main.js 2.5 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190381913819238193381943819538196381973819838199382003820138202382033820438205382063820738208382093821038211382123821338214382153821638217382183821938220382213822238223382243822538226382273822838229382303823138232382333823438235382363823738238382393824038241382423824338244382453824638247382483824938250382513825238253382543825538256382573825838259382603826138262382633826438265382663826738268382693827038271382723827338274382753827638277382783827938280382813828238283382843828538286382873828838289382903829138292382933829438295382963829738298382993830038301383023830338304383053830638307383083830938310383113831238313383143831538316383173831838319383203832138322383233832438325383263832738328383293833038331383323833338334383353833638337383383833938340383413834238343383443834538346383473834838349383503835138352383533835438355383563835738358383593836038361383623836338364383653836638367383683836938370383713837238373383743837538376383773837838379383803838138382383833838438385383863838738388383893839038391383923839338394383953839638397383983839938400384013840238403384043840538406384073840838409384103841138412384133841438415384163841738418384193842038421384223842338424384253842638427384283842938430384313843238433384343843538436384373843838439384403844138442384433844438445384463844738448384493845038451384523845338454384553845638457384583845938460384613846238463384643846538466384673846838469384703847138472384733847438475384763847738478384793848038481384823848338484384853848638487384883848938490384913849238493384943849538496384973849838499385003850138502385033850438505385063850738508385093851038511385123851338514385153851638517385183851938520385213852238523385243852538526385273852838529385303853138532385333853438535385363853738538385393854038541385423854338544385453854638547385483854938550385513855238553385543855538556385573855838559385603856138562385633856438565385663856738568385693857038571385723857338574385753857638577385783857938580385813858238583385843858538586385873858838589385903859138592385933859438595385963859738598385993860038601386023860338604386053860638607386083860938610386113861238613386143861538616386173861838619386203862138622386233862438625386263862738628386293863038631386323863338634386353863638637386383863938640386413864238643386443864538646386473864838649386503865138652386533865438655386563865738658386593866038661386623866338664386653866638667386683866938670386713867238673386743867538676386773867838679386803868138682386833868438685386863868738688386893869038691386923869338694386953869638697386983869938700387013870238703387043870538706387073870838709387103871138712387133871438715387163871738718387193872038721387223872338724387253872638727387283872938730387313873238733387343873538736387373873838739387403874138742387433874438745387463874738748387493875038751387523875338754387553875638757387583875938760387613876238763387643876538766387673876838769387703877138772387733877438775387763877738778387793878038781387823878338784387853878638787387883878938790387913879238793387943879538796387973879838799388003880138802388033880438805388063880738808388093881038811388123881338814388153881638817388183881938820388213882238823388243882538826388273882838829388303883138832388333883438835388363883738838388393884038841388423884338844388453884638847388483884938850388513885238853388543885538856388573885838859388603886138862388633886438865388663886738868388693887038871388723887338874388753887638877388783887938880388813888238883388843888538886388873888838889388903889138892388933889438895388963889738898388993890038901389023890338904389053890638907389083890938910389113891238913389143891538916389173891838919389203892138922389233892438925389263892738928389293893038931389323893338934389353893638937389383893938940389413894238943389443894538946389473894838949389503895138952389533895438955389563895738958389593896038961389623896338964389653896638967389683896938970389713897238973389743897538976389773897838979389803898138982389833898438985389863898738988389893899038991389923899338994389953899638997389983899939000390013900239003390043900539006390073900839009390103901139012390133901439015390163901739018390193902039021390223902339024390253902639027390283902939030390313903239033390343903539036390373903839039390403904139042390433904439045390463904739048390493905039051390523905339054390553905639057390583905939060390613906239063390643906539066390673906839069390703907139072390733907439075390763907739078390793908039081390823908339084390853908639087390883908939090390913909239093390943909539096390973909839099391003910139102391033910439105391063910739108391093911039111391123911339114391153911639117391183911939120391213912239123391243912539126391273912839129391303913139132391333913439135391363913739138391393914039141391423914339144391453914639147391483914939150391513915239153391543915539156391573915839159391603916139162391633916439165391663916739168391693917039171391723917339174391753917639177391783917939180391813918239183391843918539186391873918839189391903919139192391933919439195391963919739198391993920039201392023920339204392053920639207392083920939210392113921239213392143921539216392173921839219392203922139222392233922439225392263922739228392293923039231392323923339234392353923639237392383923939240392413924239243392443924539246392473924839249392503925139252392533925439255392563925739258392593926039261392623926339264392653926639267392683926939270392713927239273392743927539276392773927839279392803928139282392833928439285392863928739288392893929039291392923929339294392953929639297392983929939300393013930239303393043930539306393073930839309393103931139312393133931439315393163931739318393193932039321393223932339324393253932639327393283932939330393313933239333393343933539336393373933839339393403934139342393433934439345393463934739348393493935039351393523935339354393553935639357393583935939360393613936239363393643936539366393673936839369393703937139372393733937439375393763937739378393793938039381393823938339384393853938639387393883938939390393913939239393393943939539396393973939839399394003940139402394033940439405394063940739408394093941039411394123941339414394153941639417394183941939420394213942239423394243942539426394273942839429394303943139432394333943439435394363943739438394393944039441394423944339444394453944639447394483944939450394513945239453394543945539456394573945839459394603946139462394633946439465394663946739468394693947039471394723947339474394753947639477394783947939480394813948239483394843948539486394873948839489394903949139492394933949439495394963949739498394993950039501395023950339504395053950639507395083950939510395113951239513395143951539516395173951839519395203952139522395233952439525395263952739528395293953039531395323953339534395353953639537395383953939540395413954239543395443954539546395473954839549395503955139552395533955439555395563955739558395593956039561395623956339564395653956639567395683956939570395713957239573395743957539576395773957839579395803958139582395833958439585395863958739588395893959039591395923959339594395953959639597395983959939600396013960239603396043960539606396073960839609396103961139612396133961439615396163961739618396193962039621396223962339624396253962639627396283962939630396313963239633396343963539636396373963839639396403964139642396433964439645396463964739648396493965039651396523965339654396553965639657396583965939660396613966239663396643966539666396673966839669396703967139672396733967439675396763967739678396793968039681396823968339684396853968639687396883968939690396913969239693396943969539696396973969839699397003970139702397033970439705397063970739708397093971039711397123971339714397153971639717397183971939720397213972239723397243972539726397273972839729397303973139732397333973439735397363973739738397393974039741397423974339744397453974639747397483974939750397513975239753397543975539756397573975839759397603976139762397633976439765397663976739768397693977039771397723977339774397753977639777397783977939780397813978239783397843978539786397873978839789397903979139792397933979439795397963979739798397993980039801398023980339804398053980639807398083980939810398113981239813398143981539816398173981839819398203982139822398233982439825398263982739828398293983039831398323983339834398353983639837398383983939840398413984239843398443984539846398473984839849398503985139852398533985439855398563985739858398593986039861398623986339864398653986639867398683986939870398713987239873398743987539876398773987839879398803988139882398833988439885398863988739888398893989039891398923989339894398953989639897398983989939900399013990239903399043990539906399073990839909399103991139912399133991439915399163991739918399193992039921399223992339924399253992639927399283992939930399313993239933399343993539936399373993839939399403994139942399433994439945399463994739948399493995039951399523995339954399553995639957399583995939960399613996239963399643996539966399673996839969399703997139972399733997439975399763997739978399793998039981399823998339984399853998639987399883998939990399913999239993399943999539996399973999839999400004000140002400034000440005400064000740008400094001040011400124001340014400154001640017400184001940020400214002240023400244002540026400274002840029400304003140032400334003440035400364003740038400394004040041400424004340044400454004640047400484004940050400514005240053400544005540056400574005840059400604006140062400634006440065400664006740068400694007040071400724007340074400754007640077400784007940080400814008240083400844008540086400874008840089400904009140092400934009440095400964009740098400994010040101401024010340104401054010640107401084010940110401114011240113401144011540116401174011840119401204012140122401234012440125401264012740128401294013040131401324013340134401354013640137401384013940140401414014240143401444014540146401474014840149401504015140152401534015440155401564015740158401594016040161401624016340164401654016640167401684016940170401714017240173401744017540176401774017840179401804018140182401834018440185401864018740188401894019040191401924019340194401954019640197401984019940200402014020240203402044020540206402074020840209402104021140212402134021440215402164021740218402194022040221402224022340224402254022640227402284022940230402314023240233402344023540236402374023840239402404024140242402434024440245402464024740248402494025040251402524025340254402554025640257402584025940260402614026240263402644026540266402674026840269402704027140272402734027440275402764027740278402794028040281402824028340284402854028640287402884028940290402914029240293402944029540296402974029840299403004030140302403034030440305403064030740308403094031040311403124031340314403154031640317403184031940320403214032240323403244032540326403274032840329403304033140332403334033440335403364033740338403394034040341403424034340344403454034640347403484034940350403514035240353403544035540356403574035840359403604036140362403634036440365403664036740368403694037040371403724037340374403754037640377403784037940380403814038240383403844038540386403874038840389403904039140392403934039440395403964039740398403994040040401404024040340404404054040640407404084040940410404114041240413404144041540416404174041840419404204042140422404234042440425404264042740428404294043040431404324043340434404354043640437404384043940440404414044240443404444044540446404474044840449404504045140452404534045440455404564045740458404594046040461404624046340464404654046640467404684046940470404714047240473404744047540476404774047840479404804048140482404834048440485404864048740488404894049040491404924049340494404954049640497404984049940500405014050240503405044050540506405074050840509405104051140512405134051440515405164051740518405194052040521405224052340524405254052640527405284052940530405314053240533405344053540536405374053840539405404054140542405434054440545405464054740548405494055040551405524055340554405554055640557405584055940560405614056240563405644056540566405674056840569405704057140572405734057440575405764057740578405794058040581405824058340584405854058640587405884058940590405914059240593405944059540596405974059840599406004060140602406034060440605406064060740608406094061040611406124061340614406154061640617406184061940620406214062240623406244062540626406274062840629406304063140632406334063440635406364063740638406394064040641406424064340644406454064640647406484064940650406514065240653406544065540656406574065840659406604066140662406634066440665406664066740668406694067040671406724067340674406754067640677406784067940680406814068240683406844068540686406874068840689406904069140692406934069440695406964069740698406994070040701407024070340704407054070640707407084070940710407114071240713407144071540716407174071840719407204072140722407234072440725407264072740728407294073040731407324073340734407354073640737407384073940740407414074240743407444074540746407474074840749407504075140752407534075440755407564075740758407594076040761407624076340764407654076640767407684076940770407714077240773407744077540776407774077840779407804078140782407834078440785407864078740788407894079040791407924079340794407954079640797407984079940800408014080240803408044080540806408074080840809408104081140812408134081440815408164081740818408194082040821408224082340824408254082640827408284082940830408314083240833408344083540836408374083840839408404084140842408434084440845408464084740848408494085040851408524085340854408554085640857408584085940860408614086240863408644086540866408674086840869408704087140872408734087440875408764087740878408794088040881408824088340884408854088640887408884088940890408914089240893408944089540896408974089840899409004090140902409034090440905409064090740908409094091040911409124091340914409154091640917409184091940920409214092240923409244092540926409274092840929409304093140932409334093440935409364093740938409394094040941409424094340944409454094640947409484094940950409514095240953409544095540956409574095840959409604096140962409634096440965409664096740968409694097040971409724097340974409754097640977409784097940980409814098240983409844098540986409874098840989409904099140992409934099440995409964099740998409994100041001410024100341004410054100641007410084100941010410114101241013410144101541016410174101841019410204102141022410234102441025410264102741028410294103041031410324103341034410354103641037410384103941040410414104241043410444104541046410474104841049410504105141052410534105441055410564105741058410594106041061410624106341064410654106641067410684106941070410714107241073410744107541076410774107841079410804108141082410834108441085410864108741088410894109041091410924109341094410954109641097410984109941100411014110241103411044110541106411074110841109411104111141112411134111441115411164111741118411194112041121411224112341124411254112641127411284112941130411314113241133411344113541136411374113841139411404114141142411434114441145411464114741148411494115041151411524115341154411554115641157411584115941160411614116241163411644116541166411674116841169411704117141172411734117441175411764117741178411794118041181411824118341184411854118641187411884118941190411914119241193411944119541196411974119841199412004120141202412034120441205412064120741208412094121041211412124121341214412154121641217412184121941220412214122241223412244122541226412274122841229412304123141232412334123441235412364123741238412394124041241412424124341244412454124641247412484124941250412514125241253412544125541256412574125841259412604126141262412634126441265412664126741268412694127041271412724127341274412754127641277412784127941280412814128241283412844128541286412874128841289412904129141292412934129441295412964129741298412994130041301413024130341304413054130641307413084130941310413114131241313413144131541316413174131841319413204132141322413234132441325413264132741328413294133041331413324133341334413354133641337413384133941340413414134241343413444134541346413474134841349413504135141352413534135441355413564135741358413594136041361413624136341364413654136641367413684136941370413714137241373413744137541376413774137841379413804138141382413834138441385413864138741388413894139041391413924139341394413954139641397413984139941400414014140241403414044140541406414074140841409414104141141412414134141441415414164141741418414194142041421414224142341424414254142641427414284142941430414314143241433414344143541436414374143841439414404144141442414434144441445414464144741448414494145041451414524145341454414554145641457414584145941460414614146241463414644146541466414674146841469414704147141472414734147441475414764147741478414794148041481414824148341484414854148641487414884148941490414914149241493414944149541496414974149841499415004150141502415034150441505415064150741508415094151041511415124151341514415154151641517415184151941520415214152241523415244152541526415274152841529415304153141532415334153441535415364153741538415394154041541415424154341544415454154641547415484154941550415514155241553415544155541556415574155841559415604156141562415634156441565415664156741568415694157041571415724157341574415754157641577415784157941580415814158241583415844158541586415874158841589415904159141592415934159441595415964159741598415994160041601416024160341604416054160641607416084160941610416114161241613416144161541616416174161841619416204162141622416234162441625416264162741628416294163041631416324163341634416354163641637416384163941640416414164241643416444164541646416474164841649416504165141652416534165441655416564165741658416594166041661416624166341664416654166641667416684166941670416714167241673416744167541676416774167841679416804168141682416834168441685416864168741688416894169041691416924169341694416954169641697416984169941700417014170241703417044170541706417074170841709417104171141712417134171441715417164171741718417194172041721417224172341724417254172641727417284172941730417314173241733417344173541736417374173841739417404174141742417434174441745417464174741748417494175041751417524175341754417554175641757417584175941760417614176241763417644176541766417674176841769417704177141772417734177441775417764177741778417794178041781417824178341784417854178641787417884178941790417914179241793417944179541796417974179841799418004180141802418034180441805418064180741808418094181041811418124181341814418154181641817418184181941820418214182241823418244182541826418274182841829418304183141832418334183441835418364183741838418394184041841418424184341844418454184641847418484184941850418514185241853418544185541856418574185841859418604186141862418634186441865418664186741868418694187041871418724187341874418754187641877418784187941880418814188241883418844188541886418874188841889418904189141892418934189441895418964189741898418994190041901419024190341904419054190641907419084190941910419114191241913419144191541916419174191841919419204192141922419234192441925419264192741928419294193041931419324193341934419354193641937419384193941940419414194241943419444194541946419474194841949419504195141952419534195441955419564195741958419594196041961419624196341964419654196641967419684196941970419714197241973419744197541976419774197841979419804198141982419834198441985419864198741988419894199041991419924199341994419954199641997419984199942000420014200242003420044200542006420074200842009420104201142012420134201442015420164201742018420194202042021420224202342024420254202642027420284202942030420314203242033420344203542036420374203842039420404204142042420434204442045420464204742048420494205042051420524205342054420554205642057420584205942060420614206242063420644206542066420674206842069420704207142072420734207442075420764207742078420794208042081420824208342084420854208642087420884208942090420914209242093420944209542096420974209842099421004210142102421034210442105421064210742108421094211042111421124211342114421154211642117421184211942120421214212242123421244212542126421274212842129421304213142132421334213442135421364213742138421394214042141421424214342144421454214642147421484214942150421514215242153421544215542156421574215842159421604216142162421634216442165421664216742168421694217042171421724217342174421754217642177421784217942180421814218242183421844218542186421874218842189421904219142192421934219442195421964219742198421994220042201422024220342204422054220642207422084220942210422114221242213422144221542216422174221842219422204222142222422234222442225422264222742228422294223042231422324223342234422354223642237422384223942240422414224242243422444224542246422474224842249422504225142252422534225442255422564225742258422594226042261422624226342264422654226642267422684226942270422714227242273422744227542276422774227842279422804228142282422834228442285422864228742288422894229042291422924229342294422954229642297422984229942300423014230242303423044230542306423074230842309423104231142312423134231442315423164231742318423194232042321423224232342324423254232642327423284232942330423314233242333423344233542336423374233842339423404234142342423434234442345423464234742348423494235042351423524235342354423554235642357423584235942360423614236242363423644236542366423674236842369423704237142372423734237442375423764237742378423794238042381423824238342384423854238642387423884238942390423914239242393423944239542396423974239842399424004240142402424034240442405424064240742408424094241042411424124241342414424154241642417424184241942420424214242242423424244242542426424274242842429424304243142432424334243442435424364243742438424394244042441424424244342444424454244642447424484244942450424514245242453424544245542456424574245842459424604246142462424634246442465424664246742468424694247042471424724247342474424754247642477424784247942480424814248242483424844248542486424874248842489424904249142492424934249442495424964249742498424994250042501425024250342504425054250642507425084250942510425114251242513425144251542516425174251842519425204252142522425234252442525425264252742528425294253042531425324253342534425354253642537425384253942540425414254242543425444254542546425474254842549425504255142552425534255442555425564255742558425594256042561425624256342564425654256642567425684256942570425714257242573425744257542576425774257842579425804258142582425834258442585425864258742588425894259042591425924259342594425954259642597425984259942600426014260242603426044260542606426074260842609426104261142612426134261442615426164261742618426194262042621426224262342624426254262642627426284262942630426314263242633426344263542636426374263842639426404264142642426434264442645426464264742648426494265042651426524265342654426554265642657426584265942660426614266242663426644266542666426674266842669426704267142672426734267442675426764267742678426794268042681426824268342684426854268642687426884268942690426914269242693426944269542696426974269842699427004270142702427034270442705427064270742708427094271042711427124271342714427154271642717427184271942720427214272242723427244272542726427274272842729427304273142732427334273442735427364273742738427394274042741427424274342744427454274642747427484274942750427514275242753427544275542756427574275842759427604276142762427634276442765427664276742768427694277042771427724277342774427754277642777427784277942780427814278242783427844278542786427874278842789427904279142792427934279442795427964279742798427994280042801428024280342804428054280642807428084280942810428114281242813428144281542816428174281842819428204282142822428234282442825428264282742828428294283042831428324283342834428354283642837428384283942840428414284242843428444284542846428474284842849428504285142852428534285442855428564285742858428594286042861428624286342864428654286642867428684286942870428714287242873428744287542876428774287842879428804288142882428834288442885428864288742888428894289042891428924289342894428954289642897428984289942900429014290242903429044290542906429074290842909429104291142912429134291442915429164291742918429194292042921429224292342924429254292642927429284292942930429314293242933429344293542936429374293842939429404294142942429434294442945429464294742948429494295042951429524295342954429554295642957429584295942960429614296242963429644296542966429674296842969429704297142972429734297442975429764297742978429794298042981429824298342984429854298642987429884298942990429914299242993429944299542996429974299842999430004300143002430034300443005430064300743008430094301043011430124301343014430154301643017430184301943020430214302243023430244302543026430274302843029430304303143032430334303443035430364303743038430394304043041430424304343044430454304643047430484304943050430514305243053430544305543056430574305843059430604306143062430634306443065430664306743068430694307043071430724307343074430754307643077430784307943080430814308243083430844308543086430874308843089430904309143092430934309443095430964309743098430994310043101431024310343104431054310643107431084310943110431114311243113431144311543116431174311843119431204312143122431234312443125431264312743128431294313043131431324313343134431354313643137431384313943140431414314243143431444314543146431474314843149431504315143152431534315443155431564315743158431594316043161431624316343164431654316643167431684316943170431714317243173431744317543176431774317843179431804318143182431834318443185431864318743188431894319043191431924319343194431954319643197431984319943200432014320243203432044320543206432074320843209432104321143212432134321443215432164321743218432194322043221432224322343224432254322643227432284322943230432314323243233432344323543236432374323843239432404324143242432434324443245432464324743248432494325043251432524325343254432554325643257432584325943260432614326243263432644326543266432674326843269432704327143272432734327443275432764327743278432794328043281432824328343284432854328643287432884328943290432914329243293432944329543296432974329843299433004330143302433034330443305433064330743308433094331043311433124331343314433154331643317433184331943320433214332243323433244332543326433274332843329433304333143332433334333443335433364333743338433394334043341433424334343344433454334643347433484334943350433514335243353433544335543356433574335843359433604336143362433634336443365433664336743368433694337043371433724337343374433754337643377433784337943380433814338243383433844338543386433874338843389433904339143392433934339443395433964339743398433994340043401434024340343404434054340643407434084340943410434114341243413434144341543416434174341843419434204342143422434234342443425434264342743428434294343043431434324343343434434354343643437434384343943440434414344243443434444344543446434474344843449434504345143452434534345443455434564345743458434594346043461434624346343464434654346643467434684346943470434714347243473434744347543476434774347843479434804348143482434834348443485434864348743488434894349043491434924349343494434954349643497434984349943500435014350243503435044350543506435074350843509435104351143512435134351443515435164351743518435194352043521435224352343524435254352643527435284352943530435314353243533435344353543536435374353843539435404354143542435434354443545435464354743548435494355043551435524355343554435554355643557435584355943560435614356243563435644356543566435674356843569435704357143572435734357443575435764357743578435794358043581435824358343584435854358643587435884358943590435914359243593435944359543596435974359843599436004360143602436034360443605436064360743608436094361043611436124361343614436154361643617436184361943620436214362243623436244362543626436274362843629436304363143632436334363443635436364363743638436394364043641436424364343644436454364643647436484364943650436514365243653436544365543656436574365843659436604366143662436634366443665436664366743668436694367043671436724367343674436754367643677436784367943680436814368243683436844368543686436874368843689436904369143692436934369443695436964369743698436994370043701437024370343704437054370643707437084370943710437114371243713437144371543716437174371843719437204372143722437234372443725437264372743728437294373043731437324373343734437354373643737437384373943740437414374243743437444374543746437474374843749437504375143752437534375443755437564375743758437594376043761437624376343764437654376643767437684376943770437714377243773437744377543776437774377843779437804378143782437834378443785437864378743788437894379043791437924379343794437954379643797437984379943800438014380243803438044380543806438074380843809438104381143812438134381443815438164381743818438194382043821438224382343824438254382643827438284382943830438314383243833438344383543836438374383843839438404384143842438434384443845438464384743848438494385043851438524385343854438554385643857438584385943860438614386243863438644386543866438674386843869438704387143872438734387443875438764387743878438794388043881438824388343884438854388643887438884388943890438914389243893438944389543896438974389843899439004390143902439034390443905439064390743908439094391043911439124391343914439154391643917439184391943920439214392243923439244392543926439274392843929439304393143932439334393443935439364393743938439394394043941439424394343944439454394643947439484394943950439514395243953439544395543956439574395843959439604396143962439634396443965439664396743968439694397043971439724397343974439754397643977439784397943980439814398243983439844398543986439874398843989439904399143992439934399443995439964399743998439994400044001440024400344004440054400644007440084400944010440114401244013440144401544016440174401844019440204402144022440234402444025440264402744028440294403044031440324403344034440354403644037440384403944040440414404244043440444404544046440474404844049440504405144052440534405444055440564405744058440594406044061440624406344064440654406644067440684406944070440714407244073440744407544076440774407844079440804408144082440834408444085440864408744088440894409044091440924409344094440954409644097440984409944100441014410244103441044410544106441074410844109441104411144112441134411444115441164411744118441194412044121441224412344124441254412644127441284412944130441314413244133441344413544136441374413844139441404414144142441434414444145441464414744148441494415044151441524415344154441554415644157441584415944160441614416244163441644416544166441674416844169441704417144172441734417444175441764417744178441794418044181441824418344184441854418644187441884418944190441914419244193441944419544196441974419844199442004420144202442034420444205442064420744208442094421044211442124421344214442154421644217442184421944220442214422244223442244422544226442274422844229442304423144232442334423444235442364423744238442394424044241442424424344244442454424644247442484424944250442514425244253442544425544256442574425844259442604426144262442634426444265442664426744268442694427044271442724427344274442754427644277442784427944280442814428244283442844428544286442874428844289442904429144292442934429444295442964429744298442994430044301443024430344304443054430644307443084430944310443114431244313443144431544316443174431844319443204432144322443234432444325443264432744328443294433044331443324433344334443354433644337443384433944340443414434244343443444434544346443474434844349443504435144352443534435444355443564435744358443594436044361443624436344364443654436644367443684436944370443714437244373443744437544376443774437844379443804438144382443834438444385443864438744388443894439044391443924439344394443954439644397443984439944400444014440244403444044440544406444074440844409444104441144412444134441444415444164441744418444194442044421444224442344424444254442644427444284442944430444314443244433444344443544436444374443844439444404444144442444434444444445444464444744448444494445044451444524445344454444554445644457444584445944460444614446244463444644446544466444674446844469444704447144472444734447444475444764447744478444794448044481444824448344484444854448644487444884448944490444914449244493444944449544496444974449844499445004450144502445034450444505445064450744508445094451044511445124451344514445154451644517445184451944520445214452244523445244452544526445274452844529445304453144532445334453444535445364453744538445394454044541445424454344544445454454644547445484454944550445514455244553445544455544556445574455844559445604456144562445634456444565445664456744568445694457044571445724457344574445754457644577445784457944580445814458244583445844458544586445874458844589445904459144592445934459444595445964459744598445994460044601446024460344604446054460644607446084460944610446114461244613446144461544616446174461844619446204462144622446234462444625446264462744628446294463044631446324463344634446354463644637446384463944640446414464244643446444464544646446474464844649446504465144652446534465444655446564465744658446594466044661446624466344664446654466644667446684466944670446714467244673446744467544676446774467844679446804468144682446834468444685446864468744688446894469044691446924469344694446954469644697446984469944700447014470244703447044470544706447074470844709447104471144712447134471444715447164471744718447194472044721447224472344724447254472644727447284472944730447314473244733447344473544736447374473844739447404474144742447434474444745447464474744748447494475044751447524475344754447554475644757447584475944760447614476244763447644476544766447674476844769447704477144772447734477444775447764477744778447794478044781447824478344784447854478644787447884478944790447914479244793447944479544796447974479844799448004480144802448034480444805448064480744808448094481044811448124481344814448154481644817448184481944820448214482244823448244482544826448274482844829448304483144832448334483444835448364483744838448394484044841448424484344844448454484644847448484484944850448514485244853448544485544856448574485844859448604486144862448634486444865448664486744868448694487044871448724487344874448754487644877448784487944880448814488244883448844488544886448874488844889448904489144892448934489444895448964489744898448994490044901449024490344904449054490644907449084490944910449114491244913449144491544916449174491844919449204492144922449234492444925449264492744928449294493044931449324493344934449354493644937449384493944940449414494244943449444494544946449474494844949449504495144952449534495444955449564495744958449594496044961449624496344964449654496644967449684496944970449714497244973449744497544976449774497844979449804498144982449834498444985449864498744988449894499044991449924499344994449954499644997449984499945000450014500245003450044500545006450074500845009450104501145012450134501445015450164501745018450194502045021450224502345024450254502645027450284502945030450314503245033450344503545036450374503845039450404504145042450434504445045450464504745048450494505045051450524505345054450554505645057450584505945060450614506245063450644506545066450674506845069450704507145072450734507445075450764507745078450794508045081450824508345084450854508645087450884508945090450914509245093450944509545096450974509845099451004510145102451034510445105451064510745108451094511045111451124511345114451154511645117451184511945120451214512245123451244512545126451274512845129451304513145132451334513445135451364513745138451394514045141451424514345144451454514645147451484514945150451514515245153451544515545156451574515845159451604516145162451634516445165451664516745168451694517045171451724517345174451754517645177451784517945180451814518245183451844518545186451874518845189451904519145192451934519445195451964519745198451994520045201452024520345204452054520645207452084520945210452114521245213452144521545216452174521845219452204522145222452234522445225452264522745228452294523045231452324523345234452354523645237452384523945240452414524245243452444524545246452474524845249452504525145252452534525445255452564525745258452594526045261452624526345264452654526645267452684526945270452714527245273452744527545276452774527845279452804528145282452834528445285452864528745288452894529045291452924529345294452954529645297452984529945300453014530245303453044530545306453074530845309453104531145312453134531445315453164531745318453194532045321453224532345324453254532645327453284532945330453314533245333453344533545336453374533845339453404534145342453434534445345453464534745348453494535045351453524535345354453554535645357453584535945360453614536245363453644536545366453674536845369453704537145372453734537445375453764537745378453794538045381453824538345384453854538645387453884538945390453914539245393453944539545396453974539845399454004540145402454034540445405454064540745408454094541045411454124541345414454154541645417454184541945420454214542245423454244542545426454274542845429454304543145432454334543445435454364543745438454394544045441454424544345444454454544645447454484544945450454514545245453454544545545456454574545845459454604546145462454634546445465454664546745468454694547045471454724547345474454754547645477454784547945480454814548245483454844548545486454874548845489454904549145492454934549445495454964549745498454994550045501455024550345504455054550645507455084550945510455114551245513455144551545516455174551845519455204552145522455234552445525455264552745528455294553045531455324553345534455354553645537455384553945540455414554245543455444554545546455474554845549455504555145552455534555445555455564555745558455594556045561455624556345564455654556645567455684556945570455714557245573455744557545576455774557845579455804558145582455834558445585455864558745588455894559045591455924559345594455954559645597455984559945600456014560245603456044560545606456074560845609456104561145612456134561445615456164561745618456194562045621456224562345624456254562645627456284562945630456314563245633456344563545636456374563845639456404564145642456434564445645456464564745648456494565045651456524565345654456554565645657456584565945660456614566245663456644566545666456674566845669456704567145672456734567445675456764567745678456794568045681456824568345684456854568645687456884568945690456914569245693456944569545696456974569845699457004570145702457034570445705457064570745708457094571045711457124571345714457154571645717457184571945720457214572245723457244572545726457274572845729457304573145732457334573445735457364573745738457394574045741457424574345744457454574645747457484574945750457514575245753457544575545756457574575845759457604576145762457634576445765457664576745768457694577045771457724577345774457754577645777457784577945780457814578245783457844578545786457874578845789457904579145792457934579445795457964579745798457994580045801458024580345804458054580645807458084580945810458114581245813458144581545816458174581845819458204582145822458234582445825458264582745828458294583045831458324583345834458354583645837458384583945840458414584245843458444584545846458474584845849458504585145852458534585445855458564585745858458594586045861458624586345864458654586645867458684586945870458714587245873458744587545876458774587845879458804588145882458834588445885458864588745888458894589045891458924589345894458954589645897458984589945900459014590245903459044590545906459074590845909459104591145912459134591445915459164591745918459194592045921459224592345924459254592645927459284592945930459314593245933459344593545936459374593845939459404594145942459434594445945459464594745948459494595045951459524595345954459554595645957459584595945960459614596245963459644596545966459674596845969459704597145972459734597445975459764597745978459794598045981459824598345984459854598645987459884598945990459914599245993459944599545996459974599845999460004600146002460034600446005460064600746008460094601046011460124601346014460154601646017460184601946020460214602246023460244602546026460274602846029460304603146032460334603446035460364603746038460394604046041460424604346044460454604646047460484604946050460514605246053460544605546056460574605846059460604606146062460634606446065460664606746068460694607046071460724607346074460754607646077460784607946080460814608246083460844608546086460874608846089460904609146092460934609446095460964609746098460994610046101461024610346104461054610646107461084610946110461114611246113461144611546116461174611846119461204612146122461234612446125461264612746128461294613046131461324613346134461354613646137461384613946140461414614246143461444614546146461474614846149461504615146152461534615446155461564615746158461594616046161461624616346164461654616646167461684616946170461714617246173461744617546176461774617846179461804618146182461834618446185461864618746188461894619046191461924619346194461954619646197461984619946200462014620246203462044620546206462074620846209462104621146212462134621446215462164621746218462194622046221462224622346224462254622646227462284622946230462314623246233462344623546236462374623846239462404624146242462434624446245462464624746248462494625046251462524625346254462554625646257462584625946260462614626246263462644626546266462674626846269462704627146272462734627446275462764627746278462794628046281462824628346284462854628646287462884628946290462914629246293462944629546296462974629846299463004630146302463034630446305463064630746308463094631046311463124631346314463154631646317463184631946320463214632246323463244632546326463274632846329463304633146332463334633446335463364633746338463394634046341463424634346344463454634646347463484634946350463514635246353463544635546356463574635846359463604636146362463634636446365463664636746368463694637046371463724637346374463754637646377463784637946380463814638246383463844638546386463874638846389463904639146392463934639446395463964639746398463994640046401464024640346404464054640646407464084640946410464114641246413464144641546416464174641846419464204642146422464234642446425464264642746428464294643046431464324643346434464354643646437464384643946440464414644246443464444644546446464474644846449464504645146452464534645446455464564645746458464594646046461464624646346464464654646646467464684646946470464714647246473464744647546476464774647846479464804648146482464834648446485464864648746488464894649046491464924649346494464954649646497464984649946500465014650246503465044650546506465074650846509465104651146512465134651446515465164651746518465194652046521465224652346524465254652646527465284652946530465314653246533465344653546536465374653846539465404654146542465434654446545465464654746548465494655046551465524655346554465554655646557465584655946560465614656246563465644656546566465674656846569465704657146572465734657446575465764657746578465794658046581465824658346584465854658646587465884658946590465914659246593465944659546596465974659846599466004660146602466034660446605466064660746608466094661046611466124661346614466154661646617466184661946620466214662246623466244662546626466274662846629466304663146632466334663446635466364663746638466394664046641466424664346644466454664646647466484664946650466514665246653466544665546656466574665846659466604666146662466634666446665466664666746668466694667046671466724667346674466754667646677466784667946680466814668246683466844668546686466874668846689466904669146692466934669446695466964669746698466994670046701467024670346704467054670646707467084670946710467114671246713467144671546716467174671846719467204672146722467234672446725467264672746728467294673046731467324673346734467354673646737467384673946740467414674246743467444674546746467474674846749467504675146752467534675446755467564675746758467594676046761467624676346764467654676646767467684676946770467714677246773467744677546776467774677846779467804678146782467834678446785467864678746788467894679046791467924679346794467954679646797467984679946800468014680246803468044680546806468074680846809468104681146812468134681446815468164681746818468194682046821468224682346824468254682646827468284682946830468314683246833468344683546836468374683846839468404684146842468434684446845468464684746848468494685046851468524685346854468554685646857468584685946860468614686246863468644686546866468674686846869468704687146872468734687446875468764687746878468794688046881468824688346884468854688646887468884688946890468914689246893468944689546896468974689846899469004690146902469034690446905469064690746908469094691046911469124691346914469154691646917469184691946920469214692246923469244692546926469274692846929469304693146932469334693446935469364693746938469394694046941469424694346944469454694646947469484694946950469514695246953469544695546956469574695846959469604696146962469634696446965469664696746968469694697046971469724697346974469754697646977469784697946980469814698246983469844698546986469874698846989469904699146992469934699446995469964699746998469994700047001470024700347004470054700647007470084700947010470114701247013470144701547016470174701847019470204702147022470234702447025470264702747028470294703047031470324703347034470354703647037470384703947040470414704247043470444704547046470474704847049470504705147052470534705447055470564705747058470594706047061470624706347064470654706647067470684706947070470714707247073470744707547076470774707847079470804708147082470834708447085470864708747088470894709047091470924709347094470954709647097470984709947100471014710247103471044710547106471074710847109471104711147112471134711447115471164711747118471194712047121471224712347124471254712647127471284712947130471314713247133471344713547136471374713847139471404714147142471434714447145471464714747148471494715047151471524715347154471554715647157471584715947160471614716247163471644716547166471674716847169471704717147172471734717447175471764717747178471794718047181471824718347184471854718647187471884718947190471914719247193471944719547196471974719847199472004720147202472034720447205472064720747208472094721047211472124721347214472154721647217472184721947220472214722247223472244722547226472274722847229472304723147232472334723447235472364723747238472394724047241472424724347244472454724647247472484724947250472514725247253472544725547256472574725847259472604726147262472634726447265472664726747268472694727047271472724727347274472754727647277472784727947280472814728247283472844728547286472874728847289472904729147292472934729447295472964729747298472994730047301473024730347304473054730647307473084730947310473114731247313473144731547316473174731847319473204732147322473234732447325473264732747328473294733047331473324733347334473354733647337473384733947340473414734247343473444734547346473474734847349473504735147352473534735447355473564735747358473594736047361473624736347364473654736647367473684736947370473714737247373473744737547376473774737847379473804738147382473834738447385473864738747388473894739047391473924739347394473954739647397473984739947400474014740247403474044740547406474074740847409474104741147412474134741447415474164741747418474194742047421474224742347424474254742647427474284742947430474314743247433474344743547436474374743847439474404744147442474434744447445474464744747448474494745047451474524745347454474554745647457474584745947460474614746247463474644746547466474674746847469474704747147472474734747447475474764747747478474794748047481474824748347484474854748647487474884748947490474914749247493474944749547496474974749847499475004750147502475034750447505475064750747508475094751047511475124751347514475154751647517475184751947520475214752247523475244752547526475274752847529475304753147532475334753447535475364753747538475394754047541475424754347544475454754647547475484754947550475514755247553475544755547556475574755847559475604756147562475634756447565475664756747568475694757047571475724757347574475754757647577475784757947580475814758247583475844758547586475874758847589475904759147592475934759447595475964759747598475994760047601476024760347604476054760647607476084760947610476114761247613476144761547616476174761847619476204762147622476234762447625476264762747628476294763047631476324763347634476354763647637476384763947640476414764247643476444764547646476474764847649476504765147652476534765447655476564765747658476594766047661476624766347664476654766647667476684766947670476714767247673476744767547676476774767847679476804768147682476834768447685476864768747688476894769047691476924769347694476954769647697476984769947700477014770247703477044770547706477074770847709477104771147712477134771447715477164771747718477194772047721477224772347724477254772647727477284772947730477314773247733477344773547736477374773847739477404774147742477434774447745477464774747748477494775047751477524775347754477554775647757477584775947760477614776247763477644776547766477674776847769477704777147772477734777447775477764777747778477794778047781477824778347784477854778647787477884778947790477914779247793477944779547796477974779847799478004780147802478034780447805478064780747808478094781047811478124781347814478154781647817478184781947820478214782247823478244782547826478274782847829478304783147832478334783447835478364783747838478394784047841478424784347844478454784647847478484784947850478514785247853478544785547856478574785847859478604786147862478634786447865478664786747868478694787047871478724787347874478754787647877478784787947880478814788247883478844788547886478874788847889478904789147892478934789447895478964789747898478994790047901479024790347904479054790647907479084790947910479114791247913479144791547916479174791847919479204792147922479234792447925479264792747928479294793047931479324793347934479354793647937479384793947940479414794247943479444794547946479474794847949479504795147952479534795447955479564795747958479594796047961479624796347964479654796647967479684796947970479714797247973479744797547976479774797847979479804798147982479834798447985479864798747988479894799047991479924799347994479954799647997479984799948000480014800248003480044800548006480074800848009480104801148012480134801448015480164801748018480194802048021480224802348024480254802648027480284802948030480314803248033480344803548036480374803848039480404804148042480434804448045480464804748048480494805048051480524805348054480554805648057480584805948060480614806248063480644806548066480674806848069480704807148072480734807448075480764807748078480794808048081480824808348084480854808648087480884808948090480914809248093480944809548096480974809848099481004810148102481034810448105481064810748108481094811048111481124811348114481154811648117481184811948120481214812248123481244812548126481274812848129481304813148132481334813448135481364813748138481394814048141481424814348144481454814648147481484814948150481514815248153481544815548156481574815848159481604816148162481634816448165481664816748168481694817048171481724817348174481754817648177481784817948180481814818248183481844818548186481874818848189481904819148192481934819448195481964819748198481994820048201482024820348204482054820648207482084820948210482114821248213482144821548216482174821848219482204822148222482234822448225482264822748228482294823048231482324823348234482354823648237482384823948240482414824248243482444824548246482474824848249482504825148252482534825448255482564825748258482594826048261482624826348264482654826648267482684826948270482714827248273482744827548276482774827848279482804828148282482834828448285482864828748288482894829048291482924829348294482954829648297482984829948300483014830248303483044830548306483074830848309483104831148312483134831448315483164831748318483194832048321483224832348324483254832648327483284832948330483314833248333483344833548336483374833848339483404834148342483434834448345483464834748348483494835048351483524835348354483554835648357483584835948360483614836248363483644836548366483674836848369483704837148372483734837448375483764837748378483794838048381483824838348384483854838648387483884838948390483914839248393483944839548396483974839848399484004840148402484034840448405484064840748408484094841048411484124841348414484154841648417484184841948420484214842248423484244842548426484274842848429484304843148432484334843448435484364843748438484394844048441484424844348444484454844648447484484844948450484514845248453484544845548456484574845848459484604846148462484634846448465484664846748468484694847048471484724847348474484754847648477484784847948480484814848248483484844848548486484874848848489484904849148492484934849448495484964849748498484994850048501485024850348504485054850648507485084850948510485114851248513485144851548516485174851848519485204852148522485234852448525485264852748528485294853048531485324853348534485354853648537485384853948540485414854248543485444854548546485474854848549485504855148552485534855448555485564855748558485594856048561485624856348564485654856648567485684856948570485714857248573485744857548576485774857848579485804858148582485834858448585485864858748588485894859048591485924859348594485954859648597485984859948600486014860248603486044860548606486074860848609486104861148612486134861448615486164861748618486194862048621486224862348624486254862648627486284862948630486314863248633486344863548636486374863848639486404864148642486434864448645486464864748648486494865048651486524865348654486554865648657486584865948660486614866248663486644866548666486674866848669486704867148672486734867448675486764867748678486794868048681486824868348684486854868648687486884868948690486914869248693486944869548696486974869848699487004870148702487034870448705487064870748708487094871048711487124871348714487154871648717487184871948720487214872248723487244872548726487274872848729487304873148732487334873448735487364873748738487394874048741487424874348744487454874648747487484874948750487514875248753487544875548756487574875848759487604876148762487634876448765487664876748768487694877048771487724877348774487754877648777487784877948780487814878248783487844878548786487874878848789487904879148792487934879448795487964879748798487994880048801488024880348804488054880648807488084880948810488114881248813488144881548816488174881848819488204882148822488234882448825488264882748828488294883048831488324883348834488354883648837488384883948840488414884248843488444884548846488474884848849488504885148852488534885448855488564885748858488594886048861488624886348864488654886648867488684886948870488714887248873488744887548876488774887848879488804888148882488834888448885488864888748888488894889048891488924889348894488954889648897488984889948900489014890248903489044890548906489074890848909489104891148912489134891448915489164891748918489194892048921489224892348924489254892648927489284892948930489314893248933489344893548936489374893848939489404894148942489434894448945489464894748948489494895048951489524895348954489554895648957489584895948960489614896248963489644896548966489674896848969489704897148972489734897448975489764897748978489794898048981489824898348984489854898648987489884898948990489914899248993489944899548996489974899848999490004900149002490034900449005490064900749008490094901049011490124901349014490154901649017490184901949020490214902249023490244902549026490274902849029490304903149032490334903449035490364903749038490394904049041490424904349044490454904649047490484904949050490514905249053490544905549056490574905849059490604906149062490634906449065490664906749068490694907049071490724907349074490754907649077490784907949080490814908249083490844908549086490874908849089490904909149092490934909449095490964909749098490994910049101491024910349104491054910649107491084910949110491114911249113491144911549116491174911849119491204912149122491234912449125491264912749128491294913049131491324913349134491354913649137491384913949140491414914249143491444914549146491474914849149491504915149152491534915449155491564915749158491594916049161491624916349164491654916649167491684916949170491714917249173491744917549176491774917849179491804918149182491834918449185491864918749188491894919049191491924919349194491954919649197491984919949200492014920249203492044920549206492074920849209492104921149212492134921449215492164921749218492194922049221492224922349224492254922649227492284922949230492314923249233492344923549236492374923849239492404924149242492434924449245492464924749248492494925049251492524925349254492554925649257492584925949260492614926249263492644926549266492674926849269492704927149272492734927449275492764927749278492794928049281492824928349284492854928649287492884928949290492914929249293492944929549296492974929849299493004930149302493034930449305493064930749308493094931049311493124931349314493154931649317493184931949320493214932249323493244932549326493274932849329493304933149332493334933449335493364933749338493394934049341493424934349344493454934649347493484934949350493514935249353493544935549356493574935849359493604936149362493634936449365493664936749368493694937049371493724937349374493754937649377493784937949380493814938249383493844938549386493874938849389493904939149392493934939449395493964939749398493994940049401494024940349404494054940649407494084940949410494114941249413494144941549416494174941849419494204942149422494234942449425494264942749428494294943049431494324943349434494354943649437494384943949440494414944249443494444944549446494474944849449494504945149452494534945449455494564945749458494594946049461494624946349464494654946649467494684946949470494714947249473494744947549476494774947849479494804948149482494834948449485494864948749488494894949049491494924949349494494954949649497494984949949500495014950249503495044950549506495074950849509495104951149512495134951449515495164951749518495194952049521495224952349524495254952649527495284952949530495314953249533495344953549536495374953849539495404954149542495434954449545495464954749548495494955049551495524955349554495554955649557495584955949560495614956249563495644956549566495674956849569495704957149572495734957449575495764957749578495794958049581495824958349584495854958649587495884958949590495914959249593495944959549596495974959849599496004960149602496034960449605496064960749608496094961049611496124961349614496154961649617496184961949620496214962249623496244962549626496274962849629496304963149632496334963449635496364963749638496394964049641496424964349644496454964649647496484964949650496514965249653496544965549656496574965849659496604966149662496634966449665496664966749668496694967049671496724967349674496754967649677496784967949680496814968249683496844968549686496874968849689496904969149692496934969449695496964969749698496994970049701497024970349704497054970649707497084970949710497114971249713497144971549716497174971849719497204972149722497234972449725497264972749728497294973049731497324973349734497354973649737497384973949740497414974249743497444974549746497474974849749497504975149752497534975449755497564975749758497594976049761497624976349764497654976649767497684976949770497714977249773497744977549776497774977849779497804978149782497834978449785497864978749788497894979049791497924979349794497954979649797497984979949800498014980249803498044980549806498074980849809498104981149812498134981449815498164981749818498194982049821498224982349824498254982649827498284982949830498314983249833498344983549836498374983849839498404984149842498434984449845498464984749848498494985049851498524985349854498554985649857498584985949860498614986249863498644986549866498674986849869498704987149872498734987449875498764987749878498794988049881498824988349884498854988649887498884988949890498914989249893498944989549896498974989849899499004990149902499034990449905499064990749908499094991049911499124991349914499154991649917499184991949920499214992249923499244992549926499274992849929499304993149932499334993449935499364993749938499394994049941499424994349944499454994649947499484994949950499514995249953499544995549956499574995849959499604996149962499634996449965499664996749968499694997049971499724997349974499754997649977499784997949980499814998249983499844998549986499874998849989499904999149992499934999449995499964999749998499995000050001500025000350004500055000650007500085000950010500115001250013500145001550016500175001850019500205002150022500235002450025500265002750028500295003050031500325003350034500355003650037500385003950040500415004250043500445004550046500475004850049500505005150052500535005450055500565005750058500595006050061500625006350064500655006650067500685006950070500715007250073500745007550076500775007850079500805008150082500835008450085500865008750088500895009050091500925009350094500955009650097500985009950100501015010250103501045010550106501075010850109501105011150112501135011450115501165011750118501195012050121501225012350124501255012650127501285012950130501315013250133501345013550136501375013850139501405014150142501435014450145501465014750148501495015050151501525015350154501555015650157501585015950160501615016250163501645016550166501675016850169501705017150172501735017450175501765017750178501795018050181501825018350184501855018650187501885018950190501915019250193501945019550196501975019850199502005020150202502035020450205502065020750208502095021050211502125021350214502155021650217502185021950220502215022250223502245022550226502275022850229502305023150232502335023450235502365023750238502395024050241502425024350244502455024650247502485024950250502515025250253502545025550256502575025850259502605026150262502635026450265502665026750268502695027050271502725027350274502755027650277502785027950280502815028250283502845028550286502875028850289502905029150292502935029450295502965029750298502995030050301503025030350304503055030650307503085030950310503115031250313503145031550316503175031850319503205032150322503235032450325503265032750328503295033050331503325033350334503355033650337503385033950340503415034250343503445034550346503475034850349503505035150352503535035450355503565035750358503595036050361503625036350364503655036650367503685036950370503715037250373503745037550376503775037850379503805038150382503835038450385503865038750388503895039050391503925039350394503955039650397503985039950400504015040250403504045040550406504075040850409504105041150412504135041450415504165041750418504195042050421504225042350424504255042650427504285042950430504315043250433504345043550436504375043850439504405044150442504435044450445504465044750448504495045050451504525045350454504555045650457504585045950460504615046250463504645046550466504675046850469504705047150472504735047450475504765047750478504795048050481504825048350484504855048650487504885048950490504915049250493504945049550496504975049850499505005050150502505035050450505505065050750508505095051050511505125051350514505155051650517505185051950520505215052250523505245052550526505275052850529505305053150532505335053450535505365053750538505395054050541505425054350544505455054650547505485054950550505515055250553505545055550556505575055850559505605056150562505635056450565505665056750568505695057050571505725057350574505755057650577505785057950580505815058250583505845058550586505875058850589505905059150592505935059450595505965059750598505995060050601506025060350604506055060650607506085060950610506115061250613506145061550616506175061850619506205062150622506235062450625506265062750628506295063050631506325063350634506355063650637506385063950640506415064250643506445064550646506475064850649506505065150652506535065450655506565065750658506595066050661506625066350664506655066650667506685066950670506715067250673506745067550676506775067850679506805068150682506835068450685506865068750688506895069050691506925069350694506955069650697506985069950700507015070250703507045070550706507075070850709507105071150712507135071450715507165071750718507195072050721507225072350724507255072650727507285072950730507315073250733507345073550736507375073850739507405074150742507435074450745507465074750748507495075050751507525075350754507555075650757507585075950760507615076250763507645076550766507675076850769507705077150772507735077450775507765077750778507795078050781507825078350784507855078650787507885078950790507915079250793507945079550796507975079850799508005080150802508035080450805508065080750808508095081050811508125081350814508155081650817508185081950820508215082250823508245082550826508275082850829508305083150832508335083450835508365083750838508395084050841508425084350844508455084650847508485084950850508515085250853508545085550856508575085850859508605086150862508635086450865508665086750868508695087050871508725087350874508755087650877508785087950880508815088250883508845088550886508875088850889508905089150892508935089450895508965089750898508995090050901509025090350904509055090650907509085090950910509115091250913509145091550916509175091850919509205092150922509235092450925509265092750928509295093050931509325093350934509355093650937509385093950940509415094250943509445094550946509475094850949509505095150952509535095450955509565095750958509595096050961509625096350964509655096650967509685096950970509715097250973509745097550976509775097850979509805098150982509835098450985509865098750988509895099050991509925099350994509955099650997509985099951000510015100251003510045100551006510075100851009510105101151012510135101451015510165101751018510195102051021510225102351024510255102651027510285102951030510315103251033510345103551036510375103851039510405104151042510435104451045510465104751048510495105051051510525105351054510555105651057510585105951060510615106251063510645106551066510675106851069510705107151072510735107451075510765107751078510795108051081510825108351084510855108651087510885108951090510915109251093510945109551096510975109851099511005110151102511035110451105511065110751108511095111051111511125111351114511155111651117511185111951120511215112251123511245112551126511275112851129511305113151132511335113451135511365113751138511395114051141511425114351144511455114651147511485114951150511515115251153511545115551156511575115851159511605116151162511635116451165511665116751168511695117051171511725117351174511755117651177511785117951180511815118251183511845118551186511875118851189511905119151192511935119451195511965119751198511995120051201512025120351204512055120651207512085120951210512115121251213512145121551216512175121851219512205122151222512235122451225512265122751228512295123051231512325123351234512355123651237512385123951240512415124251243512445124551246512475124851249512505125151252512535125451255512565125751258512595126051261512625126351264512655126651267512685126951270512715127251273512745127551276512775127851279512805128151282512835128451285512865128751288512895129051291512925129351294512955129651297512985129951300513015130251303513045130551306513075130851309513105131151312513135131451315513165131751318513195132051321513225132351324513255132651327513285132951330513315133251333513345133551336513375133851339513405134151342513435134451345513465134751348513495135051351513525135351354513555135651357513585135951360513615136251363513645136551366513675136851369513705137151372513735137451375513765137751378513795138051381513825138351384513855138651387513885138951390513915139251393513945139551396513975139851399514005140151402514035140451405514065140751408514095141051411514125141351414514155141651417514185141951420514215142251423514245142551426514275142851429514305143151432514335143451435514365143751438514395144051441514425144351444514455144651447514485144951450514515145251453514545145551456514575145851459514605146151462514635146451465514665146751468514695147051471514725147351474514755147651477514785147951480514815148251483514845148551486514875148851489514905149151492514935149451495514965149751498514995150051501515025150351504515055150651507515085150951510515115151251513515145151551516515175151851519515205152151522515235152451525515265152751528515295153051531515325153351534515355153651537515385153951540515415154251543515445154551546515475154851549515505155151552515535155451555515565155751558515595156051561515625156351564515655156651567515685156951570515715157251573515745157551576515775157851579515805158151582515835158451585515865158751588515895159051591515925159351594515955159651597515985159951600516015160251603516045160551606516075160851609516105161151612516135161451615516165161751618516195162051621516225162351624516255162651627516285162951630516315163251633516345163551636516375163851639516405164151642516435164451645516465164751648516495165051651516525165351654516555165651657516585165951660516615166251663516645166551666516675166851669516705167151672516735167451675516765167751678516795168051681516825168351684516855168651687516885168951690516915169251693516945169551696516975169851699517005170151702517035170451705517065170751708517095171051711517125171351714517155171651717517185171951720517215172251723517245172551726517275172851729517305173151732517335173451735517365173751738517395174051741517425174351744517455174651747517485174951750517515175251753517545175551756517575175851759517605176151762517635176451765517665176751768517695177051771517725177351774517755177651777517785177951780517815178251783517845178551786517875178851789517905179151792517935179451795517965179751798517995180051801518025180351804518055180651807518085180951810518115181251813518145181551816518175181851819518205182151822518235182451825518265182751828518295183051831518325183351834518355183651837518385183951840518415184251843518445184551846518475184851849518505185151852518535185451855518565185751858518595186051861518625186351864518655186651867518685186951870518715187251873518745187551876518775187851879518805188151882518835188451885518865188751888518895189051891518925189351894518955189651897518985189951900519015190251903519045190551906519075190851909519105191151912519135191451915519165191751918519195192051921519225192351924519255192651927519285192951930519315193251933519345193551936519375193851939519405194151942519435194451945519465194751948519495195051951519525195351954519555195651957519585195951960519615196251963519645196551966519675196851969519705197151972519735197451975519765197751978519795198051981519825198351984519855198651987519885198951990519915199251993519945199551996519975199851999520005200152002520035200452005520065200752008520095201052011520125201352014520155201652017520185201952020520215202252023520245202552026520275202852029520305203152032520335203452035520365203752038520395204052041520425204352044520455204652047520485204952050520515205252053520545205552056520575205852059520605206152062520635206452065520665206752068520695207052071520725207352074520755207652077520785207952080520815208252083520845208552086520875208852089520905209152092520935209452095520965209752098520995210052101521025210352104521055210652107521085210952110521115211252113521145211552116521175211852119521205212152122521235212452125521265212752128521295213052131521325213352134521355213652137521385213952140521415214252143521445214552146521475214852149521505215152152521535215452155521565215752158521595216052161521625216352164521655216652167521685216952170521715217252173521745217552176521775217852179521805218152182521835218452185521865218752188521895219052191521925219352194521955219652197521985219952200522015220252203522045220552206522075220852209522105221152212522135221452215522165221752218522195222052221522225222352224522255222652227522285222952230522315223252233522345223552236522375223852239522405224152242522435224452245522465224752248522495225052251522525225352254522555225652257522585225952260522615226252263522645226552266522675226852269522705227152272522735227452275522765227752278522795228052281522825228352284522855228652287522885228952290522915229252293522945229552296522975229852299523005230152302523035230452305523065230752308523095231052311523125231352314523155231652317523185231952320523215232252323523245232552326523275232852329523305233152332523335233452335523365233752338523395234052341523425234352344523455234652347523485234952350523515235252353523545235552356523575235852359523605236152362523635236452365523665236752368523695237052371523725237352374523755237652377523785237952380523815238252383523845238552386523875238852389523905239152392523935239452395523965239752398523995240052401524025240352404524055240652407524085240952410524115241252413524145241552416524175241852419524205242152422524235242452425524265242752428524295243052431524325243352434524355243652437524385243952440524415244252443524445244552446524475244852449524505245152452524535245452455524565245752458524595246052461524625246352464524655246652467524685246952470524715247252473524745247552476524775247852479524805248152482524835248452485524865248752488524895249052491524925249352494524955249652497524985249952500525015250252503525045250552506525075250852509525105251152512525135251452515525165251752518525195252052521525225252352524525255252652527525285252952530525315253252533525345253552536525375253852539525405254152542525435254452545525465254752548525495255052551525525255352554525555255652557525585255952560525615256252563525645256552566525675256852569525705257152572525735257452575525765257752578525795258052581525825258352584525855258652587525885258952590525915259252593525945259552596525975259852599526005260152602526035260452605526065260752608526095261052611526125261352614526155261652617526185261952620526215262252623526245262552626526275262852629526305263152632526335263452635526365263752638526395264052641526425264352644526455264652647526485264952650526515265252653526545265552656526575265852659526605266152662526635266452665526665266752668526695267052671526725267352674526755267652677526785267952680526815268252683526845268552686526875268852689526905269152692526935269452695526965269752698526995270052701527025270352704527055270652707527085270952710527115271252713527145271552716527175271852719527205272152722527235272452725527265272752728527295273052731527325273352734527355273652737527385273952740527415274252743527445274552746527475274852749527505275152752527535275452755527565275752758527595276052761527625276352764527655276652767527685276952770527715277252773527745277552776527775277852779527805278152782527835278452785527865278752788527895279052791527925279352794527955279652797527985279952800528015280252803528045280552806528075280852809528105281152812528135281452815528165281752818528195282052821528225282352824528255282652827528285282952830528315283252833528345283552836528375283852839528405284152842528435284452845528465284752848528495285052851528525285352854528555285652857528585285952860528615286252863528645286552866528675286852869528705287152872528735287452875528765287752878528795288052881528825288352884528855288652887528885288952890528915289252893528945289552896528975289852899529005290152902529035290452905529065290752908529095291052911529125291352914529155291652917529185291952920529215292252923529245292552926529275292852929529305293152932529335293452935529365293752938529395294052941529425294352944529455294652947529485294952950529515295252953529545295552956529575295852959529605296152962529635296452965529665296752968529695297052971529725297352974529755297652977529785297952980529815298252983529845298552986529875298852989529905299152992529935299452995529965299752998529995300053001530025300353004530055300653007530085300953010530115301253013530145301553016530175301853019530205302153022530235302453025530265302753028530295303053031530325303353034530355303653037530385303953040530415304253043530445304553046530475304853049530505305153052530535305453055530565305753058530595306053061530625306353064530655306653067530685306953070530715307253073530745307553076530775307853079530805308153082530835308453085530865308753088530895309053091530925309353094530955309653097530985309953100531015310253103531045310553106531075310853109531105311153112531135311453115531165311753118531195312053121531225312353124531255312653127531285312953130531315313253133531345313553136531375313853139531405314153142531435314453145531465314753148531495315053151531525315353154531555315653157531585315953160531615316253163531645316553166531675316853169531705317153172531735317453175531765317753178531795318053181531825318353184531855318653187531885318953190531915319253193531945319553196531975319853199532005320153202532035320453205532065320753208532095321053211532125321353214532155321653217532185321953220532215322253223532245322553226532275322853229532305323153232532335323453235532365323753238532395324053241532425324353244532455324653247532485324953250532515325253253532545325553256532575325853259532605326153262532635326453265532665326753268532695327053271532725327353274532755327653277532785327953280532815328253283532845328553286532875328853289532905329153292532935329453295532965329753298532995330053301533025330353304533055330653307533085330953310533115331253313533145331553316533175331853319533205332153322533235332453325533265332753328533295333053331533325333353334533355333653337533385333953340533415334253343533445334553346533475334853349533505335153352533535335453355533565335753358533595336053361533625336353364533655336653367533685336953370533715337253373533745337553376533775337853379533805338153382533835338453385533865338753388533895339053391533925339353394533955339653397533985339953400534015340253403534045340553406534075340853409534105341153412534135341453415534165341753418534195342053421534225342353424534255342653427534285342953430534315343253433534345343553436534375343853439534405344153442534435344453445534465344753448534495345053451534525345353454534555345653457534585345953460534615346253463534645346553466534675346853469534705347153472534735347453475534765347753478534795348053481534825348353484534855348653487534885348953490534915349253493534945349553496534975349853499535005350153502535035350453505535065350753508535095351053511535125351353514535155351653517535185351953520535215352253523535245352553526535275352853529535305353153532535335353453535535365353753538535395354053541535425354353544535455354653547535485354953550535515355253553535545355553556535575355853559535605356153562535635356453565535665356753568535695357053571535725357353574535755357653577535785357953580535815358253583535845358553586535875358853589535905359153592535935359453595535965359753598535995360053601536025360353604536055360653607536085360953610536115361253613536145361553616536175361853619536205362153622536235362453625536265362753628536295363053631536325363353634536355363653637536385363953640536415364253643536445364553646536475364853649536505365153652536535365453655536565365753658536595366053661536625366353664536655366653667536685366953670536715367253673536745367553676536775367853679536805368153682536835368453685536865368753688536895369053691536925369353694536955369653697536985369953700537015370253703537045370553706537075370853709537105371153712537135371453715537165371753718537195372053721537225372353724537255372653727537285372953730537315373253733537345373553736537375373853739537405374153742537435374453745537465374753748537495375053751537525375353754537555375653757537585375953760537615376253763537645376553766537675376853769537705377153772537735377453775537765377753778537795378053781537825378353784537855378653787537885378953790537915379253793537945379553796537975379853799538005380153802538035380453805538065380753808538095381053811538125381353814538155381653817538185381953820538215382253823538245382553826538275382853829538305383153832538335383453835538365383753838538395384053841538425384353844538455384653847538485384953850538515385253853538545385553856538575385853859538605386153862538635386453865538665386753868538695387053871538725387353874538755387653877538785387953880538815388253883538845388553886538875388853889538905389153892538935389453895538965389753898538995390053901539025390353904539055390653907539085390953910539115391253913539145391553916539175391853919539205392153922539235392453925539265392753928539295393053931539325393353934539355393653937539385393953940539415394253943539445394553946539475394853949539505395153952539535395453955539565395753958539595396053961539625396353964539655396653967539685396953970539715397253973539745397553976539775397853979539805398153982539835398453985539865398753988539895399053991539925399353994539955399653997539985399954000540015400254003540045400554006540075400854009540105401154012540135401454015540165401754018540195402054021540225402354024540255402654027540285402954030540315403254033540345403554036540375403854039540405404154042540435404454045540465404754048540495405054051540525405354054540555405654057540585405954060540615406254063540645406554066540675406854069540705407154072540735407454075540765407754078540795408054081540825408354084540855408654087540885408954090540915409254093540945409554096540975409854099541005410154102541035410454105541065410754108541095411054111541125411354114541155411654117541185411954120541215412254123541245412554126541275412854129541305413154132541335413454135541365413754138541395414054141541425414354144541455414654147541485414954150541515415254153541545415554156541575415854159541605416154162541635416454165541665416754168541695417054171541725417354174541755417654177541785417954180541815418254183541845418554186541875418854189541905419154192541935419454195541965419754198541995420054201542025420354204542055420654207542085420954210542115421254213542145421554216542175421854219542205422154222542235422454225542265422754228542295423054231542325423354234542355423654237542385423954240542415424254243542445424554246542475424854249542505425154252542535425454255542565425754258542595426054261542625426354264542655426654267542685426954270542715427254273542745427554276542775427854279542805428154282542835428454285542865428754288542895429054291542925429354294542955429654297542985429954300543015430254303543045430554306543075430854309543105431154312543135431454315543165431754318543195432054321543225432354324543255432654327543285432954330543315433254333543345433554336543375433854339543405434154342543435434454345543465434754348543495435054351543525435354354543555435654357543585435954360543615436254363543645436554366543675436854369543705437154372543735437454375543765437754378543795438054381543825438354384543855438654387543885438954390543915439254393543945439554396543975439854399544005440154402544035440454405544065440754408544095441054411544125441354414544155441654417544185441954420544215442254423544245442554426544275442854429544305443154432544335443454435544365443754438544395444054441544425444354444544455444654447544485444954450544515445254453544545445554456544575445854459544605446154462544635446454465544665446754468544695447054471544725447354474544755447654477544785447954480544815448254483544845448554486544875448854489544905449154492544935449454495544965449754498544995450054501545025450354504545055450654507545085450954510545115451254513545145451554516545175451854519545205452154522545235452454525545265452754528545295453054531545325453354534545355453654537545385453954540545415454254543545445454554546545475454854549545505455154552545535455454555545565455754558545595456054561545625456354564545655456654567545685456954570545715457254573545745457554576545775457854579545805458154582545835458454585545865458754588545895459054591545925459354594545955459654597545985459954600546015460254603546045460554606546075460854609546105461154612546135461454615546165461754618546195462054621546225462354624546255462654627546285462954630546315463254633546345463554636546375463854639546405464154642546435464454645546465464754648546495465054651546525465354654546555465654657546585465954660546615466254663546645466554666546675466854669546705467154672546735467454675546765467754678546795468054681546825468354684546855468654687546885468954690546915469254693546945469554696546975469854699547005470154702547035470454705547065470754708547095471054711547125471354714547155471654717547185471954720547215472254723547245472554726547275472854729547305473154732547335473454735547365473754738547395474054741547425474354744547455474654747547485474954750547515475254753547545475554756547575475854759547605476154762547635476454765547665476754768547695477054771547725477354774547755477654777547785477954780547815478254783547845478554786547875478854789547905479154792547935479454795547965479754798547995480054801548025480354804548055480654807548085480954810548115481254813548145481554816548175481854819548205482154822548235482454825548265482754828548295483054831548325483354834548355483654837548385483954840548415484254843548445484554846548475484854849548505485154852548535485454855548565485754858548595486054861548625486354864548655486654867548685486954870548715487254873548745487554876548775487854879548805488154882548835488454885548865488754888548895489054891548925489354894548955489654897548985489954900549015490254903549045490554906549075490854909549105491154912549135491454915549165491754918549195492054921549225492354924549255492654927549285492954930549315493254933549345493554936549375493854939549405494154942549435494454945549465494754948549495495054951549525495354954549555495654957549585495954960549615496254963549645496554966549675496854969549705497154972549735497454975549765497754978549795498054981549825498354984549855498654987549885498954990549915499254993549945499554996549975499854999550005500155002550035500455005550065500755008550095501055011550125501355014550155501655017550185501955020550215502255023550245502555026550275502855029550305503155032550335503455035550365503755038550395504055041550425504355044550455504655047550485504955050550515505255053550545505555056550575505855059550605506155062550635506455065550665506755068550695507055071550725507355074550755507655077550785507955080550815508255083550845508555086550875508855089550905509155092550935509455095550965509755098550995510055101551025510355104551055510655107551085510955110551115511255113551145511555116551175511855119551205512155122551235512455125551265512755128551295513055131551325513355134551355513655137551385513955140551415514255143551445514555146551475514855149551505515155152551535515455155551565515755158551595516055161551625516355164551655516655167551685516955170551715517255173551745517555176551775517855179551805518155182551835518455185551865518755188551895519055191551925519355194551955519655197551985519955200552015520255203552045520555206552075520855209552105521155212552135521455215552165521755218552195522055221552225522355224552255522655227552285522955230552315523255233552345523555236552375523855239552405524155242552435524455245552465524755248552495525055251552525525355254552555525655257552585525955260552615526255263552645526555266552675526855269552705527155272552735527455275552765527755278552795528055281552825528355284552855528655287552885528955290552915529255293552945529555296552975529855299553005530155302553035530455305553065530755308553095531055311553125531355314553155531655317553185531955320553215532255323553245532555326553275532855329553305533155332553335533455335553365533755338553395534055341553425534355344553455534655347553485534955350553515535255353553545535555356553575535855359553605536155362553635536455365553665536755368553695537055371553725537355374553755537655377553785537955380553815538255383553845538555386553875538855389553905539155392553935539455395553965539755398553995540055401554025540355404554055540655407554085540955410554115541255413554145541555416554175541855419554205542155422554235542455425554265542755428554295543055431554325543355434554355543655437554385543955440554415544255443554445544555446554475544855449554505545155452554535545455455554565545755458554595546055461554625546355464554655546655467554685546955470554715547255473554745547555476554775547855479554805548155482554835548455485554865548755488554895549055491554925549355494554955549655497554985549955500555015550255503555045550555506555075550855509555105551155512555135551455515555165551755518555195552055521555225552355524555255552655527555285552955530555315553255533555345553555536555375553855539555405554155542555435554455545555465554755548555495555055551555525555355554555555555655557555585555955560555615556255563555645556555566555675556855569555705557155572555735557455575555765557755578555795558055581555825558355584555855558655587555885558955590555915559255593555945559555596555975559855599556005560155602556035560455605556065560755608556095561055611556125561355614556155561655617556185561955620556215562255623556245562555626556275562855629556305563155632556335563455635556365563755638556395564055641556425564355644556455564655647556485564955650556515565255653556545565555656556575565855659556605566155662556635566455665556665566755668556695567055671556725567355674556755567655677556785567955680556815568255683556845568555686556875568855689556905569155692556935569455695556965569755698556995570055701557025570355704557055570655707557085570955710557115571255713557145571555716557175571855719557205572155722557235572455725557265572755728557295573055731557325573355734557355573655737557385573955740557415574255743557445574555746557475574855749557505575155752557535575455755557565575755758557595576055761557625576355764557655576655767557685576955770557715577255773557745577555776557775577855779557805578155782557835578455785557865578755788557895579055791557925579355794557955579655797557985579955800558015580255803558045580555806558075580855809558105581155812558135581455815558165581755818558195582055821558225582355824558255582655827558285582955830558315583255833558345583555836558375583855839558405584155842558435584455845558465584755848558495585055851558525585355854558555585655857558585585955860558615586255863
  1. /* 许钟文修改的 标记 xzw
  2. 另外 所有"matter"字样已被我删除 原因:删除matterport信息
  3. */
  4. !function() {
  5. "use strict";
  6. function t(t, i) {
  7. return typeof t === i
  8. }
  9. function i(t, i) {
  10. return t instanceof i
  11. }
  12. function n(t) {
  13. return t && t.nodeType
  14. }
  15. function e(t) {
  16. return n(t) ? t : i(t, g) ? t[0] : void 0
  17. }
  18. function o(t, i, n) {
  19. return g.each(t, function(t, e) {
  20. n = i.call(e, n, t, e)
  21. }),
  22. n
  23. }
  24. function r(t, i, n) {
  25. var e, o, r;
  26. if (t === i)
  27. return !0;
  28. if (!t || !i || t.constructor !== i.constructor)
  29. return !1;
  30. for (e = 0,
  31. o = n.length; o > e; e += 1) {
  32. if (r = n[e],
  33. t[r] && y(t[r].equals) && !t[r].equals(i[r]))
  34. return !1;
  35. if (t[r] !== i[r])
  36. return !1
  37. }
  38. return !0
  39. }
  40. function s(t, i, n, e) {
  41. this.left = E(t),
  42. this.top = E(i),
  43. this.width = E(n),
  44. this.height = E(e),
  45. this.right = this.left + this.width,
  46. this.bottom = this.top + this.height
  47. }
  48. function h(t, i, n, e) {
  49. this.visible = t || 0,
  50. this.viewport = i || 0,
  51. this.possible = n || 0,
  52. this.rects = e && T({}, e) || null
  53. }
  54. function l(t, i) {
  55. this.els = t,
  56. this.viewport = i
  57. }
  58. function c(t, i, n) {
  59. var e;
  60. return g.inArray(n, q) >= 0 ? e = s.ofElement(t) : g.inArray(n, S) >= 0 && (e = h.of(t, i)),
  61. e ? e[n] : 0
  62. }
  63. function u(t, i) {
  64. return t.val - i.val
  65. }
  66. function a(t, i) {
  67. return i.val - t.val
  68. }
  69. function f(t) {
  70. var i = s.ofContent(t, !0)
  71. , n = s.ofViewport(t, !0)
  72. , e = i.width - n.width
  73. , o = i.height - n.height;
  74. this.content = i,
  75. this.viewport = n,
  76. this.width = 0 >= e ? null : n.left / e,
  77. this.height = 0 >= o ? null : n.top / o,
  78. this.left = n.left,
  79. this.top = n.top,
  80. this.right = i.right - n.right,
  81. this.bottom = i.bottom - n.bottom
  82. }
  83. function p(t) {
  84. this.el = t || window
  85. }
  86. function d(t, i) {
  87. this.context = t,
  88. this.viewport = i,
  89. this.init()
  90. }
  91. function v(t, i, n, e) {
  92. this.context = new l(t,i),
  93. this.property = n,
  94. this.descending = e,
  95. this.init()
  96. }
  97. function w(t) {
  98. t && t !== window && t !== document ? (this.context = t,
  99. this.$autoTarget = g(t)) : this.context = window,
  100. this.init()
  101. }
  102. var g = jQuery
  103. , m = g(window)
  104. , b = g(document)
  105. , T = g.extend
  106. , y = g.isFunction
  107. , k = Math.max
  108. , V = Math.min
  109. , E = Math.round
  110. , x = function() {
  111. var t = {}
  112. , i = 1;
  113. return function(n) {
  114. return n ? (t[n] || (t[n] = i,
  115. i += 1),
  116. t[n]) : 0
  117. }
  118. }();
  119. T(s.prototype, {
  120. equals: function(t) {
  121. return r(this, t, ["left", "top", "width", "height"])
  122. },
  123. area: function() {
  124. return this.width * this.height
  125. },
  126. relativeTo: function(t) {
  127. return new s(this.left - t.left,this.top - t.top,this.width,this.height)
  128. },
  129. intersection: function(t) {
  130. if (!i(t, s))
  131. return null;
  132. var n = k(this.left, t.left)
  133. , e = V(this.right, t.right)
  134. , o = k(this.top, t.top)
  135. , r = V(this.bottom, t.bottom)
  136. , h = e - n
  137. , l = r - o;
  138. return h >= 0 && l >= 0 ? new s(n,o,h,l) : null
  139. },
  140. envelope: function(t) {
  141. if (!i(t, s))
  142. return this;
  143. var n = V(this.left, t.left)
  144. , e = k(this.right, t.right)
  145. , o = V(this.top, t.top)
  146. , r = k(this.bottom, t.bottom)
  147. , h = e - n
  148. , l = r - o;
  149. return new s(n,o,h,l)
  150. }
  151. }),
  152. T(s, {
  153. ofContent: function(t, i) {
  154. return t && t !== document && t !== window ? i ? new s(0,0,t.scrollWidth,t.scrollHeight) : new s(t.offsetLeft - t.scrollLeft,t.offsetTop - t.scrollTop,t.scrollWidth,t.scrollHeight) : new s(0,0,b.width(),b.height())
  155. },
  156. ofViewport: function(t, i) {
  157. return t && t !== document && t !== window ? i ? new s(t.scrollLeft,t.scrollTop,t.clientWidth,t.clientHeight) : new s(t.offsetLeft,t.offsetTop,t.clientWidth,t.clientHeight) : new s(m.scrollLeft(),m.scrollTop(),m.width(),m.height())
  158. },
  159. ofElement: function(t) {
  160. var i = g(t);
  161. if (!i.is(":visible"))
  162. return null;
  163. var n = i.offset();
  164. return new s(n.left,n.top,i.outerWidth(),i.outerHeight())
  165. }
  166. }),
  167. T(h.prototype, {
  168. equals: function(t) {
  169. return this.fracsEqual(t) && this.rectsEqual(t)
  170. },
  171. fracsEqual: function(t) {
  172. return r(this, t, ["visible", "viewport", "possible"])
  173. },
  174. rectsEqual: function(t) {
  175. return r(this.rects, t.rects, ["document", "element", "viewport"])
  176. }
  177. }),
  178. T(h, {
  179. of: function(t, i) {
  180. var e, o, r;
  181. return t = n(t) && s.ofElement(t) || t,
  182. i = n(i) && s.ofViewport(i) || i || s.ofViewport(),
  183. t instanceof s && (e = t.intersection(i)) ? (o = e.area(),
  184. r = V(t.width, i.width) * V(t.height, i.height),
  185. new h(o / t.area(),o / i.area(),o / r,{
  186. document: e,
  187. element: e.relativeTo(t),
  188. viewport: e.relativeTo(i)
  189. })) : new h
  190. }
  191. });
  192. var q = ["width", "height", "left", "right", "top", "bottom"]
  193. , S = ["possible", "visible", "viewport"];
  194. T(l.prototype, {
  195. sorted: function(t, i) {
  196. var n = this.viewport;
  197. return g.map(this.els, function(i) {
  198. return {
  199. el: i,
  200. val: c(i, n, t)
  201. }
  202. }).sort(i ? a : u)
  203. },
  204. best: function(t, i) {
  205. return this.els.length ? this.sorted(t, i)[0] : null
  206. }
  207. }),
  208. T(f.prototype, {
  209. equals: function(t) {
  210. return r(this, t, ["width", "height", "left", "top", "right", "bottom", "content", "viewport"])
  211. }
  212. }),
  213. T(p.prototype, {
  214. equals: function(t) {
  215. return r(this, t, ["el"])
  216. },
  217. scrollState: function() {
  218. return new f(this.el)
  219. },
  220. scrollTo: function(t, i, n) {
  221. var e = g(this.el === window ? "html,body" : this.el);
  222. t = t || 0,
  223. i = i || 0,
  224. n = isNaN(n) ? 1e3 : n,
  225. e.stop(!0).animate({
  226. scrollLeft: t,
  227. scrollTop: i
  228. }, n)
  229. },
  230. scroll: function(t, i, n) {
  231. var e = this.el === window ? m : g(this.el);
  232. t = t || 0,
  233. i = i || 0,
  234. this.scrollTo(e.scrollLeft() + t, e.scrollTop() + i, n)
  235. },
  236. scrollToRect: function(t, i, n, e) {
  237. i = i || 0,
  238. n = n || 0,
  239. this.scrollTo(t.left - i, t.top - n, e)
  240. },
  241. scrollToElement: function(t, i, n, e) {
  242. var o = s.ofElement(t).relativeTo(s.ofContent(this.el));
  243. this.scrollToRect(o, i, n, e)
  244. }
  245. });
  246. var C = {
  247. init: function() {
  248. this.callbacks = g.Callbacks("memory unique"),
  249. this.currVal = null,
  250. this.prevVal = null,
  251. this.checkProxy = g.proxy(this.check, this),
  252. this.autoCheck()
  253. },
  254. bind: function(t) {
  255. this.callbacks.add(t)
  256. },
  257. unbind: function(t) {
  258. t ? this.callbacks.remove(t) : this.callbacks.empty()
  259. },
  260. trigger: function() {
  261. this.callbacks.fireWith(this.context, [this.currVal, this.prevVal])
  262. },
  263. check: function(t) {
  264. var i = this.updatedValue(t);
  265. return void 0 !== i && (this.prevVal = this.currVal,
  266. this.currVal = i,
  267. this.trigger(),
  268. !0)
  269. },
  270. $autoTarget: m,
  271. autoEvents: "load resize scroll",
  272. autoCheck: function(t) {
  273. this.$autoTarget[t === !1 ? "off" : "on"](this.autoEvents, this.checkProxy)
  274. }
  275. };
  276. T(d.prototype, C, {
  277. updatedValue: function() {
  278. var t = h.of(this.context, this.viewport);
  279. return this.currVal && this.currVal.equals(t) ? void 0 : t
  280. }
  281. }),
  282. T(v.prototype, C, {
  283. updatedValue: function() {
  284. var t = this.context.best(this.property, this.descending);
  285. return t && (t = t.val > 0 ? t.el : null,
  286. this.currVal !== t) ? t : void 0
  287. }
  288. }),
  289. T(w.prototype, C, {
  290. updatedValue: function() {
  291. var t = new f(this.context);
  292. return this.currVal && this.currVal.equals(t) ? void 0 : t
  293. }
  294. });
  295. var L = function(t, i) {
  296. var n = [].slice
  297. , e = jQuery
  298. , o = e.extend
  299. , r = e.isFunction
  300. , s = o({}, i)
  301. , h = function(i, n, o, s) {
  302. return o = r(o) ? o.apply(i, n) : o,
  303. r(s[o]) ? s[o].apply(i, n) : void e.error('Method "' + o + '" does not exist on jQuery.' + t)
  304. }
  305. , l = function() {
  306. return h(this, n.call(arguments), s.defaultStatic, l)
  307. }
  308. , c = function(t) {
  309. return r(c[t]) ? c[t].apply(this, n.call(arguments, 1)) : h(this, n.call(arguments), s.defaultMethod, c)
  310. }
  311. , u = function(t) {
  312. t && (o(l, t.statics),
  313. o(c, t.methods)),
  314. l.modplug = u
  315. };
  316. u.prev = {
  317. statics: e[t],
  318. methods: e.fn[t]
  319. },
  320. u(i),
  321. e[t] = l,
  322. e.fn[t] = c
  323. }
  324. , M = "fracs";
  325. L(M, {
  326. statics: {
  327. version: "0.15.0",
  328. Rect: s,
  329. Fractions: h,
  330. Group: l,
  331. ScrollState: f,
  332. Viewport: p,
  333. FracsCallbacks: d,
  334. GroupCallbacks: v,
  335. ScrollStateCallbacks: w,
  336. fracs: function(t, i) {
  337. return h.of(t, i)
  338. }
  339. },
  340. methods: {
  341. content: function(t) {
  342. return this.length ? s.ofContent(this[0], t) : null
  343. },
  344. envelope: function() {
  345. return o(this, function(t) {
  346. var i = s.ofElement(this);
  347. return t ? t.envelope(i) : i
  348. })
  349. },
  350. fracs: function(i, n, o) {
  351. t(i, "string") || (o = n,
  352. n = i,
  353. i = null),
  354. y(n) || (o = n,
  355. n = null),
  356. o = e(o);
  357. var r = M + ".fracs." + x(o);
  358. return "unbind" === i ? this.each(function() {
  359. var t = g(this).data(r);
  360. t && t.unbind(n)
  361. }) : "check" === i ? this.each(function() {
  362. var t = g(this).data(r);
  363. t && t.check()
  364. }) : y(n) ? this.each(function() {
  365. var t = g(this)
  366. , i = t.data(r);
  367. i || (i = new d(this,o),
  368. t.data(r, i)),
  369. i.bind(n)
  370. }) : this.length ? h.of(this[0], o) : null
  371. },
  372. intersection: function() {
  373. return o(this, function(t) {
  374. var i = s.ofElement(this);
  375. return t ? t.intersection(i) : i
  376. })
  377. },
  378. max: function(t, i, n) {
  379. return y(i) || (n = i,
  380. i = null),
  381. n = e(n),
  382. i ? (new v(this,n,t,!0).bind(i),
  383. this) : this.pushStack(new l(this,n).best(t, !0).el)
  384. },
  385. min: function(t, i, n) {
  386. return y(i) || (n = i,
  387. i = null),
  388. n = e(n),
  389. i ? (new v(this,n,t).bind(i),
  390. this) : this.pushStack(new l(this,n).best(t).el)
  391. },
  392. rect: function() {
  393. return this.length ? s.ofElement(this[0]) : null
  394. },
  395. scrollState: function(i, n) {
  396. var e = M + ".scrollState";
  397. return t(i, "string") || (n = i,
  398. i = null),
  399. "unbind" === i ? this.each(function() {
  400. var t = g(this).data(e);
  401. t && t.unbind(n)
  402. }) : "check" === i ? this.each(function() {
  403. var t = g(this).data(e);
  404. t && t.check()
  405. }) : y(n) ? this.each(function() {
  406. var t = g(this)
  407. , i = t.data(e);
  408. i || (i = new w(this),
  409. t.data(e, i)),
  410. i.bind(n)
  411. }) : this.length ? new f(this[0]) : null
  412. },
  413. scroll: function(t, i, n) {
  414. return this.each(function() {
  415. new p(this).scroll(t, i, n)
  416. })
  417. },
  418. scrollTo: function(t, i, n, o) {
  419. return g.isNumeric(t) && (o = n,
  420. n = i,
  421. i = t,
  422. t = null),
  423. t = e(t),
  424. this.each(function() {
  425. t ? new p(this).scrollToElement(t, i, n, o) : new p(this).scrollTo(i, n, o)
  426. })
  427. },
  428. scrollToThis: function(t, i, n, o) {
  429. return o = new p(e(o)),
  430. o.scrollToElement(this[0], t, i, n),
  431. this
  432. },
  433. softLink: function(t, i, n, o) {
  434. return o = new p(e(o)),
  435. this.filter("a[href^=#]").each(function() {
  436. var e = g(this);
  437. e.on("click", function() {
  438. o.scrollToElement(g(e.attr("href"))[0], t, i, n)
  439. })
  440. })
  441. },
  442. sort: function(i, n, o) {
  443. return t(n, "boolean") || (o = n,
  444. n = null),
  445. o = e(o),
  446. this.pushStack(g.map(new l(this,o).sorted(i, !n), function(t) {
  447. return t.el
  448. }))
  449. },
  450. viewport: function(t) {
  451. return this.length ? s.ofViewport(this[0], t) : null
  452. }
  453. },
  454. defaultStatic: "fracs",
  455. defaultMethod: "fracs"
  456. })
  457. }();
  458. if ("undefined" == typeof jQuery)
  459. throw new Error("Bootstrap's JavaScript requires jQuery");
  460. +function(t) {
  461. "use strict";
  462. function e(e) {
  463. return this.each(function() {
  464. var o = t(this)
  465. , s = o.data("bs.tooltip")
  466. , n = "object" == typeof e && e;
  467. (s || "destroy" != e) && (s || o.data("bs.tooltip", s = new i(this,n)),
  468. "string" == typeof e && s[e]())
  469. })
  470. }
  471. var i = function(t, e) {
  472. this.type = this.options = this.enabled = this.timeout = this.hoverState = this.$element = null,
  473. this.init("tooltip", t, e)
  474. };
  475. i.VERSION = "3.2.0",
  476. i.DEFAULTS = {
  477. animation: !0,
  478. placement: "top",
  479. selector: !1,
  480. template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
  481. trigger: "hover focus",
  482. title: "",
  483. delay: 0,
  484. html: !1,
  485. container: !1,
  486. viewport: {
  487. selector: "body",
  488. padding: 0
  489. }
  490. },
  491. i.prototype.init = function(e, i, o) {
  492. this.enabled = !0,
  493. this.type = e,
  494. this.$element = t(i),
  495. this.options = this.getOptions(o),
  496. this.$viewport = this.options.viewport && t(this.options.viewport.selector || this.options.viewport);
  497. for (var s = this.options.trigger.split(" "), n = s.length; n--; ) {
  498. var r = s[n];
  499. if ("click" == r)
  500. this.$element.on("click." + this.type, this.options.selector, t.proxy(this.toggle, this));
  501. else if ("manual" != r) {
  502. var a = "hover" == r ? "mouseenter" : "focusin"
  503. , l = "hover" == r ? "mouseleave" : "focusout";
  504. this.$element.on(a + "." + this.type, this.options.selector, t.proxy(this.enter, this)),
  505. this.$element.on(l + "." + this.type, this.options.selector, t.proxy(this.leave, this))
  506. }
  507. }
  508. this.options.selector ? this._options = t.extend({}, this.options, {
  509. trigger: "manual",
  510. selector: ""
  511. }) : this.fixTitle()
  512. }
  513. ,
  514. i.prototype.getDefaults = function() {
  515. return i.DEFAULTS
  516. }
  517. ,
  518. i.prototype.getOptions = function(e) {
  519. return e = t.extend({}, this.getDefaults(), this.$element.data(), e),
  520. e.delay && "number" == typeof e.delay && (e.delay = {
  521. show: e.delay,
  522. hide: e.delay
  523. }),
  524. e
  525. }
  526. ,
  527. i.prototype.getDelegateOptions = function() {
  528. var e = {}
  529. , i = this.getDefaults();
  530. return this._options && t.each(this._options, function(t, o) {
  531. i[t] != o && (e[t] = o)
  532. }),
  533. e
  534. }
  535. ,
  536. i.prototype.enter = function(e) {
  537. var i = e instanceof this.constructor ? e : t(e.currentTarget).data("bs." + this.type);
  538. return i || (i = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  539. t(e.currentTarget).data("bs." + this.type, i)),
  540. clearTimeout(i.timeout),
  541. i.hoverState = "in",
  542. i.options.delay && i.options.delay.show ? void (i.timeout = setTimeout(function() {
  543. "in" == i.hoverState && i.show()
  544. }, i.options.delay.show)) : i.show()
  545. }
  546. ,
  547. i.prototype.leave = function(e) {
  548. var i = e instanceof this.constructor ? e : t(e.currentTarget).data("bs." + this.type);
  549. return i || (i = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  550. t(e.currentTarget).data("bs." + this.type, i)),
  551. clearTimeout(i.timeout),
  552. i.hoverState = "out",
  553. i.options.delay && i.options.delay.hide ? void (i.timeout = setTimeout(function() {
  554. "out" == i.hoverState && i.hide()
  555. }, i.options.delay.hide)) : i.hide()
  556. }
  557. ,
  558. i.prototype.show = function() {
  559. var e = t.Event("show.bs." + this.type);
  560. if (this.hasContent() && this.enabled) {
  561. this.$element.trigger(e);
  562. var i = t.contains(document.documentElement, this.$element[0]);
  563. if (e.isDefaultPrevented() || !i)
  564. return;
  565. var o = this
  566. , s = this.tip()
  567. , n = this.getUID(this.type);
  568. this.setContent(),
  569. s.attr("id", n),
  570. this.$element.attr("aria-describedby", n),
  571. this.options.animation && s.addClass("fade");
  572. var r = "function" == typeof this.options.placement ? this.options.placement.call(this, s[0], this.$element[0]) : this.options.placement
  573. , a = /\s?auto?\s?/i
  574. , l = a.test(r);
  575. l && (r = r.replace(a, "") || "top"),
  576. s.detach().css({
  577. top: 0,
  578. left: 0,
  579. display: "block"
  580. }).addClass(r).data("bs." + this.type, this),
  581. this.options.container ? s.appendTo(this.options.container) : s.insertAfter(this.$element);
  582. var p = this.getPosition()
  583. , h = s[0].offsetWidth
  584. , f = s[0].offsetHeight;
  585. if (l) {
  586. var u = r
  587. , c = this.$element.parent()
  588. , d = this.getPosition(c);
  589. r = "bottom" == r && p.top + p.height + f - d.scroll > d.height ? "top" : "top" == r && p.top - d.scroll - f < 0 ? "bottom" : "right" == r && p.right + h > d.width ? "left" : "left" == r && p.left - h < d.left ? "right" : r,
  590. s.removeClass(u).addClass(r)
  591. }
  592. var g = this.getCalculatedOffset(r, p, h, f);
  593. this.applyPlacement(g, r);
  594. var y = function() {
  595. o.$element.trigger("shown.bs." + o.type),
  596. o.hoverState = null
  597. };
  598. t.support.transition && this.$tip.hasClass("fade") ? s.one("bsTransitionEnd", y).emulateTransitionEnd(150) : y()
  599. }
  600. }
  601. ,
  602. i.prototype.applyPlacement = function(e, i) {
  603. var o = this.tip()
  604. , s = o[0].offsetWidth
  605. , n = o[0].offsetHeight
  606. , r = parseInt(o.css("margin-top"), 10)
  607. , a = parseInt(o.css("margin-left"), 10);
  608. isNaN(r) && (r = 0),
  609. isNaN(a) && (a = 0),
  610. e.top = e.top + r,
  611. e.left = e.left + a,
  612. t.offset.setOffset(o[0], t.extend({
  613. using: function(t) {
  614. o.css({
  615. top: Math.round(t.top),
  616. left: Math.round(t.left)
  617. })
  618. }
  619. }, e), 0),
  620. o.addClass("in");
  621. var l = o[0].offsetWidth
  622. , p = o[0].offsetHeight;
  623. "top" == i && p != n && (e.top = e.top + n - p);
  624. var h = this.getViewportAdjustedDelta(i, e, l, p);
  625. h.left ? e.left += h.left : e.top += h.top;
  626. var f = h.left ? 2 * h.left - s + l : 2 * h.top - n + p
  627. , u = h.left ? "left" : "top"
  628. , c = h.left ? "offsetWidth" : "offsetHeight";
  629. o.offset(e),
  630. this.replaceArrow(f, o[0][c], u)
  631. }
  632. ,
  633. i.prototype.replaceArrow = function(t, e, i) {
  634. this.arrow().css(i, t ? 50 * (1 - t / e) + "%" : "")
  635. }
  636. ,
  637. i.prototype.setContent = function() {
  638. var t = this.tip()
  639. , e = this.getTitle();
  640. t.find(".tooltip-inner")[this.options.html ? "html" : "text"](e),
  641. t.removeClass("fade in top bottom left right")
  642. }
  643. ,
  644. i.prototype.hide = function() {
  645. function e() {
  646. "in" != i.hoverState && o.detach(),
  647. i.$element.trigger("hidden.bs." + i.type)
  648. }
  649. var i = this
  650. , o = this.tip()
  651. , s = t.Event("hide.bs." + this.type);
  652. if (this.$element.removeAttr("aria-describedby"),
  653. this.$element.trigger(s),
  654. !s.isDefaultPrevented())
  655. return o.removeClass("in"),
  656. t.support.transition && this.$tip.hasClass("fade") ? o.one("bsTransitionEnd", e).emulateTransitionEnd(150) : e(),
  657. this.hoverState = null,
  658. this
  659. }
  660. ,
  661. i.prototype.fixTitle = function() {
  662. var t = this.$element;
  663. (t.attr("title") || "string" != typeof t.attr("data-original-title")) && t.attr("data-original-title", t.attr("title") || "").attr("title", "")
  664. }
  665. ,
  666. i.prototype.hasContent = function() {
  667. return this.getTitle()
  668. }
  669. ,
  670. i.prototype.getPosition = function(e) {
  671. e = e || this.$element;
  672. var i = e[0]
  673. , o = "BODY" == i.tagName;
  674. return t.extend({}, "function" == typeof i.getBoundingClientRect ? i.getBoundingClientRect() : null, {
  675. scroll: o ? document.documentElement.scrollTop || document.body.scrollTop : e.scrollTop(),
  676. width: o ? t(window).width() : e.outerWidth(),
  677. height: o ? t(window).height() : e.outerHeight()
  678. }, o ? {
  679. top: 0,
  680. left: 0
  681. } : e.offset())
  682. }
  683. ,
  684. i.prototype.getCalculatedOffset = function(t, e, i, o) {
  685. return "bottom" == t ? {
  686. top: e.top + e.height,
  687. left: e.left + e.width / 2 - i / 2
  688. } : "top" == t ? {
  689. top: e.top - o,
  690. left: e.left + e.width / 2 - i / 2
  691. } : "left" == t ? {
  692. top: e.top + e.height / 2 - o / 2,
  693. left: e.left - i
  694. } : {
  695. top: e.top + e.height / 2 - o / 2,
  696. left: e.left + e.width
  697. }
  698. }
  699. ,
  700. i.prototype.getViewportAdjustedDelta = function(t, e, i, o) {
  701. var s = {
  702. top: 0,
  703. left: 0
  704. };
  705. if (!this.$viewport)
  706. return s;
  707. var n = this.options.viewport && this.options.viewport.padding || 0
  708. , r = this.getPosition(this.$viewport);
  709. if (/right|left/.test(t)) {
  710. var a = e.top - n - r.scroll
  711. , l = e.top + n - r.scroll + o;
  712. a < r.top ? s.top = r.top - a : l > r.top + r.height && (s.top = r.top + r.height - l)
  713. } else {
  714. var p = e.left - n
  715. , h = e.left + n + i;
  716. p < r.left ? s.left = r.left - p : h > r.width && (s.left = r.left + r.width - h)
  717. }
  718. return s
  719. }
  720. ,
  721. i.prototype.getTitle = function() {
  722. var t, e = this.$element, i = this.options;
  723. return t = e.attr("data-original-title") || ("function" == typeof i.title ? i.title.call(e[0]) : i.title)
  724. }
  725. ,
  726. i.prototype.getUID = function(t) {
  727. do
  728. t += ~~(1e6 * Math.random());
  729. while (document.getElementById(t));return t
  730. }
  731. ,
  732. i.prototype.tip = function() {
  733. return this.$tip = this.$tip || t(this.options.template)
  734. }
  735. ,
  736. i.prototype.arrow = function() {
  737. return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
  738. }
  739. ,
  740. i.prototype.validate = function() {
  741. this.$element[0].parentNode || (this.hide(),
  742. this.$element = null,
  743. this.options = null)
  744. }
  745. ,
  746. i.prototype.enable = function() {
  747. this.enabled = !0
  748. }
  749. ,
  750. i.prototype.disable = function() {
  751. this.enabled = !1
  752. }
  753. ,
  754. i.prototype.toggleEnabled = function() {
  755. this.enabled = !this.enabled
  756. }
  757. ,
  758. i.prototype.toggle = function(e) {
  759. var i = this;
  760. e && (i = t(e.currentTarget).data("bs." + this.type),
  761. i || (i = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  762. t(e.currentTarget).data("bs." + this.type, i))),
  763. i.tip().hasClass("in") ? i.leave(i) : i.enter(i)
  764. }
  765. ,
  766. i.prototype.destroy = function() {
  767. clearTimeout(this.timeout),
  768. this.hide().$element.off("." + this.type).removeData("bs." + this.type)
  769. }
  770. ;
  771. var o = t.fn.tooltip;
  772. t.fn.tooltip = e,
  773. t.fn.tooltip.Constructor = i,
  774. t.fn.tooltip.noConflict = function() {
  775. return t.fn.tooltip = o,
  776. this
  777. }
  778. }(jQuery);
  779. !function(e, t, n) {
  780. "undefined" != typeof module && module.exports ? module.exports = n() : "function" == typeof define && define.amd ? define(n) : t[e] = n()
  781. }("Keen", this, function() {
  782. "use strict";
  783. function Keen() {
  784. return _init.apply(this, arguments)
  785. }
  786. function _init(e) {
  787. if (_isUndefined(e))
  788. throw new Error("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  789. if (_isUndefined(e.projectId) || "String" !== _type(e.projectId) || e.projectId.length < 1)
  790. throw new Error("Please provide a projectId");
  791. this.configure(e)
  792. }
  793. function _extend(e) {
  794. for (var t = 1; t < arguments.length; t++)
  795. for (var n in arguments[t])
  796. e[n] = arguments[t][n];
  797. return e
  798. }
  799. function _isUndefined(e) {
  800. return void 0 === e
  801. }
  802. function _type(e) {
  803. var t = e && e.constructor ? e.constructor.toString() : void 0;
  804. return t ? t.match(/function (.*)\(/)[1] : "Null"
  805. }
  806. function _each(e, t, n) {
  807. var r;
  808. if (!e)
  809. return 0;
  810. if (n = n ? n : e,
  811. "array" === _type(e)) {
  812. for (r = 0; r < e.length; r++)
  813. if (t.call(n, e[r], r, e) === !1)
  814. return 0
  815. } else
  816. for (r in e)
  817. if (e.hasOwnProperty(r) && t.call(n, e[r], r, e) === !1)
  818. return 0;
  819. return 1
  820. }
  821. function _parse_params(e) {
  822. for (var t, n = {}, r = /\+/g, i = /([^&=]+)=?([^&]*)/g, o = function(e) {
  823. return decodeURIComponent(e.replace(r, " "))
  824. }, a = e.split("?")[1]; t = i.exec(a); )
  825. n[o(t[1])] = o(t[2]);
  826. return n
  827. }
  828. function _set_protocol(e) {
  829. switch (e) {
  830. case "http":
  831. return "http";
  832. case "auto":
  833. return location.protocol.replace(/:/g, "");
  834. case "https":
  835. case void 0:
  836. default:
  837. return "https"
  838. }
  839. }
  840. function _set_request_type(e) {
  841. var t = e || "jsonp"
  842. , n = !1;
  843. return ("Object" === _type(XMLHttpRequest) || "Function" === _type(XMLHttpRequest)) && "withCredentials"in new XMLHttpRequest && (n = !0),
  844. null == t || "xhr" == t ? n ? "xhr" : "jsonp" : t
  845. }
  846. function _build_url(e) {
  847. return this.client.endpoint + "/projects/" + this.client.projectId + e
  848. }
  849. function _uploadEvent(e, t, n, r, i) {
  850. var o = _build_url.apply(this, ["/events/" + e])
  851. , a = {};
  852. n = n !== !1,
  853. this.client.globalProperties && (a = this.client.globalProperties(e));
  854. for (var c in t)
  855. t.hasOwnProperty(c) && (a[c] = t[c]);
  856. switch (this.client.requestType) {
  857. case "xhr":
  858. _request.xhr.apply(this, ["POST", o, null, a, this.client.writeKey, n, r, i]);
  859. break;
  860. case "jsonp":
  861. var s = JSON.stringify(a)
  862. , l = Keen.Base64.encode(s);
  863. o = o + "?api_key=" + this.client.writeKey,
  864. o = o + "&data=" + l,
  865. o = o + "&modified=" + (new Date).getTime(),
  866. _request.jsonp.apply(this, [o, this.client.writeKey, r, i]);
  867. break;
  868. case "beacon":
  869. var s = JSON.stringify(a)
  870. , l = Keen.Base64.encode(s);
  871. o = o + "?api_key=" + encodeURIComponent(this.client.writeKey),
  872. o = o + "&data=" + encodeURIComponent(l),
  873. o = o + "&modified=" + encodeURIComponent((new Date).getTime()),
  874. o += "&c=clv1",
  875. _request.beacon.apply(this, [o, null, r, i])
  876. }
  877. }
  878. Keen.prototype.configure = function(e) {
  879. return e.host = _isUndefined(e.host) ? "api.keen.io/3.0" : e.host.replace(/.*?:\/\//g, ""),
  880. e.protocol = _set_protocol(e.protocol),
  881. e.requestType = _set_request_type(e.requestType),
  882. this.client = {
  883. projectId: e.projectId,
  884. writeKey: e.writeKey,
  885. readKey: e.readKey,
  886. globalProperties: null,
  887. endpoint: e.protocol + "://" + e.host,
  888. requestType: e.requestType
  889. },
  890. Keen.trigger("client", this, e),
  891. this.trigger("ready"),
  892. this
  893. }
  894. ;
  895. var _request = {
  896. xhr: function(e, t, n, r, i, o, a, c) {
  897. if (!i)
  898. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  899. var s = new XMLHttpRequest;
  900. if (s.onreadystatechange = function() {
  901. if (4 == s.readyState)
  902. if (s.status >= 200 && s.status < 300) {
  903. var e;
  904. try {
  905. e = JSON.parse(s.responseText)
  906. } catch (e) {
  907. Keen.log("Could not JSON parse HTTP response: " + s.responseText),
  908. c && c(s, e)
  909. }
  910. a && e && a(e)
  911. } else
  912. Keen.log("HTTP request failed."),
  913. c && c(s, null)
  914. }
  915. ,
  916. s.open(e, t, o),
  917. i && s.setRequestHeader("Authorization", i),
  918. r && s.setRequestHeader("Content-Type", "application/json"),
  919. n)
  920. for (var l in n)
  921. n.hasOwnProperty(l) && s.setRequestHeader(l, n[l]);
  922. var u = r ? JSON.stringify(r) : null;
  923. s.send(u)
  924. },
  925. jsonp: function(e, t, n, r) {
  926. if (!t)
  927. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  928. if (t && e.indexOf("api_key") < 0) {
  929. var i = e.indexOf("?") > 0 ? "&" : "?";
  930. e = e + i + "api_key=" + t
  931. }
  932. for (var o = "keenJSONPCallback" + (new Date).getTime(); o in window; )
  933. o += "a";
  934. var a = !1;
  935. window[o] = function(e) {
  936. a = !0,
  937. n && e && n(e),
  938. window[o] = void 0
  939. }
  940. ,
  941. e = e + "&jsonp=" + o;
  942. var c = document.createElement("script");
  943. c.id = "keen-jsonp",
  944. c.src = e,
  945. document.getElementsByTagName("head")[0].appendChild(c),
  946. c.onreadystatechange = function() {
  947. a === !1 && "loaded" === this.readyState && (a = !0,
  948. r && r())
  949. }
  950. ,
  951. c.onerror = function() {
  952. a === !1 && (a = !0,
  953. r && r())
  954. }
  955. },
  956. beacon: function(e, t, n, r) {
  957. if (t && e.indexOf("api_key") < 0) {
  958. var i = e.indexOf("?") > 0 ? "&" : "?";
  959. e = e + i + "api_key=" + t
  960. }
  961. var o = !1
  962. , a = document.createElement("img");
  963. a.onload = function() {
  964. if (o = !0,
  965. "naturalHeight"in this) {
  966. if (this.naturalHeight + this.naturalWidth === 0)
  967. return void this.onerror()
  968. } else if (this.width + this.height === 0)
  969. return void this.onerror();
  970. n && n({
  971. created: !0
  972. })
  973. }
  974. ,
  975. a.onerror = function() {
  976. o = !0,
  977. r && r()
  978. }
  979. ,
  980. a.src = e
  981. }
  982. }
  983. , Events = Keen.Events = {
  984. on: function(e, t) {
  985. this.listeners || (this.listeners = {});
  986. var n = this.listeners[e] || (this.listeners[e] = []);
  987. return n.push({
  988. callback: t
  989. }),
  990. this
  991. },
  992. off: function(e, t) {
  993. if (!e && !t)
  994. return this.listeners = void 0,
  995. delete this.listeners,
  996. this;
  997. for (var n = this.listeners[e] || [], r = n.length; r--; )
  998. t && t == n[r].callback && this.listeners[e].splice(r, 1),
  999. t && 0 != n.length || (this.listeners[e] = void 0,
  1000. delete this.listeners[e]);
  1001. return this
  1002. },
  1003. trigger: function(e) {
  1004. if (!this.listeners)
  1005. return this;
  1006. for (var t = Array.prototype.slice.call(arguments, 1), n = this.listeners[e] || [], r = 0; r < n.length; r++)
  1007. n[r].callback.apply(this, t);
  1008. return this
  1009. }
  1010. };
  1011. _extend(Keen.prototype, Events),
  1012. _extend(Keen, Events),
  1013. Keen.loaded = !0,
  1014. Keen.utils = {
  1015. each: _each,
  1016. extend: _extend,
  1017. parseParams: _parse_params
  1018. },
  1019. Keen.ready = function(e) {
  1020. Keen.loaded ? e() : Keen.on("ready", e)
  1021. }
  1022. ,
  1023. Keen.log = function(e) {
  1024. "object" == typeof console && console.log("[Keen IO]", e)
  1025. }
  1026. ;
  1027. var Plugins = Keen.Plugins = {};
  1028. Keen.prototype.addEvent = function() {
  1029. _uploadEvent.apply(this, arguments)
  1030. }
  1031. ,
  1032. Keen.prototype.addEventSync = function(e, t, n, r) {
  1033. _uploadEvent.apply(this, [e, t, !1, n, r])
  1034. }
  1035. ,
  1036. Keen.prototype.trackExternalLink = function(e, t, n, r, i) {
  1037. var o = e
  1038. , a = o.metaKey
  1039. , c = o.target
  1040. , s = !1
  1041. , l = function() {};
  1042. return void 0 === r && (r = 500),
  1043. "A" === c.nodeName ? l = function() {
  1044. a || s || (s = !0,
  1045. window.location = c.href)
  1046. }
  1047. : "FORM" === c.nodeName && (l = function() {
  1048. s || (s = !0,
  1049. c.submit())
  1050. }
  1051. ),
  1052. i && (l = function() {
  1053. s || (s = !0,
  1054. i())
  1055. }
  1056. ),
  1057. _uploadEvent.call(this, t, n, l, l),
  1058. setTimeout(function() {
  1059. l()
  1060. }, r),
  1061. !!a && void 0
  1062. }
  1063. ,
  1064. Keen.prototype.setGlobalProperties = function(e) {
  1065. if (!this.client)
  1066. return Keen.log("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  1067. if (!e || "function" != typeof e)
  1068. throw new Error("Invalid value for global properties: " + e);
  1069. this.client.globalProperties = e
  1070. }
  1071. ,
  1072. Keen.Base64 = {
  1073. map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  1074. encode: function(e) {
  1075. var t, n, r, i, o, a, c, s = "", l = 0, u = this.map;
  1076. for (e = this.utf8.encode(e); l < e.length; )
  1077. t = e.charCodeAt(l++),
  1078. n = e.charCodeAt(l++),
  1079. r = e.charCodeAt(l++),
  1080. i = t >> 2,
  1081. o = (3 & t) << 4 | n >> 4,
  1082. a = isNaN(n) ? 64 : (15 & n) << 2 | r >> 6,
  1083. c = isNaN(n) || isNaN(r) ? 64 : 63 & r,
  1084. s = s + u.charAt(i) + u.charAt(o) + u.charAt(a) + u.charAt(c);
  1085. return s
  1086. },
  1087. decode: function(e) {
  1088. var t, n, r, i, o, a, c, s = "", l = 0, u = this.map, f = String.fromCharCode;
  1089. for (e = e.replace(/[^A-Za-z0-9\+\/\=]/g, ""); l < e.length; )
  1090. t = u.indexOf(e.charAt(l++)),
  1091. n = u.indexOf(e.charAt(l++)),
  1092. r = u.indexOf(e.charAt(l++)),
  1093. i = u.indexOf(e.charAt(l++)),
  1094. o = t << 2 | n >> 4,
  1095. a = (15 & n) << 4 | r >> 2,
  1096. c = (3 & r) << 6 | i,
  1097. s = s + (f(o) + (64 != r ? f(a) : "")) + (64 != i ? f(c) : "");
  1098. return this.utf8.decode(s)
  1099. },
  1100. utf8: {
  1101. encode: function(e) {
  1102. for (var t, n = "", r = 0, i = String.fromCharCode; r < e.length; )
  1103. t = e.charCodeAt(r++),
  1104. n += 128 > t ? i(t) : t > 127 && 2048 > t ? i(t >> 6 | 192) + i(63 & t | 128) : i(t >> 12 | 224) + i(t >> 6 & 63 | 128) + i(63 & t | 128);
  1105. return n
  1106. },
  1107. decode: function(e) {
  1108. for (var t, n, r = "", i = 0, o = String.fromCharCode; i < e.length; )
  1109. n = e.charCodeAt(i),
  1110. r += 128 > n ? [o(n), i++][0] : n > 191 && 224 > n ? [o((31 & n) << 6 | 63 & (t = e.charCodeAt(i + 1))), i += 2][0] : [o((15 & n) << 12 | (63 & (t = e.charCodeAt(i + 1))) << 6 | 63 & (c3 = e.charCodeAt(i + 2))), i += 3][0];
  1111. return r
  1112. }
  1113. }
  1114. },
  1115. "object" != typeof JSON && (JSON = {}),
  1116. function() {
  1117. function f(e) {
  1118. return 10 > e ? "0" + e : e
  1119. }
  1120. function quote(e) {
  1121. return escapable.lastIndex = 0,
  1122. escapable.test(e) ? '"' + e.replace(escapable, function(e) {
  1123. var t = meta[e];
  1124. return "string" == typeof t ? t : "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1125. }) + '"' : '"' + e + '"'
  1126. }
  1127. function str(e, t) {
  1128. var n, r, i, o, a, c = gap, s = t[e];
  1129. switch (s && "object" == typeof s && "function" == typeof s.toJSON && (s = s.toJSON(e)),
  1130. "function" == typeof rep && (s = rep.call(t, e, s)),
  1131. typeof s) {
  1132. case "string":
  1133. return quote(s);
  1134. case "number":
  1135. return isFinite(s) ? String(s) : "null";
  1136. case "boolean":
  1137. case "null":
  1138. return String(s);
  1139. case "object":
  1140. if (!s)
  1141. return "null";
  1142. if (gap += indent,
  1143. a = [],
  1144. "[object Array]" === Object.prototype.toString.apply(s)) {
  1145. for (o = s.length,
  1146. n = 0; o > n; n += 1)
  1147. a[n] = str(n, s) || "null";
  1148. return i = 0 === a.length ? "[]" : gap ? "[\n" + gap + a.join(",\n" + gap) + "\n" + c + "]" : "[" + a.join(",") + "]",
  1149. gap = c,
  1150. i
  1151. }
  1152. if (rep && "object" == typeof rep)
  1153. for (o = rep.length,
  1154. n = 0; o > n; n += 1)
  1155. "string" == typeof rep[n] && (r = rep[n],
  1156. i = str(r, s),
  1157. i && a.push(quote(r) + (gap ? ": " : ":") + i));
  1158. else
  1159. for (r in s)
  1160. Object.prototype.hasOwnProperty.call(s, r) && (i = str(r, s),
  1161. i && a.push(quote(r) + (gap ? ": " : ":") + i));
  1162. return i = 0 === a.length ? "{}" : gap ? "{\n" + gap + a.join(",\n" + gap) + "\n" + c + "}" : "{" + a.join(",") + "}",
  1163. gap = c,
  1164. i
  1165. }
  1166. }
  1167. "function" != typeof Date.prototype.toJSON && (Date.prototype.toJSON = function() {
  1168. 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
  1169. }
  1170. ,
  1171. String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function() {
  1172. return this.valueOf()
  1173. }
  1174. );
  1175. 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 = {
  1176. "\b": "\\b",
  1177. "\t": "\\t",
  1178. "\n": "\\n",
  1179. "\f": "\\f",
  1180. "\r": "\\r",
  1181. '"': '\\"',
  1182. "\\": "\\\\"
  1183. }, rep;
  1184. "function" != typeof JSON.stringify && (JSON.stringify = function(e, t, n) {
  1185. var r;
  1186. if (gap = "",
  1187. indent = "",
  1188. "number" == typeof n)
  1189. for (r = 0; n > r; r += 1)
  1190. indent += " ";
  1191. else
  1192. "string" == typeof n && (indent = n);
  1193. if (rep = t,
  1194. t && "function" != typeof t && ("object" != typeof t || "number" != typeof t.length))
  1195. throw new Error("JSON.stringify");
  1196. return str("", {
  1197. "": e
  1198. })
  1199. }
  1200. ),
  1201. "function" != typeof JSON.parse && (JSON.parse = function(text, reviver) {
  1202. function walk(e, t) {
  1203. var n, r, i = e[t];
  1204. if (i && "object" == typeof i)
  1205. for (n in i)
  1206. Object.prototype.hasOwnProperty.call(i, n) && (r = walk(i, n),
  1207. void 0 !== r ? i[n] = r : delete i[n]);
  1208. return reviver.call(e, t, i)
  1209. }
  1210. var j;
  1211. if (text = String(text),
  1212. cx.lastIndex = 0,
  1213. cx.test(text) && (text = text.replace(cx, function(e) {
  1214. return "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1215. })),
  1216. /^[\],:{}\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, "")))
  1217. return j = eval("(" + text + ")"),
  1218. "function" == typeof reviver ? walk({
  1219. "": j
  1220. }, "") : j;
  1221. throw new SyntaxError("JSON.parse")
  1222. }
  1223. )
  1224. }(),
  1225. !function(e, t, n) {
  1226. "undefined" != typeof module && module.exports ? module.exports = n() : "function" == typeof define && define.amd ? define(n) : t[e] = n()
  1227. }("domready", Keen.utils, function(e) {
  1228. function t(e) {
  1229. for (d = 1; e = r.shift(); )
  1230. e()
  1231. }
  1232. var n, r = [], i = !1, o = document, a = o.documentElement, c = a.doScroll, s = "DOMContentLoaded", l = "addEventListener", u = "onreadystatechange", f = "readyState", p = c ? /^loaded|^c/ : /^loaded|c/, d = p.test(o[f]);
  1233. return o[l] && o[l](s, n = function() {
  1234. o.removeEventListener(s, n, i),
  1235. t()
  1236. }
  1237. , i),
  1238. c && o.attachEvent(u, n = function() {
  1239. /^c/.test(o[f]) && (o.detachEvent(u, n),
  1240. t())
  1241. }
  1242. ),
  1243. e = c ? function(t) {
  1244. self != top ? d ? t() : r.push(t) : function() {
  1245. try {
  1246. a.doScroll("left")
  1247. } catch (n) {
  1248. return setTimeout(function() {
  1249. e(t)
  1250. }, 50)
  1251. }
  1252. t()
  1253. }()
  1254. }
  1255. : function(e) {
  1256. d ? e() : r.push(e)
  1257. }
  1258. });
  1259. var loaded = window.Keen, cached = window._Keen || {}, clients, ready;
  1260. if (loaded && cached) {
  1261. clients = cached.clients || {},
  1262. ready = cached.ready || [];
  1263. for (var instance in clients)
  1264. if (clients.hasOwnProperty(instance)) {
  1265. var client = clients[instance];
  1266. for (var method in Keen.prototype)
  1267. Keen.prototype.hasOwnProperty(method) && (loaded.prototype[method] = Keen.prototype[method]);
  1268. if (loaded.Query = Keen.Query ? Keen.Query : function() {}
  1269. ,
  1270. loaded.Visualization = Keen.Visualization ? Keen.Visualization : function() {}
  1271. ,
  1272. client._config && (client.configure.call(client, client._config),
  1273. delete client._config),
  1274. client._setGlobalProperties) {
  1275. for (var globals = client._setGlobalProperties, i = 0; i < globals.length; i++)
  1276. client.setGlobalProperties.apply(client, globals[i]);
  1277. delete client._setGlobalProperties
  1278. }
  1279. if (client._addEvent) {
  1280. for (var queue = client._addEvent || [], i = 0; i < queue.length; i++)
  1281. client.addEvent.apply(client, queue[i]);
  1282. delete client._addEvent
  1283. }
  1284. var callback = client._on || [];
  1285. if (client._on) {
  1286. for (var i = 0; i < callback.length; i++)
  1287. client.on.apply(client, callback[i]);
  1288. client.trigger("ready"),
  1289. delete client._on
  1290. }
  1291. }
  1292. for (var i = 0; i < ready.length; i++) {
  1293. var callback = ready[i];
  1294. Keen.on("ready", function() {
  1295. callback()
  1296. })
  1297. }
  1298. }
  1299. return Keen.loaded && setTimeout(function() {
  1300. Keen.utils.domready(function() {
  1301. Keen.trigger("ready")
  1302. })
  1303. }, 0),
  1304. Keen
  1305. });
  1306. !function() {
  1307. var t = window.analytics = window.analytics || [];
  1308. if (!t.initialize) {
  1309. if (t.invoked)
  1310. return void (window.console && console.error && console.error("Segment snippet included twice."));
  1311. t.invoked = !0,
  1312. t.methods = ["trackSubmit", "trackClick", "trackLink", "trackForm", "pageview", "identify", "reset", "group", "track", "ready", "alias", "debug", "page", "once", "off", "on"],
  1313. t.factory = function(e) {
  1314. return function() {
  1315. var n = Array.prototype.slice.call(arguments);
  1316. return n.unshift(e),
  1317. t.push(n),
  1318. t
  1319. }
  1320. }
  1321. ;
  1322. for (var e = 0; e < t.methods.length; e++) {
  1323. var n = t.methods[e];
  1324. t[n] = t.factory(n)
  1325. }
  1326. t.load = function(t) {
  1327. var e = document.createElement("script");
  1328. e.type = "text/javascript",
  1329. e.async = !0,
  1330. e.src = ("https:" === document.location.protocol ? "https://" : "http://") + "cdn.segment.com/analytics.js/v1/" + t + "/analytics.min.js";
  1331. var n = document.getElementsByTagName("script")[0];
  1332. n.parentNode.insertBefore(e, n)
  1333. }
  1334. ,
  1335. t.SNIPPET_VERSION = "4.0.0"
  1336. }
  1337. }();
  1338. !function(i, e) {
  1339. "use strict";
  1340. var s = ""
  1341. , r = "?"
  1342. , o = "function"
  1343. , a = "undefined"
  1344. , n = "object"
  1345. , t = "major"
  1346. , d = "model"
  1347. , w = "name"
  1348. , l = "type"
  1349. , p = "vendor"
  1350. , m = "version"
  1351. , c = "architecture"
  1352. , u = "console"
  1353. , g = "mobile"
  1354. , f = "tablet"
  1355. , h = "smarttv"
  1356. , b = {
  1357. has: function(i, e) {
  1358. return e.toLowerCase().indexOf(i.toLowerCase()) !== -1
  1359. },
  1360. lowerize: function(i) {
  1361. return i.toLowerCase()
  1362. }
  1363. }
  1364. , y = {
  1365. rgx: function() {
  1366. for (var i, s, r, t, d, w, l, p = 0, m = arguments; p < m.length; p += 2) {
  1367. var c = m[p]
  1368. , u = m[p + 1];
  1369. if (typeof i === a) {
  1370. i = {};
  1371. for (t in u)
  1372. d = u[t],
  1373. typeof d === n ? i[d[0]] = e : i[d] = e
  1374. }
  1375. for (s = r = 0; s < c.length; s++)
  1376. if (w = c[s].exec(this.getUA())) {
  1377. for (t = 0; t < u.length; t++)
  1378. l = w[++r],
  1379. d = u[t],
  1380. typeof d === n && d.length > 0 ? 2 == d.length ? typeof d[1] == o ? i[d[0]] = d[1].call(this, l) : i[d[0]] = d[1] : 3 == d.length ? typeof d[1] !== o || d[1].exec && d[1].test ? i[d[0]] = l ? l.replace(d[1], d[2]) : e : i[d[0]] = l ? d[1].call(this, l, d[2]) : e : 4 == d.length && (i[d[0]] = l ? d[3].call(this, l.replace(d[1], d[2])) : e) : i[d] = l ? l : e;
  1381. break
  1382. }
  1383. if (w)
  1384. break
  1385. }
  1386. return i
  1387. },
  1388. str: function(i, s) {
  1389. for (var o in s)
  1390. if (typeof s[o] === n && s[o].length > 0) {
  1391. for (var a = 0; a < s[o].length; a++)
  1392. if (b.has(s[o][a], i))
  1393. return o === r ? e : o
  1394. } else if (b.has(s[o], i))
  1395. return o === r ? e : o;
  1396. return i
  1397. }
  1398. }
  1399. , v = {
  1400. browser: {
  1401. oldsafari: {
  1402. major: {
  1403. 1: ["/8", "/1", "/3"],
  1404. 2: "/4",
  1405. "?": "/"
  1406. },
  1407. version: {
  1408. "1.0": "/8",
  1409. 1.2: "/1",
  1410. 1.3: "/3",
  1411. "2.0": "/412",
  1412. "2.0.2": "/416",
  1413. "2.0.3": "/417",
  1414. "2.0.4": "/419",
  1415. "?": "/"
  1416. }
  1417. }
  1418. },
  1419. device: {
  1420. sprint: {
  1421. model: {
  1422. "Evo Shift 4G": "7373KT"
  1423. },
  1424. vendor: {
  1425. HTC: "APA",
  1426. Sprint: "Sprint"
  1427. }
  1428. }
  1429. },
  1430. os: {
  1431. windows: {
  1432. version: {
  1433. ME: "4.90",
  1434. "NT 3.11": "NT3.51",
  1435. "NT 4.0": "NT4.0",
  1436. 2e3: "NT 5.0",
  1437. XP: ["NT 5.1", "NT 5.2"],
  1438. Vista: "NT 6.0",
  1439. 7: "NT 6.1",
  1440. 8: "NT 6.2",
  1441. 8.1: "NT 6.3",
  1442. RT: "ARM"
  1443. }
  1444. }
  1445. }
  1446. }
  1447. , k = {
  1448. browser: [[/(opera\smini)\/((\d+)?[\w\.-]+)/i, /(opera\s[mobiletab]+).+version\/((\d+)?[\w\.-]+)/i, /(opera).+version\/((\d+)?[\w\.]+)/i, /(opera)[\/\s]+((\d+)?[\w\.]+)/i], [w, m, t], [/\s(opr)\/((\d+)?[\w\.]+)/i], [[w, "Opera"], m, t], [/(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], [w, m, t], [/(trident).+rv[:\s]((\d+)?[\w\.]+).+like\sgecko/i], [[w, "IE"], m, t], [/(yabrowser)\/((\d+)?[\w\.]+)/i], [[w, "Yandex"], m, t], [/(comodo_dragon)\/((\d+)?[\w\.]+)/i], [[w, /_/g, " "], m, t], [/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?((\d+)?[\w\.]+)/i], [w, m, t], [/(dolfin)\/((\d+)?[\w\.]+)/i], [[w, "Dolphin"], m, t], [/((?:android.+)crmo|crios)\/((\d+)?[\w\.]+)/i], [[w, "Chrome"], m, t], [/version\/((\d+)?[\w\.]+).+?mobile\/\w+\s(safari)/i], [m, t, [w, "Mobile Safari"]], [/version\/((\d+)?[\w\.]+).+?(mobile\s?safari|safari)/i], [m, t, w], [/webkit.+?(mobile\s?safari|safari)((\/[\w\.]+))/i], [w, [t, y.str, v.browser.oldsafari.major], [m, y.str, v.browser.oldsafari.version]], [/(konqueror)\/((\d+)?[\w\.]+)/i, /(webkit|khtml)\/((\d+)?[\w\.]+)/i], [w, m, t], [/(navigator|netscape)\/((\d+)?[\w\.-]+)/i], [[w, "Netscape"], m, t], [/(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], [w, m, t], [/(apple(?:coremedia|))\/((\d+)[\w\._]+)/i, /(coremedia) v((\d+)[\w\._]+)/i], [w, m, t], [/(aqualung|lyssna|bsplayer)\/([\w\.-]+)/i], [w, m], [/(ares|ossproxy)\s((\d+)[\w\.-]+)/i], [w, m, t], [/(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], [w, m, t], [/(nexplayer)\s((\d+)[\w\.-]+)/i], [w, m, t], [/(flrp)\/((\d+)[\w\.-]+)/i], [[w, "Flip Player"], m, t], [/(fstream|nativehost|queryseekspider|ia-archiver|facebookexternalhit)/i], [w], [/(gstreamer) souphttpsrc (?:\([^\)]+\)){0,1} libsoup\/((\d+)[\w\.-]+)/i], [w, m, t], [/(htc streaming player)\s[\w_]+\s\/\s((\d+)[\d\.]+)/i, /(java|python-urllib|python-requests|wget|libcurl)\/((\d+)[\w\.-_]+)/i, /(lavf)((\d+)[\d\.]+)/i], [w, m, t], [/(htc_one_s)\/((\d+)[\d\.]+)/i], [[w, /_/g, " "], m, t], [/(mplayer)(?:\s|\/)(?:(?:sherpya-){0,1}svn)(?:-|\s)(r\d+(?:-\d+[\w\.-]+){0,1})/i], [w, m], [/(mplayer)(?:\s|\/)((\d+)[\w\.-]+)/i, /(mplayer) unknown-((\d+)[\w\.\-]+)/i], [w, m, t], [/(mplayer)/i, /(yourmuze)/i, /(media player classic|nero showtime)/i], [w], [/(nero (?:home|scout))\/((\d+)[\w\.-]+)/i], [w, m, t], [/(nokia\d+)\/((\d+)[\w\.-]+)/i], [w, m, t], [/\s(songbird)\/((\d+)[\w\.-]+)/i], [w, m, t], [/(winamp)3 version ((\d+)[\w\.-]+)/i, /(winamp)\s((\d+)[\w\.-]+)/i, /(winamp)mpeg\/((\d+)[\w\.-]+)/i], [w, m, t], [/(ocms-bot|tapinradio|tunein radio|unknown|winamp|inlight radio)/i], [w], [/(quicktime|rma|radioapp|radioclientapplication|soundtap|totem|stagefright|streamium)\/((\d+)[\w\.-]+)/i], [w, m, t], [/(smp)((\d+)[\d\.]+)/i], [w, m, t], [/(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], [w, m, t], [/(wmplayer)\/((\d+)[\w\.-]+)/i, /(windows-media-player)\/((\d+)[\w\.-]+)/i], [[w, /-/g, " "], m, t], [/windows\/((\d+)[\w\.-]+) upnp\/[\d\.]+ dlnadoc\/[\d\.]+ (home media server)/i], [m, t, [w, "Windows"]], [/(com\.riseupradioalarm)\/((\d+)[\d\.]*)/i], [w, m, t], [/(rad.io)\s((\d+)[\d\.]+)/i, /(radio.(?:de|at|fr))\s((\d+)[\d\.]+)/i], [[w, "rad.io"], m, t]],
  1449. cpu: [[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i], [[c, "amd64"]], [/(ia32(?=;))/i], [[c, b.lowerize]], [/((?:i[346]|x)86)[;\)]/i], [[c, "ia32"]], [/windows\s(ce|mobile);\sppc;/i], [[c, "arm"]], [/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i], [[c, /ower/, "", b.lowerize]], [/(sun4\w)[;\)]/i], [[c, "sparc"]], [/(ia64(?=;)|68k(?=\))|arm(?=v\d+;)|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i], [c, b.lowerize]],
  1450. device: [[/\((ipad|playbook);[\w\s\);-]+(rim|apple)/i], [d, p, [l, f]], [/applecoremedia\/[\w\.]+ \((ipad)/], [d, [p, "Apple"], [l, f]], [/(apple\s{0,1}tv)/i], [[d, "Apple TV"], [p, "Apple"]], [/(hp).+(touchpad)/i, /(kindle)\/([\w\.]+)/i, /\s(nook)[\w\s]+build\/(\w+)/i, /(dell)\s(strea[kpr\s\d]*[\dko])/i], [p, d, [l, f]], [/\((ip[honed|\s\w*]+);.+(apple)/i], [d, p, [l, g]], [/\((ip[honed|\s\w*]+);/i], [d, [p, "Apple"], [l, g]], [/(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], [p, d, [l, g]], [/\((bb10);\s(\w+)/i], [[p, "BlackBerry"], d, [l, g]], [/android.+((transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+))/i], [[p, "Asus"], d, [l, f]], [/(sony)\s(tablet\s[ps])/i], [p, d, [l, f]], [/(nintendo)\s([wids3u]+)/i], [p, d, [l, u]], [/((playstation)\s[3portablevi]+)/i], [[p, "Sony"], d, [l, u]], [/(sprint\s(\w+))/i], [[p, y.str, v.device.sprint.vendor], [d, y.str, v.device.sprint.model], [l, g]], [/(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i, /(zte)-(\w+)*/i, /(alcatel|geeksphone|huawei|lenovo|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]+)*/i], [p, [d, /_/g, " "], [l, g]], [/\s((milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?(:?\s4g)?))[\w\s]+build\//i, /(mot)[\s-]?(\w+)*/i], [[p, "Motorola"], d, [l, g]], [/android.+\s((mz60\d|xoom[\s2]{0,2}))\sbuild\//i], [[p, "Motorola"], d, [l, f]], [/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n8000|sgh-t8[56]9))/i], [[p, "Samsung"], d, [l, f]], [/((s[cgp]h-\w+|gt-\w+|galaxy\snexus))/i, /(sam[sung]*)[\s-]*(\w+-?[\w-]*)*/i, /sec-((sgh\w+))/i], [[p, "Samsung"], d, [l, g]], [/(sie)-(\w+)*/i], [[p, "Siemens"], d, [l, g]], [/(maemo|nokia).*(n900|lumia\s\d+)/i, /(nokia)[\s_-]?([\w-]+)*/i], [[p, "Nokia"], d, [l, g]], [/android\s3\.[\s\w-;]{10}((a\d{3}))/i], [[p, "Acer"], d, [l, f]], [/android\s3\.[\s\w-;]{10}(lg?)-([06cv9]{3,4})/i], [[p, "LG"], d, [l, f]], [/((nexus\s[45]))/i, /(lg)[e;\s-\/]+(\w+)*/i], [[p, "LG"], d, [l, g]], [/android.+((ideatab[a-z0-9\-\s]+))/i], [[p, "Lenovo"], d, [l, f]], [/(lg) netcast\.tv/i], [p, [l, h]], [/(mobile|tablet);.+rv\:.+gecko\//i], [l, p, d]],
  1451. engine: [[/(presto)\/([\w\.]+)/i, /(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i, /(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i, /(icab)[\/\s]([23]\.[\d\.]+)/i], [w, m], [/rv\:([\w\.]+).*(gecko)/i], [m, w]],
  1452. os: [[/microsoft\s(windows)\s(vista|xp)/i], [w, m], [/(windows)\snt\s6\.2;\s(arm)/i, /(windows\sphone(?:\sos)*|windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i], [w, [m, y.str, v.os.windows.version]], [/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i], [[w, "Windows"], [m, y.str, v.os.windows.version]], [/\((bb)(10);/i], [[w, "BlackBerry"], m], [/(blackberry)\w*\/?([\w\.]+)*/i, /(tizen)\/([\w\.]+)/i, /(android|webos|palm\os|qnx|bada|rim\stablet\sos|meego)[\/\s-]?([\w\.]+)*/i], [w, m], [/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i], [[w, "Symbian"], m], [/mozilla.+\(mobile;.+gecko.+firefox/i], [[w, "Firefox OS"], m], [/(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], [w, m], [/(cros)\s[\w]+\s([\w\.]+\w)/i], [[w, "Chromium OS"], m], [/(sunos)\s?([\w\.]+\d)*/i], [[w, "Solaris"], m], [/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i], [w, m], [/(ip[honead]+)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i], [[w, "iOS"], [m, /_/g, "."]], [/(mac\sos\sx)\s?([\w\s\.]+\w)*/i], [w, [m, /_/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], [w, m]]
  1453. }
  1454. , x = function(e) {
  1455. var r = e || (i && i.navigator && i.navigator.userAgent ? i.navigator.userAgent : s);
  1456. return this instanceof x ? (this.getBrowser = function() {
  1457. return y.rgx.apply(this, k.browser)
  1458. }
  1459. ,
  1460. this.getCPU = function() {
  1461. return y.rgx.apply(this, k.cpu)
  1462. }
  1463. ,
  1464. this.getDevice = function() {
  1465. return y.rgx.apply(this, k.device)
  1466. }
  1467. ,
  1468. this.getEngine = function() {
  1469. return y.rgx.apply(this, k.engine)
  1470. }
  1471. ,
  1472. this.getOS = function() {
  1473. return y.rgx.apply(this, k.os)
  1474. }
  1475. ,
  1476. this.getResult = function() {
  1477. return {
  1478. ua: this.getUA(),
  1479. browser: this.getBrowser(),
  1480. engine: this.getEngine(),
  1481. os: this.getOS(),
  1482. device: this.getDevice(),
  1483. cpu: this.getCPU()
  1484. }
  1485. }
  1486. ,
  1487. this.getUA = function() {
  1488. return r
  1489. }
  1490. ,
  1491. this.setUA = function(i) {
  1492. return r = i,
  1493. this
  1494. }
  1495. ,
  1496. void this.setUA(r)) : new x(e).getResult()
  1497. };
  1498. if (typeof exports !== a)
  1499. typeof module !== a && module.exports && (exports = module.exports = x),
  1500. exports.UAParser = x;
  1501. else if (i.UAParser = x,
  1502. typeof define === o && define.amd && define(function() {
  1503. return x
  1504. }),
  1505. typeof i.jQuery !== a) {
  1506. var A = i.jQuery
  1507. , _ = new x;
  1508. A.ua = _.getResult(),
  1509. A.ua.get = function() {
  1510. return _.getUA()
  1511. }
  1512. ,
  1513. A.ua.set = function(i) {
  1514. _.setUA(i);
  1515. var e = _.getResult();
  1516. for (var s in e)
  1517. A.ua[s] = e[s]
  1518. }
  1519. }
  1520. }(this);
  1521. window.Modernizr = function(n, e, t) {
  1522. function o(n) {
  1523. d.cssText = n
  1524. }
  1525. function r(n, e) {
  1526. return typeof n === e
  1527. }
  1528. var i, c, u, a = "2.8.2", f = {}, s = e.documentElement, l = "modernizr", p = e.createElement(l), d = p.style, y = ({}.toString,
  1529. {}), w = [], b = w.slice, v = {}.hasOwnProperty;
  1530. u = r(v, "undefined") || r(v.call, "undefined") ? function(n, e) {
  1531. return e in n && r(n.constructor.prototype[e], "undefined")
  1532. }
  1533. : function(n, e) {
  1534. return v.call(n, e)
  1535. }
  1536. ,
  1537. Function.prototype.bind || (Function.prototype.bind = function(n) {
  1538. var e = this;
  1539. if ("function" != typeof e)
  1540. throw new TypeError;
  1541. var t = b.call(arguments, 1)
  1542. , o = function() {
  1543. if (this instanceof o) {
  1544. var r = function() {};
  1545. r.prototype = e.prototype;
  1546. var i = new r
  1547. , c = e.apply(i, t.concat(b.call(arguments)));
  1548. return Object(c) === c ? c : i
  1549. }
  1550. return e.apply(n, t.concat(b.call(arguments)))
  1551. };
  1552. return o
  1553. }
  1554. ),
  1555. y.webgl = function() {
  1556. return !!n.WebGLRenderingContext
  1557. }
  1558. ;
  1559. for (var h in y)
  1560. u(y, h) && (c = h.toLowerCase(),
  1561. f[c] = y[h](),
  1562. w.push((f[c] ? "" : "no-") + c));
  1563. return f.addTest = function(n, e) {
  1564. if ("object" == typeof n)
  1565. for (var o in n)
  1566. u(n, o) && f.addTest(o, n[o]);
  1567. else {
  1568. if (n = n.toLowerCase(),
  1569. f[n] !== t)
  1570. return f;
  1571. e = "function" == typeof e ? e() : e,
  1572. "undefined" != typeof enableClasses && enableClasses && (s.className += " " + (e ? "" : "no-") + n),
  1573. f[n] = e
  1574. }
  1575. return f
  1576. }
  1577. ,
  1578. o(""),
  1579. p = i = null,
  1580. f._version = a,
  1581. f
  1582. }(this, this.document);
  1583. !function(e, t, a) {
  1584. "use strict";
  1585. function n(t, h, m) {
  1586. function H(a) {
  1587. var n = 0
  1588. , i = Ee.length;
  1589. if (Ce.old = e.extend({}, Ce),
  1590. Ie = we ? 0 : be[ge.horizontal ? "width" : "height"](),
  1591. ke = Be[ge.horizontal ? "width" : "height"](),
  1592. ze = we ? t : Pe[ge.horizontal ? "outerWidth" : "outerHeight"](),
  1593. Ee.length = 0,
  1594. Ce.start = 0,
  1595. Ce.end = q(ze - Ie, 0),
  1596. Re) {
  1597. n = Ne.length,
  1598. qe = Pe.children(ge.itemSelector),
  1599. Ne.length = 0;
  1600. var r, s = c(Pe, ge.horizontal ? "paddingLeft" : "paddingTop"), o = c(Pe, ge.horizontal ? "paddingRight" : "paddingBottom"), l = "border-box" === e(qe).css("boxSizing"), u = "none" !== qe.css("float"), f = 0, v = qe.length - 1;
  1601. ze = 0,
  1602. qe.each(function(t, a) {
  1603. var n = e(a)
  1604. , i = a.getBoundingClientRect()
  1605. , l = E(ge.horizontal ? i.width || i.right - i.left : i.height || i.bottom - i.top)
  1606. , d = c(n, ge.horizontal ? "marginLeft" : "marginTop")
  1607. , p = c(n, ge.horizontal ? "marginRight" : "marginBottom")
  1608. , h = l + d + p
  1609. , m = !d || !p
  1610. , g = {};
  1611. g.el = a,
  1612. g.size = m ? l : h,
  1613. g.half = g.size / 2,
  1614. g.start = ze + (m ? d : 0),
  1615. g.center = g.start - E(Ie / 2 - g.size / 2),
  1616. g.end = g.start - Ie + g.size,
  1617. t || (ze += s),
  1618. ze += h,
  1619. ge.horizontal || u || p && d && t > 0 && (ze -= N(d, p)),
  1620. t === v && (g.end += o,
  1621. ze += o,
  1622. f = m ? p : 0),
  1623. Ne.push(g),
  1624. r = g
  1625. }),
  1626. Pe[0].style[ge.horizontal ? "width" : "height"] = (l ? ze : ze - s - o) + "px",
  1627. ze -= f,
  1628. Ne.length ? (Ce.start = Ne[0][Me ? "center" : "start"],
  1629. Ce.end = Me ? r.center : ze > Ie ? r.end : Ce.start) : Ce.start = Ce.end = 0
  1630. }
  1631. if (Ce.center = E(Ce.end / 2 + Ce.start / 2),
  1632. Q(),
  1633. Se.length && ke > 0 && (ge.dynamicHandle ? (Te = Ce.start === Ce.end ? ke : E(ke * Ie / ze),
  1634. Te = d(Te, ge.minHandleSize, ke),
  1635. Se[0].style[ge.horizontal ? "width" : "height"] = Te + "px") : Te = Se[ge.horizontal ? "outerWidth" : "outerHeight"](),
  1636. xe.end = ke - Te,
  1637. it || j()),
  1638. !we && Ie > 0) {
  1639. var p = Ce.start
  1640. , h = "";
  1641. if (Re)
  1642. e.each(Ne, function(e, t) {
  1643. Me ? Ee.push(t.center) : t.start + t.size > p && p <= Ce.end && (p = t.start,
  1644. Ee.push(p),
  1645. p += Ie,
  1646. p > Ce.end && p < Ce.end + Ie && Ee.push(Ce.end))
  1647. });
  1648. else
  1649. for (; p - Ie < Ce.end; )
  1650. Ee.push(p),
  1651. p += Ie;
  1652. if (De[0] && i !== Ee.length) {
  1653. for (var m = 0; m < Ee.length; m++)
  1654. h += ge.pageBuilder.call(ye, m);
  1655. Ae = De.html(h).children(),
  1656. Ae.eq(Oe.activePage).addClass(ge.activeClass)
  1657. }
  1658. }
  1659. if (Oe.slideeSize = ze,
  1660. Oe.frameSize = Ie,
  1661. Oe.sbSize = ke,
  1662. Oe.handleSize = Te,
  1663. Re) {
  1664. a && null != ge.startAt && (W(ge.startAt),
  1665. ye[Le ? "toCenter" : "toStart"](ge.startAt));
  1666. var g = Ne[Oe.activeItem];
  1667. X(Le && g ? g.center : d(Ce.dest, Ce.start, Ce.end))
  1668. } else
  1669. a ? null != ge.startAt && X(ge.startAt, 1) : X(d(Ce.dest, Ce.start, Ce.end));
  1670. pe("load")
  1671. }
  1672. function X(e, t, a) {
  1673. if (Re && at.released && !a) {
  1674. var n = $(e)
  1675. , i = e > Ce.start && e < Ce.end;
  1676. Le ? (i && (e = Ne[n.centerItem].center),
  1677. Me && ge.activateMiddle && W(n.centerItem)) : i && (e = Ne[n.firstItem].start)
  1678. }
  1679. at.init && at.slidee && ge.elasticBounds ? e > Ce.end ? e = Ce.end + (e - Ce.end) / 6 : e < Ce.start && (e = Ce.start + (e - Ce.start) / 6) : e = d(e, Ce.start, Ce.end),
  1680. et.start = +new Date,
  1681. et.time = 0,
  1682. et.from = Ce.cur,
  1683. et.to = e,
  1684. et.delta = e - Ce.cur,
  1685. et.tweesing = at.tweese || at.init && !at.slidee,
  1686. et.immediate = !et.tweesing && (t || at.init && at.slidee || !ge.speed),
  1687. at.tweese = 0,
  1688. e !== Ce.dest && (Ce.dest = e,
  1689. pe("change"),
  1690. it || Y()),
  1691. K(),
  1692. Q(),
  1693. Z(),
  1694. F()
  1695. }
  1696. function Y() {
  1697. if (ye.initialized) {
  1698. if (!it)
  1699. return it = w(Y),
  1700. void (at.released && pe("moveStart"));
  1701. et.immediate ? Ce.cur = et.to : et.tweesing ? (et.tweeseDelta = et.to - Ce.cur,
  1702. x(et.tweeseDelta) < .1 ? Ce.cur = et.to : Ce.cur += et.tweeseDelta * (at.released ? ge.swingSpeed : ge.syncSpeed)) : (et.time = N(+new Date - et.start, ge.speed),
  1703. Ce.cur = et.from + et.delta * e.easing[ge.easing](et.time / ge.speed, et.time, 0, 1, ge.speed)),
  1704. et.to === Ce.cur ? (Ce.cur = et.to,
  1705. at.tweese = it = 0) : it = w(Y),
  1706. pe("move"),
  1707. we || (f ? Pe[0].style[f] = v + (ge.horizontal ? "translateX" : "translateY") + "(" + -Ce.cur + "px)" : Pe[0].style[ge.horizontal ? "left" : "top"] = -E(Ce.cur) + "px"),
  1708. !it && at.released && pe("moveEnd"),
  1709. j()
  1710. }
  1711. }
  1712. function j() {
  1713. Se.length && (xe.cur = Ce.start === Ce.end ? 0 : ((at.init && !at.slidee ? Ce.dest : Ce.cur) - Ce.start) / (Ce.end - Ce.start) * xe.end,
  1714. xe.cur = d(E(xe.cur), xe.start, xe.end),
  1715. _e.hPos !== xe.cur && (_e.hPos = xe.cur,
  1716. f ? Se[0].style[f] = v + (ge.horizontal ? "translateX" : "translateY") + "(" + xe.cur + "px)" : Se[0].style[ge.horizontal ? "left" : "top"] = xe.cur + "px"))
  1717. }
  1718. function F() {
  1719. Ae[0] && _e.page !== Oe.activePage && (_e.page = Oe.activePage,
  1720. Ae.removeClass(ge.activeClass).eq(Oe.activePage).addClass(ge.activeClass),
  1721. pe("activePage", _e.page))
  1722. }
  1723. function M() {
  1724. tt.speed && Ce.cur !== (tt.speed > 0 ? Ce.end : Ce.start) || ye.stop(),
  1725. ot = at.init ? w(M) : 0,
  1726. tt.now = +new Date,
  1727. tt.pos = Ce.cur + (tt.now - tt.lastTime) / 1e3 * tt.speed,
  1728. X(at.init ? tt.pos : E(tt.pos)),
  1729. at.init || Ce.cur !== Ce.dest || pe("moveEnd"),
  1730. tt.lastTime = tt.now
  1731. }
  1732. function L(e, t, n) {
  1733. if ("boolean" === i(t) && (n = t,
  1734. t = a),
  1735. t === a)
  1736. X(Ce[e], n);
  1737. else {
  1738. if (Le && "center" !== e)
  1739. return;
  1740. var r = ye.getPos(t);
  1741. r && X(r[e], n, !Le)
  1742. }
  1743. }
  1744. function R(e) {
  1745. return null != e ? l(e) ? e >= 0 && e < Ne.length ? e : -1 : qe.index(e) : -1
  1746. }
  1747. function U(e) {
  1748. return R(l(e) && 0 > e ? e + Ne.length : e)
  1749. }
  1750. function W(e, t) {
  1751. var a = R(e);
  1752. return !(!Re || 0 > a) && ((_e.active !== a || t) && (qe.eq(Oe.activeItem).removeClass(ge.activeClass),
  1753. qe.eq(a).addClass(ge.activeClass),
  1754. _e.active = Oe.activeItem = a,
  1755. Z(),
  1756. pe("active", a)),
  1757. a)
  1758. }
  1759. function $(e) {
  1760. e = d(l(e) ? e : Ce.dest, Ce.start, Ce.end);
  1761. var t = {}
  1762. , a = Me ? 0 : Ie / 2;
  1763. if (!we)
  1764. for (var n = 0, i = Ee.length; i > n; n++) {
  1765. if (e >= Ce.end || n === Ee.length - 1) {
  1766. t.activePage = Ee.length - 1;
  1767. break
  1768. }
  1769. if (e <= Ee[n] + a) {
  1770. t.activePage = n;
  1771. break
  1772. }
  1773. }
  1774. if (Re) {
  1775. for (var r = !1, s = !1, o = !1, c = 0, u = Ne.length; u > c; c++)
  1776. if (r === !1 && e <= Ne[c].start + Ne[c].half && (r = c),
  1777. o === !1 && e <= Ne[c].center + Ne[c].half && (o = c),
  1778. c === u - 1 || e <= Ne[c].end + Ne[c].half) {
  1779. s = c;
  1780. break
  1781. }
  1782. t.firstItem = l(r) ? r : 0,
  1783. t.centerItem = l(o) ? o : t.firstItem,
  1784. t.lastItem = l(s) ? s : t.centerItem
  1785. }
  1786. return t
  1787. }
  1788. function Q(t) {
  1789. e.extend(Oe, $(t))
  1790. }
  1791. function Z() {
  1792. var e = Ce.dest <= Ce.start
  1793. , t = Ce.dest >= Ce.end
  1794. , a = (e ? 1 : 0) | (t ? 2 : 0);
  1795. if (_e.slideePosState !== a && (_e.slideePosState = a,
  1796. Je.is("button,input") && Je.prop("disabled", e),
  1797. Ke.is("button,input") && Ke.prop("disabled", t),
  1798. Je.add(Qe)[e ? "addClass" : "removeClass"](ge.disabledClass),
  1799. Ke.add($e)[t ? "addClass" : "removeClass"](ge.disabledClass)),
  1800. _e.fwdbwdState !== a && at.released && (_e.fwdbwdState = a,
  1801. Qe.is("button,input") && Qe.prop("disabled", e),
  1802. $e.is("button,input") && $e.prop("disabled", t)),
  1803. Re && null != Oe.activeItem) {
  1804. var n = 0 === Oe.activeItem
  1805. , i = Oe.activeItem >= Ne.length - 1
  1806. , r = (n ? 1 : 0) | (i ? 2 : 0);
  1807. _e.itemsButtonState !== r && (_e.itemsButtonState = r,
  1808. Ze.is("button,input") && Ze.prop("disabled", n),
  1809. Ge.is("button,input") && Ge.prop("disabled", i),
  1810. Ze[n ? "addClass" : "removeClass"](ge.disabledClass),
  1811. Ge[i ? "addClass" : "removeClass"](ge.disabledClass))
  1812. }
  1813. }
  1814. function G(e, t, a) {
  1815. if (e = U(e),
  1816. t = U(t),
  1817. e > -1 && t > -1 && e !== t && (!a || t !== e - 1) && (a || t !== e + 1)) {
  1818. qe.eq(e)[a ? "insertAfter" : "insertBefore"](Ne[t].el);
  1819. var n = t > e ? e : a ? t : t - 1
  1820. , i = e > t ? e : a ? t + 1 : t
  1821. , r = e > t;
  1822. null != Oe.activeItem && (e === Oe.activeItem ? _e.active = Oe.activeItem = a ? r ? t + 1 : t : r ? t : t - 1 : Oe.activeItem > n && Oe.activeItem < i && (_e.active = Oe.activeItem += r ? 1 : -1)),
  1823. H()
  1824. }
  1825. }
  1826. function J(e, t) {
  1827. for (var a = 0, n = Ve[e].length; n > a; a++)
  1828. if (Ve[e][a] === t)
  1829. return a;
  1830. return -1
  1831. }
  1832. function K() {
  1833. at.released && !ye.isPaused && ye.resume()
  1834. }
  1835. function V(e) {
  1836. return E(d(e, xe.start, xe.end) / xe.end * (Ce.end - Ce.start)) + Ce.start
  1837. }
  1838. function _() {
  1839. at.history[0] = at.history[1],
  1840. at.history[1] = at.history[2],
  1841. at.history[2] = at.history[3],
  1842. at.history[3] = at.delta
  1843. }
  1844. function ee(e) {
  1845. at.released = 0,
  1846. at.source = e,
  1847. at.slidee = "slidee" === e
  1848. }
  1849. function te(t) {
  1850. var a = "touchstart" === t.type
  1851. , n = t.data.source
  1852. , i = "slidee" === n;
  1853. at.init || !a && ie(t.target) || ("handle" !== n || ge.dragHandle && xe.start !== xe.end) && (!i || (a ? ge.touchDragging : ge.mouseDragging && t.which < 2)) && (a || r(t),
  1854. ee(n),
  1855. at.init = 0,
  1856. at.$source = e(t.target),
  1857. at.touch = a,
  1858. at.pointer = a ? t.originalEvent.touches[0] : t,
  1859. at.initX = at.pointer.pageX,
  1860. at.initY = at.pointer.pageY,
  1861. at.initPos = i ? Ce.cur : xe.cur,
  1862. at.start = +new Date,
  1863. at.time = 0,
  1864. at.path = 0,
  1865. at.delta = 0,
  1866. at.locked = 0,
  1867. at.history = [0, 0, 0, 0],
  1868. at.pathToLock = i ? a ? 30 : 10 : 0,
  1869. b.on(a ? z : I, ae),
  1870. ye.pause(1),
  1871. (i ? Pe : Se).addClass(ge.draggedClass),
  1872. pe("moveStart"),
  1873. i && (rt = setInterval(_, 10)))
  1874. }
  1875. function ae(e) {
  1876. if (at.released = "mouseup" === e.type || "touchend" === e.type,
  1877. at.pointer = at.touch ? e.originalEvent[at.released ? "changedTouches" : "touches"][0] : e,
  1878. at.pathX = at.pointer.pageX - at.initX,
  1879. at.pathY = at.pointer.pageY - at.initY,
  1880. at.path = D(A(at.pathX, 2) + A(at.pathY, 2)),
  1881. at.delta = ge.horizontal ? at.pathX : at.pathY,
  1882. at.released || !(at.path < 1)) {
  1883. if (!at.init) {
  1884. if (!(ge.horizontal ? x(at.pathX) > x(at.pathY) : x(at.pathX) < x(at.pathY)))
  1885. return ne();
  1886. at.init = 1
  1887. }
  1888. r(e),
  1889. !at.locked && at.path > at.pathToLock && at.slidee && (at.locked = 1,
  1890. at.$source.on(B, s)),
  1891. at.released && (ne(),
  1892. ge.releaseSwing && at.slidee && (at.swing = (at.delta - at.history[0]) / 40 * 300,
  1893. at.delta += at.swing,
  1894. at.tweese = x(at.swing) > 10)),
  1895. X(at.slidee ? E(at.initPos - at.delta) : V(at.initPos + at.delta))
  1896. }
  1897. }
  1898. function ne() {
  1899. clearInterval(rt),
  1900. at.released = !0,
  1901. b.off(at.touch ? z : I, ae),
  1902. (at.slidee ? Pe : Se).removeClass(ge.draggedClass),
  1903. setTimeout(function() {
  1904. at.$source.off(B, s)
  1905. }),
  1906. Ce.cur === Ce.dest && at.init && pe("moveEnd"),
  1907. ye.resume(1),
  1908. at.init = 0
  1909. }
  1910. function ie(t) {
  1911. return ~e.inArray(t.nodeName, k) || e(t).is(ge.interactive)
  1912. }
  1913. function re() {
  1914. ye.stop(),
  1915. b.off("mouseup", re)
  1916. }
  1917. function se(e) {
  1918. switch (r(e),
  1919. this) {
  1920. case $e[0]:
  1921. case Qe[0]:
  1922. ye.moveBy($e.is(this) ? ge.moveBy : -ge.moveBy),
  1923. b.on("mouseup", re);
  1924. break;
  1925. case Ze[0]:
  1926. ye.prev();
  1927. break;
  1928. case Ge[0]:
  1929. ye.next();
  1930. break;
  1931. case Je[0]:
  1932. ye.prevPage();
  1933. break;
  1934. case Ke[0]:
  1935. ye.nextPage()
  1936. }
  1937. }
  1938. function oe(e) {
  1939. return nt.curDelta = (ge.horizontal ? e.deltaY || e.deltaX : e.deltaY) || -e.wheelDelta,
  1940. nt.curDelta /= 1 === e.deltaMode ? 3 : 100,
  1941. Re ? (p = +new Date,
  1942. nt.last < p - nt.resetTime && (nt.delta = 0),
  1943. nt.last = p,
  1944. nt.delta += nt.curDelta,
  1945. x(nt.delta) < 1 ? nt.finalDelta = 0 : (nt.finalDelta = E(nt.delta / 1),
  1946. nt.delta %= 1),
  1947. nt.finalDelta) : nt.curDelta
  1948. }
  1949. function le(e) {
  1950. e.originalEvent[g] = ye;
  1951. var t = +new Date;
  1952. if (O + ge.scrollHijack > t && Ue[0] !== document && Ue[0] !== window)
  1953. return void (O = t);
  1954. if (ge.scrollBy && Ce.start !== Ce.end) {
  1955. var a = oe(e.originalEvent);
  1956. (ge.scrollTrap || a > 0 && Ce.dest < Ce.end || 0 > a && Ce.dest > Ce.start) && r(e, 1),
  1957. ye.slideBy(ge.scrollBy * a)
  1958. }
  1959. }
  1960. function ce(e) {
  1961. ge.clickBar && e.target === Be[0] && (r(e),
  1962. X(V((ge.horizontal ? e.pageX - Be.offset().left : e.pageY - Be.offset().top) - Te / 2)))
  1963. }
  1964. function de(e) {
  1965. if (ge.keyboardNavBy)
  1966. switch (e.which) {
  1967. case ge.horizontal ? 37 : 38:
  1968. r(e),
  1969. ye["pages" === ge.keyboardNavBy ? "prevPage" : "prev"]();
  1970. break;
  1971. case ge.horizontal ? 39 : 40:
  1972. r(e),
  1973. ye["pages" === ge.keyboardNavBy ? "nextPage" : "next"]()
  1974. }
  1975. }
  1976. function ue(e) {
  1977. return ie(this) ? void (e.originalEvent[g + "ignore"] = !0) : void (this.parentNode !== Pe[0] || e.originalEvent[g + "ignore"] || ye.activate(this))
  1978. }
  1979. function fe() {
  1980. this.parentNode === De[0] && ye.activatePage(Ae.index(this))
  1981. }
  1982. function ve(e) {
  1983. ge.pauseOnHover && ye["mouseenter" === e.type ? "pause" : "resume"](2)
  1984. }
  1985. function pe(e, t) {
  1986. if (Ve[e]) {
  1987. for (me = Ve[e].length,
  1988. T.length = 0,
  1989. he = 0; me > he; he++)
  1990. T.push(Ve[e][he]);
  1991. for (he = 0; me > he; he++)
  1992. T[he].call(ye, e, t)
  1993. }
  1994. }
  1995. var he, me, ge = e.extend({}, n.defaults, h), ye = this, we = l(t), be = e(t), Pe = ge.slidee ? e(ge.slidee).eq(0) : be.children().eq(0), Ie = 0, ze = 0, Ce = {
  1996. start: 0,
  1997. center: 0,
  1998. end: 0,
  1999. cur: 0,
  2000. dest: 0
  2001. }, Be = e(ge.scrollBar).eq(0), Se = Be.children().eq(0), ke = 0, Te = 0, xe = {
  2002. start: 0,
  2003. end: 0,
  2004. cur: 0
  2005. }, De = e(ge.pagesBar), Ae = 0, Ee = [], qe = 0, Ne = [], Oe = {
  2006. firstItem: 0,
  2007. lastItem: 0,
  2008. centerItem: 0,
  2009. activeItem: null,
  2010. activePage: 0
  2011. }, He = new u(be[0]), Xe = new u(Pe[0]), Ye = new u(Be[0]), je = new u(Se[0]), Fe = "basic" === ge.itemNav, Me = "forceCentered" === ge.itemNav, Le = "centered" === ge.itemNav || Me, Re = !we && (Fe || Le || Me), Ue = ge.scrollSource ? e(ge.scrollSource) : be, We = ge.dragSource ? e(ge.dragSource) : be, $e = e(ge.forward), Qe = e(ge.backward), Ze = e(ge.prev), Ge = e(ge.next), Je = e(ge.prevPage), Ke = e(ge.nextPage), Ve = {}, _e = {}, et = {}, tt = {}, at = {
  2012. released: 1
  2013. }, nt = {
  2014. last: 0,
  2015. delta: 0,
  2016. resetTime: 200
  2017. }, it = 0, rt = 0, st = 0, ot = 0;
  2018. we || (t = be[0]),
  2019. ye.initialized = 0,
  2020. ye.frame = t,
  2021. ye.slidee = Pe[0],
  2022. ye.pos = Ce,
  2023. ye.rel = Oe,
  2024. ye.items = Ne,
  2025. ye.pages = Ee,
  2026. ye.isPaused = 0,
  2027. ye.options = ge,
  2028. ye.dragging = at,
  2029. ye.reload = function() {
  2030. H()
  2031. }
  2032. ,
  2033. ye.getPos = function(e) {
  2034. if (Re) {
  2035. var t = R(e);
  2036. return -1 !== t && Ne[t]
  2037. }
  2038. var a = Pe.find(e).eq(0);
  2039. if (a[0]) {
  2040. var n = ge.horizontal ? a.offset().left - Pe.offset().left : a.offset().top - Pe.offset().top
  2041. , i = a[ge.horizontal ? "outerWidth" : "outerHeight"]();
  2042. return {
  2043. start: n,
  2044. center: n - Ie / 2 + i / 2,
  2045. end: n - Ie + i,
  2046. size: i
  2047. }
  2048. }
  2049. return !1
  2050. }
  2051. ,
  2052. ye.moveBy = function(e) {
  2053. tt.speed = e,
  2054. !at.init && tt.speed && Ce.cur !== (tt.speed > 0 ? Ce.end : Ce.start) && (tt.lastTime = +new Date,
  2055. tt.startPos = Ce.cur,
  2056. ee("button"),
  2057. at.init = 1,
  2058. pe("moveStart"),
  2059. y(ot),
  2060. M())
  2061. }
  2062. ,
  2063. ye.stop = function() {
  2064. "button" === at.source && (at.init = 0,
  2065. at.released = 1)
  2066. }
  2067. ,
  2068. ye.prev = function() {
  2069. ye.activate(null == Oe.activeItem ? 0 : Oe.activeItem - 1)
  2070. }
  2071. ,
  2072. ye.next = function() {
  2073. ye.activate(null == Oe.activeItem ? 0 : Oe.activeItem + 1)
  2074. }
  2075. ,
  2076. ye.prevPage = function() {
  2077. ye.activatePage(Oe.activePage - 1)
  2078. }
  2079. ,
  2080. ye.nextPage = function() {
  2081. ye.activatePage(Oe.activePage + 1)
  2082. }
  2083. ,
  2084. ye.slideBy = function(e, t) {
  2085. e && (Re ? ye[Le ? "toCenter" : "toStart"](d((Le ? Oe.centerItem : Oe.firstItem) + ge.scrollBy * e, 0, Ne.length)) : X(Ce.dest + e, t))
  2086. }
  2087. ,
  2088. ye.slideTo = function(e, t) {
  2089. X(e, t)
  2090. }
  2091. ,
  2092. ye.toStart = function(e, t) {
  2093. L("start", e, t)
  2094. }
  2095. ,
  2096. ye.toEnd = function(e, t) {
  2097. L("end", e, t)
  2098. }
  2099. ,
  2100. ye.toCenter = function(e, t) {
  2101. L("center", e, t)
  2102. }
  2103. ,
  2104. ye.getIndex = R,
  2105. ye.activate = function(e, t) {
  2106. var a = W(e);
  2107. ge.smart && a !== !1 && (Le ? ye.toCenter(a, t) : a >= Oe.lastItem ? ye.toStart(a, t) : a <= Oe.firstItem ? ye.toEnd(a, t) : K())
  2108. }
  2109. ,
  2110. ye.activatePage = function(e, t) {
  2111. l(e) && X(Ee[d(e, 0, Ee.length - 1)], t)
  2112. }
  2113. ,
  2114. ye.resume = function(e) {
  2115. ge.cycleBy && ge.cycleInterval && ("items" !== ge.cycleBy || Ne[0] && null != Oe.activeItem) && !(e < ye.isPaused) && (ye.isPaused = 0,
  2116. st ? st = clearTimeout(st) : pe("resume"),
  2117. st = setTimeout(function() {
  2118. switch (pe("cycle"),
  2119. ge.cycleBy) {
  2120. case "items":
  2121. ye.activate(Oe.activeItem >= Ne.length - 1 ? 0 : Oe.activeItem + 1);
  2122. break;
  2123. case "pages":
  2124. ye.activatePage(Oe.activePage >= Ee.length - 1 ? 0 : Oe.activePage + 1)
  2125. }
  2126. }, ge.cycleInterval))
  2127. }
  2128. ,
  2129. ye.pause = function(e) {
  2130. e < ye.isPaused || (ye.isPaused = e || 100,
  2131. st && (st = clearTimeout(st),
  2132. pe("pause")))
  2133. }
  2134. ,
  2135. ye.toggle = function() {
  2136. ye[st ? "pause" : "resume"]()
  2137. }
  2138. ,
  2139. ye.set = function(t, a) {
  2140. e.isPlainObject(t) ? e.extend(ge, t) : ge.hasOwnProperty(t) && (ge[t] = a)
  2141. }
  2142. ,
  2143. ye.add = function(t, a) {
  2144. var n = e(t);
  2145. Re ? (null == a || !Ne[0] || a >= Ne.length ? n.appendTo(Pe) : Ne.length && n.insertBefore(Ne[a].el),
  2146. null != Oe.activeItem && a <= Oe.activeItem && (_e.active = Oe.activeItem += n.length)) : Pe.append(n),
  2147. H()
  2148. }
  2149. ,
  2150. ye.remove = function(t) {
  2151. if (Re) {
  2152. var a = U(t);
  2153. if (a > -1) {
  2154. qe.eq(a).remove();
  2155. var n = a === Oe.activeItem;
  2156. null != Oe.activeItem && a < Oe.activeItem && (_e.active = --Oe.activeItem),
  2157. H(),
  2158. n && (_e.active = null,
  2159. ye.activate(Oe.activeItem))
  2160. }
  2161. } else
  2162. e(t).remove(),
  2163. H()
  2164. }
  2165. ,
  2166. ye.moveAfter = function(e, t) {
  2167. G(e, t, 1)
  2168. }
  2169. ,
  2170. ye.moveBefore = function(e, t) {
  2171. G(e, t)
  2172. }
  2173. ,
  2174. ye.on = function(e, t) {
  2175. if ("object" === i(e))
  2176. for (var a in e)
  2177. e.hasOwnProperty(a) && ye.on(a, e[a]);
  2178. else if ("function" === i(t))
  2179. for (var n = e.split(" "), r = 0, s = n.length; s > r; r++)
  2180. Ve[n[r]] = Ve[n[r]] || [],
  2181. -1 === J(n[r], t) && Ve[n[r]].push(t);
  2182. else if ("array" === i(t))
  2183. for (var o = 0, l = t.length; l > o; o++)
  2184. ye.on(e, t[o])
  2185. }
  2186. ,
  2187. ye.one = function(e, t) {
  2188. function a() {
  2189. t.apply(ye, arguments),
  2190. ye.off(e, a)
  2191. }
  2192. ye.on(e, a)
  2193. }
  2194. ,
  2195. ye.off = function(e, t) {
  2196. if (t instanceof Array)
  2197. for (var a = 0, n = t.length; n > a; a++)
  2198. ye.off(e, t[a]);
  2199. else
  2200. for (var i = e.split(" "), r = 0, s = i.length; s > r; r++)
  2201. if (Ve[i[r]] = Ve[i[r]] || [],
  2202. null == t)
  2203. Ve[i[r]].length = 0;
  2204. else {
  2205. var o = J(i[r], t);
  2206. -1 !== o && Ve[i[r]].splice(o, 1)
  2207. }
  2208. }
  2209. ,
  2210. ye.destroy = function() {
  2211. return Ue.add(Se).add(Be).add(De).add($e).add(Qe).add(Ze).add(Ge).add(Je).add(Ke).off("." + g),
  2212. b.off("keydown", de),
  2213. Ze.add(Ge).add(Je).add(Ke).removeClass(ge.disabledClass),
  2214. qe && null != Oe.activeItem && qe.eq(Oe.activeItem).removeClass(ge.activeClass),
  2215. De.empty(),
  2216. we || (be.off("." + g),
  2217. He.restore(),
  2218. Xe.restore(),
  2219. Ye.restore(),
  2220. je.restore(),
  2221. e.removeData(t, g)),
  2222. Ne.length = Ee.length = 0,
  2223. _e = {},
  2224. ye.initialized = 0,
  2225. ye
  2226. }
  2227. ,
  2228. ye.init = function() {
  2229. if (!ye.initialized) {
  2230. ye.on(m);
  2231. var e = ["overflow", "position"]
  2232. , t = ["position", "webkitTransform", "msTransform", "transform", "left", "top", "width", "height"];
  2233. He.save.apply(He, e),
  2234. Ye.save.apply(Ye, e),
  2235. Xe.save.apply(Xe, t),
  2236. je.save.apply(je, t);
  2237. var a = Se;
  2238. return we || (a = a.add(Pe),
  2239. be.css("overflow", "hidden"),
  2240. f || "static" !== be.css("position") || be.css("position", "relative")),
  2241. f ? v && a.css(f, v) : ("static" === Be.css("position") && Be.css("position", "relative"),
  2242. a.css({
  2243. position: "absolute"
  2244. })),
  2245. ge.forward && $e.on(S, se),
  2246. ge.backward && Qe.on(S, se),
  2247. ge.prev && Ze.on(B, se),
  2248. ge.next && Ge.on(B, se),
  2249. ge.prevPage && Je.on(B, se),
  2250. ge.nextPage && Ke.on(B, se),
  2251. Ue.on(C, le),
  2252. Be[0] && Be.on(B, ce),
  2253. Re && ge.activateOn && be.on(ge.activateOn + "." + g, "*", ue),
  2254. De[0] && ge.activatePageOn && De.on(ge.activatePageOn + "." + g, "*", fe),
  2255. We.on(P, {
  2256. source: "slidee"
  2257. }, te),
  2258. Se && Se.on(P, {
  2259. source: "handle"
  2260. }, te),
  2261. b.on("keydown", de),
  2262. we || (be.on("mouseenter." + g + " mouseleave." + g, ve),
  2263. be.on("scroll." + g, o)),
  2264. ye.initialized = 1,
  2265. H(!0),
  2266. ge.cycleBy && !we && ye[ge.startPaused ? "pause" : "resume"](),
  2267. ye
  2268. }
  2269. }
  2270. }
  2271. function i(e) {
  2272. 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
  2273. }
  2274. function r(e, t) {
  2275. e.preventDefault(),
  2276. t && e.stopPropagation()
  2277. }
  2278. function s(t) {
  2279. r(t, 1),
  2280. e(this).off(t.type, s)
  2281. }
  2282. function o() {
  2283. this.scrollLeft = 0,
  2284. this.scrollTop = 0
  2285. }
  2286. function l(e) {
  2287. return !isNaN(parseFloat(e)) && isFinite(e)
  2288. }
  2289. function c(e, t) {
  2290. return 0 | E(String(e.css(t)).replace(/[^\-0-9.]/g, ""))
  2291. }
  2292. function d(e, t, a) {
  2293. return t > e ? t : e > a ? a : e
  2294. }
  2295. function u(e) {
  2296. var t = {};
  2297. return t.style = {},
  2298. t.save = function() {
  2299. if (e && e.nodeType) {
  2300. for (var a = 0; a < arguments.length; a++)
  2301. t.style[arguments[a]] = e.style[arguments[a]];
  2302. return t
  2303. }
  2304. }
  2305. ,
  2306. t.restore = function() {
  2307. if (e && e.nodeType) {
  2308. for (var a in t.style)
  2309. t.style.hasOwnProperty(a) && (e.style[a] = t.style[a]);
  2310. return t
  2311. }
  2312. }
  2313. ,
  2314. t
  2315. }
  2316. var f, v, p, h = "sly", m = "Sly", g = h, y = t.cancelAnimationFrame || t.cancelRequestAnimationFrame, w = t.requestAnimationFrame, b = e(document), P = "touchstart." + g + " mousedown." + g, I = "mousemove." + g + " mouseup." + g, z = "touchmove." + g + " touchend." + g, C = (document.implementation.hasFeature("Event.wheel", "3.0") ? "wheel." : "mousewheel.") + g, B = "click." + g, S = "mousedown." + g, k = ["INPUT", "SELECT", "BUTTON", "TEXTAREA"], T = [], x = Math.abs, D = Math.sqrt, A = Math.pow, E = Math.round, q = Math.max, N = Math.min, O = 0;
  2317. b.on(C, function(e) {
  2318. var t = e.originalEvent[g]
  2319. , a = +new Date;
  2320. (!t || t.options.scrollHijack < a - O) && (O = a)
  2321. }),
  2322. function(e) {
  2323. function t(e) {
  2324. var t = (new Date).getTime()
  2325. , n = Math.max(0, 16 - (t - a))
  2326. , i = setTimeout(e, n);
  2327. return a = t,
  2328. i
  2329. }
  2330. w = e.requestAnimationFrame || e.webkitRequestAnimationFrame || t;
  2331. var a = (new Date).getTime()
  2332. , n = e.cancelAnimationFrame || e.webkitCancelAnimationFrame || e.clearTimeout;
  2333. y = function(t) {
  2334. n.call(e, t)
  2335. }
  2336. }(window),
  2337. function() {
  2338. function e(e) {
  2339. for (var n = 0, i = t.length; i > n; n++) {
  2340. var r = t[n] ? t[n] + e.charAt(0).toUpperCase() + e.slice(1) : e;
  2341. if (null != a.style[r])
  2342. return r
  2343. }
  2344. }
  2345. var t = ["", "webkit", "moz", "ms", "o"]
  2346. , a = document.createElement("div");
  2347. f = e("transform"),
  2348. v = e("perspective") ? "translateZ(0) " : ""
  2349. }(),
  2350. t[m] = n,
  2351. e.fn[h] = function(t, a) {
  2352. var r, s;
  2353. return e.isPlainObject(t) || (("string" === i(t) || t === !1) && (r = t === !1 ? "destroy" : t,
  2354. s = Array.prototype.slice.call(arguments, 1)),
  2355. t = {}),
  2356. this.each(function(i, o) {
  2357. var l = e.data(o, g);
  2358. l || r ? l && r && l[r] && l[r].apply(l, s) : l = e.data(o, g, new n(o,t,a).init())
  2359. })
  2360. }
  2361. ,
  2362. n.defaults = {
  2363. slidee: null,
  2364. horizontal: !1,
  2365. itemNav: null,
  2366. itemSelector: null,
  2367. smart: !1,
  2368. activateOn: null,
  2369. activateMiddle: !1,
  2370. scrollSource: null,
  2371. scrollBy: 0,
  2372. scrollHijack: 300,
  2373. scrollTrap: !1,
  2374. dragSource: null,
  2375. mouseDragging: !1,
  2376. touchDragging: !1,
  2377. releaseSwing: !1,
  2378. swingSpeed: .2,
  2379. elasticBounds: !1,
  2380. interactive: null,
  2381. scrollBar: null,
  2382. dragHandle: !1,
  2383. dynamicHandle: !1,
  2384. minHandleSize: 50,
  2385. clickBar: !1,
  2386. syncSpeed: .5,
  2387. pagesBar: null,
  2388. activatePageOn: null,
  2389. pageBuilder: function(e) {
  2390. return "<li>" + (e + 1) + "</li>"
  2391. },
  2392. forward: null,
  2393. backward: null,
  2394. prev: null,
  2395. next: null,
  2396. prevPage: null,
  2397. nextPage: null,
  2398. cycleBy: null,
  2399. cycleInterval: 5e3,
  2400. pauseOnHover: !1,
  2401. startPaused: !1,
  2402. moveBy: 300,
  2403. speed: 0,
  2404. easing: "swing",
  2405. startAt: null,
  2406. keyboardNavBy: null,
  2407. draggedClass: "dragged",
  2408. activeClass: "active",
  2409. disabledClass: "disabled"
  2410. }
  2411. }(jQuery, window);
  2412. !function e(t, i, n) {
  2413. function r(a, s) {
  2414. if (!i[a]) {
  2415. if (!t[a]) {
  2416. var l = "function" == typeof require && require;
  2417. if (!s && l)
  2418. return l(a, !0);
  2419. if (o)
  2420. return o(a, !0);
  2421. var c = new Error("Cannot find module '" + a + "'");
  2422. throw c.code = "MODULE_NOT_FOUND",
  2423. c
  2424. }
  2425. var h = i[a] = {
  2426. exports: {}
  2427. };
  2428. t[a][0].call(h.exports, function(e) {
  2429. var i = t[a][1][e];
  2430. return r(i ? i : e)
  2431. }, h, h.exports, e, t, i, n)
  2432. }
  2433. return i[a].exports
  2434. }
  2435. for (var o = "function" == typeof require && require, a = 0; a < n.length; a++)
  2436. r(n[a]);
  2437. return r
  2438. }({
  2439. 1: [function(e, t, i) {
  2440. (function(i) {
  2441. "use strict";
  2442. function n(e) {
  2443. this.player = null,
  2444. this.director = null,
  2445. this.modelManager = null,
  2446. this.container = null,
  2447. this.tagManager = null,
  2448. this.fadeInSpeed = e,
  2449. null !== this.fadeInSpeed && void 0 !== this.fadeInSpeed || (this.fadeInSpeed = 0)
  2450. }
  2451. var r = e("three")
  2452. , o = e("./util/logger")
  2453. , a = (e("./util/common"),
  2454. e("./enum/PlayerEvents"))
  2455. , s = e("./enum/DirectorEvents")
  2456. , l = e("./settings")
  2457. , c = e("./enum/Viewmode")
  2458. , h = (e("./enum/WarpStyle"),
  2459. e("./enum/BlackoutStyle"),
  2460. e("./enum/ModelManagerEvents"))
  2461. , u = e("./enum/tagEvents")
  2462. , d = e("./util/transitions")
  2463. , p = e("./util/lerp")
  2464. , f = new o(i);
  2465. n.prototype.init = function(e, t, i, n, r) {
  2466. this.player = t,
  2467. this.director = e,
  2468. this.modelManager = i,
  2469. this.tagManager = n,
  2470. this.container = r,
  2471. this.updateModel(),
  2472. this.bindEvents()
  2473. }
  2474. ,
  2475. n.prototype.bindEvents = function() {
  2476. this.modelManager.on(h.ActiveModelChanged, this.updateModel.bind(this)),
  2477. this.player.on(a.ModeChanging, this.handlePlayerModeChanging.bind(this)),
  2478. this.player.on(a.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  2479. this.player.on(a.ClosestPanoChanging, this.handleClosestPanoChanging.bind(this)),
  2480. this.player.on(a.StartInside, this.handleStartInside.bind(this)),
  2481. this.player.on(a.StartOutside, this.handleStartOutside.bind(this)),
  2482. this.player.on(a.WarpStarted, this.handleWarpStarted.bind(this)),
  2483. this.director.on(s.ActionInterrupted, this.handleActionInterruption.bind(this)),
  2484. this.tagManager.on(u.TagActivated, this.ontagActivated.bind(this)),
  2485. this.tagManager.on(u.TagNavigation, this.onNavigationTotag.bind(this))
  2486. }
  2487. ,
  2488. n.prototype.updateModel = function() {
  2489. this.model = this.modelManager.getActiveModel()
  2490. }
  2491. ,
  2492. n.prototype.handleWarpStarted = function() {
  2493. this.hidePlayerReticule()
  2494. }
  2495. ,
  2496. n.prototype.ontagActivated = function() {
  2497. this.hidePlayerReticule()
  2498. }
  2499. ,
  2500. n.prototype.onNavigationTotag = function() {
  2501. this.hidePlayerReticule()
  2502. }
  2503. ,
  2504. n.prototype.handlePlayerModeChanging = function(e, t, i) {
  2505. var n = this.modelManager.getActiveModel()
  2506. , r = this.player.is360View(t, i) || this.director.tourIsPlaying ? 0 : l[t].markerOpacity;
  2507. n.fadePanoMarkers(r),
  2508. n.setMode(t)
  2509. }
  2510. ,
  2511. n.prototype.handlePlayerModeChanged = function(e, t) {
  2512. var i = this.modelManager.getActiveModel()
  2513. , n = t === c.PANORAMA ? r.DoubleSide : r.FrontSide;
  2514. i.setSide(n),
  2515. i.setMode(t)
  2516. }
  2517. ,
  2518. n.prototype.handleClosestPanoChanging = function(e, t, i) {
  2519. i !== c.TRANSITIONING && (e && !this.director.tourIsPlaying && e.hoverOff(i),
  2520. t && !this.director.tourIsPlaying && t.hoverOn(i))
  2521. }
  2522. ,
  2523. n.prototype.handleActionInterruption = function() {}
  2524. ,
  2525. n.prototype.handleStartInside = function(e) {
  2526. var t = l[this.player.mode]
  2527. , i = e ? 0 : t.transitionTime * t.skyboxOpacityLength;
  2528. this.fadeIn(this.fadeInSpeed),
  2529. this.model.alpha = 0,
  2530. this.model.skybox.material.uniforms.opacity.value = 1,
  2531. this.model.fadePanoMarkers(e ? 0 : t.markerOpacity);
  2532. var n = this.player.reticule;
  2533. d.start(p.property(n.material, "opacity", 0), i, null, 0, null, "retReOpac")
  2534. }
  2535. ,
  2536. n.prototype.handleStartOutside = function(e) {
  2537. this.fadeIn(e)
  2538. }
  2539. ,
  2540. n.prototype.fadeIn = function(e) {
  2541. null !== e && void 0 !== e || (e = 2e3,
  2542. f.warn("DisplayController.fadeIn -> no transition time specified, defaulting to 2000 ms.")),
  2543. $(this.container).fadeIn(e)
  2544. }
  2545. ,
  2546. n.prototype.hidePlayerReticule = function() {
  2547. this.player.reticule.hide()
  2548. }
  2549. ,
  2550. t.exports = n
  2551. }
  2552. ).call(this, "/js/DisplayController.js")
  2553. }
  2554. , {
  2555. "./enum/BlackoutStyle": 18,
  2556. "./enum/DirectorEvents": 23,
  2557. "./enum/tagEvents": 32,
  2558. "./enum/ModelManagerEvents": 33,
  2559. "./enum/PlayerEvents": 40,
  2560. "./enum/Viewmode": 51,
  2561. "./enum/WarpStyle": 52,
  2562. "./settings": 166,
  2563. "./util/common": 185,
  2564. "./util/lerp": 188,
  2565. "./util/logger": 189,
  2566. "./util/transitions": 195,
  2567. three: 217
  2568. }],
  2569. 2: [function(e, t, i) {
  2570. "use strict";
  2571. function n() {
  2572. this.baseStartTime = performance.timing.navigationStart,
  2573. this.loadingStartTime = null,
  2574. this.waitingStartTime = null,
  2575. this.appReadyTime = null
  2576. }
  2577. n.prototype.setBaseStartTime = function(e) {
  2578. this.baseStartTime = e || Date.now()
  2579. }
  2580. ,
  2581. n.prototype.setWaitingStartTime = function(e) {
  2582. this.waitingStartTime = e || Date.now()
  2583. }
  2584. ,
  2585. n.prototype.setLoadingStartTime = function(e) {
  2586. this.loadingStartTime = e || Date.now()
  2587. }
  2588. ,
  2589. n.prototype.setAppReadyTime = function(e) {
  2590. this.appReadyTime = e || Date.now()
  2591. }
  2592. ,
  2593. n.prototype.calcFullLoadingTime = function() {
  2594. var e = this.appReadyTime - this.baseStartTime;
  2595. return this.waitingStartTime && (e -= this.loadingStartTime - this.waitingStartTime),
  2596. e
  2597. }
  2598. ,
  2599. t.exports = n
  2600. }
  2601. , {}],
  2602. 3: [function(e, t, i) {
  2603. (function(i) {
  2604. "use strict";
  2605. function n() {
  2606. return 100 * Math.random()
  2607. }
  2608. var r = e("./util/logger")
  2609. , o = e("./util/browser")
  2610. , a = new r(i)
  2611. , s = window.MP_AB_TESTS = window.MP_AB_TESTS || {
  2612. initialized: !1,
  2613. init: function(e, t) {
  2614. if (t = t || {},
  2615. !this.initialized) {
  2616. this.initialized = !0,
  2617. o.valueFromHash("tilegen") && (t.tilegen = 1 === o.valueFromHash("tilegen", 0)),
  2618. o.valueFromHash("imgopt") && (t.imgopt = 1 === o.valueFromHash("imgopt", 0));
  2619. for (var i in e) {
  2620. var r = i.match("^sc_tilegen_([0-9]+)$");
  2621. r && (s.tilegen = n() < parseInt(r[1]));
  2622. var l = i.match("^sc_imgopt_([0-9]+)$");
  2623. l && (s.imgopt = n() < parseInt(l[1]))
  2624. }
  2625. for (var c in t)
  2626. s[c] = t[c],
  2627. a.debug("A/B override:", c, s[c])
  2628. }
  2629. },
  2630. changeIfTileGenerating: function(e) {
  2631. return s.tilegen && (e += e.indexOf("?") === -1 ? "?" : "&",
  2632. e += "imgopt=1"),
  2633. e
  2634. },
  2635. changeIfImageOptimzing: function(e) {
  2636. return s.imgopt && e.indexOf("imgopt=1") === -1 && (e += e.indexOf("?") === -1 ? "?" : "&",
  2637. e += "imgopt=1"),
  2638. e
  2639. },
  2640. tilegen: !1,
  2641. imgopt: !1
  2642. };
  2643. t.exports = s
  2644. }
  2645. ).call(this, "/js/ab.js")
  2646. }
  2647. , {
  2648. "./util/browser": 182,
  2649. "./util/logger": 189
  2650. }],
  2651. 4: [function(e, t, i) {
  2652. (function(i) {
  2653. "use strict";
  2654. function n() {
  2655. return {
  2656. addons: [{
  2657. name: "keen:ua_parser",
  2658. input: {
  2659. ua_string: "user_agent"
  2660. },
  2661. output: "parsed_user_agent"
  2662. }]
  2663. }
  2664. }
  2665. function r(e, t, i, n) {
  2666. function r(t) {
  2667. l[t.sid] = !0;
  2668. var i = t.billboard.media && t.billboard.media.type
  2669. , n = {
  2670. tag_id: t.sid,
  2671. tags_visited: Object.keys(l).length,
  2672. tag_count: Object.keys(e.tags).length,
  2673. tag_view_count: ++E,
  2674. has_media: !!i
  2675. };
  2676. i && (n.media_type = i),
  2677. u("tag_opened", n)
  2678. }
  2679. var l = {}
  2680. , h = Date.now() - N
  2681. , f = null;
  2682. n && (f = Date.now() - window.navigationStart);
  2683. var g;
  2684. try {
  2685. g = e.data.player_options.highlight_reel && e.heroLocations.length > 1
  2686. } catch (e) {
  2687. g = !1
  2688. }
  2689. var v, A = e.supportsVR;
  2690. A || (v = "VR disabled at the model/account level",
  2691. m.valueFromHash("vr") === _.NONE ? v = "VR disabled, using &vr=0" : m.detectAndroid() ? b.isDeviceSupported(w.Android) || (v = "VR disabled, unsupported Android version") : m.detectIOS() && (b.isDeviceSupported(w.IOS) || (v = "VR disabled, unsupported iOS version"))),
  2692. u("model_loaded", {
  2693. duration: h,
  2694. duration_from_navigation_start: f,
  2695. has_hlr: g,
  2696. has_vr: A,
  2697. vr_reason: v
  2698. });
  2699. var I = 0;
  2700. e.panos.forEach(function(e) {
  2701. e.on("enter", function() {
  2702. c("pano_viewed", {
  2703. pano_id: e.id,
  2704. pano_view_count: ++I,
  2705. alignment_type: e.alignmentType,
  2706. interaction_source: O,
  2707. navigation_source: p
  2708. })
  2709. })
  2710. });
  2711. var E = 0;
  2712. for (var T in e.tags)
  2713. e.tags[T].billboard.on(M.OPENED, r.bind(this, e.tags[T]));
  2714. t.on("tour_auto", function(e) {
  2715. p = "tour_" + e
  2716. }),
  2717. t.on("tour_manual", function(e) {
  2718. O = "gui-" + e,
  2719. p = "tour_manual"
  2720. }),
  2721. i.on(C.InteractionKey, function() {
  2722. t.mode === y.TRANSITIONING || t.flying || d(C.InteractionKey)
  2723. }),
  2724. i.on(C.InteractionDirect, function() {
  2725. t.mode === y.TRANSITIONING || t.flying || d(C.InteractionDirect)
  2726. }),
  2727. o(t),
  2728. a(),
  2729. s()
  2730. }
  2731. function o(e) {
  2732. I.on(T.OPENED, function() {
  2733. c("showcase_share_intent", {
  2734. pano_id: e.currentPano && e.currentPano.id
  2735. })
  2736. }),
  2737. I.on(T.LINK_CLICKED, function(t) {
  2738. c("showcase_share_action", {
  2739. channel: t.channel,
  2740. pano_id: e.currentPano && e.currentPano.id
  2741. })
  2742. }),
  2743. E.on(x.ORIGIN_LINK_CLICKED, function() {
  2744. c("showcase_share_origin_link_clicked")
  2745. })
  2746. }
  2747. function a() {}
  2748. function s() {
  2749. b.on(S.OPENED, c.bind(this, "showcase_gui", {
  2750. gui_action: "click_vr_button"
  2751. })),
  2752. b.on(S.LAUNCH, function(e) {
  2753. c("showcase_gui", {
  2754. gui_action: "launch_vr",
  2755. vr_platform: e.vr_platform,
  2756. vr_app: e.vr_app
  2757. })
  2758. }),
  2759. b.on(S.PREV, c.bind(this, "showcase_gui", {
  2760. gui_action: "vr_modal_prev"
  2761. })),
  2762. b.on(S.NEXT, function(e) {
  2763. c("showcase_gui", {
  2764. gui_action: e.nextAction
  2765. })
  2766. }),
  2767. b.on(S.CLOSED, c.bind(this, "showcase_gui", {
  2768. gui_action: "vr_modal_close"
  2769. })),
  2770. b.on(S.falseICECHOSEN, function(e) {
  2771. c("showcase_gui", {
  2772. gui_action: e.name + " "
  2773. })
  2774. }),
  2775. b.on(S.STORE, function(e) {
  2776. c("showcase_gui", {
  2777. gui_action: "launch_store",
  2778. store: e
  2779. })
  2780. })
  2781. }
  2782. function l(e, t) {
  2783. if (f)
  2784. try {
  2785. f.addEvent(e, v.extendObject({
  2786. host: window.location.host,
  2787. keen: n(),
  2788. user_agent: "${keen.user_agent}",
  2789. referrer: {
  2790. url: v.normalizeUrl(document.referrer),
  2791. domain: v.domainFromUrl(document.referrer),
  2792. url_original: document.referrer
  2793. },
  2794. embedded: m.inIframe(),
  2795. is_mobile: m.isMobile(),
  2796. version: "2.25.6-0-gd87e5b1"
  2797. }, t))
  2798. } catch (e) {
  2799. P.warn("analytics.report -> client.addEvent() error (is there blocking software installed?). Error message: " + e)
  2800. }
  2801. }
  2802. function c(e, t) {
  2803. if (t = t || {},
  2804. L)
  2805. try {
  2806. window.analytics.track(e, v.extendObject(t, B), {
  2807. context: {
  2808. app: {
  2809. name: "showcase",
  2810. version: "2.25.6-0-gd87e5b1"
  2811. },
  2812. screen: {
  2813. width: window.screen.width,
  2814. height: window.screen.height,
  2815. density: window.devicePixelRatio
  2816. }
  2817. }
  2818. })
  2819. } catch (t) {
  2820. console.warn("Failed to send data to segment for " + e)
  2821. }
  2822. }
  2823. function h(e, t) {
  2824. if (t = t || {},
  2825. navigator.sendBeacon && L)
  2826. try {
  2827. navigator.sendBeacon("https://api.segment.io/v1/t", JSON.stringify({
  2828. event: e,
  2829. anonymousId: window.analytics.user().anonymousId(),
  2830. properties: v.extendObject(t, B),
  2831. writeKey: L,
  2832. sentAt: Date.now(),
  2833. type: "track",
  2834. context: {
  2835. userAgent: m.userAgent(),
  2836. library: {
  2837. name: "showcase-beacon",
  2838. version: "2.25.6-0-gd87e5b1"
  2839. },
  2840. app: {
  2841. name: "showcase",
  2842. version: "2.25.6-0-gd87e5b1"
  2843. }
  2844. }
  2845. }))
  2846. } catch (e) {
  2847. console.warn("Failed to send async segment request")
  2848. }
  2849. }
  2850. function u(e, t) {
  2851. t = t || {},
  2852. c(e, t)
  2853. }
  2854. function d(e, t) {
  2855. O = e === C.InteractionGui ? "gui-" + t : e,
  2856. p = "self_guided"
  2857. }
  2858. var p, f, g = (e("three"),
  2859. e("./util/ajax"),
  2860. e("./ab")), m = e("./util/browser"), v = e("./util/common"), A = e("./settings"), y = (e("./localization/localize"),
  2861. e("./enum/Viewmode")), C = e("./enum/ControlEvents"), I = e("./gui/sharing/modal"), E = e("./gui/title/titleBar"), b = e("./gui/vr/vrModal"), w = e("./enum/VRPlatforms"), _ = e("./enum/VROption"), T = e("./gui/sharing/ShareEvents"), x = e("./gui/title/TitleEvents"), S = e("./gui/vr/vrEvent"), M = e("./tag/Billboard/BillboardEvent"), R = e("./util/logger"), P = new R(i), O = (e("./enum/PlayerEvents"),
  2862. "direct"), L = null, D = !1, N = null, B = null, F = v.uuid4();
  2863. t.exports = {
  2864. report: function(e, t, i, n) {
  2865. l("Session starts", {
  2866. model: e,
  2867. status: t,
  2868. loadtime: Date.now() - (N || Date.now()),
  2869. loadtime_from_navigation_start: i ? Date.now() - window.navigationStart : null,
  2870. autoplay: i,
  2871. quickstart: n,
  2872. ab_tilegen: g.tilegen,
  2873. ab_imgopt: g.imgopt
  2874. })
  2875. },
  2876. impression: function(e) {
  2877. e = e || {};
  2878. var t = void 0 === e.isVisible || e.isVisible
  2879. , i = (void 0 !== e.immediate && e.immediate,
  2880. window.location.search.substr(1).split("&"));
  2881. u("impression", {
  2882. visible: t,
  2883. url_params: i
  2884. })
  2885. },
  2886. initKeen: function(e) {
  2887. return e.token && e.appId ? void (f = new Keen({
  2888. projectId: e.appId,
  2889. writeKey: e.token,
  2890. readKey: "",
  2891. requestType: "xhr"
  2892. })) : void P.warn("no keen token/appId")
  2893. },
  2894. initSegment: function(e) {
  2895. return e.token ? (L = e.token,
  2896. window.analytics.load(e.token),
  2897. B = {
  2898. model_id: e.model,
  2899. start_source: e.startSource,
  2900. autoplay: e.autoplay,
  2901. quickstart: e.quickstart,
  2902. language_tag: A.languageTag,
  2903. is_mobile: m.isMobile(),
  2904. iframe: m.inIframe(),
  2905. aspect_ratio: m.aspectRatio(),
  2906. session_id: F,
  2907. window: {
  2908. width: $("#player").width(),
  2909. height: $("#player").height()
  2910. },
  2911. platform: {
  2912. browser: {
  2913. name: $.ua.browser.name,
  2914. major: $.ua.browser.major,
  2915. version: $.ua.browser.version
  2916. },
  2917. os: {
  2918. name: $.ua.os.name,
  2919. version: $.ua.os.version
  2920. },
  2921. device: {
  2922. vendor: $.ua.device.vendor,
  2923. model: $.ua.device.model,
  2924. type: $.ua.device.type
  2925. }
  2926. }
  2927. },
  2928. D = Math.random() < A.analytics.sessionTrackingRate,
  2929. P.debug("tracking sample rate = " + A.analytics.sessionTrackingRate),
  2930. void P.debug("tracking this session = " + D)) : void P.warn("no segment token")
  2931. },
  2932. sessionStart: function(e) {
  2933. P.debug("analytics user_session_start"),
  2934. c("session_started"),
  2935. N = Date.now(),
  2936. window.addEventListener("unload", function() {
  2937. h("session_ended", {
  2938. duration: Date.now() - N
  2939. })
  2940. })
  2941. },
  2942. modelLoaded: function(e, t, i, n) {
  2943. r(e, t, i, n)
  2944. },
  2945. loadComplete: function(e) {
  2946. var t = {
  2947. time_to_app_start: e
  2948. };
  2949. c("load_times", t)
  2950. },
  2951. track: function(e, t) {
  2952. D && (P.debug('analytics.track("' + e + '", ' + JSON.stringify(t) + " )"),
  2953. c(e, t))
  2954. },
  2955. trackAlways: function(e, t) {
  2956. P.debug('analytics.trackAlways("' + e + '", ' + JSON.stringify(t) + " )"),
  2957. c(e, t)
  2958. },
  2959. getSessionId: function() {
  2960. return F
  2961. },
  2962. updateInteraction: d
  2963. }
  2964. }
  2965. ).call(this, "/js/analytics.js")
  2966. }
  2967. , {
  2968. "./ab": 3,
  2969. "./enum/ControlEvents": 21,
  2970. "./enum/PlayerEvents": 40,
  2971. "./enum/VROption": 47,
  2972. "./enum/VRPlatforms": 49,
  2973. "./enum/Viewmode": 51,
  2974. "./gui/sharing/ShareEvents": 76,
  2975. "./gui/sharing/modal": 77,
  2976. "./gui/title/TitleEvents": 80,
  2977. "./gui/title/titleBar": 82,
  2978. "./gui/vr/vrEvent": 85,
  2979. "./gui/vr/vrModal": 87,
  2980. "./localization/localize": 108,
  2981. "./tag/Billboard/BillboardEvent": 120,
  2982. "./settings": 166,
  2983. "./util/ajax": 181,
  2984. "./util/browser": 182,
  2985. "./util/common": 185,
  2986. "./util/logger": 189,
  2987. three: 217
  2988. }],
  2989. 5: [function(e, t, i) {
  2990. "use strict";
  2991. function n() {
  2992. r.PerspectiveCamera.call(this, a.clampVFOV(o.dollhouseFOV), $("#player").width() / $("#player").height(), o.dollhouseNear, o.dollhouseFar),
  2993. this.controls = null
  2994. }
  2995. var r = e("three")
  2996. , o = e("../constants")
  2997. , a = e("../util/cameraLight");
  2998. n.prototype = Object.create(r.PerspectiveCamera.prototype),
  2999. n.prototype.updateAspect = function(e) {
  3000. this.aspect = e,
  3001. this.updateProjectionMatrix()
  3002. }
  3003. ,
  3004. t.exports = n
  3005. }
  3006. , {
  3007. "../constants": 8,
  3008. "../util/cameraLight": 184,
  3009. three: 217
  3010. }],
  3011. 6: [function(e, t, i) {
  3012. "use strict";
  3013. function n() {
  3014. var e = $("#player").width() / $("#player").height();
  3015. r.OrthographicCamera.call(this, -o.orthoBase, o.orthoBase, o.orthoBase / e, -o.orthoBase / e, o.orthoNear, o.orthoFar),
  3016. this.controls = null,
  3017. this.updateAspect(e)
  3018. }
  3019. var r = e("three")
  3020. , o = e("../constants");
  3021. n.prototype = Object.create(r.OrthographicCamera.prototype),
  3022. n.prototype.updateAspect = function(e) {
  3023. this.aspect = e,
  3024. this.top = o.orthoBase / e,
  3025. this.bottom = -o.orthoBase / e,
  3026. this.updateProjectionMatrix()
  3027. }
  3028. ,
  3029. t.exports = n
  3030. }
  3031. , {
  3032. "../constants": 8,
  3033. three: 217
  3034. }],
  3035. 7: [function(e, t, i) {
  3036. "use strict";
  3037. function n() {
  3038. r.PerspectiveCamera.call(this, a.clampVFOV(o.insideFOV), $("#player").width() / $("#player").height(), o.insideNear, o.insideFar),
  3039. this.controls = null
  3040. }
  3041. var r = e("three")
  3042. , o = e("../settings")
  3043. , a = e("../util/cameraLight");
  3044. n.prototype = Object.create(r.PerspectiveCamera.prototype),
  3045. n.prototype.updateAspect = function(e) {
  3046. this.aspect = e,
  3047. this.updateProjectionMatrix()
  3048. }
  3049. ,
  3050. t.exports = n
  3051. }
  3052. , {
  3053. "../settings": 166,
  3054. "../util/cameraLight": 184,
  3055. three: 217
  3056. }],
  3057. 8: [function(e, t, i) {
  3058. "use strict";
  3059. t.exports = {
  3060. signedUrlDefaultExpireTime: 24e4,
  3061. signedUrlCheckInterval: 1e4,
  3062. signedUrlRefreshBuffer: 15e3,
  3063. dollhouseFOV: 70,
  3064. dollhouseNear: 1,
  3065. dollhouseFar: 5e3,
  3066. insideFOV: 70,
  3067. insideFOVMax: 120,
  3068. insideNear: .1,
  3069. insideFar: 5e3,
  3070. insideLookSpeed: .12,
  3071. insideLookLimitUp: 40,
  3072. insideLookLimitDown: -40,
  3073. orthoNear: 1,
  3074. orthoFar: 5e3,
  3075. orthoBase: 10,
  3076. narrowLandscapeHeight: 290,
  3077. reallyNarrowLandscapeHeight: 250,
  3078. visionTilingStartDate: new Date("8/26/2016"),
  3079. visionTilingStartVersion: "1.1.407.13667",
  3080. windowHeightHighQualityThreshold: 900,
  3081. tourStepDelayDefault: 3500,
  3082. tourStepDelaySlideShow: 5e3,
  3083. workshopApsect: 9 / 16,
  3084. highQualityMaxZoom: 2,
  3085. ultraHighQualityMaxZoom: 3
  3086. }
  3087. }
  3088. , {}],
  3089. 9: [function(e, t, i) {
  3090. "use strict";
  3091. function n() {
  3092. this.activeControl = null,
  3093. this.controls = {},
  3094. this.cameras = {}
  3095. }
  3096. var r = e("./PanoramaControls")
  3097. , o = e("./DollhouseControls")
  3098. , a = e("./FloorplanControls")
  3099. , s = e("../cameras/PanoramaCamera")
  3100. , l = e("../cameras/DollhouseCamera")
  3101. , c = e("../cameras/FloorplanCamera")
  3102. , h = e("events").EventEmitter
  3103. , u = e("../enum/ControlEvents")
  3104. , d = e("../enum/ModelManagerEvents")
  3105. , p = e("../enum/Viewmode")
  3106. , f = e("../settings");
  3107. n.prototype = Object.create(h.prototype),
  3108. n.prototype.init = function(e, t) {
  3109. this.setUpControls(),
  3110. this.bindEvents(e, t)
  3111. }
  3112. ,
  3113. n.prototype.activateControls = function(e) {
  3114. this.activeControl && (this.activeControl.reset(),
  3115. this.activeControl.enabled = !1),
  3116. this.controls[e] && (this.controls[e].enabled = !0),
  3117. this.activeControl = this.controls[e]
  3118. }
  3119. ,
  3120. n.prototype.setUpControls = function() {
  3121. var e = {}
  3122. , t = {}
  3123. , i = [p.PANORAMA, p.DOLLHOUSE, p.FLOORPLAN]
  3124. , n = [s, l, c]
  3125. , h = [r, o, a];
  3126. i.forEach(function(i, r) {
  3127. e[i] = new n[r],
  3128. t[i] = new h[r](e[i]),
  3129. t[i].on(u.Move, this.emit.bind(this, u.Move)),
  3130. t[i].on(u.InputStart, this.emit.bind(this, u.InputStart)),
  3131. t[i].on(u.InteractionDirect, this.emit.bind(this, u.InteractionDirect)),
  3132. t[i].on(u.InteractionKey, this.emit.bind(this, u.InteractionKey)),
  3133. t[i].on(u.Pinch, this.emit.bind(this, u.Pinch)),
  3134. t[i].on(u.Scroll, this.emit.bind(this, u.Scroll))
  3135. }
  3136. .bind(this)),
  3137. this.controls = t,
  3138. this.cameras = e
  3139. }
  3140. ,
  3141. n.prototype.bindEvents = function(e, t) {
  3142. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  3143. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  3144. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  3145. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  3146. f.useWheel && (e.addEventListener("mousewheel", this.onMouseWheel.bind(this)),
  3147. e.addEventListener("DOMMouseScroll", this.onMouseWheel.bind(this))),
  3148. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  3149. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  3150. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  3151. e.addEventListener("contextmenu", function(e) {
  3152. e.preventDefault()
  3153. }),
  3154. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  3155. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  3156. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  3157. e.addEventListener("pointerout", this.onPointerCancel.bind(this)),
  3158. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  3159. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  3160. document.addEventListener("keyup", this.onKeyUp.bind(this)),
  3161. t.on(d.ActiveModelChanged, function(e) {
  3162. this.setModelForControls(e.model)
  3163. }
  3164. .bind(this))
  3165. }
  3166. ,
  3167. n.prototype.setModelForControls = function(e) {
  3168. this.controls[p.DOLLHOUSE].setZoomBounds(e.boundingBox);
  3169. var t = e.boundingBox.clone().expandByScalar(f.modelBoundsPadding);
  3170. [p.DOLLHOUSE, p.FLOORPLAN].forEach(function(e) {
  3171. this.controls[e].setBounds(t)
  3172. }
  3173. .bind(this))
  3174. }
  3175. ,
  3176. n.prototype.onMouseDown = function(e) {
  3177. e.preventDefault(),
  3178. this.activeControl && this.activeControl.onMouseDown(e)
  3179. }
  3180. ,
  3181. n.prototype.onMouseMove = function(e) {
  3182. e.preventDefault(),
  3183. this.activeControl && this.activeControl.onMouseMove(e)
  3184. }
  3185. ,
  3186. n.prototype.onMouseUp = function(e) {
  3187. e.preventDefault(),
  3188. this.activeControl && this.activeControl.onMouseUp(e)
  3189. }
  3190. ,
  3191. n.prototype.onMouseOver = function(e) {
  3192. e.preventDefault(),
  3193. this.activeControl && this.activeControl.onMouseOver(e)
  3194. }
  3195. ,
  3196. n.prototype.onMouseWheel = function(e) {
  3197. e.preventDefault(),
  3198. this.activeControl && this.activeControl.onMouseWheel(e)
  3199. }
  3200. ,
  3201. n.prototype.onTouchStart = function(e) {
  3202. e.preventDefault(),
  3203. this.activeControl && this.activeControl.onTouchStart(e)
  3204. }
  3205. ,
  3206. n.prototype.onTouchMove = function(e) {
  3207. e.preventDefault(),
  3208. this.activeControl && this.activeControl.onTouchMove(e)
  3209. }
  3210. ,
  3211. n.prototype.onTouchEnd = function(e) {
  3212. e.preventDefault(),
  3213. this.activeControl && this.activeControl.onTouchEnd(e)
  3214. }
  3215. ,
  3216. n.prototype.onPointerDown = function(e) {
  3217. if (e.preventDefault(),
  3218. this.activeControl)
  3219. switch (e.pointerType) {
  3220. case "mouse":
  3221. this.activeControl.onMouseDown(e);
  3222. break;
  3223. default:
  3224. this.activeControl.onPointerDown(e)
  3225. }
  3226. }
  3227. ,
  3228. n.prototype.onPointerMove = function(e) {
  3229. if (e.preventDefault(),
  3230. this.activeControl)
  3231. switch (e.pointerType) {
  3232. case "mouse":
  3233. this.activeControl.onMouseMove(e);
  3234. break;
  3235. default:
  3236. this.activeControl.onPointerMove(e)
  3237. }
  3238. }
  3239. ,
  3240. n.prototype.onPointerUp = function(e) {
  3241. if (e.preventDefault(),
  3242. this.activeControl)
  3243. switch (e.pointerType) {
  3244. case "mouse":
  3245. this.activeControl.onMouseUp(e);
  3246. break;
  3247. default:
  3248. this.activeControl.onPointerUp(e)
  3249. }
  3250. }
  3251. ,
  3252. n.prototype.onPointerCancel = function(e) {
  3253. e.preventDefault(),
  3254. this.activeControl && "mouse" !== e.pointerType && this.activeControl.onPointerUp(e)
  3255. }
  3256. ,
  3257. n.prototype.onKeyDown = function(e) {
  3258. e.metaKey || e.ctrlKey || (e.preventDefault(),
  3259. this.activeControl && this.activeControl.onKeyDown(e))
  3260. }
  3261. ,
  3262. n.prototype.onKeyUp = function(e) {
  3263. e.preventDefault(),
  3264. this.activeControl && this.activeControl.onKeyUp(e)
  3265. }
  3266. ,
  3267. t.exports = n
  3268. }
  3269. , {
  3270. "../cameras/DollhouseCamera": 5,
  3271. "../cameras/FloorplanCamera": 6,
  3272. "../cameras/PanoramaCamera": 7,
  3273. "../enum/ControlEvents": 21,
  3274. "../enum/ModelManagerEvents": 33,
  3275. "../enum/Viewmode": 51,
  3276. "../settings": 166,
  3277. "./DollhouseControls": 10,
  3278. "./FloorplanControls": 11,
  3279. "./PanoramaControls": 13,
  3280. events: 202
  3281. }],
  3282. 10: [function(e, t, i) {
  3283. "use strict";
  3284. function n(e) {
  3285. a.call(this, e),
  3286. this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3287. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle,
  3288. this.minDistance = o.dollhouseDefault.minDistance,
  3289. this.maxDistance = o.dollhouseDefault.maxDistance,
  3290. this.adjustedMinDistance = this.minDistance,
  3291. this.adjustedMaxDistance = this.maxDistance
  3292. }
  3293. var r = e("three")
  3294. , o = e("../settings")
  3295. , a = e("./OutsideControls");
  3296. n.prototype = Object.create(a.prototype),
  3297. n.prototype.pan = function(e, t) {
  3298. this.camera.updateMatrix();
  3299. var i = this.camera.position.clone().sub(this.target).length();
  3300. i *= Math.tan(this.camera.fov / 2 * Math.PI / 180),
  3301. this.panLeft(2 * e * i / $("#player").height()),
  3302. this.panUp(-2 * t * i / $("#player").height())
  3303. }
  3304. ,
  3305. n.prototype.updateZoom = function() {
  3306. var e = this.offset.length();
  3307. return e * this.scale
  3308. }
  3309. ,
  3310. n.prototype.setZoomBounds = function(e) {
  3311. var t = e.min.distanceTo(e.max);
  3312. this.adjustedMinDistance = Math.max(Math.min(t / 2, o.dollhouseDefault.minDistance), 0),
  3313. this.adjustedMaxDistance = Math.min(Math.max(t, o.dollhouseDefault.maxDistance), o.skyboxRadius),
  3314. this.minDistance = this.adjustedMinDistance,
  3315. this.maxDistance = this.adjustedMaxDistance
  3316. }
  3317. ,
  3318. n.prototype.resetRanges = function(e, t) {
  3319. e ? (this.minDistance = Math.min(e, this.minDistance),
  3320. this.maxDistance = Math.max(e, this.maxDistance)) : (this.minDistance = this.adjustedMinDistance,
  3321. this.maxDistance = this.adjustedMaxDistance),
  3322. t ? (this.minPolarAngle = r.Math.degToRad(-15),
  3323. this.maxPolarAngle = r.Math.degToRad(89.9)) : (this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3324. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle)
  3325. }
  3326. ,
  3327. n.prototype.toJSON = function() {
  3328. return a.prototype.toJSON.call(this)
  3329. }
  3330. ,
  3331. t.exports = n
  3332. }
  3333. , {
  3334. "../settings": 166,
  3335. "./OutsideControls": 12,
  3336. three: 217
  3337. }],
  3338. 11: [function(e, t, i) {
  3339. "use strict";
  3340. function n(e) {
  3341. a.call(this, e),
  3342. this.minDistance = 15,
  3343. this.maxDistance = 50,
  3344. this.noRotateUpDown = !0,
  3345. this.minPolarAngle = 0,
  3346. this.maxPolarAngle = 0,
  3347. this.mouseActions[l.LEFT] = s.PAN,
  3348. this.mouseActions[l.MIDDLE] = s.DOLLY,
  3349. this.mouseActions[l.RIGHT] = s.ROTATE,
  3350. this.touchActions[1] = s.PAN,
  3351. this.touchActions[2] = s.ROTATE_DOLLY,
  3352. this.absoluteScale = 1,
  3353. this.currentScale = 1
  3354. }
  3355. var r = e("three")
  3356. , o = e("../settings")
  3357. , a = e("./OutsideControls")
  3358. , s = e("../enum/ControlActions")
  3359. , l = e("../enum/MouseButton")
  3360. , c = e("../util/math")
  3361. , h = e("../util/browser");
  3362. n.prototype = Object.create(a.prototype),
  3363. n.prototype.zoomToContain = function(e) {
  3364. var t = Math.max(e.x, e.z)
  3365. , i = Math.min(e.x, e.z)
  3366. , n = Math.max(t, i * this.camera.aspect)
  3367. , r = Math.max(i, t * this.camera.aspect);
  3368. this.absoluteScale = (h.aspectRatio() < 1 ? r : n) / 2 / o.orthoBase * 1.2,
  3369. this.currentScale = this.absoluteScale
  3370. }
  3371. ,
  3372. n.prototype.rotateToView = function(e, t) {
  3373. var i = 0
  3374. , n = h.aspectRatio() < 1
  3375. , r = e.x < e.z;
  3376. n === r ? t.z > 0 && (i = Math.PI) : i = t.x > 0 ? Math.PI / 2 : -Math.PI / 2,
  3377. this.rotateLeft(i),
  3378. this.update(0)
  3379. }
  3380. ,
  3381. n.prototype.pan = function(e, t) {
  3382. this.camera.updateMatrix(),
  3383. this.panLeft(e * (this.camera.right - this.camera.left) / $("#player").width()),
  3384. this.panUp(-t * (this.camera.top - this.camera.bottom) / $("#player").height())
  3385. }
  3386. ,
  3387. n.prototype.updateZoom = function() {
  3388. return this.absoluteScale *= this.scale - .03 * this.keyboardZoomSpeed,
  3389. this.absoluteScale = Math.max(o.zoomNearLimit, Math.min(this.absoluteScale, o.zoomFarLimit)),
  3390. this.currentScale = .8 * this.currentScale + .2 * this.absoluteScale,
  3391. this.camera.left = -o.orthoBase * this.currentScale,
  3392. this.camera.right = o.orthoBase * this.currentScale,
  3393. this.camera.top = o.orthoBase * this.currentScale / this.camera.aspect,
  3394. this.camera.bottom = -o.orthoBase * this.currentScale / this.camera.aspect,
  3395. this.camera.updateProjectionMatrix(),
  3396. this.offset.length()
  3397. }
  3398. ,
  3399. n.prototype.toJSON = function() {
  3400. var e = new r.Quaternion
  3401. , t = (new r.Quaternion).setFromAxisAngle(new r.Vector3(0,1,0), r.Math.degToRad(90))
  3402. , i = new r.Quaternion;
  3403. return function() {
  3404. var n = a.prototype.toJSON.call(this);
  3405. return e.copy(n.camera_quaternion),
  3406. i.copy(t),
  3407. i.multiply(e),
  3408. n.camera_quaternion.x = c.toPrecision(i.x, 4),
  3409. n.camera_quaternion.y = c.toPrecision(i.y, 4),
  3410. n.camera_quaternion.z = c.toPrecision(i.z, 4),
  3411. n.camera_quaternion.w = c.toPrecision(i.w, 4),
  3412. n.ortho_zoom = c.toPrecision(this.currentScale * this.camera.aspect, 4),
  3413. n
  3414. }
  3415. }(),
  3416. t.exports = n
  3417. }
  3418. , {
  3419. "../enum/ControlActions": 20,
  3420. "../enum/MouseButton": 34,
  3421. "../settings": 166,
  3422. "../util/browser": 182,
  3423. "../util/math": 190,
  3424. "./OutsideControls": 12,
  3425. three: 217
  3426. }],
  3427. 12: [function(e, t, i) {
  3428. "use strict";
  3429. function n(e) {
  3430. this.camera = e,
  3431. this.camera.controls = this,
  3432. this.enabled = !1,
  3433. this.target = new r.Vector3,
  3434. this.targetBounds = new r.Box3,
  3435. this.zoomSpeed = 1,
  3436. this.minDistance = 0,
  3437. this.maxDistance = 1 / 0,
  3438. this.noRotateUpDown = !1,
  3439. this.rotateSpeed = 1,
  3440. this.keyboardZoomSpeed = 0,
  3441. this.keyPanSpeed = 7,
  3442. this.autoRotate = !1,
  3443. this.autoRotateSpeed = 2,
  3444. this.autoPan = !1,
  3445. this.autoPanPosition = new r.Vector3,
  3446. this.minPolarAngle = r.Math.degToRad(25),
  3447. this.maxPolarAngle = r.Math.degToRad(65),
  3448. this.rotationAcceleration = new r.Vector2,
  3449. this.rotationSpeed = new r.Vector2,
  3450. this.panAcceleration = new r.Vector2,
  3451. this.panSpeed = new r.Vector2,
  3452. this.rotateStart = new r.Vector2,
  3453. this.rotateEnd = new r.Vector2,
  3454. this.rotateDelta = new r.Vector2,
  3455. this.panStart = new r.Vector2,
  3456. this.panEnd = new r.Vector2,
  3457. this.panDelta = new r.Vector2,
  3458. this.panOffset = new r.Vector3,
  3459. this.offset = new r.Vector3,
  3460. this.dollyStart = new r.Vector2,
  3461. this.dollyEnd = new r.Vector2,
  3462. this.dollyDelta = new r.Vector2,
  3463. this.phiDelta = 0,
  3464. this.thetaDelta = 0,
  3465. this.scale = 1,
  3466. this.panVector = new r.Vector3,
  3467. this.lastPosition = new r.Vector3,
  3468. this.state = c.NONE,
  3469. this.mouseActions = {},
  3470. this.mouseActions[h.LEFT] = c.ROTATE,
  3471. this.mouseActions[h.MIDDLE] = c.DOLLY,
  3472. this.mouseActions[h.RIGHT] = c.PAN,
  3473. this.touchActions = {},
  3474. this.touchActions[1] = c.ROTATE,
  3475. this.touchActions[2] = c.PAN_DOLLY,
  3476. this.lastMoveTime = 0,
  3477. this.pointersLimit = 2,
  3478. this.pointers = []
  3479. }
  3480. var r = e("three")
  3481. , o = e("../settings")
  3482. , a = e("../util/common")
  3483. , s = e("../util/math")
  3484. , l = e("../enum/Vectors")
  3485. , c = e("../enum/ControlActions")
  3486. , h = e("../enum/MouseButton")
  3487. , u = e("../enum/Keys")
  3488. , d = e("../enum/ControlEvents")
  3489. , p = e("events").EventEmitter
  3490. , f = 1e-6;
  3491. n.prototype = Object.create(p.prototype),
  3492. n.prototype.setBounds = function(e) {
  3493. this.targetBounds = e
  3494. }
  3495. ,
  3496. n.prototype.isEngaged = function() {
  3497. return this.state !== c.NONE
  3498. }
  3499. ,
  3500. n.prototype.rotateLeft = function(e) {
  3501. void 0 === e && (e = this.getAutoRotationAngle()),
  3502. this.thetaDelta -= e
  3503. }
  3504. ,
  3505. n.prototype.rotateUp = function(e) {
  3506. this.noRotateUpDown || (void 0 === e && (e = this.getAutoRotationAngle()),
  3507. this.phiDelta -= e)
  3508. }
  3509. ,
  3510. n.prototype.panLeft = function(e) {
  3511. var t = this.camera.matrix.elements;
  3512. this.panOffset.set(t[0], 0, t[2]).normalize(),
  3513. this.panOffset.multiplyScalar(-e),
  3514. this.panVector.add(this.panOffset)
  3515. }
  3516. ,
  3517. n.prototype.panUp = function(e) {
  3518. var t = this.camera.matrix.elements;
  3519. this.panOffset.set(t[4], 0, t[6]).normalize(),
  3520. this.panOffset.multiplyScalar(-e),
  3521. this.panVector.add(this.panOffset)
  3522. }
  3523. ,
  3524. n.prototype.startRotating = function(e, t) {
  3525. e && this.navRotationAcc("x", e),
  3526. t && this.navRotationAcc("y", t)
  3527. }
  3528. ,
  3529. n.prototype.stopRotating = function(e) {
  3530. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  3531. this.navRotationAcc("x", 0),
  3532. this.navRotationAcc("y", 0)
  3533. }
  3534. ,
  3535. n.prototype.setAutoPanPosition = function(e, t) {
  3536. var i = new r.Vector3
  3537. , n = new r.Vector3;
  3538. return function(e, t) {
  3539. i.copy(this.camera.position),
  3540. void 0 === e && null === e || i.setX(e),
  3541. void 0 === t && null === t || i.setZ(t);
  3542. var r = this.camera.position.distanceTo(this.target)
  3543. , o = l.FORWARD.clone().applyQuaternion(this.camera.quaternion);
  3544. this.targetClamped = !1,
  3545. n.copy(i).addScaledVector(o, r),
  3546. this.targetBounds.containsPoint(n) || (this.targetBounds.clampPoint(n, n),
  3547. i.copy(n).addScaledVector(o, -r),
  3548. this.targetClamped = !0),
  3549. this.autoPanPosition.x = i.x,
  3550. this.autoPanPosition.z = i.z,
  3551. this.autoPan && this.stopAutoPanning()
  3552. }
  3553. }(),
  3554. n.prototype.stopAutoPanning = function() {
  3555. var e = this.autoPan;
  3556. this.autoPan = !1,
  3557. this.emit(this.targetClamped ? d.AutoPanClamped : e ? d.AutoPanInterrupt : d.AutoPanComplete)
  3558. }
  3559. ,
  3560. n.prototype.dollyIn = function(e) {
  3561. void 0 === e && (e = this.getZoomScale()),
  3562. this.scale /= e
  3563. }
  3564. ,
  3565. n.prototype.dollyOut = function(e) {
  3566. void 0 === e && (e = this.getZoomScale()),
  3567. this.scale *= e
  3568. }
  3569. ,
  3570. n.prototype.updatePan = function(e) {
  3571. if (this.panSpeed.multiplyScalar(1 - o.panFriction).addScaledVector(this.panAcceleration, o.panAccelerationOutside * e),
  3572. this.pan(-this.panSpeed.x, this.panSpeed.y),
  3573. this.autoPan) {
  3574. var t = (new r.Vector3).copy(this.autoPanPosition).sub(this.camera.position);
  3575. t.setY(0).clampLength(0, 50 * e),
  3576. this.target.add(t),
  3577. this.camera.position.add(t),
  3578. this.autoPanPosition.x === this.camera.position.x && this.autoPanPosition.z === this.camera.position.z && (this.autoPan = !1,
  3579. this.stopAutoPanning())
  3580. }
  3581. }
  3582. ,
  3583. n.prototype.update = function(e) {
  3584. e || (e = 1 / 60),
  3585. this.rotationSpeed.multiplyScalar(1 - o.rotationFriction).addScaledVector(this.rotationAcceleration, o.rotationAccelerationOutside * e),
  3586. this.rotateLeft(-this.rotationSpeed.x),
  3587. this.noRotateUpDown || this.rotateUp(this.rotationSpeed.y),
  3588. this.updatePan(e);
  3589. var t = this.camera.position;
  3590. this.offset.copy(t).sub(this.target);
  3591. var i = Math.atan2(this.offset.x, this.offset.z)
  3592. , n = Math.atan2(Math.sqrt(this.offset.x * this.offset.x + this.offset.z * this.offset.z), this.offset.y);
  3593. this.autoRotate && this.rotateLeft(this.getAutoRotationAngle()),
  3594. i += this.thetaDelta,
  3595. n += this.phiDelta,
  3596. n = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, n)),
  3597. n = Math.max(f, Math.min(Math.PI - f, n));
  3598. var r = this.updateZoom();
  3599. r = Math.max(this.minDistance, Math.min(this.maxDistance, r)),
  3600. this.target.add(this.panVector),
  3601. this.targetBounds.clampPoint(this.target, this.target),
  3602. this.offset.x = r * Math.sin(n) * Math.sin(i),
  3603. this.offset.y = r * Math.cos(n),
  3604. this.offset.z = r * Math.sin(n) * Math.cos(i),
  3605. t.copy(this.target).add(this.offset),
  3606. this.camera.lookAt(this.target),
  3607. this.thetaDelta = 0,
  3608. this.phiDelta = 0,
  3609. this.scale = 1,
  3610. this.panVector.set(0, 0, 0),
  3611. this.lastPosition.distanceTo(this.camera.position) > 0 && this.lastPosition.copy(this.camera.position)
  3612. }
  3613. ,
  3614. n.prototype.getAutoRotationAngle = function() {
  3615. return 2 * Math.PI / 60 / 60 * this.autoRotateSpeed
  3616. }
  3617. ,
  3618. n.prototype.getZoomScale = function() {
  3619. return Math.pow(.95, this.zoomSpeed)
  3620. }
  3621. ,
  3622. n.prototype.onMouseDown = function(e) {
  3623. if (this.enabled) {
  3624. switch (e.preventDefault(),
  3625. this.stopAutoPanning(),
  3626. this.mouseDown = !0,
  3627. this.state = this.mouseActions[e.button],
  3628. this.state) {
  3629. case c.ROTATE:
  3630. this.rotateStart.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3631. this.rotationSpeed.set(0, 0);
  3632. break;
  3633. case c.DOLLY:
  3634. this.dollyStart.set(e.clientX, e.clientY);
  3635. break;
  3636. case c.PAN:
  3637. this.panStart.set(e.clientX, e.clientY)
  3638. }
  3639. this.emit(d.InputStart, "mouse")
  3640. }
  3641. }
  3642. ,
  3643. n.prototype.onMouseMove = function(e) {
  3644. if (this.enabled && this.mouseDown && 0 !== e.buttons) {
  3645. switch (e.preventDefault(),
  3646. this.state) {
  3647. case c.ROTATE:
  3648. this.rotateEnd.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3649. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3650. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3651. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3652. this.rotateStart.copy(this.rotateEnd);
  3653. break;
  3654. case c.DOLLY:
  3655. this.dollyEnd.set(e.clientX, e.clientY),
  3656. this.dollyDelta.subVectors(this.dollyEnd, this.dollyStart);
  3657. var t = this.dollyDelta.y > 0 ? this.dollyIn : this.dollyOut;
  3658. t.call(this),
  3659. this.dollyStart.copy(this.dollyEnd);
  3660. break;
  3661. case c.PAN:
  3662. this.panEnd.set(e.clientX, e.clientY),
  3663. this.panDelta.subVectors(this.panEnd, this.panStart),
  3664. this.pan(this.panDelta.x, this.panDelta.y),
  3665. this.panStart.copy(this.panEnd)
  3666. }
  3667. this.emit(d.Move, "mouse"),
  3668. this.lastMoveTime = e.timeStamp,
  3669. this.update()
  3670. }
  3671. }
  3672. ,
  3673. n.prototype.onMouseUp = function(e) {
  3674. this.enabled && (this.mouseDown = !1,
  3675. this.state = c.NONE,
  3676. "mouseover" !== e.type && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3677. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y),
  3678. this.update(),
  3679. this.rotationAcceleration.set(0, 0),
  3680. this.rotateDelta.set(0, 0)))
  3681. }
  3682. ,
  3683. n.prototype.onMouseOver = function(e) {
  3684. 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  3685. }
  3686. ,
  3687. n.prototype.onMouseWheel = function(e) {
  3688. if (this.enabled && o.useWheel) {
  3689. this.emit(d.Move, "wheel");
  3690. var t = e.wheelDelta || -e.detail
  3691. , i = t > 0 ? this.dollyOut : this.dollyIn;
  3692. i.call(this),
  3693. this.update()
  3694. }
  3695. }
  3696. ,
  3697. n.prototype.onKeyDown = function(e) {
  3698. this.enabled && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  3699. this.handleKeyDown(e.which)))
  3700. }
  3701. ,
  3702. n.prototype.navRotationAcc = function(e, t) {
  3703. "y" === e ? this.noRotateUpDown ? this.keyboardZoomSpeed = t : this.rotationAcceleration.y = t : this.rotationAcceleration.x = t
  3704. }
  3705. ,
  3706. n.prototype.navPanAcc = function(e, t) {
  3707. this.stopAutoPanning(),
  3708. this.panAcceleration[e] = t
  3709. }
  3710. ,
  3711. n.prototype.handleKeyDown = function(e) {
  3712. var t = !0;
  3713. switch (e) {
  3714. case u.UPARROW:
  3715. case u.I:
  3716. this.navRotationAcc("y", 1);
  3717. break;
  3718. case u.DOWNARROW:
  3719. case u.K:
  3720. this.navRotationAcc("y", -1);
  3721. break;
  3722. case u.LEFTARROW:
  3723. case u.J:
  3724. this.navRotationAcc("x", -1);
  3725. break;
  3726. case u.RIGHTARROW:
  3727. case u.L:
  3728. this.navRotationAcc("x", 1);
  3729. break;
  3730. case u.W:
  3731. this.navPanAcc("y", 1);
  3732. break;
  3733. case u.S:
  3734. this.navPanAcc("y", -1);
  3735. break;
  3736. case u.A:
  3737. this.navPanAcc("x", -1);
  3738. break;
  3739. case u.D:
  3740. this.navPanAcc("x", 1);
  3741. break;
  3742. default:
  3743. t = !1
  3744. }
  3745. t && this.emit(d.Move, "key")
  3746. }
  3747. ,
  3748. n.prototype.onKeyUp = function(e) {
  3749. this.enabled && (e.preventDefault(),
  3750. e.stopPropagation(),
  3751. this.handleKeyUp(e.which))
  3752. }
  3753. ,
  3754. n.prototype.handleKeyUp = function(e) {
  3755. switch (e) {
  3756. case u.I:
  3757. case u.K:
  3758. case u.UPARROW:
  3759. case u.DOWNARROW:
  3760. this.keyboardZoomSpeed = 0,
  3761. this.rotationAcceleration.y = 0;
  3762. break;
  3763. case u.J:
  3764. case u.L:
  3765. case u.LEFTARROW:
  3766. case u.RIGHTARROW:
  3767. this.rotationAcceleration.x = 0;
  3768. break;
  3769. case u.S:
  3770. case u.W:
  3771. this.panAcceleration.y = 0;
  3772. break;
  3773. case u.A:
  3774. case u.D:
  3775. this.panAcceleration.x = 0
  3776. }
  3777. }
  3778. ,
  3779. n.prototype.onTouchStart = function(e) {
  3780. if (this.enabled || this.state === c.NONE) {
  3781. e.preventDefault(),
  3782. e.stopPropagation(),
  3783. this.stopAutoPanning();
  3784. var t = function() {
  3785. if (2 === e.touches.length) {
  3786. var t = e.touches[0].pageX - e.touches[1].pageX
  3787. , i = e.touches[0].pageY - e.touches[1].pageY;
  3788. this.dollyStart.set(t, i)
  3789. }
  3790. }
  3791. .bind(this)
  3792. , i = function() {
  3793. this.panStart.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY"))
  3794. }
  3795. .bind(this)
  3796. , n = function() {
  3797. this.rotateStart.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY"))
  3798. }
  3799. .bind(this);
  3800. switch (this.state = this.touchActions[e.touches.length],
  3801. this.state) {
  3802. case c.PAN_DOLLY:
  3803. t();
  3804. case c.PAN:
  3805. i();
  3806. break;
  3807. case c.ROTATE_DOLLY:
  3808. t();
  3809. case c.ROTATE:
  3810. n()
  3811. }
  3812. this.rotationSpeed.set(0, 0),
  3813. this.emit(d.InputStart, "touch")
  3814. }
  3815. }
  3816. ,
  3817. n.prototype.onTouchMove = function(e) {
  3818. if (this.enabled && this.state !== c.NONE) {
  3819. e.preventDefault(),
  3820. e.stopPropagation();
  3821. var t = function() {
  3822. var t = e.touches[0].pageX - e.touches[1].pageX
  3823. , i = e.touches[0].pageY - e.touches[1].pageY;
  3824. this.dollyEnd.set(t, i);
  3825. var n = this.dollyStart.length() - this.dollyEnd.length();
  3826. n > 0 ? this.dollyOut(1 + n / 500) : this.dollyIn(1 - n / 500),
  3827. this.dollyStart.copy(this.dollyEnd)
  3828. }
  3829. .bind(this)
  3830. , i = function() {
  3831. this.panEnd.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY")),
  3832. this.panDelta.subVectors(this.panEnd, this.panStart),
  3833. this.pan(this.panDelta.x, this.panDelta.y),
  3834. this.panStart.copy(this.panEnd),
  3835. this.rotateDelta.set(0, 0)
  3836. }
  3837. .bind(this)
  3838. , n = function() {
  3839. this.rotateEnd.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY")),
  3840. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3841. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3842. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3843. this.rotateStart.copy(this.rotateEnd)
  3844. }
  3845. .bind(this)
  3846. , r = function() {
  3847. if (2 === e.touches.length) {
  3848. var i = window.devicePixelRatio || 1
  3849. , r = e.touches[1].pageX - e.touches[0].pageX
  3850. , s = e.touches[1].pageY - e.touches[0].pageY
  3851. , l = Math.sqrt(r * r + s * s)
  3852. , h = Math.abs(this.dollyStart.length() - l);
  3853. if (h > o.input.touchMoveThreshold * i)
  3854. this.state = c.DOLLY,
  3855. t();
  3856. else {
  3857. var u = a.average(e.touches, "pageX")
  3858. , d = a.average(e.touches, "pageY")
  3859. , p = this.rotateDelta.set(u, d).sub(this.rotateStart).length();
  3860. p > o.input.touchMoveThreshold && (this.state = c.ROTATE,
  3861. this.rotateStart.set(u, d),
  3862. n())
  3863. }
  3864. }
  3865. }
  3866. .bind(this);
  3867. switch (this.state) {
  3868. case c.PAN_DOLLY:
  3869. t();
  3870. case c.PAN:
  3871. i();
  3872. break;
  3873. case c.ROTATE_DOLLY:
  3874. r();
  3875. break;
  3876. case c.DOLLY:
  3877. t();
  3878. break;
  3879. case c.ROTATE:
  3880. n();
  3881. break;
  3882. default:
  3883. this.state = c.NONE
  3884. }
  3885. this.lastMoveTime = e.timeStamp,
  3886. this.emit(d.Move, "touch")
  3887. }
  3888. }
  3889. ,
  3890. n.prototype.onTouchEnd = function(e) {
  3891. this.enabled && (this.state === c.ROTATE && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3892. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y)),
  3893. this.state = c.NONE,
  3894. this.update(),
  3895. this.rotationAcceleration.set(0, 0),
  3896. this.rotateDelta.set(0, 0))
  3897. }
  3898. ,
  3899. n.prototype.onPointerDown = function(e) {
  3900. this.enabled && ("touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  3901. id: e.pointerId,
  3902. pageX: e.pageX,
  3903. pageY: e.pageY
  3904. }),
  3905. e.touches = this.pointers,
  3906. this.onTouchStart(e)),
  3907. this.emit(d.InputStart, "pointer"))
  3908. }
  3909. ,
  3910. n.prototype.onPointerMove = function(e) {
  3911. this.enabled && "touch" === e.pointerType && (this.pointers.forEach(function(t) {
  3912. e.pointerId === t.id && (t.pageX = e.pageX,
  3913. t.pageY = e.pageY)
  3914. }),
  3915. e.touches = this.pointers,
  3916. this.onTouchMove(e))
  3917. }
  3918. ,
  3919. n.prototype.onPointerUp = function(e) {
  3920. this.enabled && "touch" === e.pointerType && (this.pointers.forEach(function(t, i) {
  3921. e.pointerId === t.id && this.pointers.splice(i, 1)
  3922. }
  3923. .bind(this)),
  3924. e.touches = this.pointers,
  3925. this.onTouchEnd(e))
  3926. }
  3927. ,
  3928. n.prototype.reset = function() {
  3929. this.state = c.NONE,
  3930. this.stopAutoPanning(),
  3931. this.rotationSpeed.set(0, 0),
  3932. this.rotationAcceleration.set(0, 0),
  3933. this.panSpeed.set(0, 0),
  3934. this.panAcceleration.set(0, 0)
  3935. }
  3936. ,
  3937. n.prototype.toJSON = function() {
  3938. var e = {
  3939. camera_position: {
  3940. x: s.toPrecision(this.camera.position.x, 4),
  3941. y: s.toPrecision(this.camera.position.y, 4),
  3942. z: s.toPrecision(this.camera.position.z, 4)
  3943. },
  3944. camera_quaternion: {
  3945. x: s.toPrecision(this.camera.quaternion.x, 4),
  3946. y: s.toPrecision(this.camera.quaternion.y, 4),
  3947. z: s.toPrecision(this.camera.quaternion.z, 4),
  3948. w: s.toPrecision(this.camera.quaternion.w, 4)
  3949. }
  3950. };
  3951. return e
  3952. }
  3953. ,
  3954. t.exports = n
  3955. }
  3956. , {
  3957. "../enum/ControlActions": 20,
  3958. "../enum/ControlEvents": 21,
  3959. "../enum/Keys": 30,
  3960. "../enum/MouseButton": 34,
  3961. "../enum/Vectors": 50,
  3962. "../settings": 166,
  3963. "../util/common": 185,
  3964. "../util/math": 190,
  3965. events: 202,
  3966. three: 217
  3967. }],
  3968. 13: [function(e, t, i) {
  3969. (function(i) {
  3970. "use strict";
  3971. function n(e) {
  3972. this.camera = e,
  3973. this.camera.controls = this,
  3974. this.target = new r.Vector3(0,0,0),
  3975. this.lookVector = new r.Vector3,
  3976. this.lookSpeed = .05,
  3977. this.rotationAcc = new r.Vector2,
  3978. this.rotationSpeed = new r.Vector2,
  3979. this.lat = 0,
  3980. this.lon = 0,
  3981. this.phi = 0,
  3982. this.theta = 0,
  3983. this.enabled = !1,
  3984. this.locked = !1,
  3985. this.pointer = new r.Vector2(0,0),
  3986. this.rotationHistory = [],
  3987. this.rotationDifference = new r.Vector2,
  3988. this.pointerDragOn = !1,
  3989. this.pointerDragStart = new r.Vector2(0,0),
  3990. this.pinchDistance = 0,
  3991. this.moveStart = new r.Vector2,
  3992. this.moveTolerance = .01,
  3993. this.pointersLimit = 2,
  3994. this.pointers = []
  3995. }
  3996. var r = e("three")
  3997. , o = e("../util/logger")
  3998. , a = e("../settings")
  3999. , s = e("../util/common")
  4000. , l = e("../util/math")
  4001. , c = (e("../enum/Vectors"),
  4002. e("../enum/MouseButton"))
  4003. , h = e("../enum/Keys")
  4004. , u = e("../enum/ControlEvents")
  4005. , d = e("events").EventEmitter;
  4006. new o(i);
  4007. n.prototype = Object.create(d.prototype),
  4008. n.prototype.usable = function() {
  4009. return this.enabled && !this.locked
  4010. }
  4011. ,
  4012. n.prototype.lookAt = function(e) {
  4013. var t = this.camera.position.clone().sub(e)
  4014. , i = Math.atan(t.z / t.x);
  4015. i += t.x < 0 ? Math.PI : 0,
  4016. i += t.x > 0 && t.z < 0 ? 2 * Math.PI : 0,
  4017. this.lon = r.Math.radToDeg(i) + 180;
  4018. var n = Math.sqrt(t.x * t.x + t.z * t.z)
  4019. , o = Math.atan(t.y / n);
  4020. this.lat = -r.Math.radToDeg(o)
  4021. }
  4022. ,
  4023. n.prototype.startRotationFrom = function(e, t) {
  4024. l.convertScreenPositionToNDC(e, t, this.pointer),
  4025. this.pointerDragOn = !0,
  4026. this.pointerDragStart.copy(this.pointer),
  4027. this.moveStart.copy(this.pointer),
  4028. this.rotationHistory = [],
  4029. this.rotationSpeed.set(0, 0)
  4030. }
  4031. ,
  4032. n.prototype.onMouseOver = function(e) {
  4033. !this.pointerDragOn || 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  4034. }
  4035. ,
  4036. n.prototype.onTouchStart = function(e) {
  4037. if (this.usable()) {
  4038. switch (e.preventDefault(),
  4039. e.stopPropagation(),
  4040. e.touches.length) {
  4041. case 1:
  4042. this.startRotationFrom(e.touches[0].clientX, e.touches[0].clientY);
  4043. break;
  4044. case 2:
  4045. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  4046. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height();
  4047. this.pinchDistance = Math.sqrt(t * t + i * i)
  4048. }
  4049. this.emit(u.InputStart, "touch")
  4050. }
  4051. }
  4052. ,
  4053. n.prototype.onPointerDown = function(e) {
  4054. this.usable() && "touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  4055. id: e.pointerId,
  4056. clientX: e.clientX,
  4057. clientY: e.clientY
  4058. }),
  4059. e.touches = this.pointers,
  4060. this.onTouchStart(e),
  4061. this.emit(u.InputStart, "pointer"))
  4062. }
  4063. ,
  4064. n.prototype.onMouseDown = function(e) {
  4065. if (this.usable()) {
  4066. switch (e.preventDefault(),
  4067. e.stopPropagation(),
  4068. e.button) {
  4069. case c.LEFT:
  4070. this.startRotationFrom(e.clientX, e.clientY)
  4071. }
  4072. this.emit(u.InputStart, "mouse")
  4073. }
  4074. }
  4075. ,
  4076. n.prototype.updateRotation = function() {
  4077. if (this.usable() && this.pointerDragOn) {
  4078. var e = new r.Vector3(this.pointerDragStart.x,this.pointerDragStart.y,-1).unproject(this.camera)
  4079. , t = new r.Vector3(this.pointer.x,this.pointer.y,-1).unproject(this.camera)
  4080. , i = Math.sqrt(e.x * e.x + e.z * e.z)
  4081. , n = Math.sqrt(t.x * t.x + t.z * t.z)
  4082. , o = Math.atan2(e.y, i)
  4083. , a = Math.atan2(t.y, n);
  4084. this.rotationDifference.y = r.Math.radToDeg(o - a),
  4085. e.y = 0,
  4086. t.y = 0;
  4087. var s = Math.acos(e.dot(t) / e.length() / t.length());
  4088. isNaN(s) || (this.rotationDifference.x = r.Math.radToDeg(s),
  4089. this.pointerDragStart.x < this.pointer.x && (this.rotationDifference.x *= -1)),
  4090. this.pointerDragStart.copy(this.pointer)
  4091. }
  4092. }
  4093. ,
  4094. n.prototype.onMouseMove = function(e) {
  4095. this.usable() && (l.convertScreenPositionToNDC(e.clientX, e.clientY, this.pointer),
  4096. this.pointerDragOn && (Math.abs(this.pointer.x - this.moveStart.x) > this.moveTolerance || Math.abs(this.pointer.y - this.moveStart.y) > this.moveTolerance) && this.emit(u.Move, "mouse"))
  4097. }
  4098. ,
  4099. n.prototype.onTouchMove = function(e) {
  4100. if (this.usable())
  4101. switch (this.emit(u.Move, "touch"),
  4102. e.touches.length) {
  4103. case 1:
  4104. l.convertScreenPositionToNDC(e.touches[0].clientX, e.touches[0].clientY, this.pointer);
  4105. break;
  4106. case 2:
  4107. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  4108. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height()
  4109. , n = this.pinchDistance - Math.sqrt(t * t + i * i);
  4110. Math.abs(n) > .01 && (this.emit(u.InteractionDirect),
  4111. this.emit(u.Pinch, n),
  4112. this.pinchDistance -= n)
  4113. }
  4114. }
  4115. ,
  4116. n.prototype.onPointerMove = function(e) {
  4117. this.usable() && "touch" === e.pointerType && (this.pointers.forEach(function(t) {
  4118. e.pointerId === t.id && (t.clientX = e.clientX,
  4119. t.clientY = e.clientY)
  4120. }),
  4121. e.touches = this.pointers,
  4122. this.onTouchMove(e))
  4123. }
  4124. ,
  4125. n.prototype.endRotation = function() {
  4126. this.pointerDragOn = !1;
  4127. var e = s.averageVectors(this.rotationHistory);
  4128. this.rotationSpeed.set(e.x * a.rotationAfterMoveMultiplier, e.y * a.rotationAfterMoveMultiplier)
  4129. }
  4130. ,
  4131. n.prototype.onTouchEnd = function(e) {
  4132. this.usable() && (e.preventDefault(),
  4133. e.stopPropagation(),
  4134. this.endRotation())
  4135. }
  4136. ,
  4137. n.prototype.onMouseUp = function(e) {
  4138. this.usable() && (e.preventDefault(),
  4139. e.stopPropagation(),
  4140. this.endRotation())
  4141. }
  4142. ,
  4143. n.prototype.onPointerUp = function(e) {
  4144. this.usable() && "touch" === e.pointerType && (this.pointers.forEach(function(t, i) {
  4145. e.pointerId === t.id && this.pointers.splice(i, 1)
  4146. }
  4147. .bind(this)),
  4148. e.touches = this.pointers,
  4149. this.onTouchEnd(e))
  4150. }
  4151. ,
  4152. n.prototype.update = function(e) {
  4153. this.lon,
  4154. this.lat;
  4155. for (this.updateRotation(),
  4156. this.rotationHistory.push(this.rotationDifference.clone()); this.rotationHistory.length > a.rotationAfterMoveHistoryCount; )
  4157. this.rotationHistory.shift();
  4158. this.lon += this.rotationDifference.x,
  4159. this.lat += this.rotationDifference.y,
  4160. this.rotationDifference.set(0, 0),
  4161. this.rotationSpeed.x = this.rotationSpeed.x * (1 - a.rotationFriction) + this.rotationAcc.x * a.rotationAccelerationInside,
  4162. this.rotationSpeed.y = this.rotationSpeed.y * (1 - a.rotationFriction) + this.rotationAcc.y * a.rotationAccelerationInside,
  4163. this.lon += this.rotationSpeed.x * e,
  4164. this.lat += this.rotationSpeed.y * e,
  4165. this.lat = Math.max(a.insideLookLimitDown, Math.min(a.insideLookLimitUp, this.lat)),
  4166. this.phi = r.Math.degToRad(90 - this.lat),
  4167. this.theta = r.Math.degToRad(this.lon),
  4168. this.lookVector.x = Math.sin(this.phi) * Math.cos(this.theta),
  4169. this.lookVector.y = Math.cos(this.phi),
  4170. this.lookVector.z = Math.sin(this.phi) * Math.sin(this.theta),
  4171. this.target.copy(this.lookVector).add(this.camera.position),
  4172. this.camera.lookAt(this.target)
  4173. }
  4174. ,
  4175. n.prototype.onMouseWheel = function(e) {
  4176. if (this.usable()) {
  4177. var t = e.wheelDelta || -e.detail;
  4178. this.emit(u.InteractionDirect),
  4179. this.emit(u.Scroll, t)
  4180. }
  4181. }
  4182. ,
  4183. n.prototype.onKeyDown = function(e) {
  4184. this.usable() && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  4185. this.handleKeyDown(e.which)))
  4186. }
  4187. ,
  4188. n.prototype.handleKeyDown = function(e) {
  4189. var t = function(e, t) {
  4190. this.rotationAcc[e] = t
  4191. }
  4192. .bind(this);
  4193. this.emit(u.InteractionKey);
  4194. var i = !0;
  4195. switch (e) {
  4196. case h.LEFTARROW:
  4197. case h.J:
  4198. t("x", -1);
  4199. break;
  4200. case h.RIGHTARROW:
  4201. case h.L:
  4202. t("x", 1);
  4203. break;
  4204. case h.I:
  4205. t("y", 1);
  4206. break;
  4207. case h.K:
  4208. t("y", -1);
  4209. break;
  4210. default:
  4211. i = !1
  4212. }
  4213. i && this.emit(u.Move, "key")
  4214. }
  4215. ,
  4216. n.prototype.onKeyUp = function(e) {
  4217. this.usable() && (e.preventDefault(),
  4218. e.stopPropagation(),
  4219. this.handleKeyUp(e.which))
  4220. }
  4221. ,
  4222. n.prototype.handleKeyUp = function(e) {
  4223. switch (e) {
  4224. case h.LEFTARROW:
  4225. case h.J:
  4226. case h.RIGHTARROW:
  4227. case h.L:
  4228. this.rotationAcc.x = 0;
  4229. break;
  4230. case h.I:
  4231. case h.K:
  4232. this.rotationAcc.y = 0
  4233. }
  4234. }
  4235. ,
  4236. n.prototype.startRotating = function(e, t) {
  4237. e && (this.rotationAcc.x = e),
  4238. t && (this.rotationAcc.y = t)
  4239. }
  4240. ,
  4241. n.prototype.stopRotating = function(e) {
  4242. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  4243. this.rotationAcc.set(0, 0)
  4244. }
  4245. ,
  4246. n.prototype.reset = function() {
  4247. this.pointerDragOn = !1,
  4248. this.rotationAcc.set(0, 0),
  4249. this.rotationSpeed.set(0, 0),
  4250. this.pointers = []
  4251. }
  4252. ,
  4253. n.prototype.toJSON = function() {
  4254. var e = {
  4255. camera_position: {
  4256. x: l.toPrecision(this.camera.position.x, 4),
  4257. y: l.toPrecision(this.camera.position.y, 4),
  4258. z: l.toPrecision(this.camera.position.z, 4)
  4259. },
  4260. camera_quaternion: {
  4261. x: l.toPrecision(this.camera.quaternion.x, 4),
  4262. y: l.toPrecision(this.camera.quaternion.y, 4),
  4263. z: l.toPrecision(this.camera.quaternion.z, 4),
  4264. w: l.toPrecision(this.camera.quaternion.w, 4)
  4265. }
  4266. };
  4267. return e
  4268. }
  4269. ,
  4270. n.prototype.setStateFromJSON = function(e) {
  4271. this.camera.position.copy(e.camera_position),
  4272. this.camera.quaternion.copy(e.camera_quaternion)
  4273. }
  4274. ,
  4275. t.exports = n
  4276. }
  4277. ).call(this, "/js/controls/PanoramaControls.js")
  4278. }
  4279. , {
  4280. "../enum/ControlEvents": 21,
  4281. "../enum/Keys": 30,
  4282. "../enum/MouseButton": 34,
  4283. "../enum/Vectors": 50,
  4284. "../settings": 166,
  4285. "../util/common": 185,
  4286. "../util/logger": 189,
  4287. "../util/math": 190,
  4288. events: 202,
  4289. three: 217
  4290. }],
  4291. 14: [function(e, t, i) {
  4292. (function(i) {
  4293. "use strict";
  4294. var n = e("three")
  4295. , r = e("../enum/Viewmode")
  4296. , o = e("../util/logger")
  4297. , a = new o(i);
  4298. t.exports = {
  4299. serialize: function(e) {
  4300. return encodeURI(JSON.stringify(e))
  4301. },
  4302. deserialize: function(e) {
  4303. function t(e) {
  4304. function t(e, t) {
  4305. return e && "number" == typeof t && !isNaN(t)
  4306. }
  4307. return e.reduce(t, !0)
  4308. }
  4309. try {
  4310. var i = JSON.parse(decodeURI(e))
  4311. , o = {
  4312. mode: r.fromInt(i.camera_mode),
  4313. panoId: i.scan_id,
  4314. position: (new n.Vector3).copy(i.camera_position),
  4315. quaternion: (new n.Quaternion).copy(i.camera_quaternion),
  4316. zoom: i.ortho_zoom,
  4317. floorVisibility: i.floor_visibility
  4318. }
  4319. , s = o.position;
  4320. t([s.x, s.y, s.z]) || o.position.set(0, 0, 0);
  4321. var l = o.quaternion;
  4322. return t([l.x, l.y, l.z, l.w]) || o.quaternion.set(0, 0, 0, 1),
  4323. o
  4324. } catch (i) {
  4325. a.debug("Not able to parse start location as JSON; falling back to old array style parsing");
  4326. try {
  4327. var c = e.split(",")
  4328. , h = {
  4329. x: parseFloat(c[2]),
  4330. y: parseFloat(c[3]),
  4331. z: parseFloat(c[4])
  4332. }
  4333. , u = {
  4334. x: parseFloat(c[5]),
  4335. y: parseFloat(c[6]),
  4336. z: parseFloat(c[7]),
  4337. w: parseFloat(c[8])
  4338. };
  4339. return t([h.x, h.y, h.z]) || (h.x = 0,
  4340. h.y = 0,
  4341. h.z = 0),
  4342. t([u.x, u.y, u.z, u.w]) || (u.x = 0,
  4343. u.y = 0,
  4344. u.z = 0,
  4345. u.w = 1),
  4346. {
  4347. mode: r.fromInt(c[0]),
  4348. panoId: c[1],
  4349. position: (new n.Vector3).copy(h),
  4350. quaternion: (new n.Quaternion).copy(u)
  4351. }
  4352. } catch (t) {
  4353. a.warn('Invalid start override, ignoring: "' + e + '"', t.message)
  4354. }
  4355. }
  4356. return null
  4357. }
  4358. }
  4359. }
  4360. ).call(this, "/js/controls/serializer.js")
  4361. }
  4362. , {
  4363. "../enum/Viewmode": 51,
  4364. "../util/logger": 189,
  4365. three: 217
  4366. }],
  4367. 15: [function(e, t, i) {
  4368. (function(i) {
  4369. "use strict";
  4370. function n() {
  4371. this.endlessLoop = a.warp.loop,
  4372. this.clock = new r.Clock(!0),
  4373. this.model = null,
  4374. this.player = null,
  4375. this.currentItem = null,
  4376. this.destinationItem = null,
  4377. this.tourIsPlaying = !1,
  4378. this.transitionStage = y.None,
  4379. this.nextFunc = null,
  4380. this.onTheBus = !1,
  4381. this.tourInProgress = !1,
  4382. this.reachSource = null,
  4383. this.interrupted = !1,
  4384. this.nItems = 0,
  4385. this.walkingSectionPaused = !1
  4386. }
  4387. var r = e("three")
  4388. , o = e("./util/logger")
  4389. , a = e("./settings")
  4390. , s = e("./util/transitions")
  4391. , l = e("events").EventEmitter
  4392. , c = e("./enum/Viewmode")
  4393. , h = e("./analytics")
  4394. , u = e("./enum/WarpStyle")
  4395. , s = e("./util/transitions")
  4396. , d = (e("./model/ModelManager"),
  4397. e("./enum/ModelManagerEvents"))
  4398. , p = e("./enum/DirectorEvents")
  4399. , f = e("./enum/PlayerEvents")
  4400. , g = (e("./enum/ControlEvents"),
  4401. e("./enum/BlackoutStyle"))
  4402. , m = e("./enum/PathDiscardMode")
  4403. , v = e("./enum/PathDisplayMode")
  4404. , A = (e("./player"),
  4405. new o(i))
  4406. , y = Object.freeze({
  4407. None: 0,
  4408. Moving: 1,
  4409. Aiming: 2,
  4410. Interlude: 3
  4411. })
  4412. , C = Object.freeze({
  4413. Forward: 1,
  4414. NoChange: 0,
  4415. Backwards: -1
  4416. })
  4417. , I = s.getUniqueId();
  4418. n.prototype = Object.create(l.prototype),
  4419. n.prototype.init = function(e, t) {
  4420. this.player = e,
  4421. this.modelManager = t,
  4422. this.updateModel(),
  4423. this.resetAll(),
  4424. this.bindEvents()
  4425. }
  4426. ,
  4427. n.prototype.resetAll = function() {
  4428. if (this.currentItem = null,
  4429. this.destinationItem = null,
  4430. this.tourIsPlaying = !1,
  4431. this.bgmReplay(),//xzw
  4432. this.transitionStage = y.None,
  4433. this.nextFunc = null,
  4434. this.onTheBus = !1,
  4435. this.reachSource = null,
  4436. this.interrupted = !1,
  4437. this.model) {
  4438. var e = a.path.typ === u.WALK ? u.WALK : u.STD;
  4439. this.defaultWarpStyle = this.model.data.hasOwnProperty("player_options") && this.model.data.player_options && this.model.data.player_options.fast_transitions === !1 ? e : u.BLACK
  4440. } else
  4441. this.defaultWarpStyle = u.BLACK,
  4442. A.warn('No model yet, choosing "' + this.defaultWarpStyle + '" transitions');
  4443. this.resetSpecialTransition()
  4444. }
  4445. ,
  4446. n.prototype.updateModel = function() {
  4447. this.model = this.modelManager.getActiveModel(),
  4448. this.nItems = this.model.heroLocations.length
  4449. }
  4450. ,
  4451. n.prototype.bindEvents = function() {
  4452. this.modelManager.on(d.ActiveModelChanged, this.updateModel.bind(this)),
  4453. this.player.on(f.WarpInterruptedWithFlyTo, this.checkAndHandleWalkingtourInterruption.bind(this)),
  4454. this.player.on(f.Move, this.handlePlayerMove.bind(this)),
  4455. this.player.on(f.PanoChosen, this.handlePlayerPanoChosen.bind(this)),
  4456. this.player.on(f.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  4457. this.player.on(f.InputStart, this.handlePlayerInputStart.bind(this)),
  4458. this.player.on(f.FlyingStarted, this.handlePlayerFlyingStarted.bind(this)),
  4459. this.player.once(f.Move, function() {
  4460. s.cancelById(I)
  4461. })
  4462. }
  4463. ,
  4464. n.prototype.checkAndHandleWalkingtourInterruption = function(e) {
  4465. return e === u.WALK && (this.interrupt(g.NONE),
  4466. this.pauseWalkingSection(),
  4467. this.player.fastForwardActivePanoFlight(),
  4468. !0)
  4469. }
  4470. ,
  4471. n.prototype.handlePlayerMove = function(e) {
  4472. this.transitionStage === y.Interlude && this.interrupt(g.NONE),
  4473. this.emit("update.controls")
  4474. }
  4475. ,
  4476. n.prototype.handlePlayerPanoChosen = function(e, t) {
  4477. this.intermediateState() || e.id === t.id || (this.onTheBus = !1,
  4478. this.emit("update.controls"))
  4479. }
  4480. ,
  4481. n.prototype.handlePlayerModeChanged = function(e, t) {
  4482. this.intermediateState() || e === t || (this.onTheBus = !1,
  4483. this.emit("update.controls"))
  4484. }
  4485. ,
  4486. n.prototype.handlePlayerInputStart = function(e) {
  4487. this.transitionStage === y.Interlude && this.interrupt(g.NONE)
  4488. }
  4489. ,
  4490. n.prototype.handlePlayerFlyingStarted = function() {
  4491. this.clearWalkingSectionPaused()
  4492. }
  4493. ,
  4494. n.prototype.describe = function() {
  4495. return {
  4496. nItems: this.nItems,
  4497. currentItem: this.currentItem,
  4498. destinationItem: this.destinationItem,
  4499. tourIsPlaying: this.tourIsPlaying,
  4500. onTheBus: this.onTheBus,
  4501. endlessLoop: this.endlessLoop,
  4502. viewMode: this.player.mode,
  4503. inTransition: this._inTransition(),
  4504. transitionStage: this.transitionStage,
  4505. tourInProgress: this.tourInProgress
  4506. }
  4507. }
  4508. ,
  4509. n.prototype._inTransition = function() {
  4510. return this.player.flying || this.player.isWarping() || this.player.isWaitingToWarp() || this.player.mode === c.TRANSITIONING || this.tourIsPlaying
  4511. }
  4512. ,
  4513. n.prototype.bounceable = function() {
  4514. var e = this.clock.getDelta();
  4515. return this.isInterrupted() || e < .9 && e > .01 || this.player.flying && !this.player.isWarping()
  4516. }
  4517. ,
  4518. n.prototype.currentMoveDirection = function() {
  4519. return null === this.currentItem || void 0 === this.currentItem ? C.Forward : this.destinationItem === this.currentItem ? C.NoChange : this.destinationItem > this.currentItem ? C.Forward : C.Backwards
  4520. }
  4521. ,
  4522. n.prototype.clearPath = function() {
  4523. this._inTransition() || this.player.path.discardPathObject()
  4524. }
  4525. ,
  4526. n.prototype.allFloors = function() {
  4527. this.model.toggleAllFloors()
  4528. }
  4529. ,
  4530. n.prototype.actionComplete = function(e) {
  4531. if (this.interrupted = !1,
  4532. this.transitionStage = y.None,
  4533. this.resetSpecialTransition(),
  4534. null !== this.destinationItem && this.setCurrentItem(this.destinationItem),
  4535. this.tourIsPlaying || (this.player.disablePreRendering(),
  4536. this.player.mode === c.PANORAMA && this.player.currentPano.isAligned() && this.model.fadePanoMarkers()),
  4537. this.emit("update.controls"),
  4538. this.nextFunc) {
  4539. var t = this.nextFunc;
  4540. this.nextFunc = null,
  4541. t()
  4542. }
  4543. }
  4544. ,
  4545. n.prototype.awaitCompletion = function(e, t) {
  4546. this.nextFunc = t,
  4547. e()
  4548. }
  4549. ,
  4550. n.prototype.updateSuccessFunction = function(e) {
  4551. this.nextFunc = e
  4552. }
  4553. ,
  4554. n.prototype.interrupt = function(e, t) {
  4555. return !!this.wouldInterrupt() && (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4556. this.tourIsPlaying = !1,
  4557. this.bgmReplay(),//xzw
  4558. this.interrupted = !0,
  4559. this.nextFunc = null,
  4560. this.emit(p.ActionInterrupted),
  4561. null !== e && void 0 !== e || (e = g.BEGINNING),
  4562. this.player.interruptAndFastForward(e, t),
  4563. !0)
  4564. }
  4565. ,
  4566. n.prototype.wouldInterrupt = function() {
  4567. return this.transitionStage !== y.None
  4568. }
  4569. ,
  4570. n.prototype.intermediateState = function() {
  4571. return this.transitionStage !== y.None
  4572. }
  4573. ,
  4574. n.prototype.isInterrupted = function() {
  4575. return this.interrupted
  4576. }
  4577. ,
  4578. n.prototype.pauseWalkingSection = function() {
  4579. this.walkingSectionPaused = !0
  4580. }
  4581. ,
  4582. n.prototype.clearWalkingSectionPaused = function() {
  4583. this.walkingSectionPaused = !1
  4584. }
  4585. ,
  4586. n.prototype.autoTour = function() {
  4587. var e = Date.now();
  4588. this.model.auxDataPromise.then(function() {
  4589. e = Date.now() - e;
  4590. var t = a.warp.auto
  4591. , i = this.model.data && this.model.data.player_options && this.model.data.player_options.highlight_reel;
  4592. t >= 0 && this.model.heroCount() > 1 && i && s.trigger({
  4593. duration: Math.max(1e3 * Math.min(300, t) - e, 0),
  4594. done: function() {
  4595. this.playTour()
  4596. }
  4597. .bind(this),
  4598. name: "_atr",
  4599. id: I
  4600. })
  4601. }
  4602. .bind(this))
  4603. }
  4604. ,
  4605. n.prototype.atDestinationPano = function() {
  4606. if (!this.player.currentPano || null === this.destinationItem)
  4607. return !1;
  4608. var e = this.player.currentPano.id;
  4609. if (void 0 === e)
  4610. return !1;
  4611. var t = this.model.heroLocations;
  4612. return null !== this.destinationItem && void 0 !== t[this.destinationItem] && e === t[this.destinationItem].panoId
  4613. }
  4614. ,
  4615. n.prototype.redirectToItem = function(e, t) {
  4616. if (null === e || void 0 === e)
  4617. return void A.warn("Director.redirectToItem() -> Redirecting to null item.");
  4618. if (!this.wouldInterrupt())
  4619. return void A.warn("Director.redirectToItem() -> Director cannot redirect if there is nothing to interrupt.");
  4620. if (this.player.mode === c.TRANSITIONING)
  4621. return void A.debug("Director.redirectToItem() -> Cannot redirect while transitioning.");
  4622. A.debug("Director.redirectToItem() -> Redirecting to " + e + " via " + t);
  4623. var i = function() {
  4624. s.setTimeout(function() {
  4625. this.setDestinationItem(e),
  4626. this.goToDestination(!0, g.BEGINNING, a.warp.warpInterruptionRedirectTime, !1)
  4627. }
  4628. .bind(this), 0)
  4629. }
  4630. .bind(this);
  4631. this.interrupt(g.END, 0),
  4632. this.updateSuccessFunction(i)
  4633. }
  4634. ,
  4635. n.prototype.useSpecialTransition = function(e) {
  4636. void 0 !== e && this.defaultWarpStyle !== u.BLACK && A.debug("useSpecialTransition(): " + e),
  4637. this.nextWarpStyle = u.BLACK
  4638. }
  4639. ,
  4640. n.prototype.resetSpecialTransition = function() {
  4641. this.nextWarpStyle = this.defaultWarpStyle
  4642. }
  4643. ,
  4644. n.prototype.arrivedAtDestination = function(e) {
  4645. if (this.player.flying || this.player.isWarping())
  4646. A.warn("Cannot advance to interlude or aiming while player is flying or warping.");
  4647. else {
  4648. this.transitionStage = y.Aiming;
  4649. var t = this.tourIsPlaying ? this.tourInterlude.bind(this, this.nextItem(this.currentItem)) : null;
  4650. this.player.model.fadePanoMarkers(0),
  4651. this.awaitCompletion(function() {
  4652. this.resetSpecialTransition(),
  4653. e ? this.player.aimTourCamera(this.destinationItem, v.Retain, v.Slow, this.actionComplete.bind(this)) : this.actionComplete()
  4654. }
  4655. .bind(this), t)
  4656. }
  4657. }
  4658. ,
  4659. n.prototype.goToDestination = function(e, t, i, n) {
  4660. //xzw add:
  4661. if(g_data2.tourAudio){
  4662. var tM = g_data2.tourAudio[this.model.heroLocations[this.destinationItem].sid];
  4663. if(tM && tM.music){
  4664. var s = g_Prefix+"/audio/"+g_index+"/"+tM.music;
  4665. if(g_tourAudio.src==s && !g_tourAudio.paused) return;
  4666. g_tourAudio.src = s;
  4667. g_playAudio = g_tourAudio;
  4668. g_play && g_tourAudio.play();
  4669. g_bgAudio && g_bgAudio.pause();
  4670. }
  4671. }
  4672. if (this.onTheBus = !0,
  4673. this.emit("update.controls"),
  4674. this.player.updateLastView(),
  4675. !n && this.atDestinationPano())
  4676. return void this.arrivedAtDestination(!0);
  4677. if (this.player.flying || this.player.isWarping())
  4678. A.warn("Cannot go to new destination while player is flying or warping.");
  4679. else {
  4680. var r = this.model.getHeroDescriptorByIndex(this.destinationItem)
  4681. , o = null
  4682. , a = null;
  4683. if (r.isPano()) {
  4684. var s = 0 === this.destinationItem || e ? u.BLACK : this.nextWarpStyle;
  4685. a = this.player.warpToPanoByHeroIndex.bind(this.player, this.destinationItem, v.Show, m.Slow, s, t, i, this.actionComplete.bind(this)),
  4686. o = this.arrivedAtDestination.bind(this, !0)
  4687. } else
  4688. a = this.player.warpToNonPanoByHeroIndex.bind(this.player, this.destinationItem, this.actionComplete.bind(this)),
  4689. o = this.arrivedAtDestination.bind(this, !1);
  4690. this.transitionStage = y.Moving,
  4691. this.model.fadePanoMarkers(0),
  4692. this.awaitCompletion(function() {
  4693. a()
  4694. }
  4695. .bind(this), o),
  4696. this.emit("update.controls")
  4697. }
  4698. }
  4699. ,
  4700. n.prototype.tourInterlude = function() {
  4701. if (h.trackAlways("reach_highlight", {
  4702. reach_source: this.reachSource
  4703. }),
  4704. this.model.fadePanoMarkers(0),
  4705. this.emit("update.controls"),
  4706. this.tourIsPlaying)
  4707. return this.atEndOfTour() && !this.endlessLoop ? (this.tourInProgress = !1,
  4708. this.stopTour(),
  4709. this.emit(p.TourEnd),
  4710. void (this.player.mode === c.PANORAMA && this.model.fadePanoMarkers(a.panorama.markerOpacity))) : void this.awaitCompletion(function() {
  4711. this.transitionStage = y.Interlude,
  4712. this.player.tourInterlude(this.nextItem(this.currentItem), this.actionComplete.bind(this))
  4713. }
  4714. .bind(this), this.goNext.bind(this))
  4715. }
  4716. ,
  4717. n.prototype.playTour = function() {
  4718. if (!this.bounceable())
  4719. return this.tourIsPlaying ? void A.info("tour is already playing") : void (this.wouldInterrupt() || (this.player.emit("tour_auto", this.defaultWarpStyle),
  4720. this.tourInProgress = !0,
  4721. this.reachSource = "play",
  4722. this.tourIsPlaying = !0,
  4723. this.wasZoomEnabled = this.player.zoomEnabled,
  4724. this.player.zoomEnabled = !1,
  4725. this.resetSpecialTransition(),
  4726. this.emit("update.controls"),
  4727. this.emit(p.TourStart),
  4728. this.player.enablePreRendering(),
  4729. this.walkingSectionPaused ? (this.clearWalkingSectionPaused(),
  4730. this.goToDestination()) : this.goNext()))
  4731. }
  4732. ,
  4733. n.prototype.bgmReplay = function() {//xzw add 结束tour后可能要继续播放背景音乐
  4734. if(g_tourAudio && g_tourAudio.paused && g_bgAudio && g_bgAudio.paused){
  4735. g_playAudio = g_bgAudio;
  4736. g_bgAudio.play()
  4737. }
  4738. }
  4739. ,
  4740. n.prototype.stopTour = function() {
  4741. this.isInterrupted() || this.transitionStage === y.Moving && this.checkAndHandleWalkingtourInterruption(this.nextWarpStyle) || (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4742. this.tourIsPlaying = !1,
  4743. this.bgmReplay(),//xzw
  4744. this.interrupt(),
  4745. this.clearWalkingSectionPaused(),
  4746. this.resetSpecialTransition(),
  4747. this.emit("update.controls"))
  4748. }
  4749. ,
  4750. n.prototype.endTourProgress = function() {
  4751. this.tourInProgress = !1,
  4752. this.emit("update.controls"),
  4753. this.emit(p.TourEnd)
  4754. }
  4755. ,
  4756. n.prototype.goToHighlight = function(e) {
  4757. if (this.wouldInterrupt())
  4758. e === this.destinationItem ? this.interrupt() : this.redirectToItem(e, "goToHighlight");
  4759. else {
  4760. if (A.debug("<tour.goto " + e + ">"),
  4761. this.isInterrupted())
  4762. return;
  4763. this.clearWalkingSectionPaused(),
  4764. this.setDestinationItem(e),
  4765. this.useSpecialTransition("Hilight"),
  4766. this.goToDestination(),
  4767. h.trackAlways("reach_highlight", {
  4768. reach_source: "thumb"
  4769. })
  4770. }
  4771. }
  4772. ,
  4773. n.prototype.prevHighlight = function() {
  4774. this.bounceable() || (this.player.emit("tour_manual", "prev"),
  4775. this.interrupt(g.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4776. this.reachSource = "prev",
  4777. this.goPrev()))
  4778. }
  4779. ,
  4780. n.prototype.nextHighlight = function() {
  4781. this.bounceable() || (this.player.emit("tour_manual", "next"),
  4782. this.interrupt(g.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4783. this.reachSource = "next",
  4784. this.goNext()))
  4785. }
  4786. ,
  4787. n.prototype.changeMode = function(e) {
  4788. var t = $.Deferred()
  4789. , i = t.resolve.bind(t)
  4790. , n = t.reject.bind(t);
  4791. this.emit(p.StartModeChange);
  4792. var r = function() {
  4793. return this.clearWalkingSectionPaused(),
  4794. !!this.wouldInterrupt() && (this.interrupt(),
  4795. !0)
  4796. }
  4797. .bind(this);
  4798. if (!r()) {
  4799. switch (e) {
  4800. case c.PANORAMA:
  4801. this.player.mode === c.PANORAMA ? this.player.currentPano.isAligned() || this.player.goToLastView(!0).done(i).fail(n) : this.player.insideMode(this.player.lastInsideView.pano).done(i).fail(n);
  4802. break;
  4803. case c.DOLLHOUSE:
  4804. case c.FLOORPLAN:
  4805. this.player.flyToNewMode({
  4806. mode: e
  4807. }).done(i).fail(n);
  4808. break;
  4809. case c.OUTDOOR:
  4810. this.player.model.has360Views && (this.player.mode !== c.PANORAMA || this.player.mode === c.PANORAMA && this.player.currentPano.isAligned()) && this.player.goToLastView(!1).done(i).fail(n)
  4811. }
  4812. return t.promise()
  4813. }
  4814. }
  4815. ,
  4816. n.prototype.atEndOfTour = function() {
  4817. var e = this.currentItem >= this.nItems - 1;
  4818. return e
  4819. }
  4820. ,
  4821. n.prototype.firstDestination = function() {
  4822. return this.nItems > 0 ? 0 : null
  4823. }
  4824. ,
  4825. n.prototype.finalDestination = function() {
  4826. return this.nItems > 0 ? this.nItems - 1 : null
  4827. }
  4828. ,
  4829. n.prototype.goPrev = function() {
  4830. this.tourAdvance(-1)
  4831. }
  4832. ,
  4833. n.prototype.goNext = function() {
  4834. this.tourAdvance(1)
  4835. }
  4836. ,
  4837. n.prototype.setDestinationItem = function(e) {
  4838. this.destinationItem = e,
  4839. this.emit("update.controls")
  4840. }
  4841. ,
  4842. n.prototype.setCurrentItem = function(e) {
  4843. this.currentItem = e,
  4844. this.emit("update.controls")
  4845. }
  4846. ,
  4847. n.prototype.nextItem = function(e) {
  4848. return null === e ? this.firstDestination() : e >= this.nItems - 1 ? this.endlessLoop ? this.firstDestination() : null : e + 1
  4849. }
  4850. ,
  4851. n.prototype.prevItem = function(e) {
  4852. return null === e ? this.firstDestination() : e < 0 ? this.endlessLoop ? this.lastDestination() : null : e - 1
  4853. }
  4854. ,
  4855. n.prototype.tourAdvance = function(e) {
  4856. A.debug("tourAdvance(" + e + ")"),
  4857. null === this.currentItem || void 0 === this.currentItem ? this.setDestinationItem(this.firstDestination()) : this.setDestinationItem(this.currentItem + e),
  4858. this.destinationItem < 0 ? (this.setDestinationItem(this.finalDestination()),
  4859. this.useSpecialTransition("reverse-looping to end")) : this.destinationItem >= this.nItems && (this.setDestinationItem(this.firstDestination()),
  4860. this.useSpecialTransition("looping back to start")),
  4861. this.goToDestination()
  4862. }
  4863. ,
  4864. t.exports = n
  4865. }
  4866. ).call(this, "/js/director.js")
  4867. }
  4868. , {
  4869. "./analytics": 4,
  4870. "./enum/BlackoutStyle": 18,
  4871. "./enum/ControlEvents": 21,
  4872. "./enum/DirectorEvents": 23,
  4873. "./enum/ModelManagerEvents": 33,
  4874. "./enum/PathDiscardMode": 38,
  4875. "./enum/PathDisplayMode": 39,
  4876. "./enum/PlayerEvents": 40,
  4877. "./enum/Viewmode": 51,
  4878. "./enum/WarpStyle": 52,
  4879. "./model/ModelManager": 140,
  4880. "./player": 155,
  4881. "./settings": 166,
  4882. "./util/logger": 189,
  4883. "./util/transitions": 195,
  4884. events: 202,
  4885. three: 217
  4886. }],
  4887. 16: [function(e, t, i) {
  4888. "use strict";
  4889. var n = e("three")
  4890. , r = e("./enum/Viewmode")
  4891. , o = (e("./settings"),
  4892. e("./util/transitions"))
  4893. , a = e("./enum/PlayerEvents")
  4894. , s = new n.ShaderPass(n.HorizontalBlurShader)
  4895. , l = new n.ShaderPass(n.VerticalBlurShader);
  4896. l.renderToScreen = !0;
  4897. var c = $("#player").width() / $("#player").height();
  4898. isNaN(c) && (c = 1);
  4899. var h = {
  4900. currentBlur: 0,
  4901. aspect: c,
  4902. blurStrength: 1,
  4903. hblurPass: s,
  4904. vblurPass: l,
  4905. bindEvents: function(e) {
  4906. e.on(a.ModeChanged, function(e, t) {
  4907. e === r.PANORAMA && (o.cancel(h.blur),
  4908. o.cancel(h.addBlur),
  4909. o.start(h.removeBlur, 500, null, 0, null, "deblur"))
  4910. })
  4911. },
  4912. blur: function(e) {
  4913. h.currentBlur = e;
  4914. var t = e * h.blurStrength;
  4915. l.uniforms.v.value = t / 512 * h.aspect,
  4916. s.uniforms.h.value = t / 512
  4917. },
  4918. addBlur: function(e) {
  4919. e = Math.max(e, h.currentBlur),
  4920. h.blur(e)
  4921. },
  4922. removeBlur: function(e) {
  4923. e = Math.min(1 - e, h.currentBlur),
  4924. h.blur(e)
  4925. }
  4926. };
  4927. h.blur(0),
  4928. t.exports = h
  4929. }
  4930. , {
  4931. "./enum/PlayerEvents": 40,
  4932. "./enum/Viewmode": 51,
  4933. "./settings": 166,
  4934. "./util/transitions": 195,
  4935. three: 217
  4936. }],
  4937. 17: [function(e, t, i) {
  4938. "use strict";
  4939. t.exports = {
  4940. UNKNOWN: 0,
  4941. ALIGNED: 1,
  4942. UNALIGNED: 2,
  4943. PLACED: 3
  4944. }
  4945. }
  4946. , {}],
  4947. 18: [function(e, t, i) {
  4948. "use strict";
  4949. t.exports = {
  4950. NONE: 0,
  4951. MIDDLE: 1,
  4952. END: 2,
  4953. BEGINNING: 3,
  4954. FADEIN: 4
  4955. }
  4956. }
  4957. , {}],
  4958. 19: [function(e, t, i) {
  4959. "use strict";
  4960. var n = e("three");
  4961. t.exports = {
  4962. newBlue: new n.Color(4967932),
  4963. altBlue: new n.Color(47355),
  4964. tagDefault: new n.Color(223357),
  4965. classicBlue: new n.Color(53759),
  4966. mpYellow: new n.Color(16502016),
  4967. mpOrange: new n.Color(16428055),
  4968. mpBlue: new n.Color(12096),
  4969. mpLtGrey: new n.Color(13751252),
  4970. mpDkGrey: new n.Color(10000019),
  4971. mpRed: new n.Color(12525854),
  4972. mpOrangeDesat: new n.Color(16764529),
  4973. mpBlueDesat: new n.Color(4034734),
  4974. mpRedDesat: new n.Color(14705505),
  4975. white: new n.Color(16777215),
  4976. black: new n.Color(0),
  4977. _desat: function(e, t) {
  4978. var i = t || .3
  4979. , r = (new n.Color).copy(e).getHSL();
  4980. return (new n.Color).setHSL(r.h, r.s * (1 - i), r.l)
  4981. },
  4982. _darken: function(e, t) {
  4983. var i = t || .2
  4984. , r = e.getHSL();
  4985. return (new n.Color).setHSL(r.h, r.s, r.l * (1 - i))
  4986. }
  4987. }
  4988. }
  4989. , {
  4990. three: 217
  4991. }],
  4992. 20: [function(e, t, i) {
  4993. "use strict";
  4994. t.exports = {
  4995. NONE: -1,
  4996. ROTATE: 0,
  4997. DOLLY: 1,
  4998. PAN: 2,
  4999. ROTATE_DOLLY: 3,
  5000. PAN_DOLLY: 4
  5001. }
  5002. }
  5003. , {}],
  5004. 21: [function(e, t, i) {
  5005. "use strict";
  5006. t.exports = {
  5007. Move: "move",
  5008. InteractionDirect: "interaction.direct",
  5009. InteractionKey: "interaction.key",
  5010. InteractionGui: "interaction.gui",
  5011. FlyInDirection: "fly.direction",
  5012. InputStart: "input.start",
  5013. Pinch: "input.pinch",
  5014. Scroll: "input.scroll",
  5015. AutoPanInterrupt: "autopan.interrupt",
  5016. AutoPanComplete: "autopan.complete",
  5017. AutoPanClamped: "autopan.clamped",
  5018. LongTap: "longtap"
  5019. }
  5020. }
  5021. , {}],
  5022. 22: [function(e, t, i) {
  5023. "use strict";
  5024. t.exports = Object.freeze({
  5025. FORWARD: "FORWARD",
  5026. LEFT: "LEFT",
  5027. RIGHT: "RIGHT",
  5028. BACK: "BACK",
  5029. UP: "UP",
  5030. DOWN: "DOWN"
  5031. })
  5032. }
  5033. , {}],
  5034. 23: [function(e, t, i) {
  5035. "use strict";
  5036. t.exports = {
  5037. ActionInterrupted: "action.interrupted",
  5038. TourStart: "tour.start",
  5039. TourEnd: "tour.end",
  5040. StartModeChange: "mode.startChange"
  5041. }
  5042. }
  5043. , {}],
  5044. 24: [function(e, t, i) {
  5045. "use strict";
  5046. t.exports = Object.freeze({
  5047. None: 0,
  5048. Queued: 1,
  5049. ForceQueued: 2,
  5050. Downloading: 3,
  5051. Downloaded: 4,
  5052. DownloadFailed: 5
  5053. })
  5054. }
  5055. , {}],
  5056. 25: [function(e, t, i) {
  5057. "use strict";
  5058. t.exports = {
  5059. GL_TEXTURE_CUBE_MAP_POSITIVE_X: 0,
  5060. GL_TEXTURE_CUBE_MAP_NEGATIVE_X: 1,
  5061. GL_TEXTURE_CUBE_MAP_POSITIVE_Y: 2,
  5062. GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: 3,
  5063. GL_TEXTURE_CUBE_MAP_POSITIVE_Z: 4,
  5064. GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: 5
  5065. }
  5066. }
  5067. , {}],
  5068. 26: [function(e, t, i) {
  5069. "use strict";
  5070. t.exports = {
  5071. Texture2D: 0,
  5072. TextureCube: 1
  5073. }
  5074. }
  5075. , {}],
  5076. 27: [function(e, t, i) {
  5077. "use strict";
  5078. t.exports = {
  5079. SMALL: "small",
  5080. LARGE: "large"
  5081. }
  5082. }
  5083. , {}],
  5084. 28: [function(e, t, i) {
  5085. "use strict";
  5086. var n = e("./Viewmode")
  5087. , r = {
  5088. LANDING: {},
  5089. NAVIGATION: "navigation",
  5090. MORE_HELP: "moreHelp",
  5091. TOUR_INTERACTION: {}
  5092. };
  5093. r.LANDING[n.PANORAMA] = "panorama.landing",
  5094. r.LANDING[n.OUTDOOR] = "outdoor.landing",
  5095. r.LANDING[n.DOLLHOUSE] = "dollhouse.landing",
  5096. r.LANDING[n.FLOORPLAN] = "floorplan.landing",
  5097. r.TOUR_INTERACTION.standard = "standard.tour",
  5098. r.TOUR_INTERACTION[n.OUTDOOR] = "outdoor.tour",
  5099. r.TOUR_INTERACTION[n.FLOORPLAN] = "floorplan.tour",
  5100. t.exports = r
  5101. }
  5102. , {
  5103. "./Viewmode": 51
  5104. }],
  5105. 29: [function(e, t, i) {
  5106. "use strict";
  5107. var n = {
  5108. UP: 1,
  5109. DOWN: -1,
  5110. LEFT: "L",
  5111. RIGHT: "R",
  5112. FORWARD: "F",
  5113. BACK: "B",
  5114. reverse: {},
  5115. opposite: function(e) {
  5116. return this.reverse[e.toString()]
  5117. }
  5118. };
  5119. !function() {
  5120. n.reverse[n.UP] = n.DOWN,
  5121. n.reverse[n.DOWN] = n.UP,
  5122. n.reverse[n.LEFT] = n.RIGHT,
  5123. n.reverse[n.RIGHT] = n.LEFT,
  5124. n.reverse[n.FORWARD] = n.BACK,
  5125. n.reverse[n.BACK] = n.FORWARD
  5126. }(),
  5127. t.exports = n
  5128. }
  5129. , {}],
  5130. 30: [function(e, t, i) {
  5131. "use strict";
  5132. var n = e("../util/browser")
  5133. , r = {
  5134. ZERO: 48,
  5135. ONE: 49,
  5136. TWO: 50,
  5137. THREE: 51,
  5138. FOUR: 52,
  5139. FIVE: 53,
  5140. SIX: 54,
  5141. SEVEN: 55,
  5142. EIGHT: 56,
  5143. NINE: 57,
  5144. LEFTARROW: 37,
  5145. UPARROW: 38,
  5146. RIGHTARROW: 39,
  5147. DOWNARROW: 40,
  5148. A: 65,
  5149. B: 66,
  5150. C: 67,
  5151. D: 68,
  5152. E: 69,
  5153. F: 70,
  5154. G: 71,
  5155. H: 72,
  5156. I: 73,
  5157. J: 74,
  5158. K: 75,
  5159. L: 76,
  5160. M: 77,
  5161. N: 78,
  5162. O: 79,
  5163. P: 80,
  5164. Q: 81,
  5165. R: 82,
  5166. S: 83,
  5167. T: 84,
  5168. U: 85,
  5169. V: 86,
  5170. W: 87,
  5171. X: 88,
  5172. Y: 89,
  5173. Z: 90,
  5174. SPACE: 32,
  5175. RETURN: 13,
  5176. SEMICOLON: 186,
  5177. PLUSEQUALS: 187,
  5178. DASHUNDERSCORE: 189,
  5179. OPENBRACKET: 219
  5180. };
  5181. n.detectFirefox() && (r.SEMICOLON = 59,
  5182. r.PLUSEQUALS = 61,
  5183. r.DASHUNDERSCORE = 173),
  5184. t.exports = r
  5185. }
  5186. , {
  5187. "../util/browser": 182
  5188. }],
  5189. 31: [function(e, t, i) {
  5190. "use strict";
  5191. t.exports = {
  5192. EN_US: "en-US",
  5193. ES_MX: "es-MX",
  5194. FR_FR: "fr-FR",
  5195. DE_DE: "de-DE",
  5196. RU_RU: "ru-RU",
  5197. CN_CN: "cn-CN",
  5198. JP_JP: "jp-JP"
  5199. }
  5200. }
  5201. , {}],
  5202. 32: [function(e, t, i) {
  5203. "use strict";
  5204. t.exports = {
  5205. TagActivated: "tag.activated",
  5206. TagDismissed: "tag.dismissed",
  5207. TagNavigation: "tag.navigation"
  5208. }
  5209. }
  5210. , {}],
  5211. 33: [function(e, t, i) {
  5212. "use strict";
  5213. t.exports = {
  5214. ModelAdded: "model-added",
  5215. ActiveModelChanged: "active-model-changed"
  5216. }
  5217. }
  5218. , {}],
  5219. 34: [function(e, t, i) {
  5220. "use strict";
  5221. t.exports = {
  5222. LEFT: 0,
  5223. MIDDLE: 1,
  5224. RIGHT: 2
  5225. }
  5226. }
  5227. , {}],
  5228. 35: [function(e, t, i) {
  5229. "use strict";
  5230. t.exports = {
  5231. PanoRenderComplete: "panorama.render.complete",
  5232. TileRenderFailure: "panorama.tile.render.failed",
  5233. TileRenderSuccess: "panorama.tile.render.success",
  5234. TileUploadAttempted: "panorama.tile.upload.attempted",
  5235. UploadAttemptedForAllTiles: "panorama.upload.attempted.all.tiles",
  5236. ZoomLevelRenderStarted: "panorama.zoom.render.started"
  5237. }
  5238. }
  5239. , {}],
  5240. 36: [function(e, t, i) {
  5241. "use strict";
  5242. t.exports = {
  5243. BASE: 1,
  5244. STANDARD: 2,
  5245. HIGH: 3,
  5246. ULTRAHIGH: 4
  5247. }
  5248. }
  5249. , {}],
  5250. 37: [function(e, t, i) {
  5251. "use strict";
  5252. t.exports = {
  5253. LoadComplete: "panorama.load.complete",
  5254. LoadFailed: "panorama.load.failed",
  5255. TileLoaded: "panorama.tile.loaded"
  5256. }
  5257. }
  5258. , {}],
  5259. 38: [function(e, t, i) {
  5260. "use strict";
  5261. t.exports = Object.freeze({
  5262. Standard: 0,
  5263. Slow: 1,
  5264. Retain: 2
  5265. })
  5266. }
  5267. , {}],
  5268. 39: [function(e, t, i) {
  5269. "use strict";
  5270. t.exports = Object.freeze({
  5271. Show: 0,
  5272. Hide: 1,
  5273. Retain: 2
  5274. })
  5275. }
  5276. , {}],
  5277. 40: [function(e, t, i) {
  5278. "use strict";
  5279. t.exports = {
  5280. Move: "move",
  5281. MoveComplete: "move.complete",
  5282. ModeChanged: "mode.changed",
  5283. ModeChanging: "mode.changing",
  5284. PanoChosen: "pano.chosen",
  5285. ClosestPanoChanging: "closest.pano.changing",
  5286. WarpStarted: "warp.started",
  5287. WarpInterrupted: "warp.interrupted",
  5288. WarpEnded: "warp.ended",
  5289. FlyinFinished: "flyin.finished",
  5290. FlyingStarted: "flying.started",
  5291. FlyingInterrupted: "flying.interrupted",
  5292. FlyingEnded: "flying.ended",
  5293. Ready: "ready",
  5294. StartInside: "start.inside",
  5295. StartOutside: "start.outside",
  5296. ViewChanged: "view.changed",
  5297. WarpInterruptedWithFlyTo: "warp.interrupted.flyto",
  5298. InputStart: "input.start"
  5299. }
  5300. }
  5301. , {}],
  5302. 41: [function(e, t, i) {
  5303. "use strict";
  5304. t.exports = Object.freeze({
  5305. DEFAULT: 0,
  5306. PANOMARKERS: 1,
  5307. RETICULE: 2,
  5308. TAG: 3
  5309. })
  5310. }
  5311. , {}],
  5312. 42: [function(e, t, i) {
  5313. "use strict";
  5314. t.exports = {
  5315. visibleFloor: 1,
  5316. ghostFloor: 3,
  5317. boundingSkybox: 1,
  5318. panoMarker: 2,
  5319. reticule: 3,
  5320. tagStem: 4,
  5321. tagDisc: 5,
  5322. ribbon: 100
  5323. }
  5324. }
  5325. , {}],
  5326. 43: [function(e, t, i) {
  5327. "use strict";
  5328. t.exports = {
  5329. ContextCreated: "scene-renderer-context-created",
  5330. AfterRender: "after-render",
  5331. MemoryUsageUpdated: "scene-renderer-memory-usage-updated"
  5332. }
  5333. }
  5334. , {}],
  5335. 44: [function(e, t, i) {
  5336. "use strict";
  5337. t.exports = {
  5338. IDLE: "idle",
  5339. BROWSE: "browse",
  5340. EXAMINE: "examine"
  5341. }
  5342. }
  5343. , {}],
  5344. 45: [function(e, t, i) {
  5345. "use strict";
  5346. t.exports = {
  5347. TileDownloadSuccess: "tiledownloader.download.success",
  5348. TileDownloadFailure: "tiledownloader.download.failure",
  5349. PanoDownloadComplete: "tiledownloader.pano.download.complete"
  5350. }
  5351. }
  5352. , {}],
  5353. 46: [function(e, t, i) {
  5354. "use strict";
  5355. t.exports = {
  5356. CardboardAndroid: "googlevr",
  5357. GearVR: "gearvr",
  5358. CardboardIOS: "googlevrios",
  5359. Cardboard: "googlevr"
  5360. }
  5361. }
  5362. , {}],
  5363. 47: [function(e, t, i) {
  5364. "use strict";
  5365. t.exports = {
  5366. NONE: 0,
  5367. CONTEXTUAL: 1,
  5368. ANDROID: 2
  5369. }
  5370. }
  5371. , {}],
  5372. 48: [function(e, t, i) {
  5373. "use strict";
  5374. var n = {
  5375. Title: 0,
  5376. Cardboard: 1
  5377. }
  5378. , r = {
  5379. Title: 0,
  5380. Cardboard: 1,
  5381. Gear: 2
  5382. };
  5383. !function() {
  5384. [n, r].forEach(function(e) {
  5385. e.pageCount = Object.keys(e).length
  5386. })
  5387. }(),
  5388. t.exports.ios = n,
  5389. t.exports.standard = r
  5390. }
  5391. , {}],
  5392. 49: [function(e, t, i) {
  5393. "use strict";
  5394. t.exports = {
  5395. Android: "android",
  5396. IOS: "ios",
  5397. Desktop: "desktop",
  5398. UnsupportedAndroid: "android-unsupported"
  5399. }
  5400. }
  5401. , {}],
  5402. 50: [function(e, t, i) {
  5403. "use strict";
  5404. var n = e("three");
  5405. t.exports = {
  5406. UP: new n.Vector3(0,1,0),
  5407. DOWN: new n.Vector3(0,-1,0),
  5408. LEFT: new n.Vector3(-1,0,0),
  5409. RIGHT: new n.Vector3(1,0,0),
  5410. FORWARD: new n.Vector3(0,0,-1),
  5411. BACK: new n.Vector3(0,0,1)
  5412. }
  5413. }
  5414. , {
  5415. three: 217
  5416. }],
  5417. 51: [function(e, t, i) {
  5418. "use strict";
  5419. var n = e("../exception/ViewmodeConvertException")
  5420. , r = e("./coreViewmodes")
  5421. , o = e("../util/common")
  5422. , a = {
  5423. MESH: "mesh",
  5424. OUTDOOR: "outdoor",
  5425. TRANSITIONING: "transitioning",
  5426. toInt: function(e) {
  5427. switch (e) {
  5428. case this.PANORAMA:
  5429. return 1;
  5430. case this.DOLLHOUSE:
  5431. return 2;
  5432. case this.FLOORPLAN:
  5433. return 3;
  5434. case this.OUTDOOR:
  5435. return 4;
  5436. case this.TRANSITIONING:
  5437. return -1
  5438. }
  5439. throw new n("No known conversion for Viewmode to int for mode: " + e)
  5440. },
  5441. fromInt: function(e) {
  5442. switch (e) {
  5443. case "1":
  5444. case 1:
  5445. return this.PANORAMA;
  5446. case "2":
  5447. case 2:
  5448. return this.DOLLHOUSE;
  5449. case "3":
  5450. case 3:
  5451. return this.FLOORPLAN;
  5452. case "4":
  5453. case 4:
  5454. return this.OUTDOOR
  5455. }
  5456. throw new n("No known conversion for int to viewmode for int: " + e)
  5457. },
  5458. convertWorkshopModeInt: function(e) {
  5459. switch (e) {
  5460. case "0":
  5461. case 0:
  5462. case undefined: //xzw add
  5463. return this.PANORAMA;
  5464. case "1":
  5465. case 1:
  5466. return this.FLOORPLAN;
  5467. case "2":
  5468. case 2:
  5469. return this.DOLLHOUSE;
  5470. case "3":
  5471. case 3:
  5472. return this.MESH
  5473. }
  5474. throw new n("No known conversion for Workshop int to viewmode for int: " + e)
  5475. }
  5476. };
  5477. o.extendObject(a, r),
  5478. t.exports = a
  5479. }
  5480. , {
  5481. "../exception/ViewmodeConvertException": 58,
  5482. "../util/common": 185,
  5483. "./coreViewmodes": 54
  5484. }],
  5485. 52: [function(e, t, i) {
  5486. "use strict";
  5487. t.exports = {
  5488. BLACK: "black",
  5489. STD: "std",
  5490. WALK: "walk"
  5491. }
  5492. }
  5493. , {}],
  5494. 53: [function(e, t, i) {
  5495. "use strict";
  5496. t.exports = {
  5497. ZoomIn: "zoom.in",
  5498. ZoomOut: "zoom.out",
  5499. ZoomMax: "zoom.max",
  5500. ZoomMin: "zoom.min"
  5501. }
  5502. }
  5503. , {}],
  5504. 54: [function(e, t, i) {
  5505. "use strict";
  5506. t.exports = {
  5507. PANORAMA: "panorama",
  5508. DOLLHOUSE: "dollhouse",
  5509. FLOORPLAN: "floorplan"
  5510. }
  5511. }
  5512. , {}],
  5513. 55: [function(e, t, i) {
  5514. "use strict";
  5515. function n(e) {
  5516. this.message = e
  5517. }
  5518. t.exports = n
  5519. }
  5520. , {}],
  5521. 56: [function(e, t, i) {
  5522. "use strict";
  5523. function n(e) {
  5524. r.call(this, e)
  5525. }
  5526. var r = e("./BasicException");
  5527. n.prototype = Object.create(r.prototype),
  5528. t.exports = n
  5529. }
  5530. , {
  5531. "./BasicException": 55
  5532. }],
  5533. 57: [function(e, t, i) {
  5534. "use strict";
  5535. function n(e) {
  5536. r.call(this, e)
  5537. }
  5538. var r = e("./BasicException");
  5539. n.prototype = Object.create(r.prototype),
  5540. t.exports = n
  5541. }
  5542. , {
  5543. "./BasicException": 55
  5544. }],
  5545. 58: [function(e, t, i) {
  5546. "use strict";
  5547. function n(e) {
  5548. r.call(this, e)
  5549. }
  5550. var r = e("./BasicException");
  5551. n.prototype = Object.create(r.prototype),
  5552. t.exports = n
  5553. }
  5554. , {
  5555. "./BasicException": 55
  5556. }],
  5557. 59: [function(e, t, i) {
  5558. (function(i) {
  5559. "use strict";
  5560. function n(e) {
  5561. var t = {};
  5562. if (e) {
  5563. var i = e.flags;
  5564. if (i)
  5565. for (var n in i)
  5566. i.hasOwnProperty(n) && (t[i[n]] = !0);
  5567. return t
  5568. }
  5569. return l.debug("Feature flags -> parseFeatureFlags: rawData is null."),
  5570. null
  5571. }
  5572. var r = e("./util/ajax")
  5573. , o = e("./util/showcase")
  5574. , a = e("./util/logger")
  5575. , s = "/api/v1/user/"
  5576. , l = new a(i)
  5577. , c = {};
  5578. t.exports = {
  5579. loadFeatureFlags: function(e) {
  5580. var t = $.Deferred();
  5581. return r.get(e.urlBase + s, {
  5582. responseType: "json",
  5583. prefetchFrom: "user",
  5584. auth: o.getAuthorizationHeader()
  5585. }).done(function(e) {
  5586. c = n(e),
  5587. c ? t.resolve(c) : t.reject("loading-failed")
  5588. }).fail(function() {
  5589. l.debug("Retrieval of feature flags failed."),
  5590. t.reject("loading-failed")
  5591. }),
  5592. t.promise()
  5593. },
  5594. getFlags: function() {
  5595. return c
  5596. },
  5597. updateDependentSettings: function(e, t) {
  5598. e = e || c,
  5599. e.labels && (t.labels.enabled = !0),
  5600. e.zooming && !t.zoom.forceOff && (t.zoom.enabled = !0),
  5601. e.showcase_sdk && (t.sdkInit = !0),
  5602. e.mobile_highq_override && (t.tiling.mobileHighQualityOverride = !0),
  5603. e.showcase_webvr && (t.vr.allowWebVR = !0),
  5604. e.uhql && (t.tiling.allowUltraHighResolution = !0),
  5605. e.hide_sc_sharing && (t.share.enabled = !1)
  5606. }
  5607. }
  5608. }
  5609. ).call(this, "/js/featureflags.js")
  5610. }
  5611. , {
  5612. "./util/ajax": 181,
  5613. "./util/logger": 189,
  5614. "./util/showcase": 193
  5615. }],
  5616. 60: [function(e, t, i) {
  5617. "use strict";
  5618. var n = (e("../util/common"),
  5619. {
  5620. status: 0,
  5621. set: function(e) {
  5622. var t = e
  5623. , i = $("#bar");
  5624. if (isNaN(t))
  5625. return !1;
  5626. var n = i.attr("r")
  5627. , r = Math.PI * (2 * n);
  5628. t = Math.max(Math.min(t, 100), 0);
  5629. var o = (100 - t) / 100 * r;
  5630. o = Math.max(Math.min(o, 295.3), 0),
  5631. i.css({
  5632. strokeDashoffset: o
  5633. }),
  5634. $("#cont").attr("data-pct", t),
  5635. this.status = e
  5636. },
  5637. done: function(e) {
  5638. return e || this.status ? (this.status = null,
  5639. this.set(100)) : this
  5640. }
  5641. });
  5642. t.exports.circleLoader = n
  5643. }
  5644. , {
  5645. "../util/common": 185
  5646. }],
  5647. 61: [function(e, t, i) {
  5648. "use strict";
  5649. t.exports = Object.freeze({
  5650. CLOSE: "modal.closer.close"
  5651. })
  5652. }
  5653. , {}],
  5654. 62: [function(e, t, i) {
  5655. "use strict";
  5656. function n(e, t) {
  5657. t && (t.stopPropagation(),
  5658. t.preventDefault()),
  5659. e && this.emit(l.CLOSE, e),
  5660. g.reset()
  5661. }
  5662. function r(e, t) {
  5663. function i() {
  5664. var t = e.offsetHeight >= $("#player").height() && e.offsetWidth >= $("#player").width();
  5665. t !== f && (f = t,
  5666. t ? (e.classList.add("closeByFooter"),
  5667. h.classList.add("closeByFooter")) : (e.classList.remove("closeByFooter"),
  5668. h.classList.remove("closeByFooter")))
  5669. }
  5670. t ? setTimeout(i, o.guiAnimationSpeed) : i()
  5671. }
  5672. var o = e("../../settings")
  5673. , a = (e("../../tag/Media/MediaEvent"),
  5674. e("../../util/browser"))
  5675. , s = e("../../util/common")
  5676. , l = e("./ModalCloserEvent")
  5677. , c = e("events").EventEmitter
  5678. , h = document.getElementsByClassName("footer")[0]
  5679. , u = h.querySelectorAll(".close")[0]
  5680. , d = null
  5681. , p = null
  5682. , f = null
  5683. , g = (a.isMobile(),
  5684. {
  5685. open: function(e) {
  5686. e && (r(e),
  5687. d && u.removeEventListener("click", d, !0),
  5688. d = n.bind(this, e.id),
  5689. u.addEventListener("click", d, !0),
  5690. p && window.removeEventListener("resize", p, !0),
  5691. p = r.bind(this, e),
  5692. window.addEventListener("resize", p, !0))
  5693. },
  5694. reset: function() {
  5695. h.classList.remove("closeByFooter"),
  5696. u.removeEventListener("click", d, !0),
  5697. window.removeEventListener("resize", p, !0),
  5698. d = p = f = null
  5699. }
  5700. });
  5701. s.extendObject(g, c.prototype),
  5702. t.exports = g
  5703. }
  5704. , {
  5705. "../../tag/Media/MediaEvent": 131,
  5706. "../../settings": 166,
  5707. "../../util/browser": 182,
  5708. "../../util/common": 185,
  5709. "./ModalCloserEvent": 61,
  5710. events: 202
  5711. }],
  5712. 63: [function(e, t, i) {
  5713. "use strict";
  5714. function n(e, t, i) {
  5715. var n = new r.GUI({
  5716. width: 400
  5717. })
  5718. , u = n.addFolder("Flydown from Dollhouse");
  5719. u.add(h.flydown, "movementEasing", Object.keys(a)),
  5720. u.add(h.flydown, "movementDelay", 0, 1).step(.01),
  5721. u.add(h.flydown, "rotationEasing", Object.keys(a)),
  5722. u.add(h.flydown, "rotationDelay", 0, 1).step(.01),
  5723. u.add(h.flydown, "modelTextureDelay", 0, 1).step(.01),
  5724. u.add(h.flydown, "skyboxDelay", 0, 1).step(.01),
  5725. u.add(h.dollhouseDefault, "minPolarAngle", 0, o.Math.degToRad(50)),
  5726. u.add(h.dollhouseDefault, "maxPolarAngle", o.Math.degToRad(50), o.Math.degToRad(170));
  5727. var d = n.addFolder("Transition between panos");
  5728. d.add(h.transition, "blur", 0, 10).onFinishChange(function() {}),
  5729. d.add(h.transition, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  5730. h.transition.flyTime = 0,
  5731. d.__controllers.forEach(function(e) {
  5732. e.updateDisplay()
  5733. })
  5734. }),
  5735. d.add(h.transition, "flyTime", 0, 5e3).onFinishChange(function() {
  5736. h.transition.flySpeed = 0,
  5737. d.__controllers.forEach(function(e) {
  5738. e.updateDisplay()
  5739. })
  5740. }),
  5741. d.add(h.transition, "aimTime", 500, 2500).step(50),
  5742. d.add(h.transition, "aimSlowFactor", 1, 3).step(.1),
  5743. d.add(h.transition, "movementEasing", Object.keys(a));
  5744. var p = n.addFolder("Path Display");
  5745. p.add(h.path, "opacity", 0, 1).step(.01).onFinishChange(function() {}),
  5746. p.add(h.path, "height", 0, .2).step(.01).onFinishChange(function() {}),
  5747. p.add(h.path, "outsideHeight", 0, 2).step(.01).onFinishChange(function() {}),
  5748. p.add(h.path, "ribbonWidth", .01, .35).step(.01).onFinishChange(function() {}),
  5749. p.add(h.path, "waypointRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5750. p.add(h.path, "waypointPulse", 0, 3600).step(20).onFinishChange(function() {}),
  5751. p.add(h.path, "waypointIndoorRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5752. p.add(h.path, "fadeInTime", 0, 1200).step(10).onFinishChange(function() {}),
  5753. p.add(h.path, "fadeOutTime", 0, 1200).step(10).onFinishChange(function() {}),
  5754. p.add(h.path, "color", Object.keys(l)).onFinishChange(function() {
  5755. h.path.color = l[h.path.color],
  5756. h.path.colorUp = l._desat(h.path.color),
  5757. h.path.colorDown = l.darken(h.path.color)
  5758. }),
  5759. p.add(h, "reticuleColor", Object.keys(l)).onFinishChange(function() {
  5760. h.reticuleColor = l[h.reticuleColor]
  5761. });
  5762. var f = n.addFolder("Warping")
  5763. , g = f.addFolder("Warp/Teleport");
  5764. g.add(h.warp, "softPushDist", 0, 2).onFinishChange(function() {}),
  5765. g.add(h.warp, "softPushEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5766. g.add(h.warp, "softBendAngle", 0, 45).onFinishChange(function() {}),
  5767. g.add(h.warp, "softBendTilt", 0, 45).onFinishChange(function() {}),
  5768. g.add(h.warp, "softBendEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5769. g.add(h.warp, "burnsAngle", 0, 30).onFinishChange(function() {}),
  5770. g.add(h.warp, "minBurnsAngle", 0, 10).onFinishChange(function() {}),
  5771. g.add(h.warp, "brakeStrength", 1, 8).onFinishChange(function() {}),
  5772. g.add(h.warp, "minBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  5773. g.add(h.warp, "maxBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  5774. g.add(h.path, "mapGuides").onFinishChange(function() {}),
  5775. g.add(h.warp, "teleportTime", 0, 5e3).step(10).onFinishChange(function() {}),
  5776. g.add(h.warp, "outsideTime", 0, 5e3).step(10).onFinishChange(function() {}),
  5777. g.add(h.path, "typ", Object.keys(c)).onFinishChange(function() {
  5778. h.path.typ = c[h.path.typ]
  5779. }),
  5780. g.add(h.warp, "loop").onChange(function() {}).onFinishChange(function() {
  5781. t.endlessLoop = h.warp.loop
  5782. }),
  5783. g.add(h.warp, "walkSlideShowThreshhold", 1, 1e4).step(1).onFinishChange(function() {}),
  5784. g.add(h.warp, "walkExtraPanosDistance", 0, 3).step(.1).onFinishChange(function() {}),
  5785. g.add(h.transition, "fastForwardFactor", 1, 10).step(1).onFinishChange(function() {});
  5786. var m = f.addFolder("Long Warp Only");
  5787. m.add(h.warp, "minWarpTime", 0, 5e3).step(10).onFinishChange(function() {
  5788. h.warp.flySpeed = 0,
  5789. m.__controllers.forEach(function(e) {
  5790. e.updateDisplay()
  5791. })
  5792. }),
  5793. m.add(h.warp, "timePerMeter", 0, 5e3).step(10).onFinishChange(function() {}),
  5794. m.add(h.warp, "lookAheadMax", .01, 1).step(.01).onFinishChange(function() {}),
  5795. m.add(h.warp, "lookAheadDist", .01, 4).step(.01).onFinishChange(function() {}),
  5796. m.add(h.warp, "maxTurnPerSec", 0, 720).step(1).onFinishChange(function() {}),
  5797. m.add(h.warp, "maxAimPerSec", 0, 720).step(1).onFinishChange(function() {}),
  5798. m.add(h.warp, "turnFriction", 0, 1).step(.01).onFinishChange(function() {}),
  5799. m.add(h.warp, "walkDelay", 0, 2e3).step(10).onFinishChange(function() {}),
  5800. m.add(h.transition, "flytimeMaxDistanceThreshold", 0, 25).step(10).onFinishChange(function() {}),
  5801. m.add(h.warp, "walkMaxDist", 0, 100).step(1).onFinishChange(function() {});
  5802. var v = n.addFolder("Warp Esoterica");
  5803. v.add(h.warp, "nearPanoDist", .01, 12).step(0).onFinishChange(function() {}),
  5804. v.add(h.warp, "blur", .01, 1).onFinishChange(function() {}),
  5805. v.add(h.warp, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  5806. h.warp.minWarpTime = 0,
  5807. v.__controllers.forEach(function(e) {
  5808. e.updateDisplay()
  5809. })
  5810. }),
  5811. v.add(h.warp, "showBunny").onFinishChange(function() {}),
  5812. v.add(h.warp, "fastTime", 0, 2500).step(10).onFinishChange(function() {}),
  5813. v.add(h.warp, "movementEasing", Object.keys(a));
  5814. var A = n.addFolder("Misc");
  5815. A.add(h, "dollhouseFOV", 10, 180).onChange(function() {
  5816. i.cameras[s.DOLLHOUSE].fov = h.dollhouseFOV
  5817. }),
  5818. A.add(h, "insideFOV", 10, 180).onChange(function() {
  5819. i.cameras[s.PANORAMA].fov = h.insideFOV
  5820. }),
  5821. A.add(h, "insideLookSpeed", .01, .3).step(.01).onChange(function() {}),
  5822. A.add(h, "rotationAccelerationInside", .1, 10).step(.1).onChange(function() {}),
  5823. A.add(h, "rotationAccelerationOutside", .1, 10).step(.1).onChange(function() {});
  5824. var y = n.addFolder("Navigation");
  5825. y.add(h.navigation, "panoScores").onFinishChange(function() {
  5826. h.navigation.panoScores || e.panos.forEach(function(e) {
  5827. e.floor.remove(e.text3d),
  5828. e.text3d = null
  5829. })
  5830. }),
  5831. y.add(h.navigation, "mouseDirection"),
  5832. y.add(h.navigation, "filterStrictness", 0, 1),
  5833. y.add(h.navigation, "angleFactor", -60, 0),
  5834. y.add(h.navigation, "directionFactor", 1, 20),
  5835. y.add(h.navigation, "distanceFactor", -5, 5),
  5836. y.add(h.navigation, "optionalityFactor", .1, 10);
  5837. var C = n.addFolder("tags")
  5838. , I = C.addFolder("Tag Creation");
  5839. I.add(h.tags.pole, "enabled").name("poleEnabled"),
  5840. I.add(h.tags.pole, "height", 0, 2.5).step(.01).name("poleHeight"),
  5841. I.add(h.tags.pole, "width", 1, 10).step(1).name("poleWidth"),
  5842. I.add(h.tags.pole, "opacity", .1, 1).step(.1).name("poleOpacity");
  5843. var E = C.addFolder("Visibility");
  5844. E.add(h.tags.visibility, "anyDistance"),
  5845. E.add(h.tags.visibility, "visibleDistance", .1, 30).step(.1),
  5846. E.add(h.tags.visibility, "cameraClearance", 0, 1).step(.01),
  5847. E.add(h.tags.visibility, "hideViaFloor"),
  5848. E.add(h.tags.visibility, "hideOffScreenDisc").name("hideEdgeDisc"),
  5849. E.add(h.tags.visibility, "hideOffScreenObject").name("hideEdgeObject");
  5850. var b = C.addFolder("Disc Parameters");
  5851. b.add(h.tags.disc.scale, "nearBound", .1, 10).step(.1),
  5852. b.add(h.tags.disc.scale, "farBound", .1, 20).step(.1).listen(),
  5853. b.add(h.tags.disc.scale, "linkFarBound").onChange(function(e) {
  5854. e && (h.tags.disc.scale.farBound = h.tags.visibility.visibleDistance * (1 - h.tags.disc.scale.linkPercent / 100))
  5855. }),
  5856. b.add(h.tags.disc.scale, "linkPercent", 0, 100).step(1).onChange(function(e) {
  5857. h.tags.disc.scale.linkFarBound && (h.tags.disc.scale.farBound = h.tags.visibility.visibleDistance * (1 - e / 100))
  5858. }),
  5859. b.add(h.tags.disc.scale, "maxSize", 40, 200).step(1),
  5860. b.add(h.tags.disc.scale, "minSize", 20, 100).step(1),
  5861. b.add(h.tags.disc.scale, "responsiveness", 0, 100).step(1);
  5862. var w = C.addFolder("Navigate");
  5863. w.add(h.tags.navigate, "nearestPano").name("nearestPano"),
  5864. w.add(h.tags.navigate, "lineOfSight").name("lineOfSight"),
  5865. w.add(h.tags.navigate, "reactivate").name("reactivate"),
  5866. w.add(h.tags.navigate, "aimAt", ["disc", "object", "pole", "nothing"]).name("aim at"),
  5867. w.add(h.tags.navigate, "tiltTolerance", 0, 50).step(1),
  5868. w.add(h.tags.navigate, "rotateSpeedFactor", 0, 5).step(.1);
  5869. var _ = n.addFolder("Debug");
  5870. _.add(h, "wireframe").onFinishChange(function() {
  5871. e.chunks.forEach(function(t) {
  5872. t.material && (t.wireframeTwin || (t.wireframeTwin = new o.WireframeHelper(t),
  5873. t.wireframeTwin.material.depthWrite = !1,
  5874. t.wireframeTwin.material.depthTest = !1,
  5875. t.wireframeTwin.material.opacity = .5,
  5876. t.wireframeTwin.material.transparent = !0),
  5877. h.wireframe ? e.add(t.wireframeTwin) : e.remove(t.wireframeTwin))
  5878. })
  5879. }),
  5880. _.add(h, "skyboxWireframe").onFinishChange(function() {
  5881. h.skyboxWireframe ? (e.skybox.wireframe = new o.WireframeHelper(e.skybox),
  5882. e.add(e.skybox.wireframe)) : (e.remove(e.skybox.wireframe),
  5883. e.skybox.wireframe = null)
  5884. }),
  5885. _.add(h, "showSweeps").onFinishChange(function() {
  5886. e.setSweepVisibility(h.showSweeps)
  5887. }),
  5888. _.add(h, "showMesh").onFinishChange(function() {
  5889. e.chunks.forEach(function(e) {
  5890. e.visible = h.showMesh
  5891. })
  5892. }),
  5893. _.add(h, "showFloors").onFinishChange(function() {
  5894. e.floors.forEach(function(e) {
  5895. e.collider.children.forEach(function(e) {
  5896. e.material.visible = h.showFloors
  5897. })
  5898. })
  5899. }),
  5900. _.add(h, "showSkyboxes").onFinishChange(function() {
  5901. e.panos.forEach(function(e) {
  5902. e.skyboxMesh.visible = h.showSkyboxes
  5903. })
  5904. }),
  5905. _.add(h, "showNeighbors").onChange(function() {}),
  5906. _.add(e, "alpha", 0, 1)
  5907. }
  5908. var r = e("../lib/dat.gui")
  5909. , o = e("three")
  5910. , a = e("../util/easing")
  5911. , s = e("../enum/Viewmode")
  5912. , l = e("../enum/Colors")
  5913. , c = e("../enum/WarpStyle")
  5914. , h = e("../settings");
  5915. e("../tag/tag");
  5916. r.GUI.prototype.removeFolder = function(e) {
  5917. var t = this.__folders[e];
  5918. t && (t.close(),
  5919. this.__ul.removeChild(t.domElement.parentNode),
  5920. delete this.__folders[e],
  5921. this.onResize())
  5922. }
  5923. ,
  5924. t.exports.toggle = n
  5925. }
  5926. , {
  5927. "../enum/Colors": 19,
  5928. "../enum/Viewmode": 51,
  5929. "../enum/WarpStyle": 52,
  5930. "../lib/dat.gui": 93,
  5931. "../tag/tag": 123,
  5932. "../settings": 166,
  5933. "../util/easing": 186,
  5934. three: 217
  5935. }],
  5936. 64: [function(e, t, i) {
  5937. (function(i) {
  5938. "use strict";
  5939. function n(e, t, i, n) {
  5940. $(".gui-error .error-problem-text").text(e),
  5941. $(".gui-error .error-solution-text").text(t),
  5942. $(".gui-error .error-explanation").text(i),
  5943. $(".gui-error .error-actions").html(n),
  5944. $(window).resize(),
  5945. $(".gui-error").fadeIn(),
  5946. $("#bottom-logo").fadeIn()
  5947. }
  5948. function r(e) {
  5949. 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("");
  5950. n(e, h.ERROR_BROWSER_SOLUTION, h.ERROR_BROWSER_EXPLANATION, t),
  5951. s.isMobile() || $("[rel=tiletip]").tooltip({
  5952. placement: "bottom",
  5953. delay: {
  5954. show: 50,
  5955. hide: 0
  5956. },
  5957. trigger: "hover",
  5958. viewport: {
  5959. selector: "body",
  5960. padding: 10
  5961. }
  5962. })
  5963. }
  5964. function o() {
  5965. var e = s.isMobile() ? "" : '<span class="link install-browser">' + h.ERROR_GENERIC_ACTIONS_2 + "</span>" + h.ERROR_GENERIC_ACTIONS_3
  5966. , t = [h.ERROR_GENERIC_ACTIONS_1, e, '<a class="link" target="_blank" href=', p, ">" + h.ERROR_GENERIC_ACTIONS_4 + "</a>."].join("");
  5967. n(h.ERROR_GENERIC_PROBLEM, h.ERROR_GENERIC_SOLUTION, "", t),
  5968. s.isMobile() || $(".install-browser").on("click touchstart", function(e) {
  5969. e.preventDefault(),
  5970. e.stopPropagation(),
  5971. r(" ")
  5972. })
  5973. }
  5974. function a(e) {
  5975. if ($("head title").text(c.pageTitle),
  5976. $("#gui-message, #gui-loading, #nprogress, #gui-thumb, #bottom-logo").hide(),
  5977. $("#gui-loading").fadeOut(250),
  5978. $("#quick-blackout").hide(),
  5979. l.track("showcase_error", {
  5980. error_key: e
  5981. }),
  5982. h.locale || h.init(),
  5983. "webgl-unsupported" === e)
  5984. s.isMobile() ? o() : r(h.ERROR_WEBGL_UNSUPPORTED_PROBLEM);
  5985. else if ("webgl-ios" === e)
  5986. n(h.ERROR_WEBGL_IOS_PROBLEM, h.ERROR_WEBGL_IOS_SOLUTION, "", h.ERROR_WEBGL_IOS_ACTIONS_1 + "<strong>" + h.ERROR_WEBGL_IOS_ACTIONS_2 + "</strong>.");
  5987. else if ("webgl-safari" === e)
  5988. n(h.ERROR_WEBGL_SAFARI_PROBLEM, "", "", h.ERROR_WEBGL_SAFARI_ACTIONS_1 + "<strong>" + h.ERROR_WEBGL_SAFARI_ACTIONS_2 + "</strong>. " + h.ERROR_WEBGL_SAFARI_ACTIONS_3 + "<strong>" + h.ERROR_WEBGL_SAFARI_ACTIONS_4 + "</strong>.");
  5989. else if ("webgl-generic" === e)
  5990. o();
  5991. else if ("missing-urls" === e)
  5992. n(h.ERROR_MISSING_URLS_PROBLEM, "", h.ERROR_MISSING_URLS_EXPLANATION);
  5993. else if ("loading-failed" === e)
  5994. n(h.ERROR_LOADING_FAILED_PROBLEM, "", "", h.ERROR_LOADING_FAILED_ACTIONS_1 + '<a class="link" target="_blank" href=' + p + ">" + h.ERROR_LOADING_FAILED_ACTIONS_2 + "</a>.");
  5995. else {
  5996. if ("loading-failed-maintenance" !== e)
  5997. return void d.error("Unhandled error: " + e);
  5998. n(h.ERROR_MAINTENANCE_PROBLEM, h.ERROR_MAINTENANCE_SOLUTION)
  5999. }
  6000. }
  6001. var s = e("./../util/browser")
  6002. , l = e("./../analytics")
  6003. , c = e("./../settings")
  6004. , h = e("../localization/localize")
  6005. , u = e("./../util/logger")
  6006. , d = new u(i)
  6007. , p = '"https://support.port.com/hc/articles/208220058"';
  6008. t.exports.error = a
  6009. }
  6010. ).call(this, "/js/gui/error.js")
  6011. }
  6012. , {
  6013. "../localization/localize": 108,
  6014. "./../analytics": 4,
  6015. "./../settings": 166,
  6016. "./../util/browser": 182,
  6017. "./../util/logger": 189
  6018. }],
  6019. 65: [function(e, t, i) {
  6020. (function(i) {
  6021. "use strict";
  6022. function n() {
  6023. Ue = [],
  6024. je.floors.visible && Ue.push(".gui-floor", ".gui-floor-title"),
  6025. Ue.push(".hideTarget", ".pinTop.right")
  6026. }
  6027. function r() {
  6028. for (var e in je)
  6029. if (je.hasOwnProperty(e)) {
  6030. var t = je[e];
  6031. if (!t.visible)
  6032. for (var i = 0; i < t.elements.length; i++)
  6033. $(t.elements[i]).hide()
  6034. }
  6035. je.highlight.visible && $(".pinBottom").addClass("highlightExists"),
  6036. je.tourControls.visible === !1 && $("#drawer").addClass("fullWidth"),
  6037. n()
  6038. }
  6039. function o(e, t) {
  6040. var i = !K.isMobile() && Q.zoom.enabled && t.mode === _e.PANORAMA && !e.tourIsPlaying;
  6041. $("#gui-zoomin").toggle(i),
  6042. $("#gui-zoomout").toggle(i)
  6043. }
  6044. function a() {
  6045. c(),
  6046. $(".pinBottom").toggleClass("open"),
  6047. $("#drawer").toggleClass("open"),
  6048. $(".footer").toggleClass("open"),
  6049. $("#drawer").hasClass("open") ? ($("#pullTab .icon").attr("data-original-title", Re.CLOSE_HIGHLIGHTS),
  6050. Ze("highlights")) : ($("#pullTab .icon").attr("data-original-title", Re.OPEN_HIGHLIGHTS),
  6051. ie.resetDrawer()),
  6052. setTimeout(function() {
  6053. $("#pullTab").toggleClass("opened")
  6054. }, $("#drawer").hasClass("open") ? 0 : Q.highlightAnimationDuration),
  6055. $(".pinBottom").hasClass("open") && s($(".vr-popup")) && $(".vr-popup").is(":visible") && Ae.dismiss()
  6056. }
  6057. function s(e) {
  6058. var t;
  6059. "none" !== e.css("display") ? t = e.position().top + e.outerHeight() : (e.attr("style", "visibility: hidden"),
  6060. t = e.position().top + e.outerHeight(),
  6061. e.attr("style", "display: none"));
  6062. var i = $("#player").outerHeight()
  6063. , n = i - 130;
  6064. return n < t + 25
  6065. }
  6066. function l(e) {
  6067. "touchstart" === e.type && e.preventDefault(),
  6068. e.stopPropagation()
  6069. }
  6070. function c() {
  6071. W && (W.reload(),
  6072. W.init())
  6073. }
  6074. function h(e) {
  6075. ne.show(e),
  6076. r()
  6077. }
  6078. function u(e) {
  6079. ne.progress(e)
  6080. }
  6081. function d(e, t, i) {
  6082. var n = t.player;
  6083. $("#gui-thumb").fadeOut(2500),
  6084. ne.hide(function() {
  6085. Ge = !1
  6086. }),
  6087. me.init(e, i),
  6088. de.finishSetup(Object.keys(e.tags).length),
  6089. i.on(Te.IMAGE_OPENED, Ze.bind(this, "tag"));
  6090. var s = function() {
  6091. i.dismissExaminedTag(),
  6092. i.disableHovering()
  6093. };
  6094. Ae.on(ye.OPENED, s),
  6095. Ce.on(Me.OPENED, s),
  6096. he.on(ue.OPENED, s),
  6097. fe.on(ge.OPENED, s);
  6098. var l = i.enableHovering.bind(i);
  6099. if (Ae.on(ye.CLOSED, l),
  6100. Ce.on(Me.CLOSED, l),
  6101. he.on(ue.CLOSED, l),
  6102. fe.on(ge.CLOSED, l),
  6103. Q.labels.enabled && Object.keys(e.labels).length,
  6104. e.floors.length <= 1 || !je.floors.visible ? je.floors.visible = !1 : (y(e, t),
  6105. C(e.currentFloor, n.mode)),
  6106. r(),
  6107. o(t, t.player),
  6108. $("#gui").fadeIn(1500),
  6109. je.highlight.visible && (2 !== Q.startHighlights || e.has360Views) && setTimeout(function() {
  6110. a(),
  6111. (!e.has360Views && 1 !== Q.startHighlights || e.has360Views && 0 === Q.startHighlights) && setTimeout(a, 2e3)
  6112. }, 2e3),
  6113. !K.isMobile())
  6114. for (var c = ["a", "#title-toggle", ".next-button", ".prev-button", ".gui-floor", ".meta-toggle", ".thumbImg", "logo-button"], h = 0; h < c.length; h++)
  6115. $(c[h]).addClass("hasHover");
  6116. O(e),
  6117. de.setupToggling();
  6118. //xzw:
  6119. editHotPanel();
  6120. }
  6121. function editHotPanel(){//如果是编辑状态
  6122. if(window.location.href.substring(window.location.href.indexOf("&")+1).indexOf('add')==-1) return;
  6123. $('#addHot').css("display","block");
  6124. $('#addHot>div').children()[0].addEventListener("click",function(){//add hot
  6125. g_HotStatus = "add";
  6126. $("#player").css("cursor","cell");
  6127. })
  6128. $('#addHot>div').children()[1].addEventListener("click",function(){//output
  6129. var str = ""
  6130. for(var i=0; i<g_newHot.length; i++){
  6131. str+=( '"'+g_newHot[i].sid + '":{ "position":['+g_newHot[i].position+'], "rotation":['+g_newHot[i].rotation+']},\r');
  6132. }
  6133. if(str=="")logData("没有添加新热点")
  6134. else logData(str)
  6135. })
  6136. $('#addHot>div').children()[2].addEventListener("click",function(){//snapShot
  6137. var ev=document.createEvent("MouseEvent");//"MouseEvent"
  6138. ev.initMouseEvent("snapshotBegin",true,true,document.defaultView,0,0,0,0,0,false,false,false,false,0,null);
  6139. window.dispatchEvent(ev);
  6140. })
  6141. $('#addHot textarea').on("mousewheel",function(e){
  6142. e.stopPropagation();
  6143. })
  6144. window.logData = function(v){
  6145. $('#addHot textarea')[0].value += (v+"\r");
  6146. $('#addHot textarea')[0].scrollTop = $('#addHot textarea')[0].scrollHeight;
  6147. }
  6148. }
  6149. function p(e) {
  6150. e || (e = 0),
  6151. We = !1,
  6152. window.setTimeout(function() {
  6153. We || (ze = !0,
  6154. $("#gui-spinner").stop(!0, !0).show())
  6155. }
  6156. .bind(this), e)
  6157. }
  6158. function f() {
  6159. $("#gui-spinner").stop(!0, !0),
  6160. $("#gui-spinner").fadeOut(1e3),
  6161. We = !0,
  6162. ze = !1
  6163. }
  6164. function g(e, t) {
  6165. var i = e.mode
  6166. , n = t || e.currentPano;
  6167. $("#gui-modes-dollhouse").toggleClass("active", i === _e.DOLLHOUSE),
  6168. $("#gui-modes-floorplan").toggleClass("active", i === _e.FLOORPLAN),
  6169. i === _e.PANORAMA ? ($("#view-controllers").slideUp(500),
  6170. Q.show360Views.enabled && !n.isAligned() ? ($("#gui-modes-inside").removeClass("hidden"),
  6171. $(".gui-floor").addClass("hidden"),
  6172. $("#gui-modes-outside").addClass("desktop-only")) : ($("#gui-modes-inside").addClass("hidden"),
  6173. $(".gui-floor").removeClass("hidden"),
  6174. $("#gui-modes-outside").removeClass("desktop-only")),
  6175. $("#gui-modes-outside").removeClass("hidden")) : i !== _e.TRANSITIONING && (f(),
  6176. Be = i,
  6177. $("#gui-modes-outside").addClass("hidden"),
  6178. $("#gui-modes-inside").removeClass("hidden"),
  6179. e.model.has360Views && $(".gui-floor").removeClass("hidden"),
  6180. $("#view-controllers").is(":visible") || $("#view-controllers").slideDown(Q.guiAnimationSpeed))
  6181. }
  6182. function m(e, t) {
  6183. var i = t.player;
  6184. $("#gui-modes-inside").find("a").on("click", function(e) {
  6185. l(e),
  6186. J.updateInteraction(Se.InteractionGui, "inside-button"),
  6187. J.track("showcase_gui", {
  6188. gui_action: "click_inside_mode_button"
  6189. }),
  6190. t.changeMode(_e.PANORAMA)
  6191. }),
  6192. $("#gui-modes-outside").find("a").on("click", function(e) {
  6193. l(e),
  6194. J.track("showcase_gui", {
  6195. gui_action: "click_outside_mode_button"
  6196. }),
  6197. t.changeMode(Be)
  6198. }),
  6199. $("#gui-modes-floorplan").on("click", function(e) {
  6200. l(e),
  6201. i.mode !== _e.FLOORPLAN && (J.track("showcase_gui", {
  6202. gui_action: "click_floorplan_mode_button"
  6203. }),
  6204. t.changeMode(_e.FLOORPLAN))
  6205. }),
  6206. $("#gui-modes-dollhouse").on("click", function(e) {
  6207. l(e),
  6208. i.mode !== _e.DOLLHOUSE && (J.track("showcase_gui", {
  6209. gui_action: "click_dollhouse_mode_button"
  6210. }),
  6211. t.changeMode(_e.DOLLHOUSE))
  6212. })
  6213. }
  6214. function v(e, t) {
  6215. function i() {
  6216. document.getElementById("vr").classList.remove("hidden"),
  6217. Q.vr.allowWebVR ? K.getVRDisplay().then(function(e) {
  6218. K.supportsFullscreen() ? n(e) : (De.warn("Unable to use WebVR when full screen is not supported"),
  6219. $(".improper-embed").toggleClass("hidden", !1),
  6220. r())
  6221. }, function(e) {
  6222. r()
  6223. }) : r()
  6224. }
  6225. function n(i) {
  6226. De.info(i.displayName + " detected, VR button activates WebVR experience"),
  6227. Ie.init(e.data, t, i, q),
  6228. Ie.on(Ee.OPENED, Ze.bind(gui, "vr")),
  6229. Ie.on(Ee.SHOW_TERMS, fe.show.bind(fe))
  6230. }
  6231. function r() {
  6232. De.info("WebVR support not found, VR button activates native app VR modal"),
  6233. Ae.init(e.data, q),
  6234. Ae.on(ye.OPENED, function() {
  6235. var e = document.getElementById("vr-modal");
  6236. return function() {
  6237. Ze("vr"),
  6238. le.open(e)
  6239. }
  6240. }()),
  6241. Ae.on(ye.CLOSED, le.reset)
  6242. }
  6243. if (Q.vr.enabled && e.supportsVR && !K.valueFromHash("mls", 0))
  6244. switch (Q.vr.option) {
  6245. case Pe.CONTEXTUAL:
  6246. i();
  6247. break;
  6248. case Pe.ANDROID:
  6249. K.detectAndroid() && i();
  6250. break;
  6251. case Pe.NONE:
  6252. }
  6253. }
  6254. function A(e, t) {
  6255. $("#play").find("a").on("mousedown touchstart", function(e) {
  6256. l(e);
  6257. Ze("tour");
  6258. ve.play();
  6259. J.trackAlways("showcase_gui", {
  6260. gui_action: "play_highlights"
  6261. })
  6262. }),
  6263. $("#pause").find("a").on("mousedown touchstart", function(e) {
  6264. l(e),
  6265. ve.pause(),
  6266. J.trackAlways("showcase_gui", {
  6267. gui_action: "pause_highlights"
  6268. })
  6269. }),
  6270. $("#gui-zoomin").find("a").on("click", function(e) {
  6271. l(e),
  6272. t.player.zoomInIncrementally()
  6273. }),
  6274. $("#gui-zoomout").find("a").on("click", function(e) {
  6275. l(e),
  6276. t.player.zoomOutIncrementally()
  6277. })
  6278. }
  6279. function y(e, t) {
  6280. for (var i = $(".gui-floor"), n = 0; n < e.floors.length; n++) {
  6281. var r = $('<div class="floorChoice" data-index="' + n + '"></div>').text(e.floors.get(n).name);
  6282. $(".gui-floor").find(".container").prepend(r)
  6283. }
  6284. i.find(".container").prepend('<div class="floorChoice darkGlass allFloorBtn" data-index="all" style="display:none">' + Re.FLOOR_ALL + "</div>"),
  6285. i.on("click", function(e) {
  6286. l(e),
  6287. Ze("floor"),
  6288. i.toggleClass("open")
  6289. }),
  6290. $(".floorChoice").on("click", function(e) {
  6291. l(e);
  6292. var n = $(this).data("index");
  6293. "all" !== n ? (J.updateInteraction(Se.InteractionGui, "floor-control"),
  6294. t.player.gotoFloor(n),
  6295. J.track("showcase_gui", {
  6296. gui_action: "click_floor_select_button",
  6297. interaction_source: "gui"
  6298. })) : (J.updateInteraction(Se.InteractionGui, "floor-control"),
  6299. Ze("move"),
  6300. t.allFloors(),
  6301. J.track("showcase_gui", {
  6302. gui_action: "click_toggle_all_floors_button",
  6303. interaction_source: "gui"
  6304. })),
  6305. i.removeClass("open")
  6306. })
  6307. }
  6308. function C(e, t) {
  6309. e && (t === _e.DOLLHOUSE || t === _e.FLOORPLAN ? $(".allFloorBtn").show() : $(".allFloorBtn").hide(),
  6310. e.model.allFloorsVisible ? ($(".gui-floor-title").text(Re.FLOOR_ALL),
  6311. $(".gui-floor-number").text(Re.FLOOR_ALL),
  6312. $(".floorChoice").removeClass("active"),
  6313. $('.floorChoice[data-index="all"]').addClass("active")) : ($(".gui-floor-title").text(e.name),
  6314. $(".gui-floor-number").text(" " + (e.floorIndex + 1)),
  6315. $(".floorChoice").removeClass("active"),
  6316. $(".floorChoice[data-index=" + e.floorIndex + "]").addClass("active")))
  6317. }
  6318. function I(e) {
  6319. return e.describe().inTransition
  6320. }
  6321. function E(e) {
  6322. $("<img/>").attr("src", e).on("load", function() {
  6323. $("#gui-thumb").css("backgroundImage", "url(" + e + ")").fadeIn(500),
  6324. $(this).remove()
  6325. })
  6326. }
  6327. function b(e, t, i) {
  6328. Fe = e.heroLocations.length;
  6329. var n = '<li class="thumbImg" data-index=""><img src=""></li>'
  6330. , r = 100 / Fe + "%"
  6331. , o = $("#thumb-container")
  6332. , a = $("#progressBar");
  6333. $("#status").find(".totalSteps").text(Fe);
  6334. for (var s = 0; s < Fe; s++) {
  6335. var c = e.heroLocations[s]
  6336. , h = $(n);
  6337. if (h.attr("data-index", s),
  6338. je.highlight.visible && h.find("img").attr("src", c.thumbUrl),
  6339. c.name) {
  6340. var u = $('<div class="overlay"></div>').text(c.name);
  6341. h.prepend(u)
  6342. }
  6343. if (e.has360Views && c.cameraMode === _e.PANORAMA) {
  6344. var d = e.panos.get(c.panoId)
  6345. , p = d && !d.isAligned()
  6346. , f = p ? '<div><img class="mark360View" src="images/mark-360-white-v2.png"></div>' : '<div><img class="markInsideView" src="images/mark-inside-white.png"></div>';
  6347. h.prepend(f)
  6348. }
  6349. o.append(h),
  6350. a.append('<div class="step" data-idx="' + s + '" style="width:' + r + '"></div>')
  6351. }
  6352. j = 144 * Fe,
  6353. Y = 111 * Fe,
  6354. $(".thumbImg").on("mouseover", function() {
  6355. I(t) || i.showPathToHeroLocation($(this).data("index"))
  6356. }),
  6357. $(".thumbImg").on("mouseout", function() {
  6358. t.clearPath()
  6359. }),
  6360. $(".thumbImg").on("click", function(e) {
  6361. l(e);
  6362. var i = $(this);
  6363. J.updateInteraction(Se.InteractionGui, "thumbnail"),
  6364. J.trackAlways("showcase_gui", {
  6365. gui_action: "click_highlight"
  6366. }),
  6367. t.goToHighlight(i.data("index"))
  6368. }),
  6369. $(".previous").find("a").on("click", function(e) {
  6370. l(e),
  6371. J.trackAlways("showcase_gui", {
  6372. gui_action: "prev_highlight"
  6373. }),
  6374. t.prevHighlight()
  6375. }),
  6376. $(".next").find("a").on("click", function(e) {
  6377. l(e),
  6378. J.trackAlways("showcase_gui", {
  6379. gui_action: "next_highlight"
  6380. }),
  6381. t.nextHighlight()
  6382. }),
  6383. $("#drawer").on("mouseleave", function(e) {
  6384. l(e);
  6385. var t;
  6386. try {
  6387. t = new MouseEvent("mouseup",{
  6388. clientX: e.clientX,
  6389. clientY: e.clientY,
  6390. screenX: e.screenX,
  6391. screenY: e.screenY
  6392. })
  6393. } catch (i) {
  6394. t = document.createEvent("MouseEvents"),
  6395. t.initMouseEvent("mouseup", 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)
  6396. }
  6397. document.dispatchEvent(t)
  6398. }),
  6399. W = new Sly($("#scrollFrame"),{
  6400. horizontal: !0,
  6401. itemNav: "centered",
  6402. smart: !0,
  6403. scrollTrap: !0,
  6404. scrollBy: 1,
  6405. mouseDragging: !0,
  6406. touchDragging: !0,
  6407. speed: 300,
  6408. dragHandle: !0,
  6409. dynamicHandle: !0,
  6410. clickBar: !0,
  6411. scrollBar: $("#scroller"),
  6412. activateOn: null
  6413. }).init(),
  6414. W.on("active", function(e, t) {
  6415. Ve = t,
  6416. Ze("tour"),
  6417. $(".step").removeClass("active"),
  6418. $("#status").find(".curIdx").text(t + 1);
  6419. for (var i = 0; i <= t; i++)
  6420. $("#progressBar").find("[data-idx='" + i + "']").addClass("active")
  6421. }),
  6422. w()
  6423. }
  6424. function w() {
  6425. var e = $("#player").width() - 20
  6426. , t = $("#scroller")
  6427. , i = $("#drawer")
  6428. , n = $(".pinBottom");
  6429. if ($("#player").width() < 488 || $("#player").height() < 488)
  6430. t.addClass("hidden"),
  6431. i.addClass("noScroll"),
  6432. n.addClass("noScroll");
  6433. else {
  6434. var r = j > e
  6435. , o = !i.hasClass("noScroll")
  6436. , a = r !== o;
  6437. a && (t.toggleClass("hidden"),
  6438. i.toggleClass("noScroll"),
  6439. n.toggleClass("noScroll"))
  6440. }
  6441. }
  6442. function _(e) {
  6443. je.tourControls.visible = e.tour_buttons && K.valueFromHash("gt", 1),
  6444. je.coBrand.visible = e.presented_by && 1 !== Q.specialEdition && Q.brand && !K.valueFromHash("mls", !1),
  6445. je.highlight.visible = e.highlight_reel && 1 !== Q.specialEdition && Q.showHighlights
  6446. }
  6447. function T(e) {
  6448. function t(t, i) {
  6449. return !!e.player_options[t] && e[i || t]
  6450. }
  6451. $(".model-title").text(e.name);
  6452. var i = Q.pageTitle;
  6453. 2 !== K.valueFromHash("mls", 0) && (i = e.name + " - " + i),
  6454. document.title = i,
  6455. K.isMobile() ? $("#gui-fullscreen").toggleClass("hidden") : ($("[rel=tooltip]").tooltip({
  6456. delay: {
  6457. show: 50,
  6458. hide: 0
  6459. },
  6460. trigger: "hover",
  6461. html: !1,
  6462. viewport: {
  6463. selector: "body",
  6464. padding: 10
  6465. }
  6466. }),
  6467. K.inIframe() && document.getElementsByClassName("pinBottom-container")[0].classList.add("embed")),
  6468. t("presented_by") && 1 !== Q.specialEdition && Q.brand && !K.valueFromHash("mls", 0) ? document.getElementById("loaderCoBrandName").innerText = t("presented_by") : document.getElementById("loaderCoBrand").classList.add("hidden"),
  6469. de.populate({
  6470. name: t("model_name", "name"),
  6471. coBrand: t("presented_by"),
  6472. description: t("model_summary", "summary"),
  6473. contactName: t("contact_name"),
  6474. address: t("address"),
  6475. phone: t("contact_phone"),
  6476. formattedPhone: e.formatted_contact_phone,
  6477. email: t("contact_email"),
  6478. url: t("external_url"),
  6479. socialSharing: e.enable_social_sharing && e.is_public
  6480. })
  6481. }
  6482. function x(e, t, i, n, r, o) {
  6483. function a() {
  6484. o.setLoadingStartTime(),
  6485. H(),
  6486. r ? (re.showMessage(t, i, je.coBrand.visible),
  6487. l()) : h(l)
  6488. }
  6489. var s = $.Deferred()
  6490. , l = s.resolve.bind(s);
  6491. return Ge = !0,
  6492. O(e),
  6493. e.data.player_options && _(e.data.player_options),
  6494. 1 === Q.specialEdition && $("body").addClass("specialEdition"),
  6495. Re.localizeGUI(),
  6496. T(e.data),
  6497. r || $(".quick").addClass("hidden"),
  6498. e.data.image && !r && E(e.data.image),
  6499. n ? (J.impression(),
  6500. a()) : (o.setWaitingStartTime(),
  6501. oe.show(r, a)),
  6502. s
  6503. }
  6504. function S(e, t, i, n, r, a, s) {
  6505. q = s,
  6506. e.outsideAllowed() || $("#gui-modes-outside").addClass("invisible"),
  6507. e.supportedModes[_e.PANORAMA] || $("#gui-modes-inside").addClass("invisible"),
  6508. ae.init(),
  6509. re.init(e, a),
  6510. Oe.init(e, t, n),
  6511. $(".icon").on("mouseover", function() {
  6512. t.player && t.player.reticule.hide()
  6513. }),
  6514. m(e, t),
  6515. A(e, t),
  6516. e.data.enable_social_sharing && e.data.is_public && Q.share.enabled && (Ce.init(e.data.name),
  6517. Ce.on(Me.OPENED, function() {
  6518. var e = document.getElementById("share-modal");
  6519. return function() {
  6520. Ze("share"),
  6521. le.open(e)
  6522. }
  6523. }()),
  6524. Ce.on(Me.CLOSED, le.reset)),
  6525. e.heroLocations.length > 1 ? b(e, t, i) : (je.highlight.visible = !1,
  6526. je.tourControls.visible = !1),
  6527. de.on(pe.OPEN_INFO, Ze.bind(this, "info")),
  6528. z(),
  6529. g(i),
  6530. v(e, r),
  6531. e.on("floor.changed", C),
  6532. e.on("waiting", R.bind(this, e)),
  6533. e.on("waiting-done", P.bind(this, e)),
  6534. i.on(xe.ModeChanged, function(e, n) {
  6535. g(i),
  6536. o(t, i),
  6537. n === _e.PANORAMA && i.currentPano && !i.currentPano.isAligned() && (n = _e.OUTDOOR),
  6538. he.updateMode(n)
  6539. }),
  6540. n.on(Se.Move, Ze.bind(this, "move")),
  6541. i.on(xe.Ready, function() {
  6542. ie.init(n, i, i.tagManager, t),
  6543. i.on(xe.ModeChanged, function(e, t) {
  6544. e !== t && $(".vr-popup").is(":visible") && Ae.dismiss()
  6545. })
  6546. }),
  6547. i.on(xe.PanoChosen, function(e, t) {
  6548. g(i, t),
  6549. he.updateMode(t && !t.isAligned() ? _e.OUTDOOR : _e.PANORAMA)
  6550. }),
  6551. le.on(ce.CLOSE, function(e) {
  6552. switch (e) {
  6553. case "vr-modal":
  6554. Ae.dismiss();
  6555. break;
  6556. case "share-modal":
  6557. Ce.hide();
  6558. break;
  6559. case "terms-modal":
  6560. fe.hide()
  6561. }
  6562. });
  6563. var l = $("#play").eq(0)
  6564. , c = $("#pause").eq(0)
  6565. , h = $(".pinBottom").toArray()
  6566. , u = $("#drawer").eq(0)
  6567. , d = $("#playHead").eq(0)
  6568. , p = $("#progressBar").eq(0)
  6569. , f = $("#thumb-container").eq(0)
  6570. , y = f.children()
  6571. , I = p.children();
  6572. t.on("update.controls", function() {
  6573. var n = t.describe();
  6574. n.tourIsPlaying || i.isWarping() ? (je.tourControls.visible && (l.hide(),
  6575. c.show()),
  6576. n.tourInProgress && (h.forEach(function(e) {
  6577. e.classList.add("playing")
  6578. }),
  6579. u.addClass("playing"),
  6580. d.addClass("playing"))) : (je.tourControls.visible && (l.show(),
  6581. c.hide()),
  6582. n.tourInProgress || (ve.stopTour(),
  6583. h.forEach(function(e) {
  6584. e.classList.remove("playing")
  6585. }),
  6586. u.removeClass("playing"),
  6587. d.removeClass("playing")));
  6588. var r, a, s;
  6589. if (null !== n.currentItem) {
  6590. var p, f;
  6591. $("#status").find(".curIdx").text(n.currentItem + 1),
  6592. n.onTheBus ? (p = "active",
  6593. f = "recent") : (f = "active",
  6594. p = "recent");
  6595. var g = null === n.destinationItem || n.currentItem === n.destinationItem;
  6596. for (r = 0; r < e.heroLocations.length; r += 1)
  6597. s = y.eq(r),
  6598. a = I.eq(r),
  6599. s.removeClass(f),
  6600. a.removeClass(f),
  6601. n.onTheBus && r === n.destinationItem ? (s.addClass(p),
  6602. a.addClass(p),
  6603. W.activate(r)) : n.onTheBus && g && r === n.currentItem ? (s.addClass(p),
  6604. a.addClass(p)) : (s.removeClass(p),
  6605. a.removeClass(p))
  6606. } else
  6607. for (r = 0; r < e.heroLocations.length; r += 1)
  6608. s = y.eq(r),
  6609. a = I.eq(r),
  6610. s.removeClass("active recent"),
  6611. a.removeClass("active recent");
  6612. o(t, i)
  6613. }),
  6614. document.addEventListener("keydown", function(n) {
  6615. switch (J.updateInteraction(Se.InteractionKey),
  6616. n.which) {
  6617. case we.ZERO:
  6618. Q.debug && e.toggleAlpha();
  6619. break;
  6620. case we.NINE:
  6621. Q.debug && se.toggle();
  6622. break;
  6623. case we.ONE:
  6624. i.isInMode(_e.TRANSITIONING) || t.changeMode(_e.PANORAMA);
  6625. break;
  6626. case we.TWO:
  6627. e.outsideAllowed() && !i.isInMode(_e.DOLLHOUSE, _e.TRANSITIONING) && t.changeMode(_e.DOLLHOUSE);
  6628. break;
  6629. case we.THREE:
  6630. e.outsideAllowed() && !i.isInMode(_e.FLOORPLAN, _e.TRANSITIONING) && t.changeMode(_e.FLOORPLAN);
  6631. break;
  6632. case we.FOUR:
  6633. i.isInMode(_e.TRANSITIONING) || t.changeMode(_e.OUTDOOR);
  6634. break;
  6635. case we.SPACE:
  6636. je.tourControls.visible && ($("#playHead").hasClass("playing") || Ze("tour"));
  6637. break;
  6638. case we.RETURN:
  6639. Q.debug && e.toggleExplodeUp();
  6640. break;
  6641. case we.P:
  6642. k();
  6643. break;
  6644. case we.U:
  6645. B();
  6646. break;
  6647. case we.X:
  6648. Q.debug && e.toggleExplode();
  6649. break;
  6650. case we.PLUSEQUALS:
  6651. t.player.activatePersistentZooming(!0),
  6652. ie.hideUi();
  6653. break;
  6654. case we.DASHUNDERSCORE:
  6655. t.player.activatePersistentZooming(!1),
  6656. ie.hideUi();
  6657. break;
  6658. case we.SEVEN:
  6659. De.info("Zoom level: " + t.player.zoomLevel + ", FOV: " + t.player.zoomFov);
  6660. break;
  6661. case we.EIGHT:
  6662. t.player.decreaseZoomSpeed();
  6663. break;
  6664. case we.NINE:
  6665. t.player.increaseZoomSpeed()
  6666. }
  6667. return i && i.reticule.hide(),
  6668. !0
  6669. }
  6670. .bind(this)),
  6671. document.addEventListener("keyup", function(e) {
  6672. switch (e.which) {
  6673. case we.PLUSEQUALS:
  6674. t.player.deactivatePersistentZooming();
  6675. break;
  6676. case we.DASHUNDERSCORE:
  6677. t.player.deactivatePersistentZooming()
  6678. }
  6679. }
  6680. .bind(this)),
  6681. F(e),
  6682. L(e, t.player),
  6683. M(i),
  6684. te.setAutoPlay(e.heroCount()),
  6685. he.init(i, a.mode),
  6686. he.on(ue.OPENED, Ze.bind(this, "help")),
  6687. fe.init(),
  6688. fe.on(ge.OPENED, function() {
  6689. var e = document.getElementById("terms-modal");
  6690. return function() {
  6691. Ze("terms"),
  6692. le.open(e)
  6693. }
  6694. }()),
  6695. fe.on(ge.CLOSED, le.reset),
  6696. Q.quickstart.enabled || re.delayLanding(a.mode).then(re.showMessage.bind(this, i, t, je.coBrand.visible)),
  6697. (Q.quickstart.enabled || i.model.outsideAllowed()) && ie.init(n, i, i.tagManager, t),
  6698. Q.profiling.enabled && se.show(),
  6699. ve.init(t)
  6700. }
  6701. function M(e) {
  6702. var t = function(e, t) {
  6703. $(e).find("a").each(function(e, i) {
  6704. t ? $(i).removeClass("buttonZoomDisabled").addClass("buttonZoomEnabled") : $(i).addClass("buttonZoomDisabled").removeClass("buttonZoomEnabled"),
  6705. i.style.pointerEvents = t ? "auto" : "none"
  6706. })
  6707. }
  6708. , i = function() {
  6709. e.zoomLevel >= Q.zoom.max ? t("#gui-zoomin", !1) : t("#gui-zoomin", !0),
  6710. e.zoomLevel <= Q.zoom.min ? t("#gui-zoomout", !1) : t("#gui-zoomout", !0)
  6711. };
  6712. e.on(Ne.ZoomMax, function() {
  6713. t("#gui-zoomin", !1),
  6714. t("#gui-zoomout", !0)
  6715. }),
  6716. e.on(Ne.ZoomMin, function() {
  6717. t("#gui-zoomin", !0),
  6718. t("#gui-zoomout", !1)
  6719. }),
  6720. e.on(Ne.ZoomIn, function() {
  6721. t("#gui-zoomout", !0)
  6722. }),
  6723. e.on(Ne.ZoomOut, function() {
  6724. t("#gui-zoomin", !0)
  6725. }),
  6726. i()
  6727. }
  6728. function R(e) {
  6729. O(e)
  6730. }
  6731. function P(e) {
  6732. O(e)
  6733. }
  6734. function O(e) {
  6735. var t = e.waitQueue.length;
  6736. t <= 0 ? f() : Ge || p(Q.modelComponentLoadSpinnerDelay)
  6737. }
  6738. function L(e, t) {
  6739. He = {
  6740. gui: null,
  6741. visible: !1,
  6742. model: e,
  6743. player: t
  6744. }
  6745. }
  6746. function D(e, t) {
  6747. function i() {
  6748. var i = t.toJSON();
  6749. n.linkToLocation = window.location.protocol + "//" + window.location.host + window.location.pathname + "?m=" + e.sid + "&start=" + be.serialize(i),
  6750. t.tagManager.activeTag && (n.linkToLocation += "&tag=" + t.tagManager.activeTag.sid)
  6751. }
  6752. var n = {}
  6753. , r = new Le.GUI({
  6754. autoPlace: !0,
  6755. width: "60%"
  6756. });
  6757. i(),
  6758. t.on(xe.ViewChanged, i),
  6759. r.add(n, "linkToLocation").name(Re.LINK_TO_LOCATION).listen(),
  6760. r.domElement.id = "datLinks";
  6761. var o = [].slice.call(r.domElement.querySelectorAll(".property-name"));
  6762. return o.forEach(function(e) {
  6763. if (!K.detectSafari()) {
  6764. var t = document.createElement("button");
  6765. t.classList.add("btn-deep-link"),
  6766. t.innerText = Re.MENU_COPY,
  6767. e.nextSibling.appendChild(t);
  6768. var i = function() {
  6769. alert(Re.LINK_ALERT_COPY),
  6770. t.hide()
  6771. };
  6772. t.addEventListener("click", function(e) {
  6773. try {
  6774. var t = e.target.parentNode.childNodes[0];
  6775. t.select();
  6776. var n = document.execCommand("copy");
  6777. t.blur(),
  6778. n || i()
  6779. } catch (e) {
  6780. i()
  6781. }
  6782. })
  6783. }
  6784. }),
  6785. $(r.__closeButton).hide(),
  6786. r
  6787. }
  6788. function N(e) {
  6789. He.gui || (He.gui = D(He.model, He.player)),
  6790. He.visible = e,
  6791. e ? $(He.gui.domElement).show() : $(He.gui.domElement).hide()
  6792. }
  6793. function B() {
  6794. N(!He.visible)
  6795. }
  6796. function F(e) {
  6797. ke = {
  6798. gui: null,
  6799. visible: !1,
  6800. model: e
  6801. }
  6802. }
  6803. function V(e) {
  6804. var t = new Le.GUI;
  6805. return t.add(Q, "showSweeps").name("Show sweeps").onFinishChange(function() {
  6806. e.setSweepVisibility(Q.showSweeps)
  6807. }),
  6808. t.add(Q, "rotationAccelerationInside", .1, 10).name("Rotation speed").step(.1),
  6809. t.add(Q.transition, "flyTime", 0, 5e3).name("Transition time").onFinishChange(function() {
  6810. Q.transition.flySpeed = 0,
  6811. t.__controllers.forEach(function(e) {
  6812. e.updateDisplay()
  6813. })
  6814. }),
  6815. t.add(Q.path, "opacity", 0, 1).name("Path opacity"),
  6816. $(t.__closeButton).hide(),
  6817. t
  6818. }
  6819. function U(e) {
  6820. ke.gui || (ke.gui = V(ke.model)),
  6821. ke.visible = e,
  6822. e ? $(ke.gui.domElement).show() : $(ke.gui.domElement).hide()
  6823. }
  6824. function k() {
  6825. U(!ke.visible)
  6826. }
  6827. function H() {
  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) || e.preventDefault()
  6830. }
  6831. $("body").css("touch-action", "none"),
  6832. $("#gui-parent").find("*:not(#tag-billboards)").on("touchmove", function(e) {
  6833. e.preventDefault()
  6834. });
  6835. var t = document.getElementById("terms-text")
  6836. , i = document.getElementById("more-help-wrapper")
  6837. , n = (document.getElementById("navigation-help-wrapper"),
  6838. document.getElementById("help-dialog"),
  6839. document.getElementById("tag-billboards"));
  6840. Q.useWheel && (document.body.addEventListener("mousewheel", e),
  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. function G(e, t) {
  6847. for (var i = []; e; )
  6848. i.push(e),
  6849. e = e.parentNode;
  6850. for (; t && i.indexOf(t) === -1; )
  6851. t = t.parentNode;
  6852. return t
  6853. }
  6854. function z() {
  6855. var e, t = function(t) {
  6856. e = 0 === t.button || 1 === t.which ? t.target : null
  6857. }, i = function(t) {
  6858. e !== t.target && (e = G(e, t.target));
  6859. var i = document.getElementById("gui-parent");
  6860. if (G(i, e) !== i && (e = null),
  6861. e) {
  6862. var n;
  6863. try {
  6864. n = new MouseEvent("click",t)
  6865. } catch (e) {
  6866. n = document.createEvent("MouseEvents"),
  6867. n.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)
  6868. }
  6869. n.syntheticClick = !0,
  6870. e.dispatchEvent(n),
  6871. e = null
  6872. }
  6873. };
  6874. document.body.addEventListener("mousedown", t, !0),
  6875. document.body.addEventListener("mouseup", i, !0),
  6876. document.getElementById("gui-parent").addEventListener("click", function(e) {
  6877. e.syntheticClick || (e.stopPropagation(),
  6878. "A" === e.target.nodeName && e.preventDefault())
  6879. }, !0)
  6880. }
  6881. var W, j, Y, X, Z, q, K = (e("three"),
  6882. e("../util/ajax"),
  6883. e("../util/browser")), Q = e("../settings"), J = e("../analytics"), ee = (e("../util/transitions"),
  6884. e("../util/camera"),
  6885. e("../util/logger")), te = (e("../objects/Snapshot"),
  6886. e("./helpManager")), ie = e("./immersiveMode"), ne = e("./loadingScreen"), re = e("./landingScreen"), oe = e("./playButton"), ae = e("./populateModal"), se = e("./memoryUsage"), le = e("./closer/modalCloser"), ce = e("./closer/ModalCloserEvent"), he = e("./help/help"), ue = e("./help/HelpEvent"), de = e("./title/titleBar"), pe = e("./title/TitleEvents"), fe = e("./terms/terms"), ge = e("./terms/TermsEvent"), me = e("./title/tagToggle"), ve = e("./tourInteraction"), Ae = e("./vr/vrModal"), ye = e("./vr/vrEvent"), Ce = e("./sharing/modal"), Ie = e("./webvr/webVRgui"), Ee = e("./webvr/WebVrEvent"), be = e("../controls/serializer"), we = e("../enum/Keys"), _e = e("../enum/Viewmode"), Te = (e("../enum/BlackoutStyle"),
  6887. e("../tag/Media/MediaEvent")), xe = (e("../enum/PathDiscardMode"),
  6888. e("../enum/PathDisplayMode"),
  6889. e("../enum/DirectorEvents"),
  6890. e("../enum/PlayerEvents")), Se = e("../enum/ControlEvents"), Me = e("./sharing/ShareEvents"), Re = e("../localization/localize"), Pe = (e("../enum/Vectors"),
  6891. e("../enum/WarpStyle"),
  6892. e("../enum/AlignmentType"),
  6893. e("../enum/VROption")), Oe = e("./konami"), Le = e("../lib/dat.gui"), De = new ee(i), Ne = (e("../util/showcase"),
  6894. e("../enum/ZoomEvents")), Be = _e.DOLLHOUSE, Fe = 0, Ve = 0, Ue = [".hideTarget"], ke = null, He = null, Ge = !1, ze = !1, We = !1, je = {
  6895. coBrand: {
  6896. visible: !0,
  6897. elements: [".co-brand", "#loaderCoBrand"]
  6898. },
  6899. help: {
  6900. visible: !0,
  6901. elements: [".nav-help", "#nav-help"]
  6902. },
  6903. tourControls: {
  6904. visible: !0,
  6905. elements: [".next", ".previous", "#play"]
  6906. },
  6907. highlight: {
  6908. visible: !0,
  6909. elements: ["#drawer", "#pullTab"]
  6910. },
  6911. share: {
  6912. visible: !0,
  6913. elements: [".socialButton", "#share"]
  6914. },
  6915. fullScreen: {
  6916. visible: !0,
  6917. elements: ["#gui-fullscreen"]
  6918. },
  6919. floors: {
  6920. visible: !0,
  6921. elements: [".gui-floor"]
  6922. }
  6923. }, Ye = function() {
  6924. var e = document.getElementById("drawer");
  6925. return function() {
  6926. $("#player").height() < 400 && e.classList.contains("open") && a()
  6927. }
  6928. }(), Xe = function() {
  6929. var e = document.getElementById("meta-info");
  6930. return function() {
  6931. $("#player").height() < 400 && e.classList.contains("expand") && de.toggleMeta(!0)
  6932. }
  6933. }(), Ze = function(e) {
  6934. function t() {
  6935. u.classList.contains("expand") && de.toggleMeta(!0)
  6936. }
  6937. function i() {
  6938. fe.hide()
  6939. }
  6940. function n() {
  6941. he.close()
  6942. }
  6943. function r() {
  6944. Ae.dismiss()
  6945. }
  6946. function o() {
  6947. p.hasClass("open") && a(!0)
  6948. }
  6949. function l() {
  6950. Ce.hide()
  6951. }
  6952. function c() {
  6953. f.hasClass("open") && f.removeClass("open")
  6954. }
  6955. function h() {
  6956. d.classList.contains("fadeIn") && (d.classList.contains("landing") ? re.dismissModal() : d.classList.contains("tour") && ve.dismissModal())
  6957. }
  6958. var u = document.getElementById("meta-info")
  6959. , d = document.getElementById("interaction-modal")
  6960. , p = $("#drawer").eq(0)
  6961. , f = $(".gui-floor").eq(0)
  6962. , g = $(".vr-popup").eq(0);
  6963. return function(e) {
  6964. switch (e) {
  6965. case "info":
  6966. i(),
  6967. n(),
  6968. Ye(),
  6969. l(),
  6970. c(),
  6971. r(),
  6972. h();
  6973. break;
  6974. case "terms":
  6975. t(),
  6976. n(),
  6977. o(),
  6978. l(),
  6979. c(),
  6980. r(),
  6981. h();
  6982. break;
  6983. case "help":
  6984. t(),
  6985. i(),
  6986. l(),
  6987. c(),
  6988. r(),
  6989. h();
  6990. break;
  6991. case "vr":
  6992. t(),
  6993. i(),
  6994. l(),
  6995. c(),
  6996. n(),
  6997. h(),
  6998. s(g) && o();
  6999. break;
  7000. case "highlights":
  7001. Xe(),
  7002. i(),
  7003. l(),
  7004. c();
  7005. break;
  7006. case "share":
  7007. t(),
  7008. i(),
  7009. n(),
  7010. c(),
  7011. r(),
  7012. h();
  7013. break;
  7014. case "floor":
  7015. i(),
  7016. l(),
  7017. r();
  7018. break;
  7019. case "view":
  7020. c(),
  7021. l(),
  7022. i(),
  7023. r();
  7024. break;
  7025. case "tour":
  7026. i(),
  7027. l(),
  7028. c(),
  7029. r();
  7030. break;
  7031. case "move":
  7032. i(),
  7033. l(),
  7034. c(),
  7035. r();
  7036. break;
  7037. case "resize":
  7038. t(),
  7039. Ye(),
  7040. c();
  7041. break;
  7042. case "tag":
  7043. i(),
  7044. n(),
  7045. l(),
  7046. c(),
  7047. r()
  7048. }
  7049. }
  7050. }();
  7051. $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", function(e) {
  7052. $("#gui-fullscreen").toggle(!K.isFullscreen()),
  7053. $("#gui-fullscreen-exit").toggle(!!K.isFullscreen()),
  7054. setTimeout(function() {
  7055. $(".icon:visible").hide().show(0)
  7056. }, 100)
  7057. }),
  7058. $("#gui-fullscreen").find("a").on("click", function(e) {
  7059. l(e),
  7060. K.requestFullscreen($("body")[0]),
  7061. J.track("showcase_gui", {
  7062. gui_action: "click_enter_fullscreen",
  7063. interaction_source: "gui"
  7064. }),
  7065. W.reload()
  7066. }),
  7067. $("#gui-fullscreen-exit").find("a").on("click", function(e) {
  7068. l(e),
  7069. K.exitFullscreen(),
  7070. J.track("showcase_gui", {
  7071. gui_action: "click_exit_fullscreen",
  7072. interaction_source: "gui"
  7073. })
  7074. }),
  7075. $("#volume").find("a").on("click", function(e) {//xzw 声音
  7076. l(e);
  7077. if($("#volume img")[0].src.indexOf("btn_on.png")>-1)
  7078. {
  7079. g_play = 0;
  7080. //g_bgAudio.pause();
  7081. //g_tourAudio.pause(); //g_tourAudio.volume = 0;//ios 无法改变音量
  7082. g_playAudio && g_playAudio.pause();
  7083. $("#volume img").attr("src", "./images/Volume btn_off.png");
  7084. $("#volume").attr("title", "关闭声音");
  7085. }
  7086. else if($("#volume img")[0].src.indexOf("btn_off.png")>-1)
  7087. {
  7088. g_play = 1;
  7089. g_playAudio && g_playAudio.play()
  7090. /* if(g_tourAudio && g_tourAudio.src) g_tourAudio.play();
  7091. else if(g_bgAudio)g_bgAudio.play() */
  7092. $("#volume img").attr("src", "./images/Volume btn_on.png");
  7093. $("#volume").attr("title", "打开声音");
  7094. }
  7095. }),
  7096. $(window).on("resize", function(e) {
  7097. var t = e.target.innerHeight
  7098. , i = e.target.innerWidth;
  7099. t === X && i === Z || (je.highlight.visible && w(),
  7100. Ze("resize"),
  7101. $(".pinTop.right").removeClass("hideUnderMeta"),
  7102. c(),
  7103. X = t,
  7104. Z = i)
  7105. }).resize(),
  7106. K.supportsFullscreen() || $("#gui-fullscreen").hide(),
  7107. $("#pullTab").on("click", function(e) {
  7108. l(e),
  7109. $("#drawer").hasClass("open") ? (J.trackAlways("showcase_gui", {
  7110. gui_action: "hide_highlight_reel"
  7111. }),
  7112. $(this).addClass("open")) : (J.trackAlways("showcase_gui", {
  7113. gui_action: "show_highlight_reel"
  7114. }),
  7115. $(this).removeClass("open")),
  7116. a()
  7117. }),
  7118. $("#more-menu-button").on("click", function(e) {
  7119. l(e);
  7120. var t = $("#more-menu");
  7121. t.toggleClass("open")
  7122. }),
  7123. t.exports.init = S,
  7124. t.exports.startLoading = x,
  7125. t.exports.endLoading = d,
  7126. t.exports.onProgress = u
  7127. }
  7128. ).call(this, "/js/gui/gui.js")
  7129. }
  7130. , {
  7131. "../analytics": 4,
  7132. "../controls/serializer": 14,
  7133. "../enum/AlignmentType": 17,
  7134. "../enum/BlackoutStyle": 18,
  7135. "../enum/ControlEvents": 21,
  7136. "../enum/DirectorEvents": 23,
  7137. "../enum/Keys": 30,
  7138. "../enum/PathDiscardMode": 38,
  7139. "../enum/PathDisplayMode": 39,
  7140. "../enum/PlayerEvents": 40,
  7141. "../enum/VROption": 47,
  7142. "../enum/Vectors": 50,
  7143. "../enum/Viewmode": 51,
  7144. "../enum/WarpStyle": 52,
  7145. "../enum/ZoomEvents": 53,
  7146. "../lib/dat.gui": 93,
  7147. "../localization/localize": 108,
  7148. "../tag/Media/MediaEvent": 131,
  7149. "../objects/Snapshot": 153,
  7150. "../settings": 166,
  7151. "../util/ajax": 181,
  7152. "../util/browser": 182,
  7153. "../util/camera": 183,
  7154. "../util/logger": 189,
  7155. "../util/showcase": 193,
  7156. "../util/transitions": 195,
  7157. "./closer/ModalCloserEvent": 61,
  7158. "./closer/modalCloser": 62,
  7159. "./help/HelpEvent": 66,
  7160. "./help/help": 67,
  7161. "./helpManager": 68,
  7162. "./immersiveMode": 69,
  7163. "./konami": 70,
  7164. "./landingScreen": 71,
  7165. "./loadingScreen": 72,
  7166. "./memoryUsage": 73,
  7167. "./playButton": 74,
  7168. "./populateModal": 75,
  7169. "./sharing/ShareEvents": 76,
  7170. "./sharing/modal": 77,
  7171. "./terms/TermsEvent": 78,
  7172. "./terms/terms": 79,
  7173. "./title/TitleEvents": 80,
  7174. "./title/tagToggle": 81,
  7175. "./title/titleBar": 82,
  7176. "./tourInteraction": 84,
  7177. "./vr/vrEvent": 85,
  7178. "./vr/vrModal": 87,
  7179. "./webvr/WebVrEvent": 88,
  7180. "./webvr/webVRgui": 89,
  7181. three: 217
  7182. }],
  7183. 66: [function(e, t, i) {
  7184. "use strict";
  7185. t.exports = Object.freeze({
  7186. OPENED: "help.opened",
  7187. CLOSED: "help.closed"
  7188. })
  7189. }
  7190. , {}],
  7191. 67: [function(e, t, i) {
  7192. "use strict";
  7193. function n() {
  7194. g.on("click", function(e) {
  7195. if (S && S !== l.TRANSITIONING) {
  7196. var t = window.getComputedStyle(y).getPropertyValue("opacity") > 0;
  7197. t && !M ? R.close() : r()
  7198. }
  7199. }),
  7200. w.on("click", function(e) {
  7201. R.close()
  7202. }),
  7203. E.on("click", function(e) {
  7204. S && S !== l.TRANSITIONING && (s(),
  7205. o())
  7206. }),
  7207. b.on("click", function(e) {
  7208. s(),
  7209. a()
  7210. })
  7211. }
  7212. function r() {
  7213. S && S !== l.TRANSITIONING && (M = !0,
  7214. setTimeout(function() {
  7215. M = !1
  7216. }, d.help.modalStayDuration),
  7217. R.emit(h.OPENED),
  7218. m.addClass("open " + S),
  7219. g.addClass("open"),
  7220. s(),
  7221. o(),
  7222. y.style.removeProperty ? y.style.removeProperty("display") : y.style.removeAttribute("display"),
  7223. y.classList.add("fadeIn"))
  7224. }
  7225. function o() {
  7226. E.addClass("underline-tab"),
  7227. u.fill(_, c.NAVIGATION, S),
  7228. m.addClass(S)
  7229. }
  7230. function a() {
  7231. b.addClass("underline-tab"),
  7232. u.fill(T, c.MORE_HELP),
  7233. m.addClass("more-help")
  7234. }
  7235. function s(e, t) {
  7236. m.removeClass("more-help " + l.PANORAMA + " " + l.DOLLHOUSE + " " + l.FLOORPLAN + " " + l.OUTDOOR),
  7237. I.forEach(function(e) {
  7238. e.classList.remove("underline-tab")
  7239. })
  7240. }
  7241. var l = e("../../enum/Viewmode")
  7242. , c = e("../../enum/HelpModalType")
  7243. , h = e("./HelpEvent")
  7244. , u = (e("../helpManager"),
  7245. e("./../populateModal"))
  7246. , d = e("../../settings")
  7247. , p = e("../../util/common")
  7248. , f = e("events").EventEmitter
  7249. , g = $(".footer-help").eq(0)
  7250. , m = $("#help-dialog").eq(0)
  7251. , v = document.querySelector("#quick-logo")
  7252. , A = document.querySelector("#loaderCoBrand")
  7253. , y = document.querySelector("#help-dialog")
  7254. , C = document.querySelector(".footer")
  7255. , I = $(".help-tabs").children().toArray()
  7256. , E = $(".navigation-tab").eq(0)
  7257. , b = $(".more-help-tab").eq(0)
  7258. , w = ($("#interaction-modal").eq(0).find(".interaction").toArray(),
  7259. m.find(".close").eq(0))
  7260. , _ = m.find(".interactions").toArray()
  7261. , T = m.find(".ui-instructions").toArray()
  7262. , x = l.PANORAMA
  7263. , S = l.PANORAMA
  7264. , M = !1
  7265. , R = {
  7266. init: function(e, t) {
  7267. S = t,
  7268. x = t,
  7269. [y, A, v, C].forEach(function(e) {
  7270. e.classList.add(u.deviceType)
  7271. }),
  7272. n()
  7273. },
  7274. close: function() {
  7275. if (m.hasClass("open") && (this.emit(h.CLOSED),
  7276. g.removeClass("open"),
  7277. m.removeClass("open"),
  7278. y.classList.contains("fadeIn"))) {
  7279. y.classList.remove("fadeIn");
  7280. var e = S === l.TRANSITIONING ? x : S;
  7281. u.clear(_, c.NAVIGATION, e)
  7282. }
  7283. },
  7284. updateMode: function(e) {
  7285. x = S,
  7286. S = e
  7287. }
  7288. };
  7289. p.extendObject(R, f.prototype),
  7290. t.exports = R
  7291. }
  7292. , {
  7293. "../../enum/HelpModalType": 28,
  7294. "../../enum/Viewmode": 51,
  7295. "../../settings": 166,
  7296. "../../util/common": 185,
  7297. "../helpManager": 68,
  7298. "./../populateModal": 75,
  7299. "./HelpEvent": 66,
  7300. events: 202
  7301. }],
  7302. 68: [function(e, t, i) {
  7303. (function(i) {
  7304. "use strict";
  7305. var n = e("../util/browser")
  7306. , r = e("./../util/logger")
  7307. , o = e("./../settings")
  7308. , a = new r(i)
  7309. , s = function() {
  7310. var e;
  7311. try {
  7312. return e = window.localStorage.getItem("visitCount") || "0",
  7313. e = (parseFloat(e) + 1).toString(),
  7314. window.localStorage.setItem("visitCount", e),
  7315. a.debug("visitCount = " + e),
  7316. e
  7317. } catch (t) {
  7318. e = "1",
  7319. a.debug("couldn't set local storage")
  7320. }
  7321. }()
  7322. , l = !1;
  7323. t.exports = {
  7324. isHelpDisabled: function() {
  7325. return "0" === n.valueFromHash("help", null) || l
  7326. },
  7327. isLargeHelpEnabled: function() {
  7328. return ("1" === s || "1" === n.valueFromHash("help", null)) && !this.isHelpDisabled()
  7329. },
  7330. isSmallHelpEnabled: function() {
  7331. return "2" === n.valueFromHash("help", null) && !this.isHelpDisabled()
  7332. },
  7333. isHelpEnabled: function() {
  7334. return this.isLargeHelpEnabled() || this.isSmallHelpEnabled()
  7335. },
  7336. setAutoPlay: function(e) {
  7337. l = o.warp.auto >= 0 && e > 1
  7338. }
  7339. }
  7340. }
  7341. ).call(this, "/js/gui/helpManager.js")
  7342. }
  7343. , {
  7344. "../util/browser": 182,
  7345. "./../settings": 166,
  7346. "./../util/logger": 189
  7347. }],
  7348. 69: [function(e, t, i) {
  7349. "use strict";
  7350. function n(e, t, i, n) {
  7351. F = n,
  7352. r(e, t, i, F),
  7353. o(),
  7354. N = t.mode
  7355. }
  7356. function r(e, t, i, n) {
  7357. [C.PANORAMA, C.DOLLHOUSE, C.FLOORPLAN].forEach(function(t) {
  7358. e.controls[t].on(v.Move, a),
  7359. e.controls[t].on(v.LongTap, c)
  7360. }),
  7361. M.on("mousewheel DOMMouseScroll", a),
  7362. i.on(m.TagActivated, a),
  7363. i.on(m.TagNavigation, a),
  7364. t.on(A.FlyingEnded, s),
  7365. t.on(A.ModeChanging, function(e, t) {
  7366. B = t !== C.PANORAMA && e !== C.PANORAMA
  7367. }),
  7368. t.on(A.ModeChanged, function(e, i) {
  7369. N = t.mode,
  7370. i !== C.TRANSITIONING ? l() : a("modeChange")
  7371. }),
  7372. n.on(y.TourStart, function() {
  7373. L = !0,
  7374. a()
  7375. }),
  7376. n.on(y.TourEnd, function() {
  7377. L = !1,
  7378. l()
  7379. }),
  7380. n.on(y.ActionInterrupted, function() {
  7381. L = !1
  7382. }),
  7383. R.addEventListener("touchend", function() {
  7384. $("#pullTab").hasClass("opened") && !L && l()
  7385. }, !0)
  7386. }
  7387. function o() {
  7388. p.isMobile() ? (b.forEach(function(e) {
  7389. e.classList.add("mobile")
  7390. }),
  7391. w.click(l)) : (b.forEach(function(e) {
  7392. e.addEventListener("mouseleave", function() {
  7393. !M.is(":hover") && b[0].classList.contains("detectHover") && l()
  7394. }, !0)
  7395. }),
  7396. M.mouseleave(function() {
  7397. b[0].classList.contains("detectHover") && l()
  7398. }))
  7399. }
  7400. function a(e) {
  7401. D || d(e) && _.hasClass("playing") || (clearTimeout(O),
  7402. P = !0,
  7403. g.close(),
  7404. h(e),
  7405. N !== C.DOLLHOUSE && N !== C.FLOORPLAN && (x.hasClass("expand") && !S.hasClass("closed") || 2 === p.valueFromHash("title", 1) || S.addClass("fadeOut"),
  7406. _.hasClass("playing") || (b.forEach(function(e) {
  7407. e.classList.add("detectHover")
  7408. }),
  7409. O = setTimeout(l, f.immersive.timeToShowAgain))))
  7410. }
  7411. function s() {
  7412. _.hasClass("playing") || (clearTimeout(O),
  7413. O = setTimeout(l, f.immersive.timeToShowAgain))
  7414. }
  7415. function l() {
  7416. clearTimeout(O),
  7417. P = !1,
  7418. I.forEach(function(e) {
  7419. e.classList.remove("fadeOut"),
  7420. e.classList.remove("drawerOpen")
  7421. }),
  7422. L || E.forEach(function(e) {
  7423. e.classList.remove("duringTour")
  7424. }),
  7425. b.forEach(function(e) {
  7426. e.classList.remove("detectHover")
  7427. })
  7428. }
  7429. function c() {
  7430. P ? l() : a(),
  7431. D = !0,
  7432. setTimeout(function() {
  7433. D = !1
  7434. }, f.immersive.uiStayDuration)
  7435. }
  7436. function h(e) {
  7437. !d(e) && L ? E.forEach(function(e) {
  7438. e.classList.remove("drawerOpen"),
  7439. e.classList.add("duringTour")
  7440. }) : _.hasClass("open") ? E.forEach(function(e) {
  7441. e.classList.remove("duringTour"),
  7442. e.classList.add("drawerOpen")
  7443. }) : B || N === C.FLOORPLAN || N === C.DOLLHOUSE || E.forEach(function(e) {
  7444. e.classList.add("fadeOut")
  7445. })
  7446. }
  7447. function u() {
  7448. T.hasClass("duringTour") || (L = !1,
  7449. a("gui"),
  7450. l())
  7451. }
  7452. function d(e) {
  7453. return "mouse" === e || "touch" === e || "key" === e || "gui" === e
  7454. }
  7455. var p = e("../util/browser")
  7456. , f = e("../settings")
  7457. , g = e("./help/help")
  7458. , m = e("../enum/tagEvents")
  7459. , v = e("../enum/ControlEvents")
  7460. , A = e("../enum/PlayerEvents")
  7461. , y = e("../enum/DirectorEvents")
  7462. , A = e("../enum/PlayerEvents")
  7463. , C = e("../enum/Viewmode")
  7464. , I = $(".pinTop.left, .pinBottom-container, #drawer-container, #drawer, .footer").toArray()
  7465. , E = $(".pinBottom-container, #drawer-container, .footer").toArray()
  7466. , b = $("#hover-bottom, #hover-top").toArray()
  7467. , w = ($("#pullTab").eq(0),
  7468. $("#playHead").eq(0),
  7469. $(".pinBottom-container").eq(0))
  7470. , _ = $("#drawer").eq(0)
  7471. , T = $("#drawer-container").eq(0)
  7472. , x = $("#meta-info").eq(0)
  7473. , S = $(".pinTop.left").eq(0)
  7474. , M = $("#player").eq(0)
  7475. , R = document.getElementById("pullTab")
  7476. , P = !1
  7477. , O = null
  7478. , L = !1
  7479. , D = !1
  7480. , N = null
  7481. , B = !1
  7482. , F = null;
  7483. t.exports.init = n,
  7484. t.exports.hideUi = a,
  7485. t.exports.resetDrawer = u
  7486. }
  7487. , {
  7488. "../enum/ControlEvents": 21,
  7489. "../enum/DirectorEvents": 23,
  7490. "../enum/tagEvents": 32,
  7491. "../enum/PlayerEvents": 40,
  7492. "../enum/Viewmode": 51,
  7493. "../settings": 166,
  7494. "../util/browser": 182,
  7495. "./help/help": 67
  7496. }],
  7497. 70: [function(e, t, i) {
  7498. (function(i) {
  7499. "use strict";
  7500. function n(e, t, i) {
  7501. l.debug("konami has the modelInstance");
  7502. var n = [];
  7503. $(window).on("keydown", function(e) {
  7504. n.push(e.which),
  7505. n.length > o.secretPanelWord.length && n.shift(),
  7506. s.equalLists(n, o.secretPanelWord) && (l.debug("Developer mode active."),
  7507. o.debug = !0)
  7508. }),
  7509. $(window).on("keydown", function n(r) {
  7510. o.debug && 72 === r.which && (e && i ? (a.toggle(e, t, i),
  7511. $(window).off("keydown", n)) : console.warn("sorry we're not ready yet"))
  7512. })
  7513. }
  7514. var r = e("./../util/logger")
  7515. , o = e("./../settings")
  7516. , a = e("./debug")
  7517. , s = e("./../util/common")
  7518. , l = (e("./gui"),
  7519. new r(i));
  7520. o.console && $("body").append('<div id="debug-console"></div>'),
  7521. t.exports.init = n
  7522. }
  7523. ).call(this, "/js/gui/konami.js")
  7524. }
  7525. , {
  7526. "./../settings": 166,
  7527. "./../util/common": 185,
  7528. "./../util/logger": 189,
  7529. "./debug": 63,
  7530. "./gui": 65
  7531. }],
  7532. 71: [function(e, t, i) {
  7533. "use strict";
  7534. function n(e, t) {
  7535. E = t.mode === p.PANORAMA && t.pano && !t.pano.isAligned() ? p.OUTDOOR : t.mode
  7536. }
  7537. function r(e) {
  7538. var t = $.Deferred();
  7539. e || t.resolve();
  7540. var i = c.startupFlyinDelay;
  7541. return e === p.PANORAMA && (i += c.dollhouse.transitionTime),
  7542. setTimeout(t.resolve.bind(t), i),
  7543. t
  7544. }
  7545. function o(e, t, i) {
  7546. var n = 0;
  7547. c.quickstart.enabled && (a(i),
  7548. n = c.quickstart.showTextDelay + c.quickstart.fadeOutDelay);
  7549. var r = function() {
  7550. e.once(g.Move, l),
  7551. t.once(f.TourStart, l)
  7552. };
  7553. s(n, r)
  7554. }
  7555. function a(e) {
  7556. return e && (y.addClass("quick-brand"),
  7557. v.before(y),
  7558. A = $(".quick-brand").toArray()),
  7559. m.addClass("fadeOut"),
  7560. setTimeout(function() {
  7561. A.forEach(function(e) {
  7562. e.classList.add("fadeIn")
  7563. })
  7564. }, c.quickstart.showTextDelay),
  7565. setTimeout(function() {
  7566. A.forEach(function(e) {
  7567. e.classList.add("fadeOut")
  7568. })
  7569. }, c.quickstart.fadeOutDelay),
  7570. !0
  7571. }
  7572. function s(e, t) {
  7573. setTimeout(function() {
  7574. if (h.isHelpEnabled()) {
  7575. if (t(),
  7576. u.init(),
  7577. C.addClass("fadeIn landing " + u.deviceType),
  7578. h.isSmallHelpEnabled())
  7579. return void C.addClass("small");
  7580. u.fill(I, d.LANDING[E]),
  7581. C.addClass(E)
  7582. }
  7583. }, e)
  7584. }
  7585. function l() {
  7586. u.clear(I, d.LANDING[E]),
  7587. C.removeClass("fadeIn")
  7588. }
  7589. var c = e("../settings")
  7590. , h = (e("./help/help"),
  7591. e("./helpManager"))
  7592. , u = e("./populateModal")
  7593. , d = e("../enum/HelpModalType")
  7594. , p = e("../enum/Viewmode")
  7595. , f = e("../enum/DirectorEvents")
  7596. , g = e("../enum/PlayerEvents")
  7597. , m = $("#quick-blackout").eq(0)
  7598. , v = $("#quick-logo").eq(0)
  7599. , A = $(".quick-brand").toArray()
  7600. , y = $("#loaderCoBrand").eq(0)
  7601. , C = $("#interaction-modal").eq(0)
  7602. , I = C.find(".interaction").toArray()
  7603. , E = ($("#model-title, .pinBottom-container, #drawer-container, #drawer, .footer").toArray(),
  7604. "");
  7605. t.exports.delayLanding = r,
  7606. t.exports.showMessage = o,
  7607. t.exports.init = n,
  7608. t.exports.dismissModal = l
  7609. }
  7610. , {
  7611. "../enum/DirectorEvents": 23,
  7612. "../enum/HelpModalType": 28,
  7613. "../enum/PlayerEvents": 40,
  7614. "../enum/Viewmode": 51,
  7615. "../settings": 166,
  7616. "./help/help": 67,
  7617. "./helpManager": 68,
  7618. "./populateModal": 75
  7619. }],
  7620. 72: [function(e, t, i) {
  7621. "use strict";
  7622. var n = e("./circleLoader").circleLoader;
  7623. t.exports = {
  7624. element: $("#gui-loading"),
  7625. hide: function(e) {
  7626. n.done(),
  7627. this.element.fadeOut(2500, e)
  7628. },
  7629. show: function(e) {
  7630. this.element.fadeIn(500, function() {
  7631. this.element.css("display", "table"),
  7632. e && e()
  7633. }
  7634. .bind(this))
  7635. },
  7636. progress: function(e) {
  7637. n.set(e)
  7638. }
  7639. }
  7640. }
  7641. , {
  7642. "./circleLoader": 60
  7643. }],
  7644. 73: [function(e, t, i) {
  7645. "use strict";
  7646. var n = e("../settings")
  7647. , r = $("#memory-info")
  7648. , o = r.find("#memory-gpu")
  7649. , a = !1;
  7650. t.exports = {
  7651. show: function() {
  7652. n.profiling.enabled && (r.show(),
  7653. a = !0)
  7654. },
  7655. hide: function() {
  7656. r.hide(),
  7657. a = !1
  7658. },
  7659. toggle: function() {
  7660. a ? this.hide() : this.show()
  7661. },
  7662. update: function(e) {
  7663. n.profiling.enabled && o.text(Math.floor(e / 1e6) + "MB")
  7664. }
  7665. }
  7666. }
  7667. , {
  7668. "../settings": 166
  7669. }],
  7670. 74: [function(e, t, i) {
  7671. "use strict";
  7672. var n = e("../util/browser")
  7673. , r = e("../analytics");
  7674. e("../settings");
  7675. t.exports = {
  7676. show: function(e, t) {
  7677. $("#gui-message").fadeIn(250, function() {
  7678. $(this).css("display", "table");
  7679. var e = $("#gui-message").fracs().visible >= .5;
  7680. r.impression({
  7681. visible: e,
  7682. immediate: !0
  7683. })
  7684. }),
  7685. e && $("#quick-blackout").addClass("fadeOut"),
  7686. $("#button-play").on("click", function(i) {
  7687. return n.inIframe() && n.isMobile() ? n.valueFromHash("nt", !1) ? window.open(self.location.href, "_blank") : void (top.location.href = self.location.href) : e ? (i.stopPropagation(),
  7688. $("#quick-blackout").removeClass("fadeOut"),
  7689. $("#gui-message").hide(),
  7690. void t()) : void $("#gui-message").fadeOut(500, function() {
  7691. t()
  7692. })
  7693. })
  7694. }
  7695. }
  7696. }
  7697. , {
  7698. "../analytics": 4,
  7699. "../settings": 166,
  7700. "../util/browser": 182
  7701. }],
  7702. 75: [function(e, t, i) {
  7703. "use strict";
  7704. function n(e, t, i, n) {
  7705. function r(e) {
  7706. return e.classList.contains(a)
  7707. }
  7708. var o = i ? this.assets[t][i][this.deviceType] : this.assets[t][this.deviceType];
  7709. for (var a in o) {
  7710. var s = e.find(r);
  7711. for (var l in o[a]) {
  7712. var c = o[a][l];
  7713. if ("top-info" === l || "bottom-info" === l) {
  7714. var h = n ? c : "";
  7715. s.querySelector("." + l).textContent = h
  7716. } else {
  7717. var u = n ? c : ""
  7718. , d = s.querySelector("." + l);
  7719. d.src = u,
  7720. n ? d.classList.remove("hidden") : d.classList.add("hidden")
  7721. }
  7722. }
  7723. }
  7724. var p = Array.prototype.slice.call(e[0].parentElement.querySelectorAll("hr"));
  7725. p.forEach(function(e) {
  7726. n ? e.classList.remove("hidden") : e.classList.add("hidden")
  7727. })
  7728. }
  7729. var r = e("../util/browser")
  7730. , o = e("../localization/localize")
  7731. , a = e("../enum/HelpModalType")
  7732. , s = (e("../enum/HelpModalSize"),
  7733. e("../enum/Viewmode"));
  7734. t.exports = {
  7735. init: function() {
  7736. if (!this.hasInitialized) {
  7737. this.hasInitialized = !0,
  7738. this.deviceType = r.isMobile() ? "mobile" : "desktop",
  7739. this.assets = {},
  7740. this.assets[a.LANDING[s.PANORAMA]] = {
  7741. desktop: {
  7742. left: {
  7743. "top-info": o.ROTATE,
  7744. "big-image": "images/nav_help_mouse_drag_left.png",
  7745. keyboard: "images/nav_help_keyboard_left_right.png"
  7746. },
  7747. middle: {
  7748. "top-info": o.MOVE,
  7749. "big-image": "images/nav_help_mouse_click.png",
  7750. keyboard: "images/nav_help_keyboard_up_down.png"
  7751. },
  7752. right: {
  7753. "top-info": o.ZOOM,
  7754. "big-image": "images/nav_help_mouse_zoom.png",
  7755. keyboard: "images/nav_help_zoom_keys.png"
  7756. }
  7757. },
  7758. mobile: {
  7759. left: {
  7760. "top-info": o.ROTATE,
  7761. "big-image": "images/nav_help_gesture_drag.png"
  7762. },
  7763. middle: {
  7764. "top-info": o.MOVE,
  7765. "big-image": "images/nav_help_gesture_tap.png"
  7766. },
  7767. right: {
  7768. "top-info": o.ZOOM,
  7769. "big-image": "images/nav_help_gesture_pinch.png"
  7770. }
  7771. }
  7772. },
  7773. this.assets[a.LANDING[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.LANDING[s.PANORAMA]])),
  7774. this.assets[a.LANDING[s.DOLLHOUSE]] = {
  7775. desktop: {
  7776. left: {
  7777. "top-info": o.ROTATE,
  7778. "big-image": "images/nav_help_mouse_drag_left.png",
  7779. keyboard: "images/nav_help_keyboard_left_right.png"
  7780. },
  7781. middle: {
  7782. "top-info": o.MOVE,
  7783. "big-image": "images/nav_help_mouse_position_right.png"
  7784. }
  7785. },
  7786. mobile: {
  7787. left: {
  7788. "top-info": o.ROTATE,
  7789. "big-image": "images/nav_help_gesture_drag.png"
  7790. },
  7791. middle: {
  7792. "top-info": o.MOVE,
  7793. "big-image": "images/nav_help_gesture_position_two_finger.png"
  7794. }
  7795. }
  7796. },
  7797. this.assets[a.LANDING[s.FLOORPLAN]] = {
  7798. desktop: {
  7799. left: {
  7800. "top-info": o.MOVE,
  7801. "big-image": "images/nav_help_mouse_position_left.png"
  7802. },
  7803. middle: {
  7804. "top-info": o.ROTATE,
  7805. "big-image": "images/nav_help_mouse_drag_right.png",
  7806. keyboard: "images/nav_help_keyboard_left_right.png"
  7807. }
  7808. },
  7809. mobile: {
  7810. left: {
  7811. "top-info": o.MOVE,
  7812. "big-image": "images/nav_help_gesture_position.png"
  7813. },
  7814. middle: {
  7815. "top-info": o.ROTATE,
  7816. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  7817. }
  7818. }
  7819. };
  7820. var e = {
  7821. "top-info": o.INSIDE,
  7822. "big-image": "images/nav_help_click_inside.png",
  7823. keyboard: "images/nav_help_inside_key.png"
  7824. };
  7825. this.assets[a.LANDING[s.OUTDOOR]].desktop.middle = e,
  7826. this.assets[a.LANDING[s.DOLLHOUSE]].desktop.right = e,
  7827. this.assets[a.LANDING[s.FLOORPLAN]].desktop.right = e;
  7828. var t = {
  7829. "top-info": o.INSIDE,
  7830. "big-image": "images/nav_help_tap_inside.png"
  7831. };
  7832. this.assets[a.LANDING[s.OUTDOOR]].mobile.middle = t,
  7833. this.assets[a.LANDING[s.DOLLHOUSE]].mobile.right = t,
  7834. this.assets[a.LANDING[s.FLOORPLAN]].mobile.right = t,
  7835. this.assets[a.NAVIGATION] = {},
  7836. this.assets[a.NAVIGATION][s.PANORAMA] = {
  7837. desktop: {
  7838. left: {
  7839. "top-info": o.HELP_DESKTOP_PANORAMA_1A,
  7840. "bottom-info": o.HELP_DESKTOP_PANORAMA_1B,
  7841. "big-image": "images/nav_help_mouse_drag_left.png",
  7842. keyboard: "images/nav_help_keyboard_left_right.png"
  7843. },
  7844. middle: {
  7845. "top-info": o.HELP_DESKTOP_PANORAMA_2A,
  7846. "bottom-info": o.HELP_DESKTOP_PANORAMA_2B,
  7847. "big-image": "images/nav_help_mouse_click.png",
  7848. keyboard: "images/nav_help_keyboard_up_down.png"
  7849. },
  7850. right: {
  7851. "top-info": o.HELP_DESKTOP_PANORAMA_3A,
  7852. "bottom-info": o.HELP_DESKTOP_PANORAMA_3B,
  7853. "big-image": "images/nav_help_mouse_zoom.png",
  7854. keyboard: "images/nav_help_zoom_keys.png"
  7855. }
  7856. },
  7857. mobile: {
  7858. left: {
  7859. "top-info": o.HELP_MOBILE_PANORAMA_1,
  7860. "big-image": "images/nav_help_gesture_drag.png"
  7861. },
  7862. middle: {
  7863. "top-info": o.HELP_MOBILE_PANORAMA_2,
  7864. "big-image": "images/nav_help_gesture_tap.png"
  7865. },
  7866. right: {
  7867. "top-info": o.HELP_MOBILE_3,
  7868. "big-image": "images/nav_help_gesture_pinch.png"
  7869. }
  7870. }
  7871. },
  7872. this.assets[a.NAVIGATION][s.DOLLHOUSE] = {
  7873. desktop: {
  7874. left: {
  7875. "top-info": o.HELP_DESKTOP_DOLLHOUSE_1A,
  7876. "bottom-info": o.HELP_DESKTOP_DOLLHOUSE_1B,
  7877. "big-image": "images/nav_help_mouse_drag_left.png",
  7878. keyboard: "images/nav_help_keyboard_all.png"
  7879. },
  7880. middle: {
  7881. "top-info": o.HELP_DESKTOP_DOLLHOUSE_2A,
  7882. "big-image": "images/nav_help_mouse_position_right.png"
  7883. },
  7884. right: {
  7885. "top-info": o.HELP_DESKTOP_DOLLHOUSE_3A,
  7886. "big-image": "images/nav_help_mouse_zoom.png"
  7887. }
  7888. },
  7889. mobile: {
  7890. left: {
  7891. "top-info": o.HELP_MOBILE_DOLLHOUSE_1,
  7892. "big-image": "images/nav_help_gesture_drag.png"
  7893. },
  7894. middle: {
  7895. "top-info": o.HELP_MOBILE_DOLLHOUSE_2,
  7896. "big-image": "images/nav_help_gesture_position_two_finger.png"
  7897. },
  7898. right: {
  7899. "top-info": o.HELP_MOBILE_3,
  7900. "big-image": "images/nav_help_gesture_pinch.png"
  7901. }
  7902. }
  7903. },
  7904. this.assets[a.NAVIGATION][s.FLOORPLAN] = {
  7905. desktop: {
  7906. left: {
  7907. "top-info": o.HELP_DESKTOP_FLOORPLAN_1A,
  7908. "big-image": "images/nav_help_mouse_position_left.png"
  7909. },
  7910. middle: {
  7911. "top-info": o.HELP_DESKTOP_FLOORPLAN_2A,
  7912. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_2B,
  7913. "big-image": "images/nav_help_mouse_drag_right.png",
  7914. keyboard: "images/nav_help_keyboard_left_right.png"
  7915. },
  7916. right: {
  7917. "top-info": o.HELP_DESKTOP_FLOORPLAN_3A,
  7918. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_3B,
  7919. "big-image": "images/nav_help_mouse_zoom.png",
  7920. keyboard: "images/nav_help_keyboard_up_down.png"
  7921. }
  7922. },
  7923. mobile: {
  7924. left: {
  7925. "top-info": o.HELP_MOBILE_FLOORPLAN_1,
  7926. "big-image": "images/nav_help_gesture_position.png"
  7927. },
  7928. middle: {
  7929. "top-info": o.HELP_MOBILE_FLOORPLAN_2,
  7930. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  7931. },
  7932. right: {
  7933. "top-info": o.HELP_MOBILE_3,
  7934. "big-image": "images/nav_help_gesture_pinch.png"
  7935. }
  7936. }
  7937. },
  7938. this.assets[a.NAVIGATION][s.OUTDOOR] = JSON.parse(JSON.stringify(this.assets[a.NAVIGATION][s.PANORAMA])),
  7939. this.assets[a.NAVIGATION][s.OUTDOOR].desktop.middle = {
  7940. "top-info": o.HELP_DESKTOP_360_2A,
  7941. "bottom-info": o.HELP_DESKTOP_360_2B,
  7942. "big-image": "images/nav_help_click_inside.png",
  7943. keyboard: "images/nav_help_inside_key.png"
  7944. },
  7945. this.assets[a.NAVIGATION][s.OUTDOOR].mobile.middle = {
  7946. "top-info": o.HELP_MOBILE_360_2,
  7947. "big-image": "images/nav_help_tap_inside.png"
  7948. },
  7949. this.assets[a.MORE_HELP] = {
  7950. desktop: {
  7951. "more-help-hlr": {
  7952. "top-info": o.HELP_MORE_HLR_A,
  7953. "big-image": "images/nav_help_expand.svg",
  7954. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  7955. },
  7956. "more-help-dollhouse": {
  7957. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  7958. "big-image": "images/nav_help_dollhouse.svg",
  7959. "bottom-info": o.HELP_DESKTOP_MORE_DOLLHOUSE_B
  7960. },
  7961. "more-help-floors": {
  7962. "top-info": o.HELP_MORE_FLOORS_A,
  7963. "big-image": "images/nav_help_floor picker.svg",
  7964. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  7965. },
  7966. "more-help-tag": {
  7967. "top-info": o.HELP_MORE_TAG_A,
  7968. "big-image": "images/nav_help_tag.svg",
  7969. "bottom-info": o.HELP_DESKTOP_MORE_TAG_B
  7970. },
  7971. "more-help-zoom": {
  7972. "top-info": o.HELP_MORE_ZOOM_A,
  7973. "big-image": "images/nav_help_zoom.svg",
  7974. "bottom-info": o.HELP_DESKTOP_MORE_ZOOM_B
  7975. },
  7976. "more-help-tour": {
  7977. "top-info": o.HELP_MORE_TOUR_A,
  7978. "big-image": "images/nav_help_play.png",
  7979. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  7980. },
  7981. "more-help-inside": {
  7982. "top-info": o.HELP_MORE_INSIDE_A,
  7983. "big-image": "images/nav_help_inside.svg",
  7984. "bottom-info": o.HELP_DESKTOP_MORE_INSIDE_B
  7985. },
  7986. "more-help-vr": {
  7987. "top-info": o.HELP_MORE_VR_A,
  7988. "big-image": "images/nav_help_vr.svg",
  7989. "bottom-info": o.HELP_DESKTOP_MORE_VR_B
  7990. },
  7991. "more-help-360": {
  7992. "top-info": o.HELP_MORE_360_A,
  7993. "big-image": "images/nav_help_360.svg",
  7994. "bottom-info": o.HELP_DESKTOP_MORE_360_B
  7995. },
  7996. "more-help-fullscreen": {
  7997. "top-info": o.HELP_MORE_FULLSCREEN_A,
  7998. "big-image": "images/nav_help_fullscreen.svg",
  7999. "bottom-info": o.HELP_DESKTOP_MORE_FULLSCREEN_B
  8000. }
  8001. },
  8002. mobile: {
  8003. "more-help-hlr": {
  8004. "top-info": o.HELP_MORE_HLR_A,
  8005. "big-image": "images/nav_help_expand.svg",
  8006. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  8007. },
  8008. "more-help-dollhouse": {
  8009. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  8010. "big-image": "images/nav_help_dollhouse.svg",
  8011. "bottom-info": o.HELP_MOBILE_MORE_DOLLHOUSE_B
  8012. },
  8013. "more-help-floors": {
  8014. "top-info": o.HELP_MORE_FLOORS_A,
  8015. "big-image": "images/nav_help_floor picker.svg",
  8016. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  8017. },
  8018. "more-help-tag": {
  8019. "top-info": o.HELP_MORE_TAG_A,
  8020. "big-image": "images/nav_help_tag.svg",
  8021. "bottom-info": o.HELP_MOBILE_MORE_TAG_B
  8022. },
  8023. "more-help-tour": {
  8024. "top-info": o.HELP_MORE_TOUR_A,
  8025. "big-image": "images/nav_help_play.png",
  8026. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  8027. },
  8028. "more-help-inside": {
  8029. "top-info": o.HELP_MORE_INSIDE_A,
  8030. "big-image": "images/nav_help_inside.svg",
  8031. "bottom-info": o.HELP_MOBILE_MORE_INSIDE_B
  8032. },
  8033. "more-help-vr": {
  8034. "top-info": o.HELP_MORE_VR_A,
  8035. "big-image": "images/webvr.svg",
  8036. "bottom-info": o.HELP_MOBILE_MORE_VR_B
  8037. },
  8038. "more-help-360": {
  8039. "top-info": o.HELP_MORE_360_A,
  8040. "big-image": "images/nav_help_360.svg",
  8041. "bottom-info": o.HELP_MOBILE_MORE_360_B
  8042. }
  8043. }
  8044. },
  8045. this.assets[a.TOUR_INTERACTION[s.PANORAMA]] = {
  8046. desktop: {
  8047. left: {
  8048. "top-info": o.ROTATE,
  8049. "big-image": "images/nav_help_mouse_drag_left.png",
  8050. keyboard: "images/nav_help_keyboard_left_right.png"
  8051. },
  8052. middle: {
  8053. "top-info": o.MOVE,
  8054. "big-image": "images/nav_help_mouse_click.png",
  8055. keyboard: "images/nav_help_keyboard_up_down.png"
  8056. },
  8057. right: {
  8058. "top-info": o.PLAY,
  8059. "big-image": "images/Desktop-help-play-button.svg",
  8060. keyboard: "images/Desktop-help-spacebar-2.svg"
  8061. }
  8062. },
  8063. mobile: {
  8064. left: {
  8065. "top-info": o.ROTATE,
  8066. "big-image": "images/nav_help_gesture_drag.png"
  8067. },
  8068. middle: {
  8069. "top-info": o.MOVE,
  8070. "big-image": "images/nav_help_gesture_tap.png"
  8071. },
  8072. right: {
  8073. "top-info": o.PLAY,
  8074. "big-image": "images/mobile-help-play-button.svg"
  8075. }
  8076. }
  8077. },
  8078. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.PANORAMA]])),
  8079. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].desktop.middle = this.assets[a.LANDING[s.OUTDOOR]].desktop.middle,
  8080. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].mobile.middle = this.assets[a.LANDING[s.OUTDOOR]].mobile.middle,
  8081. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.OUTDOOR]])),
  8082. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].desktop.left = this.assets[a.LANDING[s.FLOORPLAN]].desktop.left,
  8083. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].mobile.left = this.assets[a.LANDING[s.FLOORPLAN]].mobile.left
  8084. }
  8085. },
  8086. fill: function(e, t, i) {
  8087. n.call(this, e, t, i, !0)
  8088. },
  8089. clear: function(e, t, i) {
  8090. n.call(this, e, t, i, !1)
  8091. }
  8092. }
  8093. }
  8094. , {
  8095. "../enum/HelpModalSize": 27,
  8096. "../enum/HelpModalType": 28,
  8097. "../enum/Viewmode": 51,
  8098. "../localization/localize": 108,
  8099. "../util/browser": 182
  8100. }],
  8101. 76: [function(e, t, i) {
  8102. "use strict";
  8103. t.exports = Object.freeze({
  8104. OPENED: "share.open",
  8105. CLOSED: "share.closed",
  8106. LINK_CLICKED: "share.linked"
  8107. })
  8108. }
  8109. , {}],
  8110. 77: [function(e, t, i) {
  8111. "use strict";
  8112. function n(e) {
  8113. function t(t, i) {
  8114. var n = window.screenY + ($("#player").height() - i) / 2
  8115. , r = window.screenX + ($("#player").width() - t) / 2
  8116. , o = "top=" + n + ",left=" + r + ",width=" + t + ",height=" + i;
  8117. I.emit(l.LINK_CLICKED, {
  8118. channel: e
  8119. }),
  8120. window.open(C[e], "shareWindow", o)
  8121. }
  8122. switch (e) {
  8123. case y.FACEBOOK:
  8124. t(580, 420);
  8125. break;
  8126. case y.TWITTER:
  8127. t(550, 440);
  8128. break;
  8129. case y.MAIL:
  8130. I.emit(l.LINK_CLICKED, {
  8131. channel: "email"
  8132. }),
  8133. window.open(C[e], "_blank");
  8134. break;
  8135. case y.LINKEDIN:
  8136. }
  8137. }
  8138. function r(e) {
  8139. I.emit(l.LINK_CLICKED, {
  8140. channel: "copylink"
  8141. });
  8142. var t = document.createRange();
  8143. t.selectNodeContents(v);
  8144. var i = window.getSelection();
  8145. i.removeAllRanges(),
  8146. i.addRange(t),
  8147. document.execCommand("copy"),
  8148. A.classList.remove("hidden"),
  8149. v.classList.add("highlighted")
  8150. }
  8151. function o(e) {
  8152. e && (e.stopPropagation(),
  8153. e.target === v) || (window.getSelection().removeAllRanges(),
  8154. v.classList.remove("highlighted"),
  8155. A.classList.add("hidden"))
  8156. }
  8157. var a = e("../../util/browser")
  8158. , s = e("../../localization/localize")
  8159. , l = e("./ShareEvents")
  8160. , c = e("../../util/common")
  8161. , h = e("events").EventEmitter
  8162. , u = document.getElementById("sharing")
  8163. , d = document.getElementById("share-modal")
  8164. , p = document.getElementById("share-close")
  8165. , f = document.getElementById("facebook-share")
  8166. , g = document.getElementById("twitter-share")
  8167. , m = document.getElementById("mail-share")
  8168. , v = document.getElementById("share-url-text")
  8169. , A = document.getElementById("copy-success")
  8170. , y = Object.freeze({
  8171. FACEBOOK: "facebook",
  8172. TWITTER: "twitter",
  8173. MAIL: "mail",
  8174. LINKEDIN: "linkedin"
  8175. })
  8176. , C = {};
  8177. C[y.FACEBOOK] = "http://www.facebook.com/sharer.php?u=" + encodeURIComponent(window.location.href + "&utm_source=1") + "&t=",
  8178. C[y.TWITTER] = "http://twitter.com/intent/tweet?text=",
  8179. C[y.MAIL] = "mailto:?subject=";
  8180. var I = {
  8181. init: function(e) {
  8182. var t = encodeURIComponent(s.SHARE_EXPLORE + e + " " + s.SHARE_AT + " ");
  8183. C[y.FACEBOOK] += t + encodeURIComponent(window.location.href + "&utm_source=1"),
  8184. C[y.TWITTER] += t + encodeURIComponent(window.location.href + "&utm_source=2 " + s.SHARE_WITH + " #port"),
  8185. C[y.MAIL] += encodeURIComponent(s.SHARE_EXPLORE + e + s.SHARE_3D) + "&body=" + t + encodeURIComponent(window.location.href + "&utm_source=3"),
  8186. u.addEventListener("click", this.toggle.bind(this)),
  8187. p.addEventListener("click", this.hide.bind(this)),
  8188. v.addEventListener("click", r),
  8189. d.addEventListener("click", o),
  8190. f.addEventListener("click", n.bind(this, y.FACEBOOK)),
  8191. g.addEventListener("click", n.bind(this, y.TWITTER)),
  8192. m.addEventListener("click", n.bind(this, y.MAIL)),
  8193. v.textContent = window.location.href + "&utm_source=4",
  8194. d.classList.add(a.isMobile() ? "mobile" : "desktop"),
  8195. u.classList.remove("hidden")
  8196. },
  8197. show: function() {
  8198. this.emit(l.OPENED),
  8199. d.classList.add("fadeIn")
  8200. },
  8201. hide: function() {
  8202. d.classList.contains("fadeIn") && (this.emit(l.CLOSED),
  8203. document.selection && document.selection.empty(),
  8204. window.getSelection().removeAllRanges(),
  8205. o(),
  8206. d.classList.remove("fadeIn"))
  8207. },
  8208. toggle: function() {
  8209. d.classList.contains("fadeIn") ? this.hide() : this.show()
  8210. }
  8211. };
  8212. c.extendObject(I, h.prototype),
  8213. t.exports = I
  8214. }
  8215. , {
  8216. "../../localization/localize": 108,
  8217. "../../util/browser": 182,
  8218. "../../util/common": 185,
  8219. "./ShareEvents": 76,
  8220. events: 202
  8221. }],
  8222. 78: [function(e, t, i) {
  8223. "use strict";
  8224. t.exports = Object.freeze({
  8225. OPENED: "terms.opened",
  8226. CLOSED: "terms.closed"
  8227. })
  8228. }
  8229. , {}],
  8230. 79: [function(e, t, i) {
  8231. "use strict";
  8232. var n = e("./TermsEvent")
  8233. , r = e("../../localization/localize")
  8234. , o = e("../../analytics")
  8235. , a = e("../../util/ajax")
  8236. , s = e("../../util/common")
  8237. , l = e("events").EventEmitter
  8238. , c = document.getElementById("terms-modal")
  8239. , h = {
  8240. init: function() {
  8241. $(".footer-terms").on("click", function(e) {
  8242. e.preventDefault(),
  8243. this.show()
  8244. }
  8245. .bind(this)),
  8246. $("#terms-modal .close").on("click", this.hide.bind(this))
  8247. },
  8248. show: function() {
  8249. this.emit(n.OPENED),
  8250. a.get("static/" + r.TERMS_TEXT_FILE).done(function(e) {
  8251. var t = $("#terms-text").html(e);
  8252. o.track("showcase_gui", {
  8253. gui_action: "click_terms_button",
  8254. interaction_source: "gui"
  8255. }),
  8256. t.find("a").attr("target", "_blank")
  8257. }).fail(function() {
  8258. $("#terms-text").html("<h1>" + r.TERMS_OF_USE + "</h1><p>" + r.TERMS_FAIL)
  8259. }),
  8260. c.classList.add("fadeIn")
  8261. },
  8262. hide: function(e) {
  8263. e && e.preventDefault(),
  8264. c.classList.contains("fadeIn") && this.emit(n.CLOSED),
  8265. c.classList.remove("fadeIn")
  8266. }
  8267. };
  8268. s.extendObject(h, l.prototype),
  8269. t.exports = h
  8270. }
  8271. , {
  8272. "../../analytics": 4,
  8273. "../../localization/localize": 108,
  8274. "../../util/ajax": 181,
  8275. "../../util/common": 185,
  8276. "./TermsEvent": 78,
  8277. events: 202
  8278. }],
  8279. 80: [function(e, t, i) {
  8280. "use strict";
  8281. t.exports = Object.freeze({
  8282. OPEN_INFO: "title.open.info",
  8283. CLOSE_INFO: "title.close.info",
  8284. SHOW_INFO: "title.show.info",
  8285. HIDE_INFO: "title.hide.info",
  8286. LINK_CLICKED: "title.link.click",
  8287. CONTACT_LINK_CLICKED: "title.contact.click",
  8288. ORIGIN_LINK_CLICKED: "title.origin.click"
  8289. })
  8290. }
  8291. , {}],
  8292. 81: [function(e, t, i) {
  8293. "use strict";
  8294. function n(e, t) {
  8295. o.tags.enabled && 0 !== Object.keys(e.tags).length && r(e, t)
  8296. }
  8297. function r(e, t) {
  8298. function i(i) {
  8299. e.shouldShowtags = "show" === this.value,
  8300. e.shouldShowtags ? t.showAlltags(o.tags.startup.fadeInDuration) : t.hideAlltags(o.tags.startup.fadeInDuration)
  8301. }
  8302. document.getElementById("tag-toggles").classList.remove("hidden"),
  8303. document.getElementById("radio-tag-show").checked = !0;
  8304. for (var n = document.getElementById("tag-inputs").querySelectorAll("input"), r = 0; r < n.length; r++)
  8305. n[r].addEventListener("change", i)
  8306. }
  8307. var o = e("../../settings");
  8308. t.exports.init = n
  8309. }
  8310. , {
  8311. "../../settings": 166
  8312. }],
  8313. 82: [function(e, t, i) {
  8314. (function(i) {
  8315. "use strict";
  8316. function n(e, t) {
  8317. return e && u.valueFromHash("title", 1) && 2 !== u.valueFromHash("mls", 0) ? (document.getElementsByClassName("titleText")[0].innerText = e,
  8318. e.length > g.minTooltipCharacters && I.parentElement.setAttribute("data-original-title", e),
  8319. t && 1 !== m.specialEdition && m.brand && !m.mls ? document.getElementById("cobrandTitle").innerText = t : (document.getElementsByClassName("co-brand")[0].classList.add("hidden"),
  8320. document.getElementById("gui-name").classList.add("noCoBrand"),
  8321. document.getElementById("cobrandTitle").classList.add("hidden")),
  8322. !0) : (document.getElementById("model-title").classList.add("hidden"),
  8323. !1)
  8324. }
  8325. function r(e) {
  8326. return e ? (L = !0,
  8327. void (_.innerText = e)) : void _.classList.add("hidden")
  8328. }
  8329. function o(e, t, i, n) {
  8330. if (!e && !t && !i || !m.brand || u.valueFromHash("mls", !1))
  8331. return void T.classList.add("hidden");
  8332. L = !0;
  8333. var r = []
  8334. , o = c(r, "<br>");
  8335. if (e && o('<span id="contactName">' + e + "</span>"),
  8336. t) {
  8337. var a = n || t
  8338. , s = u.isMobile() ? '<a id="phone" href="callto:' + t + '">' + a + "</a>" : "<span>" + a + "</span>";
  8339. o(s)
  8340. }
  8341. i && o('<a id="email" href="mailTo:' + i + '">' + i + "</a>"),
  8342. r[0] = "",
  8343. x.innerHTML = r.join("")
  8344. }
  8345. function a(e) {
  8346. if ("string" == typeof e)
  8347. try {
  8348. e = JSON.parse(e)
  8349. } catch (e) {
  8350. return y.warn("Unable to parse address data"),
  8351. void S.parentElement.classList.add("hidden")
  8352. }
  8353. if (!(e && (e.address_1 || e.address_2 || e.city || e.state || e.zip)))
  8354. return void S.parentElement.classList.add("hidden");
  8355. L = !0;
  8356. var t = []
  8357. , i = c(t, " ");
  8358. e.address_1 && i(e.address_1),
  8359. e.address_2 && i(e.address_2),
  8360. e.city && i(e.city, ", "),
  8361. e.state && i(e.state, ", "),
  8362. e.zip && i(e.zip, e.state ? " " : ", "),
  8363. t[0] = "",
  8364. S.innerText = t.join("")
  8365. }
  8366. function s(e) {
  8367. var t = document.createElement("a");
  8368. return t.id = "url",
  8369. t.target = "_blank",
  8370. t.href = e,
  8371. t.innerText = e,
  8372. t.addEventListener("click", N.emit.bind(N, v.ORIGIN_LINK_CLICKED)),
  8373. t
  8374. }
  8375. function l(e) {
  8376. return !(!e || u.inIframe() && document.referrer === e) && (R.classList.remove("hidden"),
  8377. P.innerHTML = f.WEBVR_LEARN_MORE + ": ",
  8378. P.appendChild(s(e)),
  8379. O.forEach(function(e) {
  8380. e.classList.add("share-link")
  8381. }),
  8382. !0)
  8383. }
  8384. function c(e, t) {
  8385. var i = e
  8386. , n = t;
  8387. return function(e, t) {
  8388. i.push(t || n, e)
  8389. }
  8390. }
  8391. function h() {
  8392. document.getElementById("title-toggle").addEventListener("click", N.toggleTitle.bind(N)),
  8393. L && I.addEventListener("click", N.toggleMeta.bind(N, !1));
  8394. var e = [].slice.call(_.querySelectorAll("a"));
  8395. e.forEach(function(e) {
  8396. e.addEventListener("click", N.emit.bind(N, v.LINK_CLICKED))
  8397. });
  8398. var t = [].slice.call(T.querySelectorAll("a"));
  8399. t.forEach(function(e) {
  8400. e.addEventListener("click", N.emit.bind(N, v.CONTACT_LINK_CLICKED, {
  8401. contact_type: e.getAttribute("id")
  8402. }))
  8403. })
  8404. }
  8405. var u = e("../../util/browser")
  8406. , d = e("../../util/common")
  8407. , p = e("../../util/logger")
  8408. , f = e("../../localization/localize")
  8409. , g = e("./titleBarSettings")
  8410. , m = e("../../settings")
  8411. , v = e("./TitleEvents")
  8412. , A = e("events").EventEmitter
  8413. , y = new p(i)
  8414. , C = document.querySelector(".pinTop.left")
  8415. , I = document.getElementsByClassName("title-container")[0]
  8416. , E = document.getElementById("title-toggle").querySelector("i")
  8417. , b = document.getElementById("meta-info-wrapper")
  8418. , w = document.getElementById("meta-info")
  8419. , _ = document.getElementById("meta-description")
  8420. , T = document.getElementsByClassName("contact-info")[0]
  8421. , x = document.getElementById("contact-data")
  8422. , S = document.getElementById("addressTxt")
  8423. , M = document.getElementById("tag-toggles")
  8424. , R = document.getElementById("share-origin")
  8425. , P = document.getElementById("share-link-wrapper")
  8426. , O = [w, b, I]
  8427. , L = !1
  8428. , D = !1
  8429. , N = {
  8430. populate: function(e) {
  8431. if (n(e.name, e.coBrand)) {
  8432. if (r(e.description),
  8433. o(e.contactName, e.phone, e.email, e.formatted_contact_phone),
  8434. a(e.address),
  8435. L) {
  8436. var t = document.createElement("br");
  8437. M.insertBefore(t, M.firstElementChild)
  8438. }
  8439. e.socialSharing && m.share.enabled && (D = l(e.url))
  8440. }
  8441. },
  8442. finishSetup: function(e) {
  8443. L = L || !!e,
  8444. h(),
  8445. L || (D ? I.classList.add("share-only") : I.classList.add("no-meta"))
  8446. },
  8447. toggleMeta: function(e, t) {
  8448. t && t.preventDefault();
  8449. var i = w.classList.contains("expand");
  8450. e && !i || (i ? (O.forEach(function(e) {
  8451. e.classList.remove("expand")
  8452. }),
  8453. this.emit(v.CLOSE_INFO)) : (O.forEach(function(e) {
  8454. e.classList.add("expand")
  8455. }),
  8456. this.emit(v.OPEN_INFO)))
  8457. },
  8458. setupToggling: function() {
  8459. b.style.height = w.offsetHeight + "px",
  8460. w.addEventListener("transitionend", function() {
  8461. b.style.height = w.offsetHeight + "px"
  8462. })
  8463. },
  8464. toggleTitle: function(e) {
  8465. e && e.preventDefault(),
  8466. C.classList.contains("closed") ? (C.classList.add("open"),
  8467. E.classList.remove("icon-dpad-right"),
  8468. E.classList.add("icon-dpad-left"),
  8469. this.emit(v.SHOW_INFO),
  8470. setTimeout(function() {
  8471. C.classList.remove("closed"),
  8472. C.classList.remove("open")
  8473. }, g.removeAnimationClasses)) : (C.classList.add("closed"),
  8474. E.classList.remove("icon-dpad-left"),
  8475. E.classList.add("icon-dpad-right"),
  8476. this.emit(v.HIDE_INFO))
  8477. }
  8478. };
  8479. d.extendObject(N, A.prototype),
  8480. t.exports = N
  8481. }
  8482. ).call(this, "/js/gui/title/titleBar.js")
  8483. }
  8484. , {
  8485. "../../localization/localize": 108,
  8486. "../../settings": 166,
  8487. "../../util/browser": 182,
  8488. "../../util/common": 185,
  8489. "../../util/logger": 189,
  8490. "./TitleEvents": 80,
  8491. "./titleBarSettings": 83,
  8492. events: 202
  8493. }],
  8494. 83: [function(e, t, i) {
  8495. "use strict";
  8496. t.exports = Object.freeze({
  8497. minTooltipCharacters: 19,
  8498. removeAnimationClasses: 500
  8499. })
  8500. }
  8501. , {}],
  8502. 84: [function(e, t, i) {
  8503. "use strict";
  8504. function n(e) {
  8505. C = e,
  8506. P.forEach(function(e) {
  8507. b.addEventListener(e, u.bind(this, !1), !0),
  8508. w.addEventListener(e, u.bind(this, !0), !0),
  8509. E.addEventListener(e, o, !0),
  8510. S.forEach(function(t) {
  8511. t.addEventListener(e, a, !0)
  8512. }),
  8513. $("#drawer img").on(e, a)
  8514. }),
  8515. document.addEventListener("keydown", u.bind(this, !1), !0),
  8516. C.on(v.TourStart, function() {
  8517. E.classList.add("playing")
  8518. })
  8519. }
  8520. function r() {
  8521. C.playTour(),
  8522. I && clearTimeout(I),
  8523. d(),
  8524. _.removeClass("fadeIn")
  8525. }
  8526. function o() {
  8527. E.classList.contains("playing") && (C.stopTour(),
  8528. _.addClass("fadeIn"),
  8529. setTimeout(function() {
  8530. _.removeClass("fadeIn")
  8531. }, p.tourInteraction.showPauseButton),
  8532. O || (clearTimeout(I),
  8533. I = setTimeout(h, p.tourInteraction.showModal)),
  8534. setTimeout(function() {
  8535. E.classList.remove("playing")
  8536. }, p.tourInteraction.allowNextClick))
  8537. }
  8538. function a() {
  8539. C.tourInProgress && (C.stopTour(),
  8540. C.endTourProgress(),
  8541. E.classList.remove("playing"))
  8542. }
  8543. function s() {
  8544. T.is(":visible") ? r() : o()
  8545. }
  8546. function l() {
  8547. x.hasClass("playing") && (clearTimeout(I),
  8548. C.atEndOfTour() ? c() : _.removeClass("fadeIn"))
  8549. }
  8550. function c() {
  8551. E.classList.remove("playing"),
  8552. h()
  8553. }
  8554. function h() {
  8555. if (!p.tourInteraction.disabled) {
  8556. M.removeClass("small landing " + g.FLOORPLAN + " " + g.OUTDOOR + " " + g.PANORAMA),
  8557. M.addClass("fadeIn tour " + m.deviceType);
  8558. var e = p.tourInteraction.smallModal ? y.SMALL : y.LARGE;
  8559. if (!p.tourInteraction.smallModal) {
  8560. var t;
  8561. t = C.player.mode === g.PANORAMA && !C.player.currentPano.isAligned() || C.player.mode === g.DOLLHOUSE ? g.OUTDOOR : C.player.mode === g.FLOORPLAN ? g.FLOORPLAN : g.PANORAMA,
  8562. m.fill(R, A.TOUR_INTERACTION[t]),
  8563. M.addClass(t)
  8564. }
  8565. M.addClass(e)
  8566. }
  8567. }
  8568. function u(e, t) {
  8569. if (t) {
  8570. var i = "keydown" === t.type
  8571. , n = t.which === f.SPACE || C.tourIsPlaying;
  8572. i && n || e || (O = !0),
  8573. C.atEndOfTour() && d(),
  8574. !C.tourIsPlaying && C.tourInProgress && (_.removeClass("fadeIn"),
  8575. d(),
  8576. t.which !== f.SPACE && a()),
  8577. i && n && s()
  8578. }
  8579. }
  8580. function d() {
  8581. M.removeClass("fadeIn")
  8582. }
  8583. var p = (e("../util/browser"),
  8584. e("../settings"))
  8585. , f = e("../enum/Keys")
  8586. , g = e("../enum/Viewmode")
  8587. , m = (e("./helpManager"),
  8588. e("./populateModal"))
  8589. , v = e("../enum/DirectorEvents")
  8590. , A = e("../enum/HelpModalType")
  8591. , y = e("../enum/HelpModalSize")
  8592. , C = null
  8593. , I = null
  8594. , E = document.getElementById("pause-overlay")
  8595. , b = document.getElementById("player")
  8596. , w = document.getElementById("gui")
  8597. , _ = $("#pause-icon").eq(0)
  8598. , T = $("#play").eq(0)
  8599. , x = $("#playHead").eq(0)
  8600. , S = $(".rightViewContainer, #previous, #next, #gui-modes-inside, #gui-modes-outside, #gui-modes-dollhouse, #gui-modes-floorplan").toArray()
  8601. , M = $("#interaction-modal").eq(0)
  8602. , R = $("#interaction-modal .interaction").toArray()
  8603. , P = ["touchstart", "mousedown", "pointerdown"]
  8604. , O = !1;
  8605. t.exports.init = n,
  8606. t.exports.play = r,
  8607. t.exports.pause = o,
  8608. t.exports.pauseWithoutCTA = a,
  8609. t.exports.togglePlay = s,
  8610. t.exports.stopTour = l,
  8611. t.exports.dismissModal = d
  8612. }
  8613. , {
  8614. "../enum/DirectorEvents": 23,
  8615. "../enum/HelpModalSize": 27,
  8616. "../enum/HelpModalType": 28,
  8617. "../enum/Keys": 30,
  8618. "../enum/Viewmode": 51,
  8619. "../settings": 166,
  8620. "../util/browser": 182,
  8621. "./helpManager": 68,
  8622. "./populateModal": 75
  8623. }],
  8624. 85: [function(e, t, i) {
  8625. "use strict";
  8626. t.exports = Object.freeze({
  8627. OPENED: "vr.modal.opened",
  8628. LAUNCH: "vr.modal.launch",
  8629. CLOSED: "vr.modal.closed",
  8630. NEXT: "vr.modal.next",
  8631. PREV: "vr.modal.prev",
  8632. STORE: "vr.modal.store",
  8633. falseICECHOSEN: "vr.modal.device"
  8634. })
  8635. }
  8636. , {}],
  8637. 86: [function(e, t, i) {
  8638. "use strict";
  8639. function n(e, t, i) {
  8640. function n(e, t, n, r) {
  8641. function o() {
  8642. return p + "&m=" + t + "&display=" + e
  8643. }
  8644. function s() {
  8645. var e = "&utm_medium=" + (a.inIframe() ? "embed" : "direct")
  8646. , t = "&utm_source=" + u
  8647. , n = "&utm_showcase_session_id=" + i;
  8648. return e + t + n
  8649. }
  8650. function l() {
  8651. return d + "&sids=" + t + "&lsid=" + t + "&ln=" + encodeURIComponent(n) + "&ld=" + encodeURIComponent(r) + "&display=" + e
  8652. }
  8653. return a.valueFromHash("vrcoll", !1) ? l() + s() : o() + s()
  8654. }
  8655. function r(e, t, i, r) {
  8656. var o = "https://api.branch.io/v1/url"
  8657. , a = n(e, t, i, r)
  8658. , s = {
  8659. responseType: "json",
  8660. data: {
  8661. branch_key: h.appConfig.branch_key,
  8662. data: {
  8663. m: t,
  8664. full_url: a,
  8665. $desktop_url: m,
  8666. $og_app_id: "331853976762864119",
  8667. $og_title: i,
  8668. $og_description: r,
  8669. $og_image_url: location.origin + "/api/v1/player/models/" + t + "/thumb",
  8670. $canonical_url: window.location.href
  8671. }
  8672. }
  8673. };
  8674. c.post(o, s).done(function(t) {
  8675. f[e] = t.url
  8676. }).fail(function(t) {
  8677. f[e] = t
  8678. }
  8679. .bind(this, a))
  8680. }
  8681. function o(e, t, i) {
  8682. for (var r in s) {
  8683. var o = s[r]
  8684. , a = n(o, e, t, i);
  8685. f[o] = a
  8686. }
  8687. }
  8688. var u = a.inIframe() ? encodeURIComponent(document.referrer) : encodeURIComponent(window.location.href)
  8689. , d = g + "/vr/dlist/?ret=" + u
  8690. , p = g + "/vr/show/?ret=" + u
  8691. , m = "https://support.port.com/hc/en-us/articles/224728887-What-do-I-need-for-Virtual-Reality";
  8692. switch (e) {
  8693. case l.IOS:
  8694. r(s.CardboardIOS, t.sid, t.name, t.summary);
  8695. break;
  8696. default:
  8697. o(t.sid, t.name, t.summary)
  8698. }
  8699. }
  8700. function r(e) {
  8701. var t = f[e];
  8702. window.open(t, "_blank")
  8703. }
  8704. function o(e) {
  8705. var t = u[e];
  8706. window.open(t, "_blank")
  8707. }
  8708. var a = e("../../util/browser")
  8709. , s = e("../../enum/VRApps")
  8710. , l = e("../../enum/VRPlatforms")
  8711. , c = e("../../util/ajax")
  8712. , h = e("../../settings")
  8713. , u = {};
  8714. u[s.CardboardAndroid] = "https://play.google.com/store/apps/details?id=com.port.mpvrcardboard&redirect_uri=",
  8715. u[s.CardboardIOS] = "https://itunes.apple.com/us/app/port-vr/id1168808473&redirect_uri=",
  8716. u[s.GearVR] = "https://www.oculus.com/experiences/gear-vr/811670972252145/?redirect_uri=";
  8717. for (var d in s) {
  8718. var p = s[d];
  8719. u[p] += encodeURIComponent(document.referrer + "&display=" + p)
  8720. }
  8721. var f = {}
  8722. , g = function() {
  8723. var e = window.location.host;
  8724. return e.indexOf(".port.com") === -1 && e.indexOf("localhost") === -1 && (e = "my.port.com"),
  8725. "https://" + e
  8726. }();
  8727. t.exports.init = n,
  8728. t.exports.launch = r,
  8729. t.exports.launchStore = o
  8730. }
  8731. , {
  8732. "../../enum/VRApps": 46,
  8733. "../../enum/VRPlatforms": 49,
  8734. "../../settings": 166,
  8735. "../../util/ajax": 181,
  8736. "../../util/browser": 182
  8737. }],
  8738. 87: [function(e, t, i) {
  8739. "use strict";
  8740. function n(e) {
  8741. var t;
  8742. switch (e) {
  8743. case m.IOS:
  8744. return t = p.iosVersion(),
  8745. t.major > 9 || 9 === t.major && t.minor >= 1;
  8746. case m.Android:
  8747. return t = p.androidVersion(),
  8748. t.major > 4 || 4 === t.major && t.minor > 4 || 4 === t.major && 4 === t.minor && t.patch >= 4
  8749. }
  8750. return !1
  8751. }
  8752. function r(e, t) {
  8753. function i(e) {
  8754. K.emit(A.STORE, {
  8755. type: e
  8756. }),
  8757. f.launchStore(e)
  8758. }
  8759. function r(e) {
  8760. switch (e !== _.pageCount && (a(e),
  8761. N.text(e + 1 + " / " + _.pageCount)),
  8762. e) {
  8763. case _.Title:
  8764. O.css("display", "none"),
  8765. L.text(u[e]),
  8766. o(s);
  8767. break;
  8768. case _.Cardboard:
  8769. O.css("display", "block"),
  8770. L.text(u[e]),
  8771. M.filter(".cardboard").off(),
  8772. M.filter(".gearvr").off(),
  8773. c(e, s),
  8774. h(H, X, Z);
  8775. break;
  8776. case _.Gear:
  8777. L.text(u[e]),
  8778. c(e, s),
  8779. T.addClass("lastPage"),
  8780. h(G, X, Z);
  8781. break;
  8782. case _.pageCount:
  8783. T.removeClass("fadeIn"),
  8784. K.emit(A.CLOSED)
  8785. }
  8786. B.filter("[src='']").hide()
  8787. }
  8788. var s = function() {
  8789. return p.detectAndroid() ? p.detectAndroidMobile() && n(m.Android) ? (T.addClass("supported"),
  8790. w = ".show-supported",
  8791. m.Android) : (T.addClass("unsupported"),
  8792. w = ".show-unsupported",
  8793. m.UnsupportedAndroid) : p.detectIPhone() || p.detectIPod() ? (T.addClass("ios"),
  8794. w = ".show-ios",
  8795. _ = v.ios,
  8796. m.IOS) : (T.addClass("desktop"),
  8797. w = ".show-desktop",
  8798. m.Desktop)
  8799. }();
  8800. f.init(s, e, t),
  8801. s !== m.Desktop && T.addClass("mobile");
  8802. var l = function(e) {
  8803. K.emit(A.LAUNCH, {
  8804. vr_platform: s,
  8805. vr_app: e
  8806. }),
  8807. f.launch(e)
  8808. };
  8809. q.cardboardAndroid = l.bind(this, g.CardboardAndroid),
  8810. q.gear = l.bind(this, g.GearVR),
  8811. q.cardboardIOS = l.bind(this, g.CardboardIOS),
  8812. d(),
  8813. $(".show-supported, .show-unsupported, .show-ios, .show-desktop").hide(),
  8814. $(w).show();
  8815. var u = [C.VR_LEARN_MORE_CAPS, C.VR_NEXT_CAPS, C.VR_GOT_IT_CAPS]
  8816. , y = ["vr_modal_learn_more", "vr_modal_next", "vr_modal_done"];
  8817. s === m.IOS && (u.splice(1, 1),
  8818. y.splice(1, 1)),
  8819. $("#vr").on("click", function(e) {
  8820. e.preventDefault(),
  8821. T.hasClass("fadeIn") ? K.dismiss() : (b = 0,
  8822. r(b),
  8823. T.addClass("fadeIn"),
  8824. K.emit(A.OPENED))
  8825. });
  8826. var I = "https://my.port.com/vr/show/?m=" + e.sid;
  8827. s === m.IOS ? $(".cardboardLink").on("click", i.bind(this, g.CardboardIOS)) : $(".cardboardLink").on("click", i.bind(this, g.CardboardAndroid)),
  8828. $(".gearLink").on("click", i.bind(this, g.GearVR)),
  8829. $("span.modelLink").text(I),
  8830. O.on("click", function(e) {
  8831. K.emit(A.PREV),
  8832. b--,
  8833. r(b)
  8834. }),
  8835. L.on("click", function(e) {
  8836. L.text();
  8837. K.emit(A.NEXT, {
  8838. nextAction: y[b]
  8839. }),
  8840. b++,
  8841. r(b)
  8842. }),
  8843. T.find(".close").on("click", K.dismiss)
  8844. }
  8845. function o(e) {
  8846. switch (e) {
  8847. case m.Android:
  8848. M.filter(".cardboard").off().on("click", q.cardboardAndroid),
  8849. M.filter(".gearvr").off().on("click", q.gear),
  8850. s(H, G, "logo-button", "same-line");
  8851. break;
  8852. case m.UnsupportedAndroid:
  8853. s("", z, "", "");
  8854. break;
  8855. case m.IOS:
  8856. M.filter(".cardboard").off().on("click", q.cardboardIOS),
  8857. s(H, "", "logo-button", "");
  8858. break;
  8859. case m.Desktop:
  8860. M.filter(".cardboard").off().on("click", l.bind(this, null, F, U)),
  8861. M.filter(".gearvr").off().on("click", l.bind(this, G, V, null)),
  8862. s(H, G, "logo-button", "same-line"),
  8863. Q.cardboard()
  8864. }
  8865. }
  8866. function a(e) {
  8867. $(".p1, .p2, .p3").hide(),
  8868. x.insertAfter(S),
  8869. T.removeClass("front-page"),
  8870. T.removeClass("details-page"),
  8871. T.removeClass("lastPage"),
  8872. M.removeClass("logo-button"),
  8873. M.removeClass("same-line"),
  8874. S.removeClass("headsetOptions"),
  8875. R.attr("src", ""),
  8876. R.filter(".second").removeClass("gear"),
  8877. R.css("display", "inline-block"),
  8878. R.off(),
  8879. P.filter(".second").css("display", ""),
  8880. D.css("display", "none"),
  8881. $(".p" + (e + 1) + w).show(),
  8882. R.filter(".third").insertBefore(P.filter(".third"))
  8883. }
  8884. function s(e, t, i, n) {
  8885. T.addClass("front-page"),
  8886. R.filter(".first").attr("src", e),
  8887. R.filter(".second").attr("src", t),
  8888. M.filter(".first").addClass(i),
  8889. M.filter(".second").addClass(i),
  8890. M.addClass(n),
  8891. ".show-desktop" === w && S.insertAfter(x)
  8892. }
  8893. function l(e, t, i) {
  8894. S.addClass("headsetOptions"),
  8895. M.off(),
  8896. R.filter(".second").attr("src", t),
  8897. D.css("display", "block"),
  8898. P.filter(".second").css("display", "none"),
  8899. D.on("click", function() {
  8900. a(_.Title),
  8901. o(m.Desktop)
  8902. }),
  8903. e && (K.emit(A.falseICECHOSEN, {
  8904. name: g.GearVR
  8905. }),
  8906. R.filter(".first").attr("src", e),
  8907. R.filter(".second").addClass("gear"),
  8908. R.filter(".second").on("click", f.launchStore.bind(this, g.GearVR)),
  8909. Q.gearvr()),
  8910. i && (K.emit(A.falseICECHOSEN, {
  8911. name: g.Cardboard
  8912. }),
  8913. R.filter(".third").attr("src", i),
  8914. R.filter(".third").show(),
  8915. R.filter(".third").insertAfter(R.filter(".second")),
  8916. R.filter(".third").addClass("link"),
  8917. R.filter(".second").addClass("link"),
  8918. R.filter(".second").on("click", f.launchStore.bind(this, g.CardboardIOS)),
  8919. R.filter(".third").on("click", f.launchStore.bind(this, g.CardboardAndroid)),
  8920. Q.cardboard())
  8921. }
  8922. function c(e, t) {
  8923. switch (t) {
  8924. case m.IOS:
  8925. X = Y,
  8926. Z = j;
  8927. break;
  8928. case m.Desktop:
  8929. e === _.Cardboard ? (X = F,
  8930. Z = U,
  8931. R.filter(".second").on("click", f.launchStore.bind(this, g.CardboardIOS)),
  8932. R.filter(".third").on("click", f.launchStore.bind(this, g.CardboardAndroid))) : (X = V,
  8933. R.filter(".second").on("click", f.launchStore.bind(this, g.GearVR)),
  8934. Z = "");
  8935. break;
  8936. default:
  8937. e === _.Cardboard ? (X = z,
  8938. Z = j) : (X = k,
  8939. Z = W)
  8940. }
  8941. }
  8942. function h(e, t, i) {
  8943. T.find(".inner").addClass("details-page"),
  8944. T.addClass("details-page"),
  8945. R.filter(".first").attr("src", e),
  8946. R.filter(".second").attr("src", t),
  8947. R.filter(".third").attr("src", i)
  8948. }
  8949. function u() {
  8950. T.hasClass("fadeIn") && (T.removeClass("fadeIn"),
  8951. K.emit(A.CLOSED))
  8952. }
  8953. function d() {
  8954. var e = p.aspectRatio() > 1 && p.isMobile();
  8955. T.toggleClass("landscape", e).toggleClass("portrait", !e),
  8956. T.toggleClass("tiny", $("#player").height() <= y.narrowLandscapeHeight),
  8957. T.toggleClass("tinier", $("#player").height() <= y.reallyNarrowLandscapeHeight)
  8958. }
  8959. var p = e("../../util/browser")
  8960. , f = e("./vrLink")
  8961. , g = e("../../enum/VRApps")
  8962. , m = e("../../enum/VRPlatforms")
  8963. , v = e("../../enum/VRPages")
  8964. , A = e("./vrEvent")
  8965. , y = (e("../../settings"),
  8966. e("../../constants"))
  8967. , C = e("../../localization/localize")
  8968. , I = e("../../util/common")
  8969. , E = e("events").EventEmitter
  8970. , b = 0
  8971. , w = null
  8972. , _ = v.standard
  8973. , T = $(".vr-popup")
  8974. , x = T.find(".vr-popup-body")
  8975. , S = T.find(".vr-images")
  8976. , M = T.find(".img-container")
  8977. , R = T.find(".vr-sm-image")
  8978. , P = M.find(".vr-img-caption")
  8979. , O = $(".vr-buttons").find(".prev-button")
  8980. , L = $(".vr-buttons").find(".next-button")
  8981. , D = S.find(".front-close")
  8982. , N = $(".vr-page")
  8983. , B = T.find("img")
  8984. , F = "images/apple-store.png"
  8985. , V = "images/badge-oculus.png"
  8986. , U = "images/badge-cardboard.png"
  8987. , k = "images/logo-samsung.png"
  8988. , H = "images/headset-cardboard.png"
  8989. , G = "images/headset-gearvr.png"
  8990. , z = "images/ico-android-robot.png"
  8991. , W = "images/ico-gearvr.png"
  8992. , j = "images/ico-vr.png"
  8993. , Y = "images/apple-logo-white.svg"
  8994. , X = null
  8995. , Z = null
  8996. , q = {}
  8997. , K = {
  8998. init: r,
  8999. dismiss: u,
  9000. isDeviceSupported: n
  9001. };
  9002. I.extendObject(K, E.prototype),
  9003. $(window).resize(d);
  9004. var Q = function() {
  9005. var e = P.filter(".first").find(".cardboard")
  9006. , t = P.filter(".first").find(".gearvr");
  9007. return {
  9008. cardboard: function() {
  9009. t.addClass("hidden"),
  9010. e.removeClass("hidden")
  9011. },
  9012. gearvr: function() {
  9013. e.addClass("hidden"),
  9014. t.removeClass("hidden")
  9015. }
  9016. }
  9017. }();
  9018. t.exports = K
  9019. }
  9020. , {
  9021. "../../constants": 8,
  9022. "../../enum/VRApps": 46,
  9023. "../../enum/VRPages": 48,
  9024. "../../enum/VRPlatforms": 49,
  9025. "../../localization/localize": 108,
  9026. "../../settings": 166,
  9027. "../../util/browser": 182,
  9028. "../../util/common": 185,
  9029. "./vrEvent": 85,
  9030. "./vrLink": 86,
  9031. events: 202
  9032. }],
  9033. 88: [function(e, t, i) {
  9034. "use strict";
  9035. t.exports = Object.freeze({
  9036. OPENED: "webvr.modal.opened",
  9037. SHOW_TERMS: "webvr.footer.show.terms"
  9038. })
  9039. }
  9040. , {}],
  9041. 89: [function(e, t, i) {
  9042. (function(i) {
  9043. "use strict";
  9044. function n(e, t, i, n) {
  9045. function r(e) {
  9046. e.preventDefault(),
  9047. a(e.currentTarget.id)
  9048. }
  9049. function a(e) {
  9050. ne[e](),
  9051. Object.keys(ne).map(function(t, i) {
  9052. $("#" + t).toggleClass("tabs-underlined", t === e)
  9053. })
  9054. }
  9055. y = i,
  9056. v = t,
  9057. w.init(E.Android, e, n),
  9058. m();
  9059. var l = new RegExp("daydream","i")
  9060. , c = l.test(y.displayName);
  9061. c ? (a("tabdaydream"),
  9062. B.filter(".device-headset-side").attr("src", H),
  9063. D.find(".title").text(x.localizeText("WEBVR_FOR_DAYDREAM"))) : (a("tabcardboard"),
  9064. B.filter(".device-headset-side").attr("src", Y),
  9065. D.find(".title").text(x.localizeText("WEBVR_FOR_CARDBOARD"))),
  9066. $("#vr").on("click", function(e) {
  9067. e.preventDefault(),
  9068. g("click_webvr_button"),
  9069. L.is(":hidden") && (ie.emit(_.OPENED),
  9070. o())
  9071. }),
  9072. $(".webvr-popup .close").on("click", function(e) {
  9073. e.preventDefault(),
  9074. D.hasClass("hidden") ? (g("webvr_help_close"),
  9075. p()) : s()
  9076. }),
  9077. $("#tabcardboard").on("click", r),
  9078. $("#tabdaydream").on("click", r),
  9079. $("#tabnative").on("click", r),
  9080. $(".webvr-popup .open-with-app").on("click", function(e) {
  9081. e.preventDefault(),
  9082. g("webvr_learn_more"),
  9083. a("tabnative"),
  9084. p()
  9085. }),
  9086. $(".webvr-popup .help").on("click", function(e) {
  9087. e.preventDefault(),
  9088. g(D.hasClass("hidden") ? "webvr_help_close" : "webvr_help_show"),
  9089. p()
  9090. }),
  9091. $(".webvr-popup .terms").on("click", function(e) {
  9092. e.preventDefault(),
  9093. g("webvr_click_terms"),
  9094. s(),
  9095. ie.emit(_.SHOW_TERMS)
  9096. }),
  9097. F.on("click", function(e) {
  9098. e.preventDefault(),
  9099. g(ee),
  9100. window.open(J, "_blank")
  9101. }),
  9102. V.on("click", function(e) {
  9103. e.preventDefault(),
  9104. g("webvr_phone_link"),
  9105. window.open(te, "_blank")
  9106. }),
  9107. $(".webvr-popup .badge-cardboard").on("click", function(e) {
  9108. e.preventDefault(),
  9109. g("webvr_cardboard_link"),
  9110. w.launch(b.CardboardAndroid)
  9111. }),
  9112. $(".webvr-popup .badge-oculus").on("click", function(e) {
  9113. e.preventDefault(),
  9114. g("webvr_oculus_link"),
  9115. w.launch(b.GearVR)
  9116. })
  9117. }
  9118. function r() {
  9119. function e() {
  9120. y.isPresenting || (f(),
  9121. window.removeEventListener("vrdisplaypresentchange", e))
  9122. }
  9123. R.info("Headset mounted"),
  9124. v.suspend();
  9125. var t = document.createElement("canvas");
  9126. for (t.getContext("webgl"),
  9127. t.className = "webvr-canvas",
  9128. document.bgColor = "#000",
  9129. document.body.style.backgroundColor = "#000"; document.body.firstChild; )
  9130. document.body.removeChild(document.body.firstChild);
  9131. document.body.appendChild(t),
  9132. g("webvr_enter_app"),
  9133. y.requestPresent([{
  9134. source: t,
  9135. predistorted: !0
  9136. }]).catch(function(t) {
  9137. R.error("Failed to present: " + t),
  9138. g("webvr_exit_calibrate"),
  9139. e()
  9140. }),
  9141. A.then(function() {
  9142. window.dispatchEvent(new Event("vrapp-start"))
  9143. }),
  9144. window.addEventListener("vrdisplaypresentchange", e)
  9145. }
  9146. function o() {
  9147. O.fadeOut(I.guiAnimationSpeed),
  9148. L.fadeIn(I.guiAnimationSpeed),
  9149. a()
  9150. }
  9151. function a() {
  9152. if (!A) {
  9153. var e = C.valueFromHash("webvr") || I.appConfig.webvr_version
  9154. , t = "https://static.port.com/webvr/" + e + "/js/main.js";
  9155. A = new Promise(function(e, i) {
  9156. var n = document.createElement("script");
  9157. n.type = "text/javascript",
  9158. n.src = t,
  9159. n.onload = e,
  9160. document.head.appendChild(n)
  9161. }
  9162. )
  9163. }
  9164. D.find(".enter-button").on("click", r)
  9165. }
  9166. function s() {
  9167. g("webvr_modal_close"),
  9168. D.find(".enter-button").off("click", r),
  9169. L.fadeOut(I.guiAnimationSpeed, function() {
  9170. D.toggleClass("hidden", !1),
  9171. N.toggleClass("hidden", !0),
  9172. C.exitFullscreen()
  9173. }),
  9174. O.fadeIn(I.guiAnimationSpeed)
  9175. }
  9176. function l() {
  9177. k.toggleClass("hidden", !1),
  9178. U.toggleClass("hidden", !0)
  9179. }
  9180. function c() {
  9181. k.toggleClass("hidden", !0),
  9182. U.toggleClass("hidden", !1)
  9183. }
  9184. function h() {
  9185. B.filter(".device-headset").attr("src", G),
  9186. B.filter(".device-phone").attr("src", z),
  9187. J = Z,
  9188. ee = K,
  9189. F.text(x.localizeText("WEBVR_DAYDREAM_VIEW")),
  9190. V.text(x.localizeText("VR_NEED_DAYDREAM_PHONE")),
  9191. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !1),
  9192. c()
  9193. }
  9194. function u() {
  9195. B.filter(".badge-cardboard").attr("src", j),
  9196. B.filter(".badge-oculus").attr("src", X),
  9197. l()
  9198. }
  9199. function d() {
  9200. B.filter(".device-headset").attr("src", Y),
  9201. B.filter(".device-phone").attr("src", W),
  9202. J = q,
  9203. ee = Q,
  9204. F.text(x.localizeText("VR_GOOGLE_CARDBOARD")),
  9205. V.text(x.localizeText("VR_COMPATIBLE_ANDROID_LONG")),
  9206. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !0),
  9207. c()
  9208. }
  9209. function p() {
  9210. D.toggleClass("hidden"),
  9211. N.toggleClass("hidden")
  9212. }
  9213. function f() {
  9214. R.info("exiting webVR"),
  9215. g("webvr_exit_app"),
  9216. window.location.search.indexOf("&qs=1") === -1 ? window.location = window.location + "&qs=1" : window.location = window.location
  9217. }
  9218. function g(e) {
  9219. var t = C.isLandscape() ? "landscape" : "portrait";
  9220. T.trackAlways("showcase_gui", {
  9221. gui_action: e,
  9222. orientation: t
  9223. })
  9224. }
  9225. function m() {
  9226. var e = C.isLandscape();
  9227. L.toggleClass("landscape", e).toggleClass("portrait", !e)
  9228. }
  9229. var v, A, y, C = e("../../util/browser"), I = e("../../settings"), E = (e("./../gui"),
  9230. e("../../enum/VRPlatforms")), b = e("../../enum/VRApps"), w = e("./../vr/vrLink"), _ = e("./WebVrEvent"), T = e("../../analytics"), x = (e("../../constants"),
  9231. e("../../localization/localize")), S = e("../../util/common"), M = e("../../util/logger"), R = new M(i), P = e("events").EventEmitter, O = $("#gui"), L = $(".webvr-popup"), D = $(".webvr-popup .page.p1"), N = $(".webvr-popup .page.p2"), B = L.find(".image"), F = $(".webvr-popup .detail.headset"), V = $(".webvr-popup .detail.phone"), U = $(".webvr-popup .tab-content.webvr"), k = $(".webvr-popup .tab-content.native"), H = "images/device-daydream-side.png", G = "images/device-daydream.png", z = "images/device-pixel.png", W = "images/ico-android-robot.png", j = "images/badge-cardboard.png", Y = "images/headset-cardboard.png", X = "images/badge-oculus.png", Z = "https://madeby.google.com/vr/", q = "https://vr.google.com/cardboard/get-cardboard/", K = "webvr_daydream_link", Q = "webvr_cardboard_link", J = Z, ee = K, te = "https://vr.google.com/daydream/phones/", ie = {
  9232. init: n
  9233. }, ne = {
  9234. tabcardboard: d,
  9235. tabdaydream: h,
  9236. tabnative: u
  9237. };
  9238. S.extendObject(ie, P.prototype),
  9239. $(window).resize(m),
  9240. t.exports = ie
  9241. }
  9242. ).call(this, "/js/gui/webvr/webVRgui.js")
  9243. }
  9244. , {
  9245. "../../analytics": 4,
  9246. "../../constants": 8,
  9247. "../../enum/VRApps": 46,
  9248. "../../enum/VRPlatforms": 49,
  9249. "../../localization/localize": 108,
  9250. "../../settings": 166,
  9251. "../../util/browser": 182,
  9252. "../../util/common": 185,
  9253. "../../util/logger": 189,
  9254. "./../gui": 65,
  9255. "./../vr/vrLink": 86,
  9256. "./WebVrEvent": 88,
  9257. events: 202
  9258. }],
  9259. 90: [function(e, t, i) {
  9260. "use strict";
  9261. function n(e, t, i, n, o) {
  9262. n || 0 === n ? this.floorId = n : this.floorId = -1,
  9263. this.roomId = o || "",
  9264. this.labelId = e,
  9265. this.position = (new r.Vector3).copy(t),
  9266. this.text = i
  9267. }
  9268. var r = e("three")
  9269. , o = e("../util/browser");
  9270. n.prototype.build = function() {
  9271. var e = window.document.createElement("div");
  9272. o.isMobile() ? e.setAttribute("class", "gui-floorplan-label gui-floorplan-label-mobile") : e.setAttribute("class", "gui-floorplan-label");
  9273. var t = window.document.createElement("div");
  9274. t.setAttribute("class", "gui-floorplan-label-text");
  9275. var i = window.document.createTextNode(this.text);
  9276. t.appendChild(i),
  9277. e.appendChild(t),
  9278. window.document.body.appendChild(e),
  9279. this.labelGui = e,
  9280. this.textBlock = t,
  9281. $(this.labelGui).hide();
  9282. var n = window.getComputedStyle(this.labelGui);
  9283. this.initialTransform = n.transform || n.webkitTransform
  9284. }
  9285. ,
  9286. t.exports = n
  9287. }
  9288. , {
  9289. "../util/browser": 182,
  9290. three: 217
  9291. }],
  9292. 91: [function(e, t, i) {
  9293. "use strict";
  9294. function n() {
  9295. this.player = null,
  9296. this.modelManager = null,
  9297. this.container = null
  9298. }
  9299. var r = e("three")
  9300. , o = (e("../util/common"),
  9301. e("../enum/PlayerEvents"))
  9302. , a = (e("../enum/DirectorEvents"),
  9303. e("../enum/ModelManagerEvents"))
  9304. , s = e("../settings")
  9305. , l = e("../enum/Viewmode")
  9306. , c = (e("../enum/WarpStyle"),
  9307. e("../util/transitions"),
  9308. e("../util/lerp"),
  9309. e("../util/browser"));
  9310. n.prototype.init = function(e, t, i) {
  9311. this.player = e,
  9312. this.modelManager = t,
  9313. this.container = i,
  9314. this.updateModel(),
  9315. this.bindEvents()
  9316. }
  9317. ,
  9318. n.prototype.bindEvents = function() {
  9319. this.modelManager.on(a.ActiveModelChanged, this.updateModel.bind(this)),
  9320. this.player.on(o.ViewChanged, this.handlePlayerViewChanged.bind(this)),
  9321. this.player.on(o.ModeChanged, this.handlePlayerViewChanged.bind(this)),
  9322. this.player.on(o.StartInside, this.handleStartInside.bind(this)),
  9323. this.player.on(o.StartOutside, this.handleStartOutside.bind(this))
  9324. }
  9325. ,
  9326. n.prototype.updateModel = function() {
  9327. this.model = this.modelManager.getActiveModel()
  9328. }
  9329. ,
  9330. n.prototype.handlePlayerViewChanged = function() {
  9331. this.updateLabelVisibility(),
  9332. this.updateLabelDisplay()
  9333. }
  9334. ,
  9335. n.prototype.getLabelsForFloor = function(e, t) {
  9336. return t = t || [],
  9337. t.length = 0,
  9338. this.model.labels.forEach(function(i) {
  9339. this.labelVisibleForFloor(i, e) && t.push(i)
  9340. }
  9341. .bind(this)),
  9342. t
  9343. }
  9344. ,
  9345. n.prototype.getLabelsForCurrentFloor = function(e) {
  9346. return this.getLabelsForFloor(this.model.currentFloor.floorIndex, e)
  9347. }
  9348. ,
  9349. n.prototype.labelVisibleForFloor = function(e, t) {
  9350. var i = c.isMobile() && this.player.getLabelScaleFactor() < s.labels.zoomHideThreshhold.mobile || !c.isMobile() && this.player.getLabelScaleFactor() < s.labels.zoomHideThreshhold.desktop;
  9351. if (!this.model.showingLabels || !e.labelGui || !i)
  9352. return !1;
  9353. var n = e.floorId === this.model.floors.size() - 1;
  9354. return this.model.allFloorsVisible ? n : e.floorId === t
  9355. }
  9356. ,
  9357. n.prototype.updateLabelVisibility = function(e) {
  9358. this.model.labels.forEach(function(e) {
  9359. this.supportedMode() && this.labelVisibleForFloor(e, this.model.currentFloor.floorIndex) ? this.showLabel(e, s.labels.fadeInDelay, s.labels.fadeInDuration) : this.hideLabel(e, s.labels.fadeOutDelay, s.labels.fadeOutDuration)
  9360. }
  9361. .bind(this))
  9362. }
  9363. ,
  9364. n.prototype.showAllLabels = function(e, t) {
  9365. this.model.labels.forEach(function(i) {
  9366. this.showLabel(i, e, t)
  9367. }
  9368. .bind(this))
  9369. }
  9370. ,
  9371. n.prototype.hideAllLabels = function(e, t) {
  9372. this.model.labels.forEach(function(i) {
  9373. this.hideLabel(i, e, t)
  9374. }
  9375. .bind(this))
  9376. }
  9377. ,
  9378. n.prototype.showLabel = function(e, t, i) {
  9379. this.model.showingLabels && (e.visible || (e.visible = !0,
  9380. e.labelGui.style.display = "block",
  9381. e.labelGui.style.opacity = 0,
  9382. $(e.labelGui).delay(t).fadeTo(i, 1)))
  9383. }
  9384. ,
  9385. n.prototype.hideLabel = function(e, t, i) {
  9386. e.visible && (e.visible = !1,
  9387. c.isMobile() ? $(e.labelGui).hide() : $(e.labelGui).delay(t).fadeOut(i))
  9388. }
  9389. ,
  9390. n.prototype.supportedMode = function() {
  9391. return this.player.mode === l.FLOORPLAN
  9392. }
  9393. ,
  9394. n.prototype.updateLabelDisplay = function() {
  9395. var e = (new r.Vector3,
  9396. new r.Vector3,
  9397. []);
  9398. return function() {
  9399. var t = this.player.getLabelScaleFactor()
  9400. , i = .6
  9401. , n = 1.2
  9402. , r = (1 - t) * n + i
  9403. , o = c.isMobile() ? s.labels.zoomTruncateThreshhold.mobile : s.labels.zoomTruncateThreshhold.desktop;
  9404. this.getLabelsForCurrentFloor(e);
  9405. for (var a = 0; a < e.length; a++) {
  9406. var l = e[a];
  9407. this.supportedMode() && l.labelGui && (this.updateProjectedGuiElement(l.labelGui, l.textBlock, l.position, r, r),
  9408. t >= o && l.text.length >= s.labels.minLengthForTruncate ? l.textBlock.innerText = l.text.substring(0, s.labels.truncateLength) + s.labels.truncateSuffix : l.textBlock.innerText = l.text)
  9409. }
  9410. }
  9411. }(),
  9412. n.prototype.updateProjectedGuiElement = function() {
  9413. var e = new r.Vector3;
  9414. new r.Vector3;
  9415. return function(t, i, n, r, o) {
  9416. i.style.fontSize = 100 * o + "%";
  9417. var a = $("#player").width()
  9418. , s = $("#player").height()
  9419. , l = .5 * a
  9420. , c = .5 * s;
  9421. e.copy(n),
  9422. e.project(this.player.camera);
  9423. var h = e.x * l + l
  9424. , u = -(e.y * c) + c;
  9425. h -= t.offsetWidth / 2,
  9426. u -= t.offsetHeight / 2,
  9427. t.style.left = h + "px",
  9428. t.style.top = u + "px"
  9429. }
  9430. }(),
  9431. n.prototype.handleStartInside = function(e) {
  9432. this.updateLabelVisibility()
  9433. }
  9434. ,
  9435. n.prototype.handleStartOutside = function() {
  9436. this.updateLabelVisibility()
  9437. }
  9438. ,
  9439. t.exports = n
  9440. }
  9441. , {
  9442. "../enum/DirectorEvents": 23,
  9443. "../enum/ModelManagerEvents": 33,
  9444. "../enum/PlayerEvents": 40,
  9445. "../enum/Viewmode": 51,
  9446. "../enum/WarpStyle": 52,
  9447. "../settings": 166,
  9448. "../util/browser": 182,
  9449. "../util/common": 185,
  9450. "../util/lerp": 188,
  9451. "../util/transitions": 195,
  9452. three: 217
  9453. }],
  9454. 92: [function(e, t, i) {
  9455. "use strict";
  9456. Array.prototype.findIndex || (Array.prototype.findIndex = function(e) {
  9457. if (null == this)
  9458. throw new TypeError("Array.prototype.findIndex called on null or undefined");
  9459. if ("function" != typeof e)
  9460. throw new TypeError("predicate must be a function");
  9461. for (var t, i = Object(this), n = i.length >>> 0, r = arguments[1], o = 0; o < n; o++)
  9462. if (t = i[o],
  9463. e.call(r, t, o, i))
  9464. return o;
  9465. return -1
  9466. }
  9467. ),
  9468. Array.prototype.find || Object.defineProperty(Array.prototype, "find", {
  9469. value: function(e) {
  9470. if (null == this)
  9471. throw new TypeError('"this" is null or not defined');
  9472. var t = Object(this)
  9473. , i = t.length >>> 0;
  9474. if ("function" != typeof e)
  9475. throw new TypeError("predicate must be a function");
  9476. for (var n = arguments[1], r = 0; r < i; ) {
  9477. var o = t[r];
  9478. if (e.call(n, o, r, t))
  9479. return o;
  9480. r++
  9481. }
  9482. }
  9483. })
  9484. }
  9485. , {}],
  9486. 93: [function(e, t, i) {
  9487. "use strict";
  9488. var n = n || {};
  9489. t.exports = n,
  9490. n.gui = n.gui || {},
  9491. n.utils = n.utils || {},
  9492. n.controllers = n.controllers || {},
  9493. n.dom = n.dom || {},
  9494. n.color = n.color || {},
  9495. n.utils.css = function() {
  9496. return {
  9497. load: function(e, t) {
  9498. t = t || document;
  9499. var i = t.createElement("link");
  9500. i.type = "text/css",
  9501. i.rel = "stylesheet",
  9502. i.href = e,
  9503. t.getElementsByTagName("head")[0].appendChild(i)
  9504. },
  9505. inject: function(e, t) {
  9506. t = t || document;
  9507. var i = document.createElement("style");
  9508. i.type = "text/css",
  9509. i.innerHTML = e,
  9510. t.getElementsByTagName("head")[0].appendChild(i)
  9511. }
  9512. }
  9513. }(),
  9514. n.utils.common = function() {
  9515. var e = Array.prototype.forEach
  9516. , t = Array.prototype.slice;
  9517. return {
  9518. BREAK: {},
  9519. extend: function(e) {
  9520. return this.each(t.call(arguments, 1), function(t) {
  9521. for (var i in t)
  9522. this.isUndefined(t[i]) || (e[i] = t[i])
  9523. }, this),
  9524. e
  9525. },
  9526. defaults: function(e) {
  9527. return this.each(t.call(arguments, 1), function(t) {
  9528. for (var i in t)
  9529. this.isUndefined(e[i]) && (e[i] = t[i])
  9530. }, this),
  9531. e
  9532. },
  9533. compose: function() {
  9534. var e = t.call(arguments);
  9535. return function() {
  9536. for (var i = t.call(arguments), n = e.length - 1; n >= 0; n--)
  9537. i = [e[n].apply(this, i)];
  9538. return i[0]
  9539. }
  9540. },
  9541. each: function(t, i, n) {
  9542. if (t)
  9543. if (e && t.forEach && t.forEach === e)
  9544. t.forEach(i, n);
  9545. else if (t.length === t.length + 0) {
  9546. for (var r = 0, o = t.length; r < o; r++)
  9547. if (r in t && i.call(n, t[r], r) === this.BREAK)
  9548. return
  9549. } else
  9550. for (var r in t)
  9551. if (i.call(n, t[r], r) === this.BREAK)
  9552. return
  9553. },
  9554. defer: function(e) {
  9555. setTimeout(e, 0)
  9556. },
  9557. toArray: function(e) {
  9558. return e.toArray ? e.toArray() : t.call(e)
  9559. },
  9560. isUndefined: function(e) {
  9561. return void 0 === e
  9562. },
  9563. isNull: function(e) {
  9564. return null === e
  9565. },
  9566. isNaN: function(e) {
  9567. return e !== e
  9568. },
  9569. isArray: Array.isArray || function(e) {
  9570. return e.constructor === Array
  9571. }
  9572. ,
  9573. isObject: function(e) {
  9574. return e === Object(e)
  9575. },
  9576. isNumber: function(e) {
  9577. return e === e + 0
  9578. },
  9579. isString: function(e) {
  9580. return e === e + ""
  9581. },
  9582. isBoolean: function(e) {
  9583. return e === !1 || e === !0
  9584. },
  9585. isFunction: function(e) {
  9586. return "[object Function]" === Object.prototype.toString.call(e)
  9587. }
  9588. }
  9589. }(),
  9590. n.controllers.Controller = function(e) {
  9591. var t = function(e, t) {
  9592. this.initialValue = e[t],
  9593. this.domElement = document.createElement("div"),
  9594. this.object = e,
  9595. this.property = t,
  9596. this.__onChange = void 0,
  9597. this.__onFinishChange = void 0
  9598. };
  9599. return e.extend(t.prototype, {
  9600. onChange: function(e) {
  9601. return this.__onChange = e,
  9602. this
  9603. },
  9604. onFinishChange: function(e) {
  9605. return this.__onFinishChange = e,
  9606. this
  9607. },
  9608. setValue: function(e) {
  9609. return this.object[this.property] = e,
  9610. this.__onChange && this.__onChange.call(this, e),
  9611. this.updateDisplay(),
  9612. this
  9613. },
  9614. getValue: function() {
  9615. return this.object[this.property]
  9616. },
  9617. updateDisplay: function() {
  9618. return this
  9619. },
  9620. isModified: function() {
  9621. return this.initialValue !== this.getValue()
  9622. }
  9623. }),
  9624. t
  9625. }(n.utils.common),
  9626. n.dom.dom = function(e) {
  9627. function t(t) {
  9628. if ("0" === t || e.isUndefined(t))
  9629. return 0;
  9630. var i = t.match(r);
  9631. return e.isNull(i) ? 0 : parseFloat(i[1])
  9632. }
  9633. var i = {
  9634. HTMLEvents: ["change"],
  9635. MouseEvents: ["click", "mousemove", "mousedown", "mouseup", "mouseover"],
  9636. KeyboardEvents: ["keydown"]
  9637. }
  9638. , n = {};
  9639. e.each(i, function(t, i) {
  9640. e.each(t, function(e) {
  9641. n[e] = i
  9642. })
  9643. });
  9644. var r = /(\d+(\.\d+)?)px/
  9645. , o = {
  9646. makeSelectable: function(e, t) {
  9647. void 0 !== e && void 0 !== e.style && (e.onselectstart = t ? function() {
  9648. return !1
  9649. }
  9650. : function() {}
  9651. ,
  9652. e.style.MozUserSelect = t ? "auto" : "none",
  9653. e.style.KhtmlUserSelect = t ? "auto" : "none",
  9654. e.unselectable = t ? "on" : "off")
  9655. },
  9656. makeFullscreen: function(t, i, n) {
  9657. e.isUndefined(i) && (i = !0),
  9658. e.isUndefined(n) && (n = !0),
  9659. t.style.position = "absolute",
  9660. i && (t.style.left = 0,
  9661. t.style.right = 0),
  9662. n && (t.style.top = 0,
  9663. t.style.bottom = 0)
  9664. },
  9665. fakeEvent: function(t, i, r, o) {
  9666. r = r || {};
  9667. var a = n[i];
  9668. if (!a)
  9669. throw new Error("Event type " + i + " not supported.");
  9670. var s = document.createEvent(a);
  9671. switch (a) {
  9672. case "MouseEvents":
  9673. var l = r.x || r.clientX || 0
  9674. , c = r.y || r.clientY || 0;
  9675. s.initMouseEvent(i, r.bubbles || !1, r.cancelable || !0, window, r.clickCount || 1, 0, 0, l, c, !1, !1, !1, !1, 0, null);
  9676. break;
  9677. case "KeyboardEvents":
  9678. var h = s.initKeyboardEvent || s.initKeyEvent;
  9679. e.defaults(r, {
  9680. cancelable: !0,
  9681. ctrlKey: !1,
  9682. altKey: !1,
  9683. shiftKey: !1,
  9684. metaKey: !1,
  9685. keyCode: void 0,
  9686. charCode: void 0
  9687. }),
  9688. h(i, r.bubbles || !1, r.cancelable, window, r.ctrlKey, r.altKey, r.shiftKey, r.metaKey, r.keyCode, r.charCode);
  9689. break;
  9690. default:
  9691. s.initEvent(i, r.bubbles || !1, r.cancelable || !0)
  9692. }
  9693. e.defaults(s, o),
  9694. t.dispatchEvent(s)
  9695. },
  9696. bind: function(e, t, i, n) {
  9697. return n = n || !1,
  9698. e.addEventListener ? e.addEventListener(t, i, n) : e.attachEvent && e.attachEvent("on" + t, i),
  9699. o
  9700. },
  9701. unbind: function(e, t, i, n) {
  9702. return n = n || !1,
  9703. e.removeEventListener ? e.removeEventListener(t, i, n) : e.detachEvent && e.detachEvent("on" + t, i),
  9704. o
  9705. },
  9706. addClass: function(e, t) {
  9707. if (void 0 === e.className)
  9708. e.className = t;
  9709. else if (e.className !== t) {
  9710. var i = e.className.split(/ +/);
  9711. i.indexOf(t) == -1 && (i.push(t),
  9712. e.className = i.join(" ").replace(/^\s+/, "").replace(/\s+$/, ""))
  9713. }
  9714. return o
  9715. },
  9716. removeClass: function(e, t) {
  9717. if (t)
  9718. if (void 0 === e.className)
  9719. ;
  9720. else if (e.className === t)
  9721. e.removeAttribute("class");
  9722. else {
  9723. var i = e.className.split(/ +/)
  9724. , n = i.indexOf(t);
  9725. n != -1 && (i.splice(n, 1),
  9726. e.className = i.join(" "))
  9727. }
  9728. else
  9729. e.className = void 0;
  9730. return o
  9731. },
  9732. hasClass: function(e, t) {
  9733. return new RegExp("(?:^|\\s+)" + t + "(?:\\s+|$)").test(e.className) || !1
  9734. },
  9735. getWidth: function(e) {
  9736. var i = getComputedStyle(e);
  9737. return t(i["border-left-width"]) + t(i["border-right-width"]) + t(i["padding-left"]) + t(i["padding-right"]) + t(i.width)
  9738. },
  9739. getHeight: function(e) {
  9740. var i = getComputedStyle(e);
  9741. return t(i["border-top-width"]) + t(i["border-bottom-width"]) + t(i["padding-top"]) + t(i["padding-bottom"]) + t(i.height)
  9742. },
  9743. getOffset: function(e) {
  9744. var t = {
  9745. left: 0,
  9746. top: 0
  9747. };
  9748. if (e.offsetParent)
  9749. do
  9750. t.left += e.offsetLeft,
  9751. t.top += e.offsetTop;
  9752. while (e = e.offsetParent);return t
  9753. },
  9754. isActive: function(e) {
  9755. return e === document.activeElement && (e.type || e.href)
  9756. }
  9757. };
  9758. return o
  9759. }(n.utils.common),
  9760. n.controllers.OptionController = function(e, t, i) {
  9761. var n = function(e, r, o) {
  9762. n.superclass.call(this, e, r);
  9763. var a = this;
  9764. if (this.__select = document.createElement("select"),
  9765. i.isArray(o)) {
  9766. var s = {};
  9767. i.each(o, function(e) {
  9768. s[e] = e
  9769. }),
  9770. o = s
  9771. }
  9772. i.each(o, function(e, t) {
  9773. var i = document.createElement("option");
  9774. i.innerHTML = t,
  9775. i.setAttribute("value", e),
  9776. a.__select.appendChild(i)
  9777. }),
  9778. this.updateDisplay(),
  9779. t.bind(this.__select, "change", function() {
  9780. var e = this.options[this.selectedIndex].value;
  9781. a.setValue(e)
  9782. }),
  9783. this.domElement.appendChild(this.__select)
  9784. };
  9785. return n.superclass = e,
  9786. i.extend(n.prototype, e.prototype, {
  9787. setValue: function(e) {
  9788. var t = n.superclass.prototype.setValue.call(this, e);
  9789. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  9790. t
  9791. },
  9792. updateDisplay: function() {
  9793. return this.__select.value = this.getValue(),
  9794. n.superclass.prototype.updateDisplay.call(this)
  9795. }
  9796. }),
  9797. n
  9798. }(n.controllers.Controller, n.dom.dom, n.utils.common),
  9799. n.controllers.NumberController = function(e, t) {
  9800. function i(e) {
  9801. return e = e.toString(),
  9802. e.indexOf(".") > -1 ? e.length - e.indexOf(".") - 1 : 0
  9803. }
  9804. var n = function(e, r, o) {
  9805. n.superclass.call(this, e, r),
  9806. o = o || {},
  9807. this.__min = o.min,
  9808. this.__max = o.max,
  9809. this.__step = o.step,
  9810. t.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,
  9811. this.__precision = i(this.__impliedStep)
  9812. };
  9813. return n.superclass = e,
  9814. t.extend(n.prototype, e.prototype, {
  9815. setValue: function(e) {
  9816. return void 0 !== this.__min && e < this.__min ? e = this.__min : void 0 !== this.__max && e > this.__max && (e = this.__max),
  9817. void 0 !== this.__step && e % this.__step != 0 && (e = Math.round(e / this.__step) * this.__step),
  9818. n.superclass.prototype.setValue.call(this, e)
  9819. },
  9820. min: function(e) {
  9821. return this.__min = e,
  9822. this
  9823. },
  9824. max: function(e) {
  9825. return this.__max = e,
  9826. this
  9827. },
  9828. step: function(e) {
  9829. return this.__step = e,
  9830. this.__impliedStep = e,
  9831. this.__precision = i(e),
  9832. this
  9833. }
  9834. }),
  9835. n
  9836. }(n.controllers.Controller, n.utils.common),
  9837. n.controllers.NumberControllerBox = function(e, t, i) {
  9838. function n(e, t) {
  9839. var i = Math.pow(10, t);
  9840. return Math.round(e * i) / i
  9841. }
  9842. var r = function(e, n, o) {
  9843. function a() {
  9844. var e = parseFloat(d.__input.value);
  9845. i.isNaN(e) || d.setValue(e)
  9846. }
  9847. function s() {
  9848. a(),
  9849. d.__onFinishChange && d.__onFinishChange.call(d, d.getValue())
  9850. }
  9851. function l(e) {
  9852. t.bind(window, "mousemove", c),
  9853. t.bind(window, "mouseup", h),
  9854. u = e.clientY
  9855. }
  9856. function c(e) {
  9857. var t = u - e.clientY;
  9858. d.setValue(d.getValue() + t * d.__impliedStep),
  9859. u = e.clientY
  9860. }
  9861. function h() {
  9862. t.unbind(window, "mousemove", c),
  9863. t.unbind(window, "mouseup", h)
  9864. }
  9865. this.__truncationSuspended = !1,
  9866. r.superclass.call(this, e, n, o);
  9867. var u, d = this;
  9868. this.__input = document.createElement("input"),
  9869. this.__input.setAttribute("type", "text"),
  9870. t.bind(this.__input, "change", a),
  9871. t.bind(this.__input, "blur", s),
  9872. t.bind(this.__input, "mousedown", l),
  9873. t.bind(this.__input, "keydown", function(e) {
  9874. 13 === e.keyCode && (d.__truncationSuspended = !0,
  9875. this.blur(),
  9876. d.__truncationSuspended = !1)
  9877. }),
  9878. this.updateDisplay(),
  9879. this.domElement.appendChild(this.__input)
  9880. };
  9881. return r.superclass = e,
  9882. i.extend(r.prototype, e.prototype, {
  9883. updateDisplay: function() {
  9884. return this.__input.value = this.__truncationSuspended ? this.getValue() : n(this.getValue(), this.__precision),
  9885. r.superclass.prototype.updateDisplay.call(this)
  9886. }
  9887. }),
  9888. r
  9889. }(n.controllers.NumberController, n.dom.dom, n.utils.common),
  9890. n.controllers.NumberControllerSlider = function(e, t, i, n, r) {
  9891. function o(e, t, i, n, r) {
  9892. return n + (r - n) * ((e - t) / (i - t))
  9893. }
  9894. var a = function(e, i, n, r, s) {
  9895. function l(e) {
  9896. t.bind(window, "mousemove", c),
  9897. t.bind(window, "mouseup", h),
  9898. c(e)
  9899. }
  9900. function c(e) {
  9901. e.preventDefault();
  9902. var i = t.getOffset(u.__background)
  9903. , n = t.getWidth(u.__background);
  9904. return u.setValue(o(e.clientX, i.left, i.left + n, u.__min, u.__max)),
  9905. !1
  9906. }
  9907. function h() {
  9908. t.unbind(window, "mousemove", c),
  9909. t.unbind(window, "mouseup", h),
  9910. u.__onFinishChange && u.__onFinishChange.call(u, u.getValue())
  9911. }
  9912. a.superclass.call(this, e, i, {
  9913. min: n,
  9914. max: r,
  9915. step: s
  9916. });
  9917. var u = this;
  9918. this.__background = document.createElement("div"),
  9919. this.__foreground = document.createElement("div"),
  9920. t.bind(this.__background, "mousedown", l),
  9921. t.addClass(this.__background, "slider"),
  9922. t.addClass(this.__foreground, "slider-fg"),
  9923. this.updateDisplay(),
  9924. this.__background.appendChild(this.__foreground),
  9925. this.domElement.appendChild(this.__background)
  9926. };
  9927. return a.superclass = e,
  9928. a.useDefaultStyles = function() {
  9929. i.inject(r)
  9930. }
  9931. ,
  9932. n.extend(a.prototype, e.prototype, {
  9933. updateDisplay: function() {
  9934. var e = (this.getValue() - this.__min) / (this.__max - this.__min);
  9935. return this.__foreground.style.width = 100 * e + "%",
  9936. a.superclass.prototype.updateDisplay.call(this)
  9937. }
  9938. }),
  9939. a
  9940. }(n.controllers.NumberController, n.dom.dom, n.utils.css, n.utils.common, "/**\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}"),
  9941. n.controllers.FunctionController = function(e, t, i) {
  9942. var n = function(e, i, r) {
  9943. n.superclass.call(this, e, i);
  9944. var o = this;
  9945. this.__button = document.createElement("div"),
  9946. this.__button.innerHTML = void 0 === r ? "Fire" : r,
  9947. t.bind(this.__button, "click", function(e) {
  9948. return e.preventDefault(),
  9949. o.fire(),
  9950. !1
  9951. }),
  9952. t.addClass(this.__button, "button"),
  9953. this.domElement.appendChild(this.__button)
  9954. };
  9955. return n.superclass = e,
  9956. i.extend(n.prototype, e.prototype, {
  9957. fire: function() {
  9958. this.__onChange && this.__onChange.call(this),
  9959. this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  9960. this.getValue().call(this.object)
  9961. }
  9962. }),
  9963. n
  9964. }(n.controllers.Controller, n.dom.dom, n.utils.common),
  9965. n.controllers.BooleanController = function(e, t, i) {
  9966. var n = function(e, i) {
  9967. function r() {
  9968. o.setValue(!o.__prev)
  9969. }
  9970. n.superclass.call(this, e, i);
  9971. var o = this;
  9972. this.__prev = this.getValue(),
  9973. this.__checkbox = document.createElement("input"),
  9974. this.__checkbox.setAttribute("type", "checkbox"),
  9975. t.bind(this.__checkbox, "change", r, !1),
  9976. this.domElement.appendChild(this.__checkbox),
  9977. this.updateDisplay()
  9978. };
  9979. return n.superclass = e,
  9980. i.extend(n.prototype, e.prototype, {
  9981. setValue: function(e) {
  9982. var t = n.superclass.prototype.setValue.call(this, e);
  9983. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  9984. this.__prev = this.getValue(),
  9985. t
  9986. },
  9987. updateDisplay: function() {
  9988. return this.getValue() === !0 ? (this.__checkbox.setAttribute("checked", "checked"),
  9989. this.__checkbox.checked = !0) : this.__checkbox.checked = !1,
  9990. n.superclass.prototype.updateDisplay.call(this)
  9991. }
  9992. }),
  9993. n
  9994. }(n.controllers.Controller, n.dom.dom, n.utils.common),
  9995. n.color.toString = function(e) {
  9996. return function(t) {
  9997. if (1 == t.a || e.isUndefined(t.a)) {
  9998. for (var i = t.hex.toString(16); i.length < 6; )
  9999. i = "0" + i;
  10000. return "#" + i
  10001. }
  10002. return "rgba(" + Math.round(t.r) + "," + Math.round(t.g) + "," + Math.round(t.b) + "," + t.a + ")"
  10003. }
  10004. }(n.utils.common),
  10005. n.color.interpret = function(e, t) {
  10006. var i, n, r = function() {
  10007. n = !1;
  10008. var e = arguments.length > 1 ? t.toArray(arguments) : arguments[0];
  10009. return t.each(o, function(r) {
  10010. if (r.litmus(e))
  10011. return t.each(r.conversions, function(r, o) {
  10012. if (i = r.read(e),
  10013. n === !1 && i !== !1)
  10014. return n = i,
  10015. i.conversionName = o,
  10016. i.conversion = r,
  10017. t.BREAK
  10018. }),
  10019. t.BREAK
  10020. }),
  10021. n
  10022. }, o = [{
  10023. litmus: t.isString,
  10024. conversions: {
  10025. THREE_CHAR_HEX: {
  10026. read: function(e) {
  10027. var t = e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);
  10028. return null !== t && {
  10029. space: "HEX",
  10030. hex: parseInt("0x" + t[1].toString() + t[1].toString() + t[2].toString() + t[2].toString() + t[3].toString() + t[3].toString())
  10031. }
  10032. },
  10033. write: e
  10034. },
  10035. SIX_CHAR_HEX: {
  10036. read: function(e) {
  10037. var t = e.match(/^#([A-F0-9]{6})$/i);
  10038. return null !== t && {
  10039. space: "HEX",
  10040. hex: parseInt("0x" + t[1].toString())
  10041. }
  10042. },
  10043. write: e
  10044. },
  10045. CSS_RGB: {
  10046. read: function(e) {
  10047. var t = e.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);
  10048. return null !== t && {
  10049. space: "RGB",
  10050. r: parseFloat(t[1]),
  10051. g: parseFloat(t[2]),
  10052. b: parseFloat(t[3])
  10053. }
  10054. },
  10055. write: e
  10056. },
  10057. CSS_RGBA: {
  10058. read: function(e) {
  10059. var t = e.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/);
  10060. return null !== t && {
  10061. space: "RGB",
  10062. r: parseFloat(t[1]),
  10063. g: parseFloat(t[2]),
  10064. b: parseFloat(t[3]),
  10065. a: parseFloat(t[4])
  10066. }
  10067. },
  10068. write: e
  10069. }
  10070. }
  10071. }, {
  10072. litmus: t.isNumber,
  10073. conversions: {
  10074. HEX: {
  10075. read: function(e) {
  10076. return {
  10077. space: "HEX",
  10078. hex: e,
  10079. conversionName: "HEX"
  10080. }
  10081. },
  10082. write: function(e) {
  10083. return e.hex
  10084. }
  10085. }
  10086. }
  10087. }, {
  10088. litmus: t.isArray,
  10089. conversions: {
  10090. RGB_ARRAY: {
  10091. read: function(e) {
  10092. return 3 == e.length && {
  10093. space: "RGB",
  10094. r: e[0],
  10095. g: e[1],
  10096. b: e[2]
  10097. }
  10098. },
  10099. write: function(e) {
  10100. return [e.r, e.g, e.b]
  10101. }
  10102. },
  10103. RGBA_ARRAY: {
  10104. read: function(e) {
  10105. return 4 == e.length && {
  10106. space: "RGB",
  10107. r: e[0],
  10108. g: e[1],
  10109. b: e[2],
  10110. a: e[3]
  10111. }
  10112. },
  10113. write: function(e) {
  10114. return [e.r, e.g, e.b, e.a]
  10115. }
  10116. }
  10117. }
  10118. }, {
  10119. litmus: t.isObject,
  10120. conversions: {
  10121. RGBA_OBJ: {
  10122. read: function(e) {
  10123. return !!(t.isNumber(e.r) && t.isNumber(e.g) && t.isNumber(e.b) && t.isNumber(e.a)) && {
  10124. space: "RGB",
  10125. r: e.r,
  10126. g: e.g,
  10127. b: e.b,
  10128. a: e.a
  10129. }
  10130. },
  10131. write: function(e) {
  10132. return {
  10133. r: e.r,
  10134. g: e.g,
  10135. b: e.b,
  10136. a: e.a
  10137. }
  10138. }
  10139. },
  10140. RGB_OBJ: {
  10141. read: function(e) {
  10142. return !!(t.isNumber(e.r) && t.isNumber(e.g) && t.isNumber(e.b)) && {
  10143. space: "RGB",
  10144. r: e.r,
  10145. g: e.g,
  10146. b: e.b
  10147. }
  10148. },
  10149. write: function(e) {
  10150. return {
  10151. r: e.r,
  10152. g: e.g,
  10153. b: e.b
  10154. }
  10155. }
  10156. },
  10157. HSVA_OBJ: {
  10158. read: function(e) {
  10159. return !!(t.isNumber(e.h) && t.isNumber(e.s) && t.isNumber(e.v) && t.isNumber(e.a)) && {
  10160. space: "HSV",
  10161. h: e.h,
  10162. s: e.s,
  10163. v: e.v,
  10164. a: e.a
  10165. }
  10166. },
  10167. write: function(e) {
  10168. return {
  10169. h: e.h,
  10170. s: e.s,
  10171. v: e.v,
  10172. a: e.a
  10173. }
  10174. }
  10175. },
  10176. HSV_OBJ: {
  10177. read: function(e) {
  10178. return !!(t.isNumber(e.h) && t.isNumber(e.s) && t.isNumber(e.v)) && {
  10179. space: "HSV",
  10180. h: e.h,
  10181. s: e.s,
  10182. v: e.v
  10183. }
  10184. },
  10185. write: function(e) {
  10186. return {
  10187. h: e.h,
  10188. s: e.s,
  10189. v: e.v
  10190. }
  10191. }
  10192. }
  10193. }
  10194. }];
  10195. return r
  10196. }(n.color.toString, n.utils.common),
  10197. n.GUI = n.gui.GUI = function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f) {
  10198. function g(e, t, i, o) {
  10199. if (void 0 === t[i])
  10200. throw new Error("Object " + t + ' has no property "' + i + '"');
  10201. var a;
  10202. if (o.color)
  10203. a = new h(t,i);
  10204. else {
  10205. var s = [t, i].concat(o.factoryArgs);
  10206. a = n.apply(e, s)
  10207. }
  10208. o.before instanceof r && (o.before = o.before.__li),
  10209. A(e, a),
  10210. p.addClass(a.domElement, "c");
  10211. var l = document.createElement("span");
  10212. p.addClass(l, "property-name"),
  10213. l.innerHTML = a.property;
  10214. var c = document.createElement("div");
  10215. c.appendChild(l),
  10216. c.appendChild(a.domElement);
  10217. var u = m(e, c, o.before);
  10218. return p.addClass(u, V.CLASS_CONTROLLER_ROW),
  10219. p.addClass(u, typeof a.getValue()),
  10220. v(e, u, a),
  10221. e.__controllers.push(a),
  10222. a
  10223. }
  10224. function m(e, t, i) {
  10225. var n = document.createElement("li");
  10226. return t && n.appendChild(t),
  10227. i ? e.__ul.insertBefore(n, params.before) : e.__ul.appendChild(n),
  10228. e.onResize(),
  10229. n
  10230. }
  10231. function v(e, t, i) {
  10232. if (i.__li = t,
  10233. i.__gui = e,
  10234. f.extend(i, {
  10235. options: function(t) {
  10236. return arguments.length > 1 ? (i.remove(),
  10237. g(e, i.object, i.property, {
  10238. before: i.__li.nextElementSibling,
  10239. factoryArgs: [f.toArray(arguments)]
  10240. })) : f.isArray(t) || f.isObject(t) ? (i.remove(),
  10241. g(e, i.object, i.property, {
  10242. before: i.__li.nextElementSibling,
  10243. factoryArgs: [t]
  10244. })) : void 0
  10245. },
  10246. name: function(e) {
  10247. return i.__li.firstElementChild.firstElementChild.innerHTML = e,
  10248. i
  10249. },
  10250. listen: function() {
  10251. return i.__gui.listen(i),
  10252. i
  10253. },
  10254. remove: function() {
  10255. return i.__gui.remove(i),
  10256. i
  10257. }
  10258. }),
  10259. i instanceof l) {
  10260. var n = new s(i.object,i.property,{
  10261. min: i.__min,
  10262. max: i.__max,
  10263. step: i.__step
  10264. });
  10265. f.each(["updateDisplay", "onChange", "onFinishChange"], function(e) {
  10266. var t = i[e]
  10267. , r = n[e];
  10268. i[e] = n[e] = function() {
  10269. var e = Array.prototype.slice.call(arguments);
  10270. return t.apply(i, e),
  10271. r.apply(n, e)
  10272. }
  10273. }),
  10274. p.addClass(t, "has-slider"),
  10275. i.domElement.insertBefore(n.domElement, i.domElement.firstElementChild)
  10276. } else if (i instanceof s) {
  10277. var r = function(t) {
  10278. return f.isNumber(i.__min) && f.isNumber(i.__max) ? (i.remove(),
  10279. g(e, i.object, i.property, {
  10280. before: i.__li.nextElementSibling,
  10281. factoryArgs: [i.__min, i.__max, i.__step]
  10282. })) : t
  10283. };
  10284. i.min = f.compose(r, i.min),
  10285. i.max = f.compose(r, i.max)
  10286. } else
  10287. i instanceof o ? (p.bind(t, "click", function() {
  10288. p.fakeEvent(i.__checkbox, "click")
  10289. }),
  10290. p.bind(i.__checkbox, "click", function(e) {
  10291. e.stopPropagation()
  10292. })) : i instanceof a ? (p.bind(t, "click", function() {
  10293. p.fakeEvent(i.__button, "click")
  10294. }),
  10295. p.bind(t, "mouseover", function() {
  10296. p.addClass(i.__button, "hover")
  10297. }),
  10298. p.bind(t, "mouseout", function() {
  10299. p.removeClass(i.__button, "hover")
  10300. })) : i instanceof h && (p.addClass(t, "color"),
  10301. i.updateDisplay = f.compose(function(e) {
  10302. return t.style.borderLeftColor = i.__color.toString(),
  10303. e
  10304. }, i.updateDisplay),
  10305. i.updateDisplay());
  10306. i.setValue = f.compose(function(t) {
  10307. return e.getRoot().__preset_select && i.isModified() && T(e.getRoot(), !0),
  10308. t
  10309. }, i.setValue)
  10310. }
  10311. function A(e, t) {
  10312. var i = e.getRoot()
  10313. , n = i.__rememberedObjects.indexOf(t.object);
  10314. if (n != -1) {
  10315. var r = i.__rememberedObjectIndecesToControllers[n];
  10316. if (void 0 === r && (r = {},
  10317. i.__rememberedObjectIndecesToControllers[n] = r),
  10318. r[t.property] = t,
  10319. i.load && i.load.remembered) {
  10320. var o, a = i.load.remembered;
  10321. if (a[e.preset])
  10322. o = a[e.preset];
  10323. else {
  10324. if (!a[L])
  10325. return;
  10326. o = a[L]
  10327. }
  10328. if (o[n] && void 0 !== o[n][t.property]) {
  10329. var s = o[n][t.property];
  10330. t.initialValue = s,
  10331. t.setValue(s)
  10332. }
  10333. }
  10334. }
  10335. }
  10336. function y(e, t) {
  10337. return document.location.href + "." + t
  10338. }
  10339. function C(e) {
  10340. var t = e.__save_row = document.createElement("li");
  10341. p.addClass(e.domElement, "has-save"),
  10342. e.__ul.insertBefore(t, e.__ul.firstChild),
  10343. p.addClass(t, "save-row");
  10344. var i = document.createElement("span");
  10345. i.innerHTML = "&nbsp;",
  10346. p.addClass(i, "button gears");
  10347. var n = document.createElement("span");
  10348. n.innerHTML = "Save",
  10349. p.addClass(n, "button"),
  10350. p.addClass(n, "save");
  10351. var r = document.createElement("span");
  10352. r.innerHTML = "New",
  10353. p.addClass(r, "button"),
  10354. p.addClass(r, "save-as");
  10355. var o = document.createElement("span");
  10356. o.innerHTML = "Revert",
  10357. p.addClass(o, "button"),
  10358. p.addClass(o, "revert");
  10359. var a = e.__preset_select = document.createElement("select");
  10360. if (e.load && e.load.remembered ? f.each(e.load.remembered, function(t, i) {
  10361. w(e, i, i == e.preset)
  10362. }) : w(e, L, !1),
  10363. p.bind(a, "change", function() {
  10364. for (var t = 0; t < e.__preset_select.length; t++)
  10365. e.__preset_select[t].innerHTML = e.__preset_select[t].value;
  10366. e.preset = this.value
  10367. }),
  10368. t.appendChild(a),
  10369. t.appendChild(i),
  10370. t.appendChild(n),
  10371. t.appendChild(r),
  10372. t.appendChild(o),
  10373. D) {
  10374. var s = document.getElementById("dg-save-locally")
  10375. , l = document.getElementById("dg-local-explain");
  10376. s.style.display = "block";
  10377. var c = document.getElementById("dg-local-storage");
  10378. "true" === localStorage.getItem(y(e, "isLocal")) && c.setAttribute("checked", "checked");
  10379. var h = function() {
  10380. l.style.display = e.useLocalStorage ? "block" : "none"
  10381. };
  10382. h(),
  10383. p.bind(c, "change", function() {
  10384. e.useLocalStorage = !e.useLocalStorage,
  10385. h()
  10386. })
  10387. }
  10388. var u = document.getElementById("dg-new-constructor");
  10389. p.bind(u, "keydown", function(e) {
  10390. !e.metaKey || 67 !== e.which && 67 != e.keyCode || S.hide()
  10391. }),
  10392. p.bind(i, "click", function() {
  10393. u.innerHTML = JSON.stringify(e.getSaveObject(), void 0, 2),
  10394. S.show(),
  10395. u.focus(),
  10396. u.select()
  10397. }),
  10398. p.bind(n, "click", function() {
  10399. e.save()
  10400. }),
  10401. p.bind(r, "click", function() {
  10402. var t = prompt("Enter a new preset name.");
  10403. t && e.saveAs(t)
  10404. }),
  10405. p.bind(o, "click", function() {
  10406. e.revert()
  10407. })
  10408. }
  10409. function I(e) {
  10410. function t(t) {
  10411. return t.preventDefault(),
  10412. r = t.clientX,
  10413. p.addClass(e.__closeButton, V.CLASS_DRAG),
  10414. p.bind(window, "mousemove", i),
  10415. p.bind(window, "mouseup", n),
  10416. !1
  10417. }
  10418. function i(t) {
  10419. return t.preventDefault(),
  10420. e.width += r - t.clientX,
  10421. e.onResize(),
  10422. r = t.clientX,
  10423. !1
  10424. }
  10425. function n() {
  10426. p.removeClass(e.__closeButton, V.CLASS_DRAG),
  10427. p.unbind(window, "mousemove", i),
  10428. p.unbind(window, "mouseup", n)
  10429. }
  10430. e.__resize_handle = document.createElement("div"),
  10431. f.extend(e.__resize_handle.style, {
  10432. width: "6px",
  10433. marginLeft: "-3px",
  10434. height: "200px",
  10435. cursor: "ew-resize",
  10436. position: "absolute"
  10437. });
  10438. var r;
  10439. p.bind(e.__resize_handle, "mousedown", t),
  10440. p.bind(e.__closeButton, "mousedown", t),
  10441. e.domElement.insertBefore(e.__resize_handle, e.domElement.firstElementChild)
  10442. }
  10443. function E(e, t) {
  10444. e.domElement.style.width = t + "px",
  10445. e.__save_row && e.autoPlace && (e.__save_row.style.width = t + "px"),
  10446. e.__closeButton && (e.__closeButton.style.width = t + "px")
  10447. }
  10448. function b(e, t) {
  10449. var i = {};
  10450. return f.each(e.__rememberedObjects, function(n, r) {
  10451. var o = {}
  10452. , a = e.__rememberedObjectIndecesToControllers[r];
  10453. f.each(a, function(e, i) {
  10454. o[i] = t ? e.initialValue : e.getValue()
  10455. }),
  10456. i[r] = o
  10457. }),
  10458. i
  10459. }
  10460. function w(e, t, i) {
  10461. var n = document.createElement("option");
  10462. n.innerHTML = t,
  10463. n.value = t,
  10464. e.__preset_select.appendChild(n),
  10465. i && (e.__preset_select.selectedIndex = e.__preset_select.length - 1)
  10466. }
  10467. function _(e) {
  10468. for (var t = 0; t < e.__preset_select.length; t++)
  10469. e.__preset_select[t].value == e.preset && (e.__preset_select.selectedIndex = t)
  10470. }
  10471. function T(e, t) {
  10472. var i = e.__preset_select[e.__preset_select.selectedIndex];
  10473. t ? i.innerHTML = i.value + "*" : i.innerHTML = i.value
  10474. }
  10475. function x(e) {
  10476. 0 != e.length && u(function() {
  10477. x(e)
  10478. }),
  10479. f.each(e, function(e) {
  10480. e.updateDisplay()
  10481. })
  10482. }
  10483. e.inject(i);
  10484. var S, M, R = "dg", P = 72, O = 20, L = "Default", D = function() {
  10485. try {
  10486. return "localStorage"in window && null !== window.localStorage
  10487. } catch (e) {
  10488. return !1
  10489. }
  10490. }(), N = !0, B = !1, F = [], V = function(e) {
  10491. function t() {
  10492. var e = i.getRoot();
  10493. e.width += 1,
  10494. f.defer(function() {
  10495. e.width -= 1
  10496. })
  10497. }
  10498. var i = this;
  10499. this.domElement = document.createElement("div"),
  10500. this.__ul = document.createElement("ul"),
  10501. this.domElement.appendChild(this.__ul),
  10502. p.addClass(this.domElement, R),
  10503. this.__folders = {},
  10504. this.__controllers = [],
  10505. this.__rememberedObjects = [],
  10506. this.__rememberedObjectIndecesToControllers = [],
  10507. this.__listening = [],
  10508. e = e || {},
  10509. e = f.defaults(e, {
  10510. autoPlace: !0,
  10511. width: V.DEFAULT_WIDTH
  10512. }),
  10513. e = f.defaults(e, {
  10514. resizable: e.autoPlace,
  10515. hideable: e.autoPlace
  10516. }),
  10517. f.isUndefined(e.load) ? e.load = {
  10518. preset: L
  10519. } : e.preset && (e.load.preset = e.preset),
  10520. f.isUndefined(e.parent) && e.hideable && F.push(this),
  10521. e.resizable = f.isUndefined(e.parent) && e.resizable,
  10522. e.autoPlace && f.isUndefined(e.scrollable) && (e.scrollable = !0);
  10523. var n, r = D && "true" === localStorage.getItem(y(this, "isLocal"));
  10524. if (Object.defineProperties(this, {
  10525. parent: {
  10526. get: function() {
  10527. return e.parent
  10528. }
  10529. },
  10530. scrollable: {
  10531. get: function() {
  10532. return e.scrollable
  10533. }
  10534. },
  10535. autoPlace: {
  10536. get: function() {
  10537. return e.autoPlace
  10538. }
  10539. },
  10540. preset: {
  10541. get: function() {
  10542. return i.parent ? i.getRoot().preset : e.load.preset
  10543. },
  10544. set: function(t) {
  10545. i.parent ? i.getRoot().preset = t : e.load.preset = t,
  10546. _(this),
  10547. i.revert()
  10548. }
  10549. },
  10550. width: {
  10551. get: function() {
  10552. return e.width
  10553. },
  10554. set: function(t) {
  10555. e.width = t,
  10556. E(i, t)
  10557. }
  10558. },
  10559. name: {
  10560. get: function() {
  10561. return e.name
  10562. },
  10563. set: function(t) {
  10564. e.name = t,
  10565. a && (a.innerHTML = e.name)
  10566. }
  10567. },
  10568. closed: {
  10569. get: function() {
  10570. return e.closed
  10571. },
  10572. set: function(t) {
  10573. e.closed = t,
  10574. e.closed ? p.addClass(i.__ul, V.CLASS_CLOSED) : p.removeClass(i.__ul, V.CLASS_CLOSED),
  10575. this.onResize(),
  10576. i.__closeButton && (i.__closeButton.innerHTML = t ? V.TEXT_OPEN : V.TEXT_CLOSED)
  10577. }
  10578. },
  10579. load: {
  10580. get: function() {
  10581. return e.load
  10582. }
  10583. },
  10584. useLocalStorage: {
  10585. get: function() {
  10586. return r
  10587. },
  10588. set: function(e) {
  10589. D && (r = e,
  10590. e ? p.bind(window, "unload", n) : p.unbind(window, "unload", n),
  10591. localStorage.setItem(y(i, "isLocal"), e))
  10592. }
  10593. }
  10594. }),
  10595. f.isUndefined(e.parent)) {
  10596. if (e.closed = !1,
  10597. p.addClass(this.domElement, V.CLASS_MAIN),
  10598. p.makeSelectable(this.domElement, !1),
  10599. D && r) {
  10600. i.useLocalStorage = !0;
  10601. var o = localStorage.getItem(y(this, "gui"));
  10602. o && (e.load = JSON.parse(o))
  10603. }
  10604. this.__closeButton = document.createElement("div"),
  10605. this.__closeButton.innerHTML = V.TEXT_CLOSED,
  10606. p.addClass(this.__closeButton, V.CLASS_CLOSE_BUTTON),
  10607. this.domElement.appendChild(this.__closeButton),
  10608. p.bind(this.__closeButton, "click", function() {
  10609. i.closed = !i.closed
  10610. })
  10611. } else {
  10612. void 0 === e.closed && (e.closed = !0);
  10613. var a = document.createTextNode(e.name);
  10614. p.addClass(a, "controller-name");
  10615. var s = m(i, a)
  10616. , l = function(e) {
  10617. return e.preventDefault(),
  10618. i.closed = !i.closed,
  10619. !1
  10620. };
  10621. p.addClass(this.__ul, V.CLASS_CLOSED),
  10622. p.addClass(s, "title"),
  10623. p.bind(s, "click", l),
  10624. e.closed || (this.closed = !1)
  10625. }
  10626. e.autoPlace && (f.isUndefined(e.parent) && (N && (M = document.createElement("div"),
  10627. p.addClass(M, R),
  10628. p.addClass(M, V.CLASS_AUTO_PLACE_CONTAINER),
  10629. document.body.appendChild(M),
  10630. N = !1),
  10631. M.appendChild(this.domElement),
  10632. p.addClass(this.domElement, V.CLASS_AUTO_PLACE)),
  10633. this.parent || E(i, e.width)),
  10634. p.bind(window, "resize", function() {
  10635. i.onResize()
  10636. }),
  10637. p.bind(this.__ul, "webkitTransitionEnd", function() {
  10638. i.onResize()
  10639. }),
  10640. p.bind(this.__ul, "transitionend", function() {
  10641. i.onResize()
  10642. }),
  10643. p.bind(this.__ul, "oTransitionEnd", function() {
  10644. i.onResize()
  10645. }),
  10646. this.onResize(),
  10647. e.resizable && I(this),
  10648. n = function() {
  10649. D && "true" === localStorage.getItem(y(i, "isLocal")) && localStorage.setItem(y(i, "gui"), JSON.stringify(i.getSaveObject()))
  10650. }
  10651. ,
  10652. this.saveToLocalStorageIfPossible = n;
  10653. i.getRoot();
  10654. e.parent || t()
  10655. };
  10656. return V.toggleHide = function() {
  10657. B = !B,
  10658. f.each(F, function(e) {
  10659. e.domElement.style.zIndex = B ? -999 : 999,
  10660. e.domElement.style.opacity = B ? 0 : 1
  10661. })
  10662. }
  10663. ,
  10664. V.CLASS_AUTO_PLACE = "a",
  10665. V.CLASS_AUTO_PLACE_CONTAINER = "ac",
  10666. V.CLASS_MAIN = "main",
  10667. V.CLASS_CONTROLLER_ROW = "cr",
  10668. V.CLASS_TOO_TALL = "taller-than-window",
  10669. V.CLASS_CLOSED = "closed",
  10670. V.CLASS_CLOSE_BUTTON = "close-button",
  10671. V.CLASS_DRAG = "drag",
  10672. V.DEFAULT_WIDTH = 245,
  10673. V.TEXT_CLOSED = "Close Controls",
  10674. V.TEXT_OPEN = "Open Controls",
  10675. p.bind(window, "keydown", function(e) {
  10676. "text" === document.activeElement.type || e.which !== P && e.keyCode != P || V.toggleHide()
  10677. }, !1),
  10678. f.extend(V.prototype, {
  10679. add: function(e, t) {
  10680. return g(this, e, t, {
  10681. factoryArgs: Array.prototype.slice.call(arguments, 2)
  10682. })
  10683. },
  10684. addColor: function(e, t) {
  10685. return g(this, e, t, {
  10686. color: !0
  10687. })
  10688. },
  10689. remove: function(e) {
  10690. this.__ul.removeChild(e.__li),
  10691. this.__controllers.slice(this.__controllers.indexOf(e), 1);
  10692. var t = this;
  10693. f.defer(function() {
  10694. t.onResize()
  10695. })
  10696. },
  10697. destroy: function() {
  10698. this.autoPlace && M.removeChild(this.domElement)
  10699. },
  10700. addFolder: function(e) {
  10701. if (void 0 !== this.__folders[e])
  10702. throw new Error('You already have a folder in this GUI by the name "' + e + '"');
  10703. var t = {
  10704. name: e,
  10705. parent: this
  10706. };
  10707. t.autoPlace = this.autoPlace,
  10708. this.load && this.load.folders && this.load.folders[e] && (t.closed = this.load.folders[e].closed,
  10709. t.load = this.load.folders[e]);
  10710. var i = new V(t);
  10711. this.__folders[e] = i;
  10712. var n = m(this, i.domElement);
  10713. return p.addClass(n, "folder"),
  10714. i
  10715. },
  10716. open: function() {
  10717. this.closed = !1
  10718. },
  10719. close: function() {
  10720. this.closed = !0
  10721. },
  10722. onResize: function() {
  10723. var e = this.getRoot();
  10724. if (e.scrollable) {
  10725. var t = p.getOffset(e.__ul).top
  10726. , i = 0;
  10727. f.each(e.__ul.childNodes, function(t) {
  10728. e.autoPlace && t === e.__save_row || (i += p.getHeight(t))
  10729. }),
  10730. $("#player").height() - t - O < i ? (p.addClass(e.domElement, V.CLASS_TOO_TALL),
  10731. e.__ul.style.height = $("#player").height() - t - O + "px") : (p.removeClass(e.domElement, V.CLASS_TOO_TALL),
  10732. e.__ul.style.height = "auto")
  10733. }
  10734. e.__resize_handle && f.defer(function() {
  10735. e.__resize_handle.style.height = e.__ul.offsetHeight + "px"
  10736. }),
  10737. e.__closeButton && (e.__closeButton.style.width = e.width + "px")
  10738. },
  10739. remember: function() {
  10740. if (f.isUndefined(S) && (S = new d,
  10741. S.domElement.innerHTML = t),
  10742. this.parent)
  10743. throw new Error("You can only call remember on a top level GUI.");
  10744. var e = this;
  10745. f.each(Array.prototype.slice.call(arguments), function(t) {
  10746. 0 == e.__rememberedObjects.length && C(e),
  10747. e.__rememberedObjects.indexOf(t) == -1 && e.__rememberedObjects.push(t)
  10748. }),
  10749. this.autoPlace && E(this, this.width)
  10750. },
  10751. getRoot: function() {
  10752. for (var e = this; e.parent; )
  10753. e = e.parent;
  10754. return e
  10755. },
  10756. getSaveObject: function() {
  10757. var e = this.load;
  10758. return e.closed = this.closed,
  10759. this.__rememberedObjects.length > 0 && (e.preset = this.preset,
  10760. e.remembered || (e.remembered = {}),
  10761. e.remembered[this.preset] = b(this)),
  10762. e.folders = {},
  10763. f.each(this.__folders, function(t, i) {
  10764. e.folders[i] = t.getSaveObject()
  10765. }),
  10766. e
  10767. },
  10768. save: function() {
  10769. this.load.remembered || (this.load.remembered = {}),
  10770. this.load.remembered[this.preset] = b(this),
  10771. T(this, !1),
  10772. this.saveToLocalStorageIfPossible()
  10773. },
  10774. saveAs: function(e) {
  10775. this.load.remembered || (this.load.remembered = {},
  10776. this.load.remembered[L] = b(this, !0)),
  10777. this.load.remembered[e] = b(this),
  10778. this.preset = e,
  10779. w(this, e, !0),
  10780. this.saveToLocalStorageIfPossible()
  10781. },
  10782. revert: function(e) {
  10783. f.each(this.__controllers, function(t) {
  10784. this.getRoot().load.remembered ? A(e || this.getRoot(), t) : t.setValue(t.initialValue)
  10785. }, this),
  10786. f.each(this.__folders, function(e) {
  10787. e.revert(e)
  10788. }),
  10789. e || T(this.getRoot(), !1)
  10790. },
  10791. listen: function(e) {
  10792. var t = 0 == this.__listening.length;
  10793. this.__listening.push(e),
  10794. t && x(this.__listening)
  10795. }
  10796. }),
  10797. V
  10798. }(n.utils.css, '<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>', ".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", n.controllers.factory = function(e, t, i, n, r, o, a) {
  10799. return function(s, l) {
  10800. var c = s[l];
  10801. return a.isArray(arguments[2]) || a.isObject(arguments[2]) ? new e(s,l,arguments[2]) : a.isNumber(c) ? a.isNumber(arguments[2]) && a.isNumber(arguments[3]) ? new i(s,l,arguments[2],arguments[3]) : new t(s,l,{
  10802. min: arguments[2],
  10803. max: arguments[3]
  10804. }) : a.isString(c) ? new n(s,l) : a.isFunction(c) ? new r(s,l,"") : a.isBoolean(c) ? new o(s,l) : void 0
  10805. }
  10806. }(n.controllers.OptionController, n.controllers.NumberControllerBox, n.controllers.NumberControllerSlider, n.controllers.StringController = function(e, t, i) {
  10807. var n = function(e, i) {
  10808. function r() {
  10809. a.setValue(a.__input.value)
  10810. }
  10811. function o() {
  10812. a.__onFinishChange && a.__onFinishChange.call(a, a.getValue())
  10813. }
  10814. n.superclass.call(this, e, i);
  10815. var a = this;
  10816. this.__input = document.createElement("input"),
  10817. this.__input.setAttribute("type", "text"),
  10818. t.bind(this.__input, "keyup", r),
  10819. t.bind(this.__input, "change", r),
  10820. t.bind(this.__input, "blur", o),
  10821. t.bind(this.__input, "keydown", function(e) {
  10822. 13 === e.keyCode && this.blur()
  10823. }),
  10824. this.updateDisplay(),
  10825. this.domElement.appendChild(this.__input)
  10826. };
  10827. return n.superclass = e,
  10828. i.extend(n.prototype, e.prototype, {
  10829. updateDisplay: function() {
  10830. return t.isActive(this.__input) || (this.__input.value = this.getValue()),
  10831. n.superclass.prototype.updateDisplay.call(this)
  10832. }
  10833. }),
  10834. n
  10835. }(n.controllers.Controller, n.dom.dom, n.utils.common), n.controllers.FunctionController, n.controllers.BooleanController, n.utils.common), n.controllers.Controller, n.controllers.BooleanController, n.controllers.FunctionController, n.controllers.NumberControllerBox, n.controllers.NumberControllerSlider, n.controllers.OptionController, n.controllers.ColorController = function(e, t, i, n, r) {
  10836. function o(e, t, i, n) {
  10837. e.style.background = "",
  10838. r.each(l, function(r) {
  10839. e.style.cssText += "background: " + r + "linear-gradient(" + t + ", " + i + " 0%, " + n + " 100%); "
  10840. })
  10841. }
  10842. function a(e) {
  10843. e.style.background = "",
  10844. e.style.cssText += "background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",
  10845. e.style.cssText += "background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  10846. e.style.cssText += "background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  10847. e.style.cssText += "background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  10848. e.style.cssText += "background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"
  10849. }
  10850. var s = function(e, l) {
  10851. function c(e) {
  10852. p(e),
  10853. t.bind(window, "mousemove", p),
  10854. t.bind(window, "mouseup", h)
  10855. }
  10856. function h() {
  10857. t.unbind(window, "mousemove", p),
  10858. t.unbind(window, "mouseup", h)
  10859. }
  10860. function u() {
  10861. var e = n(this.value);
  10862. e !== !1 ? (g.__color.__state = e,
  10863. g.setValue(g.__color.toOriginal())) : this.value = g.__color.toString()
  10864. }
  10865. function d() {
  10866. t.unbind(window, "mousemove", f),
  10867. t.unbind(window, "mouseup", d)
  10868. }
  10869. function p(e) {
  10870. e.preventDefault();
  10871. var i = t.getWidth(g.__saturation_field)
  10872. , n = t.getOffset(g.__saturation_field)
  10873. , r = (e.clientX - n.left + document.body.scrollLeft) / i
  10874. , o = 1 - (e.clientY - n.top + document.body.scrollTop) / i;
  10875. return o > 1 ? o = 1 : o < 0 && (o = 0),
  10876. r > 1 ? r = 1 : r < 0 && (r = 0),
  10877. g.__color.v = o,
  10878. g.__color.s = r,
  10879. g.setValue(g.__color.toOriginal()),
  10880. !1
  10881. }
  10882. function f(e) {
  10883. e.preventDefault();
  10884. var i = t.getHeight(g.__hue_field)
  10885. , n = t.getOffset(g.__hue_field)
  10886. , r = 1 - (e.clientY - n.top + document.body.scrollTop) / i;
  10887. return r > 1 ? r = 1 : r < 0 && (r = 0),
  10888. g.__color.h = 360 * r,
  10889. g.setValue(g.__color.toOriginal()),
  10890. !1
  10891. }
  10892. s.superclass.call(this, e, l),
  10893. this.__color = new i(this.getValue()),
  10894. this.__temp = new i(0);
  10895. var g = this;
  10896. this.domElement = document.createElement("div"),
  10897. t.makeSelectable(this.domElement, !1),
  10898. this.__selector = document.createElement("div"),
  10899. this.__selector.className = "selector",
  10900. this.__saturation_field = document.createElement("div"),
  10901. this.__saturation_field.className = "saturation-field",
  10902. this.__field_knob = document.createElement("div"),
  10903. this.__field_knob.className = "field-knob",
  10904. this.__field_knob_border = "2px solid ",
  10905. this.__hue_knob = document.createElement("div"),
  10906. this.__hue_knob.className = "hue-knob",
  10907. this.__hue_field = document.createElement("div"),
  10908. this.__hue_field.className = "hue-field",
  10909. this.__input = document.createElement("input"),
  10910. this.__input.type = "text",
  10911. this.__input_textShadow = "0 1px 1px ",
  10912. t.bind(this.__input, "keydown", function(e) {
  10913. 13 === e.keyCode && u.call(this)
  10914. }),
  10915. t.bind(this.__input, "blur", u),
  10916. t.bind(this.__selector, "mousedown", function(e) {
  10917. t.addClass(this, "drag").bind(window, "mouseup", function(e) {
  10918. t.removeClass(g.__selector, "drag")
  10919. })
  10920. });
  10921. var m = document.createElement("div");
  10922. r.extend(this.__selector.style, {
  10923. width: "122px",
  10924. height: "102px",
  10925. padding: "3px",
  10926. backgroundColor: "#222",
  10927. boxShadow: "0px 1px 3px rgba(0,0,0,0.3)"
  10928. }),
  10929. r.extend(this.__field_knob.style, {
  10930. position: "absolute",
  10931. width: "12px",
  10932. height: "12px",
  10933. border: this.__field_knob_border + (this.__color.v < .5 ? "#fff" : "#000"),
  10934. boxShadow: "0px 1px 3px rgba(0,0,0,0.5)",
  10935. borderRadius: "12px",
  10936. zIndex: 1
  10937. }),
  10938. r.extend(this.__hue_knob.style, {
  10939. position: "absolute",
  10940. width: "15px",
  10941. height: "2px",
  10942. borderRight: "4px solid #fff",
  10943. zIndex: 1
  10944. }),
  10945. r.extend(this.__saturation_field.style, {
  10946. width: "100px",
  10947. height: "100px",
  10948. border: "1px solid #555",
  10949. marginRight: "3px",
  10950. display: "inline-block",
  10951. cursor: "pointer"
  10952. }),
  10953. r.extend(m.style, {
  10954. width: "100%",
  10955. height: "100%",
  10956. background: "none"
  10957. }),
  10958. o(m, "top", "rgba(0,0,0,0)", "#000"),
  10959. r.extend(this.__hue_field.style, {
  10960. width: "15px",
  10961. height: "100px",
  10962. display: "inline-block",
  10963. border: "1px solid #555",
  10964. cursor: "ns-resize"
  10965. }),
  10966. a(this.__hue_field),
  10967. r.extend(this.__input.style, {
  10968. outline: "none",
  10969. textAlign: "center",
  10970. color: "#fff",
  10971. border: 0,
  10972. fontWeight: "bold",
  10973. textShadow: this.__input_textShadow + "rgba(0,0,0,0.7)"
  10974. }),
  10975. t.bind(this.__saturation_field, "mousedown", c),
  10976. t.bind(this.__field_knob, "mousedown", c),
  10977. t.bind(this.__hue_field, "mousedown", function(e) {
  10978. f(e),
  10979. t.bind(window, "mousemove", f),
  10980. t.bind(window, "mouseup", d)
  10981. }),
  10982. this.__saturation_field.appendChild(m),
  10983. this.__selector.appendChild(this.__field_knob),
  10984. this.__selector.appendChild(this.__saturation_field),
  10985. this.__selector.appendChild(this.__hue_field),
  10986. this.__hue_field.appendChild(this.__hue_knob),
  10987. this.domElement.appendChild(this.__input),
  10988. this.domElement.appendChild(this.__selector),
  10989. this.updateDisplay()
  10990. };
  10991. s.superclass = e,
  10992. r.extend(s.prototype, e.prototype, {
  10993. updateDisplay: function() {
  10994. var e = n(this.getValue());
  10995. if (e !== !1) {
  10996. var t = !1;
  10997. r.each(i.COMPONENTS, function(i) {
  10998. if (!r.isUndefined(e[i]) && !r.isUndefined(this.__color.__state[i]) && e[i] !== this.__color.__state[i])
  10999. return t = !0,
  11000. {}
  11001. }, this),
  11002. t && r.extend(this.__color.__state, e)
  11003. }
  11004. r.extend(this.__temp.__state, this.__color.__state),
  11005. this.__temp.a = 1;
  11006. var a = this.__color.v < .5 || this.__color.s > .5 ? 255 : 0
  11007. , s = 255 - a;
  11008. r.extend(this.__field_knob.style, {
  11009. marginLeft: 100 * this.__color.s - 7 + "px",
  11010. marginTop: 100 * (1 - this.__color.v) - 7 + "px",
  11011. backgroundColor: this.__temp.toString(),
  11012. border: this.__field_knob_border + "rgb(" + a + "," + a + "," + a + ")"
  11013. }),
  11014. this.__hue_knob.style.marginTop = 100 * (1 - this.__color.h / 360) + "px",
  11015. this.__temp.s = 1,
  11016. this.__temp.v = 1,
  11017. o(this.__saturation_field, "left", "#fff", this.__temp.toString()),
  11018. r.extend(this.__input.style, {
  11019. backgroundColor: this.__input.value = this.__color.toString(),
  11020. color: "rgb(" + a + "," + a + "," + a + ")",
  11021. textShadow: this.__input_textShadow + "rgba(" + s + "," + s + "," + s + ",.7)"
  11022. })
  11023. }
  11024. });
  11025. var l = ["-moz-", "-o-", "-webkit-", "-ms-", ""];
  11026. return s
  11027. }(n.controllers.Controller, n.dom.dom, n.color.Color = function(e, t, i, n) {
  11028. function r(e, t, i) {
  11029. Object.defineProperty(e, t, {
  11030. get: function() {
  11031. return "RGB" === this.__state.space ? this.__state[t] : (a(this, t, i),
  11032. this.__state[t])
  11033. },
  11034. set: function(e) {
  11035. "RGB" !== this.__state.space && (a(this, t, i),
  11036. this.__state.space = "RGB"),
  11037. this.__state[t] = e
  11038. }
  11039. })
  11040. }
  11041. function o(e, t) {
  11042. Object.defineProperty(e, t, {
  11043. get: function() {
  11044. return "HSV" === this.__state.space ? this.__state[t] : (s(this),
  11045. this.__state[t])
  11046. },
  11047. set: function(e) {
  11048. "HSV" !== this.__state.space && (s(this),
  11049. this.__state.space = "HSV"),
  11050. this.__state[t] = e
  11051. }
  11052. })
  11053. }
  11054. function a(e, i, r) {
  11055. if ("HEX" === e.__state.space)
  11056. e.__state[i] = t.component_from_hex(e.__state.hex, r);
  11057. else {
  11058. if ("HSV" !== e.__state.space)
  11059. throw "Corrupted color state";
  11060. n.extend(e.__state, t.hsv_to_rgb(e.__state.h, e.__state.s, e.__state.v))
  11061. }
  11062. }
  11063. function s(e) {
  11064. var i = t.rgb_to_hsv(e.r, e.g, e.b);
  11065. n.extend(e.__state, {
  11066. s: i.s,
  11067. v: i.v
  11068. }),
  11069. n.isNaN(i.h) ? n.isUndefined(e.__state.h) && (e.__state.h = 0) : e.__state.h = i.h
  11070. }
  11071. var l = function() {
  11072. if (this.__state = e.apply(this, arguments),
  11073. this.__state === !1)
  11074. throw "Failed to interpret color arguments";
  11075. this.__state.a = this.__state.a || 1
  11076. };
  11077. return l.COMPONENTS = ["r", "g", "b", "h", "s", "v", "hex", "a"],
  11078. n.extend(l.prototype, {
  11079. toString: function() {
  11080. return i(this)
  11081. },
  11082. toOriginal: function() {
  11083. return this.__state.conversion.write(this)
  11084. }
  11085. }),
  11086. r(l.prototype, "r", 2),
  11087. r(l.prototype, "g", 1),
  11088. r(l.prototype, "b", 0),
  11089. o(l.prototype, "h"),
  11090. o(l.prototype, "s"),
  11091. o(l.prototype, "v"),
  11092. Object.defineProperty(l.prototype, "a", {
  11093. get: function() {
  11094. return this.__state.a
  11095. },
  11096. set: function(e) {
  11097. this.__state.a = e
  11098. }
  11099. }),
  11100. Object.defineProperty(l.prototype, "hex", {
  11101. get: function() {
  11102. return "HEX" !== !this.__state.space && (this.__state.hex = t.rgb_to_hex(this.r, this.g, this.b)),
  11103. this.__state.hex
  11104. },
  11105. set: function(e) {
  11106. this.__state.space = "HEX",
  11107. this.__state.hex = e
  11108. }
  11109. }),
  11110. l
  11111. }(n.color.interpret, n.color.math = function() {
  11112. var e;
  11113. return {
  11114. hsv_to_rgb: function(e, t, i) {
  11115. var n = Math.floor(e / 60) % 6
  11116. , r = e / 60 - Math.floor(e / 60)
  11117. , o = i * (1 - t)
  11118. , a = i * (1 - r * t)
  11119. , s = i * (1 - (1 - r) * t)
  11120. , l = [[i, s, o], [a, i, o], [o, i, s], [o, a, i], [s, o, i], [i, o, a]][n];
  11121. return {
  11122. r: 255 * l[0],
  11123. g: 255 * l[1],
  11124. b: 255 * l[2]
  11125. }
  11126. },
  11127. rgb_to_hsv: function(e, t, i) {
  11128. var n, r, o = Math.min(e, t, i), a = Math.max(e, t, i), s = a - o;
  11129. return 0 == a ? {
  11130. h: NaN,
  11131. s: 0,
  11132. v: 0
  11133. } : (r = s / a,
  11134. n = e == a ? (t - i) / s : t == a ? 2 + (i - e) / s : 4 + (e - t) / s,
  11135. n /= 6,
  11136. n < 0 && (n += 1),
  11137. {
  11138. h: 360 * n,
  11139. s: r,
  11140. v: a / 255
  11141. })
  11142. },
  11143. rgb_to_hex: function(e, t, i) {
  11144. var n = this.hex_with_component(0, 2, e);
  11145. return n = this.hex_with_component(n, 1, t),
  11146. n = this.hex_with_component(n, 0, i)
  11147. },
  11148. component_from_hex: function(e, t) {
  11149. return e >> 8 * t & 255
  11150. },
  11151. hex_with_component: function(t, i, n) {
  11152. return n << (e = 8 * i) | t & ~(255 << e)
  11153. }
  11154. }
  11155. }(), n.color.toString, n.utils.common), n.color.interpret, n.utils.common), n.utils.requestAnimationFrame = function() {
  11156. return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(e, t) {
  11157. window.setTimeout(e, 1e3 / 60)
  11158. }
  11159. }(), n.dom.CenteredDiv = function(e, t) {
  11160. var i = function() {
  11161. this.backgroundElement = document.createElement("div"),
  11162. t.extend(this.backgroundElement.style, {
  11163. backgroundColor: "rgba(0,0,0,0.8)",
  11164. top: 0,
  11165. left: 0,
  11166. display: "none",
  11167. zIndex: "1000",
  11168. opacity: 0,
  11169. WebkitTransition: "opacity 0.2s linear"
  11170. }),
  11171. e.makeFullscreen(this.backgroundElement),
  11172. this.backgroundElement.style.position = "fixed",
  11173. this.domElement = document.createElement("div"),
  11174. t.extend(this.domElement.style, {
  11175. position: "fixed",
  11176. display: "none",
  11177. zIndex: "1001",
  11178. opacity: 0,
  11179. WebkitTransition: "-webkit-transform 0.2s ease-out, opacity 0.2s linear"
  11180. }),
  11181. document.body.appendChild(this.backgroundElement),
  11182. document.body.appendChild(this.domElement);
  11183. var i = this;
  11184. e.bind(this.backgroundElement, "click", function() {
  11185. i.hide()
  11186. })
  11187. };
  11188. return i.prototype.show = function() {
  11189. var e = this;
  11190. this.backgroundElement.style.display = "block",
  11191. this.domElement.style.display = "block",
  11192. this.domElement.style.opacity = 0,
  11193. this.domElement.style.webkitTransform = "scale(1.1)",
  11194. this.layout(),
  11195. t.defer(function() {
  11196. e.backgroundElement.style.opacity = 1,
  11197. e.domElement.style.opacity = 1,
  11198. e.domElement.style.webkitTransform = "scale(1)"
  11199. })
  11200. }
  11201. ,
  11202. i.prototype.hide = function() {
  11203. var t = this
  11204. , i = function() {
  11205. t.domElement.style.display = "none",
  11206. t.backgroundElement.style.display = "none",
  11207. e.unbind(t.domElement, "webkitTransitionEnd", i),
  11208. e.unbind(t.domElement, "transitionend", i),
  11209. e.unbind(t.domElement, "oTransitionEnd", i)
  11210. };
  11211. e.bind(this.domElement, "webkitTransitionEnd", i),
  11212. e.bind(this.domElement, "transitionend", i),
  11213. e.bind(this.domElement, "oTransitionEnd", i),
  11214. this.backgroundElement.style.opacity = 0,
  11215. this.domElement.style.opacity = 0,
  11216. this.domElement.style.webkitTransform = "scale(1.1)"
  11217. }
  11218. ,
  11219. i.prototype.layout = function() {
  11220. this.domElement.style.left = $("#player").width() / 2 - e.getWidth(this.domElement) / 2 + "px",
  11221. this.domElement.style.top = $("#player").height() / 2 - e.getHeight(this.domElement) / 2 + "px"
  11222. }
  11223. ,
  11224. i
  11225. }(n.dom.dom, n.utils.common), n.dom.dom, n.utils.common)
  11226. }
  11227. , {}],
  11228. 94: [function(e, t, i) {
  11229. (function(e) {
  11230. "use strict";
  11231. function i(t) {
  11232. function i(e) {
  11233. 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++) {
  11234. var n = _((t[i] * e + 50) / 100);
  11235. n < 1 ? n = 1 : n > 255 && (n = 255),
  11236. T[G[i]] = n
  11237. }
  11238. 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++) {
  11239. var a = _((r[o] * e + 50) / 100);
  11240. a < 1 ? a = 1 : a > 255 && (a = 255),
  11241. x[G[o]] = a
  11242. }
  11243. for (var s = [1, 1.387039845, 1.306562965, 1.175875602, 1, .785694958, .5411961, .275899379], l = 0, c = 0; c < 8; c++)
  11244. for (var h = 0; h < 8; h++)
  11245. S[l] = 1 / (T[G[l]] * s[c] * s[h] * 8),
  11246. M[l] = 1 / (x[G[l]] * s[c] * s[h] * 8),
  11247. l++
  11248. }
  11249. function n(e, t) {
  11250. for (var i = 0, n = 0, r = new Array, o = 1; o <= 16; o++) {
  11251. for (var a = 1; a <= e[o]; a++)
  11252. r[t[n]] = [],
  11253. r[t[n]][0] = i,
  11254. r[t[n]][1] = o,
  11255. n++,
  11256. i++;
  11257. i *= 2
  11258. }
  11259. return r
  11260. }
  11261. function r() {
  11262. C = n(z, W),
  11263. I = n(X, Z),
  11264. E = n(j, Y),
  11265. b = n(q, K)
  11266. }
  11267. function o() {
  11268. for (var e = 1, t = 2, i = 1; i <= 15; i++) {
  11269. for (var n = e; n < t; n++)
  11270. P[32767 + n] = i,
  11271. R[32767 + n] = [],
  11272. R[32767 + n][1] = i,
  11273. R[32767 + n][0] = n;
  11274. for (var r = -(t - 1); r <= -e; r++)
  11275. P[32767 + r] = i,
  11276. R[32767 + r] = [],
  11277. R[32767 + r][1] = i,
  11278. R[32767 + r][0] = t - 1 + r;
  11279. e <<= 1,
  11280. t <<= 1
  11281. }
  11282. }
  11283. function a() {
  11284. for (var e = 0; e < 256; e++)
  11285. H[e] = 19595 * e,
  11286. H[e + 256 >> 0] = 38470 * e,
  11287. H[e + 512 >> 0] = 7471 * e + 32768,
  11288. H[e + 768 >> 0] = -11059 * e,
  11289. H[e + 1024 >> 0] = -21709 * e,
  11290. H[e + 1280 >> 0] = 32768 * e + 8421375,
  11291. H[e + 1536 >> 0] = -27439 * e,
  11292. H[e + 1792 >> 0] = -5329 * e
  11293. }
  11294. function s(e) {
  11295. for (var t = e[0], i = e[1] - 1; i >= 0; )
  11296. t & 1 << i && (N |= 1 << B),
  11297. i--,
  11298. B--,
  11299. B < 0 && (255 == N ? (l(255),
  11300. l(0)) : l(N),
  11301. B = 7,
  11302. N = 0)
  11303. }
  11304. function l(e) {
  11305. D.push(e)
  11306. }
  11307. function c(e) {
  11308. l(e >> 8 & 255),
  11309. l(255 & e)
  11310. }
  11311. function h(e, t) {
  11312. var i, n, r, o, a, s, l, c, h, u = 0, d = 8, p = 64;
  11313. for (h = 0; h < d; ++h) {
  11314. i = e[u],
  11315. n = e[u + 1],
  11316. r = e[u + 2],
  11317. o = e[u + 3],
  11318. a = e[u + 4],
  11319. s = e[u + 5],
  11320. l = e[u + 6],
  11321. c = e[u + 7];
  11322. var f = i + c
  11323. , g = i - c
  11324. , m = n + l
  11325. , v = n - l
  11326. , A = r + s
  11327. , y = r - s
  11328. , C = o + a
  11329. , I = o - a
  11330. , E = f + C
  11331. , b = f - C
  11332. , w = m + A
  11333. , _ = m - A;
  11334. e[u] = E + w,
  11335. e[u + 4] = E - w;
  11336. var T = .707106781 * (_ + b);
  11337. e[u + 2] = b + T,
  11338. e[u + 6] = b - T,
  11339. E = I + y,
  11340. w = y + v,
  11341. _ = v + g;
  11342. var x = .382683433 * (E - _)
  11343. , S = .5411961 * E + x
  11344. , M = 1.306562965 * _ + x
  11345. , R = .707106781 * w
  11346. , P = g + R
  11347. , L = g - R;
  11348. e[u + 5] = L + S,
  11349. e[u + 3] = L - S,
  11350. e[u + 1] = P + M,
  11351. e[u + 7] = P - M,
  11352. u += 8
  11353. }
  11354. for (u = 0,
  11355. h = 0; h < d; ++h) {
  11356. i = e[u],
  11357. n = e[u + 8],
  11358. r = e[u + 16],
  11359. o = e[u + 24],
  11360. a = e[u + 32],
  11361. s = e[u + 40],
  11362. l = e[u + 48],
  11363. c = e[u + 56];
  11364. var D = i + c
  11365. , N = i - c
  11366. , B = n + l
  11367. , F = n - l
  11368. , V = r + s
  11369. , U = r - s
  11370. , k = o + a
  11371. , H = o - a
  11372. , G = D + k
  11373. , z = D - k
  11374. , W = B + V
  11375. , j = B - V;
  11376. e[u] = G + W,
  11377. e[u + 32] = G - W;
  11378. var Y = .707106781 * (j + z);
  11379. e[u + 16] = z + Y,
  11380. e[u + 48] = z - Y,
  11381. G = H + U,
  11382. W = U + F,
  11383. j = F + N;
  11384. var X = .382683433 * (G - j)
  11385. , Z = .5411961 * G + X
  11386. , q = 1.306562965 * j + X
  11387. , K = .707106781 * W
  11388. , Q = N + K
  11389. , J = N - K;
  11390. e[u + 40] = J + Z,
  11391. e[u + 24] = J - Z,
  11392. e[u + 8] = Q + q,
  11393. e[u + 56] = Q - q,
  11394. u++
  11395. }
  11396. var $;
  11397. for (h = 0; h < p; ++h)
  11398. $ = e[h] * t[h],
  11399. O[h] = $ > 0 ? $ + .5 | 0 : $ - .5 | 0;
  11400. return O
  11401. }
  11402. function u() {
  11403. c(65504),
  11404. c(16),
  11405. l(74),
  11406. l(70),
  11407. l(73),
  11408. l(70),
  11409. l(0),
  11410. l(1),
  11411. l(1),
  11412. l(0),
  11413. c(1),
  11414. c(1),
  11415. l(0),
  11416. l(0)
  11417. }
  11418. function d(e, t) {
  11419. c(65472),
  11420. c(17),
  11421. l(8),
  11422. c(t),
  11423. c(e),
  11424. l(3),
  11425. l(1),
  11426. l(17),
  11427. l(0),
  11428. l(2),
  11429. l(17),
  11430. l(1),
  11431. l(3),
  11432. l(17),
  11433. l(1)
  11434. }
  11435. function p() {
  11436. c(65499),
  11437. c(132),
  11438. l(0);
  11439. for (var e = 0; e < 64; e++)
  11440. l(T[e]);
  11441. l(1);
  11442. for (var t = 0; t < 64; t++)
  11443. l(x[t])
  11444. }
  11445. function f() {
  11446. c(65476),
  11447. c(418),
  11448. l(0);
  11449. for (var e = 0; e < 16; e++)
  11450. l(z[e + 1]);
  11451. for (var t = 0; t <= 11; t++)
  11452. l(W[t]);
  11453. l(16);
  11454. for (var i = 0; i < 16; i++)
  11455. l(j[i + 1]);
  11456. for (var n = 0; n <= 161; n++)
  11457. l(Y[n]);
  11458. l(1);
  11459. for (var r = 0; r < 16; r++)
  11460. l(X[r + 1]);
  11461. for (var o = 0; o <= 11; o++)
  11462. l(Z[o]);
  11463. l(17);
  11464. for (var a = 0; a < 16; a++)
  11465. l(q[a + 1]);
  11466. for (var s = 0; s <= 161; s++)
  11467. l(K[s])
  11468. }
  11469. function g() {
  11470. c(65498),
  11471. c(12),
  11472. l(3),
  11473. l(1),
  11474. l(0),
  11475. l(2),
  11476. l(17),
  11477. l(3),
  11478. l(17),
  11479. l(0),
  11480. l(63),
  11481. l(0)
  11482. }
  11483. function m(e, t, i, n, r) {
  11484. for (var o, a = r[0], l = r[240], c = 16, u = 63, d = 64, p = h(e, t), f = 0; f < d; ++f)
  11485. L[G[f]] = p[f];
  11486. var g = L[0] - i;
  11487. i = L[0],
  11488. 0 == g ? s(n[0]) : (o = 32767 + g,
  11489. s(n[P[o]]),
  11490. s(R[o]));
  11491. for (var m = 63; m > 0 && 0 == L[m]; m--)
  11492. ;
  11493. if (0 == m)
  11494. return s(a),
  11495. i;
  11496. for (var v, A = 1; A <= m; ) {
  11497. for (var y = A; 0 == L[A] && A <= m; ++A)
  11498. ;
  11499. var C = A - y;
  11500. if (C >= c) {
  11501. v = C >> 4;
  11502. for (var I = 1; I <= v; ++I)
  11503. s(l);
  11504. C &= 15
  11505. }
  11506. o = 32767 + L[A],
  11507. s(r[(C << 4) + P[o]]),
  11508. s(R[o]),
  11509. A++
  11510. }
  11511. return m != u && s(a),
  11512. i
  11513. }
  11514. function v() {
  11515. for (var e = String.fromCharCode, t = 0; t < 256; t++)
  11516. k[t] = e(t)
  11517. }
  11518. function A(e) {
  11519. if (e <= 0 && (e = 1),
  11520. e > 100 && (e = 100),
  11521. w != e) {
  11522. var t = 0;
  11523. t = e < 50 ? Math.floor(5e3 / e) : Math.floor(200 - 2 * e),
  11524. i(t),
  11525. w = e
  11526. }
  11527. }
  11528. function y() {
  11529. var e = (new Date).getTime();
  11530. t || (t = 50),
  11531. v(),
  11532. r(),
  11533. o(),
  11534. a(),
  11535. A(t);
  11536. (new Date).getTime() - e
  11537. }
  11538. var C, I, E, b, w, _ = (Math.round,
  11539. Math.floor), T = new Array(64), x = new Array(64), S = new Array(64), M = new Array(64), R = new Array(65535), P = new Array(65535), O = new Array(64), L = new Array(64), D = [], N = 0, B = 7, F = new Array(64), V = new Array(64), U = new Array(64), k = new Array(256), H = new Array(2048), G = [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], z = [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], X = [0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0], Z = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], q = [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];
  11540. this.encode = function(t, i) {
  11541. var n = ((new Date).getTime(),
  11542. i.quality);
  11543. n && A(n),
  11544. D = new Array,
  11545. N = 0,
  11546. B = 7,
  11547. c(65496),
  11548. u(),
  11549. p(),
  11550. d(t.width, t.height),
  11551. f(),
  11552. g();
  11553. var r = 0
  11554. , o = 0
  11555. , a = 0;
  11556. N = 0,
  11557. B = 7,
  11558. this.encode.displayName = "_encode_";
  11559. for (var l, h, v, y, w, _, T, x, R, P = t.data, O = t.width, L = t.height, k = i.flipY, G = 4 * O, z = k ? L : 0, W = k ? -8 : 8; k && z > 0 || !k && z < L; ) {
  11560. for (l = 0; l < G; ) {
  11561. for (w = G * z + l,
  11562. _ = w,
  11563. T = -1,
  11564. x = 0,
  11565. R = 0; R < 64; R++)
  11566. x = (k ? 63 - R : R) >> 3,
  11567. T = 4 * (7 & R),
  11568. _ = w + x * G + T,
  11569. z + x >= L && (_ -= G * (z + 1 + x - L)),
  11570. l + T >= G && (_ -= l + T - G + 4),
  11571. h = P[_++],
  11572. v = P[_++],
  11573. y = P[_++],
  11574. F[R] = (H[h] + H[v + 256 >> 0] + H[y + 512 >> 0] >> 16) - 128,
  11575. V[R] = (H[h + 768 >> 0] + H[v + 1024 >> 0] + H[y + 1280 >> 0] >> 16) - 128,
  11576. U[R] = (H[h + 1280 >> 0] + H[v + 1536 >> 0] + H[y + 1792 >> 0] >> 16) - 128;
  11577. r = m(F, S, r, C, E),
  11578. o = m(V, M, o, I, b),
  11579. a = m(U, M, a, I, b),
  11580. l += 32
  11581. }
  11582. z += W
  11583. }
  11584. if (B >= 0) {
  11585. var j = [];
  11586. j[1] = B + 1,
  11587. j[0] = (1 << B + 1) - 1,
  11588. s(j)
  11589. }
  11590. return c(65497),
  11591. new e(D)
  11592. }
  11593. ,
  11594. y()
  11595. }
  11596. function n(e, t) {
  11597. t = t || {},
  11598. t.quality = t.quality || 50;
  11599. var n = t.quality
  11600. , r = new i(n)
  11601. , o = r.encode(e, t);
  11602. return {
  11603. data: o,
  11604. width: e.width,
  11605. height: e.height
  11606. }
  11607. }
  11608. t.exports.encode = n
  11609. }
  11610. ).call(this, e("buffer").Buffer)
  11611. }
  11612. , {
  11613. buffer: 198
  11614. }],
  11615. 95: [function(e, t, i) {
  11616. "use strict";
  11617. !function() {
  11618. if ("performance"in window == !1 && (window.performance = {}),
  11619. Date.now = Date.now || function() {
  11620. return (new Date).getTime()
  11621. }
  11622. ,
  11623. "now"in window.performance == !1) {
  11624. var e = Date.now();
  11625. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  11626. window.performance.now = function() {
  11627. return Date.now() - e
  11628. }
  11629. }
  11630. }()
  11631. }
  11632. , {}],
  11633. 96: [function(e, t, i) {
  11634. "use strict";
  11635. var n = e("three");
  11636. n.EffectComposer = function(e, t) {
  11637. if (this.renderer = e,
  11638. void 0 === t) {
  11639. var i = {
  11640. minFilter: n.LinearFilter,
  11641. magFilter: n.LinearFilter,
  11642. format: n.RGBAFormat,
  11643. stencilBuffer: !1
  11644. }
  11645. , r = e.getSize();
  11646. t = new n.WebGLRenderTarget(r.width,r.height,i)
  11647. }
  11648. this.renderTarget1 = t,
  11649. this.renderTarget2 = t.clone(),
  11650. this.writeBuffer = this.renderTarget1,
  11651. this.readBuffer = this.renderTarget2,
  11652. this.passes = [],
  11653. void 0 === n.CopyShader && console.error("THREE.EffectComposer relies on THREE.CopyShader"),
  11654. this.copyPass = new n.ShaderPass(n.CopyShader)
  11655. }
  11656. ,
  11657. n.EffectComposer.prototype = {
  11658. swapBuffers: function() {
  11659. var e = this.readBuffer;
  11660. this.readBuffer = this.writeBuffer,
  11661. this.writeBuffer = e
  11662. },
  11663. addPass: function(e) {
  11664. this.passes.push(e)
  11665. },
  11666. insertPass: function(e, t) {
  11667. this.passes.splice(t, 0, e)
  11668. },
  11669. render: function(e) {
  11670. this.writeBuffer = this.renderTarget1,
  11671. this.readBuffer = this.renderTarget2;
  11672. var t, i, r = !1, o = this.passes.length;
  11673. for (i = 0; i < o; i++)
  11674. if (t = this.passes[i],
  11675. t.enabled) {
  11676. if (t.render(this.renderer, this.writeBuffer, this.readBuffer, e, r),
  11677. t.needsSwap) {
  11678. if (r) {
  11679. var a = this.renderer.context;
  11680. a.stencilFunc(a.NOTEQUAL, 1, 4294967295),
  11681. this.copyPass.render(this.renderer, this.writeBuffer, this.readBuffer, e),
  11682. a.stencilFunc(a.EQUAL, 1, 4294967295)
  11683. }
  11684. this.swapBuffers()
  11685. }
  11686. t instanceof n.MaskPass ? r = !0 : t instanceof n.ClearMaskPass && (r = !1)
  11687. }
  11688. },
  11689. reset: function(e) {
  11690. if (void 0 === e) {
  11691. var t = this.renderer.getSize();
  11692. e = this.renderTarget1.clone(),
  11693. e.setSize(t.width, t.height)
  11694. }
  11695. this.renderTarget1.dispose(),
  11696. this.renderTarget2.dispose(),
  11697. this.renderTarget1 = e,
  11698. this.renderTarget2 = e.clone(),
  11699. this.writeBuffer = this.renderTarget1,
  11700. this.readBuffer = this.renderTarget2
  11701. },
  11702. setSize: function(e, t) {
  11703. this.renderTarget1.setSize(e, t),
  11704. this.renderTarget2.setSize(e, t)
  11705. }
  11706. }
  11707. }
  11708. , {
  11709. three: 217
  11710. }],
  11711. 97: [function(e, t, i) {
  11712. "use strict";
  11713. var n = e("three");
  11714. n.MaskPass = function(e, t) {
  11715. this.scene = e,
  11716. this.camera = t,
  11717. this.enabled = !0,
  11718. this.clear = !0,
  11719. this.needsSwap = !1,
  11720. this.inverse = !1
  11721. }
  11722. ,
  11723. n.MaskPass.prototype = {
  11724. render: function(e, t, i, n) {
  11725. var r = e.context;
  11726. r.colorMask(!1, !1, !1, !1),
  11727. r.depthMask(!1);
  11728. var o, a;
  11729. this.inverse ? (o = 0,
  11730. a = 1) : (o = 1,
  11731. a = 0),
  11732. r.enable(r.STENCIL_TEST),
  11733. r.stencilOp(r.REPLACE, r.REPLACE, r.REPLACE),
  11734. r.stencilFunc(r.ALWAYS, o, 4294967295),
  11735. r.clearStencil(a),
  11736. e.render(this.scene, this.camera, i, this.clear),
  11737. e.render(this.scene, this.camera, t, this.clear),
  11738. r.colorMask(!0, !0, !0, !0),
  11739. r.depthMask(!0),
  11740. r.stencilFunc(r.EQUAL, 1, 4294967295),
  11741. r.stencilOp(r.KEEP, r.KEEP, r.KEEP)
  11742. }
  11743. },
  11744. n.ClearMaskPass = function() {
  11745. this.enabled = !0
  11746. }
  11747. ,
  11748. n.ClearMaskPass.prototype = {
  11749. render: function(e, t, i, n) {
  11750. var r = e.context;
  11751. r.disable(r.STENCIL_TEST)
  11752. }
  11753. }
  11754. }
  11755. , {
  11756. three: 217
  11757. }],
  11758. 98: [function(e, t, i) {
  11759. "use strict";
  11760. var n = e("three");
  11761. n.RenderPass = function(e, t, i, r, o) {
  11762. this.scene = e,
  11763. this.camera = t,
  11764. this.overrideMaterial = i,
  11765. this.clearColor = r,
  11766. this.clearAlpha = void 0 !== o ? o : 1,
  11767. this.oldClearColor = new n.Color,
  11768. this.oldClearAlpha = 1,
  11769. this.enabled = !0,
  11770. this.clear = !0,
  11771. this.needsSwap = !1
  11772. }
  11773. ,
  11774. n.RenderPass.prototype = {
  11775. render: function(e, t, i, n) {
  11776. this.scene.overrideMaterial = this.overrideMaterial,
  11777. this.clearColor && (this.oldClearColor.copy(e.getClearColor()),
  11778. this.oldClearAlpha = e.getClearAlpha(),
  11779. e.setClearColor(this.clearColor, this.clearAlpha)),
  11780. e.render(this.scene, this.camera, i, this.clear),
  11781. this.clearColor && e.setClearColor(this.oldClearColor, this.oldClearAlpha),
  11782. this.scene.overrideMaterial = null
  11783. }
  11784. }
  11785. }
  11786. , {
  11787. three: 217
  11788. }],
  11789. 99: [function(e, t, i) {
  11790. "use strict";
  11791. var n = e("three");
  11792. n.ShaderPass = function(e, t) {
  11793. this.textureID = void 0 !== t ? t : "tDiffuse",
  11794. e instanceof n.ShaderMaterial ? (this.uniforms = e.uniforms,
  11795. this.material = e) : e && (this.uniforms = n.UniformsUtils.clone(e.uniforms),
  11796. this.material = new n.ShaderMaterial({
  11797. defines: e.defines || {},
  11798. uniforms: this.uniforms,
  11799. vertexShader: e.vertexShader,
  11800. fragmentShader: e.fragmentShader
  11801. })),
  11802. this.renderToScreen = !1,
  11803. this.enabled = !0,
  11804. this.needsSwap = !0,
  11805. this.clear = !1,
  11806. this.camera = new n.OrthographicCamera(-1,1,1,-1,0,1),
  11807. this.scene = new n.Scene,
  11808. this.quad = new n.Mesh(new n.PlaneBufferGeometry(2,2),null),
  11809. this.scene.add(this.quad)
  11810. }
  11811. ,
  11812. n.ShaderPass.prototype = {
  11813. render: function(e, t, i, n) {
  11814. this.uniforms[this.textureID] && (this.uniforms[this.textureID].value = i),
  11815. this.quad.material = this.material,
  11816. this.renderToScreen ? e.render(this.scene, this.camera) : e.render(this.scene, this.camera, t, this.clear)
  11817. }
  11818. }
  11819. }
  11820. , {
  11821. three: 217
  11822. }],
  11823. 100: [function(e, t, i) {
  11824. "use strict";
  11825. var n = e("three");
  11826. n.CopyShader = {
  11827. uniforms: {
  11828. tDiffuse: {
  11829. type: "t",
  11830. value: null
  11831. },
  11832. opacity: {
  11833. type: "f",
  11834. value: 1
  11835. }
  11836. },
  11837. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11838. fragmentShader: ["uniform float opacity;", "uniform sampler2D tDiffuse;", "varying vec2 vUv;", "void main() {", "vec4 texel = texture2D( tDiffuse, vUv );", "gl_FragColor = opacity * texel;", "}"].join("\n")
  11839. }
  11840. }
  11841. , {
  11842. three: 217
  11843. }],
  11844. 101: [function(e, t, i) {
  11845. "use strict";
  11846. var n = e("three");
  11847. n.HorizontalBlurShader = {
  11848. uniforms: {
  11849. tDiffuse: {
  11850. type: "t",
  11851. value: null
  11852. },
  11853. h: {
  11854. type: "f",
  11855. value: 1 / 512
  11856. }
  11857. },
  11858. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11859. 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")
  11860. }
  11861. }
  11862. , {
  11863. three: 217
  11864. }],
  11865. 102: [function(e, t, i) {
  11866. "use strict";
  11867. var n = e("three");
  11868. n.VerticalBlurShader = {
  11869. uniforms: {
  11870. tDiffuse: {
  11871. type: "t",
  11872. value: null
  11873. },
  11874. v: {
  11875. type: "f",
  11876. value: 1 / 512
  11877. }
  11878. },
  11879. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11880. 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")
  11881. }
  11882. }
  11883. , {
  11884. three: 217
  11885. }],
  11886. 103: [function(e, t, i) {
  11887. "use strict";
  11888. var n = e("three");
  11889. !function() {
  11890. if ("performance"in window == 0 && (window.performance = {}),
  11891. "now"in window.performance == 0) {
  11892. var e = Date.now();
  11893. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  11894. window.performance.now = function() {
  11895. return Date.now() - e
  11896. }
  11897. }
  11898. }(),
  11899. n.WebGLRenderer.prototype.paramThreeToGL = function(e) {
  11900. var t, i = this.extensions, r = this.context;
  11901. if (e === n.RepeatWrapping)
  11902. return r.REPEAT;
  11903. if (e === n.ClampToEdgeWrapping)
  11904. return r.CLAMP_TO_EDGE;
  11905. if (e === n.MirroredRepeatWrapping)
  11906. return r.MIRRORED_REPEAT;
  11907. if (e === n.NearestFilter)
  11908. return r.NEAREST;
  11909. if (e === n.NearestMipMapNearestFilter)
  11910. return r.NEAREST_MIPMAP_NEAREST;
  11911. if (e === n.NearestMipMapLinearFilter)
  11912. return r.NEAREST_MIPMAP_LINEAR;
  11913. if (e === n.LinearFilter)
  11914. return r.LINEAR;
  11915. if (e === n.LinearMipMapNearestFilter)
  11916. return r.LINEAR_MIPMAP_NEAREST;
  11917. if (e === n.LinearMipMapLinearFilter)
  11918. return r.LINEAR_MIPMAP_LINEAR;
  11919. if (e === n.UnsignedByteType)
  11920. return r.UNSIGNED_BYTE;
  11921. if (e === n.UnsignedShort4444Type)
  11922. return r.UNSIGNED_SHORT_4_4_4_4;
  11923. if (e === n.UnsignedShort5551Type)
  11924. return r.UNSIGNED_SHORT_5_5_5_1;
  11925. if (e === n.UnsignedShort565Type)
  11926. return r.UNSIGNED_SHORT_5_6_5;
  11927. if (e === n.ByteType)
  11928. return r.BYTE;
  11929. if (e === n.ShortType)
  11930. return r.SHORT;
  11931. if (e === n.UnsignedShortType)
  11932. return r.UNSIGNED_SHORT;
  11933. if (e === n.IntType)
  11934. return r.INT;
  11935. if (e === n.UnsignedIntType)
  11936. return r.UNSIGNED_INT;
  11937. if (e === n.FloatType)
  11938. return r.FLOAT;
  11939. if (t = i.get("OES_texture_half_float"),
  11940. null !== t && e === n.HalfFloatType)
  11941. return t.HALF_FLOAT_OES;
  11942. if (e === n.AlphaFormat)
  11943. return r.ALPHA;
  11944. if (e === n.RGBFormat)
  11945. return r.RGB;
  11946. if (e === n.RGBAFormat)
  11947. return r.RGBA;
  11948. if (e === n.LuminanceFormat)
  11949. return r.LUMINANCE;
  11950. if (e === n.LuminanceAlphaFormat)
  11951. return r.LUMINANCE_ALPHA;
  11952. if (e === n.AddEquation)
  11953. return r.FUNC_ADD;
  11954. if (e === n.SubtractEquation)
  11955. return r.FUNC_SUBTRACT;
  11956. if (e === n.ReverseSubtractEquation)
  11957. return r.FUNC_REVERSE_SUBTRACT;
  11958. if (e === n.ZeroFactor)
  11959. return r.ZERO;
  11960. if (e === n.OneFactor)
  11961. return r.ONE;
  11962. if (e === n.SrcColorFactor)
  11963. return r.SRC_COLOR;
  11964. if (e === n.OneMinusSrcColorFactor)
  11965. return r.ONE_MINUS_SRC_COLOR;
  11966. if (e === n.SrcAlphaFactor)
  11967. return r.SRC_ALPHA;
  11968. if (e === n.OneMinusSrcAlphaFactor)
  11969. return r.ONE_MINUS_SRC_ALPHA;
  11970. if (e === n.DstAlphaFactor)
  11971. return r.DST_ALPHA;
  11972. if (e === n.OneMinusDstAlphaFactor)
  11973. return r.ONE_MINUS_DST_ALPHA;
  11974. if (e === n.DstColorFactor)
  11975. return r.DST_COLOR;
  11976. if (e === n.OneMinusDstColorFactor)
  11977. return r.ONE_MINUS_DST_COLOR;
  11978. if (e === n.SrcAlphaSaturateFactor)
  11979. return r.SRC_ALPHA_SATURATE;
  11980. if (t = i.get("WEBGL_compressed_texture_s3tc"),
  11981. null !== t) {
  11982. if (e === n.RGB_S3TC_DXT1_Format)
  11983. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  11984. if (e === n.RGBA_S3TC_DXT1_Format)
  11985. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  11986. if (e === n.RGBA_S3TC_DXT3_Format)
  11987. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  11988. if (e === n.RGBA_S3TC_DXT5_Format)
  11989. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  11990. }
  11991. if (t = i.get("WEBGL_compressed_texture_pvrtc"),
  11992. null !== t) {
  11993. if (e === n.RGB_PVRTC_4BPPV1_Format)
  11994. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  11995. if (e === n.RGB_PVRTC_2BPPV1_Format)
  11996. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  11997. if (e === n.RGBA_PVRTC_4BPPV1_Format)
  11998. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  11999. if (e === n.RGBA_PVRTC_2BPPV1_Format)
  12000. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  12001. }
  12002. if (t = i.get("WEBGL_compressed_texture_etc1"),
  12003. null !== t && e === n.RGB_ETC1_Format)
  12004. return t.COMPRESSED_RGB_ETC1_WEBGL;
  12005. if (t = i.get("EXT_blend_minmax"),
  12006. null !== t) {
  12007. if (e === n.MinEquation)
  12008. return t.MIN_EXT;
  12009. if (e === n.MaxEquation)
  12010. return t.MAX_EXT
  12011. }
  12012. return 0
  12013. }
  12014. ,
  12015. n.WebGLState = function(e, t, i) {
  12016. var r = this
  12017. , o = new n.Vector4
  12018. , a = e.getParameter(e.MAX_VERTEX_ATTRIBS)
  12019. , s = new Uint8Array(a)
  12020. , l = new Uint8Array(a)
  12021. , c = new Uint8Array(a)
  12022. , h = {}
  12023. , u = null
  12024. , d = null
  12025. , p = null
  12026. , f = null
  12027. , g = null
  12028. , m = null
  12029. , v = null
  12030. , A = null
  12031. , y = !1
  12032. , C = null
  12033. , I = null
  12034. , E = null
  12035. , b = null
  12036. , w = null
  12037. , _ = null
  12038. , T = null
  12039. , x = null
  12040. , S = null
  12041. , M = null
  12042. , R = null
  12043. , P = null
  12044. , O = null
  12045. , L = null
  12046. , D = null
  12047. , N = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)
  12048. , B = void 0
  12049. , F = {}
  12050. , V = new n.Vector4
  12051. , U = null
  12052. , k = null
  12053. , H = new n.Vector4
  12054. , G = new n.Vector4;
  12055. this.init = function() {
  12056. this.clearColor(0, 0, 0, 1),
  12057. this.clearDepth(1),
  12058. this.clearStencil(0),
  12059. this.enable(e.DEPTH_TEST),
  12060. e.depthFunc(e.LEQUAL),
  12061. e.frontFace(e.CCW),
  12062. e.cullFace(e.BACK),
  12063. this.enable(e.CULL_FACE),
  12064. this.enable(e.BLEND),
  12065. e.blendEquation(e.FUNC_ADD),
  12066. e.blendFunc(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA)
  12067. }
  12068. ,
  12069. this.initAttributes = function() {
  12070. for (var e = 0, t = s.length; e < t; e++)
  12071. s[e] = 0
  12072. }
  12073. ,
  12074. this.enableAttribute = function(i) {
  12075. if (s[i] = 1,
  12076. 0 === l[i] && (e.enableVertexAttribArray(i),
  12077. l[i] = 1),
  12078. 0 !== c[i]) {
  12079. var n = t.get("ANGLE_instanced_arrays");
  12080. n.vertexAttribDivisorANGLE(i, 0),
  12081. c[i] = 0
  12082. }
  12083. }
  12084. ,
  12085. this.enableAttributeAndDivisor = function(t, i, n) {
  12086. s[t] = 1,
  12087. 0 === l[t] && (e.enableVertexAttribArray(t),
  12088. l[t] = 1),
  12089. c[t] !== i && (n.vertexAttribDivisorANGLE(t, i),
  12090. c[t] = i)
  12091. }
  12092. ,
  12093. this.disableUnusedAttributes = function() {
  12094. for (var t = 0, i = l.length; t < i; t++)
  12095. l[t] !== s[t] && (e.disableVertexAttribArray(t),
  12096. l[t] = 0)
  12097. }
  12098. ,
  12099. this.enable = function(t) {
  12100. h[t] !== !0 && (e.enable(t),
  12101. h[t] = !0)
  12102. }
  12103. ,
  12104. this.disable = function(t) {
  12105. h[t] !== !1 && (e.disable(t),
  12106. h[t] = !1)
  12107. }
  12108. ,
  12109. this.getCompressedTextureFormats = function() {
  12110. if (null === u && (u = [],
  12111. t.get("WEBGL_compressed_texture_pvrtc") || t.get("WEBGL_compressed_texture_s3tc") || t.get("WEBGL_compressed_texture_etc1")))
  12112. for (var i = e.getParameter(e.COMPRESSED_TEXTURE_FORMATS), n = 0; n < i.length; n++)
  12113. u.push(i[n]);
  12114. return u
  12115. }
  12116. ,
  12117. this.setBlending = function(t, r, o, a, s, l, c, h) {
  12118. t === n.NoBlending ? this.disable(e.BLEND) : this.enable(e.BLEND),
  12119. t === d && h === y || (t === n.AdditiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12120. e.blendFuncSeparate(e.ONE, e.ONE, e.ONE, e.ONE)) : (e.blendEquation(e.FUNC_ADD),
  12121. e.blendFunc(e.SRC_ALPHA, e.ONE)) : t === n.SubtractiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12122. e.blendFuncSeparate(e.ZERO, e.ZERO, e.ONE_MINUS_SRC_COLOR, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  12123. e.blendFunc(e.ZERO, e.ONE_MINUS_SRC_COLOR)) : t === n.MultiplyBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12124. e.blendFuncSeparate(e.ZERO, e.ZERO, e.SRC_COLOR, e.SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  12125. e.blendFunc(e.ZERO, e.SRC_COLOR)) : h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12126. e.blendFuncSeparate(e.ONE, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12127. e.blendFuncSeparate(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)),
  12128. d = t,
  12129. y = h),
  12130. t === n.CustomBlending ? (s = s || r,
  12131. l = l || o,
  12132. c = c || a,
  12133. r === p && s === m || (e.blendEquationSeparate(i(r), i(s)),
  12134. p = r,
  12135. m = s),
  12136. o === f && a === g && l === v && c === A || (e.blendFuncSeparate(i(o), i(a), i(l), i(c)),
  12137. f = o,
  12138. g = a,
  12139. v = l,
  12140. A = c)) : (p = null,
  12141. f = null,
  12142. g = null,
  12143. m = null,
  12144. v = null,
  12145. A = null)
  12146. }
  12147. ,
  12148. this.setDepthFunc = function(t) {
  12149. if (C !== t) {
  12150. if (t)
  12151. switch (t) {
  12152. case n.NeverDepth:
  12153. e.depthFunc(e.NEVER);
  12154. break;
  12155. case n.AlwaysDepth:
  12156. e.depthFunc(e.ALWAYS);
  12157. break;
  12158. case n.LessDepth:
  12159. e.depthFunc(e.LESS);
  12160. break;
  12161. case n.LessEqualDepth:
  12162. e.depthFunc(e.LEQUAL);
  12163. break;
  12164. case n.EqualDepth:
  12165. e.depthFunc(e.EQUAL);
  12166. break;
  12167. case n.GreaterEqualDepth:
  12168. e.depthFunc(e.GEQUAL);
  12169. break;
  12170. case n.GreaterDepth:
  12171. e.depthFunc(e.GREATER);
  12172. break;
  12173. case n.NotEqualDepth:
  12174. e.depthFunc(e.NOTEQUAL);
  12175. break;
  12176. default:
  12177. e.depthFunc(e.LEQUAL)
  12178. }
  12179. else
  12180. e.depthFunc(e.LEQUAL);
  12181. C = t
  12182. }
  12183. }
  12184. ,
  12185. this.setDepthTest = function(t) {
  12186. t ? this.enable(e.DEPTH_TEST) : this.disable(e.DEPTH_TEST)
  12187. }
  12188. ,
  12189. this.setDepthWrite = function(t) {
  12190. I !== t && (e.depthMask(t),
  12191. I = t)
  12192. }
  12193. ,
  12194. this.setColorWrite = function(t) {
  12195. E !== t && (e.colorMask(t, t, t, t),
  12196. E = t)
  12197. }
  12198. ,
  12199. this.setStencilFunc = function(t, i, n) {
  12200. w === t && _ === i && T === n || (e.stencilFunc(t, i, n),
  12201. w = t,
  12202. _ = i,
  12203. T = n)
  12204. }
  12205. ,
  12206. this.setStencilOp = function(t, i, n) {
  12207. x === t && S === i && M === n || (e.stencilOp(t, i, n),
  12208. x = t,
  12209. S = i,
  12210. M = n)
  12211. }
  12212. ,
  12213. this.setStencilTest = function(t) {
  12214. t ? this.enable(e.STENCIL_TEST) : this.disable(e.STENCIL_TEST)
  12215. }
  12216. ,
  12217. this.setStencilWrite = function(t) {
  12218. b !== t && (e.stencilMask(t),
  12219. b = t)
  12220. }
  12221. ,
  12222. this.setFlipSided = function(t) {
  12223. R !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW),
  12224. R = t)
  12225. }
  12226. ,
  12227. this.setLineWidth = function(t) {
  12228. t !== P && (e.lineWidth(t),
  12229. P = t)
  12230. }
  12231. ,
  12232. this.setPolygonOffset = function(t, i, n) {
  12233. t ? this.enable(e.POLYGON_OFFSET_FILL) : this.disable(e.POLYGON_OFFSET_FILL),
  12234. !t || O === i && L === n || (e.polygonOffset(i, n),
  12235. O = i,
  12236. L = n)
  12237. }
  12238. ,
  12239. this.getScissorTest = function() {
  12240. return D
  12241. }
  12242. ,
  12243. this.setScissorTest = function(t) {
  12244. D = t,
  12245. t ? this.enable(e.SCISSOR_TEST) : this.disable(e.SCISSOR_TEST)
  12246. }
  12247. ,
  12248. this.activeTexture = function(t) {
  12249. void 0 === t && (t = e.TEXTURE0 + N - 1),
  12250. B !== t && (e.activeTexture(t),
  12251. B = t)
  12252. }
  12253. ,
  12254. this.bindTexture = function(t, i) {
  12255. void 0 === B && r.activeTexture();
  12256. var n = F[B];
  12257. void 0 === n && (n = {
  12258. type: void 0,
  12259. texture: void 0
  12260. },
  12261. F[B] = n),
  12262. n.type === t && n.texture === i || (e.bindTexture(t, i),
  12263. n.type = t,
  12264. n.texture = i)
  12265. }
  12266. ,
  12267. this.compressedTexImage2D = function() {
  12268. try {
  12269. e.compressedTexImage2D.apply(e, arguments)
  12270. } catch (e) {
  12271. console.error(e)
  12272. }
  12273. }
  12274. ,
  12275. this.texImage2D = function() {
  12276. try {
  12277. e.texImage2D.apply(e, arguments)
  12278. } catch (e) {
  12279. console.error(e)
  12280. }
  12281. }
  12282. ,
  12283. this.clearColor = function(t, i, n, r) {
  12284. o.set(t, i, n, r),
  12285. V.equals(o) === !1 && (e.clearColor(t, i, n, r),
  12286. V.copy(o))
  12287. }
  12288. ,
  12289. this.clearDepth = function(t) {
  12290. U !== t && (e.clearDepth(t),
  12291. U = t)
  12292. }
  12293. ,
  12294. this.clearStencil = function(t) {
  12295. k !== t && (e.clearStencil(t),
  12296. k = t)
  12297. }
  12298. ,
  12299. this.scissor = function(t) {
  12300. H.equals(t) === !1 && (e.scissor(t.x, t.y, t.z, t.w),
  12301. H.copy(t))
  12302. }
  12303. ,
  12304. this.viewport = function(t) {
  12305. G.equals(t) === !1 && (e.viewport(t.x, t.y, t.z, t.w),
  12306. G.copy(t))
  12307. }
  12308. ,
  12309. this.reset = function() {
  12310. for (var t = 0; t < l.length; t++)
  12311. 1 === l[t] && (e.disableVertexAttribArray(t),
  12312. l[t] = 0);
  12313. h = {},
  12314. u = null,
  12315. B = void 0,
  12316. F = {},
  12317. d = null,
  12318. E = null,
  12319. I = null,
  12320. b = null,
  12321. R = null
  12322. }
  12323. }
  12324. }
  12325. , {
  12326. three: 217
  12327. }],
  12328. 104: [function(e, t, i) {
  12329. (function(i, n) {
  12330. "use strict";
  12331. function r(e) {
  12332. this.urls = e;
  12333. var t = i("bWVzc2FnZSBiaW5hcnlfbWVzaCB7CglyZXBlYXRlZCBjaHVua19zaW1wbGUgY2h1bmsgPSAxOwoJcmVwZWF0ZWQgY2h1bmtfcXVhbnRpemVkIHF1YW50aXplZF9jaHVuayA9IDI7Cn0KCi8vIERlZmluaXRpb24gb2YgdmVydGljZXM6IDNEIGNvb3JkaW5hdGVzLCBhbmQgMkQgdGV4dHVyZSBjb29yZGluYXRlcy4KbWVzc2FnZSB2ZXJ0aWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgZmxvYXQgeHl6ID0gMSBbcGFja2VkPXRydWVdOyAgLy8geF8wLHlfMCx6XzAsIHhfMSx5XzEsel8xLCAuLi4KCXJlcGVhdGVkIGZsb2F0IHV2ID0gMiBbcGFja2VkPXRydWVdOyAgLy8gdV8wLHZfMCwgdV8xLHZfMSwgLi4uCn0KCi8vIEluZGV4ZXMgb2YgdmVydGljZXMgb2YgZmFjZXMKbWVzc2FnZSBmYWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgdWludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgovLyBBIHNpbXBseSBlbmNvZGVkIGNodW5rLgovLyBUT0RPOiBhZGQgY2h1bmsgcHJvcGVyaXRlcyAoc3VjaCBhcyAicmVmbGVjdGl2ZSIpCm1lc3NhZ2UgY2h1bmtfc2ltcGxlIHsKCW9wdGlvbmFsIHZlcnRpY2VzX3NpbXBsZSB2ZXJ0aWNlcyA9IDE7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSAyOwoJb3B0aW9uYWwgc3RyaW5nIGNodW5rX25hbWUgPSAzOwoJb3B0aW9uYWwgc3RyaW5nIG1hdGVyaWFsX25hbWUgPSA0Owp9CgovLyBRdWFudGl6ZWQgdmVyc2lvbnMgZm9sbG93OgptZXNzYWdlIHZlcnRpY2VzX3F1YW50aXplZCB7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAxOwoJcmVwZWF0ZWQgZmxvYXQgdHJhbnNsYXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHggPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgeSA9IDQgW3BhY2tlZD10cnVlXTsKCXJlcGVhdGVkIHNpbnQzMiB6ID0gNSBbcGFja2VkPXRydWVdOwp9CgptZXNzYWdlIHV2X3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgbmFtZSA9IDE7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHUgPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgdiA9IDQgW3BhY2tlZD10cnVlXTsKfQoKLy8gSW5kZXhlcyBvZiB2ZXJ0aWNlcyBvZiBmYWNlcwptZXNzYWdlIGZhY2VzX2NvbXByZXNzZWQgewoJcmVwZWF0ZWQgc2ludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgptZXNzYWdlIGNodW5rX3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgY2h1bmtfbmFtZSA9IDE7CglvcHRpb25hbCBzdHJpbmcgbWF0ZXJpYWxfbmFtZSA9IDI7CglvcHRpb25hbCB2ZXJ0aWNlc19xdWFudGl6ZWQgdmVydGljZXMgPSAzOwoJcmVwZWF0ZWQgdXZfcXVhbnRpemVkIHV2cyA9IDQ7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSA1Owp9Cg==", "base64");
  12334. this.builder = a.loadProto(t),
  12335. this.decoder = this.builder.build("binary_mesh")
  12336. }
  12337. var o = e("three")
  12338. , a = e("protobufjs")
  12339. , s = e("../util/logger")
  12340. , l = (e("../util/common"),
  12341. e("../util/ajax"))
  12342. , c = e("../objects/Chunk")
  12343. , h = new s(n);
  12344. r.prototype = {
  12345. constructor: r,
  12346. load: function(e, t, i, n) {
  12347. return h.time("download"),
  12348. l.get(e, {
  12349. responseType: "arraybuffer"
  12350. }).done(function(r) {
  12351. h.timeEnd("download"),
  12352. this.parse(r, e, t, i, n)
  12353. }
  12354. .bind(this)).fail(n)
  12355. },
  12356. parse: function(e, t, i, n, r) {
  12357. var o = this.readProtobuf(e);
  12358. if (!o)
  12359. return r();
  12360. try {
  12361. h.time("convert to webgl"),
  12362. this.convertProtobufToSceneObject(o, t, i, n, r),
  12363. h.timeEnd("convert to webgl")
  12364. } catch (e) {
  12365. return h.error("failed parsing .dam"),
  12366. h.error(e.message),
  12367. r()
  12368. }
  12369. },
  12370. readProtobuf: function(e) {
  12371. var t;
  12372. try {
  12373. h.time("parse proto"),
  12374. t = this.decoder.decode(e),
  12375. h.timeEnd("parse proto")
  12376. } catch (e) {
  12377. return h.error("failed parsing proto for .dam"),
  12378. h.error(e.message),
  12379. null
  12380. }
  12381. return t
  12382. },
  12383. convertProtobufToSceneObject: function(e, t, i, n, r) {
  12384. function a(e) {
  12385. var i = new o.BufferGeometry;
  12386. return i.addAttribute("position", new o.BufferAttribute(new Float32Array(e.vertices.xyz,0,3),3)),
  12387. e.vertices.uv.length > 0 && i.addAttribute("uv", new o.BufferAttribute(new Float32Array(e.vertices.uv,0,2),2)),
  12388. i.setIndex(new o.BufferAttribute(new Uint32Array(e.faces.faces,0,1),1)),
  12389. i.applyMatrix(s),
  12390. i.computeBoundingBox(),
  12391. new c({
  12392. geometry: i,
  12393. textureName: e.material_name,
  12394. name: e.chunk_name,
  12395. meshUrl: t
  12396. })
  12397. }
  12398. if (0 === e.chunk.length)
  12399. return h.warn("No chunks in damfile..."),
  12400. i([]);
  12401. var s = new o.Matrix4;
  12402. s.set(1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1);
  12403. var l = e.chunk.map(a);
  12404. return l ? i(l) : (h.error(".dam protobuf came out with no chunks..."),
  12405. r())
  12406. }
  12407. },
  12408. t.exports = r
  12409. }
  12410. ).call(this, e("buffer").Buffer, "/js/loaders/DamLoader.js")
  12411. }
  12412. , {
  12413. "../objects/Chunk": 144,
  12414. "../util/ajax": 181,
  12415. "../util/common": 185,
  12416. "../util/logger": 189,
  12417. buffer: 198,
  12418. protobufjs: 214,
  12419. three: 217
  12420. }],
  12421. 105: [function(e, t, i) {
  12422. (function(i) {
  12423. "use strict";
  12424. var n = (e("three"),
  12425. e("../settings"),
  12426. e("../util/browser"),
  12427. e("./DamLoader"))
  12428. , r = e("../util/logger")
  12429. , o = (e("../ab"),
  12430. new r(i));
  12431. t.exports = {
  12432. getLoaders: function() {
  12433. return [["_50k", ".dam", n], ["", ".dam", n]]
  12434. },
  12435. load: function(e, t, i, n, r, a) {
  12436. var s = this.getLoaders();
  12437. a = a || 0;
  12438. var l = s[a];
  12439. if (!l)
  12440. return void (r && r("No suitable model file found..."));
  12441. var c = l[0]
  12442. , h = l[1]
  12443. , u = new l[2](t)
  12444. , d = t.get(e + c + h);
  12445. d ? (o.debug("Trying " + c + h),
  12446. u.load(d, i, n, function() {
  12447. this.load(e, t, i, n, r, ++a)
  12448. }
  12449. .bind(this))) : (o.debug("Skipping " + h + ", not available"),
  12450. this.load(e, t, i, n, r, ++a))
  12451. }
  12452. }
  12453. }
  12454. ).call(this, "/js/loaders/ModelLoader.js")
  12455. }
  12456. , {
  12457. "../ab": 3,
  12458. "../settings": 166,
  12459. "../util/browser": 182,
  12460. "../util/logger": 189,
  12461. "./DamLoader": 104,
  12462. three: 217
  12463. }],
  12464. 106: [function(e, t, i) {
  12465. (function(i) {
  12466. "use strict";
  12467. var n = e("../util/common")
  12468. , r = e("../util/texture")
  12469. , o = e("../util/browser")
  12470. , a = e("../util/logger")
  12471. , s = e("../settings")
  12472. , l = new a(i);
  12473. t.exports = {
  12474. load: function(e, t) {
  12475. function i(e, i) {
  12476. e || (t.push(i),
  12477. p++,
  12478. d.notify(p, a),
  12479. p === a && d.resolve())
  12480. }
  12481. if (!e.chunks[0] || !e.chunks[0].meshUrl)
  12482. return $.when();
  12483. var a = n.countUnique(e.chunks.map(function(e) {
  12484. return e.textureName
  12485. }))
  12486. , c = e.chunks[0].meshUrl.indexOf("_50k") !== -1 ? "_50k" : ""
  12487. , h = "_50k" === c ? "high" : "low";
  12488. s.minimalMemoryMode && "high" === h && (o.detectSamsungS6() ? (l.warn("Galaxy S6 cannot handle large textures, turning down quality."),
  12489. h = "low") : a > s.maxMobileTextures && (l.warn("Model probably too large for mobile, turning down quality."),
  12490. h = "low"));
  12491. var u = e.data.job.uuid + c + "_texture_jpg_" + h + "/"
  12492. , d = $.Deferred()
  12493. , p = 0;
  12494. return e.chunks.forEach(function(t) {
  12495. if (!t.material.map && t.textureName) {
  12496. var n = e.urls.get(u + t.textureName);
  12497. t.setTextureMap(r.load(n, i.bind(this, r.isLoaded(n))))
  12498. }
  12499. }),
  12500. d.promise()
  12501. }
  12502. }
  12503. }
  12504. ).call(this, "/js/loaders/ModelTextureLoader.js")
  12505. }
  12506. , {
  12507. "../settings": 166,
  12508. "../util/browser": 182,
  12509. "../util/common": 185,
  12510. "../util/logger": 189,
  12511. "../util/texture": 194
  12512. }],
  12513. 107: [function(e, t, i) {
  12514. (function(i, n) {
  12515. "use strict";
  12516. function r(e) {
  12517. this.model = e,
  12518. this.modelDataPath = this.model.urls.get("vision.modeldata"),
  12519. this.sweepLocationsPath = this.model.urls.get("sweep_locations.csv");
  12520. var t = i("Ly8gUHJvdG9jb2wgQnVmZmVyIGZvciBwdWNrIHZpc2liaWxpdHkgYW5kIHJlbGF0ZWQgZGF0YQovLwovLyBUbyBkdW1wIG91dCBhIGJpbnJheSBtYW5pZmVzdCBpbiB0ZXh0IGZvcm1hdCwgeW91IGNhbiB1c2UgcHJvdG9jIGRpcmVjdGx5OgovLyAgIHByb3RvYyAtLXByb3RvX3BhdGggfi9kZXYvbXBfdmlzaW9uLyAgLS1kZWNvZGU9ZW9zLnN0b3JhZ2UuVmlzaW9uTW9kZWxkYXRhIH4vZGV2L21wX3Zpc2lvbi9lb3Mvc3RvcmFnZS92aXNpb25fbW9kZWxkYXRhLnByb3RvIDwgdmlzaW9uLm1vZGVsZGF0YQoKLy8gcGFja2FnZSBlb3Muc3RvcmFnZTsKCi8vIGltcG9ydCAiZW9zL2luZnJhL2NvbW1vbi5wcm90byI7Ci8vIFRoZSBmb2xsb3dpbmcgd2VyZSBtYW51YWxseSBleHRyYWN0ZWQgaGVyZSwgSlMgZG9lcyBub3QgbGlrZSBwcm90b2J1ZiBpbXBvcnRzCgptZXNzYWdlIEFmZmluZTNmIHsKCW9wdGlvbmFsIFF1YXRlcm5pb25mIHJvdGF0aW9uID0gMTsKCW9wdGlvbmFsIFZlY3RvcjNmIHRyYW5zbGF0aW9uID0gMjsKfQoKbWVzc2FnZSBRdWF0ZXJuaW9uZiB7CglvcHRpb25hbCBmbG9hdCB3ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHggPSAyOwoJb3B0aW9uYWwgZmxvYXQgeSA9IDM7CglvcHRpb25hbCBmbG9hdCB6ID0gNDsKfQoKbWVzc2FnZSBWZWN0b3IzZiB7CglvcHRpb25hbCBmbG9hdCB4ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHkgPSAyOwoJb3B0aW9uYWwgZmxvYXQgeiA9IDM7Cn0KCi8vCi8vIE9uZSBzd2VlcCAvIHBhbm8KLy8KbWVzc2FnZSBTd2VlcExvY2F0aW9uIHsKCW9wdGlvbmFsIGJ5dGVzIHV1aWQgPSAxOyAgLyogdXVpZCAqLwoJb3B0aW9uYWwgQWZmaW5lM2YgcG9zZSA9IDI7ICAvKiBjYW1lcmEgcG9zZSAoeCwgeSx6KSBpbiBtZXRlciBhbmQgYSBxdWF0ZXJuaW9uKi8KCW9wdGlvbmFsIFZlY3RvcjNmIHB1Y2sgPSAzOyAgLyogcHVjayBsb2NhdGlvbiAtIHggYW55IGlzIGdlbmVyYWxseSB0aGUgc2FtZSBhcyBwb3NlLCB6IGlzIHRoZSBoZWlnaHQgb2YgdGhlIGNsb3Nlc3QgZmxvb3IgdW5kZXIgdGhlIGNhbWVyYSAqLwoJb3B0aW9uYWwgaW50MzIgZ3JvdXAgPSA0OyAgLyogZmxvb3IgaW5kZXggKi8KCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gNTsgIC8qIHJvb20gaW5kZXggKi8KCXJlcGVhdGVkIGludDMyIHZpc2libGVzID0gNjsgIC8qIGxpc3Qgb2YgaW5kaWNlcyB0byBhbGwgcHVja3MgdmlzaWJsZSBmcm9tIHRoaXMgcHVjayAqLwoJcmVwZWF0ZWQgZmxvYXQgc2NvcmVzID0gNzsgLyogdXNlZCBhcyBwYXJ0IG9mIHNjb3JpbmcgZnVuY3Rpb24gZm9yIGRldGVybWluaW5nIHdoaWNoIHB1Y2sgdG8gZ28gdG8gbmV4dCAqLwogIG9wdGlvbmFsIHN0cmluZyBzd2VlcF9uYW1lID0gODsKCiAgLy8gV2l0aCBvdXRkb29yIHBhbm9zLCB3ZSBoYXZlIGEgY291cGxlIG9mIGRpZmZlcmVudCBzaXR1YXRpb25zIGZvciBhbGlnbm1lbnQuIFRoZSBjb21tb24KICAvLyBjYXNlIGlzIHRoYXQgdGhlIHBhbm8gYWxpZ25lZCBub3JtYWxseS4gSXQgY291bGQgYWxzbyBoYXZlIGJlZW4gcGxhY2VkIG1hbnVhbGx5IGluCiAgLy8gQ2FwdHVyZUFwcCBvciBXb3Jrc2hvcCwgb3IgbGVmdCB1bmFsaWduZWQgZm9yIGhpZ2hsaWdodC1yZWVsIHZpZXdpbmcuCiAgZW51bSBBbGlnbm1lbnRUeXBlCiAgewogICAgICBVTktOT1dOID0gMDsKICAgICAgQUxJR05FRCA9IDE7CiAgICAgIFVOQUxJR05FRCA9IDI7CiAgICAgIE1BTlVBTExZX1BMQUNFRCA9IDM7CiAgfQogIG9wdGlvbmFsIEFsaWdubWVudFR5cGUgYWxpZ25tZW50X3R5cGUgPSA5IFtkZWZhdWx0ID0gQUxJR05FRF07Cn0KCm1lc3NhZ2UgU3ViZ3JvdXBJbmZvIHsKCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gMTsKCW9wdGlvbmFsIGZsb2F0IGFyZWEgPSAyOyAvKiBmbG9vciBhcmVhIGluIG1eMiAoc3F1YXJlIG1ldGVyYWdlKSAqLwp9CgovKiBBbGwgcHVja3MgaW4gYSBtb2RlbC4gUHVja3MgYXJlIHN0b3JlZCBpbiBzY2FubmluZyBvcmRlci4gKi8KbWVzc2FnZSBWaXNpb25Nb2RlbGRhdGEgewoJcmVwZWF0ZWQgU3dlZXBMb2NhdGlvbiBzd2VlcExvY2F0aW9ucyA9IDE7CglyZXBlYXRlZCBTdWJncm91cEluZm8gc3ViZ3JvdXBJbmZvcyA9IDI7Cn0K", "base64")
  12521. , n = o.loadProto(t);
  12522. this.decoder = n.build("VisionModeldata")
  12523. }
  12524. var o = e("protobufjs")
  12525. , a = e("../util/ajax")
  12526. , s = (e("../util/common"),
  12527. e("../util/math"))
  12528. , l = e("../util/logger")
  12529. , c = new l(n);
  12530. r.prototype.load = function() {
  12531. return this.modelDataPath ? (c.info("Using vision.modeldata"),
  12532. this.loadVisionModelData()) : this.sweepLocationsPath ? (c.warn("Using sweep_locations.csv"),
  12533. this.loadSweepLocationsCSV()) : (c.warn("No sweep file found"),
  12534. $.when([]))
  12535. }
  12536. ,
  12537. r.prototype.loadVisionModelData = function() {
  12538. return a.get(this.modelDataPath, {
  12539. responseType: "arraybuffer"
  12540. }).then(function(e) {
  12541. var t;
  12542. try {
  12543. t = this.decoder.decode(e)
  12544. } catch (e) {
  12545. return c.warn("Could not decode vision.modeldata, trying sweep_locations.csv"),
  12546. this.loadSweepLocationsCSV()
  12547. }
  12548. var i = t.sweepLocations.map(function(e) {
  12549. return {
  12550. uuid: e.uuid.toUTF8().replace(/-/g, ""),
  12551. position: {
  12552. x: e.pose.translation.x,
  12553. y: e.pose.translation.y,
  12554. z: e.pose.translation.z
  12555. },
  12556. quaternion: {
  12557. x: e.pose.rotation.x,
  12558. y: e.pose.rotation.y,
  12559. z: e.pose.rotation.z,
  12560. w: e.pose.rotation.w
  12561. },
  12562. puck: {
  12563. x: e.puck.x,
  12564. y: e.puck.y,
  12565. z: e.puck.z
  12566. },
  12567. floor: e.group,
  12568. neighbours: e.visibles,
  12569. alignmentType: e.alignment_type
  12570. }
  12571. }).map(function(e) {
  12572. return e.position = s.convertVisionVector(e.position),
  12573. e.quaternion = s.convertVisionQuaternion(e.quaternion),
  12574. e.puck = s.convertVisionVector(e.puck),
  12575. e
  12576. });
  12577. return i.forEach(function(e) {
  12578. e.neighbours = e.neighbours.map(function(e) {
  12579. return i[e].uuid
  12580. })
  12581. }),
  12582. i
  12583. }
  12584. .bind(this), function() {
  12585. return c.warn("Could not load vision.modeldata, trying sweep_locations.csv"),
  12586. this.loadSweepLocationsCSV()
  12587. }
  12588. .bind(this))
  12589. }
  12590. ,
  12591. r.prototype.loadSweepLocationsCSV = function() {
  12592. return a.get(this.sweepLocationsPath).then(function(e) {
  12593. var t = e.split("\n").map(function(e) {
  12594. return e.split(", ")
  12595. }).filter(function(e) {
  12596. return e.length > 1
  12597. }).map(function(e) {
  12598. return {
  12599. uuid: e[0],
  12600. position: {
  12601. x: parseFloat(e[1]),
  12602. y: parseFloat(e[2]),
  12603. z: parseFloat(e[3])
  12604. },
  12605. quaternion: {
  12606. x: parseFloat(e[4]),
  12607. y: parseFloat(e[5]),
  12608. z: parseFloat(e[6]),
  12609. w: parseFloat(e[7])
  12610. }
  12611. }
  12612. }).map(function(e) {
  12613. return e.position = s.convertVisionVector(e.position),
  12614. e.quaternion = s.convertVisionQuaternion(e.quaternion),
  12615. e
  12616. });
  12617. return t
  12618. }).fail(function() {
  12619. c.warn("Could not load sweep_locations.csv, no sweeps loaded.")
  12620. })
  12621. }
  12622. ,
  12623. t.exports = r
  12624. }
  12625. ).call(this, e("buffer").Buffer, "/js/loaders/SweepDataLoader.js")
  12626. }
  12627. , {
  12628. "../util/ajax": 181,
  12629. "../util/common": 185,
  12630. "../util/logger": 189,
  12631. "../util/math": 190,
  12632. buffer: 198,
  12633. protobufjs: 214
  12634. }],
  12635. 108: [function(e, t, i) {
  12636. (function(i) {
  12637. "use strict";
  12638. function n() {
  12639. this.locale = null
  12640. }
  12641. var r = e("../settings")
  12642. , o = e("../util/common")
  12643. , a = e("../util/logger")
  12644. , s = e("../enum/Locale")
  12645. , l = new a(i);
  12646. n.prototype.init = function() {
  12647. var t;
  12648. switch (r.languageTag) {
  12649. case null:
  12650. case "en":
  12651. case s.EN_US:
  12652. this.locale = s.EN_US,
  12653. t = e("./strings-en-US");
  12654. break;
  12655. case "es":
  12656. case s.ES_MX:
  12657. this.locale = s.ES_MX,
  12658. t = e("./strings-es-MX");
  12659. break;
  12660. case "fr":
  12661. case s.FR_FR:
  12662. this.locale = s.FR_FR,
  12663. t = e("./strings-fr-FR");
  12664. break;
  12665. case "de":
  12666. case s.DE_DE:
  12667. this.locale = s.DE_DE,
  12668. t = e("./strings-de-DE");
  12669. break;
  12670. case "ru":
  12671. case s.RU_RU:
  12672. this.locale = s.RU_RU,
  12673. t = e("./strings-ru-RU");
  12674. break;
  12675. case "cn":
  12676. case s.CN_CN:
  12677. this.locale = s.CN_CN,
  12678. t = e("./strings-cn-CN");
  12679. break;
  12680. case "jp":
  12681. case s.JP_JP:
  12682. this.locale = s.JP_JP,
  12683. t = e("./strings-jp-JP");
  12684. break;
  12685. default:
  12686. l.info("Unsupported language tag, defaulting to 'en-US'"),
  12687. this.locale = s.EN_US,
  12688. t = e("./strings-en-US")
  12689. }
  12690. l.info("Using locale '" + this.locale + "'"),
  12691. o.extendObject(this, t)
  12692. }
  12693. ,
  12694. n.prototype.localizeGUI = function() {
  12695. var e = document.querySelector("#gui-parent");
  12696. this.localizeTree(e),
  12697. this.localizeLoadingText()
  12698. }
  12699. ,
  12700. n.prototype.localizeLoadingText = function() {
  12701. var e = document.querySelector("#loader-cont")
  12702. , t = e.getAttribute("title");
  12703. e.removeAttribute("title"),
  12704. e.setAttribute("data-status", t),
  12705. e.classList.add(this.locale),
  12706. document.querySelector("#help-dialog").classList.add(this.locale),
  12707. document.querySelector("#interaction-modal").classList.add(this.locale),
  12708. document.querySelector("#gui").classList.add(this.locale)
  12709. }
  12710. ,
  12711. n.prototype.localizeTree = function(e) {
  12712. var t, i, n = /{\[{ ?(\w+) ?}\]}/;
  12713. if (e.nodeType === Node.TEXT_NODE)
  12714. t = e.data.match(n),
  12715. t && (i = t[1],
  12716. e.data = this.localizeText(i) || i);
  12717. else if (e.nodeType === Node.ELEMENT_NODE) {
  12718. var r = e.getAttribute("title");
  12719. r && (t = r.match(n),
  12720. t && (i = t[1],
  12721. e.setAttribute("title", this.localizeText(i) || i)))
  12722. }
  12723. for (e = e.firstChild; e; )
  12724. this.localizeTree(e),
  12725. e = e.nextSibling
  12726. }
  12727. ,
  12728. n.prototype.localizeText = function(t) {
  12729. var i = this[t];
  12730. return i || this.locale === s.EN_US || (l.warn("Localization key '" + t + "' not available for locale '" + this.locale + "', defaulting to English."),
  12731. i = e("./strings-en-US")[t]),
  12732. i || l.warn("Localization key '" + t + "' not available for locale 'en-US'"),
  12733. i
  12734. }
  12735. ,
  12736. t.exports = new n
  12737. }
  12738. ).call(this, "/js/localization/localize.js")
  12739. }
  12740. , {
  12741. "../enum/Locale": 31,
  12742. "../settings": 166,
  12743. "../util/common": 185,
  12744. "../util/logger": 189,
  12745. "./strings-cn-CN": 109,
  12746. "./strings-de-DE": 110,
  12747. "./strings-en-US": 111,
  12748. "./strings-es-MX": 112,
  12749. "./strings-fr-FR": 113,
  12750. "./strings-jp-JP": 114,
  12751. "./strings-ru-RU": 115
  12752. }],
  12753. 109: [function(e, t, i) {
  12754. "use strict";
  12755. t.exports = {
  12756. PAGE_TITLE: "",
  12757. LOADING: "正在加载",
  12758. PRESENTED_BY_CAPS: "呈现者:",
  12759. POWERED_BY: "技术支持:",
  12760. POWERED_BY_CAPS: "技术支持:",
  12761. DESKTOP_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  12762. MOBILE_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  12763. PRESENTED_BY: "呈现者:",
  12764. MORE: "更多 ",
  12765. LESS: "更少 ",
  12766. TAG_CONTENT: "tag™ 内容",
  12767. SHOW: "显示",
  12768. HIDE: "隐藏",
  12769. DOLLHOUSE: "场景屋",
  12770. FLOOR_PLAN: "楼层平面图",
  12771. OPEN_HIGHLIGHTS: "打开精彩片段",
  12772. CLOSE_HIGHLIGHTS: "关闭",
  12773. PREVIOUS: "上一个",
  12774. PLAY: "播放",
  12775. PAUSE: "暂停",
  12776. NEXT: "下一个",
  12777. EXPLORE_3D_SPACE: "探索 3D 空间",
  12778. VIEW_DOLLHOUSE: "观看场景屋",
  12779. SOCIAL_SHARING: "分享这个空间",
  12780. VIEW_IN_VR: "以 VR 观看",
  12781. VIEW_FULLSCREEN: "全屏观看",
  12782. EXIT_FULLSCREEN: " 退出全屏",
  12783. ZOOM_IN: "放大",
  12784. ZOOM_OUT: "缩小",
  12785. FLOOR_NAME: "楼层",
  12786. FLOOR_ALL: "全部",
  12787. TERMS: "条款",
  12788. PORT_TERMS: "port 条款",
  12789. TERMS_OF_USE: "使用条款",
  12790. CLOSE_TERMS: "关闭",
  12791. TERMS_TEXT_FILE: "terms-cn-CN.html",
  12792. TERMS_FAIL: "无法获取条款。请确保您有互联网连接以查看使用条款。",
  12793. WEBVR_FOR_DAYDREAM: "用于 Daydream 视图",
  12794. WEBVR_ENTER_WEBVR: "进入 VR",
  12795. WEBVR_DIFFERENT_HEADSET: "有其他耳机吗?",
  12796. WEBVR_LEARN_MORE: "了解更多",
  12797. WEBVR_VIEW_SPACE: "在 VR 中观看空间",
  12798. WEBVR_DAYDREAM_VIEW: "Daydream 视图",
  12799. WEBVR_DAYDREAM_PHONE: "支持 Daydream 的手机",
  12800. WEBVR_FOR_CARDBOARD: "用于 Google Cardboard",
  12801. WEBVR_VIEW_CARDBOARD: "或在 Google Cardboard 上观看",
  12802. VR_VIEW_SPACE: "在虚拟现实中观看空间",
  12803. VR_LEARN_MORE_CAPS: "了解更多",
  12804. VR_PREVIOUS_CAPS: "上一个’,",
  12805. VR_NEXT_CAPS: "下一个",
  12806. VR_GOT_IT_CAPS: "明白了",
  12807. VR_SHOW_SUPPORTED: "点击以使用 VR 观看空间",
  12808. VR_SHOW_UNSUPPORTED: "很遗憾,您的设备不符合在 VR 中观看空间的最低要求。",
  12809. VR_SHOW_IOS_1: "点击以使用 VR 观看空间",
  12810. VR_SHOW_IOS_2: "需要有 port VR 应用程序和兼容的 iPhone 才能观看",
  12811. VR_WHAT_YOU_NEED: "关于...您需要什么",
  12812. VR_NEED_CARDBOARD: "您使用 Google Cardboard 时需要什么",
  12813. VR_NEED_SAMSUNG: "您使用 Samsung Gear VR 时需要什么",
  12814. VR_NEED_DAYDREAM: "需要事先与 DAYDREAM VIEW 配对",
  12815. VR_NEED_DAYDREAM_PHONE: "支持 Daydream 的手机",
  12816. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  12817. VR_GOOGLE_DAYDREAM: "Google Daydream",
  12818. VR_APP: "port VR 应用程序",
  12819. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  12820. VR_COMPATIBLE_IPHONES_1: "iPhones",
  12821. VR_COMPATIBLE_IPHONES_2: "iPhone 5s 和更高版本,运行 iOS 9.1 和更高版本",
  12822. VR_COMPATIBLE_IPHONES_3: "兼容的 iPhone",
  12823. VR_COMPATIBLE_ANDROID: "兼容的 Android 设备",
  12824. VR_COMPATIBLE_ANDROID_LONG: "4.5-5.5 英寸、运行 Android OS 4.4.4 和更高版本的兼容型 Android 设备显示屏",
  12825. VR_ANDROID_DETAIL: "4.5 至 5.5 英寸、运行 Android OS 4.4.4 和更高版本的显示屏",
  12826. VR_ANDROID_DVICES: "Android 设备",
  12827. VR_COMPATIBLE_SAMSUNG: "兼容的 Samsung 设备",
  12828. VR_SAMSUNG_DETAIL: "Galaxy S6 和更高版本",
  12829. VR_APP_FOR_CARDBOARD: "用于 Google Cardboard 的 port VR 应用程序",
  12830. VR_APP_FOR_SAMSUNG: "用于 Gear VR 的 port VR 应用程序",
  12831. VR_APP_FOR_ANDROID: "用于 Android 手机的 port VR 应用程序",
  12832. VR_APP_OPEN: "请使用 port VR 应用程序打开",
  12833. VR_DOWNLOAD_HERE: "在此下载",
  12834. VR_REQUIRE_HEADSET: "需要一副 VR 耳机并安装用于 Android 的 port VR 应用程序",
  12835. VR_REDIRECT_TO_STORE: "如果未安装应用程序,您将跳转到应用程序商店。",
  12836. VR_IMPROPER_EMBED: "port 空间未正确嵌入,无法在您的 Web 浏览器支持 VR。",
  12837. VR_OPEN_ANDROID_LINK: "在您的手机上打开链接",
  12838. VR_ANDROID_OPTIONS: "可用的 VR 耳机选项",
  12839. SHARE_TO: "分享到",
  12840. SHARE_LINK: "直接链接",
  12841. SHARE_EXPLORE: "探索",
  12842. SHARE_AT: "在",
  12843. SHARE_WITH: "使用",
  12844. SHARE_3D: "以 3D",
  12845. SHARE_COPIED: "已复制!",
  12846. ERROR_BROWSER_SOLUTION: "安装更新的浏览器以探索 3D。",
  12847. ERROR_BROWSER_EXPLANATION: "WebGL 需要现代的浏览器。",
  12848. ERROR_GENERIC_PROBLEM: "糟糕,出现问题。",
  12849. ERROR_GENERIC_SOLUTION: "重新启动您的浏览器。",
  12850. ERROR_GENERIC_ACTIONS_1: "如果问题仍然存在,",
  12851. ERROR_GENERIC_ACTIONS_2: "请安装支持的浏览器",
  12852. ERROR_GENERIC_ACTIONS_3: " 或",
  12853. ERROR_GENERIC_ACTIONS_4: "查看我们的故障排除指南",
  12854. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "浏览器不受支持。",
  12855. ERROR_WEBGL_IOS_PROBLEM: "iOS 版本不受支持。",
  12856. ERROR_WEBGL_IOS_SOLUTION: "升级到 iOS 8 或更高版本以在 3D 中探索。",
  12857. ERROR_WEBGL_IOS_ACTIONS_1: "点击 ",
  12858. ERROR_WEBGL_IOS_ACTIONS_2: "设置 > 通用 > 软件更新",
  12859. ERROR_WEBGL_SAFARI_PROBLEM: "启用 WebGL 以在 3D 中探索。",
  12860. ERROR_WEBGL_SAFARI_ACTIONS_1: "单击",
  12861. ERROR_WEBGL_SAFARI_ACTIONS_2: "菜单栏中的首选项 > 高级 > 显示开发菜单",
  12862. ERROR_WEBGL_SAFARI_ACTIONS_3: "然后单击",
  12863. ERROR_WEBGL_SAFARI_ACTIONS_4: "开发 > 启用 WebGL",
  12864. ERROR_MISSING_URLS_PROBLEM: "糟糕,没有此模型的全景。",
  12865. ERROR_MISSING_URLS_EXPLANATION: "这是较早的模型。网站所有者可能正在开发一种新模型。",
  12866. ERROR_LOADING_FAILED_PROBLEM: "糟糕,模式不可用。",
  12867. ERROR_LOADING_FAILED_ACTIONS_1: "如果问题仍然存在,",
  12868. ERROR_LOADING_FAILED_ACTIONS_2: "查看我们的故障排除指南",
  12869. ERROR_MAINTENANCE_PROBLEM: "正在进行维护",
  12870. ERROR_MAINTENANCE_SOLUTION: "请过几分钟再来。",
  12871. LINK_TO_LOCATION: "地点链接",
  12872. MENU_COPY: "复制",
  12873. LINK_ALERT_COPY: "请使用 CTRL/CMD + C 复制。",
  12874. ROTATE: "旋转",
  12875. MOVE: "移动",
  12876. INSIDE: "内部",
  12877. ZOOM: "缩放",
  12878. HELP: "小帮手",
  12879. HELP_NAVIGATION_TAB: "导航",
  12880. HELP_MORE_HELP_TAB: "更多帮助",
  12881. HELP_DESKTOP_PANORAMA_1A: "单击并拖动以环顾空间。",
  12882. HELP_DESKTOP_PANORAMA_2A: "单击整个空间内的圆环以四处移动。",
  12883. HELP_DESKTOP_PANORAMA_3A: "使用鼠标滚轮来放大和缩小。",
  12884. HELP_DESKTOP_PANORAMA_1B: "或者,使用箭头键向左向右转。",
  12885. HELP_DESKTOP_PANORAMA_2B: "或者,使用箭头键向前移动和向后移动。",
  12886. HELP_DESKTOP_PANORAMA_3B: "或者,使用加号和减号键来放大和缩小。",
  12887. HELP_DESKTOP_360_2A: "单击内部视图图标以进入空间。",
  12888. HELP_DESKTOP_360_2B: "或者,按 1 号键进入内部视图。 ",
  12889. HELP_DESKTOP_DOLLHOUSE_1A: "左键单击并向左、向右、向上和向下拖动以旋转场景屋。",
  12890. HELP_DESKTOP_DOLLHOUSE_2A: "右键单击并向左、向右、向上和向下拖动以改变场景屋在屏幕上的位置。",
  12891. HELP_DESKTOP_DOLLHOUSE_3A: "使用鼠标滚轮来放大和缩小。",
  12892. HELP_DESKTOP_DOLLHOUSE_1B: "或者,使用箭头键来旋转场景屋。",
  12893. HELP_DESKTOP_FLOORPLAN_1A: "左键单击并向左、向右、向上和向下拖动以改变楼层平面图在屏幕上的位置。",
  12894. HELP_DESKTOP_FLOORPLAN_2A: "右键单击并向左或向右拖动以旋转楼层平面图。",
  12895. HELP_DESKTOP_FLOORPLAN_3A: "使用鼠标滚轮来放大和缩小。",
  12896. HELP_DESKTOP_FLOORPLAN_2B: "或者,使用箭头键以向左或向右旋转。",
  12897. HELP_DESKTOP_FLOORPLAN_3B: "或者,使用箭头键来放大和缩小。",
  12898. HELP_MOBILE_PANORAMA_1: "触摸并拖动以环顾空间。",
  12899. HELP_MOBILE_PANORAMA_2: "点击整个空间内的圆环以四处移动。",
  12900. HELP_MOBILE_3: "使用捏合手势来放大和缩小。",
  12901. HELP_MOBILE_360_2: "点击内部视图图标以进入空间。",
  12902. HELP_MOBILE_DOLLHOUSE_1: "触摸并向上、向下、向左和向右拖动以旋转场景屋。",
  12903. HELP_MOBILE_DOLLHOUSE_2: "用两指触摸并拖动以定位场景屋。",
  12904. HELP_MOBILE_FLOORPLAN_1: "触摸并拖动以定位楼层平面图。",
  12905. HELP_MOBILE_FLOORPLAN_2: "用两指触摸并拖动以旋转楼层平面图。",
  12906. HELP_MORE_HLR_A: "精彩片段集锦",
  12907. HELP_DESKTOP_MORE_HLR_B: "打开以使用缩略图图像在空间中流览。",
  12908. HELP_MORE_DOLLHOUSE_A: "场景屋",
  12909. HELP_DESKTOP_MORE_DOLLHOUSE_B: "单击以查看和旋转 3D 内整个空间的俯视图。",
  12910. HELP_MOBILE_MORE_DOLLHOUSE_B: "点击以查看和旋转 3D 内整个空间的俯视图。",
  12911. HELP_MORE_FLOORS_A: "楼层选择器",
  12912. HELP_DESKTOP_MORE_FLOORS_B: "在空间中的楼层之间切换。",
  12913. HELP_MORE_TAG_A: "tag™ 贴文",
  12914. HELP_DESKTOP_MORE_TAG_B: "单击或悬停鼠标以查看空间中的功能信息。",
  12915. HELP_MOBILE_MORE_TAG_B: "点击以查看空间中的功能信息。",
  12916. HELP_MORE_ZOOM_A: "缩放控件",
  12917. HELP_DESKTOP_MORE_ZOOM_B: "使用这些控件来放大和缩小或使用滚轮。",
  12918. HELP_MORE_TOUR_A: "导览控件",
  12919. HELP_DESKTOP_MORE_TOUR_B: "通过导览播放、暂停以及向前和向后流览。",
  12920. HELP_MORE_INSIDE_A: "内部视图",
  12921. HELP_DESKTOP_MORE_INSIDE_B: "单击以探索空间内部。",
  12922. HELP_MOBILE_MORE_INSIDE_B: "点击以探索空间内部。",
  12923. HELP_MORE_VR_A: "VR 模式",
  12924. HELP_DESKTOP_MORE_VR_B: "单击以在虚拟现实中启动空间。",
  12925. HELP_MOBILE_MORE_VR_B: "点击以在虚拟现实中启动空间。",
  12926. HELP_MORE_360_A: "360° 视图",
  12927. HELP_DESKTOP_MORE_360_B: "单击精彩片段集锦中的 360 视图中以观看室外场景。",
  12928. HELP_MOBILE_MORE_360_B: "点击精彩片段集锦中的 360 视图中以观看室外场景。",
  12929. HELP_MORE_FULLSCREEN_A: "全屏",
  12930. HELP_DESKTOP_MORE_FULLSCREEN_B: "将 3D Showcase 扩展到全屏。",
  12931. CLOSE: "关闭"
  12932. }
  12933. }
  12934. , {}],
  12935. 110: [function(e, t, i) {
  12936. "use strict";
  12937. t.exports = {
  12938. PAGE_TITLE: "",
  12939. LOADING: "Lädt",
  12940. PRESENTED_BY_CAPS: "PRÄSENTIERT VON",
  12941. POWERED_BY: "Angetrieben von",
  12942. POWERED_BY_CAPS: "ANGETRIEBEN VON",
  12943. DESKTOP_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  12944. MOBILE_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  12945. PRESENTED_BY: "Präsentiert von ",
  12946. MORE: "Mehr ",
  12947. LESS: "Weniger ",
  12948. TAG_CONTENT: "tag™ Inhalt",
  12949. SHOW: "Anzeigen",
  12950. HIDE: "Verbergen",
  12951. DOLLHOUSE: "Puppenhaus",
  12952. FLOOR_PLAN: "Grundriss",
  12953. OPEN_HIGHLIGHTS: "Highlights anzeigen",
  12954. CLOSE_HIGHLIGHTS: "Schließen",
  12955. PREVIOUS: "Vorheriges",
  12956. PLAY: "Abspielen",
  12957. PAUSE: "Pausieren",
  12958. NEXT: "Nächstes",
  12959. EXPLORE_3D_SPACE: "Innenraum betreten",
  12960. VIEW_DOLLHOUSE: "Puppenhaus ansehen",
  12961. SOCIAL_SHARING: "Teilen Sie diesen Raum",
  12962. VIEW_IN_VR: "In VR ansehen",
  12963. VIEW_FULLSCREEN: "Ansicht im Vollbildmodus",
  12964. EXIT_FULLSCREEN: "Beenden des Vollbildmodus",
  12965. ZOOM_IN: "Vergrößern",
  12966. ZOOM_OUT: "Verkleinern",
  12967. FLOOR_NAME: "Etage ",
  12968. FLOOR_ALL: "Alle",
  12969. TERMS: "Bedingungen",
  12970. PORT_TERMS: "port Bedingungen",
  12971. TERMS_OF_USE: "Nutzungsbedingungen",
  12972. TERMS_TEXT_FILE: "terms-de-DE.html",
  12973. CLOSE_TERMS: "Schließen",
  12974. TERMS_FAIL: "Konnte die Nutzungsbedingungen nicht abrufen. Bitte stellen Sie sicher, dass Sie zum Internet verbunden sind.",
  12975. HELP: "Hilfe",
  12976. HELP_NAVIGATION_TAB: "Navigation",
  12977. HELP_MORE_HELP_TAB: "Hilfe-Details",
  12978. CLOSE: "Schließen",
  12979. HELP_DESKTOP_PANORAMA_1A: "Klicken und ziehen Sie um sich im Raum umzusehen.",
  12980. HELP_DESKTOP_PANORAMA_2A: "Klicken Sie auf die Ringe im Raum um sich zu bewegen.",
  12981. HELP_DESKTOP_PANORAMA_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12982. HELP_DESKTOP_PANORAMA_1B: "Oder verwenden Sie die Pfeiltasten um sich nach links und rechts zu bewegen.",
  12983. HELP_DESKTOP_PANORAMA_2B: "Oder verwenden Sie die Pfeiltasten um sich vorwärts und rückwärts zubewegen.",
  12984. HELP_DESKTOP_PANORAMA_3B: "Oder verwenden Sie die Plus- und Minus-Tasten zum Vergrößern und Verkleinern.",
  12985. HELP_DESKTOP_360_2A: "Klicken Sie die Innenansicht ikone, um diesen Raum zu starten .",
  12986. HELP_DESKTOP_360_2B: "Oder, drücken Sie die 1-Taste um die Innenraumansicht zu starten.",
  12987. HELP_DESKTOP_DOLLHOUSE_1A: "Klicken Sie mit der linken Maustaste und ziehen Sie nach links, rechts, oben und unten um das Puppenhaus zu drehen.",
  12988. 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.",
  12989. HELP_DESKTOP_DOLLHOUSE_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12990. HELP_DESKTOP_DOLLHOUSE_1B: "Oder verwenden Sie die Pfeiltasten um das Puppenhaus zu drehen.",
  12991. 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.",
  12992. HELP_DESKTOP_FLOORPLAN_2A: "Klicken Sie mit der rechten Maustaste und ziehen Sie nach links oder rechts um den Grundriss zu drehen.",
  12993. HELP_DESKTOP_FLOORPLAN_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12994. HELP_DESKTOP_FLOORPLAN_2B: "Oder verwenden Sie die Pfeiltasten um das Modell nach links oder rechts zu drehen.",
  12995. HELP_DESKTOP_FLOORPLAN_3B: "Oder verwenden Sie die Pfeiltasten zum Vergrößern und Verkleinern.",
  12996. HELP_MOBILE_PANORAMA_1: "Berühren und ziehen an dem Raum um sich umzusehen.",
  12997. HELP_MOBILE_PANORAMA_2: "Klicken Sie auf die Ringe im Raum, um sich zu bewegen.",
  12998. HELP_MOBILE_3: "Benutzen Sie die Zoom-Gäste zum Vergrößern und Verkleinern.",
  12999. HELP_MOBILE_360_2: "Tippen Sie die Innenansicht ikone, um diesen Raum zu starten.",
  13000. HELP_MOBILE_DOLLHOUSE_1: "Berühren und nach oben, unten, links und rechts ziehen um das Puppenhaus zu drehen.",
  13001. HELP_MOBILE_DOLLHOUSE_2: "Berühren und mit zwei Fingern ziehen um das Puppenhaus zu positionieren.",
  13002. HELP_MOBILE_FLOORPLAN_1: "Berühren und ziehen, um den Grundriss zu positionieren.",
  13003. HELP_MOBILE_FLOORPLAN_2: "Berühren und ziehen mit zwei Fingern, um den Grundriss zu drehen.",
  13004. HELP_MORE_HLR_A: "Liste das Highlight",
  13005. HELP_DESKTOP_MORE_HLR_B: "Öffnen um durch den Raum mit Vorschau-Bildern zu navigieren.",
  13006. HELP_MORE_DOLLHOUSE_A: "Puppenhaus Ansicht",
  13007. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Klicken Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  13008. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tippen Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  13009. HELP_MORE_FLOORS_A: "Etage auswählen",
  13010. HELP_DESKTOP_MORE_FLOORS_B: "Zwischen den Etagen im Raum wechseln.",
  13011. HELP_MORE_TAG_A: "tag™ Posts",
  13012. HELP_DESKTOP_MORE_TAG_B: "Klicken Sie auf oder bewegen Sie Ihren Mauszeiger über die Informationen über die Funktionen im Raum.",
  13013. HELP_MOBILE_MORE_TAG_B: "Tippen Sie für Informationen über die Funktionen im Raum.",
  13014. HELP_MORE_ZOOM_A: "Zoom Steuerung",
  13015. HELP_DESKTOP_MORE_ZOOM_B: "Verwenden Sie diese Steuerung oder das Scrollrad zum Vergrößern und Verkleinern.",
  13016. HELP_MORE_TOUR_A: "Tour Steuerung",
  13017. HELP_DESKTOP_MORE_TOUR_B: "Abspielen, pausieren und vorwärts und rückwärts durch eine geführte Tour navigieren.",
  13018. HELP_MORE_INSIDE_A: "Innenansicht",
  13019. HELP_DESKTOP_MORE_INSIDE_B: "Klicken Sie hier um sich im Raum umzusehen.",
  13020. HELP_MOBILE_MORE_INSIDE_B: "Sehen Sie sich in diesen 3D Raum um.",
  13021. HELP_MORE_VR_A: "VR Modus",
  13022. HELP_DESKTOP_MORE_VR_B: "Klicken Sie hier, um den Raum in der virtuellen Realität zu starten.",
  13023. HELP_MOBILE_MORE_VR_B: "Tippen Sie um den Raum in der virtuellen Realität zu starten.",
  13024. HELP_MORE_360_A: "360° Views Ansicht ",
  13025. HELP_DESKTOP_MORE_360_B: "Klicken Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  13026. HELP_MOBILE_MORE_360_B: "Tippen Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  13027. HELP_MORE_FULLSCREEN_A: "Vollbild",
  13028. HELP_DESKTOP_MORE_FULLSCREEN_B: "Erweitern Sie 3D Showcase im Vollbildmodus.",
  13029. WEBVR_FOR_CARDBOARD: "Für Google Cardboard",
  13030. WEBVR_FOR_DAYDREAM: "Für Daydream View",
  13031. WEBVR_ENTER_WEBVR: "Starten Sie VR",
  13032. WEBVR_DIFFERENT_HEADSET: "Haben Sie anderes Headset?",
  13033. WEBVR_LEARN_MORE: "Mehr Infos",
  13034. WEBVR_VIEW_SPACE: "Ansicht des Raumes in VR",
  13035. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13036. WEBVR_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  13037. WEBVR_VIEW_CARDBOARD: "Oder mit Google Cardboard ansehen",
  13038. VR_WHAT_YOU_NEED: "Was Sie dafür brauchen...",
  13039. VR_NEED_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  13040. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13041. VR_APP: "port VR App",
  13042. VR_APP_OPEN: "Oder öffnen Sie die port VR App",
  13043. 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",
  13044. VR_SAMSUNG_DETAIL: "Galaxy S6 und neuer",
  13045. VR_APP_FOR_ANDROID: "port VR app für Android",
  13046. VR_NEED_DAYDREAM: "ERFORDERT VOR DER 'PAIRING' MIT DAYDREAM VIEW",
  13047. VR_VIEW_SPACE: "Ansicht des Raumes in VR",
  13048. VR_LEARN_MORE_CAPS: "MEHR INFOS",
  13049. VR_PREVIOUS_CAPS: "ZURÜCK",
  13050. VR_NEXT_CAPS: "WEITER",
  13051. VR_GOT_IT_CAPS: "VERSTANDEN",
  13052. VR_SHOW_SUPPORTED: "Tippen Sie um den Raum in VR zu sehen",
  13053. VR_SHOW_UNSUPPORTED: "Schade, aber Ihr Gerät erfüllt nicht die Mindestanforderungen um den Raum in VR zu sehen.",
  13054. VR_SHOW_IOS_1: "Tippen Sie um den Raum in VR zu sehen",
  13055. VR_SHOW_IOS_2: "port VR App sowie kompatibles iPhone sind von nöten um diesen Raum zu sehen",
  13056. VR_NEED_CARDBOARD: "Was Sie dafür brauchen ist Google Cardboard",
  13057. VR_NEED_SAMSUNG: "Was Sie dafür brauchen ist Samsung Gear VR",
  13058. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13059. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13060. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13061. VR_COMPATIBLE_IPHONES_2: "iPhone 5s oder neuer, mit iOS 9.1 und später",
  13062. VR_COMPATIBLE_IPHONES_3: "Kompatibles iPhones",
  13063. VR_COMPATIBLE_ANDROID: "Kompatibles Android Gerät",
  13064. VR_ANDROID_DETAIL: "Bildschirmdiagonale von 11,5 bis 14 cm (4,5 - 5,5 Zoll) und Android 4.4.4 und neuer",
  13065. VR_ANDROID_DVICES: "Android Geräte",
  13066. VR_COMPATIBLE_SAMSUNG: "Kompatible Samsung Geräte",
  13067. VR_APP_FOR_CARDBOARD: "port VR App für Google Cardboard",
  13068. VR_APP_FOR_SAMSUNG: "port VR App für Gear VR",
  13069. VR_DOWNLOAD_HERE: "Hier runterladen",
  13070. VR_REQUIRE_HEADSET: "Benötigt das ein VR-Headset und port VR App für Android installiert wird",
  13071. VR_REDIRECT_TO_STORE: "Wenn App nicht installiert ist, werden Sie zum App Store umgeleitet.",
  13072. VR_IMPROPER_EMBED: "Der port Raum ist nicht richtig eingebettet um VR in Ihrem Webbrowser zu unterstützen.",
  13073. VR_OPEN_ANDROID_LINK: "Öffnen Sie den Link auf Ihrem Handy",
  13074. VR_ANDROID_OPTIONS: "VR Headset Optionen",
  13075. SHARE_TO: "Teilen auf",
  13076. SHARE_LINK: "Direkter Link",
  13077. SHARE_EXPLORE: "Umsehen",
  13078. SHARE_AT: "auf",
  13079. SHARE_WITH: "mit",
  13080. SHARE_3D: "in 3D",
  13081. SHARE_COPIED: "Kopiert!",
  13082. ERROR_BROWSER_SOLUTION: "Installieren Sie einen neueren Browser um sich in 3D umzusehen.",
  13083. ERROR_BROWSER_EXPLANATION: "WebGL benötigt einen modernen Browser.",
  13084. ERROR_GENERIC_PROBLEM: "Huch, etwas ist schief gelaufen.",
  13085. ERROR_GENERIC_SOLUTION: "Starten Sie Ihren Browser neu.",
  13086. ERROR_GENERIC_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  13087. ERROR_GENERIC_ACTIONS_2: "Installieren Sie einen unterstützten Browser",
  13088. ERROR_GENERIC_ACTIONS_3: " oder ",
  13089. ERROR_GENERIC_ACTIONS_4: "Sehen Sie unseren Leitfaden zur Fehlerbehebung",
  13090. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser wird nicht unterstützt.",
  13091. ERROR_WEBGL_IOS_PROBLEM: "iOS-Version wird nicht unterstützt.",
  13092. ERROR_WEBGL_IOS_SOLUTION: "Aktualisieren Sie auf iOS 8 oder neuer um sich in 3D umzusehen.",
  13093. ERROR_WEBGL_IOS_ACTIONS_1: "Tippen ",
  13094. ERROR_WEBGL_IOS_ACTIONS_2: "Einstellungen > Allgemein > Softwareaktualisierung",
  13095. ERROR_WEBGL_SAFARI_PROBLEM: "Aktivieren Sie WebVR um sich in 3D umzusehen.",
  13096. ERROR_WEBGL_SAFARI_ACTIONS_1: "Klicken ",
  13097. ERROR_WEBGL_SAFARI_ACTIONS_2: "Präferenzen > Fortgeschrittene > Entwickler-Menü anzeigen",
  13098. ERROR_WEBGL_SAFARI_ACTIONS_3: "Klicken Sie dann ",
  13099. ERROR_WEBGL_SAFARI_ACTIONS_4: "Entwickler > WebGL Aktivieren",
  13100. ERROR_MISSING_URLS_PROBLEM: "Huch, es gibt keine Panoramen für dieses Modell .",
  13101. ERROR_MISSING_URLS_EXPLANATION: "Dies ist ein älteres Modell. Der Website-Besitzer hat eventuell ein neues Modell in Arbeit.",
  13102. ERROR_LOADING_FAILED_PROBLEM: "Huch, das Modell ist nicht verfügbar.",
  13103. ERROR_LOADING_FAILED_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  13104. ERROR_LOADING_FAILED_ACTIONS_2: "sehen Sie unseren Leitfaden zur Fehlerbehebung",
  13105. ERROR_MAINTENANCE_PROBLEM: "Wartung im Gange.",
  13106. ERROR_MAINTENANCE_SOLUTION: "Bitte versuchen Sie es in ein paar Minuten nochmal.",
  13107. LINK_TO_LOCATION: "Link zu",
  13108. MENU_COPY: "Kopieren",
  13109. LINK_ALERT_COPY: "Bitte benutzen Sie CTRL/CMD + C zum kopieren.",
  13110. ROTATE: "Drehen",
  13111. INSIDE: "Drinnen",
  13112. MOVE: "Bewegen",
  13113. ZOOM: "Vergrößern"
  13114. }
  13115. }
  13116. , {}],
  13117. 111: [function(e, t, i) {
  13118. "use strict";
  13119. t.exports = {
  13120. PAGE_TITLE: "",
  13121. LOADING: "Loading",
  13122. PRESENTED_BY_CAPS: "PRESENTED BY",
  13123. POWERED_BY: "powered by ",
  13124. POWERED_BY_CAPS: "POWERED BY",
  13125. DESKTOP_SHORT_CTA: "Click to explore this 3D space.",
  13126. MOBILE_SHORT_CTA: "Tap to explore this 3D space.",
  13127. PRESENTED_BY: "Presented by ",
  13128. MORE: "More ",
  13129. LESS: "Less ",
  13130. TAG_CONTENT: "tag™ Content",
  13131. SHOW: "Show",
  13132. HIDE: "Hide",
  13133. DOLLHOUSE: "Dollhouse",
  13134. FLOOR_PLAN: "Floor plan",
  13135. OPEN_HIGHLIGHTS: "Open Highlights",
  13136. CLOSE_HIGHLIGHTS: "Close",
  13137. PREVIOUS: "Previous",
  13138. PLAY: "Play",
  13139. PAUSE: "Pause",
  13140. NEXT: "Next",
  13141. EXPLORE_3D_SPACE: "Explore 3D Space",
  13142. VIEW_DOLLHOUSE: "View dollhouse",
  13143. SOCIAL_SHARING: "Share this Space",
  13144. VIEW_IN_VR: "View in VR",
  13145. VIEW_FULLSCREEN: "View Fullscreen",
  13146. EXIT_FULLSCREEN: "Exit Fullscreen",
  13147. ZOOM_IN: "Zoom in",
  13148. ZOOM_OUT: "Zoom out",
  13149. FLOOR_NAME: "Floor ",
  13150. FLOOR_ALL: "All",
  13151. TERMS: "Terms",
  13152. PORT_TERMS: "port terms",
  13153. TERMS_OF_USE: "Terms of Use",
  13154. TERMS_TEXT_FILE: "terms-en-US.html",
  13155. CLOSE_TERMS: "Close",
  13156. TERMS_FAIL: "Could not fetch terms. Please make sure you have an internet connection to view the terms of use.",
  13157. HELP: "Help",
  13158. HELP_NAVIGATION_TAB: "Navigation",
  13159. HELP_MORE_HELP_TAB: "More Help",
  13160. CLOSE: "Close",
  13161. HELP_DESKTOP_PANORAMA_1A: "Click and Drag to look around the Space.",
  13162. HELP_DESKTOP_PANORAMA_2A: "Click on the rings throughout the space to move around.",
  13163. HELP_DESKTOP_PANORAMA_3A: "Use the scroll wheel to zoom in and out.",
  13164. HELP_DESKTOP_PANORAMA_1B: "Or, use the arrow keys to turn left and right.",
  13165. HELP_DESKTOP_PANORAMA_2B: "Or, use the arrow keys to move forward and back.",
  13166. HELP_DESKTOP_PANORAMA_3B: "Or, use the plus and minus keys to zoom in and out.",
  13167. HELP_DESKTOP_360_2A: "Click the Inside View icon to enter the Space.",
  13168. HELP_DESKTOP_360_2B: "Or, press the number 1 key to enter Inside View.",
  13169. HELP_DESKTOP_DOLLHOUSE_1A: "Left click and drag left, right, up, and down to rotate the Dollhouse.",
  13170. HELP_DESKTOP_DOLLHOUSE_2A: "Right click and drag left, right, up, and down to change the Dollhouse position on screen.",
  13171. HELP_DESKTOP_DOLLHOUSE_3A: "Use the scroll wheel to zoom in and out.",
  13172. HELP_DESKTOP_DOLLHOUSE_1B: "Or, use the arrow keys to rotate the Dollhouse.",
  13173. HELP_DESKTOP_FLOORPLAN_1A: "Left click and drag left, right, up, and down to change the Floorplan position on screen.",
  13174. HELP_DESKTOP_FLOORPLAN_2A: "Right click and drag left or right to rotate the Floorplan.",
  13175. HELP_DESKTOP_FLOORPLAN_3A: "Use the scroll wheel to zoom in and out.",
  13176. HELP_DESKTOP_FLOORPLAN_2B: "Or, use the arrow keys to rotate left or right.",
  13177. HELP_DESKTOP_FLOORPLAN_3B: "Or, use the arrow keys to zoom in and out.",
  13178. HELP_MOBILE_PANORAMA_1: "Touch and Drag to look around the Space.",
  13179. HELP_MOBILE_PANORAMA_2: "Tap on the rings throughout the Space to move around.",
  13180. HELP_MOBILE_3: "Use a pinch gesture to zoom in and out.",
  13181. HELP_MOBILE_360_2: "Tap the Inside View icon to enter the Space.",
  13182. HELP_MOBILE_DOLLHOUSE_1: "Touch and drag up, down, left, and right to rotate the Dollhouse.",
  13183. HELP_MOBILE_DOLLHOUSE_2: "Touch and drag with two fingers to position the Dollhouse.",
  13184. HELP_MOBILE_FLOORPLAN_1: "Touch and drag to position the Floorplan.",
  13185. HELP_MOBILE_FLOORPLAN_2: "Touch and drag with two fingers to rotate the Floorplan.",
  13186. HELP_MORE_HLR_A: "Highlight Reel",
  13187. HELP_DESKTOP_MORE_HLR_B: "Open to navigate through the Space using thumbnail images.",
  13188. HELP_MORE_DOLLHOUSE_A: "Dollhouse View",
  13189. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Click to view and rotate a top-down view of the entire Space in 3D.",
  13190. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tap to view and rotate a top-down view of the entire Space in 3D.",
  13191. HELP_MORE_FLOORS_A: "Floor Selector",
  13192. HELP_DESKTOP_MORE_FLOORS_B: "Switch between floors in the Space.",
  13193. HELP_MORE_TAG_A: "tag™ Posts",
  13194. HELP_DESKTOP_MORE_TAG_B: "Click or hover over for information about features in the Space.",
  13195. HELP_MOBILE_MORE_TAG_B: "Tap for information about features in the Space.",
  13196. HELP_MORE_ZOOM_A: "Zoom Controls",
  13197. HELP_DESKTOP_MORE_ZOOM_B: "Use these controls to zoom in and out or use the scroll wheel.",
  13198. HELP_MORE_TOUR_A: "Tour Controls",
  13199. HELP_DESKTOP_MORE_TOUR_B: "Play, pause, and navigate forward and backward through a Guided Tour.",
  13200. HELP_MORE_INSIDE_A: "Inside View",
  13201. HELP_DESKTOP_MORE_INSIDE_B: "Click to explore inside the Space.",
  13202. HELP_MOBILE_MORE_INSIDE_B: "Tap to explore inside the Space.",
  13203. HELP_MORE_VR_A: "VR Mode",
  13204. HELP_DESKTOP_MORE_VR_B: "Click to launch the Space in virtual reality.",
  13205. HELP_MOBILE_MORE_VR_B: "Tap to launch the Space in virtual reality.",
  13206. HELP_MORE_360_A: "360° Views",
  13207. HELP_DESKTOP_MORE_360_B: "Click 360 Views in the Highlight Reel to view outdoor scenes.",
  13208. HELP_MOBILE_MORE_360_B: "Tap 360 Views in the Highlight Reel to view outdoor scenes.",
  13209. HELP_MORE_FULLSCREEN_A: "Full screen",
  13210. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expand 3D Showcase to full screen.",
  13211. WEBVR_FOR_CARDBOARD: "For Google Cardboard",
  13212. WEBVR_VIEW_CARDBOARD: "Or View on Google Cardboard",
  13213. WEBVR_FOR_DAYDREAM: "For Daydream View",
  13214. WEBVR_ENTER_WEBVR: "ENTER VR",
  13215. WEBVR_DIFFERENT_HEADSET: "Have a different headset?",
  13216. WEBVR_LEARN_MORE: "Learn more",
  13217. WEBVR_VIEW_SPACE: "View Space in VR",
  13218. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13219. WEBVR_DAYDREAM_PHONE: "Daydream-ready phone",
  13220. VR_VIEW_SPACE: "View Space in Virtual Reality",
  13221. VR_LEARN_MORE_CAPS: "LEARN MORE",
  13222. VR_PREVIOUS_CAPS: "PREVIOUS",
  13223. VR_NEXT_CAPS: "NEXT",
  13224. VR_GOT_IT_CAPS: "GOT IT",
  13225. VR_SHOW_SUPPORTED: "Tap to view the Space in VR with",
  13226. VR_SHOW_UNSUPPORTED: "Sorry, but your device doesn't meet the minimum requirements to view a space in VR.",
  13227. VR_SHOW_IOS_1: "Tap to view the space in VR",
  13228. VR_SHOW_IOS_2: "Requires port VR app and compatible iPhone to view",
  13229. VR_WHAT_YOU_NEED: "What You'll Need For...",
  13230. VR_NEED_CARDBOARD: "What you'll need with Google Cardboard",
  13231. VR_NEED_SAMSUNG: "What you'll need with Samsung Gear VR",
  13232. VR_NEED_DAYDREAM: "NEEDS PRIOR PAIRING WITH DAYDREAM VIEW",
  13233. VR_NEED_DAYDREAM_PHONE: "Daydream-ready phone",
  13234. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13235. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13236. VR_APP: "port VR App",
  13237. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13238. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13239. VR_COMPATIBLE_IPHONES_2: "iPhone 5s and newer, running iOS 9.1 and higher",
  13240. VR_COMPATIBLE_IPHONES_3: "Compatible iPhones",
  13241. VR_COMPATIBLE_ANDROID: "Compatible Android Devices",
  13242. VR_COMPATIBLE_ANDROID_LONG: 'Compatible Android Devices Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13243. VR_ANDROID_DETAIL: 'Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13244. VR_ANDROID_DVICES: "Android Devices",
  13245. VR_COMPATIBLE_SAMSUNG: "Compatible Samsung Devices",
  13246. VR_SAMSUNG_DETAIL: "Galaxy S6 and Above",
  13247. VR_APP_FOR_CARDBOARD: "port VR app for Google Cardboard",
  13248. VR_APP_FOR_SAMSUNG: "port VR app for Gear VR",
  13249. VR_APP_FOR_ANDROID: "port VR app for Android Phones",
  13250. VR_APP_OPEN: "Open with the port VR app instead",
  13251. VR_DOWNLOAD_HERE: "Download here",
  13252. VR_REQUIRE_HEADSET: "Requires a VR headset and port VR app for Android to be installed",
  13253. VR_REDIRECT_TO_STORE: "If app is not installed, you will be redirected to the app store.",
  13254. VR_IMPROPER_EMBED: "The port Space is not embedded properly to support VR in your web browser.",
  13255. VR_OPEN_ANDROID_LINK: "Open the Link on Your Mobile Phone",
  13256. VR_ANDROID_OPTIONS: "Available VR Headset Options",
  13257. SHARE_TO: "Share to",
  13258. SHARE_LINK: "Direct Link",
  13259. SHARE_EXPLORE: "Explore ",
  13260. SHARE_AT: "at",
  13261. SHARE_WITH: "with",
  13262. SHARE_3D: " in 3D",
  13263. SHARE_COPIED: "Copied!",
  13264. ERROR_BROWSER_SOLUTION: "Install a new browser to explore in 3D.",
  13265. ERROR_BROWSER_EXPLANATION: "WebGL requires a modern browser.",
  13266. ERROR_GENERIC_PROBLEM: "Oops, something went wrong.",
  13267. ERROR_GENERIC_SOLUTION: "Restart your browser.",
  13268. ERROR_GENERIC_ACTIONS_1: "If the problem persists, ",
  13269. ERROR_GENERIC_ACTIONS_2: "install a supported browser",
  13270. ERROR_GENERIC_ACTIONS_3: " or ",
  13271. ERROR_GENERIC_ACTIONS_4: "see our troubleshooting guide",
  13272. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser not supported.",
  13273. ERROR_WEBGL_IOS_PROBLEM: "iOS version not supported.",
  13274. ERROR_WEBGL_IOS_SOLUTION: "Upgrade to iOS 8 or higher to explore in 3D.",
  13275. ERROR_WEBGL_IOS_ACTIONS_1: "Tap ",
  13276. ERROR_WEBGL_IOS_ACTIONS_2: "Settings > General > Software Update",
  13277. ERROR_WEBGL_SAFARI_PROBLEM: "Enable WebGL to explore in 3D.",
  13278. ERROR_WEBGL_SAFARI_ACTIONS_1: "Click ",
  13279. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferences > Advanced > Show Develop menu",
  13280. ERROR_WEBGL_SAFARI_ACTIONS_3: "Then click ",
  13281. ERROR_WEBGL_SAFARI_ACTIONS_4: "Develop > Enable WebGL",
  13282. ERROR_MISSING_URLS_PROBLEM: "Oops, there are no panoramas for this model.",
  13283. ERROR_MISSING_URLS_EXPLANATION: "This is an older model. The website owner may have a new model on the way.",
  13284. ERROR_LOADING_FAILED_PROBLEM: "Oops, model not available.",
  13285. ERROR_LOADING_FAILED_ACTIONS_1: "If the problem persists, ",
  13286. ERROR_LOADING_FAILED_ACTIONS_2: "see our troubleshooting guide",
  13287. ERROR_MAINTENANCE_PROBLEM: "Maintenance in progress.",
  13288. ERROR_MAINTENANCE_SOLUTION: "Please come back in a few minutes.",
  13289. LINK_TO_LOCATION: "Link to location",
  13290. MENU_COPY: "Copy",
  13291. LINK_ALERT_COPY: "Please use CTRL/CMD + C to copy.",
  13292. ROTATE: "Rotate",
  13293. INSIDE: "Inside",
  13294. MOVE: "Move",
  13295. ZOOM: "Zoom"
  13296. }
  13297. }
  13298. , {}],
  13299. 112: [function(e, t, i) {
  13300. "use strict";
  13301. t.exports = {
  13302. PAGE_TITLE: "",
  13303. LOADING: "Cargando",
  13304. PRESENTED_BY_CAPS: "PRESENTADO POR",
  13305. POWERED_BY: "potenciando por ",
  13306. POWERED_BY_CAPS: "POTENCIADO POR ",
  13307. DESKTOP_SHORT_CTA: "Haga clic para explorar este Espacio 3D.",
  13308. MOBILE_SHORT_CTA: "Pulse para explorar este Espacio 3D.",
  13309. PRESENTED_BY: "Presentado por ",
  13310. MORE: "Más ",
  13311. LESS: "Menos ",
  13312. TAG_CONTENT: "Contenido de tag™",
  13313. SHOW: "Mostrar",
  13314. HIDE: "Ocultar",
  13315. DOLLHOUSE: "Dollhouse",
  13316. FLOOR_PLAN: "Planos",
  13317. OPEN_HIGHLIGHTS: "Aspectos Destacados",
  13318. CLOSE_HIGHLIGHTS: "Cerrar",
  13319. PREVIOUS: "Anterior",
  13320. PLAY: "Play",
  13321. PAUSE: "Pausa",
  13322. NEXT: "Siguiente",
  13323. EXPLORE_3D_SPACE: "Explorar el Espacio 3D",
  13324. VIEW_DOLLHOUSE: "Ver dollhouse",
  13325. SOCIAL_SHARING: "Compartir este espacio",
  13326. VIEW_IN_VR: "Ver en realidad virtual",
  13327. VIEW_FULLSCREEN: "Ver en pantalla completa",
  13328. EXIT_FULLSCREEN: "Salir de pantalla completa",
  13329. ZOOM_IN: "Acercar",
  13330. ZOOM_OUT: "Alejar",
  13331. FLOOR_NAME: "Piso ",
  13332. FLOOR_ALL: "Todas",
  13333. TERMS: "Condiciones",
  13334. PORT_TERMS: "port términos de uso",
  13335. TERMS_OF_USE: "Términos de uso",
  13336. TERMS_TEXT_FILE: "terms-es-MX.html",
  13337. CLOSE_TERMS: "Cerrar",
  13338. 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.",
  13339. HELP: "Ayuda",
  13340. HELP_NAVIGATION_TAB: "Navegación",
  13341. HELP_MORE_HELP_TAB: "Más Ayuda",
  13342. CLOSE: "Cerrar",
  13343. HELP_DESKTOP_PANORAMA_1A: "Haga clic y arrastre para mirar alrededor del espacio.",
  13344. HELP_DESKTOP_PANORAMA_2A: "Haga clic en los aros a lo largo del espacio para moverse.",
  13345. HELP_DESKTOP_PANORAMA_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13346. HELP_DESKTOP_PANORAMA_1B: "O use las teclas de flecha para girar a la izquierda y a la derecha.",
  13347. HELP_DESKTOP_PANORAMA_2B: "O use las teclas de dirección para adelantar o retroceder.",
  13348. HELP_DESKTOP_PANORAMA_3B: "O use la tecla más para acercar y la tecla menos para alejar.",
  13349. HELP_DESKTOP_360_2A: "Haga clic en el icono Vista Interior para ingresar al Espacio.",
  13350. HELP_DESKTOP_360_2B: "O bien, presione la tecla numero 1 para entrar en la Vista Interior.",
  13351. HELP_DESKTOP_DOLLHOUSE_1A: "Haga clic izquierdo y arrastre hacia la izquierda, derecha, arriba o abajo para girar la Dollhouse.",
  13352. HELP_DESKTOP_DOLLHOUSE_2A: "Haga clic derecho y arrastre hacia la izquierda, derecha, arriba o abajo para cambiar la posición della dollhouse.",
  13353. HELP_DESKTOP_DOLLHOUSE_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13354. HELP_DESKTOP_DOLLHOUSE_1B: "O use las teclas de dirección para girar la Dollhouse.",
  13355. 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.",
  13356. HELP_DESKTOP_FLOORPLAN_2A: "Haga clic derecho y arrastre hacia la izquierda o derecha para girar la planta.",
  13357. HELP_DESKTOP_FLOORPLAN_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13358. HELP_DESKTOP_FLOORPLAN_2B: "O use las teclas para girar hacia la izquierda o derecha.",
  13359. HELP_DESKTOP_FLOORPLAN_3B: "O use las teclas de dirección para acercar o alejar.",
  13360. HELP_MOBILE_PANORAMA_1: "Toque y arrastre para mirar alrededor del espacio.",
  13361. HELP_MOBILE_PANORAMA_2: "Toque en los aros a lo largo del espacio para moverse.",
  13362. HELP_MOBILE_3: "Use el gesto de pellizcar para acercar o alejar.",
  13363. HELP_MOBILE_360_2: "Toque el ícono Vista Interior para entrar en el Espacio.",
  13364. HELP_MOBILE_DOLLHOUSE_1: "Toque y arrastre con dos dedos para cambiar la posición della dollhouse.",
  13365. HELP_MOBILE_DOLLHOUSE_2: "Toque y arrastre con dos dedos para cambiar la posición de la vista aérea.",
  13366. HELP_MOBILE_FLOORPLAN_1: "Toque y arrastre para cambiar la posición de la planta.",
  13367. HELP_MOBILE_FLOORPLAN_2: "Toque y arrastre con dos dedos para girar la planta.",
  13368. HELP_MORE_HLR_A: "Galería destacada",
  13369. HELP_DESKTOP_MORE_HLR_B: "Abra para navegar a través del espacio utilizando imágenes en miniatura.",
  13370. HELP_MORE_DOLLHOUSE_A: "Vista aérea por pisos",
  13371. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Haga clic para ver y girar la Dollhouse del espacio completo en 3D.",
  13372. HELP_MOBILE_MORE_DOLLHOUSE_B: "Toque para ver y girar la vista Dollhouse del espacio completo en 3D.",
  13373. HELP_MORE_FLOORS_A: "Seleccionador de plantas",
  13374. HELP_DESKTOP_MORE_FLOORS_B: "Cambie de una planta a otra en el espacio.",
  13375. HELP_MORE_TAG_A: "tag™ Posts",
  13376. HELP_DESKTOP_MORE_TAG_B: "Haga clic o coloque el cursor para obtener más información acerca de las características del espacio.",
  13377. HELP_MOBILE_MORE_TAG_B: "Toque para obtener más información acerca de las características del espacio.",
  13378. HELP_MORE_ZOOM_A: "Controles de zoom",
  13379. HELP_DESKTOP_MORE_ZOOM_B: "Use estos controles o la rueda de desplazamiento para acercar o alejar.",
  13380. HELP_MORE_TOUR_A: "Controles de recorrido",
  13381. HELP_DESKTOP_MORE_TOUR_B: "Reproduzca, pause, adelante o retroceda a través de un recorrido guiado.",
  13382. HELP_MORE_INSIDE_A: "Vista interior",
  13383. HELP_DESKTOP_MORE_INSIDE_B: "Haga clic para explorar el interior del espacio.",
  13384. HELP_MOBILE_MORE_INSIDE_B: "Toque para explorar el interior del espacio.",
  13385. HELP_MORE_VR_A: "Modo de realidad virtual",
  13386. HELP_DESKTOP_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13387. HELP_MOBILE_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13388. HELP_MORE_360_A: "360° Views",
  13389. HELP_DESKTOP_MORE_360_B: "Una vez que se encuentre en galería destacada, haga clic en vistas de 360º para ver el exterior.",
  13390. HELP_MOBILE_MORE_360_B: "Una vez que se encuentre en galería destacada, toque en vistas de 360º para ver el exterior.",
  13391. HELP_MORE_FULLSCREEN_A: "Pantalla completa",
  13392. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expanda el escenario 3D para verlo en pantalla completa.",
  13393. WEBVR_FOR_CARDBOARD: "Para Google Cardboard",
  13394. WEBVR_FOR_DAYDREAM: "Para Daydream View",
  13395. WEBVR_ENTER_WEBVR: "ENTRAR VR",
  13396. WEBVR_DIFFERENT_HEADSET: "¿Tiene un auricular diferente?",
  13397. WEBVR_LEARN_MORE: "Más información",
  13398. WEBVR_VIEW_SPACE: "Ver Espacio en VR",
  13399. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13400. WEBVR_DAYDREAM_PHONE: "Daydream Teléfono listos",
  13401. WEBVR_VIEW_CARDBOARD: "O Ver en Google Cardboard",
  13402. VR_NEED_DAYDREAM: "Necesidades antes de acoplarse con Daydream View",
  13403. VR_NEED_DAYDREAM_PHONE: "Teléfono listo para Daydream",
  13404. VR_GOOGLE_DAYDREAM: "Daydream de Google",
  13405. VR_APP: "port VR App",
  13406. VR_COMPATIBLE_ANDROID_LONG: 'Compatible con los Dispositivos Android con Pantallas de 4.5"-5.5" operando Android OS 4.4.4 y posteriores',
  13407. VR_APP_FOR_ANDROID: "Aplicación port VR para Teléfonos Android",
  13408. VR_APP_OPEN: "Abrir con la aplicación port VR en su lugar",
  13409. VR_VIEW_SPACE: "Ver Espacio en realidad virtual",
  13410. VR_LEARN_MORE_CAPS: "SABER MÁS",
  13411. VR_PREVIOUS_CAPS: "ANTERIOR",
  13412. VR_NEXT_CAPS: "SIGUIENTE",
  13413. VR_GOT_IT_CAPS: "COMPRENDIDO",
  13414. VR_SHOW_SUPPORTED: "Pulse para ver el Espacio en realidad virtual con",
  13415. VR_SHOW_UNSUPPORTED: "Lo sentimos, pero su dispositivo no cumple los requisitos mínimos para ver un Espacio en realidad virtual.",
  13416. VR_SHOW_IOS_1: "Pulse para ver el Espacio en realidad virtual",
  13417. VR_SHOW_IOS_2: "Necesita la aplicación port VR y un iPhone compatible para ver",
  13418. VR_WHAT_YOU_NEED: "Lo que necesitaras...",
  13419. VR_NEED_CARDBOARD: "Lo que necesitaras con Google Cardboard",
  13420. VR_NEED_SAMSUNG: "Lo que necesitaras con el Samsung Gear VR",
  13421. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13422. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13423. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13424. VR_COMPATIBLE_IPHONES_2: "Compatible con iPhone 6S o superior y con iOS 9.1 en adelante",
  13425. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13426. VR_COMPATIBLE_ANDROID: "Dispositivos Android compatibles",
  13427. VR_ANDROID_DETAIL: "Pantallas de 11.43 cm a 13.97 cm con OS de Android 4.4.4 en adelante",
  13428. VR_ANDROID_DVICES: "Dispositivos Android",
  13429. VR_COMPATIBLE_SAMSUNG: "Dispositivos compatibles del Samsung",
  13430. VR_SAMSUNG_DETAIL: "Galaxy S5 en adelante",
  13431. VR_APP_FOR_CARDBOARD: "Aplicación port VR para Google Cardboard",
  13432. VR_APP_FOR_SAMSUNG: "Aplicación port VR para Gear VR",
  13433. VR_DOWNLOAD_HERE: "Descargar aquí",
  13434. VR_REQUIRE_HEADSET: "Necesita un casco de realidad virtual y que se instale la aplicación port VR para Android",
  13435. VR_REDIRECT_TO_STORE: "Si la aplicación no está instalada, se le redirigirá a la tienda de aplicaciones.",
  13436. VR_IMPROPER_EMBED: "El espacio de port no está incorporado correctamente para apoyar VR en su navegador web.",
  13437. VR_OPEN_ANDROID_LINK: "Abre el enlace en tu teléfono móvil",
  13438. VR_ANDROID_OPTIONS: "Opciones de auriculares en RV disponibles",
  13439. SHARE_TO: "Compartir en",
  13440. SHARE_LINK: "Enlace directo",
  13441. SHARE_EXPLORE: "Explorar ",
  13442. SHARE_AT: "en",
  13443. SHARE_WITH: "con",
  13444. SHARE_3D: " en 3D",
  13445. SHARE_COPIED: "¡Copiado!",
  13446. ERROR_BROWSER_SOLUTION: "Instale un nuevo navegador para explorar en 3D.",
  13447. ERROR_BROWSER_EXPLANATION: "WebGL requiere un navegador moderno.",
  13448. ERROR_GENERIC_PROBLEM: "Vaya, algo ha ido mal.",
  13449. ERROR_GENERIC_SOLUTION: "Reinicie su navegador.",
  13450. ERROR_GENERIC_ACTIONS_1: "Si el problema persiste, ",
  13451. ERROR_GENERIC_ACTIONS_2: "instale un navegador compatible",
  13452. ERROR_GENERIC_ACTIONS_3: " o ",
  13453. ERROR_GENERIC_ACTIONS_4: "consulte nuestra guía de solución de problemas",
  13454. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navegador no compatible.",
  13455. ERROR_WEBGL_IOS_PROBLEM: "Versión de iOS no compatible.",
  13456. ERROR_WEBGL_IOS_SOLUTION: "Actualice a iOS 8 o superior para explorar en 3D.",
  13457. ERROR_WEBGL_IOS_ACTIONS_1: "Pulse ",
  13458. ERROR_WEBGL_IOS_ACTIONS_2: "Ajustes > General > Actualización de software",
  13459. ERROR_WEBGL_SAFARI_PROBLEM: "Habilite WebGL para explorar en 3D.",
  13460. ERROR_WEBGL_SAFARI_ACTIONS_1: "Haga clic en ",
  13461. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferencias > Avanzado > Mostrar el menú Desarrollar",
  13462. ERROR_WEBGL_SAFARI_ACTIONS_3: "Después, haga clic en ",
  13463. ERROR_WEBGL_SAFARI_ACTIONS_4: "Desarrollar > Habilitar WebGL",
  13464. ERROR_MISSING_URLS_PROBLEM: "Vaya, no hay panoramas para este modelo.",
  13465. ERROR_MISSING_URLS_EXPLANATION: "Este es un modelo antiguo. El propietario del sitio web puede tener un nuevo modelo en mente.",
  13466. ERROR_LOADING_FAILED_PROBLEM: "Vaya, modelo no disponible.",
  13467. ERROR_LOADING_FAILED_ACTIONS_1: "Si el problema persiste, ",
  13468. ERROR_LOADING_FAILED_ACTIONS_2: "consulte nuestra guía de solución de problemas",
  13469. ERROR_MAINTENANCE_PROBLEM: "Mantenimiento en progreso.",
  13470. ERROR_MAINTENANCE_SOLUTION: "Regrese en unos minutos.",
  13471. LINK_TO_LOCATION: "Enlace a la ubicación",
  13472. MENU_COPY: "Copiar",
  13473. LINK_ALERT_COPY: "Utilice CTRL/CMD + C para copiar.",
  13474. ROTATE: "Girar",
  13475. INSIDE: "Interior",
  13476. MOVE: "Moverse",
  13477. ZOOM: "Acercar o alejar"
  13478. }
  13479. }
  13480. , {}],
  13481. 113: [function(e, t, i) {
  13482. "use strict";
  13483. t.exports = {
  13484. PAGE_TITLE: "",
  13485. LOADING: "Chargement",
  13486. PRESENTED_BY_CAPS: "PRÉSENTÉ PAR",
  13487. POWERED_BY: "alimenté par ",
  13488. POWERED_BY_CAPS: "ALIMENTÉ PAR",
  13489. DESKTOP_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13490. MOBILE_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13491. PRESENTED_BY: "Présenté par ",
  13492. MORE: "Plus ",
  13493. LESS: "Moins ",
  13494. TAG_CONTENT: "Contenu tag™",
  13495. SHOW: "Montrer",
  13496. HIDE: "Cacher",
  13497. DOLLHOUSE: "Dollhouse",
  13498. FLOOR_PLAN: "Plan de sol",
  13499. OPEN_HIGHLIGHTS: "Ouvrir les faits saillants",
  13500. CLOSE_HIGHLIGHTS: "Fermer",
  13501. PREVIOUS: "Précédent",
  13502. PLAY: "Lecture",
  13503. PAUSE: "Pause",
  13504. NEXT: "Suivant",
  13505. EXPLORE_3D_SPACE: "Explorer l'Espace en 3D",
  13506. VIEW_DOLLHOUSE: "Voir dollhouse",
  13507. SOCIAL_SHARING: "Partager cet espace",
  13508. VIEW_IN_VR: "Voir en VR",
  13509. VIEW_FULLSCREEN: "Plein écran",
  13510. EXIT_FULLSCREEN: "Fermer plein écran",
  13511. ZOOM_IN: "Zoom avant",
  13512. ZOOM_OUT: "Zoom arrière",
  13513. FLOOR_NAME: "Étage ",
  13514. FLOOR_ALL: "Tous",
  13515. TERMS: "Mentions légales",
  13516. PORT_TERMS: "port mentions légales",
  13517. TERMS_OF_USE: "Conditions d'utilisation",
  13518. TERMS_TEXT_FILE: "terms-fr-FR.html",
  13519. CLOSE_TERMS: "Fermer",
  13520. TERMS_FAIL: "Impossible d'accéder aux mentions légales. Vérifiez que vous avez une connexion Internet pour afficher les conditions d'utilisation.",
  13521. HELP: "Aide",
  13522. HELP_NAVIGATION_TAB: "Navigation",
  13523. HELP_MORE_HELP_TAB: "Aide",
  13524. CLOSE: "Fermer",
  13525. HELP_DESKTOP_PANORAMA_1A: "Cliquez et faites glisser pour regarder autour de l’espace.",
  13526. HELP_DESKTOP_PANORAMA_2A: "Cliquez sur les anneaux pour vous déplacer.",
  13527. HELP_DESKTOP_PANORAMA_3A: "Utilisez la molette de votre souris pour zoomer.",
  13528. HELP_DESKTOP_PANORAMA_1B: "Ou utilisez les touches pour tourner.",
  13529. HELP_DESKTOP_PANORAMA_2B: "Ou utilisez les touches pour avancer et reculer.",
  13530. HELP_DESKTOP_PANORAMA_3B: "Ou utilisez les touches plus et moins pour zoomer.",
  13531. HELP_DESKTOP_360_2A: "Cliquez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13532. HELP_DESKTOP_360_2B: "Ou, appuyez sur la touche numéro 1 pour entrer dans la Vue Intérieure.",
  13533. HELP_DESKTOP_DOLLHOUSE_1A: "Faites un clic gauche et bougez votre souris pour faire pivoter la vue Dollhouse.",
  13534. HELP_DESKTOP_DOLLHOUSE_2A: "Faites un clic droit et bougez votre souris pour changer la position de la vue Dollhouse.",
  13535. HELP_DESKTOP_DOLLHOUSE_3A: "Utilisez la molette de votre souris pour zoomer.",
  13536. HELP_DESKTOP_DOLLHOUSE_1B: "Ou utilisez les touches pour faire pivoter la vue Dollhouse.",
  13537. HELP_DESKTOP_FLOORPLAN_1A: "Faites un clic droit pour changer la position du plan sur l’écran.",
  13538. HELP_DESKTOP_FLOORPLAN_2A: "Faites un clic droit et faites glisser à gauche ou à droite pour faire pivoter le plan.",
  13539. HELP_DESKTOP_FLOORPLAN_3A: "Utilisez la molette de votre souris pour zoomer.",
  13540. HELP_DESKTOP_FLOORPLAN_2B: "Ou utilisez les touches pour faire pivoter à gauche ou à droite.",
  13541. HELP_DESKTOP_FLOORPLAN_3B: "Ou utilisez les touches pour effectuer un zoom avant ou arrière.",
  13542. HELP_MOBILE_PANORAMA_1: "Touchez et faites glisser pour regarder autour de l’espace.",
  13543. HELP_MOBILE_PANORAMA_2: "Tapez sur les anneaux dans tout l’espace pour vous déplacer.",
  13544. HELP_MOBILE_3: "Utilisez un geste de pincement pour zoomer avant/arrière.",
  13545. HELP_MOBILE_360_2: "Tapez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13546. HELP_MOBILE_DOLLHOUSE_1: "Touchez et faites glisser vers le haut/bas/gauche/droite pour faire pivoter la vue Dollhouse.",
  13547. HELP_MOBILE_DOLLHOUSE_2: "Touchez et faites glisser avec deux doigts pour positionner vue en coupe.",
  13548. HELP_MOBILE_FLOORPLAN_1: "Touchez et faites glisser pour positionner le plan.",
  13549. HELP_MOBILE_FLOORPLAN_2: "Touchez et faites glisser avec deux doigts pour faire pivoter le plan.",
  13550. HELP_MORE_HLR_A: "Carrousel",
  13551. HELP_DESKTOP_MORE_HLR_B: "Ouvrez pour naviguer dans l’espace en utilisant les vignettes.",
  13552. HELP_MORE_DOLLHOUSE_A: "Vue en coupe",
  13553. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Cliquez pour afficher et faire pivoter l’espace entier en 3D.",
  13554. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tapez pour afficher et faire pivoter l’espace entier en 3D.",
  13555. HELP_MORE_FLOORS_A: "Sélecteur d’étage",
  13556. HELP_DESKTOP_MORE_FLOORS_B: "Basculer entre les étages dans l’espace.",
  13557. HELP_MORE_TAG_A: "tag™ Posts",
  13558. HELP_DESKTOP_MORE_TAG_B: "Cliquez ou survolez pour obtenir des informations sur l’espace.",
  13559. HELP_MOBILE_MORE_TAG_B: "Tapez pour obtenir des informations sur l’espace.",
  13560. HELP_MORE_ZOOM_A: "Commandes de zoom",
  13561. HELP_DESKTOP_MORE_ZOOM_B: "Utilisez votre clavier ou la molette de votre souris pour zoomer.",
  13562. HELP_MORE_TOUR_A: "Commandes de la visite",
  13563. HELP_DESKTOP_MORE_TOUR_B: "Mettez en marche ou en pause, avancez et reculez lors d'une visite guidée.",
  13564. HELP_MORE_INSIDE_A: "Vue intérieure",
  13565. HELP_DESKTOP_MORE_INSIDE_B: "Cliquez pour explorer l’intérieur de l’espace.",
  13566. HELP_MOBILE_MORE_INSIDE_B: "Tapez pour explorer l’intérieur de l’espace.",
  13567. HELP_MORE_VR_A: "Mode RV",
  13568. HELP_DESKTOP_MORE_VR_B: "Cliquez pour lancer l’espace en réalité virtuelle.",
  13569. HELP_MOBILE_MORE_VR_B: "Tapez pour lancer l’espace en réalité virtuelle.",
  13570. HELP_MORE_360_A: "Vues 360°",
  13571. HELP_DESKTOP_MORE_360_B: "Cliquez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13572. HELP_MOBILE_MORE_360_B: "Tapez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13573. HELP_MORE_FULLSCREEN_A: "Plein écran",
  13574. HELP_DESKTOP_MORE_FULLSCREEN_B: "Voir 3D Showcase en plein écran.",
  13575. WEBVR_FOR_CARDBOARD: "Pour Google Cardboard",
  13576. WEBVR_FOR_DAYDREAM: "Pour Daydream View",
  13577. WEBVR_ENTER_WEBVR: "ENTRER VR",
  13578. WEBVR_DIFFERENT_HEADSET: "Avez-vous un casque différent?",
  13579. WEBVR_LEARN_MORE: "En savoir plus",
  13580. WEBVR_VIEW_SPACE: "Voir Espace en VR",
  13581. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13582. WEBVR_DAYDREAM_PHONE: "Téléphone compatibles Daydream",
  13583. WEBVR_VIEW_CARDBOARD: "Ou Afficher sur Google Cardboard",
  13584. VR_VIEW_SPACE: "Voir l'Espace en Réalité Virtuelle",
  13585. VR_LEARN_MORE_CAPS: "EN SAVOIR PLUS",
  13586. VR_PREVIOUS_CAPS: "PRÉCÉDENT",
  13587. VR_NEXT_CAPS: "SUIVANT",
  13588. VR_GOT_IT_CAPS: "BIEN COMPRIS",
  13589. VR_SHOW_SUPPORTED: "Taper pour voir l'Espace en VR avec",
  13590. VR_SHOW_UNSUPPORTED: "Désolé mais votre appareil ne répond pas aux critères minimaux pour voir cet Espace en mode VR.",
  13591. VR_SHOW_IOS_1: "Taper pour voir l’Espace en Realité Virtuelle",
  13592. VR_SHOW_IOS_2: "Nécessite l’application port VR et un iPhone compatible pour voir",
  13593. VR_WHAT_YOU_NEED: "Ce dont vous aurez besoin pour...",
  13594. VR_NEED_CARDBOARD: "Ce dont vous aurez besoin avec Google Cardboard",
  13595. VR_NEED_SAMSUNG: "Ce dont vous aurez besoin avec Samsung Gear VR",
  13596. VR_NEED_DAYDREAM: "BESOINS AVANT APPARIEMENT AVEC DAYDREAM VIEW",
  13597. VR_NEED_DAYDREAM_PHONE: "Téléphone compatible avec Daydream",
  13598. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13599. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13600. VR_APP: "port VR App",
  13601. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13602. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13603. VR_COMPATIBLE_IPHONES_2: "iPhone 5s et plus récent, avec iOS 9.1 et plus récent",
  13604. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13605. VR_COMPATIBLE_ANDROID: "Appareils Android compatibles",
  13606. 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",
  13607. VR_ANDROID_DETAIL: 'Écrans 4.5" à 5.5" avec Android 4.4.4 ou plus récent',
  13608. VR_ANDROID_DVICES: "Appareils Android",
  13609. VR_COMPATIBLE_SAMSUNG: "Appareils Samsung Compatibles",
  13610. VR_SAMSUNG_DETAIL: "Galaxy S6 et plus récents",
  13611. VR_APP_FOR_CARDBOARD: "Application port VR pour Google Cardboard",
  13612. VR_APP_FOR_SAMSUNG: "Application port VR pour Gear VR",
  13613. VR_APP_FOR_ANDROID: "Application port VR pour téléphones Android",
  13614. VR_APP_OPEN: "Ouvrir plutôt avec l’application port VR",
  13615. VR_DOWNLOAD_HERE: "Télécharger ici",
  13616. VR_REQUIRE_HEADSET: "Nécessite un casque VR et l'application port VR pour Android afin d'être installé",
  13617. VR_REDIRECT_TO_STORE: "Si l'application n'est pas installée, vous serez rediriger vers l'App store.",
  13618. VR_IMPROPER_EMBED: "L'Espace port n'est pas correctement intégré pour supporter VR dans votre navigateur Web.",
  13619. VR_OPEN_ANDROID_LINK: "Ouvrez ce lien avec votre appareil mobile",
  13620. VR_ANDROID_OPTIONS: "Options disponibles pour casque VR sous",
  13621. SHARE_TO: "Partager sur",
  13622. SHARE_LINK: "Lien direct",
  13623. SHARE_EXPLORE: "Explorer ",
  13624. SHARE_AT: "à",
  13625. SHARE_WITH: "avec",
  13626. SHARE_3D: " en 3D",
  13627. SHARE_COPIED: "Copié!",
  13628. ERROR_BROWSER_SOLUTION: "Installer un nouveau navigateur pour explorer en 3D.",
  13629. ERROR_BROWSER_EXPLANATION: "WebGL a besoin d'un navigateur récent.",
  13630. ERROR_GENERIC_PROBLEM: "Il y eu un problème.",
  13631. ERROR_GENERIC_SOLUTION: "Redémarrer votre navigateur.",
  13632. ERROR_GENERIC_ACTIONS_1: "Si le problème persiste, ",
  13633. ERROR_GENERIC_ACTIONS_2: "installez un navigateur plus récent",
  13634. ERROR_GENERIC_ACTIONS_3: " ou ",
  13635. ERROR_GENERIC_ACTIONS_4: "voir notre guide de dépannage",
  13636. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navigateur non-supporté.",
  13637. ERROR_WEBGL_IOS_PROBLEM: "Version iOS non-supportée.",
  13638. ERROR_WEBGL_IOS_SOLUTION: "Mettre à jour avec iOS8 au minimum pour voir l'Espace en 3D.",
  13639. ERROR_WEBGL_IOS_ACTIONS_1: "Tapez ",
  13640. ERROR_WEBGL_IOS_ACTIONS_2: "Paramètres > Général > Mise à jour Software",
  13641. ERROR_WEBGL_SAFARI_PROBLEM: "Activez WegGL pour explorer en 3D.",
  13642. ERROR_WEBGL_SAFARI_ACTIONS_1: "Cliquez ",
  13643. ERROR_WEBGL_SAFARI_ACTIONS_2: "Préferences > Avancés > Voir menu développeur",
  13644. ERROR_WEBGL_SAFARI_ACTIONS_3: "Puis cliquez ",
  13645. ERROR_WEBGL_SAFARI_ACTIONS_4: "Développe > Activé WebGL",
  13646. ERROR_MISSING_URLS_PROBLEM: "Il n'y a pas de panoromas pour ce modèle.",
  13647. ERROR_MISSING_URLS_EXPLANATION: "Ceci est un ancien modèle. Le propriétaire du site a peut-être un nouveau modèle en cours.",
  13648. ERROR_LOADING_FAILED_PROBLEM: "Ce modèle n'est pas disponible.",
  13649. ERROR_LOADING_FAILED_ACTIONS_1: "Si le problème persiste, ",
  13650. ERROR_LOADING_FAILED_ACTIONS_2: "voir notre guide de dépannage",
  13651. ERROR_MAINTENANCE_PROBLEM: "Maintenance en cours.",
  13652. ERROR_MAINTENANCE_SOLUTION: "Revenez dans quelques instants.",
  13653. LINK_TO_LOCATION: "Lien vers l'emplacement",
  13654. MENU_COPY: "Copie",
  13655. LINK_ALERT_COPY: "Utiliser CTRL+CMD C pour copier.",
  13656. ROTATE: "Faire pivoter",
  13657. INSIDE: "Intérieure",
  13658. MOVE: "Se déplacer",
  13659. ZOOM: "Zoom"
  13660. }
  13661. }
  13662. , {}],
  13663. 114: [function(e, t, i) {
  13664. "use strict";
  13665. t.exports = {
  13666. PAGE_TITLE: "",
  13667. LOADING: "読み込み中",
  13668. PRESENTED_BY_CAPS: "PRESENTED BY",
  13669. POWERED_BY: "powered by",
  13670. POWERED_BY_CAPS: "POWERED BY",
  13671. DESKTOP_SHORT_CTA: "クリックしてこの3D Spaceを探索",
  13672. MOBILE_SHORT_CTA: "タップしてこの3D Spaceを探索",
  13673. PRESENTED_BY: "Presented by ",
  13674. MORE: "全て表示 ",
  13675. LESS: "閉じる ",
  13676. TAG_CONTENT: "tag™コンテンツ ",
  13677. SHOW: "表示",
  13678. HIDE: "非表示",
  13679. DOLLHOUSE: "ドールハウス",
  13680. FLOOR_PLAN: "フロアプラン",
  13681. OPEN_HIGHLIGHTS: "ハイライトを開く",
  13682. CLOSE_HIGHLIGHTS: "閉じる",
  13683. PREVIOUS: "前へ",
  13684. PLAY: "再生",
  13685. PAUSE: "一時停止",
  13686. NEXT: "次へ",
  13687. EXPLORE_3D_SPACE: "3DSpaceの探索",
  13688. VIEW_DOLLHOUSE: "ドールハウスの表示",
  13689. SOCIAL_SHARING: "このSpaceを共有する",
  13690. VIEW_IN_VR: "VRで表示",
  13691. VIEW_FULLSCREEN: "フルスクリーン表示",
  13692. EXIT_FULLSCREEN: "フルスクリーン表示を終了",
  13693. ZOOM_IN: "ズームイン",
  13694. ZOOM_OUT: "ズームアウト",
  13695. FLOOR_NAME: "フロア ",
  13696. FLOOR_ALL: "すべて",
  13697. TERMS: "規約",
  13698. PORT_TERMS: "port規約",
  13699. TERMS_OF_USE: "利用規約",
  13700. CLOSE_TERMS: "閉じる",
  13701. TERMS_TEXT_FILE: "terms-jp-JP.html",
  13702. TERMS_FAIL: "規約を取得できませんでした。利用規約を表示するためにインターネットに接続されていることを確認してください。",
  13703. WEBVR_FOR_DAYDREAM: "Daydream View用",
  13704. WEBVR_ENTER_WEBVR: "VRに入る",
  13705. WEBVR_DIFFERENT_HEADSET: "別のヘッドセットをお持ちですか?",
  13706. WEBVR_LEARN_MORE: "もっと詳しく",
  13707. WEBVR_VIEW_SPACE: "VRでSpaceを表示",
  13708. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13709. WEBVR_DAYDREAM_PHONE: "Daydream対応スマホ",
  13710. WEBVR_FOR_CARDBOARD: "Google Cardboard用",
  13711. WEBVR_VIEW_CARDBOARD: "またはGoogle Cardboardで表示",
  13712. VR_VIEW_SPACE: "バーチャルリアリティでSpaceを表示",
  13713. VR_LEARN_MORE_CAPS: "もっと詳しく",
  13714. VR_PREVIOUS_CAPS: "前へ",
  13715. VR_NEXT_CAPS: "次へ",
  13716. VR_GOT_IT_CAPS: "了解",
  13717. VR_SHOW_SUPPORTED: "タップして次を使用してVRでSpaceを表示: ",
  13718. VR_SHOW_UNSUPPORTED: "お使いのデバイスはVRでSpaceを表示する最低要件を満たしていません",
  13719. VR_SHOW_IOS_1: "タップしてVRでSpaceを表示",
  13720. VR_SHOW_IOS_2: "表示するにはport VRアプリと互換性のあるiPhoneが必要です",
  13721. VR_WHAT_YOU_NEED: "必要なもの",
  13722. VR_NEED_CARDBOARD: "Google Cardboardに必要なもの",
  13723. VR_NEED_SAMSUNG: "Samsung Gear VRに必要なもの",
  13724. VR_NEED_DAYDREAM: "事前にDaydream Viewとのペアリングが必要です",
  13725. VR_NEED_DAYDREAM_PHONE: "Daydream対応スマホ",
  13726. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13727. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13728. VR_APP: "port VRアプリ",
  13729. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13730. VR_COMPATIBLE_IPHONES_1: "iPhone",
  13731. VR_COMPATIBLE_IPHONES_2: "iOS 9.1以降で動作するiPhone 5s以降のモデル",
  13732. VR_COMPATIBLE_IPHONES_3: "互換性のあるiPhone",
  13733. VR_COMPATIBLE_ANDROID: "互換性のあるAndroidデバイス",
  13734. VR_COMPATIBLE_ANDROID_LONG: "Android OS 4.4.4以降で動作する互換性のあるAndroidデバイスの4.5~5.5インチディスプレイ",
  13735. VR_ANDROID_DETAIL: "Android OS 4.4.4以降で動作する4.5~5.5インチディスプレイ",
  13736. VR_ANDROID_DVICES: "Androidデバイス",
  13737. VR_COMPATIBLE_SAMSUNG: "互換性のあるSamsungデバイス",
  13738. VR_SAMSUNG_DETAIL: "Galaxy S5以降のモデル",
  13739. VR_APP_FOR_CARDBOARD: "Google Cardboard用のport VRアプリ",
  13740. VR_APP_FOR_SAMSUNG: "Gear VR 用のport VRアプリ",
  13741. VR_APP_FOR_ANDROID: "Androidフォン用のport VRアプリ",
  13742. VR_APP_OPEN: "port VRアプリで開く",
  13743. VR_DOWNLOAD_HERE: "ここからダウンロード",
  13744. VR_REQUIRE_HEADSET: "Android 用のVRヘッドセットとport VRアプリ をインストールする必要があります",
  13745. VR_REDIRECT_TO_STORE: "アプリがインストールされていない場合、App Storeにリダイレクトされます",
  13746. VR_IMPROPER_EMBED: "お使いのウェブブラウザでVRがサポートされるようport Spaceが適切に埋め込まれていません。",
  13747. VR_OPEN_ANDROID_LINK: "お使いの携帯電話でリンクを開いてください",
  13748. VR_ANDROID_OPTIONS: "利用可能なVRヘッドセットオプション",
  13749. SHARE_TO: "共有先",
  13750. SHARE_LINK: "ダイレクトリンク",
  13751. SHARE_EXPLORE: "探索",
  13752. SHARE_AT: "場所",
  13753. SHARE_WITH: "使用アプリ",
  13754. SHARE_3D: "3Dで",
  13755. SHARE_COPIED: "コピーされました!",
  13756. ERROR_BROWSER_SOLUTION: "3D探索するには、新しいバージョンのブラウザをインストールしてください",
  13757. ERROR_BROWSER_EXPLANATION: "WebGLにはモダンブラウザが必要です。",
  13758. ERROR_GENERIC_PROBLEM: "問題が発生しました。",
  13759. ERROR_GENERIC_SOLUTION: "ブラウザを再起動してください。",
  13760. ERROR_GENERIC_ACTIONS_1: "問題が解決しない場合は、",
  13761. ERROR_GENERIC_ACTIONS_2: "サポートされているブラウザをインストールしてください",
  13762. ERROR_GENERIC_ACTIONS_3: "または",
  13763. ERROR_GENERIC_ACTIONS_4: "トラブルシューティングガイドを参照してください",
  13764. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "ブラウザがサポートされていません。",
  13765. ERROR_WEBGL_IOS_PROBLEM: "サポートされていないiOSバージョンです。",
  13766. ERROR_WEBGL_IOS_SOLUTION: "3D探索するには、iOS 8以降にアップグレードしてください。",
  13767. ERROR_WEBGL_IOS_ACTIONS_1: "以下の順にタップします:",
  13768. ERROR_WEBGL_IOS_ACTIONS_2: "設定 > 全般 > ソフトウェアの更新",
  13769. ERROR_WEBGL_SAFARI_PROBLEM: "WebGLを有効にして3Dで探索します。",
  13770. ERROR_WEBGL_SAFARI_ACTIONS_1: "以下の順にクリックします:",
  13771. ERROR_WEBGL_SAFARI_ACTIONS_2: "環境設定 > 詳細 > メニューバーに開発メニューを表示",
  13772. ERROR_WEBGL_SAFARI_ACTIONS_3: "その後、以下の順にクリックします:",
  13773. ERROR_WEBGL_SAFARI_ACTIONS_4: "開発 > WebGLを有効にする",
  13774. ERROR_MISSING_URLS_PROBLEM: "このモデルではパノラマを使用できません。",
  13775. ERROR_MISSING_URLS_EXPLANATION: "これは古いモデルです。ウェブサイト所有者が新しいモデルを開発中かもしれません。",
  13776. ERROR_LOADING_FAILED_PROBLEM: "モデルは利用できません。",
  13777. ERROR_LOADING_FAILED_ACTIONS_1: "問題が解決しない場合は、",
  13778. ERROR_LOADING_FAILED_ACTIONS_2: "トラブルシューティングガイドを参照してください",
  13779. ERROR_MAINTENANCE_PROBLEM: "メンテナンスは進行中です。",
  13780. ERROR_MAINTENANCE_SOLUTION: "しばらくしてからやり直し てください。",
  13781. LINK_TO_LOCATION: "ロケーションへのリンク",
  13782. MENU_COPY: "コピー",
  13783. LINK_ALERT_COPY: "コピーするにはCTRL/CMD + Cを使用してください。",
  13784. ROTATE: "回転",
  13785. MOVE: "移動",
  13786. INSIDE: "内側",
  13787. ZOOM: "ズーム",
  13788. HELP: "ヘルプ",
  13789. HELP_NAVIGATION_TAB: "ナビゲーション",
  13790. HELP_MORE_HELP_TAB: "その他のヘルプ",
  13791. HELP_DESKTOP_PANORAMA_1A: "Spaceを見回すには、クリックしてドラッグします。",
  13792. HELP_DESKTOP_PANORAMA_2A: "移動するには、Space全体にあるリングをクリックします。",
  13793. HELP_DESKTOP_PANORAMA_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13794. HELP_DESKTOP_PANORAMA_1B: "または、矢印キーを使用して左右に向きを変えます。",
  13795. HELP_DESKTOP_PANORAMA_2B: "または、矢印キーを使用して前後に向きを変えます。",
  13796. HELP_DESKTOP_PANORAMA_3B: "あるいは、プラス(+)キーまたはマイナス(-)キーを使用して、ズームイン、ズームアウトします。",
  13797. HELP_DESKTOP_360_2A: "内側ビューアイコンをクリックしてSpaceに入ります。",
  13798. HELP_DESKTOP_360_2B: "または、数字キー1を押して内側ビューに入ります。",
  13799. HELP_DESKTOP_DOLLHOUSE_1A: "左クリックと左右、上下のドラッグでドールハウスを回転します。",
  13800. HELP_DESKTOP_DOLLHOUSE_2A: "右クリックと左右、上下のドラッグでドールハウスの画面上の位置を変更します。",
  13801. HELP_DESKTOP_DOLLHOUSE_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13802. HELP_DESKTOP_DOLLHOUSE_1B: "または、矢印キーを使用してドールハウスを回転します。",
  13803. HELP_DESKTOP_FLOORPLAN_1A: "左ボタンを押しながら、上下左右にドラッグしてフロアプランの画面上の位置を変更します。",
  13804. HELP_DESKTOP_FLOORPLAN_2A: "右ボタンを押しながら左右にドラッグして、フロアプランを回転します。",
  13805. HELP_DESKTOP_FLOORPLAN_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13806. HELP_DESKTOP_FLOORPLAN_2B: "または、矢印キーを使用して左右に回転します。",
  13807. HELP_DESKTOP_FLOORPLAN_3B: "または、矢印キーを使用して、ズームイン、ズームアウトします。",
  13808. HELP_MOBILE_PANORAMA_1: "Spaceを見回すには、タッチしてドラッグします。",
  13809. HELP_MOBILE_PANORAMA_2: "移動するには、Space全体にあるリングをタップします。",
  13810. HELP_MOBILE_3: "ピンチジェスチャーを使用してズームイン、ズームアウトします。",
  13811. HELP_MOBILE_360_2: "内側ビューアイコンをタップしてSpaceに入ります。",
  13812. HELP_MOBILE_DOLLHOUSE_1: "タッチして上下左右にドラッグしてドールハウスを回転します。",
  13813. HELP_MOBILE_DOLLHOUSE_2: "タッチして、2本指でドラッグしてドールハウスを配置します。",
  13814. HELP_MOBILE_FLOORPLAN_1: "タッチ&ドラッグしてフロアプランを配置します。",
  13815. HELP_MOBILE_FLOORPLAN_2: "タッチして、2本指でドラッグしてフロアプランを回転します。",
  13816. HELP_MORE_HLR_A: "ハイライト",
  13817. HELP_DESKTOP_MORE_HLR_B: "サムネイル画像を使用してSpaceを移動するために開きます。",
  13818. HELP_MORE_DOLLHOUSE_A: "ドールハウス",
  13819. HELP_DESKTOP_MORE_DOLLHOUSE_B: "クリックして3DでSpace全体のトップダウンビューを表示して回転します。",
  13820. HELP_MOBILE_MORE_DOLLHOUSE_B: "タップして3DでSpace全体のトップダウンビューを表示して回転します。",
  13821. HELP_MORE_FLOORS_A: "フロアセレクター",
  13822. HELP_DESKTOP_MORE_FLOORS_B: "Space内のフロアを切り替えます。",
  13823. HELP_MORE_TAG_A: "tag™ Posts",
  13824. HELP_DESKTOP_MORE_TAG_B: "クリックするか、カーソルを置くとSpace内の機能についての説明が表示されます。",
  13825. HELP_MOBILE_MORE_TAG_B: "タップするとSpace内の機能についての説明が表示されます。",
  13826. HELP_MORE_ZOOM_A: "ズームコントロール",
  13827. HELP_DESKTOP_MORE_ZOOM_B: "これらのコントロールまたはスクロールホイールを使用して、ズームイン、ズームアウトします。",
  13828. HELP_MORE_TOUR_A: "ツアーコントロール",
  13829. HELP_DESKTOP_MORE_TOUR_B: "ガイド付きツアー中に再生、一時停止、前方・後方に移動します。",
  13830. HELP_MORE_INSIDE_A: "内側ビュー",
  13831. HELP_DESKTOP_MORE_INSIDE_B: "クリックしてSpace内を探索します。",
  13832. HELP_MOBILE_MORE_INSIDE_B: "タップしてSpace内を探索します。",
  13833. HELP_MORE_VR_A: "VRモード",
  13834. HELP_DESKTOP_MORE_VR_B: "クリックしてバーチャルリアリティでSpaceを起動します。",
  13835. HELP_MOBILE_MORE_VR_B: "タップしてバーチャルリアリティでSpaceを起動します。",
  13836. HELP_MORE_360_A: "360° Views",
  13837. HELP_DESKTOP_MORE_360_B: "Highlight Reelの360° Viewsをクリックして屋外シーンを表示します。",
  13838. HELP_MOBILE_MORE_360_B: "Highlight Reelの360° Viewsをタップして屋外シーンを表示します。",
  13839. HELP_MORE_FULLSCREEN_A: "フルスクリーン",
  13840. HELP_DESKTOP_MORE_FULLSCREEN_B: "3D Showcaseをフルスクリーン表示にします。",
  13841. CLOSE: "閉じる"
  13842. }
  13843. }
  13844. , {}],
  13845. 115: [function(e, t, i) {
  13846. "use strict";
  13847. t.exports = {
  13848. PAGE_TITLE: "",
  13849. LOADING: "Загрузка",
  13850. PRESENTED_BY_CAPS: "ПРЕДСТАВЛЕНО",
  13851. POWERED_BY: "разработано на платформе ",
  13852. POWERED_BY_CAPS: "РАЗРАБОТАНО НА ПЛАТФОРМЕ",
  13853. DESKTOP_SHORT_CTA: "Нажмите для просмотра.",
  13854. MOBILE_SHORT_CTA: "Нажмите для просмотра.",
  13855. PRESENTED_BY: "Представлено ",
  13856. MORE: "Больше ",
  13857. LESS: "Меньше ",
  13858. TAG_CONTENT: "tag™ Контент",
  13859. SHOW: "Показать",
  13860. HIDE: "Скрыть",
  13861. DOLLHOUSE: "Dollhouse",
  13862. FLOOR_PLAN: "Планировка",
  13863. OPEN_HIGHLIGHTS: "Открыть Фотоколлаж",
  13864. CLOSE_HIGHLIGHTS: "Закрыть",
  13865. PREVIOUS: "Предыдущий",
  13866. PLAY: "Воспроизвести",
  13867. PAUSE: "Пауза",
  13868. NEXT: "Следующий",
  13869. EXPLORE_3D_SPACE: "Просмотреть 3D модель",
  13870. VIEW_DOLLHOUSE: "Посмотреть Dollhouse",
  13871. SOCIAL_SHARING: "Поделиться этой моделью",
  13872. VIEW_IN_VR: "Посмотреть в VR",
  13873. VIEW_FULLSCREEN: "Полный экран",
  13874. EXIT_FULLSCREEN: "Выйти из полноэкранного режима",
  13875. ZOOM_IN: "Увеличить",
  13876. ZOOM_OUT: "Уменьшить",
  13877. FLOOR_NAME: "Этаж ",
  13878. FLOOR_ALL: "Все",
  13879. TERMS: "Условия",
  13880. PORT_TERMS: "Правила пользования",
  13881. TERMS_OF_USE: "Условия использования",
  13882. TERMS_TEXT_FILE: "terms-ru-RU.html",
  13883. CLOSE_TERMS: "Закрыть",
  13884. TERMS_FAIL: "Не удалось загрузить условия использования. Для просмотра условий использования, пожалуйста, убедитесь, что у Вас есть подключение к Интернету.",
  13885. HELP: "Помощь",
  13886. HELP_NAVIGATION_TAB: "Навигация",
  13887. HELP_MORE_HELP_TAB: "Доп. Помощь",
  13888. CLOSE: "Закрыть",
  13889. HELP_DESKTOP_PANORAMA_1A: "Нажмите и перетащите, чтобы осмотреть пространство вокруг.",
  13890. HELP_DESKTOP_PANORAMA_2A: "Для передвижения по модели нажимайте на круги .",
  13891. HELP_DESKTOP_PANORAMA_3A: "Используйте колесо прокрутки для увеличения и уменьшения.",
  13892. HELP_DESKTOP_PANORAMA_1B: "Или используйте клавиши со стрелками для поворота влево и вправо.",
  13893. HELP_DESKTOP_PANORAMA_2B: "Или используйте стрелки для перемещения вперед и назад.",
  13894. HELP_DESKTOP_PANORAMA_3B: "Или используйте клавиши ‘плюс’ и ‘минус’ для увеличения и уменьшения изображения.",
  13895. HELP_DESKTOP_360_2A: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  13896. HELP_DESKTOP_360_2B: "или нажмите 1 на клавиатуре, чтобы увидеть внутреннюю панораму.",
  13897. HELP_DESKTOP_DOLLHOUSE_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы повернуть Dollhouse.",
  13898. HELP_DESKTOP_DOLLHOUSE_2A: "Нажмите правую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить позицию Dollhouse на экране.",
  13899. HELP_DESKTOP_DOLLHOUSE_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  13900. HELP_DESKTOP_DOLLHOUSE_1B: "Или используйте клавиши со стрелками, чтобы повернуть Dollhouse.",
  13901. HELP_DESKTOP_FLOORPLAN_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить положение Планировки на экране.",
  13902. HELP_DESKTOP_FLOORPLAN_2A: "Нажмите правую кнопку мыши и перетащите влево или вправо, чтобы повернуть Планировку.",
  13903. HELP_DESKTOP_FLOORPLAN_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  13904. HELP_DESKTOP_FLOORPLAN_2B: "Или используйте клавиши со стрелками для поворота влево или вправо.",
  13905. HELP_DESKTOP_FLOORPLAN_3B: "Или используйте стрелки для увеличения и уменьшения.",
  13906. HELP_MOBILE_PANORAMA_1: "Нажмите и перетащите, чтобы осмотреть модель.",
  13907. HELP_MOBILE_PANORAMA_2: "Для передвижения по модели нажимайте на круги.",
  13908. HELP_MOBILE_3: "Используйте движение двумя пальцами в разные стороны, чтобы увеличить и уменьшить.",
  13909. HELP_MOBILE_360_2: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  13910. HELP_MOBILE_DOLLHOUSE_1: "Нажмите и перетащите вверх, вниз, влево и вправо, чтобы повернуть Dollhouse.",
  13911. HELP_MOBILE_DOLLHOUSE_2: "Нажмите и перетащите, чтобы расположить Dollhouse.",
  13912. HELP_MOBILE_FLOORPLAN_1: "Нажмите и перетащите, чтобы расположить план здания.",
  13913. HELP_MOBILE_FLOORPLAN_2: "Коснитесь и перетащите двумя пальцами, чтобы повернуть план здания.",
  13914. HELP_MORE_HLR_A: "Фотоколлаж",
  13915. HELP_DESKTOP_MORE_HLR_B: "Откройте для перемещения по модели, используя иконки изображений.",
  13916. HELP_MORE_DOLLHOUSE_A: "Dollhouse",
  13917. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  13918. HELP_MOBILE_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  13919. HELP_MORE_FLOORS_A: "Выбор Этажа",
  13920. HELP_DESKTOP_MORE_FLOORS_B: "Переключение между этажами.",
  13921. HELP_MORE_TAG_A: "tag™ Posts",
  13922. HELP_DESKTOP_MORE_TAG_B: "Нажмите или наведите курсор мыши для получения информации о функциях в Пространстве.",
  13923. HELP_MOBILE_MORE_TAG_B: "Нажмите для получения информации о функциях.",
  13924. HELP_MORE_ZOOM_A: "Масштаб",
  13925. HELP_DESKTOP_MORE_ZOOM_B: "Используйте эти кнопки для увеличения и уменьшения изображения или используйте колесо прокрутки.",
  13926. HELP_MORE_TOUR_A: "Управление Туром",
  13927. HELP_DESKTOP_MORE_TOUR_B: "Используйте кнопки Воспроизвести, Пауза, Вперед и Назад для управления фотоколлажем.",
  13928. HELP_MORE_INSIDE_A: "Вид Изнутри",
  13929. HELP_DESKTOP_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  13930. HELP_MOBILE_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  13931. HELP_MORE_VR_A: "Режим VR",
  13932. HELP_DESKTOP_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  13933. HELP_MOBILE_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  13934. HELP_MORE_360_A: "360° Views",
  13935. HELP_DESKTOP_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  13936. HELP_MOBILE_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  13937. HELP_MORE_FULLSCREEN_A: "Полный экран",
  13938. HELP_DESKTOP_MORE_FULLSCREEN_B: "Развернуть 3D Showcase во весь экран.",
  13939. WEBVR_FOR_CARDBOARD: "Для Google Cardboard",
  13940. WEBVR_FOR_DAYDREAM: "Для просмотра в Daydream",
  13941. WEBVR_ENTER_WEBVR: "ВОЙТИ В VR ",
  13942. WEBVR_DIFFERENT_HEADSET: "Есть другой VR-шлем?",
  13943. WEBVR_LEARN_MORE: "Узнать больше",
  13944. WEBVR_VIEW_SPACE: "Запустить модель в VR",
  13945. WEBVR_DAYDREAM_VIEW: "Посмотреть в Daydream",
  13946. WEBVR_DAYDREAM_PHONE: "Daydream-готовый телефон",
  13947. WEBVR_VIEW_CARDBOARD: "Или просмотреть в Google Cardboard",
  13948. VR_WHAT_YOU_NEED: "Что Вам потребуется...",
  13949. VR_NEED_DAYDREAM_PHONE: "Daydream-готовый телефон",
  13950. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13951. VR_APP: "port VR App",
  13952. VR_APP_OPEN: "Или открыть через приложение port VR",
  13953. VR_COMPATIBLE_ANDROID_LONG: 'Совместимые Android устройства с диагональю экрана 4.5"-5.5" дюймов и Android версией 4.4.4, и выше',
  13954. VR_SAMSUNG_DETAIL: "Galaxy S6 и выше",
  13955. VR_APP_FOR_ANDROID: "Приложение port VR для Android",
  13956. VR_NEED_DAYDREAM: "Необходимо для соединением с Daydream",
  13957. VR_VIEW_SPACE: "Запустить модель в VR",
  13958. VR_LEARN_MORE_CAPS: "УЗНАТЬ БОЛЬШЕ",
  13959. VR_PREVIOUS_CAPS: "ПРЕДЫДУЩИЙ",
  13960. VR_NEXT_CAPS: "СЛЕДУЮЩИЙ",
  13961. VR_GOT_IT_CAPS: "ЯСНО",
  13962. VR_SHOW_SUPPORTED: "Нажмите, чтобы просмотреть модель в VR с помощью",
  13963. VR_SHOW_UNSUPPORTED: "Извините, но Ваше устройство не соответствует минимальным требованиям для просмотра модели в VR.",
  13964. VR_SHOW_IOS_1: "Нажмите, чтобы просмотреть модель в VR",
  13965. VR_SHOW_IOS_2: "Для просмотра требуется приложение port VR и совместимый iPhone",
  13966. VR_NEED_CARDBOARD: "Что Вам потребуется для Google Cardboard",
  13967. VR_NEED_SAMSUNG: "Что Вам потребуется для Samsung Gear VR",
  13968. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13969. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13970. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13971. VR_COMPATIBLE_IPHONES_2: "iPhone 5s или новее с iOS 9.1 и выше",
  13972. VR_COMPATIBLE_IPHONES_3: "Совместимые модели iPhone",
  13973. VR_COMPATIBLE_ANDROID: "Совместимые Android устройства",
  13974. VR_ANDROID_DETAIL: 'Экран от 4.5" до 5.5" и Android 4.4.4, и выше',
  13975. VR_ANDROID_DVICES: "Android устройства",
  13976. VR_COMPATIBLE_SAMSUNG: "Совместимые Samsung устройства",
  13977. VR_APP_FOR_CARDBOARD: "Приложение port VR для Google Cardboard",
  13978. VR_APP_FOR_SAMSUNG: "Приложение port VR для Gear VR",
  13979. VR_DOWNLOAD_HERE: "Скачать здесь",
  13980. VR_REQUIRE_HEADSET: "Требуется VR-шлем и установленное приложение port VR для Android",
  13981. VR_REDIRECT_TO_STORE: "Если приложение не установлено, Вы будете перенаправлены на страницу магазина приложений.",
  13982. VR_IMPROPER_EMBED: "port модель не встроена должным образом для поддержки VR в вашем веб-браузере.",
  13983. VR_OPEN_ANDROID_LINK: "Откройте ссылку на Вашем мобильном телефоне",
  13984. VR_ANDROID_OPTIONS: "Доступные опции VR-шлемов",
  13985. SHARE_TO: "Поделиться",
  13986. SHARE_LINK: "Прямая ссылка",
  13987. SHARE_EXPLORE: "просмотреть",
  13988. SHARE_AT: "на",
  13989. SHARE_WITH: "с",
  13990. SHARE_3D: "в 3D",
  13991. SHARE_COPIED: "Скопировано!",
  13992. ERROR_BROWSER_SOLUTION: "установите новый браузер, чтобы просмотреть 3D пространство.",
  13993. ERROR_BROWSER_EXPLANATION: "WebGL требует современный браузер.",
  13994. ERROR_GENERIC_PROBLEM: "Ой, что-то пошло не так.",
  13995. ERROR_GENERIC_SOLUTION: "Перезапустите браузер.",
  13996. ERROR_GENERIC_ACTIONS_1: "Если проблема не устранена, ",
  13997. ERROR_GENERIC_ACTIONS_2: "установите поддерживаемый браузер",
  13998. ERROR_GENERIC_ACTIONS_3: " или ",
  13999. ERROR_GENERIC_ACTIONS_4: "смотрите наше руководство по устранению неполадок",
  14000. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Браузер не поддерживается.",
  14001. ERROR_WEBGL_IOS_PROBLEM: "iOS-версия не поддерживается.",
  14002. ERROR_WEBGL_IOS_SOLUTION: "Обновите до iOS 8 или выше, чтобы просмотреть пространство в 3D.",
  14003. ERROR_WEBGL_IOS_ACTIONS_1: "Нажмите ",
  14004. ERROR_WEBGL_IOS_ACTIONS_2: "Настройки > Общие > Обновление ПО",
  14005. ERROR_WEBGL_SAFARI_PROBLEM: "Включите WebGL для 3D-просмотра.",
  14006. ERROR_WEBGL_SAFARI_ACTIONS_1: "Нажмите ",
  14007. ERROR_WEBGL_SAFARI_ACTIONS_2: "Настойки > Дополнения > Показывать меню “Разработка” в строке меню",
  14008. ERROR_WEBGL_SAFARI_ACTIONS_3: "Затем нажмите ",
  14009. ERROR_WEBGL_SAFARI_ACTIONS_4: "Разработка > Разрешить WebGL",
  14010. ERROR_MISSING_URLS_PROBLEM: "Ой, для этой модели нет панорамы.",
  14011. ERROR_MISSING_URLS_EXPLANATION: "Эта модель устарела. У владельца веб-сайта может быть новая модель.",
  14012. ERROR_LOADING_FAILED_PROBLEM: "Ой, модель недоступна.",
  14013. ERROR_LOADING_FAILED_ACTIONS_1: "Если проблема не устранена, ",
  14014. ERROR_LOADING_FAILED_ACTIONS_2: "посмотрите наше руководство по устранению неполадок",
  14015. ERROR_MAINTENANCE_PROBLEM: "Выполняется техническое обслуживание.",
  14016. ERROR_MAINTENANCE_SOLUTION: "Пожалуйста, попробуйте снова через несколько минут.",
  14017. LINK_TO_LOCATION: "Ссылка на местоположение",
  14018. MENU_COPY: "Копировать",
  14019. LINK_ALERT_COPY: "Для того, чтобы скопировать, пожалуйста, используйте CTRL/CMD + C.",
  14020. ROTATE: "Вращать",
  14021. MOVE: "Передвигаться",
  14022. INSIDE: "Вид изнутри",
  14023. ZOOM: "Масштаб"
  14024. }
  14025. }
  14026. , {}],
  14027. 116: [function(e, t, i) {//main.js
  14028. (function(t) {
  14029. "use strict";
  14030. function i() {
  14031. var e = Y.getModelIDFromQueryString();
  14032. if (!e)
  14033. return b(null, "loading-failed");
  14034. var t = Y.parseSidUrl(e)
  14035. , i = l()
  14036. , a = c()
  14037. , s = o()
  14038. , u = V.quickstart.enabled
  14039. , g = null
  14040. , m = null
  14041. , v = null
  14042. , w = null
  14043. , T = null
  14044. , x = null
  14045. , S = null
  14046. , M = null
  14047. , R = null
  14048. , P = null
  14049. , O = null
  14050. , L = null
  14051. , N = new ue;
  14052. r(s);
  14053. /* h({ //MP开头写法
  14054. urlBase: t.urlBase
  14055. }).then...... */
  14056. $.ajax(g_Prefix+"data/"+window.number+"/someData.json",{dataType: "json"}).done( function(e){ //改
  14057. e.files.templates[0] = e.files.templates[0].replace("{{number}}",window.number);
  14058. window.MP_PREFETCHED_MODELDATA = e;
  14059. h({
  14060. urlBase: t.urlBase
  14061. })//xzw someData.js是我整合的 原本在html里 但这样每个场景的html都不一样了
  14062. }).then(function(i) {
  14063. return re.init(),
  14064. d(t, e) //getModel and load
  14065. }).then(function(e) {
  14066. return P = e,
  14067. p(P, V.appConfig.segment_key, V.appConfig.keen_write_key, V.appConfig.keen_project_id, {
  14068. startSource: i,
  14069. autoplay: V.autoplay,
  14070. quickstart: u
  14071. }),
  14072. P.urls.init()
  14073. }).then(function() {
  14074. return P.loadPanos()
  14075. }).then(function() {
  14076. m = X.getStartCameraOptions(P, P.panos),
  14077. S = A(P),
  14078. O = y(u, m.mode),
  14079. v = O.controls,
  14080. w = O.player,
  14081. T = O.director,
  14082. x = O.tagManager,
  14083. M = O.tileDownloader,
  14084. R = O.qualityManager,
  14085. L = O.panoRenderer,
  14086. C(P, S, O, s),
  14087. w.director = T,//xzw add
  14088. P.supportsTiles && M.start(),
  14089. !u || m.mode === D.PANORAMA && m.pano || (de.warn("Tried to quickstart, but failed as we are not starting in inside mode."),
  14090. u = !1);
  14091. var e = null;
  14092. if (u) {
  14093. de.warn("Quickstart engaged. Hold on to your knickers.");
  14094. var t = v.controls[D.PANORAMA];
  14095. g = new ie(R,S.scene,S.camera,t,s),
  14096. _(S, s, P),
  14097. e = g.load(m).then(function() {
  14098. S.addComponent(g),
  14099. S.once(le.AfterRender, function() {
  14100. de.warn("First render after quickstart load finished.")
  14101. })
  14102. })
  14103. }
  14104. return $.when(e, U.startLoading(P, w, T, V.autoplay, u, N))
  14105. }).then(function() {
  14106. return f(P, U.onProgress, i, !u, a)
  14107. }).then(function() {
  14108. if (m.quickstart = u,
  14109. I(P, S, O, s),
  14110. S.started || _(S, s, P),
  14111. H.modelLoaded(P, w, v, V.autoplay),
  14112. E(w, P, m, V.autoplay).done(function() {
  14113. T.autoTour()
  14114. }),
  14115. !P.supportsTiles) {
  14116. var e = new Z(P,w);
  14117. e.start()
  14118. }
  14119. u && (S.removeComponent(g),
  14120. g.destroy(),
  14121. m.pano.enter()),
  14122. U.init(P, T, w, v, S, m, H.getSessionId()),
  14123. U.endLoading(P, T, x),
  14124. S.once(le.AfterRender, function() {
  14125. N.setAppReadyTime();
  14126. var e = N.calcFullLoadingTime();
  14127. de.warn("Total load time: " + e / 1e3),
  14128. H.loadComplete(e),
  14129. de.warn("First render after model load finished.")
  14130. }),
  14131. S.on(le.MemoryUsageUpdated, n)
  14132. }).fail(b.bind(this, e))
  14133. }
  14134. function n(e) {
  14135. ce.update(e)
  14136. }
  14137. function r(e) {
  14138. de.info("Version", "2.25.6-0-gd87e5b1"),
  14139. q.defaultMaxListeners = 1e3,
  14140. a(e),
  14141. s()
  14142. }
  14143. function o() {
  14144. return document.getElementById("player")
  14145. }
  14146. function a(e) {
  14147. e.addEventListener("dragenter", T, !1),
  14148. e.addEventListener("dragover", T, !1)
  14149. }
  14150. function s() {
  14151. F.valueFromHash("title", !0) || $(document).ready(function() {
  14152. var e = $(".model-title");
  14153. e.hide()
  14154. })
  14155. }
  14156. function l() {
  14157. return F.valueFromHash("play", !1) ? "autoplay" : F.inIframe() ? "click" : "fullpage"
  14158. }
  14159. function c() {
  14160. return {
  14161. panoElementsToLoad: 6,
  14162. modelElementsToLoad: 0,
  14163. totalElementsLoaded: 0,
  14164. totalElementsToLoad: 0,
  14165. totalPercentageLoaded: 0,
  14166. progressCallback: null
  14167. }
  14168. }
  14169. function h(e) {
  14170. return K.loadFeatureFlags(e).done(function(e) {
  14171. K.updateDependentSettings(e, V)
  14172. })
  14173. }
  14174. function u(e) {
  14175. return Q.get(e.urlBase + "/api/v1/config/showcase", {
  14176. responseType: "json",
  14177. prefetchFrom: "config"
  14178. }).then(function(e) {
  14179. return e ? void j.extendObject(V.appConfig, e) : {}
  14180. }, function(e) {
  14181. return de.warn("Failed loading runtime config, using defaults."),
  14182. $.when({})
  14183. })
  14184. }
  14185. function d(e, t) {
  14186. var i = B.getModel({
  14187. url: t,
  14188. floors: F.valueFromHash("f", !0),
  14189. autoload: !1
  14190. })
  14191. , n = u({
  14192. urlBase: e.urlBase
  14193. });
  14194. return $.when(i, n).then(null, function(e) {
  14195. return this
  14196. })
  14197. }
  14198. function p(e, t, i, n, r) {
  14199. de.info("Model data loaded"),
  14200. de.debug("UUID: " + e.data.job.uuid),
  14201. J.init(K.getFlags()),
  14202. i && H.initKeen({
  14203. token: i,
  14204. appId: n
  14205. }),
  14206. H.initSegment({
  14207. model: e.sid,
  14208. version: "2.25.6-0-gd87e5b1",
  14209. startSource: r.startSource,
  14210. token: t,
  14211. autoplay: r.autoplay,
  14212. quickstart: r.quickstart
  14213. })
  14214. }
  14215. function f(e, t, i, n, r) {
  14216. return r.progressCallback = t,
  14217. H.sessionStart(),
  14218. e.load(n).progress(g.bind(this, r))
  14219. }
  14220. function g(e, t) {
  14221. e.modelElementsToLoad = t[1],
  14222. v(e),
  14223. m(e)
  14224. }
  14225. function m(e) {
  14226. e.totalElementsLoaded++,
  14227. e.totalPercentageLoaded = e.totalElementsLoaded / e.totalElementsToLoad,
  14228. e.progressCallback && e.progressCallback(100 * e.totalPercentageLoaded)
  14229. }
  14230. function v(e) {
  14231. e.totalElementsToLoad = e.modelElementsToLoad + e.panoElementsToLoad
  14232. }
  14233. function A(e) {
  14234. var t = new x.PerspectiveCamera;
  14235. t.layers.enable(he.PANOMARKERS),
  14236. t.layers.enable(he.RETICULE),
  14237. t.layers.enable(he.TAG);
  14238. var i = new x.Scene
  14239. , n = new x.AmbientLight(16777215);
  14240. i.add(n),
  14241. i.skybox = new W,
  14242. i.add(i.skybox),
  14243. i.plane = new x.Mesh(new x.PlaneBufferGeometry(1e5,1e5),new x.RawShaderMaterial({
  14244. side: x.DoubleSide
  14245. })),
  14246. i.plane.position.y = 0,
  14247. i.plane.rotateX(-Math.PI / 2),
  14248. i.plane.material.visible = !1,
  14249. i.add(i.plane),
  14250. i.updateMatrixWorld(),
  14251. V.showScreenshotLocations && e.data.images.forEach(function(e) {
  14252. if (e.metadata && e.metadata.camera_position) {
  14253. var t = e.metadata.camera_position
  14254. , n = new x.Mesh(new x.BoxGeometry(.3,.3,.3));
  14255. n.position = t.clone(),
  14256. i.add(n);
  14257. var r = e.metadata.camera_quaternion
  14258. , o = new x.Vector3(0,0,-1).applyQuaternion(r);
  14259. i.add(new x.ArrowHelper(o,t.clone(),1,16711680))
  14260. }
  14261. }),
  14262. V.showAxis && (i.add(new x.ArrowHelper(new x.Vector3(0,1,0),new x.Vector3(0,0,0),1,255)),
  14263. i.add(new x.ArrowHelper(new x.Vector3(0,0,1),new x.Vector3(0,0,0),1,16711680)),
  14264. i.add(new x.ArrowHelper(new x.Vector3(1,0,0),new x.Vector3(0,0,0),1,65280)));
  14265. var r = new te(i,t,z);
  14266. return r
  14267. }
  14268. function y(e, t) {
  14269. var i = e ? 1 : 1e3
  14270. , n = J.tilegen || J.imgopt ? 6 : 2;
  14271. n = F.valueFromHash("tileconc", n);
  14272. var r = new ne
  14273. , o = new ae({
  14274. concurrentDownloads: n
  14275. })
  14276. , a = new se
  14277. , s = new P
  14278. , l = new M
  14279. , c = new S(t)
  14280. , h = new R
  14281. , u = new O(i)
  14282. , d = new L
  14283. , p = new oe;
  14284. return {
  14285. qualityManager: r,
  14286. panoRenderer: a,
  14287. tileDownloader: o,
  14288. player: c,
  14289. director: l,
  14290. modelManager: s,
  14291. tagManager: p,
  14292. displayController: u,
  14293. labelDisplayController: d,
  14294. controls: h
  14295. }
  14296. }
  14297. function C(e, t, i, n) {
  14298. var r = i.controls
  14299. , o = i.qualityManager
  14300. , a = i.panoRenderer
  14301. , s = i.tileDownloader
  14302. , l = i.modelManager;
  14303. r.init(n, l),
  14304. ee.init(i.director, r, i.player, l, t),
  14305. o.init(l),
  14306. s.init(o),
  14307. a.init(t, s, o),
  14308. l.init(s, a, o),
  14309. l.addModel(e),
  14310. t.addComponent(G)
  14311. }
  14312. function I(e, t, i, n) {
  14313. var r = i.qualityManager
  14314. , o = i.panoRenderer
  14315. , a = i.tileDownloader
  14316. , s = i.modelManager
  14317. , l = i.player
  14318. , c = i.director
  14319. , h = i.tagManager
  14320. , u = i.displayController
  14321. , d = i.labelDisplayController
  14322. , p = i.controls;
  14323. t.scene.add(e),
  14324. t.qualityManager = r;
  14325. var f = {
  14326. camera: t.camera,
  14327. director: c,
  14328. modelManager: s,
  14329. tileDownloader: a,
  14330. panoRenderer: o,
  14331. qualityManager: r,
  14332. tagManager: h,
  14333. container: n,
  14334. controls: p
  14335. };
  14336. l.init(f),
  14337. l.setScene(t.scene),
  14338. h.init(s, l),
  14339. c.init(l, s),
  14340. u.init(c, l, s, h, n),
  14341. d.init(l, s, n),
  14342. z.bindEvents(l),
  14343. t.addComponent(h),
  14344. t.addComponent(l),
  14345. t.addComponent(o)
  14346. l.sceneRenderer = t; //xzw add 方便resize
  14347. }
  14348. function E(e, t, i, n) {
  14349. return de.info("Starting player in " + i.mode),
  14350. H.report(t.sid, "started-playing", n, i.quickstart),
  14351. e.start(i)
  14352. }
  14353. function b(e, t) {
  14354. de.error(t),
  14355. k.error(t),
  14356. H.report(e, "error-" + t)
  14357. }
  14358. function w(e) {
  14359. var t = F.details();
  14360. t && "Safari" === t.name && t.version > 500 && t.version < 600 ? (k.error("webgl-safari"),
  14361. H.report(e, "error-webgl-safari")) : (k.error("webgl-generic"),
  14362. H.report(e, "error-webgl-generic"))
  14363. }
  14364. function _(e, t, i) {
  14365. try {
  14366. e.start(t)
  14367. } catch (e) {
  14368. throw de.warn(e.message),
  14369. w(i.sid),
  14370. e
  14371. }
  14372. }
  14373. function T(e) {
  14374. e.stopPropagation(),
  14375. e.preventDefault()
  14376. }
  14377. e("./lib/three75-shim"),
  14378. e("./lib/array-polyfill"),
  14379. e("./lib/performance-polyfill"),
  14380. e("./lib/shaders/CopyShader.js"),
  14381. e("./lib/shaders/HorizontalBlurShader.js"),
  14382. e("./lib/shaders/VerticalBlurShader.js"),
  14383. e("./lib/postprocessing/EffectComposer.js"),
  14384. e("./lib/postprocessing/RenderPass.js"),
  14385. e("./lib/postprocessing/MaskPass.js"),
  14386. e("./lib/postprocessing/ShaderPass.js"),
  14387. window.Promise || (window.Promise = e("promise-polyfill"));
  14388. var x = e("three")
  14389. , S = (e("./util/sentry"),
  14390. e("./player"))
  14391. , M = e("./director")
  14392. , R = e("./controls/CameraControls")
  14393. , P = e("./model/ModelManager")
  14394. , O = e("./DisplayController")
  14395. , L = e("./label/LabelDisplayController")
  14396. , D = e("./enum/Viewmode")
  14397. , N = e("./util/logger")
  14398. , B = e("./showcase")
  14399. , F = e("./util/browser")
  14400. , V = e("./settings")
  14401. , U = e("./gui/gui")
  14402. , k = e("./gui/error")
  14403. , H = e("./analytics")
  14404. , G = e("./util/transitions")
  14405. , z = e("./effects")
  14406. , W = e("./objects/Skybox")
  14407. , j = e("./util/common")
  14408. , Y = (e("./util/PanoramaCollection"),
  14409. e("./util/math"),
  14410. e("./util/showcase"))
  14411. , X = e("./util/camera")
  14412. , Z = (e("./objects/Panorama"),
  14413. e("./cameras/PanoramaCamera"),
  14414. e("./preloaders"))
  14415. , q = e("events").EventEmitter
  14416. , K = e("./featureflags")
  14417. , Q = (e("./util/lerp"),
  14418. e("./util/ajax"))
  14419. , J = e("./ab")
  14420. , ee = e("./sdk/automation.js")
  14421. , te = e("./scene/SceneRenderer")
  14422. , ie = e("./scene/QuickstartManager")
  14423. , ne = e("./tile/QualityManager.js")
  14424. , re = e("./localization/localize")
  14425. , oe = e("./tag/tagManager")
  14426. , ae = e("./tile/TileDownloader")
  14427. , se = e("./tile/PanoRenderer")
  14428. , le = (e("./enum/PanoSizeClass"),
  14429. e("./enum/PanoramaEvents"),
  14430. e("./enum/SceneRendererEvents"))
  14431. , ce = e("./gui/memoryUsage")
  14432. , he = e("./enum/RenderLayers")
  14433. , ue = e("./TimingData")
  14434. , de = new N(t);
  14435. N.level = V.logLevel,
  14436. N.consoleEnabled = V.console,
  14437. i()
  14438. }
  14439. ).call(this, "/js/main.js")
  14440. }
  14441. , {
  14442. "./DisplayController": 1,
  14443. "./TimingData": 2,
  14444. "./ab": 3,
  14445. "./analytics": 4,
  14446. "./cameras/PanoramaCamera": 7,
  14447. "./controls/CameraControls": 9,
  14448. "./director": 15,
  14449. "./effects": 16,
  14450. "./enum/PanoSizeClass": 36,
  14451. "./enum/PanoramaEvents": 37,
  14452. "./enum/RenderLayers": 41,
  14453. "./enum/SceneRendererEvents": 43,
  14454. "./enum/Viewmode": 51,
  14455. "./featureflags": 59,
  14456. "./gui/error": 64,
  14457. "./gui/gui": 65,
  14458. "./gui/memoryUsage": 73,
  14459. "./label/LabelDisplayController": 91,
  14460. "./lib/array-polyfill": 92,
  14461. "./lib/performance-polyfill": 95,
  14462. "./lib/postprocessing/EffectComposer.js": 96,
  14463. "./lib/postprocessing/MaskPass.js": 97,
  14464. "./lib/postprocessing/RenderPass.js": 98,
  14465. "./lib/postprocessing/ShaderPass.js": 99,
  14466. "./lib/shaders/CopyShader.js": 100,
  14467. "./lib/shaders/HorizontalBlurShader.js": 101,
  14468. "./lib/shaders/VerticalBlurShader.js": 102,
  14469. "./lib/three75-shim": 103,
  14470. "./localization/localize": 108,
  14471. "./tag/tagManager": 124,
  14472. "./model/ModelManager": 140,
  14473. "./objects/Panorama": 148,
  14474. "./objects/Skybox": 152,
  14475. "./player": 155,
  14476. "./preloaders": 156,
  14477. "./scene/QuickstartManager": 157,
  14478. "./scene/SceneRenderer": 158,
  14479. "./sdk/automation.js": 164,
  14480. "./settings": 166,
  14481. "./showcase": 168,
  14482. "./tile/PanoRenderer": 169,
  14483. "./tile/QualityManager.js": 170,
  14484. "./tile/TileDownloader": 171,
  14485. "./util/PanoramaCollection": 178,
  14486. "./util/ajax": 181,
  14487. "./util/browser": 182,
  14488. "./util/camera": 183,
  14489. "./util/common": 185,
  14490. "./util/lerp": 188,
  14491. "./util/logger": 189,
  14492. "./util/math": 190,
  14493. "./util/sentry": 192,
  14494. "./util/showcase": 193,
  14495. "./util/transitions": 195,
  14496. events: 202,
  14497. "promise-polyfill": 213,
  14498. three: 217
  14499. }],
  14500. 117: [function(e, t, i) {
  14501. "use strict";
  14502. function n(e) {
  14503. e = e || {},
  14504. r.RawShaderMaterial.call(this, a.extendObject({
  14505. fragmentShader: o.cube.fragmentShader,
  14506. vertexShader: o.cube.vertexShader,
  14507. uniforms: r.UniformsUtils.clone(o.cube.uniforms),
  14508. name: "CubemapMaterial"
  14509. }, e))
  14510. }
  14511. var r = e("three")
  14512. , o = e("../shaders")
  14513. , a = e("../util/common");
  14514. n.prototype = Object.create(r.RawShaderMaterial.prototype),
  14515. n.prototype.constructor = n,
  14516. t.exports = n
  14517. }
  14518. , {
  14519. "../shaders": 167,
  14520. "../util/common": 185,
  14521. three: 217
  14522. }],
  14523. 118: [function(e, t, i) {
  14524. "use strict";
  14525. function n(e) {
  14526. e = e || {},
  14527. r.RawShaderMaterial.call(this, a.extendObject({
  14528. fragmentShader: o.model.fragmentShader,
  14529. vertexShader: o.model.vertexShader,
  14530. uniforms: r.UniformsUtils.clone(o.model.uniforms),
  14531. name: "ModelTextureMaterial"
  14532. }, e))
  14533. }
  14534. var r = e("three")
  14535. , o = e("../shaders")
  14536. , a = e("../util/common");
  14537. n.prototype = Object.create(r.RawShaderMaterial.prototype),
  14538. n.prototype.constructor = n,
  14539. n.prototype.setProjectedPanos = function(e, t, i) {
  14540. i && (this.uniforms.progress.value = 0),
  14541. e.ensureSkyboxReadyForRender(),
  14542. this.uniforms.pano0Map.value = e.getSkyboxTexture(),
  14543. this.uniforms.pano0Position.value.copy(e.position),
  14544. this.uniforms.pano0Matrix.value.copy(e.skyboxMesh.matrixWorld),
  14545. t.ensureSkyboxReadyForRender(),
  14546. this.uniforms.pano1Map.value = t.getSkyboxTexture(),
  14547. this.uniforms.pano1Position.value.copy(t.position),
  14548. this.uniforms.pano1Matrix.value.copy(t.skyboxMesh.matrixWorld)
  14549. }
  14550. ,
  14551. t.exports = n
  14552. }
  14553. , {
  14554. "../shaders": 167,
  14555. "../util/common": 185,
  14556. three: 217
  14557. }],
  14558. 119: [function(e, t, i) {
  14559. (function(i) {
  14560. "use strict";
  14561. function n(e, t, i, n) {
  14562. this.div = null,
  14563. this.body = null,
  14564. this.label = e,
  14565. this.description = t,
  14566. this.parsedDescription = [],
  14567. this.media = i || {
  14568. type: null
  14569. },
  14570. this.loadingSpinner = null,
  14571. this.parser = new r({
  14572. supportLinks: !u.valueFromHash("mls"),
  14573. keepLinkLabels: !0
  14574. }),
  14575. this.state = I.CLOSED,
  14576. this.orientation = "",
  14577. this.initialTransform = "",
  14578. this.hovering = !1,
  14579. this.openTransition = null,
  14580. this.closeTransition = null,
  14581. this.openPromise = null,
  14582. this.closePromise = null,
  14583. this.animationTransition = null,
  14584. this.animationScale = 0
  14585. }
  14586. var r = e("../Parser/DescriptionParser")
  14587. , o = e("../Media/Link")
  14588. , a = e("../Media/Image")
  14589. , s = e("../Media/EmbedlyPlayer")
  14590. , l = e("../Media/EmbedlyEmbed")
  14591. , c = e("../../util/transitions")
  14592. , h = e("../../util/lerp")
  14593. , u = e("../../util/browser")
  14594. , d = e("./BillboardEvent")
  14595. , p = e("../Media/MediaEvent")
  14596. , f = e("../Parser/DescriptionChunkType")
  14597. , g = e("events").EventEmitter
  14598. , m = e("./billboardSettings")
  14599. , v = e("./overlaySettings")
  14600. , A = e("../../util/logger")
  14601. , y = new A(i)
  14602. , C = document.getElementById("tag-billboards");
  14603. C.addEventListener("touchend", function(e) {
  14604. C.style.pointerEvents = "none"
  14605. }),
  14606. C.addEventListener("touchcancel", function(e) {
  14607. C.style.pointerEvents = "none"
  14608. });
  14609. var I = {
  14610. CLOSED: "closed",
  14611. OPENING: "opening",
  14612. OPEN: "open",
  14613. CLOSING: "closing",
  14614. ACTIVE: "active"
  14615. };
  14616. n.prototype = Object.create(g.prototype),
  14617. n.prototype.build = function(e) {
  14618. this.parsedDescription = this.parser.parse(this.description);
  14619. var t = document.createElement("div");
  14620. t.className = "tag-container has-hotzone",
  14621. this.div = t,
  14622. this.body = document.createElement("div"),
  14623. this.body.className = "tag-body";
  14624. var i = document.createElement("div");
  14625. i.classList.add("tag-content");
  14626. var n = document.createElement("div");
  14627. n.classList.add("tag-text-content");
  14628. var r = document.createElement("div");
  14629. r.className = "tag-label",
  14630. r.textContent = this.label,
  14631. n.appendChild(r);
  14632. var o = document.createElement("div");
  14633. o.className = "tag-desc",
  14634. n.appendChild(o),
  14635. i.appendChild(n),
  14636. this.body.appendChild(i),
  14637. this.appendDescriptionElements(this.parsedDescription, o),
  14638. this.appendMedia(),
  14639. t.appendChild(this.body),
  14640. C.appendChild(t),
  14641. this.bindEvents(t, this.body)
  14642. }
  14643. ,
  14644. n.prototype.bindEvents = function(e, t) {
  14645. var i = function(e) {
  14646. return function(t) {
  14647. if (!this.div.classList.contains("overlay")) {
  14648. var i, n = document.getElementById("player");
  14649. try {
  14650. i = new MouseEvent(e,t)
  14651. } catch (n) {
  14652. i = document.createEvent("MouseEvents"),
  14653. i.initMouseEvent(e, 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)
  14654. }
  14655. n.dispatchEvent(i)
  14656. }
  14657. }
  14658. };
  14659. t.addEventListener("mousedown", function(e) {
  14660. e.stopPropagation()
  14661. }),
  14662. t.addEventListener("mouseup", function(e) {
  14663. e.stopPropagation()
  14664. }),
  14665. e.addEventListener("touchstart", function(e) {
  14666. C.style.pointerEvents = "auto"
  14667. }),
  14668. e.addEventListener("mousedown", i("mousedown").bind(this)),
  14669. e.addEventListener("mouseup", i("mouseup").bind(this)),
  14670. t.addEventListener("mouseover", function(t) {
  14671. this.state === I.OPEN && e.classList.remove("has-hotzone")
  14672. }
  14673. .bind(this)),
  14674. e.addEventListener("mouseenter", function(e) {
  14675. this.state !== I.CLOSING && (this.hovering = !0,
  14676. this.emit(d.ENTER))
  14677. }
  14678. .bind(this)),
  14679. e.addEventListener("mouseleave", function(e) {
  14680. this.hovering = !1,
  14681. this.emit(d.LEAVE)
  14682. }
  14683. .bind(this)),
  14684. e.addEventListener("gesturestart", function(e) {
  14685. e.preventDefault()
  14686. });
  14687. var n = e.querySelector(".tag-text-content")
  14688. , r = 0;
  14689. n.addEventListener("touchstart", function(e) {
  14690. r = e.changedTouches[0].clientY
  14691. }),
  14692. n.addEventListener("touchmove", function(t) {
  14693. function i(e) {
  14694. e && (0 === e.scrollTop && t.changedTouches[0].clientY > r || e.scrollTop + e.clientHeight - e.scrollHeight === 0 && t.changedTouches[0].clientY < r) && t.preventDefault()
  14695. }
  14696. return e.classList.contains("overlay") ? i(this.querySelector(".tag-desc")) : void i(this)
  14697. }),
  14698. e.addEventListener("touchmove", function(e) {
  14699. 0 === (n.compareDocumentPosition(e.target) & Node.DOCUMENT_POSITION_CONTAINED_BY) && e.preventDefault()
  14700. })
  14701. }
  14702. ,
  14703. n.prototype.appendDescriptionElements = function(e, t) {
  14704. e.length > 0 && this.div.classList.add("has-text"),
  14705. e.forEach(function(e, i) {
  14706. switch (e.type) {
  14707. case f.TEXT:
  14708. t.appendChild(this.createTextElement(e.text));
  14709. break;
  14710. case f.LINK:
  14711. t.appendChild(this.createLinkElement(e.link))
  14712. }
  14713. }
  14714. .bind(this))
  14715. }
  14716. ,
  14717. n.prototype.appendLoadingSpinner = function() {
  14718. this.loadingSpinner = document.createElement("div"),
  14719. this.loadingSpinner.classList.add("loading-spinner");
  14720. var e = document.createElement("div");
  14721. e.classList.add("gui-spinner-icon"),
  14722. this.loadingSpinner.appendChild(e),
  14723. this.body.appendChild(this.loadingSpinner)
  14724. }
  14725. ,
  14726. n.prototype.onMediaLoadFinished = function() {
  14727. this.loadingSpinner && (this.loadingSpinner.parentNode.removeChild(this.loadingSpinner),
  14728. this.applyOrientation(this.orientation),
  14729. this.loadingSpinner = null)
  14730. }
  14731. ,
  14732. n.prototype.appendMedia = function() {
  14733. if (this.media && this.media.type && "error" !== this.media.type && (!u.valueFromHash("mls", 0) || this.media.type === f.IMAGE)) {
  14734. this.appendLoadingSpinner();
  14735. var e = document.createElement("div");
  14736. e.classList.add("tag-media-content");
  14737. var t = document.createElement("i");
  14738. switch (["icon", "icon-close-thin", "close"].forEach(function(e) {
  14739. t.classList.add(e)
  14740. }),
  14741. this.body.appendChild(t),
  14742. this.body.appendChild(e),
  14743. this.media.type) {
  14744. case f.IMAGE:
  14745. e.appendChild(this.createImageElement(this.media, this.body));
  14746. break;
  14747. case f.VIDEO:
  14748. e.appendChild(this.createVideoElement(this.media, this.body));
  14749. break;
  14750. case f.RICH:
  14751. e.appendChild(this.createEmbedElement(this.media, this.body))
  14752. }
  14753. }
  14754. }
  14755. ,
  14756. n.prototype.createTextElement = function(e) {
  14757. var t = document.createElement("span");
  14758. return t.textContent = e,
  14759. t
  14760. }
  14761. ;
  14762. n.prototype.createLinkElement = function(e) {
  14763. var t = new o(e);
  14764. return t.on(p.LINK_CLICK, this.emit.bind(this, p.LINK_CLICK)),
  14765. t.createDomElement()
  14766. }
  14767. ,
  14768. n.prototype.createImageElement = function(e, t) {
  14769. function i() {
  14770. function e() {
  14771. m || (r.classList.remove("view-image"),
  14772. c.classList.add("overlay"),
  14773. i(),
  14774. window.addEventListener("resize", b),
  14775. c.addEventListener("click", a),
  14776. g.addEventListener("click", l),
  14777. f.addEventListener("click", s),
  14778. m = !0,
  14779. o.emit(p.IMAGE_OPENED))
  14780. }
  14781. function i() {
  14782. t.classList.add("show-info"),
  14783. h.classList.remove("collapsible"),
  14784. h.style.height = "";
  14785. var e = parseFloat(getComputedStyle(I).lineHeight)
  14786. , i = y + e
  14787. , r = c.clientWidth - 2 * v.boundaryWidth - C
  14788. , a = c.clientHeight - 2 * v.boundaryHeight - C - i
  14789. , s = a
  14790. , l = s * n.aspect;
  14791. l > r && (l = r,
  14792. s = l / n.aspect),
  14793. s > a && (s = a,
  14794. l = s * n.aspect),
  14795. l += C,
  14796. s += C + i,
  14797. t.style.width = l + "px",
  14798. t.style.height = s + "px",
  14799. u.style.paddingTop = e + C + "px",
  14800. o.description.length > 0 && (h.classList.add("collapsible"),
  14801. h.style.height = h.clientHeight + 12 + "px",
  14802. E.style.height = "calc(100% - " + I.clientHeight + "px)")
  14803. }
  14804. function a(e) {
  14805. e.target === c && s()
  14806. }
  14807. function s() {
  14808. m && (m = !1,
  14809. r.classList.add("view-image"),
  14810. c.classList.remove("overlay"),
  14811. h.style.height = "",
  14812. u.style.paddingTop = "",
  14813. t.style.width = "",
  14814. t.style.height = "",
  14815. window.removeEventListener("resize", b),
  14816. c.removeEventListener("click", a),
  14817. g.removeEventListener("click", l),
  14818. f.removeEventListener("click", s),
  14819. o.emit(p.IMAGE_CLOSED),
  14820. o.close(!0))
  14821. }
  14822. function l(e) {
  14823. t.classList.toggle("show-info")
  14824. }
  14825. var c = o.div
  14826. , h = c.getElementsByClassName("tag-content")[0]
  14827. , u = c.getElementsByClassName("tag-media-content")[0]
  14828. , f = t.getElementsByClassName("close")[0]
  14829. , g = h.getElementsByClassName("tag-label")[0];
  14830. c.classList.add("has-image"),
  14831. r.classList.add("view-image"),
  14832. c.classList.add(n.aspect >= 1 ? "image-landscape" : "image-portrait"),
  14833. o.applyOrientation(o.orientation);
  14834. var m = !1
  14835. , A = getComputedStyle(h)
  14836. , y = parseFloat(A.paddingTop) + parseFloat(A.paddingBottom)
  14837. , C = 2 * parseFloat(getComputedStyle(u).paddingLeft)
  14838. , I = h.querySelector(".tag-label")
  14839. , E = h.querySelector(".tag-desc")
  14840. , b = function() {
  14841. var e, t, n = 0;
  14842. return function() {
  14843. clearInterval(e),
  14844. clearTimeout(t),
  14845. e = setInterval(function() {
  14846. var e = c.clientHeight;
  14847. n !== e && (i(),
  14848. n = e)
  14849. }, 100),
  14850. t = setTimeout(clearInterval.bind(this, e), 1e3)
  14851. }
  14852. }();
  14853. n.on(p.IMAGE_OPENING, e),
  14854. o.on(d.ACTIVATE, e),
  14855. o.on(p.IMAGE_CLOSED, n.onClosed.bind(n)),
  14856. o.on(d.CLOSING, s)
  14857. }
  14858. var n = new a
  14859. , r = n.createDomElement();
  14860. this.once(d.OPENED, function() {
  14861. n.load(e.src).then(i).catch(function(t) {
  14862. y.warn("Failed to load image:", e.src),
  14863. y.warn("with error:", t)
  14864. }).then(this.onMediaLoadFinished.bind(this))
  14865. });
  14866. var o = this;
  14867. return r
  14868. }
  14869. ,
  14870. n.prototype.createVideoElement = function(e, t) {
  14871. var i = new s({
  14872. autoPlay: !0,
  14873. autoResume: !0,
  14874. startMuted: !1,
  14875. loop: !1
  14876. })
  14877. , n = i.createDomElement();
  14878. return this.once(d.OPENED, function() {
  14879. i.load(e.src).then(function() {
  14880. this.div.classList.add("has-video"),
  14881. this.state !== I.OPEN && this.state !== I.ACTIVE || (i.show(),
  14882. i.play()),
  14883. this.on(d.OPENING, i.show.bind(i)),
  14884. this.on(d.OPENED, i.play.bind(i)),
  14885. this.on(d.CLOSING, i.pause.bind(i)),
  14886. this.on(d.CLOSED, i.hide.bind(i))
  14887. }
  14888. .bind(this)).catch(function(t) {
  14889. y.warn("Failed to embed video:", e.src),
  14890. y.warn("with error:", t)
  14891. }).then(this.onMediaLoadFinished.bind(this))
  14892. }
  14893. .bind(this)),
  14894. n
  14895. }
  14896. ,
  14897. n.prototype.createEmbedElement = function(e, t) {
  14898. var i = new l
  14899. , n = i.createDomElement();
  14900. return this.once(d.OPENED, function() {
  14901. i.load(e.src).then(function() {
  14902. this.div.classList.add("has-embed"),
  14903. this.state !== I.OPEN && this.state !== I.ACTIVE || i.show(),
  14904. this.applyOrientation(this.orientation),
  14905. this.on(d.OPENING, i.show.bind(i)),
  14906. this.on(d.CLOSED, i.hide.bind(i))
  14907. }
  14908. .bind(this)).catch(function(t) {
  14909. y.warn("Failed to embed:", e.src),
  14910. y.warn("with error:", t)
  14911. }).then(this.onMediaLoadFinished.bind(this))
  14912. }
  14913. .bind(this)),
  14914. n
  14915. }
  14916. ,
  14917. n.prototype.open = function(e) {
  14918. return this.openPromise = $.Deferred(),
  14919. this.state === I.ACTIVE ? this.openPromise.resolve().promise() : (this.hovering || this.div.classList.add("has-hotzone"),
  14920. this.openTransition ? e && this.setActiveState() : this.openTransition = c.setTimeout(function() {
  14921. this.state !== I.OPEN && (this.emit(d.OPENING),
  14922. e && this.emit(d.ACTIVATING),
  14923. this.state = I.OPENING,
  14924. this.animateOpen(function() {
  14925. e && this.setActiveState(),
  14926. this.openPromise.resolve()
  14927. }
  14928. .bind(this)))
  14929. }
  14930. .bind(this), m.animation.openDelay),
  14931. c.cancel(this.closeTransition),
  14932. this.closePromise && this.closePromise.reject(),
  14933. this.closeTransition = void 0,
  14934. this.openPromise.promise())
  14935. }
  14936. ,
  14937. n.prototype.close = function(e) {
  14938. return this.closePromise = $.Deferred(),
  14939. !e && this.hovering ? this.closePromise.reject().promise() : (this.closeTransition || (this.closeTransition = c.setTimeout(function() {
  14940. this.state !== I.CLOSED && (this.emit(d.CLOSING),
  14941. this.state = I.CLOSING,
  14942. this.animateClose())
  14943. }
  14944. .bind(this), m.animation.closeDelay)),
  14945. c.cancel(this.openTransition),
  14946. this.openPromise && this.openPromise.reject(),
  14947. this.openTransition = void 0,
  14948. this.closePromise.resolve(),
  14949. this.closePromise.promise())
  14950. }
  14951. ,
  14952. n.prototype.setActiveState = function() {
  14953. this.state !== I.CLOSED && (this.state = I.ACTIVE,
  14954. this.emit(d.ACTIVATE),
  14955. this.div.classList.remove("has-hotzone"))
  14956. }
  14957. ,
  14958. n.prototype.animateOpen = function(e) {
  14959. if (this.state === I.OPENING) {
  14960. if (c.cancel(this.animationTransition),
  14961. u.detectSamsungNative())
  14962. return this.boardOrientation = null,
  14963. this.div.style.visibility = "visible",
  14964. this.emit(d.OPENED),
  14965. this.state = I.OPEN,
  14966. void (e && e());
  14967. this.div.style.webkitTransform = "scale(0)",
  14968. this.div.style.transform = "scale(0)",
  14969. this.div.style.visibility = "visible",
  14970. this.animationTransition = c.start(h.property(this, "animationScale", 1), m.animation.openDuration, function() {
  14971. this.emit(d.OPENED),
  14972. this.state = I.OPEN,
  14973. e && e()
  14974. }
  14975. .bind(this))
  14976. }
  14977. }
  14978. ,
  14979. n.prototype.animateClose = function(e) {
  14980. this.state === I.CLOSING && (c.cancel(this.animationTransition),
  14981. this.animationTransition = c.start(h.property(this, "animationScale", 0), m.animation.closeDuration, function() {
  14982. this.emit(d.CLOSED),
  14983. this.state = I.CLOSED,
  14984. this.div.style.visibility = "hidden",
  14985. this.div.classList.contains("has-hotzone") || this.div.classList.add("has-hotzone"),
  14986. e && e()
  14987. }
  14988. .bind(this)))
  14989. }
  14990. ,
  14991. n.prototype.needsUpdate = function() {
  14992. return this.state !== I.CLOSED
  14993. }
  14994. ,
  14995. n.prototype.update = function(e, t) {
  14996. if (this.needsUpdate()) {
  14997. var i = (this.updateOrientation(e),
  14998. this.calcScale(t))
  14999. , n = {
  15000. x: (e.x + 1) * $("#player").width() / 2,
  15001. y: (e.y + 1) * $("#player").height() / 2
  15002. };
  15003. this.div.screenTransform = this.initialTransform + " translate(" + n.x + "px, " + n.y + "px) scale(" + i * this.animationScale + ")",
  15004. this.div.style.webkitTransform = this.div.screenTransform,
  15005. this.div.style.transform = this.div.screenTransform
  15006. }
  15007. }
  15008. ,
  15009. n.prototype.getDimensions = function() {
  15010. return this.div.getBoundingClientRect()
  15011. }
  15012. ,
  15013. n.prototype.calcScale = function(e) {
  15014. return Math.sqrt(e / 40) * m.boardToDiscRatio
  15015. }
  15016. ,
  15017. n.prototype.updateOrientation = function(e) {
  15018. if (this.state !== I.ACTIVE) {
  15019. var t = 1 / 3
  15020. , i = e.y < -t ? 0 : e.y < t ? 1 : 2
  15021. , n = e.x < -t ? 0 : e.x < t ? 1 : 2
  15022. , r = "";
  15023. r += 0 === n ? "right" : 2 === n ? "left" : "",
  15024. r += 0 === i ? "-down" : 2 === i ? "-up" : "",
  15025. 1 === n && (r = 0 === i ? "bottom" : 2 === i ? "top" : "",
  15026. 1 === i && (r = $("#player").width() > $("#player").height() ? e.x < 0 ? "right" : "left" : e.y < 0 ? "bottom" : "top")),
  15027. 1 === n && 1 === i && r === this.orientation || this.applyOrientation(r)
  15028. }
  15029. }
  15030. ,
  15031. n.prototype.applyOrientation = function(e) {
  15032. this.div.style.transform = this.div.style.webkitTransform = "",
  15033. this.div.classList.remove("tag-container-" + this.orientation),
  15034. this.div.classList.add("tag-container-" + e);
  15035. var t = window.getComputedStyle(this.div);
  15036. this.initialTransform = t.transform || t.webkitTransform,
  15037. "none" === this.initialTransform && (this.initialTransform = "");
  15038. var i = t.transform.slice(7, -1).split(",")
  15039. , n = -i[4]
  15040. , r = -i[5];
  15041. this.div.style.webkitTransformOrigin = n + "px " + r + "px",
  15042. this.div.style.transformOrigin = n + "px " + r + "px",
  15043. this.orientation = e
  15044. }
  15045. ,
  15046. t.exports = n
  15047. }
  15048. ).call(this, "/js/tag/Billboard/Billboard.js")
  15049. }
  15050. , {
  15051. "../../util/browser": 182,
  15052. "../../util/lerp": 188,
  15053. "../../util/logger": 189,
  15054. "../../util/transitions": 195,
  15055. "../Media/EmbedlyEmbed": 125,
  15056. "../Media/EmbedlyPlayer": 126,
  15057. "../Media/Image": 128,
  15058. "../Media/Link": 129,
  15059. "../Media/MediaEvent": 131,
  15060. "../Parser/DescriptionChunkType": 133,
  15061. "../Parser/DescriptionParser": 134,
  15062. "./BillboardEvent": 120,
  15063. "./billboardSettings": 121,
  15064. "./overlaySettings": 122,
  15065. events: 202
  15066. }],
  15067. 120: [function(e, t, i) {
  15068. "use strict";
  15069. t.exports = Object.freeze({
  15070. ENTER: "billboard.enter",
  15071. LEAVE: "billboard.leave",
  15072. OPENING: "billboard.opening",
  15073. OPENED: "billboard.open",
  15074. CLOSING: "billboard.closing",
  15075. CLOSED: "billboard.closed",
  15076. ACTIVATING: "billboard.activating",
  15077. ACTIVATE: "billboard.activate"
  15078. })
  15079. }
  15080. , {}],
  15081. 121: [function(e, t, i) {
  15082. "use strict";
  15083. t.exports = Object.freeze({
  15084. animation: Object.freeze({
  15085. hoverOnClosing: !1,
  15086. openDelay: 100,
  15087. closeDelay: 50,
  15088. openDuration: 200,
  15089. closeDuration: 100
  15090. }),
  15091. boardToDiscRatio: 1.2
  15092. })
  15093. }
  15094. , {}],
  15095. 122: [function(e, t, i) {
  15096. "use strict";
  15097. t.exports = Object.freeze({
  15098. boundaryWidth: 30,
  15099. boundaryHeight: 0
  15100. })
  15101. }
  15102. , {}],
  15103. "hot": [function(e, t, i) {//热点
  15104. "use strict";
  15105. function hot(sid,d,model){
  15106. this.sid = sid;
  15107. this.position = d.position;
  15108. this.rotation = d.rotation;
  15109. this.link = d.link;
  15110. this.model = model;
  15111. this.size = d.size;
  15112. this.build();
  15113. }
  15114. var r = e("three")
  15115. , f = e("../shaders")
  15116. , a = e("../settings")
  15117. , s = e("../enum/Viewmode")
  15118. , p = e("../objects/Panorama")
  15119. , te = e("../util/texture")
  15120. var raycaster = new r.Raycaster;
  15121. var geometry = new r.PlaneBufferGeometry( 0.13, 0.13,1,1);
  15122. var shaderMaterial = new r.ShaderMaterial( {
  15123. uniforms: f.hot.uniforms,
  15124. vertexShader: f.hot.vertexShader,
  15125. fragmentShader: f.hot.fragmentShader
  15126. });
  15127. shaderMaterial.transparent = true;
  15128. f.hot.uniforms.texture1.value = te.load("images/point2.png");
  15129. f.hot.uniforms.texture2.value = te.load("images/point2_light.png");
  15130. hot.prototype.build = function(){
  15131. var sprite = new r.Mesh( geometry, shaderMaterial );
  15132. sprite.dynamic = true;
  15133. sprite.position.copy(new r.Vector3().fromArray(this.position));
  15134. sprite.rotation.copy(new r.Euler().fromArray(this.rotation));
  15135. this.size && sprite.scale.set(this.size,this.size,this.size);
  15136. sprite.name = this.sid;
  15137. sprite.type = "hotSprite";
  15138. sprite.belongHot = this;
  15139. if(this.link) sprite.hotLink = this.link;
  15140. this.mesh = sprite;
  15141. this.model.add(sprite);
  15142. }
  15143. hot.prototype.closestPanoTowardTag = function(e, t) {
  15144. var i = []
  15145. , o = []
  15146. , l = this.mesh.position;
  15147. if (e === s.PANORAMA) {
  15148. var c = .5
  15149. , h = t.position.clone().sub(l).normalize();
  15150. i.push(p.filters.isPanoAligned()),
  15151. i.push(p.filters.inPanoDirection(l, h, c)),
  15152. i.push(p.filters.isNeighbourPanoTo(t)),
  15153. o.push(p.scoreFunctions.direction(l, h))
  15154. }
  15155. var u = new r.Vector3
  15156. , d = function(e) {
  15157. u.copy(l).sub(e.position);
  15158. var t = -r.Math.radToDeg(Math.atan(u.y / Math.sqrt(u.x * u.x + u.z * u.z)))
  15159. , i = a.tags.navigate.tiltTolerance;
  15160. return a.insideLookLimitDown - i < t && t < a.insideLookLimitUp + i
  15161. }
  15162. , f = function(e) {
  15163. return Math.abs(e.position.x - l.x) > a.tags.visibility.cameraClearance || Math.abs(e.position.z - l.z) > a.tags.visibility.cameraClearance
  15164. };
  15165. i.push(f, d),
  15166. o.push(p.scoreFunctions.distanceSquared(this.mesh, -2));
  15167. var g = t.model.panos.sortByScore(i, o);
  15168. if (g && a.tags.navigate.lineOfSight) {
  15169. for (var m = 0; m < g.length; m++) {
  15170. var v = g[m].pano
  15171. , A = v.position.distanceTo(l);
  15172. raycaster.set(v.position, l.clone().sub(v.position).normalize());
  15173. var y = raycaster.intersectObjects(t.model.colliders);
  15174. if (0 === y.length || y[0].distance > A)
  15175. return v
  15176. }
  15177. return null
  15178. }
  15179. return g && g.length > 0 && g[0].pano
  15180. },
  15181. hot.prototype.examine = function(e) {
  15182. var hotPop = document.getElementById('popup');
  15183. if(this.link){
  15184. g_currentHot = this;
  15185. hotPop.style.display = "block";
  15186. hotPop.classList.add("wait");
  15187. var myElement = document.createElement("iframe");
  15188. myElement.src = this.link;
  15189. myElement.id = "id1";
  15190. myElement.allowTransparency = "true";
  15191. myElement.style.width = "100%";
  15192. myElement.style.height = "100%";
  15193. myElement.scrolling = "no";
  15194. var element=document.getElementById("id1"); //??
  15195. if (typeof(element)== "undefined" || element == null){
  15196. document.getElementById("popup").appendChild(myElement);
  15197. }
  15198. setTimeout(function(){$('#player').on("click",e.closePopup);},20)
  15199. }
  15200. var t = e.mode
  15201. , i = a.tags.navigate.nearestPano && this.closestPanoTowardTag(t, e.currentPano) || e.currentPano
  15202. , n = this.mesh.position;
  15203. e.flyingToTag = true;
  15204. var o = function() {
  15205. e.flyingToTag = false;
  15206. if(this.link){
  15207. hotPop.classList.remove("wait");
  15208. }
  15209. }.bind(this);
  15210. if (t === s.PANORAMA){
  15211. var l = {
  15212. pano: i,
  15213. lookAtPoint: n,
  15214. duration: null,
  15215. maxDistanceOverride: null,
  15216. skipWarpingCheck: !1
  15217. };
  15218. e.flyToPano(l, o)
  15219. }else {
  15220. var c = {
  15221. pano: i
  15222. };
  15223. if (n) {
  15224. var h = (new r.Matrix4).lookAt(i.position, n, new r.Vector3(0,1,0));
  15225. c.quaternion = (new r.Quaternion).setFromRotationMatrix(h)
  15226. }
  15227. c.callback = o,
  15228. c.duration = 1500,
  15229. c.mode = s.PANORAMA,
  15230. e.flyToNewMode(c)
  15231. }
  15232. },
  15233. t.exports = hot;
  15234. }
  15235. , {
  15236. three: 217,
  15237. "../shaders":167,
  15238. "../enum/Viewmode":51,
  15239. "../objects/Panorama":148,
  15240. "../util/texture":194,
  15241. "../settings":166
  15242. }],
  15243. 123: [function(e, t, i) {//tag
  15244. (function(i) {
  15245. "use strict";
  15246. function n(e, t, i) {
  15247. var n = i.version || "0";
  15248. "0" !== n && I.info("tag defined using version " + n),
  15249. this.model = e,
  15250. this.sid = t,
  15251. this.color = (new r.Color).set(i.color || l.tagDefault),
  15252. this.hoverColor = l._darken(this.color, .2),
  15253. this.floor = null,
  15254. this.floorIndex = i.floor,
  15255. this.mode = s.PANORAMA,
  15256. i.preferred_camera && i.preferred_camera.mode && (this.mode = i.preferred_camera.mode),
  15257. this.obj3d = null,
  15258. this.disc = null,
  15259. this.materials = {
  15260. disc: null,
  15261. pole: null
  15262. },
  15263. this.position = (new r.Vector3).copy(i.position),
  15264. this.discPosition = (new r.Vector3).copy(i.stem.direction),
  15265. this.discWorldPosition = null,
  15266. this.discScale = .05,
  15267. this.poleEnabled = i.stem.enabled,
  15268. this.billboard = new o(i.label,i.description,i.media,this),
  15269. this.visibleTransition = null,
  15270. this.hoveringDisc = !1
  15271. }
  15272. var r = e("three")
  15273. , o = e("./Billboard/Billboard")
  15274. , a = e("../settings")
  15275. , s = e("../enum/Viewmode")
  15276. , l = e("../enum/Colors")
  15277. , c = e("../enum/RenderLayers")
  15278. , h = e("../enum/RenderOrder")
  15279. , u = (e("../util/common"),
  15280. e("../util/math"))
  15281. , d = e("../util/texture")
  15282. , p = e("../objects/Panorama")
  15283. , f = e("../shaders")
  15284. , g = e("../util/transitions")
  15285. , m = e("../util/lerp")
  15286. , v = e("../util/easing")
  15287. , A = e("./Billboard/BillboardEvent")
  15288. , y = e("events").EventEmitter
  15289. , C = e("../util/logger")
  15290. , I = new C(i)
  15291. , E = d.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==")
  15292. , b = d.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")
  15293. , w = new r.PlaneBufferGeometry(1,1);
  15294. n.prototype = Object.create(y.prototype),
  15295. n.raycaster = new r.Raycaster,
  15296. n.prototype.bindEvents = function() {
  15297. this.billboard.on(A.ENTER, this.setHoverState.bind(this)),
  15298. this.billboard.on(A.LEAVE, this.setFreeState.bind(this))
  15299. }
  15300. ,
  15301. n.prototype.build = function() {
  15302. return this.floor = this.model.floors.get(this.floorIndex) || this.model.floors.first(),
  15303. this.floor && (this.billboard.build(this.model.sid),
  15304. this.obj3d = this.buildObject3D(),
  15305. this.floor.add(this.obj3d)),
  15306. this
  15307. }
  15308. ,
  15309. n.prototype.buildObject3D = function() {
  15310. var e = new r.Object3D;
  15311. e.position.copy(this.position);
  15312. var t = r.UniformsUtils.clone(f.tagDisc.uniforms);
  15313. t.bg.value = b,
  15314. t.mask.value = E,
  15315. t.color.value.copy(this.color),
  15316. this.materials.disc = new r.RawShaderMaterial({
  15317. transparent: !0,
  15318. vertexShader: f.tagDisc.vertexShader,
  15319. fragmentShader: f.tagDisc.fragmentShader,
  15320. uniforms: t
  15321. }),
  15322. this.disc = new r.Mesh(w,this.materials.disc),
  15323. this.disc.layers.set(c.TAG),
  15324. this.disc.position.copy(this.discPosition),
  15325. this.disc.renderOrder = h.tagDisc,
  15326. this.disc.tag = this;
  15327. var i = this.buildPole();
  15328. return i.layers.set(c.TAG),
  15329. i.renderOrder = h.tagStem,
  15330. e.add(i),
  15331. e.layers.set(c.TAG),
  15332. e.add(this.disc)
  15333. }
  15334. ,
  15335. n.prototype.buildPole = function() {
  15336. var e = new r.BufferGeometry
  15337. , t = new Float32Array(6);
  15338. return t[0] = t[1] = t[2] = 0,
  15339. t[3] = this.discPosition.x,
  15340. t[4] = this.discPosition.y,
  15341. t[5] = this.discPosition.z,
  15342. e.addAttribute("position", new r.BufferAttribute(t,3)),
  15343. this.materials.pole = new r.LineBasicMaterial({
  15344. linewidth: a.tags.pole.width,
  15345. color: a.tags.pole.color,
  15346. opacity: 0,
  15347. visible: this.poleEnabled,
  15348. transparent: !0,
  15349. depthWrite: !1
  15350. }),
  15351. new r.Line(e,this.materials.pole)
  15352. }
  15353. ,
  15354. n.prototype.setFreeState = function(e) {
  15355. !e && this.hoveringDisc || this.billboard.close(e).then(function() {
  15356. this.materials.disc.uniforms.color.value = this.color
  15357. }
  15358. .bind(this))
  15359. }
  15360. ,
  15361. n.prototype.setHoverState = function(e) {
  15362. this.billboard.open(e),
  15363. this.materials.disc.uniforms.color.value = this.hoverColor
  15364. }
  15365. ,
  15366. n.prototype.hide = function(e, t) {
  15367. var i = $.Deferred();
  15368. if (0 === this.materials.disc.uniforms.opacity.value && !g.isRunning(this.visibleTransition))
  15369. return i.resolve().promise();
  15370. e = e || 0,
  15371. t = t || 0,
  15372. g.cancel(this.visibleTransition);
  15373. var n = this.materials.disc.uniforms.opacity.value / a.tags.disc.opacity
  15374. , r = t + e
  15375. , o = t / r;
  15376. return this.visibleTransition = g.start(function(e) {
  15377. var t = m.property(e.materials.disc.uniforms.opacity, "value", 0)
  15378. , i = m.property(e.materials.pole, "opacity", 0);
  15379. return function(n) {
  15380. t(n),
  15381. e.materials.pole && i(n)
  15382. }
  15383. }(this), r * n, function() {
  15384. i.resolve()
  15385. }, o, v[a.warp.blendEasing]),
  15386. i.promise()
  15387. }
  15388. ,
  15389. n.prototype.show = function(e, t) {
  15390. var i = $.Deferred();
  15391. if (this.materials.disc.uniforms.opacity.value === a.tags.disc.opacity && !g.isRunning(this.visibleTransition))
  15392. return i.resolve().promise();
  15393. e = e || 0,
  15394. t = t || 0,
  15395. g.cancel(this.visibleTransition);
  15396. var n = (a.tags.disc.opacity - this.materials.disc.uniforms.opacity.value) / a.tags.disc.opacity
  15397. , r = t + e
  15398. , o = t / r;
  15399. return this.visibleTransition = g.start(function(e) {
  15400. var t = m.property(e.materials.disc.uniforms.opacity, "value", a.tags.disc.opacity)
  15401. , i = m.property(e.materials.pole, "opacity", a.tags.pole.opacity);
  15402. return function(n) {
  15403. t(n),
  15404. e.materials.pole && i(n)
  15405. }
  15406. }(this), r * n, function() {
  15407. i.resolve()
  15408. }, o, v[a.warp.blendEasing]),
  15409. i.promise()
  15410. }
  15411. ,
  15412. n.prototype.closestPanoTowardTag = function(e, t) {
  15413. var i = []
  15414. , o = []
  15415. , l = this.disc.getWorldPosition();
  15416. if (e === s.PANORAMA) {
  15417. var c = .5
  15418. , h = t.position.clone().sub(l).normalize();
  15419. i.push(p.filters.isPanoAligned()),
  15420. i.push(p.filters.inPanoDirection(l, h, c)),
  15421. i.push(p.filters.isNeighbourPanoTo(t)),
  15422. o.push(p.scoreFunctions.direction(l, h))
  15423. }
  15424. var u = new r.Vector3
  15425. , d = function(e) {
  15426. u.copy(l).sub(e.position);
  15427. var t = -r.Math.radToDeg(Math.atan(u.y / Math.sqrt(u.x * u.x + u.z * u.z)))
  15428. , i = a.tags.navigate.tiltTolerance;
  15429. return a.insideLookLimitDown - i < t && t < a.insideLookLimitUp + i
  15430. }
  15431. , f = function(e) {
  15432. return Math.abs(e.position.x - l.x) > a.tags.visibility.cameraClearance || Math.abs(e.position.z - l.z) > a.tags.visibility.cameraClearance
  15433. };
  15434. i.push(f, d),
  15435. o.push(p.scoreFunctions.distanceSquared(this, -2));
  15436. var g = this.model.panos.sortByScore(i, o);
  15437. if (a.tags.navigate.lineOfSight) {
  15438. for (var m = 0; m < g.length; m++) {
  15439. var v = g[m].pano
  15440. , A = v.position.distanceTo(l);
  15441. if (!a.tags.visibility.anyDistance && A > a.tags.visibility.visibleDistance)
  15442. return null;
  15443. n.raycaster.set(v.position, l.clone().sub(v.position).normalize());
  15444. var y = n.raycaster.intersectObjects(this.model.colliders);
  15445. if (0 === y.length || y[0].distance > A)
  15446. return v
  15447. }
  15448. return null
  15449. }
  15450. return g.length > 0 && g[0].pano
  15451. }
  15452. ,
  15453. n.prototype.examine = function(e) {
  15454. var t = e.mode
  15455. , i = a.tags.navigate.nearestPano && this.closestPanoTowardTag(t, e.currentPano) || e.currentPano
  15456. , n = this.disc.getWorldPosition();
  15457. this.billboard.setActiveState();
  15458. var o = function() {
  15459. var t = this.billboard.getDimensions()
  15460. , n = new r.Vector3;
  15461. u.convertScreenPositionToNDC(t.left + t.width / 2, t.top + t.height / 2, n),
  15462. n.unproject(e.camera),
  15463. e.flyToPano({
  15464. pano: i,
  15465. lookAtPoint: n
  15466. })
  15467. }
  15468. .bind(this);
  15469. if (t === s.PANORAMA)
  15470. if (i !== e.currentPano) {
  15471. var l = {
  15472. pano: i,
  15473. lookAtPoint: n,
  15474. duration: null,
  15475. maxDistanceOverride: null,
  15476. skipWarpingCheck: !1
  15477. };
  15478. e.flyToPano(l, o)
  15479. } else
  15480. setTimeout(function() {
  15481. this.billboard.open().then(function() {
  15482. o()
  15483. })
  15484. }
  15485. .bind(this), 0);
  15486. else {
  15487. var c = {
  15488. pano: i
  15489. };
  15490. if (n) {
  15491. var h = (new r.Matrix4).lookAt(i.position, n, new r.Vector3(0,1,0));
  15492. c.quaternion = (new r.Quaternion).setFromRotationMatrix(h)
  15493. }
  15494. c.callback = o,
  15495. c.duration = 1500,
  15496. c.mode = s.PANORAMA,
  15497. e.flyToNewMode(c)
  15498. }
  15499. }
  15500. ,
  15501. n.prototype.update = function(e, t) {
  15502. var i = new r.Vector3;
  15503. return function(e, t) {
  15504. this.discWorldPosition = this.disc.getWorldPosition(),
  15505. this.updateDisc(e, t),
  15506. this.billboard.needsUpdate() && (i.copy(this.discWorldPosition).project(t),
  15507. i.z < 1 && (i.y *= -1,
  15508. this.billboard.update(i, this.getDiscRadius(i, t))))
  15509. }
  15510. }(),
  15511. n.prototype.updateDisc = function(e, t) {
  15512. var i = new r.Vector3
  15513. , o = new r.Vector3
  15514. , l = new r.Vector3
  15515. , c = new r.Vector3
  15516. , h = new r.Vector3;
  15517. return function(e, t) {
  15518. var u = a.tags.visibility
  15519. , d = a.tags.disc.scale
  15520. , p = e === s.DOLLHOUSE || e === s.FLOORPLAN ? a.tags.visibility.visibleDistance : t.position.distanceTo(this.discWorldPosition);
  15521. if (this.obj3d.visible = 0 !== this.disc.material.opacity && (u.anyDistance || p <= u.visibleDistance || e === s.TRANSITIONING) && (!u.hideViaFloor || this.tagVisibleOnCurrentFloor(e)) && (!u.hideOffScreenDisc || !this.offScreen(this.disc, t)) && (!u.hideOffScreenObject || !this.offScreen(this.obj3d, t)),
  15522. this.obj3d.visible) {
  15523. this.disc.quaternion.copy(t.quaternion);
  15524. var f = d.maxSize - (d.maxSize - d.minSize) * r.Math.smoothstep(p, d.nearBound, d.farBound);
  15525. i.copy(this.discWorldPosition).project(t),
  15526. o.set($("#player").width() / 2, $("#player").height() / 2, 1).multiply(i),
  15527. l.set(f / 2, 0, 0).add(o),
  15528. c.set(2 / $("#player").width(), 2 / $("#player").height(), 1).multiply(l),
  15529. h.copy(c).unproject(t);
  15530. var g = h.distanceTo(this.discWorldPosition)
  15531. , m = 1 + a.tags.disc.scale.responsiveness / 100 * (n.viewportScale() - 1);
  15532. this.discScale = g * m,
  15533. this.disc.scale.set(this.discScale, this.discScale, this.discScale)
  15534. }
  15535. }
  15536. }(),
  15537. n.prototype.getDiscRadius = function(e, t) {
  15538. var i = new r.Vector3;
  15539. return function(e, t) {
  15540. return i.set(-this.discScale / 2, 0, 0).applyQuaternion(t.quaternion).add(this.discWorldPosition).project(t),
  15541. Math.abs(e.x - i.x) * $("#player").width()
  15542. }
  15543. }(),
  15544. n.prototype.tagVisibleOnCurrentFloor = function(e) {
  15545. return !(e === s.DOLLHOUSE || e === s.FLOORPLAN) || this.model.allFloorsVisible || !this.floor.hidden
  15546. }
  15547. ,
  15548. n.prototype.offScreen = function(e, t) {
  15549. var i = e.getWorldPosition().project(t);
  15550. return !(-1 < i.x && i.x < 1 && -1 < i.y && i.y < 1)
  15551. }
  15552. ,
  15553. n.viewportScale = function() {
  15554. return n.viewportWidth === $("#player").width() && n.viewportHeight === $("#player").height() || (n.viewportWidth = $("#player").width(),
  15555. n.viewportHeight = $("#player").height(),
  15556. n.currentViewportScale = Math.sqrt(Math.min(n.viewportWidth, n.viewportHeight) / a.tags.disc.scale.baseViewportSize)),
  15557. n.currentViewportScale
  15558. }
  15559. ,
  15560. t.exports = n
  15561. }
  15562. ).call(this, "/js/tag/tag.js")
  15563. }
  15564. , {
  15565. "../enum/Colors": 19,
  15566. "../enum/RenderLayers": 41,
  15567. "../enum/RenderOrder": 42,
  15568. "../enum/Viewmode": 51,
  15569. "../objects/Panorama": 148,
  15570. "../settings": 166,
  15571. "../shaders": 167,
  15572. "../util/common": 185,
  15573. "../util/easing": 186,
  15574. "../util/lerp": 188,
  15575. "../util/logger": 189,
  15576. "../util/math": 190,
  15577. "../util/texture": 194,
  15578. "../util/transitions": 195,
  15579. "./Billboard/Billboard": 119,
  15580. "./Billboard/BillboardEvent": 120,
  15581. events: 202,
  15582. three: 217
  15583. }],
  15584. 124: [function(e, t, i) {
  15585. (function(i) {
  15586. "use strict";
  15587. function n() {
  15588. this.tagState = y.IDLE,
  15589. this.intersectTag = null,
  15590. this.hoveredTag = null,
  15591. this.activeTag = null,
  15592. this.tagDiscs = [],
  15593. this.raycaster = new r.Raycaster,
  15594. this.modelManager = null,
  15595. this.player = null,
  15596. this.totaltags = 0,
  15597. this.navigatingViaTag = !1,
  15598. this.enabled = !1
  15599. }
  15600. var r = e("three")
  15601. , o = e("../util/logger")
  15602. , a = e("../util/common")
  15603. , s = e("../controls/serializer")
  15604. , l = e("../objects/Snapshot")
  15605. , c = e("../settings")
  15606. , h = e("./Billboard/BillboardEvent")
  15607. , u = e("./Media/MediaEvent")
  15608. , d = e("./Media/LinkType")
  15609. , p = e("../enum/Viewmode")
  15610. , f = e("../enum/WarpStyle")
  15611. , g = e("../enum/BlackoutStyle")
  15612. , m = e("../enum/ModelManagerEvents")
  15613. , v = e("../enum/tagEvents")
  15614. , A = e("../enum/PlayerEvents")
  15615. , y = (e("../util/lerp"),
  15616. e("../enum/TagStates"))
  15617. , C = e("events").EventEmitter
  15618. , I = new o(i);
  15619. a.extend(n, C),
  15620. n.prototype.init = function(e, t) {
  15621. this.modelManager = e,
  15622. this.player = t,
  15623. this.updateModel(),
  15624. this.bindEvents()
  15625. }
  15626. ,
  15627. n.prototype.update = function(e) {
  15628. this.updateTags(this.player.mode, this.player.camera, this.player.currentPano, this.player.flying)
  15629. }
  15630. ,
  15631. n.prototype.updateTags = function(e, t, i, n) {
  15632. for (var r in this.model.tags)
  15633. this.model.tags[r].update(e, t, i, n)
  15634. }
  15635. ,
  15636. n.prototype.updateModel = function() {
  15637. this.model = this.modelManager.getActiveModel(),
  15638. this.gettagsFromModel(),
  15639. this.totaltags = Object.keys(this.model.tags).length
  15640. }
  15641. ,
  15642. n.prototype.gettagsFromModel = function() {
  15643. this.tagDiscs = [];
  15644. for (var e in this.model.tags) {
  15645. var t = this.model.tags[e].disc;
  15646. t && this.tagDiscs.push(t)
  15647. }
  15648. }
  15649. ,
  15650. n.prototype.bindEvents = function() {
  15651. function e() {
  15652. Object.keys(this.model.tags).forEach(function(e) {
  15653. var t = this.model.tags[e];
  15654. t.bindEvents(),
  15655. t.billboard.on(u.LINK_CLICK, function(e) {
  15656. e.type === d.NAVIGATION && this.navigateViaLink(e.url)
  15657. }
  15658. .bind(this)),
  15659. t.billboard.on(u.IMAGE_OPENED, function() {
  15660. this.tagState = y.EXAMINE,
  15661. this.emit(u.IMAGE_OPENED)
  15662. }
  15663. .bind(this)),
  15664. t.billboard.on(h.CLOSING, this.dismissExaminedTag.bind(this))
  15665. }
  15666. .bind(this))
  15667. }
  15668. this.modelManager.on(m.ActiveModelChanged, this.updateModel.bind(this)),
  15669. this.modelManager.on(m.ActiveModelChanged, e.bind(this)),
  15670. this.player.on(A.ModeChanging, this.onPlayerModeChanging.bind(this)),
  15671. this.player.on(A.PanoChosen, this.onPanoChange.bind(this)),
  15672. this.player.on(A.Ready, this.onPlayerReady.bind(this)),
  15673. this.player.on(A.FlyingEnded, this.onPlayerFlyingEnded.bind(this)),
  15674. this.player.on(A.WarpStarted, this.handleWarpStart.bind(this)),
  15675. this.player.on(A.WarpInterrupted, this.handleWarpInterruption.bind(this)),
  15676. e.call(this)
  15677. }
  15678. ,
  15679. n.prototype.navigateViaLink = function(e) {
  15680. var t = s.deserialize(e);
  15681. if (t)
  15682. if (t.mode === p.PANORAMA) {
  15683. try {
  15684. this.player.model.panos.get(t.panoId)
  15685. } catch (e) {
  15686. return void I.warn("Unable to find panorama location", t.panoId)
  15687. }
  15688. this.player.warpToPanoById(t.panoId, t.quaternion, null, null, f.BLACK)
  15689. } else {
  15690. var i = {
  15691. cameraMode: t.mode,
  15692. position: t.position,
  15693. quaternion: t.quaternion,
  15694. scanId: t.panoId,
  15695. orthoZoom: t.zoom,
  15696. floorVisibility: t.floorVisibility,
  15697. thumbUrl: null,
  15698. name: null
  15699. };
  15700. this.player.flyToNewMode({
  15701. mode: t.mode,
  15702. duration: c.warp.outsideTime,
  15703. warpDest: new l(i),
  15704. force: !0
  15705. })
  15706. }
  15707. }
  15708. ,
  15709. n.prototype.handleWarpStart = function(e, t, i, n) {
  15710. this.dismissExaminedTag(),
  15711. t === f.BLACK && (null !== n && void 0 !== n || (n = c.warp.teleportTime),
  15712. e && (i = g.END),
  15713. this.hideShowTagsForBlackoutStyle(i, n))
  15714. }
  15715. ,
  15716. n.prototype.handleWarpInterruption = function(e, t, i) {
  15717. null !== i && void 0 !== i || (i = c.warp.teleportTime),
  15718. this.hideShowTagsForBlackoutStyle(t, i)
  15719. }
  15720. ,
  15721. n.prototype.hideShowTagsForBlackoutStyle = function(e, t) {
  15722. var i = 0
  15723. , n = 0
  15724. , r = t / 2;
  15725. switch (null !== e && void 0 !== e || (e = g.MIDDLE),
  15726. e) {
  15727. case g.END:
  15728. this.hideAlltags(r);
  15729. break;
  15730. case g.BEGINNING:
  15731. this.hideAlltags().done(this.showAlltags.bind(this, r));
  15732. break;
  15733. case g.NONE:
  15734. break;
  15735. case g.MIDDLE:
  15736. i = r,
  15737. n = r,
  15738. this.hideAlltags(n),
  15739. setTimeout(function() {
  15740. this.showAlltags(i)
  15741. }
  15742. .bind(this), n);
  15743. break;
  15744. case g.FADEIN:
  15745. setTimeout(function() {
  15746. this.showAlltags(r)
  15747. }
  15748. .bind(this), r)
  15749. }
  15750. }
  15751. ,
  15752. n.prototype.onPlayerModeChanging = function(e, t) {
  15753. t !== p.PANORAMA && this.dismissExaminedTag(),
  15754. t === p.PANORAMA && player.currentPano && !player.currentPano.isAligned() && (t = p.OUTDOOR);
  15755. var i = t !== p.OUTDOOR;
  15756. i !== this.model.tagsShown && (i ? this.showAlltags(c.tags.startup.fadeInDuration) : this.hideAlltags(c.tags.startup.fadeInDuration))
  15757. }
  15758. ,
  15759. n.prototype.onPanoChange = function(e, t) {
  15760. var i = this.navigatingViaTag;
  15761. if (this.navigatingViaTag = !1,
  15762. !i) {
  15763. this.dismissExaminedTag();
  15764. var n = e && !e.isAligned() ? p.OUTDOOR : p.PANORAMA
  15765. , r = t && !t.isAligned() ? p.OUTDOOR : p.PANORAMA;
  15766. n !== r && (r === p.PANORAMA ? this.showAlltags(c.tags.startup.fadeInDuration, null, !0) : this.hideAlltags(c.tags.startup.fadeInDuration))
  15767. }
  15768. }
  15769. ,
  15770. n.prototype.onPlayerReady = function(e, t, i) {
  15771. this.startAlltags(e, t ? i : null)
  15772. }
  15773. ,
  15774. n.prototype.onPlayerFlyingEnded = function(e, t) {
  15775. this.updateClosestTags(e)
  15776. }
  15777. ,
  15778. n.prototype.dismissExaminedTag = function() {
  15779. this.activeTag && this.tagState === y.EXAMINE && this.dismissActiveTag(),
  15780. this.hoveredTag && (this.hoveredTag.setFreeState(!0),
  15781. this.hoveredTag = null)
  15782. }
  15783. ,
  15784. n.prototype.startAlltags = function(e, t) {
  15785. this.model.shouldShowtags = c.tags.enabled,
  15786. this.enabled = !0,
  15787. e || (this.showAlltags(c.tags.startup.fadeInDuration, c.tags.startup.fadeInDelay),
  15788. t && setTimeout(function() {
  15789. this.activateTag(this.model.getTagBySid(t))
  15790. }
  15791. .bind(this), c.tags.startup.fadeInDuration / 2))
  15792. }
  15793. ,
  15794. n.prototype.showAlltags = function(e, t, i) {
  15795. function n() {
  15796. o++,
  15797. o === this.totaltags && (this.model.tagsShown = !0,
  15798. r.resolve())
  15799. }
  15800. var r = $.Deferred();
  15801. if (!i && this.player.mode === p.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || !this.model.shouldShowtags)
  15802. return r.resolve().promise();
  15803. var o = 0;
  15804. for (var a in this.model.tags) {
  15805. var s = this.model.tags[a];
  15806. s.show(e, t).done(n.bind(this))
  15807. }
  15808. return r.promise()
  15809. }
  15810. ,
  15811. n.prototype.hideAlltags = function(e, t) {
  15812. function i() {
  15813. r++,
  15814. r === this.totaltags && (this.model.tagsShown = !1,
  15815. n.resolve())
  15816. }
  15817. var n = $.Deferred()
  15818. , r = 0;
  15819. for (var o in this.model.tags) {
  15820. var a = this.model.tags[o];
  15821. a.hide(e, t).done(i.bind(this)),
  15822. a === this.activeTag && this.dismissActiveTag()
  15823. }
  15824. return n.promise()
  15825. }
  15826. ,
  15827. n.prototype.enableHovering = function() {
  15828. this.enabled = !0
  15829. }
  15830. ,
  15831. n.prototype.disableHovering = function() {
  15832. this.enabled = !1
  15833. }
  15834. ,
  15835. n.prototype.activateTag = function(e, t) {
  15836. t = t || y.EXAMINE,
  15837. this.activeTag = e,
  15838. this.activeTag.hoveringDisc = !0,
  15839. this.activeTag.setHoverState(t === y.EXAMINE),
  15840. this.tagState = t,
  15841. this.emit(v.TagActivated, e)
  15842. }
  15843. ,
  15844. n.prototype.dismissActiveTag = function() {
  15845. this.activeTag.hoveringDisc = !1,
  15846. this.activeTag.setFreeState(!0);
  15847. var e = this.activeTag;
  15848. this.activeTag = null,
  15849. this.tagState = y.IDLE,
  15850. this.emit(v.TagDismissed, e)
  15851. }
  15852. ,
  15853. n.prototype.clickedOnTag = function(e) {
  15854. var t = function() {
  15855. this.navigatingViaTag = !0,
  15856. this.activeTag.examine(this.player),
  15857. this.emit(v.TagNavigation, this.activeTag)
  15858. }
  15859. .bind(this);
  15860. return this.tagState !== y.EXAMINE ? (this.activateTag(this.intersectTag, y.EXAMINE),
  15861. this.activeTag = this.intersectTag,
  15862. t(),
  15863. !0) : (this.dismissActiveTag(),
  15864. !1)
  15865. }
  15866. ,
  15867. n.prototype.intersecttag = function() {
  15868. var e = new r.Vector3
  15869. , t = new r.Vector3
  15870. , i = new r.Vector3;
  15871. return function(n, r, o) {
  15872. if (!this.enabled)
  15873. return null;
  15874. var a = null
  15875. , s = this.tagDiscs.filter(function(e) {
  15876. return e.parent.visible
  15877. });
  15878. if (s.length > 0) {
  15879. var l = this.model.floors.reduce(function(e, t) {
  15880. return t.hidden ? e : e.concat(t.collider.children)
  15881. }, s);
  15882. e.set(n.x, n.y, -1).unproject(o),
  15883. t.set(n.x, n.y, 1).unproject(o),
  15884. i.copy(t).sub(e).normalize(),
  15885. this.raycaster.set(e, i);
  15886. var c = this.raycaster.intersectObjects(l);
  15887. c.length > 0 && s.indexOf(c[0].object) !== -1 && (a = c[0].object.tag)
  15888. }
  15889. return this.intersectTag = a,
  15890. r && (this.activeTag && a !== this.activeTag && (this.tagState === y.BROWSE || this.tagState === y.EXAMINE && a) && this.dismissActiveTag(),
  15891. a && a !== this.activeTag && (a.listeners(h.ENTER).length < 1 && (a.billboard.on(h.ENTER, function() {
  15892. this.hoveredTag = a
  15893. }
  15894. .bind(this)),
  15895. a.billboard.on(h.LEAVE, function() {
  15896. this.hoveredTag = null
  15897. }
  15898. .bind(this))),
  15899. this.activateTag(a, y.BROWSE))),
  15900. a
  15901. }
  15902. }(),
  15903. n.prototype.rankedtagInDirection = function() {
  15904. var e = []
  15905. , t = []
  15906. , i = new r.Vector3
  15907. , n = new r.Vector3
  15908. , o = new r.Vector3;
  15909. return function(r, a, s, l) {
  15910. var c = 0;
  15911. t.length = 0;
  15912. for (var h = 0; h < this.closesttags.length; h++) {
  15913. var u = this.closesttags[h];
  15914. n.copy(u.position),
  15915. n.add(u.discPosition),
  15916. i.copy(a),
  15917. i.sub(n).negate(),
  15918. i.normalize();
  15919. var d = i.dot(l);
  15920. if (d >= 0) {
  15921. o.copy(n),
  15922. o.project(s);
  15923. var p = this.intersecttag(o, !1, s);
  15924. if (p) {
  15925. if (c >= e.length)
  15926. for (var f = 0; f < 64; f++)
  15927. e.push({
  15928. tag: u,
  15929. dot: d
  15930. });
  15931. var g = e[c];
  15932. g.tag = u,
  15933. g.dot = d,
  15934. g.position = math.projectPositionToCanvas(n, s),
  15935. t.push(g),
  15936. c++
  15937. }
  15938. }
  15939. }
  15940. return t.sort(function(e, t) {
  15941. return e.dot > t.dot ? -1 : e.dot < t.dot ? 1 : 0
  15942. }),
  15943. r < t.length ? t[r].tag : null
  15944. }
  15945. }(),
  15946. n.prototype.updateClosestTags = function() {
  15947. var e = new r.Vector3
  15948. , t = 30;
  15949. return function(i) {
  15950. this.closesttags || (this.closesttags = []),
  15951. this.closesttags.length = 0;
  15952. var n = this.model.tags;
  15953. if (n)
  15954. for (var r in n)
  15955. if (n.hasOwnProperty(r)) {
  15956. var o = n[r]
  15957. , a = o.position;
  15958. e.copy(i),
  15959. e.sub(a).negate();
  15960. var s = e.lengthSq();
  15961. s < t && this.closesttags.push(o)
  15962. }
  15963. }
  15964. }(),
  15965. t.exports = n
  15966. }
  15967. ).call(this, "/js/tag/tagManager.js")
  15968. }
  15969. , {
  15970. "../controls/serializer": 14,
  15971. "../enum/BlackoutStyle": 18,
  15972. "../enum/tagEvents": 32,
  15973. "../enum/ModelManagerEvents": 33,
  15974. "../enum/PlayerEvents": 40,
  15975. "../enum/TagStates": 44,
  15976. "../enum/Viewmode": 51,
  15977. "../enum/WarpStyle": 52,
  15978. "../objects/Snapshot": 153,
  15979. "../settings": 166,
  15980. "../util/common": 185,
  15981. "../util/lerp": 188,
  15982. "../util/logger": 189,
  15983. "./Billboard/BillboardEvent": 120,
  15984. "./Media/LinkType": 130,
  15985. "./Media/MediaEvent": 131,
  15986. events: 202,
  15987. three: 217
  15988. }],
  15989. 125: [function(e, t, i) {
  15990. (function(i) {
  15991. "use strict";
  15992. function n() {
  15993. this.embedWrapper = null,
  15994. this.embedElement = null
  15995. }
  15996. var r = e("../../util/ajax")
  15997. , o = e("./mediaSettings")
  15998. , a = e("../../settings")
  15999. , s = e("../../util/logger")
  16000. , l = new s(i);
  16001. n.prototype.createDomElement = function() {
  16002. return this.embedWrapper = document.createElement("div"),
  16003. this.embedWrapper.classList.add("tag-embed"),
  16004. this.embedWrapper.classList.add("hidden"),
  16005. this.embedWrapper
  16006. }
  16007. ,
  16008. n.prototype.load = function(e) {
  16009. var t = "https://api.embedly.com/1/oembed?key=" + a.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&maxwidth=" + o.maxEmbedWidth;
  16010. return new Promise(function(e, i) {
  16011. r.get(t).then(function(t) {
  16012. if (t = JSON.parse(t),
  16013. t.html && t.html.indexOf("<script") === -1) {
  16014. this.embedWrapper.innerHTML = t.html;
  16015. var n = Math.min(t.width, o.maxEmbedWidth) || o.maxEmbedWidth;
  16016. if (this.embedWrapper.style.width = n + "px",
  16017. t.height) {
  16018. var r = t.height / t.width;
  16019. this.embedWrapper.style.height = n * r + "px"
  16020. }
  16021. this.embedElement = this.embedWrapper.firstChild;
  16022. var a = [];
  16023. try {
  16024. a = [].slice.call(this.embedElement.querySelectorAll("a"))
  16025. } catch (e) {
  16026. l.debug("Error getting `a` elements for embed; was it an iframe?")
  16027. }
  16028. a.forEach(function(e) {
  16029. e.setAttribute("target", "_blank")
  16030. }),
  16031. this.embedElement.classList.add("hidden"),
  16032. this.embedWrapper.classList.remove("hidden"),
  16033. e()
  16034. } else
  16035. i("Not a valid embed")
  16036. }
  16037. .bind(this), function(e) {
  16038. i(e.response)
  16039. })
  16040. }
  16041. .bind(this))
  16042. }
  16043. ,
  16044. n.prototype.show = function() {
  16045. this.embedElement && this.embedElement.classList.remove("hidden")
  16046. }
  16047. ,
  16048. n.prototype.hide = function() {
  16049. this.embedElement && this.embedElement.classList.add("hidden")
  16050. }
  16051. ,
  16052. t.exports = n
  16053. }
  16054. ).call(this, "/js/tag/Media/EmbedlyEmbed.js")
  16055. }
  16056. , {
  16057. "../../settings": 166,
  16058. "../../util/ajax": 181,
  16059. "../../util/logger": 189,
  16060. "./mediaSettings": 132
  16061. }],
  16062. 126: [function(e, t, i) {
  16063. (function(i) {
  16064. "use strict";
  16065. function n(e) {
  16066. o.call(this),
  16067. this.options = e,
  16068. this.playerControls = null,
  16069. this.state = s.NOT_READY
  16070. }
  16071. var r = e("../../util/browser")
  16072. , o = e("./EmbedlyEmbed")
  16073. , a = e("../../util/logger")
  16074. , s = (new a(i),
  16075. Object.freeze({
  16076. NOT_READY: "player.not.ready",
  16077. CUED: "player.cued",
  16078. PLAYING: "player.playing",
  16079. PAUSED: "player.paused"
  16080. }));
  16081. n.prototype = Object.create(o.prototype),
  16082. n.prototype.createDomElement = function() {
  16083. return this.embedWrapper = document.createElement("div"),
  16084. this.embedWrapper.classList.add("tag-video"),
  16085. this.embedWrapper.classList.add("hidden"),
  16086. this.embedWrapper
  16087. }
  16088. ,
  16089. n.prototype.load = function(e) {
  16090. var t = function() {
  16091. function e(e) {
  16092. this.playerState = s.CUED,
  16093. this.options.startMuted && this.playerControls.mute()
  16094. }
  16095. function t(e) {
  16096. this.playerState = e
  16097. }
  16098. function i(e) {
  16099. this.playerControls.setCurrentTime(0),
  16100. this.options.loop ? this.playerControls.play() : this.playerControls.pause()
  16101. }
  16102. this.playerControls = new playerjs.Player(this.embedElement),
  16103. this.playerControls.on("ready", e.bind(this)),
  16104. this.playerControls.on("play", t.bind(this, s.PLAYING)),
  16105. this.playerControls.on("pause", t.bind(this, s.PAUSED)),
  16106. this.playerControls.on("ended", i.bind(this))
  16107. }
  16108. .bind(this);
  16109. return o.prototype.load.call(this, e).then(t.bind(this))
  16110. }
  16111. ,
  16112. n.prototype.play = function() {
  16113. var e = r.isMobile();
  16114. return function() {
  16115. this.playerState !== s.NOT_READY && this.playerControls && !e && (this.state === s.CUED && this.options.autoPlay || this.options.autoResume) && this.playerControls.play()
  16116. }
  16117. }(),
  16118. n.prototype.pause = function() {
  16119. this.playerState !== s.NOT_READY && this.playerControls && this.playerControls.pause()
  16120. }
  16121. ,
  16122. t.exports = n
  16123. }
  16124. ).call(this, "/js/tag/Media/EmbedlyPlayer.js")
  16125. }
  16126. , {
  16127. "../../util/browser": 182,
  16128. "../../util/logger": 189,
  16129. "./EmbedlyEmbed": 125
  16130. }],
  16131. 127: [function(e, t, i) {
  16132. (function(i) {
  16133. "use strict";
  16134. function n(e) {
  16135. function t() {
  16136. return a.debug("requesting file from embedly:", e.href),
  16137. r.get(e.href, {
  16138. responseType: e.responseType
  16139. }).then(function(t) {
  16140. return a.debug("requesting file finished:", e.href),
  16141. t
  16142. })
  16143. }
  16144. function i() {}
  16145. return s = new Promise(function(e, n) {
  16146. s.catch(i).then(function() {
  16147. t().then(e, n)
  16148. })
  16149. }
  16150. )
  16151. }
  16152. var r = e("../../util/ajax")
  16153. , o = (e("./mediaSettings"),
  16154. e("../../util/logger"))
  16155. , a = new o(i)
  16156. , s = Promise.resolve();
  16157. t.exports.enqueue = n
  16158. }
  16159. ).call(this, "/js/tag/Media/EmbedlyQueue.js")
  16160. }
  16161. , {
  16162. "../../util/ajax": 181,
  16163. "../../util/logger": 189,
  16164. "./mediaSettings": 132
  16165. }],
  16166. 128: [function(e, t, i) {
  16167. (function(i) {
  16168. "use strict";
  16169. function n() {
  16170. this.imageWrapper = null,
  16171. this.width = 0,
  16172. this.height = 0,
  16173. this.aspect = 1
  16174. }
  16175. var r = e("./MediaEvent")
  16176. , o = e("./EmbedlyQueue")
  16177. , a = e("events").EventEmitter
  16178. , s = e("../../util/logger")
  16179. , l = e("../../settings");
  16180. new s(i);
  16181. n.prototype = Object.create(a.prototype),
  16182. n.prototype.createDomElement = function() {
  16183. return this.imageWrapper = document.createElement("div"),
  16184. this.imageWrapper.classList.add("tag-image"),
  16185. this.imageWrapper.classList.add("hidden"),
  16186. this.imageWrapper.addEventListener("click", function(e) {
  16187. e.stopPropagation(),
  16188. this.emit(r.IMAGE_OPENING),
  16189. this.imageWrapper.style.pointerEvents = "none"
  16190. }
  16191. .bind(this)),
  16192. this.imageWrapper
  16193. }
  16194. ,
  16195. n.prototype.onClosed = function() {
  16196. this.imageWrapper.style.pointerEvents = "auto"
  16197. }
  16198. ,
  16199. n.prototype.load = function(e) {
  16200. var t = Math.max(window.screen.height, window.screen.width)
  16201. , i = "https://i.embed.ly/1/display/resize?key=" + l.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&width=" + t + "&height=" + t;
  16202. return new Promise(function(e, t) {
  16203. function n(t) {
  16204. var i = t.target;
  16205. this.width = i.naturalWidth,
  16206. this.height = i.naturalHeight,
  16207. this.aspect = this.width / this.height;
  16208. var n = t.target.src;
  16209. this.imageWrapper.style.backgroundImage = 'url("' + n + '")',
  16210. this.imageWrapper.style.width = this.width + "px",
  16211. this.imageWrapper.style.height = this.height + "px",
  16212. this.imageWrapper.classList.remove("hidden"),
  16213. e()
  16214. }
  16215. o.enqueue({
  16216. href: i,
  16217. responseType: "arraybuffer"
  16218. }).then(function(e) {
  16219. var t = new Uint8Array(e)
  16220. , i = new Blob([t])
  16221. , r = new window.Image;
  16222. r.addEventListener("load", n.bind(this));
  16223. var o = URL.createObjectURL(i);
  16224. r.src = o
  16225. }
  16226. .bind(this), t)
  16227. }
  16228. .bind(this))
  16229. }
  16230. ,
  16231. t.exports = n
  16232. }
  16233. ).call(this, "/js/tag/Media/Image.js")
  16234. }
  16235. , {
  16236. "../../settings": 166,
  16237. "../../util/logger": 189,
  16238. "./EmbedlyQueue": 127,
  16239. "./MediaEvent": 131,
  16240. events: 202
  16241. }],
  16242. 129: [function(e, t, i) {
  16243. "use strict";
  16244. function n(e) {
  16245. this.label = e.label,
  16246. this.href = e.url,
  16247. this.type = this.updateLinkForType(),
  16248. this.domElement = null,
  16249. this.id = c++
  16250. }
  16251. var r = e("./LinkType")
  16252. , o = e("./MediaEvent")
  16253. , a = e("../../util/browser")
  16254. , s = e("../../analytics")
  16255. , l = e("events").EventEmitter
  16256. , c = 0;
  16257. n.prototype = Object.create(l.prototype),
  16258. n.prototype.updateLinkForType = function() {
  16259. function e(e) {
  16260. var t = new RegExp("[#&?]start=([^#&?]*)")
  16261. , i = t.exec(e);
  16262. return i[1]
  16263. }
  16264. function t(e) {
  16265. return e + "&play=1"
  16266. }
  16267. var i = a.valueFromHash("m") || a.valueFromHash("model");
  16268. return this.href.indexOf("port.com/show") !== -1 || this.href.indexOf(window.location.host + "/show") !== -1 ? this.href.indexOf(i) !== -1 && this.href.indexOf("start=") !== -1 ? (this.href = e(this.href),
  16269. r.NAVIGATION) : (this.href = t(this.href),
  16270. r.MODEL) : r.EXT_LINK
  16271. }
  16272. ;
  16273. var h = {};
  16274. n.prototype.createDomElement = function() {
  16275. function e(e) {
  16276. switch (e.stopPropagation(),
  16277. h[this.id] = !0,
  16278. s.trackAlways("click_tag_link", {
  16279. link_type: this.type,
  16280. link_count: c,
  16281. links_clicked: Object.keys(h).length
  16282. }),
  16283. this.type) {
  16284. case r.MODEL:
  16285. window.location.replace(this.href);
  16286. break;
  16287. case r.EXT_LINK:
  16288. window.open(this.href, "_blank")
  16289. }
  16290. this.emit(o.LINK_CLICK, {
  16291. type: this.type,
  16292. url: this.href
  16293. })
  16294. }
  16295. if (this.domElement = document.createElement("a"),
  16296. this.domElement.classList.add("tag-link"),
  16297. this.domElement.textContent = this.label,
  16298. this.type === r.EXT_LINK) {
  16299. this.domElement.textContent += " ";
  16300. var t = document.createElement("i");
  16301. t.classList.add("icon-ext-link"),
  16302. t.title = "Link to external web site",
  16303. this.domElement.appendChild(t)
  16304. }
  16305. return this.domElement.addEventListener("click", e.bind(this)),
  16306. this.domElement
  16307. }
  16308. ,
  16309. t.exports = n
  16310. }
  16311. , {
  16312. "../../analytics": 4,
  16313. "../../util/browser": 182,
  16314. "./LinkType": 130,
  16315. "./MediaEvent": 131,
  16316. events: 202
  16317. }],
  16318. 130: [function(e, t, i) {
  16319. "use strict";
  16320. t.exports = {
  16321. NAVIGATION: "navigation",
  16322. MODEL: "model",
  16323. EXT_LINK: "ext-link"
  16324. }
  16325. }
  16326. , {}],
  16327. 131: [function(e, t, i) {
  16328. "use strict";
  16329. t.exports = Object.freeze({
  16330. LINK_CLICK: "mtmedia.link",
  16331. IMAGE_LOADED: "mtmedia.image.loaded",
  16332. IMAGE_OPENING: "mtmedia.image.opening",
  16333. IMAGE_OPENED: "mtmedia.image.opened",
  16334. IMAGE_CLOSING: "mtmedia.image.closing",
  16335. IMAGE_CLOSED: "mtmedia.image.closed",
  16336. VIDEO_START: "mtmedia.video.start",
  16337. VIDEO_PAUSE: "mtmedia.video.pause",
  16338. VIDEO_ENDED: "mtmedia.video.end"
  16339. })
  16340. }
  16341. , {}],
  16342. 132: [function(e, t, i) {
  16343. "use strict";
  16344. t.exports = Object.freeze({
  16345. maxEmbedWidth: 350,
  16346. defaultAspectRatio: .75
  16347. })
  16348. }
  16349. , {}],
  16350. 133: [function(e, t, i) {
  16351. "use strict";
  16352. t.exports = Object.freeze({
  16353. TEXT: "text",
  16354. LINK: "link",
  16355. IMAGE: "photo",
  16356. VIDEO: "video",
  16357. RICH: "rich"
  16358. })
  16359. }
  16360. , {}],
  16361. 134: [function(e, t, i) {
  16362. "use strict";
  16363. function n(e) {
  16364. this.capabilities = {
  16365. links: {
  16366. enable: e.supportLinks,
  16367. keepLabels: e.keepLinkLabels
  16368. }
  16369. }
  16370. }
  16371. var r = e("./DescriptionChunkType");
  16372. n.prototype.parse = function(e, t) {
  16373. var i = []
  16374. , n = e.split("[").map(function(e, t) {
  16375. return 0 === t ? e : "[" + e
  16376. });
  16377. return n.forEach(function(e) {
  16378. var n = this.findMarkdown(e);
  16379. if (n) {
  16380. if (n.url.indexOf("javascript:") !== -1)
  16381. return;
  16382. this.addLinkChunk(i, n, t),
  16383. this.addTextChunk(i, e.slice(n.markdown.length))
  16384. } else
  16385. this.addTextChunk(i, e)
  16386. }
  16387. .bind(this)),
  16388. i
  16389. }
  16390. ,
  16391. n.prototype.findMarkdown = function(e) {
  16392. var t = /\[([^\]]*)\]\((.*)\)/
  16393. , i = e.match(t);
  16394. if (i) {
  16395. for (var n = i[2], r = 1, o = 0; o < n.length && ("(" === n[o] ? r++ : ")" === n[o] && r--,
  16396. 0 !== r); )
  16397. o++;
  16398. var a = n.length - o;
  16399. return {
  16400. markdown: i[0].substring(0, i[0].length - a),
  16401. label: i[1],
  16402. url: i[2].substring(0, o)
  16403. }
  16404. }
  16405. }
  16406. ,
  16407. n.prototype.addTextChunk = function(e, t) {
  16408. 0 !== t.length && e.push({
  16409. type: r.TEXT,
  16410. text: t
  16411. })
  16412. }
  16413. ,
  16414. n.prototype.addLinkChunk = function(e, t) {
  16415. if (!this.capabilities.links.enable)
  16416. return void (this.capabilities.links.keepLabels && this.addTextChunk(e, t.label));
  16417. var i = {
  16418. label: t.label,
  16419. url: t.url
  16420. };
  16421. i.url.indexOf("://") === -1 && (i.url = "http://" + i.url),
  16422. e.push({
  16423. type: r.LINK,
  16424. link: i
  16425. })
  16426. }
  16427. ,
  16428. t.exports = n
  16429. }
  16430. , {
  16431. "./DescriptionChunkType": 133
  16432. }],
  16433. 135: [function(e, t, i) {
  16434. (function(i) {
  16435. "use strict";
  16436. var n = e("../util/logger")
  16437. , r = new n(i)
  16438. , o = {
  16439. parseIdsFromChunkName: function(e, t) {
  16440. t.floorId = o.parseFloor(e),
  16441. t.roomId = o.parseRoom(e)
  16442. },
  16443. parseFloor: function(e) {
  16444. var t = e.match(/_group([0-9]+)/);
  16445. if (!t)
  16446. return 0;
  16447. try {
  16448. return parseInt(t[1], 10)
  16449. } catch (e) {
  16450. return r.warn('Non-int value "' + t[1] + '" for mesh group, defaulting to floor 0'),
  16451. 0
  16452. }
  16453. },
  16454. parseRoom: function(e) {
  16455. var t = e.match(/_sub([0-9]+)/);
  16456. if (!t)
  16457. return -1;
  16458. try {
  16459. return parseInt(t[1], 10)
  16460. } catch (e) {
  16461. return r.warn('Non-int value "' + t[1] + '" for mesh subgroup, defaulting to subgroup 0'),
  16462. 0
  16463. }
  16464. }
  16465. };
  16466. t.exports = o
  16467. }
  16468. ).call(this, "/js/model/Chunks.js")
  16469. }
  16470. , {
  16471. "../util/logger": 189
  16472. }],
  16473. 136: [function(e, t, i) {
  16474. (function(i) {
  16475. "use strict";
  16476. function n(e) {
  16477. s.call(this),
  16478. this.model = e,
  16479. this.exploded = !1
  16480. }
  16481. var r = e("../objects/Floor")
  16482. , o = (e("../settings"),
  16483. e("../util/logger"))
  16484. , a = e("../util/transitions")
  16485. , s = e("../util/IndexedCollection")
  16486. , l = e("../util/common")
  16487. , c = e("../util/easing");
  16488. new o(i);
  16489. l.inherit(n, s),
  16490. n.prototype.add = function(e) {
  16491. s.prototype.add.call(this, e),
  16492. this.model.add(e)
  16493. }
  16494. ,
  16495. n.prototype.getIndex = function(e) {
  16496. return e.floorIndex
  16497. }
  16498. ,
  16499. n.prototype.build = function() {
  16500. this.list.forEach(function(e) {
  16501. e.build()
  16502. })
  16503. }
  16504. ,
  16505. n.prototype.size = function() {
  16506. return this.length
  16507. }
  16508. ,
  16509. n.prototype.sort = function() {
  16510. s.prototype.sort.call(this, function(e, t) {
  16511. return e.floorIndex - t.floorIndex
  16512. })
  16513. }
  16514. ,
  16515. n.prototype.nextFloor = function(e, t) {
  16516. return this.index[e.floorIndex + t] || null
  16517. }
  16518. ,
  16519. n.prototype.getFloorAtPoint = function(e) {
  16520. for (var t = null, i = 1 / 0, n = 0; n < this.list.length; n++) {
  16521. var r = this.list[n]
  16522. , o = r.distanceToPoint(e);
  16523. (!t || i > o) && (i = o,
  16524. t = r)
  16525. }
  16526. return t
  16527. }
  16528. ,
  16529. n.prototype.getOrMakeFloor = function(e) {
  16530. var t = this.index[e];
  16531. return t || (t = new r(this.model,e),
  16532. this.add(t)),
  16533. t
  16534. }
  16535. ,
  16536. n.prototype.hide = function() {
  16537. this.list.forEach(function(e) {
  16538. e.hide()
  16539. })
  16540. }
  16541. ,
  16542. n.prototype.show = function() {
  16543. this.list.forEach(function(e) {
  16544. e.show()
  16545. })
  16546. }
  16547. ,
  16548. n.prototype.names = function() {
  16549. return this.list.reduce(function(e, t) {
  16550. return e.concat(t.name)
  16551. }, [])
  16552. }
  16553. ,
  16554. n.prototype.toggleExplodeHorizontal = function() {
  16555. function e(e, t) {
  16556. r.copy(e.position),
  16557. e.position.x = i[e.floorIndex] * t,
  16558. e.position.y = 1 * e.floorIndex * t,
  16559. r.sub(e.position).multiplyScalar(-1),
  16560. e.panos.forEach(function(e) {
  16561. e.translate(r)
  16562. })
  16563. }
  16564. var t, i = [], n = 0;
  16565. this.list.forEach(function(e, r, o) {
  16566. t = r > 0 ? Math.max(o[r - 1].boundingBox.max.x - e.boundingBox.min.x, e.boundingBox.size().x / 2) : 0,
  16567. n += t,
  16568. i[r] = n
  16569. }),
  16570. i = i.map(function(e) {
  16571. return e - n / 2
  16572. });
  16573. var r = this.list[0].position.clone();
  16574. this.exploded ? this.list.forEach(function(t) {
  16575. a.start(function(i) {
  16576. e(t, 1 - i)
  16577. }, 1500, null, 0, c.easeOutExpo)
  16578. }) : this.list.forEach(function(t) {
  16579. a.start(function(i) {
  16580. e(t, i)
  16581. }, 1500, null, 0, c.easeOutExpo)
  16582. }),
  16583. this.exploded = !this.exploded
  16584. }
  16585. ,
  16586. n.prototype.toggleExplodeVertical = function() {
  16587. function e(e, i) {
  16588. var n = n.copy(e.position);
  16589. e.position.y = (5 * e.floorIndex - t.y / 2) * i,
  16590. n.sub(e.position).multiplyScalar(-1),
  16591. e.panos.forEach(function(e) {
  16592. e.translate(n)
  16593. })
  16594. }
  16595. var t = this.model.size;
  16596. this.list[0].position.clone();
  16597. this.exploded ? this.list.forEach(function(t) {
  16598. a.start(function(i) {
  16599. e(t, 1 - i)
  16600. }, 1500, null, 0, c.easeOutExpo)
  16601. }) : this.list.forEach(function(t) {
  16602. a.start(function(i) {
  16603. e(t, i)
  16604. }, 1500, null, 0, c.easeOutExpo)
  16605. }),
  16606. this.exploded = !this.exploded
  16607. }
  16608. ,
  16609. t.exports = n
  16610. }
  16611. ).call(this, "/js/model/FloorCollection.js")
  16612. }
  16613. , {
  16614. "../objects/Floor": 146,
  16615. "../settings": 166,
  16616. "../util/IndexedCollection": 175,
  16617. "../util/common": 185,
  16618. "../util/easing": 186,
  16619. "../util/logger": 189,
  16620. "../util/transitions": 195
  16621. }],
  16622. 137: [function(e, t, i) {
  16623. (function(i) {
  16624. "use strict";
  16625. function n() {
  16626. c.call(this)
  16627. }
  16628. var r = e("../settings")
  16629. , o = e("../util/logger")
  16630. , a = e("../enum/Viewmode")
  16631. , s = e("../objects/Snapshot")
  16632. , l = (e("../util/math"),
  16633. e("../util/common"))
  16634. , c = e("../util/IndexedCollection")
  16635. , h = new o(i);
  16636. l.inherit(n, c),
  16637. n.prototype.getImage = function(e) {
  16638. return e && this.index.hasOwnProperty(e) ? this.index[e] : null
  16639. }
  16640. ,
  16641. n.prototype.filterByModesAndReel = function(e, t) {
  16642. for (var i = [], n = 0; n < t.length; n += 1) {
  16643. var r = t[n]
  16644. , o = this.index[r.sid];
  16645. o && i.push(o)
  16646. }
  16647. var s = e[a.DOLLHOUSE]
  16648. , l = e[a.FLOORPLAN];
  16649. i = i.filter(function(e) {
  16650. if (!e.metadata || void 0 === e.metadata.camera_mode)
  16651. return !0;
  16652. var t;
  16653. try {
  16654. t = a.convertWorkshopModeInt(e.metadata.camera_mode)
  16655. } catch (e) {
  16656. return h.debug(e.message),
  16657. !1
  16658. }
  16659. return t === a.PANORAMA || t === a.FLOORPLAN && l || t === a.DOLLHOUSE && s
  16660. }),
  16661. i.length !== this.list.length && h.info("Disallowed " + (this.list.length - i.length) + " highlight images"),
  16662. this.list = i,
  16663. this.reIndex()
  16664. }
  16665. ,
  16666. n.prototype.getHeroLocations = function(e) {
  16667. if (0 === this.list.length)
  16668. return [];
  16669. for (var t = [], i = 0; i < this.list.length; ++i) {
  16670. var o = this.list[i]
  16671. , l = o.thumbnail_signed_src
  16672. , c = o.name;
  16673. if (o.metadata && void 0 !== o.metadata.camera_quaternion) {
  16674. if (!r.show360Views.enabled && o.metadata.scan_id) {
  16675. var h = e.get(o.metadata.scan_id);
  16676. if (h && !h.isAligned())
  16677. continue
  16678. }
  16679. var u = a.convertWorkshopModeInt(o.metadata.camera_mode);
  16680. if (u === a.MESH)
  16681. continue;
  16682. var d = {
  16683. cameraMode: u,
  16684. position: o.metadata.camera_position,
  16685. quaternion: o.metadata.camera_quaternion,
  16686. panoId: o.metadata.scan_id,
  16687. orthoZoom: o.metadata.ortho_zoom,
  16688. floorVisibility: void 0 !== o.metadata.floor_visibility ? o.metadata.floor_visibility.slice(0) : [],
  16689. thumbUrl: l,
  16690. name: n.filterImageName(c),
  16691. sid: o.sid //xzw add g_tourAudio要用
  16692. }
  16693. , p = new s(d);
  16694. t.push(p)
  16695. }
  16696. }
  16697. return t
  16698. }
  16699. ,
  16700. n.prototype.getIndex = function(e) {
  16701. return e.sid
  16702. }
  16703. ,
  16704. n.filterImageName = function(e) {
  16705. return "" === e || e.match(/^[0-9.]+_[0-9.]+$/) ? null : e
  16706. }
  16707. ,
  16708. t.exports = n
  16709. }
  16710. ).call(this, "/js/model/ImageCollection.js")
  16711. }
  16712. , {
  16713. "../enum/Viewmode": 51,
  16714. "../objects/Snapshot": 153,
  16715. "../settings": 166,
  16716. "../util/IndexedCollection": 175,
  16717. "../util/common": 185,
  16718. "../util/logger": 189,
  16719. "../util/math": 190
  16720. }],
  16721. 138: [function(e, t, i) {
  16722. (function(i) {
  16723. "use strict";
  16724. function n() {
  16725. u.call(this)
  16726. }
  16727. var r = e("../label/Label")
  16728. , o = e("../settings")
  16729. , a = e("../util/logger")
  16730. , s = e("../util/math")
  16731. , l = e("../util/ajax")
  16732. , c = e("./RoomCollection")
  16733. , h = e("../util/common")
  16734. , u = e("../util/IndexedCollection");
  16735. new a(i);
  16736. h.inherit(n, u),
  16737. n.prototype.getIndex = function(e) {
  16738. return e.labelId
  16739. }
  16740. ,
  16741. n.prototype.associateWithRooms = function(e) {
  16742. this.forEach(function(t) {
  16743. e.forEach(function(e) {
  16744. e.roomId === t.roomId && (t.room = e)
  16745. })
  16746. })
  16747. }
  16748. ,
  16749. n.prototype.createFromLabelData = function(e) {
  16750. e.forEach(function(e) {
  16751. var t = n.parseRoomIndexFromWorkshopRoomId(e.roomId);
  16752. t = c.generateRoomId(e.floorId, t);
  16753. var i = new r(e.sid,e.position || e.positions[0],e.text,e.floorId,t);
  16754. i.position = s.convertWorkshopVector(i.position),
  16755. this.add(i),
  16756. i.build()
  16757. }
  16758. .bind(this))
  16759. }
  16760. ,
  16761. n.prototype.load = function(e, t) {
  16762. return l.get(e, {
  16763. responseType: "json",
  16764. auth: t ? o.authorizationHeader : null
  16765. }).done(function(e) {
  16766. var t = [];
  16767. for (var i in e) {
  16768. var n = e[i];
  16769. t.push(n)
  16770. }
  16771. this.createFromLabelData(t)
  16772. }
  16773. .bind(this))
  16774. }
  16775. ,
  16776. n.parseRoomIndexFromWorkshopRoomId = function(e) {
  16777. var t = -1;
  16778. if (e) {
  16779. var i = e.split("_");
  16780. t = parseInt(i[0])
  16781. }
  16782. return t
  16783. }
  16784. ,
  16785. t.exports = n
  16786. }
  16787. ).call(this, "/js/model/LabelCollection.js")
  16788. }
  16789. , {
  16790. "../label/Label": 90,
  16791. "../settings": 166,
  16792. "../util/IndexedCollection": 175,
  16793. "../util/ajax": 181,
  16794. "../util/common": 185,
  16795. "../util/logger": 189,
  16796. "../util/math": 190,
  16797. "./RoomCollection": 141
  16798. }],
  16799. 139: [function(e, t, i) {
  16800. (function(i) {
  16801. "use strict";
  16802. function n(e, t) {
  16803. o.Object3D.call(this),
  16804. this.sid = t.sid,
  16805. this.data = t,
  16806. this.options = e,
  16807. this.urls = new s(e.urlFiles),
  16808. this.isPublic = void 0 !== t.is_public && t.is_public,
  16809. this.images = new _(this),
  16810. this.images.extend(t.images),
  16811. this.heroImage = this.images.getImage(t.icon),
  16812. this.heroLocations = [],
  16813. this.outdoorPanoLocations = [],
  16814. this.floors = new d(this),
  16815. this.floorsEnabled = void 0 === e.floors || e.floors,
  16816. this.changingFloor = !1,
  16817. this.chunks = [],
  16818. this.panos = new A,
  16819. this.colliders = [],
  16820. this.loadPanosPromise = null,
  16821. this.loadMeshTexturesPromise = null,
  16822. this.auxDataPromise = null,
  16823. this.meshTexturesLoaded = !1,
  16824. this.meshTextures = [],
  16825. this.tags = {},
  16826. this.tagsShown = !1,
  16827. this.shouldShowtags = !1,
  16828. this.has360Views = !1,
  16829. this.showingLabels = f.labels.enabled && t.player_options.labels,
  16830. this.supportedModes = {},
  16831. this.supportedModes[c.PANORAMA] = !0,
  16832. this.supportedModes[c.DOLLHOUSE] = !t.player_options || t.player_options.dollhouse && w.valueFromHash("dh", 1),
  16833. this.supportedModes[c.FLOORPLAN] = !t.player_options || t.player_options.floor_plan && w.valueFromHash("dh", 1),
  16834. this.supportedModes[c.TRANSITIONING] = !0,
  16835. this.supportsTiles = this.configureTiling(),
  16836. this.supportsVR = t.is_vr,
  16837. this.mode = c.DOLLHOUSE,
  16838. this.size = null,
  16839. this.center = null,
  16840. this.boundingBox = new o.Box3,
  16841. this.currentFloor = null,
  16842. this.allFloorsVisible = !0,
  16843. this.projectedPano0 = null,
  16844. this.projectedPano1 = null,
  16845. this.floorsEnabled && t.floors && t.floors.indexOf(",") !== -1 && t.floors.split(",").forEach(function(e, t) {
  16846. this.addFloor(new u(this,t,e.trim()))
  16847. }
  16848. .bind(this)),
  16849. this.waitQueue = [],
  16850. this.on("load", function(e) {
  16851. 0 !== this.waitQueue.length && (this.waitQueue = this.waitQueue.filter(function(e) {
  16852. return !e.isLoadedCallback()
  16853. }),
  16854. 0 === this.waitQueue.length && this.emit("waiting-done"))
  16855. }
  16856. .bind(this)),
  16857. this.setupCustomProperties()
  16858. this.hots = {};
  16859. }
  16860. function r() {
  16861. try {
  16862. var e = document.createElement("canvas")
  16863. , t = e.getContext("webgl");
  16864. t || (t = e.getContext("experimental-webgl"));
  16865. var i = t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE);
  16866. return i
  16867. } catch (e) {
  16868. return 0
  16869. }
  16870. }
  16871. var o = e("three")
  16872. , a = e("../util/ajax")
  16873. , s = e("../util/ModelUrls")
  16874. , l = e("../objects/BoundingTextureSkybox")
  16875. , c = e("../enum/Viewmode")
  16876. , h = e("../enum/RenderOrder")
  16877. , u = (e("../enum/AlignmentType"),
  16878. e("../objects/Floor"))
  16879. , d = e("./FloorCollection")
  16880. , p = e("../objects/Chunk")
  16881. , f = (e("../objects/Room"),
  16882. e("../objects/Snapshot"),
  16883. e("../label/Label"),
  16884. e("../util/math"),
  16885. e("../settings"))
  16886. ,ss = e("../shaders")
  16887. , g = e("../util/logger")
  16888. , m = e("../tag/tag")
  16889. , v = (e("../tag/tagManager"),
  16890. e("../objects/Panorama"))
  16891. , A = e("../util/PanoramaCollection")
  16892. , y = e("../loaders/ModelLoader")
  16893. , C = e("../loaders/ModelTextureLoader")
  16894. , I = e("../loaders/SweepDataLoader")
  16895. , E = e("../util/transitions")
  16896. , b = (e("../util/easing"),
  16897. e("../util/lerp"),
  16898. e("../util/common"))
  16899. , w = (e("../util/texture"),
  16900. e("./../util/browser"))
  16901. , _ = e("./ImageCollection")
  16902. , T = e("./RoomCollection")
  16903. , x = e("./LabelCollection")
  16904. , S = e("./Chunks")
  16905. , M = e("./../util/showcase")
  16906. , R = e("../exception/BasicException")
  16907. , P = (e("../constants")
  16908. ,e("events").EventEmitter)
  16909. ,Hot = e("hot")
  16910. , O = new g(i);
  16911. n.prototype = Object.create(o.Object3D.prototype),
  16912. b.extend(n, P),
  16913. n.prototype.setupCustomProperties = function() {
  16914. var e = f.modelAlpha;
  16915. Object.defineProperty(this, "alpha", {
  16916. get: function() {
  16917. return e
  16918. },
  16919. set: function(t) {
  16920. e = t,
  16921. this.chunks.forEach(function(t) {
  16922. t.material && t.material.uniforms.modelAlpha && (t.material.uniforms.modelAlpha.value = e)
  16923. })
  16924. }
  16925. })
  16926. }
  16927. ,
  16928. n.prototype.configureTiling = function() {
  16929. var e = r();
  16930. if (e < 2048)
  16931. return !1;
  16932. O.warn("Max cube texture size: " + e);
  16933. for (var t = 0; t < f.tiling.tilingFlagNames.length; t++) {
  16934. var i = f.tiling.tilingFlagNames[t];
  16935. if ("1" === w.valueFromHash(i, null))
  16936. return !0;
  16937. if ("0" === w.valueFromHash(i, null))
  16938. return !1
  16939. }
  16940. return !!M.modelDataPromisesTiles(this.data)
  16941. }
  16942. ,
  16943. n.prototype.toggleAlpha = function() {
  16944. this.alpha < 1 ? this.alpha = 1 : this.alpha = 0
  16945. }
  16946. ,
  16947. n.prototype.load = function(e) {
  16948. var t = function() {
  16949. return $.when(this.loadPanos(), this.loadMesh())
  16950. }
  16951. , i = this.urls.init().then(t.bind(this));
  16952. return e ? i = i.then(this.loadMeshTextures.bind(this)) : i.then(this.loadMeshTextures.bind(this)),
  16953. this.auxDataPromise = $.when( /*this.loadHighlightReel(), this.loadtags() */this.loadhots(), this.loadLabels()),
  16954. $.when(i, this.auxDataPromise).done(this.build.bind(this)) //不要另外使用active_reel文件
  16955. }
  16956. ,
  16957. n.prototype.loadMesh = function() {
  16958. function e(e) {
  16959. O.error(e),
  16960. n.reject("loading-failed")
  16961. }
  16962. function t(e, t) {
  16963. n.notify(e, t)
  16964. }
  16965. function i(e, t) {
  16966. if (0 === e.length) {
  16967. O.warn("No geometry found for model, loading faux geometry, disabling outside mode"),
  16968. r.supportedModes[c.DOLLHOUSE] = !1,
  16969. r.supportedModes[c.FLOORPLAN] = !1;
  16970. var i = new p({
  16971. geometry: new o.PlaneBufferGeometry(5,5,1,1)
  16972. });
  16973. i.material.visible = !1,
  16974. i.rotateX(-Math.PI / 2),
  16975. i.geometry.computeBoundingBox(),
  16976. e = [i]
  16977. }
  16978. e.forEach(function(e) {
  16979. var t = r.floorsEnabled ? S.parseFloor(e.name) : 0;
  16980. r.addChunk(t, e)
  16981. }),
  16982. r.floors.sort(),
  16983. n.resolve(r)
  16984. }
  16985. var n = $.Deferred()
  16986. , r = this;
  16987. return y.load(r.data.job.uuid, r.urls, i, t, e),
  16988. n.promise()
  16989. }
  16990. ,
  16991. n.prototype.loadMeshTextures = function() {
  16992. return this.loadTexturesPromise ? this.loadTexturesPromise : (this.loadTexturesPromise = C.load(this, this.meshTextures).then(function() {
  16993. this.meshTexturesLoaded = !0
  16994. }
  16995. .bind(this)),
  16996. this.loadTexturesPromise)
  16997. }
  16998. ,
  16999. /* n.prototype.loadtags = function() {//xzw改
  17000. var e = $.Deferred();
  17001. if (!f.tags.enabled)
  17002. return e.resolve();
  17003. //var t = this.options.urlBase + "/api/v1/jsonstore/model/tags/" + this.sid;
  17004. t = "data/" + this.sid + "/tags.json"
  17005. return a.get(t, {
  17006. responseType: "json",
  17007. auth: this.isPublic ? null : f.authorizationHeader
  17008. }).done(function(t) {
  17009. var i = 0
  17010. , n = 0;
  17011. for (var r in t) {
  17012. var o = t[r];
  17013. o.enabled && (n++,
  17014. (o.label.length || o.description.length) && (this.tags[r] = new m(this,r,o),
  17015. i++))
  17016. }
  17017. i !== n && O.warn("Disallowed " + (n - i) + " tags with no text data"),
  17018. e.resolve()
  17019. }
  17020. .bind(this)).fail(function() {
  17021. O.warn("Getting tags failed, not displaying tags."),
  17022. e.resolve()
  17023. }),
  17024. e
  17025. } */
  17026. n.prototype.shineHots = function(){ //xzw
  17027. E.trigger({
  17028. func: function(e) {
  17029. if(e<=0.5) ss.hot.uniforms.opac.value = 2*e;
  17030. else ss.hot.uniforms.opac.value = -2*e + 2;
  17031. }.bind(this),
  17032. cycling: true,
  17033. duration: 3000,
  17034. //easing: "easeInOutQuad",
  17035. name: "hotShine"
  17036. })
  17037. },
  17038. n.prototype.audioAutoPlay = function(audio){
  17039. //https://www.cnblogs.com/interdrp/p/4211883.html 部分资料
  17040. audio.load(); // iOS 9 还需要额外的 load 一下, 否则直接 play 无效
  17041. var play = function(){
  17042. audio.play();
  17043. console.log('begin play bgm')
  17044. document.removeEventListener("touchstart",play);
  17045. $('#player')[0].removeEventListener("touchstart", play);
  17046. };
  17047. audio.play();
  17048. document.addEventListener("WeixinJSBridgeReady", function () {
  17049. play();
  17050. }, false);
  17051. document.addEventListener("touchstart", play);//ios需要加个事件才能播放 不能自动播放;如果还有浏览器不行,换成别的交互事件
  17052. $('#player')[0].addEventListener("touchstart", play);
  17053. audio.addEventListener('ended', function () {
  17054. audio.play();
  17055. });
  17056. }
  17057. n.prototype.loadhots = function() {//xzw
  17058. var e = $.Deferred();
  17059. var t = g_Prefix+"data/" + this.sid + "/data2.js"
  17060. return a.get(t, {
  17061. responseType: "json",
  17062. auth: this.isPublic ? null : f.authorizationHeader
  17063. }).done(function(t) {
  17064. g_data2 = t;
  17065. this.hotsCount = 0;
  17066. for(var i in t.hots){
  17067. this.hotsCount ++;
  17068. this.hots[i] = new Hot(i, t.hots[i], this);
  17069. }
  17070. g_index = w.valueFromHash("m");
  17071. if(t.tourAudio){
  17072. g_tourAudio = new Audio;
  17073. g_tourAudio.loop = false;
  17074. g_tourAudio.addEventListener('ended', function () {
  17075. var ev = document.createEvent("MouseEvent");
  17076. ev.initEvent("tourAudioEnded",true,true);
  17077. window.dispatchEvent(ev);
  17078. });
  17079. }
  17080. if(t.hasBGM){
  17081. g_bgAudio = new Audio;
  17082. g_bgAudio.src = g_Prefix+"/audio/"+g_index+"/background.mp3";
  17083. g_bgAudio.loop = true;
  17084. g_bgAudio.autoplay = true;
  17085. g_playAudio = g_bgAudio;
  17086. this.audioAutoPlay(g_bgAudio)
  17087. }
  17088. /* g_audio=t.audio;
  17089. g_Text=t.texts;
  17090. g_TextShow=t.showText;
  17091. g_weixinTitle=t.weixintitle;
  17092. if("undefined" != typeof(t.roof))
  17093. {
  17094. g_roof=t.roof;
  17095. }
  17096. if("undefined" != typeof(t.dollhouseminDistance))
  17097. {
  17098. I.dollhouseDefault.minDistance=t.dollhouseminDistance;
  17099. } */
  17100. e.resolve()
  17101. }.bind(this)).fail(function() {
  17102. console.log('没有热点')
  17103. e.resolve()
  17104. }),
  17105. e
  17106. }
  17107. ,
  17108. n.prototype.loadPanos = function() {
  17109. if (this.loadPanosPromise)
  17110. return this.loadPanosPromise;
  17111. var e = new I(this);
  17112. return this.loadPanosPromise = e.load().then(function(e) {
  17113. return this.data.sweeps && Object.keys(this.data.sweeps).length > 0 && (e = e.filter(function(e) {
  17114. return this.data.sweeps[e.uuid].enabled
  17115. }
  17116. .bind(this))),
  17117. this.panos.extend(e.map(function(e) {
  17118. return new v(this,e.uuid,e,this.supportsTiles)
  17119. }
  17120. .bind(this))),
  17121. this.panos.forEach(function(e) {
  17122. e.neighbourUUIDs && (e.neighbourUUIDs.forEach(function(t) {
  17123. var i = this.panos.get(t);
  17124. i && this.panos.setNeighbour(e, i, !0)
  17125. }
  17126. .bind(this)),
  17127. e.neighbourPanos = this.panos.getNeighbours(e) || this.panos.setNeighbour(e, e, !0))
  17128. }
  17129. .bind(this)),
  17130. 0 === this.panos.length && (O.warn("Model has no panos, turning off inside mode"),
  17131. this.supportedModes[c.PANORAMA] = !1),
  17132. $.when(this)
  17133. }
  17134. .bind(this)),
  17135. this.loadPanosPromise
  17136. }
  17137. ,
  17138. n.prototype.loadHighlightReel = function() {//xzw
  17139. var e = $.Deferred()
  17140. // , t = this.options.urlBase + "/api/v1/jsonstore/model/highlights/" + this.sid + "/active_reel";
  17141. ,t = this.options.urlBase + "data/" + this.sid + "/active_reel.json";
  17142. return a.get(t, {
  17143. responseType: "json",
  17144. auth: this.isPublic ? null : f.authorizationHeader
  17145. }).done(function(t) {
  17146. t.reel ? (O.info("Got highlight reel with " + t.reel.length + " items"),
  17147. this.images.filterByModesAndReel(this.supportedModes, t.reel)) : O.info("No highlight reel found"),
  17148. e.resolve()
  17149. }
  17150. .bind(this)).fail(function() {
  17151. O.warn("Getting highlight reel failed, no highlights available"),
  17152. e.resolve()
  17153. }),
  17154. e
  17155. }
  17156. ,
  17157. n.prototype.waitForLoad = function(e, t) {
  17158. t() || (this.waitQueue.push({
  17159. object: e,
  17160. isLoadedCallback: t
  17161. }),
  17162. 1 === this.waitQueue.length && this.emit("waiting"))
  17163. }
  17164. ,
  17165. n.prototype.hide = function() {
  17166. this.floors.hide()
  17167. }
  17168. ,
  17169. n.prototype.show = function() {
  17170. this.floors.show()
  17171. }
  17172. ,
  17173. n.prototype.floorNames = function() {
  17174. return this.floors.names()
  17175. }
  17176. ,
  17177. n.prototype.warpDestFloors = function(e, t) {
  17178. if (!e || this.floors.length !== e.length)
  17179. return void this.toggleAllFloors(!0);
  17180. var i = e.findIndex(function(e) {
  17181. return e
  17182. }
  17183. .bind(this));
  17184. i !== -1 && this.setFloor(this.floors.list[i], null, t)
  17185. }
  17186. ,
  17187. n.prototype.setFloor = function(e, t, i) {
  17188. this.allFloorsVisible && this.emit("allfloors.toggled", !1, this.currentFloor),
  17189. this.allFloorsVisible = !1,
  17190. this._setFloor(e, t, i)
  17191. }
  17192. ,
  17193. n.prototype.toggleAllFloors = function(e) {
  17194. this.allFloorsVisible = void 0 !== e ? e : !this.allFloorsVisible,
  17195. this.emit("allfloors.toggled", this.allFloorsVisible, this.currentFloor),
  17196. this._setFloor(this.currentFloor)
  17197. }
  17198. ,
  17199. n.prototype._setFloor = function(e, t, i) {
  17200. t = t || this.mode,
  17201. this.emit("floor.changed", e, t, this.currentFloor),
  17202. this.currentFloor = e;
  17203. var n;
  17204. if (t === c.PANORAMA) {
  17205. if (this.show(),
  17206. this.shouldShowtags && this.tagsShown)
  17207. for (n in this.tags)
  17208. this.tags[n].show(f.showFloorDuration)
  17209. } else if ((t === c.FLOORPLAN || t === c.DOLLHOUSE) && (this.floors.list.forEach(function(e, t) {
  17210. e.toggle(e === this.currentFloor || this.allFloorsVisible, i || this.allFloorsVisible)
  17211. }
  17212. .bind(this)),
  17213. this.shouldShowtags && this.tagsShown))
  17214. for (n in this.tags) {
  17215. var r = this.tags[n];
  17216. this.allFloorsVisible ? r.show(f.showFloorDuration) : r.floor === this.currentFloor ? r.show(f.showFloorDuration, f.showFloorDelay) : r.hide(f.hideFloorDuration, f.hideFloorDelay)
  17217. }
  17218. var o = this
  17219. , a = e;
  17220. E.start(function() {}, f.showFloorDelay, function() {
  17221. o.floors.forEach(function(e) {
  17222. e.chunks.forEach(function(t) {
  17223. t.renderOrder = e === a ? h.visibleFloor : h.ghostFloor
  17224. })
  17225. })
  17226. }
  17227. .bind(this))
  17228. }
  17229. ,
  17230. n.prototype.toggleExplode = function() {
  17231. this.floors.toggleExplodeHorizontal()
  17232. }
  17233. ,
  17234. n.prototype.toggleExplodeUp = function() {
  17235. this.floors.toggleExplodeVertical()
  17236. }
  17237. ,
  17238. n.prototype.nextFloor = function(e) {
  17239. return this.floors.nextFloor(this.currentFloor, e)
  17240. }
  17241. ,
  17242. n.prototype.addFloor = function(e) {
  17243. this.floors.add(e)
  17244. }
  17245. ,
  17246. n.prototype.getFloorAtPoint = function(e) {
  17247. return this.floors.getFloorAtPoint(e)
  17248. }
  17249. ,
  17250. n.prototype.getTagBySid = function(e) {
  17251. return this.tags[e]
  17252. }
  17253. ,
  17254. n.prototype.addChunk = function(e, t) {
  17255. this.floors.getOrMakeFloor(e).addChunk(t),
  17256. this.chunks.push(t)
  17257. }
  17258. ,
  17259. n.prototype.setMode = function(e) {
  17260. if (!this.supportedModes[e])
  17261. throw new R("Mode not supported for this model: " + e);
  17262. this.mode = e,
  17263. this.chunks.forEach(function(t) {
  17264. t.setMode(e)
  17265. })
  17266. }
  17267. ,
  17268. n.prototype.build = function() {
  17269. this.heroLocations = this.images.getHeroLocations(this.panos);
  17270. var e = function() {
  17271. 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()
  17272. }
  17273. .bind(this)();
  17274. this.has360Views = f.show360Views.enabled && this.heroLocations.some(function(e) {
  17275. return e.cameraMode === c.PANORAMA && this.panos.get(e.panoId) && !this.panos.get(e.panoId).isAligned()
  17276. }
  17277. .bind(this)) || e,
  17278. null === this.heroImage && O.warn("No hero image defined."),
  17279. this.currentFloor = this.floors.last(),
  17280. this.floors.build(),
  17281. this.colliders = this.floors.reduce(function(e, t) {
  17282. return e.concat(t.collider.children)
  17283. }, []),
  17284. this.panos.forEach(function(e) {
  17285. e.build1(),
  17286. e.on("enter", function() {
  17287. e.floor !== this.currentFloor && this.setFloor(e.floor)
  17288. }
  17289. .bind(this))
  17290. }
  17291. .bind(this)),
  17292. this.panos.forEach(function(e) {
  17293. e.build2()
  17294. }),
  17295. this.floors.forEach(function(e) {
  17296. this.boundingBox.union(e.boundingBox)
  17297. }
  17298. .bind(this)),
  17299. this.size = this.boundingBox.size(),
  17300. this.center = this.boundingBox.center(),
  17301. this.floors.forEach(function(e) {
  17302. O.info("Floor " + e + ": " + e.children.length + " chunks, " + e.panos.length + " panos.")
  17303. }
  17304. .bind(this)),
  17305. this.panos.populate_path_graph(),
  17306. this.skybox = new l(this.boundingBox),
  17307. this.skybox.matrixWorldNeedsUpdate = !0,
  17308. this.add(this.skybox);
  17309. setTimeout(function(){
  17310. this.hotsCount && this.shineHots();
  17311. }.bind(this),1300)//xzw 热点开始闪烁
  17312. for (var t in this.tags)
  17313. this.tags[t].build();
  17314. return O.debug("Done building model"),
  17315. v.raycastsDone > 0 && (O.warn("raycasts: " + v.raycastsDone),
  17316. O.warn("raycasts skipped: " + v.raycastsSkipped)),
  17317. this.buildRooms(),
  17318. this.labels.associateWithRooms(this.rooms),
  17319. $.when(this)
  17320. }
  17321. ,
  17322. n.prototype.loadLabels = function() {//xzw
  17323. this.labels = new x(this);
  17324. var e = $.Deferred();
  17325. if (!this.showingLabels)
  17326. return e.resolve();
  17327. // var t = this.options.urlBase + "/api/v1/jsonstore/model/labels/" + this.sid;
  17328. var t = "data/" + this.sid + "/labels.json";
  17329. return this.labels.load(t, !this.isPublic).done(e.resolve.bind(e)).fail(function() {
  17330. O.warn("Getting labels failed, not displaying labels."),
  17331. e.resolve()
  17332. }),
  17333. e
  17334. }
  17335. ,
  17336. n.prototype.buildRooms = function() {
  17337. this.rooms = new T(this),
  17338. this.rooms.createFromChunks(this.chunks),
  17339. this.rooms.calcRoomBoundaries()
  17340. }
  17341. ,
  17342. n.prototype.updateProjectedPanos = function() {
  17343. this.projectedPano0 && this.projectedPano1 && this.setProjectedPanos(this.projectedPano0, this.projectedPano1, !1)
  17344. }
  17345. ,
  17346. n.prototype.setProjectedPanos = function(e, t, i) {
  17347. void 0 !== i && null !== i || (i = !0),
  17348. i = !!i,
  17349. this.projectedPano0 = e,
  17350. this.projectedPano1 = t,
  17351. this.skybox.material.setProjectedPanos(e, t, i),
  17352. this.chunks.forEach(function(n) {
  17353. n.materialInside.setProjectedPanos(e, t, i)
  17354. })
  17355. }
  17356. ,
  17357. n.prototype.setSide = function(e) {
  17358. this.floors.forEach(function(t) {
  17359. t.collider.material.side = e
  17360. })
  17361. }
  17362. ,
  17363. n.prototype.heroCount = function() {
  17364. return this.heroLocations ? this.heroLocations.length : 0
  17365. }
  17366. ,
  17367. n.prototype.getHeroDescriptorByIndex = function(e) {
  17368. if (e < 0)
  17369. return O.warn("Model.getHeroDescriptorByHeroIndex() -> heroIndex is less than 0."),
  17370. null;
  17371. var t = this.heroCount();
  17372. if (t < 1)
  17373. return O.warn("Model.getHeroDescriptorByIndex() -> No hero locations in this model"),
  17374. null;
  17375. var i = this.heroLocations[e];
  17376. return void 0 === i ? (O.warn("Model.getHeroDescriptorByIndex() -> Index " + e + " is not a validindex"),
  17377. null) : i
  17378. }
  17379. ,
  17380. n.prototype.findPanoramicHero = function() {
  17381. for (var e in this.heroLocations)
  17382. if (this.heroLocations[e].cameraMode === c.PANORAMA)
  17383. return this.heroLocations[e];
  17384. return null
  17385. }
  17386. ,
  17387. n.prototype.listImagePanos = function() {
  17388. var e = []
  17389. , t = this;
  17390. return this.images.forEach(function(i) {
  17391. if (i.metadata && i.metadata.scan_id) {
  17392. var n = t.panos.get(i.metadata.scan_id);
  17393. n && (t.supportsTiles || n.isLoaded("high") || e.push(n))
  17394. }
  17395. }),
  17396. e
  17397. }
  17398. ,
  17399. n.prototype.fadePanoMarkers = function(e, t) {
  17400. this.panos.fadeMarkerOpacity(e, t)
  17401. }
  17402. ,
  17403. n.prototype.setSweepVisibility = function(e) {
  17404. this.panos.forEach(function(t) {
  17405. t.marker && (t.marker.visible = e)
  17406. })
  17407. }
  17408. ,
  17409. n.prototype.outsideAllowed = function() {
  17410. return this.supportedModes[c.DOLLHOUSE] && this.supportedModes[c.FLOORPLAN]
  17411. }
  17412. ,
  17413. t.exports = n
  17414. }
  17415. ).call(this, "/js/model/Model.js")
  17416. }
  17417. , {
  17418. "../constants": 8,
  17419. "../enum/AlignmentType": 17,
  17420. "../enum/RenderOrder": 42,
  17421. "../enum/Viewmode": 51,
  17422. "../exception/BasicException": 55,
  17423. "../label/Label": 90,
  17424. "../loaders/ModelLoader": 105,
  17425. "../loaders/ModelTextureLoader": 106,
  17426. "../loaders/SweepDataLoader": 107,
  17427. "../tag/tag": 123,
  17428. "../tag/tagManager": 124,
  17429. "../objects/BoundingTextureSkybox": 143,
  17430. "../objects/Chunk": 144,
  17431. "../objects/Floor": 146,
  17432. "../objects/Panorama": 148,
  17433. "../objects/Room": 150,
  17434. "../objects/Snapshot": 153,
  17435. "../settings": 166,
  17436. "../shaders": 167,
  17437. "../util/ModelUrls": 177,
  17438. "../util/PanoramaCollection": 178,
  17439. "../util/ajax": 181,
  17440. "../util/common": 185,
  17441. "../util/easing": 186,
  17442. "../util/lerp": 188,
  17443. "../util/logger": 189,
  17444. "../util/math": 190,
  17445. "../util/texture": 194,
  17446. "../util/transitions": 195,
  17447. "./../util/browser": 182,
  17448. "./../util/showcase": 193,
  17449. "./Chunks": 135,
  17450. "./FloorCollection": 136,
  17451. "./ImageCollection": 137,
  17452. "./LabelCollection": 138,
  17453. "./RoomCollection": 141,
  17454. events: 202,
  17455. three: 217,
  17456. "hot": "hot"
  17457. }],
  17458. 140: [function(e, t, i) {
  17459. "use strict";
  17460. function n() {
  17461. this.modelMap = {},
  17462. this.activeModel = null,
  17463. this.modelCount = 0,
  17464. this.tileDownloader = null,
  17465. this.panoRenderer = null
  17466. }
  17467. var r = (e("three"),
  17468. e("../util/common"))
  17469. , o = e("../exception/BasicException")
  17470. , a = e("../enum/ModelManagerEvents")
  17471. , s = e("../enum/PanoRendererEvents")
  17472. , l = e("events").EventEmitter;
  17473. n.prototype.init = function(e, t, i) {
  17474. this.tileDownloader = e,
  17475. this.panoRenderer = t,
  17476. this.qualityManager = i,
  17477. this.bindEvents()
  17478. }
  17479. ,
  17480. n.prototype.bindEvents = function() {
  17481. this.panoRenderer.on(s.TileRenderSuccess, this.onTileRendered.bind(this))
  17482. }
  17483. ,
  17484. n.prototype.onTileRendered = function(e, t, i, n) {}
  17485. ,
  17486. n.prototype.addModel = function(e) {
  17487. this.modelMap[e.sid] = e,
  17488. 0 === this.modelCount && this.activateModel(e.sid),
  17489. this.modelCount++,
  17490. this.emit(a.ModelAdded)
  17491. }
  17492. ,
  17493. n.prototype.getModel = function(e) {
  17494. return this.modelMap[e]
  17495. }
  17496. ,
  17497. n.prototype.activateModel = function(e) {
  17498. var t = this.modelMap[e];
  17499. if (!t)
  17500. throw new o("Tried to activate invalid model!");
  17501. var i = this.activeModel;
  17502. this.activeModel = t,
  17503. this.tileDownloader.setPanoData(t.panos, t.listImagePanos(), t.sid),
  17504. this.tileDownloader.setUrls(t.urls),
  17505. t.panos.forEach(function(e) {
  17506. e.attachToPanoRenderer(this.panoRenderer),
  17507. e.tileDownloader = this.tileDownloader,
  17508. e.qualityManager = this.qualityManager
  17509. }
  17510. .bind(this)),
  17511. this.emit(a.ActiveModelChanged, {
  17512. oldModel: i,
  17513. model: t
  17514. })
  17515. }
  17516. ,
  17517. n.prototype.getActiveModel = function() {
  17518. return this.activeModel
  17519. }
  17520. ,
  17521. r.extend(n, l),
  17522. t.exports = n
  17523. }
  17524. , {
  17525. "../enum/ModelManagerEvents": 33,
  17526. "../enum/PanoRendererEvents": 35,
  17527. "../exception/BasicException": 55,
  17528. "../util/common": 185,
  17529. events: 202,
  17530. three: 217
  17531. }],
  17532. 141: [function(e, t, i) {
  17533. (function(i) {
  17534. "use strict";
  17535. function n() {
  17536. s.call(this)
  17537. }
  17538. var r = e("../objects/Room")
  17539. , o = (e("../settings"),
  17540. e("../util/logger"))
  17541. , a = (e("../util/transitions"),
  17542. e("../util/easing"),
  17543. e("../util/common"))
  17544. , s = e("../util/IndexedCollection")
  17545. , l = e("./Chunks");
  17546. new o(i);
  17547. a.inherit(n, s),
  17548. n.prototype.getIndex = function(e) {
  17549. return e.roomId
  17550. }
  17551. ,
  17552. n.prototype.calcRoomBoundaries = function() {
  17553. this.forEach(function(e) {
  17554. e.calcBoundaries()
  17555. })
  17556. }
  17557. ,
  17558. n.prototype.createFromChunks = function(e) {
  17559. var t = {
  17560. floorId: -1,
  17561. roomId: -1
  17562. }
  17563. , i = {};
  17564. e.forEach(function(e) {
  17565. l.parseIdsFromChunkName(e.name, t);
  17566. var o = i[t.roomId];
  17567. if (!o) {
  17568. var a = n.generateRoomId(t.floorId, t.roomId);
  17569. o = new r(t.floorId,a),
  17570. this.add(o),
  17571. i[t.roomId] = o
  17572. }
  17573. o.addChunk(e)
  17574. }
  17575. .bind(this)),
  17576. this.calcRoomBoundaries()
  17577. }
  17578. ,
  17579. n.generateRoomId = function(e, t) {
  17580. return e + "_" + t
  17581. }
  17582. ,
  17583. t.exports = n
  17584. }
  17585. ).call(this, "/js/model/RoomCollection.js")
  17586. }
  17587. , {
  17588. "../objects/Room": 150,
  17589. "../settings": 166,
  17590. "../util/IndexedCollection": 175,
  17591. "../util/common": 185,
  17592. "../util/easing": 186,
  17593. "../util/logger": 189,
  17594. "../util/transitions": 195,
  17595. "./Chunks": 135
  17596. }],
  17597. 142: [function(e, t, i) {
  17598. "use strict";
  17599. function n(e, t, i) {
  17600. e = e.clone();
  17601. var n = e.size()
  17602. , o = new r.BoxGeometry(n.x,n.y,n.z);
  17603. o.boundingBox = e,
  17604. r.Mesh.call(this, o, t),
  17605. this.position.copy(e.center()),
  17606. this.frustumCulled = !1,
  17607. i && this.add(new r.WireframeHelper(this))
  17608. }
  17609. var r = e("three");
  17610. n.prototype = Object.create(r.Mesh.prototype),
  17611. n.prototype.constructor = n,
  17612. t.exports = n
  17613. }
  17614. , {
  17615. three: 217
  17616. }],
  17617. 143: [function(e, t, i) {
  17618. (function(i) {
  17619. "use strict";
  17620. function n(e) {
  17621. h.time("Computing a nice bounding cubemap");
  17622. var t = new a({
  17623. side: r.BackSide,
  17624. transparent: !0
  17625. });
  17626. t.uniforms.modelAlpha.value = 0,
  17627. t.uniforms.opacity.value = 1 - s.modelAlpha,
  17628. this.renderOrder = l.boundingSkybox,
  17629. o.call(this, e, t),
  17630. h.timeEnd("Computing a nice bounding cubemap")
  17631. }
  17632. var r = e("three")
  17633. , o = (e("../enum/Viewmode"),
  17634. e("../shaders"),
  17635. e("./BoundingMesh"))
  17636. , a = e("../materials/ModelTextureMaterial")
  17637. , s = e("../settings")
  17638. , l = e("../enum/RenderOrder")
  17639. , c = e("../util/logger")
  17640. , h = new c(i);
  17641. n.prototype = Object.create(o.prototype),
  17642. n.prototype.constructor = n,
  17643. t.exports = n
  17644. }
  17645. ).call(this, "/js/objects/BoundingTextureSkybox.js")
  17646. }
  17647. , {
  17648. "../enum/RenderOrder": 42,
  17649. "../enum/Viewmode": 51,
  17650. "../materials/ModelTextureMaterial": 118,
  17651. "../settings": 166,
  17652. "../shaders": 167,
  17653. "../util/logger": 189,
  17654. "./BoundingMesh": 142,
  17655. three: 217
  17656. }],
  17657. 144: [function(e, t, i) {
  17658. "use strict";
  17659. function n(e) {
  17660. this.materialInside = new s({
  17661. side: r.DoubleSide
  17662. });
  17663. var t = r.UniformsUtils.clone(o.modelOutside.uniforms);
  17664. this.materialOutside = new r.RawShaderMaterial({
  17665. fragmentShader: o.modelOutside.fragmentShader,
  17666. vertexShader: o.modelOutside.vertexShader,
  17667. uniforms: t,
  17668. side: r.FrontSide,
  17669. name: "chunkOut"
  17670. }),
  17671. r.Mesh.call(this, e.geometry, this.materialInside),
  17672. this.name = e.name || "",
  17673. this.textureName = e.textureName,
  17674. this.meshUrl = e.meshUrl
  17675. }
  17676. var r = e("three")
  17677. , o = e("../shaders")
  17678. , a = e("../enum/Viewmode")
  17679. , s = e("../materials/ModelTextureMaterial");
  17680. n.prototype = Object.create(r.Mesh.prototype),
  17681. n.prototype.setTextureMap = function(e) {
  17682. this.materialInside.uniforms.map.value = e,
  17683. this.materialOutside.uniforms.map.value = e
  17684. }
  17685. ,
  17686. n.prototype.setMode = function(e) {
  17687. var t = e === a.DOLLHOUSE || e === a.FLOORPLAN ? this.materialOutside : this.materialInside;
  17688. t.side = e === a.PANORAMA ? r.DoubleSide : r.FrontSide,
  17689. t.transparent = this.material.transparent,
  17690. t.uniforms.opacity.value = this.material.uniforms.opacity.value,
  17691. this.material = t
  17692. }
  17693. ,
  17694. t.exports = n
  17695. }
  17696. , {
  17697. "../enum/Viewmode": 51,
  17698. "../materials/ModelTextureMaterial": 118,
  17699. "../shaders": 167,
  17700. three: 217
  17701. }],
  17702. 145: [function(e, t, i) {
  17703. "use strict";
  17704. function n(e) {
  17705. this.chunksize = e || 10,
  17706. this.chunks = {},
  17707. this.boundingBoxes = {},
  17708. this.children = [],
  17709. this.offset = new r.Vector3(0,.5,0),
  17710. this.material = new r.MeshBasicMaterial({
  17711. color: 16777215 * Math.random(),
  17712. side: r.DoubleSide
  17713. })
  17714. }
  17715. var r = e("three");
  17716. e("../enum/Viewmode");
  17717. n.prototype.add = function(e) {
  17718. var t, i, n, o, a, s, l, c, h, u, d, p, f, g, m = e.attributes;
  17719. m ? (t = m.position.array,
  17720. i = void 0 !== e.index ? e.index.array : void 0) : (t = e.vertices,
  17721. n = e.faces);
  17722. var v = new r.Vector3;
  17723. if (i)
  17724. for (o = 0,
  17725. a = i.length; o < a; o += 3) {
  17726. var A = 3 * i[o]
  17727. , y = 3 * i[o + 1]
  17728. , C = 3 * i[o + 2];
  17729. s = (t[A] + t[y] + t[C]) / 3,
  17730. l = (t[A + 1] + t[y + 1] + t[C + 1]) / 3,
  17731. c = (t[A + 2] + t[y + 2] + t[C + 2]) / 3,
  17732. h = Math.floor(s / this.chunksize),
  17733. u = Math.floor(l / this.chunksize),
  17734. d = Math.floor(c / this.chunksize),
  17735. p = h + "." + u + "." + d,
  17736. p in this.chunks ? (g = this.chunks[p],
  17737. f = this.boundingBoxes[p]) : (g = this.chunks[p] = [],
  17738. f = this.boundingBoxes[p] = new r.Box3),
  17739. g.push(t[A], t[A + 1], t[A + 2], t[y], t[y + 1], t[y + 2], t[C], t[C + 1], t[C + 2]),
  17740. f.expandByPoint(v.set(t[A], t[A + 1], t[A + 2])),
  17741. f.expandByPoint(v.set(t[y], t[y + 1], t[y + 2])),
  17742. f.expandByPoint(v.set(t[C], t[C + 1], t[C + 2]))
  17743. }
  17744. else
  17745. for (o = 0,
  17746. a = t.length; o < a; o += 9)
  17747. s = (t[o] + t[o + 3] + t[o + 6]) / 3,
  17748. l = (t[o + 1] + t[o + 4] + t[o + 7]) / 3,
  17749. c = (t[o + 2] + t[o + 5] + t[o + 8]) / 3,
  17750. h = Math.floor(s / this.chunksize),
  17751. u = Math.floor(l / this.chunksize),
  17752. d = Math.floor(c / this.chunksize),
  17753. p = h + "." + u + "." + d,
  17754. p in this.chunks ? (g = this.chunks[p],
  17755. f = this.boundingBoxes[p]) : (g = this.chunks[p] = [],
  17756. f = this.boundingBoxes[p] = new r.Box3),
  17757. g.push(t[o], t[o + 1], t[o + 2], t[o + 3], t[o + 4], t[o + 5], t[o + 6], t[o + 7], t[o + 8]),
  17758. f.expandByPoint(v.set(t[o], t[o + 1], t[o + 2])),
  17759. f.expandByPoint(v.set(t[o + 3], t[o + 4], t[o + 5])),
  17760. f.expandByPoint(v.set(t[o + 6], t[o + 7], t[o + 8]))
  17761. }
  17762. ,
  17763. n.prototype.build = function() {
  17764. var e = new r.Object3D;
  17765. e.material = this.material;
  17766. for (var t in this.chunks) {
  17767. var i = this.chunks[t]
  17768. , n = new r.BufferGeometry;
  17769. n.addAttribute("position", new r.BufferAttribute(new Float32Array(i),3)),
  17770. n.boundingBox = this.boundingBoxes[t];
  17771. var o = new r.Mesh(n,this.material);
  17772. o.material.visible = !1,
  17773. e.add(o),
  17774. this.chunks[t] = []
  17775. }
  17776. return e
  17777. }
  17778. ,
  17779. t.exports = n
  17780. }
  17781. , {
  17782. "../enum/Viewmode": 51,
  17783. three: 217
  17784. }],
  17785. 146: [function(e, t, i) {
  17786. "use strict";
  17787. function n(e, t, i) {
  17788. r.Object3D.call(this),
  17789. this.model = e,
  17790. this.floorIndex = t,
  17791. this.name = i || d.FLOOR_NAME + (t + 1),
  17792. this.panos = [],
  17793. this.chunks = [],
  17794. this.colliderBuilder = new l(3),
  17795. this.collider = null,
  17796. this.center = null,
  17797. this.boundingBox = new r.Box3,
  17798. this.size = null,
  17799. this.hidden = !1,
  17800. this.conservativeBoundingBox = new r.Box3,
  17801. this.debugColor = 16777215 * Math.random(),
  17802. this.transition = null
  17803. }
  17804. var r = e("three")
  17805. , o = e("../settings")
  17806. , a = e("../util/common")
  17807. , s = e("../util/lerp")
  17808. , l = e("./ChunkedCollider")
  17809. , c = e("../util/transitions")
  17810. , h = e("../util/easing")
  17811. , u = (e("../objects/Panorama"),
  17812. e("../enum/RenderOrder"))
  17813. , d = e("../localization/localize");
  17814. n.prototype = Object.create(r.Object3D.prototype),
  17815. n.prototype.enter = function(e) {
  17816. this.model.setFloor(this, e)
  17817. }
  17818. ,
  17819. n.prototype.hide = function(e) {
  17820. if (!this.hidden || this.transition) {
  17821. this.chunks.forEach(function(e) {
  17822. e.material.transparent = !0
  17823. }),
  17824. c.cancel(this.transition);
  17825. var t = e ? 0 : o.hideFloorDuration + o.hideFloorDelay
  17826. , i = e ? 0 : o.hideFloorDelay / t;
  17827. this.transition = c.start(s.allUniforms(this.chunks, "opacity", .08), t, function() {
  17828. this.hidden = !0
  17829. }
  17830. .bind(this), i, h.easeInOutQuad)
  17831. }
  17832. }
  17833. ,
  17834. n.prototype.show = function(e) {
  17835. if (this.hidden || this.transition) {
  17836. this.hidden = !1,
  17837. c.cancel(this.transition);
  17838. var t = e ? o.showFloorDuration : o.showFloorDuration + o.showFloorDelay
  17839. , i = e ? 0 : o.showFloorDelay / t;
  17840. this.transition = c.start(s.allUniforms(this.chunks, "opacity", 1), t, function() {
  17841. this.hidden || this.chunks.forEach(function(e) {
  17842. e.material.transparent = !1
  17843. })
  17844. }
  17845. .bind(this), i, h.easeInOutQuad)
  17846. }
  17847. }
  17848. ,
  17849. n.prototype.toggle = function(e, t) {
  17850. e = void 0 === e ? this.hidden : e,
  17851. e ? this.show(t) : this.hide(t)
  17852. }
  17853. ,
  17854. n.prototype.containsPoint = function(e) {
  17855. return this.collider.children.some(function(t) {
  17856. return t.geometry.boundingBox || t.geometry.computeBoundingBox(),
  17857. t.geometry.boundingBox.containsPoint(e)
  17858. })
  17859. }
  17860. ,
  17861. n.prototype.distanceToPoint = function(e) {
  17862. var t = null
  17863. , i = 1 / 0;
  17864. return this.collider.children.forEach(function(n) {
  17865. n.geometry.boundingBox || n.geometry.computeBoundingBox();
  17866. var r = n.geometry.boundingBox.distanceToPoint(e);
  17867. (!t || i > r) && (i = r,
  17868. t = n)
  17869. }),
  17870. i
  17871. }
  17872. ,
  17873. n.prototype.addChunk = function(e) {
  17874. e.renderOrder = u.ghostFloor,
  17875. this.add(e),
  17876. this.chunks.push(e),
  17877. this.boundingBox.union(e.geometry.boundingBox),
  17878. this.size = this.boundingBox.size(),
  17879. this.colliderBuilder.add(e.geometry)
  17880. }
  17881. ,
  17882. n.prototype.addPano = function(e) {
  17883. this.panos.push(e),
  17884. this.add(e.skyboxMesh),
  17885. e.marker && this.add(e.marker);
  17886. var t = new r.Vector3(1,1,1)
  17887. , i = (new r.Box3).setFromCenterAndSize(e.position, t);
  17888. this.boundingBox.union(i)
  17889. }
  17890. ,
  17891. n.prototype.build = function() {
  17892. this.collider = this.colliderBuilder.build(!0),
  17893. this.add(this.collider),
  17894. this.center = this.boundingBox.center(),
  17895. this.conservativeBoundingBox.copy(this.boundingBox),
  17896. this.conservativeBoundingBox.min.y = a.lowerMedian(this.collider.children.map(function(e) {
  17897. return e.geometry.boundingBox.min.y
  17898. }), 5),
  17899. this.conservativeBoundingBox.max.y = a.lowerMedian(this.collider.children.map(function(e) {
  17900. return e.geometry.boundingBox.max.y
  17901. }), 5),
  17902. this.colliderBuilder = null
  17903. }
  17904. ,
  17905. n.prototype.toShortString = function() {
  17906. return a.nth(this.floorIndex + 1)
  17907. }
  17908. ,
  17909. n.prototype.toString = function() {
  17910. return this.name
  17911. }
  17912. ,
  17913. t.exports = n
  17914. }
  17915. , {
  17916. "../enum/RenderOrder": 42,
  17917. "../localization/localize": 108,
  17918. "../objects/Panorama": 148,
  17919. "../settings": 166,
  17920. "../util/common": 185,
  17921. "../util/easing": 186,
  17922. "../util/lerp": 188,
  17923. "../util/transitions": 195,
  17924. "./ChunkedCollider": 145,
  17925. three: 217
  17926. }],
  17927. 147: [function(e, t, i) {
  17928. "use strict";
  17929. function n(e) {
  17930. this.player = e,
  17931. this.obj3d = null,
  17932. this.UP = new r.Vector3(0,1,0)
  17933. }
  17934. var r = e("three")
  17935. , o = e("../settings");
  17936. n.prototype.prefs = {
  17937. linewidth: 3,
  17938. height: .07,
  17939. opacity: .45,
  17940. endScale: .05
  17941. },
  17942. n.prototype.discard = function() {
  17943. if (this.obj3d) {
  17944. var e = this.obj3d.parent;
  17945. e && e.remove(this.obj3d)
  17946. }
  17947. this.obj3d = null
  17948. }
  17949. ,
  17950. n.prototype.draw = function() {
  17951. if (this.discard(),
  17952. o.showNeighbors) {
  17953. var e = this.player.currentPano.floor;
  17954. this.obj3d = new r.Object3D;
  17955. var t = this.player.model.panos.getNeighbours(this.player.currentPano)
  17956. , i = this.player.currentPano.floorPosition.clone().sub(this.player.model.position);
  17957. i.y += this.prefs.height;
  17958. var n = .1525
  17959. , a = .127
  17960. , s = .0127
  17961. , l = .1
  17962. , c = .19
  17963. , h = .2032
  17964. , u = .2286
  17965. , d = .255
  17966. , p = new r.Matrix4;
  17967. for (var f in t)
  17968. if (t[f]) {
  17969. var g = this.player.model.panos.get(f)
  17970. , m = (g.position.clone().sub(this.player.model.position),
  17971. g.position.clone().sub(g.floorPosition))
  17972. , v = g.floorPosition.clone().sub(this.player.model.position);
  17973. v.y += this.prefs.height;
  17974. var A = new r.Geometry;
  17975. A.vertices.push(new r.Vector3(0,-s,0), new r.Vector3(-s,0,0), new r.Vector3(0,s,0), new r.Vector3(s,0,0), new r.Vector3(0,-s,0)),
  17976. A.vertices.push(new r.Vector3(0,-d,0), new r.Vector3(d,-d,0), new r.Vector3(d,n,0), new r.Vector3(-n,n,0), new r.Vector3(-n,a,0), new r.Vector3(-c,l,0), new r.Vector3(-c,-h,0), new r.Vector3(-n,-u,0), new r.Vector3(-n,-d,0), new r.Vector3(0,-d,0)),
  17977. p.identity().setPosition(m),
  17978. A.applyMatrix(p),
  17979. A.vertices.push(new r.Vector3(0,-this.prefs.endScale,0)),
  17980. A.vertices.push(new r.Vector3(-this.prefs.endScale,-this.prefs.endScale,0), new r.Vector3(-this.prefs.endScale,this.prefs.endScale,0), new r.Vector3(this.prefs.endScale,this.prefs.endScale,0), new r.Vector3(this.prefs.endScale,-this.prefs.endScale,0)),
  17981. p.lookAt(v, i, this.UP).setPosition(v),
  17982. A.applyMatrix(p),
  17983. A.vertices.push(v, i);
  17984. var y = new r.Line(A,new r.LineBasicMaterial({
  17985. color: g.debugColor.getHex(),
  17986. transparent: !0,
  17987. opacity: this.prefs.opacity,
  17988. depthWrite: !1,
  17989. name: "sLine" + f,
  17990. linewidth: this.prefs.linewidth
  17991. }));
  17992. this.obj3d.add(y)
  17993. }
  17994. e.add(this.obj3d)
  17995. }
  17996. }
  17997. ,
  17998. n.prototype.update = function() {
  17999. o.showNeighbors && this.obj3d && this.obj3d.updateMatrixWorld()
  18000. }
  18001. ,
  18002. t.exports = n
  18003. }
  18004. , {
  18005. "../settings": 166,
  18006. three: 217
  18007. }],
  18008. 148: [function(e, t, i) {
  18009. (function(i) {
  18010. "use strict";
  18011. function n(e, t, i, n) {
  18012. this.model = e,
  18013. this.id = t,
  18014. this.alignmentType = i.alignmentType || l.ALIGNED,
  18015. this.neighbourUUIDs = i.neighbours || null,
  18016. this.neighbourPanos = null,
  18017. this.floor = null,
  18018. this.floorIndex = i.floor,
  18019. this.failedLoadingAt = 0,
  18020. this.maxLoadRetries = 4,
  18021. this.origin = i.position.clone(),
  18022. this.position = this.alignmentType === l.UNALIGNED ? new r.Vector3(0,-5,0) : i.position.clone(),
  18023. this.quaternion = i.quaternion.clone(),
  18024. this.skyboxMesh = new r.Mesh(E),
  18025. this.skyboxMesh.position.copy(this.position),
  18026. this.skyboxMesh.quaternion.copy(this.quaternion),
  18027. this.skyboxMesh.name = "skybox",
  18028. this.skyboxMesh.visible = !1,
  18029. this.skyboxMesh.updateMatrix(),
  18030. this.skyboxMesh.updateMatrixWorld(),
  18031. this.marker = null,
  18032. this.isAligned() && (this.marker = new r.Mesh(b,new r.MeshBasicMaterial({
  18033. map: w,
  18034. side: r.DoubleSide,
  18035. opacity: 0,
  18036. transparent: !0,
  18037. depthWrite: !1
  18038. })),
  18039. this.marker.renderOrder = s.panoMarker,
  18040. this.marker.name = "marker",
  18041. this.marker.pano = this,
  18042. this.marker.layers.set(v.PANOMARKERS),
  18043. this.marker.updateMatrixWorld(),
  18044. a.colorMarkerOnLoad && this.on("load", function() {
  18045. this.marker.material.color.set(65280)
  18046. })),
  18047. this.debugColor = (new r.Color).setHSL(.06 + .53 * Math.random(), .8 + .2 * Math.random(), .5 + .2 * Math.random()),
  18048. this.floorPosition = i.puck ? i.puck.clone() : null,
  18049. this.tiled = n,
  18050. this.tiled ? this.solidSkybox = null : (this.solidSkybox = new r.Texture([null, null, null, null, null, null]),
  18051. this.solidSkybox.flipY = !1,
  18052. a.minimalMemoryMode && (this.solidSkybox.minFilter = r.LinearFilter,
  18053. this.solidSkybox.magFilter = r.LinearFilter,
  18054. this.solidSkybox.generateMipmaps = !1)),
  18055. this.zoomed = !1,
  18056. this.panoRenderer = null,
  18057. this.qualityManager = null,
  18058. this.tileDownloader = null,
  18059. this.tiledPanoRenderTarget = null,
  18060. this.minimumTiledPanoLoaded = !1,
  18061. this.highestPartialTileRenderOpCompleted = 0,
  18062. this.highestFullTileRenderOpCompleted = 0,
  18063. this.shouldRedrawOnBaseLoaded = !1,
  18064. this.lockUntilRenderingComplete = !1,
  18065. a.colorMarkerOnLoad && this.on("load", function() {
  18066. this.marker.material.color.set(65280)
  18067. })
  18068. }
  18069. var r = e("three")
  18070. , o = e("../util/logger")
  18071. , a = e("../settings")
  18072. , s = (e("../enum/Viewmode"),
  18073. e("../enum/RenderOrder"))
  18074. , l = e("../enum/AlignmentType")
  18075. , c = (e("../util/common"),
  18076. e("../util/transitions"))
  18077. , h = e("../util/lerp")
  18078. , u = e("../util/ajax")
  18079. , d = e("../util/texture")
  18080. , p = e("../util/panorama")
  18081. , f = (e("../enum/TileDownloaderEvents"),
  18082. e("../enum/PanoramaEvents"))
  18083. , g = e("../enum/PanoRendererEvents")
  18084. , m = e("../enum/PanoSizeClass")
  18085. , v = e("../enum/RenderLayers")
  18086. , A = (e("../scene/SceneRenderer"),
  18087. e("../enum/GLCubeFaces"),
  18088. e("../exception/BasicException"))
  18089. , y = e("../tile/TileUtils")
  18090. , C = e("events").EventEmitter
  18091. , I = new o(i)
  18092. , E = new r.SphereBufferGeometry(.1)
  18093. , b = new r.PlaneBufferGeometry(.4,.4,1,1)
  18094. , w = d.loadBase64("iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAAAXNSR0IArs4c6QAAIIRJREFUeAHtnQvsXVWVxnnKG8qjFCiPtjA8Qh3COyTgpIOgECQDwmAI+ByMCiNqJDpRY4ya0cGoICiB+MQhIA8JElAeaRxISAuFMJRAkUIpFCjlUYZnodD5fWXfet/3nHvPY6991krW/9z/uefss/a31vruPnvvs89667k4Ao6AI+AIOAKOgCPgCDgCjkCDEFi/QXVNsqpr1qzZkIpti+4QtluylW4RtPX5ffyvYzfqUv5db3WXvsP/b6Gvoa+Gbeuz/n8JfV7b9ddfX8e6GEXACcCI40j07TB1OrorOg3dHlXST0E3QOuQd7noSlRk8AK6HH0KXQYxvMjWJXIEnAAidBDJvhNm7YnujirhlfiboZbkDYxdhooQlqKLIYVn2bpEhIATQM3OINnVJJ+BKuFbqmZ7iqLbh8VtugRS0O2HS00IOAHUADxJP5XL7o/ORvdBdX/eRFE/wyJ0IfogZLCiiSDUWWcngArQJ+GFsxL9AFSJr3t4l14E1IfwIHo/ughCWNN7iO8pEgEngCLRbCsrJP0/sOsQ9CB0q7av/eNoBF7hkHvRe9C/ORmMBmycI5wAxkFtyDkk/h58fQSqpN9myKH+VXYEXuZQkcFdEMET2U/zI0ch4AQwCqEM35P06qE/HD0S3S3DKX7I+Ag8yal3ovMgA400uEyAgBPABOCR+HtxupL+YLSpHXkTIDjRqepAXIDeCRE8OlFJDT7ZCSCn88O9vRL+GHRGztP98HIQWEKxt6ILvK8gH8BOABnxIvE34VD92h+NahaeS3wIaDbi7ahaBaviMy8+i5wARvgk3N/r134OuvmIw/3rOBB4HTPmord6P8FwhzgBDMAn/OJ/kK+V/Nam4Q6oVeN2q5NQtwa3eYugv++dALpwIfHVmadf+2PRVKfkdtU6+X81BfkWdC5EoM5Dl4CAE0AAgsQXFhq/PwndOuz2TVoIaD7B9ajmE/gsQ4BwAgAEkl/DeaehevrOJX0E9HTiVZBA44cPG00AJL6esf8oqum6Ls1DQNOMr4UIGrt2QSMJgMTXAhrq3DsB9Qk8gNBgUZ/AjahGDLTASaOkcQRA8quZfybqzf1GhfrIyuq24HJIQNvGSGMIgMTfGK9+BNUvv1oALo5ANwJqAWjY8E8QwdvdX6b4fyMIgOSfifM+g2ohDhdHYBQCWpjkl5DA46MOtP598gRA8mvqrjr6NrTuLLe/UgTe4WrqINTU4mQlWQIg8TVt95OoVuFxcQTGRUCrE/0GItD04uQkSQIg+WfhqbNQDfO5OAKTIqBhwktTvCVIjgBIfnXyaTafN/knDXs/vx0B3RL8ERJQJ2EykgwBkPhb4JVPoe9PxjtekRgReACjfg0R6E1J5iUJAvAmv/k4tFYB3RJcBgk8Zs3wbnvNEwDJr0d2T0a9yd/tXf+/TAR0S3AdJHBbmRcpu2zTBEDynwpAIgAXR6AuBLTWwNV1XXzS65okABJfv/afQLUSr4sjUDcC8zDgtxCBWgWmxBwBkPx6eOdzqN6w4+IIxIKA3mh0CSRgasERUwRA8qun/9/RmbF43e1wBNoQ0NThn0ECZkYIzBAAya9JPeeienW2iyMQKwJ6BfoFkICJNQZMEADJvwugfhHdNlavu12OQBsCL/H5Qkjg6bZ9UX6MngBI/j1B7mxUzX8XR8AKAroNuBgSWByzwVETAMmvjj51+PmqPTFHkds2CAF1CKpjUB2EUUq0C2OEX35P/ijDxo3KiMDaEasQyxlPqfawKAkAwHTPr2a///JXGw9+teIRUAyfTUzvXHzRk5cYHQEAlHr71eHn9/yT+9dLiAMBxfK5IbbjsChYERUBANBaoLDNe/ujChM3pgAEFNMigah+2KLpBAQYNZW+gs4sAGwvohcBLXL5Zpvq7bn6X7Ipqrcfa9tSLaLqUjwCmiz0YzoGo5gxGAUBkPya2382un/xeDeixDXUUhNPlqPPtm1X8FlLWa0i4LTibWbBJ2odihS0tNpUVBOwprVtdasWRfxghzXRqICGCGt/diAKBxJsnwYQf7AnWxgr2Zehi1CNMSvhnyOYKl3GGp+phbAjKmLQXI190OloFDGFHbHLPHz2q7qNrN1ZBNKpgOCP9A6PBP2yP4wq6RcROHrbbXSCL/U2ZRGBdF9ULQaXwQjU/ihxrQRAwCjxRQAunQioabgQXYAq4Vd2fm3jP/w7BUtFBgejs1Hd6rl0InA1/q1tUZHaCIDgmAUOX0U9KP4eEEv4qGfL58f6K/93U/N9Cq2DwzhLt3oz8p2d9NEi+x/h71qWF6uFAAgGDYV8E1VHUtNFnXfzUb2zXvfzyQv+V7/BEagIwWPgvQ7c7+H/16p2fl0EcA4VbfrqvY+Awc3oQzheHXuNE4hA8bcfehy6d+MA6KzwA8TBRZ27yv+vcgLA6cdSLb2qq6mie/ubcLZ68F0CAsSFRhKOR9VX0FTRq8huqbLylRIATm7qfb9+4e9Db8bBS6t0sLVrESO7Y7NaBAeilcZnBFhV3h9QGcA4VhNKvoU26Z5PiX83ql/8Z9i6ZESAeNmZQ9UiOBStLE4zmlfmYeoT+i7xoglcpUtlwOLQL1CbJr2o80nqewWOrKV3t/TIqegCxI1ajaeju1V0yRgucz9x8/MqDKmEAHBik8b738BxN6BzcWIjO/eKDlziR3E6Bz0R3azo8iMtr5L5AaUTAM6bCcDnoU0Y759PPa8h8V+ONKhMm0UsbUMFTkE1fJi6qD/gfGLp8TIrWioB4DDNF/82OrXMSkRQtsbv1dzXVF2XkhEgrjS7ULcFmk+Qsuhhru8QV6U951E2AZxMBT6Usoeo2x3olThpdeL1jKp64cflNIw6KirDijfmL8TWdcUX+16JpREADtJwzn+gG5RlfM3lvsn1f49z1MvvUhMCxJlGCc5AN63JhLIv+y4X+E/irJTh41KSE6eo3DPRUsovG/EM5auH//ue/BmQKvmQ4IPvcxn5JEVZm0shpwqvX1kJegyWqgWQovwPlfoBgfdcipWzWKfgix9gu3yToiiXlFOFS+EEAFNpos8JhVtaf4GrMOEygu2/Ub/fr98fHRbIJ/KNfITKV6nJCSG3Cq1X4QSAdZrnr/X9UpJXqcxPCLB7UqpUinUJPvoJdZPPUhLlVOHP0BRKADDUXhh5SEqoUxdNzSx9PDYxzGqtDiSgsfPzUfkuJTkk5FhhdSqMADBMIwoalklJnqYyPySgGvGcfkqOCz77IXWSD1OS00KuFVKnwggAa45AU+r4e5T66Jff5HJchUSH8UKC79QSkC9TEeWYcq0QKYQAYCTdn5xUiEVxFPK/mPFTAqiSJ7LiqHKaVgQf/pTayaepyEkh5yauTyEEgBX/jG49sTVxFKBA+QWBU9r0yziq2Rwrgi9/QY1TIQHl2pwiPDgxAcBEm2BIKWOURVQwZxlqKl5KwLyb8zw/PHIEgk8vxcxUbgeODbk3EfITEwBX16O+W05kRRwnq7NIb2vxX/44/FG4FcG3F1NwCh2Dyjnl3kQyEQHAQHo2O4Vffw0XXUCA+D3/ROEU/8nBxxdgaQpDhMeEHBwb+IkIgKsq+a0v0KAJI0p+7+0fO4xsnRh8LRKwPllo4h/gsQkg3H8U0hFRY/hoyuhFBISP89fohDouHXx+Ede2Pm14ziR9AWMTAMAdiW5eh/MKvObvCIRSV1wp0FYvqmAEgu9/V3CxVRenHFQujiVjEQCMo1l/R491xXhO+isB4HP74/FHLZaEGPhrLRcv7qJHh5zMXeJYBMBV9LLH7XNfLZ4T9Oz4H+Ixxy2pGQHFguX1BJSLysncMi4BWO7510o+GutfnRstPyFJBEIsaI6AYsOqjJWTuQmApoae+JthFSXs1jJezxm2300vAYEQE78voeiqipwRcjPX9XITAKVbXoTxDhzta/jlCpHmHBxi4w7DNc6dm7kIAIbRuONBRgHSUN+VRm13s6tDQDFidVj4oJCjmdHKRQCUejiqJ/8sitbt9/t+i56r0OYQI1dUeMkiL6XcVI5mlrwEMPZ4Y2aLyjlwPo5dVE7RXmpqCIRYmW+0XrlyNDMB0LTYA0B2MwjKG9h8jUG73eR6EVDMKHasyW4hVzPZnZkAKK2wVUgyWVbcQTfA6P6uvuLwbERJIWZuMFrZzLmaiQBgFM38s9j5p8kdc4060c2uHwHFjsUJQuoMVM6OlEwEQCl7o3ozqyVZg7Hq+NPWxRHIjUCIHXUIWosh5apydqRkJYCxphmOvHq5B9yNAx8r9xJeeuoIhBiyOHckU86OJACjzX8x9k2pB6fXrzIEFEvWWgGZbgNGEgAV17vYt6oM6mIudB/M/UwxRXkpTUcgxNJ9xnBQzip3h0oWAjhgaAlxfnlznGa5VYYRsBhTI3M3CwHsb8xpC2HspcZsdnMjRyDE1MLIzew2b2TuDiUA7v+nUuK07lIj/9/v/SN3kGHzrMXWtJDDAyEfSgCcNZJBBpZczxeLYOrF9Vzar5o6AiG2HjFWz6E5PIoAZhur7J+N2evm2kPAWl/A0BweSAA0HTbCNyN7ESPyn9Z5fygie9yUNBFQjFl6p8A+IZf7emMgAXD0DFSPF1oRPfFnbazWCrZuZ0AgxJilJwWVwzMGOXAYAew56KRI998VqV1uVnoIWIu1gbmcCgEsgZmtruKSXnokXqMQa0sMVTN5AphnyBluahoIWIq5fARAp8FO+GhLI356Bzst3ZMZgdXNHIGAYk6xZ0G2DDndY+ugW4CBjNFTQv07NPPP+kse60fRLciFQIg5SzMD++b0IALYPRca9R68oN7L+9UbjICl2Oub04MIYFdDTvXFPg05KzFTLcVe35weRADTjTjqWZpiK43Y6mYmhkCIPSujT31zuocA6CzYDj/pBSAWxBIDW8DTbcyPgJUY3CzkdkcNewiAb/syRcdZ8fxjBfx4EHNLikbAUgz25HY/Auh7r1A0agWUp2m/lsAvoMpeRIQIKAatTEHvye1+BGDl+f9lPvwXYTo0zKQQg8uMVLsnt/sRwPZGKvOwETvdzPQRsBKLPbndjwB2MOIvX/LbiKMaYKaVWOzJ7Q4CoJdwQ5w1xYjDrAy/GIHTzZwAASuxOCXk+LqqdhAAe7dFu/etOziiD+p0eS4ie9yUZiOgWLTQEajcVo6vk+5k72kirDsyrg8v0vnydlwmuTVNRSDEopVVgjpyvJsAOtghYocuj9g2N62ZCFiJyY4c7yYAK48AW7nnamYqNLPWVmKyI8etEoAVtm1mKjSz1lZicigBbGHEd1bY1gicbmYBCFiJyY4ct9oCWFGAw7wIR6BIBKzEZBItgNeL9JyX5QgUgICVmEyiBfBmAQ7zIhyBIhFYVWRhJZY1lAA2LvHCRRX9FuOuFiZdFFVfL8cAAsTku5j5lgFTO172090HoNeBxS7+6x+7h5prn4XY7MjxbgLQswCxi5WmVuw4un3FI2AhNjtyvJsAOtiheHwKKdECyxZSUS/EHAIWYrMjxy0SgAWWNRe5bnAhCFiITfMEYIFlC4kmL8QcAhZicygBmEPcDXYEHIHxEei+BVg9flGVnblpZVfyCzkC+RCwEJsdOW6RADbJ5xM/2hGoDAELsWmeACywbGUR5xeKCgELsekEEFXIuDEpIWCeACy879wCyCkFtdclOwIWYrMjx7v7ACzMZd6YlU277c7uIj/SESgBgRCTJp6laa9+dyK91v5lxJ8tdLZEDJ+bVgICVmKyI8etEsDmJTjQi3QEJkHASky+2l7JbgLo+LL9wMg+T43MHjfHEbASk0m0AHbyeHMEIkPASkwOJQArLYCet5xGFgxuTvMQsBKTHTlu9RbACts2Lw2aW2MrMTmUAF4y4j8rbGsETjezAASsxGRHjne3AJ4vAIgqitiOcVcLY65VYOHXqBmBEIvb1WxG1st35Hg3AYgdtLhh7LI+Bu4Yu5FuX2MQUCwqJmMX5fbgFgArm2qa4MrYaxHss3LPZQRON3MCBKzE4sqQ4+uq2t0C0BcdTYR1R8b3YVZ8JrlFDUVgTyP17sntfgTwgpHK7GvETjczfQT2MVLFntzuRwBW3nI6nc6XLY0A72YmikCIwelGqvdst539COCp7oMi/V+dLlaYN1II3awCEFAMWugAVFWXdde3HwH0HNR9UkT/OwFE5IyGmmIpBntyu4cA6CV8EUe+YcSZ3g9gxFEJm2klBt8Iud3hih4CCN/2MEXHWfH8M417sCnxmOOWNAmBEHtWZgD2zelBBGClH0DxZqkJ1qT8aEJdLcVe35weRABLDXnvYEO2uqlpIWAp9vrm9CACWGzIT7N9ONCQtxIxNcTcbEPV6ZvTfQmAzgKNF3Y8NhhxRfW648Mits9NSxMBxVzHq7YjruarIad7TOxLAOGovozRU0IcOw6Pwwy3okEIWIq5gbmcCgHMoElm5YGMBuVImlUNsTbDUO2SJwD54ghDDnFTbSNgLdbGIoAl+MjCi0JaoXQYzGxlSmbLZt8aQyDEmKU+J+XwkkEwD7wFoNNALxFcNOjECPdrRZb9IrTLTUoLAcWYldV/hPyikMt9vTCQAMLRC/ueFe/O4+I1zS1LBAFrMTY0h0cRwIPGnLY3TTQrizMYg9bNDbG1tzEkhubwUAKg6bCCyi43VuHjjdnr5tpBwFpsLQ85PBDhoQQQzhrKIANLru8LzQzcvb7L+5VTRCDElKWZf3LDyNzNQgD3G3Sotfs0gxA3zmSLMTUyd7MQgEYCXjHm7gNh7J2N2ezmRopAiKUDIzVvkFnK2ZGjeCMJgHuINRR076CrRLpf8wGs3a9FCqWbFWLJ2hyTe0PuDnXgSAIIZ98ztJQ4vzwU5p4Vp2lulRUEQgwdasXeNjsz5WxWAvgbBb/cVriFj2Ls03GgNea2gG0jbAyxczqVtRZDylXl7EjJRABGbwNU+d3QOSNR8AMcgf4IKHYUQ9YkU/NflcpEAKH2d1lDIdh7Iky+jVHb3eyaEAgxc2JNl5/0splzNTMB0Ap4AquenNSyGs7fjGueUsN1/ZK2EVDMKHasyZMhVzPZnZkAQml3Zio1voP0pKClBRzjQ7BBFoVYsfTEX7t3cuVoXgKYx5UsPSLcDow6BDdq3+GfHYFuBEKMqOPPoig3laOZJRcB0LTQC0MWZC49rgO1YtDH4jLJrYkQAcWI1dWlFoQczQxrLgIIpeZqYmS2pJoDj4LhLY7pVoNOw68SYuMowzDkzs3cBADDPApASwyDdAaO3tGw/W56CQiEmDijhKKrKnJJyM1c18tNAKH0W3NdJa6DN8Wcz+Jw7w+Iyy+1WRNi4bMYoNiwKmPl5LgEoH6AF6wihd2a3HGaYfvd9GIRUCxYnPDTQkG5OFbf3FgEQFNDDwjd3rq60e0HYP5DjNruZheEQIiBDxRUXF3F3B5yMvf1xyKAcBV1OLye+4pxnfBxAmBmXCa5NVUhEHz/8aquV9J1lIO5O/9atoxNADDOKgqZ2yrI6HYT7D6HQLA67GMU9vrNDj4/B0sUA5ZlbsjFseowNgGEq6njQXMDLMuWGH8uATHFciXc9uwIBF+fyxnyvWVR7o3V+deq9EQEAPNMbEDLkJq3WuddJLB5zXb45UtGIPhYyW9pbf9BqNwacnDQ9yP3T0QAofTb2L468krxH7ALJp5NgGwcv6lu4TgIBN+ezbnytXVRzin3JpKJCSDcf9wykRXxnLwXpmiOwMS4xFMlt0QIBJ9qrF8+TkFumeTevwVAUYGuzsD/axVqfPuP2P95bwkY92Kb+cGXn2eXfJuCaMWfQjrgCyEAmEhPIf0xBWRDHRQoXyJwvE/AuFODD79ENVJJfnnk+pBzE3unEAIIVtzFdunEFsVTgJqK5xFAPjoQj09yWRJ8dx4npdLsV/2VY8q1QqQwAoCRNDvwqkKsiqcQdRZ9jUDyeQLx+CSTJcFnX+PgFDr82ut8Vci19n1jfy6MAGQBhulJwUzLEY9tcfUnarhILQGfMVg99mNdMfhKv/wpDPW1Y3BPyLH2fRN9LpQAgiXXslWfQEqiCSNfJrD82YHIvRp89GXMtD7Jpxtp5ZRyq1ApnABgqBex8MZCrYyjME0ZPYsA86XF4vBHhxX4ZSP5Rj5CrU/v7ahb+OfGkFv9vht7X+EEECzR9MSlY1sV94n/hHlfJ9h8UZFI/BR88XXMkW9SFOXSRFN+B4FSCgHAVO9ywctRbVMUPTv+DQLPlxer2bvBB9/ADMvP8w9DcW0uhZwadtxY360/1lkZT8I5J3PohzIebvWwOzD8Shy02moFLNpNbG2E3R9Dj7Jofw6b/0JsXZfj+FyHlk0Amlf/bXRqLqvsHfwsJl+Bo0a+jtle1eKzmOTfB6t0v5/68OwK6vgd4urtsrxQKgHIaJyl4TMNyWyo/xOX+dTvGhxm7UWqJtxCLOkVb6egh5kweDIj3+H084mlxycrZvjZpROALo/jPsjm1OGmJPOtHpG+AdVCDWuSqVWNFSF+FKdz0BPRzWo0pcpL/4H4ub3sC1ZCAKoETvwCmwPKrlBE5es9iroteCwim8yZQtzMwmg191Pt5Ovnk/uJm5/3+6LofVUSgB6s+Raa2uysYT5RC+Bu9CYc+sywA/27TgRI/J3ZczyqkZbK4rTTilr+0zya7xIvWuuvdKkU2MDmX6VWTegPaHeeiOA+9GYcm+r8iPb6jv2ZGNmdk49DD0Qrjc+xjS7uRN33/4gYqazVWDnAOPgYKqmOnKbKQiquFsHipgLQr97ExZ7s1y/+7H7fN2SfOpBLmfAzCL/KCUCG4Oxz2Lx/kFEN2a8hwz+jD+H0RnYWEgeKv/3QD6Ma2muyPEAcXFQ1AHURwBZU9Jtok/oDBvlW93zz0bsIAM0nSF5IfI3fH4FqOM9jYL31FAPfw/+vsa1UaiEA1ZAgUO9uE/sDhjl4CV/OQ+cTDK8OO9Dad/hbT+cp4Q9HZ6Au7yFQ+X1/O/C1EYCMICiOZvOv7Qb557UIKCjUV6D3vS2CDFau3WvsD/7Vakpq2h+M6t6+aZ2/VHmkVDLeP8iKWglARhEkmiCkiUIugxHQrYH6DNZqrK2D8CuvhG9p6lN1B3ss2ze34cursx1azlG1E4CqReB8mo2ahi6jEVCH4TL0YVTDRSKH5wik0uaLU36P4DM957EjqiTX7dy+6HQ0ipjCjthlHj77Vd1GRuEsgklNw7PR/esGxOj1RQrqSFqOihBa2xV8fh1dRbC9yzaz4JMNOHgTVBO4pqJK9GltW3XeRRE/2GFNHsTgi/GJbvVqlWgcSMC9DyS+gs6sFZF0L64lpd5EV3VtVeNNUSV7+1b+cCkegccp8sckv/xRu0RDAEICElBP8Xmofm1cHIHUEFDr7L9I/tdiqZiaedEIwGjo6wL0pWiMckMcgWIQUExfEFPyq1pREYAMAiDdy16IRsOSssvFEZgAAcXyhSG2Jyim+FOjIwBVEaCeZnMxGsV9kmxycQTGREAxrA4/xXR0EiUBCCUA08Myl6BOAgLExSICit1LQixHaX9UnYD9EKJjUE+JaYhwi37f+z5HIFIE1OzXL79+yKKV6AlAyEECu7D5Irqt/ndxBCJHQB1+uuePstnfjp0JApDBkIAmnpyL+hChAHGJFQEN9am3X53Z0YsZAhCSYZ6A1hKYGT2ybmATEdAkn5+R/GZGsEwRgCIKEtAMtc+hPm1YgLjEgsCDGKIOP1Od1uYIQN6GBPTswCdQf4BIgLjUjYDWcPgtyV/73P68QJgkgFYlIYJT+eyPErcA8W0dCNT+SO8klTZNAKo4JCACOBn1xSYEiEtVCOjX/jp+9W+r6oJlXMc8AQgUSEBzBf4N1UiBiyNQNgLq4b+M5K9s+e6yKpQEAQgcSEAThT6FNn21YcHhUh4CD1D0r0l+Mz39w6BIhgBalYQIjuXzv6B+S9ACxbdFIKAm//Uk/i1FFBZLGckRgICFBGaxOQv1WwIB4jIpAsk0+buBSJIAVElIQEtZfRI9AHVxBMZF4H5O/A2//FpaLTlJlgBanoIIfJSgBYZv8yCQRC//qAonTwACABKYyeYz6FT97+IIjEBgBd//kl99Te1NWhpBAPIgJKBlrD+CHoNGuw4CtrnUh4BWTtbLOf9E8le6zHpdVW4MAbQAhgh25/OZqLYujkALgaV8uJzE17Yx0jgCkGchAbUA1BI4AdXDRS7NRUAP79yI3kryqwXQKGkkAbQ8DBFomPCj6CGtfb5tFAL3UNtrSXwTz+6X4ZlGE0ALUIhgLz6fhvptQQuUtLdq5l9F4j+adjVH184JIGAECQgLvbP+JHTrsNs3aSHwMtW5Hr2L5F+TVtXGq40TQBduEIH6BOagmlKsNxW52EdAL5zRFN65JL6pBTvKht4JYADCEIHeladJROos3GzAYb47bgTewDwN6+mZfb0T0aULASeALkC6/4UIlPwiAbUKNL3YJX4ENG13LqqefZGAywAEnAAGANO9O7QIjmT/0ej23d/7/1Eg8AJW3I7e6b/42fzhBJANp3VHQQTC7GBUrYIZqEv9CCzBBDX1F5D43rmXwx9OADnA6j4UMtDw4VHoQahPKOoGqNz/1Zl3L3oHSd/44bxxoXYCGBe5tvNCP4FWKNYtwm5tX/nH4hF4kiLvROf5/f3k4DoBTI5hRwmQwR7s0HwCtQq26fjS/xkXAY3f69de4/dPjFuIn9eLgBNALyaF7Al9BXtTmPoLRAZbFVJwcwp5haoq6Regj/i9fTmOdwIoB9eOUgMZ7MNOrU6kNxpN6zjA/2khsJwPesOOVuFZ5EnfgqW8rRNAedgOLBlC0MIkIoLZqIihqR2I6shbhC5EHyThtRCHS4UIOAFUCHa/S0EGG7F/Brpnm6Y6BVlTche36RKSfjX/u9SEgBNATcAPuyykoFegixD0dOKu6HTU2nRkzcBbhj6F6um7xSS7Xp3tEhECTgAROWOYKZCC1i4QEYgQ1Ieg2Yg7oFNQLXBSh2gBjZXo86hm4ekeXgm/jGR/ka1L5Ag4AUTuoFHmQQwbcsy2qMhAW90+SLdo2+qz+hl0u6HjtW0pH9dTM7yl74TPuj/X22+karq3tvr8Eqqkf4lE1/EujoAj4Ag4Ao6AI+AIOAKOgCPgCDgC8SPw/zAG7eO6u+9JAAAAAElFTkSuQmCC");
  18095. n.prototype = Object.create(C.prototype),
  18096. n.prototype.enter = function() {
  18097. var e = null;
  18098. return function() {
  18099. this.setZoomed(!1),
  18100. this.emit("enter", {
  18101. oldPano: e,
  18102. newPano: this
  18103. }),
  18104. e = this
  18105. }
  18106. }(),
  18107. n.prototype.exit = function() {
  18108. this.tiled ? (this.clearWaitDeferreds(),
  18109. this.minimumTiledPanoLoaded = !1,
  18110. this.tiledPanoRenderTarget = null,
  18111. this.setZoomed(!1),
  18112. this.panoRenderer.deactivateTiledPano(this),
  18113. this.highestPartialTileRenderOpCompleted = 0,
  18114. this.highestFullTileRenderOpCompleted = 0) : (this.solidSkybox.dispose(),
  18115. this.solidSkybox.loaded = !1,
  18116. this.solidSkybox.version = 0),
  18117. this.emit("exit")
  18118. }
  18119. ,
  18120. n.prototype.hoverOn = function(e) {
  18121. this.marker && (c.start(h.property(this.marker.material, "opacity", a[e].markerOpacityOnHover), 250),
  18122. a.navigation.panoScores & a.navigation.mouseDirection && this.addTextSprite("HIT", 12525854))
  18123. }
  18124. ,
  18125. n.prototype.hoverOff = function(e) {
  18126. this.marker && c.start(h.property(this.marker.material, "opacity", a[e].markerOpacity), 250)
  18127. }
  18128. ,
  18129. n.prototype.build1 = function() {
  18130. this.floor = this.floor || this.model.floors.get(this.floorIndex) || this.raycastToFindFloor() || this.model.getFloorAtPoint(this.position),
  18131. this.floor.addPano(this),
  18132. this.floorPosition = this.floorPosition || this.raycastFloorPosition(),
  18133. this.neighbourPanos = this.neighbourPanos || this.findNeighourPanos(),
  18134. a.colorMarkerByFloor && this.marker && this.marker.material.color.set(this.floor.debugColor)
  18135. }
  18136. ,
  18137. n.prototype.build2 = function() {
  18138. this.floorPosition = this.floorPosition || this.interpolateFloorPosition(),
  18139. this.height = this.position.distanceTo(this.floorPosition),
  18140. this.placeMarker()
  18141. }
  18142. ,
  18143. n.prototype.interpolateFloorPosition = function() {
  18144. var e = this.model.panos.filter(n.filters.isNeighbourPanoTo(this)).filter(function(e) {
  18145. return !!e.floorPosition
  18146. }).sort(function(e, t) {
  18147. return e.position.distanceTo(this.position) - t.position.distanceTo(this.position)
  18148. }
  18149. .bind(this))
  18150. , t = this.position.clone();
  18151. return e.length >= 2 ? t.y = (e[0].floorPosition.y + e[1].floorPosition.y) / 2 : t.add(a.noMeshFloorPositionOffset),
  18152. t
  18153. }
  18154. ,
  18155. n.prototype.raycastFloorPosition = function() {
  18156. I.warn("Performance warning: Raycasting to find floor position");
  18157. var e = new r.Raycaster(this.position,new r.Vector3(0,-1,0))
  18158. , t = e.intersectObjects(this.model.colliders);
  18159. return t.length ? t[0].point : null
  18160. }
  18161. ,
  18162. n.prototype.raycastToFindFloor = function() {
  18163. var e = [new r.Vector3(0,-1,0), new r.Vector3(1,-1,0), new r.Vector3(0,-1,1), new r.Vector3(-1,-1,0), new r.Vector3(0,-1,-1), new r.Vector3(1,0,0), new r.Vector3(0,0,1), new r.Vector3(-1,0,0), new r.Vector3(0,0,-1)];
  18164. return function() {
  18165. I.warn("Performance warning: Raycasting to find floor index");
  18166. for (var t = 0; t < e.length; t++) {
  18167. var i = new r.Raycaster(this.position.clone(),e[t].clone())
  18168. , n = i.intersectObjects(this.model.colliders);
  18169. if (n.length)
  18170. return n[0].object.parent.parent
  18171. }
  18172. return null
  18173. }
  18174. }(),
  18175. n.prototype.placeMarker = function() {
  18176. this.marker && (this.marker.position.copy(this.floorPosition),
  18177. this.marker.position.y += .05,
  18178. this.marker.lookAt(new r.Vector3(0,1,0).add(this.marker.position)))
  18179. }
  18180. ,
  18181. n.prototype.translate = function(e) {
  18182. this.position.add(e),
  18183. this.floorPosition.add(e)
  18184. }
  18185. ,
  18186. n.prototype.findClosestMidtpointPanoTo = function(e) {
  18187. (new r.Vector3).addVectors(this.position, e.position).divideScalar(2);
  18188. return this.model.panos.find([n.filters.notIn([this, e])], [n.sortFunctions.distanceToPoint(point)])
  18189. }
  18190. ,
  18191. n.prototype.attachToPanoRenderer = function(e) {
  18192. this.panoRenderer = e,
  18193. this.panoRenderer.on(g.TileRenderSuccess, this.onTileRendered.bind(this)),
  18194. this.panoRenderer.on(g.PanoRenderComplete, this.onPanoRendered.bind(this)),
  18195. this.panoRenderer.on(g.TileRenderFailure, this.onTileRenderFail.bind(this)),
  18196. this.panoRenderer.on(g.UploadAttemptedForAllTiles, this.onUploadAttemptedForAllTiles.bind(this))
  18197. }
  18198. ;
  18199. var _ = {};
  18200. n.prototype.getWaitDeferred = function(e) {
  18201. var t = _[this.id];
  18202. t || (t = {},
  18203. _[this.id] = t);
  18204. var i = t[e];
  18205. return i || (i = {
  18206. deferred: $.Deferred(),
  18207. active: !1
  18208. },
  18209. t[e] = i),
  18210. i
  18211. }
  18212. ,
  18213. n.prototype.resetWaitDeferred = function(e) {
  18214. var t = this.getWaitDeferred(e);
  18215. t.active = !1,
  18216. t.deferred = $.Deferred()
  18217. }
  18218. ,
  18219. n.prototype.clearWaitDeferreds = function() {
  18220. var e = _[this.id];
  18221. e || (e = {},
  18222. _[this.id] = e);
  18223. for (var t in e)
  18224. if (e.hasOwnProperty(t)) {
  18225. var i = e[t];
  18226. i.active = !1,
  18227. i.deferred = $.Deferred()
  18228. }
  18229. }
  18230. ,
  18231. n.prototype.loadTiledPano = function() {
  18232. var e = (new r.Vector3,
  18233. [])
  18234. , t = [];
  18235. return function(i, n, r, o, a, s) {
  18236. null !== o && void 0 !== o || (o = !0),
  18237. null !== a && void 0 !== a || (a = !0);
  18238. var l = this.getWaitDeferred(i)
  18239. , c = l.deferred
  18240. , h = null
  18241. , u = null;
  18242. if (r && ("number" == typeof r ? h = r : (h = r.hFov,
  18243. u = r.vFov)),
  18244. !this.isLoaded(i)) {
  18245. if (!l.active) {
  18246. if (l.active = !0,
  18247. r) {
  18248. var d = y.matchingTilesInDirection(this, i, n, h, u);
  18249. e[this.id + ":" + i] = {
  18250. tileCount: 0,
  18251. targetTileCount: d
  18252. },
  18253. I.info("Loading partial pano: " + this.id + " with " + d + " tiles")
  18254. }
  18255. t[this.id] || (t[this.id] = !0,
  18256. this.on(f.LoadComplete, function(e, t) {
  18257. var i = this.getWaitDeferred(e).deferred;
  18258. i && "pending" === i.state() && this.highestPartialTileRenderOpCompleted >= e && (i.resolve(e, t),
  18259. this.resetWaitDeferred(e))
  18260. }
  18261. .bind(this)),
  18262. this.on(f.LoadFailed, function(e) {
  18263. var t = this.getWaitDeferred(e).deferred;
  18264. t && "pending" === t.state() && this.highestPartialTileRenderOpCompleted >= e && (t.reject(e),
  18265. this.resetWaitDeferred(e))
  18266. }
  18267. .bind(this)),
  18268. this.on(f.TileLoaded, function(t, i, n) {
  18269. var r = this.getWaitDeferred(t).deferred;
  18270. if (r && "pending" === r.state()) {
  18271. r.notify(t, i, n);
  18272. var o = e[this.id + ":" + t];
  18273. o && (o.tileCount++,
  18274. o.tileCount === o.targetTileCount && (this.onPanoRendered(this.id, t, n, !0),
  18275. r.resolve(t, n),
  18276. this.resetWaitDeferred(t)))
  18277. }
  18278. }
  18279. .bind(this)))
  18280. }
  18281. this.tileDownloader.clearForceQueue(),
  18282. this.tileDownloader.forceQueueTilesForPano(this, i, n, h, u, s),
  18283. this.tiledPanoRenderTarget = this.panoRenderer.activateTiledPano(this, this.qualityManager.getMaxNavPanoSize(), o),
  18284. this.panoRenderer.renderPanoTiles(this.id, n, a)
  18285. }
  18286. return c.promise()
  18287. }
  18288. }(),
  18289. n.prototype.onUploadAttemptedForAllTiles = function(e, t, i) {
  18290. if (e === this.id) {
  18291. var n = this.qualityManager.getPanoSize(m.BASE);
  18292. t === n && this.shouldRedrawOnBaseLoaded && (this.shouldRedrawOnBaseLoaded = !1,
  18293. this.panoRenderer.resetRenderStatus(this.id, !0, !1),
  18294. this.panoRenderer.renderPanoTiles(this.id, null, !0, !0))
  18295. }
  18296. }
  18297. ,
  18298. n.prototype.onTileRendered = function(e, t, i, n) {
  18299. e === this.id && this.emit(f.TileLoaded, t, i, n)
  18300. }
  18301. ,
  18302. n.prototype.onPanoRendered = function(e, t, i, n) {
  18303. e === this.id && (this.minimumTiledPanoLoaded = !0,
  18304. this.updateSkyboxForZoomLevel(),
  18305. t > this.highestPartialTileRenderOpCompleted && (this.highestPartialTileRenderOpCompleted = t),
  18306. !n && t > this.highestFullTileRenderOpCompleted && (this.highestFullTileRenderOpCompleted = t),
  18307. this.emit("load", t),
  18308. this.model.emit("load", this),
  18309. this.emit(f.LoadComplete, t, i))
  18310. }
  18311. ,
  18312. n.prototype.setZoomed = function(e) {
  18313. this.zoomed = e,
  18314. this.updateSkyboxForZoomLevel()
  18315. }
  18316. ,
  18317. n.prototype.ensureSkyboxReadyForRender = function() {
  18318. this.tiled || (this.solidSkybox.loaded || (this.solidSkybox.needsUpdate = !0),
  18319. this.solidSkybox.loaded = !0)
  18320. }
  18321. ,
  18322. n.prototype.updateSkyboxForZoomLevel = function() {
  18323. this.minimumTiledPanoLoaded && this.model.updateProjectedPanos()
  18324. }
  18325. ,
  18326. n.prototype.getSkyboxTexture = function() {
  18327. return this.tiled ? this.minimumTiledPanoLoaded ? this.zoomed ? this.panoRenderer.zoomRenderTarget.texture : this.tiledPanoRenderTarget.texture : null : this.solidSkybox
  18328. }
  18329. ,
  18330. n.prototype.onTileRenderFail = function(e, t, i) {
  18331. e === this.id && this.emit(f.LoadFailed, t)
  18332. }
  18333. ,
  18334. n.prototype.isLoaded = function(e) {
  18335. if (this.tiled) {
  18336. if (e && "string" == typeof e)
  18337. throw new A("Wrong panoSize given to Panorama.isLoaded(); a tiled pano uses PanoSizeClass");
  18338. return !!this.minimumTiledPanoLoaded && (!e || this.highestPartialTileRenderOpCompleted >= e)
  18339. }
  18340. if (e && "number" == typeof e)
  18341. throw new A("Wrong panoSize given to Panorama.isLoaded(); a non-tiled pano uses high/low.");
  18342. return !!this.solidSkybox.high || e in this.solidSkybox
  18343. }
  18344. ,
  18345. n.prototype.loadCube = function(e) {
  18346. if (this.isLoaded(e))
  18347. return I.info("Skipping load of pano, already loaded"),
  18348. $.when();
  18349. this.emit("loading", e),
  18350. this.model.emit("loading", this);
  18351. var t = p.getCubemapUrls(this.model.urls, this.id, e)
  18352. , i = t.filter(function(e) {
  18353. return !e
  18354. });
  18355. "low" === e && i.length > 0 && (I.info("Pano", this.id, "not available in low res, loading high res right away"),
  18356. e = "high",
  18357. t = p.getCubemapUrls(this.model.urls, this.id, e));
  18358. var n = 0
  18359. , r = [0, 1, 2, 3, 4, 5].map(function(e, i, n) {
  18360. return u.getImage(t[i])
  18361. }
  18362. .bind(this));
  18363. return $.when(r[0], r[1], r[2], r[3], r[4], r[5]).then(function(t, i, n, r, o, a) {
  18364. return this.solidSkybox[e] = [t, i, n, r, o, a],
  18365. "high" !== e && this.solidSkybox.high || (this.solidSkybox.image = this.solidSkybox[e],
  18366. this.solidSkybox.low = null),
  18367. this.solidSkybox.needsUpdate = !0,
  18368. this.emit("load", e),
  18369. this.model.emit("load", this),
  18370. this
  18371. }
  18372. .bind(this), function() {
  18373. I.error("Downloading cubemap for pano", this.id, "failed"),
  18374. this.failedLoadingAt = Date.now()
  18375. }
  18376. .bind(this), function() {
  18377. return $.when(++n, 6)
  18378. })
  18379. }
  18380. ,
  18381. n.raycastsSkipped = 0,
  18382. n.raycastsDone = 0,
  18383. n.prototype.findNeighourPanos = function() {
  18384. return this.model.panos.setNeighbour(this.id, this.id, !1),
  18385. this.model.panos.forEach(function(e) {
  18386. if (e !== this && (!this.model.panos.neighbourMap[this.id] || void 0 === this.model.panos.neighbourMap[this.id][e.id])) {
  18387. var t = this.position.distanceTo(e.position);
  18388. if (t > a.panoramaNeighbourMaxDistance)
  18389. return this.model.panos.setNeighbour(this, e, !1),
  18390. void n.raycastsSkipped++;
  18391. var i = e.position.clone().sub(this.position).normalize()
  18392. , o = new r.Raycaster(this.position,i.clone(),0,t)
  18393. , s = o.intersectObjects(this.model.colliders);
  18394. n.raycastsDone++,
  18395. this.model.panos.setNeighbour(this, e, 0 === s.length),
  18396. a.showNeighbourRaycasts && (s.length ? this.floor.model.add(new r.ArrowHelper(i,this.position,s[0].distance,16711680)) : this.floor.model.add(new r.ArrowHelper(i,this.position,t,16777215,0,0)))
  18397. }
  18398. }
  18399. .bind(this)),
  18400. this.model.panos.neighbourMap[this.id]
  18401. }
  18402. ,
  18403. n.prototype.worldPosition = function() {
  18404. return this.position
  18405. }
  18406. ,
  18407. n.prototype.addTextSprite = function(e, t) {
  18408. this.removeTextSprite();
  18409. var i = document.createElement("canvas")
  18410. , n = i.getContext("2d");
  18411. i.width = 256,
  18412. i.height = 256;
  18413. var o = "Arial"
  18414. , a = 60;
  18415. n.font = "bold " + a + "px " + o,
  18416. n.fillStyle = "white";
  18417. var s = n.measureText(e).width;
  18418. n.fillText(e, (i.width - s) / 2, (i.height + a) / 2);
  18419. var l = new r.Texture(i);
  18420. l.needsUpdate = !0;
  18421. var c = new r.SpriteMaterial({
  18422. map: l,
  18423. color: t || 16428055
  18424. });
  18425. this.text3d = new r.Sprite(c),
  18426. this.text3d.position.copy(this.skyboxMesh.position),
  18427. this.floor.add(this.text3d)
  18428. }
  18429. ,
  18430. n.prototype.removeTextSprite = function() {
  18431. this.text3d && (this.floor.remove(this.text3d),
  18432. this.text3d = null)
  18433. }
  18434. ,
  18435. n.prototype.isAligned = function() {
  18436. return this.alignmentType === l.ALIGNED
  18437. }
  18438. ,
  18439. n.filters = {
  18440. inDirection: function(e, t, i) {
  18441. return function(n) {
  18442. var r = n.position.clone().sub(e).normalize();
  18443. return r.dot(t) > i
  18444. }
  18445. },
  18446. inFloorDirection: function(e, t, i) {
  18447. return function(n) {
  18448. var r = n.floorPosition.clone().sub(e).normalize();
  18449. return r.dot(t) > i
  18450. }
  18451. },
  18452. inPanoDirection: function(e, t, i) {
  18453. return i = a.navigation.panoScores ? a.navigation.filterStrictness : i,
  18454. function(n) {
  18455. var r = n.floorPosition.clone().sub(e).normalize()
  18456. , o = n.position.clone().sub(e).normalize();
  18457. return r.dot(t) > i || o.dot(t) > i
  18458. }
  18459. },
  18460. atFloor: function(e) {
  18461. return function(t) {
  18462. return !e || t.floor === e
  18463. }
  18464. },
  18465. not: function(e) {
  18466. return function(t) {
  18467. return t !== e
  18468. }
  18469. },
  18470. notIn: function(e) {
  18471. return function(t) {
  18472. return e.indexOf(t) === -1
  18473. }
  18474. },
  18475. isLoaded: function() {
  18476. return function(e) {
  18477. return e.isLoaded()
  18478. }
  18479. },
  18480. isNotLoaded: function() {
  18481. return function(e) {
  18482. return !e.isLoaded()
  18483. }
  18484. },
  18485. isCloseEnoughTo: function(e, t) {
  18486. return function(i) {
  18487. return e.distanceTo(i.floorPosition) < t
  18488. }
  18489. },
  18490. hasMinimumHeightDifferenceTo: function(e, t) {
  18491. return function(i) {
  18492. return Math.abs(i.position.y - e.y) > t
  18493. }
  18494. },
  18495. isNotBehindNormal: function(e, t) {
  18496. var i = new r.Vector3;
  18497. return t = t.clone(),
  18498. function(n) {
  18499. var r = i.copy(n.position).sub(e).normalize();
  18500. return r.dot(t) > 0
  18501. }
  18502. },
  18503. isNeighbourPanoTo: function(e) {
  18504. return function(t) {
  18505. return !e || !e.neighbourPanos || !!e.neighbourPanos[t.id]
  18506. }
  18507. },
  18508. isNeighbourOfNeighbourTo: function(e) {
  18509. return function(t) {
  18510. return !!e.neighbourPanos[t.id] || e.neighbourUUIDs.some(function(i) {
  18511. var n = e.model.panos.get(i);
  18512. return !!n && n.neighbourPanos[t.id]
  18513. })
  18514. }
  18515. },
  18516. isNotRecentlyFailed: function(e) {
  18517. return function(t) {
  18518. return Date.now() - t.failedLoadingAt > e
  18519. }
  18520. },
  18521. isOnVisibleFloor: function() {
  18522. return function(e) {
  18523. return !e.floor.hidden
  18524. }
  18525. },
  18526. isPanoAligned: function() {
  18527. return function(e) {
  18528. return e.isAligned()
  18529. }
  18530. }
  18531. },
  18532. n.sortFunctions = {
  18533. distanceToPoint: function(e) {
  18534. return function(t, i) {
  18535. return t.position.distanceTo(e) - i.position.distanceTo(e)
  18536. }
  18537. },
  18538. floorDistanceToPoint: function(e) {
  18539. return function(t, i) {
  18540. return t.floorPosition.distanceTo(e) - i.floorPosition.distanceTo(e)
  18541. }
  18542. },
  18543. choose: function(e) {
  18544. return function(t, i) {
  18545. return e.id === t.id ? -1 : e.id === i.id ? 1 : 0
  18546. }
  18547. }
  18548. },
  18549. n.scoreFunctions = {
  18550. distance: function(e, t) {
  18551. return t = t || a.navigation.distanceFactor,
  18552. function(i) {
  18553. return e ? e.position.distanceTo(i.position) * t : 0
  18554. }
  18555. },
  18556. distanceSquared: function(e, t) {
  18557. return t = t || a.navigation.distanceFactor,
  18558. function(i) {
  18559. return e ? e.position.distanceToSquared(i.position) * t : 0
  18560. }
  18561. },
  18562. direction: function(e, t) {
  18563. return function(i) {
  18564. var n = i.position.clone().sub(e).normalize();
  18565. return n.dot(t) * a.navigation.directionFactor
  18566. }
  18567. },
  18568. angle: function(e, t) {
  18569. return function(i) {
  18570. var n = i.position.clone().sub(e).normalize();
  18571. return n.angleTo(t) * a.navigation.angleFactor
  18572. }
  18573. },
  18574. inFieldOfView: function(e, t) {
  18575. return function(i) {
  18576. var n = i.position.clone().sub(e).normalize();
  18577. return n.dot(t) > .75 ? 10 : -1
  18578. }
  18579. },
  18580. optionality: function(e) {
  18581. return function(t) {
  18582. var i = t.neighbourUUIDs.filter(function(t) {
  18583. return !(t in e.neighbourUUIDs) && t !== e.id
  18584. });
  18585. return i.length * a.navigation.optionalityFactor
  18586. }
  18587. },
  18588. penalizeHeightDifferenceUnder: function(e, t) {
  18589. return function(i) {
  18590. return e.y - i.position.y < t ? -20 : 0
  18591. }
  18592. }
  18593. },
  18594. t.exports = n
  18595. }
  18596. ).call(this, "/js/objects/Panorama.js")
  18597. }
  18598. , {
  18599. "../enum/AlignmentType": 17,
  18600. "../enum/GLCubeFaces": 25,
  18601. "../enum/PanoRendererEvents": 35,
  18602. "../enum/PanoSizeClass": 36,
  18603. "../enum/PanoramaEvents": 37,
  18604. "../enum/RenderLayers": 41,
  18605. "../enum/RenderOrder": 42,
  18606. "../enum/TileDownloaderEvents": 45,
  18607. "../enum/Viewmode": 51,
  18608. "../exception/BasicException": 55,
  18609. "../scene/SceneRenderer": 158,
  18610. "../settings": 166,
  18611. "../tile/TileUtils": 174,
  18612. "../util/ajax": 181,
  18613. "../util/common": 185,
  18614. "../util/lerp": 188,
  18615. "../util/logger": 189,
  18616. "../util/panorama": 191,
  18617. "../util/texture": 194,
  18618. "../util/transitions": 195,
  18619. events: 202,
  18620. three: 217
  18621. }],
  18622. 149: [function(e, t, i) {
  18623. "use strict";
  18624. function n(e) {
  18625. var t = r.UniformsUtils.clone(c.waypoint.uniforms);
  18626. t.map.value = d,
  18627. t.opacity.value = 0,
  18628. t.color.value.set(o.reticuleColor),
  18629. r.Mesh.call(this, new r.PlaneBufferGeometry(.4,.4,1,1), new r.RawShaderMaterial({
  18630. side: r.DoubleSide,
  18631. depthWrite: !1,
  18632. depthTest: !1,
  18633. transparent: !0,
  18634. vertexShader: c.waypoint.vertexShader,
  18635. fragmentShader: c.waypoint.fragmentShader,
  18636. uniforms: t,
  18637. name: "waypoint",
  18638. opacity: 0
  18639. })),
  18640. this.layers.set(h.RETICULE),
  18641. this.renderOrder = u.reticule,
  18642. this.player = e,
  18643. this.direction = new r.Vector3,
  18644. this.hidden = !0,
  18645. this.mouseLastMoveTime = Date.now()
  18646. }
  18647. var r = e("three")
  18648. , o = e("../settings")
  18649. , a = e("../util/transitions")
  18650. , s = e("../util/texture")
  18651. , l = e("../util/lerp")
  18652. , c = e("../shaders")
  18653. , h = e("../enum/RenderLayers")
  18654. , u = e("../enum/RenderOrder")
  18655. , d = s.loadBase64("iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAAAXNSR0IArs4c6QAAQABJREFUeAHtfQl8HMWVd1V3z4wky7KNjDFgwI4xR7htGccHhwMxkswRQmKSkCWBhGw2ybebQE6yuzj7fSEkBMLuJtlkIUDIQhYnhGDQYQdiDttgPDZgIBzGsQwGbGNZsmxZmumjvv9rSUYzmuo5NNPdI1X/MJqu89Wr939d9epVFWPqURxQHFAcUBxQHFAcUBxQHFAcUBwYRRzgo6itI7Kps+LxyGRx8lG20KcxTUzhjE9Ep+IfrxVc1KLRE7lghwjGK/E7yjiLIT7KBIu5731cSSI8IRhLIjyBoCRnokdwtge/d3PB2wUT+Md24+9u5vDtOre37uAvvbWhrs7sK0L9vxw5oBRAmfTa+fGeo6M8cioAeKom+HEA9zQAcyqAOwVN0AJphmA26n0btLSBlq0OF69D8WxKCnPTo3WVbwZCk6o0Lw4oBZAXu3xJzBfFE8dHBJ8vuDYTX2KAnp/CORvnS+1FqkQIthe0vwjaN3HhbDS5WLOyLvYaisdAQj1h4YBSAAH3REPz5piYNHW2zhgAz+bjSzoPX3Uauo+8R7B2jBbWYkqyBkOHNXxX2/qWxhk05VBPQBxQCiAAxjfEe6czoTVwzusxZF4IwFcFQEbwVQp2AFOaVUKIVsadlpa6ii3BEzW6KFAKwI/+XrZMXzzt0oUO5xdrXNQzxmf4UW351SE2O4K3akIsb9r64Cq2ZAnZGNRTQg4oBVAq5i5dqtUv/t7ZGueX4wt/GRh9aKmqGonlwlDwHqwFDzhC3N/a9IMn2dKlzkhsZ9BtUgqgyD1Q/2xytq5rV8II9nEY7iYXufjMxQksz3GxFfaDNgyp3wF42jVatuNit2Nr7Rhi79Z0Z7/tOElm2olk0komYvsTT29/OkkFzp0yNxpLVMeiUSPKInpM17Qo8lVjijIR+WpR7kQHy4oQFvzjR6DcqQibBsU2MTNBxQ0FL3eAl3+wbeee1jOj64tb+uguTSmAIvT/uas6xlfVjLkC4LgGw/vTilDkkCIA6gQT4hXG+YtciE2C81ctx25L7t/bNnbsofR1nGgZMB7a1gTQMIY7rJoZDH95tRBONQyMFQCRDgOcgbT4xw0Ai36jSGbBOI9/zEI6C+E20vVyru0XmtiP2G6hsf1I0810o8OwWDvS7t637z0tWj1uqqHpUAjiBNB0Kmg8BQWeCMEiP4MSPOIFKLnbD3R13/v4wgmdJahgVBWpFMAwurs+bi7QAHow8RP4GpKjTVEeANBiXDyPIfAaJpx1tmCbdmvR1w/R2KG6ZR7JdDFFF/zw/q/yRHypK4pScZ6FYGTRC8W0W2PabptbO6A2tttG5O09DntvopM8TufsVMa1OeDNfCb46VA0rsLJs5rMyQXrQd2/d6AMWusiqzMnUqHZOKAUQDYOpcfDoNcw9ZKPc137Br74denRhbwD8L34uj6JvE+hQ9bsYMa6ccmeCTEjcizXaajNp+DLejjiigegQgjNMQ+ACQXG3wXN24UttiYs84290cqOycyag7j5KOYsjDvOhkIoiuLCiCAubOcnLW0P/UEZDnPspP5kSgHkyK9zV+2qrqwZ/wXOtK+BacfkmM0jmdgM4LcIWL13cf0J+O4ewR37OF3n04XjTMdXvWgjCg8ifIvCaKGHa9oW2xZbhKa/Dp/idyYJ+xyOVREoggYohGGvjEC5bBPMua2nq/OOxxdOwpRFPdk4oBRAFg658/ux1dcBkF9F0vFZkntGAwTr8FW8X3BneY/e015hV5+MJa+T3DnzCAO8JyMQSQoB/3sFS6Mv9+r7X6q0K2Fs1C4GLy4Hr+dky58lvhPl/+zAvv23KDuBN6eUApDwZ/7q98bWVIzH154D/MNxwxUb8GW6n/Vay1ikIsF0uw4Gs5kQ9CMlVY/OYCGwp4BvZLYeZ2ZvjFUYSyCcl2NkMKtQhmCEtRfTg1u6ejtvW7Pg0H2FljOS8ykFkNa7i1bsGBOprcXXnn8TxquCXHIheDvwjbvLTtp3CmF2adHKOpjf6xTo05gte4UysAWPO8meOOeRGj2qX43+uAqKuLBlVbggoz9uNtvbf7bygsndsmpHY7hSAAO9DsedhsXXf07j2o0A/mEDwXn8hUFatMIyf7txhL7SfMeaiS16Z2E4OzWPMlTSNA5gKN+GNc6nIkcYG6137EXwb7gGihTelAXsgBRspyOc61uabrxbORb1MVopAPCBlvOwGeffIVgz0+Qvl1eab/7ScsxfYKnLMCKRBfjaYJgfzNJcLgSXYxo4H2GlhMct01yNJVLL0CJfhnL9EtqSv11GiI3wMf4ntXwIjpajMBSLZnePPYvcjKHlknzLxLy+DWv0twkrcpfg1klaRDsPc/uj8i1Hpc+fA7AVvOWYzmNcGC9zw7wKvga0MjM135IwVVsG18hvjuazC0alAjh31SpjzNgF10H/3QAVmNdyG772z2Hn2k3bjWjTUZa1AIrgwzAU5v8VyldaVfohHICBrxMC/Je3DGP1FCu5GDssv4NRwRlDEnoFwKEII7bvd+9bjRWDheQNOaqeUacALognZ+qM35G/oIiXsGa/NMm7Ho2xmkVwkV2ghvnhwApND+DyvDrBulZGRc358C1YiuncyflQR4rdZuILK+qiG/PJV+5pR40CmLv2rcoJkcnfB/CvxVcfU/7cHgjGaxjqf7/djjYdEoURSrBzkDOaW26VymcOJB3OntiT1FfW6hgRcO0G9PfxOdOAPRDo71s7zB03PD3vKIwMRv4zKhRAYzw5B0bjezHXn55rl2J+uIdz57vdFZH7KnqTH9GFvhCKo0QbXHKlSqXLiQM42NTm9qreiuifx/SanxZC+yH6/pCc8iIR+n4LY84VzXXRdbnmKdd0I14BNMbNazHXvwkCEMmlkzCnx9SS3ZkYo387esA6DQy6GHP8vOwEudSj0pSeA/ia08nGy3uqjU1V++yboMCvRn/mJPNQAjjtWHynuS5ya+kpDa6GnJgRHHmF13zB2r2HGLGqu9DfF+deinjBttg/6Jq9U+iRTyurfu6cC3NKWjXgtnmf7eiH6Qb7L8hEHlu2xXIrceCqFfPG0RHpI+4ZkQqgfp05F5tq/he6/uhcegzavgtDvn9tt/bdVRsddwlGAPNz/VLkUr5KEzwH3JEdZ2vak3sfqjXGXoUp4b9hVFiTE2WCvelw5/KWWdFnckpfRolGmgLgi+PmdTiKmuZ8OW2dBfh/Z7PEdZxFp2ucfQzD/TFl1H+K1Dw5gPldtyPYHwVLbtFZ7BbIyadyKQJyYuGY8+821UVuQXrok5HxjBgFcN66rtqYXvkbWH0X59Q1QrwKi/FXbNvYbGjWFcg3Lad8KtGI4ADsA1stx7hX160ZWNn5OZYNT8ilYcjXlLB7PvvYnBo6FansH7irl/+z+FlzXkyvei4X8PcZ+cQtnb2dZwqHTzI0+3oF/vKXgXxbQH1OfU8yQLIA0/8trmxkKYhkjGSNZC5L0rKILvsRQL+V/0e5DPkxjNsDu8BnuWP9VXD9GnRmzktDZdGbisiCOICv+h4u7NuFZnwQg/vfQJayygVNCTAT+Ha5rxKU8wiAN24wbwWIaR6Xdb6Pud9ay0mejs5O4mDLbyjwF4SVEZnJlQXIBMmGKyOQlWwNJZkj2SMZRNqy/ZCWJeHujbjs9LvA9iuydVTfsE7cLGqMH7BO80pN007JlkfFj14OOI7zIhsfuYd3Wd8Drr8JgGTHiGD37mDPX1WONyVnb1zIZKH/wI4HYLS5ICtpOAgCJ+peybn1msZ02keOI7PVoziQhQNCdDgMUwJhHI+Tje+BCsh+MIwQK3DgyGXlduBIWSmAc+NdE8ewyiYA+cwsXYjpmVjtWOantEiEztyjtf2c/f+zlq0SjHwOcFx9LsRDjmm+rBmR30GGcM5DlkeIZ3vtnsZyWiEoGxsA7d2vYpU4DMIb/DTkx3NTgu27UDOMSzGC+5gCfxbBVdFDOeB+MPjHSIZIlkimsq4SQDaxFL2GZHVogeEMKYsRwKL1iZMjmt4KFh7pxUZYZuG/bX8OBr91GotgyC/UkN+LYSouNw4IjimBeTucxLCpTL8bBsBs+0reNh27fuXs2Eu5VRBcqtArgIb15nxN4w+DRZ5ghnbuhpb+GHfELqZrOL8/aycFx3VVc9lxAPJlMtu5Q2h8Eqz/f4R8ZfMY7XAccVHL7MiaMDc21AqgYb3VAPdcGPyynNqDyzFx8WUj03gMV3XBq6+AAyPD3EuKtlBwACNMBye/3ssckcAFqs2Qy4mehOG0IbgdX9Yy22jxTBdgZGgVgPvl5/zP2cAPzbzNcSysCBjTdY1dEiAvVdWjhAO2wx7C7WdbNM1YAQAd49lsVwmIj4R1JBBKIyDN+d1hf9Yvv3jJ7NHhkmmcocDvKYYqsogc6JM14wxX9oTwnudDhkmWL3g2cVIRSShaUaFTAGRB7Tf4ec75aZnPShrnRMbYjeiQhUXjiCpIcSAHDpDMkeyRDJIsZskywdD1FWFcHQiVAqAdfVFmrAQzPa39WOlbnphgXGjEzCu5w2ZnYb6KVhwoCQdI9kgGSRZJJrNUciTJNsl4lnS+RodGAZCHX4Ve2QwLq+chjjDE3LNDGFfGOq2v4FCHE33l1gioDDYT8pPoxVJpJ5ZJd9A/+t0XBo8J9eTJAe1EkkWSSZJNr8wk2yTjJOte6fyMC4URsM+3/7SH4eSTxb1XLCdG457565D2MD8ZFfa6yEKN47GxR11zQY1bh3eawnkvxqIHEhHW65gdiciuCb0tjTzh1ZaGZhEzJ3VUaJEJsZjJcJtpsirCtUNxi+9huPkId/M5k3Eceq1aaUnjIvi9gxm3TOYWlECWY+jgNryDvXBRGPYOhEEB4BQf67ew9l+RxtLUV8yzaKjV9+Xn3pbX1Jwj7g1f7B4AfTPAuIVpYodtmztr/la16/dLOG68Kv3ziWVC7/rAgUm6HjmMOaQUNJy27MyAo8woPzxVbEuMN34e67AewQfK23UYG4ia6oy/Q28FOuoKXAG4W3oZ/7qn2MLSSsYWI+ZcCX6NxmF/EpeSvIFV6NeciPVq6+kV2yBggQrOkP4CgfXP9x6jmcYJTNOOB3nHIs0ovD+Bv2IltHuMqPUE+sjzchIo8p82z4pcO4SXPgYEqgDoMA/aU+3VXkj5NlpuMSrtxTBY1HmlHUlxEI53MZSMm6b12vg3Y3/z6+teLB7SKKHz6MQHIhEDNh1clsr44cUqO+zl4DbjuNWjN0Uq7bUAmOdoFbaX64I8VCQwBUCOPgD/43SwgrRDycNPWBhKuev8C6XpRkqEEPsw117PuflM88zKbSOlWdSOxo09xwgR+RCOWj8T/V49ktqWqS1wFloFZ6HndG5gA5vcYxC2GwtK4NygHIUCUQB9B3jSGX5Mepsuvvzdju0sxPVOh45kJx+008TXcZPNrGdatzz0MluyxJd5fCah9SVs2TK9fvolJ+nM+BBGOadCALNtrPGFrFJU4noMwhCr6doqtFNq+YcSeCthHzgjiG3EQSgAjqH/w/gKLJYxHQwxIRwXAhwHdM7JUDLiHrLYY5/DyvYeY93T8ziMeqPvmbtWVNZWWnPgL7+IVhZGIgdw2eBvAbIqKPlH8MGTKjuMApowFbgIPIDY+/f4rgBg9MMxS/zHsiai9cC+/RlYl/8KY9Lfj7jlJiwXMYe1NrU9uG7Ef+1lnZwejlHB4qmXzsEWrnoYzkbU8i4tz8J4+yus1nyQcf1/ADgp5iD434JR8OZ09pTyXUpMKSqlG3s0nT/pNe+HJvwhLmn9NefG10GcVGOWgr5SlukIsZ3boqV5TmQDZMBXLV/KdhW3bMEb15mzhM6xC5RPKW7ZwZWGzjaFsH6KS6k/j5Hvd2WUkD3AscXZrXMiT8vSFDvcNwXg3tUXHfMc9J/8tBRa68fpKzE27rsj5TAPKLQ2hxtNrbP4pmJ33kgur36DOFUT1mIAZuqIaCcOFUmwvT+MsbHePgK4hsxKdp/h112EvikADP2XY+hPc5zMDyz+jpU8Q4vGLoWzquf6aeYCQhYKi76tsQdaZ/qnzUPGgaKQU78R9zw67DJMDcYWpcAgC+H8JSeZeFAzovQhlJ4lgKnAw5gK5HGpbeGN8kUBZFvvp3m/cNhiLBHhvg5+aeHNCT4nrqPGnI89pTP9Tw/X8QPBU1T+FFwUF1U2sz8KG8FZmDyFZv9KIZwVtngQS704nZ49AvBJ8Qco+OIfICWgkMZlytMYT86Bq+hTnhZQJn4shP3fOGDhOpgAy/j0XrFNcOPe5pl8WyZeqLDhcaBxoziGCwsu42XsCo7ThnGADS6z0b+IEfG3ZByhlTC4V5/VXBddJ0tTjPCSKoC5a9+qnBA9/EWAH77imR8Md9bi0o4Gba91PYZ53mcAZC4iBKHiAC4a/VPLTONJZeArdXcI3rDROhsXen4UvK4qdW0lKZ/uHRhn3IjLR1qgBKR3DEIJbOlIvnvK0/OOKtkycUmHUxMik7/vBX587dst2/wk64KPf7mCn/PXE8JY2jIz8oQCf0ngklYoF8Rr4jlk5vW0yPJ4JVmHzJPsA+R7ZEQTdghDsvhihJdsBHBBPDnTYNqzmOVkHNLTvB8NuBhznSSWfC4rRmP8LMOd69ustblOXw5BpLaox28OwGTUGLcvhoTVl6NtAEvDD2CVgzZMwUAusQdgTdxizpkr6qIbS8HekowAzl21ytAZv0MGfmoIgH8L3dKL89IwlCu3R3ThNtn/aJ5tPKTAH2DfQfFSH1BfQKK6AqSkoKpJ9t2bqoEFaQH4gBKWCFPSNMOIKIkCGDN2wXXQbGdI6RLi1a7ezn8Tun5NuRn9BOevJcS+/9c0K/aKtH0qwlcOUF9Qn1Df+FrxcCuDwZswQFjAF/FVWXGEJcKULH444UWfAtDBhzEWeRVff+nhEDhb/Tzh8EnldJgnTVlgvW1urYvRyUVqyD8cqStVXjqTIJ64CKtJjdIhdanqHka5tHOQa2IX7rR4TFoMjhdPMPOER+sq35SmKSCi6COAKIMvswf4YfS4z7aNzdgIc04B9AaTBfMwzXHubJ1doeb7wfRAbrVCMVMfUV9hZFk2uyoJC4QJYON30oYCUy62pAkKiyjqCKA+bi7A7r2nZKSggV02S5ygs+hnMayZJksXqnDBEo6m/7JlJjYnqadsONCwUXxQc+wv4WMUKweiYRPbarPkb3QWexXW/xoZzdhdeFZrXSTbMeSy7EPCizcCWLpUg7n/34fUkBLg/Atn0enlAn50yn5bN29V4E/pxLJ4oT6jvqM+LAeCCROEDTj//KsXvS7GgDWvNPnEFW0E0LA+eTX8G38tqxwd8Xy71XVObaRmKZwfpIcjyPL7HQ569yQs47bHPsR3+l23qq94HDjvGXFYzLC+BoAdUrxSS1MSnOK6282upbVGzROg93RZLY7jfL5ldvROWXw+4UVRAHTOeaR24hYMtzLu5XYNaJaYr0X4sTCfeZ+Wmg/1pUorxNvd+v7/ePyMCZ2lqkKV6x8Hzn2uY/wYu/ofYbw90r9aC6sJ/iWrHVO8oRl8DcCZGZ+C7TTbd09fecHk7sJqeT9XUYYSkdrar8rA71Yl2J26Zu+EYWb++1WH9BfArzHjJwr8Ie2fAsiivqQ+xVLb2wVk9zcLMNKPFfkXHh9aF3NFoCyzhsmj4Pmr3xs7vmLCViiAjEc6katjYox+XKzH+Qfs9jsqj6J9T0rD/gP6/h8p8PvOel8qpJFAlV397bBPB+DP8FaiUvuvWLf9OgyCmacucKPv7O2YtmbBofuGw7xhjwDGV4z/ugz8RBjnznejB6zTygD8+2nOr8A/HHEKd17qW+rjsBsGCSsuZoAdKUfxwa2pGP81aXyOEcNSAOeu6hgvGL9WVhcY/Vp3ReQ+DDN8OdxARkfWcFrq063/VAa/rJwq+wTUx9TXmI4mwtwY2MouJuwQhmR0wph+HWFQFp9L+LAUQNXYarj8snGyihzhLK3oTX4EhEq9AmV5fQuHwwit87eeUdnmW52qokA5QH1NfR5mZyFMUyoJO4QhGbMIe4RBWXwu4QUrgHNX7aoGkV+VVoLrvDrsaDOcnRdK0wQcQasTXDh3q3X+gDsigOqpz6nvSQYCqD6nKgk7hCEYL1+SZSAMEhZl8dnCC1YAlTXjv4DC5cMPh99wSNReBPtAaD2x0PNNj8yOPpuNSSp+ZHKA+p5kILStA3ZcDAFLHjSO78eiRxJ5VGEKAOe4c6ZJDRCYtzyX0Loew6kt58irDjYGltbXWmbqjwRLhao9aA6QDJAsBE2HrH7CEGGJMCVL42IRmJTFe4UXpAAapl7ycRj2jpEWzJ2borzmAsSH9HZY0ZV09v5a7eqT9uDoicAGIlcWwnueQDTGajCSdm6SdQphkTApi/cKL0gBcF37hqxQDKnathvRJpzrH0qnH/ckH+bc+WjdIXtlbVDho4sDfbLg3NknG+Fru9DEAsIUYUtGnRcmZXkoPG8FQDv+YNWvkxYqnNumJCwc38wrpGmCjMAxXuowjyA7IJx1uzIB2QgjdYSloyzckg1syegjTBI2ZfGy8LwVAM7v+6KsMIR3CityF85oC6flH4dIumf4eTRARY1eDvSf7xjKg0bx9f+wiy1gTNZDWbCZMVteCoCcDuCgIJ1rwFDxS8Gtk6CN5KsDGcnwI1AcwMZ+nFOoTvPxg9tlWQdkw5URJkJ3oQthirBFGJPxlrCZr2NQXgqgsnrMZ7CsJ3PqcSzH/IUW0c6TERhkuGOzPz1ax9W8P8hOKIO6SUbojocwkkrYIoyBNicjfcBmVc2YKzLGSQLzUgA4xZTW/jM/QrTCrcYIo88/joprazmTLu1Qj+JAdg7QBS8kM9lT+pvCxRYwBscgqa0CI4Vr8qEqZwVQ/2xyNrb2nCYr3GH8diMSydsIISuvWOGuZVfT7gPtmEapR3EgFw5AViAzYVwVIIwR1uSt4Kf1YVWeYnBMzgpA49pnB2cc/BtbfncYR+grucOgJEL24KJOdVdfyPqkDMhxZQayEzZSCWOENcKcjDZd166UxaWH56YA6AwyjiuapY+4y3nXmhU6t19c0U239ErJVhGKAx4ccGUHMuSRxP8ouAe7WGPiLlnlUA4fZzmeGwgnouzP4ri5ENbzv8hSWglrhh7VP4GNCVNlaYIIt7m4u3Vm5Okg6lZ1jgwO1G805+qCfy5MrcFKQJudtH9vxIzNUrqE+HBTXWSVNL4/IqcRAPb8L5EXJDYIYXaFDfzEJAV+ea+pmNw4QDJEspRban9SEdYIc9jIuEFWozdm38+VXQHQJgOP4T8sa/dr0Uq5Z+D7dfn6y+FGeHd5+coJVdlwORBGWSLMEfakbSPM5rBBKKsCWDzt0oWYJxwqrajXwtZAESoFgFtXt7fO4pukNKsIxYE8OODKUsgOFHUxB+zJmkGYJezK4gfCsyoAh3PpcV4YGq1jkYoE7ANHDhQYhr/cFi1hoEPRMHI4IGzRHKrWEOaAPReDEsK8sDuQJasC0LioH0g85K8Q9zPdDtXXH04SO5vnRKRzoyFtUAGKAzlwwJUpyFYOSf1LQtgjDEoeT+z25/FUAA3x3ulwoJkhKR+Of85yeCfNlMUHEu7Qji7l9BMI70d0pZApV7bC00jCHmFQThGf0YdheQpPBcCE1iDPKjb36D3tYRr+44C/9qa2B9fJaVYxigOFc4Bki2Ss8BKKnBPTABeDTHgsB3phOMt5AFhukA7/4WzQUmFXn1zkJg2rOFyzvJItWVI210IPq7Eqs/8cgGy5MuZ/zdIaCYOERVkCLwxTHukIoKF5cwwbC6RWRGyWaNWEOElWsd/hWBIx23sM9fX3m/GjrD6SMZK1sDSbMEhYlNFDGCYsy+KlCkBMmjob6/9VmTJC4/Tu4voTGP6fmCk+iDA0dNPT83hPEHWrOkcPB0jGSNZC02JgkLBImMxIEzDsYjljpMcIAEeMzpfkQbB4ciJnR2B4USlP42+Mzaxn/K1R1TZaORAmWSMMEhYJk7L+8MKyfATAvRQAe4o79nGyCn0Px4aN1i0Pvex7varCUckBV9ZCtEmoH4vSnYvY1iz9mMsUAA5H4vNkvQsvozW6zrFEGI4HDg/rlfEvHH0xKqiAMdCVuZA0lrBImJSR049lJBn6ZFQAi+KJ4zH/rx2aHAMNwawdDIYQxwmNAuDcVMP/TJ2lwkrGgTDJHGHRxSSwmbHBwLKL6QyRGRVARHDpkAE+Ns8fbrAJYZn/CybebZ5ZuS1D21SQ4kDJOEAyR7JXsgryKJiwSJgkbMqyyTCdUQEIrsm9+wRbYyetY2UV+R/O4/7XqWpUHCAOhEf2XEwCm7J+kWE6owLgTJwqKwiXE6zjuviANN7nCJvpr/pcpapOccDlgGlaoblT0MUksCnrGhmmMyoAHCZwiqwgYbMXGNePlMX7HJ6s2cK2+lynqk5xwOXA+Ddjf8OPZCjYAUzagkn9E2SYHqIAzo/3HM05G5epUfCASrw59o03YAk8PFO832HwgHrj90u4cv31m/GqPpcDJHskg6FgBzC5fcwbmwmjmeghTBO20+OGKIAoj3gM/8UrRyQ+CL8DZqQXFMi744RmCBZI+1WlwXMgJDJImCRs4uP8iowpmbA9RAHAsilXAHCB1GxziqwCv8OdiKXm/34zXdWXwoEwyaBumZiay92UM2F7iALQBJd6+MGQ8CLXRCjm/2hMT+vpFWr5L0Uc1YvfHCAZJFn0u96M9eliCmE0YxwCM2F7iALAfudpsgIE56/iiORQzP/RnM3YjIQpj3oUBwLkgCuDkMUQPIRNwqiMlEzYHqIAcMyPVAFYjt2GIcZEWQW+htvOFl/rU5UpDkg5EA5ZxJVhtX0YzUwoXIKnpsekKIBZ8XgE1kL5EH9Px1Z8cjO6CKcXXPL3iNhR8jpUBYoDuXBAC4cswhA4kQGjUpI5m0IYHxyfogAmi5OPQmRK2MHEgu2O1R6GEQavOBgW4A/bNncGWL2qWnHgIAfCIouETcIoA1YPEpf6Q+vH+MHQFLDbQpcO/zF/IM0SiuE/NiQ5NX+r2nWwFeqH4kCAHCBZJJkMkITBVU/sx+rgsIO/0zGeogA0XdAIIOOD+UObZYRk+M/EbuUAlLGbVGAAHHAdgkJyWChhlLAqY0M6xlMUALyapPN7jCveYbY1QVawn+G4DEEN//1kuKorBw5o4bBJAaMuViUUp2M8RQG4RgRZRsZwHDIfI4n2N1gPCbP9bbWqLcwc4OEwBBJGYaiXHl2ejvE0BSAfAeAokN3cYdVh6AOchKpGAGHoCEXDQQ6ERSb7MCpkRkCc85OK8RQFAJBLjXzwd2jHDoBQjABsx1AGwIOip36EgQOhkUlg1MWqlCmpGE9RADg8UGoDcGytnTs8FCMAi/eGw/VSymQVMdo4EBaZJIwSVmX8T8d4igKAY61UAcDwtlsIJxQKQEtYmc9Al7VahSsOlJgDYZFJwihhVdZcYPyQwXEpCgCHBkidfDTd2Q/tIY0fXGipf+t6tVIApWayKj8vDoRFJgmjhFUZ8cB45eC4FAWACOkVQsxyEpoIxzkAb46V3IIyuGXqt+KAjxwIi0y6GAVWPZqegvFUBcBZVJbRtu0kTIi4ZCTYBxrOefkkHo5jmIJlhao9RBwgmSTZDJwkYNTFqoyQNIynKACsEUoVQDJpEeiCPwnIEQr8ss5V4cFyIByyafRjNSMv0jGeogCwiSBleDC4hERsP4YVPHgFwNXwf3C/qN8h4kAoZJMbfViV8CUN46kKwGME8PT2p5PY8BC4AsB2ZWUAlPStCg6WA2GQTcIoYdWDEymj/HQF4JFPRSkOKA6MNA6kKwCp5pg7ZW4UGi7z3WM+cgUaLhRLkT42WVVVJhwIg2wSRgmrHixLwXiqAuCZzxSnwmKJatgHROAKAHYKpQA8eldFBciBUMimsPqwKuFDGsZTFAB2EaVoh8FFRKMGaZXgFQDnUkPlYHrVb8UB3zkQDtm0+rGasfnpGE9RAPi6yh0IInoM65yBKwAsY/CGZqGUQMbuVYFBcYBkkmQzqPoH6nUxCqwOvA/5m4bxVAXgMQLQNS2KOU4oruEyJ3WoacCQnlUBQXIgLDJJGCWsevAiZZSfogBwqYB0lx12GFVjI0EoluC0yAS5hvNouYpSHCgVB8Iik4RRwqqsnekYT1EAGD7skWbkfCLnmnSTgSxfKcJjpjIEloKvqszCORAWmSSM4nRg6bke6RhPUQDQHtJ9xNhhVCs0EQoFkGDJqsK7SuVUHCg+B8Iik4RRwqpHC1O2CqcoANgwUiIHF4KTRifCBNg9OCyo3xGuHRpU3apexYFMHAiNTAKjLlYzEYkwxKV85FMUAE4TTYkcXAZdOyQ0FooRgMP5YYNpU78VB4LmQFhkkjBKWJXxIx3jaQpAeqMIrW+gUBGKEQCzncmyBqpwxYFAOCB4SGRSdPdhNTMX4AeQMspPUwAeRwkxfgTTjY7MxfocqoWF2T63W1UXYg6E5KMEjOLk3yNkjMIIQK4AmMO3SzNyMdWw5EZCWb5ShGMeU/uJZSLww0lK0TZVZvlxgGSRZDIMlBNGcTXYVCktaRhPGQHo3N4qy4gGTkNcivaQpS11ODY8aF0fODCp1PWo8hUHcuEAySLJZC5pfUizux+rGatKx3gK0Tv4S28hV+ZjjTibuG/fe7j/QITCGUjXI8oQmLGLVaDfHAiLLBI2CaMw2GX2A4CXYD/GD7IoRQFsqKszsR9AOg2IVo+bmm5EOFiS3z8cZQfwm+WqPgkHQiKLhE3CqIRKCn7bxfigBCkKgMIxf2gbFJ/y09D0qZrHUmFK4pK/aNNLXoWqQHEgJw6EQxY1pu0mjMpIzoTtIQoA8wcPO4A4webiXVkF/oY7MxiuOvW3TlWb4kAaB1wZhCyG4LG5tYMLcYKMlEzYHqIAHC5elxUgOD+V2fKVAlm+UoRjqaOy/vneY0pRtipTcSBXDpAMkizmmr6k6YBNF6OSSrAE+Fp61BAFgMZsSk908F2IU2wj8vbB94B/aKYh1XYBk6aqHyUcCJMMutgERqWs5/zF9LghCiApTLkC4PzEd2J/3Q1jQ+AHg7gN0bTj0xuk3hUHfOVASGSQMLnHYe8xYFTW/kzYHqIAHq2rfBOHCuzNVAgm3LEp3cfOQCWhsAPgGuRjlUNQpp5SYX5wwHUAggz6UVfWOoDJiU7yOMJoprSEacJ2etwQBUAJcGjAkKHCQEads1NhfJMuFQ6k8+lvtGs6Iwcl9SgO+M6BzqMTH0ClXqfv+EcTMOliU1KjDNMZFQBuEPWYBmhzhC2kKwWS+ksWrDNb2QFKxl1VsBcHIhEjNFNQF5NcmyOjV4bpjAqAC2ejrCAMD+brUeMNabzvEaLO9ypVhYoDLgfCI3sJy3yDsCnrGBmmMyoAk4s1soLgKXT6uxbrgNuh9PxAad4SRGDV4vDGjT1qObAEvFVFyjlAMkeyJ0/hXwxhcW+0soOwKatVhumMCmBlXew1uARnPBwEmx6MycyawzVti6wyv8OFiHzI7zpVfaObA2GSOcKii0lgM2OvAMsupjNEZlQASAf/JrE2Q3o3CEsO821bhEYBYIfSbLZsmdoeLOswFV5cDkDWXJkrbqkFl0ZYJEzKCujHMpIMfWQKAGeHMfk0gLGzhKZLPQaHVlPiEM7H1k+/5KQS16KKVxxwOeDKGmQuLOzox+JZMnq8sCxVALgBxEMB8LPhDfROWOwA1HCdGWoaIJMAFV5UDoRJ1giDhEUs3p8ta6QXlqUKgO9qWw87wIFMhcIOUDFJ2OdgovBKpvggwuDnfOrctSIcPtlBMEDV6QsHSMZI1nypLJdKgEHCImEyY3Jg2MVyxkgmP8WkpXFGAg1dJckHZ0BRj5NQX5bF+x0OD6hIbaUlXQf1mx5V38jkAMkYyVpYWkcYJCzK6CEME5Zl8dIRAGXA8KJVlhEap6FX3/+SLD6IcEewRcoYGATnR0mdMP65Mhai5hIGCYsykrwwTHk8FQDjTousYMw5ZlTalbXQEm/L0/gbg/3OtYunXqpGAf6yfdTURrJFMhaaBgN7LgaBRSlNnhjOogBa6iqw1Cc2ywrnQrsY+4/lXoOyjKUM1xiGQ+qgkFKyeHSWDZlyZSs8rSfsEQblFInNfRiWp/AeASCfI7h0GgBDwOW4jDguLz6AGNwa1LjOnBVAzarKEcwBV6bCdiMVYY8wKHk8sdufJ6sCgMPDckn5qJvPYWZvLEzTAKIVp7RL50SytqhwxQEvDoROpmjqDey5GJQQ7oXdgSxZFUDT1gdXwYXovYEMQ/5WGEtswUM1CtA4n1K/IURLNUOYpgLKiQMkSyRTYaLZxRywJ6OJMEvYlcUPhGdVAGzJEhv+AA8MZEj/iyWRy51kT6gUANGoCWtxOq3qXXGgEA6EUZYIc4Q9aXsIs4TdLE92BYACHCHul5fDZ3EeqcFyQ5s8jf8xGBpNrd9ozvW/ZlXjSOIAyRDJUpjaRFgjzGElTmrr8sbs+63JSQG0Nv3gSRwptOP9bKm/9Kh+NdYiV6eGBv+mO+yyi+KiKnhKFAXlyAGSHZKhsNGOq7ueIszJ6CKsEmZl8YPDc1IAbOlSOByxPwzOmPqbX6UdbmzArqPe1PCA37Bhw2b2RwOmQlVfphxwZSdEm36IjYSxyBEGlt75VTK2ulgFZmXxg8NzUwDIYdvOPYMzDv6NCidb79iLQFTobAFYuz2rcaM4ZjC96rfiQDYOuDID2cmWzv94HiesEeZkdXthNT1Pzgqg9czoeuifF9ILGHjHlWHXWKYZumkAtkJqXFhXKOeggZ5Sf7NzAC42kBmSnexp/U1BGCOsyWsVL/RhVZ5icExeDcTGgtsHZ075zXk9DhGwwDq6YThkDz+mYaMl3S4ZMmIVOQFzoE9WeOhGjS62gDE44Hht/pFjNANf81IAB7q678WSYE+GcihIM7TIlx3TeUwSH2iwJthHz4+LcYESoSoPPQdIRkhWwkgoYYswBtoy4xbYdDGaB/GZC5IU8PjCCZ1wMPi9JJo8A7/EhfEyRgqdsjTBhfOqmOZ8AV6LWD5Vj+JABg5ANlwZYTx0K0eEKcIWYSwD5W4QYZMwKovPFJ6XAqACHK9pAGPjuWFeBYT9JVNlgYcJcVxj3PbYPBE4hYqAADngygZkJEASpFUTpghbSDBeligLNjNmy1sBtNZFVkMbya39XPvaW4axOnRLggPN11n94g2JEwde1V/FAeKAKxOQjTByg7BEmGLAlow+wiRhUxYvC89bAVBBwnZ+IisQmmrqFCu5mDs8b2JkZRYzvM+yq119fnyPsgcUk7FlXFafLGhXh9HqT2wlLLmYArZkbPbCpCwPhRekAFraHvoD5hvbpAUL7TsJ1rUS8UlpmkAjeE1UG/d5ZQ8ItBPCUTnm/a4sMA7X2lA+SRdLwJSMOsIiYVIW7xVekAKgTQaCObfJCoah4oyYU3Oew9kTsjRBh3Mhjq+PJy4Kmg5Vf7AcIBkgWQiWCnnthKGoqDmfMCVL5WIxh40/mfIXpgBQUk9X5x34I7c4auL7e5L6SiwbSg8kzESQn2GaZjReuD55pp91qrrCwwHqe5KB8FCURgmwQxiCV9LStJjBr539WBwclvPvghXA4wsn7ceupJ9Ja+L85Fo9udjm9ippmoAjYK/AEW/a5xo2ig8GTIqq3mcOUJ9T35MM+Fx1ztURdghDWF8/WZaJMEhYlMVnCy9YAVDBB/btvwU7j/ZKK+HaDb0V0T+DSJnzkDSrbxGc6Zpjf6n+uZ6pvtWpKgqUA9TX1OeAfmivkyPMEHZg+b9BxizCHmFQFp9L+LAUQJ9jkJASgHnL8WN6zU/D9UZ6rFguRJY8DWcxzTb+z3nPiMNKXpeqIFAOUB9TXwP8sUAJyVI5YYawQxiSJcXS3y35Ov6klzUsBUCFdfV23oZ5fnt6wQPvQmg/TFYZL4Rzj8AAlRgHcl4dM6yvnftch9TR4v3U6lc5coD6lvqY+jrM9BNWXMwAO1I6gTkXe9IEuUUMWwGsWXDoPngG3CyrDtsWD4l12z/itnkflivwX3gfCMYhY+zqf1SHiIS3jwqljPqU+pb6uNAy/MhHGCGsuJgBduR1ipv7sCdPkUvMsBUAVWK2t/8M0N4prZCzq21HPwzDrjXSNGGJ4PxIh1nfUCOBsHTI8OmgvqQ+xTDvyOGXVuISgJF+rFwtq4lO/HExJ0uQR3hRFMDKCyZ3O8K5XlYvWVp1g/1Xe3LvQ5i3dMvShSYcglJlV39b2QRC0yMFE0J9SH1ZDuAnbBBGCCteqxNCON8jzBXMlEEZi6IAqLyWphvvhmcdjiqSPfy0WmPsVbhb7Y+yFGEKp6Ei5ovfUqsDYeqV/GihvqM+DPuwf6BVhA3CCL6Xpw2EDfkLjLlYGxJRWEBR10Dr4+YCnfOnZKRg6NJls8QJOot+Fp0yTZYuVOFwxnA0/ZctM/lfQ0WXIsaTA7TO37/UF2pr/0AjsOy31WbJ3+gs9irsZlK3ZFuIswrZ9DNQT/rfoo0AqGB3p6Bgy9IrGXinhqGBt1iOcS+UQU6HFg7kDewvLRE69leVx2BgPZB3xa6HH/os7Et9Aw0jLBAmCBte4Ee6ZcUEP9VfVAXgNihhfgsGQanjDxr4KV23ZmC488QAA0L/Fw4jjqZdXb++92K1gSjEvYWNPdRH1FcAf2idfNI5SFggTBA20uMOvgNTSWZ+8+B7kX4UdQowQNPiuElGl5sG3of8FeLVzt7OM8dVjL++XOZnA23AGu1rSWfvrx+tO0TuATmQWP31jQO0pZd29YV5Y08mZmDov2dvb+eN4yvGPwvMnJApjRsmxHea6iI/ksYXGFH8EQAI6d63Gi7C4jkpTWgoGnwDF/bt0NRZry+SlhNABAlYjI/9Z3WoSADMl1RJfUF9Um7gJ9knDBAWvMBPWCJMSZo/rOCSjACIogviyZkG06DVMg/F+p2CLkbjkrh4MXS3r2TjKlw1Haiu1uY6fTk6L9QOTtnaUrbxGPK7x3jhJJ+wHubhxVtc3/UARsBRpFkOIGbGomC2xZwzV9RFPVbYvGrxjstcqXeenGMb15s/5hqXzltg1NhjOcnTdW5comnaKTkXHKaEnL+OZYI7Hq3jakrgY7/Q6b39h7yG8gy/bKxwHOdFW1gPGVr0ecz9pR5/whE3N8+OfCtbeYXGl2QKMEBMh7njBoB8y8B7+l9quKFH/peNj9wD41pHenxZvOMQyRi3ljY8a55DXpxlQXNZEyk48Zp4DpkpS/C7sg6ZJ9n3BD+wQxgqZXeVXGAb48k5WGx4Cg2NyBoCD6gfC2H/Nw5nuA4rCGVjvU1vD0akbUzT7mueybelx6n34XPAva7LcbBDTkwdfmkBlYB5v+NYWO7Tv8gZl37Z8eE0beEsWDE7+mwpKS25AiDiG+PmtZjrSI0YZA9wHHahrgkYBPnHStngUpft2gYc3N7K9D89XMcPlLq+0VA+beRxL+rEXX3lONdP7SPxR9vhuqaxRwA+Kf4AiGubZ0d/mpq3+G9SAopdVeMGE4YOfpG0XGxvdKzk6ZphXIpDEKQnoEjzhy1CiH22xh5onRl5OmyklRM99RvNue4V3SG7pbcgHgrnJceyHtSM6POAfq28DLG8aVbkEnl88WJ8UwAXrN17iBEd8xwafrSUfCFWJ9i+C2Ns3HdxWNcEaboyisAqR5vDjabWWXxTGZEdOKn1G8SpmrAWY+Q4NXBiikGA4B0JtveHMTb2EawaLZAWKdibVrL7jBXzxu2RpilihG8KgGiuX2fO1XT+JOwBhqwNAMxNWPm4g3Pj6yBOajeQ5Q9rOJZ8tnNbtDTPiWzAyE8tG2bsKCzrrTNnCZ03YGl4SsYkZRiIzja5o98quHUNFJr8eG/BLMcWZ7fO8W/U6KsCoL6DlyDty5YeIEL2ANw88hnmYPONpv09lEVJVyp8lychdsKDoLWp7cF1dLy67/WHscJly/TFUy+dg57GDdN8RB3LBmOewxznV0zDwbNc/x8ATo45Ib4Jb7+f+NlFcmJKRwWcN8yHoQkXy6ogCyi0wIVQBgewu/DvZOnKORzXPbVrnK1s7zHWPT2PS/dOlHMbs9E+d62orK205sAXfhGOZ/aYE2crKbzx2L33W4CsCvavRzxXwoRoaq6LkI3M19FhEAqAnbeuqzamVz0Hhhwl6zpwoduxnYUwCB6qa8wXg4iMllKGo50mhGOTzaxnWrc89PKIHxXga18//ZKTdGZ8CEr+VAjgiJnmpcuJ7bCHsL71nqZrq9DOMenxA+/44L2VsA+c8dicmvaBML/+BqIAqHGLnzXnCY0/4WUPgC7cDW8pGEyMM6AEFvrFlMDqwcqBw/l6zs1nmmdWbguMjhJU3Lix5xghIh/ShJiNYf7YElQRqiIB/lWMWc/ByxWXerKJMuIAfos74pymMyNrZWlKGR6YAqBGNa5Pfp1r2q1eDcQXcpvZo8+LjLEbucNme6UdSXH4Or6L6WLcZvqrNVvY1t8v4WVlL/jEMqF3TWfTdGZjh5uowyjn8JHUP15tERpbb3brzZFKey0AdoxnWp/W+2U0BKoAiCj4B9wK4fi6jEA3XIiXrKRxjhFzroQwjcarvZPwMnwDxqTXnIj1auvpFdvwFYVuDNFDe/Gf7z1GM40TYLw9HuQdC+qiIaLQJ1KcV6wE3Hyj1hPoI09/Fij5nzbPilzrE2EZqwlcAYAqvjhu/RbDpCsyUjgQSD4CE4wLY53WV5DFU6sOZBmpfyE4MBpqmxlztsC6vMO2zZ01f6va5dcowf26f+DAJF2PHIbVmsmgZTpomQFFXjlSeZ5bu8S2xHjj57EOy3utnwoT7N6mOoMM3IEq8jAoADYrHo9MZqc9DI15gTejxfIdwrhyMrOuQ9oRtVzk3e7sse5yExO74UexE5ed7cBce6ftGLss3tujJaxeXa/ufXMs6335JO55ZftJL4vo0ftYhW3vr3BiRoXGtKoIDLGwTRwGL/bJWL0B3/nEEbc8m53F3inA7x3MuGUyt+4Bfy72TCzEih3shYs21NWZnul8iAyFAqB2LlqxY0yktvYvAPaZXu2GoN8DCf9HMHrUjwS8+CSL69urIJIYcfUCxL2UDjytwHeoAryPQSBCIxOyNoQvXGzDh+nnh3H7P8E872VrIZ7Fmf4fLtax3sPlRag6+9x418QqVrkaX5njvRsmlmOodWWs07lqlNoEvNmjYn3kAH8lMV67C1PTrF9+jM5eS9g984NY7pMxJFQKgIg8P95zdIy7SyLet7jAJgDD4CVazL4MroJ1sgaqcMWBUnEAx1rHnYT+AAx+D2H0JPfv7yPg7YQw5z1aV/lmqegppNzQKQBqxKL1iZMjmv4kfnpvCMLqQLLXuECP2WePCj+BQnpY5SkJB2id307oT0YrrBUAv6e1HwR0mI599srZsZdKQswwCg2lAqD2NKw352NDCO5HZ56WZZhQt+GABRgPjekj2WNwGH2sshaZA66HH7O24ACbFQCQ94oUjvPGRrCPtMyOhPJezNAqAOqzhvUWdoWxB7IpAddj0HEamcZjGuNXKAt1kSVeFedygFZaHCbuZY5I4ESPZsil1MOvLwOBn13WMttoCSsLMX0O70OMI+0JCr3PC0RH9PtbV+EKj19hVBD48kp4uaooK4QDrkxhVx++mFUka1nBD5nt+/KHF/zEh1ArACKQhk40f8LPt+ld9qBjxsAR5RFmiw8KYf0U53N6Kw1ZQSpccSCdA5AlV6awpZdkjGQtPUna+9sks2Ed9g+mNfQKgIgl4wlZUGkZZTDx6b8x9I/07bnWP7/b6rwRxpnQGV3SaVbvIecAZIhO8sH1Fp93ZcvjcFtqibvUB1kNo8EvE6dDbQNIJ5j8BMawyiYA29NZyM2HZULHMj/FtcjJ3IBnVhmfNpzOB/XuAwdweq+wxHLhmC9pRuR3OSzzEfqf7bV7GsO0zp+NU2UxAhhoxON1NbvJiwqMXjEQJv2LdVkcvvgc7vLjdAwz8qgpgZRZKiKFA5AVkhmSHZKhHMG/gmSznMBPbS4rBUAEkwsl+VHji34vvXs+MA5yjTXRGezOOONGh/EXPdOryFHPAZIRkhX33H7ITg7GPnz52b0kk2Fx782nE8tqCpDWMI6txLfAKOO9lbg/E3bQrbVs85O6FjlR0/hH1ZQgjZuj/dW9sEP8yXbMV9wbexiflwtL+rf0Xoe0WCgov6fsRgCDWCxoLzWMLtdhfdYaFJ7xJxTFvIgWxTFkuIzRtn6CM/l8OXY5IzEqMFQccGUBMkGy4cpIDuAnmSPZ69/PX5bgp04o5xHAQSEir0F03u+wCiA9Y3AgMXoK/SZu6ert/LexsQmL4Wh0jnIcGuDO6PrrOvYI9sS+REdTTcX4f4UMXQdAZMUE8r2FY7w+GdQxXsXspayNLWZlpSyr76DRyt+gExfnVI8QrzqcfcW2jc2GZsF7kE/LKZ9KNCI4gI/AVssx7tV1a4Ym2M9h6MPRZdkf5GvCjr7PlpuxT9ayEaMA+htIdoFvwAkIRhz55SODmQFtfp/NEt/gLDodo4GPYaqQzcljcHb1u8w4gDl7N9xz/yhYcovOYhj2s0/n0gQa8uM+l+sx5Kdz+8t2yJ/e1pGmANz20Q1Eus7/F4M5+TVkgziBzu3CkVb/0m7tu7s2Ou4SdO98MGZE8mZQs0fVT5r6oUfXtCf3PlRrjP0cFsD+L8BfkxMTcF2XbYtP+nljT050FSHRiBVyuotQj1XdjS86XbaQ04Ph3fOOzb6sa/ZOoUc+zYXIalPIqWCVKFAOYD3/LW6b99mOfpims19gund6rgRhxPCwnTjwOb/u6suVrmKlG7EKYIBBdDU5PuY3QdtHBsK8/rpfCsHuTIzRvx09YJ0GBl0MJeK5JdmrPBUXHAeg0HtwBNryZJXxQqzb/hFGAFejP3OSeYwKsaFMfAe39dwaXAtKX3NOzCg9GaWtoTGenIMh371QAji9NrcHArAHPoTf7a6I3FfRm/yILvSFEJ1YbrlVqkA5IFjC5vaq3oron8f0mp8WQvsh+v6QXGlC32/BlPCK5rroulzzlGu6cvYDyJnn1JEdyXdPEY64GTNBO5eMfQKj/aqqx4rjesfYbkv/Z6wa/Bl5PU/VzaVslaZkHEhSH1FfUZ+5fce0X+UMfsgGyQjJymgAP/XCqBgBDBa3C+LJmTrjuH6cnzE4POtvHD+GM/BvSGhdj8VYzSKhiQW40LIiaz6VoOQcgCNPL3f46gTrWhlzas7DXQnfx7JetmO6UujCdOE5m4kvrKiLbkyJGOEvo2IEMLgPqYMP7Ft9JtyBvoPRQM/gOM/fJFA6eyDKxq4S3ObbdeN6YYsHYSTq9MynIkvGAeI99YHbF+gT6hvqo7zATzIAWSCZGG3gp44ZdSOAwdLYuKbnGBaL/BhDxCWDw3P5DWNhG25+vU1YkbsEt07SItp5atUgF84NPw1Z9R3TeYwL42VumFfhBumvQZCn5lsy5vrLksz8ZthO6s23HcNJP6oVwADj6uPmAp2xf8eXY+ZAWB5/OzF8/KXlmL+AA5JhRCIL3EtMlcEwDxbmkBSGPbp00zJN3LYrLEOLfBnTuC8h5/gccqcmEWIjDEH/1FoXWZ0aMfrelAIY6POlS7WGxdd/TuMaThJiuP4q7wfnRYpWbCe93ThCX+m8a83CF2YBhHRq3iWpDAc5AOXahhHaau1wY4P1jr1IY+IaKOp6JMh7+or+2CGE872WphvvZkuX4lh/9SgFkCYD/VeUfRWzo29CEdSmRef0SoKGNeS77KR9pxBmlxatrNO5qIPgel92klPpoyCREG/bgsedZE+c80iNHtWvRn9cBUWAi0gLeARrR3/cjAM7flaOe2QjXhcAAAVhSURBVPYLaHHOWZQCkLBq/ur3xo6vGP91+I9eC8EbJ0mWQ7DYAHvB/azXWsYiFQmm23WwFcxUyiCNdQA95vYbma3HmdkbYxXGEgjn5QD+rLSUOb9CEe/lTNza2dv50zULDt2Xc8ZRlFApgCydfe6qjvFVY6uvw1Aeo4IC5puDysdwdh2mCfcL7izv0XvaK+zqk3GL70lQBiei/FHlbQhekPX9Fdw6/HKvvv+lSruylgvtYvDicvACjlvDesgu87MD+/bf8vjCCWqVxoOVSgF4MGdw1LmrdlVX1oz/AmeuxfmYwXGF/Rab8YVqEYK37uL6ExM5O4I79nHYxDRdOM70kaYQCPBc07ZgU80Woemv7xbsnUnCPodzUY8RVgO+9DMK4+P7uTDS2oa7O27r6eq84/GFk/a/H6N+yTigFICMM7LwZcv0hqmXfJzrGrYQ8zpZsnzCoQhwTbd4EnmeQoeswT3z6w432AQ7aR3LdfEBHEd9JL6WhyPOyKfcoNICiNg6y98FzduxTr9VjxpvvGuxjsnMmoO4+aDrLAD+bAC/KI5U8AeIC9v5SUvbQ39gS5bk5OkZFG/CVq9SAMPoEVo+xP2FX+SCfRwGw6IN4aEQaO/583BUWgNfg3XCZi+8OfaNN45IfHCiZptTuCaO1AU/HCsOtejAiRgtFAVI+bICX/VeAHo3LPPtNhfvCoe/7eiR7e/E/rr76H3HQnmx07BGPwe8mY8l0tMB+OIpMDjwYKPPH3D7zn+r5bx8e+799EoBvM+Lgn+RnaCyesxncNjoF/BlO63ggjwyAmgJmjOj/E0wbL0Ig9mrlmO3sT0dW2O1hyGaTbQMrFrYFm5U5mPgi1ANuOEvr8bSVzXAUoGTbwyAES4PBERuQNG4gAQwcaaioHMVLdorAX96C0qtF4di74fL836EdmMNHkNq0c10o8OwyKrOdifad2KLzYRphqZPhWHzBBhMT0GaU12bBivVxinxguOIO3r2d/+Pmt+jF4b5KAUwTAamZ69/Njlb17UrAa6PA1iFLVulF5rtXbDd8Iffir0JbRgOvwNtQMteuzG/bndsrR1f6t2a7gDITsK27WQyaSUTsf2Jp7c/7W5smjtlbjSWqI5Fo0ZU1/UoM7QY8lVjZIE7F51a2CmwHMphpmAYcfAjUBcAz6dBmUzMRlox4sHLHeDlH2zbuaf1zOj6YpSpyujjgFIApZIEOBYtvvB75+CruARAuQyMPrRUVY3EcqHE3sNo5AGMdpY1PfKDJ5TjTml6WSmA0vA1tVQYDhdPu3Qhlrwu1mD1xtd02Bbv1ApGypvY7GBVBEujy5u2PrhKGfRK369KAZSex0NqaIj3TmdCa8AQux5D6oUYIVQNSTQaAgQ7gCnLKkxRWhl3WlrqKraMhmaHqY1KAQTcGw3Nm2Ni0tTZsMzNh6FuPubW86AQCnJBDrgp2auHSy7sB2thYFyDtbo1fFfb+pbGGYnsGVWKUnFAKYBScbbwcvmieOL4iOBQCNpMzIFPJes6jGDDcEcunJhCc8JwR264L4L2TVw4G00u1qysi9H17rRioZ6QcEApgJB0RDYyzo/3HB3lESgDcaom+HH4kk7DaGEqRgtTkDfvnXHZ6ssxHjsg2XbQ0gZatjpcvI4pzaakMDeN5j32OfIuFMmUAghFNxROxKx4PDJZnHyULfRpmi6OoiU7dCqW7GjpTkzEtAI+9uwQfInJUSkGhRFFfBTApQNOo/01JxGewKc5iXBaGkzg602ONnuQF0uKHJ67oh3x/UuL/C2d21t38Jfe2lBXh9Nz1aM4oDigOKA4oDigOKA4oDigOKA4oDigOFAGHPj/BmkrpMF8AC4AAAAASUVORK5CYII=");
  18656. n.prototype = Object.create(r.Mesh.prototype),
  18657. n.prototype.move = function(e, t, i) {
  18658. this.hidden = i,
  18659. this.mouseLastMoveTime = Date.now()
  18660. }
  18661. ,
  18662. n.prototype.hide = function() {
  18663. this.hidden || (this.hidden = !0,
  18664. a.start(l.property(this.material.uniforms.opacity, "value", 0), o.reticuleOpacityTransitionTime))
  18665. }
  18666. ,
  18667. n.prototype.show = function() {
  18668. this.hidden = !1,
  18669. this.material.opacity <= 0 && a.start(l.property(this.material.uniforms.opacity, "value", o[this.player.mode].reticuleOpacity), o.reticuleOpacityTransitionTime)
  18670. }
  18671. ,
  18672. n.prototype.update = function() {
  18673. Date.now() - this.mouseLastMoveTime > o.hideReticuleTimeout && !this.hidden && this.hide()
  18674. }
  18675. ,
  18676. n.prototype.updatePosition = function(e, t) {
  18677. if (!this.hidden) {
  18678. if (!t)
  18679. return this.hide();
  18680. var i = t.point
  18681. , n = e.distanceTo(i)
  18682. , r = 1 + .01 * n;
  18683. n < 1 && (r -= 1 - n),
  18684. this.show(),
  18685. this.scale.set(r, r, r),
  18686. this.direction = this.direction.multiplyScalar(.8),
  18687. this.direction.add(t.face.normal.clone().multiplyScalar(.2)),
  18688. this.position.copy(i).add(t.face.normal.clone().multiplyScalar(.01)),
  18689. this.lookAt(this.position.clone().add(this.direction))
  18690. }
  18691. }
  18692. ,
  18693. n.prototype.writeAstag = function() {
  18694. var e = Math.floor(4294967296 * (1 + Math.random())).toString(16) + Math.floor(16 * (1 + Math.random())).toString(16)
  18695. , t = new Date;
  18696. this.tagCount = "undefined" == typeof this.tagCount ? 1 : this.tagCount + 1;
  18697. var i = {
  18698. enabled: !0,
  18699. version: "0",
  18700. created: t.toISOString(),
  18701. created_by: "APITest",
  18702. position: this.position.clone(),
  18703. stem: {
  18704. enabled: o.tags.pole.enabled,
  18705. direction: this.direction.multiplyScalar(o.tags.pole.height)
  18706. },
  18707. label: "tag " + this.tagCount,
  18708. description: "Description " + e,
  18709. floor: function(e) {
  18710. if (e.currentFloor) {
  18711. var t = e.floors.indexOf(e.currentFloor);
  18712. return t > -1 ? t : void 0
  18713. }
  18714. }(this.player.model),
  18715. type: "info",
  18716. metadata: {
  18717. preferred_camera: {
  18718. mode: this.player.mode
  18719. }
  18720. }
  18721. };
  18722. console.log("--------------------------"),
  18723. console.log(JSON.stringify(i));
  18724. var n = this.player.model.addtag(e, i).build();
  18725. n && (n.disc && this.player.tagDiscs.push(n.disc),
  18726. n.visible || n.show(o.tags.startup.fadeInDuration))
  18727. }
  18728. ,
  18729. t.exports = n
  18730. }
  18731. , {
  18732. "../enum/RenderLayers": 41,
  18733. "../enum/RenderOrder": 42,
  18734. "../settings": 166,
  18735. "../shaders": 167,
  18736. "../util/lerp": 188,
  18737. "../util/texture": 194,
  18738. "../util/transitions": 195,
  18739. three: 217
  18740. }],
  18741. 150: [function(e, t, i) {
  18742. "use strict";
  18743. function n(e, t) {
  18744. this.chunks = [],
  18745. this.floorId = e,
  18746. this.roomId = t,
  18747. this.position = new r.Vector3
  18748. }
  18749. var r = e("three");
  18750. n.prototype.addChunk = function(e) {
  18751. this.chunks.push(e)
  18752. }
  18753. ,
  18754. n.prototype.calcBoundaries = function() {
  18755. for (var e = new r.Vector3, t = new r.Vector3(0,0,0), i = new r.Vector3(0,0,0), n = new r.Vector3(0,0,0), o = 0, a = 0; a < this.chunks.length; a++) {
  18756. var s = this.chunks[a]
  18757. , l = s.geometry.attributes.position;
  18758. if (l)
  18759. for (var c = 0; c < l.array.length; c += 3)
  18760. e.set(l.array[c], l.array[c + 1], l.array[c + 2]),
  18761. t.add(e),
  18762. 0 === c ? (i.copy(e),
  18763. n.copy(e)) : (i.max(e),
  18764. n.min(e)),
  18765. o++
  18766. }
  18767. o > 0 ? (t.multiplyScalar(1 / o),
  18768. this.average = t) : this.average = null,
  18769. this.boundsMax = i,
  18770. this.boundsMin = n,
  18771. this.center = new r.Vector3,
  18772. this.center.copy(i).sub(n).multiplyScalar(.5).add(n)
  18773. }
  18774. ,
  18775. t.exports = n
  18776. }
  18777. , {
  18778. three: 217
  18779. }],
  18780. 151: [function(e, t, i) {
  18781. (function(i) {
  18782. "use strict";
  18783. function n(e, t, i) {
  18784. this.obj3d = null,
  18785. this.nodes = [],
  18786. this.colorHull = [],
  18787. this.shortPaths = {},
  18788. this.floorHull = null,
  18789. this.cameraHull = null,
  18790. this.floorPathDistance = 0,
  18791. this.floorCurvePoints = null,
  18792. this.floorCurveColors = null,
  18793. this.camCurvePoints = null,
  18794. this.warpDestHeroLoc = null,
  18795. this.warpDestPano = null,
  18796. this.warpPathPoints = null,
  18797. this.warpPathLengths = [0],
  18798. this.warpLength = 0,
  18799. this.closeWarpDistance = 4,
  18800. this.UP = A.UP.clone(),
  18801. this.longestStep = 0,
  18802. this.upcomingTransType = null,
  18803. this.burnsDir = 1,
  18804. this.prevNextDist = 0,
  18805. this.nextI = 0,
  18806. this.activeTransType = null,
  18807. this.lastTransType = null,
  18808. this.bunnyObj = null,
  18809. this.director = e,
  18810. this.player = t,
  18811. this.playerControls = i,
  18812. this.modelManager = t.modelManager,
  18813. this.updateModel(),
  18814. this.updateDefaultsFromModelData(),
  18815. this.bindEvents(),
  18816. this.warping = !1,
  18817. this.waitingToWarp = !1,
  18818. this.warpInterrupted = !1,
  18819. this.warpInterruptionBlackoutStyle = null,
  18820. this.warpInterruptionTravelTime = null
  18821. }
  18822. var r = e("three")
  18823. , o = e("../util/logger")
  18824. , a = e("../enum/Viewmode")
  18825. , s = e("../enum/RenderOrder")
  18826. , l = e("../enum/WarpStyle")
  18827. , c = e("../settings")
  18828. , h = e("../util/math")
  18829. , u = e("../util/lerp")
  18830. , d = e("../util/easing")
  18831. , p = e("../util/transitions")
  18832. , f = e("../objects/Snapshot")
  18833. , g = e("../effects")
  18834. , m = e("../shaders")
  18835. , v = (e("../gui/gui"),
  18836. e("../util/texture"))
  18837. , A = e("../enum/Vectors")
  18838. , y = (e("../model/ModelManager"),
  18839. new o(i))
  18840. , C = e("../enum/PlayerEvents")
  18841. , I = e("../enum/BlackoutStyle")
  18842. , E = e("../enum/ModelManagerEvents")
  18843. , b = e("../constants")
  18844. , w = {
  18845. path: v.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"),
  18846. pathEnd: v.loadBase64("iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAAAXNSR0IArs4c6QAAM3pJREFUeAHtfQmUHMWZZkTW0Ye6uRECg5FYCz3WHGK6G0kNFmqBpD4WG3Mb3sh4bOPd98aewWAMyxsj7NGADdhee97bHWwPtvy4ZJDxQF8IqYUspBbdPSCOZSX5WcJgEBIgoFt9VFZl7PdnVbWqW1XdWVfmn1WRT62sjIyM+OL7j4yIjEMKffiagUVb36qqDc88PaACc4SwTpaGPB4FOkEoOqvjJf0W4lglZCXOYSFFBcLCQokK+xr/4YggfEzRWYkxupZCjeJ8EGHvCyE/EFJ9gOv3lUVn492YjO0ZjOx/c1vjaSMI14dPGYAu6IM7A0t6eoJVVY1nqoA4VxrG2VLJM2DcMHg5W0oxy0v8Sol9wLIXWPYoqf6sLOs1GROvjIxs3bWpqSnqJTad9/QMaAcwPUeuxljSs6eysvbUeghmgRTyXBjXuULKs3BNb2zfHKg5jAml3oBjeEUJhT+xfXTw7f5NTXOoZqEPJgxoB+CxIFo2D54oqqsuhKFfaEiBs6wDpLDHsIqVfQTlHLCUeAHlfEEMj7zQubj2QLEy0+lOz4B2ANNzVNAYdf39oVnivItQdW5B9b0Fb/ezC5qB3xJT6jVw0QkuOveJHVsG6utNvxXBz3i1A3BBesu2HDolVBG6DMYOo5eXIMsaF7L1YxZDSqkNaDp0mmPm0+svmvGOHwvhJ8zaARRJWpf0Dp1UEQpfhQ67a5WUF4FozXUWXKPPAH2Kagv+e3zMjDyxYWHNe1k8rqM6ZEArpUOinERbsfXj4wKhqqvxpr8Wb/qL8Yzh5DkdZ1oGLNQMnkfN4PGYOfK77sajP5z2CR3BEQPaATiiaepIzX3mEkPKryPWFWjL0vd2fRSJAfQX0FeEdfAIv+hqCG0qUjZlk6x2ADmKevkLgzMD4cobDUN8DbX7uTkmox/LiwG127LEL2OR0V8/e2Ht/rySKtOHtQPIUvArtkfOCwSNWzBi7jq87UNZPq6jF4EB1ApM9LA8FotaD3QvCO8oQhYlm6R2AA5F2zxgrggIcSve9pc6fERH84QB9VxMiPu76kLdnmTvs0y1A5hKYGvXBlrmXH4DOvRuxd85U0XV93gxgE7DV/F3f+eepx4W11wDn6CPdAxoB5COlVWrjNa2O64V0lgFwz8zXRQd5g8G4AR2CWWt6mi/53GxapXlD9TuodQOYCLXsrUvip58dTc+5X124i195WsGlHpdKXlXR0NwHcqBYQb6IAa0A0joQWufuQxs/Ahv/PlaNUqXAdQIXob539bREFpfuqV0XrKydwDLekfnhkKBBzDz7jLntOmYfmcAMxSfNs3YLesXVu72e1nywV+2DqCl94OjRPCof8IAnm+BwFKdfZePbpTDsxEMKPqZiH7yg86Fx39SDgWeXMaydACtL0a+IgLGvSj8zMmE6OvyYwAdAvtFzLq944LwQ+VW+rJyACu2jn4mEA48iHZ+U7kJWpd3egbQP9ATi8Ru6m6s/NP0sUsjRlk4AHtJrZqLvo3q/ip09FWVhuh0KYrCgBIjaBasGhna8uNyWNKs5B1AS1/kfLzxf4W/84uiMDrRkmQAtYGX8PfVzobwSyVZwEShSnq6astA5B+lNLZr4y9lFS5O2UhnSHdIh4qTA49US7IG0PbHj45VVTMeghC/wINmjcLPDKAm8Ac5cugr7Z875qCfy5EOe8k5gNb+yAIM4X0cBTs9XYF1mGYgFwbwpeBNDCm+tqM+vD2X57k+U1JNgNZ+89tYhOeP2vi5qpt/ccV1yvhjXMf8W47JyEuiBmAvxVVR/Ws9mm+yePV1MRigUYSxseEbS2FpMt87gObt5qJAQD6Gz3ufLoawdZqagbQMKPGXWExd17UgtC3tfZ8E+rkJIFsHzO8YAblZG79PtK2UYOKFQ7pHOohi+fZF6kvgtH1W9VGnPowq/xWlpFO6LP5kAE2CdcOfvH2DH7c9850DuLT/w6PDsvY/YPyL/akuGnUpMgAnsDmiBj//XP1xH/upfL5yACv6D50ckOEuGD82zdSHZoAXA3ACr8RUpLm7fsa7vJBlRuMbBxCftx98FoBnZy6OvqMZ8JYBjBfYa5rR5X5ZZ8AXDqB1e6ReBI0OgD3RW/Hq3DUD0zMAJ3BARK3WjgXh/uljexuD/VeAtj7zUhk0erTxe6soOnfnDJCuks6S7jp/ypuYrB1Ac9/YdcKQ7aBG76brjX7oXHNnoIZ019bh3NMo+pNsHUBbf+SbhhF4BAzo5bqKrgY6gyIxECYdJl0uUvp5J8uyDwCDK+5CT/+qvEtXZgmg7XkIO+juwizInVjUYpch1PvKEkNKGoPKUIOBmMDZGrRMa9A0zMF9b741SBTNOv202pAVqjVCRq20jNpYQOAsa6WyaqUhaiwhT8BiKmdiVtw8LJd+JpRmRplRm3dx8YVgVUdd6O68EypwAuwcgO0tpfGzApez1JJ7B4b+Kgx+pxRqZ8ySO6Vl7uxcWP22GwVt6R0+VRmheQFDzVNCzoMSkWOgnZNOcSN/3+ahrG+114d/zgk/KwdA7SWqMgEUK1xeC8zuVVaiB9NRN5oxayPXT0z2p9qAsRTTsfEnmiBE/dUmRXkgR2VZseu7GioeSwn29CcbQ7N7TOMdfrrNL8RHqG4/D33ZiL+ejvqK16Al0B9fHbK1f+xs+PIm/C1Fs+RioD/GVyUoDtiIsFRbe0PoueIkn12qLBwAfeenzyaAXr69/QrtcymesCy1pqt99eaS28cO+y02t9252DDkSqnEVagh1GanqiUVe0hFrSYO4wQ8dwCJEX4vAEj5VReViCmp1gvLWnPQ3P/UtsbTRkpKzTMUZtHWt6qODc28XBgGnIGkLdmw83p5HajOHcCIwQu9bs556gDiY/srtgLE7DIT/w6lxBphjT3ScUHNvvIq+8TStr44NEsYFddLKVaiqXDexLulfQUnsDemxhq9nDvgmQNIzOrbXEYTeyz03K8TUt3bXhceKG3Vzq10bQOROqHk7fiiQNO82Y5Rya106Z+iCUSYRbjYq1mEnjiAxHz+7nKY0os3fRRV3EdlJHZP+6KKN9KrgQ5NZaBt29hZKhy4A92eX0LNIJh6rxR/wwlsxnoCK7xYT8ALByDb+s0n4eW/WIrCTClTBL9/bUbNe59dULUnJVz/dMjA8u0jc0LB0O2IfiP+SvrrEJzAOgwUugrlRMvAvcN1B9DSZ96GnuAfuldEl3NSYhhV/QdHTPP+jY3Vf3U595LMbunW4U9VhUK34qVxE2pT1SVZSBQKTuA2OIH73Cyfqw6AFvCkddRKtlqnxO9GIpGbteEXR4VtRxAO/wRO4Ori5OBtqtRctGJqsZsLjbrmAGjp7mB4xksQXgmu3qt2W0r8fWd96FlvVag8cm/pN5cbUvwrvhrMLbkSY7XhaOTQ+W4tOe5WT6sMYN3+kjP++E6y37Pe23uONn73TJG4Js4x4el7qDeX1tgJvCBtW3GJTldqAPDYt2A22f0ulcmVbDBUtz0ai35Td/C5QnfGTKijMBgI/hxDjdsyRvLhDTi3W+HoHig29KI7AOyuulAqg9r9oWIXxpX0lXgPbbVvdDQE/+BKfjoTRwy09kW/AB37N9QyT3L0APNI0DFTSWtxZ124t5hQi+oA7F16q2teQianF7MQbqWNt34PRu9dX+6j99ziO9t8EqMKH0FtoCnbZznGx/fAN+Xw0PnF3JW4qH0A9hbdpWH8lrLU3R3PrL5UGz9HU4ljItmQjEhWCLH4InWGjF6cZEPOYucWC3kU52jti9wsDePHxUndvVRRFduHCTs3dNaFMDVXH35hoGXAXIqJRg+jWTDLL5gz4bSEdTOaAj/NdD+f8KI4gBX9kb8JCKPX/+1+tWHUHLthw8Ka9/IhWT/rDQOX9A6dVBmqeBifCy/xBkFhcrX7A5S1oLMh/FJhUjycSsGbAEt6eoIBIX/pZ+NH2wuDstRd7U+vXq6N/7Cy+O0XyY5kSLK0Zeq3AiTwki2hX+NXZFuFLkLBawB+H+pL3tZSsZWclm0qtNDLMT17uTkZWOPnFxMWi/luZ0PoR4WUX0EdwIqto58JhoOv4FNMVSFBupjWEDqQruhoCK13MU+dlUsMtPaZy6Qh1yE7f648hUFP0Uj03O7Gyj8VirKCNgEC4cCDfjV+VBEP2Ms0aeMvlG6xS4ccO8mYZM0OnBNAeLHaNuYkrsM4BXMALX2Rv/Pr91coxF4RjV7EYY02h3LT0XJkwJYxZG3LPMc0vHyMbKz1xchXCoWhIE2Alt4PjpKho3cjsZmFAuZWOhjc82pMRFZ4uSyTW2XV+RxmwF6OToS7YVC0n4GvDjiv/cr8eG7nwuM/yRd4YWoAwaP+yZfGL9TW4cGhxdr481Uj/z1PMifZ43PPVr+ht20NNlcI3HnXAGhV33AoSOvW+2rFFnrzkwJsajr2o0IQqdPwJwNLeg4eU11bg7kqvqsJRCJm9Ox8VxXOuwYQCgVoxpK/jJ9WY0W1Xxu/P422kKhJB0gXfNgnEE7YXl505FUDSHxW8dUiGBD0gXiHX+WuvJjTD5cUA63bR88UweAWGISv9qfAZ+vl+Xy2zqcGgEV9RUEHJbigUUNYdKm1Y4E2fhe49lUWtk5ANwB6yFfA4zaY84s8ZweA+ddXoN003y9k2eOpaZDPgnC/XzBrnO4yQLpBA8FIV9zNOffcyAbJFnNNITcHgH3epLSnXOaar6vPodoPucZW5lNVchWwzswzBkhHSFdIZzwDkWXGti3CJrN8zI6eU9WhtW/sSxLbeOeSoRfP0NpxWF7pB17krfP0JwPYu+J7WIb8br+gV9h2vKOh4tFs8WbvNdauxWQ/Y1W2GXkXX23ofGb1au/y1zn7kYH2Z1b/MyoBG3yDnWySbDPLI+saAIb8rjQM4zdZ5uNJdLTl9o1FR+eX45Te+PftGfPAwTxDyHnosD0TQjgB51qE1aLtWINKbi3CaKONYYQPYmzEEGbLDSJ8EGHv47wLGxruRNjO4cFDO8vtsymtJ1ARrHwZ5ffFoiKWZX0ZawasgewcH1k7AFSNXkXV6GzHOXgX0YLyLiuTlXxkc+/YOUZQNsGwlyohF0KwBR+WjUbxfilULxzFRiuqeroWVrwK8fqmrZyLKtLKQnCgNDs0+9pyLhnm8QwNbuuoD52bTRJZOYDmAXMF6v9d2WTgVVz0+t2NDp1VXuVf7Hzt+RdG7ZVYdq0FeTXhDX5CsfOcnD4s/4BUYpOyrE5lDT5ZiLHpk/PgcI3xLqswjfguDlimwxATqrmrLtQ9Xbzk/ay8GhoYtyYf5HyGJ+zpaF/9fc4Yc8KGNl5zX7S1bSD6qBE8ep8MGP8Ow7/aC+Mn/Hh7nEj5Ew7CQ7gIXy5t0Zz4cOkh0iXSKZeyyyubbG3UcQ1gxfbIecGg8XJe6Nx4mNbtt0bnl9Lqvcu2HDolVBH+R1TvV8Lg+K97b++doNaYY5Gfrr9oxjtuiL3YedCS49KofNkP/Eej1vzuBeEdTjhxXAMIBI1bnCTodRx0cH2jVIy/edvI7Nb+6P8OVVX8GVXQ7/hB+Wz5w0kRXsJN+KkcXutFvvmTTpFu5ZuOG89nY6uOagCJ3tC3uK+nhmraM+gEucwNkouZhz0uPRC8E3lcD84LvhBkMbGnSxuGE0X4IyIWXe33Ydit/eYzqImx3oYMfJv4+nWak69fjmoA4UDFl7kbP/qiR7BX37fSKaBfwur636mGgt0jAsHXwPfKUjB+4p7KQeWhclH5qJx+kclknLQfJOna5HBO1+A6RDbrBJMjB2AY4mtOEvMyDhZ2+Bc/b9TZ0h+9fJaY+QbeLreTAL3kslh5U7mofFROKm+x8ilmuqRj+Lx8TzHzKETaTm12WgfQ3GcugQ+fWwhQxUtD7Vb7995XvPSLl/LyF4dPw9iKdux3/3u08T9dvJwYpYxyUnmp3FR+RsicQdm/F7Ng1W5nkb2KJefGbXfq/Kd1AJj18/Wpk/D+rqXE33e2zh3zHkl2CFoHov8taITRsyxpGmr5HSg3lZ948FPhSddI57hjdmK7U3YCrtj68XGBihnvIFIF28Iq8bv2+uA1bPGlAVbX3x+aJc67R0n5bXA7pQzSPF5yQRhQhO0X1Y/3iR13DNTX+2Yqblt/dC2kdzVXgaAzcDQWOfSp7sajP8yEccoaQCBcdQ1z4x8eiURuzlQ4juGX9o98+iRx3ma89W/Rxh+XkM0D+CBeiB+OckuHydY9hXkUTA/0uVSSDU8Fb0oHgJfTlA9PlbAr95R6cGNj9V9dyasAmWA99/kVIvQiOsIWFiC5kkuCeCF+iCc/FM7WPeggb6xT23BGB2CPfJLyYsaFi4yY5v2M8U2Ahg6vJmEYz/tmMM8E9C5e0EhH8OSkA8tFVBmzSuhgJGMEj2/AqV5MtpwJRkYHIALhK/FQ5vuZUnQpHO3Gh/zy9seSTVeivd+JKtlRLtHj62yIJ8OQXcQb94KQDpIuMsZpJGw5LcSMBi6VvDbtEwwCaWRZNGr+kAGUaSG09UW+Kg2xlnVfyrSlcD8C8UW8EX/u555djqSLidGO2T3oUuypbDmtA6DJJ3hjXeQSvuyzkeJRPwz6sd9ghkFtxLQ8Z1/wsnvCQHPgQe41AVsXoZNcpUO2TDadDl9axQxVhC5j3ENtyUiM/UiseJtfPAzS03KcThg6LC0DcALiYZvPtLd5BCZ00uKBZiIKsmWy6Ymh8av0yiklLTLB81BqXfuiijd4goujol5srMrzlK72F0ZKxCPxyfnrgK2T0M3ClLgIqWSw6SMcAA1SQc/hJUWAUJAko8zHYbe+MHI6Vunp0h1+BRH3eCLEJ/HKepyAVPeOA2b2g2yabHsyrCMcAEaoUdu/ZnJEHtdqR3d9+D95YDkShU1wRfAx/anvSG4KEoJPhGERfDydIhck/TwTaa8LD2BQo6OFOPLMKpfHaxK2PeHZIxwAejPZVv+Bbc0E9MwuaHgvDWZhBquk4BC/xDPXQnHW0XS2fYQDQFWLpwNQIiassUe4Cp4mtNDYfq74SgkX8cx2AhHpKOkqwyOdbU9wAC2bB7HII88lvzFbZD3Xpb7sKa1K/IbxlxOG6pg7JJtn8M1xKrG9dBh0NffSFfFJ2LZt4ylZTHAAorrqwpR7vH5aFtvqf8gI/R941+N4EVbaaIhv4p1lKRnr6mQbn+gAhOLpALBTzUFz/1Mchd08EP1i2c7n91ogWE/A5t9rHJPyt3U1vrvSpDscLifa+AQHgFVaWDoAJcUT2xpPY7cOG61tF1DipxzEWq4YiH9uawySrpLOcpTJZBsfdwBLevZUYsBQHUfQlqVYVv9niROxg2yZLOPFUTEIE/i35cAMH1edJRuP23qcsHEHUFl7aj2Cwsx4JDgfdbWv3swNFy3djdFputefgWBIDvZS6gywJCEkdPaj5DWjczhh6zakcQeAntUFjECOQ8Fa/8+LVav4jbHGuv3oiDpiZNU4cP3DNQZsOcT3UXAtz2kzgs7aujttRPcjpNp6igOQ57oPxUmOaqOTWG7GSex0c72beeq8pmXgen47EPHTXWJRisO2Pu4AMISRpQOIYivqaUXvcgQjFPou3jq+37HHZdqKmh3Jg+RS1EyyTJyj7saLcNjWbQewpKcniE9ZZ2VZvqJHx0orB55tqHi96BllkYE9r1qKr2TxiI7qFgOQS6Z5725BSM2HdJd0ODWMxW/Yum3zAGM7gKqqxjPRLuC39LcSPcAIDvkc9i69HLniQ5FnSEiHST6eATgyY2xYZevwkXc8DCGeyOYJgu0AVECwrP4LZfGq/q9dG8BklJUeyk5nPQ0Dtnwgp2miuXebmw4nSp60edsBYJ712e4x4jwnM8bLATTPuWKFnurrXH6exMSUYVtOnmR+ZKbcdDiJMGnztgMwhPwvyRuMzu+sX1i5mxEeETDE33LCo7GkZ4CTnBI6/E56pN6FYqHQMyj3eBNAqdneQcmQs1KvZrjjSXBL7wdHoT33BU8y15lmxwDkZMsru6eKF5uZLscLqubQ2XYA+DI4G79ZHej528kJkDRqr0T1v4oTJo0lAwOQky2vDLfdDuamy/Hyy9l0NhZtfasK31Az7hxCkbw4pFDMHIDBc6EUL4TjgzzRxmUjL266TOIjmyfbN2rDM0/nKM+YJTk5ADSZxBKOPGlM6RlIyAtfvLw/mOnyOCFk+0ZABey2wHgokx/SMtk4gObesXOgSScyoUbDcMAAyYvk5iBq0aNw0uXUwpLtow/AOjk1kMNvtJkOdS6sfpsDFsJgBGUTFywah3MGuMiNdJl02jlyt2JaJxvSkMe7lZ3TfKRi1v6XcqlT7DoeHwYwKIiP3JTaxYeZOBKyfdQAxAncgGF+N5vqP3EDPHqpb25K4gAPL7nJ/+cAsttRTjCE4lcDEIy85ZKeg8egPTnTbcno/PJngORG8ss/pfxTwKQAVoPa7BLB9lEDUOxqAFKqD/KnvDApVNfOmFeYlHQqXjDARX54077vRfmnzlOdgDUCBbs+AHzCGZwauHt3sZuKdgDu0V3wnLjIj5NOJ0km2zcAjN969pbBxgFgnoR2AEmN8eGZjfwY6XSKGI+lPgB26wBgFyA2DgDDf+150ymk6Z9+YoCJ/FjpdEJ+6CStpK8A/BxAjE8TAPyw6yPxk/0xwMpCfoqXTifFUoEaEr+lwI2ANZRE6PlZilrPMWgAuTPARH6sdDrJJmyfOgHZ7QVgmRabJgA6kbQDSCqMD89c5MdJp5NiJNtHHwC/JoBpmGwcAOZNaQeQ1BhfnnnIj5dOJwQJ26c+AHY1gH1vvsXGAWDapHYAvjT8OGgu8uOk0yniRA1AH1MzoPQiIFMTxPyult+UAiIHEJkyhgc3Z51+Gqe37rAHFOgsC8cAC/kx0+kkuxH6CjCWvOJyDlkhNg4A0zj5fJHgIiA/4WAyqpSTTo+LD7ZvQMHZ1QCMkMHGAWCuBJv+iHHB6R+OGcAGnSwcOC+djtNHtk9fAdjVAKTFxwGgE0k7AMfmxi8iF/lx0ulxKcH2WfYBxAKMet6VdgDjCuPHH0zkx0qnD8sxgoFAavTwNY9f0uLx7TbBBsNpnDzk5BMULOTHTKdt0ZHtUw3gIDdBSmXx6QNQgt1STtzkxRoPE/mx0unDAjtInYAfHL7m8UsaooYHEiyZymx/Ai68+AUHF/lx0umk7GD776MGIFlUkZKg6GwJyWIGF2FBJxKr9QkJkz6cM8BFfpx0+jB78gOMA+Cz/FYSmCElmzn4w4OHtANICsaHZy7y46TT42KE7VMfALsaAL7dslmFZ1PTsR+hqrR/nDT9wzcMkNxIfhwAc9LpFD7eN5TFrwaAejebGgCRhd7S3hTS9E+fMMBKbsx0mkRIto8agPEuN3linvKMlt7hU7nggvfeyAWLxuGcAS5yI10mnXaO3K2YxrtGTMb2uJVdNvkoI8SmGWBFVU822HVcHgxwkRsnXU6VDNm+MRjZ/2ZqIJffAYNPP0DXwopX0Z48wIUbjWN6BkheJLfpYxY/BiddTi0t2b6xrfG0ESybtC/1BoffWLGUTQ0AfGBRV7GJAy8agzMGEvKCH/D+YKbLNiFk82T79BUAh9prnxj9hzYTJweADhOrkxE9Gso0DHCSFzddjlMXt/mEA5B7puHT/dtSnuN+pplzVNbgk5g5OZI5hr7DhgHIyZYXF0DMdDlOS9zmbQeA+u2fuXCVguOUZb2jc1OuPf3ZufD4T/A98A+egtCZO2MAcrLl5Sx2UWMldPiUomaSQ+JJm487AMt6LYc0iv5IKGAsLXomWWQQs8Rvs4iuo3rEACc5cdPhpEjQRLJt3nYAMiZeSd5gdZa8HEDXnnXdaAa8x4ojDWYiA5CPLaeJod5dMdPhJBFJm7cdwMjI1l3oLmW3MhCq3E0AjD4UJsc118QwuGQNEzQaRhoGbPlATmlueREkEzrsRd4Z8yRbJ5unCLYD2NTUFBVKvZHxCY9uwPJPXN439lmPsk+brTkW+SlLZ5kWbXkFklxIPlxK3do/djbpMBc84zhg67bNI8B2APEbkmUzICjl0nHgDH6sv2jGO2gGPMQAioYwmQHIxZbP5HDPriXVYBkeh2193AEooVg6ALQAWDkAkqZlmj/EQIooQ8mWLSSSB8mFFwH8dJf4SbX1FAcgtvMiL45GSnmxWLVqHCcHjF2LqvYCxyMcsGgM4ww8kpDLeICnP6Cztu56CiJ95mgqjdv6uGGNDr7dj+js9ggApmOa2+5cnL4oHobGoqvx1jE9RKCzTjBgywHy4ERIQmeP4YQpgSWSsHX7ctwBbGqag9WB1QBDwMIw5EpuuDoWVKIXVT3ADVd54lEPxOXBp/QcdTbOjhqI23r8atwB0KWlxAvxYF7/Y2LHVYu2vlXFC5XAgIADP0CD6i/ccJUVHvBvy4FRoUlXSWcZQRqHMtnGJzgAdLixdAD4llp7bGjm5eOlYPJjoP6UYUuIf2ACpyxhEP8kB06Ft3WV7bbyE218ogMYHuHpAEi6hsGuGUCwOuuDT2EMRQf91ofLDIB3m3+Xs502O6a6auOeZOMTHEDn4toDUGaW8wKkkstaXxyaNS35HkQwLfO/oyPqQw+yLtssiW/inRsBpKOkq9xw2Xhg27aNp4Cb4AAoHMTynPcuRUAYFdenYGfz89kLqt9CM+XL+LyCf/ooNgM2z+Db5r3YmWWbPuko6SrDI51tH+EAsJECTwcAQoGNZTOAZN1RF3xGKvVjhnIvOUjEM/HNsWCcdTSdbR/hAPaJHVtA7BBHcuECzmsbiNTxxCawrtqOOzAZRS8hXkQBEb/EcxGzyDnpuG7K83JOoLgPDiVse0IuRziAgfp6EyRvmBCL04WSt3OCk4qFuIuI6LVoCLyXGq5/F4gB8Er8Es8FSrGwyTDWTbLpdLwd4QBsRpRi2wxAO+CKtm1jZxVWcoVL7bn6qr9gsYVmtLc+KVyqOiXik3glfjmyYeskdJMjNhtTBptO6wDMMfNpxh1ahgoHWFYBk8LvuCD8MnaluRwc8ltjIQnSR2fikfgkXrnCTuhkWnvyGjPZMtl0OhxpAdOUSnS0UF8Az0OJLy3fPjKHJ7g4qvb6UA+2Ob4BVxiroo88GLCIR5vPPBIp5qO2LkIni5lHPmmTLWeaJp3WAVBmWDTw8XwyLeaz6M0MhoIhtn0BybJ3NASfFJZ1E661E0iSkt0Zxm/dZPOY3XOuxiZdJJ10NdMsMpvKljM6gDEz8gTy4Ky4Ny7dOvypLHjwJGp7Q/hXyhLX6OZAdvQTX8Qb8Zfdk+7GTujgje7mmlVuVsKW0z6U0QFsWFjzHnoOn0/7FI/AcFUodCsPKFOjoDcYqmEtumNwap6Sd4kn4ov7m5/wJnQwnMTO7Uw2TLacCVdGB2A/oPg2A2x8Ut7kh1oAYY33CVgX60+EtuQy/0efUC3rYs5t/iR4W/egg8lrludpbHhKBxAzR34Hb4x1ApgeUlRXhcM/YYruCFjUiz0mzAvglfVgoSPYoWHoqpf44dzbnwrb1j3oYGoYp99ku2TDU2Ga0gF0Nx5NE1zWTZWA5/ekuLql31zuOQ6HAOg79ntix2Jo+wP0ecbhYyUdzeYBfBAvXL/zTxaArXPQvcnhzK7XJWw4I6wpHQA9ZSn1i4xPM7lhSPGvLR27K5jAmRYGjchCFZf6Lz4PL13WswgT5f888ZFupNq0ZHoQgXSNdM6DrLPK0ontTusAuhpCm/Ci2p1Vzq5HlnPFzNm3uZ5tnhnShJaoFZmP2kB5rieAclP5uU7sySheW9egc6wPtTtuu1ODnNYB0OOWJX45dTLe3zWEvIP74KB0LNGUVrz92rCVzRVoEPwlXZySC0M5qbxUbpZTeqcgnHSMdG2KKCxuObVZRw4gFhn9NapqJouSZQIhRVUwEPx5ptvcw7vqgr/fJ/afhdoA7TnAm+scybTLhfJROam8OSbj6WO2jkHXPAUxTebEM9nsNNHs29i5yNnROhBdg8h/6yy2d7EweORyfD/29TberdtHzxSB4J1g8XrOI8ycShkKSZuoPCKwdDe31XudloHitfRHL0fbn73jQqfqb9GscrR2hmMHsGJ75Lxg0GA7GWNckPiOrKzR+R0X1OwbD/Ppj+ZtI7ONUOi7WGHmKxCUbzo5k3RDEcfQrHmIduxhtWlHEmAWZ3upL6PyZcjipCwe8yRqNGrN714Q3uEkc0dNAEoonqB6zkminsYhARkVj3DbTSgXTshoOuqD/8McGTtDWeo+3wwisp2wuo9wE36/G7+tS6RTPjB+dNg/59T4SScd1wAocvOAuSIgZBf95n7AYO7uaAit4o4zK3xr1waa51yxImCgKabEFyA9Pm1RJUaA5w8xS/y2a8+6bsFni+6sKE4XubXPXCUNeVe6e9zCYkI1d9WFup3iysoBUKKt/eYr2PPsHKcZeBgPHaFqWWddaKOHGIqWdUvvB0dJo/ZKaRgtSoolEKTr21Cjin8AG2BswkIdncoafLJz4fEltwhKy4C5FL3+6yFIx7Xlogl9moQxkvLVjvrQudNEm3A7awfQ0hdZaRjGbyakwvQCnU/7xqKj86eaDMEUerawZHPv2DlGUDbBOS9VQi6EYGdmm8h08WHw+7EwRy8UbaMVVT1dCytexTMILs3jkt6hkyqClS+jI3aWH0oIR7yyoyH822ywZu0ABKqhrWd88f9C0c7MJiPv4qoN7U+vXo52HOepzQWnZ0nPwWOqa2fMgxOchzfYPFTPSV4n4FyLsFq0/mqh2LUw3yqEjSBsELY8iLBBhOG3eB/nXahF7UTYzuHBQzs3NR37UcGBck0Qu/u2XXbns+DpEq4QU3HBKe/q+PPv/2u2Ta/sHQBybe0b+5I0Ao+kAmD9W6m7MOjk+6wxanCsGGjrN7+H9SfvZgVqCjDKil3f0VDx6BRR0t7KqV3T0X7P4xiw8nraFBkGKilXNfeNXccQmobEkAHSFdIZhtDSQ4It2jaZ/u6UoTnVACjF1r4oOqAErRrkiwNVXBNOqw1fBqhDRx+agbQMoMd/Gd787Wj2hNJGYBiIwW9X5bp4Ss4OADxIfBH4T/QFzGfISSZIQypqNXUsCPdniqDDy5eB1u2Rehk0esBAjV9YQNv/ZfT8/w3w5tQZm1MTIEGOQpZ+m4FXI4JGhz3U1i8S1jhdYcDWCegGMvON8dvExG0wJ+On5/NxAIKq0/ACT9tAfPIfqjwnimCwe0X/oZN9AlnDLDIDti5AJ2zdKHJehUyebC/fJm1eDoAKY5qxW3CKFLJgxU4Lgp4dEOFu+lRW7Lx0+rwZIB0gXSCd4I30CHSRhO0dcSObgLwdwPqFlbux8sjPssmUQ1z0XZxTfVRNu3YCHKThDQZ7rAR0gHTBGwS550o2R7aXewrxJ/N2AHYy0U9+gEbI/nzBuP28FLKxurZms24OuM289/mRzEn2pAPeo8kOgW1rsLnsnkofuyAOwB4DHrNuT58F71Dy/gFZsVV3DPKWUyHRkaxJ5n5889s8wNYKNe8CTZ/CHfgsuBGkNhUuRfdSglc9IKJWq/5E6B7nXuREn/roSxAU3/XJU4UoLz779eCz39JCpEVpFKQGkAQTi8RuwqfBkeS1n86kEPQN2B4I4ifgGqtjBki2JGO/Gj/Zlm1jjks8fcSCOoDuxso/oXNi1fTZso1RQ6PA9LBhtvLJGZgtU8gWCfjrO39Kicm2yMZSgvL+WVAHQGhGhrb8GNWUl/JG5lECNATUwEQnezIIZoR5BENnWygGaFYfJvaQTP00vHdy8cmmyLYmh+d7jdpQ4Q+sGXC+lMZ2PxMeZ0VtGDXHbiiD9QQKrwQMUqT5/JWhiof9MqU3E2U0j0Upa0FnQ7jgL9aivOEIqJKW34YJp+FfXkILQtCqMGlu6iDGDJDMSHZ+N36imGypGMZPaRfFAVDCnXXhn6La4uvluakcqMXMoiWhaF24UlholMpU0geq/CQrkhnJzu9lJRsiWypWOYrSBEiCbfvjR8eq6pqXkMnpyTA/nyGMHmGNXV8KS477WQ6ZsNPS3bQitF8/RU8uFz5NvymHh85v/9wxByffK9R1UR0AgWztjyxAReOP/u8PSFBOS14r8Q2/bz5SKAXikg7Wp/gCdOzfsLwZ+3X7nXBmr18hrM911Ie3O4mfa5yiOwAChgFC34ZXfiBXkByfQ22gPRqLfvPZBVV7OOIrF0y0Vx9t1wX9aiulMkO/bsGAn4L3+k/myBUHQJm2Dpj/gXHXl00G4OtrDMzAlMx/Ufv33tfZOnfM12XxGXjaolvOnP0d6NT/xFufz/4IBeDRnuZbF/p8AZKaNomidQJOzjk2NnwjRjL9ZXK4r6+heHjz/MA4afarLf3mcl+XxUfgiWvinLgvNeMnG7FtxSV5uFYDoPI0bzcXGQG5GW21oEvlczcbJX43EoncvLGx+q/uZlweuS3dOvypqnD4JzD6q0uxxGj3R62YWty1ILTNrfK56gCoUGgKULXtR24V0PV8lBjG4qMPjpjm/doRFIZ92/BDoVvxTfYmGH91YVLllwqq/rd11IXucxOZ6w4AhZNwAk/ACVzhZkE9yCuCzzgPRaPmD3VHYW7sUwdfKBiiaeY34i+cWyr+eArGvw7GfxXQQm3cO7xwAGJJz57K6qNOxTJMcrF7RfUmJ6rW4a31qIzE7mlfVPGGNyj8lWvbtrGzVDhwB0zhSyXbXEwRCYx/8/Anb6/Y1DRnNCXYlZ+eOAAq2aX9Hx4dlrW0IktWmxm6wkpxMsEuW2qdkOre9rrwQHGy8HeqbQOROox7vR1VfaodutZB7SVrMP5XImpw8XP1x33sBQ7PHAAVlpZlsldmEWK2F4X3Lk+1AzWDNRhV+Ei5jypMjN67Hm/6lWgdnuedTNzPGXX9vTE11thdP+Nd93OP5+ipAyAIy3pH54ZCwRcAxJcrtOQlOCViSqr1wrLWHDT3P7Wt8TRfLqaSLQeLtr5VdWxo5uXCMFZKJbETjwhkm4bf48P4D5hm9MJCLOyZDxeeOwAC78cdWfIhPe2z2JFXSfGEZak1Xe2rN5fcbsaYpNPcdudiw5AwenEVjL42LQ/lEchmhyoWDoBk3tZnXioMe8WWku7tdajfH2Eo6PPoEN4YVWrjsw0Vr+M5V3uHHeKcKppc3jf22aCUS1G1X4pBOxcjst6HgfbQsFRbe0PouanIc+seGwdABaZlm+yVW6AxbhHgh3yougjz7xHK2mjGrI1eVxszcWY35wLGUiHpTzRBiOXXrMtEDsIhR2VhG++uhorHpojm6i12htbWH/kmFMh3G424KjUh3sEXhVehUDulUDtjltwpLXNn58Lqt93A0dI7fKoyQvMChpqnhJwHJZqHnvtzkPcpbuTv2zyU9a32+vDPOeFn5wCIHAwUugufB1dxIsoPWOAQDkmldsIo8ad2G0K9j36FQWEZ6F9QgyomBo2ANWSZ1qBpmIP73nxrkMo16/TTakNWqNYIGbVWzKiRAVGLzrlaYVg4i1pLyBMgj7lwNvOUtA1+hh/4YIVRqbva60PfZ4UJYFg6ACKJagJKGv8LANli5CZMjYcfA1Ttl8r6B25v/iRTrI2L+gQCRuA3AKs7BpMS02c/MRCJWbEvc2rzTyaPtQMgsImvA7/HT9+u5z6ZdH1dFgwMobf/i1x6+zMxzt4BEHC/b+eUiXwdXpoMoNrvm23mfOEASE0SIwafBeDZpak2ulSlwACMfy9G+C3n+ql2Mse+mXBBhNK4aZo8MbkQ+lozwIEB0k3SUb8YP3HmGwdAYGnSBM2cAtGb6VofmgEuDJBOkm56ObEnFy585QCogDRtkuZOg/B1uRRYP6MZKDQDpIukk15N6c2nPL7pA0hTSNnSh+XFpFxdDotGpCm/DvKYAVrsBXM27uxssJfxQvPff4efHYDNNi00GgjIxzBc6NP+o18j9i0DtHpvTF3n5gKexeDKd02AySSQAKKRQ+ejGvb05Hv6WjNQDAZI10jn/G78xI3vawApApZYL/7bGLN+D5oEoZRw/VMzUBAGUOU3Yfx3dMZ37PFllX8yEaXkAOyy2XsRSuNxFOz0yYXV15qBXBmAtb+JybzXFnuvvlzx5fqc75sAkwtOAqIdVdE54/utySeXTV97wwDpEulUqRk/sVlyNYBUFWnti9yMtQV+qJsEqazo304ZoCo/3vrf7WjAbkQlepS0AyCZtfRFzsenwl/h7/wSlaEuVhEYwFv/Jfx9tbMh/FIRkmeTZMk1ASYzSwIcHtxyARbb/C7WZCqLVXcnc6Cvs2AAOkK6QjpT6sZPrJR8DSBV9Cu2jn4mEA48iNpAU2q4/q0ZIAbwxu+JRWI3dTdW/qlcGCkrB5AUKpoFfycN4x4UfmYyTJ/LlwH08O8XMev2jgvCD5UbCyXfBEgnUFTt/l2ZH8+1lLof9yPp4uiwsmAgQjpAulCOxk8SLssaQKpqx9cZCDyAAUSXpYbr36XNAI3mM83YLX6aulsMiZS9A0iS2tpn0hZVP0L/wPxkmD6XHgNo57+MzuDbOhpC60uvdNmXSDuAiZzJ1r7oFVKqu7HO/Wcn3tJXvmZAqdeVknd1NARpGjma/fogBsqyD2AK0SsoyJPtz6w+V2EHF7wtdk0RV9/yAQMkQ5IlyZRkC8ja+FPkpmsAKWQc8XPt2kDLnMtvMKT8DmoEZx9xXwfwZUCp19DBd1/nnqceFtdcE+ML1Ftk2gE45L95wFyBPaxvRb/ppQ4f0dE8YUA9B2u/v6su1O1J9j7LVDuALAW2YnvkvEDQuAUVyev0HIMsyStSdHvMvhSPxaLWA90LwjuKlE1JJqsdQI5ivaR36KRwoOLLhiG+hlrB3ByT0Y/lxYDabVnil5HY2G82LKx5L6+kyvRh7QAKIPjmPnMJ+gm+js+IV4LQigIkqZPIwAB68MZQ+3oS7ftfdDWENmWIpoMdMqAdgEOinERbsfXj4wLhqmtQI7gG4wkuxjP6K4sT4qaPA3tXz6MDf20sMrK2u/HoD6d/RMdwwoB2AE5YyiFO64tDs0QgfCW22b4WW2pfBKI111nwiDc9dtVVW/Df4yIWebLjgpp9WTyuozpkQCulQ6LyibZsy6FTQhWhy/ApsQU1g0uQlt7oND2hQ3jTb8C0vE5zzHx6/UUz3kkfTYcWigHtAArFpMN0Prv29fDsM868ED3XcAaipezHF+B7PbjoBBed+8SOLQP19aZDKnW0AjCgHUABSMwniZbNgyeK6qoLUeO90JACZ1mH9ML5pMn4Wcy8VAOWEi+gnC+I4ZEXOhfXHmCMt+ShaQfATMRLevZUVtaeWg/BLMAMxXNhMOeilnAWrn31dSHeW6/egKG/gpl3+BPbRwff7t/UNGeUGeVlDUc7AB+If0lPT7CqqvFMFRDnYiGTs9GxeAYcwxwY12xUnWd5WQRU39E5p/YCyx502P1ZWdZrMiZeGRnZumtTU1PUS2w67+kZ0A5geo5Yx1i09a2q2vDM0wMqAIdgnSwNeTwAn4A+dJzVCRAwXR+rhKzEuQLfIsIIC+NbOtUokk2NCMLH8JaOIJwWSBmTQtGb+iDCPoBxvy+kwlm8ryw6G+/GZGzPYGT/m9saT9PrLIIYvx7/H1IyCcsl4M1WAAAAAElFTkSuQmCC"),
  18847. pathStart: v.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==")
  18848. };
  18849. n.prototype.setScene = function(e) {
  18850. this.createCpm(e),
  18851. this.createBunnyObj(e)
  18852. }
  18853. ,
  18854. n.prototype.updateModel = function() {
  18855. this.model = this.modelManager.getActiveModel()
  18856. }
  18857. ,
  18858. n.prototype.bindEvents = function() {
  18859. this.modelManager.on(E.ActiveModelChanged, this.updateModel.bind(this))
  18860. }
  18861. ,
  18862. n.prototype.updateDefaultsFromModelData = function() {
  18863. this.model.data
  18864. }
  18865. ,
  18866. n.prototype.pointPathDistance = function(e) {
  18867. for (var t = 0, i = 1; i < e.length; i += 1)
  18868. t += e[i - 1].distanceTo(e[i]);
  18869. return t
  18870. }
  18871. ,
  18872. n.prototype.pointPathLengths = function(e) {
  18873. for (var t = [0], i = 1; i < e.length; i += 1)
  18874. t.push(t[i - 1] + e[i - 1].distanceTo(e[i]));
  18875. return t
  18876. }
  18877. ,
  18878. n.prototype.interpAlongPath = function(e, t, i) {
  18879. var n, o = new r.Vector3, a = t[t.length - 1];
  18880. if (i < 1) {
  18881. n = i * a;
  18882. for (var s = 1; s < t.length; s += 1)
  18883. if (t[s] > n) {
  18884. var l = (n - t[s - 1]) / (t[s] - t[s - 1]);
  18885. return o.copy(e[s]),
  18886. o.sub(e[s - 1]),
  18887. o.multiplyScalar(l),
  18888. o.add(e[s - 1]),
  18889. o
  18890. }
  18891. } else
  18892. o.copy(e[e.length - 1]);
  18893. return o
  18894. }
  18895. ,
  18896. n.prototype.pathHeight = function() {
  18897. return this.player.mode !== a.FLOORPLAN ? c.path.height : c.path.outsideHeight
  18898. }
  18899. ,
  18900. n.prototype.createBunnyObj = function(e) {
  18901. this.bunnyObj || (this.bunnyObj = new r.AxisHelper(.1),
  18902. this.bunnyObj.visible = c.warp.showBunny),
  18903. this.bunnyObj.parent && this.bunnyObj.parent.remove(bunnyObj),
  18904. e.add(this.bunnyObj)
  18905. }
  18906. ,
  18907. n.prototype.createCpm = function(e) {
  18908. if (!this.currentPanoMarker) {
  18909. var t = this.makeWaypointObj(w.pathEnd, "Current");
  18910. t.material.uniforms.opacity.value = 0,
  18911. this.currentPanoMarker = {
  18912. mesh: t,
  18913. placed: !1
  18914. }
  18915. }
  18916. this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  18917. this.placeCpm(),
  18918. this.currentPanoMarker.mesh.parent || e.add(this.currentPanoMarker.mesh)
  18919. }
  18920. ,
  18921. n.prototype.placeCpm = function() {
  18922. if (c.path.mapGuides && this.player.currentPano && this.player.currentPano.isAligned()) {
  18923. var e = this.player.currentPano.floor;
  18924. this.currentPanoMarker.mesh.parent !== this.player.currentPano.floor && (this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  18925. e.add(this.currentPanoMarker.mesh)),
  18926. this.currentPanoMarker.mesh.position.copy(this.player.currentPano.floorPosition).sub(e.position),
  18927. this.currentPanoMarker.mesh.position.y += this.pathHeight(),
  18928. this.currentPanoMarker.placed = !0
  18929. } else
  18930. this.popOutCpm()
  18931. }
  18932. ,
  18933. n.prototype.fadeInCpm = function(e) {
  18934. this.player.mode === a.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || c.path.mapGuides && this.currentPanoMarker.placed && p.start(u.property(this.currentPanoMarker.mesh.material.uniforms.opacity, "value", 1), e)
  18935. }
  18936. ,
  18937. n.prototype.fadeOutCpm = function(e) {
  18938. p.start(u.property(this.currentPanoMarker.mesh.material.uniforms.opacity, "value", 0), e)
  18939. }
  18940. ,
  18941. n.prototype.popInCpm = function() {
  18942. c.path.mapGuides && this.currentPanoMarker.placed && this.fadeInCpm(2)
  18943. }
  18944. ,
  18945. n.prototype.popOutCpm = function() {
  18946. this.fadeOutCpm(2)
  18947. }
  18948. ,
  18949. n.prototype.brushPrefs = {
  18950. linewidth: 7,
  18951. strokeWidth: 15,
  18952. cvSegments: 48,
  18953. paveStep: .1,
  18954. paveWidth: .2,
  18955. lookBlendDist: 3,
  18956. maxTurn: r.Math.degToRad(2)
  18957. },
  18958. n.prototype.panoPathDistance = function(e) {
  18959. var t = this.model.panos;
  18960. if (!e || e.length < 2)
  18961. return 0;
  18962. for (var i = [], n = 0; n < e.length; n += 1)
  18963. i.push(t.get(e[n]).floorPosition);
  18964. return this.pointPathDistance(i)
  18965. }
  18966. ,
  18967. n.prototype.loadTileTexture = function(e) {
  18968. var t = v.load(e, function(t) {
  18969. t.wrapS = r.RepeatWrapping,
  18970. t.wrapT = r.RepeatWrapping,
  18971. t.needsUpdate = !0,
  18972. y.debug('path texture "' + e + '" is ready')
  18973. }, function() {
  18974. y.error('path texture "' + e + '" failed')
  18975. });
  18976. return t.mapping = r.UVMapping,
  18977. t
  18978. }
  18979. ,
  18980. n.prototype.buildWarpDestinationDescriptor = function(e, t, i, n, r, o) {
  18981. var a = {
  18982. cameraMode: n,
  18983. position: e,
  18984. quaternion: t,
  18985. panoId: i,
  18986. orthoZoom: o,
  18987. floorVisibility: r,
  18988. thumbUrl: null,
  18989. name: null
  18990. };
  18991. return new f(a)
  18992. }
  18993. ,
  18994. n.prototype.buildWarpDestinationDescriptorFromHero = function(e) {
  18995. return this.buildWarpDestinationDescriptor(e.position, e.quaternion, this.getHeroId(e), e.cameraMode, e.floorVisibility, e.orthoZoom)
  18996. }
  18997. ,
  18998. n.prototype.setWarpDestination = function(e) {
  18999. this.warpDestHeroLoc = e
  19000. }
  19001. ,
  19002. n.prototype.setWarpDestinationByHeroIndex = function(e) {
  19003. var t = this.getHeroDescriptorByHeroIndex(e);
  19004. return null !== t && (this.setWarpDestination(t),
  19005. !0)
  19006. }
  19007. ,
  19008. n.prototype.setWarpDestinationByPano = function(e, t) {
  19009. var i = this.model.panos.get(e.id);
  19010. return !!i && this.setWarpDestinationByPanoId(e.id, t)
  19011. }
  19012. ,
  19013. n.prototype.setWarpDestinationByPanoId = function(e, t) {
  19014. var i = this.model.panos.get(e);
  19015. if (i) {
  19016. t = t || new r.Quaternion;
  19017. var n = this.buildWarpDestinationDescriptor(i.position, t, i.id, "panorama", [], -1);
  19018. return this.setWarpDestination(n),
  19019. !0
  19020. }
  19021. return !1
  19022. }
  19023. ,
  19024. n.prototype.getHeroDescriptorByHeroIndex = function(e) {
  19025. var t = this.model.heroCount();
  19026. if (null !== this.warpDestHeroLoc && t < 2)
  19027. return y.info("ShowPath.getHeroDescriptorByHeroIndex() -> Only one hero location is available."),
  19028. this.model.getHeroDescriptorByIndex(0);
  19029. var i = this.model.getHeroDescriptorByIndex(e);
  19030. if (i) {
  19031. var n = i.isPano() ? i.panoId : i.cameraMode;
  19032. y.debug('ShowPath.getHeroDescriptorByHeroIndex() -> New brush/warp destination: "' + n + '" out of ' + t + " choices.")
  19033. }
  19034. return i
  19035. }
  19036. ,
  19037. n.prototype.getHeroDescriptorByPano = function(e) {
  19038. var t = this.model.panos.get(e.id);
  19039. return t ? this.getHeroDescriptorByPanoId(e.id) : null
  19040. }
  19041. ,
  19042. n.prototype.getHeroDescriptorByPanoId = function(e) {
  19043. var t = this.getHeroIndexFromPanoId(e);
  19044. return this.getHeroDescriptorByHeroIndex(t)
  19045. }
  19046. ,
  19047. n.prototype.getHeroIndexFromPanoId = function(e) {
  19048. for (var t = 0; t < this.model.heroLocations.length; t++) {
  19049. var i = this.model.heroLocations[t]
  19050. , n = this.getHeroId(i);
  19051. if (n && n === e)
  19052. return t
  19053. }
  19054. return -1
  19055. }
  19056. ,
  19057. n.prototype.getHeroPano = function(e) {
  19058. if (null === e)
  19059. return y.warn("getHeroPano(): no destination"),
  19060. null;
  19061. var t = this.getHeroId(e)
  19062. , i = this.model.panos.get(t);
  19063. return void 0 === i && (i = null,
  19064. "" !== t && y.debug('unable to find pano "' + t + '"')),
  19065. i
  19066. }
  19067. ,
  19068. n.prototype.getHeroId = function(e) {
  19069. return e.panoId
  19070. }
  19071. ,
  19072. n.prototype.setWarpDestPano = function() {
  19073. return this.warpDestPano = this.getHeroPano(this.warpDestHeroLoc),
  19074. this.warpDestPano
  19075. }
  19076. ,
  19077. n.prototype.brushToWarpPano = function(e, t) {
  19078. if (this.discardPathObject(),
  19079. !this.setWarpDestPano())
  19080. return !1;
  19081. if (this.warpDestHeroLoc.cameraMode !== a.PANORAMA && y.warn("Can only brush from pano to pano"),
  19082. !this.warpDestPano)
  19083. return y.info("No brush"),
  19084. !1;
  19085. if (!this.player.currentPano)
  19086. return y.debug("No current pano, visibility undefined"),
  19087. !1;
  19088. if (!this.warpDestPano)
  19089. return y.info("No wPano, visibility undefined"),
  19090. !1;
  19091. if (!this.warpDestPano.isAligned())
  19092. return y.debug("Cannot brush to unaligned pano"),
  19093. !1;
  19094. var i = (e === l.STD || e === l.WALK) && c.path.mapGuides
  19095. , n = !0;
  19096. if (this.player.currentPano.id === this.warpDestPano.id)
  19097. y.debug("Already at destination pano");
  19098. else {
  19099. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  19100. n = void 0 === this.nodes || null === this.nodes || this.nodes.length < 1,
  19101. this.obj3d = new r.Object3D,
  19102. y.debug('Brushing from "' + this.player.currentPano.id + '" to "' + this.warpDestPano.id + '" (' + (this.nodes ? this.nodes.length : 0) + ")"),
  19103. n ? (y.info('No "walkable" route, using fall-back warp style transition'),
  19104. e = t) : (this.setPathHulls(this.nodes),
  19105. this.setFloorCurves(),
  19106. i && ("chevron" === c.path.style ? this.obj3d.add(this.drawPathPavement(this.floorCurvePoints)) : "ribbon" === c.path.style && this.obj3d.add(this.drawPathRibbon(this.floorCurvePoints, this.floorCurveColors)))),
  19107. this.player.currentPano.floor.add(this.obj3d);
  19108. var o = this.player.mode === a.DOLLHOUSE || this.player.mode === a.FLOORPLAN
  19109. , s = e === l.STD;
  19110. if (!n && (i || s)) {
  19111. if (o) {
  19112. var h = this.makeStartMarker(this.floorHull[0], this.floorCurvePoints);
  19113. this.obj3d.add(h)
  19114. }
  19115. var u = this.makeEndMarker(this.floorHull[this.floorHull.length - 1]);
  19116. this.obj3d.add(u)
  19117. }
  19118. this.appearSlow()
  19119. }
  19120. return this.upcomingTransType = e,
  19121. !n
  19122. }
  19123. ,
  19124. n.prototype.findShortestPath = function(e, t) {
  19125. if (!e || !t)
  19126. return null;
  19127. var i = c.warp.walkExtraPanosDistance
  19128. , n = e.id + ":" + t.id + ":" + i;
  19129. if (this.shortPaths.hasOwnProperty(n))
  19130. return this.shortPaths[n] ? this.shortPaths[n].slice() : null;
  19131. var r = t.id + ":" + e.id + ":" + i;
  19132. if (this.shortPaths.hasOwnProperty(r))
  19133. return this.shortPaths[r] ? this.shortPaths[r].slice().reverse() : null;
  19134. var o = this.model.panos.aStarSearch(e, t);
  19135. return this.model.panos.includeNodesNearPath(o, i),
  19136. this.shortPaths[n] = o ? o.slice() : null,
  19137. o
  19138. }
  19139. ,
  19140. n.prototype.makePathHulls = function(e) {
  19141. var t, i, n, r, o, a = 0, s = [], l = [], h = [], u = this.model.panos;
  19142. t = u.get(e[0]),
  19143. r = t.floor.floorIndex;
  19144. for (var d = 0; d < e.length; d += 1)
  19145. t = u.get(e[d]),
  19146. i = t.floorPosition.clone().sub(this.model.position),
  19147. i.y += this.pathHeight(),
  19148. s.push(i),
  19149. l.push(t.position.clone()),
  19150. n = t.floor.floorIndex,
  19151. h.push(n > r ? c.path.colorUp : n < r ? c.path.colorDown : c.path.color),
  19152. d > 0 && (o = l[d].distanceTo(l[d - 1]),
  19153. o > a && (a = o));
  19154. return a > this.longestStep && (this.longestStep = a,
  19155. y.debug("path contains " + a + " meter segment")),
  19156. {
  19157. floor: s,
  19158. camera: l,
  19159. color: h
  19160. }
  19161. }
  19162. ,
  19163. n.prototype.makeFloorCurves = function(e, t, i) {
  19164. var n = this.player.mode === a.PANORAMA ? c.path.waypointIndoorRadius : c.path.waypointRadius
  19165. , o = this.pointPathDistance(e) - 2 * n
  19166. , s = e.slice(0)
  19167. , l = s[1].clone().sub(s[0]);
  19168. l.y = 0,
  19169. l.normalize().multiplyScalar(n),
  19170. s[0] = (new r.Vector3).copy(s[0]).add(l),
  19171. l = s[s.length - 2].clone().sub(s[s.length - 1]),
  19172. l.y = 0,
  19173. l.normalize().multiplyScalar(n),
  19174. s[s.length - 1] = (new r.Vector3).copy(s[s.length - 1]).add(l);
  19175. var h = new r.CatmullRomCurve3(s)
  19176. , u = Math.floor(o / i);
  19177. u = 4 * Math.floor(u / 4),
  19178. u = Math.max(4, u);
  19179. for (var d, p, f, g = h.getSpacedPoints(u), m = [], v = new r.Vector3, A = 0; A < g.length; A += 1) {
  19180. f = 0,
  19181. d = g[A].distanceTo(e[0]);
  19182. for (var y = 1; y < e.length; y += 1)
  19183. v.copy(g[A]).sub(e[y]),
  19184. v.y *= 4,
  19185. p = v.length(),
  19186. p < d && (f = y);
  19187. m.push(t[f])
  19188. }
  19189. return {
  19190. distance: o,
  19191. points: g,
  19192. colors: m
  19193. }
  19194. }
  19195. ,
  19196. n.prototype.makeCameraCurvePoints = function(e, t) {
  19197. var i = this.pointPathDistance(e)
  19198. , n = new r.CatmullRomCurve3(e);
  19199. return n.getSpacedPoints(Math.max(2, Math.floor(i / t)))
  19200. }
  19201. ,
  19202. n.prototype.makeCameraCurveTangents = function(e, t) {
  19203. var i = this.pointPathDistance(e)
  19204. , n = new r.CatmullRomCurve3(e)
  19205. , o = Math.max(2, Math.floor(i / t));
  19206. o || (o = 5);
  19207. for (var a = [], s = 0; s <= o; s++)
  19208. a.push(n.getTangentAt(s / o));
  19209. return a
  19210. }
  19211. ,
  19212. n.prototype.setPathHulls = function(e) {
  19213. var t = this.makePathHulls(e);
  19214. this.floorHull = t.floor,
  19215. this.cameraHull = t.camera,
  19216. this.colorHull = t.color
  19217. }
  19218. ,
  19219. n.prototype.setFloorCurves = function() {
  19220. var e = this.makeFloorCurves(this.floorHull, this.colorHull, this.brushPrefs.paveStep);
  19221. this.floorPathDistance = e.distance,
  19222. this.floorCurvePoints = e.points,
  19223. this.floorCurveColors = e.colors
  19224. }
  19225. ,
  19226. n.prototype.setCameraCurvePoints = function() {
  19227. this.camCurvePoints = this.makeCameraCurvePoints(this.cameraHull, c.warp.stepFactor * this.brushPrefs.paveStep)
  19228. }
  19229. ,
  19230. n.prototype.chooseWarpPath = function(e) {
  19231. var t, i, n, o = this.playerControls.cameras[a.PANORAMA];
  19232. if (this.player.currentPano === this.warpDestPano || !e)
  19233. return this.warpPathPoints = null,
  19234. this.warpLength = 0,
  19235. !1;
  19236. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  19237. void 0 === this.nodes || null === this.nodes || this.nodes.length < 1 ? (y.debug("warp path to unreachable node"),
  19238. t = this.warpDestPano.position.clone().sub(o.position),
  19239. i = t.clone().negate(),
  19240. t.multiplyScalar(.15).add(o.position),
  19241. i.multiplyScalar(.15).add(this.warpDestPano.position),
  19242. t.y = o.position.y,
  19243. i.y = this.warpDestPano.position.y,
  19244. n = new r.CubicBezierCurve3(o.position.clone(),t,i,this.warpDestPano.position.clone()),
  19245. this.warpPathPoints = n.getSpacedPoints(this.brushPrefs.cvSegments)) : (y.debug("follow warp path (path distance was " + this.nodes.length + " nodes, " + this.floorPathDistance + ")"),
  19246. this.setCameraCurvePoints(),
  19247. this.warpPathPoints = this.camCurvePoints.slice(0)),
  19248. this.warpLength = 0,
  19249. this.warpPathLengths = [0];
  19250. for (var s = new r.Vector3, l = new r.Vector3, h = Math.cos(r.Math.degToRad(c.warp.minBrakeAngle)), u = Math.cos(r.Math.degToRad(c.warp.maxBrakeAngle)), d = 1; d < this.warpPathPoints.length; d += 1) {
  19251. s.copy(this.warpPathPoints[d - 1]).sub(this.warpPathPoints[d]);
  19252. var p = s.length();
  19253. s.y *= c.warp.climbEffort;
  19254. var f = s.length() / p;
  19255. if (d > 1) {
  19256. s.setY(0).normalize(),
  19257. l.copy(this.warpPathPoints[d - 2]).sub(this.warpPathPoints[d - 1]).setY(0).normalize();
  19258. var g = Math.min(1, s.dot(l))
  19259. , m = 1 + (c.warp.brakeStrength - 1) * (1 - r.Math.smoothstep(g, u, h));
  19260. f = Math.max(m, f)
  19261. }
  19262. this.warpLength += p * f,
  19263. this.warpPathLengths[d] = this.warpLength
  19264. }
  19265. return !0
  19266. }
  19267. ,
  19268. n.prototype.drawPathRibbon = function(e, t) {
  19269. this.bunnyObj.visible = c.warp.showBunny;
  19270. for (var i = .6 * c.path.ribbonWidth * .5, n = new r.Vector3, o = new r.Vector3(0,this.pathHeight(),0), l = new r.Geometry, h = new r.Vector3, u = 0; u < e.length; u += 1) {
  19271. h.copy(e[u]),
  19272. 0 === u ? h.sub(e[u + 1]) : h.sub(e[u - 1]).negate(),
  19273. h.normalize(),
  19274. n.crossVectors(h, A.UP),
  19275. n.multiplyScalar(i);
  19276. var d = (new r.Vector3).copy(e[u]).add(o);
  19277. d.sub(n),
  19278. l.vertices.push(d),
  19279. d = (new r.Vector3).copy(e[u]).add(o),
  19280. d.add(n),
  19281. l.vertices.push(d)
  19282. }
  19283. var p, f = 0;
  19284. for (u = 0; u < e.length - 1; u += 1) {
  19285. var g = 2 * u
  19286. , v = f;
  19287. f += e[u + 1].distanceTo(e[u]);
  19288. var y = f
  19289. , C = t[u]
  19290. , I = t[u + 1];
  19291. p = new r.Face3(g,g + 1,g + 2),
  19292. p.vertexColors = [new r.Color(C), new r.Color(C), new r.Color(I)],
  19293. l.faces.push(p),
  19294. l.faceVertexUvs[0].push([new r.Vector2(0,v), new r.Vector2(1,v), new r.Vector2(0,y)]),
  19295. p = new r.Face3(g + 2,g + 1,g + 3),
  19296. p.vertexColors = [new r.Color(I), new r.Color(C), new r.Color(I)],
  19297. l.faces.push(p),
  19298. l.faceVertexUvs[0].push([new r.Vector2(0,y), new r.Vector2(1,v), new r.Vector2(1,y)])
  19299. }
  19300. l.computeFaceNormals(),
  19301. l.computeVertexNormals();
  19302. var E, b;
  19303. this.player.mode === a.PANORAMA ? (b = r.UniformsUtils.clone(m.ribbon.uniforms),
  19304. b.map.value = w.path,
  19305. b.opacity.value = 0,
  19306. b.color.value.set(c.path.color),
  19307. E = new r.RawShaderMaterial({
  19308. side: r.DoubleSide,
  19309. depthWrite: !1,
  19310. transparent: !0,
  19311. vertexShader: m.ribbon.vertexShader,
  19312. fragmentShader: m.ribbon.fragmentShader,
  19313. uniforms: b,
  19314. name: "ribbonT",
  19315. opacity: 0
  19316. })) : E = new r.MeshBasicMaterial({
  19317. color: 16777215,
  19318. side: r.DoubleSide,
  19319. name: "ribbonOut",
  19320. vertexColors: r.VertexColors
  19321. });
  19322. var _ = new r.Mesh(l,E);
  19323. return _.name = "ribbon",
  19324. this.player.mode === a.PANORAMA && (_.renderOrder = s.ribbon),
  19325. _
  19326. }
  19327. ,
  19328. n.prototype.drawPathPavement = function(e) {
  19329. for (var t, i = .25, n = new r.Vector3, o = new r.Geometry, s = new r.Vector3, l = 0; l < e.length; l += 1)
  19330. s.copy(e[l]),
  19331. 0 === l ? s.sub(e[l + 1]).negate() : s.sub(e[l - 1]),
  19332. s.normalize(),
  19333. n.crossVectors(s, A.UP),
  19334. n.multiplyScalar(this.brushPrefs.paveWidth),
  19335. t = (new r.Vector3).copy(e[l]),
  19336. t.sub(n),
  19337. o.vertices.push(t),
  19338. o.vertices.push((new r.Vector3).copy(e[l])),
  19339. t = (new r.Vector3).copy(e[l]),
  19340. t.add(n),
  19341. o.vertices.push(t);
  19342. var h, u, d;
  19343. for (l = 0; l < e.length - 1; l += 1)
  19344. h = 3 * l + 1,
  19345. u = l * i,
  19346. d = u + i,
  19347. o.faces.push(new r.Face3(h - 1,h,h + 3)),
  19348. o.faceVertexUvs[0].push([new r.Vector2(0,u), new r.Vector2(.5,u), new r.Vector2(.5,d)]),
  19349. o.faces.push(new r.Face3(h + 3,h + 2,h - 1)),
  19350. o.faceVertexUvs[0].push([new r.Vector2(.5,d), new r.Vector2(0,d), new r.Vector2(0,u)]),
  19351. o.faces.push(new r.Face3(h + 3,h,h + 1)),
  19352. o.faceVertexUvs[0].push([new r.Vector2(.5,d), new r.Vector2(.5,u), new r.Vector2(1,u)]),
  19353. o.faces.push(new r.Face3(h + 3,h + 1,h + 4)),
  19354. o.faceVertexUvs[0].push([new r.Vector2(.5,d), new r.Vector2(1,u), new r.Vector2(1,d)]);
  19355. var p = this.player.mode === a.PANORAMA ? new r.MeshBasicMaterial({
  19356. color: c.path.color,
  19357. side: r.DoubleSide,
  19358. transparent: !0,
  19359. depthWrite: !1,
  19360. opacity: 0,
  19361. name: "paveT",
  19362. map: w.path
  19363. }) : new r.MeshBasicMaterial({
  19364. color: c.path.color,
  19365. side: r.DoubleSide,
  19366. transparent: !0,
  19367. depthWrite: !1,
  19368. opacity: 1,
  19369. name: "paveO",
  19370. map: w.path
  19371. });
  19372. return new r.Mesh(o,p)
  19373. }
  19374. ,
  19375. n.prototype.hintPrefs = {
  19376. rad: .18,
  19377. width: .0125,
  19378. depth: .0625,
  19379. setBack: -.04,
  19380. markRad: .25,
  19381. markInnerRad: .16
  19382. },
  19383. n.prototype.makeWaypointObj = function(e, t) {
  19384. var i = new r.Geometry
  19385. , n = this.player.mode === a.PANORAMA ? c.path.waypointIndoorRadius : c.path.waypointRadius
  19386. , o = this.pathHeight();
  19387. i.vertices.push(new r.Vector3(-n,o,n), new r.Vector3(-n,o,-n), new r.Vector3(n,o,-n), new r.Vector3(n,o,n)),
  19388. i.faces.push(new r.Face3(0,1,2), new r.Face3(2,3,0)),
  19389. i.faceVertexUvs[0].push([new r.Vector2(0,0), new r.Vector2(1,0), new r.Vector2(1,1)]),
  19390. i.faceVertexUvs[0].push([new r.Vector2(1,1), new r.Vector2(0,1), new r.Vector2(0,0)]);
  19391. var s = r.UniformsUtils.clone(m.waypoint.uniforms);
  19392. s.map.value = e,
  19393. s.opacity.value = 0,
  19394. s.color.value.set(c.path.color);
  19395. var l = {
  19396. side: r.DoubleSide,
  19397. depthWrite: !1,
  19398. transparent: !0,
  19399. vertexShader: m.waypoint.vertexShader,
  19400. fragmentShader: m.waypoint.fragmentShader,
  19401. uniforms: s,
  19402. name: "waypoint",
  19403. opacity: 0
  19404. };
  19405. this.player.mode !== a.PANORAMA && (l.depthTest = !1,
  19406. l.name = "wayPtOut");
  19407. var h = new r.RawShaderMaterial(l)
  19408. , u = new r.Mesh(i,h);
  19409. return u.name = t,
  19410. u
  19411. }
  19412. ,
  19413. n.prototype.makeStartMarker = function(e, t) {
  19414. var i = (new r.Vector3).copy(t[1]).sub(t[0]);
  19415. i.y = 0,
  19416. i.normalize();
  19417. var n = Math.acos(i.x)
  19418. , o = this.makeWaypointObj(w.pathStart, "Start");
  19419. return o.rotateOnAxis(new r.Vector3(0,1,0), n),
  19420. o.position.copy(e),
  19421. o
  19422. }
  19423. ,
  19424. n.prototype.makeEndMarker = function(e) {
  19425. var t = this.makeWaypointObj(w.pathEnd, "End")
  19426. , i = this.model.panos.get(this.nodes[0]).floor.floorIndex
  19427. , n = this.model.panos.get(this.nodes[this.nodes.length - 1]).floor.floorIndex;
  19428. return i < n ? t.material.uniforms.color.value.set(c.path.colorUp) : i > n && t.material.uniforms.color.value.set(c.path.colorDown),
  19429. t.position.copy(e),
  19430. t
  19431. }
  19432. ,
  19433. n.prototype.pathClean = function(e) {
  19434. if (e) {
  19435. for (var t in e.children)
  19436. this.pathClean(e.children[t]);
  19437. e.geometry && e.geometry.dispose(),
  19438. e.material && e.material.dispose()
  19439. }
  19440. }
  19441. ,
  19442. n.prototype.discardPathObject = function() {
  19443. if (this.obj3d) {
  19444. var e = this.obj3d.parent;
  19445. e && e.remove(this.obj3d),
  19446. this.pathClean(this.obj3d)
  19447. }
  19448. this.obj3d = null,
  19449. this.popInCpm()
  19450. }
  19451. ,
  19452. n.prototype.discardSlow = function() {
  19453. if (this.obj3d) {
  19454. if (this.player.mode !== a.PANORAMA)
  19455. return void this.discardPathObject();
  19456. for (var e, t = this, i = 0, n = function() {
  19457. this.discardPathObject()
  19458. }
  19459. .bind(this), r = 0; r < t.obj3d.children.length; r += 1)
  19460. e = t.obj3d.children[r],
  19461. void 0 !== e.material && e.material.transparent === !0 && (void 0 !== e.material.uniforms ? p.start(u.property(e.material.uniforms.opacity, "value", 0), c.path.fadeOutTime, n, 0, d[c.warp.blendEasing]) : p.start(u.property(e.material, "opacity", 0), c.path.fadeOutTime, n, 0, d[c.warp.blendEasing]),
  19462. i += 1,
  19463. n = null);
  19464. 0 === i && this.discardPathObject(),
  19465. this.player.mode !== a.PANORAMA && this.fadeInCpm(c.path.fadeInTime - 3)
  19466. }
  19467. }
  19468. ,
  19469. n.prototype.appearSlow = function() {
  19470. var e, t = this;
  19471. this.fadeOutCpm(c.path.fadeInTime);
  19472. for (var i = this.player.mode === a.PANORAMA ? c.path.opacity : 1, n = 0; n < t.obj3d.children.length; n += 1)
  19473. e = t.obj3d.children[n],
  19474. void 0 !== e.material && e.material.transparent === !0 && (void 0 !== e.material.uniforms ? p.start(u.property(e.material.uniforms.opacity, "value", i), c.path.fadeInTime, null, 0, d[c.warp.blendEasing]) : p.start(u.property(e.material, "opacity", i), c.path.fadeInTime, null, 0, d[c.warp.blendEasing]))
  19475. }
  19476. ,
  19477. n.prototype.update = function() {
  19478. this.obj3d && this.obj3d.updateMatrixWorld()
  19479. }
  19480. ,
  19481. n.prototype.calcBurnsAmount = function(e) {
  19482. var t = r.Math.degToRad(c.warp.burnsAngle);
  19483. if (this.player.mode === a.PANORAMA) {
  19484. var i = this.burnsDir * t;
  19485. if (this.upcomingTransType === l.BLACK)
  19486. return i;
  19487. var n = e;
  19488. if (null === n)
  19489. return y.warn("Transition request for non-highlight"),
  19490. i;
  19491. var o = this.getHeroDescriptorByHeroIndex(n);
  19492. if (null === o)
  19493. return i;
  19494. if (!o.isPano())
  19495. return i;
  19496. var s = this.getHeroPano(o)
  19497. , h = this.playerControls.cameras[a.PANORAMA]
  19498. , u = A.FORWARD.clone().applyQuaternion(h.quaternion).setY(0).normalize()
  19499. , d = Math.min(r.Math.degToRad(c.warp.minBurnsAngle), t)
  19500. , p = function(e) {
  19501. var i = Math.acos(Math.min(1, e.dot(u)))
  19502. , n = (new r.Vector3).crossVectors(u, e);
  19503. return Math.max(d, Math.min(Math.abs(i), t)) * Math.sign(n.y)
  19504. };
  19505. if (s === this.player.currentPano)
  19506. return i = p(A.FORWARD.clone().applyQuaternion(o.quaternion).setY(0).normalize());
  19507. var f = this.findShortestPath(this.player.currentPano, s);
  19508. if (void 0 === f || null === f || f.length < 1)
  19509. return y.debug("Empty path ahead..."),
  19510. i;
  19511. var g = this.makePathHulls(f)
  19512. , m = new r.CatmullRomCurve3(g.camera)
  19513. , v = Math.min(.1, c.warp.lookAheadDist / m.getLength());
  19514. return i = p(m.getPointAt(v).clone().sub(h.position).setY(0).normalize())
  19515. }
  19516. return this.player.mode === a.DOLLHOUSE ? .02 * this.burnsDir : this.burnsDir
  19517. }
  19518. ,
  19519. n.prototype.waitNextStep = function(e, t, time) {//xzw 改时间
  19520. var i = (time==void 0)? c.warp.tourStepDelay : time; //
  19521. i || (i = this.lastTransType === l.BLACK ? b.tourStepDelaySlideShow : b.tourStepDelayDefault);
  19522. var n = new r.Euler
  19523. , o = new r.Vector3;
  19524. y.debug("Starting wait: " + (void 0 !== t));
  19525. var s = this.calcBurnsAmount(e)
  19526. , h = function() {
  19527. this.endWarpState(),
  19528. this.player.mode === a.DOLLHOUSE && (this.playerControls.cameras[a.DOLLHOUSE].controls.rotationAcceleration.x = 0),
  19529. t && t()
  19530. }
  19531. .bind(this)
  19532. , u = function(e, t) {
  19533. if (this.warpInterrupted)
  19534. return h(),
  19535. !0;
  19536. var r = t || 1e3 / 60;
  19537. if (c.warp.doBurns)
  19538. if (this.player.mode === a.PANORAMA) {
  19539. var l = this.playerControls.cameras[a.PANORAMA];
  19540. n.setFromQuaternion(l.quaternion, c.warp.eOrder);
  19541. var u = r * s / i;
  19542. n.y += u,
  19543. o.set(0, 0, -1),
  19544. o.applyEuler(n),
  19545. o.add(l.position),
  19546. l.controls.lookAt(o),
  19547. l.controls.lookVector.copy(o),
  19548. l.lookAt(o)
  19549. } else
  19550. this.player.mode === a.DOLLHOUSE ? this.playerControls.controls[a.DOLLHOUSE].rotationAcceleration.x = s : this.playerControls.controls[a.FLOORPLAN].absoluteScale *= .9996
  19551. }
  19552. .bind(this);
  19553. this.startWarpState(),
  19554. p.start(u, i, h, 0, d.easeInOutQuad, "wait")
  19555. }
  19556. ,
  19557. n.prototype.warpToNonPano = function(e) {
  19558. if (this.discardPathObject(),
  19559. this.warpDestHeroLoc.cameraMode === a.DOLLHOUSE || this.warpDestHeroLoc.cameraMode === a.FLOORPLAN) {
  19560. var t = function() {
  19561. e && e()
  19562. }
  19563. .bind(this);
  19564. this.player.flyToNewMode({
  19565. mode: this.warpDestHeroLoc.cameraMode,
  19566. duration: c.warp.outsideTime,
  19567. warpDest: this.warpDestHeroLoc,
  19568. callback: t,
  19569. force: !0
  19570. })
  19571. } else
  19572. y.warn("no warp destination!!!"),
  19573. e && e()
  19574. }
  19575. ,
  19576. n.prototype._resetWarpShaderParams = function(e) {
  19577. this.player.mode === a.PANORAMA && (void 0 !== e.material.uniforms.blackout && (e.material.uniforms.blackout.value = 0),
  19578. void 0 !== e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = 0))
  19579. }
  19580. ,
  19581. n.prototype._clearWarpShading = function() {
  19582. for (var e = this.model.chunks, t = 0; t < e.length; t += 1)
  19583. this._resetWarpShaderParams(e[t]),
  19584. e[t].visible = !0;
  19585. this._resetWarpShaderParams(this.model.skybox)
  19586. }
  19587. ,
  19588. n.prototype._warpStopFlying = function() {
  19589. this.activeTransType = null,
  19590. this.placeCpm()
  19591. }
  19592. ,
  19593. n.prototype._wrapupTravelOnlyBits = function() {
  19594. this._warpStopFlying(),
  19595. this.warpPathPoints && (this.player.currentPano.exit(),
  19596. this.warpDestPano.enter(),
  19597. this.player.currentPano = this.warpDestPano),
  19598. this.player.spider.draw(),
  19599. this.placeCpm()
  19600. }
  19601. ,
  19602. n.prototype._wrapupTravel = function(e) {
  19603. this._wrapupTravelOnlyBits(),
  19604. this.warpCameraAim(e)
  19605. }
  19606. ,
  19607. n.prototype._wrapupWarpShading = function(e) {
  19608. this._clearWarpShading(),
  19609. this._wrapupTravel(e)
  19610. }
  19611. ,
  19612. n.prototype.wrapupWarpShadingOnly = function(e, t) {
  19613. t !== I.END && this._clearWarpShading(),
  19614. this._wrapupTravelOnlyBits(),
  19615. this.upcomingTransType = null,
  19616. e && e()
  19617. }
  19618. ,
  19619. n.prototype._warpCameraAim = function(e, t) {
  19620. var i = this.warpDestHeroLoc.quaternion
  19621. , n = this.playerControls.cameras[a.PANORAMA]
  19622. , o = new r.Vector3(0,0,1).applyQuaternion(i).normalize()
  19623. , s = new r.Vector3(0,0,1).applyQuaternion(n.quaternion).normalize()
  19624. , l = s.dot(o)
  19625. , u = r.Math.radToDeg(Math.acos(l))
  19626. , f = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(i, c.warp.eOrder)
  19627. , g = (new r.Euler).setFromQuaternion(n.quaternion, c.warp.eOrder)
  19628. , m = new r.Euler(f.x - g.x,f.y - g.y,f.z - g.z,c.warp.eOrder);
  19629. m.y = h.constrainedTurn(m.y),
  19630. this.burnsDir = Math.sign(m.y);
  19631. var v = new r.Euler(0,0,0,c.warp.eOrder)
  19632. , A = new r.Vector3
  19633. , C = function(e, t) {
  19634. return !!this.warpInterrupted || (v.x = g.x + e * m.x,
  19635. v.y = g.y + e * m.y,
  19636. v.z = g.z + e * m.z,
  19637. A.set(0, 0, -1),
  19638. A.applyEuler(v),
  19639. A.add(n.position),
  19640. n.controls.lookAt(A),
  19641. n.controls.lookVector.copy(A),
  19642. void n.lookAt(A))
  19643. }
  19644. .bind(this);
  19645. return u > c.warp.minRotation ? p.start(C, e, t, 0, d[c.warp.movementEasing]) : (y.debug("Aim angle only is " + u.toPrecision(3) + " degrees, skipping explicit re-aim"),
  19646. void (t && t()))
  19647. }
  19648. ,
  19649. n.prototype._warpBendAim = function(e, t, i, n) {
  19650. var o = n || 0
  19651. , s = this.playerControls.cameras[a.PANORAMA]
  19652. , l = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  19653. , u = (new r.Euler).setFromQuaternion(s.quaternion, c.warp.eOrder)
  19654. , f = new r.Euler(l.x - u.x,l.y - u.y,l.z - u.z,c.warp.eOrder);
  19655. f.y = h.constrainedTurn(f.y);
  19656. var g = Math.min(r.Math.degToRad(c.warp.softBendTilt), Math.abs(f.x));
  19657. f.x = g * Math.sign(f.x),
  19658. g = Math.min(r.Math.degToRad(Math.max(0, c.warp.softBendAngle)), g),
  19659. this.burnsDir = Math.sign(f.y),
  19660. g *= Math.sign(f.y),
  19661. f.y = g;
  19662. var m = new r.Euler(0,0,0,c.warp.eOrder)
  19663. , v = new r.Vector3
  19664. , A = function(e, t) {
  19665. if (e < .5)
  19666. m.x = u.x + e * f.x,
  19667. m.y = u.y + e * f.y,
  19668. m.z = u.z + e * f.z;
  19669. else {
  19670. var i = (1 - e) * c.warp.softBendEnd;
  19671. m.x = l.x - i * f.x,
  19672. m.y = l.y - i * f.y,
  19673. m.z = l.z - i * f.z
  19674. }
  19675. v.set(0, 0, -1),
  19676. v.applyEuler(m),
  19677. v.add(s.position),
  19678. s.controls.lookAt(v),
  19679. s.controls.lookVector.copy(v),
  19680. s.lookAt(v)
  19681. }
  19682. .bind(this);
  19683. return p.start(A, t, i, o, d[c.warp.movementEasing])
  19684. }
  19685. ,
  19686. n.prototype._warpStepCameraAim = function(e, t, i) {
  19687. var n = this.playerControls.cameras[a.PANORAMA]
  19688. , o = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  19689. , s = (new r.Euler).setFromQuaternion(n.quaternion, c.warp.eOrder)
  19690. , l = new r.Euler(o.x - s.x,o.y - s.y,o.z - s.z,c.warp.eOrder);
  19691. l.y = h.constrainedTurn(l.y),
  19692. this.burnsDir = Math.sign(l.y);
  19693. var u = new r.Euler(0,0,0,c.warp.eOrder)
  19694. , f = new r.Vector3
  19695. , g = function(e, t) {
  19696. e < .5 ? u.copy(s) : u.copy(o),
  19697. f.set(0, 0, -1),
  19698. f.applyEuler(u),
  19699. f.add(n.position),
  19700. n.controls.lookAt(f),
  19701. n.controls.lookVector.copy(f),
  19702. n.lookAt(f)
  19703. }
  19704. .bind(this);
  19705. return p.start(g, t, i, 0, d[c.warp.movementEasing])
  19706. }
  19707. ,
  19708. n.prototype.setBurnsDir = function() {
  19709. var e = this.playerControls.cameras[a.PANORAMA]
  19710. , t = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  19711. , i = (new r.Euler).setFromQuaternion(e.quaternion, c.warp.eOrder)
  19712. , n = new r.Euler(t.x - i.x,t.y - i.y,t.z - i.z,c.warp.eOrder);
  19713. n.y = h.constrainedTurn(n.y),
  19714. this.burnsDir = Math.sign(n.y)
  19715. }
  19716. ,
  19717. n.prototype.stepWarpPath = function(e, t) {
  19718. var i = this.playerControls.cameras[a.PANORAMA];
  19719. if (!this.warpPathPoints)
  19720. return i.position.copy(this.warpDestPano.position),
  19721. !0;
  19722. var n = this.warpPathPoints[0]
  19723. , o = this.warpDestPano.position;
  19724. if (null !== this.nodes && this.cameraHull.length > 1) {
  19725. var s = new r.Vector3;
  19726. e < .5 ? s.copy(this.cameraHull[1]).sub(n).normalize().multiplyScalar(c.warp.softPushDist * e).add(n) : s.copy(this.cameraHull[this.cameraHull.length - 2]).sub(o).normalize().multiplyScalar(c.warp.softPushDist * c.warp.softPushEnd * (1 - e)).add(o),
  19727. i.position.copy(s)
  19728. } else
  19729. e < .5 ? i.position.copy(n) : i.position.copy(o)
  19730. }
  19731. ,
  19732. n.prototype.interruptAndFastForward = function(e, t) {
  19733. this.warping && (this.warpInterrupted = !0,
  19734. this.warpInterruptionBlackoutStyle = e,
  19735. this.warpInterruptionTravelTime = t,
  19736. null !== this.warpInterruptionBlackoutStyle && void 0 !== this.warpInterruptionBlackoutStyle || (this.warpInterruptionBlackoutStyle = I.MIDDLE),
  19737. null !== this.warpInterruptionTravelTime && void 0 !== this.warpInterruptionTravelTime || (this.warpInterruptionTravelTime = c.minWarpTime))
  19738. }
  19739. ,
  19740. n.prototype.warpCameraAim = function(e) {
  19741. var t = c.warp.minWarpTime;
  19742. if (this.upcomingTransType === l.BLACK)
  19743. t = c.warp.teleportTime;
  19744. else {
  19745. var i = this.playerControls.cameras[a.PANORAMA]
  19746. , n = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  19747. , o = (new r.Euler).setFromQuaternion(i.quaternion, c.warp.eOrder)
  19748. , s = new r.Euler(n.x - o.x,n.y - o.y,n.z - o.z,c.warp.eOrder);
  19749. s.y = h.constrainedTurn(s.y);
  19750. var u = 1e3 * Math.abs(s.y) / r.Math.degToRad(c.warp.maxAimPerSec);
  19751. t = Math.max(t, u)
  19752. }
  19753. var d = function() {
  19754. this._warpStopFlying(),
  19755. this.discardSlow(),
  19756. e && e()
  19757. }
  19758. .bind(this);
  19759. this._warpCameraAim(t, d)
  19760. }
  19761. ,
  19762. n.prototype.warpCommonParameters = function(e, t, i, n) {
  19763. this.model.skybox.material.uniforms.blackout.value = n;
  19764. var r = u.uniform(this.model.skybox, "progress", 1)
  19765. , o = u.allUniforms(this.model.chunks, "progress", 1)
  19766. , a = !1
  19767. , s = function() {
  19768. if (this.warpInterrupted)
  19769. return a = !0,
  19770. !0
  19771. }
  19772. .bind(this)
  19773. , l = function(e, t) {
  19774. return i && a ? (this.model.skybox.material.uniforms.progress.value = 0,
  19775. !0) : void r(e, t)
  19776. }
  19777. .bind(this)
  19778. , h = function(e, t) {
  19779. return i && a ? (o(0),
  19780. !0) : void o(e, t)
  19781. }
  19782. .bind(this);
  19783. p.start(s, e, null, t, null, "safeHaltWatch"),
  19784. p.start(l, e, null, t, d[c.warp.blendEasing], "skyboxProgress"),
  19785. p.start(h, e, null, t, d[c.warp.blendEasing], "chunkProgress")
  19786. }
  19787. ,
  19788. n.prototype.warpTravel_STD = function(e) {
  19789. var t, i = Math.min(c.warp.lookAheadMax, c.warp.lookAheadDist / this.warpLength), n = this.playerControls.cameras[a.PANORAMA], o = (Math.min(.25, 3 / this.warpLength),
  19790. Math.min(.35, 7 / this.warpLength)), s = new r.Euler(0,0,0,c.warp.eOrder), f = new r.Vector3, m = (new r.Euler).setFromQuaternion(n.quaternion, c.warp.eOrder), v = (new r.Euler).copy(m), C = n.position.clone(), E = new r.Matrix4, b = new r.Euler, w = c.warp.minWarpTime;
  19791. w += this.warpLength * c.warp.timePerMeter,
  19792. c.warp.flySpeed > .01 && (w = 1e3 * this.warpLength / c.warp.flySpeed);
  19793. var _ = !1
  19794. , T = this.warpDestHeroLoc.quaternion
  19795. , x = new r.Vector3(0,0,-1).applyQuaternion(T).normalize()
  19796. , S = this.warpPathPoints[this.warpPathPoints.length - 1].clone().sub(this.warpPathPoints[this.warpPathPoints.length - 2]).normalize()
  19797. , M = S.dot(x)
  19798. , R = r.Math.radToDeg(Math.acos(M))
  19799. , P = function(e) {
  19800. var t = o
  19801. , i = r.Math.smoothstep(e, 0, t) * (1 - r.Math.smoothstep(e, 1 - t, 1));
  19802. return i
  19803. }
  19804. , O = function() {
  19805. return E.lookAt(C, t, A.UP),
  19806. s.setFromRotationMatrix(E, c.warp.eOrder),
  19807. m.setFromQuaternion(n.quaternion, c.warp.eOrder),
  19808. b.set(s.x - m.x, s.y - m.y, s.z - m.z, c.warp.eOrder),
  19809. h.constrainedTurn(b.y)
  19810. }
  19811. .bind(this)
  19812. , L = function(e, t) {
  19813. if (this.warpInterrupted)
  19814. return _ = !0,
  19815. !0
  19816. }
  19817. .bind(this)
  19818. , D = function(e, t) {
  19819. return _ || !this.warpPathPoints ? (g.blur(0),
  19820. !0) : void g.blur(e)
  19821. }
  19822. .bind(this)
  19823. , N = u.allUniforms(this.model.chunks, "modelAlpha", 1)
  19824. , B = function(e, t) {
  19825. return _ || !this.warpPathPoints ? (N(0),
  19826. !0) : void N(e, t)
  19827. }
  19828. .bind(this)
  19829. , F = function(e, t) {
  19830. if (!this.warpPathPoints)
  19831. return n.position.copy(this.warpDestPano.position),
  19832. !0;
  19833. if (_)
  19834. return !0;
  19835. var i = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, e);
  19836. n.position.copy(i),
  19837. C = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, .99 * e)
  19838. }
  19839. .bind(this)
  19840. , V = function(e, n) {
  19841. return this.warpPathPoints ? !!_ || void (t = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, Math.min(e + i, 1))) : (y.debug("Lost bunny."),
  19842. !0)
  19843. }
  19844. .bind(this)
  19845. , U = function(e, o) {
  19846. if (_)
  19847. return y.debug(">>>> Walkthrough interupted at t=" + e),
  19848. !0;
  19849. if (!this.warpPathPoints)
  19850. return !0;
  19851. var a = this.warpLength * e
  19852. , l = r.Math.smoothstep(a, 0, this.brushPrefs.lookBlendDist)
  19853. , u = r.Math.smoothstep(a, this.warpLength - this.brushPrefs.lookBlendDist, this.warpLength);
  19854. c.warp.matchCam && (l *= 1 - u),
  19855. E.lookAt(C, t, A.UP),
  19856. s.setFromRotationMatrix(E, c.warp.eOrder),
  19857. m.setFromQuaternion(n.quaternion, c.warp.eOrder),
  19858. b.set(s.x - m.x, s.y - m.y, s.z - m.z, c.warp.eOrder),
  19859. b.y = h.constrainedTurn(b.y),
  19860. s.x = m.x + l * b.x,
  19861. s.y = m.y + l * b.y,
  19862. s.z = m.z + l * b.z,
  19863. b.set(s.x - v.x, s.y - v.y, s.z - v.z, c.warp.eOrder),
  19864. b.y = h.constrainedTurn(b.y);
  19865. var d = r.Math.degToRad(c.warp.maxTurnPerSec) * o / 1e3;
  19866. b.y = Math.sign(b.y) * Math.min(d, Math.abs(b.y)),
  19867. v.x = v.x + b.x * c.warp.turnFriction,
  19868. v.y = v.y + b.y * c.warp.turnFriction,
  19869. v.z = v.z + b.z * c.warp.turnFriction,
  19870. v.x = Math.max(r.Math.degToRad(c.warp.minDownAngle), v.x);
  19871. var p = t.clone().sub(C).normalize();
  19872. if (R < c.warp.maxAimRotation && u > 0) {
  19873. var g = 1 - u;
  19874. p.x = p.x * g + u * S.x,
  19875. p.y = p.y * g + u * S.y,
  19876. p.z = p.z * g + u * S.z,
  19877. p.normalize()
  19878. }
  19879. this.bunnyObj.position.copy(n.position).add(p),
  19880. f.set(0, 0, -1).applyEuler(v).normalize(),
  19881. f.multiplyScalar(8),
  19882. f.add(n.position),
  19883. e > 1 - i && c.warp.matchCam || (n.controls.lookAt(f),
  19884. n.controls.lookVector.copy(f),
  19885. n.lookAt(f))
  19886. }
  19887. .bind(this)
  19888. , k = function() {
  19889. _ ? (this.discardSlow(),
  19890. this.upcomingTransType = l.BLACK,
  19891. this.warpTravel_BLACK(-.5, this.warpInterruptionTravelTime, I.BEGINNING, e)) : this._wrapupWarpShading(e)
  19892. }
  19893. .bind(this);
  19894. V(0);
  19895. var H = c.warp.motionLeadTime + 1e3 * Math.abs(O()) / r.Math.degToRad(c.warp.maxTurnPerSec);
  19896. w += H;
  19897. var G = H / w;
  19898. this.warpCommonParameters(w, G, !0, I.NONE),
  19899. p.start(L, w, null, 0, null, "_haltWatcher"),
  19900. c.warp.blur > 0 && (g.blurStrength = c.warp.blur,
  19901. p.start(D, w, null, G, P, "blurring")),
  19902. p.start(B, w, null, G, P, "modelAlpha"),
  19903. p.start(F, w, null, G, d[c.warp.blendEasing], "followPath"),
  19904. p.start(V, w, null, G, d[c.warp.blendEasing], "goBunny"),
  19905. p.start(U, w, k, 0, d[c.warp.blendEasing], "lookAtBunny")
  19906. }
  19907. ,
  19908. n.prototype.warpTravel_BLACK = function(e, t, i, n) {
  19909. var r = e || 0;
  19910. void 0 !== t && null !== t || (t = c.warp.teleportTime),
  19911. this.warpCommonParameters(t, r, !1, i),
  19912. this.model.chunks.forEach(function(e) {
  19913. e.material.uniforms.blackout.value = i
  19914. }),
  19915. this._warpBendAim(null, t, null, r);
  19916. var o = function() {
  19917. this.wrapupWarpShadingOnly(n, i)
  19918. }
  19919. .bind(this);
  19920. p.start(this.stepWarpPath.bind(this), t, o, r, d[c.warp.blendEasing], "stepMotion")
  19921. }
  19922. ,
  19923. n.prototype.flightStepWalk = function(e, t, i) {
  19924. var n = .001
  19925. , o = 1
  19926. , a = 1.2
  19927. , s = new r.Vector3
  19928. , h = new r.Vector3
  19929. , u = function(e, t) {
  19930. var i = Math.min(this.player.position.distanceTo(e.position), c.transition.flytimeMaxDistanceThreshold)
  19931. , r = i * c.transition.flytimeDistanceMultiplier + c.transition.flyTime;
  19932. h.copy(A.FORWARD),
  19933. this.player.getDirection(h),
  19934. s.copy(t).sub(e.position).normalize();
  19935. var l = s.dot(h)
  19936. , u = Math.acos(l)
  19937. , d = u / r;
  19938. return d > n && (r *= d / n,
  19939. u < o && (r *= a)),
  19940. r
  19941. };
  19942. return function(e, t, i) {
  19943. if (this.warpInterrupted)
  19944. i && i();
  19945. else if (this.activeTransType !== l.WALK)
  19946. this._clearWarpShading(),
  19947. this._warpStopFlying(),
  19948. this.player.spider.draw(),
  19949. this.placeCpm(),
  19950. i && i();
  19951. else if (this.player.currentPano !== e) {
  19952. var n = {
  19953. pano: e,
  19954. lookAtPoint: t,
  19955. duration: null,
  19956. maxDistanceOverride: c.warp.walkMaxDist,
  19957. skipWarpingCheck: !1,
  19958. constantMoveSpeed: !0
  19959. };
  19960. n.duration = u.call(this, e, t),
  19961. this.player.nonInterruptingFlyToPano(n, i)
  19962. } else
  19963. i && i()
  19964. }
  19965. }(),
  19966. n.prototype.makeWalkFlightFunc = function(e, t, i) {
  19967. return this.flightStepWalk.bind(this, e, t, i)
  19968. }
  19969. ,
  19970. n.prototype.warpTravel_WALK = function() {
  19971. var e = [];
  19972. return function(t) {
  19973. var i = this.player.model.panos;
  19974. e.length = 0;
  19975. for (var n = null, o = !1, a = 0; a < this.nodes.length; a++) {
  19976. var s = this.nodes[a]
  19977. , l = i.get(s);
  19978. a === this.nodes.length - 1;
  19979. o = n && l.position.distanceTo(n.position) < c.warp.walkMinDist,
  19980. n && o || (e.push(s),
  19981. n = l)
  19982. }
  19983. o && this.nodes.length > 1 && (e[e.length - 1] = this.nodes[this.nodes.length - 1]);
  19984. var h = e.length
  19985. , u = i.get(e[h - 1])
  19986. , d = new Array(h + 1);
  19987. d[d.length - 1] = function() {
  19988. t && t()
  19989. }
  19990. .bind(this);
  19991. for (var p = h - 1, f = d.length - 1; f > 0; f -= 1) {
  19992. var g = e[p];
  19993. u = i.get(g);
  19994. var m = new r.Vector3;
  19995. this.getLookAtForWalkingTourNode(e, p, m),
  19996. d[f - 1] = this.makeWalkFlightFunc(u, m, d[f]),
  19997. p--
  19998. }
  19999. d[0]()
  20000. }
  20001. }(),
  20002. n.prototype.getLookAtForWalkingTourNode = function() {
  20003. var e = new r.Vector3
  20004. , t = new r.Vector3
  20005. , i = new r.Vector3
  20006. , n = new r.Vector3
  20007. , o = new r.Vector3
  20008. , a = .65
  20009. , s = .75
  20010. , l = .2
  20011. , c = .4
  20012. , h = .2
  20013. , u = 3;
  20014. return function(r, d, p) {
  20015. var f = r.length;
  20016. if (d >= f)
  20017. return !1;
  20018. var g = 1
  20019. , m = 1;
  20020. t.set(0, 0, 0),
  20021. o.set(0, 0, 0);
  20022. for (var v = null, A = d; A < d + u && !(A >= f); A++) {
  20023. if (v = this.player.model.panos.get(r[A]),
  20024. this.getOrientationForWalkingTourNode(r, A, i),
  20025. A === d && e.copy(i),
  20026. n.copy(i),
  20027. A > d) {
  20028. var y = n.dot(e) < a;
  20029. g *= y ? l : s,
  20030. m *= y ? h : c
  20031. }
  20032. i.multiplyScalar(g),
  20033. t.add(i),
  20034. o.lerp(v.position, m)
  20035. }
  20036. return t.normalize(),
  20037. p.copy(o),
  20038. p.add(t),
  20039. !0
  20040. }
  20041. }(),
  20042. n.prototype.getOrientationForWalkingTourNode = function(e, t, i) {
  20043. var n = e.length;
  20044. if (t >= n)
  20045. return !1;
  20046. if (t === n - 1)
  20047. i.copy(A.FORWARD).applyQuaternion(this.warpDestHeroLoc.quaternion);
  20048. else {
  20049. var r = this.player.model.panos.get(e[t])
  20050. , o = this.player.model.panos.get(e[t + 1]);
  20051. i.copy(o.position).sub(r.position)
  20052. }
  20053. return i.normalize(),
  20054. !0
  20055. }
  20056. ,
  20057. n.prototype.warpCameraTravel = function(e, t, i, n) {
  20058. if (this.activeTransType = this.upcomingTransType,
  20059. this.lastTransType = this.activeTransType,
  20060. this.upcomingTransType = null,
  20061. !e) {
  20062. var r = function() {
  20063. this._wrapupTravel(n)
  20064. }
  20065. .bind(this)
  20066. , o = {
  20067. pano: this.warpDestPano,
  20068. lookAtPoint: null,
  20069. duration: null,
  20070. maxDistanceOverride: null,
  20071. skipWarpingCheck: !1
  20072. };
  20073. return void this.player.flyToPano(o, r)
  20074. }
  20075. this.activeTransType === l.BLACK ? this.warpTravel_BLACK(null, i, t, n) : this.activeTransType === l.WALK ? this.warpTravel_WALK(function() {
  20076. this._clearWarpShading(),
  20077. this._warpStopFlying(),
  20078. this.player.spider.draw(),
  20079. this.placeCpm(),
  20080. n && n()
  20081. }
  20082. .bind(this)) : this.warpTravel_STD(n)
  20083. }
  20084. ,
  20085. n.prototype.startWarpState = function() {
  20086. this.warping = !0,
  20087. this.warpInterrupted = !1,
  20088. this.warpInterruptionBlackoutStyle = null,
  20089. this.warpInterruptionTravelTime = null
  20090. }
  20091. ,
  20092. n.prototype.endWarpState = function() {
  20093. this.warping = !1
  20094. }
  20095. ,
  20096. n.prototype.warpToPano = function(e, t, i, n) {
  20097. if (this.warping)
  20098. return void y.warn("Cannot warp when already warping");
  20099. if (this.upcomingTransType = e,
  20100. this.activeTransType = null,
  20101. !this.setWarpDestPano())
  20102. return this.upcomingTransType = null,
  20103. void this.warpToNonPano(n);
  20104. if (this.player.mode !== a.PANORAMA)
  20105. return this.upcomingTransType = null,
  20106. this.discardSlow(),
  20107. void this.player.flyToNewMode({
  20108. mode: a.PANORAMA,
  20109. pano: this.warpDestPano,
  20110. duration: c.warp.outsideTime,
  20111. warpDest: this.warpDestHeroLoc,
  20112. callback: n,
  20113. force: !0
  20114. });
  20115. if (!this.warpDestPano)
  20116. return y.warn("no warp destination, callback dropped"),
  20117. void (this.upcomingTransType = null);
  20118. var r = !(this.model.panos.isNeighbour(this.player.currentPano, this.warpDestPano) && this.warpDestPano !== this.player.currentPano && this.warpDestPano.position.distanceTo(this.player.currentPano.position) < c.warp.nearPanoDist)
  20119. , o = this.chooseWarpPath(r);
  20120. if (o && this.upcomingTransType !== l.WALK) {
  20121. var s = function() {
  20122. this.waitingToWarp = !1,
  20123. this.warpToPano(e, t, i, n)
  20124. }
  20125. .bind(this);
  20126. if (this.player.checkAndWaitForPanoLoad(this.warpDestPano, "high", "low", this.player.basePanoSize, s))
  20127. return void (this.waitingToWarp = !0)
  20128. }
  20129. this.player.currentPano || (y.warn("Arrived at a very strange spot!"),
  20130. this.player.currentPano = this.warpDestPano,
  20131. this.placeCpm(),
  20132. this.fadeOutCpm(c.path.fadeOutTime),
  20133. this.player.spider.draw()),
  20134. y.debug("Warping to pano ", this.warpDestPano.position),
  20135. this.upcomingTransType !== l.WALK && this.player.emit(C.PanoChosen, this.player.currentPano, this.warpDestPano),
  20136. this.startWarpState();
  20137. var h = function() {
  20138. this.endWarpState(),
  20139. n && n()
  20140. }
  20141. .bind(this);
  20142. o ? this.warpCameraTravel(r, t, i, h) : this.warpCameraAim(h),
  20143. this.player.smoothZoomToDefault(c.zoom.restoreTime)
  20144. }
  20145. ,
  20146. t.exports = n
  20147. }
  20148. ).call(this, "/js/objects/ShowPath.js")
  20149. }
  20150. , {
  20151. "../constants": 8,
  20152. "../effects": 16,
  20153. "../enum/BlackoutStyle": 18,
  20154. "../enum/ModelManagerEvents": 33,
  20155. "../enum/PlayerEvents": 40,
  20156. "../enum/RenderOrder": 42,
  20157. "../enum/Vectors": 50,
  20158. "../enum/Viewmode": 51,
  20159. "../enum/WarpStyle": 52,
  20160. "../gui/gui": 65,
  20161. "../model/ModelManager": 140,
  20162. "../objects/Snapshot": 153,
  20163. "../settings": 166,
  20164. "../shaders": 167,
  20165. "../util/easing": 186,
  20166. "../util/lerp": 188,
  20167. "../util/logger": 189,
  20168. "../util/math": 190,
  20169. "../util/texture": 194,
  20170. "../util/transitions": 195,
  20171. three: 217
  20172. }],
  20173. 152: [function(e, t, i) {
  20174. "use strict";
  20175. function n() {
  20176. var e = new r.SphereBufferGeometry(a.skyboxRadius,20,5)
  20177. , t = new r.RawShaderMaterial({
  20178. fragmentShader: o.skysphere.fragmentShader,
  20179. vertexShader: o.skysphere.vertexShader,
  20180. uniforms: r.UniformsUtils.clone(o.skysphere.uniforms),
  20181. side: r.BackSide,
  20182. name: "skysphere"
  20183. });
  20184. t.uniforms.radius.value = e.parameters.radius,
  20185. r.Mesh.call(this, e, t)
  20186. }
  20187. var r = e("three")
  20188. , o = e("../shaders")
  20189. , a = e("../settings");
  20190. n.prototype = Object.create(r.Mesh.prototype),
  20191. n.prototype.constructor = n,
  20192. t.exports = n
  20193. }
  20194. , {
  20195. "../settings": 166,
  20196. "../shaders": 167,
  20197. three: 217
  20198. }],
  20199. 153: [function(e, t, i) {
  20200. (function(i) {
  20201. "use strict";
  20202. function n(e) {
  20203. o.call(this, e),
  20204. this.sid = e.sid,//xzw add
  20205. this.panoId = e.panoId,
  20206. this.orthoZoom = e.orthoZoom,
  20207. this.floorVisibility = e.floorVisibility,
  20208. this.thumbUrl = e.thumbUrl,
  20209. this.name = e.name
  20210. }
  20211. var r = (e("three"),
  20212. e("../util/logger"))
  20213. , o = (e("../settings"),
  20214. e("../enum/Viewmode"),
  20215. e("../util/common"),
  20216. e("../util/transitions"),
  20217. e("../util/lerp"),
  20218. e("../util/ajax"),
  20219. e("../util/texture"),
  20220. e("./View"));
  20221. e("events").EventEmitter,
  20222. new r(i);
  20223. n.prototype = Object.create(o.prototype),
  20224. n.prototype.isPano = function() {
  20225. return this.panoId && "" !== this.panoId
  20226. }
  20227. ,
  20228. t.exports = n
  20229. }
  20230. ).call(this, "/js/objects/Snapshot.js")
  20231. }
  20232. , {
  20233. "../enum/Viewmode": 51,
  20234. "../settings": 166,
  20235. "../util/ajax": 181,
  20236. "../util/common": 185,
  20237. "../util/lerp": 188,
  20238. "../util/logger": 189,
  20239. "../util/texture": 194,
  20240. "../util/transitions": 195,
  20241. "./View": 154,
  20242. events: 202,
  20243. three: 217
  20244. }],
  20245. 154: [function(e, t, i) {
  20246. (function(i) {
  20247. "use strict";
  20248. function n(e) {
  20249. e = e || {},
  20250. this.position = new r.Vector3,
  20251. this.quaternion = new r.Quaternion,
  20252. this.update(e)
  20253. }
  20254. var r = e("three")
  20255. , o = e("../util/logger")
  20256. , a = (e("../settings"),
  20257. e("../enum/Viewmode"),
  20258. e("../util/common"),
  20259. e("../util/transitions"),
  20260. e("../util/lerp"),
  20261. e("../util/ajax"),
  20262. e("../util/texture"),
  20263. e("events").EventEmitter);
  20264. new o(i);
  20265. n.prototype = Object.create(a.prototype),
  20266. n.prototype.isValid = function() {
  20267. return !!this.cameraMode
  20268. }
  20269. ,
  20270. n.prototype.update = function(e) {
  20271. return this.cameraMode = e.cameraMode || this.cameraMode,
  20272. this.pano = e.pano || this.pano,
  20273. e.position && this.position.copy(e.position),
  20274. e.quaternion && this.quaternion.copy(e.quaternion),
  20275. this
  20276. }
  20277. ,
  20278. t.exports = n
  20279. }
  20280. ).call(this, "/js/objects/View.js")
  20281. }
  20282. , {
  20283. "../enum/Viewmode": 51,
  20284. "../settings": 166,
  20285. "../util/ajax": 181,
  20286. "../util/common": 185,
  20287. "../util/lerp": 188,
  20288. "../util/logger": 189,
  20289. "../util/texture": 194,
  20290. "../util/transitions": 195,
  20291. events: 202,
  20292. three: 217
  20293. }],
  20294. 155: [function(e, t, i) {//player.js
  20295. (function(i) {
  20296. "use strict";
  20297. function n(e) {
  20298. this.currentPano = null,
  20299. this.nextPano = null,
  20300. this.camera = null,
  20301. this.paused = !1,
  20302. this.flying = !1,
  20303. this.sceneIntersectionPlane = null,
  20304. this.target = new r.Vector3,
  20305. this.mouse = new r.Vector3(1.1,1.1,.5),
  20306. this.mouseAtMouseDown = new r.Vector2,
  20307. this.mouseCouldBeClickToMove = !1,
  20308. this.mouseLastMoveTime = Date.now(),
  20309. this.mouseDown = !1,
  20310. this.mouseDownTimer = null,
  20311. this.couldBeLongTap = !1,
  20312. this.containsMouse = !0,
  20313. this.isTouchEvent = !1,
  20314. this.isPanoHover = !1,
  20315. this.reticule = new a(this),
  20316. this.panoMarkers = [],
  20317. this.spider = new h(this),
  20318. this.quaternion = new r.Quaternion,
  20319. this.position = new r.Vector3(15,10,15),
  20320. this.previousState = null,
  20321. this.lastInsideView = new c,
  20322. this.last360View = new c,
  20323. this.raycaster = new r.Raycaster,
  20324. this.intersect = null,
  20325. this.lastChangeTime = Date.now(),
  20326. this.history = new I,
  20327. this.cameraControls = null,
  20328. this.path = null,
  20329. this.model = null,
  20330. this.domElement = null,
  20331. this.cachedPanoCandidates = null,
  20332. this.basePanoSize = 0,
  20333. this.standardPanoSize = 0,
  20334. this.highPanoSize = 0,
  20335. this.ultraHighPanoSize = 0,
  20336. this.zoomLevel = 1,
  20337. this.zooming = 0,
  20338. this.zoomSpeed = .5,
  20339. this.scrollZoomSpeed = .06,
  20340. this.zoomSpeedAdjust = .05,
  20341. this.defaultZoomIncrement = .2,
  20342. this.baseFov = f.insideFOV,
  20343. this.zoomFov = this.baseFov,
  20344. this.zoomEnabled = !0,
  20345. this.preRenderingEnabled = !1,
  20346. this.setupCustomProperties(e),
  20347. this.zoomStats = new L
  20348. }
  20349. var r = e("three")
  20350. , o = e("./util/logger")
  20351. , a = e("./objects/Reticule")
  20352. , s = e("./objects/Panorama")
  20353. , l = e("./objects/ShowPath")
  20354. , c = e("./objects/View")
  20355. , h = (e("./objects/Snapshot"),
  20356. e("./objects/NSpider"))
  20357. , u = e("./enum/Viewmode")
  20358. , d = (e("./enum/TagStates"),
  20359. e("./enum/Vectors"))
  20360. , p = e("./enum/Keys")
  20361. , f = (e("./enum/AlignmentType"),
  20362. e("./settings"))
  20363. , g = e("./util/common")
  20364. , m = (e("./util/browser"),
  20365. e("./util/math"))
  20366. , v = e("./util/lerp")
  20367. , A = e("./util/easing")
  20368. , y = e("./util/transitions")
  20369. , C = e("events").EventEmitter
  20370. , I = (e("./shaders"),
  20371. e("./util/history"))
  20372. , E = (e("./util/camera"),
  20373. e("./model/ModelManager"),
  20374. e("./enum/PathDiscardMode"))
  20375. , b = e("./enum/PathDisplayMode")
  20376. , w = e("./enum/PlayerEvents")
  20377. , _ = e("./enum/ControlEvents")
  20378. , T = e("./enum/ModelManagerEvents")
  20379. , x = e("./enum/WarpStyle")
  20380. , S = e("./enum/BlackoutStyle")
  20381. , M = e("./exception/BasicException")
  20382. , R = e("./enum/PanoSizeClass")
  20383. , P = (e("./tile/TileDownloader"),
  20384. e("./tile/TilePrioritizer"))
  20385. , O = (e("./enum/PanoramaEvents"),
  20386. e("./enum/ZoomEvents"))
  20387. , L = e("./util/ZoomStats")
  20388. , D = e("./constants")
  20389. , N = e("./util/common")
  20390. , B = e("./util/cameraLight")
  20391. , Hot = e('hot')
  20392. , F = new o(i)
  20393. , V = Object.freeze({
  20394. FlyToPano: y.getUniqueId(),
  20395. FlyToNewMode: y.getUniqueId(),
  20396. FlyToSameMode: y.getUniqueId(),
  20397. FlyToViewFloor: y.getUniqueId(),
  20398. LookTransition: y.getUniqueId(),
  20399. ZoomTransition: y.getUniqueId()
  20400. });
  20401. n.prototype = Object.create(C.prototype),
  20402. n.prototype.init = function(e) {
  20403. this.modelManager = e.modelManager,
  20404. this.tileDownloader = e.tileDownloader,
  20405. this.panoRenderer = e.panoRenderer,
  20406. this.qualityManager = e.qualityManager,
  20407. this.domElement = e.container,
  20408. this.camera = e.camera,
  20409. this.tagManager = e.tagManager,
  20410. this.cameraControls = e.controls,
  20411. this.path = new l(e.director,this,e.controls),
  20412. this.basePanoSize = this.qualityManager.getPanoSize(R.BASE),
  20413. this.standardPanoSize = this.qualityManager.getPanoSize(R.STANDARD),
  20414. this.highPanoSize = this.qualityManager.getPanoSize(R.HIGH),
  20415. this.ultraHighPanoSize = this.qualityManager.getPanoSize(R.ULTRAHIGH),
  20416. this.tileDownloader.processPriorityQueue = !1,
  20417. this.tileDownloader.tilePrioritizer = new P(this.qualityManager,this.basePanoSize,this.standardPanoSize,this.highPanoSize,this.ultraHighPanoSize),
  20418. this.bindEvents(e.container),
  20419. this.updateModel()
  20420. }
  20421. //xzw add: 截图
  20422. function dataURLtoBlob(dataurl) {
  20423. var arr = dataurl.split(','), mime = arr[0].match(/:(.*?);/)[1],
  20424. bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n);
  20425. while(n--){
  20426. u8arr[n] = bstr.charCodeAt(n);
  20427. }
  20428. return new Blob([u8arr], {type:mime});
  20429. }
  20430. n.prototype.screenShot = function(o){
  20431. if(this.flying || this.flyingToTag) return;
  20432. var R = this.sceneRenderer;
  20433. R.updateScreenSize(o);
  20434. for(var i in this.model.panos.index){
  20435. this.model.panos.index[i].marker.forceHide = this.model.panos.index[i].marker.visible;
  20436. this.model.panos.index[i].marker.visible = false;
  20437. }
  20438. for(var i in this.model.hots){
  20439. this.model.hots[i].mesh.visible = false;
  20440. }
  20441. this.reticule.visible = false;
  20442. this.reticule.forceUnvisible = true;
  20443. this.path.currentPanoMarker.mesh.visible = false;
  20444. setTimeout(function(){//因resize效用没办法立即生效(原因未知),故而延后
  20445. R.renderer.clear(true,true,true);
  20446. R.renderer.render(R.scene, R.camera);
  20447. var imgData = R.renderer.domElement.toDataURL(o.type,0.9);
  20448. o.f && o.f(imgData)
  20449. R.updateScreenSize({resize:true});
  20450. this.reticule.visible = true;
  20451. for(var i in this.model.hots){
  20452. this.model.hots[i].mesh.visible = true;
  20453. }
  20454. for(var i in this.model.panos.index){
  20455. this.model.panos.index[i].marker.visible = this.model.panos.index[i].marker.forceHide;
  20456. }
  20457. this.path.currentPanoMarker.mesh.visible = true;
  20458. R.renderer.render(R.scene, R.camera);
  20459. }.bind(this),30) //这个数字不能太小
  20460. }
  20461. var scaleImg = e("scaleImg");
  20462. var ResizeImg = function(img, option){
  20463. var img2; //不能直接改img 否则可能触发第二次img.onload
  20464. var compress = function(ratio,type){
  20465. var image = img2 || img;
  20466. var c = document.createElement('canvas');
  20467. c.width = image.width; c.height = image.height;
  20468. var ctx = c.getContext('2d');
  20469. ctx.drawImage(image,0,0,image.width,image.height);
  20470. img2 = scaleImg(ratio/* option.maxSize/oldSize */, c, type/* option.type||"png" */);//最大不能超过0.8M
  20471. }
  20472. var reCom = function(){ //如果有了img2 就只需要img2 否则创造新的img2
  20473. var image = img2 || img;
  20474. var blob = dataURLtoBlob(image.src);
  20475. if(option.maxWeight && blob.size > option.maxWeight){
  20476. compress(option.maxWeight/blob.size, "jpeg")
  20477. blob = dataURLtoBlob(image.src);
  20478. }
  20479. if(!img2){
  20480. img2 = new Image();
  20481. }
  20482. img2.base64Src = image.src;
  20483. img2.src = window.URL.createObjectURL(blob);
  20484. }
  20485. var oldSize = Math.max(img.width, img.height);
  20486. if(option.toType != "png"){//不是非要png的话
  20487. if(option.oldType == "jpeg"){//jpeg先判断尺寸,然后是尺寸
  20488. if(oldSize > option.maxSize){
  20489. compress(option.maxSize/oldSize, "jpeg");
  20490. }
  20491. reCom();
  20492. }else if(option.oldType == "png"){//png先判断数据量 如果数据量达标,就无视大小(有可能超出大小)
  20493. if(option.maxWeight && option.weight > option.maxWeight){//如果一开始大小不大就不压缩 还是png
  20494. compress(oldSize>option.maxSize ? option.maxSize/oldSize : 1, "jpeg");
  20495. reCom();
  20496. }
  20497. }
  20498. }else{
  20499. //?貌似png会越压缩越大?
  20500. }
  20501. return img2 || img;
  20502. }
  20503. var _fixType=function(type) {
  20504. type = type.toLowerCase().replace(/jpg/i, 'jpeg');
  20505. var r = type.match(/png|jpeg|bmp|gif/)[0];
  20506. return 'image/' + r;
  20507. };
  20508. var saveFile=function(data, filename){
  20509. var save_link = document.createElementNS('http://www.w3.org/1999/xhtml', 'a');
  20510. save_link.href = data;
  20511. save_link.download = filename;
  20512. var event = document.createEvent('MouseEvents');
  20513. event.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
  20514. save_link.dispatchEvent(event);
  20515. };
  20516. n.prototype.getWrapShot = function(){ //获取导览点截图和信息
  20517. var str = ',{\r\t'+this.getSnapAngleInfo();
  20518. this.screenShot({ width:g_snapShotWidth*4, height:g_snapShotHeight*4, type:"image/jpeg", f:function(imgData){
  20519. var img = new Image();
  20520. img.src = imgData;
  20521. img.onload = function(){
  20522. var img2 = ResizeImg(this,{maxSize: g_snapShotWidth, oldType:"jpeg"}); //暂定缩略图大小
  20523. img2.src.replace(_fixType("image/jpeg"),'image/octet-stream');
  20524. var filename = "snap" + (new Date()).getTime();
  20525. saveFile(img2.src,filename + ".jpg");
  20526. str +=(',\r\t"thumbnail_signed_src":"'+filename+'.jpg",');
  20527. str +=('\r\t"sid":"'+filename+'",');
  20528. str +=('\r\t"name":"'+filename+'"\r}');
  20529. logData(str)
  20530. }
  20531. }});
  20532. }
  20533. ,
  20534. n.prototype.getSnapAngleInfo = function(){
  20535. var info = {};
  20536. var str = '"metadata":{';
  20537. var q = this.camera.quaternion.clone();
  20538. switch (this.mode) {
  20539. case "panorama":
  20540. info.scan_id = this.currentPano.id;
  20541. str += ('"scan_id":"'+this.currentPano.id+'",');
  20542. break;
  20543. case "floorplan":
  20544. info.camera_mode = 1;
  20545. q = (new r.Quaternion).setFromAxisAngle(new r.Vector3(0,1,0), r.Math.degToRad(90))
  20546. q.multiply(this.camera.quaternion);
  20547. str += ('"camera_mode":1,');
  20548. //str += ('"ortho_zoom":'+m.toPrecision(this.cameraControls.activeControl.currentScale * $("#player").height() / $("#player").width() * D.workshopApsect * 16, 4)+",");
  20549. str += ('"ortho_zoom":'+ m.toPrecision(this.cameraControls.activeControl.currentScale, 4 )+",");
  20550. break;
  20551. case "dollhouse":
  20552. info.camera_mode = 2;
  20553. str += ('"camera_mode":2,');
  20554. break;
  20555. }
  20556. info.camera_position = m.toPrecision(this.camera.position.toArray(),4);
  20557. info.camera_quaternion = m.toPrecision(q.toArray(),4);
  20558. str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+"]}");
  20559. return str;
  20560. }
  20561. //------end
  20562. n.prototype.closePopup = function() {//xzw 关闭热点页面
  20563. if(!g_currentHot) return;
  20564. g_currentHot = null;
  20565. var hotPop = document.getElementById('popup');
  20566. hotPop.style.display = "none";
  20567. hotPop.removeChild(document.getElementById("id1"));
  20568. $("#popup iframe:last").remove();
  20569. //document.getElementById("bgaudio").play();
  20570. $('#player').off("click",this.closePopup)
  20571. }
  20572. n.prototype.setupCustomProperties = function(e) {
  20573. var t = e || u.PANORAMA;
  20574. Object.defineProperty(this, "mode", {
  20575. get: function() {
  20576. return t
  20577. },
  20578. set: function(e) {
  20579. var i = t;
  20580. t = e,
  20581. this.onModeUpdated(i, t)
  20582. }
  20583. })
  20584. }
  20585. ,
  20586. n.prototype.isInMode = function() {
  20587. for (var e = 0; e < arguments.length; e++)
  20588. if (this.mode === arguments[e])
  20589. return !0;
  20590. return !1
  20591. }
  20592. ,
  20593. n.prototype.isOutsideMode = function(e) {
  20594. return e = e || this.mode,
  20595. e === u.DOLLHOUSE || e === u.FLOORPLAN
  20596. }
  20597. ,
  20598. n.prototype.is360View = function(e, t) {
  20599. return e === u.PANORAMA && t && !t.isAligned()
  20600. }
  20601. ,
  20602. n.prototype.setScene = function(e) {
  20603. this.sceneIntersectionPlane = e.plane,
  20604. this.path.setScene(e),
  20605. this.moveReticuleToScene(e)
  20606. }
  20607. ,
  20608. n.prototype.moveReticuleToScene = function(e) {
  20609. this.reticule.parent && this.reticule.parent.remove(this.reticule),
  20610. e.add(this.reticule)
  20611. }
  20612. ,
  20613. n.prototype.updateModel = function() {
  20614. function e(e, t, n) {
  20615. this.mode === u.DOLLHOUSE && e !== n && i.call(this, e.center.y)
  20616. }
  20617. function t(e, t) {
  20618. if (this.mode === u.DOLLHOUSE) {
  20619. var n = e ? this.model.center.y : n = t.center.y;
  20620. i.call(this, n)
  20621. }
  20622. }
  20623. function i(e) {
  20624. var t = this.cameraControls.cameras[u.DOLLHOUSE]
  20625. , i = this.cameraControls.controls[u.DOLLHOUSE]
  20626. , n = t.position.y + (e - i.target.y)
  20627. , r = f.showFloorDuration + f.showFloorDelay;
  20628. y.start(v.property(i.target, "y", e), r, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToViewFloor),
  20629. y.start(v.property(t.position, "y", n), r, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToViewFloor)
  20630. }
  20631. this.model = this.modelManager.getActiveModel(),
  20632. this.model.on("floor.changed", e.bind(this)),
  20633. this.model.on("allfloors.toggled", t.bind(this)),
  20634. this.on(w.PanoChosen, this.model.setProjectedPanos.bind(this.model))
  20635. }
  20636. ,
  20637. n.prototype.updateModelDependentData = function() {
  20638. this.cameraControls.setModelForControls(this.model),
  20639. this.getPanoMarkersFromModel(this.model)
  20640. }
  20641. ,
  20642. n.prototype.onModelChanged = function() {
  20643. this.updateModel(),
  20644. this.updateModelDependentData()
  20645. }
  20646. ,
  20647. n.prototype.getPanoMarkersFromModel = function(e) {
  20648. this.panoMarkers = e.panos.list.reduce(function(e, t) {
  20649. return t.marker ? e.concat(t.marker) : e
  20650. }, [])
  20651. }
  20652. ,
  20653. n.prototype.handleControlMove = function(e) {
  20654. this.emit(w.Move, e)
  20655. }
  20656. ,
  20657. n.prototype.handleControlInputStart = function(e) {
  20658. this.emit(w.InputStart, e)
  20659. }
  20660. ,
  20661. n.prototype.onModeUpdated = function(e, t) {
  20662. this.cameraControls.activateControls(t),
  20663. this.emit(w.ModeChanged, e, t)
  20664. }
  20665. ,
  20666. n.prototype.isWarping = function() {
  20667. return this.path.warping
  20668. }
  20669. ,
  20670. n.prototype.isWaitingToWarp = function() {
  20671. return this.path.waitingToWarp
  20672. }
  20673. ,
  20674. n.prototype.getLabelScaleFactor = function() {
  20675. if (this.isOutsideMode()) {
  20676. var e = 10
  20677. , t = Math.sqrt(this.cameraControls.controls[u.FLOORPLAN].currentScale / e);
  20678. return t
  20679. }
  20680. return .5
  20681. }
  20682. ,
  20683. n.prototype.changeMusic = function() {//xzw add
  20684. if(!this.director.tourIsPlaying && g_play && g_bgAudio){
  20685. g_playAudio = g_bgAudio;
  20686. g_bgAudio.play();
  20687. }else{
  20688. if(!g_play){
  20689. g_playAudio = g_bgAudio;
  20690. }else{//防止再次播放时重播一遍
  20691. g_playAudio = null;
  20692. }
  20693. }
  20694. }
  20695. ,
  20696. n.prototype.bindEvents = function(e) {
  20697. e !== document && e.setAttribute("tabindex", -1),
  20698. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  20699. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  20700. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  20701. e.addEventListener("mouseout", this.onMouseOut.bind(this)),
  20702. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  20703. this.modelManager.on(T.ActiveModelChanged, this.onModelChanged.bind(this)),
  20704. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  20705. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  20706. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  20707. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  20708. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  20709. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  20710. e.addEventListener("pointerout", this.onPointerOut.bind(this)),
  20711. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  20712. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  20713. this.cameraControls.on(_.Move, this.handleControlMove.bind(this)),
  20714. this.cameraControls.on(_.InputStart, this.handleControlInputStart.bind(this)),
  20715. this.cameraControls.on(_.Pinch, this.handleControlPinch.bind(this)),
  20716. this.cameraControls.on(_.Scroll, this.handleControlScroll.bind(this)),
  20717. window.addEventListener("snapshotBegin", this.getWrapShot.bind(this))//xzw add
  20718. window.addEventListener("tourAudioEnded", this.changeMusic.bind(this))//xzw add
  20719. $('#closepop').on("click",this.closePopup.bind(this)); //xzw add
  20720. }
  20721. ,
  20722. n.prototype.onMouseDown = function(e) {
  20723. e.currentTarget !== document && e.currentTarget.focus(),
  20724. 0 === e.button && (this.handleInputStart.call(this, e.clientX, e.clientY, !1),
  20725. this.updateIntersect())
  20726. }
  20727. ,
  20728. n.prototype.onMouseMove = function(e) {
  20729. this.isTouchEvent = !1,
  20730. this.handleInputMove.call(this, e.clientX, e.clientY, !1)
  20731. }
  20732. ,
  20733. n.prototype.onMouseOver = function(e) {
  20734. this.containsMouse = !0,
  20735. !this.mouseDown || 0 !== e.which && 0 !== e.buttons || (this.mouseDown = !1)
  20736. }
  20737. ,
  20738. n.prototype.onMouseOut = function(e) {
  20739. this.containsMouse = !1
  20740. }
  20741. ,
  20742. n.prototype.onMouseUp = function(e) {
  20743. this.handleInputEnd.call(this, e.clientX, e.clientY, !1);
  20744. }
  20745. ,
  20746. n.prototype.onTouchStart = function(e) {
  20747. if (e.currentTarget !== document && e.currentTarget.focus(),
  20748. !this.mouseDown) {
  20749. this.couldBeLongTap = !0;
  20750. var t = g.average(e.changedTouches, "clientX")
  20751. , i = g.average(e.changedTouches, "clientY");
  20752. this.handleInputStart.call(this, t, i, !0),
  20753. this.mouseDownTimer = setTimeout(function() {
  20754. this.updateIntersect(),
  20755. this.handleInputEnd.call(this, t, i, !0)
  20756. }
  20757. .bind(this), f.input.longTapThreshold)
  20758. }
  20759. }
  20760. ,
  20761. n.prototype.onTouchMove = function(e) {
  20762. var t = g.average(e.changedTouches, "clientX")
  20763. , i = g.average(e.changedTouches, "clientY");
  20764. this.handleInputMove.call(this, t, i, !0)
  20765. }
  20766. ,
  20767. n.prototype.onTouchEnd = function(e) {
  20768. if (clearTimeout(this.mouseDownTimer),
  20769. this.mouseDown) {
  20770. this.couldBeLongTap = !1,
  20771. this.updateIntersect();
  20772. var t = g.average(e.changedTouches, "clientX")
  20773. , i = g.average(e.changedTouches, "clientY");
  20774. this.handleInputEnd.call(this, t, i, !0)
  20775. }
  20776. }
  20777. ,
  20778. n.prototype.onPointerDown = function(e) {
  20779. return e.currentTarget !== document && e.currentTarget.focus(),
  20780. this.mouseDown || "mouse" === e.pointerType ? this.onMouseDown(e) : (this.couldBeLongTap = !0,
  20781. this.handleInputStart.call(this, e.clientX, e.clientY, !0),
  20782. void (this.mouseDownTimer = setTimeout(function() {
  20783. this.updateIntersect(),
  20784. this.handleInputEnd.call(this, e.clientX, e.clientY, !0)
  20785. }
  20786. .bind(this), f.input.longTapThreshold)))
  20787. }
  20788. ,
  20789. n.prototype.onPointerMove = function(e) {
  20790. "mouse" !== e.pointerType ? this.handleInputMove.call(this, e.clientX, e.clientY, !0) : this.onMouseMove(e)
  20791. }
  20792. ,
  20793. n.prototype.onPointerUp = function(e) {
  20794. return this.mouseDown && "mouse" !== e.pointerType ? (clearTimeout(this.mouseDownTimer),
  20795. this.couldBeLongTap = !1,
  20796. this.updateIntersect(),
  20797. void this.handleInputEnd.call(this, e.clientX, e.clientY, !0)) : this.onMouseUp(e)
  20798. }
  20799. ,
  20800. n.prototype.onPointerOut = function(e) {
  20801. this.mouseDown = !1
  20802. }
  20803. ,
  20804. n.prototype.onPointerCancel = function(e) {
  20805. this.mouseDown = !1
  20806. }
  20807. ,
  20808. n.prototype.onKeyDown = function(e) {
  20809. var t = function() {
  20810. this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.Move, "key")
  20811. }
  20812. .bind(this)
  20813. , i = e.which;
  20814. switch (i) {
  20815. case p.F:
  20816. t(),
  20817. this.changeFloor(-1);
  20818. break;
  20819. case p.R:
  20820. t(),
  20821. this.changeFloor(1)
  20822. }
  20823. if (this.mode === u.PANORAMA)
  20824. switch (i) {
  20825. case p.UPARROW:
  20826. case p.W:
  20827. this.flyLocalDirection(d.FORWARD.clone());
  20828. break;
  20829. case p.DOWNARROW:
  20830. case p.S:
  20831. this.flyLocalDirection(d.BACK.clone());
  20832. break;
  20833. case p.A:
  20834. this.flyLocalDirection(d.LEFT.clone());
  20835. break;
  20836. case p.D:
  20837. this.flyLocalDirection(d.RIGHT.clone())
  20838. }
  20839. }
  20840. ,
  20841. n.prototype.handleScrollPinchZoom = function() {
  20842. return function(e) {
  20843. var t = e
  20844. , i = this.zoomLevel;
  20845. this.zoomBy(t),
  20846. this.currentPano && this.zoomStats.addZoomAction(i, this.zoomLevel, this.currentPano.id)
  20847. }
  20848. }(),
  20849. n.prototype.handleControlPinch = function(e) {
  20850. f.zoom.enabled ? this.handleScrollPinchZoom(1 - e) : this.flyLocalDirection(new r.Vector3(0,0,e).normalize())
  20851. }
  20852. ,
  20853. n.prototype.handleControlScroll = function(e) {
  20854. f.zoom.enabled ? (e > 0 ? e = 1 + this.scrollZoomSpeed : e < 0 && (e = 1 - this.scrollZoomSpeed),
  20855. 0 !== e && this.handleScrollPinchZoom(e)) : this.flyLocalDirection(new r.Vector3(0,0,-e).normalize())
  20856. }
  20857. ,
  20858. n.prototype.handleInputStart = function(e, t, i) {
  20859. this.isTouchEvent = i,
  20860. m.convertScreenPositionToNDC(e, t, this.mouse),
  20861. m.convertScreenPositionToNDC(e, t, this.mouseAtMouseDown),
  20862. this.mouseCouldBeClickToMove = !0,
  20863. this.mouseDown = !0
  20864. }
  20865. ,
  20866. n.prototype.handleInputMove = function(e, t, i) {
  20867. this.isTouchEvent = i,
  20868. m.convertScreenPositionToNDC(e, t, this.mouse),
  20869. this.mouseAtMouseDown.distanceTo(this.mouse) > f.input.moveToleranceNDC && (this.mouseCouldBeClickToMove = !1,
  20870. this.couldBeLongTap = !1,
  20871. clearTimeout(this.mouseDownTimer)),
  20872. this.mouseLastMoveTime = Date.now(),
  20873. this.reticule.move(e, t, i)
  20874. }
  20875. ,
  20876. n.prototype.handleInputEnd = function(e, t, i) {//xzw
  20877. if (this.isTouchEvent = i,
  20878. this.mouseDown = !1,
  20879. this.cameraControls.controls[u.PANORAMA].emit("interaction.direct"),
  20880. !i && this.couldBeLongTap)
  20881. return !0;
  20882. if (this.handleLongTap())
  20883. return !0;
  20884. if (this.mouseCouldBeClickToMove) {
  20885. if (this.flying)
  20886. return this.path.activeTransType === x.WALK && this.emit(w.WarpInterruptedWithFlyTo, this.path.activeTransType),
  20887. !0;
  20888. if(this.checkHotClick())//add
  20889. return !0;
  20890. if(g_HotStatus == "add"){//添加热点 add
  20891. var position = this.reticule.position.toArray();
  20892. var rotation = this.reticule.rotation.toArray().slice(0,3);
  20893. var sid = "hot"+(this.model.hotsCount+g_newHot.length);
  20894. while(this.model.hots[sid]){sid+="_1"}//防重名
  20895. var hot = new Hot(sid, {position:position, rotation:rotation, size:2}, this.model);
  20896. g_newHot.push(hot);
  20897. this.model.hots[sid] = hot;
  20898. //$('#addHot textarea')[0].value+=('添加热点:\r"'+sid + '":{ "position":['+position+'], "rotation":['+rotation+']},\r');
  20899. logData('添加热点:\r"'+sid + '":{ "position":['+position+'], "rotation":['+rotation+']},\r')
  20900. g_HotStatus = false;
  20901. $("#player").css("cursor","");
  20902. return !0;
  20903. }
  20904. //if (this.checktagClick())
  20905. // return !0;
  20906. if (this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.Move, this.isTouchEvent ? "touch" : "mouse"),
  20907. this.history.invalidate(),
  20908. this.intersect)
  20909. return this.flyToPanoClosestToMouse();
  20910. if (this.mode === u.PANORAMA) {
  20911. var n = this.closestPanoInDirection(this.getMouseDirection());
  20912. return n ? this.flyToPano({
  20913. pano: n
  20914. }) : this.bump(this.getMouseDirection())
  20915. }
  20916. }
  20917. this.intersect && this.closestPano && this.closestPano.hoverOff(this.mode)
  20918. }
  20919. ,
  20920. n.prototype.handleLongTap = function() {
  20921. if (this.couldBeLongTap && (!this.isPanoHover || this.mode !== u.PANORAMA))
  20922. return this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.LongTap, "touch"),
  20923. !0
  20924. }
  20925. ,
  20926. n.prototype.checktagClick = function() {
  20927. if (this.tagManager.intersectTag) {
  20928. var e = this.isTouchEvent
  20929. , t = this.tagManager.clickedOnTag(e, this);
  20930. return e || t || y.cancelById(V.LookTransition),
  20931. !0
  20932. }
  20933. if (this.tagManager.activeTag)
  20934. return this.tagManager.dismissActiveTag(),
  20935. !1
  20936. }
  20937. ,
  20938. n.prototype.rankedtagInDirection = function(e, t) {
  20939. return this.tagManager.rankedtagInDirection(e, this.position, this.camera, t)
  20940. }
  20941. ,
  20942. n.prototype.start = function(e) {
  20943. var t = e.mode
  20944. , i = e.pano
  20945. , n = e.position
  20946. , r = e.quaternion
  20947. , o = e.tag
  20948. , a = e.quickstart
  20949. , s = $.Deferred();
  20950. this.updateModelDependentData(),
  20951. this.updateFromControls(),
  20952. this.findDefaultViews();
  20953. var l = this.is360View(t, i);
  20954. return !this.model.outsideAllowed() || l || a ? this.startInside(i, n, r, o, s) : this.startOutside(e, s),
  20955. s.done(function(e) {
  20956. this.emit(w.Ready, l, e, o)
  20957. }
  20958. .bind(this)),
  20959. s.promise()
  20960. }
  20961. ,
  20962. n.prototype.startOutside = function(e, t) {
  20963. var i = e.mode
  20964. , n = e.pano
  20965. , r = e.position
  20966. , o = e.quaternion
  20967. , a = e.zoom
  20968. , s = e.floorVisibility
  20969. , l = e.tag;
  20970. this.emit(w.StartOutside, f[i].transitionTime),
  20971. this.isOutsideMode(i) ? (this.model.warpDestFloors(s, !0),
  20972. y.cancelById(V.FlyToViewFloor),
  20973. i === u.FLOORPLAN ? this.floorplanMode(r, o, a) : this.dollhouseMode(r, o),
  20974. t.resolve(!1)) : this.startInsideWithFlyin(n, r, o, l, t)
  20975. }
  20976. ,
  20977. n.prototype.startInside = function(e, t, i, n, r) {
  20978. r = r || $.Deferred(),
  20979. this.currentPano = e;
  20980. var o = e && !e.isAligned();
  20981. if (t = o ? e.position : t || e.position,
  20982. i = i || e.quaternion,
  20983. e) {
  20984. var a = this.startInside.bind(this, e, t, i, n, r);
  20985. if (this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, a))
  20986. return
  20987. }
  20988. return this.mode = u.PANORAMA,
  20989. e.floor.enter(this.mode),
  20990. this.emit(w.PanoChosen, this.currentPano, this.currentPano),
  20991. this.switchCameraMode(this.mode, i),
  20992. this.emit(w.StartInside, o),
  20993. r.resolve(!0),
  20994. r
  20995. }
  20996. ,
  20997. n.prototype.startInsideWithFlyin = function(e, t, i, n, r) {
  20998. if (r = r || $.Deferred(),
  20999. this.dollhouseMode(),
  21000. !e)
  21001. return F.warn("Player.startInsideWithFlyin() -> targetPano is invalid."),
  21002. r.resolve(!1),
  21003. r;
  21004. t = t || e.position;
  21005. var o = i || this.cameraControls.activeControl.camera.quaternion
  21006. , a = e.position;
  21007. return this.fitDollhouse(a, t, o),
  21008. setTimeout(function(t) {
  21009. this.cameraControls.activeControl && (this.cameraControls.activeControl.maxDistance = t);
  21010. var n = {
  21011. mode: u.PANORAMA,
  21012. pano: e,
  21013. quaternion: i,
  21014. callback: function() {
  21015. this.emit(w.FlyinFinished),
  21016. r.resolve(!0)
  21017. }
  21018. .bind(this)
  21019. };
  21020. this.flyToNewMode(n)
  21021. }.bind(this, this.cameraControls.activeControl.maxDistance), f.startupFlyinDelay),
  21022. r
  21023. }
  21024. ,
  21025. n.prototype.checkAndWaitForPanoLoad = function() {
  21026. var e = {}
  21027. , t = {}
  21028. , i = 5e3
  21029. , n = function() {
  21030. for (var n in e)
  21031. if (e.hasOwnProperty(n) && e[n]) {
  21032. var r = performance.now() - t[n];
  21033. if (r < i)
  21034. return !0
  21035. }
  21036. return !1
  21037. };
  21038. return function(r, o, a, s, l, c, h, u, d, p) {
  21039. if (n())
  21040. return !0;
  21041. var f = function(t, i, n) {
  21042. N.delayOneFrame(function() {
  21043. e[t] = !1,
  21044. l && l(i, n)
  21045. }
  21046. .bind(this))
  21047. }
  21048. .bind(this, r.id)
  21049. , g = function(t, i) {
  21050. N.delayOneFrame(function() {
  21051. e[t] = !1,
  21052. c && c(i)
  21053. }
  21054. .bind(this))
  21055. }
  21056. .bind(this, r.id);
  21057. try {
  21058. return null !== u && void 0 !== u || (u = !0),
  21059. this.model.supportsTiles ? e[r.id] = this.checkAndWaitForTiledPanoLoad(r, s, f, g, h, u, d, p) : e[r.id] = this.checkAndWaitForWholePanoLoad(r, o, a, f, u),
  21060. e[r.id] && (t[r.id] = performance.now()),
  21061. e[r.id]
  21062. } catch (n) {
  21063. throw e[r.id] = !1,
  21064. t[r.id] = performance.now() - i,
  21065. n
  21066. }
  21067. }
  21068. }(),
  21069. n.prototype.checkAndWaitForWholePanoLoad = function(e, t, i, n, r) {
  21070. if (!e)
  21071. throw new M("Player.checkAndWaitForWholePanoLoad() -> Cannot load texture for null pano.");
  21072. return r && this.model.waitForLoad(e, function() {
  21073. return e.isLoaded(i)
  21074. }),
  21075. !e.isLoaded(t) && (e.loadCube(t).done(n),
  21076. !0)
  21077. }
  21078. ,
  21079. n.prototype.checkAndWaitForTiledPanoLoad = function() {
  21080. var e = new r.Vector3;
  21081. return function(t, i, n, r, o, a, s, l) {
  21082. if (!t)
  21083. throw new M("Player.checkAndWaitForTiledPanoLoad() -> Cannot load texture for null pano.");
  21084. return e.copy(d.FORWARD),
  21085. this.getDirection(e),
  21086. !t.isLoaded(i) && (a && this.model.waitForLoad(t, function() {
  21087. return t.isLoaded(i)
  21088. }),
  21089. t.loadTiledPano(i, e, null, s, l).done(function(e, t) {
  21090. n && n(e, t)
  21091. }
  21092. .bind(this)).fail(function(e) {
  21093. r && r(e)
  21094. }
  21095. .bind(this)).progress(function(e, t, i) {
  21096. o && o(e, t, i)
  21097. }
  21098. .bind(this)),
  21099. !0)
  21100. }
  21101. }(),
  21102. n.prototype.switchCameraMode = function(e, t) {
  21103. var i = this.cameraControls.controls[e]
  21104. , n = i.camera;
  21105. switch (e) {
  21106. case u.PANORAMA:
  21107. n.position.copy(this.currentPano.position);
  21108. var o = t ? d.FORWARD.clone().applyQuaternion(t) : this.getDirection().setY(0).normalize();
  21109. i.lookAt(o.add(n.position));
  21110. break;
  21111. case u.DOLLHOUSE:
  21112. var a = this.position.clone();
  21113. this.mode === u.PANORAMA ? a.add(new r.Vector3(0,6,0)).add(this.getDirection().multiplyScalar(-10)) : a.add(d.DOWN.clone().applyQuaternion(this.quaternion).multiplyScalar(6)).setY(6),
  21114. n.position.copy(a),
  21115. i.target.copy(this.target.clone().setY(this.model.center.y));
  21116. break;
  21117. case u.FLOORPLAN:
  21118. n.position.copy(this.model.center).setY(f.floorplan.cameraHeight),
  21119. i.target.copy(this.model.center).setY(0),
  21120. i.zoomToContain(this.model.size),
  21121. i.rotateToView(this.model.size, this.getDirection())
  21122. }
  21123. i.update(0)
  21124. }
  21125. ,
  21126. n.prototype.update = function() {
  21127. var e = (new r.Vector3,
  21128. {})
  21129. , t = [];
  21130. return function(i) {
  21131. this.updatePersistentZooming(i),
  21132. this.updateFromControls(i),
  21133. this.getCurrentNodePanos(t),
  21134. this.hasChanged(e) && (this.lastChangeTime = Date.now(),
  21135. !this.mouseDown && this.containsMouse && this.updateIntersect(),
  21136. this.emit(w.ViewChanged)),
  21137. this.model.supportsTiles && (this.updateTileDownloader(t),
  21138. this.updatePanoRenderer(t)),
  21139. this.updatePreRendering(t),
  21140. this.reticule.update(),
  21141. this.path.update(),
  21142. this.spider.update(),
  21143. this.cachedPanoCandidates && f.navigation.panoScores && this.model.panos.showPanoScores(this.cachedPanoCandidates),
  21144. this.updateControlLocks(),
  21145. this.model.supportsTiles && this.updateZoomPano()
  21146. }
  21147. }(),
  21148. n.prototype.updatePersistentZooming = function(e) {
  21149. 1 === this.zooming ? this.zoomBy(1 + this.zoomSpeed * e) : this.zooming === -1 && this.zoomBy(1 - this.zoomSpeed * e)
  21150. }
  21151. ,
  21152. n.prototype.updateControlLocks = function() {
  21153. this.currentPano && this.model.supportsTiles && (this.cameraControls.controls[u.PANORAMA].locked = !this.currentPano.highestFullTileRenderOpCompleted && this.currentPano.lockUntilRenderingComplete)
  21154. }
  21155. ,
  21156. n.prototype.updatePanoRenderer = function() {
  21157. var e = new r.Vector3;
  21158. return function(t) {
  21159. var i = this.nextPano || this.currentPano;
  21160. this.panoRenderer.hasQueuedTiles() && i && (e.copy(d.FORWARD),
  21161. this.getDirection(e),
  21162. this.panoRenderer.updateDirection(e))
  21163. }
  21164. }(),
  21165. n.prototype.cleanupInactivePanos = function() {
  21166. var e = []
  21167. , t = [];
  21168. return function() {
  21169. e.length = 0,
  21170. e.push(this.currentPano),
  21171. this.nextPano && e.push(this.nextPano),
  21172. t.length = 0;
  21173. for (var i = 0; i < this.panoRenderer.activePanos.length; i++)
  21174. t.push(this.panoRenderer.activePanos[i]);
  21175. for (var n = 0; n < t.length; n++) {
  21176. for (var r = t[n], o = !0, a = 0; a < e.length; a++)
  21177. r.id === e[a].id && (o = !1);
  21178. o && r.exit()
  21179. }
  21180. }
  21181. }(),
  21182. n.prototype.updatePreRendering = function() {
  21183. var e = {};
  21184. return function(t) {
  21185. if (1 === f.tiling.preRenderTourPanos && this.preRenderingEnabled) {
  21186. var i = this.nextPano || this.currentPano;
  21187. if (i && t && t.length > 1) {
  21188. var n = t.findIndex(function(e) {
  21189. if (e.id === i.id)
  21190. return !0
  21191. });
  21192. if (n >= 0 && n + 1 < t.length) {
  21193. var r = t[n + 1];
  21194. r.isLoaded(this.basePanoSize) || e[r.id] || (window.setTimeout(function(t) {
  21195. this.checkAndWaitForPanoLoad(t, "high", "low", this.basePanoSize, null, null, null, !1, !1, !1),
  21196. window.setTimeout(function(t) {
  21197. e[t.id] = !1
  21198. }
  21199. .bind(this, t), f.tiling.panoPreRenderRepeatDelay)
  21200. }
  21201. .bind(this, r), f.tiling.panoPreRenderDelay),
  21202. e[r.id] = !0)
  21203. }
  21204. }
  21205. }
  21206. }
  21207. }(),
  21208. n.prototype.enablePreRendering = function() {
  21209. this.preRenderingEnabled = !0
  21210. }
  21211. ,
  21212. n.prototype.disablePreRendering = function() {
  21213. this.preRenderingEnabled = !1,
  21214. this.cleanupInactivePanos()
  21215. }
  21216. ,
  21217. n.prototype.updateTileDownloader = function() {
  21218. var e = new r.Vector3;
  21219. return function(t) {
  21220. var i = this.nextPano || this.currentPano;
  21221. i && (e.copy(d.FORWARD),
  21222. this.getDirection(e),
  21223. this.tileDownloader.tilePrioritizer.updateCriteria(i, this.position, e, t.length > 0 ? t : null),
  21224. this.tileDownloader.processPriorityQueue = !0)
  21225. }
  21226. }(),
  21227. n.prototype.updateFromControls = function(e) {
  21228. null !== e && void 0 !== e || (e = 0),
  21229. this.cameraControls.activeControl && (this.cameraControls.activeControl.update(e),
  21230. this.quaternion.copy(this.cameraControls.activeControl.camera.quaternion),
  21231. this.position.copy(this.cameraControls.activeControl.camera.position),
  21232. this.target.copy(this.cameraControls.activeControl.target),
  21233. this.cameraControls.activeControl.camera.updateProjectionMatrix(),
  21234. this.camera.projectionMatrix.copy(this.cameraControls.activeControl.camera.projectionMatrix)),
  21235. this.camera.position.copy(this.position),
  21236. this.camera.quaternion.copy(this.quaternion),
  21237. this.camera.updateMatrix(),
  21238. this.camera.updateMatrixWorld()
  21239. }
  21240. ,
  21241. n.prototype.hasChanged = function(e) {
  21242. if (!this.previousState)
  21243. return this.previousState = {
  21244. allFloorsVisible: this.model.allFloorsVisible,
  21245. position: this.position.clone(),
  21246. quaternion: this.quaternion.clone(),
  21247. mouse: this.mouse.clone(),
  21248. labelScaleFactor: this.getLabelScaleFactor(),
  21249. currentFloor: this.model.currentFloor,
  21250. projectionMatrix: this.camera.projectionMatrix.clone(),
  21251. worldMatrix: this.camera.matrixWorld.clone(),
  21252. mode: this.mode,
  21253. modelPosition: this.model.position.clone(),
  21254. modelCenter: this.model.center.clone(),
  21255. zoomLevel: this.zoomLevel
  21256. },
  21257. !0;
  21258. 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;
  21259. return e.allFloorsVisible = this.model.allFloorsVisible !== this.previousState.allFloorsVisible,
  21260. e.moved = !this.position.equals(this.previousState.position),
  21261. e.rotated = !this.quaternion.equals(this.previousState.quaternion),
  21262. e.mouseMoved = !this.mouse.equals(this.previousState.mouse),
  21263. e.labelScaleFactor = this.getLabelScaleFactor() !== this.previousState.labelScaleFactor,
  21264. e.floorChanged = this.model.currentFloor !== this.previousState.currentFloor,
  21265. e.cameraProjectionChanged = !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix),
  21266. e.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(this.previousState.worldMatrix),
  21267. e.modeChanged = this.mode !== this.previousState.mode,
  21268. e.modelPositionChanged = !this.model.position.equals(this.previousState.modelPosition),
  21269. e.modelCenterChanged = !this.model.center.equals(this.previousState.modelCenter),
  21270. e.nextPanoActive = null !== this.nextPano,
  21271. e.zoomLevel = this.zoomLevel !== this.previousState.zoomLevel,
  21272. this.previousState.allFloorsVisible = this.model.allFloorsVisible,
  21273. this.previousState.position.copy(this.position),
  21274. this.previousState.quaternion.copy(this.quaternion),
  21275. this.previousState.mouse.copy(this.mouse),
  21276. this.previousState.labelScaleFactor = this.getLabelScaleFactor(),
  21277. this.previousState.currentFloor = this.model.currentFloor,
  21278. this.previousState.projectionMatrix.copy(this.camera.projectionMatrix),
  21279. this.previousState.worldMatrix.copy(this.camera.matrixWorld),
  21280. this.previousState.mode = this.mode,
  21281. this.previousState.modelPosition.copy(this.model.position),
  21282. this.previousState.modelCenter.copy(this.model.center),
  21283. this.previousState.zoomLevel = this.zoomLevel,
  21284. !t
  21285. }
  21286. ,
  21287. n.prototype.updateIntersect = function() {
  21288. var e = this.flying || this.isWarping()
  21289. , t = this.isOutsideMode() && this.cameraControls.controls[this.mode].isEngaged()
  21290. , i = y.getById(V.LookTransition)
  21291. , n = !(e || t || this.isTouchEvent || i.length && i[0].running);
  21292. //this.tagManager.intersecttag(this.mouse, n, this.camera) || (this.intersect = this.getMouseIntersect(),//--MP
  21293. this.intersect = this.getMouseIntersect(); //xzw change
  21294. this.intersect && this.updateClosestPano(this.intersect),
  21295. this.closestPano || this.closestPanoInDirection(this.getMouseDirection()) ? (this.reticule.updatePosition(this.position, this.intersect),
  21296. f.navigation.panoScores && !f.navigation.mouseDirection && this.closestPanoInDirection(this.getDirection())) : this.reticule.hide()
  21297. }
  21298. ,
  21299. n.prototype.checkHotClick = function() {
  21300. if(this.intersectHot){
  21301. this.intersectHot.examine(this);
  21302. /* g_touraudio.pause();
  21303. g_bgaudio = false;
  21304. document.getElementById("bgaudio").pause();
  21305. var sWidth = document.body.scrollWidth;
  21306. var sHeight = document.body.scrollHeight;
  21307. var pop1 = document.getElementById('popup');
  21308. pop1.style.display = "block";
  21309. var myElement = document.createElement("iframe");
  21310. myElement.src = g_HotMeshes[i].hotLink;
  21311. myElement.id = "id1";
  21312. myElement.allowTransparency = "true";
  21313. myElement.style.width = "100%";
  21314. myElement.style.height = "100%";
  21315. myElement.scrolling = "no";
  21316. var element=document.getElementById("id1");
  21317. if (typeof(element)== "undefined" || element == null){
  21318. document.getElementById("popup").appendChild(myElement);
  21319. }
  21320. var oClose = document.getElementById("closepop");
  21321. oClose.onclick = function() {
  21322. pop1.style.display = "none";
  21323. document.getElementById("popup").removeChild(document.getElementById("id1"));
  21324. $("#popup iframe:last").remove();
  21325. document.getElementById("bgaudio").play();
  21326. } */
  21327. return true;
  21328. }
  21329. },
  21330. n.prototype.getMouseDirection = function(e) {
  21331. e = e || this.mouse;
  21332. var t = new r.Vector3(e.x,e.y,-1).unproject(this.camera)
  21333. , i = new r.Vector3(e.x,e.y,1).unproject(this.camera);
  21334. return i.sub(t).normalize()
  21335. }
  21336. ,
  21337. n.prototype.getMouseIntersect = function(e, t) {//xzw change
  21338. e = e || this.mouse.clone(),
  21339. t = t || this.model.floors.reduce(function(e, t) {
  21340. return t.hidden ? e : e.concat(t.collider.children)
  21341. }, this.mode === u.PANORAMA ? this.panoMarkers : []);
  21342. for(var i in this.model.hots){
  21343. t.push(this.model.hots[i].mesh);
  21344. }
  21345. var i = new r.Vector3(e.x,e.y,-1).unproject(this.camera);
  21346. this.raycaster.set(i, this.getMouseDirection(e));
  21347. var n = this.raycaster.intersectObjects(t);
  21348. if (0 === n.length){
  21349. this.intersectHot = null; //add
  21350. if(g_HotStatus!="add") $("#player").css("cursor","");
  21351. return null;
  21352. }
  21353. var o = n[0];
  21354. if(o.object.type == "hotSprite"){ //add
  21355. this.intersectHot = o.object.belongHot;
  21356. $("#player").css("cursor","pointer");
  21357. return;
  21358. }
  21359. this.intersectHot = null;
  21360. if(g_HotStatus!="add") $("#player").css("cursor","");
  21361. if (o.face) {
  21362. o.normal = o.face.normal.applyQuaternion(o.object.quaternion);
  21363. var a = this.position.clone().sub(o.point);
  21364. a.dot(o.normal) < 0 && o.normal.negate(),
  21365. this.currentPano ? o.onFloor = o.point.y < this.position.y - .5 * this.currentPano.height : o.onFloor = o.point.y < this.position.y - .5,
  21366. o.horizontal = o.normal.y > .8
  21367. }
  21368. return o
  21369. }
  21370. ,
  21371. n.prototype.updateClosestPano = function(e) {
  21372. var t = [s.filters.isPanoAligned()];
  21373. if (this.mode === u.PANORAMA) {
  21374. if (!this.currentPano)
  21375. return;
  21376. t.push(s.filters.not(this.currentPano)),
  21377. t.push(s.filters.inFloorDirection(this.currentPano.floorPosition, this.getDirection(), .25)),
  21378. t.push(s.filters.isNeighbourPanoTo(this.currentPano)),
  21379. t.push(s.filters.isCloseEnoughTo(e.point, f.panoFloorClickRadius)),
  21380. t.push(s.filters.isNotBehindNormal(e.point, e.normal))
  21381. } else
  21382. t.push(s.filters.isOnVisibleFloor()),
  21383. this.mode !== u.FLOORPLAN && t.push(s.filters.inDirection(this.position, this.getDirection(), .25));
  21384. var i = this.model.panos.find(t, [s.sortFunctions.floorDistanceToPoint(e.point)]);
  21385. i !== this.closestPano ? (i && (this.isPanoHover = !0),
  21386. this.emit(w.ClosestPanoChanging, this.closestPano, i, this.mode),
  21387. this.closestPano = i) : this.isPanoHover = !1
  21388. }
  21389. ,
  21390. n.prototype.dollhouseMode = function(e, t) {
  21391. this.emit(w.ModeChanging, this.mode, u.DOLLHOUSE),
  21392. this.mode = u.DOLLHOUSE,
  21393. this.cameraControls.controls[u.DOLLHOUSE].reset();
  21394. var i = new r.Vector3(this.model.center.x,0,this.model.center.z)
  21395. , n = new r.Vector3(15,10,15);
  21396. if (e && t) {
  21397. var o = d.FORWARD.clone().applyQuaternion(t)
  21398. , a = this.model.center.clone().sub(e)
  21399. , s = a.dot(o);
  21400. s > 0 ? (i = o.clone().multiplyScalar(s).add(e),
  21401. n.copy(e)) : F.warn("Tried to initiate dollhouse mode that wasn't looking at the model", e, t)
  21402. }
  21403. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(0, !0),
  21404. this.cameraControls.controls[u.DOLLHOUSE].target.copy(i),
  21405. this.cameraControls.cameras[u.DOLLHOUSE].position.copy(n),
  21406. this.updateFromControls(),
  21407. this.model.alpha = 1,
  21408. this.model.skybox.material.uniforms.opacity.value = 0
  21409. }
  21410. ,
  21411. n.prototype.insideMode = function(e, t) {
  21412. var i = $.Deferred()
  21413. , n = t || null;
  21414. if (this.mode !== u.PANORAMA && this.mode !== u.TRANSITIONING) {
  21415. var r = [s.filters.isPanoAligned()];
  21416. this.model.currentFloor && r.push(s.filters.atFloor(this.model.currentFloor)),
  21417. e = e || this.currentPano || this.model.panos.find(r, [s.sortFunctions.distanceToPoint(this.cameraControls.activeControl.target)]),
  21418. this.flyToNewMode({
  21419. mode: u.PANORAMA,
  21420. pano: e,
  21421. callback: n
  21422. }).done(i.resolve.bind(i)).fail(i.reject.bind(i))
  21423. } else {
  21424. var o = this.mode === u.PANORAMA ? "Already in panorama mode" : "Cannot change mode during mode transition";
  21425. i.reject(o)
  21426. }
  21427. return i.promise()
  21428. }
  21429. ,
  21430. n.prototype.fitDollhouse = function(e, t, i) {
  21431. var n = d.FORWARD.clone().applyQuaternion(i);
  21432. this.cameraControls.activeControl.target.copy(n).add(e);
  21433. var o = d.RIGHT.clone().applyQuaternion(i)
  21434. , a = d.UP.clone()
  21435. , s = o.clone().applyAxisAngle(a, Math.PI / 2)
  21436. , l = this.model.boundingBox.max.clone()
  21437. , c = this.model.boundingBox.min.clone()
  21438. , h = [new r.Vector3(l.x,0,l.z).sub(e), new r.Vector3(l.x,0,c.z).sub(e), new r.Vector3(c.x,0,l.z).sub(e), new r.Vector3(c.x,0,c.z).sub(e)]
  21439. , u = 0
  21440. , p = 0
  21441. , g = 0;
  21442. h.forEach(function(e, t, i) {
  21443. var n = Math.abs(e.dot(o))
  21444. , r = e.dot(s);
  21445. n > u && (u = n,
  21446. p = r),
  21447. r > g && (g = r)
  21448. });
  21449. var m = Math.max(Math.abs(new r.Vector3(0,l.y,0).sub(e).dot(a)), Math.abs(new r.Vector3(0,c.y,0).sub(e).dot(a)))
  21450. , v = s.clone().multiplyScalar(p).add(t)
  21451. , A = s.clone().multiplyScalar(g).add(t);
  21452. p = u / Math.tan(this.cameraControls.activeControl.camera.fov / 2 * this.cameraControls.activeControl.camera.aspect * (Math.PI / 180)),
  21453. g = m / Math.tan(this.cameraControls.activeControl.camera.fov / 2 * (Math.PI / 180)),
  21454. p = Math.max(p, 10),
  21455. g = Math.max(g, 10);
  21456. var y = n.clone().multiplyScalar(-p).add(v).sub(t).length()
  21457. , C = n.clone().multiplyScalar(-g).add(v).sub(t).length();
  21458. this.cameraControls.activeControl.maxDistance = f.skyboxRadius - 1,
  21459. y >= C ? this.cameraControls.activeControl.camera.position.set(0, 6, 0).add(v).add(n.multiplyScalar(1.1 * -p)) : this.cameraControls.activeControl.camera.position.set(0, 6, 0).add(A).add(n.multiplyScalar(1.1 * -g))
  21460. }
  21461. ,
  21462. n.prototype.floorplanMode = function(e, t, i) {
  21463. this.mode = u.FLOORPLAN;
  21464. var n = this.cameraControls.controls[u.FLOORPLAN];
  21465. n.reset();
  21466. var r = e ? e : this.model.center;
  21467. if (n.target.copy(r).setY(0),
  21468. n.camera.position.copy(r).setY(f.floorplan.cameraHeight),
  21469. i ? (n.currentScale = i / ($("#player").width() / $("#player").height()),
  21470. n.absoluteScale = n.currentScale) : n.zoomToContain(this.model.size),
  21471. t) {
  21472. var o = d.LEFT.clone().applyQuaternion(t);
  21473. n.rotateLeft(-Math.atan2(o.x, o.z))
  21474. } else
  21475. n.rotateToView(this.model.size, this.getDirection());
  21476. n.update(0)
  21477. }
  21478. ,
  21479. n.prototype.nonInterruptingFlyToPano = function(e, t) {
  21480. return e.skipWarpingCheck = !0,
  21481. this.flyToPano(e, t)
  21482. }
  21483. ,
  21484. n.prototype.flyToPano = function(e, t) {
  21485. var i = e.pano
  21486. , n = e.lookAtPoint
  21487. , o = e.duration
  21488. , a = e.aimDuration
  21489. , s = e.maxDistanceOverride
  21490. , l = e.skipWarpingCheck
  21491. , c = e.constantMoveSpeed
  21492. , h = null
  21493. , p = null;
  21494. if (this.isWarping() && !l && (this.path.activeTransType === x.BLACK || this.path.activeTransType === x.STD))
  21495. return F.warn("Player.flyToPano() -> Cannot fly when warping"),
  21496. t && t(),
  21497. !1;
  21498. if (this.updateLastView(),
  21499. this.mode !== u.PANORAMA) {
  21500. var m;
  21501. return n && (m = (new r.Quaternion).setFromUnitVectors(d.FORWARD, n.sub(i.position).normalize())),
  21502. void this.flyToNewMode({
  21503. mode: u.PANORAMA,
  21504. pano: i,
  21505. duration: o,
  21506. quaternion: m,
  21507. callback: t
  21508. })
  21509. }
  21510. if (!i || (h = g.deepExtend(e),
  21511. p = function() {
  21512. N.delayOneFrame(function() {
  21513. this.flyToPano(h, t)
  21514. }
  21515. .bind(this))
  21516. }
  21517. .bind(this),
  21518. !this.checkAndWaitForPanoLoad(i, "high", "low", this.basePanoSize, p))) {
  21519. var C = function(e) {
  21520. t && t(e)
  21521. }
  21522. .bind(this);
  21523. this.currentPano || (this.currentPano = i,
  21524. this.path.placeCpm(),
  21525. this.path.fadeOutCpm(f.path.fadeOutTime),
  21526. this.spider.draw());
  21527. var I = o;
  21528. if ("number" != typeof o) {
  21529. var E = s || f.transition.flytimeMaxDistanceThreshold;
  21530. I = Math.min(this.currentPano.position.distanceTo(i.position), E) * f.transition.flytimeDistanceMultiplier + f.transition.flyTime
  21531. }
  21532. if (f.transition.flySpeed > .01 && (I = 1e3 * this.currentPano.position.distanceTo(i.position) / f.transition.flySpeed),
  21533. 1 !== this.zoomLevel)
  21534. switch (f.zoom.transitionStyle) {
  21535. case 1:
  21536. this.smoothZoomToDefault(I / 2);
  21537. break;
  21538. case 2:
  21539. return h = g.deepExtend(e),
  21540. p = this.flyToPano.bind(this, h, t),
  21541. void this.smoothZoomToDefault(f.zoom.restoreTime * (this.zoomLevel - 1), p)
  21542. }
  21543. if (n) {
  21544. y.cancelById(V.LookTransition),
  21545. I *= f.transition.aimSlowFactor;
  21546. var b = this.cameraControls.activeControl.camera.quaternion.clone()
  21547. , _ = (new r.Matrix4).lookAt(i.position, n, d.UP)
  21548. , T = (new r.Quaternion).setFromRotationMatrix(_)
  21549. , S = b.clone()
  21550. , M = new r.Vector3;
  21551. if (i === this.currentPano) {
  21552. var R = d.FORWARD.clone().applyQuaternion(b)
  21553. , P = d.FORWARD.clone().applyQuaternion(T)
  21554. , O = R.angleTo(P);
  21555. return void 0 !== a && null !== a || (a = 1 * Math.sqrt(O) / f.tags.navigate.rotateSpeedFactor * 1e3),
  21556. void y.start(function(e) {
  21557. S.copy(b),
  21558. v.quaternion(S, T)(e),
  21559. M.copy(d.FORWARD).applyQuaternion(S).add(this.cameraControls.activeControl.camera.position),
  21560. this.cameraControls.activeControl.lookAt(M)
  21561. }
  21562. .bind(this), a, C, 0, A[f.transition.movementEasing], null, V.LookTransition)
  21563. }
  21564. }
  21565. if (i === this.currentPano || this.flying)
  21566. return void C();
  21567. this.flying = !0;
  21568. var L = this.position.clone()
  21569. , D = this.currentPano;
  21570. F.debug("Flying to pano ", i.position),
  21571. this.emit(w.PanoChosen, this.currentPano, i),
  21572. this.emit(w.FlyingStarted, i.position, L, i, D),
  21573. n && y.start(function(e) {
  21574. S.copy(b),
  21575. v.quaternion(S, T)(e),
  21576. M.copy(d.FORWARD).applyQuaternion(S).add(this.cameraControls.activeControl.camera.position),
  21577. this.cameraControls.activeControl.lookAt(M)
  21578. }
  21579. .bind(this), I, null, 0, A[f.transition.movementEasing], null, V.LookTransition);
  21580. var B = c ? null : A[f.transition.movementEasing];
  21581. this.nextPano = i,
  21582. y.start(v.uniform(this.model.skybox, "progress", 1), I, null, 0, A[f.transition.blendEasing], "skyFly", V.FlyToPano),
  21583. y.start(v.allUniforms(this.model.chunks, "progress", 1), I, null, 0, A[f.transition.blendEasing], "chunkFly", V.FlyToPano),
  21584. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, i.position), I, function(e) {
  21585. this.flying = !1,
  21586. this.currentPano !== i && this.currentPano.exit(),
  21587. i.enter(),
  21588. this.currentPano = i,
  21589. this.nextPano = null,
  21590. this.path.placeCpm(),
  21591. this.path.fadeOutCpm(f.path.fadeOutTime),
  21592. this.spider.draw(),
  21593. this.emit(w.FlyingEnded, i.position, L, i, D),
  21594. C(e)
  21595. }
  21596. .bind(this), 0, B, "camFly", V.FlyToPano)
  21597. }
  21598. }
  21599. ,
  21600. n.prototype.fastForwardActivePanoFlight = function(e) {
  21601. e = e || f.transition.fastForwardFactor / 10 * 4 + 1,
  21602. y.adjustSpeed(V.FlyToPano, e),
  21603. y.adjustSpeed(V.LookTransition, e)
  21604. }
  21605. ,
  21606. n.prototype.flyToPanoClosestToMouse = function() {
  21607. if (Date.now() - this.mouseLastMoveTime > 50 && (this.intersect = this.getMouseIntersect(),
  21608. this.intersect && this.updateClosestPano(this.intersect)),
  21609. this.closestPano)
  21610. return this.flyToPano({
  21611. pano: this.closestPano
  21612. });
  21613. var e = this.getMouseDirection();
  21614. this.flyDirection(e) || this.flyToPano({
  21615. pano: this.currentPano
  21616. })
  21617. }
  21618. ,
  21619. n.prototype.flyLocalDirection = function(e) {
  21620. var t = this.getDirection(e)
  21621. , i = 1 === e.z ? .4 : .75
  21622. , n = 1 === Math.abs(e.x);
  21623. return this.flyDirection(t, i, n)
  21624. }
  21625. ,
  21626. n.prototype.flyDirection = function(e, t, i) {
  21627. this.closePopup();//xzw add
  21628. var n = $.Deferred();
  21629. this.history.invalidate();
  21630. var r = this.closestPanoInDirection(e, t, i);
  21631. return r ? this.flyToPano({
  21632. pano: r
  21633. }, n.resolve.bind(n, !0)) : (this.bump(e),
  21634. n.resolve(!1)),
  21635. n.promise()
  21636. }
  21637. ,
  21638. n.prototype.closestPanoInDirection = function(e, t, i) {
  21639. return this.rankedPanoInDirection(0, e, t, i)
  21640. }
  21641. ,
  21642. n.prototype.rankedPanoInDirection = function() {
  21643. var e = {
  21644. pano: null,
  21645. candidates: []
  21646. };
  21647. return function(t, i, n, r) {
  21648. t || (t = 0),
  21649. n = void 0 !== n ? n : .75;
  21650. var o = r ? "angle" : "direction";
  21651. return this.model.panos.findRankedByScore(t, [s.filters.isPanoAligned(), s.filters.inPanoDirection(this.position, i, n), s.filters.isNeighbourPanoTo(this.currentPano), s.filters.not(this.currentPano)], [s.scoreFunctions.distanceSquared(this.currentPano), s.scoreFunctions[o](this.position, i)], e),
  21652. this.cachedPanoCandidates = e.candidates,
  21653. e.pano
  21654. }
  21655. }(),
  21656. n.prototype.bump = function(e) {
  21657. if (this.mode === u.PANORAMA && !this.flying && !this.isWarping()) {
  21658. var t, i, n, r = f.transition, o = (r.flytimeMaxDistanceThreshold * r.flytimeDistanceMultiplier + r.flyTime) / 8, a = this.camera.getWorldDirection().dot(e), s = Math.abs(a) > .5;
  21659. if (s)
  21660. t = function() {
  21661. y.start(v.property(this.cameraControls.cameras[u.PANORAMA], "zoom", a > 0 ? 1.04 : .96), o, i, 0, A.easeInOutSine, "bumpZStart")
  21662. }
  21663. .bind(this),
  21664. i = function() {
  21665. y.start(v.property(this.cameraControls.cameras[u.PANORAMA], "zoom", 1), 5 * o, n, 0, A.easeInOutSine, "bumpZRelax")
  21666. }
  21667. .bind(this);
  21668. else {
  21669. var l = this.camera.position.clone()
  21670. , c = e.clone();
  21671. this.raycaster.set(l, c);
  21672. var h = this.model.floors.reduce(function(e, t) {
  21673. return e.concat(t.collider.children)
  21674. }, [])
  21675. , d = this.raycaster.intersectObjects(h)
  21676. , p = d.length > 0 ? d[0].distance / 25 : .04
  21677. , g = l.clone().add(c.multiplyScalar(p));
  21678. t = function() {
  21679. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, g), o, i, 0, A.easeInOutSine, "bumpTStart")
  21680. }
  21681. .bind(this),
  21682. i = function() {
  21683. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, l), 5 * o, n, 0, A.easeInOutSine, "bumpTRelax")
  21684. }
  21685. .bind(this)
  21686. }
  21687. n = function() {
  21688. this.flying = !1
  21689. }
  21690. .bind(this),
  21691. this.flying = !0,
  21692. t()
  21693. }
  21694. }
  21695. ,
  21696. n.prototype.changeFloor = function(e) {
  21697. if (!this.is360View(this.mode, this.currentPano))
  21698. if (this.mode === u.PANORAMA) {
  21699. var t = this.history.reversePano(e);
  21700. t && t.isAligned() ? this.flyToPano({
  21701. pano: t
  21702. }) : this.changeFloorByScore(e)
  21703. } else
  21704. this.model.setFloor(this.model.nextFloor(e) || this.model.currentFloor)
  21705. }
  21706. ,
  21707. n.prototype.changeFloorByScore = function() {
  21708. var e = {
  21709. pano: null,
  21710. candidates: []
  21711. };
  21712. return function(t) {
  21713. var i = this.model.nextFloor(t);
  21714. return i ? (this.model.panos.lowestByScore([s.filters.atFloor(i), s.filters.isPanoAligned()], [s.scoreFunctions.distance(this.currentPano), s.scoreFunctions.direction(this.position, new r.Vector3(0,t,0)), s.scoreFunctions.penalizeHeightDifferenceUnder(this.position, .5)], e),
  21715. void (e.pano ? (this.cachedPanoCandidates = e.candidates,
  21716. this.history.push(t, this.currentPano),
  21717. this.flyToPano({
  21718. pano: e.pano
  21719. })) : F.warn("No pano found on selected floor, not moving there."))) : void F.debug("player.changeFloor(" + t + "): no such floor")
  21720. }
  21721. }(),
  21722. n.prototype.gotoFloor = function(e) {
  21723. var t = e - this.model.currentFloor.floorIndex;
  21724. this.changeFloor(t)
  21725. }
  21726. ,
  21727. n.prototype.getDirection = function(e) {
  21728. return e = e ? e : (new r.Vector3).copy(d.FORWARD),
  21729. e.applyQuaternion(this.camera.quaternion)
  21730. }
  21731. ,
  21732. n.prototype.flyToSameMode = function(e, t, i, n, o) {
  21733. if (o = o || $.Deferred(),
  21734. this.mode === u.TRANSITIONING)
  21735. return F.warn("should not be transitioning here"),
  21736. n && n(!1),
  21737. o.reject().promise();
  21738. var a = i || !1
  21739. , s = i ? i.position : this.position
  21740. , l = this.position.clone()
  21741. , c = this.currentPano;
  21742. if (F.debug("New pose in mode " + this.mode),
  21743. !e || (retryCallback = function() {
  21744. N.delayOneFrame(function() {
  21745. this.flyToSameMode(e, t, i, n, o)
  21746. }
  21747. .bind(this))
  21748. }
  21749. .bind(this),
  21750. !this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, retryCallback))) {
  21751. var h = function() {
  21752. this.emit(w.FlyingEnded, s, l, e, c),
  21753. n && n(!0)
  21754. }
  21755. .bind(this)
  21756. , d = f[this.mode]
  21757. , p = void 0 !== t ? t : d.transitionTime
  21758. , g = new r.Vector3
  21759. , C = new r.Vector3;
  21760. if (this.emit(w.FlyingStarted, s, l, e, c),
  21761. this.mode === u.PANORAMA)
  21762. F.warn("we should not be here for panorama views");
  21763. else if (this.mode === u.DOLLHOUSE)
  21764. if (a) {
  21765. var I = new r.Vector3(0,1,0);
  21766. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(1, !0),
  21767. this.model.warpDestFloors(i.floorVisibility),
  21768. C.copy(i.position);
  21769. var E = new r.Vector3(0,0,-1).applyQuaternion(i.quaternion)
  21770. , b = new r.Raycaster(C.clone(),E.clone(),0,1 / 0)
  21771. , _ = b.intersectObjects(this.model.colliders)
  21772. , T = 3;
  21773. _.length ? (g.copy(_[0].point),
  21774. T = .75 * C.distanceTo(g)) : (g.copy(E).multiplyScalar(3).add(C),
  21775. F.debug("Tried to restore dollhouse mode that did not intersect...", i.position, i.quaternion));
  21776. var x = (new r.Matrix4).lookAt(C, g, I)
  21777. , S = (new r.Euler).setFromRotationMatrix(x, f.warp.eOrder)
  21778. , M = g.distanceTo(C)
  21779. , R = (new r.Matrix4).lookAt(this.cameraControls.cameras[u.DOLLHOUSE].position, this.cameraControls.controls[u.DOLLHOUSE].target, I)
  21780. , P = (new r.Euler).setFromRotationMatrix(R, f.warp.eOrder)
  21781. , O = this.cameraControls.cameras[u.DOLLHOUSE].position.distanceTo(this.cameraControls.controls[u.DOLLHOUSE].target);
  21782. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(Math.min(O, T), !0);
  21783. var L = new r.Euler(S.x - P.x,S.y - P.y,S.z - P.z,f.warp.eOrder);
  21784. L.y = L.y > Math.PI ? L.y -= 2 * Math.PI : L.y < -Math.PI ? L.y += 2 * Math.PI : L.y,
  21785. this.path.burnsDir = Math.sign(L.y);
  21786. var D = new r.Euler(0,0,0,f.warp.eOrder)
  21787. , B = new r.Vector3;
  21788. y.start(v.vector(this.cameraControls.controls[u.DOLLHOUSE].target, g), p, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToSameMode),
  21789. y.start(function(e, t) {
  21790. D.x = P.x + e * L.x,
  21791. D.y = P.y + e * L.y,
  21792. D.z = P.z + e * L.z;
  21793. var i = O + e * (M - O);
  21794. B.set(0, 0, i).applyEuler(D).add(this.cameraControls.controls[u.DOLLHOUSE].target),
  21795. this.cameraControls.cameras[u.DOLLHOUSE].position.copy(B).add(this.model.position)
  21796. }
  21797. .bind(this), p, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToSameMode),
  21798. y.start(function(e, t) {
  21799. this.cameraControls.controls[u.DOLLHOUSE].update(),
  21800. this.quaternion.copy(this.cameraControls.cameras[u.DOLLHOUSE].quaternion),
  21801. this.position.copy(this.cameraControls.cameras[u.DOLLHOUSE].position)
  21802. }
  21803. .bind(this), p, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToSameMode)
  21804. } else
  21805. F.warn("invalid warp destination in flyToSameMode()? ignore it then");
  21806. else if (this.path.placeCpm(),
  21807. this.path.fadeInCpm(f.path.fadeInTime),
  21808. i) {
  21809. this.model.warpDestFloors(i.floorVisibility);
  21810. var U = this.cameraControls.cameras[u.FLOORPLAN]
  21811. , k = this.cameraControls.controls[u.FLOORPLAN]
  21812. , H = k.target.clone()
  21813. , G = i.position.clone().sub(H)
  21814. , z = U.position.clone().sub(k.target)
  21815. , W = z.length()
  21816. , j = new r.Vector3(-1,0,0).applyQuaternion(i.quaternion).normalize()
  21817. , Y = Math.atan2(k.offset.x, k.offset.z)
  21818. , X = Math.atan2(j.x, j.z)
  21819. , Z = k.absoluteScale
  21820. , q = m.convertWorkshopOrthoZoom(i.orthoZoom);
  21821. y.start(function(e, t) {
  21822. k.target.copy(G).multiplyScalar(e).add(H);
  21823. var i = Y + (X - Y) * e;
  21824. k.offset.x = W * Math.sin(i),
  21825. k.offset.z = W * Math.cos(i),
  21826. U.position.copy(k.target).add(k.offset),
  21827. k.absoluteScale = Z + e * (q - Z),
  21828. k.update(),
  21829. this.quaternion.copy(U.quaternion),
  21830. this.position.copy(U.position),
  21831. this.target.copy(k.target),
  21832. this.camera.projectionMatrix.copy(U.projectionMatrix)
  21833. }
  21834. .bind(this), p, null, 0, A[f.flydown.movementEasing], null, V.FlyToSameMode)
  21835. } else
  21836. F.info("flyToSameMode() funny floorplan view? skipping");
  21837. return y.setTimeout(function(e) {
  21838. this.mode = e,
  21839. h(),
  21840. o.resolve(!0)
  21841. }
  21842. .bind(this, this.mode), p, V.FlyToSameMode),
  21843. this.mode = u.TRANSITIONING,
  21844. o.promise()
  21845. }
  21846. }
  21847. ,
  21848. n.prototype.flyToNewMode = function(e, t) {
  21849. e = e || {};
  21850. var i = e.mode
  21851. , n = e.pano
  21852. , o = e.duration
  21853. , a = e.warpDest
  21854. , s = e.callback
  21855. , l = e.force
  21856. , c = e.quaternion;
  21857. if (t = t || $.Deferred(),
  21858. this.isWarping())
  21859. return F.warn("Player.flyToNewMode() -> Cannot fly when warping"),
  21860. s && s(!1),
  21861. t.reject("Cannot change mode during tour transition").promise();
  21862. if (this.mode === u.TRANSITIONING)
  21863. return s && s(!1),
  21864. t.reject("Cannot change mode during mode transition").promise();
  21865. if (i === this.mode)
  21866. return l ? (this.flyToSameMode(n, o, a, s).done(t.resolve.bind(t)).fail(t.reject.bind(t)),
  21867. t.promise()) : (s && s(!1),
  21868. t.reject("Already in " + i + " mode").promise());
  21869. var h = a || !1;
  21870. F.debug("Switching mode to " + i);
  21871. var d = function() {
  21872. N.delayOneFrame(function() {
  21873. this.flyToNewMode(e, t)
  21874. }
  21875. .bind(this))
  21876. }
  21877. .bind(this);
  21878. if (n && this.checkAndWaitForPanoLoad(n, "low", "low", this.basePanoSize, d))
  21879. return t.promise();
  21880. if (!this.model.meshTexturesLoaded && this.isOutsideMode(i))
  21881. return F.info("Waiting for model textures to be loaded before going out to dollhouse"),
  21882. this.model.waitForLoad(this.model, function() {
  21883. return this.model.meshTexturesLoaded;
  21884. }
  21885. .bind(this)),
  21886. this.model.loadMeshTextures().done(d),
  21887. t.promise();
  21888. this.history.invalidate(),
  21889. this.updateLastView();
  21890. var p = this.mode
  21891. , C = this.cameraControls.cameras[i];
  21892. e = g.deepExtend({}, f[i], f[p + "-" + i]);
  21893. var I = void 0 !== o ? o : e.transitionTime;
  21894. this.emit(w.ModeChanging, p, i, n),
  21895. n && (this.currentPano = n),
  21896. this.switchCameraMode(i, c),
  21897. y.cancelById(V.LookTransition);
  21898. var _ = (new r.Vector3).copy(this.position);
  21899. if (i === u.PANORAMA)
  21900. this.emit(w.PanoChosen, n, n),
  21901. setTimeout(function() {
  21902. n.floor.enter(i)
  21903. }
  21904. .bind(this), I / 2),
  21905. this.path.fadeOutCpm(f.path.fadeOutTime);
  21906. else if (i === u.DOLLHOUSE) {
  21907. if (h && (this.model.stayPut = !0),
  21908. a ? (this.cameraControls.controls[u.DOLLHOUSE].resetRanges(1, !0),
  21909. this.model.warpDestFloors(a.floorVisibility)) : this.model.toggleAllFloors(!0),
  21910. this.path.placeCpm(),
  21911. this.path.fadeInCpm(f.path.fadeInTime),
  21912. h) {
  21913. var T = new r.Vector3(this.model.center.x,0,this.model.center.z);
  21914. _.set(15, 10, 15);
  21915. var M = new r.Vector3(0,0,-1).applyQuaternion(a.quaternion)
  21916. , R = new r.Raycaster(a.position.clone(),M.clone(),0,1 / 0)
  21917. , P = R.intersectObjects([this.sceneIntersectionPlane]);
  21918. P.length ? (T.copy(P[0].point),
  21919. _.copy(a.position),
  21920. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(.75 * _.distanceTo(T), !0)) : (F.warn("Tried to restore dollhouse mode that did not intersect...", a.position, a.quaternion),
  21921. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(3, !0)),
  21922. this.cameraControls.controls[u.DOLLHOUSE].target.copy(T),
  21923. _.add(this.model.position),
  21924. C.position.copy(_),
  21925. this.cameraControls.controls[u.DOLLHOUSE].update()
  21926. }
  21927. } else if (this.path.placeCpm(),
  21928. this.path.fadeInCpm(f.path.fadeInTime),
  21929. a) {
  21930. this.model.warpDestFloors(a.floorVisibility);
  21931. var O = this.cameraControls.cameras[u.FLOORPLAN]
  21932. , L = this.cameraControls.controls[u.FLOORPLAN]
  21933. , D = O.position.clone().sub(L.target)
  21934. , B = new r.Vector3(-1,0,0).applyQuaternion(a.quaternion).normalize()
  21935. , U = Math.atan2(B.x, B.z);
  21936. L.target.copy(a.position);
  21937. var k = D.length();
  21938. L.offset.x = k * Math.sin(U),
  21939. L.offset.y = 0,
  21940. L.offset.z = k * Math.cos(U),
  21941. O.position.copy(L.target).add(L.offset);
  21942. L.target.clone().sub(C.position);
  21943. C.quaternion.copy(a.quaternion),
  21944. L.currentScale = m.convertWorkshopOrthoZoom(a.orthoZoom),
  21945. L.absoluteScale = L.currentScale,
  21946. L.update()
  21947. } else
  21948. this.model.currentFloor.enter(i);
  21949. var H = this.currentPano
  21950. , G = this.position.clone();
  21951. return this.emit(w.FlyingStarted, _, G, n, this.currentPano),
  21952. this.flying = !0,
  21953. this.isOutsideMode(i) && this.is360View(p, H) ? (h || i !== u.DOLLHOUSE || (C.position.set(15, 10, 15),
  21954. C.controls.target.set(this.model.center.x, 0, this.model.center.z),
  21955. C.controls.update()),
  21956. e.blackoutStyle = S.FADEIN,
  21957. I = f.show360Views.transitionTime,
  21958. this.fade360View(I, C, e)) : this.isOutsideMode(p) && this.is360View(i, n) ? (h && this.switchCameraMode(i, h.quaternion),
  21959. this.mode = i,
  21960. this.path && this.path.popOutCpm(),
  21961. e.blackoutStyle = S.END,
  21962. I = f.show360Views.transitionTime,
  21963. this.fade360View(I, C, e)) : (y.start(v.property(this.model, "alpha", e.modelAlpha, null), I * e.modelAlphaLength, null, e.modelAlphaDelay, null, V.FlyToNewMode),
  21964. y.start(v.vector(this.position, C.position), I, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToNewMode),
  21965. y.start(v.quaternion(this.quaternion, C.quaternion), I * e.rotationDuration, null, e.rotationDelay, A[f.flydown.rotationEasing], null, V.FlyToNewMode),
  21966. y.start(v.matrix4(this.camera.projectionMatrix, C.projectionMatrix), I * e.cameraMatrixDuration, null, e.cameraMatrixDelay, e.cameraMatrixEase, null, V.FlyToNewMode),
  21967. y.start(v.uniform(this.model.skybox, "opacity", e.skyboxOpacity), I * e.skyboxOpacityLength, null, e.skyboxOpacityDelay, null, V.FlyToNewMode),
  21968. y.start(v.property(this.reticule.material.uniforms.opacity, "value", 0), I, null, V.FlyToNewMode)),
  21969. y.setTimeout(function() {
  21970. this.flying = !1,
  21971. p === u.PANORAMA && i !== u.PANORAMA ? this.currentPano.exit() : p !== u.PANORAMA && i === u.PANORAMA && (this.currentPano !== H && H.exit(),
  21972. this.currentPano.enter(),
  21973. this.path.placeCpm(),
  21974. this.path.fadeOutCpm(f.path.fadeOutTime),
  21975. this.spider.draw()),
  21976. p === u.DOLLHOUSE && this.cameraControls.controls[u.DOLLHOUSE].resetRanges(),
  21977. this.mode = i,
  21978. this.emit(w.FlyingEnded, _, G, this.currentPano, H),
  21979. h && p !== u.PANORAMA && i === u.PANORAMA ? this.startWarp(b.Retain, E.Retain, x.BLACK, null, null, s) : (s && s(),
  21980. t.resolve())
  21981. }
  21982. .bind(this), I, V.FlyToNewMode),
  21983. this.mode = u.TRANSITIONING,
  21984. t.promise()
  21985. }
  21986. ,
  21987. n.prototype.fade360View = function(e, t, i) {
  21988. this.tagManager.hideShowTagsForBlackoutStyle(i.blackoutStyle, e),
  21989. $(this.domElement).fadeOut(.5 * e, function() {
  21990. this.model.skybox.material.uniforms.opacity.value = i.skyboxOpacity,
  21991. this.model.alpha = i.modelAlpha,
  21992. this.position.copy(t.position),
  21993. this.quaternion.copy(t.quaternion),
  21994. this.camera.projectionMatrix.copy(t.projectionMatrix),
  21995. $(this.domElement).fadeIn(.5 * e)
  21996. }
  21997. .bind(this))
  21998. }
  21999. ,
  22000. n.prototype.findDefaultViews = function() {
  22001. this.findDefaultView(this.lastInsideView, !0),
  22002. this.findDefaultView(this.last360View, !1)
  22003. }
  22004. ,
  22005. n.prototype.findDefaultView = function(e, t) {
  22006. var i, n = this.model.heroLocations, r = this.model.panos, o = n.findIndex(function(e) {
  22007. if (e.cameraMode !== u.PANORAMA)
  22008. return !1;
  22009. var i = r.get(e.panoId);
  22010. return i && i.isAligned() === t
  22011. });
  22012. o >= 0 ? (i = r.get(n[o].panoId),
  22013. e.update({
  22014. cameraMode: u.PANORAMA,
  22015. pano: i,
  22016. position: n[o].position,
  22017. quaternion: n[o].quaternion
  22018. })) : (o = r.list.findIndex(function(e) {
  22019. return e.isAligned() === t
  22020. }),
  22021. o >= 0 ? (i = r.list[o],
  22022. e.update({
  22023. cameraMode: u.PANORAMA,
  22024. pano: i,
  22025. position: i.position
  22026. })) : F.warn("There are no", t ? "inside" : "360º", "views in this model"))
  22027. }
  22028. ,
  22029. n.prototype.updateLastView = function() {
  22030. if (this.mode === u.PANORAMA) {
  22031. var e = this.currentPano.isAligned() ? this.lastInsideView : this.last360View;
  22032. e.update({
  22033. pano: this.currentPano,
  22034. position: this.position,
  22035. quaternion: this.quaternion
  22036. })
  22037. }
  22038. }
  22039. ,
  22040. n.prototype.goToLastView = function(e, t) {
  22041. var i = $.Deferred()
  22042. , n = i.resolve.bind(i)
  22043. , r = i.reject.bind(i)
  22044. , o = e ? this.lastInsideView : this.last360View;
  22045. return this.isInMode(u.PANORAMA) && this.currentPano.isAligned() !== e && this.updateLastView(),
  22046. this.isInMode(u.PANORAMA) ? (this.path && this.path.popOutCpm(),
  22047. this.fadeToView(e, o, f.show360Views.transitionTime, t).done(n).fail(r)) : this.isOutsideMode() && this.flyToNewMode({
  22048. mode: o.cameraMode,
  22049. pano: o.pano,
  22050. quaternion: o.quaternion,
  22051. callback: t
  22052. }).done(n).fail(r),
  22053. i.promise()
  22054. }
  22055. ,
  22056. n.prototype.fadeToView = function(e, t, i, n) {
  22057. var r = $.Deferred()
  22058. , o = r.resolve.bind(r)
  22059. , a = r.reject.bind(r);
  22060. if (!t.isValid() || t.cameraMode === u.PANORAMA && !t.pano)
  22061. return F.warn("Tried to fade to an illegal view", t.cameraMode),
  22062. a("Cannot go to illegal view"),
  22063. r.promise();
  22064. var s = (f[t.cameraMode],
  22065. function() {
  22066. $(this.domElement).fadeIn(.5 * i),
  22067. n && n(),
  22068. o()
  22069. }
  22070. .bind(this))
  22071. , l = e ? S.FADEIN : S.END;
  22072. return this.tagManager.hideShowTagsForBlackoutStyle(l, i),
  22073. $(this.domElement).fadeOut(.5 * i, function() {
  22074. this.model.fadePanoMarkers(e ? f.panorama.markerOpacity : 0),
  22075. t.cameraMode === u.PANORAMA ? this.flyToPano({
  22076. pano: t.pano,
  22077. lookAtPoint: d.FORWARD.clone().applyQuaternion(t.quaternion).add(t.pano.position),
  22078. duration: 0
  22079. }, s) : this.flyToNewMode({
  22080. mode: t.cameraMode,
  22081. quaternion: t.quaternion,
  22082. duration: 0,
  22083. callback: s
  22084. })
  22085. }
  22086. .bind(this)),
  22087. r.promise()
  22088. }
  22089. ,
  22090. n.prototype.startWarp = function(e, t, i, n, r, o) {
  22091. if (this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !1),
  22092. this.flying)
  22093. return F.warn("Player.startWarp() -> Cannot warp when flying"),
  22094. o && o(),
  22095. !1;
  22096. null !== e && void 0 !== e || (e = b.Show),
  22097. this.history.invalidate(),
  22098. e !== b.Retain ? this.path.brushToWarpPano(i, x.BLACK) || (i = x.BLACK) : i = this.path.upcomingTransType;
  22099. var a = this.path.warpDestPano && !this.path.warpDestPano.isAligned();
  22100. return this.emit(w.WarpStarted, a, i, n, r),
  22101. n = n || S.MIDDLE,
  22102. this.path.warpToPano(i, n, r, function() {
  22103. t === E.Slow ? this.path.discardSlow() : t === E.Standard && this.path.discardPathObject(),
  22104. this.emit(w.WarpEnded, i),
  22105. this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !0),
  22106. o && o()
  22107. }
  22108. .bind(this)),
  22109. e === b.Hide && this.path.discardPathObject(),
  22110. !0
  22111. }
  22112. ,
  22113. n.prototype.warpToPanoById = function(e, t, i, n, r, o, a, s) {
  22114. return this.path.setWarpDestinationByPanoId(e, t) ? this.startWarp(i, n, r, o, a, s) : (F.warn("Player.warpToPanoById() -> Could not setWarpDestinationByPanoId()"),
  22115. s && s(),
  22116. !1)
  22117. }
  22118. ,
  22119. n.prototype.warpToPanoByHeroIndex = function(e, t, i, n, r, o, a) {
  22120. return this.path.setWarpDestinationByHeroIndex(e) ? this.startWarp(t, i, n, r, o, a) : (F.warn("Player.warpToPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  22121. a && a(),
  22122. !1)
  22123. }
  22124. ,
  22125. n.prototype.warpToPano = function(e, t, i, n, r, o, a, s) {
  22126. return this.warpToPanoById(e.id, t, i, n, r, o, a, s)
  22127. }
  22128. ,
  22129. n.prototype.warpToNonPanoByHeroIndex = function(e, t) {
  22130. return this.path.setWarpDestinationByHeroIndex(e) ? (this.path.warpToNonPano(t),
  22131. !0) : (F.warn("Player.warpToNonPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  22132. t && t(),
  22133. !1)
  22134. }
  22135. ,
  22136. n.prototype.aimTourCamera = function(e, t, i, n) {
  22137. return F.debug("player.aimTourCamera(" + e + ") calling warpToPanoByHeroIndex(" + e + ")"),
  22138. this.warpToPanoByHeroIndex(e, t, i, null, null, null, n)
  22139. }
  22140. ,
  22141. n.prototype.showPathToHeroLocation = function(e) {
  22142. this.path.setWarpDestinationByHeroIndex(e) && this.path.brushToWarpPano(x.STD, x.BLACK)
  22143. }
  22144. ,
  22145. n.prototype.tourInterlude = function(e, t) {
  22146. this.history.invalidate();
  22147. this.path.discardSlow();
  22148. //xzw:
  22149. var a = g_data2.tourAudio && g_data2.tourAudio[this.model.heroLocations[this.director.currentItem].sid];
  22150. var rotTime = a && a.time;
  22151. this.path.waitNextStep(e, function() {
  22152. t && t()
  22153. }.bind(this), rotTime)
  22154. }
  22155. ,
  22156. n.prototype.stopInterlude = function() {
  22157. this.interruptAndFastForward(null, 0)
  22158. }
  22159. ,
  22160. n.prototype.interruptAndFastForward = function(e, t) {
  22161. this.isWarping() && this.emit(w.WarpInterrupted, this.path.activeTransType, e, t),
  22162. this.flying && this.emit(w.FlyingInterrupted),
  22163. this.path.interruptAndFastForward(e, t)
  22164. }
  22165. ,
  22166. n.prototype.setSize = function(e, t) {
  22167. var i = e / t;
  22168. this.baseFov = B.clampVFOV(f.insideFOV, f.insideFOVMax, e, t);
  22169. var n = B.getHFOVFromVFOV(f.insideFOV, e, t);
  22170. n > f.insideFOVMax ? this.baseFov = B.getVFOVFromHFOV(f.insideFOVMax, e, t) : this.baseFov = f.insideFOV;
  22171. for (var r in this.cameraControls.cameras) {
  22172. var o = this.cameraControls.cameras[r];
  22173. o.fov = this.baseFov * (1 / this.zoomLevel),
  22174. o.updateAspect(i)
  22175. }
  22176. }
  22177. ,
  22178. n.prototype.toJSON = function() {
  22179. var e = {};
  22180. return this.cameraControls.activeControl ? (e = this.cameraControls.activeControl.toJSON(),
  22181. e.camera_mode = u.toInt(this.mode),
  22182. this.isOutsideMode() ? this.model.allFloorsVisible ? e.floor_visibility = [] : e.floor_visibility = this.model.floors.list.map(function(e) {
  22183. return e.hidden ? 0 : 1
  22184. }) : u.PANORAMA && (e.scan_id = this.currentPano.id),
  22185. e) : e
  22186. }
  22187. ,
  22188. n.prototype.getCurrentNodePanos = function(e) {
  22189. this.model.panos.map;
  22190. if (e.length = 0,
  22191. this.path.nodes)
  22192. for (var t = 0; t < this.path.nodes.length; t++) {
  22193. var i = this.path.nodes[t];
  22194. e.push(this.model.panos.get(i))
  22195. }
  22196. }
  22197. ,
  22198. n.prototype.zoomIncrementally = function(e) {
  22199. var t = this.zoomLevel;
  22200. this.zoomTo(this.zoomLevel + e),
  22201. t !== this.zoomLevel && this.currentPano && this.zoomStats.addZoomAction(t, this.zoomLevel, this.currentPano.id)
  22202. }
  22203. ,
  22204. n.prototype.zoomInIncrementally = function(e) {
  22205. e = e || this.defaultZoomIncrement,
  22206. this.zoomIncrementally(e)
  22207. }
  22208. ,
  22209. n.prototype.zoomOutIncrementally = function(e) {
  22210. e = e || -this.defaultZoomIncrement,
  22211. this.zoomIncrementally(e)
  22212. }
  22213. ,
  22214. n.prototype.zoomBy = function(e) {
  22215. this.zoomTo(this.zoomLevel * e)
  22216. }
  22217. ,
  22218. n.prototype.zoomIn = function() {
  22219. this.zoomBy(1 + this.zoomSpeed)
  22220. }
  22221. ,
  22222. n.prototype.zoomOut = function() {
  22223. this.zoomBy(1 - this.zoomSpeed)
  22224. }
  22225. ,
  22226. n.prototype.zoomTo = function(e, t) {
  22227. if (t || f.zoom.enabled && this.mode === u.PANORAMA && this.zoomEnabled) {
  22228. if (e < f.zoom.min && (e = f.zoom.min),
  22229. e > f.zoom.max && (e = f.zoom.max),
  22230. e > this.zoomLevel ? (this.emit(O.ZoomIn),
  22231. e === f.zoom.max && this.emit(O.ZoomMax)) : e < this.zoomLevel && (this.emit(O.ZoomOut),
  22232. e === f.zoom.min && this.emit(O.ZoomMin)),
  22233. this.cameraControls.activeControl) {
  22234. var i = this.cameraControls.activeControl.camera;
  22235. this.zoomLevel = e,
  22236. i.fov = this.baseFov * (1 / this.zoomLevel),
  22237. i.updateProjectionMatrix(),
  22238. this.zoomFov = i.fov
  22239. }
  22240. }
  22241. }
  22242. ,
  22243. n.prototype.increaseZoomSpeed = function() {
  22244. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed + this.zoomSpeedAdjust)
  22245. }
  22246. ,
  22247. n.prototype.decreaseZoomSpeed = function() {
  22248. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed - this.zoomSpeedAdjust)
  22249. }
  22250. ,
  22251. n.prototype.clampZoomSpeed = function(e) {
  22252. return e < 0 ? 0 : e
  22253. }
  22254. ,
  22255. n.prototype.activatePersistentZooming = function(e) {
  22256. this.zooming = e ? 1 : -1
  22257. }
  22258. ,
  22259. n.prototype.deactivatePersistentZooming = function() {
  22260. this.zooming = 0
  22261. }
  22262. ,
  22263. n.prototype.zoomDefault = function() {
  22264. this.zoomTo(1, !0)
  22265. }
  22266. ,
  22267. n.prototype.smoothZoomToDefault = function(e, t) {
  22268. var i, n = this.zoomLevel, r = function(e) {
  22269. e > 1 && (e = 1),
  22270. i = n * (1 - e) + e,
  22271. this.zoomTo(i, !0)
  22272. }
  22273. .bind(this), o = function() {
  22274. this.zoomDefault(),
  22275. t && window.setTimeout(t, 50)
  22276. }
  22277. .bind(this);
  22278. y.start(r, e, o, null, 0, A[f.transition.blendEasing])
  22279. }
  22280. ,
  22281. n.prototype.updateZoomPano = function() {
  22282. if (!this.panoRenderer.zoomPanoRenderingDisabled && this.mode === u.PANORAMA) {
  22283. var e = this.currentPano;
  22284. if (e) {
  22285. var t = this.zoomLevel > f.zoom.activationThreshold
  22286. , i = this.flying && this.nextPano && this.nextPano !== this.currentPano
  22287. , n = !i && !this.isWarping()
  22288. , r = t && n;
  22289. this.tileDownloader.tilePrioritizer.setZoomingActive(r),
  22290. this.panoRenderer.setZoomingActive(r, e, !0);
  22291. var o = function(e, t) {
  22292. this.panoRenderer.resetRenderStatus(e.id, !1, !0, this.qualityManager.getMaxNavPanoSize()),
  22293. this.panoRenderer.clearAllQueuedUploadsForPano(e.id),
  22294. this.panoRenderer.renderPanoTiles(e.id, null, !1, !1),
  22295. e.setZoomed(t)
  22296. }
  22297. .bind(this);
  22298. r && !e.zoomed ? (o(e, !0),
  22299. this.panoRenderer.enableUltraHighQualityMode(function() {
  22300. this.qualityManager.useUltraHighResolutionPanos && !f.zoom.overridemax && (f.zoom.max = D.ultraHighQualityMaxZoom),
  22301. r && o(e, !0)
  22302. }
  22303. .bind(this))) : !t && e.zoomed && o(e, !1)
  22304. }
  22305. }
  22306. }
  22307. ,
  22308. t.exports = n
  22309. }
  22310. ).call(this, "/js/player.js")
  22311. }
  22312. , {
  22313. "./constants": 8,
  22314. "./enum/AlignmentType": 17,
  22315. "./enum/BlackoutStyle": 18,
  22316. "./enum/ControlEvents": 21,
  22317. "./enum/Keys": 30,
  22318. "./enum/ModelManagerEvents": 33,
  22319. "./enum/PanoSizeClass": 36,
  22320. "./enum/PanoramaEvents": 37,
  22321. "./enum/PathDiscardMode": 38,
  22322. "./enum/PathDisplayMode": 39,
  22323. "./enum/PlayerEvents": 40,
  22324. "./enum/TagStates": 44,
  22325. "./enum/Vectors": 50,
  22326. "./enum/Viewmode": 51,
  22327. "./enum/WarpStyle": 52,
  22328. "./enum/ZoomEvents": 53,
  22329. "./exception/BasicException": 55,
  22330. "./model/ModelManager": 140,
  22331. "./objects/NSpider": 147,
  22332. "./objects/Panorama": 148,
  22333. "./objects/Reticule": 149,
  22334. "./objects/ShowPath": 151,
  22335. "./objects/Snapshot": 153,
  22336. "./objects/View": 154,
  22337. "./settings": 166,
  22338. "./shaders": 167,
  22339. "./tile/TileDownloader": 171,
  22340. "./tile/TilePrioritizer": 172,
  22341. "./util/ZoomStats": 179,
  22342. "./util/browser": 182,
  22343. "./util/camera": 183,
  22344. "./util/cameraLight": 184,
  22345. "./util/common": 185,
  22346. "./util/easing": 186,
  22347. "./util/history": 187,
  22348. "./util/lerp": 188,
  22349. "./util/logger": 189,
  22350. "./util/math": 190,
  22351. "./util/transitions": 195,
  22352. "hot":"hot",
  22353. "scaleImg":"scaleImg",
  22354. events: 202,
  22355. three: 217
  22356. }],
  22357. "scaleImg":[function(t, e){// xzw
  22358. var OUTPUT = e;
  22359. (function(){function t(t,a,i,r){function h(){B="object"==typeof i?i:a.src||r?u:document.createElement("canvas"),B.width=s,B.height=f,G=B.getContext("2d")}
  22360. function n(t){if(t){var e,a=G.getImageData(0,0,s,f),i=a.data;for(e=0;at>e;e+=4)
  22361. i[e]=t[e]*it|0,i[e+1]=t[e+1]*it|0,i[e+2]=t[e+2]*it|0,i[e+3]=t[e+3]*it|0;return delete t,a}
  22362. return G.getImageData(0,0,s,f)}
  22363. function o(t,e,a,i,r){return.5*(i-e+(2*e-5*a+4*i-r+(3*(a-i)+r-e)*t)*t)*t+a}
  22364. a||(a=t.input,i=t.output,r=t.inputRemovable,t.scale&&(t=t.scale));var u,d;if(a.src)
  22365. if(u=document.createElement("canvas"),null!=a.naturalWidth)
  22366. u.width=a.naturalWidth,u.height=a.naturalHeight;else if(null!=a.runtimeStyle){var l=a.runtimeStyle,c=l.width,g=l.height;l.width="auto",l.height="auto",u.width=a.width,u.height=a.height,l.width=c,l.height=g}else{var c=a.width,g=a.height;a.removeAttribute&&(a.removeAttribute("width"),a.removeAttribute("height")),u.width=a.width,u.height=a.height,a.width=c,a.height=g}
  22367. else
  22368. u=a;d=u.getContext("2d"),a.src&&d.drawImage(a,0,0);var s,f,m=u.width,w=u.height,p=d.getImageData(0,0,m,w).data;if(!m||!w)
  22369. return!1;(a.src||r)&&u.clearRect(0,0,m,w),"object"==typeof t?t.width?(s=t.width+.5|0,f=t.height+.5|0):(s=m*t.scaleX+.5|0,f=w*t.scaleY+.5|0):(s=t*m+.5|0,f=t*w+.5|0);var v,b,y,x,D,I,A,j,R,k,C,E,F,L,S,U,W,H,alpha,X,Y,q,z,B,G,J,K,M,N,O,P,Q,T,V,Z,$=s<<2,_=m<<2,tt=0,et=0,at=$*f,it=255.99/255,rt=s/m,ht=f/w,nt=rt*ht;if(rt>1||ht>1)
  22370. for(h(),J=n(),K=J.data,x=0;f>x;x++)
  22371. for(b=x/ht,R=0|b,q=b-R,N=R*_,M=1>R?N:N-_,w-2>R?(O=N+_,P=(R+2)*_):O=P=R>w-2?N:N+_,y=0;s>y;y++,et+=4)
  22372. v=y/rt,j=0|v,z=v-j,T=j<<2,Q=1>j?T:T-4,m-2>j?(V=T+4,Z=T+8):V=Z=j>m-2?T:T+4,H=o(q,o(z,p[M+Q],p[M+T],p[M+V],p[M+Z]),o(z,p[N+Q],p[N+T],p[N+V],p[N+Z]),o(z,p[O+Q],p[O+T],p[O+V],p[O+Z]),o(z,p[P+Q],p[P+T],p[P+V],p[P+Z]))*it|0,++Q,++T,++V,++Z,X=o(q,o(z,p[M+Q],p[M+T],p[M+V],p[M+Z]),o(z,p[N+Q],p[N+T],p[N+V],p[N+Z]),o(z,p[O+Q],p[O+T],p[O+V],p[O+Z]),o(z,p[P+Q],p[P+T],p[P+V],p[P+Z]))*it|0,++Q,++T,++V,++Z,Y=o(q,o(z,p[M+Q],p[M+T],p[M+V],p[M+Z]),o(z,p[N+Q],p[N+T],p[N+V],p[N+Z]),o(z,p[O+Q],p[O+T],p[O+V],p[O+Z]),o(z,p[P+Q],p[P+T],p[P+V],p[P+Z]))*it|0,++Q,++T,++V,++Z,alpha=o(q,o(z,p[M+Q],p[M+T],p[M+V],p[M+Z]),o(z,p[N+Q],p[N+T],p[N+V],p[N+Z]),o(z,p[O+Q],p[O+T],p[O+V],p[O+Z]),o(z,p[P+Q],p[P+T],p[P+V],p[P+Z]))*it|0,K[et]=H>=0?256>H?H:255:0,K[et+1]=X>=0?256>X?X:255:0,K[et+2]=Y>=0?256>Y?Y:255:0,K[et+3]=alpha>=0?256>alpha?alpha:255:0;else{if(e.Float32Array)
  22373. W=new Float32Array(at);else
  22374. for(W=[],et=0;at>et;++et)
  22375. W[et]=0;for(b=0;w>b;b++)
  22376. for(x=b*ht,A=0|x,D=A*$,U=!!((A-(x+ht|0))*(w-1-b))<<1,U&&(F=A+1-x,L=x+ht-A-1),v=0;m>v;v++,tt+=4)
  22377. switch(y=v*rt,I=0|y,et=D+(I<<2),S=!!((I-(y+rt|0))*(m-1-v)),S&&(C=I+1-y,E=y+rt-I-1),H=p[tt],X=p[tt+1],Y=p[tt+2],alpha=p[tt+3],S+U){case 0:W[et]+=H*nt,W[et+1]+=X*nt,W[et+2]+=Y*nt,W[et+3]+=alpha*nt;break;case 1:k=C*ht,W[et]+=H*k,W[et+1]+=X*k,W[et+2]+=Y*k,W[et+3]+=alpha*k,k=E*ht,W[et+4]+=H*k,W[et+5]+=X*k,W[et+6]+=Y*k,W[et+7]+=alpha*k;break;case 2:k=rt*F,W[et]+=H*k,W[et+1]+=X*k,W[et+2]+=Y*k,W[et+3]+=alpha*k,k=rt*L,et+=$,W[et]+=H*k,W[et+1]+=X*k,W[et+2]+=Y*k,W[et+3]+=alpha*k;break;default:k=C*F,W[et]+=H*k,W[et+1]+=X*k,W[et+2]+=Y*k,W[et+3]+=alpha*k,k=E*F,W[et+4]+=H*k,W[et+5]+=X*k,W[et+6]+=Y*k,W[et+7]+=alpha*k,k=C*L,et+=$,W[et]+=H*k,W[et+1]+=X*k,W[et+2]+=Y*k,W[et+3]+=alpha*k,k=E*L,W[et+4]+=H*k,W[et+5]+=X*k,W[et+6]+=Y*k,W[et+7]+=alpha*k;}
  22378. delete p,h(),J=n(W)}
  22379. if(G.putImageData(J,0,0),"string"==typeof i){if("png"===i||"jpeg"===i){var ot;return ot=r&&a.src?a:new Image,ot.width=s,ot.height=f,ot.src=B.toDataURL("image/"+i,0.85),ot}
  22380. if("png-src"===i||"jpeg-src"===i)
  22381. return B.toDataURL("image/"+i.split("-")[0],0.85)}
  22382. return B}
  22383. var e=this;"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=t),exports.scale=t):c=t}).call(this);
  22384. OUTPUT.exports = c;
  22385. }, {}
  22386. ],
  22387. 156: [function(e, t, i) {
  22388. (function(i) {
  22389. "use strict";
  22390. function n(e, t) {
  22391. this.model = e,
  22392. this.panos = e.panos,
  22393. this.player = t,
  22394. this.imagePanos = this.listImagePanos(),
  22395. this.retryMinimumTime = 1e4
  22396. }
  22397. var r = (e("three"),
  22398. e("./enum/Viewmode"))
  22399. , o = (e("./settings"),
  22400. e("./objects/Panorama"))
  22401. , a = e("./util/logger")
  22402. , s = new a(i);
  22403. n.prototype.start = function() {
  22404. this.loadNextPano(function(e) {
  22405. e ? this.start() : (s.debug("No suitable pano loaded, waiting a little while before looking again"),
  22406. setTimeout(function() {
  22407. this.start()
  22408. }
  22409. .bind(this), 1e3))
  22410. }
  22411. .bind(this))
  22412. }
  22413. ,
  22414. n.prototype.validLoadTarget = function(e) {
  22415. return e && !e.isLoaded("high") && Date.now() - e.failedLoadingAt > this.retryMinimumTime
  22416. }
  22417. ,
  22418. n.prototype.listImagePanos = function() {
  22419. var e = []
  22420. , t = this;
  22421. return this.model.images.forEach(function(i) {
  22422. if (i.metadata && i.metadata.scan_id) {
  22423. var n = t.model.panos.get(i.metadata.scan_id);
  22424. n && !n.isLoaded("high") && e.push(n)
  22425. }
  22426. }),
  22427. e
  22428. }
  22429. ,
  22430. n.prototype.nextNotLoadedImage = function() {
  22431. for (; this.imagePanos.length > 0; ) {
  22432. var e = this.imagePanos[0];
  22433. if (!e.isLoaded("high"))
  22434. return e;
  22435. this.imagePanos.shift()
  22436. }
  22437. return null
  22438. }
  22439. ,
  22440. n.prototype.loadNextPano = function(e) {
  22441. var t, i, n = this.model.waitQueue.filter(function(e) {
  22442. return e.object instanceof o
  22443. });
  22444. n.length > 0 ? (t = n[0].object,
  22445. s.debug("Overrode pano selection: Flying to an unloaded pano " + t.id)) : this.validLoadTarget(this.player.currentPano) ? (t = this.player.currentPano,
  22446. s.debug("Overrode pano selection: Currently at an unloaded pano " + t.id)) : this.validLoadTarget(this.player.closestPano) ? (t = this.player.closestPano,
  22447. s.debug("Overrode pano selection: Hovering over an unloaded pano " + t.id)) : this.validLoadTarget(this.nextNotLoadedImage()) ? (i = "high",
  22448. t = this.imagePanos[0],
  22449. s.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())]),
  22450. t && s.debug("Normal pano selection: neighbor " + t.id)),
  22451. t ? (i = i || t.isLoaded("low") ? "high" : "low",
  22452. s.debug("Preloading " + i + "-res pano " + t.id),
  22453. t.loadCube(i).done(e).fail(function() {
  22454. s.warn("Failed preloading pano", t.id, ", marking it as failed and forgetting it for a while"),
  22455. e()
  22456. })) : e && e(null)
  22457. }
  22458. ,
  22459. t.exports = n
  22460. }
  22461. ).call(this, "/js/preloaders.js")
  22462. }
  22463. , {
  22464. "./enum/Viewmode": 51,
  22465. "./objects/Panorama": 148,
  22466. "./settings": 166,
  22467. "./util/logger": 189,
  22468. three: 217
  22469. }],
  22470. 157: [function(e, t, i) {
  22471. (function(i) {
  22472. "use strict";
  22473. function n(e, t, i, n, r) {
  22474. this.qualityManager = e,
  22475. this.scene = t,
  22476. this.camera = i,
  22477. this.container = r,
  22478. this.controls = n,
  22479. this.controls.enabled = !0,
  22480. this.controls.locked = !0,
  22481. this.quickstartCamera = n.camera,
  22482. this.quickstartCamera.fov = h.clampVFOV(a.insideFOV, a.insideFOVMax, $("#player").width(), $("#player").height()),
  22483. this.skybox = null
  22484. }
  22485. var r = e("three")
  22486. , o = e("../util/logger")
  22487. , a = e("../constants")
  22488. , s = (e("../util/transitions"),
  22489. e("../util/lerp"),
  22490. e("../util/easing"),
  22491. e("../enum/Vectors"))
  22492. , l = e("../enum/PanoSizeClass")
  22493. , c = (e("../materials/ModelTextureMaterial"),
  22494. e("../materials/CubemapMaterial"))
  22495. , h = (e("../cameras/PanoramaCamera"),
  22496. e("../controls/PanoramaControls"),
  22497. e("../tile/TileUtils"),
  22498. e("../util/camera"),
  22499. e("../util/cameraLight"))
  22500. , u = (e("../util/browser"),
  22501. e("../settings"),
  22502. e("../gui/helpManager"),
  22503. new o(i));
  22504. n.prototype.load = function(e) {
  22505. e.pano.shouldRedrawOnBaseLoaded = !0;
  22506. var t, i, n = this, r = s.FORWARD.clone().applyQuaternion(e.quaternion), o = r.clone().negate();
  22507. this.controls.lookAt(r.add(this.quickstartCamera.position));
  22508. var a = this.qualityManager.getPanoSize(l.BASE)
  22509. , c = this.qualityManager.getPanoSize(l.STANDARD);
  22510. if (e.pano.tiled) {
  22511. u.warn("Loading startPano, TILED", e.pano.id);
  22512. var d = h.getHFOVForCamera(this.quickstartCamera, $("#player").width(), $("#player").height())
  22513. , p = this.quickstartCamera.fov;
  22514. u.warn("Quickstart loading tiles in frustum: [horizontal FOV: " + d + ", vertical FOV: " + p + "]"),
  22515. t = e.pano.loadTiledPano(c, r, {
  22516. hFov: d,
  22517. vFov: p
  22518. }, !1, !1, !0),
  22519. i = e.pano.loadTiledPano(a, o, null, !1, !1, !0)
  22520. } else
  22521. u.warn("Loading startPano", e.pano.id),
  22522. t = e.pano.loadCube("high");
  22523. return $.when(t).then(function() {
  22524. n.init(e.pano, e.quaternion),
  22525. e.pano.tiled ? i.done(function() {
  22526. e.pano.lockUntilRenderingComplete = !1,
  22527. this.controls.locked = !1
  22528. }
  22529. .bind(this)) : this.controls.locked = !1
  22530. }
  22531. .bind(this))
  22532. }
  22533. ,
  22534. n.prototype.init = function(e, t) {
  22535. u.info("Quickstart done loading, adding scene objects"),
  22536. e.lockUntilRenderingComplete = !0,
  22537. this.skybox = new r.Mesh(new r.CubeGeometry(1,1,1),new c({
  22538. side: r.BackSide
  22539. })),
  22540. this.skybox.material.uniforms.map.value = e.getSkyboxTexture(),
  22541. this.skybox.quaternion.copy(e.quaternion),
  22542. this.scene.add(this.skybox),
  22543. $(this.container).show()
  22544. }
  22545. ,
  22546. n.prototype.update = function(e) {
  22547. this.controls.update(e),
  22548. this.camera.copy(this.quickstartCamera)
  22549. }
  22550. ,
  22551. n.prototype.setSize = function(e, t) {
  22552. this.quickstartCamera.updateAspect(e / t)
  22553. }
  22554. ,
  22555. n.prototype.destroy = function() {
  22556. this.scene.remove(this.skybox)
  22557. }
  22558. ,
  22559. t.exports = n
  22560. }
  22561. ).call(this, "/js/scene/QuickstartManager.js")
  22562. }
  22563. , {
  22564. "../cameras/PanoramaCamera": 7,
  22565. "../constants": 8,
  22566. "../controls/PanoramaControls": 13,
  22567. "../enum/PanoSizeClass": 36,
  22568. "../enum/Vectors": 50,
  22569. "../gui/helpManager": 68,
  22570. "../materials/CubemapMaterial": 117,
  22571. "../materials/ModelTextureMaterial": 118,
  22572. "../settings": 166,
  22573. "../tile/TileUtils": 174,
  22574. "../util/browser": 182,
  22575. "../util/camera": 183,
  22576. "../util/cameraLight": 184,
  22577. "../util/easing": 186,
  22578. "../util/lerp": 188,
  22579. "../util/logger": 189,
  22580. "../util/transitions": 195,
  22581. three: 217
  22582. }],
  22583. 158: [function(e, t, i) {
  22584. "use strict";
  22585. function n(e, t, i) {
  22586. this.scene = e,
  22587. this.camera = t,
  22588. this.renderer = null,
  22589. this.effects = i,
  22590. this.animateCallback = null,
  22591. this.composer = null,
  22592. this.qualityManager = null,
  22593. e.renderWidth = 0,
  22594. e.renderHeight = 0,
  22595. this.updateClock = new r.Clock,
  22596. this.components = [],
  22597. this.updateListeners = [],
  22598. this.resizeListeners = [],
  22599. this.forceUpdateSize = !1,
  22600. this.started = !1,
  22601. this.textures = {},
  22602. this.suspendedObjects = []
  22603. }
  22604. var r = e("three")
  22605. , o = e("../shaders")
  22606. , a = e("../enum/SceneRendererEvents")
  22607. , s = e("../enum/GLTextureType")
  22608. , l = e("../enum/GLCubeFaces")
  22609. , c = e("../exception/BasicException")
  22610. , h = e("../exception/RendererCreationException")
  22611. , u = e("../settings")
  22612. , d = e("events").EventEmitter;
  22613. window.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame,
  22614. n.prototype = Object.create(d.prototype),
  22615. n.prototype.addComponent = function(e) {
  22616. this.components.push(e),
  22617. e.update && this.updateListeners.push(e),
  22618. e.setSize && (this.resizeListeners.push(e),
  22619. this.forceUpdateSize = !0)
  22620. }
  22621. ,
  22622. n.prototype.removeComponent = function(e) {
  22623. var t = function(t) {
  22624. return t !== e
  22625. };
  22626. this.components = this.components.filter(t),
  22627. this.updateListeners = this.updateListeners.filter(t),
  22628. this.resizeListeners = this.resizeListeners.filter(t)
  22629. }
  22630. ,
  22631. n.prototype.start = function(e) {
  22632. if (this.started)
  22633. throw new c("Can't start SceneRenderer, already started");
  22634. this.createContext(e),
  22635. this.initComposer(),
  22636. this.started = !0,
  22637. (p = p.bind(this))()
  22638. }
  22639. ,
  22640. n.prototype.createContext = function(e) {
  22641. try {
  22642. this.renderer = new r.WebGLRenderer,
  22643. this.renderer.autoClear = !0,
  22644. this.renderer.setPixelRatio(window.devicePixelRatio ? window.devicePixelRatio : 1),
  22645. this.renderer.setSize($("#player").width(), $("#player").height(), false), //改
  22646. this.emit(a.ContextCreated)
  22647. } catch (e) {
  22648. throw new h("Unable to create a WebGL rendering context")
  22649. }
  22650. u.profiling.enabled && this.overrideTextures(),
  22651. e.appendChild(this.renderer.domElement)
  22652. }
  22653. ,
  22654. n.prototype.overrideTextures = function() {
  22655. var e = this.renderer.context
  22656. , t = 0
  22657. , i = e.createTexture;
  22658. e.createTexture = function() {
  22659. var n = i.call(e);
  22660. return n.id = t++,
  22661. this.textures[n.id] = n,
  22662. n
  22663. }
  22664. .bind(this);
  22665. var n = e.texImage2D;
  22666. e.texImage2D = function(t, i, r, o, a, l, c, h, u) {
  22667. var d, p = this.getTextureTypeFromTarget(e, t);
  22668. d = p === s.TextureCube ? e.getParameter(e.TEXTURE_BINDING_CUBE_MAP) : e.getParameter(e.TEXTURE_BINDING_2D),
  22669. void 0 !== c ? n.call(e, t, i, r, o, a, l, c, h, u) : (c = o,
  22670. h = a,
  22671. u = l,
  22672. o = u.naturalWidth,
  22673. a = u.naturalHeight,
  22674. n.call(e, t, i, r, c, h, u));
  22675. var f = this.textures[d.id];
  22676. f.width = p === s.TextureCube ? 6 * o : o,
  22677. f.height = a
  22678. }
  22679. .bind(this);
  22680. var r = e.deleteTexture;
  22681. e.deleteTexture = function(t) {
  22682. delete this.textures[t.id],
  22683. r.call(e, t)
  22684. }
  22685. .bind(this)
  22686. }
  22687. ,
  22688. n.prototype.updateTextureMemory = function() {
  22689. var e = null;
  22690. return function() {
  22691. var t = 0;
  22692. for (var i in this.textures) {
  22693. var n = this.textures[i];
  22694. n.width && n.height && (t += n.width * n.height * 4)
  22695. }
  22696. t !== e && this.emit(a.MemoryUsageUpdated, t),
  22697. e = t
  22698. }
  22699. }(),
  22700. n.prototype.getTextureTypeFromTarget = function(e, t) {
  22701. switch (t) {
  22702. case e.TEXTURE_CUBE_MAP_POSITIVE_X:
  22703. case e.TEXTURE_CUBE_MAP_NEGATIVE_X:
  22704. case e.TEXTURE_CUBE_MAP_POSITIVE_Y:
  22705. case e.TEXTURE_CUBE_MAP_NEGATIVE_Y:
  22706. case e.TEXTURE_CUBE_MAP_POSITIVE_Z:
  22707. case e.TEXTURE_CUBE_MAP_NEGATIVE_Z:
  22708. return s.TextureCube;
  22709. case e.TEXTURE_2D:
  22710. return s.Texture2D;
  22711. default:
  22712. return null
  22713. }
  22714. }
  22715. ,
  22716. n.prototype.initComposer = function() {
  22717. this.composer = new r.EffectComposer(this.renderer),
  22718. this.composer.addPass(new r.RenderPass(this.scene,this.camera)),
  22719. this.composer.addPass(this.effects.hblurPass),
  22720. this.composer.addPass(this.effects.vblurPass)
  22721. }
  22722. ,
  22723. n.prototype.setSize = function(e, t, devicePixelRatio) {
  22724. this.renderWidth = e,
  22725. this.renderHeight = t,
  22726. this.effects.aspect = e / t,
  22727. /* this.renderer.setSize(e, t), -----MP */
  22728. this.renderer.setSize(e, t, false, devicePixelRatio), //改 为了防止给canvas设置宽高
  22729. this.composer.setSize(e, t);
  22730. for (var i = 0; i < this.resizeListeners.length; i++)
  22731. this.resizeListeners[i].setSize(e, t)
  22732. }
  22733. ,
  22734. n.prototype.render = function() {
  22735. this.effects.currentBlur > 0 ? this.composer.render() : this.renderer.render(this.scene, this.camera)
  22736. }
  22737. ,
  22738. /* n.prototype.updateScreenSize = function() {----MP
  22739. ($("#player").width() !== this.renderWidth || $("#player").height() !== this.renderHeight || this.forceUpdateSize) && (this.setSize($("#player").width(), $("#player").height()),
  22740. this.forceUpdateSize = !1)
  22741. } */
  22742. n.prototype.updateScreenSize = function() {//xzw 改 为了截屏 要改canvas大小 以及缩放时不模糊
  22743. var W,H;//当截屏时有setTimeout 期间不能恢复大小,所以要用W,H记录正常大小
  22744. return function(o){
  22745. var render = false;
  22746. var ratio;
  22747. var w, h; //记录应当render的大小
  22748. if(o && !o.resize && o.width!= void 0 && o.height!= void 0){
  22749. w = o.width, h = o.height, render = true, ratio=1;
  22750. }else{
  22751. w = $('#player').width();
  22752. h = $('#player').height();
  22753. o && o.resize && (W = this.renderWidth, H = this.renderHeight);
  22754. (w !== W || h !== H || this.forceUpdateSize) &&
  22755. (W = w, H = h, render = true, ratio = window.devicePixelRatio);
  22756. }
  22757. if(render){
  22758. this.setSize(w, h, ratio);
  22759. this.forceUpdateSize = !1
  22760. }
  22761. }
  22762. }()
  22763. ,
  22764. n.prototype.updateComponents = function() {
  22765. for (var e = Math.min(1, this.updateClock.getDelta()), t = 0; t < this.updateListeners.length; t++)
  22766. this.updateListeners[t].update(e)
  22767. }
  22768. ,
  22769. n.prototype.suspend = function() {
  22770. this.started = !1,
  22771. this.suspendedObjects = this.scene.children.map(function(e) {
  22772. return this.scene.remove(e),
  22773. e
  22774. }
  22775. .bind(this)),
  22776. this.render()
  22777. }
  22778. ,
  22779. n.prototype.resume = function() {
  22780. this.suspendedObjects.forEach(function(e) {
  22781. this.scene.add(e)
  22782. }
  22783. .bind(this)),
  22784. this.suspendedObjects = [],
  22785. this.started = !0,
  22786. p()
  22787. }
  22788. ;
  22789. var p = function() {
  22790. this.started && (window.requestAnimationFrame(p),
  22791. this.updateScreenSize(),
  22792. this.updateComponents(),
  22793. this.updateTextureMemory(),
  22794. this.render(),
  22795. this.emit(a.AfterRender))
  22796. };
  22797. n.prototype.getImageData = function() {
  22798. var e = document.createElement("canvas")
  22799. , t = e.getContext("2d");
  22800. return function(i, n, r) {
  22801. return e.width === n && e.height === r || (e.width = n,
  22802. e.height = r),
  22803. t.drawImage(i, 0, 0, n, r),
  22804. t.getImageData(0, 0, n, r)
  22805. }
  22806. }(),
  22807. n.prototype.initSizedTexture2D = function(e, t, i) {
  22808. var n = this.renderer
  22809. , o = n.context
  22810. , a = n.state
  22811. , s = new r.Texture(null);
  22812. s.flipY = !1,
  22813. i !== !0 && (i = !1),
  22814. s.generateMipmaps = i;
  22815. var l = n.paramThreeToGL(s.format)
  22816. , c = n.paramThreeToGL(s.type)
  22817. , h = n.properties.get(s)
  22818. , u = o.createTexture();
  22819. a.bindTexture(o.TEXTURE_2D, u),
  22820. o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL, s.flipY),
  22821. o.texImage2D(o.TEXTURE_2D, 0, l, e, e, 0, l, c, null),
  22822. s.wrapS = t,
  22823. s.wrapT = t;
  22824. var d = n.paramThreeToGL(t);
  22825. return o.texParameteri(o.TEXTURE_2D, o.TEXTURE_WRAP_S, d),
  22826. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_WRAP_T, d),
  22827. i ? (s.magFilter = r.LinearFilter,
  22828. s.minFilter = r.LinearMipMapLinearFilter,
  22829. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MAG_FILTER, o.LINEAR),
  22830. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MIN_FILTER, o.LINEAR_MIPMAP_NEAREST),
  22831. o.generateMipmap(o.TEXTURE_2D)) : (s.magFilter = r.LinearFilter,
  22832. s.minFilter = r.LinearFilter,
  22833. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MAG_FILTER, o.LINEAR),
  22834. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MIN_FILTER, o.LINEAR)),
  22835. a.bindTexture(o.TEXTURE_2D, null),
  22836. h.__webglTexture = u,
  22837. s
  22838. }
  22839. ,
  22840. n.prototype.initSizedCubeMap = function(e, t) {
  22841. var i = this.renderer
  22842. , n = i.context
  22843. , o = i.state
  22844. , a = new r.CubeTexture([null, null, null, null, null, null]);
  22845. a.flipY = !1,
  22846. a.generateMipmaps = t;
  22847. var s = i.paramThreeToGL(a.format)
  22848. , l = i.paramThreeToGL(a.type)
  22849. , c = i.properties.get(a)
  22850. , h = n.createTexture();
  22851. o.bindTexture(n.TEXTURE_CUBE_MAP, h),
  22852. n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL, a.flipY);
  22853. for (var u = 0; u < 6; u++)
  22854. n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + u, 0, s, e, e, 0, s, l, null);
  22855. return t ? (a.magFilter = r.LinearFilter,
  22856. a.minFilter = r.LinearMipMapLinearFilter,
  22857. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  22858. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR_MIPMAP_LINEAR),
  22859. n.texParameteri(n.TEXTURE_CUBE_MAP, n.GENERATE_MIPMAP, n.TRUE),
  22860. n.generateMipmap(n.TEXTURE_CUBE_MAP)) : (a.magFilter = r.LinearFilter,
  22861. a.minFilter = r.LinearFilter,
  22862. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  22863. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR)),
  22864. o.bindTexture(n.TEXTURE_CUBE_MAP, null),
  22865. c.__image__webglTextureCube = h,
  22866. a
  22867. }
  22868. ,
  22869. n.prototype.deallocateCubeTexture = function(e) {
  22870. var t = this.renderer
  22871. , i = t.context
  22872. , n = t.properties.get(e);
  22873. i.deleteTexture(n.__image__webglTextureCube)
  22874. }
  22875. ,
  22876. n.prototype.uploadTexture2D = function(e, t, i, n, r, o) {
  22877. var a = this.renderer
  22878. , s = a.context
  22879. , l = a.state
  22880. , c = a.properties.get(t);
  22881. l.bindTexture(s.TEXTURE_2D, c.__webglTexture),
  22882. s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, t.flipY),
  22883. s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  22884. s.pixelStorei(s.UNPACK_ALIGNMENT, t.unpackAlignment),
  22885. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_S, a.paramThreeToGL(t.wrapS)),
  22886. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_T, a.paramThreeToGL(t.wrapT)),
  22887. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MAG_FILTER, a.paramThreeToGL(t.magFilter)),
  22888. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MIN_FILTER, a.paramThreeToGL(t.minFilter)),
  22889. s.texSubImage2D(s.TEXTURE_2D, 0, i, n, s.RGBA, s.UNSIGNED_BYTE, e),
  22890. t.generateMipmaps && s.generateMipmap(s.TEXTURE_2D),
  22891. l.bindTexture(s.TEXTURE_2D, null)
  22892. }
  22893. ,
  22894. n.prototype.uploadTexture3D = function(e, t, i, n, r, o, a) {
  22895. var s = this.renderer
  22896. , l = s.context
  22897. , c = s.state
  22898. , h = s.properties.get(t);
  22899. c.bindTexture(l.TEXTURE_CUBE_MAP, h.__image__webglTextureCube),
  22900. l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL, t.flipY),
  22901. l.texSubImage2D(r, 0, i, n, l.RGBA, l.UNSIGNED_BYTE, e),
  22902. t.generateMipmaps && l.generateMipmap(l.TEXTURE_CUBE_MAP),
  22903. c.bindTexture(l.TEXTURE_CUBE_MAP, null)
  22904. }
  22905. ,
  22906. n.prototype.rebuildMipMaps2D = function(e) {
  22907. var t = this.renderer
  22908. , i = t.context
  22909. , n = t.state;
  22910. t.properties.get(e);
  22911. i.generateMipmap(i.TEXTURE_2D),
  22912. n.bindTexture(i.TEXTURE_2D, null)
  22913. }
  22914. ,
  22915. n.prototype.rebuildMipMaps3D = function(e) {
  22916. var t = this.renderer
  22917. , i = t.context
  22918. , n = t.state
  22919. , r = t.properties.get(e);
  22920. n.bindTexture(i.TEXTURE_CUBE_MAP, r.__image__webglTextureCube),
  22921. i.generateMipmap(i.TEXTURE_CUBE_MAP),
  22922. n.bindTexture(i.TEXTURE_CUBE_MAP, null)
  22923. }
  22924. ,
  22925. n.prototype.renderToCubeMap = function() {
  22926. var e = !1
  22927. , t = null
  22928. , i = null
  22929. , n = null
  22930. , a = null
  22931. , s = null
  22932. , l = 1;
  22933. return function(c, h, u, d, p, f, g, m, v, A, y, C, I, E, b, w) {
  22934. var _ = this.renderer;
  22935. _.context;
  22936. e || (i = new r.OrthographicCamera(l / -2,l / 2,l / 2,l / -2,-200,200),
  22937. i.position.z = 150,
  22938. t = new r.Scene,
  22939. t.add(i),
  22940. n = new r.ShaderMaterial({
  22941. uniforms: {
  22942. tDiffuse: {
  22943. type: "t",
  22944. value: null
  22945. },
  22946. alpha: {
  22947. type: "f",
  22948. value: 1
  22949. }
  22950. },
  22951. vertexShader: o.basicTextured.vertexShader,
  22952. fragmentShader: o.basicTextured.fragmentShader,
  22953. depthWrite: !1,
  22954. depthTest: !1,
  22955. side: r.DoubleSide
  22956. }),
  22957. a = new r.PlaneBufferGeometry(l,l),
  22958. s = new r.Mesh(a,n),
  22959. s.position.z = 0,
  22960. t.add(s),
  22961. e = !0);
  22962. var T = a.getAttribute("uv");
  22963. T.setDynamic(!0),
  22964. T.needsUpdate = !0;
  22965. var x = T.array
  22966. , S = p / u
  22967. , M = f / d
  22968. , R = g / u
  22969. , P = m / d;
  22970. x[0] = S,
  22971. x[1] = M + P,
  22972. x[2] = S + R,
  22973. x[3] = M + P,
  22974. x[4] = S,
  22975. x[5] = M,
  22976. x[6] = S + R,
  22977. x[7] = M;
  22978. var O = a.getAttribute("position");
  22979. O.setDynamic(!0),
  22980. O.needsUpdate = !0;
  22981. var L = O.array
  22982. , D = v / h.width - l / 2
  22983. , N = A / h.height - l / 2
  22984. , B = y / h.width
  22985. , F = C / h.height;
  22986. L[0] = D,
  22987. L[1] = N + F,
  22988. L[3] = D + B,
  22989. L[4] = N + F,
  22990. L[6] = D,
  22991. L[7] = N,
  22992. L[9] = D + B,
  22993. L[10] = N;
  22994. this.renderer.properties.get(c);
  22995. n.uniforms.tDiffuse.value = c,
  22996. n.blending = E || r.NoBlending,
  22997. n.transparent = !!b,
  22998. void 0 !== w && null !== w || (w = 1),
  22999. n.uniforms.alpha.value = w,
  23000. n.needUpdate = !0,
  23001. h.activeCubeFace = I,
  23002. h.viewport.set(0, 0, h.width, h.height);
  23003. var V = this.renderer.autoClear;
  23004. this.renderer.autoClear = !1,
  23005. this.renderer.render(t, i, h, !1),
  23006. this.renderer.autoClear = V
  23007. }
  23008. }(),
  23009. n.prototype.copyCubeMap = function() {
  23010. var e = !1
  23011. , t = null
  23012. , i = null
  23013. , a = null
  23014. , s = null
  23015. , l = null
  23016. , c = new r.Euler;
  23017. new r.Vector3;
  23018. return function(h, u, d, p, f, g, m, v, A) {
  23019. this.renderer;
  23020. if (!e) {
  23021. var y = 2;
  23022. i = new r.OrthographicCamera(y / -2,y / 2,y / 2,y / -2,0,200),
  23023. i.position.set(0, 0, 0),
  23024. t = new r.Scene,
  23025. t.add(i),
  23026. a = new r.ShaderMaterial({
  23027. uniforms: {
  23028. tDiffuse: {
  23029. type: "t",
  23030. value: null
  23031. },
  23032. alpha: {
  23033. type: "f",
  23034. value: 1
  23035. }
  23036. },
  23037. vertexShader: o.copyCubeMap.vertexShader,
  23038. fragmentShader: o.copyCubeMap.fragmentShader,
  23039. depthWrite: !1,
  23040. depthTest: !1,
  23041. side: r.DoubleSide
  23042. }),
  23043. s = new r.BoxGeometry(y,y,y),
  23044. l = new r.Mesh(s,a),
  23045. t.add(l),
  23046. e = !0
  23047. }
  23048. for (var C = 0; C < 6; C++)
  23049. n.getCubeOrientationForCubeFace(C, c),
  23050. l.rotation.copy(c),
  23051. l.matrixWorldNeedsUpdate = !0,
  23052. l.updateMatrixWorld(),
  23053. a.uniforms.tDiffuse.value = h,
  23054. a.blending = m || r.NoBlending,
  23055. a.transparent = !!v,
  23056. void 0 !== A && null !== A || (A = 1),
  23057. a.uniforms.alpha.value = A,
  23058. a.needUpdate = !0,
  23059. u.activeCubeFace = C,
  23060. u.viewport.set(0, 0, f, g),
  23061. this.renderer.render(t, i, u, !1)
  23062. }
  23063. }(),
  23064. n.getLookAtForCubeFace = function(e, t) {
  23065. switch (e) {
  23066. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  23067. t.set(1, 0, 0);
  23068. break;
  23069. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  23070. t.set(-1, 0, 0);
  23071. break;
  23072. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  23073. t.set(0, 1, 0);
  23074. break;
  23075. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  23076. t.set(0, -1, 0);
  23077. break;
  23078. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  23079. t.set(0, 0, 1);
  23080. break;
  23081. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  23082. t.set(0, 0, -1)
  23083. }
  23084. }
  23085. ,
  23086. n.getCubeOrientationForCubeFace = function(e, t) {
  23087. switch (e) {
  23088. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  23089. t.set(0, -Math.PI / 2, 0);
  23090. break;
  23091. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  23092. t.set(0, Math.PI / 2, 0);
  23093. break;
  23094. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  23095. t.set(Math.PI / 2, Math.PI, 0);
  23096. break;
  23097. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  23098. t.set(-Math.PI / 2, Math.PI, 0);
  23099. break;
  23100. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  23101. t.set(0, -Math.PI, 0);
  23102. break;
  23103. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  23104. t.set(0, 0, 0)
  23105. }
  23106. }
  23107. ,
  23108. t.exports = n
  23109. }
  23110. , {
  23111. "../enum/GLCubeFaces": 25,
  23112. "../enum/GLTextureType": 26,
  23113. "../enum/SceneRendererEvents": 43,
  23114. "../exception/BasicException": 55,
  23115. "../exception/RendererCreationException": 57,
  23116. "../settings": 166,
  23117. "../shaders": 167,
  23118. events: 202,
  23119. three: 217
  23120. }],
  23121. 159: [function(e, t, i) {
  23122. "use strict";
  23123. function n(e) {
  23124. this.messenger = new a(e),
  23125. this.clientKey = null
  23126. }
  23127. var r = e("../util/ajax")
  23128. , o = e("./PostMessageType")
  23129. , a = e("./postmessage")
  23130. , s = e("./VersionInfo")
  23131. , l = e("events").EventEmitter
  23132. , c = window.location.origin + "/api/v1/user/";
  23133. n.prototype = Object.create(l.prototype),
  23134. n.prototype.bindEvents = function() {
  23135. this.messenger.on(o.ACTION, this.onMessageReceived.bind(this))
  23136. }
  23137. ,
  23138. n.prototype.waitForConnection = function() {
  23139. var e = new Promise(function(e, t) {
  23140. this.messenger.on(o.CONNECT, function(i) {
  23141. this.onConnectionReceived(i).then(e.bind(this, i.sdkVersion), t.bind())
  23142. }
  23143. .bind(this))
  23144. }
  23145. .bind(this));
  23146. return e
  23147. }
  23148. ,
  23149. n.prototype.onConnectionReceived = function(e) {
  23150. return this.messenger.setTarget(e.source, e.origin),
  23151. this.verifyConnection(e).then(function(t, i) {
  23152. this.messenger.send({
  23153. type: o.ACCEPT,
  23154. toId: e.fromId,
  23155. warning: i
  23156. }),
  23157. this.clientKey = t,
  23158. this.messenger.removeAllListeners(o.CONNECT),
  23159. this.bindEvents()
  23160. }
  23161. .bind(this), function(t) {
  23162. this.messenger.send({
  23163. type: o.REJECT,
  23164. toId: e.fromId,
  23165. reason: t
  23166. }),
  23167. this.messenger.setTarget()
  23168. }
  23169. .bind(this))
  23170. }
  23171. ,
  23172. n.prototype.verifyConnection = function(e) {
  23173. return new Promise(function(t, i) {
  23174. var n;
  23175. if (s.isDeprecated(e.sdkVersion))
  23176. n = "This version of the SDK is being deprecated. Please see http://www.port.com for more info";
  23177. else if (!s.isSupported(e.sdkVersion))
  23178. return i("This version of the SDK isn't supported. Get the latest version here: http://www.port.com");
  23179. var o = {
  23180. cache: !1,
  23181. headers: {
  23182. "X-port-Application-Key": e.applicationKey,
  23183. "X-port-Referrer": e.origin
  23184. }
  23185. };
  23186. r.get(c, o).done(t.bind(this, e.applicationKey, n)).fail(i.bind(this, "key/referrer mismatch"))
  23187. }
  23188. )
  23189. }
  23190. ,
  23191. n.prototype.onMessageReceived = function(e) {
  23192. if (this.validateClientApplicationKey(e.applicationKey)) {
  23193. var t = this;
  23194. e.onDone = function(i) {
  23195. i.toId = e.fromId,
  23196. i.uid = e.uid,
  23197. i.type = o.RESPONSE,
  23198. t.messenger.send(i)
  23199. }
  23200. ,
  23201. this.emit(o.ACTION, e)
  23202. }
  23203. }
  23204. ,
  23205. n.prototype.validateClientApplicationKey = function(e) {
  23206. return this.clientKey === e
  23207. }
  23208. ,
  23209. n.prototype.sendEvent = function(e, t) {
  23210. this.messenger.send({
  23211. type: o.EVENT,
  23212. eventType: e,
  23213. eventData: t
  23214. })
  23215. }
  23216. ,
  23217. t.exports = n
  23218. }
  23219. , {
  23220. "../util/ajax": 181,
  23221. "./PostMessageType": 160,
  23222. "./VersionInfo": 163,
  23223. "./postmessage": 165,
  23224. events: 202
  23225. }],
  23226. 160: [function(e, t, i) {
  23227. "use strict";
  23228. t.exports = Object.freeze({
  23229. CONNECT: "postmessage.connect",
  23230. ACCEPT: "postmessage.accept",
  23231. REJECT: "postmessage.reject",
  23232. ACTION: "postmessage.action",
  23233. RESPONSE: "postmessage.response",
  23234. EVENT: "postmessage.event"
  23235. })
  23236. }
  23237. , {}],
  23238. 161: [function(e, t, i) {
  23239. "use strict";
  23240. t.exports = Object.freeze({
  23241. MOVE: "sdk.move",
  23242. ENTER_PANO: "sdk.enterpano",
  23243. MODEL_LOADED: "sdk.modelloaded"
  23244. })
  23245. }
  23246. , {}],
  23247. 162: [function(e, t, i) {
  23248. "use strict";
  23249. t.exports = Object.freeze({
  23250. FLY: "transition.fly",
  23251. FADEOUT: "transition.fade",
  23252. INSTANT: "transition.instant"
  23253. })
  23254. }
  23255. , {}],
  23256. 163: [function(e, t, i) {
  23257. "use strict";
  23258. t.exports = {
  23259. current: "1.0",
  23260. supported: ["1.0"],
  23261. deprecated: [],
  23262. isSupported: function(e) {
  23263. return this.supported.indexOf(e) !== -1
  23264. },
  23265. isDeprecated: function(e) {
  23266. return this.deprecated.indexOf(e) !== -1
  23267. },
  23268. isValid: function(e) {
  23269. return this.isSupported(e) || this.isDeprecated(e)
  23270. }
  23271. }
  23272. }
  23273. , {}],
  23274. 164: [function(e, t, i) {
  23275. (function(i) {
  23276. "use strict";
  23277. function n(e, t, i) {
  23278. e && (e = e.toLowerCase().trim());
  23279. var n = new I.UP.clone
  23280. , r = Math.PI / 3
  23281. , o = Math.PI / 2;
  23282. switch (e) {
  23283. case "left":
  23284. i.copy(t),
  23285. i.applyAxisAngle(n, o);
  23286. break;
  23287. case "right":
  23288. i.copy(t),
  23289. i.applyAxisAngle(n, -o);
  23290. break;
  23291. case "forwardleft":
  23292. i.copy(t),
  23293. i.applyAxisAngle(n, r);
  23294. break;
  23295. case "forwardright":
  23296. i.copy(t),
  23297. i.applyAxisAngle(n, -r);
  23298. break;
  23299. case "forward":
  23300. default:
  23301. i.copy(t)
  23302. }
  23303. return i
  23304. }
  23305. function r(e, t) {
  23306. if (e) {
  23307. var i = {
  23308. pano: e,
  23309. lookAtPoint: null,
  23310. duration: null,
  23311. maxDistanceOverride: null,
  23312. skipWarpingCheck: !1
  23313. };
  23314. this.player.flyToPano(i, function() {
  23315. t && t({
  23316. success: !0,
  23317. message: "Transition complete."
  23318. })
  23319. })
  23320. } else
  23321. R.warn("Showcase -> clickPanoObject: Unable to find pano."),
  23322. t && t({
  23323. success: !1,
  23324. error: "Unable to find pano."
  23325. })
  23326. }
  23327. function o(e, t) {
  23328. var i = this.findRankedPano(e, t);
  23329. return i >= 0 ? this.handleToObject[i] : (R.warn("Showcase -> findRankedPanoObject: Unable to find nearby pano."),
  23330. null)
  23331. }
  23332. function a(e, t) {
  23333. var i = this.findRankedtag(e, t);
  23334. return i >= 0 ? this.handleToObject[i] : (R.warn("Showcase -> findRankedtagObject: Unable to find nearby tag."),
  23335. null)
  23336. }
  23337. function s(e, t) {
  23338. t.copy(I.FORWARD),
  23339. e.getDirection(t)
  23340. }
  23341. function l(e) {
  23342. function t(e) {
  23343. var t = (new c.Euler).setFromQuaternion(e.quaternion, "YXZ");
  23344. return {
  23345. x: c.Math.radToDeg(t._x),
  23346. y: c.Math.radToDeg(t._y),
  23347. z: c.Math.radToDeg(t._z)
  23348. }
  23349. }
  23350. var i = function(e) {
  23351. return e.alignmentType !== m.ALIGNED ? null : {
  23352. x: e.position.x,
  23353. y: e.position.y,
  23354. z: e.position.z
  23355. }
  23356. };
  23357. return {
  23358. panos: e.panos.list.map(function(n) {
  23359. var r = y.getCubemapUrls(e.urls, n.id, "high")[C.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z];
  23360. return {
  23361. uuid: n.id,
  23362. aligned: n.alignmentType === m.ALIGNED,
  23363. neighbourUUIDs: n.neighbourUUIDs.slice(),
  23364. position: i(n),
  23365. rotation: t(n),
  23366. thumbnail: r
  23367. }
  23368. })
  23369. }
  23370. }
  23371. var c = e("three")
  23372. , h = e("./ApiHost")
  23373. , u = e("../util/logger")
  23374. , d = e("../util/common")
  23375. , p = e("../util/math")
  23376. , f = e("../enum/ModelManagerEvents")
  23377. , g = e("./PostMessageType")
  23378. , m = e("../enum/AlignmentType")
  23379. , v = e("../enum/Direction")
  23380. , A = e("./TransitionStyles")
  23381. , y = e("../util/panorama")
  23382. , C = e("../enum/GLCubeFaces")
  23383. , I = e("../enum/Vectors")
  23384. , E = e("../enum/Viewmode")
  23385. , b = e("../enum/WarpStyle")
  23386. , w = (e("../enum/Keys"),
  23387. e("../enum/PlayerEvents"))
  23388. , _ = e("../sdk/SdkEvents")
  23389. , I = e("../enum/Vectors")
  23390. , T = e("../enum/ControlEvents")
  23391. , x = e("../enum/RenderLayers")
  23392. , S = (e("../constants"),
  23393. e("../settings"))
  23394. , M = e("../lib/jpeg_encoder")
  23395. , R = new u(i)
  23396. , P = function() {
  23397. var e = function e() {
  23398. e.playerDirection.copy(e.player.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  23399. e.player.getDirection(e.playerDirection),
  23400. e.projectVectors();
  23401. var t = e.playerDirection.angleTo(e.lastFacingDirection);
  23402. if (e.angleTravelled += Math.abs(t),
  23403. e.angleTravelled >= Math.abs(e.angle)) {
  23404. if (e.active = !1,
  23405. e.onDone) {
  23406. var i = e.onDone;
  23407. i()
  23408. }
  23409. } else
  23410. e.lastFacingDirection.copy(e.playerDirection),
  23411. window.setTimeout(e, 4)
  23412. };
  23413. return e.active = !1,
  23414. e.angle = 0,
  23415. e.angleTravelled = 0,
  23416. e.playerDirection = new c.Vector3,
  23417. e.lastFacingDirection = new c.Vector3,
  23418. e.onDone = null,
  23419. e.player = null,
  23420. e.start = function(t, i, n, r) {
  23421. e.active = !0,
  23422. t && i && (i = 0),
  23423. e.angle = t || i,
  23424. e.xAngle = t,
  23425. e.yAngle = i,
  23426. e.angleTravelled = 0,
  23427. e.playerDirection.copy(n.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  23428. n.getDirection(e.playerDirection),
  23429. e.lastFacingDirection.copy(e.playerDirection),
  23430. e.projectVectors(),
  23431. e.onDone = r,
  23432. e.player = n,
  23433. e()
  23434. }
  23435. ,
  23436. e.projectVectors = function() {
  23437. e.xAngle && (e.playerDirection.projectOnPlane(I.UP),
  23438. e.lastFacingDirection.projectOnPlane(I.UP))
  23439. }
  23440. ,
  23441. e
  23442. }()
  23443. , O = function() {
  23444. var e = new c.Vector3;
  23445. return function(t) {
  23446. t ? (e.copy(t.position),
  23447. e.add(t.discPosition),
  23448. p.projectPositionToCanvas(e, this.player.camera, e),
  23449. this.click(e.x, e.y)) : R.warn("Showcase -> clicktagObject: Unable to find tag.")
  23450. }
  23451. }()
  23452. , L = function() {
  23453. return this.player.mode === E.PANORAMA ? S.insideLookLimitUp : this.player.mode === E.DOLLHOUSE ? 90 - c.Math.radToDeg(S.dollhouseDefault.minPolarAngle) : null
  23454. }
  23455. , D = function() {
  23456. return this.player.mode === E.PANORAMA ? S.insideLookLimitDown : this.player.mode === E.DOLLHOUSE ? 90 - c.Math.radToDeg(S.dollhouseDefault.maxPolarAngle) : null
  23457. }
  23458. , N = function(e) {
  23459. var t = new c.Vector3;
  23460. return function(e) {
  23461. var i = this.player.getDirection();
  23462. t.copy(i);
  23463. var n = t.y;
  23464. t.y = 0,
  23465. t.normalize();
  23466. var r = c.Math.radToDeg(t.angleTo(i)) * (n < 0 ? -1 : 1);
  23467. if (this.player.mode !== E.DOLLHOUSE && this.player.mode !== E.PANORAMA)
  23468. return 0 !== e && R.warn("Cannot rotate in y direction when in " + this.player.mode + " mode"),
  23469. 0;
  23470. this.player.mode === E.DOLLHOUSE && (r = -r);
  23471. var o = L.call(this) - .1
  23472. , a = D.call(this) + .1
  23473. , s = r + e;
  23474. s > o ? s = o : s < a && (s = a);
  23475. var l = s - r;
  23476. return e > 0 && l < .01 && (l = 0),
  23477. e < 0 && l > -.01 && (l = 0),
  23478. l
  23479. }
  23480. }()
  23481. , B = function() {
  23482. var e = new c.Euler;
  23483. return function(t) {
  23484. return e.setFromQuaternion(t.quaternion, "YXZ"),
  23485. {
  23486. position: {
  23487. x: t.position.x,
  23488. y: t.position.y,
  23489. z: t.position.z
  23490. },
  23491. rotation: {
  23492. x: c.Math.radToDeg(e.x),
  23493. y: c.Math.radToDeg(e.y),
  23494. z: 0
  23495. },
  23496. pano: t.currentPano ? t.currentPano.id : null,
  23497. mode: t.mode
  23498. }
  23499. }
  23500. }()
  23501. , F = null;
  23502. t.exports = {
  23503. init: function(e, t, i, n, r) {
  23504. V.init(e, t, i, r),
  23505. F = new Promise(function(e, t) {
  23506. i.on(w.Ready, function() {
  23507. e()
  23508. })
  23509. }
  23510. .bind(this));
  23511. var o = new h(window)
  23512. , a = o.waitForConnection();
  23513. a.then(function(e) {
  23514. o.on(g.ACTION, V.onMessageReceive.bind(V))
  23515. });
  23516. var s = function() {
  23517. var e = Date.now();
  23518. return function() {
  23519. if (!(Date.now() - e < 100)) {
  23520. var t = B(i);
  23521. o.sendEvent(_.MOVE, {
  23522. state: t
  23523. }),
  23524. e = Date.now()
  23525. }
  23526. }
  23527. }();
  23528. i.on(w.Move, s),
  23529. i.on(w.ViewChanged, s),
  23530. n.on(f.ActiveModelChanged, function(e) {
  23531. function t(e) {
  23532. var t, i = e.newPano.id;
  23533. e.oldPano && (t = e.oldPano.id),
  23534. i !== t && o.sendEvent(_.ENTER_PANO, {
  23535. oldPano: t,
  23536. newPano: i
  23537. })
  23538. }
  23539. var i = e.model
  23540. , n = e.oldModel;
  23541. V.model = i,
  23542. a.then(function() {
  23543. o.sendEvent(_.MODEL_LOADED, {
  23544. metadata: l(i)
  23545. })
  23546. }),
  23547. n && n.panos.forEach(function(e) {
  23548. e.removeEventListener("enter", t)
  23549. }),
  23550. i.panos.forEach(function(e) {
  23551. e.on("enter", t)
  23552. })
  23553. })
  23554. }
  23555. };
  23556. var V = {
  23557. director: null,
  23558. player: null,
  23559. controls: null,
  23560. sceneRenderer: null,
  23561. model: null,
  23562. init: function(e, t, i, n) {
  23563. this.director = e,
  23564. this.player = i,
  23565. this.controls = t,
  23566. this.sceneRenderer = n
  23567. },
  23568. handleToObject: {},
  23569. objectToHandle: {},
  23570. handleCount: 0,
  23571. onMessageReceive: function(e) {
  23572. if (e) {
  23573. var t = e.targetFunction
  23574. , i = e.params
  23575. , n = e.onDone;
  23576. t && this[t] && this[t](i, n)
  23577. }
  23578. },
  23579. waitForInit: function(e, t) {
  23580. F.then(t.bind({
  23581. success: !0,
  23582. message: "Init complete."
  23583. }))
  23584. },
  23585. moveToPano: function(e, t) {
  23586. var i = new c.Euler(0,0,0,"YXZ")
  23587. , n = new c.Quaternion;
  23588. return function(e, t) {
  23589. var r = e.pano
  23590. , o = e.rotation
  23591. , a = e.transition;
  23592. if (!this.model)
  23593. return t({
  23594. success: !1,
  23595. error: "The model has not been loaded yet"
  23596. });
  23597. var s = this.model.panos.get(r);
  23598. if (!s)
  23599. return t({
  23600. success: !1,
  23601. error: r + " does not exist in this model"
  23602. });
  23603. if (!o)
  23604. return t({
  23605. sucess: !1,
  23606. erorr: o + " is not a valid rotation"
  23607. });
  23608. i.set(c.Math.degToRad(o.x || 0), c.Math.degToRad(o.y || 0), c.Math.degToRad(o.z || 0), "YXZ"),
  23609. console.log(o.z);
  23610. var l = {
  23611. success: !0,
  23612. message: r
  23613. };
  23614. if (a === A.FADEOUT)
  23615. n.setFromEuler(i),
  23616. this.player.warpToPano(s, n, null, null, b.BLACK, null, null, t.bind(this, l));
  23617. else {
  23618. var h, u;
  23619. a === A.INSTANT && (h = 0,
  23620. u = 0);
  23621. var d = I.FORWARD.clone().applyEuler(i).add(s.position);
  23622. this.player.flyToPano({
  23623. pano: s,
  23624. lookAtPoint: d,
  23625. duration: h,
  23626. aimDuration: u
  23627. }, t.bind(this, l))
  23628. }
  23629. }
  23630. }(),
  23631. moveInDirection: function(e, t) {
  23632. var i = e.direction;
  23633. return "undefined" == typeof v[i] ? (R.warn("Showcase -> moveInDirection: Cannot move in invalid direction."),
  23634. void (t && t({
  23635. success: !1,
  23636. error: "Invalid direction."
  23637. }))) : void this.player.flyLocalDirection(I[i].clone()).then(function(e) {
  23638. t(e ? {
  23639. success: !0,
  23640. message: "moved " + i
  23641. } : {
  23642. success: !1,
  23643. error: "Cannot move in direction: " + i
  23644. })
  23645. })
  23646. },
  23647. getPose: function(e, t) {
  23648. this.player.camera.position,
  23649. (new c.Euler).setFromQuaternion(this.player.camera.quaternion, "YXZ");
  23650. return t({
  23651. success: !0,
  23652. message: B(this.player)
  23653. })
  23654. },
  23655. takeScreenShot: function() {
  23656. var e = new c.PerspectiveCamera
  23657. , t = new c.WebGLRenderTarget;
  23658. return function(i, n) {
  23659. if (!i.resolution)
  23660. return n({
  23661. success: !1,
  23662. error: "An invalid resolution was specified"
  23663. });
  23664. if (i.resolution.width === -1 || i.resolution.height === -1) {
  23665. var r = this.sceneRenderer.renderer.getSize();
  23666. i.resolution.width = r.width,
  23667. i.resolution.height = r.height
  23668. }
  23669. e.layers.set(x.DEFAULT),
  23670. i.visibleObjects && (i.visibleObjects.showtags && e.layers.enable(x.TAG),
  23671. i.visibleObjects.showPucks && e.layers.enable(x.PANOMARKERS),
  23672. i.visibleObjects.showReticule && e.layers.enable(x.RETICULE));
  23673. var o = i.resolution.width
  23674. , a = i.resolution.height
  23675. , s = o / a;
  23676. e.position.copy(this.sceneRenderer.camera.position),
  23677. e.quaternion.copy(this.sceneRenderer.camera.quaternion),
  23678. e.projectionMatrix.copy(this.player.camera.projectionMatrix),
  23679. e.projectionMatrix.elements[0] = this.player.camera.projectionMatrix.elements[5] / s,
  23680. t.setSize(o, a),
  23681. this.sceneRenderer.renderer.render(this.sceneRenderer.scene, e, t);
  23682. var l = new Uint8Array(o * a * 4);
  23683. this.sceneRenderer.renderer.readRenderTargetPixels(t, 0, 0, o, a, l);
  23684. var c = M.encode({
  23685. data: l,
  23686. width: o,
  23687. height: a,
  23688. heading: 180,
  23689. pitch: 0
  23690. }, {
  23691. quality: 75,
  23692. flipY: !0
  23693. })
  23694. , h = "data:image/jpg;base64," + d.uint8ToBase64(c.data);
  23695. n({
  23696. success: !0,
  23697. message: h
  23698. })
  23699. }
  23700. }(),
  23701. findRankedPano: function(e, t) {
  23702. var i = new c.Vector3
  23703. , r = new c.Vector3;
  23704. return function(e, t) {
  23705. s(this.player, r),
  23706. n(t, r, i);
  23707. var o = this.player.rankedPanoInDirection(e, i);
  23708. if (o) {
  23709. var a = this.objectToHandle[o.id];
  23710. return a || (this.objectToHandle[o.id] = a = this.handleCount++,
  23711. this.handleToObject[a] = o),
  23712. a
  23713. }
  23714. return R.warn("Showcase -> findRankedPano: Unable to find nearby pano."),
  23715. -1
  23716. }
  23717. }(),
  23718. findRankedtag: function(e, t) {
  23719. var i = new c.Vector3
  23720. , r = new c.Vector3;
  23721. return function(e, t) {
  23722. s(this.player, r),
  23723. n(t, r, i);
  23724. var o = this.player.rankedtagInDirection(e, i);
  23725. if (o) {
  23726. var a = this.objectToHandle[o.sid];
  23727. return a || (this.objectToHandle[o.sid] = a = this.handleCount++,
  23728. this.handleToObject[a] = o),
  23729. a
  23730. }
  23731. return R.warn("Showcase -> findRankedtag: Unable to find nearby tag."),
  23732. -1
  23733. }
  23734. }(),
  23735. clickNearesttag: function(e) {
  23736. this.clickRankedtag(0, e)
  23737. },
  23738. clickRankedtag: function(e, t) {
  23739. var i = a.call(this, e, t);
  23740. i && O.call(this, i)
  23741. },
  23742. clickNearestPano: function(e, t) {
  23743. this.clickRankedPano(0, e, t)
  23744. },
  23745. clickRankedPano: function(e, t, i) {
  23746. var n = o.call(this, e, t);
  23747. n ? r.call(this, n, i) : i(null)
  23748. },
  23749. clickPano: function(e, t) {
  23750. var i = this.handleTable[e];
  23751. i ? r.call(this, i, t) : t(null)
  23752. },
  23753. rotateDirection: function() {
  23754. return function(e, t) {
  23755. var i = e.direction
  23756. , n = e.angle;
  23757. if (!P.active) {
  23758. var r = 0
  23759. , o = 0
  23760. , a = 0
  23761. , s = 0;
  23762. if (!n || isNaN(n))
  23763. return R.warn("Showcase -> rotateDirection: Invalid rotation angle."),
  23764. void (t && t({
  23765. success: !1,
  23766. error: "Invalid rotation angle."
  23767. }));
  23768. if (this.player.mode === E.TRANSITIONING)
  23769. return R.warn("Automation -> rotateDirection: Cannot rotate while transitioning"),
  23770. void (t && t({
  23771. success: !1,
  23772. error: "Cannot rotate while transitioning"
  23773. }));
  23774. if (i === v.RIGHT || i === v.LEFT)
  23775. i === v.RIGHT && (n = -n),
  23776. r = n > 0 ? -1 : 1,
  23777. a = n;
  23778. else {
  23779. if (i !== v.UP && i !== v.DOWN)
  23780. return R.warn("Showcase -> rotateDirection: Invalid direction for rotation: " + i),
  23781. void (t && t({
  23782. success: !1,
  23783. error: "Invalid direction for rotation."
  23784. }));
  23785. if (this.player.mode === E.FLOORPLAN)
  23786. return R.warn("Showcase -> rotateDirection: Cannot rotate " + i + " in floorplan mode"),
  23787. void (t && t({
  23788. success: !1,
  23789. error: "Cannot rotate " + i + " in floorplan mode"
  23790. }));
  23791. if (i === v.DOWN && (n = -n),
  23792. n = N.call(this, n),
  23793. 0 === n)
  23794. return R.warn("Showcase -> rotateDirection: Already at maximum rotation in direction: " + i),
  23795. void (t && t({
  23796. success: !1,
  23797. error: "Already at maximum rotation in direction: " + i
  23798. }));
  23799. o = n > 0 ? 1 : -1,
  23800. s = n
  23801. }
  23802. var l = n;
  23803. n = c.Math.degToRad(n),
  23804. a = c.Math.degToRad(a),
  23805. s = c.Math.degToRad(s);
  23806. var h = this.controls.activeControl
  23807. , u = function() {
  23808. h.stopRotating(!0),
  23809. t && t({
  23810. success: !0,
  23811. message: "Rotated " + l.toFixed(2) + "° in direction: " + e.direction
  23812. })
  23813. };
  23814. h.startRotating(r, o),
  23815. P.start(a, s, this.player, u)
  23816. }
  23817. }
  23818. }(),
  23819. rotate: function() {
  23820. var e = new c.Vector3
  23821. , t = new c.Vector3;
  23822. return function(i, n) {
  23823. var r = i.xAngle
  23824. , o = i.yAngle;
  23825. if (!P.active) {
  23826. if (r = r || 0,
  23827. o = o || 0,
  23828. isNaN(r) || isNaN(o))
  23829. return R.warn("Showcase -> rotate: Invalid rotation angle."),
  23830. void (n && n({
  23831. success: !1,
  23832. error: "Invalid rotation angle."
  23833. }));
  23834. if (this.player.mode === E.TRANSITIONING)
  23835. return R.warn("Automation -> rotate: Cannot rotate while transitioning"),
  23836. void (n && n({
  23837. success: !1,
  23838. error: "Cannot rotate while transitioning"
  23839. }));
  23840. Math.abs(r) < .01 && (r = 0),
  23841. Math.abs(o) < .01 && (o = 0);
  23842. var a = o;
  23843. o = N.call(this, o),
  23844. r = -r;
  23845. var s = a > 0 ? "UP" : "DOWN";
  23846. if (!r && a && !o)
  23847. return R.warn("Showcase -> rotate: Already at maximum rotation in direction: " + s),
  23848. void (n && n({
  23849. success: !1,
  23850. error: "Already at maximum rotation in direction: " + s
  23851. }));
  23852. a > o && R.warn("Showcase -> rotate: Reached maximum rotation in direction: " + s);
  23853. var l = o;
  23854. o = c.Math.degToRad(o),
  23855. r = c.Math.degToRad(r),
  23856. e.copy(this.player.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  23857. this.player.getDirection(e),
  23858. t.copy(e).applyAxisAngle(I.UP, r),
  23859. t.applyAxisAngle(I.RIGHT, o);
  23860. var h = (e.angleTo(t),
  23861. r > 0 ? -1 : r < 0 ? 1 : 0)
  23862. , u = o > 0 ? 1 : o < 0 ? -1 : 0;
  23863. Math.abs(r) > Math.abs(o) ? u *= Math.abs(o / r) : Math.abs(o) > Math.abs(r) && (h *= Math.abs(r / o));
  23864. var d = this.controls.activeControl
  23865. , p = function() {
  23866. d.stopRotating(!0),
  23867. n && n({
  23868. success: !0,
  23869. message: "Rotated " + i.xAngle.toFixed(2) + "° horizontally, " + l.toFixed(2) + "° vertically"
  23870. })
  23871. };
  23872. d.startRotating(h, u),
  23873. P.start(r, o, this.player, p)
  23874. }
  23875. }
  23876. }(),
  23877. panCamera: function(e, t) {
  23878. function i(e) {
  23879. switch (r.removeAllListeners(T.AutoPanComplete),
  23880. r.removeAllListeners(T.AutoPanInterrupt),
  23881. r.removeAllListeners(T.AutoPanClamped),
  23882. e) {
  23883. case T.AutoPanInterrupt:
  23884. t({
  23885. success: !0,
  23886. message: "Camera panning interrupted."
  23887. });
  23888. break;
  23889. case T.AutoPanClamped:
  23890. if (r.autoPanPosition.x !== n.x || r.autoPanPosition.z !== n.z) {
  23891. if (Math.abs(this.player.position.x - r.autoPanPosition.x) < .01 && Math.abs(this.player.position.z - r.autoPanPosition.z) < .01)
  23892. return void t({
  23893. success: !1,
  23894. error: "Already at edge of current model bounds."
  23895. });
  23896. var i = "The view point is outside the bounds for the current model. ";
  23897. i += "The view point was clamped to " + o(r.target.x, r.target.z),
  23898. console.warn(i)
  23899. }
  23900. case T.AutoPanComplete:
  23901. t({
  23902. success: !0,
  23903. message: "Panned camera to position " + o(r.autoPanPosition.x, r.autoPanPosition.z)
  23904. })
  23905. }
  23906. }
  23907. if (this.player.mode !== E.DOLLHOUSE && this.player.mode !== E.FLOORPLAN)
  23908. return t({
  23909. success: !1,
  23910. error: "Camera panning is not available in the current mode: " + this.player.mode
  23911. });
  23912. var n = e.position
  23913. , r = this.player.control;
  23914. r.setAutoPanPosition(n.x, n.z),
  23915. r.autoPan = !0;
  23916. var o = function(e, t) {
  23917. return "(" + e.toFixed(2) + ", " + t.toFixed(2) + ")"
  23918. };
  23919. r.on(T.AutoPanComplete, i.bind(this, T.AutoPanComplete)),
  23920. r.on(T.AutoPanInterrupt, i.bind(this, T.AutoPanInterrupt)),
  23921. r.on(T.AutoPanClamped, i.bind(this, T.AutoPanClamped))
  23922. },
  23923. click: function(e, t) {
  23924. var i = e.x
  23925. , n = e.y
  23926. , r = e.percentage;
  23927. r === !0 && (i = i / 100 * $("#player").width(),
  23928. n = n / 100 * $("#player").height()),
  23929. this.player.handleInputStart(i, n),
  23930. this.player.updateIntersect(),
  23931. this.player.handleInputEnd(i, n)
  23932. },
  23933. mouseOver: function(e, t) {
  23934. var i = e.x
  23935. , n = e.y
  23936. , r = e.percentage;
  23937. r === !0 && (i = i / 100 * $("#player").width(),
  23938. n = n / 100 * $("#player").height()),
  23939. this.player.handleInputMove(i, n),
  23940. this.player.updateIntersect()
  23941. },
  23942. moveToMode: function(e, t) {
  23943. function i(e) {
  23944. t(e ? {
  23945. success: !1,
  23946. error: "Failed to load new mode: " + e
  23947. } : {
  23948. success: !0,
  23949. message: "Moved to new mode: " + n
  23950. })
  23951. }
  23952. var n = e.mode;
  23953. n === E.PANORAMA || n === E.DOLLHOUSE || n === E.FLOORPLAN ? this.director.changeMode(n).then(function() {
  23954. i()
  23955. }, function(e) {
  23956. i(e)
  23957. }) : t({
  23958. success: !1,
  23959. error: "Invalid mode selection"
  23960. })
  23961. }
  23962. }
  23963. }
  23964. ).call(this, "/js/sdk/automation.js")
  23965. }
  23966. , {
  23967. "../constants": 8,
  23968. "../enum/AlignmentType": 17,
  23969. "../enum/ControlEvents": 21,
  23970. "../enum/Direction": 22,
  23971. "../enum/GLCubeFaces": 25,
  23972. "../enum/Keys": 30,
  23973. "../enum/ModelManagerEvents": 33,
  23974. "../enum/PlayerEvents": 40,
  23975. "../enum/RenderLayers": 41,
  23976. "../enum/Vectors": 50,
  23977. "../enum/Viewmode": 51,
  23978. "../enum/WarpStyle": 52,
  23979. "../lib/jpeg_encoder": 94,
  23980. "../sdk/SdkEvents": 161,
  23981. "../settings": 166,
  23982. "../util/common": 185,
  23983. "../util/logger": 189,
  23984. "../util/math": 190,
  23985. "../util/panorama": 191,
  23986. "./ApiHost": 159,
  23987. "./PostMessageType": 160,
  23988. "./TransitionStyles": 162,
  23989. three: 217
  23990. }],
  23991. 165: [function(e, t, i) {
  23992. "use strict";
  23993. function n(e) {
  23994. this.sourceWindow = e,
  23995. this.targetWindow = null,
  23996. this.targetOrigin = null,
  23997. this.id = Math.floor(1e5 * Math.random()),
  23998. this.bindEvents()
  23999. }
  24000. var r = e("./PostMessageType")
  24001. , o = e("events").EventEmitter;
  24002. n.prototype = Object.create(o.prototype),
  24003. n.prototype.bindEvents = function() {
  24004. this.sourceWindow.addEventListener("message", this.onPostmessageReceived.bind(this))
  24005. }
  24006. ,
  24007. n.prototype.setTarget = function(e, t) {
  24008. this.targetWindow = e,
  24009. this.targetOrigin = t
  24010. }
  24011. ,
  24012. n.prototype.onPostmessageReceived = function(e) {
  24013. var t = e.origin || e.originalEvent.origin
  24014. , i = e.source;
  24015. switch (e.data.type) {
  24016. case r.CONNECT:
  24017. break;
  24018. case r.RESPONSE:
  24019. if (this.id !== e.data.toId)
  24020. return;
  24021. default:
  24022. if (!this.validateMessageOrigin(t))
  24023. return
  24024. }
  24025. var n = e.data;
  24026. n.source = i,
  24027. n.origin = t,
  24028. n.timestamp = Date.now(),
  24029. this.emit(e.data.type, n)
  24030. }
  24031. ,
  24032. n.prototype.validateMessageOrigin = function(e) {
  24033. return "*" === this.targetOrigin || e === this.targetOrigin
  24034. }
  24035. ,
  24036. n.prototype.send = function(e) {
  24037. this.targetWindow && this.targetOrigin && (e.fromId = this.id,
  24038. this.targetWindow.postMessage(e, this.targetOrigin))
  24039. }
  24040. ,
  24041. t.exports = n
  24042. }
  24043. , {
  24044. "./PostMessageType": 160,
  24045. events: 202
  24046. }],
  24047. 166: [function(e, t, i) {
  24048. "use strict";
  24049. var n = e("three")
  24050. , r = e("./util/browser")
  24051. , o = e("./enum/Viewmode")
  24052. , a = e("./enum/VROption")
  24053. , s = e("./enum/Colors")
  24054. , l = e("./enum/WarpStyle")
  24055. , c = e("./util/easing")
  24056. , h = e("./util/common")
  24057. , u = e("./util/showcase")
  24058. , d = e("./constants")
  24059. , p = {
  24060. debug: !1,
  24061. version: "2.25.6-0-gd87e5b1",
  24062. languageTag: r.valueFromHash("lang", null),
  24063. pageTitle: "",
  24064. authorizationHeader: u.getAuthorizationHeader(),
  24065. autoplay: r.valueFromHash("play", !1) || !r.inIframe(),
  24066. logLevel: r.valueFromHash("log", 2),
  24067. skyboxRadius: 2500,
  24068. modelBoundsPadding: 5,
  24069. showNeighbors: !1,
  24070. brand: r.valueFromHash("brand", !0),
  24071. showHighlights: r.valueFromHash("hhl", !0) && r.valueFromHash("hr", 1),
  24072. startHighlights: r.valueFromHash("hl", -1),
  24073. specialEdition: r.valueFromHash("bn", 0),
  24074. useWheel: r.valueFromHash("wh", !0),
  24075. crossOrigin: "anonymous",
  24076. fancierTransition: !1,
  24077. wireframe: !1,
  24078. skyboxWireframe: !1,
  24079. modelAlpha: 1,
  24080. highlightPanoSelection: !1,
  24081. showSweeps: !0,
  24082. showSkyboxes: !1,
  24083. showMesh: !0,
  24084. showFloors: !1,
  24085. showFloorDuration: 300,
  24086. showFloorDelay: 300,
  24087. hideFloorDuration: 300,
  24088. hideFloorDelay: 0,
  24089. reticuleOpacityTransitionTime: 250,
  24090. reticuleColor: s.newBlue,
  24091. markerOpacityTransitionTime: 500,
  24092. guiAnimationSpeed: 250,
  24093. highlightAnimationDuration: 500,
  24094. modelComponentLoadSpinnerDelay: 150,
  24095. captureErrors: !1,
  24096. maxMobileTextures: 6,
  24097. minimalMemoryMode: r.valueFromHash("m3", r.isMobile()),
  24098. startupFlyinDelay: 3e3,
  24099. dollhouseDefault: {
  24100. minDistance: 15,
  24101. maxDistance: 50,
  24102. minPolarAngle: n.Math.degToRad(10),
  24103. maxPolarAngle: n.Math.degToRad(90)
  24104. },
  24105. hideReticuleTimeout: 1e3,
  24106. analytics: {
  24107. inactivityThreshold: 30,
  24108. sessionTrackingRate: .15,
  24109. maxTrackedErrors: 20,
  24110. sessionDurationPingFrequency: 10,
  24111. sessionDurationTimeout: 15
  24112. },
  24113. flydown: {
  24114. movementEasing: "easeInOutQuad",
  24115. movementDelay: .001,
  24116. rotationEasing: "easeInOutQuad",
  24117. rotationDelay: .5,
  24118. modelTextureDelay: .75,
  24119. skyboxDelay: .75
  24120. },
  24121. transition: {
  24122. flySpeed: .01,
  24123. flyTime: 750,
  24124. flytimeMaxDistanceThreshold: 5,
  24125. flytimeDistanceMultiplier: 150,
  24126. aimTime: 1500,
  24127. aimSlowFactor: 1.5,
  24128. blur: .8,
  24129. movementEasing: "easeInOutQuad",
  24130. blendEasing: "easeInOutQuad",
  24131. fastForwardFactor: r.valueFromHash("mfis", 3)
  24132. },
  24133. show360Views: {
  24134. enabled: !0,
  24135. transitionTime: 1e3
  24136. },
  24137. quickstart: {
  24138. enabled: 1 === r.valueFromHash("qust", 0) || 1 === r.valueFromHash("qs", 0),
  24139. animation: 1400,
  24140. showTextDelay: 500,
  24141. fadeOutDelay: 3e3,
  24142. fovChange: 10
  24143. },
  24144. appConfig: {
  24145. webvr_version: null,
  24146. segment_key: null,
  24147. embedly_key: null,
  24148. branch_key: null,
  24149. keen_write_key: null,
  24150. keen_project_id: null
  24151. },
  24152. vr: {
  24153. enabled: !0,
  24154. allowWebVR: !1,
  24155. option: r.valueFromHash("vr", a.CONTEXTUAL)
  24156. },
  24157. share: {
  24158. enabled: !r.valueFromHash("mls", 0) && r.valueFromHash("brand", !0)
  24159. },
  24160. input: {
  24161. longTapThreshold: 200,
  24162. moveToleranceNDC: .08,
  24163. touchMoveThreshold: 25
  24164. },
  24165. help: {
  24166. modalStayDuration: 600
  24167. },
  24168. immersive: {
  24169. timeToShowAgain: 1250,
  24170. uiStayDuration: 600
  24171. },
  24172. tourInteraction: {
  24173. disabled: "0" === r.valueFromHash("tourcta", null),
  24174. showPauseButton: 1e3,
  24175. showModal: 1500,
  24176. allowNextClick: 200,
  24177. largeModal: "1" === r.valueFromHash("tourcta", null),
  24178. smallModal: "2" === r.valueFromHash("tourcta", null)
  24179. },
  24180. labels: {
  24181. enabled: !1,
  24182. hideUntilStart: !0,
  24183. fadeInDuration: 250,
  24184. fadeInDelay: 250,
  24185. fadeOutDuration: 250,
  24186. fadeOutDelay: 0,
  24187. zoomHideThreshhold: {
  24188. mobile: r.isSmallScreen() ? .45 : .6,
  24189. desktop: 2
  24190. },
  24191. zoomTruncateThreshhold: {
  24192. mobile: r.isSmallScreen() ? .35 : .45,
  24193. desktop: .85
  24194. },
  24195. minLengthForTruncate: 16,
  24196. truncateLength: 12,
  24197. truncateSuffix: "..."
  24198. },
  24199. tags: {
  24200. enabled: r.valueFromHash("mt", 1),
  24201. startup: {
  24202. hideUntilStart: !0,
  24203. fadeInDuration: 500,
  24204. fadeInDelay: 100
  24205. },
  24206. visibility: {
  24207. anyDistance: !0,
  24208. visibleDistance: 8,
  24209. cameraClearance: .1,
  24210. alphaTestLevel: .05,
  24211. hideViaFloor: !0,
  24212. hideOffScreenDisc: !1,
  24213. hideOffScreenObject: !1
  24214. },
  24215. disc: {
  24216. opacity: 1,
  24217. disabledOpacity: .5,
  24218. scale: {
  24219. nearBound: 1.5,
  24220. farBound: 4.8,
  24221. linkFarBound: !1,
  24222. linkPercent: 40,
  24223. maxSize: 80,
  24224. minSize: 40,
  24225. baseViewportSize: 800,
  24226. responsiveness: 100
  24227. }
  24228. },
  24229. pole: {
  24230. enabled: !0,
  24231. height: .5,
  24232. width: 2,
  24233. opacity: .5,
  24234. color: "white"
  24235. },
  24236. navigate: {
  24237. nearestPano: !0,
  24238. lineOfSight: !0,
  24239. reactivate: !0,
  24240. aimAt: "disc",
  24241. tiltTolerance: 25,
  24242. rotateSpeedFactor: .6
  24243. }
  24244. },
  24245. path: {
  24246. color: s.newBlue,
  24247. colorUp: s._desat(s.newBlue, .5),
  24248. colorDown: s._darken(s.newBlue, .35),
  24249. opacity: .5,
  24250. style: "ribbon",
  24251. height: .025,
  24252. ribbonWidth: .24,
  24253. outsideHeight: .5,
  24254. waypointRadius: .5,
  24255. waypointIndoorRadius: .24,
  24256. waypointPulse: 1e3,
  24257. typ: l.BLACK,
  24258. meshFree: r.valueFromHash("mf", 1),
  24259. mapGuides: r.valueFromHash("guides", !0),
  24260. fadeInTime: 400,
  24261. fadeOutTime: 300
  24262. },
  24263. warp: {
  24264. nearPanoDist: .1,
  24265. matchCam: !1,
  24266. blur: .33,
  24267. fastTime: 1500,
  24268. teleportTime: 1500,
  24269. outsideTime: 2e3,
  24270. lookAheadMax: .3,
  24271. lookAheadDist: 2.5,
  24272. softPushDist: .37,
  24273. softPushEnd: .3,
  24274. softBendAngle: 8,
  24275. softBendTilt: 4,
  24276. softBendEnd: .3,
  24277. doBurns: r.valueFromHash("kb", !0),
  24278. burnsAngle: 35,
  24279. minBurnsAngle: 35,
  24280. minDownAngle: -35,
  24281. maxTurnPerSec: 280,
  24282. maxAimPerSec: 35,
  24283. minRotation: 12,
  24284. maxAimRotation: 33.2,
  24285. turnFriction: .2,
  24286. flySpeed: .01,
  24287. minWarpTime: 1200,
  24288. warpInterruptionRedirectTime: 500,
  24289. tourStepDelay: r.valueFromHash("st", 0),
  24290. walkDelay: 0,
  24291. walkMaxDist: 50,
  24292. walkMinDist: .8,
  24293. walkSlideShowThreshhold: 3e3,
  24294. walkExtraPanosDistance: .4,
  24295. timePerMeter: 800,
  24296. motionLeadTime: 500,
  24297. movementEasing: "easeInOutQuad",
  24298. blendEasing: "easeInOutQuad",
  24299. showBunny: !1,
  24300. loop: r.valueFromHash("lp", !1),
  24301. auto: r.valueFromHash("ts", -1),
  24302. eOrder: "YXZ",
  24303. stepFactor: .25,
  24304. brakeStrength: 2,
  24305. minBrakeAngle: .1,
  24306. maxBrakeAngle: 1.8,
  24307. climbEffort: 4
  24308. },
  24309. rotationFriction: .05,
  24310. rotationAccelerationInside: 4.5,
  24311. rotationAccelerationOutside: .15,
  24312. rotationAfterMoveMultiplier: 40,
  24313. rotationAfterMoveHistoryCount: 5,
  24314. panFriction: .09,
  24315. panAccelerationOutside: 60,
  24316. onload: r.valueFromHash("onload", o.PANORAMA),
  24317. zoomNearLimit: .1,
  24318. zoomFarLimit: 10,
  24319. navigation: {
  24320. panoScores: !1,
  24321. mouseDirection: !0,
  24322. filterStrictness: .75,
  24323. angleFactor: -30,
  24324. directionFactor: 10,
  24325. distanceFactor: -1,
  24326. optionalityFactor: 3
  24327. },
  24328. sdkInit: !1,
  24329. secretPanelWord: [38, 38, 40, 40, 37, 39, 37, 39, 66, 65],
  24330. console: r.valueFromHash("console", !1),
  24331. noMeshFloorPositionOffset: new n.Vector3(0,-1.2,0),
  24332. panoramaNeighbourMaxDistance: 5,
  24333. panoFloorClickRadius: .35,
  24334. showScreenshotLocations: !1,
  24335. showAxis: !1,
  24336. showNeighbourRaycasts: !1,
  24337. colorMarkerOnLoad: !1,
  24338. colorMarkerByFloor: !1,
  24339. tiling: {
  24340. panoPreRenderRepeatDelay: 2500,
  24341. panoPreRenderDelay: 500,
  24342. preRenderTourPanos: r.valueFromHash("tileprerender", 0),
  24343. tilingFlagNames: ["usetiles", "tiles"],
  24344. maxNavPanoQuality: r.valueFromHash("maxtileq", null),
  24345. maxZoomPanoQuality: r.valueFromHash("maxztileq", null),
  24346. overlayStyle: r.valueFromHash("tileoverlay", 0),
  24347. uploadIntervalDelay: r.valueFromHash("tileupdelay", 10),
  24348. initialIntervalDelay: r.valueFromHash("itiledelay", 0),
  24349. maxNonBaseUploadsPerFrame: r.valueFromHash("maxnbtpf", 2),
  24350. maxBaseUploadsPerFrame: r.valueFromHash("maxbtpf", 6),
  24351. customCompression: r.valueFromHash("tilecustcomp", 0),
  24352. mobileHighQualityOverride: !1,
  24353. allowUltraHighResolution: !1
  24354. },
  24355. zoom: {
  24356. enabled: !1,
  24357. forceOff: r.valueFromHash("nozoom", 0),
  24358. overridemax: r.valueFromHash("maxzoom", null),
  24359. overridemin: r.valueFromHash("minzoom", null),
  24360. max: d.highQualityMaxZoom,
  24361. min: 1,
  24362. transitionStyle: r.valueFromHash("zoomtrans", 1),
  24363. activationThreshold: 1.1,
  24364. restoreTime: 500
  24365. },
  24366. profiling: {
  24367. enabled: r.valueFromHash("mem", !1)
  24368. }
  24369. };
  24370. p = h.deepExtend(p, d, {
  24371. insideFOV: r.valueFromHash("fov", d.insideFOV),
  24372. insideFOVMax: r.valueFromHash("fovmax", d.insideFOVMax),
  24373. panorama: {
  24374. transitionTime: 1e3,
  24375. modelAlpha: 0,
  24376. modelAlphaDelay: p.flydown.modelTextureDelay,
  24377. modelAlphaLength: 1,
  24378. skyboxOpacity: 1,
  24379. skyboxOpacityDelay: p.flydown.skyboxDelay,
  24380. skyboxOpacityLength: .9,
  24381. fovLength: 1,
  24382. fovDelay: 0,
  24383. cameraMatrixDuration: .8,
  24384. cameraMatrixDelay: 0,
  24385. cameraMatrixEase: c.easeInCubic,
  24386. reticuleOpacity: 1,
  24387. markerOpacity: .3,
  24388. markerOpacityOnHover: 1
  24389. },
  24390. dollhouse: {
  24391. transitionTime: 1e3,
  24392. modelAlpha: 1,
  24393. modelAlphaDelay: 0,
  24394. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  24395. skyboxOpacity: 0,
  24396. skyboxOpacityDelay: 0,
  24397. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  24398. fovLength: 1,
  24399. fovDelay: 0,
  24400. cameraMatrixDuration: .8,
  24401. cameraMatrixDelay: .3,
  24402. cameraMatrixEase: c.easeInCubic,
  24403. reticuleOpacity: 1,
  24404. markerOpacity: 0,
  24405. markerOpacityOnHover: 0
  24406. },
  24407. floorplan: {
  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: .5,
  24418. cameraMatrixDelay: 0,
  24419. cameraMatrixEase: c.easeOutCubic,
  24420. reticuleOpacity: 1,
  24421. markerOpacity: 0,
  24422. markerOpacityOnHover: 0,
  24423. cameraHeight: 50
  24424. },
  24425. transitioning: {
  24426. reticuleOpacity: 0,
  24427. markerOpacity: .3,
  24428. markerOpacityOnHover: 1
  24429. },
  24430. "floorplan-dollhouse": {
  24431. rotationDelay: 0,
  24432. rotationDuration: 1
  24433. },
  24434. "floorplan-panorama": {
  24435. rotationDelay: .5,
  24436. rotationDuration: 1
  24437. },
  24438. "dollhouse-panorama": {
  24439. rotationDelay: .5,
  24440. rotationDuration: 1
  24441. },
  24442. "dollhouse-floorplan": {
  24443. rotationDelay: 0,
  24444. rotationDuration: 1,
  24445. cameraMatrixDuration: 1.05,
  24446. cameraMatrixDelay: .5
  24447. },
  24448. "panorama-dollhouse": {
  24449. rotationDelay: 0,
  24450. rotationDuration: .5
  24451. },
  24452. "panorama-floorplan": {
  24453. transitionTime: 1500,
  24454. rotationDelay: 0,
  24455. rotationDuration: .5
  24456. }
  24457. }),
  24458. p.path.meshFree && (p.path.typ = l.WALK),
  24459. p.zoom.max = p.zoom.overridemax || p.zoom.max,
  24460. p.zoom.min = p.zoom.overridemin || p.zoom.min,
  24461. t.exports = p
  24462. }
  24463. , {
  24464. "./constants": 8,
  24465. "./enum/Colors": 19,
  24466. "./enum/VROption": 47,
  24467. "./enum/Viewmode": 51,
  24468. "./enum/WarpStyle": 52,
  24469. "./util/browser": 182,
  24470. "./util/common": 185,
  24471. "./util/easing": 186,
  24472. "./util/showcase": 193,
  24473. three: 217
  24474. }],
  24475. 167: [function(e, t, i) {
  24476. "use strict";
  24477. var n = e("three")
  24478. , r = e("./settings")
  24479. , 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"
  24480. , a = "precision highp float;\nprecision highp int;\n\nuniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n";
  24481. t.exports = {
  24482. basicTextured: {
  24483. uniforms: {
  24484. tDiffuse: {
  24485. type: "t",
  24486. value: null
  24487. },
  24488. alpha: {
  24489. type: "f",
  24490. value: 1
  24491. }
  24492. },
  24493. vertexShader: "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  24494. 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}"
  24495. },
  24496. copyCubeMap: {
  24497. uniforms: {
  24498. tDiffuse: {
  24499. type: "t",
  24500. value: null
  24501. },
  24502. alpha: {
  24503. type: "f",
  24504. value: 1
  24505. }
  24506. },
  24507. 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}",
  24508. 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}"
  24509. },
  24510. cube: {
  24511. uniforms: {
  24512. map: {
  24513. type: "t",
  24514. value: null
  24515. },
  24516. opacity: {
  24517. type: "f",
  24518. value: 1
  24519. }
  24520. },
  24521. vertexShader: o + "varying vec3 vWorldPosition;\n\nvoid main() {\n vWorldPosition = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n",
  24522. 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"
  24523. },
  24524. model: {
  24525. uniforms: {
  24526. map: {
  24527. type: "t",
  24528. value: null
  24529. },
  24530. modelAlpha: {
  24531. type: "f",
  24532. value: r.modelAlpha
  24533. },
  24534. opacity: {
  24535. type: "f",
  24536. value: 1
  24537. },
  24538. progress: {
  24539. type: "f",
  24540. value: 0
  24541. },
  24542. blackout: {
  24543. type: "i",
  24544. value: 0
  24545. },
  24546. pano0Map: {
  24547. type: "t",
  24548. value: null
  24549. },
  24550. pano0Position: {
  24551. type: "v3",
  24552. value: new n.Vector3
  24553. },
  24554. pano0Matrix: {
  24555. type: "m4",
  24556. value: new n.Matrix4
  24557. },
  24558. pano1Map: {
  24559. type: "t",
  24560. value: null
  24561. },
  24562. pano1Position: {
  24563. type: "v3",
  24564. value: new n.Vector3
  24565. },
  24566. pano1Matrix: {
  24567. type: "m4",
  24568. value: new n.Matrix4
  24569. }
  24570. },
  24571. 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",
  24572. 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"
  24573. },
  24574. hot:{
  24575. uniforms:{
  24576. color:{
  24577. type: "c",
  24578. value: new n.Color( 0xff2200 )
  24579. },
  24580. opac:{
  24581. type: "f",
  24582. value: 0
  24583. },
  24584. texture1:{
  24585. type: "t",
  24586. value: null
  24587. },
  24588. texture2:{
  24589. type: "t",
  24590. value: null
  24591. }
  24592. },
  24593. vertexShader:"varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv ;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  24594. 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 = tcolor1+ vec4(opac)*tcolor2;}\n"
  24595. },
  24596. modelOutside: {
  24597. uniforms: {
  24598. map: {
  24599. type: "t",
  24600. value: null
  24601. },
  24602. opacity: {
  24603. type: "f",
  24604. value: 1
  24605. }
  24606. },
  24607. vertexShader: o + "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  24608. 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"
  24609. },
  24610. ribbon: {
  24611. uniforms: {
  24612. map: {
  24613. type: "t",
  24614. value: null
  24615. },
  24616. opacity: {
  24617. type: "f",
  24618. value: 1
  24619. },
  24620. color: {
  24621. type: "c",
  24622. value: new n.Color(r.path.color)
  24623. }
  24624. },
  24625. 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",
  24626. 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"
  24627. },
  24628. waypoint: {
  24629. uniforms: {
  24630. map: {
  24631. type: "t",
  24632. value: null
  24633. },
  24634. opacity: {
  24635. type: "f",
  24636. value: 1
  24637. },
  24638. pulse: {
  24639. type: "f",
  24640. value: 1
  24641. },
  24642. nearFade: {
  24643. type: "v2",
  24644. value: new n.Vector2(2 * r.insideNear,2 * r.path.waypointIndoorRadius)
  24645. },
  24646. color: {
  24647. type: "c",
  24648. value: new n.Color(r.reticuleColor)
  24649. }
  24650. },
  24651. 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",
  24652. 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"
  24653. },
  24654. modelDebug: {
  24655. uniforms: {
  24656. map: {
  24657. type: "t",
  24658. value: null
  24659. },
  24660. modelAlpha: {
  24661. type: "f",
  24662. value: r.modelAlpha
  24663. },
  24664. depthmapRatio: {
  24665. type: "f",
  24666. value: 0
  24667. },
  24668. opacity: {
  24669. type: "f",
  24670. value: 1
  24671. },
  24672. progress: {
  24673. type: "f",
  24674. value: 0
  24675. },
  24676. considerOcclusion: {
  24677. type: "i",
  24678. value: r.fancierTransition
  24679. },
  24680. highlightPanoSelection: {
  24681. type: "i",
  24682. value: 0
  24683. },
  24684. useThirdPano: {
  24685. type: "i",
  24686. value: r.useThirdPano
  24687. },
  24688. pano0Map: {
  24689. type: "t",
  24690. value: null
  24691. },
  24692. pano0Depth: {
  24693. type: "t",
  24694. value: null
  24695. },
  24696. pano0Position: {
  24697. type: "v3",
  24698. value: new n.Vector3
  24699. },
  24700. pano0Matrix: {
  24701. type: "m4",
  24702. value: new n.Matrix4
  24703. },
  24704. pano0Weight: {
  24705. type: "f",
  24706. value: r.transition.pano0Weight
  24707. },
  24708. pano1Map: {
  24709. type: "t",
  24710. value: null
  24711. },
  24712. pano1Depth: {
  24713. type: "t",
  24714. value: null
  24715. },
  24716. pano1Position: {
  24717. type: "v3",
  24718. value: new n.Vector3
  24719. },
  24720. pano1Matrix: {
  24721. type: "m4",
  24722. value: new n.Matrix4
  24723. },
  24724. pano1Weight: {
  24725. type: "f",
  24726. value: r.transition.pano1Weight
  24727. },
  24728. pano2Map: {
  24729. type: "t",
  24730. value: null
  24731. },
  24732. pano2Depth: {
  24733. type: "t",
  24734. value: null
  24735. },
  24736. pano2Position: {
  24737. type: "v3",
  24738. value: new n.Vector3
  24739. },
  24740. pano2Matrix: {
  24741. type: "m4",
  24742. value: new n.Matrix4
  24743. },
  24744. pano2Weight: {
  24745. type: "f",
  24746. value: r.transition.pano2Weight
  24747. }
  24748. },
  24749. 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",
  24750. 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"
  24751. },
  24752. customDepth: {
  24753. uniforms: {
  24754. panoPosition: {
  24755. type: "v3",
  24756. value: new n.Vector3
  24757. }
  24758. },
  24759. 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",
  24760. 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"
  24761. },
  24762. skysphere: {
  24763. uniforms: {
  24764. radius: {
  24765. type: "f",
  24766. value: 0
  24767. }
  24768. },
  24769. 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",
  24770. 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"
  24771. },
  24772. tagDisc: {
  24773. uniforms: {
  24774. opacity: {
  24775. type: "f",
  24776. value: 0
  24777. },
  24778. color: {
  24779. type: "c",
  24780. value: new n.Color
  24781. },
  24782. bg: {
  24783. type: "t",
  24784. value: null
  24785. },
  24786. mask: {
  24787. type: "t",
  24788. value: null
  24789. }
  24790. },
  24791. vertexShader: o + "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  24792. 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"
  24793. }
  24794. }
  24795. }
  24796. , {
  24797. "./settings": 166,
  24798. three: 217
  24799. }],
  24800. 168: [function(e, t, i) {
  24801. (function(i) {
  24802. "use strict";
  24803. var n = e("three")
  24804. , r = (e("url"),
  24805. e("./util/ajax"))
  24806. , o = e("./settings")
  24807. , a = e("./util/logger")
  24808. , s = e("./util/math")
  24809. , l = e("./util/showcase")
  24810. , c = e("./objects/Panorama")
  24811. , h = new a(i)
  24812. , u = e("./model/Model")
  24813. , d = e("./shaders")
  24814. , p = e("./util/transitions")
  24815. , f = e("./objects/Chunk")
  24816. , g = e("./objects/Reticule")
  24817. , m = e("./objects/Skybox")
  24818. , v = e("./objects/Floor")
  24819. , A = e("./cameras/DollhouseCamera")
  24820. , y = e("./cameras/FloorplanCamera")
  24821. , C = e("./cameras/PanoramaCamera")
  24822. , I = e("./controls/DollhouseControls")
  24823. , E = e("./controls/FloorplanControls")
  24824. , b = e("./controls/PanoramaControls");
  24825. n.ImageUtils.crossOrigin = o.crossOrigin,
  24826. t.exports = {
  24827. shaders: d,
  24828. transitions: p,
  24829. Model: u,
  24830. Chunk: f,
  24831. Floor: v,
  24832. Skybox: m,
  24833. Reticule: g,
  24834. Panorama: c,
  24835. DollhouseCamera: A,
  24836. FloorplanCamera: y,
  24837. PanoramaCamera: C,
  24838. DollhouseControls: I,
  24839. FloorplanControls: E,
  24840. PanoramaControls: b,
  24841. getModel: function(e) {
  24842. if (!e.url)
  24843. throw 'getModel(): missing parameter "url"';
  24844. e.autoload = void 0 === e.autoload || e.autoload;
  24845. var t = l.parseSidUrl(e.url);
  24846. e.urlBase = t.urlBase,
  24847. e.urlModel = t.urlModel,
  24848. e.urlFiles = t.urlFiles;
  24849. var i = this._getPlatformError();
  24850. return i ? $.Deferred().reject(i).promise() : (this.options = e,
  24851. this._loadModel().then(this._buildModel.bind(this)))
  24852. },
  24853. _getPlatformError: function() {
  24854. 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"
  24855. },
  24856. _loadModel: function() {
  24857. return r.get(this.options.urlModel, {
  24858. responseType: "json",
  24859. prefetchFrom: "model",
  24860. auth: l.getAuthorizationHeader()
  24861. }).then(null, function() {
  24862. return h.warn("Model loading failed at initial metadata load"),
  24863. "loading-failed"
  24864. })
  24865. },
  24866. _buildModel: function(e) {
  24867. e = l.normalizeModeldata(e, s);
  24868. var t = new u(this.options,e);
  24869. return this.options.autoload ? t.load(!0) : $.when(t)
  24870. }
  24871. }
  24872. }
  24873. ).call(this, "/js/showcase.js")
  24874. }
  24875. , {
  24876. "./cameras/DollhouseCamera": 5,
  24877. "./cameras/FloorplanCamera": 6,
  24878. "./cameras/PanoramaCamera": 7,
  24879. "./controls/DollhouseControls": 10,
  24880. "./controls/FloorplanControls": 11,
  24881. "./controls/PanoramaControls": 13,
  24882. "./model/Model": 139,
  24883. "./objects/Chunk": 144,
  24884. "./objects/Floor": 146,
  24885. "./objects/Panorama": 148,
  24886. "./objects/Reticule": 149,
  24887. "./objects/Skybox": 152,
  24888. "./settings": 166,
  24889. "./shaders": 167,
  24890. "./util/ajax": 181,
  24891. "./util/logger": 189,
  24892. "./util/math": 190,
  24893. "./util/showcase": 193,
  24894. "./util/transitions": 195,
  24895. three: 217,
  24896. url: 208
  24897. }],
  24898. 169: [function(e, t, i) {
  24899. "use strict";
  24900. function n() {
  24901. var e = {
  24902. renderTarget: null,
  24903. inUse: !1,
  24904. size: -1,
  24905. pano: null
  24906. };
  24907. return e
  24908. }
  24909. function r(e) {
  24910. M.push(e)
  24911. }
  24912. function o(e) {
  24913. var t = n();
  24914. return t.inUse = !0,
  24915. t.size = e,
  24916. r(t),
  24917. t
  24918. }
  24919. function a(e) {
  24920. for (var t = 0; t < M.length; t++) {
  24921. var i = M[t];
  24922. if (!i.inUse && i.size === e)
  24923. return i.inUse = !0,
  24924. i
  24925. }
  24926. return null
  24927. }
  24928. function s(e) {
  24929. for (var t = 0; t < M.length; t++) {
  24930. var i = M[t];
  24931. if (i.renderTarget === e)
  24932. return i.inUse = !1,
  24933. !0
  24934. }
  24935. return !1
  24936. }
  24937. function l() {
  24938. this.tileDirectory = {},
  24939. this.activeRenderTargetDescriptors = {},
  24940. this.activePanos = [],
  24941. this.panoLODDescriptors = {},
  24942. this.panoDescriptors = {},
  24943. this.tileTrees = {},
  24944. this.sceneRenderer = null,
  24945. this.tileDownloader = null,
  24946. this.forceQueue = [],
  24947. this.uploadQueues = {},
  24948. this.uploadInterval = null,
  24949. this.uploadIntervalCancelled = !1,
  24950. this.usingTileOverlay = !1,
  24951. this.overlayTilesLoaded = !1,
  24952. this.overlayTileBase = null,
  24953. this.overlayTilesBasic = {},
  24954. this.overlayTilesEnhanced = {},
  24955. this.zoomRenderTarget = null,
  24956. this.zoomPano = null,
  24957. this.zoomingActive = !1,
  24958. this.zoomPanoId = null,
  24959. this.zoomPanoRenderingDisabled = !1,
  24960. this.direction = new h.Vector3,
  24961. this.initTime = -1,
  24962. this.maxBaseUploadsPerFrame = x,
  24963. this.maxNonBaseUploadsPerFrame = T
  24964. }
  24965. function c() {
  24966. this.uploadIntervalCancelled || (this.overlayTilesLoaded || !this.usingTileOverlay ? (b = !0,
  24967. this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  24968. this.peekNextFromUploadQueue() ? this.refreshUploadInterval(w) : this.uploadInterval = null) : this.refreshUploadInterval(this.uploadIntervalDelay))
  24969. }
  24970. var h = e("three")
  24971. , u = e("../exception/BasicException")
  24972. , d = e("../settings")
  24973. , p = e("../enum/PanoSizeClass")
  24974. , f = (e("../objects/Panorama"),
  24975. e("../enum/PanoRendererEvents"))
  24976. , g = e("../enum/SceneRendererEvents")
  24977. , m = e("../enum/TileDownloaderEvents")
  24978. , v = e("../enum/Vectors")
  24979. , A = (e("../enum/GLCubeFaces"),
  24980. e("../objects/Panorama"),
  24981. e("./TileTree"))
  24982. , y = (e("./TileDownloader"),
  24983. e("./TilePrioritizer"))
  24984. , C = e("./TileUtils")
  24985. , p = e("../enum/PanoSizeClass")
  24986. , I = (e("../util/browser"),
  24987. e("../util/panorama"))
  24988. , E = e("events").EventEmitter
  24989. , b = !1
  24990. , w = d.tiling.uploadIntervalDelay
  24991. , _ = d.tiling.initialIntervalDelay
  24992. , T = d.tiling.maxNonBaseUploadsPerFrame
  24993. , x = d.tiling.maxBaseUploadsPerFrame
  24994. , S = {
  24995. Base: 0,
  24996. Remaining: 1
  24997. }
  24998. , M = [];
  24999. l.prototype = Object.create(E.prototype),
  25000. l.prototype.init = function(e, t, i) {
  25001. this.sceneRenderer = e,
  25002. this.tileDownloader = t,
  25003. this.qualityManager = i,
  25004. this.bindEvents(),
  25005. this.sceneRenderer.on(g.ContextCreated, this.loadOverlayTiles.bind(this)),
  25006. this.initTime = performance.now()
  25007. }
  25008. ,
  25009. l.prototype.getActivePanoTextures = function(e) {
  25010. e = e || [];
  25011. for (var t = 0; t < M.length; t++) {
  25012. var i = M[t];
  25013. i.renderTarget && i.renderTarget.texture && e.push(i.renderTarget.texture)
  25014. }
  25015. }
  25016. ,
  25017. l.prototype.hasQueuedTiles = function() {
  25018. var e = this.peekNextFromUploadQueue();
  25019. return null !== e && void 0 !== e
  25020. }
  25021. ,
  25022. l.prototype.getActiveRenderTargetDescriptor = function(e) {
  25023. return this.activeRenderTargetDescriptors[e]
  25024. }
  25025. ,
  25026. l.prototype.setActiveRenderTargetDescriptor = function(e, t) {
  25027. this.activeRenderTargetDescriptors[e] = t
  25028. }
  25029. ,
  25030. l.prototype.loadOverlayTiles = function() {
  25031. if (0 !== d.tiling.overlayStyle) {
  25032. var e = 0
  25033. , t = function(t, n, r) {
  25034. t = n ? t[n] = this.sceneRenderer.initSizedTexture2D(C.TILE_SIZE, h.ClampToEdgeWrapping) : this.overlayTileBase = this.sceneRenderer.initSizedTexture2D(C.TILE_SIZE, h.ClampToEdgeWrapping),
  25035. this.sceneRenderer.uploadTexture2D(r, t, 0, 0, C.TILE_SIZE, C.TILE_SIZE),
  25036. e++,
  25037. e === i.length && (this.overlayTilesLoaded = !0)
  25038. }
  25039. .bind(this)
  25040. , i = [["images/outlineBase.png", t.bind(this, this.overlayTileBase, null)], ["images/outlineBasic512.png", t.bind(this, this.overlayTilesBasic, 256)], ["images/outlineBasic512.png", t.bind(this, this.overlayTilesBasic, 512)], ["images/outlineBasic1024.png", t.bind(this, this.overlayTilesBasic, 1024)], ["images/outlineBasic2048.png", t.bind(this, this.overlayTilesBasic, 2048)], ["images/outlineBasic4096.png", t.bind(this, this.overlayTilesBasic, 4096)], ["images/outlineEnhanced512.png", t.bind(this, this.overlayTilesEnhanced, 256)], ["images/outlineEnhanced512.png", t.bind(this, this.overlayTilesEnhanced, 512)], ["images/outlineEnhanced1024.png", t.bind(this, this.overlayTilesEnhanced, 1024)], ["images/outlineEnhanced2048.png", t.bind(this, this.overlayTilesEnhanced, 2048)], ["images/outlineEnhanced4096.png", t.bind(this, this.overlayTilesEnhanced, 4096)]];
  25041. i.forEach(function(e) {
  25042. this.tileDownloader.loadImage(e[0], 0, e[1])
  25043. }
  25044. .bind(this)),
  25045. this.usingTileOverlay = !0
  25046. } else
  25047. this.usingTileOverlay = !1
  25048. }
  25049. ,
  25050. l.prototype.bindEvents = function() {
  25051. this.tileDownloader.on(m.TileDownloadSuccess, this.onTileDownloaded.bind(this))
  25052. }
  25053. ,
  25054. l.prototype.setupZoomRenderTarget = function() {
  25055. if (this.qualityManager.getMaxZoomPanoSize() >= this.qualityManager.getMaxNavPanoSize()) {
  25056. if (this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize())
  25057. return;
  25058. var e = this.zoomRenderTarget;
  25059. if (this.zoomRenderTarget = this.initTiledPano(this.qualityManager.getMaxZoomPanoSize(), !1),
  25060. e) {
  25061. var t = e.width
  25062. , i = this.zoomRenderTarget.width;
  25063. this.sceneRenderer.copyCubeMap(e.texture, this.zoomRenderTarget, t, t, i, i),
  25064. e.texture.dispose(),
  25065. e.texture.loaded = !1,
  25066. e.texture.version = 0,
  25067. this.sceneRenderer.deallocateCubeTexture(e.texture),
  25068. e.texture = null
  25069. }
  25070. this.zoomPanoRenderingDisabled = !1
  25071. } else
  25072. this.zoomPanoRenderingDisabled = !0
  25073. }
  25074. ,
  25075. l.prototype.enableUltraHighQualityMode = function(e) {
  25076. if (!this.qualityManager.ultraHighQualityModeEnabled()) {
  25077. var t = this.qualityManager.getPanoSize(p.ULTRAHIGH);
  25078. this.tileDownloader.testDownload(t, C.TILE_SIZE, function(t) {
  25079. t && (this.qualityManager.enableUltraHighQualityMode(),
  25080. this.setupZoomRenderTarget(),
  25081. e())
  25082. }
  25083. .bind(this))
  25084. }
  25085. }
  25086. ,
  25087. l.prototype.activateTiledPano = function(e, t, i) {
  25088. i && this.clearAllQueuedUploads();
  25089. for (var n = 0; n < C.FACES_PER_PANO; n++)
  25090. this.initTileTree(e.id, n, this.qualityManager.getMaxPossiblePanoSize());
  25091. this.linkAllTilesAndNodes(e);
  25092. var r = this.getActiveRenderTargetDescriptor(e.id)
  25093. , l = t;
  25094. if (l > this.qualityManager.getMaxNavPanoSize() && (l = this.qualityManager.getMaxNavPanoSize()),
  25095. !r || l !== r.size) {
  25096. if (r && s(r.renderTarget),
  25097. r = a(l),
  25098. !r) {
  25099. var c = this.initTiledPano(l, !1);
  25100. r = o(c.width),
  25101. r.renderTarget = c
  25102. }
  25103. r.pano = e,
  25104. this.resetPanoDescriptor(e.id),
  25105. this.resetPanoLODDescriptors(e.id),
  25106. this.resetRenderStatus(e.id, !0, !0)
  25107. }
  25108. this.setActiveRenderTargetDescriptor(e.id, r);
  25109. var h = i ? 0 : 1;
  25110. return this.updateActivePanos(e, h),
  25111. r.renderTarget
  25112. }
  25113. ,
  25114. l.prototype.deactivateTiledPano = function(e) {
  25115. var t = this.getActiveRenderTargetDescriptor(e.id);
  25116. this.isRenderTargetDescriptorValid(t) && s(t.renderTarget),
  25117. this.setActiveRenderTargetDescriptor(e.id, null);
  25118. var i = this.getUploadQueueForPano(e.id);
  25119. this.clearUploadQueue(i),
  25120. this.updateActivePanos()
  25121. }
  25122. ,
  25123. l.prototype.updateActivePanos = function() {
  25124. var e = [];
  25125. return function(t, i) {
  25126. e.length = 0;
  25127. for (var n = 0; n < this.activePanos.length; n++) {
  25128. t && e.length === i && e.push(t);
  25129. var r = this.activePanos[n]
  25130. , o = this.getActiveRenderTargetDescriptor(r.id);
  25131. t && r.id === t.id || !this.isRenderTargetDescriptorValid(o) || e.push(r)
  25132. }
  25133. t && i >= e.length && e.push(t),
  25134. this.activePanos.length = 0,
  25135. this.activePanos.push.apply(this.activePanos, e)
  25136. }
  25137. }(),
  25138. l.prototype.getActivePanoCount = function() {
  25139. return this.activePanos.length
  25140. }
  25141. ,
  25142. l.prototype.resetRenderStatus = function(e, t, i, n) {
  25143. var r = null;
  25144. n && (r = A.getLevelCountForSize(C.TILE_SIZE, n) + 1);
  25145. for (var o = function(e, n, r, o) {
  25146. i && (n.tile.zoomUploaded = !1),
  25147. t && (n.tile.uploaded = !1)
  25148. }, a = 0; a < C.FACES_PER_PANO; a++) {
  25149. var s = this.getTileTree(e, a);
  25150. s.breadthFirst({
  25151. callback: o.bind(this, a),
  25152. minLevel: r
  25153. })
  25154. }
  25155. }
  25156. ,
  25157. l.prototype.copyBaseRenderStatusToZoomed = function(e) {
  25158. for (var t = A.getLevelCountForSize(C.TILE_SIZE, this.qualityManager.getMaxNavPanoSize()), i = function(e, t, i, n) {
  25159. t.tile.zoomUploaded = t.tile.uploaded,
  25160. t.zoomCovered = t.covered
  25161. }, n = 0; n < C.FACES_PER_PANO; n++) {
  25162. var r = this.getTileTree(e, n);
  25163. r.breadthFirst({
  25164. callback: i.bind(this, n),
  25165. maxLevel: t
  25166. })
  25167. }
  25168. }
  25169. ,
  25170. l.prototype.renderPanoTiles = function() {
  25171. var e = [];
  25172. return function(t, i, n, r) {
  25173. this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize() || this.zoomPanoRenderingDisabled || this.setupZoomRenderTarget(),
  25174. i = i || this.direction || v.FORWARD;
  25175. var o = this.getActiveRenderTargetDescriptor(t);
  25176. if (!this.isRenderTargetDescriptorValid(o))
  25177. throw new u("PanoRenderer.renderPanoTiles() -> Cannot render to a pano that is not activated.");
  25178. for (var a = 0; a < C.FACES_PER_PANO; a++) {
  25179. var s = this.getTileTree(t, a);
  25180. e.length = 0,
  25181. s.breadthFirst({
  25182. saveVisited: e
  25183. });
  25184. for (var l = 0; l < e.length; l++) {
  25185. var c = e[l];
  25186. this.queueTileUpload(c.tile, !1, r || 0 === l && n)
  25187. }
  25188. }
  25189. this.updateDirection(i)
  25190. }
  25191. }(),
  25192. l.prototype.isRenderTargetDescriptorValid = function(e) {
  25193. return e && e.renderTarget
  25194. }
  25195. ,
  25196. l.prototype.isPanoActive = function(e) {
  25197. var t = this.getActiveRenderTargetDescriptor(e);
  25198. return this.isRenderTargetDescriptorValid(t)
  25199. }
  25200. ,
  25201. l.prototype.isPanoZoomed = function(e) {
  25202. return this.zoomingActive && this.zoomPanoId === e
  25203. }
  25204. ,
  25205. l.prototype.initTileTree = function(e, t, i) {
  25206. var n = this.tileTrees[e];
  25207. n || (n = [],
  25208. this.tileTrees[e] = n);
  25209. var r = n[t];
  25210. if (!r) {
  25211. var o = A.getLevelCountForSize(C.TILE_SIZE, i);
  25212. r = new A(C.TILE_SIZE,o),
  25213. n[t] = r
  25214. }
  25215. }
  25216. ,
  25217. l.prototype.getTileTree = function(e, t) {
  25218. var i = this.tileTrees[e];
  25219. if (!i)
  25220. throw new u("PanoRenderer.getTileTree() -> Tree array not yet initialized!");
  25221. var n = i[t];
  25222. if (!n)
  25223. throw new u("PanoRenderer.getTileTree() -> Tree not yet initialized!");
  25224. return n
  25225. }
  25226. ,
  25227. l.prototype.initTiledPano = function(e, t) {
  25228. var i = this.sceneRenderer.renderer
  25229. , n = (i.context,
  25230. new h.WebGLRenderTargetCube(e,e,{
  25231. stencilBuffer: !1
  25232. }))
  25233. , r = new h.CubeTexture([]);
  25234. n.texture = r,
  25235. r.image = [null, null, null, null, null, null],
  25236. r.flipY = !0,
  25237. t ? (r.generateMipmaps = !0,
  25238. r.magFilter = h.LinearFilter,
  25239. r.minFilter = h.LinearMipMapLinearFilter) : (r.generateMipmaps = !1,
  25240. r.magFilter = h.LinearFilter,
  25241. r.minFilter = h.LinearFilter),
  25242. r.format = h.RGBAFormat,
  25243. i.setRenderTarget(n),
  25244. i.setRenderTarget(null);
  25245. var o = i.properties.get(r);
  25246. return o.__image__webglTextureCube = o.__webglTexture,
  25247. n
  25248. }
  25249. ,
  25250. l.prototype.getUploadQueueForPano = function(e) {
  25251. var t = this.uploadQueues[e];
  25252. return t || (t = [],
  25253. this.uploadQueues[e] = t),
  25254. t
  25255. }
  25256. ,
  25257. l.prototype.isTileUploaded = function(e) {
  25258. return this.isPanoZoomed(e.panoId) ? e.zoomUploaded : e.uploaded
  25259. }
  25260. ,
  25261. l.prototype.setUploaded = function(e, t) {
  25262. this.isPanoZoomed(e.panoId) ? e.zoomUploaded = t : e.uploaded = t
  25263. }
  25264. ,
  25265. l.prototype.queueTileUpload = function(e, t, i) {
  25266. var n = this.getActiveRenderTargetDescriptor(e.panoId);
  25267. if (this.isRenderTargetDescriptorValid(n) && e.downloaded && !this.isTileUploaded(e) && (!e.uploadQueued || i) && (!(e.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive)) {
  25268. var r = this.getUploadQueueForPano(e.panoId);
  25269. 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),
  25270. e.uploadQueued = !0,
  25271. this.uploadInterval || this.uploadIntervalCancelled || this.refreshUploadInterval(0))
  25272. }
  25273. }
  25274. ,
  25275. l.prototype.shoulPushToFrontOfQueue = function(e) {
  25276. return 0 === A.getLevelCountForSize(C.TILE_SIZE, e.panoSize)
  25277. }
  25278. ,
  25279. l.prototype.getTopUploadQueue = function() {
  25280. for (var e = null, t = null, i = S.Base; i <= S.Remaining; i++)
  25281. for (var n = 0; n < this.activePanos.length; n++)
  25282. if (e = this.activePanos[n],
  25283. t = this.getUploadQueueForPano(e.id),
  25284. t.length > 0)
  25285. switch (i) {
  25286. case S.Base:
  25287. if (0 === t[0].level)
  25288. return t;
  25289. break;
  25290. case S.Remaining:
  25291. return t
  25292. }
  25293. return null
  25294. }
  25295. ,
  25296. l.prototype.getNextFromUploadQueue = function() {
  25297. var e = function(e) {
  25298. var t = e.shift();
  25299. return t.uploadQueued = !1,
  25300. t
  25301. };
  25302. return function() {
  25303. if (this.forceQueue.length > 0)
  25304. return e(this.forceQueue);
  25305. var t = this.getTopUploadQueue();
  25306. return t && t.length > 0 ? e(t) : null
  25307. }
  25308. }(),
  25309. l.prototype.peekNextFromUploadQueue = function() {
  25310. if (this.forceQueue.length > 0)
  25311. return this.forceQueue[0];
  25312. var e = this.getTopUploadQueue();
  25313. return e && e.length > 0 ? e[0] : null
  25314. }
  25315. ,
  25316. l.prototype.clearAllQueuedUploads = function() {
  25317. this.clearAllUploadQueues(null, 0)
  25318. }
  25319. ,
  25320. l.prototype.clearAllQueuedUploadsForPano = function(e) {
  25321. this.clearAllUploadQueues(e, 0)
  25322. }
  25323. ,
  25324. l.prototype.clearAllUploadQueues = function(e, t) {
  25325. if (e)
  25326. this.clearUploadQueue(this.getUploadQueueForPano(e), t),
  25327. this.clearUploadQueue(this.forceQueue, t, e);
  25328. else {
  25329. for (var i = 0; i < this.activePanos.length; i++) {
  25330. var n = this.activePanos[i];
  25331. this.clearUploadQueue(this.getUploadQueueForPano(n.id), t)
  25332. }
  25333. this.clearUploadQueue(this.forceQueue, t)
  25334. }
  25335. }
  25336. ,
  25337. l.prototype.clearUploadQueue = function(e, t, i) {
  25338. void 0 !== t && null !== t || (t = 0);
  25339. for (var n = 0; n < e.length; ) {
  25340. var r = e[n];
  25341. (!i || i && i === r.tile.panoId) && r.level >= t ? (r.uploadQueued = !1,
  25342. e.splice(n, 1)) : n++
  25343. }
  25344. }
  25345. ,
  25346. l.prototype.refreshUploadInterval = function() {
  25347. var e = null;
  25348. return function(t) {
  25349. this.uploadIntervalCancelled || (e || (e = c.bind(this)),
  25350. null !== t && void 0 !== t || (t = w),
  25351. b || (t = _),
  25352. this.uploadInterval = window.setTimeout(e, t),
  25353. this.uploadIntervalDelay = t)
  25354. }
  25355. }(),
  25356. l.prototype.update = function() {
  25357. var e = performance.now()
  25358. , t = 0;
  25359. return function() {
  25360. this.uploadIntervalCancelled = !0,
  25361. window.clearTimeout(this.uploadInterval),
  25362. this.uploadInterval = null;
  25363. var i = performance.now() - e;
  25364. !(i > w || 0 === t) || !this.overlayTilesLoaded && this.usingTileOverlay || (this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  25365. e = performance.now()),
  25366. t++
  25367. }
  25368. }(),
  25369. l.prototype.updateUploadQueue = function(e, t) {
  25370. e || (e = 1);
  25371. for (var i = 0, n = 0; ; ) {
  25372. if (n >= t || i >= e)
  25373. break;
  25374. var r = this.getNextFromUploadQueue();
  25375. if (!r)
  25376. break;
  25377. if (0 !== r.level ? i++ : n++,
  25378. !(r.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive) {
  25379. var o = this.getActiveRenderTargetDescriptor(r.panoId);
  25380. this.isRenderTargetDescriptorValid(o) && this.uploadTile(r, r.forceUpload)
  25381. }
  25382. }
  25383. }
  25384. ,
  25385. l.prototype.updateDirection = function(e) {
  25386. if (e = e || this.direction) {
  25387. this.direction = e;
  25388. for (var t = 0; t < this.activePanos.length; t++) {
  25389. var i = this.activePanos[t]
  25390. , n = this.getUploadQueueForPano(i.id);
  25391. y.sortPanoTiles(n, i, this.direction)
  25392. }
  25393. }
  25394. }
  25395. ,
  25396. l.prototype.uploadTile = function() {
  25397. var e = {}
  25398. , t = (new h.Vector4,
  25399. d.tiling.overlayStyle);
  25400. return function(i, n) {
  25401. var r = i.panoId
  25402. , o = i.image
  25403. , a = i.tileSize
  25404. , s = i.panoSize
  25405. , l = i.tileIndex
  25406. , c = (i.faceTileIndex,
  25407. i.totalTiles)
  25408. , u = (i.face,
  25409. i.tileX)
  25410. , d = i.tileY
  25411. , p = !0
  25412. , g = !1
  25413. , m = (this.getPanoDescriptor(r),
  25414. this.getPanoLODDescriptor(r, s))
  25415. , v = this.getActiveRenderTargetDescriptor(r)
  25416. , A = v.renderTarget
  25417. , y = v.size;
  25418. if (this.isPanoZoomed(r) && (A = this.zoomRenderTarget,
  25419. y = this.qualityManager.getMaxZoomPanoSize()),
  25420. this.isRenderTargetDescriptorValid(v) || (p = !1,
  25421. g = !1),
  25422. n || (this.anyUploaded(i.node) && (p = !1,
  25423. g = !0),
  25424. this.isTileUploaded(i) && (p = !1,
  25425. g = !1)),
  25426. p) {
  25427. var C = u * a
  25428. , I = d * a
  25429. , E = a / s * y
  25430. , b = C / s * y
  25431. , w = I / s * y;
  25432. e[a] || (e[a] = this.sceneRenderer.initSizedTexture2D(a, h.ClampToEdgeWrapping));
  25433. var _ = e[a];
  25434. if (this.sceneRenderer.uploadTexture2D(o, _, 0, 0, a, a),
  25435. 1 === t || 2 === t) {
  25436. var T = 1 === t ? this.overlayTilesBasic : this.overlayTilesEnhanced;
  25437. this.sceneRenderer.renderToCubeMap(_, A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace),
  25438. this.sceneRenderer.renderToCubeMap(T[s], A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace, h.NormalBlending, !0, .5)
  25439. } else
  25440. this.sceneRenderer.renderToCubeMap(_, A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace);
  25441. m.uploadCount++,
  25442. this.emit(f.TileRenderSuccess, r, s, l, c),
  25443. m.uploadCount === c && this.emit(f.PanoRenderComplete, r, s, c),
  25444. this.setUploaded(i, !0),
  25445. this.addCoverageForNode(i.node)
  25446. } else
  25447. this.setUploaded(i, !1);
  25448. return i.uploadAttempted || (m.uploadAttempts++,
  25449. this.emit(f.TileUploadAttempted, r, s, l, c)),
  25450. i.uploadAttempted = !0,
  25451. m.uploadAttempts === c && this.emit(f.UploadAttemptedForAllTiles, r, s, c),
  25452. g
  25453. }
  25454. }(),
  25455. l.prototype.linkTileAndNode = function(e, t) {
  25456. t.tile = e,
  25457. e.node = t
  25458. }
  25459. ,
  25460. l.prototype.linkAllTilesAndNodes = function(e) {
  25461. for (var t = function(t, i, n, r, o) {
  25462. var a = this.getTileDirectoryEntry(e.id, i, r, o);
  25463. this.linkTileAndNode(a, n)
  25464. }, i = 0; i < C.FACES_PER_PANO; i++) {
  25465. var n = this.getTileTree(e.id, i);
  25466. n.breadthFirst({
  25467. callback: t.bind(this, n, i)
  25468. })
  25469. }
  25470. }
  25471. ,
  25472. l.prototype.anyUploaded = function(e) {
  25473. if (!e)
  25474. return !1;
  25475. if (e.tile && this.isTileUploaded(e.tile))
  25476. return !0;
  25477. if (e.children)
  25478. for (var t = 0; t < e.children.length; t++) {
  25479. var i = e.children[t];
  25480. if (this.anyUploaded(i))
  25481. return !0
  25482. }
  25483. return !1
  25484. }
  25485. ,
  25486. l.prototype.setNodeCovered = function(e, t) {
  25487. this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered = t : e.covered = t
  25488. }
  25489. ,
  25490. l.prototype.isNodeCovered = function(e) {
  25491. return !!e && (this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered : e.covered)
  25492. }
  25493. ,
  25494. l.prototype.addCoverageForNode = function(e) {
  25495. if (this.setNodeCovered(e, !0),
  25496. e.parent && e.covered) {
  25497. var t = e.parent;
  25498. this.nodeSubcovered(t) && this.addCoverageForNode(t, !0)
  25499. }
  25500. }
  25501. ,
  25502. l.prototype.calcFullCoverage = function(e) {
  25503. var t = !1;
  25504. if (e.children)
  25505. for (var i = 0; i < e.children.length; i++) {
  25506. var n = e.children[i];
  25507. t = t || this.calcFullCoverage(n)
  25508. }
  25509. e.covered = e.tile.uploaded || t
  25510. }
  25511. ,
  25512. l.prototype.nodeSubcovered = function(e) {
  25513. if (!e.children)
  25514. return !1;
  25515. for (var t = 0; t < e.children.length; t++)
  25516. if (!e.children[t] || !this.isNodeCovered(e.children[t]))
  25517. return !1;
  25518. return !0
  25519. }
  25520. ,
  25521. l.prototype.resetPanoDescriptor = function(e) {
  25522. this.getPanoDescriptor(e)
  25523. }
  25524. ,
  25525. l.prototype.getPanoDescriptor = function(e) {
  25526. var t = this.panoDescriptors[e];
  25527. return t || (t = {},
  25528. this.panoDescriptors[e] = t),
  25529. t
  25530. }
  25531. ,
  25532. l.prototype.resetPanoLODDescriptors = function(e) {
  25533. var t = this.getPanoLODDescriptors(e);
  25534. for (var i in t)
  25535. if (t.hasOwnProperty(i)) {
  25536. var n = t[i];
  25537. n.uploadCount = 0,
  25538. n.uploadAttempts = 0
  25539. }
  25540. }
  25541. ,
  25542. l.prototype.getPanoLODDescriptor = function(e, t) {
  25543. var i = this.getPanoLODDescriptors(e)
  25544. , n = i[t];
  25545. return n || (n = {
  25546. uploadCount: 0,
  25547. uploadAttempts: 0
  25548. },
  25549. i[t] = n),
  25550. n
  25551. }
  25552. ,
  25553. l.prototype.getPanoLODDescriptors = function(e) {
  25554. var t = this.panoLODDescriptors[e];
  25555. return t || (t = {},
  25556. this.panoLODDescriptors[e] = t),
  25557. t
  25558. }
  25559. ,
  25560. l.prototype.onTileDownloaded = function(e) {
  25561. var t = A.getLevelCountForSize(C.TILE_SIZE, e.panoSize)
  25562. , i = this.getTileDirectoryEntry(e.panoId, e.face, t, e.faceTileIndex);
  25563. if (i.downloaded = !0,
  25564. i.image = e.image,
  25565. i.panoSize = e.panoSize,
  25566. i.tileX = e.tileX,
  25567. i.tileY = e.tileY,
  25568. i.totalTiles = e.totalTiles,
  25569. i.tileIndex = e.tileIndex,
  25570. i.faceTileIndex = e.faceTileIndex,
  25571. i.face = e.face,
  25572. i.cubeFace = I.mapFaceToCubemapFace(e.face),
  25573. i.panoId = e.panoId,
  25574. i.tileSize = e.tileSize,
  25575. i.direction = (new h.Vector3).copy(e.direction),
  25576. i.node = null,
  25577. i.level = A.getLevelCountForSize(C.TILE_SIZE, i.panoSize),
  25578. this.isPanoActive(i.panoId)) {
  25579. var n = this.getTileTree(i.panoId, i.face)
  25580. , r = n.getSubNode(i.panoSize, i.tileX, i.tileY);
  25581. this.linkTileAndNode(i, r),
  25582. this.queueTileUpload(i, !0)
  25583. }
  25584. }
  25585. ,
  25586. l.prototype.getTileDirectoryEntry = function(e, t, i, n) {
  25587. var r = this.tileDirectory[e];
  25588. r || (r = {},
  25589. this.tileDirectory[e] = r);
  25590. var o = 16384 * t + 1024 * i + n
  25591. , a = r[o];
  25592. return a || (a = {
  25593. downloaded: !1,
  25594. uploaded: !1,
  25595. zoomUploaded: !1
  25596. },
  25597. r[o] = a),
  25598. a._key = e + ":" + t + ":" + i + ":" + n,
  25599. a._tileKey = o,
  25600. a
  25601. }
  25602. ,
  25603. l.prototype.setZoomingActive = function(e, t, i) {
  25604. this.zoomPanoRenderingDisabled || e === this.zoomingActive && this.zoomPanoId === t.id || (this.zoomingActive = e,
  25605. this.zoomPanoId = t.id,
  25606. this.zoomingActive && (this.zoomPanoId !== t.id || i) && this.updateZoomedPanoFromBase(t))
  25607. }
  25608. ,
  25609. l.prototype.updateZoomedPanoFromBase = function(e) {
  25610. if (!this.zoomPanoRenderingDisabled) {
  25611. var t = this.getActiveRenderTargetDescriptor(e.id);
  25612. if (t && t.renderTarget) {
  25613. var i = this.qualityManager.getMaxZoomPanoSize()
  25614. , n = t.renderTarget
  25615. , r = t.size;
  25616. this.sceneRenderer.copyCubeMap(n.texture, this.zoomRenderTarget, r, r, i, i),
  25617. this.copyBaseRenderStatusToZoomed(e.id)
  25618. }
  25619. }
  25620. }
  25621. ,
  25622. t.exports = l
  25623. }
  25624. , {
  25625. "../enum/GLCubeFaces": 25,
  25626. "../enum/PanoRendererEvents": 35,
  25627. "../enum/PanoSizeClass": 36,
  25628. "../enum/SceneRendererEvents": 43,
  25629. "../enum/TileDownloaderEvents": 45,
  25630. "../enum/Vectors": 50,
  25631. "../exception/BasicException": 55,
  25632. "../objects/Panorama": 148,
  25633. "../settings": 166,
  25634. "../util/browser": 182,
  25635. "../util/panorama": 191,
  25636. "./TileDownloader": 171,
  25637. "./TilePrioritizer": 172,
  25638. "./TileTree": 173,
  25639. "./TileUtils": 174,
  25640. events: 202,
  25641. three: 217
  25642. }],
  25643. 170: [function(e, t, i) {
  25644. "use strict";
  25645. function n(e, t, i) {
  25646. this.maxNavPanoSize = -1,
  25647. this.maxZoomPanoSize = -1,
  25648. this.devicePixelDensity = e,
  25649. this.deviceScreenSize = t,
  25650. this.clientBandwidth = i,
  25651. this.panoSizeClassMap = {},
  25652. this.useHighResolutionPanos = !0,
  25653. this.useUltraHighResolutionPanos = !1,
  25654. this.modelHasUltraHighPanos = !1
  25655. }
  25656. var r = e("../enum/PanoSizeClass")
  25657. , o = e("../settings")
  25658. , a = e("../util/browser")
  25659. , s = e("../constants")
  25660. , l = e("../util/showcase")
  25661. , c = e("../enum/ModelManagerEvents");
  25662. n.prototype.init = function(e) {
  25663. this.buildPanoSizeClassMap(this.devicePixelDensity, this.deviceScreenSize, this.clientBandwidth),
  25664. this.ultraHighSize = this.getPanoSize(r.ULTRAHIGH),
  25665. this.highSize = this.getPanoSize(r.HIGH),
  25666. this.standardSize = this.getPanoSize(r.STANDARD),
  25667. this.baseSize = this.getPanoSize(r.BASE),
  25668. o.tiling.maxZoomPanoQuality && this.ultraHighSize <= o.tiling.maxZoomPanoQuality && (o.tiling.allowUltraHighResolution = !0),
  25669. this.highQualityThreshold = a.valueFromHash("threshold2k", s.windowHeightHighQualityThreshold),
  25670. this.updateMaximums(),
  25671. e.on(c.ActiveModelChanged, this.onModelChanged.bind(this))
  25672. }
  25673. ,
  25674. n.prototype.updateFromModel = function(e) {
  25675. this.updateHighResolutionSettings(e),
  25676. this.updateUltraHighResolutionSettings(e)
  25677. }
  25678. ,
  25679. n.prototype.updateHighResolutionSettings = function(e) {
  25680. l.modelDataPromisesTiles(e.data) ? this.useHighResolutionPanos = !0 : this.useHighResolutionPanos = !1,
  25681. this.updateMaximums()
  25682. }
  25683. ,
  25684. n.prototype.updateUltraHighResolutionSettings = function(e) {
  25685. o.tiling.allowUltraHighResolution && this.modelHasUltraHighPanos ? this.useUltraHighResolutionPanos = !0 : this.useUltraHighResolutionPanos = !1,
  25686. this.updateMaximums()
  25687. }
  25688. ,
  25689. n.prototype.enableUltraHighQualityMode = function() {
  25690. this.modelHasUltraHighPanos = !0,
  25691. this.updateUltraHighResolutionSettings(null)
  25692. }
  25693. ,
  25694. n.prototype.ultraHighQualityModeEnabled = function() {
  25695. return this.modelHasUltraHighPanos
  25696. }
  25697. ,
  25698. n.prototype.onModelChanged = function(e) {
  25699. this.updateFromModel(e.model),
  25700. this.updateMaximums()
  25701. }
  25702. ,
  25703. n.prototype.updateMaximums = function() {
  25704. this.maxNavPanoSize = o.tiling.maxNavPanoQuality || this.detectMaxNavPanoSize(),
  25705. this.maxZoomPanoSize = o.tiling.maxZoomPanoQuality || this.detectMaxZoomPanoSize(),
  25706. this.maxZoomPanoSize < this.maxNavPanoSize && (this.maxNavPanoSize = this.maxZoomPanoSize)
  25707. }
  25708. ,
  25709. n.prototype.buildPanoSizeClassMap = function() {
  25710. this.panoSizeClassMap[r.BASE] = 512,
  25711. this.panoSizeClassMap[r.STANDARD] = 1024,
  25712. this.panoSizeClassMap[r.HIGH] = 2048,
  25713. this.panoSizeClassMap[r.ULTRAHIGH] = 4096
  25714. }
  25715. ,
  25716. n.prototype.getPanoSize = function(e) {
  25717. return this.panoSizeClassMap[e]
  25718. }
  25719. ,
  25720. n.prototype.getMaxPossiblePanoSize = function() {
  25721. return this.getPanoSize(r.ULTRAHIGH)
  25722. }
  25723. ,
  25724. n.prototype.getMaxPanoSize = function() {
  25725. return this.maxZoomPanoSize
  25726. }
  25727. ,
  25728. n.prototype.getMaxNavPanoSize = function() {
  25729. return this.maxNavPanoSize
  25730. }
  25731. ,
  25732. n.prototype.getMaxZoomPanoSize = function() {
  25733. return this.maxZoomPanoSize
  25734. }
  25735. ,
  25736. n.prototype.detectMaxNavPanoSizeClass = function() {
  25737. return this.useHighResolutionPanos ? a.isMobile() ? r.STANDARD : $("#player").height() < this.highQualityThreshold ? r.STANDARD : r.HIGH : r.STANDARD
  25738. }
  25739. ,
  25740. n.prototype.detectMaxNavPanoSize = function() {
  25741. var e = this.detectMaxNavPanoSizeClass();
  25742. return this.getPanoSize(e)
  25743. }
  25744. ,
  25745. n.prototype.detectMaxZoomPanoSize = function() {
  25746. 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)
  25747. }
  25748. ,
  25749. t.exports = n
  25750. }
  25751. , {
  25752. "../constants": 8,
  25753. "../enum/ModelManagerEvents": 33,
  25754. "../enum/PanoSizeClass": 36,
  25755. "../settings": 166,
  25756. "../util/browser": 182,
  25757. "../util/showcase": 193
  25758. }],
  25759. 171: [function(e, t, i) {
  25760. (function(i) {
  25761. "use strict";
  25762. function n(e) {
  25763. this.panos = null,
  25764. this.retryMinimumTime = 1e4,
  25765. this.urls = null,
  25766. this.panoLoadCallbacks = {},
  25767. this.downloadDescriptors = {},
  25768. this.priorityQueue = [],
  25769. this.forceQueue = [],
  25770. this.activeDownloads = [],
  25771. this.qualityManager = null,
  25772. this.tilePrioritizer = null,
  25773. this.refreshInterval = null,
  25774. this.processPriorityQueue = !1,
  25775. this.concurrentDownloads = e.concurrentDownloads || 1,
  25776. this.downloadTestResults = {}
  25777. }
  25778. var r = e("three")
  25779. , o = (e("../enum/Viewmode"),
  25780. e("../settings"))
  25781. , a = (e("../objects/Panorama"),
  25782. e("../util/logger"))
  25783. , s = (e("../enum/Vectors"),
  25784. e("../enum/PanoSizeClass"),
  25785. e("../enum/TileDownloaderEvents"))
  25786. , l = e("./TilePrioritizer")
  25787. , c = e("./TileUtils")
  25788. , h = (e("../enum/GLCubeFaces"),
  25789. e("../enum/DownloadStatus"))
  25790. , u = e("../util/panorama")
  25791. , d = e("../util/ajax")
  25792. , p = e("../ab")
  25793. , f = e("events").EventEmitter
  25794. , g = (new a(i),
  25795. Object.freeze({
  25796. Testing: 1,
  25797. Success: 2,
  25798. Fail: 3
  25799. }));
  25800. n.prototype = Object.create(f.prototype),
  25801. n.IDLE_REFRESH_DELAY = 500,
  25802. n.ACTIVE_REFRESH_DELAY = 16,
  25803. n.DOWNLOAD_RETRIES = 4,
  25804. n.prototype.init = function(e) {
  25805. this.qualityManager = e
  25806. }
  25807. ,
  25808. n.prototype.setUrls = function(e) {
  25809. this.urls = e
  25810. }
  25811. ,
  25812. n.prototype.setPanoData = function(e, t, i) {
  25813. this.panos = e,
  25814. this.imagePanos = t,
  25815. this.panoGroupId = i
  25816. }
  25817. ,
  25818. n.prototype.start = function() {
  25819. this.refreshUpdateInterval(0)
  25820. }
  25821. ,
  25822. n.prototype.stop = function() {
  25823. window.cancel(this.refreshInterval)
  25824. }
  25825. ,
  25826. n.prototype.refreshUpdateInterval = function(e) {
  25827. e || (e = 0),
  25828. this.refreshInterval = window.setTimeout(function() {
  25829. var e = this.update();
  25830. e ? this.refreshUpdateInterval(n.ACTIVE_REFRESH_DELAY) : this.refreshUpdateInterval(n.IDLE_REFRESH_DELAY)
  25831. }
  25832. .bind(this), e)
  25833. }
  25834. ,
  25835. n.prototype.update = function() {
  25836. var e = this.forceQueue.length > 0;
  25837. return this.processQueueForDownloading(this.forceQueue),
  25838. this.processPriorityQueue && (this.queuePrioritizedTilesForPanos(this.panos),
  25839. this.priorityQueue.length > 0 && (e = !0),
  25840. this.processQueueForDownloading(this.priorityQueue)),
  25841. e
  25842. }
  25843. ,
  25844. n.prototype.forceQueueTilesForPano = function() {
  25845. var e = []
  25846. , t = [];
  25847. return function(i, n, r, o, a, s) {
  25848. e.length = 0;
  25849. for (var u = this.getTileDownloadDescriptors(i, n), d = 0; d < u.length; d++) {
  25850. var p = u[d];
  25851. p.status !== h.None && p.status !== h.Queued || e.push(p)
  25852. }
  25853. if (r && e.length > 0) {
  25854. l.sortPanoTiles(e, i, r),
  25855. t.length = 0,
  25856. c.matchingTilesInDirection(i, n, r, o, a, t);
  25857. for (var f = 0, g = function(e) {
  25858. return e.face === m.face && e.faceTileIndex === m.faceTileIndex
  25859. }; f < e.length; ) {
  25860. var m = e[f]
  25861. , v = t.findIndex(g);
  25862. v < 0 ? e.splice(f, 1) : f++
  25863. }
  25864. }
  25865. for (var A = 0; A < e.length; A++)
  25866. this.forceQueue.push(e[A]);
  25867. this.setStatusForAllDescriptors(this.forceQueue, h.ForceQueued),
  25868. this.clearFromQueue(this.priorityQueue, h.ForceQueued, !1),
  25869. s && this.processQueueForDownloading(this.forceQueue, !0)
  25870. }
  25871. }(),
  25872. n.prototype.clearForceQueue = function() {
  25873. this.clearQueue(this.forceQueue)
  25874. }
  25875. ,
  25876. n.prototype.queuePrioritizedTilesForPanos = function(e) {
  25877. this.tilePrioritizer && (this.clearQueue(this.priorityQueue),
  25878. this.tilePrioritizer.filterAndPrioritize(this.priorityQueue, e, this),
  25879. this.clearFromQueue(this.priorityQueue, h.None, !0),
  25880. this.setStatusOrRemoveForAllDescriptors(this.priorityQueue, h.Queued))
  25881. }
  25882. ,
  25883. n.prototype.clearQueue = function(e) {
  25884. this.setStatusForAllDescriptors(e, h.None),
  25885. e.length = 0
  25886. }
  25887. ,
  25888. n.prototype.clearFromQueue = function(e, t, i) {
  25889. for (var n = 0; n < e.length; n++) {
  25890. var r = e[n];
  25891. r && (t === r.status && !i || t !== r.status && i) && (e[n] = null)
  25892. }
  25893. }
  25894. ,
  25895. n.prototype.setStatusForAllDescriptors = function(e, t) {
  25896. for (var i = 0; i < e.length; i++) {
  25897. var n = e[i];
  25898. n && (n.status = t)
  25899. }
  25900. }
  25901. ,
  25902. n.prototype.setStatusOrRemoveForAllDescriptors = function(e, t) {
  25903. for (var i = 0; i < e.length; i++) {
  25904. var n = e[i];
  25905. n && (n.status !== t ? n.status = t : e[i] = null)
  25906. }
  25907. }
  25908. ,
  25909. n.prototype.getTileDownloadDescriptors = function(e, t) {
  25910. var i = this.getAllTileDownloadDescriptorsForPano(e)
  25911. , n = i[t];
  25912. return n || (n = this.buildDownloadDescriptorArray(t),
  25913. i[t] = n,
  25914. this.initTileDownloadDescriptors(n, e, t)),
  25915. n
  25916. }
  25917. ,
  25918. n.prototype.getAllTileDownloadDescriptorsForPano = function(e) {
  25919. var t = this.downloadDescriptors[e.id];
  25920. return t || (t = {},
  25921. this.downloadDescriptors[e.id] = t),
  25922. t
  25923. }
  25924. ,
  25925. n.prototype.processQueueForDownloading = function(e, t) {
  25926. if (this.cleanupActiveDownloads(),
  25927. this.activeDownloads.length < this.concurrentDownloads || t)
  25928. for (var i = t ? e.length : this.concurrentDownloads - this.activeDownloads.length, n = 0, r = 0; n < i && e.length > 0; r++) {
  25929. var o = e.shift();
  25930. o && (this.startDownload(o),
  25931. n++)
  25932. }
  25933. }
  25934. ,
  25935. n.prototype.testDownload = function(e, t, i) {
  25936. var n = this.downloadTestResults[e];
  25937. if (n)
  25938. return void (n === g.Success ? i(!0) : n === g.Fail && i(!1));
  25939. this.downloadTestResults[e] = g.Testing;
  25940. var r = this.panos.list[0]
  25941. , o = this.getTileUrl(r.id, e, t, 0)
  25942. , a = function(t) {
  25943. this.downloadTestResults[e] = g.Success,
  25944. i(!0)
  25945. }
  25946. .bind(this)
  25947. , s = function() {
  25948. this.downloadTestResults[e] = g.Fail,
  25949. i(!1)
  25950. }
  25951. .bind(this);
  25952. this.loadImage(o, 0, a, s)
  25953. }
  25954. ,
  25955. n.prototype.startDownload = function(e) {
  25956. e.status = h.Downloading;
  25957. var t = this.getTileUrl(e.pano.id, e.panoSize, e.tileSize, e.tileIndex);
  25958. this.activeDownloads.push(e),
  25959. this.loadImage(t, n.DOWNLOAD_RETRIES, this.downloadComplete.bind(this, e), this.downloadFailed.bind(this, e))
  25960. }
  25961. ,
  25962. n.prototype.downloadFailed = function(e, t) {}
  25963. ,
  25964. n.prototype.downloadComplete = function(e, t) {
  25965. if (e.panoGroupId === this.panoGroupId) {
  25966. var i = this.getPanoLoadCallbacks(e.pano, e.panoSize);
  25967. e.status = h.Downloaded,
  25968. i && i.onProgress && i.onProgress(e.pano, e.panoSize);
  25969. var n = {
  25970. panoId: e.pano.id,
  25971. image: t,
  25972. tileSize: e.tileSize,
  25973. panoSize: e.panoSize,
  25974. tileIndex: e.tileIndex,
  25975. faceTileIndex: e.faceTileIndex,
  25976. totalTiles: e.totalTiles,
  25977. face: e.face,
  25978. tileX: e.tileX,
  25979. tileY: e.tileY,
  25980. direction: e.direction
  25981. };
  25982. e.image = t,
  25983. this.emit(s.TileDownloadSuccess, n),
  25984. this.isPanoDownloaded(e.pano, e.panoSize) && (n = {
  25985. panoId: e.pano.id,
  25986. tileSize: e.tileSize,
  25987. panoSize: e.panoSize
  25988. },
  25989. this.emit(s.PanoDownloadComplete, n),
  25990. i && i.onLoad && i.onLoad(e.pano, e.panoSize))
  25991. }
  25992. }
  25993. ,
  25994. n.prototype.cleanupActiveDownloads = function() {
  25995. var e = [];
  25996. return function() {
  25997. e.length = 0;
  25998. for (var t = 0; t < this.activeDownloads.length; t++) {
  25999. var i = this.activeDownloads[t];
  26000. i.status !== h.Downloaded && i.status !== h.Failed && e.push(i)
  26001. }
  26002. this.activeDownloads.length = 0,
  26003. this.activeDownloads.push.apply(this.activeDownloads, e)
  26004. }
  26005. }(),
  26006. n.prototype.isPanoDownloaded = function(e, t) {
  26007. var i = this.getTileDownloadDescriptors(e, t);
  26008. if (i.length <= 0)
  26009. return !1;
  26010. for (var n = 0; n < i.length; n++) {
  26011. var r = i[n];
  26012. if (r.status !== h.Downloaded)
  26013. return !1
  26014. }
  26015. return !0
  26016. }
  26017. ,
  26018. n.prototype.setPanoLoadCallbacks = function(e, t, i, n, r) {
  26019. var o = e.id + ":" + this.qualityManager.getPanoSize(t);
  26020. this.panoLoadCallbacks[o] = {
  26021. onLoad: i,
  26022. onFail: n,
  26023. onProgress: r
  26024. }
  26025. }
  26026. ,
  26027. n.prototype.getPanoLoadCallbacks = function(e, t) {
  26028. var i = e.id + ":" + t;
  26029. return this.panoLoadCallbacks[i]
  26030. }
  26031. ,
  26032. n.prototype.buildDownloadDescriptorArray = function(e) {
  26033. for (var t = c.getTileCountForSize(e), i = [], n = 0; n < t; n++) {
  26034. var r = this.buildDownloadDescriptor();
  26035. i.push(r)
  26036. }
  26037. return i
  26038. }
  26039. ,
  26040. n.prototype.buildDownloadDescriptor = function() {
  26041. var e = {
  26042. panoGroupId: null,
  26043. pano: null,
  26044. panoSize: -1,
  26045. tileSize: -1,
  26046. tileIndex: -1,
  26047. totalTiles: -1,
  26048. faceTileIndex: -1,
  26049. status: h.None,
  26050. url: null,
  26051. image: null,
  26052. direction: new r.Vector3,
  26053. face: -1,
  26054. cubeFace: -1,
  26055. tileX: -1,
  26056. tileY: -1
  26057. };
  26058. return e
  26059. }
  26060. ,
  26061. n.prototype.initTileDownloadDescriptors = function(e, t, i) {
  26062. for (var n = 0; n < e.length; n++) {
  26063. var r = e[n];
  26064. this.initTileDownloadDescriptor(r, t, i, n)
  26065. }
  26066. }
  26067. ,
  26068. n.prototype.initTileDownloadDescriptor = function(e, t, i, n) {
  26069. var r = i >= c.TILE_SIZE ? c.TILE_SIZE : i;
  26070. e.face = c.getFaceForTile(i, n),
  26071. e.cubeFace = u.mapFaceToCubemapFace(e.face),
  26072. e.panoGroupId = this.panoGroupId,
  26073. e.pano = t,
  26074. e.panoSize = i,
  26075. e.tileSize = r,
  26076. e.tileIndex = n,
  26077. e.totalTiles = c.getTileCountForSize(i),
  26078. e.status = h.None,
  26079. e.image = null,
  26080. c.getTileLocation(e.panoSize, e.tileIndex, e),
  26081. c.getTileVector(e.panoSize, e.tileSize, e.cubeFace, e.tileX, e.tileY, c.LocationOnTile.Center, 0, e.direction)
  26082. }
  26083. ,
  26084. n.prototype.getTileUrl = function() {
  26085. var e = {
  26086. 256: "256",
  26087. 512: "512",
  26088. 1024: "1k",
  26089. 2048: "2k",
  26090. 4096: "4k"
  26091. }
  26092. , t = {
  26093. face: -1,
  26094. faceTileIndex: -1,
  26095. tileX: -1,
  26096. tileY: -1
  26097. };
  26098. return function(i, n, r, a) {
  26099. c.getTileLocation(n, a, t);
  26100. var s = Math.floor(n / r)
  26101. , l = s * s
  26102. , h = Math.floor(a / l)
  26103. , u = "";
  26104. 1 === o.tiling.customCompression && (u = "_" + o.tiling["q" + e[n]]);
  26105. var d = this.urls.get("tiles/" + i + "/" + e[n] + u + "_face" + h + "_" + t.tileX + "_" + t.tileY + ".jpg");
  26106. return d = p.changeIfTileGenerating(d)
  26107. }
  26108. }(),
  26109. n.prototype.loadImage = function(e, t, i, n) {
  26110. d.getImage(e, t).then(function(e) {
  26111. i(e)
  26112. }).fail(n)
  26113. }
  26114. ,
  26115. t.exports = n
  26116. }
  26117. ).call(this, "/js/tile/TileDownloader.js")
  26118. }
  26119. , {
  26120. "../ab": 3,
  26121. "../enum/DownloadStatus": 24,
  26122. "../enum/GLCubeFaces": 25,
  26123. "../enum/PanoSizeClass": 36,
  26124. "../enum/TileDownloaderEvents": 45,
  26125. "../enum/Vectors": 50,
  26126. "../enum/Viewmode": 51,
  26127. "../objects/Panorama": 148,
  26128. "../settings": 166,
  26129. "../util/ajax": 181,
  26130. "../util/logger": 189,
  26131. "../util/panorama": 191,
  26132. "./TilePrioritizer": 172,
  26133. "./TileUtils": 174,
  26134. events: 202,
  26135. three: 217
  26136. }],
  26137. 172: [function(e, t, i) {
  26138. (function(i) {
  26139. "use strict";
  26140. function n(e, t, i, o, a) {
  26141. this.qualityManager = e,
  26142. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  26143. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize(),
  26144. this.baseSize = t,
  26145. this.standardSize = i,
  26146. this.highSize = o,
  26147. this.ultraHighSize = a,
  26148. this.priorityCriteria = new n.PriorityCriteria(null,new r.Vector3(0,0,0),new r.Vector3(0,0,-1),new r.Vector3(0,0,-1))
  26149. }
  26150. var r = e("three")
  26151. , o = (e("../enum/Viewmode"),
  26152. e("../settings"),
  26153. e("../settings"),
  26154. e("../objects/Panorama"))
  26155. , a = e("../util/logger")
  26156. , s = (e("../enum/Vectors"),
  26157. e("../enum/PanoSizeClass"),
  26158. e("../enum/ModelManagerEvents"),
  26159. e("../enum/GLCubeFaces"),
  26160. e("../enum/DownloadStatus"))
  26161. , l = (e("../util/browser"),
  26162. e("./TileUtils"))
  26163. , c = e("../util/math")
  26164. , h = (e("events").EventEmitter,
  26165. new a(i),
  26166. Object.freeze({
  26167. None: 0,
  26168. DirectionalFOV: 1
  26169. }));
  26170. n.PriorityCriteria = function(e, t, i, n, o) {
  26171. this.pano = e,
  26172. this.cameraPosition = (new r.Vector3).copy(t),
  26173. this.cameraDir = (new r.Vector3).copy(i),
  26174. this.panoSpaceDir = (new r.Vector3).copy(n),
  26175. this.upcomingPanos = o,
  26176. this.copy = function(e) {
  26177. this.pano = e.pano,
  26178. this.cameraPosition.copy(e.cameraPosition),
  26179. this.cameraDir.copy(e.cameraDir),
  26180. this.panoSpaceDir.copy(e.panoSpaceDir),
  26181. this.upcomingPanos = o
  26182. }
  26183. ,
  26184. this.zoomingActive = !1
  26185. }
  26186. ,
  26187. n.DIRECTIONAL_FOV = 180,
  26188. n.DIRECTIONAL_FOV_NARROW = 120,
  26189. n.MAX_SCORED_PANOS_TOCONSIDER = 6,
  26190. n.MAX_SCORED_PANOS_TOADD = 2,
  26191. n.MAX_UPCOMING_PANOS_TOADD = 3,
  26192. n.DIRECTION_SCORE_STRICTNESS = .75,
  26193. n.appendQueue = function(e, t) {
  26194. if (e && t)
  26195. for (var i = 0; i < t.length; i++)
  26196. e.push(t[i])
  26197. }
  26198. ,
  26199. n.prototype.updateCriteria = function(e, t, i, n) {
  26200. this.priorityCriteria.pano = e,
  26201. this.priorityCriteria.cameraPosition.copy(t),
  26202. this.priorityCriteria.cameraDir.copy(i),
  26203. this.priorityCriteria.upcomingPanos = n,
  26204. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  26205. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize()
  26206. }
  26207. ,
  26208. n.prototype.filterAndPrioritize = function() {
  26209. var e = []
  26210. , t = []
  26211. , i = [];
  26212. return function(r, o, a) {
  26213. this.populateNeighborPanos(this.priorityCriteria.pano, o, e),
  26214. this.populateScoredPanos(this.priorityCriteria.pano, o, t, this.priorityCriteria.cameraDir, n.MAX_SCORED_PANOS_TOCONSIDER);
  26215. var s = this.baseSize
  26216. , l = this.standardSize
  26217. , c = this.highSize
  26218. , h = this.ultraHighSize;
  26219. this.queueTilesForPano(r, a, this.priorityCriteria.pano, s),
  26220. this.priorityCriteria.upcomingPanos && this.queueTilesForPanos(r, this.priorityCriteria.upcomingPanos, a, s, n.MAX_UPCOMING_PANOS_TOADD),
  26221. i.length = 0,
  26222. this.canDownloadSize(l) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, l, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  26223. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26224. n.appendQueue(r, i),
  26225. this.queueTilesForPanos(r, t, a, s, n.MAX_SCORED_PANOS_TOADD),
  26226. i.length = 0,
  26227. this.canDownloadSize(c) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, c, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  26228. this.canDownloadSize(h) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, h, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  26229. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26230. n.appendQueue(r, i),
  26231. i.length = 0,
  26232. this.canDownloadSize(l) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, l, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  26233. this.canDownloadSize(c) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, c, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  26234. this.canDownloadSize(h) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, h, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  26235. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26236. n.appendQueue(r, i),
  26237. this.queueTilesForPanos(r, e, a, s)
  26238. }
  26239. }(),
  26240. n.prototype.canDownloadSize = function(e) {
  26241. return this.maxNavQuality >= e || this.maxZoomQuality >= e && this.zoomingActive
  26242. }
  26243. ,
  26244. n.prototype.populateNeighborPanos = function(e, t, i) {
  26245. i = i || [],
  26246. i.length = 0;
  26247. var n = t.getNeighbours(e);
  26248. for (var r in n)
  26249. if (n.hasOwnProperty(r)) {
  26250. var o = t.get(r);
  26251. i.push(o)
  26252. }
  26253. return i
  26254. }
  26255. ,
  26256. n.prototype.populateScoredPanos = function(e, t, i, r, a) {
  26257. i = i || [],
  26258. i.length = 0;
  26259. var s = [o.filters.inPanoDirection(e.position, r, n.DIRECTION_SCORE_STRICTNESS), o.filters.not(e)]
  26260. , l = [o.scoreFunctions.distanceSquared(e), o.scoreFunctions.direction(e.position, r)]
  26261. , c = t.sortByScore(s, l);
  26262. if (c)
  26263. for (var h = 0; h < c.length && h < a; h++) {
  26264. var u = c[h].pano;
  26265. i.push(u)
  26266. }
  26267. return i
  26268. }
  26269. ,
  26270. n.prototype.queueTilesForPanos = function(e, t, i, n, r) {
  26271. for (var o = 0, a = 0; a < t.length; a++) {
  26272. var s = t[a]
  26273. , l = this.queueTilesForPano(e, i, s, n);
  26274. if (o += l > 0 ? 1 : 0,
  26275. r && o >= r)
  26276. break
  26277. }
  26278. return o
  26279. }
  26280. ,
  26281. n.prototype.queueTilesForPano = function() {
  26282. var e = {
  26283. filter: h.None
  26284. };
  26285. return function(t, i, n, r) {
  26286. return this.filterAndQueueTileDownloadDescriptors(t, i, n, r, e)
  26287. }
  26288. }(),
  26289. n.prototype.queueTilesForPanosInDirection = function() {
  26290. var e = new r.Vector3;
  26291. return function(t, i, n, r, o, a, s, l) {
  26292. for (var h = 0, u = 0; u < n.length; u++) {
  26293. var d = n[u];
  26294. e.copy(d.position),
  26295. e.sub(o),
  26296. e.normalize();
  26297. var p = Math.max(Math.min(a.dot(e), 1), -1)
  26298. , f = c.getFOVDotThreshold(s);
  26299. if (p >= f) {
  26300. var g = this.queueTilesInDirectionForPano(t, i, d, r, o, a, s);
  26301. if (h += g > 0 ? 1 : 0,
  26302. l && h >= l)
  26303. break
  26304. }
  26305. }
  26306. return h
  26307. }
  26308. }(),
  26309. n.prototype.queueTilesInDirectionForPanos = function(e, t, i, n, r, o, a, s) {
  26310. for (var l = 0, c = 0; c < i.length; c++) {
  26311. var h = i[c]
  26312. , u = this.queueTilesInDirectionForPano(e, t, h, n, o, a);
  26313. if (l += u > 0 ? 1 : 0,
  26314. s && l >= s)
  26315. break
  26316. }
  26317. return l
  26318. }
  26319. ,
  26320. n.prototype.queueTilesInDirectionForPano = function() {
  26321. var e = {
  26322. filter: h.DirectionalFOV,
  26323. direction: new r.Vector3,
  26324. fov: 60
  26325. }
  26326. , t = new r.Vector3;
  26327. return function(i, n, r, o, a, s, c) {
  26328. return t.copy(s),
  26329. l.getRelativeDirection(r.quaternion, t),
  26330. e.direction.copy(t),
  26331. e.fov = c,
  26332. this.filterAndQueueTileDownloadDescriptors(i, n, r, o, e)
  26333. }
  26334. }(),
  26335. n.prototype.filterAndQueueTileDownloadDescriptors = function() {
  26336. var e = [];
  26337. return function(t, i, n, r, o) {
  26338. var a = i.getTileDownloadDescriptors(n, r);
  26339. e.length = 0,
  26340. this.filterTileDownloadDescriptors(n, a, e, o);
  26341. for (var s = 0, l = 0; l < e.length; l++) {
  26342. var c = e[l];
  26343. c && (t.push(c),
  26344. s++)
  26345. }
  26346. return s
  26347. }
  26348. }(),
  26349. n.prototype.filterTileDownloadDescriptors = function() {
  26350. new r.Vector3;
  26351. return function(e, t, i, n) {
  26352. var r, o;
  26353. switch (n.filter) {
  26354. case h.DirectionalFOV:
  26355. for (r = 0; r < t.length; r++)
  26356. o = t[r],
  26357. l.isTileWithinFOV(o.panoSize, o.tileSize, o.face, o.tileX, o.tileY, n.direction, n.fov) && i.push(o);
  26358. break;
  26359. default:
  26360. for (r = 0; r < t.length; r++)
  26361. o = t[r],
  26362. i.push(o)
  26363. }
  26364. for (r = 0; r < i.length; r++)
  26365. o = i[r],
  26366. this.canIncludeDescriptor(o) || (i[r] = null)
  26367. }
  26368. }(),
  26369. n.prototype.canIncludeDescriptor = function(e) {
  26370. return e.status !== s.Downloading && e.status !== s.Downloaded
  26371. }
  26372. ,
  26373. n.prototype.canIncludePano = function(e, t) {
  26374. return !e.isLoaded(t)
  26375. }
  26376. ,
  26377. n.getFOVDotThreshold = function(e) {
  26378. return Math.cos(r.Math.degToRad(e / 2))
  26379. }
  26380. ;
  26381. var u = function() {
  26382. var e = function e(t, i) {
  26383. var n = e._panoSpaceDir
  26384. , r = e._fovThreshold
  26385. , o = e._fovThresholdNarrow
  26386. , a = Math.max(Math.min(n.dot(t.direction), 1), -1)
  26387. , s = Math.max(Math.min(n.dot(i.direction), 1), -1);
  26388. return t._dot = a,
  26389. i._dot = s,
  26390. a >= r && s < r ? -1 : a < r && s >= r ? 1 : a >= o && s < o ? -1 : a < o && s >= o ? 1 : t.panoSize > i.panoSize ? 1 : i.panoSize > t.panoSize ? -1 : -(a - s)
  26391. };
  26392. return e._panoSpaceDir = new r.Vector3,
  26393. e._fovThreshold = -1,
  26394. e._fovThresholdNarrow = -1,
  26395. e
  26396. }();
  26397. n.sortPanoTiles = function(e, t, i) {
  26398. u._panoSpaceDir.copy(i),
  26399. l.getRelativeDirection(t.quaternion, u._panoSpaceDir),
  26400. u._fovThresholdNarrow = c.getFOVDotThreshold(n.DIRECTIONAL_FOV_NARROW),
  26401. u._fovThreshold = c.getFOVDotThreshold(n.DIRECTIONAL_FOV),
  26402. e.sort(u)
  26403. }
  26404. ,
  26405. n.insertSortedPanoTile = function(e, t, i, r) {
  26406. u._panoSpaceDir.copy(r),
  26407. l.getRelativeDirection(i.quaternion, u._panoSpaceDir),
  26408. u._fovThresholdNarrow = c.getFOVDotThreshold(n.DIRECTIONAL_FOV_NARROW),
  26409. u._fovThreshold = c.getFOVDotThreshold(n.DIRECTIONAL_FOV);
  26410. for (var o = -1, a = 0; a < e.length; a++) {
  26411. var s = u(t, e[a]);
  26412. if (s <= 0) {
  26413. o = a;
  26414. break
  26415. }
  26416. }
  26417. if (o === -1)
  26418. e[e.length] = t;
  26419. else {
  26420. for (var h = e.length; h > o; h--)
  26421. e[h] = e[h - 1];
  26422. e[o] = t
  26423. }
  26424. }
  26425. ,
  26426. n.prototype.setZoomingActive = function(e) {
  26427. e !== this.zoomingActive && (this.zoomingActive = e)
  26428. }
  26429. ,
  26430. t.exports = n
  26431. }
  26432. ).call(this, "/js/tile/TilePrioritizer.js")
  26433. }
  26434. , {
  26435. "../enum/DownloadStatus": 24,
  26436. "../enum/GLCubeFaces": 25,
  26437. "../enum/ModelManagerEvents": 33,
  26438. "../enum/PanoSizeClass": 36,
  26439. "../enum/Vectors": 50,
  26440. "../enum/Viewmode": 51,
  26441. "../objects/Panorama": 148,
  26442. "../settings": 166,
  26443. "../util/browser": 182,
  26444. "../util/logger": 189,
  26445. "../util/math": 190,
  26446. "./TileUtils": 174,
  26447. events: 202,
  26448. three: 217
  26449. }],
  26450. 173: [function(e, t, i) {
  26451. "use strict";
  26452. function n(e, t) {
  26453. this.levels = t,
  26454. this.tileSize = e,
  26455. this.root = null,
  26456. this.allNodes = [],
  26457. a(this)
  26458. }
  26459. function r(e, t) {
  26460. this.tree = e,
  26461. this.parent = t,
  26462. this.children = [],
  26463. this.id = ++u
  26464. }
  26465. function o(e, t, i, r, a, s, l, h) {
  26466. if (e) {
  26467. l = l || n.TraversalType.PreOrder;
  26468. var u = r * c + i;
  26469. if (l === n.TraversalType.PreOrder && (a && a(e, t, u, i, r),
  26470. s && s.push(e)),
  26471. e.children && 0 !== e.children.length) {
  26472. for (var d = r * c, p = i * c, f = 0; f < c; f++)
  26473. for (var g = 0; g < c; g++)
  26474. o(e.children[g * c + f], t + 1, p + f, d + g, a, s, l, h);
  26475. l === n.TraversalType.PostOrder && (a && a(e, t, u, i, r),
  26476. s && s.push(e))
  26477. }
  26478. }
  26479. }
  26480. function a(e) {
  26481. e.root = s(e, null, 0)
  26482. }
  26483. function s(e, t, i) {
  26484. if (i > e.levels)
  26485. return null;
  26486. var n = new r(e,t);
  26487. e.allNodes.push(n);
  26488. for (var o = 0; o < h; o++)
  26489. n.children[o] = s(e, n, i + 1);
  26490. return n
  26491. }
  26492. function l(e, t, i, n, r) {
  26493. if (!e)
  26494. return null;
  26495. if (0 === i)
  26496. return e;
  26497. if (!e.children || 0 === e.children.length)
  26498. return null;
  26499. var o = Math.pow(c, i)
  26500. , a = o / c
  26501. , s = n % a
  26502. , h = r % a
  26503. , u = Math.floor(r / a)
  26504. , d = Math.floor(n / a)
  26505. , p = u * c + d
  26506. , f = e.children[p];
  26507. return l(f, t + 1, i - 1, s, h)
  26508. }
  26509. var c = (e("three"),
  26510. e("./TileUtils"),
  26511. e("../objects/Panorama"),
  26512. e("../util/panorama"),
  26513. e("events").EventEmitter,
  26514. 2)
  26515. , h = c * c;
  26516. n.TraversalType = Object.freeze({
  26517. PreOrder: 0,
  26518. PostOrder: 1
  26519. });
  26520. var u = 0;
  26521. n.getLevelCountForSize = function(e, t) {
  26522. var i = 0;
  26523. for (t < e && (t = e); ; ) {
  26524. if (t /= c,
  26525. t < e)
  26526. break;
  26527. i++
  26528. }
  26529. return i
  26530. }
  26531. ,
  26532. n.getSizeForLevel = function(e, t) {
  26533. return Math.pow(c, t) * e
  26534. }
  26535. ,
  26536. n.prototype.getSubNode = function(e, t, i) {
  26537. (!t || e < this.tileSize) && (t = 0),
  26538. (!i || e < this.tileSize) && (i = 0),
  26539. e < this.tileSize && (e = this.tileSize);
  26540. var r = n.getLevelCountForSize(this.tileSize, e)
  26541. , o = l(this.root, 0, r, t, i);
  26542. return o
  26543. }
  26544. ,
  26545. n.prototype.breadthFirst = function(e) {
  26546. e = e || {};
  26547. var t = !!e.nullLevelEnd
  26548. , i = e.maxLevel
  26549. , n = e.minLevel
  26550. , r = e.callback
  26551. , o = e.saveVisited
  26552. , a = []
  26553. , s = {}
  26554. , l = 0
  26555. , c = 0;
  26556. for (a.push(this.root),
  26557. a.push(s); a.length > 0 && !(i && l > i); ) {
  26558. var h = a.shift();
  26559. if (h === s)
  26560. (!n || l >= n) && (r && t && r(null),
  26561. o && t && o.push(null)),
  26562. a.length > 0 && a.push(s),
  26563. l++,
  26564. c = 0;
  26565. else {
  26566. if (h.children)
  26567. for (var u = 0; u < h.children.length; u++) {
  26568. var d = h.children[u];
  26569. d && a.push(h.children[u])
  26570. }
  26571. var p = this.getFaceIndexFromNode(h);
  26572. (!n || l >= n) && (r && r(h, l, p),
  26573. o && o.push(h)),
  26574. c++
  26575. }
  26576. }
  26577. }
  26578. ,
  26579. n.prototype.getFaceIndexFromNode = function(e) {
  26580. if (!e)
  26581. return -1;
  26582. for (var t = 1, i = e, n = 0, r = 0; ; ) {
  26583. var o = i.parent;
  26584. if (!o)
  26585. break;
  26586. for (var a = -1, s = 0; s < o.children.length; s++)
  26587. o.children[s] === i && (a = s);
  26588. var l = a % c
  26589. , h = Math.floor(a / c);
  26590. n = l * t + n,
  26591. r = h * t + r,
  26592. t *= c,
  26593. i = o
  26594. }
  26595. return r * t + n
  26596. }
  26597. ,
  26598. n.prototype.depthFirst = function(e, t, i) {
  26599. o(this.root, 0, 0, 0, e, t, i, this.tileSize)
  26600. }
  26601. ,
  26602. t.exports = n
  26603. }
  26604. , {
  26605. "../objects/Panorama": 148,
  26606. "../util/panorama": 191,
  26607. "./TileUtils": 174,
  26608. events: 202,
  26609. three: 217
  26610. }],
  26611. 174: [function(e, t, i) {
  26612. "use strict";
  26613. var n = e("../enum/GLCubeFaces")
  26614. , r = e("../util/MathLight")
  26615. , o = {};
  26616. o.TILE_SIZE = 512,
  26617. o.FACES_PER_PANO = 6,
  26618. o.LocationOnTile = {
  26619. Center: 0,
  26620. UpperLeft: 1,
  26621. UpperRight: 2,
  26622. LowerRight: 3,
  26623. LowerLeft: 4
  26624. },
  26625. o.getTileVector = function() {
  26626. return function(e, t, i, a, s, l, c, h) {
  26627. l = l || o.LocationOnTile.Center;
  26628. var u = e / t
  26629. , d = a / u;
  26630. s = -s + (u - 1);
  26631. var p = s / u
  26632. , f = t / e
  26633. , g = 2 * f
  26634. , m = g / 2
  26635. , v = 2 * d - 1 + m
  26636. , A = 2 * p - 1 + m;
  26637. switch (l) {
  26638. case o.LocationOnTile.UpperLeft:
  26639. v -= m,
  26640. A += m,
  26641. v += c * g;
  26642. break;
  26643. case o.LocationOnTile.UpperRight:
  26644. v += m,
  26645. A += m,
  26646. A -= c * g;
  26647. break;
  26648. case o.LocationOnTile.LowerRight:
  26649. v += m,
  26650. A -= m,
  26651. v -= c * g;
  26652. break;
  26653. case o.LocationOnTile.LowerLeft:
  26654. v -= m,
  26655. A -= m,
  26656. A += c * g;
  26657. break;
  26658. case o.LocationOnTile.Center:
  26659. }
  26660. switch (i) {
  26661. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  26662. r.setVector(h, -1, A, -v);
  26663. break;
  26664. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  26665. r.setVector(h, 1, A, v);
  26666. break;
  26667. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  26668. r.setVector(h, -v, 1, -A);
  26669. break;
  26670. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  26671. r.setVector(h, -v, -1, A);
  26672. break;
  26673. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  26674. r.setVector(h, -v, A, 1);
  26675. break;
  26676. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  26677. r.setVector(h, v, A, -1)
  26678. }
  26679. r.normalize(h)
  26680. }
  26681. }(),
  26682. o.getFaceForTile = function(e, t) {
  26683. var i = o.TILE_SIZE;
  26684. e < o.TILE_SIZE && (i = e);
  26685. var n = Math.floor(e / i)
  26686. , r = n * n;
  26687. return Math.floor(t / r)
  26688. }
  26689. ,
  26690. o.getTileLocation = function(e, t, i) {
  26691. var n = o.TILE_SIZE;
  26692. e < o.TILE_SIZE && (n = e);
  26693. var r = o.getFaceForTile(e, t)
  26694. , a = Math.floor(e / n)
  26695. , s = a * a
  26696. , l = t - r * s;
  26697. i.tileX = l % a,
  26698. i.tileY = Math.floor(l / a),
  26699. i.face = r,
  26700. i.faceTileIndex = l
  26701. }
  26702. ,
  26703. o.getTileCountForSize = function(e) {
  26704. if (e <= o.TILE_SIZE)
  26705. return o.FACES_PER_PANO;
  26706. var t = Math.floor(e / o.TILE_SIZE)
  26707. , i = t * t
  26708. , n = i * o.FACES_PER_PANO;
  26709. return n
  26710. }
  26711. ,
  26712. o.getRelativeDirection = function() {
  26713. var e = new r.Matrix4
  26714. , t = new r.Quaternion;
  26715. return function(i, n) {
  26716. t.copy(i),
  26717. t.inverse(),
  26718. e.makeRotationFromQuaternion(t),
  26719. e.applyToVector3(n),
  26720. r.normalize(n)
  26721. }
  26722. }(),
  26723. o.matchingTilesInDirection = function() {
  26724. var e = new r.Vector3
  26725. , t = new r.Vector3(0,0,-1)
  26726. , i = new r.Quaternion
  26727. , n = function(e, t) {
  26728. e.push({
  26729. face: t.face,
  26730. faceTileIndex: t.faceTileIndex,
  26731. tileX: t.tileX,
  26732. tileY: t.tileY
  26733. })
  26734. }
  26735. , a = function() {
  26736. var e = {
  26737. face: -1,
  26738. faceTileIndex: -1,
  26739. tileX: -1,
  26740. tileY: -1
  26741. };
  26742. return function(t, i, r) {
  26743. for (var a = o.getTileCountForSize(t), s = 0, l = 0; l < a; l++)
  26744. o.getTileLocation(t, l, e),
  26745. i && !i(e) || (s++,
  26746. r && n(r, e));
  26747. return s
  26748. }
  26749. }();
  26750. return function(n, s, l, c, h, u) {
  26751. var d = s < o.TILE_SIZE ? s : o.TILE_SIZE;
  26752. o.getTileCountForSize(s);
  26753. if (!c && !h)
  26754. return a(s, null, u);
  26755. var p = !!h;
  26756. if (h = h || c,
  26757. h = Math.max(0, Math.min(h, 360)),
  26758. c = Math.max(0, Math.min(c, 360)),
  26759. r.copyVector(l, e),
  26760. o.getRelativeDirection(n.quaternion, e),
  26761. p) {
  26762. i.setFromUnitVectors(e, t);
  26763. var f = function(e) {
  26764. return o.isTileWithinFrustum(s, d, e.face, e.tileX, e.tileY, i, c, h)
  26765. };
  26766. return a(s, f, u)
  26767. }
  26768. var g = function(t) {
  26769. return o.isTileWithinFOV(s, d, t.face, t.tileX, t.tileY, e, c)
  26770. };
  26771. return a(s, g, u)
  26772. }
  26773. }(),
  26774. o.isTileWithinFrustum = function() {
  26775. var e = new r.Vector3
  26776. , t = 1e-5;
  26777. return function(i, n, a, s, l, c, h, u) {
  26778. for (var d = Math.tan(.5 * u * r.RADIANS_PER_DEGREE), p = -d, f = Math.tan(.5 * h * r.RADIANS_PER_DEGREE), g = -f, m = o.mapFaceToCubemapFace(a), v = 0, A = 0, y = 0, C = 0, I = 0, E = 0, b = o.LocationOnTile.Center; b <= o.LocationOnTile.LowerLeft; b++)
  26779. if (o.getTileVector(i, n, m, s, l, b, 0, e),
  26780. r.applyQuaternionToVector(c, e),
  26781. e.z >= -t)
  26782. I++;
  26783. else {
  26784. var w = -1 / e.z
  26785. , _ = e.x * w
  26786. , T = e.y * w;
  26787. T > d ? v++ : T < p && A++,
  26788. _ > f ? y++ : _ < g && C++,
  26789. E++
  26790. }
  26791. return A !== E && v !== E && y !== E && C !== E
  26792. }
  26793. }(),
  26794. o.isTileWithinFOV = function() {
  26795. var e = new r.Vector3
  26796. , t = new r.Vector3(0,1,0)
  26797. , i = new r.Vector3(1,0,0);
  26798. return function(n, a, s, l, c, h, u) {
  26799. var d = o.mapFaceToCubemapFace(s);
  26800. if (r.cross(h, t, i),
  26801. o.getTileVector(n, a, d, l, c, o.LocationOnTile.Center, 0, e),
  26802. o.isWithinFOV(e, h, u, null))
  26803. return !0;
  26804. for (var p = u / 360, f = Math.floor(1 / p), g = 0, m = 0; m < f; m++) {
  26805. for (var v = o.LocationOnTile.UpperLeft; v <= o.LocationOnTile.LowerLeft; v++)
  26806. if (o.getTileVector(n, a, d, l, c, v, g, e),
  26807. o.isWithinFOV(e, h, u, null))
  26808. return !0;
  26809. g += p
  26810. }
  26811. return !1
  26812. }
  26813. }(),
  26814. o.isWithinFOV = function() {
  26815. var e = new r.Vector3
  26816. , t = new r.Vector3;
  26817. return function(i, n, o, a) {
  26818. if (r.copyVector(i, t),
  26819. a) {
  26820. r.copyVector(a, e),
  26821. r.normalize(e);
  26822. var s = r.dot(e, i);
  26823. e.x *= s,
  26824. e.y *= s,
  26825. e.z *= s,
  26826. r.subVector(t, e)
  26827. }
  26828. var l = o / 2 * r.RADIANS_PER_DEGREE
  26829. , c = Math.cos(l)
  26830. , h = r.dot(t, n);
  26831. return h >= c
  26832. }
  26833. }(),
  26834. o.mapFaceToCubemapFace = function() {
  26835. var e = {
  26836. 0: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  26837. 1: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  26838. 2: n.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  26839. 3: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  26840. 4: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  26841. 5: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  26842. };
  26843. return function(t) {
  26844. return e[t]
  26845. }
  26846. }(),
  26847. t.exports = o
  26848. }
  26849. , {
  26850. "../enum/GLCubeFaces": 25,
  26851. "../util/MathLight": 176
  26852. }],
  26853. 175: [function(e, t, i) {
  26854. (function(i) {
  26855. "use strict";
  26856. function n() {
  26857. this.list = [],
  26858. this.index = {},
  26859. Object.defineProperty(this, "length", {
  26860. get: function() {
  26861. return this.list.length
  26862. }
  26863. })
  26864. }
  26865. var r = (e("./common"),
  26866. e("./logger"));
  26867. new r(i);
  26868. n.prototype.forEach = function(e) {
  26869. this.list.forEach(e)
  26870. }
  26871. ,
  26872. n.prototype.add = function(e) {
  26873. this.list.push(e),
  26874. this.index[this.getIndex(e)] = e
  26875. }
  26876. ,
  26877. n.prototype.getIndex = function(e) {
  26878. throw new Error("IndexedCollection.getIndex not implemented in subclass.")
  26879. }
  26880. ,
  26881. n.prototype.extend = function(e) {
  26882. for (var t = 0; t < e.length; t++)
  26883. this.add(e[t])
  26884. }
  26885. ,
  26886. n.prototype.get = function(e) {
  26887. return this.index[e]
  26888. }
  26889. ,
  26890. n.prototype.first = function() {
  26891. return this.list[0]
  26892. }
  26893. ,
  26894. n.prototype.last = function() {
  26895. return this.list[this.list.length - 1]
  26896. }
  26897. ,
  26898. n.prototype.reIndex = function() {
  26899. this.index = {};
  26900. var e = this;
  26901. this.forEach(function(t) {
  26902. e.index[e.getIndex(t)] = t
  26903. })
  26904. }
  26905. ,
  26906. n.prototype.filter = function(e) {
  26907. var t = this.list.filter(e);
  26908. return this.reIndex(),
  26909. t
  26910. }
  26911. ,
  26912. n.prototype.reduce = function(e, t) {
  26913. return this.list.reduce(e, t)
  26914. }
  26915. ,
  26916. n.prototype.sort = function(e) {
  26917. return this.list.sort(e)
  26918. }
  26919. ,
  26920. n.prototype.indexOf = function(e) {
  26921. for (var t = 0; t < this.list.length; ++t)
  26922. if (this.list[t] === e)
  26923. return t;
  26924. return -1
  26925. }
  26926. ,
  26927. t.exports = n
  26928. }
  26929. ).call(this, "/js/util/IndexedCollection.js")
  26930. }
  26931. , {
  26932. "./common": 185,
  26933. "./logger": 189
  26934. }],
  26935. 176: [function(e, t, i) {
  26936. "use strict";
  26937. var n = e("../constants")
  26938. , r = {};
  26939. r.RADIANS_PER_DEGREE = Math.PI / 180,
  26940. r.DEGREES_PER_RADIAN = 180 / Math.PI,
  26941. r.Vector3 = function(e, t, i) {
  26942. this.x = e || 0,
  26943. this.y = t || 0,
  26944. this.z = i || 0
  26945. }
  26946. ,
  26947. r.Matrix4 = function() {
  26948. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  26949. arguments.length > 0 && console.error("MathLight.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  26950. }
  26951. ,
  26952. r.Matrix4.prototype = {
  26953. identity: function() {
  26954. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  26955. this
  26956. },
  26957. copy: function(e) {
  26958. return this.elements.set(e.elements),
  26959. this
  26960. },
  26961. applyToVector3: function(e) {
  26962. var t = e.x
  26963. , i = e.y
  26964. , n = e.z
  26965. , r = this.elements;
  26966. return e.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  26967. e.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  26968. e.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  26969. this
  26970. },
  26971. getInverse: function(e, t) {
  26972. var i = this.elements
  26973. , n = e.elements
  26974. , r = n[0]
  26975. , o = n[1]
  26976. , a = n[2]
  26977. , s = n[3]
  26978. , l = n[4]
  26979. , c = n[5]
  26980. , h = n[6]
  26981. , u = n[7]
  26982. , d = n[8]
  26983. , p = n[9]
  26984. , f = n[10]
  26985. , g = n[11]
  26986. , m = n[12]
  26987. , v = n[13]
  26988. , A = n[14]
  26989. , y = n[15]
  26990. , C = p * A * u - v * f * u + v * h * g - c * A * g - p * h * y + c * f * y
  26991. , I = m * f * u - d * A * u - m * h * g + l * A * g + d * h * y - l * f * y
  26992. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * y + l * p * y
  26993. , b = m * p * h - d * v * h - m * c * f + l * v * f + d * c * A - l * p * A
  26994. , w = r * C + o * I + a * E + s * b;
  26995. if (0 === w) {
  26996. var _ = "MathLight.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  26997. if (t)
  26998. throw new Error(_);
  26999. return console.warn(_),
  27000. this.identity()
  27001. }
  27002. var T = 1 / w;
  27003. return i[0] = C * T,
  27004. i[1] = (v * f * s - p * A * s - v * a * g + o * A * g + p * a * y - o * f * y) * T,
  27005. i[2] = (c * A * s - v * h * s + v * a * u - o * A * u - c * a * y + o * h * y) * T,
  27006. i[3] = (p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g) * T,
  27007. i[4] = I * T,
  27008. i[5] = (d * A * s - m * f * s + m * a * g - r * A * g - d * a * y + r * f * y) * T,
  27009. i[6] = (m * h * s - l * A * s - m * a * u + r * A * u + l * a * y - r * h * y) * T,
  27010. i[7] = (l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g) * T,
  27011. i[8] = E * T,
  27012. i[9] = (m * p * s - d * v * s - m * o * g + r * v * g + d * o * y - r * p * y) * T,
  27013. i[10] = (l * v * s - m * c * s + m * o * u - r * v * u - l * o * y + r * c * y) * T,
  27014. i[11] = (d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g) * T,
  27015. i[12] = b * T,
  27016. i[13] = (d * v * a - m * p * a + m * o * f - r * v * f - d * o * A + r * p * A) * T,
  27017. i[14] = (m * c * a - l * v * a - m * o * h + r * v * h + l * o * A - r * c * A) * T,
  27018. i[15] = (l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f) * T,
  27019. this
  27020. },
  27021. makeRotationFromQuaternion: function(e) {
  27022. var t = this.elements
  27023. , i = e.x
  27024. , n = e.y
  27025. , r = e.z
  27026. , o = e.w
  27027. , a = i + i
  27028. , s = n + n
  27029. , l = r + r
  27030. , c = i * a
  27031. , h = i * s
  27032. , u = i * l
  27033. , d = n * s
  27034. , p = n * l
  27035. , f = r * l
  27036. , g = o * a
  27037. , m = o * s
  27038. , v = o * l;
  27039. return t[0] = 1 - (d + f),
  27040. t[4] = h - v,
  27041. t[8] = u + m,
  27042. t[1] = h + v,
  27043. t[5] = 1 - (c + f),
  27044. t[9] = p - g,
  27045. t[2] = u - m,
  27046. t[6] = p + g,
  27047. t[10] = 1 - (c + d),
  27048. t[3] = 0,
  27049. t[7] = 0,
  27050. t[11] = 0,
  27051. t[12] = 0,
  27052. t[13] = 0,
  27053. t[14] = 0,
  27054. t[15] = 1,
  27055. this
  27056. }
  27057. },
  27058. r.Quaternion = function(e, t, i, n) {
  27059. this._x = e || 0,
  27060. this._y = t || 0,
  27061. this._z = i || 0,
  27062. this._w = void 0 !== n ? n : 1
  27063. }
  27064. ,
  27065. r.Quaternion.prototype = {
  27066. get x() {
  27067. return this._x
  27068. },
  27069. set x(e) {
  27070. this._x = e
  27071. },
  27072. get y() {
  27073. return this._y
  27074. },
  27075. set y(e) {
  27076. this._y = e
  27077. },
  27078. get z() {
  27079. return this._z
  27080. },
  27081. set z(e) {
  27082. this._z = e
  27083. },
  27084. get w() {
  27085. return this._w
  27086. },
  27087. set w(e) {
  27088. this._w = e
  27089. },
  27090. copy: function(e) {
  27091. this._x = e.x,
  27092. this._y = e.y,
  27093. this._z = e.z,
  27094. this._w = e.w
  27095. },
  27096. inverse: function() {
  27097. return this.conjugate().normalize()
  27098. },
  27099. conjugate: function() {
  27100. return this._x *= -1,
  27101. this._y *= -1,
  27102. this._z *= -1,
  27103. this
  27104. },
  27105. length: function() {
  27106. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  27107. },
  27108. normalize: function() {
  27109. var e = this.length();
  27110. return 0 === e ? (this._x = 0,
  27111. this._y = 0,
  27112. this._z = 0,
  27113. this._w = 1) : (e = 1 / e,
  27114. this._x = this._x * e,
  27115. this._y = this._y * e,
  27116. this._z = this._z * e,
  27117. this._w = this._w * e),
  27118. this
  27119. },
  27120. setFromAxisAngle: function(e, t) {
  27121. var i = t / 2
  27122. , n = Math.sin(i);
  27123. return this._x = e.x * n,
  27124. this._y = e.y * n,
  27125. this._z = e.z * n,
  27126. this._w = Math.cos(i),
  27127. this
  27128. },
  27129. setFromUnitVectors: function() {
  27130. var e, t, i = 1e-6;
  27131. return function(n, o) {
  27132. return void 0 === e && (e = new r.Vector3),
  27133. t = r.dot(n, o) + 1,
  27134. t < i ? (t = 0,
  27135. Math.abs(n.x) > Math.abs(n.z) ? r.setVector(e, -n.y, n.x, 0) : r.setVector(e, 0, -n.z, n.y)) : r.cross(n, o, e),
  27136. this._x = e.x,
  27137. this._y = e.y,
  27138. this._z = e.z,
  27139. this._w = t,
  27140. this.normalize()
  27141. }
  27142. }(),
  27143. multiply: function(e) {
  27144. return this.multiplyQuaternions(this, e)
  27145. },
  27146. premultiply: function(e) {
  27147. return this.multiplyQuaternions(e, this)
  27148. },
  27149. multiplyQuaternions: function(e, t) {
  27150. var i = e._x
  27151. , n = e._y
  27152. , r = e._z
  27153. , o = e._w
  27154. , a = t._x
  27155. , s = t._y
  27156. , l = t._z
  27157. , c = t._w;
  27158. return this._x = i * c + o * a + n * l - r * s,
  27159. this._y = n * c + o * s + r * a - i * l,
  27160. this._z = r * c + o * l + i * s - n * a,
  27161. this._w = o * c - i * a - n * s - r * l,
  27162. this
  27163. }
  27164. },
  27165. r.convertWorkshopVector = function(e) {
  27166. return new r.Vector3(-e.x,e.y,e.z)
  27167. }
  27168. ,
  27169. r.convertWorkshopQuaternion = function(e) {
  27170. return new r.Quaternion(-e.x,e.y,e.z,-e.w).multiply(new r.Quaternion(Math.sqrt(2) / 2,Math.sqrt(2) / 2,0,0))
  27171. }
  27172. ;
  27173. r.convertWorkshopOrthoZoom = function(e) {//xzw
  27174. //return e === -1 ? -1 : e / 16 * ($("#player").width() / $("#player").height()) / n.workshopApsect
  27175. return e === -1 ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight;
  27176. }
  27177. ,
  27178. r.convertWorkshopPanoramaQuaternion = function(e) {
  27179. return new r.Quaternion(e.x,-e.y,-e.z,e.w).normalize().multiply((new r.Quaternion).setFromAxisAngle(new r.Vector3(0,1,0), 270 * r.RADIANS_PER_DEGREE))
  27180. }
  27181. ,
  27182. r.normalize = function(e) {
  27183. var t = e.x * e.x + e.y * e.y + e.z * e.z
  27184. , i = Math.sqrt(t);
  27185. e.x /= i,
  27186. e.y /= i,
  27187. e.z /= i
  27188. }
  27189. ,
  27190. r.dot = function(e, t) {
  27191. return e.x * t.x + e.y * t.y + e.z * t.z
  27192. }
  27193. ,
  27194. r.cross = function(e, t, i) {
  27195. var n = e.x
  27196. , r = e.y
  27197. , o = e.z;
  27198. i.x = r * t.z - o * t.y,
  27199. i.y = o * t.x - n * t.z,
  27200. i.z = n * t.y - r * t.x
  27201. }
  27202. ,
  27203. r.setVector = function(e, t, i, n) {
  27204. e.x = t,
  27205. e.y = i,
  27206. e.z = n
  27207. }
  27208. ,
  27209. r.copyVector = function(e, t) {
  27210. t.x = e.x,
  27211. t.y = e.y,
  27212. t.z = e.z
  27213. }
  27214. ,
  27215. r.addVector = function(e, t) {
  27216. e.x += t.x,
  27217. e.y += t.y,
  27218. e.z += t.z
  27219. }
  27220. ,
  27221. r.subVector = function(e, t) {
  27222. e.x -= t.x,
  27223. e.y -= t.y,
  27224. e.z -= t.z
  27225. }
  27226. ,
  27227. r.applyQuaternionToVector = function(e, t) {
  27228. var i = t.x
  27229. , n = t.y
  27230. , r = t.z
  27231. , o = e.x
  27232. , a = e.y
  27233. , s = e.z
  27234. , l = e.w
  27235. , c = l * i + a * r - s * n
  27236. , h = l * n + s * i - o * r
  27237. , u = l * r + o * n - a * i
  27238. , d = -o * i - a * n - s * r;
  27239. t.x = c * l + d * -o + h * -s - u * -a,
  27240. t.y = h * l + d * -a + u * -o - c * -s,
  27241. t.z = u * l + d * -s + c * -a - h * -o
  27242. }
  27243. ,
  27244. r.angleBetweenVectors = function(e, t) {
  27245. return Math.acos(r.dot(e, t))
  27246. }
  27247. ,
  27248. t.exports = r
  27249. }
  27250. , {
  27251. "../constants": 8
  27252. }],
  27253. 177: [function(e, t, i) {
  27254. (function(i) {
  27255. "use strict";
  27256. function n(e) {
  27257. this.cache = null,
  27258. this.expires = 0
  27259. }
  27260. function r() {
  27261. this.baseUrl = null,
  27262. this.cache = null,
  27263. this.expires = 0
  27264. }
  27265. function o() {
  27266. this.baseUrl = null,
  27267. this.expires = 0
  27268. }
  27269. function a(e) {
  27270. this.initialLoadingPromise = null,
  27271. this.endpoint = e + "?type=3",
  27272. this.urlContainer = null,
  27273. this.authorizationHeader = h.getAuthorizationHeader(),
  27274. this.containerClasses = [o, r, n]
  27275. }
  27276. var s = e("./ajax")
  27277. , l = e("./logger")
  27278. , c = e("../constants")
  27279. , h = e("./showcase")
  27280. , u = (e("../ab"),
  27281. new l(i));
  27282. n.prototype = {
  27283. version: 1,
  27284. validate: function(e) {
  27285. return "catalog.json"in e && Object.keys(e).length > 0
  27286. },
  27287. update: function(e) {
  27288. return this.cache = e,
  27289. this.expires = Date.now() + c.signedUrlDefaultExpireTime,
  27290. $.when()
  27291. },
  27292. get: function(e) {
  27293. return this.cache[e]
  27294. }
  27295. },
  27296. r.prototype = {
  27297. version: 2,
  27298. validate: function(e) {
  27299. return "catalog.json"in e && "base.url"in e && Object.keys(e).length > 1
  27300. },
  27301. update: function(e) {
  27302. return this.baseUrl = e["base.url"],
  27303. this.cache = e,
  27304. this.expires = Date.now() + c.signedUrlDefaultExpireTime,
  27305. $.when()
  27306. },
  27307. get: function(e) {
  27308. var t = this.cache[e];
  27309. return t ? this.baseUrl.replace("{{filename}}", e) + t : null
  27310. }
  27311. },
  27312. o.prototype = {
  27313. version: 3,
  27314. validate: function(e) {
  27315. return e.templates && e.catalog_file && (!e.expires || 1e3 * e.expires > Date.now())
  27316. },
  27317. update: function(e) {
  27318. return this.baseUrl = e.templates[0],
  27319. e.expires ? this.expires = 1e3 * e.expires : this.expires = Date.now() + c.signedUrlDefaultExpireTime,
  27320. $.when()
  27321. },
  27322. get: function(e) {
  27323. return this.baseUrl.replace("{{filename}}", e)
  27324. }
  27325. },
  27326. a.prototype = {
  27327. init: function() {
  27328. return this.initialLoadingPromise ? this.initialLoadingPromise : (setInterval(function() {
  27329. var e = this.urlContainer ? this.urlContainer.expires : Date.now();
  27330. Date.now() + c.signedUrlRefreshBuffer > e && (u.debug("Refreshing urls..."),
  27331. this.refresh().done(function() {
  27332. u.debug("Refreshed")
  27333. }).fail(function() {
  27334. u.error("Failed url refresh, urls might go stale soon")
  27335. }))
  27336. }
  27337. .bind(this), c.signedUrlCheckInterval),
  27338. this.initialLoadingPromise = this.refresh(),
  27339. this.initialLoadingPromise)
  27340. },
  27341. refresh: function(e) { //已经在someData.js里加载过了 不用再加载file了吧
  27342. e = e || {};
  27343. /*var t = void 0 === e.cache || e.cache;
  27344. return s.get( this.endpoint , { //file
  27345. responseType: "json",
  27346. prefetchFrom: t ? "files" : null,
  27347. cache: t,
  27348. auth: this.authorizationHeader
  27349. }).then(function(e) {
  27350. if (this.urlContainer && this.urlContainer.validate(e))
  27351. return this.urlContainer.update(e);
  27352. for (var i = 0; i < this.containerClasses.length; i++) {
  27353. var n = this.containerClasses[i]
  27354. , r = new n;
  27355. if (r.validate(e))
  27356. return u.info("Using urls version " + r.version),
  27357. this.urlContainer = r,
  27358. this.urlContainer.update(e)
  27359. }
  27360. return t ? this.refresh({
  27361. cache: !1
  27362. }) : $.Deferred().reject("missing-urls")
  27363. }
  27364. .bind(this), function(e) {
  27365. return "loading-failed"
  27366. }) */
  27367. return $.Deferred().resolve();
  27368. },
  27369. get: function(e) {
  27370. //return this.urlContainer.get(e)
  27371. return g_Prefix + window.MP_PREFETCHED_MODELDATA.files.templates[0].replace("{{filename}}", e)
  27372. }
  27373. },
  27374. t.exports = a
  27375. }
  27376. ).call(this, "/js/util/ModelUrls.js")
  27377. }
  27378. , {
  27379. "../ab": 3,
  27380. "../constants": 8,
  27381. "./ajax": 181,
  27382. "./logger": 189,
  27383. "./showcase": 193
  27384. }],
  27385. 178: [function(e, t, i) {
  27386. (function(i) {
  27387. "use strict";
  27388. function n() {
  27389. u.call(this),
  27390. this.neighbourMap = {},
  27391. this.map = null
  27392. }
  27393. var r = e("three")
  27394. , o = e("./common")
  27395. , a = e("../settings")
  27396. , s = e("../objects/Panorama")
  27397. , a = e("../settings")
  27398. , l = e("./aStar")
  27399. , c = e("./logger")
  27400. , h = new c(i)
  27401. , u = e("./IndexedCollection")
  27402. , d = e("./transitions");
  27403. o.inherit(n, u),
  27404. n.prototype.getIndex = function(e) {
  27405. return e.id
  27406. }
  27407. ,
  27408. n.prototype.find = function(e, t) {
  27409. var i = o.filterAll(this.list, e);
  27410. return 0 === i.length ? null : (t && t.forEach(function(e) {
  27411. i = o.stableSort(i, e)
  27412. }),
  27413. i[0])
  27414. }
  27415. ,
  27416. n.prototype.sortByScore = function(e, t) {
  27417. var i = o.filterAll(this.list, e);
  27418. return 0 === i.length ? null : i = i.map(function(e) {
  27419. return {
  27420. pano: e,
  27421. score: t.reduce(function(t, i) {
  27422. return t + i(e)
  27423. }, 0)
  27424. }
  27425. }).sort(function(e, t) {
  27426. return t.score - e.score;
  27427. })
  27428. }
  27429. ,
  27430. n.prototype.lowestByScore = function(e, t, i) {
  27431. return this.findRankedByScore(0, e, t, i)
  27432. }
  27433. ,
  27434. n.prototype.findRankedByScore = function(e, t, i, n) {
  27435. n && (n.candidates = null,
  27436. n.pano = null),
  27437. e || (e = 0);
  27438. var r = this.sortByScore(t, i);
  27439. return !r || 0 === r.length || e >= r.length ? null : (n && (n.candidates = r,
  27440. n.pano = r[e].pano),
  27441. r[e].pano)
  27442. }
  27443. ,
  27444. n.prototype.showPanoScores = function(e) {
  27445. this.list.forEach(function(e) {
  27446. e.removeTextSprite()
  27447. });
  27448. var t = 6344768;
  27449. e.forEach(function(e) {
  27450. e.pano.addTextSprite(e.score.toFixed(2), t),
  27451. t = 16428055
  27452. })
  27453. }
  27454. ,
  27455. n.prototype.isNeighbour = function(e, t) {
  27456. return this.neighbourMap[e.id][t.id]
  27457. }
  27458. ,
  27459. n.prototype.getNeighbours = function(e) {
  27460. return this.neighbourMap[e.id]
  27461. }
  27462. ,
  27463. n.prototype.setNeighbour = function(e, t, i) {
  27464. return this.neighbourMap[e.id] || (this.neighbourMap[e.id] = {}),
  27465. this.neighbourMap[t.id] || (this.neighbourMap[t.id] = {}),
  27466. this.neighbourMap[e.id][e.id] = !0,
  27467. this.neighbourMap[t.id][t.id] = !0,
  27468. this.neighbourMap[e.id][t.id] = i,
  27469. this.neighbourMap[t.id][e.id] = i,
  27470. this.neighbourMap[e.id]
  27471. }
  27472. ,
  27473. n.prototype.findClosest = function(e, t) {
  27474. var i = [s.filters.isPanoAligned()];
  27475. return t && i.push(s.filters.inDirection(e, t, .75)),
  27476. this.find(i, [s.sortFunctions.distanceToPoint(e)])
  27477. }
  27478. ,
  27479. n.prototype.dualNeighbors = function(e, t) {
  27480. var i, n = [];
  27481. for (i in this.neighbourMap[e.id])
  27482. this.neighbourMap[t.id][i] && n.push(i);
  27483. return n
  27484. }
  27485. ,
  27486. n.prototype.populate_path_graph = function() {
  27487. var e, t, i, n, o, a, s, l, c = Date.now(), u = {}, d = 0, p = new r.Vector3(0,0,0), f = 0, g = 0;
  27488. for (e = 0; e < this.list.length; e += 1) {
  27489. o = this.list[e],
  27490. s = {},
  27491. l = !1,
  27492. i = o.neighbourPanos || o.findNeighourPanos();
  27493. for (t in i)
  27494. if (i[t]) {
  27495. a = this.index[t],
  27496. p.copy(o.floorPosition),
  27497. p.sub(a.floorPosition);
  27498. var m = Math.sqrt(p.x * p.x + p.z * p.z)
  27499. , v = (Math.abs(p.y) / Math.max(m, .01),
  27500. Math.max(0, Math.abs(p.y) - .2));
  27501. v > 0 ? (f += 1,
  27502. v = Math.pow(4 * v, 2),
  27503. m = Math.pow(m, 2),
  27504. n = Math.sqrt(v * v + m * m)) : (g += 1,
  27505. n = p.length()),
  27506. s[a.id] = n,
  27507. l = !0
  27508. }
  27509. l ? u[o.id] = s : d += 1
  27510. }
  27511. this.map = u,
  27512. h.info("graph ready in " + (Date.now() - c) + "ms, " + d + " had no neighbors")
  27513. }
  27514. ,
  27515. n.prototype.aStarSearch = function(e, t) {
  27516. var i = Date.now()
  27517. , n = new l({
  27518. start: e,
  27519. isEnd: function(e) {
  27520. return e === t
  27521. },
  27522. neighbor: function(e) {
  27523. var t = e.neighbourPanos || e.findNeighourPanos()
  27524. , i = [];
  27525. for (var n in t)
  27526. i.push(this.index[n]);
  27527. return i
  27528. }
  27529. .bind(this),
  27530. distance: function(e, t) {
  27531. var i = this.map[e.id]
  27532. , n = i[t.id];
  27533. return n
  27534. }
  27535. .bind(this),
  27536. heuristic: function(e, t) {
  27537. return 1
  27538. }
  27539. .bind(this),
  27540. hash: function(e) {
  27541. return e.id
  27542. },
  27543. timeout: 5e3
  27544. });
  27545. if (h.debug("A* search in " + (Date.now() - i) + "ms"),
  27546. "success" !== n.status)
  27547. return h.debug("Did not find A* path from " + e + " to " + t),
  27548. null;
  27549. h.debug("Total cost " + n.cost.toPrecision(3) + ", " + n.path.length + " steps");
  27550. var r = [];
  27551. return n.path.forEach(function(e) {
  27552. r.push(e.id)
  27553. }),
  27554. r
  27555. }
  27556. ,
  27557. n.prototype.includeNodesNearPath = function() {
  27558. var e = new r.Vector3
  27559. , t = new r.Vector3
  27560. , i = new r.Vector3
  27561. , n = new r.Vector3
  27562. , o = new r.Vector3
  27563. , a = new r.Vector3
  27564. , s = new r.Vector3
  27565. , l = new r.Vector3
  27566. , c = []
  27567. , h = new r.Vector3
  27568. , u = new r.Vector3;
  27569. return function(r, d) {
  27570. if (r)
  27571. for (var p = function(e, t, i) {
  27572. return o.copy(t).sub(e),
  27573. o.dot(i)
  27574. }, f = function(e, t) {
  27575. return p(h, e.position, i) - p(h, t.position, i)
  27576. }, g = 0; g < r.length - 1; ) {
  27577. var m = r[g]
  27578. , v = r[g + 1]
  27579. , A = this.index[m]
  27580. , y = this.index[v];
  27581. h.copy(A.position),
  27582. u.copy(y.position),
  27583. c.length = 0,
  27584. e.copy(u).sub(h),
  27585. i.copy(e).normalize();
  27586. for (var C = 0; C < this.list.length; C++) {
  27587. var I = this.list[C];
  27588. o.copy(I.position).sub(h);
  27589. var E = o.dot(i);
  27590. if (E > 0) {
  27591. s.copy(i),
  27592. s.multiplyScalar(E),
  27593. a.copy(o),
  27594. a.sub(s);
  27595. var b = a.length();
  27596. if (b < d) {
  27597. t.copy(e).negate(),
  27598. n.copy(t).normalize(),
  27599. l.copy(I.position).sub(u);
  27600. var w = l.dot(n);
  27601. w > 0 && c.push(I)
  27602. }
  27603. }
  27604. }
  27605. if (c.length > 0) {
  27606. c.sort(f);
  27607. for (var _ = r.length + c.length - 1; _ >= g + c.length; _--)
  27608. r[_] = r[_ - c.length];
  27609. for (var T = 0; T < c.length; T++)
  27610. r[T + g + 1] = c[T].id
  27611. }
  27612. g += c.length + 1
  27613. }
  27614. }
  27615. }(),
  27616. n.prototype.fadeMarkerOpacity = function(e, t) {
  27617. var i = void 0 === e ? a.panorama.markerOpacity : e
  27618. , n = this.list.findIndex(function(e) {
  27619. return e.marker
  27620. });
  27621. if (!(n < 0)) {
  27622. var r = this.list[n].marker.material.opacity;
  27623. if (r !== e) {
  27624. var o = i - r;
  27625. d.trigger({
  27626. func: function(e, t) {
  27627. var i = r + e * o;
  27628. this.forEach(function(e) {
  27629. e.marker && (e.marker.material.opacity = i)
  27630. })
  27631. }
  27632. .bind(this),
  27633. duration: void 0 === t ? a.markerOpacityTransitionTime : t,
  27634. name: "_fpm"
  27635. })
  27636. }
  27637. }
  27638. }
  27639. ,
  27640. t.exports = n
  27641. }
  27642. ).call(this, "/js/util/PanoramaCollection.js")
  27643. }
  27644. , {
  27645. "../objects/Panorama": 148,
  27646. "../settings": 166,
  27647. "./IndexedCollection": 175,
  27648. "./aStar": 180,
  27649. "./common": 185,
  27650. "./logger": 189,
  27651. "./transitions": 195,
  27652. three: 217
  27653. }],
  27654. 179: [function(e, t, i) {
  27655. "use strict";
  27656. function n() {
  27657. this.actionSequence = [],
  27658. this.actionSequenceInProgress = !1
  27659. }
  27660. function r(e, t, i, n) {
  27661. s.trackAlways("zoom_" + e, {
  27662. from: t,
  27663. to: i,
  27664. pano: n
  27665. })
  27666. }
  27667. function o(e, t) {
  27668. r("initial", 1, e, t)
  27669. }
  27670. function a(e, t, i) {
  27671. r("followup", e, t, i)
  27672. }
  27673. var s = e("../analytics");
  27674. n.prototype.reset = function(e) {
  27675. this.actionSequenceInProgress = !1,
  27676. this.actionSequence.length = 0
  27677. }
  27678. ,
  27679. n.prototype.addZoomAction = function() {
  27680. var e = null
  27681. , t = null
  27682. , i = !1
  27683. , n = function() {
  27684. if (e = null,
  27685. this.actionSequence.length > 0) {
  27686. var i = this.actionSequence[0].start
  27687. , n = this.actionSequence[this.actionSequence.length - 1].end;
  27688. 1 === i ? o(n, t) : a(i, n, t)
  27689. }
  27690. this.reset()
  27691. };
  27692. return function(r, o, a) {
  27693. if (r !== o) {
  27694. i || (n = n.bind(this),
  27695. i = !0),
  27696. e && (window.clearTimeout(e),
  27697. e = null),
  27698. a === t && this.actionSequenceInProgress || (this.reset(),
  27699. t = a),
  27700. this.actionSequenceInProgress = !0;
  27701. var s = {
  27702. start: r,
  27703. end: o
  27704. };
  27705. this.actionSequence.push(s),
  27706. e = window.setTimeout(n, 150)
  27707. }
  27708. }
  27709. }(),
  27710. t.exports = n
  27711. }
  27712. , {
  27713. "../analytics": 4
  27714. }],
  27715. 180: [function(e, t, i) {
  27716. "use strict";
  27717. function n(e) {
  27718. void 0 === e.timeout && (e.timeout = 1 / 0);
  27719. var t = e.hash || o
  27720. , i = {
  27721. data: e.start,
  27722. g: 0,
  27723. h: e.heuristic(e.start)
  27724. }
  27725. , n = i;
  27726. i.f = i.h;
  27727. var h = new s
  27728. , u = new l(a)
  27729. , d = c();
  27730. u.push(i),
  27731. d.set(t(i.data), i);
  27732. for (var p = new Date; u.size(); ) {
  27733. if (new Date - p > e.timeout)
  27734. return {
  27735. status: "timeout",
  27736. cost: n.g,
  27737. path: r(n)
  27738. };
  27739. var f = u.pop();
  27740. if (d.delete(t(f.data)),
  27741. e.isEnd(f.data))
  27742. return {
  27743. status: "success",
  27744. cost: f.g,
  27745. path: r(f)
  27746. };
  27747. h.add(t(f.data));
  27748. for (var g = e.neighbor(f.data), m = 0; m < g.length; m++) {
  27749. var v = g[m];
  27750. if (!h.contains(t(v))) {
  27751. var A = f.g + e.distance(f.data, v)
  27752. , y = d.get(t(v))
  27753. , C = !1;
  27754. if (void 0 === y)
  27755. y = {
  27756. data: v
  27757. },
  27758. d.set(t(v), y);
  27759. else {
  27760. if (y.g < A)
  27761. continue;
  27762. C = !0
  27763. }
  27764. y.parent = f,
  27765. y.g = A,
  27766. y.h = e.heuristic(v),
  27767. y.f = A + y.h,
  27768. y.h < n.h && (n = y),
  27769. C ? u.heapify() : u.push(y)
  27770. }
  27771. }
  27772. }
  27773. return {
  27774. status: "noPath",
  27775. cost: n.g,
  27776. path: r(n)
  27777. }
  27778. }
  27779. function r(e) {
  27780. if (void 0 !== e.parent) {
  27781. var t = r(e.parent);
  27782. return t.push(e.data),
  27783. t
  27784. }
  27785. return [e.data]
  27786. }
  27787. function o(e) {
  27788. return e.toString()
  27789. }
  27790. function a(e, t) {
  27791. return e.f - t.f
  27792. }
  27793. var s = e("Set")
  27794. , l = e("heap")
  27795. , c = e("dict");
  27796. t.exports = n
  27797. }
  27798. , {
  27799. Set: 196,
  27800. dict: 210,
  27801. heap: 211
  27802. }],
  27803. 181: [function(e, t, i) {
  27804. (function(i) {
  27805. "use strict";
  27806. function n(e, t, i) {
  27807. var n = new XMLHttpRequest;
  27808. if (i && "withCredentials"in n)
  27809. n.open(e, t, i);
  27810. else if ("undefined" != typeof XDomainRequest)
  27811. n = new XDomainRequest,
  27812. n.open(e, t);
  27813. else {
  27814. if (i)
  27815. throw "Browser does not support CORS!";
  27816. n.open(e, t)
  27817. }
  27818. return n
  27819. }
  27820. function r(e, t, i) {
  27821. function o() {
  27822. u.warn("Retrying ", t),
  27823. r(e, t, i).done(c.resolve.bind(c)).progress(c.notify.bind(c)).fail(c.reject.bind(c))
  27824. }
  27825. function a(e, t) {
  27826. var i = e.response;
  27827. if ("json" === t && "object" != typeof i)
  27828. try {
  27829. i = JSON.parse(e.responseText)
  27830. } catch (e) {
  27831. return void c.reject({
  27832. error: "Failed parsing JSON"
  27833. })
  27834. }
  27835. else if ("image/jpeg" === t) {
  27836. var n = new Uint8Array(e.response)
  27837. , r = new Blob([n],{
  27838. type: "image/jpeg"
  27839. })
  27840. , o = URL.createObjectURL(r);
  27841. i = new Image,
  27842. i.src = o,
  27843. i.crossOrigin = "Anonymous",
  27844. i.onload = function() {
  27845. URL.revokeObjectURL(o)
  27846. }
  27847. }
  27848. return i
  27849. }
  27850. var s = n(e, t, !1);
  27851. if (i = i || {},
  27852. i.retries = void 0 !== i.retries ? i.retries : 0,
  27853. i.retry = void 0 !== i.retry ? i.retry : "get" === e.toLowerCase(),
  27854. i.responseType)
  27855. if (["arraybuffer", "text", "json"].indexOf(i.responseType) > -1)
  27856. s.responseType = i.responseType;
  27857. else {
  27858. if ("image/jpeg" !== i.responseType)
  27859. throw new Error('reponseType can only be one of "arraybuffer", "text" or "json", "image/jpeg"');
  27860. s.responseType = "arraybuffer"
  27861. }
  27862. if ("json" === i.responseType && s.setRequestHeader("Accept", "application/json"),
  27863. i.auth && s.setRequestHeader("Authorization", i.auth),
  27864. "object" == typeof i.data && (i.data = JSON.stringify(i.data),
  27865. s.setRequestHeader("Content-Type", "application/json")),
  27866. "object" == typeof i.headers)
  27867. for (var l in i.headers)
  27868. s.setRequestHeader(l, i.headers[l]);
  27869. var c = $.Deferred();
  27870. return s.onreadystatechange = function(e) {
  27871. if (4 === this.readyState)
  27872. if (this.status >= 500 && this.status <= 600 && i.retry && i.retries < 3)
  27873. i.retries++,
  27874. setTimeout(o, 1e3);
  27875. else if (200 === this.status) {
  27876. var t = a(this, i.responseType);
  27877. c.resolve(t)
  27878. } else
  27879. c.reject(this)
  27880. }
  27881. ,
  27882. s.onprogress = function(e) {
  27883. c.notify(e)
  27884. }
  27885. ,
  27886. s.send(i.data),
  27887. c.promise()
  27888. }
  27889. function o(e) {
  27890. return Object.keys(e).sort().map(function(t) {
  27891. return {
  27892. key: t,
  27893. value: e[t]
  27894. }
  27895. })
  27896. }
  27897. function a(e, t) {
  27898. var i = t.responseType || null
  27899. , n = t.auth || null
  27900. , r = t.prefetchFrom || null
  27901. , a = e + "__" + i + "__" + n + "__" + r;
  27902. return t.headers && o(t.headers).forEach(function(e) {
  27903. a += "__" + e.key + ":" + e.value
  27904. }),
  27905. a
  27906. }
  27907. function s(e, t) {
  27908. return window.MP_REQUEST_CACHE ? window.MP_REQUEST_CACHE[a(e, t)] : null
  27909. }
  27910. function l(e, t, i) {
  27911. window.MP_REQUEST_CACHE && (window.MP_REQUEST_CACHE[a(e, t)] = i)
  27912. }
  27913. var c = e("./logger")
  27914. , h = e("../ab")
  27915. , u = new c(i);
  27916. window.URL = window.URL || window.webkitURL,
  27917. window.MP_REQUEST_CACHE = window.MP_REQUEST_CACHE || {},
  27918. window.MP_PREFETCHED_MODELDATA = window.MP_PREFETCHED_MODELDATA || {}
  27919. /* setTimeout(function() {//MP-- xzw delete
  27920. window.MP_REQUEST_CACHE = null,
  27921. window.MP_PREFETCHED_MODELDATA = {}
  27922. }, 6e4),
  27923. window.onpageshow = function(e) {
  27924. e.persisted && (window.MP_REQUEST_CACHE = null,
  27925. window.MP_PREFETCHED_MODELDATA = {})
  27926. } */
  27927. ,
  27928. t.exports = {
  27929. get: function(e, t) {
  27930. t = t || {};
  27931. var i = void 0 === t.cache || t.cache;
  27932. if (i) {
  27933. var n = s(e, t);
  27934. if (n)
  27935. return n
  27936. }
  27937. var o;
  27938. return o = t.prefetchFrom && window.MP_PREFETCHED_MODELDATA[t.prefetchFrom] ? $.when(window.MP_PREFETCHED_MODELDATA[t.prefetchFrom]) : r("GET", e, t),
  27939. i && l(e, t, o),
  27940. o
  27941. },
  27942. post: function(e, t) {
  27943. return r("POST", e, t)
  27944. },
  27945. patch: function(e, t) {
  27946. return r("PATCH", e, t)
  27947. },
  27948. getImage: function(e, t) {
  27949. function i() {
  27950. u.warn("Retrying ", e),
  27951. o.getImage(e, t - 1).done(n.resolve.bind(n)).progress(n.notify.bind(n)).fail(n.reject.bind(n))
  27952. }
  27953. var n = $.Deferred()
  27954. , r = new Image
  27955. , o = this;
  27956. return e = h.changeIfImageOptimzing(e),
  27957. null !== t && void 0 !== t || (t = 3),
  27958. r.onerror = function() {
  27959. t > 0 ? setTimeout(i, 1e3) : n.reject()
  27960. }
  27961. ,
  27962. r.onload = function() {
  27963. n.resolve(r)
  27964. }
  27965. ,
  27966. r.crossOrigin = "anonymous",
  27967. r.src = e,
  27968. n
  27969. }
  27970. }
  27971. }
  27972. ).call(this, "/js/util/ajax.js")
  27973. }
  27974. , {
  27975. "../ab": 3,
  27976. "./logger": 189
  27977. }],
  27978. 182: [function(e, t, i) {
  27979. "use strict";
  27980. function n(e, t) {
  27981. var i = window.navigator.userAgent
  27982. , n = i.match(e);
  27983. return n = n ? n[1].split(t) : [],
  27984. {
  27985. major: parseInt(n[0]) || 0,
  27986. minor: parseInt(n[1]) || 0,
  27987. patch: parseInt(n[2]) || 0
  27988. }
  27989. }
  27990. var r = e("../exception/DeviceMismatchException");
  27991. t.exports = {
  27992. isFullscreen: function() {
  27993. return document.fullscreenElement || document.mozFullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement
  27994. },
  27995. supportsFullscreen: function() {
  27996. return document.fullscreenEnabled || document.mozFullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled || document.msFullscreenEnabled
  27997. },
  27998. isPointerLocked: function() {
  27999. return document.pointerLockElement || document.mozPointerLockElement || document.webkitPointerLockElement
  28000. },
  28001. requestFullscreen: function(e, t) {
  28002. e.requestFullscreen ? e.requestFullscreen() : e.mozRequestFullScreen ? e.mozRequestFullScreen() : e.webkitRequestFullscreen ? e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT) : e.msRequestFullscreen && e.msRequestFullscreen(),
  28003. t && $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", browser.requestPointerLock)
  28004. },
  28005. requestPointerLock: function() {
  28006. var e;
  28007. if (document.fullscreenElement)
  28008. e = document.fullscreenElement();
  28009. else if (document.mozFullscreenElement)
  28010. e = document.mozFullscreenElement();
  28011. else if (document.mozFullScreenElement)
  28012. e = document.mozFullScreenElement();
  28013. else {
  28014. if (!document.webkitFullscreenElement)
  28015. return;
  28016. e = document.webkitFullscreenElement()
  28017. }
  28018. e.requestPointerLock = e.requestPointerLock || e.mozRequestPointerLock || e.webkitRequestPointerLock,
  28019. e.requestPointerLock(),
  28020. $(document).off("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", this)
  28021. },
  28022. exitPointerLock: function() {
  28023. document.exitPointerLock = document.exitPointerLock || document.mozExitPointerLock || document.webkitExitPointerLock,
  28024. document.exitPointerLock()
  28025. },
  28026. exitFullscreen: function() {
  28027. document.exitFullscreen ? document.exitFullscreen() : document.msExitFullscreen ? document.msExitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.webkitExitFullscreen && document.webkitExitFullscreen()
  28028. },
  28029. details: function() {
  28030. var e = navigator.userAgent.match("(Firefox|Chrome|Safari)/([\\d]+)");
  28031. return e ? {
  28032. name: e[1],
  28033. version: parseInt(e[2]),
  28034. platform: navigator.platform
  28035. } : {}
  28036. },
  28037. is: function(e) {
  28038. return this.details() && this.details().name === e
  28039. },
  28040. inIframe: function() {
  28041. return window.parent !== window
  28042. },
  28043. aspectRatio: function() {
  28044. var e = $("#player").width() / $("#player").height();
  28045. return isFinite(e) ? e : 0
  28046. },
  28047. userAgent: function() {
  28048. return window.navigator.userAgent
  28049. },
  28050. isMobile: function() {
  28051. var e = navigator.userAgent || navigator.vendor || window.opera;
  28052. 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))
  28053. },
  28054. isLandscape: function() {
  28055. return this.isMobile && this.aspectRatio() > 1
  28056. },
  28057. isSmallScreen: function() {
  28058. var e = screen.width / window.devicePixelRatio;
  28059. return e < 240
  28060. },
  28061. detectIE: function() {
  28062. var e = window.navigator.userAgent
  28063. , t = e.indexOf("MSIE ");
  28064. return t !== -1 || !!navigator.userAgent.match(/Trident.*rv\:11\./)
  28065. },
  28066. detectSafari: function() {
  28067. var e = window.navigator.userAgent
  28068. , t = e.indexOf("Safari");
  28069. return t !== -1 && !this.detectChrome()
  28070. },
  28071. detectFirefox: function() {
  28072. var e = window.navigator.userAgent;
  28073. return e.indexOf("Firefox") !== -1
  28074. },
  28075. detectChrome: function() {
  28076. var e = window.navigator.userAgent;
  28077. return e.indexOf("Chrome") !== -1 && !this.detectOpera()
  28078. },
  28079. detectOpera: function() {
  28080. var e = window.navigator.userAgent;
  28081. return e.indexOf("OPR") !== -1
  28082. },
  28083. detectIOS: function() {
  28084. return this.detectIPhone() || this.detectIPad() || this.detectIPod()
  28085. },
  28086. detectIPad: function() {
  28087. var e = window.navigator.userAgent
  28088. , t = /iPad/;
  28089. return t.test(e)
  28090. },
  28091. detectIPod: function() {
  28092. var e = window.navigator.userAgent
  28093. , t = /iPod/;
  28094. return t.test(e)
  28095. },
  28096. detectIPhone: function() {
  28097. var e = window.navigator.userAgent
  28098. , t = /iPhone/;
  28099. return t.test(e)
  28100. },
  28101. detectAndroid: function() {
  28102. var e = window.navigator.userAgent;
  28103. return e.indexOf("Android") !== -1
  28104. },
  28105. detectAndroidMobile: function() {
  28106. var e = window.navigator.userAgent;
  28107. return this.detectAndroid() && e.indexOf("Mobile") !== -1
  28108. },
  28109. detectSamsungNative: function() {
  28110. var e = window.navigator.userAgent;
  28111. return e.indexOf("SM-G900H") !== -1 || e.indexOf("GT-I9500") !== -1 || e.indexOf("SM-N900") !== -1
  28112. },
  28113. detectSamsungS6: function() {
  28114. var e = window.navigator.userAgent;
  28115. return e.indexOf("SM-G92") !== -1
  28116. },
  28117. detectWebVR: function() {
  28118. return !(!window.navigator.getVRDisplays || !window.VRDisplay)
  28119. },
  28120. getVRDisplay: function() {
  28121. var e = $.Deferred();
  28122. return this.detectWebVR() ? (navigator.getVRDisplays().then(function(t) {
  28123. t.length >= 1 && e.resolve(t[0]),
  28124. e.reject(null)
  28125. }),
  28126. e) : e.reject(null)
  28127. },
  28128. iosVersion: function() {
  28129. if (!this.detectIOS())
  28130. throw new r("Did not detect an iDevice");
  28131. var e = /((?:\d+\_?){1,3}) like Mac OS/
  28132. , t = "_";
  28133. return n(e, t)
  28134. },
  28135. androidVersion: function() {
  28136. if (!this.detectAndroid())
  28137. throw new r("Did not detect an Android based device");
  28138. var e = /Android ((?:\d+\.?){1,3})/
  28139. , t = ".";
  28140. return n(e, t)
  28141. },
  28142. valueFromCookie: function(e, t) {
  28143. var i = new RegExp(e + "=([0-9a-f]+)(; ?|$)").exec(document.cookie);
  28144. if (!i)
  28145. return t;
  28146. var n = i[1];
  28147. return "boolean" == typeof t ? "true" === n || "1" === n : "number" == typeof t ? parseFloat(n) : n
  28148. },
  28149. valueFromHash: function(e, t) {
  28150. var i = new RegExp("[#&?]" + e + "=([^#&?]*)")
  28151. , n = i.exec(window.location.href);
  28152. if (!n)
  28153. return t;
  28154. var r = n[1];
  28155. return "boolean" == typeof t ? "true" === r || "1" === r : "number" == typeof t ? parseFloat(r) : window.decodeURIComponent(r)
  28156. }
  28157. }
  28158. }
  28159. , {
  28160. "../exception/DeviceMismatchException": 56
  28161. }],
  28162. 183: [function(e, t, i) {
  28163. (function(i) {
  28164. "use strict";
  28165. function n(e, t) {
  28166. var i = r(t);
  28167. if (Object.keys(i).length > 0)
  28168. return i;
  28169. if (e.heroImage)
  28170. i = o(e, t);
  28171. else if (e.data.camera_start) {
  28172. var n = e.data.camera_start;
  28173. try {
  28174. Object.keys(n).length > 0 && !l.isEmptyQuaternion(n.camera.quaternion) && (i.mode = h.convertWorkshopModeInt(n.mode),
  28175. i.position = n.camera.position,
  28176. //i.quaternion = n.camera.quaternion,
  28177. i.quaternion = new th.Quaternion().fromArray(n.camera.quaternion),//xzw
  28178. i.zoom = l.convertWorkshopOrthoZoom(n.camera.zoom),
  28179. n.pano && (i.pano = t.get(n.pano.uuid) || t.findClosest(i.position),
  28180. d.debug("Using camera_start"),
  28181. d.debug("Modeldata pano: ", i.pano.quaternion),
  28182. d.debug("Camera start pano: ", n.pano.quaternion)),
  28183. i.mode !== h.PANORAMA && (i.floorVisibility = e.heroImage.metadata.floor_visibility))
  28184. } catch (e) {
  28185. d.warn(e.message)
  28186. }
  28187. }
  28188. if (e.outsideAllowed() || i.mode === h.PANORAMA || (i = {}),
  28189. i.mode === h.MESH && i.position && (i.mode = h.PANORAMA,
  28190. i.pano = t.findClosest(i.position),
  28191. i.quaternion = i.pano.quaternion),
  28192. 0 === Object.keys(i).length) {
  28193. var a = t.list[0];
  28194. a && (i.mode = h.PANORAMA,
  28195. i.pano = a,
  28196. i.position = a.position,
  28197. i.quaternion = a.quaternion,
  28198. d.info("Starting at 1st pano " + a.id))
  28199. }
  28200. return i.mode = i.mode || h.DOLLHOUSE,
  28201. i
  28202. }
  28203. function r(e) {
  28204. var t = c.valueFromHash("start", "")
  28205. , i = {};
  28206. if ("" !== t) {
  28207. d.debug("Start override found in parameters, trying to parse..."),
  28208. i = a(t) || {};
  28209. var n = c.valueFromHash("tag", null);
  28210. n && (i.tag = n),
  28211. i.panoId && (i.pano = e.get(i.panoId))
  28212. }
  28213. return i
  28214. }
  28215. function o(e, t) {
  28216. if (!e.heroImage || !e.heroImage.metadata.camera_position)
  28217. return {};
  28218. var i = {}
  28219. , n = e.heroImage.metadata;
  28220. d.debug("Using start position from thumbnail image"),
  28221. i.position = n.camera_position,
  28222. i.quaternion = n.camera_quaternion;
  28223. try {
  28224. i.mode = h.convertWorkshopModeInt(n.camera_mode),
  28225. i.mode === h.PANORAMA ? i.pano = t.get(n.scan_id) : i.floorVisibility = n.floor_visibility
  28226. } catch (e) {
  28227. d.debug(e.message)
  28228. }
  28229. return i
  28230. }
  28231. function a(e) {
  28232. return s.deserialize(e)
  28233. }
  28234. var s = e("../controls/serializer")
  28235. , l = e("../util/math")
  28236. , c = e("./browser")
  28237. , h = e("../enum/Viewmode")
  28238. , u = e("../util/logger")
  28239. , th = e("three")//xzw
  28240. , d = new u(i);
  28241. t.exports = {
  28242. getStartCameraOptions: n
  28243. }
  28244. }
  28245. ).call(this, "/js/util/camera.js")
  28246. }
  28247. , {
  28248. "../controls/serializer": 14,
  28249. "../enum/Viewmode": 51,
  28250. "../util/logger": 189,
  28251. "../util/math": 190,
  28252. "./browser": 182,
  28253. "three": 217
  28254. }],
  28255. 184: [function(e, t, i) {
  28256. "use strict";
  28257. function n(e, t, i) {
  28258. return o(e.fov, t, i)
  28259. }
  28260. var r = e("./MathLight")
  28261. , o = function(e, t, i) {
  28262. var n = t
  28263. , o = i
  28264. , a = 2 * Math.atan(Math.tan(e * r.RADIANS_PER_DEGREE / 2) * (n / o)) * r.DEGREES_PER_RADIAN;
  28265. return a
  28266. }
  28267. , a = function(e, t, i) {
  28268. var n = t
  28269. , o = i
  28270. , a = 2 * Math.atan(Math.tan(e * r.RADIANS_PER_DEGREE / 2) * (o / n)) * r.DEGREES_PER_RADIAN;
  28271. return a
  28272. }
  28273. , s = function(e, t, i, n) {
  28274. var r = o(e, i, n);
  28275. return r > t ? a(t, i, n) : e
  28276. };
  28277. t.exports = {
  28278. clampVFOV: s,
  28279. getHFOVForCamera: n,
  28280. getHFOVFromVFOV: o,
  28281. getVFOVFromHFOV: a
  28282. }
  28283. }
  28284. , {
  28285. "./MathLight": 176
  28286. }],
  28287. 185: [function(e, t, i) {
  28288. "use strict";
  28289. var n = e("three");
  28290. t.exports = {
  28291. delayOneFrame: function(e) {
  28292. window.setTimeout(e, 1)
  28293. },
  28294. normalizeUrl: function(e) {
  28295. return e.replace("https://", "http://")
  28296. },
  28297. domainFromUrl: function(e) {
  28298. var t = /^([^:]*:\/\/)?(www\.)?([^\/]+)/.exec(e);
  28299. return t ? t[3] : e
  28300. },
  28301. average: function(e, t) {
  28302. if (0 === e.length)
  28303. return null;
  28304. for (var i = 0, n = 0, r = 0; r < e.length; r++) {
  28305. var o = t ? e[r][t] : e[r];
  28306. i += o,
  28307. n++
  28308. }
  28309. return i / n
  28310. },
  28311. countUnique: function(e) {
  28312. for (var t = {}, i = 0; i < e.length; i++)
  28313. t[e[i]] = 1 + (t[e[i]] || 0);
  28314. return Object.keys(t).length
  28315. },
  28316. averageVectors: function(e, t) {
  28317. var i = new n.Vector3;
  28318. if (0 === e.length)
  28319. return i;
  28320. for (var r = 0, o = 0; o < e.length; o++) {
  28321. var a = t ? e[o][t] : e[o];
  28322. i.add(a),
  28323. r++
  28324. }
  28325. return i.divideScalar(r)
  28326. },
  28327. equalLists: function(e, t) {
  28328. if (e.length !== t.length)
  28329. return !1;
  28330. for (var i = 0; i < e.length; i++)
  28331. if (e[i] !== t[i])
  28332. return !1;
  28333. return !0
  28334. },
  28335. lowerMedian: function(e, t) {
  28336. if (0 === e.length)
  28337. return null;
  28338. t = t || 2,
  28339. e.sort(function(e, t) {
  28340. return e - t
  28341. });
  28342. var i = Math.floor(e.length / t);
  28343. return e[i]
  28344. },
  28345. stableSort: function(e, t) {
  28346. return e.map(function(e, t) {
  28347. return {
  28348. value: e,
  28349. index: t
  28350. }
  28351. }).sort(function(e, i) {
  28352. var n = t(e.value, i.value);
  28353. return 0 !== n ? n : e.index - i.index
  28354. }).map(function(e) {
  28355. return e.value
  28356. })
  28357. },
  28358. filterAll: function(e, t) {
  28359. return e.filter(function(e) {
  28360. return t.every(function(t) {
  28361. return t(e)
  28362. })
  28363. })
  28364. },
  28365. formatDate: function(e) {
  28366. return [e.getFullYear(), e.getMonth() + 1, e.getDate()].join("-")
  28367. },
  28368. formatDatetime: function(e) {
  28369. return [e.getFullYear(), e.getMonth() + 1, e.getDate(), e.getHours(), e.getMinutes()].join("-")
  28370. },
  28371. randomString: function(e) {
  28372. for (var t = "", i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", n = 0; n < e; n++)
  28373. t += i.charAt(Math.floor(Math.random() * i.length));
  28374. return t
  28375. },
  28376. uint8ToBase64: function(e, t) {
  28377. t && "number" == typeof t || (t = 8192);
  28378. for (var i = [], n = 0; n < e.length; n += t)
  28379. i.push(String.fromCharCode.apply(null, e.subarray(n, n + t)));
  28380. return btoa(i.join(""))
  28381. },
  28382. uuid4: function e(t) {
  28383. return t ? (t ^ 16 * Math.random() >> t / 4).toString(16) : ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, e)
  28384. },
  28385. nth: function(e) {
  28386. return e %= 10,
  28387. 1 === e ? e + "st" : 2 === e ? e + "nd" : 3 === e ? e + "rd" : e + "th"
  28388. },
  28389. extendObject: function(e, t) {
  28390. return Object.keys(t).forEach(function(i) {
  28391. e[i] = t[i]
  28392. }),
  28393. e
  28394. },
  28395. deepExtend: function e(t) {
  28396. t = t || {};
  28397. for (var i = 1; i < arguments.length; i++) {
  28398. var n = arguments[i];
  28399. if (n)
  28400. for (var r in n)
  28401. n.hasOwnProperty(r) && ("object" == typeof n[r] ? t[r] = e(t[r], n[r]) : t[r] = n[r])
  28402. }
  28403. return t
  28404. },
  28405. inherit: function(e, t) {
  28406. e.prototype = Object.create(t.prototype),
  28407. e.prototype.constructor = e
  28408. },
  28409. extend: function(e, t) {
  28410. for (var i in t.prototype)
  28411. e.prototype[i] = t.prototype[i]
  28412. }
  28413. },
  28414. Math.sign = function(e) {
  28415. return e < 0 ? -1 : 1
  28416. }
  28417. }
  28418. , {
  28419. three: 217
  28420. }],
  28421. 186: [function(e, t, i) {
  28422. "use strict";
  28423. var n = {};
  28424. n.linearTween = function(e, t, i, n) {
  28425. return i * e / n + t
  28426. }
  28427. ,
  28428. n.easeInQuad = function(e, t, i, n) {
  28429. return e /= n,
  28430. i * e * e + t
  28431. }
  28432. ,
  28433. n.easeOutQuad = function(e, t, i, n) {
  28434. return e /= n,
  28435. -i * e * (e - 2) + t
  28436. }
  28437. ,
  28438. n.easeInOutQuad = function(e, t, i, n) {
  28439. return e /= n / 2,
  28440. e < 1 ? i / 2 * e * e + t : (e--,
  28441. -i / 2 * (e * (e - 2) - 1) + t)
  28442. }
  28443. ,
  28444. n.easeInCubic = function(e, t, i, n) {
  28445. return e /= n,
  28446. i * e * e * e + t
  28447. }
  28448. ,
  28449. n.easeOutCubic = function(e, t, i, n) {
  28450. return e /= n,
  28451. e--,
  28452. i * (e * e * e + 1) + t
  28453. }
  28454. ,
  28455. n.easeInOutCubic = function(e, t, i, n) {
  28456. return e /= n / 2,
  28457. e < 1 ? i / 2 * e * e * e + t : (e -= 2,
  28458. i / 2 * (e * e * e + 2) + t)
  28459. }
  28460. ,
  28461. n.easeInQuart = function(e, t, i, n) {
  28462. return e /= n,
  28463. i * e * e * e * e + t
  28464. }
  28465. ,
  28466. n.easeOutQuart = function(e, t, i, n) {
  28467. return e /= n,
  28468. e--,
  28469. -i * (e * e * e * e - 1) + t
  28470. }
  28471. ,
  28472. n.easeInOutQuart = function(e, t, i, n) {
  28473. return e /= n / 2,
  28474. e < 1 ? i / 2 * e * e * e * e + t : (e -= 2,
  28475. -i / 2 * (e * e * e * e - 2) + t)
  28476. }
  28477. ,
  28478. n.easeInQuint = function(e, t, i, n) {
  28479. return e /= n,
  28480. i * e * e * e * e * e + t
  28481. }
  28482. ,
  28483. n.easeOutQuint = function(e, t, i, n) {
  28484. return e /= n,
  28485. e--,
  28486. i * (e * e * e * e * e + 1) + t
  28487. }
  28488. ,
  28489. n.easeInOutQuint = function(e, t, i, n) {
  28490. return e /= n / 2,
  28491. e < 1 ? i / 2 * e * e * e * e * e + t : (e -= 2,
  28492. i / 2 * (e * e * e * e * e + 2) + t)
  28493. }
  28494. ,
  28495. n.easeInSine = function(e, t, i, n) {
  28496. return -i * Math.cos(e / n * (Math.PI / 2)) + i + t
  28497. }
  28498. ,
  28499. n.easeOutSine = function(e, t, i, n) {
  28500. return i * Math.sin(e / n * (Math.PI / 2)) + t
  28501. }
  28502. ,
  28503. n.easeInOutSine = function(e, t, i, n) {
  28504. return -i / 2 * (Math.cos(Math.PI * e / n) - 1) + t
  28505. }
  28506. ,
  28507. n.easeInExpo = function(e, t, i, n) {
  28508. return i * Math.pow(2, 10 * (e / n - 1)) + t
  28509. }
  28510. ,
  28511. n.easeOutExpo = function(e, t, i, n) {
  28512. return i * (-Math.pow(2, -10 * e / n) + 1) + t
  28513. }
  28514. ,
  28515. n.easeInOutExpo = function(e, t, i, n) {
  28516. return e /= n / 2,
  28517. e < 1 ? i / 2 * Math.pow(2, 10 * (e - 1)) + t : (e--,
  28518. i / 2 * (-Math.pow(2, -10 * e) + 2) + t)
  28519. }
  28520. ,
  28521. n.easeInCirc = function(e, t, i, n) {
  28522. return e /= n,
  28523. -i * (Math.sqrt(1 - e * e) - 1) + t
  28524. }
  28525. ,
  28526. n.easeOutCirc = function(e, t, i, n) {
  28527. return e /= n,
  28528. e--,
  28529. i * Math.sqrt(1 - e * e) + t
  28530. }
  28531. ,
  28532. n.easeInOutCirc = function(e, t, i, n) {
  28533. return e /= n / 2,
  28534. e < 1 ? -i / 2 * (Math.sqrt(1 - e * e) - 1) + t : (e -= 2,
  28535. i / 2 * (Math.sqrt(1 - e * e) + 1) + t)
  28536. }
  28537. ,
  28538. n.easeInElastic = function(e, t, i, n) {
  28539. var r = 1.70158
  28540. , o = 0
  28541. , a = i;
  28542. return 0 === e ? t : 1 === (e /= n) ? t + i : (o || (o = .3 * n),
  28543. a < Math.abs(i) ? (a = i,
  28544. r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a),
  28545. -(a * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o)) + t)
  28546. }
  28547. ,
  28548. n.easeOutElastic = function(e, t, i, n) {
  28549. var r = 1.70158
  28550. , o = 0
  28551. , a = i;
  28552. return 0 === e ? t : 1 === (e /= n) ? t + i : (o || (o = .3 * n),
  28553. a < Math.abs(i) ? (a = i,
  28554. r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a),
  28555. a * Math.pow(2, -10 * e) * Math.sin((e * n - r) * (2 * Math.PI) / o) + i + t)
  28556. }
  28557. ,
  28558. n.easeInOutElastic = function(e, t, i, n) {
  28559. var r = 1.70158
  28560. , o = 0
  28561. , a = i;
  28562. return 0 === e ? t : 2 === (e /= n / 2) ? t + i : (o || (o = n * (.3 * 1.5)),
  28563. a < Math.abs(i) ? (a = i,
  28564. r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a),
  28565. e < 1 ? -.5 * (a * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o)) + t : a * Math.pow(2, -10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o) * .5 + i + t)
  28566. }
  28567. ,
  28568. n.easeInBack = function(e, t, i, n, r) {
  28569. return void 0 === r && (r = 1.70158),
  28570. i * (e /= n) * e * ((r + 1) * e - r) + t
  28571. }
  28572. ,
  28573. n.easeOutBack = function(e, t, i, n, r) {
  28574. return void 0 === r && (r = 1.70158),
  28575. i * ((e = e / n - 1) * e * ((r + 1) * e + r) + 1) + t
  28576. }
  28577. ,
  28578. n.easeInOutBack = function(e, t, i, n, r) {
  28579. return void 0 === r && (r = 1.70158),
  28580. (e /= n / 2) < 1 ? i / 2 * (e * e * (((r *= 1.525) + 1) * e - r)) + t : i / 2 * ((e -= 2) * e * (((r *= 1.525) + 1) * e + r) + 2) + t
  28581. }
  28582. ,
  28583. n.easeOutBounce = function(e, t, i, n) {
  28584. 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
  28585. }
  28586. ,
  28587. n.easeInBounce = function(e, t, i, r) {
  28588. return i - n.easeOutBounce(r - e, 0, i, r) + t
  28589. }
  28590. ,
  28591. n.easeInOutBounce = function(e, t, i, r) {
  28592. return e < r / 2 ? .5 * n.easeInBounce(2 * e, 0, i, r) + t : .5 * n.easeOutBounce(x, 2 * e - r, 0, i, r) + .5 * i + t
  28593. }
  28594. ,
  28595. t.exports = n
  28596. }
  28597. , {}],
  28598. 187: [function(e, t, i) {
  28599. "use strict";
  28600. function n() {
  28601. this.events = [],
  28602. this.valid = !1
  28603. }
  28604. var r = e("../enum/Joystick");
  28605. n.prototype.push = function(e, t) {
  28606. this.events.push({
  28607. direction: e,
  28608. pano: t
  28609. }),
  28610. this.valid = !0
  28611. }
  28612. ,
  28613. n.prototype.pop = function(e) {
  28614. var t = this.events.pop();
  28615. return this.events.length < 1 && (this.valid = !1),
  28616. t
  28617. }
  28618. ,
  28619. n.prototype.peek = function() {
  28620. return this.events.length ? this.events[this.events.length - 1] : {
  28621. direction: null,
  28622. pano: null
  28623. }
  28624. }
  28625. ,
  28626. n.prototype.invalidate = function() {
  28627. this.events = [],
  28628. this.valid = !1
  28629. }
  28630. ,
  28631. n.prototype.reversePano = function(e) {
  28632. if (!this.valid)
  28633. return null;
  28634. var t = this.peek();
  28635. return r.opposite(e) === t.direction ? (this.pop(),
  28636. t.pano) : null
  28637. }
  28638. ,
  28639. t.exports = n
  28640. }
  28641. , {
  28642. "../enum/Joystick": 29
  28643. }],
  28644. 188: [function(e, t, i) {
  28645. "use strict";
  28646. t.exports = {
  28647. vector: function(e, t) {
  28648. var i = e.clone();
  28649. return t = t.clone(),
  28650. function(n) {
  28651. e.set(i.x * (1 - n) + t.x * n, i.y * (1 - n) + t.y * n, i.z * (1 - n) + t.z * n)
  28652. }
  28653. },
  28654. quaternion: function(e, t) {
  28655. var i = e.clone();
  28656. return function(n) {
  28657. e.copy(i).slerp(t, n)
  28658. }
  28659. },
  28660. property: function(e, t, i, n) {
  28661. var r = e[t];
  28662. return function(o) {
  28663. e[t] = r * (1 - o) + i * o,
  28664. n && n(e[t])
  28665. }
  28666. },
  28667. uniform: function(e, t, i) {
  28668. var n = e.material.uniforms[t].value;
  28669. return function(r) {
  28670. e.material.uniforms[t] && (e.material.uniforms[t].value = n * (1 - r) + i * r)
  28671. }
  28672. },
  28673. matrix4: function(e, t) {
  28674. var i = e.clone();
  28675. return function(n) {
  28676. for (var r = e.elements, o = i.elements, a = t.elements, s = 0; s < 16; s++)
  28677. r[s] = o[s] * (1 - n) + a[s] * n
  28678. }
  28679. },
  28680. allUniforms: function(e, t, i) {
  28681. var n = e.map(function(e) {
  28682. return this.uniform(e, t, i)
  28683. }
  28684. .bind(this));
  28685. return function(e) {
  28686. n.forEach(function(t) {
  28687. t(e)
  28688. })
  28689. }
  28690. }
  28691. }
  28692. }
  28693. , {}],
  28694. 189: [function(e, t, i) {
  28695. "use strict";
  28696. function n(e) {
  28697. var t, i, o, a, s = e.split("/"), l = "[" + s[s.length - 1].replace(".js", "") + "]", c = {};
  28698. if (n.consoleEnabled) {
  28699. var h = function(e) {
  28700. $("#debug-console").append("<p>" + e + "</p>"),
  28701. $("#debug-console")[0].scrollTop = $("#debug-console")[0].scrollHeight
  28702. };
  28703. t = function(e) {
  28704. h(Array.prototype.slice.call(arguments).join(" "))
  28705. }
  28706. ,
  28707. i = function(e) {
  28708. h(Array.prototype.slice.call(arguments).join(" "))
  28709. }
  28710. ,
  28711. o = function(e) {
  28712. h("WARN: " + Array.prototype.slice.call(arguments).join(" "))
  28713. }
  28714. ,
  28715. a = function(e) {
  28716. h("ERROR: " + Array.prototype.slice.call(arguments).join(" "))
  28717. }
  28718. } else
  28719. console.log ? (t = console.log,
  28720. i = console.info ? console.info : console.log,
  28721. o = console.warn ? console.warn : console.log,
  28722. a = console.error ? console.error : console.log) : t = i = o = a = function() {}
  28723. ;
  28724. var u = function(e) {
  28725. return [l, n.timestamp()].concat(Array.prototype.slice.call(e))
  28726. }
  28727. , d = function(t, i) {
  28728. if (r) {
  28729. var o = Array.prototype.slice.call(t).join(" ");
  28730. r.captureMessage(o, {
  28731. level: i,
  28732. path: e,
  28733. timestamp: n.timestamp()
  28734. })
  28735. }
  28736. }
  28737. , p = function(t, i) {
  28738. if (r) {
  28739. var o = Array.prototype.slice.call(t).join(" ");
  28740. r.captureException(new Error(o), {
  28741. level: i,
  28742. path: e,
  28743. timestamp: n.timestamp()
  28744. })
  28745. }
  28746. };
  28747. return {
  28748. debug: function() {
  28749. n.level >= n.levels.debug && t.apply(console, u(arguments))
  28750. },
  28751. info: function() {
  28752. n.level >= n.levels.info && i.apply(console, u(arguments))
  28753. },
  28754. warn: function() {
  28755. d(arguments, "warn"),
  28756. n.level >= n.levels.warn && o.apply(console, u(arguments))
  28757. },
  28758. error: function() {
  28759. p(arguments, "error"),
  28760. n.level >= n.levels.error && a.apply(console, u(arguments))
  28761. },
  28762. v3str: function(e, t) {
  28763. var i = void 0 === t ? 2 : t;
  28764. return "(" + e.x.toPrecision(i) + ", " + e.y.toPrecision(i) + ", " + e.z.toPrecision(i) + ")"
  28765. },
  28766. eulstr: function(e, t) {
  28767. var i = void 0 === t ? 2 : t;
  28768. return "(" + THREE.Math.radToDeg(e.x).toPrecision(i) + ", " + THREE.Math.radToDeg(e.y).toPrecision(i) + ", " + THREE.Math.radToDeg(e.z).toPrecision(i) + ' "' + e.order + '")'
  28769. },
  28770. time: function(e) {
  28771. n.level >= n.levels.debug && (c[e] = Date.now())
  28772. },
  28773. timeEnd: function(e) {
  28774. if (n.level >= n.levels.debug) {
  28775. var t = c[e];
  28776. if (!t)
  28777. return;
  28778. var i = (Date.now() - t) / 1e3;
  28779. this.debug(e, i + "s")
  28780. }
  28781. }
  28782. }
  28783. }
  28784. var r = window.Raven;
  28785. n.timestamp = function() {
  28786. return (Date.now() - window.navigationStart) / 1e3 + "s"
  28787. }
  28788. ,
  28789. n.levels = {
  28790. debug: 3,
  28791. info: 2,
  28792. warn: 1,
  28793. error: 0
  28794. },
  28795. n.level = n.levels.info,
  28796. t.exports = n
  28797. }
  28798. , {}],
  28799. 190: [function(e, t, i) {
  28800. "use strict";
  28801. var n = e("three")
  28802. , r = e("../enum/GLCubeFaces")
  28803. , o = e("../constants");
  28804. t.exports = {
  28805. convertVisionVector: function(e) {
  28806. return new n.Vector3(e.x,e.z,-e.y)
  28807. },
  28808. convertVisionQuaternion: function(e) {
  28809. return new n.Quaternion(e.x,e.z,-e.y,e.w).multiply((new n.Quaternion).setFromAxisAngle(new n.Vector3(0,1,0), n.Math.degToRad(90)))
  28810. },
  28811. convertWorkshopVector: function(e) {
  28812. return new n.Vector3(-e.x,e.y,e.z)
  28813. },
  28814. convertWorkshopQuaternion: function(e) {
  28815. return new n.Quaternion(-e.x,e.y,e.z,-e.w).multiply(new n.Quaternion(Math.sqrt(2) / 2,Math.sqrt(2) / 2,0,0))
  28816. },
  28817. convertWorkshopPanoramaQuaternion: function(e) {
  28818. return new n.Quaternion(e.x,-e.y,-e.z,e.w).normalize().multiply((new n.Quaternion).setFromAxisAngle(new n.Vector3(0,1,0), n.Math.degToRad(270)))
  28819. },
  28820. convertWorkshopOrthoZoom: function(e) {// xzw
  28821. //return e === -1 ? -1 : e / 16 * ($("#player").width() / $("#player").height()) / o.workshopApsect
  28822. //return e;
  28823. return e === -1 ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight;
  28824. },
  28825. toPrecision: function(e, t) {//xzw change
  28826. var f = function(e, t){
  28827. var i = Math.pow(10, t);
  28828. return Math.round(e * i) / i
  28829. }
  28830. if(e instanceof Array){
  28831. for(var s=0; s<e.length; s++){
  28832. e[s] = f(e[s],t);
  28833. }
  28834. return e;
  28835. }
  28836. else return f(e,t)
  28837. },
  28838. isEmptyQuaternion: function(e) {
  28839. return 0 === Math.abs(e.x) && 0 === Math.abs(e.y) && 0 === Math.abs(e.z) && 0 === Math.abs(e.w)
  28840. },
  28841. projectPositionToCanvas: function(e, t, i) {
  28842. i = i || new n.Vector3,
  28843. i.copy(e);
  28844. var r = .5 * $("#player").width()
  28845. , o = .5 * $("#player").height();
  28846. return i.project(t),
  28847. i.x = i.x * r + r,
  28848. i.y = -(i.y * o) + o,
  28849. i
  28850. },
  28851. convertScreenPositionToNDC: function(e, t, i) {
  28852. return i = i || new n.Vector2,
  28853. i.x = e / $("#player").width() * 2 - 1,
  28854. i.y = 2 * -(t / $("#player").height()) + 1,
  28855. i
  28856. },
  28857. constrainedTurn: function(e) {
  28858. var t = e % (2 * Math.PI);
  28859. return t = t > Math.PI ? t -= 2 * Math.PI : t < -Math.PI ? t += 2 * Math.PI : t
  28860. },
  28861. getFOVDotThreshold: function(e) {
  28862. return Math.cos(n.Math.degToRad(e / 2))
  28863. },
  28864. transform2DForwardVectorByCubeFace: function(e, t, i, n) {
  28865. switch (e) {
  28866. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  28867. i.set(1, t.y, t.x);
  28868. break;
  28869. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  28870. i.set(-1, t.y, -t.x);
  28871. break;
  28872. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  28873. i.set(-t.x, 1, -t.y);
  28874. break;
  28875. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  28876. i.set(-t.x, -1, t.y);
  28877. break;
  28878. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  28879. i.set(-t.x, t.y, 1);
  28880. break;
  28881. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  28882. i.set(t.x, t.y, -1)
  28883. }
  28884. n && i.normalize()
  28885. }
  28886. }
  28887. }
  28888. , {
  28889. "../constants": 8,
  28890. "../enum/GLCubeFaces": 25,
  28891. three: 217
  28892. }],
  28893. 191: [function(e, t, i) {
  28894. "use strict";
  28895. function n(e, t, i) {
  28896. return a.map(function(n, o) {
  28897. return e.get("pan/" + i + "/" + t + "_skybox" + r(n) + ".jpg")
  28898. }
  28899. .bind(this))
  28900. }
  28901. function r(e) {
  28902. return s[e]
  28903. }
  28904. var o = e("../enum/GLCubeFaces")
  28905. , a = [0, 1, 2, 3, 4, 5]
  28906. , s = {
  28907. 0: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  28908. 1: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  28909. 2: o.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  28910. 3: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  28911. 4: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  28912. 5: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  28913. };
  28914. t.exports = {
  28915. mapFaceToCubemapFace: r,
  28916. getCubemapUrls: n
  28917. }
  28918. }
  28919. , {
  28920. "../enum/GLCubeFaces": 25
  28921. }],
  28922. 192: [function(e, t, i) {
  28923. "use strict";
  28924. t.exports = {
  28925. captureErrors: function(e, t, i) {
  28926. if ("Raven"in window) {
  28927. Raven.config(e, t).install(),
  28928. i && Raven.setTagsContext(i);
  28929. var n = console.warn
  28930. , r = console.error;
  28931. console.warn = function() {
  28932. var e = Array.prototype.slice.call(arguments);
  28933. Raven.captureMessage(e.join(" "), {
  28934. level: "warning"
  28935. }),
  28936. n.apply(console, e)
  28937. }
  28938. ,
  28939. console.error = function() {
  28940. var e = Array.prototype.slice.call(arguments);
  28941. Raven.captureException(new Error(e.join(" ")), {
  28942. level: "error"
  28943. }),
  28944. r.apply(console, e)
  28945. }
  28946. } else
  28947. console.error("Raven not found, not capturing errors.")
  28948. }
  28949. }
  28950. }
  28951. , {}],
  28952. 193: [function(e, t, i) {
  28953. (function(i) {
  28954. "use strict";
  28955. var n = e("./browser")
  28956. , r = e("../constants")
  28957. , o = e("url")
  28958. , a = e("./logger")
  28959. , ss = e('three')
  28960. , s = new a(i)
  28961. , l = {
  28962. getAuthorizationHeader: function() {
  28963. var e = n.valueFromHash("auth");
  28964. if (e)
  28965. return e.replace(",", " ");
  28966. var t = n.valueFromCookie("token");
  28967. return t ? "Token " + t : null
  28968. },
  28969. parseSidUrl: function(e) {
  28970. var t, i;
  28971. if (e = e || "",
  28972. e.match(/^https?/)) {
  28973. var n = o.parse(e);
  28974. t = n.protocol + "//" + n.host,
  28975. i = e
  28976. } else //xzw 原先的不能用
  28977. //t = window.location.protocol + "//" + window.location.host, //MP
  28978. t = ""
  28979. //i = t + "/api/player/models/" + e; //MP
  28980. i = t + "data/" + e;
  28981. return {
  28982. urlBase: t,
  28983. urlModel: i,
  28984. urlFiles: i + (i.match(/\/$/) ? "files" : "/files"),
  28985. urlThumb: i + (i.match(/\/$/) ? "thumb" : "/thumb")
  28986. }
  28987. },
  28988. getModelIDFromQueryString: function() {
  28989. return n.valueFromHash("model") || n.valueFromHash("m")
  28990. },
  28991. normalizeModeldata: function(e, t) {//xzw 修改导览images数据
  28992. e = JSON.parse(JSON.stringify(e));
  28993. var i = null;
  28994. if (e.images.forEach(function(n) {
  28995. if(!n.metadata) return;
  28996. if ("string" == typeof n.metadata)
  28997. try {
  28998. n.metadata = JSON.parse(n.metadata)
  28999. } catch (e) {
  29000. s.warn("Unable to parse image metadata"),
  29001. n.metadata = null
  29002. }
  29003. else{
  29004. "object" == typeof n.metadata && s.debug("image.metadata already a JSON object");
  29005. }
  29006. if(n.metadata.camera_position instanceof Array){//xzw 改的格式
  29007. n.metadata.camera_position = new ss.Vector3().fromArray(n.metadata.camera_position);
  29008. n.metadata.camera_quaternion = new ss.Quaternion().fromArray(n.metadata.camera_quaternion);
  29009. }else{
  29010. n.metadata.camera_quaternion && (n.metadata.camera_quaternion = t.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  29011. n.metadata.camera_position && (n.metadata.camera_position = t.convertWorkshopVector(n.metadata.camera_position))
  29012. }
  29013. !i && e.icon && e.icon === n.sid && (i = n.metadata)
  29014. }),
  29015. //icon初始视角的:
  29016. i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
  29017. var n = {};
  29018. n.pano = {
  29019. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  29020. position: t.convertWorkshopVector(i.scan_position),
  29021. uuid: i.scan_id
  29022. },
  29023. n.camera = {
  29024. quaternion: i.camera_quaternion,
  29025. position: i.camera_position
  29026. },
  29027. e.startPano = n
  29028. }
  29029. return e
  29030. },
  29031. visionVersionToInt: function() {
  29032. var e = new RegExp(["(?:[0-9.]+\\.){1,4}", "([0-9]+)", "[^\\.]*$"].join(""));
  29033. return function(t) {
  29034. if (!t)
  29035. throw new Error("Vision version is required");
  29036. var i = e.exec(t);
  29037. if (null === i)
  29038. throw new Error("String is not a vision version: " + t);
  29039. return parseInt(i[1])
  29040. }
  29041. }(),
  29042. modelDataPromisesTiles: function(e) {
  29043. if (e.vision_version)
  29044. try {
  29045. return l.visionVersionToInt(e.vision_version) >= l.visionVersionToInt(r.visionTilingStartVersion)
  29046. } catch (t) {
  29047. s.warn("Invalid vision version: " + e.vision_version)
  29048. }
  29049. var t = e.created ? new Date(e.created) : null;
  29050. return t && t >= r.visionTilingStartDate
  29051. }
  29052. };
  29053. t.exports = l
  29054. }
  29055. ).call(this, "/js/util/showcase.js")
  29056. }
  29057. , {
  29058. "../constants": 8,
  29059. "./browser": 182,
  29060. "./logger": 189,
  29061. three:217,
  29062. url: 208
  29063. }],
  29064. 194: [function(e, t, i) {
  29065. "use strict";
  29066. var n = e("../util/ajax")
  29067. , r = e("three")
  29068. , o = e("../settings")
  29069. , a = {};
  29070. t.exports = {
  29071. load: function(e, t, i) {
  29072. var s = a[e];
  29073. return s ? (t && setTimeout(function() {
  29074. t(s)
  29075. }, 1),
  29076. s) : (s = new r.Texture,
  29077. o.minimalMemoryMode && (s.minFilter = r.LinearFilter,
  29078. s.magFilter = r.LinearFilter,
  29079. s.generateMipmaps = !1),
  29080. s.sourceFile = e,
  29081. a[e] = s,
  29082. n.getImage(e).then(function(e) {
  29083. s.image = e,
  29084. s.needsUpdate = !0,
  29085. t && t(s)
  29086. }).fail(i),
  29087. s)
  29088. },
  29089. loadBase64: function(e, t) {
  29090. t = t || "png";
  29091. var i = new r.Texture;
  29092. return i.image = document.createElement("img"),
  29093. i.image.setAttribute("src", "data:image/" + t + ";base64," + e),
  29094. o.minimalMemoryMode && (i.minFilter = r.LinearFilter,
  29095. i.magFilter = r.LinearFilter,
  29096. i.generateMipmaps = !1),
  29097. i.needsUpdate = !0,
  29098. i
  29099. },
  29100. isLoaded: function(e) {
  29101. return !!a[e]
  29102. }
  29103. }
  29104. }
  29105. , {
  29106. "../settings": 166,
  29107. "../util/ajax": 181,
  29108. three: 217
  29109. }],
  29110. 195: [function(e, t, i) {
  29111. "use strict";
  29112. var n = e("./easing");
  29113. t.exports = {
  29114. globalDone: null,
  29115. funcs: [],
  29116. counter: 0,
  29117. uniqueID: 0,
  29118. start: function(e, t, i, r, o, a, s) {
  29119. return r = r || 0,
  29120. this.funcs.push({
  29121. func: e,
  29122. current: -r * Math.abs(t),
  29123. duration: (1 - Math.max(r, 0)) * Math.abs(t),
  29124. done: i,
  29125. easing: o || n.linearTween,
  29126. cycling: t < 0,
  29127. running: !0,
  29128. debug: r < 0,
  29129. name: a || "T" + this.counter,
  29130. id: void 0 === s ? this.counter : s,
  29131. paused: !1
  29132. }),
  29133. e(0, 16),
  29134. this.counter += 1,
  29135. e
  29136. },
  29137. trigger: function(e) {
  29138. var t = void 0 === e.delayRatio ? 0 : e.delayRatio
  29139. , i = e.func || function() {}
  29140. , r = void 0 === e.duration ? 0 : e.duration;
  29141. void 0 !== e.cycling && e.cycling && (r = -Math.abs(r));
  29142. var o = e.done || null
  29143. , a = e.easing || n.linearTween
  29144. , s = e.name || "R" + this.counter
  29145. , l = void 0 === e.id ? this.counter : e.id;
  29146. return this.start(i, r, o, t, a, s, l)
  29147. },
  29148. setTimeout: function(e, t, i) {
  29149. var n = void 0 === i ? this.counter : i;
  29150. return this.trigger({
  29151. done: e,
  29152. duration: void 0 === t ? 0 : t,
  29153. name: "O" + this.counter,
  29154. id: n
  29155. })
  29156. },
  29157. pause: function() {
  29158. this.paused = !0
  29159. },
  29160. resume: function() {
  29161. this.paused = !1
  29162. },
  29163. update: function(e) {
  29164. this.funcs.forEach(function(t) {
  29165. if (!(t.paused || (t.current += 1e3 * e,
  29166. t.current < 0)))
  29167. if (t.current >= t.duration && !t.cycling) {
  29168. var i = t.easing(1, 0, 1, 1);
  29169. t.func(i, 1e3 * e),
  29170. t.done && t.done(),
  29171. t.running = !1
  29172. } else {
  29173. var n = t.easing(t.current % t.duration / t.duration, 0, 1, 1)
  29174. , r = t.func(n, 1e3 * e) || !1;
  29175. r && (t.done && t.done(),
  29176. t.running = !1)
  29177. }
  29178. });
  29179. var t = this.funcs.length;
  29180. this.funcs = this.funcs.filter(function(e) {
  29181. return e.running
  29182. });
  29183. var i = this.funcs.length;
  29184. if (t > 0 && 0 === i && this.globalDone) {
  29185. var n = this.globalDone;
  29186. this.globalDone = null,
  29187. n()
  29188. }
  29189. },
  29190. adjustSpeed: function(e, t) {
  29191. for (var i = this.getById(e), n = 0; n < i.length; n++) {
  29192. var r = i[n];
  29193. r.duration /= t,
  29194. r.current /= t
  29195. }
  29196. },
  29197. getById: function(e) {
  29198. return this.funcs.filter(function(t) {
  29199. return e === t.id
  29200. })
  29201. },
  29202. get: function(e) {
  29203. for (var t = 0; t < this.funcs.length; t += 1)
  29204. if (this.funcs[t].func === e)
  29205. return this.funcs[t];
  29206. return null
  29207. },
  29208. isRunning: function(e) {
  29209. var t = this.get(e);
  29210. return null !== t && t.running
  29211. },
  29212. countActive: function() {
  29213. for (var e = 0, t = 0; t < this.funcs.length; t += 1)
  29214. e += this.funcs[t].running;
  29215. return e
  29216. },
  29217. listActive: function() {
  29218. for (var e = [], t = 0; t < this.funcs.length; t += 1)
  29219. this.funcs[t].running && e.push(this.funcs[t].name);
  29220. return e
  29221. },
  29222. done: function(e) {
  29223. this.globalDone = e
  29224. },
  29225. cancelById: function(e) {
  29226. var t = void 0 === e ? 0 : e;
  29227. this.funcs = this.funcs.filter(function(e) {
  29228. return e.id !== t
  29229. })
  29230. },
  29231. cancel: function(e) {
  29232. this.funcs = this.funcs.filter(function(t) {
  29233. return t.func !== e
  29234. })
  29235. },
  29236. getUniqueId: function() {
  29237. return this.uniqueID -= 1,
  29238. this.uniqueID
  29239. }
  29240. }
  29241. }
  29242. , {
  29243. "./easing": 186
  29244. }],
  29245. 196: [function(e, t, i) {
  29246. function n(e) {
  29247. if (this.set = {},
  29248. this.infContains = function() {
  29249. return !0
  29250. }
  29251. ,
  29252. "object" == typeof e)
  29253. if (e instanceof Array)
  29254. for (var t = 0; t < e.length; t++)
  29255. this.set[e[t]] = !0;
  29256. else
  29257. this.set = e;
  29258. else if ("function" == typeof e)
  29259. this.infContains = e;
  29260. else if ("undefined" != typeof e)
  29261. throw new Error("set must be either an array or an object.")
  29262. }
  29263. t.exports = n,
  29264. n.prototype.contains = function(e) {
  29265. return !!this.set[e]
  29266. }
  29267. ,
  29268. n.prototype.has = n.prototype.contains,
  29269. n.prototype.add = function(e) {
  29270. if (1 == arguments.length)
  29271. this.set[e] = !0;
  29272. else
  29273. for (var t = 0; t < arguments.length; t++)
  29274. this.set[arguments[t]] = !0
  29275. }
  29276. ,
  29277. n.prototype.addAll = function(e) {
  29278. if ("object" != typeof e && !(e instanceof Array))
  29279. throw new Error("arr must be an array.");
  29280. for (var t = 0; t < e.length; t++)
  29281. this.add(e[t])
  29282. }
  29283. ,
  29284. n.prototype.remove = function(e) {
  29285. if (1 == arguments.length)
  29286. delete this.set[e];
  29287. else
  29288. for (var t = 0; t < arguments.length; t++)
  29289. delete this.set[arguments[t]]
  29290. }
  29291. ,
  29292. n.prototype.delete = n.prototype.remove,
  29293. n.prototype.clear = function() {
  29294. this.set = {}
  29295. }
  29296. ,
  29297. n.prototype.size = function() {
  29298. return Object.keys(this.set).length
  29299. }
  29300. ,
  29301. n.prototype.toString = function() {
  29302. return "{" + Object.keys(this.set).toString() + "}"
  29303. }
  29304. ,
  29305. n.prototype.toArray = function() {
  29306. return "undefined" == typeof this.set ? [] : Object.keys(this.set)
  29307. }
  29308. ,
  29309. n.prototype["*values"] = n.prototype.toArray
  29310. }
  29311. , {}],
  29312. 197: [function(e, t, i) {}
  29313. , {}],
  29314. 198: [function(e, t, i) {
  29315. (function(t) {
  29316. "use strict";
  29317. function n() {
  29318. try {
  29319. var e = new Uint8Array(1);
  29320. return e.__proto__ = {
  29321. __proto__: Uint8Array.prototype,
  29322. foo: function() {
  29323. return 42
  29324. }
  29325. },
  29326. 42 === e.foo() && "function" == typeof e.subarray && 0 === e.subarray(1, 1).byteLength
  29327. } catch (e) {
  29328. return !1
  29329. }
  29330. }
  29331. function r() {
  29332. return a.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823
  29333. }
  29334. function o(e, t) {
  29335. if (r() < t)
  29336. throw new RangeError("Invalid typed array length");
  29337. return a.TYPED_ARRAY_SUPPORT ? (e = new Uint8Array(t),
  29338. e.__proto__ = a.prototype) : (null === e && (e = new a(t)),
  29339. e.length = t),
  29340. e
  29341. }
  29342. function a(e, t, i) {
  29343. if (!(a.TYPED_ARRAY_SUPPORT || this instanceof a))
  29344. return new a(e,t,i);
  29345. if ("number" == typeof e) {
  29346. if ("string" == typeof t)
  29347. throw new Error("If encoding is specified then the first argument must be a string");
  29348. return h(this, e)
  29349. }
  29350. return s(this, e, t, i)
  29351. }
  29352. function s(e, t, i, n) {
  29353. if ("number" == typeof t)
  29354. throw new TypeError('"value" argument must not be a number');
  29355. return "undefined" != typeof ArrayBuffer && t instanceof ArrayBuffer ? p(e, t, i, n) : "string" == typeof t ? u(e, t, i) : f(e, t)
  29356. }
  29357. function l(e) {
  29358. if ("number" != typeof e)
  29359. throw new TypeError('"size" argument must be a number');
  29360. if (e < 0)
  29361. throw new RangeError('"size" argument must not be negative')
  29362. }
  29363. function c(e, t, i, n) {
  29364. return l(t),
  29365. 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)
  29366. }
  29367. function h(e, t) {
  29368. if (l(t),
  29369. e = o(e, t < 0 ? 0 : 0 | g(t)),
  29370. !a.TYPED_ARRAY_SUPPORT)
  29371. for (var i = 0; i < t; ++i)
  29372. e[i] = 0;
  29373. return e
  29374. }
  29375. function u(e, t, i) {
  29376. if ("string" == typeof i && "" !== i || (i = "utf8"),
  29377. !a.isEncoding(i))
  29378. throw new TypeError('"encoding" must be a valid string encoding');
  29379. var n = 0 | v(t, i);
  29380. e = o(e, n);
  29381. var r = e.write(t, i);
  29382. return r !== n && (e = e.slice(0, r)),
  29383. e
  29384. }
  29385. function d(e, t) {
  29386. var i = t.length < 0 ? 0 : 0 | g(t.length);
  29387. e = o(e, i);
  29388. for (var n = 0; n < i; n += 1)
  29389. e[n] = 255 & t[n];
  29390. return e
  29391. }
  29392. function p(e, t, i, n) {
  29393. if (t.byteLength,
  29394. i < 0 || t.byteLength < i)
  29395. throw new RangeError("'offset' is out of bounds");
  29396. if (t.byteLength < i + (n || 0))
  29397. throw new RangeError("'length' is out of bounds");
  29398. return t = void 0 === i && void 0 === n ? new Uint8Array(t) : void 0 === n ? new Uint8Array(t,i) : new Uint8Array(t,i,n),
  29399. a.TYPED_ARRAY_SUPPORT ? (e = t,
  29400. e.__proto__ = a.prototype) : e = d(e, t),
  29401. e
  29402. }
  29403. function f(e, t) {
  29404. if (a.isBuffer(t)) {
  29405. var i = 0 | g(t.length);
  29406. return e = o(e, i),
  29407. 0 === e.length ? e : (t.copy(e, 0, 0, i),
  29408. e)
  29409. }
  29410. if (t) {
  29411. if ("undefined" != typeof ArrayBuffer && t.buffer instanceof ArrayBuffer || "length"in t)
  29412. return "number" != typeof t.length || K(t.length) ? o(e, 0) : d(e, t);
  29413. if ("Buffer" === t.type && $(t.data))
  29414. return d(e, t.data)
  29415. }
  29416. throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")
  29417. }
  29418. function g(e) {
  29419. if (e >= r())
  29420. throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + r().toString(16) + " bytes");
  29421. return 0 | e
  29422. }
  29423. function m(e) {
  29424. return +e != e && (e = 0),
  29425. a.alloc(+e)
  29426. }
  29427. function v(e, t) {
  29428. if (a.isBuffer(e))
  29429. return e.length;
  29430. if ("undefined" != typeof ArrayBuffer && "function" == typeof ArrayBuffer.isView && (ArrayBuffer.isView(e) || e instanceof ArrayBuffer))
  29431. return e.byteLength;
  29432. "string" != typeof e && (e = "" + e);
  29433. var i = e.length;
  29434. if (0 === i)
  29435. return 0;
  29436. for (var n = !1; ; )
  29437. switch (t) {
  29438. case "ascii":
  29439. case "latin1":
  29440. case "binary":
  29441. return i;
  29442. case "utf8":
  29443. case "utf-8":
  29444. case void 0:
  29445. return j(e).length;
  29446. case "ucs2":
  29447. case "ucs-2":
  29448. case "utf16le":
  29449. case "utf-16le":
  29450. return 2 * i;
  29451. case "hex":
  29452. return i >>> 1;
  29453. case "base64":
  29454. return Z(e).length;
  29455. default:
  29456. if (n)
  29457. return j(e).length;
  29458. t = ("" + t).toLowerCase(),
  29459. n = !0
  29460. }
  29461. }
  29462. function A(e, t, i) {
  29463. var n = !1;
  29464. if ((void 0 === t || t < 0) && (t = 0),
  29465. t > this.length)
  29466. return "";
  29467. if ((void 0 === i || i > this.length) && (i = this.length),
  29468. i <= 0)
  29469. return "";
  29470. if (i >>>= 0,
  29471. t >>>= 0,
  29472. i <= t)
  29473. return "";
  29474. for (e || (e = "utf8"); ; )
  29475. switch (e) {
  29476. case "hex":
  29477. return L(this, t, i);
  29478. case "utf8":
  29479. case "utf-8":
  29480. return M(this, t, i);
  29481. case "ascii":
  29482. return P(this, t, i);
  29483. case "latin1":
  29484. case "binary":
  29485. return O(this, t, i);
  29486. case "base64":
  29487. return S(this, t, i);
  29488. case "ucs2":
  29489. case "ucs-2":
  29490. case "utf16le":
  29491. case "utf-16le":
  29492. return D(this, t, i);
  29493. default:
  29494. if (n)
  29495. throw new TypeError("Unknown encoding: " + e);
  29496. e = (e + "").toLowerCase(),
  29497. n = !0
  29498. }
  29499. }
  29500. function y(e, t, i) {
  29501. var n = e[t];
  29502. e[t] = e[i],
  29503. e[i] = n
  29504. }
  29505. function C(e, t, i, n, r) {
  29506. if (0 === e.length)
  29507. return -1;
  29508. if ("string" == typeof i ? (n = i,
  29509. i = 0) : i > 2147483647 ? i = 2147483647 : i < -2147483648 && (i = -2147483648),
  29510. i = +i,
  29511. isNaN(i) && (i = r ? 0 : e.length - 1),
  29512. i < 0 && (i = e.length + i),
  29513. i >= e.length) {
  29514. if (r)
  29515. return -1;
  29516. i = e.length - 1
  29517. } else if (i < 0) {
  29518. if (!r)
  29519. return -1;
  29520. i = 0
  29521. }
  29522. if ("string" == typeof t && (t = a.from(t, n)),
  29523. a.isBuffer(t))
  29524. return 0 === t.length ? -1 : I(e, t, i, n, r);
  29525. if ("number" == typeof t)
  29526. return t &= 255,
  29527. a.TYPED_ARRAY_SUPPORT && "function" == typeof Uint8Array.prototype.indexOf ? r ? Uint8Array.prototype.indexOf.call(e, t, i) : Uint8Array.prototype.lastIndexOf.call(e, t, i) : I(e, [t], i, n, r);
  29528. throw new TypeError("val must be string, number or Buffer")
  29529. }
  29530. function I(e, t, i, n, r) {
  29531. function o(e, t) {
  29532. return 1 === a ? e[t] : e.readUInt16BE(t * a)
  29533. }
  29534. var a = 1
  29535. , s = e.length
  29536. , l = t.length;
  29537. if (void 0 !== n && (n = String(n).toLowerCase(),
  29538. "ucs2" === n || "ucs-2" === n || "utf16le" === n || "utf-16le" === n)) {
  29539. if (e.length < 2 || t.length < 2)
  29540. return -1;
  29541. a = 2,
  29542. s /= 2,
  29543. l /= 2,
  29544. i /= 2
  29545. }
  29546. var c;
  29547. if (r) {
  29548. var h = -1;
  29549. for (c = i; c < s; c++)
  29550. if (o(e, c) === o(t, h === -1 ? 0 : c - h)) {
  29551. if (h === -1 && (h = c),
  29552. c - h + 1 === l)
  29553. return h * a
  29554. } else
  29555. h !== -1 && (c -= c - h),
  29556. h = -1
  29557. } else
  29558. for (i + l > s && (i = s - l),
  29559. c = i; c >= 0; c--) {
  29560. for (var u = !0, d = 0; d < l; d++)
  29561. if (o(e, c + d) !== o(t, d)) {
  29562. u = !1;
  29563. break
  29564. }
  29565. if (u)
  29566. return c
  29567. }
  29568. return -1
  29569. }
  29570. function E(e, t, i, n) {
  29571. i = Number(i) || 0;
  29572. var r = e.length - i;
  29573. n ? (n = Number(n),
  29574. n > r && (n = r)) : n = r;
  29575. var o = t.length;
  29576. if (o % 2 !== 0)
  29577. throw new TypeError("Invalid hex string");
  29578. n > o / 2 && (n = o / 2);
  29579. for (var a = 0; a < n; ++a) {
  29580. var s = parseInt(t.substr(2 * a, 2), 16);
  29581. if (isNaN(s))
  29582. return a;
  29583. e[i + a] = s
  29584. }
  29585. return a
  29586. }
  29587. function b(e, t, i, n) {
  29588. return q(j(t, e.length - i), e, i, n)
  29589. }
  29590. function w(e, t, i, n) {
  29591. return q(Y(t), e, i, n)
  29592. }
  29593. function _(e, t, i, n) {
  29594. return w(e, t, i, n)
  29595. }
  29596. function T(e, t, i, n) {
  29597. return q(Z(t), e, i, n)
  29598. }
  29599. function x(e, t, i, n) {
  29600. return q(X(t, e.length - i), e, i, n)
  29601. }
  29602. function S(e, t, i) {
  29603. return 0 === t && i === e.length ? Q.fromByteArray(e) : Q.fromByteArray(e.slice(t, i))
  29604. }
  29605. function M(e, t, i) {
  29606. i = Math.min(e.length, i);
  29607. for (var n = [], r = t; r < i; ) {
  29608. var o = e[r]
  29609. , a = null
  29610. , s = o > 239 ? 4 : o > 223 ? 3 : o > 191 ? 2 : 1;
  29611. if (r + s <= i) {
  29612. var l, c, h, u;
  29613. switch (s) {
  29614. case 1:
  29615. o < 128 && (a = o);
  29616. break;
  29617. case 2:
  29618. l = e[r + 1],
  29619. 128 === (192 & l) && (u = (31 & o) << 6 | 63 & l,
  29620. u > 127 && (a = u));
  29621. break;
  29622. case 3:
  29623. l = e[r + 1],
  29624. c = e[r + 2],
  29625. 128 === (192 & l) && 128 === (192 & c) && (u = (15 & o) << 12 | (63 & l) << 6 | 63 & c,
  29626. u > 2047 && (u < 55296 || u > 57343) && (a = u));
  29627. break;
  29628. case 4:
  29629. l = e[r + 1],
  29630. c = e[r + 2],
  29631. h = e[r + 3],
  29632. 128 === (192 & l) && 128 === (192 & c) && 128 === (192 & h) && (u = (15 & o) << 18 | (63 & l) << 12 | (63 & c) << 6 | 63 & h,
  29633. u > 65535 && u < 1114112 && (a = u))
  29634. }
  29635. }
  29636. null === a ? (a = 65533,
  29637. s = 1) : a > 65535 && (a -= 65536,
  29638. n.push(a >>> 10 & 1023 | 55296),
  29639. a = 56320 | 1023 & a),
  29640. n.push(a),
  29641. r += s
  29642. }
  29643. return R(n)
  29644. }
  29645. function R(e) {
  29646. var t = e.length;
  29647. if (t <= ee)
  29648. return String.fromCharCode.apply(String, e);
  29649. for (var i = "", n = 0; n < t; )
  29650. i += String.fromCharCode.apply(String, e.slice(n, n += ee));
  29651. return i
  29652. }
  29653. function P(e, t, i) {
  29654. var n = "";
  29655. i = Math.min(e.length, i);
  29656. for (var r = t; r < i; ++r)
  29657. n += String.fromCharCode(127 & e[r]);
  29658. return n
  29659. }
  29660. function O(e, t, i) {
  29661. var n = "";
  29662. i = Math.min(e.length, i);
  29663. for (var r = t; r < i; ++r)
  29664. n += String.fromCharCode(e[r]);
  29665. return n
  29666. }
  29667. function L(e, t, i) {
  29668. var n = e.length;
  29669. (!t || t < 0) && (t = 0),
  29670. (!i || i < 0 || i > n) && (i = n);
  29671. for (var r = "", o = t; o < i; ++o)
  29672. r += W(e[o]);
  29673. return r
  29674. }
  29675. function D(e, t, i) {
  29676. for (var n = e.slice(t, i), r = "", o = 0; o < n.length; o += 2)
  29677. r += String.fromCharCode(n[o] + 256 * n[o + 1]);
  29678. return r
  29679. }
  29680. function N(e, t, i) {
  29681. if (e % 1 !== 0 || e < 0)
  29682. throw new RangeError("offset is not uint");
  29683. if (e + t > i)
  29684. throw new RangeError("Trying to access beyond buffer length")
  29685. }
  29686. function B(e, t, i, n, r, o) {
  29687. if (!a.isBuffer(e))
  29688. throw new TypeError('"buffer" argument must be a Buffer instance');
  29689. if (t > r || t < o)
  29690. throw new RangeError('"value" argument is out of bounds');
  29691. if (i + n > e.length)
  29692. throw new RangeError("Index out of range")
  29693. }
  29694. function F(e, t, i, n) {
  29695. t < 0 && (t = 65535 + t + 1);
  29696. for (var r = 0, o = Math.min(e.length - i, 2); r < o; ++r)
  29697. e[i + r] = (t & 255 << 8 * (n ? r : 1 - r)) >>> 8 * (n ? r : 1 - r)
  29698. }
  29699. function V(e, t, i, n) {
  29700. t < 0 && (t = 4294967295 + t + 1);
  29701. for (var r = 0, o = Math.min(e.length - i, 4); r < o; ++r)
  29702. e[i + r] = t >>> 8 * (n ? r : 3 - r) & 255
  29703. }
  29704. function U(e, t, i, n, r, o) {
  29705. if (i + n > e.length)
  29706. throw new RangeError("Index out of range");
  29707. if (i < 0)
  29708. throw new RangeError("Index out of range")
  29709. }
  29710. function k(e, t, i, n, r) {
  29711. return r || U(e, t, i, 4, 3.4028234663852886e38, -3.4028234663852886e38),
  29712. J.write(e, t, i, n, 23, 4),
  29713. i + 4
  29714. }
  29715. function H(e, t, i, n, r) {
  29716. return r || U(e, t, i, 8, 1.7976931348623157e308, -1.7976931348623157e308),
  29717. J.write(e, t, i, n, 52, 8),
  29718. i + 8
  29719. }
  29720. function G(e) {
  29721. if (e = z(e).replace(te, ""),
  29722. e.length < 2)
  29723. return "";
  29724. for (; e.length % 4 !== 0; )
  29725. e += "=";
  29726. return e
  29727. }
  29728. function z(e) {
  29729. return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, "")
  29730. }
  29731. function W(e) {
  29732. return e < 16 ? "0" + e.toString(16) : e.toString(16)
  29733. }
  29734. function j(e, t) {
  29735. t = t || 1 / 0;
  29736. for (var i, n = e.length, r = null, o = [], a = 0; a < n; ++a) {
  29737. if (i = e.charCodeAt(a),
  29738. i > 55295 && i < 57344) {
  29739. if (!r) {
  29740. if (i > 56319) {
  29741. (t -= 3) > -1 && o.push(239, 191, 189);
  29742. continue
  29743. }
  29744. if (a + 1 === n) {
  29745. (t -= 3) > -1 && o.push(239, 191, 189);
  29746. continue
  29747. }
  29748. r = i;
  29749. continue
  29750. }
  29751. if (i < 56320) {
  29752. (t -= 3) > -1 && o.push(239, 191, 189),
  29753. r = i;
  29754. continue
  29755. }
  29756. i = (r - 55296 << 10 | i - 56320) + 65536
  29757. } else
  29758. r && (t -= 3) > -1 && o.push(239, 191, 189);
  29759. if (r = null,
  29760. i < 128) {
  29761. if ((t -= 1) < 0)
  29762. break;
  29763. o.push(i)
  29764. } else if (i < 2048) {
  29765. if ((t -= 2) < 0)
  29766. break;
  29767. o.push(i >> 6 | 192, 63 & i | 128)
  29768. } else if (i < 65536) {
  29769. if ((t -= 3) < 0)
  29770. break;
  29771. o.push(i >> 12 | 224, i >> 6 & 63 | 128, 63 & i | 128)
  29772. } else {
  29773. if (!(i < 1114112))
  29774. throw new Error("Invalid code point");
  29775. if ((t -= 4) < 0)
  29776. break;
  29777. o.push(i >> 18 | 240, i >> 12 & 63 | 128, i >> 6 & 63 | 128, 63 & i | 128)
  29778. }
  29779. }
  29780. return o
  29781. }
  29782. function Y(e) {
  29783. for (var t = [], i = 0; i < e.length; ++i)
  29784. t.push(255 & e.charCodeAt(i));
  29785. return t
  29786. }
  29787. function X(e, t) {
  29788. for (var i, n, r, o = [], a = 0; a < e.length && !((t -= 2) < 0); ++a)
  29789. i = e.charCodeAt(a),
  29790. n = i >> 8,
  29791. r = i % 256,
  29792. o.push(r),
  29793. o.push(n);
  29794. return o
  29795. }
  29796. function Z(e) {
  29797. return Q.toByteArray(G(e))
  29798. }
  29799. function q(e, t, i, n) {
  29800. for (var r = 0; r < n && !(r + i >= t.length || r >= e.length); ++r)
  29801. t[r + i] = e[r];
  29802. return r
  29803. }
  29804. function K(e) {
  29805. return e !== e
  29806. }
  29807. var Q = e("base64-js")
  29808. , J = e("ieee754")
  29809. , $ = e("isarray");
  29810. i.Buffer = a,
  29811. i.SlowBuffer = m,
  29812. i.INSPECT_MAX_BYTES = 50,
  29813. a.TYPED_ARRAY_SUPPORT = void 0 !== t.TYPED_ARRAY_SUPPORT ? t.TYPED_ARRAY_SUPPORT : n(),
  29814. i.kMaxLength = r(),
  29815. a.poolSize = 8192,
  29816. a._augment = function(e) {
  29817. return e.__proto__ = a.prototype,
  29818. e
  29819. }
  29820. ,
  29821. a.from = function(e, t, i) {
  29822. return s(null, e, t, i)
  29823. }
  29824. ,
  29825. a.TYPED_ARRAY_SUPPORT && (a.prototype.__proto__ = Uint8Array.prototype,
  29826. a.__proto__ = Uint8Array,
  29827. "undefined" != typeof Symbol && Symbol.species && a[Symbol.species] === a && Object.defineProperty(a, Symbol.species, {
  29828. value: null,
  29829. configurable: !0
  29830. })),
  29831. a.alloc = function(e, t, i) {
  29832. return c(null, e, t, i)
  29833. }
  29834. ,
  29835. a.allocUnsafe = function(e) {
  29836. return h(null, e)
  29837. }
  29838. ,
  29839. a.allocUnsafeSlow = function(e) {
  29840. return h(null, e)
  29841. }
  29842. ,
  29843. a.isBuffer = function(e) {
  29844. return !(null == e || !e._isBuffer)
  29845. }
  29846. ,
  29847. a.compare = function(e, t) {
  29848. if (!a.isBuffer(e) || !a.isBuffer(t))
  29849. throw new TypeError("Arguments must be Buffers");
  29850. if (e === t)
  29851. return 0;
  29852. for (var i = e.length, n = t.length, r = 0, o = Math.min(i, n); r < o; ++r)
  29853. if (e[r] !== t[r]) {
  29854. i = e[r],
  29855. n = t[r];
  29856. break
  29857. }
  29858. return i < n ? -1 : n < i ? 1 : 0
  29859. }
  29860. ,
  29861. a.isEncoding = function(e) {
  29862. switch (String(e).toLowerCase()) {
  29863. case "hex":
  29864. case "utf8":
  29865. case "utf-8":
  29866. case "ascii":
  29867. case "latin1":
  29868. case "binary":
  29869. case "base64":
  29870. case "ucs2":
  29871. case "ucs-2":
  29872. case "utf16le":
  29873. case "utf-16le":
  29874. return !0;
  29875. default:
  29876. return !1
  29877. }
  29878. }
  29879. ,
  29880. a.concat = function(e, t) {
  29881. if (!$(e))
  29882. throw new TypeError('"list" argument must be an Array of Buffers');
  29883. if (0 === e.length)
  29884. return a.alloc(0);
  29885. var i;
  29886. if (void 0 === t)
  29887. for (t = 0,
  29888. i = 0; i < e.length; ++i)
  29889. t += e[i].length;
  29890. var n = a.allocUnsafe(t)
  29891. , r = 0;
  29892. for (i = 0; i < e.length; ++i) {
  29893. var o = e[i];
  29894. if (!a.isBuffer(o))
  29895. throw new TypeError('"list" argument must be an Array of Buffers');
  29896. o.copy(n, r),
  29897. r += o.length
  29898. }
  29899. return n
  29900. }
  29901. ,
  29902. a.byteLength = v,
  29903. a.prototype._isBuffer = !0,
  29904. a.prototype.swap16 = function() {
  29905. var e = this.length;
  29906. if (e % 2 !== 0)
  29907. throw new RangeError("Buffer size must be a multiple of 16-bits");
  29908. for (var t = 0; t < e; t += 2)
  29909. y(this, t, t + 1);
  29910. return this
  29911. }
  29912. ,
  29913. a.prototype.swap32 = function() {
  29914. var e = this.length;
  29915. if (e % 4 !== 0)
  29916. throw new RangeError("Buffer size must be a multiple of 32-bits");
  29917. for (var t = 0; t < e; t += 4)
  29918. y(this, t, t + 3),
  29919. y(this, t + 1, t + 2);
  29920. return this
  29921. }
  29922. ,
  29923. a.prototype.swap64 = function() {
  29924. var e = this.length;
  29925. if (e % 8 !== 0)
  29926. throw new RangeError("Buffer size must be a multiple of 64-bits");
  29927. for (var t = 0; t < e; t += 8)
  29928. y(this, t, t + 7),
  29929. y(this, t + 1, t + 6),
  29930. y(this, t + 2, t + 5),
  29931. y(this, t + 3, t + 4);
  29932. return this
  29933. }
  29934. ,
  29935. a.prototype.toString = function() {
  29936. var e = 0 | this.length;
  29937. return 0 === e ? "" : 0 === arguments.length ? M(this, 0, e) : A.apply(this, arguments)
  29938. }
  29939. ,
  29940. a.prototype.equals = function(e) {
  29941. if (!a.isBuffer(e))
  29942. throw new TypeError("Argument must be a Buffer");
  29943. return this === e || 0 === a.compare(this, e)
  29944. }
  29945. ,
  29946. a.prototype.inspect = function() {
  29947. var e = ""
  29948. , t = i.INSPECT_MAX_BYTES;
  29949. return this.length > 0 && (e = this.toString("hex", 0, t).match(/.{2}/g).join(" "),
  29950. this.length > t && (e += " ... ")),
  29951. "<Buffer " + e + ">"
  29952. }
  29953. ,
  29954. a.prototype.compare = function(e, t, i, n, r) {
  29955. if (!a.isBuffer(e))
  29956. throw new TypeError("Argument must be a Buffer");
  29957. if (void 0 === t && (t = 0),
  29958. void 0 === i && (i = e ? e.length : 0),
  29959. void 0 === n && (n = 0),
  29960. void 0 === r && (r = this.length),
  29961. t < 0 || i > e.length || n < 0 || r > this.length)
  29962. throw new RangeError("out of range index");
  29963. if (n >= r && t >= i)
  29964. return 0;
  29965. if (n >= r)
  29966. return -1;
  29967. if (t >= i)
  29968. return 1;
  29969. if (t >>>= 0,
  29970. i >>>= 0,
  29971. n >>>= 0,
  29972. r >>>= 0,
  29973. this === e)
  29974. return 0;
  29975. for (var o = r - n, s = i - t, l = Math.min(o, s), c = this.slice(n, r), h = e.slice(t, i), u = 0; u < l; ++u)
  29976. if (c[u] !== h[u]) {
  29977. o = c[u],
  29978. s = h[u];
  29979. break
  29980. }
  29981. return o < s ? -1 : s < o ? 1 : 0
  29982. }
  29983. ,
  29984. a.prototype.includes = function(e, t, i) {
  29985. return this.indexOf(e, t, i) !== -1
  29986. }
  29987. ,
  29988. a.prototype.indexOf = function(e, t, i) {
  29989. return C(this, e, t, i, !0)
  29990. }
  29991. ,
  29992. a.prototype.lastIndexOf = function(e, t, i) {
  29993. return C(this, e, t, i, !1)
  29994. }
  29995. ,
  29996. a.prototype.write = function(e, t, i, n) {
  29997. if (void 0 === t)
  29998. n = "utf8",
  29999. i = this.length,
  30000. t = 0;
  30001. else if (void 0 === i && "string" == typeof t)
  30002. n = t,
  30003. i = this.length,
  30004. t = 0;
  30005. else {
  30006. if (!isFinite(t))
  30007. throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
  30008. t |= 0,
  30009. isFinite(i) ? (i |= 0,
  30010. void 0 === n && (n = "utf8")) : (n = i,
  30011. i = void 0)
  30012. }
  30013. var r = this.length - t;
  30014. if ((void 0 === i || i > r) && (i = r),
  30015. e.length > 0 && (i < 0 || t < 0) || t > this.length)
  30016. throw new RangeError("Attempt to write outside buffer bounds");
  30017. n || (n = "utf8");
  30018. for (var o = !1; ; )
  30019. switch (n) {
  30020. case "hex":
  30021. return E(this, e, t, i);
  30022. case "utf8":
  30023. case "utf-8":
  30024. return b(this, e, t, i);
  30025. case "ascii":
  30026. return w(this, e, t, i);
  30027. case "latin1":
  30028. case "binary":
  30029. return _(this, e, t, i);
  30030. case "base64":
  30031. return T(this, e, t, i);
  30032. case "ucs2":
  30033. case "ucs-2":
  30034. case "utf16le":
  30035. case "utf-16le":
  30036. return x(this, e, t, i);
  30037. default:
  30038. if (o)
  30039. throw new TypeError("Unknown encoding: " + n);
  30040. n = ("" + n).toLowerCase(),
  30041. o = !0
  30042. }
  30043. }
  30044. ,
  30045. a.prototype.toJSON = function() {
  30046. return {
  30047. type: "Buffer",
  30048. data: Array.prototype.slice.call(this._arr || this, 0)
  30049. }
  30050. }
  30051. ;
  30052. var ee = 4096;
  30053. a.prototype.slice = function(e, t) {
  30054. var i = this.length;
  30055. e = ~~e,
  30056. t = void 0 === t ? i : ~~t,
  30057. e < 0 ? (e += i,
  30058. e < 0 && (e = 0)) : e > i && (e = i),
  30059. t < 0 ? (t += i,
  30060. t < 0 && (t = 0)) : t > i && (t = i),
  30061. t < e && (t = e);
  30062. var n;
  30063. if (a.TYPED_ARRAY_SUPPORT)
  30064. n = this.subarray(e, t),
  30065. n.__proto__ = a.prototype;
  30066. else {
  30067. var r = t - e;
  30068. n = new a(r,void 0);
  30069. for (var o = 0; o < r; ++o)
  30070. n[o] = this[o + e]
  30071. }
  30072. return n
  30073. }
  30074. ,
  30075. a.prototype.readUIntLE = function(e, t, i) {
  30076. e |= 0,
  30077. t |= 0,
  30078. i || N(e, t, this.length);
  30079. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  30080. n += this[e + o] * r;
  30081. return n
  30082. }
  30083. ,
  30084. a.prototype.readUIntBE = function(e, t, i) {
  30085. e |= 0,
  30086. t |= 0,
  30087. i || N(e, t, this.length);
  30088. for (var n = this[e + --t], r = 1; t > 0 && (r *= 256); )
  30089. n += this[e + --t] * r;
  30090. return n
  30091. }
  30092. ,
  30093. a.prototype.readUInt8 = function(e, t) {
  30094. return t || N(e, 1, this.length),
  30095. this[e]
  30096. }
  30097. ,
  30098. a.prototype.readUInt16LE = function(e, t) {
  30099. return t || N(e, 2, this.length),
  30100. this[e] | this[e + 1] << 8
  30101. }
  30102. ,
  30103. a.prototype.readUInt16BE = function(e, t) {
  30104. return t || N(e, 2, this.length),
  30105. this[e] << 8 | this[e + 1]
  30106. }
  30107. ,
  30108. a.prototype.readUInt32LE = function(e, t) {
  30109. return t || N(e, 4, this.length),
  30110. (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + 16777216 * this[e + 3]
  30111. }
  30112. ,
  30113. a.prototype.readUInt32BE = function(e, t) {
  30114. return t || N(e, 4, this.length),
  30115. 16777216 * this[e] + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3])
  30116. }
  30117. ,
  30118. a.prototype.readIntLE = function(e, t, i) {
  30119. e |= 0,
  30120. t |= 0,
  30121. i || N(e, t, this.length);
  30122. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  30123. n += this[e + o] * r;
  30124. return r *= 128,
  30125. n >= r && (n -= Math.pow(2, 8 * t)),
  30126. n
  30127. }
  30128. ,
  30129. a.prototype.readIntBE = function(e, t, i) {
  30130. e |= 0,
  30131. t |= 0,
  30132. i || N(e, t, this.length);
  30133. for (var n = t, r = 1, o = this[e + --n]; n > 0 && (r *= 256); )
  30134. o += this[e + --n] * r;
  30135. return r *= 128,
  30136. o >= r && (o -= Math.pow(2, 8 * t)),
  30137. o
  30138. }
  30139. ,
  30140. a.prototype.readInt8 = function(e, t) {
  30141. return t || N(e, 1, this.length),
  30142. 128 & this[e] ? (255 - this[e] + 1) * -1 : this[e]
  30143. }
  30144. ,
  30145. a.prototype.readInt16LE = function(e, t) {
  30146. t || N(e, 2, this.length);
  30147. var i = this[e] | this[e + 1] << 8;
  30148. return 32768 & i ? 4294901760 | i : i
  30149. }
  30150. ,
  30151. a.prototype.readInt16BE = function(e, t) {
  30152. t || N(e, 2, this.length);
  30153. var i = this[e + 1] | this[e] << 8;
  30154. return 32768 & i ? 4294901760 | i : i
  30155. }
  30156. ,
  30157. a.prototype.readInt32LE = function(e, t) {
  30158. return t || N(e, 4, this.length),
  30159. this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24
  30160. }
  30161. ,
  30162. a.prototype.readInt32BE = function(e, t) {
  30163. return t || N(e, 4, this.length),
  30164. this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]
  30165. }
  30166. ,
  30167. a.prototype.readFloatLE = function(e, t) {
  30168. return t || N(e, 4, this.length),
  30169. J.read(this, e, !0, 23, 4)
  30170. }
  30171. ,
  30172. a.prototype.readFloatBE = function(e, t) {
  30173. return t || N(e, 4, this.length),
  30174. J.read(this, e, !1, 23, 4)
  30175. }
  30176. ,
  30177. a.prototype.readDoubleLE = function(e, t) {
  30178. return t || N(e, 8, this.length),
  30179. J.read(this, e, !0, 52, 8)
  30180. }
  30181. ,
  30182. a.prototype.readDoubleBE = function(e, t) {
  30183. return t || N(e, 8, this.length),
  30184. J.read(this, e, !1, 52, 8)
  30185. }
  30186. ,
  30187. a.prototype.writeUIntLE = function(e, t, i, n) {
  30188. if (e = +e,
  30189. t |= 0,
  30190. i |= 0,
  30191. !n) {
  30192. var r = Math.pow(2, 8 * i) - 1;
  30193. B(this, e, t, i, r, 0)
  30194. }
  30195. var o = 1
  30196. , a = 0;
  30197. for (this[t] = 255 & e; ++a < i && (o *= 256); )
  30198. this[t + a] = e / o & 255;
  30199. return t + i
  30200. }
  30201. ,
  30202. a.prototype.writeUIntBE = function(e, t, i, n) {
  30203. if (e = +e,
  30204. t |= 0,
  30205. i |= 0,
  30206. !n) {
  30207. var r = Math.pow(2, 8 * i) - 1;
  30208. B(this, e, t, i, r, 0)
  30209. }
  30210. var o = i - 1
  30211. , a = 1;
  30212. for (this[t + o] = 255 & e; --o >= 0 && (a *= 256); )
  30213. this[t + o] = e / a & 255;
  30214. return t + i
  30215. }
  30216. ,
  30217. a.prototype.writeUInt8 = function(e, t, i) {
  30218. return e = +e,
  30219. t |= 0,
  30220. i || B(this, e, t, 1, 255, 0),
  30221. a.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  30222. this[t] = 255 & e,
  30223. t + 1
  30224. }
  30225. ,
  30226. a.prototype.writeUInt16LE = function(e, t, i) {
  30227. return e = +e,
  30228. t |= 0,
  30229. i || B(this, e, t, 2, 65535, 0),
  30230. a.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30231. this[t + 1] = e >>> 8) : F(this, e, t, !0),
  30232. t + 2
  30233. }
  30234. ,
  30235. a.prototype.writeUInt16BE = function(e, t, i) {
  30236. return e = +e,
  30237. t |= 0,
  30238. i || B(this, e, t, 2, 65535, 0),
  30239. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  30240. this[t + 1] = 255 & e) : F(this, e, t, !1),
  30241. t + 2
  30242. }
  30243. ,
  30244. a.prototype.writeUInt32LE = function(e, t, i) {
  30245. return e = +e,
  30246. t |= 0,
  30247. i || B(this, e, t, 4, 4294967295, 0),
  30248. a.TYPED_ARRAY_SUPPORT ? (this[t + 3] = e >>> 24,
  30249. this[t + 2] = e >>> 16,
  30250. this[t + 1] = e >>> 8,
  30251. this[t] = 255 & e) : V(this, e, t, !0),
  30252. t + 4
  30253. }
  30254. ,
  30255. a.prototype.writeUInt32BE = function(e, t, i) {
  30256. return e = +e,
  30257. t |= 0,
  30258. i || B(this, e, t, 4, 4294967295, 0),
  30259. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  30260. this[t + 1] = e >>> 16,
  30261. this[t + 2] = e >>> 8,
  30262. this[t + 3] = 255 & e) : V(this, e, t, !1),
  30263. t + 4
  30264. }
  30265. ,
  30266. a.prototype.writeIntLE = function(e, t, i, n) {
  30267. if (e = +e,
  30268. t |= 0,
  30269. !n) {
  30270. var r = Math.pow(2, 8 * i - 1);
  30271. B(this, e, t, i, r - 1, -r)
  30272. }
  30273. var o = 0
  30274. , a = 1
  30275. , s = 0;
  30276. for (this[t] = 255 & e; ++o < i && (a *= 256); )
  30277. e < 0 && 0 === s && 0 !== this[t + o - 1] && (s = 1),
  30278. this[t + o] = (e / a >> 0) - s & 255;
  30279. return t + i
  30280. }
  30281. ,
  30282. a.prototype.writeIntBE = function(e, t, i, n) {
  30283. if (e = +e,
  30284. t |= 0,
  30285. !n) {
  30286. var r = Math.pow(2, 8 * i - 1);
  30287. B(this, e, t, i, r - 1, -r)
  30288. }
  30289. var o = i - 1
  30290. , a = 1
  30291. , s = 0;
  30292. for (this[t + o] = 255 & e; --o >= 0 && (a *= 256); )
  30293. e < 0 && 0 === s && 0 !== this[t + o + 1] && (s = 1),
  30294. this[t + o] = (e / a >> 0) - s & 255;
  30295. return t + i
  30296. }
  30297. ,
  30298. a.prototype.writeInt8 = function(e, t, i) {
  30299. return e = +e,
  30300. t |= 0,
  30301. i || B(this, e, t, 1, 127, -128),
  30302. a.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  30303. e < 0 && (e = 255 + e + 1),
  30304. this[t] = 255 & e,
  30305. t + 1
  30306. }
  30307. ,
  30308. a.prototype.writeInt16LE = function(e, t, i) {
  30309. return e = +e,
  30310. t |= 0,
  30311. i || B(this, e, t, 2, 32767, -32768),
  30312. a.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30313. this[t + 1] = e >>> 8) : F(this, e, t, !0),
  30314. t + 2
  30315. }
  30316. ,
  30317. a.prototype.writeInt16BE = function(e, t, i) {
  30318. return e = +e,
  30319. t |= 0,
  30320. i || B(this, e, t, 2, 32767, -32768),
  30321. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  30322. this[t + 1] = 255 & e) : F(this, e, t, !1),
  30323. t + 2
  30324. }
  30325. ,
  30326. a.prototype.writeInt32LE = function(e, t, i) {
  30327. return e = +e,
  30328. t |= 0,
  30329. i || B(this, e, t, 4, 2147483647, -2147483648),
  30330. a.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30331. this[t + 1] = e >>> 8,
  30332. this[t + 2] = e >>> 16,
  30333. this[t + 3] = e >>> 24) : V(this, e, t, !0),
  30334. t + 4
  30335. }
  30336. ,
  30337. a.prototype.writeInt32BE = function(e, t, i) {
  30338. return e = +e,
  30339. t |= 0,
  30340. i || B(this, e, t, 4, 2147483647, -2147483648),
  30341. e < 0 && (e = 4294967295 + e + 1),
  30342. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  30343. this[t + 1] = e >>> 16,
  30344. this[t + 2] = e >>> 8,
  30345. this[t + 3] = 255 & e) : V(this, e, t, !1),
  30346. t + 4
  30347. }
  30348. ,
  30349. a.prototype.writeFloatLE = function(e, t, i) {
  30350. return k(this, e, t, !0, i)
  30351. }
  30352. ,
  30353. a.prototype.writeFloatBE = function(e, t, i) {
  30354. return k(this, e, t, !1, i)
  30355. }
  30356. ,
  30357. a.prototype.writeDoubleLE = function(e, t, i) {
  30358. return H(this, e, t, !0, i)
  30359. }
  30360. ,
  30361. a.prototype.writeDoubleBE = function(e, t, i) {
  30362. return H(this, e, t, !1, i)
  30363. }
  30364. ,
  30365. a.prototype.copy = function(e, t, i, n) {
  30366. if (i || (i = 0),
  30367. n || 0 === n || (n = this.length),
  30368. t >= e.length && (t = e.length),
  30369. t || (t = 0),
  30370. n > 0 && n < i && (n = i),
  30371. n === i)
  30372. return 0;
  30373. if (0 === e.length || 0 === this.length)
  30374. return 0;
  30375. if (t < 0)
  30376. throw new RangeError("targetStart out of bounds");
  30377. if (i < 0 || i >= this.length)
  30378. throw new RangeError("sourceStart out of bounds");
  30379. if (n < 0)
  30380. throw new RangeError("sourceEnd out of bounds");
  30381. n > this.length && (n = this.length),
  30382. e.length - t < n - i && (n = e.length - t + i);
  30383. var r, o = n - i;
  30384. if (this === e && i < t && t < n)
  30385. for (r = o - 1; r >= 0; --r)
  30386. e[r + t] = this[r + i];
  30387. else if (o < 1e3 || !a.TYPED_ARRAY_SUPPORT)
  30388. for (r = 0; r < o; ++r)
  30389. e[r + t] = this[r + i];
  30390. else
  30391. Uint8Array.prototype.set.call(e, this.subarray(i, i + o), t);
  30392. return o
  30393. }
  30394. ,
  30395. a.prototype.fill = function(e, t, i, n) {
  30396. if ("string" == typeof e) {
  30397. if ("string" == typeof t ? (n = t,
  30398. t = 0,
  30399. i = this.length) : "string" == typeof i && (n = i,
  30400. i = this.length),
  30401. 1 === e.length) {
  30402. var r = e.charCodeAt(0);
  30403. r < 256 && (e = r)
  30404. }
  30405. if (void 0 !== n && "string" != typeof n)
  30406. throw new TypeError("encoding must be a string");
  30407. if ("string" == typeof n && !a.isEncoding(n))
  30408. throw new TypeError("Unknown encoding: " + n)
  30409. } else
  30410. "number" == typeof e && (e &= 255);
  30411. if (t < 0 || this.length < t || this.length < i)
  30412. throw new RangeError("Out of range index");
  30413. if (i <= t)
  30414. return this;
  30415. t >>>= 0,
  30416. i = void 0 === i ? this.length : i >>> 0,
  30417. e || (e = 0);
  30418. var o;
  30419. if ("number" == typeof e)
  30420. for (o = t; o < i; ++o)
  30421. this[o] = e;
  30422. else {
  30423. var s = a.isBuffer(e) ? e : j(new a(e,n).toString())
  30424. , l = s.length;
  30425. for (o = 0; o < i - t; ++o)
  30426. this[o + t] = s[o % l]
  30427. }
  30428. return this
  30429. }
  30430. ;
  30431. var te = /[^+\/0-9A-Za-z-_]/g
  30432. }
  30433. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  30434. }
  30435. , {
  30436. "base64-js": 199,
  30437. ieee754: 200,
  30438. isarray: 201
  30439. }],
  30440. 199: [function(e, t, i) {
  30441. "use strict";
  30442. function n(e) {
  30443. var t = e.length;
  30444. if (t % 4 > 0)
  30445. throw new Error("Invalid string. Length must be a multiple of 4");
  30446. return "=" === e[t - 2] ? 2 : "=" === e[t - 1] ? 1 : 0
  30447. }
  30448. function r(e) {
  30449. return 3 * e.length / 4 - n(e)
  30450. }
  30451. function o(e) {
  30452. var t, i, r, o, a, s, l = e.length;
  30453. a = n(e),
  30454. s = new u(3 * l / 4 - a),
  30455. r = a > 0 ? l - 4 : l;
  30456. var c = 0;
  30457. for (t = 0,
  30458. i = 0; t < r; t += 4,
  30459. i += 3)
  30460. o = h[e.charCodeAt(t)] << 18 | h[e.charCodeAt(t + 1)] << 12 | h[e.charCodeAt(t + 2)] << 6 | h[e.charCodeAt(t + 3)],
  30461. s[c++] = o >> 16 & 255,
  30462. s[c++] = o >> 8 & 255,
  30463. s[c++] = 255 & o;
  30464. return 2 === a ? (o = h[e.charCodeAt(t)] << 2 | h[e.charCodeAt(t + 1)] >> 4,
  30465. s[c++] = 255 & o) : 1 === a && (o = h[e.charCodeAt(t)] << 10 | h[e.charCodeAt(t + 1)] << 4 | h[e.charCodeAt(t + 2)] >> 2,
  30466. s[c++] = o >> 8 & 255,
  30467. s[c++] = 255 & o),
  30468. s
  30469. }
  30470. function a(e) {
  30471. return c[e >> 18 & 63] + c[e >> 12 & 63] + c[e >> 6 & 63] + c[63 & e]
  30472. }
  30473. function s(e, t, i) {
  30474. for (var n, r = [], o = t; o < i; o += 3)
  30475. n = (e[o] << 16) + (e[o + 1] << 8) + e[o + 2],
  30476. r.push(a(n));
  30477. return r.join("")
  30478. }
  30479. function l(e) {
  30480. for (var t, i = e.length, n = i % 3, r = "", o = [], a = 16383, l = 0, h = i - n; l < h; l += a)
  30481. o.push(s(e, l, l + a > h ? h : l + a));
  30482. return 1 === n ? (t = e[i - 1],
  30483. r += c[t >> 2],
  30484. r += c[t << 4 & 63],
  30485. r += "==") : 2 === n && (t = (e[i - 2] << 8) + e[i - 1],
  30486. r += c[t >> 10],
  30487. r += c[t >> 4 & 63],
  30488. r += c[t << 2 & 63],
  30489. r += "="),
  30490. o.push(r),
  30491. o.join("")
  30492. }
  30493. i.byteLength = r,
  30494. i.toByteArray = o,
  30495. i.fromByteArray = l;
  30496. for (var c = [], h = [], u = "undefined" != typeof Uint8Array ? Uint8Array : Array, d = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", p = 0, f = d.length; p < f; ++p)
  30497. c[p] = d[p],
  30498. h[d.charCodeAt(p)] = p;
  30499. h["-".charCodeAt(0)] = 62,
  30500. h["_".charCodeAt(0)] = 63
  30501. }
  30502. , {}],
  30503. 200: [function(e, t, i) {
  30504. i.read = function(e, t, i, n, r) {
  30505. 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];
  30506. for (u += d,
  30507. o = p & (1 << -h) - 1,
  30508. p >>= -h,
  30509. h += s; h > 0; o = 256 * o + e[t + u],
  30510. u += d,
  30511. h -= 8)
  30512. ;
  30513. for (a = o & (1 << -h) - 1,
  30514. o >>= -h,
  30515. h += n; h > 0; a = 256 * a + e[t + u],
  30516. u += d,
  30517. h -= 8)
  30518. ;
  30519. if (0 === o)
  30520. o = 1 - c;
  30521. else {
  30522. if (o === l)
  30523. return a ? NaN : (p ? -1 : 1) * (1 / 0);
  30524. a += Math.pow(2, n),
  30525. o -= c
  30526. }
  30527. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  30528. }
  30529. ,
  30530. i.write = function(e, t, i, n, r, o) {
  30531. 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;
  30532. for (t = Math.abs(t),
  30533. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  30534. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  30535. t * (l = Math.pow(2, -a)) < 1 && (a--,
  30536. l *= 2),
  30537. t += a + u >= 1 ? d / l : d * Math.pow(2, 1 - u),
  30538. t * l >= 2 && (a++,
  30539. l /= 2),
  30540. a + u >= h ? (s = 0,
  30541. a = h) : a + u >= 1 ? (s = (t * l - 1) * Math.pow(2, r),
  30542. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  30543. a = 0)); r >= 8; e[i + p] = 255 & s,
  30544. p += f,
  30545. s /= 256,
  30546. r -= 8)
  30547. ;
  30548. for (a = a << r | s,
  30549. c += r; c > 0; e[i + p] = 255 & a,
  30550. p += f,
  30551. a /= 256,
  30552. c -= 8)
  30553. ;
  30554. e[i + p - f] |= 128 * g
  30555. }
  30556. }
  30557. , {}],
  30558. 201: [function(e, t, i) {
  30559. var n = {}.toString;
  30560. t.exports = Array.isArray || function(e) {
  30561. return "[object Array]" == n.call(e)
  30562. }
  30563. }
  30564. , {}],
  30565. 202: [function(e, t, i) {
  30566. function n() {
  30567. this._events = this._events || {},
  30568. this._maxListeners = this._maxListeners || void 0
  30569. }
  30570. function r(e) {
  30571. return "function" == typeof e
  30572. }
  30573. function o(e) {
  30574. return "number" == typeof e
  30575. }
  30576. function a(e) {
  30577. return "object" == typeof e && null !== e
  30578. }
  30579. function s(e) {
  30580. return void 0 === e
  30581. }
  30582. t.exports = n,
  30583. n.EventEmitter = n,
  30584. n.prototype._events = void 0,
  30585. n.prototype._maxListeners = void 0,
  30586. n.defaultMaxListeners = 10,
  30587. n.prototype.setMaxListeners = function(e) {
  30588. if (!o(e) || e < 0 || isNaN(e))
  30589. throw TypeError("n must be a positive number");
  30590. return this._maxListeners = e,
  30591. this
  30592. }
  30593. ,
  30594. n.prototype.emit = function(e) {
  30595. var t, i, n, o, l, c;
  30596. if (this._events || (this._events = {}),
  30597. "error" === e && (!this._events.error || a(this._events.error) && !this._events.error.length)) {
  30598. if (t = arguments[1],
  30599. t instanceof Error)
  30600. throw t;
  30601. var h = new Error('Uncaught, unspecified "error" event. (' + t + ")");
  30602. throw h.context = t,
  30603. h
  30604. }
  30605. if (i = this._events[e],
  30606. s(i))
  30607. return !1;
  30608. if (r(i))
  30609. switch (arguments.length) {
  30610. case 1:
  30611. i.call(this);
  30612. break;
  30613. case 2:
  30614. i.call(this, arguments[1]);
  30615. break;
  30616. case 3:
  30617. i.call(this, arguments[1], arguments[2]);
  30618. break;
  30619. default:
  30620. o = Array.prototype.slice.call(arguments, 1),
  30621. i.apply(this, o)
  30622. }
  30623. else if (a(i))
  30624. for (o = Array.prototype.slice.call(arguments, 1),
  30625. c = i.slice(),
  30626. n = c.length,
  30627. l = 0; l < n; l++)
  30628. c[l].apply(this, o);
  30629. return !0
  30630. }
  30631. ,
  30632. n.prototype.addListener = function(e, t) {
  30633. var i;
  30634. if (!r(t))
  30635. throw TypeError("listener must be a function");
  30636. return this._events || (this._events = {}),
  30637. this._events.newListener && this.emit("newListener", e, r(t.listener) ? t.listener : t),
  30638. this._events[e] ? a(this._events[e]) ? this._events[e].push(t) : this._events[e] = [this._events[e], t] : this._events[e] = t,
  30639. a(this._events[e]) && !this._events[e].warned && (i = s(this._maxListeners) ? n.defaultMaxListeners : this._maxListeners,
  30640. i && i > 0 && this._events[e].length > i && (this._events[e].warned = !0,
  30641. console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.", this._events[e].length),
  30642. "function" == typeof console.trace && console.trace())),
  30643. this
  30644. }
  30645. ,
  30646. n.prototype.on = n.prototype.addListener,
  30647. n.prototype.once = function(e, t) {
  30648. function i() {
  30649. this.removeListener(e, i),
  30650. n || (n = !0,
  30651. t.apply(this, arguments))
  30652. }
  30653. if (!r(t))
  30654. throw TypeError("listener must be a function");
  30655. var n = !1;
  30656. return i.listener = t,
  30657. this.on(e, i),
  30658. this
  30659. }
  30660. ,
  30661. n.prototype.removeListener = function(e, t) {
  30662. var i, n, o, s;
  30663. if (!r(t))
  30664. throw TypeError("listener must be a function");
  30665. if (!this._events || !this._events[e])
  30666. return this;
  30667. if (i = this._events[e],
  30668. o = i.length,
  30669. n = -1,
  30670. i === t || r(i.listener) && i.listener === t)
  30671. delete this._events[e],
  30672. this._events.removeListener && this.emit("removeListener", e, t);
  30673. else if (a(i)) {
  30674. for (s = o; s-- > 0; )
  30675. if (i[s] === t || i[s].listener && i[s].listener === t) {
  30676. n = s;
  30677. break
  30678. }
  30679. if (n < 0)
  30680. return this;
  30681. 1 === i.length ? (i.length = 0,
  30682. delete this._events[e]) : i.splice(n, 1),
  30683. this._events.removeListener && this.emit("removeListener", e, t)
  30684. }
  30685. return this
  30686. }
  30687. ,
  30688. n.prototype.removeAllListeners = function(e) {
  30689. var t, i;
  30690. if (!this._events)
  30691. return this;
  30692. if (!this._events.removeListener)
  30693. return 0 === arguments.length ? this._events = {} : this._events[e] && delete this._events[e],
  30694. this;
  30695. if (0 === arguments.length) {
  30696. for (t in this._events)
  30697. "removeListener" !== t && this.removeAllListeners(t);
  30698. return this.removeAllListeners("removeListener"),
  30699. this._events = {},
  30700. this
  30701. }
  30702. if (i = this._events[e],
  30703. r(i))
  30704. this.removeListener(e, i);
  30705. else if (i)
  30706. for (; i.length; )
  30707. this.removeListener(e, i[i.length - 1]);
  30708. return delete this._events[e],
  30709. this
  30710. }
  30711. ,
  30712. n.prototype.listeners = function(e) {
  30713. var t;
  30714. return t = this._events && this._events[e] ? r(this._events[e]) ? [this._events[e]] : this._events[e].slice() : []
  30715. }
  30716. ,
  30717. n.prototype.listenerCount = function(e) {
  30718. if (this._events) {
  30719. var t = this._events[e];
  30720. if (r(t))
  30721. return 1;
  30722. if (t)
  30723. return t.length
  30724. }
  30725. return 0
  30726. }
  30727. ,
  30728. n.listenerCount = function(e, t) {
  30729. return e.listenerCount(t)
  30730. }
  30731. }
  30732. , {}],
  30733. 203: [function(e, t, i) {
  30734. function n() {
  30735. throw new Error("setTimeout has not been defined")
  30736. }
  30737. function r() {
  30738. throw new Error("clearTimeout has not been defined")
  30739. }
  30740. function o(e) {
  30741. if (u === setTimeout)
  30742. return setTimeout(e, 0);
  30743. if ((u === n || !u) && setTimeout)
  30744. return u = setTimeout,
  30745. setTimeout(e, 0);
  30746. try {
  30747. return u(e, 0)
  30748. } catch (t) {
  30749. try {
  30750. return u.call(null, e, 0)
  30751. } catch (t) {
  30752. return u.call(this, e, 0)
  30753. }
  30754. }
  30755. }
  30756. function a(e) {
  30757. if (d === clearTimeout)
  30758. return clearTimeout(e);
  30759. if ((d === r || !d) && clearTimeout)
  30760. return d = clearTimeout,
  30761. clearTimeout(e);
  30762. try {
  30763. return d(e)
  30764. } catch (t) {
  30765. try {
  30766. return d.call(null, e)
  30767. } catch (t) {
  30768. return d.call(this, e)
  30769. }
  30770. }
  30771. }
  30772. function s() {
  30773. m && f && (m = !1,
  30774. f.length ? g = f.concat(g) : v = -1,
  30775. g.length && l())
  30776. }
  30777. function l() {
  30778. if (!m) {
  30779. var e = o(s);
  30780. m = !0;
  30781. for (var t = g.length; t; ) {
  30782. for (f = g,
  30783. g = []; ++v < t; )
  30784. f && f[v].run();
  30785. v = -1,
  30786. t = g.length
  30787. }
  30788. f = null,
  30789. m = !1,
  30790. a(e)
  30791. }
  30792. }
  30793. function c(e, t) {
  30794. this.fun = e,
  30795. this.array = t
  30796. }
  30797. function h() {}
  30798. var u, d, p = t.exports = {};
  30799. !function() {
  30800. try {
  30801. u = "function" == typeof setTimeout ? setTimeout : n
  30802. } catch (e) {
  30803. u = n
  30804. }
  30805. try {
  30806. d = "function" == typeof clearTimeout ? clearTimeout : r
  30807. } catch (e) {
  30808. d = r
  30809. }
  30810. }();
  30811. var f, g = [], m = !1, v = -1;
  30812. p.nextTick = function(e) {
  30813. var t = new Array(arguments.length - 1);
  30814. if (arguments.length > 1)
  30815. for (var i = 1; i < arguments.length; i++)
  30816. t[i - 1] = arguments[i];
  30817. g.push(new c(e,t)),
  30818. 1 !== g.length || m || o(l)
  30819. }
  30820. ,
  30821. c.prototype.run = function() {
  30822. this.fun.apply(null, this.array)
  30823. }
  30824. ,
  30825. p.title = "browser",
  30826. p.browser = !0,
  30827. p.env = {},
  30828. p.argv = [],
  30829. p.version = "",
  30830. p.versions = {},
  30831. p.on = h,
  30832. p.addListener = h,
  30833. p.once = h,
  30834. p.off = h,
  30835. p.removeListener = h,
  30836. p.removeAllListeners = h,
  30837. p.emit = h,
  30838. p.binding = function(e) {
  30839. throw new Error("process.binding is not supported")
  30840. }
  30841. ,
  30842. p.cwd = function() {
  30843. return "/"
  30844. }
  30845. ,
  30846. p.chdir = function(e) {
  30847. throw new Error("process.chdir is not supported")
  30848. }
  30849. ,
  30850. p.umask = function() {
  30851. return 0
  30852. }
  30853. }
  30854. , {}],
  30855. 204: [function(e, t, i) {
  30856. (function(e) {
  30857. !function(n) {
  30858. function r(e) {
  30859. throw new RangeError(L[e])
  30860. }
  30861. function o(e, t) {
  30862. for (var i = e.length, n = []; i--; )
  30863. n[i] = t(e[i]);
  30864. return n
  30865. }
  30866. function a(e, t) {
  30867. var i = e.split("@")
  30868. , n = "";
  30869. i.length > 1 && (n = i[0] + "@",
  30870. e = i[1]),
  30871. e = e.replace(O, ".");
  30872. var r = e.split(".")
  30873. , a = o(r, t).join(".");
  30874. return n + a
  30875. }
  30876. function s(e) {
  30877. for (var t, i, n = [], r = 0, o = e.length; r < o; )
  30878. t = e.charCodeAt(r++),
  30879. t >= 55296 && t <= 56319 && r < o ? (i = e.charCodeAt(r++),
  30880. 56320 == (64512 & i) ? n.push(((1023 & t) << 10) + (1023 & i) + 65536) : (n.push(t),
  30881. r--)) : n.push(t);
  30882. return n
  30883. }
  30884. function l(e) {
  30885. return o(e, function(e) {
  30886. var t = "";
  30887. return e > 65535 && (e -= 65536,
  30888. t += B(e >>> 10 & 1023 | 55296),
  30889. e = 56320 | 1023 & e),
  30890. t += B(e)
  30891. }).join("")
  30892. }
  30893. function c(e) {
  30894. return e - 48 < 10 ? e - 22 : e - 65 < 26 ? e - 65 : e - 97 < 26 ? e - 97 : E
  30895. }
  30896. function h(e, t) {
  30897. return e + 22 + 75 * (e < 26) - ((0 != t) << 5)
  30898. }
  30899. function u(e, t, i) {
  30900. var n = 0;
  30901. for (e = i ? N(e / T) : e >> 1,
  30902. e += N(e / t); e > D * w >> 1; n += E)
  30903. e = N(e / D);
  30904. return N(n + (D + 1) * e / (e + _))
  30905. }
  30906. function d(e) {
  30907. var t, i, n, o, a, s, h, d, p, f, g = [], m = e.length, v = 0, A = S, y = x;
  30908. for (i = e.lastIndexOf(M),
  30909. i < 0 && (i = 0),
  30910. n = 0; n < i; ++n)
  30911. e.charCodeAt(n) >= 128 && r("not-basic"),
  30912. g.push(e.charCodeAt(n));
  30913. for (o = i > 0 ? i + 1 : 0; o < m; ) {
  30914. for (a = v,
  30915. s = 1,
  30916. h = E; o >= m && r("invalid-input"),
  30917. d = c(e.charCodeAt(o++)),
  30918. (d >= E || d > N((I - v) / s)) && r("overflow"),
  30919. v += d * s,
  30920. p = h <= y ? b : h >= y + w ? w : h - y,
  30921. !(d < p); h += E)
  30922. f = E - p,
  30923. s > N(I / f) && r("overflow"),
  30924. s *= f;
  30925. t = g.length + 1,
  30926. y = u(v - a, t, 0 == a),
  30927. N(v / t) > I - A && r("overflow"),
  30928. A += N(v / t),
  30929. v %= t,
  30930. g.splice(v++, 0, A)
  30931. }
  30932. return l(g)
  30933. }
  30934. function p(e) {
  30935. var t, i, n, o, a, l, c, d, p, f, g, m, v, A, y, C = [];
  30936. for (e = s(e),
  30937. m = e.length,
  30938. t = S,
  30939. i = 0,
  30940. a = x,
  30941. l = 0; l < m; ++l)
  30942. g = e[l],
  30943. g < 128 && C.push(B(g));
  30944. for (n = o = C.length,
  30945. o && C.push(M); n < m; ) {
  30946. for (c = I,
  30947. l = 0; l < m; ++l)
  30948. g = e[l],
  30949. g >= t && g < c && (c = g);
  30950. for (v = n + 1,
  30951. c - t > N((I - i) / v) && r("overflow"),
  30952. i += (c - t) * v,
  30953. t = c,
  30954. l = 0; l < m; ++l)
  30955. if (g = e[l],
  30956. g < t && ++i > I && r("overflow"),
  30957. g == t) {
  30958. for (d = i,
  30959. p = E; f = p <= a ? b : p >= a + w ? w : p - a,
  30960. !(d < f); p += E)
  30961. y = d - f,
  30962. A = E - f,
  30963. C.push(B(h(f + y % A, 0))),
  30964. d = N(y / A);
  30965. C.push(B(h(d, 0))),
  30966. a = u(i, v, n == o),
  30967. i = 0,
  30968. ++n
  30969. }
  30970. ++i,
  30971. ++t
  30972. }
  30973. return C.join("")
  30974. }
  30975. function f(e) {
  30976. return a(e, function(e) {
  30977. return R.test(e) ? d(e.slice(4).toLowerCase()) : e
  30978. })
  30979. }
  30980. function g(e) {
  30981. return a(e, function(e) {
  30982. return P.test(e) ? "xn--" + p(e) : e
  30983. })
  30984. }
  30985. var m = "object" == typeof i && i && !i.nodeType && i
  30986. , v = "object" == typeof t && t && !t.nodeType && t
  30987. , A = "object" == typeof e && e;
  30988. A.global !== A && A.window !== A && A.self !== A || (n = A);
  30989. var y, C, I = 2147483647, E = 36, b = 1, w = 26, _ = 38, T = 700, x = 72, S = 128, M = "-", R = /^xn--/, P = /[^\x20-\x7E]/, O = /[\x2E\u3002\uFF0E\uFF61]/g, L = {
  30990. overflow: "Overflow: input needs wider integers to process",
  30991. "not-basic": "Illegal input >= 0x80 (not a basic code point)",
  30992. "invalid-input": "Invalid input"
  30993. }, D = E - b, N = Math.floor, B = String.fromCharCode;
  30994. if (y = {
  30995. version: "1.4.1",
  30996. ucs2: {
  30997. decode: s,
  30998. encode: l
  30999. },
  31000. decode: d,
  31001. encode: p,
  31002. toASCII: g,
  31003. toUnicode: f
  31004. },
  31005. "function" == typeof define && "object" == typeof define.amd && define.amd)
  31006. define("punycode", function() {
  31007. return y
  31008. });
  31009. else if (m && v)
  31010. if (t.exports == m)
  31011. v.exports = y;
  31012. else
  31013. for (C in y)
  31014. y.hasOwnProperty(C) && (m[C] = y[C]);
  31015. else
  31016. n.punycode = y
  31017. }(this)
  31018. }
  31019. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  31020. }
  31021. , {}],
  31022. 205: [function(e, t, i) {
  31023. "use strict";
  31024. function n(e, t) {
  31025. return Object.prototype.hasOwnProperty.call(e, t)
  31026. }
  31027. t.exports = function(e, t, i, o) {
  31028. t = t || "&",
  31029. i = i || "=";
  31030. var a = {};
  31031. if ("string" != typeof e || 0 === e.length)
  31032. return a;
  31033. var s = /\+/g;
  31034. e = e.split(t);
  31035. var l = 1e3;
  31036. o && "number" == typeof o.maxKeys && (l = o.maxKeys);
  31037. var c = e.length;
  31038. l > 0 && c > l && (c = l);
  31039. for (var h = 0; h < c; ++h) {
  31040. var u, d, p, f, g = e[h].replace(s, "%20"), m = g.indexOf(i);
  31041. m >= 0 ? (u = g.substr(0, m),
  31042. d = g.substr(m + 1)) : (u = g,
  31043. d = ""),
  31044. p = decodeURIComponent(u),
  31045. f = decodeURIComponent(d),
  31046. n(a, p) ? r(a[p]) ? a[p].push(f) : a[p] = [a[p], f] : a[p] = f
  31047. }
  31048. return a
  31049. }
  31050. ;
  31051. var r = Array.isArray || function(e) {
  31052. return "[object Array]" === Object.prototype.toString.call(e)
  31053. }
  31054. }
  31055. , {}],
  31056. 206: [function(e, t, i) {
  31057. "use strict";
  31058. function n(e, t) {
  31059. if (e.map)
  31060. return e.map(t);
  31061. for (var i = [], n = 0; n < e.length; n++)
  31062. i.push(t(e[n], n));
  31063. return i
  31064. }
  31065. var r = function(e) {
  31066. switch (typeof e) {
  31067. case "string":
  31068. return e;
  31069. case "boolean":
  31070. return e ? "true" : "false";
  31071. case "number":
  31072. return isFinite(e) ? e : "";
  31073. default:
  31074. return ""
  31075. }
  31076. };
  31077. t.exports = function(e, t, i, s) {
  31078. return t = t || "&",
  31079. i = i || "=",
  31080. null === e && (e = void 0),
  31081. "object" == typeof e ? n(a(e), function(a) {
  31082. var s = encodeURIComponent(r(a)) + i;
  31083. return o(e[a]) ? n(e[a], function(e) {
  31084. return s + encodeURIComponent(r(e))
  31085. }).join(t) : s + encodeURIComponent(r(e[a]))
  31086. }).join(t) : s ? encodeURIComponent(r(s)) + i + encodeURIComponent(r(e)) : ""
  31087. }
  31088. ;
  31089. var o = Array.isArray || function(e) {
  31090. return "[object Array]" === Object.prototype.toString.call(e)
  31091. }
  31092. , a = Object.keys || function(e) {
  31093. var t = [];
  31094. for (var i in e)
  31095. Object.prototype.hasOwnProperty.call(e, i) && t.push(i);
  31096. return t
  31097. }
  31098. }
  31099. , {}],
  31100. 207: [function(e, t, i) {
  31101. "use strict";
  31102. i.decode = i.parse = e("./decode"),
  31103. i.encode = i.stringify = e("./encode")
  31104. }
  31105. , {
  31106. "./decode": 205,
  31107. "./encode": 206
  31108. }],
  31109. 208: [function(e, t, i) {
  31110. "use strict";
  31111. function n() {
  31112. this.protocol = null,
  31113. this.slashes = null,
  31114. this.auth = null,
  31115. this.host = null,
  31116. this.port = null,
  31117. this.hostname = null,
  31118. this.hash = null,
  31119. this.search = null,
  31120. this.query = null,
  31121. this.pathname = null,
  31122. this.path = null,
  31123. this.href = null
  31124. }
  31125. function r(e, t, i) {
  31126. if (e && c.isObject(e) && e instanceof n)
  31127. return e;
  31128. var r = new n;
  31129. return r.parse(e, t, i),
  31130. r
  31131. }
  31132. function o(e) {
  31133. return c.isString(e) && (e = r(e)),
  31134. e instanceof n ? e.format() : n.prototype.format.call(e)
  31135. }
  31136. function a(e, t) {
  31137. return r(e, !1, !0).resolve(t)
  31138. }
  31139. function s(e, t) {
  31140. return e ? r(e, !1, !0).resolveObject(t) : t
  31141. }
  31142. var l = e("punycode")
  31143. , c = e("./util");
  31144. i.parse = r,
  31145. i.resolve = a,
  31146. i.resolveObject = s,
  31147. i.format = o,
  31148. i.Url = n;
  31149. var h = /^([a-z0-9.+-]+:)/i
  31150. , u = /:[0-9]*$/
  31151. , d = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/
  31152. , p = ["<", ">", '"', "`", " ", "\r", "\n", "\t"]
  31153. , f = ["{", "}", "|", "\\", "^", "`"].concat(p)
  31154. , g = ["'"].concat(f)
  31155. , m = ["%", "/", "?", ";", "#"].concat(g)
  31156. , v = ["/", "?", "#"]
  31157. , A = 255
  31158. , y = /^[+a-z0-9A-Z_-]{0,63}$/
  31159. , C = /^([+a-z0-9A-Z_-]{0,63})(.*)$/
  31160. , I = {
  31161. javascript: !0,
  31162. "javascript:": !0
  31163. }
  31164. , E = {
  31165. javascript: !0,
  31166. "javascript:": !0
  31167. }
  31168. , b = {
  31169. http: !0,
  31170. https: !0,
  31171. ftp: !0,
  31172. gopher: !0,
  31173. file: !0,
  31174. "http:": !0,
  31175. "https:": !0,
  31176. "ftp:": !0,
  31177. "gopher:": !0,
  31178. "file:": !0
  31179. }
  31180. , w = e("querystring");
  31181. n.prototype.parse = function(e, t, i) {
  31182. if (!c.isString(e))
  31183. throw new TypeError("Parameter 'url' must be a string, not " + typeof e);
  31184. var n = e.indexOf("?")
  31185. , r = n !== -1 && n < e.indexOf("#") ? "?" : "#"
  31186. , o = e.split(r)
  31187. , a = /\\/g;
  31188. o[0] = o[0].replace(a, "/"),
  31189. e = o.join(r);
  31190. var s = e;
  31191. if (s = s.trim(),
  31192. !i && 1 === e.split("#").length) {
  31193. var u = d.exec(s);
  31194. if (u)
  31195. return this.path = s,
  31196. this.href = s,
  31197. this.pathname = u[1],
  31198. u[2] ? (this.search = u[2],
  31199. t ? this.query = w.parse(this.search.substr(1)) : this.query = this.search.substr(1)) : t && (this.search = "",
  31200. this.query = {}),
  31201. this
  31202. }
  31203. var p = h.exec(s);
  31204. if (p) {
  31205. p = p[0];
  31206. var f = p.toLowerCase();
  31207. this.protocol = f,
  31208. s = s.substr(p.length)
  31209. }
  31210. if (i || p || s.match(/^\/\/[^@\/]+@[^@\/]+/)) {
  31211. var _ = "//" === s.substr(0, 2);
  31212. !_ || p && E[p] || (s = s.substr(2),
  31213. this.slashes = !0)
  31214. }
  31215. if (!E[p] && (_ || p && !b[p])) {
  31216. for (var T = -1, x = 0; x < v.length; x++) {
  31217. var S = s.indexOf(v[x]);
  31218. S !== -1 && (T === -1 || S < T) && (T = S)
  31219. }
  31220. var M, R;
  31221. R = T === -1 ? s.lastIndexOf("@") : s.lastIndexOf("@", T),
  31222. R !== -1 && (M = s.slice(0, R),
  31223. s = s.slice(R + 1),
  31224. this.auth = decodeURIComponent(M)),
  31225. T = -1;
  31226. for (var x = 0; x < m.length; x++) {
  31227. var S = s.indexOf(m[x]);
  31228. S !== -1 && (T === -1 || S < T) && (T = S)
  31229. }
  31230. T === -1 && (T = s.length),
  31231. this.host = s.slice(0, T),
  31232. s = s.slice(T),
  31233. this.parseHost(),
  31234. this.hostname = this.hostname || "";
  31235. var P = "[" === this.hostname[0] && "]" === this.hostname[this.hostname.length - 1];
  31236. if (!P)
  31237. for (var O = this.hostname.split(/\./), x = 0, L = O.length; x < L; x++) {
  31238. var D = O[x];
  31239. if (D && !D.match(y)) {
  31240. for (var N = "", B = 0, F = D.length; B < F; B++)
  31241. N += D.charCodeAt(B) > 127 ? "x" : D[B];
  31242. if (!N.match(y)) {
  31243. var V = O.slice(0, x)
  31244. , U = O.slice(x + 1)
  31245. , k = D.match(C);
  31246. k && (V.push(k[1]),
  31247. U.unshift(k[2])),
  31248. U.length && (s = "/" + U.join(".") + s),
  31249. this.hostname = V.join(".");
  31250. break
  31251. }
  31252. }
  31253. }
  31254. this.hostname.length > A ? this.hostname = "" : this.hostname = this.hostname.toLowerCase(),
  31255. P || (this.hostname = l.toASCII(this.hostname));
  31256. var H = this.port ? ":" + this.port : ""
  31257. , G = this.hostname || "";
  31258. this.host = G + H,
  31259. this.href += this.host,
  31260. P && (this.hostname = this.hostname.substr(1, this.hostname.length - 2),
  31261. "/" !== s[0] && (s = "/" + s))
  31262. }
  31263. if (!I[f])
  31264. for (var x = 0, L = g.length; x < L; x++) {
  31265. var z = g[x];
  31266. if (s.indexOf(z) !== -1) {
  31267. var W = encodeURIComponent(z);
  31268. W === z && (W = escape(z)),
  31269. s = s.split(z).join(W)
  31270. }
  31271. }
  31272. var j = s.indexOf("#");
  31273. j !== -1 && (this.hash = s.substr(j),
  31274. s = s.slice(0, j));
  31275. var Y = s.indexOf("?");
  31276. if (Y !== -1 ? (this.search = s.substr(Y),
  31277. this.query = s.substr(Y + 1),
  31278. t && (this.query = w.parse(this.query)),
  31279. s = s.slice(0, Y)) : t && (this.search = "",
  31280. this.query = {}),
  31281. s && (this.pathname = s),
  31282. b[f] && this.hostname && !this.pathname && (this.pathname = "/"),
  31283. this.pathname || this.search) {
  31284. var H = this.pathname || ""
  31285. , X = this.search || "";
  31286. this.path = H + X
  31287. }
  31288. return this.href = this.format(),
  31289. this
  31290. }
  31291. ,
  31292. n.prototype.format = function() {
  31293. var e = this.auth || "";
  31294. e && (e = encodeURIComponent(e),
  31295. e = e.replace(/%3A/i, ":"),
  31296. e += "@");
  31297. var t = this.protocol || ""
  31298. , i = this.pathname || ""
  31299. , n = this.hash || ""
  31300. , r = !1
  31301. , o = "";
  31302. this.host ? r = e + this.host : this.hostname && (r = e + (this.hostname.indexOf(":") === -1 ? this.hostname : "[" + this.hostname + "]"),
  31303. this.port && (r += ":" + this.port)),
  31304. this.query && c.isObject(this.query) && Object.keys(this.query).length && (o = w.stringify(this.query));
  31305. var a = this.search || o && "?" + o || "";
  31306. return t && ":" !== t.substr(-1) && (t += ":"),
  31307. this.slashes || (!t || b[t]) && r !== !1 ? (r = "//" + (r || ""),
  31308. i && "/" !== i.charAt(0) && (i = "/" + i)) : r || (r = ""),
  31309. n && "#" !== n.charAt(0) && (n = "#" + n),
  31310. a && "?" !== a.charAt(0) && (a = "?" + a),
  31311. i = i.replace(/[?#]/g, function(e) {
  31312. return encodeURIComponent(e)
  31313. }),
  31314. a = a.replace("#", "%23"),
  31315. t + r + i + a + n
  31316. }
  31317. ,
  31318. n.prototype.resolve = function(e) {
  31319. return this.resolveObject(r(e, !1, !0)).format()
  31320. }
  31321. ,
  31322. n.prototype.resolveObject = function(e) {
  31323. if (c.isString(e)) {
  31324. var t = new n;
  31325. t.parse(e, !1, !0),
  31326. e = t
  31327. }
  31328. for (var i = new n, r = Object.keys(this), o = 0; o < r.length; o++) {
  31329. var a = r[o];
  31330. i[a] = this[a]
  31331. }
  31332. if (i.hash = e.hash,
  31333. "" === e.href)
  31334. return i.href = i.format(),
  31335. i;
  31336. if (e.slashes && !e.protocol) {
  31337. for (var s = Object.keys(e), l = 0; l < s.length; l++) {
  31338. var h = s[l];
  31339. "protocol" !== h && (i[h] = e[h])
  31340. }
  31341. return b[i.protocol] && i.hostname && !i.pathname && (i.path = i.pathname = "/"),
  31342. i.href = i.format(),
  31343. i
  31344. }
  31345. if (e.protocol && e.protocol !== i.protocol) {
  31346. if (!b[e.protocol]) {
  31347. for (var u = Object.keys(e), d = 0; d < u.length; d++) {
  31348. var p = u[d];
  31349. i[p] = e[p]
  31350. }
  31351. return i.href = i.format(),
  31352. i
  31353. }
  31354. if (i.protocol = e.protocol,
  31355. e.host || E[e.protocol])
  31356. i.pathname = e.pathname;
  31357. else {
  31358. for (var f = (e.pathname || "").split("/"); f.length && !(e.host = f.shift()); )
  31359. ;
  31360. e.host || (e.host = ""),
  31361. e.hostname || (e.hostname = ""),
  31362. "" !== f[0] && f.unshift(""),
  31363. f.length < 2 && f.unshift(""),
  31364. i.pathname = f.join("/")
  31365. }
  31366. if (i.search = e.search,
  31367. i.query = e.query,
  31368. i.host = e.host || "",
  31369. i.auth = e.auth,
  31370. i.hostname = e.hostname || e.host,
  31371. i.port = e.port,
  31372. i.pathname || i.search) {
  31373. var g = i.pathname || ""
  31374. , m = i.search || "";
  31375. i.path = g + m
  31376. }
  31377. return i.slashes = i.slashes || e.slashes,
  31378. i.href = i.format(),
  31379. i
  31380. }
  31381. var v = i.pathname && "/" === i.pathname.charAt(0)
  31382. , A = e.host || e.pathname && "/" === e.pathname.charAt(0)
  31383. , y = A || v || i.host && e.pathname
  31384. , C = y
  31385. , I = i.pathname && i.pathname.split("/") || []
  31386. , f = e.pathname && e.pathname.split("/") || []
  31387. , w = i.protocol && !b[i.protocol];
  31388. if (w && (i.hostname = "",
  31389. i.port = null,
  31390. i.host && ("" === I[0] ? I[0] = i.host : I.unshift(i.host)),
  31391. i.host = "",
  31392. e.protocol && (e.hostname = null,
  31393. e.port = null,
  31394. e.host && ("" === f[0] ? f[0] = e.host : f.unshift(e.host)),
  31395. e.host = null),
  31396. y = y && ("" === f[0] || "" === I[0])),
  31397. A)
  31398. i.host = e.host || "" === e.host ? e.host : i.host,
  31399. i.hostname = e.hostname || "" === e.hostname ? e.hostname : i.hostname,
  31400. i.search = e.search,
  31401. i.query = e.query,
  31402. I = f;
  31403. else if (f.length)
  31404. I || (I = []),
  31405. I.pop(),
  31406. I = I.concat(f),
  31407. i.search = e.search,
  31408. i.query = e.query;
  31409. else if (!c.isNullOrUndefined(e.search)) {
  31410. if (w) {
  31411. i.hostname = i.host = I.shift();
  31412. var _ = !!(i.host && i.host.indexOf("@") > 0) && i.host.split("@");
  31413. _ && (i.auth = _.shift(),
  31414. i.host = i.hostname = _.shift())
  31415. }
  31416. return i.search = e.search,
  31417. i.query = e.query,
  31418. c.isNull(i.pathname) && c.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  31419. i.href = i.format(),
  31420. i
  31421. }
  31422. if (!I.length)
  31423. return i.pathname = null,
  31424. i.search ? i.path = "/" + i.search : i.path = null,
  31425. i.href = i.format(),
  31426. i;
  31427. for (var T = I.slice(-1)[0], x = (i.host || e.host || I.length > 1) && ("." === T || ".." === T) || "" === T, S = 0, M = I.length; M >= 0; M--)
  31428. T = I[M],
  31429. "." === T ? I.splice(M, 1) : ".." === T ? (I.splice(M, 1),
  31430. S++) : S && (I.splice(M, 1),
  31431. S--);
  31432. if (!y && !C)
  31433. for (; S--; S)
  31434. I.unshift("..");
  31435. !y || "" === I[0] || I[0] && "/" === I[0].charAt(0) || I.unshift(""),
  31436. x && "/" !== I.join("/").substr(-1) && I.push("");
  31437. var R = "" === I[0] || I[0] && "/" === I[0].charAt(0);
  31438. if (w) {
  31439. i.hostname = i.host = R ? "" : I.length ? I.shift() : "";
  31440. var _ = !!(i.host && i.host.indexOf("@") > 0) && i.host.split("@");
  31441. _ && (i.auth = _.shift(),
  31442. i.host = i.hostname = _.shift())
  31443. }
  31444. return y = y || i.host && I.length,
  31445. y && !R && I.unshift(""),
  31446. I.length ? i.pathname = I.join("/") : (i.pathname = null,
  31447. i.path = null),
  31448. c.isNull(i.pathname) && c.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  31449. i.auth = e.auth || i.auth,
  31450. i.slashes = i.slashes || e.slashes,
  31451. i.href = i.format(),
  31452. i
  31453. }
  31454. ,
  31455. n.prototype.parseHost = function() {
  31456. var e = this.host
  31457. , t = u.exec(e);
  31458. t && (t = t[0],
  31459. ":" !== t && (this.port = t.substr(1)),
  31460. e = e.substr(0, e.length - t.length)),
  31461. e && (this.hostname = e)
  31462. }
  31463. }
  31464. , {
  31465. "./util": 209,
  31466. punycode: 204,
  31467. querystring: 207
  31468. }],
  31469. 209: [function(e, t, i) {
  31470. "use strict";
  31471. t.exports = {
  31472. isString: function(e) {
  31473. return "string" == typeof e
  31474. },
  31475. isObject: function(e) {
  31476. return "object" == typeof e && null !== e
  31477. },
  31478. isNull: function(e) {
  31479. return null === e
  31480. },
  31481. isNullOrUndefined: function(e) {
  31482. return null == e
  31483. }
  31484. }
  31485. }
  31486. , {}],
  31487. 210: [function(e, t, i) {
  31488. "use strict";
  31489. function n(e) {
  31490. return l + e
  31491. }
  31492. function r(e) {
  31493. return e.substring(l.length)
  31494. }
  31495. function o(e, t) {
  31496. for (var i in t)
  31497. Object.defineProperty(e, i, {
  31498. value: t[i],
  31499. configurable: !0,
  31500. writable: !0
  31501. })
  31502. }
  31503. function a(e) {
  31504. if ("string" != typeof e)
  31505. throw new TypeError("key must be a string.")
  31506. }
  31507. var s = Object.prototype.hasOwnProperty
  31508. , l = "~";
  31509. t.exports = function(e) {
  31510. var t = Object.create(null)
  31511. , i = 0
  31512. , l = {};
  31513. return o(l, {
  31514. get: function(e, i) {
  31515. a(e);
  31516. var r = n(e);
  31517. return r in t ? t[r] : i
  31518. },
  31519. set: function(e, r) {
  31520. a(e);
  31521. var o = n(e);
  31522. return o in t || ++i,
  31523. t[o] = r
  31524. },
  31525. has: function(e) {
  31526. return a(e),
  31527. n(e)in t
  31528. },
  31529. delete: function(e) {
  31530. a(e);
  31531. var r = n(e);
  31532. return r in t && (--i,
  31533. delete t[r],
  31534. !0)
  31535. },
  31536. clear: function() {
  31537. t = Object.create(null),
  31538. i = 0
  31539. },
  31540. forEach: function(e, i) {
  31541. if ("function" != typeof e)
  31542. throw new TypeError("`callback` must be a function");
  31543. for (var n in t)
  31544. if (s.call(t, n)) {
  31545. var o = r(n)
  31546. , a = t[n];
  31547. e.call(i, a, o, l)
  31548. }
  31549. }
  31550. }),
  31551. Object.defineProperty(l, "size", {
  31552. get: function() {
  31553. return i
  31554. },
  31555. configurable: !0
  31556. }),
  31557. "object" == typeof e && null !== e && Object.keys(e).forEach(function(t) {
  31558. l.set(t, e[t])
  31559. }),
  31560. l
  31561. }
  31562. }
  31563. , {}],
  31564. 211: [function(e, t, i) {
  31565. t.exports = e("./lib/heap")
  31566. }
  31567. , {
  31568. "./lib/heap": 212
  31569. }],
  31570. 212: [function(e, t, i) {
  31571. (function() {
  31572. var e, n, r, o, a, s, l, c, h, u, d, p, f, g, m;
  31573. r = Math.floor,
  31574. u = Math.min,
  31575. n = function(e, t) {
  31576. return e < t ? -1 : e > t ? 1 : 0
  31577. }
  31578. ,
  31579. h = function(e, t, i, o, a) {
  31580. var s;
  31581. if (null == i && (i = 0),
  31582. null == a && (a = n),
  31583. i < 0)
  31584. throw new Error("lo must be non-negative");
  31585. for (null == o && (o = e.length); i < o; )
  31586. s = r((i + o) / 2),
  31587. a(t, e[s]) < 0 ? o = s : i = s + 1;
  31588. return [].splice.apply(e, [i, i - i].concat(t)),
  31589. t
  31590. }
  31591. ,
  31592. s = function(e, t, i) {
  31593. return null == i && (i = n),
  31594. e.push(t),
  31595. g(e, 0, e.length - 1, i)
  31596. }
  31597. ,
  31598. a = function(e, t) {
  31599. var i, r;
  31600. return null == t && (t = n),
  31601. i = e.pop(),
  31602. e.length ? (r = e[0],
  31603. e[0] = i,
  31604. m(e, 0, t)) : r = i,
  31605. r
  31606. }
  31607. ,
  31608. c = function(e, t, i) {
  31609. var r;
  31610. return null == i && (i = n),
  31611. r = e[0],
  31612. e[0] = t,
  31613. m(e, 0, i),
  31614. r
  31615. }
  31616. ,
  31617. l = function(e, t, i) {
  31618. var r;
  31619. return null == i && (i = n),
  31620. e.length && i(e[0], t) < 0 && (r = [e[0], t],
  31621. t = r[0],
  31622. e[0] = r[1],
  31623. m(e, 0, i)),
  31624. t
  31625. }
  31626. ,
  31627. o = function(e, t) {
  31628. var i, o, a, s, l, c;
  31629. for (null == t && (t = n),
  31630. s = function() {
  31631. c = [];
  31632. for (var t = 0, i = r(e.length / 2); 0 <= i ? t < i : t > i; 0 <= i ? t++ : t--)
  31633. c.push(t);
  31634. return c
  31635. }
  31636. .apply(this).reverse(),
  31637. l = [],
  31638. o = 0,
  31639. a = s.length; o < a; o++)
  31640. i = s[o],
  31641. l.push(m(e, i, t));
  31642. return l
  31643. }
  31644. ,
  31645. f = function(e, t, i) {
  31646. var r;
  31647. if (null == i && (i = n),
  31648. r = e.indexOf(t),
  31649. r !== -1)
  31650. return g(e, 0, r, i),
  31651. m(e, r, i)
  31652. }
  31653. ,
  31654. d = function(e, t, i) {
  31655. var r, a, s, c, h;
  31656. if (null == i && (i = n),
  31657. a = e.slice(0, t),
  31658. !a.length)
  31659. return a;
  31660. for (o(a, i),
  31661. h = e.slice(t),
  31662. s = 0,
  31663. c = h.length; s < c; s++)
  31664. r = h[s],
  31665. l(a, r, i);
  31666. return a.sort(i).reverse()
  31667. }
  31668. ,
  31669. p = function(e, t, i) {
  31670. var r, s, l, c, d, p, f, g, m, v;
  31671. if (null == i && (i = n),
  31672. 10 * t <= e.length) {
  31673. if (c = e.slice(0, t).sort(i),
  31674. !c.length)
  31675. return c;
  31676. for (l = c[c.length - 1],
  31677. g = e.slice(t),
  31678. d = 0,
  31679. f = g.length; d < f; d++)
  31680. r = g[d],
  31681. i(r, l) < 0 && (h(c, r, 0, null, i),
  31682. c.pop(),
  31683. l = c[c.length - 1]);
  31684. return c
  31685. }
  31686. for (o(e, i),
  31687. v = [],
  31688. s = p = 0,
  31689. m = u(t, e.length); 0 <= m ? p < m : p > m; s = 0 <= m ? ++p : --p)
  31690. v.push(a(e, i));
  31691. return v
  31692. }
  31693. ,
  31694. g = function(e, t, i, r) {
  31695. var o, a, s;
  31696. for (null == r && (r = n),
  31697. o = e[i]; i > t && (s = i - 1 >> 1,
  31698. a = e[s],
  31699. r(o, a) < 0); )
  31700. e[i] = a,
  31701. i = s;
  31702. return e[i] = o
  31703. }
  31704. ,
  31705. m = function(e, t, i) {
  31706. var r, o, a, s, l;
  31707. for (null == i && (i = n),
  31708. o = e.length,
  31709. l = t,
  31710. a = e[t],
  31711. r = 2 * t + 1; r < o; )
  31712. s = r + 1,
  31713. s < o && !(i(e[r], e[s]) < 0) && (r = s),
  31714. e[t] = e[r],
  31715. t = r,
  31716. r = 2 * t + 1;
  31717. return e[t] = a,
  31718. g(e, l, t, i)
  31719. }
  31720. ,
  31721. e = function() {
  31722. function e(e) {
  31723. this.cmp = null != e ? e : n,
  31724. this.nodes = []
  31725. }
  31726. return e.push = s,
  31727. e.pop = a,
  31728. e.replace = c,
  31729. e.pushpop = l,
  31730. e.heapify = o,
  31731. e.updateItem = f,
  31732. e.nlargest = d,
  31733. e.nsmallest = p,
  31734. e.prototype.push = function(e) {
  31735. return s(this.nodes, e, this.cmp)
  31736. }
  31737. ,
  31738. e.prototype.pop = function() {
  31739. return a(this.nodes, this.cmp)
  31740. }
  31741. ,
  31742. e.prototype.peek = function() {
  31743. return this.nodes[0]
  31744. }
  31745. ,
  31746. e.prototype.contains = function(e) {
  31747. return this.nodes.indexOf(e) !== -1
  31748. }
  31749. ,
  31750. e.prototype.replace = function(e) {
  31751. return c(this.nodes, e, this.cmp)
  31752. }
  31753. ,
  31754. e.prototype.pushpop = function(e) {
  31755. return l(this.nodes, e, this.cmp)
  31756. }
  31757. ,
  31758. e.prototype.heapify = function() {
  31759. return o(this.nodes, this.cmp)
  31760. }
  31761. ,
  31762. e.prototype.updateItem = function(e) {
  31763. return f(this.nodes, e, this.cmp)
  31764. }
  31765. ,
  31766. e.prototype.clear = function() {
  31767. return this.nodes = []
  31768. }
  31769. ,
  31770. e.prototype.empty = function() {
  31771. return 0 === this.nodes.length
  31772. }
  31773. ,
  31774. e.prototype.size = function() {
  31775. return this.nodes.length
  31776. }
  31777. ,
  31778. e.prototype.clone = function() {
  31779. var t;
  31780. return t = new e,
  31781. t.nodes = this.nodes.slice(0),
  31782. t
  31783. }
  31784. ,
  31785. e.prototype.toArray = function() {
  31786. return this.nodes.slice(0)
  31787. }
  31788. ,
  31789. e.prototype.insert = e.prototype.push,
  31790. e.prototype.top = e.prototype.peek,
  31791. e.prototype.front = e.prototype.peek,
  31792. e.prototype.has = e.prototype.contains,
  31793. e.prototype.copy = e.prototype.clone,
  31794. e
  31795. }(),
  31796. function(e, n) {
  31797. return "function" == typeof define && define.amd ? define([], n) : "object" == typeof i ? t.exports = n() : e.Heap = n()
  31798. }(this, function() {
  31799. return e
  31800. })
  31801. }
  31802. ).call(this)
  31803. }
  31804. , {}],
  31805. 213: [function(e, t, i) {
  31806. !function(e) {
  31807. function i() {}
  31808. function n(e, t) {
  31809. return function() {
  31810. e.apply(t, arguments)
  31811. }
  31812. }
  31813. function r(e) {
  31814. if ("object" != typeof this)
  31815. throw new TypeError("Promises must be constructed via new");
  31816. if ("function" != typeof e)
  31817. throw new TypeError("not a function");
  31818. this._state = 0,
  31819. this._handled = !1,
  31820. this._value = void 0,
  31821. this._deferreds = [],
  31822. h(e, this)
  31823. }
  31824. function o(e, t) {
  31825. for (; 3 === e._state; )
  31826. e = e._value;
  31827. return 0 === e._state ? void e._deferreds.push(t) : (e._handled = !0,
  31828. void r._immediateFn(function() {
  31829. var i = 1 === e._state ? t.onFulfilled : t.onRejected;
  31830. if (null === i)
  31831. return void (1 === e._state ? a : s)(t.promise, e._value);
  31832. var n;
  31833. try {
  31834. n = i(e._value)
  31835. } catch (e) {
  31836. return void s(t.promise, e)
  31837. }
  31838. a(t.promise, n)
  31839. }))
  31840. }
  31841. function a(e, t) {
  31842. try {
  31843. if (t === e)
  31844. throw new TypeError("A promise cannot be resolved with itself.");
  31845. if (t && ("object" == typeof t || "function" == typeof t)) {
  31846. var i = t.then;
  31847. if (t instanceof r)
  31848. return e._state = 3,
  31849. e._value = t,
  31850. void l(e);
  31851. if ("function" == typeof i)
  31852. return void h(n(i, t), e)
  31853. }
  31854. e._state = 1,
  31855. e._value = t,
  31856. l(e)
  31857. } catch (t) {
  31858. s(e, t)
  31859. }
  31860. }
  31861. function s(e, t) {
  31862. e._state = 2,
  31863. e._value = t,
  31864. l(e)
  31865. }
  31866. function l(e) {
  31867. 2 === e._state && 0 === e._deferreds.length && r._immediateFn(function() {
  31868. e._handled || r._unhandledRejectionFn(e._value)
  31869. });
  31870. for (var t = 0, i = e._deferreds.length; t < i; t++)
  31871. o(e, e._deferreds[t]);
  31872. e._deferreds = null
  31873. }
  31874. function c(e, t, i) {
  31875. this.onFulfilled = "function" == typeof e ? e : null,
  31876. this.onRejected = "function" == typeof t ? t : null,
  31877. this.promise = i
  31878. }
  31879. function h(e, t) {
  31880. var i = !1;
  31881. try {
  31882. e(function(e) {
  31883. i || (i = !0,
  31884. a(t, e))
  31885. }, function(e) {
  31886. i || (i = !0,
  31887. s(t, e))
  31888. })
  31889. } catch (e) {
  31890. if (i)
  31891. return;
  31892. i = !0,
  31893. s(t, e)
  31894. }
  31895. }
  31896. var u = setTimeout;
  31897. r.prototype.catch = function(e) {
  31898. return this.then(null, e)
  31899. }
  31900. ,
  31901. r.prototype.then = function(e, t) {
  31902. var n = new this.constructor(i);
  31903. return o(this, new c(e,t,n)),
  31904. n
  31905. }
  31906. ,
  31907. r.all = function(e) {
  31908. var t = Array.prototype.slice.call(e);
  31909. return new r(function(e, i) {
  31910. function n(o, a) {
  31911. try {
  31912. if (a && ("object" == typeof a || "function" == typeof a)) {
  31913. var s = a.then;
  31914. if ("function" == typeof s)
  31915. return void s.call(a, function(e) {
  31916. n(o, e)
  31917. }, i)
  31918. }
  31919. t[o] = a,
  31920. 0 === --r && e(t)
  31921. } catch (e) {
  31922. i(e)
  31923. }
  31924. }
  31925. if (0 === t.length)
  31926. return e([]);
  31927. for (var r = t.length, o = 0; o < t.length; o++)
  31928. n(o, t[o])
  31929. }
  31930. )
  31931. }
  31932. ,
  31933. r.resolve = function(e) {
  31934. return e && "object" == typeof e && e.constructor === r ? e : new r(function(t) {
  31935. t(e)
  31936. }
  31937. )
  31938. }
  31939. ,
  31940. r.reject = function(e) {
  31941. return new r(function(t, i) {
  31942. i(e)
  31943. }
  31944. )
  31945. }
  31946. ,
  31947. r.race = function(e) {
  31948. return new r(function(t, i) {
  31949. for (var n = 0, r = e.length; n < r; n++)
  31950. e[n].then(t, i)
  31951. }
  31952. )
  31953. }
  31954. ,
  31955. r._immediateFn = "function" == typeof setImmediate && function(e) {
  31956. setImmediate(e)
  31957. }
  31958. || function(e) {
  31959. u(e, 0)
  31960. }
  31961. ,
  31962. r._unhandledRejectionFn = function(e) {
  31963. "undefined" != typeof console && console && console.warn("Possible Unhandled Promise Rejection:", e)
  31964. }
  31965. ,
  31966. r._setImmediateFn = function(e) {
  31967. r._immediateFn = e
  31968. }
  31969. ,
  31970. r._setUnhandledRejectionFn = function(e) {
  31971. r._unhandledRejectionFn = e
  31972. }
  31973. ,
  31974. "undefined" != typeof t && t.exports ? t.exports = r : e.Promise || (e.Promise = r)
  31975. }(this)
  31976. }
  31977. , {}],
  31978. 214: [function(e, t, i) {
  31979. (function(i) {
  31980. !function(i, n) {
  31981. "function" == typeof define && define.amd ? define(["bytebuffer"], n) : "function" == typeof e && "object" == typeof t && t && t.exports ? t.exports = n(e("bytebuffer"), !0) : (i.dcodeIO = i.dcodeIO || {}).ProtoBuf = n(i.dcodeIO.ByteBuffer)
  31982. }(this, function(t, n) {
  31983. "use strict";
  31984. var r = {};
  31985. return r.ByteBuffer = t,
  31986. r.Long = t.Long || null,
  31987. r.VERSION = "5.0.1",
  31988. r.WIRE_TYPES = {},
  31989. r.WIRE_TYPES.VARINT = 0,
  31990. r.WIRE_TYPES.BITS64 = 1,
  31991. r.WIRE_TYPES.LDELIM = 2,
  31992. r.WIRE_TYPES.STARTGROUP = 3,
  31993. r.WIRE_TYPES.ENDGROUP = 4,
  31994. r.WIRE_TYPES.BITS32 = 5,
  31995. r.PACKABLE_WIRE_TYPES = [r.WIRE_TYPES.VARINT, r.WIRE_TYPES.BITS64, r.WIRE_TYPES.BITS32],
  31996. r.TYPES = {
  31997. int32: {
  31998. name: "int32",
  31999. wireType: r.WIRE_TYPES.VARINT,
  32000. defaultValue: 0
  32001. },
  32002. uint32: {
  32003. name: "uint32",
  32004. wireType: r.WIRE_TYPES.VARINT,
  32005. defaultValue: 0
  32006. },
  32007. sint32: {
  32008. name: "sint32",
  32009. wireType: r.WIRE_TYPES.VARINT,
  32010. defaultValue: 0
  32011. },
  32012. int64: {
  32013. name: "int64",
  32014. wireType: r.WIRE_TYPES.VARINT,
  32015. defaultValue: r.Long ? r.Long.ZERO : void 0
  32016. },
  32017. uint64: {
  32018. name: "uint64",
  32019. wireType: r.WIRE_TYPES.VARINT,
  32020. defaultValue: r.Long ? r.Long.UZERO : void 0
  32021. },
  32022. sint64: {
  32023. name: "sint64",
  32024. wireType: r.WIRE_TYPES.VARINT,
  32025. defaultValue: r.Long ? r.Long.ZERO : void 0
  32026. },
  32027. bool: {
  32028. name: "bool",
  32029. wireType: r.WIRE_TYPES.VARINT,
  32030. defaultValue: !1
  32031. },
  32032. double: {
  32033. name: "double",
  32034. wireType: r.WIRE_TYPES.BITS64,
  32035. defaultValue: 0
  32036. },
  32037. string: {
  32038. name: "string",
  32039. wireType: r.WIRE_TYPES.LDELIM,
  32040. defaultValue: ""
  32041. },
  32042. bytes: {
  32043. name: "bytes",
  32044. wireType: r.WIRE_TYPES.LDELIM,
  32045. defaultValue: null
  32046. },
  32047. fixed32: {
  32048. name: "fixed32",
  32049. wireType: r.WIRE_TYPES.BITS32,
  32050. defaultValue: 0
  32051. },
  32052. sfixed32: {
  32053. name: "sfixed32",
  32054. wireType: r.WIRE_TYPES.BITS32,
  32055. defaultValue: 0
  32056. },
  32057. fixed64: {
  32058. name: "fixed64",
  32059. wireType: r.WIRE_TYPES.BITS64,
  32060. defaultValue: r.Long ? r.Long.UZERO : void 0
  32061. },
  32062. sfixed64: {
  32063. name: "sfixed64",
  32064. wireType: r.WIRE_TYPES.BITS64,
  32065. defaultValue: r.Long ? r.Long.ZERO : void 0
  32066. },
  32067. float: {
  32068. name: "float",
  32069. wireType: r.WIRE_TYPES.BITS32,
  32070. defaultValue: 0
  32071. },
  32072. enum: {
  32073. name: "enum",
  32074. wireType: r.WIRE_TYPES.VARINT,
  32075. defaultValue: 0
  32076. },
  32077. message: {
  32078. name: "message",
  32079. wireType: r.WIRE_TYPES.LDELIM,
  32080. defaultValue: null
  32081. },
  32082. group: {
  32083. name: "group",
  32084. wireType: r.WIRE_TYPES.STARTGROUP,
  32085. defaultValue: null
  32086. }
  32087. },
  32088. r.MAP_KEY_TYPES = [r.TYPES.int32, r.TYPES.sint32, r.TYPES.sfixed32, r.TYPES.uint32, r.TYPES.fixed32, r.TYPES.int64, r.TYPES.sint64, r.TYPES.sfixed64, r.TYPES.uint64, r.TYPES.fixed64, r.TYPES.bool, r.TYPES.string, r.TYPES.bytes],
  32089. r.ID_MIN = 1,
  32090. r.ID_MAX = 536870911,
  32091. r.convertFieldsToCamelCase = !1,
  32092. r.populateAccessors = !0,
  32093. r.populateDefaults = !0,
  32094. r.Util = function() {
  32095. var t = {};
  32096. return t.IS_NODE = !("object" != typeof i || i + "" != "[object process]" || i.browser),
  32097. t.XHR = function() {
  32098. for (var e = [function() {
  32099. return new XMLHttpRequest
  32100. }
  32101. , function() {
  32102. return new ActiveXObject("Msxml2.XMLHTTP")
  32103. }
  32104. , function() {
  32105. return new ActiveXObject("Msxml3.XMLHTTP")
  32106. }
  32107. , function() {
  32108. return new ActiveXObject("Microsoft.XMLHTTP")
  32109. }
  32110. ], t = null, i = 0; i < e.length; i++) {
  32111. try {
  32112. t = e[i]()
  32113. } catch (e) {
  32114. continue
  32115. }
  32116. break
  32117. }
  32118. if (!t)
  32119. throw Error("XMLHttpRequest is not supported");
  32120. return t
  32121. }
  32122. ,
  32123. t.fetch = function(i, n) {
  32124. if (n && "function" != typeof n && (n = null),
  32125. t.IS_NODE) {
  32126. var r = e("fs");
  32127. if (n)
  32128. r.readFile(i, function(e, t) {
  32129. n(e ? null : "" + t)
  32130. });
  32131. else
  32132. try {
  32133. return r.readFileSync(i)
  32134. } catch (e) {
  32135. return null
  32136. }
  32137. } else {
  32138. var o = t.XHR();
  32139. if (o.open("GET", i, !!n),
  32140. o.setRequestHeader("Accept", "text/plain"),
  32141. "function" == typeof o.overrideMimeType && o.overrideMimeType("text/plain"),
  32142. !n)
  32143. return o.send(null),
  32144. 200 == o.status || 0 == o.status && "string" == typeof o.responseText ? o.responseText : null;
  32145. if (o.onreadystatechange = function() {
  32146. 4 == o.readyState && n(200 == o.status || 0 == o.status && "string" == typeof o.responseText ? o.responseText : null)
  32147. }
  32148. ,
  32149. 4 == o.readyState)
  32150. return;
  32151. o.send(null)
  32152. }
  32153. }
  32154. ,
  32155. t.toCamelCase = function(e) {
  32156. return e.replace(/_([a-zA-Z])/g, function(e, t) {
  32157. return t.toUpperCase()
  32158. })
  32159. }
  32160. ,
  32161. t
  32162. }(),
  32163. r.Lang = {
  32164. DELIM: /[\s\{\}=;:\[\],'"\(\)<>]/g,
  32165. RULE: /^(?:required|optional|repeated|map)$/,
  32166. TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,
  32167. NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,
  32168. TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,
  32169. TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,
  32170. FQTYPEREF: /^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,
  32171. NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,
  32172. NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,
  32173. NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/,
  32174. NUMBER_OCT: /^0[0-7]+$/,
  32175. NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,
  32176. BOOL: /^(?:true|false)$/i,
  32177. ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  32178. NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  32179. WHITESPACE: /\s/,
  32180. STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,
  32181. STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,
  32182. STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g
  32183. },
  32184. r.DotProto = function(e, t) {
  32185. function i(e, i) {
  32186. var n = -1
  32187. , r = 1;
  32188. if ("-" == e.charAt(0) && (r = -1,
  32189. e = e.substring(1)),
  32190. t.NUMBER_DEC.test(e))
  32191. n = parseInt(e);
  32192. else if (t.NUMBER_HEX.test(e))
  32193. n = parseInt(e.substring(2), 16);
  32194. else {
  32195. if (!t.NUMBER_OCT.test(e))
  32196. throw Error("illegal id value: " + (r < 0 ? "-" : "") + e);
  32197. n = parseInt(e.substring(1), 8)
  32198. }
  32199. if (n = r * n | 0,
  32200. !i && n < 0)
  32201. throw Error("illegal id value: " + (r < 0 ? "-" : "") + e);
  32202. return n
  32203. }
  32204. function n(e) {
  32205. var i = 1;
  32206. if ("-" == e.charAt(0) && (i = -1,
  32207. e = e.substring(1)),
  32208. t.NUMBER_DEC.test(e))
  32209. return i * parseInt(e, 10);
  32210. if (t.NUMBER_HEX.test(e))
  32211. return i * parseInt(e.substring(2), 16);
  32212. if (t.NUMBER_OCT.test(e))
  32213. return i * parseInt(e.substring(1), 8);
  32214. if ("inf" === e)
  32215. return i * (1 / 0);
  32216. if ("nan" === e)
  32217. return NaN;
  32218. if (t.NUMBER_FLT.test(e))
  32219. return i * parseFloat(e);
  32220. throw Error("illegal number value: " + (i < 0 ? "-" : "") + e)
  32221. }
  32222. function r(e, t, i) {
  32223. "undefined" == typeof e[t] ? e[t] = i : (Array.isArray(e[t]) || (e[t] = [e[t]]),
  32224. e[t].push(i))
  32225. }
  32226. var o = {}
  32227. , a = function(e) {
  32228. this.source = e + "",
  32229. this.index = 0,
  32230. this.line = 1,
  32231. this.stack = [],
  32232. this._stringOpen = null
  32233. }
  32234. , s = a.prototype;
  32235. s._readString = function() {
  32236. var e = '"' === this._stringOpen ? t.STRING_DQ : t.STRING_SQ;
  32237. e.lastIndex = this.index - 1;
  32238. var i = e.exec(this.source);
  32239. if (!i)
  32240. throw Error("unterminated string");
  32241. return this.index = e.lastIndex,
  32242. this.stack.push(this._stringOpen),
  32243. this._stringOpen = null,
  32244. i[1]
  32245. }
  32246. ,
  32247. s.next = function() {
  32248. if (this.stack.length > 0)
  32249. return this.stack.shift();
  32250. if (this.index >= this.source.length)
  32251. return null;
  32252. if (null !== this._stringOpen)
  32253. return this._readString();
  32254. var e, i, n;
  32255. do {
  32256. for (e = !1; t.WHITESPACE.test(n = this.source.charAt(this.index)); )
  32257. if ("\n" === n && ++this.line,
  32258. ++this.index === this.source.length)
  32259. return null;
  32260. if ("/" === this.source.charAt(this.index))
  32261. if (++this.index,
  32262. "/" === this.source.charAt(this.index)) {
  32263. for (; "\n" !== this.source.charAt(++this.index); )
  32264. if (this.index == this.source.length)
  32265. return null;
  32266. ++this.index,
  32267. ++this.line,
  32268. e = !0
  32269. } else {
  32270. if ("*" !== (n = this.source.charAt(this.index)))
  32271. return "/";
  32272. do {
  32273. if ("\n" === n && ++this.line,
  32274. ++this.index === this.source.length)
  32275. return null;
  32276. i = n,
  32277. n = this.source.charAt(this.index)
  32278. } while ("*" !== i || "/" !== n);++this.index,
  32279. e = !0
  32280. }
  32281. } while (e);if (this.index === this.source.length)
  32282. return null;
  32283. var r = this.index;
  32284. t.DELIM.lastIndex = 0;
  32285. var o = t.DELIM.test(this.source.charAt(r++));
  32286. if (!o)
  32287. for (; r < this.source.length && !t.DELIM.test(this.source.charAt(r)); )
  32288. ++r;
  32289. var a = this.source.substring(this.index, this.index = r);
  32290. return '"' !== a && "'" !== a || (this._stringOpen = a),
  32291. a
  32292. }
  32293. ,
  32294. s.peek = function() {
  32295. if (0 === this.stack.length) {
  32296. var e = this.next();
  32297. if (null === e)
  32298. return null;
  32299. this.stack.push(e)
  32300. }
  32301. return this.stack[0]
  32302. }
  32303. ,
  32304. s.skip = function(e) {
  32305. var t = this.next();
  32306. if (t !== e)
  32307. throw Error("illegal '" + t + "', '" + e + "' expected")
  32308. }
  32309. ,
  32310. s.omit = function(e) {
  32311. return this.peek() === e && (this.next(),
  32312. !0)
  32313. }
  32314. ,
  32315. s.toString = function() {
  32316. return "Tokenizer (" + this.index + "/" + this.source.length + " at line " + this.line + ")"
  32317. }
  32318. ,
  32319. o.Tokenizer = a;
  32320. var l = function(e) {
  32321. this.tn = new a(e),
  32322. this.proto3 = !1
  32323. }
  32324. , c = l.prototype;
  32325. return c.parse = function() {
  32326. var e, i, n = {
  32327. name: "[ROOT]",
  32328. package: null,
  32329. messages: [],
  32330. enums: [],
  32331. imports: [],
  32332. options: {},
  32333. services: []
  32334. }, r = !0;
  32335. try {
  32336. for (; e = this.tn.next(); )
  32337. switch (e) {
  32338. case "package":
  32339. if (!r || null !== n.package)
  32340. throw Error("unexpected 'package'");
  32341. if (e = this.tn.next(),
  32342. !t.TYPEREF.test(e))
  32343. throw Error("illegal package name: " + e);
  32344. this.tn.skip(";"),
  32345. n.package = e;
  32346. break;
  32347. case "import":
  32348. if (!r)
  32349. throw Error("unexpected 'import'");
  32350. e = this.tn.peek(),
  32351. ("public" === e || (i = "weak" === e)) && this.tn.next(),
  32352. e = this._readString(),
  32353. this.tn.skip(";"),
  32354. i || n.imports.push(e);
  32355. break;
  32356. case "syntax":
  32357. if (!r)
  32358. throw Error("unexpected 'syntax'");
  32359. this.tn.skip("="),
  32360. "proto3" === (n.syntax = this._readString()) && (this.proto3 = !0),
  32361. this.tn.skip(";");
  32362. break;
  32363. case "message":
  32364. this._parseMessage(n, null),
  32365. r = !1;
  32366. break;
  32367. case "enum":
  32368. this._parseEnum(n),
  32369. r = !1;
  32370. break;
  32371. case "option":
  32372. this._parseOption(n);
  32373. break;
  32374. case "service":
  32375. this._parseService(n);
  32376. break;
  32377. case "extend":
  32378. this._parseExtend(n);
  32379. break;
  32380. default:
  32381. throw Error("unexpected '" + e + "'")
  32382. }
  32383. } catch (e) {
  32384. throw e.message = "Parse error at line " + this.tn.line + ": " + e.message,
  32385. e
  32386. }
  32387. return delete n.name,
  32388. n
  32389. }
  32390. ,
  32391. l.parse = function(e) {
  32392. return new l(e).parse()
  32393. }
  32394. ,
  32395. c._readString = function() {
  32396. var e, t, i = "";
  32397. do {
  32398. if (t = this.tn.next(),
  32399. "'" !== t && '"' !== t)
  32400. throw Error("illegal string delimiter: " + t);
  32401. i += this.tn.next(),
  32402. this.tn.skip(t),
  32403. e = this.tn.peek()
  32404. } while ('"' === e || '"' === e);return i
  32405. }
  32406. ,
  32407. c._readValue = function(e) {
  32408. var i = this.tn.peek();
  32409. if ('"' === i || "'" === i)
  32410. return this._readString();
  32411. if (this.tn.next(),
  32412. t.NUMBER.test(i))
  32413. return n(i);
  32414. if (t.BOOL.test(i))
  32415. return "true" === i.toLowerCase();
  32416. if (e && t.TYPEREF.test(i))
  32417. return i;
  32418. throw Error("illegal value: " + i)
  32419. }
  32420. ,
  32421. c._parseOption = function(e, i) {
  32422. var n = this.tn.next()
  32423. , r = !1;
  32424. if ("(" === n && (r = !0,
  32425. n = this.tn.next()),
  32426. !t.TYPEREF.test(n))
  32427. throw Error("illegal option name: " + n);
  32428. var o = n;
  32429. r && (this.tn.skip(")"),
  32430. o = "(" + o + ")",
  32431. n = this.tn.peek(),
  32432. t.FQTYPEREF.test(n) && (o += n,
  32433. this.tn.next())),
  32434. this.tn.skip("="),
  32435. this._parseOptionValue(e, o),
  32436. i || this.tn.skip(";")
  32437. }
  32438. ,
  32439. c._parseOptionValue = function(e, i) {
  32440. var n = this.tn.peek();
  32441. if ("{" !== n)
  32442. r(e.options, i, this._readValue(!0));
  32443. else
  32444. for (this.tn.skip("{"); "}" !== (n = this.tn.next()); ) {
  32445. if (!t.NAME.test(n))
  32446. throw Error("illegal option name: " + i + "." + n);
  32447. this.tn.omit(":") ? r(e.options, i + "." + n, this._readValue(!0)) : this._parseOptionValue(e, i + "." + n)
  32448. }
  32449. }
  32450. ,
  32451. c._parseService = function(e) {
  32452. var i = this.tn.next();
  32453. if (!t.NAME.test(i))
  32454. throw Error("illegal service name at line " + this.tn.line + ": " + i);
  32455. var n = i
  32456. , r = {
  32457. name: n,
  32458. rpc: {},
  32459. options: {}
  32460. };
  32461. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  32462. if ("option" === i)
  32463. this._parseOption(r);
  32464. else {
  32465. if ("rpc" !== i)
  32466. throw Error("illegal service token: " + i);
  32467. this._parseServiceRPC(r)
  32468. }
  32469. this.tn.omit(";"),
  32470. e.services.push(r)
  32471. }
  32472. ,
  32473. c._parseServiceRPC = function(e) {
  32474. var i = "rpc"
  32475. , n = this.tn.next();
  32476. if (!t.NAME.test(n))
  32477. throw Error("illegal rpc service method name: " + n);
  32478. var r = n
  32479. , o = {
  32480. request: null,
  32481. response: null,
  32482. request_stream: !1,
  32483. response_stream: !1,
  32484. options: {}
  32485. };
  32486. if (this.tn.skip("("),
  32487. n = this.tn.next(),
  32488. "stream" === n.toLowerCase() && (o.request_stream = !0,
  32489. n = this.tn.next()),
  32490. !t.TYPEREF.test(n))
  32491. throw Error("illegal rpc service request type: " + n);
  32492. if (o.request = n,
  32493. this.tn.skip(")"),
  32494. n = this.tn.next(),
  32495. "returns" !== n.toLowerCase())
  32496. throw Error("illegal rpc service request type delimiter: " + n);
  32497. if (this.tn.skip("("),
  32498. n = this.tn.next(),
  32499. "stream" === n.toLowerCase() && (o.response_stream = !0,
  32500. n = this.tn.next()),
  32501. o.response = n,
  32502. this.tn.skip(")"),
  32503. n = this.tn.peek(),
  32504. "{" === n) {
  32505. for (this.tn.next(); "}" !== (n = this.tn.next()); ) {
  32506. if ("option" !== n)
  32507. throw Error("illegal rpc service token: " + n);
  32508. this._parseOption(o)
  32509. }
  32510. this.tn.omit(";")
  32511. } else
  32512. this.tn.skip(";");
  32513. "undefined" == typeof e[i] && (e[i] = {}),
  32514. e[i][r] = o
  32515. }
  32516. ,
  32517. c._parseMessage = function(e, n) {
  32518. var r = !!n
  32519. , o = this.tn.next()
  32520. , a = {
  32521. name: "",
  32522. fields: [],
  32523. enums: [],
  32524. messages: [],
  32525. options: {},
  32526. services: [],
  32527. oneofs: {}
  32528. };
  32529. if (!t.NAME.test(o))
  32530. throw Error("illegal " + (r ? "group" : "message") + " name: " + o);
  32531. for (a.name = o,
  32532. r && (this.tn.skip("="),
  32533. n.id = i(this.tn.next()),
  32534. a.isGroup = !0),
  32535. o = this.tn.peek(),
  32536. "[" === o && n && this._parseFieldOptions(n),
  32537. this.tn.skip("{"); "}" !== (o = this.tn.next()); )
  32538. if (t.RULE.test(o))
  32539. this._parseMessageField(a, o);
  32540. else if ("oneof" === o)
  32541. this._parseMessageOneOf(a);
  32542. else if ("enum" === o)
  32543. this._parseEnum(a);
  32544. else if ("message" === o)
  32545. this._parseMessage(a);
  32546. else if ("option" === o)
  32547. this._parseOption(a);
  32548. else if ("service" === o)
  32549. this._parseService(a);
  32550. else if ("extensions" === o)
  32551. a.extensions = this._parseExtensionRanges();
  32552. else if ("reserved" === o)
  32553. this._parseIgnored();
  32554. else if ("extend" === o)
  32555. this._parseExtend(a);
  32556. else {
  32557. if (!t.TYPEREF.test(o))
  32558. throw Error("illegal message token: " + o);
  32559. if (!this.proto3)
  32560. throw Error("illegal field rule: " + o);
  32561. this._parseMessageField(a, "optional", o)
  32562. }
  32563. return this.tn.omit(";"),
  32564. e.messages.push(a),
  32565. a
  32566. }
  32567. ,
  32568. c._parseIgnored = function() {
  32569. for (; ";" !== this.tn.peek(); )
  32570. this.tn.next();
  32571. this.tn.skip(";")
  32572. }
  32573. ,
  32574. c._parseMessageField = function(e, n, r) {
  32575. if (!t.RULE.test(n))
  32576. throw Error("illegal message field rule: " + n);
  32577. var o, a = {
  32578. rule: n,
  32579. type: "",
  32580. name: "",
  32581. options: {},
  32582. id: 0
  32583. };
  32584. if ("map" === n) {
  32585. if (r)
  32586. throw Error("illegal type: " + r);
  32587. if (this.tn.skip("<"),
  32588. o = this.tn.next(),
  32589. !t.TYPE.test(o) && !t.TYPEREF.test(o))
  32590. throw Error("illegal message field type: " + o);
  32591. if (a.keytype = o,
  32592. this.tn.skip(","),
  32593. o = this.tn.next(),
  32594. !t.TYPE.test(o) && !t.TYPEREF.test(o))
  32595. throw Error("illegal message field: " + o);
  32596. if (a.type = o,
  32597. this.tn.skip(">"),
  32598. o = this.tn.next(),
  32599. !t.NAME.test(o))
  32600. throw Error("illegal message field name: " + o);
  32601. a.name = o,
  32602. this.tn.skip("="),
  32603. a.id = i(this.tn.next()),
  32604. o = this.tn.peek(),
  32605. "[" === o && this._parseFieldOptions(a),
  32606. this.tn.skip(";")
  32607. } else if (r = "undefined" != typeof r ? r : this.tn.next(),
  32608. "group" === r) {
  32609. var s = this._parseMessage(e, a);
  32610. if (!/^[A-Z]/.test(s.name))
  32611. throw Error("illegal group name: " + s.name);
  32612. a.type = s.name,
  32613. a.name = s.name.toLowerCase(),
  32614. this.tn.omit(";")
  32615. } else {
  32616. if (!t.TYPE.test(r) && !t.TYPEREF.test(r))
  32617. throw Error("illegal message field type: " + r);
  32618. if (a.type = r,
  32619. o = this.tn.next(),
  32620. !t.NAME.test(o))
  32621. throw Error("illegal message field name: " + o);
  32622. a.name = o,
  32623. this.tn.skip("="),
  32624. a.id = i(this.tn.next()),
  32625. o = this.tn.peek(),
  32626. "[" === o && this._parseFieldOptions(a),
  32627. this.tn.skip(";")
  32628. }
  32629. return e.fields.push(a),
  32630. a
  32631. }
  32632. ,
  32633. c._parseMessageOneOf = function(e) {
  32634. var i = this.tn.next();
  32635. if (!t.NAME.test(i))
  32636. throw Error("illegal oneof name: " + i);
  32637. var n, r = i, o = [];
  32638. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  32639. n = this._parseMessageField(e, "optional", i),
  32640. n.oneof = r,
  32641. o.push(n.id);
  32642. this.tn.omit(";"),
  32643. e.oneofs[r] = o
  32644. }
  32645. ,
  32646. c._parseFieldOptions = function(e) {
  32647. this.tn.skip("[");
  32648. for (var t, i = !0; "]" !== (t = this.tn.peek()); )
  32649. i || this.tn.skip(","),
  32650. this._parseOption(e, !0),
  32651. i = !1;
  32652. this.tn.next()
  32653. }
  32654. ,
  32655. c._parseEnum = function(e) {
  32656. var n = {
  32657. name: "",
  32658. values: [],
  32659. options: {}
  32660. }
  32661. , r = this.tn.next();
  32662. if (!t.NAME.test(r))
  32663. throw Error("illegal name: " + r);
  32664. for (n.name = r,
  32665. this.tn.skip("{"); "}" !== (r = this.tn.next()); )
  32666. if ("option" === r)
  32667. this._parseOption(n);
  32668. else {
  32669. if (!t.NAME.test(r))
  32670. throw Error("illegal name: " + r);
  32671. this.tn.skip("=");
  32672. var o = {
  32673. name: r,
  32674. id: i(this.tn.next(), !0)
  32675. };
  32676. r = this.tn.peek(),
  32677. "[" === r && this._parseFieldOptions({
  32678. options: {}
  32679. }),
  32680. this.tn.skip(";"),
  32681. n.values.push(o)
  32682. }
  32683. this.tn.omit(";"),
  32684. e.enums.push(n)
  32685. }
  32686. ,
  32687. c._parseExtensionRanges = function() {
  32688. var t, i, r, o = [];
  32689. do {
  32690. for (i = []; ; ) {
  32691. switch (t = this.tn.next()) {
  32692. case "min":
  32693. r = e.ID_MIN;
  32694. break;
  32695. case "max":
  32696. r = e.ID_MAX;
  32697. break;
  32698. default:
  32699. r = n(t)
  32700. }
  32701. if (i.push(r),
  32702. 2 === i.length)
  32703. break;
  32704. if ("to" !== this.tn.peek()) {
  32705. i.push(r);
  32706. break
  32707. }
  32708. this.tn.next()
  32709. }
  32710. o.push(i)
  32711. } while (this.tn.omit(","));return this.tn.skip(";"),
  32712. o
  32713. }
  32714. ,
  32715. c._parseExtend = function(e) {
  32716. var i = this.tn.next();
  32717. if (!t.TYPEREF.test(i))
  32718. throw Error("illegal extend reference: " + i);
  32719. var n = {
  32720. ref: i,
  32721. fields: []
  32722. };
  32723. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  32724. if (t.RULE.test(i))
  32725. this._parseMessageField(n, i);
  32726. else {
  32727. if (!t.TYPEREF.test(i))
  32728. throw Error("illegal extend token: " + i);
  32729. if (!this.proto3)
  32730. throw Error("illegal field rule: " + i);
  32731. this._parseMessageField(n, "optional", i)
  32732. }
  32733. return this.tn.omit(";"),
  32734. e.messages.push(n),
  32735. n
  32736. }
  32737. ,
  32738. c.toString = function() {
  32739. return "Parser at line " + this.tn.line
  32740. }
  32741. ,
  32742. o.Parser = l,
  32743. o
  32744. }(r, r.Lang),
  32745. r.Reflect = function(e) {
  32746. function i(i) {
  32747. if ("string" == typeof i && (i = e.TYPES[i]),
  32748. "undefined" == typeof i.defaultValue)
  32749. throw Error("default value for type " + i.name + " is not supported");
  32750. return i == e.TYPES.bytes ? new t(0) : i.defaultValue
  32751. }
  32752. function n(t, i) {
  32753. if (t && "number" == typeof t.low && "number" == typeof t.high && "boolean" == typeof t.unsigned && t.low === t.low && t.high === t.high)
  32754. return new e.Long(t.low,t.high,"undefined" == typeof i ? t.unsigned : i);
  32755. if ("string" == typeof t)
  32756. return e.Long.fromString(t, i || !1, 10);
  32757. if ("number" == typeof t)
  32758. return e.Long.fromNumber(t, i || !1);
  32759. throw Error("not convertible to Long")
  32760. }
  32761. function r(t, i) {
  32762. var n = i.readVarint32()
  32763. , o = 7 & n
  32764. , a = n >>> 3;
  32765. switch (o) {
  32766. case e.WIRE_TYPES.VARINT:
  32767. do
  32768. n = i.readUint8();
  32769. while (128 === (128 & n));break;
  32770. case e.WIRE_TYPES.BITS64:
  32771. i.offset += 8;
  32772. break;
  32773. case e.WIRE_TYPES.LDELIM:
  32774. n = i.readVarint32(),
  32775. i.offset += n;
  32776. break;
  32777. case e.WIRE_TYPES.STARTGROUP:
  32778. r(a, i);
  32779. break;
  32780. case e.WIRE_TYPES.ENDGROUP:
  32781. if (a === t)
  32782. return !1;
  32783. throw Error("Illegal GROUPEND after unknown group: " + a + " (" + t + " expected)");
  32784. case e.WIRE_TYPES.BITS32:
  32785. i.offset += 4;
  32786. break;
  32787. default:
  32788. throw Error("Illegal wire type in unknown group " + t + ": " + o)
  32789. }
  32790. return !0
  32791. }
  32792. var o = {}
  32793. , a = function(e, t, i) {
  32794. this.builder = e,
  32795. this.parent = t,
  32796. this.name = i,
  32797. this.className
  32798. }
  32799. , s = a.prototype;
  32800. s.fqn = function() {
  32801. for (var e = this.name, t = this; ; ) {
  32802. if (t = t.parent,
  32803. null == t)
  32804. break;
  32805. e = t.name + "." + e
  32806. }
  32807. return e
  32808. }
  32809. ,
  32810. s.toString = function(e) {
  32811. return (e ? this.className + " " : "") + this.fqn()
  32812. }
  32813. ,
  32814. s.build = function() {
  32815. throw Error(this.toString(!0) + " cannot be built directly")
  32816. }
  32817. ,
  32818. o.T = a;
  32819. var l = function(e, t, i, n, r) {
  32820. a.call(this, e, t, i),
  32821. this.className = "Namespace",
  32822. this.children = [],
  32823. this.options = n || {},
  32824. this.syntax = r || "proto2"
  32825. }
  32826. , c = l.prototype = Object.create(a.prototype);
  32827. c.getChildren = function(e) {
  32828. if (e = e || null,
  32829. null == e)
  32830. return this.children.slice();
  32831. for (var t = [], i = 0, n = this.children.length; i < n; ++i)
  32832. this.children[i]instanceof e && t.push(this.children[i]);
  32833. return t
  32834. }
  32835. ,
  32836. c.addChild = function(e) {
  32837. var t;
  32838. if (t = this.getChild(e.name))
  32839. if (t instanceof d.Field && t.name !== t.originalName && null === this.getChild(t.originalName))
  32840. t.name = t.originalName;
  32841. else {
  32842. if (!(e instanceof d.Field && e.name !== e.originalName && null === this.getChild(e.originalName)))
  32843. throw Error("Duplicate name in namespace " + this.toString(!0) + ": " + e.name);
  32844. e.name = e.originalName
  32845. }
  32846. this.children.push(e)
  32847. }
  32848. ,
  32849. c.getChild = function(e) {
  32850. for (var t = "number" == typeof e ? "id" : "name", i = 0, n = this.children.length; i < n; ++i)
  32851. if (this.children[i][t] === e)
  32852. return this.children[i];
  32853. return null
  32854. }
  32855. ,
  32856. c.resolve = function(e, t) {
  32857. var i = "string" == typeof e ? e.split(".") : e
  32858. , n = this
  32859. , r = 0;
  32860. if ("" === i[r]) {
  32861. for (; null !== n.parent; )
  32862. n = n.parent;
  32863. r++
  32864. }
  32865. var a;
  32866. do {
  32867. do {
  32868. if (!(n instanceof o.Namespace)) {
  32869. n = null;
  32870. break
  32871. }
  32872. if (a = n.getChild(i[r]),
  32873. !a || !(a instanceof o.T) || t && !(a instanceof o.Namespace)) {
  32874. n = null;
  32875. break
  32876. }
  32877. n = a,
  32878. r++
  32879. } while (r < i.length);if (null != n)
  32880. break;
  32881. if (null !== this.parent)
  32882. return this.parent.resolve(e, t)
  32883. } while (null != n);return n
  32884. }
  32885. ,
  32886. c.qn = function(e) {
  32887. var t = []
  32888. , i = e;
  32889. do
  32890. t.unshift(i.name),
  32891. i = i.parent;
  32892. while (null !== i);for (var n = 1; n <= t.length; n++) {
  32893. var r = t.slice(t.length - n);
  32894. if (e === this.resolve(r, e instanceof o.Namespace))
  32895. return r.join(".")
  32896. }
  32897. return e.fqn()
  32898. }
  32899. ,
  32900. c.build = function() {
  32901. for (var e, t = {}, i = this.children, n = 0, r = i.length; n < r; ++n)
  32902. e = i[n],
  32903. e instanceof l && (t[e.name] = e.build());
  32904. return Object.defineProperty && Object.defineProperty(t, "$options", {
  32905. value: this.buildOpt()
  32906. }),
  32907. t
  32908. }
  32909. ,
  32910. c.buildOpt = function() {
  32911. for (var e = {}, t = Object.keys(this.options), i = 0, n = t.length; i < n; ++i) {
  32912. var r = t[i]
  32913. , o = this.options[t[i]];
  32914. e[r] = o
  32915. }
  32916. return e
  32917. }
  32918. ,
  32919. c.getOption = function(e) {
  32920. return "undefined" == typeof e ? this.options : "undefined" != typeof this.options[e] ? this.options[e] : null
  32921. }
  32922. ,
  32923. o.Namespace = l;
  32924. var h = function(t, i, n, r) {
  32925. if (this.type = t,
  32926. this.resolvedType = i,
  32927. this.isMapKey = n,
  32928. this.syntax = r,
  32929. n && e.MAP_KEY_TYPES.indexOf(t) < 0)
  32930. throw Error("Invalid map key type: " + t.name)
  32931. }
  32932. , u = h.prototype;
  32933. h.defaultFieldValue = i,
  32934. u.verifyValue = function(i) {
  32935. function r(e, t) {
  32936. throw Error("Illegal value for " + o.toString(!0) + " of type " + o.type.name + ": " + e + " (" + t + ")")
  32937. }
  32938. var o = this;
  32939. switch (this.type) {
  32940. case e.TYPES.int32:
  32941. case e.TYPES.sint32:
  32942. case e.TYPES.sfixed32:
  32943. return ("number" != typeof i || i === i && i % 1 !== 0) && r(typeof i, "not an integer"),
  32944. i > 4294967295 ? 0 | i : i;
  32945. case e.TYPES.uint32:
  32946. case e.TYPES.fixed32:
  32947. return ("number" != typeof i || i === i && i % 1 !== 0) && r(typeof i, "not an integer"),
  32948. i < 0 ? i >>> 0 : i;
  32949. case e.TYPES.int64:
  32950. case e.TYPES.sint64:
  32951. case e.TYPES.sfixed64:
  32952. if (e.Long)
  32953. try {
  32954. return n(i, !1)
  32955. } catch (e) {
  32956. r(typeof i, e.message)
  32957. }
  32958. else
  32959. r(typeof i, "requires Long.js");
  32960. case e.TYPES.uint64:
  32961. case e.TYPES.fixed64:
  32962. if (e.Long)
  32963. try {
  32964. return n(i, !0)
  32965. } catch (e) {
  32966. r(typeof i, e.message)
  32967. }
  32968. else
  32969. r(typeof i, "requires Long.js");
  32970. case e.TYPES.bool:
  32971. return "boolean" != typeof i && r(typeof i, "not a boolean"),
  32972. i;
  32973. case e.TYPES.float:
  32974. case e.TYPES.double:
  32975. return "number" != typeof i && r(typeof i, "not a number"),
  32976. i;
  32977. case e.TYPES.string:
  32978. return "string" == typeof i || i && i instanceof String || r(typeof i, "not a string"),
  32979. "" + i;
  32980. case e.TYPES.bytes:
  32981. return t.isByteBuffer(i) ? i : t.wrap(i, "base64");
  32982. case e.TYPES.enum:
  32983. var a = this.resolvedType.getChildren(e.Reflect.Enum.Value);
  32984. for (l = 0; l < a.length; l++) {
  32985. if (a[l].name == i)
  32986. return a[l].id;
  32987. if (a[l].id == i)
  32988. return a[l].id
  32989. }
  32990. if ("proto3" === this.syntax)
  32991. return ("number" != typeof i || i === i && i % 1 !== 0) && r(typeof i, "not an integer"),
  32992. (i > 4294967295 || i < 0) && r(typeof i, "not in range for uint32"),
  32993. i;
  32994. r(i, "not a valid enum value");
  32995. case e.TYPES.group:
  32996. case e.TYPES.message:
  32997. if (i && "object" == typeof i || r(typeof i, "object expected"),
  32998. i instanceof this.resolvedType.clazz)
  32999. return i;
  33000. if (i instanceof e.Builder.Message) {
  33001. var s = {};
  33002. for (var l in i)
  33003. i.hasOwnProperty(l) && (s[l] = i[l]);
  33004. i = s
  33005. }
  33006. return new this.resolvedType.clazz(i)
  33007. }
  33008. throw Error("[INTERNAL] Illegal value for " + this.toString(!0) + ": " + i + " (undefined type " + this.type + ")")
  33009. }
  33010. ,
  33011. u.calculateLength = function(i, n) {
  33012. if (null === n)
  33013. return 0;
  33014. var r;
  33015. switch (this.type) {
  33016. case e.TYPES.int32:
  33017. return n < 0 ? t.calculateVarint64(n) : t.calculateVarint32(n);
  33018. case e.TYPES.uint32:
  33019. return t.calculateVarint32(n);
  33020. case e.TYPES.sint32:
  33021. return t.calculateVarint32(t.zigZagEncode32(n));
  33022. case e.TYPES.fixed32:
  33023. case e.TYPES.sfixed32:
  33024. case e.TYPES.float:
  33025. return 4;
  33026. case e.TYPES.int64:
  33027. case e.TYPES.uint64:
  33028. return t.calculateVarint64(n);
  33029. case e.TYPES.sint64:
  33030. return t.calculateVarint64(t.zigZagEncode64(n));
  33031. case e.TYPES.fixed64:
  33032. case e.TYPES.sfixed64:
  33033. return 8;
  33034. case e.TYPES.bool:
  33035. return 1;
  33036. case e.TYPES.enum:
  33037. return t.calculateVarint32(n);
  33038. case e.TYPES.double:
  33039. return 8;
  33040. case e.TYPES.string:
  33041. return r = t.calculateUTF8Bytes(n),
  33042. t.calculateVarint32(r) + r;
  33043. case e.TYPES.bytes:
  33044. if (n.remaining() < 0)
  33045. throw Error("Illegal value for " + this.toString(!0) + ": " + n.remaining() + " bytes remaining");
  33046. return t.calculateVarint32(n.remaining()) + n.remaining();
  33047. case e.TYPES.message:
  33048. return r = this.resolvedType.calculate(n),
  33049. t.calculateVarint32(r) + r;
  33050. case e.TYPES.group:
  33051. return r = this.resolvedType.calculate(n),
  33052. r + t.calculateVarint32(i << 3 | e.WIRE_TYPES.ENDGROUP)
  33053. }
  33054. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + n + " (unknown type)")
  33055. }
  33056. ,
  33057. u.encodeValue = function(i, n, r) {
  33058. if (null === n)
  33059. return r;
  33060. switch (this.type) {
  33061. case e.TYPES.int32:
  33062. n < 0 ? r.writeVarint64(n) : r.writeVarint32(n);
  33063. break;
  33064. case e.TYPES.uint32:
  33065. r.writeVarint32(n);
  33066. break;
  33067. case e.TYPES.sint32:
  33068. r.writeVarint32ZigZag(n);
  33069. break;
  33070. case e.TYPES.fixed32:
  33071. r.writeUint32(n);
  33072. break;
  33073. case e.TYPES.sfixed32:
  33074. r.writeInt32(n);
  33075. break;
  33076. case e.TYPES.int64:
  33077. case e.TYPES.uint64:
  33078. r.writeVarint64(n);
  33079. break;
  33080. case e.TYPES.sint64:
  33081. r.writeVarint64ZigZag(n);
  33082. break;
  33083. case e.TYPES.fixed64:
  33084. r.writeUint64(n);
  33085. break;
  33086. case e.TYPES.sfixed64:
  33087. r.writeInt64(n);
  33088. break;
  33089. case e.TYPES.bool:
  33090. "string" == typeof n ? r.writeVarint32("false" === n.toLowerCase() ? 0 : !!n) : r.writeVarint32(n ? 1 : 0);
  33091. break;
  33092. case e.TYPES.enum:
  33093. r.writeVarint32(n);
  33094. break;
  33095. case e.TYPES.float:
  33096. r.writeFloat32(n);
  33097. break;
  33098. case e.TYPES.double:
  33099. r.writeFloat64(n);
  33100. break;
  33101. case e.TYPES.string:
  33102. r.writeVString(n);
  33103. break;
  33104. case e.TYPES.bytes:
  33105. if (n.remaining() < 0)
  33106. throw Error("Illegal value for " + this.toString(!0) + ": " + n.remaining() + " bytes remaining");
  33107. var o = n.offset;
  33108. r.writeVarint32(n.remaining()),
  33109. r.append(n),
  33110. n.offset = o;
  33111. break;
  33112. case e.TYPES.message:
  33113. var a = (new t).LE();
  33114. this.resolvedType.encode(n, a),
  33115. r.writeVarint32(a.offset),
  33116. r.append(a.flip());
  33117. break;
  33118. case e.TYPES.group:
  33119. this.resolvedType.encode(n, r),
  33120. r.writeVarint32(i << 3 | e.WIRE_TYPES.ENDGROUP);
  33121. break;
  33122. default:
  33123. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + n + " (unknown type)")
  33124. }
  33125. return r
  33126. }
  33127. ,
  33128. u.decode = function(t, i, n) {
  33129. if (i != this.type.wireType)
  33130. throw Error("Unexpected wire type for element");
  33131. var r, o;
  33132. switch (this.type) {
  33133. case e.TYPES.int32:
  33134. return 0 | t.readVarint32();
  33135. case e.TYPES.uint32:
  33136. return t.readVarint32() >>> 0;
  33137. case e.TYPES.sint32:
  33138. return 0 | t.readVarint32ZigZag();
  33139. case e.TYPES.fixed32:
  33140. return t.readUint32() >>> 0;
  33141. case e.TYPES.sfixed32:
  33142. return 0 | t.readInt32();
  33143. case e.TYPES.int64:
  33144. return t.readVarint64();
  33145. case e.TYPES.uint64:
  33146. return t.readVarint64().toUnsigned();
  33147. case e.TYPES.sint64:
  33148. return t.readVarint64ZigZag();
  33149. case e.TYPES.fixed64:
  33150. return t.readUint64();
  33151. case e.TYPES.sfixed64:
  33152. return t.readInt64();
  33153. case e.TYPES.bool:
  33154. return !!t.readVarint32();
  33155. case e.TYPES.enum:
  33156. return t.readVarint32();
  33157. case e.TYPES.float:
  33158. return t.readFloat();
  33159. case e.TYPES.double:
  33160. return t.readDouble();
  33161. case e.TYPES.string:
  33162. return t.readVString();
  33163. case e.TYPES.bytes:
  33164. if (o = t.readVarint32(),
  33165. t.remaining() < o)
  33166. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + o + " required but got only " + t.remaining());
  33167. return r = t.clone(),
  33168. r.limit = r.offset + o,
  33169. t.offset += o,
  33170. r;
  33171. case e.TYPES.message:
  33172. return o = t.readVarint32(),
  33173. this.resolvedType.decode(t, o);
  33174. case e.TYPES.group:
  33175. return this.resolvedType.decode(t, -1, n)
  33176. }
  33177. throw Error("[INTERNAL] Illegal decode type")
  33178. }
  33179. ,
  33180. u.valueFromString = function(i) {
  33181. if (!this.isMapKey)
  33182. throw Error("valueFromString() called on non-map-key element");
  33183. switch (this.type) {
  33184. case e.TYPES.int32:
  33185. case e.TYPES.sint32:
  33186. case e.TYPES.sfixed32:
  33187. case e.TYPES.uint32:
  33188. case e.TYPES.fixed32:
  33189. return this.verifyValue(parseInt(i));
  33190. case e.TYPES.int64:
  33191. case e.TYPES.sint64:
  33192. case e.TYPES.sfixed64:
  33193. case e.TYPES.uint64:
  33194. case e.TYPES.fixed64:
  33195. return this.verifyValue(i);
  33196. case e.TYPES.bool:
  33197. return "true" === i;
  33198. case e.TYPES.string:
  33199. return this.verifyValue(i);
  33200. case e.TYPES.bytes:
  33201. return t.fromBinary(i)
  33202. }
  33203. }
  33204. ,
  33205. u.valueToString = function(t) {
  33206. if (!this.isMapKey)
  33207. throw Error("valueToString() called on non-map-key element");
  33208. return this.type === e.TYPES.bytes ? t.toString("binary") : t.toString()
  33209. }
  33210. ,
  33211. o.Element = h;
  33212. var d = function(e, t, i, n, r, o) {
  33213. l.call(this, e, t, i, n, o),
  33214. this.className = "Message",
  33215. this.extensions = void 0,
  33216. this.clazz = null,
  33217. this.isGroup = !!r,
  33218. this._fields = null,
  33219. this._fieldsById = null,
  33220. this._fieldsByName = null
  33221. }
  33222. , p = d.prototype = Object.create(l.prototype);
  33223. p.build = function(i) {
  33224. if (this.clazz && !i)
  33225. return this.clazz;
  33226. var n = function(e, i) {
  33227. function n(i, r, o, a) {
  33228. if (null === i || "object" != typeof i) {
  33229. if (a && a instanceof e.Reflect.Enum) {
  33230. var s = e.Reflect.Enum.getName(a.object, i);
  33231. if (null !== s)
  33232. return s
  33233. }
  33234. return i
  33235. }
  33236. if (t.isByteBuffer(i))
  33237. return r ? i.toBase64() : i.toBuffer();
  33238. if (e.Long.isLong(i))
  33239. return o ? i.toString() : e.Long.fromValue(i);
  33240. var l;
  33241. if (Array.isArray(i))
  33242. return l = [],
  33243. i.forEach(function(e, t) {
  33244. l[t] = n(e, r, o, a)
  33245. }),
  33246. l;
  33247. if (l = {},
  33248. i instanceof e.Map) {
  33249. for (var c = i.entries(), h = c.next(); !h.done; h = c.next())
  33250. l[i.keyElem.valueToString(h.value[0])] = n(h.value[1], r, o, i.valueElem.resolvedType);
  33251. return l
  33252. }
  33253. var u = i.$type
  33254. , d = void 0;
  33255. for (var p in i)
  33256. i.hasOwnProperty(p) && (u && (d = u.getChild(p)) ? l[p] = n(i[p], r, o, d.resolvedType) : l[p] = n(i[p], r, o));
  33257. return l
  33258. }
  33259. var r = i.getChildren(e.Reflect.Message.Field)
  33260. , o = i.getChildren(e.Reflect.Message.OneOf)
  33261. , a = function(n, s) {
  33262. e.Builder.Message.call(this);
  33263. for (var l = 0, c = o.length; l < c; ++l)
  33264. this[o[l].name] = null;
  33265. for (l = 0,
  33266. c = r.length; l < c; ++l) {
  33267. var h = r[l];
  33268. this[h.name] = h.repeated ? [] : h.map ? new e.Map(h) : null,
  33269. !h.required && "proto3" !== i.syntax || null === h.defaultValue || (this[h.name] = h.defaultValue)
  33270. }
  33271. if (arguments.length > 0) {
  33272. var u;
  33273. if (1 !== arguments.length || null === n || "object" != typeof n || !("function" != typeof n.encode || n instanceof a) || Array.isArray(n) || n instanceof e.Map || t.isByteBuffer(n) || n instanceof ArrayBuffer || e.Long && n instanceof e.Long)
  33274. for (l = 0,
  33275. c = arguments.length; l < c; ++l)
  33276. "undefined" != typeof (u = arguments[l]) && this.$set(r[l].name, u);
  33277. else
  33278. this.$set(n)
  33279. }
  33280. }
  33281. , s = a.prototype = Object.create(e.Builder.Message.prototype);
  33282. s.add = function(t, n, r) {
  33283. var o = i._fieldsByName[t];
  33284. if (!r) {
  33285. if (!o)
  33286. throw Error(this + "#" + t + " is undefined");
  33287. if (!(o instanceof e.Reflect.Message.Field))
  33288. throw Error(this + "#" + t + " is not a field: " + o.toString(!0));
  33289. if (!o.repeated)
  33290. throw Error(this + "#" + t + " is not a repeated field");
  33291. n = o.verifyValue(n, !0)
  33292. }
  33293. return null === this[t] && (this[t] = []),
  33294. this[t].push(n),
  33295. this
  33296. }
  33297. ,
  33298. s.$add = s.add,
  33299. s.set = function(t, n, r) {
  33300. if (t && "object" == typeof t) {
  33301. r = n;
  33302. for (var o in t)
  33303. t.hasOwnProperty(o) && "undefined" != typeof (n = t[o]) && this.$set(o, n, r);
  33304. return this
  33305. }
  33306. var a = i._fieldsByName[t];
  33307. if (r)
  33308. this[t] = n;
  33309. else {
  33310. if (!a)
  33311. throw Error(this + "#" + t + " is not a field: undefined");
  33312. if (!(a instanceof e.Reflect.Message.Field))
  33313. throw Error(this + "#" + t + " is not a field: " + a.toString(!0));
  33314. this[a.name] = n = a.verifyValue(n)
  33315. }
  33316. if (a && a.oneof) {
  33317. var s = this[a.oneof.name];
  33318. null !== n ? (null !== s && s !== a.name && (this[s] = null),
  33319. this[a.oneof.name] = a.name) : s === t && (this[a.oneof.name] = null)
  33320. }
  33321. return this
  33322. }
  33323. ,
  33324. s.$set = s.set,
  33325. s.get = function(t, n) {
  33326. if (n)
  33327. return this[t];
  33328. var r = i._fieldsByName[t];
  33329. if (!(r && r instanceof e.Reflect.Message.Field))
  33330. throw Error(this + "#" + t + " is not a field: undefined");
  33331. if (!(r instanceof e.Reflect.Message.Field))
  33332. throw Error(this + "#" + t + " is not a field: " + r.toString(!0));
  33333. return this[r.name]
  33334. }
  33335. ,
  33336. s.$get = s.get;
  33337. for (var l = 0; l < r.length; l++) {
  33338. var c = r[l];
  33339. c instanceof e.Reflect.Message.ExtensionField || i.builder.options.populateAccessors && function(e) {
  33340. var t = e.originalName.replace(/(_[a-zA-Z])/g, function(e) {
  33341. return e.toUpperCase().replace("_", "")
  33342. });
  33343. t = t.substring(0, 1).toUpperCase() + t.substring(1);
  33344. var n = e.originalName.replace(/([A-Z])/g, function(e) {
  33345. return "_" + e
  33346. })
  33347. , r = function(t, i) {
  33348. return this[e.name] = i ? t : e.verifyValue(t),
  33349. this
  33350. }
  33351. , o = function() {
  33352. return this[e.name]
  33353. };
  33354. null === i.getChild("set" + t) && (s["set" + t] = r),
  33355. null === i.getChild("set_" + n) && (s["set_" + n] = r),
  33356. null === i.getChild("get" + t) && (s["get" + t] = o),
  33357. null === i.getChild("get_" + n) && (s["get_" + n] = o)
  33358. }(c)
  33359. }
  33360. s.encode = function(e, n) {
  33361. "boolean" == typeof e && (n = e,
  33362. e = void 0);
  33363. var r = !1;
  33364. e || (e = new t,
  33365. r = !0);
  33366. var o = e.littleEndian;
  33367. try {
  33368. return i.encode(this, e.LE(), n),
  33369. (r ? e.flip() : e).LE(o)
  33370. } catch (t) {
  33371. throw e.LE(o),
  33372. t
  33373. }
  33374. }
  33375. ,
  33376. a.encode = function(e, t, i) {
  33377. return new a(e).encode(t, i)
  33378. }
  33379. ,
  33380. s.calculate = function() {
  33381. return i.calculate(this)
  33382. }
  33383. ,
  33384. s.encodeDelimited = function(e, n) {
  33385. var r = !1;
  33386. e || (e = new t,
  33387. r = !0);
  33388. var o = (new t).LE();
  33389. return i.encode(this, o, n).flip(),
  33390. e.writeVarint32(o.remaining()),
  33391. e.append(o),
  33392. r ? e.flip() : e
  33393. }
  33394. ,
  33395. s.encodeAB = function() {
  33396. try {
  33397. return this.encode().toArrayBuffer()
  33398. } catch (e) {
  33399. throw e.encoded && (e.encoded = e.encoded.toArrayBuffer()),
  33400. e
  33401. }
  33402. }
  33403. ,
  33404. s.toArrayBuffer = s.encodeAB,
  33405. s.encodeNB = function() {
  33406. try {
  33407. return this.encode().toBuffer()
  33408. } catch (e) {
  33409. throw e.encoded && (e.encoded = e.encoded.toBuffer()),
  33410. e
  33411. }
  33412. }
  33413. ,
  33414. s.toBuffer = s.encodeNB,
  33415. s.encode64 = function() {
  33416. try {
  33417. return this.encode().toBase64()
  33418. } catch (e) {
  33419. throw e.encoded && (e.encoded = e.encoded.toBase64()),
  33420. e
  33421. }
  33422. }
  33423. ,
  33424. s.toBase64 = s.encode64,
  33425. s.encodeHex = function() {
  33426. try {
  33427. return this.encode().toHex()
  33428. } catch (e) {
  33429. throw e.encoded && (e.encoded = e.encoded.toHex()),
  33430. e
  33431. }
  33432. }
  33433. ,
  33434. s.toHex = s.encodeHex,
  33435. s.toRaw = function(e, t) {
  33436. return n(this, !!e, !!t, this.$type)
  33437. }
  33438. ,
  33439. s.encodeJSON = function() {
  33440. return JSON.stringify(n(this, !0, !0, this.$type))
  33441. }
  33442. ,
  33443. a.decode = function(e, n, r) {
  33444. "string" == typeof n && (r = n,
  33445. n = -1),
  33446. "string" == typeof e && (e = t.wrap(e, r ? r : "base64")),
  33447. e = t.isByteBuffer(e) ? e : t.wrap(e);
  33448. var o = e.littleEndian;
  33449. try {
  33450. var a = i.decode(e.LE());
  33451. return e.LE(o),
  33452. a
  33453. } catch (t) {
  33454. throw e.LE(o),
  33455. t
  33456. }
  33457. }
  33458. ,
  33459. a.decodeDelimited = function(e, n) {
  33460. if ("string" == typeof e && (e = t.wrap(e, n ? n : "base64")),
  33461. e = t.isByteBuffer(e) ? e : t.wrap(e),
  33462. e.remaining() < 1)
  33463. return null;
  33464. var r = e.offset
  33465. , o = e.readVarint32();
  33466. if (e.remaining() < o)
  33467. return e.offset = r,
  33468. null;
  33469. try {
  33470. var a = i.decode(e.slice(e.offset, e.offset + o).LE());
  33471. return e.offset += o,
  33472. a
  33473. } catch (t) {
  33474. throw e.offset += o,
  33475. t
  33476. }
  33477. }
  33478. ,
  33479. a.decode64 = function(e) {
  33480. return a.decode(e, "base64")
  33481. }
  33482. ,
  33483. a.decodeHex = function(e) {
  33484. return a.decode(e, "hex")
  33485. }
  33486. ,
  33487. a.decodeJSON = function(e) {
  33488. return new a(JSON.parse(e))
  33489. }
  33490. ,
  33491. s.toString = function() {
  33492. return i.toString()
  33493. }
  33494. ;
  33495. return Object.defineProperty && (Object.defineProperty(a, "$options", {
  33496. value: i.buildOpt()
  33497. }),
  33498. Object.defineProperty(s, "$options", {
  33499. value: a.$options
  33500. }),
  33501. Object.defineProperty(a, "$type", {
  33502. value: i
  33503. }),
  33504. Object.defineProperty(s, "$type", {
  33505. value: i
  33506. })),
  33507. a
  33508. }(e, this);
  33509. this._fields = [],
  33510. this._fieldsById = {},
  33511. this._fieldsByName = {};
  33512. for (var r, o = 0, a = this.children.length; o < a; o++)
  33513. if (r = this.children[o],
  33514. r instanceof A || r instanceof d || r instanceof E) {
  33515. if (n.hasOwnProperty(r.name))
  33516. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + r.toString(!0) + " cannot override static property '" + r.name + "'");
  33517. n[r.name] = r.build()
  33518. } else if (r instanceof d.Field)
  33519. r.build(),
  33520. this._fields.push(r),
  33521. this._fieldsById[r.id] = r,
  33522. this._fieldsByName[r.name] = r;
  33523. else if (!(r instanceof d.OneOf || r instanceof I))
  33524. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + this.children[o].toString(!0));
  33525. return this.clazz = n
  33526. }
  33527. ,
  33528. p.encode = function(e, t, i) {
  33529. for (var n, r, o = null, a = 0, s = this._fields.length; a < s; ++a)
  33530. n = this._fields[a],
  33531. r = e[n.name],
  33532. n.required && null === r ? null === o && (o = n) : n.encode(i ? r : n.verifyValue(r), t, e);
  33533. if (null !== o) {
  33534. var l = Error("Missing at least one required field for " + this.toString(!0) + ": " + o);
  33535. throw l.encoded = t,
  33536. l
  33537. }
  33538. return t
  33539. }
  33540. ,
  33541. p.calculate = function(e) {
  33542. for (var t, i, n = 0, r = 0, o = this._fields.length; r < o; ++r) {
  33543. if (t = this._fields[r],
  33544. i = e[t.name],
  33545. t.required && null === i)
  33546. throw Error("Missing at least one required field for " + this.toString(!0) + ": " + t);
  33547. n += t.calculate(i, e)
  33548. }
  33549. return n
  33550. }
  33551. ,
  33552. p.decode = function(t, i, n) {
  33553. i = "number" == typeof i ? i : -1;
  33554. for (var o, a, s, l, c = t.offset, h = new this.clazz; t.offset < c + i || i === -1 && t.remaining() > 0; ) {
  33555. if (o = t.readVarint32(),
  33556. a = 7 & o,
  33557. s = o >>> 3,
  33558. a === e.WIRE_TYPES.ENDGROUP) {
  33559. if (s !== n)
  33560. throw Error("Illegal group end indicator for " + this.toString(!0) + ": " + s + " (" + (n ? n + " expected" : "not a group") + ")");
  33561. break
  33562. }
  33563. if (l = this._fieldsById[s]) {
  33564. if (l.repeated && !l.options.packed)
  33565. h[l.name].push(l.decode(a, t));
  33566. else if (l.map) {
  33567. var u = l.decode(a, t);
  33568. h[l.name].set(u[0], u[1])
  33569. } else if (h[l.name] = l.decode(a, t),
  33570. l.oneof) {
  33571. var d = h[l.oneof.name];
  33572. null !== d && d !== l.name && (h[d] = null),
  33573. h[l.oneof.name] = l.name
  33574. }
  33575. } else
  33576. switch (a) {
  33577. case e.WIRE_TYPES.VARINT:
  33578. t.readVarint32();
  33579. break;
  33580. case e.WIRE_TYPES.BITS32:
  33581. t.offset += 4;
  33582. break;
  33583. case e.WIRE_TYPES.BITS64:
  33584. t.offset += 8;
  33585. break;
  33586. case e.WIRE_TYPES.LDELIM:
  33587. var p = t.readVarint32();
  33588. t.offset += p;
  33589. break;
  33590. case e.WIRE_TYPES.STARTGROUP:
  33591. for (; r(s, t); )
  33592. ;
  33593. break;
  33594. default:
  33595. throw Error("Illegal wire type for unknown field " + s + " in " + this.toString(!0) + "#decode: " + a)
  33596. }
  33597. }
  33598. for (var f = 0, g = this._fields.length; f < g; ++f)
  33599. if (l = this._fields[f],
  33600. null === h[l.name])
  33601. if ("proto3" === this.syntax)
  33602. h[l.name] = l.defaultValue;
  33603. else {
  33604. if (l.required) {
  33605. var m = Error("Missing at least one required field for " + this.toString(!0) + ": " + l.name);
  33606. throw m.decoded = h,
  33607. m
  33608. }
  33609. e.populateDefaults && null !== l.defaultValue && (h[l.name] = l.defaultValue)
  33610. }
  33611. return h
  33612. }
  33613. ,
  33614. o.Message = d;
  33615. var f = function(t, i, n, r, o, s, l, c, h, u) {
  33616. a.call(this, t, i, s),
  33617. this.className = "Message.Field",
  33618. this.required = "required" === n,
  33619. this.repeated = "repeated" === n,
  33620. this.map = "map" === n,
  33621. this.keyType = r || null,
  33622. this.type = o,
  33623. this.resolvedType = null,
  33624. this.id = l,
  33625. this.options = c || {},
  33626. this.defaultValue = null,
  33627. this.oneof = h || null,
  33628. this.syntax = u || "proto2",
  33629. this.originalName = this.name,
  33630. this.element = null,
  33631. this.keyElement = null,
  33632. !this.builder.options.convertFieldsToCamelCase || this instanceof d.ExtensionField || (this.name = e.Util.toCamelCase(this.name))
  33633. }
  33634. , g = f.prototype = Object.create(a.prototype);
  33635. g.build = function() {
  33636. this.element = new h(this.type,this.resolvedType,!1,this.syntax),
  33637. this.map && (this.keyElement = new h(this.keyType,void 0,!0,this.syntax)),
  33638. "proto3" !== this.syntax || this.repeated || this.map ? "undefined" != typeof this.options.default && (this.defaultValue = this.verifyValue(this.options.default)) : this.defaultValue = h.defaultFieldValue(this.type)
  33639. }
  33640. ,
  33641. g.verifyValue = function(t, i) {
  33642. function n(e, t) {
  33643. throw Error("Illegal value for " + r.toString(!0) + " of type " + r.type.name + ": " + e + " (" + t + ")")
  33644. }
  33645. i = i || !1;
  33646. var r = this;
  33647. if (null === t)
  33648. return this.required && n(typeof t, "required"),
  33649. "proto3" === this.syntax && this.type !== e.TYPES.message && n(typeof t, "proto3 field without field presence cannot be null"),
  33650. null;
  33651. var o;
  33652. if (this.repeated && !i) {
  33653. Array.isArray(t) || (t = [t]);
  33654. var a = [];
  33655. for (o = 0; o < t.length; o++)
  33656. a.push(this.element.verifyValue(t[o]));
  33657. return a
  33658. }
  33659. return this.map && !i ? t instanceof e.Map ? t : (t instanceof Object || n(typeof t, "expected ProtoBuf.Map or raw object for map field"),
  33660. new e.Map(this,t)) : (!this.repeated && Array.isArray(t) && n(typeof t, "no array expected"),
  33661. this.element.verifyValue(t))
  33662. }
  33663. ,
  33664. g.hasWirePresence = function(t, i) {
  33665. if ("proto3" !== this.syntax)
  33666. return null !== t;
  33667. if (this.oneof && i[this.oneof.name] === this.name)
  33668. return !0;
  33669. switch (this.type) {
  33670. case e.TYPES.int32:
  33671. case e.TYPES.sint32:
  33672. case e.TYPES.sfixed32:
  33673. case e.TYPES.uint32:
  33674. case e.TYPES.fixed32:
  33675. return 0 !== t;
  33676. case e.TYPES.int64:
  33677. case e.TYPES.sint64:
  33678. case e.TYPES.sfixed64:
  33679. case e.TYPES.uint64:
  33680. case e.TYPES.fixed64:
  33681. return 0 !== t.low || 0 !== t.high;
  33682. case e.TYPES.bool:
  33683. return t;
  33684. case e.TYPES.float:
  33685. case e.TYPES.double:
  33686. return 0 !== t;
  33687. case e.TYPES.string:
  33688. return t.length > 0;
  33689. case e.TYPES.bytes:
  33690. return t.remaining() > 0;
  33691. case e.TYPES.enum:
  33692. return 0 !== t;
  33693. case e.TYPES.message:
  33694. return null !== t;
  33695. default:
  33696. return !0
  33697. }
  33698. }
  33699. ,
  33700. g.encode = function(i, n, r) {
  33701. if (null === this.type || "object" != typeof this.type)
  33702. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  33703. if (null === i || this.repeated && 0 == i.length)
  33704. return n;
  33705. try {
  33706. if (this.repeated) {
  33707. var o;
  33708. if (this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {
  33709. n.writeVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  33710. n.ensureCapacity(n.offset += 1);
  33711. var a = n.offset;
  33712. for (o = 0; o < i.length; o++)
  33713. this.element.encodeValue(this.id, i[o], n);
  33714. var s = n.offset - a
  33715. , l = t.calculateVarint32(s);
  33716. if (l > 1) {
  33717. var c = n.slice(a, n.offset);
  33718. a += l - 1,
  33719. n.offset = a,
  33720. n.append(c)
  33721. }
  33722. n.writeVarint32(s, a - l)
  33723. } else
  33724. for (o = 0; o < i.length; o++)
  33725. n.writeVarint32(this.id << 3 | this.type.wireType),
  33726. this.element.encodeValue(this.id, i[o], n)
  33727. } else
  33728. this.map ? i.forEach(function(i, r, o) {
  33729. var a = t.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, r) + t.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, i);
  33730. n.writeVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  33731. n.writeVarint32(a),
  33732. n.writeVarint32(8 | this.keyType.wireType),
  33733. this.keyElement.encodeValue(1, r, n),
  33734. n.writeVarint32(16 | this.type.wireType),
  33735. this.element.encodeValue(2, i, n)
  33736. }, this) : this.hasWirePresence(i, r) && (n.writeVarint32(this.id << 3 | this.type.wireType),
  33737. this.element.encodeValue(this.id, i, n))
  33738. } catch (e) {
  33739. throw Error("Illegal value for " + this.toString(!0) + ": " + i + " (" + e + ")")
  33740. }
  33741. return n
  33742. }
  33743. ,
  33744. g.calculate = function(i, n) {
  33745. if (i = this.verifyValue(i),
  33746. null === this.type || "object" != typeof this.type)
  33747. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  33748. if (null === i || this.repeated && 0 == i.length)
  33749. return 0;
  33750. var r = 0;
  33751. try {
  33752. if (this.repeated) {
  33753. var o, a;
  33754. if (this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {
  33755. for (r += t.calculateVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  33756. a = 0,
  33757. o = 0; o < i.length; o++)
  33758. a += this.element.calculateLength(this.id, i[o]);
  33759. r += t.calculateVarint32(a),
  33760. r += a
  33761. } else
  33762. for (o = 0; o < i.length; o++)
  33763. r += t.calculateVarint32(this.id << 3 | this.type.wireType),
  33764. r += this.element.calculateLength(this.id, i[o])
  33765. } else
  33766. this.map ? i.forEach(function(i, n, o) {
  33767. var a = t.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, n) + t.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, i);
  33768. r += t.calculateVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  33769. r += t.calculateVarint32(a),
  33770. r += a
  33771. }, this) : this.hasWirePresence(i, n) && (r += t.calculateVarint32(this.id << 3 | this.type.wireType),
  33772. r += this.element.calculateLength(this.id, i))
  33773. } catch (e) {
  33774. throw Error("Illegal value for " + this.toString(!0) + ": " + i + " (" + e + ")")
  33775. }
  33776. return r
  33777. }
  33778. ,
  33779. g.decode = function(t, i, n) {
  33780. var r, o, a = !this.map && t == this.type.wireType || !n && this.repeated && this.options.packed && t == e.WIRE_TYPES.LDELIM || this.map && t == e.WIRE_TYPES.LDELIM;
  33781. if (!a)
  33782. throw Error("Illegal wire type for field " + this.toString(!0) + ": " + t + " (" + this.type.wireType + " expected)");
  33783. if (t == e.WIRE_TYPES.LDELIM && this.repeated && this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0 && !n) {
  33784. o = i.readVarint32(),
  33785. o = i.offset + o;
  33786. for (var s = []; i.offset < o; )
  33787. s.push(this.decode(this.type.wireType, i, !0));
  33788. return s
  33789. }
  33790. if (this.map) {
  33791. var l = h.defaultFieldValue(this.keyType);
  33792. if (r = h.defaultFieldValue(this.type),
  33793. o = i.readVarint32(),
  33794. i.remaining() < o)
  33795. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + o + " required but got only " + i.remaining());
  33796. var c = i.clone();
  33797. for (c.limit = c.offset + o,
  33798. i.offset += o; c.remaining() > 0; ) {
  33799. var u = c.readVarint32();
  33800. t = 7 & u;
  33801. var d = u >>> 3;
  33802. if (1 === d)
  33803. l = this.keyElement.decode(c, t, d);
  33804. else {
  33805. if (2 !== d)
  33806. throw Error("Unexpected tag in map field key/value submessage");
  33807. r = this.element.decode(c, t, d)
  33808. }
  33809. }
  33810. return [l, r]
  33811. }
  33812. return this.element.decode(i, t, this.id)
  33813. }
  33814. ,
  33815. o.Message.Field = f;
  33816. var m = function(e, t, i, n, r, o, a) {
  33817. f.call(this, e, t, i, null, n, r, o, a),
  33818. this.extension
  33819. };
  33820. m.prototype = Object.create(f.prototype),
  33821. o.Message.ExtensionField = m;
  33822. var v = function(e, t, i) {
  33823. a.call(this, e, t, i),
  33824. this.fields = []
  33825. };
  33826. o.Message.OneOf = v;
  33827. var A = function(e, t, i, n, r) {
  33828. l.call(this, e, t, i, n, r),
  33829. this.className = "Enum",
  33830. this.object = null
  33831. };
  33832. A.getName = function(e, t) {
  33833. for (var i, n = Object.keys(e), r = 0; r < n.length; ++r)
  33834. if (e[i = n[r]] === t)
  33835. return i;
  33836. return null
  33837. }
  33838. ;
  33839. var y = A.prototype = Object.create(l.prototype);
  33840. y.build = function(t) {
  33841. if (this.object && !t)
  33842. return this.object;
  33843. for (var i = new e.Builder.Enum, n = this.getChildren(A.Value), r = 0, o = n.length; r < o; ++r)
  33844. i[n[r].name] = n[r].id;
  33845. return Object.defineProperty && Object.defineProperty(i, "$options", {
  33846. value: this.buildOpt(),
  33847. enumerable: !1
  33848. }),
  33849. this.object = i
  33850. }
  33851. ,
  33852. o.Enum = A;
  33853. var C = function(e, t, i, n) {
  33854. a.call(this, e, t, i),
  33855. this.className = "Enum.Value",
  33856. this.id = n
  33857. };
  33858. C.prototype = Object.create(a.prototype),
  33859. o.Enum.Value = C;
  33860. var I = function(e, t, i, n) {
  33861. a.call(this, e, t, i),
  33862. this.field = n
  33863. };
  33864. I.prototype = Object.create(a.prototype),
  33865. o.Extension = I;
  33866. var E = function(e, t, i, n) {
  33867. l.call(this, e, t, i, n),
  33868. this.className = "Service",
  33869. this.clazz = null
  33870. }
  33871. , b = E.prototype = Object.create(l.prototype);
  33872. b.build = function(i) {
  33873. return this.clazz && !i ? this.clazz : this.clazz = function(e, i) {
  33874. for (var n = function(t) {
  33875. e.Builder.Service.call(this),
  33876. this.rpcImpl = t || function(e, t, i) {
  33877. setTimeout(i.bind(this, Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")), 0)
  33878. }
  33879. }, r = n.prototype = Object.create(e.Builder.Service.prototype), o = i.getChildren(e.Reflect.Service.RPCMethod), a = 0; a < o.length; a++)
  33880. !function(e) {
  33881. r[e.name] = function(n, r) {
  33882. try {
  33883. try {
  33884. n = e.resolvedRequestType.clazz.decode(t.wrap(n))
  33885. } catch (e) {
  33886. if (!(e instanceof TypeError))
  33887. throw e
  33888. }
  33889. if (null === n || "object" != typeof n)
  33890. throw Error("Illegal arguments");
  33891. n instanceof e.resolvedRequestType.clazz || (n = new e.resolvedRequestType.clazz(n)),
  33892. this.rpcImpl(e.fqn(), n, function(t, n) {
  33893. if (t)
  33894. return void r(t);
  33895. null === n && (n = "");
  33896. try {
  33897. n = e.resolvedResponseType.clazz.decode(n)
  33898. } catch (e) {}
  33899. return n && n instanceof e.resolvedResponseType.clazz ? void r(null, n) : void r(Error("Illegal response type received in service method " + i.name + "#" + e.name))
  33900. })
  33901. } catch (e) {
  33902. setTimeout(r.bind(this, e), 0)
  33903. }
  33904. }
  33905. ,
  33906. n[e.name] = function(t, i, r) {
  33907. new n(t)[e.name](i, r)
  33908. }
  33909. ,
  33910. Object.defineProperty && (Object.defineProperty(n[e.name], "$options", {
  33911. value: e.buildOpt()
  33912. }),
  33913. Object.defineProperty(r[e.name], "$options", {
  33914. value: n[e.name].$options
  33915. }))
  33916. }(o[a]);
  33917. return Object.defineProperty && (Object.defineProperty(n, "$options", {
  33918. value: i.buildOpt()
  33919. }),
  33920. Object.defineProperty(r, "$options", {
  33921. value: n.$options
  33922. }),
  33923. Object.defineProperty(n, "$type", {
  33924. value: i
  33925. }),
  33926. Object.defineProperty(r, "$type", {
  33927. value: i
  33928. })),
  33929. n
  33930. }(e, this)
  33931. }
  33932. ,
  33933. o.Service = E;
  33934. var w = function(e, t, i, n) {
  33935. a.call(this, e, t, i),
  33936. this.className = "Service.Method",
  33937. this.options = n || {}
  33938. }
  33939. , _ = w.prototype = Object.create(a.prototype);
  33940. _.buildOpt = c.buildOpt,
  33941. o.Service.Method = w;
  33942. var T = function(e, t, i, n, r, o, a, s) {
  33943. w.call(this, e, t, i, s),
  33944. this.className = "Service.RPCMethod",
  33945. this.requestName = n,
  33946. this.responseName = r,
  33947. this.requestStream = o,
  33948. this.responseStream = a,
  33949. this.resolvedRequestType = null,
  33950. this.resolvedResponseType = null
  33951. };
  33952. return T.prototype = Object.create(w.prototype),
  33953. o.Service.RPCMethod = T,
  33954. o
  33955. }(r),
  33956. r.Builder = function(t, i, n) {
  33957. function r(e) {
  33958. e.messages && e.messages.forEach(function(t) {
  33959. t.syntax = e.syntax,
  33960. r(t)
  33961. }),
  33962. e.enums && e.enums.forEach(function(t) {
  33963. t.syntax = e.syntax
  33964. })
  33965. }
  33966. var o = function(e) {
  33967. this.ns = new n.Namespace(this,null,""),
  33968. this.ptr = this.ns,
  33969. this.resolved = !1,
  33970. this.result = null,
  33971. this.files = {},
  33972. this.importRoot = null,
  33973. this.options = e || {}
  33974. }
  33975. , a = o.prototype;
  33976. return o.isMessage = function(e) {
  33977. return "string" == typeof e.name && ("undefined" == typeof e.values && "undefined" == typeof e.rpc)
  33978. }
  33979. ,
  33980. o.isMessageField = function(e) {
  33981. return "string" == typeof e.rule && "string" == typeof e.name && "string" == typeof e.type && "undefined" != typeof e.id
  33982. }
  33983. ,
  33984. o.isEnum = function(e) {
  33985. return "string" == typeof e.name && !("undefined" == typeof e.values || !Array.isArray(e.values) || 0 === e.values.length)
  33986. }
  33987. ,
  33988. o.isService = function(e) {
  33989. return !("string" != typeof e.name || "object" != typeof e.rpc || !e.rpc)
  33990. }
  33991. ,
  33992. o.isExtend = function(e) {
  33993. return "string" == typeof e.ref
  33994. }
  33995. ,
  33996. a.reset = function() {
  33997. return this.ptr = this.ns,
  33998. this
  33999. }
  34000. ,
  34001. a.define = function(e) {
  34002. if ("string" != typeof e || !i.TYPEREF.test(e))
  34003. throw Error("illegal namespace: " + e);
  34004. return e.split(".").forEach(function(e) {
  34005. var t = this.ptr.getChild(e);
  34006. null === t && this.ptr.addChild(t = new n.Namespace(this,this.ptr,e)),
  34007. this.ptr = t
  34008. }, this),
  34009. this
  34010. }
  34011. ,
  34012. a.create = function(e) {
  34013. if (!e)
  34014. return this;
  34015. if (Array.isArray(e)) {
  34016. if (0 === e.length)
  34017. return this;
  34018. e = e.slice()
  34019. } else
  34020. e = [e];
  34021. for (var i = [e]; i.length > 0; ) {
  34022. if (e = i.pop(),
  34023. !Array.isArray(e))
  34024. throw Error("not a valid namespace: " + JSON.stringify(e));
  34025. for (; e.length > 0; ) {
  34026. var r = e.shift();
  34027. if (o.isMessage(r)) {
  34028. var a = new n.Message(this,this.ptr,r.name,r.options,r.isGroup,r.syntax)
  34029. , s = {};
  34030. r.oneofs && Object.keys(r.oneofs).forEach(function(e) {
  34031. a.addChild(s[e] = new n.Message.OneOf(this,a,e))
  34032. }, this),
  34033. r.fields && r.fields.forEach(function(e) {
  34034. if (null !== a.getChild(0 | e.id))
  34035. throw Error("duplicate or invalid field id in " + a.name + ": " + e.id);
  34036. if (e.options && "object" != typeof e.options)
  34037. throw Error("illegal field options in " + a.name + "#" + e.name);
  34038. var t = null;
  34039. if ("string" == typeof e.oneof && !(t = s[e.oneof]))
  34040. throw Error("illegal oneof in " + a.name + "#" + e.name + ": " + e.oneof);
  34041. e = new n.Message.Field(this,a,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,r.syntax),
  34042. t && t.fields.push(e),
  34043. a.addChild(e)
  34044. }, this);
  34045. var l = [];
  34046. if (r.enums && r.enums.forEach(function(e) {
  34047. l.push(e)
  34048. }),
  34049. r.messages && r.messages.forEach(function(e) {
  34050. l.push(e)
  34051. }),
  34052. r.services && r.services.forEach(function(e) {
  34053. l.push(e)
  34054. }),
  34055. r.extensions && ("number" == typeof r.extensions[0] ? a.extensions = [r.extensions] : a.extensions = r.extensions),
  34056. this.ptr.addChild(a),
  34057. l.length > 0) {
  34058. i.push(e),
  34059. e = l,
  34060. l = null,
  34061. this.ptr = a,
  34062. a = null;
  34063. continue
  34064. }
  34065. l = null
  34066. } else if (o.isEnum(r))
  34067. a = new n.Enum(this,this.ptr,r.name,r.options,r.syntax),
  34068. r.values.forEach(function(e) {
  34069. a.addChild(new n.Enum.Value(this,a,e.name,e.id))
  34070. }, this),
  34071. this.ptr.addChild(a);
  34072. else if (o.isService(r))
  34073. a = new n.Service(this,this.ptr,r.name,r.options),
  34074. Object.keys(r.rpc).forEach(function(e) {
  34075. var t = r.rpc[e];
  34076. a.addChild(new n.Service.RPCMethod(this,a,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))
  34077. }, this),
  34078. this.ptr.addChild(a);
  34079. else {
  34080. if (!o.isExtend(r))
  34081. throw Error("not a valid definition: " + JSON.stringify(r));
  34082. if (a = this.ptr.resolve(r.ref, !0))
  34083. r.fields.forEach(function(e) {
  34084. if (null !== a.getChild(0 | e.id))
  34085. throw Error("duplicate extended field id in " + a.name + ": " + e.id);
  34086. if (a.extensions) {
  34087. var i = !1;
  34088. if (a.extensions.forEach(function(t) {
  34089. e.id >= t[0] && e.id <= t[1] && (i = !0)
  34090. }),
  34091. !i)
  34092. throw Error("illegal extended field id in " + a.name + ": " + e.id + " (not within valid ranges)")
  34093. }
  34094. var r = e.name;
  34095. this.options.convertFieldsToCamelCase && (r = t.Util.toCamelCase(r));
  34096. var o = new n.Message.ExtensionField(this,a,e.rule,e.type,this.ptr.fqn() + "." + r,e.id,e.options)
  34097. , s = new n.Extension(this,this.ptr,e.name,o);
  34098. o.extension = s,
  34099. this.ptr.addChild(s),
  34100. a.addChild(o)
  34101. }, this);
  34102. else if (!/\.?google\.protobuf\./.test(r.ref))
  34103. throw Error("extended message " + r.ref + " is not defined")
  34104. }
  34105. r = null,
  34106. a = null
  34107. }
  34108. e = null,
  34109. this.ptr = this.ptr.parent
  34110. }
  34111. return this.resolved = !1,
  34112. this.result = null,
  34113. this
  34114. }
  34115. ,
  34116. a.import = function(i, n) {
  34117. var o = "/";
  34118. if ("string" == typeof n) {
  34119. if (t.Util.IS_NODE && (n = e("path").resolve(n)),
  34120. this.files[n] === !0)
  34121. return this.reset();
  34122. this.files[n] = !0
  34123. } else if ("object" == typeof n) {
  34124. var a = n.root;
  34125. t.Util.IS_NODE && (a = e("path").resolve(a)),
  34126. (a.indexOf("\\") >= 0 || n.file.indexOf("\\") >= 0) && (o = "\\");
  34127. var s = a + o + n.file;
  34128. if (this.files[s] === !0)
  34129. return this.reset();
  34130. this.files[s] = !0
  34131. }
  34132. if (i.imports && i.imports.length > 0) {
  34133. var l, c = !1;
  34134. "object" == typeof n ? (this.importRoot = n.root,
  34135. c = !0,
  34136. l = this.importRoot,
  34137. n = n.file,
  34138. (l.indexOf("\\") >= 0 || n.indexOf("\\") >= 0) && (o = "\\")) : "string" == typeof n ? this.importRoot ? l = this.importRoot : n.indexOf("/") >= 0 ? (l = n.replace(/\/[^\/]*$/, ""),
  34139. "" === l && (l = "/")) : n.indexOf("\\") >= 0 ? (l = n.replace(/\\[^\\]*$/, ""),
  34140. o = "\\") : l = "." : l = null;
  34141. for (var h = 0; h < i.imports.length; h++)
  34142. if ("string" == typeof i.imports[h]) {
  34143. if (!l)
  34144. throw Error("cannot determine import root");
  34145. var u = i.imports[h];
  34146. if ("google/protobuf/descriptor.proto" === u)
  34147. continue;
  34148. if (u = l + o + u,
  34149. this.files[u] === !0)
  34150. continue;
  34151. /\.proto$/i.test(u) && !t.DotProto && (u = u.replace(/\.proto$/, ".json"));
  34152. var d = t.Util.fetch(u);
  34153. if (null === d)
  34154. throw Error("failed to import '" + u + "' in '" + n + "': file not found");
  34155. /\.json$/i.test(u) ? this.import(JSON.parse(d + ""), u) : this.import(t.DotProto.Parser.parse(d), u)
  34156. } else
  34157. n ? /\.(\w+)$/.test(n) ? this.import(i.imports[h], n.replace(/^(.+)\.(\w+)$/, function(e, t, i) {
  34158. return t + "_import" + h + "." + i
  34159. })) : this.import(i.imports[h], n + "_import" + h) : this.import(i.imports[h]);
  34160. c && (this.importRoot = null)
  34161. }
  34162. i.package && this.define(i.package),
  34163. i.syntax && r(i);
  34164. var p = this.ptr;
  34165. return i.options && Object.keys(i.options).forEach(function(e) {
  34166. p.options[e] = i.options[e]
  34167. }),
  34168. i.messages && (this.create(i.messages),
  34169. this.ptr = p),
  34170. i.enums && (this.create(i.enums),
  34171. this.ptr = p),
  34172. i.services && (this.create(i.services),
  34173. this.ptr = p),
  34174. i.extends && this.create(i.extends),
  34175. this.reset()
  34176. }
  34177. ,
  34178. a.resolveAll = function() {
  34179. var e;
  34180. if (null == this.ptr || "object" == typeof this.ptr.type)
  34181. return this;
  34182. if (this.ptr instanceof n.Namespace)
  34183. this.ptr.children.forEach(function(e) {
  34184. this.ptr = e,
  34185. this.resolveAll()
  34186. }, this);
  34187. else if (this.ptr instanceof n.Message.Field) {
  34188. if (i.TYPE.test(this.ptr.type))
  34189. this.ptr.type = t.TYPES[this.ptr.type];
  34190. else {
  34191. if (!i.TYPEREF.test(this.ptr.type))
  34192. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  34193. if (e = (this.ptr instanceof n.Message.ExtensionField ? this.ptr.extension.parent : this.ptr.parent).resolve(this.ptr.type, !0),
  34194. !e)
  34195. throw Error("unresolvable type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  34196. if (this.ptr.resolvedType = e,
  34197. e instanceof n.Enum) {
  34198. if (this.ptr.type = t.TYPES.enum,
  34199. "proto3" === this.ptr.syntax && "proto3" !== e.syntax)
  34200. throw Error("proto3 message cannot reference proto2 enum")
  34201. } else {
  34202. if (!(e instanceof n.Message))
  34203. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  34204. this.ptr.type = e.isGroup ? t.TYPES.group : t.TYPES.message
  34205. }
  34206. }
  34207. if (this.ptr.map) {
  34208. if (!i.TYPE.test(this.ptr.keyType))
  34209. throw Error("illegal key type for map field in " + this.ptr.toString(!0) + ": " + this.ptr.keyType);
  34210. this.ptr.keyType = t.TYPES[this.ptr.keyType]
  34211. }
  34212. } else if (this.ptr instanceof t.Reflect.Service.Method) {
  34213. if (!(this.ptr instanceof t.Reflect.Service.RPCMethod))
  34214. throw Error("illegal service type in " + this.ptr.toString(!0));
  34215. if (e = this.ptr.parent.resolve(this.ptr.requestName, !0),
  34216. !(e && e instanceof t.Reflect.Message))
  34217. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.requestName);
  34218. if (this.ptr.resolvedRequestType = e,
  34219. e = this.ptr.parent.resolve(this.ptr.responseName, !0),
  34220. !(e && e instanceof t.Reflect.Message))
  34221. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.responseName);
  34222. this.ptr.resolvedResponseType = e
  34223. } else if (!(this.ptr instanceof t.Reflect.Message.OneOf || this.ptr instanceof t.Reflect.Extension || this.ptr instanceof t.Reflect.Enum.Value))
  34224. throw Error("illegal object in namespace: " + typeof this.ptr + ": " + this.ptr);
  34225. return this.reset()
  34226. }
  34227. ,
  34228. a.build = function(e) {
  34229. if (this.reset(),
  34230. this.resolved || (this.resolveAll(),
  34231. this.resolved = !0,
  34232. this.result = null),
  34233. null === this.result && (this.result = this.ns.build()),
  34234. !e)
  34235. return this.result;
  34236. for (var t = "string" == typeof e ? e.split(".") : e, i = this.result, n = 0; n < t.length; n++) {
  34237. if (!i[t[n]]) {
  34238. i = null;
  34239. break
  34240. }
  34241. i = i[t[n]]
  34242. }
  34243. return i
  34244. }
  34245. ,
  34246. a.lookup = function(e, t) {
  34247. return e ? this.ns.resolve(e, t) : this.ns
  34248. }
  34249. ,
  34250. a.toString = function() {
  34251. return "Builder"
  34252. }
  34253. ,
  34254. o.Message = function() {}
  34255. ,
  34256. o.Enum = function() {}
  34257. ,
  34258. o.Service = function() {}
  34259. ,
  34260. o
  34261. }(r, r.Lang, r.Reflect),
  34262. r.Map = function(e, t) {
  34263. function i(e) {
  34264. var t = 0;
  34265. return {
  34266. next: function() {
  34267. return t < e.length ? {
  34268. done: !1,
  34269. value: e[t++]
  34270. } : {
  34271. done: !0
  34272. }
  34273. }
  34274. }
  34275. }
  34276. var n = function(e, i) {
  34277. if (!e.map)
  34278. throw Error("field is not a map");
  34279. if (this.field = e,
  34280. this.keyElem = new t.Element(e.keyType,null,!0,e.syntax),
  34281. this.valueElem = new t.Element(e.type,e.resolvedType,!1,e.syntax),
  34282. this.map = {},
  34283. Object.defineProperty(this, "size", {
  34284. get: function() {
  34285. return Object.keys(this.map).length
  34286. }
  34287. }),
  34288. i)
  34289. for (var n = Object.keys(i), r = 0; r < n.length; r++) {
  34290. var o = this.keyElem.valueFromString(n[r])
  34291. , a = this.valueElem.verifyValue(i[n[r]]);
  34292. this.map[this.keyElem.valueToString(o)] = {
  34293. key: o,
  34294. value: a
  34295. }
  34296. }
  34297. }
  34298. , r = n.prototype;
  34299. return r.clear = function() {
  34300. this.map = {}
  34301. }
  34302. ,
  34303. r.delete = function(e) {
  34304. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e))
  34305. , i = t in this.map;
  34306. return delete this.map[t],
  34307. i
  34308. }
  34309. ,
  34310. r.entries = function() {
  34311. for (var e, t = [], n = Object.keys(this.map), r = 0; r < n.length; r++)
  34312. t.push([(e = this.map[n[r]]).key, e.value]);
  34313. return i(t)
  34314. }
  34315. ,
  34316. r.keys = function() {
  34317. for (var e = [], t = Object.keys(this.map), n = 0; n < t.length; n++)
  34318. e.push(this.map[t[n]].key);
  34319. return i(e)
  34320. }
  34321. ,
  34322. r.values = function() {
  34323. for (var e = [], t = Object.keys(this.map), n = 0; n < t.length; n++)
  34324. e.push(this.map[t[n]].value);
  34325. return i(e)
  34326. }
  34327. ,
  34328. r.forEach = function(e, t) {
  34329. for (var i, n = Object.keys(this.map), r = 0; r < n.length; r++)
  34330. e.call(t, (i = this.map[n[r]]).value, i.key, this)
  34331. }
  34332. ,
  34333. r.set = function(e, t) {
  34334. var i = this.keyElem.verifyValue(e)
  34335. , n = this.valueElem.verifyValue(t);
  34336. return this.map[this.keyElem.valueToString(i)] = {
  34337. key: i,
  34338. value: n
  34339. },
  34340. this
  34341. }
  34342. ,
  34343. r.get = function(e) {
  34344. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  34345. if (t in this.map)
  34346. return this.map[t].value
  34347. }
  34348. ,
  34349. r.has = function(e) {
  34350. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  34351. return t in this.map
  34352. }
  34353. ,
  34354. n
  34355. }(r, r.Reflect),
  34356. r.loadProto = function(e, t, i) {
  34357. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  34358. t = void 0),
  34359. r.loadJson(r.DotProto.Parser.parse(e), t, i)
  34360. }
  34361. ,
  34362. r.protoFromString = r.loadProto,
  34363. r.loadProtoFile = function(e, t, i) {
  34364. if (t && "object" == typeof t ? (i = t,
  34365. t = null) : t && "function" == typeof t || (t = null),
  34366. t)
  34367. return r.Util.fetch("string" == typeof e ? e : e.root + "/" + e.file, function(n) {
  34368. if (null === n)
  34369. return void t(Error("Failed to fetch file"));
  34370. try {
  34371. t(null, r.loadProto(n, i, e))
  34372. } catch (e) {
  34373. t(e)
  34374. }
  34375. });
  34376. var n = r.Util.fetch("object" == typeof e ? e.root + "/" + e.file : e);
  34377. return null === n ? null : r.loadProto(n, i, e)
  34378. }
  34379. ,
  34380. r.protoFromFile = r.loadProtoFile,
  34381. r.newBuilder = function(e) {
  34382. return e = e || {},
  34383. "undefined" == typeof e.convertFieldsToCamelCase && (e.convertFieldsToCamelCase = r.convertFieldsToCamelCase),
  34384. "undefined" == typeof e.populateAccessors && (e.populateAccessors = r.populateAccessors),
  34385. new r.Builder(e)
  34386. }
  34387. ,
  34388. r.loadJson = function(e, t, i) {
  34389. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  34390. t = null),
  34391. t && "object" == typeof t || (t = r.newBuilder()),
  34392. "string" == typeof e && (e = JSON.parse(e)),
  34393. t.import(e, i),
  34394. t.resolveAll(),
  34395. t
  34396. }
  34397. ,
  34398. r.loadJsonFile = function(e, t, i) {
  34399. if (t && "object" == typeof t ? (i = t,
  34400. t = null) : t && "function" == typeof t || (t = null),
  34401. t)
  34402. return r.Util.fetch("string" == typeof e ? e : e.root + "/" + e.file, function(n) {
  34403. if (null === n)
  34404. return void t(Error("Failed to fetch file"));
  34405. try {
  34406. t(null, r.loadJson(JSON.parse(n), i, e))
  34407. } catch (e) {
  34408. t(e)
  34409. }
  34410. });
  34411. var n = r.Util.fetch("object" == typeof e ? e.root + "/" + e.file : e);
  34412. return null === n ? null : r.loadJson(JSON.parse(n), i, e)
  34413. }
  34414. ,
  34415. r
  34416. })
  34417. }
  34418. ).call(this, e("_process"))
  34419. }
  34420. , {
  34421. _process: 203,
  34422. bytebuffer: 215,
  34423. fs: 197,
  34424. path: 197
  34425. }],
  34426. 215: [function(e, t, i) {
  34427. !function(i, n) {
  34428. "function" == typeof define && define.amd ? define(["long"], n) : "function" == typeof e && "object" == typeof t && t && t.exports ? t.exports = function() {
  34429. var t;
  34430. try {
  34431. t = e("long")
  34432. } catch (e) {}
  34433. return n(t)
  34434. }() : (i.dcodeIO = i.dcodeIO || {}).ByteBuffer = n(i.dcodeIO.Long)
  34435. }(this, function(e) {
  34436. "use strict";
  34437. function t(e) {
  34438. var t = 0;
  34439. return function() {
  34440. return t < e.length ? e.charCodeAt(t++) : null
  34441. }
  34442. }
  34443. function i() {
  34444. var e = []
  34445. , t = [];
  34446. return function() {
  34447. return 0 === arguments.length ? t.join("") + l.apply(String, e) : (e.length + arguments.length > 1024 && (t.push(l.apply(String, e)),
  34448. e.length = 0),
  34449. void Array.prototype.push.apply(e, arguments))
  34450. }
  34451. }
  34452. function n(e, t, i, n, r) {
  34453. 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];
  34454. for (u += d,
  34455. o = p & (1 << -h) - 1,
  34456. p >>= -h,
  34457. h += s; h > 0; o = 256 * o + e[t + u],
  34458. u += d,
  34459. h -= 8)
  34460. ;
  34461. for (a = o & (1 << -h) - 1,
  34462. o >>= -h,
  34463. h += n; h > 0; a = 256 * a + e[t + u],
  34464. u += d,
  34465. h -= 8)
  34466. ;
  34467. if (0 === o)
  34468. o = 1 - c;
  34469. else {
  34470. if (o === l)
  34471. return a ? NaN : (p ? -1 : 1) * (1 / 0);
  34472. a += Math.pow(2, n),
  34473. o -= c
  34474. }
  34475. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  34476. }
  34477. function r(e, t, i, n, r, o) {
  34478. 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;
  34479. for (t = Math.abs(t),
  34480. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  34481. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  34482. t * (l = Math.pow(2, -a)) < 1 && (a--,
  34483. l *= 2),
  34484. t += a + u >= 1 ? d / l : d * Math.pow(2, 1 - u),
  34485. t * l >= 2 && (a++,
  34486. l /= 2),
  34487. a + u >= h ? (s = 0,
  34488. a = h) : a + u >= 1 ? (s = (t * l - 1) * Math.pow(2, r),
  34489. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  34490. a = 0)); r >= 8; e[i + p] = 255 & s,
  34491. p += f,
  34492. s /= 256,
  34493. r -= 8)
  34494. ;
  34495. for (a = a << r | s,
  34496. c += r; c > 0; e[i + p] = 255 & a,
  34497. p += f,
  34498. a /= 256,
  34499. c -= 8)
  34500. ;
  34501. e[i + p - f] |= 128 * g
  34502. }
  34503. var o = function(e, t, i) {
  34504. if ("undefined" == typeof e && (e = o.DEFAULT_CAPACITY),
  34505. "undefined" == typeof t && (t = o.DEFAULT_ENDIAN),
  34506. "undefined" == typeof i && (i = o.DEFAULT_NOASSERT),
  34507. !i) {
  34508. if (e |= 0,
  34509. e < 0)
  34510. throw RangeError("Illegal capacity");
  34511. t = !!t,
  34512. i = !!i
  34513. }
  34514. this.buffer = 0 === e ? s : new ArrayBuffer(e),
  34515. this.view = 0 === e ? null : new Uint8Array(this.buffer),
  34516. this.offset = 0,
  34517. this.markedOffset = -1,
  34518. this.limit = e,
  34519. this.littleEndian = t,
  34520. this.noAssert = i
  34521. };
  34522. o.VERSION = "5.0.1",
  34523. o.LITTLE_ENDIAN = !0,
  34524. o.BIG_ENDIAN = !1,
  34525. o.DEFAULT_CAPACITY = 16,
  34526. o.DEFAULT_ENDIAN = o.BIG_ENDIAN,
  34527. o.DEFAULT_NOASSERT = !1,
  34528. o.Long = e || null;
  34529. var a = o.prototype;
  34530. a.__isByteBuffer__,
  34531. Object.defineProperty(a, "__isByteBuffer__", {
  34532. value: !0,
  34533. enumerable: !1,
  34534. configurable: !1
  34535. });
  34536. var s = new ArrayBuffer(0)
  34537. , l = String.fromCharCode;
  34538. o.accessor = function() {
  34539. return Uint8Array
  34540. }
  34541. ,
  34542. o.allocate = function(e, t, i) {
  34543. return new o(e,t,i)
  34544. }
  34545. ,
  34546. o.concat = function(e, t, i, n) {
  34547. "boolean" != typeof t && "string" == typeof t || (n = i,
  34548. i = t,
  34549. t = void 0);
  34550. for (var r, a = 0, s = 0, l = e.length; s < l; ++s)
  34551. o.isByteBuffer(e[s]) || (e[s] = o.wrap(e[s], t)),
  34552. r = e[s].limit - e[s].offset,
  34553. r > 0 && (a += r);
  34554. if (0 === a)
  34555. return new o(0,i,n);
  34556. var c, h = new o(a,i,n);
  34557. for (s = 0; s < l; )
  34558. c = e[s++],
  34559. r = c.limit - c.offset,
  34560. r <= 0 || (h.view.set(c.view.subarray(c.offset, c.limit), h.offset),
  34561. h.offset += r);
  34562. return h.limit = h.offset,
  34563. h.offset = 0,
  34564. h
  34565. }
  34566. ,
  34567. o.isByteBuffer = function(e) {
  34568. return (e && e.__isByteBuffer__) === !0
  34569. }
  34570. ,
  34571. o.type = function() {
  34572. return ArrayBuffer
  34573. }
  34574. ,
  34575. o.wrap = function(e, t, i, n) {
  34576. if ("string" != typeof t && (n = i,
  34577. i = t,
  34578. t = void 0),
  34579. "string" == typeof e)
  34580. switch ("undefined" == typeof t && (t = "utf8"),
  34581. t) {
  34582. case "base64":
  34583. return o.fromBase64(e, i);
  34584. case "hex":
  34585. return o.fromHex(e, i);
  34586. case "binary":
  34587. return o.fromBinary(e, i);
  34588. case "utf8":
  34589. return o.fromUTF8(e, i);
  34590. case "debug":
  34591. return o.fromDebug(e, i);
  34592. default:
  34593. throw Error("Unsupported encoding: " + t)
  34594. }
  34595. if (null === e || "object" != typeof e)
  34596. throw TypeError("Illegal buffer");
  34597. var r;
  34598. if (o.isByteBuffer(e))
  34599. return r = a.clone.call(e),
  34600. r.markedOffset = -1,
  34601. r;
  34602. if (e instanceof Uint8Array)
  34603. r = new o(0,i,n),
  34604. e.length > 0 && (r.buffer = e.buffer,
  34605. r.offset = e.byteOffset,
  34606. r.limit = e.byteOffset + e.byteLength,
  34607. r.view = new Uint8Array(e.buffer));
  34608. else if (e instanceof ArrayBuffer)
  34609. r = new o(0,i,n),
  34610. e.byteLength > 0 && (r.buffer = e,
  34611. r.offset = 0,
  34612. r.limit = e.byteLength,
  34613. r.view = e.byteLength > 0 ? new Uint8Array(e) : null);
  34614. else {
  34615. if ("[object Array]" !== Object.prototype.toString.call(e))
  34616. throw TypeError("Illegal buffer");
  34617. r = new o(e.length,i,n),
  34618. r.limit = e.length;
  34619. for (var s = 0; s < e.length; ++s)
  34620. r.view[s] = e[s]
  34621. }
  34622. return r
  34623. }
  34624. ,
  34625. a.writeBitSet = function(e, t) {
  34626. var i = "undefined" == typeof t;
  34627. if (i && (t = this.offset),
  34628. !this.noAssert) {
  34629. if (!(e instanceof Array))
  34630. throw TypeError("Illegal BitSet: Not an array");
  34631. if ("number" != typeof t || t % 1 !== 0)
  34632. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34633. if (t >>>= 0,
  34634. t < 0 || t + 0 > this.buffer.byteLength)
  34635. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34636. }
  34637. var n, r = t, o = e.length, a = o >> 3, s = 0;
  34638. for (t += this.writeVarint32(o, t); a--; )
  34639. 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,
  34640. this.writeByte(n, t++);
  34641. if (s < o) {
  34642. var l = 0;
  34643. for (n = 0; s < o; )
  34644. n |= (1 & !!e[s++]) << l++;
  34645. this.writeByte(n, t++)
  34646. }
  34647. return i ? (this.offset = t,
  34648. this) : t - r
  34649. }
  34650. ,
  34651. a.readBitSet = function(e) {
  34652. var t = "undefined" == typeof e;
  34653. t && (e = this.offset);
  34654. var i, n = this.readVarint32(e), r = n.value, o = r >> 3, a = 0, s = [];
  34655. for (e += n.length; o--; )
  34656. i = this.readByte(e++),
  34657. s[a++] = !!(1 & i),
  34658. s[a++] = !!(2 & i),
  34659. s[a++] = !!(4 & i),
  34660. s[a++] = !!(8 & i),
  34661. s[a++] = !!(16 & i),
  34662. s[a++] = !!(32 & i),
  34663. s[a++] = !!(64 & i),
  34664. s[a++] = !!(128 & i);
  34665. if (a < r) {
  34666. var l = 0;
  34667. for (i = this.readByte(e++); a < r; )
  34668. s[a++] = !!(i >> l++ & 1)
  34669. }
  34670. return t && (this.offset = e),
  34671. s
  34672. }
  34673. ,
  34674. a.readBytes = function(e, t) {
  34675. var i = "undefined" == typeof t;
  34676. if (i && (t = this.offset),
  34677. !this.noAssert) {
  34678. if ("number" != typeof t || t % 1 !== 0)
  34679. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34680. if (t >>>= 0,
  34681. t < 0 || t + e > this.buffer.byteLength)
  34682. throw RangeError("Illegal offset: 0 <= " + t + " (+" + e + ") <= " + this.buffer.byteLength)
  34683. }
  34684. var n = this.slice(t, t + e);
  34685. return i && (this.offset += e),
  34686. n
  34687. }
  34688. ,
  34689. a.writeBytes = a.append,
  34690. a.writeInt8 = function(e, t) {
  34691. var i = "undefined" == typeof t;
  34692. if (i && (t = this.offset),
  34693. !this.noAssert) {
  34694. if ("number" != typeof e || e % 1 !== 0)
  34695. throw TypeError("Illegal value: " + e + " (not an integer)");
  34696. if (e |= 0,
  34697. "number" != typeof t || t % 1 !== 0)
  34698. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34699. if (t >>>= 0,
  34700. t < 0 || t + 0 > this.buffer.byteLength)
  34701. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34702. }
  34703. t += 1;
  34704. var n = this.buffer.byteLength;
  34705. return t > n && this.resize((n *= 2) > t ? n : t),
  34706. t -= 1,
  34707. this.view[t] = e,
  34708. i && (this.offset += 1),
  34709. this
  34710. }
  34711. ,
  34712. a.writeByte = a.writeInt8,
  34713. a.readInt8 = function(e) {
  34714. var t = "undefined" == typeof e;
  34715. if (t && (e = this.offset),
  34716. !this.noAssert) {
  34717. if ("number" != typeof e || e % 1 !== 0)
  34718. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34719. if (e >>>= 0,
  34720. e < 0 || e + 1 > this.buffer.byteLength)
  34721. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  34722. }
  34723. var i = this.view[e];
  34724. return 128 === (128 & i) && (i = -(255 - i + 1)),
  34725. t && (this.offset += 1),
  34726. i
  34727. }
  34728. ,
  34729. a.readByte = a.readInt8,
  34730. a.writeUint8 = function(e, t) {
  34731. var i = "undefined" == typeof t;
  34732. if (i && (t = this.offset),
  34733. !this.noAssert) {
  34734. if ("number" != typeof e || e % 1 !== 0)
  34735. throw TypeError("Illegal value: " + e + " (not an integer)");
  34736. if (e >>>= 0,
  34737. "number" != typeof t || t % 1 !== 0)
  34738. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34739. if (t >>>= 0,
  34740. t < 0 || t + 0 > this.buffer.byteLength)
  34741. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34742. }
  34743. t += 1;
  34744. var n = this.buffer.byteLength;
  34745. return t > n && this.resize((n *= 2) > t ? n : t),
  34746. t -= 1,
  34747. this.view[t] = e,
  34748. i && (this.offset += 1),
  34749. this
  34750. }
  34751. ,
  34752. a.writeUInt8 = a.writeUint8,
  34753. a.readUint8 = function(e) {
  34754. var t = "undefined" == typeof e;
  34755. if (t && (e = this.offset),
  34756. !this.noAssert) {
  34757. if ("number" != typeof e || e % 1 !== 0)
  34758. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34759. if (e >>>= 0,
  34760. e < 0 || e + 1 > this.buffer.byteLength)
  34761. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  34762. }
  34763. var i = this.view[e];
  34764. return t && (this.offset += 1),
  34765. i
  34766. }
  34767. ,
  34768. a.readUInt8 = a.readUint8,
  34769. a.writeInt16 = function(e, t) {
  34770. var i = "undefined" == typeof t;
  34771. if (i && (t = this.offset),
  34772. !this.noAssert) {
  34773. if ("number" != typeof e || e % 1 !== 0)
  34774. throw TypeError("Illegal value: " + e + " (not an integer)");
  34775. if (e |= 0,
  34776. "number" != typeof t || t % 1 !== 0)
  34777. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34778. if (t >>>= 0,
  34779. t < 0 || t + 0 > this.buffer.byteLength)
  34780. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34781. }
  34782. t += 2;
  34783. var n = this.buffer.byteLength;
  34784. return t > n && this.resize((n *= 2) > t ? n : t),
  34785. t -= 2,
  34786. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  34787. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  34788. this.view[t + 1] = 255 & e),
  34789. i && (this.offset += 2),
  34790. this
  34791. }
  34792. ,
  34793. a.writeShort = a.writeInt16,
  34794. a.readInt16 = function(e) {
  34795. var t = "undefined" == typeof e;
  34796. if (t && (e = this.offset),
  34797. !this.noAssert) {
  34798. if ("number" != typeof e || e % 1 !== 0)
  34799. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34800. if (e >>>= 0,
  34801. e < 0 || e + 2 > this.buffer.byteLength)
  34802. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  34803. }
  34804. var i = 0;
  34805. return this.littleEndian ? (i = this.view[e],
  34806. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  34807. i |= this.view[e + 1]),
  34808. 32768 === (32768 & i) && (i = -(65535 - i + 1)),
  34809. t && (this.offset += 2),
  34810. i
  34811. }
  34812. ,
  34813. a.readShort = a.readInt16,
  34814. a.writeUint16 = function(e, t) {
  34815. var i = "undefined" == typeof t;
  34816. if (i && (t = this.offset),
  34817. !this.noAssert) {
  34818. if ("number" != typeof e || e % 1 !== 0)
  34819. throw TypeError("Illegal value: " + e + " (not an integer)");
  34820. if (e >>>= 0,
  34821. "number" != typeof t || t % 1 !== 0)
  34822. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34823. if (t >>>= 0,
  34824. t < 0 || t + 0 > this.buffer.byteLength)
  34825. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34826. }
  34827. t += 2;
  34828. var n = this.buffer.byteLength;
  34829. return t > n && this.resize((n *= 2) > t ? n : t),
  34830. t -= 2,
  34831. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  34832. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  34833. this.view[t + 1] = 255 & e),
  34834. i && (this.offset += 2),
  34835. this
  34836. }
  34837. ,
  34838. a.writeUInt16 = a.writeUint16,
  34839. a.readUint16 = function(e) {
  34840. var t = "undefined" == typeof e;
  34841. if (t && (e = this.offset),
  34842. !this.noAssert) {
  34843. if ("number" != typeof e || e % 1 !== 0)
  34844. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34845. if (e >>>= 0,
  34846. e < 0 || e + 2 > this.buffer.byteLength)
  34847. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  34848. }
  34849. var i = 0;
  34850. return this.littleEndian ? (i = this.view[e],
  34851. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  34852. i |= this.view[e + 1]),
  34853. t && (this.offset += 2),
  34854. i
  34855. }
  34856. ,
  34857. a.readUInt16 = a.readUint16,
  34858. a.writeInt32 = function(e, t) {
  34859. var i = "undefined" == typeof t;
  34860. if (i && (t = this.offset),
  34861. !this.noAssert) {
  34862. if ("number" != typeof e || e % 1 !== 0)
  34863. throw TypeError("Illegal value: " + e + " (not an integer)");
  34864. if (e |= 0,
  34865. "number" != typeof t || t % 1 !== 0)
  34866. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34867. if (t >>>= 0,
  34868. t < 0 || t + 0 > this.buffer.byteLength)
  34869. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34870. }
  34871. t += 4;
  34872. var n = this.buffer.byteLength;
  34873. return t > n && this.resize((n *= 2) > t ? n : t),
  34874. t -= 4,
  34875. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  34876. this.view[t + 2] = e >>> 16 & 255,
  34877. this.view[t + 1] = e >>> 8 & 255,
  34878. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  34879. this.view[t + 1] = e >>> 16 & 255,
  34880. this.view[t + 2] = e >>> 8 & 255,
  34881. this.view[t + 3] = 255 & e),
  34882. i && (this.offset += 4),
  34883. this
  34884. }
  34885. ,
  34886. a.writeInt = a.writeInt32,
  34887. a.readInt32 = function(e) {
  34888. var t = "undefined" == typeof e;
  34889. if (t && (e = this.offset),
  34890. !this.noAssert) {
  34891. if ("number" != typeof e || e % 1 !== 0)
  34892. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34893. if (e >>>= 0,
  34894. e < 0 || e + 4 > this.buffer.byteLength)
  34895. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  34896. }
  34897. var i = 0;
  34898. return this.littleEndian ? (i = this.view[e + 2] << 16,
  34899. i |= this.view[e + 1] << 8,
  34900. i |= this.view[e],
  34901. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  34902. i |= this.view[e + 2] << 8,
  34903. i |= this.view[e + 3],
  34904. i += this.view[e] << 24 >>> 0),
  34905. i |= 0,
  34906. t && (this.offset += 4),
  34907. i
  34908. }
  34909. ,
  34910. a.readInt = a.readInt32,
  34911. a.writeUint32 = function(e, t) {
  34912. var i = "undefined" == typeof t;
  34913. if (i && (t = this.offset),
  34914. !this.noAssert) {
  34915. if ("number" != typeof e || e % 1 !== 0)
  34916. throw TypeError("Illegal value: " + e + " (not an integer)");
  34917. if (e >>>= 0,
  34918. "number" != typeof t || t % 1 !== 0)
  34919. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34920. if (t >>>= 0,
  34921. t < 0 || t + 0 > this.buffer.byteLength)
  34922. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34923. }
  34924. t += 4;
  34925. var n = this.buffer.byteLength;
  34926. return t > n && this.resize((n *= 2) > t ? n : t),
  34927. t -= 4,
  34928. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  34929. this.view[t + 2] = e >>> 16 & 255,
  34930. this.view[t + 1] = e >>> 8 & 255,
  34931. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  34932. this.view[t + 1] = e >>> 16 & 255,
  34933. this.view[t + 2] = e >>> 8 & 255,
  34934. this.view[t + 3] = 255 & e),
  34935. i && (this.offset += 4),
  34936. this
  34937. }
  34938. ,
  34939. a.writeUInt32 = a.writeUint32,
  34940. a.readUint32 = function(e) {
  34941. var t = "undefined" == typeof e;
  34942. if (t && (e = this.offset),
  34943. !this.noAssert) {
  34944. if ("number" != typeof e || e % 1 !== 0)
  34945. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34946. if (e >>>= 0,
  34947. e < 0 || e + 4 > this.buffer.byteLength)
  34948. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  34949. }
  34950. var i = 0;
  34951. return this.littleEndian ? (i = this.view[e + 2] << 16,
  34952. i |= this.view[e + 1] << 8,
  34953. i |= this.view[e],
  34954. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  34955. i |= this.view[e + 2] << 8,
  34956. i |= this.view[e + 3],
  34957. i += this.view[e] << 24 >>> 0),
  34958. t && (this.offset += 4),
  34959. i
  34960. }
  34961. ,
  34962. a.readUInt32 = a.readUint32,
  34963. e && (a.writeInt64 = function(t, i) {
  34964. var n = "undefined" == typeof i;
  34965. if (n && (i = this.offset),
  34966. !this.noAssert) {
  34967. if ("number" == typeof t)
  34968. t = e.fromNumber(t);
  34969. else if ("string" == typeof t)
  34970. t = e.fromString(t);
  34971. else if (!(t && t instanceof e))
  34972. throw TypeError("Illegal value: " + t + " (not an integer or Long)");
  34973. if ("number" != typeof i || i % 1 !== 0)
  34974. throw TypeError("Illegal offset: " + i + " (not an integer)");
  34975. if (i >>>= 0,
  34976. i < 0 || i + 0 > this.buffer.byteLength)
  34977. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  34978. }
  34979. "number" == typeof t ? t = e.fromNumber(t) : "string" == typeof t && (t = e.fromString(t)),
  34980. i += 8;
  34981. var r = this.buffer.byteLength;
  34982. i > r && this.resize((r *= 2) > i ? r : i),
  34983. i -= 8;
  34984. var o = t.low
  34985. , a = t.high;
  34986. return this.littleEndian ? (this.view[i + 3] = o >>> 24 & 255,
  34987. this.view[i + 2] = o >>> 16 & 255,
  34988. this.view[i + 1] = o >>> 8 & 255,
  34989. this.view[i] = 255 & o,
  34990. i += 4,
  34991. this.view[i + 3] = a >>> 24 & 255,
  34992. this.view[i + 2] = a >>> 16 & 255,
  34993. this.view[i + 1] = a >>> 8 & 255,
  34994. this.view[i] = 255 & a) : (this.view[i] = a >>> 24 & 255,
  34995. this.view[i + 1] = a >>> 16 & 255,
  34996. this.view[i + 2] = a >>> 8 & 255,
  34997. this.view[i + 3] = 255 & a,
  34998. i += 4,
  34999. this.view[i] = o >>> 24 & 255,
  35000. this.view[i + 1] = o >>> 16 & 255,
  35001. this.view[i + 2] = o >>> 8 & 255,
  35002. this.view[i + 3] = 255 & o),
  35003. n && (this.offset += 8),
  35004. this
  35005. }
  35006. ,
  35007. a.writeLong = a.writeInt64,
  35008. a.readInt64 = function(t) {
  35009. var i = "undefined" == typeof t;
  35010. if (i && (t = this.offset),
  35011. !this.noAssert) {
  35012. if ("number" != typeof t || t % 1 !== 0)
  35013. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35014. if (t >>>= 0,
  35015. t < 0 || t + 8 > this.buffer.byteLength)
  35016. throw RangeError("Illegal offset: 0 <= " + t + " (+8) <= " + this.buffer.byteLength)
  35017. }
  35018. var n = 0
  35019. , r = 0;
  35020. this.littleEndian ? (n = this.view[t + 2] << 16,
  35021. n |= this.view[t + 1] << 8,
  35022. n |= this.view[t],
  35023. n += this.view[t + 3] << 24 >>> 0,
  35024. t += 4,
  35025. r = this.view[t + 2] << 16,
  35026. r |= this.view[t + 1] << 8,
  35027. r |= this.view[t],
  35028. r += this.view[t + 3] << 24 >>> 0) : (r = this.view[t + 1] << 16,
  35029. r |= this.view[t + 2] << 8,
  35030. r |= this.view[t + 3],
  35031. r += this.view[t] << 24 >>> 0,
  35032. t += 4,
  35033. n = this.view[t + 1] << 16,
  35034. n |= this.view[t + 2] << 8,
  35035. n |= this.view[t + 3],
  35036. n += this.view[t] << 24 >>> 0);
  35037. var o = new e(n,r,!1);
  35038. return i && (this.offset += 8),
  35039. o
  35040. }
  35041. ,
  35042. a.readLong = a.readInt64,
  35043. a.writeUint64 = function(t, i) {
  35044. var n = "undefined" == typeof i;
  35045. if (n && (i = this.offset),
  35046. !this.noAssert) {
  35047. if ("number" == typeof t)
  35048. t = e.fromNumber(t);
  35049. else if ("string" == typeof t)
  35050. t = e.fromString(t);
  35051. else if (!(t && t instanceof e))
  35052. throw TypeError("Illegal value: " + t + " (not an integer or Long)");
  35053. if ("number" != typeof i || i % 1 !== 0)
  35054. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35055. if (i >>>= 0,
  35056. i < 0 || i + 0 > this.buffer.byteLength)
  35057. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35058. }
  35059. "number" == typeof t ? t = e.fromNumber(t) : "string" == typeof t && (t = e.fromString(t)),
  35060. i += 8;
  35061. var r = this.buffer.byteLength;
  35062. i > r && this.resize((r *= 2) > i ? r : i),
  35063. i -= 8;
  35064. var o = t.low
  35065. , a = t.high;
  35066. return this.littleEndian ? (this.view[i + 3] = o >>> 24 & 255,
  35067. this.view[i + 2] = o >>> 16 & 255,
  35068. this.view[i + 1] = o >>> 8 & 255,
  35069. this.view[i] = 255 & o,
  35070. i += 4,
  35071. this.view[i + 3] = a >>> 24 & 255,
  35072. this.view[i + 2] = a >>> 16 & 255,
  35073. this.view[i + 1] = a >>> 8 & 255,
  35074. this.view[i] = 255 & a) : (this.view[i] = a >>> 24 & 255,
  35075. this.view[i + 1] = a >>> 16 & 255,
  35076. this.view[i + 2] = a >>> 8 & 255,
  35077. this.view[i + 3] = 255 & a,
  35078. i += 4,
  35079. this.view[i] = o >>> 24 & 255,
  35080. this.view[i + 1] = o >>> 16 & 255,
  35081. this.view[i + 2] = o >>> 8 & 255,
  35082. this.view[i + 3] = 255 & o),
  35083. n && (this.offset += 8),
  35084. this
  35085. }
  35086. ,
  35087. a.writeUInt64 = a.writeUint64,
  35088. a.readUint64 = function(t) {
  35089. var i = "undefined" == typeof t;
  35090. if (i && (t = this.offset),
  35091. !this.noAssert) {
  35092. if ("number" != typeof t || t % 1 !== 0)
  35093. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35094. if (t >>>= 0,
  35095. t < 0 || t + 8 > this.buffer.byteLength)
  35096. throw RangeError("Illegal offset: 0 <= " + t + " (+8) <= " + this.buffer.byteLength)
  35097. }
  35098. var n = 0
  35099. , r = 0;
  35100. this.littleEndian ? (n = this.view[t + 2] << 16,
  35101. n |= this.view[t + 1] << 8,
  35102. n |= this.view[t],
  35103. n += this.view[t + 3] << 24 >>> 0,
  35104. t += 4,
  35105. r = this.view[t + 2] << 16,
  35106. r |= this.view[t + 1] << 8,
  35107. r |= this.view[t],
  35108. r += this.view[t + 3] << 24 >>> 0) : (r = this.view[t + 1] << 16,
  35109. r |= this.view[t + 2] << 8,
  35110. r |= this.view[t + 3],
  35111. r += this.view[t] << 24 >>> 0,
  35112. t += 4,
  35113. n = this.view[t + 1] << 16,
  35114. n |= this.view[t + 2] << 8,
  35115. n |= this.view[t + 3],
  35116. n += this.view[t] << 24 >>> 0);
  35117. var o = new e(n,r,!0);
  35118. return i && (this.offset += 8),
  35119. o
  35120. }
  35121. ,
  35122. a.readUInt64 = a.readUint64),
  35123. a.writeFloat32 = function(e, t) {
  35124. var i = "undefined" == typeof t;
  35125. if (i && (t = this.offset),
  35126. !this.noAssert) {
  35127. if ("number" != typeof e)
  35128. throw TypeError("Illegal value: " + e + " (not a number)");
  35129. if ("number" != typeof t || t % 1 !== 0)
  35130. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35131. if (t >>>= 0,
  35132. t < 0 || t + 0 > this.buffer.byteLength)
  35133. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35134. }
  35135. t += 4;
  35136. var n = this.buffer.byteLength;
  35137. return t > n && this.resize((n *= 2) > t ? n : t),
  35138. t -= 4,
  35139. r(this.view, e, t, this.littleEndian, 23, 4),
  35140. i && (this.offset += 4),
  35141. this
  35142. }
  35143. ,
  35144. a.writeFloat = a.writeFloat32,
  35145. a.readFloat32 = function(e) {
  35146. var t = "undefined" == typeof e;
  35147. if (t && (e = this.offset),
  35148. !this.noAssert) {
  35149. if ("number" != typeof e || e % 1 !== 0)
  35150. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35151. if (e >>>= 0,
  35152. e < 0 || e + 4 > this.buffer.byteLength)
  35153. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35154. }
  35155. var i = n(this.view, e, this.littleEndian, 23, 4);
  35156. return t && (this.offset += 4),
  35157. i
  35158. }
  35159. ,
  35160. a.readFloat = a.readFloat32,
  35161. a.writeFloat64 = function(e, t) {
  35162. var i = "undefined" == typeof t;
  35163. if (i && (t = this.offset),
  35164. !this.noAssert) {
  35165. if ("number" != typeof e)
  35166. throw TypeError("Illegal value: " + e + " (not a number)");
  35167. if ("number" != typeof t || t % 1 !== 0)
  35168. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35169. if (t >>>= 0,
  35170. t < 0 || t + 0 > this.buffer.byteLength)
  35171. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35172. }
  35173. t += 8;
  35174. var n = this.buffer.byteLength;
  35175. return t > n && this.resize((n *= 2) > t ? n : t),
  35176. t -= 8,
  35177. r(this.view, e, t, this.littleEndian, 52, 8),
  35178. i && (this.offset += 8),
  35179. this
  35180. }
  35181. ,
  35182. a.writeDouble = a.writeFloat64,
  35183. a.readFloat64 = function(e) {
  35184. var t = "undefined" == typeof e;
  35185. if (t && (e = this.offset),
  35186. !this.noAssert) {
  35187. if ("number" != typeof e || e % 1 !== 0)
  35188. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35189. if (e >>>= 0,
  35190. e < 0 || e + 8 > this.buffer.byteLength)
  35191. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  35192. }
  35193. var i = n(this.view, e, this.littleEndian, 52, 8);
  35194. return t && (this.offset += 8),
  35195. i
  35196. }
  35197. ,
  35198. a.readDouble = a.readFloat64,
  35199. o.MAX_VARINT32_BYTES = 5,
  35200. o.calculateVarint32 = function(e) {
  35201. return e >>>= 0,
  35202. e < 128 ? 1 : e < 16384 ? 2 : e < 1 << 21 ? 3 : e < 1 << 28 ? 4 : 5
  35203. }
  35204. ,
  35205. o.zigZagEncode32 = function(e) {
  35206. return ((e |= 0) << 1 ^ e >> 31) >>> 0
  35207. }
  35208. ,
  35209. o.zigZagDecode32 = function(e) {
  35210. return e >>> 1 ^ -(1 & e) | 0
  35211. }
  35212. ,
  35213. a.writeVarint32 = function(e, t) {
  35214. var i = "undefined" == typeof t;
  35215. if (i && (t = this.offset),
  35216. !this.noAssert) {
  35217. if ("number" != typeof e || e % 1 !== 0)
  35218. throw TypeError("Illegal value: " + e + " (not an integer)");
  35219. if (e |= 0,
  35220. "number" != typeof t || t % 1 !== 0)
  35221. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35222. if (t >>>= 0,
  35223. t < 0 || t + 0 > this.buffer.byteLength)
  35224. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35225. }
  35226. var n, r = o.calculateVarint32(e);
  35227. t += r;
  35228. var a = this.buffer.byteLength;
  35229. for (t > a && this.resize((a *= 2) > t ? a : t),
  35230. t -= r,
  35231. e >>>= 0; e >= 128; )
  35232. n = 127 & e | 128,
  35233. this.view[t++] = n,
  35234. e >>>= 7;
  35235. return this.view[t++] = e,
  35236. i ? (this.offset = t,
  35237. this) : r
  35238. }
  35239. ,
  35240. a.writeVarint32ZigZag = function(e, t) {
  35241. return this.writeVarint32(o.zigZagEncode32(e), t)
  35242. }
  35243. ,
  35244. a.readVarint32 = function(e) {
  35245. var t = "undefined" == typeof e;
  35246. if (t && (e = this.offset),
  35247. !this.noAssert) {
  35248. if ("number" != typeof e || e % 1 !== 0)
  35249. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35250. if (e >>>= 0,
  35251. e < 0 || e + 1 > this.buffer.byteLength)
  35252. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35253. }
  35254. var i, n = 0, r = 0;
  35255. do {
  35256. if (!this.noAssert && e > this.limit) {
  35257. var o = Error("Truncated");
  35258. throw o.truncated = !0,
  35259. o
  35260. }
  35261. i = this.view[e++],
  35262. n < 5 && (r |= (127 & i) << 7 * n),
  35263. ++n
  35264. } while (0 !== (128 & i));return r |= 0,
  35265. t ? (this.offset = e,
  35266. r) : {
  35267. value: r,
  35268. length: n
  35269. }
  35270. }
  35271. ,
  35272. a.readVarint32ZigZag = function(e) {
  35273. var t = this.readVarint32(e);
  35274. return "object" == typeof t ? t.value = o.zigZagDecode32(t.value) : t = o.zigZagDecode32(t),
  35275. t
  35276. }
  35277. ,
  35278. e && (o.MAX_VARINT64_BYTES = 10,
  35279. o.calculateVarint64 = function(t) {
  35280. "number" == typeof t ? t = e.fromNumber(t) : "string" == typeof t && (t = e.fromString(t));
  35281. var i = t.toInt() >>> 0
  35282. , n = t.shiftRightUnsigned(28).toInt() >>> 0
  35283. , r = t.shiftRightUnsigned(56).toInt() >>> 0;
  35284. return 0 == r ? 0 == n ? i < 16384 ? i < 128 ? 1 : 2 : i < 1 << 21 ? 3 : 4 : n < 16384 ? n < 128 ? 5 : 6 : n < 1 << 21 ? 7 : 8 : r < 128 ? 9 : 10
  35285. }
  35286. ,
  35287. o.zigZagEncode64 = function(t) {
  35288. return "number" == typeof t ? t = e.fromNumber(t, !1) : "string" == typeof t ? t = e.fromString(t, !1) : t.unsigned !== !1 && (t = t.toSigned()),
  35289. t.shiftLeft(1).xor(t.shiftRight(63)).toUnsigned()
  35290. }
  35291. ,
  35292. o.zigZagDecode64 = function(t) {
  35293. return "number" == typeof t ? t = e.fromNumber(t, !1) : "string" == typeof t ? t = e.fromString(t, !1) : t.unsigned !== !1 && (t = t.toSigned()),
  35294. t.shiftRightUnsigned(1).xor(t.and(e.ONE).toSigned().negate()).toSigned()
  35295. }
  35296. ,
  35297. a.writeVarint64 = function(t, i) {
  35298. var n = "undefined" == typeof i;
  35299. if (n && (i = this.offset),
  35300. !this.noAssert) {
  35301. if ("number" == typeof t)
  35302. t = e.fromNumber(t);
  35303. else if ("string" == typeof t)
  35304. t = e.fromString(t);
  35305. else if (!(t && t instanceof e))
  35306. throw TypeError("Illegal value: " + t + " (not an integer or Long)");
  35307. if ("number" != typeof i || i % 1 !== 0)
  35308. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35309. if (i >>>= 0,
  35310. i < 0 || i + 0 > this.buffer.byteLength)
  35311. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35312. }
  35313. "number" == typeof t ? t = e.fromNumber(t, !1) : "string" == typeof t ? t = e.fromString(t, !1) : t.unsigned !== !1 && (t = t.toSigned());
  35314. var r = o.calculateVarint64(t)
  35315. , a = t.toInt() >>> 0
  35316. , s = t.shiftRightUnsigned(28).toInt() >>> 0
  35317. , l = t.shiftRightUnsigned(56).toInt() >>> 0;
  35318. i += r;
  35319. var c = this.buffer.byteLength;
  35320. switch (i > c && this.resize((c *= 2) > i ? c : i),
  35321. i -= r,
  35322. r) {
  35323. case 10:
  35324. this.view[i + 9] = l >>> 7 & 1;
  35325. case 9:
  35326. this.view[i + 8] = 9 !== r ? 128 | l : 127 & l;
  35327. case 8:
  35328. this.view[i + 7] = 8 !== r ? s >>> 21 | 128 : s >>> 21 & 127;
  35329. case 7:
  35330. this.view[i + 6] = 7 !== r ? s >>> 14 | 128 : s >>> 14 & 127;
  35331. case 6:
  35332. this.view[i + 5] = 6 !== r ? s >>> 7 | 128 : s >>> 7 & 127;
  35333. case 5:
  35334. this.view[i + 4] = 5 !== r ? 128 | s : 127 & s;
  35335. case 4:
  35336. this.view[i + 3] = 4 !== r ? a >>> 21 | 128 : a >>> 21 & 127;
  35337. case 3:
  35338. this.view[i + 2] = 3 !== r ? a >>> 14 | 128 : a >>> 14 & 127;
  35339. case 2:
  35340. this.view[i + 1] = 2 !== r ? a >>> 7 | 128 : a >>> 7 & 127;
  35341. case 1:
  35342. this.view[i] = 1 !== r ? 128 | a : 127 & a
  35343. }
  35344. return n ? (this.offset += r,
  35345. this) : r
  35346. }
  35347. ,
  35348. a.writeVarint64ZigZag = function(e, t) {
  35349. return this.writeVarint64(o.zigZagEncode64(e), t)
  35350. }
  35351. ,
  35352. a.readVarint64 = function(t) {
  35353. var i = "undefined" == typeof t;
  35354. if (i && (t = this.offset),
  35355. !this.noAssert) {
  35356. if ("number" != typeof t || t % 1 !== 0)
  35357. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35358. if (t >>>= 0,
  35359. t < 0 || t + 1 > this.buffer.byteLength)
  35360. throw RangeError("Illegal offset: 0 <= " + t + " (+1) <= " + this.buffer.byteLength)
  35361. }
  35362. var n = t
  35363. , r = 0
  35364. , o = 0
  35365. , a = 0
  35366. , s = 0;
  35367. if (s = this.view[t++],
  35368. r = 127 & s,
  35369. 128 & s && (s = this.view[t++],
  35370. r |= (127 & s) << 7,
  35371. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  35372. r |= (127 & s) << 14,
  35373. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  35374. r |= (127 & s) << 21,
  35375. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  35376. o = 127 & s,
  35377. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  35378. o |= (127 & s) << 7,
  35379. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  35380. o |= (127 & s) << 14,
  35381. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  35382. o |= (127 & s) << 21,
  35383. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  35384. a = 127 & s,
  35385. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  35386. a |= (127 & s) << 7,
  35387. 128 & s || this.noAssert && "undefined" == typeof s))))))))))
  35388. throw Error("Buffer overrun");
  35389. var l = e.fromBits(r | o << 28, o >>> 4 | a << 24, !1);
  35390. return i ? (this.offset = t,
  35391. l) : {
  35392. value: l,
  35393. length: t - n
  35394. }
  35395. }
  35396. ,
  35397. a.readVarint64ZigZag = function(t) {
  35398. var i = this.readVarint64(t);
  35399. return i && i.value instanceof e ? i.value = o.zigZagDecode64(i.value) : i = o.zigZagDecode64(i),
  35400. i
  35401. }
  35402. ),
  35403. a.writeCString = function(e, i) {
  35404. var n = "undefined" == typeof i;
  35405. n && (i = this.offset);
  35406. var r, o = e.length;
  35407. if (!this.noAssert) {
  35408. if ("string" != typeof e)
  35409. throw TypeError("Illegal str: Not a string");
  35410. for (r = 0; r < o; ++r)
  35411. if (0 === e.charCodeAt(r))
  35412. throw RangeError("Illegal str: Contains NULL-characters");
  35413. if ("number" != typeof i || i % 1 !== 0)
  35414. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35415. if (i >>>= 0,
  35416. i < 0 || i + 0 > this.buffer.byteLength)
  35417. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35418. }
  35419. o = h.calculateUTF16asUTF8(t(e))[1],
  35420. i += o + 1;
  35421. var a = this.buffer.byteLength;
  35422. return i > a && this.resize((a *= 2) > i ? a : i),
  35423. i -= o + 1,
  35424. h.encodeUTF16toUTF8(t(e), function(e) {
  35425. this.view[i++] = e
  35426. }
  35427. .bind(this)),
  35428. this.view[i++] = 0,
  35429. n ? (this.offset = i,
  35430. this) : o
  35431. }
  35432. ,
  35433. a.readCString = function(e) {
  35434. var t = "undefined" == typeof e;
  35435. if (t && (e = this.offset),
  35436. !this.noAssert) {
  35437. if ("number" != typeof e || e % 1 !== 0)
  35438. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35439. if (e >>>= 0,
  35440. e < 0 || e + 1 > this.buffer.byteLength)
  35441. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35442. }
  35443. var n, r = e, o = -1;
  35444. return h.decodeUTF8toUTF16(function() {
  35445. if (0 === o)
  35446. return null;
  35447. if (e >= this.limit)
  35448. throw RangeError("Illegal range: Truncated data, " + e + " < " + this.limit);
  35449. return o = this.view[e++],
  35450. 0 === o ? null : o
  35451. }
  35452. .bind(this), n = i(), !0),
  35453. t ? (this.offset = e,
  35454. n()) : {
  35455. string: n(),
  35456. length: e - r
  35457. }
  35458. }
  35459. ,
  35460. a.writeIString = function(e, i) {
  35461. var n = "undefined" == typeof i;
  35462. if (n && (i = this.offset),
  35463. !this.noAssert) {
  35464. if ("string" != typeof e)
  35465. throw TypeError("Illegal str: Not a string");
  35466. if ("number" != typeof i || i % 1 !== 0)
  35467. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35468. if (i >>>= 0,
  35469. i < 0 || i + 0 > this.buffer.byteLength)
  35470. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35471. }
  35472. var r, o = i;
  35473. r = h.calculateUTF16asUTF8(t(e), this.noAssert)[1],
  35474. i += 4 + r;
  35475. var a = this.buffer.byteLength;
  35476. if (i > a && this.resize((a *= 2) > i ? a : i),
  35477. i -= 4 + r,
  35478. this.littleEndian ? (this.view[i + 3] = r >>> 24 & 255,
  35479. this.view[i + 2] = r >>> 16 & 255,
  35480. this.view[i + 1] = r >>> 8 & 255,
  35481. this.view[i] = 255 & r) : (this.view[i] = r >>> 24 & 255,
  35482. this.view[i + 1] = r >>> 16 & 255,
  35483. this.view[i + 2] = r >>> 8 & 255,
  35484. this.view[i + 3] = 255 & r),
  35485. i += 4,
  35486. h.encodeUTF16toUTF8(t(e), function(e) {
  35487. this.view[i++] = e
  35488. }
  35489. .bind(this)),
  35490. i !== o + 4 + r)
  35491. throw RangeError("Illegal range: Truncated data, " + i + " == " + (i + 4 + r));
  35492. return n ? (this.offset = i,
  35493. this) : i - o
  35494. }
  35495. ,
  35496. a.readIString = function(e) {
  35497. var t = "undefined" == typeof e;
  35498. if (t && (e = this.offset),
  35499. !this.noAssert) {
  35500. if ("number" != typeof e || e % 1 !== 0)
  35501. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35502. if (e >>>= 0,
  35503. e < 0 || e + 4 > this.buffer.byteLength)
  35504. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35505. }
  35506. var i = e
  35507. , n = this.readUint32(e)
  35508. , r = this.readUTF8String(n, o.METRICS_BYTES, e += 4);
  35509. return e += r.length,
  35510. t ? (this.offset = e,
  35511. r.string) : {
  35512. string: r.string,
  35513. length: e - i
  35514. }
  35515. }
  35516. ,
  35517. o.METRICS_CHARS = "c",
  35518. o.METRICS_BYTES = "b",
  35519. a.writeUTF8String = function(e, i) {
  35520. var n = "undefined" == typeof i;
  35521. if (n && (i = this.offset),
  35522. !this.noAssert) {
  35523. if ("number" != typeof i || i % 1 !== 0)
  35524. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35525. if (i >>>= 0,
  35526. i < 0 || i + 0 > this.buffer.byteLength)
  35527. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35528. }
  35529. var r, o = i;
  35530. r = h.calculateUTF16asUTF8(t(e))[1],
  35531. i += r;
  35532. var a = this.buffer.byteLength;
  35533. return i > a && this.resize((a *= 2) > i ? a : i),
  35534. i -= r,
  35535. h.encodeUTF16toUTF8(t(e), function(e) {
  35536. this.view[i++] = e
  35537. }
  35538. .bind(this)),
  35539. n ? (this.offset = i,
  35540. this) : i - o
  35541. }
  35542. ,
  35543. a.writeString = a.writeUTF8String,
  35544. o.calculateUTF8Chars = function(e) {
  35545. return h.calculateUTF16asUTF8(t(e))[0]
  35546. }
  35547. ,
  35548. o.calculateUTF8Bytes = function(e) {
  35549. return h.calculateUTF16asUTF8(t(e))[1]
  35550. }
  35551. ,
  35552. o.calculateString = o.calculateUTF8Bytes,
  35553. a.readUTF8String = function(e, t, n) {
  35554. "number" == typeof t && (n = t,
  35555. t = void 0);
  35556. var r = "undefined" == typeof n;
  35557. if (r && (n = this.offset),
  35558. "undefined" == typeof t && (t = o.METRICS_CHARS),
  35559. !this.noAssert) {
  35560. if ("number" != typeof e || e % 1 !== 0)
  35561. throw TypeError("Illegal length: " + e + " (not an integer)");
  35562. if (e |= 0,
  35563. "number" != typeof n || n % 1 !== 0)
  35564. throw TypeError("Illegal offset: " + n + " (not an integer)");
  35565. if (n >>>= 0,
  35566. n < 0 || n + 0 > this.buffer.byteLength)
  35567. throw RangeError("Illegal offset: 0 <= " + n + " (+0) <= " + this.buffer.byteLength)
  35568. }
  35569. var a, s = 0, l = n;
  35570. if (t === o.METRICS_CHARS) {
  35571. if (a = i(),
  35572. h.decodeUTF8(function() {
  35573. return s < e && n < this.limit ? this.view[n++] : null
  35574. }
  35575. .bind(this), function(e) {
  35576. ++s,
  35577. h.UTF8toUTF16(e, a)
  35578. }),
  35579. s !== e)
  35580. throw RangeError("Illegal range: Truncated data, " + s + " == " + e);
  35581. return r ? (this.offset = n,
  35582. a()) : {
  35583. string: a(),
  35584. length: n - l
  35585. }
  35586. }
  35587. if (t === o.METRICS_BYTES) {
  35588. if (!this.noAssert) {
  35589. if ("number" != typeof n || n % 1 !== 0)
  35590. throw TypeError("Illegal offset: " + n + " (not an integer)");
  35591. if (n >>>= 0,
  35592. n < 0 || n + e > this.buffer.byteLength)
  35593. throw RangeError("Illegal offset: 0 <= " + n + " (+" + e + ") <= " + this.buffer.byteLength)
  35594. }
  35595. var c = n + e;
  35596. if (h.decodeUTF8toUTF16(function() {
  35597. return n < c ? this.view[n++] : null
  35598. }
  35599. .bind(this), a = i(), this.noAssert),
  35600. n !== c)
  35601. throw RangeError("Illegal range: Truncated data, " + n + " == " + c);
  35602. return r ? (this.offset = n,
  35603. a()) : {
  35604. string: a(),
  35605. length: n - l
  35606. }
  35607. }
  35608. throw TypeError("Unsupported metrics: " + t)
  35609. }
  35610. ,
  35611. a.readString = a.readUTF8String,
  35612. a.writeVString = function(e, i) {
  35613. var n = "undefined" == typeof i;
  35614. if (n && (i = this.offset),
  35615. !this.noAssert) {
  35616. if ("string" != typeof e)
  35617. throw TypeError("Illegal str: Not a string");
  35618. if ("number" != typeof i || i % 1 !== 0)
  35619. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35620. if (i >>>= 0,
  35621. i < 0 || i + 0 > this.buffer.byteLength)
  35622. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35623. }
  35624. var r, a, s = i;
  35625. r = h.calculateUTF16asUTF8(t(e), this.noAssert)[1],
  35626. a = o.calculateVarint32(r),
  35627. i += a + r;
  35628. var l = this.buffer.byteLength;
  35629. if (i > l && this.resize((l *= 2) > i ? l : i),
  35630. i -= a + r,
  35631. i += this.writeVarint32(r, i),
  35632. h.encodeUTF16toUTF8(t(e), function(e) {
  35633. this.view[i++] = e
  35634. }
  35635. .bind(this)),
  35636. i !== s + r + a)
  35637. throw RangeError("Illegal range: Truncated data, " + i + " == " + (i + r + a));
  35638. return n ? (this.offset = i,
  35639. this) : i - s
  35640. }
  35641. ,
  35642. a.readVString = function(e) {
  35643. var t = "undefined" == typeof e;
  35644. if (t && (e = this.offset),
  35645. !this.noAssert) {
  35646. if ("number" != typeof e || e % 1 !== 0)
  35647. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35648. if (e >>>= 0,
  35649. e < 0 || e + 1 > this.buffer.byteLength)
  35650. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35651. }
  35652. var i = e
  35653. , n = this.readVarint32(e)
  35654. , r = this.readUTF8String(n.value, o.METRICS_BYTES, e += n.length);
  35655. return e += r.length,
  35656. t ? (this.offset = e,
  35657. r.string) : {
  35658. string: r.string,
  35659. length: e - i
  35660. }
  35661. }
  35662. ,
  35663. a.append = function(e, t, i) {
  35664. "number" != typeof t && "string" == typeof t || (i = t,
  35665. t = void 0);
  35666. var n = "undefined" == typeof i;
  35667. if (n && (i = this.offset),
  35668. !this.noAssert) {
  35669. if ("number" != typeof i || i % 1 !== 0)
  35670. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35671. if (i >>>= 0,
  35672. i < 0 || i + 0 > this.buffer.byteLength)
  35673. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35674. }
  35675. e instanceof o || (e = o.wrap(e, t));
  35676. var r = e.limit - e.offset;
  35677. if (r <= 0)
  35678. return this;
  35679. i += r;
  35680. var a = this.buffer.byteLength;
  35681. return i > a && this.resize((a *= 2) > i ? a : i),
  35682. i -= r,
  35683. this.view.set(e.view.subarray(e.offset, e.limit), i),
  35684. e.offset += r,
  35685. n && (this.offset += r),
  35686. this
  35687. }
  35688. ,
  35689. a.appendTo = function(e, t) {
  35690. return e.append(this, t),
  35691. this
  35692. }
  35693. ,
  35694. a.assert = function(e) {
  35695. return this.noAssert = !e,
  35696. this
  35697. }
  35698. ,
  35699. a.capacity = function() {
  35700. return this.buffer.byteLength
  35701. }
  35702. ,
  35703. a.clear = function() {
  35704. return this.offset = 0,
  35705. this.limit = this.buffer.byteLength,
  35706. this.markedOffset = -1,
  35707. this
  35708. }
  35709. ,
  35710. a.clone = function(e) {
  35711. var t = new o(0,this.littleEndian,this.noAssert);
  35712. return e ? (t.buffer = new ArrayBuffer(this.buffer.byteLength),
  35713. t.view = new Uint8Array(t.buffer)) : (t.buffer = this.buffer,
  35714. t.view = this.view),
  35715. t.offset = this.offset,
  35716. t.markedOffset = this.markedOffset,
  35717. t.limit = this.limit,
  35718. t
  35719. }
  35720. ,
  35721. a.compact = function(e, t) {
  35722. if ("undefined" == typeof e && (e = this.offset),
  35723. "undefined" == typeof t && (t = this.limit),
  35724. !this.noAssert) {
  35725. if ("number" != typeof e || e % 1 !== 0)
  35726. throw TypeError("Illegal begin: Not an integer");
  35727. if (e >>>= 0,
  35728. "number" != typeof t || t % 1 !== 0)
  35729. throw TypeError("Illegal end: Not an integer");
  35730. if (t >>>= 0,
  35731. e < 0 || e > t || t > this.buffer.byteLength)
  35732. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35733. }
  35734. if (0 === e && t === this.buffer.byteLength)
  35735. return this;
  35736. var i = t - e;
  35737. if (0 === i)
  35738. return this.buffer = s,
  35739. this.view = null,
  35740. this.markedOffset >= 0 && (this.markedOffset -= e),
  35741. this.offset = 0,
  35742. this.limit = 0,
  35743. this;
  35744. var n = new ArrayBuffer(i)
  35745. , r = new Uint8Array(n);
  35746. return r.set(this.view.subarray(e, t)),
  35747. this.buffer = n,
  35748. this.view = r,
  35749. this.markedOffset >= 0 && (this.markedOffset -= e),
  35750. this.offset = 0,
  35751. this.limit = i,
  35752. this
  35753. }
  35754. ,
  35755. a.copy = function(e, t) {
  35756. if ("undefined" == typeof e && (e = this.offset),
  35757. "undefined" == typeof t && (t = this.limit),
  35758. !this.noAssert) {
  35759. if ("number" != typeof e || e % 1 !== 0)
  35760. throw TypeError("Illegal begin: Not an integer");
  35761. if (e >>>= 0,
  35762. "number" != typeof t || t % 1 !== 0)
  35763. throw TypeError("Illegal end: Not an integer");
  35764. if (t >>>= 0,
  35765. e < 0 || e > t || t > this.buffer.byteLength)
  35766. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35767. }
  35768. if (e === t)
  35769. return new o(0,this.littleEndian,this.noAssert);
  35770. var i = t - e
  35771. , n = new o(i,this.littleEndian,this.noAssert);
  35772. return n.offset = 0,
  35773. n.limit = i,
  35774. n.markedOffset >= 0 && (n.markedOffset -= e),
  35775. this.copyTo(n, 0, e, t),
  35776. n
  35777. }
  35778. ,
  35779. a.copyTo = function(e, t, i, n) {
  35780. var r, a;
  35781. if (!this.noAssert && !o.isByteBuffer(e))
  35782. throw TypeError("Illegal target: Not a ByteBuffer");
  35783. if (t = (a = "undefined" == typeof t) ? e.offset : 0 | t,
  35784. i = (r = "undefined" == typeof i) ? this.offset : 0 | i,
  35785. n = "undefined" == typeof n ? this.limit : 0 | n,
  35786. t < 0 || t > e.buffer.byteLength)
  35787. throw RangeError("Illegal target range: 0 <= " + t + " <= " + e.buffer.byteLength);
  35788. if (i < 0 || n > this.buffer.byteLength)
  35789. throw RangeError("Illegal source range: 0 <= " + i + " <= " + this.buffer.byteLength);
  35790. var s = n - i;
  35791. return 0 === s ? e : (e.ensureCapacity(t + s),
  35792. e.view.set(this.view.subarray(i, n), t),
  35793. r && (this.offset += s),
  35794. a && (e.offset += s),
  35795. this)
  35796. }
  35797. ,
  35798. a.ensureCapacity = function(e) {
  35799. var t = this.buffer.byteLength;
  35800. return t < e ? this.resize((t *= 2) > e ? t : e) : this
  35801. }
  35802. ,
  35803. a.fill = function(e, t, i) {
  35804. var n = "undefined" == typeof t;
  35805. if (n && (t = this.offset),
  35806. "string" == typeof e && e.length > 0 && (e = e.charCodeAt(0)),
  35807. "undefined" == typeof t && (t = this.offset),
  35808. "undefined" == typeof i && (i = this.limit),
  35809. !this.noAssert) {
  35810. if ("number" != typeof e || e % 1 !== 0)
  35811. throw TypeError("Illegal value: " + e + " (not an integer)");
  35812. if (e |= 0,
  35813. "number" != typeof t || t % 1 !== 0)
  35814. throw TypeError("Illegal begin: Not an integer");
  35815. if (t >>>= 0,
  35816. "number" != typeof i || i % 1 !== 0)
  35817. throw TypeError("Illegal end: Not an integer");
  35818. if (i >>>= 0,
  35819. t < 0 || t > i || i > this.buffer.byteLength)
  35820. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  35821. }
  35822. if (t >= i)
  35823. return this;
  35824. for (; t < i; )
  35825. this.view[t++] = e;
  35826. return n && (this.offset = t),
  35827. this
  35828. }
  35829. ,
  35830. a.flip = function() {
  35831. return this.limit = this.offset,
  35832. this.offset = 0,
  35833. this
  35834. }
  35835. ,
  35836. a.mark = function(e) {
  35837. if (e = "undefined" == typeof e ? this.offset : e,
  35838. !this.noAssert) {
  35839. if ("number" != typeof e || e % 1 !== 0)
  35840. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35841. if (e >>>= 0,
  35842. e < 0 || e + 0 > this.buffer.byteLength)
  35843. throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
  35844. }
  35845. return this.markedOffset = e,
  35846. this
  35847. }
  35848. ,
  35849. a.order = function(e) {
  35850. if (!this.noAssert && "boolean" != typeof e)
  35851. throw TypeError("Illegal littleEndian: Not a boolean");
  35852. return this.littleEndian = !!e,
  35853. this
  35854. }
  35855. ,
  35856. a.LE = function(e) {
  35857. return this.littleEndian = "undefined" == typeof e || !!e,
  35858. this
  35859. }
  35860. ,
  35861. a.BE = function(e) {
  35862. return this.littleEndian = "undefined" != typeof e && !e,
  35863. this
  35864. }
  35865. ,
  35866. a.prepend = function(e, t, i) {
  35867. "number" != typeof t && "string" == typeof t || (i = t,
  35868. t = void 0);
  35869. var n = "undefined" == typeof i;
  35870. if (n && (i = this.offset),
  35871. !this.noAssert) {
  35872. if ("number" != typeof i || i % 1 !== 0)
  35873. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35874. if (i >>>= 0,
  35875. i < 0 || i + 0 > this.buffer.byteLength)
  35876. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35877. }
  35878. e instanceof o || (e = o.wrap(e, t));
  35879. var r = e.limit - e.offset;
  35880. if (r <= 0)
  35881. return this;
  35882. var a = r - i;
  35883. if (a > 0) {
  35884. var s = new ArrayBuffer(this.buffer.byteLength + a)
  35885. , l = new Uint8Array(s);
  35886. l.set(this.view.subarray(i, this.buffer.byteLength), r),
  35887. this.buffer = s,
  35888. this.view = l,
  35889. this.offset += a,
  35890. this.markedOffset >= 0 && (this.markedOffset += a),
  35891. this.limit += a,
  35892. i += a
  35893. } else {
  35894. new Uint8Array(this.buffer)
  35895. }
  35896. return this.view.set(e.view.subarray(e.offset, e.limit), i - r),
  35897. e.offset = e.limit,
  35898. n && (this.offset -= r),
  35899. this
  35900. }
  35901. ,
  35902. a.prependTo = function(e, t) {
  35903. return e.prepend(this, t),
  35904. this
  35905. }
  35906. ,
  35907. a.printDebug = function(e) {
  35908. "function" != typeof e && (e = console.log.bind(console)),
  35909. e(this.toString() + "\n-------------------------------------------------------------------\n" + this.toDebug(!0))
  35910. }
  35911. ,
  35912. a.remaining = function() {
  35913. return this.limit - this.offset
  35914. }
  35915. ,
  35916. a.reset = function() {
  35917. return this.markedOffset >= 0 ? (this.offset = this.markedOffset,
  35918. this.markedOffset = -1) : this.offset = 0,
  35919. this
  35920. }
  35921. ,
  35922. a.resize = function(e) {
  35923. if (!this.noAssert) {
  35924. if ("number" != typeof e || e % 1 !== 0)
  35925. throw TypeError("Illegal capacity: " + e + " (not an integer)");
  35926. if (e |= 0,
  35927. e < 0)
  35928. throw RangeError("Illegal capacity: 0 <= " + e)
  35929. }
  35930. if (this.buffer.byteLength < e) {
  35931. var t = new ArrayBuffer(e)
  35932. , i = new Uint8Array(t);
  35933. i.set(this.view),
  35934. this.buffer = t,
  35935. this.view = i
  35936. }
  35937. return this
  35938. }
  35939. ,
  35940. a.reverse = function(e, t) {
  35941. if ("undefined" == typeof e && (e = this.offset),
  35942. "undefined" == typeof t && (t = this.limit),
  35943. !this.noAssert) {
  35944. if ("number" != typeof e || e % 1 !== 0)
  35945. throw TypeError("Illegal begin: Not an integer");
  35946. if (e >>>= 0,
  35947. "number" != typeof t || t % 1 !== 0)
  35948. throw TypeError("Illegal end: Not an integer");
  35949. if (t >>>= 0,
  35950. e < 0 || e > t || t > this.buffer.byteLength)
  35951. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35952. }
  35953. return e === t ? this : (Array.prototype.reverse.call(this.view.subarray(e, t)),
  35954. this)
  35955. }
  35956. ,
  35957. a.skip = function(e) {
  35958. if (!this.noAssert) {
  35959. if ("number" != typeof e || e % 1 !== 0)
  35960. throw TypeError("Illegal length: " + e + " (not an integer)");
  35961. e |= 0
  35962. }
  35963. var t = this.offset + e;
  35964. if (!this.noAssert && (t < 0 || t > this.buffer.byteLength))
  35965. throw RangeError("Illegal length: 0 <= " + this.offset + " + " + e + " <= " + this.buffer.byteLength);
  35966. return this.offset = t,
  35967. this
  35968. }
  35969. ,
  35970. a.slice = function(e, t) {
  35971. if ("undefined" == typeof e && (e = this.offset),
  35972. "undefined" == typeof t && (t = this.limit),
  35973. !this.noAssert) {
  35974. if ("number" != typeof e || e % 1 !== 0)
  35975. throw TypeError("Illegal begin: Not an integer");
  35976. if (e >>>= 0,
  35977. "number" != typeof t || t % 1 !== 0)
  35978. throw TypeError("Illegal end: Not an integer");
  35979. if (t >>>= 0,
  35980. e < 0 || e > t || t > this.buffer.byteLength)
  35981. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35982. }
  35983. var i = this.clone();
  35984. return i.offset = e,
  35985. i.limit = t,
  35986. i
  35987. }
  35988. ,
  35989. a.toBuffer = function(e) {
  35990. var t = this.offset
  35991. , i = this.limit;
  35992. if (!this.noAssert) {
  35993. if ("number" != typeof t || t % 1 !== 0)
  35994. throw TypeError("Illegal offset: Not an integer");
  35995. if (t >>>= 0,
  35996. "number" != typeof i || i % 1 !== 0)
  35997. throw TypeError("Illegal limit: Not an integer");
  35998. if (i >>>= 0,
  35999. t < 0 || t > i || i > this.buffer.byteLength)
  36000. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  36001. }
  36002. if (!e && 0 === t && i === this.buffer.byteLength)
  36003. return this.buffer;
  36004. if (t === i)
  36005. return s;
  36006. var n = new ArrayBuffer(i - t);
  36007. return new Uint8Array(n).set(new Uint8Array(this.buffer).subarray(t, i), 0),
  36008. n
  36009. }
  36010. ,
  36011. a.toArrayBuffer = a.toBuffer,
  36012. a.toString = function(e, t, i) {
  36013. if ("undefined" == typeof e)
  36014. return "ByteBufferAB(offset=" + this.offset + ",markedOffset=" + this.markedOffset + ",limit=" + this.limit + ",capacity=" + this.capacity() + ")";
  36015. switch ("number" == typeof e && (e = "utf8",
  36016. t = e,
  36017. i = t),
  36018. e) {
  36019. case "utf8":
  36020. return this.toUTF8(t, i);
  36021. case "base64":
  36022. return this.toBase64(t, i);
  36023. case "hex":
  36024. return this.toHex(t, i);
  36025. case "binary":
  36026. return this.toBinary(t, i);
  36027. case "debug":
  36028. return this.toDebug();
  36029. case "columns":
  36030. return this.toColumns();
  36031. default:
  36032. throw Error("Unsupported encoding: " + e)
  36033. }
  36034. }
  36035. ;
  36036. var c = function() {
  36037. for (var e = {}, t = [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], i = [], n = 0, r = t.length; n < r; ++n)
  36038. i[t[n]] = n;
  36039. return e.encode = function(e, i) {
  36040. for (var n, r; null !== (n = e()); )
  36041. i(t[n >> 2 & 63]),
  36042. r = (3 & n) << 4,
  36043. null !== (n = e()) ? (r |= n >> 4 & 15,
  36044. i(t[63 & (r | n >> 4 & 15)]),
  36045. r = (15 & n) << 2,
  36046. null !== (n = e()) ? (i(t[63 & (r | n >> 6 & 3)]),
  36047. i(t[63 & n])) : (i(t[63 & r]),
  36048. i(61))) : (i(t[63 & r]),
  36049. i(61),
  36050. i(61))
  36051. }
  36052. ,
  36053. e.decode = function(e, t) {
  36054. function n(e) {
  36055. throw Error("Illegal character code: " + e)
  36056. }
  36057. for (var r, o, a; null !== (r = e()); )
  36058. if (o = i[r],
  36059. "undefined" == typeof o && n(r),
  36060. null !== (r = e()) && (a = i[r],
  36061. "undefined" == typeof a && n(r),
  36062. t(o << 2 >>> 0 | (48 & a) >> 4),
  36063. null !== (r = e()))) {
  36064. if (o = i[r],
  36065. "undefined" == typeof o) {
  36066. if (61 === r)
  36067. break;
  36068. n(r)
  36069. }
  36070. if (t((15 & a) << 4 >>> 0 | (60 & o) >> 2),
  36071. null !== (r = e())) {
  36072. if (a = i[r],
  36073. "undefined" == typeof a) {
  36074. if (61 === r)
  36075. break;
  36076. n(r)
  36077. }
  36078. t((3 & o) << 6 >>> 0 | a)
  36079. }
  36080. }
  36081. }
  36082. ,
  36083. e.test = function(e) {
  36084. return /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)
  36085. }
  36086. ,
  36087. e
  36088. }();
  36089. a.toBase64 = function(e, t) {
  36090. if ("undefined" == typeof e && (e = this.offset),
  36091. "undefined" == typeof t && (t = this.limit),
  36092. e |= 0,
  36093. t |= 0,
  36094. e < 0 || t > this.capacity || e > t)
  36095. throw RangeError("begin, end");
  36096. var n;
  36097. return c.encode(function() {
  36098. return e < t ? this.view[e++] : null
  36099. }
  36100. .bind(this), n = i()),
  36101. n()
  36102. }
  36103. ,
  36104. o.fromBase64 = function(e, i) {
  36105. if ("string" != typeof e)
  36106. throw TypeError("str");
  36107. var n = new o(e.length / 4 * 3,i)
  36108. , r = 0;
  36109. return c.decode(t(e), function(e) {
  36110. n.view[r++] = e
  36111. }),
  36112. n.limit = r,
  36113. n
  36114. }
  36115. ,
  36116. o.btoa = function(e) {
  36117. return o.fromBinary(e).toBase64()
  36118. }
  36119. ,
  36120. o.atob = function(e) {
  36121. return o.fromBase64(e).toBinary()
  36122. }
  36123. ,
  36124. a.toBinary = function(e, t) {
  36125. if ("undefined" == typeof e && (e = this.offset),
  36126. "undefined" == typeof t && (t = this.limit),
  36127. e |= 0,
  36128. t |= 0,
  36129. e < 0 || t > this.capacity() || e > t)
  36130. throw RangeError("begin, end");
  36131. if (e === t)
  36132. return "";
  36133. for (var i = [], n = []; e < t; )
  36134. i.push(this.view[e++]),
  36135. i.length >= 1024 && (n.push(String.fromCharCode.apply(String, i)),
  36136. i = []);
  36137. return n.join("") + String.fromCharCode.apply(String, i)
  36138. }
  36139. ,
  36140. o.fromBinary = function(e, t) {
  36141. if ("string" != typeof e)
  36142. throw TypeError("str");
  36143. for (var i, n = 0, r = e.length, a = new o(r,t); n < r; ) {
  36144. if (i = e.charCodeAt(n),
  36145. i > 255)
  36146. throw RangeError("illegal char code: " + i);
  36147. a.view[n++] = i
  36148. }
  36149. return a.limit = r,
  36150. a
  36151. }
  36152. ,
  36153. a.toDebug = function(e) {
  36154. for (var t, i = -1, n = this.buffer.byteLength, r = "", o = "", a = ""; i < n; ) {
  36155. if (i !== -1 && (t = this.view[i],
  36156. r += t < 16 ? "0" + t.toString(16).toUpperCase() : t.toString(16).toUpperCase(),
  36157. e && (o += t > 32 && t < 127 ? String.fromCharCode(t) : ".")),
  36158. ++i,
  36159. e && i > 0 && i % 16 === 0 && i !== n) {
  36160. for (; r.length < 51; )
  36161. r += " ";
  36162. a += r + o + "\n",
  36163. r = o = ""
  36164. }
  36165. 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 ? " " : ""
  36166. }
  36167. if (e && " " !== r) {
  36168. for (; r.length < 51; )
  36169. r += " ";
  36170. a += r + o + "\n"
  36171. }
  36172. return e ? a : r
  36173. }
  36174. ,
  36175. o.fromDebug = function(e, t, i) {
  36176. for (var n, r, a = e.length, s = new o((a + 1) / 3 | 0,t,i), l = 0, c = 0, h = !1, u = !1, d = !1, p = !1, f = !1; l < a; ) {
  36177. switch (n = e.charAt(l++)) {
  36178. case "!":
  36179. if (!i) {
  36180. if (u || d || p) {
  36181. f = !0;
  36182. break
  36183. }
  36184. u = d = p = !0
  36185. }
  36186. s.offset = s.markedOffset = s.limit = c,
  36187. h = !1;
  36188. break;
  36189. case "|":
  36190. if (!i) {
  36191. if (u || p) {
  36192. f = !0;
  36193. break
  36194. }
  36195. u = p = !0
  36196. }
  36197. s.offset = s.limit = c,
  36198. h = !1;
  36199. break;
  36200. case "[":
  36201. if (!i) {
  36202. if (u || d) {
  36203. f = !0;
  36204. break
  36205. }
  36206. u = d = !0
  36207. }
  36208. s.offset = s.markedOffset = c,
  36209. h = !1;
  36210. break;
  36211. case "<":
  36212. if (!i) {
  36213. if (u) {
  36214. f = !0;
  36215. break
  36216. }
  36217. u = !0
  36218. }
  36219. s.offset = c,
  36220. h = !1;
  36221. break;
  36222. case "]":
  36223. if (!i) {
  36224. if (p || d) {
  36225. f = !0;
  36226. break
  36227. }
  36228. p = d = !0
  36229. }
  36230. s.limit = s.markedOffset = c,
  36231. h = !1;
  36232. break;
  36233. case ">":
  36234. if (!i) {
  36235. if (p) {
  36236. f = !0;
  36237. break
  36238. }
  36239. p = !0
  36240. }
  36241. s.limit = c,
  36242. h = !1;
  36243. break;
  36244. case "'":
  36245. if (!i) {
  36246. if (d) {
  36247. f = !0;
  36248. break
  36249. }
  36250. d = !0
  36251. }
  36252. s.markedOffset = c,
  36253. h = !1;
  36254. break;
  36255. case " ":
  36256. h = !1;
  36257. break;
  36258. default:
  36259. if (!i && h) {
  36260. f = !0;
  36261. break
  36262. }
  36263. if (r = parseInt(n + e.charAt(l++), 16),
  36264. !i && (isNaN(r) || r < 0 || r > 255))
  36265. throw TypeError("Illegal str: Not a debug encoded string");
  36266. s.view[c++] = r,
  36267. h = !0
  36268. }
  36269. if (f)
  36270. throw TypeError("Illegal str: Invalid symbol at " + l)
  36271. }
  36272. if (!i) {
  36273. if (!u || !p)
  36274. throw TypeError("Illegal str: Missing offset or limit");
  36275. if (c < s.buffer.byteLength)
  36276. throw TypeError("Illegal str: Not a debug encoded string (is it hex?) " + c + " < " + a)
  36277. }
  36278. return s
  36279. }
  36280. ,
  36281. a.toHex = function(e, t) {
  36282. if (e = "undefined" == typeof e ? this.offset : e,
  36283. t = "undefined" == typeof t ? this.limit : t,
  36284. !this.noAssert) {
  36285. if ("number" != typeof e || e % 1 !== 0)
  36286. throw TypeError("Illegal begin: Not an integer");
  36287. if (e >>>= 0,
  36288. "number" != typeof t || t % 1 !== 0)
  36289. throw TypeError("Illegal end: Not an integer");
  36290. if (t >>>= 0,
  36291. e < 0 || e > t || t > this.buffer.byteLength)
  36292. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  36293. }
  36294. for (var i, n = new Array(t - e); e < t; )
  36295. i = this.view[e++],
  36296. i < 16 ? n.push("0", i.toString(16)) : n.push(i.toString(16));
  36297. return n.join("")
  36298. }
  36299. ,
  36300. o.fromHex = function(e, t, i) {
  36301. if (!i) {
  36302. if ("string" != typeof e)
  36303. throw TypeError("Illegal str: Not a string");
  36304. if (e.length % 2 !== 0)
  36305. throw TypeError("Illegal str: Length not a multiple of 2")
  36306. }
  36307. for (var n, r = e.length, a = new o(r / 2 | 0,t), s = 0, l = 0; s < r; s += 2) {
  36308. if (n = parseInt(e.substring(s, s + 2), 16),
  36309. !i && (!isFinite(n) || n < 0 || n > 255))
  36310. throw TypeError("Illegal str: Contains non-hex characters");
  36311. a.view[l++] = n
  36312. }
  36313. return a.limit = l,
  36314. a
  36315. }
  36316. ;
  36317. var h = function() {
  36318. var e = {};
  36319. return e.MAX_CODEPOINT = 1114111,
  36320. e.encodeUTF8 = function(e, t) {
  36321. var i = null;
  36322. for ("number" == typeof e && (i = e,
  36323. e = function() {
  36324. return null
  36325. }
  36326. ); null !== i || null !== (i = e()); )
  36327. i < 128 ? t(127 & i) : i < 2048 ? (t(i >> 6 & 31 | 192),
  36328. t(63 & i | 128)) : i < 65536 ? (t(i >> 12 & 15 | 224),
  36329. t(i >> 6 & 63 | 128),
  36330. t(63 & i | 128)) : (t(i >> 18 & 7 | 240),
  36331. t(i >> 12 & 63 | 128),
  36332. t(i >> 6 & 63 | 128),
  36333. t(63 & i | 128)),
  36334. i = null
  36335. }
  36336. ,
  36337. e.decodeUTF8 = function(e, t) {
  36338. for (var i, n, r, o, a = function(e) {
  36339. e = e.slice(0, e.indexOf(null));
  36340. var t = Error(e.toString());
  36341. throw t.name = "TruncatedError",
  36342. t.bytes = e,
  36343. t
  36344. }; null !== (i = e()); )
  36345. if (0 === (128 & i))
  36346. t(i);
  36347. else if (192 === (224 & i))
  36348. null === (n = e()) && a([i, n]),
  36349. t((31 & i) << 6 | 63 & n);
  36350. else if (224 === (240 & i))
  36351. (null === (n = e()) || null === (r = e())) && a([i, n, r]),
  36352. t((15 & i) << 12 | (63 & n) << 6 | 63 & r);
  36353. else {
  36354. if (240 !== (248 & i))
  36355. throw RangeError("Illegal starting byte: " + i);
  36356. (null === (n = e()) || null === (r = e()) || null === (o = e())) && a([i, n, r, o]),
  36357. t((7 & i) << 18 | (63 & n) << 12 | (63 & r) << 6 | 63 & o)
  36358. }
  36359. }
  36360. ,
  36361. e.UTF16toUTF8 = function(e, t) {
  36362. for (var i, n = null; ; ) {
  36363. if (null === (i = null !== n ? n : e()))
  36364. break;
  36365. i >= 55296 && i <= 57343 && null !== (n = e()) && n >= 56320 && n <= 57343 ? (t(1024 * (i - 55296) + n - 56320 + 65536),
  36366. n = null) : t(i)
  36367. }
  36368. null !== n && t(n)
  36369. }
  36370. ,
  36371. e.UTF8toUTF16 = function(e, t) {
  36372. var i = null;
  36373. for ("number" == typeof e && (i = e,
  36374. e = function() {
  36375. return null
  36376. }
  36377. ); null !== i || null !== (i = e()); )
  36378. i <= 65535 ? t(i) : (i -= 65536,
  36379. t((i >> 10) + 55296),
  36380. t(i % 1024 + 56320)),
  36381. i = null
  36382. }
  36383. ,
  36384. e.encodeUTF16toUTF8 = function(t, i) {
  36385. e.UTF16toUTF8(t, function(t) {
  36386. e.encodeUTF8(t, i)
  36387. })
  36388. }
  36389. ,
  36390. e.decodeUTF8toUTF16 = function(t, i) {
  36391. e.decodeUTF8(t, function(t) {
  36392. e.UTF8toUTF16(t, i)
  36393. })
  36394. }
  36395. ,
  36396. e.calculateCodePoint = function(e) {
  36397. return e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  36398. }
  36399. ,
  36400. e.calculateUTF8 = function(e) {
  36401. for (var t, i = 0; null !== (t = e()); )
  36402. i += t < 128 ? 1 : t < 2048 ? 2 : t < 65536 ? 3 : 4;
  36403. return i
  36404. }
  36405. ,
  36406. e.calculateUTF16asUTF8 = function(t) {
  36407. var i = 0
  36408. , n = 0;
  36409. return e.UTF16toUTF8(t, function(e) {
  36410. ++i,
  36411. n += e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  36412. }),
  36413. [i, n]
  36414. }
  36415. ,
  36416. e
  36417. }();
  36418. return a.toUTF8 = function(e, t) {
  36419. if ("undefined" == typeof e && (e = this.offset),
  36420. "undefined" == typeof t && (t = this.limit),
  36421. !this.noAssert) {
  36422. if ("number" != typeof e || e % 1 !== 0)
  36423. throw TypeError("Illegal begin: Not an integer");
  36424. if (e >>>= 0,
  36425. "number" != typeof t || t % 1 !== 0)
  36426. throw TypeError("Illegal end: Not an integer");
  36427. if (t >>>= 0,
  36428. e < 0 || e > t || t > this.buffer.byteLength)
  36429. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  36430. }
  36431. var n;
  36432. try {
  36433. h.decodeUTF8toUTF16(function() {
  36434. return e < t ? this.view[e++] : null
  36435. }
  36436. .bind(this), n = i())
  36437. } catch (i) {
  36438. if (e !== t)
  36439. throw RangeError("Illegal range: Truncated data, " + e + " != " + t)
  36440. }
  36441. return n()
  36442. }
  36443. ,
  36444. o.fromUTF8 = function(e, i, n) {
  36445. if (!n && "string" != typeof e)
  36446. throw TypeError("Illegal str: Not a string");
  36447. var r = new o(h.calculateUTF16asUTF8(t(e), !0)[1],i,n)
  36448. , a = 0;
  36449. return h.encodeUTF16toUTF8(t(e), function(e) {
  36450. r.view[a++] = e
  36451. }),
  36452. r.limit = a,
  36453. r
  36454. }
  36455. ,
  36456. o
  36457. })
  36458. }
  36459. , {
  36460. long: 216
  36461. }],
  36462. 216: [function(e, t, i) {
  36463. !function(i, n) {
  36464. "function" == typeof define && define.amd ? define([], n) : "function" == typeof e && "object" == typeof t && t && t.exports ? t.exports = n() : (i.dcodeIO = i.dcodeIO || {}).Long = n()
  36465. }(this, function() {
  36466. "use strict";
  36467. function e(e, t, i) {
  36468. this.low = 0 | e,
  36469. this.high = 0 | t,
  36470. this.unsigned = !!i
  36471. }
  36472. function t(e) {
  36473. return (e && e.__isLong__) === !0
  36474. }
  36475. function i(e, t) {
  36476. var i, n, o;
  36477. return t ? (e >>>= 0,
  36478. (o = 0 <= e && e < 256) && (n = l[e]) ? n : (i = r(e, (0 | e) < 0 ? -1 : 0, !0),
  36479. o && (l[e] = i),
  36480. i)) : (e |= 0,
  36481. (o = -128 <= e && e < 128) && (n = s[e]) ? n : (i = r(e, e < 0 ? -1 : 0, !1),
  36482. o && (s[e] = i),
  36483. i))
  36484. }
  36485. function n(e, t) {
  36486. if (isNaN(e) || !isFinite(e))
  36487. return t ? m : g;
  36488. if (t) {
  36489. if (e < 0)
  36490. return m;
  36491. if (e >= d)
  36492. return I
  36493. } else {
  36494. if (e <= -p)
  36495. return E;
  36496. if (e + 1 >= p)
  36497. return C
  36498. }
  36499. return e < 0 ? n(-e, t).neg() : r(e % u | 0, e / u | 0, t)
  36500. }
  36501. function r(t, i, n) {
  36502. return new e(t,i,n)
  36503. }
  36504. function o(e, t, i) {
  36505. if (0 === e.length)
  36506. throw Error("empty string");
  36507. if ("NaN" === e || "Infinity" === e || "+Infinity" === e || "-Infinity" === e)
  36508. return g;
  36509. if ("number" == typeof t ? (i = t,
  36510. t = !1) : t = !!t,
  36511. i = i || 10,
  36512. i < 2 || 36 < i)
  36513. throw RangeError("radix");
  36514. var r;
  36515. if ((r = e.indexOf("-")) > 0)
  36516. throw Error("interior hyphen");
  36517. if (0 === r)
  36518. return o(e.substring(1), t, i).neg();
  36519. for (var a = n(c(i, 8)), s = g, l = 0; l < e.length; l += 8) {
  36520. var h = Math.min(8, e.length - l)
  36521. , u = parseInt(e.substring(l, l + h), i);
  36522. if (h < 8) {
  36523. var d = n(c(i, h));
  36524. s = s.mul(d).add(n(u))
  36525. } else
  36526. s = s.mul(a),
  36527. s = s.add(n(u))
  36528. }
  36529. return s.unsigned = t,
  36530. s
  36531. }
  36532. function a(t) {
  36533. return t instanceof e ? t : "number" == typeof t ? n(t) : "string" == typeof t ? o(t) : r(t.low, t.high, t.unsigned)
  36534. }
  36535. e.prototype.__isLong__,
  36536. Object.defineProperty(e.prototype, "__isLong__", {
  36537. value: !0,
  36538. enumerable: !1,
  36539. configurable: !1
  36540. }),
  36541. e.isLong = t;
  36542. var s = {}
  36543. , l = {};
  36544. e.fromInt = i,
  36545. e.fromNumber = n,
  36546. e.fromBits = r;
  36547. var c = Math.pow;
  36548. e.fromString = o,
  36549. e.fromValue = a;
  36550. var h = 1 << 24
  36551. , u = 4294967296
  36552. , d = 0x10000000000000000
  36553. , p = d / 2
  36554. , f = i(h)
  36555. , g = i(0);
  36556. e.ZERO = g;
  36557. var m = i(0, !0);
  36558. e.UZERO = m;
  36559. var v = i(1);
  36560. e.ONE = v;
  36561. var A = i(1, !0);
  36562. e.UONE = A;
  36563. var y = i(-1);
  36564. e.NEG_ONE = y;
  36565. var C = r(-1, 2147483647, !1);
  36566. e.MAX_VALUE = C;
  36567. var I = r(-1, -1, !0);
  36568. e.MAX_UNSIGNED_VALUE = I;
  36569. var E = r(0, -2147483648, !1);
  36570. e.MIN_VALUE = E;
  36571. var b = e.prototype;
  36572. return b.toInt = function() {
  36573. return this.unsigned ? this.low >>> 0 : this.low
  36574. }
  36575. ,
  36576. b.toNumber = function() {
  36577. return this.unsigned ? (this.high >>> 0) * u + (this.low >>> 0) : this.high * u + (this.low >>> 0)
  36578. }
  36579. ,
  36580. b.toString = function(e) {
  36581. if (e = e || 10,
  36582. e < 2 || 36 < e)
  36583. throw RangeError("radix");
  36584. if (this.isZero())
  36585. return "0";
  36586. if (this.isNegative()) {
  36587. if (this.eq(E)) {
  36588. var t = n(e)
  36589. , i = this.div(t)
  36590. , r = i.mul(t).sub(this);
  36591. return i.toString(e) + r.toInt().toString(e)
  36592. }
  36593. return "-" + this.neg().toString(e)
  36594. }
  36595. for (var o = n(c(e, 6), this.unsigned), a = this, s = ""; ; ) {
  36596. var l = a.div(o)
  36597. , h = a.sub(l.mul(o)).toInt() >>> 0
  36598. , u = h.toString(e);
  36599. if (a = l,
  36600. a.isZero())
  36601. return u + s;
  36602. for (; u.length < 6; )
  36603. u = "0" + u;
  36604. s = "" + u + s
  36605. }
  36606. }
  36607. ,
  36608. b.getHighBits = function() {
  36609. return this.high
  36610. }
  36611. ,
  36612. b.getHighBitsUnsigned = function() {
  36613. return this.high >>> 0
  36614. }
  36615. ,
  36616. b.getLowBits = function() {
  36617. return this.low
  36618. }
  36619. ,
  36620. b.getLowBitsUnsigned = function() {
  36621. return this.low >>> 0
  36622. }
  36623. ,
  36624. b.getNumBitsAbs = function() {
  36625. if (this.isNegative())
  36626. return this.eq(E) ? 64 : this.neg().getNumBitsAbs();
  36627. for (var e = 0 != this.high ? this.high : this.low, t = 31; t > 0 && 0 == (e & 1 << t); t--)
  36628. ;
  36629. return 0 != this.high ? t + 33 : t + 1
  36630. }
  36631. ,
  36632. b.isZero = function() {
  36633. return 0 === this.high && 0 === this.low
  36634. }
  36635. ,
  36636. b.isNegative = function() {
  36637. return !this.unsigned && this.high < 0
  36638. }
  36639. ,
  36640. b.isPositive = function() {
  36641. return this.unsigned || this.high >= 0
  36642. }
  36643. ,
  36644. b.isOdd = function() {
  36645. return 1 === (1 & this.low)
  36646. }
  36647. ,
  36648. b.isEven = function() {
  36649. return 0 === (1 & this.low)
  36650. }
  36651. ,
  36652. b.equals = function(e) {
  36653. return t(e) || (e = a(e)),
  36654. (this.unsigned === e.unsigned || this.high >>> 31 !== 1 || e.high >>> 31 !== 1) && (this.high === e.high && this.low === e.low)
  36655. }
  36656. ,
  36657. b.eq = b.equals,
  36658. b.notEquals = function(e) {
  36659. return !this.eq(e)
  36660. }
  36661. ,
  36662. b.neq = b.notEquals,
  36663. b.lessThan = function(e) {
  36664. return this.comp(e) < 0
  36665. }
  36666. ,
  36667. b.lt = b.lessThan,
  36668. b.lessThanOrEqual = function(e) {
  36669. return this.comp(e) <= 0
  36670. }
  36671. ,
  36672. b.lte = b.lessThanOrEqual,
  36673. b.greaterThan = function(e) {
  36674. return this.comp(e) > 0
  36675. }
  36676. ,
  36677. b.gt = b.greaterThan,
  36678. b.greaterThanOrEqual = function(e) {
  36679. return this.comp(e) >= 0
  36680. }
  36681. ,
  36682. b.gte = b.greaterThanOrEqual,
  36683. b.compare = function(e) {
  36684. if (t(e) || (e = a(e)),
  36685. this.eq(e))
  36686. return 0;
  36687. var i = this.isNegative()
  36688. , n = e.isNegative();
  36689. return i && !n ? -1 : !i && n ? 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
  36690. }
  36691. ,
  36692. b.comp = b.compare,
  36693. b.negate = function() {
  36694. return !this.unsigned && this.eq(E) ? E : this.not().add(v)
  36695. }
  36696. ,
  36697. b.neg = b.negate,
  36698. b.add = function(e) {
  36699. t(e) || (e = a(e));
  36700. var i = this.high >>> 16
  36701. , n = 65535 & this.high
  36702. , o = this.low >>> 16
  36703. , s = 65535 & this.low
  36704. , l = e.high >>> 16
  36705. , c = 65535 & e.high
  36706. , h = e.low >>> 16
  36707. , u = 65535 & e.low
  36708. , d = 0
  36709. , p = 0
  36710. , f = 0
  36711. , g = 0;
  36712. return g += s + u,
  36713. f += g >>> 16,
  36714. g &= 65535,
  36715. f += o + h,
  36716. p += f >>> 16,
  36717. f &= 65535,
  36718. p += n + c,
  36719. d += p >>> 16,
  36720. p &= 65535,
  36721. d += i + l,
  36722. d &= 65535,
  36723. r(f << 16 | g, d << 16 | p, this.unsigned)
  36724. }
  36725. ,
  36726. b.subtract = function(e) {
  36727. return t(e) || (e = a(e)),
  36728. this.add(e.neg())
  36729. }
  36730. ,
  36731. b.sub = b.subtract,
  36732. b.multiply = function(e) {
  36733. if (this.isZero())
  36734. return g;
  36735. if (t(e) || (e = a(e)),
  36736. e.isZero())
  36737. return g;
  36738. if (this.eq(E))
  36739. return e.isOdd() ? E : g;
  36740. if (e.eq(E))
  36741. return this.isOdd() ? E : g;
  36742. if (this.isNegative())
  36743. return e.isNegative() ? this.neg().mul(e.neg()) : this.neg().mul(e).neg();
  36744. if (e.isNegative())
  36745. return this.mul(e.neg()).neg();
  36746. if (this.lt(f) && e.lt(f))
  36747. return n(this.toNumber() * e.toNumber(), this.unsigned);
  36748. var i = this.high >>> 16
  36749. , o = 65535 & this.high
  36750. , s = this.low >>> 16
  36751. , l = 65535 & this.low
  36752. , c = e.high >>> 16
  36753. , h = 65535 & e.high
  36754. , u = e.low >>> 16
  36755. , d = 65535 & e.low
  36756. , p = 0
  36757. , m = 0
  36758. , v = 0
  36759. , A = 0;
  36760. return A += l * d,
  36761. v += A >>> 16,
  36762. A &= 65535,
  36763. v += s * d,
  36764. m += v >>> 16,
  36765. v &= 65535,
  36766. v += l * u,
  36767. m += v >>> 16,
  36768. v &= 65535,
  36769. m += o * d,
  36770. p += m >>> 16,
  36771. m &= 65535,
  36772. m += s * u,
  36773. p += m >>> 16,
  36774. m &= 65535,
  36775. m += l * h,
  36776. p += m >>> 16,
  36777. m &= 65535,
  36778. p += i * d + o * u + s * h + l * c,
  36779. p &= 65535,
  36780. r(v << 16 | A, p << 16 | m, this.unsigned)
  36781. }
  36782. ,
  36783. b.mul = b.multiply,
  36784. b.divide = function(e) {
  36785. if (t(e) || (e = a(e)),
  36786. e.isZero())
  36787. throw Error("division by zero");
  36788. if (this.isZero())
  36789. return this.unsigned ? m : g;
  36790. var i, r, o;
  36791. if (this.unsigned) {
  36792. if (e.unsigned || (e = e.toUnsigned()),
  36793. e.gt(this))
  36794. return m;
  36795. if (e.gt(this.shru(1)))
  36796. return A;
  36797. o = m
  36798. } else {
  36799. if (this.eq(E)) {
  36800. if (e.eq(v) || e.eq(y))
  36801. return E;
  36802. if (e.eq(E))
  36803. return v;
  36804. var s = this.shr(1);
  36805. return i = s.div(e).shl(1),
  36806. i.eq(g) ? e.isNegative() ? v : y : (r = this.sub(e.mul(i)),
  36807. o = i.add(r.div(e)))
  36808. }
  36809. if (e.eq(E))
  36810. return this.unsigned ? m : g;
  36811. if (this.isNegative())
  36812. return e.isNegative() ? this.neg().div(e.neg()) : this.neg().div(e).neg();
  36813. if (e.isNegative())
  36814. return this.div(e.neg()).neg();
  36815. o = g
  36816. }
  36817. for (r = this; r.gte(e); ) {
  36818. i = Math.max(1, Math.floor(r.toNumber() / e.toNumber()));
  36819. for (var l = Math.ceil(Math.log(i) / Math.LN2), h = l <= 48 ? 1 : c(2, l - 48), u = n(i), d = u.mul(e); d.isNegative() || d.gt(r); )
  36820. i -= h,
  36821. u = n(i, this.unsigned),
  36822. d = u.mul(e);
  36823. u.isZero() && (u = v),
  36824. o = o.add(u),
  36825. r = r.sub(d)
  36826. }
  36827. return o
  36828. }
  36829. ,
  36830. b.div = b.divide,
  36831. b.modulo = function(e) {
  36832. return t(e) || (e = a(e)),
  36833. this.sub(this.div(e).mul(e))
  36834. }
  36835. ,
  36836. b.mod = b.modulo,
  36837. b.not = function() {
  36838. return r(~this.low, ~this.high, this.unsigned)
  36839. }
  36840. ,
  36841. b.and = function(e) {
  36842. return t(e) || (e = a(e)),
  36843. r(this.low & e.low, this.high & e.high, this.unsigned)
  36844. }
  36845. ,
  36846. b.or = function(e) {
  36847. return t(e) || (e = a(e)),
  36848. r(this.low | e.low, this.high | e.high, this.unsigned)
  36849. }
  36850. ,
  36851. b.xor = function(e) {
  36852. return t(e) || (e = a(e)),
  36853. r(this.low ^ e.low, this.high ^ e.high, this.unsigned)
  36854. }
  36855. ,
  36856. b.shiftLeft = function(e) {
  36857. return t(e) && (e = e.toInt()),
  36858. 0 === (e &= 63) ? this : e < 32 ? r(this.low << e, this.high << e | this.low >>> 32 - e, this.unsigned) : r(0, this.low << e - 32, this.unsigned)
  36859. }
  36860. ,
  36861. b.shl = b.shiftLeft,
  36862. b.shiftRight = function(e) {
  36863. return t(e) && (e = e.toInt()),
  36864. 0 === (e &= 63) ? this : e < 32 ? r(this.low >>> e | this.high << 32 - e, this.high >> e, this.unsigned) : r(this.high >> e - 32, this.high >= 0 ? 0 : -1, this.unsigned)
  36865. }
  36866. ,
  36867. b.shr = b.shiftRight,
  36868. b.shiftRightUnsigned = function(e) {
  36869. if (t(e) && (e = e.toInt()),
  36870. e &= 63,
  36871. 0 === e)
  36872. return this;
  36873. var i = this.high;
  36874. if (e < 32) {
  36875. var n = this.low;
  36876. return r(n >>> e | i << 32 - e, i >>> e, this.unsigned)
  36877. }
  36878. return 32 === e ? r(i, 0, this.unsigned) : r(i >>> e - 32, 0, this.unsigned)
  36879. }
  36880. ,
  36881. b.shru = b.shiftRightUnsigned,
  36882. b.toSigned = function() {
  36883. return this.unsigned ? r(this.low, this.high, !1) : this
  36884. }
  36885. ,
  36886. b.toUnsigned = function() {
  36887. return this.unsigned ? this : r(this.low, this.high, !0)
  36888. }
  36889. ,
  36890. b.toBytes = function(e) {
  36891. return e ? this.toBytesLE() : this.toBytesBE()
  36892. }
  36893. ,
  36894. b.toBytesLE = function() {
  36895. var e = this.high
  36896. , t = this.low;
  36897. return [255 & t, t >>> 8 & 255, t >>> 16 & 255, t >>> 24 & 255, 255 & e, e >>> 8 & 255, e >>> 16 & 255, e >>> 24 & 255]
  36898. }
  36899. ,
  36900. b.toBytesBE = function() {
  36901. var e = this.high
  36902. , t = this.low;
  36903. return [e >>> 24 & 255, e >>> 16 & 255, e >>> 8 & 255, 255 & e, t >>> 24 & 255, t >>> 16 & 255, t >>> 8 & 255, 255 & t]
  36904. }
  36905. ,
  36906. e
  36907. })
  36908. }
  36909. , {}],
  36910. 217: [function(e, t, i) {
  36911. var n = {
  36912. REVISION: "75"
  36913. };
  36914. "function" == typeof define && define.amd ? define("three", n) : "undefined" != typeof i && "undefined" != typeof t && (t.exports = n),
  36915. void 0 === Number.EPSILON && (Number.EPSILON = Math.pow(2, -52)),
  36916. void 0 === Math.sign && (Math.sign = function(e) {
  36917. return e < 0 ? -1 : e > 0 ? 1 : +e
  36918. }
  36919. ),
  36920. void 0 === Function.prototype.name && void 0 !== Object.defineProperty && Object.defineProperty(Function.prototype, "name", {
  36921. get: function() {
  36922. return this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]
  36923. }
  36924. }),
  36925. void 0 === Object.assign && Object.defineProperty(Object, "assign", {
  36926. writable: !0,
  36927. configurable: !0,
  36928. value: function(e) {
  36929. "use strict";
  36930. if (void 0 === e || null === e)
  36931. throw new TypeError("Cannot convert first argument to object");
  36932. for (var t = Object(e), i = 1, n = arguments.length; i !== n; ++i) {
  36933. var r = arguments[i];
  36934. if (void 0 !== r && null !== r) {
  36935. r = Object(r);
  36936. for (var o = Object.keys(r), a = 0, s = o.length; a !== s; ++a) {
  36937. var l = o[a]
  36938. , c = Object.getOwnPropertyDescriptor(r, l);
  36939. void 0 !== c && c.enumerable && (t[l] = r[l])
  36940. }
  36941. }
  36942. }
  36943. return t
  36944. }
  36945. }),
  36946. n.MOUSE = {
  36947. LEFT: 0,
  36948. MIDDLE: 1,
  36949. RIGHT: 2
  36950. },
  36951. n.CullFaceNone = 0,
  36952. n.CullFaceBack = 1,
  36953. n.CullFaceFront = 2,
  36954. n.CullFaceFrontBack = 3,
  36955. n.FrontFaceDirectionCW = 0,
  36956. n.FrontFaceDirectionCCW = 1,
  36957. n.BasicShadowMap = 0,
  36958. n.PCFShadowMap = 1,
  36959. n.PCFSoftShadowMap = 2,
  36960. n.FrontSide = 0,
  36961. n.BackSide = 1,
  36962. n.DoubleSide = 2,
  36963. n.FlatShading = 1,
  36964. n.SmoothShading = 2,
  36965. n.NoColors = 0,
  36966. n.FaceColors = 1,
  36967. n.VertexColors = 2,
  36968. n.NoBlending = 0,
  36969. n.NormalBlending = 1,
  36970. n.AdditiveBlending = 2,
  36971. n.SubtractiveBlending = 3,
  36972. n.MultiplyBlending = 4,
  36973. n.CustomBlending = 5,
  36974. n.AddEquation = 100,
  36975. n.SubtractEquation = 101,
  36976. n.ReverseSubtractEquation = 102,
  36977. n.MinEquation = 103,
  36978. n.MaxEquation = 104,
  36979. n.ZeroFactor = 200,
  36980. n.OneFactor = 201,
  36981. n.SrcColorFactor = 202,
  36982. n.OneMinusSrcColorFactor = 203,
  36983. n.SrcAlphaFactor = 204,
  36984. n.OneMinusSrcAlphaFactor = 205,
  36985. n.DstAlphaFactor = 206,
  36986. n.OneMinusDstAlphaFactor = 207,
  36987. n.DstColorFactor = 208,
  36988. n.OneMinusDstColorFactor = 209,
  36989. n.SrcAlphaSaturateFactor = 210,
  36990. n.NeverDepth = 0,
  36991. n.AlwaysDepth = 1,
  36992. n.LessDepth = 2,
  36993. n.LessEqualDepth = 3,
  36994. n.EqualDepth = 4,
  36995. n.GreaterEqualDepth = 5,
  36996. n.GreaterDepth = 6,
  36997. n.NotEqualDepth = 7,
  36998. n.MultiplyOperation = 0,
  36999. n.MixOperation = 1,
  37000. n.AddOperation = 2,
  37001. n.NoToneMapping = 0,
  37002. n.LinearToneMapping = 1,
  37003. n.ReinhardToneMapping = 2,
  37004. n.Uncharted2ToneMapping = 3,
  37005. n.CineonToneMapping = 4,
  37006. n.UVMapping = 300,
  37007. n.CubeReflectionMapping = 301,
  37008. n.CubeRefractionMapping = 302,
  37009. n.EquirectangularReflectionMapping = 303,
  37010. n.EquirectangularRefractionMapping = 304,
  37011. n.SphericalReflectionMapping = 305,
  37012. n.CubeUVReflectionMapping = 306,
  37013. n.CubeUVRefractionMapping = 307,
  37014. n.RepeatWrapping = 1e3,
  37015. n.ClampToEdgeWrapping = 1001,
  37016. n.MirroredRepeatWrapping = 1002,
  37017. n.NearestFilter = 1003,
  37018. n.NearestMipMapNearestFilter = 1004,
  37019. n.NearestMipMapLinearFilter = 1005,
  37020. n.LinearFilter = 1006,
  37021. n.LinearMipMapNearestFilter = 1007,
  37022. n.LinearMipMapLinearFilter = 1008,
  37023. n.UnsignedByteType = 1009,
  37024. n.ByteType = 1010,
  37025. n.ShortType = 1011,
  37026. n.UnsignedShortType = 1012,
  37027. n.IntType = 1013,
  37028. n.UnsignedIntType = 1014,
  37029. n.FloatType = 1015,
  37030. n.HalfFloatType = 1025,
  37031. n.UnsignedShort4444Type = 1016,
  37032. n.UnsignedShort5551Type = 1017,
  37033. n.UnsignedShort565Type = 1018,
  37034. n.AlphaFormat = 1019,
  37035. n.RGBFormat = 1020,
  37036. n.RGBAFormat = 1021,
  37037. n.LuminanceFormat = 1022,
  37038. n.LuminanceAlphaFormat = 1023,
  37039. n.RGBEFormat = n.RGBAFormat,
  37040. n.RGB_S3TC_DXT1_Format = 2001,
  37041. n.RGBA_S3TC_DXT1_Format = 2002,
  37042. n.RGBA_S3TC_DXT3_Format = 2003,
  37043. n.RGBA_S3TC_DXT5_Format = 2004,
  37044. n.RGB_PVRTC_4BPPV1_Format = 2100,
  37045. n.RGB_PVRTC_2BPPV1_Format = 2101,
  37046. n.RGBA_PVRTC_4BPPV1_Format = 2102,
  37047. n.RGBA_PVRTC_2BPPV1_Format = 2103,
  37048. n.RGB_ETC1_Format = 2151,
  37049. n.LoopOnce = 2200,
  37050. n.LoopRepeat = 2201,
  37051. n.LoopPingPong = 2202,
  37052. n.InterpolateDiscrete = 2300,
  37053. n.InterpolateLinear = 2301,
  37054. n.InterpolateSmooth = 2302,
  37055. n.ZeroCurvatureEnding = 2400,
  37056. n.ZeroSlopeEnding = 2401,
  37057. n.WrapAroundEnding = 2402,
  37058. n.TrianglesDrawMode = 0,
  37059. n.TriangleStripDrawMode = 1,
  37060. n.TriangleFanDrawMode = 2,
  37061. n.LinearEncoding = 3e3,
  37062. n.sRGBEncoding = 3001,
  37063. n.GammaEncoding = 3007,
  37064. n.RGBEEncoding = 3002,
  37065. n.LogLuvEncoding = 3003,
  37066. n.RGBM7Encoding = 3004,
  37067. n.RGBM16Encoding = 3005,
  37068. n.RGBDEncoding = 3006,
  37069. n.Color = function(e) {
  37070. return 3 === arguments.length ? this.fromArray(arguments) : this.set(e)
  37071. }
  37072. ,
  37073. n.Color.prototype = {
  37074. constructor: n.Color,
  37075. r: 1,
  37076. g: 1,
  37077. b: 1,
  37078. set: function(e) {
  37079. return e instanceof n.Color ? this.copy(e) : "number" == typeof e ? this.setHex(e) : "string" == typeof e && this.setStyle(e),
  37080. this
  37081. },
  37082. setScalar: function(e) {
  37083. this.r = e,
  37084. this.g = e,
  37085. this.b = e
  37086. },
  37087. setHex: function(e) {
  37088. return e = Math.floor(e),
  37089. this.r = (e >> 16 & 255) / 255,
  37090. this.g = (e >> 8 & 255) / 255,
  37091. this.b = (255 & e) / 255,
  37092. this
  37093. },
  37094. setRGB: function(e, t, i) {
  37095. return this.r = e,
  37096. this.g = t,
  37097. this.b = i,
  37098. this
  37099. },
  37100. setHSL: function() {
  37101. function e(e, t, i) {
  37102. return i < 0 && (i += 1),
  37103. i > 1 && (i -= 1),
  37104. i < 1 / 6 ? e + 6 * (t - e) * i : i < .5 ? t : i < 2 / 3 ? e + 6 * (t - e) * (2 / 3 - i) : e
  37105. }
  37106. return function(t, i, r) {
  37107. if (t = n.Math.euclideanModulo(t, 1),
  37108. i = n.Math.clamp(i, 0, 1),
  37109. r = n.Math.clamp(r, 0, 1),
  37110. 0 === i)
  37111. this.r = this.g = this.b = r;
  37112. else {
  37113. var o = r <= .5 ? r * (1 + i) : r + i - r * i
  37114. , a = 2 * r - o;
  37115. this.r = e(a, o, t + 1 / 3),
  37116. this.g = e(a, o, t),
  37117. this.b = e(a, o, t - 1 / 3)
  37118. }
  37119. return this
  37120. }
  37121. }(),
  37122. setStyle: function(e) {
  37123. function t(t) {
  37124. void 0 !== t && parseFloat(t) < 1 && console.warn("THREE.Color: Alpha component of " + e + " will be ignored.")
  37125. }
  37126. var i;
  37127. if (i = /^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e)) {
  37128. var r, o = i[1], a = i[2];
  37129. switch (o) {
  37130. case "rgb":
  37131. case "rgba":
  37132. if (r = /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))
  37133. return this.r = Math.min(255, parseInt(r[1], 10)) / 255,
  37134. this.g = Math.min(255, parseInt(r[2], 10)) / 255,
  37135. this.b = Math.min(255, parseInt(r[3], 10)) / 255,
  37136. t(r[5]),
  37137. this;
  37138. if (r = /^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))
  37139. return this.r = Math.min(100, parseInt(r[1], 10)) / 100,
  37140. this.g = Math.min(100, parseInt(r[2], 10)) / 100,
  37141. this.b = Math.min(100, parseInt(r[3], 10)) / 100,
  37142. t(r[5]),
  37143. this;
  37144. break;
  37145. case "hsl":
  37146. case "hsla":
  37147. if (r = /^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a)) {
  37148. var s = parseFloat(r[1]) / 360
  37149. , l = parseInt(r[2], 10) / 100
  37150. , c = parseInt(r[3], 10) / 100;
  37151. return t(r[5]),
  37152. this.setHSL(s, l, c)
  37153. }
  37154. }
  37155. } else if (i = /^\#([A-Fa-f0-9]+)$/.exec(e)) {
  37156. var h = i[1]
  37157. , u = h.length;
  37158. if (3 === u)
  37159. return this.r = parseInt(h.charAt(0) + h.charAt(0), 16) / 255,
  37160. this.g = parseInt(h.charAt(1) + h.charAt(1), 16) / 255,
  37161. this.b = parseInt(h.charAt(2) + h.charAt(2), 16) / 255,
  37162. this;
  37163. if (6 === u)
  37164. return this.r = parseInt(h.charAt(0) + h.charAt(1), 16) / 255,
  37165. this.g = parseInt(h.charAt(2) + h.charAt(3), 16) / 255,
  37166. this.b = parseInt(h.charAt(4) + h.charAt(5), 16) / 255,
  37167. this
  37168. }
  37169. if (e && e.length > 0) {
  37170. var h = n.ColorKeywords[e];
  37171. void 0 !== h ? this.setHex(h) : console.warn("THREE.Color: Unknown color " + e)
  37172. }
  37173. return this
  37174. },
  37175. clone: function() {
  37176. return new this.constructor(this.r,this.g,this.b)
  37177. },
  37178. copy: function(e) {
  37179. return this.r = e.r,
  37180. this.g = e.g,
  37181. this.b = e.b,
  37182. this
  37183. },
  37184. copyGammaToLinear: function(e, t) {
  37185. return void 0 === t && (t = 2),
  37186. this.r = Math.pow(e.r, t),
  37187. this.g = Math.pow(e.g, t),
  37188. this.b = Math.pow(e.b, t),
  37189. this
  37190. },
  37191. copyLinearToGamma: function(e, t) {
  37192. void 0 === t && (t = 2);
  37193. var i = t > 0 ? 1 / t : 1;
  37194. return this.r = Math.pow(e.r, i),
  37195. this.g = Math.pow(e.g, i),
  37196. this.b = Math.pow(e.b, i),
  37197. this
  37198. },
  37199. convertGammaToLinear: function() {
  37200. var e = this.r
  37201. , t = this.g
  37202. , i = this.b;
  37203. return this.r = e * e,
  37204. this.g = t * t,
  37205. this.b = i * i,
  37206. this
  37207. },
  37208. convertLinearToGamma: function() {
  37209. return this.r = Math.sqrt(this.r),
  37210. this.g = Math.sqrt(this.g),
  37211. this.b = Math.sqrt(this.b),
  37212. this
  37213. },
  37214. getHex: function() {
  37215. return 255 * this.r << 16 ^ 255 * this.g << 8 ^ 255 * this.b << 0
  37216. },
  37217. getHexString: function() {
  37218. return ("000000" + this.getHex().toString(16)).slice(-6)
  37219. },
  37220. getHSL: function(e) {
  37221. var t, i, n = e || {
  37222. h: 0,
  37223. s: 0,
  37224. l: 0
  37225. }, 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;
  37226. if (l === s)
  37227. t = 0,
  37228. i = 0;
  37229. else {
  37230. var h = s - l;
  37231. switch (i = c <= .5 ? h / (s + l) : h / (2 - s - l),
  37232. s) {
  37233. case r:
  37234. t = (o - a) / h + (o < a ? 6 : 0);
  37235. break;
  37236. case o:
  37237. t = (a - r) / h + 2;
  37238. break;
  37239. case a:
  37240. t = (r - o) / h + 4
  37241. }
  37242. t /= 6
  37243. }
  37244. return n.h = t,
  37245. n.s = i,
  37246. n.l = c,
  37247. n
  37248. },
  37249. getStyle: function() {
  37250. return "rgb(" + (255 * this.r | 0) + "," + (255 * this.g | 0) + "," + (255 * this.b | 0) + ")"
  37251. },
  37252. offsetHSL: function(e, t, i) {
  37253. var n = this.getHSL();
  37254. return n.h += e,
  37255. n.s += t,
  37256. n.l += i,
  37257. this.setHSL(n.h, n.s, n.l),
  37258. this
  37259. },
  37260. add: function(e) {
  37261. return this.r += e.r,
  37262. this.g += e.g,
  37263. this.b += e.b,
  37264. this
  37265. },
  37266. addColors: function(e, t) {
  37267. return this.r = e.r + t.r,
  37268. this.g = e.g + t.g,
  37269. this.b = e.b + t.b,
  37270. this
  37271. },
  37272. addScalar: function(e) {
  37273. return this.r += e,
  37274. this.g += e,
  37275. this.b += e,
  37276. this
  37277. },
  37278. multiply: function(e) {
  37279. return this.r *= e.r,
  37280. this.g *= e.g,
  37281. this.b *= e.b,
  37282. this
  37283. },
  37284. multiplyScalar: function(e) {
  37285. return this.r *= e,
  37286. this.g *= e,
  37287. this.b *= e,
  37288. this
  37289. },
  37290. lerp: function(e, t) {
  37291. return this.r += (e.r - this.r) * t,
  37292. this.g += (e.g - this.g) * t,
  37293. this.b += (e.b - this.b) * t,
  37294. this
  37295. },
  37296. equals: function(e) {
  37297. return e.r === this.r && e.g === this.g && e.b === this.b
  37298. },
  37299. fromArray: function(e, t) {
  37300. return void 0 === t && (t = 0),
  37301. this.r = e[t],
  37302. this.g = e[t + 1],
  37303. this.b = e[t + 2],
  37304. this
  37305. },
  37306. toArray: function(e, t) {
  37307. return void 0 === e && (e = []),
  37308. void 0 === t && (t = 0),
  37309. e[t] = this.r,
  37310. e[t + 1] = this.g,
  37311. e[t + 2] = this.b,
  37312. e
  37313. }
  37314. },
  37315. n.ColorKeywords = {
  37316. aliceblue: 15792383,
  37317. antiquewhite: 16444375,
  37318. aqua: 65535,
  37319. aquamarine: 8388564,
  37320. azure: 15794175,
  37321. beige: 16119260,
  37322. bisque: 16770244,
  37323. black: 0,
  37324. blanchedalmond: 16772045,
  37325. blue: 255,
  37326. blueviolet: 9055202,
  37327. brown: 10824234,
  37328. burlywood: 14596231,
  37329. cadetblue: 6266528,
  37330. chartreuse: 8388352,
  37331. chocolate: 13789470,
  37332. coral: 16744272,
  37333. cornflowerblue: 6591981,
  37334. cornsilk: 16775388,
  37335. crimson: 14423100,
  37336. cyan: 65535,
  37337. darkblue: 139,
  37338. darkcyan: 35723,
  37339. darkgoldenrod: 12092939,
  37340. darkgray: 11119017,
  37341. darkgreen: 25600,
  37342. darkgrey: 11119017,
  37343. darkkhaki: 12433259,
  37344. darkmagenta: 9109643,
  37345. darkolivegreen: 5597999,
  37346. darkorange: 16747520,
  37347. darkorchid: 10040012,
  37348. darkred: 9109504,
  37349. darksalmon: 15308410,
  37350. darkseagreen: 9419919,
  37351. darkslateblue: 4734347,
  37352. darkslategray: 3100495,
  37353. darkslategrey: 3100495,
  37354. darkturquoise: 52945,
  37355. darkviolet: 9699539,
  37356. deeppink: 16716947,
  37357. deepskyblue: 49151,
  37358. dimgray: 6908265,
  37359. dimgrey: 6908265,
  37360. dodgerblue: 2003199,
  37361. firebrick: 11674146,
  37362. floralwhite: 16775920,
  37363. forestgreen: 2263842,
  37364. fuchsia: 16711935,
  37365. gainsboro: 14474460,
  37366. ghostwhite: 16316671,
  37367. gold: 16766720,
  37368. goldenrod: 14329120,
  37369. gray: 8421504,
  37370. green: 32768,
  37371. greenyellow: 11403055,
  37372. grey: 8421504,
  37373. honeydew: 15794160,
  37374. hotpink: 16738740,
  37375. indianred: 13458524,
  37376. indigo: 4915330,
  37377. ivory: 16777200,
  37378. khaki: 15787660,
  37379. lavender: 15132410,
  37380. lavenderblush: 16773365,
  37381. lawngreen: 8190976,
  37382. lemonchiffon: 16775885,
  37383. lightblue: 11393254,
  37384. lightcoral: 15761536,
  37385. lightcyan: 14745599,
  37386. lightgoldenrodyellow: 16448210,
  37387. lightgray: 13882323,
  37388. lightgreen: 9498256,
  37389. lightgrey: 13882323,
  37390. lightpink: 16758465,
  37391. lightsalmon: 16752762,
  37392. lightseagreen: 2142890,
  37393. lightskyblue: 8900346,
  37394. lightslategray: 7833753,
  37395. lightslategrey: 7833753,
  37396. lightsteelblue: 11584734,
  37397. lightyellow: 16777184,
  37398. lime: 65280,
  37399. limegreen: 3329330,
  37400. linen: 16445670,
  37401. magenta: 16711935,
  37402. maroon: 8388608,
  37403. mediumaquamarine: 6737322,
  37404. mediumblue: 205,
  37405. mediumorchid: 12211667,
  37406. mediumpurple: 9662683,
  37407. mediumseagreen: 3978097,
  37408. mediumslateblue: 8087790,
  37409. mediumspringgreen: 64154,
  37410. mediumturquoise: 4772300,
  37411. mediumvioletred: 13047173,
  37412. midnightblue: 1644912,
  37413. mintcream: 16121850,
  37414. mistyrose: 16770273,
  37415. moccasin: 16770229,
  37416. navajowhite: 16768685,
  37417. navy: 128,
  37418. oldlace: 16643558,
  37419. olive: 8421376,
  37420. olivedrab: 7048739,
  37421. orange: 16753920,
  37422. orangered: 16729344,
  37423. orchid: 14315734,
  37424. palegoldenrod: 15657130,
  37425. palegreen: 10025880,
  37426. paleturquoise: 11529966,
  37427. palevioletred: 14381203,
  37428. papayawhip: 16773077,
  37429. peachpuff: 16767673,
  37430. peru: 13468991,
  37431. pink: 16761035,
  37432. plum: 14524637,
  37433. powderblue: 11591910,
  37434. purple: 8388736,
  37435. red: 16711680,
  37436. rosybrown: 12357519,
  37437. royalblue: 4286945,
  37438. saddlebrown: 9127187,
  37439. salmon: 16416882,
  37440. sandybrown: 16032864,
  37441. seagreen: 3050327,
  37442. seashell: 16774638,
  37443. sienna: 10506797,
  37444. silver: 12632256,
  37445. skyblue: 8900331,
  37446. slateblue: 6970061,
  37447. slategray: 7372944,
  37448. slategrey: 7372944,
  37449. snow: 16775930,
  37450. springgreen: 65407,
  37451. steelblue: 4620980,
  37452. tan: 13808780,
  37453. teal: 32896,
  37454. thistle: 14204888,
  37455. tomato: 16737095,
  37456. turquoise: 4251856,
  37457. violet: 15631086,
  37458. wheat: 16113331,
  37459. white: 16777215,
  37460. whitesmoke: 16119285,
  37461. yellow: 16776960,
  37462. yellowgreen: 10145074
  37463. },
  37464. n.Quaternion = function(e, t, i, n) {
  37465. this._x = e || 0,
  37466. this._y = t || 0,
  37467. this._z = i || 0,
  37468. this._w = void 0 !== n ? n : 1
  37469. }
  37470. ,
  37471. n.Quaternion.prototype = {
  37472. constructor: n.Quaternion,
  37473. get x() {
  37474. return this._x
  37475. },
  37476. set x(e) {
  37477. this._x = e,
  37478. this.onChangeCallback()
  37479. },
  37480. get y() {
  37481. return this._y
  37482. },
  37483. set y(e) {
  37484. this._y = e,
  37485. this.onChangeCallback()
  37486. },
  37487. get z() {
  37488. return this._z
  37489. },
  37490. set z(e) {
  37491. this._z = e,
  37492. this.onChangeCallback()
  37493. },
  37494. get w() {
  37495. return this._w
  37496. },
  37497. set w(e) {
  37498. this._w = e,
  37499. this.onChangeCallback()
  37500. },
  37501. set: function(e, t, i, n) {
  37502. return this._x = e,
  37503. this._y = t,
  37504. this._z = i,
  37505. this._w = n,
  37506. this.onChangeCallback(),
  37507. this
  37508. },
  37509. clone: function() {
  37510. return new this.constructor(this._x,this._y,this._z,this._w)
  37511. },
  37512. copy: function(e) {
  37513. return this._x = e.x,
  37514. this._y = e.y,
  37515. this._z = e.z,
  37516. this._w = e.w,
  37517. this.onChangeCallback(),
  37518. this
  37519. },
  37520. setFromEuler: function(e, t) {
  37521. if (e instanceof n.Euler == !1)
  37522. throw new Error("THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  37523. var i = Math.cos(e._x / 2)
  37524. , r = Math.cos(e._y / 2)
  37525. , o = Math.cos(e._z / 2)
  37526. , a = Math.sin(e._x / 2)
  37527. , s = Math.sin(e._y / 2)
  37528. , l = Math.sin(e._z / 2)
  37529. , c = e.order;
  37530. return "XYZ" === c ? (this._x = a * r * o + i * s * l,
  37531. this._y = i * s * o - a * r * l,
  37532. this._z = i * r * l + a * s * o,
  37533. this._w = i * r * o - a * s * l) : "YXZ" === c ? (this._x = a * r * o + i * s * l,
  37534. this._y = i * s * o - a * r * l,
  37535. this._z = i * r * l - a * s * o,
  37536. this._w = i * r * o + a * s * l) : "ZXY" === c ? (this._x = a * r * o - i * s * l,
  37537. this._y = i * s * o + a * r * l,
  37538. this._z = i * r * l + a * s * o,
  37539. this._w = i * r * o - a * s * l) : "ZYX" === c ? (this._x = a * r * o - i * s * l,
  37540. this._y = i * s * o + a * r * l,
  37541. this._z = i * r * l - a * s * o,
  37542. this._w = i * r * o + a * s * l) : "YZX" === c ? (this._x = a * r * o + i * s * l,
  37543. this._y = i * s * o + a * r * l,
  37544. this._z = i * r * l - a * s * o,
  37545. this._w = i * r * o - a * s * l) : "XZY" === c && (this._x = a * r * o - i * s * l,
  37546. this._y = i * s * o - a * r * l,
  37547. this._z = i * r * l + a * s * o,
  37548. this._w = i * r * o + a * s * l),
  37549. t !== !1 && this.onChangeCallback(),
  37550. this
  37551. },
  37552. setFromAxisAngle: function(e, t) {
  37553. var i = t / 2
  37554. , n = Math.sin(i);
  37555. return this._x = e.x * n,
  37556. this._y = e.y * n,
  37557. this._z = e.z * n,
  37558. this._w = Math.cos(i),
  37559. this.onChangeCallback(),
  37560. this
  37561. },
  37562. setFromRotationMatrix: function(e) {
  37563. 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;
  37564. return d > 0 ? (t = .5 / Math.sqrt(d + 1),
  37565. this._w = .25 / t,
  37566. this._x = (h - l) * t,
  37567. this._y = (o - c) * t,
  37568. this._z = (a - r) * t) : n > s && n > u ? (t = 2 * Math.sqrt(1 + n - s - u),
  37569. this._w = (h - l) / t,
  37570. this._x = .25 * t,
  37571. this._y = (r + a) / t,
  37572. this._z = (o + c) / t) : s > u ? (t = 2 * Math.sqrt(1 + s - n - u),
  37573. this._w = (o - c) / t,
  37574. this._x = (r + a) / t,
  37575. this._y = .25 * t,
  37576. this._z = (l + h) / t) : (t = 2 * Math.sqrt(1 + u - n - s),
  37577. this._w = (a - r) / t,
  37578. this._x = (o + c) / t,
  37579. this._y = (l + h) / t,
  37580. this._z = .25 * t),
  37581. this.onChangeCallback(),
  37582. this
  37583. },
  37584. setFromUnitVectors: function() {
  37585. var e, t, i = 1e-6;
  37586. return function(r, o) {
  37587. return void 0 === e && (e = new n.Vector3),
  37588. t = r.dot(o) + 1,
  37589. t < i ? (t = 0,
  37590. Math.abs(r.x) > Math.abs(r.z) ? e.set(-r.y, r.x, 0) : e.set(0, -r.z, r.y)) : e.crossVectors(r, o),
  37591. this._x = e.x,
  37592. this._y = e.y,
  37593. this._z = e.z,
  37594. this._w = t,
  37595. this.normalize(),
  37596. this
  37597. }
  37598. }(),
  37599. inverse: function() {
  37600. return this.conjugate().normalize(),
  37601. this
  37602. },
  37603. conjugate: function() {
  37604. return this._x *= -1,
  37605. this._y *= -1,
  37606. this._z *= -1,
  37607. this.onChangeCallback(),
  37608. this
  37609. },
  37610. dot: function(e) {
  37611. return this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w
  37612. },
  37613. lengthSq: function() {
  37614. return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w
  37615. },
  37616. length: function() {
  37617. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  37618. },
  37619. normalize: function() {
  37620. var e = this.length();
  37621. return 0 === e ? (this._x = 0,
  37622. this._y = 0,
  37623. this._z = 0,
  37624. this._w = 1) : (e = 1 / e,
  37625. this._x = this._x * e,
  37626. this._y = this._y * e,
  37627. this._z = this._z * e,
  37628. this._w = this._w * e),
  37629. this.onChangeCallback(),
  37630. this
  37631. },
  37632. multiply: function(e, t) {
  37633. return void 0 !== t ? (console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),
  37634. this.multiplyQuaternions(e, t)) : this.multiplyQuaternions(this, e)
  37635. },
  37636. multiplyQuaternions: function(e, t) {
  37637. var i = e._x
  37638. , n = e._y
  37639. , r = e._z
  37640. , o = e._w
  37641. , a = t._x
  37642. , s = t._y
  37643. , l = t._z
  37644. , c = t._w;
  37645. return this._x = i * c + o * a + n * l - r * s,
  37646. this._y = n * c + o * s + r * a - i * l,
  37647. this._z = r * c + o * l + i * s - n * a,
  37648. this._w = o * c - i * a - n * s - r * l,
  37649. this.onChangeCallback(),
  37650. this
  37651. },
  37652. slerp: function(e, t) {
  37653. if (0 === t)
  37654. return this;
  37655. if (1 === t)
  37656. return this.copy(e);
  37657. var i = this._x
  37658. , n = this._y
  37659. , r = this._z
  37660. , o = this._w
  37661. , a = o * e._w + i * e._x + n * e._y + r * e._z;
  37662. if (a < 0 ? (this._w = -e._w,
  37663. this._x = -e._x,
  37664. this._y = -e._y,
  37665. this._z = -e._z,
  37666. a = -a) : this.copy(e),
  37667. a >= 1)
  37668. return this._w = o,
  37669. this._x = i,
  37670. this._y = n,
  37671. this._z = r,
  37672. this;
  37673. var s = Math.sqrt(1 - a * a);
  37674. if (Math.abs(s) < .001)
  37675. return this._w = .5 * (o + this._w),
  37676. this._x = .5 * (i + this._x),
  37677. this._y = .5 * (n + this._y),
  37678. this._z = .5 * (r + this._z),
  37679. this;
  37680. var l = Math.atan2(s, a)
  37681. , c = Math.sin((1 - t) * l) / s
  37682. , h = Math.sin(t * l) / s;
  37683. return this._w = o * c + this._w * h,
  37684. this._x = i * c + this._x * h,
  37685. this._y = n * c + this._y * h,
  37686. this._z = r * c + this._z * h,
  37687. this.onChangeCallback(),
  37688. this
  37689. },
  37690. equals: function(e) {
  37691. return e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w
  37692. },
  37693. fromArray: function(e, t) {
  37694. return void 0 === t && (t = 0),
  37695. this._x = e[t],
  37696. this._y = e[t + 1],
  37697. this._z = e[t + 2],
  37698. this._w = e[t + 3],
  37699. this.onChangeCallback(),
  37700. this
  37701. },
  37702. toArray: function(e, t) {
  37703. return void 0 === e && (e = []),
  37704. void 0 === t && (t = 0),
  37705. e[t] = this._x,
  37706. e[t + 1] = this._y,
  37707. e[t + 2] = this._z,
  37708. e[t + 3] = this._w,
  37709. e
  37710. },
  37711. onChange: function(e) {
  37712. return this.onChangeCallback = e,
  37713. this
  37714. },
  37715. onChangeCallback: function() {}
  37716. },
  37717. Object.assign(n.Quaternion, {
  37718. slerp: function(e, t, i, n) {
  37719. return i.copy(e).slerp(t, n)
  37720. },
  37721. slerpFlat: function(e, t, i, n, r, o, a) {
  37722. var s = i[n + 0]
  37723. , l = i[n + 1]
  37724. , c = i[n + 2]
  37725. , h = i[n + 3]
  37726. , u = r[o + 0]
  37727. , d = r[o + 1]
  37728. , p = r[o + 2]
  37729. , f = r[o + 3];
  37730. if (h !== f || s !== u || l !== d || c !== p) {
  37731. var g = 1 - a
  37732. , m = s * u + l * d + c * p + h * f
  37733. , v = m >= 0 ? 1 : -1
  37734. , A = 1 - m * m;
  37735. if (A > Number.EPSILON) {
  37736. var y = Math.sqrt(A)
  37737. , C = Math.atan2(y, m * v);
  37738. g = Math.sin(g * C) / y,
  37739. a = Math.sin(a * C) / y
  37740. }
  37741. var I = a * v;
  37742. if (s = s * g + u * I,
  37743. l = l * g + d * I,
  37744. c = c * g + p * I,
  37745. h = h * g + f * I,
  37746. g === 1 - a) {
  37747. var E = 1 / Math.sqrt(s * s + l * l + c * c + h * h);
  37748. s *= E,
  37749. l *= E,
  37750. c *= E,
  37751. h *= E
  37752. }
  37753. }
  37754. e[t] = s,
  37755. e[t + 1] = l,
  37756. e[t + 2] = c,
  37757. e[t + 3] = h
  37758. }
  37759. }),
  37760. n.Vector2 = function(e, t) {
  37761. this.x = e || 0,
  37762. this.y = t || 0
  37763. }
  37764. ,
  37765. n.Vector2.prototype = {
  37766. constructor: n.Vector2,
  37767. get width() {
  37768. return this.x
  37769. },
  37770. set width(e) {
  37771. this.x = e
  37772. },
  37773. get height() {
  37774. return this.y
  37775. },
  37776. set height(e) {
  37777. this.y = e
  37778. },
  37779. set: function(e, t) {
  37780. return this.x = e,
  37781. this.y = t,
  37782. this
  37783. },
  37784. setScalar: function(e) {
  37785. return this.x = e,
  37786. this.y = e,
  37787. this
  37788. },
  37789. setX: function(e) {
  37790. return this.x = e,
  37791. this
  37792. },
  37793. setY: function(e) {
  37794. return this.y = e,
  37795. this
  37796. },
  37797. setComponent: function(e, t) {
  37798. switch (e) {
  37799. case 0:
  37800. this.x = t;
  37801. break;
  37802. case 1:
  37803. this.y = t;
  37804. break;
  37805. default:
  37806. throw new Error("index is out of range: " + e)
  37807. }
  37808. },
  37809. getComponent: function(e) {
  37810. switch (e) {
  37811. case 0:
  37812. return this.x;
  37813. case 1:
  37814. return this.y;
  37815. default:
  37816. throw new Error("index is out of range: " + e)
  37817. }
  37818. },
  37819. clone: function() {
  37820. return new this.constructor(this.x,this.y)
  37821. },
  37822. copy: function(e) {
  37823. return this.x = e.x,
  37824. this.y = e.y,
  37825. this
  37826. },
  37827. add: function(e, t) {
  37828. return void 0 !== t ? (console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  37829. this.addVectors(e, t)) : (this.x += e.x,
  37830. this.y += e.y,
  37831. this)
  37832. },
  37833. addScalar: function(e) {
  37834. return this.x += e,
  37835. this.y += e,
  37836. this
  37837. },
  37838. addVectors: function(e, t) {
  37839. return this.x = e.x + t.x,
  37840. this.y = e.y + t.y,
  37841. this
  37842. },
  37843. addScaledVector: function(e, t) {
  37844. return this.x += e.x * t,
  37845. this.y += e.y * t,
  37846. this
  37847. },
  37848. sub: function(e, t) {
  37849. return void 0 !== t ? (console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  37850. this.subVectors(e, t)) : (this.x -= e.x,
  37851. this.y -= e.y,
  37852. this)
  37853. },
  37854. subScalar: function(e) {
  37855. return this.x -= e,
  37856. this.y -= e,
  37857. this
  37858. },
  37859. subVectors: function(e, t) {
  37860. return this.x = e.x - t.x,
  37861. this.y = e.y - t.y,
  37862. this
  37863. },
  37864. multiply: function(e) {
  37865. return this.x *= e.x,
  37866. this.y *= e.y,
  37867. this
  37868. },
  37869. multiplyScalar: function(e) {
  37870. return isFinite(e) ? (this.x *= e,
  37871. this.y *= e) : (this.x = 0,
  37872. this.y = 0),
  37873. this
  37874. },
  37875. divide: function(e) {
  37876. return this.x /= e.x,
  37877. this.y /= e.y,
  37878. this
  37879. },
  37880. divideScalar: function(e) {
  37881. return this.multiplyScalar(1 / e)
  37882. },
  37883. min: function(e) {
  37884. return this.x = Math.min(this.x, e.x),
  37885. this.y = Math.min(this.y, e.y),
  37886. this
  37887. },
  37888. max: function(e) {
  37889. return this.x = Math.max(this.x, e.x),
  37890. this.y = Math.max(this.y, e.y),
  37891. this
  37892. },
  37893. clamp: function(e, t) {
  37894. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  37895. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  37896. this
  37897. },
  37898. clampScalar: function() {
  37899. var e, t;
  37900. return function(i, r) {
  37901. return void 0 === e && (e = new n.Vector2,
  37902. t = new n.Vector2),
  37903. e.set(i, i),
  37904. t.set(r, r),
  37905. this.clamp(e, t)
  37906. }
  37907. }(),
  37908. clampLength: function(e, t) {
  37909. var i = this.length();
  37910. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  37911. this
  37912. },
  37913. floor: function() {
  37914. return this.x = Math.floor(this.x),
  37915. this.y = Math.floor(this.y),
  37916. this
  37917. },
  37918. ceil: function() {
  37919. return this.x = Math.ceil(this.x),
  37920. this.y = Math.ceil(this.y),
  37921. this
  37922. },
  37923. round: function() {
  37924. return this.x = Math.round(this.x),
  37925. this.y = Math.round(this.y),
  37926. this
  37927. },
  37928. roundToZero: function() {
  37929. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  37930. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  37931. this
  37932. },
  37933. negate: function() {
  37934. return this.x = -this.x,
  37935. this.y = -this.y,
  37936. this
  37937. },
  37938. dot: function(e) {
  37939. return this.x * e.x + this.y * e.y
  37940. },
  37941. lengthSq: function() {
  37942. return this.x * this.x + this.y * this.y
  37943. },
  37944. length: function() {
  37945. return Math.sqrt(this.x * this.x + this.y * this.y)
  37946. },
  37947. lengthManhattan: function() {
  37948. return Math.abs(this.x) + Math.abs(this.y)
  37949. },
  37950. normalize: function() {
  37951. return this.divideScalar(this.length())
  37952. },
  37953. angle: function() {
  37954. var e = Math.atan2(this.y, this.x);
  37955. return e < 0 && (e += 2 * Math.PI),
  37956. e
  37957. },
  37958. distanceTo: function(e) {
  37959. return Math.sqrt(this.distanceToSquared(e))
  37960. },
  37961. distanceToSquared: function(e) {
  37962. var t = this.x - e.x
  37963. , i = this.y - e.y;
  37964. return t * t + i * i
  37965. },
  37966. setLength: function(e) {
  37967. return this.multiplyScalar(e / this.length())
  37968. },
  37969. lerp: function(e, t) {
  37970. return this.x += (e.x - this.x) * t,
  37971. this.y += (e.y - this.y) * t,
  37972. this
  37973. },
  37974. lerpVectors: function(e, t, i) {
  37975. return this.subVectors(t, e).multiplyScalar(i).add(e),
  37976. this
  37977. },
  37978. equals: function(e) {
  37979. return e.x === this.x && e.y === this.y
  37980. },
  37981. fromArray: function(e, t) {
  37982. return void 0 === t && (t = 0),
  37983. this.x = e[t],
  37984. this.y = e[t + 1],
  37985. this
  37986. },
  37987. toArray: function(e, t) {
  37988. return void 0 === e && (e = []),
  37989. void 0 === t && (t = 0),
  37990. e[t] = this.x,
  37991. e[t + 1] = this.y,
  37992. e
  37993. },
  37994. fromAttribute: function(e, t, i) {
  37995. return void 0 === i && (i = 0),
  37996. t = t * e.itemSize + i,
  37997. this.x = e.array[t],
  37998. this.y = e.array[t + 1],
  37999. this
  38000. },
  38001. rotateAround: function(e, t) {
  38002. var i = Math.cos(t)
  38003. , n = Math.sin(t)
  38004. , r = this.x - e.x
  38005. , o = this.y - e.y;
  38006. return this.x = r * i - o * n + e.x,
  38007. this.y = r * n + o * i + e.y,
  38008. this
  38009. }
  38010. },
  38011. n.Vector3 = function(e, t, i) {
  38012. this.x = e || 0,
  38013. this.y = t || 0,
  38014. this.z = i || 0
  38015. }
  38016. ,
  38017. n.Vector3.prototype = {
  38018. constructor: n.Vector3,
  38019. set: function(e, t, i) {
  38020. return this.x = e,
  38021. this.y = t,
  38022. this.z = i,
  38023. this
  38024. },
  38025. setScalar: function(e) {
  38026. return this.x = e,
  38027. this.y = e,
  38028. this.z = e,
  38029. this
  38030. },
  38031. setX: function(e) {
  38032. return this.x = e,
  38033. this
  38034. },
  38035. setY: function(e) {
  38036. return this.y = e,
  38037. this
  38038. },
  38039. setZ: function(e) {
  38040. return this.z = e,
  38041. this
  38042. },
  38043. setComponent: function(e, t) {
  38044. switch (e) {
  38045. case 0:
  38046. this.x = t;
  38047. break;
  38048. case 1:
  38049. this.y = t;
  38050. break;
  38051. case 2:
  38052. this.z = t;
  38053. break;
  38054. default:
  38055. throw new Error("index is out of range: " + e)
  38056. }
  38057. },
  38058. getComponent: function(e) {
  38059. switch (e) {
  38060. case 0:
  38061. return this.x;
  38062. case 1:
  38063. return this.y;
  38064. case 2:
  38065. return this.z;
  38066. default:
  38067. throw new Error("index is out of range: " + e)
  38068. }
  38069. },
  38070. clone: function() {
  38071. return new this.constructor(this.x,this.y,this.z)
  38072. },
  38073. copy: function(e) {
  38074. return this.x = e.x,
  38075. this.y = e.y,
  38076. this.z = e.z,
  38077. this
  38078. },
  38079. add: function(e, t) {
  38080. return void 0 !== t ? (console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  38081. this.addVectors(e, t)) : (this.x += e.x,
  38082. this.y += e.y,
  38083. this.z += e.z,
  38084. this)
  38085. },
  38086. addScalar: function(e) {
  38087. return this.x += e,
  38088. this.y += e,
  38089. this.z += e,
  38090. this
  38091. },
  38092. addVectors: function(e, t) {
  38093. return this.x = e.x + t.x,
  38094. this.y = e.y + t.y,
  38095. this.z = e.z + t.z,
  38096. this
  38097. },
  38098. addScaledVector: function(e, t) {
  38099. return this.x += e.x * t,
  38100. this.y += e.y * t,
  38101. this.z += e.z * t,
  38102. this
  38103. },
  38104. sub: function(e, t) {
  38105. return void 0 !== t ? (console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  38106. this.subVectors(e, t)) : (this.x -= e.x,
  38107. this.y -= e.y,
  38108. this.z -= e.z,
  38109. this)
  38110. },
  38111. subScalar: function(e) {
  38112. return this.x -= e,
  38113. this.y -= e,
  38114. this.z -= e,
  38115. this
  38116. },
  38117. subVectors: function(e, t) {
  38118. return this.x = e.x - t.x,
  38119. this.y = e.y - t.y,
  38120. this.z = e.z - t.z,
  38121. this
  38122. },
  38123. multiply: function(e, t) {
  38124. return void 0 !== t ? (console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),
  38125. this.multiplyVectors(e, t)) : (this.x *= e.x,
  38126. this.y *= e.y,
  38127. this.z *= e.z,
  38128. this)
  38129. },
  38130. multiplyScalar: function(e) {
  38131. return isFinite(e) ? (this.x *= e,
  38132. this.y *= e,
  38133. this.z *= e) : (this.x = 0,
  38134. this.y = 0,
  38135. this.z = 0),
  38136. this
  38137. },
  38138. multiplyVectors: function(e, t) {
  38139. return this.x = e.x * t.x,
  38140. this.y = e.y * t.y,
  38141. this.z = e.z * t.z,
  38142. this
  38143. },
  38144. applyEuler: function() {
  38145. var e;
  38146. return function(t) {
  38147. return t instanceof n.Euler == !1 && console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),
  38148. void 0 === e && (e = new n.Quaternion),
  38149. this.applyQuaternion(e.setFromEuler(t)),
  38150. this
  38151. }
  38152. }(),
  38153. applyAxisAngle: function() {
  38154. var e;
  38155. return function(t, i) {
  38156. return void 0 === e && (e = new n.Quaternion),
  38157. this.applyQuaternion(e.setFromAxisAngle(t, i)),
  38158. this
  38159. }
  38160. }(),
  38161. applyMatrix3: function(e) {
  38162. var t = this.x
  38163. , i = this.y
  38164. , n = this.z
  38165. , r = e.elements;
  38166. return this.x = r[0] * t + r[3] * i + r[6] * n,
  38167. this.y = r[1] * t + r[4] * i + r[7] * n,
  38168. this.z = r[2] * t + r[5] * i + r[8] * n,
  38169. this
  38170. },
  38171. applyMatrix4: function(e) {
  38172. var t = this.x
  38173. , i = this.y
  38174. , n = this.z
  38175. , r = e.elements;
  38176. return this.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  38177. this.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  38178. this.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  38179. this
  38180. },
  38181. applyProjection: function(e) {
  38182. var t = this.x
  38183. , i = this.y
  38184. , n = this.z
  38185. , r = e.elements
  38186. , o = 1 / (r[3] * t + r[7] * i + r[11] * n + r[15]);
  38187. return this.x = (r[0] * t + r[4] * i + r[8] * n + r[12]) * o,
  38188. this.y = (r[1] * t + r[5] * i + r[9] * n + r[13]) * o,
  38189. this.z = (r[2] * t + r[6] * i + r[10] * n + r[14]) * o,
  38190. this
  38191. },
  38192. applyQuaternion: function(e) {
  38193. var t = this.x
  38194. , i = this.y
  38195. , n = this.z
  38196. , r = e.x
  38197. , o = e.y
  38198. , a = e.z
  38199. , s = e.w
  38200. , l = s * t + o * n - a * i
  38201. , c = s * i + a * t - r * n
  38202. , h = s * n + r * i - o * t
  38203. , u = -r * t - o * i - a * n;
  38204. return this.x = l * s + u * -r + c * -a - h * -o,
  38205. this.y = c * s + u * -o + h * -r - l * -a,
  38206. this.z = h * s + u * -a + l * -o - c * -r,
  38207. this
  38208. },
  38209. project: function() {
  38210. var e;
  38211. return function(t) {
  38212. return void 0 === e && (e = new n.Matrix4),
  38213. e.multiplyMatrices(t.projectionMatrix, e.getInverse(t.matrixWorld)),
  38214. this.applyProjection(e)
  38215. }
  38216. }(),
  38217. unproject: function() {
  38218. var e;
  38219. return function(t) {
  38220. return void 0 === e && (e = new n.Matrix4),
  38221. e.multiplyMatrices(t.matrixWorld, e.getInverse(t.projectionMatrix)),
  38222. this.applyProjection(e)
  38223. }
  38224. }(),
  38225. transformDirection: function(e) {
  38226. var t = this.x
  38227. , i = this.y
  38228. , n = this.z
  38229. , r = e.elements;
  38230. return this.x = r[0] * t + r[4] * i + r[8] * n,
  38231. this.y = r[1] * t + r[5] * i + r[9] * n,
  38232. this.z = r[2] * t + r[6] * i + r[10] * n,
  38233. this.normalize(),
  38234. this
  38235. },
  38236. divide: function(e) {
  38237. return this.x /= e.x,
  38238. this.y /= e.y,
  38239. this.z /= e.z,
  38240. this
  38241. },
  38242. divideScalar: function(e) {
  38243. return this.multiplyScalar(1 / e)
  38244. },
  38245. min: function(e) {
  38246. return this.x = Math.min(this.x, e.x),
  38247. this.y = Math.min(this.y, e.y),
  38248. this.z = Math.min(this.z, e.z),
  38249. this
  38250. },
  38251. max: function(e) {
  38252. return this.x = Math.max(this.x, e.x),
  38253. this.y = Math.max(this.y, e.y),
  38254. this.z = Math.max(this.z, e.z),
  38255. this
  38256. },
  38257. clamp: function(e, t) {
  38258. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  38259. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  38260. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  38261. this
  38262. },
  38263. clampScalar: function() {
  38264. var e, t;
  38265. return function(i, r) {
  38266. return void 0 === e && (e = new n.Vector3,
  38267. t = new n.Vector3),
  38268. e.set(i, i, i),
  38269. t.set(r, r, r),
  38270. this.clamp(e, t)
  38271. }
  38272. }(),
  38273. clampLength: function(e, t) {
  38274. var i = this.length();
  38275. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  38276. this
  38277. },
  38278. floor: function() {
  38279. return this.x = Math.floor(this.x),
  38280. this.y = Math.floor(this.y),
  38281. this.z = Math.floor(this.z),
  38282. this
  38283. },
  38284. ceil: function() {
  38285. return this.x = Math.ceil(this.x),
  38286. this.y = Math.ceil(this.y),
  38287. this.z = Math.ceil(this.z),
  38288. this
  38289. },
  38290. round: function() {
  38291. return this.x = Math.round(this.x),
  38292. this.y = Math.round(this.y),
  38293. this.z = Math.round(this.z),
  38294. this
  38295. },
  38296. roundToZero: function() {
  38297. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  38298. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  38299. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  38300. this
  38301. },
  38302. negate: function() {
  38303. return this.x = -this.x,
  38304. this.y = -this.y,
  38305. this.z = -this.z,
  38306. this
  38307. },
  38308. dot: function(e) {
  38309. return this.x * e.x + this.y * e.y + this.z * e.z
  38310. },
  38311. lengthSq: function() {
  38312. return this.x * this.x + this.y * this.y + this.z * this.z
  38313. },
  38314. length: function() {
  38315. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z)
  38316. },
  38317. lengthManhattan: function() {
  38318. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z)
  38319. },
  38320. normalize: function() {
  38321. return this.divideScalar(this.length())
  38322. },
  38323. setLength: function(e) {
  38324. return this.multiplyScalar(e / this.length())
  38325. },
  38326. lerp: function(e, t) {
  38327. return this.x += (e.x - this.x) * t,
  38328. this.y += (e.y - this.y) * t,
  38329. this.z += (e.z - this.z) * t,
  38330. this
  38331. },
  38332. lerpVectors: function(e, t, i) {
  38333. return this.subVectors(t, e).multiplyScalar(i).add(e),
  38334. this
  38335. },
  38336. cross: function(e, t) {
  38337. if (void 0 !== t)
  38338. return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),
  38339. this.crossVectors(e, t);
  38340. var i = this.x
  38341. , n = this.y
  38342. , r = this.z;
  38343. return this.x = n * e.z - r * e.y,
  38344. this.y = r * e.x - i * e.z,
  38345. this.z = i * e.y - n * e.x,
  38346. this
  38347. },
  38348. crossVectors: function(e, t) {
  38349. var i = e.x
  38350. , n = e.y
  38351. , r = e.z
  38352. , o = t.x
  38353. , a = t.y
  38354. , s = t.z;
  38355. return this.x = n * s - r * a,
  38356. this.y = r * o - i * s,
  38357. this.z = i * a - n * o,
  38358. this
  38359. },
  38360. projectOnVector: function() {
  38361. var e, t;
  38362. return function(i) {
  38363. return void 0 === e && (e = new n.Vector3),
  38364. e.copy(i).normalize(),
  38365. t = this.dot(e),
  38366. this.copy(e).multiplyScalar(t)
  38367. }
  38368. }(),
  38369. projectOnPlane: function() {
  38370. var e;
  38371. return function(t) {
  38372. return void 0 === e && (e = new n.Vector3),
  38373. e.copy(this).projectOnVector(t),
  38374. this.sub(e)
  38375. }
  38376. }(),
  38377. reflect: function() {
  38378. var e;
  38379. return function(t) {
  38380. return void 0 === e && (e = new n.Vector3),
  38381. this.sub(e.copy(t).multiplyScalar(2 * this.dot(t)))
  38382. }
  38383. }(),
  38384. angleTo: function(e) {
  38385. var t = this.dot(e) / Math.sqrt(this.lengthSq() * e.lengthSq());
  38386. return Math.acos(n.Math.clamp(t, -1, 1))
  38387. },
  38388. distanceTo: function(e) {
  38389. return Math.sqrt(this.distanceToSquared(e))
  38390. },
  38391. distanceToSquared: function(e) {
  38392. var t = this.x - e.x
  38393. , i = this.y - e.y
  38394. , n = this.z - e.z;
  38395. return t * t + i * i + n * n
  38396. },
  38397. setFromSpherical: function(e) {
  38398. var t = Math.sin(e.phi) * e.radius;
  38399. return this.x = t * Math.sin(e.theta),
  38400. this.y = Math.cos(e.phi) * e.radius,
  38401. this.z = t * Math.cos(e.theta),
  38402. this
  38403. },
  38404. setFromMatrixPosition: function(e) {
  38405. return this.setFromMatrixColumn(e, 3)
  38406. },
  38407. setFromMatrixScale: function(e) {
  38408. var t = this.setFromMatrixColumn(e, 0).length()
  38409. , i = this.setFromMatrixColumn(e, 1).length()
  38410. , n = this.setFromMatrixColumn(e, 2).length();
  38411. return this.x = t,
  38412. this.y = i,
  38413. this.z = n,
  38414. this
  38415. },
  38416. setFromMatrixColumn: function(e, t) {
  38417. return "number" == typeof e && (console.warn("THREE.Vector3: setFromMatrixColumn now expects ( matrix, index )."),
  38418. e = arguments[1],
  38419. t = arguments[0]),
  38420. this.fromArray(e.elements, 4 * t)
  38421. },
  38422. equals: function(e) {
  38423. return e.x === this.x && e.y === this.y && e.z === this.z
  38424. },
  38425. fromArray: function(e, t) {
  38426. return void 0 === t && (t = 0),
  38427. this.x = e[t],
  38428. this.y = e[t + 1],
  38429. this.z = e[t + 2],
  38430. this
  38431. },
  38432. toArray: function(e, t) {
  38433. return void 0 === e && (e = []),
  38434. void 0 === t && (t = 0),
  38435. e[t] = this.x,
  38436. e[t + 1] = this.y,
  38437. e[t + 2] = this.z,
  38438. e
  38439. },
  38440. fromAttribute: function(e, t, i) {
  38441. return void 0 === i && (i = 0),
  38442. t = t * e.itemSize + i,
  38443. this.x = e.array[t],
  38444. this.y = e.array[t + 1],
  38445. this.z = e.array[t + 2],
  38446. this
  38447. }
  38448. },
  38449. n.Vector4 = function(e, t, i, n) {
  38450. this.x = e || 0,
  38451. this.y = t || 0,
  38452. this.z = i || 0,
  38453. this.w = void 0 !== n ? n : 1
  38454. }
  38455. ,
  38456. n.Vector4.prototype = {
  38457. constructor: n.Vector4,
  38458. set: function(e, t, i, n) {
  38459. return this.x = e,
  38460. this.y = t,
  38461. this.z = i,
  38462. this.w = n,
  38463. this
  38464. },
  38465. setScalar: function(e) {
  38466. return this.x = e,
  38467. this.y = e,
  38468. this.z = e,
  38469. this.w = e,
  38470. this
  38471. },
  38472. setX: function(e) {
  38473. return this.x = e,
  38474. this
  38475. },
  38476. setY: function(e) {
  38477. return this.y = e,
  38478. this
  38479. },
  38480. setZ: function(e) {
  38481. return this.z = e,
  38482. this
  38483. },
  38484. setW: function(e) {
  38485. return this.w = e,
  38486. this
  38487. },
  38488. setComponent: function(e, t) {
  38489. switch (e) {
  38490. case 0:
  38491. this.x = t;
  38492. break;
  38493. case 1:
  38494. this.y = t;
  38495. break;
  38496. case 2:
  38497. this.z = t;
  38498. break;
  38499. case 3:
  38500. this.w = t;
  38501. break;
  38502. default:
  38503. throw new Error("index is out of range: " + e)
  38504. }
  38505. },
  38506. getComponent: function(e) {
  38507. switch (e) {
  38508. case 0:
  38509. return this.x;
  38510. case 1:
  38511. return this.y;
  38512. case 2:
  38513. return this.z;
  38514. case 3:
  38515. return this.w;
  38516. default:
  38517. throw new Error("index is out of range: " + e)
  38518. }
  38519. },
  38520. clone: function() {
  38521. return new this.constructor(this.x,this.y,this.z,this.w)
  38522. },
  38523. copy: function(e) {
  38524. return this.x = e.x,
  38525. this.y = e.y,
  38526. this.z = e.z,
  38527. this.w = void 0 !== e.w ? e.w : 1,
  38528. this
  38529. },
  38530. add: function(e, t) {
  38531. return void 0 !== t ? (console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  38532. this.addVectors(e, t)) : (this.x += e.x,
  38533. this.y += e.y,
  38534. this.z += e.z,
  38535. this.w += e.w,
  38536. this)
  38537. },
  38538. addScalar: function(e) {
  38539. return this.x += e,
  38540. this.y += e,
  38541. this.z += e,
  38542. this.w += e,
  38543. this
  38544. },
  38545. addVectors: function(e, t) {
  38546. return this.x = e.x + t.x,
  38547. this.y = e.y + t.y,
  38548. this.z = e.z + t.z,
  38549. this.w = e.w + t.w,
  38550. this
  38551. },
  38552. addScaledVector: function(e, t) {
  38553. return this.x += e.x * t,
  38554. this.y += e.y * t,
  38555. this.z += e.z * t,
  38556. this.w += e.w * t,
  38557. this
  38558. },
  38559. sub: function(e, t) {
  38560. return void 0 !== t ? (console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  38561. this.subVectors(e, t)) : (this.x -= e.x,
  38562. this.y -= e.y,
  38563. this.z -= e.z,
  38564. this.w -= e.w,
  38565. this)
  38566. },
  38567. subScalar: function(e) {
  38568. return this.x -= e,
  38569. this.y -= e,
  38570. this.z -= e,
  38571. this.w -= e,
  38572. this
  38573. },
  38574. subVectors: function(e, t) {
  38575. return this.x = e.x - t.x,
  38576. this.y = e.y - t.y,
  38577. this.z = e.z - t.z,
  38578. this.w = e.w - t.w,
  38579. this
  38580. },
  38581. multiplyScalar: function(e) {
  38582. return isFinite(e) ? (this.x *= e,
  38583. this.y *= e,
  38584. this.z *= e,
  38585. this.w *= e) : (this.x = 0,
  38586. this.y = 0,
  38587. this.z = 0,
  38588. this.w = 0),
  38589. this
  38590. },
  38591. applyMatrix4: function(e) {
  38592. var t = this.x
  38593. , i = this.y
  38594. , n = this.z
  38595. , r = this.w
  38596. , o = e.elements;
  38597. return this.x = o[0] * t + o[4] * i + o[8] * n + o[12] * r,
  38598. this.y = o[1] * t + o[5] * i + o[9] * n + o[13] * r,
  38599. this.z = o[2] * t + o[6] * i + o[10] * n + o[14] * r,
  38600. this.w = o[3] * t + o[7] * i + o[11] * n + o[15] * r,
  38601. this
  38602. },
  38603. divideScalar: function(e) {
  38604. return this.multiplyScalar(1 / e)
  38605. },
  38606. setAxisAngleFromQuaternion: function(e) {
  38607. this.w = 2 * Math.acos(e.w);
  38608. var t = Math.sqrt(1 - e.w * e.w);
  38609. return t < 1e-4 ? (this.x = 1,
  38610. this.y = 0,
  38611. this.z = 0) : (this.x = e.x / t,
  38612. this.y = e.y / t,
  38613. this.z = e.z / t),
  38614. this
  38615. },
  38616. setAxisAngleFromRotationMatrix: function(e) {
  38617. var t, i, n, r, o = .01, a = .1, s = e.elements, l = s[0], c = s[4], h = s[8], u = s[1], d = s[5], p = s[9], f = s[2], g = s[6], m = s[10];
  38618. if (Math.abs(c - u) < o && Math.abs(h - f) < o && Math.abs(p - g) < o) {
  38619. if (Math.abs(c + u) < a && Math.abs(h + f) < a && Math.abs(p + g) < a && Math.abs(l + d + m - 3) < a)
  38620. return this.set(1, 0, 0, 0),
  38621. this;
  38622. t = Math.PI;
  38623. var v = (l + 1) / 2
  38624. , A = (d + 1) / 2
  38625. , y = (m + 1) / 2
  38626. , C = (c + u) / 4
  38627. , I = (h + f) / 4
  38628. , E = (p + g) / 4;
  38629. return v > A && v > y ? v < o ? (i = 0,
  38630. n = .707106781,
  38631. r = .707106781) : (i = Math.sqrt(v),
  38632. n = C / i,
  38633. r = I / i) : A > y ? A < o ? (i = .707106781,
  38634. n = 0,
  38635. r = .707106781) : (n = Math.sqrt(A),
  38636. i = C / n,
  38637. r = E / n) : y < o ? (i = .707106781,
  38638. n = .707106781,
  38639. r = 0) : (r = Math.sqrt(y),
  38640. i = I / r,
  38641. n = E / r),
  38642. this.set(i, n, r, t),
  38643. this
  38644. }
  38645. var b = Math.sqrt((g - p) * (g - p) + (h - f) * (h - f) + (u - c) * (u - c));
  38646. return Math.abs(b) < .001 && (b = 1),
  38647. this.x = (g - p) / b,
  38648. this.y = (h - f) / b,
  38649. this.z = (u - c) / b,
  38650. this.w = Math.acos((l + d + m - 1) / 2),
  38651. this
  38652. },
  38653. min: function(e) {
  38654. return this.x = Math.min(this.x, e.x),
  38655. this.y = Math.min(this.y, e.y),
  38656. this.z = Math.min(this.z, e.z),
  38657. this.w = Math.min(this.w, e.w),
  38658. this
  38659. },
  38660. max: function(e) {
  38661. return this.x = Math.max(this.x, e.x),
  38662. this.y = Math.max(this.y, e.y),
  38663. this.z = Math.max(this.z, e.z),
  38664. this.w = Math.max(this.w, e.w),
  38665. this
  38666. },
  38667. clamp: function(e, t) {
  38668. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  38669. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  38670. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  38671. this.w = Math.max(e.w, Math.min(t.w, this.w)),
  38672. this
  38673. },
  38674. clampScalar: function() {
  38675. var e, t;
  38676. return function(i, r) {
  38677. return void 0 === e && (e = new n.Vector4,
  38678. t = new n.Vector4),
  38679. e.set(i, i, i, i),
  38680. t.set(r, r, r, r),
  38681. this.clamp(e, t)
  38682. }
  38683. }(),
  38684. floor: function() {
  38685. return this.x = Math.floor(this.x),
  38686. this.y = Math.floor(this.y),
  38687. this.z = Math.floor(this.z),
  38688. this.w = Math.floor(this.w),
  38689. this
  38690. },
  38691. ceil: function() {
  38692. return this.x = Math.ceil(this.x),
  38693. this.y = Math.ceil(this.y),
  38694. this.z = Math.ceil(this.z),
  38695. this.w = Math.ceil(this.w),
  38696. this
  38697. },
  38698. round: function() {
  38699. return this.x = Math.round(this.x),
  38700. this.y = Math.round(this.y),
  38701. this.z = Math.round(this.z),
  38702. this.w = Math.round(this.w),
  38703. this
  38704. },
  38705. roundToZero: function() {
  38706. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  38707. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  38708. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  38709. this.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w),
  38710. this
  38711. },
  38712. negate: function() {
  38713. return this.x = -this.x,
  38714. this.y = -this.y,
  38715. this.z = -this.z,
  38716. this.w = -this.w,
  38717. this
  38718. },
  38719. dot: function(e) {
  38720. return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w
  38721. },
  38722. lengthSq: function() {
  38723. return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w
  38724. },
  38725. length: function() {
  38726. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w)
  38727. },
  38728. lengthManhattan: function() {
  38729. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w)
  38730. },
  38731. normalize: function() {
  38732. return this.divideScalar(this.length())
  38733. },
  38734. setLength: function(e) {
  38735. return this.multiplyScalar(e / this.length())
  38736. },
  38737. lerp: function(e, t) {
  38738. return this.x += (e.x - this.x) * t,
  38739. this.y += (e.y - this.y) * t,
  38740. this.z += (e.z - this.z) * t,
  38741. this.w += (e.w - this.w) * t,
  38742. this
  38743. },
  38744. lerpVectors: function(e, t, i) {
  38745. return this.subVectors(t, e).multiplyScalar(i).add(e),
  38746. this
  38747. },
  38748. equals: function(e) {
  38749. return e.x === this.x && e.y === this.y && e.z === this.z && e.w === this.w
  38750. },
  38751. fromArray: function(e, t) {
  38752. return void 0 === t && (t = 0),
  38753. this.x = e[t],
  38754. this.y = e[t + 1],
  38755. this.z = e[t + 2],
  38756. this.w = e[t + 3],
  38757. this
  38758. },
  38759. toArray: function(e, t) {
  38760. return void 0 === e && (e = []),
  38761. void 0 === t && (t = 0),
  38762. e[t] = this.x,
  38763. e[t + 1] = this.y,
  38764. e[t + 2] = this.z,
  38765. e[t + 3] = this.w,
  38766. e
  38767. },
  38768. fromAttribute: function(e, t, i) {
  38769. return void 0 === i && (i = 0),
  38770. t = t * e.itemSize + i,
  38771. this.x = e.array[t],
  38772. this.y = e.array[t + 1],
  38773. this.z = e.array[t + 2],
  38774. this.w = e.array[t + 3],
  38775. this
  38776. }
  38777. },
  38778. n.Euler = function(e, t, i, r) {
  38779. this._x = e || 0,
  38780. this._y = t || 0,
  38781. this._z = i || 0,
  38782. this._order = r || n.Euler.DefaultOrder
  38783. }
  38784. ,
  38785. n.Euler.RotationOrders = ["XYZ", "YZX", "ZXY", "XZY", "YXZ", "ZYX"],
  38786. n.Euler.DefaultOrder = "XYZ",
  38787. n.Euler.prototype = {
  38788. constructor: n.Euler,
  38789. get x() {
  38790. return this._x
  38791. },
  38792. set x(e) {
  38793. this._x = e,
  38794. this.onChangeCallback()
  38795. },
  38796. get y() {
  38797. return this._y
  38798. },
  38799. set y(e) {
  38800. this._y = e,
  38801. this.onChangeCallback()
  38802. },
  38803. get z() {
  38804. return this._z
  38805. },
  38806. set z(e) {
  38807. this._z = e,
  38808. this.onChangeCallback()
  38809. },
  38810. get order() {
  38811. return this._order
  38812. },
  38813. set order(e) {
  38814. this._order = e,
  38815. this.onChangeCallback()
  38816. },
  38817. set: function(e, t, i, n) {
  38818. return this._x = e,
  38819. this._y = t,
  38820. this._z = i,
  38821. this._order = n || this._order,
  38822. this.onChangeCallback(),
  38823. this
  38824. },
  38825. clone: function() {
  38826. return new this.constructor(this._x,this._y,this._z,this._order)
  38827. },
  38828. copy: function(e) {
  38829. return this._x = e._x,
  38830. this._y = e._y,
  38831. this._z = e._z,
  38832. this._order = e._order,
  38833. this.onChangeCallback(),
  38834. this
  38835. },
  38836. setFromRotationMatrix: function(e, t, i) {
  38837. var r = n.Math.clamp
  38838. , o = e.elements
  38839. , a = o[0]
  38840. , s = o[4]
  38841. , l = o[8]
  38842. , c = o[1]
  38843. , h = o[5]
  38844. , u = o[9]
  38845. , d = o[2]
  38846. , p = o[6]
  38847. , f = o[10];
  38848. return t = t || this._order,
  38849. "XYZ" === t ? (this._y = Math.asin(r(l, -1, 1)),
  38850. Math.abs(l) < .99999 ? (this._x = Math.atan2(-u, f),
  38851. this._z = Math.atan2(-s, a)) : (this._x = Math.atan2(p, h),
  38852. this._z = 0)) : "YXZ" === t ? (this._x = Math.asin(-r(u, -1, 1)),
  38853. Math.abs(u) < .99999 ? (this._y = Math.atan2(l, f),
  38854. this._z = Math.atan2(c, h)) : (this._y = Math.atan2(-d, a),
  38855. this._z = 0)) : "ZXY" === t ? (this._x = Math.asin(r(p, -1, 1)),
  38856. Math.abs(p) < .99999 ? (this._y = Math.atan2(-d, f),
  38857. this._z = Math.atan2(-s, h)) : (this._y = 0,
  38858. this._z = Math.atan2(c, a))) : "ZYX" === t ? (this._y = Math.asin(-r(d, -1, 1)),
  38859. Math.abs(d) < .99999 ? (this._x = Math.atan2(p, f),
  38860. this._z = Math.atan2(c, a)) : (this._x = 0,
  38861. this._z = Math.atan2(-s, h))) : "YZX" === t ? (this._z = Math.asin(r(c, -1, 1)),
  38862. Math.abs(c) < .99999 ? (this._x = Math.atan2(-u, h),
  38863. this._y = Math.atan2(-d, a)) : (this._x = 0,
  38864. this._y = Math.atan2(l, f))) : "XZY" === t ? (this._z = Math.asin(-r(s, -1, 1)),
  38865. Math.abs(s) < .99999 ? (this._x = Math.atan2(p, h),
  38866. this._y = Math.atan2(l, a)) : (this._x = Math.atan2(-u, f),
  38867. this._y = 0)) : console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: " + t),
  38868. this._order = t,
  38869. i !== !1 && this.onChangeCallback(),
  38870. this
  38871. },
  38872. setFromQuaternion: function() {
  38873. var e;
  38874. return function(t, i, r) {
  38875. return void 0 === e && (e = new n.Matrix4),
  38876. e.makeRotationFromQuaternion(t),
  38877. this.setFromRotationMatrix(e, i, r),
  38878. this
  38879. }
  38880. }(),
  38881. setFromVector3: function(e, t) {
  38882. return this.set(e.x, e.y, e.z, t || this._order)
  38883. },
  38884. reorder: function() {
  38885. var e = new n.Quaternion;
  38886. return function(t) {
  38887. e.setFromEuler(this),
  38888. this.setFromQuaternion(e, t)
  38889. }
  38890. }(),
  38891. equals: function(e) {
  38892. return e._x === this._x && e._y === this._y && e._z === this._z && e._order === this._order
  38893. },
  38894. fromArray: function(e) {
  38895. return this._x = e[0],
  38896. this._y = e[1],
  38897. this._z = e[2],
  38898. void 0 !== e[3] && (this._order = e[3]),
  38899. this.onChangeCallback(),
  38900. this
  38901. },
  38902. toArray: function(e, t) {
  38903. return void 0 === e && (e = []),
  38904. void 0 === t && (t = 0),
  38905. e[t] = this._x,
  38906. e[t + 1] = this._y,
  38907. e[t + 2] = this._z,
  38908. e[t + 3] = this._order,
  38909. e
  38910. },
  38911. toVector3: function(e) {
  38912. return e ? e.set(this._x, this._y, this._z) : new n.Vector3(this._x,this._y,this._z)
  38913. },
  38914. onChange: function(e) {
  38915. return this.onChangeCallback = e,
  38916. this
  38917. },
  38918. onChangeCallback: function() {}
  38919. },
  38920. n.Line3 = function(e, t) {
  38921. this.start = void 0 !== e ? e : new n.Vector3,
  38922. this.end = void 0 !== t ? t : new n.Vector3
  38923. }
  38924. ,
  38925. n.Line3.prototype = {
  38926. constructor: n.Line3,
  38927. set: function(e, t) {
  38928. return this.start.copy(e),
  38929. this.end.copy(t),
  38930. this
  38931. },
  38932. clone: function() {
  38933. return (new this.constructor).copy(this)
  38934. },
  38935. copy: function(e) {
  38936. return this.start.copy(e.start),
  38937. this.end.copy(e.end),
  38938. this
  38939. },
  38940. center: function(e) {
  38941. var t = e || new n.Vector3;
  38942. return t.addVectors(this.start, this.end).multiplyScalar(.5)
  38943. },
  38944. delta: function(e) {
  38945. var t = e || new n.Vector3;
  38946. return t.subVectors(this.end, this.start)
  38947. },
  38948. distanceSq: function() {
  38949. return this.start.distanceToSquared(this.end)
  38950. },
  38951. distance: function() {
  38952. return this.start.distanceTo(this.end)
  38953. },
  38954. at: function(e, t) {
  38955. var i = t || new n.Vector3;
  38956. return this.delta(i).multiplyScalar(e).add(this.start)
  38957. },
  38958. closestPointToPointParameter: function() {
  38959. var e = new n.Vector3
  38960. , t = new n.Vector3;
  38961. return function(i, r) {
  38962. e.subVectors(i, this.start),
  38963. t.subVectors(this.end, this.start);
  38964. var o = t.dot(t)
  38965. , a = t.dot(e)
  38966. , s = a / o;
  38967. return r && (s = n.Math.clamp(s, 0, 1)),
  38968. s
  38969. }
  38970. }(),
  38971. closestPointToPoint: function(e, t, i) {
  38972. var r = this.closestPointToPointParameter(e, t)
  38973. , o = i || new n.Vector3;
  38974. return this.delta(o).multiplyScalar(r).add(this.start)
  38975. },
  38976. applyMatrix4: function(e) {
  38977. return this.start.applyMatrix4(e),
  38978. this.end.applyMatrix4(e),
  38979. this
  38980. },
  38981. equals: function(e) {
  38982. return e.start.equals(this.start) && e.end.equals(this.end)
  38983. }
  38984. },
  38985. n.Box2 = function(e, t) {
  38986. this.min = void 0 !== e ? e : new n.Vector2(+(1 / 0),+(1 / 0)),
  38987. this.max = void 0 !== t ? t : new n.Vector2(-(1 / 0),-(1 / 0))
  38988. }
  38989. ,
  38990. n.Box2.prototype = {
  38991. constructor: n.Box2,
  38992. set: function(e, t) {
  38993. return this.min.copy(e),
  38994. this.max.copy(t),
  38995. this
  38996. },
  38997. setFromPoints: function(e) {
  38998. this.makeEmpty();
  38999. for (var t = 0, i = e.length; t < i; t++)
  39000. this.expandByPoint(e[t]);
  39001. return this
  39002. },
  39003. setFromCenterAndSize: function() {
  39004. var e = new n.Vector2;
  39005. return function(t, i) {
  39006. var n = e.copy(i).multiplyScalar(.5);
  39007. return this.min.copy(t).sub(n),
  39008. this.max.copy(t).add(n),
  39009. this
  39010. }
  39011. }(),
  39012. clone: function() {
  39013. return (new this.constructor).copy(this)
  39014. },
  39015. copy: function(e) {
  39016. return this.min.copy(e.min),
  39017. this.max.copy(e.max),
  39018. this
  39019. },
  39020. makeEmpty: function() {
  39021. return this.min.x = this.min.y = +(1 / 0),
  39022. this.max.x = this.max.y = -(1 / 0),
  39023. this
  39024. },
  39025. isEmpty: function() {
  39026. return this.max.x < this.min.x || this.max.y < this.min.y
  39027. },
  39028. center: function(e) {
  39029. var t = e || new n.Vector2;
  39030. return t.addVectors(this.min, this.max).multiplyScalar(.5)
  39031. },
  39032. size: function(e) {
  39033. var t = e || new n.Vector2;
  39034. return t.subVectors(this.max, this.min)
  39035. },
  39036. expandByPoint: function(e) {
  39037. return this.min.min(e),
  39038. this.max.max(e),
  39039. this
  39040. },
  39041. expandByVector: function(e) {
  39042. return this.min.sub(e),
  39043. this.max.add(e),
  39044. this
  39045. },
  39046. expandByScalar: function(e) {
  39047. return this.min.addScalar(-e),
  39048. this.max.addScalar(e),
  39049. this
  39050. },
  39051. containsPoint: function(e) {
  39052. return !(e.x < this.min.x || e.x > this.max.x || e.y < this.min.y || e.y > this.max.y)
  39053. },
  39054. containsBox: function(e) {
  39055. 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
  39056. },
  39057. getParameter: function(e, t) {
  39058. var i = t || new n.Vector2;
  39059. return i.set((e.x - this.min.x) / (this.max.x - this.min.x), (e.y - this.min.y) / (this.max.y - this.min.y))
  39060. },
  39061. intersectsBox: function(e) {
  39062. 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)
  39063. },
  39064. clampPoint: function(e, t) {
  39065. var i = t || new n.Vector2;
  39066. return i.copy(e).clamp(this.min, this.max)
  39067. },
  39068. distanceToPoint: function() {
  39069. var e = new n.Vector2;
  39070. return function(t) {
  39071. var i = e.copy(t).clamp(this.min, this.max);
  39072. return i.sub(t).length()
  39073. }
  39074. }(),
  39075. intersect: function(e) {
  39076. return this.min.max(e.min),
  39077. this.max.min(e.max),
  39078. this
  39079. },
  39080. union: function(e) {
  39081. return this.min.min(e.min),
  39082. this.max.max(e.max),
  39083. this
  39084. },
  39085. translate: function(e) {
  39086. return this.min.add(e),
  39087. this.max.add(e),
  39088. this
  39089. },
  39090. equals: function(e) {
  39091. return e.min.equals(this.min) && e.max.equals(this.max)
  39092. }
  39093. },
  39094. n.Box3 = function(e, t) {
  39095. this.min = void 0 !== e ? e : new n.Vector3(+(1 / 0),+(1 / 0),+(1 / 0)),
  39096. this.max = void 0 !== t ? t : new n.Vector3(-(1 / 0),-(1 / 0),-(1 / 0))
  39097. }
  39098. ,
  39099. n.Box3.prototype = {
  39100. constructor: n.Box3,
  39101. set: function(e, t) {
  39102. return this.min.copy(e),
  39103. this.max.copy(t),
  39104. this
  39105. },
  39106. setFromArray: function(e) {
  39107. this.makeEmpty();
  39108. 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) {
  39109. var c = e[s]
  39110. , h = e[s + 1]
  39111. , u = e[s + 2];
  39112. c < t && (t = c),
  39113. h < i && (i = h),
  39114. u < n && (n = u),
  39115. c > r && (r = c),
  39116. h > o && (o = h),
  39117. u > a && (a = u)
  39118. }
  39119. this.min.set(t, i, n),
  39120. this.max.set(r, o, a)
  39121. },
  39122. setFromPoints: function(e) {
  39123. this.makeEmpty();
  39124. for (var t = 0, i = e.length; t < i; t++)
  39125. this.expandByPoint(e[t]);
  39126. return this
  39127. },
  39128. setFromCenterAndSize: function() {
  39129. var e = new n.Vector3;
  39130. return function(t, i) {
  39131. var n = e.copy(i).multiplyScalar(.5);
  39132. return this.min.copy(t).sub(n),
  39133. this.max.copy(t).add(n),
  39134. this
  39135. }
  39136. }(),
  39137. setFromObject: function() {
  39138. var e;
  39139. return function(t) {
  39140. void 0 === e && (e = new n.Box3);
  39141. var i = this;
  39142. return this.makeEmpty(),
  39143. t.updateMatrixWorld(!0),
  39144. t.traverse(function(t) {
  39145. var n = t.geometry;
  39146. void 0 !== n && (null === n.boundingBox && n.computeBoundingBox(),
  39147. n.boundingBox.isEmpty() === !1 && (e.copy(n.boundingBox),
  39148. e.applyMatrix4(t.matrixWorld),
  39149. i.union(e)))
  39150. }),
  39151. this
  39152. }
  39153. }(),
  39154. clone: function() {
  39155. return (new this.constructor).copy(this)
  39156. },
  39157. copy: function(e) {
  39158. return this.min.copy(e.min),
  39159. this.max.copy(e.max),
  39160. this
  39161. },
  39162. makeEmpty: function() {
  39163. return this.min.x = this.min.y = this.min.z = +(1 / 0),
  39164. this.max.x = this.max.y = this.max.z = -(1 / 0),
  39165. this
  39166. },
  39167. isEmpty: function() {
  39168. return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z
  39169. },
  39170. center: function(e) {
  39171. var t = e || new n.Vector3;
  39172. return t.addVectors(this.min, this.max).multiplyScalar(.5)
  39173. },
  39174. size: function(e) {
  39175. var t = e || new n.Vector3;
  39176. return t.subVectors(this.max, this.min)
  39177. },
  39178. expandByPoint: function(e) {
  39179. return this.min.min(e),
  39180. this.max.max(e),
  39181. this
  39182. },
  39183. expandByVector: function(e) {
  39184. return this.min.sub(e),
  39185. this.max.add(e),
  39186. this
  39187. },
  39188. expandByScalar: function(e) {
  39189. return this.min.addScalar(-e),
  39190. this.max.addScalar(e),
  39191. this
  39192. },
  39193. containsPoint: function(e) {
  39194. 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)
  39195. },
  39196. containsBox: function(e) {
  39197. 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
  39198. },
  39199. getParameter: function(e, t) {
  39200. var i = t || new n.Vector3;
  39201. return i.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))
  39202. },
  39203. intersectsBox: function(e) {
  39204. 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)
  39205. },
  39206. intersectsSphere: function() {
  39207. var e;
  39208. return function(t) {
  39209. return void 0 === e && (e = new n.Vector3),
  39210. this.clampPoint(t.center, e),
  39211. e.distanceToSquared(t.center) <= t.radius * t.radius
  39212. }
  39213. }(),
  39214. intersectsPlane: function(e) {
  39215. var t, i;
  39216. return e.normal.x > 0 ? (t = e.normal.x * this.min.x,
  39217. i = e.normal.x * this.max.x) : (t = e.normal.x * this.max.x,
  39218. i = e.normal.x * this.min.x),
  39219. e.normal.y > 0 ? (t += e.normal.y * this.min.y,
  39220. i += e.normal.y * this.max.y) : (t += e.normal.y * this.max.y,
  39221. i += e.normal.y * this.min.y),
  39222. e.normal.z > 0 ? (t += e.normal.z * this.min.z,
  39223. i += e.normal.z * this.max.z) : (t += e.normal.z * this.max.z,
  39224. i += e.normal.z * this.min.z),
  39225. t <= e.constant && i >= e.constant
  39226. },
  39227. clampPoint: function(e, t) {
  39228. var i = t || new n.Vector3;
  39229. return i.copy(e).clamp(this.min, this.max)
  39230. },
  39231. distanceToPoint: function() {
  39232. var e = new n.Vector3;
  39233. return function(t) {
  39234. var i = e.copy(t).clamp(this.min, this.max);
  39235. return i.sub(t).length()
  39236. }
  39237. }(),
  39238. getBoundingSphere: function() {
  39239. var e = new n.Vector3;
  39240. return function(t) {
  39241. var i = t || new n.Sphere;
  39242. return i.center = this.center(),
  39243. i.radius = .5 * this.size(e).length(),
  39244. i
  39245. }
  39246. }(),
  39247. intersect: function(e) {
  39248. return this.min.max(e.min),
  39249. this.max.min(e.max),
  39250. this
  39251. },
  39252. union: function(e) {
  39253. return this.min.min(e.min),
  39254. this.max.max(e.max),
  39255. this
  39256. },
  39257. applyMatrix4: function() {
  39258. var e = [new n.Vector3, new n.Vector3, new n.Vector3, new n.Vector3, new n.Vector3, new n.Vector3, new n.Vector3, new n.Vector3];
  39259. return function(t) {
  39260. return e[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(t),
  39261. e[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(t),
  39262. e[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(t),
  39263. e[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(t),
  39264. e[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(t),
  39265. e[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(t),
  39266. e[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(t),
  39267. e[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(t),
  39268. this.makeEmpty(),
  39269. this.setFromPoints(e),
  39270. this
  39271. }
  39272. }(),
  39273. translate: function(e) {
  39274. return this.min.add(e),
  39275. this.max.add(e),
  39276. this
  39277. },
  39278. equals: function(e) {
  39279. return e.min.equals(this.min) && e.max.equals(this.max)
  39280. }
  39281. },
  39282. n.Matrix3 = function() {
  39283. this.elements = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]),
  39284. arguments.length > 0 && console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")
  39285. }
  39286. ,
  39287. n.Matrix3.prototype = {
  39288. constructor: n.Matrix3,
  39289. set: function(e, t, i, n, r, o, a, s, l) {
  39290. var c = this.elements;
  39291. return c[0] = e,
  39292. c[1] = n,
  39293. c[2] = a,
  39294. c[3] = t,
  39295. c[4] = r,
  39296. c[5] = s,
  39297. c[6] = i,
  39298. c[7] = o,
  39299. c[8] = l,
  39300. this
  39301. },
  39302. identity: function() {
  39303. return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1),
  39304. this
  39305. },
  39306. clone: function() {
  39307. return (new this.constructor).fromArray(this.elements)
  39308. },
  39309. copy: function(e) {
  39310. var t = e.elements;
  39311. return this.set(t[0], t[3], t[6], t[1], t[4], t[7], t[2], t[5], t[8]),
  39312. this
  39313. },
  39314. setFromMatrix4: function(e) {
  39315. var t = e.elements;
  39316. return this.set(t[0], t[4], t[8], t[1], t[5], t[9], t[2], t[6], t[10]),
  39317. this
  39318. },
  39319. applyToVector3Array: function() {
  39320. var e;
  39321. return function(t, i, r) {
  39322. void 0 === e && (e = new n.Vector3),
  39323. void 0 === i && (i = 0),
  39324. void 0 === r && (r = t.length);
  39325. for (var o = 0, a = i; o < r; o += 3,
  39326. a += 3)
  39327. e.fromArray(t, a),
  39328. e.applyMatrix3(this),
  39329. e.toArray(t, a);
  39330. return t
  39331. }
  39332. }(),
  39333. applyToBuffer: function() {
  39334. var e;
  39335. return function(t, i, r) {
  39336. void 0 === e && (e = new n.Vector3),
  39337. void 0 === i && (i = 0),
  39338. void 0 === r && (r = t.length / t.itemSize);
  39339. for (var o = 0, a = i; o < r; o++,
  39340. a++)
  39341. e.x = t.getX(a),
  39342. e.y = t.getY(a),
  39343. e.z = t.getZ(a),
  39344. e.applyMatrix3(this),
  39345. t.setXYZ(e.x, e.y, e.z);
  39346. return t
  39347. }
  39348. }(),
  39349. multiplyScalar: function(e) {
  39350. var t = this.elements;
  39351. return t[0] *= e,
  39352. t[3] *= e,
  39353. t[6] *= e,
  39354. t[1] *= e,
  39355. t[4] *= e,
  39356. t[7] *= e,
  39357. t[2] *= e,
  39358. t[5] *= e,
  39359. t[8] *= e,
  39360. this
  39361. },
  39362. determinant: function() {
  39363. var e = this.elements
  39364. , t = e[0]
  39365. , i = e[1]
  39366. , n = e[2]
  39367. , r = e[3]
  39368. , o = e[4]
  39369. , a = e[5]
  39370. , s = e[6]
  39371. , l = e[7]
  39372. , c = e[8];
  39373. return t * o * c - t * a * l - i * r * c + i * a * s + n * r * l - n * o * s
  39374. },
  39375. getInverse: function(e, t) {
  39376. e instanceof n.Matrix4 && console.warn("THREE.Matrix3.getInverse no longer takes a Matrix4 argument.");
  39377. var i = e.elements
  39378. , r = this.elements
  39379. , o = i[0]
  39380. , a = i[1]
  39381. , s = i[2]
  39382. , l = i[3]
  39383. , c = i[4]
  39384. , h = i[5]
  39385. , u = i[6]
  39386. , d = i[7]
  39387. , p = i[8]
  39388. , f = p * c - h * d
  39389. , g = h * u - p * l
  39390. , m = d * l - c * u
  39391. , v = o * f + a * g + s * m;
  39392. if (0 === v) {
  39393. var A = "THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0";
  39394. if (t)
  39395. throw new Error(A);
  39396. return console.warn(A),
  39397. this.identity()
  39398. }
  39399. return r[0] = f,
  39400. r[1] = s * d - p * a,
  39401. r[2] = h * a - s * c,
  39402. r[3] = g,
  39403. r[4] = p * o - s * u,
  39404. r[5] = s * l - h * o,
  39405. r[6] = m,
  39406. r[7] = a * u - d * o,
  39407. r[8] = c * o - a * l,
  39408. this.multiplyScalar(1 / v)
  39409. },
  39410. transpose: function() {
  39411. var e, t = this.elements;
  39412. return e = t[1],
  39413. t[1] = t[3],
  39414. t[3] = e,
  39415. e = t[2],
  39416. t[2] = t[6],
  39417. t[6] = e,
  39418. e = t[5],
  39419. t[5] = t[7],
  39420. t[7] = e,
  39421. this
  39422. },
  39423. flattenToArrayOffset: function(e, t) {
  39424. var i = this.elements;
  39425. return e[t] = i[0],
  39426. e[t + 1] = i[1],
  39427. e[t + 2] = i[2],
  39428. e[t + 3] = i[3],
  39429. e[t + 4] = i[4],
  39430. e[t + 5] = i[5],
  39431. e[t + 6] = i[6],
  39432. e[t + 7] = i[7],
  39433. e[t + 8] = i[8],
  39434. e
  39435. },
  39436. getNormalMatrix: function(e) {
  39437. return this.setFromMatrix4(e).getInverse(this).transpose()
  39438. },
  39439. transposeIntoArray: function(e) {
  39440. var t = this.elements;
  39441. return e[0] = t[0],
  39442. e[1] = t[3],
  39443. e[2] = t[6],
  39444. e[3] = t[1],
  39445. e[4] = t[4],
  39446. e[5] = t[7],
  39447. e[6] = t[2],
  39448. e[7] = t[5],
  39449. e[8] = t[8],
  39450. this
  39451. },
  39452. fromArray: function(e) {
  39453. return this.elements.set(e),
  39454. this
  39455. },
  39456. toArray: function() {
  39457. var e = this.elements;
  39458. return [e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8]]
  39459. }
  39460. },
  39461. n.Matrix4 = function() {
  39462. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  39463. arguments.length > 0 && console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  39464. }
  39465. ,
  39466. n.Matrix4.prototype = {
  39467. constructor: n.Matrix4,
  39468. set: function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  39469. var m = this.elements;
  39470. return m[0] = e,
  39471. m[4] = t,
  39472. m[8] = i,
  39473. m[12] = n,
  39474. m[1] = r,
  39475. m[5] = o,
  39476. m[9] = a,
  39477. m[13] = s,
  39478. m[2] = l,
  39479. m[6] = c,
  39480. m[10] = h,
  39481. m[14] = u,
  39482. m[3] = d,
  39483. m[7] = p,
  39484. m[11] = f,
  39485. m[15] = g,
  39486. this
  39487. },
  39488. identity: function() {
  39489. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  39490. this
  39491. },
  39492. clone: function() {
  39493. return (new n.Matrix4).fromArray(this.elements)
  39494. },
  39495. copy: function(e) {
  39496. return this.elements.set(e.elements),
  39497. this
  39498. },
  39499. copyPosition: function(e) {
  39500. var t = this.elements
  39501. , i = e.elements;
  39502. return t[12] = i[12],
  39503. t[13] = i[13],
  39504. t[14] = i[14],
  39505. this
  39506. },
  39507. extractBasis: function(e, t, i) {
  39508. return e.setFromMatrixColumn(this, 0),
  39509. t.setFromMatrixColumn(this, 1),
  39510. i.setFromMatrixColumn(this, 2),
  39511. this
  39512. },
  39513. makeBasis: function(e, t, i) {
  39514. 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),
  39515. this
  39516. },
  39517. extractRotation: function() {
  39518. var e;
  39519. return function(t) {
  39520. void 0 === e && (e = new n.Vector3);
  39521. var i = this.elements
  39522. , r = t.elements
  39523. , o = 1 / e.setFromMatrixColumn(t, 0).length()
  39524. , a = 1 / e.setFromMatrixColumn(t, 1).length()
  39525. , s = 1 / e.setFromMatrixColumn(t, 2).length();
  39526. return i[0] = r[0] * o,
  39527. i[1] = r[1] * o,
  39528. i[2] = r[2] * o,
  39529. i[4] = r[4] * a,
  39530. i[5] = r[5] * a,
  39531. i[6] = r[6] * a,
  39532. i[8] = r[8] * s,
  39533. i[9] = r[9] * s,
  39534. i[10] = r[10] * s,
  39535. this
  39536. }
  39537. }(),
  39538. makeRotationFromEuler: function(e) {
  39539. e instanceof n.Euler == !1 && console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  39540. var t = this.elements
  39541. , i = e.x
  39542. , r = e.y
  39543. , o = e.z
  39544. , a = Math.cos(i)
  39545. , s = Math.sin(i)
  39546. , l = Math.cos(r)
  39547. , c = Math.sin(r)
  39548. , h = Math.cos(o)
  39549. , u = Math.sin(o);
  39550. if ("XYZ" === e.order) {
  39551. var d = a * h
  39552. , p = a * u
  39553. , f = s * h
  39554. , g = s * u;
  39555. t[0] = l * h,
  39556. t[4] = -l * u,
  39557. t[8] = c,
  39558. t[1] = p + f * c,
  39559. t[5] = d - g * c,
  39560. t[9] = -s * l,
  39561. t[2] = g - d * c,
  39562. t[6] = f + p * c,
  39563. t[10] = a * l
  39564. } else if ("YXZ" === e.order) {
  39565. var m = l * h
  39566. , v = l * u
  39567. , A = c * h
  39568. , y = c * u;
  39569. t[0] = m + y * s,
  39570. t[4] = A * s - v,
  39571. t[8] = a * c,
  39572. t[1] = a * u,
  39573. t[5] = a * h,
  39574. t[9] = -s,
  39575. t[2] = v * s - A,
  39576. t[6] = y + m * s,
  39577. t[10] = a * l
  39578. } else if ("ZXY" === e.order) {
  39579. var m = l * h
  39580. , v = l * u
  39581. , A = c * h
  39582. , y = c * u;
  39583. t[0] = m - y * s,
  39584. t[4] = -a * u,
  39585. t[8] = A + v * s,
  39586. t[1] = v + A * s,
  39587. t[5] = a * h,
  39588. t[9] = y - m * s,
  39589. t[2] = -a * c,
  39590. t[6] = s,
  39591. t[10] = a * l
  39592. } else if ("ZYX" === e.order) {
  39593. var d = a * h
  39594. , p = a * u
  39595. , f = s * h
  39596. , g = s * u;
  39597. t[0] = l * h,
  39598. t[4] = f * c - p,
  39599. t[8] = d * c + g,
  39600. t[1] = l * u,
  39601. t[5] = g * c + d,
  39602. t[9] = p * c - f,
  39603. t[2] = -c,
  39604. t[6] = s * l,
  39605. t[10] = a * l
  39606. } else if ("YZX" === e.order) {
  39607. var C = a * l
  39608. , I = a * c
  39609. , E = s * l
  39610. , b = s * c;
  39611. t[0] = l * h,
  39612. t[4] = b - C * u,
  39613. t[8] = E * u + I,
  39614. t[1] = u,
  39615. t[5] = a * h,
  39616. t[9] = -s * h,
  39617. t[2] = -c * h,
  39618. t[6] = I * u + E,
  39619. t[10] = C - b * u
  39620. } else if ("XZY" === e.order) {
  39621. var C = a * l
  39622. , I = a * c
  39623. , E = s * l
  39624. , b = s * c;
  39625. t[0] = l * h,
  39626. t[4] = -u,
  39627. t[8] = c * h,
  39628. t[1] = C * u + b,
  39629. t[5] = a * h,
  39630. t[9] = I * u - E,
  39631. t[2] = E * u - I,
  39632. t[6] = s * h,
  39633. t[10] = b * u + C
  39634. }
  39635. return t[3] = 0,
  39636. t[7] = 0,
  39637. t[11] = 0,
  39638. t[12] = 0,
  39639. t[13] = 0,
  39640. t[14] = 0,
  39641. t[15] = 1,
  39642. this
  39643. },
  39644. makeRotationFromQuaternion: function(e) {
  39645. var t = this.elements
  39646. , i = e.x
  39647. , n = e.y
  39648. , r = e.z
  39649. , o = e.w
  39650. , a = i + i
  39651. , s = n + n
  39652. , l = r + r
  39653. , c = i * a
  39654. , h = i * s
  39655. , u = i * l
  39656. , d = n * s
  39657. , p = n * l
  39658. , f = r * l
  39659. , g = o * a
  39660. , m = o * s
  39661. , v = o * l;
  39662. return t[0] = 1 - (d + f),
  39663. t[4] = h - v,
  39664. t[8] = u + m,
  39665. t[1] = h + v,
  39666. t[5] = 1 - (c + f),
  39667. t[9] = p - g,
  39668. t[2] = u - m,
  39669. t[6] = p + g,
  39670. t[10] = 1 - (c + d),
  39671. t[3] = 0,
  39672. t[7] = 0,
  39673. t[11] = 0,
  39674. t[12] = 0,
  39675. t[13] = 0,
  39676. t[14] = 0,
  39677. t[15] = 1,
  39678. this
  39679. },
  39680. lookAt: function() {
  39681. var e, t, i;
  39682. return function(r, o, a) {
  39683. void 0 === e && (e = new n.Vector3),
  39684. void 0 === t && (t = new n.Vector3),
  39685. void 0 === i && (i = new n.Vector3);
  39686. var s = this.elements;
  39687. return i.subVectors(r, o).normalize(),
  39688. 0 === i.lengthSq() && (i.z = 1),
  39689. e.crossVectors(a, i).normalize(),
  39690. 0 === e.lengthSq() && (i.x += 1e-4,
  39691. e.crossVectors(a, i).normalize()),
  39692. t.crossVectors(i, e),
  39693. s[0] = e.x,
  39694. s[4] = t.x,
  39695. s[8] = i.x,
  39696. s[1] = e.y,
  39697. s[5] = t.y,
  39698. s[9] = i.y,
  39699. s[2] = e.z,
  39700. s[6] = t.z,
  39701. s[10] = i.z,
  39702. this
  39703. }
  39704. }(),
  39705. multiply: function(e, t) {
  39706. return void 0 !== t ? (console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),
  39707. this.multiplyMatrices(e, t)) : this.multiplyMatrices(this, e)
  39708. },
  39709. multiplyMatrices: function(e, t) {
  39710. var i = e.elements
  39711. , n = t.elements
  39712. , r = this.elements
  39713. , o = i[0]
  39714. , a = i[4]
  39715. , s = i[8]
  39716. , l = i[12]
  39717. , c = i[1]
  39718. , h = i[5]
  39719. , u = i[9]
  39720. , d = i[13]
  39721. , p = i[2]
  39722. , f = i[6]
  39723. , g = i[10]
  39724. , m = i[14]
  39725. , v = i[3]
  39726. , A = i[7]
  39727. , y = i[11]
  39728. , C = i[15]
  39729. , I = n[0]
  39730. , E = n[4]
  39731. , b = n[8]
  39732. , w = n[12]
  39733. , _ = n[1]
  39734. , T = n[5]
  39735. , x = n[9]
  39736. , S = n[13]
  39737. , M = n[2]
  39738. , R = n[6]
  39739. , P = n[10]
  39740. , O = n[14]
  39741. , L = n[3]
  39742. , D = n[7]
  39743. , N = n[11]
  39744. , B = n[15];
  39745. return r[0] = o * I + a * _ + s * M + l * L,
  39746. r[4] = o * E + a * T + s * R + l * D,
  39747. r[8] = o * b + a * x + s * P + l * N,
  39748. r[12] = o * w + a * S + s * O + l * B,
  39749. r[1] = c * I + h * _ + u * M + d * L,
  39750. r[5] = c * E + h * T + u * R + d * D,
  39751. r[9] = c * b + h * x + u * P + d * N,
  39752. r[13] = c * w + h * S + u * O + d * B,
  39753. r[2] = p * I + f * _ + g * M + m * L,
  39754. r[6] = p * E + f * T + g * R + m * D,
  39755. r[10] = p * b + f * x + g * P + m * N,
  39756. r[14] = p * w + f * S + g * O + m * B,
  39757. r[3] = v * I + A * _ + y * M + C * L,
  39758. r[7] = v * E + A * T + y * R + C * D,
  39759. r[11] = v * b + A * x + y * P + C * N,
  39760. r[15] = v * w + A * S + y * O + C * B,
  39761. this
  39762. },
  39763. multiplyToArray: function(e, t, i) {
  39764. var n = this.elements;
  39765. return this.multiplyMatrices(e, t),
  39766. i[0] = n[0],
  39767. i[1] = n[1],
  39768. i[2] = n[2],
  39769. i[3] = n[3],
  39770. i[4] = n[4],
  39771. i[5] = n[5],
  39772. i[6] = n[6],
  39773. i[7] = n[7],
  39774. i[8] = n[8],
  39775. i[9] = n[9],
  39776. i[10] = n[10],
  39777. i[11] = n[11],
  39778. i[12] = n[12],
  39779. i[13] = n[13],
  39780. i[14] = n[14],
  39781. i[15] = n[15],
  39782. this
  39783. },
  39784. multiplyScalar: function(e) {
  39785. var t = this.elements;
  39786. return t[0] *= e,
  39787. t[4] *= e,
  39788. t[8] *= e,
  39789. t[12] *= e,
  39790. t[1] *= e,
  39791. t[5] *= e,
  39792. t[9] *= e,
  39793. t[13] *= e,
  39794. t[2] *= e,
  39795. t[6] *= e,
  39796. t[10] *= e,
  39797. t[14] *= e,
  39798. t[3] *= e,
  39799. t[7] *= e,
  39800. t[11] *= e,
  39801. t[15] *= e,
  39802. this
  39803. },
  39804. applyToVector3Array: function() {
  39805. var e;
  39806. return function(t, i, r) {
  39807. void 0 === e && (e = new n.Vector3),
  39808. void 0 === i && (i = 0),
  39809. void 0 === r && (r = t.length);
  39810. for (var o = 0, a = i; o < r; o += 3,
  39811. a += 3)
  39812. e.fromArray(t, a),
  39813. e.applyMatrix4(this),
  39814. e.toArray(t, a);
  39815. return t
  39816. }
  39817. }(),
  39818. applyToBuffer: function() {
  39819. var e;
  39820. return function(t, i, r) {
  39821. void 0 === e && (e = new n.Vector3),
  39822. void 0 === i && (i = 0),
  39823. void 0 === r && (r = t.length / t.itemSize);
  39824. for (var o = 0, a = i; o < r; o++,
  39825. a++)
  39826. e.x = t.getX(a),
  39827. e.y = t.getY(a),
  39828. e.z = t.getZ(a),
  39829. e.applyMatrix4(this),
  39830. t.setXYZ(e.x, e.y, e.z);
  39831. return t
  39832. }
  39833. }(),
  39834. determinant: function() {
  39835. var e = this.elements
  39836. , t = e[0]
  39837. , i = e[4]
  39838. , n = e[8]
  39839. , r = e[12]
  39840. , o = e[1]
  39841. , a = e[5]
  39842. , s = e[9]
  39843. , l = e[13]
  39844. , c = e[2]
  39845. , h = e[6]
  39846. , u = e[10]
  39847. , d = e[14]
  39848. , p = e[3]
  39849. , f = e[7]
  39850. , g = e[11]
  39851. , m = e[15];
  39852. return p * (+r * s * h - n * l * h - r * a * u + i * l * u + n * a * d - i * s * d) + f * (+t * s * d - t * l * u + r * o * u - n * o * d + n * l * c - r * s * c) + g * (+t * l * h - t * a * d - r * o * h + i * o * d + r * a * c - i * l * c) + m * (-n * a * c - t * s * h + t * a * u + n * o * h - i * o * u + i * s * c)
  39853. },
  39854. transpose: function() {
  39855. var e, t = this.elements;
  39856. return e = t[1],
  39857. t[1] = t[4],
  39858. t[4] = e,
  39859. e = t[2],
  39860. t[2] = t[8],
  39861. t[8] = e,
  39862. e = t[6],
  39863. t[6] = t[9],
  39864. t[9] = e,
  39865. e = t[3],
  39866. t[3] = t[12],
  39867. t[12] = e,
  39868. e = t[7],
  39869. t[7] = t[13],
  39870. t[13] = e,
  39871. e = t[11],
  39872. t[11] = t[14],
  39873. t[14] = e,
  39874. this
  39875. },
  39876. flattenToArrayOffset: function(e, t) {
  39877. var i = this.elements;
  39878. return e[t] = i[0],
  39879. e[t + 1] = i[1],
  39880. e[t + 2] = i[2],
  39881. e[t + 3] = i[3],
  39882. e[t + 4] = i[4],
  39883. e[t + 5] = i[5],
  39884. e[t + 6] = i[6],
  39885. e[t + 7] = i[7],
  39886. e[t + 8] = i[8],
  39887. e[t + 9] = i[9],
  39888. e[t + 10] = i[10],
  39889. e[t + 11] = i[11],
  39890. e[t + 12] = i[12],
  39891. e[t + 13] = i[13],
  39892. e[t + 14] = i[14],
  39893. e[t + 15] = i[15],
  39894. e
  39895. },
  39896. getPosition: function() {
  39897. var e;
  39898. return function() {
  39899. return void 0 === e && (e = new n.Vector3),
  39900. console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),
  39901. e.setFromMatrixColumn(this, 3)
  39902. }
  39903. }(),
  39904. setPosition: function(e) {
  39905. var t = this.elements;
  39906. return t[12] = e.x,
  39907. t[13] = e.y,
  39908. t[14] = e.z,
  39909. this
  39910. },
  39911. getInverse: function(e, t) {
  39912. var i = this.elements
  39913. , n = e.elements
  39914. , r = n[0]
  39915. , o = n[1]
  39916. , a = n[2]
  39917. , s = n[3]
  39918. , l = n[4]
  39919. , c = n[5]
  39920. , h = n[6]
  39921. , u = n[7]
  39922. , d = n[8]
  39923. , p = n[9]
  39924. , f = n[10]
  39925. , g = n[11]
  39926. , m = n[12]
  39927. , v = n[13]
  39928. , A = n[14]
  39929. , y = n[15]
  39930. , C = p * A * u - v * f * u + v * h * g - c * A * g - p * h * y + c * f * y
  39931. , I = m * f * u - d * A * u - m * h * g + l * A * g + d * h * y - l * f * y
  39932. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * y + l * p * y
  39933. , b = m * p * h - d * v * h - m * c * f + l * v * f + d * c * A - l * p * A
  39934. , w = r * C + o * I + a * E + s * b;
  39935. if (0 === w) {
  39936. var _ = "THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  39937. if (t)
  39938. throw new Error(_);
  39939. return console.warn(_),
  39940. this.identity()
  39941. }
  39942. return i[0] = C,
  39943. i[1] = v * f * s - p * A * s - v * a * g + o * A * g + p * a * y - o * f * y,
  39944. i[2] = c * A * s - v * h * s + v * a * u - o * A * u - c * a * y + o * h * y,
  39945. i[3] = p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g,
  39946. i[4] = I,
  39947. i[5] = d * A * s - m * f * s + m * a * g - r * A * g - d * a * y + r * f * y,
  39948. i[6] = m * h * s - l * A * s - m * a * u + r * A * u + l * a * y - r * h * y,
  39949. i[7] = l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g,
  39950. i[8] = E,
  39951. i[9] = m * p * s - d * v * s - m * o * g + r * v * g + d * o * y - r * p * y,
  39952. i[10] = l * v * s - m * c * s + m * o * u - r * v * u - l * o * y + r * c * y,
  39953. i[11] = d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g,
  39954. i[12] = b,
  39955. i[13] = d * v * a - m * p * a + m * o * f - r * v * f - d * o * A + r * p * A,
  39956. i[14] = m * c * a - l * v * a - m * o * h + r * v * h + l * o * A - r * c * A,
  39957. i[15] = l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f,
  39958. this.multiplyScalar(1 / w)
  39959. },
  39960. scale: function(e) {
  39961. var t = this.elements
  39962. , i = e.x
  39963. , n = e.y
  39964. , r = e.z;
  39965. return t[0] *= i,
  39966. t[4] *= n,
  39967. t[8] *= r,
  39968. t[1] *= i,
  39969. t[5] *= n,
  39970. t[9] *= r,
  39971. t[2] *= i,
  39972. t[6] *= n,
  39973. t[10] *= r,
  39974. t[3] *= i,
  39975. t[7] *= n,
  39976. t[11] *= r,
  39977. this
  39978. },
  39979. getMaxScaleOnAxis: function() {
  39980. var e = this.elements
  39981. , t = e[0] * e[0] + e[1] * e[1] + e[2] * e[2]
  39982. , i = e[4] * e[4] + e[5] * e[5] + e[6] * e[6]
  39983. , n = e[8] * e[8] + e[9] * e[9] + e[10] * e[10];
  39984. return Math.sqrt(Math.max(t, i, n))
  39985. },
  39986. makeTranslation: function(e, t, i) {
  39987. return this.set(1, 0, 0, e, 0, 1, 0, t, 0, 0, 1, i, 0, 0, 0, 1),
  39988. this
  39989. },
  39990. makeRotationX: function(e) {
  39991. var t = Math.cos(e)
  39992. , i = Math.sin(e);
  39993. return this.set(1, 0, 0, 0, 0, t, -i, 0, 0, i, t, 0, 0, 0, 0, 1),
  39994. this
  39995. },
  39996. makeRotationY: function(e) {
  39997. var t = Math.cos(e)
  39998. , i = Math.sin(e);
  39999. return this.set(t, 0, i, 0, 0, 1, 0, 0, -i, 0, t, 0, 0, 0, 0, 1),
  40000. this
  40001. },
  40002. makeRotationZ: function(e) {
  40003. var t = Math.cos(e)
  40004. , i = Math.sin(e);
  40005. return this.set(t, -i, 0, 0, i, t, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  40006. this
  40007. },
  40008. makeRotationAxis: function(e, t) {
  40009. var i = Math.cos(t)
  40010. , n = Math.sin(t)
  40011. , r = 1 - i
  40012. , o = e.x
  40013. , a = e.y
  40014. , s = e.z
  40015. , l = r * o
  40016. , c = r * a;
  40017. 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),
  40018. this
  40019. },
  40020. makeScale: function(e, t, i) {
  40021. return this.set(e, 0, 0, 0, 0, t, 0, 0, 0, 0, i, 0, 0, 0, 0, 1),
  40022. this
  40023. },
  40024. compose: function(e, t, i) {
  40025. return this.makeRotationFromQuaternion(t),
  40026. this.scale(i),
  40027. this.setPosition(e),
  40028. this
  40029. },
  40030. decompose: function() {
  40031. var e, t;
  40032. return function(i, r, o) {
  40033. void 0 === e && (e = new n.Vector3),
  40034. void 0 === t && (t = new n.Matrix4);
  40035. var a = this.elements
  40036. , s = e.set(a[0], a[1], a[2]).length()
  40037. , l = e.set(a[4], a[5], a[6]).length()
  40038. , c = e.set(a[8], a[9], a[10]).length()
  40039. , h = this.determinant();
  40040. h < 0 && (s = -s),
  40041. i.x = a[12],
  40042. i.y = a[13],
  40043. i.z = a[14],
  40044. t.elements.set(this.elements);
  40045. var u = 1 / s
  40046. , d = 1 / l
  40047. , p = 1 / c;
  40048. return t.elements[0] *= u,
  40049. t.elements[1] *= u,
  40050. t.elements[2] *= u,
  40051. t.elements[4] *= d,
  40052. t.elements[5] *= d,
  40053. t.elements[6] *= d,
  40054. t.elements[8] *= p,
  40055. t.elements[9] *= p,
  40056. t.elements[10] *= p,
  40057. r.setFromRotationMatrix(t),
  40058. o.x = s,
  40059. o.y = l,
  40060. o.z = c,
  40061. this
  40062. }
  40063. }(),
  40064. makeFrustum: function(e, t, i, n, r, o) {
  40065. var a = this.elements
  40066. , s = 2 * r / (t - e)
  40067. , l = 2 * r / (n - i)
  40068. , c = (t + e) / (t - e)
  40069. , h = (n + i) / (n - i)
  40070. , u = -(o + r) / (o - r)
  40071. , d = -2 * o * r / (o - r);
  40072. return a[0] = s,
  40073. a[4] = 0,
  40074. a[8] = c,
  40075. a[12] = 0,
  40076. a[1] = 0,
  40077. a[5] = l,
  40078. a[9] = h,
  40079. a[13] = 0,
  40080. a[2] = 0,
  40081. a[6] = 0,
  40082. a[10] = u,
  40083. a[14] = d,
  40084. a[3] = 0,
  40085. a[7] = 0,
  40086. a[11] = -1,
  40087. a[15] = 0,
  40088. this
  40089. },
  40090. makePerspective: function(e, t, i, r) {
  40091. var o = i * Math.tan(n.Math.degToRad(.5 * e))
  40092. , a = -o
  40093. , s = a * t
  40094. , l = o * t;
  40095. return this.makeFrustum(s, l, a, o, i, r)
  40096. },
  40097. makeOrthographic: function(e, t, i, n, r, o) {
  40098. var a = this.elements
  40099. , s = 1 / (t - e)
  40100. , l = 1 / (i - n)
  40101. , c = 1 / (o - r)
  40102. , h = (t + e) * s
  40103. , u = (i + n) * l
  40104. , d = (o + r) * c;
  40105. return a[0] = 2 * s,
  40106. a[4] = 0,
  40107. a[8] = 0,
  40108. a[12] = -h,
  40109. a[1] = 0,
  40110. a[5] = 2 * l,
  40111. a[9] = 0,
  40112. a[13] = -u,
  40113. a[2] = 0,
  40114. a[6] = 0,
  40115. a[10] = -2 * c,
  40116. a[14] = -d,
  40117. a[3] = 0,
  40118. a[7] = 0,
  40119. a[11] = 0,
  40120. a[15] = 1,
  40121. this
  40122. },
  40123. equals: function(e) {
  40124. for (var t = this.elements, i = e.elements, n = 0; n < 16; n++)
  40125. if (t[n] !== i[n])
  40126. return !1;
  40127. return !0
  40128. },
  40129. fromArray: function(e) {
  40130. return this.elements.set(e),
  40131. this
  40132. },
  40133. toArray: function() {
  40134. var e = this.elements;
  40135. 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]]
  40136. }
  40137. },
  40138. n.Ray = function(e, t) {
  40139. this.origin = void 0 !== e ? e : new n.Vector3,
  40140. this.direction = void 0 !== t ? t : new n.Vector3
  40141. }
  40142. ,
  40143. n.Ray.prototype = {
  40144. constructor: n.Ray,
  40145. set: function(e, t) {
  40146. return this.origin.copy(e),
  40147. this.direction.copy(t),
  40148. this
  40149. },
  40150. clone: function() {
  40151. return (new this.constructor).copy(this)
  40152. },
  40153. copy: function(e) {
  40154. return this.origin.copy(e.origin),
  40155. this.direction.copy(e.direction),
  40156. this
  40157. },
  40158. at: function(e, t) {
  40159. var i = t || new n.Vector3;
  40160. return i.copy(this.direction).multiplyScalar(e).add(this.origin)
  40161. },
  40162. lookAt: function(e) {
  40163. this.direction.copy(e).sub(this.origin).normalize()
  40164. },
  40165. recast: function() {
  40166. var e = new n.Vector3;
  40167. return function(t) {
  40168. return this.origin.copy(this.at(t, e)),
  40169. this
  40170. }
  40171. }(),
  40172. closestPointToPoint: function(e, t) {
  40173. var i = t || new n.Vector3;
  40174. i.subVectors(e, this.origin);
  40175. var r = i.dot(this.direction);
  40176. return r < 0 ? i.copy(this.origin) : i.copy(this.direction).multiplyScalar(r).add(this.origin)
  40177. },
  40178. distanceToPoint: function(e) {
  40179. return Math.sqrt(this.distanceSqToPoint(e))
  40180. },
  40181. distanceSqToPoint: function() {
  40182. var e = new n.Vector3;
  40183. return function(t) {
  40184. var i = e.subVectors(t, this.origin).dot(this.direction);
  40185. return i < 0 ? this.origin.distanceToSquared(t) : (e.copy(this.direction).multiplyScalar(i).add(this.origin),
  40186. e.distanceToSquared(t))
  40187. }
  40188. }(),
  40189. distanceSqToSegment: function() {
  40190. var e = new n.Vector3
  40191. , t = new n.Vector3
  40192. , i = new n.Vector3;
  40193. return function(n, r, o, a) {
  40194. e.copy(n).add(r).multiplyScalar(.5),
  40195. t.copy(r).sub(n).normalize(),
  40196. i.copy(this.origin).sub(e);
  40197. var s, l, c, h, u = .5 * n.distanceTo(r), d = -this.direction.dot(t), p = i.dot(this.direction), f = -i.dot(t), g = i.lengthSq(), m = Math.abs(1 - d * d);
  40198. if (m > 0)
  40199. if (s = d * f - p,
  40200. l = d * p - f,
  40201. h = u * m,
  40202. s >= 0)
  40203. if (l >= -h)
  40204. if (l <= h) {
  40205. var v = 1 / m;
  40206. s *= v,
  40207. l *= v,
  40208. c = s * (s + d * l + 2 * p) + l * (d * s + l + 2 * f) + g
  40209. } else
  40210. l = u,
  40211. s = Math.max(0, -(d * l + p)),
  40212. c = -s * s + l * (l + 2 * f) + g;
  40213. else
  40214. l = -u,
  40215. s = Math.max(0, -(d * l + p)),
  40216. c = -s * s + l * (l + 2 * f) + g;
  40217. else
  40218. l <= -h ? (s = Math.max(0, -(-d * u + p)),
  40219. l = s > 0 ? -u : Math.min(Math.max(-u, -f), u),
  40220. c = -s * s + l * (l + 2 * f) + g) : l <= h ? (s = 0,
  40221. l = Math.min(Math.max(-u, -f), u),
  40222. c = l * (l + 2 * f) + g) : (s = Math.max(0, -(d * u + p)),
  40223. l = s > 0 ? u : Math.min(Math.max(-u, -f), u),
  40224. c = -s * s + l * (l + 2 * f) + g);
  40225. else
  40226. l = d > 0 ? -u : u,
  40227. s = Math.max(0, -(d * l + p)),
  40228. c = -s * s + l * (l + 2 * f) + g;
  40229. return o && o.copy(this.direction).multiplyScalar(s).add(this.origin),
  40230. a && a.copy(t).multiplyScalar(l).add(e),
  40231. c
  40232. }
  40233. }(),
  40234. intersectSphere: function() {
  40235. var e = new n.Vector3;
  40236. return function(t, i) {
  40237. e.subVectors(t.center, this.origin);
  40238. var n = e.dot(this.direction)
  40239. , r = e.dot(e) - n * n
  40240. , o = t.radius * t.radius;
  40241. if (r > o)
  40242. return null;
  40243. var a = Math.sqrt(o - r)
  40244. , s = n - a
  40245. , l = n + a;
  40246. return s < 0 && l < 0 ? null : s < 0 ? this.at(l, i) : this.at(s, i)
  40247. }
  40248. }(),
  40249. intersectsSphere: function(e) {
  40250. return this.distanceToPoint(e.center) <= e.radius
  40251. },
  40252. distanceToPlane: function(e) {
  40253. var t = e.normal.dot(this.direction);
  40254. if (0 === t)
  40255. return 0 === e.distanceToPoint(this.origin) ? 0 : null;
  40256. var i = -(this.origin.dot(e.normal) + e.constant) / t;
  40257. return i >= 0 ? i : null
  40258. },
  40259. intersectPlane: function(e, t) {
  40260. var i = this.distanceToPlane(e);
  40261. return null === i ? null : this.at(i, t)
  40262. },
  40263. intersectsPlane: function(e) {
  40264. var t = e.distanceToPoint(this.origin);
  40265. if (0 === t)
  40266. return !0;
  40267. var i = e.normal.dot(this.direction);
  40268. return i * t < 0
  40269. },
  40270. intersectBox: function(e, t) {
  40271. 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;
  40272. return l >= 0 ? (i = (e.min.x - u.x) * l,
  40273. n = (e.max.x - u.x) * l) : (i = (e.max.x - u.x) * l,
  40274. n = (e.min.x - u.x) * l),
  40275. c >= 0 ? (r = (e.min.y - u.y) * c,
  40276. o = (e.max.y - u.y) * c) : (r = (e.max.y - u.y) * c,
  40277. o = (e.min.y - u.y) * c),
  40278. i > o || r > n ? null : ((r > i || i !== i) && (i = r),
  40279. (o < n || n !== n) && (n = o),
  40280. h >= 0 ? (a = (e.min.z - u.z) * h,
  40281. s = (e.max.z - u.z) * h) : (a = (e.max.z - u.z) * h,
  40282. s = (e.min.z - u.z) * h),
  40283. i > s || a > n ? null : ((a > i || i !== i) && (i = a),
  40284. (s < n || n !== n) && (n = s),
  40285. n < 0 ? null : this.at(i >= 0 ? i : n, t)))
  40286. },
  40287. intersectsBox: function() {
  40288. var e = new n.Vector3;
  40289. return function(t) {
  40290. return null !== this.intersectBox(t, e)
  40291. }
  40292. }(),
  40293. intersectTriangle: function() {
  40294. var e = new n.Vector3
  40295. , t = new n.Vector3
  40296. , i = new n.Vector3
  40297. , r = new n.Vector3;
  40298. return function(n, o, a, s, l) {
  40299. t.subVectors(o, n),
  40300. i.subVectors(a, n),
  40301. r.crossVectors(t, i);
  40302. var c, h = this.direction.dot(r);
  40303. if (h > 0) {
  40304. if (s)
  40305. return null;
  40306. c = 1
  40307. } else {
  40308. if (!(h < 0))
  40309. return null;
  40310. c = -1,
  40311. h = -h
  40312. }
  40313. e.subVectors(this.origin, n);
  40314. var u = c * this.direction.dot(i.crossVectors(e, i));
  40315. if (u < 0)
  40316. return null;
  40317. var d = c * this.direction.dot(t.cross(e));
  40318. if (d < 0)
  40319. return null;
  40320. if (u + d > h)
  40321. return null;
  40322. var p = -c * e.dot(r);
  40323. return p < 0 ? null : this.at(p / h, l)
  40324. }
  40325. }(),
  40326. applyMatrix4: function(e) {
  40327. return this.direction.add(this.origin).applyMatrix4(e),
  40328. this.origin.applyMatrix4(e),
  40329. this.direction.sub(this.origin),
  40330. this.direction.normalize(),
  40331. this
  40332. },
  40333. equals: function(e) {
  40334. return e.origin.equals(this.origin) && e.direction.equals(this.direction)
  40335. }
  40336. },
  40337. n.Sphere = function(e, t) {
  40338. this.center = void 0 !== e ? e : new n.Vector3,
  40339. this.radius = void 0 !== t ? t : 0
  40340. }
  40341. ,
  40342. n.Sphere.prototype = {
  40343. constructor: n.Sphere,
  40344. set: function(e, t) {
  40345. return this.center.copy(e),
  40346. this.radius = t,
  40347. this
  40348. },
  40349. setFromPoints: function() {
  40350. var e = new n.Box3;
  40351. return function(t, i) {
  40352. var n = this.center;
  40353. void 0 !== i ? n.copy(i) : e.setFromPoints(t).center(n);
  40354. for (var r = 0, o = 0, a = t.length; o < a; o++)
  40355. r = Math.max(r, n.distanceToSquared(t[o]));
  40356. return this.radius = Math.sqrt(r),
  40357. this
  40358. }
  40359. }(),
  40360. clone: function() {
  40361. return (new this.constructor).copy(this)
  40362. },
  40363. copy: function(e) {
  40364. return this.center.copy(e.center),
  40365. this.radius = e.radius,
  40366. this
  40367. },
  40368. empty: function() {
  40369. return this.radius <= 0
  40370. },
  40371. containsPoint: function(e) {
  40372. return e.distanceToSquared(this.center) <= this.radius * this.radius
  40373. },
  40374. distanceToPoint: function(e) {
  40375. return e.distanceTo(this.center) - this.radius
  40376. },
  40377. intersectsSphere: function(e) {
  40378. var t = this.radius + e.radius;
  40379. return e.center.distanceToSquared(this.center) <= t * t
  40380. },
  40381. intersectsBox: function(e) {
  40382. return e.intersectsSphere(this)
  40383. },
  40384. intersectsPlane: function(e) {
  40385. return Math.abs(this.center.dot(e.normal) - e.constant) <= this.radius
  40386. },
  40387. clampPoint: function(e, t) {
  40388. var i = this.center.distanceToSquared(e)
  40389. , r = t || new n.Vector3;
  40390. return r.copy(e),
  40391. i > this.radius * this.radius && (r.sub(this.center).normalize(),
  40392. r.multiplyScalar(this.radius).add(this.center)),
  40393. r
  40394. },
  40395. getBoundingBox: function(e) {
  40396. var t = e || new n.Box3;
  40397. return t.set(this.center, this.center),
  40398. t.expandByScalar(this.radius),
  40399. t
  40400. },
  40401. applyMatrix4: function(e) {
  40402. return this.center.applyMatrix4(e),
  40403. this.radius = this.radius * e.getMaxScaleOnAxis(),
  40404. this
  40405. },
  40406. translate: function(e) {
  40407. return this.center.add(e),
  40408. this
  40409. },
  40410. equals: function(e) {
  40411. return e.center.equals(this.center) && e.radius === this.radius
  40412. }
  40413. },
  40414. n.Frustum = function(e, t, i, r, o, a) {
  40415. this.planes = [void 0 !== e ? e : new n.Plane, void 0 !== t ? t : new n.Plane, void 0 !== i ? i : new n.Plane, void 0 !== r ? r : new n.Plane, void 0 !== o ? o : new n.Plane, void 0 !== a ? a : new n.Plane]
  40416. }
  40417. ,
  40418. n.Frustum.prototype = {
  40419. constructor: n.Frustum,
  40420. set: function(e, t, i, n, r, o) {
  40421. var a = this.planes;
  40422. return a[0].copy(e),
  40423. a[1].copy(t),
  40424. a[2].copy(i),
  40425. a[3].copy(n),
  40426. a[4].copy(r),
  40427. a[5].copy(o),
  40428. this
  40429. },
  40430. clone: function() {
  40431. return (new this.constructor).copy(this)
  40432. },
  40433. copy: function(e) {
  40434. for (var t = this.planes, i = 0; i < 6; i++)
  40435. t[i].copy(e.planes[i]);
  40436. return this
  40437. },
  40438. setFromMatrix: function(e) {
  40439. var t = this.planes
  40440. , i = e.elements
  40441. , n = i[0]
  40442. , r = i[1]
  40443. , o = i[2]
  40444. , a = i[3]
  40445. , s = i[4]
  40446. , l = i[5]
  40447. , c = i[6]
  40448. , h = i[7]
  40449. , u = i[8]
  40450. , d = i[9]
  40451. , p = i[10]
  40452. , f = i[11]
  40453. , g = i[12]
  40454. , m = i[13]
  40455. , v = i[14]
  40456. , A = i[15];
  40457. return t[0].setComponents(a - n, h - s, f - u, A - g).normalize(),
  40458. t[1].setComponents(a + n, h + s, f + u, A + g).normalize(),
  40459. t[2].setComponents(a + r, h + l, f + d, A + m).normalize(),
  40460. t[3].setComponents(a - r, h - l, f - d, A - m).normalize(),
  40461. t[4].setComponents(a - o, h - c, f - p, A - v).normalize(),
  40462. t[5].setComponents(a + o, h + c, f + p, A + v).normalize(),
  40463. this
  40464. },
  40465. intersectsObject: function() {
  40466. var e = new n.Sphere;
  40467. return function(t) {
  40468. var i = t.geometry;
  40469. return null === i.boundingSphere && i.computeBoundingSphere(),
  40470. e.copy(i.boundingSphere),
  40471. e.applyMatrix4(t.matrixWorld),
  40472. this.intersectsSphere(e)
  40473. }
  40474. }(),
  40475. intersectsSphere: function(e) {
  40476. for (var t = this.planes, i = e.center, n = -e.radius, r = 0; r < 6; r++) {
  40477. var o = t[r].distanceToPoint(i);
  40478. if (o < n)
  40479. return !1
  40480. }
  40481. return !0
  40482. },
  40483. intersectsBox: function() {
  40484. var e = new n.Vector3
  40485. , t = new n.Vector3;
  40486. return function(i) {
  40487. for (var n = this.planes, r = 0; r < 6; r++) {
  40488. var o = n[r];
  40489. e.x = o.normal.x > 0 ? i.min.x : i.max.x,
  40490. t.x = o.normal.x > 0 ? i.max.x : i.min.x,
  40491. e.y = o.normal.y > 0 ? i.min.y : i.max.y,
  40492. t.y = o.normal.y > 0 ? i.max.y : i.min.y,
  40493. e.z = o.normal.z > 0 ? i.min.z : i.max.z,
  40494. t.z = o.normal.z > 0 ? i.max.z : i.min.z;
  40495. var a = o.distanceToPoint(e)
  40496. , s = o.distanceToPoint(t);
  40497. if (a < 0 && s < 0)
  40498. return !1
  40499. }
  40500. return !0
  40501. }
  40502. }(),
  40503. containsPoint: function(e) {
  40504. for (var t = this.planes, i = 0; i < 6; i++)
  40505. if (t[i].distanceToPoint(e) < 0)
  40506. return !1;
  40507. return !0
  40508. }
  40509. },
  40510. n.Plane = function(e, t) {
  40511. this.normal = void 0 !== e ? e : new n.Vector3(1,0,0),
  40512. this.constant = void 0 !== t ? t : 0
  40513. }
  40514. ,
  40515. n.Plane.prototype = {
  40516. constructor: n.Plane,
  40517. set: function(e, t) {
  40518. return this.normal.copy(e),
  40519. this.constant = t,
  40520. this
  40521. },
  40522. setComponents: function(e, t, i, n) {
  40523. return this.normal.set(e, t, i),
  40524. this.constant = n,
  40525. this
  40526. },
  40527. setFromNormalAndCoplanarPoint: function(e, t) {
  40528. return this.normal.copy(e),
  40529. this.constant = -t.dot(this.normal),
  40530. this
  40531. },
  40532. setFromCoplanarPoints: function() {
  40533. var e = new n.Vector3
  40534. , t = new n.Vector3;
  40535. return function(i, n, r) {
  40536. var o = e.subVectors(r, n).cross(t.subVectors(i, n)).normalize();
  40537. return this.setFromNormalAndCoplanarPoint(o, i),
  40538. this
  40539. }
  40540. }(),
  40541. clone: function() {
  40542. return (new this.constructor).copy(this)
  40543. },
  40544. copy: function(e) {
  40545. return this.normal.copy(e.normal),
  40546. this.constant = e.constant,
  40547. this
  40548. },
  40549. normalize: function() {
  40550. var e = 1 / this.normal.length();
  40551. return this.normal.multiplyScalar(e),
  40552. this.constant *= e,
  40553. this
  40554. },
  40555. negate: function() {
  40556. return this.constant *= -1,
  40557. this.normal.negate(),
  40558. this
  40559. },
  40560. distanceToPoint: function(e) {
  40561. return this.normal.dot(e) + this.constant
  40562. },
  40563. distanceToSphere: function(e) {
  40564. return this.distanceToPoint(e.center) - e.radius
  40565. },
  40566. projectPoint: function(e, t) {
  40567. return this.orthoPoint(e, t).sub(e).negate()
  40568. },
  40569. orthoPoint: function(e, t) {
  40570. var i = this.distanceToPoint(e)
  40571. , r = t || new n.Vector3;
  40572. return r.copy(this.normal).multiplyScalar(i)
  40573. },
  40574. intersectLine: function() {
  40575. var e = new n.Vector3;
  40576. return function(t, i) {
  40577. var r = i || new n.Vector3
  40578. , o = t.delta(e)
  40579. , a = this.normal.dot(o);
  40580. if (0 !== a) {
  40581. var s = -(t.start.dot(this.normal) + this.constant) / a;
  40582. if (!(s < 0 || s > 1))
  40583. return r.copy(o).multiplyScalar(s).add(t.start)
  40584. } else if (0 === this.distanceToPoint(t.start))
  40585. return r.copy(t.start)
  40586. }
  40587. }(),
  40588. intersectsLine: function(e) {
  40589. var t = this.distanceToPoint(e.start)
  40590. , i = this.distanceToPoint(e.end);
  40591. return t < 0 && i > 0 || i < 0 && t > 0
  40592. },
  40593. intersectsBox: function(e) {
  40594. return e.intersectsPlane(this)
  40595. },
  40596. intersectsSphere: function(e) {
  40597. return e.intersectsPlane(this)
  40598. },
  40599. coplanarPoint: function(e) {
  40600. var t = e || new n.Vector3;
  40601. return t.copy(this.normal).multiplyScalar(-this.constant)
  40602. },
  40603. applyMatrix4: function() {
  40604. var e = new n.Vector3
  40605. , t = new n.Vector3
  40606. , i = new n.Matrix3;
  40607. return function(n, r) {
  40608. var o = r || i.getNormalMatrix(n)
  40609. , a = e.copy(this.normal).applyMatrix3(o)
  40610. , s = this.coplanarPoint(t);
  40611. return s.applyMatrix4(n),
  40612. this.setFromNormalAndCoplanarPoint(a, s),
  40613. this
  40614. }
  40615. }(),
  40616. translate: function(e) {
  40617. return this.constant = this.constant - e.dot(this.normal),
  40618. this
  40619. },
  40620. equals: function(e) {
  40621. return e.normal.equals(this.normal) && e.constant === this.constant
  40622. }
  40623. },
  40624. n.Spherical = function(e, t, i) {
  40625. return this.radius = void 0 !== e ? e : 1,
  40626. this.phi = void 0 !== t ? t : 0,
  40627. this.theta = void 0 !== i ? i : 0,
  40628. this
  40629. }
  40630. ,
  40631. n.Spherical.prototype = {
  40632. constructor: n.Spherical,
  40633. set: function(e, t, i) {
  40634. this.radius = e,
  40635. this.phi = t,
  40636. this.theta = i
  40637. },
  40638. clone: function() {
  40639. return (new this.constructor).copy(this)
  40640. },
  40641. copy: function(e) {
  40642. return this.radius.copy(e.radius),
  40643. this.phi.copy(e.phi),
  40644. this.theta.copy(e.theta),
  40645. this
  40646. },
  40647. makeSafe: function() {
  40648. var e = 1e-6;
  40649. this.phi = Math.max(e, Math.min(Math.PI - e, this.phi))
  40650. },
  40651. setFromVector3: function(e) {
  40652. return this.radius = e.length(),
  40653. 0 === this.radius ? (this.theta = 0,
  40654. this.phi = 0) : (this.theta = Math.atan2(e.x, e.z),
  40655. this.phi = Math.acos(n.Math.clamp(e.y / this.radius, -1, 1))),
  40656. this
  40657. }
  40658. },
  40659. n.Math = {
  40660. generateUUID: function() {
  40661. var e, t = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""), i = new Array(36), n = 0;
  40662. return function() {
  40663. for (var r = 0; r < 36; r++)
  40664. 8 === r || 13 === r || 18 === r || 23 === r ? i[r] = "-" : 14 === r ? i[r] = "4" : (n <= 2 && (n = 33554432 + 16777216 * Math.random() | 0),
  40665. e = 15 & n,
  40666. n >>= 4,
  40667. i[r] = t[19 === r ? 3 & e | 8 : e]);
  40668. return i.join("")
  40669. }
  40670. }(),
  40671. clamp: function(e, t, i) {
  40672. return Math.max(t, Math.min(i, e))
  40673. },
  40674. euclideanModulo: function(e, t) {
  40675. return (e % t + t) % t
  40676. },
  40677. mapLinear: function(e, t, i, n, r) {
  40678. return n + (e - t) * (r - n) / (i - t)
  40679. },
  40680. smoothstep: function(e, t, i) {
  40681. return e <= t ? 0 : e >= i ? 1 : (e = (e - t) / (i - t),
  40682. e * e * (3 - 2 * e))
  40683. },
  40684. smootherstep: function(e, t, i) {
  40685. return e <= t ? 0 : e >= i ? 1 : (e = (e - t) / (i - t),
  40686. e * e * e * (e * (6 * e - 15) + 10))
  40687. },
  40688. random16: function() {
  40689. return console.warn("THREE.Math.random16() has been deprecated. Use Math.random() instead."),
  40690. Math.random()
  40691. },
  40692. randInt: function(e, t) {
  40693. return e + Math.floor(Math.random() * (t - e + 1))
  40694. },
  40695. randFloat: function(e, t) {
  40696. return e + Math.random() * (t - e)
  40697. },
  40698. randFloatSpread: function(e) {
  40699. return e * (.5 - Math.random())
  40700. },
  40701. degToRad: function() {
  40702. var e = Math.PI / 180;
  40703. return function(t) {
  40704. return t * e
  40705. }
  40706. }(),
  40707. radToDeg: function() {
  40708. var e = 180 / Math.PI;
  40709. return function(t) {
  40710. return t * e
  40711. }
  40712. }(),
  40713. isPowerOfTwo: function(e) {
  40714. return 0 === (e & e - 1) && 0 !== e
  40715. },
  40716. nearestPowerOfTwo: function(e) {
  40717. return Math.pow(2, Math.round(Math.log(e) / Math.LN2))
  40718. },
  40719. nextPowerOfTwo: function(e) {
  40720. return e--,
  40721. e |= e >> 1,
  40722. e |= e >> 2,
  40723. e |= e >> 4,
  40724. e |= e >> 8,
  40725. e |= e >> 16,
  40726. e++,
  40727. e
  40728. }
  40729. },
  40730. n.Spline = function(e) {
  40731. function t(e, t, i, n, r, o, a) {
  40732. var s = .5 * (i - e)
  40733. , l = .5 * (n - t);
  40734. return (2 * (t - i) + s + l) * a + (-3 * (t - i) - 2 * s - l) * o + s * r + t
  40735. }
  40736. this.points = e;
  40737. var i, r, o, a, s, l, c, h, u, d = [], p = {
  40738. x: 0,
  40739. y: 0,
  40740. z: 0
  40741. };
  40742. this.initFromArray = function(e) {
  40743. this.points = [];
  40744. for (var t = 0; t < e.length; t++)
  40745. this.points[t] = {
  40746. x: e[t][0],
  40747. y: e[t][1],
  40748. z: e[t][2]
  40749. }
  40750. }
  40751. ,
  40752. this.getPoint = function(e) {
  40753. return i = (this.points.length - 1) * e,
  40754. r = Math.floor(i),
  40755. o = i - r,
  40756. d[0] = 0 === r ? r : r - 1,
  40757. d[1] = r,
  40758. d[2] = r > this.points.length - 2 ? this.points.length - 1 : r + 1,
  40759. d[3] = r > this.points.length - 3 ? this.points.length - 1 : r + 2,
  40760. l = this.points[d[0]],
  40761. c = this.points[d[1]],
  40762. h = this.points[d[2]],
  40763. u = this.points[d[3]],
  40764. a = o * o,
  40765. s = o * a,
  40766. p.x = t(l.x, c.x, h.x, u.x, o, a, s),
  40767. p.y = t(l.y, c.y, h.y, u.y, o, a, s),
  40768. p.z = t(l.z, c.z, h.z, u.z, o, a, s),
  40769. p
  40770. }
  40771. ,
  40772. this.getControlPointsArray = function() {
  40773. var e, t, i = this.points.length, n = [];
  40774. for (e = 0; e < i; e++)
  40775. t = this.points[e],
  40776. n[e] = [t.x, t.y, t.z];
  40777. return n
  40778. }
  40779. ,
  40780. this.getLength = function(e) {
  40781. var t, i, r, o, a = 0, s = 0, l = 0, c = new n.Vector3, h = new n.Vector3, u = [], d = 0;
  40782. for (u[0] = 0,
  40783. e || (e = 100),
  40784. r = this.points.length * e,
  40785. c.copy(this.points[0]),
  40786. t = 1; t < r; t++)
  40787. i = t / r,
  40788. o = this.getPoint(i),
  40789. h.copy(o),
  40790. d += h.distanceTo(c),
  40791. c.copy(o),
  40792. a = (this.points.length - 1) * i,
  40793. s = Math.floor(a),
  40794. s !== l && (u[s] = d,
  40795. l = s);
  40796. return u[u.length] = d,
  40797. {
  40798. chunks: u,
  40799. total: d
  40800. }
  40801. }
  40802. ,
  40803. this.reparametrizeByArcLength = function(e) {
  40804. var t, i, r, o, a, s, l, c, h = [], u = new n.Vector3, d = this.getLength();
  40805. for (h.push(u.copy(this.points[0]).clone()),
  40806. t = 1; t < this.points.length; t++) {
  40807. for (s = d.chunks[t] - d.chunks[t - 1],
  40808. l = Math.ceil(e * s / d.total),
  40809. o = (t - 1) / (this.points.length - 1),
  40810. a = t / (this.points.length - 1),
  40811. i = 1; i < l - 1; i++)
  40812. r = o + i * (1 / l) * (a - o),
  40813. c = this.getPoint(r),
  40814. h.push(u.copy(c).clone());
  40815. h.push(u.copy(this.points[t]).clone())
  40816. }
  40817. this.points = h
  40818. }
  40819. }
  40820. ,
  40821. n.Triangle = function(e, t, i) {
  40822. this.a = void 0 !== e ? e : new n.Vector3,
  40823. this.b = void 0 !== t ? t : new n.Vector3,
  40824. this.c = void 0 !== i ? i : new n.Vector3
  40825. }
  40826. ,
  40827. n.Triangle.normal = function() {
  40828. var e = new n.Vector3;
  40829. return function(t, i, r, o) {
  40830. var a = o || new n.Vector3;
  40831. a.subVectors(r, i),
  40832. e.subVectors(t, i),
  40833. a.cross(e);
  40834. var s = a.lengthSq();
  40835. return s > 0 ? a.multiplyScalar(1 / Math.sqrt(s)) : a.set(0, 0, 0)
  40836. }
  40837. }(),
  40838. n.Triangle.barycoordFromPoint = function() {
  40839. var e = new n.Vector3
  40840. , t = new n.Vector3
  40841. , i = new n.Vector3;
  40842. return function(r, o, a, s, l) {
  40843. e.subVectors(s, o),
  40844. t.subVectors(a, o),
  40845. i.subVectors(r, o);
  40846. var c = e.dot(e)
  40847. , h = e.dot(t)
  40848. , u = e.dot(i)
  40849. , d = t.dot(t)
  40850. , p = t.dot(i)
  40851. , f = c * d - h * h
  40852. , g = l || new n.Vector3;
  40853. if (0 === f)
  40854. return g.set(-2, -1, -1);
  40855. var m = 1 / f
  40856. , v = (d * u - h * p) * m
  40857. , A = (c * p - h * u) * m;
  40858. return g.set(1 - v - A, A, v)
  40859. }
  40860. }(),
  40861. n.Triangle.containsPoint = function() {
  40862. var e = new n.Vector3;
  40863. return function(t, i, r, o) {
  40864. var a = n.Triangle.barycoordFromPoint(t, i, r, o, e);
  40865. return a.x >= 0 && a.y >= 0 && a.x + a.y <= 1
  40866. }
  40867. }(),
  40868. n.Triangle.prototype = {
  40869. constructor: n.Triangle,
  40870. set: function(e, t, i) {
  40871. return this.a.copy(e),
  40872. this.b.copy(t),
  40873. this.c.copy(i),
  40874. this
  40875. },
  40876. setFromPointsAndIndices: function(e, t, i, n) {
  40877. return this.a.copy(e[t]),
  40878. this.b.copy(e[i]),
  40879. this.c.copy(e[n]),
  40880. this
  40881. },
  40882. clone: function() {
  40883. return (new this.constructor).copy(this)
  40884. },
  40885. copy: function(e) {
  40886. return this.a.copy(e.a),
  40887. this.b.copy(e.b),
  40888. this.c.copy(e.c),
  40889. this
  40890. },
  40891. area: function() {
  40892. var e = new n.Vector3
  40893. , t = new n.Vector3;
  40894. return function() {
  40895. return e.subVectors(this.c, this.b),
  40896. t.subVectors(this.a, this.b),
  40897. .5 * e.cross(t).length()
  40898. }
  40899. }(),
  40900. midpoint: function(e) {
  40901. var t = e || new n.Vector3;
  40902. return t.addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3)
  40903. },
  40904. normal: function(e) {
  40905. return n.Triangle.normal(this.a, this.b, this.c, e)
  40906. },
  40907. plane: function(e) {
  40908. var t = e || new n.Plane;
  40909. return t.setFromCoplanarPoints(this.a, this.b, this.c)
  40910. },
  40911. barycoordFromPoint: function(e, t) {
  40912. return n.Triangle.barycoordFromPoint(e, this.a, this.b, this.c, t)
  40913. },
  40914. containsPoint: function(e) {
  40915. return n.Triangle.containsPoint(e, this.a, this.b, this.c)
  40916. },
  40917. equals: function(e) {
  40918. return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c)
  40919. }
  40920. },
  40921. n.Interpolant = function(e, t, i, n) {
  40922. this.parameterPositions = e,
  40923. this._cachedIndex = 0,
  40924. this.resultBuffer = void 0 !== n ? n : new t.constructor(i),
  40925. this.sampleValues = t,
  40926. this.valueSize = i
  40927. }
  40928. ,
  40929. n.Interpolant.prototype = {
  40930. constructor: n.Interpolant,
  40931. evaluate: function(e) {
  40932. var t = this.parameterPositions
  40933. , i = this._cachedIndex
  40934. , n = t[i]
  40935. , r = t[i - 1];
  40936. e: {
  40937. t: {
  40938. var o;
  40939. i: {
  40940. n: if (!(e < n)) {
  40941. for (var a = i + 2; ; ) {
  40942. if (void 0 === n) {
  40943. if (e < r)
  40944. break n;
  40945. return i = t.length,
  40946. this._cachedIndex = i,
  40947. this.afterEnd_(i - 1, e, r)
  40948. }
  40949. if (i === a)
  40950. break;
  40951. if (r = n,
  40952. n = t[++i],
  40953. e < n)
  40954. break t
  40955. }
  40956. o = t.length;
  40957. break i
  40958. }
  40959. {
  40960. if (e >= r)
  40961. break e;
  40962. var s = t[1];
  40963. e < s && (i = 2,
  40964. r = s);
  40965. for (var a = i - 2; ; ) {
  40966. if (void 0 === r)
  40967. return this._cachedIndex = 0,
  40968. this.beforeStart_(0, e, n);
  40969. if (i === a)
  40970. break;
  40971. if (n = r,
  40972. r = t[--i - 1],
  40973. e >= r)
  40974. break t
  40975. }
  40976. o = i,
  40977. i = 0
  40978. }
  40979. }
  40980. for (; i < o; ) {
  40981. var l = i + o >>> 1;
  40982. e < t[l] ? o = l : i = l + 1
  40983. }
  40984. if (n = t[i],
  40985. r = t[i - 1],
  40986. void 0 === r)
  40987. return this._cachedIndex = 0,
  40988. this.beforeStart_(0, e, n);
  40989. if (void 0 === n)
  40990. return i = t.length,
  40991. this._cachedIndex = i,
  40992. this.afterEnd_(i - 1, r, e)
  40993. }
  40994. this._cachedIndex = i,
  40995. this.intervalChanged_(i, r, n)
  40996. }
  40997. return this.interpolate_(i, r, e, n)
  40998. },
  40999. settings: null,
  41000. DefaultSettings_: {},
  41001. getSettings_: function() {
  41002. return this.settings || this.DefaultSettings_
  41003. },
  41004. copySampleValue_: function(e) {
  41005. for (var t = this.resultBuffer, i = this.sampleValues, n = this.valueSize, r = e * n, o = 0; o !== n; ++o)
  41006. t[o] = i[r + o];
  41007. return t
  41008. },
  41009. interpolate_: function(e, t, i, n) {
  41010. throw new Error("call to abstract method")
  41011. },
  41012. intervalChanged_: function(e, t, i) {}
  41013. },
  41014. Object.assign(n.Interpolant.prototype, {
  41015. beforeStart_: n.Interpolant.prototype.copySampleValue_,
  41016. afterEnd_: n.Interpolant.prototype.copySampleValue_
  41017. }),
  41018. n.CubicInterpolant = function(e, t, i, r) {
  41019. n.Interpolant.call(this, e, t, i, r),
  41020. this._weightPrev = -0,
  41021. this._offsetPrev = -0,
  41022. this._weightNext = -0,
  41023. this._offsetNext = -0
  41024. }
  41025. ,
  41026. n.CubicInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  41027. constructor: n.CubicInterpolant,
  41028. DefaultSettings_: {
  41029. endingStart: n.ZeroCurvatureEnding,
  41030. endingEnd: n.ZeroCurvatureEnding
  41031. },
  41032. intervalChanged_: function(e, t, i) {
  41033. var r = this.parameterPositions
  41034. , o = e - 2
  41035. , a = e + 1
  41036. , s = r[o]
  41037. , l = r[a];
  41038. if (void 0 === s)
  41039. switch (this.getSettings_().endingStart) {
  41040. case n.ZeroSlopeEnding:
  41041. o = e,
  41042. s = 2 * t - i;
  41043. break;
  41044. case n.WrapAroundEnding:
  41045. o = r.length - 2,
  41046. s = t + r[o] - r[o + 1];
  41047. break;
  41048. default:
  41049. o = e,
  41050. s = i
  41051. }
  41052. if (void 0 === l)
  41053. switch (this.getSettings_().endingEnd) {
  41054. case n.ZeroSlopeEnding:
  41055. a = e,
  41056. l = 2 * i - t;
  41057. break;
  41058. case n.WrapAroundEnding:
  41059. a = 1,
  41060. l = i + r[1] - r[0];
  41061. break;
  41062. default:
  41063. a = e - 1,
  41064. l = t
  41065. }
  41066. var c = .5 * (i - t)
  41067. , h = this.valueSize;
  41068. this._weightPrev = c / (t - s),
  41069. this._weightNext = c / (l - i),
  41070. this._offsetPrev = o * h,
  41071. this._offsetNext = a * h
  41072. },
  41073. interpolate_: function(e, t, i, n) {
  41074. 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, A = (-1 - d) * g + (1.5 + d) * f + .5 * p, y = d * g - d * f, C = 0; C !== a; ++C)
  41075. r[C] = m * o[c + C] + v * o[l + C] + A * o[s + C] + y * o[h + C];
  41076. return r
  41077. }
  41078. }),
  41079. n.DiscreteInterpolant = function(e, t, i, r) {
  41080. n.Interpolant.call(this, e, t, i, r)
  41081. }
  41082. ,
  41083. n.DiscreteInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  41084. constructor: n.DiscreteInterpolant,
  41085. interpolate_: function(e, t, i, n) {
  41086. return this.copySampleValue_(e - 1)
  41087. }
  41088. }),
  41089. n.LinearInterpolant = function(e, t, i, r) {
  41090. n.Interpolant.call(this, e, t, i, r)
  41091. }
  41092. ,
  41093. n.LinearInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  41094. constructor: n.LinearInterpolant,
  41095. interpolate_: function(e, t, i, n) {
  41096. 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)
  41097. r[u] = o[l + u] * h + o[s + u] * c;
  41098. return r
  41099. }
  41100. }),
  41101. n.QuaternionLinearInterpolant = function(e, t, i, r) {
  41102. n.Interpolant.call(this, e, t, i, r)
  41103. }
  41104. ,
  41105. n.QuaternionLinearInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  41106. constructor: n.QuaternionLinearInterpolant,
  41107. interpolate_: function(e, t, i, r) {
  41108. for (var o = this.resultBuffer, a = this.sampleValues, s = this.valueSize, l = e * s, c = (i - t) / (r - t), h = l + s; l !== h; l += 4)
  41109. n.Quaternion.slerpFlat(o, 0, a, l - s, a, l, c);
  41110. return o
  41111. }
  41112. }),
  41113. n.Clock = function(e) {
  41114. this.autoStart = void 0 === e || e,
  41115. this.startTime = 0,
  41116. this.oldTime = 0,
  41117. this.elapsedTime = 0,
  41118. this.running = !1
  41119. }
  41120. ,
  41121. n.Clock.prototype = {
  41122. constructor: n.Clock,
  41123. start: function() {
  41124. this.startTime = performance.now(),
  41125. this.oldTime = this.startTime,
  41126. this.running = !0
  41127. },
  41128. stop: function() {
  41129. this.getElapsedTime(),
  41130. this.running = !1
  41131. },
  41132. getElapsedTime: function() {
  41133. return this.getDelta(),
  41134. this.elapsedTime
  41135. },
  41136. getDelta: function() {
  41137. var e = 0;
  41138. if (this.autoStart && !this.running && this.start(),
  41139. this.running) {
  41140. var t = performance.now();
  41141. e = .001 * (t - this.oldTime),
  41142. this.oldTime = t,
  41143. this.elapsedTime += e
  41144. }
  41145. return e
  41146. }
  41147. },
  41148. n.EventDispatcher = function() {}
  41149. ,
  41150. n.EventDispatcher.prototype = {
  41151. constructor: n.EventDispatcher,
  41152. apply: function(e) {
  41153. e.addEventListener = n.EventDispatcher.prototype.addEventListener,
  41154. e.hasEventListener = n.EventDispatcher.prototype.hasEventListener,
  41155. e.removeEventListener = n.EventDispatcher.prototype.removeEventListener,
  41156. e.dispatchEvent = n.EventDispatcher.prototype.dispatchEvent
  41157. },
  41158. addEventListener: function(e, t) {
  41159. void 0 === this._listeners && (this._listeners = {});
  41160. var i = this._listeners;
  41161. void 0 === i[e] && (i[e] = []),
  41162. i[e].indexOf(t) === -1 && i[e].push(t)
  41163. },
  41164. hasEventListener: function(e, t) {
  41165. if (void 0 === this._listeners)
  41166. return !1;
  41167. var i = this._listeners;
  41168. return void 0 !== i[e] && i[e].indexOf(t) !== -1
  41169. },
  41170. removeEventListener: function(e, t) {
  41171. if (void 0 !== this._listeners) {
  41172. var i = this._listeners
  41173. , n = i[e];
  41174. if (void 0 !== n) {
  41175. var r = n.indexOf(t);
  41176. r !== -1 && n.splice(r, 1)
  41177. }
  41178. }
  41179. },
  41180. dispatchEvent: function(e) {
  41181. if (void 0 !== this._listeners) {
  41182. var t = this._listeners
  41183. , i = t[e.type];
  41184. if (void 0 !== i) {
  41185. e.target = this;
  41186. for (var n = [], r = i.length, o = 0; o < r; o++)
  41187. n[o] = i[o];
  41188. for (var o = 0; o < r; o++)
  41189. n[o].call(this, e)
  41190. }
  41191. }
  41192. }
  41193. },
  41194. n.Layers = function() {
  41195. this.mask = 1
  41196. }
  41197. ,
  41198. n.Layers.prototype = {
  41199. constructor: n.Layers,
  41200. set: function(e) {
  41201. this.mask = 1 << e
  41202. },
  41203. enable: function(e) {
  41204. this.mask |= 1 << e
  41205. },
  41206. toggle: function(e) {
  41207. this.mask ^= 1 << e
  41208. },
  41209. disable: function(e) {
  41210. this.mask &= ~(1 << e)
  41211. },
  41212. test: function(e) {
  41213. return 0 !== (this.mask & e.mask)
  41214. }
  41215. },
  41216. function(e) {
  41217. function t(e, t) {
  41218. return e.distance - t.distance
  41219. }
  41220. function i(e, t, n, r) {
  41221. if (e.visible !== !1 && (e.raycast(t, n),
  41222. r === !0))
  41223. for (var o = e.children, a = 0, s = o.length; a < s; a++)
  41224. i(o[a], t, n, !0)
  41225. }
  41226. e.Raycaster = function(t, i, n, r) {
  41227. this.ray = new e.Ray(t,i),
  41228. this.near = n || 0,
  41229. this.far = r || 1 / 0,
  41230. this.params = {
  41231. Mesh: {},
  41232. Line: {},
  41233. LOD: {},
  41234. Points: {
  41235. threshold: 1
  41236. },
  41237. Sprite: {}
  41238. },
  41239. Object.defineProperties(this.params, {
  41240. PointCloud: {
  41241. get: function() {
  41242. return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),
  41243. this.Points
  41244. }
  41245. }
  41246. })
  41247. }
  41248. ,
  41249. e.Raycaster.prototype = {
  41250. constructor: e.Raycaster,
  41251. linePrecision: 1,
  41252. set: function(e, t) {
  41253. this.ray.set(e, t)
  41254. },
  41255. setFromCamera: function(t, i) {
  41256. i instanceof e.PerspectiveCamera ? (this.ray.origin.setFromMatrixPosition(i.matrixWorld),
  41257. this.ray.direction.set(t.x, t.y, .5).unproject(i).sub(this.ray.origin).normalize()) : i instanceof e.OrthographicCamera ? (this.ray.origin.set(t.x, t.y, -1).unproject(i),
  41258. this.ray.direction.set(0, 0, -1).transformDirection(i.matrixWorld)) : console.error("THREE.Raycaster: Unsupported camera type.")
  41259. },
  41260. intersectObject: function(e, n) {
  41261. var r = [];
  41262. return i(e, this, r, n),
  41263. r.sort(t),
  41264. r
  41265. },
  41266. intersectObjects: function(e, n) {
  41267. var r = [];
  41268. if (Array.isArray(e) === !1)
  41269. return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),
  41270. r;
  41271. for (var o = 0, a = e.length; o < a; o++)
  41272. i(e[o], this, r, n);
  41273. return r.sort(t),
  41274. r
  41275. }
  41276. }
  41277. }(n),
  41278. n.Object3D = function() {
  41279. function e() {
  41280. o.setFromEuler(r, !1)
  41281. }
  41282. function t() {
  41283. r.setFromQuaternion(o, void 0, !1)
  41284. }
  41285. Object.defineProperty(this, "id", {
  41286. value: n.Object3DIdCount++
  41287. }),
  41288. this.uuid = n.Math.generateUUID(),
  41289. this.name = "",
  41290. this.type = "Object3D",
  41291. this.parent = null,
  41292. this.children = [],
  41293. this.up = n.Object3D.DefaultUp.clone();
  41294. var i = new n.Vector3
  41295. , r = new n.Euler
  41296. , o = new n.Quaternion
  41297. , a = new n.Vector3(1,1,1);
  41298. r.onChange(e),
  41299. o.onChange(t),
  41300. Object.defineProperties(this, {
  41301. position: {
  41302. enumerable: !0,
  41303. value: i
  41304. },
  41305. rotation: {
  41306. enumerable: !0,
  41307. value: r
  41308. },
  41309. quaternion: {
  41310. enumerable: !0,
  41311. value: o
  41312. },
  41313. scale: {
  41314. enumerable: !0,
  41315. value: a
  41316. },
  41317. modelViewMatrix: {
  41318. value: new n.Matrix4
  41319. },
  41320. normalMatrix: {
  41321. value: new n.Matrix3
  41322. }
  41323. }),
  41324. this.rotationAutoUpdate = !0,
  41325. this.matrix = new n.Matrix4,
  41326. this.matrixWorld = new n.Matrix4,
  41327. this.matrixAutoUpdate = n.Object3D.DefaultMatrixAutoUpdate,
  41328. this.matrixWorldNeedsUpdate = !1,
  41329. this.layers = new n.Layers,
  41330. this.visible = !0,
  41331. this.castShadow = !1,
  41332. this.receiveShadow = !1,
  41333. this.frustumCulled = !0,
  41334. this.renderOrder = 0,
  41335. this.userData = {}
  41336. }
  41337. ,
  41338. n.Object3D.DefaultUp = new n.Vector3(0,1,0),
  41339. n.Object3D.DefaultMatrixAutoUpdate = !0,
  41340. n.Object3D.prototype = {
  41341. constructor: n.Object3D,
  41342. applyMatrix: function(e) {
  41343. this.matrix.multiplyMatrices(e, this.matrix),
  41344. this.matrix.decompose(this.position, this.quaternion, this.scale)
  41345. },
  41346. setRotationFromAxisAngle: function(e, t) {
  41347. this.quaternion.setFromAxisAngle(e, t)
  41348. },
  41349. setRotationFromEuler: function(e) {
  41350. this.quaternion.setFromEuler(e, !0)
  41351. },
  41352. setRotationFromMatrix: function(e) {
  41353. this.quaternion.setFromRotationMatrix(e)
  41354. },
  41355. setRotationFromQuaternion: function(e) {
  41356. this.quaternion.copy(e)
  41357. },
  41358. rotateOnAxis: function() {
  41359. var e = new n.Quaternion;
  41360. return function(t, i) {
  41361. return e.setFromAxisAngle(t, i),
  41362. this.quaternion.multiply(e),
  41363. this
  41364. }
  41365. }(),
  41366. rotateX: function() {
  41367. var e = new n.Vector3(1,0,0);
  41368. return function(t) {
  41369. return this.rotateOnAxis(e, t)
  41370. }
  41371. }(),
  41372. rotateY: function() {
  41373. var e = new n.Vector3(0,1,0);
  41374. return function(t) {
  41375. return this.rotateOnAxis(e, t)
  41376. }
  41377. }(),
  41378. rotateZ: function() {
  41379. var e = new n.Vector3(0,0,1);
  41380. return function(t) {
  41381. return this.rotateOnAxis(e, t)
  41382. }
  41383. }(),
  41384. translateOnAxis: function() {
  41385. var e = new n.Vector3;
  41386. return function(t, i) {
  41387. return e.copy(t).applyQuaternion(this.quaternion),
  41388. this.position.add(e.multiplyScalar(i)),
  41389. this
  41390. }
  41391. }(),
  41392. translateX: function() {
  41393. var e = new n.Vector3(1,0,0);
  41394. return function(t) {
  41395. return this.translateOnAxis(e, t)
  41396. }
  41397. }(),
  41398. translateY: function() {
  41399. var e = new n.Vector3(0,1,0);
  41400. return function(t) {
  41401. return this.translateOnAxis(e, t)
  41402. }
  41403. }(),
  41404. translateZ: function() {
  41405. var e = new n.Vector3(0,0,1);
  41406. return function(t) {
  41407. return this.translateOnAxis(e, t)
  41408. }
  41409. }(),
  41410. localToWorld: function(e) {
  41411. return e.applyMatrix4(this.matrixWorld)
  41412. },
  41413. worldToLocal: function() {
  41414. var e = new n.Matrix4;
  41415. return function(t) {
  41416. return t.applyMatrix4(e.getInverse(this.matrixWorld))
  41417. }
  41418. }(),
  41419. lookAt: function() {
  41420. var e = new n.Matrix4;
  41421. return function(t) {
  41422. e.lookAt(t, this.position, this.up),
  41423. this.quaternion.setFromRotationMatrix(e)
  41424. }
  41425. }(),
  41426. add: function(e) {
  41427. if (arguments.length > 1) {
  41428. for (var t = 0; t < arguments.length; t++)
  41429. this.add(arguments[t]);
  41430. return this
  41431. }
  41432. return e === this ? (console.error("THREE.Object3D.add: object can't be added as a child of itself.", e),
  41433. this) : (e instanceof n.Object3D ? (null !== e.parent && e.parent.remove(e),
  41434. e.parent = this,
  41435. e.dispatchEvent({
  41436. type: "added"
  41437. }),
  41438. this.children.push(e)) : console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.", e),
  41439. this)
  41440. },
  41441. remove: function(e) {
  41442. if (arguments.length > 1)
  41443. for (var t = 0; t < arguments.length; t++)
  41444. this.remove(arguments[t]);
  41445. var i = this.children.indexOf(e);
  41446. i !== -1 && (e.parent = null,
  41447. e.dispatchEvent({
  41448. type: "removed"
  41449. }),
  41450. this.children.splice(i, 1))
  41451. },
  41452. getObjectById: function(e) {
  41453. return this.getObjectByProperty("id", e)
  41454. },
  41455. getObjectByName: function(e) {
  41456. return this.getObjectByProperty("name", e)
  41457. },
  41458. getObjectByProperty: function(e, t) {
  41459. if (this[e] === t)
  41460. return this;
  41461. for (var i = 0, n = this.children.length; i < n; i++) {
  41462. var r = this.children[i]
  41463. , o = r.getObjectByProperty(e, t);
  41464. if (void 0 !== o)
  41465. return o
  41466. }
  41467. },
  41468. getWorldPosition: function(e) {
  41469. var t = e || new n.Vector3;
  41470. return this.updateMatrixWorld(!0),
  41471. t.setFromMatrixPosition(this.matrixWorld)
  41472. },
  41473. getWorldQuaternion: function() {
  41474. var e = new n.Vector3
  41475. , t = new n.Vector3;
  41476. return function(i) {
  41477. var r = i || new n.Quaternion;
  41478. return this.updateMatrixWorld(!0),
  41479. this.matrixWorld.decompose(e, r, t),
  41480. r
  41481. }
  41482. }(),
  41483. getWorldRotation: function() {
  41484. var e = new n.Quaternion;
  41485. return function(t) {
  41486. var i = t || new n.Euler;
  41487. return this.getWorldQuaternion(e),
  41488. i.setFromQuaternion(e, this.rotation.order, !1)
  41489. }
  41490. }(),
  41491. getWorldScale: function() {
  41492. var e = new n.Vector3
  41493. , t = new n.Quaternion;
  41494. return function(i) {
  41495. var r = i || new n.Vector3;
  41496. return this.updateMatrixWorld(!0),
  41497. this.matrixWorld.decompose(e, t, r),
  41498. r
  41499. }
  41500. }(),
  41501. getWorldDirection: function() {
  41502. var e = new n.Quaternion;
  41503. return function(t) {
  41504. var i = t || new n.Vector3;
  41505. return this.getWorldQuaternion(e),
  41506. i.set(0, 0, 1).applyQuaternion(e)
  41507. }
  41508. }(),
  41509. raycast: function() {},
  41510. traverse: function(e) {
  41511. e(this);
  41512. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  41513. t[i].traverse(e)
  41514. },
  41515. traverseVisible: function(e) {
  41516. if (this.visible !== !1) {
  41517. e(this);
  41518. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  41519. t[i].traverseVisible(e)
  41520. }
  41521. },
  41522. traverseAncestors: function(e) {
  41523. var t = this.parent;
  41524. null !== t && (e(t),
  41525. t.traverseAncestors(e))
  41526. },
  41527. updateMatrix: function() {
  41528. this.matrix.compose(this.position, this.quaternion, this.scale),
  41529. this.matrixWorldNeedsUpdate = !0
  41530. },
  41531. updateMatrixWorld: function(e) {
  41532. this.matrixAutoUpdate === !0 && this.updateMatrix(),
  41533. this.matrixWorldNeedsUpdate !== !0 && e !== !0 || (null === this.parent ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix),
  41534. this.matrixWorldNeedsUpdate = !1,
  41535. e = !0);
  41536. for (var t = 0, i = this.children.length; t < i; t++)
  41537. this.children[t].updateMatrixWorld(e)
  41538. },
  41539. toJSON: function(e) {
  41540. function t(e) {
  41541. var t = [];
  41542. for (var i in e) {
  41543. var n = e[i];
  41544. delete n.metadata,
  41545. t.push(n)
  41546. }
  41547. return t
  41548. }
  41549. var i = void 0 === e
  41550. , n = {};
  41551. i && (e = {
  41552. geometries: {},
  41553. materials: {},
  41554. textures: {},
  41555. images: {}
  41556. },
  41557. n.metadata = {
  41558. version: 4.4,
  41559. type: "Object",
  41560. generator: "Object3D.toJSON"
  41561. });
  41562. var r = {};
  41563. if (r.uuid = this.uuid,
  41564. r.type = this.type,
  41565. "" !== this.name && (r.name = this.name),
  41566. "{}" !== JSON.stringify(this.userData) && (r.userData = this.userData),
  41567. this.castShadow === !0 && (r.castShadow = !0),
  41568. this.receiveShadow === !0 && (r.receiveShadow = !0),
  41569. this.visible === !1 && (r.visible = !1),
  41570. r.matrix = this.matrix.toArray(),
  41571. void 0 !== this.geometry && (void 0 === e.geometries[this.geometry.uuid] && (e.geometries[this.geometry.uuid] = this.geometry.toJSON(e)),
  41572. r.geometry = this.geometry.uuid),
  41573. void 0 !== this.material && (void 0 === e.materials[this.material.uuid] && (e.materials[this.material.uuid] = this.material.toJSON(e)),
  41574. r.material = this.material.uuid),
  41575. this.children.length > 0) {
  41576. r.children = [];
  41577. for (var o = 0; o < this.children.length; o++)
  41578. r.children.push(this.children[o].toJSON(e).object)
  41579. }
  41580. if (i) {
  41581. var a = t(e.geometries)
  41582. , s = t(e.materials)
  41583. , l = t(e.textures)
  41584. , c = t(e.images);
  41585. a.length > 0 && (n.geometries = a),
  41586. s.length > 0 && (n.materials = s),
  41587. l.length > 0 && (n.textures = l),
  41588. c.length > 0 && (n.images = c)
  41589. }
  41590. return n.object = r,
  41591. n
  41592. },
  41593. clone: function(e) {
  41594. return (new this.constructor).copy(this, e)
  41595. },
  41596. copy: function(e, t) {
  41597. if (void 0 === t && (t = !0),
  41598. this.name = e.name,
  41599. this.up.copy(e.up),
  41600. this.position.copy(e.position),
  41601. this.quaternion.copy(e.quaternion),
  41602. this.scale.copy(e.scale),
  41603. this.rotationAutoUpdate = e.rotationAutoUpdate,
  41604. this.matrix.copy(e.matrix),
  41605. this.matrixWorld.copy(e.matrixWorld),
  41606. this.matrixAutoUpdate = e.matrixAutoUpdate,
  41607. this.matrixWorldNeedsUpdate = e.matrixWorldNeedsUpdate,
  41608. this.visible = e.visible,
  41609. this.castShadow = e.castShadow,
  41610. this.receiveShadow = e.receiveShadow,
  41611. this.frustumCulled = e.frustumCulled,
  41612. this.renderOrder = e.renderOrder,
  41613. this.userData = JSON.parse(JSON.stringify(e.userData)),
  41614. t === !0)
  41615. for (var i = 0; i < e.children.length; i++) {
  41616. var n = e.children[i];
  41617. this.add(n.clone())
  41618. }
  41619. return this
  41620. }
  41621. },
  41622. n.EventDispatcher.prototype.apply(n.Object3D.prototype),
  41623. n.Object3DIdCount = 0,
  41624. n.Face3 = function(e, t, i, r, o, a) {
  41625. this.a = e,
  41626. this.b = t,
  41627. this.c = i,
  41628. this.normal = r instanceof n.Vector3 ? r : new n.Vector3,
  41629. this.vertexNormals = Array.isArray(r) ? r : [],
  41630. this.color = o instanceof n.Color ? o : new n.Color,
  41631. this.vertexColors = Array.isArray(o) ? o : [],
  41632. this.materialIndex = void 0 !== a ? a : 0
  41633. }
  41634. ,
  41635. n.Face3.prototype = {
  41636. constructor: n.Face3,
  41637. clone: function() {
  41638. return (new this.constructor).copy(this)
  41639. },
  41640. copy: function(e) {
  41641. this.a = e.a,
  41642. this.b = e.b,
  41643. this.c = e.c,
  41644. this.normal.copy(e.normal),
  41645. this.color.copy(e.color),
  41646. this.materialIndex = e.materialIndex;
  41647. for (var t = 0, i = e.vertexNormals.length; t < i; t++)
  41648. this.vertexNormals[t] = e.vertexNormals[t].clone();
  41649. for (var t = 0, i = e.vertexColors.length; t < i; t++)
  41650. this.vertexColors[t] = e.vertexColors[t].clone();
  41651. return this
  41652. }
  41653. },
  41654. n.BufferAttribute = function(e, t) {
  41655. this.uuid = n.Math.generateUUID(),
  41656. this.array = e,
  41657. this.itemSize = t,
  41658. this.dynamic = !1,
  41659. this.updateRange = {
  41660. offset: 0,
  41661. count: -1
  41662. },
  41663. this.version = 0
  41664. }
  41665. ,
  41666. n.BufferAttribute.prototype = {
  41667. constructor: n.BufferAttribute,
  41668. get count() {
  41669. return this.array.length / this.itemSize
  41670. },
  41671. set needsUpdate(e) {
  41672. e === !0 && this.version++
  41673. },
  41674. setDynamic: function(e) {
  41675. return this.dynamic = e,
  41676. this
  41677. },
  41678. copy: function(e) {
  41679. return this.array = new e.array.constructor(e.array),
  41680. this.itemSize = e.itemSize,
  41681. this.dynamic = e.dynamic,
  41682. this
  41683. },
  41684. copyAt: function(e, t, i) {
  41685. e *= this.itemSize,
  41686. i *= t.itemSize;
  41687. for (var n = 0, r = this.itemSize; n < r; n++)
  41688. this.array[e + n] = t.array[i + n];
  41689. return this
  41690. },
  41691. copyArray: function(e) {
  41692. return this.array.set(e),
  41693. this
  41694. },
  41695. copyColorsArray: function(e) {
  41696. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  41697. var a = e[r];
  41698. void 0 === a && (console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined", r),
  41699. a = new n.Color),
  41700. t[i++] = a.r,
  41701. t[i++] = a.g,
  41702. t[i++] = a.b
  41703. }
  41704. return this
  41705. },
  41706. copyIndicesArray: function(e) {
  41707. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41708. var o = e[n];
  41709. t[i++] = o.a,
  41710. t[i++] = o.b,
  41711. t[i++] = o.c
  41712. }
  41713. return this
  41714. },
  41715. copyVector2sArray: function(e) {
  41716. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  41717. var a = e[r];
  41718. void 0 === a && (console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined", r),
  41719. a = new n.Vector2),
  41720. t[i++] = a.x,
  41721. t[i++] = a.y
  41722. }
  41723. return this
  41724. },
  41725. copyVector3sArray: function(e) {
  41726. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  41727. var a = e[r];
  41728. void 0 === a && (console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined", r),
  41729. a = new n.Vector3),
  41730. t[i++] = a.x,
  41731. t[i++] = a.y,
  41732. t[i++] = a.z
  41733. }
  41734. return this
  41735. },
  41736. copyVector4sArray: function(e) {
  41737. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  41738. var a = e[r];
  41739. void 0 === a && (console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined", r),
  41740. a = new n.Vector4),
  41741. t[i++] = a.x,
  41742. t[i++] = a.y,
  41743. t[i++] = a.z,
  41744. t[i++] = a.w
  41745. }
  41746. return this
  41747. },
  41748. set: function(e, t) {
  41749. return void 0 === t && (t = 0),
  41750. this.array.set(e, t),
  41751. this
  41752. },
  41753. getX: function(e) {
  41754. return this.array[e * this.itemSize]
  41755. },
  41756. setX: function(e, t) {
  41757. return this.array[e * this.itemSize] = t,
  41758. this
  41759. },
  41760. getY: function(e) {
  41761. return this.array[e * this.itemSize + 1]
  41762. },
  41763. setY: function(e, t) {
  41764. return this.array[e * this.itemSize + 1] = t,
  41765. this
  41766. },
  41767. getZ: function(e) {
  41768. return this.array[e * this.itemSize + 2]
  41769. },
  41770. setZ: function(e, t) {
  41771. return this.array[e * this.itemSize + 2] = t,
  41772. this
  41773. },
  41774. getW: function(e) {
  41775. return this.array[e * this.itemSize + 3]
  41776. },
  41777. setW: function(e, t) {
  41778. return this.array[e * this.itemSize + 3] = t,
  41779. this
  41780. },
  41781. setXY: function(e, t, i) {
  41782. return e *= this.itemSize,
  41783. this.array[e + 0] = t,
  41784. this.array[e + 1] = i,
  41785. this
  41786. },
  41787. setXYZ: function(e, t, i, n) {
  41788. return e *= this.itemSize,
  41789. this.array[e + 0] = t,
  41790. this.array[e + 1] = i,
  41791. this.array[e + 2] = n,
  41792. this
  41793. },
  41794. setXYZW: function(e, t, i, n, r) {
  41795. return e *= this.itemSize,
  41796. this.array[e + 0] = t,
  41797. this.array[e + 1] = i,
  41798. this.array[e + 2] = n,
  41799. this.array[e + 3] = r,
  41800. this
  41801. },
  41802. clone: function() {
  41803. return (new this.constructor).copy(this)
  41804. }
  41805. },
  41806. n.Int8Attribute = function(e, t) {
  41807. return new n.BufferAttribute(new Int8Array(e),t)
  41808. }
  41809. ,
  41810. n.Uint8Attribute = function(e, t) {
  41811. return new n.BufferAttribute(new Uint8Array(e),t)
  41812. }
  41813. ,
  41814. n.Uint8ClampedAttribute = function(e, t) {
  41815. return new n.BufferAttribute(new Uint8ClampedArray(e),t)
  41816. }
  41817. ,
  41818. n.Int16Attribute = function(e, t) {
  41819. return new n.BufferAttribute(new Int16Array(e),t)
  41820. }
  41821. ,
  41822. n.Uint16Attribute = function(e, t) {
  41823. return new n.BufferAttribute(new Uint16Array(e),t)
  41824. }
  41825. ;
  41826. n.Int32Attribute = function(e, t) {
  41827. return new n.BufferAttribute(new Int32Array(e),t)
  41828. }
  41829. ;
  41830. n.Uint32Attribute = function(e, t) {
  41831. return new n.BufferAttribute(new Uint32Array(e),t)
  41832. }
  41833. ,
  41834. n.Float32Attribute = function(e, t) {
  41835. return new n.BufferAttribute(new Float32Array(e),t)
  41836. }
  41837. ,
  41838. n.Float64Attribute = function(e, t) {
  41839. return new n.BufferAttribute(new Float64Array(e),t)
  41840. }
  41841. ,
  41842. n.DynamicBufferAttribute = function(e, t) {
  41843. return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),
  41844. new n.BufferAttribute(e,t).setDynamic(!0)
  41845. }
  41846. ,
  41847. n.InstancedBufferAttribute = function(e, t, i) {
  41848. n.BufferAttribute.call(this, e, t),
  41849. this.meshPerAttribute = i || 1
  41850. }
  41851. ,
  41852. n.InstancedBufferAttribute.prototype = Object.create(n.BufferAttribute.prototype),
  41853. n.InstancedBufferAttribute.prototype.constructor = n.InstancedBufferAttribute,
  41854. n.InstancedBufferAttribute.prototype.copy = function(e) {
  41855. return n.BufferAttribute.prototype.copy.call(this, e),
  41856. this.meshPerAttribute = e.meshPerAttribute,
  41857. this
  41858. }
  41859. ,
  41860. n.InterleavedBuffer = function(e, t) {
  41861. this.uuid = n.Math.generateUUID(),
  41862. this.array = e,
  41863. this.stride = t,
  41864. this.dynamic = !1,
  41865. this.updateRange = {
  41866. offset: 0,
  41867. count: -1
  41868. },
  41869. this.version = 0
  41870. }
  41871. ,
  41872. n.InterleavedBuffer.prototype = {
  41873. constructor: n.InterleavedBuffer,
  41874. get length() {
  41875. return this.array.length
  41876. },
  41877. get count() {
  41878. return this.array.length / this.stride
  41879. },
  41880. set needsUpdate(e) {
  41881. e === !0 && this.version++
  41882. },
  41883. setDynamic: function(e) {
  41884. return this.dynamic = e,
  41885. this
  41886. },
  41887. copy: function(e) {
  41888. return this.array = new e.array.constructor(e.array),
  41889. this.stride = e.stride,
  41890. this.dynamic = e.dynamic,
  41891. this
  41892. },
  41893. copyAt: function(e, t, i) {
  41894. e *= this.stride,
  41895. i *= t.stride;
  41896. for (var n = 0, r = this.stride; n < r; n++)
  41897. this.array[e + n] = t.array[i + n];
  41898. return this
  41899. },
  41900. set: function(e, t) {
  41901. return void 0 === t && (t = 0),
  41902. this.array.set(e, t),
  41903. this
  41904. },
  41905. clone: function() {
  41906. return (new this.constructor).copy(this)
  41907. }
  41908. },
  41909. n.InstancedInterleavedBuffer = function(e, t, i) {
  41910. n.InterleavedBuffer.call(this, e, t),
  41911. this.meshPerAttribute = i || 1
  41912. }
  41913. ,
  41914. n.InstancedInterleavedBuffer.prototype = Object.create(n.InterleavedBuffer.prototype),
  41915. n.InstancedInterleavedBuffer.prototype.constructor = n.InstancedInterleavedBuffer,
  41916. n.InstancedInterleavedBuffer.prototype.copy = function(e) {
  41917. return n.InterleavedBuffer.prototype.copy.call(this, e),
  41918. this.meshPerAttribute = e.meshPerAttribute,
  41919. this
  41920. }
  41921. ,
  41922. n.InterleavedBufferAttribute = function(e, t, i) {
  41923. this.uuid = n.Math.generateUUID(),
  41924. this.data = e,
  41925. this.itemSize = t,
  41926. this.offset = i
  41927. }
  41928. ,
  41929. n.InterleavedBufferAttribute.prototype = {
  41930. constructor: n.InterleavedBufferAttribute,
  41931. get length() {
  41932. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  41933. this.array.length
  41934. },
  41935. get count() {
  41936. return this.data.count
  41937. },
  41938. setX: function(e, t) {
  41939. return this.data.array[e * this.data.stride + this.offset] = t,
  41940. this
  41941. },
  41942. setY: function(e, t) {
  41943. return this.data.array[e * this.data.stride + this.offset + 1] = t,
  41944. this
  41945. },
  41946. setZ: function(e, t) {
  41947. return this.data.array[e * this.data.stride + this.offset + 2] = t,
  41948. this
  41949. },
  41950. setW: function(e, t) {
  41951. return this.data.array[e * this.data.stride + this.offset + 3] = t,
  41952. this
  41953. },
  41954. getX: function(e) {
  41955. return this.data.array[e * this.data.stride + this.offset]
  41956. },
  41957. getY: function(e) {
  41958. return this.data.array[e * this.data.stride + this.offset + 1]
  41959. },
  41960. getZ: function(e) {
  41961. return this.data.array[e * this.data.stride + this.offset + 2]
  41962. },
  41963. getW: function(e) {
  41964. return this.data.array[e * this.data.stride + this.offset + 3]
  41965. },
  41966. setXY: function(e, t, i) {
  41967. return e = e * this.data.stride + this.offset,
  41968. this.data.array[e + 0] = t,
  41969. this.data.array[e + 1] = i,
  41970. this
  41971. },
  41972. setXYZ: function(e, t, i, n) {
  41973. return e = e * this.data.stride + this.offset,
  41974. this.data.array[e + 0] = t,
  41975. this.data.array[e + 1] = i,
  41976. this.data.array[e + 2] = n,
  41977. this
  41978. },
  41979. setXYZW: function(e, t, i, n, r) {
  41980. return e = e * this.data.stride + this.offset,
  41981. this.data.array[e + 0] = t,
  41982. this.data.array[e + 1] = i,
  41983. this.data.array[e + 2] = n,
  41984. this.data.array[e + 3] = r,
  41985. this
  41986. }
  41987. },
  41988. n.Geometry = function() {
  41989. Object.defineProperty(this, "id", {
  41990. value: n.GeometryIdCount++
  41991. }),
  41992. this.uuid = n.Math.generateUUID(),
  41993. this.name = "",
  41994. this.type = "Geometry",
  41995. this.vertices = [],
  41996. this.colors = [],
  41997. this.faces = [],
  41998. this.faceVertexUvs = [[]],
  41999. this.morphTargets = [],
  42000. this.morphNormals = [],
  42001. this.skinWeights = [],
  42002. this.skinIndices = [],
  42003. this.lineDistances = [],
  42004. this.boundingBox = null,
  42005. this.boundingSphere = null,
  42006. this.verticesNeedUpdate = !1,
  42007. this.elementsNeedUpdate = !1,
  42008. this.uvsNeedUpdate = !1,
  42009. this.normalsNeedUpdate = !1,
  42010. this.colorsNeedUpdate = !1,
  42011. this.lineDistancesNeedUpdate = !1,
  42012. this.groupsNeedUpdate = !1
  42013. }
  42014. ,
  42015. n.Geometry.prototype = {
  42016. constructor: n.Geometry,
  42017. applyMatrix: function(e) {
  42018. for (var t = (new n.Matrix3).getNormalMatrix(e), i = 0, r = this.vertices.length; i < r; i++) {
  42019. var o = this.vertices[i];
  42020. o.applyMatrix4(e)
  42021. }
  42022. for (var i = 0, r = this.faces.length; i < r; i++) {
  42023. var a = this.faces[i];
  42024. a.normal.applyMatrix3(t).normalize();
  42025. for (var s = 0, l = a.vertexNormals.length; s < l; s++)
  42026. a.vertexNormals[s].applyMatrix3(t).normalize()
  42027. }
  42028. return null !== this.boundingBox && this.computeBoundingBox(),
  42029. null !== this.boundingSphere && this.computeBoundingSphere(),
  42030. this.verticesNeedUpdate = !0,
  42031. this.normalsNeedUpdate = !0,
  42032. this
  42033. },
  42034. rotateX: function() {
  42035. var e;
  42036. return function(t) {
  42037. return void 0 === e && (e = new n.Matrix4),
  42038. e.makeRotationX(t),
  42039. this.applyMatrix(e),
  42040. this
  42041. }
  42042. }(),
  42043. rotateY: function() {
  42044. var e;
  42045. return function(t) {
  42046. return void 0 === e && (e = new n.Matrix4),
  42047. e.makeRotationY(t),
  42048. this.applyMatrix(e),
  42049. this
  42050. }
  42051. }(),
  42052. rotateZ: function() {
  42053. var e;
  42054. return function(t) {
  42055. return void 0 === e && (e = new n.Matrix4),
  42056. e.makeRotationZ(t),
  42057. this.applyMatrix(e),
  42058. this
  42059. }
  42060. }(),
  42061. translate: function() {
  42062. var e;
  42063. return function(t, i, r) {
  42064. return void 0 === e && (e = new n.Matrix4),
  42065. e.makeTranslation(t, i, r),
  42066. this.applyMatrix(e),
  42067. this
  42068. }
  42069. }(),
  42070. scale: function() {
  42071. var e;
  42072. return function(t, i, r) {
  42073. return void 0 === e && (e = new n.Matrix4),
  42074. e.makeScale(t, i, r),
  42075. this.applyMatrix(e),
  42076. this
  42077. }
  42078. }(),
  42079. lookAt: function() {
  42080. var e;
  42081. return function(t) {
  42082. void 0 === e && (e = new n.Object3D),
  42083. e.lookAt(t),
  42084. e.updateMatrix(),
  42085. this.applyMatrix(e.matrix)
  42086. }
  42087. }(),
  42088. fromBufferGeometry: function(e) {
  42089. function t(e, t, r, o) {
  42090. var a = void 0 !== s ? [u[e].clone(), u[t].clone(), u[r].clone()] : []
  42091. , f = void 0 !== l ? [i.colors[e].clone(), i.colors[t].clone(), i.colors[r].clone()] : []
  42092. , g = new n.Face3(e,t,r,a,f,o);
  42093. i.faces.push(g),
  42094. void 0 !== c && i.faceVertexUvs[0].push([d[e].clone(), d[t].clone(), d[r].clone()]),
  42095. void 0 !== h && i.faceVertexUvs[1].push([p[e].clone(), p[t].clone(), p[r].clone()])
  42096. }
  42097. var i = this
  42098. , r = null !== e.index ? e.index.array : void 0
  42099. , o = e.attributes
  42100. , a = o.position.array
  42101. , s = void 0 !== o.normal ? o.normal.array : void 0
  42102. , l = void 0 !== o.color ? o.color.array : void 0
  42103. , c = void 0 !== o.uv ? o.uv.array : void 0
  42104. , h = void 0 !== o.uv2 ? o.uv2.array : void 0;
  42105. void 0 !== h && (this.faceVertexUvs[1] = []);
  42106. for (var u = [], d = [], p = [], f = 0, g = 0; f < a.length; f += 3,
  42107. g += 2)
  42108. i.vertices.push(new n.Vector3(a[f],a[f + 1],a[f + 2])),
  42109. void 0 !== s && u.push(new n.Vector3(s[f],s[f + 1],s[f + 2])),
  42110. void 0 !== l && i.colors.push(new n.Color(l[f],l[f + 1],l[f + 2])),
  42111. void 0 !== c && d.push(new n.Vector2(c[g],c[g + 1])),
  42112. void 0 !== h && p.push(new n.Vector2(h[g],h[g + 1]));
  42113. if (void 0 !== r) {
  42114. var m = e.groups;
  42115. if (m.length > 0)
  42116. for (var f = 0; f < m.length; f++)
  42117. for (var v = m[f], A = v.start, y = v.count, g = A, C = A + y; g < C; g += 3)
  42118. t(r[g], r[g + 1], r[g + 2], v.materialIndex);
  42119. else
  42120. for (var f = 0; f < r.length; f += 3)
  42121. t(r[f], r[f + 1], r[f + 2])
  42122. } else
  42123. for (var f = 0; f < a.length / 3; f += 3)
  42124. t(f, f + 1, f + 2);
  42125. return this.computeFaceNormals(),
  42126. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  42127. null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  42128. this
  42129. },
  42130. center: function() {
  42131. this.computeBoundingBox();
  42132. var e = this.boundingBox.center().negate();
  42133. return this.translate(e.x, e.y, e.z),
  42134. e
  42135. },
  42136. normalize: function() {
  42137. this.computeBoundingSphere();
  42138. var e = this.boundingSphere.center
  42139. , t = this.boundingSphere.radius
  42140. , i = 0 === t ? 1 : 1 / t
  42141. , r = new n.Matrix4;
  42142. return r.set(i, 0, 0, -i * e.x, 0, i, 0, -i * e.y, 0, 0, i, -i * e.z, 0, 0, 0, 1),
  42143. this.applyMatrix(r),
  42144. this
  42145. },
  42146. computeFaceNormals: function() {
  42147. for (var e = new n.Vector3, t = new n.Vector3, i = 0, r = this.faces.length; i < r; i++) {
  42148. var o = this.faces[i]
  42149. , a = this.vertices[o.a]
  42150. , s = this.vertices[o.b]
  42151. , l = this.vertices[o.c];
  42152. e.subVectors(l, s),
  42153. t.subVectors(a, s),
  42154. e.cross(t),
  42155. e.normalize(),
  42156. o.normal.copy(e)
  42157. }
  42158. },
  42159. computeVertexNormals: function(e) {
  42160. void 0 === e && (e = !0);
  42161. var t, i, r, o, a, s;
  42162. for (s = new Array(this.vertices.length),
  42163. t = 0,
  42164. i = this.vertices.length; t < i; t++)
  42165. s[t] = new n.Vector3;
  42166. if (e) {
  42167. var l, c, h, u = new n.Vector3, d = new n.Vector3;
  42168. for (r = 0,
  42169. o = this.faces.length; r < o; r++)
  42170. a = this.faces[r],
  42171. l = this.vertices[a.a],
  42172. c = this.vertices[a.b],
  42173. h = this.vertices[a.c],
  42174. u.subVectors(h, c),
  42175. d.subVectors(l, c),
  42176. u.cross(d),
  42177. s[a.a].add(u),
  42178. s[a.b].add(u),
  42179. s[a.c].add(u)
  42180. } else
  42181. for (r = 0,
  42182. o = this.faces.length; r < o; r++)
  42183. a = this.faces[r],
  42184. s[a.a].add(a.normal),
  42185. s[a.b].add(a.normal),
  42186. s[a.c].add(a.normal);
  42187. for (t = 0,
  42188. i = this.vertices.length; t < i; t++)
  42189. s[t].normalize();
  42190. for (r = 0,
  42191. o = this.faces.length; r < o; r++) {
  42192. a = this.faces[r];
  42193. var p = a.vertexNormals;
  42194. 3 === p.length ? (p[0].copy(s[a.a]),
  42195. p[1].copy(s[a.b]),
  42196. p[2].copy(s[a.c])) : (p[0] = s[a.a].clone(),
  42197. p[1] = s[a.b].clone(),
  42198. p[2] = s[a.c].clone())
  42199. }
  42200. this.faces.length > 0 && (this.normalsNeedUpdate = !0)
  42201. },
  42202. computeMorphNormals: function() {
  42203. var e, t, i, r, o;
  42204. for (i = 0,
  42205. r = this.faces.length; i < r; i++)
  42206. for (o = this.faces[i],
  42207. o.__originalFaceNormal ? o.__originalFaceNormal.copy(o.normal) : o.__originalFaceNormal = o.normal.clone(),
  42208. o.__originalVertexNormals || (o.__originalVertexNormals = []),
  42209. e = 0,
  42210. t = o.vertexNormals.length; e < t; e++)
  42211. o.__originalVertexNormals[e] ? o.__originalVertexNormals[e].copy(o.vertexNormals[e]) : o.__originalVertexNormals[e] = o.vertexNormals[e].clone();
  42212. var a = new n.Geometry;
  42213. for (a.faces = this.faces,
  42214. e = 0,
  42215. t = this.morphTargets.length; e < t; e++) {
  42216. if (!this.morphNormals[e]) {
  42217. this.morphNormals[e] = {},
  42218. this.morphNormals[e].faceNormals = [],
  42219. this.morphNormals[e].vertexNormals = [];
  42220. var s, l, c = this.morphNormals[e].faceNormals, h = this.morphNormals[e].vertexNormals;
  42221. for (i = 0,
  42222. r = this.faces.length; i < r; i++)
  42223. s = new n.Vector3,
  42224. l = {
  42225. a: new n.Vector3,
  42226. b: new n.Vector3,
  42227. c: new n.Vector3
  42228. },
  42229. c.push(s),
  42230. h.push(l)
  42231. }
  42232. var u = this.morphNormals[e];
  42233. a.vertices = this.morphTargets[e].vertices,
  42234. a.computeFaceNormals(),
  42235. a.computeVertexNormals();
  42236. var s, l;
  42237. for (i = 0,
  42238. r = this.faces.length; i < r; i++)
  42239. o = this.faces[i],
  42240. s = u.faceNormals[i],
  42241. l = u.vertexNormals[i],
  42242. s.copy(o.normal),
  42243. l.a.copy(o.vertexNormals[0]),
  42244. l.b.copy(o.vertexNormals[1]),
  42245. l.c.copy(o.vertexNormals[2])
  42246. }
  42247. for (i = 0,
  42248. r = this.faces.length; i < r; i++)
  42249. o = this.faces[i],
  42250. o.normal = o.__originalFaceNormal,
  42251. o.vertexNormals = o.__originalVertexNormals
  42252. },
  42253. computeTangents: function() {
  42254. console.warn("THREE.Geometry: .computeTangents() has been removed.")
  42255. },
  42256. computeLineDistances: function() {
  42257. for (var e = 0, t = this.vertices, i = 0, n = t.length; i < n; i++)
  42258. i > 0 && (e += t[i].distanceTo(t[i - 1])),
  42259. this.lineDistances[i] = e
  42260. },
  42261. computeBoundingBox: function() {
  42262. null === this.boundingBox && (this.boundingBox = new n.Box3),
  42263. this.boundingBox.setFromPoints(this.vertices)
  42264. },
  42265. computeBoundingSphere: function() {
  42266. null === this.boundingSphere && (this.boundingSphere = new n.Sphere),
  42267. this.boundingSphere.setFromPoints(this.vertices)
  42268. },
  42269. merge: function(e, t, i) {
  42270. if (e instanceof n.Geometry == !1)
  42271. return void console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.", e);
  42272. var r, o = this.vertices.length, a = this.vertices, s = e.vertices, l = this.faces, c = e.faces, h = this.faceVertexUvs[0], u = e.faceVertexUvs[0];
  42273. void 0 === i && (i = 0),
  42274. void 0 !== t && (r = (new n.Matrix3).getNormalMatrix(t));
  42275. for (var d = 0, p = s.length; d < p; d++) {
  42276. var f = s[d]
  42277. , g = f.clone();
  42278. void 0 !== t && g.applyMatrix4(t),
  42279. a.push(g)
  42280. }
  42281. for (d = 0,
  42282. p = c.length; d < p; d++) {
  42283. var m, v, A, y = c[d], C = y.vertexNormals, I = y.vertexColors;
  42284. m = new n.Face3(y.a + o,y.b + o,y.c + o),
  42285. m.normal.copy(y.normal),
  42286. void 0 !== r && m.normal.applyMatrix3(r).normalize();
  42287. for (var E = 0, b = C.length; E < b; E++)
  42288. v = C[E].clone(),
  42289. void 0 !== r && v.applyMatrix3(r).normalize(),
  42290. m.vertexNormals.push(v);
  42291. m.color.copy(y.color);
  42292. for (var E = 0, b = I.length; E < b; E++)
  42293. A = I[E],
  42294. m.vertexColors.push(A.clone());
  42295. m.materialIndex = y.materialIndex + i,
  42296. l.push(m)
  42297. }
  42298. for (d = 0,
  42299. p = u.length; d < p; d++) {
  42300. var w = u[d]
  42301. , _ = [];
  42302. if (void 0 !== w) {
  42303. for (var E = 0, b = w.length; E < b; E++)
  42304. _.push(w[E].clone());
  42305. h.push(_)
  42306. }
  42307. }
  42308. },
  42309. mergeMesh: function(e) {
  42310. return e instanceof n.Mesh == !1 ? void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.", e) : (e.matrixAutoUpdate && e.updateMatrix(),
  42311. void this.merge(e.geometry, e.matrix))
  42312. },
  42313. mergeVertices: function() {
  42314. var e, t, i, n, r, o, a, s, l = {}, c = [], h = [], u = 4, d = Math.pow(10, u);
  42315. for (i = 0,
  42316. n = this.vertices.length; i < n; i++)
  42317. e = this.vertices[i],
  42318. t = Math.round(e.x * d) + "_" + Math.round(e.y * d) + "_" + Math.round(e.z * d),
  42319. void 0 === l[t] ? (l[t] = i,
  42320. c.push(this.vertices[i]),
  42321. h[i] = c.length - 1) : h[i] = h[l[t]];
  42322. var p = [];
  42323. for (i = 0,
  42324. n = this.faces.length; i < n; i++) {
  42325. r = this.faces[i],
  42326. r.a = h[r.a],
  42327. r.b = h[r.b],
  42328. r.c = h[r.c],
  42329. o = [r.a, r.b, r.c];
  42330. for (var f = -1, g = 0; g < 3; g++)
  42331. if (o[g] === o[(g + 1) % 3]) {
  42332. f = g,
  42333. p.push(i);
  42334. break
  42335. }
  42336. }
  42337. for (i = p.length - 1; i >= 0; i--) {
  42338. var m = p[i];
  42339. for (this.faces.splice(m, 1),
  42340. a = 0,
  42341. s = this.faceVertexUvs.length; a < s; a++)
  42342. this.faceVertexUvs[a].splice(m, 1)
  42343. }
  42344. var v = this.vertices.length - c.length;
  42345. return this.vertices = c,
  42346. v
  42347. },
  42348. sortFacesByMaterialIndex: function() {
  42349. function e(e, t) {
  42350. return e.materialIndex - t.materialIndex
  42351. }
  42352. for (var t = this.faces, i = t.length, n = 0; n < i; n++)
  42353. t[n]._id = n;
  42354. t.sort(e);
  42355. var r, o, a = this.faceVertexUvs[0], s = this.faceVertexUvs[1];
  42356. a && a.length === i && (r = []),
  42357. s && s.length === i && (o = []);
  42358. for (var n = 0; n < i; n++) {
  42359. var l = t[n]._id;
  42360. r && r.push(a[l]),
  42361. o && o.push(s[l])
  42362. }
  42363. r && (this.faceVertexUvs[0] = r),
  42364. o && (this.faceVertexUvs[1] = o)
  42365. },
  42366. toJSON: function() {
  42367. function e(e, t, i) {
  42368. return i ? e | 1 << t : e & ~(1 << t)
  42369. }
  42370. function t(e) {
  42371. var t = e.x.toString() + e.y.toString() + e.z.toString();
  42372. return void 0 !== d[t] ? d[t] : (d[t] = u.length / 3,
  42373. u.push(e.x, e.y, e.z),
  42374. d[t])
  42375. }
  42376. function i(e) {
  42377. var t = e.r.toString() + e.g.toString() + e.b.toString();
  42378. return void 0 !== f[t] ? f[t] : (f[t] = p.length,
  42379. p.push(e.getHex()),
  42380. f[t])
  42381. }
  42382. function n(e) {
  42383. var t = e.x.toString() + e.y.toString();
  42384. return void 0 !== m[t] ? m[t] : (m[t] = g.length / 2,
  42385. g.push(e.x, e.y),
  42386. m[t])
  42387. }
  42388. var r = {
  42389. metadata: {
  42390. version: 4.4,
  42391. type: "Geometry",
  42392. generator: "Geometry.toJSON"
  42393. }
  42394. };
  42395. if (r.uuid = this.uuid,
  42396. r.type = this.type,
  42397. "" !== this.name && (r.name = this.name),
  42398. void 0 !== this.parameters) {
  42399. var o = this.parameters;
  42400. for (var a in o)
  42401. void 0 !== o[a] && (r[a] = o[a]);
  42402. return r
  42403. }
  42404. for (var s = [], l = 0; l < this.vertices.length; l++) {
  42405. var c = this.vertices[l];
  42406. s.push(c.x, c.y, c.z)
  42407. }
  42408. for (var h = [], u = [], d = {}, p = [], f = {}, g = [], m = {}, l = 0; l < this.faces.length; l++) {
  42409. var v = this.faces[l]
  42410. , A = !0
  42411. , y = !1
  42412. , C = void 0 !== this.faceVertexUvs[0][l]
  42413. , I = v.normal.length() > 0
  42414. , E = v.vertexNormals.length > 0
  42415. , b = 1 !== v.color.r || 1 !== v.color.g || 1 !== v.color.b
  42416. , w = v.vertexColors.length > 0
  42417. , _ = 0;
  42418. if (_ = e(_, 0, 0),
  42419. _ = e(_, 1, A),
  42420. _ = e(_, 2, y),
  42421. _ = e(_, 3, C),
  42422. _ = e(_, 4, I),
  42423. _ = e(_, 5, E),
  42424. _ = e(_, 6, b),
  42425. _ = e(_, 7, w),
  42426. h.push(_),
  42427. h.push(v.a, v.b, v.c),
  42428. h.push(v.materialIndex),
  42429. C) {
  42430. var T = this.faceVertexUvs[0][l];
  42431. h.push(n(T[0]), n(T[1]), n(T[2]))
  42432. }
  42433. if (I && h.push(t(v.normal)),
  42434. E) {
  42435. var x = v.vertexNormals;
  42436. h.push(t(x[0]), t(x[1]), t(x[2]))
  42437. }
  42438. if (b && h.push(i(v.color)),
  42439. w) {
  42440. var S = v.vertexColors;
  42441. h.push(i(S[0]), i(S[1]), i(S[2]))
  42442. }
  42443. }
  42444. return r.data = {},
  42445. r.data.vertices = s,
  42446. r.data.normals = u,
  42447. p.length > 0 && (r.data.colors = p),
  42448. g.length > 0 && (r.data.uvs = [g]),
  42449. r.data.faces = h,
  42450. r
  42451. },
  42452. clone: function() {
  42453. return (new n.Geometry).copy(this)
  42454. },
  42455. copy: function(e) {
  42456. this.vertices = [],
  42457. this.faces = [],
  42458. this.faceVertexUvs = [[]];
  42459. for (var t = e.vertices, i = 0, n = t.length; i < n; i++)
  42460. this.vertices.push(t[i].clone());
  42461. for (var r = e.faces, i = 0, n = r.length; i < n; i++)
  42462. this.faces.push(r[i].clone());
  42463. for (var i = 0, n = e.faceVertexUvs.length; i < n; i++) {
  42464. var o = e.faceVertexUvs[i];
  42465. void 0 === this.faceVertexUvs[i] && (this.faceVertexUvs[i] = []);
  42466. for (var a = 0, s = o.length; a < s; a++) {
  42467. for (var l = o[a], c = [], h = 0, u = l.length; h < u; h++) {
  42468. var d = l[h];
  42469. c.push(d.clone())
  42470. }
  42471. this.faceVertexUvs[i].push(c)
  42472. }
  42473. }
  42474. return this
  42475. },
  42476. dispose: function() {
  42477. this.dispatchEvent({
  42478. type: "dispose"
  42479. })
  42480. }
  42481. },
  42482. n.EventDispatcher.prototype.apply(n.Geometry.prototype),
  42483. n.GeometryIdCount = 0,
  42484. n.DirectGeometry = function() {
  42485. Object.defineProperty(this, "id", {
  42486. value: n.GeometryIdCount++
  42487. }),
  42488. this.uuid = n.Math.generateUUID(),
  42489. this.name = "",
  42490. this.type = "DirectGeometry",
  42491. this.indices = [],
  42492. this.vertices = [],
  42493. this.normals = [],
  42494. this.colors = [],
  42495. this.uvs = [],
  42496. this.uvs2 = [],
  42497. this.groups = [],
  42498. this.morphTargets = {},
  42499. this.skinWeights = [],
  42500. this.skinIndices = [],
  42501. this.boundingBox = null,
  42502. this.boundingSphere = null,
  42503. this.verticesNeedUpdate = !1,
  42504. this.normalsNeedUpdate = !1,
  42505. this.colorsNeedUpdate = !1,
  42506. this.uvsNeedUpdate = !1,
  42507. this.groupsNeedUpdate = !1
  42508. }
  42509. ,
  42510. n.DirectGeometry.prototype = {
  42511. constructor: n.DirectGeometry,
  42512. computeBoundingBox: n.Geometry.prototype.computeBoundingBox,
  42513. computeBoundingSphere: n.Geometry.prototype.computeBoundingSphere,
  42514. computeFaceNormals: function() {
  42515. console.warn("THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.")
  42516. },
  42517. computeVertexNormals: function() {
  42518. console.warn("THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.")
  42519. },
  42520. computeGroups: function(e) {
  42521. for (var t, i, n = [], r = e.faces, o = 0; o < r.length; o++) {
  42522. var a = r[o];
  42523. a.materialIndex !== i && (i = a.materialIndex,
  42524. void 0 !== t && (t.count = 3 * o - t.start,
  42525. n.push(t)),
  42526. t = {
  42527. start: 3 * o,
  42528. materialIndex: i
  42529. })
  42530. }
  42531. void 0 !== t && (t.count = 3 * o - t.start,
  42532. n.push(t)),
  42533. this.groups = n
  42534. },
  42535. fromGeometry: function(e) {
  42536. var t, i = e.faces, r = e.vertices, o = e.faceVertexUvs, a = o[0] && o[0].length > 0, s = o[1] && o[1].length > 0, l = e.morphTargets, c = l.length;
  42537. if (c > 0) {
  42538. t = [];
  42539. for (var h = 0; h < c; h++)
  42540. t[h] = [];
  42541. this.morphTargets.position = t
  42542. }
  42543. var u, d = e.morphNormals, p = d.length;
  42544. if (p > 0) {
  42545. u = [];
  42546. for (var h = 0; h < p; h++)
  42547. u[h] = [];
  42548. this.morphTargets.normal = u
  42549. }
  42550. for (var f = e.skinIndices, g = e.skinWeights, m = f.length === r.length, v = g.length === r.length, h = 0; h < i.length; h++) {
  42551. var A = i[h];
  42552. this.vertices.push(r[A.a], r[A.b], r[A.c]);
  42553. var y = A.vertexNormals;
  42554. if (3 === y.length)
  42555. this.normals.push(y[0], y[1], y[2]);
  42556. else {
  42557. var C = A.normal;
  42558. this.normals.push(C, C, C)
  42559. }
  42560. var I = A.vertexColors;
  42561. if (3 === I.length)
  42562. this.colors.push(I[0], I[1], I[2]);
  42563. else {
  42564. var E = A.color;
  42565. this.colors.push(E, E, E)
  42566. }
  42567. if (a === !0) {
  42568. var b = o[0][h];
  42569. void 0 !== b ? this.uvs.push(b[0], b[1], b[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ", h),
  42570. this.uvs.push(new n.Vector2, new n.Vector2, new n.Vector2))
  42571. }
  42572. if (s === !0) {
  42573. var b = o[1][h];
  42574. void 0 !== b ? this.uvs2.push(b[0], b[1], b[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ", h),
  42575. this.uvs2.push(new n.Vector2, new n.Vector2, new n.Vector2))
  42576. }
  42577. for (var w = 0; w < c; w++) {
  42578. var _ = l[w].vertices;
  42579. t[w].push(_[A.a], _[A.b], _[A.c])
  42580. }
  42581. for (var w = 0; w < p; w++) {
  42582. var T = d[w].vertexNormals[h];
  42583. u[w].push(T.a, T.b, T.c)
  42584. }
  42585. m && this.skinIndices.push(f[A.a], f[A.b], f[A.c]),
  42586. v && this.skinWeights.push(g[A.a], g[A.b], g[A.c])
  42587. }
  42588. return this.computeGroups(e),
  42589. this.verticesNeedUpdate = e.verticesNeedUpdate,
  42590. this.normalsNeedUpdate = e.normalsNeedUpdate,
  42591. this.colorsNeedUpdate = e.colorsNeedUpdate,
  42592. this.uvsNeedUpdate = e.uvsNeedUpdate,
  42593. this.groupsNeedUpdate = e.groupsNeedUpdate,
  42594. this
  42595. },
  42596. dispose: function() {
  42597. this.dispatchEvent({
  42598. type: "dispose"
  42599. })
  42600. }
  42601. },
  42602. n.EventDispatcher.prototype.apply(n.DirectGeometry.prototype),
  42603. n.BufferGeometry = function() {
  42604. Object.defineProperty(this, "id", {
  42605. value: n.GeometryIdCount++
  42606. }),
  42607. this.uuid = n.Math.generateUUID(),
  42608. this.name = "",
  42609. this.type = "BufferGeometry",
  42610. this.index = null,
  42611. this.attributes = {},
  42612. this.morphAttributes = {},
  42613. this.groups = [],
  42614. this.boundingBox = null,
  42615. this.boundingSphere = null,
  42616. this.drawRange = {
  42617. start: 0,
  42618. count: 1 / 0
  42619. }
  42620. }
  42621. ,
  42622. n.BufferGeometry.prototype = {
  42623. constructor: n.BufferGeometry,
  42624. getIndex: function() {
  42625. return this.index
  42626. },
  42627. setIndex: function(e) {
  42628. this.index = e
  42629. },
  42630. addAttribute: function(e, t) {
  42631. return t instanceof n.BufferAttribute == !1 && t instanceof n.InterleavedBufferAttribute == !1 ? (console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),
  42632. void this.addAttribute(e, new n.BufferAttribute(arguments[1],arguments[2]))) : "index" === e ? (console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),
  42633. void this.setIndex(t)) : (this.attributes[e] = t,
  42634. this)
  42635. },
  42636. getAttribute: function(e) {
  42637. return this.attributes[e]
  42638. },
  42639. removeAttribute: function(e) {
  42640. return delete this.attributes[e],
  42641. this
  42642. },
  42643. addGroup: function(e, t, i) {
  42644. this.groups.push({
  42645. start: e,
  42646. count: t,
  42647. materialIndex: void 0 !== i ? i : 0
  42648. })
  42649. },
  42650. clearGroups: function() {
  42651. this.groups = []
  42652. },
  42653. setDrawRange: function(e, t) {
  42654. this.drawRange.start = e,
  42655. this.drawRange.count = t
  42656. },
  42657. applyMatrix: function(e) {
  42658. var t = this.attributes.position;
  42659. void 0 !== t && (e.applyToVector3Array(t.array),
  42660. t.needsUpdate = !0);
  42661. var i = this.attributes.normal;
  42662. if (void 0 !== i) {
  42663. var r = (new n.Matrix3).getNormalMatrix(e);
  42664. r.applyToVector3Array(i.array),
  42665. i.needsUpdate = !0
  42666. }
  42667. return null !== this.boundingBox && this.computeBoundingBox(),
  42668. null !== this.boundingSphere && this.computeBoundingSphere(),
  42669. this
  42670. },
  42671. rotateX: function() {
  42672. var e;
  42673. return function(t) {
  42674. return void 0 === e && (e = new n.Matrix4),
  42675. e.makeRotationX(t),
  42676. this.applyMatrix(e),
  42677. this
  42678. }
  42679. }(),
  42680. rotateY: function() {
  42681. var e;
  42682. return function(t) {
  42683. return void 0 === e && (e = new n.Matrix4),
  42684. e.makeRotationY(t),
  42685. this.applyMatrix(e),
  42686. this
  42687. }
  42688. }(),
  42689. rotateZ: function() {
  42690. var e;
  42691. return function(t) {
  42692. return void 0 === e && (e = new n.Matrix4),
  42693. e.makeRotationZ(t),
  42694. this.applyMatrix(e),
  42695. this
  42696. }
  42697. }(),
  42698. translate: function() {
  42699. var e;
  42700. return function(t, i, r) {
  42701. return void 0 === e && (e = new n.Matrix4),
  42702. e.makeTranslation(t, i, r),
  42703. this.applyMatrix(e),
  42704. this
  42705. }
  42706. }(),
  42707. scale: function() {
  42708. var e;
  42709. return function(t, i, r) {
  42710. return void 0 === e && (e = new n.Matrix4),
  42711. e.makeScale(t, i, r),
  42712. this.applyMatrix(e),
  42713. this
  42714. }
  42715. }(),
  42716. lookAt: function() {
  42717. var e;
  42718. return function(t) {
  42719. void 0 === e && (e = new n.Object3D),
  42720. e.lookAt(t),
  42721. e.updateMatrix(),
  42722. this.applyMatrix(e.matrix)
  42723. }
  42724. }(),
  42725. center: function() {
  42726. this.computeBoundingBox();
  42727. var e = this.boundingBox.center().negate();
  42728. return this.translate(e.x, e.y, e.z),
  42729. e
  42730. },
  42731. setFromObject: function(e) {
  42732. var t = e.geometry;
  42733. if (e instanceof n.Points || e instanceof n.Line) {
  42734. var i = new n.Float32Attribute(3 * t.vertices.length,3)
  42735. , r = new n.Float32Attribute(3 * t.colors.length,3);
  42736. if (this.addAttribute("position", i.copyVector3sArray(t.vertices)),
  42737. this.addAttribute("color", r.copyColorsArray(t.colors)),
  42738. t.lineDistances && t.lineDistances.length === t.vertices.length) {
  42739. var o = new n.Float32Attribute(t.lineDistances.length,1);
  42740. this.addAttribute("lineDistance", o.copyArray(t.lineDistances))
  42741. }
  42742. null !== t.boundingSphere && (this.boundingSphere = t.boundingSphere.clone()),
  42743. null !== t.boundingBox && (this.boundingBox = t.boundingBox.clone())
  42744. } else
  42745. e instanceof n.Mesh && t instanceof n.Geometry && this.fromGeometry(t);
  42746. return this
  42747. },
  42748. updateFromObject: function(e) {
  42749. var t = e.geometry;
  42750. if (e instanceof n.Mesh) {
  42751. var i = t.__directGeometry;
  42752. if (void 0 === i)
  42753. return this.fromGeometry(t);
  42754. i.verticesNeedUpdate = t.verticesNeedUpdate,
  42755. i.normalsNeedUpdate = t.normalsNeedUpdate,
  42756. i.colorsNeedUpdate = t.colorsNeedUpdate,
  42757. i.uvsNeedUpdate = t.uvsNeedUpdate,
  42758. i.groupsNeedUpdate = t.groupsNeedUpdate,
  42759. t.verticesNeedUpdate = !1,
  42760. t.normalsNeedUpdate = !1,
  42761. t.colorsNeedUpdate = !1,
  42762. t.uvsNeedUpdate = !1,
  42763. t.groupsNeedUpdate = !1,
  42764. t = i
  42765. }
  42766. if (t.verticesNeedUpdate === !0) {
  42767. var r = this.attributes.position;
  42768. void 0 !== r && (r.copyVector3sArray(t.vertices),
  42769. r.needsUpdate = !0),
  42770. t.verticesNeedUpdate = !1
  42771. }
  42772. if (t.normalsNeedUpdate === !0) {
  42773. var r = this.attributes.normal;
  42774. void 0 !== r && (r.copyVector3sArray(t.normals),
  42775. r.needsUpdate = !0),
  42776. t.normalsNeedUpdate = !1
  42777. }
  42778. if (t.colorsNeedUpdate === !0) {
  42779. var r = this.attributes.color;
  42780. void 0 !== r && (r.copyColorsArray(t.colors),
  42781. r.needsUpdate = !0),
  42782. t.colorsNeedUpdate = !1
  42783. }
  42784. if (t.uvsNeedUpdate) {
  42785. var r = this.attributes.uv;
  42786. void 0 !== r && (r.copyVector2sArray(t.uvs),
  42787. r.needsUpdate = !0),
  42788. t.uvsNeedUpdate = !1
  42789. }
  42790. if (t.lineDistancesNeedUpdate) {
  42791. var r = this.attributes.lineDistance;
  42792. void 0 !== r && (r.copyArray(t.lineDistances),
  42793. r.needsUpdate = !0),
  42794. t.lineDistancesNeedUpdate = !1
  42795. }
  42796. return t.groupsNeedUpdate && (t.computeGroups(e.geometry),
  42797. this.groups = t.groups,
  42798. t.groupsNeedUpdate = !1),
  42799. this
  42800. },
  42801. fromGeometry: function(e) {
  42802. return e.__directGeometry = (new n.DirectGeometry).fromGeometry(e),
  42803. this.fromDirectGeometry(e.__directGeometry)
  42804. },
  42805. fromDirectGeometry: function(e) {
  42806. var t = new Float32Array(3 * e.vertices.length);
  42807. if (this.addAttribute("position", new n.BufferAttribute(t,3).copyVector3sArray(e.vertices)),
  42808. e.normals.length > 0) {
  42809. var i = new Float32Array(3 * e.normals.length);
  42810. this.addAttribute("normal", new n.BufferAttribute(i,3).copyVector3sArray(e.normals))
  42811. }
  42812. if (e.colors.length > 0) {
  42813. var r = new Float32Array(3 * e.colors.length);
  42814. this.addAttribute("color", new n.BufferAttribute(r,3).copyColorsArray(e.colors))
  42815. }
  42816. if (e.uvs.length > 0) {
  42817. var o = new Float32Array(2 * e.uvs.length);
  42818. this.addAttribute("uv", new n.BufferAttribute(o,2).copyVector2sArray(e.uvs))
  42819. }
  42820. if (e.uvs2.length > 0) {
  42821. var a = new Float32Array(2 * e.uvs2.length);
  42822. this.addAttribute("uv2", new n.BufferAttribute(a,2).copyVector2sArray(e.uvs2))
  42823. }
  42824. if (e.indices.length > 0) {
  42825. var s = e.vertices.length > 65535 ? Uint32Array : Uint16Array
  42826. , l = new s(3 * e.indices.length);
  42827. this.setIndex(new n.BufferAttribute(l,1).copyIndicesArray(e.indices))
  42828. }
  42829. this.groups = e.groups;
  42830. for (var c in e.morphTargets) {
  42831. for (var h = [], u = e.morphTargets[c], d = 0, p = u.length; d < p; d++) {
  42832. var f = u[d]
  42833. , g = new n.Float32Attribute(3 * f.length,3);
  42834. h.push(g.copyVector3sArray(f))
  42835. }
  42836. this.morphAttributes[c] = h
  42837. }
  42838. if (e.skinIndices.length > 0) {
  42839. var m = new n.Float32Attribute(4 * e.skinIndices.length,4);
  42840. this.addAttribute("skinIndex", m.copyVector4sArray(e.skinIndices))
  42841. }
  42842. if (e.skinWeights.length > 0) {
  42843. var v = new n.Float32Attribute(4 * e.skinWeights.length,4);
  42844. this.addAttribute("skinWeight", v.copyVector4sArray(e.skinWeights))
  42845. }
  42846. return null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  42847. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  42848. this
  42849. },
  42850. computeBoundingBox: function() {
  42851. new n.Vector3;
  42852. return function() {
  42853. null === this.boundingBox && (this.boundingBox = new n.Box3);
  42854. var e = this.attributes.position.array;
  42855. e && this.boundingBox.setFromArray(e),
  42856. void 0 !== e && 0 !== e.length || (this.boundingBox.min.set(0, 0, 0),
  42857. this.boundingBox.max.set(0, 0, 0)),
  42858. (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)
  42859. }
  42860. }(),
  42861. computeBoundingSphere: function() {
  42862. var e = new n.Box3
  42863. , t = new n.Vector3;
  42864. return function() {
  42865. null === this.boundingSphere && (this.boundingSphere = new n.Sphere);
  42866. var i = this.attributes.position.array;
  42867. if (i) {
  42868. var r = this.boundingSphere.center;
  42869. e.setFromArray(i),
  42870. e.center(r);
  42871. for (var o = 0, a = 0, s = i.length; a < s; a += 3)
  42872. t.fromArray(i, a),
  42873. o = Math.max(o, r.distanceToSquared(t));
  42874. this.boundingSphere.radius = Math.sqrt(o),
  42875. isNaN(this.boundingSphere.radius) && console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this)
  42876. }
  42877. }
  42878. }(),
  42879. computeFaceNormals: function() {},
  42880. computeVertexNormals: function() {
  42881. var e = this.index
  42882. , t = this.attributes
  42883. , i = this.groups;
  42884. if (t.position) {
  42885. var r = t.position.array;
  42886. if (void 0 === t.normal)
  42887. this.addAttribute("normal", new n.BufferAttribute(new Float32Array(r.length),3));
  42888. else
  42889. for (var o = t.normal.array, a = 0, s = o.length; a < s; a++)
  42890. o[a] = 0;
  42891. var l, c, h, u = t.normal.array, d = new n.Vector3, p = new n.Vector3, f = new n.Vector3, g = new n.Vector3, m = new n.Vector3;
  42892. if (e) {
  42893. var v = e.array;
  42894. 0 === i.length && this.addGroup(0, v.length);
  42895. for (var A = 0, y = i.length; A < y; ++A)
  42896. for (var C = i[A], I = C.start, E = C.count, a = I, s = I + E; a < s; a += 3)
  42897. l = 3 * v[a + 0],
  42898. c = 3 * v[a + 1],
  42899. h = 3 * v[a + 2],
  42900. d.fromArray(r, l),
  42901. p.fromArray(r, c),
  42902. f.fromArray(r, h),
  42903. g.subVectors(f, p),
  42904. m.subVectors(d, p),
  42905. g.cross(m),
  42906. u[l] += g.x,
  42907. u[l + 1] += g.y,
  42908. u[l + 2] += g.z,
  42909. u[c] += g.x,
  42910. u[c + 1] += g.y,
  42911. u[c + 2] += g.z,
  42912. u[h] += g.x,
  42913. u[h + 1] += g.y,
  42914. u[h + 2] += g.z
  42915. } else
  42916. for (var a = 0, s = r.length; a < s; a += 9)
  42917. d.fromArray(r, a),
  42918. p.fromArray(r, a + 3),
  42919. f.fromArray(r, a + 6),
  42920. g.subVectors(f, p),
  42921. m.subVectors(d, p),
  42922. g.cross(m),
  42923. u[a] = g.x,
  42924. u[a + 1] = g.y,
  42925. u[a + 2] = g.z,
  42926. u[a + 3] = g.x,
  42927. u[a + 4] = g.y,
  42928. u[a + 5] = g.z,
  42929. u[a + 6] = g.x,
  42930. u[a + 7] = g.y,
  42931. u[a + 8] = g.z;
  42932. this.normalizeNormals(),
  42933. t.normal.needsUpdate = !0
  42934. }
  42935. },
  42936. merge: function(e, t) {
  42937. if (e instanceof n.BufferGeometry == !1)
  42938. return void console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.", e);
  42939. void 0 === t && (t = 0);
  42940. var i = this.attributes;
  42941. for (var r in i)
  42942. if (void 0 !== e.attributes[r])
  42943. for (var o = i[r], a = o.array, s = e.attributes[r], l = s.array, c = s.itemSize, h = 0, u = c * t; h < l.length; h++,
  42944. u++)
  42945. a[u] = l[h];
  42946. return this
  42947. },
  42948. normalizeNormals: function() {
  42949. for (var e, t, i, n, r = this.attributes.normal.array, o = 0, a = r.length; o < a; o += 3)
  42950. e = r[o],
  42951. t = r[o + 1],
  42952. i = r[o + 2],
  42953. n = 1 / Math.sqrt(e * e + t * t + i * i),
  42954. r[o] *= n,
  42955. r[o + 1] *= n,
  42956. r[o + 2] *= n
  42957. },
  42958. toNonIndexed: function() {
  42959. if (null === this.index)
  42960. return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),
  42961. this;
  42962. var e = new n.BufferGeometry
  42963. , t = this.index.array
  42964. , i = this.attributes;
  42965. for (var r in i) {
  42966. for (var o = i[r], a = o.array, s = o.itemSize, l = new a.constructor(t.length * s), c = 0, h = 0, u = 0, d = t.length; u < d; u++) {
  42967. c = t[u] * s;
  42968. for (var p = 0; p < s; p++)
  42969. l[h++] = a[c++]
  42970. }
  42971. e.addAttribute(r, new n.BufferAttribute(l,s))
  42972. }
  42973. return e
  42974. },
  42975. toJSON: function() {
  42976. var e = {
  42977. metadata: {
  42978. version: 4.4,
  42979. type: "BufferGeometry",
  42980. generator: "BufferGeometry.toJSON"
  42981. }
  42982. };
  42983. if (e.uuid = this.uuid,
  42984. e.type = this.type,
  42985. "" !== this.name && (e.name = this.name),
  42986. void 0 !== this.parameters) {
  42987. var t = this.parameters;
  42988. for (var i in t)
  42989. void 0 !== t[i] && (e[i] = t[i]);
  42990. return e
  42991. }
  42992. e.data = {
  42993. attributes: {}
  42994. };
  42995. var n = this.index;
  42996. if (null !== n) {
  42997. var r = Array.prototype.slice.call(n.array);
  42998. e.data.index = {
  42999. type: n.array.constructor.name,
  43000. array: r
  43001. }
  43002. }
  43003. var o = this.attributes;
  43004. for (var i in o) {
  43005. var a = o[i]
  43006. , r = Array.prototype.slice.call(a.array);
  43007. e.data.attributes[i] = {
  43008. itemSize: a.itemSize,
  43009. type: a.array.constructor.name,
  43010. array: r
  43011. }
  43012. }
  43013. var s = this.groups;
  43014. s.length > 0 && (e.data.groups = JSON.parse(JSON.stringify(s)));
  43015. var l = this.boundingSphere;
  43016. return null !== l && (e.data.boundingSphere = {
  43017. center: l.center.toArray(),
  43018. radius: l.radius
  43019. }),
  43020. e
  43021. },
  43022. clone: function() {
  43023. return (new n.BufferGeometry).copy(this)
  43024. },
  43025. copy: function(e) {
  43026. var t = e.index;
  43027. null !== t && this.setIndex(t.clone());
  43028. var i = e.attributes;
  43029. for (var n in i) {
  43030. var r = i[n];
  43031. this.addAttribute(n, r.clone())
  43032. }
  43033. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  43034. var l = o[a];
  43035. this.addGroup(l.start, l.count)
  43036. }
  43037. return this
  43038. },
  43039. dispose: function() {
  43040. this.dispatchEvent({
  43041. type: "dispose"
  43042. })
  43043. }
  43044. },
  43045. n.EventDispatcher.prototype.apply(n.BufferGeometry.prototype),
  43046. n.BufferGeometry.MaxIndex = 65535,
  43047. n.InstancedBufferGeometry = function() {
  43048. n.BufferGeometry.call(this),
  43049. this.type = "InstancedBufferGeometry",
  43050. this.maxInstancedCount = void 0
  43051. }
  43052. ,
  43053. n.InstancedBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  43054. n.InstancedBufferGeometry.prototype.constructor = n.InstancedBufferGeometry,
  43055. n.InstancedBufferGeometry.prototype.addGroup = function(e, t, i) {
  43056. this.groups.push({
  43057. start: e,
  43058. count: t,
  43059. instances: i
  43060. })
  43061. }
  43062. ,
  43063. n.InstancedBufferGeometry.prototype.copy = function(e) {
  43064. var t = e.index;
  43065. null !== t && this.setIndex(t.clone());
  43066. var i = e.attributes;
  43067. for (var n in i) {
  43068. var r = i[n];
  43069. this.addAttribute(n, r.clone())
  43070. }
  43071. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  43072. var l = o[a];
  43073. this.addGroup(l.start, l.count, l.instances)
  43074. }
  43075. return this
  43076. }
  43077. ,
  43078. n.EventDispatcher.prototype.apply(n.InstancedBufferGeometry.prototype),
  43079. n.Uniform = function(e, t) {
  43080. this.type = e,
  43081. this.value = t,
  43082. this.dynamic = !1
  43083. }
  43084. ,
  43085. n.Uniform.prototype = {
  43086. constructor: n.Uniform,
  43087. onUpdate: function(e) {
  43088. return this.dynamic = !0,
  43089. this.onUpdateCallback = e,
  43090. this
  43091. }
  43092. },
  43093. n.AnimationClip = function(e, t, i) {
  43094. this.name = e || n.Math.generateUUID(),
  43095. this.tracks = i,
  43096. this.duration = void 0 !== t ? t : -1,
  43097. this.duration < 0 && this.resetDuration(),
  43098. this.trim(),
  43099. this.optimize()
  43100. }
  43101. ,
  43102. n.AnimationClip.prototype = {
  43103. constructor: n.AnimationClip,
  43104. resetDuration: function() {
  43105. for (var e = this.tracks, t = 0, i = 0, n = e.length; i !== n; ++i) {
  43106. var r = this.tracks[i];
  43107. t = Math.max(t, r.times[r.times.length - 1])
  43108. }
  43109. this.duration = t
  43110. },
  43111. trim: function() {
  43112. for (var e = 0; e < this.tracks.length; e++)
  43113. this.tracks[e].trim(0, this.duration);
  43114. return this
  43115. },
  43116. optimize: function() {
  43117. for (var e = 0; e < this.tracks.length; e++)
  43118. this.tracks[e].optimize();
  43119. return this
  43120. }
  43121. },
  43122. Object.assign(n.AnimationClip, {
  43123. parse: function(e) {
  43124. for (var t = [], i = e.tracks, r = 1 / (e.fps || 1), o = 0, a = i.length; o !== a; ++o)
  43125. t.push(n.KeyframeTrack.parse(i[o]).scale(r));
  43126. return new n.AnimationClip(e.name,e.duration,t)
  43127. },
  43128. toJSON: function(e) {
  43129. for (var t = [], i = e.tracks, r = {
  43130. name: e.name,
  43131. duration: e.duration,
  43132. tracks: t
  43133. }, o = 0, a = i.length; o !== a; ++o)
  43134. t.push(n.KeyframeTrack.toJSON(i[o]));
  43135. return r
  43136. },
  43137. CreateFromMorphTargetSequence: function(e, t, i) {
  43138. for (var r = t.length, o = [], a = 0; a < r; a++) {
  43139. var s = []
  43140. , l = [];
  43141. s.push((a + r - 1) % r, a, (a + 1) % r),
  43142. l.push(0, 1, 0);
  43143. var c = n.AnimationUtils.getKeyframeOrder(s);
  43144. s = n.AnimationUtils.sortedArray(s, 1, c),
  43145. l = n.AnimationUtils.sortedArray(l, 1, c),
  43146. 0 === s[0] && (s.push(r),
  43147. l.push(l[0])),
  43148. o.push(new n.NumberKeyframeTrack(".morphTargetInfluences[" + t[a].name + "]",s,l).scale(1 / i))
  43149. }
  43150. return new n.AnimationClip(e,-1,o)
  43151. },
  43152. findByName: function(e, t) {
  43153. for (var i = 0; i < e.length; i++)
  43154. if (e[i].name === t)
  43155. return e[i];
  43156. return null
  43157. },
  43158. CreateClipsFromMorphTargetSequences: function(e, t) {
  43159. for (var i = {}, r = /^([\w-]*?)([\d]+)$/, o = 0, a = e.length; o < a; o++) {
  43160. var s = e[o]
  43161. , l = s.name.match(r);
  43162. if (l && l.length > 1) {
  43163. var c = l[1]
  43164. , h = i[c];
  43165. h || (i[c] = h = []),
  43166. h.push(s)
  43167. }
  43168. }
  43169. var u = [];
  43170. for (var c in i)
  43171. u.push(n.AnimationClip.CreateFromMorphTargetSequence(c, i[c], t));
  43172. return u
  43173. },
  43174. parseAnimation: function(e, t, i) {
  43175. if (!e)
  43176. return console.error(" no animation in JSONLoader data"),
  43177. null;
  43178. for (var r = function(e, t, i, r, o) {
  43179. if (0 !== i.length) {
  43180. var a = []
  43181. , s = [];
  43182. n.AnimationUtils.flattenJSON(i, a, s, r),
  43183. 0 !== a.length && o.push(new e(t,a,s))
  43184. }
  43185. }, o = [], a = e.name || "default", s = e.length || -1, l = e.fps || 30, c = e.hierarchy || [], h = 0; h < c.length; h++) {
  43186. var u = c[h].keys;
  43187. if (u && 0 != u.length)
  43188. if (u[0].morphTargets) {
  43189. for (var d = {}, p = 0; p < u.length; p++)
  43190. if (u[p].morphTargets)
  43191. for (var f = 0; f < u[p].morphTargets.length; f++)
  43192. d[u[p].morphTargets[f]] = -1;
  43193. for (var g in d) {
  43194. for (var m = [], v = [], f = 0; f !== u[p].morphTargets.length; ++f) {
  43195. var A = u[p];
  43196. m.push(A.time),
  43197. v.push(A.morphTarget === g ? 1 : 0)
  43198. }
  43199. o.push(new n.NumberKeyframeTrack(".morphTargetInfluence[" + g + "]",m,v))
  43200. }
  43201. s = d.length * (l || 1)
  43202. } else {
  43203. var y = ".bones[" + t[h].name + "]";
  43204. r(n.VectorKeyframeTrack, y + ".position", u, "pos", o),
  43205. r(n.QuaternionKeyframeTrack, y + ".quaternion", u, "rot", o),
  43206. r(n.VectorKeyframeTrack, y + ".scale", u, "scl", o)
  43207. }
  43208. }
  43209. if (0 === o.length)
  43210. return null;
  43211. var C = new n.AnimationClip(a,s,o);
  43212. return C
  43213. }
  43214. }),
  43215. n.AnimationMixer = function(e) {
  43216. this._root = e,
  43217. this._initMemoryManager(),
  43218. this._accuIndex = 0,
  43219. this.time = 0,
  43220. this.timeScale = 1
  43221. }
  43222. ,
  43223. n.AnimationMixer.prototype = {
  43224. constructor: n.AnimationMixer,
  43225. clipAction: function(e, t) {
  43226. var i, r = t || this._root, o = r.uuid, a = "string" == typeof e ? e : e.name, s = e !== a ? e : null, l = this._actionsByClip[a];
  43227. if (void 0 !== l) {
  43228. var c = l.actionByRoot[o];
  43229. if (void 0 !== c)
  43230. return c;
  43231. if (i = l.knownActions[0],
  43232. s = i._clip,
  43233. e !== a && e !== s)
  43234. throw new Error("Different clips with the same name detected!")
  43235. }
  43236. if (null === s)
  43237. return null;
  43238. var h = new n.AnimationMixer._Action(this,s,t);
  43239. return this._bindAction(h, i),
  43240. this._addInactiveAction(h, a, o),
  43241. h
  43242. },
  43243. existingAction: function(e, t) {
  43244. var i = t || this._root
  43245. , n = i.uuid
  43246. , r = "string" == typeof e ? e : e.name
  43247. , o = this._actionsByClip[r];
  43248. return void 0 !== o ? o.actionByRoot[n] || null : null
  43249. },
  43250. stopAllAction: function() {
  43251. var e = this._actions
  43252. , t = this._nActiveActions
  43253. , i = this._bindings
  43254. , n = this._nActiveBindings;
  43255. this._nActiveActions = 0,
  43256. this._nActiveBindings = 0;
  43257. for (var r = 0; r !== t; ++r)
  43258. e[r].reset();
  43259. for (var r = 0; r !== n; ++r)
  43260. i[r].useCount = 0;
  43261. return this
  43262. },
  43263. update: function(e) {
  43264. e *= this.timeScale;
  43265. 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) {
  43266. var s = t[a];
  43267. s.enabled && s._update(n, e, r, o)
  43268. }
  43269. for (var l = this._bindings, c = this._nActiveBindings, a = 0; a !== c; ++a)
  43270. l[a].apply(o);
  43271. return this
  43272. },
  43273. getRoot: function() {
  43274. return this._root
  43275. },
  43276. uncacheClip: function(e) {
  43277. var t = this._actions
  43278. , i = e.name
  43279. , n = this._actionsByClip
  43280. , r = n[i];
  43281. if (void 0 !== r) {
  43282. for (var o = r.knownActions, a = 0, s = o.length; a !== s; ++a) {
  43283. var l = o[a];
  43284. this._deactivateAction(l);
  43285. var c = l._cacheIndex
  43286. , h = t[t.length - 1];
  43287. l._cacheIndex = null,
  43288. l._byClipCacheIndex = null,
  43289. h._cacheIndex = c,
  43290. t[c] = h,
  43291. t.pop(),
  43292. this._removeInactiveBindingsForAction(l)
  43293. }
  43294. delete n[i]
  43295. }
  43296. },
  43297. uncacheRoot: function(e) {
  43298. var t = e.uuid
  43299. , i = this._actionsByClip;
  43300. for (var n in i) {
  43301. var r = i[n].actionByRoot
  43302. , o = r[t];
  43303. void 0 !== o && (this._deactivateAction(o),
  43304. this._removeInactiveAction(o))
  43305. }
  43306. var a = this._bindingsByRootAndName
  43307. , s = a[t];
  43308. if (void 0 !== s)
  43309. for (var l in s) {
  43310. var c = s[l];
  43311. c.restoreOriginalState(),
  43312. this._removeInactiveBinding(c)
  43313. }
  43314. },
  43315. uncacheAction: function(e, t) {
  43316. var i = this.existingAction(e, t);
  43317. null !== i && (this._deactivateAction(i),
  43318. this._removeInactiveAction(i))
  43319. }
  43320. },
  43321. n.EventDispatcher.prototype.apply(n.AnimationMixer.prototype),
  43322. n.AnimationMixer._Action = function(e, t, i) {
  43323. this._mixer = e,
  43324. this._clip = t,
  43325. this._localRoot = i || null;
  43326. for (var r = t.tracks, o = r.length, a = new Array(o), s = {
  43327. endingStart: n.ZeroCurvatureEnding,
  43328. endingEnd: n.ZeroCurvatureEnding
  43329. }, l = 0; l !== o; ++l) {
  43330. var c = r[l].createInterpolant(null);
  43331. a[l] = c,
  43332. c.settings = s
  43333. }
  43334. this._interpolantSettings = s,
  43335. this._interpolants = a,
  43336. this._propertyBindings = new Array(o),
  43337. this._cacheIndex = null,
  43338. this._byClipCacheIndex = null,
  43339. this._timeScaleInterpolant = null,
  43340. this._weightInterpolant = null,
  43341. this.loop = n.LoopRepeat,
  43342. this._loopCount = -1,
  43343. this._startTime = null,
  43344. this.time = 0,
  43345. this.timeScale = 1,
  43346. this._effectiveTimeScale = 1,
  43347. this.weight = 1,
  43348. this._effectiveWeight = 1,
  43349. this.repetitions = 1 / 0,
  43350. this.paused = !1,
  43351. this.enabled = !0,
  43352. this.clampWhenFinished = !1,
  43353. this.zeroSlopeAtStart = !0,
  43354. this.zeroSlopeAtEnd = !0
  43355. }
  43356. ,
  43357. n.AnimationMixer._Action.prototype = {
  43358. constructor: n.AnimationMixer._Action,
  43359. play: function() {
  43360. return this._mixer._activateAction(this),
  43361. this
  43362. },
  43363. stop: function() {
  43364. return this._mixer._deactivateAction(this),
  43365. this.reset()
  43366. },
  43367. reset: function() {
  43368. return this.paused = !1,
  43369. this.enabled = !0,
  43370. this.time = 0,
  43371. this._loopCount = -1,
  43372. this._startTime = null,
  43373. this.stopFading().stopWarping()
  43374. },
  43375. isRunning: function() {
  43376. this._startTime;
  43377. return this.enabled && !this.paused && 0 !== this.timeScale && null === this._startTime && this._mixer._isActiveAction(this)
  43378. },
  43379. isScheduled: function() {
  43380. return this._mixer._isActiveAction(this)
  43381. },
  43382. startAt: function(e) {
  43383. return this._startTime = e,
  43384. this
  43385. },
  43386. setLoop: function(e, t) {
  43387. return this.loop = e,
  43388. this.repetitions = t,
  43389. this
  43390. },
  43391. setEffectiveWeight: function(e) {
  43392. return this.weight = e,
  43393. this._effectiveWeight = this.enabled ? e : 0,
  43394. this.stopFading()
  43395. },
  43396. getEffectiveWeight: function() {
  43397. return this._effectiveWeight
  43398. },
  43399. fadeIn: function(e) {
  43400. return this._scheduleFading(e, 0, 1)
  43401. },
  43402. fadeOut: function(e) {
  43403. return this._scheduleFading(e, 1, 0)
  43404. },
  43405. crossFadeFrom: function(e, t, i) {
  43406. this._mixer;
  43407. if (e.fadeOut(t),
  43408. this.fadeIn(t),
  43409. i) {
  43410. var n = this._clip.duration
  43411. , r = e._clip.duration
  43412. , o = r / n
  43413. , a = n / r;
  43414. e.warp(1, o, t),
  43415. this.warp(a, 1, t)
  43416. }
  43417. return this
  43418. },
  43419. crossFadeTo: function(e, t, i) {
  43420. return e.crossFadeFrom(this, t, i)
  43421. },
  43422. stopFading: function() {
  43423. var e = this._weightInterpolant;
  43424. return null !== e && (this._weightInterpolant = null,
  43425. this._mixer._takeBackControlInterpolant(e)),
  43426. this
  43427. },
  43428. setEffectiveTimeScale: function(e) {
  43429. return this.timeScale = e,
  43430. this._effectiveTimeScale = this.paused ? 0 : e,
  43431. this.stopWarping()
  43432. },
  43433. getEffectiveTimeScale: function() {
  43434. return this._effectiveTimeScale
  43435. },
  43436. setDuration: function(e) {
  43437. return this.timeScale = this._clip.duration / e,
  43438. this.stopWarping()
  43439. },
  43440. syncWith: function(e) {
  43441. return this.time = e.time,
  43442. this.timeScale = e.timeScale,
  43443. this.stopWarping()
  43444. },
  43445. halt: function(e) {
  43446. return this.warp(this._currentTimeScale, 0, e)
  43447. },
  43448. warp: function(e, t, i) {
  43449. var n = this._mixer
  43450. , r = n.time
  43451. , o = this._timeScaleInterpolant
  43452. , a = this.timeScale;
  43453. null === o && (o = n._lendControlInterpolant(),
  43454. this._timeScaleInterpolant = o);
  43455. var s = o.parameterPositions
  43456. , l = o.sampleValues;
  43457. return s[0] = r,
  43458. s[1] = r + i,
  43459. l[0] = e / a,
  43460. l[1] = t / a,
  43461. this
  43462. },
  43463. stopWarping: function() {
  43464. var e = this._timeScaleInterpolant;
  43465. return null !== e && (this._timeScaleInterpolant = null,
  43466. this._mixer._takeBackControlInterpolant(e)),
  43467. this
  43468. },
  43469. getMixer: function() {
  43470. return this._mixer
  43471. },
  43472. getClip: function() {
  43473. return this._clip
  43474. },
  43475. getRoot: function() {
  43476. return this._localRoot || this._mixer._root
  43477. },
  43478. _update: function(e, t, i, n) {
  43479. var r = this._startTime;
  43480. if (null !== r) {
  43481. var o = (e - r) * i;
  43482. if (o < 0 || 0 === i)
  43483. return;
  43484. this._startTime = null,
  43485. t = i * o
  43486. }
  43487. t *= this._updateTimeScale(e);
  43488. var a = this._updateTime(t)
  43489. , s = this._updateWeight(e);
  43490. if (s > 0)
  43491. for (var l = this._interpolants, c = this._propertyBindings, h = 0, u = l.length; h !== u; ++h)
  43492. l[h].evaluate(a),
  43493. c[h].accumulate(n, s)
  43494. },
  43495. _updateWeight: function(e) {
  43496. var t = 0;
  43497. if (this.enabled) {
  43498. t = this.weight;
  43499. var i = this._weightInterpolant;
  43500. if (null !== i) {
  43501. var n = i.evaluate(e)[0];
  43502. t *= n,
  43503. e > i.parameterPositions[1] && (this.stopFading(),
  43504. 0 === n && (this.enabled = !1))
  43505. }
  43506. }
  43507. return this._effectiveWeight = t,
  43508. t
  43509. },
  43510. _updateTimeScale: function(e) {
  43511. var t = 0;
  43512. if (!this.paused) {
  43513. t = this.timeScale;
  43514. var i = this._timeScaleInterpolant;
  43515. if (null !== i) {
  43516. var n = i.evaluate(e)[0];
  43517. t *= n,
  43518. e > i.parameterPositions[1] && (this.stopWarping(),
  43519. 0 === t ? this.pause = !0 : this.timeScale = t)
  43520. }
  43521. }
  43522. return this._effectiveTimeScale = t,
  43523. t
  43524. },
  43525. _updateTime: function(e) {
  43526. var t = this.time + e;
  43527. if (0 === e)
  43528. return t;
  43529. var i = this._clip.duration
  43530. , r = this.loop
  43531. , o = this._loopCount
  43532. , a = !1;
  43533. switch (r) {
  43534. case n.LoopOnce:
  43535. if (o === -1 && (this.loopCount = 0,
  43536. this._setEndings(!0, !0, !1)),
  43537. t >= i)
  43538. t = i;
  43539. else {
  43540. if (!(t < 0))
  43541. break;
  43542. t = 0
  43543. }
  43544. this.clampWhenFinished ? this.pause = !0 : this.enabled = !1,
  43545. this._mixer.dispatchEvent({
  43546. type: "finished",
  43547. action: this,
  43548. direction: e < 0 ? -1 : 1
  43549. });
  43550. break;
  43551. case n.LoopPingPong:
  43552. a = !0;
  43553. case n.LoopRepeat:
  43554. if (o === -1 && (e > 0 ? (o = 0,
  43555. this._setEndings(!0, 0 === this.repetitions, a)) : this._setEndings(0 === this.repetitions, !0, a)),
  43556. t >= i || t < 0) {
  43557. var s = Math.floor(t / i);
  43558. t -= i * s,
  43559. o += Math.abs(s);
  43560. var l = this.repetitions - o;
  43561. if (l < 0) {
  43562. this.clampWhenFinished ? this.paused = !0 : this.enabled = !1,
  43563. t = e > 0 ? i : 0,
  43564. this._mixer.dispatchEvent({
  43565. type: "finished",
  43566. action: this,
  43567. direction: e > 0 ? 1 : -1
  43568. });
  43569. break
  43570. }
  43571. if (0 === l) {
  43572. var c = e < 0;
  43573. this._setEndings(c, !c, a)
  43574. } else
  43575. this._setEndings(!1, !1, a);
  43576. this._loopCount = o,
  43577. this._mixer.dispatchEvent({
  43578. type: "loop",
  43579. action: this,
  43580. loopDelta: s
  43581. })
  43582. }
  43583. if (r === n.LoopPingPong && 1 === (1 & o))
  43584. return this.time = t,
  43585. i - t
  43586. }
  43587. return this.time = t,
  43588. t
  43589. },
  43590. _setEndings: function(e, t, i) {
  43591. var r = this._interpolantSettings;
  43592. i ? (r.endingStart = n.ZeroSlopeEnding,
  43593. r.endingEnd = n.ZeroSlopeEnding) : (e ? r.endingStart = this.zeroSlopeAtStart ? n.ZeroSlopeEnding : n.ZeroCurvatureEnding : r.endingStart = n.WrapAroundEnding,
  43594. t ? r.endingEnd = this.zeroSlopeAtEnd ? n.ZeroSlopeEnding : n.ZeroCurvatureEnding : r.endingEnd = n.WrapAroundEnding)
  43595. },
  43596. _scheduleFading: function(e, t, i) {
  43597. var n = this._mixer
  43598. , r = n.time
  43599. , o = this._weightInterpolant;
  43600. null === o && (o = n._lendControlInterpolant(),
  43601. this._weightInterpolant = o);
  43602. var a = o.parameterPositions
  43603. , s = o.sampleValues;
  43604. return a[0] = r,
  43605. s[0] = t,
  43606. a[1] = r + e,
  43607. s[1] = i,
  43608. this
  43609. }
  43610. },
  43611. Object.assign(n.AnimationMixer.prototype, {
  43612. _bindAction: function(e, t) {
  43613. var i = e._localRoot || this._root
  43614. , r = e._clip.tracks
  43615. , o = r.length
  43616. , a = e._propertyBindings
  43617. , s = e._interpolants
  43618. , l = i.uuid
  43619. , c = this._bindingsByRootAndName
  43620. , h = c[l];
  43621. void 0 === h && (h = {},
  43622. c[l] = h);
  43623. for (var u = 0; u !== o; ++u) {
  43624. var d = r[u]
  43625. , p = d.name
  43626. , f = h[p];
  43627. if (void 0 !== f)
  43628. a[u] = f;
  43629. else {
  43630. if (f = a[u],
  43631. void 0 !== f) {
  43632. null === f._cacheIndex && (++f.referenceCount,
  43633. this._addInactiveBinding(f, l, p));
  43634. continue
  43635. }
  43636. var g = t && t._propertyBindings[u].binding.parsedPath;
  43637. f = new n.PropertyMixer(n.PropertyBinding.create(i, p, g),d.ValueTypeName,d.getValueSize()),
  43638. ++f.referenceCount,
  43639. this._addInactiveBinding(f, l, p),
  43640. a[u] = f
  43641. }
  43642. s[u].resultBuffer = f.buffer
  43643. }
  43644. },
  43645. _activateAction: function(e) {
  43646. if (!this._isActiveAction(e)) {
  43647. if (null === e._cacheIndex) {
  43648. var t = (e._localRoot || this._root).uuid
  43649. , i = e._clip.name
  43650. , n = this._actionsByClip[i];
  43651. this._bindAction(e, n && n.knownActions[0]),
  43652. this._addInactiveAction(e, i, t)
  43653. }
  43654. for (var r = e._propertyBindings, o = 0, a = r.length; o !== a; ++o) {
  43655. var s = r[o];
  43656. 0 === s.useCount++ && (this._lendBinding(s),
  43657. s.saveOriginalState())
  43658. }
  43659. this._lendAction(e)
  43660. }
  43661. },
  43662. _deactivateAction: function(e) {
  43663. if (this._isActiveAction(e)) {
  43664. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  43665. var r = t[i];
  43666. 0 === --r.useCount && (r.restoreOriginalState(),
  43667. this._takeBackBinding(r))
  43668. }
  43669. this._takeBackAction(e)
  43670. }
  43671. },
  43672. _initMemoryManager: function() {
  43673. this._actions = [],
  43674. this._nActiveActions = 0,
  43675. this._actionsByClip = {},
  43676. this._bindings = [],
  43677. this._nActiveBindings = 0,
  43678. this._bindingsByRootAndName = {},
  43679. this._controlInterpolants = [],
  43680. this._nActiveControlInterpolants = 0;
  43681. var e = this;
  43682. this.stats = {
  43683. actions: {
  43684. get total() {
  43685. return e._actions.length
  43686. },
  43687. get inUse() {
  43688. return e._nActiveActions
  43689. }
  43690. },
  43691. bindings: {
  43692. get total() {
  43693. return e._bindings.length
  43694. },
  43695. get inUse() {
  43696. return e._nActiveBindings
  43697. }
  43698. },
  43699. controlInterpolants: {
  43700. get total() {
  43701. return e._controlInterpolants.length
  43702. },
  43703. get inUse() {
  43704. return e._nActiveControlInterpolants
  43705. }
  43706. }
  43707. }
  43708. },
  43709. _isActiveAction: function(e) {
  43710. var t = e._cacheIndex;
  43711. return null !== t && t < this._nActiveActions
  43712. },
  43713. _addInactiveAction: function(e, t, i) {
  43714. var n = this._actions
  43715. , r = this._actionsByClip
  43716. , o = r[t];
  43717. if (void 0 === o)
  43718. o = {
  43719. knownActions: [e],
  43720. actionByRoot: {}
  43721. },
  43722. e._byClipCacheIndex = 0,
  43723. r[t] = o;
  43724. else {
  43725. var a = o.knownActions;
  43726. e._byClipCacheIndex = a.length,
  43727. a.push(e)
  43728. }
  43729. e._cacheIndex = n.length,
  43730. n.push(e),
  43731. o.actionByRoot[i] = e
  43732. },
  43733. _removeInactiveAction: function(e) {
  43734. var t = this._actions
  43735. , i = t[t.length - 1]
  43736. , n = e._cacheIndex;
  43737. i._cacheIndex = n,
  43738. t[n] = i,
  43739. t.pop(),
  43740. e._cacheIndex = null;
  43741. var r = e._clip.name
  43742. , o = this._actionsByClip
  43743. , a = o[r]
  43744. , s = a.knownActions
  43745. , l = s[s.length - 1]
  43746. , c = e._byClipCacheIndex;
  43747. l._byClipCacheIndex = c,
  43748. s[c] = l,
  43749. s.pop(),
  43750. e._byClipCacheIndex = null;
  43751. var h = a.actionByRoot
  43752. , u = (t._localRoot || this._root).uuid;
  43753. delete h[u],
  43754. 0 === s.length && delete o[r],
  43755. this._removeInactiveBindingsForAction(e)
  43756. },
  43757. _removeInactiveBindingsForAction: function(e) {
  43758. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  43759. var r = t[i];
  43760. 0 === --r.referenceCount && this._removeInactiveBinding(r)
  43761. }
  43762. },
  43763. _lendAction: function(e) {
  43764. var t = this._actions
  43765. , i = e._cacheIndex
  43766. , n = this._nActiveActions++
  43767. , r = t[n];
  43768. e._cacheIndex = n,
  43769. t[n] = e,
  43770. r._cacheIndex = i,
  43771. t[i] = r
  43772. },
  43773. _takeBackAction: function(e) {
  43774. var t = this._actions
  43775. , i = e._cacheIndex
  43776. , n = --this._nActiveActions
  43777. , r = t[n];
  43778. e._cacheIndex = n,
  43779. t[n] = e,
  43780. r._cacheIndex = i,
  43781. t[i] = r
  43782. },
  43783. _addInactiveBinding: function(e, t, i) {
  43784. var n = this._bindingsByRootAndName
  43785. , r = n[t]
  43786. , o = this._bindings;
  43787. void 0 === r && (r = {},
  43788. n[t] = r),
  43789. r[i] = e,
  43790. e._cacheIndex = o.length,
  43791. o.push(e)
  43792. },
  43793. _removeInactiveBinding: function(e) {
  43794. var t = this._bindings
  43795. , i = e.binding
  43796. , n = i.rootNode.uuid
  43797. , r = i.path
  43798. , o = this._bindingsByRootAndName
  43799. , a = o[n]
  43800. , s = t[t.length - 1]
  43801. , l = e._cacheIndex;
  43802. s._cacheIndex = l,
  43803. t[l] = s,
  43804. t.pop(),
  43805. delete a[r];
  43806. e: {
  43807. for (var c in a)
  43808. break e;
  43809. delete o[n]
  43810. }
  43811. },
  43812. _lendBinding: function(e) {
  43813. var t = this._bindings
  43814. , i = e._cacheIndex
  43815. , n = this._nActiveBindings++
  43816. , r = t[n];
  43817. e._cacheIndex = n,
  43818. t[n] = e,
  43819. r._cacheIndex = i,
  43820. t[i] = r
  43821. },
  43822. _takeBackBinding: function(e) {
  43823. var t = this._bindings
  43824. , i = e._cacheIndex
  43825. , n = --this._nActiveBindings
  43826. , r = t[n];
  43827. e._cacheIndex = n,
  43828. t[n] = e,
  43829. r._cacheIndex = i,
  43830. t[i] = r
  43831. },
  43832. _lendControlInterpolant: function() {
  43833. var e = this._controlInterpolants
  43834. , t = this._nActiveControlInterpolants++
  43835. , i = e[t];
  43836. return void 0 === i && (i = new n.LinearInterpolant(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),
  43837. i.__cacheIndex = t,
  43838. e[t] = i),
  43839. i
  43840. },
  43841. _takeBackControlInterpolant: function(e) {
  43842. var t = this._controlInterpolants
  43843. , i = e.__cacheIndex
  43844. , n = --this._nActiveControlInterpolants
  43845. , r = t[n];
  43846. e.__cacheIndex = n,
  43847. t[n] = e,
  43848. r.__cacheIndex = i,
  43849. t[i] = r
  43850. },
  43851. _controlInterpolantsResultBuffer: new Float32Array(1)
  43852. }),
  43853. n.AnimationObjectGroup = function(e) {
  43854. this.uuid = n.Math.generateUUID(),
  43855. this._objects = Array.prototype.slice.call(arguments),
  43856. this.nCachedObjects_ = 0;
  43857. var t = {};
  43858. this._indicesByUUID = t;
  43859. for (var i = 0, r = arguments.length; i !== r; ++i)
  43860. t[arguments[i].uuid] = i;
  43861. this._paths = [],
  43862. this._parsedPaths = [],
  43863. this._bindings = [],
  43864. this._bindingsIndicesByPath = {};
  43865. var o = this;
  43866. this.stats = {
  43867. objects: {
  43868. get total() {
  43869. return o._objects.length
  43870. },
  43871. get inUse() {
  43872. return this.total - o.nCachedObjects_
  43873. }
  43874. },
  43875. get bindingsPerObject() {
  43876. return o._bindings.length
  43877. }
  43878. }
  43879. }
  43880. ,
  43881. n.AnimationObjectGroup.prototype = {
  43882. constructor: n.AnimationObjectGroup,
  43883. add: function(e) {
  43884. for (var t = this._objects, i = t.length, r = this.nCachedObjects_, o = this._indicesByUUID, a = this._paths, s = this._parsedPaths, l = this._bindings, c = l.length, h = 0, u = arguments.length; h !== u; ++h) {
  43885. var d = arguments[h]
  43886. , p = d.uuid
  43887. , f = o[p];
  43888. if (void 0 === f) {
  43889. f = i++,
  43890. o[p] = f,
  43891. t.push(d);
  43892. for (var g = 0, m = c; g !== m; ++g)
  43893. l[g].push(new n.PropertyBinding(d,a[g],s[g]))
  43894. } else if (f < r) {
  43895. var v = t[f]
  43896. , A = --r
  43897. , y = t[A];
  43898. o[y.uuid] = f,
  43899. t[f] = y,
  43900. o[p] = A,
  43901. t[A] = d;
  43902. for (var g = 0, m = c; g !== m; ++g) {
  43903. var C = l[g]
  43904. , I = C[A]
  43905. , E = C[f];
  43906. C[f] = I,
  43907. void 0 === E && (E = new n.PropertyBinding(d,a[g],s[g])),
  43908. C[A] = E
  43909. }
  43910. } else
  43911. t[f] !== v && console.error("Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes...")
  43912. }
  43913. this.nCachedObjects_ = r
  43914. },
  43915. remove: function(e) {
  43916. for (var t = this._objects, i = (t.length,
  43917. this.nCachedObjects_), n = this._indicesByUUID, r = this._bindings, o = r.length, a = 0, s = arguments.length; a !== s; ++a) {
  43918. var l = arguments[a]
  43919. , c = l.uuid
  43920. , h = n[c];
  43921. if (void 0 !== h && h >= i) {
  43922. var u = i++
  43923. , d = t[u];
  43924. n[d.uuid] = h,
  43925. t[h] = d,
  43926. n[c] = u,
  43927. t[u] = l;
  43928. for (var p = 0, f = o; p !== f; ++p) {
  43929. var g = r[p]
  43930. , m = g[u]
  43931. , v = g[h];
  43932. g[h] = m,
  43933. g[u] = v
  43934. }
  43935. }
  43936. }
  43937. this.nCachedObjects_ = i
  43938. },
  43939. uncache: function(e) {
  43940. 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) {
  43941. var c = arguments[s]
  43942. , h = c.uuid
  43943. , u = r[h];
  43944. if (void 0 !== u)
  43945. if (delete r[h],
  43946. u < n) {
  43947. var d = --n
  43948. , p = t[d]
  43949. , f = --i
  43950. , g = t[f];
  43951. r[p.uuid] = u,
  43952. t[u] = p,
  43953. r[g.uuid] = d,
  43954. t[d] = g,
  43955. t.pop();
  43956. for (var m = 0, v = a; m !== v; ++m) {
  43957. var A = o[m]
  43958. , y = A[d]
  43959. , C = A[f];
  43960. A[u] = y,
  43961. A[d] = C,
  43962. A.pop()
  43963. }
  43964. } else {
  43965. var f = --i
  43966. , g = t[f];
  43967. r[g.uuid] = u,
  43968. t[u] = g,
  43969. t.pop();
  43970. for (var m = 0, v = a; m !== v; ++m) {
  43971. var A = o[m];
  43972. A[u] = A[f],
  43973. A.pop()
  43974. }
  43975. }
  43976. }
  43977. this.nCachedObjects_ = n
  43978. },
  43979. subscribe_: function(e, t) {
  43980. var i = this._bindingsIndicesByPath
  43981. , r = i[e]
  43982. , o = this._bindings;
  43983. if (void 0 !== r)
  43984. return o[r];
  43985. var a = this._paths
  43986. , s = this._parsedPaths
  43987. , l = this._objects
  43988. , c = l.length
  43989. , h = this.nCachedObjects_
  43990. , u = new Array(c);
  43991. r = o.length,
  43992. i[e] = r,
  43993. a.push(e),
  43994. s.push(t),
  43995. o.push(u);
  43996. for (var d = h, p = l.length; d !== p; ++d) {
  43997. var f = l[d];
  43998. u[d] = new n.PropertyBinding(f,e,t)
  43999. }
  44000. return u
  44001. },
  44002. unsubscribe_: function(e) {
  44003. var t = this._bindingsIndicesByPath
  44004. , i = t[e];
  44005. if (void 0 !== i) {
  44006. var n = this._paths
  44007. , r = this._parsedPaths
  44008. , o = this._bindings
  44009. , a = o.length - 1
  44010. , s = o[a]
  44011. , l = e[a];
  44012. t[l] = i,
  44013. o[i] = s,
  44014. o.pop(),
  44015. r[i] = r[a],
  44016. r.pop(),
  44017. n[i] = n[a],
  44018. n.pop()
  44019. }
  44020. }
  44021. },
  44022. n.AnimationUtils = {
  44023. arraySlice: function(e, t, i) {
  44024. return n.AnimationUtils.isTypedArray(e) ? new e.constructor(e.subarray(t, i)) : e.slice(t, i)
  44025. },
  44026. convertArray: function(e, t, i) {
  44027. return !e || !i && e.constructor === t ? e : "number" == typeof t.BYTES_PER_ELEMENT ? new t(e) : Array.prototype.slice.call(e)
  44028. },
  44029. isTypedArray: function(e) {
  44030. return ArrayBuffer.isView(e) && !(e instanceof DataView)
  44031. },
  44032. getKeyframeOrder: function(e) {
  44033. function t(t, i) {
  44034. return e[t] - e[i]
  44035. }
  44036. for (var i = e.length, n = new Array(i), r = 0; r !== i; ++r)
  44037. n[r] = r;
  44038. return n.sort(t),
  44039. n
  44040. },
  44041. sortedArray: function(e, t, i) {
  44042. for (var n = e.length, r = new e.constructor(n), o = 0, a = 0; a !== n; ++o)
  44043. for (var s = i[o] * t, l = 0; l !== t; ++l)
  44044. r[a++] = e[s + l];
  44045. return r
  44046. },
  44047. flattenJSON: function(e, t, i, n) {
  44048. for (var r = 1, o = e[0]; void 0 !== o && void 0 === o[n]; )
  44049. o = e[r++];
  44050. if (void 0 !== o) {
  44051. var a = o[n];
  44052. if (void 0 !== a)
  44053. if (Array.isArray(a)) {
  44054. do
  44055. a = o[n],
  44056. void 0 !== a && (t.push(o.time),
  44057. i.push.apply(i, a)),
  44058. o = e[r++];
  44059. while (void 0 !== o)
  44060. } else if (void 0 !== a.toArray) {
  44061. do
  44062. a = o[n],
  44063. void 0 !== a && (t.push(o.time),
  44064. a.toArray(i, i.length)),
  44065. o = e[r++];
  44066. while (void 0 !== o)
  44067. } else
  44068. do
  44069. a = o[n],
  44070. void 0 !== a && (t.push(o.time),
  44071. i.push(a)),
  44072. o = e[r++];
  44073. while (void 0 !== o)
  44074. }
  44075. }
  44076. },
  44077. n.KeyframeTrack = function(e, t, i, r) {
  44078. if (void 0 === e)
  44079. throw new Error("track name is undefined");
  44080. if (void 0 === t || 0 === t.length)
  44081. throw new Error("no keyframes in track named " + e);
  44082. this.name = e,
  44083. this.times = n.AnimationUtils.convertArray(t, this.TimeBufferType),
  44084. this.values = n.AnimationUtils.convertArray(i, this.ValueBufferType),
  44085. this.setInterpolation(r || this.DefaultInterpolation),
  44086. this.validate(),
  44087. this.optimize()
  44088. }
  44089. ,
  44090. n.KeyframeTrack.prototype = {
  44091. constructor: n.KeyframeTrack,
  44092. TimeBufferType: Float32Array,
  44093. ValueBufferType: Float32Array,
  44094. DefaultInterpolation: n.InterpolateLinear,
  44095. InterpolantFactoryMethodDiscrete: function(e) {
  44096. return new n.DiscreteInterpolant(this.times,this.values,this.getValueSize(),e)
  44097. },
  44098. InterpolantFactoryMethodLinear: function(e) {
  44099. return new n.LinearInterpolant(this.times,this.values,this.getValueSize(),e)
  44100. },
  44101. InterpolantFactoryMethodSmooth: function(e) {
  44102. return new n.CubicInterpolant(this.times,this.values,this.getValueSize(),e)
  44103. },
  44104. setInterpolation: function(e) {
  44105. var t = void 0;
  44106. switch (e) {
  44107. case n.InterpolateDiscrete:
  44108. t = this.InterpolantFactoryMethodDiscrete;
  44109. break;
  44110. case n.InterpolateLinear:
  44111. t = this.InterpolantFactoryMethodLinear;
  44112. break;
  44113. case n.InterpolateSmooth:
  44114. t = this.InterpolantFactoryMethodSmooth
  44115. }
  44116. if (void 0 === t) {
  44117. var i = "unsupported interpolation for " + this.ValueTypeName + " keyframe track named " + this.name;
  44118. if (void 0 === this.createInterpolant) {
  44119. if (e === this.DefaultInterpolation)
  44120. throw new Error(i);
  44121. this.setInterpolation(this.DefaultInterpolation)
  44122. }
  44123. return void console.warn(i)
  44124. }
  44125. this.createInterpolant = t
  44126. },
  44127. getInterpolation: function() {
  44128. switch (this.createInterpolant) {
  44129. case this.InterpolantFactoryMethodDiscrete:
  44130. return n.InterpolateDiscrete;
  44131. case this.InterpolantFactoryMethodLinear:
  44132. return n.InterpolateLinear;
  44133. case this.InterpolantFactoryMethodSmooth:
  44134. return n.InterpolateSmooth
  44135. }
  44136. },
  44137. getValueSize: function() {
  44138. return this.values.length / this.times.length
  44139. },
  44140. shift: function(e) {
  44141. if (0 !== e)
  44142. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  44143. t[i] += e;
  44144. return this
  44145. },
  44146. scale: function(e) {
  44147. if (1 !== e)
  44148. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  44149. t[i] *= e;
  44150. return this
  44151. },
  44152. trim: function(e, t) {
  44153. for (var i = this.times, r = i.length, o = 0, a = r - 1; o !== r && i[o] < e; )
  44154. ++o;
  44155. for (; a !== -1 && i[a] > t; )
  44156. --a;
  44157. if (++a,
  44158. 0 !== o || a !== r) {
  44159. o >= a && (a = Math.max(a, 1),
  44160. o = a - 1);
  44161. var s = this.getValueSize();
  44162. this.times = n.AnimationUtils.arraySlice(i, o, a),
  44163. this.values = n.AnimationUtils.arraySlice(this.values, o * s, a * s)
  44164. }
  44165. return this
  44166. },
  44167. validate: function() {
  44168. var e = !0
  44169. , t = this.getValueSize();
  44170. t - Math.floor(t) !== 0 && (console.error("invalid value size in track", this),
  44171. e = !1);
  44172. var i = this.times
  44173. , r = this.values
  44174. , o = i.length;
  44175. 0 === o && (console.error("track is empty", this),
  44176. e = !1);
  44177. for (var a = null, s = 0; s !== o; s++) {
  44178. var l = i[s];
  44179. if ("number" == typeof l && isNaN(l)) {
  44180. console.error("time is not a valid number", this, s, l),
  44181. e = !1;
  44182. break
  44183. }
  44184. if (null !== a && a > l) {
  44185. console.error("out of order keys", this, s, l, a),
  44186. e = !1;
  44187. break
  44188. }
  44189. a = l
  44190. }
  44191. if (void 0 !== r && n.AnimationUtils.isTypedArray(r))
  44192. for (var s = 0, c = r.length; s !== c; ++s) {
  44193. var h = r[s];
  44194. if (isNaN(h)) {
  44195. console.error("value is not a valid number", this, s, h),
  44196. e = !1;
  44197. break
  44198. }
  44199. }
  44200. return e
  44201. },
  44202. optimize: function() {
  44203. for (var e = this.times, t = this.values, i = this.getValueSize(), r = 1, o = 1, a = e.length - 1; o <= a; ++o) {
  44204. var s = !1
  44205. , l = e[o]
  44206. , c = e[o + 1];
  44207. if (l !== c && (1 !== o || l !== l[0]))
  44208. for (var h = o * i, u = h - i, d = h + i, p = 0; p !== i; ++p) {
  44209. var f = t[h + p];
  44210. if (f !== t[u + p] || f !== t[d + p]) {
  44211. s = !0;
  44212. break
  44213. }
  44214. }
  44215. if (s) {
  44216. if (o !== r) {
  44217. e[r] = e[o];
  44218. for (var g = o * i, m = r * i, p = 0; p !== i; ++p)
  44219. t[m + p] = t[g + p]
  44220. }
  44221. ++r
  44222. }
  44223. }
  44224. return r !== e.length && (this.times = n.AnimationUtils.arraySlice(e, 0, r),
  44225. this.values = n.AnimationUtils.arraySlice(t, 0, r * i)),
  44226. this
  44227. }
  44228. },
  44229. Object.assign(n.KeyframeTrack, {
  44230. parse: function(e) {
  44231. if (void 0 === e.type)
  44232. throw new Error("track type undefined, can not parse");
  44233. var t = n.KeyframeTrack._getTrackTypeForValueTypeName(e.type);
  44234. if (void 0 === e.times) {
  44235. console.warn("legacy JSON format detected, converting");
  44236. var i = []
  44237. , r = [];
  44238. n.AnimationUtils.flattenJSON(e.keys, i, r, "value"),
  44239. e.times = i,
  44240. e.values = r
  44241. }
  44242. return void 0 !== t.parse ? t.parse(e) : new t(e.name,e.times,e.values,e.interpolation)
  44243. },
  44244. toJSON: function(e) {
  44245. var t, i = e.constructor;
  44246. if (void 0 !== i.toJSON)
  44247. t = i.toJSON(e);
  44248. else {
  44249. t = {
  44250. name: e.name,
  44251. times: n.AnimationUtils.convertArray(e.times, Array),
  44252. values: n.AnimationUtils.convertArray(e.values, Array)
  44253. };
  44254. var r = e.getInterpolation();
  44255. r !== e.DefaultInterpolation && (t.interpolation = r)
  44256. }
  44257. return t.type = e.ValueTypeName,
  44258. t
  44259. },
  44260. _getTrackTypeForValueTypeName: function(e) {
  44261. switch (e.toLowerCase()) {
  44262. case "scalar":
  44263. case "double":
  44264. case "float":
  44265. case "number":
  44266. case "integer":
  44267. return n.NumberKeyframeTrack;
  44268. case "vector":
  44269. case "vector2":
  44270. case "vector3":
  44271. case "vector4":
  44272. return n.VectorKeyframeTrack;
  44273. case "color":
  44274. return n.ColorKeyframeTrack;
  44275. case "quaternion":
  44276. return n.QuaternionKeyframeTrack;
  44277. case "bool":
  44278. case "boolean":
  44279. return n.BooleanKeyframeTrack;
  44280. case "string":
  44281. return n.StringKeyframeTrack
  44282. }
  44283. throw new Error("Unsupported typeName: " + e)
  44284. }
  44285. }),
  44286. n.PropertyBinding = function(e, t, i) {
  44287. this.path = t,
  44288. this.parsedPath = i || n.PropertyBinding.parseTrackName(t),
  44289. this.node = n.PropertyBinding.findNode(e, this.parsedPath.nodeName) || e,
  44290. this.rootNode = e
  44291. }
  44292. ,
  44293. n.PropertyBinding.prototype = {
  44294. constructor: n.PropertyBinding,
  44295. getValue: function(e, t) {
  44296. this.bind(),
  44297. this.getValue(e, t)
  44298. },
  44299. setValue: function(e, t) {
  44300. this.bind(),
  44301. this.setValue(e, t)
  44302. },
  44303. bind: function() {
  44304. var e = this.node
  44305. , t = this.parsedPath
  44306. , i = t.objectName
  44307. , r = t.propertyName
  44308. , o = t.propertyIndex;
  44309. if (e || (e = n.PropertyBinding.findNode(this.rootNode, t.nodeName) || this.rootNode,
  44310. this.node = e),
  44311. this.getValue = this._getValue_unavailable,
  44312. this.setValue = this._setValue_unavailable,
  44313. !e)
  44314. return void console.error(" trying to update node for track: " + this.path + " but it wasn't found.");
  44315. if (i) {
  44316. var a = t.objectIndex;
  44317. switch (i) {
  44318. case "materials":
  44319. if (!e.material)
  44320. return void console.error(" can not bind to material as node does not have a material", this);
  44321. if (!e.material.materials)
  44322. return void console.error(" can not bind to material.materials as node.material does not have a materials array", this);
  44323. e = e.material.materials;
  44324. break;
  44325. case "bones":
  44326. if (!e.skeleton)
  44327. return void console.error(" can not bind to bones as node does not have a skeleton", this);
  44328. e = e.skeleton.bones;
  44329. for (var s = 0; s < e.length; s++)
  44330. if (e[s].name === a) {
  44331. a = s;
  44332. break
  44333. }
  44334. break;
  44335. default:
  44336. if (void 0 === e[i])
  44337. return void console.error(" can not bind to objectName of node, undefined", this);
  44338. e = e[i]
  44339. }
  44340. if (void 0 !== a) {
  44341. if (void 0 === e[a])
  44342. return void console.error(" trying to bind to objectIndex of objectName, but is undefined:", this, e);
  44343. e = e[a]
  44344. }
  44345. }
  44346. var l = e[r];
  44347. if (!l) {
  44348. var c = t.nodeName;
  44349. return void console.error(" trying to update property for track: " + c + "." + r + " but it wasn't found.", e)
  44350. }
  44351. var h = this.Versioning.None;
  44352. void 0 !== e.needsUpdate ? (h = this.Versioning.NeedsUpdate,
  44353. this.targetObject = e) : void 0 !== e.matrixWorldNeedsUpdate && (h = this.Versioning.MatrixWorldNeedsUpdate,
  44354. this.targetObject = e);
  44355. var u = this.BindingType.Direct;
  44356. if (void 0 !== o) {
  44357. if ("morphTargetInfluences" === r) {
  44358. if (!e.geometry)
  44359. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry", this);
  44360. if (!e.geometry.morphTargets)
  44361. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets", this);
  44362. for (var s = 0; s < this.node.geometry.morphTargets.length; s++)
  44363. if (e.geometry.morphTargets[s].name === o) {
  44364. o = s;
  44365. break
  44366. }
  44367. }
  44368. u = this.BindingType.ArrayElement,
  44369. this.resolvedProperty = l,
  44370. this.propertyIndex = o
  44371. } else
  44372. void 0 !== l.fromArray && void 0 !== l.toArray ? (u = this.BindingType.HasFromToArray,
  44373. this.resolvedProperty = l) : void 0 !== l.length ? (u = this.BindingType.EntireArray,
  44374. this.resolvedProperty = l) : this.propertyName = r;
  44375. this.getValue = this.GetterByBindingType[u],
  44376. this.setValue = this.SetterByBindingTypeAndVersioning[u][h]
  44377. },
  44378. unbind: function() {
  44379. this.node = null,
  44380. this.getValue = this._getValue_unbound,
  44381. this.setValue = this._setValue_unbound
  44382. }
  44383. },
  44384. Object.assign(n.PropertyBinding.prototype, {
  44385. _getValue_unavailable: function() {},
  44386. _setValue_unavailable: function() {},
  44387. _getValue_unbound: n.PropertyBinding.prototype.getValue,
  44388. _setValue_unbound: n.PropertyBinding.prototype.setValue,
  44389. BindingType: {
  44390. Direct: 0,
  44391. EntireArray: 1,
  44392. ArrayElement: 2,
  44393. HasFromToArray: 3
  44394. },
  44395. Versioning: {
  44396. None: 0,
  44397. NeedsUpdate: 1,
  44398. MatrixWorldNeedsUpdate: 2
  44399. },
  44400. GetterByBindingType: [function(e, t) {
  44401. e[t] = this.node[this.propertyName]
  44402. }
  44403. , function(e, t) {
  44404. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44405. e[t++] = i[n]
  44406. }
  44407. , function(e, t) {
  44408. e[t] = this.resolvedProperty[this.propertyIndex]
  44409. }
  44410. , function(e, t) {
  44411. this.resolvedProperty.toArray(e, t)
  44412. }
  44413. ],
  44414. SetterByBindingTypeAndVersioning: [[function(e, t) {
  44415. this.node[this.propertyName] = e[t]
  44416. }
  44417. , function(e, t) {
  44418. this.node[this.propertyName] = e[t],
  44419. this.targetObject.needsUpdate = !0
  44420. }
  44421. , function(e, t) {
  44422. this.node[this.propertyName] = e[t],
  44423. this.targetObject.matrixWorldNeedsUpdate = !0
  44424. }
  44425. ], [function(e, t) {
  44426. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44427. i[n] = e[t++]
  44428. }
  44429. , function(e, t) {
  44430. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44431. i[n] = e[t++];
  44432. this.targetObject.needsUpdate = !0
  44433. }
  44434. , function(e, t) {
  44435. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44436. i[n] = e[t++];
  44437. this.targetObject.matrixWorldNeedsUpdate = !0
  44438. }
  44439. ], [function(e, t) {
  44440. this.resolvedProperty[this.propertyIndex] = e[t]
  44441. }
  44442. , function(e, t) {
  44443. this.resolvedProperty[this.propertyIndex] = e[t],
  44444. this.targetObject.needsUpdate = !0
  44445. }
  44446. , function(e, t) {
  44447. this.resolvedProperty[this.propertyIndex] = e[t],
  44448. this.targetObject.matrixWorldNeedsUpdate = !0
  44449. }
  44450. ], [function(e, t) {
  44451. this.resolvedProperty.fromArray(e, t)
  44452. }
  44453. , function(e, t) {
  44454. this.resolvedProperty.fromArray(e, t),
  44455. this.targetObject.needsUpdate = !0
  44456. }
  44457. , function(e, t) {
  44458. this.resolvedProperty.fromArray(e, t),
  44459. this.targetObject.matrixWorldNeedsUpdate = !0
  44460. }
  44461. ]]
  44462. }),
  44463. n.PropertyBinding.Composite = function(e, t, i) {
  44464. var r = i || n.PropertyBinding.parseTrackName(t);
  44465. this._targetGroup = e,
  44466. this._bindings = e.subscribe_(t, r)
  44467. }
  44468. ,
  44469. n.PropertyBinding.Composite.prototype = {
  44470. constructor: n.PropertyBinding.Composite,
  44471. getValue: function(e, t) {
  44472. this.bind();
  44473. var i = this._targetGroup.nCachedObjects_
  44474. , n = this._bindings[i];
  44475. void 0 !== n && n.getValue(e, t)
  44476. },
  44477. setValue: function(e, t) {
  44478. for (var i = this._bindings, n = this._targetGroup.nCachedObjects_, r = i.length; n !== r; ++n)
  44479. i[n].setValue(e, t)
  44480. },
  44481. bind: function() {
  44482. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  44483. e[t].bind()
  44484. },
  44485. unbind: function() {
  44486. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  44487. e[t].unbind()
  44488. }
  44489. },
  44490. n.PropertyBinding.create = function(e, t, i) {
  44491. return e instanceof n.AnimationObjectGroup ? new n.PropertyBinding.Composite(e,t,i) : new n.PropertyBinding(e,t,i)
  44492. }
  44493. ,
  44494. n.PropertyBinding.parseTrackName = function(e) {
  44495. var t = /^(([\w]+\/)*)([\w-\d]+)?(\.([\w]+)(\[([\w\d\[\]\_.:\- ]+)\])?)?(\.([\w.]+)(\[([\w\d\[\]\_. ]+)\])?)$/
  44496. , i = t.exec(e);
  44497. if (!i)
  44498. throw new Error("cannot parse trackName at all: " + e);
  44499. i.index === t.lastIndex && t.lastIndex++;
  44500. var n = {
  44501. nodeName: i[3],
  44502. objectName: i[5],
  44503. objectIndex: i[7],
  44504. propertyName: i[9],
  44505. propertyIndex: i[11]
  44506. };
  44507. if (null === n.propertyName || 0 === n.propertyName.length)
  44508. throw new Error("can not parse propertyName from trackName: " + e);
  44509. return n
  44510. }
  44511. ,
  44512. n.PropertyBinding.findNode = function(e, t) {
  44513. if (!t || "" === t || "root" === t || "." === t || t === -1 || t === e.name || t === e.uuid)
  44514. return e;
  44515. if (e.skeleton) {
  44516. var i = function(e) {
  44517. for (var i = 0; i < e.bones.length; i++) {
  44518. var n = e.bones[i];
  44519. if (n.name === t)
  44520. return n
  44521. }
  44522. return null
  44523. }
  44524. , n = i(e.skeleton);
  44525. if (n)
  44526. return n
  44527. }
  44528. if (e.children) {
  44529. var r = function(e) {
  44530. for (var i = 0; i < e.length; i++) {
  44531. var n = e[i];
  44532. if (n.name === t || n.uuid === t)
  44533. return n;
  44534. var o = r(n.children);
  44535. if (o)
  44536. return o
  44537. }
  44538. return null
  44539. }
  44540. , o = r(e.children);
  44541. if (o)
  44542. return o
  44543. }
  44544. return null
  44545. }
  44546. ,
  44547. n.PropertyMixer = function(e, t, i) {
  44548. this.binding = e,
  44549. this.valueSize = i;
  44550. var n, r = Float64Array;
  44551. switch (t) {
  44552. case "quaternion":
  44553. n = this._slerp;
  44554. break;
  44555. case "string":
  44556. case "bool":
  44557. r = Array,
  44558. n = this._select;
  44559. break;
  44560. default:
  44561. n = this._lerp
  44562. }
  44563. this.buffer = new r(4 * i),
  44564. this._mixBufferRegion = n,
  44565. this.cumulativeWeight = 0,
  44566. this.useCount = 0,
  44567. this.referenceCount = 0
  44568. }
  44569. ,
  44570. n.PropertyMixer.prototype = {
  44571. constructor: n.PropertyMixer,
  44572. accumulate: function(e, t) {
  44573. var i = this.buffer
  44574. , n = this.valueSize
  44575. , r = e * n + n
  44576. , o = this.cumulativeWeight;
  44577. if (0 === o) {
  44578. for (var a = 0; a !== n; ++a)
  44579. i[r + a] = i[a];
  44580. o = t
  44581. } else {
  44582. o += t;
  44583. var s = t / o;
  44584. this._mixBufferRegion(i, r, 0, s, n)
  44585. }
  44586. this.cumulativeWeight = o
  44587. },
  44588. apply: function(e) {
  44589. var t = this.valueSize
  44590. , i = this.buffer
  44591. , n = e * t + t
  44592. , r = this.cumulativeWeight
  44593. , o = this.binding;
  44594. if (this.cumulativeWeight = 0,
  44595. r < 1) {
  44596. var a = 3 * t;
  44597. this._mixBufferRegion(i, n, a, 1 - r, t)
  44598. }
  44599. for (var s = t, l = t + t; s !== l; ++s)
  44600. if (i[s] !== i[s + t]) {
  44601. o.setValue(i, n);
  44602. break
  44603. }
  44604. },
  44605. saveOriginalState: function() {
  44606. var e = this.binding
  44607. , t = this.buffer
  44608. , i = this.valueSize
  44609. , n = 3 * i;
  44610. e.getValue(t, n);
  44611. for (var r = i, o = n; r !== o; ++r)
  44612. t[r] = t[n + r % i];
  44613. this.cumulativeWeight = 0
  44614. },
  44615. restoreOriginalState: function() {
  44616. var e = 3 * this.valueSize;
  44617. this.binding.setValue(this.buffer, e)
  44618. },
  44619. _select: function(e, t, i, n, r) {
  44620. if (n >= .5)
  44621. for (var o = 0; o !== r; ++o)
  44622. e[t + o] = e[i + o]
  44623. },
  44624. _slerp: function(e, t, i, r, o) {
  44625. n.Quaternion.slerpFlat(e, t, e, t, e, i, r)
  44626. },
  44627. _lerp: function(e, t, i, n, r) {
  44628. for (var o = 1 - n, a = 0; a !== r; ++a) {
  44629. var s = t + a;
  44630. e[s] = e[s] * o + e[i + a] * n
  44631. }
  44632. }
  44633. },
  44634. n.BooleanKeyframeTrack = function(e, t, i) {
  44635. n.KeyframeTrack.call(this, e, t, i)
  44636. }
  44637. ,
  44638. n.BooleanKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  44639. constructor: n.BooleanKeyframeTrack,
  44640. ValueTypeName: "bool",
  44641. ValueBufferType: Array,
  44642. DefaultInterpolation: n.IntepolateDiscrete,
  44643. InterpolantFactoryMethodLinear: void 0,
  44644. InterpolantFactoryMethodSmooth: void 0
  44645. }),
  44646. n.NumberKeyframeTrack = function(e, t, i, r) {
  44647. n.KeyframeTrack.call(this, e, t, i, r)
  44648. }
  44649. ,
  44650. n.NumberKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  44651. constructor: n.NumberKeyframeTrack,
  44652. ValueTypeName: "number"
  44653. }),
  44654. n.QuaternionKeyframeTrack = function(e, t, i, r) {
  44655. n.KeyframeTrack.call(this, e, t, i, r)
  44656. }
  44657. ,
  44658. n.QuaternionKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  44659. constructor: n.QuaternionKeyframeTrack,
  44660. ValueTypeName: "quaternion",
  44661. DefaultInterpolation: n.InterpolateLinear,
  44662. InterpolantFactoryMethodLinear: function(e) {
  44663. return new n.QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),e)
  44664. },
  44665. InterpolantFactoryMethodSmooth: void 0
  44666. }),
  44667. n.StringKeyframeTrack = function(e, t, i, r) {
  44668. n.KeyframeTrack.call(this, e, t, i, r)
  44669. }
  44670. ,
  44671. n.StringKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  44672. constructor: n.StringKeyframeTrack,
  44673. ValueTypeName: "string",
  44674. ValueBufferType: Array,
  44675. DefaultInterpolation: n.IntepolateDiscrete,
  44676. InterpolantFactoryMethodLinear: void 0,
  44677. InterpolantFactoryMethodSmooth: void 0
  44678. }),
  44679. n.VectorKeyframeTrack = function(e, t, i, r) {
  44680. n.KeyframeTrack.call(this, e, t, i, r)
  44681. }
  44682. ,
  44683. n.VectorKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  44684. constructor: n.VectorKeyframeTrack,
  44685. ValueTypeName: "vector"
  44686. }),
  44687. n.Audio = function(e) {
  44688. n.Object3D.call(this),
  44689. this.type = "Audio",
  44690. this.context = e.context,
  44691. this.source = this.context.createBufferSource(),
  44692. this.source.onended = this.onEnded.bind(this),
  44693. this.gain = this.context.createGain(),
  44694. this.gain.connect(e.getInput()),
  44695. this.autoplay = !1,
  44696. this.startTime = 0,
  44697. this.playbackRate = 1,
  44698. this.isPlaying = !1,
  44699. this.hasPlaybackControl = !0,
  44700. this.sourceType = "empty",
  44701. this.filter = null
  44702. }
  44703. ,
  44704. n.Audio.prototype = Object.create(n.Object3D.prototype),
  44705. n.Audio.prototype.constructor = n.Audio,
  44706. n.Audio.prototype.getOutput = function() {
  44707. return this.gain
  44708. }
  44709. ,
  44710. n.Audio.prototype.load = function(e) {
  44711. var t = new n.AudioBuffer(this.context);
  44712. return t.load(e),
  44713. this.setBuffer(t),
  44714. this
  44715. }
  44716. ,
  44717. n.Audio.prototype.setNodeSource = function(e) {
  44718. return this.hasPlaybackControl = !1,
  44719. this.sourceType = "audioNode",
  44720. this.source = e,
  44721. this.connect(),
  44722. this
  44723. }
  44724. ,
  44725. n.Audio.prototype.setBuffer = function(e) {
  44726. var t = this;
  44727. return e.onReady(function(e) {
  44728. t.source.buffer = e,
  44729. t.sourceType = "buffer",
  44730. t.autoplay && t.play()
  44731. }),
  44732. this
  44733. }
  44734. ,
  44735. n.Audio.prototype.play = function() {
  44736. if (this.isPlaying === !0)
  44737. return void console.warn("THREE.Audio: Audio is already playing.");
  44738. if (this.hasPlaybackControl === !1)
  44739. return void console.warn("THREE.Audio: this Audio has no playback control.");
  44740. var e = this.context.createBufferSource();
  44741. e.buffer = this.source.buffer,
  44742. e.loop = this.source.loop,
  44743. e.onended = this.source.onended,
  44744. e.start(0, this.startTime),
  44745. e.playbackRate.value = this.playbackRate,
  44746. this.isPlaying = !0,
  44747. this.source = e,
  44748. this.connect()
  44749. }
  44750. ,
  44751. n.Audio.prototype.pause = function() {
  44752. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  44753. void (this.startTime = this.context.currentTime))
  44754. }
  44755. ,
  44756. n.Audio.prototype.stop = function() {
  44757. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  44758. void (this.startTime = 0))
  44759. }
  44760. ,
  44761. n.Audio.prototype.connect = function() {
  44762. null !== this.filter ? (this.source.connect(this.filter),
  44763. this.filter.connect(this.getOutput())) : this.source.connect(this.getOutput())
  44764. }
  44765. ,
  44766. n.Audio.prototype.disconnect = function() {
  44767. null !== this.filter ? (this.source.disconnect(this.filter),
  44768. this.filter.disconnect(this.getOutput())) : this.source.disconnect(this.getOutput())
  44769. }
  44770. ,
  44771. n.Audio.prototype.getFilter = function() {
  44772. return this.filter
  44773. }
  44774. ,
  44775. n.Audio.prototype.setFilter = function(e) {
  44776. void 0 === e && (e = null),
  44777. this.isPlaying === !0 ? (this.disconnect(),
  44778. this.filter = e,
  44779. this.connect()) : this.filter = e
  44780. }
  44781. ,
  44782. n.Audio.prototype.setPlaybackRate = function(e) {
  44783. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.playbackRate = e,
  44784. void (this.isPlaying === !0 && (this.source.playbackRate.value = this.playbackRate)))
  44785. }
  44786. ,
  44787. n.Audio.prototype.getPlaybackRate = function() {
  44788. return this.playbackRate
  44789. }
  44790. ,
  44791. n.Audio.prototype.onEnded = function() {
  44792. this.isPlaying = !1
  44793. }
  44794. ,
  44795. n.Audio.prototype.setLoop = function(e) {
  44796. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : void (this.source.loop = e)
  44797. }
  44798. ,
  44799. n.Audio.prototype.getLoop = function() {
  44800. return this.hasPlaybackControl === !1 ? (console.warn("THREE.Audio: this Audio has no playback control."),
  44801. !1) : this.source.loop
  44802. }
  44803. ,
  44804. n.Audio.prototype.setVolume = function(e) {
  44805. this.gain.gain.value = e
  44806. }
  44807. ,
  44808. n.Audio.prototype.getVolume = function() {
  44809. return this.gain.gain.value
  44810. }
  44811. ,
  44812. n.AudioAnalyser = function(e, t) {
  44813. this.analyser = e.context.createAnalyser(),
  44814. this.analyser.fftSize = void 0 !== t ? t : 2048,
  44815. this.data = new Uint8Array(this.analyser.frequencyBinCount),
  44816. e.getOutput().connect(this.analyser)
  44817. }
  44818. ,
  44819. n.AudioAnalyser.prototype = {
  44820. constructor: n.AudioAnalyser,
  44821. getData: function() {
  44822. return this.analyser.getByteFrequencyData(this.data),
  44823. this.data
  44824. }
  44825. },
  44826. n.AudioBuffer = function(e) {
  44827. this.context = e,
  44828. this.ready = !1,
  44829. this.readyCallbacks = []
  44830. }
  44831. ,
  44832. n.AudioBuffer.prototype.load = function(e) {
  44833. var t = this
  44834. , i = new XMLHttpRequest;
  44835. return i.open("GET", e, !0),
  44836. i.responseType = "arraybuffer",
  44837. i.onload = function(e) {
  44838. t.context.decodeAudioData(this.response, function(e) {
  44839. t.buffer = e,
  44840. t.ready = !0;
  44841. for (var i = 0; i < t.readyCallbacks.length; i++)
  44842. t.readyCallbacks[i](t.buffer);
  44843. t.readyCallbacks = []
  44844. })
  44845. }
  44846. ,
  44847. i.send(),
  44848. this
  44849. }
  44850. ,
  44851. n.AudioBuffer.prototype.onReady = function(e) {
  44852. this.ready ? e(this.buffer) : this.readyCallbacks.push(e)
  44853. }
  44854. ,
  44855. n.PositionalAudio = function(e) {
  44856. n.Audio.call(this, e),
  44857. this.panner = this.context.createPanner(),
  44858. this.panner.connect(this.gain)
  44859. }
  44860. ,
  44861. n.PositionalAudio.prototype = Object.create(n.Audio.prototype),
  44862. n.PositionalAudio.prototype.constructor = n.PositionalAudio,
  44863. n.PositionalAudio.prototype.getOutput = function() {
  44864. return this.panner
  44865. }
  44866. ,
  44867. n.PositionalAudio.prototype.setRefDistance = function(e) {
  44868. this.panner.refDistance = e
  44869. }
  44870. ,
  44871. n.PositionalAudio.prototype.getRefDistance = function() {
  44872. return this.panner.refDistance
  44873. }
  44874. ,
  44875. n.PositionalAudio.prototype.setRolloffFactor = function(e) {
  44876. this.panner.rolloffFactor = e
  44877. }
  44878. ,
  44879. n.PositionalAudio.prototype.getRolloffFactor = function() {
  44880. return this.panner.rolloffFactor
  44881. }
  44882. ,
  44883. n.PositionalAudio.prototype.setDistanceModel = function(e) {
  44884. this.panner.distanceModel = e
  44885. }
  44886. ,
  44887. n.PositionalAudio.prototype.getDistanceModel = function() {
  44888. return this.panner.distanceModel
  44889. }
  44890. ,
  44891. n.PositionalAudio.prototype.setMaxDistance = function(e) {
  44892. this.panner.maxDistance = e
  44893. }
  44894. ,
  44895. n.PositionalAudio.prototype.getMaxDistance = function() {
  44896. return this.panner.maxDistance
  44897. }
  44898. ,
  44899. n.PositionalAudio.prototype.updateMatrixWorld = function() {
  44900. var e = new n.Vector3;
  44901. return function(t) {
  44902. n.Object3D.prototype.updateMatrixWorld.call(this, t),
  44903. e.setFromMatrixPosition(this.matrixWorld),
  44904. this.panner.setPosition(e.x, e.y, e.z)
  44905. }
  44906. }(),
  44907. n.AudioListener = function() {
  44908. n.Object3D.call(this),
  44909. this.type = "AudioListener",
  44910. this.context = new (window.AudioContext || window.webkitAudioContext),
  44911. this.gain = this.context.createGain(),
  44912. this.gain.connect(this.context.destination),
  44913. this.filter = null
  44914. }
  44915. ,
  44916. n.AudioListener.prototype = Object.create(n.Object3D.prototype),
  44917. n.AudioListener.prototype.constructor = n.AudioListener,
  44918. n.AudioListener.prototype.getInput = function() {
  44919. return this.gain
  44920. }
  44921. ,
  44922. n.AudioListener.prototype.removeFilter = function() {
  44923. null !== this.filter && (this.gain.disconnect(this.filter),
  44924. this.filter.disconnect(this.context.destination),
  44925. this.gain.connect(this.context.destination),
  44926. this.filter = null)
  44927. }
  44928. ,
  44929. n.AudioListener.prototype.setFilter = function(e) {
  44930. null !== this.filter ? (this.gain.disconnect(this.filter),
  44931. this.filter.disconnect(this.context.destination)) : this.gain.disconnect(this.context.destination),
  44932. this.filter = e,
  44933. this.gain.connect(this.filter),
  44934. this.filter.connect(this.context.destination)
  44935. }
  44936. ,
  44937. n.AudioListener.prototype.getFilter = function() {
  44938. return this.filter
  44939. }
  44940. ,
  44941. n.AudioListener.prototype.setMasterVolume = function(e) {
  44942. this.gain.gain.value = e
  44943. }
  44944. ,
  44945. n.AudioListener.prototype.getMasterVolume = function() {
  44946. return this.gain.gain.value
  44947. }
  44948. ,
  44949. n.AudioListener.prototype.updateMatrixWorld = function() {
  44950. var e = new n.Vector3
  44951. , t = new n.Quaternion
  44952. , i = new n.Vector3
  44953. , r = new n.Vector3;
  44954. return function(o) {
  44955. n.Object3D.prototype.updateMatrixWorld.call(this, o);
  44956. var a = this.context.listener
  44957. , s = this.up;
  44958. this.matrixWorld.decompose(e, t, i),
  44959. r.set(0, 0, -1).applyQuaternion(t),
  44960. a.setPosition(e.x, e.y, e.z),
  44961. a.setOrientation(r.x, r.y, r.z, s.x, s.y, s.z)
  44962. }
  44963. }(),
  44964. n.Camera = function() {
  44965. n.Object3D.call(this),
  44966. this.type = "Camera",
  44967. this.matrixWorldInverse = new n.Matrix4,
  44968. this.projectionMatrix = new n.Matrix4
  44969. }
  44970. ,
  44971. n.Camera.prototype = Object.create(n.Object3D.prototype),
  44972. n.Camera.prototype.constructor = n.Camera,
  44973. n.Camera.prototype.getWorldDirection = function() {
  44974. var e = new n.Quaternion;
  44975. return function(t) {
  44976. var i = t || new n.Vector3;
  44977. return this.getWorldQuaternion(e),
  44978. i.set(0, 0, -1).applyQuaternion(e)
  44979. }
  44980. }(),
  44981. n.Camera.prototype.lookAt = function() {
  44982. var e = new n.Matrix4;
  44983. return function(t) {
  44984. e.lookAt(this.position, t, this.up),
  44985. this.quaternion.setFromRotationMatrix(e)
  44986. }
  44987. }(),
  44988. n.Camera.prototype.clone = function() {
  44989. return (new this.constructor).copy(this)
  44990. }
  44991. ,
  44992. n.Camera.prototype.copy = function(e) {
  44993. return n.Object3D.prototype.copy.call(this, e),
  44994. this.matrixWorldInverse.copy(e.matrixWorldInverse),
  44995. this.projectionMatrix.copy(e.projectionMatrix),
  44996. this
  44997. }
  44998. ,
  44999. n.CubeCamera = function(e, t, i) {
  45000. n.Object3D.call(this),
  45001. this.type = "CubeCamera";
  45002. var r = 90
  45003. , o = 1
  45004. , a = new n.PerspectiveCamera(r,o,e,t);
  45005. a.up.set(0, -1, 0),
  45006. a.lookAt(new n.Vector3(1,0,0)),
  45007. this.add(a);
  45008. var s = new n.PerspectiveCamera(r,o,e,t);
  45009. s.up.set(0, -1, 0),
  45010. s.lookAt(new n.Vector3(-1,0,0)),
  45011. this.add(s);
  45012. var l = new n.PerspectiveCamera(r,o,e,t);
  45013. l.up.set(0, 0, 1),
  45014. l.lookAt(new n.Vector3(0,1,0)),
  45015. this.add(l);
  45016. var c = new n.PerspectiveCamera(r,o,e,t);
  45017. c.up.set(0, 0, -1),
  45018. c.lookAt(new n.Vector3(0,-1,0)),
  45019. this.add(c);
  45020. var h = new n.PerspectiveCamera(r,o,e,t);
  45021. h.up.set(0, -1, 0),
  45022. h.lookAt(new n.Vector3(0,0,1)),
  45023. this.add(h);
  45024. var u = new n.PerspectiveCamera(r,o,e,t);
  45025. u.up.set(0, -1, 0),
  45026. u.lookAt(new n.Vector3(0,0,-1)),
  45027. this.add(u);
  45028. var d = {
  45029. format: n.RGBFormat,
  45030. magFilter: n.LinearFilter,
  45031. minFilter: n.LinearFilter
  45032. };
  45033. this.renderTarget = new n.WebGLRenderTargetCube(i,i,d),
  45034. this.updateCubeMap = function(e, t) {
  45035. null === this.parent && this.updateMatrixWorld();
  45036. var i = this.renderTarget
  45037. , n = i.texture.generateMipmaps;
  45038. i.texture.generateMipmaps = !1,
  45039. i.activeCubeFace = 0,
  45040. e.render(t, a, i),
  45041. i.activeCubeFace = 1,
  45042. e.render(t, s, i),
  45043. i.activeCubeFace = 2,
  45044. e.render(t, l, i),
  45045. i.activeCubeFace = 3,
  45046. e.render(t, c, i),
  45047. i.activeCubeFace = 4,
  45048. e.render(t, h, i),
  45049. i.texture.generateMipmaps = n,
  45050. i.activeCubeFace = 5,
  45051. e.render(t, u, i),
  45052. e.setRenderTarget(null)
  45053. }
  45054. }
  45055. ,
  45056. n.CubeCamera.prototype = Object.create(n.Object3D.prototype),
  45057. n.CubeCamera.prototype.constructor = n.CubeCamera,
  45058. n.OrthographicCamera = function(e, t, i, r, o, a) {
  45059. n.Camera.call(this),
  45060. this.type = "OrthographicCamera",
  45061. this.zoom = 1,
  45062. this.left = e,
  45063. this.right = t,
  45064. this.top = i,
  45065. this.bottom = r,
  45066. this.near = void 0 !== o ? o : .1,
  45067. this.far = void 0 !== a ? a : 2e3,
  45068. this.updateProjectionMatrix()
  45069. }
  45070. ,
  45071. n.OrthographicCamera.prototype = Object.create(n.Camera.prototype),
  45072. n.OrthographicCamera.prototype.constructor = n.OrthographicCamera,
  45073. n.OrthographicCamera.prototype.updateProjectionMatrix = function() {
  45074. var e = (this.right - this.left) / (2 * this.zoom)
  45075. , t = (this.top - this.bottom) / (2 * this.zoom)
  45076. , i = (this.right + this.left) / 2
  45077. , n = (this.top + this.bottom) / 2;
  45078. this.projectionMatrix.makeOrthographic(i - e, i + e, n + t, n - t, this.near, this.far)
  45079. }
  45080. ,
  45081. n.OrthographicCamera.prototype.copy = function(e) {
  45082. return n.Camera.prototype.copy.call(this, e),
  45083. this.left = e.left,
  45084. this.right = e.right,
  45085. this.top = e.top,
  45086. this.bottom = e.bottom,
  45087. this.near = e.near,
  45088. this.far = e.far,
  45089. this.zoom = e.zoom,
  45090. this
  45091. }
  45092. ,
  45093. n.OrthographicCamera.prototype.toJSON = function(e) {
  45094. var t = n.Object3D.prototype.toJSON.call(this, e);
  45095. return t.object.zoom = this.zoom,
  45096. t.object.left = this.left,
  45097. t.object.right = this.right,
  45098. t.object.top = this.top,
  45099. t.object.bottom = this.bottom,
  45100. t.object.near = this.near,
  45101. t.object.far = this.far,
  45102. t
  45103. }
  45104. ,
  45105. n.PerspectiveCamera = function(e, t, i, r) {
  45106. n.Camera.call(this),
  45107. this.type = "PerspectiveCamera",
  45108. this.focalLength = 10,
  45109. this.zoom = 1,
  45110. this.fov = void 0 !== e ? e : 50,
  45111. this.aspect = void 0 !== t ? t : 1,
  45112. this.near = void 0 !== i ? i : .1,
  45113. this.far = void 0 !== r ? r : 2e3,
  45114. this.updateProjectionMatrix()
  45115. }
  45116. ,
  45117. n.PerspectiveCamera.prototype = Object.create(n.Camera.prototype),
  45118. n.PerspectiveCamera.prototype.constructor = n.PerspectiveCamera,
  45119. n.PerspectiveCamera.prototype.setLens = function(e, t) {
  45120. void 0 === t && (t = 24),
  45121. this.fov = 2 * n.Math.radToDeg(Math.atan(t / (2 * e))),
  45122. this.updateProjectionMatrix()
  45123. }
  45124. ,
  45125. n.PerspectiveCamera.prototype.setViewOffset = function(e, t, i, n, r, o) {
  45126. this.fullWidth = e,
  45127. this.fullHeight = t,
  45128. this.x = i,
  45129. this.y = n,
  45130. this.width = r,
  45131. this.height = o,
  45132. this.updateProjectionMatrix()
  45133. }
  45134. ,
  45135. n.PerspectiveCamera.prototype.updateProjectionMatrix = function() {
  45136. var e = n.Math.radToDeg(2 * Math.atan(Math.tan(.5 * n.Math.degToRad(this.fov)) / this.zoom));
  45137. if (this.fullWidth) {
  45138. var t = this.fullWidth / this.fullHeight
  45139. , i = Math.tan(n.Math.degToRad(.5 * e)) * this.near
  45140. , r = -i
  45141. , o = t * r
  45142. , a = t * i
  45143. , s = Math.abs(a - o)
  45144. , l = Math.abs(i - r);
  45145. this.projectionMatrix.makeFrustum(o + this.x * s / this.fullWidth, o + (this.x + this.width) * s / this.fullWidth, i - (this.y + this.height) * l / this.fullHeight, i - this.y * l / this.fullHeight, this.near, this.far)
  45146. } else
  45147. this.projectionMatrix.makePerspective(e, this.aspect, this.near, this.far)
  45148. }
  45149. ,
  45150. n.PerspectiveCamera.prototype.copy = function(e) {
  45151. return n.Camera.prototype.copy.call(this, e),
  45152. this.focalLength = e.focalLength,
  45153. this.zoom = e.zoom,
  45154. this.fov = e.fov,
  45155. this.aspect = e.aspect,
  45156. this.near = e.near,
  45157. this.far = e.far,
  45158. this
  45159. }
  45160. ,
  45161. n.PerspectiveCamera.prototype.toJSON = function(e) {
  45162. var t = n.Object3D.prototype.toJSON.call(this, e);
  45163. return t.object.focalLength = this.focalLength,
  45164. t.object.zoom = this.zoom,
  45165. t.object.fov = this.fov,
  45166. t.object.aspect = this.aspect,
  45167. t.object.near = this.near,
  45168. t.object.far = this.far,
  45169. t
  45170. }
  45171. ,
  45172. n.StereoCamera = function() {
  45173. this.type = "StereoCamera",
  45174. this.aspect = 1,
  45175. this.cameraL = new n.PerspectiveCamera,
  45176. this.cameraL.layers.enable(1),
  45177. this.cameraL.matrixAutoUpdate = !1,
  45178. this.cameraR = new n.PerspectiveCamera,
  45179. this.cameraR.layers.enable(2),
  45180. this.cameraR.matrixAutoUpdate = !1
  45181. }
  45182. ,
  45183. n.StereoCamera.prototype = {
  45184. constructor: n.StereoCamera,
  45185. update: function() {
  45186. var e, t, i, r, o, a = new n.Matrix4, s = new n.Matrix4;
  45187. return function(l) {
  45188. var c = e !== l.focalLength || t !== l.fov || i !== l.aspect * this.aspect || r !== l.near || o !== l.far;
  45189. if (c) {
  45190. e = l.focalLength,
  45191. t = l.fov,
  45192. i = l.aspect * this.aspect,
  45193. r = l.near,
  45194. o = l.far;
  45195. var h, u, d = l.projectionMatrix.clone(), p = .032, f = p * r / e, g = r * Math.tan(n.Math.degToRad(.5 * t));
  45196. s.elements[12] = -p,
  45197. a.elements[12] = p,
  45198. h = -g * i + f,
  45199. u = g * i + f,
  45200. d.elements[0] = 2 * r / (u - h),
  45201. d.elements[8] = (u + h) / (u - h),
  45202. this.cameraL.projectionMatrix.copy(d),
  45203. h = -g * i - f,
  45204. u = g * i - f,
  45205. d.elements[0] = 2 * r / (u - h),
  45206. d.elements[8] = (u + h) / (u - h),
  45207. this.cameraR.projectionMatrix.copy(d)
  45208. }
  45209. this.cameraL.matrixWorld.copy(l.matrixWorld).multiply(s),
  45210. this.cameraR.matrixWorld.copy(l.matrixWorld).multiply(a)
  45211. }
  45212. }()
  45213. },
  45214. n.Light = function(e, t) {
  45215. n.Object3D.call(this),
  45216. this.type = "Light",
  45217. this.color = new n.Color(e),
  45218. this.intensity = void 0 !== t ? t : 1,
  45219. this.receiveShadow = void 0
  45220. }
  45221. ,
  45222. n.Light.prototype = Object.create(n.Object3D.prototype),
  45223. n.Light.prototype.constructor = n.Light,
  45224. n.Light.prototype.copy = function(e) {
  45225. return n.Object3D.prototype.copy.call(this, e),
  45226. this.color.copy(e.color),
  45227. this.intensity = e.intensity,
  45228. this
  45229. }
  45230. ,
  45231. n.Light.prototype.toJSON = function(e) {
  45232. var t = n.Object3D.prototype.toJSON.call(this, e);
  45233. return t.object.color = this.color.getHex(),
  45234. t.object.intensity = this.intensity,
  45235. void 0 !== this.groundColor && (t.object.groundColor = this.groundColor.getHex()),
  45236. void 0 !== this.distance && (t.object.distance = this.distance),
  45237. void 0 !== this.angle && (t.object.angle = this.angle),
  45238. void 0 !== this.decay && (t.object.decay = this.decay),
  45239. void 0 !== this.penumbra && (t.object.penumbra = this.penumbra),
  45240. t
  45241. }
  45242. ,
  45243. n.LightShadow = function(e) {
  45244. this.camera = e,
  45245. this.bias = 0,
  45246. this.radius = 1,
  45247. this.mapSize = new n.Vector2(512,512),
  45248. this.map = null,
  45249. this.matrix = new n.Matrix4
  45250. }
  45251. ,
  45252. n.LightShadow.prototype = {
  45253. constructor: n.LightShadow,
  45254. copy: function(e) {
  45255. return this.camera = e.camera.clone(),
  45256. this.bias = e.bias,
  45257. this.radius = e.radius,
  45258. this.mapSize.copy(e.mapSize),
  45259. this
  45260. },
  45261. clone: function() {
  45262. return (new this.constructor).copy(this)
  45263. }
  45264. },
  45265. n.AmbientLight = function(e, t) {
  45266. n.Light.call(this, e, t),
  45267. this.type = "AmbientLight",
  45268. this.castShadow = void 0
  45269. }
  45270. ,
  45271. n.AmbientLight.prototype = Object.create(n.Light.prototype),
  45272. n.AmbientLight.prototype.constructor = n.AmbientLight,
  45273. n.DirectionalLight = function(e, t) {
  45274. n.Light.call(this, e, t),
  45275. this.type = "DirectionalLight",
  45276. this.position.set(0, 1, 0),
  45277. this.updateMatrix(),
  45278. this.target = new n.Object3D,
  45279. this.shadow = new n.LightShadow(new n.OrthographicCamera(-5,5,5,-5,.5,500))
  45280. }
  45281. ,
  45282. n.DirectionalLight.prototype = Object.create(n.Light.prototype),
  45283. n.DirectionalLight.prototype.constructor = n.DirectionalLight,
  45284. n.DirectionalLight.prototype.copy = function(e) {
  45285. return n.Light.prototype.copy.call(this, e),
  45286. this.target = e.target.clone(),
  45287. this.shadow = e.shadow.clone(),
  45288. this
  45289. }
  45290. ,
  45291. n.HemisphereLight = function(e, t, i) {
  45292. n.Light.call(this, e, i),
  45293. this.type = "HemisphereLight",
  45294. this.castShadow = void 0,
  45295. this.position.set(0, 1, 0),
  45296. this.updateMatrix(),
  45297. this.groundColor = new n.Color(t)
  45298. }
  45299. ,
  45300. n.HemisphereLight.prototype = Object.create(n.Light.prototype),
  45301. n.HemisphereLight.prototype.constructor = n.HemisphereLight,
  45302. n.HemisphereLight.prototype.copy = function(e) {
  45303. return n.Light.prototype.copy.call(this, e),
  45304. this.groundColor.copy(e.groundColor),
  45305. this
  45306. }
  45307. ,
  45308. n.PointLight = function(e, t, i, r) {
  45309. n.Light.call(this, e, t),
  45310. this.type = "PointLight",
  45311. this.distance = void 0 !== i ? i : 0,
  45312. this.decay = void 0 !== r ? r : 1,
  45313. this.shadow = new n.LightShadow(new n.PerspectiveCamera(90,1,.5,500))
  45314. }
  45315. ,
  45316. n.PointLight.prototype = Object.create(n.Light.prototype),
  45317. n.PointLight.prototype.constructor = n.PointLight,
  45318. Object.defineProperty(n.PointLight.prototype, "power", {
  45319. get: function() {
  45320. return 4 * this.intensity * Math.PI
  45321. },
  45322. set: function(e) {
  45323. this.intensity = e / (4 * Math.PI)
  45324. }
  45325. }),
  45326. n.PointLight.prototype.copy = function(e) {
  45327. return n.Light.prototype.copy.call(this, e),
  45328. this.distance = e.distance,
  45329. this.decay = e.decay,
  45330. this.shadow = e.shadow.clone(),
  45331. this
  45332. }
  45333. ,
  45334. n.SpotLight = function(e, t, i, r, o, a) {
  45335. n.Light.call(this, e, t),
  45336. this.type = "SpotLight",
  45337. this.position.set(0, 1, 0),
  45338. this.updateMatrix(),
  45339. this.target = new n.Object3D,
  45340. this.distance = void 0 !== i ? i : 0,
  45341. this.angle = void 0 !== r ? r : Math.PI / 3,
  45342. this.penumbra = void 0 !== o ? o : 0,
  45343. this.decay = void 0 !== a ? a : 1,
  45344. this.shadow = new n.LightShadow(new n.PerspectiveCamera(50,1,.5,500))
  45345. }
  45346. ,
  45347. n.SpotLight.prototype = Object.create(n.Light.prototype),
  45348. n.SpotLight.prototype.constructor = n.SpotLight,
  45349. Object.defineProperty(n.SpotLight.prototype, "power", {
  45350. get: function() {
  45351. return this.intensity * Math.PI
  45352. },
  45353. set: function(e) {
  45354. this.intensity = e / Math.PI
  45355. }
  45356. }),
  45357. n.SpotLight.prototype.copy = function(e) {
  45358. return n.Light.prototype.copy.call(this, e),
  45359. this.distance = e.distance,
  45360. this.angle = e.angle,
  45361. this.penumbra = e.penumbra,
  45362. this.decay = e.decay,
  45363. this.target = e.target.clone(),
  45364. this.shadow = e.shadow.clone(),
  45365. this
  45366. }
  45367. ,
  45368. n.Cache = {
  45369. enabled: !1,
  45370. files: {},
  45371. add: function(e, t) {
  45372. this.enabled !== !1 && (this.files[e] = t)
  45373. },
  45374. get: function(e) {
  45375. if (this.enabled !== !1)
  45376. return this.files[e]
  45377. },
  45378. remove: function(e) {
  45379. delete this.files[e]
  45380. },
  45381. clear: function() {
  45382. this.files = {}
  45383. }
  45384. },
  45385. n.Loader = function() {
  45386. this.onLoadStart = function() {}
  45387. ,
  45388. this.onLoadProgress = function() {}
  45389. ,
  45390. this.onLoadComplete = function() {}
  45391. }
  45392. ,
  45393. n.Loader.prototype = {
  45394. constructor: n.Loader,
  45395. crossOrigin: void 0,
  45396. extractUrlBase: function(e) {
  45397. var t = e.split("/");
  45398. return 1 === t.length ? "./" : (t.pop(),
  45399. t.join("/") + "/")
  45400. },
  45401. initMaterials: function(e, t, i) {
  45402. for (var n = [], r = 0; r < e.length; ++r)
  45403. n[r] = this.createMaterial(e[r], t, i);
  45404. return n
  45405. },
  45406. createMaterial: function() {
  45407. var e, t, i;
  45408. return function(r, o, a) {
  45409. function s(e, i, r, s, c) {
  45410. var h, u = o + e, d = n.Loader.Handlers.get(u);
  45411. null !== d ? h = d.load(u) : (t.setCrossOrigin(a),
  45412. h = t.load(u)),
  45413. void 0 !== i && (h.repeat.fromArray(i),
  45414. 1 !== i[0] && (h.wrapS = n.RepeatWrapping),
  45415. 1 !== i[1] && (h.wrapT = n.RepeatWrapping)),
  45416. void 0 !== r && h.offset.fromArray(r),
  45417. void 0 !== s && ("repeat" === s[0] && (h.wrapS = n.RepeatWrapping),
  45418. "mirror" === s[0] && (h.wrapS = n.MirroredRepeatWrapping),
  45419. "repeat" === s[1] && (h.wrapT = n.RepeatWrapping),
  45420. "mirror" === s[1] && (h.wrapT = n.MirroredRepeatWrapping)),
  45421. void 0 !== c && (h.anisotropy = c);
  45422. var p = n.Math.generateUUID();
  45423. return l[p] = h,
  45424. p
  45425. }
  45426. void 0 === e && (e = new n.Color),
  45427. void 0 === t && (t = new n.TextureLoader),
  45428. void 0 === i && (i = new n.MaterialLoader);
  45429. var l = {}
  45430. , c = {
  45431. uuid: n.Math.generateUUID(),
  45432. type: "MeshLambertMaterial"
  45433. };
  45434. for (var h in r) {
  45435. var u = r[h];
  45436. switch (h) {
  45437. case "DbgColor":
  45438. case "DbgIndex":
  45439. case "opticalDensity":
  45440. case "illumination":
  45441. break;
  45442. case "DbgName":
  45443. c.name = u;
  45444. break;
  45445. case "blending":
  45446. c.blending = n[u];
  45447. break;
  45448. case "colorAmbient":
  45449. case "mapAmbient":
  45450. console.warn("THREE.Loader.createMaterial:", h, "is no longer supported.");
  45451. break;
  45452. case "colorDiffuse":
  45453. c.color = e.fromArray(u).getHex();
  45454. break;
  45455. case "colorSpecular":
  45456. c.specular = e.fromArray(u).getHex();
  45457. break;
  45458. case "colorEmissive":
  45459. c.emissive = e.fromArray(u).getHex();
  45460. break;
  45461. case "specularCoef":
  45462. c.shininess = u;
  45463. break;
  45464. case "shading":
  45465. "basic" === u.toLowerCase() && (c.type = "MeshBasicMaterial"),
  45466. "phong" === u.toLowerCase() && (c.type = "MeshPhongMaterial");
  45467. break;
  45468. case "mapDiffuse":
  45469. c.map = s(u, r.mapDiffuseRepeat, r.mapDiffuseOffset, r.mapDiffuseWrap, r.mapDiffuseAnisotropy);
  45470. break;
  45471. case "mapDiffuseRepeat":
  45472. case "mapDiffuseOffset":
  45473. case "mapDiffuseWrap":
  45474. case "mapDiffuseAnisotropy":
  45475. break;
  45476. case "mapLight":
  45477. c.lightMap = s(u, r.mapLightRepeat, r.mapLightOffset, r.mapLightWrap, r.mapLightAnisotropy);
  45478. break;
  45479. case "mapLightRepeat":
  45480. case "mapLightOffset":
  45481. case "mapLightWrap":
  45482. case "mapLightAnisotropy":
  45483. break;
  45484. case "mapAO":
  45485. c.aoMap = s(u, r.mapAORepeat, r.mapAOOffset, r.mapAOWrap, r.mapAOAnisotropy);
  45486. break;
  45487. case "mapAORepeat":
  45488. case "mapAOOffset":
  45489. case "mapAOWrap":
  45490. case "mapAOAnisotropy":
  45491. break;
  45492. case "mapBump":
  45493. c.bumpMap = s(u, r.mapBumpRepeat, r.mapBumpOffset, r.mapBumpWrap, r.mapBumpAnisotropy);
  45494. break;
  45495. case "mapBumpScale":
  45496. c.bumpScale = u;
  45497. break;
  45498. case "mapBumpRepeat":
  45499. case "mapBumpOffset":
  45500. case "mapBumpWrap":
  45501. case "mapBumpAnisotropy":
  45502. break;
  45503. case "mapNormal":
  45504. c.normalMap = s(u, r.mapNormalRepeat, r.mapNormalOffset, r.mapNormalWrap, r.mapNormalAnisotropy);
  45505. break;
  45506. case "mapNormalFactor":
  45507. c.normalScale = [u, u];
  45508. break;
  45509. case "mapNormalRepeat":
  45510. case "mapNormalOffset":
  45511. case "mapNormalWrap":
  45512. case "mapNormalAnisotropy":
  45513. break;
  45514. case "mapSpecular":
  45515. c.specularMap = s(u, r.mapSpecularRepeat, r.mapSpecularOffset, r.mapSpecularWrap, r.mapSpecularAnisotropy);
  45516. break;
  45517. case "mapSpecularRepeat":
  45518. case "mapSpecularOffset":
  45519. case "mapSpecularWrap":
  45520. case "mapSpecularAnisotropy":
  45521. break;
  45522. case "mapAlpha":
  45523. c.alphaMap = s(u, r.mapAlphaRepeat, r.mapAlphaOffset, r.mapAlphaWrap, r.mapAlphaAnisotropy);
  45524. break;
  45525. case "mapAlphaRepeat":
  45526. case "mapAlphaOffset":
  45527. case "mapAlphaWrap":
  45528. case "mapAlphaAnisotropy":
  45529. break;
  45530. case "flipSided":
  45531. c.side = n.BackSide;
  45532. break;
  45533. case "doubleSided":
  45534. c.side = n.DoubleSide;
  45535. break;
  45536. case "transparency":
  45537. console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),
  45538. c.opacity = u;
  45539. break;
  45540. case "depthTest":
  45541. case "depthWrite":
  45542. case "colorWrite":
  45543. case "opacity":
  45544. case "reflectivity":
  45545. case "transparent":
  45546. case "visible":
  45547. case "wireframe":
  45548. c[h] = u;
  45549. break;
  45550. case "vertexColors":
  45551. u === !0 && (c.vertexColors = n.VertexColors),
  45552. "face" === u && (c.vertexColors = n.FaceColors);
  45553. break;
  45554. default:
  45555. console.error("THREE.Loader.createMaterial: Unsupported", h, u)
  45556. }
  45557. }
  45558. return "MeshBasicMaterial" === c.type && delete c.emissive,
  45559. "MeshPhongMaterial" !== c.type && delete c.specular,
  45560. c.opacity < 1 && (c.transparent = !0),
  45561. i.setTextures(l),
  45562. i.parse(c)
  45563. }
  45564. }()
  45565. },
  45566. n.Loader.Handlers = {
  45567. handlers: [],
  45568. add: function(e, t) {
  45569. this.handlers.push(e, t)
  45570. },
  45571. get: function(e) {
  45572. for (var t = this.handlers, i = 0, n = t.length; i < n; i += 2) {
  45573. var r = t[i]
  45574. , o = t[i + 1];
  45575. if (r.test(e))
  45576. return o
  45577. }
  45578. return null
  45579. }
  45580. },
  45581. n.XHRLoader = function(e) {
  45582. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  45583. }
  45584. ,
  45585. n.XHRLoader.prototype = {
  45586. constructor: n.XHRLoader,
  45587. load: function(e, t, i, r) {
  45588. void 0 !== this.path && (e = this.path + e);
  45589. var o = this
  45590. , a = n.Cache.get(e);
  45591. if (void 0 !== a)
  45592. return t && setTimeout(function() {
  45593. t(a)
  45594. }, 0),
  45595. a;
  45596. var s = new XMLHttpRequest;
  45597. return s.overrideMimeType("text/plain"),
  45598. s.open("GET", e, !0),
  45599. s.addEventListener("load", function(i) {
  45600. var a = i.target.response;
  45601. n.Cache.add(e, a),
  45602. 200 === this.status ? (t && t(a),
  45603. o.manager.itemEnd(e)) : 0 === this.status ? (console.warn("THREE.XHRLoader: HTTP Status 0 received."),
  45604. t && t(a),
  45605. o.manager.itemEnd(e)) : (r && r(i),
  45606. o.manager.itemError(e))
  45607. }, !1),
  45608. void 0 !== i && s.addEventListener("progress", function(e) {
  45609. i(e)
  45610. }, !1),
  45611. s.addEventListener("error", function(t) {
  45612. r && r(t),
  45613. o.manager.itemError(e)
  45614. }, !1),
  45615. void 0 !== this.responseType && (s.responseType = this.responseType),
  45616. void 0 !== this.withCredentials && (s.withCredentials = this.withCredentials),
  45617. s.send(null),
  45618. o.manager.itemStart(e),
  45619. s
  45620. },
  45621. setPath: function(e) {
  45622. this.path = e
  45623. },
  45624. setResponseType: function(e) {
  45625. this.responseType = e
  45626. },
  45627. setWithCredentials: function(e) {
  45628. this.withCredentials = e
  45629. }
  45630. },
  45631. n.FontLoader = function(e) {
  45632. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  45633. }
  45634. ,
  45635. n.FontLoader.prototype = {
  45636. constructor: n.FontLoader,
  45637. load: function(e, t, i, r) {
  45638. var o = new n.XHRLoader(this.manager);
  45639. o.load(e, function(e) {
  45640. t(new n.Font(JSON.parse(e.substring(65, e.length - 2))))
  45641. }, i, r)
  45642. }
  45643. },
  45644. n.ImageLoader = function(e) {
  45645. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  45646. }
  45647. ,
  45648. n.ImageLoader.prototype = {
  45649. constructor: n.ImageLoader,
  45650. load: function(e, t, i, r) {
  45651. void 0 !== this.path && (e = this.path + e);
  45652. var o = this
  45653. , a = n.Cache.get(e);
  45654. if (void 0 !== a)
  45655. return o.manager.itemStart(e),
  45656. t ? setTimeout(function() {
  45657. t(a),
  45658. o.manager.itemEnd(e)
  45659. }, 0) : o.manager.itemEnd(e),
  45660. a;
  45661. var s = document.createElement("img");
  45662. return s.addEventListener("load", function(i) {
  45663. n.Cache.add(e, this),
  45664. t && t(this),
  45665. o.manager.itemEnd(e)
  45666. }, !1),
  45667. void 0 !== i && s.addEventListener("progress", function(e) {
  45668. i(e)
  45669. }, !1),
  45670. s.addEventListener("error", function(t) {
  45671. r && r(t),
  45672. o.manager.itemError(e)
  45673. }, !1),
  45674. void 0 !== this.crossOrigin && (s.crossOrigin = this.crossOrigin),
  45675. o.manager.itemStart(e),
  45676. s.src = e,
  45677. s
  45678. },
  45679. setCrossOrigin: function(e) {
  45680. this.crossOrigin = e
  45681. },
  45682. setPath: function(e) {
  45683. this.path = e
  45684. }
  45685. },
  45686. n.JSONLoader = function(e) {
  45687. "boolean" == typeof e && (console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),
  45688. e = void 0),
  45689. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  45690. this.withCredentials = !1
  45691. }
  45692. ,
  45693. n.JSONLoader.prototype = {
  45694. constructor: n.JSONLoader,
  45695. get statusDomElement() {
  45696. return void 0 === this._statusDomElement && (this._statusDomElement = document.createElement("div")),
  45697. console.warn("THREE.JSONLoader: .statusDomElement has been removed."),
  45698. this._statusDomElement
  45699. },
  45700. load: function(e, t, i, r) {
  45701. var o = this
  45702. , a = this.texturePath && "string" == typeof this.texturePath ? this.texturePath : n.Loader.prototype.extractUrlBase(e)
  45703. , s = new n.XHRLoader(this.manager);
  45704. s.setWithCredentials(this.withCredentials),
  45705. s.load(e, function(i) {
  45706. var n = JSON.parse(i)
  45707. , r = n.metadata;
  45708. if (void 0 !== r) {
  45709. var s = r.type;
  45710. if (void 0 !== s) {
  45711. if ("object" === s.toLowerCase())
  45712. return void console.error("THREE.JSONLoader: " + e + " should be loaded with THREE.ObjectLoader instead.");
  45713. if ("scene" === s.toLowerCase())
  45714. return void console.error("THREE.JSONLoader: " + e + " should be loaded with THREE.SceneLoader instead.")
  45715. }
  45716. }
  45717. var l = o.parse(n, a);
  45718. t(l.geometry, l.materials)
  45719. }, i, r)
  45720. },
  45721. setTexturePath: function(e) {
  45722. this.texturePath = e
  45723. },
  45724. parse: function(e, t) {
  45725. function i(t) {
  45726. function i(e, t) {
  45727. return e & 1 << t
  45728. }
  45729. var r, o, a, l, c, h, u, d, p, f, g, m, v, A, y, C, I, E, b, w, _, T, x, S, M, R, P, O = e.faces, L = e.vertices, D = e.normals, N = e.colors, B = 0;
  45730. if (void 0 !== e.uvs) {
  45731. for (r = 0; r < e.uvs.length; r++)
  45732. e.uvs[r].length && B++;
  45733. for (r = 0; r < B; r++)
  45734. s.faceVertexUvs[r] = []
  45735. }
  45736. for (l = 0,
  45737. c = L.length; l < c; )
  45738. E = new n.Vector3,
  45739. E.x = L[l++] * t,
  45740. E.y = L[l++] * t,
  45741. E.z = L[l++] * t,
  45742. s.vertices.push(E);
  45743. for (l = 0,
  45744. c = O.length; l < c; )
  45745. if (f = O[l++],
  45746. g = i(f, 0),
  45747. m = i(f, 1),
  45748. v = i(f, 3),
  45749. A = i(f, 4),
  45750. y = i(f, 5),
  45751. C = i(f, 6),
  45752. I = i(f, 7),
  45753. g) {
  45754. if (w = new n.Face3,
  45755. w.a = O[l],
  45756. w.b = O[l + 1],
  45757. w.c = O[l + 3],
  45758. _ = new n.Face3,
  45759. _.a = O[l + 1],
  45760. _.b = O[l + 2],
  45761. _.c = O[l + 3],
  45762. l += 4,
  45763. m && (p = O[l++],
  45764. w.materialIndex = p,
  45765. _.materialIndex = p),
  45766. a = s.faces.length,
  45767. v)
  45768. for (r = 0; r < B; r++)
  45769. for (S = e.uvs[r],
  45770. s.faceVertexUvs[r][a] = [],
  45771. s.faceVertexUvs[r][a + 1] = [],
  45772. o = 0; o < 4; o++)
  45773. d = O[l++],
  45774. R = S[2 * d],
  45775. P = S[2 * d + 1],
  45776. M = new n.Vector2(R,P),
  45777. 2 !== o && s.faceVertexUvs[r][a].push(M),
  45778. 0 !== o && s.faceVertexUvs[r][a + 1].push(M);
  45779. if (A && (u = 3 * O[l++],
  45780. w.normal.set(D[u++], D[u++], D[u]),
  45781. _.normal.copy(w.normal)),
  45782. y)
  45783. for (r = 0; r < 4; r++)
  45784. u = 3 * O[l++],
  45785. x = new n.Vector3(D[u++],D[u++],D[u]),
  45786. 2 !== r && w.vertexNormals.push(x),
  45787. 0 !== r && _.vertexNormals.push(x);
  45788. if (C && (h = O[l++],
  45789. T = N[h],
  45790. w.color.setHex(T),
  45791. _.color.setHex(T)),
  45792. I)
  45793. for (r = 0; r < 4; r++)
  45794. h = O[l++],
  45795. T = N[h],
  45796. 2 !== r && w.vertexColors.push(new n.Color(T)),
  45797. 0 !== r && _.vertexColors.push(new n.Color(T));
  45798. s.faces.push(w),
  45799. s.faces.push(_)
  45800. } else {
  45801. if (b = new n.Face3,
  45802. b.a = O[l++],
  45803. b.b = O[l++],
  45804. b.c = O[l++],
  45805. m && (p = O[l++],
  45806. b.materialIndex = p),
  45807. a = s.faces.length,
  45808. v)
  45809. for (r = 0; r < B; r++)
  45810. for (S = e.uvs[r],
  45811. s.faceVertexUvs[r][a] = [],
  45812. o = 0; o < 3; o++)
  45813. d = O[l++],
  45814. R = S[2 * d],
  45815. P = S[2 * d + 1],
  45816. M = new n.Vector2(R,P),
  45817. s.faceVertexUvs[r][a].push(M);
  45818. if (A && (u = 3 * O[l++],
  45819. b.normal.set(D[u++], D[u++], D[u])),
  45820. y)
  45821. for (r = 0; r < 3; r++)
  45822. u = 3 * O[l++],
  45823. x = new n.Vector3(D[u++],D[u++],D[u]),
  45824. b.vertexNormals.push(x);
  45825. if (C && (h = O[l++],
  45826. b.color.setHex(N[h])),
  45827. I)
  45828. for (r = 0; r < 3; r++)
  45829. h = O[l++],
  45830. b.vertexColors.push(new n.Color(N[h]));
  45831. s.faces.push(b)
  45832. }
  45833. }
  45834. function r() {
  45835. var t = void 0 !== e.influencesPerVertex ? e.influencesPerVertex : 2;
  45836. if (e.skinWeights)
  45837. for (var i = 0, r = e.skinWeights.length; i < r; i += t) {
  45838. var o = e.skinWeights[i]
  45839. , a = t > 1 ? e.skinWeights[i + 1] : 0
  45840. , l = t > 2 ? e.skinWeights[i + 2] : 0
  45841. , c = t > 3 ? e.skinWeights[i + 3] : 0;
  45842. s.skinWeights.push(new n.Vector4(o,a,l,c))
  45843. }
  45844. if (e.skinIndices)
  45845. for (var i = 0, r = e.skinIndices.length; i < r; i += t) {
  45846. var h = e.skinIndices[i]
  45847. , u = t > 1 ? e.skinIndices[i + 1] : 0
  45848. , d = t > 2 ? e.skinIndices[i + 2] : 0
  45849. , p = t > 3 ? e.skinIndices[i + 3] : 0;
  45850. s.skinIndices.push(new n.Vector4(h,u,d,p))
  45851. }
  45852. s.bones = e.bones,
  45853. s.bones && s.bones.length > 0 && (s.skinWeights.length !== s.skinIndices.length || s.skinIndices.length !== s.vertices.length) && console.warn("When skinning, number of vertices (" + s.vertices.length + "), skinIndices (" + s.skinIndices.length + "), and skinWeights (" + s.skinWeights.length + ") should match.")
  45854. }
  45855. function o(t) {
  45856. if (void 0 !== e.morphTargets)
  45857. for (var i = 0, r = e.morphTargets.length; i < r; i++) {
  45858. s.morphTargets[i] = {},
  45859. s.morphTargets[i].name = e.morphTargets[i].name,
  45860. s.morphTargets[i].vertices = [];
  45861. for (var o = s.morphTargets[i].vertices, a = e.morphTargets[i].vertices, l = 0, c = a.length; l < c; l += 3) {
  45862. var h = new n.Vector3;
  45863. h.x = a[l] * t,
  45864. h.y = a[l + 1] * t,
  45865. h.z = a[l + 2] * t,
  45866. o.push(h)
  45867. }
  45868. }
  45869. if (void 0 !== e.morphColors && e.morphColors.length > 0) {
  45870. console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');
  45871. for (var u = s.faces, d = e.morphColors[0].colors, i = 0, r = u.length; i < r; i++)
  45872. u[i].color.fromArray(d, 3 * i)
  45873. }
  45874. }
  45875. function a() {
  45876. var t = []
  45877. , i = [];
  45878. void 0 !== e.animation && i.push(e.animation),
  45879. void 0 !== e.animations && (e.animations.length ? i = i.concat(e.animations) : i.push(e.animations));
  45880. for (var r = 0; r < i.length; r++) {
  45881. var o = n.AnimationClip.parseAnimation(i[r], s.bones);
  45882. o && t.push(o)
  45883. }
  45884. if (s.morphTargets) {
  45885. var a = n.AnimationClip.CreateClipsFromMorphTargetSequences(s.morphTargets, 10);
  45886. t = t.concat(a)
  45887. }
  45888. t.length > 0 && (s.animations = t)
  45889. }
  45890. var s = new n.Geometry
  45891. , l = void 0 !== e.scale ? 1 / e.scale : 1;
  45892. if (i(l),
  45893. r(),
  45894. o(l),
  45895. a(),
  45896. s.computeFaceNormals(),
  45897. s.computeBoundingSphere(),
  45898. void 0 === e.materials || 0 === e.materials.length)
  45899. return {
  45900. geometry: s
  45901. };
  45902. var c = n.Loader.prototype.initMaterials(e.materials, t, this.crossOrigin);
  45903. return {
  45904. geometry: s,
  45905. materials: c
  45906. }
  45907. }
  45908. },
  45909. n.LoadingManager = function(e, t, i) {
  45910. var n = this
  45911. , r = !1
  45912. , o = 0
  45913. , a = 0;
  45914. this.onStart = void 0,
  45915. this.onLoad = e,
  45916. this.onProgress = t,
  45917. this.onError = i,
  45918. this.itemStart = function(e) {
  45919. a++,
  45920. r === !1 && void 0 !== n.onStart && n.onStart(e, o, a),
  45921. r = !0
  45922. }
  45923. ,
  45924. this.itemEnd = function(e) {
  45925. o++,
  45926. void 0 !== n.onProgress && n.onProgress(e, o, a),
  45927. o === a && (r = !1,
  45928. void 0 !== n.onLoad && n.onLoad())
  45929. }
  45930. ,
  45931. this.itemError = function(e) {
  45932. void 0 !== n.onError && n.onError(e)
  45933. }
  45934. }
  45935. ,
  45936. n.DefaultLoadingManager = new n.LoadingManager,
  45937. n.BufferGeometryLoader = function(e) {
  45938. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  45939. }
  45940. ,
  45941. n.BufferGeometryLoader.prototype = {
  45942. constructor: n.BufferGeometryLoader,
  45943. load: function(e, t, i, r) {
  45944. var o = this
  45945. , a = new n.XHRLoader(o.manager);
  45946. a.load(e, function(e) {
  45947. t(o.parse(JSON.parse(e)))
  45948. }, i, r)
  45949. },
  45950. parse: function(e) {
  45951. var t = new n.BufferGeometry
  45952. , i = e.data.index
  45953. , r = {
  45954. Int8Array: Int8Array,
  45955. Uint8Array: Uint8Array,
  45956. Uint8ClampedArray: Uint8ClampedArray,
  45957. Int16Array: Int16Array,
  45958. Uint16Array: Uint16Array,
  45959. Int32Array: Int32Array,
  45960. Uint32Array: Uint32Array,
  45961. Float32Array: Float32Array,
  45962. Float64Array: Float64Array
  45963. };
  45964. if (void 0 !== i) {
  45965. var o = new r[i.type](i.array);
  45966. t.setIndex(new n.BufferAttribute(o,1))
  45967. }
  45968. var a = e.data.attributes;
  45969. for (var s in a) {
  45970. var l = a[s]
  45971. , o = new r[l.type](l.array);
  45972. t.addAttribute(s, new n.BufferAttribute(o,l.itemSize))
  45973. }
  45974. var c = e.data.groups || e.data.drawcalls || e.data.offsets;
  45975. if (void 0 !== c)
  45976. for (var h = 0, u = c.length; h !== u; ++h) {
  45977. var d = c[h];
  45978. t.addGroup(d.start, d.count, d.materialIndex)
  45979. }
  45980. var p = e.data.boundingSphere;
  45981. if (void 0 !== p) {
  45982. var f = new n.Vector3;
  45983. void 0 !== p.center && f.fromArray(p.center),
  45984. t.boundingSphere = new n.Sphere(f,p.radius)
  45985. }
  45986. return t
  45987. }
  45988. },
  45989. n.MaterialLoader = function(e) {
  45990. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  45991. this.textures = {}
  45992. }
  45993. ,
  45994. n.MaterialLoader.prototype = {
  45995. constructor: n.MaterialLoader,
  45996. load: function(e, t, i, r) {
  45997. var o = this
  45998. , a = new n.XHRLoader(o.manager);
  45999. a.load(e, function(e) {
  46000. t(o.parse(JSON.parse(e)))
  46001. }, i, r)
  46002. },
  46003. setTextures: function(e) {
  46004. this.textures = e
  46005. },
  46006. getTexture: function(e) {
  46007. var t = this.textures;
  46008. return void 0 === t[e] && console.warn("THREE.MaterialLoader: Undefined texture", e),
  46009. t[e]
  46010. },
  46011. parse: function(e) {
  46012. var t = new n[e.type];
  46013. if (void 0 !== e.uuid && (t.uuid = e.uuid),
  46014. void 0 !== e.name && (t.name = e.name),
  46015. void 0 !== e.color && t.color.setHex(e.color),
  46016. void 0 !== e.roughness && (t.roughness = e.roughness),
  46017. void 0 !== e.metalness && (t.metalness = e.metalness),
  46018. void 0 !== e.emissive && t.emissive.setHex(e.emissive),
  46019. void 0 !== e.specular && t.specular.setHex(e.specular),
  46020. void 0 !== e.shininess && (t.shininess = e.shininess),
  46021. void 0 !== e.uniforms && (t.uniforms = e.uniforms),
  46022. void 0 !== e.vertexShader && (t.vertexShader = e.vertexShader),
  46023. void 0 !== e.fragmentShader && (t.fragmentShader = e.fragmentShader),
  46024. void 0 !== e.vertexColors && (t.vertexColors = e.vertexColors),
  46025. void 0 !== e.shading && (t.shading = e.shading),
  46026. void 0 !== e.blending && (t.blending = e.blending),
  46027. void 0 !== e.side && (t.side = e.side),
  46028. void 0 !== e.opacity && (t.opacity = e.opacity),
  46029. void 0 !== e.transparent && (t.transparent = e.transparent),
  46030. void 0 !== e.alphaTest && (t.alphaTest = e.alphaTest),
  46031. void 0 !== e.depthTest && (t.depthTest = e.depthTest),
  46032. void 0 !== e.depthWrite && (t.depthWrite = e.depthWrite),
  46033. void 0 !== e.colorWrite && (t.colorWrite = e.colorWrite),
  46034. void 0 !== e.wireframe && (t.wireframe = e.wireframe),
  46035. void 0 !== e.wireframeLinewidth && (t.wireframeLinewidth = e.wireframeLinewidth),
  46036. void 0 !== e.size && (t.size = e.size),
  46037. void 0 !== e.sizeAttenuation && (t.sizeAttenuation = e.sizeAttenuation),
  46038. void 0 !== e.map && (t.map = this.getTexture(e.map)),
  46039. void 0 !== e.alphaMap && (t.alphaMap = this.getTexture(e.alphaMap),
  46040. t.transparent = !0),
  46041. void 0 !== e.bumpMap && (t.bumpMap = this.getTexture(e.bumpMap)),
  46042. void 0 !== e.bumpScale && (t.bumpScale = e.bumpScale),
  46043. void 0 !== e.normalMap && (t.normalMap = this.getTexture(e.normalMap)),
  46044. void 0 !== e.normalScale) {
  46045. var i = e.normalScale;
  46046. Array.isArray(i) === !1 && (i = [i, i]),
  46047. t.normalScale = (new n.Vector2).fromArray(i)
  46048. }
  46049. if (void 0 !== e.displacementMap && (t.displacementMap = this.getTexture(e.displacementMap)),
  46050. void 0 !== e.displacementScale && (t.displacementScale = e.displacementScale),
  46051. void 0 !== e.displacementBias && (t.displacementBias = e.displacementBias),
  46052. void 0 !== e.roughnessMap && (t.roughnessMap = this.getTexture(e.roughnessMap)),
  46053. void 0 !== e.metalnessMap && (t.metalnessMap = this.getTexture(e.metalnessMap)),
  46054. void 0 !== e.emissiveMap && (t.emissiveMap = this.getTexture(e.emissiveMap)),
  46055. void 0 !== e.emissiveIntensity && (t.emissiveIntensity = e.emissiveIntensity),
  46056. void 0 !== e.specularMap && (t.specularMap = this.getTexture(e.specularMap)),
  46057. void 0 !== e.envMap && (t.envMap = this.getTexture(e.envMap),
  46058. t.combine = n.MultiplyOperation),
  46059. e.reflectivity && (t.reflectivity = e.reflectivity),
  46060. void 0 !== e.lightMap && (t.lightMap = this.getTexture(e.lightMap)),
  46061. void 0 !== e.lightMapIntensity && (t.lightMapIntensity = e.lightMapIntensity),
  46062. void 0 !== e.aoMap && (t.aoMap = this.getTexture(e.aoMap)),
  46063. void 0 !== e.aoMapIntensity && (t.aoMapIntensity = e.aoMapIntensity),
  46064. void 0 !== e.materials)
  46065. for (var r = 0, o = e.materials.length; r < o; r++)
  46066. t.materials.push(this.parse(e.materials[r]));
  46067. return t
  46068. }
  46069. },
  46070. n.ObjectLoader = function(e) {
  46071. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  46072. this.texturePath = ""
  46073. }
  46074. ,
  46075. n.ObjectLoader.prototype = {
  46076. constructor: n.ObjectLoader,
  46077. load: function(e, t, i, r) {
  46078. "" === this.texturePath && (this.texturePath = e.substring(0, e.lastIndexOf("/") + 1));
  46079. var o = this
  46080. , a = new n.XHRLoader(o.manager);
  46081. a.load(e, function(e) {
  46082. o.parse(JSON.parse(e), t)
  46083. }, i, r)
  46084. },
  46085. setTexturePath: function(e) {
  46086. this.texturePath = e
  46087. },
  46088. setCrossOrigin: function(e) {
  46089. this.crossOrigin = e
  46090. },
  46091. parse: function(e, t) {
  46092. var i = this.parseGeometries(e.geometries)
  46093. , n = this.parseImages(e.images, function() {
  46094. void 0 !== t && t(a)
  46095. })
  46096. , r = this.parseTextures(e.textures, n)
  46097. , o = this.parseMaterials(e.materials, r)
  46098. , a = this.parseObject(e.object, i, o);
  46099. return e.animations && (a.animations = this.parseAnimations(e.animations)),
  46100. void 0 !== e.images && 0 !== e.images.length || void 0 !== t && t(a),
  46101. a
  46102. },
  46103. parseGeometries: function(e) {
  46104. var t = {};
  46105. if (void 0 !== e)
  46106. for (var i = new n.JSONLoader, r = new n.BufferGeometryLoader, o = 0, a = e.length; o < a; o++) {
  46107. var s, l = e[o];
  46108. switch (l.type) {
  46109. case "PlaneGeometry":
  46110. case "PlaneBufferGeometry":
  46111. s = new n[l.type](l.width,l.height,l.widthSegments,l.heightSegments);
  46112. break;
  46113. case "BoxGeometry":
  46114. case "BoxBufferGeometry":
  46115. case "CubeGeometry":
  46116. s = new n[l.type](l.width,l.height,l.depth,l.widthSegments,l.heightSegments,l.depthSegments);
  46117. break;
  46118. case "CircleGeometry":
  46119. case "CircleBufferGeometry":
  46120. s = new n[l.type](l.radius,l.segments,l.thetaStart,l.thetaLength);
  46121. break;
  46122. case "CylinderGeometry":
  46123. case "CylinderBufferGeometry":
  46124. s = new n[l.type](l.radiusTop,l.radiusBottom,l.height,l.radialSegments,l.heightSegments,l.openEnded,l.thetaStart,l.thetaLength);
  46125. break;
  46126. case "SphereGeometry":
  46127. case "SphereBufferGeometry":
  46128. s = new n[l.type](l.radius,l.widthSegments,l.heightSegments,l.phiStart,l.phiLength,l.thetaStart,l.thetaLength);
  46129. break;
  46130. case "DodecahedronGeometry":
  46131. s = new n.DodecahedronGeometry(l.radius,l.detail);
  46132. break;
  46133. case "IcosahedronGeometry":
  46134. s = new n.IcosahedronGeometry(l.radius,l.detail);
  46135. break;
  46136. case "OctahedronGeometry":
  46137. s = new n.OctahedronGeometry(l.radius,l.detail);
  46138. break;
  46139. case "TetrahedronGeometry":
  46140. s = new n.TetrahedronGeometry(l.radius,l.detail);
  46141. break;
  46142. case "RingGeometry":
  46143. case "RingBufferGeometry":
  46144. s = new n[l.type](l.innerRadius,l.outerRadius,l.thetaSegments,l.phiSegments,l.thetaStart,l.thetaLength);
  46145. break;
  46146. case "TorusGeometry":
  46147. case "TorusBufferGeometry":
  46148. s = new n[l.type](l.radius,l.tube,l.radialSegments,l.tubularSegments,l.arc);
  46149. break;
  46150. case "TorusKnotGeometry":
  46151. case "TorusKnotBufferGeometry":
  46152. s = new n[l.type](l.radius,l.tube,l.tubularSegments,l.radialSegments,l.p,l.q);
  46153. break;
  46154. case "LatheGeometry":
  46155. s = new n.LatheGeometry(l.points,l.segments,l.phiStart,l.phiLength);
  46156. break;
  46157. case "BufferGeometry":
  46158. s = r.parse(l);
  46159. break;
  46160. case "Geometry":
  46161. s = i.parse(l.data, this.texturePath).geometry;
  46162. break;
  46163. default:
  46164. console.warn('THREE.ObjectLoader: Unsupported geometry type "' + l.type + '"');
  46165. continue
  46166. }
  46167. s.uuid = l.uuid,
  46168. void 0 !== l.name && (s.name = l.name),
  46169. t[l.uuid] = s
  46170. }
  46171. return t
  46172. },
  46173. parseMaterials: function(e, t) {
  46174. var i = {};
  46175. if (void 0 !== e) {
  46176. var r = new n.MaterialLoader;
  46177. r.setTextures(t);
  46178. for (var o = 0, a = e.length; o < a; o++) {
  46179. var s = r.parse(e[o]);
  46180. i[s.uuid] = s
  46181. }
  46182. }
  46183. return i
  46184. },
  46185. parseAnimations: function(e) {
  46186. for (var t = [], i = 0; i < e.length; i++) {
  46187. var r = n.AnimationClip.parse(e[i]);
  46188. t.push(r)
  46189. }
  46190. return t
  46191. },
  46192. parseImages: function(e, t) {
  46193. function i(e) {
  46194. return r.manager.itemStart(e),
  46195. s.load(e, function() {
  46196. r.manager.itemEnd(e)
  46197. })
  46198. }
  46199. var r = this
  46200. , o = {};
  46201. if (void 0 !== e && e.length > 0) {
  46202. var a = new n.LoadingManager(t)
  46203. , s = new n.ImageLoader(a);
  46204. s.setCrossOrigin(this.crossOrigin);
  46205. for (var l = 0, c = e.length; l < c; l++) {
  46206. var h = e[l]
  46207. , u = /^(\/\/)|([a-z]+:(\/\/)?)/i.test(h.url) ? h.url : r.texturePath + h.url;
  46208. o[h.uuid] = i(u)
  46209. }
  46210. }
  46211. return o
  46212. },
  46213. parseTextures: function(e, t) {
  46214. function i(e) {
  46215. return "number" == typeof e ? e : (console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.", e),
  46216. n[e])
  46217. }
  46218. var r = {};
  46219. if (void 0 !== e)
  46220. for (var o = 0, a = e.length; o < a; o++) {
  46221. var s = e[o];
  46222. void 0 === s.image && console.warn('THREE.ObjectLoader: No "image" specified for', s.uuid),
  46223. void 0 === t[s.image] && console.warn("THREE.ObjectLoader: Undefined image", s.image);
  46224. var l = new n.Texture(t[s.image]);
  46225. l.needsUpdate = !0,
  46226. l.uuid = s.uuid,
  46227. void 0 !== s.name && (l.name = s.name),
  46228. void 0 !== s.mapping && (l.mapping = i(s.mapping)),
  46229. void 0 !== s.offset && (l.offset = new n.Vector2(s.offset[0],s.offset[1])),
  46230. void 0 !== s.repeat && (l.repeat = new n.Vector2(s.repeat[0],s.repeat[1])),
  46231. void 0 !== s.minFilter && (l.minFilter = i(s.minFilter)),
  46232. void 0 !== s.magFilter && (l.magFilter = i(s.magFilter)),
  46233. void 0 !== s.anisotropy && (l.anisotropy = s.anisotropy),
  46234. Array.isArray(s.wrap) && (l.wrapS = i(s.wrap[0]),
  46235. l.wrapT = i(s.wrap[1])),
  46236. r[s.uuid] = l
  46237. }
  46238. return r
  46239. },
  46240. parseObject: function() {
  46241. var e = new n.Matrix4;
  46242. return function(t, i, r) {
  46243. function o(e) {
  46244. return void 0 === i[e] && console.warn("THREE.ObjectLoader: Undefined geometry", e),
  46245. i[e]
  46246. }
  46247. function a(e) {
  46248. if (void 0 !== e)
  46249. return void 0 === r[e] && console.warn("THREE.ObjectLoader: Undefined material", e),
  46250. r[e]
  46251. }
  46252. var s;
  46253. switch (t.type) {
  46254. case "Scene":
  46255. s = new n.Scene;
  46256. break;
  46257. case "PerspectiveCamera":
  46258. s = new n.PerspectiveCamera(t.fov,t.aspect,t.near,t.far);
  46259. break;
  46260. case "OrthographicCamera":
  46261. s = new n.OrthographicCamera(t.left,t.right,t.top,t.bottom,t.near,t.far);
  46262. break;
  46263. case "AmbientLight":
  46264. s = new n.AmbientLight(t.color,t.intensity);
  46265. break;
  46266. case "DirectionalLight":
  46267. s = new n.DirectionalLight(t.color,t.intensity);
  46268. break;
  46269. case "PointLight":
  46270. s = new n.PointLight(t.color,t.intensity,t.distance,t.decay);
  46271. break;
  46272. case "SpotLight":
  46273. s = new n.SpotLight(t.color,t.intensity,t.distance,t.angle,t.penumbra,t.decay);
  46274. break;
  46275. case "HemisphereLight":
  46276. s = new n.HemisphereLight(t.color,t.groundColor,t.intensity);
  46277. break;
  46278. case "Mesh":
  46279. var l = o(t.geometry)
  46280. , c = a(t.material);
  46281. s = l.bones && l.bones.length > 0 ? new n.SkinnedMesh(l,c) : new n.Mesh(l,c);
  46282. break;
  46283. case "LOD":
  46284. s = new n.LOD;
  46285. break;
  46286. case "Line":
  46287. s = new n.Line(o(t.geometry),a(t.material),t.mode);
  46288. break;
  46289. case "PointCloud":
  46290. case "Points":
  46291. s = new n.Points(o(t.geometry),a(t.material));
  46292. break;
  46293. case "Sprite":
  46294. s = new n.Sprite(a(t.material));
  46295. break;
  46296. case "Group":
  46297. s = new n.Group;
  46298. break;
  46299. default:
  46300. s = new n.Object3D
  46301. }
  46302. if (s.uuid = t.uuid,
  46303. void 0 !== t.name && (s.name = t.name),
  46304. void 0 !== t.matrix ? (e.fromArray(t.matrix),
  46305. e.decompose(s.position, s.quaternion, s.scale)) : (void 0 !== t.position && s.position.fromArray(t.position),
  46306. void 0 !== t.rotation && s.rotation.fromArray(t.rotation),
  46307. void 0 !== t.scale && s.scale.fromArray(t.scale)),
  46308. void 0 !== t.castShadow && (s.castShadow = t.castShadow),
  46309. void 0 !== t.receiveShadow && (s.receiveShadow = t.receiveShadow),
  46310. void 0 !== t.visible && (s.visible = t.visible),
  46311. void 0 !== t.userData && (s.userData = t.userData),
  46312. void 0 !== t.children)
  46313. for (var h in t.children)
  46314. s.add(this.parseObject(t.children[h], i, r));
  46315. if ("LOD" === t.type)
  46316. for (var u = t.levels, d = 0; d < u.length; d++) {
  46317. var p = u[d]
  46318. , h = s.getObjectByProperty("uuid", p.object);
  46319. void 0 !== h && s.addLevel(h, p.distance)
  46320. }
  46321. return s
  46322. }
  46323. }()
  46324. },
  46325. n.TextureLoader = function(e) {
  46326. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  46327. }
  46328. ,
  46329. n.TextureLoader.prototype = {
  46330. constructor: n.TextureLoader,
  46331. load: function(e, t, i, r) {
  46332. var o = new n.Texture
  46333. , a = new n.ImageLoader(this.manager);
  46334. return a.setCrossOrigin(this.crossOrigin),
  46335. a.setPath(this.path),
  46336. a.load(e, function(e) {
  46337. o.image = e,
  46338. o.needsUpdate = !0,
  46339. void 0 !== t && t(o)
  46340. }, i, r),
  46341. o
  46342. },
  46343. setCrossOrigin: function(e) {
  46344. this.crossOrigin = e
  46345. },
  46346. setPath: function(e) {
  46347. this.path = e
  46348. }
  46349. },
  46350. n.CubeTextureLoader = function(e) {
  46351. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  46352. }
  46353. ,
  46354. n.CubeTextureLoader.prototype = {
  46355. constructor: n.CubeTextureLoader,
  46356. load: function(e, t, i, r) {
  46357. function o(i) {
  46358. s.load(e[i], function(e) {
  46359. a.images[i] = e,
  46360. l++,
  46361. 6 === l && (a.needsUpdate = !0,
  46362. t && t(a))
  46363. }, void 0, r)
  46364. }
  46365. var a = new n.CubeTexture
  46366. , s = new n.ImageLoader(this.manager);
  46367. s.setCrossOrigin(this.crossOrigin),
  46368. s.setPath(this.path);
  46369. for (var l = 0, c = 0; c < e.length; ++c)
  46370. o(c);
  46371. return a
  46372. },
  46373. setCrossOrigin: function(e) {
  46374. this.crossOrigin = e
  46375. },
  46376. setPath: function(e) {
  46377. this.path = e
  46378. }
  46379. },
  46380. n.DataTextureLoader = n.BinaryTextureLoader = function(e) {
  46381. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  46382. this._parser = null
  46383. }
  46384. ,
  46385. n.BinaryTextureLoader.prototype = {
  46386. constructor: n.BinaryTextureLoader,
  46387. load: function(e, t, i, r) {
  46388. var o = this
  46389. , a = new n.DataTexture
  46390. , s = new n.XHRLoader(this.manager);
  46391. return s.setResponseType("arraybuffer"),
  46392. s.load(e, function(e) {
  46393. var i = o._parser(e);
  46394. i && (void 0 !== i.image ? a.image = i.image : void 0 !== i.data && (a.image.width = i.width,
  46395. a.image.height = i.height,
  46396. a.image.data = i.data),
  46397. a.wrapS = void 0 !== i.wrapS ? i.wrapS : n.ClampToEdgeWrapping,
  46398. a.wrapT = void 0 !== i.wrapT ? i.wrapT : n.ClampToEdgeWrapping,
  46399. a.magFilter = void 0 !== i.magFilter ? i.magFilter : n.LinearFilter,
  46400. a.minFilter = void 0 !== i.minFilter ? i.minFilter : n.LinearMipMapLinearFilter,
  46401. a.anisotropy = void 0 !== i.anisotropy ? i.anisotropy : 1,
  46402. void 0 !== i.format && (a.format = i.format),
  46403. void 0 !== i.type && (a.type = i.type),
  46404. void 0 !== i.mipmaps && (a.mipmaps = i.mipmaps),
  46405. 1 === i.mipmapCount && (a.minFilter = n.LinearFilter),
  46406. a.needsUpdate = !0,
  46407. t && t(a, i))
  46408. }, i, r),
  46409. a
  46410. }
  46411. },
  46412. n.CompressedTextureLoader = function(e) {
  46413. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  46414. this._parser = null
  46415. }
  46416. ;
  46417. n.CompressedTextureLoader.prototype = {
  46418. constructor: n.CompressedTextureLoader,
  46419. load: function(e, t, i, r) {
  46420. function o(o) {
  46421. c.load(e[o], function(e) {
  46422. var i = a._parser(e, !0);
  46423. s[o] = {
  46424. width: i.width,
  46425. height: i.height,
  46426. format: i.format,
  46427. mipmaps: i.mipmaps
  46428. },
  46429. h += 1,
  46430. 6 === h && (1 === i.mipmapCount && (l.minFilter = n.LinearFilter),
  46431. l.format = i.format,
  46432. l.needsUpdate = !0,
  46433. t && t(l))
  46434. }, i, r)
  46435. }
  46436. var a = this
  46437. , s = []
  46438. , l = new n.CompressedTexture;
  46439. l.image = s;
  46440. var c = new n.XHRLoader(this.manager);
  46441. if (c.setPath(this.path),
  46442. c.setResponseType("arraybuffer"),
  46443. Array.isArray(e))
  46444. for (var h = 0, u = 0, d = e.length; u < d; ++u)
  46445. o(u);
  46446. else
  46447. c.load(e, function(e) {
  46448. var i = a._parser(e, !0);
  46449. if (i.isCubemap)
  46450. for (var r = i.mipmaps.length / i.mipmapCount, o = 0; o < r; o++) {
  46451. s[o] = {
  46452. mipmaps: []
  46453. };
  46454. for (var c = 0; c < i.mipmapCount; c++)
  46455. s[o].mipmaps.push(i.mipmaps[o * i.mipmapCount + c]),
  46456. s[o].format = i.format,
  46457. s[o].width = i.width,
  46458. s[o].height = i.height
  46459. }
  46460. else
  46461. l.image.width = i.width,
  46462. l.image.height = i.height,
  46463. l.mipmaps = i.mipmaps;
  46464. 1 === i.mipmapCount && (l.minFilter = n.LinearFilter),
  46465. l.format = i.format,
  46466. l.needsUpdate = !0,
  46467. t && t(l)
  46468. }, i, r);
  46469. return l
  46470. },
  46471. setPath: function(e) {
  46472. this.path = e
  46473. }
  46474. };
  46475. n.Material = function() {
  46476. Object.defineProperty(this, "id", {
  46477. value: n.MaterialIdCount++
  46478. }),
  46479. this.uuid = n.Math.generateUUID(),
  46480. this.name = "",
  46481. this.type = "Material",
  46482. this.side = n.FrontSide,
  46483. this.opacity = 1,
  46484. this.transparent = !1,
  46485. this.blending = n.NormalBlending,
  46486. this.blendSrc = n.SrcAlphaFactor,
  46487. this.blendDst = n.OneMinusSrcAlphaFactor,
  46488. this.blendEquation = n.AddEquation,
  46489. this.blendSrcAlpha = null,
  46490. this.blendDstAlpha = null,
  46491. this.blendEquationAlpha = null,
  46492. this.depthFunc = n.LessEqualDepth,
  46493. this.depthTest = !0,
  46494. this.depthWrite = !0,
  46495. this.colorWrite = !0,
  46496. this.precision = null,
  46497. this.polygonOffset = !1,
  46498. this.polygonOffsetFactor = 0,
  46499. this.polygonOffsetUnits = 0,
  46500. this.alphaTest = 0,
  46501. this.premultipliedAlpha = !1,
  46502. this.overdraw = 0,
  46503. this.visible = !0,
  46504. this._needsUpdate = !0
  46505. }
  46506. ,
  46507. n.Material.prototype = {
  46508. constructor: n.Material,
  46509. get needsUpdate() {
  46510. return this._needsUpdate
  46511. },
  46512. set needsUpdate(e) {
  46513. e === !0 && this.update(),
  46514. this._needsUpdate = e
  46515. },
  46516. setValues: function(e) {
  46517. if (void 0 !== e)
  46518. for (var t in e) {
  46519. var i = e[t];
  46520. if (void 0 !== i) {
  46521. var r = this[t];
  46522. void 0 !== r ? r instanceof n.Color ? r.set(i) : r instanceof n.Vector3 && i instanceof n.Vector3 ? r.copy(i) : "overdraw" === t ? this[t] = Number(i) : this[t] = i : console.warn("THREE." + this.type + ": '" + t + "' is not a property of this material.")
  46523. } else
  46524. console.warn("THREE.Material: '" + t + "' parameter is undefined.")
  46525. }
  46526. },
  46527. toJSON: function(e) {
  46528. function t(e) {
  46529. var t = [];
  46530. for (var i in e) {
  46531. var n = e[i];
  46532. delete n.metadata,
  46533. t.push(n)
  46534. }
  46535. return t
  46536. }
  46537. var i = void 0 === e;
  46538. i && (e = {
  46539. textures: {},
  46540. images: {}
  46541. });
  46542. var r = {
  46543. metadata: {
  46544. version: 4.4,
  46545. type: "Material",
  46546. generator: "Material.toJSON"
  46547. }
  46548. };
  46549. if (r.uuid = this.uuid,
  46550. r.type = this.type,
  46551. "" !== this.name && (r.name = this.name),
  46552. this.color instanceof n.Color && (r.color = this.color.getHex()),
  46553. .5 !== this.roughness && (r.roughness = this.roughness),
  46554. .5 !== this.metalness && (r.metalness = this.metalness),
  46555. this.emissive instanceof n.Color && (r.emissive = this.emissive.getHex()),
  46556. this.specular instanceof n.Color && (r.specular = this.specular.getHex()),
  46557. void 0 !== this.shininess && (r.shininess = this.shininess),
  46558. this.map instanceof n.Texture && (r.map = this.map.toJSON(e).uuid),
  46559. this.alphaMap instanceof n.Texture && (r.alphaMap = this.alphaMap.toJSON(e).uuid),
  46560. this.lightMap instanceof n.Texture && (r.lightMap = this.lightMap.toJSON(e).uuid),
  46561. this.bumpMap instanceof n.Texture && (r.bumpMap = this.bumpMap.toJSON(e).uuid,
  46562. r.bumpScale = this.bumpScale),
  46563. this.normalMap instanceof n.Texture && (r.normalMap = this.normalMap.toJSON(e).uuid,
  46564. r.normalScale = this.normalScale.toArray()),
  46565. this.displacementMap instanceof n.Texture && (r.displacementMap = this.displacementMap.toJSON(e).uuid,
  46566. r.displacementScale = this.displacementScale,
  46567. r.displacementBias = this.displacementBias),
  46568. this.roughnessMap instanceof n.Texture && (r.roughnessMap = this.roughnessMap.toJSON(e).uuid),
  46569. this.metalnessMap instanceof n.Texture && (r.metalnessMap = this.metalnessMap.toJSON(e).uuid),
  46570. this.emissiveMap instanceof n.Texture && (r.emissiveMap = this.emissiveMap.toJSON(e).uuid),
  46571. this.specularMap instanceof n.Texture && (r.specularMap = this.specularMap.toJSON(e).uuid),
  46572. this.envMap instanceof n.Texture && (r.envMap = this.envMap.toJSON(e).uuid,
  46573. r.reflectivity = this.reflectivity),
  46574. void 0 !== this.size && (r.size = this.size),
  46575. void 0 !== this.sizeAttenuation && (r.sizeAttenuation = this.sizeAttenuation),
  46576. void 0 !== this.vertexColors && this.vertexColors !== n.NoColors && (r.vertexColors = this.vertexColors),
  46577. void 0 !== this.shading && this.shading !== n.SmoothShading && (r.shading = this.shading),
  46578. void 0 !== this.blending && this.blending !== n.NormalBlending && (r.blending = this.blending),
  46579. void 0 !== this.side && this.side !== n.FrontSide && (r.side = this.side),
  46580. this.opacity < 1 && (r.opacity = this.opacity),
  46581. this.transparent === !0 && (r.transparent = this.transparent),
  46582. this.alphaTest > 0 && (r.alphaTest = this.alphaTest),
  46583. this.premultipliedAlpha === !0 && (r.premultipliedAlpha = this.premultipliedAlpha),
  46584. this.wireframe === !0 && (r.wireframe = this.wireframe),
  46585. this.wireframeLinewidth > 1 && (r.wireframeLinewidth = this.wireframeLinewidth),
  46586. i) {
  46587. var o = t(e.textures)
  46588. , a = t(e.images);
  46589. o.length > 0 && (r.textures = o),
  46590. a.length > 0 && (r.images = a)
  46591. }
  46592. return r
  46593. },
  46594. clone: function() {
  46595. return (new this.constructor).copy(this)
  46596. },
  46597. copy: function(e) {
  46598. return this.name = e.name,
  46599. this.side = e.side,
  46600. this.opacity = e.opacity,
  46601. this.transparent = e.transparent,
  46602. this.blending = e.blending,
  46603. this.blendSrc = e.blendSrc,
  46604. this.blendDst = e.blendDst,
  46605. this.blendEquation = e.blendEquation,
  46606. this.blendSrcAlpha = e.blendSrcAlpha,
  46607. this.blendDstAlpha = e.blendDstAlpha,
  46608. this.blendEquationAlpha = e.blendEquationAlpha,
  46609. this.depthFunc = e.depthFunc,
  46610. this.depthTest = e.depthTest,
  46611. this.depthWrite = e.depthWrite,
  46612. this.colorWrite = e.colorWrite,
  46613. this.precision = e.precision,
  46614. this.polygonOffset = e.polygonOffset,
  46615. this.polygonOffsetFactor = e.polygonOffsetFactor,
  46616. this.polygonOffsetUnits = e.polygonOffsetUnits,
  46617. this.alphaTest = e.alphaTest,
  46618. this.premultipliedAlpha = e.premultipliedAlpha,
  46619. this.overdraw = e.overdraw,
  46620. this.visible = e.visible,
  46621. this
  46622. },
  46623. update: function() {
  46624. this.dispatchEvent({
  46625. type: "update"
  46626. })
  46627. },
  46628. dispose: function() {
  46629. this.dispatchEvent({
  46630. type: "dispose"
  46631. })
  46632. }
  46633. },
  46634. n.EventDispatcher.prototype.apply(n.Material.prototype),
  46635. n.MaterialIdCount = 0,
  46636. n.LineBasicMaterial = function(e) {
  46637. n.Material.call(this),
  46638. this.type = "LineBasicMaterial",
  46639. this.color = new n.Color(16777215),
  46640. this.linewidth = 1,
  46641. this.linecap = "round",
  46642. this.linejoin = "round",
  46643. this.blending = n.NormalBlending,
  46644. this.vertexColors = n.NoColors,
  46645. this.fog = !0,
  46646. this.setValues(e)
  46647. }
  46648. ,
  46649. n.LineBasicMaterial.prototype = Object.create(n.Material.prototype),
  46650. n.LineBasicMaterial.prototype.constructor = n.LineBasicMaterial,
  46651. n.LineBasicMaterial.prototype.copy = function(e) {
  46652. return n.Material.prototype.copy.call(this, e),
  46653. this.color.copy(e.color),
  46654. this.linewidth = e.linewidth,
  46655. this.linecap = e.linecap,
  46656. this.linejoin = e.linejoin,
  46657. this.vertexColors = e.vertexColors,
  46658. this.fog = e.fog,
  46659. this
  46660. }
  46661. ,
  46662. n.LineDashedMaterial = function(e) {
  46663. n.Material.call(this),
  46664. this.type = "LineDashedMaterial",
  46665. this.color = new n.Color(16777215),
  46666. this.linewidth = 1,
  46667. this.scale = 1,
  46668. this.dashSize = 3,
  46669. this.gapSize = 1,
  46670. this.blending = n.NormalBlending,
  46671. this.vertexColors = n.NoColors,
  46672. this.fog = !0,
  46673. this.setValues(e)
  46674. }
  46675. ,
  46676. n.LineDashedMaterial.prototype = Object.create(n.Material.prototype),
  46677. n.LineDashedMaterial.prototype.constructor = n.LineDashedMaterial,
  46678. n.LineDashedMaterial.prototype.copy = function(e) {
  46679. return n.Material.prototype.copy.call(this, e),
  46680. this.color.copy(e.color),
  46681. this.linewidth = e.linewidth,
  46682. this.scale = e.scale,
  46683. this.dashSize = e.dashSize,
  46684. this.gapSize = e.gapSize,
  46685. this.vertexColors = e.vertexColors,
  46686. this.fog = e.fog,
  46687. this
  46688. }
  46689. ,
  46690. n.MeshBasicMaterial = function(e) {
  46691. n.Material.call(this),
  46692. this.type = "MeshBasicMaterial",
  46693. this.color = new n.Color(16777215),
  46694. this.map = null,
  46695. this.aoMap = null,
  46696. this.aoMapIntensity = 1,
  46697. this.specularMap = null,
  46698. this.alphaMap = null,
  46699. this.envMap = null,
  46700. this.combine = n.MultiplyOperation,
  46701. this.reflectivity = 1,
  46702. this.refractionRatio = .98,
  46703. this.fog = !0,
  46704. this.shading = n.SmoothShading,
  46705. this.blending = n.NormalBlending,
  46706. this.wireframe = !1,
  46707. this.wireframeLinewidth = 1,
  46708. this.wireframeLinecap = "round",
  46709. this.wireframeLinejoin = "round",
  46710. this.vertexColors = n.NoColors,
  46711. this.skinning = !1,
  46712. this.morphTargets = !1,
  46713. this.setValues(e)
  46714. }
  46715. ,
  46716. n.MeshBasicMaterial.prototype = Object.create(n.Material.prototype),
  46717. n.MeshBasicMaterial.prototype.constructor = n.MeshBasicMaterial,
  46718. n.MeshBasicMaterial.prototype.copy = function(e) {
  46719. return n.Material.prototype.copy.call(this, e),
  46720. this.color.copy(e.color),
  46721. this.map = e.map,
  46722. this.aoMap = e.aoMap,
  46723. this.aoMapIntensity = e.aoMapIntensity,
  46724. this.specularMap = e.specularMap,
  46725. this.alphaMap = e.alphaMap,
  46726. this.envMap = e.envMap,
  46727. this.combine = e.combine,
  46728. this.reflectivity = e.reflectivity,
  46729. this.refractionRatio = e.refractionRatio,
  46730. this.fog = e.fog,
  46731. this.shading = e.shading,
  46732. this.wireframe = e.wireframe,
  46733. this.wireframeLinewidth = e.wireframeLinewidth,
  46734. this.wireframeLinecap = e.wireframeLinecap,
  46735. this.wireframeLinejoin = e.wireframeLinejoin,
  46736. this.vertexColors = e.vertexColors,
  46737. this.skinning = e.skinning,
  46738. this.morphTargets = e.morphTargets,
  46739. this
  46740. }
  46741. ,
  46742. n.MeshLambertMaterial = function(e) {
  46743. n.Material.call(this),
  46744. this.type = "MeshLambertMaterial",
  46745. this.color = new n.Color(16777215),
  46746. this.map = null,
  46747. this.lightMap = null,
  46748. this.lightMapIntensity = 1,
  46749. this.aoMap = null,
  46750. this.aoMapIntensity = 1,
  46751. this.emissive = new n.Color(0),
  46752. this.emissiveIntensity = 1,
  46753. this.emissiveMap = null,
  46754. this.specularMap = null,
  46755. this.alphaMap = null,
  46756. this.envMap = null,
  46757. this.combine = n.MultiplyOperation,
  46758. this.reflectivity = 1,
  46759. this.refractionRatio = .98,
  46760. this.fog = !0,
  46761. this.blending = n.NormalBlending,
  46762. this.wireframe = !1,
  46763. this.wireframeLinewidth = 1,
  46764. this.wireframeLinecap = "round",
  46765. this.wireframeLinejoin = "round",
  46766. this.vertexColors = n.NoColors,
  46767. this.skinning = !1,
  46768. this.morphTargets = !1,
  46769. this.morphNormals = !1,
  46770. this.setValues(e)
  46771. }
  46772. ,
  46773. n.MeshLambertMaterial.prototype = Object.create(n.Material.prototype),
  46774. n.MeshLambertMaterial.prototype.constructor = n.MeshLambertMaterial,
  46775. n.MeshLambertMaterial.prototype.copy = function(e) {
  46776. return n.Material.prototype.copy.call(this, e),
  46777. this.color.copy(e.color),
  46778. this.map = e.map,
  46779. this.lightMap = e.lightMap,
  46780. this.lightMapIntensity = e.lightMapIntensity,
  46781. this.aoMap = e.aoMap,
  46782. this.aoMapIntensity = e.aoMapIntensity,
  46783. this.emissive.copy(e.emissive),
  46784. this.emissiveMap = e.emissiveMap,
  46785. this.emissiveIntensity = e.emissiveIntensity,
  46786. this.specularMap = e.specularMap,
  46787. this.alphaMap = e.alphaMap,
  46788. this.envMap = e.envMap,
  46789. this.combine = e.combine,
  46790. this.reflectivity = e.reflectivity,
  46791. this.refractionRatio = e.refractionRatio,
  46792. this.fog = e.fog,
  46793. this.wireframe = e.wireframe,
  46794. this.wireframeLinewidth = e.wireframeLinewidth,
  46795. this.wireframeLinecap = e.wireframeLinecap,
  46796. this.wireframeLinejoin = e.wireframeLinejoin,
  46797. this.vertexColors = e.vertexColors,
  46798. this.skinning = e.skinning,
  46799. this.morphTargets = e.morphTargets,
  46800. this.morphNormals = e.morphNormals,
  46801. this
  46802. }
  46803. ,
  46804. n.MeshPhongMaterial = function(e) {
  46805. n.Material.call(this),
  46806. this.type = "MeshPhongMaterial",
  46807. this.color = new n.Color(16777215),
  46808. this.specular = new n.Color(1118481),
  46809. this.shininess = 30,
  46810. this.map = null,
  46811. this.lightMap = null,
  46812. this.lightMapIntensity = 1,
  46813. this.aoMap = null,
  46814. this.aoMapIntensity = 1,
  46815. this.emissive = new n.Color(0),
  46816. this.emissiveIntensity = 1,
  46817. this.emissiveMap = null,
  46818. this.bumpMap = null,
  46819. this.bumpScale = 1,
  46820. this.normalMap = null,
  46821. this.normalScale = new n.Vector2(1,1),
  46822. this.displacementMap = null,
  46823. this.displacementScale = 1,
  46824. this.displacementBias = 0,
  46825. this.specularMap = null,
  46826. this.alphaMap = null,
  46827. this.envMap = null,
  46828. this.combine = n.MultiplyOperation,
  46829. this.reflectivity = 1,
  46830. this.refractionRatio = .98,
  46831. this.fog = !0,
  46832. this.shading = n.SmoothShading,
  46833. this.blending = n.NormalBlending,
  46834. this.wireframe = !1,
  46835. this.wireframeLinewidth = 1,
  46836. this.wireframeLinecap = "round",
  46837. this.wireframeLinejoin = "round",
  46838. this.vertexColors = n.NoColors,
  46839. this.skinning = !1,
  46840. this.morphTargets = !1,
  46841. this.morphNormals = !1,
  46842. this.setValues(e)
  46843. }
  46844. ,
  46845. n.MeshPhongMaterial.prototype = Object.create(n.Material.prototype),
  46846. n.MeshPhongMaterial.prototype.constructor = n.MeshPhongMaterial,
  46847. n.MeshPhongMaterial.prototype.copy = function(e) {
  46848. return n.Material.prototype.copy.call(this, e),
  46849. this.color.copy(e.color),
  46850. this.specular.copy(e.specular),
  46851. this.shininess = e.shininess,
  46852. this.map = e.map,
  46853. this.lightMap = e.lightMap,
  46854. this.lightMapIntensity = e.lightMapIntensity,
  46855. this.aoMap = e.aoMap,
  46856. this.aoMapIntensity = e.aoMapIntensity,
  46857. this.emissive.copy(e.emissive),
  46858. this.emissiveMap = e.emissiveMap,
  46859. this.emissiveIntensity = e.emissiveIntensity,
  46860. this.bumpMap = e.bumpMap,
  46861. this.bumpScale = e.bumpScale,
  46862. this.normalMap = e.normalMap,
  46863. this.normalScale.copy(e.normalScale),
  46864. this.displacementMap = e.displacementMap,
  46865. this.displacementScale = e.displacementScale,
  46866. this.displacementBias = e.displacementBias,
  46867. this.specularMap = e.specularMap,
  46868. this.alphaMap = e.alphaMap,
  46869. this.envMap = e.envMap,
  46870. this.combine = e.combine,
  46871. this.reflectivity = e.reflectivity,
  46872. this.refractionRatio = e.refractionRatio,
  46873. this.fog = e.fog,
  46874. this.shading = e.shading,
  46875. this.wireframe = e.wireframe,
  46876. this.wireframeLinewidth = e.wireframeLinewidth,
  46877. this.wireframeLinecap = e.wireframeLinecap,
  46878. this.wireframeLinejoin = e.wireframeLinejoin,
  46879. this.vertexColors = e.vertexColors,
  46880. this.skinning = e.skinning,
  46881. this.morphTargets = e.morphTargets,
  46882. this.morphNormals = e.morphNormals,
  46883. this
  46884. }
  46885. ,
  46886. n.MeshStandardMaterial = function(e) {
  46887. n.Material.call(this),
  46888. this.type = "MeshStandardMaterial",
  46889. this.color = new n.Color(16777215),
  46890. this.roughness = .5,
  46891. this.metalness = .5,
  46892. this.map = null,
  46893. this.lightMap = null,
  46894. this.lightMapIntensity = 1,
  46895. this.aoMap = null,
  46896. this.aoMapIntensity = 1,
  46897. this.emissive = new n.Color(0),
  46898. this.emissiveIntensity = 1,
  46899. this.emissiveMap = null,
  46900. this.bumpMap = null,
  46901. this.bumpScale = 1,
  46902. this.normalMap = null,
  46903. this.normalScale = new n.Vector2(1,1),
  46904. this.displacementMap = null,
  46905. this.displacementScale = 1,
  46906. this.displacementBias = 0,
  46907. this.roughnessMap = null,
  46908. this.metalnessMap = null,
  46909. this.alphaMap = null,
  46910. this.envMap = null,
  46911. this.envMapIntensity = 1,
  46912. this.refractionRatio = .98,
  46913. this.fog = !0,
  46914. this.shading = n.SmoothShading,
  46915. this.blending = n.NormalBlending,
  46916. this.wireframe = !1,
  46917. this.wireframeLinewidth = 1,
  46918. this.wireframeLinecap = "round",
  46919. this.wireframeLinejoin = "round",
  46920. this.vertexColors = n.NoColors,
  46921. this.skinning = !1,
  46922. this.morphTargets = !1,
  46923. this.morphNormals = !1,
  46924. this.setValues(e)
  46925. }
  46926. ,
  46927. n.MeshStandardMaterial.prototype = Object.create(n.Material.prototype),
  46928. n.MeshStandardMaterial.prototype.constructor = n.MeshStandardMaterial,
  46929. n.MeshStandardMaterial.prototype.copy = function(e) {
  46930. return n.Material.prototype.copy.call(this, e),
  46931. this.color.copy(e.color),
  46932. this.roughness = e.roughness,
  46933. this.metalness = e.metalness,
  46934. this.map = e.map,
  46935. this.lightMap = e.lightMap,
  46936. this.lightMapIntensity = e.lightMapIntensity,
  46937. this.aoMap = e.aoMap,
  46938. this.aoMapIntensity = e.aoMapIntensity,
  46939. this.emissive.copy(e.emissive),
  46940. this.emissiveMap = e.emissiveMap,
  46941. this.emissiveIntensity = e.emissiveIntensity,
  46942. this.bumpMap = e.bumpMap,
  46943. this.bumpScale = e.bumpScale,
  46944. this.normalMap = e.normalMap,
  46945. this.normalScale.copy(e.normalScale),
  46946. this.displacementMap = e.displacementMap,
  46947. this.displacementScale = e.displacementScale,
  46948. this.displacementBias = e.displacementBias,
  46949. this.roughnessMap = e.roughnessMap,
  46950. this.metalnessMap = e.metalnessMap,
  46951. this.alphaMap = e.alphaMap,
  46952. this.envMap = e.envMap,
  46953. this.envMapIntensity = e.envMapIntensity,
  46954. this.refractionRatio = e.refractionRatio,
  46955. this.fog = e.fog,
  46956. this.shading = e.shading,
  46957. this.wireframe = e.wireframe,
  46958. this.wireframeLinewidth = e.wireframeLinewidth,
  46959. this.wireframeLinecap = e.wireframeLinecap,
  46960. this.wireframeLinejoin = e.wireframeLinejoin,
  46961. this.vertexColors = e.vertexColors,
  46962. this.skinning = e.skinning,
  46963. this.morphTargets = e.morphTargets,
  46964. this.morphNormals = e.morphNormals,
  46965. this
  46966. }
  46967. ,
  46968. n.MeshDepthMaterial = function(e) {
  46969. n.Material.call(this),
  46970. this.type = "MeshDepthMaterial",
  46971. this.morphTargets = !1,
  46972. this.wireframe = !1,
  46973. this.wireframeLinewidth = 1,
  46974. this.setValues(e)
  46975. }
  46976. ,
  46977. n.MeshDepthMaterial.prototype = Object.create(n.Material.prototype),
  46978. n.MeshDepthMaterial.prototype.constructor = n.MeshDepthMaterial,
  46979. n.MeshDepthMaterial.prototype.copy = function(e) {
  46980. return n.Material.prototype.copy.call(this, e),
  46981. this.wireframe = e.wireframe,
  46982. this.wireframeLinewidth = e.wireframeLinewidth,
  46983. this
  46984. }
  46985. ,
  46986. n.MeshNormalMaterial = function(e) {
  46987. n.Material.call(this, e),
  46988. this.type = "MeshNormalMaterial",
  46989. this.wireframe = !1,
  46990. this.wireframeLinewidth = 1,
  46991. this.morphTargets = !1,
  46992. this.setValues(e)
  46993. }
  46994. ,
  46995. n.MeshNormalMaterial.prototype = Object.create(n.Material.prototype),
  46996. n.MeshNormalMaterial.prototype.constructor = n.MeshNormalMaterial,
  46997. n.MeshNormalMaterial.prototype.copy = function(e) {
  46998. return n.Material.prototype.copy.call(this, e),
  46999. this.wireframe = e.wireframe,
  47000. this.wireframeLinewidth = e.wireframeLinewidth,
  47001. this
  47002. }
  47003. ,
  47004. n.MultiMaterial = function(e) {
  47005. this.uuid = n.Math.generateUUID(),
  47006. this.type = "MultiMaterial",
  47007. this.materials = e instanceof Array ? e : [],
  47008. this.visible = !0
  47009. }
  47010. ,
  47011. n.MultiMaterial.prototype = {
  47012. constructor: n.MultiMaterial,
  47013. toJSON: function(e) {
  47014. for (var t = {
  47015. metadata: {
  47016. version: 4.2,
  47017. type: "material",
  47018. generator: "MaterialExporter"
  47019. },
  47020. uuid: this.uuid,
  47021. type: this.type,
  47022. materials: []
  47023. }, i = this.materials, n = 0, r = i.length; n < r; n++) {
  47024. var o = i[n].toJSON(e);
  47025. delete o.metadata,
  47026. t.materials.push(o)
  47027. }
  47028. return t.visible = this.visible,
  47029. t
  47030. },
  47031. clone: function() {
  47032. for (var e = new this.constructor, t = 0; t < this.materials.length; t++)
  47033. e.materials.push(this.materials[t].clone());
  47034. return e.visible = this.visible,
  47035. e
  47036. }
  47037. },
  47038. n.PointsMaterial = function(e) {
  47039. n.Material.call(this),
  47040. this.type = "PointsMaterial",
  47041. this.color = new n.Color(16777215),
  47042. this.map = null,
  47043. this.size = 1,
  47044. this.sizeAttenuation = !0,
  47045. this.blending = n.NormalBlending,
  47046. this.vertexColors = n.NoColors,
  47047. this.fog = !0,
  47048. this.setValues(e)
  47049. }
  47050. ,
  47051. n.PointsMaterial.prototype = Object.create(n.Material.prototype),
  47052. n.PointsMaterial.prototype.constructor = n.PointsMaterial,
  47053. n.PointsMaterial.prototype.copy = function(e) {
  47054. return n.Material.prototype.copy.call(this, e),
  47055. this.color.copy(e.color),
  47056. this.map = e.map,
  47057. this.size = e.size,
  47058. this.sizeAttenuation = e.sizeAttenuation,
  47059. this.vertexColors = e.vertexColors,
  47060. this.fog = e.fog,
  47061. this
  47062. }
  47063. ,
  47064. n.ShaderMaterial = function(e) {
  47065. n.Material.call(this),
  47066. this.type = "ShaderMaterial",
  47067. this.defines = {},
  47068. this.uniforms = {},
  47069. this.vertexShader = "void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",
  47070. this.fragmentShader = "void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",
  47071. this.shading = n.SmoothShading,
  47072. this.linewidth = 1,
  47073. this.wireframe = !1,
  47074. this.wireframeLinewidth = 1,
  47075. this.fog = !1,
  47076. this.lights = !1,
  47077. this.vertexColors = n.NoColors,
  47078. this.skinning = !1,
  47079. this.morphTargets = !1,
  47080. this.morphNormals = !1,
  47081. this.extensions = {
  47082. derivatives: !1,
  47083. fragDepth: !1,
  47084. drawBuffers: !1,
  47085. shaderTextureLOD: !1
  47086. },
  47087. this.defaultAttributeValues = {
  47088. color: [1, 1, 1],
  47089. uv: [0, 0],
  47090. uv2: [0, 0]
  47091. },
  47092. this.index0AttributeName = void 0,
  47093. void 0 !== e && (void 0 !== e.attributes && console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),
  47094. this.setValues(e))
  47095. }
  47096. ,
  47097. n.ShaderMaterial.prototype = Object.create(n.Material.prototype),
  47098. n.ShaderMaterial.prototype.constructor = n.ShaderMaterial,
  47099. n.ShaderMaterial.prototype.copy = function(e) {
  47100. return n.Material.prototype.copy.call(this, e),
  47101. this.fragmentShader = e.fragmentShader,
  47102. this.vertexShader = e.vertexShader,
  47103. this.uniforms = n.UniformsUtils.clone(e.uniforms),
  47104. this.defines = e.defines,
  47105. this.shading = e.shading,
  47106. this.wireframe = e.wireframe,
  47107. this.wireframeLinewidth = e.wireframeLinewidth,
  47108. this.fog = e.fog,
  47109. this.lights = e.lights,
  47110. this.vertexColors = e.vertexColors,
  47111. this.skinning = e.skinning,
  47112. this.morphTargets = e.morphTargets,
  47113. this.morphNormals = e.morphNormals,
  47114. this.extensions = e.extensions,
  47115. this
  47116. }
  47117. ,
  47118. n.ShaderMaterial.prototype.toJSON = function(e) {
  47119. var t = n.Material.prototype.toJSON.call(this, e);
  47120. return t.uniforms = this.uniforms,
  47121. t.vertexShader = this.vertexShader,
  47122. t.fragmentShader = this.fragmentShader,
  47123. t
  47124. }
  47125. ,
  47126. n.RawShaderMaterial = function(e) {
  47127. n.ShaderMaterial.call(this, e),
  47128. this.type = "RawShaderMaterial"
  47129. }
  47130. ,
  47131. n.RawShaderMaterial.prototype = Object.create(n.ShaderMaterial.prototype),
  47132. n.RawShaderMaterial.prototype.constructor = n.RawShaderMaterial,
  47133. n.SpriteMaterial = function(e) {
  47134. n.Material.call(this),
  47135. this.type = "SpriteMaterial",
  47136. this.color = new n.Color(16777215),
  47137. this.map = null,
  47138. this.rotation = 0,
  47139. this.fog = !1,
  47140. this.setValues(e)
  47141. }
  47142. ,
  47143. n.SpriteMaterial.prototype = Object.create(n.Material.prototype),
  47144. n.SpriteMaterial.prototype.constructor = n.SpriteMaterial,
  47145. n.SpriteMaterial.prototype.copy = function(e) {
  47146. return n.Material.prototype.copy.call(this, e),
  47147. this.color.copy(e.color),
  47148. this.map = e.map,
  47149. this.rotation = e.rotation,
  47150. this.fog = e.fog,
  47151. this
  47152. }
  47153. ,
  47154. n.Texture = function(e, t, i, r, o, a, s, l, c) {
  47155. Object.defineProperty(this, "id", {
  47156. value: n.TextureIdCount++
  47157. }),
  47158. this.uuid = n.Math.generateUUID(),
  47159. this.name = "",
  47160. this.sourceFile = "",
  47161. this.image = void 0 !== e ? e : n.Texture.DEFAULT_IMAGE,
  47162. this.mipmaps = [],
  47163. this.mapping = void 0 !== t ? t : n.Texture.DEFAULT_MAPPING,
  47164. this.wrapS = void 0 !== i ? i : n.ClampToEdgeWrapping,
  47165. this.wrapT = void 0 !== r ? r : n.ClampToEdgeWrapping,
  47166. this.magFilter = void 0 !== o ? o : n.LinearFilter,
  47167. this.minFilter = void 0 !== a ? a : n.LinearMipMapLinearFilter,
  47168. this.anisotropy = void 0 !== c ? c : 1,
  47169. this.format = void 0 !== s ? s : n.RGBAFormat,
  47170. this.type = void 0 !== l ? l : n.UnsignedByteType,
  47171. this.offset = new n.Vector2(0,0),
  47172. this.repeat = new n.Vector2(1,1),
  47173. this.generateMipmaps = !0,
  47174. this.premultiplyAlpha = !1,
  47175. this.flipY = !0,
  47176. this.unpackAlignment = 4,
  47177. this.encoding = n.LinearEncoding,
  47178. this.version = 0,
  47179. this.onUpdate = null
  47180. }
  47181. ,
  47182. n.Texture.DEFAULT_IMAGE = void 0,
  47183. n.Texture.DEFAULT_MAPPING = n.UVMapping,
  47184. n.Texture.prototype = {
  47185. constructor: n.Texture,
  47186. set needsUpdate(e) {
  47187. e === !0 && this.version++
  47188. },
  47189. clone: function() {
  47190. return (new this.constructor).copy(this)
  47191. },
  47192. copy: function(e) {
  47193. return this.image = e.image,
  47194. this.mipmaps = e.mipmaps.slice(0),
  47195. this.mapping = e.mapping,
  47196. this.wrapS = e.wrapS,
  47197. this.wrapT = e.wrapT,
  47198. this.magFilter = e.magFilter,
  47199. this.minFilter = e.minFilter,
  47200. this.anisotropy = e.anisotropy,
  47201. this.format = e.format,
  47202. this.type = e.type,
  47203. this.offset.copy(e.offset),
  47204. this.repeat.copy(e.repeat),
  47205. this.generateMipmaps = e.generateMipmaps,
  47206. this.premultiplyAlpha = e.premultiplyAlpha,
  47207. this.flipY = e.flipY,
  47208. this.unpackAlignment = e.unpackAlignment,
  47209. this.encoding = e.encoding,
  47210. this
  47211. },
  47212. toJSON: function(e) {
  47213. function t(e) {
  47214. var t;
  47215. return void 0 !== e.toDataURL ? t = e : (t = document.createElement("canvas"),
  47216. t.width = e.width,
  47217. t.height = e.height,
  47218. t.getContext("2d").drawImage(e, 0, 0, e.width, e.height)),
  47219. t.width > 2048 || t.height > 2048 ? t.toDataURL("image/jpeg", .6) : t.toDataURL("image/png")
  47220. }
  47221. if (void 0 !== e.textures[this.uuid])
  47222. return e.textures[this.uuid];
  47223. var i = {
  47224. metadata: {
  47225. version: 4.4,
  47226. type: "Texture",
  47227. generator: "Texture.toJSON"
  47228. },
  47229. uuid: this.uuid,
  47230. name: this.name,
  47231. mapping: this.mapping,
  47232. repeat: [this.repeat.x, this.repeat.y],
  47233. offset: [this.offset.x, this.offset.y],
  47234. wrap: [this.wrapS, this.wrapT],
  47235. minFilter: this.minFilter,
  47236. magFilter: this.magFilter,
  47237. anisotropy: this.anisotropy
  47238. };
  47239. if (void 0 !== this.image) {
  47240. var r = this.image;
  47241. void 0 === r.uuid && (r.uuid = n.Math.generateUUID()),
  47242. void 0 === e.images[r.uuid] && (e.images[r.uuid] = {
  47243. uuid: r.uuid,
  47244. url: t(r)
  47245. }),
  47246. i.image = r.uuid
  47247. }
  47248. return e.textures[this.uuid] = i,
  47249. i
  47250. },
  47251. dispose: function() {
  47252. this.dispatchEvent({
  47253. type: "dispose"
  47254. })
  47255. },
  47256. transformUv: function(e) {
  47257. if (this.mapping === n.UVMapping) {
  47258. if (e.multiply(this.repeat),
  47259. e.add(this.offset),
  47260. e.x < 0 || e.x > 1)
  47261. switch (this.wrapS) {
  47262. case n.RepeatWrapping:
  47263. e.x = e.x - Math.floor(e.x);
  47264. break;
  47265. case n.ClampToEdgeWrapping:
  47266. e.x = e.x < 0 ? 0 : 1;
  47267. break;
  47268. case n.MirroredRepeatWrapping:
  47269. 1 === Math.abs(Math.floor(e.x) % 2) ? e.x = Math.ceil(e.x) - e.x : e.x = e.x - Math.floor(e.x)
  47270. }
  47271. if (e.y < 0 || e.y > 1)
  47272. switch (this.wrapT) {
  47273. case n.RepeatWrapping:
  47274. e.y = e.y - Math.floor(e.y);
  47275. break;
  47276. case n.ClampToEdgeWrapping:
  47277. e.y = e.y < 0 ? 0 : 1;
  47278. break;
  47279. case n.MirroredRepeatWrapping:
  47280. 1 === Math.abs(Math.floor(e.y) % 2) ? e.y = Math.ceil(e.y) - e.y : e.y = e.y - Math.floor(e.y)
  47281. }
  47282. this.flipY && (e.y = 1 - e.y)
  47283. }
  47284. }
  47285. },
  47286. n.EventDispatcher.prototype.apply(n.Texture.prototype),
  47287. n.TextureIdCount = 0,
  47288. n.CanvasTexture = function(e, t, i, r, o, a, s, l, c) {
  47289. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  47290. this.needsUpdate = !0
  47291. }
  47292. ,
  47293. n.CanvasTexture.prototype = Object.create(n.Texture.prototype),
  47294. n.CanvasTexture.prototype.constructor = n.CanvasTexture,
  47295. n.CubeTexture = function(e, t, i, r, o, a, s, l, c) {
  47296. e = void 0 !== e ? e : [],
  47297. t = void 0 !== t ? t : n.CubeReflectionMapping,
  47298. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  47299. this.flipY = !1
  47300. }
  47301. ,
  47302. n.CubeTexture.prototype = Object.create(n.Texture.prototype),
  47303. n.CubeTexture.prototype.constructor = n.CubeTexture,
  47304. Object.defineProperty(n.CubeTexture.prototype, "images", {
  47305. get: function() {
  47306. return this.image
  47307. },
  47308. set: function(e) {
  47309. this.image = e
  47310. }
  47311. }),
  47312. n.CompressedTexture = function(e, t, i, r, o, a, s, l, c, h, u) {
  47313. n.Texture.call(this, null, a, s, l, c, h, r, o, u),
  47314. this.image = {
  47315. width: t,
  47316. height: i
  47317. },
  47318. this.mipmaps = e,
  47319. this.flipY = !1,
  47320. this.generateMipmaps = !1
  47321. }
  47322. ,
  47323. n.CompressedTexture.prototype = Object.create(n.Texture.prototype),
  47324. n.CompressedTexture.prototype.constructor = n.CompressedTexture,
  47325. n.DataTexture = function(e, t, i, r, o, a, s, l, c, h, u) {
  47326. n.Texture.call(this, null, a, s, l, c, h, r, o, u),
  47327. this.image = {
  47328. data: e,
  47329. width: t,
  47330. height: i
  47331. },
  47332. this.magFilter = void 0 !== c ? c : n.NearestFilter,
  47333. this.minFilter = void 0 !== h ? h : n.NearestFilter,
  47334. this.flipY = !1,
  47335. this.generateMipmaps = !1
  47336. }
  47337. ,
  47338. n.DataTexture.prototype = Object.create(n.Texture.prototype),
  47339. n.DataTexture.prototype.constructor = n.DataTexture,
  47340. n.VideoTexture = function(e, t, i, r, o, a, s, l, c) {
  47341. function h() {
  47342. requestAnimationFrame(h),
  47343. e.readyState === e.HAVE_ENOUGH_DATA && (u.needsUpdate = !0)
  47344. }
  47345. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  47346. this.generateMipmaps = !1;
  47347. var u = this;
  47348. h()
  47349. }
  47350. ,
  47351. n.VideoTexture.prototype = Object.create(n.Texture.prototype),
  47352. n.VideoTexture.prototype.constructor = n.VideoTexture,
  47353. n.Group = function() {
  47354. n.Object3D.call(this),
  47355. this.type = "Group"
  47356. }
  47357. ,
  47358. n.Group.prototype = Object.create(n.Object3D.prototype),
  47359. n.Group.prototype.constructor = n.Group,
  47360. n.Points = function(e, t) {
  47361. n.Object3D.call(this),
  47362. this.type = "Points",
  47363. this.geometry = void 0 !== e ? e : new n.Geometry,
  47364. this.material = void 0 !== t ? t : new n.PointsMaterial({
  47365. color: 16777215 * Math.random()
  47366. })
  47367. }
  47368. ,
  47369. n.Points.prototype = Object.create(n.Object3D.prototype),
  47370. n.Points.prototype.constructor = n.Points,
  47371. n.Points.prototype.raycast = function() {
  47372. var e = new n.Matrix4
  47373. , t = new n.Ray
  47374. , i = new n.Sphere;
  47375. return function(r, o) {
  47376. function a(e, i) {
  47377. var n = t.distanceSqToPoint(e);
  47378. if (n < d) {
  47379. var a = t.closestPointToPoint(e);
  47380. a.applyMatrix4(c);
  47381. var l = r.ray.origin.distanceTo(a);
  47382. if (l < r.near || l > r.far)
  47383. return;
  47384. o.push({
  47385. distance: l,
  47386. distanceToRay: Math.sqrt(n),
  47387. point: a.clone(),
  47388. index: i,
  47389. face: null,
  47390. object: s
  47391. })
  47392. }
  47393. }
  47394. var s = this
  47395. , l = this.geometry
  47396. , c = this.matrixWorld
  47397. , h = r.params.Points.threshold;
  47398. if (null === l.boundingSphere && l.computeBoundingSphere(),
  47399. i.copy(l.boundingSphere),
  47400. i.applyMatrix4(c),
  47401. r.ray.intersectsSphere(i) !== !1) {
  47402. e.getInverse(c),
  47403. t.copy(r.ray).applyMatrix4(e);
  47404. var u = h / ((this.scale.x + this.scale.y + this.scale.z) / 3)
  47405. , d = u * u
  47406. , p = new n.Vector3;
  47407. if (l instanceof n.BufferGeometry) {
  47408. var f = l.index
  47409. , g = l.attributes
  47410. , m = g.position.array;
  47411. if (null !== f)
  47412. for (var v = f.array, A = 0, y = v.length; A < y; A++) {
  47413. var C = v[A];
  47414. p.fromArray(m, 3 * C),
  47415. a(p, C)
  47416. }
  47417. else
  47418. for (var A = 0, I = m.length / 3; A < I; A++)
  47419. p.fromArray(m, 3 * A),
  47420. a(p, A)
  47421. } else
  47422. for (var E = l.vertices, A = 0, I = E.length; A < I; A++)
  47423. a(E[A], A)
  47424. }
  47425. }
  47426. }(),
  47427. n.Points.prototype.clone = function() {
  47428. return new this.constructor(this.geometry,this.material).copy(this)
  47429. }
  47430. ,
  47431. n.Line = function(e, t, i) {
  47432. return 1 === i ? (console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),
  47433. new n.LineSegments(e,t)) : (n.Object3D.call(this),
  47434. this.type = "Line",
  47435. this.geometry = void 0 !== e ? e : new n.Geometry,
  47436. void (this.material = void 0 !== t ? t : new n.LineBasicMaterial({
  47437. color: 16777215 * Math.random()
  47438. })))
  47439. }
  47440. ,
  47441. n.Line.prototype = Object.create(n.Object3D.prototype),
  47442. n.Line.prototype.constructor = n.Line,
  47443. n.Line.prototype.raycast = function() {
  47444. var e = new n.Matrix4
  47445. , t = new n.Ray
  47446. , i = new n.Sphere;
  47447. return function(r, o) {
  47448. var a = r.linePrecision
  47449. , s = a * a
  47450. , l = this.geometry
  47451. , c = this.matrixWorld;
  47452. if (null === l.boundingSphere && l.computeBoundingSphere(),
  47453. i.copy(l.boundingSphere),
  47454. i.applyMatrix4(c),
  47455. r.ray.intersectsSphere(i) !== !1) {
  47456. e.getInverse(c),
  47457. t.copy(r.ray).applyMatrix4(e);
  47458. var h = new n.Vector3
  47459. , u = new n.Vector3
  47460. , d = new n.Vector3
  47461. , p = new n.Vector3
  47462. , f = this instanceof n.LineSegments ? 2 : 1;
  47463. if (l instanceof n.BufferGeometry) {
  47464. var g = l.index
  47465. , m = l.attributes
  47466. , v = m.position.array;
  47467. if (null !== g)
  47468. for (var A = g.array, y = 0, C = A.length - 1; y < C; y += f) {
  47469. var I = A[y]
  47470. , E = A[y + 1];
  47471. h.fromArray(v, 3 * I),
  47472. u.fromArray(v, 3 * E);
  47473. var b = t.distanceSqToSegment(h, u, p, d);
  47474. if (!(b > s)) {
  47475. p.applyMatrix4(this.matrixWorld);
  47476. var w = r.ray.origin.distanceTo(p);
  47477. w < r.near || w > r.far || o.push({
  47478. distance: w,
  47479. point: d.clone().applyMatrix4(this.matrixWorld),
  47480. index: y,
  47481. face: null,
  47482. faceIndex: null,
  47483. object: this
  47484. })
  47485. }
  47486. }
  47487. else
  47488. for (var y = 0, C = v.length / 3 - 1; y < C; y += f) {
  47489. h.fromArray(v, 3 * y),
  47490. u.fromArray(v, 3 * y + 3);
  47491. var b = t.distanceSqToSegment(h, u, p, d);
  47492. if (!(b > s)) {
  47493. p.applyMatrix4(this.matrixWorld);
  47494. var w = r.ray.origin.distanceTo(p);
  47495. w < r.near || w > r.far || o.push({
  47496. distance: w,
  47497. point: d.clone().applyMatrix4(this.matrixWorld),
  47498. index: y,
  47499. face: null,
  47500. faceIndex: null,
  47501. object: this
  47502. })
  47503. }
  47504. }
  47505. } else if (l instanceof n.Geometry)
  47506. for (var _ = l.vertices, T = _.length, y = 0; y < T - 1; y += f) {
  47507. var b = t.distanceSqToSegment(_[y], _[y + 1], p, d);
  47508. if (!(b > s)) {
  47509. p.applyMatrix4(this.matrixWorld);
  47510. var w = r.ray.origin.distanceTo(p);
  47511. w < r.near || w > r.far || o.push({
  47512. distance: w,
  47513. point: d.clone().applyMatrix4(this.matrixWorld),
  47514. index: y,
  47515. face: null,
  47516. faceIndex: null,
  47517. object: this
  47518. })
  47519. }
  47520. }
  47521. }
  47522. }
  47523. }(),
  47524. n.Line.prototype.clone = function() {
  47525. return new this.constructor(this.geometry,this.material).copy(this)
  47526. }
  47527. ,
  47528. n.LineStrip = 0,
  47529. n.LinePieces = 1,
  47530. n.LineSegments = function(e, t) {
  47531. n.Line.call(this, e, t),
  47532. this.type = "LineSegments"
  47533. }
  47534. ,
  47535. n.LineSegments.prototype = Object.create(n.Line.prototype),
  47536. n.LineSegments.prototype.constructor = n.LineSegments,
  47537. n.Mesh = function(e, t) {
  47538. n.Object3D.call(this),
  47539. this.type = "Mesh",
  47540. this.geometry = void 0 !== e ? e : new n.Geometry,
  47541. this.material = void 0 !== t ? t : new n.MeshBasicMaterial({
  47542. color: 16777215 * Math.random()
  47543. }),
  47544. this.drawMode = n.TrianglesDrawMode,
  47545. this.updateMorphTargets()
  47546. }
  47547. ,
  47548. n.Mesh.prototype = Object.create(n.Object3D.prototype),
  47549. n.Mesh.prototype.constructor = n.Mesh,
  47550. n.Mesh.prototype.setDrawMode = function(e) {
  47551. this.drawMode = e
  47552. }
  47553. ,
  47554. n.Mesh.prototype.updateMorphTargets = function() {
  47555. if (void 0 !== this.geometry.morphTargets && this.geometry.morphTargets.length > 0) {
  47556. this.morphTargetBase = -1,
  47557. this.morphTargetInfluences = [],
  47558. this.morphTargetDictionary = {};
  47559. for (var e = 0, t = this.geometry.morphTargets.length; e < t; e++)
  47560. this.morphTargetInfluences.push(0),
  47561. this.morphTargetDictionary[this.geometry.morphTargets[e].name] = e
  47562. }
  47563. }
  47564. ,
  47565. n.Mesh.prototype.getMorphTargetIndexByName = function(e) {
  47566. return void 0 !== this.morphTargetDictionary[e] ? this.morphTargetDictionary[e] : (console.warn("THREE.Mesh.getMorphTargetIndexByName: morph target " + e + " does not exist. Returning 0."),
  47567. 0)
  47568. }
  47569. ,
  47570. n.Mesh.prototype.raycast = function() {
  47571. function e(e, t, i, r, o, a, s) {
  47572. return n.Triangle.barycoordFromPoint(e, t, i, r, m),
  47573. o.multiplyScalar(m.x),
  47574. a.multiplyScalar(m.y),
  47575. s.multiplyScalar(m.z),
  47576. o.add(a).add(s),
  47577. o.clone()
  47578. }
  47579. function t(e, t, i, r, o, a, s) {
  47580. var l, c = e.material;
  47581. if (l = c.side === n.BackSide ? i.intersectTriangle(a, o, r, !0, s) : i.intersectTriangle(r, o, a, c.side !== n.DoubleSide, s),
  47582. null === l)
  47583. return null;
  47584. A.copy(s),
  47585. A.applyMatrix4(e.matrixWorld);
  47586. var h = t.ray.origin.distanceTo(A);
  47587. return h < t.near || h > t.far ? null : {
  47588. distance: h,
  47589. point: A.clone(),
  47590. object: e
  47591. }
  47592. }
  47593. function i(i, r, o, a, h, u, d, m) {
  47594. s.fromArray(a, 3 * u),
  47595. l.fromArray(a, 3 * d),
  47596. c.fromArray(a, 3 * m);
  47597. var A = t(i, r, o, s, l, c, v);
  47598. return A && (h && (p.fromArray(h, 2 * u),
  47599. f.fromArray(h, 2 * d),
  47600. g.fromArray(h, 2 * m),
  47601. A.uv = e(v, s, l, c, p, f, g)),
  47602. A.face = new n.Face3(u,d,m,n.Triangle.normal(s, l, c)),
  47603. A.faceIndex = u),
  47604. A
  47605. }
  47606. var r = new n.Matrix4
  47607. , o = new n.Ray
  47608. , a = new n.Sphere
  47609. , s = new n.Vector3
  47610. , l = new n.Vector3
  47611. , c = new n.Vector3
  47612. , h = new n.Vector3
  47613. , u = new n.Vector3
  47614. , d = new n.Vector3
  47615. , p = new n.Vector2
  47616. , f = new n.Vector2
  47617. , g = new n.Vector2
  47618. , m = new n.Vector3
  47619. , v = new n.Vector3
  47620. , A = new n.Vector3;
  47621. return function(m, A) {
  47622. var y = this.geometry
  47623. , C = this.material
  47624. , I = this.matrixWorld;
  47625. if (void 0 !== C && (null === y.boundingSphere && y.computeBoundingSphere(),
  47626. a.copy(y.boundingSphere),
  47627. a.applyMatrix4(I),
  47628. m.ray.intersectsSphere(a) !== !1 && (r.getInverse(I),
  47629. o.copy(m.ray).applyMatrix4(r),
  47630. null === y.boundingBox || o.intersectsBox(y.boundingBox) !== !1))) {
  47631. var E, b;
  47632. if (y instanceof n.BufferGeometry) {
  47633. var w, _, T, x = y.index, S = y.attributes, M = S.position.array;
  47634. if (void 0 !== S.uv && (E = S.uv.array),
  47635. null !== x)
  47636. for (var R = x.array, P = 0, O = R.length; P < O; P += 3)
  47637. w = R[P],
  47638. _ = R[P + 1],
  47639. T = R[P + 2],
  47640. b = i(this, m, o, M, E, w, _, T),
  47641. b && (b.faceIndex = Math.floor(P / 3),
  47642. A.push(b));
  47643. else
  47644. for (var P = 0, O = M.length; P < O; P += 9)
  47645. w = P / 3,
  47646. _ = w + 1,
  47647. T = w + 2,
  47648. b = i(this, m, o, M, E, w, _, T),
  47649. b && (b.index = w,
  47650. A.push(b))
  47651. } else if (y instanceof n.Geometry) {
  47652. var L, D, N, B = C instanceof n.MultiMaterial, F = B === !0 ? C.materials : null, V = y.vertices, U = y.faces, k = y.faceVertexUvs[0];
  47653. k.length > 0 && (E = k);
  47654. for (var H = 0, G = U.length; H < G; H++) {
  47655. var z = U[H]
  47656. , W = B === !0 ? F[z.materialIndex] : C;
  47657. if (void 0 !== W) {
  47658. if (L = V[z.a],
  47659. D = V[z.b],
  47660. N = V[z.c],
  47661. W.morphTargets === !0) {
  47662. var j = y.morphTargets
  47663. , Y = this.morphTargetInfluences;
  47664. s.set(0, 0, 0),
  47665. l.set(0, 0, 0),
  47666. c.set(0, 0, 0);
  47667. for (var X = 0, Z = j.length; X < Z; X++) {
  47668. var q = Y[X];
  47669. if (0 !== q) {
  47670. var K = j[X].vertices;
  47671. s.addScaledVector(h.subVectors(K[z.a], L), q),
  47672. l.addScaledVector(u.subVectors(K[z.b], D), q),
  47673. c.addScaledVector(d.subVectors(K[z.c], N), q)
  47674. }
  47675. }
  47676. s.add(L),
  47677. l.add(D),
  47678. c.add(N),
  47679. L = s,
  47680. D = l,
  47681. N = c
  47682. }
  47683. if (b = t(this, m, o, L, D, N, v)) {
  47684. if (E) {
  47685. var Q = E[H];
  47686. p.copy(Q[0]),
  47687. f.copy(Q[1]),
  47688. g.copy(Q[2]),
  47689. b.uv = e(v, L, D, N, p, f, g)
  47690. }
  47691. b.face = z,
  47692. b.faceIndex = H,
  47693. A.push(b)
  47694. }
  47695. }
  47696. }
  47697. }
  47698. }
  47699. }
  47700. }(),
  47701. n.Mesh.prototype.clone = function() {
  47702. return new this.constructor(this.geometry,this.material).copy(this)
  47703. }
  47704. ,
  47705. n.Bone = function(e) {
  47706. n.Object3D.call(this),
  47707. this.type = "Bone",
  47708. this.skin = e
  47709. }
  47710. ,
  47711. n.Bone.prototype = Object.create(n.Object3D.prototype),
  47712. n.Bone.prototype.constructor = n.Bone,
  47713. n.Bone.prototype.copy = function(e) {
  47714. return n.Object3D.prototype.copy.call(this, e),
  47715. this.skin = e.skin,
  47716. this
  47717. }
  47718. ,
  47719. n.Skeleton = function(e, t, i) {
  47720. if (this.useVertexTexture = void 0 === i || i,
  47721. this.identityMatrix = new n.Matrix4,
  47722. e = e || [],
  47723. this.bones = e.slice(0),
  47724. this.useVertexTexture) {
  47725. var r = Math.sqrt(4 * this.bones.length);
  47726. r = n.Math.nextPowerOfTwo(Math.ceil(r)),
  47727. r = Math.max(r, 4),
  47728. this.boneTextureWidth = r,
  47729. this.boneTextureHeight = r,
  47730. this.boneMatrices = new Float32Array(this.boneTextureWidth * this.boneTextureHeight * 4),
  47731. this.boneTexture = new n.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,n.RGBAFormat,n.FloatType)
  47732. } else
  47733. this.boneMatrices = new Float32Array(16 * this.bones.length);
  47734. if (void 0 === t)
  47735. this.calculateInverses();
  47736. else if (this.bones.length === t.length)
  47737. this.boneInverses = t.slice(0);
  47738. else {
  47739. console.warn("THREE.Skeleton bonInverses is the wrong length."),
  47740. this.boneInverses = [];
  47741. for (var o = 0, a = this.bones.length; o < a; o++)
  47742. this.boneInverses.push(new n.Matrix4)
  47743. }
  47744. }
  47745. ,
  47746. n.Skeleton.prototype.calculateInverses = function() {
  47747. this.boneInverses = [];
  47748. for (var e = 0, t = this.bones.length; e < t; e++) {
  47749. var i = new n.Matrix4;
  47750. this.bones[e] && i.getInverse(this.bones[e].matrixWorld),
  47751. this.boneInverses.push(i)
  47752. }
  47753. }
  47754. ,
  47755. n.Skeleton.prototype.pose = function() {
  47756. for (var e, t = 0, i = this.bones.length; t < i; t++)
  47757. e = this.bones[t],
  47758. e && e.matrixWorld.getInverse(this.boneInverses[t]);
  47759. for (var t = 0, i = this.bones.length; t < i; t++)
  47760. e = this.bones[t],
  47761. e && (e.parent ? (e.matrix.getInverse(e.parent.matrixWorld),
  47762. e.matrix.multiply(e.matrixWorld)) : e.matrix.copy(e.matrixWorld),
  47763. e.matrix.decompose(e.position, e.quaternion, e.scale));
  47764. }
  47765. ,
  47766. n.Skeleton.prototype.update = function() {
  47767. var e = new n.Matrix4;
  47768. return function() {
  47769. for (var t = 0, i = this.bones.length; t < i; t++) {
  47770. var n = this.bones[t] ? this.bones[t].matrixWorld : this.identityMatrix;
  47771. e.multiplyMatrices(n, this.boneInverses[t]),
  47772. e.flattenToArrayOffset(this.boneMatrices, 16 * t)
  47773. }
  47774. this.useVertexTexture && (this.boneTexture.needsUpdate = !0)
  47775. }
  47776. }(),
  47777. n.Skeleton.prototype.clone = function() {
  47778. return new n.Skeleton(this.bones,this.boneInverses,this.useVertexTexture)
  47779. }
  47780. ,
  47781. n.SkinnedMesh = function(e, t, i) {
  47782. n.Mesh.call(this, e, t),
  47783. this.type = "SkinnedMesh",
  47784. this.bindMode = "attached",
  47785. this.bindMatrix = new n.Matrix4,
  47786. this.bindMatrixInverse = new n.Matrix4;
  47787. var r = [];
  47788. if (this.geometry && void 0 !== this.geometry.bones) {
  47789. for (var o, a, s = 0, l = this.geometry.bones.length; s < l; ++s)
  47790. a = this.geometry.bones[s],
  47791. o = new n.Bone(this),
  47792. r.push(o),
  47793. o.name = a.name,
  47794. o.position.fromArray(a.pos),
  47795. o.quaternion.fromArray(a.rotq),
  47796. void 0 !== a.scl && o.scale.fromArray(a.scl);
  47797. for (var s = 0, l = this.geometry.bones.length; s < l; ++s)
  47798. a = this.geometry.bones[s],
  47799. a.parent !== -1 && null !== a.parent ? r[a.parent].add(r[s]) : this.add(r[s])
  47800. }
  47801. this.normalizeSkinWeights(),
  47802. this.updateMatrixWorld(!0),
  47803. this.bind(new n.Skeleton(r,void 0,i), this.matrixWorld)
  47804. }
  47805. ,
  47806. n.SkinnedMesh.prototype = Object.create(n.Mesh.prototype),
  47807. n.SkinnedMesh.prototype.constructor = n.SkinnedMesh,
  47808. n.SkinnedMesh.prototype.bind = function(e, t) {
  47809. this.skeleton = e,
  47810. void 0 === t && (this.updateMatrixWorld(!0),
  47811. this.skeleton.calculateInverses(),
  47812. t = this.matrixWorld),
  47813. this.bindMatrix.copy(t),
  47814. this.bindMatrixInverse.getInverse(t)
  47815. }
  47816. ,
  47817. n.SkinnedMesh.prototype.pose = function() {
  47818. this.skeleton.pose()
  47819. }
  47820. ,
  47821. n.SkinnedMesh.prototype.normalizeSkinWeights = function() {
  47822. if (this.geometry instanceof n.Geometry)
  47823. for (var e = 0; e < this.geometry.skinWeights.length; e++) {
  47824. var t = this.geometry.skinWeights[e]
  47825. , i = 1 / t.lengthManhattan();
  47826. i !== 1 / 0 ? t.multiplyScalar(i) : t.set(1, 0, 0, 0)
  47827. }
  47828. else if (this.geometry instanceof n.BufferGeometry)
  47829. for (var r = new n.Vector4, o = this.geometry.attributes.skinWeight, e = 0; e < o.count; e++) {
  47830. r.x = o.getX(e),
  47831. r.y = o.getY(e),
  47832. r.z = o.getZ(e),
  47833. r.w = o.getW(e);
  47834. var i = 1 / r.lengthManhattan();
  47835. i !== 1 / 0 ? r.multiplyScalar(i) : r.set(1, 0, 0, 0),
  47836. o.setXYZW(e, r.x, r.y, r.z, r.w)
  47837. }
  47838. }
  47839. ,
  47840. n.SkinnedMesh.prototype.updateMatrixWorld = function(e) {
  47841. n.Mesh.prototype.updateMatrixWorld.call(this, !0),
  47842. "attached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.matrixWorld) : "detached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.bindMatrix) : console.warn("THREE.SkinnedMesh unrecognized bindMode: " + this.bindMode)
  47843. }
  47844. ,
  47845. n.SkinnedMesh.prototype.clone = function() {
  47846. return new this.constructor(this.geometry,this.material,this.useVertexTexture).copy(this)
  47847. }
  47848. ,
  47849. n.LOD = function() {
  47850. n.Object3D.call(this),
  47851. this.type = "LOD",
  47852. Object.defineProperties(this, {
  47853. levels: {
  47854. enumerable: !0,
  47855. value: []
  47856. },
  47857. objects: {
  47858. get: function() {
  47859. return console.warn("THREE.LOD: .objects has been renamed to .levels."),
  47860. this.levels
  47861. }
  47862. }
  47863. })
  47864. }
  47865. ,
  47866. n.LOD.prototype = Object.create(n.Object3D.prototype),
  47867. n.LOD.prototype.constructor = n.LOD,
  47868. n.LOD.prototype.addLevel = function(e, t) {
  47869. void 0 === t && (t = 0),
  47870. t = Math.abs(t);
  47871. for (var i = this.levels, n = 0; n < i.length && !(t < i[n].distance); n++)
  47872. ;
  47873. i.splice(n, 0, {
  47874. distance: t,
  47875. object: e
  47876. }),
  47877. this.add(e)
  47878. }
  47879. ,
  47880. n.LOD.prototype.getObjectForDistance = function(e) {
  47881. for (var t = this.levels, i = 1, n = t.length; i < n && !(e < t[i].distance); i++)
  47882. ;
  47883. return t[i - 1].object
  47884. }
  47885. ,
  47886. n.LOD.prototype.raycast = function() {
  47887. var e = new n.Vector3;
  47888. return function(t, i) {
  47889. e.setFromMatrixPosition(this.matrixWorld);
  47890. var n = t.ray.origin.distanceTo(e);
  47891. this.getObjectForDistance(n).raycast(t, i)
  47892. }
  47893. }(),
  47894. n.LOD.prototype.update = function() {
  47895. var e = new n.Vector3
  47896. , t = new n.Vector3;
  47897. return function(i) {
  47898. var n = this.levels;
  47899. if (n.length > 1) {
  47900. e.setFromMatrixPosition(i.matrixWorld),
  47901. t.setFromMatrixPosition(this.matrixWorld);
  47902. var r = e.distanceTo(t);
  47903. n[0].object.visible = !0;
  47904. for (var o = 1, a = n.length; o < a && r >= n[o].distance; o++)
  47905. n[o - 1].object.visible = !1,
  47906. n[o].object.visible = !0;
  47907. for (; o < a; o++)
  47908. n[o].object.visible = !1
  47909. }
  47910. }
  47911. }(),
  47912. n.LOD.prototype.copy = function(e) {
  47913. n.Object3D.prototype.copy.call(this, e, !1);
  47914. for (var t = e.levels, i = 0, r = t.length; i < r; i++) {
  47915. var o = t[i];
  47916. this.addLevel(o.object.clone(), o.distance)
  47917. }
  47918. return this
  47919. }
  47920. ,
  47921. n.LOD.prototype.toJSON = function(e) {
  47922. var t = n.Object3D.prototype.toJSON.call(this, e);
  47923. t.object.levels = [];
  47924. for (var i = this.levels, r = 0, o = i.length; r < o; r++) {
  47925. var a = i[r];
  47926. t.object.levels.push({
  47927. object: a.object.uuid,
  47928. distance: a.distance
  47929. })
  47930. }
  47931. return t
  47932. }
  47933. ,
  47934. n.Sprite = function() {
  47935. var e = new Uint16Array([0, 1, 2, 0, 2, 3])
  47936. , t = new Float32Array([-.5, -.5, 0, .5, -.5, 0, .5, .5, 0, -.5, .5, 0])
  47937. , i = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1])
  47938. , r = new n.BufferGeometry;
  47939. return r.setIndex(new n.BufferAttribute(e,1)),
  47940. r.addAttribute("position", new n.BufferAttribute(t,3)),
  47941. r.addAttribute("uv", new n.BufferAttribute(i,2)),
  47942. function(e) {
  47943. n.Object3D.call(this),
  47944. this.type = "Sprite",
  47945. this.geometry = r,
  47946. this.material = void 0 !== e ? e : new n.SpriteMaterial
  47947. }
  47948. }(),
  47949. n.Sprite.prototype = Object.create(n.Object3D.prototype),
  47950. n.Sprite.prototype.constructor = n.Sprite,
  47951. n.Sprite.prototype.raycast = function() {
  47952. var e = new n.Vector3;
  47953. return function(t, i) {
  47954. e.setFromMatrixPosition(this.matrixWorld);
  47955. var n = t.ray.distanceSqToPoint(e)
  47956. , r = this.scale.x * this.scale.y;
  47957. n > r || i.push({
  47958. distance: Math.sqrt(n),
  47959. point: this.position,
  47960. face: null,
  47961. object: this
  47962. })
  47963. }
  47964. }(),
  47965. n.Sprite.prototype.clone = function() {
  47966. return new this.constructor(this.material).copy(this)
  47967. }
  47968. ,
  47969. n.Particle = n.Sprite,
  47970. n.LensFlare = function(e, t, i, r, o) {
  47971. n.Object3D.call(this),
  47972. this.lensFlares = [],
  47973. this.positionScreen = new n.Vector3,
  47974. this.customUpdateCallback = void 0,
  47975. void 0 !== e && this.add(e, t, i, r, o)
  47976. }
  47977. ,
  47978. n.LensFlare.prototype = Object.create(n.Object3D.prototype),
  47979. n.LensFlare.prototype.constructor = n.LensFlare,
  47980. n.LensFlare.prototype.add = function(e, t, i, r, o, a) {
  47981. void 0 === t && (t = -1),
  47982. void 0 === i && (i = 0),
  47983. void 0 === a && (a = 1),
  47984. void 0 === o && (o = new n.Color(16777215)),
  47985. void 0 === r && (r = n.NormalBlending),
  47986. i = Math.min(i, Math.max(0, i)),
  47987. this.lensFlares.push({
  47988. texture: e,
  47989. size: t,
  47990. distance: i,
  47991. x: 0,
  47992. y: 0,
  47993. z: 0,
  47994. scale: 1,
  47995. rotation: 0,
  47996. opacity: a,
  47997. color: o,
  47998. blending: r
  47999. })
  48000. }
  48001. ,
  48002. n.LensFlare.prototype.updateLensFlares = function() {
  48003. var e, t, i = this.lensFlares.length, n = 2 * -this.positionScreen.x, r = 2 * -this.positionScreen.y;
  48004. for (e = 0; e < i; e++)
  48005. t = this.lensFlares[e],
  48006. t.x = this.positionScreen.x + n * t.distance,
  48007. t.y = this.positionScreen.y + r * t.distance,
  48008. t.wantedRotation = t.x * Math.PI * .25,
  48009. t.rotation += .25 * (t.wantedRotation - t.rotation)
  48010. }
  48011. ,
  48012. n.LensFlare.prototype.copy = function(e) {
  48013. n.Object3D.prototype.copy.call(this, e),
  48014. this.positionScreen.copy(e.positionScreen),
  48015. this.customUpdateCallback = e.customUpdateCallback;
  48016. for (var t = 0, i = e.lensFlares.length; t < i; t++)
  48017. this.lensFlares.push(e.lensFlares[t]);
  48018. return this
  48019. }
  48020. ,
  48021. n.Scene = function() {
  48022. n.Object3D.call(this),
  48023. this.type = "Scene",
  48024. this.fog = null,
  48025. this.overrideMaterial = null,
  48026. this.autoUpdate = !0
  48027. }
  48028. ,
  48029. n.Scene.prototype = Object.create(n.Object3D.prototype),
  48030. n.Scene.prototype.constructor = n.Scene,
  48031. n.Scene.prototype.copy = function(e, t) {
  48032. return n.Object3D.prototype.copy.call(this, e, t),
  48033. null !== e.fog && (this.fog = e.fog.clone()),
  48034. null !== e.overrideMaterial && (this.overrideMaterial = e.overrideMaterial.clone()),
  48035. this.autoUpdate = e.autoUpdate,
  48036. this.matrixAutoUpdate = e.matrixAutoUpdate,
  48037. this
  48038. }
  48039. ,
  48040. n.Fog = function(e, t, i) {
  48041. this.name = "",
  48042. this.color = new n.Color(e),
  48043. this.near = void 0 !== t ? t : 1,
  48044. this.far = void 0 !== i ? i : 1e3
  48045. }
  48046. ,
  48047. n.Fog.prototype.clone = function() {
  48048. return new n.Fog(this.color.getHex(),this.near,this.far)
  48049. }
  48050. ,
  48051. n.FogExp2 = function(e, t) {
  48052. this.name = "",
  48053. this.color = new n.Color(e),
  48054. this.density = void 0 !== t ? t : 25e-5
  48055. }
  48056. ,
  48057. n.FogExp2.prototype.clone = function() {
  48058. return new n.FogExp2(this.color.getHex(),this.density)
  48059. }
  48060. ,
  48061. n.ShaderChunk = {},
  48062. n.ShaderChunk.alphamap_fragment = "#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n",
  48063. n.ShaderChunk.alphamap_pars_fragment = "#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n",
  48064. n.ShaderChunk.alphatest_fragment = "#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n",
  48065. n.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",
  48066. n.ShaderChunk.aomap_pars_fragment = "#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",
  48067. n.ShaderChunk.begin_vertex = "\nvec3 transformed = vec3( position );\n",
  48068. n.ShaderChunk.beginnormal_vertex = "\nvec3 objectNormal = vec3( normal );\n",
  48069. n.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",
  48070. n.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",
  48071. n.ShaderChunk.color_fragment = "#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",
  48072. n.ShaderChunk.color_pars_fragment = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n",
  48073. n.ShaderChunk.color_pars_vertex = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",
  48074. n.ShaderChunk.color_vertex = "#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",
  48075. n.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",
  48076. n.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",
  48077. n.ShaderChunk.defaultnormal_vertex = "#ifdef FLIP_SIDED\n\tobjectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n",
  48078. n.ShaderChunk.displacementmap_vertex = "#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n",
  48079. n.ShaderChunk.displacementmap_pars_vertex = "#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n",
  48080. n.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",
  48081. n.ShaderChunk.emissivemap_pars_fragment = "#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n",
  48082. n.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",
  48083. n.ShaderChunk.encodings_fragment = " gl_FragColor = linearToOutputTexel( gl_FragColor );\n",
  48084. n.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",
  48085. n.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",
  48086. n.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",
  48087. n.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",
  48088. n.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",
  48089. n.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",
  48090. n.ShaderChunk.lightmap_fragment = "#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n",
  48091. n.ShaderChunk.lightmap_pars_fragment = "#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",
  48092. n.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",
  48093. n.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",
  48094. n.ShaderChunk.lights_phong_fragment = "BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",
  48095. n.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",
  48096. n.ShaderChunk.lights_phong_pars_vertex = "#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\n",
  48097. n.ShaderChunk.lights_phong_vertex = "#ifdef USE_ENVMAP\n\tvWorldPosition = worldPosition.xyz;\n#endif\n",
  48098. n.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",
  48099. n.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",
  48100. n.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",
  48101. n.ShaderChunk.logdepthbuf_fragment = "#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif",
  48102. n.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",
  48103. n.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",
  48104. n.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",
  48105. n.ShaderChunk.map_fragment = "#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n",
  48106. n.ShaderChunk.map_pars_fragment = "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n",
  48107. n.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",
  48108. n.ShaderChunk.map_particle_pars_fragment = "#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n",
  48109. n.ShaderChunk.metalnessmap_fragment = "float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.r;\n#endif\n",
  48110. n.ShaderChunk.metalnessmap_pars_fragment = "#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",
  48111. n.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",
  48112. n.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";
  48113. n.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";
  48114. n.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",
  48115. n.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",
  48116. n.ShaderChunk.premultiplied_alpha_fragment = "#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n",
  48117. n.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",
  48118. n.ShaderChunk.roughnessmap_fragment = "float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.r;\n#endif\n",
  48119. n.ShaderChunk.roughnessmap_pars_fragment = "#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",
  48120. n.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",
  48121. n.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",
  48122. n.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",
  48123. n.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",
  48124. n.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",
  48125. n.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",
  48126. n.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",
  48127. n.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",
  48128. n.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",
  48129. n.ShaderChunk.specularmap_pars_fragment = "#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",
  48130. n.ShaderChunk.tonemapping_fragment = "#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n",
  48131. n.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",
  48132. n.ShaderChunk.uv2_pars_fragment = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",
  48133. n.ShaderChunk.uv2_pars_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",
  48134. n.ShaderChunk.uv2_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",
  48135. n.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",
  48136. n.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",
  48137. n.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",
  48138. n.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",
  48139. n.UniformsUtils = {
  48140. merge: function(e) {
  48141. for (var t = {}, i = 0; i < e.length; i++) {
  48142. var n = this.clone(e[i]);
  48143. for (var r in n)
  48144. t[r] = n[r]
  48145. }
  48146. return t
  48147. },
  48148. clone: function(e) {
  48149. var t = {};
  48150. for (var i in e) {
  48151. t[i] = {};
  48152. for (var r in e[i]) {
  48153. var o = e[i][r];
  48154. o instanceof n.Color || o instanceof n.Vector2 || o instanceof n.Vector3 || o instanceof n.Vector4 || o instanceof n.Matrix3 || o instanceof n.Matrix4 || o instanceof n.Texture ? t[i][r] = o.clone() : Array.isArray(o) ? t[i][r] = o.slice() : t[i][r] = o
  48155. }
  48156. }
  48157. return t
  48158. }
  48159. },
  48160. n.UniformsLib = {
  48161. common: {
  48162. diffuse: {
  48163. type: "c",
  48164. value: new n.Color(15658734)
  48165. },
  48166. opacity: {
  48167. type: "f",
  48168. value: 1
  48169. },
  48170. map: {
  48171. type: "t",
  48172. value: null
  48173. },
  48174. offsetRepeat: {
  48175. type: "v4",
  48176. value: new n.Vector4(0,0,1,1)
  48177. },
  48178. specularMap: {
  48179. type: "t",
  48180. value: null
  48181. },
  48182. alphaMap: {
  48183. type: "t",
  48184. value: null
  48185. },
  48186. envMap: {
  48187. type: "t",
  48188. value: null
  48189. },
  48190. flipEnvMap: {
  48191. type: "f",
  48192. value: -1
  48193. },
  48194. reflectivity: {
  48195. type: "f",
  48196. value: 1
  48197. },
  48198. refractionRatio: {
  48199. type: "f",
  48200. value: .98
  48201. }
  48202. },
  48203. aomap: {
  48204. aoMap: {
  48205. type: "t",
  48206. value: null
  48207. },
  48208. aoMapIntensity: {
  48209. type: "f",
  48210. value: 1
  48211. }
  48212. },
  48213. lightmap: {
  48214. lightMap: {
  48215. type: "t",
  48216. value: null
  48217. },
  48218. lightMapIntensity: {
  48219. type: "f",
  48220. value: 1
  48221. }
  48222. },
  48223. emissivemap: {
  48224. emissiveMap: {
  48225. type: "t",
  48226. value: null
  48227. }
  48228. },
  48229. bumpmap: {
  48230. bumpMap: {
  48231. type: "t",
  48232. value: null
  48233. },
  48234. bumpScale: {
  48235. type: "f",
  48236. value: 1
  48237. }
  48238. },
  48239. normalmap: {
  48240. normalMap: {
  48241. type: "t",
  48242. value: null
  48243. },
  48244. normalScale: {
  48245. type: "v2",
  48246. value: new n.Vector2(1,1)
  48247. }
  48248. },
  48249. displacementmap: {
  48250. displacementMap: {
  48251. type: "t",
  48252. value: null
  48253. },
  48254. displacementScale: {
  48255. type: "f",
  48256. value: 1
  48257. },
  48258. displacementBias: {
  48259. type: "f",
  48260. value: 0
  48261. }
  48262. },
  48263. roughnessmap: {
  48264. roughnessMap: {
  48265. type: "t",
  48266. value: null
  48267. }
  48268. },
  48269. metalnessmap: {
  48270. metalnessMap: {
  48271. type: "t",
  48272. value: null
  48273. }
  48274. },
  48275. fog: {
  48276. fogDensity: {
  48277. type: "f",
  48278. value: 25e-5
  48279. },
  48280. fogNear: {
  48281. type: "f",
  48282. value: 1
  48283. },
  48284. fogFar: {
  48285. type: "f",
  48286. value: 2e3
  48287. },
  48288. fogColor: {
  48289. type: "c",
  48290. value: new n.Color(16777215)
  48291. }
  48292. },
  48293. lights: {
  48294. ambientLightColor: {
  48295. type: "fv",
  48296. value: []
  48297. },
  48298. directionalLights: {
  48299. type: "sa",
  48300. value: [],
  48301. properties: {
  48302. direction: {
  48303. type: "v3"
  48304. },
  48305. color: {
  48306. type: "c"
  48307. },
  48308. shadow: {
  48309. type: "i"
  48310. },
  48311. shadowBias: {
  48312. type: "f"
  48313. },
  48314. shadowRadius: {
  48315. type: "f"
  48316. },
  48317. shadowMapSize: {
  48318. type: "v2"
  48319. }
  48320. }
  48321. },
  48322. directionalShadowMap: {
  48323. type: "tv",
  48324. value: []
  48325. },
  48326. directionalShadowMatrix: {
  48327. type: "m4v",
  48328. value: []
  48329. },
  48330. spotLights: {
  48331. type: "sa",
  48332. value: [],
  48333. properties: {
  48334. color: {
  48335. type: "c"
  48336. },
  48337. position: {
  48338. type: "v3"
  48339. },
  48340. direction: {
  48341. type: "v3"
  48342. },
  48343. distance: {
  48344. type: "f"
  48345. },
  48346. coneCos: {
  48347. type: "f"
  48348. },
  48349. penumbraCos: {
  48350. type: "f"
  48351. },
  48352. decay: {
  48353. type: "f"
  48354. },
  48355. shadow: {
  48356. type: "i"
  48357. },
  48358. shadowBias: {
  48359. type: "f"
  48360. },
  48361. shadowRadius: {
  48362. type: "f"
  48363. },
  48364. shadowMapSize: {
  48365. type: "v2"
  48366. }
  48367. }
  48368. },
  48369. spotShadowMap: {
  48370. type: "tv",
  48371. value: []
  48372. },
  48373. spotShadowMatrix: {
  48374. type: "m4v",
  48375. value: []
  48376. },
  48377. pointLights: {
  48378. type: "sa",
  48379. value: [],
  48380. properties: {
  48381. color: {
  48382. type: "c"
  48383. },
  48384. position: {
  48385. type: "v3"
  48386. },
  48387. decay: {
  48388. type: "f"
  48389. },
  48390. distance: {
  48391. type: "f"
  48392. },
  48393. shadow: {
  48394. type: "i"
  48395. },
  48396. shadowBias: {
  48397. type: "f"
  48398. },
  48399. shadowRadius: {
  48400. type: "f"
  48401. },
  48402. shadowMapSize: {
  48403. type: "v2"
  48404. }
  48405. }
  48406. },
  48407. pointShadowMap: {
  48408. type: "tv",
  48409. value: []
  48410. },
  48411. pointShadowMatrix: {
  48412. type: "m4v",
  48413. value: []
  48414. },
  48415. hemisphereLights: {
  48416. type: "sa",
  48417. value: [],
  48418. properties: {
  48419. direction: {
  48420. type: "v3"
  48421. },
  48422. skyColor: {
  48423. type: "c"
  48424. },
  48425. groundColor: {
  48426. type: "c"
  48427. }
  48428. }
  48429. }
  48430. },
  48431. points: {
  48432. diffuse: {
  48433. type: "c",
  48434. value: new n.Color(15658734)
  48435. },
  48436. opacity: {
  48437. type: "f",
  48438. value: 1
  48439. },
  48440. size: {
  48441. type: "f",
  48442. value: 1
  48443. },
  48444. scale: {
  48445. type: "f",
  48446. value: 1
  48447. },
  48448. map: {
  48449. type: "t",
  48450. value: null
  48451. },
  48452. offsetRepeat: {
  48453. type: "v4",
  48454. value: new n.Vector4(0,0,1,1)
  48455. }
  48456. }
  48457. },
  48458. n.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",
  48459. n.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",
  48460. n.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",
  48461. n.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",
  48462. n.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",
  48463. n.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",
  48464. n.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",
  48465. n.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",
  48466. n.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",
  48467. n.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",
  48468. n.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",
  48469. n.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",
  48470. n.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",
  48471. n.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",
  48472. n.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",
  48473. n.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",
  48474. n.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",
  48475. n.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",
  48476. n.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",
  48477. n.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",
  48478. n.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",
  48479. n.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",
  48480. n.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",
  48481. n.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",
  48482. n.ShaderLib = {
  48483. basic: {
  48484. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.aomap, n.UniformsLib.fog]),
  48485. vertexShader: n.ShaderChunk.meshbasic_vert,
  48486. fragmentShader: n.ShaderChunk.meshbasic_frag
  48487. },
  48488. lambert: {
  48489. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.aomap, n.UniformsLib.lightmap, n.UniformsLib.emissivemap, n.UniformsLib.fog, n.UniformsLib.lights, {
  48490. emissive: {
  48491. type: "c",
  48492. value: new n.Color(0)
  48493. }
  48494. }]),
  48495. vertexShader: n.ShaderChunk.meshlambert_vert,
  48496. fragmentShader: n.ShaderChunk.meshlambert_frag
  48497. },
  48498. phong: {
  48499. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.aomap, n.UniformsLib.lightmap, n.UniformsLib.emissivemap, n.UniformsLib.bumpmap, n.UniformsLib.normalmap, n.UniformsLib.displacementmap, n.UniformsLib.fog, n.UniformsLib.lights, {
  48500. emissive: {
  48501. type: "c",
  48502. value: new n.Color(0)
  48503. },
  48504. specular: {
  48505. type: "c",
  48506. value: new n.Color(1118481)
  48507. },
  48508. shininess: {
  48509. type: "f",
  48510. value: 30
  48511. }
  48512. }]),
  48513. vertexShader: n.ShaderChunk.meshphong_vert,
  48514. fragmentShader: n.ShaderChunk.meshphong_frag
  48515. },
  48516. standard: {
  48517. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.aomap, n.UniformsLib.lightmap, n.UniformsLib.emissivemap, n.UniformsLib.bumpmap, n.UniformsLib.normalmap, n.UniformsLib.displacementmap, n.UniformsLib.roughnessmap, n.UniformsLib.metalnessmap, n.UniformsLib.fog, n.UniformsLib.lights, {
  48518. emissive: {
  48519. type: "c",
  48520. value: new n.Color(0)
  48521. },
  48522. roughness: {
  48523. type: "f",
  48524. value: .5
  48525. },
  48526. metalness: {
  48527. type: "f",
  48528. value: 0
  48529. },
  48530. envMapIntensity: {
  48531. type: "f",
  48532. value: 1
  48533. }
  48534. }]),
  48535. vertexShader: n.ShaderChunk.meshstandard_vert,
  48536. fragmentShader: n.ShaderChunk.meshstandard_frag
  48537. },
  48538. points: {
  48539. uniforms: n.UniformsUtils.merge([n.UniformsLib.points, n.UniformsLib.fog]),
  48540. vertexShader: n.ShaderChunk.points_vert,
  48541. fragmentShader: n.ShaderChunk.points_frag
  48542. },
  48543. dashed: {
  48544. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.fog, {
  48545. scale: {
  48546. type: "f",
  48547. value: 1
  48548. },
  48549. dashSize: {
  48550. type: "f",
  48551. value: 1
  48552. },
  48553. totalSize: {
  48554. type: "f",
  48555. value: 2
  48556. }
  48557. }]),
  48558. vertexShader: n.ShaderChunk.linedashed_vert,
  48559. fragmentShader: n.ShaderChunk.linedashed_frag
  48560. },
  48561. depth: {
  48562. uniforms: {
  48563. mNear: {
  48564. type: "f",
  48565. value: 1
  48566. },
  48567. mFar: {
  48568. type: "f",
  48569. value: 2e3
  48570. },
  48571. opacity: {
  48572. type: "f",
  48573. value: 1
  48574. }
  48575. },
  48576. vertexShader: n.ShaderChunk.depth_vert,
  48577. fragmentShader: n.ShaderChunk.depth_frag
  48578. },
  48579. normal: {
  48580. uniforms: {
  48581. opacity: {
  48582. type: "f",
  48583. value: 1
  48584. }
  48585. },
  48586. vertexShader: n.ShaderChunk.normal_vert,
  48587. fragmentShader: n.ShaderChunk.normal_frag
  48588. },
  48589. cube: {
  48590. uniforms: {
  48591. tCube: {
  48592. type: "t",
  48593. value: null
  48594. },
  48595. tFlip: {
  48596. type: "f",
  48597. value: -1
  48598. }
  48599. },
  48600. vertexShader: n.ShaderChunk.cube_vert,
  48601. fragmentShader: n.ShaderChunk.cube_frag
  48602. },
  48603. equirect: {
  48604. uniforms: {
  48605. tEquirect: {
  48606. type: "t",
  48607. value: null
  48608. },
  48609. tFlip: {
  48610. type: "f",
  48611. value: -1
  48612. }
  48613. },
  48614. vertexShader: n.ShaderChunk.equirect_vert,
  48615. fragmentShader: n.ShaderChunk.equirect_frag
  48616. },
  48617. depthRGBA: {
  48618. uniforms: {},
  48619. vertexShader: n.ShaderChunk.depthRGBA_vert,
  48620. fragmentShader: n.ShaderChunk.depthRGBA_frag
  48621. },
  48622. distanceRGBA: {
  48623. uniforms: {
  48624. lightPos: {
  48625. type: "v3",
  48626. value: new n.Vector3(0,0,0)
  48627. }
  48628. },
  48629. vertexShader: n.ShaderChunk.distanceRGBA_vert,
  48630. fragmentShader: n.ShaderChunk.distanceRGBA_frag
  48631. }
  48632. },
  48633. n.WebGLRenderer = function(e) {
  48634. function t() {
  48635. return null === ye ? Oe : 1
  48636. }
  48637. function i(e, t, i, n) {
  48638. se === !0 && (e *= n,
  48639. t *= n,
  48640. i *= n),
  48641. Ye.clearColor(e, t, i, n)
  48642. }
  48643. function r() {
  48644. Ye.init(),
  48645. Ye.scissor(we.copy(Le).multiplyScalar(Oe)),
  48646. Ye.viewport(Te.copy(Ne).multiplyScalar(Oe)),
  48647. i(Se.r, Se.g, Se.b, Me)
  48648. }
  48649. function o() {
  48650. Ae = null,
  48651. be = null,
  48652. Ee = "",
  48653. Ie = -1,
  48654. Ye.reset()
  48655. }
  48656. function a(e) {
  48657. e.preventDefault(),
  48658. o(),
  48659. r(),
  48660. Xe.clear()
  48661. }
  48662. function s(e) {
  48663. var t = e.target;
  48664. t.removeEventListener("dispose", s),
  48665. h(t),
  48666. ke.textures--
  48667. }
  48668. function l(e) {
  48669. var t = e.target;
  48670. t.removeEventListener("dispose", l),
  48671. u(t),
  48672. ke.textures--
  48673. }
  48674. function c(e) {
  48675. var t = e.target;
  48676. t.removeEventListener("dispose", c),
  48677. d(t)
  48678. }
  48679. function h(e) {
  48680. var t = Xe.get(e);
  48681. if (e.image && t.__image__webglTextureCube)
  48682. Ge.deleteTexture(t.__image__webglTextureCube);
  48683. else {
  48684. if (void 0 === t.__webglInit)
  48685. return;
  48686. Ge.deleteTexture(t.__webglTexture)
  48687. }
  48688. Xe.delete(e)
  48689. }
  48690. function u(e) {
  48691. var t = Xe.get(e)
  48692. , i = Xe.get(e.texture);
  48693. if (e && void 0 !== i.__webglTexture) {
  48694. if (Ge.deleteTexture(i.__webglTexture),
  48695. e instanceof n.WebGLRenderTargetCube)
  48696. for (var r = 0; r < 6; r++)
  48697. Ge.deleteFramebuffer(t.__webglFramebuffer[r]),
  48698. Ge.deleteRenderbuffer(t.__webglDepthbuffer[r]);
  48699. else
  48700. Ge.deleteFramebuffer(t.__webglFramebuffer),
  48701. Ge.deleteRenderbuffer(t.__webglDepthbuffer);
  48702. Xe.delete(e.texture),
  48703. Xe.delete(e)
  48704. }
  48705. }
  48706. function d(e) {
  48707. p(e),
  48708. Xe.delete(e)
  48709. }
  48710. function p(e) {
  48711. var t = Xe.get(e).program;
  48712. e.program = void 0,
  48713. void 0 !== t && qe.releaseProgram(t)
  48714. }
  48715. function f(e, t, i, r) {
  48716. var o;
  48717. if (i instanceof n.InstancedBufferGeometry && (o = We.get("ANGLE_instanced_arrays"),
  48718. null === o))
  48719. return void console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
  48720. void 0 === r && (r = 0),
  48721. Ye.initAttributes();
  48722. var a = i.attributes
  48723. , s = t.getAttributes()
  48724. , l = e.defaultAttributeValues;
  48725. for (var c in s) {
  48726. var h = s[c];
  48727. if (h >= 0) {
  48728. var u = a[c];
  48729. if (void 0 !== u) {
  48730. var d = u.itemSize
  48731. , p = Ze.getAttributeBuffer(u);
  48732. if (u instanceof n.InterleavedBufferAttribute) {
  48733. var f = u.data
  48734. , g = f.stride
  48735. , m = u.offset;
  48736. f instanceof n.InstancedInterleavedBuffer ? (Ye.enableAttributeAndDivisor(h, f.meshPerAttribute, o),
  48737. void 0 === i.maxInstancedCount && (i.maxInstancedCount = f.meshPerAttribute * f.count)) : Ye.enableAttribute(h),
  48738. Ge.bindBuffer(Ge.ARRAY_BUFFER, p),
  48739. Ge.vertexAttribPointer(h, d, Ge.FLOAT, !1, g * f.array.BYTES_PER_ELEMENT, (r * g + m) * f.array.BYTES_PER_ELEMENT)
  48740. } else
  48741. u instanceof n.InstancedBufferAttribute ? (Ye.enableAttributeAndDivisor(h, u.meshPerAttribute, o),
  48742. void 0 === i.maxInstancedCount && (i.maxInstancedCount = u.meshPerAttribute * u.count)) : Ye.enableAttribute(h),
  48743. Ge.bindBuffer(Ge.ARRAY_BUFFER, p),
  48744. Ge.vertexAttribPointer(h, d, Ge.FLOAT, !1, 0, r * d * 4)
  48745. } else if (void 0 !== l) {
  48746. var v = l[c];
  48747. if (void 0 !== v)
  48748. switch (v.length) {
  48749. case 2:
  48750. Ge.vertexAttrib2fv(h, v);
  48751. break;
  48752. case 3:
  48753. Ge.vertexAttrib3fv(h, v);
  48754. break;
  48755. case 4:
  48756. Ge.vertexAttrib4fv(h, v);
  48757. break;
  48758. default:
  48759. Ge.vertexAttrib1fv(h, v)
  48760. }
  48761. }
  48762. }
  48763. }
  48764. Ye.disableUnusedAttributes()
  48765. }
  48766. function g(e, t) {
  48767. return Math.abs(t[0]) - Math.abs(e[0])
  48768. }
  48769. function m(e, t) {
  48770. 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
  48771. }
  48772. function v(e, t) {
  48773. 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
  48774. }
  48775. function A(e, t, i, n, r) {
  48776. var o, a;
  48777. i.transparent ? (o = de,
  48778. a = ++pe) : (o = he,
  48779. a = ++ue);
  48780. var s = o[a];
  48781. void 0 !== s ? (s.id = e.id,
  48782. s.object = e,
  48783. s.geometry = t,
  48784. s.material = i,
  48785. s.z = Ve.z,
  48786. s.group = r) : (s = {
  48787. id: e.id,
  48788. object: e,
  48789. geometry: t,
  48790. material: i,
  48791. z: Ve.z,
  48792. group: r
  48793. },
  48794. o.push(s))
  48795. }
  48796. function y(e, t) {
  48797. if (e.visible !== !1) {
  48798. if (e.layers.test(t.layers))
  48799. if (e instanceof n.Light)
  48800. ce.push(e);
  48801. else if (e instanceof n.Sprite)
  48802. e.frustumCulled !== !1 && Be.intersectsObject(e) !== !0 || ge.push(e);
  48803. else if (e instanceof n.LensFlare)
  48804. me.push(e);
  48805. else if (e instanceof n.ImmediateRenderObject)
  48806. ve.sortObjects === !0 && (Ve.setFromMatrixPosition(e.matrixWorld),
  48807. Ve.applyProjection(Fe)),
  48808. A(e, null, e.material, Ve.z, null);
  48809. else if ((e instanceof n.Mesh || e instanceof n.Line || e instanceof n.Points) && (e instanceof n.SkinnedMesh && e.skeleton.update(),
  48810. e.frustumCulled === !1 || Be.intersectsObject(e) === !0)) {
  48811. var i = e.material;
  48812. if (i.visible === !0) {
  48813. ve.sortObjects === !0 && (Ve.setFromMatrixPosition(e.matrixWorld),
  48814. Ve.applyProjection(Fe));
  48815. var r = Ze.update(e);
  48816. if (i instanceof n.MultiMaterial)
  48817. for (var o = r.groups, a = i.materials, s = 0, l = o.length; s < l; s++) {
  48818. var c = o[s]
  48819. , h = a[c.materialIndex];
  48820. h.visible === !0 && A(e, r, h, Ve.z, c)
  48821. }
  48822. else
  48823. A(e, r, i, Ve.z, null)
  48824. }
  48825. }
  48826. for (var u = e.children, s = 0, l = u.length; s < l; s++)
  48827. y(u[s], t)
  48828. }
  48829. }
  48830. function C(e, t, i, r) {
  48831. for (var o = 0, a = e.length; o < a; o++) {
  48832. var s = e[o]
  48833. , l = s.object
  48834. , c = s.geometry
  48835. , h = void 0 === r ? s.material : r
  48836. , u = s.group;
  48837. if (l.modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, l.matrixWorld),
  48838. l.normalMatrix.getNormalMatrix(l.modelViewMatrix),
  48839. l instanceof n.ImmediateRenderObject) {
  48840. E(h);
  48841. var d = w(t, i, h, l);
  48842. Ee = "",
  48843. l.render(function(e) {
  48844. ve.renderBufferImmediate(e, d, h)
  48845. })
  48846. } else
  48847. ve.renderBufferDirect(t, i, c, h, l, u)
  48848. }
  48849. }
  48850. function I(e, t, i) {
  48851. var r = Xe.get(e)
  48852. , o = qe.getParameters(e, Ue, t, i)
  48853. , a = qe.getProgramCode(e, o)
  48854. , s = r.program
  48855. , l = !0;
  48856. if (void 0 === s)
  48857. e.addEventListener("dispose", c);
  48858. else if (s.code !== a)
  48859. p(e);
  48860. else {
  48861. if (void 0 !== o.shaderID)
  48862. return;
  48863. l = !1
  48864. }
  48865. if (l) {
  48866. if (o.shaderID) {
  48867. var h = n.ShaderLib[o.shaderID];
  48868. r.__webglShader = {
  48869. name: e.type,
  48870. uniforms: n.UniformsUtils.clone(h.uniforms),
  48871. vertexShader: h.vertexShader,
  48872. fragmentShader: h.fragmentShader
  48873. }
  48874. } else
  48875. r.__webglShader = {
  48876. name: e.type,
  48877. uniforms: e.uniforms,
  48878. vertexShader: e.vertexShader,
  48879. fragmentShader: e.fragmentShader
  48880. };
  48881. e.__webglShader = r.__webglShader,
  48882. s = qe.acquireProgram(e, o, a),
  48883. r.program = s,
  48884. e.program = s
  48885. }
  48886. var u = s.getAttributes();
  48887. if (e.morphTargets) {
  48888. e.numSupportedMorphTargets = 0;
  48889. for (var d = 0; d < ve.maxMorphTargets; d++)
  48890. u["morphTarget" + d] >= 0 && e.numSupportedMorphTargets++
  48891. }
  48892. if (e.morphNormals) {
  48893. e.numSupportedMorphNormals = 0;
  48894. for (var d = 0; d < ve.maxMorphNormals; d++)
  48895. u["morphNormal" + d] >= 0 && e.numSupportedMorphNormals++
  48896. }
  48897. r.uniformsList = [];
  48898. var f = r.__webglShader.uniforms
  48899. , g = r.program.getUniforms();
  48900. for (var m in f) {
  48901. var v = g[m];
  48902. v && r.uniformsList.push([r.__webglShader.uniforms[m], v])
  48903. }
  48904. (e instanceof n.MeshPhongMaterial || e instanceof n.MeshLambertMaterial || e instanceof n.MeshStandardMaterial || e.lights) && (r.lightsHash = Ue.hash,
  48905. f.ambientLightColor.value = Ue.ambient,
  48906. f.directionalLights.value = Ue.directional,
  48907. f.spotLights.value = Ue.spot,
  48908. f.pointLights.value = Ue.point,
  48909. f.hemisphereLights.value = Ue.hemi,
  48910. f.directionalShadowMap.value = Ue.directionalShadowMap,
  48911. f.directionalShadowMatrix.value = Ue.directionalShadowMatrix,
  48912. f.spotShadowMap.value = Ue.spotShadowMap,
  48913. f.spotShadowMatrix.value = Ue.spotShadowMatrix,
  48914. f.pointShadowMap.value = Ue.pointShadowMap,
  48915. f.pointShadowMatrix.value = Ue.pointShadowMatrix),
  48916. r.hasDynamicUniforms = !1;
  48917. for (var A = 0, y = r.uniformsList.length; A < y; A++) {
  48918. var C = r.uniformsList[A][0];
  48919. if (C.dynamic === !0) {
  48920. r.hasDynamicUniforms = !0;
  48921. break
  48922. }
  48923. }
  48924. }
  48925. function E(e) {
  48926. b(e),
  48927. e.transparent === !0 ? Ye.setBlending(e.blending, e.blendEquation, e.blendSrc, e.blendDst, e.blendEquationAlpha, e.blendSrcAlpha, e.blendDstAlpha, e.premultipliedAlpha) : Ye.setBlending(n.NoBlending),
  48928. Ye.setDepthFunc(e.depthFunc),
  48929. Ye.setDepthTest(e.depthTest),
  48930. Ye.setDepthWrite(e.depthWrite),
  48931. Ye.setColorWrite(e.colorWrite),
  48932. Ye.setPolygonOffset(e.polygonOffset, e.polygonOffsetFactor, e.polygonOffsetUnits)
  48933. }
  48934. function b(e) {
  48935. e.side !== n.DoubleSide ? Ye.enable(Ge.CULL_FACE) : Ye.disable(Ge.CULL_FACE),
  48936. Ye.setFlipSided(e.side === n.BackSide)
  48937. }
  48938. function w(e, t, i, r) {
  48939. xe = 0;
  48940. var o = Xe.get(i);
  48941. void 0 === o.program && (i.needsUpdate = !0),
  48942. void 0 !== o.lightsHash && o.lightsHash !== Ue.hash && (i.needsUpdate = !0),
  48943. i.needsUpdate && (I(i, t, r),
  48944. i.needsUpdate = !1);
  48945. var a = !1
  48946. , s = !1
  48947. , l = !1
  48948. , c = o.program
  48949. , h = c.getUniforms()
  48950. , u = o.__webglShader.uniforms;
  48951. if (c.id !== Ae && (Ge.useProgram(c.program),
  48952. Ae = c.id,
  48953. a = !0,
  48954. s = !0,
  48955. l = !0),
  48956. i.id !== Ie && (Ie = i.id,
  48957. s = !0),
  48958. (a || e !== be) && (Ge.uniformMatrix4fv(h.projectionMatrix, !1, e.projectionMatrix.elements),
  48959. je.logarithmicDepthBuffer && Ge.uniform1f(h.logDepthBufFC, 2 / (Math.log(e.far + 1) / Math.LN2)),
  48960. e !== be && (be = e,
  48961. s = !0,
  48962. l = !0),
  48963. (i instanceof n.ShaderMaterial || i instanceof n.MeshPhongMaterial || i instanceof n.MeshStandardMaterial || i.envMap) && void 0 !== h.cameraPosition && (Ve.setFromMatrixPosition(e.matrixWorld),
  48964. Ge.uniform3f(h.cameraPosition, Ve.x, Ve.y, Ve.z)),
  48965. (i instanceof n.MeshPhongMaterial || i instanceof n.MeshLambertMaterial || i instanceof n.MeshBasicMaterial || i instanceof n.MeshStandardMaterial || i instanceof n.ShaderMaterial || i.skinning) && void 0 !== h.viewMatrix && Ge.uniformMatrix4fv(h.viewMatrix, !1, e.matrixWorldInverse.elements),
  48966. void 0 !== h.toneMappingExposure && Ge.uniform1f(h.toneMappingExposure, ve.toneMappingExposure),
  48967. void 0 !== h.toneMappingWhitePoint && Ge.uniform1f(h.toneMappingWhitePoint, ve.toneMappingWhitePoint)),
  48968. i.skinning)
  48969. if (r.bindMatrix && void 0 !== h.bindMatrix && Ge.uniformMatrix4fv(h.bindMatrix, !1, r.bindMatrix.elements),
  48970. r.bindMatrixInverse && void 0 !== h.bindMatrixInverse && Ge.uniformMatrix4fv(h.bindMatrixInverse, !1, r.bindMatrixInverse.elements),
  48971. je.floatVertexTextures && r.skeleton && r.skeleton.useVertexTexture) {
  48972. if (void 0 !== h.boneTexture) {
  48973. var d = B();
  48974. Ge.uniform1i(h.boneTexture, d),
  48975. ve.setTexture(r.skeleton.boneTexture, d)
  48976. }
  48977. void 0 !== h.boneTextureWidth && Ge.uniform1i(h.boneTextureWidth, r.skeleton.boneTextureWidth),
  48978. void 0 !== h.boneTextureHeight && Ge.uniform1i(h.boneTextureHeight, r.skeleton.boneTextureHeight)
  48979. } else
  48980. r.skeleton && r.skeleton.boneMatrices && void 0 !== h.boneGlobalMatrices && Ge.uniformMatrix4fv(h.boneGlobalMatrices, !1, r.skeleton.boneMatrices);
  48981. return s && ((i instanceof n.MeshPhongMaterial || i instanceof n.MeshLambertMaterial || i instanceof n.MeshStandardMaterial || i.lights) && D(u, l),
  48982. t && i.fog && R(u, t),
  48983. (i instanceof n.MeshBasicMaterial || i instanceof n.MeshLambertMaterial || i instanceof n.MeshPhongMaterial || i instanceof n.MeshStandardMaterial) && T(u, i),
  48984. i instanceof n.LineBasicMaterial ? x(u, i) : i instanceof n.LineDashedMaterial ? (x(u, i),
  48985. S(u, i)) : i instanceof n.PointsMaterial ? M(u, i) : i instanceof n.MeshLambertMaterial ? P(u, i) : i instanceof n.MeshPhongMaterial ? O(u, i) : i instanceof n.MeshStandardMaterial ? L(u, i) : i instanceof n.MeshDepthMaterial ? (u.mNear.value = e.near,
  48986. u.mFar.value = e.far,
  48987. u.opacity.value = i.opacity) : i instanceof n.MeshNormalMaterial && (u.opacity.value = i.opacity),
  48988. V(o.uniformsList)),
  48989. N(h, r),
  48990. void 0 !== h.modelMatrix && Ge.uniformMatrix4fv(h.modelMatrix, !1, r.matrixWorld.elements),
  48991. o.hasDynamicUniforms === !0 && _(o.uniformsList, r, e),
  48992. c
  48993. }
  48994. function _(e, t, i) {
  48995. for (var n = [], r = 0, o = e.length; r < o; r++) {
  48996. var a = e[r][0]
  48997. , s = a.onUpdateCallback;
  48998. void 0 !== s && (s.bind(a)(t, i),
  48999. n.push(e[r]))
  49000. }
  49001. V(n)
  49002. }
  49003. function T(e, t) {
  49004. e.opacity.value = t.opacity,
  49005. e.diffuse.value = t.color,
  49006. t.emissive && e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),
  49007. e.map.value = t.map,
  49008. e.specularMap.value = t.specularMap,
  49009. e.alphaMap.value = t.alphaMap,
  49010. t.aoMap && (e.aoMap.value = t.aoMap,
  49011. e.aoMapIntensity.value = t.aoMapIntensity);
  49012. var i;
  49013. if (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),
  49014. void 0 !== i) {
  49015. i instanceof n.WebGLRenderTarget && (i = i.texture);
  49016. var r = i.offset
  49017. , o = i.repeat;
  49018. e.offsetRepeat.value.set(r.x, r.y, o.x, o.y)
  49019. }
  49020. e.envMap.value = t.envMap,
  49021. e.flipEnvMap.value = t.envMap instanceof n.WebGLRenderTargetCube ? 1 : -1,
  49022. e.reflectivity.value = t.reflectivity,
  49023. e.refractionRatio.value = t.refractionRatio
  49024. }
  49025. function x(e, t) {
  49026. e.diffuse.value = t.color,
  49027. e.opacity.value = t.opacity
  49028. }
  49029. function S(e, t) {
  49030. e.dashSize.value = t.dashSize,
  49031. e.totalSize.value = t.dashSize + t.gapSize,
  49032. e.scale.value = t.scale
  49033. }
  49034. function M(e, t) {
  49035. if (e.diffuse.value = t.color,
  49036. e.opacity.value = t.opacity,
  49037. e.size.value = t.size * Oe,
  49038. e.scale.value = te.clientHeight / 2,
  49039. e.map.value = t.map,
  49040. null !== t.map) {
  49041. var i = t.map.offset
  49042. , n = t.map.repeat;
  49043. e.offsetRepeat.value.set(i.x, i.y, n.x, n.y)
  49044. }
  49045. }
  49046. function R(e, t) {
  49047. e.fogColor.value = t.color,
  49048. t instanceof n.Fog ? (e.fogNear.value = t.near,
  49049. e.fogFar.value = t.far) : t instanceof n.FogExp2 && (e.fogDensity.value = t.density)
  49050. }
  49051. function P(e, t) {
  49052. t.lightMap && (e.lightMap.value = t.lightMap,
  49053. e.lightMapIntensity.value = t.lightMapIntensity),
  49054. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap)
  49055. }
  49056. function O(e, t) {
  49057. e.specular.value = t.specular,
  49058. e.shininess.value = Math.max(t.shininess, 1e-4),
  49059. t.lightMap && (e.lightMap.value = t.lightMap,
  49060. e.lightMapIntensity.value = t.lightMapIntensity),
  49061. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  49062. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  49063. e.bumpScale.value = t.bumpScale),
  49064. t.normalMap && (e.normalMap.value = t.normalMap,
  49065. e.normalScale.value.copy(t.normalScale)),
  49066. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  49067. e.displacementScale.value = t.displacementScale,
  49068. e.displacementBias.value = t.displacementBias)
  49069. }
  49070. function L(e, t) {
  49071. e.roughness.value = t.roughness,
  49072. e.metalness.value = t.metalness,
  49073. t.roughnessMap && (e.roughnessMap.value = t.roughnessMap),
  49074. t.metalnessMap && (e.metalnessMap.value = t.metalnessMap),
  49075. t.lightMap && (e.lightMap.value = t.lightMap,
  49076. e.lightMapIntensity.value = t.lightMapIntensity),
  49077. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  49078. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  49079. e.bumpScale.value = t.bumpScale),
  49080. t.normalMap && (e.normalMap.value = t.normalMap,
  49081. e.normalScale.value.copy(t.normalScale)),
  49082. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  49083. e.displacementScale.value = t.displacementScale,
  49084. e.displacementBias.value = t.displacementBias),
  49085. t.envMap && (e.envMapIntensity.value = t.envMapIntensity)
  49086. }
  49087. function D(e, t) {
  49088. e.ambientLightColor.needsUpdate = t,
  49089. e.directionalLights.needsUpdate = t,
  49090. e.pointLights.needsUpdate = t,
  49091. e.spotLights.needsUpdate = t,
  49092. e.hemisphereLights.needsUpdate = t
  49093. }
  49094. function N(e, t) {
  49095. Ge.uniformMatrix4fv(e.modelViewMatrix, !1, t.modelViewMatrix.elements),
  49096. e.normalMatrix && Ge.uniformMatrix3fv(e.normalMatrix, !1, t.normalMatrix.elements)
  49097. }
  49098. function B() {
  49099. var e = xe;
  49100. return e >= je.maxTextures && console.warn("WebGLRenderer: trying to use " + e + " texture units while this GPU supports only " + je.maxTextures),
  49101. xe += 1,
  49102. e
  49103. }
  49104. function F(e, t, i, r) {
  49105. var o, a;
  49106. if ("1i" === t)
  49107. Ge.uniform1i(i, r);
  49108. else if ("1f" === t)
  49109. Ge.uniform1f(i, r);
  49110. else if ("2f" === t)
  49111. Ge.uniform2f(i, r[0], r[1]);
  49112. else if ("3f" === t)
  49113. Ge.uniform3f(i, r[0], r[1], r[2]);
  49114. else if ("4f" === t)
  49115. Ge.uniform4f(i, r[0], r[1], r[2], r[3]);
  49116. else if ("1iv" === t)
  49117. Ge.uniform1iv(i, r);
  49118. else if ("3iv" === t)
  49119. Ge.uniform3iv(i, r);
  49120. else if ("1fv" === t)
  49121. Ge.uniform1fv(i, r);
  49122. else if ("2fv" === t)
  49123. Ge.uniform2fv(i, r);
  49124. else if ("3fv" === t)
  49125. Ge.uniform3fv(i, r);
  49126. else if ("4fv" === t)
  49127. Ge.uniform4fv(i, r);
  49128. else if ("Matrix2fv" === t)
  49129. Ge.uniformMatrix2fv(i, !1, r);
  49130. else if ("Matrix3fv" === t)
  49131. Ge.uniformMatrix3fv(i, !1, r);
  49132. else if ("Matrix4fv" === t)
  49133. Ge.uniformMatrix4fv(i, !1, r);
  49134. else if ("i" === t)
  49135. Ge.uniform1i(i, r);
  49136. else if ("f" === t)
  49137. Ge.uniform1f(i, r);
  49138. else if ("v2" === t)
  49139. Ge.uniform2f(i, r.x, r.y);
  49140. else if ("v3" === t)
  49141. Ge.uniform3f(i, r.x, r.y, r.z);
  49142. else if ("v4" === t)
  49143. Ge.uniform4f(i, r.x, r.y, r.z, r.w);
  49144. else if ("c" === t)
  49145. Ge.uniform3f(i, r.r, r.g, r.b);
  49146. else if ("s" === t) {
  49147. var s = e.properties;
  49148. for (var l in s) {
  49149. var c = s[l]
  49150. , h = i[l]
  49151. , u = r[l];
  49152. F(c, c.type, h, u)
  49153. }
  49154. } else if ("sa" === t)
  49155. for (var s = e.properties, d = 0, p = r.length; d < p; d++)
  49156. for (var l in s) {
  49157. var c = s[l]
  49158. , h = i[d][l]
  49159. , u = r[d][l];
  49160. F(c, c.type, h, u)
  49161. }
  49162. else if ("iv1" === t)
  49163. Ge.uniform1iv(i, r);
  49164. else if ("iv" === t)
  49165. Ge.uniform3iv(i, r);
  49166. else if ("fv1" === t)
  49167. Ge.uniform1fv(i, r);
  49168. else if ("fv" === t)
  49169. Ge.uniform3fv(i, r);
  49170. else if ("v2v" === t) {
  49171. void 0 === e._array && (e._array = new Float32Array(2 * r.length));
  49172. for (var d = 0, f = 0, g = r.length; d < g; d++,
  49173. f += 2)
  49174. e._array[f + 0] = r[d].x,
  49175. e._array[f + 1] = r[d].y;
  49176. Ge.uniform2fv(i, e._array)
  49177. } else if ("v3v" === t) {
  49178. void 0 === e._array && (e._array = new Float32Array(3 * r.length));
  49179. for (var d = 0, m = 0, g = r.length; d < g; d++,
  49180. m += 3)
  49181. e._array[m + 0] = r[d].x,
  49182. e._array[m + 1] = r[d].y,
  49183. e._array[m + 2] = r[d].z;
  49184. Ge.uniform3fv(i, e._array)
  49185. } else if ("v4v" === t) {
  49186. void 0 === e._array && (e._array = new Float32Array(4 * r.length));
  49187. for (var d = 0, v = 0, g = r.length; d < g; d++,
  49188. v += 4)
  49189. e._array[v + 0] = r[d].x,
  49190. e._array[v + 1] = r[d].y,
  49191. e._array[v + 2] = r[d].z,
  49192. e._array[v + 3] = r[d].w;
  49193. Ge.uniform4fv(i, e._array)
  49194. } else if ("m2" === t)
  49195. Ge.uniformMatrix2fv(i, !1, r.elements);
  49196. else if ("m3" === t)
  49197. Ge.uniformMatrix3fv(i, !1, r.elements);
  49198. else if ("m3v" === t) {
  49199. void 0 === e._array && (e._array = new Float32Array(9 * r.length));
  49200. for (var d = 0, g = r.length; d < g; d++)
  49201. r[d].flattenToArrayOffset(e._array, 9 * d);
  49202. Ge.uniformMatrix3fv(i, !1, e._array)
  49203. } else if ("m4" === t)
  49204. Ge.uniformMatrix4fv(i, !1, r.elements);
  49205. else if ("m4v" === t) {
  49206. void 0 === e._array && (e._array = new Float32Array(16 * r.length));
  49207. for (var d = 0, g = r.length; d < g; d++)
  49208. r[d].flattenToArrayOffset(e._array, 16 * d);
  49209. Ge.uniformMatrix4fv(i, !1, e._array)
  49210. } else if ("t" === t) {
  49211. if (o = r,
  49212. a = B(),
  49213. Ge.uniform1i(i, a),
  49214. !o)
  49215. return;
  49216. o instanceof n.CubeTexture || Array.isArray(o.image) && 6 === o.image.length ? Y(o, a) : o instanceof n.WebGLRenderTargetCube ? X(o.texture, a) : o instanceof n.WebGLRenderTarget ? ve.setTexture(o.texture, a) : ve.setTexture(o, a)
  49217. } else if ("tv" === t) {
  49218. void 0 === e._array && (e._array = []);
  49219. for (var d = 0, g = e.value.length; d < g; d++)
  49220. e._array[d] = B();
  49221. Ge.uniform1iv(i, e._array);
  49222. for (var d = 0, g = e.value.length; d < g; d++)
  49223. o = e.value[d],
  49224. a = e._array[d],
  49225. o && (o instanceof n.CubeTexture || o.image instanceof Array && 6 === o.image.length ? Y(o, a) : o instanceof n.WebGLRenderTarget ? ve.setTexture(o.texture, a) : o instanceof n.WebGLRenderTargetCube ? X(o.texture, a) : ve.setTexture(o, a))
  49226. } else
  49227. console.warn("THREE.WebGLRenderer: Unknown uniform type: " + t)
  49228. }
  49229. function V(e) {
  49230. for (var t = 0, i = e.length; t < i; t++) {
  49231. var n = e[t][0];
  49232. if (n.needsUpdate !== !1) {
  49233. var r = n.type
  49234. , o = e[t][1]
  49235. , a = n.value;
  49236. F(n, r, o, a)
  49237. }
  49238. }
  49239. }
  49240. function U(e, t) {
  49241. var i, r, o, a, s, l, c = 0, h = 0, u = 0, d = t.matrixWorldInverse, p = 0, f = 0, g = 0, m = 0, v = 0;
  49242. for (Ue.shadowsPointLight = 0,
  49243. i = 0,
  49244. r = e.length; i < r; i++)
  49245. if (o = e[i],
  49246. a = o.color,
  49247. s = o.intensity,
  49248. l = o.distance,
  49249. o instanceof n.AmbientLight)
  49250. c += a.r * s,
  49251. h += a.g * s,
  49252. u += a.b * s;
  49253. else if (o instanceof n.DirectionalLight) {
  49254. var A = Ke.get(o);
  49255. A.color.copy(o.color).multiplyScalar(o.intensity),
  49256. A.direction.setFromMatrixPosition(o.matrixWorld),
  49257. Ve.setFromMatrixPosition(o.target.matrixWorld),
  49258. A.direction.sub(Ve),
  49259. A.direction.transformDirection(d),
  49260. A.shadow = o.castShadow,
  49261. o.castShadow && (A.shadowBias = o.shadow.bias,
  49262. A.shadowRadius = o.shadow.radius,
  49263. A.shadowMapSize = o.shadow.mapSize,
  49264. Ue.shadows[v++] = o),
  49265. Ue.directionalShadowMap[p] = o.shadow.map,
  49266. Ue.directionalShadowMatrix[p] = o.shadow.matrix,
  49267. Ue.directional[p++] = A
  49268. } else if (o instanceof n.SpotLight) {
  49269. var A = Ke.get(o);
  49270. A.position.setFromMatrixPosition(o.matrixWorld),
  49271. A.position.applyMatrix4(d),
  49272. A.color.copy(a).multiplyScalar(s),
  49273. A.distance = l,
  49274. A.direction.setFromMatrixPosition(o.matrixWorld),
  49275. Ve.setFromMatrixPosition(o.target.matrixWorld),
  49276. A.direction.sub(Ve),
  49277. A.direction.transformDirection(d),
  49278. A.coneCos = Math.cos(o.angle),
  49279. A.penumbraCos = Math.cos(o.angle * (1 - o.penumbra)),
  49280. A.decay = 0 === o.distance ? 0 : o.decay,
  49281. A.shadow = o.castShadow,
  49282. o.castShadow && (A.shadowBias = o.shadow.bias,
  49283. A.shadowRadius = o.shadow.radius,
  49284. A.shadowMapSize = o.shadow.mapSize,
  49285. Ue.shadows[v++] = o),
  49286. Ue.spotShadowMap[g] = o.shadow.map,
  49287. Ue.spotShadowMatrix[g] = o.shadow.matrix,
  49288. Ue.spot[g++] = A
  49289. } else if (o instanceof n.PointLight) {
  49290. var A = Ke.get(o);
  49291. A.position.setFromMatrixPosition(o.matrixWorld),
  49292. A.position.applyMatrix4(d),
  49293. A.color.copy(o.color).multiplyScalar(o.intensity),
  49294. A.distance = o.distance,
  49295. A.decay = 0 === o.distance ? 0 : o.decay,
  49296. A.shadow = o.castShadow,
  49297. o.castShadow && (A.shadowBias = o.shadow.bias,
  49298. A.shadowRadius = o.shadow.radius,
  49299. A.shadowMapSize = o.shadow.mapSize,
  49300. Ue.shadows[v++] = o),
  49301. Ue.pointShadowMap[f] = o.shadow.map,
  49302. void 0 === Ue.pointShadowMatrix[f] && (Ue.pointShadowMatrix[f] = new n.Matrix4),
  49303. Ve.setFromMatrixPosition(o.matrixWorld).negate(),
  49304. Ue.pointShadowMatrix[f].identity().setPosition(Ve),
  49305. Ue.point[f++] = A
  49306. } else if (o instanceof n.HemisphereLight) {
  49307. var A = Ke.get(o);
  49308. A.direction.setFromMatrixPosition(o.matrixWorld),
  49309. A.direction.transformDirection(d),
  49310. A.direction.normalize(),
  49311. A.skyColor.copy(o.color).multiplyScalar(s),
  49312. A.groundColor.copy(o.groundColor).multiplyScalar(s),
  49313. Ue.hemi[m++] = A
  49314. }
  49315. Ue.ambient[0] = c,
  49316. Ue.ambient[1] = h,
  49317. Ue.ambient[2] = u,
  49318. Ue.directional.length = p,
  49319. Ue.spot.length = g,
  49320. Ue.point.length = f,
  49321. Ue.hemi.length = m,
  49322. Ue.shadows.length = v,
  49323. Ue.hash = p + "," + f + "," + g + "," + m + "," + v
  49324. }
  49325. function k(e, t, i) {
  49326. var r;
  49327. if (i ? (Ge.texParameteri(e, Ge.TEXTURE_WRAP_S, ee(t.wrapS)),
  49328. Ge.texParameteri(e, Ge.TEXTURE_WRAP_T, ee(t.wrapT)),
  49329. Ge.texParameteri(e, Ge.TEXTURE_MAG_FILTER, ee(t.magFilter)),
  49330. Ge.texParameteri(e, Ge.TEXTURE_MIN_FILTER, ee(t.minFilter))) : (Ge.texParameteri(e, Ge.TEXTURE_WRAP_S, Ge.CLAMP_TO_EDGE),
  49331. Ge.texParameteri(e, Ge.TEXTURE_WRAP_T, Ge.CLAMP_TO_EDGE),
  49332. t.wrapS === n.ClampToEdgeWrapping && t.wrapT === n.ClampToEdgeWrapping || console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.", t),
  49333. Ge.texParameteri(e, Ge.TEXTURE_MAG_FILTER, $(t.magFilter)),
  49334. Ge.texParameteri(e, Ge.TEXTURE_MIN_FILTER, $(t.minFilter)),
  49335. t.minFilter !== n.NearestFilter && t.minFilter !== n.LinearFilter && console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.", t)),
  49336. r = We.get("EXT_texture_filter_anisotropic")) {
  49337. if (t.type === n.FloatType && null === We.get("OES_texture_float_linear"))
  49338. return;
  49339. if (t.type === n.HalfFloatType && null === We.get("OES_texture_half_float_linear"))
  49340. return;
  49341. (t.anisotropy > 1 || Xe.get(t).__currentAnisotropy) && (Ge.texParameterf(e, r.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(t.anisotropy, ve.getMaxAnisotropy())),
  49342. Xe.get(t).__currentAnisotropy = t.anisotropy)
  49343. }
  49344. }
  49345. function H(e, t, i) {
  49346. void 0 === e.__webglInit && (e.__webglInit = !0,
  49347. t.addEventListener("dispose", s),
  49348. e.__webglTexture = Ge.createTexture(),
  49349. ke.textures++),
  49350. Ye.activeTexture(Ge.TEXTURE0 + i),
  49351. Ye.bindTexture(Ge.TEXTURE_2D, e.__webglTexture),
  49352. Ge.pixelStorei(Ge.UNPACK_FLIP_Y_WEBGL, t.flipY),
  49353. Ge.pixelStorei(Ge.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  49354. Ge.pixelStorei(Ge.UNPACK_ALIGNMENT, t.unpackAlignment);
  49355. var r = G(t.image, je.maxTextureSize);
  49356. W(t) && z(r) === !1 && (r = j(r));
  49357. var o = z(r)
  49358. , a = ee(t.format)
  49359. , l = ee(t.type);
  49360. k(Ge.TEXTURE_2D, t, o);
  49361. var c, h = t.mipmaps;
  49362. if (t instanceof n.DataTexture)
  49363. if (h.length > 0 && o) {
  49364. for (var u = 0, d = h.length; u < d; u++)
  49365. c = h[u],
  49366. Ye.texImage2D(Ge.TEXTURE_2D, u, a, c.width, c.height, 0, a, l, c.data);
  49367. t.generateMipmaps = !1
  49368. } else
  49369. Ye.texImage2D(Ge.TEXTURE_2D, 0, a, r.width, r.height, 0, a, l, r.data);
  49370. else if (t instanceof n.CompressedTexture)
  49371. for (var u = 0, d = h.length; u < d; u++)
  49372. c = h[u],
  49373. t.format !== n.RGBAFormat && t.format !== n.RGBFormat ? Ye.getCompressedTextureFormats().indexOf(a) > -1 ? Ye.compressedTexImage2D(Ge.TEXTURE_2D, u, a, c.width, c.height, 0, c.data) : console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()") : Ye.texImage2D(Ge.TEXTURE_2D, u, a, c.width, c.height, 0, a, l, c.data);
  49374. else if (h.length > 0 && o) {
  49375. for (var u = 0, d = h.length; u < d; u++)
  49376. c = h[u],
  49377. Ye.texImage2D(Ge.TEXTURE_2D, u, a, a, l, c);
  49378. t.generateMipmaps = !1
  49379. } else
  49380. Ye.texImage2D(Ge.TEXTURE_2D, 0, a, a, l, r);
  49381. t.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_2D),
  49382. e.__version = t.version,
  49383. t.onUpdate && t.onUpdate(t)
  49384. }
  49385. function G(e, t) {
  49386. if (e.width > t || e.height > t) {
  49387. var i = t / Math.max(e.width, e.height)
  49388. , n = document.createElement("canvas");
  49389. n.width = Math.floor(e.width * i),
  49390. n.height = Math.floor(e.height * i);
  49391. var r = n.getContext("2d");
  49392. return r.drawImage(e, 0, 0, e.width, e.height, 0, 0, n.width, n.height),
  49393. console.warn("THREE.WebGLRenderer: image is too big (" + e.width + "x" + e.height + "). Resized to " + n.width + "x" + n.height, e),
  49394. n
  49395. }
  49396. return e
  49397. }
  49398. function z(e) {
  49399. return n.Math.isPowerOfTwo(e.width) && n.Math.isPowerOfTwo(e.height)
  49400. }
  49401. function W(e) {
  49402. return e.wrapS !== n.ClampToEdgeWrapping || e.wrapT !== n.ClampToEdgeWrapping || e.minFilter !== n.NearestFilter && e.minFilter !== n.LinearFilter
  49403. }
  49404. function j(e) {
  49405. if (e instanceof HTMLImageElement || e instanceof HTMLCanvasElement) {
  49406. var t = document.createElement("canvas");
  49407. t.width = n.Math.nearestPowerOfTwo(e.width),
  49408. t.height = n.Math.nearestPowerOfTwo(e.height);
  49409. var i = t.getContext("2d");
  49410. return i.drawImage(e, 0, 0, t.width, t.height),
  49411. console.warn("THREE.WebGLRenderer: image is not power of two (" + e.width + "x" + e.height + "). Resized to " + t.width + "x" + t.height, e),
  49412. t
  49413. }
  49414. return e
  49415. }
  49416. function Y(e, t) {
  49417. var i = Xe.get(e);
  49418. if (6 === e.image.length)
  49419. if (e.version > 0 && i.__version !== e.version) {
  49420. i.__image__webglTextureCube || (e.addEventListener("dispose", s),
  49421. i.__image__webglTextureCube = Ge.createTexture(),
  49422. ke.textures++),
  49423. Ye.activeTexture(Ge.TEXTURE0 + t),
  49424. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__image__webglTextureCube),
  49425. Ge.pixelStorei(Ge.UNPACK_FLIP_Y_WEBGL, e.flipY);
  49426. for (var r = e instanceof n.CompressedTexture, o = e.image[0]instanceof n.DataTexture, a = [], l = 0; l < 6; l++)
  49427. !ve.autoScaleCubemaps || r || o ? a[l] = o ? e.image[l].image : e.image[l] : a[l] = G(e.image[l], je.maxCubemapSize);
  49428. var c = a[0]
  49429. , h = z(c)
  49430. , u = ee(e.format)
  49431. , d = ee(e.type);
  49432. k(Ge.TEXTURE_CUBE_MAP, e, h);
  49433. for (var l = 0; l < 6; l++)
  49434. if (r)
  49435. for (var p, f = a[l].mipmaps, g = 0, m = f.length; g < m; g++)
  49436. p = f[g],
  49437. e.format !== n.RGBAFormat && e.format !== n.RGBFormat ? Ye.getCompressedTextureFormats().indexOf(u) > -1 ? Ye.compressedTexImage2D(Ge.TEXTURE_CUBE_MAP_POSITIVE_X + l, g, u, p.width, p.height, 0, p.data) : console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setCubeTexture()") : Ye.texImage2D(Ge.TEXTURE_CUBE_MAP_POSITIVE_X + l, g, u, p.width, p.height, 0, u, d, p.data);
  49438. else
  49439. o ? Ye.texImage2D(Ge.TEXTURE_CUBE_MAP_POSITIVE_X + l, 0, u, a[l].width, a[l].height, 0, u, d, a[l].data) : Ye.texImage2D(Ge.TEXTURE_CUBE_MAP_POSITIVE_X + l, 0, u, u, d, a[l]);
  49440. e.generateMipmaps && h && Ge.generateMipmap(Ge.TEXTURE_CUBE_MAP),
  49441. i.__version = e.version,
  49442. e.onUpdate && e.onUpdate(e)
  49443. } else
  49444. Ye.activeTexture(Ge.TEXTURE0 + t),
  49445. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__image__webglTextureCube)
  49446. }
  49447. function X(e, t) {
  49448. Ye.activeTexture(Ge.TEXTURE0 + t),
  49449. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, Xe.get(e).__webglTexture)
  49450. }
  49451. function Z(e, t, i, n) {
  49452. var r = ee(t.texture.format)
  49453. , o = ee(t.texture.type);
  49454. Ye.texImage2D(n, 0, r, t.width, t.height, 0, r, o, null),
  49455. Ge.bindFramebuffer(Ge.FRAMEBUFFER, e),
  49456. Ge.framebufferTexture2D(Ge.FRAMEBUFFER, i, n, Xe.get(t.texture).__webglTexture, 0),
  49457. Ge.bindFramebuffer(Ge.FRAMEBUFFER, null)
  49458. }
  49459. function q(e, t) {
  49460. Ge.bindRenderbuffer(Ge.RENDERBUFFER, e),
  49461. t.depthBuffer && !t.stencilBuffer ? (Ge.renderbufferStorage(Ge.RENDERBUFFER, Ge.DEPTH_COMPONENT16, t.width, t.height),
  49462. Ge.framebufferRenderbuffer(Ge.FRAMEBUFFER, Ge.DEPTH_ATTACHMENT, Ge.RENDERBUFFER, e)) : t.depthBuffer && t.stencilBuffer ? (Ge.renderbufferStorage(Ge.RENDERBUFFER, Ge.DEPTH_STENCIL, t.width, t.height),
  49463. Ge.framebufferRenderbuffer(Ge.FRAMEBUFFER, Ge.DEPTH_STENCIL_ATTACHMENT, Ge.RENDERBUFFER, e)) : Ge.renderbufferStorage(Ge.RENDERBUFFER, Ge.RGBA4, t.width, t.height),
  49464. Ge.bindRenderbuffer(Ge.RENDERBUFFER, null)
  49465. }
  49466. function K(e) {
  49467. var t = Xe.get(e)
  49468. , i = e instanceof n.WebGLRenderTargetCube;
  49469. if (i) {
  49470. t.__webglDepthbuffer = [];
  49471. for (var r = 0; r < 6; r++)
  49472. Ge.bindFramebuffer(Ge.FRAMEBUFFER, t.__webglFramebuffer[r]),
  49473. t.__webglDepthbuffer[r] = Ge.createRenderbuffer(),
  49474. q(t.__webglDepthbuffer[r], e)
  49475. } else
  49476. Ge.bindFramebuffer(Ge.FRAMEBUFFER, t.__webglFramebuffer),
  49477. t.__webglDepthbuffer = Ge.createRenderbuffer(),
  49478. q(t.__webglDepthbuffer, e);
  49479. Ge.bindFramebuffer(Ge.FRAMEBUFFER, null)
  49480. }
  49481. function Q(e) {
  49482. var t = Xe.get(e)
  49483. , i = Xe.get(e.texture);
  49484. e.addEventListener("dispose", l),
  49485. i.__webglTexture = Ge.createTexture(),
  49486. ke.textures++;
  49487. var r = e instanceof n.WebGLRenderTargetCube
  49488. , o = n.Math.isPowerOfTwo(e.width) && n.Math.isPowerOfTwo(e.height);
  49489. if (r) {
  49490. t.__webglFramebuffer = [];
  49491. for (var a = 0; a < 6; a++)
  49492. t.__webglFramebuffer[a] = Ge.createFramebuffer()
  49493. } else
  49494. t.__webglFramebuffer = Ge.createFramebuffer();
  49495. if (r) {
  49496. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__webglTexture),
  49497. k(Ge.TEXTURE_CUBE_MAP, e.texture, o);
  49498. for (var a = 0; a < 6; a++)
  49499. Z(t.__webglFramebuffer[a], e, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_CUBE_MAP_POSITIVE_X + a);
  49500. e.texture.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_CUBE_MAP),
  49501. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, null)
  49502. } else
  49503. Ye.bindTexture(Ge.TEXTURE_2D, i.__webglTexture),
  49504. k(Ge.TEXTURE_2D, e.texture, o),
  49505. Z(t.__webglFramebuffer, e, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_2D),
  49506. e.texture.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_2D),
  49507. Ye.bindTexture(Ge.TEXTURE_2D, null);
  49508. e.depthBuffer && K(e)
  49509. }
  49510. function J(e) {
  49511. var t = e instanceof n.WebGLRenderTargetCube ? Ge.TEXTURE_CUBE_MAP : Ge.TEXTURE_2D
  49512. , i = Xe.get(e.texture).__webglTexture;
  49513. Ye.bindTexture(t, i),
  49514. Ge.generateMipmap(t),
  49515. Ye.bindTexture(t, null)
  49516. }
  49517. function $(e) {
  49518. return e === n.NearestFilter || e === n.NearestMipMapNearestFilter || e === n.NearestMipMapLinearFilter ? Ge.NEAREST : Ge.LINEAR
  49519. }
  49520. function ee(e) {
  49521. var t;
  49522. if (e === n.RepeatWrapping)
  49523. return Ge.REPEAT;
  49524. if (e === n.ClampToEdgeWrapping)
  49525. return Ge.CLAMP_TO_EDGE;
  49526. if (e === n.MirroredRepeatWrapping)
  49527. return Ge.MIRRORED_REPEAT;
  49528. if (e === n.NearestFilter)
  49529. return Ge.NEAREST;
  49530. if (e === n.NearestMipMapNearestFilter)
  49531. return Ge.NEAREST_MIPMAP_NEAREST;
  49532. if (e === n.NearestMipMapLinearFilter)
  49533. return Ge.NEAREST_MIPMAP_LINEAR;
  49534. if (e === n.LinearFilter)
  49535. return Ge.LINEAR;
  49536. if (e === n.LinearMipMapNearestFilter)
  49537. return Ge.LINEAR_MIPMAP_NEAREST;
  49538. if (e === n.LinearMipMapLinearFilter)
  49539. return Ge.LINEAR_MIPMAP_LINEAR;
  49540. if (e === n.UnsignedByteType)
  49541. return Ge.UNSIGNED_BYTE;
  49542. if (e === n.UnsignedShort4444Type)
  49543. return Ge.UNSIGNED_SHORT_4_4_4_4;
  49544. if (e === n.UnsignedShort5551Type)
  49545. return Ge.UNSIGNED_SHORT_5_5_5_1;
  49546. if (e === n.UnsignedShort565Type)
  49547. return Ge.UNSIGNED_SHORT_5_6_5;
  49548. if (e === n.ByteType)
  49549. return Ge.BYTE;
  49550. if (e === n.ShortType)
  49551. return Ge.SHORT;
  49552. if (e === n.UnsignedShortType)
  49553. return Ge.UNSIGNED_SHORT;
  49554. if (e === n.IntType)
  49555. return Ge.INT;
  49556. if (e === n.UnsignedIntType)
  49557. return Ge.UNSIGNED_INT;
  49558. if (e === n.FloatType)
  49559. return Ge.FLOAT;
  49560. if (t = We.get("OES_texture_half_float"),
  49561. null !== t && e === n.HalfFloatType)
  49562. return t.HALF_FLOAT_OES;
  49563. if (e === n.AlphaFormat)
  49564. return Ge.ALPHA;
  49565. if (e === n.RGBFormat)
  49566. return Ge.RGB;
  49567. if (e === n.RGBAFormat)
  49568. return Ge.RGBA;
  49569. if (e === n.LuminanceFormat)
  49570. return Ge.LUMINANCE;
  49571. if (e === n.LuminanceAlphaFormat)
  49572. return Ge.LUMINANCE_ALPHA;
  49573. if (e === n.AddEquation)
  49574. return Ge.FUNC_ADD;
  49575. if (e === n.SubtractEquation)
  49576. return Ge.FUNC_SUBTRACT;
  49577. if (e === n.ReverseSubtractEquation)
  49578. return Ge.FUNC_REVERSE_SUBTRACT;
  49579. if (e === n.ZeroFactor)
  49580. return Ge.ZERO;
  49581. if (e === n.OneFactor)
  49582. return Ge.ONE;
  49583. if (e === n.SrcColorFactor)
  49584. return Ge.SRC_COLOR;
  49585. if (e === n.OneMinusSrcColorFactor)
  49586. return Ge.ONE_MINUS_SRC_COLOR;
  49587. if (e === n.SrcAlphaFactor)
  49588. return Ge.SRC_ALPHA;
  49589. if (e === n.OneMinusSrcAlphaFactor)
  49590. return Ge.ONE_MINUS_SRC_ALPHA;
  49591. if (e === n.DstAlphaFactor)
  49592. return Ge.DST_ALPHA;
  49593. if (e === n.OneMinusDstAlphaFactor)
  49594. return Ge.ONE_MINUS_DST_ALPHA;
  49595. if (e === n.DstColorFactor)
  49596. return Ge.DST_COLOR;
  49597. if (e === n.OneMinusDstColorFactor)
  49598. return Ge.ONE_MINUS_DST_COLOR;
  49599. if (e === n.SrcAlphaSaturateFactor)
  49600. return Ge.SRC_ALPHA_SATURATE;
  49601. if (t = We.get("WEBGL_compressed_texture_s3tc"),
  49602. null !== t) {
  49603. if (e === n.RGB_S3TC_DXT1_Format)
  49604. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  49605. if (e === n.RGBA_S3TC_DXT1_Format)
  49606. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  49607. if (e === n.RGBA_S3TC_DXT3_Format)
  49608. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  49609. if (e === n.RGBA_S3TC_DXT5_Format)
  49610. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  49611. }
  49612. if (t = We.get("WEBGL_compressed_texture_pvrtc"),
  49613. null !== t) {
  49614. if (e === n.RGB_PVRTC_4BPPV1_Format)
  49615. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  49616. if (e === n.RGB_PVRTC_2BPPV1_Format)
  49617. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  49618. if (e === n.RGBA_PVRTC_4BPPV1_Format)
  49619. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  49620. if (e === n.RGBA_PVRTC_2BPPV1_Format)
  49621. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  49622. }
  49623. if (t = We.get("WEBGL_compressed_texture_etc1"),
  49624. null !== t && e === n.RGB_ETC1_Format)
  49625. return t.COMPRESSED_RGB_ETC1_WEBGL;
  49626. if (t = We.get("EXT_blend_minmax"),
  49627. null !== t) {
  49628. if (e === n.MinEquation)
  49629. return t.MIN_EXT;
  49630. if (e === n.MaxEquation)
  49631. return t.MAX_EXT
  49632. }
  49633. return 0
  49634. }
  49635. console.log("THREE.WebGLRenderer", n.REVISION),
  49636. e = e || {};
  49637. var te = void 0 !== e.canvas ? e.canvas : document.createElement("canvas")
  49638. , ie = void 0 !== e.context ? e.context : null
  49639. , ne = void 0 !== e.alpha && e.alpha
  49640. , re = void 0 === e.depth || e.depth
  49641. , oe = void 0 === e.stencil || e.stencil
  49642. , ae = void 0 !== e.antialias && e.antialias
  49643. , se = void 0 === e.premultipliedAlpha || e.premultipliedAlpha
  49644. , le = void 0 !== e.preserveDrawingBuffer && e.preserveDrawingBuffer
  49645. , ce = []
  49646. , he = []
  49647. , ue = -1
  49648. , de = []
  49649. , pe = -1
  49650. , fe = new Float32Array(8)
  49651. , ge = []
  49652. , me = [];
  49653. this.domElement = te,
  49654. this.context = null,
  49655. this.autoClear = !0,
  49656. this.autoClearColor = !0,
  49657. this.autoClearDepth = !0,
  49658. this.autoClearStencil = !0,
  49659. this.sortObjects = !0,
  49660. this.gammaFactor = 2,
  49661. this.gammaInput = !1,
  49662. this.gammaOutput = !1,
  49663. this.physicallyCorrectLights = !1,
  49664. this.toneMapping = n.LinearToneMapping,
  49665. this.toneMappingExposure = 1,
  49666. this.toneMappingWhitePoint = 1,
  49667. this.maxMorphTargets = 8,
  49668. this.maxMorphNormals = 4,
  49669. this.autoScaleCubemaps = !0;
  49670. var ve = this
  49671. , Ae = null
  49672. , ye = null
  49673. , Ce = null
  49674. , Ie = -1
  49675. , Ee = ""
  49676. , be = null
  49677. , we = new n.Vector4
  49678. , _e = null
  49679. , Te = new n.Vector4
  49680. , xe = 0
  49681. , Se = new n.Color(0)
  49682. , Me = 0
  49683. , Re = te.width
  49684. , Pe = te.height
  49685. , Oe = 1
  49686. , Le = new n.Vector4(0,0,Re,Pe)
  49687. , De = !1
  49688. , Ne = new n.Vector4(0,0,Re,Pe)
  49689. , Be = new n.Frustum
  49690. , Fe = new n.Matrix4
  49691. , Ve = new n.Vector3
  49692. , Ue = {
  49693. hash: "",
  49694. ambient: [0, 0, 0],
  49695. directional: [],
  49696. directionalShadowMap: [],
  49697. directionalShadowMatrix: [],
  49698. spot: [],
  49699. spotShadowMap: [],
  49700. spotShadowMatrix: [],
  49701. point: [],
  49702. pointShadowMap: [],
  49703. pointShadowMatrix: [],
  49704. hemi: [],
  49705. shadows: [],
  49706. shadowsPointLight: 0
  49707. }
  49708. , ke = {
  49709. geometries: 0,
  49710. textures: 0
  49711. }
  49712. , He = {
  49713. calls: 0,
  49714. vertices: 0,
  49715. faces: 0,
  49716. points: 0
  49717. };
  49718. this.info = {
  49719. render: He,
  49720. memory: ke,
  49721. programs: null
  49722. };
  49723. var Ge;
  49724. try {
  49725. var ze = {
  49726. alpha: ne,
  49727. depth: re,
  49728. stencil: oe,
  49729. antialias: ae,
  49730. premultipliedAlpha: se,
  49731. preserveDrawingBuffer: le
  49732. };
  49733. if (Ge = ie || te.getContext("webgl", ze) || te.getContext("experimental-webgl", ze),
  49734. null === Ge)
  49735. throw null !== te.getContext("webgl") ? "Error creating WebGL context with your selected attributes." : "Error creating WebGL context.";
  49736. void 0 === Ge.getShaderPrecisionFormat && (Ge.getShaderPrecisionFormat = function() {
  49737. return {
  49738. rangeMin: 1,
  49739. rangeMax: 1,
  49740. precision: 1
  49741. }
  49742. }
  49743. ),
  49744. te.addEventListener("webglcontextlost", a, !1)
  49745. } catch (e) {
  49746. console.error("THREE.WebGLRenderer: " + e)
  49747. }
  49748. var We = new n.WebGLExtensions(Ge);
  49749. We.get("OES_texture_float"),
  49750. We.get("OES_texture_float_linear"),
  49751. We.get("OES_texture_half_float"),
  49752. We.get("OES_texture_half_float_linear"),
  49753. We.get("OES_standard_derivatives"),
  49754. We.get("ANGLE_instanced_arrays"),
  49755. We.get("OES_element_index_uint") && (n.BufferGeometry.MaxIndex = 4294967296);
  49756. var je = new n.WebGLCapabilities(Ge,We,e)
  49757. , Ye = new n.WebGLState(Ge,We,ee)
  49758. , Xe = new n.WebGLProperties
  49759. , Ze = new n.WebGLObjects(Ge,Xe,this.info)
  49760. , qe = new n.WebGLPrograms(this,je)
  49761. , Ke = new n.WebGLLights;
  49762. this.info.programs = qe.programs;
  49763. var Qe = new n.WebGLBufferRenderer(Ge,We,He)
  49764. , Je = new n.WebGLIndexedBufferRenderer(Ge,We,He);
  49765. r(),
  49766. this.context = Ge,
  49767. this.capabilities = je,
  49768. this.extensions = We,
  49769. this.properties = Xe,
  49770. this.state = Ye;
  49771. var $e = new n.WebGLShadowMap(this,Ue,Ze);
  49772. this.shadowMap = $e;
  49773. var et = new n.SpritePlugin(this,ge)
  49774. , tt = new n.LensFlarePlugin(this,me);
  49775. this.getContext = function() {
  49776. return Ge
  49777. }
  49778. ,
  49779. this.getContextAttributes = function() {
  49780. return Ge.getContextAttributes()
  49781. }
  49782. ,
  49783. this.forceContextLoss = function() {
  49784. We.get("WEBGL_lose_context").loseContext()
  49785. }
  49786. ,
  49787. this.getMaxAnisotropy = function() {
  49788. var e;
  49789. return function() {
  49790. if (void 0 !== e)
  49791. return e;
  49792. var t = We.get("EXT_texture_filter_anisotropic");
  49793. return e = null !== t ? Ge.getParameter(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 0
  49794. }
  49795. }(),
  49796. this.getPrecision = function() {
  49797. return je.precision
  49798. }
  49799. ,
  49800. this.getPixelRatio = function() {
  49801. return Oe
  49802. }
  49803. ,
  49804. this.setPixelRatio = function(e) {
  49805. void 0 !== e && (Oe = e,
  49806. this.setSize(Ne.z, Ne.w, !1))
  49807. }
  49808. ,
  49809. this.getSize = function() {
  49810. return {
  49811. width: Re,
  49812. height: Pe
  49813. }
  49814. }
  49815. ,
  49816. this.setSize = function(e, t, i, devicePixelRatio) {
  49817. if(devicePixelRatio != void 0) Oe = devicePixelRatio; //xzw add 改分辨率 始终保持清晰
  49818. Re = e,
  49819. Pe = t,
  49820. te.width = e * Oe,
  49821. te.height = t * Oe,
  49822. i !== !1 && (te.style.width = e + "px",
  49823. te.style.height = t + "px"),
  49824. this.setViewport(0, 0, e, t)
  49825. }
  49826. ,
  49827. this.setViewport = function(e, t, i, n) {
  49828. Ye.viewport(Ne.set(e, t, i, n))
  49829. }
  49830. ,
  49831. this.setScissor = function(e, t, i, n) {
  49832. Ye.scissor(Le.set(e, t, i, n))
  49833. }
  49834. ,
  49835. this.setScissorTest = function(e) {
  49836. Ye.setScissorTest(De = e)
  49837. }
  49838. ,
  49839. this.getClearColor = function() {
  49840. return Se
  49841. }
  49842. ,
  49843. this.setClearColor = function(e, t) {
  49844. Se.set(e),
  49845. Me = void 0 !== t ? t : 1,
  49846. i(Se.r, Se.g, Se.b, Me)
  49847. }
  49848. ,
  49849. this.getClearAlpha = function() {
  49850. return Me
  49851. }
  49852. ,
  49853. this.setClearAlpha = function(e) {
  49854. Me = e,
  49855. i(Se.r, Se.g, Se.b, Me)
  49856. }
  49857. ,
  49858. this.clear = function(e, t, i) {
  49859. var n = 0;
  49860. (void 0 === e || e) && (n |= Ge.COLOR_BUFFER_BIT),
  49861. (void 0 === t || t) && (n |= Ge.DEPTH_BUFFER_BIT),
  49862. (void 0 === i || i) && (n |= Ge.STENCIL_BUFFER_BIT),
  49863. Ge.clear(n)
  49864. }
  49865. ,
  49866. this.clearColor = function() {
  49867. this.clear(!0, !1, !1)
  49868. }
  49869. ,
  49870. this.clearDepth = function() {
  49871. this.clear(!1, !0, !1)
  49872. }
  49873. ,
  49874. this.clearStencil = function() {
  49875. this.clear(!1, !1, !0)
  49876. }
  49877. ,
  49878. this.clearTarget = function(e, t, i, n) {
  49879. this.setRenderTarget(e),
  49880. this.clear(t, i, n)
  49881. }
  49882. ,
  49883. this.resetGLState = o,
  49884. this.dispose = function() {
  49885. te.removeEventListener("webglcontextlost", a, !1)
  49886. }
  49887. ,
  49888. this.renderBufferImmediate = function(e, t, i) {
  49889. Ye.initAttributes();
  49890. var r = Xe.get(e);
  49891. e.hasPositions && !r.position && (r.position = Ge.createBuffer()),
  49892. e.hasNormals && !r.normal && (r.normal = Ge.createBuffer()),
  49893. e.hasUvs && !r.uv && (r.uv = Ge.createBuffer()),
  49894. e.hasColors && !r.color && (r.color = Ge.createBuffer());
  49895. var o = t.getAttributes();
  49896. if (e.hasPositions && (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.position),
  49897. Ge.bufferData(Ge.ARRAY_BUFFER, e.positionArray, Ge.DYNAMIC_DRAW),
  49898. Ye.enableAttribute(o.position),
  49899. Ge.vertexAttribPointer(o.position, 3, Ge.FLOAT, !1, 0, 0)),
  49900. e.hasNormals) {
  49901. if (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.normal),
  49902. "MeshPhongMaterial" !== i.type && "MeshStandardMaterial" !== i.type && i.shading === n.FlatShading)
  49903. for (var a = 0, s = 3 * e.count; a < s; a += 9) {
  49904. var l = e.normalArray
  49905. , c = (l[a + 0] + l[a + 3] + l[a + 6]) / 3
  49906. , h = (l[a + 1] + l[a + 4] + l[a + 7]) / 3
  49907. , u = (l[a + 2] + l[a + 5] + l[a + 8]) / 3;
  49908. l[a + 0] = c,
  49909. l[a + 1] = h,
  49910. l[a + 2] = u,
  49911. l[a + 3] = c,
  49912. l[a + 4] = h,
  49913. l[a + 5] = u,
  49914. l[a + 6] = c,
  49915. l[a + 7] = h,
  49916. l[a + 8] = u
  49917. }
  49918. Ge.bufferData(Ge.ARRAY_BUFFER, e.normalArray, Ge.DYNAMIC_DRAW),
  49919. Ye.enableAttribute(o.normal),
  49920. Ge.vertexAttribPointer(o.normal, 3, Ge.FLOAT, !1, 0, 0)
  49921. }
  49922. e.hasUvs && i.map && (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.uv),
  49923. Ge.bufferData(Ge.ARRAY_BUFFER, e.uvArray, Ge.DYNAMIC_DRAW),
  49924. Ye.enableAttribute(o.uv),
  49925. Ge.vertexAttribPointer(o.uv, 2, Ge.FLOAT, !1, 0, 0)),
  49926. e.hasColors && i.vertexColors !== n.NoColors && (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.color),
  49927. Ge.bufferData(Ge.ARRAY_BUFFER, e.colorArray, Ge.DYNAMIC_DRAW),
  49928. Ye.enableAttribute(o.color),
  49929. Ge.vertexAttribPointer(o.color, 3, Ge.FLOAT, !1, 0, 0)),
  49930. Ye.disableUnusedAttributes(),
  49931. Ge.drawArrays(Ge.TRIANGLES, 0, e.count),
  49932. e.count = 0
  49933. }
  49934. ,
  49935. this.renderBufferDirect = function(e, i, r, o, a, s) {
  49936. E(o);
  49937. var l = w(e, i, o, a)
  49938. , c = !1
  49939. , h = r.id + "_" + l.id + "_" + o.wireframe;
  49940. h !== Ee && (Ee = h,
  49941. c = !0);
  49942. var u = a.morphTargetInfluences;
  49943. if (void 0 !== u) {
  49944. for (var d = [], p = 0, m = u.length; p < m; p++) {
  49945. var v = u[p];
  49946. d.push([v, p])
  49947. }
  49948. d.sort(g),
  49949. d.length > 8 && (d.length = 8);
  49950. for (var A = r.morphAttributes, p = 0, m = d.length; p < m; p++) {
  49951. var v = d[p];
  49952. if (fe[p] = v[0],
  49953. 0 !== v[0]) {
  49954. var y = v[1];
  49955. o.morphTargets === !0 && A.position && r.addAttribute("morphTarget" + p, A.position[y]),
  49956. o.morphNormals === !0 && A.normal && r.addAttribute("morphNormal" + p, A.normal[y])
  49957. } else
  49958. o.morphTargets === !0 && r.removeAttribute("morphTarget" + p),
  49959. o.morphNormals === !0 && r.removeAttribute("morphNormal" + p)
  49960. }
  49961. var C = l.getUniforms();
  49962. null !== C.morphTargetInfluences && Ge.uniform1fv(C.morphTargetInfluences, fe),
  49963. c = !0
  49964. }
  49965. var y = r.index
  49966. , I = r.attributes.position;
  49967. o.wireframe === !0 && (y = Ze.getWireframeAttribute(r));
  49968. var b;
  49969. null !== y ? (b = Je,
  49970. b.setIndex(y)) : b = Qe,
  49971. c && (f(o, l, r),
  49972. null !== y && Ge.bindBuffer(Ge.ELEMENT_ARRAY_BUFFER, Ze.getAttributeBuffer(y)));
  49973. var _ = 0
  49974. , T = 1 / 0;
  49975. null !== y ? T = y.count : void 0 !== I && (T = I.count);
  49976. var x = r.drawRange.start
  49977. , S = r.drawRange.count
  49978. , M = null !== s ? s.start : 0
  49979. , R = null !== s ? s.count : 1 / 0
  49980. , P = Math.max(_, x, M)
  49981. , O = Math.min(_ + T, x + S, M + R) - 1
  49982. , L = Math.max(0, O - P + 1);
  49983. if (a instanceof n.Mesh)
  49984. if (o.wireframe === !0)
  49985. Ye.setLineWidth(o.wireframeLinewidth * t()),
  49986. b.setMode(Ge.LINES);
  49987. else
  49988. switch (a.drawMode) {
  49989. case n.TrianglesDrawMode:
  49990. b.setMode(Ge.TRIANGLES);
  49991. break;
  49992. case n.TriangleStripDrawMode:
  49993. b.setMode(Ge.TRIANGLE_STRIP);
  49994. break;
  49995. case n.TriangleFanDrawMode:
  49996. b.setMode(Ge.TRIANGLE_FAN)
  49997. }
  49998. else if (a instanceof n.Line) {
  49999. var D = o.linewidth;
  50000. void 0 === D && (D = 1),
  50001. Ye.setLineWidth(D * t()),
  50002. a instanceof n.LineSegments ? b.setMode(Ge.LINES) : b.setMode(Ge.LINE_STRIP)
  50003. } else
  50004. a instanceof n.Points && b.setMode(Ge.POINTS);
  50005. r instanceof n.InstancedBufferGeometry ? r.maxInstancedCount > 0 && b.renderInstances(r, P, L) : b.render(P, L)
  50006. }
  50007. ,
  50008. this.render = function(e, t, i, r) {
  50009. if (t instanceof n.Camera == !1)
  50010. return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");
  50011. var o = e.fog;
  50012. if (Ee = "",
  50013. Ie = -1,
  50014. be = null,
  50015. e.autoUpdate === !0 && e.updateMatrixWorld(),
  50016. null === t.parent && t.updateMatrixWorld(),
  50017. t.matrixWorldInverse.getInverse(t.matrixWorld),
  50018. Fe.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse),
  50019. Be.setFromMatrix(Fe),
  50020. ce.length = 0,
  50021. ue = -1,
  50022. pe = -1,
  50023. ge.length = 0,
  50024. me.length = 0,
  50025. y(e, t),
  50026. he.length = ue + 1,
  50027. de.length = pe + 1,
  50028. ve.sortObjects === !0 && (he.sort(m),
  50029. de.sort(v)),
  50030. U(ce, t),
  50031. $e.render(e, t),
  50032. He.calls = 0,
  50033. He.vertices = 0,
  50034. He.faces = 0,
  50035. He.points = 0,
  50036. void 0 === i && (i = null),
  50037. this.setRenderTarget(i),
  50038. (this.autoClear || r) && this.clear(this.autoClearColor, this.autoClearDepth, this.autoClearStencil),
  50039. e.overrideMaterial) {
  50040. var a = e.overrideMaterial;
  50041. C(he, t, o, a),
  50042. C(de, t, o, a)
  50043. } else
  50044. Ye.setBlending(n.NoBlending),
  50045. C(he, t, o),
  50046. C(de, t, o);
  50047. if (et.render(e, t),
  50048. tt.render(e, t, Te),
  50049. i) {
  50050. var s = i.texture;
  50051. s.generateMipmaps && z(i) && s.minFilter !== n.NearestFilter && s.minFilter !== n.LinearFilter && J(i)
  50052. }
  50053. Ye.setDepthTest(!0),
  50054. Ye.setDepthWrite(!0),
  50055. Ye.setColorWrite(!0)
  50056. }
  50057. ,
  50058. this.setFaceCulling = function(e, t) {
  50059. e === n.CullFaceNone ? Ye.disable(Ge.CULL_FACE) : (t === n.FrontFaceDirectionCW ? Ge.frontFace(Ge.CW) : Ge.frontFace(Ge.CCW),
  50060. e === n.CullFaceBack ? Ge.cullFace(Ge.BACK) : e === n.CullFaceFront ? Ge.cullFace(Ge.FRONT) : Ge.cullFace(Ge.FRONT_AND_BACK),
  50061. Ye.enable(Ge.CULL_FACE))
  50062. }
  50063. ,
  50064. this.setTexture = function(e, t) {
  50065. var i = Xe.get(e);
  50066. if (e.version > 0 && i.__version !== e.version) {
  50067. var n = e.image;
  50068. return void 0 === n ? void console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined", e) : n.complete === !1 ? void console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete", e) : void H(i, e, t)
  50069. }
  50070. Ye.activeTexture(Ge.TEXTURE0 + t),
  50071. Ye.bindTexture(Ge.TEXTURE_2D, i.__webglTexture)
  50072. }
  50073. ,
  50074. this.getCurrentRenderTarget = function() {
  50075. return ye
  50076. }
  50077. ,
  50078. this.setRenderTarget = function(e) {
  50079. ye = e,
  50080. e && void 0 === Xe.get(e).__webglFramebuffer && Q(e);
  50081. var t, i = e instanceof n.WebGLRenderTargetCube;
  50082. if (e) {
  50083. var r = Xe.get(e);
  50084. t = i ? r.__webglFramebuffer[e.activeCubeFace] : r.__webglFramebuffer,
  50085. we.copy(e.scissor),
  50086. _e = e.scissorTest,
  50087. Te.copy(e.viewport)
  50088. } else
  50089. t = null,
  50090. we.copy(Le).multiplyScalar(Oe),
  50091. _e = De,
  50092. Te.copy(Ne).multiplyScalar(Oe);
  50093. if (Ce !== t && (Ge.bindFramebuffer(Ge.FRAMEBUFFER, t),
  50094. Ce = t),
  50095. Ye.scissor(we),
  50096. Ye.setScissorTest(_e),
  50097. Ye.viewport(Te),
  50098. i) {
  50099. var o = Xe.get(e.texture);
  50100. Ge.framebufferTexture2D(Ge.FRAMEBUFFER, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_CUBE_MAP_POSITIVE_X + e.activeCubeFace, o.__webglTexture, e.activeMipMapLevel)
  50101. }
  50102. }
  50103. ,
  50104. this.readRenderTargetPixels = function(e, t, i, r, o, a) {
  50105. if (e instanceof n.WebGLRenderTarget == !1)
  50106. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");
  50107. var s = Xe.get(e).__webglFramebuffer;
  50108. if (s) {
  50109. var l = !1;
  50110. s !== Ce && (Ge.bindFramebuffer(Ge.FRAMEBUFFER, s),
  50111. l = !0);
  50112. try {
  50113. var c = e.texture;
  50114. if (c.format !== n.RGBAFormat && ee(c.format) !== Ge.getParameter(Ge.IMPLEMENTATION_COLOR_READ_FORMAT))
  50115. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");
  50116. if (!(c.type === n.UnsignedByteType || ee(c.type) === Ge.getParameter(Ge.IMPLEMENTATION_COLOR_READ_TYPE) || c.type === n.FloatType && We.get("WEBGL_color_buffer_float") || c.type === n.HalfFloatType && We.get("EXT_color_buffer_half_float")))
  50117. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");
  50118. Ge.checkFramebufferStatus(Ge.FRAMEBUFFER) === Ge.FRAMEBUFFER_COMPLETE ? Ge.readPixels(t, i, r, o, ee(c.format), ee(c.type), a) : console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")
  50119. } finally {
  50120. l && Ge.bindFramebuffer(Ge.FRAMEBUFFER, Ce)
  50121. }
  50122. }
  50123. }
  50124. }
  50125. ,
  50126. n.WebGLRenderTarget = function(e, t, i) {
  50127. this.uuid = n.Math.generateUUID(),
  50128. this.width = e,
  50129. this.height = t,
  50130. this.scissor = new n.Vector4(0,0,e,t),
  50131. this.scissorTest = !1,
  50132. this.viewport = new n.Vector4(0,0,e,t),
  50133. i = i || {},
  50134. void 0 === i.minFilter && (i.minFilter = n.LinearFilter),
  50135. this.texture = new n.Texture(void 0,void 0,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy),
  50136. this.depthBuffer = void 0 === i.depthBuffer || i.depthBuffer,
  50137. this.stencilBuffer = void 0 === i.stencilBuffer || i.stencilBuffer
  50138. }
  50139. ,
  50140. n.WebGLRenderTarget.prototype = {
  50141. constructor: n.WebGLRenderTarget,
  50142. setSize: function(e, t) {
  50143. this.width === e && this.height === t || (this.width = e,
  50144. this.height = t,
  50145. this.dispose()),
  50146. this.viewport.set(0, 0, e, t),
  50147. this.scissor.set(0, 0, e, t)
  50148. },
  50149. clone: function() {
  50150. return (new this.constructor).copy(this)
  50151. },
  50152. copy: function(e) {
  50153. return this.width = e.width,
  50154. this.height = e.height,
  50155. this.viewport.copy(e.viewport),
  50156. this.texture = e.texture.clone(),
  50157. this.depthBuffer = e.depthBuffer,
  50158. this.stencilBuffer = e.stencilBuffer,
  50159. this
  50160. },
  50161. dispose: function() {
  50162. this.dispatchEvent({
  50163. type: "dispose"
  50164. })
  50165. }
  50166. },
  50167. n.EventDispatcher.prototype.apply(n.WebGLRenderTarget.prototype),
  50168. n.WebGLRenderTargetCube = function(e, t, i) {
  50169. n.WebGLRenderTarget.call(this, e, t, i),
  50170. this.activeCubeFace = 0,
  50171. this.activeMipMapLevel = 0
  50172. }
  50173. ,
  50174. n.WebGLRenderTargetCube.prototype = Object.create(n.WebGLRenderTarget.prototype),
  50175. n.WebGLRenderTargetCube.prototype.constructor = n.WebGLRenderTargetCube,
  50176. n.WebGLBufferRenderer = function(e, t, i) {
  50177. function r(e) {
  50178. s = e
  50179. }
  50180. function o(t, n) {
  50181. e.drawArrays(s, t, n),
  50182. i.calls++,
  50183. i.vertices += n,
  50184. s === e.TRIANGLES && (i.faces += n / 3)
  50185. }
  50186. function a(r) {
  50187. var o = t.get("ANGLE_instanced_arrays");
  50188. if (null === o)
  50189. return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
  50190. var a = r.attributes.position
  50191. , l = 0;
  50192. a instanceof n.InterleavedBufferAttribute ? (l = a.data.count,
  50193. o.drawArraysInstancedANGLE(s, 0, l, r.maxInstancedCount)) : (l = a.count,
  50194. o.drawArraysInstancedANGLE(s, 0, l, r.maxInstancedCount)),
  50195. i.calls++,
  50196. i.vertices += l * r.maxInstancedCount,
  50197. s === e.TRIANGLES && (i.faces += r.maxInstancedCount * l / 3)
  50198. }
  50199. var s;
  50200. this.setMode = r,
  50201. this.render = o,
  50202. this.renderInstances = a
  50203. }
  50204. ,
  50205. n.WebGLIndexedBufferRenderer = function(e, t, i) {
  50206. function n(e) {
  50207. s = e
  50208. }
  50209. function r(i) {
  50210. i.array instanceof Uint32Array && t.get("OES_element_index_uint") ? (l = e.UNSIGNED_INT,
  50211. c = 4) : (l = e.UNSIGNED_SHORT,
  50212. c = 2)
  50213. }
  50214. function o(t, n) {
  50215. e.drawElements(s, n, l, t * c),
  50216. i.calls++,
  50217. i.vertices += n,
  50218. s === e.TRIANGLES && (i.faces += n / 3)
  50219. }
  50220. function a(n, r, o) {
  50221. var a = t.get("ANGLE_instanced_arrays");
  50222. return null === a ? void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.") : (a.drawElementsInstancedANGLE(s, o, l, r * c, n.maxInstancedCount),
  50223. i.calls++,
  50224. i.vertices += o * n.maxInstancedCount,
  50225. void (s === e.TRIANGLES && (i.faces += n.maxInstancedCount * o / 3)))
  50226. }
  50227. var s, l, c;
  50228. this.setMode = n,
  50229. this.setIndex = r,
  50230. this.render = o,
  50231. this.renderInstances = a
  50232. }
  50233. ,
  50234. n.WebGLExtensions = function(e) {
  50235. var t = {};
  50236. this.get = function(i) {
  50237. if (void 0 !== t[i])
  50238. return t[i];
  50239. var n;
  50240. switch (i) {
  50241. case "EXT_texture_filter_anisotropic":
  50242. n = e.getExtension("EXT_texture_filter_anisotropic") || e.getExtension("MOZ_EXT_texture_filter_anisotropic") || e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");
  50243. break;
  50244. case "WEBGL_compressed_texture_s3tc":
  50245. n = e.getExtension("WEBGL_compressed_texture_s3tc") || e.getExtension("MOZ_WEBGL_compressed_texture_s3tc") || e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");
  50246. break;
  50247. case "WEBGL_compressed_texture_pvrtc":
  50248. n = e.getExtension("WEBGL_compressed_texture_pvrtc") || e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");
  50249. break;
  50250. case "WEBGL_compressed_texture_etc1":
  50251. n = e.getExtension("WEBGL_compressed_texture_etc1");
  50252. break;
  50253. default:
  50254. n = e.getExtension(i)
  50255. }
  50256. return null === n && console.warn("THREE.WebGLRenderer: " + i + " extension not supported."),
  50257. t[i] = n,
  50258. n
  50259. }
  50260. }
  50261. ,
  50262. n.WebGLCapabilities = function(e, t, i) {
  50263. function n(t) {
  50264. if ("highp" === t) {
  50265. if (e.getShaderPrecisionFormat(e.VERTEX_SHADER, e.HIGH_FLOAT).precision > 0 && e.getShaderPrecisionFormat(e.FRAGMENT_SHADER, e.HIGH_FLOAT).precision > 0)
  50266. return "highp";
  50267. t = "mediump"
  50268. }
  50269. return "mediump" === t && e.getShaderPrecisionFormat(e.VERTEX_SHADER, e.MEDIUM_FLOAT).precision > 0 && e.getShaderPrecisionFormat(e.FRAGMENT_SHADER, e.MEDIUM_FLOAT).precision > 0 ? "mediump" : "lowp"
  50270. }
  50271. this.getMaxPrecision = n,
  50272. this.precision = void 0 !== i.precision ? i.precision : "highp",
  50273. this.logarithmicDepthBuffer = void 0 !== i.logarithmicDepthBuffer && i.logarithmicDepthBuffer,
  50274. this.maxTextures = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),
  50275. this.maxVertexTextures = e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),
  50276. this.maxTextureSize = e.getParameter(e.MAX_TEXTURE_SIZE),
  50277. this.maxCubemapSize = e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),
  50278. this.maxAttributes = e.getParameter(e.MAX_VERTEX_ATTRIBS),
  50279. this.maxVertexUniforms = e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),
  50280. this.maxVaryings = e.getParameter(e.MAX_VARYING_VECTORS),
  50281. this.maxFragmentUniforms = e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),
  50282. this.vertexTextures = this.maxVertexTextures > 0,
  50283. this.floatFragmentTextures = !!t.get("OES_texture_float"),
  50284. this.floatVertexTextures = this.vertexTextures && this.floatFragmentTextures;
  50285. var r = n(this.precision);
  50286. r !== this.precision && (console.warn("THREE.WebGLRenderer:", this.precision, "not supported, using", r, "instead."),
  50287. this.precision = r),
  50288. this.logarithmicDepthBuffer && (this.logarithmicDepthBuffer = !!t.get("EXT_frag_depth"))
  50289. }
  50290. ,
  50291. n.WebGLGeometries = function(e, t, i) {
  50292. function r(e) {
  50293. var t = e.geometry;
  50294. if (void 0 !== h[t.id])
  50295. return h[t.id];
  50296. t.addEventListener("dispose", o);
  50297. var r;
  50298. return t instanceof n.BufferGeometry ? r = t : t instanceof n.Geometry && (void 0 === t._bufferGeometry && (t._bufferGeometry = (new n.BufferGeometry).setFromObject(e)),
  50299. r = t._bufferGeometry),
  50300. h[t.id] = r,
  50301. i.memory.geometries++,
  50302. r
  50303. }
  50304. function o(e) {
  50305. var n = e.target
  50306. , r = h[n.id];
  50307. null !== r.index && s(r.index),
  50308. l(r.attributes),
  50309. n.removeEventListener("dispose", o),
  50310. delete h[n.id];
  50311. var a = t.get(n);
  50312. a.wireframe && s(a.wireframe),
  50313. t.delete(n);
  50314. var c = t.get(r);
  50315. c.wireframe && s(c.wireframe),
  50316. t.delete(r),
  50317. i.memory.geometries--
  50318. }
  50319. function a(e) {
  50320. return e instanceof n.InterleavedBufferAttribute ? t.get(e.data).__webglBuffer : t.get(e).__webglBuffer
  50321. }
  50322. function s(t) {
  50323. var i = a(t);
  50324. void 0 !== i && (e.deleteBuffer(i),
  50325. c(t))
  50326. }
  50327. function l(e) {
  50328. for (var t in e)
  50329. s(e[t])
  50330. }
  50331. function c(e) {
  50332. e instanceof n.InterleavedBufferAttribute ? t.delete(e.data) : t.delete(e)
  50333. }
  50334. var h = {};
  50335. this.get = r
  50336. }
  50337. ,
  50338. n.WebGLLights = function() {
  50339. var e = {};
  50340. this.get = function(t) {
  50341. if (void 0 !== e[t.id])
  50342. return e[t.id];
  50343. var i;
  50344. switch (t.type) {
  50345. case "DirectionalLight":
  50346. i = {
  50347. direction: new n.Vector3,
  50348. color: new n.Color,
  50349. shadow: !1,
  50350. shadowBias: 0,
  50351. shadowRadius: 1,
  50352. shadowMapSize: new n.Vector2
  50353. };
  50354. break;
  50355. case "SpotLight":
  50356. i = {
  50357. position: new n.Vector3,
  50358. direction: new n.Vector3,
  50359. color: new n.Color,
  50360. distance: 0,
  50361. coneCos: 0,
  50362. penumbraCos: 0,
  50363. decay: 0,
  50364. shadow: !1,
  50365. shadowBias: 0,
  50366. shadowRadius: 1,
  50367. shadowMapSize: new n.Vector2
  50368. };
  50369. break;
  50370. case "PointLight":
  50371. i = {
  50372. position: new n.Vector3,
  50373. color: new n.Color,
  50374. distance: 0,
  50375. decay: 0,
  50376. shadow: !1,
  50377. shadowBias: 0,
  50378. shadowRadius: 1,
  50379. shadowMapSize: new n.Vector2
  50380. };
  50381. break;
  50382. case "HemisphereLight":
  50383. i = {
  50384. direction: new n.Vector3,
  50385. skyColor: new n.Color,
  50386. groundColor: new n.Color
  50387. }
  50388. }
  50389. return e[t.id] = i,
  50390. i
  50391. }
  50392. }
  50393. ,
  50394. n.WebGLObjects = function(e, t, i) {
  50395. function r(t) {
  50396. var i = u.get(t);
  50397. t.geometry instanceof n.Geometry && i.updateFromObject(t);
  50398. var r = i.index
  50399. , a = i.attributes;
  50400. null !== r && o(r, e.ELEMENT_ARRAY_BUFFER);
  50401. for (var s in a)
  50402. o(a[s], e.ARRAY_BUFFER);
  50403. var l = i.morphAttributes;
  50404. for (var s in l)
  50405. for (var c = l[s], h = 0, d = c.length; h < d; h++)
  50406. o(c[h], e.ARRAY_BUFFER);
  50407. return i
  50408. }
  50409. function o(e, i) {
  50410. var r = e instanceof n.InterleavedBufferAttribute ? e.data : e
  50411. , o = t.get(r);
  50412. void 0 === o.__webglBuffer ? a(o, r, i) : o.version !== r.version && s(o, r, i)
  50413. }
  50414. function a(t, i, n) {
  50415. t.__webglBuffer = e.createBuffer(),
  50416. e.bindBuffer(n, t.__webglBuffer);
  50417. var r = i.dynamic ? e.DYNAMIC_DRAW : e.STATIC_DRAW;
  50418. e.bufferData(n, i.array, r),
  50419. t.version = i.version
  50420. }
  50421. function s(t, i, n) {
  50422. e.bindBuffer(n, t.__webglBuffer),
  50423. i.dynamic === !1 || i.updateRange.count === -1 ? e.bufferSubData(n, 0, i.array) : 0 === i.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.") : (e.bufferSubData(n, i.updateRange.offset * i.array.BYTES_PER_ELEMENT, i.array.subarray(i.updateRange.offset, i.updateRange.offset + i.updateRange.count)),
  50424. i.updateRange.count = 0),
  50425. t.version = i.version
  50426. }
  50427. function l(e) {
  50428. return e instanceof n.InterleavedBufferAttribute ? t.get(e.data).__webglBuffer : t.get(e).__webglBuffer
  50429. }
  50430. function c(i) {
  50431. var r = t.get(i);
  50432. if (void 0 !== r.wireframe)
  50433. return r.wireframe;
  50434. var a = []
  50435. , s = i.index
  50436. , l = i.attributes
  50437. , c = l.position;
  50438. if (null !== s)
  50439. for (var u = {}, d = s.array, p = 0, f = d.length; p < f; p += 3) {
  50440. var g = d[p + 0]
  50441. , m = d[p + 1]
  50442. , v = d[p + 2];
  50443. h(u, g, m) && a.push(g, m),
  50444. h(u, m, v) && a.push(m, v),
  50445. h(u, v, g) && a.push(v, g)
  50446. }
  50447. else
  50448. for (var d = l.position.array, p = 0, f = d.length / 3 - 1; p < f; p += 3) {
  50449. var g = p + 0
  50450. , m = p + 1
  50451. , v = p + 2;
  50452. a.push(g, m, m, v, v, g)
  50453. }
  50454. var A = c.count > 65535 ? Uint32Array : Uint16Array
  50455. , y = new n.BufferAttribute(new A(a),1);
  50456. return o(y, e.ELEMENT_ARRAY_BUFFER),
  50457. r.wireframe = y,
  50458. y
  50459. }
  50460. function h(e, t, i) {
  50461. if (t > i) {
  50462. var n = t;
  50463. t = i,
  50464. i = n
  50465. }
  50466. var r = e[t];
  50467. return void 0 === r ? (e[t] = [i],
  50468. !0) : r.indexOf(i) === -1 && (r.push(i),
  50469. !0)
  50470. }
  50471. var u = new n.WebGLGeometries(e,t,i);
  50472. this.getAttributeBuffer = l,
  50473. this.getWireframeAttribute = c,
  50474. this.update = r
  50475. }
  50476. ,
  50477. n.WebGLProgram = function() {
  50478. function e(e) {
  50479. switch (e) {
  50480. case n.LinearEncoding:
  50481. return ["Linear", "( value )"];
  50482. case n.sRGBEncoding:
  50483. return ["sRGB", "( value )"];
  50484. case n.RGBEEncoding:
  50485. return ["RGBE", "( value )"];
  50486. case n.RGBM7Encoding:
  50487. return ["RGBM", "( value, 7.0 )"];
  50488. case n.RGBM16Encoding:
  50489. return ["RGBM", "( value, 16.0 )"];
  50490. case n.RGBDEncoding:
  50491. return ["RGBD", "( value, 256.0 )"];
  50492. case n.GammaEncoding:
  50493. return ["Gamma", "( value, float( GAMMA_FACTOR ) )"];
  50494. default:
  50495. throw new Error("unsupported encoding: " + e)
  50496. }
  50497. }
  50498. function t(t, i) {
  50499. var n = e(i);
  50500. return "vec4 " + t + "( vec4 value ) { return " + n[0] + "ToLinear" + n[1] + "; }"
  50501. }
  50502. function i(t, i) {
  50503. var n = e(i);
  50504. return "vec4 " + t + "( vec4 value ) { return LinearTo" + n[0] + n[1] + "; }"
  50505. }
  50506. function r(e, t) {
  50507. var i;
  50508. switch (t) {
  50509. case n.LinearToneMapping:
  50510. i = "Linear";
  50511. break;
  50512. case n.ReinhardToneMapping:
  50513. i = "Reinhard";
  50514. break;
  50515. case n.Uncharted2ToneMapping:
  50516. i = "Uncharted2";
  50517. break;
  50518. case n.CineonToneMapping:
  50519. i = "OptimizedCineon";
  50520. break;
  50521. default:
  50522. throw new Error("unsupported toneMapping: " + t)
  50523. }
  50524. return "vec3 " + e + "( vec3 color ) { return " + i + "ToneMapping( color ); }"
  50525. }
  50526. function o(e, t, i) {
  50527. e = e || {};
  50528. var n = [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" : ""];
  50529. return n.filter(c).join("\n")
  50530. }
  50531. function a(e) {
  50532. var t = [];
  50533. for (var i in e) {
  50534. var n = e[i];
  50535. n !== !1 && t.push("#define " + i + " " + n)
  50536. }
  50537. return t.join("\n")
  50538. }
  50539. function s(e, t, i) {
  50540. for (var n = {}, r = e.getProgramParameter(t, e.ACTIVE_UNIFORMS), o = 0; o < r; o++) {
  50541. var a = e.getActiveUniform(t, o)
  50542. , s = a.name
  50543. , l = e.getUniformLocation(t, s)
  50544. , c = f.exec(s);
  50545. if (c) {
  50546. var h = c[1]
  50547. , u = c[2]
  50548. , d = n[h];
  50549. d || (d = n[h] = {}),
  50550. d[u] = l
  50551. } else if (c = g.exec(s)) {
  50552. var p = c[1]
  50553. , v = c[2]
  50554. , A = c[3]
  50555. , y = n[p];
  50556. y || (y = n[p] = []);
  50557. var C = y[v];
  50558. C || (C = y[v] = {}),
  50559. C[A] = l
  50560. } else if (c = m.exec(s)) {
  50561. var p = c[1];
  50562. n[p] = l
  50563. } else
  50564. n[s] = l
  50565. }
  50566. return n
  50567. }
  50568. function l(e, t, i) {
  50569. for (var n = {}, r = e.getProgramParameter(t, e.ACTIVE_ATTRIBUTES), o = 0; o < r; o++) {
  50570. var a = e.getActiveAttrib(t, o)
  50571. , s = a.name;
  50572. n[s] = e.getAttribLocation(t, s)
  50573. }
  50574. return n
  50575. }
  50576. function c(e) {
  50577. return "" !== e
  50578. }
  50579. function h(e, t) {
  50580. 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)
  50581. }
  50582. function u(e) {
  50583. function t(e, t) {
  50584. var i = n.ShaderChunk[t];
  50585. if (void 0 === i)
  50586. throw new Error("Can not resolve #include <" + t + ">");
  50587. return u(i)
  50588. }
  50589. var i = /#include +<([\w\d.]+)>/g;
  50590. return e.replace(i, t)
  50591. }
  50592. function d(e) {
  50593. function t(e, t, i, n) {
  50594. for (var r = "", o = parseInt(t); o < parseInt(i); o++)
  50595. r += n.replace(/\[ i \]/g, "[ " + o + " ]");
  50596. return r
  50597. }
  50598. var i = /for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g;
  50599. return e.replace(i, t)
  50600. }
  50601. var p = 0
  50602. , f = /^([\w\d_]+)\.([\w\d_]+)$/
  50603. , g = /^([\w\d_]+)\[(\d+)\]\.([\w\d_]+)$/
  50604. , m = /^([\w\d_]+)\[0\]$/;
  50605. return function(e, f, g, m) {
  50606. var v = e.context
  50607. , A = g.extensions
  50608. , y = g.defines
  50609. , C = g.__webglShader.vertexShader
  50610. , I = g.__webglShader.fragmentShader
  50611. , E = "SHADOWMAP_TYPE_BASIC";
  50612. m.shadowMapType === n.PCFShadowMap ? E = "SHADOWMAP_TYPE_PCF" : m.shadowMapType === n.PCFSoftShadowMap && (E = "SHADOWMAP_TYPE_PCF_SOFT");
  50613. var b = "ENVMAP_TYPE_CUBE"
  50614. , w = "ENVMAP_MODE_REFLECTION"
  50615. , _ = "ENVMAP_BLENDING_MULTIPLY";
  50616. if (m.envMap) {
  50617. switch (g.envMap.mapping) {
  50618. case n.CubeReflectionMapping:
  50619. case n.CubeRefractionMapping:
  50620. b = "ENVMAP_TYPE_CUBE";
  50621. break;
  50622. case n.CubeUVReflectionMapping:
  50623. case n.CubeUVRefractionMapping:
  50624. b = "ENVMAP_TYPE_CUBE_UV";
  50625. break;
  50626. case n.EquirectangularReflectionMapping:
  50627. case n.EquirectangularRefractionMapping:
  50628. b = "ENVMAP_TYPE_EQUIREC";
  50629. break;
  50630. case n.SphericalReflectionMapping:
  50631. b = "ENVMAP_TYPE_SPHERE"
  50632. }
  50633. switch (g.envMap.mapping) {
  50634. case n.CubeRefractionMapping:
  50635. case n.EquirectangularRefractionMapping:
  50636. w = "ENVMAP_MODE_REFRACTION"
  50637. }
  50638. switch (g.combine) {
  50639. case n.MultiplyOperation:
  50640. _ = "ENVMAP_BLENDING_MULTIPLY";
  50641. break;
  50642. case n.MixOperation:
  50643. _ = "ENVMAP_BLENDING_MIX";
  50644. break;
  50645. case n.AddOperation:
  50646. _ = "ENVMAP_BLENDING_ADD"
  50647. }
  50648. }
  50649. var T, x, S = e.gammaFactor > 0 ? e.gammaFactor : 1, M = o(A, m, e.extensions), R = a(y), P = v.createProgram();
  50650. g instanceof n.RawShaderMaterial ? (T = "",
  50651. x = "") : (T = ["precision " + m.precision + " float;", "precision " + m.precision + " int;", "#define SHADER_NAME " + g.__webglShader.name, R, m.supportsVertexTextures ? "#define VERTEX_TEXTURES" : "", "#define GAMMA_FACTOR " + S, "#define MAX_BONES " + m.maxBones, m.map ? "#define USE_MAP" : "", m.envMap ? "#define USE_ENVMAP" : "", m.envMap ? "#define " + w : "", m.lightMap ? "#define USE_LIGHTMAP" : "", m.aoMap ? "#define USE_AOMAP" : "", m.emissiveMap ? "#define USE_EMISSIVEMAP" : "", m.bumpMap ? "#define USE_BUMPMAP" : "", m.normalMap ? "#define USE_NORMALMAP" : "", m.displacementMap && m.supportsVertexTextures ? "#define USE_DISPLACEMENTMAP" : "", m.specularMap ? "#define USE_SPECULARMAP" : "", m.roughnessMap ? "#define USE_ROUGHNESSMAP" : "", m.metalnessMap ? "#define USE_METALNESSMAP" : "", m.alphaMap ? "#define USE_ALPHAMAP" : "", m.vertexColors ? "#define USE_COLOR" : "", m.flatShading ? "#define FLAT_SHADED" : "", m.skinning ? "#define USE_SKINNING" : "", m.useVertexTexture ? "#define BONE_TEXTURE" : "", m.morphTargets ? "#define USE_MORPHTARGETS" : "", m.morphNormals && m.flatShading === !1 ? "#define USE_MORPHNORMALS" : "", m.doubleSided ? "#define DOUBLE_SIDED" : "", m.flipSided ? "#define FLIP_SIDED" : "", m.shadowMapEnabled ? "#define USE_SHADOWMAP" : "", m.shadowMapEnabled ? "#define " + E : "", m.pointLightShadows > 0 ? "#define POINT_LIGHT_SHADOWS" : "", m.sizeAttenuation ? "#define USE_SIZEATTENUATION" : "", m.logarithmicDepthBuffer ? "#define USE_LOGDEPTHBUF" : "", m.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(c).join("\n"),
  50652. x = [M, "precision " + m.precision + " float;", "precision " + m.precision + " int;", "#define SHADER_NAME " + g.__webglShader.name, R, m.alphaTest ? "#define ALPHATEST " + m.alphaTest : "", "#define GAMMA_FACTOR " + S, m.useFog && m.fog ? "#define USE_FOG" : "", m.useFog && m.fogExp ? "#define FOG_EXP2" : "", m.map ? "#define USE_MAP" : "", m.envMap ? "#define USE_ENVMAP" : "", m.envMap ? "#define " + b : "", m.envMap ? "#define " + w : "", m.envMap ? "#define " + _ : "", m.lightMap ? "#define USE_LIGHTMAP" : "", m.aoMap ? "#define USE_AOMAP" : "", m.emissiveMap ? "#define USE_EMISSIVEMAP" : "", m.bumpMap ? "#define USE_BUMPMAP" : "", m.normalMap ? "#define USE_NORMALMAP" : "", m.specularMap ? "#define USE_SPECULARMAP" : "", m.roughnessMap ? "#define USE_ROUGHNESSMAP" : "", m.metalnessMap ? "#define USE_METALNESSMAP" : "", m.alphaMap ? "#define USE_ALPHAMAP" : "", m.vertexColors ? "#define USE_COLOR" : "", m.flatShading ? "#define FLAT_SHADED" : "", m.doubleSided ? "#define DOUBLE_SIDED" : "", m.flipSided ? "#define FLIP_SIDED" : "", m.shadowMapEnabled ? "#define USE_SHADOWMAP" : "", m.shadowMapEnabled ? "#define " + E : "", m.pointLightShadows > 0 ? "#define POINT_LIGHT_SHADOWS" : "", m.premultipliedAlpha ? "#define PREMULTIPLIED_ALPHA" : "", m.physicallyCorrectLights ? "#define PHYSICALLY_CORRECT_LIGHTS" : "", m.logarithmicDepthBuffer ? "#define USE_LOGDEPTHBUF" : "", m.logarithmicDepthBuffer && e.extensions.get("EXT_frag_depth") ? "#define USE_LOGDEPTHBUF_EXT" : "", m.envMap && e.extensions.get("EXT_shader_texture_lod") ? "#define TEXTURE_LOD_EXT" : "", "uniform mat4 viewMatrix;", "uniform vec3 cameraPosition;", m.toneMapping !== n.NoToneMapping ? "#define TONE_MAPPING" : "", m.toneMapping !== n.NoToneMapping ? n.ShaderChunk.tonemapping_pars_fragment : "", m.toneMapping !== n.NoToneMapping ? r("toneMapping", m.toneMapping) : "", m.outputEncoding || m.mapEncoding || m.envMapEncoding || m.emissiveMapEncoding ? n.ShaderChunk.encodings_pars_fragment : "", m.mapEncoding ? t("mapTexelToLinear", m.mapEncoding) : "", m.envMapEncoding ? t("envMapTexelToLinear", m.envMapEncoding) : "", m.emissiveMapEncoding ? t("emissiveMapTexelToLinear", m.emissiveMapEncoding) : "", m.outputEncoding ? i("linearToOutputTexel", m.outputEncoding) : "", "\n"].filter(c).join("\n")),
  50653. C = u(C, m),
  50654. C = h(C, m),
  50655. I = u(I, m),
  50656. I = h(I, m),
  50657. g instanceof n.ShaderMaterial == !1 && (C = d(C),
  50658. I = d(I));
  50659. var O = T + C
  50660. , L = x + I
  50661. , D = n.WebGLShader(v, v.VERTEX_SHADER, O)
  50662. , N = n.WebGLShader(v, v.FRAGMENT_SHADER, L);
  50663. v.attachShader(P, D),
  50664. v.attachShader(P, N),
  50665. void 0 !== g.index0AttributeName ? v.bindAttribLocation(P, 0, g.index0AttributeName) : m.morphTargets === !0 && v.bindAttribLocation(P, 0, "position"),
  50666. v.linkProgram(P);
  50667. var B = v.getProgramInfoLog(P)
  50668. , F = v.getShaderInfoLog(D)
  50669. , V = v.getShaderInfoLog(N)
  50670. , U = !0
  50671. , k = !0;
  50672. v.getProgramParameter(P, v.LINK_STATUS) === !1 ? (U = !1,
  50673. console.error("THREE.WebGLProgram: shader error: ", v.getError(), "gl.VALIDATE_STATUS", v.getProgramParameter(P, v.VALIDATE_STATUS), "gl.getProgramInfoLog", B, F, V)) : "" !== B ? console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()", B) : "" !== F && "" !== V || (k = !1),
  50674. k && (this.diagnostics = {
  50675. runnable: U,
  50676. material: g,
  50677. programLog: B,
  50678. vertexShader: {
  50679. log: F,
  50680. prefix: T
  50681. },
  50682. fragmentShader: {
  50683. log: V,
  50684. prefix: x
  50685. }
  50686. }),
  50687. v.deleteShader(D),
  50688. v.deleteShader(N);
  50689. var H;
  50690. this.getUniforms = function() {
  50691. return void 0 === H && (H = s(v, P)),
  50692. H
  50693. }
  50694. ;
  50695. var G;
  50696. return this.getAttributes = function() {
  50697. return void 0 === G && (G = l(v, P)),
  50698. G
  50699. }
  50700. ,
  50701. this.destroy = function() {
  50702. v.deleteProgram(P),
  50703. this.program = void 0
  50704. }
  50705. ,
  50706. Object.defineProperties(this, {
  50707. uniforms: {
  50708. get: function() {
  50709. return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),
  50710. this.getUniforms()
  50711. }
  50712. },
  50713. attributes: {
  50714. get: function() {
  50715. return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),
  50716. this.getAttributes()
  50717. }
  50718. }
  50719. }),
  50720. this.id = p++,
  50721. this.code = f,
  50722. this.usedTimes = 1,
  50723. this.program = P,
  50724. this.vertexShader = D,
  50725. this.fragmentShader = N,
  50726. this
  50727. }
  50728. }(),
  50729. n.WebGLPrograms = function(e, t) {
  50730. function i(e) {
  50731. if (t.floatVertexTextures && e && e.skeleton && e.skeleton.useVertexTexture)
  50732. return 1024;
  50733. var i = t.maxVertexUniforms
  50734. , r = Math.floor((i - 20) / 4)
  50735. , o = r;
  50736. return void 0 !== e && e instanceof n.SkinnedMesh && (o = Math.min(e.skeleton.bones.length, o),
  50737. o < e.skeleton.bones.length && console.warn("WebGLRenderer: too many bones - " + e.skeleton.bones.length + ", this GPU supports just " + o + " (try OpenGL instead of ANGLE)")),
  50738. o
  50739. }
  50740. function r(e, t) {
  50741. var i;
  50742. return e ? e instanceof n.Texture ? i = e.encoding : e instanceof n.WebGLRenderTarget && (i = e.texture.encoding) : i = n.LinearEncoding,
  50743. i === n.LinearEncoding && t && (i = n.GammaEncoding),
  50744. i
  50745. }
  50746. var o = []
  50747. , a = {
  50748. MeshDepthMaterial: "depth",
  50749. MeshNormalMaterial: "normal",
  50750. MeshBasicMaterial: "basic",
  50751. MeshLambertMaterial: "lambert",
  50752. MeshPhongMaterial: "phong",
  50753. MeshStandardMaterial: "standard",
  50754. LineBasicMaterial: "basic",
  50755. LineDashedMaterial: "dashed",
  50756. PointsMaterial: "points"
  50757. }
  50758. , s = ["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"];
  50759. this.getParameters = function(o, s, l, c) {
  50760. var h = a[o.type]
  50761. , u = i(c)
  50762. , d = e.getPrecision();
  50763. null !== o.precision && (d = t.getMaxPrecision(o.precision),
  50764. d !== o.precision && console.warn("THREE.WebGLProgram.getParameters:", o.precision, "not supported, using", d, "instead."));
  50765. var p = {
  50766. shaderID: h,
  50767. precision: d,
  50768. supportsVertexTextures: t.vertexTextures,
  50769. outputEncoding: r(e.getCurrentRenderTarget(), e.gammaOutput),
  50770. map: !!o.map,
  50771. mapEncoding: r(o.map, e.gammaInput),
  50772. envMap: !!o.envMap,
  50773. envMapMode: o.envMap && o.envMap.mapping,
  50774. envMapEncoding: r(o.envMap, e.gammaInput),
  50775. envMapCubeUV: !!o.envMap && (o.envMap.mapping === n.CubeUVReflectionMapping || o.envMap.mapping === n.CubeUVRefractionMapping),
  50776. lightMap: !!o.lightMap,
  50777. aoMap: !!o.aoMap,
  50778. emissiveMap: !!o.emissiveMap,
  50779. emissiveMapEncoding: r(o.emissiveMap, e.gammaInput),
  50780. bumpMap: !!o.bumpMap,
  50781. normalMap: !!o.normalMap,
  50782. displacementMap: !!o.displacementMap,
  50783. roughnessMap: !!o.roughnessMap,
  50784. metalnessMap: !!o.metalnessMap,
  50785. specularMap: !!o.specularMap,
  50786. alphaMap: !!o.alphaMap,
  50787. combine: o.combine,
  50788. vertexColors: o.vertexColors,
  50789. fog: l,
  50790. useFog: o.fog,
  50791. fogExp: l instanceof n.FogExp2,
  50792. flatShading: o.shading === n.FlatShading,
  50793. sizeAttenuation: o.sizeAttenuation,
  50794. logarithmicDepthBuffer: t.logarithmicDepthBuffer,
  50795. skinning: o.skinning,
  50796. maxBones: u,
  50797. useVertexTexture: t.floatVertexTextures && c && c.skeleton && c.skeleton.useVertexTexture,
  50798. morphTargets: o.morphTargets,
  50799. morphNormals: o.morphNormals,
  50800. maxMorphTargets: e.maxMorphTargets,
  50801. maxMorphNormals: e.maxMorphNormals,
  50802. numDirLights: s.directional.length,
  50803. numPointLights: s.point.length,
  50804. numSpotLights: s.spot.length,
  50805. numHemiLights: s.hemi.length,
  50806. pointLightShadows: s.shadowsPointLight,
  50807. shadowMapEnabled: e.shadowMap.enabled && c.receiveShadow && s.shadows.length > 0,
  50808. shadowMapType: e.shadowMap.type,
  50809. toneMapping: e.toneMapping,
  50810. physicallyCorrectLights: e.physicallyCorrectLights,
  50811. premultipliedAlpha: o.premultipliedAlpha,
  50812. alphaTest: o.alphaTest,
  50813. doubleSided: o.side === n.DoubleSide,
  50814. flipSided: o.side === n.BackSide
  50815. };
  50816. return p
  50817. }
  50818. ,
  50819. this.getProgramCode = function(e, t) {
  50820. var i = [];
  50821. if (t.shaderID ? i.push(t.shaderID) : (i.push(e.fragmentShader),
  50822. i.push(e.vertexShader)),
  50823. void 0 !== e.defines)
  50824. for (var n in e.defines)
  50825. i.push(n),
  50826. i.push(e.defines[n]);
  50827. for (var r = 0; r < s.length; r++) {
  50828. var o = s[r];
  50829. i.push(o),
  50830. i.push(t[o])
  50831. }
  50832. return i.join()
  50833. }
  50834. ,
  50835. this.acquireProgram = function(t, i, r) {
  50836. for (var a, s = 0, l = o.length; s < l; s++) {
  50837. var c = o[s];
  50838. if (c.code === r) {
  50839. a = c,
  50840. ++a.usedTimes;
  50841. break
  50842. }
  50843. }
  50844. return void 0 === a && (a = new n.WebGLProgram(e,r,t,i),
  50845. o.push(a)),
  50846. a
  50847. }
  50848. ,
  50849. this.releaseProgram = function(e) {
  50850. if (0 === --e.usedTimes) {
  50851. var t = o.indexOf(e);
  50852. o[t] = o[o.length - 1],
  50853. o.pop(),
  50854. e.destroy()
  50855. }
  50856. }
  50857. ,
  50858. this.programs = o
  50859. }
  50860. ,
  50861. n.WebGLProperties = function() {
  50862. var e = {};
  50863. this.get = function(t) {
  50864. var i = t.uuid
  50865. , n = e[i];
  50866. return void 0 === n && (n = {},
  50867. e[i] = n),
  50868. n
  50869. }
  50870. ,
  50871. this.delete = function(t) {
  50872. delete e[t.uuid]
  50873. }
  50874. ,
  50875. this.clear = function() {
  50876. e = {}
  50877. }
  50878. }
  50879. ,
  50880. n.WebGLShader = function() {
  50881. function e(e) {
  50882. for (var t = e.split("\n"), i = 0; i < t.length; i++)
  50883. t[i] = i + 1 + ": " + t[i];
  50884. return t.join("\n")
  50885. }
  50886. return function(t, i, n) {
  50887. var r = t.createShader(i);
  50888. return t.shaderSource(r, n),
  50889. t.compileShader(r),
  50890. t.getShaderParameter(r, t.COMPILE_STATUS) === !1 && console.error("THREE.WebGLShader: Shader couldn't compile."),
  50891. "" !== t.getShaderInfoLog(r) && console.warn("THREE.WebGLShader: gl.getShaderInfoLog()", i === t.VERTEX_SHADER ? "vertex" : "fragment", t.getShaderInfoLog(r), e(n)),
  50892. r
  50893. }
  50894. }(),
  50895. n.WebGLShadowMap = function(e, t, i) {
  50896. function r(e, t, i, r) {
  50897. var o = e.geometry
  50898. , a = null
  50899. , s = v
  50900. , l = e.customDepthMaterial;
  50901. if (i && (s = A,
  50902. l = e.customDistanceMaterial),
  50903. l)
  50904. a = l;
  50905. else {
  50906. var c = void 0 !== o.morphTargets && o.morphTargets.length > 0 && t.morphTargets
  50907. , h = e instanceof n.SkinnedMesh && t.skinning
  50908. , u = 0;
  50909. c && (u |= f),
  50910. h && (u |= g),
  50911. a = s[u]
  50912. }
  50913. return a.visible = t.visible,
  50914. a.wireframe = t.wireframe,
  50915. a.wireframeLinewidth = t.wireframeLinewidth,
  50916. i && void 0 !== a.uniforms.lightPos && a.uniforms.lightPos.value.copy(r),
  50917. a
  50918. }
  50919. function o(e, t, i) {
  50920. if (e.visible !== !1) {
  50921. if (e.layers.test(t.layers) && (e instanceof n.Mesh || e instanceof n.Line || e instanceof n.Points) && e.castShadow && (e.frustumCulled === !1 || l.intersectsObject(e) === !0)) {
  50922. var r = e.material;
  50923. r.visible === !0 && (e.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse, e.matrixWorld),
  50924. p.push(e))
  50925. }
  50926. for (var a = e.children, s = 0, c = a.length; s < c; s++)
  50927. o(a[s], t, i)
  50928. }
  50929. }
  50930. for (var a = e.context, s = e.state, l = new n.Frustum, c = new n.Matrix4, h = new n.Vector2, u = new n.Vector3, d = new n.Vector3, p = [], f = 1, g = 2, m = (f | g) + 1, v = new Array(m), A = new Array(m), y = [new n.Vector3(1,0,0), new n.Vector3(-1,0,0), new n.Vector3(0,0,1), new n.Vector3(0,0,-1), new n.Vector3(0,1,0), new n.Vector3(0,-1,0)], C = [new n.Vector3(0,1,0), new n.Vector3(0,1,0), new n.Vector3(0,1,0), new n.Vector3(0,1,0), new n.Vector3(0,0,1), new n.Vector3(0,0,-1)], I = [new n.Vector4, new n.Vector4, new n.Vector4, new n.Vector4, new n.Vector4, new n.Vector4], E = n.ShaderLib.depthRGBA, b = n.UniformsUtils.clone(E.uniforms), w = n.ShaderLib.distanceRGBA, _ = n.UniformsUtils.clone(w.uniforms), T = 0; T !== m; ++T) {
  50931. var x = 0 !== (T & f)
  50932. , S = 0 !== (T & g)
  50933. , M = new n.ShaderMaterial({
  50934. uniforms: b,
  50935. vertexShader: E.vertexShader,
  50936. fragmentShader: E.fragmentShader,
  50937. morphTargets: x,
  50938. skinning: S
  50939. });
  50940. v[T] = M;
  50941. var R = new n.ShaderMaterial({
  50942. defines: {
  50943. USE_SHADOWMAP: ""
  50944. },
  50945. uniforms: _,
  50946. vertexShader: w.vertexShader,
  50947. fragmentShader: w.fragmentShader,
  50948. morphTargets: x,
  50949. skinning: S
  50950. });
  50951. A[T] = R
  50952. }
  50953. var P = this;
  50954. this.enabled = !1,
  50955. this.autoUpdate = !0,
  50956. this.needsUpdate = !1,
  50957. this.type = n.PCFShadowMap,
  50958. this.cullFace = n.CullFaceFront,
  50959. this.render = function(f, g) {
  50960. var m, v, A = t.shadows;
  50961. if (0 !== A.length && P.enabled !== !1 && (P.autoUpdate !== !1 || P.needsUpdate !== !1)) {
  50962. s.clearColor(1, 1, 1, 1),
  50963. s.disable(a.BLEND),
  50964. s.enable(a.CULL_FACE),
  50965. a.frontFace(a.CCW),
  50966. a.cullFace(P.cullFace === n.CullFaceFront ? a.FRONT : a.BACK),
  50967. s.setDepthTest(!0),
  50968. s.setScissorTest(!1);
  50969. for (var E = 0, b = A.length; E < b; E++) {
  50970. var w = A[E]
  50971. , _ = w.shadow
  50972. , T = _.camera;
  50973. if (h.copy(_.mapSize),
  50974. w instanceof n.PointLight) {
  50975. m = 6,
  50976. v = !0;
  50977. var x = h.x
  50978. , S = h.y;
  50979. I[0].set(2 * x, S, x, S),
  50980. I[1].set(0, S, x, S),
  50981. I[2].set(3 * x, S, x, S),
  50982. I[3].set(x, S, x, S),
  50983. I[4].set(3 * x, 0, x, S),
  50984. I[5].set(x, 0, x, S),
  50985. h.x *= 4,
  50986. h.y *= 2
  50987. } else
  50988. m = 1,
  50989. v = !1;
  50990. if (null === _.map) {
  50991. var M = {
  50992. minFilter: n.NearestFilter,
  50993. magFilter: n.NearestFilter,
  50994. format: n.RGBAFormat
  50995. };
  50996. _.map = new n.WebGLRenderTarget(h.x,h.y,M),
  50997. w instanceof n.SpotLight && (T.aspect = h.x / h.y),
  50998. T.updateProjectionMatrix()
  50999. }
  51000. var R = _.map
  51001. , O = _.matrix;
  51002. d.setFromMatrixPosition(w.matrixWorld),
  51003. T.position.copy(d),
  51004. e.setRenderTarget(R),
  51005. e.clear();
  51006. for (var L = 0; L < m; L++) {
  51007. if (v) {
  51008. u.copy(T.position),
  51009. u.add(y[L]),
  51010. T.up.copy(C[L]),
  51011. T.lookAt(u);
  51012. var D = I[L];
  51013. s.viewport(D)
  51014. } else
  51015. u.setFromMatrixPosition(w.target.matrixWorld),
  51016. T.lookAt(u);
  51017. T.updateMatrixWorld(),
  51018. T.matrixWorldInverse.getInverse(T.matrixWorld),
  51019. O.set(.5, 0, 0, .5, 0, .5, 0, .5, 0, 0, .5, .5, 0, 0, 0, 1),
  51020. O.multiply(T.projectionMatrix),
  51021. O.multiply(T.matrixWorldInverse),
  51022. c.multiplyMatrices(T.projectionMatrix, T.matrixWorldInverse),
  51023. l.setFromMatrix(c),
  51024. p.length = 0,
  51025. o(f, g, T);
  51026. for (var N = 0, B = p.length; N < B; N++) {
  51027. var F = p[N]
  51028. , V = i.update(F)
  51029. , U = F.material;
  51030. if (U instanceof n.MultiMaterial)
  51031. for (var k = V.groups, H = U.materials, G = 0, z = k.length; G < z; G++) {
  51032. var W = k[G]
  51033. , j = H[W.materialIndex];
  51034. if (j.visible === !0) {
  51035. var Y = r(F, j, v, d);
  51036. e.renderBufferDirect(T, null, V, Y, F, W)
  51037. }
  51038. }
  51039. else {
  51040. var Y = r(F, U, v, d);
  51041. e.renderBufferDirect(T, null, V, Y, F, null)
  51042. }
  51043. }
  51044. }
  51045. }
  51046. var X = e.getClearColor()
  51047. , Z = e.getClearAlpha();
  51048. e.setClearColor(X, Z),
  51049. s.enable(a.BLEND),
  51050. P.cullFace === n.CullFaceFront && a.cullFace(a.BACK),
  51051. P.needsUpdate = !1
  51052. }
  51053. }
  51054. }
  51055. ,
  51056. n.WebGLState = function(e, t, i) {
  51057. var r = this
  51058. , o = new n.Vector4
  51059. , a = new Uint8Array(16)
  51060. , s = new Uint8Array(16)
  51061. , l = new Uint8Array(16)
  51062. , c = {}
  51063. , h = null
  51064. , u = null
  51065. , d = null
  51066. , p = null
  51067. , f = null
  51068. , g = null
  51069. , m = null
  51070. , v = null
  51071. , A = !1
  51072. , y = null
  51073. , C = null
  51074. , I = null
  51075. , E = null
  51076. , b = null
  51077. , w = null
  51078. , _ = null
  51079. , T = null
  51080. , x = null
  51081. , S = null
  51082. , M = null
  51083. , R = null
  51084. , P = null
  51085. , O = null
  51086. , L = null
  51087. , D = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)
  51088. , N = void 0
  51089. , B = {}
  51090. , F = new n.Vector4
  51091. , V = null
  51092. , U = null
  51093. , k = new n.Vector4
  51094. , H = new n.Vector4
  51095. , G = e.createTexture();
  51096. e.bindTexture(e.TEXTURE_2D, G),
  51097. e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER, e.LINEAR),
  51098. e.texImage2D(e.TEXTURE_2D, 0, e.RGB, 1, 1, 0, e.RGB, e.UNSIGNED_BYTE, new Uint8Array(3)),
  51099. this.init = function() {
  51100. this.clearColor(0, 0, 0, 1),
  51101. this.clearDepth(1),
  51102. this.clearStencil(0),
  51103. this.enable(e.DEPTH_TEST),
  51104. e.depthFunc(e.LEQUAL),
  51105. e.frontFace(e.CCW),
  51106. e.cullFace(e.BACK),
  51107. this.enable(e.CULL_FACE),
  51108. this.enable(e.BLEND),
  51109. e.blendEquation(e.FUNC_ADD),
  51110. e.blendFunc(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA)
  51111. }
  51112. ,
  51113. this.initAttributes = function() {
  51114. for (var e = 0, t = a.length; e < t; e++)
  51115. a[e] = 0
  51116. }
  51117. ,
  51118. this.enableAttribute = function(i) {
  51119. if (a[i] = 1,
  51120. 0 === s[i] && (e.enableVertexAttribArray(i),
  51121. s[i] = 1),
  51122. 0 !== l[i]) {
  51123. var n = t.get("ANGLE_instanced_arrays");
  51124. n.vertexAttribDivisorANGLE(i, 0),
  51125. l[i] = 0
  51126. }
  51127. }
  51128. ,
  51129. this.enableAttributeAndDivisor = function(t, i, n) {
  51130. a[t] = 1,
  51131. 0 === s[t] && (e.enableVertexAttribArray(t),
  51132. s[t] = 1),
  51133. l[t] !== i && (n.vertexAttribDivisorANGLE(t, i),
  51134. l[t] = i)
  51135. }
  51136. ,
  51137. this.disableUnusedAttributes = function() {
  51138. for (var t = 0, i = s.length; t < i; t++)
  51139. s[t] !== a[t] && (e.disableVertexAttribArray(t),
  51140. s[t] = 0)
  51141. }
  51142. ,
  51143. this.enable = function(t) {
  51144. c[t] !== !0 && (e.enable(t),
  51145. c[t] = !0)
  51146. }
  51147. ,
  51148. this.disable = function(t) {
  51149. c[t] !== !1 && (e.disable(t),
  51150. c[t] = !1)
  51151. }
  51152. ,
  51153. this.getCompressedTextureFormats = function() {
  51154. if (null === h && (h = [],
  51155. t.get("WEBGL_compressed_texture_pvrtc") || t.get("WEBGL_compressed_texture_s3tc") || t.get("WEBGL_compressed_texture_etc1")))
  51156. for (var i = e.getParameter(e.COMPRESSED_TEXTURE_FORMATS), n = 0; n < i.length; n++)
  51157. h.push(i[n]);
  51158. return h
  51159. }
  51160. ,
  51161. this.setBlending = function(t, r, o, a, s, l, c, h) {
  51162. t === n.NoBlending ? this.disable(e.BLEND) : this.enable(e.BLEND),
  51163. t === u && h === A || (t === n.AdditiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  51164. e.blendFuncSeparate(e.ONE, e.ONE, e.ONE, e.ONE)) : (e.blendEquation(e.FUNC_ADD),
  51165. e.blendFunc(e.SRC_ALPHA, e.ONE)) : t === n.SubtractiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  51166. e.blendFuncSeparate(e.ZERO, e.ZERO, e.ONE_MINUS_SRC_COLOR, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  51167. e.blendFunc(e.ZERO, e.ONE_MINUS_SRC_COLOR)) : t === n.MultiplyBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  51168. e.blendFuncSeparate(e.ZERO, e.ZERO, e.SRC_COLOR, e.SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  51169. e.blendFunc(e.ZERO, e.SRC_COLOR)) : h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  51170. e.blendFuncSeparate(e.ONE, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  51171. e.blendFuncSeparate(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)),
  51172. u = t,
  51173. A = h),
  51174. t === n.CustomBlending ? (s = s || r,
  51175. l = l || o,
  51176. c = c || a,
  51177. r === d && s === g || (e.blendEquationSeparate(i(r), i(s)),
  51178. d = r,
  51179. g = s),
  51180. o === p && a === f && l === m && c === v || (e.blendFuncSeparate(i(o), i(a), i(l), i(c)),
  51181. p = o,
  51182. f = a,
  51183. m = l,
  51184. v = c)) : (d = null,
  51185. p = null,
  51186. f = null,
  51187. g = null,
  51188. m = null,
  51189. v = null)
  51190. }
  51191. ,
  51192. this.setDepthFunc = function(t) {
  51193. if (y !== t) {
  51194. if (t)
  51195. switch (t) {
  51196. case n.NeverDepth:
  51197. e.depthFunc(e.NEVER);
  51198. break;
  51199. case n.AlwaysDepth:
  51200. e.depthFunc(e.ALWAYS);
  51201. break;
  51202. case n.LessDepth:
  51203. e.depthFunc(e.LESS);
  51204. break;
  51205. case n.LessEqualDepth:
  51206. e.depthFunc(e.LEQUAL);
  51207. break;
  51208. case n.EqualDepth:
  51209. e.depthFunc(e.EQUAL);
  51210. break;
  51211. case n.GreaterEqualDepth:
  51212. e.depthFunc(e.GEQUAL);
  51213. break;
  51214. case n.GreaterDepth:
  51215. e.depthFunc(e.GREATER);
  51216. break;
  51217. case n.NotEqualDepth:
  51218. e.depthFunc(e.NOTEQUAL);
  51219. break;
  51220. default:
  51221. e.depthFunc(e.LEQUAL)
  51222. }
  51223. else
  51224. e.depthFunc(e.LEQUAL);
  51225. y = t
  51226. }
  51227. }
  51228. ,
  51229. this.setDepthTest = function(t) {
  51230. t ? this.enable(e.DEPTH_TEST) : this.disable(e.DEPTH_TEST)
  51231. }
  51232. ,
  51233. this.setDepthWrite = function(t) {
  51234. C !== t && (e.depthMask(t),
  51235. C = t)
  51236. }
  51237. ,
  51238. this.setColorWrite = function(t) {
  51239. I !== t && (e.colorMask(t, t, t, t),
  51240. I = t)
  51241. }
  51242. ,
  51243. this.setStencilFunc = function(t, i, n) {
  51244. b === t && w === i && _ === n || (e.stencilFunc(t, i, n),
  51245. b = t,
  51246. w = i,
  51247. _ = n)
  51248. }
  51249. ,
  51250. this.setStencilOp = function(t, i, n) {
  51251. T === t && x === i && S === n || (e.stencilOp(t, i, n),
  51252. T = t,
  51253. x = i,
  51254. S = n)
  51255. }
  51256. ,
  51257. this.setStencilTest = function(t) {
  51258. t ? this.enable(e.STENCIL_TEST) : this.disable(e.STENCIL_TEST)
  51259. }
  51260. ,
  51261. this.setStencilWrite = function(t) {
  51262. E !== t && (e.stencilMask(t),
  51263. E = t)
  51264. }
  51265. ,
  51266. this.setFlipSided = function(t) {
  51267. M !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW),
  51268. M = t)
  51269. }
  51270. ,
  51271. this.setLineWidth = function(t) {
  51272. t !== R && (e.lineWidth(t),
  51273. R = t)
  51274. }
  51275. ,
  51276. this.setPolygonOffset = function(t, i, n) {
  51277. t ? this.enable(e.POLYGON_OFFSET_FILL) : this.disable(e.POLYGON_OFFSET_FILL),
  51278. !t || P === i && O === n || (e.polygonOffset(i, n),
  51279. P = i,
  51280. O = n)
  51281. }
  51282. ,
  51283. this.getScissorTest = function() {
  51284. return L
  51285. }
  51286. ,
  51287. this.setScissorTest = function(t) {
  51288. L = t,
  51289. t ? this.enable(e.SCISSOR_TEST) : this.disable(e.SCISSOR_TEST)
  51290. }
  51291. ,
  51292. this.activeTexture = function(t) {
  51293. void 0 === t && (t = e.TEXTURE0 + D - 1),
  51294. N !== t && (e.activeTexture(t),
  51295. N = t)
  51296. }
  51297. ,
  51298. this.bindTexture = function(t, i) {
  51299. void 0 === N && r.activeTexture();
  51300. var n = B[N];
  51301. void 0 === n && (n = {
  51302. type: void 0,
  51303. texture: void 0
  51304. },
  51305. B[N] = n),
  51306. n.type === t && n.texture === i || (e.bindTexture(t, i || G),
  51307. n.type = t,
  51308. n.texture = i)
  51309. }
  51310. ,
  51311. this.compressedTexImage2D = function() {
  51312. try {
  51313. e.compressedTexImage2D.apply(e, arguments)
  51314. } catch (e) {
  51315. console.error(e)
  51316. }
  51317. }
  51318. ,
  51319. this.texImage2D = function() {
  51320. try {
  51321. e.texImage2D.apply(e, arguments)
  51322. } catch (e) {
  51323. console.error(e)
  51324. }
  51325. }
  51326. ,
  51327. this.clearColor = function(t, i, n, r) {
  51328. o.set(t, i, n, r),
  51329. F.equals(o) === !1 && (e.clearColor(t, i, n, r),
  51330. F.copy(o))
  51331. }
  51332. ,
  51333. this.clearDepth = function(t) {
  51334. V !== t && (e.clearDepth(t),
  51335. V = t)
  51336. }
  51337. ,
  51338. this.clearStencil = function(t) {
  51339. U !== t && (e.clearStencil(t),
  51340. U = t)
  51341. }
  51342. ,
  51343. this.scissor = function(t) {
  51344. k.equals(t) === !1 && (e.scissor(t.x, t.y, t.z, t.w),
  51345. k.copy(t))
  51346. }
  51347. ,
  51348. this.viewport = function(t) {
  51349. H.equals(t) === !1 && (e.viewport(t.x, t.y, t.z, t.w),
  51350. H.copy(t))
  51351. }
  51352. ,
  51353. this.reset = function() {
  51354. for (var t = 0; t < s.length; t++)
  51355. 1 === s[t] && (e.disableVertexAttribArray(t),
  51356. s[t] = 0);
  51357. c = {},
  51358. h = null,
  51359. N = void 0,
  51360. B = {},
  51361. u = null,
  51362. I = null,
  51363. C = null,
  51364. E = null,
  51365. M = null
  51366. }
  51367. }
  51368. ,
  51369. n.LensFlarePlugin = function(e, t) {
  51370. function i() {
  51371. var e = new Float32Array([-1, -1, 0, 0, 1, -1, 1, 0, 1, 1, 1, 1, -1, 1, 0, 1])
  51372. , t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  51373. o = p.createBuffer(),
  51374. a = p.createBuffer(),
  51375. p.bindBuffer(p.ARRAY_BUFFER, o),
  51376. p.bufferData(p.ARRAY_BUFFER, e, p.STATIC_DRAW),
  51377. p.bindBuffer(p.ELEMENT_ARRAY_BUFFER, a),
  51378. p.bufferData(p.ELEMENT_ARRAY_BUFFER, t, p.STATIC_DRAW),
  51379. u = p.createTexture(),
  51380. d = p.createTexture(),
  51381. f.bindTexture(p.TEXTURE_2D, u),
  51382. p.texImage2D(p.TEXTURE_2D, 0, p.RGB, 16, 16, 0, p.RGB, p.UNSIGNED_BYTE, null),
  51383. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_S, p.CLAMP_TO_EDGE),
  51384. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_T, p.CLAMP_TO_EDGE),
  51385. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MAG_FILTER, p.NEAREST),
  51386. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MIN_FILTER, p.NEAREST),
  51387. f.bindTexture(p.TEXTURE_2D, d),
  51388. p.texImage2D(p.TEXTURE_2D, 0, p.RGBA, 16, 16, 0, p.RGBA, p.UNSIGNED_BYTE, null),
  51389. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_S, p.CLAMP_TO_EDGE),
  51390. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_T, p.CLAMP_TO_EDGE),
  51391. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MAG_FILTER, p.NEAREST),
  51392. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MIN_FILTER, p.NEAREST),
  51393. h = p.getParameter(p.MAX_VERTEX_TEXTURE_IMAGE_UNITS) > 0;
  51394. var i;
  51395. i = h ? {
  51396. 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"),
  51397. 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")
  51398. } : {
  51399. 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"),
  51400. 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")
  51401. },
  51402. s = r(i),
  51403. l = {
  51404. vertex: p.getAttribLocation(s, "position"),
  51405. uv: p.getAttribLocation(s, "uv")
  51406. },
  51407. c = {
  51408. renderType: p.getUniformLocation(s, "renderType"),
  51409. map: p.getUniformLocation(s, "map"),
  51410. occlusionMap: p.getUniformLocation(s, "occlusionMap"),
  51411. opacity: p.getUniformLocation(s, "opacity"),
  51412. color: p.getUniformLocation(s, "color"),
  51413. scale: p.getUniformLocation(s, "scale"),
  51414. rotation: p.getUniformLocation(s, "rotation"),
  51415. screenPosition: p.getUniformLocation(s, "screenPosition")
  51416. }
  51417. }
  51418. function r(t) {
  51419. var i = p.createProgram()
  51420. , n = p.createShader(p.FRAGMENT_SHADER)
  51421. , r = p.createShader(p.VERTEX_SHADER)
  51422. , o = "precision " + e.getPrecision() + " float;\n";
  51423. return p.shaderSource(n, o + t.fragmentShader),
  51424. p.shaderSource(r, o + t.vertexShader),
  51425. p.compileShader(n),
  51426. p.compileShader(r),
  51427. p.attachShader(i, n),
  51428. p.attachShader(i, r),
  51429. p.linkProgram(i),
  51430. i
  51431. }
  51432. var o, a, s, l, c, h, u, d, p = e.context, f = e.state;
  51433. this.render = function(r, g, m) {
  51434. if (0 !== t.length) {
  51435. var v = new n.Vector3
  51436. , A = m.w / m.z
  51437. , y = .5 * m.z
  51438. , C = .5 * m.w
  51439. , I = 16 / m.w
  51440. , E = new n.Vector2(I * A,I)
  51441. , b = new n.Vector3(1,1,0)
  51442. , w = new n.Vector2(1,1);
  51443. void 0 === s && i(),
  51444. p.useProgram(s),
  51445. f.initAttributes(),
  51446. f.enableAttribute(l.vertex),
  51447. f.enableAttribute(l.uv),
  51448. f.disableUnusedAttributes(),
  51449. p.uniform1i(c.occlusionMap, 0),
  51450. p.uniform1i(c.map, 1),
  51451. p.bindBuffer(p.ARRAY_BUFFER, o),
  51452. p.vertexAttribPointer(l.vertex, 2, p.FLOAT, !1, 16, 0),
  51453. p.vertexAttribPointer(l.uv, 2, p.FLOAT, !1, 16, 8),
  51454. p.bindBuffer(p.ELEMENT_ARRAY_BUFFER, a),
  51455. f.disable(p.CULL_FACE),
  51456. f.setDepthWrite(!1);
  51457. for (var _ = 0, T = t.length; _ < T; _++) {
  51458. I = 16 / m.w,
  51459. E.set(I * A, I);
  51460. var x = t[_];
  51461. if (v.set(x.matrixWorld.elements[12], x.matrixWorld.elements[13], x.matrixWorld.elements[14]),
  51462. v.applyMatrix4(g.matrixWorldInverse),
  51463. v.applyProjection(g.projectionMatrix),
  51464. b.copy(v),
  51465. w.x = b.x * y + y,
  51466. w.y = b.y * C + C,
  51467. h || w.x > 0 && w.x < m.z && w.y > 0 && w.y < m.w) {
  51468. f.activeTexture(p.TEXTURE0),
  51469. f.bindTexture(p.TEXTURE_2D, null),
  51470. f.activeTexture(p.TEXTURE1),
  51471. f.bindTexture(p.TEXTURE_2D, u),
  51472. p.copyTexImage2D(p.TEXTURE_2D, 0, p.RGB, m.x + w.x - 8, m.y + w.y - 8, 16, 16, 0),
  51473. p.uniform1i(c.renderType, 0),
  51474. p.uniform2f(c.scale, E.x, E.y),
  51475. p.uniform3f(c.screenPosition, b.x, b.y, b.z),
  51476. f.disable(p.BLEND),
  51477. f.enable(p.DEPTH_TEST),
  51478. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0),
  51479. f.activeTexture(p.TEXTURE0),
  51480. f.bindTexture(p.TEXTURE_2D, d),
  51481. p.copyTexImage2D(p.TEXTURE_2D, 0, p.RGBA, m.x + w.x - 8, m.y + w.y - 8, 16, 16, 0),
  51482. p.uniform1i(c.renderType, 1),
  51483. f.disable(p.DEPTH_TEST),
  51484. f.activeTexture(p.TEXTURE1),
  51485. f.bindTexture(p.TEXTURE_2D, u),
  51486. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0),
  51487. x.positionScreen.copy(b),
  51488. x.customUpdateCallback ? x.customUpdateCallback(x) : x.updateLensFlares(),
  51489. p.uniform1i(c.renderType, 2),
  51490. f.enable(p.BLEND);
  51491. for (var S = 0, M = x.lensFlares.length; S < M; S++) {
  51492. var R = x.lensFlares[S];
  51493. R.opacity > .001 && R.scale > .001 && (b.x = R.x,
  51494. b.y = R.y,
  51495. b.z = R.z,
  51496. I = R.size * R.scale / m.w,
  51497. E.x = I * A,
  51498. E.y = I,
  51499. p.uniform3f(c.screenPosition, b.x, b.y, b.z),
  51500. p.uniform2f(c.scale, E.x, E.y),
  51501. p.uniform1f(c.rotation, R.rotation),
  51502. p.uniform1f(c.opacity, R.opacity),
  51503. p.uniform3f(c.color, R.color.r, R.color.g, R.color.b),
  51504. f.setBlending(R.blending, R.blendEquation, R.blendSrc, R.blendDst),
  51505. e.setTexture(R.texture, 1),
  51506. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0))
  51507. }
  51508. }
  51509. }
  51510. f.enable(p.CULL_FACE),
  51511. f.enable(p.DEPTH_TEST),
  51512. f.setDepthWrite(!0),
  51513. e.resetGLState()
  51514. }
  51515. }
  51516. }
  51517. ,
  51518. n.SpritePlugin = function(e, t) {
  51519. function i() {
  51520. var e = new Float32Array([-.5, -.5, 0, 0, .5, -.5, 1, 0, .5, .5, 1, 1, -.5, .5, 0, 1])
  51521. , t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  51522. a = d.createBuffer(),
  51523. s = d.createBuffer(),
  51524. d.bindBuffer(d.ARRAY_BUFFER, a),
  51525. d.bufferData(d.ARRAY_BUFFER, e, d.STATIC_DRAW),
  51526. d.bindBuffer(d.ELEMENT_ARRAY_BUFFER, s),
  51527. d.bufferData(d.ELEMENT_ARRAY_BUFFER, t, d.STATIC_DRAW),
  51528. l = r(),
  51529. c = {
  51530. position: d.getAttribLocation(l, "position"),
  51531. uv: d.getAttribLocation(l, "uv")
  51532. },
  51533. h = {
  51534. uvOffset: d.getUniformLocation(l, "uvOffset"),
  51535. uvScale: d.getUniformLocation(l, "uvScale"),
  51536. rotation: d.getUniformLocation(l, "rotation"),
  51537. scale: d.getUniformLocation(l, "scale"),
  51538. color: d.getUniformLocation(l, "color"),
  51539. map: d.getUniformLocation(l, "map"),
  51540. opacity: d.getUniformLocation(l, "opacity"),
  51541. modelViewMatrix: d.getUniformLocation(l, "modelViewMatrix"),
  51542. projectionMatrix: d.getUniformLocation(l, "projectionMatrix"),
  51543. fogType: d.getUniformLocation(l, "fogType"),
  51544. fogDensity: d.getUniformLocation(l, "fogDensity"),
  51545. fogNear: d.getUniformLocation(l, "fogNear"),
  51546. fogFar: d.getUniformLocation(l, "fogFar"),
  51547. fogColor: d.getUniformLocation(l, "fogColor"),
  51548. alphaTest: d.getUniformLocation(l, "alphaTest")
  51549. };
  51550. var i = document.createElement("canvas");
  51551. i.width = 8,
  51552. i.height = 8;
  51553. var o = i.getContext("2d");
  51554. o.fillStyle = "white",
  51555. o.fillRect(0, 0, 8, 8),
  51556. u = new n.Texture(i),
  51557. u.needsUpdate = !0
  51558. }
  51559. function r() {
  51560. var t = d.createProgram()
  51561. , i = d.createShader(d.VERTEX_SHADER)
  51562. , n = d.createShader(d.FRAGMENT_SHADER);
  51563. return d.shaderSource(i, ["precision " + e.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")),
  51564. d.shaderSource(n, ["precision " + e.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")),
  51565. d.compileShader(i),
  51566. d.compileShader(n),
  51567. d.attachShader(t, i),
  51568. d.attachShader(t, n),
  51569. d.linkProgram(t),
  51570. t
  51571. }
  51572. function o(e, t) {
  51573. return e.renderOrder !== t.renderOrder ? e.renderOrder - t.renderOrder : e.z !== t.z ? t.z - e.z : t.id - e.id
  51574. }
  51575. var a, s, l, c, h, u, d = e.context, p = e.state, f = new n.Vector3, g = new n.Quaternion, m = new n.Vector3;
  51576. this.render = function(r, v) {
  51577. if (0 !== t.length) {
  51578. void 0 === l && i(),
  51579. d.useProgram(l),
  51580. p.initAttributes(),
  51581. p.enableAttribute(c.position),
  51582. p.enableAttribute(c.uv),
  51583. p.disableUnusedAttributes(),
  51584. p.disable(d.CULL_FACE),
  51585. p.enable(d.BLEND),
  51586. d.bindBuffer(d.ARRAY_BUFFER, a),
  51587. d.vertexAttribPointer(c.position, 2, d.FLOAT, !1, 16, 0),
  51588. d.vertexAttribPointer(c.uv, 2, d.FLOAT, !1, 16, 8),
  51589. d.bindBuffer(d.ELEMENT_ARRAY_BUFFER, s),
  51590. d.uniformMatrix4fv(h.projectionMatrix, !1, v.projectionMatrix.elements),
  51591. p.activeTexture(d.TEXTURE0),
  51592. d.uniform1i(h.map, 0);
  51593. var A = 0
  51594. , y = 0
  51595. , C = r.fog;
  51596. C ? (d.uniform3f(h.fogColor, C.color.r, C.color.g, C.color.b),
  51597. C instanceof n.Fog ? (d.uniform1f(h.fogNear, C.near),
  51598. d.uniform1f(h.fogFar, C.far),
  51599. d.uniform1i(h.fogType, 1),
  51600. A = 1,
  51601. y = 1) : C instanceof n.FogExp2 && (d.uniform1f(h.fogDensity, C.density),
  51602. d.uniform1i(h.fogType, 2),
  51603. A = 2,
  51604. y = 2)) : (d.uniform1i(h.fogType, 0),
  51605. A = 0,
  51606. y = 0);
  51607. for (var I = 0, E = t.length; I < E; I++) {
  51608. var b = t[I];
  51609. b.modelViewMatrix.multiplyMatrices(v.matrixWorldInverse, b.matrixWorld),
  51610. b.z = -b.modelViewMatrix.elements[14]
  51611. }
  51612. t.sort(o);
  51613. for (var w = [], I = 0, E = t.length; I < E; I++) {
  51614. var b = t[I]
  51615. , _ = b.material;
  51616. d.uniform1f(h.alphaTest, _.alphaTest),
  51617. d.uniformMatrix4fv(h.modelViewMatrix, !1, b.modelViewMatrix.elements),
  51618. b.matrixWorld.decompose(f, g, m),
  51619. w[0] = m.x,
  51620. w[1] = m.y;
  51621. var T = 0;
  51622. r.fog && _.fog && (T = y),
  51623. A !== T && (d.uniform1i(h.fogType, T),
  51624. A = T),
  51625. null !== _.map ? (d.uniform2f(h.uvOffset, _.map.offset.x, _.map.offset.y),
  51626. d.uniform2f(h.uvScale, _.map.repeat.x, _.map.repeat.y)) : (d.uniform2f(h.uvOffset, 0, 0),
  51627. d.uniform2f(h.uvScale, 1, 1)),
  51628. d.uniform1f(h.opacity, _.opacity),
  51629. d.uniform3f(h.color, _.color.r, _.color.g, _.color.b),
  51630. d.uniform1f(h.rotation, _.rotation),
  51631. d.uniform2fv(h.scale, w),
  51632. p.setBlending(_.blending, _.blendEquation, _.blendSrc, _.blendDst),
  51633. p.setDepthTest(_.depthTest),
  51634. p.setDepthWrite(_.depthWrite),
  51635. _.map && _.map.image && _.map.image.width ? e.setTexture(_.map, 0) : e.setTexture(u, 0),
  51636. d.drawElements(d.TRIANGLES, 6, d.UNSIGNED_SHORT, 0)
  51637. }
  51638. p.enable(d.CULL_FACE),
  51639. e.resetGLState()
  51640. }
  51641. }
  51642. }
  51643. ,
  51644. Object.defineProperties(n.Box2.prototype, {
  51645. empty: {
  51646. value: function() {
  51647. return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),
  51648. this.isEmpty()
  51649. }
  51650. },
  51651. isIntersectionBox: {
  51652. value: function(e) {
  51653. return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),
  51654. this.intersectsBox(e)
  51655. }
  51656. }
  51657. }),
  51658. Object.defineProperties(n.Box3.prototype, {
  51659. empty: {
  51660. value: function() {
  51661. return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),
  51662. this.isEmpty()
  51663. }
  51664. },
  51665. isIntersectionBox: {
  51666. value: function(e) {
  51667. return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),
  51668. this.intersectsBox(e)
  51669. }
  51670. },
  51671. isIntersectionSphere: {
  51672. value: function(e) {
  51673. return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  51674. this.intersectsSphere(e)
  51675. }
  51676. }
  51677. }),
  51678. Object.defineProperties(n.Matrix3.prototype, {
  51679. multiplyVector3: {
  51680. value: function(e) {
  51681. return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),
  51682. e.applyMatrix3(this)
  51683. }
  51684. },
  51685. multiplyVector3Array: {
  51686. value: function(e) {
  51687. return console.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  51688. this.applyToVector3Array(e)
  51689. }
  51690. }
  51691. }),
  51692. Object.defineProperties(n.Matrix4.prototype, {
  51693. extractPosition: {
  51694. value: function(e) {
  51695. return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),
  51696. this.copyPosition(e)
  51697. }
  51698. },
  51699. setRotationFromQuaternion: {
  51700. value: function(e) {
  51701. return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),
  51702. this.makeRotationFromQuaternion(e)
  51703. }
  51704. },
  51705. multiplyVector3: {
  51706. value: function(e) {
  51707. return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead."),
  51708. e.applyProjection(this)
  51709. }
  51710. },
  51711. multiplyVector4: {
  51712. value: function(e) {
  51713. return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  51714. e.applyMatrix4(this)
  51715. }
  51716. },
  51717. multiplyVector3Array: {
  51718. value: function(e) {
  51719. return console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  51720. this.applyToVector3Array(e)
  51721. }
  51722. },
  51723. rotateAxis: {
  51724. value: function(e) {
  51725. console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),
  51726. e.transformDirection(this)
  51727. }
  51728. },
  51729. crossVector: {
  51730. value: function(e) {
  51731. return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  51732. e.applyMatrix4(this)
  51733. }
  51734. },
  51735. translate: {
  51736. value: function(e) {
  51737. console.error("THREE.Matrix4: .translate() has been removed.")
  51738. }
  51739. },
  51740. rotateX: {
  51741. value: function(e) {
  51742. console.error("THREE.Matrix4: .rotateX() has been removed.")
  51743. }
  51744. },
  51745. rotateY: {
  51746. value: function(e) {
  51747. console.error("THREE.Matrix4: .rotateY() has been removed.")
  51748. }
  51749. },
  51750. rotateZ: {
  51751. value: function(e) {
  51752. console.error("THREE.Matrix4: .rotateZ() has been removed.")
  51753. }
  51754. },
  51755. rotateByAxis: {
  51756. value: function(e, t) {
  51757. console.error("THREE.Matrix4: .rotateByAxis() has been removed.")
  51758. }
  51759. }
  51760. }),
  51761. Object.defineProperties(n.Plane.prototype, {
  51762. isIntersectionLine: {
  51763. value: function(e) {
  51764. return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),
  51765. this.intersectsLine(e)
  51766. }
  51767. }
  51768. }),
  51769. Object.defineProperties(n.Quaternion.prototype, {
  51770. multiplyVector3: {
  51771. value: function(e) {
  51772. return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),
  51773. e.applyQuaternion(this)
  51774. }
  51775. }
  51776. }),
  51777. Object.defineProperties(n.Ray.prototype, {
  51778. isIntersectionBox: {
  51779. value: function(e) {
  51780. return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),
  51781. this.intersectsBox(e)
  51782. }
  51783. },
  51784. isIntersectionPlane: {
  51785. value: function(e) {
  51786. return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),
  51787. this.intersectsPlane(e)
  51788. }
  51789. },
  51790. isIntersectionSphere: {
  51791. value: function(e) {
  51792. return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  51793. this.intersectsSphere(e)
  51794. }
  51795. }
  51796. }),
  51797. Object.defineProperties(n.Vector3.prototype, {
  51798. setEulerFromRotationMatrix: {
  51799. value: function() {
  51800. console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")
  51801. }
  51802. },
  51803. setEulerFromQuaternion: {
  51804. value: function() {
  51805. console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")
  51806. }
  51807. },
  51808. getPositionFromMatrix: {
  51809. value: function(e) {
  51810. return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),
  51811. this.setFromMatrixPosition(e)
  51812. }
  51813. },
  51814. getScaleFromMatrix: {
  51815. value: function(e) {
  51816. return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),
  51817. this.setFromMatrixScale(e)
  51818. }
  51819. },
  51820. getColumnFromMatrix: {
  51821. value: function(e, t) {
  51822. return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),
  51823. this.setFromMatrixColumn(e, t)
  51824. }
  51825. }
  51826. }),
  51827. n.Face4 = function(e, t, i, r, o, a, s) {
  51828. return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),
  51829. new n.Face3(e,t,i,o,a,s)
  51830. }
  51831. ,
  51832. n.Vertex = function(e, t, i) {
  51833. return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),
  51834. new n.Vector3(e,t,i)
  51835. }
  51836. ,
  51837. Object.defineProperties(n.Object3D.prototype, {
  51838. eulerOrder: {
  51839. get: function() {
  51840. return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  51841. this.rotation.order
  51842. },
  51843. set: function(e) {
  51844. console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  51845. this.rotation.order = e
  51846. }
  51847. },
  51848. getChildByName: {
  51849. value: function(e) {
  51850. return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),
  51851. this.getObjectByName(e)
  51852. }
  51853. },
  51854. renderDepth: {
  51855. set: function(e) {
  51856. console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")
  51857. }
  51858. },
  51859. translate: {
  51860. value: function(e, t) {
  51861. return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),
  51862. this.translateOnAxis(t, e)
  51863. }
  51864. },
  51865. useQuaternion: {
  51866. get: function() {
  51867. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  51868. },
  51869. set: function(e) {
  51870. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  51871. }
  51872. }
  51873. }),
  51874. Object.defineProperties(n, {
  51875. PointCloud: {
  51876. value: function(e, t) {
  51877. return console.warn("THREE.PointCloud has been renamed to THREE.Points."),
  51878. new n.Points(e,t)
  51879. }
  51880. },
  51881. ParticleSystem: {
  51882. value: function(e, t) {
  51883. return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),
  51884. new n.Points(e,t)
  51885. }
  51886. }
  51887. }),
  51888. Object.defineProperties(n.Light.prototype, {
  51889. onlyShadow: {
  51890. set: function(e) {
  51891. console.warn("THREE.Light: .onlyShadow has been removed.")
  51892. }
  51893. },
  51894. shadowCameraFov: {
  51895. set: function(e) {
  51896. console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),
  51897. this.shadow.camera.fov = e
  51898. }
  51899. },
  51900. shadowCameraLeft: {
  51901. set: function(e) {
  51902. console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),
  51903. this.shadow.camera.left = e
  51904. }
  51905. },
  51906. shadowCameraRight: {
  51907. set: function(e) {
  51908. console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),
  51909. this.shadow.camera.right = e
  51910. }
  51911. },
  51912. shadowCameraTop: {
  51913. set: function(e) {
  51914. console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),
  51915. this.shadow.camera.top = e
  51916. }
  51917. },
  51918. shadowCameraBottom: {
  51919. set: function(e) {
  51920. console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),
  51921. this.shadow.camera.bottom = e
  51922. }
  51923. },
  51924. shadowCameraNear: {
  51925. set: function(e) {
  51926. console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),
  51927. this.shadow.camera.near = e
  51928. }
  51929. },
  51930. shadowCameraFar: {
  51931. set: function(e) {
  51932. console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),
  51933. this.shadow.camera.far = e
  51934. }
  51935. },
  51936. shadowCameraVisible: {
  51937. set: function(e) {
  51938. console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")
  51939. }
  51940. },
  51941. shadowBias: {
  51942. set: function(e) {
  51943. console.warn("THREE.Light: .shadowBias is now .shadow.bias."),
  51944. this.shadow.bias = e
  51945. }
  51946. },
  51947. shadowDarkness: {
  51948. set: function(e) {
  51949. console.warn("THREE.Light: .shadowDarkness has been removed.")
  51950. }
  51951. },
  51952. shadowMapWidth: {
  51953. set: function(e) {
  51954. console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),
  51955. this.shadow.mapSize.width = e
  51956. }
  51957. },
  51958. shadowMapHeight: {
  51959. set: function(e) {
  51960. console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),
  51961. this.shadow.mapSize.height = e
  51962. }
  51963. }
  51964. }),
  51965. Object.defineProperties(n.BufferAttribute.prototype, {
  51966. length: {
  51967. get: function() {
  51968. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  51969. this.array.length
  51970. }
  51971. }
  51972. }),
  51973. Object.defineProperties(n.BufferGeometry.prototype, {
  51974. drawcalls: {
  51975. get: function() {
  51976. return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),
  51977. this.groups
  51978. }
  51979. },
  51980. offsets: {
  51981. get: function() {
  51982. return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),
  51983. this.groups
  51984. }
  51985. },
  51986. addIndex: {
  51987. value: function(e) {
  51988. console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),
  51989. this.setIndex(e)
  51990. }
  51991. },
  51992. addDrawCall: {
  51993. value: function(e, t, i) {
  51994. void 0 !== i && console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),
  51995. console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),
  51996. this.addGroup(e, t)
  51997. }
  51998. },
  51999. clearDrawCalls: {
  52000. value: function() {
  52001. console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),
  52002. this.clearGroups()
  52003. }
  52004. },
  52005. computeTangents: {
  52006. value: function() {
  52007. console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")
  52008. }
  52009. },
  52010. computeOffsets: {
  52011. value: function() {
  52012. console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")
  52013. }
  52014. }
  52015. }),
  52016. Object.defineProperties(n.Material.prototype, {
  52017. wrapAround: {
  52018. get: function() {
  52019. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  52020. },
  52021. set: function(e) {
  52022. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  52023. }
  52024. },
  52025. wrapRGB: {
  52026. get: function() {
  52027. return console.warn("THREE." + this.type + ": .wrapRGB has been removed."),
  52028. new n.Color
  52029. }
  52030. }
  52031. }),
  52032. Object.defineProperties(n, {
  52033. PointCloudMaterial: {
  52034. value: function(e) {
  52035. return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),
  52036. new n.PointsMaterial(e)
  52037. }
  52038. },
  52039. ParticleBasicMaterial: {
  52040. value: function(e) {
  52041. return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),
  52042. new n.PointsMaterial(e)
  52043. }
  52044. },
  52045. ParticleSystemMaterial: {
  52046. value: function(e) {
  52047. return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),
  52048. new n.PointsMaterial(e)
  52049. }
  52050. }
  52051. }),
  52052. Object.defineProperties(n.MeshPhongMaterial.prototype, {
  52053. metal: {
  52054. get: function() {
  52055. return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),
  52056. !1
  52057. },
  52058. set: function(e) {
  52059. console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")
  52060. }
  52061. }
  52062. }),
  52063. Object.defineProperties(n.ShaderMaterial.prototype, {
  52064. derivatives: {
  52065. get: function() {
  52066. return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  52067. this.extensions.derivatives
  52068. },
  52069. set: function(e) {
  52070. console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  52071. this.extensions.derivatives = e
  52072. }
  52073. }
  52074. }),
  52075. Object.defineProperties(n.WebGLRenderer.prototype, {
  52076. supportsFloatTextures: {
  52077. value: function() {
  52078. return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),
  52079. this.extensions.get("OES_texture_float")
  52080. }
  52081. },
  52082. supportsHalfFloatTextures: {
  52083. value: function() {
  52084. return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),
  52085. this.extensions.get("OES_texture_half_float")
  52086. }
  52087. },
  52088. supportsStandardDerivatives: {
  52089. value: function() {
  52090. return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),
  52091. this.extensions.get("OES_standard_derivatives")
  52092. }
  52093. },
  52094. supportsCompressedTextureS3TC: {
  52095. value: function() {
  52096. return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),
  52097. this.extensions.get("WEBGL_compressed_texture_s3tc")
  52098. }
  52099. },
  52100. supportsCompressedTexturePVRTC: {
  52101. value: function() {
  52102. return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),
  52103. this.extensions.get("WEBGL_compressed_texture_pvrtc")
  52104. }
  52105. },
  52106. supportsBlendMinMax: {
  52107. value: function() {
  52108. return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),
  52109. this.extensions.get("EXT_blend_minmax")
  52110. }
  52111. },
  52112. supportsVertexTextures: {
  52113. value: function() {
  52114. return this.capabilities.vertexTextures
  52115. }
  52116. },
  52117. supportsInstancedArrays: {
  52118. value: function() {
  52119. return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),
  52120. this.extensions.get("ANGLE_instanced_arrays")
  52121. }
  52122. },
  52123. enableScissorTest: {
  52124. value: function(e) {
  52125. console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),
  52126. this.setScissorTest(e)
  52127. }
  52128. },
  52129. initMaterial: {
  52130. value: function() {
  52131. console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")
  52132. }
  52133. },
  52134. addPrePlugin: {
  52135. value: function() {
  52136. console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")
  52137. }
  52138. },
  52139. addPostPlugin: {
  52140. value: function() {
  52141. console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")
  52142. }
  52143. },
  52144. updateShadowMap: {
  52145. value: function() {
  52146. console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")
  52147. }
  52148. },
  52149. shadowMapEnabled: {
  52150. get: function() {
  52151. return this.shadowMap.enabled
  52152. },
  52153. set: function(e) {
  52154. console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),
  52155. this.shadowMap.enabled = e
  52156. }
  52157. },
  52158. shadowMapType: {
  52159. get: function() {
  52160. return this.shadowMap.type
  52161. },
  52162. set: function(e) {
  52163. console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),
  52164. this.shadowMap.type = e
  52165. }
  52166. },
  52167. shadowMapCullFace: {
  52168. get: function() {
  52169. return this.shadowMap.cullFace
  52170. },
  52171. set: function(e) {
  52172. console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace."),
  52173. this.shadowMap.cullFace = e
  52174. }
  52175. }
  52176. }),
  52177. Object.defineProperties(n.WebGLRenderTarget.prototype, {
  52178. wrapS: {
  52179. get: function() {
  52180. return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  52181. this.texture.wrapS
  52182. },
  52183. set: function(e) {
  52184. console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  52185. this.texture.wrapS = e
  52186. }
  52187. },
  52188. wrapT: {
  52189. get: function() {
  52190. return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  52191. this.texture.wrapT
  52192. },
  52193. set: function(e) {
  52194. console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  52195. this.texture.wrapT = e
  52196. }
  52197. },
  52198. magFilter: {
  52199. get: function() {
  52200. return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  52201. this.texture.magFilter
  52202. },
  52203. set: function(e) {
  52204. console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  52205. this.texture.magFilter = e
  52206. }
  52207. },
  52208. minFilter: {
  52209. get: function() {
  52210. return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  52211. this.texture.minFilter
  52212. },
  52213. set: function(e) {
  52214. console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  52215. this.texture.minFilter = e
  52216. }
  52217. },
  52218. anisotropy: {
  52219. get: function() {
  52220. return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  52221. this.texture.anisotropy
  52222. },
  52223. set: function(e) {
  52224. console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  52225. this.texture.anisotropy = e
  52226. }
  52227. },
  52228. offset: {
  52229. get: function() {
  52230. return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  52231. this.texture.offset
  52232. },
  52233. set: function(e) {
  52234. console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  52235. this.texture.offset = e
  52236. }
  52237. },
  52238. repeat: {
  52239. get: function() {
  52240. return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  52241. this.texture.repeat
  52242. },
  52243. set: function(e) {
  52244. console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  52245. this.texture.repeat = e
  52246. }
  52247. },
  52248. format: {
  52249. get: function() {
  52250. return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  52251. this.texture.format
  52252. },
  52253. set: function(e) {
  52254. console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  52255. this.texture.format = e
  52256. }
  52257. },
  52258. type: {
  52259. get: function() {
  52260. return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  52261. this.texture.type
  52262. },
  52263. set: function(e) {
  52264. console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  52265. this.texture.type = e
  52266. }
  52267. },
  52268. generateMipmaps: {
  52269. get: function() {
  52270. return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  52271. this.texture.generateMipmaps
  52272. },
  52273. set: function(e) {
  52274. console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  52275. this.texture.generateMipmaps = e
  52276. }
  52277. }
  52278. }),
  52279. n.GeometryUtils = {
  52280. merge: function(e, t, i) {
  52281. console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.");
  52282. var r;
  52283. t instanceof n.Mesh && (t.matrixAutoUpdate && t.updateMatrix(),
  52284. r = t.matrix,
  52285. t = t.geometry),
  52286. e.merge(t, r, i)
  52287. },
  52288. center: function(e) {
  52289. return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),
  52290. e.center()
  52291. }
  52292. },
  52293. n.ImageUtils = {
  52294. crossOrigin: void 0,
  52295. loadTexture: function(e, t, i, r) {
  52296. console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");
  52297. var o = new n.TextureLoader;
  52298. o.setCrossOrigin(this.crossOrigin);
  52299. var a = o.load(e, i, void 0, r);
  52300. return t && (a.mapping = t),
  52301. a
  52302. },
  52303. loadTextureCube: function(e, t, i, r) {
  52304. console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");
  52305. var o = new n.CubeTextureLoader;
  52306. o.setCrossOrigin(this.crossOrigin);
  52307. var a = o.load(e, i, void 0, r);
  52308. return t && (a.mapping = t),
  52309. a
  52310. },
  52311. loadCompressedTexture: function() {
  52312. console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")
  52313. },
  52314. loadCompressedTextureCube: function() {
  52315. console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")
  52316. }
  52317. },
  52318. n.Projector = function() {
  52319. console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),
  52320. this.projectVector = function(e, t) {
  52321. console.warn("THREE.Projector: .projectVector() is now vector.project()."),
  52322. e.project(t)
  52323. }
  52324. ,
  52325. this.unprojectVector = function(e, t) {
  52326. console.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),
  52327. e.unproject(t)
  52328. }
  52329. ,
  52330. this.pickingRay = function(e, t) {
  52331. console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")
  52332. }
  52333. }
  52334. ,
  52335. n.CanvasRenderer = function() {
  52336. console.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"),
  52337. this.domElement = document.createElement("canvas"),
  52338. this.clear = function() {}
  52339. ,
  52340. this.render = function() {}
  52341. ,
  52342. this.setClearColor = function() {}
  52343. ,
  52344. this.setSize = function() {}
  52345. }
  52346. ,
  52347. n.MeshFaceMaterial = n.MultiMaterial,
  52348. n.CurveUtils = {
  52349. tangentQuadraticBezier: function(e, t, i, n) {
  52350. return 2 * (1 - e) * (i - t) + 2 * e * (n - i)
  52351. },
  52352. tangentCubicBezier: function(e, t, i, n, r) {
  52353. 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
  52354. },
  52355. tangentSpline: function(e, t, i, n, r) {
  52356. var o = 6 * e * e - 6 * e
  52357. , a = 3 * e * e - 4 * e + 1
  52358. , s = -6 * e * e + 6 * e
  52359. , l = 3 * e * e - 2 * e;
  52360. return o + a + s + l
  52361. },
  52362. interpolate: function(e, t, i, n, r) {
  52363. var o = .5 * (i - e)
  52364. , a = .5 * (n - t)
  52365. , s = r * r
  52366. , l = r * s;
  52367. return (2 * t - 2 * i + o + a) * l + (-3 * t + 3 * i - 2 * o - a) * s + o * r + t
  52368. }
  52369. },
  52370. n.SceneUtils = {
  52371. createMultiMaterialObject: function(e, t) {
  52372. for (var i = new n.Group, r = 0, o = t.length; r < o; r++)
  52373. i.add(new n.Mesh(e,t[r]));
  52374. return i
  52375. },
  52376. detach: function(e, t, i) {
  52377. e.applyMatrix(t.matrixWorld),
  52378. t.remove(e),
  52379. i.add(e)
  52380. },
  52381. attach: function(e, t, i) {
  52382. var r = new n.Matrix4;
  52383. r.getInverse(i.matrixWorld),
  52384. e.applyMatrix(r),
  52385. t.remove(e),
  52386. i.add(e)
  52387. }
  52388. },
  52389. n.ShapeUtils = {
  52390. area: function(e) {
  52391. for (var t = e.length, i = 0, n = t - 1, r = 0; r < t; n = r++)
  52392. i += e[n].x * e[r].y - e[r].x * e[n].y;
  52393. return .5 * i
  52394. },
  52395. triangulate: function() {
  52396. function e(e, t, i, n, r, o) {
  52397. var a, s, l, c, h, u, d, p, f;
  52398. if (s = e[o[t]].x,
  52399. l = e[o[t]].y,
  52400. c = e[o[i]].x,
  52401. h = e[o[i]].y,
  52402. u = e[o[n]].x,
  52403. d = e[o[n]].y,
  52404. Number.EPSILON > (c - s) * (d - l) - (h - l) * (u - s))
  52405. return !1;
  52406. var g, m, v, A, y, C, I, E, b, w, _, T, x, S, M;
  52407. for (g = u - c,
  52408. m = d - h,
  52409. v = s - u,
  52410. A = l - d,
  52411. y = c - s,
  52412. C = h - l,
  52413. a = 0; a < r; a++)
  52414. if (p = e[o[a]].x,
  52415. f = e[o[a]].y,
  52416. !(p === s && f === l || p === c && f === h || p === u && f === d) && (I = p - s,
  52417. E = f - l,
  52418. b = p - c,
  52419. w = f - h,
  52420. _ = p - u,
  52421. T = f - d,
  52422. M = g * w - m * b,
  52423. x = y * E - C * I,
  52424. S = v * T - A * _,
  52425. M >= -Number.EPSILON && S >= -Number.EPSILON && x >= -Number.EPSILON))
  52426. return !1;
  52427. return !0
  52428. }
  52429. return function(t, i) {
  52430. var r = t.length;
  52431. if (r < 3)
  52432. return null;
  52433. var o, a, s, l = [], c = [], h = [];
  52434. if (n.ShapeUtils.area(t) > 0)
  52435. for (a = 0; a < r; a++)
  52436. c[a] = a;
  52437. else
  52438. for (a = 0; a < r; a++)
  52439. c[a] = r - 1 - a;
  52440. var u = r
  52441. , d = 2 * u;
  52442. for (a = u - 1; u > 2; ) {
  52443. if (d-- <= 0)
  52444. return console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()"),
  52445. i ? h : l;
  52446. if (o = a,
  52447. u <= o && (o = 0),
  52448. a = o + 1,
  52449. u <= a && (a = 0),
  52450. s = a + 1,
  52451. u <= s && (s = 0),
  52452. e(t, o, a, s, u, c)) {
  52453. var p, f, g, m, v;
  52454. for (p = c[o],
  52455. f = c[a],
  52456. g = c[s],
  52457. l.push([t[p], t[f], t[g]]),
  52458. h.push([c[o], c[a], c[s]]),
  52459. m = a,
  52460. v = a + 1; v < u; m++,
  52461. v++)
  52462. c[m] = c[v];
  52463. u--,
  52464. d = 2 * u
  52465. }
  52466. }
  52467. return i ? h : l
  52468. }
  52469. }(),
  52470. triangulateShape: function(e, t) {
  52471. function i(e, t, i) {
  52472. 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
  52473. }
  52474. function r(e, t, n, r, o) {
  52475. var a = t.x - e.x
  52476. , s = t.y - e.y
  52477. , l = r.x - n.x
  52478. , c = r.y - n.y
  52479. , h = e.x - n.x
  52480. , u = e.y - n.y
  52481. , d = s * l - a * c
  52482. , p = s * h - a * u;
  52483. if (Math.abs(d) > Number.EPSILON) {
  52484. var f;
  52485. if (d > 0) {
  52486. if (p < 0 || p > d)
  52487. return [];
  52488. if (f = c * h - l * u,
  52489. f < 0 || f > d)
  52490. return []
  52491. } else {
  52492. if (p > 0 || p < d)
  52493. return [];
  52494. if (f = c * h - l * u,
  52495. f > 0 || f < d)
  52496. return []
  52497. }
  52498. if (0 === f)
  52499. return !o || 0 !== p && p !== d ? [e] : [];
  52500. if (f === d)
  52501. return !o || 0 !== p && p !== d ? [t] : [];
  52502. if (0 === p)
  52503. return [n];
  52504. if (p === d)
  52505. return [r];
  52506. var g = f / d;
  52507. return [{
  52508. x: e.x + g * a,
  52509. y: e.y + g * s
  52510. }]
  52511. }
  52512. if (0 !== p || c * h !== l * u)
  52513. return [];
  52514. var m = 0 === a && 0 === s
  52515. , v = 0 === l && 0 === c;
  52516. if (m && v)
  52517. return e.x !== n.x || e.y !== n.y ? [] : [e];
  52518. if (m)
  52519. return i(n, r, e) ? [e] : [];
  52520. if (v)
  52521. return i(e, t, n) ? [n] : [];
  52522. var A, y, C, I, E, b, w, _;
  52523. return 0 !== a ? (e.x < t.x ? (A = e,
  52524. C = e.x,
  52525. y = t,
  52526. I = t.x) : (A = t,
  52527. C = t.x,
  52528. y = e,
  52529. I = e.x),
  52530. n.x < r.x ? (E = n,
  52531. w = n.x,
  52532. b = r,
  52533. _ = r.x) : (E = r,
  52534. w = r.x,
  52535. b = n,
  52536. _ = n.x)) : (e.y < t.y ? (A = e,
  52537. C = e.y,
  52538. y = t,
  52539. I = t.y) : (A = t,
  52540. C = t.y,
  52541. y = e,
  52542. I = e.y),
  52543. n.y < r.y ? (E = n,
  52544. w = n.y,
  52545. b = r,
  52546. _ = r.y) : (E = r,
  52547. w = r.y,
  52548. b = n,
  52549. _ = n.y)),
  52550. C <= w ? I < w ? [] : I === w ? o ? [] : [E] : I <= _ ? [E, y] : [E, b] : C > _ ? [] : C === _ ? o ? [] : [A] : I <= _ ? [A, y] : [A, b]
  52551. }
  52552. function o(e, t, i, n) {
  52553. var r = t.x - e.x
  52554. , o = t.y - e.y
  52555. , a = i.x - e.x
  52556. , s = i.y - e.y
  52557. , l = n.x - e.x
  52558. , c = n.y - e.y
  52559. , h = r * s - o * a
  52560. , u = r * c - o * l;
  52561. if (Math.abs(h) > Number.EPSILON) {
  52562. var d = l * s - c * a;
  52563. return h > 0 ? u >= 0 && d >= 0 : u >= 0 || d >= 0
  52564. }
  52565. return u > 0
  52566. }
  52567. function a(e, t) {
  52568. function i(e, t) {
  52569. var i = A.length - 1
  52570. , n = e - 1;
  52571. n < 0 && (n = i);
  52572. var r = e + 1;
  52573. r > i && (r = 0);
  52574. var a = o(A[e], A[n], A[r], s[t]);
  52575. if (!a)
  52576. return !1;
  52577. var l = s.length - 1
  52578. , c = t - 1;
  52579. c < 0 && (c = l);
  52580. var h = t + 1;
  52581. return h > l && (h = 0),
  52582. a = o(s[t], s[c], s[h], A[e]),
  52583. !!a
  52584. }
  52585. function n(e, t) {
  52586. var i, n, o;
  52587. for (i = 0; i < A.length; i++)
  52588. if (n = i + 1,
  52589. n %= A.length,
  52590. o = r(e, t, A[i], A[n], !0),
  52591. o.length > 0)
  52592. return !0;
  52593. return !1
  52594. }
  52595. function a(e, i) {
  52596. var n, o, a, s, l;
  52597. for (n = 0; n < y.length; n++)
  52598. for (o = t[y[n]],
  52599. a = 0; a < o.length; a++)
  52600. if (s = a + 1,
  52601. s %= o.length,
  52602. l = r(e, i, o[a], o[s], !0),
  52603. l.length > 0)
  52604. return !0;
  52605. return !1
  52606. }
  52607. for (var s, l, c, h, u, d, p, f, g, m, v, A = e.concat(), y = [], C = [], I = 0, E = t.length; I < E; I++)
  52608. y.push(I);
  52609. for (var b = 0, w = 2 * y.length; y.length > 0; ) {
  52610. if (w--,
  52611. w < 0) {
  52612. console.log("Infinite Loop! Holes left:" + y.length + ", Probably Hole outside Shape!");
  52613. break
  52614. }
  52615. for (c = b; c < A.length; c++) {
  52616. h = A[c],
  52617. l = -1;
  52618. for (var I = 0; I < y.length; I++)
  52619. if (d = y[I],
  52620. p = h.x + ":" + h.y + ":" + d,
  52621. void 0 === C[p]) {
  52622. s = t[d];
  52623. for (var _ = 0; _ < s.length; _++)
  52624. if (u = s[_],
  52625. i(c, _) && !n(h, u) && !a(h, u)) {
  52626. l = _,
  52627. y.splice(I, 1),
  52628. f = A.slice(0, c + 1),
  52629. g = A.slice(c),
  52630. m = s.slice(l),
  52631. v = s.slice(0, l + 1),
  52632. A = f.concat(m).concat(v).concat(g),
  52633. b = c;
  52634. break
  52635. }
  52636. if (l >= 0)
  52637. break;
  52638. C[p] = !0
  52639. }
  52640. if (l >= 0)
  52641. break
  52642. }
  52643. }
  52644. return A
  52645. }
  52646. for (var s, l, c, h, u, d, p = {}, f = e.concat(), g = 0, m = t.length; g < m; g++)
  52647. Array.prototype.push.apply(f, t[g]);
  52648. for (s = 0,
  52649. l = f.length; s < l; s++)
  52650. u = f[s].x + ":" + f[s].y,
  52651. void 0 !== p[u] && console.warn("THREE.Shape: Duplicate point", u),
  52652. p[u] = s;
  52653. var v = a(e, t)
  52654. , A = n.ShapeUtils.triangulate(v, !1);
  52655. for (s = 0,
  52656. l = A.length; s < l; s++)
  52657. for (h = A[s],
  52658. c = 0; c < 3; c++)
  52659. u = h[c].x + ":" + h[c].y,
  52660. d = p[u],
  52661. void 0 !== d && (h[c] = d);
  52662. return A.concat()
  52663. },
  52664. isClockWise: function(e) {
  52665. return n.ShapeUtils.area(e) < 0
  52666. },
  52667. b2: function() {
  52668. function e(e, t) {
  52669. var i = 1 - e;
  52670. return i * i * t
  52671. }
  52672. function t(e, t) {
  52673. return 2 * (1 - e) * e * t
  52674. }
  52675. function i(e, t) {
  52676. return e * e * t
  52677. }
  52678. return function(n, r, o, a) {
  52679. return e(n, r) + t(n, o) + i(n, a)
  52680. }
  52681. }(),
  52682. b3: function() {
  52683. function e(e, t) {
  52684. var i = 1 - e;
  52685. return i * i * i * t
  52686. }
  52687. function t(e, t) {
  52688. var i = 1 - e;
  52689. return 3 * i * i * e * t
  52690. }
  52691. function i(e, t) {
  52692. var i = 1 - e;
  52693. return 3 * i * e * e * t
  52694. }
  52695. function n(e, t) {
  52696. return e * e * e * t
  52697. }
  52698. return function(r, o, a, s, l) {
  52699. return e(r, o) + t(r, a) + i(r, s) + n(r, l)
  52700. }
  52701. }()
  52702. },
  52703. n.Curve = function() {}
  52704. ,
  52705. n.Curve.prototype = {
  52706. constructor: n.Curve,
  52707. getPoint: function(e) {
  52708. return console.warn("THREE.Curve: Warning, getPoint() not implemented!"),
  52709. null
  52710. },
  52711. getPointAt: function(e) {
  52712. var t = this.getUtoTmapping(e);
  52713. return this.getPoint(t)
  52714. },
  52715. getPoints: function(e) {
  52716. e || (e = 5);
  52717. var t, i = [];
  52718. for (t = 0; t <= e; t++)
  52719. i.push(this.getPoint(t / e));
  52720. return i
  52721. },
  52722. getSpacedPoints: function(e) {
  52723. e || (e = 5);
  52724. var t, i = [];
  52725. for (t = 0; t <= e; t++)
  52726. i.push(this.getPointAt(t / e));
  52727. return i
  52728. },
  52729. getLength: function() {
  52730. var e = this.getLengths();
  52731. return e[e.length - 1]
  52732. },
  52733. getLengths: function(e) {
  52734. if (e || (e = this.__arcLengthDivisions ? this.__arcLengthDivisions : 200),
  52735. this.cacheArcLengths && this.cacheArcLengths.length === e + 1 && !this.needsUpdate)
  52736. return this.cacheArcLengths;
  52737. this.needsUpdate = !1;
  52738. var t, i, n = [], r = this.getPoint(0), o = 0;
  52739. for (n.push(0),
  52740. i = 1; i <= e; i++)
  52741. t = this.getPoint(i / e),
  52742. o += t.distanceTo(r),
  52743. n.push(o),
  52744. r = t;
  52745. return this.cacheArcLengths = n,
  52746. n
  52747. },
  52748. updateArcLengths: function() {
  52749. this.needsUpdate = !0,
  52750. this.getLengths()
  52751. },
  52752. getUtoTmapping: function(e, t) {
  52753. var i, n = this.getLengths(), r = 0, o = n.length;
  52754. i = t ? t : e * n[o - 1];
  52755. for (var a, s = 0, l = o - 1; s <= l; )
  52756. if (r = Math.floor(s + (l - s) / 2),
  52757. a = n[r] - i,
  52758. a < 0)
  52759. s = r + 1;
  52760. else {
  52761. if (!(a > 0)) {
  52762. l = r;
  52763. break
  52764. }
  52765. l = r - 1
  52766. }
  52767. if (r = l,
  52768. n[r] === i) {
  52769. var c = r / (o - 1);
  52770. return c
  52771. }
  52772. var h = n[r]
  52773. , u = n[r + 1]
  52774. , d = u - h
  52775. , p = (i - h) / d
  52776. , c = (r + p) / (o - 1);
  52777. return c
  52778. },
  52779. getTangent: function(e) {
  52780. var t = 1e-4
  52781. , i = e - t
  52782. , n = e + t;
  52783. i < 0 && (i = 0),
  52784. n > 1 && (n = 1);
  52785. var r = this.getPoint(i)
  52786. , o = this.getPoint(n)
  52787. , a = o.clone().sub(r);
  52788. return a.normalize()
  52789. },
  52790. getTangentAt: function(e) {
  52791. var t = this.getUtoTmapping(e);
  52792. return this.getTangent(t)
  52793. }
  52794. },
  52795. n.Curve.create = function(e, t) {
  52796. return e.prototype = Object.create(n.Curve.prototype),
  52797. e.prototype.constructor = e,
  52798. e.prototype.getPoint = t,
  52799. e
  52800. }
  52801. ,
  52802. n.CurvePath = function() {
  52803. this.curves = [],
  52804. this.autoClose = !1
  52805. }
  52806. ,
  52807. n.CurvePath.prototype = Object.create(n.Curve.prototype),
  52808. n.CurvePath.prototype.constructor = n.CurvePath,
  52809. n.CurvePath.prototype.add = function(e) {
  52810. this.curves.push(e)
  52811. }
  52812. ,
  52813. n.CurvePath.prototype.closePath = function() {
  52814. var e = this.curves[0].getPoint(0)
  52815. , t = this.curves[this.curves.length - 1].getPoint(1);
  52816. e.equals(t) || this.curves.push(new n.LineCurve(t,e))
  52817. }
  52818. ,
  52819. n.CurvePath.prototype.getPoint = function(e) {
  52820. for (var t = e * this.getLength(), i = this.getCurveLengths(), n = 0; n < i.length; ) {
  52821. if (i[n] >= t) {
  52822. var r = i[n] - t
  52823. , o = this.curves[n]
  52824. , a = 1 - r / o.getLength();
  52825. return o.getPointAt(a)
  52826. }
  52827. n++
  52828. }
  52829. return null
  52830. }
  52831. ,
  52832. n.CurvePath.prototype.getLength = function() {
  52833. var e = this.getCurveLengths();
  52834. return e[e.length - 1]
  52835. }
  52836. ,
  52837. n.CurvePath.prototype.getCurveLengths = function() {
  52838. if (this.cacheLengths && this.cacheLengths.length === this.curves.length)
  52839. return this.cacheLengths;
  52840. for (var e = [], t = 0, i = 0, n = this.curves.length; i < n; i++)
  52841. t += this.curves[i].getLength(),
  52842. e.push(t);
  52843. return this.cacheLengths = e,
  52844. e
  52845. }
  52846. ,
  52847. n.CurvePath.prototype.createPointsGeometry = function(e) {
  52848. var t = this.getPoints(e);
  52849. return this.createGeometry(t)
  52850. }
  52851. ,
  52852. n.CurvePath.prototype.createSpacedPointsGeometry = function(e) {
  52853. var t = this.getSpacedPoints(e);
  52854. return this.createGeometry(t)
  52855. }
  52856. ,
  52857. n.CurvePath.prototype.createGeometry = function(e) {
  52858. for (var t = new n.Geometry, i = 0, r = e.length; i < r; i++) {
  52859. var o = e[i];
  52860. t.vertices.push(new n.Vector3(o.x,o.y,o.z || 0))
  52861. }
  52862. return t
  52863. }
  52864. ,
  52865. n.Font = function(e) {
  52866. this.data = e
  52867. }
  52868. ,
  52869. n.Font.prototype = {
  52870. constructor: n.Font,
  52871. generateShapes: function(e, t, i) {
  52872. function r(e) {
  52873. for (var i = String(e).split(""), n = t / a.resolution, r = 0, s = [], l = 0; l < i.length; l++) {
  52874. var c = o(i[l], n, r);
  52875. r += c.offset,
  52876. s.push(c.path)
  52877. }
  52878. return s
  52879. }
  52880. function o(e, t, r) {
  52881. var o = a.glyphs[e] || a.glyphs["?"];
  52882. if (o) {
  52883. var s, l, c, h, u, d, p, f, g, m, v, A = new n.Path, y = [], C = n.ShapeUtils.b2, I = n.ShapeUtils.b3;
  52884. if (o.o)
  52885. for (var E = o._cachedOutline || (o._cachedOutline = o.o.split(" ")), b = 0, w = E.length; b < w; ) {
  52886. var _ = E[b++];
  52887. switch (_) {
  52888. case "m":
  52889. s = E[b++] * t + r,
  52890. l = E[b++] * t,
  52891. A.moveTo(s, l);
  52892. break;
  52893. case "l":
  52894. s = E[b++] * t + r,
  52895. l = E[b++] * t,
  52896. A.lineTo(s, l);
  52897. break;
  52898. case "q":
  52899. if (c = E[b++] * t + r,
  52900. h = E[b++] * t,
  52901. p = E[b++] * t + r,
  52902. f = E[b++] * t,
  52903. A.quadraticCurveTo(p, f, c, h),
  52904. v = y[y.length - 1]) {
  52905. u = v.x,
  52906. d = v.y;
  52907. for (var T = 1; T <= i; T++) {
  52908. var x = T / i;
  52909. C(x, u, p, c),
  52910. C(x, d, f, h)
  52911. }
  52912. }
  52913. break;
  52914. case "b":
  52915. if (c = E[b++] * t + r,
  52916. h = E[b++] * t,
  52917. p = E[b++] * t + r,
  52918. f = E[b++] * t,
  52919. g = E[b++] * t + r,
  52920. m = E[b++] * t,
  52921. A.bezierCurveTo(p, f, g, m, c, h),
  52922. v = y[y.length - 1]) {
  52923. u = v.x,
  52924. d = v.y;
  52925. for (var T = 1; T <= i; T++) {
  52926. var x = T / i;
  52927. I(x, u, p, g, c),
  52928. I(x, d, f, m, h)
  52929. }
  52930. }
  52931. }
  52932. }
  52933. return {
  52934. offset: o.ha * t,
  52935. path: A
  52936. }
  52937. }
  52938. }
  52939. void 0 === t && (t = 100),
  52940. void 0 === i && (i = 4);
  52941. for (var a = this.data, s = r(e), l = [], c = 0, h = s.length; c < h; c++)
  52942. Array.prototype.push.apply(l, s[c].toShapes());
  52943. return l
  52944. }
  52945. },
  52946. n.Path = function(e) {
  52947. n.CurvePath.call(this),
  52948. this.actions = [],
  52949. e && this.fromPoints(e)
  52950. }
  52951. ,
  52952. n.Path.prototype = Object.create(n.CurvePath.prototype),
  52953. n.Path.prototype.constructor = n.Path,
  52954. n.Path.prototype.fromPoints = function(e) {
  52955. this.moveTo(e[0].x, e[0].y);
  52956. for (var t = 1, i = e.length; t < i; t++)
  52957. this.lineTo(e[t].x, e[t].y)
  52958. }
  52959. ,
  52960. n.Path.prototype.moveTo = function(e, t) {
  52961. this.actions.push({
  52962. action: "moveTo",
  52963. args: [e, t]
  52964. })
  52965. }
  52966. ,
  52967. n.Path.prototype.lineTo = function(e, t) {
  52968. var i = this.actions[this.actions.length - 1].args
  52969. , r = i[i.length - 2]
  52970. , o = i[i.length - 1]
  52971. , a = new n.LineCurve(new n.Vector2(r,o),new n.Vector2(e,t));
  52972. this.curves.push(a),
  52973. this.actions.push({
  52974. action: "lineTo",
  52975. args: [e, t]
  52976. })
  52977. }
  52978. ,
  52979. n.Path.prototype.quadraticCurveTo = function(e, t, i, r) {
  52980. var o = this.actions[this.actions.length - 1].args
  52981. , a = o[o.length - 2]
  52982. , s = o[o.length - 1]
  52983. , l = new n.QuadraticBezierCurve(new n.Vector2(a,s),new n.Vector2(e,t),new n.Vector2(i,r));
  52984. this.curves.push(l),
  52985. this.actions.push({
  52986. action: "quadraticCurveTo",
  52987. args: [e, t, i, r]
  52988. })
  52989. }
  52990. ,
  52991. n.Path.prototype.bezierCurveTo = function(e, t, i, r, o, a) {
  52992. var s = this.actions[this.actions.length - 1].args
  52993. , l = s[s.length - 2]
  52994. , c = s[s.length - 1]
  52995. , h = new n.CubicBezierCurve(new n.Vector2(l,c),new n.Vector2(e,t),new n.Vector2(i,r),new n.Vector2(o,a));
  52996. this.curves.push(h),
  52997. this.actions.push({
  52998. action: "bezierCurveTo",
  52999. args: [e, t, i, r, o, a]
  53000. })
  53001. }
  53002. ,
  53003. n.Path.prototype.splineThru = function(e) {
  53004. var t = Array.prototype.slice.call(arguments)
  53005. , i = this.actions[this.actions.length - 1].args
  53006. , r = i[i.length - 2]
  53007. , o = i[i.length - 1]
  53008. , a = [new n.Vector2(r,o)];
  53009. Array.prototype.push.apply(a, e);
  53010. var s = new n.SplineCurve(a);
  53011. this.curves.push(s),
  53012. this.actions.push({
  53013. action: "splineThru",
  53014. args: t
  53015. })
  53016. }
  53017. ,
  53018. n.Path.prototype.arc = function(e, t, i, n, r, o) {
  53019. var a = this.actions[this.actions.length - 1].args
  53020. , s = a[a.length - 2]
  53021. , l = a[a.length - 1];
  53022. this.absarc(e + s, t + l, i, n, r, o)
  53023. }
  53024. ,
  53025. n.Path.prototype.absarc = function(e, t, i, n, r, o) {
  53026. this.absellipse(e, t, i, i, n, r, o)
  53027. }
  53028. ,
  53029. n.Path.prototype.ellipse = function(e, t, i, n, r, o, a, s) {
  53030. var l = this.actions[this.actions.length - 1].args
  53031. , c = l[l.length - 2]
  53032. , h = l[l.length - 1];
  53033. this.absellipse(e + c, t + h, i, n, r, o, a, s)
  53034. }
  53035. ,
  53036. n.Path.prototype.absellipse = function(e, t, i, r, o, a, s, l) {
  53037. var c = [e, t, i, r, o, a, s, l || 0]
  53038. , h = new n.EllipseCurve(e,t,i,r,o,a,s,l);
  53039. this.curves.push(h);
  53040. var u = h.getPoint(1);
  53041. c.push(u.x),
  53042. c.push(u.y),
  53043. this.actions.push({
  53044. action: "ellipse",
  53045. args: c
  53046. })
  53047. }
  53048. ,
  53049. n.Path.prototype.getSpacedPoints = function(e) {
  53050. e || (e = 40);
  53051. for (var t = [], i = 0; i < e; i++)
  53052. t.push(this.getPoint(i / e));
  53053. return this.autoClose && t.push(t[0]),
  53054. t
  53055. }
  53056. ,
  53057. n.Path.prototype.getPoints = function(e) {
  53058. e = e || 12;
  53059. for (var t, i, r, o, a, s, l, c, h, u, d, p = n.ShapeUtils.b2, f = n.ShapeUtils.b3, g = [], m = 0, v = this.actions.length; m < v; m++) {
  53060. var A = this.actions[m]
  53061. , y = A.action
  53062. , C = A.args;
  53063. switch (y) {
  53064. case "moveTo":
  53065. g.push(new n.Vector2(C[0],C[1]));
  53066. break;
  53067. case "lineTo":
  53068. g.push(new n.Vector2(C[0],C[1]));
  53069. break;
  53070. case "quadraticCurveTo":
  53071. t = C[2],
  53072. i = C[3],
  53073. a = C[0],
  53074. s = C[1],
  53075. g.length > 0 ? (h = g[g.length - 1],
  53076. l = h.x,
  53077. c = h.y) : (h = this.actions[m - 1].args,
  53078. l = h[h.length - 2],
  53079. c = h[h.length - 1]);
  53080. for (var I = 1; I <= e; I++) {
  53081. var E = I / e;
  53082. u = p(E, l, a, t),
  53083. d = p(E, c, s, i),
  53084. g.push(new n.Vector2(u,d))
  53085. }
  53086. break;
  53087. case "bezierCurveTo":
  53088. t = C[4],
  53089. i = C[5],
  53090. a = C[0],
  53091. s = C[1],
  53092. r = C[2],
  53093. o = C[3],
  53094. g.length > 0 ? (h = g[g.length - 1],
  53095. l = h.x,
  53096. c = h.y) : (h = this.actions[m - 1].args,
  53097. l = h[h.length - 2],
  53098. c = h[h.length - 1]);
  53099. for (var I = 1; I <= e; I++) {
  53100. var E = I / e;
  53101. u = f(E, l, a, r, t),
  53102. d = f(E, c, s, o, i),
  53103. g.push(new n.Vector2(u,d))
  53104. }
  53105. break;
  53106. case "splineThru":
  53107. h = this.actions[m - 1].args;
  53108. var b = new n.Vector2(h[h.length - 2],h[h.length - 1])
  53109. , w = [b]
  53110. , _ = e * C[0].length;
  53111. w = w.concat(C[0]);
  53112. for (var T = new n.SplineCurve(w), I = 1; I <= _; I++)
  53113. g.push(T.getPointAt(I / _));
  53114. break;
  53115. case "arc":
  53116. for (var x, S = C[0], M = C[1], R = C[2], P = C[3], O = C[4], L = !!C[5], D = O - P, N = 2 * e, I = 1; I <= N; I++) {
  53117. var E = I / N;
  53118. L || (E = 1 - E),
  53119. x = P + E * D,
  53120. u = S + R * Math.cos(x),
  53121. d = M + R * Math.sin(x),
  53122. g.push(new n.Vector2(u,d))
  53123. }
  53124. break;
  53125. case "ellipse":
  53126. var x, B, F, S = C[0], M = C[1], V = C[2], U = C[3], P = C[4], O = C[5], L = !!C[6], k = C[7], D = O - P, N = 2 * e;
  53127. 0 !== k && (B = Math.cos(k),
  53128. F = Math.sin(k));
  53129. for (var I = 1; I <= N; I++) {
  53130. var E = I / N;
  53131. if (L || (E = 1 - E),
  53132. x = P + E * D,
  53133. u = S + V * Math.cos(x),
  53134. d = M + U * Math.sin(x),
  53135. 0 !== k) {
  53136. var H = u
  53137. , G = d;
  53138. u = (H - S) * B - (G - M) * F + S,
  53139. d = (H - S) * F + (G - M) * B + M
  53140. }
  53141. g.push(new n.Vector2(u,d))
  53142. }
  53143. }
  53144. }
  53145. var z = g[g.length - 1];
  53146. return Math.abs(z.x - g[0].x) < Number.EPSILON && Math.abs(z.y - g[0].y) < Number.EPSILON && g.splice(g.length - 1, 1),
  53147. this.autoClose && g.push(g[0]),
  53148. g
  53149. }
  53150. ,
  53151. n.Path.prototype.toShapes = function(e, t) {
  53152. function i(e) {
  53153. for (var t = [], i = new n.Path, r = 0, o = e.length; r < o; r++) {
  53154. var a = e[r]
  53155. , s = a.args
  53156. , l = a.action;
  53157. "moveTo" === l && 0 !== i.actions.length && (t.push(i),
  53158. i = new n.Path),
  53159. i[l].apply(i, s)
  53160. }
  53161. return 0 !== i.actions.length && t.push(i),
  53162. t
  53163. }
  53164. function r(e) {
  53165. for (var t = [], i = 0, r = e.length; i < r; i++) {
  53166. var o = e[i]
  53167. , a = new n.Shape;
  53168. a.actions = o.actions,
  53169. a.curves = o.curves,
  53170. t.push(a)
  53171. }
  53172. return t
  53173. }
  53174. function o(e, t) {
  53175. for (var i = t.length, n = !1, r = i - 1, o = 0; o < i; r = o++) {
  53176. var a = t[r]
  53177. , s = t[o]
  53178. , l = s.x - a.x
  53179. , c = s.y - a.y;
  53180. if (Math.abs(c) > Number.EPSILON) {
  53181. if (c < 0 && (a = t[o],
  53182. l = -l,
  53183. s = t[r],
  53184. c = -c),
  53185. e.y < a.y || e.y > s.y)
  53186. continue;
  53187. if (e.y === a.y) {
  53188. if (e.x === a.x)
  53189. return !0
  53190. } else {
  53191. var h = c * (e.x - a.x) - l * (e.y - a.y);
  53192. if (0 === h)
  53193. return !0;
  53194. if (h < 0)
  53195. continue;
  53196. n = !n
  53197. }
  53198. } else {
  53199. if (e.y !== a.y)
  53200. continue;
  53201. if (s.x <= e.x && e.x <= a.x || a.x <= e.x && e.x <= s.x)
  53202. return !0
  53203. }
  53204. }
  53205. return n
  53206. }
  53207. var a = n.ShapeUtils.isClockWise
  53208. , s = i(this.actions);
  53209. if (0 === s.length)
  53210. return [];
  53211. if (t === !0)
  53212. return r(s);
  53213. var l, c, h, u = [];
  53214. if (1 === s.length)
  53215. return c = s[0],
  53216. h = new n.Shape,
  53217. h.actions = c.actions,
  53218. h.curves = c.curves,
  53219. u.push(h),
  53220. u;
  53221. var d = !a(s[0].getPoints());
  53222. d = e ? !d : d;
  53223. var p, f = [], g = [], m = [], v = 0;
  53224. g[v] = void 0,
  53225. m[v] = [];
  53226. for (var A = 0, y = s.length; A < y; A++)
  53227. c = s[A],
  53228. p = c.getPoints(),
  53229. l = a(p),
  53230. l = e ? !l : l,
  53231. l ? (!d && g[v] && v++,
  53232. g[v] = {
  53233. s: new n.Shape,
  53234. p: p
  53235. },
  53236. g[v].s.actions = c.actions,
  53237. g[v].s.curves = c.curves,
  53238. d && v++,
  53239. m[v] = []) : m[v].push({
  53240. h: c,
  53241. p: p[0]
  53242. });
  53243. if (!g[0])
  53244. return r(s);
  53245. if (g.length > 1) {
  53246. for (var C = !1, I = [], E = 0, b = g.length; E < b; E++)
  53247. f[E] = [];
  53248. for (var E = 0, b = g.length; E < b; E++)
  53249. for (var w = m[E], _ = 0; _ < w.length; _++) {
  53250. for (var T = w[_], x = !0, S = 0; S < g.length; S++)
  53251. o(T.p, g[S].p) && (E !== S && I.push({
  53252. froms: E,
  53253. tos: S,
  53254. hole: _
  53255. }),
  53256. x ? (x = !1,
  53257. f[S].push(T)) : C = !0);
  53258. x && f[E].push(T)
  53259. }
  53260. I.length > 0 && (C || (m = f))
  53261. }
  53262. for (var M, A = 0, R = g.length; A < R; A++) {
  53263. h = g[A].s,
  53264. u.push(h),
  53265. M = m[A];
  53266. for (var P = 0, O = M.length; P < O; P++)
  53267. h.holes.push(M[P].h)
  53268. }
  53269. return u
  53270. }
  53271. ,
  53272. n.Shape = function() {
  53273. n.Path.apply(this, arguments),
  53274. this.holes = []
  53275. }
  53276. ,
  53277. n.Shape.prototype = Object.create(n.Path.prototype),
  53278. n.Shape.prototype.constructor = n.Shape,
  53279. n.Shape.prototype.extrude = function(e) {
  53280. return new n.ExtrudeGeometry(this,e)
  53281. }
  53282. ,
  53283. n.Shape.prototype.makeGeometry = function(e) {
  53284. return new n.ShapeGeometry(this,e)
  53285. }
  53286. ,
  53287. n.Shape.prototype.getPointsHoles = function(e) {
  53288. for (var t = [], i = 0, n = this.holes.length; i < n; i++)
  53289. t[i] = this.holes[i].getPoints(e);
  53290. return t
  53291. }
  53292. ,
  53293. n.Shape.prototype.extractAllPoints = function(e) {
  53294. return {
  53295. shape: this.getPoints(e),
  53296. holes: this.getPointsHoles(e)
  53297. }
  53298. }
  53299. ,
  53300. n.Shape.prototype.extractPoints = function(e) {
  53301. return this.extractAllPoints(e)
  53302. }
  53303. ,
  53304. n.LineCurve = function(e, t) {
  53305. this.v1 = e,
  53306. this.v2 = t
  53307. }
  53308. ,
  53309. n.LineCurve.prototype = Object.create(n.Curve.prototype),
  53310. n.LineCurve.prototype.constructor = n.LineCurve,
  53311. n.LineCurve.prototype.getPoint = function(e) {
  53312. var t = this.v2.clone().sub(this.v1);
  53313. return t.multiplyScalar(e).add(this.v1),
  53314. t
  53315. }
  53316. ,
  53317. n.LineCurve.prototype.getPointAt = function(e) {
  53318. return this.getPoint(e)
  53319. }
  53320. ,
  53321. n.LineCurve.prototype.getTangent = function(e) {
  53322. var t = this.v2.clone().sub(this.v1);
  53323. return t.normalize()
  53324. }
  53325. ,
  53326. n.QuadraticBezierCurve = function(e, t, i) {
  53327. this.v0 = e,
  53328. this.v1 = t,
  53329. this.v2 = i
  53330. }
  53331. ,
  53332. n.QuadraticBezierCurve.prototype = Object.create(n.Curve.prototype),
  53333. n.QuadraticBezierCurve.prototype.constructor = n.QuadraticBezierCurve,
  53334. n.QuadraticBezierCurve.prototype.getPoint = function(e) {
  53335. var t = n.ShapeUtils.b2;
  53336. return new n.Vector2(t(e, this.v0.x, this.v1.x, this.v2.x),t(e, this.v0.y, this.v1.y, this.v2.y))
  53337. }
  53338. ,
  53339. n.QuadraticBezierCurve.prototype.getTangent = function(e) {
  53340. var t = n.CurveUtils.tangentQuadraticBezier;
  53341. return new n.Vector2(t(e, this.v0.x, this.v1.x, this.v2.x),t(e, this.v0.y, this.v1.y, this.v2.y)).normalize()
  53342. }
  53343. ,
  53344. n.CubicBezierCurve = function(e, t, i, n) {
  53345. this.v0 = e,
  53346. this.v1 = t,
  53347. this.v2 = i,
  53348. this.v3 = n
  53349. }
  53350. ,
  53351. n.CubicBezierCurve.prototype = Object.create(n.Curve.prototype),
  53352. n.CubicBezierCurve.prototype.constructor = n.CubicBezierCurve,
  53353. n.CubicBezierCurve.prototype.getPoint = function(e) {
  53354. var t = n.ShapeUtils.b3;
  53355. return new n.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))
  53356. }
  53357. ,
  53358. n.CubicBezierCurve.prototype.getTangent = function(e) {
  53359. var t = n.CurveUtils.tangentCubicBezier;
  53360. return new n.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()
  53361. }
  53362. ,
  53363. n.SplineCurve = function(e) {
  53364. this.points = void 0 == e ? [] : e
  53365. }
  53366. ,
  53367. n.SplineCurve.prototype = Object.create(n.Curve.prototype),
  53368. n.SplineCurve.prototype.constructor = n.SplineCurve,
  53369. n.SplineCurve.prototype.getPoint = function(e) {
  53370. var t = this.points
  53371. , i = (t.length - 1) * e
  53372. , r = Math.floor(i)
  53373. , o = i - r
  53374. , a = t[0 === r ? r : r - 1]
  53375. , s = t[r]
  53376. , l = t[r > t.length - 2 ? t.length - 1 : r + 1]
  53377. , c = t[r > t.length - 3 ? t.length - 1 : r + 2]
  53378. , h = n.CurveUtils.interpolate;
  53379. return new n.Vector2(h(a.x, s.x, l.x, c.x, o),h(a.y, s.y, l.y, c.y, o))
  53380. }
  53381. ,
  53382. n.EllipseCurve = function(e, t, i, n, r, o, a, s) {
  53383. this.aX = e,
  53384. this.aY = t,
  53385. this.xRadius = i,
  53386. this.yRadius = n,
  53387. this.aStartAngle = r,
  53388. this.aEndAngle = o,
  53389. this.aClockwise = a,
  53390. this.aRotation = s || 0
  53391. }
  53392. ,
  53393. n.EllipseCurve.prototype = Object.create(n.Curve.prototype),
  53394. n.EllipseCurve.prototype.constructor = n.EllipseCurve,
  53395. n.EllipseCurve.prototype.getPoint = function(e) {
  53396. var t = this.aEndAngle - this.aStartAngle;
  53397. t < 0 && (t += 2 * Math.PI),
  53398. t > 2 * Math.PI && (t -= 2 * Math.PI);
  53399. var i;
  53400. i = this.aClockwise === !0 ? this.aEndAngle + (1 - e) * (2 * Math.PI - t) : this.aStartAngle + e * t;
  53401. var r = this.aX + this.xRadius * Math.cos(i)
  53402. , o = this.aY + this.yRadius * Math.sin(i);
  53403. if (0 !== this.aRotation) {
  53404. var a = Math.cos(this.aRotation)
  53405. , s = Math.sin(this.aRotation)
  53406. , l = r
  53407. , c = o;
  53408. r = (l - this.aX) * a - (c - this.aY) * s + this.aX,
  53409. o = (l - this.aX) * s + (c - this.aY) * a + this.aY
  53410. }
  53411. return new n.Vector2(r,o)
  53412. }
  53413. ,
  53414. n.ArcCurve = function(e, t, i, r, o, a) {
  53415. n.EllipseCurve.call(this, e, t, i, i, r, o, a)
  53416. }
  53417. ,
  53418. n.ArcCurve.prototype = Object.create(n.EllipseCurve.prototype),
  53419. n.ArcCurve.prototype.constructor = n.ArcCurve,
  53420. n.LineCurve3 = n.Curve.create(function(e, t) {
  53421. this.v1 = e,
  53422. this.v2 = t
  53423. }, function(e) {
  53424. var t = new n.Vector3;
  53425. return t.subVectors(this.v2, this.v1),
  53426. t.multiplyScalar(e),
  53427. t.add(this.v1),
  53428. t
  53429. }),
  53430. n.QuadraticBezierCurve3 = n.Curve.create(function(e, t, i) {
  53431. this.v0 = e,
  53432. this.v1 = t,
  53433. this.v2 = i
  53434. }, function(e) {
  53435. var t = n.ShapeUtils.b2;
  53436. return new n.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))
  53437. }),
  53438. n.CubicBezierCurve3 = n.Curve.create(function(e, t, i, n) {
  53439. this.v0 = e,
  53440. this.v1 = t,
  53441. this.v2 = i,
  53442. this.v3 = n
  53443. }, function(e) {
  53444. var t = n.ShapeUtils.b3;
  53445. return new n.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))
  53446. }),
  53447. n.SplineCurve3 = n.Curve.create(function(e) {
  53448. console.warn("THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3"),
  53449. this.points = void 0 == e ? [] : e
  53450. }, function(e) {
  53451. var t = this.points
  53452. , i = (t.length - 1) * e
  53453. , r = Math.floor(i)
  53454. , o = i - r
  53455. , a = t[0 == r ? r : r - 1]
  53456. , s = t[r]
  53457. , l = t[r > t.length - 2 ? t.length - 1 : r + 1]
  53458. , c = t[r > t.length - 3 ? t.length - 1 : r + 2]
  53459. , h = n.CurveUtils.interpolate;
  53460. return new n.Vector3(h(a.x, s.x, l.x, c.x, o),h(a.y, s.y, l.y, c.y, o),h(a.z, s.z, l.z, c.z, o))
  53461. }),
  53462. n.CatmullRomCurve3 = function() {
  53463. function e() {}
  53464. var t = new n.Vector3
  53465. , i = new e
  53466. , r = new e
  53467. , o = new e;
  53468. return e.prototype.init = function(e, t, i, n) {
  53469. this.c0 = e,
  53470. this.c1 = i,
  53471. this.c2 = -3 * e + 3 * t - 2 * i - n,
  53472. this.c3 = 2 * e - 2 * t + i + n
  53473. }
  53474. ,
  53475. e.prototype.initNonuniformCatmullRom = function(e, t, i, n, r, o, a) {
  53476. var s = (t - e) / r - (i - e) / (r + o) + (i - t) / o
  53477. , l = (i - t) / o - (n - t) / (o + a) + (n - i) / a;
  53478. s *= o,
  53479. l *= o,
  53480. this.init(t, i, s, l)
  53481. }
  53482. ,
  53483. e.prototype.initCatmullRom = function(e, t, i, n, r) {
  53484. this.init(t, i, r * (i - e), r * (n - t))
  53485. }
  53486. ,
  53487. e.prototype.calc = function(e) {
  53488. var t = e * e
  53489. , i = t * e;
  53490. return this.c0 + this.c1 * e + this.c2 * t + this.c3 * i
  53491. }
  53492. ,
  53493. n.Curve.create(function(e) {
  53494. this.points = e || [],
  53495. this.closed = !1
  53496. }, function(e) {
  53497. var a, s, l, c, h = this.points;
  53498. c = h.length,
  53499. c < 2 && console.log("duh, you need at least 2 points"),
  53500. a = (c - (this.closed ? 0 : 1)) * e,
  53501. s = Math.floor(a),
  53502. l = a - s,
  53503. this.closed ? s += s > 0 ? 0 : (Math.floor(Math.abs(s) / h.length) + 1) * h.length : 0 === l && s === c - 1 && (s = c - 2,
  53504. l = 1);
  53505. var u, d, p, f;
  53506. if (this.closed || s > 0 ? u = h[(s - 1) % c] : (t.subVectors(h[0], h[1]).add(h[0]),
  53507. u = t),
  53508. d = h[s % c],
  53509. p = h[(s + 1) % c],
  53510. this.closed || s + 2 < c ? f = h[(s + 2) % c] : (t.subVectors(h[c - 1], h[c - 2]).add(h[c - 1]),
  53511. f = t),
  53512. void 0 === this.type || "centripetal" === this.type || "chordal" === this.type) {
  53513. var g = "chordal" === this.type ? .5 : .25
  53514. , m = Math.pow(u.distanceToSquared(d), g)
  53515. , v = Math.pow(d.distanceToSquared(p), g)
  53516. , A = Math.pow(p.distanceToSquared(f), g);
  53517. v < 1e-4 && (v = 1),
  53518. m < 1e-4 && (m = v),
  53519. A < 1e-4 && (A = v),
  53520. i.initNonuniformCatmullRom(u.x, d.x, p.x, f.x, m, v, A),
  53521. r.initNonuniformCatmullRom(u.y, d.y, p.y, f.y, m, v, A),
  53522. o.initNonuniformCatmullRom(u.z, d.z, p.z, f.z, m, v, A)
  53523. } else if ("catmullrom" === this.type) {
  53524. var y = void 0 !== this.tension ? this.tension : .5;
  53525. i.initCatmullRom(u.x, d.x, p.x, f.x, y),
  53526. r.initCatmullRom(u.y, d.y, p.y, f.y, y),
  53527. o.initCatmullRom(u.z, d.z, p.z, f.z, y)
  53528. }
  53529. var C = new n.Vector3(i.calc(l),r.calc(l),o.calc(l));
  53530. return C
  53531. })
  53532. }(),
  53533. n.ClosedSplineCurve3 = function(e) {
  53534. console.warn("THREE.ClosedSplineCurve3 has been deprecated. Please use THREE.CatmullRomCurve3."),
  53535. n.CatmullRomCurve3.call(this, e),
  53536. this.type = "catmullrom",
  53537. this.closed = !0
  53538. }
  53539. ,
  53540. n.ClosedSplineCurve3.prototype = Object.create(n.CatmullRomCurve3.prototype),
  53541. n.BoxGeometry = function(e, t, i, r, o, a) {
  53542. n.Geometry.call(this),
  53543. this.type = "BoxGeometry",
  53544. this.parameters = {
  53545. width: e,
  53546. height: t,
  53547. depth: i,
  53548. widthSegments: r,
  53549. heightSegments: o,
  53550. depthSegments: a
  53551. },
  53552. this.fromBufferGeometry(new n.BoxBufferGeometry(e,t,i,r,o,a)),
  53553. this.mergeVertices()
  53554. }
  53555. ,
  53556. n.BoxGeometry.prototype = Object.create(n.Geometry.prototype),
  53557. n.BoxGeometry.prototype.constructor = n.BoxGeometry,
  53558. n.CubeGeometry = n.BoxGeometry,
  53559. n.BoxBufferGeometry = function(e, t, i, r, o, a) {
  53560. function s(e, t, i) {
  53561. var n = 0;
  53562. return n += e * t * 2,
  53563. n += e * i * 2,
  53564. n += i * t * 2,
  53565. 4 * n
  53566. }
  53567. function l(e, t, i, r, o, a, s, l, h, u, I) {
  53568. for (var E = a / h, b = s / u, w = a / 2, _ = s / 2, T = l / 2, x = h + 1, S = u + 1, M = 0, R = 0, P = new n.Vector3, O = 0; O < S; O++)
  53569. for (var L = O * b - _, D = 0; D < x; D++) {
  53570. var N = D * E - w;
  53571. P[e] = N * r,
  53572. P[t] = L * o,
  53573. P[i] = T,
  53574. p[m] = P.x,
  53575. p[m + 1] = P.y,
  53576. p[m + 2] = P.z,
  53577. P[e] = 0,
  53578. P[t] = 0,
  53579. P[i] = l > 0 ? 1 : -1,
  53580. f[m] = P.x,
  53581. f[m + 1] = P.y,
  53582. f[m + 2] = P.z,
  53583. g[v] = D / h,
  53584. g[v + 1] = 1 - O / u,
  53585. m += 3,
  53586. v += 2,
  53587. M += 1
  53588. }
  53589. for (O = 0; O < u; O++)
  53590. for (D = 0; D < h; D++) {
  53591. var B = y + D + x * O
  53592. , F = y + D + x * (O + 1)
  53593. , V = y + (D + 1) + x * (O + 1)
  53594. , U = y + (D + 1) + x * O;
  53595. d[A] = B,
  53596. d[A + 1] = F,
  53597. d[A + 2] = U,
  53598. d[A + 3] = F,
  53599. d[A + 4] = V,
  53600. d[A + 5] = U,
  53601. A += 6,
  53602. R += 6
  53603. }
  53604. c.addGroup(C, R, I),
  53605. C += R,
  53606. y += M
  53607. }
  53608. n.BufferGeometry.call(this),
  53609. this.type = "BoxBufferGeometry",
  53610. this.parameters = {
  53611. width: e,
  53612. height: t,
  53613. depth: i,
  53614. widthSegments: r,
  53615. heightSegments: o,
  53616. depthSegments: a
  53617. };
  53618. var c = this;
  53619. r = Math.floor(r) || 1,
  53620. o = Math.floor(o) || 1,
  53621. a = Math.floor(a) || 1;
  53622. var h = s(r, o, a)
  53623. , u = h / 4 * 6
  53624. , d = new (u > 65535 ? Uint32Array : Uint16Array)(u)
  53625. , p = new Float32Array(3 * h)
  53626. , f = new Float32Array(3 * h)
  53627. , g = new Float32Array(2 * h)
  53628. , m = 0
  53629. , v = 0
  53630. , A = 0
  53631. , y = 0
  53632. , C = 0;
  53633. l("z", "y", "x", -1, -1, i, t, e, a, o, 0),
  53634. l("z", "y", "x", 1, -1, i, t, -e, a, o, 1),
  53635. l("x", "z", "y", 1, 1, e, i, t, r, a, 2),
  53636. l("x", "z", "y", 1, -1, e, i, -t, r, a, 3),
  53637. l("x", "y", "z", 1, -1, e, t, i, r, o, 4),
  53638. l("x", "y", "z", -1, -1, e, t, -i, r, o, 5),
  53639. this.setIndex(new n.BufferAttribute(d,1)),
  53640. this.addAttribute("position", new n.BufferAttribute(p,3)),
  53641. this.addAttribute("normal", new n.BufferAttribute(f,3)),
  53642. this.addAttribute("uv", new n.BufferAttribute(g,2))
  53643. }
  53644. ,
  53645. n.BoxBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  53646. n.BoxBufferGeometry.prototype.constructor = n.BoxBufferGeometry,
  53647. n.CircleGeometry = function(e, t, i, r) {
  53648. n.Geometry.call(this),
  53649. this.type = "CircleGeometry",
  53650. this.parameters = {
  53651. radius: e,
  53652. segments: t,
  53653. thetaStart: i,
  53654. thetaLength: r
  53655. },
  53656. this.fromBufferGeometry(new n.CircleBufferGeometry(e,t,i,r))
  53657. }
  53658. ,
  53659. n.CircleGeometry.prototype = Object.create(n.Geometry.prototype),
  53660. n.CircleGeometry.prototype.constructor = n.CircleGeometry,
  53661. n.CircleBufferGeometry = function(e, t, i, r) {
  53662. n.BufferGeometry.call(this),
  53663. this.type = "CircleBufferGeometry",
  53664. this.parameters = {
  53665. radius: e,
  53666. segments: t,
  53667. thetaStart: i,
  53668. thetaLength: r
  53669. },
  53670. e = e || 50,
  53671. t = void 0 !== t ? Math.max(3, t) : 8,
  53672. i = void 0 !== i ? i : 0,
  53673. r = void 0 !== r ? r : 2 * Math.PI;
  53674. var o = t + 2
  53675. , a = new Float32Array(3 * o)
  53676. , s = new Float32Array(3 * o)
  53677. , l = new Float32Array(2 * o);
  53678. s[2] = 1,
  53679. l[0] = .5,
  53680. l[1] = .5;
  53681. for (var c = 0, h = 3, u = 2; c <= t; c++,
  53682. h += 3,
  53683. u += 2) {
  53684. var d = i + c / t * r;
  53685. a[h] = e * Math.cos(d),
  53686. a[h + 1] = e * Math.sin(d),
  53687. s[h + 2] = 1,
  53688. l[u] = (a[h] / e + 1) / 2,
  53689. l[u + 1] = (a[h + 1] / e + 1) / 2
  53690. }
  53691. for (var p = [], h = 1; h <= t; h++)
  53692. p.push(h, h + 1, 0);
  53693. this.setIndex(new n.BufferAttribute(new Uint16Array(p),1)),
  53694. this.addAttribute("position", new n.BufferAttribute(a,3)),
  53695. this.addAttribute("normal", new n.BufferAttribute(s,3)),
  53696. this.addAttribute("uv", new n.BufferAttribute(l,2)),
  53697. this.boundingSphere = new n.Sphere(new n.Vector3,e)
  53698. }
  53699. ,
  53700. n.CircleBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  53701. n.CircleBufferGeometry.prototype.constructor = n.CircleBufferGeometry,
  53702. n.CylinderBufferGeometry = function(e, t, i, r, o, a, s, l) {
  53703. function c() {
  53704. var e = (r + 1) * (o + 1);
  53705. return a === !1 && (e += 2 * (r + 1) + 2 * r),
  53706. e
  53707. }
  53708. function h() {
  53709. var e = r * o * 2 * 3;
  53710. return a === !1 && (e += 2 * r * 3),
  53711. e
  53712. }
  53713. function u() {
  53714. var a, c, h = new n.Vector3, u = new n.Vector3, d = (t - e) / i;
  53715. for (c = 0; c <= o; c++) {
  53716. var p = []
  53717. , f = c / o
  53718. , b = f * (t - e) + e;
  53719. for (a = 0; a <= r; a++) {
  53720. var w = a / r;
  53721. u.x = b * Math.sin(w * l + s),
  53722. u.y = -f * i + E,
  53723. u.z = b * Math.cos(w * l + s),
  53724. m.setXYZ(y, u.x, u.y, u.z),
  53725. h.copy(u),
  53726. (0 === e && 0 === c || 0 === t && c === o) && (h.x = Math.sin(w * l + s),
  53727. h.z = Math.cos(w * l + s)),
  53728. h.setY(Math.sqrt(h.x * h.x + h.z * h.z) * d).normalize(),
  53729. v.setXYZ(y, h.x, h.y, h.z),
  53730. A.setXY(y, w, 1 - f),
  53731. p.push(y),
  53732. y++
  53733. }
  53734. I.push(p)
  53735. }
  53736. for (a = 0; a < r; a++)
  53737. for (c = 0; c < o; c++) {
  53738. var _ = I[c][a]
  53739. , T = I[c + 1][a]
  53740. , x = I[c + 1][a + 1]
  53741. , S = I[c][a + 1];
  53742. g.setX(C, _),
  53743. C++,
  53744. g.setX(C, T),
  53745. C++,
  53746. g.setX(C, S),
  53747. C++,
  53748. g.setX(C, T),
  53749. C++,
  53750. g.setX(C, x),
  53751. C++,
  53752. g.setX(C, S),
  53753. C++
  53754. }
  53755. }
  53756. function d(i) {
  53757. var o, a, c, h = new n.Vector2, u = new n.Vector3, d = i === !0 ? e : t, p = i === !0 ? 1 : -1;
  53758. for (a = y,
  53759. o = 1; o <= r; o++)
  53760. m.setXYZ(y, 0, E * p, 0),
  53761. v.setXYZ(y, 0, p, 0),
  53762. i === !0 ? (h.x = o / r,
  53763. h.y = 0) : (h.x = (o - 1) / r,
  53764. h.y = 1),
  53765. A.setXY(y, h.x, h.y),
  53766. y++;
  53767. for (c = y,
  53768. o = 0; o <= r; o++) {
  53769. var f = o / r;
  53770. u.x = d * Math.sin(f * l + s),
  53771. u.y = E * p,
  53772. u.z = d * Math.cos(f * l + s),
  53773. m.setXYZ(y, u.x, u.y, u.z),
  53774. v.setXYZ(y, 0, p, 0),
  53775. A.setXY(y, f, i === !0 ? 1 : 0),
  53776. y++
  53777. }
  53778. for (o = 0; o < r; o++) {
  53779. var I = a + o
  53780. , b = c + o;
  53781. i === !0 ? (g.setX(C, b),
  53782. C++,
  53783. g.setX(C, b + 1),
  53784. C++,
  53785. g.setX(C, I),
  53786. C++) : (g.setX(C, b + 1),
  53787. C++,
  53788. g.setX(C, b),
  53789. C++,
  53790. g.setX(C, I),
  53791. C++)
  53792. }
  53793. }
  53794. n.BufferGeometry.call(this),
  53795. this.type = "CylinderBufferGeometry",
  53796. this.parameters = {
  53797. radiusTop: e,
  53798. radiusBottom: t,
  53799. height: i,
  53800. radialSegments: r,
  53801. heightSegments: o,
  53802. openEnded: a,
  53803. thetaStart: s,
  53804. thetaLength: l
  53805. },
  53806. e = void 0 !== e ? e : 20,
  53807. t = void 0 !== t ? t : 20,
  53808. i = void 0 !== i ? i : 100,
  53809. r = Math.floor(r) || 8,
  53810. o = Math.floor(o) || 1,
  53811. a = void 0 !== a && a,
  53812. s = void 0 !== s ? s : 0,
  53813. l = void 0 !== l ? l : 2 * Math.PI;
  53814. var p = c()
  53815. , f = h()
  53816. , g = new n.BufferAttribute(new (f > 65535 ? Uint32Array : Uint16Array)(f),1)
  53817. , m = new n.BufferAttribute(new Float32Array(3 * p),3)
  53818. , v = new n.BufferAttribute(new Float32Array(3 * p),3)
  53819. , A = new n.BufferAttribute(new Float32Array(2 * p),2)
  53820. , y = 0
  53821. , C = 0
  53822. , I = []
  53823. , E = i / 2;
  53824. u(),
  53825. a === !1 && (e > 0 && d(!0),
  53826. t > 0 && d(!1)),
  53827. this.setIndex(g),
  53828. this.addAttribute("position", m),
  53829. this.addAttribute("normal", v),
  53830. this.addAttribute("uv", A)
  53831. }
  53832. ,
  53833. n.CylinderBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  53834. n.CylinderBufferGeometry.prototype.constructor = n.CylinderBufferGeometry,
  53835. n.CylinderGeometry = function(e, t, i, r, o, a, s, l) {
  53836. n.Geometry.call(this),
  53837. this.type = "CylinderGeometry",
  53838. this.parameters = {
  53839. radiusTop: e,
  53840. radiusBottom: t,
  53841. height: i,
  53842. radialSegments: r,
  53843. heightSegments: o,
  53844. openEnded: a,
  53845. thetaStart: s,
  53846. thetaLength: l
  53847. },
  53848. this.fromBufferGeometry(new n.CylinderBufferGeometry(e,t,i,r,o,a,s,l)),
  53849. this.mergeVertices()
  53850. }
  53851. ,
  53852. n.CylinderGeometry.prototype = Object.create(n.Geometry.prototype),
  53853. n.CylinderGeometry.prototype.constructor = n.CylinderGeometry,
  53854. n.EdgesGeometry = function(e, t) {
  53855. function i(e, t) {
  53856. return e - t
  53857. }
  53858. n.BufferGeometry.call(this),
  53859. t = void 0 !== t ? t : 1;
  53860. var r, o = Math.cos(n.Math.degToRad(t)), a = [0, 0], s = {}, l = ["a", "b", "c"];
  53861. e instanceof n.BufferGeometry ? (r = new n.Geometry,
  53862. r.fromBufferGeometry(e)) : r = e.clone(),
  53863. r.mergeVertices(),
  53864. r.computeFaceNormals();
  53865. for (var c = r.vertices, h = r.faces, u = 0, d = h.length; u < d; u++)
  53866. for (var p = h[u], f = 0; f < 3; f++) {
  53867. a[0] = p[l[f]],
  53868. a[1] = p[l[(f + 1) % 3]],
  53869. a.sort(i);
  53870. var g = a.toString();
  53871. void 0 === s[g] ? s[g] = {
  53872. vert1: a[0],
  53873. vert2: a[1],
  53874. face1: u,
  53875. face2: void 0
  53876. } : s[g].face2 = u
  53877. }
  53878. var m = [];
  53879. for (var g in s) {
  53880. var v = s[g];
  53881. if (void 0 === v.face2 || h[v.face1].normal.dot(h[v.face2].normal) <= o) {
  53882. var A = c[v.vert1];
  53883. m.push(A.x),
  53884. m.push(A.y),
  53885. m.push(A.z),
  53886. A = c[v.vert2],
  53887. m.push(A.x),
  53888. m.push(A.y),
  53889. m.push(A.z)
  53890. }
  53891. }
  53892. this.addAttribute("position", new n.BufferAttribute(new Float32Array(m),3))
  53893. }
  53894. ,
  53895. n.EdgesGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  53896. n.EdgesGeometry.prototype.constructor = n.EdgesGeometry,
  53897. n.ExtrudeGeometry = function(e, t) {
  53898. return "undefined" == typeof e ? void (e = []) : (n.Geometry.call(this),
  53899. this.type = "ExtrudeGeometry",
  53900. e = Array.isArray(e) ? e : [e],
  53901. this.addShapeList(e, t),
  53902. void this.computeFaceNormals())
  53903. }
  53904. ;
  53905. n.ExtrudeGeometry.prototype = Object.create(n.Geometry.prototype);
  53906. n.ExtrudeGeometry.prototype.constructor = n.ExtrudeGeometry,
  53907. n.ExtrudeGeometry.prototype.addShapeList = function(e, t) {
  53908. for (var i = e.length, n = 0; n < i; n++) {
  53909. var r = e[n];
  53910. this.addShape(r, t)
  53911. }
  53912. }
  53913. ,
  53914. n.ExtrudeGeometry.prototype.addShape = function(e, t) {
  53915. function i(e, t, i) {
  53916. return t || console.error("THREE.ExtrudeGeometry: vec does not exist"),
  53917. t.clone().multiplyScalar(i).add(e)
  53918. }
  53919. function r(e, t, i) {
  53920. var r, o, a = 1, s = e.x - t.x, l = e.y - t.y, c = i.x - e.x, h = i.y - e.y, u = s * s + l * l, d = s * h - l * c;
  53921. if (Math.abs(d) > Number.EPSILON) {
  53922. var p = Math.sqrt(u)
  53923. , f = Math.sqrt(c * c + h * h)
  53924. , g = t.x - l / p
  53925. , m = t.y + s / p
  53926. , v = i.x - h / f
  53927. , A = i.y + c / f
  53928. , y = ((v - g) * h - (A - m) * c) / (s * h - l * c);
  53929. r = g + s * y - e.x,
  53930. o = m + l * y - e.y;
  53931. var C = r * r + o * o;
  53932. if (C <= 2)
  53933. return new n.Vector2(r,o);
  53934. a = Math.sqrt(C / 2)
  53935. } else {
  53936. var I = !1;
  53937. s > Number.EPSILON ? c > Number.EPSILON && (I = !0) : s < -Number.EPSILON ? c < -Number.EPSILON && (I = !0) : Math.sign(l) === Math.sign(h) && (I = !0),
  53938. I ? (r = -l,
  53939. o = s,
  53940. a = Math.sqrt(u)) : (r = s,
  53941. o = l,
  53942. a = Math.sqrt(u / 2))
  53943. }
  53944. return new n.Vector2(r / a,o / a)
  53945. }
  53946. function o() {
  53947. if (C) {
  53948. var e = 0
  53949. , t = z * e;
  53950. for (Y = 0; Y < W; Y++)
  53951. G = N[Y],
  53952. c(G[2] + t, G[1] + t, G[0] + t);
  53953. for (e = E + 2 * y,
  53954. t = z * e,
  53955. Y = 0; Y < W; Y++)
  53956. G = N[Y],
  53957. c(G[0] + t, G[1] + t, G[2] + t)
  53958. } else {
  53959. for (Y = 0; Y < W; Y++)
  53960. G = N[Y],
  53961. c(G[2], G[1], G[0]);
  53962. for (Y = 0; Y < W; Y++)
  53963. G = N[Y],
  53964. c(G[0] + z * E, G[1] + z * E, G[2] + z * E)
  53965. }
  53966. }
  53967. function a() {
  53968. var e = 0;
  53969. for (s(B, e),
  53970. e += B.length,
  53971. x = 0,
  53972. S = L.length; x < S; x++)
  53973. T = L[x],
  53974. s(T, e),
  53975. e += T.length
  53976. }
  53977. function s(e, t) {
  53978. var i, n;
  53979. for (Y = e.length; --Y >= 0; ) {
  53980. i = Y,
  53981. n = Y - 1,
  53982. n < 0 && (n = e.length - 1);
  53983. var r = 0
  53984. , o = E + 2 * y;
  53985. for (r = 0; r < o; r++) {
  53986. var a = z * r
  53987. , s = z * (r + 1)
  53988. , l = t + i + a
  53989. , c = t + n + a
  53990. , u = t + n + s
  53991. , d = t + i + s;
  53992. h(l, c, u, d, e, r, o, i, n)
  53993. }
  53994. }
  53995. }
  53996. function l(e, t, i) {
  53997. M.vertices.push(new n.Vector3(e,t,i))
  53998. }
  53999. function c(e, t, i) {
  54000. e += R,
  54001. t += R,
  54002. i += R,
  54003. M.faces.push(new n.Face3(e,t,i,null,null,0));
  54004. var r = _.generateTopUV(M, e, t, i);
  54005. M.faceVertexUvs[0].push(r)
  54006. }
  54007. function h(e, t, i, r, o, a, s, l, c) {
  54008. e += R,
  54009. t += R,
  54010. i += R,
  54011. r += R,
  54012. M.faces.push(new n.Face3(e,t,r,null,null,1)),
  54013. M.faces.push(new n.Face3(t,i,r,null,null,1));
  54014. var h = _.generateSideWallUV(M, e, t, i, r);
  54015. M.faceVertexUvs[0].push([h[0], h[1], h[3]]),
  54016. M.faceVertexUvs[0].push([h[1], h[2], h[3]])
  54017. }
  54018. var u, d, p, f, g, m = void 0 !== t.amount ? t.amount : 100, v = void 0 !== t.bevelThickness ? t.bevelThickness : 6, A = void 0 !== t.bevelSize ? t.bevelSize : v - 2, y = void 0 !== t.bevelSegments ? t.bevelSegments : 3, C = void 0 === t.bevelEnabled || t.bevelEnabled, I = void 0 !== t.curveSegments ? t.curveSegments : 12, E = void 0 !== t.steps ? t.steps : 1, b = t.extrudePath, w = !1, _ = void 0 !== t.UVGenerator ? t.UVGenerator : n.ExtrudeGeometry.WorldUVGenerator;
  54019. b && (u = b.getSpacedPoints(E),
  54020. w = !0,
  54021. C = !1,
  54022. d = void 0 !== t.frames ? t.frames : new n.TubeGeometry.FrenetFrames(b,E,!1),
  54023. p = new n.Vector3,
  54024. f = new n.Vector3,
  54025. g = new n.Vector3),
  54026. C || (y = 0,
  54027. v = 0,
  54028. A = 0);
  54029. var T, x, S, M = this, R = this.vertices.length, P = e.extractPoints(I), O = P.shape, L = P.holes, D = !n.ShapeUtils.isClockWise(O);
  54030. if (D) {
  54031. for (O = O.reverse(),
  54032. x = 0,
  54033. S = L.length; x < S; x++)
  54034. T = L[x],
  54035. n.ShapeUtils.isClockWise(T) && (L[x] = T.reverse());
  54036. D = !1
  54037. }
  54038. var N = n.ShapeUtils.triangulateShape(O, L)
  54039. , B = O;
  54040. for (x = 0,
  54041. S = L.length; x < S; x++)
  54042. T = L[x],
  54043. O = O.concat(T);
  54044. for (var F, V, U, k, H, G, z = O.length, W = N.length, j = [], Y = 0, X = B.length, Z = X - 1, q = Y + 1; Y < X; Y++,
  54045. Z++,
  54046. q++)
  54047. Z === X && (Z = 0),
  54048. q === X && (q = 0),
  54049. j[Y] = r(B[Y], B[Z], B[q]);
  54050. var K, Q = [], J = j.concat();
  54051. for (x = 0,
  54052. S = L.length; x < S; x++) {
  54053. for (T = L[x],
  54054. K = [],
  54055. Y = 0,
  54056. X = T.length,
  54057. Z = X - 1,
  54058. q = Y + 1; Y < X; Y++,
  54059. Z++,
  54060. q++)
  54061. Z === X && (Z = 0),
  54062. q === X && (q = 0),
  54063. K[Y] = r(T[Y], T[Z], T[q]);
  54064. Q.push(K),
  54065. J = J.concat(K)
  54066. }
  54067. for (F = 0; F < y; F++) {
  54068. for (U = F / y,
  54069. k = v * (1 - U),
  54070. V = A * Math.sin(U * Math.PI / 2),
  54071. Y = 0,
  54072. X = B.length; Y < X; Y++)
  54073. H = i(B[Y], j[Y], V),
  54074. l(H.x, H.y, -k);
  54075. for (x = 0,
  54076. S = L.length; x < S; x++)
  54077. for (T = L[x],
  54078. K = Q[x],
  54079. Y = 0,
  54080. X = T.length; Y < X; Y++)
  54081. H = i(T[Y], K[Y], V),
  54082. l(H.x, H.y, -k)
  54083. }
  54084. for (V = A,
  54085. Y = 0; Y < z; Y++)
  54086. H = C ? i(O[Y], J[Y], V) : O[Y],
  54087. w ? (f.copy(d.normals[0]).multiplyScalar(H.x),
  54088. p.copy(d.binormals[0]).multiplyScalar(H.y),
  54089. g.copy(u[0]).add(f).add(p),
  54090. l(g.x, g.y, g.z)) : l(H.x, H.y, 0);
  54091. var $;
  54092. for ($ = 1; $ <= E; $++)
  54093. for (Y = 0; Y < z; Y++)
  54094. H = C ? i(O[Y], J[Y], V) : O[Y],
  54095. w ? (f.copy(d.normals[$]).multiplyScalar(H.x),
  54096. p.copy(d.binormals[$]).multiplyScalar(H.y),
  54097. g.copy(u[$]).add(f).add(p),
  54098. l(g.x, g.y, g.z)) : l(H.x, H.y, m / E * $);
  54099. for (F = y - 1; F >= 0; F--) {
  54100. for (U = F / y,
  54101. k = v * (1 - U),
  54102. V = A * Math.sin(U * Math.PI / 2),
  54103. Y = 0,
  54104. X = B.length; Y < X; Y++)
  54105. H = i(B[Y], j[Y], V),
  54106. l(H.x, H.y, m + k);
  54107. for (x = 0,
  54108. S = L.length; x < S; x++)
  54109. for (T = L[x],
  54110. K = Q[x],
  54111. Y = 0,
  54112. X = T.length; Y < X; Y++)
  54113. H = i(T[Y], K[Y], V),
  54114. w ? l(H.x, H.y + u[E - 1].y, u[E - 1].x + k) : l(H.x, H.y, m + k)
  54115. }
  54116. o(),
  54117. a()
  54118. }
  54119. ,
  54120. n.ExtrudeGeometry.WorldUVGenerator = {
  54121. generateTopUV: function(e, t, i, r) {
  54122. var o = e.vertices
  54123. , a = o[t]
  54124. , s = o[i]
  54125. , l = o[r];
  54126. return [new n.Vector2(a.x,a.y), new n.Vector2(s.x,s.y), new n.Vector2(l.x,l.y)]
  54127. },
  54128. generateSideWallUV: function(e, t, i, r, o) {
  54129. var a = e.vertices
  54130. , s = a[t]
  54131. , l = a[i]
  54132. , c = a[r]
  54133. , h = a[o];
  54134. return Math.abs(s.y - l.y) < .01 ? [new n.Vector2(s.x,1 - s.z), new n.Vector2(l.x,1 - l.z), new n.Vector2(c.x,1 - c.z), new n.Vector2(h.x,1 - h.z)] : [new n.Vector2(s.y,1 - s.z), new n.Vector2(l.y,1 - l.z), new n.Vector2(c.y,1 - c.z), new n.Vector2(h.y,1 - h.z)]
  54135. }
  54136. },
  54137. n.ShapeGeometry = function(e, t) {
  54138. n.Geometry.call(this),
  54139. this.type = "ShapeGeometry",
  54140. Array.isArray(e) === !1 && (e = [e]),
  54141. this.addShapeList(e, t),
  54142. this.computeFaceNormals()
  54143. }
  54144. ,
  54145. n.ShapeGeometry.prototype = Object.create(n.Geometry.prototype),
  54146. n.ShapeGeometry.prototype.constructor = n.ShapeGeometry,
  54147. n.ShapeGeometry.prototype.addShapeList = function(e, t) {
  54148. for (var i = 0, n = e.length; i < n; i++)
  54149. this.addShape(e[i], t);
  54150. return this
  54151. }
  54152. ,
  54153. n.ShapeGeometry.prototype.addShape = function(e, t) {
  54154. void 0 === t && (t = {});
  54155. var i, r, o, a = void 0 !== t.curveSegments ? t.curveSegments : 12, s = t.material, l = void 0 === t.UVGenerator ? n.ExtrudeGeometry.WorldUVGenerator : t.UVGenerator, c = this.vertices.length, h = e.extractPoints(a), u = h.shape, d = h.holes, p = !n.ShapeUtils.isClockWise(u);
  54156. if (p) {
  54157. for (u = u.reverse(),
  54158. i = 0,
  54159. r = d.length; i < r; i++)
  54160. o = d[i],
  54161. n.ShapeUtils.isClockWise(o) && (d[i] = o.reverse());
  54162. p = !1
  54163. }
  54164. var f = n.ShapeUtils.triangulateShape(u, d);
  54165. for (i = 0,
  54166. r = d.length; i < r; i++)
  54167. o = d[i],
  54168. u = u.concat(o);
  54169. var g, m, v = u.length, A = f.length;
  54170. for (i = 0; i < v; i++)
  54171. g = u[i],
  54172. this.vertices.push(new n.Vector3(g.x,g.y,0));
  54173. for (i = 0; i < A; i++) {
  54174. m = f[i];
  54175. var y = m[0] + c
  54176. , C = m[1] + c
  54177. , I = m[2] + c;
  54178. this.faces.push(new n.Face3(y,C,I,null,null,s)),
  54179. this.faceVertexUvs[0].push(l.generateTopUV(this, y, C, I))
  54180. }
  54181. }
  54182. ,
  54183. n.LatheBufferGeometry = function(e, t, i, r) {
  54184. n.BufferGeometry.call(this),
  54185. this.type = "LatheBufferGeometry",
  54186. this.parameters = {
  54187. points: e,
  54188. segments: t,
  54189. phiStart: i,
  54190. phiLength: r
  54191. },
  54192. t = Math.floor(t) || 12,
  54193. i = i || 0,
  54194. r = r || 2 * Math.PI,
  54195. r = n.Math.clamp(r, 0, 2 * Math.PI);
  54196. var o, a, s, l = (t + 1) * e.length, c = t * e.length * 2 * 3, h = new n.BufferAttribute(new (c > 65535 ? Uint32Array : Uint16Array)(c),1), u = new n.BufferAttribute(new Float32Array(3 * l),3), d = new n.BufferAttribute(new Float32Array(2 * l),2), p = 0, f = 0, g = (1 / (e.length - 1),
  54197. 1 / t), m = new n.Vector3, v = new n.Vector2;
  54198. for (a = 0; a <= t; a++) {
  54199. var A = i + a * g * r
  54200. , y = Math.sin(A)
  54201. , C = Math.cos(A);
  54202. for (s = 0; s <= e.length - 1; s++)
  54203. m.x = e[s].x * y,
  54204. m.y = e[s].y,
  54205. m.z = e[s].x * C,
  54206. u.setXYZ(p, m.x, m.y, m.z),
  54207. v.x = a / t,
  54208. v.y = s / (e.length - 1),
  54209. d.setXY(p, v.x, v.y),
  54210. p++
  54211. }
  54212. for (a = 0; a < t; a++)
  54213. for (s = 0; s < e.length - 1; s++) {
  54214. o = s + a * e.length;
  54215. var I = o
  54216. , E = o + e.length
  54217. , b = o + e.length + 1
  54218. , w = o + 1;
  54219. h.setX(f, I),
  54220. f++,
  54221. h.setX(f, E),
  54222. f++,
  54223. h.setX(f, w),
  54224. f++,
  54225. h.setX(f, E),
  54226. f++,
  54227. h.setX(f, b),
  54228. f++,
  54229. h.setX(f, w),
  54230. f++
  54231. }
  54232. if (this.setIndex(h),
  54233. this.addAttribute("position", u),
  54234. this.addAttribute("uv", d),
  54235. this.computeVertexNormals(),
  54236. r === 2 * Math.PI) {
  54237. var _ = this.attributes.normal.array
  54238. , T = new n.Vector3
  54239. , x = new n.Vector3
  54240. , S = new n.Vector3;
  54241. for (o = t * e.length * 3,
  54242. a = 0,
  54243. s = 0; a < e.length; a++,
  54244. s += 3)
  54245. T.x = _[s + 0],
  54246. T.y = _[s + 1],
  54247. T.z = _[s + 2],
  54248. x.x = _[o + s + 0],
  54249. x.y = _[o + s + 1],
  54250. x.z = _[o + s + 2],
  54251. S.addVectors(T, x).normalize(),
  54252. _[s + 0] = _[o + s + 0] = S.x,
  54253. _[s + 1] = _[o + s + 1] = S.y,
  54254. _[s + 2] = _[o + s + 2] = S.z
  54255. }
  54256. }
  54257. ,
  54258. n.LatheBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  54259. n.LatheBufferGeometry.prototype.constructor = n.LatheBufferGeometry,
  54260. n.LatheGeometry = function(e, t, i, r) {
  54261. n.Geometry.call(this),
  54262. this.type = "LatheGeometry",
  54263. this.parameters = {
  54264. points: e,
  54265. segments: t,
  54266. phiStart: i,
  54267. phiLength: r
  54268. },
  54269. this.fromBufferGeometry(new n.LatheBufferGeometry(e,t,i,r)),
  54270. this.mergeVertices()
  54271. }
  54272. ,
  54273. n.LatheGeometry.prototype = Object.create(n.Geometry.prototype),
  54274. n.LatheGeometry.prototype.constructor = n.LatheGeometry,
  54275. n.PlaneGeometry = function(e, t, i, r) {
  54276. n.Geometry.call(this),
  54277. this.type = "PlaneGeometry",
  54278. this.parameters = {
  54279. width: e,
  54280. height: t,
  54281. widthSegments: i,
  54282. heightSegments: r
  54283. },
  54284. this.fromBufferGeometry(new n.PlaneBufferGeometry(e,t,i,r))
  54285. }
  54286. ,
  54287. n.PlaneGeometry.prototype = Object.create(n.Geometry.prototype),
  54288. n.PlaneGeometry.prototype.constructor = n.PlaneGeometry,
  54289. n.PlaneBufferGeometry = function(e, t, i, r) {
  54290. n.BufferGeometry.call(this),
  54291. this.type = "PlaneBufferGeometry",
  54292. this.parameters = {
  54293. width: e,
  54294. height: t,
  54295. widthSegments: i,
  54296. heightSegments: r
  54297. };
  54298. for (var o = e / 2, a = t / 2, s = Math.floor(i) || 1, l = Math.floor(r) || 1, c = s + 1, h = l + 1, u = e / s, d = t / l, p = new Float32Array(c * h * 3), f = new Float32Array(c * h * 3), g = new Float32Array(c * h * 2), m = 0, v = 0, A = 0; A < h; A++)
  54299. for (var y = A * d - a, C = 0; C < c; C++) {
  54300. var I = C * u - o;
  54301. p[m] = I,
  54302. p[m + 1] = -y,
  54303. f[m + 2] = 1,
  54304. g[v] = C / s,
  54305. g[v + 1] = 1 - A / l,
  54306. m += 3,
  54307. v += 2
  54308. }
  54309. m = 0;
  54310. for (var E = new (p.length / 3 > 65535 ? Uint32Array : Uint16Array)(s * l * 6), A = 0; A < l; A++)
  54311. for (var C = 0; C < s; C++) {
  54312. var b = C + c * A
  54313. , w = C + c * (A + 1)
  54314. , _ = C + 1 + c * (A + 1)
  54315. , T = C + 1 + c * A;
  54316. E[m] = b,
  54317. E[m + 1] = w,
  54318. E[m + 2] = T,
  54319. E[m + 3] = w,
  54320. E[m + 4] = _,
  54321. E[m + 5] = T,
  54322. m += 6
  54323. }
  54324. this.setIndex(new n.BufferAttribute(E,1)),
  54325. this.addAttribute("position", new n.BufferAttribute(p,3)),
  54326. this.addAttribute("normal", new n.BufferAttribute(f,3)),
  54327. this.addAttribute("uv", new n.BufferAttribute(g,2))
  54328. }
  54329. ,
  54330. n.PlaneBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  54331. n.PlaneBufferGeometry.prototype.constructor = n.PlaneBufferGeometry,
  54332. n.RingBufferGeometry = function(e, t, i, r, o, a) {
  54333. n.BufferGeometry.call(this),
  54334. this.type = "RingBufferGeometry",
  54335. this.parameters = {
  54336. innerRadius: e,
  54337. outerRadius: t,
  54338. thetaSegments: i,
  54339. phiSegments: r,
  54340. thetaStart: o,
  54341. thetaLength: a
  54342. },
  54343. e = e || 20,
  54344. t = t || 50,
  54345. o = void 0 !== o ? o : 0,
  54346. a = void 0 !== a ? a : 2 * Math.PI,
  54347. i = void 0 !== i ? Math.max(3, i) : 8,
  54348. r = void 0 !== r ? Math.max(1, r) : 1;
  54349. var s, l, c, h = (i + 1) * (r + 1), u = i * r * 2 * 3, d = new n.BufferAttribute(new (u > 65535 ? Uint32Array : Uint16Array)(u),1), p = new n.BufferAttribute(new Float32Array(3 * h),3), f = new n.BufferAttribute(new Float32Array(3 * h),3), g = new n.BufferAttribute(new Float32Array(2 * h),2), m = 0, v = 0, A = e, y = (t - e) / r, C = new n.Vector3, I = new n.Vector2;
  54350. for (l = 0; l <= r; l++) {
  54351. for (c = 0; c <= i; c++)
  54352. s = o + c / i * a,
  54353. C.x = A * Math.cos(s),
  54354. C.y = A * Math.sin(s),
  54355. p.setXYZ(m, C.x, C.y, C.z),
  54356. f.setXYZ(m, 0, 0, 1),
  54357. I.x = (C.x / t + 1) / 2,
  54358. I.y = (C.y / t + 1) / 2,
  54359. g.setXY(m, I.x, I.y),
  54360. m++;
  54361. A += y
  54362. }
  54363. for (l = 0; l < r; l++) {
  54364. var E = l * (i + 1);
  54365. for (c = 0; c < i; c++) {
  54366. s = c + E;
  54367. var b = s
  54368. , w = s + i + 1
  54369. , _ = s + i + 2
  54370. , T = s + 1;
  54371. d.setX(v, b),
  54372. v++,
  54373. d.setX(v, w),
  54374. v++,
  54375. d.setX(v, _),
  54376. v++,
  54377. d.setX(v, b),
  54378. v++,
  54379. d.setX(v, _),
  54380. v++,
  54381. d.setX(v, T),
  54382. v++
  54383. }
  54384. }
  54385. this.setIndex(d),
  54386. this.addAttribute("position", p),
  54387. this.addAttribute("normal", f),
  54388. this.addAttribute("uv", g)
  54389. }
  54390. ,
  54391. n.RingBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  54392. n.RingBufferGeometry.prototype.constructor = n.RingBufferGeometry,
  54393. n.RingGeometry = function(e, t, i, r, o, a) {
  54394. n.Geometry.call(this),
  54395. this.type = "RingGeometry",
  54396. this.parameters = {
  54397. innerRadius: e,
  54398. outerRadius: t,
  54399. thetaSegments: i,
  54400. phiSegments: r,
  54401. thetaStart: o,
  54402. thetaLength: a
  54403. },
  54404. this.fromBufferGeometry(new n.RingBufferGeometry(e,t,i,r,o,a))
  54405. }
  54406. ,
  54407. n.RingGeometry.prototype = Object.create(n.Geometry.prototype),
  54408. n.RingGeometry.prototype.constructor = n.RingGeometry,
  54409. n.SphereGeometry = function(e, t, i, r, o, a, s) {
  54410. n.Geometry.call(this),
  54411. this.type = "SphereGeometry",
  54412. this.parameters = {
  54413. radius: e,
  54414. widthSegments: t,
  54415. heightSegments: i,
  54416. phiStart: r,
  54417. phiLength: o,
  54418. thetaStart: a,
  54419. thetaLength: s
  54420. },
  54421. this.fromBufferGeometry(new n.SphereBufferGeometry(e,t,i,r,o,a,s))
  54422. }
  54423. ,
  54424. n.SphereGeometry.prototype = Object.create(n.Geometry.prototype),
  54425. n.SphereGeometry.prototype.constructor = n.SphereGeometry,
  54426. n.SphereBufferGeometry = function(e, t, i, r, o, a, s) {
  54427. n.BufferGeometry.call(this),
  54428. this.type = "SphereBufferGeometry",
  54429. this.parameters = {
  54430. radius: e,
  54431. widthSegments: t,
  54432. heightSegments: i,
  54433. phiStart: r,
  54434. phiLength: o,
  54435. thetaStart: a,
  54436. thetaLength: s
  54437. },
  54438. e = e || 50,
  54439. t = Math.max(3, Math.floor(t) || 8),
  54440. i = Math.max(2, Math.floor(i) || 6),
  54441. r = void 0 !== r ? r : 0,
  54442. o = void 0 !== o ? o : 2 * Math.PI,
  54443. a = void 0 !== a ? a : 0,
  54444. s = void 0 !== s ? s : Math.PI;
  54445. for (var l = a + s, c = (t + 1) * (i + 1), h = new n.BufferAttribute(new Float32Array(3 * c),3), u = new n.BufferAttribute(new Float32Array(3 * c),3), d = new n.BufferAttribute(new Float32Array(2 * c),2), p = 0, f = [], g = new n.Vector3, m = 0; m <= i; m++) {
  54446. for (var v = [], A = m / i, y = 0; y <= t; y++) {
  54447. var C = y / t
  54448. , I = -e * Math.cos(r + C * o) * Math.sin(a + A * s)
  54449. , E = e * Math.cos(a + A * s)
  54450. , b = e * Math.sin(r + C * o) * Math.sin(a + A * s);
  54451. g.set(I, E, b).normalize(),
  54452. h.setXYZ(p, I, E, b),
  54453. u.setXYZ(p, g.x, g.y, g.z),
  54454. d.setXY(p, C, 1 - A),
  54455. v.push(p),
  54456. p++
  54457. }
  54458. f.push(v)
  54459. }
  54460. for (var w = [], m = 0; m < i; m++)
  54461. for (var y = 0; y < t; y++) {
  54462. var _ = f[m][y + 1]
  54463. , T = f[m][y]
  54464. , x = f[m + 1][y]
  54465. , S = f[m + 1][y + 1];
  54466. (0 !== m || a > 0) && w.push(_, T, S),
  54467. (m !== i - 1 || l < Math.PI) && w.push(T, x, S)
  54468. }
  54469. this.setIndex(new (h.count > 65535 ? n.Uint32Attribute : n.Uint16Attribute)(w,1)),
  54470. this.addAttribute("position", h),
  54471. this.addAttribute("normal", u),
  54472. this.addAttribute("uv", d),
  54473. this.boundingSphere = new n.Sphere(new n.Vector3,e)
  54474. }
  54475. ,
  54476. n.SphereBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  54477. n.SphereBufferGeometry.prototype.constructor = n.SphereBufferGeometry,
  54478. n.TextGeometry = function(e, t) {
  54479. t = t || {};
  54480. var i = t.font;
  54481. if (i instanceof n.Font == !1)
  54482. return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),
  54483. new n.Geometry;
  54484. var r = i.generateShapes(e, t.size, t.curveSegments);
  54485. t.amount = void 0 !== t.height ? t.height : 50,
  54486. void 0 === t.bevelThickness && (t.bevelThickness = 10),
  54487. void 0 === t.bevelSize && (t.bevelSize = 8),
  54488. void 0 === t.bevelEnabled && (t.bevelEnabled = !1),
  54489. n.ExtrudeGeometry.call(this, r, t),
  54490. this.type = "TextGeometry"
  54491. }
  54492. ,
  54493. n.TextGeometry.prototype = Object.create(n.ExtrudeGeometry.prototype),
  54494. n.TextGeometry.prototype.constructor = n.TextGeometry,
  54495. n.TorusBufferGeometry = function(e, t, i, r, o) {
  54496. n.BufferGeometry.call(this),
  54497. this.type = "TorusBufferGeometry",
  54498. this.parameters = {
  54499. radius: e,
  54500. tube: t,
  54501. radialSegments: i,
  54502. tubularSegments: r,
  54503. arc: o
  54504. },
  54505. e = e || 100,
  54506. t = t || 40,
  54507. i = Math.floor(i) || 8,
  54508. r = Math.floor(r) || 6,
  54509. o = o || 2 * Math.PI;
  54510. var a, s, l = (i + 1) * (r + 1), c = i * r * 2 * 3, h = new (c > 65535 ? Uint32Array : Uint16Array)(c), u = new Float32Array(3 * l), d = new Float32Array(3 * l), p = new Float32Array(2 * l), f = 0, g = 0, m = 0, v = new n.Vector3, A = new n.Vector3, y = new n.Vector3;
  54511. for (a = 0; a <= i; a++)
  54512. for (s = 0; s <= r; s++) {
  54513. var C = s / r * o
  54514. , I = a / i * Math.PI * 2;
  54515. A.x = (e + t * Math.cos(I)) * Math.cos(C),
  54516. A.y = (e + t * Math.cos(I)) * Math.sin(C),
  54517. A.z = t * Math.sin(I),
  54518. u[f] = A.x,
  54519. u[f + 1] = A.y,
  54520. u[f + 2] = A.z,
  54521. v.x = e * Math.cos(C),
  54522. v.y = e * Math.sin(C),
  54523. y.subVectors(A, v).normalize(),
  54524. d[f] = y.x,
  54525. d[f + 1] = y.y,
  54526. d[f + 2] = y.z,
  54527. p[g] = s / r,
  54528. p[g + 1] = a / i,
  54529. f += 3,
  54530. g += 2
  54531. }
  54532. for (a = 1; a <= i; a++)
  54533. for (s = 1; s <= r; s++) {
  54534. var E = (r + 1) * a + s - 1
  54535. , b = (r + 1) * (a - 1) + s - 1
  54536. , w = (r + 1) * (a - 1) + s
  54537. , _ = (r + 1) * a + s;
  54538. h[m] = E,
  54539. h[m + 1] = b,
  54540. h[m + 2] = _,
  54541. h[m + 3] = b,
  54542. h[m + 4] = w,
  54543. h[m + 5] = _,
  54544. m += 6
  54545. }
  54546. this.setIndex(new n.BufferAttribute(h,1)),
  54547. this.addAttribute("position", new n.BufferAttribute(u,3)),
  54548. this.addAttribute("normal", new n.BufferAttribute(d,3)),
  54549. this.addAttribute("uv", new n.BufferAttribute(p,2))
  54550. }
  54551. ,
  54552. n.TorusBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  54553. n.TorusBufferGeometry.prototype.constructor = n.TorusBufferGeometry,
  54554. n.TorusGeometry = function(e, t, i, r, o) {
  54555. n.Geometry.call(this),
  54556. this.type = "TorusGeometry",
  54557. this.parameters = {
  54558. radius: e,
  54559. tube: t,
  54560. radialSegments: i,
  54561. tubularSegments: r,
  54562. arc: o
  54563. },
  54564. this.fromBufferGeometry(new n.TorusBufferGeometry(e,t,i,r,o))
  54565. }
  54566. ,
  54567. n.TorusGeometry.prototype = Object.create(n.Geometry.prototype),
  54568. n.TorusGeometry.prototype.constructor = n.TorusGeometry,
  54569. n.TorusKnotBufferGeometry = function(e, t, i, r, o, a) {
  54570. function s(e, t, i, n, r) {
  54571. var o = Math.cos(e)
  54572. , a = Math.sin(e)
  54573. , s = i / t * e
  54574. , l = Math.cos(s);
  54575. r.x = n * (2 + l) * .5 * o,
  54576. r.y = n * (2 + l) * a * .5,
  54577. r.z = n * Math.sin(s) * .5
  54578. }
  54579. n.BufferGeometry.call(this),
  54580. this.type = "TorusKnotBufferGeometry",
  54581. this.parameters = {
  54582. radius: e,
  54583. tube: t,
  54584. tubularSegments: i,
  54585. radialSegments: r,
  54586. p: o,
  54587. q: a
  54588. },
  54589. e = e || 100,
  54590. t = t || 40,
  54591. i = Math.floor(i) || 64,
  54592. r = Math.floor(r) || 8,
  54593. o = o || 2,
  54594. a = a || 3;
  54595. var l, c, h = (r + 1) * (i + 1), u = r * i * 2 * 3, d = new n.BufferAttribute(new (u > 65535 ? Uint32Array : Uint16Array)(u),1), p = new n.BufferAttribute(new Float32Array(3 * h),3), f = new n.BufferAttribute(new Float32Array(3 * h),3), g = new n.BufferAttribute(new Float32Array(2 * h),2), m = 0, v = 0, A = new n.Vector3, y = new n.Vector3, C = new n.Vector2, I = new n.Vector3, E = new n.Vector3, b = new n.Vector3, w = new n.Vector3, _ = new n.Vector3;
  54596. for (l = 0; l <= i; ++l) {
  54597. var T = l / i * o * Math.PI * 2;
  54598. for (s(T, o, a, e, I),
  54599. s(T + .01, o, a, e, E),
  54600. w.subVectors(E, I),
  54601. _.addVectors(E, I),
  54602. b.crossVectors(w, _),
  54603. _.crossVectors(b, w),
  54604. b.normalize(),
  54605. _.normalize(),
  54606. c = 0; c <= r; ++c) {
  54607. var x = c / r * Math.PI * 2
  54608. , S = -t * Math.cos(x)
  54609. , M = t * Math.sin(x);
  54610. A.x = I.x + (S * _.x + M * b.x),
  54611. A.y = I.y + (S * _.y + M * b.y),
  54612. A.z = I.z + (S * _.z + M * b.z),
  54613. p.setXYZ(m, A.x, A.y, A.z),
  54614. y.subVectors(A, I).normalize(),
  54615. f.setXYZ(m, y.x, y.y, y.z),
  54616. C.x = l / i,
  54617. C.y = c / r,
  54618. g.setXY(m, C.x, C.y),
  54619. m++
  54620. }
  54621. }
  54622. for (c = 1; c <= i; c++)
  54623. for (l = 1; l <= r; l++) {
  54624. var R = (r + 1) * (c - 1) + (l - 1)
  54625. , P = (r + 1) * c + (l - 1)
  54626. , O = (r + 1) * c + l
  54627. , L = (r + 1) * (c - 1) + l;
  54628. d.setX(v, R),
  54629. v++,
  54630. d.setX(v, P),
  54631. v++,
  54632. d.setX(v, L),
  54633. v++,
  54634. d.setX(v, P),
  54635. v++,
  54636. d.setX(v, O),
  54637. v++,
  54638. d.setX(v, L),
  54639. v++
  54640. }
  54641. this.setIndex(d),
  54642. this.addAttribute("position", p),
  54643. this.addAttribute("normal", f),
  54644. this.addAttribute("uv", g)
  54645. }
  54646. ,
  54647. n.TorusKnotBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  54648. n.TorusKnotBufferGeometry.prototype.constructor = n.TorusKnotBufferGeometry,
  54649. n.TorusKnotGeometry = function(e, t, i, r, o, a, s) {
  54650. n.Geometry.call(this),
  54651. this.type = "TorusKnotGeometry",
  54652. this.parameters = {
  54653. radius: e,
  54654. tube: t,
  54655. tubularSegments: i,
  54656. radialSegments: r,
  54657. p: o,
  54658. q: a
  54659. },
  54660. void 0 !== s && console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),
  54661. this.fromBufferGeometry(new n.TorusKnotBufferGeometry(e,t,i,r,o,a)),
  54662. this.mergeVertices()
  54663. }
  54664. ,
  54665. n.TorusKnotGeometry.prototype = Object.create(n.Geometry.prototype),
  54666. n.TorusKnotGeometry.prototype.constructor = n.TorusKnotGeometry,
  54667. n.TubeGeometry = function(e, t, i, r, o, a) {
  54668. function s(e, t, i) {
  54669. return R.vertices.push(new n.Vector3(e,t,i)) - 1
  54670. }
  54671. n.Geometry.call(this),
  54672. this.type = "TubeGeometry",
  54673. this.parameters = {
  54674. path: e,
  54675. segments: t,
  54676. radius: i,
  54677. radialSegments: r,
  54678. closed: o,
  54679. taper: a
  54680. },
  54681. t = t || 64,
  54682. i = i || 1,
  54683. r = r || 8,
  54684. o = o || !1,
  54685. a = a || n.TubeGeometry.NoTaper;
  54686. var l, c, h, u, d, p, f, g, m, v, A, y, C, I, E, b, w, _, T, x, S, M = [], R = this, P = t + 1, O = new n.Vector3, L = new n.TubeGeometry.FrenetFrames(e,t,o), D = L.tangents, N = L.normals, B = L.binormals;
  54687. for (this.tangents = D,
  54688. this.normals = N,
  54689. this.binormals = B,
  54690. v = 0; v < P; v++)
  54691. for (M[v] = [],
  54692. u = v / (P - 1),
  54693. m = e.getPointAt(u),
  54694. l = D[v],
  54695. c = N[v],
  54696. h = B[v],
  54697. p = i * a(u),
  54698. A = 0; A < r; A++)
  54699. d = A / r * 2 * Math.PI,
  54700. f = -p * Math.cos(d),
  54701. g = p * Math.sin(d),
  54702. O.copy(m),
  54703. O.x += f * c.x + g * h.x,
  54704. O.y += f * c.y + g * h.y,
  54705. O.z += f * c.z + g * h.z,
  54706. M[v][A] = s(O.x, O.y, O.z);
  54707. for (v = 0; v < t; v++)
  54708. for (A = 0; A < r; A++)
  54709. y = o ? (v + 1) % t : v + 1,
  54710. C = (A + 1) % r,
  54711. I = M[v][A],
  54712. E = M[y][A],
  54713. b = M[y][C],
  54714. w = M[v][C],
  54715. _ = new n.Vector2(v / t,A / r),
  54716. T = new n.Vector2((v + 1) / t,A / r),
  54717. x = new n.Vector2((v + 1) / t,(A + 1) / r),
  54718. S = new n.Vector2(v / t,(A + 1) / r),
  54719. this.faces.push(new n.Face3(I,E,w)),
  54720. this.faceVertexUvs[0].push([_, T, S]),
  54721. this.faces.push(new n.Face3(E,b,w)),
  54722. this.faceVertexUvs[0].push([T.clone(), x, S.clone()]);
  54723. this.computeFaceNormals(),
  54724. this.computeVertexNormals()
  54725. }
  54726. ,
  54727. n.TubeGeometry.prototype = Object.create(n.Geometry.prototype),
  54728. n.TubeGeometry.prototype.constructor = n.TubeGeometry,
  54729. n.TubeGeometry.NoTaper = function(e) {
  54730. return 1
  54731. }
  54732. ,
  54733. n.TubeGeometry.SinusoidalTaper = function(e) {
  54734. return Math.sin(Math.PI * e)
  54735. }
  54736. ,
  54737. n.TubeGeometry.FrenetFrames = function(e, t, i) {
  54738. function r() {
  54739. f[0] = new n.Vector3,
  54740. g[0] = new n.Vector3,
  54741. a = Number.MAX_VALUE,
  54742. s = Math.abs(p[0].x),
  54743. l = Math.abs(p[0].y),
  54744. c = Math.abs(p[0].z),
  54745. s <= a && (a = s,
  54746. d.set(1, 0, 0)),
  54747. l <= a && (a = l,
  54748. d.set(0, 1, 0)),
  54749. c <= a && d.set(0, 0, 1),
  54750. m.crossVectors(p[0], d).normalize(),
  54751. f[0].crossVectors(p[0], m),
  54752. g[0].crossVectors(p[0], f[0])
  54753. }
  54754. var o, a, s, l, c, h, u, d = new n.Vector3, p = [], f = [], g = [], m = new n.Vector3, v = new n.Matrix4, A = t + 1;
  54755. for (this.tangents = p,
  54756. this.normals = f,
  54757. this.binormals = g,
  54758. h = 0; h < A; h++)
  54759. u = h / (A - 1),
  54760. p[h] = e.getTangentAt(u),
  54761. p[h].normalize();
  54762. for (r(),
  54763. h = 1; h < A; h++)
  54764. f[h] = f[h - 1].clone(),
  54765. g[h] = g[h - 1].clone(),
  54766. m.crossVectors(p[h - 1], p[h]),
  54767. m.length() > Number.EPSILON && (m.normalize(),
  54768. o = Math.acos(n.Math.clamp(p[h - 1].dot(p[h]), -1, 1)),
  54769. f[h].applyMatrix4(v.makeRotationAxis(m, o))),
  54770. g[h].crossVectors(p[h], f[h]);
  54771. if (i)
  54772. for (o = Math.acos(n.Math.clamp(f[0].dot(f[A - 1]), -1, 1)),
  54773. o /= A - 1,
  54774. p[0].dot(m.crossVectors(f[0], f[A - 1])) > 0 && (o = -o),
  54775. h = 1; h < A; h++)
  54776. f[h].applyMatrix4(v.makeRotationAxis(p[h], o * h)),
  54777. g[h].crossVectors(p[h], f[h])
  54778. }
  54779. ,
  54780. n.PolyhedronGeometry = function(e, t, i, r) {
  54781. function o(e) {
  54782. var t = e.normalize().clone();
  54783. t.index = u.vertices.push(t) - 1;
  54784. var i = l(e) / 2 / Math.PI + .5
  54785. , r = c(e) / Math.PI + .5;
  54786. return t.uv = new n.Vector2(i,1 - r),
  54787. t
  54788. }
  54789. function a(e, t, i, r) {
  54790. var o = new n.Face3(e.index,t.index,i.index,[e.clone(), t.clone(), i.clone()],void 0,r);
  54791. u.faces.push(o),
  54792. C.copy(e).add(t).add(i).divideScalar(3);
  54793. var a = l(C);
  54794. u.faceVertexUvs[0].push([h(e.uv, e, a), h(t.uv, t, a), h(i.uv, i, a)])
  54795. }
  54796. function s(e, t) {
  54797. for (var i = Math.pow(2, t), n = o(u.vertices[e.a]), r = o(u.vertices[e.b]), s = o(u.vertices[e.c]), l = [], c = e.materialIndex, h = 0; h <= i; h++) {
  54798. l[h] = [];
  54799. for (var d = o(n.clone().lerp(s, h / i)), p = o(r.clone().lerp(s, h / i)), f = i - h, g = 0; g <= f; g++)
  54800. 0 === g && h === i ? l[h][g] = d : l[h][g] = o(d.clone().lerp(p, g / f))
  54801. }
  54802. for (var h = 0; h < i; h++)
  54803. for (var g = 0; g < 2 * (i - h) - 1; g++) {
  54804. var m = Math.floor(g / 2);
  54805. g % 2 === 0 ? a(l[h][m + 1], l[h + 1][m], l[h][m], c) : a(l[h][m + 1], l[h + 1][m + 1], l[h + 1][m], c)
  54806. }
  54807. }
  54808. function l(e) {
  54809. return Math.atan2(e.z, -e.x)
  54810. }
  54811. function c(e) {
  54812. return Math.atan2(-e.y, Math.sqrt(e.x * e.x + e.z * e.z))
  54813. }
  54814. function h(e, t, i) {
  54815. return i < 0 && 1 === e.x && (e = new n.Vector2(e.x - 1,e.y)),
  54816. 0 === t.x && 0 === t.z && (e = new n.Vector2(i / 2 / Math.PI + .5,e.y)),
  54817. e.clone()
  54818. }
  54819. n.Geometry.call(this),
  54820. this.type = "PolyhedronGeometry",
  54821. this.parameters = {
  54822. vertices: e,
  54823. indices: t,
  54824. radius: i,
  54825. detail: r
  54826. },
  54827. i = i || 1,
  54828. r = r || 0;
  54829. for (var u = this, d = 0, p = e.length; d < p; d += 3)
  54830. o(new n.Vector3(e[d],e[d + 1],e[d + 2]));
  54831. for (var f = this.vertices, g = [], d = 0, m = 0, p = t.length; d < p; d += 3,
  54832. m++) {
  54833. var v = f[t[d]]
  54834. , A = f[t[d + 1]]
  54835. , y = f[t[d + 2]];
  54836. g[m] = new n.Face3(v.index,A.index,y.index,[v.clone(), A.clone(), y.clone()],void 0,m)
  54837. }
  54838. for (var C = new n.Vector3, d = 0, p = g.length; d < p; d++)
  54839. s(g[d], r);
  54840. for (var d = 0, p = this.faceVertexUvs[0].length; d < p; d++) {
  54841. var I = this.faceVertexUvs[0][d]
  54842. , E = I[0].x
  54843. , b = I[1].x
  54844. , w = I[2].x
  54845. , _ = Math.max(E, b, w)
  54846. , T = Math.min(E, b, w);
  54847. _ > .9 && T < .1 && (E < .2 && (I[0].x += 1),
  54848. b < .2 && (I[1].x += 1),
  54849. w < .2 && (I[2].x += 1))
  54850. }
  54851. for (var d = 0, p = this.vertices.length; d < p; d++)
  54852. this.vertices[d].multiplyScalar(i);
  54853. this.mergeVertices(),
  54854. this.computeFaceNormals(),
  54855. this.boundingSphere = new n.Sphere(new n.Vector3,i)
  54856. }
  54857. ,
  54858. n.PolyhedronGeometry.prototype = Object.create(n.Geometry.prototype),
  54859. n.PolyhedronGeometry.prototype.constructor = n.PolyhedronGeometry,
  54860. n.DodecahedronGeometry = function(e, t) {
  54861. var i = (1 + Math.sqrt(5)) / 2
  54862. , r = 1 / i
  54863. , o = [-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, -r, -i, 0, -r, i, 0, r, -i, 0, r, i, -r, -i, 0, -r, i, 0, r, -i, 0, r, i, 0, -i, 0, -r, i, 0, -r, -i, 0, r, i, 0, r]
  54864. , a = [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];
  54865. n.PolyhedronGeometry.call(this, o, a, e, t),
  54866. this.type = "DodecahedronGeometry",
  54867. this.parameters = {
  54868. radius: e,
  54869. detail: t
  54870. }
  54871. }
  54872. ,
  54873. n.DodecahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  54874. n.DodecahedronGeometry.prototype.constructor = n.DodecahedronGeometry,
  54875. n.IcosahedronGeometry = function(e, t) {
  54876. var i = (1 + Math.sqrt(5)) / 2
  54877. , r = [-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]
  54878. , o = [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];
  54879. n.PolyhedronGeometry.call(this, r, o, e, t),
  54880. this.type = "IcosahedronGeometry",
  54881. this.parameters = {
  54882. radius: e,
  54883. detail: t
  54884. }
  54885. }
  54886. ,
  54887. n.IcosahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  54888. n.IcosahedronGeometry.prototype.constructor = n.IcosahedronGeometry,
  54889. n.OctahedronGeometry = function(e, t) {
  54890. var i = [1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1]
  54891. , r = [0, 2, 4, 0, 4, 3, 0, 3, 5, 0, 5, 2, 1, 2, 5, 1, 5, 3, 1, 3, 4, 1, 4, 2];
  54892. n.PolyhedronGeometry.call(this, i, r, e, t),
  54893. this.type = "OctahedronGeometry",
  54894. this.parameters = {
  54895. radius: e,
  54896. detail: t
  54897. }
  54898. }
  54899. ,
  54900. n.OctahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  54901. n.OctahedronGeometry.prototype.constructor = n.OctahedronGeometry,
  54902. n.TetrahedronGeometry = function(e, t) {
  54903. var i = [1, 1, 1, -1, -1, 1, -1, 1, -1, 1, -1, -1]
  54904. , r = [2, 1, 0, 0, 3, 2, 1, 3, 0, 2, 3, 1];
  54905. n.PolyhedronGeometry.call(this, i, r, e, t),
  54906. this.type = "TetrahedronGeometry",
  54907. this.parameters = {
  54908. radius: e,
  54909. detail: t
  54910. }
  54911. }
  54912. ,
  54913. n.TetrahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  54914. n.TetrahedronGeometry.prototype.constructor = n.TetrahedronGeometry,
  54915. n.ParametricGeometry = function(e, t, i) {
  54916. n.Geometry.call(this),
  54917. this.type = "ParametricGeometry",
  54918. this.parameters = {
  54919. func: e,
  54920. slices: t,
  54921. stacks: i
  54922. };
  54923. var r, o, a, s, l, c = this.vertices, h = this.faces, u = this.faceVertexUvs[0], d = t + 1;
  54924. for (r = 0; r <= i; r++)
  54925. for (l = r / i,
  54926. o = 0; o <= t; o++)
  54927. s = o / t,
  54928. a = e(s, l),
  54929. c.push(a);
  54930. var p, f, g, m, v, A, y, C;
  54931. for (r = 0; r < i; r++)
  54932. for (o = 0; o < t; o++)
  54933. p = r * d + o,
  54934. f = r * d + o + 1,
  54935. g = (r + 1) * d + o + 1,
  54936. m = (r + 1) * d + o,
  54937. v = new n.Vector2(o / t,r / i),
  54938. A = new n.Vector2((o + 1) / t,r / i),
  54939. y = new n.Vector2((o + 1) / t,(r + 1) / i),
  54940. C = new n.Vector2(o / t,(r + 1) / i),
  54941. h.push(new n.Face3(p,f,m)),
  54942. u.push([v, A, C]),
  54943. h.push(new n.Face3(f,g,m)),
  54944. u.push([A.clone(), y, C.clone()]);
  54945. this.computeFaceNormals(),
  54946. this.computeVertexNormals()
  54947. }
  54948. ,
  54949. n.ParametricGeometry.prototype = Object.create(n.Geometry.prototype),
  54950. n.ParametricGeometry.prototype.constructor = n.ParametricGeometry,
  54951. n.WireframeGeometry = function(e) {
  54952. function t(e, t) {
  54953. return e - t
  54954. }
  54955. n.BufferGeometry.call(this);
  54956. var i = [0, 0]
  54957. , r = {}
  54958. , o = ["a", "b", "c"];
  54959. if (e instanceof n.Geometry) {
  54960. for (var a = e.vertices, s = e.faces, l = 0, c = new Uint32Array(6 * s.length), h = 0, u = s.length; h < u; h++)
  54961. for (var d = s[h], p = 0; p < 3; p++) {
  54962. i[0] = d[o[p]],
  54963. i[1] = d[o[(p + 1) % 3]],
  54964. i.sort(t);
  54965. var f = i.toString();
  54966. void 0 === r[f] && (c[2 * l] = i[0],
  54967. c[2 * l + 1] = i[1],
  54968. r[f] = !0,
  54969. l++)
  54970. }
  54971. for (var g = new Float32Array(2 * l * 3), h = 0, u = l; h < u; h++)
  54972. for (var p = 0; p < 2; p++) {
  54973. var m = a[c[2 * h + p]]
  54974. , v = 6 * h + 3 * p;
  54975. g[v + 0] = m.x,
  54976. g[v + 1] = m.y,
  54977. g[v + 2] = m.z
  54978. }
  54979. this.addAttribute("position", new n.BufferAttribute(g,3))
  54980. } else if (e instanceof n.BufferGeometry)
  54981. if (null !== e.index) {
  54982. var A = e.index.array
  54983. , a = e.attributes.position
  54984. , y = e.groups
  54985. , l = 0;
  54986. 0 === y.length && e.addGroup(0, A.length);
  54987. for (var c = new Uint32Array(2 * A.length), C = 0, I = y.length; C < I; ++C)
  54988. for (var E = y[C], b = E.start, w = E.count, h = b, _ = b + w; h < _; h += 3)
  54989. for (var p = 0; p < 3; p++) {
  54990. i[0] = A[h + p],
  54991. i[1] = A[h + (p + 1) % 3],
  54992. i.sort(t);
  54993. var f = i.toString();
  54994. void 0 === r[f] && (c[2 * l] = i[0],
  54995. c[2 * l + 1] = i[1],
  54996. r[f] = !0,
  54997. l++)
  54998. }
  54999. for (var g = new Float32Array(2 * l * 3), h = 0, u = l; h < u; h++)
  55000. for (var p = 0; p < 2; p++) {
  55001. var v = 6 * h + 3 * p
  55002. , T = c[2 * h + p];
  55003. g[v + 0] = a.getX(T),
  55004. g[v + 1] = a.getY(T),
  55005. g[v + 2] = a.getZ(T)
  55006. }
  55007. this.addAttribute("position", new n.BufferAttribute(g,3))
  55008. } else {
  55009. for (var a = e.attributes.position.array, l = a.length / 3, x = l / 3, g = new Float32Array(2 * l * 3), h = 0, u = x; h < u; h++)
  55010. for (var p = 0; p < 3; p++) {
  55011. var v = 18 * h + 6 * p
  55012. , S = 9 * h + 3 * p;
  55013. g[v + 0] = a[S],
  55014. g[v + 1] = a[S + 1],
  55015. g[v + 2] = a[S + 2];
  55016. var T = 9 * h + 3 * ((p + 1) % 3);
  55017. g[v + 3] = a[T],
  55018. g[v + 4] = a[T + 1],
  55019. g[v + 5] = a[T + 2]
  55020. }
  55021. this.addAttribute("position", new n.BufferAttribute(g,3))
  55022. }
  55023. }
  55024. ,
  55025. n.WireframeGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  55026. n.WireframeGeometry.prototype.constructor = n.WireframeGeometry,
  55027. n.AxisHelper = function(e) {
  55028. e = e || 1;
  55029. var t = new Float32Array([0, 0, 0, e, 0, 0, 0, 0, 0, 0, e, 0, 0, 0, 0, 0, 0, e])
  55030. , i = new Float32Array([1, 0, 0, 1, .6, 0, 0, 1, 0, .6, 1, 0, 0, 0, 1, 0, .6, 1])
  55031. , r = new n.BufferGeometry;
  55032. r.addAttribute("position", new n.BufferAttribute(t,3)),
  55033. r.addAttribute("color", new n.BufferAttribute(i,3));
  55034. var o = new n.LineBasicMaterial({
  55035. vertexColors: n.VertexColors
  55036. });
  55037. n.LineSegments.call(this, r, o)
  55038. }
  55039. ,
  55040. n.AxisHelper.prototype = Object.create(n.LineSegments.prototype),
  55041. n.AxisHelper.prototype.constructor = n.AxisHelper,
  55042. n.ArrowHelper = function() {
  55043. var e = new n.Geometry;
  55044. e.vertices.push(new n.Vector3(0,0,0), new n.Vector3(0,1,0));
  55045. var t = new n.CylinderGeometry(0,.5,1,5,1);
  55046. return t.translate(0, -.5, 0),
  55047. function(i, r, o, a, s, l) {
  55048. n.Object3D.call(this),
  55049. void 0 === a && (a = 16776960),
  55050. void 0 === o && (o = 1),
  55051. void 0 === s && (s = .2 * o),
  55052. void 0 === l && (l = .2 * s),
  55053. this.position.copy(r),
  55054. this.line = new n.Line(e,new n.LineBasicMaterial({
  55055. color: a
  55056. })),
  55057. this.line.matrixAutoUpdate = !1,
  55058. this.add(this.line),
  55059. this.cone = new n.Mesh(t,new n.MeshBasicMaterial({
  55060. color: a
  55061. })),
  55062. this.cone.matrixAutoUpdate = !1,
  55063. this.add(this.cone),
  55064. this.setDirection(i),
  55065. this.setLength(o, s, l)
  55066. }
  55067. }(),
  55068. n.ArrowHelper.prototype = Object.create(n.Object3D.prototype),
  55069. n.ArrowHelper.prototype.constructor = n.ArrowHelper,
  55070. n.ArrowHelper.prototype.setDirection = function() {
  55071. var e, t = new n.Vector3;
  55072. return function(i) {
  55073. i.y > .99999 ? this.quaternion.set(0, 0, 0, 1) : i.y < -.99999 ? this.quaternion.set(1, 0, 0, 0) : (t.set(i.z, 0, -i.x).normalize(),
  55074. e = Math.acos(i.y),
  55075. this.quaternion.setFromAxisAngle(t, e))
  55076. }
  55077. }(),
  55078. n.ArrowHelper.prototype.setLength = function(e, t, i) {
  55079. void 0 === t && (t = .2 * e),
  55080. void 0 === i && (i = .2 * t),
  55081. this.line.scale.set(1, Math.max(0, e - t), 1),
  55082. this.line.updateMatrix(),
  55083. this.cone.scale.set(i, t, i),
  55084. this.cone.position.y = e,
  55085. this.cone.updateMatrix()
  55086. }
  55087. ,
  55088. n.ArrowHelper.prototype.setColor = function(e) {
  55089. this.line.material.color.set(e),
  55090. this.cone.material.color.set(e)
  55091. }
  55092. ,
  55093. n.BoxHelper = function(e) {
  55094. 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])
  55095. , i = new Float32Array(24)
  55096. , r = new n.BufferGeometry;
  55097. r.setIndex(new n.BufferAttribute(t,1)),
  55098. r.addAttribute("position", new n.BufferAttribute(i,3)),
  55099. n.LineSegments.call(this, r, new n.LineBasicMaterial({
  55100. color: 16776960
  55101. })),
  55102. void 0 !== e && this.update(e)
  55103. }
  55104. ,
  55105. n.BoxHelper.prototype = Object.create(n.LineSegments.prototype),
  55106. n.BoxHelper.prototype.constructor = n.BoxHelper,
  55107. n.BoxHelper.prototype.update = function() {
  55108. var e = new n.Box3;
  55109. return function(t) {
  55110. if (e.setFromObject(t),
  55111. !e.isEmpty()) {
  55112. var i = e.min
  55113. , n = e.max
  55114. , r = this.geometry.attributes.position
  55115. , o = r.array;
  55116. o[0] = n.x,
  55117. o[1] = n.y,
  55118. o[2] = n.z,
  55119. o[3] = i.x,
  55120. o[4] = n.y,
  55121. o[5] = n.z,
  55122. o[6] = i.x,
  55123. o[7] = i.y,
  55124. o[8] = n.z,
  55125. o[9] = n.x,
  55126. o[10] = i.y,
  55127. o[11] = n.z,
  55128. o[12] = n.x,
  55129. o[13] = n.y,
  55130. o[14] = i.z,
  55131. o[15] = i.x,
  55132. o[16] = n.y,
  55133. o[17] = i.z,
  55134. o[18] = i.x,
  55135. o[19] = i.y,
  55136. o[20] = i.z,
  55137. o[21] = n.x,
  55138. o[22] = i.y,
  55139. o[23] = i.z,
  55140. r.needsUpdate = !0,
  55141. this.geometry.computeBoundingSphere()
  55142. }
  55143. }
  55144. }(),
  55145. n.BoundingBoxHelper = function(e, t) {
  55146. var i = void 0 !== t ? t : 8947848;
  55147. this.object = e,
  55148. this.box = new n.Box3,
  55149. n.Mesh.call(this, new n.BoxGeometry(1,1,1), new n.MeshBasicMaterial({
  55150. color: i,
  55151. wireframe: !0
  55152. }))
  55153. }
  55154. ,
  55155. n.BoundingBoxHelper.prototype = Object.create(n.Mesh.prototype),
  55156. n.BoundingBoxHelper.prototype.constructor = n.BoundingBoxHelper,
  55157. n.BoundingBoxHelper.prototype.update = function() {
  55158. this.box.setFromObject(this.object),
  55159. this.box.size(this.scale),
  55160. this.box.center(this.position)
  55161. }
  55162. ,
  55163. n.CameraHelper = function(e) {
  55164. function t(e, t, n) {
  55165. i(e, n),
  55166. i(t, n)
  55167. }
  55168. function i(e, t) {
  55169. r.vertices.push(new n.Vector3),
  55170. r.colors.push(new n.Color(t)),
  55171. void 0 === a[e] && (a[e] = []),
  55172. a[e].push(r.vertices.length - 1)
  55173. }
  55174. var r = new n.Geometry
  55175. , o = new n.LineBasicMaterial({
  55176. color: 16777215,
  55177. vertexColors: n.FaceColors
  55178. })
  55179. , a = {}
  55180. , s = 16755200
  55181. , l = 16711680
  55182. , c = 43775
  55183. , h = 16777215
  55184. , u = 3355443;
  55185. t("n1", "n2", s),
  55186. t("n2", "n4", s),
  55187. t("n4", "n3", s),
  55188. t("n3", "n1", s),
  55189. t("f1", "f2", s),
  55190. t("f2", "f4", s),
  55191. t("f4", "f3", s),
  55192. t("f3", "f1", s),
  55193. t("n1", "f1", s),
  55194. t("n2", "f2", s),
  55195. t("n3", "f3", s),
  55196. t("n4", "f4", s),
  55197. t("p", "n1", l),
  55198. t("p", "n2", l),
  55199. t("p", "n3", l),
  55200. t("p", "n4", l),
  55201. t("u1", "u2", c),
  55202. t("u2", "u3", c),
  55203. t("u3", "u1", c),
  55204. t("c", "t", h),
  55205. t("p", "c", u),
  55206. t("cn1", "cn2", u),
  55207. t("cn3", "cn4", u),
  55208. t("cf1", "cf2", u),
  55209. t("cf3", "cf4", u),
  55210. n.LineSegments.call(this, r, o),
  55211. this.camera = e,
  55212. this.camera.updateProjectionMatrix(),
  55213. this.matrix = e.matrixWorld,
  55214. this.matrixAutoUpdate = !1,
  55215. this.pointMap = a,
  55216. this.update()
  55217. }
  55218. ,
  55219. n.CameraHelper.prototype = Object.create(n.LineSegments.prototype),
  55220. n.CameraHelper.prototype.constructor = n.CameraHelper,
  55221. n.CameraHelper.prototype.update = function() {
  55222. function e(e, n, a, s) {
  55223. r.set(n, a, s).unproject(o);
  55224. var l = i[e];
  55225. if (void 0 !== l)
  55226. for (var c = 0, h = l.length; c < h; c++)
  55227. t.vertices[l[c]].copy(r)
  55228. }
  55229. var t, i, r = new n.Vector3, o = new n.Camera;
  55230. return function() {
  55231. t = this.geometry,
  55232. i = this.pointMap;
  55233. var n = 1
  55234. , r = 1;
  55235. o.projectionMatrix.copy(this.camera.projectionMatrix),
  55236. e("c", 0, 0, -1),
  55237. e("t", 0, 0, 1),
  55238. e("n1", -n, -r, -1),
  55239. e("n2", n, -r, -1),
  55240. e("n3", -n, r, -1),
  55241. e("n4", n, r, -1),
  55242. e("f1", -n, -r, 1),
  55243. e("f2", n, -r, 1),
  55244. e("f3", -n, r, 1),
  55245. e("f4", n, r, 1),
  55246. e("u1", .7 * n, 1.1 * r, -1),
  55247. e("u2", .7 * -n, 1.1 * r, -1),
  55248. e("u3", 0, 2 * r, -1),
  55249. e("cf1", -n, 0, 1),
  55250. e("cf2", n, 0, 1),
  55251. e("cf3", 0, -r, 1),
  55252. e("cf4", 0, r, 1),
  55253. e("cn1", -n, 0, -1),
  55254. e("cn2", n, 0, -1),
  55255. e("cn3", 0, -r, -1),
  55256. e("cn4", 0, r, -1),
  55257. t.verticesNeedUpdate = !0
  55258. }
  55259. }(),
  55260. n.DirectionalLightHelper = function(e, t) {
  55261. n.Object3D.call(this),
  55262. this.light = e,
  55263. this.light.updateMatrixWorld(),
  55264. this.matrix = e.matrixWorld,
  55265. this.matrixAutoUpdate = !1,
  55266. t = t || 1;
  55267. var i = new n.Geometry;
  55268. i.vertices.push(new n.Vector3(-t,t,0), new n.Vector3(t,t,0), new n.Vector3(t,-t,0), new n.Vector3(-t,-t,0), new n.Vector3(-t,t,0));
  55269. var r = new n.LineBasicMaterial({
  55270. fog: !1
  55271. });
  55272. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  55273. this.lightPlane = new n.Line(i,r),
  55274. this.add(this.lightPlane),
  55275. i = new n.Geometry,
  55276. i.vertices.push(new n.Vector3, new n.Vector3),
  55277. r = new n.LineBasicMaterial({
  55278. fog: !1
  55279. }),
  55280. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  55281. this.targetLine = new n.Line(i,r),
  55282. this.add(this.targetLine),
  55283. this.update()
  55284. }
  55285. ,
  55286. n.DirectionalLightHelper.prototype = Object.create(n.Object3D.prototype),
  55287. n.DirectionalLightHelper.prototype.constructor = n.DirectionalLightHelper,
  55288. n.DirectionalLightHelper.prototype.dispose = function() {
  55289. this.lightPlane.geometry.dispose(),
  55290. this.lightPlane.material.dispose(),
  55291. this.targetLine.geometry.dispose(),
  55292. this.targetLine.material.dispose()
  55293. }
  55294. ,
  55295. n.DirectionalLightHelper.prototype.update = function() {
  55296. var e = new n.Vector3
  55297. , t = new n.Vector3
  55298. , i = new n.Vector3;
  55299. return function() {
  55300. e.setFromMatrixPosition(this.light.matrixWorld),
  55301. t.setFromMatrixPosition(this.light.target.matrixWorld),
  55302. i.subVectors(t, e),
  55303. this.lightPlane.lookAt(i),
  55304. this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  55305. this.targetLine.geometry.vertices[1].copy(i),
  55306. this.targetLine.geometry.verticesNeedUpdate = !0,
  55307. this.targetLine.material.color.copy(this.lightPlane.material.color)
  55308. }
  55309. }(),
  55310. n.EdgesHelper = function(e, t, i) {
  55311. var r = void 0 !== t ? t : 16777215;
  55312. n.LineSegments.call(this, new n.EdgesGeometry(e.geometry,i), new n.LineBasicMaterial({
  55313. color: r
  55314. })),
  55315. this.matrix = e.matrixWorld,
  55316. this.matrixAutoUpdate = !1
  55317. }
  55318. ,
  55319. n.EdgesHelper.prototype = Object.create(n.LineSegments.prototype),
  55320. n.EdgesHelper.prototype.constructor = n.EdgesHelper,
  55321. n.FaceNormalsHelper = function(e, t, i, r) {
  55322. this.object = e,
  55323. this.size = void 0 !== t ? t : 1;
  55324. var o = void 0 !== i ? i : 16776960
  55325. , a = void 0 !== r ? r : 1
  55326. , s = 0
  55327. , l = this.object.geometry;
  55328. l instanceof n.Geometry ? s = l.faces.length : console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");
  55329. var c = new n.BufferGeometry
  55330. , h = new n.Float32Attribute(2 * s * 3,3);
  55331. c.addAttribute("position", h),
  55332. n.LineSegments.call(this, c, new n.LineBasicMaterial({
  55333. color: o,
  55334. linewidth: a
  55335. })),
  55336. this.matrixAutoUpdate = !1,
  55337. this.update()
  55338. }
  55339. ,
  55340. n.FaceNormalsHelper.prototype = Object.create(n.LineSegments.prototype),
  55341. n.FaceNormalsHelper.prototype.constructor = n.FaceNormalsHelper,
  55342. n.FaceNormalsHelper.prototype.update = function() {
  55343. var e = new n.Vector3
  55344. , t = new n.Vector3
  55345. , i = new n.Matrix3;
  55346. return function() {
  55347. this.object.updateMatrixWorld(!0),
  55348. i.getNormalMatrix(this.object.matrixWorld);
  55349. for (var n = this.object.matrixWorld, r = this.geometry.attributes.position, o = this.object.geometry, a = o.vertices, s = o.faces, l = 0, c = 0, h = s.length; c < h; c++) {
  55350. var u = s[c]
  55351. , d = u.normal;
  55352. e.copy(a[u.a]).add(a[u.b]).add(a[u.c]).divideScalar(3).applyMatrix4(n),
  55353. t.copy(d).applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  55354. r.setXYZ(l, e.x, e.y, e.z),
  55355. l += 1,
  55356. r.setXYZ(l, t.x, t.y, t.z),
  55357. l += 1
  55358. }
  55359. return r.needsUpdate = !0,
  55360. this
  55361. }
  55362. }(),
  55363. n.GridHelper = function(e, t) {
  55364. var i = new n.Geometry
  55365. , r = new n.LineBasicMaterial({
  55366. vertexColors: n.VertexColors
  55367. });
  55368. this.color1 = new n.Color(4473924),
  55369. this.color2 = new n.Color(8947848);
  55370. for (var o = -e; o <= e; o += t) {
  55371. i.vertices.push(new n.Vector3(-e,0,o), new n.Vector3(e,0,o), new n.Vector3(o,0,-e), new n.Vector3(o,0,e));
  55372. var a = 0 === o ? this.color1 : this.color2;
  55373. i.colors.push(a, a, a, a)
  55374. }
  55375. n.LineSegments.call(this, i, r)
  55376. }
  55377. ,
  55378. n.GridHelper.prototype = Object.create(n.LineSegments.prototype),
  55379. n.GridHelper.prototype.constructor = n.GridHelper,
  55380. n.GridHelper.prototype.setColors = function(e, t) {
  55381. this.color1.set(e),
  55382. this.color2.set(t),
  55383. this.geometry.colorsNeedUpdate = !0
  55384. }
  55385. ,
  55386. n.HemisphereLightHelper = function(e, t) {
  55387. n.Object3D.call(this),
  55388. this.light = e,
  55389. this.light.updateMatrixWorld(),
  55390. this.matrix = e.matrixWorld,
  55391. this.matrixAutoUpdate = !1,
  55392. this.colors = [new n.Color, new n.Color];
  55393. var i = new n.SphereGeometry(t,4,2);
  55394. i.rotateX(-Math.PI / 2);
  55395. for (var r = 0, o = 8; r < o; r++)
  55396. i.faces[r].color = this.colors[r < 4 ? 0 : 1];
  55397. var a = new n.MeshBasicMaterial({
  55398. vertexColors: n.FaceColors,
  55399. wireframe: !0
  55400. });
  55401. this.lightSphere = new n.Mesh(i,a),
  55402. this.add(this.lightSphere),
  55403. this.update()
  55404. }
  55405. ,
  55406. n.HemisphereLightHelper.prototype = Object.create(n.Object3D.prototype),
  55407. n.HemisphereLightHelper.prototype.constructor = n.HemisphereLightHelper,
  55408. n.HemisphereLightHelper.prototype.dispose = function() {
  55409. this.lightSphere.geometry.dispose(),
  55410. this.lightSphere.material.dispose()
  55411. }
  55412. ,
  55413. n.HemisphereLightHelper.prototype.update = function() {
  55414. var e = new n.Vector3;
  55415. return function() {
  55416. this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity),
  55417. this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity),
  55418. this.lightSphere.lookAt(e.setFromMatrixPosition(this.light.matrixWorld).negate()),
  55419. this.lightSphere.geometry.colorsNeedUpdate = !0
  55420. }
  55421. }(),
  55422. n.PointLightHelper = function(e, t) {
  55423. this.light = e,
  55424. this.light.updateMatrixWorld();
  55425. var i = new n.SphereGeometry(t,4,2)
  55426. , r = new n.MeshBasicMaterial({
  55427. wireframe: !0,
  55428. fog: !1
  55429. });
  55430. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  55431. n.Mesh.call(this, i, r),
  55432. this.matrix = this.light.matrixWorld,
  55433. this.matrixAutoUpdate = !1
  55434. }
  55435. ,
  55436. n.PointLightHelper.prototype = Object.create(n.Mesh.prototype),
  55437. n.PointLightHelper.prototype.constructor = n.PointLightHelper,
  55438. n.PointLightHelper.prototype.dispose = function() {
  55439. this.geometry.dispose(),
  55440. this.material.dispose()
  55441. }
  55442. ,
  55443. n.PointLightHelper.prototype.update = function() {
  55444. this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  55445. }
  55446. ,
  55447. n.SkeletonHelper = function(e) {
  55448. this.bones = this.getBoneList(e);
  55449. for (var t = new n.Geometry, i = 0; i < this.bones.length; i++) {
  55450. var r = this.bones[i];
  55451. r.parent instanceof n.Bone && (t.vertices.push(new n.Vector3),
  55452. t.vertices.push(new n.Vector3),
  55453. t.colors.push(new n.Color(0,0,1)),
  55454. t.colors.push(new n.Color(0,1,0)))
  55455. }
  55456. t.dynamic = !0;
  55457. var o = new n.LineBasicMaterial({
  55458. vertexColors: n.VertexColors,
  55459. depthTest: !1,
  55460. depthWrite: !1,
  55461. transparent: !0
  55462. });
  55463. n.LineSegments.call(this, t, o),
  55464. this.root = e,
  55465. this.matrix = e.matrixWorld,
  55466. this.matrixAutoUpdate = !1,
  55467. this.update()
  55468. }
  55469. ,
  55470. n.SkeletonHelper.prototype = Object.create(n.LineSegments.prototype),
  55471. n.SkeletonHelper.prototype.constructor = n.SkeletonHelper,
  55472. n.SkeletonHelper.prototype.getBoneList = function(e) {
  55473. var t = [];
  55474. e instanceof n.Bone && t.push(e);
  55475. for (var i = 0; i < e.children.length; i++)
  55476. t.push.apply(t, this.getBoneList(e.children[i]));
  55477. return t
  55478. }
  55479. ,
  55480. n.SkeletonHelper.prototype.update = function() {
  55481. for (var e = this.geometry, t = (new n.Matrix4).getInverse(this.root.matrixWorld), i = new n.Matrix4, r = 0, o = 0; o < this.bones.length; o++) {
  55482. var a = this.bones[o];
  55483. a.parent instanceof n.Bone && (i.multiplyMatrices(t, a.matrixWorld),
  55484. e.vertices[r].setFromMatrixPosition(i),
  55485. i.multiplyMatrices(t, a.parent.matrixWorld),
  55486. e.vertices[r + 1].setFromMatrixPosition(i),
  55487. r += 2)
  55488. }
  55489. e.verticesNeedUpdate = !0,
  55490. e.computeBoundingSphere()
  55491. }
  55492. ,
  55493. n.SpotLightHelper = function(e) {
  55494. n.Object3D.call(this),
  55495. this.light = e,
  55496. this.light.updateMatrixWorld(),
  55497. this.matrix = e.matrixWorld,
  55498. this.matrixAutoUpdate = !1;
  55499. var t = new n.CylinderGeometry(0,1,1,8,1,!0);
  55500. t.translate(0, -.5, 0),
  55501. t.rotateX(-Math.PI / 2);
  55502. var i = new n.MeshBasicMaterial({
  55503. wireframe: !0,
  55504. fog: !1
  55505. });
  55506. this.cone = new n.Mesh(t,i),
  55507. this.add(this.cone),
  55508. this.update()
  55509. }
  55510. ,
  55511. n.SpotLightHelper.prototype = Object.create(n.Object3D.prototype),
  55512. n.SpotLightHelper.prototype.constructor = n.SpotLightHelper,
  55513. n.SpotLightHelper.prototype.dispose = function() {
  55514. this.cone.geometry.dispose(),
  55515. this.cone.material.dispose()
  55516. }
  55517. ,
  55518. n.SpotLightHelper.prototype.update = function() {
  55519. var e = new n.Vector3
  55520. , t = new n.Vector3;
  55521. return function() {
  55522. var i = this.light.distance ? this.light.distance : 1e4
  55523. , n = i * Math.tan(this.light.angle);
  55524. this.cone.scale.set(n, n, i),
  55525. e.setFromMatrixPosition(this.light.matrixWorld),
  55526. t.setFromMatrixPosition(this.light.target.matrixWorld),
  55527. this.cone.lookAt(t.sub(e)),
  55528. this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  55529. }
  55530. }(),
  55531. n.VertexNormalsHelper = function(e, t, i, r) {
  55532. this.object = e,
  55533. this.size = void 0 !== t ? t : 1;
  55534. var o = void 0 !== i ? i : 16711680
  55535. , a = void 0 !== r ? r : 1
  55536. , s = 0
  55537. , l = this.object.geometry;
  55538. l instanceof n.Geometry ? s = 3 * l.faces.length : l instanceof n.BufferGeometry && (s = l.attributes.normal.count);
  55539. var c = new n.BufferGeometry
  55540. , h = new n.Float32Attribute(2 * s * 3,3);
  55541. c.addAttribute("position", h),
  55542. n.LineSegments.call(this, c, new n.LineBasicMaterial({
  55543. color: o,
  55544. linewidth: a
  55545. })),
  55546. this.matrixAutoUpdate = !1,
  55547. this.update()
  55548. }
  55549. ,
  55550. n.VertexNormalsHelper.prototype = Object.create(n.LineSegments.prototype),
  55551. n.VertexNormalsHelper.prototype.constructor = n.VertexNormalsHelper,
  55552. n.VertexNormalsHelper.prototype.update = function() {
  55553. var e = new n.Vector3
  55554. , t = new n.Vector3
  55555. , i = new n.Matrix3;
  55556. return function() {
  55557. var r = ["a", "b", "c"];
  55558. this.object.updateMatrixWorld(!0),
  55559. i.getNormalMatrix(this.object.matrixWorld);
  55560. var o = this.object.matrixWorld
  55561. , a = this.geometry.attributes.position
  55562. , s = this.object.geometry;
  55563. if (s instanceof n.Geometry)
  55564. for (var l = s.vertices, c = s.faces, h = 0, u = 0, d = c.length; u < d; u++)
  55565. for (var p = c[u], f = 0, g = p.vertexNormals.length; f < g; f++) {
  55566. var m = l[p[r[f]]]
  55567. , v = p.vertexNormals[f];
  55568. e.copy(m).applyMatrix4(o),
  55569. t.copy(v).applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  55570. a.setXYZ(h, e.x, e.y, e.z),
  55571. h += 1,
  55572. a.setXYZ(h, t.x, t.y, t.z),
  55573. h += 1
  55574. }
  55575. else if (s instanceof n.BufferGeometry)
  55576. for (var A = s.attributes.position, y = s.attributes.normal, h = 0, f = 0, g = A.count; f < g; f++)
  55577. e.set(A.getX(f), A.getY(f), A.getZ(f)).applyMatrix4(o),
  55578. t.set(y.getX(f), y.getY(f), y.getZ(f)),
  55579. t.applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  55580. a.setXYZ(h, e.x, e.y, e.z),
  55581. h += 1,
  55582. a.setXYZ(h, t.x, t.y, t.z),
  55583. h += 1;
  55584. return a.needsUpdate = !0,
  55585. this
  55586. }
  55587. }(),
  55588. n.WireframeHelper = function(e, t) {
  55589. var i = void 0 !== t ? t : 16777215;
  55590. n.LineSegments.call(this, new n.WireframeGeometry(e.geometry), new n.LineBasicMaterial({
  55591. color: i
  55592. })),
  55593. this.matrix = e.matrixWorld,
  55594. this.matrixAutoUpdate = !1
  55595. }
  55596. ,
  55597. n.WireframeHelper.prototype = Object.create(n.LineSegments.prototype),
  55598. n.WireframeHelper.prototype.constructor = n.WireframeHelper,
  55599. n.ImmediateRenderObject = function(e) {
  55600. n.Object3D.call(this),
  55601. this.material = e,
  55602. this.render = function(e) {}
  55603. }
  55604. ,
  55605. n.ImmediateRenderObject.prototype = Object.create(n.Object3D.prototype),
  55606. n.ImmediateRenderObject.prototype.constructor = n.ImmediateRenderObject,
  55607. n.MorphBlendMesh = function(e, t) {
  55608. n.Mesh.call(this, e, t),
  55609. this.animationsMap = {},
  55610. this.animationsList = [];
  55611. var i = this.geometry.morphTargets.length
  55612. , r = "__default"
  55613. , o = 0
  55614. , a = i - 1
  55615. , s = i / 1;
  55616. this.createAnimation(r, o, a, s),
  55617. this.setAnimationWeight(r, 1)
  55618. }
  55619. ,
  55620. n.MorphBlendMesh.prototype = Object.create(n.Mesh.prototype),
  55621. n.MorphBlendMesh.prototype.constructor = n.MorphBlendMesh,
  55622. n.MorphBlendMesh.prototype.createAnimation = function(e, t, i, n) {
  55623. var r = {
  55624. start: t,
  55625. end: i,
  55626. length: i - t + 1,
  55627. fps: n,
  55628. duration: (i - t) / n,
  55629. lastFrame: 0,
  55630. currentFrame: 0,
  55631. active: !1,
  55632. time: 0,
  55633. direction: 1,
  55634. weight: 1,
  55635. directionBackwards: !1,
  55636. mirroredLoop: !1
  55637. };
  55638. this.animationsMap[e] = r,
  55639. this.animationsList.push(r)
  55640. }
  55641. ,
  55642. n.MorphBlendMesh.prototype.autoCreateAnimations = function(e) {
  55643. for (var t, i = /([a-z]+)_?(\d+)/i, n = {}, r = this.geometry, o = 0, a = r.morphTargets.length; o < a; o++) {
  55644. var s = r.morphTargets[o]
  55645. , l = s.name.match(i);
  55646. if (l && l.length > 1) {
  55647. var c = l[1];
  55648. n[c] || (n[c] = {
  55649. start: 1 / 0,
  55650. end: -(1 / 0)
  55651. });
  55652. var h = n[c];
  55653. o < h.start && (h.start = o),
  55654. o > h.end && (h.end = o),
  55655. t || (t = c)
  55656. }
  55657. }
  55658. for (var c in n) {
  55659. var h = n[c];
  55660. this.createAnimation(c, h.start, h.end, e)
  55661. }
  55662. this.firstAnimation = t
  55663. }
  55664. ,
  55665. n.MorphBlendMesh.prototype.setAnimationDirectionForward = function(e) {
  55666. var t = this.animationsMap[e];
  55667. t && (t.direction = 1,
  55668. t.directionBackwards = !1)
  55669. }
  55670. ,
  55671. n.MorphBlendMesh.prototype.setAnimationDirectionBackward = function(e) {
  55672. var t = this.animationsMap[e];
  55673. t && (t.direction = -1,
  55674. t.directionBackwards = !0)
  55675. }
  55676. ,
  55677. n.MorphBlendMesh.prototype.setAnimationFPS = function(e, t) {
  55678. var i = this.animationsMap[e];
  55679. i && (i.fps = t,
  55680. i.duration = (i.end - i.start) / i.fps)
  55681. }
  55682. ,
  55683. n.MorphBlendMesh.prototype.setAnimationDuration = function(e, t) {
  55684. var i = this.animationsMap[e];
  55685. i && (i.duration = t,
  55686. i.fps = (i.end - i.start) / i.duration)
  55687. }
  55688. ,
  55689. n.MorphBlendMesh.prototype.setAnimationWeight = function(e, t) {
  55690. var i = this.animationsMap[e];
  55691. i && (i.weight = t)
  55692. }
  55693. ,
  55694. n.MorphBlendMesh.prototype.setAnimationTime = function(e, t) {
  55695. var i = this.animationsMap[e];
  55696. i && (i.time = t)
  55697. }
  55698. ,
  55699. n.MorphBlendMesh.prototype.getAnimationTime = function(e) {
  55700. var t = 0
  55701. , i = this.animationsMap[e];
  55702. return i && (t = i.time),
  55703. t
  55704. }
  55705. ,
  55706. n.MorphBlendMesh.prototype.getAnimationDuration = function(e) {
  55707. var t = -1
  55708. , i = this.animationsMap[e];
  55709. return i && (t = i.duration),
  55710. t
  55711. }
  55712. ,
  55713. n.MorphBlendMesh.prototype.playAnimation = function(e) {
  55714. var t = this.animationsMap[e];
  55715. t ? (t.time = 0,
  55716. t.active = !0) : console.warn("THREE.MorphBlendMesh: animation[" + e + "] undefined in .playAnimation()")
  55717. }
  55718. ,
  55719. n.MorphBlendMesh.prototype.stopAnimation = function(e) {
  55720. var t = this.animationsMap[e];
  55721. t && (t.active = !1)
  55722. }
  55723. ,
  55724. n.MorphBlendMesh.prototype.update = function(e) {
  55725. for (var t = 0, i = this.animationsList.length; t < i; t++) {
  55726. var r = this.animationsList[t];
  55727. if (r.active) {
  55728. var o = r.duration / r.length;
  55729. r.time += r.direction * e,
  55730. r.mirroredLoop ? (r.time > r.duration || r.time < 0) && (r.direction *= -1,
  55731. r.time > r.duration && (r.time = r.duration,
  55732. r.directionBackwards = !0),
  55733. r.time < 0 && (r.time = 0,
  55734. r.directionBackwards = !1)) : (r.time = r.time % r.duration,
  55735. r.time < 0 && (r.time += r.duration));
  55736. var a = r.start + n.Math.clamp(Math.floor(r.time / o), 0, r.length - 1)
  55737. , s = r.weight;
  55738. a !== r.currentFrame && (this.morphTargetInfluences[r.lastFrame] = 0,
  55739. this.morphTargetInfluences[r.currentFrame] = 1 * s,
  55740. this.morphTargetInfluences[a] = 0,
  55741. r.lastFrame = r.currentFrame,
  55742. r.currentFrame = a);
  55743. var l = r.time % o / o;
  55744. r.directionBackwards && (l = 1 - l),
  55745. r.currentFrame !== r.lastFrame ? (this.morphTargetInfluences[r.currentFrame] = l * s,
  55746. this.morphTargetInfluences[r.lastFrame] = (1 - l) * s) : this.morphTargetInfluences[r.currentFrame] = s
  55747. }
  55748. }
  55749. }
  55750. ,
  55751. "undefined" != typeof i ? ("undefined" != typeof t && t.exports && (i = t.exports = n),
  55752. i.THREE = n) : this.THREE = n
  55753. }
  55754. , {}]
  55755. }, {}, [116]);