main_2020_edit.js 2.4 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190381913819238193381943819538196381973819838199382003820138202382033820438205382063820738208382093821038211382123821338214382153821638217382183821938220382213822238223382243822538226382273822838229382303823138232382333823438235382363823738238382393824038241382423824338244382453824638247382483824938250382513825238253382543825538256382573825838259382603826138262382633826438265382663826738268382693827038271382723827338274382753827638277382783827938280382813828238283382843828538286382873828838289382903829138292382933829438295382963829738298382993830038301383023830338304383053830638307383083830938310383113831238313383143831538316383173831838319383203832138322383233832438325383263832738328383293833038331383323833338334383353833638337383383833938340383413834238343383443834538346383473834838349383503835138352383533835438355383563835738358383593836038361383623836338364383653836638367383683836938370383713837238373383743837538376383773837838379383803838138382383833838438385383863838738388383893839038391383923839338394383953839638397383983839938400384013840238403384043840538406384073840838409384103841138412384133841438415384163841738418384193842038421384223842338424384253842638427384283842938430384313843238433384343843538436384373843838439384403844138442384433844438445384463844738448384493845038451384523845338454384553845638457384583845938460384613846238463384643846538466384673846838469384703847138472384733847438475384763847738478384793848038481384823848338484384853848638487384883848938490384913849238493384943849538496384973849838499385003850138502385033850438505385063850738508385093851038511385123851338514385153851638517385183851938520385213852238523385243852538526385273852838529385303853138532385333853438535385363853738538385393854038541385423854338544385453854638547385483854938550385513855238553385543855538556385573855838559385603856138562385633856438565385663856738568385693857038571385723857338574385753857638577385783857938580385813858238583385843858538586385873858838589385903859138592385933859438595385963859738598385993860038601386023860338604386053860638607386083860938610386113861238613386143861538616386173861838619386203862138622386233862438625386263862738628386293863038631386323863338634386353863638637386383863938640386413864238643386443864538646386473864838649386503865138652386533865438655386563865738658386593866038661386623866338664386653866638667386683866938670386713867238673386743867538676386773867838679386803868138682386833868438685386863868738688386893869038691386923869338694386953869638697386983869938700387013870238703387043870538706387073870838709387103871138712387133871438715387163871738718387193872038721387223872338724387253872638727387283872938730387313873238733387343873538736387373873838739387403874138742387433874438745387463874738748387493875038751387523875338754387553875638757387583875938760387613876238763387643876538766387673876838769387703877138772387733877438775387763877738778387793878038781387823878338784387853878638787387883878938790387913879238793387943879538796387973879838799388003880138802388033880438805388063880738808388093881038811388123881338814388153881638817388183881938820388213882238823388243882538826388273882838829388303883138832388333883438835388363883738838388393884038841388423884338844388453884638847388483884938850388513885238853388543885538856388573885838859388603886138862388633886438865388663886738868388693887038871388723887338874388753887638877388783887938880388813888238883388843888538886388873888838889388903889138892388933889438895388963889738898388993890038901389023890338904389053890638907389083890938910389113891238913389143891538916389173891838919389203892138922389233892438925389263892738928389293893038931389323893338934389353893638937389383893938940389413894238943389443894538946389473894838949389503895138952389533895438955389563895738958389593896038961389623896338964389653896638967389683896938970389713897238973389743897538976389773897838979389803898138982389833898438985389863898738988389893899038991389923899338994389953899638997389983899939000390013900239003390043900539006390073900839009390103901139012390133901439015390163901739018390193902039021390223902339024390253902639027390283902939030390313903239033390343903539036390373903839039390403904139042390433904439045390463904739048390493905039051390523905339054390553905639057390583905939060390613906239063390643906539066390673906839069390703907139072390733907439075390763907739078390793908039081390823908339084390853908639087390883908939090390913909239093390943909539096390973909839099391003910139102391033910439105391063910739108391093911039111391123911339114391153911639117391183911939120391213912239123391243912539126391273912839129391303913139132391333913439135391363913739138391393914039141391423914339144391453914639147391483914939150391513915239153391543915539156391573915839159391603916139162391633916439165391663916739168391693917039171391723917339174391753917639177391783917939180391813918239183391843918539186391873918839189391903919139192391933919439195391963919739198391993920039201392023920339204392053920639207392083920939210392113921239213392143921539216392173921839219392203922139222392233922439225392263922739228392293923039231392323923339234392353923639237392383923939240392413924239243392443924539246392473924839249392503925139252392533925439255392563925739258392593926039261392623926339264392653926639267392683926939270392713927239273392743927539276392773927839279392803928139282392833928439285392863928739288392893929039291392923929339294392953929639297392983929939300393013930239303393043930539306393073930839309393103931139312393133931439315393163931739318393193932039321393223932339324393253932639327393283932939330393313933239333393343933539336393373933839339393403934139342393433934439345393463934739348393493935039351393523935339354393553935639357393583935939360393613936239363393643936539366393673936839369393703937139372393733937439375393763937739378393793938039381393823938339384393853938639387393883938939390393913939239393393943939539396393973939839399394003940139402394033940439405394063940739408394093941039411394123941339414394153941639417394183941939420394213942239423394243942539426394273942839429394303943139432394333943439435394363943739438394393944039441394423944339444394453944639447394483944939450394513945239453394543945539456394573945839459394603946139462394633946439465394663946739468394693947039471394723947339474394753947639477394783947939480394813948239483394843948539486394873948839489394903949139492394933949439495394963949739498394993950039501395023950339504395053950639507395083950939510395113951239513395143951539516395173951839519395203952139522395233952439525395263952739528395293953039531395323953339534395353953639537395383953939540395413954239543395443954539546395473954839549395503955139552395533955439555395563955739558395593956039561395623956339564395653956639567395683956939570395713957239573395743957539576395773957839579395803958139582395833958439585395863958739588395893959039591395923959339594395953959639597395983959939600396013960239603396043960539606396073960839609396103961139612396133961439615396163961739618396193962039621396223962339624396253962639627396283962939630396313963239633396343963539636396373963839639396403964139642396433964439645396463964739648396493965039651396523965339654396553965639657396583965939660396613966239663396643966539666396673966839669396703967139672396733967439675396763967739678396793968039681396823968339684396853968639687396883968939690396913969239693396943969539696396973969839699397003970139702397033970439705397063970739708397093971039711397123971339714397153971639717397183971939720397213972239723397243972539726397273972839729397303973139732397333973439735397363973739738397393974039741397423974339744397453974639747397483974939750397513975239753397543975539756397573975839759397603976139762397633976439765397663976739768397693977039771397723977339774397753977639777397783977939780397813978239783397843978539786397873978839789397903979139792397933979439795397963979739798397993980039801398023980339804398053980639807398083980939810398113981239813398143981539816398173981839819398203982139822398233982439825398263982739828398293983039831398323983339834398353983639837398383983939840398413984239843398443984539846398473984839849398503985139852398533985439855398563985739858398593986039861398623986339864398653986639867398683986939870398713987239873398743987539876398773987839879398803988139882398833988439885398863988739888398893989039891398923989339894398953989639897398983989939900399013990239903399043990539906399073990839909399103991139912399133991439915399163991739918399193992039921399223992339924399253992639927399283992939930399313993239933399343993539936399373993839939399403994139942399433994439945399463994739948399493995039951399523995339954399553995639957399583995939960399613996239963399643996539966399673996839969399703997139972399733997439975399763997739978399793998039981399823998339984399853998639987399883998939990399913999239993399943999539996399973999839999400004000140002400034000440005400064000740008400094001040011400124001340014400154001640017400184001940020400214002240023400244002540026400274002840029400304003140032400334003440035400364003740038400394004040041400424004340044400454004640047400484004940050400514005240053400544005540056400574005840059400604006140062400634006440065400664006740068400694007040071400724007340074400754007640077400784007940080400814008240083400844008540086400874008840089400904009140092400934009440095400964009740098400994010040101401024010340104401054010640107401084010940110401114011240113401144011540116401174011840119401204012140122401234012440125401264012740128401294013040131401324013340134401354013640137401384013940140401414014240143401444014540146401474014840149401504015140152401534015440155401564015740158401594016040161401624016340164401654016640167401684016940170401714017240173401744017540176401774017840179401804018140182401834018440185401864018740188401894019040191401924019340194401954019640197401984019940200402014020240203402044020540206402074020840209402104021140212402134021440215402164021740218402194022040221402224022340224402254022640227402284022940230402314023240233402344023540236402374023840239402404024140242402434024440245402464024740248402494025040251402524025340254402554025640257402584025940260402614026240263402644026540266402674026840269402704027140272402734027440275402764027740278402794028040281402824028340284402854028640287402884028940290402914029240293402944029540296402974029840299403004030140302403034030440305403064030740308403094031040311403124031340314403154031640317403184031940320403214032240323403244032540326403274032840329403304033140332403334033440335403364033740338403394034040341403424034340344403454034640347403484034940350403514035240353403544035540356403574035840359403604036140362403634036440365403664036740368403694037040371403724037340374403754037640377403784037940380403814038240383403844038540386403874038840389403904039140392403934039440395403964039740398403994040040401404024040340404404054040640407404084040940410404114041240413404144041540416404174041840419404204042140422404234042440425404264042740428404294043040431404324043340434404354043640437404384043940440404414044240443404444044540446404474044840449404504045140452404534045440455404564045740458404594046040461404624046340464404654046640467404684046940470404714047240473404744047540476404774047840479404804048140482404834048440485404864048740488404894049040491404924049340494404954049640497404984049940500405014050240503405044050540506405074050840509405104051140512405134051440515405164051740518405194052040521405224052340524405254052640527405284052940530405314053240533405344053540536405374053840539405404054140542405434054440545405464054740548405494055040551405524055340554405554055640557405584055940560405614056240563405644056540566405674056840569405704057140572405734057440575405764057740578405794058040581405824058340584405854058640587405884058940590405914059240593405944059540596405974059840599406004060140602406034060440605406064060740608406094061040611406124061340614406154061640617406184061940620406214062240623406244062540626406274062840629406304063140632406334063440635406364063740638406394064040641406424064340644406454064640647406484064940650406514065240653406544065540656406574065840659406604066140662406634066440665406664066740668406694067040671406724067340674406754067640677406784067940680406814068240683406844068540686406874068840689406904069140692406934069440695406964069740698406994070040701407024070340704407054070640707407084070940710407114071240713407144071540716407174071840719407204072140722407234072440725407264072740728407294073040731407324073340734407354073640737407384073940740407414074240743407444074540746407474074840749407504075140752407534075440755407564075740758407594076040761407624076340764407654076640767407684076940770407714077240773407744077540776407774077840779407804078140782407834078440785407864078740788407894079040791407924079340794407954079640797407984079940800408014080240803408044080540806408074080840809408104081140812408134081440815408164081740818408194082040821408224082340824408254082640827408284082940830408314083240833408344083540836408374083840839408404084140842408434084440845408464084740848408494085040851408524085340854408554085640857408584085940860408614086240863408644086540866408674086840869408704087140872408734087440875408764087740878408794088040881408824088340884408854088640887408884088940890408914089240893408944089540896408974089840899409004090140902409034090440905409064090740908409094091040911409124091340914409154091640917409184091940920409214092240923409244092540926409274092840929409304093140932409334093440935409364093740938409394094040941409424094340944409454094640947409484094940950409514095240953409544095540956409574095840959409604096140962409634096440965409664096740968409694097040971409724097340974409754097640977409784097940980409814098240983409844098540986409874098840989409904099140992409934099440995409964099740998409994100041001410024100341004410054100641007410084100941010410114101241013410144101541016410174101841019410204102141022410234102441025410264102741028410294103041031410324103341034410354103641037410384103941040410414104241043410444104541046410474104841049410504105141052410534105441055410564105741058410594106041061410624106341064410654106641067410684106941070410714107241073410744107541076410774107841079410804108141082410834108441085410864108741088410894109041091410924109341094410954109641097410984109941100411014110241103411044110541106411074110841109411104111141112411134111441115411164111741118411194112041121411224112341124411254112641127411284112941130411314113241133411344113541136411374113841139411404114141142411434114441145411464114741148411494115041151411524115341154411554115641157411584115941160411614116241163411644116541166411674116841169411704117141172411734117441175411764117741178411794118041181411824118341184411854118641187411884118941190411914119241193411944119541196411974119841199412004120141202412034120441205412064120741208412094121041211412124121341214412154121641217412184121941220412214122241223412244122541226412274122841229412304123141232412334123441235412364123741238412394124041241412424124341244412454124641247412484124941250412514125241253412544125541256412574125841259412604126141262412634126441265412664126741268412694127041271412724127341274412754127641277412784127941280412814128241283412844128541286412874128841289412904129141292412934129441295412964129741298412994130041301413024130341304413054130641307413084130941310413114131241313413144131541316413174131841319413204132141322413234132441325413264132741328413294133041331413324133341334413354133641337413384133941340413414134241343413444134541346413474134841349413504135141352413534135441355413564135741358413594136041361413624136341364413654136641367413684136941370413714137241373413744137541376413774137841379413804138141382413834138441385413864138741388413894139041391413924139341394413954139641397413984139941400414014140241403414044140541406414074140841409414104141141412414134141441415414164141741418414194142041421414224142341424414254142641427414284142941430414314143241433414344143541436414374143841439414404144141442414434144441445414464144741448414494145041451414524145341454414554145641457414584145941460414614146241463414644146541466414674146841469414704147141472414734147441475414764147741478414794148041481414824148341484414854148641487414884148941490414914149241493414944149541496414974149841499415004150141502415034150441505415064150741508415094151041511415124151341514415154151641517415184151941520415214152241523415244152541526415274152841529415304153141532415334153441535415364153741538415394154041541415424154341544415454154641547415484154941550415514155241553415544155541556415574155841559415604156141562415634156441565415664156741568415694157041571415724157341574415754157641577415784157941580415814158241583415844158541586415874158841589415904159141592415934159441595415964159741598415994160041601416024160341604416054160641607416084160941610416114161241613416144161541616416174161841619416204162141622416234162441625416264162741628416294163041631416324163341634416354163641637416384163941640416414164241643416444164541646416474164841649416504165141652416534165441655416564165741658416594166041661416624166341664416654166641667416684166941670416714167241673416744167541676416774167841679416804168141682416834168441685416864168741688416894169041691416924169341694416954169641697416984169941700417014170241703417044170541706417074170841709417104171141712417134171441715417164171741718417194172041721417224172341724417254172641727417284172941730417314173241733417344173541736417374173841739417404174141742417434174441745417464174741748417494175041751417524175341754417554175641757417584175941760417614176241763417644176541766417674176841769417704177141772417734177441775417764177741778417794178041781417824178341784417854178641787417884178941790417914179241793417944179541796417974179841799418004180141802418034180441805418064180741808418094181041811418124181341814418154181641817418184181941820418214182241823418244182541826418274182841829418304183141832418334183441835418364183741838418394184041841418424184341844418454184641847418484184941850418514185241853418544185541856418574185841859418604186141862418634186441865418664186741868418694187041871418724187341874418754187641877418784187941880418814188241883418844188541886418874188841889418904189141892418934189441895418964189741898418994190041901419024190341904419054190641907419084190941910419114191241913419144191541916419174191841919419204192141922419234192441925419264192741928419294193041931419324193341934419354193641937419384193941940419414194241943419444194541946419474194841949419504195141952419534195441955419564195741958419594196041961419624196341964419654196641967419684196941970419714197241973419744197541976419774197841979419804198141982419834198441985419864198741988419894199041991419924199341994419954199641997419984199942000420014200242003420044200542006420074200842009420104201142012420134201442015420164201742018420194202042021420224202342024420254202642027420284202942030420314203242033420344203542036420374203842039420404204142042420434204442045420464204742048420494205042051420524205342054420554205642057420584205942060420614206242063420644206542066420674206842069420704207142072420734207442075420764207742078420794208042081420824208342084420854208642087420884208942090420914209242093420944209542096420974209842099421004210142102421034210442105421064210742108421094211042111421124211342114421154211642117421184211942120421214212242123421244212542126421274212842129421304213142132421334213442135421364213742138421394214042141421424214342144421454214642147421484214942150421514215242153421544215542156421574215842159421604216142162421634216442165421664216742168421694217042171421724217342174421754217642177421784217942180421814218242183421844218542186421874218842189421904219142192421934219442195421964219742198421994220042201422024220342204422054220642207422084220942210422114221242213422144221542216422174221842219422204222142222422234222442225422264222742228422294223042231422324223342234422354223642237422384223942240422414224242243422444224542246422474224842249422504225142252422534225442255422564225742258422594226042261422624226342264422654226642267422684226942270422714227242273422744227542276422774227842279422804228142282422834228442285422864228742288422894229042291422924229342294422954229642297422984229942300423014230242303423044230542306423074230842309423104231142312423134231442315423164231742318423194232042321423224232342324423254232642327423284232942330423314233242333423344233542336423374233842339423404234142342423434234442345423464234742348423494235042351423524235342354423554235642357423584235942360423614236242363423644236542366423674236842369423704237142372423734237442375423764237742378423794238042381423824238342384423854238642387423884238942390423914239242393423944239542396423974239842399424004240142402424034240442405424064240742408424094241042411424124241342414424154241642417424184241942420424214242242423424244242542426424274242842429424304243142432424334243442435424364243742438424394244042441424424244342444424454244642447424484244942450424514245242453424544245542456424574245842459424604246142462424634246442465424664246742468424694247042471424724247342474424754247642477424784247942480424814248242483424844248542486424874248842489424904249142492424934249442495424964249742498424994250042501425024250342504425054250642507425084250942510425114251242513425144251542516425174251842519425204252142522425234252442525425264252742528425294253042531425324253342534425354253642537425384253942540425414254242543425444254542546425474254842549425504255142552425534255442555425564255742558425594256042561425624256342564425654256642567425684256942570425714257242573425744257542576425774257842579425804258142582425834258442585425864258742588425894259042591425924259342594425954259642597425984259942600426014260242603426044260542606426074260842609426104261142612426134261442615426164261742618426194262042621426224262342624426254262642627426284262942630426314263242633426344263542636426374263842639426404264142642426434264442645426464264742648426494265042651426524265342654426554265642657426584265942660426614266242663426644266542666426674266842669426704267142672426734267442675426764267742678426794268042681426824268342684426854268642687426884268942690426914269242693426944269542696426974269842699427004270142702427034270442705427064270742708427094271042711427124271342714427154271642717427184271942720427214272242723427244272542726427274272842729427304273142732427334273442735427364273742738427394274042741427424274342744427454274642747427484274942750427514275242753427544275542756427574275842759427604276142762427634276442765427664276742768427694277042771427724277342774427754277642777427784277942780427814278242783427844278542786427874278842789427904279142792427934279442795427964279742798427994280042801428024280342804428054280642807428084280942810428114281242813428144281542816428174281842819428204282142822428234282442825428264282742828428294283042831428324283342834428354283642837428384283942840428414284242843428444284542846428474284842849428504285142852428534285442855428564285742858428594286042861428624286342864428654286642867428684286942870428714287242873428744287542876428774287842879428804288142882428834288442885428864288742888428894289042891428924289342894428954289642897428984289942900429014290242903429044290542906429074290842909429104291142912429134291442915429164291742918429194292042921429224292342924429254292642927429284292942930429314293242933429344293542936429374293842939429404294142942429434294442945429464294742948429494295042951429524295342954429554295642957429584295942960429614296242963429644296542966429674296842969429704297142972429734297442975429764297742978429794298042981429824298342984429854298642987429884298942990429914299242993429944299542996429974299842999430004300143002430034300443005430064300743008430094301043011430124301343014430154301643017430184301943020430214302243023430244302543026430274302843029430304303143032430334303443035430364303743038430394304043041430424304343044430454304643047430484304943050430514305243053430544305543056430574305843059430604306143062430634306443065430664306743068430694307043071430724307343074430754307643077430784307943080430814308243083430844308543086430874308843089430904309143092430934309443095430964309743098430994310043101431024310343104431054310643107431084310943110431114311243113431144311543116431174311843119431204312143122431234312443125431264312743128431294313043131431324313343134431354313643137431384313943140431414314243143431444314543146431474314843149431504315143152431534315443155431564315743158431594316043161431624316343164431654316643167431684316943170431714317243173431744317543176431774317843179431804318143182431834318443185431864318743188431894319043191431924319343194431954319643197431984319943200432014320243203432044320543206432074320843209432104321143212432134321443215432164321743218432194322043221432224322343224432254322643227432284322943230432314323243233432344323543236432374323843239432404324143242432434324443245432464324743248432494325043251432524325343254432554325643257432584325943260432614326243263432644326543266432674326843269432704327143272432734327443275432764327743278432794328043281432824328343284432854328643287432884328943290432914329243293432944329543296432974329843299433004330143302433034330443305433064330743308433094331043311433124331343314433154331643317433184331943320433214332243323433244332543326433274332843329433304333143332433334333443335433364333743338433394334043341433424334343344433454334643347433484334943350433514335243353433544335543356433574335843359433604336143362433634336443365433664336743368433694337043371433724337343374433754337643377433784337943380433814338243383433844338543386433874338843389433904339143392433934339443395433964339743398433994340043401434024340343404434054340643407434084340943410434114341243413434144341543416434174341843419434204342143422434234342443425434264342743428434294343043431434324343343434434354343643437434384343943440434414344243443434444344543446434474344843449434504345143452434534345443455434564345743458434594346043461434624346343464434654346643467434684346943470434714347243473434744347543476434774347843479434804348143482434834348443485434864348743488434894349043491434924349343494434954349643497434984349943500435014350243503435044350543506435074350843509435104351143512435134351443515435164351743518435194352043521435224352343524435254352643527435284352943530435314353243533435344353543536435374353843539435404354143542435434354443545435464354743548435494355043551435524355343554435554355643557435584355943560435614356243563435644356543566435674356843569435704357143572435734357443575435764357743578435794358043581435824358343584435854358643587435884358943590435914359243593435944359543596435974359843599436004360143602436034360443605436064360743608436094361043611436124361343614436154361643617436184361943620436214362243623436244362543626436274362843629436304363143632436334363443635436364363743638436394364043641436424364343644436454364643647436484364943650436514365243653436544365543656436574365843659436604366143662436634366443665436664366743668436694367043671436724367343674436754367643677436784367943680436814368243683436844368543686436874368843689436904369143692436934369443695436964369743698436994370043701437024370343704437054370643707437084370943710437114371243713437144371543716437174371843719437204372143722437234372443725437264372743728437294373043731437324373343734437354373643737437384373943740437414374243743437444374543746437474374843749437504375143752437534375443755437564375743758437594376043761437624376343764437654376643767437684376943770437714377243773437744377543776437774377843779437804378143782437834378443785437864378743788437894379043791437924379343794437954379643797437984379943800438014380243803438044380543806438074380843809438104381143812438134381443815438164381743818438194382043821438224382343824438254382643827438284382943830438314383243833438344383543836438374383843839438404384143842438434384443845438464384743848438494385043851438524385343854438554385643857438584385943860438614386243863438644386543866438674386843869438704387143872438734387443875438764387743878438794388043881438824388343884438854388643887438884388943890438914389243893438944389543896438974389843899439004390143902439034390443905439064390743908439094391043911439124391343914439154391643917439184391943920439214392243923439244392543926439274392843929439304393143932439334393443935439364393743938439394394043941439424394343944439454394643947439484394943950439514395243953439544395543956439574395843959439604396143962439634396443965439664396743968439694397043971439724397343974439754397643977439784397943980439814398243983439844398543986439874398843989439904399143992439934399443995439964399743998439994400044001440024400344004440054400644007440084400944010440114401244013440144401544016440174401844019440204402144022440234402444025440264402744028440294403044031440324403344034440354403644037440384403944040440414404244043440444404544046440474404844049440504405144052440534405444055440564405744058440594406044061440624406344064440654406644067440684406944070440714407244073440744407544076440774407844079440804408144082440834408444085440864408744088440894409044091440924409344094440954409644097440984409944100441014410244103441044410544106441074410844109441104411144112441134411444115441164411744118441194412044121441224412344124441254412644127441284412944130441314413244133441344413544136441374413844139441404414144142441434414444145441464414744148441494415044151441524415344154441554415644157441584415944160441614416244163441644416544166441674416844169441704417144172441734417444175441764417744178441794418044181441824418344184441854418644187441884418944190441914419244193441944419544196441974419844199442004420144202442034420444205442064420744208442094421044211442124421344214442154421644217442184421944220442214422244223442244422544226442274422844229442304423144232442334423444235442364423744238442394424044241442424424344244442454424644247442484424944250442514425244253442544425544256442574425844259442604426144262442634426444265442664426744268442694427044271442724427344274442754427644277442784427944280442814428244283442844428544286442874428844289442904429144292442934429444295442964429744298442994430044301443024430344304443054430644307443084430944310443114431244313443144431544316443174431844319443204432144322443234432444325443264432744328443294433044331443324433344334443354433644337443384433944340443414434244343443444434544346443474434844349443504435144352443534435444355443564435744358443594436044361443624436344364443654436644367443684436944370443714437244373443744437544376443774437844379443804438144382443834438444385443864438744388443894439044391443924439344394443954439644397443984439944400444014440244403444044440544406444074440844409444104441144412444134441444415444164441744418444194442044421444224442344424444254442644427444284442944430444314443244433444344443544436444374443844439444404444144442444434444444445444464444744448444494445044451444524445344454444554445644457444584445944460444614446244463444644446544466444674446844469444704447144472444734447444475444764447744478444794448044481444824448344484444854448644487444884448944490444914449244493444944449544496444974449844499445004450144502445034450444505445064450744508445094451044511445124451344514445154451644517445184451944520445214452244523445244452544526445274452844529445304453144532445334453444535445364453744538445394454044541445424454344544445454454644547445484454944550445514455244553445544455544556445574455844559445604456144562445634456444565445664456744568445694457044571445724457344574445754457644577445784457944580445814458244583445844458544586445874458844589445904459144592445934459444595445964459744598445994460044601446024460344604446054460644607446084460944610446114461244613446144461544616446174461844619446204462144622446234462444625446264462744628446294463044631446324463344634446354463644637446384463944640446414464244643446444464544646446474464844649446504465144652446534465444655446564465744658446594466044661446624466344664446654466644667446684466944670446714467244673446744467544676446774467844679446804468144682446834468444685446864468744688446894469044691446924469344694446954469644697446984469944700447014470244703447044470544706447074470844709447104471144712447134471444715447164471744718447194472044721447224472344724447254472644727447284472944730447314473244733447344473544736447374473844739447404474144742447434474444745447464474744748447494475044751447524475344754447554475644757447584475944760447614476244763447644476544766447674476844769447704477144772447734477444775447764477744778447794478044781447824478344784447854478644787447884478944790447914479244793447944479544796447974479844799448004480144802448034480444805448064480744808448094481044811448124481344814448154481644817448184481944820448214482244823448244482544826448274482844829448304483144832448334483444835448364483744838448394484044841448424484344844448454484644847448484484944850448514485244853448544485544856448574485844859448604486144862448634486444865448664486744868448694487044871448724487344874448754487644877448784487944880448814488244883448844488544886448874488844889448904489144892448934489444895448964489744898448994490044901449024490344904449054490644907449084490944910449114491244913449144491544916449174491844919449204492144922449234492444925449264492744928449294493044931449324493344934449354493644937449384493944940449414494244943449444494544946449474494844949449504495144952449534495444955449564495744958449594496044961449624496344964449654496644967449684496944970449714497244973449744497544976449774497844979449804498144982449834498444985449864498744988449894499044991449924499344994449954499644997449984499945000450014500245003450044500545006450074500845009450104501145012450134501445015450164501745018450194502045021450224502345024450254502645027450284502945030450314503245033450344503545036450374503845039450404504145042450434504445045450464504745048450494505045051450524505345054450554505645057450584505945060450614506245063450644506545066450674506845069450704507145072450734507445075450764507745078450794508045081450824508345084450854508645087450884508945090450914509245093450944509545096450974509845099451004510145102451034510445105451064510745108451094511045111451124511345114451154511645117451184511945120451214512245123451244512545126451274512845129451304513145132451334513445135451364513745138451394514045141451424514345144451454514645147451484514945150451514515245153451544515545156451574515845159451604516145162451634516445165451664516745168451694517045171451724517345174451754517645177451784517945180451814518245183451844518545186451874518845189451904519145192451934519445195451964519745198451994520045201452024520345204452054520645207452084520945210452114521245213452144521545216452174521845219452204522145222452234522445225452264522745228452294523045231452324523345234452354523645237452384523945240452414524245243452444524545246452474524845249452504525145252452534525445255452564525745258452594526045261452624526345264452654526645267452684526945270452714527245273452744527545276452774527845279452804528145282452834528445285452864528745288452894529045291452924529345294452954529645297452984529945300453014530245303453044530545306453074530845309453104531145312453134531445315453164531745318453194532045321453224532345324453254532645327453284532945330453314533245333453344533545336453374533845339453404534145342453434534445345453464534745348453494535045351453524535345354453554535645357453584535945360453614536245363453644536545366453674536845369453704537145372453734537445375453764537745378453794538045381453824538345384453854538645387453884538945390453914539245393453944539545396453974539845399454004540145402454034540445405454064540745408454094541045411454124541345414454154541645417454184541945420454214542245423454244542545426454274542845429454304543145432454334543445435454364543745438454394544045441454424544345444454454544645447454484544945450454514545245453454544545545456454574545845459454604546145462454634546445465454664546745468454694547045471454724547345474454754547645477454784547945480454814548245483454844548545486454874548845489454904549145492454934549445495454964549745498454994550045501455024550345504455054550645507455084550945510455114551245513455144551545516455174551845519455204552145522455234552445525455264552745528455294553045531455324553345534455354553645537455384553945540455414554245543455444554545546455474554845549455504555145552455534555445555455564555745558455594556045561455624556345564455654556645567455684556945570455714557245573455744557545576455774557845579455804558145582455834558445585455864558745588455894559045591455924559345594455954559645597455984559945600456014560245603456044560545606456074560845609456104561145612456134561445615456164561745618456194562045621456224562345624456254562645627456284562945630456314563245633456344563545636456374563845639456404564145642456434564445645456464564745648456494565045651456524565345654456554565645657456584565945660456614566245663456644566545666456674566845669456704567145672456734567445675456764567745678456794568045681456824568345684456854568645687456884568945690456914569245693456944569545696456974569845699457004570145702457034570445705457064570745708457094571045711457124571345714457154571645717457184571945720457214572245723457244572545726457274572845729457304573145732457334573445735457364573745738457394574045741457424574345744457454574645747457484574945750457514575245753457544575545756457574575845759457604576145762457634576445765457664576745768457694577045771457724577345774457754577645777457784577945780457814578245783457844578545786457874578845789457904579145792457934579445795457964579745798457994580045801458024580345804458054580645807458084580945810458114581245813458144581545816458174581845819458204582145822458234582445825458264582745828458294583045831458324583345834458354583645837458384583945840458414584245843458444584545846458474584845849458504585145852458534585445855458564585745858458594586045861458624586345864458654586645867458684586945870458714587245873458744587545876458774587845879458804588145882458834588445885458864588745888458894589045891458924589345894458954589645897458984589945900459014590245903459044590545906459074590845909459104591145912459134591445915459164591745918459194592045921459224592345924459254592645927459284592945930459314593245933459344593545936459374593845939459404594145942459434594445945459464594745948459494595045951459524595345954459554595645957459584595945960459614596245963459644596545966459674596845969459704597145972459734597445975459764597745978459794598045981459824598345984459854598645987459884598945990459914599245993459944599545996459974599845999460004600146002460034600446005460064600746008460094601046011460124601346014460154601646017460184601946020460214602246023460244602546026460274602846029460304603146032460334603446035460364603746038460394604046041460424604346044460454604646047460484604946050460514605246053460544605546056460574605846059460604606146062460634606446065460664606746068460694607046071460724607346074460754607646077460784607946080460814608246083460844608546086460874608846089460904609146092460934609446095460964609746098460994610046101461024610346104461054610646107461084610946110461114611246113461144611546116461174611846119461204612146122461234612446125461264612746128461294613046131461324613346134461354613646137461384613946140461414614246143461444614546146461474614846149461504615146152461534615446155461564615746158461594616046161461624616346164461654616646167461684616946170461714617246173461744617546176461774617846179461804618146182461834618446185461864618746188461894619046191461924619346194461954619646197461984619946200462014620246203462044620546206462074620846209462104621146212462134621446215462164621746218462194622046221462224622346224462254622646227462284622946230462314623246233462344623546236462374623846239462404624146242462434624446245462464624746248462494625046251462524625346254462554625646257462584625946260462614626246263462644626546266462674626846269462704627146272462734627446275462764627746278462794628046281462824628346284462854628646287462884628946290462914629246293462944629546296462974629846299463004630146302463034630446305463064630746308463094631046311463124631346314463154631646317463184631946320463214632246323463244632546326463274632846329463304633146332463334633446335463364633746338463394634046341463424634346344463454634646347463484634946350463514635246353463544635546356463574635846359463604636146362463634636446365463664636746368463694637046371463724637346374463754637646377463784637946380463814638246383463844638546386463874638846389463904639146392463934639446395463964639746398463994640046401464024640346404464054640646407464084640946410464114641246413464144641546416464174641846419464204642146422464234642446425464264642746428464294643046431464324643346434464354643646437464384643946440464414644246443464444644546446464474644846449464504645146452464534645446455464564645746458464594646046461464624646346464464654646646467464684646946470464714647246473464744647546476464774647846479464804648146482464834648446485464864648746488464894649046491464924649346494464954649646497464984649946500465014650246503465044650546506465074650846509465104651146512465134651446515465164651746518465194652046521465224652346524465254652646527465284652946530465314653246533465344653546536465374653846539465404654146542465434654446545465464654746548465494655046551465524655346554465554655646557465584655946560465614656246563465644656546566465674656846569465704657146572465734657446575465764657746578465794658046581465824658346584465854658646587465884658946590465914659246593465944659546596465974659846599466004660146602466034660446605466064660746608466094661046611466124661346614466154661646617466184661946620466214662246623466244662546626466274662846629466304663146632466334663446635466364663746638466394664046641466424664346644466454664646647466484664946650466514665246653466544665546656466574665846659466604666146662466634666446665466664666746668466694667046671466724667346674466754667646677466784667946680466814668246683466844668546686466874668846689466904669146692466934669446695466964669746698466994670046701467024670346704467054670646707467084670946710467114671246713467144671546716467174671846719467204672146722467234672446725467264672746728467294673046731467324673346734467354673646737467384673946740467414674246743467444674546746467474674846749467504675146752467534675446755467564675746758467594676046761467624676346764467654676646767467684676946770467714677246773467744677546776467774677846779467804678146782467834678446785467864678746788467894679046791467924679346794467954679646797467984679946800468014680246803468044680546806468074680846809468104681146812468134681446815468164681746818468194682046821468224682346824468254682646827468284682946830468314683246833468344683546836468374683846839468404684146842468434684446845468464684746848468494685046851468524685346854468554685646857468584685946860468614686246863468644686546866468674686846869468704687146872468734687446875468764687746878468794688046881468824688346884468854688646887468884688946890468914689246893468944689546896468974689846899469004690146902469034690446905469064690746908469094691046911469124691346914469154691646917469184691946920469214692246923469244692546926469274692846929469304693146932469334693446935469364693746938469394694046941469424694346944469454694646947469484694946950469514695246953469544695546956469574695846959469604696146962469634696446965469664696746968469694697046971469724697346974469754697646977469784697946980469814698246983469844698546986469874698846989469904699146992469934699446995469964699746998469994700047001470024700347004470054700647007470084700947010470114701247013470144701547016470174701847019470204702147022470234702447025470264702747028470294703047031470324703347034470354703647037470384703947040470414704247043470444704547046470474704847049470504705147052470534705447055470564705747058470594706047061470624706347064470654706647067470684706947070470714707247073470744707547076470774707847079470804708147082470834708447085470864708747088470894709047091470924709347094470954709647097470984709947100471014710247103471044710547106471074710847109471104711147112471134711447115471164711747118471194712047121471224712347124471254712647127471284712947130471314713247133471344713547136471374713847139471404714147142471434714447145471464714747148471494715047151471524715347154471554715647157471584715947160471614716247163471644716547166471674716847169471704717147172471734717447175471764717747178471794718047181471824718347184471854718647187471884718947190471914719247193471944719547196471974719847199472004720147202472034720447205472064720747208472094721047211472124721347214472154721647217472184721947220472214722247223472244722547226472274722847229472304723147232472334723447235472364723747238472394724047241472424724347244472454724647247472484724947250472514725247253472544725547256472574725847259472604726147262472634726447265472664726747268472694727047271472724727347274472754727647277472784727947280472814728247283472844728547286472874728847289472904729147292472934729447295472964729747298472994730047301473024730347304473054730647307473084730947310473114731247313473144731547316473174731847319473204732147322473234732447325473264732747328473294733047331473324733347334473354733647337473384733947340473414734247343473444734547346473474734847349473504735147352473534735447355473564735747358473594736047361473624736347364473654736647367473684736947370473714737247373473744737547376473774737847379473804738147382473834738447385473864738747388473894739047391473924739347394473954739647397473984739947400474014740247403474044740547406474074740847409474104741147412474134741447415474164741747418474194742047421474224742347424474254742647427474284742947430474314743247433474344743547436474374743847439474404744147442474434744447445474464744747448474494745047451474524745347454474554745647457474584745947460474614746247463474644746547466474674746847469474704747147472474734747447475474764747747478474794748047481474824748347484474854748647487474884748947490474914749247493474944749547496474974749847499475004750147502475034750447505475064750747508475094751047511475124751347514475154751647517475184751947520475214752247523475244752547526475274752847529475304753147532475334753447535475364753747538475394754047541475424754347544475454754647547475484754947550475514755247553475544755547556475574755847559475604756147562475634756447565475664756747568475694757047571475724757347574475754757647577475784757947580475814758247583475844758547586475874758847589475904759147592475934759447595475964759747598475994760047601476024760347604476054760647607476084760947610476114761247613476144761547616476174761847619476204762147622476234762447625476264762747628476294763047631476324763347634476354763647637476384763947640476414764247643476444764547646476474764847649476504765147652476534765447655476564765747658476594766047661476624766347664476654766647667476684766947670476714767247673476744767547676476774767847679476804768147682476834768447685476864768747688476894769047691476924769347694476954769647697476984769947700477014770247703477044770547706477074770847709477104771147712477134771447715477164771747718477194772047721477224772347724477254772647727477284772947730477314773247733477344773547736477374773847739477404774147742477434774447745477464774747748477494775047751477524775347754477554775647757477584775947760477614776247763477644776547766477674776847769477704777147772477734777447775477764777747778477794778047781477824778347784477854778647787477884778947790477914779247793477944779547796477974779847799478004780147802478034780447805478064780747808478094781047811478124781347814478154781647817478184781947820478214782247823478244782547826478274782847829478304783147832478334783447835478364783747838478394784047841478424784347844478454784647847478484784947850478514785247853478544785547856478574785847859478604786147862478634786447865478664786747868478694787047871478724787347874478754787647877478784787947880478814788247883478844788547886478874788847889478904789147892478934789447895478964789747898478994790047901479024790347904479054790647907479084790947910479114791247913479144791547916479174791847919479204792147922479234792447925479264792747928479294793047931479324793347934479354793647937479384793947940479414794247943479444794547946479474794847949479504795147952479534795447955479564795747958479594796047961479624796347964479654796647967479684796947970479714797247973479744797547976479774797847979479804798147982479834798447985479864798747988479894799047991479924799347994479954799647997479984799948000480014800248003480044800548006480074800848009480104801148012480134801448015480164801748018480194802048021480224802348024480254802648027480284802948030480314803248033480344803548036480374803848039480404804148042480434804448045480464804748048480494805048051480524805348054480554805648057480584805948060480614806248063480644806548066480674806848069480704807148072480734807448075480764807748078480794808048081480824808348084480854808648087480884808948090480914809248093480944809548096480974809848099481004810148102481034810448105481064810748108481094811048111481124811348114481154811648117481184811948120481214812248123481244812548126481274812848129481304813148132481334813448135481364813748138481394814048141481424814348144481454814648147481484814948150481514815248153481544815548156481574815848159481604816148162481634816448165481664816748168481694817048171481724817348174481754817648177481784817948180481814818248183481844818548186481874818848189481904819148192481934819448195481964819748198481994820048201482024820348204482054820648207482084820948210482114821248213482144821548216482174821848219482204822148222482234822448225482264822748228482294823048231482324823348234482354823648237482384823948240482414824248243482444824548246482474824848249482504825148252482534825448255482564825748258482594826048261482624826348264482654826648267482684826948270482714827248273482744827548276482774827848279482804828148282482834828448285482864828748288482894829048291482924829348294482954829648297482984829948300483014830248303483044830548306483074830848309483104831148312483134831448315483164831748318483194832048321483224832348324483254832648327483284832948330483314833248333483344833548336483374833848339483404834148342483434834448345483464834748348483494835048351483524835348354483554835648357483584835948360483614836248363483644836548366483674836848369483704837148372483734837448375483764837748378483794838048381483824838348384483854838648387483884838948390483914839248393483944839548396483974839848399484004840148402484034840448405484064840748408484094841048411484124841348414484154841648417484184841948420484214842248423484244842548426484274842848429484304843148432484334843448435484364843748438484394844048441484424844348444484454844648447484484844948450484514845248453484544845548456484574845848459484604846148462484634846448465484664846748468484694847048471484724847348474484754847648477484784847948480484814848248483484844848548486484874848848489484904849148492484934849448495484964849748498484994850048501485024850348504485054850648507485084850948510485114851248513485144851548516485174851848519485204852148522485234852448525485264852748528485294853048531485324853348534485354853648537485384853948540485414854248543485444854548546485474854848549485504855148552485534855448555485564855748558485594856048561485624856348564485654856648567485684856948570485714857248573485744857548576485774857848579485804858148582485834858448585485864858748588485894859048591485924859348594485954859648597485984859948600486014860248603486044860548606486074860848609486104861148612486134861448615486164861748618486194862048621486224862348624486254862648627486284862948630486314863248633486344863548636486374863848639486404864148642486434864448645486464864748648486494865048651486524865348654486554865648657486584865948660486614866248663486644866548666486674866848669486704867148672486734867448675486764867748678486794868048681486824868348684486854868648687486884868948690486914869248693486944869548696486974869848699487004870148702487034870448705487064870748708487094871048711487124871348714487154871648717487184871948720487214872248723487244872548726487274872848729487304873148732487334873448735487364873748738487394874048741487424874348744487454874648747487484874948750487514875248753487544875548756487574875848759487604876148762487634876448765487664876748768487694877048771487724877348774487754877648777487784877948780487814878248783487844878548786487874878848789487904879148792487934879448795487964879748798487994880048801488024880348804488054880648807488084880948810488114881248813488144881548816488174881848819488204882148822488234882448825488264882748828488294883048831488324883348834488354883648837488384883948840488414884248843488444884548846488474884848849488504885148852488534885448855488564885748858488594886048861488624886348864488654886648867488684886948870488714887248873488744887548876488774887848879488804888148882488834888448885488864888748888488894889048891488924889348894488954889648897488984889948900489014890248903489044890548906489074890848909489104891148912489134891448915489164891748918489194892048921489224892348924489254892648927489284892948930489314893248933489344893548936489374893848939489404894148942489434894448945489464894748948489494895048951489524895348954489554895648957489584895948960489614896248963489644896548966489674896848969489704897148972489734897448975489764897748978489794898048981489824898348984489854898648987489884898948990489914899248993489944899548996489974899848999490004900149002490034900449005490064900749008490094901049011490124901349014490154901649017490184901949020490214902249023490244902549026490274902849029490304903149032490334903449035490364903749038490394904049041490424904349044490454904649047490484904949050490514905249053490544905549056490574905849059490604906149062490634906449065490664906749068490694907049071490724907349074490754907649077490784907949080490814908249083490844908549086490874908849089490904909149092490934909449095490964909749098490994910049101491024910349104491054910649107491084910949110491114911249113491144911549116491174911849119491204912149122491234912449125491264912749128491294913049131491324913349134491354913649137491384913949140491414914249143491444914549146491474914849149491504915149152491534915449155491564915749158491594916049161491624916349164491654916649167491684916949170491714917249173491744917549176491774917849179491804918149182491834918449185491864918749188491894919049191491924919349194491954919649197491984919949200492014920249203492044920549206492074920849209492104921149212492134921449215492164921749218492194922049221492224922349224492254922649227492284922949230492314923249233492344923549236492374923849239492404924149242492434924449245492464924749248492494925049251492524925349254492554925649257492584925949260492614926249263492644926549266492674926849269492704927149272492734927449275492764927749278492794928049281492824928349284492854928649287492884928949290492914929249293492944929549296492974929849299493004930149302493034930449305493064930749308493094931049311493124931349314493154931649317493184931949320493214932249323493244932549326493274932849329493304933149332493334933449335493364933749338493394934049341493424934349344493454934649347493484934949350493514935249353493544935549356493574935849359493604936149362493634936449365493664936749368493694937049371493724937349374493754937649377493784937949380493814938249383493844938549386493874938849389493904939149392493934939449395493964939749398493994940049401494024940349404494054940649407494084940949410494114941249413494144941549416494174941849419494204942149422494234942449425494264942749428494294943049431494324943349434494354943649437494384943949440494414944249443494444944549446494474944849449494504945149452494534945449455494564945749458494594946049461494624946349464494654946649467494684946949470494714947249473494744947549476494774947849479494804948149482494834948449485494864948749488494894949049491494924949349494494954949649497494984949949500495014950249503495044950549506495074950849509495104951149512495134951449515495164951749518495194952049521495224952349524495254952649527495284952949530495314953249533495344953549536495374953849539495404954149542495434954449545495464954749548495494955049551495524955349554495554955649557495584955949560495614956249563495644956549566495674956849569495704957149572495734957449575495764957749578495794958049581495824958349584495854958649587495884958949590495914959249593495944959549596495974959849599496004960149602496034960449605496064960749608496094961049611496124961349614496154961649617496184961949620496214962249623496244962549626496274962849629496304963149632496334963449635496364963749638496394964049641496424964349644496454964649647496484964949650496514965249653496544965549656496574965849659496604966149662496634966449665496664966749668496694967049671496724967349674496754967649677496784967949680496814968249683496844968549686496874968849689496904969149692496934969449695496964969749698496994970049701497024970349704497054970649707497084970949710497114971249713497144971549716497174971849719497204972149722497234972449725497264972749728497294973049731497324973349734497354973649737497384973949740497414974249743497444974549746497474974849749497504975149752497534975449755497564975749758497594976049761497624976349764497654976649767497684976949770497714977249773497744977549776497774977849779497804978149782497834978449785497864978749788497894979049791497924979349794497954979649797497984979949800498014980249803498044980549806498074980849809498104981149812498134981449815498164981749818498194982049821498224982349824498254982649827498284982949830498314983249833498344983549836498374983849839498404984149842498434984449845498464984749848498494985049851498524985349854498554985649857498584985949860498614986249863498644986549866498674986849869498704987149872498734987449875498764987749878498794988049881498824988349884498854988649887498884988949890498914989249893498944989549896498974989849899499004990149902499034990449905499064990749908499094991049911499124991349914499154991649917499184991949920499214992249923499244992549926499274992849929499304993149932499334993449935499364993749938499394994049941499424994349944499454994649947499484994949950499514995249953499544995549956499574995849959499604996149962499634996449965499664996749968499694997049971499724997349974499754997649977499784997949980499814998249983499844998549986499874998849989499904999149992499934999449995499964999749998499995000050001500025000350004500055000650007500085000950010500115001250013500145001550016500175001850019500205002150022500235002450025500265002750028500295003050031500325003350034500355003650037500385003950040500415004250043500445004550046500475004850049500505005150052500535005450055500565005750058500595006050061500625006350064500655006650067500685006950070500715007250073500745007550076500775007850079500805008150082500835008450085500865008750088500895009050091500925009350094500955009650097500985009950100501015010250103501045010550106501075010850109501105011150112501135011450115501165011750118501195012050121501225012350124501255012650127501285012950130501315013250133501345013550136501375013850139501405014150142501435014450145501465014750148501495015050151501525015350154501555015650157501585015950160501615016250163501645016550166501675016850169501705017150172501735017450175501765017750178501795018050181501825018350184501855018650187501885018950190501915019250193501945019550196501975019850199502005020150202502035020450205502065020750208502095021050211502125021350214502155021650217502185021950220502215022250223502245022550226502275022850229502305023150232502335023450235502365023750238502395024050241502425024350244502455024650247502485024950250502515025250253502545025550256502575025850259502605026150262502635026450265502665026750268502695027050271502725027350274502755027650277502785027950280502815028250283502845028550286502875028850289502905029150292502935029450295502965029750298502995030050301503025030350304503055030650307503085030950310503115031250313503145031550316503175031850319503205032150322503235032450325503265032750328503295033050331503325033350334503355033650337503385033950340503415034250343503445034550346503475034850349503505035150352503535035450355503565035750358503595036050361503625036350364503655036650367503685036950370503715037250373503745037550376503775037850379503805038150382503835038450385503865038750388503895039050391503925039350394503955039650397503985039950400504015040250403504045040550406504075040850409504105041150412504135041450415504165041750418504195042050421504225042350424504255042650427504285042950430504315043250433504345043550436504375043850439504405044150442504435044450445504465044750448504495045050451504525045350454504555045650457504585045950460504615046250463504645046550466504675046850469504705047150472504735047450475504765047750478504795048050481504825048350484504855048650487504885048950490504915049250493504945049550496504975049850499505005050150502505035050450505505065050750508505095051050511505125051350514505155051650517505185051950520505215052250523505245052550526505275052850529505305053150532505335053450535505365053750538505395054050541505425054350544505455054650547505485054950550505515055250553505545055550556505575055850559505605056150562505635056450565505665056750568505695057050571505725057350574505755057650577505785057950580505815058250583505845058550586505875058850589505905059150592505935059450595505965059750598505995060050601506025060350604506055060650607506085060950610506115061250613506145061550616506175061850619506205062150622506235062450625506265062750628506295063050631506325063350634506355063650637506385063950640506415064250643506445064550646506475064850649506505065150652506535065450655506565065750658506595066050661506625066350664506655066650667506685066950670506715067250673506745067550676506775067850679506805068150682506835068450685506865068750688506895069050691506925069350694506955069650697506985069950700507015070250703507045070550706507075070850709507105071150712507135071450715507165071750718507195072050721507225072350724507255072650727507285072950730507315073250733507345073550736507375073850739507405074150742507435074450745507465074750748507495075050751507525075350754507555075650757507585075950760507615076250763507645076550766507675076850769507705077150772507735077450775507765077750778507795078050781507825078350784507855078650787507885078950790507915079250793507945079550796507975079850799508005080150802508035080450805508065080750808508095081050811508125081350814508155081650817508185081950820508215082250823508245082550826508275082850829508305083150832508335083450835508365083750838508395084050841508425084350844508455084650847508485084950850508515085250853508545085550856508575085850859508605086150862508635086450865508665086750868508695087050871508725087350874508755087650877508785087950880508815088250883508845088550886508875088850889508905089150892508935089450895508965089750898508995090050901509025090350904509055090650907509085090950910509115091250913509145091550916509175091850919509205092150922509235092450925509265092750928509295093050931509325093350934509355093650937509385093950940509415094250943509445094550946509475094850949509505095150952509535095450955509565095750958509595096050961509625096350964509655096650967509685096950970509715097250973509745097550976509775097850979509805098150982509835098450985509865098750988509895099050991509925099350994509955099650997509985099951000510015100251003510045100551006510075100851009510105101151012510135101451015510165101751018510195102051021510225102351024510255102651027510285102951030510315103251033510345103551036510375103851039510405104151042510435104451045510465104751048510495105051051510525105351054510555105651057510585105951060510615106251063510645106551066510675106851069510705107151072510735107451075510765107751078510795108051081510825108351084510855108651087510885108951090510915109251093510945109551096510975109851099511005110151102511035110451105511065110751108511095111051111511125111351114511155111651117511185111951120511215112251123511245112551126511275112851129511305113151132511335113451135511365113751138511395114051141511425114351144511455114651147511485114951150511515115251153511545115551156511575115851159511605116151162511635116451165511665116751168511695117051171511725117351174511755117651177511785117951180511815118251183511845118551186511875118851189511905119151192511935119451195511965119751198511995120051201512025120351204512055120651207512085120951210512115121251213512145121551216512175121851219512205122151222512235122451225512265122751228512295123051231512325123351234512355123651237512385123951240512415124251243512445124551246512475124851249512505125151252512535125451255512565125751258512595126051261512625126351264512655126651267512685126951270512715127251273512745127551276512775127851279512805128151282512835128451285512865128751288512895129051291512925129351294512955129651297512985129951300513015130251303513045130551306513075130851309513105131151312513135131451315513165131751318513195132051321513225132351324513255132651327513285132951330513315133251333513345133551336513375133851339513405134151342513435134451345513465134751348513495135051351513525135351354513555135651357513585135951360513615136251363513645136551366513675136851369513705137151372513735137451375513765137751378513795138051381513825138351384513855138651387513885138951390513915139251393513945139551396513975139851399514005140151402514035140451405514065140751408514095141051411514125141351414514155141651417514185141951420514215142251423514245142551426514275142851429514305143151432514335143451435514365143751438514395144051441514425144351444514455144651447514485144951450514515145251453514545145551456514575145851459514605146151462514635146451465514665146751468514695147051471514725147351474514755147651477514785147951480514815148251483514845148551486514875148851489514905149151492514935149451495514965149751498514995150051501515025150351504515055150651507515085150951510515115151251513515145151551516515175151851519515205152151522515235152451525515265152751528515295153051531515325153351534515355153651537515385153951540515415154251543515445154551546515475154851549515505155151552515535155451555515565155751558515595156051561515625156351564515655156651567515685156951570515715157251573515745157551576515775157851579515805158151582515835158451585515865158751588515895159051591515925159351594515955159651597515985159951600516015160251603516045160551606516075160851609516105161151612516135161451615516165161751618516195162051621516225162351624516255162651627516285162951630516315163251633516345163551636516375163851639516405164151642516435164451645516465164751648516495165051651516525165351654516555165651657516585165951660516615166251663516645166551666516675166851669516705167151672516735167451675516765167751678516795168051681516825168351684516855168651687516885168951690516915169251693516945169551696516975169851699517005170151702517035170451705517065170751708517095171051711517125171351714517155171651717517185171951720517215172251723517245172551726517275172851729517305173151732517335173451735517365173751738517395174051741517425174351744517455174651747517485174951750517515175251753517545175551756517575175851759517605176151762517635176451765517665176751768517695177051771517725177351774517755177651777517785177951780517815178251783517845178551786517875178851789517905179151792517935179451795517965179751798517995180051801518025180351804518055180651807518085180951810518115181251813518145181551816518175181851819518205182151822518235182451825518265182751828518295183051831518325183351834518355183651837518385183951840518415184251843518445184551846518475184851849518505185151852518535185451855518565185751858518595186051861518625186351864518655186651867518685186951870518715187251873518745187551876518775187851879518805188151882518835188451885518865188751888518895189051891518925189351894518955189651897518985189951900519015190251903519045190551906519075190851909519105191151912519135191451915519165191751918519195192051921519225192351924519255192651927519285192951930519315193251933519345193551936519375193851939519405194151942519435194451945519465194751948519495195051951519525195351954519555195651957519585195951960519615196251963519645196551966519675196851969519705197151972519735197451975519765197751978519795198051981519825198351984519855198651987519885198951990519915199251993519945199551996519975199851999520005200152002520035200452005520065200752008520095201052011520125201352014520155201652017520185201952020520215202252023520245202552026520275202852029520305203152032520335203452035520365203752038520395204052041520425204352044520455204652047520485204952050520515205252053520545205552056520575205852059520605206152062520635206452065520665206752068520695207052071520725207352074520755207652077520785207952080520815208252083520845208552086520875208852089520905209152092520935209452095520965209752098520995210052101521025210352104521055210652107521085210952110521115211252113521145211552116521175211852119521205212152122521235212452125521265212752128521295213052131521325213352134521355213652137521385213952140521415214252143521445214552146521475214852149521505215152152521535215452155521565215752158521595216052161521625216352164521655216652167521685216952170521715217252173521745217552176521775217852179521805218152182521835218452185521865218752188521895219052191521925219352194521955219652197521985219952200522015220252203522045220552206522075220852209522105221152212522135221452215522165221752218522195222052221522225222352224522255222652227522285222952230522315223252233522345223552236522375223852239522405224152242522435224452245522465224752248522495225052251522525225352254522555225652257522585225952260522615226252263522645226552266522675226852269522705227152272522735227452275522765227752278522795228052281522825228352284522855228652287522885228952290522915229252293522945229552296522975229852299523005230152302523035230452305523065230752308523095231052311523125231352314523155231652317523185231952320523215232252323523245232552326523275232852329523305233152332523335233452335523365233752338523395234052341523425234352344523455234652347523485234952350523515235252353523545235552356523575235852359523605236152362523635236452365523665236752368523695237052371523725237352374523755237652377523785237952380523815238252383523845238552386523875238852389523905239152392523935239452395523965239752398523995240052401524025240352404524055240652407524085240952410524115241252413524145241552416524175241852419524205242152422524235242452425524265242752428524295243052431524325243352434524355243652437524385243952440524415244252443524445244552446524475244852449524505245152452524535245452455524565245752458524595246052461524625246352464524655246652467524685246952470524715247252473524745247552476524775247852479524805248152482524835248452485524865248752488524895249052491524925249352494524955249652497524985249952500525015250252503525045250552506525075250852509525105251152512525135251452515525165251752518525195252052521525225252352524525255252652527525285252952530525315253252533525345253552536525375253852539525405254152542525435254452545525465254752548525495255052551525525255352554525555255652557525585255952560525615256252563525645256552566525675256852569525705257152572525735257452575525765257752578525795258052581525825258352584525855258652587525885258952590525915259252593525945259552596525975259852599526005260152602526035260452605526065260752608526095261052611526125261352614526155261652617526185261952620526215262252623526245262552626526275262852629526305263152632526335263452635526365263752638526395264052641526425264352644526455264652647526485264952650526515265252653526545265552656526575265852659526605266152662526635266452665526665266752668526695267052671526725267352674526755267652677526785267952680526815268252683526845268552686526875268852689526905269152692526935269452695526965269752698526995270052701527025270352704527055270652707527085270952710527115271252713527145271552716527175271852719527205272152722527235272452725527265272752728527295273052731527325273352734527355273652737527385273952740527415274252743527445274552746527475274852749527505275152752527535275452755527565275752758527595276052761527625276352764527655276652767527685276952770527715277252773527745277552776527775277852779527805278152782527835278452785527865278752788527895279052791527925279352794527955279652797527985279952800528015280252803528045280552806528075280852809528105281152812528135281452815528165281752818528195282052821528225282352824528255282652827528285282952830528315283252833528345283552836528375283852839528405284152842528435284452845528465284752848528495285052851528525285352854528555285652857528585285952860528615286252863528645286552866528675286852869528705287152872528735287452875528765287752878528795288052881528825288352884528855288652887528885288952890528915289252893528945289552896528975289852899529005290152902529035290452905529065290752908529095291052911529125291352914529155291652917529185291952920529215292252923529245292552926529275292852929529305293152932529335293452935529365293752938529395294052941529425294352944529455294652947529485294952950529515295252953529545295552956529575295852959529605296152962529635296452965529665296752968529695297052971529725297352974529755297652977529785297952980529815298252983529845298552986529875298852989529905299152992529935299452995529965299752998529995300053001530025300353004530055300653007530085300953010530115301253013530145301553016530175301853019530205302153022530235302453025530265302753028530295303053031530325303353034530355303653037530385303953040530415304253043530445304553046530475304853049530505305153052530535305453055530565305753058530595306053061530625306353064530655306653067530685306953070530715307253073530745307553076530775307853079530805308153082530835308453085530865308753088530895309053091530925309353094530955309653097530985309953100531015310253103531045310553106531075310853109531105311153112531135311453115531165311753118531195312053121531225312353124531255312653127531285312953130531315313253133531345313553136531375313853139531405314153142531435314453145531465314753148531495315053151531525315353154531555315653157531585315953160531615316253163531645316553166531675316853169531705317153172531735317453175531765317753178531795318053181531825318353184531855318653187531885318953190531915319253193531945319553196531975319853199532005320153202532035320453205532065320753208532095321053211532125321353214532155321653217532185321953220532215322253223532245322553226532275322853229532305323153232532335323453235532365323753238532395324053241532425324353244532455324653247532485324953250532515325253253532545325553256532575325853259532605326153262532635326453265532665326753268532695327053271532725327353274532755327653277532785327953280532815328253283532845328553286532875328853289532905329153292532935329453295532965329753298532995330053301533025330353304533055330653307533085330953310533115331253313533145331553316533175331853319533205332153322533235332453325533265332753328533295333053331533325333353334533355333653337533385333953340533415334253343533445334553346533475334853349533505335153352533535335453355533565335753358533595336053361533625336353364533655336653367533685336953370533715337253373533745337553376533775337853379533805338153382533835338453385533865338753388533895339053391533925339353394533955339653397533985339953400534015340253403534045340553406534075340853409534105341153412534135341453415534165341753418534195342053421534225342353424534255342653427534285342953430534315343253433534345343553436534375343853439534405344153442534435344453445534465344753448534495345053451534525345353454534555345653457534585345953460534615346253463534645346553466534675346853469534705347153472534735347453475534765347753478534795348053481534825348353484534855348653487534885348953490534915349253493534945349553496534975349853499535005350153502535035350453505535065350753508535095351053511535125351353514535155351653517535185351953520535215352253523535245352553526535275352853529535305353153532535335353453535535365353753538535395354053541535425354353544535455354653547535485354953550535515355253553535545355553556535575355853559535605356153562535635356453565535665356753568535695357053571535725357353574535755357653577535785357953580535815358253583535845358553586535875358853589535905359153592535935359453595535965359753598535995360053601536025360353604536055360653607536085360953610536115361253613536145361553616536175361853619536205362153622536235362453625536265362753628536295363053631536325363353634536355363653637536385363953640536415364253643536445364553646536475364853649536505365153652536535365453655536565365753658536595366053661536625366353664536655366653667536685366953670536715367253673536745367553676536775367853679536805368153682536835368453685536865368753688536895369053691536925369353694536955369653697536985369953700537015370253703537045370553706537075370853709537105371153712537135371453715537165371753718537195372053721537225372353724537255372653727537285372953730537315373253733537345373553736537375373853739537405374153742537435374453745537465374753748537495375053751537525375353754537555375653757537585375953760537615376253763537645376553766537675376853769537705377153772537735377453775537765377753778537795378053781537825378353784537855378653787537885378953790537915379253793537945379553796537975379853799538005380153802538035380453805538065380753808538095381053811538125381353814538155381653817538185381953820538215382253823538245382553826538275382853829538305383153832538335383453835538365383753838538395384053841538425384353844538455384653847538485384953850538515385253853538545385553856538575385853859538605386153862538635386453865538665386753868538695387053871538725387353874538755387653877538785387953880538815388253883538845388553886538875388853889538905389153892538935389453895538965389753898538995390053901539025390353904539055390653907539085390953910539115391253913539145391553916539175391853919539205392153922539235392453925539265392753928539295393053931539325393353934539355393653937539385393953940539415394253943539445394553946539475394853949539505395153952539535395453955539565395753958539595396053961539625396353964539655396653967539685396953970539715397253973539745397553976539775397853979539805398153982539835398453985539865398753988539895399053991539925399353994539955399653997539985399954000540015400254003540045400554006540075400854009540105401154012540135401454015540165401754018540195402054021540225402354024540255402654027540285402954030540315403254033540345403554036540375403854039540405404154042540435404454045540465404754048540495405054051540525405354054540555405654057540585405954060540615406254063540645406554066540675406854069540705407154072540735407454075540765407754078540795408054081540825408354084540855408654087540885408954090540915409254093540945409554096540975409854099541005410154102541035410454105541065410754108541095411054111541125411354114541155411654117541185411954120541215412254123541245412554126541275412854129541305413154132541335413454135541365413754138541395414054141541425414354144541455414654147541485414954150541515415254153541545415554156541575415854159541605416154162541635416454165541665416754168541695417054171541725417354174541755417654177541785417954180541815418254183541845418554186541875418854189541905419154192541935419454195541965419754198541995420054201542025420354204542055420654207542085420954210542115421254213542145421554216542175421854219542205422154222542235422454225542265422754228542295423054231542325423354234542355423654237542385423954240542415424254243542445424554246542475424854249542505425154252542535425454255542565425754258542595426054261542625426354264542655426654267542685426954270542715427254273542745427554276542775427854279542805428154282542835428454285542865428754288542895429054291542925429354294542955429654297542985429954300543015430254303543045430554306543075430854309543105431154312543135431454315543165431754318543195432054321543225432354324543255432654327543285432954330543315433254333543345433554336543375433854339543405434154342543435434454345543465434754348543495435054351543525435354354543555435654357543585435954360543615436254363543645436554366543675436854369543705437154372543735437454375543765437754378543795438054381543825438354384543855438654387543885438954390543915439254393543945439554396543975439854399544005440154402544035440454405544065440754408544095441054411544125441354414544155441654417544185441954420544215442254423544245442554426544275442854429544305443154432544335443454435544365443754438544395444054441544425444354444544455444654447544485444954450544515445254453544545445554456544575445854459544605446154462544635446454465544665446754468544695447054471544725447354474544755447654477544785447954480544815448254483544845448554486544875448854489544905449154492544935449454495544965449754498544995450054501545025450354504545055450654507545085450954510545115451254513545145451554516545175451854519545205452154522545235452454525545265452754528545295453054531545325453354534545355453654537545385453954540545415454254543545445454554546545475454854549545505455154552545535455454555545565455754558545595456054561545625456354564545655456654567545685456954570545715457254573545745457554576545775457854579545805458154582545835458454585545865458754588545895459054591545925459354594545955459654597545985459954600546015460254603546045460554606546075460854609546105461154612546135461454615546165461754618546195462054621546225462354624546255462654627546285462954630546315463254633546345463554636546375463854639546405464154642546435464454645546465464754648546495465054651546525465354654546555465654657546585465954660546615466254663546645466554666546675466854669546705467154672546735467454675546765467754678546795468054681546825468354684546855468654687546885468954690546915469254693546945469554696546975469854699547005470154702547035470454705547065470754708547095471054711547125471354714547155471654717547185471954720547215472254723547245472554726547275472854729547305473154732547335473454735547365473754738547395474054741547425474354744547455474654747547485474954750547515475254753547545475554756547575475854759547605476154762547635476454765547665476754768547695477054771547725477354774547755477654777547785477954780547815478254783547845478554786547875478854789547905479154792547935479454795547965479754798547995480054801548025480354804548055480654807548085480954810548115481254813548145481554816548175481854819548205482154822548235482454825548265482754828548295483054831548325483354834548355483654837548385483954840548415484254843548445484554846548475484854849548505485154852548535485454855548565485754858548595486054861548625486354864548655486654867548685486954870548715487254873548745487554876548775487854879548805488154882548835488454885548865488754888548895489054891548925489354894548955489654897548985489954900549015490254903549045490554906549075490854909549105491154912549135491454915549165491754918549195492054921549225492354924549255492654927549285492954930549315493254933549345493554936549375493854939549405494154942549435494454945549465494754948549495495054951549525495354954549555495654957549585495954960549615496254963549645496554966549675496854969549705497154972549735497454975549765497754978549795498054981549825498354984549855498654987549885498954990549915499254993549945499554996549975499854999550005500155002550035500455005550065500755008550095501055011550125501355014550155501655017550185501955020550215502255023550245502555026550275502855029550305503155032550335503455035550365503755038550395504055041550425504355044550455504655047550485504955050550515505255053550545505555056550575505855059550605506155062550635506455065550665506755068550695507055071550725507355074550755507655077550785507955080550815508255083550845508555086550875508855089550905509155092550935509455095550965509755098550995510055101551025510355104551055510655107551085510955110551115511255113551145511555116551175511855119551205512155122551235512455125551265512755128551295513055131551325513355134551355513655137551385513955140551415514255143551445514555146551475514855149551505515155152551535515455155551565515755158551595516055161551625516355164551655516655167551685516955170551715517255173551745517555176551775517855179551805518155182551835518455185551865518755188551895519055191551925519355194551955519655197551985519955200552015520255203552045520555206552075520855209552105521155212552135521455215552165521755218552195522055221552225522355224552255522655227552285522955230552315523255233552345523555236552375523855239552405524155242552435524455245552465524755248552495525055251552525525355254552555525655257552585525955260552615526255263552645526555266552675526855269552705527155272552735527455275552765527755278552795528055281552825528355284552855528655287552885528955290552915529255293552945529555296552975529855299553005530155302553035530455305553065530755308553095531055311553125531355314553155531655317553185531955320553215532255323553245532555326553275532855329553305533155332553335533455335553365533755338553395534055341553425534355344553455534655347553485534955350553515535255353553545535555356553575535855359553605536155362
  1. g_playAudio = null
  2. g_tourAudio = new Audio
  3. g_tourAudio.loop = !1
  4. g_tourAudio.crossOrigin = "anonymous"
  5. g_tourAudio.addEventListener("ended", function() {
  6. var e = document.createEvent("MouseEvent");
  7. e.initEvent("tourAudioEnded", !0, !0),
  8. window.dispatchEvent(e)
  9. })
  10. g_tourAudio.oncanplaythrough = function() {
  11. g_tourAudio.play();
  12. if(g_bgAudio && !g_bgAudio.paused){
  13. manage.switchBgmState(false);
  14. g_bgAudio.pauseByTour = true
  15. }
  16. g_playAudio = g_tourAudio;
  17. }
  18. var dom = {
  19. getOffset: function(e, t, i) {
  20. for (left = "left" == e ? t.offsetLeft : t.offsetTop,
  21. i = i || $("body")[0]; (t = t.offsetParent) && t != i; )
  22. left += "left" == e ? t.offsetLeft : t.offsetTop;
  23. return left
  24. }
  25. };
  26. if (function() {
  27. "use strict";
  28. function o(e, t) {
  29. return typeof e === t
  30. }
  31. function a(e, t) {
  32. return e instanceof t
  33. }
  34. function s(e) {
  35. return e && e.nodeType
  36. }
  37. function l(e) {
  38. return s(e) ? e : a(e, y) ? e[0] : void 0
  39. }
  40. function e(e, i, n) {
  41. return y.each(e, function(e, t) {
  42. n = i.call(t, n, e, t)
  43. }),
  44. n
  45. }
  46. function t(e, t, i) {
  47. var n, r, o;
  48. if (e === t)
  49. return !0;
  50. if (!e || !t || e.constructor !== t.constructor)
  51. return !1;
  52. for (n = 0,
  53. r = i.length; n < r; n += 1) {
  54. if (e[o = i[n]] && E(e[o].equals) && !e[o].equals(t[o]))
  55. return !1;
  56. if (e[o] !== t[o])
  57. return !1
  58. }
  59. return !0
  60. }
  61. function c(e, t, i, n) {
  62. this.left = w(e),
  63. this.top = w(t),
  64. this.width = w(i),
  65. this.height = w(n),
  66. this.right = this.left + this.width,
  67. this.bottom = this.top + this.height
  68. }
  69. function h(e, t, i, n) {
  70. this.visible = e || 0,
  71. this.viewport = t || 0,
  72. this.possible = i || 0,
  73. this.rects = n && I({}, n) || null
  74. }
  75. function r(e, t) {
  76. this.els = e,
  77. this.viewport = t
  78. }
  79. function n(e, t) {
  80. return e.val - t.val
  81. }
  82. function u(e, t) {
  83. return t.val - e.val
  84. }
  85. function d(e) {
  86. var t = c.ofContent(e, !0)
  87. , i = c.ofViewport(e, !0)
  88. , n = t.width - i.width
  89. , r = t.height - i.height;
  90. this.content = t,
  91. this.viewport = i,
  92. this.width = n <= 0 ? null : i.left / n,
  93. this.height = r <= 0 ? null : i.top / r,
  94. this.left = i.left,
  95. this.top = i.top,
  96. this.right = t.right - i.right,
  97. this.bottom = t.bottom - i.bottom
  98. }
  99. function p(e) {
  100. this.el = e || window
  101. }
  102. function f(e, t) {
  103. this.context = e,
  104. this.viewport = t,
  105. this.init()
  106. }
  107. function g(e, t, i, n) {
  108. this.context = new r(e,t),
  109. this.property = i,
  110. this.descending = n,
  111. this.init()
  112. }
  113. function m(e) {
  114. e && e !== window && e !== document ? (this.context = e,
  115. this.$autoTarget = y(e)) : this.context = window,
  116. this.init()
  117. }
  118. var i, v, y = jQuery, A = y(window), C = y(document), I = y.extend, E = y.isFunction, _ = Math.max, b = Math.min, w = Math.round, T = (i = {},
  119. v = 1,
  120. function(e) {
  121. return e ? (i[e] || (i[e] = v,
  122. v += 1),
  123. i[e]) : 0
  124. }
  125. );
  126. I(c.prototype, {
  127. equals: function(e) {
  128. return t(this, e, ["left", "top", "width", "height"])
  129. },
  130. area: function() {
  131. return this.width * this.height
  132. },
  133. relativeTo: function(e) {
  134. return new c(this.left - e.left,this.top - e.top,this.width,this.height)
  135. },
  136. intersection: function(e) {
  137. if (!a(e, c))
  138. return null;
  139. var t = _(this.left, e.left)
  140. , i = b(this.right, e.right)
  141. , n = _(this.top, e.top)
  142. , r = i - t
  143. , o = b(this.bottom, e.bottom) - n;
  144. return 0 <= r && 0 <= o ? new c(t,n,r,o) : null
  145. },
  146. envelope: function(e) {
  147. if (!a(e, c))
  148. return this;
  149. var t = b(this.left, e.left)
  150. , i = _(this.right, e.right)
  151. , n = b(this.top, e.top);
  152. return new c(t,n,i - t,_(this.bottom, e.bottom) - n)
  153. }
  154. }),
  155. I(c, {
  156. ofContent: function(e, t) {
  157. return e && e !== document && e !== window ? t ? new c(0,0,e.scrollWidth,e.scrollHeight) : new c(e.offsetLeft - e.scrollLeft,e.offsetTop - e.scrollTop,e.scrollWidth,e.scrollHeight) : new c(0,0,C.width(),C.height())
  158. },
  159. ofViewport: function(e, t) {
  160. return e && e !== document && e !== window ? t ? new c(e.scrollLeft,e.scrollTop,e.clientWidth,e.clientHeight) : new c(e.offsetLeft,e.offsetTop,e.clientWidth,e.clientHeight) : new c(A.scrollLeft(),A.scrollTop(),A.width(),A.height())
  161. },
  162. ofElement: function(e) {
  163. var t = y(e);
  164. if (!t.is(":visible"))
  165. return null;
  166. var i = t.offset();
  167. return new c(i.left,i.top,t.outerWidth(),t.outerHeight())
  168. }
  169. }),
  170. I(h.prototype, {
  171. equals: function(e) {
  172. return this.fracsEqual(e) && this.rectsEqual(e)
  173. },
  174. fracsEqual: function(e) {
  175. return t(this, e, ["visible", "viewport", "possible"])
  176. },
  177. rectsEqual: function(e) {
  178. return t(this.rects, e.rects, ["document", "element", "viewport"])
  179. }
  180. }),
  181. I(h, {
  182. of: function(e, t) {
  183. var i, n, r;
  184. return e = s(e) && c.ofElement(e) || e,
  185. t = s(t) && c.ofViewport(t) || t || c.ofViewport(),
  186. e instanceof c && (i = e.intersection(t)) ? (n = i.area(),
  187. r = b(e.width, t.width) * b(e.height, t.height),
  188. new h(n / e.area(),n / t.area(),n / r,{
  189. document: i,
  190. element: i.relativeTo(e),
  191. viewport: i.relativeTo(t)
  192. })) : new h
  193. }
  194. });
  195. var x = ["width", "height", "left", "right", "top", "bottom"]
  196. , S = ["possible", "visible", "viewport"];
  197. I(r.prototype, {
  198. sorted: function(t, e) {
  199. var i = this.viewport;
  200. return y.map(this.els, function(e) {
  201. return {
  202. el: e,
  203. val: function(e, t, i) {
  204. var n;
  205. return 0 <= y.inArray(i, x) ? n = c.ofElement(e) : 0 <= y.inArray(i, S) && (n = h.of(e, t)),
  206. n ? n[i] : 0
  207. }(e, i, t)
  208. }
  209. }).sort(e ? u : n)
  210. },
  211. best: function(e, t) {
  212. return this.els.length ? this.sorted(e, t)[0] : null
  213. }
  214. }),
  215. I(d.prototype, {
  216. equals: function(e) {
  217. return t(this, e, ["width", "height", "left", "top", "right", "bottom", "content", "viewport"])
  218. }
  219. }),
  220. I(p.prototype, {
  221. equals: function(e) {
  222. return t(this, e, ["el"])
  223. },
  224. scrollState: function() {
  225. return new d(this.el)
  226. },
  227. scrollTo: function(e, t, i) {
  228. var n = y(this.el === window ? "html,body" : this.el);
  229. e = e || 0,
  230. t = t || 0,
  231. i = isNaN(i) ? 1e3 : i,
  232. n.stop(!0).animate({
  233. scrollLeft: e,
  234. scrollTop: t
  235. }, i)
  236. },
  237. scroll: function(e, t, i) {
  238. var n = this.el === window ? A : y(this.el);
  239. e = e || 0,
  240. t = t || 0,
  241. this.scrollTo(n.scrollLeft() + e, n.scrollTop() + t, i)
  242. },
  243. scrollToRect: function(e, t, i, n) {
  244. t = t || 0,
  245. i = i || 0,
  246. this.scrollTo(e.left - t, e.top - i, n)
  247. },
  248. scrollToElement: function(e, t, i, n) {
  249. var r = c.ofElement(e).relativeTo(c.ofContent(this.el));
  250. this.scrollToRect(r, t, i, n)
  251. }
  252. });
  253. var M = {
  254. init: function() {
  255. this.callbacks = y.Callbacks("memory unique"),
  256. this.currVal = null,
  257. this.prevVal = null,
  258. this.checkProxy = y.proxy(this.check, this),
  259. this.autoCheck()
  260. },
  261. bind: function(e) {
  262. this.callbacks.add(e)
  263. },
  264. unbind: function(e) {
  265. e ? this.callbacks.remove(e) : this.callbacks.empty()
  266. },
  267. trigger: function() {
  268. this.callbacks.fireWith(this.context, [this.currVal, this.prevVal])
  269. },
  270. check: function(e) {
  271. var t = this.updatedValue(e);
  272. return void 0 !== t && (this.prevVal = this.currVal,
  273. this.currVal = t,
  274. this.trigger(),
  275. !0)
  276. },
  277. $autoTarget: A,
  278. autoEvents: "load resize scroll",
  279. autoCheck: function(e) {
  280. this.$autoTarget[!1 === e ? "off" : "on"](this.autoEvents, this.checkProxy)
  281. }
  282. };
  283. I(f.prototype, M, {
  284. updatedValue: function() {
  285. var e = h.of(this.context, this.viewport);
  286. return this.currVal && this.currVal.equals(e) ? void 0 : e
  287. }
  288. }),
  289. I(g.prototype, M, {
  290. updatedValue: function() {
  291. var e = this.context.best(this.property, this.descending);
  292. return e && (e = 0 < e.val ? e.el : null,
  293. this.currVal !== e) ? e : void 0
  294. }
  295. }),
  296. I(m.prototype, M, {
  297. updatedValue: function() {
  298. var e = new d(this.context);
  299. return this.currVal && this.currVal.equals(e) ? void 0 : e
  300. }
  301. });
  302. var R, P, O, L, D, N, F, B, V, k, U = "fracs";
  303. function H(e, t, i, n) {
  304. return i = N(i) ? i.apply(e, t) : i,
  305. N(n[i]) ? n[i].apply(e, t) : void L.error('Method "' + i + '" does not exist on jQuery.' + R)
  306. }
  307. R = U,
  308. P = {
  309. statics: {
  310. version: "0.15.0",
  311. Rect: c,
  312. Fractions: h,
  313. Group: r,
  314. ScrollState: d,
  315. Viewport: p,
  316. FracsCallbacks: f,
  317. GroupCallbacks: g,
  318. ScrollStateCallbacks: m,
  319. fracs: function(e, t) {
  320. return h.of(e, t)
  321. }
  322. },
  323. methods: {
  324. content: function(e) {
  325. return this.length ? c.ofContent(this[0], e) : null
  326. },
  327. envelope: function() {
  328. return e(this, function(e) {
  329. var t = c.ofElement(this);
  330. return e ? e.envelope(t) : t
  331. })
  332. },
  333. fracs: function(e, i, n) {
  334. o(e, "string") || (n = i,
  335. i = e,
  336. e = null),
  337. E(i) || (n = i,
  338. i = null),
  339. n = l(n);
  340. var r = U + ".fracs." + T(n);
  341. return "unbind" === e ? this.each(function() {
  342. var e = y(this).data(r);
  343. e && e.unbind(i)
  344. }) : "check" === e ? this.each(function() {
  345. var e = y(this).data(r);
  346. e && e.check()
  347. }) : E(i) ? this.each(function() {
  348. var e = y(this)
  349. , t = e.data(r);
  350. t || (t = new f(this,n),
  351. e.data(r, t)),
  352. t.bind(i)
  353. }) : this.length ? h.of(this[0], n) : null
  354. },
  355. intersection: function() {
  356. return e(this, function(e) {
  357. var t = c.ofElement(this);
  358. return e ? e.intersection(t) : t
  359. })
  360. },
  361. max: function(e, t, i) {
  362. return E(t) || (i = t,
  363. t = null),
  364. i = l(i),
  365. t ? (new g(this,i,e,!0).bind(t),
  366. this) : this.pushStack(new r(this,i).best(e, !0).el)
  367. },
  368. min: function(e, t, i) {
  369. return E(t) || (i = t,
  370. t = null),
  371. i = l(i),
  372. t ? (new g(this,i,e).bind(t),
  373. this) : this.pushStack(new r(this,i).best(e).el)
  374. },
  375. rect: function() {
  376. return this.length ? c.ofElement(this[0]) : null
  377. },
  378. scrollState: function(e, i) {
  379. var n = U + ".scrollState";
  380. return o(e, "string") || (i = e,
  381. e = null),
  382. "unbind" === e ? this.each(function() {
  383. var e = y(this).data(n);
  384. e && e.unbind(i)
  385. }) : "check" === e ? this.each(function() {
  386. var e = y(this).data(n);
  387. e && e.check()
  388. }) : E(i) ? this.each(function() {
  389. var e = y(this)
  390. , t = e.data(n);
  391. t || (t = new m(this),
  392. e.data(n, t)),
  393. t.bind(i)
  394. }) : this.length ? new d(this[0]) : null
  395. },
  396. scroll: function(e, t, i) {
  397. return this.each(function() {
  398. new p(this).scroll(e, t, i)
  399. })
  400. },
  401. scrollTo: function(e, t, i, n) {
  402. return y.isNumeric(e) && (n = i,
  403. i = t,
  404. t = e,
  405. e = null),
  406. e = l(e),
  407. this.each(function() {
  408. e ? new p(this).scrollToElement(e, t, i, n) : new p(this).scrollTo(t, i, n)
  409. })
  410. },
  411. scrollToThis: function(e, t, i, n) {
  412. return (n = new p(l(n))).scrollToElement(this[0], e, t, i),
  413. this
  414. },
  415. softLink: function(t, i, n, r) {
  416. return r = new p(l(r)),
  417. this.filter("a[href^=#]").each(function() {
  418. var e = y(this);
  419. e.on("click", function() {
  420. r.scrollToElement(y(e.attr("href"))[0], t, i, n)
  421. })
  422. })
  423. },
  424. sort: function(e, t, i) {
  425. return o(t, "boolean") || (i = t,
  426. t = null),
  427. i = l(i),
  428. this.pushStack(y.map(new r(this,i).sorted(e, !t), function(e) {
  429. return e.el
  430. }))
  431. },
  432. viewport: function(e) {
  433. return this.length ? c.ofViewport(this[0], e) : null
  434. }
  435. },
  436. defaultStatic: "fracs",
  437. defaultMethod: "fracs"
  438. },
  439. O = [].slice,
  440. L = jQuery,
  441. D = L.extend,
  442. N = L.isFunction,
  443. F = D({}, P),
  444. B = function() {
  445. return H(this, O.call(arguments), F.defaultStatic, B)
  446. }
  447. ,
  448. V = function(e) {
  449. return N(V[e]) ? V[e].apply(this, O.call(arguments, 1)) : H(this, O.call(arguments), F.defaultMethod, V)
  450. }
  451. ,
  452. (k = function(e) {
  453. e && (D(B, e.statics),
  454. D(V, e.methods)),
  455. B.modplug = k
  456. }
  457. ).prev = {
  458. statics: L[R],
  459. methods: L.fn[R]
  460. },
  461. k(P),
  462. L[R] = B,
  463. L.fn[R] = V
  464. }(),
  465. "undefined" == typeof jQuery)
  466. throw new Error("Bootstrap's JavaScript requires jQuery");
  467. !function(m) {
  468. "use strict";
  469. function r(e, t) {
  470. this.type = this.options = this.enabled = this.timeout = this.hoverState = this.$element = null,
  471. this.init("tooltip", e, t)
  472. }
  473. r.VERSION = "3.2.0",
  474. r.DEFAULTS = {
  475. animation: !0,
  476. placement: "top",
  477. selector: !1,
  478. template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
  479. trigger: "hover focus",
  480. title: "",
  481. delay: 0,
  482. html: !1,
  483. container: !1,
  484. viewport: {
  485. selector: "body",
  486. padding: 0
  487. }
  488. },
  489. r.prototype.init = function(e, t, i) {
  490. this.enabled = !0,
  491. this.type = e,
  492. this.$element = m(t),
  493. this.options = this.getOptions(i),
  494. this.$viewport = this.options.viewport && m(this.options.viewport.selector || this.options.viewport);
  495. for (var n = this.options.trigger.split(" "), r = n.length; r--; ) {
  496. var o = n[r];
  497. if ("click" == o)
  498. this.$element.on("click." + this.type, this.options.selector, m.proxy(this.toggle, this));
  499. else if ("manual" != o) {
  500. var a = "hover" == o ? "mouseenter" : "focusin"
  501. , s = "hover" == o ? "mouseleave" : "focusout";
  502. this.$element.on(a + "." + this.type, this.options.selector, m.proxy(this.enter, this)),
  503. this.$element.on(s + "." + this.type, this.options.selector, m.proxy(this.leave, this))
  504. }
  505. }
  506. this.options.selector ? this._options = m.extend({}, this.options, {
  507. trigger: "manual",
  508. selector: ""
  509. }) : this.fixTitle()
  510. }
  511. ,
  512. r.prototype.getDefaults = function() {
  513. return r.DEFAULTS
  514. }
  515. ,
  516. r.prototype.getOptions = function(e) {
  517. return (e = m.extend({}, this.getDefaults(), this.$element.data(), e)).delay && "number" == typeof e.delay && (e.delay = {
  518. show: e.delay,
  519. hide: e.delay
  520. }),
  521. e
  522. }
  523. ,
  524. r.prototype.getDelegateOptions = function() {
  525. var i = {}
  526. , n = this.getDefaults();
  527. return this._options && m.each(this._options, function(e, t) {
  528. n[e] != t && (i[e] = t)
  529. }),
  530. i
  531. }
  532. ,
  533. r.prototype.enter = function(e) {
  534. var t = e instanceof this.constructor ? e : m(e.currentTarget).data("bs." + this.type);
  535. return t || (t = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  536. m(e.currentTarget).data("bs." + this.type, t)),
  537. clearTimeout(t.timeout),
  538. t.hoverState = "in",
  539. t.options.delay && t.options.delay.show ? void (t.timeout = setTimeout(function() {}, t.options.delay.show)) : t.show()
  540. }
  541. ,
  542. r.prototype.leave = function(e) {
  543. var t = e instanceof this.constructor ? e : m(e.currentTarget).data("bs." + this.type);
  544. return t || (t = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  545. m(e.currentTarget).data("bs." + this.type, t)),
  546. clearTimeout(t.timeout),
  547. t.hoverState = "out",
  548. t.options.delay && t.options.delay.hide ? void (t.timeout = setTimeout(function() {
  549. "out" == t.hoverState && t.hide()
  550. }, t.options.delay.hide)) : t.hide()
  551. }
  552. ,
  553. r.prototype.show = function() {
  554. var e = m.Event("show.bs." + this.type);
  555. if (this.hasContent() && this.enabled) {
  556. this.$element.trigger(e);
  557. var t = m.contains(document.documentElement, this.$element[0]);
  558. if (e.isDefaultPrevented() || !t)
  559. return;
  560. var i = this
  561. , n = this.tip()
  562. , r = this.getUID(this.type);
  563. this.setContent(),
  564. n.attr("id", r),
  565. this.$element.attr("aria-describedby", r),
  566. this.options.animation && n.addClass("fade");
  567. var o = "function" == typeof this.options.placement ? this.options.placement.call(this, n[0], this.$element[0]) : this.options.placement
  568. , a = /\s?auto?\s?/i
  569. , s = a.test(o);
  570. s && (o = o.replace(a, "") || "top"),
  571. n.detach().css({
  572. top: 0,
  573. left: 0,
  574. display: "block"
  575. }).addClass(o).data("bs." + this.type, this),
  576. this.options.container ? n.appendTo(this.options.container) : n.insertAfter(this.$element);
  577. var l = this.getPosition()
  578. , c = n[0].offsetWidth
  579. , h = n[0].offsetHeight;
  580. if (s) {
  581. var u = o
  582. , d = this.$element.parent()
  583. , p = this.getPosition(d);
  584. o = "bottom" == o && l.top + l.height + h - p.scroll > p.height ? "top" : "top" == o && l.top - p.scroll - h < 0 ? "bottom" : "right" == o && l.right + c > p.width ? "left" : "left" == o && l.left - c < p.left ? "right" : o,
  585. n.removeClass(u).addClass(o)
  586. }
  587. var f = this.getCalculatedOffset(o, l, c, h);
  588. this.applyPlacement(f, o);
  589. var g = function() {
  590. i.$element.trigger("shown.bs." + i.type),
  591. i.hoverState = null
  592. };
  593. m.support.transition && this.$tip.hasClass("fade") ? n.one("bsTransitionEnd", g).emulateTransitionEnd(150) : g()
  594. }
  595. }
  596. ,
  597. r.prototype.applyPlacement = function(e, t) {
  598. var i = this.tip()
  599. , n = i[0].offsetWidth
  600. , r = i[0].offsetHeight
  601. , o = parseInt(i.css("margin-top"), 10)
  602. , a = parseInt(i.css("margin-left"), 10);
  603. isNaN(o) && (o = 0),
  604. isNaN(a) && (a = 0),
  605. e.top = e.top + o,
  606. e.left = e.left + a,
  607. m.offset.setOffset(i[0], m.extend({
  608. using: function(e) {
  609. i.css({
  610. top: Math.round(e.top),
  611. left: Math.round(e.left)
  612. })
  613. }
  614. }, e), 0),
  615. i.addClass("in");
  616. var s = i[0].offsetWidth
  617. , l = i[0].offsetHeight;
  618. "top" == t && l != r && (e.top = e.top + r - l);
  619. var c = this.getViewportAdjustedDelta(t, e, s, l);
  620. c.left ? e.left += c.left : e.top += c.top;
  621. var h = c.left ? 2 * c.left - n + s : 2 * c.top - r + l
  622. , u = c.left ? "left" : "top"
  623. , d = c.left ? "offsetWidth" : "offsetHeight";
  624. i.offset(e),
  625. this.replaceArrow(h, i[0][d], u)
  626. }
  627. ,
  628. r.prototype.replaceArrow = function(e, t, i) {
  629. this.arrow().css(i, e ? 50 * (1 - e / t) + "%" : "")
  630. }
  631. ,
  632. r.prototype.setContent = function() {
  633. var e = this.tip()
  634. , t = this.getTitle();
  635. e.find(".tooltip-inner")[this.options.html ? "html" : "text"](t),
  636. e.removeClass("fade in top bottom left right")
  637. }
  638. ,
  639. r.prototype.hide = function() {
  640. function e() {
  641. "in" != t.hoverState && i.detach(),
  642. t.$element.trigger("hidden.bs." + t.type)
  643. }
  644. var t = this
  645. , i = this.tip()
  646. , n = m.Event("hide.bs." + this.type);
  647. if (this.$element.removeAttr("aria-describedby"),
  648. this.$element.trigger(n),
  649. !n.isDefaultPrevented())
  650. return i.removeClass("in"),
  651. m.support.transition && this.$tip.hasClass("fade") ? i.one("bsTransitionEnd", e).emulateTransitionEnd(150) : e(),
  652. this.hoverState = null,
  653. this
  654. }
  655. ,
  656. r.prototype.fixTitle = function() {
  657. var e = this.$element;
  658. !e.attr("title") && "string" == typeof e.attr("data-original-title") || e.attr("data-original-title", e.attr("title") || "").attr("title", "")
  659. }
  660. ,
  661. r.prototype.hasContent = function() {
  662. return this.getTitle()
  663. }
  664. ,
  665. r.prototype.getPosition = function(e) {
  666. var t = (e = e || this.$element)[0]
  667. , i = "BODY" == t.tagName;
  668. return m.extend({}, "function" == typeof t.getBoundingClientRect ? t.getBoundingClientRect() : null, {
  669. scroll: i ? document.documentElement.scrollTop || document.body.scrollTop : e.scrollTop(),
  670. width: i ? m(window).width() : e.outerWidth(),
  671. height: i ? m(window).height() : e.outerHeight()
  672. }, i ? {
  673. top: 0,
  674. left: 0
  675. } : e.offset())
  676. }
  677. ,
  678. r.prototype.getCalculatedOffset = function(e, t, i, n) {
  679. return "bottom" == e ? {
  680. top: t.top + t.height,
  681. left: t.left + t.width / 2 - i / 2
  682. } : "top" == e ? {
  683. top: t.top - n,
  684. left: t.left + t.width / 2 - i / 2
  685. } : "left" == e ? {
  686. top: t.top + t.height / 2 - n / 2,
  687. left: t.left - i
  688. } : {
  689. top: t.top + t.height / 2 - n / 2,
  690. left: t.left + t.width
  691. }
  692. }
  693. ,
  694. r.prototype.getViewportAdjustedDelta = function(e, t, i, n) {
  695. var r = {
  696. top: 0,
  697. left: 0
  698. };
  699. if (!this.$viewport)
  700. return r;
  701. var o = this.options.viewport && this.options.viewport.padding || 0
  702. , a = this.getPosition(this.$viewport);
  703. if (/right|left/.test(e)) {
  704. var s = t.top - o - a.scroll
  705. , l = t.top + o - a.scroll + n;
  706. s < a.top ? r.top = a.top - s : l > a.top + a.height && (r.top = a.top + a.height - l)
  707. } else {
  708. var c = t.left - o
  709. , h = t.left + o + i;
  710. c < a.left ? r.left = a.left - c : h > a.width && (r.left = a.left + a.width - h)
  711. }
  712. return r
  713. }
  714. ,
  715. r.prototype.getTitle = function() {
  716. var e = this.$element
  717. , t = this.options;
  718. return e.attr("data-original-title") || ("function" == typeof t.title ? t.title.call(e[0]) : t.title)
  719. }
  720. ,
  721. r.prototype.getUID = function(e) {
  722. for (; e += ~~(1e6 * Math.random()),
  723. document.getElementById(e); )
  724. ;
  725. return e
  726. }
  727. ,
  728. r.prototype.tip = function() {
  729. return this.$tip = this.$tip || m(this.options.template)
  730. }
  731. ,
  732. r.prototype.arrow = function() {
  733. return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
  734. }
  735. ,
  736. r.prototype.validate = function() {
  737. this.$element[0].parentNode || (this.hide(),
  738. this.$element = null,
  739. this.options = null)
  740. }
  741. ,
  742. r.prototype.enable = function() {
  743. this.enabled = !0
  744. }
  745. ,
  746. r.prototype.disable = function() {
  747. this.enabled = !1
  748. }
  749. ,
  750. r.prototype.toggleEnabled = function() {
  751. this.enabled = !this.enabled
  752. }
  753. ,
  754. r.prototype.toggle = function(e) {
  755. var t = this;
  756. e && ((t = m(e.currentTarget).data("bs." + this.type)) || (t = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  757. m(e.currentTarget).data("bs." + this.type, t))),
  758. t.tip().hasClass("in") ? t.leave(t) : t.enter(t)
  759. }
  760. ,
  761. r.prototype.destroy = function() {
  762. clearTimeout(this.timeout),
  763. this.hide().$element.off("." + this.type).removeData("bs." + this.type)
  764. }
  765. ;
  766. var e = m.fn.tooltip;
  767. m.fn.tooltip = function(n) {
  768. return this.each(function() {
  769. var e = m(this)
  770. , t = e.data("bs.tooltip")
  771. , i = "object" == typeof n && n;
  772. !t && "destroy" == n || (t || e.data("bs.tooltip", t = new r(this,i)),
  773. "string" == typeof n && t[n]())
  774. })
  775. }
  776. ,
  777. m.fn.tooltip.Constructor = r,
  778. m.fn.tooltip.noConflict = function() {
  779. return m.fn.tooltip = e,
  780. this
  781. }
  782. }(jQuery),
  783. function(e, t, i) {
  784. "undefined" != typeof module && module.exports ? module.exports = i() : "function" == typeof define && define.amd ? define(i) : t.Keen = i()
  785. }(0, this, function() {
  786. "use strict";
  787. function Keen() {
  788. return _init.apply(this, arguments)
  789. }
  790. function _init(e) {
  791. if (_isUndefined(e))
  792. throw new Error("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  793. if (_isUndefined(e.projectId) || "String" !== _type(e.projectId) || e.projectId.length < 1)
  794. throw new Error("Please provide a projectId");
  795. this.configure(e)
  796. }
  797. function _extend(e) {
  798. for (var t = 1; t < arguments.length; t++)
  799. for (var i in arguments[t])
  800. e[i] = arguments[t][i];
  801. return e
  802. }
  803. function _isUndefined(e) {
  804. return void 0 === e
  805. }
  806. function _type(e) {
  807. var t = e && e.constructor ? e.constructor.toString() : void 0;
  808. return t ? t.match(/function (.*)\(/)[1] : "Null"
  809. }
  810. function _each(e, t, i) {
  811. var n;
  812. if (!e)
  813. return 0;
  814. if (i = i || e,
  815. "array" === _type(e)) {
  816. for (n = 0; n < e.length; n++)
  817. if (!1 === t.call(i, e[n], n, e))
  818. return 0
  819. } else
  820. for (n in e)
  821. if (e.hasOwnProperty(n) && !1 === t.call(i, e[n], n, e))
  822. return 0;
  823. return 1
  824. }
  825. function _parse_params(e) {
  826. for (var t, i = {}, n = /\+/g, r = /([^&=]+)=?([^&]*)/g, o = function(e) {
  827. return decodeURIComponent(e.replace(n, " "))
  828. }, a = e.split("?")[1]; t = r.exec(a); )
  829. i[o(t[1])] = o(t[2]);
  830. return i
  831. }
  832. function _set_protocol(e) {
  833. switch (e) {
  834. case "http":
  835. return "http";
  836. case "auto":
  837. return location.protocol.replace(/:/g, "");
  838. case "https":
  839. case void 0:
  840. default:
  841. return "https"
  842. }
  843. }
  844. function _set_request_type(e) {
  845. var t = e || "jsonp"
  846. , i = !1;
  847. return ("Object" === _type(XMLHttpRequest) || "Function" === _type(XMLHttpRequest)) && "withCredentials"in new XMLHttpRequest && (i = !0),
  848. null == t || "xhr" == t ? i ? "xhr" : "jsonp" : t
  849. }
  850. function _build_url(e) {
  851. return this.client.endpoint + "/projects/" + this.client.projectId + e
  852. }
  853. function _uploadEvent(e, t, i, n, r) {
  854. var o = _build_url.apply(this, ["/events/" + e])
  855. , a = {};
  856. for (var s in i = !1 !== i,
  857. this.client.globalProperties && (a = this.client.globalProperties(e)),
  858. t)
  859. t.hasOwnProperty(s) && (a[s] = t[s]);
  860. switch (this.client.requestType) {
  861. case "xhr":
  862. _request.xhr.apply(this, ["POST", o, null, a, this.client.writeKey, i, n, r]);
  863. break;
  864. case "jsonp":
  865. var l = JSON.stringify(a)
  866. , c = Keen.Base64.encode(l);
  867. o = (o = (o = o + "?api_key=" + this.client.writeKey) + "&data=" + c) + "&modified=" + (new Date).getTime(),
  868. _request.jsonp.apply(this, [o, this.client.writeKey, n, r]);
  869. break;
  870. case "beacon":
  871. l = JSON.stringify(a),
  872. c = Keen.Base64.encode(l);
  873. o = (o = (o = o + "?api_key=" + encodeURIComponent(this.client.writeKey)) + "&data=" + encodeURIComponent(c)) + "&modified=" + encodeURIComponent((new Date).getTime()),
  874. o += "&c=clv1",
  875. _request.beacon.apply(this, [o, null, n, r])
  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, i, n, r, o, a, s) {
  897. if (!r)
  898. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  899. var l = new XMLHttpRequest;
  900. if (l.onreadystatechange = function() {
  901. if (4 == l.readyState)
  902. if (200 <= l.status && l.status < 300) {
  903. var e;
  904. try {
  905. e = JSON.parse(l.responseText)
  906. } catch (e) {
  907. Keen.log("Could not JSON parse HTTP response: " + l.responseText),
  908. s && s(l, e)
  909. }
  910. a && e && a(e)
  911. } else
  912. Keen.log("HTTP request failed."),
  913. s && s(l, null)
  914. }
  915. ,
  916. l.open(e, t, o),
  917. r && l.setRequestHeader("Authorization", r),
  918. n && l.setRequestHeader("Content-Type", "application/json"),
  919. i)
  920. for (var c in i)
  921. i.hasOwnProperty(c) && l.setRequestHeader(c, i[c]);
  922. var h = n ? JSON.stringify(n) : null;
  923. l.send(h)
  924. },
  925. jsonp: function(e, t, i, n) {
  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 r = 0 < e.indexOf("?") ? "&" : "?";
  930. e = e + r + "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. i && e && i(e),
  938. window[o] = void 0
  939. }
  940. ,
  941. e = e + "&jsonp=" + o;
  942. var s = document.createElement("script");
  943. s.id = "keen-jsonp",
  944. s.src = e,
  945. document.getElementsByTagName("head")[0].appendChild(s),
  946. s.onreadystatechange = function() {
  947. !1 === a && "loaded" === this.readyState && (a = !0,
  948. n && n())
  949. }
  950. ,
  951. s.onerror = function() {
  952. !1 === a && (a = !0,
  953. n && n())
  954. }
  955. },
  956. beacon: function(e, t, i, n) {
  957. if (t && e.indexOf("api_key") < 0) {
  958. var r = 0 < e.indexOf("?") ? "&" : "?";
  959. e = e + r + "api_key=" + t
  960. }
  961. var o = document.createElement("img");
  962. o.onload = function() {
  963. if (!0,
  964. "naturalHeight"in this) {
  965. if (this.naturalHeight + this.naturalWidth === 0)
  966. return void this.onerror()
  967. } else if (this.width + this.height === 0)
  968. return void this.onerror();
  969. i && i({
  970. created: !0
  971. })
  972. }
  973. ,
  974. o.onerror = function() {
  975. !0,
  976. n && n()
  977. }
  978. ,
  979. o.src = e
  980. }
  981. }
  982. , Events = Keen.Events = {
  983. on: function(e, t) {
  984. return this.listeners || (this.listeners = {}),
  985. (this.listeners[e] || (this.listeners[e] = [])).push({
  986. callback: t
  987. }),
  988. this
  989. },
  990. off: function(e, t) {
  991. if (!e && !t)
  992. return this.listeners = void 0,
  993. delete this.listeners,
  994. this;
  995. for (var i = this.listeners[e] || [], n = i.length; n--; )
  996. t && t == i[n].callback && this.listeners[e].splice(n, 1),
  997. t && 0 != i.length || (this.listeners[e] = void 0,
  998. delete this.listeners[e]);
  999. return this
  1000. },
  1001. trigger: function(e) {
  1002. if (!this.listeners)
  1003. return this;
  1004. for (var t = Array.prototype.slice.call(arguments, 1), i = this.listeners[e] || [], n = 0; n < i.length; n++)
  1005. i[n].callback.apply(this, t);
  1006. return this
  1007. }
  1008. };
  1009. _extend(Keen.prototype, Events),
  1010. _extend(Keen, Events),
  1011. Keen.loaded = !0,
  1012. Keen.utils = {
  1013. each: _each,
  1014. extend: _extend,
  1015. parseParams: _parse_params
  1016. },
  1017. Keen.ready = function(e) {
  1018. Keen.loaded ? e() : Keen.on("ready", e)
  1019. }
  1020. ,
  1021. Keen.log = function(e) {
  1022. "object" == typeof console && console.log("[Keen IO]", e)
  1023. }
  1024. ;
  1025. var Plugins = Keen.Plugins = {}, Hh, Ih;
  1026. Keen.prototype.addEvent = function() {
  1027. _uploadEvent.apply(this, arguments)
  1028. }
  1029. ,
  1030. Keen.prototype.addEventSync = function(e, t, i, n) {
  1031. _uploadEvent.apply(this, [e, t, !1, i, n])
  1032. }
  1033. ,
  1034. Keen.prototype.trackExternalLink = function(e, t, i, n, r) {
  1035. var o = e
  1036. , a = o.metaKey
  1037. , s = o.target
  1038. , l = !1
  1039. , c = function() {};
  1040. return void 0 === n && (n = 500),
  1041. "A" === s.nodeName ? c = function() {
  1042. a || l || (l = !0,
  1043. window.location = s.href)
  1044. }
  1045. : "FORM" === s.nodeName && (c = function() {
  1046. l || (l = !0,
  1047. s.submit())
  1048. }
  1049. ),
  1050. r && (c = function() {
  1051. l || (l = !0,
  1052. r())
  1053. }
  1054. ),
  1055. _uploadEvent.call(this, t, i, c, c),
  1056. setTimeout(function() {
  1057. c()
  1058. }, n),
  1059. !!a && void 0
  1060. }
  1061. ,
  1062. Keen.prototype.setGlobalProperties = function(e) {
  1063. if (!this.client)
  1064. return Keen.log("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  1065. if (!e || "function" != typeof e)
  1066. throw new Error("Invalid value for global properties: " + e);
  1067. this.client.globalProperties = e
  1068. }
  1069. ,
  1070. Keen.Base64 = {
  1071. map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  1072. encode: function(e) {
  1073. var t, i, n, r, o, a, s, l = "", c = 0, h = this.map;
  1074. for (e = this.utf8.encode(e); c < e.length; )
  1075. t = e.charCodeAt(c++),
  1076. i = e.charCodeAt(c++),
  1077. n = e.charCodeAt(c++),
  1078. r = t >> 2,
  1079. o = (3 & t) << 4 | i >> 4,
  1080. a = isNaN(i) ? 64 : (15 & i) << 2 | n >> 6,
  1081. s = isNaN(i) || isNaN(n) ? 64 : 63 & n,
  1082. l = l + h.charAt(r) + h.charAt(o) + h.charAt(a) + h.charAt(s);
  1083. return l
  1084. },
  1085. decode: function(e) {
  1086. var t, i, n, r, o, a, s = "", l = 0, c = this.map, h = String.fromCharCode;
  1087. for (e = e.replace(/[^A-Za-z0-9\+\/\=]/g, ""); l < e.length; )
  1088. t = c.indexOf(e.charAt(l++)),
  1089. o = (15 & (i = c.indexOf(e.charAt(l++)))) << 4 | (n = c.indexOf(e.charAt(l++))) >> 2,
  1090. a = (3 & n) << 6 | (r = c.indexOf(e.charAt(l++))),
  1091. s = s + (h(t << 2 | i >> 4) + (64 != n ? h(o) : "")) + (64 != r ? h(a) : "");
  1092. return this.utf8.decode(s)
  1093. },
  1094. utf8: {
  1095. encode: function(e) {
  1096. for (var t, i = "", n = 0, r = String.fromCharCode; n < e.length; )
  1097. i += (t = e.charCodeAt(n++)) < 128 ? r(t) : 127 < t && t < 2048 ? r(t >> 6 | 192) + r(63 & t | 128) : r(t >> 12 | 224) + r(t >> 6 & 63 | 128) + r(63 & t | 128);
  1098. return i
  1099. },
  1100. decode: function(e) {
  1101. for (var t, i = "", n = 0, r = String.fromCharCode; n < e.length; )
  1102. i += (t = e.charCodeAt(n)) < 128 ? [r(t), n++][0] : 191 < t && t < 224 ? [r((31 & t) << 6 | 63 & e.charCodeAt(n + 1)), n += 2][0] : [r((15 & t) << 12 | (63 & e.charCodeAt(n + 1)) << 6 | 63 & (c3 = e.charCodeAt(n + 2))), n += 3][0];
  1103. return i
  1104. }
  1105. }
  1106. },
  1107. "object" != typeof JSON && (JSON = {}),
  1108. function() {
  1109. function f(e) {
  1110. return e < 10 ? "0" + e : e
  1111. }
  1112. function quote(e) {
  1113. return escapable.lastIndex = 0,
  1114. escapable.test(e) ? '"' + e.replace(escapable, function(e) {
  1115. var t = meta[e];
  1116. return "string" == typeof t ? t : "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1117. }) + '"' : '"' + e + '"'
  1118. }
  1119. function str(e, t) {
  1120. var i, n, r, o, a, s = gap, l = t[e];
  1121. switch (l && "object" == typeof l && "function" == typeof l.toJSON && (l = l.toJSON(e)),
  1122. "function" == typeof rep && (l = rep.call(t, e, l)),
  1123. typeof l) {
  1124. case "string":
  1125. return quote(l);
  1126. case "number":
  1127. return isFinite(l) ? String(l) : "null";
  1128. case "boolean":
  1129. case "null":
  1130. return String(l);
  1131. case "object":
  1132. if (!l)
  1133. return "null";
  1134. if (gap += indent,
  1135. a = [],
  1136. "[object Array]" === Object.prototype.toString.apply(l)) {
  1137. for (o = l.length,
  1138. i = 0; i < o; i += 1)
  1139. a[i] = str(i, l) || "null";
  1140. return r = 0 === a.length ? "[]" : gap ? "[\n" + gap + a.join(",\n" + gap) + "\n" + s + "]" : "[" + a.join(",") + "]",
  1141. gap = s,
  1142. r
  1143. }
  1144. if (rep && "object" == typeof rep)
  1145. for (o = rep.length,
  1146. i = 0; i < o; i += 1)
  1147. "string" == typeof rep[i] && ((r = str(n = rep[i], l)) && a.push(quote(n) + (gap ? ": " : ":") + r));
  1148. else
  1149. for (n in l)
  1150. Object.prototype.hasOwnProperty.call(l, n) && ((r = str(n, l)) && a.push(quote(n) + (gap ? ": " : ":") + r));
  1151. return r = 0 === a.length ? "{}" : gap ? "{\n" + gap + a.join(",\n" + gap) + "\n" + s + "}" : "{" + a.join(",") + "}",
  1152. gap = s,
  1153. r
  1154. }
  1155. }
  1156. "function" != typeof Date.prototype.toJSON && (Date.prototype.toJSON = function() {
  1157. 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
  1158. }
  1159. ,
  1160. String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function() {
  1161. return this.valueOf()
  1162. }
  1163. );
  1164. 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 = {
  1165. "\b": "\\b",
  1166. "\t": "\\t",
  1167. "\n": "\\n",
  1168. "\f": "\\f",
  1169. "\r": "\\r",
  1170. '"': '\\"',
  1171. "\\": "\\\\"
  1172. }, rep;
  1173. "function" != typeof JSON.stringify && (JSON.stringify = function(e, t, i) {
  1174. var n;
  1175. if (indent = gap = "",
  1176. "number" == typeof i)
  1177. for (n = 0; n < i; n += 1)
  1178. indent += " ";
  1179. else
  1180. "string" == typeof i && (indent = i);
  1181. if ((rep = t) && "function" != typeof t && ("object" != typeof t || "number" != typeof t.length))
  1182. throw new Error("JSON.stringify");
  1183. return str("", {
  1184. "": e
  1185. })
  1186. }
  1187. ),
  1188. "function" != typeof JSON.parse && (JSON.parse = function(text, reviver) {
  1189. function walk(e, t) {
  1190. var i, n, r = e[t];
  1191. if (r && "object" == typeof r)
  1192. for (i in r)
  1193. Object.prototype.hasOwnProperty.call(r, i) && (void 0 !== (n = walk(r, i)) ? r[i] = n : delete r[i]);
  1194. return reviver.call(e, t, r)
  1195. }
  1196. var j;
  1197. if (text = String(text),
  1198. cx.lastIndex = 0,
  1199. cx.test(text) && (text = text.replace(cx, function(e) {
  1200. return "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1201. })),
  1202. /^[\],:{}\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, "")))
  1203. return j = eval("(" + text + ")"),
  1204. "function" == typeof reviver ? walk({
  1205. "": j
  1206. }, "") : j;
  1207. throw new SyntaxError("JSON.parse")
  1208. }
  1209. )
  1210. }(),
  1211. Hh = Keen.utils,
  1212. Ih = function(i) {
  1213. function e(e) {
  1214. for (u = 1; e = n.shift(); )
  1215. e()
  1216. }
  1217. var t, n = [], r = document, o = r.documentElement, a = o.doScroll, s = "DOMContentLoaded", l = "addEventListener", c = "onreadystatechange", h = "readyState", u = (a ? /^loaded|^c/ : /^loaded|c/).test(r[h]);
  1218. return r[l] && r[l](s, t = function() {
  1219. r.removeEventListener(s, t, !1),
  1220. e()
  1221. }
  1222. , !1),
  1223. a && r.attachEvent(c, t = function() {
  1224. /^c/.test(r[h]) && (r.detachEvent(c, t),
  1225. e())
  1226. }
  1227. ),
  1228. i = a ? function(t) {
  1229. self != top ? u ? t() : n.push(t) : function() {
  1230. try {
  1231. o.doScroll("left")
  1232. } catch (e) {
  1233. return setTimeout(function() {
  1234. i(t)
  1235. }, 50)
  1236. }
  1237. t()
  1238. }()
  1239. }
  1240. : function(e) {
  1241. u ? e() : n.push(e)
  1242. }
  1243. }
  1244. ,
  1245. "undefined" != typeof module && module.exports ? module.exports = Ih() : "function" == typeof define && define.amd ? define(Ih) : Hh.domready = Ih();
  1246. var loaded = window.Keen, cached = window._Keen || {}, clients, ready;
  1247. if (loaded && cached) {
  1248. for (var instance in clients = cached.clients || {},
  1249. ready = cached.ready || [],
  1250. clients)
  1251. if (clients.hasOwnProperty(instance)) {
  1252. var client = clients[instance];
  1253. for (var method in Keen.prototype)
  1254. Keen.prototype.hasOwnProperty(method) && (loaded.prototype[method] = Keen.prototype[method]);
  1255. if (loaded.Query = Keen.Query ? Keen.Query : function() {}
  1256. ,
  1257. loaded.Visualization = Keen.Visualization ? Keen.Visualization : function() {}
  1258. ,
  1259. client._config && (client.configure.call(client, client._config),
  1260. delete client._config),
  1261. client._setGlobalProperties) {
  1262. for (var globals = client._setGlobalProperties, i = 0; i < globals.length; i++)
  1263. client.setGlobalProperties.apply(client, globals[i]);
  1264. delete client._setGlobalProperties
  1265. }
  1266. if (client._addEvent) {
  1267. for (var queue = client._addEvent || [], i = 0; i < queue.length; i++)
  1268. client.addEvent.apply(client, queue[i]);
  1269. delete client._addEvent
  1270. }
  1271. var callback = client._on || [];
  1272. if (client._on) {
  1273. for (var i = 0; i < callback.length; i++)
  1274. client.on.apply(client, callback[i]);
  1275. client.trigger("ready"),
  1276. delete client._on
  1277. }
  1278. }
  1279. for (var i = 0; i < ready.length; i++) {
  1280. var callback = ready[i];
  1281. Keen.on("ready", function() {
  1282. callback()
  1283. })
  1284. }
  1285. }
  1286. return Keen.loaded && setTimeout(function() {
  1287. Keen.utils.domready(function() {
  1288. Keen.trigger("ready")
  1289. })
  1290. }, 0),
  1291. Keen
  1292. }),
  1293. function() {
  1294. var i = window.analytics = window.analytics || [];
  1295. if (!i.initialize) {
  1296. if (i.invoked)
  1297. return window.console && console.error && console.error("Segment snippet included twice.");
  1298. i.invoked = !0,
  1299. i.methods = ["trackSubmit", "trackClick", "trackLink", "trackForm", "pageview", "identify", "reset", "group", "track", "ready", "alias", "debug", "page", "once", "off", "on"],
  1300. i.factory = function(t) {
  1301. return function() {
  1302. var e = Array.prototype.slice.call(arguments);
  1303. return e.unshift(t),
  1304. i.push(e),
  1305. i
  1306. }
  1307. }
  1308. ;
  1309. for (var e = 0; e < i.methods.length; e++) {
  1310. var t = i.methods[e];
  1311. i[t] = i.factory(t)
  1312. }
  1313. i.load = function(e) {
  1314. var t = document.createElement("script");
  1315. t.type = "text/javascript",
  1316. t.async = !0,
  1317. t.src = ("https:" === document.location.protocol ? "https://" : "http://") + "cdn.segment.com/analytics.js/v1/" + e + "/analytics.min.js";
  1318. var i = document.getElementsByTagName("script")[0];
  1319. i.parentNode.insertBefore(t, i)
  1320. }
  1321. ,
  1322. i.SNIPPET_VERSION = "4.0.0"
  1323. }
  1324. }(),
  1325. function(i, u) {
  1326. "use strict";
  1327. var d = "function"
  1328. , p = "undefined"
  1329. , f = "object"
  1330. , e = "major"
  1331. , t = "model"
  1332. , n = "name"
  1333. , r = "type"
  1334. , o = "vendor"
  1335. , a = "version"
  1336. , s = "architecture"
  1337. , l = "console"
  1338. , c = "mobile"
  1339. , h = "tablet"
  1340. , g = {
  1341. has: function(e, t) {
  1342. return -1 !== t.toLowerCase().indexOf(e.toLowerCase())
  1343. },
  1344. lowerize: function(e) {
  1345. return e.toLowerCase()
  1346. }
  1347. }
  1348. , m = {
  1349. rgx: function() {
  1350. for (var e, t, i, n, r, o, a, s = 0, l = arguments; s < l.length; s += 2) {
  1351. var c = l[s]
  1352. , h = l[s + 1];
  1353. if (typeof e == p)
  1354. for (n in e = {},
  1355. h)
  1356. typeof (r = h[n]) == f ? e[r[0]] = u : e[r] = u;
  1357. for (t = i = 0; t < c.length; t++)
  1358. if (o = c[t].exec(this.getUA())) {
  1359. for (n = 0; n < h.length; n++)
  1360. a = o[++i],
  1361. typeof (r = h[n]) == f && 0 < r.length ? 2 == r.length ? typeof r[1] == d ? e[r[0]] = r[1].call(this, a) : e[r[0]] = r[1] : 3 == r.length ? typeof r[1] != d || r[1].exec && r[1].test ? e[r[0]] = a ? a.replace(r[1], r[2]) : u : e[r[0]] = a ? r[1].call(this, a, r[2]) : u : 4 == r.length && (e[r[0]] = a ? r[3].call(this, a.replace(r[1], r[2])) : u) : e[r] = a || u;
  1362. break
  1363. }
  1364. if (o)
  1365. break
  1366. }
  1367. return e
  1368. },
  1369. str: function(e, t) {
  1370. for (var i in t)
  1371. if (typeof t[i] == f && 0 < t[i].length) {
  1372. for (var n = 0; n < t[i].length; n++)
  1373. if (g.has(t[i][n], e))
  1374. return "?" === i ? u : i
  1375. } else if (g.has(t[i], e))
  1376. return "?" === i ? u : i;
  1377. return e
  1378. }
  1379. }
  1380. , v = {
  1381. browser: {
  1382. oldsafari: {
  1383. major: {
  1384. 1: ["/8", "/1", "/3"],
  1385. 2: "/4",
  1386. "?": "/"
  1387. },
  1388. version: {
  1389. "1.0": "/8",
  1390. 1.2: "/1",
  1391. 1.3: "/3",
  1392. "2.0": "/412",
  1393. "2.0.2": "/416",
  1394. "2.0.3": "/417",
  1395. "2.0.4": "/419",
  1396. "?": "/"
  1397. }
  1398. }
  1399. },
  1400. device: {
  1401. sprint: {
  1402. model: {
  1403. "Evo Shift 4G": "7373KT"
  1404. },
  1405. vendor: {
  1406. HTC: "APA",
  1407. Sprint: "Sprint"
  1408. }
  1409. }
  1410. },
  1411. os: {
  1412. windows: {
  1413. version: {
  1414. ME: "4.90",
  1415. "NT 3.11": "NT3.51",
  1416. "NT 4.0": "NT4.0",
  1417. 2e3: "NT 5.0",
  1418. XP: ["NT 5.1", "NT 5.2"],
  1419. Vista: "NT 6.0",
  1420. 7: "NT 6.1",
  1421. 8: "NT 6.2",
  1422. 8.1: "NT 6.3",
  1423. RT: "ARM"
  1424. }
  1425. }
  1426. }
  1427. }
  1428. , y = {
  1429. browser: [[/(opera\smini)\/((\d+)?[\w\.-]+)/i, /(opera\s[mobiletab]+).+version\/((\d+)?[\w\.-]+)/i, /(opera).+version\/((\d+)?[\w\.]+)/i, /(opera)[\/\s]+((\d+)?[\w\.]+)/i], [n, a, e], [/\s(opr)\/((\d+)?[\w\.]+)/i], [[n, "Opera"], a, e], [/(kindle)\/((\d+)?[\w\.]+)/i, /(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?((\d+)?[\w\.]+)*/i, /(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?((\d+)?[\w\.]*)/i, /(?:ms|\()(ie)\s((\d+)?[\w\.]+)/i, /(rekonq)((?:\/)[\w\.]+)*/i, /(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron)\/((\d+)?[\w\.-]+)/i], [n, a, e], [/(trident).+rv[:\s]((\d+)?[\w\.]+).+like\sgecko/i], [[n, "IE"], a, e], [/(yabrowser)\/((\d+)?[\w\.]+)/i], [[n, "Yandex"], a, e], [/(comodo_dragon)\/((\d+)?[\w\.]+)/i], [[n, /_/g, " "], a, e], [/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?((\d+)?[\w\.]+)/i], [n, a, e], [/(dolfin)\/((\d+)?[\w\.]+)/i], [[n, "Dolphin"], a, e], [/((?:android.+)crmo|crios)\/((\d+)?[\w\.]+)/i], [[n, "Chrome"], a, e], [/version\/((\d+)?[\w\.]+).+?mobile\/\w+\s(safari)/i], [a, e, [n, "Mobile Safari"]], [/version\/((\d+)?[\w\.]+).+?(mobile\s?safari|safari)/i], [a, e, n], [/webkit.+?(mobile\s?safari|safari)((\/[\w\.]+))/i], [n, [e, m.str, v.browser.oldsafari.major], [a, m.str, v.browser.oldsafari.version]], [/(konqueror)\/((\d+)?[\w\.]+)/i, /(webkit|khtml)\/((\d+)?[\w\.]+)/i], [n, a, e], [/(navigator|netscape)\/((\d+)?[\w\.-]+)/i], [[n, "Netscape"], a, e], [/(swiftfox)/i, /(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?((\d+)?[\w\.\+]+)/i, /(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/((\d+)?[\w\.-]+)/i, /(mozilla)\/((\d+)?[\w\.]+).+rv\:.+gecko\/\d+/i, /(uc\s?browser|polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|qqbrowser)[\/\s]?((\d+)?[\w\.]+)/i, /(links)\s\(((\d+)?[\w\.]+)/i, /(gobrowser)\/?((\d+)?[\w\.]+)*/i, /(ice\s?browser)\/v?((\d+)?[\w\._]+)/i, /(mosaic)[\/\s]((\d+)?[\w\.]+)/i], [n, a, e], [/(apple(?:coremedia|))\/((\d+)[\w\._]+)/i, /(coremedia) v((\d+)[\w\._]+)/i], [n, a, e], [/(aqualung|lyssna|bsplayer)\/([\w\.-]+)/i], [n, a], [/(ares|ossproxy)\s((\d+)[\w\.-]+)/i], [n, a, e], [/(audacious|audimusicstream|amarok|bass|core|dalvik|gnomemplayer|music on console|nsplayer|psp-internetradioplayer|videos)\/((\d+)[\w\.-]+)/i, /(clementine|music player daemon)\s((\d+)[\w\.-]+)/i, /(lg player|nexplayer)\s((\d+)[\d\.]+)/i, /player\/(nexplayer|lg player)\s((\d+)[\w\.-]+)/i], [n, a, e], [/(nexplayer)\s((\d+)[\w\.-]+)/i], [n, a, e], [/(flrp)\/((\d+)[\w\.-]+)/i], [[n, "Flip Player"], a, e], [/(fstream|nativehost|queryseekspider|ia-archiver|facebookexternalhit)/i], [n], [/(gstreamer) souphttpsrc (?:\([^\)]+\)){0,1} libsoup\/((\d+)[\w\.-]+)/i], [n, a, e], [/(htc streaming player)\s[\w_]+\s\/\s((\d+)[\d\.]+)/i, /(java|python-urllib|python-requests|wget|libcurl)\/((\d+)[\w\.-_]+)/i, /(lavf)((\d+)[\d\.]+)/i], [n, a, e], [/(htc_one_s)\/((\d+)[\d\.]+)/i], [[n, /_/g, " "], a, e], [/(mplayer)(?:\s|\/)(?:(?:sherpya-){0,1}svn)(?:-|\s)(r\d+(?:-\d+[\w\.-]+){0,1})/i], [n, a], [/(mplayer)(?:\s|\/)((\d+)[\w\.-]+)/i, /(mplayer) unknown-((\d+)[\w\.\-]+)/i], [n, a, e], [/(mplayer)/i, /(yourmuze)/i, /(media player classic|nero showtime)/i], [n], [/(nero (?:home|scout))\/((\d+)[\w\.-]+)/i], [n, a, e], [/(nokia\d+)\/((\d+)[\w\.-]+)/i], [n, a, e], [/\s(songbird)\/((\d+)[\w\.-]+)/i], [n, a, e], [/(winamp)3 version ((\d+)[\w\.-]+)/i, /(winamp)\s((\d+)[\w\.-]+)/i, /(winamp)mpeg\/((\d+)[\w\.-]+)/i], [n, a, e], [/(ocms-bot|tapinradio|tunein radio|unknown|winamp|inlight radio)/i], [n], [/(quicktime|rma|radioapp|radioclientapplication|soundtap|totem|stagefright|streamium)\/((\d+)[\w\.-]+)/i], [n, a, e], [/(smp)((\d+)[\d\.]+)/i], [n, a, e], [/(vlc) media player - version ((\d+)[\w\.]+)/i, /(vlc)\/((\d+)[\w\.-]+)/i, /(xbmc|gvfs|xine|xmms|irapp)\/((\d+)[\w\.-]+)/i, /(foobar2000)\/((\d+)[\d\.]+)/i, /(itunes)\/((\d+)[\d\.]+)/i], [n, a, e], [/(wmplayer)\/((\d+)[\w\.-]+)/i, /(windows-media-player)\/((\d+)[\w\.-]+)/i], [[n, /-/g, " "], a, e], [/windows\/((\d+)[\w\.-]+) upnp\/[\d\.]+ dlnadoc\/[\d\.]+ (home media server)/i], [a, e, [n, "Windows"]], [/(com\.riseupradioalarm)\/((\d+)[\d\.]*)/i], [n, a, e], [/(rad.io)\s((\d+)[\d\.]+)/i, /(radio.(?:de|at|fr))\s((\d+)[\d\.]+)/i], [[n, "rad.io"], a, e]],
  1430. cpu: [[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i], [[s, "amd64"]], [/(ia32(?=;))/i], [[s, g.lowerize]], [/((?:i[346]|x)86)[;\)]/i], [[s, "ia32"]], [/windows\s(ce|mobile);\sppc;/i], [[s, "arm"]], [/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i], [[s, /ower/, "", g.lowerize]], [/(sun4\w)[;\)]/i], [[s, "sparc"]], [/(ia64(?=;)|68k(?=\))|arm(?=v\d+;)|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i], [s, g.lowerize]],
  1431. device: [[/\((ipad|playbook);[\w\s\);-]+(rim|apple)/i], [t, o, [r, h]], [/applecoremedia\/[\w\.]+ \((ipad)/], [t, [o, "Apple"], [r, h]], [/(apple\s{0,1}tv)/i], [[t, "Apple TV"], [o, "Apple"]], [/(hp).+(touchpad)/i, /(kindle)\/([\w\.]+)/i, /\s(nook)[\w\s]+build\/(\w+)/i, /(dell)\s(strea[kpr\s\d]*[\dko])/i], [o, t, [r, h]], [/\((ip[honed|\s\w*]+);.+(apple)/i], [t, o, [r, c]], [/\((ip[honed|\s\w*]+);/i], [t, [o, "Apple"], [r, c]], [/(blackberry)[\s-]?(\w+)/i, /(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|huawei|meizu|motorola)[\s_-]?([\w-]+)*/i, /(hp)\s([\w\s]+\w)/i, /(asus)-?(\w+)/i], [o, t, [r, c]], [/\((bb10);\s(\w+)/i], [[o, "BlackBerry"], t, [r, c]], [/android.+((transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+))/i], [[o, "Asus"], t, [r, h]], [/(sony)\s(tablet\s[ps])/i], [o, t, [r, h]], [/(nintendo)\s([wids3u]+)/i], [o, t, [r, l]], [/((playstation)\s[3portablevi]+)/i], [[o, "Sony"], t, [r, l]], [/(sprint\s(\w+))/i], [[o, m.str, v.device.sprint.vendor], [t, m.str, v.device.sprint.model], [r, c]], [/(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i, /(zte)-(\w+)*/i, /(alcatel|geeksphone|huawei|lenovo|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]+)*/i], [o, [t, /_/g, " "], [r, c]], [/\s((milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?(:?\s4g)?))[\w\s]+build\//i, /(mot)[\s-]?(\w+)*/i], [[o, "Motorola"], t, [r, c]], [/android.+\s((mz60\d|xoom[\s2]{0,2}))\sbuild\//i], [[o, "Motorola"], t, [r, h]], [/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n8000|sgh-t8[56]9))/i], [[o, "Samsung"], t, [r, h]], [/((s[cgp]h-\w+|gt-\w+|galaxy\snexus))/i, /(sam[sung]*)[\s-]*(\w+-?[\w-]*)*/i, /sec-((sgh\w+))/i], [[o, "Samsung"], t, [r, c]], [/(sie)-(\w+)*/i], [[o, "Siemens"], t, [r, c]], [/(maemo|nokia).*(n900|lumia\s\d+)/i, /(nokia)[\s_-]?([\w-]+)*/i], [[o, "Nokia"], t, [r, c]], [/android\s3\.[\s\w-;]{10}((a\d{3}))/i], [[o, "Acer"], t, [r, h]], [/android\s3\.[\s\w-;]{10}(lg?)-([06cv9]{3,4})/i], [[o, "LG"], t, [r, h]], [/((nexus\s[45]))/i, /(lg)[e;\s-\/]+(\w+)*/i], [[o, "LG"], t, [r, c]], [/android.+((ideatab[a-z0-9\-\s]+))/i], [[o, "Lenovo"], t, [r, h]], [/(lg) netcast\.tv/i], [o, [r, "smarttv"]], [/(mobile|tablet);.+rv\:.+gecko\//i], [r, o, t]],
  1432. engine: [[/(presto)\/([\w\.]+)/i, /(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i, /(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i, /(icab)[\/\s]([23]\.[\d\.]+)/i], [n, a], [/rv\:([\w\.]+).*(gecko)/i], [a, n]],
  1433. os: [[/microsoft\s(windows)\s(vista|xp)/i], [n, a], [/(windows)\snt\s6\.2;\s(arm)/i, /(windows\sphone(?:\sos)*|windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i], [n, [a, m.str, v.os.windows.version]], [/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i], [[n, "Windows"], [a, m.str, v.os.windows.version]], [/\((bb)(10);/i], [[n, "BlackBerry"], a], [/(blackberry)\w*\/?([\w\.]+)*/i, /(tizen)\/([\w\.]+)/i, /(android|webos|palm\os|qnx|bada|rim\stablet\sos|meego)[\/\s-]?([\w\.]+)*/i], [n, a], [/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i], [[n, "Symbian"], a], [/mozilla.+\(mobile;.+gecko.+firefox/i], [[n, "Firefox OS"], a], [/(nintendo|playstation)\s([wids3portablevu]+)/i, /(mint)[\/\s\(]?(\w+)*/i, /(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk)[\/\s-]?([\w\.-]+)*/i, /(hurd|linux)\s?([\w\.]+)*/i, /(gnu)\s?([\w\.]+)*/i], [n, a], [/(cros)\s[\w]+\s([\w\.]+\w)/i], [[n, "Chromium OS"], a], [/(sunos)\s?([\w\.]+\d)*/i], [[n, "Solaris"], a], [/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i], [n, a], [/(ip[honead]+)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i], [[n, "iOS"], [a, /_/g, "."]], [/(mac\sos\sx)\s?([\w\s\.]+\w)*/i], [n, [a, /_/g, "."]], [/(haiku)\s(\w+)/i, /(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i, /(macintosh|mac(?=_powerpc)|plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos)/i, /(unix)\s?([\w\.]+)*/i], [n, a]]
  1434. }
  1435. , A = function(e) {
  1436. var t = e || (i && i.navigator && i.navigator.userAgent ? i.navigator.userAgent : "");
  1437. return this instanceof A ? (this.getBrowser = function() {
  1438. return m.rgx.apply(this, y.browser)
  1439. }
  1440. ,
  1441. this.getCPU = function() {
  1442. return m.rgx.apply(this, y.cpu)
  1443. }
  1444. ,
  1445. this.getDevice = function() {
  1446. return m.rgx.apply(this, y.device)
  1447. }
  1448. ,
  1449. this.getEngine = function() {
  1450. return m.rgx.apply(this, y.engine)
  1451. }
  1452. ,
  1453. this.getOS = function() {
  1454. return m.rgx.apply(this, y.os)
  1455. }
  1456. ,
  1457. this.getResult = function() {
  1458. return {
  1459. ua: this.getUA(),
  1460. browser: this.getBrowser(),
  1461. engine: this.getEngine(),
  1462. os: this.getOS(),
  1463. device: this.getDevice(),
  1464. cpu: this.getCPU()
  1465. }
  1466. }
  1467. ,
  1468. this.getUA = function() {
  1469. return t
  1470. }
  1471. ,
  1472. this.setUA = function(e) {
  1473. return t = e,
  1474. this
  1475. }
  1476. ,
  1477. void this.setUA(t)) : new A(e).getResult()
  1478. };
  1479. if (typeof exports != p)
  1480. typeof module != p && module.exports && (exports = module.exports = A),
  1481. exports.UAParser = A;
  1482. else if (i.UAParser = A,
  1483. typeof define == d && define.amd && define(function() {
  1484. return A
  1485. }),
  1486. typeof i.jQuery != p) {
  1487. var C = i.jQuery
  1488. , I = new A;
  1489. C.ua = I.getResult(),
  1490. C.ua.get = function() {
  1491. return I.getUA()
  1492. }
  1493. ,
  1494. C.ua.set = function(e) {
  1495. I.setUA(e);
  1496. var t = I.getResult();
  1497. for (var i in t)
  1498. C.ua[i] = t[i]
  1499. }
  1500. }
  1501. }(this),
  1502. window.Modernizr = function(e, t) {
  1503. function i(e, t) {
  1504. return typeof e === t
  1505. }
  1506. var n, r, o, a = {}, s = t.documentElement, l = t.createElement("modernizr"), c = l.style, h = {}, u = [], d = u.slice, p = {}.hasOwnProperty;
  1507. for (var f in r = i(p, "undefined") || i(p.call, "undefined") ? function(e, t) {
  1508. return t in e && i(e.constructor.prototype[t], "undefined")
  1509. }
  1510. : function(e, t) {
  1511. return p.call(e, t)
  1512. }
  1513. ,
  1514. Function.prototype.bind || (Function.prototype.bind = function(n) {
  1515. var r = this;
  1516. if ("function" != typeof r)
  1517. throw new TypeError;
  1518. var o = d.call(arguments, 1)
  1519. , a = function() {
  1520. if (this instanceof a) {
  1521. function e() {}
  1522. e.prototype = r.prototype;
  1523. var t = new e
  1524. , i = r.apply(t, o.concat(d.call(arguments)));
  1525. return Object(i) === i ? i : t
  1526. }
  1527. return r.apply(n, o.concat(d.call(arguments)))
  1528. };
  1529. return a
  1530. }
  1531. ),
  1532. h.webgl = function() {
  1533. return !!e.WebGLRenderingContext
  1534. }
  1535. ,
  1536. h)
  1537. r(h, f) && (n = f.toLowerCase(),
  1538. a[n] = h[f](),
  1539. u.push((a[n] ? "" : "no-") + n));
  1540. return a.addTest = function(e, t) {
  1541. if ("object" == typeof e)
  1542. for (var i in e)
  1543. r(e, i) && a.addTest(i, e[i]);
  1544. else {
  1545. if (e = e.toLowerCase(),
  1546. void 0 !== a[e])
  1547. return a;
  1548. t = "function" == typeof t ? t() : t,
  1549. "undefined" != typeof enableClasses && enableClasses && (s.className += " " + (t ? "" : "no-") + e),
  1550. a[e] = t
  1551. }
  1552. return a
  1553. }
  1554. ,
  1555. o = "",
  1556. c.cssText = o,
  1557. l = null,
  1558. a._version = "2.8.2",
  1559. a
  1560. }(this, this.document),
  1561. function(xe, e, Se) {
  1562. "use strict";
  1563. function Me(s, e, n) {
  1564. function a(e) {
  1565. var t = Q.length;
  1566. if (G.old = xe.extend({}, G),
  1567. H = V ? 0 : k[F.horizontal ? "width" : "height"](),
  1568. Y = W[F.horizontal ? "width" : "height"](),
  1569. z = V ? s : U[F.horizontal ? "outerWidth" : "outerHeight"](),
  1570. Q.length = 0,
  1571. G.start = 0,
  1572. G.end = nt(z - H, 0),
  1573. le) {
  1574. $.length,
  1575. J = U.children(F.itemSelector),
  1576. $.length = 0;
  1577. var h, u = Ne(U, F.horizontal ? "paddingLeft" : "paddingTop"), d = Ne(U, F.horizontal ? "paddingRight" : "paddingBottom"), i = "border-box" === xe(J).css("boxSizing"), p = "none" !== J.css("float"), f = 0, g = J.length - 1;
  1578. z = 0,
  1579. J.each(function(e, t) {
  1580. var i = xe(t)
  1581. , n = t.getBoundingClientRect()
  1582. , r = it(F.horizontal ? n.width || n.right - n.left : n.height || n.bottom - n.top)
  1583. , o = Ne(i, F.horizontal ? "marginLeft" : "marginTop")
  1584. , a = Ne(i, F.horizontal ? "marginRight" : "marginBottom")
  1585. , s = r + o + a
  1586. , l = !o || !a
  1587. , c = {};
  1588. c.el = t,
  1589. c.size = l ? r : s,
  1590. c.half = c.size / 2,
  1591. c.start = z + (l ? o : 0),
  1592. c.center = c.start - it(H / 2 - c.size / 2),
  1593. c.end = c.start - H + c.size,
  1594. e || (z += u),
  1595. z += s,
  1596. F.horizontal || p || a && o && 0 < e && (z -= rt(o, a)),
  1597. e === g && (c.end += d,
  1598. z += d,
  1599. f = l ? a : 0),
  1600. $.push(c),
  1601. h = c
  1602. }),
  1603. U[0].style[F.horizontal ? "width" : "height"] = (i ? z : z - u - d) + "px",
  1604. z -= f,
  1605. $.length ? (G.start = $[0][ae ? "center" : "start"],
  1606. G.end = ae ? h.center : H < z ? h.end : G.start) : G.start = G.end = 0
  1607. }
  1608. if (G.center = it(G.end / 2 + G.start / 2),
  1609. v(),
  1610. j.length && 0 < Y && (F.dynamicHandle ? (q = Fe(q = G.start === G.end ? Y : it(Y * H / z), F.minHandleSize, Y),
  1611. j[0].style[F.horizontal ? "width" : "height"] = q + "px") : q = j[F.horizontal ? "outerWidth" : "outerHeight"](),
  1612. X.end = Y - q,
  1613. _e || c()),
  1614. !V && 0 < H) {
  1615. var n = G.start
  1616. , r = "";
  1617. if (le)
  1618. xe.each($, function(e, t) {
  1619. ae ? Q.push(t.center) : t.start + t.size > n && n <= G.end && (n = t.start,
  1620. Q.push(n),
  1621. (n += H) > G.end && n < G.end + H && Q.push(G.end))
  1622. });
  1623. else
  1624. for (; n - H < G.end; )
  1625. Q.push(n),
  1626. n += H;
  1627. if (Z[0] && t !== Q.length) {
  1628. for (var o = 0; o < Q.length; o++)
  1629. r += F.pageBuilder.call(B, o);
  1630. (K = Z.html(r).children()).eq(ee.activePage).addClass(F.activeClass)
  1631. }
  1632. }
  1633. if (ee.slideeSize = z,
  1634. ee.frameSize = H,
  1635. ee.sbSize = Y,
  1636. ee.handleSize = q,
  1637. le) {
  1638. e && null != F.startAt && (m(F.startAt),
  1639. B[se ? "toCenter" : "toStart"](F.startAt));
  1640. var a = $[ee.activeItem];
  1641. l(se && a ? a.center : Fe(G.dest, G.start, G.end))
  1642. } else
  1643. e ? null != F.startAt && l(F.startAt, 1) : l(Fe(G.dest, G.start, G.end));
  1644. L("load")
  1645. }
  1646. function l(e, t, i) {
  1647. if (le && Ie.released && !i) {
  1648. var n = d(e)
  1649. , r = e > G.start && e < G.end;
  1650. se ? (r && (e = $[n.centerItem].center),
  1651. ae && F.activateMiddle && m(n.centerItem)) : r && (e = $[n.firstItem].start)
  1652. }
  1653. Ie.init && Ie.slidee && F.elasticBounds ? e > G.end ? e = G.end + (e - G.end) / 6 : e < G.start && (e = G.start + (e - G.start) / 6) : e = Fe(e, G.start, G.end),
  1654. Ae.start = +new Date,
  1655. Ae.time = 0,
  1656. Ae.from = G.cur,
  1657. Ae.to = e,
  1658. Ae.delta = e - G.cur,
  1659. Ae.tweesing = Ie.tweese || Ie.init && !Ie.slidee,
  1660. Ae.immediate = !Ae.tweesing && (t || Ie.init && Ie.slidee || !F.speed),
  1661. Ie.tweese = 0,
  1662. e !== G.dest && (G.dest = e,
  1663. L("change"),
  1664. _e || o()),
  1665. g(),
  1666. v(),
  1667. p(),
  1668. K[0] && ye.page !== ee.activePage && (ye.page = ee.activePage,
  1669. K.removeClass(F.activeClass).eq(ee.activePage).addClass(F.activeClass),
  1670. L("activePage", ye.page))
  1671. }
  1672. function o() {
  1673. if (B.initialized) {
  1674. if (!_e)
  1675. return _e = Ge(o),
  1676. void (Ie.released && L("moveStart"));
  1677. Ae.immediate ? G.cur = Ae.to : Ae.tweesing ? (Ae.tweeseDelta = Ae.to - G.cur,
  1678. $e(Ae.tweeseDelta) < .1 ? G.cur = Ae.to : G.cur += Ae.tweeseDelta * (Ie.released ? F.swingSpeed : F.syncSpeed)) : (Ae.time = rt(+new Date - Ae.start, F.speed),
  1679. G.cur = Ae.from + Ae.delta * xe.easing[F.easing](Ae.time / F.speed, Ae.time, 0, 1, F.speed)),
  1680. Ae.to === G.cur ? (G.cur = Ae.to,
  1681. Ie.tweese = _e = 0) : _e = Ge(o),
  1682. L("move"),
  1683. V || (Ve ? U[0].style[Ve] = ke + (F.horizontal ? "translateX" : "translateY") + "(" + -G.cur + "px)" : U[0].style[F.horizontal ? "left" : "top"] = -it(G.cur) + "px"),
  1684. !_e && Ie.released && L("moveEnd"),
  1685. c()
  1686. }
  1687. }
  1688. function c() {
  1689. j.length && (X.cur = G.start === G.end ? 0 : ((Ie.init && !Ie.slidee ? G.dest : G.cur) - G.start) / (G.end - G.start) * X.end,
  1690. X.cur = Fe(it(X.cur), X.start, X.end),
  1691. ye.hPos !== X.cur && (ye.hPos = X.cur,
  1692. Ve ? j[0].style[Ve] = ke + (F.horizontal ? "translateX" : "translateY") + "(" + X.cur + "px)" : j[0].style[F.horizontal ? "left" : "top"] = X.cur + "px"))
  1693. }
  1694. function t() {
  1695. Ce.speed && G.cur !== (0 < Ce.speed ? G.end : G.start) || B.stop(),
  1696. Te = Ie.init ? Ge(t) : 0,
  1697. Ce.now = +new Date,
  1698. Ce.pos = G.cur + (Ce.now - Ce.lastTime) / 1e3 * Ce.speed,
  1699. l(Ie.init ? Ce.pos : it(Ce.pos)),
  1700. Ie.init || G.cur !== G.dest || L("moveEnd"),
  1701. Ce.lastTime = Ce.now
  1702. }
  1703. function i(e, t, i) {
  1704. if ("boolean" === Re(t) && (i = t,
  1705. t = Se),
  1706. t === Se)
  1707. l(G[e], i);
  1708. else {
  1709. if (se && "center" !== e)
  1710. return;
  1711. var n = B.getPos(t);
  1712. n && l(n[e], i, !se)
  1713. }
  1714. }
  1715. function h(e) {
  1716. return null != e ? De(e) ? 0 <= e && e < $.length ? e : -1 : J.index(e) : -1
  1717. }
  1718. function u(e) {
  1719. return h(De(e) && e < 0 ? e + $.length : e)
  1720. }
  1721. function m(e, t) {
  1722. var i = h(e);
  1723. return !(!le || i < 0) && (ye.active === i && !t || (J.eq(ee.activeItem).removeClass(F.activeClass),
  1724. J.eq(i).addClass(F.activeClass),
  1725. ye.active = ee.activeItem = i,
  1726. p(),
  1727. L("active", i)),
  1728. i)
  1729. }
  1730. function d(e) {
  1731. e = Fe(De(e) ? e : G.dest, G.start, G.end);
  1732. var t = {}
  1733. , i = ae ? 0 : H / 2;
  1734. if (!V)
  1735. for (var n = 0, r = Q.length; n < r; n++) {
  1736. if (e >= G.end || n === Q.length - 1) {
  1737. t.activePage = Q.length - 1;
  1738. break
  1739. }
  1740. if (e <= Q[n] + i) {
  1741. t.activePage = n;
  1742. break
  1743. }
  1744. }
  1745. if (le) {
  1746. for (var o = !1, a = !1, s = !1, l = 0, c = $.length; l < c; l++)
  1747. if (!1 === o && e <= $[l].start + $[l].half && (o = l),
  1748. !1 === s && e <= $[l].center + $[l].half && (s = l),
  1749. l === c - 1 || e <= $[l].end + $[l].half) {
  1750. a = l;
  1751. break
  1752. }
  1753. t.firstItem = De(o) ? o : 0,
  1754. t.centerItem = De(s) ? s : t.firstItem,
  1755. t.lastItem = De(a) ? a : t.centerItem
  1756. }
  1757. return t
  1758. }
  1759. function v(e) {
  1760. xe.extend(ee, d(e))
  1761. }
  1762. function p() {
  1763. var e = G.dest <= G.start
  1764. , t = G.dest >= G.end
  1765. , i = (e ? 1 : 0) | (t ? 2 : 0);
  1766. if (ye.slideePosState !== i && (ye.slideePosState = i,
  1767. ge.is("button,input") && ge.prop("disabled", e),
  1768. me.is("button,input") && me.prop("disabled", t),
  1769. ge.add(de)[e ? "addClass" : "removeClass"](F.disabledClass),
  1770. me.add(ue)[t ? "addClass" : "removeClass"](F.disabledClass)),
  1771. ye.fwdbwdState !== i && Ie.released && (ye.fwdbwdState = i,
  1772. de.is("button,input") && de.prop("disabled", e),
  1773. ue.is("button,input") && ue.prop("disabled", t)),
  1774. le && null != ee.activeItem) {
  1775. var n = 0 === ee.activeItem
  1776. , r = ee.activeItem >= $.length - 1
  1777. , o = (n ? 1 : 0) | (r ? 2 : 0);
  1778. ye.itemsButtonState !== o && (ye.itemsButtonState = o,
  1779. pe.is("button,input") && pe.prop("disabled", n),
  1780. fe.is("button,input") && fe.prop("disabled", r),
  1781. pe[n ? "addClass" : "removeClass"](F.disabledClass),
  1782. fe[r ? "addClass" : "removeClass"](F.disabledClass))
  1783. }
  1784. }
  1785. function r(e, t, i) {
  1786. if (e = u(e),
  1787. t = u(t),
  1788. -1 < e && -1 < t && e !== t && (!i || t !== e - 1) && (i || t !== e + 1)) {
  1789. J.eq(e)[i ? "insertAfter" : "insertBefore"]($[t].el);
  1790. var n = e < t ? e : i ? t : t - 1
  1791. , r = t < e ? e : i ? t + 1 : t
  1792. , o = t < e;
  1793. null != ee.activeItem && (e === ee.activeItem ? ye.active = ee.activeItem = i ? o ? t + 1 : t : o ? t : t - 1 : ee.activeItem > n && ee.activeItem < r && (ye.active = ee.activeItem += o ? 1 : -1)),
  1794. a()
  1795. }
  1796. }
  1797. function f(e, t) {
  1798. for (var i = 0, n = ve[e].length; i < n; i++)
  1799. if (ve[e][i] === t)
  1800. return i;
  1801. return -1
  1802. }
  1803. function g() {
  1804. Ie.released && !B.isPaused && B.resume()
  1805. }
  1806. function y(e) {
  1807. return it(Fe(e, X.start, X.end) / X.end * (G.end - G.start)) + G.start
  1808. }
  1809. function A() {
  1810. Ie.history[0] = Ie.history[1],
  1811. Ie.history[1] = Ie.history[2],
  1812. Ie.history[2] = Ie.history[3],
  1813. Ie.history[3] = Ie.delta
  1814. }
  1815. function C(e) {
  1816. Ie.released = 0,
  1817. Ie.source = e,
  1818. Ie.slidee = "slidee" === e
  1819. }
  1820. function I(e) {
  1821. var t = "touchstart" === e.type
  1822. , i = e.data.source
  1823. , n = "slidee" === i;
  1824. Ie.init || !t && b(e.target) || !("handle" !== i || F.dragHandle && X.start !== X.end) || n && !(t ? F.touchDragging : F.mouseDragging && e.which < 2) || (t || Pe(e),
  1825. C(i),
  1826. Ie.init = 0,
  1827. Ie.$source = xe(e.target),
  1828. Ie.touch = t,
  1829. Ie.pointer = t ? e.originalEvent.touches[0] : e,
  1830. Ie.initX = Ie.pointer.pageX,
  1831. Ie.initY = Ie.pointer.pageY,
  1832. Ie.initPos = n ? G.cur : X.cur,
  1833. Ie.start = +new Date,
  1834. Ie.time = 0,
  1835. Ie.path = 0,
  1836. Ie.delta = 0,
  1837. Ie.locked = 0,
  1838. Ie.history = [0, 0, 0, 0],
  1839. Ie.pathToLock = n ? t ? 30 : 10 : 0,
  1840. We.on(t ? qe : Ye, E),
  1841. B.pause(1),
  1842. (n ? U : j).addClass(F.draggedClass),
  1843. L("moveStart"),
  1844. n && (be = setInterval(A, 10)))
  1845. }
  1846. function E(e) {
  1847. if (Ie.released = "mouseup" === e.type || "touchend" === e.type,
  1848. Ie.pointer = Ie.touch ? e.originalEvent[Ie.released ? "changedTouches" : "touches"][0] : e,
  1849. Ie.pathX = Ie.pointer.pageX - Ie.initX,
  1850. Ie.pathY = Ie.pointer.pageY - Ie.initY,
  1851. Ie.path = et(tt(Ie.pathX, 2) + tt(Ie.pathY, 2)),
  1852. Ie.delta = F.horizontal ? Ie.pathX : Ie.pathY,
  1853. Ie.released || !(Ie.path < 1)) {
  1854. if (!Ie.init) {
  1855. if (!(F.horizontal ? $e(Ie.pathX) > $e(Ie.pathY) : $e(Ie.pathX) < $e(Ie.pathY)))
  1856. return _();
  1857. Ie.init = 1
  1858. }
  1859. Pe(e),
  1860. !Ie.locked && Ie.path > Ie.pathToLock && Ie.slidee && (Ie.locked = 1,
  1861. Ie.$source.on(Ze, Oe)),
  1862. Ie.released && (_(),
  1863. F.releaseSwing && Ie.slidee && (Ie.swing = (Ie.delta - Ie.history[0]) / 40 * 300,
  1864. Ie.delta += Ie.swing,
  1865. Ie.tweese = 10 < $e(Ie.swing))),
  1866. l(Ie.slidee ? it(Ie.initPos - Ie.delta) : y(Ie.initPos + Ie.delta))
  1867. }
  1868. }
  1869. function _() {
  1870. clearInterval(be),
  1871. Ie.released = !0,
  1872. We.off(Ie.touch ? qe : Ye, E),
  1873. (Ie.slidee ? U : j).removeClass(F.draggedClass),
  1874. setTimeout(function() {
  1875. Ie.$source.off(Ze, Oe)
  1876. }),
  1877. G.cur === G.dest && Ie.init && L("moveEnd"),
  1878. B.resume(1),
  1879. Ie.init = 0
  1880. }
  1881. function b(e) {
  1882. return ~xe.inArray(e.nodeName, Qe) || xe(e).is(F.interactive)
  1883. }
  1884. function w() {
  1885. B.stop(),
  1886. We.off("mouseup", w)
  1887. }
  1888. function T(e) {
  1889. switch (Pe(e),
  1890. this) {
  1891. case ue[0]:
  1892. case de[0]:
  1893. B.moveBy(ue.is(this) ? F.moveBy : -F.moveBy),
  1894. We.on("mouseup", w);
  1895. break;
  1896. case pe[0]:
  1897. B.prev();
  1898. break;
  1899. case fe[0]:
  1900. B.next();
  1901. break;
  1902. case ge[0]:
  1903. B.prevPage();
  1904. break;
  1905. case me[0]:
  1906. B.nextPage()
  1907. }
  1908. }
  1909. function x(e) {
  1910. e.originalEvent[He] = B;
  1911. var t = +new Date;
  1912. if (ot + F.scrollHijack > t && ce[0] !== document && ce[0] !== window)
  1913. ot = t;
  1914. else if (F.scrollBy && G.start !== G.end) {
  1915. var i = function(e) {
  1916. return Ee.curDelta = (F.horizontal ? e.deltaY || e.deltaX : e.deltaY) || -e.wheelDelta,
  1917. Ee.curDelta /= 1 === e.deltaMode ? 3 : 100,
  1918. le ? (Ue = +new Date,
  1919. Ee.last < Ue - Ee.resetTime && (Ee.delta = 0),
  1920. Ee.last = Ue,
  1921. Ee.delta += Ee.curDelta,
  1922. $e(Ee.delta) < 1 ? Ee.finalDelta = 0 : (Ee.finalDelta = it(Ee.delta / 1),
  1923. Ee.delta %= 1),
  1924. Ee.finalDelta) : Ee.curDelta
  1925. }(e.originalEvent);
  1926. (F.scrollTrap || 0 < i && G.dest < G.end || i < 0 && G.dest > G.start) && Pe(e, 1),
  1927. B.slideBy(F.scrollBy * i)
  1928. }
  1929. }
  1930. function S(e) {
  1931. F.clickBar && e.target === W[0] && (Pe(e),
  1932. l(y((F.horizontal ? e.pageX - W.offset().left : e.pageY - W.offset().top) - q / 2)))
  1933. }
  1934. function M(e) {
  1935. if (F.keyboardNavBy)
  1936. switch (e.which) {
  1937. case F.horizontal ? 37 : 38:
  1938. Pe(e),
  1939. B["pages" === F.keyboardNavBy ? "prevPage" : "prev"]();
  1940. break;
  1941. case F.horizontal ? 39 : 40:
  1942. Pe(e),
  1943. B["pages" === F.keyboardNavBy ? "nextPage" : "next"]()
  1944. }
  1945. }
  1946. function R(e) {
  1947. return b(this) ? void (e.originalEvent[He + "ignore"] = !0) : void (this.parentNode !== U[0] || e.originalEvent[He + "ignore"] || B.activate(this))
  1948. }
  1949. function P() {
  1950. this.parentNode === Z[0] && B.activatePage(K.index(this))
  1951. }
  1952. function O(e) {
  1953. F.pauseOnHover && B["mouseenter" === e.type ? "pause" : "resume"](2)
  1954. }
  1955. function L(e, t) {
  1956. if (ve[e]) {
  1957. for (N = ve[e].length,
  1958. Je.length = 0,
  1959. D = 0; D < N; D++)
  1960. Je.push(ve[e][D]);
  1961. for (D = 0; D < N; D++)
  1962. Je[D].call(B, e, t)
  1963. }
  1964. }
  1965. var D, N, F = xe.extend({}, Me.defaults, e), B = this, V = De(s), k = xe(s), U = F.slidee ? xe(F.slidee).eq(0) : k.children().eq(0), H = 0, z = 0, G = {
  1966. start: 0,
  1967. center: 0,
  1968. end: 0,
  1969. cur: 0,
  1970. dest: 0
  1971. }, W = xe(F.scrollBar).eq(0), j = W.children().eq(0), Y = 0, q = 0, X = {
  1972. start: 0,
  1973. end: 0,
  1974. cur: 0
  1975. }, Z = xe(F.pagesBar), K = 0, Q = [], J = 0, $ = [], ee = {
  1976. firstItem: 0,
  1977. lastItem: 0,
  1978. centerItem: 0,
  1979. activeItem: null,
  1980. activePage: 0
  1981. }, te = new Be(k[0]), ie = new Be(U[0]), ne = new Be(W[0]), re = new Be(j[0]), oe = "basic" === F.itemNav, ae = "forceCentered" === F.itemNav, se = "centered" === F.itemNav || ae, le = !V && (oe || se || ae), ce = F.scrollSource ? xe(F.scrollSource) : k, he = F.dragSource ? xe(F.dragSource) : k, ue = xe(F.forward), de = xe(F.backward), pe = xe(F.prev), fe = xe(F.next), ge = xe(F.prevPage), me = xe(F.nextPage), ve = {}, ye = {}, Ae = {}, Ce = {}, Ie = {
  1982. released: 1
  1983. }, Ee = {
  1984. last: 0,
  1985. delta: 0,
  1986. resetTime: 200
  1987. }, _e = 0, be = 0, we = 0, Te = 0;
  1988. V || (s = k[0]),
  1989. B.initialized = 0,
  1990. B.frame = s,
  1991. B.slidee = U[0],
  1992. B.pos = G,
  1993. B.rel = ee,
  1994. B.items = $,
  1995. B.pages = Q,
  1996. B.isPaused = 0,
  1997. B.options = F,
  1998. B.dragging = Ie,
  1999. B.reload = function() {
  2000. a()
  2001. }
  2002. ,
  2003. B.getPos = function(e) {
  2004. if (le) {
  2005. var t = h(e);
  2006. return -1 !== t && $[t]
  2007. }
  2008. var i = U.find(e).eq(0);
  2009. if (i[0]) {
  2010. var n = F.horizontal ? i.offset().left - U.offset().left : i.offset().top - U.offset().top
  2011. , r = i[F.horizontal ? "outerWidth" : "outerHeight"]();
  2012. return {
  2013. start: n,
  2014. center: n - H / 2 + r / 2,
  2015. end: n - H + r,
  2016. size: r
  2017. }
  2018. }
  2019. return !1
  2020. }
  2021. ,
  2022. B.moveBy = function(e) {
  2023. Ce.speed = e,
  2024. !Ie.init && Ce.speed && G.cur !== (0 < Ce.speed ? G.end : G.start) && (Ce.lastTime = +new Date,
  2025. Ce.startPos = G.cur,
  2026. C("button"),
  2027. Ie.init = 1,
  2028. L("moveStart"),
  2029. ze(Te),
  2030. t())
  2031. }
  2032. ,
  2033. B.stop = function() {
  2034. "button" === Ie.source && (Ie.init = 0,
  2035. Ie.released = 1)
  2036. }
  2037. ,
  2038. B.prev = function() {
  2039. B.activate(null == ee.activeItem ? 0 : ee.activeItem - 1)
  2040. }
  2041. ,
  2042. B.next = function() {
  2043. B.activate(null == ee.activeItem ? 0 : ee.activeItem + 1)
  2044. }
  2045. ,
  2046. B.prevPage = function() {
  2047. B.activatePage(ee.activePage - 1)
  2048. }
  2049. ,
  2050. B.nextPage = function() {
  2051. B.activatePage(ee.activePage + 1)
  2052. }
  2053. ,
  2054. B.slideBy = function(e, t) {
  2055. e && (le ? B[se ? "toCenter" : "toStart"](Fe((se ? ee.centerItem : ee.firstItem) + F.scrollBy * e, 0, $.length)) : l(G.dest + e, t))
  2056. }
  2057. ,
  2058. B.slideTo = function(e, t) {
  2059. l(e, t)
  2060. }
  2061. ,
  2062. B.toStart = function(e, t) {
  2063. i("start", e, t)
  2064. }
  2065. ,
  2066. B.toEnd = function(e, t) {
  2067. i("end", e, t)
  2068. }
  2069. ,
  2070. B.toCenter = function(e, t) {
  2071. i("center", e, t)
  2072. }
  2073. ,
  2074. B.getIndex = h,
  2075. B.activate = function(e, t) {
  2076. var i = m(e);
  2077. F.smart && !1 !== i && (se ? B.toCenter(i, t) : i >= ee.lastItem ? B.toStart(i, t) : i <= ee.firstItem ? B.toEnd(i, t) : g())
  2078. }
  2079. ,
  2080. B.activatePage = function(e, t) {
  2081. De(e) && l(Q[Fe(e, 0, Q.length - 1)], t)
  2082. }
  2083. ,
  2084. B.resume = function(e) {
  2085. F.cycleBy && F.cycleInterval && ("items" !== F.cycleBy || $[0] && null != ee.activeItem) && !(e < B.isPaused) && (B.isPaused = 0,
  2086. we ? we = clearTimeout(we) : L("resume"),
  2087. we = setTimeout(function() {
  2088. switch (L("cycle"),
  2089. F.cycleBy) {
  2090. case "items":
  2091. B.activate(ee.activeItem >= $.length - 1 ? 0 : ee.activeItem + 1);
  2092. break;
  2093. case "pages":
  2094. B.activatePage(ee.activePage >= Q.length - 1 ? 0 : ee.activePage + 1)
  2095. }
  2096. }, F.cycleInterval))
  2097. }
  2098. ,
  2099. B.pause = function(e) {
  2100. e < B.isPaused || (B.isPaused = e || 100,
  2101. we && (we = clearTimeout(we),
  2102. L("pause")))
  2103. }
  2104. ,
  2105. B.toggle = function() {
  2106. B[we ? "pause" : "resume"]()
  2107. }
  2108. ,
  2109. B.set = function(e, t) {
  2110. xe.isPlainObject(e) ? xe.extend(F, e) : F.hasOwnProperty(e) && (F[e] = t)
  2111. }
  2112. ,
  2113. B.add = function(e, t) {
  2114. var i = xe(e);
  2115. le ? (null == t || !$[0] || t >= $.length ? i.appendTo(U) : $.length && i.insertBefore($[t].el),
  2116. null != ee.activeItem && t <= ee.activeItem && (ye.active = ee.activeItem += i.length)) : U.append(i),
  2117. a()
  2118. }
  2119. ,
  2120. B.remove = function(e) {
  2121. if (le) {
  2122. var t = u(e);
  2123. if (-1 < t) {
  2124. J.eq(t).remove();
  2125. var i = t === ee.activeItem;
  2126. null != ee.activeItem && t < ee.activeItem && (ye.active = --ee.activeItem),
  2127. a(),
  2128. i && (ye.active = null,
  2129. B.activate(ee.activeItem))
  2130. }
  2131. } else
  2132. xe(e).remove(),
  2133. a()
  2134. }
  2135. ,
  2136. B.moveAfter = function(e, t) {
  2137. r(e, t, 1)
  2138. }
  2139. ,
  2140. B.moveBefore = function(e, t) {
  2141. r(e, t)
  2142. }
  2143. ,
  2144. B.on = function(e, t) {
  2145. if ("object" === Re(e))
  2146. for (var i in e)
  2147. e.hasOwnProperty(i) && B.on(i, e[i]);
  2148. else if ("function" === Re(t))
  2149. for (var n = e.split(" "), r = 0, o = n.length; r < o; r++)
  2150. ve[n[r]] = ve[n[r]] || [],
  2151. -1 === f(n[r], t) && ve[n[r]].push(t);
  2152. else if ("array" === Re(t))
  2153. for (var a = 0, s = t.length; a < s; a++)
  2154. B.on(e, t[a])
  2155. }
  2156. ,
  2157. B.one = function(t, i) {
  2158. B.on(t, function e() {
  2159. i.apply(B, arguments),
  2160. B.off(t, e)
  2161. })
  2162. }
  2163. ,
  2164. B.off = function(e, t) {
  2165. if (t instanceof Array)
  2166. for (var i = 0, n = t.length; i < n; i++)
  2167. B.off(e, t[i]);
  2168. else
  2169. for (var r = e.split(" "), o = 0, a = r.length; o < a; o++)
  2170. if (ve[r[o]] = ve[r[o]] || [],
  2171. null == t)
  2172. ve[r[o]].length = 0;
  2173. else {
  2174. var s = f(r[o], t);
  2175. -1 !== s && ve[r[o]].splice(s, 1)
  2176. }
  2177. }
  2178. ,
  2179. B.destroy = function() {
  2180. return ce.add(j).add(W).add(Z).add(ue).add(de).add(pe).add(fe).add(ge).add(me).off("." + He),
  2181. We.off("keydown", M),
  2182. pe.add(fe).add(ge).add(me).removeClass(F.disabledClass),
  2183. J && null != ee.activeItem && J.eq(ee.activeItem).removeClass(F.activeClass),
  2184. Z.empty(),
  2185. V || (k.off("." + He),
  2186. te.restore(),
  2187. ie.restore(),
  2188. ne.restore(),
  2189. re.restore(),
  2190. xe.removeData(s, He)),
  2191. $.length = Q.length = 0,
  2192. ye = {},
  2193. B.initialized = 0,
  2194. B
  2195. }
  2196. ,
  2197. B.init = function() {
  2198. if (!B.initialized) {
  2199. B.on(n);
  2200. var e = ["overflow", "position"]
  2201. , t = ["position", "webkitTransform", "msTransform", "transform", "left", "top", "width", "height"];
  2202. te.save.apply(te, e),
  2203. ne.save.apply(ne, e),
  2204. ie.save.apply(ie, t),
  2205. re.save.apply(re, t);
  2206. var i = j;
  2207. return V || (i = i.add(U),
  2208. k.css("overflow", "hidden"),
  2209. Ve || "static" !== k.css("position") || k.css("position", "relative")),
  2210. Ve ? ke && i.css(Ve, ke) : ("static" === W.css("position") && W.css("position", "relative"),
  2211. i.css({
  2212. position: "absolute"
  2213. })),
  2214. F.forward && ue.on(Ke, T),
  2215. F.backward && de.on(Ke, T),
  2216. F.prev && pe.on(Ze, T),
  2217. F.next && fe.on(Ze, T),
  2218. F.prevPage && ge.on(Ze, T),
  2219. F.nextPage && me.on(Ze, T),
  2220. ce.on(Xe, x),
  2221. W[0] && W.on(Ze, S),
  2222. le && F.activateOn && k.on(F.activateOn + "." + He, "*", R),
  2223. Z[0] && F.activatePageOn && Z.on(F.activatePageOn + "." + He, "*", P),
  2224. he.on(je, {
  2225. source: "slidee"
  2226. }, I),
  2227. j && j.on(je, {
  2228. source: "handle"
  2229. }, I),
  2230. We.on("keydown", M),
  2231. V || (k.on("mouseenter." + He + " mouseleave." + He, O),
  2232. k.on("scroll." + He, Le)),
  2233. B.initialized = 1,
  2234. a(!0),
  2235. F.cycleBy && !V && B[F.startPaused ? "pause" : "resume"](),
  2236. B
  2237. }
  2238. }
  2239. }
  2240. function Re(e) {
  2241. 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
  2242. }
  2243. function Pe(e, t) {
  2244. e.preventDefault(),
  2245. t && e.stopPropagation()
  2246. }
  2247. function Oe(e) {
  2248. Pe(e, 1),
  2249. xe(this).off(e.type, Oe)
  2250. }
  2251. function Le() {
  2252. this.scrollLeft = 0,
  2253. this.scrollTop = 0
  2254. }
  2255. function De(e) {
  2256. return !isNaN(parseFloat(e)) && isFinite(e)
  2257. }
  2258. function Ne(e, t) {
  2259. return 0 | it(String(e.css(t)).replace(/[^\-0-9.]/g, ""))
  2260. }
  2261. function Fe(e, t, i) {
  2262. return e < t ? t : i < e ? i : e
  2263. }
  2264. function Be(t) {
  2265. var i = {
  2266. style: {},
  2267. save: function() {
  2268. if (t && t.nodeType) {
  2269. for (var e = 0; e < arguments.length; e++)
  2270. i.style[arguments[e]] = t.style[arguments[e]];
  2271. return i
  2272. }
  2273. },
  2274. restore: function() {
  2275. if (t && t.nodeType) {
  2276. for (var e in i.style)
  2277. i.style.hasOwnProperty(e) && (t.style[e] = i.style[e]);
  2278. return i
  2279. }
  2280. }
  2281. };
  2282. return i
  2283. }
  2284. var Ve, ke, Ue, r, o, He = "sly", ze = e.cancelAnimationFrame || e.cancelRequestAnimationFrame, Ge = e.requestAnimationFrame, We = xe(document), je = "touchstart." + He + " mousedown." + He, Ye = "mousemove." + He + " mouseup." + He, qe = "touchmove." + He + " touchend." + He, Xe = (document.implementation.hasFeature("Event.wheel", "3.0") ? "wheel." : "mousewheel.") + He, Ze = "click." + He, Ke = "mousedown." + He, Qe = ["INPUT", "SELECT", "BUTTON", "TEXTAREA"], Je = [], $e = Math.abs, et = Math.sqrt, tt = Math.pow, it = Math.round, nt = Math.max, rt = Math.min, ot = 0;
  2285. function t(e) {
  2286. for (var t = 0, i = r.length; t < i; t++) {
  2287. var n = r[t] ? r[t] + e.charAt(0).toUpperCase() + e.slice(1) : e;
  2288. if (null != o.style[n])
  2289. return n
  2290. }
  2291. }
  2292. We.on(Xe, function(e) {
  2293. var t = e.originalEvent[He]
  2294. , i = +new Date;
  2295. (!t || t.options.scrollHijack < i - ot) && (ot = i)
  2296. }),
  2297. function(t) {
  2298. Ge = t.requestAnimationFrame || t.webkitRequestAnimationFrame || function(e) {
  2299. var t = (new Date).getTime()
  2300. , i = Math.max(0, 16 - (t - r))
  2301. , n = setTimeout(e, i);
  2302. return r = t,
  2303. n
  2304. }
  2305. ;
  2306. var r = (new Date).getTime()
  2307. , i = t.cancelAnimationFrame || t.webkitCancelAnimationFrame || t.clearTimeout;
  2308. ze = function(e) {
  2309. i.call(t, e)
  2310. }
  2311. }(window),
  2312. r = ["", "webkit", "moz", "ms", "o"],
  2313. o = document.createElement("div"),
  2314. Ve = t("transform"),
  2315. ke = t("perspective") ? "translateZ(0) " : "",
  2316. e.Sly = Me,
  2317. xe.fn.sly = function(n, r) {
  2318. var o, a;
  2319. return xe.isPlainObject(n) || ("string" !== Re(n) && !1 !== n || (o = !1 === n ? "destroy" : n,
  2320. a = Array.prototype.slice.call(arguments, 1)),
  2321. n = {}),
  2322. this.each(function(e, t) {
  2323. var i = xe.data(t, He);
  2324. i || o ? i && o && i[o] && i[o].apply(i, a) : i = xe.data(t, He, new Me(t,n,r).init())
  2325. })
  2326. }
  2327. ,
  2328. Me.defaults = {
  2329. slidee: null,
  2330. horizontal: !1,
  2331. itemNav: null,
  2332. itemSelector: null,
  2333. smart: !1,
  2334. activateOn: null,
  2335. activateMiddle: !1,
  2336. scrollSource: null,
  2337. scrollBy: 0,
  2338. scrollHijack: 300,
  2339. scrollTrap: !1,
  2340. dragSource: null,
  2341. mouseDragging: !1,
  2342. touchDragging: !1,
  2343. releaseSwing: !1,
  2344. swingSpeed: .2,
  2345. elasticBounds: !1,
  2346. interactive: null,
  2347. scrollBar: null,
  2348. dragHandle: !1,
  2349. dynamicHandle: !1,
  2350. minHandleSize: 50,
  2351. clickBar: !1,
  2352. syncSpeed: .5,
  2353. pagesBar: null,
  2354. activatePageOn: null,
  2355. pageBuilder: function(e) {
  2356. return "<li>" + (e + 1) + "</li>"
  2357. },
  2358. forward: null,
  2359. backward: null,
  2360. prev: null,
  2361. next: null,
  2362. prevPage: null,
  2363. nextPage: null,
  2364. cycleBy: null,
  2365. cycleInterval: 5e3,
  2366. pauseOnHover: !1,
  2367. startPaused: !1,
  2368. moveBy: 300,
  2369. speed: 0,
  2370. easing: "swing",
  2371. startAt: null,
  2372. keyboardNavBy: null,
  2373. draggedClass: "dragged",
  2374. activeClass: "active",
  2375. disabledClass: "disabled"
  2376. }
  2377. }(jQuery, window),
  2378. function o(a, s, l) {
  2379. function c(i, e) {
  2380. if (!s[i]) {
  2381. if (!a[i]) {
  2382. var t = "function" == typeof require && require;
  2383. if (!e && t)
  2384. return t(i, !0);
  2385. if (h)
  2386. return h(i, !0);
  2387. var n = new Error("Cannot find module '" + i + "'");
  2388. throw n.code = "MODULE_NOT_FOUND",
  2389. n
  2390. }
  2391. var r = s[i] = {
  2392. exports: {}
  2393. };
  2394. a[i][0].call(r.exports, function(e) {
  2395. var t = a[i][1][e];
  2396. return c(t || e)
  2397. }, r, r.exports, o, a, s, l)
  2398. }
  2399. return s[i].exports
  2400. }
  2401. for (var h = "function" == typeof require && require, e = 0; e < l.length; e++)
  2402. c(l[e]);
  2403. return c
  2404. }({
  2405. 1: [function(p, f, e) {
  2406. (function(e) {
  2407. "use strict";
  2408. function t(e) {
  2409. this.player = null,
  2410. this.director = null,
  2411. this.modelManager = null,
  2412. this.container = null,
  2413. this.tagManager = null,
  2414. this.fadeInSpeed = e,
  2415. null !== this.fadeInSpeed && void 0 !== this.fadeInSpeed || (this.fadeInSpeed = 0)
  2416. }
  2417. var r = p("three")
  2418. , i = p("./util/logger")
  2419. , n = (p("./util/common"),
  2420. p("./enum/PlayerEvents"))
  2421. , o = p("./enum/DirectorEvents")
  2422. , a = p("./settings")
  2423. , s = p("./enum/Viewmode")
  2424. , l = (p("./enum/WarpStyle"),
  2425. p("./enum/BlackoutStyle"),
  2426. p("./enum/ModelManagerEvents"))
  2427. , c = p("./enum/tagEvents")
  2428. , h = p("./util/transitions")
  2429. , u = p("./util/lerp")
  2430. , d = new i(e);
  2431. window.THREE = r,
  2432. t.prototype.init = function(e, t, i, n, r) {
  2433. (window.app = this).player = t,
  2434. this.director = e,
  2435. this.modelManager = i,
  2436. this.tagManager = n,
  2437. this.container = r,
  2438. this.updateModel(),
  2439. this.bindEvents()
  2440. }
  2441. ,
  2442. t.prototype.bindEvents = function() {
  2443. this.modelManager.on(l.ActiveModelChanged, this.updateModel.bind(this)),
  2444. this.player.on(n.ModeChanging, this.handlePlayerModeChanging.bind(this)),
  2445. this.player.on(n.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  2446. this.player.on(n.ClosestPanoChanging, this.handleClosestPanoChanging.bind(this)),
  2447. this.player.on(n.StartInside, this.handleStartInside.bind(this)),
  2448. this.player.on(n.StartOutside, this.handleStartOutside.bind(this)),
  2449. this.player.on(n.WarpStarted, this.handleWarpStarted.bind(this)),
  2450. this.director.on(o.ActionInterrupted, this.handleActionInterruption.bind(this)),
  2451. this.tagManager.on(c.TagActivated, this.ontagActivated.bind(this)),
  2452. this.tagManager.on(c.TagNavigation, this.onNavigationTotag.bind(this))
  2453. }
  2454. ,
  2455. t.prototype.updateModel = function() {
  2456. this.model = this.modelManager.getActiveModel()
  2457. }
  2458. ,
  2459. t.prototype.handleWarpStarted = function() {
  2460. this.hidePlayerReticule()
  2461. }
  2462. ,
  2463. t.prototype.ontagActivated = function() {
  2464. this.hidePlayerReticule()
  2465. }
  2466. ,
  2467. t.prototype.onNavigationTotag = function() {
  2468. this.hidePlayerReticule()
  2469. }
  2470. ,
  2471. t.prototype.handlePlayerModeChanging = function(e, t, i) {
  2472. var n = this.modelManager.getActiveModel()
  2473. , r = this.player.is360View(t, i) || this.director.tourIsPlaying ? 0 : a[t].markerOpacity;
  2474. n.fadePanoMarkers(r),
  2475. n.setMode(t)
  2476. }
  2477. ,
  2478. t.prototype.handlePlayerModeChanged = function(e, t) {
  2479. var i = this.modelManager.getActiveModel()
  2480. , n = t === s.PANORAMA ? r.DoubleSide : r.FrontSide;
  2481. i.setSide(n),
  2482. i.setMode(t)
  2483. }
  2484. ,
  2485. t.prototype.handleClosestPanoChanging = function(e, t, i) {
  2486. i !== s.TRANSITIONING && (e && !this.director.tourIsPlaying && e.hoverOff(i),
  2487. t && !this.director.tourIsPlaying && t.hoverOn(i))
  2488. }
  2489. ,
  2490. t.prototype.handleActionInterruption = function() {}
  2491. ,
  2492. t.prototype.handleStartInside = function(e) {
  2493. var t = a[this.player.mode]
  2494. , i = e ? 0 : t.transitionTime * t.skyboxOpacityLength;
  2495. this.fadeIn(this.fadeInSpeed),
  2496. this.model.alpha = 0,
  2497. this.model.skybox.material.uniforms.opacity.value = 1,
  2498. this.model.fadePanoMarkers(e ? 0 : t.markerOpacity);
  2499. var n = this.player.reticule;
  2500. h.start(u.property(n.material, "opacity", 0), i, null, 0, null, "retReOpac")
  2501. }
  2502. ,
  2503. t.prototype.handleStartOutside = function(e) {
  2504. this.fadeIn(e)
  2505. }
  2506. ,
  2507. t.prototype.fadeIn = function(e) {
  2508. null != e || (e = 2e3,
  2509. d.warn("DisplayController.fadeIn -> no transition time specified, defaulting to 2000 ms.")),
  2510. $(this.container).fadeIn(e)
  2511. }
  2512. ,
  2513. t.prototype.hidePlayerReticule = function() {
  2514. this.player.reticule.hide()
  2515. }
  2516. ,
  2517. f.exports = t
  2518. }
  2519. ).call(this, "/js/DisplayController.js")
  2520. }
  2521. , {
  2522. "./enum/BlackoutStyle": 18,
  2523. "./enum/DirectorEvents": 23,
  2524. "./enum/tagEvents": 32,
  2525. "./enum/ModelManagerEvents": 33,
  2526. "./enum/PlayerEvents": 40,
  2527. "./enum/Viewmode": 51,
  2528. "./enum/WarpStyle": 52,
  2529. "./settings": 166,
  2530. "./util/common": 185,
  2531. "./util/lerp": 188,
  2532. "./util/logger": 189,
  2533. "./util/transitions": 195,
  2534. three: 217
  2535. }],
  2536. 2: [function(e, t, i) {
  2537. "use strict";
  2538. function n() {
  2539. this.baseStartTime = performance.timing.navigationStart,
  2540. this.loadingStartTime = null,
  2541. this.waitingStartTime = null,
  2542. this.appReadyTime = null
  2543. }
  2544. n.prototype.setBaseStartTime = function(e) {
  2545. this.baseStartTime = e || Date.now()
  2546. }
  2547. ,
  2548. n.prototype.setWaitingStartTime = function(e) {
  2549. this.waitingStartTime = e || Date.now()
  2550. }
  2551. ,
  2552. n.prototype.setLoadingStartTime = function(e) {
  2553. this.loadingStartTime = e || Date.now()
  2554. }
  2555. ,
  2556. n.prototype.setAppReadyTime = function(e) {
  2557. this.appReadyTime = e || Date.now()
  2558. }
  2559. ,
  2560. n.prototype.calcFullLoadingTime = function() {
  2561. var e = this.appReadyTime - this.baseStartTime;
  2562. return this.waitingStartTime && (e -= this.loadingStartTime - this.waitingStartTime),
  2563. e
  2564. }
  2565. ,
  2566. t.exports = n
  2567. }
  2568. , {}],
  2569. 3: [function(i, n, e) {
  2570. (function(e) {
  2571. "use strict";
  2572. function a() {
  2573. return 100 * Math.random()
  2574. }
  2575. var t = i("./util/logger")
  2576. , s = i("./util/browser")
  2577. , l = new t(e)
  2578. , c = window.MP_AB_TESTS = window.MP_AB_TESTS || {
  2579. initialized: !1,
  2580. init: function(e, t) {
  2581. if (t = t || {},
  2582. !this.initialized) {
  2583. for (var i in this.initialized = !0,
  2584. s.valueFromHash("tilegen") && (t.tilegen = 1 === s.valueFromHash("tilegen", 0)),
  2585. s.valueFromHash("imgopt") && (t.imgopt = 1 === s.valueFromHash("imgopt", 0)),
  2586. e) {
  2587. var n = i.match("^sc_tilegen_([0-9]+)$");
  2588. n && (c.tilegen = a() < parseInt(n[1]));
  2589. var r = i.match("^sc_imgopt_([0-9]+)$");
  2590. r && (c.imgopt = a() < parseInt(r[1]))
  2591. }
  2592. for (var o in t)
  2593. c[o] = t[o],
  2594. l.debug("A/B override:", o, c[o])
  2595. }
  2596. },
  2597. changeIfTileGenerating: function(e) {
  2598. return c.tilegen && (e += -1 === e.indexOf("?") ? "?" : "&",
  2599. e += ""),
  2600. e
  2601. },
  2602. changeIfImageOptimzing: function(e) {
  2603. if(e.includes("blob:http"))return e;//add
  2604. return c.imgopt && -1 === e.indexOf("imgopt=1") && (e += -1 === e.indexOf("?") ? "?" : "&",
  2605. e += ""),
  2606. e
  2607. },
  2608. tilegen: !1,
  2609. imgopt: !1
  2610. };
  2611. n.exports = c
  2612. }
  2613. ).call(this, "/js/ab.js")
  2614. }
  2615. , {
  2616. "./util/browser": 182,
  2617. "./util/logger": 189
  2618. }],
  2619. 4: [function(u, d, e) {
  2620. (function(e) {
  2621. "use strict";
  2622. function r(n, e, t, i) {
  2623. function r(e) {
  2624. a[e.sid] = !0;
  2625. var t = e.billboard.media && e.billboard.media.type
  2626. , i = {
  2627. tag_id: e.sid,
  2628. tags_visited: Object.keys(a).length,
  2629. tag_count: Object.keys(n.tags).length,
  2630. tag_view_count: ++d,
  2631. has_media: !!t
  2632. };
  2633. t && (i.media_type = t),
  2634. g("tag_opened", i)
  2635. }
  2636. var o, a = {}, s = Date.now() - P, l = null;
  2637. i && (l = Date.now() - window.navigationStart);
  2638. try {
  2639. o = /* n.data.player_options.highlight_reel && */ 0 < n.heroLocations.length
  2640. } catch (n) {
  2641. o = !1
  2642. }
  2643. var c, h = n.supportsVR;
  2644. h || (c = "VR disabled at the model/account level",
  2645. y.valueFromHash("vr") === w.NONE ? c = "VR disabled, using &vr=0" : y.detectAndroid() ? _.isDeviceSupported(b.Android) || (c = "VR disabled, unsupported Android version") : y.detectIOS() && (_.isDeviceSupported(b.IOS) || (c = "VR disabled, unsupported iOS version"))),
  2646. g("model_loaded", {
  2647. duration: s,
  2648. duration_from_navigation_start: l,
  2649. has_hlr: o,
  2650. has_vr: h,
  2651. vr_reason: c
  2652. });
  2653. var u = 0;
  2654. n.panos.forEach(function(e) {
  2655. e.on("enter", function() {
  2656. f("pano_viewed", {
  2657. pano_id: e.id,
  2658. pano_view_count: ++u,
  2659. alignment_type: e.alignmentType,
  2660. interaction_source: R,
  2661. navigation_source: v
  2662. })
  2663. })
  2664. });
  2665. var d = 0;
  2666. for (var p in n.tags)
  2667. n.tags[p].billboard.on(M.OPENED, r.bind(this, n.tags[p]));
  2668. e.on("tour_auto", function(e) {
  2669. v = "tour_" + e
  2670. }),
  2671. e.on("tour_manual", function(e) {
  2672. R = "gui-" + e,
  2673. v = "tour_manual"
  2674. }),
  2675. t.on(C.InteractionKey, function() {
  2676. e.mode === A.TRANSITIONING || e.flying || m(C.InteractionKey)
  2677. }),
  2678. t.on(C.InteractionDirect, function() {
  2679. e.mode === A.TRANSITIONING || e.flying || m(C.InteractionDirect)
  2680. }),
  2681. function(t) {
  2682. I.on(T.OPENED, function() {
  2683. f("showcase_share_intent", {
  2684. pano_id: t.currentPano && t.currentPano.id
  2685. })
  2686. }),
  2687. I.on(T.LINK_CLICKED, function(e) {
  2688. f("showcase_share_action", {
  2689. channel: e.channel,
  2690. pano_id: t.currentPano && t.currentPano.id
  2691. })
  2692. }),
  2693. E.on(x.ORIGIN_LINK_CLICKED, function() {
  2694. f("showcase_share_origin_link_clicked")
  2695. })
  2696. }(e),
  2697. function() {
  2698. _.on(S.OPENED, f.bind(this, "showcase_gui", {
  2699. gui_action: "click_vr_button"
  2700. })),
  2701. _.on(S.LAUNCH, function(e) {
  2702. f("showcase_gui", {
  2703. gui_action: "launch_vr",
  2704. vr_platform: e.vr_platform,
  2705. vr_app: e.vr_app
  2706. })
  2707. }),
  2708. _.on(S.PREV, f.bind(this, "showcase_gui", {
  2709. gui_action: "vr_modal_prev"
  2710. })),
  2711. _.on(S.NEXT, function(e) {
  2712. f("showcase_gui", {
  2713. gui_action: e.nextAction
  2714. })
  2715. }),
  2716. _.on(S.CLOSED, f.bind(this, "showcase_gui", {
  2717. gui_action: "vr_modal_close"
  2718. })),
  2719. _.on(S.falseICECHOSEN, function(e) {
  2720. f("showcase_gui", {
  2721. gui_action: e.name + " "
  2722. })
  2723. }),
  2724. _.on(S.STORE, function(e) {
  2725. f("showcase_gui", {
  2726. gui_action: "launch_store",
  2727. store: e
  2728. })
  2729. })
  2730. }()
  2731. }
  2732. function f(e, t) {
  2733. if (t = t || {},
  2734. i)
  2735. try {
  2736. window.analytics.track(e, s.extendObject(t, c), {
  2737. context: {
  2738. app: {
  2739. name: "showcase",
  2740. version: "2.25.6-0-gd87e5b1"
  2741. },
  2742. screen: {
  2743. width: window.screen.width,
  2744. height: window.screen.height,
  2745. density: window.devicePixelRatio
  2746. }
  2747. }
  2748. })
  2749. } catch (t) {
  2750. console.warn("Failed to send data to segment for " + e)
  2751. }
  2752. }
  2753. function g(e, t) {
  2754. f(e, t = t || {})
  2755. }
  2756. function m(e, t) {
  2757. R = e === C.InteractionGui ? "gui-" + t : e,
  2758. v = "self_guided"
  2759. }
  2760. var v, o, a = (u("three"),
  2761. u("./util/ajax"),
  2762. u("./ab")), y = u("./util/browser"), s = u("./util/common"), t = u("./settings"), A = (u("./localization/localize"),
  2763. u("./enum/Viewmode")), C = u("./enum/ControlEvents"), I = u("./gui/sharing/modal"), E = u("./gui/title/titleBar"), _ = u("./gui/vr/vrModal"), b = u("./enum/VRPlatforms"), w = u("./enum/VROption"), T = u("./gui/sharing/ShareEvents"), x = u("./gui/title/TitleEvents"), S = u("./gui/vr/vrEvent"), M = u("./tag/Billboard/BillboardEvent"), l = new (u("./util/logger"))(e), R = (u("./enum/PlayerEvents"),
  2764. "direct"), i = null, n = !1, P = null, c = null, h = s.uuid4();
  2765. d.exports = {
  2766. report: function(e, t, i, n) {
  2767. !function(e, t) {
  2768. if (o)
  2769. try {
  2770. o.addEvent(e, s.extendObject({
  2771. host: window.location.host,
  2772. keen: {
  2773. addons: [{
  2774. name: "keen:ua_parser",
  2775. input: {
  2776. ua_string: "user_agent"
  2777. },
  2778. output: "parsed_user_agent"
  2779. }]
  2780. },
  2781. user_agent: "${keen.user_agent}",
  2782. referrer: {
  2783. url: s.normalizeUrl(document.referrer),
  2784. domain: s.domainFromUrl(document.referrer),
  2785. url_original: document.referrer
  2786. },
  2787. embedded: y.inIframe(),
  2788. is_mobile: y.isMobile(),
  2789. version: "2.25.6-0-gd87e5b1"
  2790. }, t))
  2791. } catch (e) {
  2792. l.warn("analytics.report -> client.addEvent() error (is there blocking software installed?). Error message: " + e)
  2793. }
  2794. }("Session starts", {
  2795. model: e,
  2796. status: t,
  2797. loadtime: Date.now() - (P || Date.now()),
  2798. loadtime_from_navigation_start: i ? Date.now() - window.navigationStart : null,
  2799. autoplay: i,
  2800. quickstart: n,
  2801. ab_tilegen: a.tilegen,
  2802. ab_imgopt: a.imgopt
  2803. })
  2804. },
  2805. impression: function(e) {
  2806. g("impression", {
  2807. visible: void 0 === (e = e || {}).isVisible || e.isVisible,
  2808. url_params: (void 0 !== e.immediate && e.immediate,
  2809. window.location.search.substr(1).split("&"))
  2810. })
  2811. },
  2812. initKeen: function(e) {
  2813. return e.token && e.appId ? void (o = new Keen({
  2814. projectId: e.appId,
  2815. writeKey: e.token,
  2816. readKey: "",
  2817. requestType: "xhr"
  2818. })) : void l.warn("no keen token/appId")
  2819. },
  2820. initSegment: function(e) {
  2821. return e.token ? (i = e.token,
  2822. window.analytics.load(e.token),
  2823. c = {
  2824. model_id: e.model,
  2825. start_source: e.startSource,
  2826. autoplay: e.autoplay,
  2827. quickstart: e.quickstart,
  2828. language_tag: t.languageTag,
  2829. is_mobile: y.isMobile(),
  2830. iframe: y.inIframe(),
  2831. aspect_ratio: y.aspectRatio(),
  2832. session_id: h,
  2833. window: {
  2834. width: $("#player").width(),
  2835. height: $("#player").height()
  2836. },
  2837. platform: {
  2838. browser: {
  2839. name: $.ua.browser.name,
  2840. major: $.ua.browser.major,
  2841. version: $.ua.browser.version
  2842. },
  2843. os: {
  2844. name: $.ua.os.name,
  2845. version: $.ua.os.version
  2846. },
  2847. device: {
  2848. vendor: $.ua.device.vendor,
  2849. model: $.ua.device.model,
  2850. type: $.ua.device.type
  2851. }
  2852. }
  2853. },
  2854. n = Math.random() < t.analytics.sessionTrackingRate,
  2855. l.debug("tracking sample rate = " + t.analytics.sessionTrackingRate),
  2856. void l.debug("tracking this session = " + n)) : void l.warn("no segment token")
  2857. },
  2858. sessionStart: function(e) {
  2859. l.debug("analytics user_session_start"),
  2860. f("session_started"),
  2861. P = Date.now(),
  2862. window.addEventListener("unload", function() {
  2863. !function(e, t) {
  2864. if (t = t || {},
  2865. navigator.sendBeacon && i)
  2866. try {
  2867. navigator.sendBeacon("https://api.segment.io/v1/t", JSON.stringify({
  2868. event: e,
  2869. anonymousId: window.analytics.user().anonymousId(),
  2870. properties: s.extendObject(t, c),
  2871. writeKey: i,
  2872. sentAt: Date.now(),
  2873. type: "track",
  2874. context: {
  2875. userAgent: y.userAgent(),
  2876. library: {
  2877. name: "showcase-beacon",
  2878. version: "2.25.6-0-gd87e5b1"
  2879. },
  2880. app: {
  2881. name: "showcase",
  2882. version: "2.25.6-0-gd87e5b1"
  2883. }
  2884. }
  2885. }))
  2886. } catch (e) {
  2887. console.warn("Failed to send async segment request")
  2888. }
  2889. }("session_ended", {
  2890. duration: Date.now() - P
  2891. })
  2892. })
  2893. },
  2894. modelLoaded: function(e, t, i, n) {
  2895. r(e, t, i, n)
  2896. },
  2897. loadComplete: function(e) {
  2898. f("load_times", {
  2899. time_to_app_start: e
  2900. })
  2901. },
  2902. track: function(e, t) {
  2903. n && (l.debug('analytics.track("' + e + '", ' + JSON.stringify(t) + " )"),
  2904. f(e, t))
  2905. },
  2906. trackAlways: function(e, t) {
  2907. l.debug('analytics.trackAlways("' + e + '", ' + JSON.stringify(t) + " )"),
  2908. f(e, t)
  2909. },
  2910. getSessionId: function() {
  2911. return h
  2912. },
  2913. updateInteraction: m
  2914. }
  2915. }
  2916. ).call(this, "/js/analytics.js")
  2917. }
  2918. , {
  2919. "./ab": 3,
  2920. "./enum/ControlEvents": 21,
  2921. "./enum/PlayerEvents": 40,
  2922. "./enum/VROption": 47,
  2923. "./enum/VRPlatforms": 49,
  2924. "./enum/Viewmode": 51,
  2925. "./gui/sharing/ShareEvents": 76,
  2926. "./gui/sharing/modal": 77,
  2927. "./gui/title/TitleEvents": 80,
  2928. "./gui/title/titleBar": 82,
  2929. "./gui/vr/vrEvent": 85,
  2930. "./gui/vr/vrModal": 87,
  2931. "./localization/localize": 108,
  2932. "./tag/Billboard/BillboardEvent": 120,
  2933. "./settings": 166,
  2934. "./util/ajax": 181,
  2935. "./util/browser": 182,
  2936. "./util/common": 185,
  2937. "./util/logger": 189,
  2938. three: 217
  2939. }],
  2940. 5: [function(e, t, i) {
  2941. "use strict";
  2942. function n() {
  2943. r.PerspectiveCamera.call(this, a.clampVFOV(o.dollhouseFOV), $("#player").width() / $("#player").height(), o.dollhouseNear, o.dollhouseFar),
  2944. this.controls = null
  2945. }
  2946. var r = e("three")
  2947. , o = e("../constants")
  2948. , a = e("../util/cameraLight");
  2949. (n.prototype = Object.create(r.PerspectiveCamera.prototype)).updateAspect = function(e) {
  2950. this.aspect = e,
  2951. this.updateProjectionMatrix()
  2952. }
  2953. ,
  2954. t.exports = n
  2955. }
  2956. , {
  2957. "../constants": 8,
  2958. "../util/cameraLight": 184,
  2959. three: 217
  2960. }],
  2961. 6: [function(e, t, i) {
  2962. "use strict";
  2963. function n() {
  2964. var e = $("#player").width() / $("#player").height();
  2965. r.OrthographicCamera.call(this, -o.orthoBase, o.orthoBase, o.orthoBase / e, -o.orthoBase / e, o.orthoNear, o.orthoFar),
  2966. this.controls = null,
  2967. this.updateAspect(e)
  2968. }
  2969. var r = e("three")
  2970. , o = e("../constants");
  2971. (n.prototype = Object.create(r.OrthographicCamera.prototype)).updateAspect = function(e) {
  2972. this.aspect = e,
  2973. this.top = o.orthoBase / e,
  2974. this.bottom = -o.orthoBase / e,
  2975. this.updateProjectionMatrix()
  2976. }
  2977. ,
  2978. t.exports = n
  2979. }
  2980. , {
  2981. "../constants": 8,
  2982. three: 217
  2983. }],
  2984. 7: [function(e, t, i) {
  2985. "use strict";
  2986. function n() {
  2987. r.PerspectiveCamera.call(this, a.clampVFOV(o.insideFOV), $("#player").width() / $("#player").height(), o.insideNear, o.insideFar),
  2988. this.controls = null
  2989. }
  2990. var r = e("three")
  2991. , o = e("../settings")
  2992. , a = e("../util/cameraLight");
  2993. (n.prototype = Object.create(r.PerspectiveCamera.prototype)).updateAspect = function(e) {
  2994. this.aspect = e,
  2995. this.updateProjectionMatrix()
  2996. }
  2997. ,
  2998. t.exports = n
  2999. }
  3000. , {
  3001. "../settings": 166,
  3002. "../util/cameraLight": 184,
  3003. three: 217
  3004. }],
  3005. 8: [function(e, t, i) {
  3006. "use strict";
  3007. t.exports = {
  3008. signedUrlDefaultExpireTime: 24e4,
  3009. signedUrlCheckInterval: 1e4,
  3010. signedUrlRefreshBuffer: 15e3,
  3011. dollhouseFOV: 70,
  3012. dollhouseNear: .1,//1,
  3013. dollhouseFar: 5e3,
  3014. insideFOV: 70,
  3015. insideFOVMax: 120,
  3016. insideNear: .1,
  3017. insideFar: 5e3,
  3018. insideLookSpeed: .12,
  3019. insideLookLimitUp: 40,
  3020. insideLookLimitDown: -40,
  3021. orthoNear: 1,
  3022. orthoFar: 5e3,
  3023. orthoBase: 10,
  3024. narrowLandscapeHeight: 290,
  3025. reallyNarrowLandscapeHeight: 250,
  3026. visionTilingStartDate: new Date("8/26/2016"),
  3027. visionTilingStartVersion: "1.1.407.13667",
  3028. windowHeightHighQualityThreshold: 900,
  3029. tourStepDelayDefault: 3500,
  3030. tourStepDelaySlideShow: 5e3,
  3031. workshopApsect: 9 / 16,
  3032. highQualityMaxZoom: 2,
  3033. ultraHighQualityMaxZoom: 3
  3034. }
  3035. }
  3036. , {}],
  3037. 9: [function(e, t, i) {
  3038. "use strict";
  3039. function n() {
  3040. this.activeControl = null,
  3041. this.controls = {},
  3042. this.cameras = {}
  3043. }
  3044. var a = e("./PanoramaControls")
  3045. , s = e("./DollhouseControls")
  3046. , l = e("./FloorplanControls")
  3047. , c = e("../cameras/PanoramaCamera")
  3048. , h = e("../cameras/DollhouseCamera")
  3049. , u = e("../cameras/FloorplanCamera")
  3050. , r = e("events").EventEmitter
  3051. , d = e("../enum/ControlEvents")
  3052. , o = e("../enum/ModelManagerEvents")
  3053. , p = e("../enum/Viewmode")
  3054. , f = e("../settings");
  3055. (n.prototype = Object.create(r.prototype)).init = function(e, t) {
  3056. this.setUpControls(),
  3057. this.bindEvents(e, t)
  3058. }
  3059. ,
  3060. n.prototype.activateControls = function(e) {
  3061. this.activeControl && (this.activeControl.reset(),
  3062. this.activeControl.enabled = !1),
  3063. this.controls[e] && (this.controls[e].enabled = !0),
  3064. this.activeControl = this.controls[e]
  3065. }
  3066. ,
  3067. n.prototype.setUpControls = function() {
  3068. var i = {}
  3069. , n = {}
  3070. , e = [p.PANORAMA, p.DOLLHOUSE, p.FLOORPLAN]
  3071. , r = [c, h, u]
  3072. , o = [a, s, l];
  3073. e.forEach(function(e, t) {
  3074. i[e] = new r[t],
  3075. n[e] = new o[t](i[e]),
  3076. n[e].on(d.Move, this.emit.bind(this, d.Move)),
  3077. n[e].on(d.InputStart, this.emit.bind(this, d.InputStart)),
  3078. n[e].on(d.InteractionDirect, this.emit.bind(this, d.InteractionDirect)),
  3079. n[e].on(d.InteractionKey, this.emit.bind(this, d.InteractionKey)),
  3080. n[e].on(d.Pinch, this.emit.bind(this, d.Pinch)),
  3081. n[e].on(d.Scroll, this.emit.bind(this, d.Scroll))
  3082. }
  3083. .bind(this)),
  3084. this.controls = n,
  3085. this.cameras = i
  3086. }
  3087. ,
  3088. n.prototype.bindEvents = function(e, t) {
  3089. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  3090. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  3091. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  3092. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  3093. f.useWheel && (e.addEventListener("mousewheel", this.onMouseWheel.bind(this), {
  3094. passive: !1
  3095. }),
  3096. e.addEventListener("DOMMouseScroll", this.onMouseWheel.bind(this))),
  3097. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  3098. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  3099. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  3100. e.addEventListener("contextmenu", function(e) {
  3101. e.preventDefault()
  3102. }),
  3103. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  3104. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  3105. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  3106. e.addEventListener("pointerout", this.onPointerCancel.bind(this)),
  3107. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  3108. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  3109. document.addEventListener("keyup", this.onKeyUp.bind(this)),
  3110. t.on(o.ActiveModelChanged, function(e) {
  3111. this.setModelForControls(e.model)
  3112. }
  3113. .bind(this))
  3114. }
  3115. ,
  3116. n.prototype.setModelForControls = function(e) {
  3117. this.controls[p.DOLLHOUSE].setZoomBounds(e.boundingBox);
  3118. var t = e.boundingBox.clone().expandByScalar(f.modelBoundsPadding);
  3119. [p.DOLLHOUSE, p.FLOORPLAN].forEach(function(e) {
  3120. this.controls[e].setBounds(t)
  3121. }
  3122. .bind(this))
  3123. }
  3124. ,
  3125. n.prototype.onMouseDown = function(e) {
  3126. e.preventDefault(),
  3127. this.activeControl && this.activeControl.onMouseDown(e)
  3128. }
  3129. ,
  3130. n.prototype.onMouseMove = function(e) {
  3131. e.preventDefault(),
  3132. this.activeControl && this.activeControl.onMouseMove(e)
  3133. }
  3134. ,
  3135. n.prototype.onMouseUp = function(e) {
  3136. e.preventDefault(),
  3137. this.activeControl && this.activeControl.onMouseUp(e)
  3138. }
  3139. ,
  3140. n.prototype.onMouseOver = function(e) {
  3141. e.preventDefault(),
  3142. this.activeControl && this.activeControl.onMouseOver(e)
  3143. }
  3144. ,
  3145. n.prototype.onMouseWheel = function(e) {
  3146. e.preventDefault(),
  3147. this.activeControl && this.activeControl.onMouseWheel(e)
  3148. }
  3149. ,
  3150. n.prototype.onTouchStart = function(e) {
  3151. e.preventDefault(),
  3152. this.activeControl && this.activeControl.onTouchStart(e),
  3153. $("#hotListWrap")[0].classList.remove("hotListActive"),
  3154. $("#hotListContent ul .active").removeClass("active"),
  3155. $("#hotList")[0].classList.remove("active")
  3156. }
  3157. ,
  3158. n.prototype.onTouchMove = function(e) {
  3159. e.preventDefault(),
  3160. this.activeControl && this.activeControl.onTouchMove(e)
  3161. }
  3162. ,
  3163. n.prototype.onTouchEnd = function(e) {
  3164. e.preventDefault(),
  3165. this.activeControl && this.activeControl.onTouchEnd(e)
  3166. }
  3167. ,
  3168. n.prototype.onPointerDown = function(e) {
  3169. if (e.preventDefault(),
  3170. this.activeControl)
  3171. switch (e.pointerType) {
  3172. case "mouse":
  3173. this.activeControl.onMouseDown(e);
  3174. break;
  3175. default:
  3176. this.activeControl.onPointerDown(e)
  3177. }
  3178. }
  3179. ,
  3180. n.prototype.onPointerMove = function(e) {
  3181. if (e.preventDefault(),
  3182. this.activeControl)
  3183. switch (e.pointerType) {
  3184. case "mouse":
  3185. this.activeControl.onMouseMove(e);
  3186. break;
  3187. default:
  3188. this.activeControl.onPointerMove(e)
  3189. }
  3190. }
  3191. ,
  3192. n.prototype.onPointerUp = function(e) {
  3193. if (e.preventDefault(),
  3194. this.activeControl)
  3195. switch (e.pointerType) {
  3196. case "mouse":
  3197. this.activeControl.onMouseUp(e);
  3198. break;
  3199. default:
  3200. this.activeControl.onPointerUp(e)
  3201. }
  3202. }
  3203. ,
  3204. n.prototype.onPointerCancel = function(e) {
  3205. e.preventDefault(),
  3206. this.activeControl && "mouse" !== e.pointerType && this.activeControl.onPointerUp(e)
  3207. }
  3208. ,
  3209. n.prototype.onKeyDown = function(e) {
  3210. e.metaKey || e.ctrlKey || (e.preventDefault(),
  3211. this.activeControl && this.activeControl.onKeyDown(e))
  3212. }
  3213. ,
  3214. n.prototype.onKeyUp = function(e) {
  3215. e.preventDefault(),
  3216. this.activeControl && this.activeControl.onKeyUp(e)
  3217. }
  3218. ,
  3219. t.exports = n
  3220. }
  3221. , {
  3222. "../cameras/DollhouseCamera": 5,
  3223. "../cameras/FloorplanCamera": 6,
  3224. "../cameras/PanoramaCamera": 7,
  3225. "../enum/ControlEvents": 21,
  3226. "../enum/ModelManagerEvents": 33,
  3227. "../enum/Viewmode": 51,
  3228. "../settings": 166,
  3229. "./DollhouseControls": 10,
  3230. "./FloorplanControls": 11,
  3231. "./PanoramaControls": 13,
  3232. events: 202
  3233. }],
  3234. 10: [function(e, t, i) {
  3235. "use strict";
  3236. function n(e) {
  3237. a.call(this, e),
  3238. this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3239. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle,
  3240. this.minDistance = o.dollhouseDefault.minDistance,
  3241. this.maxDistance = o.dollhouseDefault.maxDistance,
  3242. this.adjustedMinDistance = this.minDistance,
  3243. this.adjustedMaxDistance = this.maxDistance
  3244. }
  3245. var r = e("three")
  3246. , o = e("../settings")
  3247. , a = e("./OutsideControls");
  3248. (n.prototype = Object.create(a.prototype)).pan = function(e, t) {
  3249. this.camera.updateMatrix();
  3250. var i = this.camera.position.clone().sub(this.target).length();
  3251. i *= Math.tan(this.camera.fov / 2 * Math.PI / 180),
  3252. this.panLeft(2 * e * i / $("#player").height()),
  3253. this.panUp(-2 * t * i / $("#player").height())
  3254. }
  3255. ,
  3256. n.prototype.updateZoom = function() {
  3257. return this.offset.length() * this.scale
  3258. }
  3259. ,
  3260. n.prototype.setZoomBounds = function(e) {
  3261. var t = e.min.distanceTo(e.max);
  3262. this.adjustedMinDistance = Math.max(Math.min(t / 2, o.dollhouseDefault.minDistance), 0),
  3263. this.adjustedMaxDistance = Math.min(Math.max(t, o.dollhouseDefault.maxDistance), o.skyboxRadius),
  3264. this.minDistance = this.adjustedMinDistance,
  3265. this.maxDistance = this.adjustedMaxDistance
  3266. }
  3267. ,
  3268. n.prototype.resetRanges = function(e, t) {
  3269. e ? (this.minDistance = Math.min(e, this.minDistance),
  3270. this.maxDistance = Math.max(e, this.maxDistance)) : (this.minDistance = this.adjustedMinDistance,
  3271. this.maxDistance = this.adjustedMaxDistance),
  3272. t ? (this.minPolarAngle = r.Math.degToRad(-15),
  3273. this.maxPolarAngle = r.Math.degToRad(89.9)) : (this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3274. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle)
  3275. }
  3276. ,
  3277. n.prototype.toJSON = function() {
  3278. return a.prototype.toJSON.call(this)
  3279. }
  3280. ,
  3281. t.exports = n
  3282. }
  3283. , {
  3284. "../settings": 166,
  3285. "./OutsideControls": 12,
  3286. three: 217
  3287. }],
  3288. 11: [function(e, t, i) {
  3289. "use strict";
  3290. function n(e) {
  3291. c.call(this, e),
  3292. this.minDistance = 15,
  3293. this.maxDistance = 50,
  3294. this.noRotateUpDown = !0,
  3295. this.minPolarAngle = 0,
  3296. this.maxPolarAngle = 0,
  3297. this.mouseActions[u.LEFT] = h.PAN,
  3298. this.mouseActions[u.MIDDLE] = h.DOLLY,
  3299. this.mouseActions[u.RIGHT] = h.ROTATE,
  3300. this.touchActions[1] = h.PAN,
  3301. this.touchActions[2] = h.ROTATE_DOLLY,
  3302. this.absoluteScale = 1,
  3303. this.currentScale = 1
  3304. }
  3305. var r, o, a, s = e("three"), l = e("../settings"), c = e("./OutsideControls"), h = e("../enum/ControlActions"), u = e("../enum/MouseButton"), d = e("../util/math"), p = e("../util/browser");
  3306. (n.prototype = Object.create(c.prototype)).zoomToContain = function(e) {
  3307. var t = Math.max(e.x, e.z)
  3308. , i = Math.min(e.x, e.z)
  3309. , n = Math.max(t, i * this.camera.aspect)
  3310. , r = Math.max(i, t * this.camera.aspect);
  3311. this.absoluteScale = (p.aspectRatio() < 1 ? r : n) / 2 / l.orthoBase * 1.2,
  3312. this.currentScale = this.absoluteScale
  3313. }
  3314. ,
  3315. n.prototype.rotateToView = function(e, t) {
  3316. var i = 0;
  3317. p.aspectRatio() < 1 == e.x < e.z ? 0 < t.z && (i = Math.PI) : i = 0 < t.x ? Math.PI / 2 : -Math.PI / 2,
  3318. this.rotateLeft(i),
  3319. this.update(0)
  3320. }
  3321. ,
  3322. n.prototype.pan = function(e, t) {
  3323. this.camera.updateMatrix(),
  3324. this.panLeft(e * (this.camera.right - this.camera.left) / $("#player").width()),
  3325. this.panUp(-t * (this.camera.top - this.camera.bottom) / $("#player").height())
  3326. }
  3327. ,
  3328. n.prototype.updateZoom = function() {
  3329. return this.absoluteScale *= this.scale - .03 * this.keyboardZoomSpeed,
  3330. this.absoluteScale = Math.max(l.zoomNearLimit, Math.min(this.absoluteScale, l.zoomFarLimit)),
  3331. this.currentScale = .8 * this.currentScale + .2 * this.absoluteScale,
  3332. this.camera.left = -l.orthoBase * this.currentScale,
  3333. this.camera.right = l.orthoBase * this.currentScale,
  3334. this.camera.top = l.orthoBase * this.currentScale / this.camera.aspect,
  3335. this.camera.bottom = -l.orthoBase * this.currentScale / this.camera.aspect,
  3336. this.camera.updateProjectionMatrix(),
  3337. this.offset.length()
  3338. }
  3339. ,
  3340. n.prototype.toJSON = (r = new s.Quaternion,
  3341. o = (new s.Quaternion).setFromAxisAngle(new s.Vector3(0,1,0), s.Math.degToRad(90)),
  3342. a = new s.Quaternion,
  3343. function() {
  3344. var e = c.prototype.toJSON.call(this);
  3345. return r.copy(e.camera_quaternion),
  3346. a.copy(o),
  3347. a.multiply(r),
  3348. e.camera_quaternion.x = d.toPrecision(a.x, 4),
  3349. e.camera_quaternion.y = d.toPrecision(a.y, 4),
  3350. e.camera_quaternion.z = d.toPrecision(a.z, 4),
  3351. e.camera_quaternion.w = d.toPrecision(a.w, 4),
  3352. e.ortho_zoom = d.toPrecision(this.currentScale * this.camera.aspect, 4),
  3353. e
  3354. }
  3355. ),
  3356. t.exports = n
  3357. }
  3358. , {
  3359. "../enum/ControlActions": 20,
  3360. "../enum/MouseButton": 34,
  3361. "../settings": 166,
  3362. "../util/browser": 182,
  3363. "../util/math": 190,
  3364. "./OutsideControls": 12,
  3365. three: 217
  3366. }],
  3367. 12: [function(e, t, i) {
  3368. "use strict";
  3369. function n(e) {
  3370. this.camera = e,
  3371. (this.camera.controls = this).enabled = !1,
  3372. this.target = new a.Vector3,
  3373. this.targetBounds = new a.Box3,
  3374. this.zoomSpeed = 2,//编辑时缩放快一些
  3375. this.minDistance = 0,
  3376. this.maxDistance = 1 / 0,
  3377. this.noRotateUpDown = !1,
  3378. this.rotateSpeed = 1,
  3379. this.keyboardZoomSpeed = 0,
  3380. this.keyPanSpeed = 7,
  3381. this.autoRotate = !1,
  3382. this.autoRotateSpeed = 2,
  3383. this.autoPan = !1,
  3384. this.autoPanPosition = new a.Vector3,
  3385. this.minPolarAngle = a.Math.degToRad(25),
  3386. this.maxPolarAngle = a.Math.degToRad(65),
  3387. this.rotationAcceleration = new a.Vector2,
  3388. this.rotationSpeed = new a.Vector2,
  3389. this.panAcceleration = new a.Vector2,
  3390. this.panSpeed = new a.Vector2,
  3391. this.rotateStart = new a.Vector2,
  3392. this.rotateEnd = new a.Vector2,
  3393. this.rotateDelta = new a.Vector2,
  3394. this.panStart = new a.Vector2,
  3395. this.panEnd = new a.Vector2,
  3396. this.panDelta = new a.Vector2,
  3397. this.panOffset = new a.Vector3,
  3398. this.offset = new a.Vector3,
  3399. this.dollyStart = new a.Vector2,
  3400. this.dollyEnd = new a.Vector2,
  3401. this.dollyDelta = new a.Vector2,
  3402. this.phiDelta = 0,
  3403. this.thetaDelta = 0,
  3404. this.scale = 1,
  3405. this.panVector = new a.Vector3,
  3406. this.lastPosition = new a.Vector3,
  3407. this.state = u.NONE,
  3408. this.mouseActions = {},
  3409. this.mouseActions[d.LEFT] = u.ROTATE,
  3410. this.mouseActions[d.MIDDLE] = u.DOLLY,
  3411. this.mouseActions[d.RIGHT] = u.PAN,
  3412. this.touchActions = {},
  3413. this.touchActions[1] = u.ROTATE,
  3414. this.touchActions[2] = u.PAN_DOLLY,
  3415. this.lastMoveTime = 0,
  3416. this.pointersLimit = 2,
  3417. this.pointers = []
  3418. }
  3419. var r, o, a = e("three"), c = e("../settings"), h = e("../util/common"), s = e("../util/math"), l = e("../enum/Vectors"), u = e("../enum/ControlActions"), d = e("../enum/MouseButton"), p = e("../enum/Keys"), f = e("../enum/ControlEvents"), g = e("events").EventEmitter;
  3420. (n.prototype = Object.create(g.prototype)).setBounds = function(e) {
  3421. this.targetBounds = e
  3422. }
  3423. ,
  3424. n.prototype.isEngaged = function() {
  3425. return this.state !== u.NONE
  3426. }
  3427. ,
  3428. n.prototype.rotateLeft = function(e) {
  3429. void 0 === e && (e = this.getAutoRotationAngle()),
  3430. this.thetaDelta -= e
  3431. }
  3432. ,
  3433. n.prototype.rotateUp = function(e) {
  3434. this.noRotateUpDown || (void 0 === e && (e = this.getAutoRotationAngle()),
  3435. this.phiDelta -= e)
  3436. }
  3437. ,
  3438. n.prototype.panLeft = function(e) {
  3439. var t = this.camera.matrix.elements;
  3440. this.panOffset.set(t[0], 0, t[2]).normalize(),
  3441. this.panOffset.multiplyScalar(-e),
  3442. this.panVector.add(this.panOffset)
  3443. }
  3444. ,
  3445. n.prototype.panUp = function(e) {
  3446. var t = this.camera.matrix.elements;
  3447. this.panOffset.set(t[4], 0, t[6]).normalize(),
  3448. this.panOffset.multiplyScalar(-e),
  3449. this.panVector.add(this.panOffset)
  3450. }
  3451. ,
  3452. n.prototype.startRotating = function(e, t) {
  3453. e && this.navRotationAcc("x", e),
  3454. t && this.navRotationAcc("y", t)
  3455. }
  3456. ,
  3457. n.prototype.stopRotating = function(e) {
  3458. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  3459. this.navRotationAcc("x", 0),
  3460. this.navRotationAcc("y", 0)
  3461. }
  3462. ,
  3463. n.prototype.setAutoPanPosition = (r = new a.Vector3,
  3464. o = new a.Vector3,
  3465. function(e, t) {
  3466. r.copy(this.camera.position),
  3467. void 0 === e && null === e || r.setX(e),
  3468. void 0 === t && null === t || r.setZ(t);
  3469. var i = this.camera.position.distanceTo(this.target)
  3470. , n = l.FORWARD.clone().applyQuaternion(this.camera.quaternion);
  3471. this.targetClamped = !1,
  3472. o.copy(r).addScaledVector(n, i),
  3473. this.targetBounds.containsPoint(o) || (this.targetBounds.clampPoint(o, o),
  3474. r.copy(o).addScaledVector(n, -i),
  3475. this.targetClamped = !0),
  3476. this.autoPanPosition.x = r.x,
  3477. this.autoPanPosition.z = r.z,
  3478. this.autoPan && this.stopAutoPanning()
  3479. }
  3480. ),
  3481. n.prototype.stopAutoPanning = function() {
  3482. var e = this.autoPan;
  3483. this.autoPan = !1,
  3484. this.emit(this.targetClamped ? f.AutoPanClamped : e ? f.AutoPanInterrupt : f.AutoPanComplete)
  3485. }
  3486. ,
  3487. n.prototype.dollyIn = function(e) {
  3488. void 0 === e && (e = this.getZoomScale()),
  3489. this.scale /= e
  3490. }
  3491. ,
  3492. n.prototype.dollyOut = function(e) {
  3493. void 0 === e && (e = this.getZoomScale()),
  3494. this.scale *= e
  3495. }
  3496. ,
  3497. n.prototype.updatePan = function(e) {
  3498. if (this.panSpeed.multiplyScalar(1 - c.panFriction).addScaledVector(this.panAcceleration, c.panAccelerationOutside * e),
  3499. this.pan(-this.panSpeed.x, this.panSpeed.y),
  3500. this.autoPan) {
  3501. var t = (new a.Vector3).copy(this.autoPanPosition).sub(this.camera.position);
  3502. t.setY(0).clampLength(0, 50 * e),
  3503. this.target.add(t),
  3504. this.camera.position.add(t),
  3505. this.autoPanPosition.x === this.camera.position.x && this.autoPanPosition.z === this.camera.position.z && (this.autoPan = !1,
  3506. this.stopAutoPanning())
  3507. }
  3508. }
  3509. ,
  3510. n.prototype.update = function(e) {
  3511. e = e || 1 / 60,
  3512. this.rotationSpeed.multiplyScalar(1 - c.rotationFriction).addScaledVector(this.rotationAcceleration, c.rotationAccelerationOutside * e),
  3513. this.rotateLeft(-this.rotationSpeed.x),
  3514. this.noRotateUpDown || this.rotateUp(this.rotationSpeed.y),
  3515. this.updatePan(e);
  3516. var t = this.camera.position;
  3517. this.offset.copy(t).sub(this.target);
  3518. var i = Math.atan2(this.offset.x, this.offset.z)
  3519. , n = Math.atan2(Math.sqrt(this.offset.x * this.offset.x + this.offset.z * this.offset.z), this.offset.y);
  3520. this.autoRotate && this.rotateLeft(this.getAutoRotationAngle()),
  3521. i += this.thetaDelta,
  3522. n += this.phiDelta,
  3523. n = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, n)),
  3524. n = Math.max(1e-6, Math.min(Math.PI - 1e-6, n));
  3525. var r = this.updateZoom();
  3526. r = Math.max(this.minDistance, Math.min(this.maxDistance, r)),
  3527. this.target.add(this.panVector),
  3528. this.targetBounds.clampPoint(this.target, this.target),
  3529. this.offset.x = r * Math.sin(n) * Math.sin(i),
  3530. this.offset.y = r * Math.cos(n),
  3531. this.offset.z = r * Math.sin(n) * Math.cos(i),
  3532. t.copy(this.target).add(this.offset),
  3533. this.camera.lookAt(this.target),
  3534. this.thetaDelta = 0,
  3535. this.phiDelta = 0,
  3536. this.scale = 1,
  3537. this.panVector.set(0, 0, 0),
  3538. 0 < this.lastPosition.distanceTo(this.camera.position) && this.lastPosition.copy(this.camera.position)
  3539. }
  3540. ,
  3541. n.prototype.getAutoRotationAngle = function() {
  3542. return 2 * Math.PI / 60 / 60 * this.autoRotateSpeed
  3543. }
  3544. ,
  3545. n.prototype.getZoomScale = function() {
  3546. return Math.pow(.95, this.zoomSpeed)
  3547. }
  3548. ,
  3549. n.prototype.onMouseDown = function(e) {
  3550. if (this.enabled) {
  3551. switch (e.preventDefault(),
  3552. this.stopAutoPanning(),
  3553. this.mouseDown = !0,
  3554. this.state = this.mouseActions[e.button],
  3555. this.state) {
  3556. case u.ROTATE:
  3557. this.rotateStart.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3558. this.rotationSpeed.set(0, 0);
  3559. break;
  3560. case u.DOLLY:
  3561. this.dollyStart.set(e.clientX, e.clientY);
  3562. break;
  3563. case u.PAN:
  3564. this.panStart.set(e.clientX, e.clientY)
  3565. }
  3566. this.emit(f.InputStart, "mouse")
  3567. }
  3568. }
  3569. ,
  3570. n.prototype.onMouseMove = function(e) {
  3571. if (this.enabled && this.mouseDown && 0 !== e.buttons) {
  3572. switch (e.preventDefault(),
  3573. this.state) {
  3574. case u.ROTATE:
  3575. this.rotateEnd.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3576. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3577. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3578. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3579. this.rotateStart.copy(this.rotateEnd);
  3580. break;
  3581. case u.DOLLY:
  3582. this.dollyEnd.set(e.clientX, e.clientY),
  3583. this.dollyDelta.subVectors(this.dollyEnd, this.dollyStart),
  3584. (0 < this.dollyDelta.y ? this.dollyIn : this.dollyOut).call(this),
  3585. this.dollyStart.copy(this.dollyEnd);
  3586. break;
  3587. case u.PAN:
  3588. this.panEnd.set(e.clientX, e.clientY),
  3589. this.panDelta.subVectors(this.panEnd, this.panStart),
  3590. this.pan(this.panDelta.x, this.panDelta.y),
  3591. this.panStart.copy(this.panEnd)
  3592. }
  3593. this.emit(f.Move, "mouse"),
  3594. this.lastMoveTime = e.timeStamp,
  3595. this.update()
  3596. }
  3597. }
  3598. ,
  3599. n.prototype.onMouseUp = function(e) {
  3600. this.enabled && (this.mouseDown = !1,
  3601. this.state = u.NONE,
  3602. "mouseover" !== e.type && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3603. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y),
  3604. this.update(),
  3605. this.rotationAcceleration.set(0, 0),
  3606. this.rotateDelta.set(0, 0)))
  3607. }
  3608. ,
  3609. n.prototype.onMouseOver = function(e) {
  3610. 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  3611. }
  3612. ,
  3613. n.prototype.onMouseWheel = function(e) {
  3614. this.enabled && c.useWheel && (this.emit(f.Move, "wheel"),
  3615. (0 < (e.wheelDelta || -e.detail) ? this.dollyOut : this.dollyIn).call(this),
  3616. this.update())
  3617. }
  3618. ,
  3619. n.prototype.onKeyDown = function(e) {
  3620. this.enabled && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  3621. this.handleKeyDown(e.which)))
  3622. }
  3623. ,
  3624. n.prototype.navRotationAcc = function(e, t) {
  3625. "y" === e ? this.noRotateUpDown ? this.keyboardZoomSpeed = t : this.rotationAcceleration.y = t : this.rotationAcceleration.x = t
  3626. }
  3627. ,
  3628. n.prototype.navPanAcc = function(e, t) {
  3629. this.stopAutoPanning(),
  3630. this.panAcceleration[e] = t
  3631. }
  3632. ,
  3633. n.prototype.handleKeyDown = function(e) {
  3634. var t = !0;
  3635. switch (e) {
  3636. case p.UPARROW:
  3637. case p.I:
  3638. this.navRotationAcc("y", 1);
  3639. break;
  3640. case p.DOWNARROW:
  3641. case p.K:
  3642. this.navRotationAcc("y", -1);
  3643. break;
  3644. case p.LEFTARROW:
  3645. case p.J:
  3646. this.navRotationAcc("x", -1);
  3647. break;
  3648. case p.RIGHTARROW:
  3649. case p.L:
  3650. this.navRotationAcc("x", 1);
  3651. break;
  3652. case p.W:
  3653. this.navPanAcc("y", 1);
  3654. break;
  3655. case p.S:
  3656. this.navPanAcc("y", -1);
  3657. break;
  3658. case p.A:
  3659. this.navPanAcc("x", -1);
  3660. break;
  3661. case p.D:
  3662. this.navPanAcc("x", 1);
  3663. break;
  3664. default:
  3665. t = !1
  3666. }
  3667. t && this.emit(f.Move, "key")
  3668. }
  3669. ,
  3670. n.prototype.onKeyUp = function(e) {
  3671. this.enabled && (e.preventDefault(),
  3672. e.stopPropagation(),
  3673. this.handleKeyUp(e.which))
  3674. }
  3675. ,
  3676. n.prototype.handleKeyUp = function(e) {
  3677. switch (e) {
  3678. case p.I:
  3679. case p.K:
  3680. case p.UPARROW:
  3681. case p.DOWNARROW:
  3682. this.keyboardZoomSpeed = 0,
  3683. this.rotationAcceleration.y = 0;
  3684. break;
  3685. case p.J:
  3686. case p.L:
  3687. case p.LEFTARROW:
  3688. case p.RIGHTARROW:
  3689. this.rotationAcceleration.x = 0;
  3690. break;
  3691. case p.S:
  3692. case p.W:
  3693. this.panAcceleration.y = 0;
  3694. break;
  3695. case p.A:
  3696. case p.D:
  3697. this.panAcceleration.x = 0
  3698. }
  3699. }
  3700. ,
  3701. n.prototype.onTouchStart = function(i) {
  3702. if (this.enabled || this.state === u.NONE) {
  3703. i.preventDefault(),
  3704. i.stopPropagation(),
  3705. this.stopAutoPanning();
  3706. var e = function() {
  3707. if (2 === i.touches.length) {
  3708. var e = i.touches[0].pageX - i.touches[1].pageX
  3709. , t = i.touches[0].pageY - i.touches[1].pageY;
  3710. this.dollyStart.set(e, t)
  3711. }
  3712. }
  3713. .bind(this)
  3714. , t = function() {
  3715. this.panStart.set(h.average(i.touches, "pageX"), h.average(i.touches, "pageY"))
  3716. }
  3717. .bind(this)
  3718. , n = function() {
  3719. this.rotateStart.set(h.average(i.touches, "pageX"), h.average(i.touches, "pageY"))
  3720. }
  3721. .bind(this);
  3722. switch (this.state = this.touchActions[i.touches.length],
  3723. this.state) {
  3724. case u.PAN_DOLLY:
  3725. e();
  3726. case u.PAN:
  3727. t();
  3728. break;
  3729. case u.ROTATE_DOLLY:
  3730. e();
  3731. case u.ROTATE:
  3732. n()
  3733. }
  3734. this.rotationSpeed.set(0, 0),
  3735. this.emit(f.InputStart, "touch")
  3736. }
  3737. }
  3738. ,
  3739. n.prototype.onTouchMove = function(a) {
  3740. if (this.enabled && this.state !== u.NONE) {
  3741. a.preventDefault(),
  3742. a.stopPropagation();
  3743. var s = function() {
  3744. var e = a.touches[0].pageX - a.touches[1].pageX
  3745. , t = a.touches[0].pageY - a.touches[1].pageY;
  3746. this.dollyEnd.set(e, t);
  3747. var i = this.dollyStart.length() - this.dollyEnd.length();
  3748. 0 < i ? this.dollyOut(1 + i / 500) : this.dollyIn(1 - i / 500),
  3749. this.dollyStart.copy(this.dollyEnd)
  3750. }
  3751. .bind(this)
  3752. , e = function() {
  3753. this.panEnd.set(h.average(a.touches, "pageX"), h.average(a.touches, "pageY")),
  3754. this.panDelta.subVectors(this.panEnd, this.panStart),
  3755. this.pan(this.panDelta.x, this.panDelta.y),
  3756. this.panStart.copy(this.panEnd),
  3757. this.rotateDelta.set(0, 0)
  3758. }
  3759. .bind(this)
  3760. , l = function() {
  3761. this.rotateEnd.set(h.average(a.touches, "pageX"), h.average(a.touches, "pageY")),
  3762. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3763. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3764. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3765. this.rotateStart.copy(this.rotateEnd)
  3766. }
  3767. .bind(this)
  3768. , t = function() {
  3769. if (2 === a.touches.length) {
  3770. var e = window.devicePixelRatio || 1
  3771. , t = a.touches[1].pageX - a.touches[0].pageX
  3772. , i = a.touches[1].pageY - a.touches[0].pageY
  3773. , n = Math.sqrt(t * t + i * i);
  3774. if (Math.abs(this.dollyStart.length() - n) > c.input.touchMoveThreshold * e)
  3775. this.state = u.DOLLY,
  3776. s();
  3777. else {
  3778. var r = h.average(a.touches, "pageX")
  3779. , o = h.average(a.touches, "pageY");
  3780. this.rotateDelta.set(r, o).sub(this.rotateStart).length() > c.input.touchMoveThreshold && (this.state = u.ROTATE,
  3781. this.rotateStart.set(r, o),
  3782. l())
  3783. }
  3784. }
  3785. }
  3786. .bind(this);
  3787. switch (this.state) {
  3788. case u.PAN_DOLLY:
  3789. s();
  3790. case u.PAN:
  3791. e();
  3792. break;
  3793. case u.ROTATE_DOLLY:
  3794. t();
  3795. break;
  3796. case u.DOLLY:
  3797. s();
  3798. break;
  3799. case u.ROTATE:
  3800. l();
  3801. break;
  3802. default:
  3803. this.state = u.NONE
  3804. }
  3805. this.lastMoveTime = a.timeStamp,
  3806. this.emit(f.Move, "touch")
  3807. }
  3808. }
  3809. ,
  3810. n.prototype.onTouchEnd = function(e) {
  3811. this.enabled && (this.state === u.ROTATE && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3812. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y)),
  3813. this.state = u.NONE,
  3814. this.update(),
  3815. this.rotationAcceleration.set(0, 0),
  3816. this.rotateDelta.set(0, 0))
  3817. }
  3818. ,
  3819. n.prototype.onPointerDown = function(e) {
  3820. this.enabled && ("touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  3821. id: e.pointerId,
  3822. pageX: e.pageX,
  3823. pageY: e.pageY
  3824. }),
  3825. e.touches = this.pointers,
  3826. this.onTouchStart(e)),
  3827. this.emit(f.InputStart, "pointer"))
  3828. }
  3829. ,
  3830. n.prototype.onPointerMove = function(t) {
  3831. this.enabled && "touch" === t.pointerType && (this.pointers.forEach(function(e) {
  3832. t.pointerId === e.id && (e.pageX = t.pageX,
  3833. e.pageY = t.pageY)
  3834. }),
  3835. t.touches = this.pointers,
  3836. this.onTouchMove(t))
  3837. }
  3838. ,
  3839. n.prototype.onPointerUp = function(i) {
  3840. this.enabled && "touch" === i.pointerType && (this.pointers.forEach(function(e, t) {
  3841. i.pointerId === e.id && this.pointers.splice(t, 1)
  3842. }
  3843. .bind(this)),
  3844. i.touches = this.pointers,
  3845. this.onTouchEnd(i))
  3846. }
  3847. ,
  3848. n.prototype.reset = function() {
  3849. this.state = u.NONE,
  3850. this.stopAutoPanning(),
  3851. this.rotationSpeed.set(0, 0),
  3852. this.rotationAcceleration.set(0, 0),
  3853. this.panSpeed.set(0, 0),
  3854. this.panAcceleration.set(0, 0)
  3855. }
  3856. ,
  3857. n.prototype.toJSON = function() {
  3858. return {
  3859. camera_position: {
  3860. x: s.toPrecision(this.camera.position.x, 4),
  3861. y: s.toPrecision(this.camera.position.y, 4),
  3862. z: s.toPrecision(this.camera.position.z, 4)
  3863. },
  3864. camera_quaternion: {
  3865. x: s.toPrecision(this.camera.quaternion.x, 4),
  3866. y: s.toPrecision(this.camera.quaternion.y, 4),
  3867. z: s.toPrecision(this.camera.quaternion.z, 4),
  3868. w: s.toPrecision(this.camera.quaternion.w, 4)
  3869. }
  3870. }
  3871. }
  3872. ,
  3873. t.exports = n
  3874. }
  3875. , {
  3876. "../enum/ControlActions": 20,
  3877. "../enum/ControlEvents": 21,
  3878. "../enum/Keys": 30,
  3879. "../enum/MouseButton": 34,
  3880. "../enum/Vectors": 50,
  3881. "../settings": 166,
  3882. "../util/common": 185,
  3883. "../util/math": 190,
  3884. events: 202,
  3885. three: 217
  3886. }],
  3887. 13: [function(u, d, e) {
  3888. (function(e) {
  3889. "use strict";
  3890. function t(e) {
  3891. this.camera = e,
  3892. (this.camera.controls = this).target = new s.Vector3(0,0,0),
  3893. this.lookVector = new s.Vector3,
  3894. this.lookSpeed = .05,
  3895. this.rotationAcc = new s.Vector2,
  3896. this.rotationSpeed = new s.Vector2,
  3897. this.lat = 0,
  3898. this.lon = 0,
  3899. this.phi = 0,
  3900. this.theta = 0,
  3901. this.enabled = !1,
  3902. this.locked = !1,
  3903. this.pointer = new s.Vector2(0,0),
  3904. this.rotationHistory = [],
  3905. this.rotationDifference = new s.Vector2,
  3906. this.pointerDragOn = !1,
  3907. this.pointerDragStart = new s.Vector2(0,0),
  3908. this.pinchDistance = 0,
  3909. this.moveStart = new s.Vector2,
  3910. this.moveTolerance = .01,
  3911. this.pointersLimit = 2,
  3912. this.pointers = []
  3913. }
  3914. var s = u("three")
  3915. , i = u("../util/logger")
  3916. , n = u("../settings")
  3917. , r = u("../util/common")
  3918. , o = u("../util/math")
  3919. , a = (u("../enum/Vectors"),
  3920. u("../enum/MouseButton"))
  3921. , l = u("../enum/Keys")
  3922. , c = u("../enum/ControlEvents")
  3923. , h = u("events").EventEmitter;
  3924. new i(e),
  3925. (t.prototype = Object.create(h.prototype)).usable = function() {
  3926. return this.enabled && !this.locked
  3927. }
  3928. ,
  3929. t.prototype.lookAt = function(e) {
  3930. var t = this.camera.position.clone().sub(e)
  3931. , i = Math.atan(t.z / t.x);
  3932. i += t.x < 0 ? Math.PI : 0,
  3933. i += 0 < t.x && t.z < 0 ? 2 * Math.PI : 0,
  3934. this.lon = s.Math.radToDeg(i) + 180;
  3935. var n = Math.sqrt(t.x * t.x + t.z * t.z)
  3936. , r = Math.atan(t.y / n);
  3937. this.lat = -s.Math.radToDeg(r)
  3938. }
  3939. ,
  3940. t.prototype.startRotationFrom = function(e, t) {
  3941. o.convertScreenPositionToNDC(e, t, this.pointer),
  3942. this.pointerDragOn = !0,
  3943. this.pointerDragStart.copy(this.pointer),
  3944. this.moveStart.copy(this.pointer),
  3945. this.rotationHistory = [],
  3946. this.rotationSpeed.set(0, 0)
  3947. }
  3948. ,
  3949. t.prototype.onMouseOver = function(e) {
  3950. !this.pointerDragOn || 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  3951. }
  3952. ,
  3953. t.prototype.onTouchStart = function(e) {
  3954. if (this.usable()) {
  3955. switch (e.preventDefault(),
  3956. e.stopPropagation(),
  3957. e.touches.length) {
  3958. case 1:
  3959. this.startRotationFrom(e.touches[0].clientX, e.touches[0].clientY);
  3960. break;
  3961. case 2:
  3962. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  3963. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height();
  3964. this.pinchDistance = Math.sqrt(t * t + i * i)
  3965. }
  3966. this.emit(c.InputStart, "touch")
  3967. }
  3968. }
  3969. ,
  3970. t.prototype.onPointerDown = function(e) {
  3971. this.usable() && "touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  3972. id: e.pointerId,
  3973. clientX: e.clientX,
  3974. clientY: e.clientY
  3975. }),
  3976. e.touches = this.pointers,
  3977. this.onTouchStart(e),
  3978. this.emit(c.InputStart, "pointer"))
  3979. }
  3980. ,
  3981. t.prototype.onMouseDown = function(e) {
  3982. if (this.usable()) {
  3983. switch (e.preventDefault(),
  3984. e.stopPropagation(),
  3985. e.button) {
  3986. case a.LEFT:
  3987. this.startRotationFrom(e.clientX, e.clientY)
  3988. }
  3989. this.emit(c.InputStart, "mouse")
  3990. }
  3991. }
  3992. ,
  3993. t.prototype.updateRotation = function() {
  3994. if (this.usable() && this.pointerDragOn) {
  3995. var e = new s.Vector3(this.pointerDragStart.x,this.pointerDragStart.y,-1).unproject(this.camera)
  3996. , t = new s.Vector3(this.pointer.x,this.pointer.y,-1).unproject(this.camera)
  3997. , i = Math.sqrt(e.x * e.x + e.z * e.z)
  3998. , n = Math.sqrt(t.x * t.x + t.z * t.z)
  3999. , r = Math.atan2(e.y, i)
  4000. , o = Math.atan2(t.y, n);
  4001. this.rotationDifference.y = s.Math.radToDeg(r - o),
  4002. e.y = 0,
  4003. t.y = 0;
  4004. var a = Math.acos(e.dot(t) / e.length() / t.length());
  4005. isNaN(a) || (this.rotationDifference.x = s.Math.radToDeg(a),
  4006. this.pointerDragStart.x < this.pointer.x && (this.rotationDifference.x *= -1)),
  4007. this.pointerDragStart.copy(this.pointer)
  4008. }
  4009. }
  4010. ,
  4011. t.prototype.onMouseMove = function(e) {
  4012. this.usable() && (o.convertScreenPositionToNDC(e.clientX, e.clientY, this.pointer),
  4013. this.pointerDragOn && (Math.abs(this.pointer.x - this.moveStart.x) > this.moveTolerance || Math.abs(this.pointer.y - this.moveStart.y) > this.moveTolerance) && this.emit(c.Move, "mouse"))
  4014. }
  4015. ,
  4016. t.prototype.onTouchMove = function(e) {
  4017. if (this.usable())
  4018. switch (this.emit(c.Move, "touch"),
  4019. e.touches.length) {
  4020. case 1:
  4021. o.convertScreenPositionToNDC(e.touches[0].clientX, e.touches[0].clientY, this.pointer);
  4022. break;
  4023. case 2:
  4024. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  4025. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height()
  4026. , n = this.pinchDistance - Math.sqrt(t * t + i * i);
  4027. .01 < Math.abs(n) && (this.emit(c.InteractionDirect),
  4028. this.emit(c.Pinch, n),
  4029. this.pinchDistance -= n)
  4030. }
  4031. }
  4032. ,
  4033. t.prototype.onPointerMove = function(t) {
  4034. this.usable() && "touch" === t.pointerType && (this.pointers.forEach(function(e) {
  4035. t.pointerId === e.id && (e.clientX = t.clientX,
  4036. e.clientY = t.clientY)
  4037. }),
  4038. t.touches = this.pointers,
  4039. this.onTouchMove(t))
  4040. }
  4041. ,
  4042. t.prototype.endRotation = function() {
  4043. this.pointerDragOn = !1;
  4044. var e = r.averageVectors(this.rotationHistory);
  4045. this.rotationSpeed.set(e.x * n.rotationAfterMoveMultiplier, e.y * n.rotationAfterMoveMultiplier)
  4046. }
  4047. ,
  4048. t.prototype.onTouchEnd = function(e) {
  4049. this.usable() && (e.preventDefault(),
  4050. e.stopPropagation(),
  4051. this.endRotation())
  4052. }
  4053. ,
  4054. t.prototype.onMouseUp = function(e) {
  4055. this.usable() && (e.preventDefault(),
  4056. e.stopPropagation(),
  4057. this.endRotation())
  4058. }
  4059. ,
  4060. t.prototype.onPointerUp = function(i) {
  4061. this.usable() && "touch" === i.pointerType && (this.pointers.forEach(function(e, t) {
  4062. i.pointerId === e.id && this.pointers.splice(t, 1)
  4063. }
  4064. .bind(this)),
  4065. i.touches = this.pointers,
  4066. this.onTouchEnd(i))
  4067. }
  4068. ,
  4069. t.prototype.update = function(e) {
  4070. for (this.lon,
  4071. this.lat,
  4072. this.updateRotation(),
  4073. this.rotationHistory.push(this.rotationDifference.clone()); this.rotationHistory.length > n.rotationAfterMoveHistoryCount; )
  4074. this.rotationHistory.shift();
  4075. this.lon += this.rotationDifference.x,
  4076. this.lat += this.rotationDifference.y,
  4077. this.rotationDifference.set(0, 0),
  4078. this.rotationSpeed.x = this.rotationSpeed.x * (1 - n.rotationFriction) + this.rotationAcc.x * n.rotationAccelerationInside,
  4079. this.rotationSpeed.y = this.rotationSpeed.y * (1 - n.rotationFriction) + this.rotationAcc.y * n.rotationAccelerationInside,
  4080. this.lon += this.rotationSpeed.x * e,
  4081. this.lat += this.rotationSpeed.y * e,
  4082. this.lat = Math.max(n.insideLookLimitDown, Math.min(n.insideLookLimitUp, this.lat)),
  4083. this.phi = s.Math.degToRad(90 - this.lat),
  4084. this.theta = s.Math.degToRad(this.lon),
  4085. this.lookVector.x = Math.sin(this.phi) * Math.cos(this.theta),
  4086. this.lookVector.y = Math.cos(this.phi),
  4087. this.lookVector.z = Math.sin(this.phi) * Math.sin(this.theta),
  4088. this.target.copy(this.lookVector).add(this.camera.position),
  4089. this.camera.lookAt(this.target)
  4090. }
  4091. ,
  4092. t.prototype.onMouseWheel = function(e) {
  4093. if (this.usable()) {
  4094. var t = e.wheelDelta || -e.detail;
  4095. this.emit(c.InteractionDirect),
  4096. this.emit(c.Scroll, t)
  4097. }
  4098. }
  4099. ,
  4100. t.prototype.onKeyDown = function(e) {
  4101. this.usable() && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  4102. this.handleKeyDown(e.which)))
  4103. }
  4104. ,
  4105. t.prototype.handleKeyDown = function(e) {
  4106. var t = function(e, t) {
  4107. this.rotationAcc[e] = t
  4108. }
  4109. .bind(this);
  4110. this.emit(c.InteractionKey);
  4111. var i = !0;
  4112. switch (e) {
  4113. case l.LEFTARROW:
  4114. case l.J:
  4115. t("x", -1);
  4116. break;
  4117. case l.RIGHTARROW:
  4118. case l.L:
  4119. t("x", 1);
  4120. break;
  4121. case l.I:
  4122. t("y", 1);
  4123. break;
  4124. case l.K:
  4125. t("y", -1);
  4126. break;
  4127. default:
  4128. i = !1
  4129. }
  4130. i && this.emit(c.Move, "key")
  4131. }
  4132. ,
  4133. t.prototype.onKeyUp = function(e) {
  4134. this.usable() && (e.preventDefault(),
  4135. e.stopPropagation(),
  4136. this.handleKeyUp(e.which))
  4137. }
  4138. ,
  4139. t.prototype.handleKeyUp = function(e) {
  4140. switch (e) {
  4141. case l.LEFTARROW:
  4142. case l.J:
  4143. case l.RIGHTARROW:
  4144. case l.L:
  4145. this.rotationAcc.x = 0;
  4146. break;
  4147. case l.I:
  4148. case l.K:
  4149. this.rotationAcc.y = 0
  4150. }
  4151. }
  4152. ,
  4153. t.prototype.startRotating = function(e, t) {
  4154. e && (this.rotationAcc.x = e),
  4155. t && (this.rotationAcc.y = t)
  4156. }
  4157. ,
  4158. t.prototype.stopRotating = function(e) {
  4159. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  4160. this.rotationAcc.set(0, 0)
  4161. }
  4162. ,
  4163. t.prototype.reset = function() {
  4164. this.pointerDragOn = !1,
  4165. this.rotationAcc.set(0, 0),
  4166. this.rotationSpeed.set(0, 0),
  4167. this.pointers = []
  4168. }
  4169. ,
  4170. t.prototype.toJSON = function() {
  4171. return {
  4172. camera_position: {
  4173. x: o.toPrecision(this.camera.position.x, 4),
  4174. y: o.toPrecision(this.camera.position.y, 4),
  4175. z: o.toPrecision(this.camera.position.z, 4)
  4176. },
  4177. camera_quaternion: {
  4178. x: o.toPrecision(this.camera.quaternion.x, 4),
  4179. y: o.toPrecision(this.camera.quaternion.y, 4),
  4180. z: o.toPrecision(this.camera.quaternion.z, 4),
  4181. w: o.toPrecision(this.camera.quaternion.w, 4)
  4182. }
  4183. }
  4184. }
  4185. ,
  4186. t.prototype.setStateFromJSON = function(e) {
  4187. this.camera.position.copy(e.camera_position),
  4188. this.camera.quaternion.copy(e.camera_quaternion)
  4189. }
  4190. ,
  4191. d.exports = t
  4192. }
  4193. ).call(this, "/js/controls/PanoramaControls.js")
  4194. }
  4195. , {
  4196. "../enum/ControlEvents": 21,
  4197. "../enum/Keys": 30,
  4198. "../enum/MouseButton": 34,
  4199. "../enum/Vectors": 50,
  4200. "../settings": 166,
  4201. "../util/common": 185,
  4202. "../util/logger": 189,
  4203. "../util/math": 190,
  4204. events: 202,
  4205. three: 217
  4206. }],
  4207. 14: [function(t, i, e) {
  4208. (function(e) {
  4209. "use strict";
  4210. var c = t("three")
  4211. , h = t("../enum/Viewmode")
  4212. , u = new (t("../util/logger"))(e);
  4213. i.exports = {
  4214. serialize: function(e) {
  4215. return encodeURI(JSON.stringify(e))
  4216. },
  4217. deserialize: function(e) {
  4218. function t(e) {
  4219. return e.reduce(function(e, t) {
  4220. return e && "number" == typeof t && !isNaN(t)
  4221. }, !0)
  4222. }
  4223. try {
  4224. var i = JSON.parse(decodeURI(e))
  4225. , n = {
  4226. mode: h.fromInt(i.camera_mode),
  4227. panoId: i.scan_id,
  4228. position: (new c.Vector3).copy(i.camera_position),
  4229. quaternion: (new c.Quaternion).copy(i.camera_quaternion),
  4230. zoom: i.ortho_zoom,
  4231. floorVisibility: i.floor_visibility
  4232. }
  4233. , r = n.position;
  4234. t([r.x, r.y, r.z]) || n.position.set(0, 0, 0);
  4235. var o = n.quaternion;
  4236. return t([o.x, o.y, o.z, o.w]) || n.quaternion.set(0, 0, 0, 1),
  4237. n
  4238. } catch (i) {
  4239. u.debug("Not able to parse start location as JSON; falling back to old array style parsing");
  4240. try {
  4241. var a = e.split(",")
  4242. , s = {
  4243. x: parseFloat(a[2]),
  4244. y: parseFloat(a[3]),
  4245. z: parseFloat(a[4])
  4246. }
  4247. , l = {
  4248. x: parseFloat(a[5]),
  4249. y: parseFloat(a[6]),
  4250. z: parseFloat(a[7]),
  4251. w: parseFloat(a[8])
  4252. };
  4253. return t([s.x, s.y, s.z]) || (s.x = 0,
  4254. s.y = 0,
  4255. s.z = 0),
  4256. t([l.x, l.y, l.z, l.w]) || (l.x = 0,
  4257. l.y = 0,
  4258. l.z = 0,
  4259. l.w = 1),
  4260. {
  4261. mode: h.fromInt(a[0]),
  4262. panoId: a[1],
  4263. position: (new c.Vector3).copy(s),
  4264. quaternion: (new c.Quaternion).copy(l)
  4265. }
  4266. } catch (t) {
  4267. u.warn('Invalid start override, ignoring: "' + e + '"', t.message)
  4268. }
  4269. }
  4270. return null
  4271. }
  4272. }
  4273. }
  4274. ).call(this, "/js/controls/serializer.js")
  4275. }
  4276. , {
  4277. "../enum/Viewmode": 51,
  4278. "../util/logger": 189,
  4279. three: 217
  4280. }],
  4281. 15: [function(C, I, e) {
  4282. (function(e) {
  4283. "use strict";
  4284. function t() {
  4285. this.endlessLoop = r.warp.loop,
  4286. this.clock = new i.Clock(!0),
  4287. this.model = null,
  4288. this.player = null,
  4289. this.currentItem = null,
  4290. this.destinationItem = null,
  4291. this.tourIsPlaying = !1,
  4292. this.transitionStage = v.None,
  4293. this.nextFunc = null,
  4294. this.onTheBus = !1,
  4295. this.tourInProgress = !1,
  4296. this.reachSource = null,
  4297. this.interrupted = !1,
  4298. this.nItems = 0,
  4299. this.walkingSectionPaused = !1
  4300. }
  4301. var i = C("three")
  4302. , n = C("./util/logger")
  4303. , r = C("./settings")
  4304. , o = C("./util/transitions")
  4305. , a = C("events").EventEmitter
  4306. , s = C("./enum/Viewmode")
  4307. , l = C("./analytics")
  4308. , c = C("./enum/WarpStyle")
  4309. , h = (o = C("./util/transitions"),
  4310. C("./model/ModelManager"),
  4311. C("./enum/ModelManagerEvents"))
  4312. , u = C("./enum/DirectorEvents")
  4313. , d = C("./enum/PlayerEvents")
  4314. , p = (C("./enum/ControlEvents"),
  4315. C("./enum/BlackoutStyle"))
  4316. , f = C("./enum/PathDiscardMode")
  4317. , g = C("./enum/PathDisplayMode")
  4318. , m = (C("./player"),
  4319. new n(e))
  4320. , v = Object.freeze({
  4321. None: 0,
  4322. Moving: 1,
  4323. Aiming: 2,
  4324. Interlude: 3
  4325. })
  4326. , y = Object.freeze({
  4327. Forward: 1,
  4328. NoChange: 0,
  4329. Backwards: -1
  4330. })
  4331. , A = o.getUniqueId();
  4332. (t.prototype = Object.create(a.prototype)).init = function(e, t) {
  4333. this.player = e,
  4334. this.modelManager = t,
  4335. this.updateModel(),
  4336. this.resetAll(),
  4337. this.bindEvents()
  4338. }
  4339. ,
  4340. t.prototype.resetAll = function() {
  4341. if (this.currentItem = null,
  4342. this.destinationItem = null,
  4343. this.tourIsPlaying = !1,
  4344. this.bgmReplay(),
  4345. this.transitionStage = v.None,
  4346. this.nextFunc = null,
  4347. this.onTheBus = !1,
  4348. this.reachSource = null,
  4349. this.interrupted = !1,
  4350. this.model) {
  4351. var e = r.path.typ === c.WALK ? c.WALK : c.STD;
  4352. this.defaultWarpStyle = this.model.data.hasOwnProperty("player_options") && this.model.data.player_options && !1 === this.model.data.player_options.fast_transitions ? e : c.BLACK
  4353. } else
  4354. this.defaultWarpStyle = c.BLACK,
  4355. m.warn('No model yet, choosing "' + this.defaultWarpStyle + '" transitions');
  4356. this.resetSpecialTransition()
  4357. }
  4358. ,
  4359. t.prototype.updateModel = function() {
  4360. this.model = this.modelManager.getActiveModel(),
  4361. this.nItems = this.model.heroLocations.length
  4362. }
  4363. ,
  4364. t.prototype.bindEvents = function() {
  4365. this.modelManager.on(h.ActiveModelChanged, this.updateModel.bind(this)),
  4366. this.player.on(d.WarpInterruptedWithFlyTo, this.checkAndHandleWalkingtourInterruption.bind(this)),
  4367. this.player.on(d.Move, this.handlePlayerMove.bind(this)),
  4368. this.player.on(d.PanoChosen, this.handlePlayerPanoChosen.bind(this)),
  4369. this.player.on(d.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  4370. this.player.on(d.InputStart, this.handlePlayerInputStart.bind(this)),
  4371. this.player.on(d.FlyingStarted, this.handlePlayerFlyingStarted.bind(this)),
  4372. this.player.once(d.Move, function() {
  4373. o.cancelById(A)
  4374. })
  4375. }
  4376. ,
  4377. t.prototype.checkAndHandleWalkingtourInterruption = function(e) {
  4378. return e === c.WALK && (this.interrupt(p.NONE),
  4379. this.pauseWalkingSection(),
  4380. this.player.fastForwardActivePanoFlight(),
  4381. !0)
  4382. }
  4383. ,
  4384. t.prototype.handlePlayerMove = function(e) {
  4385. this.transitionStage === v.Interlude && this.interrupt(p.NONE),
  4386. this.emit("update.controls")
  4387. }
  4388. ,
  4389. t.prototype.handlePlayerPanoChosen = function(e, t) {
  4390. this.intermediateState() || e.id === t.id || (this.onTheBus = !1,
  4391. this.emit("update.controls"))
  4392. }
  4393. ,
  4394. t.prototype.handlePlayerModeChanged = function(e, t) {
  4395. this.intermediateState() || e === t || (this.onTheBus = !1,
  4396. this.emit("update.controls"))
  4397. }
  4398. ,
  4399. t.prototype.handlePlayerInputStart = function(e) {
  4400. this.transitionStage === v.Interlude && this.interrupt(p.NONE)
  4401. }
  4402. ,
  4403. t.prototype.handlePlayerFlyingStarted = function() {
  4404. this.clearWalkingSectionPaused()
  4405. }
  4406. ,
  4407. t.prototype.describe = function() {
  4408. return {
  4409. nItems: this.nItems,
  4410. currentItem: this.currentItem,
  4411. destinationItem: this.destinationItem,
  4412. tourIsPlaying: this.tourIsPlaying,
  4413. onTheBus: this.onTheBus,
  4414. endlessLoop: this.endlessLoop,
  4415. viewMode: this.player.mode,
  4416. inTransition: this._inTransition(),
  4417. transitionStage: this.transitionStage,
  4418. tourInProgress: this.tourInProgress
  4419. }
  4420. }
  4421. ,
  4422. t.prototype._inTransition = function() {
  4423. return this.player.flying || this.player.isWarping() || this.player.isWaitingToWarp() || this.player.mode === s.TRANSITIONING || this.tourIsPlaying
  4424. }
  4425. ,
  4426. t.prototype.bounceable = function() {
  4427. var e = this.clock.getDelta();
  4428. return this.isInterrupted() || e < .9 && .01 < e || this.player.flying && !this.player.isWarping()
  4429. }
  4430. ,
  4431. t.prototype.itemCompare = function(item1, item2, type){//add
  4432. if(type == 'equal'){//==
  4433. return item1 && item2 && item1[0] == item2[0] && item1[1] == item2[1]
  4434. }else if(type == 'less'){//<
  4435. return item1 && item2 && (item1[0] < item2[0]) || (item1[0] == item2[0] && item1[1] < item2[1])
  4436. }
  4437. }
  4438. t.prototype.currentMoveDirection = function() {
  4439. //return null === this.currentItem || void 0 === this.currentItem ? y.Forward : this.destinationItem === this.currentItem ? y.NoChange : this.destinationItem > this.currentItem ? y.Forward : y.Backwards
  4440. return null === this.currentItem || void 0 === this.currentItem ? y.Forward : this.itemCompare(this.destinationItem, this.currentItem,'equal') ? y.NoChange : this.itemCompare(this.currentItem, this.destinationItem,'less') ? y.Forward : y.Backwards
  4441. }
  4442. ,
  4443. t.prototype.clearPath = function() {
  4444. this._inTransition() || this.player.path.discardPathObject()
  4445. }
  4446. ,
  4447. t.prototype.allFloors = function() {
  4448. this.model.toggleAllFloors()
  4449. }
  4450. ,
  4451. t.prototype.actionComplete = function(e) {
  4452. if (this.interrupted = !1,
  4453. this.transitionStage = v.None,
  4454. this.resetSpecialTransition(),
  4455. null !== this.destinationItem && this.setCurrentItem(this.destinationItem),
  4456. this.tourIsPlaying || (this.player.disablePreRendering(),
  4457. this.player.mode === s.PANORAMA && this.player.currentPano.isAligned() && this.model.fadePanoMarkers()),
  4458. this.emit("update.controls"),
  4459. this.nextFunc) {
  4460. var t = this.nextFunc;
  4461. this.nextFunc = null,
  4462. t()
  4463. }
  4464. }
  4465. ,
  4466. t.prototype.awaitCompletion = function(e, t) {
  4467. this.nextFunc = t,
  4468. e()
  4469. }
  4470. ,
  4471. t.prototype.updateSuccessFunction = function(e) {
  4472. this.nextFunc = e
  4473. }
  4474. ,
  4475. t.prototype.interrupt = function(e, t) {
  4476. return !!this.wouldInterrupt() && (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4477. this.tourIsPlaying = !1,
  4478. this.bgmReplay(),
  4479. this.interrupted = !0,
  4480. this.nextFunc = null,
  4481. this.emit(u.ActionInterrupted),
  4482. null != e || (e = p.BEGINNING),
  4483. this.player.interruptAndFastForward(e, t),
  4484. !0)
  4485. }
  4486. ,
  4487. t.prototype.wouldInterrupt = function() {
  4488. return this.transitionStage !== v.None
  4489. }
  4490. ,
  4491. t.prototype.intermediateState = function() {
  4492. return this.transitionStage !== v.None
  4493. }
  4494. ,
  4495. t.prototype.isInterrupted = function() {
  4496. return this.interrupted
  4497. }
  4498. ,
  4499. t.prototype.pauseWalkingSection = function() {
  4500. this.walkingSectionPaused = !0
  4501. }
  4502. ,
  4503. t.prototype.clearWalkingSectionPaused = function() {
  4504. this.walkingSectionPaused = !1
  4505. }
  4506. ,
  4507. t.prototype.autoTour = function() {
  4508. var i = Date.now();
  4509. this.model.auxDataPromise.then(function() {
  4510. i = Date.now() - i;
  4511. var e = r.warp.auto
  4512. , t = this.model.data && this.model.data.player_options/* && this.model.data.player_options.highlight_reel */;
  4513. 0 <= e && 1 < this.model.heroCount() && t && o.trigger({
  4514. duration: Math.max(1e3 * Math.min(300, e) - i, 0),
  4515. done: function() {
  4516. this.playTour()
  4517. }
  4518. .bind(this),
  4519. name: "_atr",
  4520. id: A
  4521. })
  4522. }
  4523. .bind(this))
  4524. }
  4525. ,
  4526. t.prototype.atDestinationPano = function() {
  4527. if (!this.player.currentPano || null === this.destinationItem)
  4528. return !1;
  4529. var e = this.player.currentPano.id;
  4530. if (void 0 === e)
  4531. return !1;
  4532. var t = this.model.heroLocations;
  4533. //return null !== this.destinationItem && void 0 !== t[this.destinationItem] && e === t[this.destinationItem].panoId
  4534. var destination = this.destinationItem && this.model.getHeroDescriptorByIndex(this.destinationItem)
  4535. return destination && destination.panoId == e
  4536. }
  4537. ,
  4538. t.prototype.redirectToItem = function(e, t) {
  4539. if (null != e)
  4540. if (this.wouldInterrupt())
  4541. if (this.player.mode !== s.TRANSITIONING) {
  4542. m.debug("Director.redirectToItem() -> Redirecting to " + e + " via " + t);
  4543. var i = function() {
  4544. o.setTimeout(function() {
  4545. this.setDestinationItem(e),
  4546. this.goToDestination(!0, p.BEGINNING, r.warp.warpInterruptionRedirectTime, !1)
  4547. }
  4548. .bind(this), 0)
  4549. }
  4550. .bind(this);
  4551. this.interrupt(p.END, 0),
  4552. this.updateSuccessFunction(i)
  4553. } else
  4554. m.debug("Director.redirectToItem() -> Cannot redirect while transitioning.");
  4555. else
  4556. m.warn("Director.redirectToItem() -> Director cannot redirect if there is nothing to interrupt.");
  4557. else
  4558. m.warn("Director.redirectToItem() -> Redirecting to null item.")
  4559. }
  4560. ,
  4561. t.prototype.useSpecialTransition = function(e) {
  4562. void 0 !== e && this.defaultWarpStyle !== c.BLACK && m.debug("useSpecialTransition(): " + e),
  4563. this.nextWarpStyle = c.BLACK
  4564. }
  4565. ,
  4566. t.prototype.resetSpecialTransition = function() {
  4567. this.nextWarpStyle = this.defaultWarpStyle
  4568. }
  4569. ,
  4570. t.prototype.arrivedAtDestination = function(e) {
  4571. if (this.player.flying || this.player.isWarping())
  4572. m.warn("Cannot advance to interlude or aiming while player is flying or warping.");
  4573. else {
  4574. this.transitionStage = v.Aiming;
  4575. var t = this.tourIsPlaying ? this.tourInterlude.bind(this, this.nextItem(this.currentItem)) : null;
  4576. this.player.model.fadePanoMarkers(0),
  4577. this.awaitCompletion(function() {
  4578. this.resetSpecialTransition(),
  4579. e ? this.player.aimTourCamera(this.destinationItem, g.Retain, g.Slow, this.actionComplete.bind(this)) : this.actionComplete()
  4580. }
  4581. .bind(this), t)
  4582. }
  4583. }
  4584. ,
  4585. t.prototype.goToDestination = function(e, t, i, n) {
  4586. //音频
  4587. if(this.destinationItem[1] == 0){//如果是每个folder的起始
  4588. var musicInfo = this.model.heroLocations[this.destinationItem[0]].musicInfo
  4589. if(musicInfo && musicInfo.music){
  4590. var o = musicInfo.music.includes(g_Prefix.slice(-10)) ? musicInfo.music : g_Prefix + musicInfo.music;
  4591. g_tourAudio.src = manage.dealURL(o);
  4592. g_tourAudio.load()
  4593. }
  4594. }
  4595. if (this.onTheBus = !0,
  4596. this.emit("update.controls"),
  4597. this.player.updateLastView(),
  4598. n || !this.atDestinationPano())
  4599. if (this.player.flying || this.player.isWarping())
  4600. m.warn("Cannot go to new destination while player is flying or warping.");
  4601. else {
  4602. var a = this.model.getHeroDescriptorByIndex(this.destinationItem)
  4603. , s = null
  4604. , l = null;
  4605. if (a.isPano()) {
  4606. o = this.getMomentTour(this.destinationItem) //window.MP_PREFETCHED_MODELDATA.momentTour || "walk";
  4607. l = this.player.warpToPanoByHeroIndex.bind(this.player, this.destinationItem, g.Show, f.Slow, o, !0, i, this.actionComplete.bind(this)),
  4608. s = this.arrivedAtDestination.bind(this, !0)
  4609. } else{
  4610. l = this.player.warpToNonPanoByHeroIndex.bind(this.player, this.destinationItem, this.actionComplete.bind(this)),
  4611. s = this.arrivedAtDestination.bind(this, !1);
  4612. }
  4613. this.transitionStage = v.Moving,
  4614. this.model.fadePanoMarkers(0),
  4615. this.awaitCompletion(function() {
  4616. l()
  4617. }
  4618. .bind(this), s),
  4619. this.emit("update.controls")
  4620. }
  4621. else
  4622. this.arrivedAtDestination(!0)
  4623. }
  4624. ,
  4625. t.prototype.tourInterlude = function() {
  4626. if (l.trackAlways("reach_highlight", {
  4627. reach_source: this.reachSource
  4628. }),
  4629. this.model.fadePanoMarkers(0),
  4630. this.emit("update.controls"),
  4631. this.tourIsPlaying)
  4632. return this.atEndOfTour() && !this.endlessLoop ? (this.tourInProgress = !1,
  4633. this.stopTour(),
  4634. this.emit(u.TourEnd),
  4635. void (this.player.mode === s.PANORAMA && this.model.fadePanoMarkers(r.panorama.markerOpacity))) : void this.awaitCompletion(function() {
  4636. this.transitionStage = v.Interlude,
  4637. this.player.tourInterlude(this.nextItem(this.currentItem), this.actionComplete.bind(this))
  4638. }
  4639. .bind(this), this.goNext.bind(this))
  4640. }
  4641. ,
  4642. t.prototype.playTour = function() {
  4643. if (!this.bounceable())
  4644. return this.tourIsPlaying ? void m.info("tour is already playing") : void (this.wouldInterrupt() || (this.player.emit("tour_auto", this.defaultWarpStyle),
  4645. this.tourInProgress = !0,
  4646. this.reachSource = "play",
  4647. this.tourIsPlaying = !0,
  4648. this.wasZoomEnabled = this.player.zoomEnabled,
  4649. this.player.zoomEnabled = !1,
  4650. this.resetSpecialTransition(),
  4651. this.emit("update.controls"),
  4652. this.emit(u.TourStart),
  4653. this.player.enablePreRendering(),
  4654. this.walkingSectionPaused ? (this.clearWalkingSectionPaused(),
  4655. this.goToDestination()) : this.goNext()))
  4656. }
  4657. ,
  4658. t.prototype.bgmReplay = function() {
  4659. if(g_bgAudio && g_bgAudio.paused && g_bgAudio.pauseByTour){
  4660. g_playAudio = g_bgAudio;
  4661. g_tourAudio && g_tourAudio.pause();
  4662. //window.tourAudio && window.tourAudio.pause();
  4663. manage.switchBgmState(true);
  4664. }
  4665. }
  4666. ,
  4667. t.prototype.stopTour = function(isAutoStop) {//停止导览 isAutoStop 希望仅在飞完结束自动停止时的stopTour不停止tourSound, 这样才能完整播放tourSound. 不过似乎会在倒数第二个片段点击按钮停止导览时也视作自动结束的(执行this.interrupt() )。
  4668. this.isInterrupted() || this.transitionStage === v.Moving && this.checkAndHandleWalkingtourInterruption(this.nextWarpStyle) || (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4669. this.tourIsPlaying = !1,
  4670. (!isAutoStop || g_tourAudio && g_tourAudio.paused )&&this.bgmReplay(),//xzw
  4671. this.interrupt(),
  4672. this.clearWalkingSectionPaused(),
  4673. this.resetSpecialTransition(),
  4674. this.emit("update.controls"))
  4675. if(!isAutoStop && g_tourAudio && g_tourAudio.paused == false )
  4676. {
  4677. g_tourAudio.pause();
  4678. g_tourAudio.src = ""
  4679. }
  4680. }
  4681. ,
  4682. t.prototype.endTourProgress = function() {
  4683. this.tourInProgress = !1,
  4684. this.emit("update.controls"),
  4685. this.emit(u.TourEnd)
  4686. }
  4687. ,
  4688. t.prototype.goToHighlight = function(e) {
  4689. if (this.wouldInterrupt())
  4690. this.itemCompare(this.destinationItem,e,'equal') ? this.interrupt() : this.redirectToItem(e, "goToHighlight");
  4691. else {
  4692. if (m.debug("<tour.goto " + e + ">"),
  4693. this.isInterrupted())
  4694. return;
  4695. this.clearWalkingSectionPaused(),
  4696. this.setDestinationItem(e),
  4697. this.useSpecialTransition("Hilight"),
  4698. this.goToDestination(),
  4699. l.trackAlways("reach_highlight", {
  4700. reach_source: "thumb"
  4701. })
  4702. }
  4703. }
  4704. ,
  4705. t.prototype.prevHighlight = function() {
  4706. this.bounceable() || (this.player.emit("tour_manual", "prev"),
  4707. this.interrupt(p.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4708. this.reachSource = "prev",
  4709. this.goPrev()))
  4710. }
  4711. ,
  4712. t.prototype.nextHighlight = function() {
  4713. this.bounceable() || (this.player.emit("tour_manual", "next"),
  4714. this.interrupt(p.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4715. this.reachSource = "next",
  4716. this.goNext()))
  4717. }
  4718. ,
  4719. t.prototype.changeMode = function(e) {
  4720. var t = $.Deferred()
  4721. , i = t.resolve.bind(t)
  4722. , n = t.reject.bind(t);
  4723. if (this.emit(u.StartModeChange),
  4724. !function() {
  4725. return this.clearWalkingSectionPaused(),
  4726. !!this.wouldInterrupt() && (this.interrupt(),
  4727. !0)
  4728. }
  4729. .bind(this)()) {
  4730. switch (e) {
  4731. case s.PANORAMA:
  4732. this.player.mode === s.PANORAMA ? this.player.currentPano.isAligned() || this.player.goToLastView(!0).done(i).fail(n) : this.player.insideMode(this.player.lastInsideView.pano).done(i).fail(n);
  4733. break;
  4734. case s.DOLLHOUSE:
  4735. case s.FLOORPLAN:
  4736. this.player.flyToNewMode({
  4737. mode: e
  4738. }).done(i).fail(n);
  4739. break;
  4740. case s.OUTDOOR:
  4741. this.player.model.has360Views && (this.player.mode !== s.PANORAMA || this.player.mode === s.PANORAMA && this.player.currentPano.isAligned()) && this.player.goToLastView(!1).done(i).fail(n)
  4742. }
  4743. return t.promise()
  4744. }
  4745. }
  4746. ,
  4747. t.prototype.atEndOfTour = function(item) {
  4748. //return this.currentItem >= this.nItems - 1
  4749. var end = this.currentItem && this.currentItem[0] >= this.nItems - 1;
  4750. if(end){
  4751. var heroLocations = this.model.heroLocations[this.nItems-1].heroLocations
  4752. if(heroLocations){
  4753. end = this.currentItem[1] >= heroLocations.length - 1
  4754. }
  4755. }
  4756. return end;
  4757. }
  4758. ,
  4759. t.prototype.firstDestination = function() {
  4760. //return 0 < this.nItems ? 0 : null
  4761. return 0 < this.nItems ? [0,0]: null
  4762. }
  4763. ,
  4764. t.prototype.finalDestination = function() {
  4765. //return 0 < this.nItems ? this.nItems - 1 : null
  4766. return 0 < this.nItems ? [this.nItems - 1,0]: null
  4767. }
  4768. ,
  4769. t.prototype.goPrev = function() {
  4770. this.tourAdvance(-1)
  4771. }
  4772. ,
  4773. t.prototype.goNext = function() {
  4774. this.tourAdvance(1)
  4775. }
  4776. ,
  4777. t.prototype.setDestinationItem = function(e) {
  4778. this.destinationItem = e,
  4779. this.emit("update.controls")
  4780. }
  4781. ,
  4782. t.prototype.setCurrentItem = function(e) {
  4783. this.currentItem = e,
  4784. this.emit("update.controls")
  4785. }
  4786. ,
  4787. t.prototype.nextItem = function(currentItem) {
  4788. //return null === e ? this.firstDestination() : e >= this.nItems - 1 ? this.endlessLoop ? this.firstDestination() : null : e + 1
  4789. if(currentItem == void 0)return this.firstDestination()
  4790. var currentLocation = this.model.heroLocations[currentItem[0]];
  4791. var currentChildNum = currentLocation.heroLocations ? currentLocation.heroLocations.length : 1
  4792. var item;
  4793. if(this.currentItem[1] >= currentChildNum - 1){//子目录中最后一个
  4794. item = [currentItem[0] + 1, 0] //结果可能超出nItems
  4795. }else{
  4796. item = [currentItem[0] , currentItem[1]+1]
  4797. }
  4798. if(item[0] >= this.nItems ){
  4799. item = this.firstDestination()
  4800. }
  4801. return item;
  4802. //暂时不理会endlessLoop,默认为false
  4803. }
  4804. ,
  4805. t.prototype.prevItem = function(currentItem) {
  4806. //return null === e ? this.firstDestination() : e < 0 ? this.endlessLoop ? this.lastDestination() : null : e - 1
  4807. if(currentItem == void 0)return this.firstDestination()//finalDestination?
  4808. var item;
  4809. var lastLocation = this.model.heroLocations[currentItem[0]-1];
  4810. if(!lastLocation) return this.finalDestination()//[-1, 0]//this.setDestinationItem([-1, 0]) //结果小于0
  4811. else{
  4812. var lastChildNum = lastLocation.heroLocations ? lastLocation.heroLocations.length : 1
  4813. if(this.currentItem[1] == 0){//子目录中第一个
  4814. return [currentItem[0] - 1, lastChildNum-1]
  4815. }else{
  4816. return [currentItem[0], currentItem[1]-1]
  4817. }
  4818. }
  4819. }
  4820. ,
  4821. t.prototype.tourAdvance = function(e) {//e是1或-1
  4822. m.debug("tourAdvance(" + e + ")")
  4823. if(null === this.currentItem || void 0 === this.currentItem){
  4824. this.setDestinationItem(this.firstDestination())
  4825. }else{
  4826. var item
  4827. if(e == 1){
  4828. item = this.nextItem(this.currentItem)
  4829. /* var currentLocation = this.model.heroLocations[this.currentItem[0]];
  4830. var currentChildNum = currentLocation.heroLocations ? currentLocation.heroLocations.length : 1
  4831. if(this.currentItem[1] >= currentChildNum - 1){//子目录中最后一个
  4832. this.setDestinationItem([this.currentItem[0] + 1, 0]) //结果可能超出nItems
  4833. }else{
  4834. this.setDestinationItem([this.currentItem[0] , this.currentItem[1]+1])
  4835. } */
  4836. }else if(e == -1){
  4837. item = this.prevItem(this.currentItem)
  4838. /* var lastLocation = this.model.heroLocations[this.currentItem[0]-1];
  4839. if(!lastLocation) this.setDestinationItem([-1, 0]) //结果小于0
  4840. else{
  4841. var lastChildNum = lastLocation.heroLocations ? lastLocation.heroLocations.length : 1
  4842. if(this.currentItem[1] == 0){//子目录中第一个
  4843. this.setDestinationItem([this.currentItem[0] - 1, lastChildNum-1])
  4844. }else{
  4845. this.setDestinationItem([this.currentItem[0], this.currentItem[1]-1])
  4846. }
  4847. } */
  4848. }
  4849. //this.setDestinationItem(this.currentItem + e)
  4850. this.setDestinationItem(item)
  4851. }
  4852. if(this.itemCompare(this.destinationItem, this.finalDestination(), 'equal')[0] < 0 ){
  4853. this.useSpecialTransition("reverse-looping to end")
  4854. }else if(this.itemCompare(this.destinationItem, this.firstDestination(), 'equal')){
  4855. this.useSpecialTransition("looping back to start")
  4856. }
  4857. /* if(this.destinationItem[0] < 0 ){
  4858. this.setDestinationItem(this.finalDestination())
  4859. this.useSpecialTransition("reverse-looping to end")
  4860. }else{
  4861. this.destinationItem[0] >= this.nItems && (this.setDestinationItem(this.firstDestination()),
  4862. this.useSpecialTransition("looping back to start"))
  4863. } */
  4864. var momentTour = this.getMomentTour(this.destinationItem);
  4865. if ( "black" === momentTour) { // 方奕卓 瞬间过渡, 相机缩放至1
  4866. var i = this.player.zoomLevel;
  4867. this.player.zoomEnabled = !0;
  4868. var t = function(e, t) {
  4869. this.player.zoomTo((1 - e) * i, !0)
  4870. }
  4871. .bind(this);
  4872. o.start(t, 1500, function() {}, 0, h.easeOutQuad, "zoom")
  4873. }
  4874. this.goToDestination()
  4875. }
  4876. ,
  4877. t.prototype.getMomentTour = function(destinationItem) {//add
  4878. /* if(!item) return window.MP_PREFETCHED_MODELDATA.momentTour || "walk";
  4879. var currentLocation = this.model.heroLocations[item[0]];
  4880. var currentChildNum = currentLocation.heroLocations ? currentLocation.heroLocations.length : 1
  4881. if(item[1]>=currentChildNum-1){//子目录中最后一个
  4882. return window.MP_PREFETCHED_MODELDATA.momentTour || "walk";
  4883. }else{
  4884. return currentLocation.momentTour || "walk";
  4885. } */
  4886. if(!destinationItem || destinationItem[1] == 0) return window.MP_PREFETCHED_MODELDATA.momentTour || "walk";
  4887. else{
  4888. var currentLocation = this.model.heroLocations[destinationItem[0]];
  4889. return currentLocation.momentTour || "walk";
  4890. }
  4891. }
  4892. ,
  4893. I.exports = t
  4894. }
  4895. ).call(this, "/js/director.js")
  4896. }
  4897. , {
  4898. "./analytics": 4,
  4899. "./enum/BlackoutStyle": 18,
  4900. "./enum/ControlEvents": 21,
  4901. "./enum/DirectorEvents": 23,
  4902. "./enum/ModelManagerEvents": 33,
  4903. "./enum/PathDiscardMode": 38,
  4904. "./enum/PathDisplayMode": 39,
  4905. "./enum/PlayerEvents": 40,
  4906. "./enum/Viewmode": 51,
  4907. "./enum/WarpStyle": 52,
  4908. "./model/ModelManager": 140,
  4909. "./player": 155,
  4910. "./settings": 166,
  4911. "./util/logger": 189,
  4912. "./util/transitions": 195,
  4913. events: 202,
  4914. three: 217
  4915. }],
  4916. 16: [function(e, t, i) {
  4917. "use strict";
  4918. var n = e("three")
  4919. , r = e("./enum/Viewmode")
  4920. , o = (e("./settings"),
  4921. e("./util/transitions"))
  4922. , a = e("./enum/PlayerEvents")
  4923. , s = new n.ShaderPass(n.HorizontalBlurShader)
  4924. , l = new n.ShaderPass(n.VerticalBlurShader);
  4925. l.renderToScreen = !0;
  4926. var c = $("#player").width() / $("#player").height();
  4927. isNaN(c) && (c = 1);
  4928. var h = {
  4929. currentBlur: 0,
  4930. aspect: c,
  4931. blurStrength: 1,
  4932. hblurPass: s,
  4933. vblurPass: l,
  4934. bindEvents: function(e) {
  4935. e.on(a.ModeChanged, function(e, t) {
  4936. e === r.PANORAMA && (o.cancel(h.blur),
  4937. o.cancel(h.addBlur),
  4938. o.start(h.removeBlur, 500, null, 0, null, "deblur"))
  4939. })
  4940. },
  4941. blur: function(e) {
  4942. var t = (h.currentBlur = e) * h.blurStrength;
  4943. l.uniforms.v.value = t / 512 * h.aspect,
  4944. s.uniforms.h.value = t / 512
  4945. },
  4946. addBlur: function(e) {
  4947. e = Math.max(e, h.currentBlur),
  4948. h.blur(e)
  4949. },
  4950. removeBlur: function(e) {
  4951. e = Math.min(1 - e, h.currentBlur),
  4952. h.blur(e)
  4953. }
  4954. };
  4955. h.blur(0),
  4956. t.exports = h
  4957. }
  4958. , {
  4959. "./enum/PlayerEvents": 40,
  4960. "./enum/Viewmode": 51,
  4961. "./settings": 166,
  4962. "./util/transitions": 195,
  4963. three: 217
  4964. }],
  4965. 17: [function(e, t, i) {
  4966. "use strict";
  4967. t.exports = {
  4968. UNKNOWN: 0,
  4969. ALIGNED: 1,
  4970. UNALIGNED: 2,
  4971. PLACED: 3
  4972. }
  4973. }
  4974. , {}],
  4975. 18: [function(e, t, i) {
  4976. "use strict";
  4977. t.exports = {
  4978. NONE: 0,
  4979. MIDDLE: 1,
  4980. END: 2,
  4981. BEGINNING: 3,
  4982. FADEIN: 4
  4983. }
  4984. }
  4985. , {}],
  4986. 19: [function(e, t, i) {
  4987. "use strict";
  4988. var r = e("three");
  4989. t.exports = {
  4990. newBlue: new r.Color(4967932),
  4991. altBlue: new r.Color(47355),
  4992. tagDefault: new r.Color(223357),
  4993. classicBlue: new r.Color(53759),
  4994. mpYellow: new r.Color(16502016),
  4995. mpOrange: new r.Color(16428055),
  4996. mpBlue: new r.Color(12096),
  4997. mpLtGrey: new r.Color(13751252),
  4998. mpDkGrey: new r.Color(10000019),
  4999. mpRed: new r.Color(12525854),
  5000. mpOrangeDesat: new r.Color(16764529),
  5001. mpBlueDesat: new r.Color(4034734),
  5002. mpRedDesat: new r.Color(14705505),
  5003. white: new r.Color(16777215),
  5004. black: new r.Color(0),
  5005. _desat: function(e, t) {
  5006. var i = t || .3
  5007. , n = (new r.Color).copy(e).getHSL();
  5008. return (new r.Color).setHSL(n.h, n.s * (1 - i), n.l)
  5009. },
  5010. _darken: function(e, t) {
  5011. var i = t || .2
  5012. , n = e.getHSL();
  5013. return (new r.Color).setHSL(n.h, n.s, n.l * (1 - i))
  5014. }
  5015. }
  5016. }
  5017. , {
  5018. three: 217
  5019. }],
  5020. 20: [function(e, t, i) {
  5021. "use strict";
  5022. t.exports = {
  5023. NONE: -1,
  5024. ROTATE: 0,
  5025. DOLLY: 1,
  5026. PAN: 2,
  5027. ROTATE_DOLLY: 3,
  5028. PAN_DOLLY: 4
  5029. }
  5030. }
  5031. , {}],
  5032. 21: [function(e, t, i) {
  5033. "use strict";
  5034. t.exports = {
  5035. Move: "move",
  5036. InteractionDirect: "interaction.direct",
  5037. InteractionKey: "interaction.key",
  5038. InteractionGui: "interaction.gui",
  5039. FlyInDirection: "fly.direction",
  5040. InputStart: "input.start",
  5041. Pinch: "input.pinch",
  5042. Scroll: "input.scroll",
  5043. AutoPanInterrupt: "autopan.interrupt",
  5044. AutoPanComplete: "autopan.complete",
  5045. AutoPanClamped: "autopan.clamped",
  5046. LongTap: "longtap"
  5047. }
  5048. }
  5049. , {}],
  5050. 22: [function(e, t, i) {
  5051. "use strict";
  5052. t.exports = Object.freeze({
  5053. FORWARD: "FORWARD",
  5054. LEFT: "LEFT",
  5055. RIGHT: "RIGHT",
  5056. BACK: "BACK",
  5057. UP: "UP",
  5058. DOWN: "DOWN"
  5059. })
  5060. }
  5061. , {}],
  5062. 23: [function(e, t, i) {
  5063. "use strict";
  5064. t.exports = {
  5065. ActionInterrupted: "action.interrupted",
  5066. TourStart: "tour.start",
  5067. TourEnd: "tour.end",
  5068. StartModeChange: "mode.startChange"
  5069. }
  5070. }
  5071. , {}],
  5072. 24: [function(e, t, i) {
  5073. "use strict";
  5074. t.exports = Object.freeze({
  5075. None: 0,
  5076. Queued: 1,
  5077. ForceQueued: 2,
  5078. Downloading: 3,
  5079. Downloaded: 4,
  5080. DownloadFailed: 5
  5081. })
  5082. }
  5083. , {}],
  5084. 25: [function(e, t, i) {
  5085. "use strict";
  5086. t.exports = {
  5087. GL_TEXTURE_CUBE_MAP_POSITIVE_X: 0,
  5088. GL_TEXTURE_CUBE_MAP_NEGATIVE_X: 1,
  5089. GL_TEXTURE_CUBE_MAP_POSITIVE_Y: 2,
  5090. GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: 3,
  5091. GL_TEXTURE_CUBE_MAP_POSITIVE_Z: 4,
  5092. GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: 5
  5093. }
  5094. }
  5095. , {}],
  5096. 26: [function(e, t, i) {
  5097. "use strict";
  5098. t.exports = {
  5099. Texture2D: 0,
  5100. TextureCube: 1
  5101. }
  5102. }
  5103. , {}],
  5104. 27: [function(e, t, i) {
  5105. "use strict";
  5106. t.exports = {
  5107. SMALL: "small",
  5108. LARGE: "large"
  5109. }
  5110. }
  5111. , {}],
  5112. 28: [function(e, t, i) {
  5113. "use strict";
  5114. var n = e("./Viewmode")
  5115. , r = {
  5116. LANDING: {},
  5117. NAVIGATION: "navigation",
  5118. MORE_HELP: "moreHelp",
  5119. TOUR_INTERACTION: {}
  5120. };
  5121. r.LANDING[n.PANORAMA] = "panorama.landing",
  5122. r.LANDING[n.OUTDOOR] = "outdoor.landing",
  5123. r.LANDING[n.DOLLHOUSE] = "dollhouse.landing",
  5124. r.LANDING[n.FLOORPLAN] = "floorplan.landing",
  5125. r.TOUR_INTERACTION.standard = "standard.tour",
  5126. r.TOUR_INTERACTION[n.OUTDOOR] = "outdoor.tour",
  5127. r.TOUR_INTERACTION[n.FLOORPLAN] = "floorplan.tour",
  5128. t.exports = r
  5129. }
  5130. , {
  5131. "./Viewmode": 51
  5132. }],
  5133. 29: [function(e, t, i) {
  5134. "use strict";
  5135. var n = {
  5136. UP: 1,
  5137. DOWN: -1,
  5138. LEFT: "L",
  5139. RIGHT: "R",
  5140. FORWARD: "F",
  5141. BACK: "B",
  5142. reverse: {},
  5143. opposite: function(e) {
  5144. return this.reverse[e.toString()]
  5145. }
  5146. };
  5147. n.reverse[n.UP] = n.DOWN,
  5148. n.reverse[n.DOWN] = n.UP,
  5149. n.reverse[n.LEFT] = n.RIGHT,
  5150. n.reverse[n.RIGHT] = n.LEFT,
  5151. n.reverse[n.FORWARD] = n.BACK,
  5152. n.reverse[n.BACK] = n.FORWARD,
  5153. t.exports = n
  5154. }
  5155. , {}],
  5156. 30: [function(e, t, i) {
  5157. "use strict";
  5158. var n = {
  5159. ZERO: 48,
  5160. ONE: 49,
  5161. TWO: 50,
  5162. THREE: 51,
  5163. FOUR: 52,
  5164. FIVE: 53,
  5165. SIX: 54,
  5166. SEVEN: 55,
  5167. EIGHT: 56,
  5168. NINE: 57,
  5169. LEFTARROW: 37,
  5170. UPARROW: 38,
  5171. RIGHTARROW: 39,
  5172. DOWNARROW: 40,
  5173. A: 65,
  5174. B: 66,
  5175. C: 67,
  5176. D: 68,
  5177. E: 69,
  5178. F: 70,
  5179. G: 71,
  5180. H: 72,
  5181. I: 73,
  5182. J: 74,
  5183. K: 75,
  5184. L: 76,
  5185. M: 77,
  5186. N: 78,
  5187. O: 79,
  5188. P: 80,
  5189. Q: 81,
  5190. R: 82,
  5191. S: 83,
  5192. T: 84,
  5193. U: 85,
  5194. V: 86,
  5195. W: 87,
  5196. X: 88,
  5197. Y: 89,
  5198. Z: 90,
  5199. SPACE: 32,
  5200. RETURN: 13,
  5201. SEMICOLON: 186,
  5202. PLUSEQUALS: 187,
  5203. DASHUNDERSCORE: 189,
  5204. OPENBRACKET: 219
  5205. };
  5206. e("../util/browser").detectFirefox() && (n.SEMICOLON = 59,
  5207. n.PLUSEQUALS = 61,
  5208. n.DASHUNDERSCORE = 173),
  5209. t.exports = n
  5210. }
  5211. , {
  5212. "../util/browser": 182
  5213. }],
  5214. 31: [function(e, t, i) {
  5215. "use strict";
  5216. t.exports = {
  5217. EN_US: "en-US",
  5218. ES_MX: "es-MX",
  5219. FR_FR: "fr-FR",
  5220. DE_DE: "de-DE",
  5221. RU_RU: "ru-RU",
  5222. CN_CN: "cn-CN",
  5223. JP_JP: "jp-JP"
  5224. }
  5225. }
  5226. , {}],
  5227. 32: [function(e, t, i) {
  5228. "use strict";
  5229. t.exports = {
  5230. TagActivated: "tag.activated",
  5231. TagDismissed: "tag.dismissed",
  5232. TagNavigation: "tag.navigation"
  5233. }
  5234. }
  5235. , {}],
  5236. 33: [function(e, t, i) {
  5237. "use strict";
  5238. t.exports = {
  5239. ModelAdded: "model-added",
  5240. ActiveModelChanged: "active-model-changed"
  5241. }
  5242. }
  5243. , {}],
  5244. 34: [function(e, t, i) {
  5245. "use strict";
  5246. t.exports = {
  5247. LEFT: 0,
  5248. MIDDLE: 1,
  5249. RIGHT: 2
  5250. }
  5251. }
  5252. , {}],
  5253. 35: [function(e, t, i) {
  5254. "use strict";
  5255. t.exports = {
  5256. PanoRenderComplete: "panorama.render.complete",
  5257. TileRenderFailure: "panorama.tile.render.failed",
  5258. TileRenderSuccess: "panorama.tile.render.success",
  5259. TileUploadAttempted: "panorama.tile.upload.attempted",
  5260. UploadAttemptedForAllTiles: "panorama.upload.attempted.all.tiles",
  5261. ZoomLevelRenderStarted: "panorama.zoom.render.started"
  5262. }
  5263. }
  5264. , {}],
  5265. 36: [function(e, t, i) {
  5266. "use strict";
  5267. t.exports = {
  5268. BASE: 1,
  5269. STANDARD: 2,
  5270. HIGH: 3,
  5271. ULTRAHIGH: 4
  5272. }
  5273. }
  5274. , {}],
  5275. 37: [function(e, t, i) {
  5276. "use strict";
  5277. t.exports = {
  5278. LoadComplete: "panorama.load.complete",
  5279. LoadFailed: "panorama.load.failed",
  5280. TileLoaded: "panorama.tile.loaded"
  5281. }
  5282. }
  5283. , {}],
  5284. 38: [function(e, t, i) {
  5285. "use strict";
  5286. t.exports = Object.freeze({
  5287. Standard: 0,
  5288. Slow: 1,
  5289. Retain: 2
  5290. })
  5291. }
  5292. , {}],
  5293. 39: [function(e, t, i) {
  5294. "use strict";
  5295. t.exports = Object.freeze({
  5296. Show: 0,
  5297. Hide: 1,
  5298. Retain: 2
  5299. })
  5300. }
  5301. , {}],
  5302. 40: [function(e, t, i) {
  5303. "use strict";
  5304. t.exports = {
  5305. Move: "move",
  5306. MoveComplete: "move.complete",
  5307. ModeChanged: "mode.changed",
  5308. ModeChanging: "mode.changing",
  5309. PanoChosen: "pano.chosen",
  5310. ClosestPanoChanging: "closest.pano.changing",
  5311. WarpStarted: "warp.started",
  5312. WarpInterrupted: "warp.interrupted",
  5313. WarpEnded: "warp.ended",
  5314. FlyinFinished: "flyin.finished",
  5315. FlyingStarted: "flying.started",
  5316. FlyingInterrupted: "flying.interrupted",
  5317. FlyingEnded: "flying.ended",
  5318. Ready: "ready",
  5319. StartInside: "start.inside",
  5320. StartOutside: "start.outside",
  5321. ViewChanged: "view.changed",
  5322. WarpInterruptedWithFlyTo: "warp.interrupted.flyto",
  5323. InputStart: "input.start"
  5324. }
  5325. }
  5326. , {}],
  5327. 41: [function(e, t, i) {
  5328. "use strict";
  5329. t.exports = Object.freeze({
  5330. DEFAULT: 0,
  5331. PANOMARKERS: 1,
  5332. RETICULE: 2,
  5333. TAG: 3
  5334. })
  5335. }
  5336. , {}],
  5337. 42: [function(e, t, i) {
  5338. "use strict";
  5339. t.exports = {
  5340. visibleFloor: 1,
  5341. ghostFloor: 3,
  5342. boundingSkybox: 1,
  5343. panoMarker: 2,
  5344. reticule: 3,
  5345. tagStem: 4,
  5346. tagDisc: 5,
  5347. ribbon: 100
  5348. }
  5349. }
  5350. , {}],
  5351. 43: [function(e, t, i) {
  5352. "use strict";
  5353. t.exports = {
  5354. ContextCreated: "scene-renderer-context-created",
  5355. AfterRender: "after-render",
  5356. MemoryUsageUpdated: "scene-renderer-memory-usage-updated"
  5357. }
  5358. }
  5359. , {}],
  5360. 44: [function(e, t, i) {
  5361. "use strict";
  5362. t.exports = {
  5363. IDLE: "idle",
  5364. BROWSE: "browse",
  5365. EXAMINE: "examine"
  5366. }
  5367. }
  5368. , {}],
  5369. 45: [function(e, t, i) {
  5370. "use strict";
  5371. t.exports = {
  5372. TileDownloadSuccess: "tiledownloader.download.success",
  5373. TileDownloadFailure: "tiledownloader.download.failure",
  5374. PanoDownloadComplete: "tiledownloader.pano.download.complete"
  5375. }
  5376. }
  5377. , {}],
  5378. 46: [function(e, t, i) {
  5379. "use strict";
  5380. t.exports = {
  5381. CardboardAndroid: "googlevr",
  5382. GearVR: "gearvr",
  5383. CardboardIOS: "googlevrios",
  5384. Cardboard: "googlevr"
  5385. }
  5386. }
  5387. , {}],
  5388. 47: [function(e, t, i) {
  5389. "use strict";
  5390. t.exports = {
  5391. NONE: 0,
  5392. CONTEXTUAL: 1,
  5393. ANDROID: 2
  5394. }
  5395. }
  5396. , {}],
  5397. 48: [function(e, t, i) {
  5398. "use strict";
  5399. var n = {
  5400. Title: 0,
  5401. Cardboard: 1
  5402. }
  5403. , r = {
  5404. Title: 0,
  5405. Cardboard: 1,
  5406. Gear: 2
  5407. };
  5408. [n, r].forEach(function(e) {
  5409. e.pageCount = Object.keys(e).length
  5410. }),
  5411. t.exports.ios = n,
  5412. t.exports.standard = r
  5413. }
  5414. , {}],
  5415. 49: [function(e, t, i) {
  5416. "use strict";
  5417. t.exports = {
  5418. Android: "android",
  5419. IOS: "ios",
  5420. Desktop: "desktop",
  5421. UnsupportedAndroid: "android-unsupported"
  5422. }
  5423. }
  5424. , {}],
  5425. 50: [function(e, t, i) {
  5426. "use strict";
  5427. var n = e("three");
  5428. t.exports = {
  5429. UP: new n.Vector3(0,1,0),
  5430. DOWN: new n.Vector3(0,-1,0),
  5431. LEFT: new n.Vector3(-1,0,0),
  5432. RIGHT: new n.Vector3(1,0,0),
  5433. FORWARD: new n.Vector3(0,0,-1),
  5434. BACK: new n.Vector3(0,0,1)
  5435. }
  5436. }
  5437. , {
  5438. three: 217
  5439. }],
  5440. 51: [function(e, t, i) {
  5441. "use strict";
  5442. var n = e("../exception/ViewmodeConvertException")
  5443. , r = e("./coreViewmodes")
  5444. , o = {
  5445. MESH: "mesh",
  5446. OUTDOOR: "outdoor",
  5447. TRANSITIONING: "transitioning",
  5448. toInt: function(e) {
  5449. switch (e) {
  5450. case this.PANORAMA:
  5451. return 1;
  5452. case this.DOLLHOUSE:
  5453. return 2;
  5454. case this.FLOORPLAN:
  5455. return 3;
  5456. case this.OUTDOOR:
  5457. return 4;
  5458. case this.TRANSITIONING:
  5459. return -1
  5460. }
  5461. throw new n("No known conversion for Viewmode to int for mode: " + e)
  5462. },
  5463. fromInt: function(e) {
  5464. switch (e) {
  5465. case "1":
  5466. case 1:
  5467. return this.PANORAMA;
  5468. case "2":
  5469. case 2:
  5470. return this.DOLLHOUSE;
  5471. case "3":
  5472. case 3:
  5473. return this.FLOORPLAN;
  5474. case "4":
  5475. case 4:
  5476. return this.OUTDOOR
  5477. }
  5478. throw new n("No known conversion for int to viewmode for int: " + e)
  5479. },
  5480. convertWorkshopModeInt: function(e) {
  5481. switch (e) {
  5482. case "0":
  5483. case 0:
  5484. case void 0:
  5485. return this.PANORAMA;
  5486. case "1":
  5487. case 1:
  5488. return this.FLOORPLAN;
  5489. case "2":
  5490. case 2:
  5491. return this.DOLLHOUSE;
  5492. case "3":
  5493. case 3:
  5494. return this.MESH
  5495. }
  5496. throw new n("No known conversion for Workshop int to viewmode for int: " + e)
  5497. }
  5498. };
  5499. e("../util/common").extendObject(o, r),
  5500. t.exports = o
  5501. }
  5502. , {
  5503. "../exception/ViewmodeConvertException": 58,
  5504. "../util/common": 185,
  5505. "./coreViewmodes": 54
  5506. }],
  5507. 52: [function(e, t, i) {
  5508. "use strict";
  5509. t.exports = {
  5510. BLACK: "black",
  5511. STD: "std",
  5512. WALK: "walk"
  5513. }
  5514. }
  5515. , {}],
  5516. 53: [function(e, t, i) {
  5517. "use strict";
  5518. t.exports = {
  5519. ZoomIn: "zoom.in",
  5520. ZoomOut: "zoom.out",
  5521. ZoomMax: "zoom.max",
  5522. ZoomMin: "zoom.min"
  5523. }
  5524. }
  5525. , {}],
  5526. 54: [function(e, t, i) {
  5527. "use strict";
  5528. t.exports = {
  5529. PANORAMA: "panorama",
  5530. DOLLHOUSE: "dollhouse",
  5531. FLOORPLAN: "floorplan"
  5532. }
  5533. }
  5534. , {}],
  5535. 55: [function(e, t, i) {
  5536. "use strict";
  5537. t.exports = function(e) {
  5538. this.message = e
  5539. }
  5540. }
  5541. , {}],
  5542. 56: [function(e, t, i) {
  5543. "use strict";
  5544. function n(e) {
  5545. r.call(this, e)
  5546. }
  5547. var r = e("./BasicException");
  5548. n.prototype = Object.create(r.prototype),
  5549. t.exports = n
  5550. }
  5551. , {
  5552. "./BasicException": 55
  5553. }],
  5554. 57: [function(e, t, i) {
  5555. "use strict";
  5556. function n(e) {
  5557. r.call(this, e)
  5558. }
  5559. var r = e("./BasicException");
  5560. n.prototype = Object.create(r.prototype),
  5561. t.exports = n
  5562. }
  5563. , {
  5564. "./BasicException": 55
  5565. }],
  5566. 58: [function(e, t, i) {
  5567. "use strict";
  5568. function n(e) {
  5569. r.call(this, e)
  5570. }
  5571. var r = e("./BasicException");
  5572. n.prototype = Object.create(r.prototype),
  5573. t.exports = n
  5574. }
  5575. , {
  5576. "./BasicException": 55
  5577. }],
  5578. 59: [function(a, s, e) {
  5579. (function(e) {
  5580. "use strict";
  5581. var i = a("./util/ajax")
  5582. , n = a("./util/showcase")
  5583. , t = a("./util/logger")
  5584. , r = new t(e)
  5585. , o = {};
  5586. s.exports = {
  5587. loadFeatureFlags: function(e) {
  5588. var t = $.Deferred();
  5589. return i.get(e.urlBase + "", {
  5590. responseType: "json",
  5591. prefetchFrom: "user",
  5592. auth: n.getAuthorizationHeader()
  5593. }).done(function(e) {
  5594. (o = function(e) {
  5595. var t = {};
  5596. if (e) {
  5597. var i = e.flags;
  5598. if (i)
  5599. for (var n in i)
  5600. i.hasOwnProperty(n) && (t[i[n]] = !0);
  5601. return t
  5602. }
  5603. return r.debug("Feature flags -> parseFeatureFlags: rawData is null."),
  5604. null
  5605. }(e)) ? t.resolve(o) : t.reject("loading-failed")
  5606. }).fail(function() {
  5607. r.debug("Retrieval of feature flags failed."),
  5608. t.reject("loading-failed")
  5609. }),
  5610. t.promise()
  5611. },
  5612. getFlags: function() {
  5613. return o
  5614. },
  5615. updateDependentSettings: function(e, t) {
  5616. (e = e || o).labels && (t.labels.enabled = !0),
  5617. e.zooming && !t.zoom.forceOff && (t.zoom.enabled = !0),
  5618. e.showcase_sdk && (t.sdkInit = !0),
  5619. e.mobile_highq_override && (t.tiling.mobileHighQualityOverride = !0),
  5620. e.showcase_webvr && (t.vr.allowWebVR = !0),
  5621. e.uhql && (t.tiling.allowUltraHighResolution = !0),
  5622. e.hide_sc_sharing && (t.share.enabled = !1)
  5623. }
  5624. }
  5625. }
  5626. ).call(this, "/js/featureflags.js")
  5627. }
  5628. , {
  5629. "./util/ajax": 181,
  5630. "./util/logger": 189,
  5631. "./util/showcase": 193
  5632. }],
  5633. 60: [function(e, t, i) {
  5634. "use strict";
  5635. var n = (e("../util/common"),
  5636. {
  5637. status: 0,
  5638. set: function(e) {
  5639. if (isNaN(e))
  5640. return !1;
  5641. var t = $(".progressbar");
  5642. e < 0 && (e = 0),
  5643. 100 < e && (e = 100);
  5644. var i = e * (parseInt(t.css("width").replace("px", "")) / 100)
  5645. , n = Math.round(e)
  5646. , r = parseInt(i) - 15;
  5647. t.find(".bar").css("width", i),
  5648. t.find(".label").css("left", r),
  5649. t.find(".perc").text(n + "%"),
  5650. this.status = e
  5651. },
  5652. done: function(e) {
  5653. return e || this.status ? (this.status = null,
  5654. this.set(100)) : this
  5655. }
  5656. });
  5657. t.exports.circleLoader = n
  5658. }
  5659. , {
  5660. "../util/common": 185
  5661. }],
  5662. 61: [function(e, t, i) {
  5663. "use strict";
  5664. t.exports = Object.freeze({
  5665. CLOSE: "modal.closer.close"
  5666. })
  5667. }
  5668. , {}],
  5669. 62: [function(e, t, i) {
  5670. "use strict";
  5671. function n(t, e) {
  5672. function i() {
  5673. var e = t.offsetHeight >= $("#player").height() && t.offsetWidth >= $("#player").width();
  5674. e !== p && ((p = e) ? (t.classList.add("closeByFooter"),
  5675. c.classList.add("closeByFooter")) : (t.classList.remove("closeByFooter"),
  5676. c.classList.remove("closeByFooter")))
  5677. }
  5678. e ? setTimeout(i, r.guiAnimationSpeed) : i()
  5679. }
  5680. var r = e("../../settings")
  5681. , o = (e("../../tag/Media/MediaEvent"),
  5682. e("../../util/browser"))
  5683. , a = e("../../util/common")
  5684. , s = e("./ModalCloserEvent")
  5685. , l = e("events").EventEmitter
  5686. , c = document.getElementsByClassName("footer")[0]
  5687. , h = c.querySelectorAll(".close")[0]
  5688. , u = null
  5689. , d = null
  5690. , p = null
  5691. , f = (o.isMobile(),
  5692. {
  5693. open: function(e) {
  5694. e && (n(e),
  5695. u && h.removeEventListener("click", u, !0),
  5696. u = function(e, t) {
  5697. t && (t.stopPropagation(),
  5698. t.preventDefault()),
  5699. e && this.emit(s.CLOSE, e),
  5700. f.reset()
  5701. }
  5702. .bind(this, e.id),
  5703. h.addEventListener("click", u, !0),
  5704. d && window.removeEventListener("resize", d, !0),
  5705. d = n.bind(this, e),
  5706. window.addEventListener("resize", d, !0))
  5707. },
  5708. reset: function() {
  5709. c.classList.remove("closeByFooter"),
  5710. h.removeEventListener("click", u, !0),
  5711. window.removeEventListener("resize", d, !0),
  5712. u = d = p = null
  5713. }
  5714. });
  5715. a.extendObject(f, l.prototype),
  5716. t.exports = f
  5717. }
  5718. , {
  5719. "../../tag/Media/MediaEvent": 131,
  5720. "../../settings": 166,
  5721. "../../util/browser": 182,
  5722. "../../util/common": 185,
  5723. "./ModalCloserEvent": 61,
  5724. events: 202
  5725. }],
  5726. 63: [function(e, t, i) {
  5727. "use strict";
  5728. var A = e("../lib/dat.gui")
  5729. , C = e("three")
  5730. , I = e("../util/easing")
  5731. , E = e("../enum/Viewmode")
  5732. , _ = e("../enum/Colors")
  5733. , b = e("../enum/WarpStyle")
  5734. , w = e("../settings");
  5735. e("../tag/tag"),
  5736. A.GUI.prototype.removeFolder = function(e) {
  5737. var t = this.__folders[e];
  5738. t && (t.close(),
  5739. this.__ul.removeChild(t.domElement.parentNode),
  5740. delete this.__folders[e],
  5741. this.onResize())
  5742. }
  5743. ,
  5744. t.exports.toggle = function(t, e, i) {
  5745. var n = new A.GUI({
  5746. width: 400
  5747. })
  5748. , r = n.addFolder("Flydown from Dollhouse");
  5749. r.add(w.flydown, "movementEasing", Object.keys(I)),
  5750. r.add(w.flydown, "movementDelay", 0, 1).step(.01),
  5751. r.add(w.flydown, "rotationEasing", Object.keys(I)),
  5752. r.add(w.flydown, "rotationDelay", 0, 1).step(.01),
  5753. r.add(w.flydown, "modelTextureDelay", 0, 1).step(.01),
  5754. r.add(w.flydown, "skyboxDelay", 0, 1).step(.01),
  5755. r.add(w.dollhouseDefault, "minPolarAngle", 0, C.Math.degToRad(50)),
  5756. r.add(w.dollhouseDefault, "maxPolarAngle", C.Math.degToRad(50), C.Math.degToRad(170));
  5757. var o = n.addFolder("Transition between panos");
  5758. o.add(w.transition, "blur", 0, 10).onFinishChange(function() {}),
  5759. o.add(w.transition, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  5760. w.transition.flyTime = 0,
  5761. o.__controllers.forEach(function(e) {
  5762. e.updateDisplay()
  5763. })
  5764. }),
  5765. o.add(w.transition, "flyTime", 0, 5e3).onFinishChange(function() {
  5766. w.transition.flySpeed = 0,
  5767. o.__controllers.forEach(function(e) {
  5768. e.updateDisplay()
  5769. })
  5770. }),
  5771. o.add(w.transition, "aimTime", 500, 2500).step(50),
  5772. o.add(w.transition, "aimSlowFactor", 1, 3).step(.1),
  5773. o.add(w.transition, "movementEasing", Object.keys(I));
  5774. var a = n.addFolder("Path Display");
  5775. a.add(w.path, "opacity", 0, 1).step(.01).onFinishChange(function() {}),
  5776. a.add(w.path, "height", 0, .2).step(.01).onFinishChange(function() {}),
  5777. a.add(w.path, "outsideHeight", 0, 2).step(.01).onFinishChange(function() {}),
  5778. a.add(w.path, "ribbonWidth", .01, .35).step(.01).onFinishChange(function() {}),
  5779. a.add(w.path, "waypointRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5780. a.add(w.path, "waypointPulse", 0, 3600).step(20).onFinishChange(function() {}),
  5781. a.add(w.path, "waypointIndoorRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5782. a.add(w.path, "fadeInTime", 0, 1200).step(10).onFinishChange(function() {}),
  5783. a.add(w.path, "fadeOutTime", 0, 1200).step(10).onFinishChange(function() {}),
  5784. a.add(w.path, "color", Object.keys(_)).onFinishChange(function() {
  5785. w.path.color = _[w.path.color],
  5786. w.path.colorUp = _._desat(w.path.color),
  5787. w.path.colorDown = _.darken(w.path.color)
  5788. }),
  5789. a.add(w, "reticuleColor", Object.keys(_)).onFinishChange(function() {
  5790. w.reticuleColor = _[w.reticuleColor]
  5791. });
  5792. var s = n.addFolder("Warping")
  5793. , l = s.addFolder("Warp/Teleport");
  5794. l.add(w.warp, "softPushDist", 0, 2).onFinishChange(function() {}),
  5795. l.add(w.warp, "softPushEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5796. l.add(w.warp, "softBendAngle", 0, 45).onFinishChange(function() {}),
  5797. l.add(w.warp, "softBendTilt", 0, 45).onFinishChange(function() {}),
  5798. l.add(w.warp, "softBendEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5799. l.add(w.warp, "burnsAngle", 0, 30).onFinishChange(function() {}),
  5800. l.add(w.warp, "minBurnsAngle", 0, 10).onFinishChange(function() {}),
  5801. l.add(w.warp, "brakeStrength", 1, 8).onFinishChange(function() {}),
  5802. l.add(w.warp, "minBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  5803. l.add(w.warp, "maxBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  5804. l.add(w.path, "mapGuides").onFinishChange(function() {}),
  5805. l.add(w.warp, "teleportTime", 0, 5e3).step(10).onFinishChange(function() {}),
  5806. l.add(w.warp, "outsideTime", 0, 5e3).step(10).onFinishChange(function() {}),
  5807. l.add(w.path, "typ", Object.keys(b)).onFinishChange(function() {
  5808. w.path.typ = b[w.path.typ]
  5809. }),
  5810. l.add(w.warp, "loop").onChange(function() {}).onFinishChange(function() {
  5811. e.endlessLoop = w.warp.loop
  5812. }),
  5813. l.add(w.warp, "walkSlideShowThreshhold", 1, 1e4).step(1).onFinishChange(function() {}),
  5814. l.add(w.warp, "walkExtraPanosDistance", 0, 3).step(.1).onFinishChange(function() {}),
  5815. l.add(w.transition, "fastForwardFactor", 1, 10).step(1).onFinishChange(function() {});
  5816. var c = s.addFolder("Long Warp Only");
  5817. c.add(w.warp, "minWarpTime", 0, 5e3).step(10).onFinishChange(function() {
  5818. w.warp.flySpeed = 0,
  5819. c.__controllers.forEach(function(e) {
  5820. e.updateDisplay()
  5821. })
  5822. }),
  5823. c.add(w.warp, "timePerMeter", 0, 5e3).step(10).onFinishChange(function() {}),
  5824. c.add(w.warp, "lookAheadMax", .01, 1).step(.01).onFinishChange(function() {}),
  5825. c.add(w.warp, "lookAheadDist", .01, 4).step(.01).onFinishChange(function() {}),
  5826. c.add(w.warp, "maxTurnPerSec", 0, 720).step(1).onFinishChange(function() {}),
  5827. c.add(w.warp, "maxAimPerSec", 0, 720).step(1).onFinishChange(function() {}),
  5828. c.add(w.warp, "turnFriction", 0, 1).step(.01).onFinishChange(function() {}),
  5829. c.add(w.warp, "walkDelay", 0, 2e3).step(10).onFinishChange(function() {}),
  5830. c.add(w.transition, "flytimeMaxDistanceThreshold", 0, 25).step(10).onFinishChange(function() {}),
  5831. c.add(w.warp, "walkMaxDist", 0, 100).step(1).onFinishChange(function() {});
  5832. var h = n.addFolder("Warp Esoterica");
  5833. h.add(w.warp, "nearPanoDist", .01, 12).step(0).onFinishChange(function() {}),
  5834. h.add(w.warp, "blur", .01, 1).onFinishChange(function() {}),
  5835. h.add(w.warp, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  5836. w.warp.minWarpTime = 0,
  5837. h.__controllers.forEach(function(e) {
  5838. e.updateDisplay()
  5839. })
  5840. }),
  5841. h.add(w.warp, "showBunny").onFinishChange(function() {}),
  5842. h.add(w.warp, "fastTime", 0, 2500).step(10).onFinishChange(function() {}),
  5843. h.add(w.warp, "movementEasing", Object.keys(I));
  5844. var u = n.addFolder("Misc");
  5845. u.add(w, "dollhouseFOV", 10, 180).onChange(function() {
  5846. i.cameras[E.DOLLHOUSE].fov = w.dollhouseFOV
  5847. }),
  5848. u.add(w, "insideFOV", 10, 180).onChange(function() {
  5849. i.cameras[E.PANORAMA].fov = w.insideFOV
  5850. }),
  5851. u.add(w, "insideLookSpeed", .01, .3).step(.01).onChange(function() {}),
  5852. u.add(w, "rotationAccelerationInside", .1, 10).step(.1).onChange(function() {}),
  5853. u.add(w, "rotationAccelerationOutside", .1, 10).step(.1).onChange(function() {});
  5854. var d = n.addFolder("Navigation");
  5855. d.add(w.navigation, "panoScores").onFinishChange(function() {
  5856. w.navigation.panoScores || t.panos.forEach(function(e) {
  5857. e.floor.remove(e.text3d),
  5858. e.text3d = null
  5859. })
  5860. }),
  5861. d.add(w.navigation, "mouseDirection"),
  5862. d.add(w.navigation, "filterStrictness", 0, 1),
  5863. d.add(w.navigation, "angleFactor", -60, 0),
  5864. d.add(w.navigation, "directionFactor", 1, 20),
  5865. d.add(w.navigation, "distanceFactor", -5, 5),
  5866. d.add(w.navigation, "optionalityFactor", .1, 10);
  5867. var p = n.addFolder("tags")
  5868. , f = p.addFolder("Tag Creation");
  5869. f.add(w.tags.pole, "enabled").name("poleEnabled"),
  5870. f.add(w.tags.pole, "height", 0, 2.5).step(.01).name("poleHeight"),
  5871. f.add(w.tags.pole, "width", 1, 10).step(1).name("poleWidth"),
  5872. f.add(w.tags.pole, "opacity", .1, 1).step(.1).name("poleOpacity");
  5873. var g = p.addFolder("Visibility");
  5874. g.add(w.tags.visibility, "anyDistance"),
  5875. g.add(w.tags.visibility, "visibleDistance", .1, 30).step(.1),
  5876. g.add(w.tags.visibility, "cameraClearance", 0, 1).step(.01),
  5877. g.add(w.tags.visibility, "hideViaFloor"),
  5878. g.add(w.tags.visibility, "hideOffScreenDisc").name("hideEdgeDisc"),
  5879. g.add(w.tags.visibility, "hideOffScreenObject").name("hideEdgeObject");
  5880. var m = p.addFolder("Disc Parameters");
  5881. m.add(w.tags.disc.scale, "nearBound", .1, 10).step(.1),
  5882. m.add(w.tags.disc.scale, "farBound", .1, 20).step(.1).listen(),
  5883. m.add(w.tags.disc.scale, "linkFarBound").onChange(function(e) {
  5884. e && (w.tags.disc.scale.farBound = w.tags.visibility.visibleDistance * (1 - w.tags.disc.scale.linkPercent / 100))
  5885. }),
  5886. m.add(w.tags.disc.scale, "linkPercent", 0, 100).step(1).onChange(function(e) {
  5887. w.tags.disc.scale.linkFarBound && (w.tags.disc.scale.farBound = w.tags.visibility.visibleDistance * (1 - e / 100))
  5888. }),
  5889. m.add(w.tags.disc.scale, "maxSize", 40, 200).step(1),
  5890. m.add(w.tags.disc.scale, "minSize", 20, 100).step(1),
  5891. m.add(w.tags.disc.scale, "responsiveness", 0, 100).step(1);
  5892. var v = p.addFolder("Navigate");
  5893. v.add(w.tags.navigate, "nearestPano").name("nearestPano"),
  5894. v.add(w.tags.navigate, "lineOfSight").name("lineOfSight"),
  5895. v.add(w.tags.navigate, "reactivate").name("reactivate"),
  5896. v.add(w.tags.navigate, "aimAt", ["disc", "object", "pole", "nothing"]).name("aim at"),
  5897. v.add(w.tags.navigate, "tiltTolerance", 0, 50).step(1),
  5898. v.add(w.tags.navigate, "rotateSpeedFactor", 0, 5).step(.1);
  5899. var y = n.addFolder("Debug");
  5900. y.add(w, "wireframe").onFinishChange(function() {
  5901. t.chunks.forEach(function(e) {
  5902. e.material && (e.wireframeTwin || (e.wireframeTwin = new C.WireframeHelper(e),
  5903. e.wireframeTwin.material.depthWrite = !1,
  5904. e.wireframeTwin.material.depthTest = !1,
  5905. e.wireframeTwin.material.opacity = .5,
  5906. e.wireframeTwin.material.transparent = !0),
  5907. w.wireframe ? t.add(e.wireframeTwin) : t.remove(e.wireframeTwin))
  5908. })
  5909. }),
  5910. y.add(w, "skyboxWireframe").onFinishChange(function() {
  5911. w.skyboxWireframe ? (t.skybox.wireframe = new C.WireframeHelper(t.skybox),
  5912. t.add(t.skybox.wireframe)) : (t.remove(t.skybox.wireframe),
  5913. t.skybox.wireframe = null)
  5914. }),
  5915. y.add(w, "showSweeps").onFinishChange(function() {
  5916. t.setSweepVisibility(w.showSweeps)
  5917. }),
  5918. y.add(w, "showMesh").onFinishChange(function() {
  5919. t.chunks.forEach(function(e) {
  5920. e.visible = w.showMesh
  5921. })
  5922. }),
  5923. y.add(w, "showFloors").onFinishChange(function() {
  5924. t.floors.forEach(function(e) {
  5925. e.collider.children.forEach(function(e) {
  5926. e.material.visible = w.showFloors
  5927. })
  5928. })
  5929. }),
  5930. y.add(w, "showSkyboxes").onFinishChange(function() {
  5931. t.panos.forEach(function(e) {
  5932. e.skyboxMesh.visible = w.showSkyboxes
  5933. })
  5934. }),
  5935. y.add(w, "showNeighbors").onChange(function() {}),
  5936. y.add(t, "alpha", 0, 1)
  5937. }
  5938. }
  5939. , {
  5940. "../enum/Colors": 19,
  5941. "../enum/Viewmode": 51,
  5942. "../enum/WarpStyle": 52,
  5943. "../lib/dat.gui": 93,
  5944. "../tag/tag": 123,
  5945. "../settings": 166,
  5946. "../util/easing": 186,
  5947. three: 217
  5948. }],
  5949. 64: [function(c, h, e) {
  5950. (function(e) {
  5951. "use strict";
  5952. function i(e, t, i, n) {
  5953. $(".gui-error .error-problem-text").text(e),
  5954. $(".gui-error .error-solution-text").text(t),
  5955. $(".gui-error .error-explanation").text(i),
  5956. $(".gui-error .error-actions").html(n),
  5957. $(window).resize(),
  5958. $(".gui-error").fadeIn(),
  5959. $("#bottom-logo").fadeIn()
  5960. }
  5961. function n(e) {
  5962. 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("");
  5963. i(e, s.ERROR_BROWSER_SOLUTION, s.ERROR_BROWSER_EXPLANATION, t),
  5964. r.isMobile() || $("[rel=tiletip]").tooltip({
  5965. placement: "bottom",
  5966. delay: {
  5967. show: 50,
  5968. hide: 0
  5969. },
  5970. trigger: "hover",
  5971. viewport: {
  5972. selector: "body",
  5973. padding: 10
  5974. }
  5975. })
  5976. }
  5977. function t() {
  5978. var e = r.isMobile() ? "" : '<span class="link install-browser">' + s.ERROR_GENERIC_ACTIONS_2 + "</span>" + s.ERROR_GENERIC_ACTIONS_3
  5979. , t = [s.ERROR_GENERIC_ACTIONS_1, e].join("");
  5980. i(s.ERROR_GENERIC_PROBLEM, s.ERROR_GENERIC_SOLUTION, "", t),
  5981. r.isMobile() || $(".install-browser").on("click touchstart", function(e) {
  5982. e.preventDefault(),
  5983. e.stopPropagation(),
  5984. n(" ")
  5985. })
  5986. }
  5987. var r = c("./../util/browser")
  5988. , o = c("./../analytics")
  5989. , a = c("./../settings")
  5990. , s = c("../localization/localize")
  5991. , l = new (c("./../util/logger"))(e);
  5992. h.exports.error = function(e) {
  5993. if ($("head title").text(a.pageTitle),
  5994. $("#gui-message, #gui-loading, #nprogress, #gui-thumb, #bottom-logo").hide(),
  5995. $("#gui-loading").fadeOut(250),
  5996. $("#quick-blackout").hide(),
  5997. o.track("showcase_error", {
  5998. error_key: e
  5999. }),
  6000. s.locale || s.init(),
  6001. "webgl-unsupported" === e)
  6002. r.isMobile() ? t() : n(s.ERROR_WEBGL_UNSUPPORTED_PROBLEM);
  6003. else if ("webgl-ios" === e)
  6004. i(s.ERROR_WEBGL_IOS_PROBLEM, s.ERROR_WEBGL_IOS_SOLUTION, "", s.ERROR_WEBGL_IOS_ACTIONS_1 + "<strong>" + s.ERROR_WEBGL_IOS_ACTIONS_2 + "</strong>.");
  6005. else if ("webgl-safari" === e)
  6006. i(s.ERROR_WEBGL_SAFARI_PROBLEM, "", "", s.ERROR_WEBGL_SAFARI_ACTIONS_1 + "<strong>" + s.ERROR_WEBGL_SAFARI_ACTIONS_2 + "</strong>. " + s.ERROR_WEBGL_SAFARI_ACTIONS_3 + "<strong>" + s.ERROR_WEBGL_SAFARI_ACTIONS_4 + "</strong>.");
  6007. else if ("webgl-generic" === e)
  6008. t();
  6009. else if ("missing-urls" === e)
  6010. i(s.ERROR_MISSING_URLS_PROBLEM, "", s.ERROR_MISSING_URLS_EXPLANATION);
  6011. else if ("loading-failed" === e)
  6012. i(s.ERROR_LOADING_FAILED_PROBLEM, "", "", s.ERROR_LOADING_FAILED_ACTIONS_1 + '<a class="link" target="_blank" href="https://support.port.com/hc/articles/208220058">' + s.ERROR_LOADING_FAILED_ACTIONS_2 + "</a>.");
  6013. else {
  6014. if ("loading-failed-maintenance" !== e)
  6015. return void l.error("Unhandled error: " + e);
  6016. i(s.ERROR_MAINTENANCE_PROBLEM, s.ERROR_MAINTENANCE_SOLUTION)
  6017. }
  6018. }
  6019. }
  6020. ).call(this, "/js/gui/error.js")
  6021. }
  6022. , {
  6023. "../localization/localize": 108,
  6024. "./../analytics": 4,
  6025. "./../settings": 166,
  6026. "./../util/browser": 182,
  6027. "./../util/logger": 189
  6028. }],
  6029. 65: [function(Oe, Le, e) {
  6030. (function(e) {
  6031. "use strict";
  6032. function c() {
  6033. for (var e in Ce)
  6034. if (Ce.hasOwnProperty(e)) {
  6035. var t = Ce[e];
  6036. if (!t.visible)
  6037. for (var i = 0; i < t.elements.length; i++)
  6038. $(t.elements[i]).hide()
  6039. }
  6040. Ce.highlight.visible && $(".pinBottom").addClass("highlightExists"),
  6041. !1 === Ce.tourControls.visible && $("#drawer").addClass("fullWidth"),
  6042. ge = [],
  6043. Ce.floors.visible && ge.push(".gui-floor", ".gui-floor-title"),
  6044. ge.push(".hideTarget", ".pinTop.right")
  6045. }
  6046. function v(e, t) {
  6047. var i = !S.isMobile() && M.zoom.enabled && t.mode === ie.PANORAMA && !e.tourIsPlaying;
  6048. $("#gui-zoomin").toggle(i),
  6049. $("#gui-zoomout").toggle(i)
  6050. }
  6051. function l() {
  6052. n(),
  6053. $(".pinBottom").toggleClass("open"),
  6054. $("#drawer").toggleClass("open"),
  6055. $(".footer").toggleClass("open"),
  6056. $("#drawer").hasClass("open") ? ($("#pullTab .icon").attr("data-original-title", se.CLOSE_HIGHLIGHTS),
  6057. _e("highlights")) : ($("#pullTab .icon").attr("data-original-title", se.OPEN_HIGHLIGHTS),
  6058. O.resetDrawer()),
  6059. setTimeout(function() {
  6060. $("#pullTab").toggleClass("opened")
  6061. }, $("#drawer").hasClass("open") ? 0 : M.highlightAnimationDuration),
  6062. $(".pinBottom").hasClass("open") && t($(".vr-popup")) && $(".vr-popup").is(":visible") && X.dismiss()
  6063. }
  6064. function t(e) {
  6065. var t;
  6066. return "none" !== e.css("display") ? t = e.position().top + e.outerHeight() : (e.attr("style", "visibility: hidden"),
  6067. t = e.position().top + e.outerHeight(),
  6068. e.attr("style", "display: none")),
  6069. $("#player").outerHeight() - 130 < t + 25
  6070. }
  6071. function y(e) {
  6072. "touchstart" === e.type && e.preventDefault(),
  6073. e.stopPropagation()
  6074. }
  6075. function n() {
  6076. w && (w.reload(),
  6077. w.init())
  6078. }
  6079. function r() {
  6080. $("#gui-spinner").stop(!0, !0),
  6081. $("#gui-spinner").fadeOut(1e3),
  6082. !(Ae = !0)
  6083. }
  6084. function A(e, t) {
  6085. var i = e.mode
  6086. , n = t || e.currentPano;
  6087. $("#gui-modes-dollhouse").toggleClass("active", i === ie.DOLLHOUSE),
  6088. $("#gui-modes-floorplan").toggleClass("active", i === ie.FLOORPLAN),
  6089. $("#gui-modes-inside").toggleClass("active", i === ie.PANORAMA),
  6090. i === ie.PANORAMA ? ($("#view-controllers").slideUp(500),
  6091. M.show360Views.enabled && !n.isAligned() ? ($(".gui-floor").addClass("hidden"),
  6092. $("#gui-modes-outside").addClass("desktop-only")) : ($(".gui-floor").removeClass("hidden"),
  6093. $("#gui-modes-outside").removeClass("desktop-only")),
  6094. $("#gui-modes-outside").removeClass("hidden")) : i !== ie.TRANSITIONING && (r(),
  6095. pe = i,
  6096. $("#gui-modes-outside").addClass("hidden"),
  6097. e.model.has360Views && $(".gui-floor").removeClass("hidden"),
  6098. $("#view-controllers").is(":visible") || $("#view-controllers").slideDown(M.guiAnimationSpeed))
  6099. }
  6100. function C(t, i) {
  6101. function e() {
  6102. document.getElementById("vr").classList.remove("hidden"),
  6103. M.vr.allowWebVR ? S.getVRDisplay().then(function(e) {
  6104. S.supportsFullscreen() ? function(e) {
  6105. ue.info(e.displayName + " detected, VR button activates WebVR experience"),
  6106. Q.init(t.data, i, e, x),
  6107. Q.on(J.OPENED, _e.bind(gui, "vr")),
  6108. Q.on(J.SHOW_TERMS, W.show.bind(W))
  6109. }(e) : (ue.warn("Unable to use WebVR when full screen is not supported"),
  6110. $(".improper-embed").toggleClass("hidden", !1),
  6111. n())
  6112. }, function(e) {
  6113. n()
  6114. }) : n()
  6115. }
  6116. function n() {
  6117. var e;
  6118. ue.info("WebVR support not found, VR button activates native app VR modal"),
  6119. X.init(t.data, x),
  6120. X.on(Z.OPENED, (e = document.getElementById("vr-modal"),
  6121. function() {
  6122. _e("vr"),
  6123. V.open(e)
  6124. }
  6125. )),
  6126. X.on(Z.CLOSED, V.reset)
  6127. }
  6128. if (M.vr.enabled && t.supportsVR && !S.valueFromHash("mls", 0))
  6129. switch (M.vr.option) {
  6130. case le.CONTEXTUAL:
  6131. e();
  6132. break;
  6133. case le.ANDROID:
  6134. S.detectAndroid() && e();
  6135. break;
  6136. case le.NONE:
  6137. }
  6138. }
  6139. function h(e, i) {
  6140. for (var n = $(".gui-floor"), t = 0; t < e.floors.length; t++)
  6141. if ("372" !== getQueryVariable("m")) {
  6142. var r = $('<div class="floorChoice" data-index="' + t + '"></div>').text(e.floors.get(t).name);
  6143. $(".gui-floor").find(".container").prepend(r)
  6144. }
  6145. n.find(".container").prepend('<div class="floorChoice darkGlass allFloorBtn" data-index="all" style="display:none">' + se.FLOOR_ALL + "</div>"),
  6146. n.on("click", function(e) {
  6147. y(e),
  6148. _e("floor"),
  6149. n.toggleClass("open")
  6150. }),
  6151. $(".floorChoice").on("click", function(e) {
  6152. y(e);
  6153. var t = $(this).data("index");
  6154. "all" !== t ? (R.updateInteraction(oe.InteractionGui, "floor-control"),
  6155. i.player.gotoFloor(t),
  6156. R.track("showcase_gui", {
  6157. gui_action: "click_floor_select_button",
  6158. interaction_source: "gui"
  6159. })) : (R.updateInteraction(oe.InteractionGui, "floor-control"),
  6160. _e("move"),
  6161. i.allFloors(),
  6162. R.track("showcase_gui", {
  6163. gui_action: "click_toggle_all_floors_button",
  6164. interaction_source: "gui"
  6165. })),
  6166. n.removeClass("open")
  6167. })
  6168. }
  6169. function I(e, t) {
  6170. e && (t === ie.DOLLHOUSE || t === ie.FLOORPLAN ? ($(".allFloorBtn").show(),
  6171. $(".gui-floor-icon").hide(),
  6172. $(".gui-floor-title").show()) : ($(".allFloorBtn").hide(),
  6173. $(".gui-floor-icon").show(),
  6174. $(".gui-floor-title").hide()),
  6175. e.model.allFloorsVisible ? ($(".gui-floor-title").text(se.FLOOR_ALL),
  6176. $(".gui-floor-number").text(se.FLOOR_ALL),
  6177. $(".floorChoice").removeClass("active"),
  6178. $('.floorChoice[data-index="all"]').addClass("active")) : ($(".gui-floor-title").text(e.name),
  6179. $(".gui-floor-number").text(" " + (e.floorIndex + 1)),
  6180. $(".floorChoice").removeClass("active"),
  6181. $(".floorChoice[data-index=" + e.floorIndex + "]").addClass("active")))
  6182. }
  6183. function E() {
  6184. var e = $("#player").width() - 20
  6185. , t = $("#scroller")
  6186. , i = $("#drawer")
  6187. , n = $(".pinBottom");
  6188. $("#player").width() < 488 || $("#player").height() < 488 ? (t.addClass("hidden"),
  6189. i.addClass("noScroll"),
  6190. n.addClass("noScroll")) : e < T != !i.hasClass("noScroll") && (t.toggleClass("hidden"),
  6191. i.toggleClass("noScroll"),
  6192. n.toggleClass("noScroll"))
  6193. }
  6194. function _(e) {
  6195. e.waitQueue.length <= 0 ? r() : ye || function(e) {
  6196. e = e || 0,
  6197. Ae = !1,
  6198. window.setTimeout(function() {
  6199. Ae || (!0,
  6200. $("#gui-spinner").stop(!0, !0).show())
  6201. }
  6202. .bind(this), e)
  6203. }(M.modelComponentLoadSpinnerDelay)
  6204. }
  6205. function b(e, t) {
  6206. for (var i = []; e; )
  6207. i.push(e),
  6208. e = e.parentNode;
  6209. for (; t && -1 === i.indexOf(t); )
  6210. t = t.parentNode;
  6211. return t
  6212. }
  6213. var w, T, o, a, x, i, s, u, d, p, f, g, S = (Oe("three"),
  6214. Oe("../util/ajax"),
  6215. Oe("../util/browser")), M = Oe("../settings"), R = Oe("../analytics"), m = (Oe("../util/transitions"),
  6216. Oe("../util/camera"),
  6217. Oe("../util/logger")), P = (Oe("../objects/Snapshot"),
  6218. Oe("./helpManager")), O = Oe("./immersiveMode"), L = Oe("./loadingScreen"), D = Oe("./landingScreen"), N = Oe("./playButton"), F = Oe("./populateModal"), B = Oe("./memoryUsage"), V = Oe("./closer/modalCloser"), k = Oe("./closer/ModalCloserEvent"), U = Oe("./help/help"), H = Oe("./help/HelpEvent"), z = Oe("./title/titleBar"), G = Oe("./title/TitleEvents"), W = Oe("./terms/terms"), j = Oe("./terms/TermsEvent"), Y = Oe("./title/tagToggle"), q = Oe("./tourInteraction"), X = Oe("./vr/vrModal"), Z = Oe("./vr/vrEvent"), K = Oe("./sharing/modal"), Q = Oe("./webvr/webVRgui"), J = Oe("./webvr/WebVrEvent"), ee = Oe("../controls/serializer"), te = Oe("../enum/Keys"), ie = Oe("../enum/Viewmode"), ne = (Oe("../enum/BlackoutStyle"),
  6219. Oe("../tag/Media/MediaEvent")), re = (Oe("../enum/PathDiscardMode"),
  6220. Oe("../enum/PathDisplayMode"),
  6221. Oe("../enum/DirectorEvents"),
  6222. Oe("../enum/PlayerEvents")), oe = Oe("../enum/ControlEvents"), ae = Oe("./sharing/ShareEvents"), se = Oe("../localization/localize"), le = (Oe("../enum/Vectors"),
  6223. Oe("../enum/WarpStyle"),
  6224. Oe("../enum/AlignmentType"),
  6225. Oe("../enum/VROption")), ce = Oe("./konami"), he = Oe("../lib/dat.gui"), ue = new m(e), de = (Oe("../util/showcase"),
  6226. Oe("../enum/ZoomEvents")), pe = ie.DOLLHOUSE, fe = 0, ge = [".hideTarget"], me = null, ve = null, ye = !1, Ae = !1, Ce = {
  6227. coBrand: {
  6228. visible: !0,
  6229. elements: [".co-brand", "#loaderCoBrand"]
  6230. },
  6231. help: {
  6232. visible: !0,
  6233. elements: [".nav-help", "#nav-help"]
  6234. },
  6235. tourControls: {
  6236. visible: !0,
  6237. elements: [".next", ".previous", "#play"]
  6238. },
  6239. highlight: {
  6240. visible: !0,
  6241. elements: ["#drawer", "#pullTab"]
  6242. },
  6243. share: {
  6244. visible: !0,
  6245. elements: [".socialButton", "#share"]
  6246. },
  6247. fullScreen: {
  6248. visible: !0,
  6249. elements: ["#gui-fullscreen"]
  6250. },
  6251. floors: {
  6252. visible: !0,
  6253. elements: [".gui-floor"]
  6254. }
  6255. }, Ie = (g = document.getElementById("drawer"),
  6256. function() {
  6257. $("#player").height() < 400 && g.classList.contains("open") && l()
  6258. }
  6259. ), Ee = (f = document.getElementById("meta-info"),
  6260. function() {
  6261. $("#player").height() < 400 && f.classList.contains("expand") && z.toggleMeta(!0)
  6262. }
  6263. ), _e = (i = document.getElementById("meta-info"),
  6264. s = document.getElementById("interaction-modal"),
  6265. u = $("#drawer").eq(0),
  6266. d = $(".gui-floor").eq(0),
  6267. p = $(".vr-popup").eq(0),
  6268. function(e) {
  6269. switch (e) {
  6270. case "info":
  6271. we(),
  6272. Te(),
  6273. Ie(),
  6274. Me(),
  6275. Re(),
  6276. xe(),
  6277. Pe();
  6278. break;
  6279. case "terms":
  6280. be(),
  6281. Te(),
  6282. Se(),
  6283. Me(),
  6284. Re(),
  6285. xe(),
  6286. Pe();
  6287. break;
  6288. case "help":
  6289. be(),
  6290. we(),
  6291. Me(),
  6292. Re(),
  6293. xe(),
  6294. Pe();
  6295. break;
  6296. case "vr":
  6297. be(),
  6298. we(),
  6299. Me(),
  6300. Re(),
  6301. Te(),
  6302. Pe(),
  6303. t(p) && Se();
  6304. break;
  6305. case "highlights":
  6306. Ee(),
  6307. we(),
  6308. Me(),
  6309. Re();
  6310. break;
  6311. case "share":
  6312. be(),
  6313. we(),
  6314. Te(),
  6315. Re(),
  6316. xe(),
  6317. Pe();
  6318. break;
  6319. case "floor":
  6320. we(),
  6321. Me(),
  6322. xe();
  6323. break;
  6324. case "view":
  6325. Re(),
  6326. Me(),
  6327. we(),
  6328. xe();
  6329. break;
  6330. case "tour":
  6331. case "move":
  6332. we(),
  6333. Me(),
  6334. Re(),
  6335. xe();
  6336. break;
  6337. case "resize":
  6338. be(),
  6339. Ie(),
  6340. Re();
  6341. break;
  6342. case "tag":
  6343. we(),
  6344. Te(),
  6345. Me(),
  6346. Re(),
  6347. xe()
  6348. }
  6349. }
  6350. );
  6351. function be() {
  6352. i.classList.contains("expand") && z.toggleMeta(!0)
  6353. }
  6354. function we() {
  6355. W.hide()
  6356. }
  6357. function Te() {
  6358. U.close()
  6359. }
  6360. function xe() {
  6361. X.dismiss()
  6362. }
  6363. function Se() {
  6364. u.hasClass("open") && l()
  6365. }
  6366. function Me() {
  6367. K.hide()
  6368. }
  6369. function Re() {
  6370. d.hasClass("open") && d.removeClass("open")
  6371. }
  6372. function Pe() {
  6373. s.classList.contains("fadeIn") && (s.classList.contains("landing") ? D.dismissModal() : s.classList.contains("tour") && q.dismissModal())
  6374. }
  6375. $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", function(e) {
  6376. $("#gui-fullscreen").toggle(!S.isFullscreen()),
  6377. $("#gui-fullscreen-exit").toggle(!!S.isFullscreen()),
  6378. setTimeout(function() {
  6379. $(".icon:visible").hide().show(0)
  6380. }, 100)
  6381. }),
  6382. $("#gui-fullscreen").find("a").on("click", function(e) {
  6383. y(e),
  6384. S.requestFullscreen($("body")[0]),
  6385. R.track("showcase_gui", {
  6386. gui_action: "click_enter_fullscreen",
  6387. interaction_source: "gui"
  6388. })
  6389. }),
  6390. $("#gui-fullscreen-exit").find("a").on("click", function(e) {
  6391. y(e),
  6392. S.exitFullscreen(),
  6393. R.track("showcase_gui", {
  6394. gui_action: "click_exit_fullscreen",
  6395. interaction_source: "gui"
  6396. })
  6397. }),
  6398. $(window).on("resize", function(e) {
  6399. var t = e.target.innerHeight
  6400. , i = e.target.innerWidth;
  6401. t === o && i === a || (Ce.highlight.visible && E(),
  6402. _e("resize"),
  6403. $(".pinTop.right").removeClass("hideUnderMeta"),
  6404. n(),
  6405. o = t,
  6406. a = i)
  6407. }).resize(),
  6408. S.supportsFullscreen() || $("#gui-fullscreen").hide(),
  6409. $("#pullTab").on("click", function(e) {
  6410. y(e),
  6411. $("#drawer").hasClass("open") ? (R.trackAlways("showcase_gui", {
  6412. gui_action: "hide_highlight_reel"
  6413. }),
  6414. $(this).addClass("open").children("img").attr("src", "images/auto.png")) : (R.trackAlways("showcase_gui", {
  6415. gui_action: "show_highlight_reel"
  6416. }),
  6417. $(this).removeClass("open").children("img").attr("src", "images/auto-suspend.png")),
  6418. l()
  6419. }),
  6420. window.MP_PREFETCHED_MODELDATA.showHotListSta && ($("#hotList").css("display", ""),
  6421. $("#hotList").on("click", function(e) {
  6422. y(e);
  6423. var t = $("#hotListWrap")[0];
  6424. t.classList.contains("hotListActive") ? (t.classList.remove("hotListActive"),
  6425. this.classList.remove("active")) : (t.classList.add("hotListActive"),
  6426. this.classList.add("active"))
  6427. }),
  6428. $("#hotListContent ul").on("mouseover", function(e) {
  6429. y(e);
  6430. var t = e.target
  6431. , i = document.getElementById("hotListWrap");
  6432. if ("SPAN" === t.tagName) {
  6433. var n = t.parentElement.parentElement;
  6434. t.offsetWidth + 116 >= n.clientWidth ? i.style.width = t.offsetWidth + 116 + "px" : i.style.width = ""
  6435. } else if ("LI" === t.tagName) {
  6436. n = t.parentElement;
  6437. t.children[0].offsetWidth + 116 >= n.clientWidth ? i.style.width = t.children[0].offsetWidth + 116 + "px" : i.style.width = ""
  6438. } else
  6439. i.style.width = ""
  6440. }),
  6441. $("#hotListContent ul").on("click", function(e) {
  6442. y(e),
  6443. this.preElem && this.preElem.classList.remove("active"),
  6444. "SPAN" === e.target.tagName ? (e.target.parentElement.classList.add("active"),
  6445. e.target.parentElement.hot && e.target.parentElement.hot.examine(window.player, !0),
  6446. this.preElem = e.target.parentElement) : (e.target.classList.add("active"),
  6447. e.target.hot && e.target.hot.examine(window.player, !0),
  6448. this.preElem = e.target)
  6449. }),
  6450. $("#hotListClose").on("click", function(e) {
  6451. y(e),
  6452. $("#hotListWrap")[0].classList.remove("hotListActive"),
  6453. $("#hotListContent ul .active").removeClass("active"),
  6454. $("#hotList")[0].classList.remove("active")
  6455. })),
  6456. "true" === window.MP_PREFETCHED_MODELDATA.supportsVR && $("#vr").css("display", ""),
  6457. $("#more-menu-button").on("click", function(e) {
  6458. y(e),
  6459. $("#more-menu").toggleClass("open")
  6460. }),
  6461. Le.exports.init = function(s, l, c, e, t, i, n) {
  6462. var r;
  6463. x = n,
  6464. s.outsideAllowed() || $("#gui-modes-outside").addClass("invisible"),
  6465. s.supportedModes[ie.PANORAMA] || $("#gui-modes-inside").addClass("invisible"),
  6466. F.init(),
  6467. D.init(s, i),
  6468. ce.init(s, l, e),
  6469. $(".icon").on("mouseover", function() {
  6470. l.player && l.player.reticule.hide()
  6471. }),
  6472. function(e, t) {
  6473. var i = t.player;
  6474. $("#gui-modes-inside").on("mousedown touchstart", function(e) {
  6475. y(e),
  6476. R.updateInteraction(oe.InteractionGui, "inside-button"),
  6477. R.track("USER", {
  6478. event_type: "showcase_gui",
  6479. gui_action: "click_inside_mode_button"
  6480. }),
  6481. t.changeMode(ie.PANORAMA)
  6482. }),
  6483. $("#gui-modes-outside").find("a").on("click", function(e) {
  6484. y(e),
  6485. R.track("showcase_gui", {
  6486. gui_action: "click_outside_mode_button"
  6487. }),
  6488. t.changeMode(pe)
  6489. }),
  6490. $("#gui-modes-floorplan").on("click", function(e) {
  6491. y(e),
  6492. i.mode !== ie.FLOORPLAN && (R.track("showcase_gui", {
  6493. gui_action: "click_floorplan_mode_button"
  6494. }),
  6495. t.changeMode(ie.FLOORPLAN))
  6496. }),
  6497. $("#gui-modes-dollhouse").on("click", function(e) {
  6498. y(e),
  6499. i.mode !== ie.DOLLHOUSE && (R.track("showcase_gui", {
  6500. gui_action: "click_dollhouse_mode_button"
  6501. }),
  6502. t.changeMode(ie.DOLLHOUSE))
  6503. })
  6504. }(0, l),
  6505. function(e, t) {
  6506. $("#play").on("mousedown touchstart", function(e) {
  6507. y(e),
  6508. _e("tour"),
  6509. q.play(),
  6510. R.trackAlways("showcase_gui", {
  6511. gui_action: "play_highlights"
  6512. })
  6513. }),
  6514. window.startAndPlay = function(e) {
  6515. _e("tour"),
  6516. q.play(),
  6517. R.trackAlways("showcase_gui", {
  6518. gui_action: "play_highlights"
  6519. })
  6520. }
  6521. ,
  6522. $("#pause").on("mousedown touchstart", function(e) {
  6523. y(e),
  6524. q.pause(),
  6525. R.trackAlways("showcase_gui", {
  6526. gui_action: "pause_highlights"
  6527. })
  6528. }),
  6529. $("#gui-zoomin").find("a").on("click", function(e) {
  6530. y(e),
  6531. t.player.zoomInIncrementally()
  6532. }),
  6533. $("#gui-zoomout").find("a").on("click", function(e) {
  6534. y(e),
  6535. t.player.zoomOutIncrementally()
  6536. })
  6537. }(0, l),
  6538. s.data.enable_social_sharing && s.data.is_public && M.share.enabled && (K.init(MP_PREFETCHED_MODELDATA.name/* s.data.name */),
  6539. K.on(ae.OPENED, (r = document.getElementById("share-modal"),
  6540. function() {
  6541. _e("share"),
  6542. V.open(r)
  6543. }
  6544. )),
  6545. K.on(ae.CLOSED, V.reset)),
  6546. 0 < s.heroLocations.length ? function(e, i, t) {
  6547. var n = 100 / (fe = e.heroLocations.length) + "%"
  6548. , r = $("#thumb-container")
  6549. , o = $("#progressBar");
  6550. $("#status").find(".totalSteps").text(fe);
  6551. for (var a = 0; a < fe; a++) {
  6552. var s = e.heroLocations[a]
  6553. , l = $('<li class="thumbImg" data-index=""><img src=""></li>');
  6554. if(s.heroLocations){//有子项,选第一张截图
  6555. var tmp = s.heroLocations[0].thumbUrl.replace('https://','').replace('http://','')
  6556. }else{
  6557. var tmp = s.thumbUrl.replace('https://','').replace('http://','')
  6558. }
  6559. if (l.attr("data-index", a),
  6560. //Ce.highlight.visible && l.find("img").attr("src",'https://'+tmp),
  6561. Ce.highlight.visible && l.find("img").attr("src", 'http://'+tmp),// xzw改 导览图片 https在某些服务器打不开
  6562. s.name) {
  6563. var c = $('<div class="overlay"></div>').text(s.name);
  6564. l.prepend(c)
  6565. }
  6566. if (e.has360Views && s.cameraMode === ie.PANORAMA) {
  6567. var h = e.panos.get(s.panoId)
  6568. , u = h && !h.isAligned() ? '<div><img class="mark360View" src="images/mark-360-white-v2.png"></div>' : '<div><img class="markInsideView" src="images/mark-inside-white.png"></div>';
  6569. l.prepend(u)
  6570. }
  6571. r.append(l),
  6572. o.append('<div class="step" data-idx="' + a + '" style="width:' + n + '"></div>')
  6573. }
  6574. T = 144 * fe,
  6575. 111 * fe,
  6576. $(".thumbImg").on("mouseover", function() {
  6577. !function(e) {
  6578. return e.describe().inTransition
  6579. }(i) && t.showPathToHeroLocation([$(this).data("index"),0])//改
  6580. }),
  6581. $(".thumbImg").on("mouseout", function() {
  6582. i.clearPath()
  6583. }),
  6584. $(".thumbImg").on("click", function(e) {
  6585. y(e);
  6586. var t = $(this);
  6587. R.updateInteraction(oe.InteractionGui, "thumbnail"),
  6588. R.trackAlways("showcase_gui", {
  6589. gui_action: "click_highlight"
  6590. }),
  6591. i.goToHighlight([t.data("index"),0])//改
  6592. }),
  6593. $(".previous").find("a").on("click", function(e) {
  6594. y(e),
  6595. R.trackAlways("showcase_gui", {
  6596. gui_action: "prev_highlight"
  6597. }),
  6598. i.prevHighlight()
  6599. }),
  6600. $(".next").find("a").on("click", function(e) {
  6601. y(e),
  6602. R.trackAlways("showcase_gui", {
  6603. gui_action: "next_highlight"
  6604. }),
  6605. i.nextHighlight()
  6606. }),
  6607. $("#drawer").on("mouseleave", function(t) {
  6608. var i;
  6609. y(t);
  6610. try {
  6611. i = new MouseEvent("mouseup",{
  6612. clientX: t.clientX,
  6613. clientY: t.clientY,
  6614. screenX: t.screenX,
  6615. screenY: t.screenY
  6616. })
  6617. } catch (e) {
  6618. (i = document.createEvent("MouseEvents")).initMouseEvent("mouseup", t.bubbles, t.cancelable, t.view, t.detail, t.screenX, t.screenY, t.clientX, t.clientY, t.ctrlKey, t.altKey, t.shiftKey, t.metaKey, t.button, t.relatedTarget)
  6619. }
  6620. document.dispatchEvent(i)
  6621. }),
  6622. (w = new Sly($("#scrollFrame"),{
  6623. horizontal: !0,
  6624. itemNav: "centered",
  6625. smart: !0,
  6626. scrollTrap: !0,
  6627. scrollBy: 1,
  6628. mouseDragging: !0,
  6629. touchDragging: !0,
  6630. speed: 300,
  6631. dragHandle: !0,
  6632. dynamicHandle: !0,
  6633. clickBar: !0,
  6634. scrollBar: $("#scroller"),
  6635. activateOn: null
  6636. }).init()).on("active", function(e, t) {
  6637. t,
  6638. _e("tour"),
  6639. $(".step").removeClass("active"),
  6640. $("#status").find(".curIdx").text(t + 1);
  6641. for (var i = 0; i <= t; i++)
  6642. $("#progressBar").find("[data-idx='" + i + "']").addClass("active")
  6643. }),
  6644. E()
  6645. }(s, l, c) : (Ce.highlight.visible = !1,
  6646. Ce.tourControls.visible = !1),
  6647. z.on(G.OPEN_INFO, _e.bind(this, "info")),
  6648. function() {
  6649. var n;
  6650. document.body.addEventListener("mousedown", function(e) {
  6651. n = 0 === e.button || 1 === e.which ? e.target : null
  6652. }, !0),
  6653. document.body.addEventListener("mouseup", function(t) {
  6654. n !== t.target && (n = b(n, t.target));
  6655. var e = document.getElementById("gui-parent");
  6656. if (b(e, n) !== e && (n = null),
  6657. n) {
  6658. var i;
  6659. try {
  6660. i = new MouseEvent("click",t)
  6661. } catch (e) {
  6662. (i = document.createEvent("MouseEvents")).initMouseEvent("click", t.bubbles, t.cancelable, t.view, t.detail, t.screenX, t.screenY, t.clientX, t.clientY, t.ctrlKey, t.altKey, t.shiftKey, t.metaKey, t.button, t.relatedTarget)
  6663. }
  6664. i.syntheticClick = !0,
  6665. n.dispatchEvent(i),
  6666. n = null
  6667. }
  6668. }, !0),
  6669. document.getElementById("gui-parent").addEventListener("click", function(e) {
  6670. e.syntheticClick || (e.stopPropagation(),
  6671. "A" === e.target.nodeName && e.preventDefault())
  6672. }, !0)
  6673. }(),
  6674. A(c),
  6675. C(s, t),
  6676. s.on("floor.changed", I),
  6677. s.on("waiting", function(e) {
  6678. _(e)
  6679. }
  6680. .bind(this, s)),
  6681. s.on("waiting-done", function(e) {
  6682. _(e)
  6683. }
  6684. .bind(this, s)),
  6685. c.on(re.ModeChanged, function(e, t) {
  6686. A(c),
  6687. v(l, c),
  6688. t === ie.PANORAMA && c.currentPano && !c.currentPano.isAligned() && (t = ie.OUTDOOR),
  6689. U.updateMode(t)
  6690. }),
  6691. e.on(oe.Move, _e.bind(this, "move")),
  6692. c.on(re.Ready, function() {
  6693. O.init(e, c, c.tagManager, l),
  6694. c.on(re.ModeChanged, function(e, t) {
  6695. e !== t && $(".vr-popup").is(":visible") && X.dismiss()
  6696. })
  6697. }),
  6698. c.on(re.PanoChosen, function(e, t) {
  6699. A(c, t),
  6700. U.updateMode(t && !t.isAligned() ? ie.OUTDOOR : ie.PANORAMA)
  6701. }),
  6702. V.on(k.CLOSE, function(e) {
  6703. switch (e) {
  6704. case "vr-modal":
  6705. X.dismiss();
  6706. break;
  6707. case "share-modal":
  6708. K.hide();
  6709. break;
  6710. case "terms-modal":
  6711. W.hide()
  6712. }
  6713. });
  6714. var o, h = $("#play").eq(0), u = $("#pause").eq(0), d = $(".pinBottom").toArray(), p = $("#drawer").eq(0), f = $("#playHead").eq(0), a = $("#progressBar").eq(0), g = $("#thumb-container").eq(0).children(), m = a.children();
  6715. l.on("update.controls", function() {
  6716. var e, t, i, n = l.describe();
  6717. if (n.tourIsPlaying || c.isWarping() ? (Ce.tourControls.visible && (h.hide(),
  6718. u.show()),
  6719. n.tourInProgress && (d.forEach(function(e) {
  6720. e.classList.add("playing")
  6721. }),
  6722. p.addClass("playing"),
  6723. f.addClass("playing"))) : (Ce.tourControls.visible && (h.show(),
  6724. u.hide()),
  6725. n.tourInProgress || (q.stopTour(),
  6726. d.forEach(function(e) {
  6727. e.classList.remove("playing")
  6728. }),
  6729. p.removeClass("playing"),
  6730. f.removeClass("playing"))),
  6731. null !== n.currentItem) {
  6732. var r, o;
  6733. $("#status").find(".curIdx").text(n.currentItem[0] + 1),
  6734. n.onTheBus ? (r = "active",
  6735. o = "recent") : (o = "active",
  6736. r = "recent");
  6737. var a = null === n.destinationItem || n.currentItem[0] === n.destinationItem[0];
  6738. for (e = 0; e < s.heroLocations.length; e += 1)
  6739. i = g.eq(e),
  6740. t = m.eq(e),
  6741. i.removeClass(o),
  6742. t.removeClass(o),
  6743. n.onTheBus && e === n.destinationItem[0] ? (i.addClass(r),
  6744. t.addClass(r),
  6745. w.activate(e)) : n.onTheBus && a && e === n.currentItem[0] ? (i.addClass(r),
  6746. t.addClass(r)) : (i.removeClass(r),
  6747. t.removeClass(r))
  6748. } else
  6749. for (e = 0; e < s.heroLocations.length; e += 1)
  6750. i = g.eq(e),
  6751. t = m.eq(e),
  6752. i.removeClass("active recent"),
  6753. t.removeClass("active recent");
  6754. v(l, c)
  6755. }),
  6756. document.addEventListener("keydown", function(e) {
  6757. switch (R.updateInteraction(oe.InteractionKey),
  6758. e.which) {
  6759. case te.ZERO:
  6760. M.debug && s.toggleAlpha();
  6761. break;
  6762. case te.NINE:
  6763. M.debug && B.toggle();
  6764. break;
  6765. case te.ONE:
  6766. c.isInMode(ie.TRANSITIONING) || l.changeMode(ie.PANORAMA);
  6767. break;
  6768. case te.TWO:
  6769. s.outsideAllowed() && !c.isInMode(ie.DOLLHOUSE, ie.TRANSITIONING) && l.changeMode(ie.DOLLHOUSE);
  6770. break;
  6771. case te.THREE:
  6772. s.outsideAllowed() && !c.isInMode(ie.FLOORPLAN, ie.TRANSITIONING) && l.changeMode(ie.FLOORPLAN);
  6773. break;
  6774. case te.FOUR:
  6775. c.isInMode(ie.TRANSITIONING) || l.changeMode(ie.OUTDOOR);
  6776. break;
  6777. case te.SPACE:
  6778. Ce.tourControls.visible && ($("#playHead").hasClass("playing") || _e("tour"));
  6779. break;
  6780. case te.RETURN:
  6781. M.debug && s.toggleExplodeUp();
  6782. break;
  6783. case te.P:
  6784. !function(e) {
  6785. me.gui || (me.gui = function(e) {
  6786. var t = new he.GUI;
  6787. return t.add(M, "showSweeps").name("Show sweeps").onFinishChange(function() {
  6788. e.setSweepVisibility(M.showSweeps)
  6789. }),
  6790. t.add(M, "rotationAccelerationInside", .1, 10).name("Rotation speed").step(.1),
  6791. t.add(M.transition, "flyTime", 0, 5e3).name("Transition time").onFinishChange(function() {
  6792. M.transition.flySpeed = 0,
  6793. t.__controllers.forEach(function(e) {
  6794. e.updateDisplay()
  6795. })
  6796. }),
  6797. t.add(M.path, "opacity", 0, 1).name("Path opacity"),
  6798. $(t.__closeButton).hide(),
  6799. t
  6800. }(me.model)),
  6801. (me.visible = e) ? $(me.gui.domElement).show() : $(me.gui.domElement).hide()
  6802. }(!me.visible);
  6803. break;
  6804. case te.U:
  6805. !function(e) {
  6806. ve.gui || (ve.gui = function(t, i) {
  6807. function e() {
  6808. var e = i.toJSON();
  6809. n.linkToLocation = window.location.protocol + "//" + window.location.host + window.location.pathname + "?m=" + t.sid + "&start=" + ee.serialize(e),
  6810. i.tagManager.activeTag && (n.linkToLocation += "&tag=" + i.tagManager.activeTag.sid)
  6811. }
  6812. var n = {}
  6813. , r = new he.GUI({
  6814. autoPlace: !0,
  6815. width: "60%"
  6816. });
  6817. return e(),
  6818. i.on(re.ViewChanged, e),
  6819. r.add(n, "linkToLocation").name(se.LINK_TO_LOCATION).listen(),
  6820. r.domElement.id = "datLinks",
  6821. [].slice.call(r.domElement.querySelectorAll(".property-name")).forEach(function(e) {
  6822. if (!S.detectSafari()) {
  6823. var t = document.createElement("button");
  6824. t.classList.add("btn-deep-link"),
  6825. t.innerText = se.MENU_COPY,
  6826. e.nextSibling.appendChild(t);
  6827. var n = function() {
  6828. alert(se.LINK_ALERT_COPY),
  6829. t.hide()
  6830. };
  6831. t.addEventListener("click", function(e) {
  6832. try {
  6833. var t = e.target.parentNode.childNodes[0];
  6834. t.select();
  6835. var i = document.execCommand("copy");
  6836. t.blur(),
  6837. i || n()
  6838. } catch (e) {
  6839. n()
  6840. }
  6841. })
  6842. }
  6843. }),
  6844. $(r.__closeButton).hide(),
  6845. r
  6846. }(ve.model, ve.player)),
  6847. (ve.visible = e) ? $(ve.gui.domElement).show() : $(ve.gui.domElement).hide()
  6848. }(!ve.visible);
  6849. break;
  6850. case te.X:
  6851. M.debug && s.toggleExplode();
  6852. break;
  6853. case te.PLUSEQUALS:
  6854. l.player.activatePersistentZooming(!0),
  6855. O.hideUi();
  6856. break;
  6857. case te.DASHUNDERSCORE:
  6858. l.player.activatePersistentZooming(!1),
  6859. O.hideUi();
  6860. break;
  6861. case te.SEVEN:
  6862. ue.info("Zoom level: " + l.player.zoomLevel + ", FOV: " + l.player.zoomFov);
  6863. break;
  6864. case te.EIGHT:
  6865. l.player.decreaseZoomSpeed();
  6866. break;
  6867. case te.NINE:
  6868. l.player.increaseZoomSpeed()
  6869. }
  6870. return c && c.reticule.hide(),
  6871. !0
  6872. }
  6873. .bind(this)),
  6874. document.addEventListener("keyup", function(e) {
  6875. switch (e.which) {
  6876. case te.PLUSEQUALS:
  6877. l.player.deactivatePersistentZooming();
  6878. break;
  6879. case te.DASHUNDERSCORE:
  6880. l.player.deactivatePersistentZooming()
  6881. }
  6882. }
  6883. .bind(this)),
  6884. function(e) {
  6885. me = {
  6886. gui: null,
  6887. visible: !1,
  6888. model: e
  6889. }
  6890. }(s),
  6891. function(e, t) {
  6892. ve = {
  6893. gui: null,
  6894. visible: !1,
  6895. model: e,
  6896. player: t
  6897. }
  6898. }(s, l.player),
  6899. function(e) {
  6900. function t(e, i) {
  6901. $(e).find("a").each(function(e, t) {
  6902. i ? $(t).removeClass("buttonZoomDisabled").addClass("buttonZoomEnabled") : $(t).addClass("buttonZoomDisabled").removeClass("buttonZoomEnabled"),
  6903. t.style.pointerEvents = i ? "auto" : "none"
  6904. })
  6905. }
  6906. e.on(de.ZoomMax, function() {
  6907. t("#gui-zoomin", !1),
  6908. t("#gui-zoomout", !0)
  6909. }),
  6910. e.on(de.ZoomMin, function() {
  6911. t("#gui-zoomin", !0),
  6912. t("#gui-zoomout", !1)
  6913. }),
  6914. e.on(de.ZoomIn, function() {
  6915. t("#gui-zoomout", !0)
  6916. }),
  6917. e.on(de.ZoomOut, function() {
  6918. t("#gui-zoomin", !0)
  6919. }),
  6920. e.zoomLevel >= M.zoom.max ? t("#gui-zoomin", !1) : t("#gui-zoomin", !0),
  6921. e.zoomLevel <= M.zoom.min ? t("#gui-zoomout", !1) : t("#gui-zoomout", !0)
  6922. }(c),
  6923. P.setAutoPlay(s.heroCount()),
  6924. U.init(c, i.mode),
  6925. U.on(H.OPENED, _e.bind(this, "help")),
  6926. W.init(),
  6927. W.on(j.OPENED, (o = document.getElementById("terms-modal"),
  6928. function() {
  6929. _e("terms"),
  6930. V.open(o)
  6931. }
  6932. )),
  6933. W.on(j.CLOSED, V.reset),
  6934. M.quickstart.enabled || D.delayLanding(i.mode).then(D.showMessage.bind(this, c, l, Ce.coBrand.visible)),
  6935. (M.quickstart.enabled || c.model.outsideAllowed()) && O.init(e, c, c.tagManager, l),
  6936. M.profiling.enabled && B.show(),
  6937. q.init(l)
  6938. }
  6939. ,
  6940. Le.exports.startLoading = function(e, t, i, n, r, o) {
  6941. function a() {
  6942. o.setLoadingStartTime(),
  6943. function() {
  6944. function e(e) {
  6945. e.target === t || $.contains(t, e.target) || e.target === i || $.contains(i, e.target) || e.target === n || $.contains(n, e.target)
  6946. }
  6947. $("body").css("touch-action", "none"),
  6948. $("#gui-parent").find("*:not(#tag-billboards)").on("touchmove", function(e) {});
  6949. var t = document.getElementById("terms-text")
  6950. , i = document.getElementById("more-help-wrapper")
  6951. , n = (document.getElementById("navigation-help-wrapper"),
  6952. document.getElementById("help-dialog"),
  6953. document.getElementById("tag-billboards"));
  6954. M.useWheel && (document.body.addEventListener("mousewheel", e, {
  6955. passive: !1
  6956. }),
  6957. document.body.addEventListener("DOMMouseScroll", e)),
  6958. $("#terms-text, #more-help-wrapper, #navigation-help-wrapper").off("touchmove").on("touchmove", function(e) {
  6959. e.stopPropagation()
  6960. })
  6961. }(),
  6962. r ? (D.showMessage(t, i, Ce.coBrand.visible),
  6963. l()) : function(e) {
  6964. L.show(e),
  6965. c()
  6966. }(l)
  6967. }
  6968. var s = $.Deferred()
  6969. , l = s.resolve.bind(s);
  6970. ye = !0,
  6971. _(e);
  6972. e.data.player_options && function(e) {
  6973. Ce.tourControls.visible = true//e.tour_buttons && S.valueFromHash("gt", 1),
  6974. Ce.coBrand.visible = e.presented_by && 1 !== M.specialEdition && M.brand && !S.valueFromHash("mls", !1),
  6975. Ce.highlight.visible = /* e.highlight_reel && */ 1 !== M.specialEdition && M.showHighlights
  6976. }(e.data.player_options),
  6977. 1 === M.specialEdition && $("body").addClass("specialEdition");
  6978. se.localizeGUI();
  6979. !function(i) {
  6980. function e(e, t) {
  6981. return !!i.player_options[e] && i[t || e]
  6982. }
  6983. $(".model-title").text(i.name);
  6984. var t = M.pageTitle;
  6985. 2 !== S.valueFromHash("mls", 0) && i.name && (t = i.name),
  6986. document.title = t,
  6987. S.isMobile() ? $("#gui-fullscreen").css("display", "none") : ($("[rel=tooltip]").tooltip({
  6988. delay: {
  6989. show: 50,
  6990. hide: 0
  6991. },
  6992. trigger: "hover",
  6993. html: !1,
  6994. viewport: {
  6995. selector: "body",
  6996. padding: 10
  6997. }
  6998. }),
  6999. S.inIframe() && document.getElementsByClassName("pinBottom-container")[0].classList.add("embed")),
  7000. z.populate({
  7001. name: e("model_name", "name"),
  7002. coBrand: e("presented_by"),
  7003. description: e("model_summary", "summary") || "暂无内容",
  7004. contactName: e("contact_name"),
  7005. address: e("address"),
  7006. phone: e("contact_phone"),
  7007. formattedPhone: i.formatted_contact_phone,
  7008. email: e("contact_email"),
  7009. url: e("external_url"),
  7010. socialSharing: i.enable_social_sharing && i.is_public
  7011. })
  7012. }(e.data);
  7013. r || $(".quick").addClass("hidden");
  7014. n ? (R.impression(),
  7015. a()) : (o.setWaitingStartTime(),
  7016. N.show(r, a))
  7017. return s
  7018. }
  7019. ,
  7020. Le.exports.endLoading = function(e, t, i) {
  7021. var n = t.player;
  7022. function r() {
  7023. i.dismissExaminedTag(),
  7024. i.disableHovering()
  7025. }
  7026. $("#gui-thumb").fadeOut(2500),
  7027. L.hide(function() {
  7028. ye = !1
  7029. }),
  7030. Y.init(e, i),
  7031. z.finishSetup(Object.keys(e.tags).length),
  7032. i.on(ne.IMAGE_OPENED, _e.bind(this, "tag")),
  7033. X.on(Z.OPENED, r),
  7034. K.on(ae.OPENED, r),
  7035. U.on(H.OPENED, r),
  7036. W.on(j.OPENED, r);
  7037. var o = i.enableHovering.bind(i);
  7038. if (X.on(Z.CLOSED, o),
  7039. K.on(ae.CLOSED, o),
  7040. U.on(H.CLOSED, o),
  7041. W.on(j.CLOSED, o),
  7042. M.labels.enabled && Object.keys(e.labels).length,
  7043. e.floors.length <= 1 || !Ce.floors.visible ? Ce.floors.visible = !1 : (h(e, t),
  7044. I(e.currentFloor, n.mode)),
  7045. "372" === getQueryVariable("m") && (Ce.floors.visible = 1,
  7046. h(e, t)),
  7047. c(),
  7048. v(t, t.player),
  7049. $("#gui").fadeIn(1500),
  7050. Ce.highlight.visible && (2 !== M.startHighlights || e.has360Views) && setTimeout(function() {
  7051. l(),
  7052. (!e.has360Views && 1 !== M.startHighlights || e.has360Views && 0 === M.startHighlights) && setTimeout(l, 2e3)
  7053. }, 2e3),
  7054. !S.isMobile())
  7055. for (var a = ["a", "#title-toggle", ".next-button", ".prev-button", ".gui-floor", ".meta-toggle", ".thumbImg", "logo-button"], s = 0; s < a.length; s++)
  7056. $(a[s]).addClass("hasHover");
  7057. _(e),
  7058. z.setupToggling(),
  7059. window.editHotPanel && editHotPanel(),
  7060. function() {
  7061. var i = $("#pullTab")
  7062. , e = {
  7063. bottom: {
  7064. "border-bottom-left-radius": "10px",
  7065. "border-bottom-right-radius": "10px"
  7066. },
  7067. top: {
  7068. "border-top-left-radius": "10px",
  7069. "border-top-right-radius": "10px"
  7070. }
  7071. }
  7072. , t = {
  7073. bottom: {
  7074. "border-top-right-radius": "10px",
  7075. "border-bottom-right-radius": "10px"
  7076. },
  7077. top: {
  7078. "border-bottom-left-radius": "10px",
  7079. "border-top-left-radius": "10px"
  7080. }
  7081. };
  7082. function n(e, t) {
  7083. $("#gui-modes-map > div:visible:last").css(e),
  7084. i.is(":visible") ? $(".viewContainer > div:visible:first").css(t) : $("#gui-modes-map > div:visible:first").css(t)
  7085. }
  7086. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? n(e.bottom, e.top) : n(t.bottom, t.top);
  7087. (window.MP_PREFETCHED_MODELDATA.model.special || "true" === window.MP_PREFETCHED_MODELDATA.special) && window.specialScene && specialScene.special().afterImplement()
  7088. }(),
  7089. window.EditTools && (window.editTool = new EditTools(n.sceneRenderer))
  7090. }
  7091. ,
  7092. Le.exports.onProgress = function(e) {
  7093. L.progress(e)
  7094. }
  7095. }
  7096. ).call(this, "/js/gui/gui.js")
  7097. }
  7098. , {
  7099. "../analytics": 4,
  7100. "../controls/serializer": 14,
  7101. "../enum/AlignmentType": 17,
  7102. "../enum/BlackoutStyle": 18,
  7103. "../enum/ControlEvents": 21,
  7104. "../enum/DirectorEvents": 23,
  7105. "../enum/Keys": 30,
  7106. "../enum/PathDiscardMode": 38,
  7107. "../enum/PathDisplayMode": 39,
  7108. "../enum/PlayerEvents": 40,
  7109. "../enum/VROption": 47,
  7110. "../enum/Vectors": 50,
  7111. "../enum/Viewmode": 51,
  7112. "../enum/WarpStyle": 52,
  7113. "../enum/ZoomEvents": 53,
  7114. "../lib/dat.gui": 93,
  7115. "../localization/localize": 108,
  7116. "../tag/Media/MediaEvent": 131,
  7117. "../objects/Snapshot": 153,
  7118. "../settings": 166,
  7119. "../util/ajax": 181,
  7120. "../util/browser": 182,
  7121. "../util/camera": 183,
  7122. "../util/logger": 189,
  7123. "../util/showcase": 193,
  7124. "../util/transitions": 195,
  7125. "./closer/ModalCloserEvent": 61,
  7126. "./closer/modalCloser": 62,
  7127. "./help/HelpEvent": 66,
  7128. "./help/help": 67,
  7129. "./helpManager": 68,
  7130. "./immersiveMode": 69,
  7131. "./konami": 70,
  7132. "./landingScreen": 71,
  7133. "./loadingScreen": 72,
  7134. "./memoryUsage": 73,
  7135. "./playButton": 74,
  7136. "./populateModal": 75,
  7137. "./sharing/ShareEvents": 76,
  7138. "./sharing/modal": 77,
  7139. "./terms/TermsEvent": 78,
  7140. "./terms/terms": 79,
  7141. "./title/TitleEvents": 80,
  7142. "./title/tagToggle": 81,
  7143. "./title/titleBar": 82,
  7144. "./tourInteraction": 84,
  7145. "./vr/vrEvent": 85,
  7146. "./vr/vrModal": 87,
  7147. "./webvr/WebVrEvent": 88,
  7148. "./webvr/webVRgui": 89,
  7149. three: 217
  7150. }],
  7151. 66: [function(e, t, i) {
  7152. "use strict";
  7153. t.exports = Object.freeze({
  7154. OPENED: "help.opened",
  7155. CLOSED: "help.closed"
  7156. })
  7157. }
  7158. , {}],
  7159. 67: [function(e, t, i) {
  7160. "use strict";
  7161. function n() {
  7162. p.on("click", function(e) {
  7163. T && T !== a.TRANSITIONING && (0 < window.getComputedStyle(v).getPropertyValue("opacity") && !x ? S.close() : T && T !== a.TRANSITIONING && (x = !0,
  7164. setTimeout(function() {
  7165. x = !1
  7166. }, h.help.modalStayDuration),
  7167. S.emit(l.OPENED),
  7168. f.addClass("open " + T),
  7169. p.addClass("open"),
  7170. o(),
  7171. r(),
  7172. v.style.removeProperty ? v.style.removeProperty("display") : v.style.removeAttribute("display"),
  7173. v.classList.add("fadeIn")))
  7174. }),
  7175. E.on("click", function(e) {
  7176. S.close()
  7177. }),
  7178. C.on("click", function(e) {
  7179. T && T !== a.TRANSITIONING && (o(),
  7180. r())
  7181. }),
  7182. I.on("click", function(e) {
  7183. o(),
  7184. I.addClass("underline-tab"),
  7185. c.fill(b, s.MORE_HELP),
  7186. f.addClass("more-help")
  7187. })
  7188. }
  7189. function r() {
  7190. C.addClass("underline-tab"),
  7191. c.fill(_, s.NAVIGATION, T),
  7192. f.addClass(T)
  7193. }
  7194. function o() {
  7195. f.removeClass("more-help " + a.PANORAMA + " " + a.DOLLHOUSE + " " + a.FLOORPLAN + " " + a.OUTDOOR),
  7196. A.forEach(function(e) {
  7197. e.classList.remove("underline-tab")
  7198. })
  7199. }
  7200. var a = e("../../enum/Viewmode")
  7201. , s = e("../../enum/HelpModalType")
  7202. , l = e("./HelpEvent")
  7203. , c = (e("../helpManager"),
  7204. e("./../populateModal"))
  7205. , h = e("../../settings")
  7206. , u = e("../../util/common")
  7207. , d = e("events").EventEmitter
  7208. , p = $(".footer-help").eq(0)
  7209. , f = $("#help-dialog").eq(0)
  7210. , g = document.querySelector("#quick-logo")
  7211. , m = document.querySelector("#loaderCoBrand")
  7212. , v = document.querySelector("#help-dialog")
  7213. , y = document.querySelector(".footer")
  7214. , A = $(".help-tabs").children().toArray()
  7215. , C = $(".navigation-tab").eq(0)
  7216. , I = $(".more-help-tab").eq(0)
  7217. , E = ($("#interaction-modal").eq(0).find(".interaction").toArray(),
  7218. f.find(".close").eq(0))
  7219. , _ = f.find(".interactions").toArray()
  7220. , b = f.find(".ui-instructions").toArray()
  7221. , w = a.PANORAMA
  7222. , T = a.PANORAMA
  7223. , x = !1
  7224. , S = {
  7225. init: function(e, t) {
  7226. w = T = t,
  7227. [v, m, g, y].forEach(function(e) {
  7228. e.classList.add(c.deviceType)
  7229. }),
  7230. n()
  7231. },
  7232. close: function() {
  7233. if (f.hasClass("open") && (this.emit(l.CLOSED),
  7234. p.removeClass("open"),
  7235. f.removeClass("open"),
  7236. v.classList.contains("fadeIn"))) {
  7237. v.classList.remove("fadeIn");
  7238. var e = T === a.TRANSITIONING ? w : T;
  7239. c.clear(_, s.NAVIGATION, e)
  7240. }
  7241. },
  7242. updateMode: function(e) {
  7243. w = T,
  7244. T = e
  7245. }
  7246. };
  7247. u.extendObject(S, d.prototype),
  7248. t.exports = S
  7249. }
  7250. , {
  7251. "../../enum/HelpModalType": 28,
  7252. "../../enum/Viewmode": 51,
  7253. "../../settings": 166,
  7254. "../../util/common": 185,
  7255. "../helpManager": 68,
  7256. "./../populateModal": 75,
  7257. "./HelpEvent": 66,
  7258. events: 202
  7259. }],
  7260. 68: [function(s, l, e) {
  7261. (function(e) {
  7262. "use strict";
  7263. var t = s("../util/browser")
  7264. , i = s("./../util/logger")
  7265. , n = s("./../settings")
  7266. , r = new i(e)
  7267. , o = function() {
  7268. var t;
  7269. try {
  7270. return t = window.localStorage.getItem("visitCount") || "0",
  7271. t = (parseFloat(t) + 1).toString(),
  7272. window.localStorage.setItem("visitCount", t),
  7273. r.debug("visitCount = " + t),
  7274. t
  7275. } catch (e) {
  7276. t = "1",
  7277. r.debug("couldn't set local storage")
  7278. }
  7279. }()
  7280. , a = !1;
  7281. l.exports = {
  7282. isHelpDisabled: function() {
  7283. return "0" === t.valueFromHash("help", null) || a
  7284. },
  7285. isLargeHelpEnabled: function() {
  7286. return ("1" === o || "1" === t.valueFromHash("help", null)) && !this.isHelpDisabled()
  7287. },
  7288. isSmallHelpEnabled: function() {
  7289. return "2" === t.valueFromHash("help", null) && !this.isHelpDisabled()
  7290. },
  7291. isHelpEnabled: function() {
  7292. return this.isLargeHelpEnabled() || this.isSmallHelpEnabled()
  7293. },
  7294. setAutoPlay: function(e) {
  7295. a = 0 <= n.warp.auto && 1 < e
  7296. }
  7297. }
  7298. }
  7299. ).call(this, "/js/gui/helpManager.js")
  7300. }
  7301. , {
  7302. "../util/browser": 182,
  7303. "./../settings": 166,
  7304. "./../util/logger": 189
  7305. }],
  7306. 69: [function(e, t, i) {
  7307. "use strict";
  7308. function r(e) {
  7309. M || n(e) && C.hasClass("playing") || (clearTimeout(x),
  7310. T = !0,
  7311. h.close(),
  7312. function(e) {
  7313. !n(e) && S ? v.forEach(function(e) {
  7314. e.classList.remove("drawerOpen"),
  7315. e.classList.add("duringTour")
  7316. }) : C.hasClass("open") ? v.forEach(function(e) {
  7317. e.classList.remove("duringTour"),
  7318. e.classList.add("drawerOpen")
  7319. }) : P || R === g.FLOORPLAN || R === g.DOLLHOUSE || v.forEach(function(e) {
  7320. e.classList.add("fadeOut")
  7321. })
  7322. }(e),
  7323. R !== g.DOLLHOUSE && R !== g.FLOORPLAN && (E.hasClass("expand") && !_.hasClass("closed") || l.valueFromHash("title", 1),
  7324. C.hasClass("playing") || (y.forEach(function(e) {
  7325. e.classList.add("detectHover")
  7326. }),
  7327. x = setTimeout(a, c.immersive.timeToShowAgain))))
  7328. }
  7329. function o() {
  7330. C.hasClass("playing") || (clearTimeout(x),
  7331. x = setTimeout(a, c.immersive.timeToShowAgain))
  7332. }
  7333. function a() {
  7334. clearTimeout(x),
  7335. T = !1,
  7336. m.forEach(function(e) {
  7337. e.classList.remove("drawerOpen")
  7338. }),
  7339. S || v.forEach(function(e) {
  7340. e.classList.remove("duringTour")
  7341. }),
  7342. y.forEach(function(e) {
  7343. e.classList.remove("detectHover")
  7344. })
  7345. }
  7346. function s() {
  7347. T ? a() : r(),
  7348. M = !0,
  7349. setTimeout(function() {
  7350. M = !1
  7351. }, c.immersive.uiStayDuration)
  7352. }
  7353. function n(e) {
  7354. return "mouse" === e || "touch" === e || "key" === e || "gui" === e
  7355. }
  7356. var l = e("../util/browser")
  7357. , c = e("../settings")
  7358. , h = e("./help/help")
  7359. , u = e("../enum/tagEvents")
  7360. , d = e("../enum/ControlEvents")
  7361. , p = e("../enum/PlayerEvents")
  7362. , f = e("../enum/DirectorEvents")
  7363. , g = (p = e("../enum/PlayerEvents"),
  7364. e("../enum/Viewmode"))
  7365. , m = $(".pinTop.left, .pinBottom-container, #drawer-container, #drawer, .footer").toArray()
  7366. , v = $(".pinBottom-container, #drawer-container, .footer").toArray()
  7367. , y = $("#hover-bottom, #hover-top").toArray()
  7368. , A = ($("#pullTab").eq(0),
  7369. $("#playHead").eq(0),
  7370. $(".pinBottom-container").eq(0))
  7371. , C = $("#drawer").eq(0)
  7372. , I = $("#drawer-container").eq(0)
  7373. , E = $("#meta-info").eq(0)
  7374. , _ = $(".pinTop.left").eq(0)
  7375. , b = $("#player").eq(0)
  7376. , w = document.getElementById("pullTab")
  7377. , T = !1
  7378. , x = null
  7379. , S = !1
  7380. , M = !1
  7381. , R = null
  7382. , P = !1;
  7383. t.exports.init = function(e, t, i, n) {
  7384. (function(t, i, e, n) {
  7385. [g.PANORAMA, g.DOLLHOUSE, g.FLOORPLAN].forEach(function(e) {
  7386. t.controls[e].on(d.Move, r),
  7387. t.controls[e].on(d.LongTap, s)
  7388. }),
  7389. b.on("mousewheel DOMMouseScroll", r),
  7390. e.on(u.TagActivated, r),
  7391. e.on(u.TagNavigation, r),
  7392. i.on(p.FlyingEnded, o),
  7393. i.on(p.ModeChanging, function(e, t) {
  7394. P = t !== g.PANORAMA && e !== g.PANORAMA
  7395. }),
  7396. i.on(p.ModeChanged, function(e, t) {
  7397. R = i.mode,
  7398. t !== g.TRANSITIONING ? a() : r("modeChange")
  7399. }),
  7400. n.on(f.TourStart, function() {
  7401. S = !0,
  7402. r()
  7403. }),
  7404. n.on(f.TourEnd, function() {
  7405. S = !1,
  7406. a()
  7407. }),
  7408. n.on(f.ActionInterrupted, function() {
  7409. S = !1
  7410. }),
  7411. w.addEventListener("touchend", function() {
  7412. $("#pullTab").hasClass("opened") && !S && a()
  7413. }, !0)
  7414. }
  7415. )(e, t, i, n),
  7416. l.isMobile() ? (y.forEach(function(e) {
  7417. e.classList.add("mobile")
  7418. }),
  7419. A.click(a)) : (y.forEach(function(e) {
  7420. e.addEventListener("mouseleave", function() {
  7421. !b.is(":hover") && y[0].classList.contains("detectHover") && a()
  7422. }, !0)
  7423. }),
  7424. b.mouseleave(function() {
  7425. y[0].classList.contains("detectHover") && a()
  7426. })),
  7427. R = t.mode
  7428. }
  7429. ,
  7430. t.exports.hideUi = r,
  7431. t.exports.resetDrawer = function() {
  7432. I.hasClass("duringTour") || (S = !1,
  7433. r("gui"),
  7434. a())
  7435. }
  7436. }
  7437. , {
  7438. "../enum/ControlEvents": 21,
  7439. "../enum/DirectorEvents": 23,
  7440. "../enum/tagEvents": 32,
  7441. "../enum/PlayerEvents": 40,
  7442. "../enum/Viewmode": 51,
  7443. "../settings": 166,
  7444. "../util/browser": 182,
  7445. "./help/help": 67
  7446. }],
  7447. 70: [function(i, n, e) {
  7448. (function(e) {
  7449. "use strict";
  7450. var t = i("./../util/logger")
  7451. , o = i("./../settings")
  7452. , a = i("./debug")
  7453. , s = i("./../util/common")
  7454. , l = (i("./gui"),
  7455. new t(e));
  7456. o.console && $("body").append('<div id="debug-console"></div>'),
  7457. n.exports.init = function(i, n, r) {
  7458. l.debug("konami has the modelInstance");
  7459. var t = [];
  7460. $(window).on("keydown", function(e) {
  7461. t.push(e.which),
  7462. t.length > o.secretPanelWord.length && t.shift(),
  7463. s.equalLists(t, o.secretPanelWord) && (l.debug("Developer mode active."),
  7464. o.debug = !0)
  7465. }),
  7466. $(window).on("keydown", function e(t) {
  7467. o.debug && 72 === t.which && (i && r ? (a.toggle(i, n, r),
  7468. $(window).off("keydown", e)) : console.warn("sorry we're not ready yet"))
  7469. })
  7470. }
  7471. }
  7472. ).call(this, "/js/gui/konami.js")
  7473. }
  7474. , {
  7475. "./../settings": 166,
  7476. "./../util/common": 185,
  7477. "./../util/logger": 189,
  7478. "./debug": 63,
  7479. "./gui": 65
  7480. }],
  7481. 71: [function(e, t, i) {
  7482. "use strict";
  7483. function r() {
  7484. s.clear(m, l.LANDING[v]),
  7485. g.removeClass("fadeIn")
  7486. }
  7487. var o = e("../settings")
  7488. , a = (e("./help/help"),
  7489. e("./helpManager"))
  7490. , s = e("./populateModal")
  7491. , l = e("../enum/HelpModalType")
  7492. , n = e("../enum/Viewmode")
  7493. , c = e("../enum/DirectorEvents")
  7494. , h = e("../enum/PlayerEvents")
  7495. , u = $("#quick-blackout").eq(0)
  7496. , d = $("#quick-logo").eq(0)
  7497. , p = $(".quick-brand").toArray()
  7498. , f = $("#loaderCoBrand").eq(0)
  7499. , g = $("#interaction-modal").eq(0)
  7500. , m = g.find(".interaction").toArray()
  7501. , v = ($("#model-title, .pinBottom-container, #drawer-container, #drawer, .footer").toArray(),
  7502. "");
  7503. t.exports.delayLanding = function(e) {
  7504. var t = $.Deferred();
  7505. e || t.resolve();
  7506. var i = o.startupFlyinDelay;
  7507. return e === n.PANORAMA && (i += o.dollhouse.transitionTime),
  7508. setTimeout(t.resolve.bind(t), i),
  7509. t
  7510. }
  7511. ,
  7512. t.exports.showMessage = function(e, t, i) {
  7513. var n = 0;
  7514. o.quickstart.enabled && (function(e) {
  7515. /* e && (f.addClass("quick-brand"), //quick-brand样式有问题 会遮住屏幕
  7516. d.before(f),
  7517. p = $(".quick-brand").toArray()), */
  7518. u.addClass("fadeOut")
  7519. /* setTimeout(function() {
  7520. p.forEach(function(e) {
  7521. e.classList.add("fadeIn")
  7522. })
  7523. }, o.quickstart.showTextDelay),
  7524. setTimeout(function() {
  7525. p.forEach(function(e) {
  7526. e.classList.add("fadeOut")
  7527. })
  7528. }, o.quickstart.fadeOutDelay) */
  7529. }(i),
  7530. n = o.quickstart.showTextDelay + o.quickstart.fadeOutDelay),
  7531. function(e, t) {
  7532. setTimeout(function() {
  7533. if (a.isHelpEnabled()) {
  7534. if (t(),
  7535. s.init(),
  7536. g.addClass("fadeIn landing " + s.deviceType),
  7537. a.isSmallHelpEnabled())
  7538. return void g.addClass("small");
  7539. s.fill(m, l.LANDING[v]),
  7540. g.addClass(v)
  7541. }
  7542. }, e);
  7543. var i = {
  7544. pc: ["images/pc_step1.png", "images/pc_step2.png", "images/pc_step3.png"],
  7545. mobile: ["images/phone_step1.png", "images/phone_step2.png", "images/phone_step3.png"]
  7546. }
  7547. , n = $(".nav-icon .icon");
  7548. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) && n.attr("src", i.mobile[0]);
  7549. function r(e) {
  7550. e.on("click", function() {
  7551. var e = null;
  7552. if (e = "plus" == $(this).attr("data-id") ? +n.attr("data-page") + 1 : +n.attr("data-page") - 1,
  7553. i.length < e || e < 1)
  7554. return !1;
  7555. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? n.attr({
  7556. "data-page": e,
  7557. src: i.mobile[e - 1]
  7558. }) : n.attr({
  7559. "data-page": e,
  7560. src: i.pc[e - 1]
  7561. })
  7562. })
  7563. }
  7564. r($(".next-button")),
  7565. r($(".prev-button"))
  7566. }(n, function() {
  7567. e.once(h.Move, r),
  7568. t.once(c.TourStart, r)
  7569. })
  7570. }
  7571. ,
  7572. t.exports.init = function(e, t) {
  7573. v = t.mode === n.PANORAMA && t.pano && !t.pano.isAligned() ? n.OUTDOOR : t.mode
  7574. }
  7575. ,
  7576. t.exports.dismissModal = r
  7577. }
  7578. , {
  7579. "../enum/DirectorEvents": 23,
  7580. "../enum/HelpModalType": 28,
  7581. "../enum/PlayerEvents": 40,
  7582. "../enum/Viewmode": 51,
  7583. "../settings": 166,
  7584. "./help/help": 67,
  7585. "./helpManager": 68,
  7586. "./populateModal": 75
  7587. }],
  7588. 72: [function(e, t, i) {
  7589. "use strict";
  7590. var n = e("./circleLoader").circleLoader;
  7591. t.exports = {
  7592. element: $("#gui-loading"),
  7593. hide: function(e) {
  7594. n.done(),
  7595. this.element.fadeOut(1500, e)
  7596. },
  7597. show: function(e) {
  7598. this.element.fadeIn(500, function() {
  7599. this.element.css("display", "table"),
  7600. e && e()
  7601. }
  7602. .bind(this))
  7603. },
  7604. progress: function(e) {
  7605. n.set(e)
  7606. }
  7607. }
  7608. }
  7609. , {
  7610. "./circleLoader": 60
  7611. }],
  7612. 73: [function(e, t, i) {
  7613. "use strict";
  7614. var n = e("../settings")
  7615. , r = $("#memory-info")
  7616. , o = r.find("#memory-gpu")
  7617. , a = !1;
  7618. t.exports = {
  7619. show: function() {
  7620. n.profiling.enabled && (r.show(),
  7621. a = !0)
  7622. },
  7623. hide: function() {
  7624. r.hide(),
  7625. a = !1
  7626. },
  7627. toggle: function() {
  7628. a ? this.hide() : this.show()
  7629. },
  7630. update: function(e) {
  7631. n.profiling.enabled && o.text(Math.floor(e / 1e6) + "MB")
  7632. }
  7633. }
  7634. }
  7635. , {
  7636. "../settings": 166
  7637. }],
  7638. 74: [function(e, t, i) {
  7639. "use strict";
  7640. e("../util/browser"),
  7641. e("../analytics");
  7642. e("../settings"),
  7643. t.exports = {
  7644. show: function(e, t) {
  7645. $("#gui-message").fadeOut(500, function() {
  7646. t()
  7647. })
  7648. }
  7649. }
  7650. }
  7651. , {
  7652. "../analytics": 4,
  7653. "../settings": 166,
  7654. "../util/browser": 182
  7655. }],
  7656. 75: [function(e, t, i) {
  7657. "use strict";
  7658. function n(e, t, i, n) {
  7659. i ? this.assets[t][i][this.deviceType] : this.assets[t][this.deviceType]
  7660. }
  7661. var r = e("../util/browser")
  7662. , o = e("../localization/localize")
  7663. , a = e("../enum/HelpModalType")
  7664. , s = (e("../enum/HelpModalSize"),
  7665. e("../enum/Viewmode"));
  7666. t.exports = {
  7667. init: function() {
  7668. if (!this.hasInitialized) {
  7669. this.hasInitialized = !0,
  7670. this.deviceType = r.isMobile() ? "mobile" : "desktop",
  7671. this.assets = {},
  7672. this.assets[a.LANDING[s.PANORAMA]] = {
  7673. desktop: {
  7674. left: {
  7675. "top-info": o.ROTATE,
  7676. "big-image": "images/nav_help_mouse_drag_left.png",
  7677. keyboard: "images/nav_help_keyboard_left_right.png"
  7678. },
  7679. middle: {
  7680. "top-info": o.MOVE,
  7681. "big-image": "images/nav_help_mouse_click.png",
  7682. keyboard: "images/nav_help_keyboard_up_down.png"
  7683. },
  7684. right: {
  7685. "top-info": o.ZOOM,
  7686. "big-image": "images/nav_help_mouse_zoom.png",
  7687. keyboard: "images/nav_help_zoom_keys.png"
  7688. }
  7689. },
  7690. mobile: {
  7691. left: {
  7692. "top-info": o.ROTATE,
  7693. "big-image": "images/nav_help_gesture_drag.png"
  7694. },
  7695. middle: {
  7696. "top-info": o.MOVE,
  7697. "big-image": "images/nav_help_gesture_tap.png"
  7698. },
  7699. right: {
  7700. "top-info": o.ZOOM,
  7701. "big-image": "images/nav_help_gesture_pinch.png"
  7702. }
  7703. }
  7704. },
  7705. this.assets[a.LANDING[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.LANDING[s.PANORAMA]])),
  7706. this.assets[a.LANDING[s.DOLLHOUSE]] = {
  7707. desktop: {
  7708. left: {
  7709. "top-info": o.ROTATE,
  7710. "big-image": "images/nav_help_mouse_drag_left.png",
  7711. keyboard: "images/nav_help_keyboard_left_right.png"
  7712. },
  7713. middle: {
  7714. "top-info": o.MOVE,
  7715. "big-image": "images/nav_help_mouse_position_right.png"
  7716. }
  7717. },
  7718. mobile: {
  7719. left: {
  7720. "top-info": o.ROTATE,
  7721. "big-image": "images/nav_help_gesture_drag.png"
  7722. },
  7723. middle: {
  7724. "top-info": o.MOVE,
  7725. "big-image": "images/nav_help_gesture_position_two_finger.png"
  7726. }
  7727. }
  7728. },
  7729. this.assets[a.LANDING[s.FLOORPLAN]] = {
  7730. desktop: {
  7731. left: {
  7732. "top-info": o.MOVE,
  7733. "big-image": "images/nav_help_mouse_position_left.png"
  7734. },
  7735. middle: {
  7736. "top-info": o.ROTATE,
  7737. "big-image": "images/nav_help_mouse_drag_right.png",
  7738. keyboard: "images/nav_help_keyboard_left_right.png"
  7739. }
  7740. },
  7741. mobile: {
  7742. left: {
  7743. "top-info": o.MOVE,
  7744. "big-image": "images/nav_help_gesture_position.png"
  7745. },
  7746. middle: {
  7747. "top-info": o.ROTATE,
  7748. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  7749. }
  7750. }
  7751. };
  7752. var e = {
  7753. "top-info": o.INSIDE,
  7754. "big-image": "images/nav_help_click_inside.png",
  7755. keyboard: "images/nav_help_inside_key.png"
  7756. };
  7757. this.assets[a.LANDING[s.OUTDOOR]].desktop.middle = e,
  7758. this.assets[a.LANDING[s.DOLLHOUSE]].desktop.right = e,
  7759. this.assets[a.LANDING[s.FLOORPLAN]].desktop.right = e;
  7760. var t = {
  7761. "top-info": o.INSIDE,
  7762. "big-image": "images/nav_help_tap_inside.png"
  7763. };
  7764. this.assets[a.LANDING[s.OUTDOOR]].mobile.middle = t,
  7765. this.assets[a.LANDING[s.DOLLHOUSE]].mobile.right = t,
  7766. this.assets[a.LANDING[s.FLOORPLAN]].mobile.right = t,
  7767. this.assets[a.NAVIGATION] = {},
  7768. this.assets[a.NAVIGATION][s.PANORAMA] = {
  7769. desktop: {
  7770. left: {
  7771. "top-info": o.HELP_DESKTOP_PANORAMA_1A,
  7772. "bottom-info": o.HELP_DESKTOP_PANORAMA_1B,
  7773. "big-image": "images/nav_help_mouse_drag_left.png",
  7774. keyboard: "images/nav_help_keyboard_left_right.png"
  7775. },
  7776. middle: {
  7777. "top-info": o.HELP_DESKTOP_PANORAMA_2A,
  7778. "bottom-info": o.HELP_DESKTOP_PANORAMA_2B,
  7779. "big-image": "images/nav_help_mouse_click.png",
  7780. keyboard: "images/nav_help_keyboard_up_down.png"
  7781. },
  7782. right: {
  7783. "top-info": o.HELP_DESKTOP_PANORAMA_3A,
  7784. "bottom-info": o.HELP_DESKTOP_PANORAMA_3B,
  7785. "big-image": "images/nav_help_mouse_zoom.png",
  7786. keyboard: "images/nav_help_zoom_keys.png"
  7787. }
  7788. },
  7789. mobile: {
  7790. left: {
  7791. "top-info": o.HELP_MOBILE_PANORAMA_1,
  7792. "big-image": "images/nav_help_gesture_drag.png"
  7793. },
  7794. middle: {
  7795. "top-info": o.HELP_MOBILE_PANORAMA_2,
  7796. "big-image": "images/nav_help_gesture_tap.png"
  7797. },
  7798. right: {
  7799. "top-info": o.HELP_MOBILE_3,
  7800. "big-image": "images/nav_help_gesture_pinch.png"
  7801. }
  7802. }
  7803. },
  7804. this.assets[a.NAVIGATION][s.DOLLHOUSE] = {
  7805. desktop: {
  7806. left: {
  7807. "top-info": o.HELP_DESKTOP_DOLLHOUSE_1A,
  7808. "bottom-info": o.HELP_DESKTOP_DOLLHOUSE_1B,
  7809. "big-image": "images/nav_help_mouse_drag_left.png",
  7810. keyboard: "images/nav_help_keyboard_all.png"
  7811. },
  7812. middle: {
  7813. "top-info": o.HELP_DESKTOP_DOLLHOUSE_2A,
  7814. "big-image": "images/nav_help_mouse_position_right.png"
  7815. },
  7816. right: {
  7817. "top-info": o.HELP_DESKTOP_DOLLHOUSE_3A,
  7818. "big-image": "images/nav_help_mouse_zoom.png"
  7819. }
  7820. },
  7821. mobile: {
  7822. left: {
  7823. "top-info": o.HELP_MOBILE_DOLLHOUSE_1,
  7824. "big-image": "images/nav_help_gesture_drag.png"
  7825. },
  7826. middle: {
  7827. "top-info": o.HELP_MOBILE_DOLLHOUSE_2,
  7828. "big-image": "images/nav_help_gesture_position_two_finger.png"
  7829. },
  7830. right: {
  7831. "top-info": o.HELP_MOBILE_3,
  7832. "big-image": "images/nav_help_gesture_pinch.png"
  7833. }
  7834. }
  7835. },
  7836. this.assets[a.NAVIGATION][s.FLOORPLAN] = {
  7837. desktop: {
  7838. left: {
  7839. "top-info": o.HELP_DESKTOP_FLOORPLAN_1A,
  7840. "big-image": "images/nav_help_mouse_position_left.png"
  7841. },
  7842. middle: {
  7843. "top-info": o.HELP_DESKTOP_FLOORPLAN_2A,
  7844. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_2B,
  7845. "big-image": "images/nav_help_mouse_drag_right.png",
  7846. keyboard: "images/nav_help_keyboard_left_right.png"
  7847. },
  7848. right: {
  7849. "top-info": o.HELP_DESKTOP_FLOORPLAN_3A,
  7850. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_3B,
  7851. "big-image": "images/nav_help_mouse_zoom.png",
  7852. keyboard: "images/nav_help_keyboard_up_down.png"
  7853. }
  7854. },
  7855. mobile: {
  7856. left: {
  7857. "top-info": o.HELP_MOBILE_FLOORPLAN_1,
  7858. "big-image": "images/nav_help_gesture_position.png"
  7859. },
  7860. middle: {
  7861. "top-info": o.HELP_MOBILE_FLOORPLAN_2,
  7862. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  7863. },
  7864. right: {
  7865. "top-info": o.HELP_MOBILE_3,
  7866. "big-image": "images/nav_help_gesture_pinch.png"
  7867. }
  7868. }
  7869. },
  7870. this.assets[a.NAVIGATION][s.OUTDOOR] = JSON.parse(JSON.stringify(this.assets[a.NAVIGATION][s.PANORAMA])),
  7871. this.assets[a.NAVIGATION][s.OUTDOOR].desktop.middle = {
  7872. "top-info": o.HELP_DESKTOP_360_2A,
  7873. "bottom-info": o.HELP_DESKTOP_360_2B,
  7874. "big-image": "images/nav_help_click_inside.png",
  7875. keyboard: "images/nav_help_inside_key.png"
  7876. },
  7877. this.assets[a.NAVIGATION][s.OUTDOOR].mobile.middle = {
  7878. "top-info": o.HELP_MOBILE_360_2,
  7879. "big-image": "images/nav_help_tap_inside.png"
  7880. },
  7881. this.assets[a.MORE_HELP] = {
  7882. desktop: {
  7883. "more-help-hlr": {
  7884. "top-info": o.HELP_MORE_HLR_A,
  7885. "big-image": "images/nav_help_expand.svg",
  7886. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  7887. },
  7888. "more-help-dollhouse": {
  7889. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  7890. "big-image": "images/nav_help_dollhouse.svg",
  7891. "bottom-info": o.HELP_DESKTOP_MORE_DOLLHOUSE_B
  7892. },
  7893. "more-help-floors": {
  7894. "top-info": o.HELP_MORE_FLOORS_A,
  7895. "big-image": "images/nav_help_floor picker.svg",
  7896. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  7897. },
  7898. "more-help-tag": {
  7899. "top-info": o.HELP_MORE_TAG_A,
  7900. "big-image": "images/nav_help_tag.svg",
  7901. "bottom-info": o.HELP_DESKTOP_MORE_TAG_B
  7902. },
  7903. "more-help-zoom": {
  7904. "top-info": o.HELP_MORE_ZOOM_A,
  7905. "big-image": "images/nav_help_zoom.svg",
  7906. "bottom-info": o.HELP_DESKTOP_MORE_ZOOM_B
  7907. },
  7908. "more-help-tour": {
  7909. "top-info": o.HELP_MORE_TOUR_A,
  7910. "big-image": "images/nav_help_play.png",
  7911. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  7912. },
  7913. "more-help-inside": {
  7914. "top-info": o.HELP_MORE_INSIDE_A,
  7915. "big-image": "images/nav_help_inside.svg",
  7916. "bottom-info": o.HELP_DESKTOP_MORE_INSIDE_B
  7917. },
  7918. "more-help-vr": {
  7919. "top-info": o.HELP_MORE_VR_A,
  7920. "big-image": "images/nav_help_vr.svg",
  7921. "bottom-info": o.HELP_DESKTOP_MORE_VR_B
  7922. },
  7923. "more-help-360": {
  7924. "top-info": o.HELP_MORE_360_A,
  7925. "big-image": "images/nav_help_360.svg",
  7926. "bottom-info": o.HELP_DESKTOP_MORE_360_B
  7927. },
  7928. "more-help-fullscreen": {
  7929. "top-info": o.HELP_MORE_FULLSCREEN_A,
  7930. "big-image": "images/nav_help_fullscreen.svg",
  7931. "bottom-info": o.HELP_DESKTOP_MORE_FULLSCREEN_B
  7932. }
  7933. },
  7934. mobile: {
  7935. "more-help-hlr": {
  7936. "top-info": o.HELP_MORE_HLR_A,
  7937. "big-image": "images/nav_help_expand.svg",
  7938. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  7939. },
  7940. "more-help-dollhouse": {
  7941. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  7942. "big-image": "images/nav_help_dollhouse.svg",
  7943. "bottom-info": o.HELP_MOBILE_MORE_DOLLHOUSE_B
  7944. },
  7945. "more-help-floors": {
  7946. "top-info": o.HELP_MORE_FLOORS_A,
  7947. "big-image": "images/nav_help_floor picker.svg",
  7948. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  7949. },
  7950. "more-help-tag": {
  7951. "top-info": o.HELP_MORE_TAG_A,
  7952. "big-image": "images/nav_help_tag.svg",
  7953. "bottom-info": o.HELP_MOBILE_MORE_TAG_B
  7954. },
  7955. "more-help-tour": {
  7956. "top-info": o.HELP_MORE_TOUR_A,
  7957. "big-image": "images/nav_help_play.png",
  7958. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  7959. },
  7960. "more-help-inside": {
  7961. "top-info": o.HELP_MORE_INSIDE_A,
  7962. "big-image": "images/nav_help_inside.svg",
  7963. "bottom-info": o.HELP_MOBILE_MORE_INSIDE_B
  7964. },
  7965. "more-help-vr": {
  7966. "top-info": o.HELP_MORE_VR_A,
  7967. "big-image": "images/webvr.svg",
  7968. "bottom-info": o.HELP_MOBILE_MORE_VR_B
  7969. },
  7970. "more-help-360": {
  7971. "top-info": o.HELP_MORE_360_A,
  7972. "big-image": "images/nav_help_360.svg",
  7973. "bottom-info": o.HELP_MOBILE_MORE_360_B
  7974. }
  7975. }
  7976. },
  7977. this.assets[a.TOUR_INTERACTION[s.PANORAMA]] = {
  7978. desktop: {
  7979. left: {
  7980. "top-info": o.ROTATE,
  7981. "big-image": "images/nav_help_mouse_drag_left.png",
  7982. keyboard: "images/nav_help_keyboard_left_right.png"
  7983. },
  7984. middle: {
  7985. "top-info": o.MOVE,
  7986. "big-image": "images/nav_help_mouse_click.png",
  7987. keyboard: "images/nav_help_keyboard_up_down.png"
  7988. },
  7989. right: {
  7990. "top-info": o.PLAY,
  7991. "big-image": "images/Desktop-help-play-button.svg",
  7992. keyboard: "images/Desktop-help-spacebar-2.svg"
  7993. }
  7994. },
  7995. mobile: {
  7996. left: {
  7997. "top-info": o.ROTATE,
  7998. "big-image": "images/nav_help_gesture_drag.png"
  7999. },
  8000. middle: {
  8001. "top-info": o.MOVE,
  8002. "big-image": "images/nav_help_gesture_tap.png"
  8003. },
  8004. right: {
  8005. "top-info": o.PLAY,
  8006. "big-image": "images/mobile-help-play-button.svg"
  8007. }
  8008. }
  8009. },
  8010. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.PANORAMA]])),
  8011. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].desktop.middle = this.assets[a.LANDING[s.OUTDOOR]].desktop.middle,
  8012. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].mobile.middle = this.assets[a.LANDING[s.OUTDOOR]].mobile.middle,
  8013. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.OUTDOOR]])),
  8014. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].desktop.left = this.assets[a.LANDING[s.FLOORPLAN]].desktop.left,
  8015. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].mobile.left = this.assets[a.LANDING[s.FLOORPLAN]].mobile.left
  8016. }
  8017. },
  8018. fill: function(e, t, i) {
  8019. n.call(this, e, t, i, !0)
  8020. },
  8021. clear: function(e, t, i) {
  8022. n.call(this, e, t, i, !1)
  8023. }
  8024. }
  8025. }
  8026. , {
  8027. "../enum/HelpModalSize": 27,
  8028. "../enum/HelpModalType": 28,
  8029. "../enum/Viewmode": 51,
  8030. "../localization/localize": 108,
  8031. "../util/browser": 182
  8032. }],
  8033. 76: [function(e, t, i) {
  8034. "use strict";
  8035. t.exports = Object.freeze({
  8036. OPENED: "share.open",
  8037. CLOSED: "share.closed",
  8038. LINK_CLICKED: "share.linked"
  8039. })
  8040. }
  8041. , {}],
  8042. 77: [function(e, t, i) {
  8043. "use strict";
  8044. function n(n) {
  8045. function e(e, t) {
  8046. var i = "top=" + (window.screenY + ($("#player").height() - t) / 2) + ",left=" + (window.screenX + ($("#player").width() - e) / 2) + ",width=" + e + ",height=" + t;
  8047. I.emit(l.LINK_CLICKED, {
  8048. channel: n
  8049. }),
  8050. window.open(C[n], "shareWindow", i)
  8051. }
  8052. switch (n) {
  8053. case A.FACEBOOK:
  8054. e(580, 420);
  8055. break;
  8056. case A.TWITTER:
  8057. e(550, 440);
  8058. break;
  8059. case A.MAIL:
  8060. I.emit(l.LINK_CLICKED, {
  8061. channel: "email"
  8062. }),
  8063. window.open(C[n], "_blank");
  8064. break;
  8065. case A.LINKEDIN:
  8066. }
  8067. }
  8068. function r(e) {
  8069. I.emit(l.LINK_CLICKED, {
  8070. channel: "copylink"
  8071. });
  8072. var t = document.createRange();
  8073. t.selectNodeContents(v);
  8074. var i = window.getSelection();
  8075. i.removeAllRanges(),
  8076. i.addRange(t),
  8077. document.execCommand("copy"),
  8078. y.classList.remove("hidden"),
  8079. v.classList.add("highlighted")
  8080. }
  8081. function o(e) {
  8082. e && (e.stopPropagation(),
  8083. e.target === v) || (window.getSelection().removeAllRanges(),
  8084. v.classList.remove("highlighted"),
  8085. y.classList.add("hidden"))
  8086. }
  8087. var a = e("../../util/browser")
  8088. , s = e("../../localization/localize")
  8089. , l = e("./ShareEvents")
  8090. , c = e("../../util/common")
  8091. , h = e("events").EventEmitter
  8092. , u = document.getElementById("sharing")
  8093. , d = document.getElementById("share-modal")
  8094. , p = document.getElementById("share-close")
  8095. , f = document.getElementById("facebook-share")
  8096. , g = document.getElementById("twitter-share")
  8097. , m = document.getElementById("mail-share")
  8098. , v = document.getElementById("share-url-text")
  8099. , y = document.getElementById("copy-success")
  8100. , A = Object.freeze({
  8101. FACEBOOK: "facebook",
  8102. TWITTER: "twitter",
  8103. MAIL: "mail",
  8104. LINKEDIN: "linkedin"
  8105. })
  8106. , C = {};
  8107. C[A.FACEBOOK] = "http://www.facebook.com/sharer.php?u=" + encodeURIComponent(window.location.href + "&utm_source=1") + "&t=",
  8108. C[A.TWITTER] = "http://twitter.com/intent/tweet?text=",
  8109. C[A.MAIL] = "mailto:?subject=";
  8110. var I = {
  8111. init: function(e) {
  8112. var t = encodeURIComponent(s.SHARE_EXPLORE + e + " " + s.SHARE_AT + " ");
  8113. C[A.FACEBOOK] += t + encodeURIComponent(window.location.href + "&utm_source=1"),
  8114. C[A.TWITTER] += t + encodeURIComponent(window.location.href + "&utm_source=2 " + s.SHARE_WITH + " #port"),
  8115. C[A.MAIL] += encodeURIComponent(s.SHARE_EXPLORE + e + s.SHARE_3D) + "&body=" + t + encodeURIComponent(window.location.href + "&utm_source=3"),
  8116. u.addEventListener("click", this.toggle.bind(this)),
  8117. p.addEventListener("click", this.hide.bind(this)),
  8118. v.addEventListener("click", r),
  8119. d.addEventListener("click", o),
  8120. f.addEventListener("click", n.bind(this, A.FACEBOOK)),
  8121. g.addEventListener("click", n.bind(this, A.TWITTER)),
  8122. m.addEventListener("click", n.bind(this, A.MAIL)),
  8123. v.textContent = window.location.href + "&utm_source=4",
  8124. d.classList.add(a.isMobile() ? "mobile" : "desktop"),
  8125. u.classList.remove("hidden")
  8126. },
  8127. show: function() {
  8128. this.emit(l.OPENED),
  8129. d.classList.add("fadeIn")
  8130. },
  8131. hide: function() {
  8132. d.classList.contains("fadeIn") && (this.emit(l.CLOSED),
  8133. document.selection && document.selection.empty(),
  8134. window.getSelection().removeAllRanges(),
  8135. o(),
  8136. d.classList.remove("fadeIn"))
  8137. },
  8138. toggle: function() {
  8139. d.classList.contains("fadeIn") ? this.hide() : this.show()
  8140. }
  8141. };
  8142. c.extendObject(I, h.prototype),
  8143. t.exports = I
  8144. }
  8145. , {
  8146. "../../localization/localize": 108,
  8147. "../../util/browser": 182,
  8148. "../../util/common": 185,
  8149. "./ShareEvents": 76,
  8150. events: 202
  8151. }],
  8152. 78: [function(e, t, i) {
  8153. "use strict";
  8154. t.exports = Object.freeze({
  8155. OPENED: "terms.opened",
  8156. CLOSED: "terms.closed"
  8157. })
  8158. }
  8159. , {}],
  8160. 79: [function(e, t, i) {
  8161. "use strict";
  8162. var n = e("./TermsEvent")
  8163. , r = e("../../localization/localize")
  8164. , o = e("../../analytics")
  8165. , a = e("../../util/ajax")
  8166. , s = e("../../util/common")
  8167. , l = e("events").EventEmitter
  8168. , c = document.getElementById("terms-modal")
  8169. , h = {
  8170. init: function() {
  8171. $(".footer-terms").on("click", function(e) {
  8172. e.preventDefault(),
  8173. this.show()
  8174. }
  8175. .bind(this)),
  8176. $("#terms-modal .close").on("click", this.hide.bind(this))
  8177. },
  8178. show: function() {
  8179. this.emit(n.OPENED),
  8180. a.get("static/" + r.TERMS_TEXT_FILE).done(function(e) {
  8181. var t = $("#terms-text").html(e);
  8182. o.track("showcase_gui", {
  8183. gui_action: "click_terms_button",
  8184. interaction_source: "gui"
  8185. }),
  8186. t.find("a").attr("target", "_blank")
  8187. }).fail(function() {
  8188. $("#terms-text").html("<h1>" + r.TERMS_OF_USE + "</h1><p>" + r.TERMS_FAIL)
  8189. }),
  8190. c.classList.add("fadeIn")
  8191. },
  8192. hide: function(e) {
  8193. e && e.preventDefault(),
  8194. c.classList.contains("fadeIn") && this.emit(n.CLOSED),
  8195. c.classList.remove("fadeIn")
  8196. }
  8197. };
  8198. s.extendObject(h, l.prototype),
  8199. t.exports = h
  8200. }
  8201. , {
  8202. "../../analytics": 4,
  8203. "../../localization/localize": 108,
  8204. "../../util/ajax": 181,
  8205. "../../util/common": 185,
  8206. "./TermsEvent": 78,
  8207. events: 202
  8208. }],
  8209. 80: [function(e, t, i) {
  8210. "use strict";
  8211. t.exports = Object.freeze({
  8212. OPEN_INFO: "title.open.info",
  8213. CLOSE_INFO: "title.close.info",
  8214. SHOW_INFO: "title.show.info",
  8215. HIDE_INFO: "title.hide.info",
  8216. LINK_CLICKED: "title.link.click",
  8217. CONTACT_LINK_CLICKED: "title.contact.click",
  8218. ORIGIN_LINK_CLICKED: "title.origin.click"
  8219. })
  8220. }
  8221. , {}],
  8222. 81: [function(e, t, i) {
  8223. "use strict";
  8224. var o = e("../../settings");
  8225. t.exports.init = function(e, t) {
  8226. o.tags.enabled && 0 !== Object.keys(e.tags).length && function(t, i) {
  8227. function e(e) {
  8228. t.shouldShowtags = "show" === this.value,
  8229. t.shouldShowtags ? i.showAlltags(o.tags.startup.fadeInDuration) : i.hideAlltags(o.tags.startup.fadeInDuration)
  8230. }
  8231. document.getElementById("tag-toggles").classList.remove("hidden"),
  8232. document.getElementById("radio-tag-show").checked = !0;
  8233. for (var n = document.getElementById("tag-inputs").querySelectorAll("input"), r = 0; r < n.length; r++)
  8234. n[r].addEventListener("change", e)
  8235. }(e, t)
  8236. }
  8237. }
  8238. , {
  8239. "../../settings": 166
  8240. }],
  8241. 82: [function(S, M, e) {
  8242. (function(e) {
  8243. "use strict";
  8244. function i(e) {
  8245. return !(!e || l.inIframe() && document.referrer === e || (E.classList.remove("hidden"),
  8246. _.innerHTML = r.WEBVR_LEARN_MORE + ": ",
  8247. _.appendChild(function(e) {
  8248. var t = document.createElement("a");
  8249. return t.id = "url",
  8250. t.target = "_blank",
  8251. t.href = e,
  8252. t.innerText = e,
  8253. t.addEventListener("click", x.emit.bind(x, a.ORIGIN_LINK_CLICKED)),
  8254. t
  8255. }(e)),
  8256. b.forEach(function(e) {
  8257. e.classList.add("share-link")
  8258. }),
  8259. 0))
  8260. }
  8261. function s(e, t) {
  8262. var i = e
  8263. , n = t;
  8264. return function(e, t) {
  8265. i.push(t || n, e)
  8266. }
  8267. }
  8268. var l = S("../../util/browser")
  8269. , t = S("../../util/common")
  8270. , n = S("../../util/logger")
  8271. , r = S("../../localization/localize")
  8272. , o = S("./titleBarSettings")
  8273. , c = S("../../settings")
  8274. , a = S("./TitleEvents")
  8275. , h = S("events").EventEmitter
  8276. , u = new n(e)
  8277. , d = document.querySelector(".pinTop.left")
  8278. , p = document.getElementsByClassName("title-container")[0]
  8279. , f = document.getElementById("title-toggle").querySelector("i")
  8280. , g = document.getElementById("meta-info-wrapper")
  8281. , m = document.getElementById("meta-info")
  8282. , v = document.getElementById("meta-description")
  8283. , y = document.getElementsByClassName("contact-info")[0]
  8284. , A = document.getElementById("contact-data")
  8285. , C = document.getElementById("addressTxt")
  8286. , I = document.getElementById("tag-toggles")
  8287. , E = document.getElementById("share-origin")
  8288. , _ = document.getElementById("share-link-wrapper")
  8289. , b = [m, g, p]
  8290. , w = !1
  8291. , T = !1
  8292. , x = {
  8293. populate: function(e) {
  8294. if (function(e, t) {
  8295. return e && l.valueFromHash("title", 1) && 2 !== l.valueFromHash("mls", 0) ? (document.getElementsByClassName("titleText")[0].innerText = e,
  8296. (g_weixinObj.title = e).length > o.minTooltipCharacters && p.parentElement.setAttribute("data-original-title", e),
  8297. t && 1 !== c.specialEdition && c.brand && !c.mls ? document.getElementById("cobrandTitle").innerText = t : (document.getElementsByClassName("co-brand")[0].classList.add("hidden"),
  8298. document.getElementById("gui-name").classList.add("noCoBrand"),
  8299. document.getElementById("cobrandTitle").classList.add("hidden")),
  8300. !0) : (document.getElementById("model-title").classList.add("hidden"),
  8301. !1)
  8302. }(MP_PREFETCHED_MODELDATA.name, e.coBrand)) {
  8303. if (function(e) {
  8304. e ? (w = !0,
  8305. v.innerHTML = e) : v.classList.add("hidden")
  8306. }(e.description),
  8307. function(e, t, i, n) {
  8308. if ((e || t || i) && c.brand && !l.valueFromHash("mls", !1)) {
  8309. w = !0;
  8310. var r = []
  8311. , o = s(r, "<br>");
  8312. if (e && o('<span id="contactName">' + e + "</span>"),
  8313. t) {
  8314. var a = n || t;
  8315. o(l.isMobile() ? '<a id="phone" href="callto:' + t + '">' + a + "</a>" : "<span>" + a + "</span>")
  8316. }
  8317. i && o('<a id="email" href="mailTo:' + i + '">' + i + "</a>"),
  8318. r[0] = "",
  8319. A.innerHTML = r.join("")
  8320. } else
  8321. y.classList.add("hidden")
  8322. }(e.contactName, e.phone, e.email, e.formatted_contact_phone),
  8323. function(e) {
  8324. if ("string" == typeof e)
  8325. try {
  8326. e = JSON.parse(e)
  8327. } catch (e) {
  8328. return u.warn("Unable to parse address data"),
  8329. C.parentElement.classList.add("hidden")
  8330. }
  8331. if (e && (e.address_1 || e.address_2 || e.city || e.state || e.zip)) {
  8332. w = !0;
  8333. var t = []
  8334. , i = s(t, " ");
  8335. e.address_1 && i(e.address_1),
  8336. e.address_2 && i(e.address_2),
  8337. e.city && i(e.city, ", "),
  8338. e.state && i(e.state, ", "),
  8339. e.zip && i(e.zip, e.state ? " " : ", "),
  8340. t[0] = "",
  8341. C.innerText = t.join("")
  8342. } else
  8343. C.parentElement.classList.add("hidden")
  8344. }(e.address),
  8345. w) {
  8346. var t = document.createElement("br");
  8347. I.insertBefore(t, I.firstElementChild)
  8348. }
  8349. e.socialSharing && c.share.enabled && (T = i(e.url))
  8350. }
  8351. },
  8352. finishSetup: function(e) {
  8353. w = w || !!e,
  8354. document.getElementById("title-toggle").addEventListener("click", x.toggleTitle.bind(x)),
  8355. w && p.addEventListener("click", x.toggleMeta.bind(x, !1)),
  8356. [].slice.call(v.querySelectorAll("a")).forEach(function(e) {
  8357. e.addEventListener("click", x.emit.bind(x, a.LINK_CLICKED))
  8358. }),
  8359. [].slice.call(y.querySelectorAll("a")).forEach(function(e) {
  8360. e.addEventListener("click", x.emit.bind(x, a.CONTACT_LINK_CLICKED, {
  8361. contact_type: e.getAttribute("id")
  8362. }))
  8363. }),
  8364. w || (T ? p.classList.add("share-only") : p.classList.add("no-meta"))
  8365. },
  8366. toggleMeta: function(e, t) {
  8367. var i = document.getElementById("model-title");
  8368. t && t.preventDefault();
  8369. var n = m.classList.contains("expand");
  8370. e && !n || (n ? (b.forEach(function(e) {
  8371. e.classList.remove("expand")
  8372. }),
  8373. this.emit(a.CLOSE_INFO),
  8374. i.classList.remove("expand")) : (b.forEach(function(e) {
  8375. e.classList.add("expand")
  8376. }),
  8377. i.classList.add("expand"),
  8378. this.emit(a.OPEN_INFO)))
  8379. },
  8380. setupToggling: function() {
  8381. g.style.height = m.offsetHeight + "px",
  8382. m.addEventListener("transitionend", function() {
  8383. g.style.height = m.offsetHeight + "px"
  8384. })
  8385. },
  8386. toggleTitle: function(e) {
  8387. e && e.preventDefault(),
  8388. d.classList.contains("closed") ? (d.classList.add("open"),
  8389. f.classList.remove("icon-dpad-right"),
  8390. f.classList.add("icon-dpad-left"),
  8391. this.emit(a.SHOW_INFO),
  8392. setTimeout(function() {
  8393. d.classList.remove("closed"),
  8394. d.classList.remove("open")
  8395. }, o.removeAnimationClasses)) : (d.classList.add("closed"),
  8396. f.classList.remove("icon-dpad-left"),
  8397. f.classList.add("icon-dpad-right"),
  8398. this.emit(a.HIDE_INFO))
  8399. }
  8400. };
  8401. t.extendObject(x, h.prototype),
  8402. M.exports = x
  8403. }
  8404. ).call(this, "/js/gui/title/titleBar.js")
  8405. }
  8406. , {
  8407. "../../localization/localize": 108,
  8408. "../../settings": 166,
  8409. "../../util/browser": 182,
  8410. "../../util/common": 185,
  8411. "../../util/logger": 189,
  8412. "./TitleEvents": 80,
  8413. "./titleBarSettings": 83,
  8414. events: 202
  8415. }],
  8416. 83: [function(e, t, i) {
  8417. "use strict";
  8418. t.exports = Object.freeze({
  8419. minTooltipCharacters: 19,
  8420. removeAnimationClasses: 500
  8421. })
  8422. }
  8423. , {}],
  8424. 84: [function(e, t, i) {
  8425. "use strict";
  8426. function n() {
  8427. v.playTour(),
  8428. y && clearTimeout(y),
  8429. c(),
  8430. E.removeClass("fadeIn")
  8431. }
  8432. function r() {
  8433. A.classList.contains("playing") && (v.stopTour(),
  8434. E.addClass("fadeIn"),
  8435. setTimeout(function() {
  8436. E.removeClass("fadeIn")
  8437. }, h.tourInteraction.showPauseButton),
  8438. M || (clearTimeout(y),
  8439. y = setTimeout(s, h.tourInteraction.showModal)),
  8440. setTimeout(function() {
  8441. A.classList.remove("playing")
  8442. }, h.tourInteraction.allowNextClick))
  8443. }
  8444. function o() {
  8445. v.tourInProgress && (v.stopTour(),
  8446. v.endTourProgress(),
  8447. A.classList.remove("playing"))
  8448. }
  8449. function a() {
  8450. _.is(":visible") ? n() : r()
  8451. }
  8452. function s() {//去掉导览结束时的提示
  8453. /* if (!h.tourInteraction.disabled) {
  8454. T.removeClass("small landing " + d.FLOORPLAN + " " + d.OUTDOOR + " " + d.PANORAMA),
  8455. T.addClass("fadeIn tour " + p.deviceType);
  8456. var e, t = h.tourInteraction.smallModal ? m.SMALL : m.LARGE;
  8457. if (!h.tourInteraction.smallModal)
  8458. e = v.player.mode === d.PANORAMA && !v.player.currentPano.isAligned() || v.player.mode === d.DOLLHOUSE ? d.OUTDOOR : v.player.mode === d.FLOORPLAN ? d.FLOORPLAN : d.PANORAMA,
  8459. p.fill(x, g.TOUR_INTERACTION[e]),
  8460. T.addClass(e);
  8461. T.addClass(t)
  8462. } */
  8463. }
  8464. function l(e, t) {
  8465. if (t) {
  8466. var i = "keydown" === t.type
  8467. , n = t.which === u.SPACE || v.tourIsPlaying;
  8468. i && n || e || (M = !0),
  8469. v.atEndOfTour() && c(),
  8470. !v.tourIsPlaying && v.tourInProgress && (E.removeClass("fadeIn"),
  8471. c(),
  8472. t.which !== u.SPACE && o()),
  8473. i && n && a()
  8474. }
  8475. }
  8476. function c() {
  8477. T.removeClass("fadeIn")
  8478. }
  8479. var h = (e("../util/browser"),
  8480. e("../settings"))
  8481. , u = e("../enum/Keys")
  8482. , d = e("../enum/Viewmode")
  8483. , p = (e("./helpManager"),
  8484. e("./populateModal"))
  8485. , f = e("../enum/DirectorEvents")
  8486. , g = e("../enum/HelpModalType")
  8487. , m = e("../enum/HelpModalSize")
  8488. , v = null
  8489. , y = null
  8490. , A = document.getElementById("pause-overlay")
  8491. , C = document.getElementById("player")
  8492. , I = document.getElementById("gui")
  8493. , E = $("#pause-icon").eq(0)
  8494. , _ = $("#play").eq(0)
  8495. , b = $("#playHead").eq(0)
  8496. , w = $(".rightViewContainer, #previous, #next, #gui-modes-inside, #gui-modes-outside, #gui-modes-dollhouse, #gui-modes-floorplan").toArray()
  8497. , T = $("#interaction-modal").eq(0)
  8498. , x = $("#interaction-modal .interaction").toArray()
  8499. , S = ["touchstart", "mousedown", "pointerdown"]
  8500. , M = !1;
  8501. t.exports.init = function(e) {
  8502. v = e,
  8503. S.forEach(function(t) {
  8504. C.addEventListener(t, l.bind(this, !1), !0),
  8505. I.addEventListener(t, l.bind(this, !0), !0),
  8506. A.addEventListener(t, r, !0),
  8507. w.forEach(function(e) {
  8508. e.addEventListener(t, o, !0)
  8509. }),
  8510. $("#drawer img").on(t, o)
  8511. }),
  8512. document.addEventListener("keydown", l.bind(this, !1), !0),
  8513. v.on(f.TourStart, function() {
  8514. A.classList.add("playing")
  8515. })
  8516. }
  8517. ,
  8518. t.exports.play = n,
  8519. t.exports.pause = r,
  8520. t.exports.pauseWithoutCTA = o,
  8521. t.exports.togglePlay = a,
  8522. t.exports.stopTour = function() {
  8523. b.hasClass("playing") && (clearTimeout(y),
  8524. v.atEndOfTour() ? (A.classList.remove("playing"),
  8525. s()) : E.removeClass("fadeIn"))
  8526. }
  8527. ,
  8528. t.exports.dismissModal = c
  8529. }
  8530. , {
  8531. "../enum/DirectorEvents": 23,
  8532. "../enum/HelpModalSize": 27,
  8533. "../enum/HelpModalType": 28,
  8534. "../enum/Keys": 30,
  8535. "../enum/Viewmode": 51,
  8536. "../settings": 166,
  8537. "../util/browser": 182,
  8538. "./helpManager": 68,
  8539. "./populateModal": 75
  8540. }],
  8541. 85: [function(e, t, i) {
  8542. "use strict";
  8543. t.exports = Object.freeze({
  8544. OPENED: "vr.modal.opened",
  8545. LAUNCH: "vr.modal.launch",
  8546. CLOSED: "vr.modal.closed",
  8547. NEXT: "vr.modal.next",
  8548. PREV: "vr.modal.prev",
  8549. STORE: "vr.modal.store",
  8550. falseICECHOSEN: "vr.modal.device"
  8551. })
  8552. }
  8553. , {}],
  8554. 86: [function(e, t, i) {
  8555. "use strict";
  8556. var h = e("../../util/browser")
  8557. , u = e("../../enum/VRApps")
  8558. , n = e("../../enum/VRPlatforms")
  8559. , d = e("../../util/ajax")
  8560. , p = e("../../settings")
  8561. , r = {};
  8562. for (var o in r[u.CardboardAndroid] = "https://play.google.com/store/apps/details?id=com.port.mpvrcardboard&redirect_uri=",
  8563. r[u.CardboardIOS] = "https://itunes.apple.com/us/app/port-vr/id1168808473&redirect_uri=",
  8564. r[u.GearVR] = "https://www.oculus.com/experiences/gear-vr/811670972252145/?redirect_uri=",
  8565. u) {
  8566. var a = u[o];
  8567. r[a] += encodeURIComponent(document.referrer + "&display=" + a)
  8568. }
  8569. var s, f = {}, g = (-1 === (s = window.location.host).indexOf(".port.com") && -1 === s.indexOf("localhost") && (s = "my.port.com"),
  8570. "https://" + s);
  8571. t.exports.init = function(e, t, o) {
  8572. function a(e, t, i, n) {
  8573. function r() {
  8574. return "&utm_medium=" + (h.inIframe() ? "embed" : "direct") + ("&utm_source=" + s) + ("&utm_showcase_session_id=" + o)
  8575. }
  8576. return h.valueFromHash("vrcoll", !1) ? l + "&sids=" + t + "&lsid=" + t + "&ln=" + encodeURIComponent(i) + "&ld=" + encodeURIComponent(n) + "&display=" + e + r() : c + "&m=" + t + "&display=" + e + r()
  8577. }
  8578. var s = h.inIframe() ? encodeURIComponent(document.referrer) : encodeURIComponent(window.location.href)
  8579. , l = g + "/vr/dlist/?ret=" + s
  8580. , c = g + "/vr/show/?ret=" + s;
  8581. switch (e) {
  8582. case n.IOS:
  8583. !function(t, e, i, n) {
  8584. var r = a(t, e, i, n)
  8585. , o = {
  8586. responseType: "json",
  8587. data: {
  8588. branch_key: p.appConfig.branch_key,
  8589. data: {
  8590. m: e,
  8591. full_url: r,
  8592. $desktop_url: "",
  8593. $og_app_id: "331853976762864119",
  8594. $og_title: i,
  8595. $og_description: n,
  8596. $og_image_url: location.origin + "/api/v1/player/models/" + e + "/thumb",
  8597. $canonical_url: window.location.href
  8598. }
  8599. }
  8600. };
  8601. d.post("https://api.branch.io/v1/url", o).done(function(e) {
  8602. f[t] = e.url
  8603. }).fail(function(e) {
  8604. f[t] = e
  8605. }
  8606. .bind(this, r))
  8607. }(u.CardboardIOS, t.sid, t.name, t.summary);
  8608. break;
  8609. default:
  8610. !function(e, t, i) {
  8611. for (var n in u) {
  8612. var r = u[n]
  8613. , o = a(r, e, t, i);
  8614. f[r] = o
  8615. }
  8616. }(t.sid, t.name, t.summary)
  8617. }
  8618. }
  8619. ,
  8620. t.exports.launch = function(e) {
  8621. var t = f[e];
  8622. window.open(t, "_blank")
  8623. }
  8624. ,
  8625. t.exports.launchStore = function(e) {
  8626. var t = r[e];
  8627. window.open(t, "_blank")
  8628. }
  8629. }
  8630. , {
  8631. "../../enum/VRApps": 46,
  8632. "../../enum/VRPlatforms": 49,
  8633. "../../settings": 166,
  8634. "../../util/ajax": 181,
  8635. "../../util/browser": 182
  8636. }],
  8637. 87: [function(e, t, i) {
  8638. "use strict";
  8639. function c(e) {
  8640. var t;
  8641. switch (e) {
  8642. case y.IOS:
  8643. return 9 < (t = g.iosVersion()).major || 9 === t.major && 1 <= t.minor;
  8644. case y.Android:
  8645. return 4 < (t = g.androidVersion()).major || 4 === t.major && 4 < t.minor || 4 === t.major && 4 === t.minor && 4 <= t.patch
  8646. }
  8647. return !1
  8648. }
  8649. function h(e) {
  8650. switch (e) {
  8651. case y.Android:
  8652. x.filter(".cardboard").off().on("click", q.cardboardAndroid),
  8653. x.filter(".gearvr").off().on("click", q.gear),
  8654. n(k, U, "logo-button", "same-line");
  8655. break;
  8656. case y.UnsupportedAndroid:
  8657. n("", H, "", "");
  8658. break;
  8659. case y.IOS:
  8660. x.filter(".cardboard").off().on("click", q.cardboardIOS),
  8661. n(k, "", "logo-button", "");
  8662. break;
  8663. case y.Desktop:
  8664. x.filter(".cardboard").off().on("click", r.bind(this, null, N, B)),
  8665. x.filter(".gearvr").off().on("click", r.bind(this, U, F, null)),
  8666. n(k, U, "logo-button", "same-line"),
  8667. Q.cardboard()
  8668. }
  8669. }
  8670. function u(e) {
  8671. $(".p1, .p2, .p3").hide(),
  8672. l.insertAfter(T),
  8673. w.removeClass("front-page"),
  8674. w.removeClass("details-page"),
  8675. w.removeClass("lastPage"),
  8676. x.removeClass("logo-button"),
  8677. x.removeClass("same-line"),
  8678. T.removeClass("headsetOptions"),
  8679. S.attr("src", ""),
  8680. S.filter(".second").removeClass("gear"),
  8681. S.css("display", "inline-block"),
  8682. S.off(),
  8683. M.filter(".second").css("display", ""),
  8684. O.css("display", "none"),
  8685. $(".p" + (e + 1) + _).show(),
  8686. S.filter(".third").insertBefore(M.filter(".third"))
  8687. }
  8688. function n(e, t, i, n) {
  8689. w.addClass("front-page"),
  8690. S.filter(".first").attr("src", e),
  8691. S.filter(".second").attr("src", t),
  8692. x.filter(".first").addClass(i),
  8693. x.filter(".second").addClass(i),
  8694. x.addClass(n),
  8695. ".show-desktop" === _ && T.insertAfter(l)
  8696. }
  8697. function r(e, t, i) {
  8698. T.addClass("headsetOptions"),
  8699. x.off(),
  8700. S.filter(".second").attr("src", t),
  8701. O.css("display", "block"),
  8702. M.filter(".second").css("display", "none"),
  8703. O.on("click", function() {
  8704. u(b.Title),
  8705. h(y.Desktop)
  8706. }),
  8707. e && (X.emit(C.falseICECHOSEN, {
  8708. name: v.GearVR
  8709. }),
  8710. S.filter(".first").attr("src", e),
  8711. S.filter(".second").addClass("gear"),
  8712. S.filter(".second").on("click", m.launchStore.bind(this, v.GearVR)),
  8713. Q.gearvr()),
  8714. i && (X.emit(C.falseICECHOSEN, {
  8715. name: v.Cardboard
  8716. }),
  8717. S.filter(".third").attr("src", i),
  8718. S.filter(".third").show(),
  8719. S.filter(".third").insertAfter(S.filter(".second")),
  8720. S.filter(".third").addClass("link"),
  8721. S.filter(".second").addClass("link"),
  8722. S.filter(".second").on("click", m.launchStore.bind(this, v.CardboardIOS)),
  8723. S.filter(".third").on("click", m.launchStore.bind(this, v.CardboardAndroid)),
  8724. Q.cardboard())
  8725. }
  8726. function d(e, t) {
  8727. switch (t) {
  8728. case y.IOS:
  8729. j = W,
  8730. Y = G;
  8731. break;
  8732. case y.Desktop:
  8733. e === b.Cardboard ? (j = N,
  8734. Y = B,
  8735. S.filter(".second").on("click", m.launchStore.bind(this, v.CardboardIOS)),
  8736. S.filter(".third").on("click", m.launchStore.bind(this, v.CardboardAndroid))) : (j = F,
  8737. S.filter(".second").on("click", m.launchStore.bind(this, v.GearVR)),
  8738. Y = "");
  8739. break;
  8740. default:
  8741. Y = e === b.Cardboard ? (j = H,
  8742. G) : (j = V,
  8743. z)
  8744. }
  8745. }
  8746. function p(e, t, i) {
  8747. w.find(".inner").addClass("details-page"),
  8748. w.addClass("details-page"),
  8749. S.filter(".first").attr("src", e),
  8750. S.filter(".second").attr("src", t),
  8751. S.filter(".third").attr("src", i)
  8752. }
  8753. function f() {
  8754. var e = 1 < g.aspectRatio() && g.isMobile();
  8755. w.toggleClass("landscape", e).toggleClass("portrait", !e),
  8756. w.toggleClass("tiny", $("#player").height() <= o.narrowLandscapeHeight),
  8757. w.toggleClass("tinier", $("#player").height() <= o.reallyNarrowLandscapeHeight)
  8758. }
  8759. var g = e("../../util/browser")
  8760. , m = e("./vrLink")
  8761. , v = e("../../enum/VRApps")
  8762. , y = e("../../enum/VRPlatforms")
  8763. , A = e("../../enum/VRPages")
  8764. , C = e("./vrEvent")
  8765. , o = (e("../../settings"),
  8766. e("../../constants"))
  8767. , I = e("../../localization/localize")
  8768. , a = e("../../util/common")
  8769. , s = e("events").EventEmitter
  8770. , E = 0
  8771. , _ = null
  8772. , b = A.standard
  8773. , w = $(".vr-popup")
  8774. , l = w.find(".vr-popup-body")
  8775. , T = w.find(".vr-images")
  8776. , x = w.find(".img-container")
  8777. , S = w.find(".vr-sm-image")
  8778. , M = x.find(".vr-img-caption")
  8779. , R = $(".vr-buttons").find(".prev-button")
  8780. , P = $(".vr-buttons").find(".next-button")
  8781. , O = T.find(".front-close")
  8782. , L = $(".vr-page")
  8783. , D = w.find("img")
  8784. , N = "images/apple-store.png"
  8785. , F = "images/badge-oculus.png"
  8786. , B = "images/badge-cardboard.png"
  8787. , V = "images/logo-samsung.png"
  8788. , k = "images/headset-cardboard.png"
  8789. , U = "images/headset-gearvr.png"
  8790. , H = "images/ico-android-robot.png"
  8791. , z = "images/ico-gearvr.png"
  8792. , G = "images/ico-vr.png"
  8793. , W = "images/apple-logo-white.svg"
  8794. , j = null
  8795. , Y = null
  8796. , q = {}
  8797. , X = {
  8798. init: function(e, t) {
  8799. function i(e) {
  8800. X.emit(C.STORE, {
  8801. type: e
  8802. }),
  8803. m.launchStore(e)
  8804. }
  8805. function n(e) {
  8806. switch (e !== b.pageCount && (u(e),
  8807. L.text(e + 1 + " / " + b.pageCount)),
  8808. e) {
  8809. case b.Title:
  8810. R.css("display", "none"),
  8811. P.text(a[e]),
  8812. h(r);
  8813. break;
  8814. case b.Cardboard:
  8815. R.css("display", "block"),
  8816. P.text(a[e]),
  8817. x.filter(".cardboard").off(),
  8818. x.filter(".gearvr").off(),
  8819. d(e, r),
  8820. p(k, j, Y);
  8821. break;
  8822. case b.Gear:
  8823. P.text(a[e]),
  8824. d(e, r),
  8825. w.addClass("lastPage"),
  8826. p(U, j, Y);
  8827. break;
  8828. case b.pageCount:
  8829. w.removeClass("fadeIn"),
  8830. X.emit(C.CLOSED)
  8831. }
  8832. D.filter("[src='']").hide()
  8833. }
  8834. var r = g.detectAndroid() ? g.detectAndroidMobile() && c(y.Android) ? (w.addClass("supported"),
  8835. _ = ".show-supported",
  8836. y.Android) : (w.addClass("unsupported"),
  8837. _ = ".show-unsupported",
  8838. y.UnsupportedAndroid) : g.detectIPhone() || g.detectIPod() ? (w.addClass("ios"),
  8839. _ = ".show-ios",
  8840. b = A.ios,
  8841. y.IOS) : (w.addClass("desktop"),
  8842. _ = ".show-desktop",
  8843. y.Desktop);
  8844. function o(e) {
  8845. X.emit(C.LAUNCH, {
  8846. vr_platform: r,
  8847. vr_app: e
  8848. }),
  8849. m.launch(e)
  8850. }
  8851. m.init(r, e, t),
  8852. r !== y.Desktop && w.addClass("mobile"),
  8853. q.cardboardAndroid = o.bind(this, v.CardboardAndroid),
  8854. q.gear = o.bind(this, v.GearVR),
  8855. q.cardboardIOS = o.bind(this, v.CardboardIOS),
  8856. f(),
  8857. $(".show-supported, .show-unsupported, .show-ios, .show-desktop").hide(),
  8858. $(_).show();
  8859. var a = [I.VR_LEARN_MORE_CAPS, I.VR_NEXT_CAPS, I.VR_GOT_IT_CAPS]
  8860. , s = ["vr_modal_learn_more", "vr_modal_next", "vr_modal_done"];
  8861. r === y.IOS && (a.splice(1, 1),
  8862. s.splice(1, 1)),
  8863. $("#vr").on("click", function(e) {
  8864. e.preventDefault(),
  8865. window.vrEnabled || (window.vrEnabled = !0,
  8866. this.classList.add("active"),
  8867. $("#gui div").not("#vrOff").addClass("vrHide"),
  8868. $("#vrOffImg").css({
  8869. display: "inline-block"
  8870. }))
  8871. }),
  8872. $("#vrOff").on("click", function() {
  8873. window.vrEnabled = !1,
  8874. $("#gui div").not("#vrOff").removeClass("vrHide"),
  8875. $("#vrOffImg").css({
  8876. display: "none"
  8877. }),
  8878. $("#player canvas").css({
  8879. width: "",
  8880. height: ""
  8881. }),
  8882. $("#vr").removeClass("active")
  8883. });
  8884. var l = "https://my.port.com/vr/show/?m=" + e.sid;
  8885. r === y.IOS ? $(".cardboardLink").on("click", i.bind(this, v.CardboardIOS)) : $(".cardboardLink").on("click", i.bind(this, v.CardboardAndroid)),
  8886. $(".gearLink").on("click", i.bind(this, v.GearVR)),
  8887. $("span.modelLink").text(l),
  8888. R.on("click", function(e) {
  8889. X.emit(C.PREV),
  8890. n(--E)
  8891. }),
  8892. P.on("click", function(e) {
  8893. P.text(),
  8894. X.emit(C.NEXT, {
  8895. nextAction: s[E]
  8896. }),
  8897. n(++E)
  8898. }),
  8899. w.find(".close").on("click", X.dismiss)
  8900. },
  8901. dismiss: function() {
  8902. w.hasClass("fadeIn") && (w.removeClass("fadeIn"),
  8903. X.emit(C.CLOSED))
  8904. },
  8905. isDeviceSupported: c
  8906. };
  8907. a.extendObject(X, s.prototype),
  8908. $(window).resize(f);
  8909. var Z, K, Q = (Z = M.filter(".first").find(".cardboard"),
  8910. K = M.filter(".first").find(".gearvr"),
  8911. {
  8912. cardboard: function() {
  8913. K.addClass("hidden"),
  8914. Z.removeClass("hidden")
  8915. },
  8916. gearvr: function() {
  8917. Z.addClass("hidden"),
  8918. K.removeClass("hidden")
  8919. }
  8920. });
  8921. t.exports = X
  8922. }
  8923. , {
  8924. "../../constants": 8,
  8925. "../../enum/VRApps": 46,
  8926. "../../enum/VRPages": 48,
  8927. "../../enum/VRPlatforms": 49,
  8928. "../../localization/localize": 108,
  8929. "../../settings": 166,
  8930. "../../util/browser": 182,
  8931. "../../util/common": 185,
  8932. "./vrEvent": 85,
  8933. "./vrLink": 86,
  8934. events: 202
  8935. }],
  8936. 88: [function(e, t, i) {
  8937. "use strict";
  8938. t.exports = Object.freeze({
  8939. OPENED: "webvr.modal.opened",
  8940. SHOW_TERMS: "webvr.footer.show.terms"
  8941. })
  8942. }
  8943. , {}],
  8944. 89: [function(B, V, e) {
  8945. (function(e) {
  8946. "use strict";
  8947. function a() {
  8948. function t() {
  8949. p.isPresenting || (r.info("exiting webVR"),
  8950. c("webvr_exit_app"),
  8951. -1 === window.location.search.indexOf("&qs=1") ? window.location = window.location + "&qs=1" : window.location = window.location,
  8952. window.removeEventListener("vrdisplaypresentchange", t))
  8953. }
  8954. r.info("Headset mounted"),
  8955. u.suspend();
  8956. var e = document.createElement("canvas");
  8957. for (e.getContext("webgl"),
  8958. e.className = "webvr-canvas",
  8959. document.bgColor = "#000",
  8960. document.body.style.backgroundColor = "#000"; document.body.firstChild; )
  8961. document.body.removeChild(document.body.firstChild);
  8962. document.body.appendChild(e),
  8963. c("webvr_enter_app"),
  8964. p.requestPresent([{
  8965. source: e,
  8966. predistorted: !0
  8967. }]).catch(function(e) {
  8968. r.error("Failed to present: " + e),
  8969. c("webvr_exit_calibrate"),
  8970. t()
  8971. }),
  8972. d.then(function() {
  8973. window.dispatchEvent(new Event("vrapp-start"))
  8974. }),
  8975. window.addEventListener("vrdisplaypresentchange", t)
  8976. }
  8977. function s() {
  8978. c("webvr_modal_close"),
  8979. _.find(".enter-button").off("click", a),
  8980. E.fadeOut(g.guiAnimationSpeed, function() {
  8981. _.toggleClass("hidden", !1),
  8982. b.toggleClass("hidden", !0),
  8983. f.exitFullscreen()
  8984. }),
  8985. I.fadeIn(g.guiAnimationSpeed)
  8986. }
  8987. function t() {
  8988. M.toggleClass("hidden", !0),
  8989. S.toggleClass("hidden", !1)
  8990. }
  8991. function l() {
  8992. _.toggleClass("hidden"),
  8993. b.toggleClass("hidden")
  8994. }
  8995. function c(e) {
  8996. var t = f.isLandscape() ? "landscape" : "portrait";
  8997. i.trackAlways("showcase_gui", {
  8998. gui_action: e,
  8999. orientation: t
  9000. })
  9001. }
  9002. function h() {
  9003. var e = f.isLandscape();
  9004. E.toggleClass("landscape", e).toggleClass("portrait", !e)
  9005. }
  9006. var u, d, p, f = B("../../util/browser"), g = B("../../settings"), m = (B("./../gui"),
  9007. B("../../enum/VRPlatforms")), v = B("../../enum/VRApps"), y = B("./../vr/vrLink"), A = B("./WebVrEvent"), i = B("../../analytics"), C = (B("../../constants"),
  9008. B("../../localization/localize")), n = B("../../util/common"), r = new (B("../../util/logger"))(e), o = B("events").EventEmitter, I = $("#gui"), E = $(".webvr-popup"), _ = $(".webvr-popup .page.p1"), b = $(".webvr-popup .page.p2"), w = E.find(".image"), T = $(".webvr-popup .detail.headset"), x = $(".webvr-popup .detail.phone"), S = $(".webvr-popup .tab-content.webvr"), M = $(".webvr-popup .tab-content.native"), R = "images/headset-cardboard.png", P = "https://madeby.google.com/vr/", O = "webvr_daydream_link", L = P, D = O, N = {
  9009. init: function(e, t, i, n) {
  9010. function r(e) {
  9011. e.preventDefault(),
  9012. o(e.currentTarget.id)
  9013. }
  9014. function o(i) {
  9015. F[i](),
  9016. Object.keys(F).map(function(e, t) {
  9017. $("#" + e).toggleClass("tabs-underlined", e === i)
  9018. })
  9019. }
  9020. p = i,
  9021. u = t,
  9022. y.init(m.Android, e, n),
  9023. h(),
  9024. new RegExp("daydream","i").test(p.displayName) ? (o("tabdaydream"),
  9025. w.filter(".device-headset-side").attr("src", "images/device-daydream-side.png"),
  9026. _.find(".title").text(C.localizeText("WEBVR_FOR_DAYDREAM"))) : (o("tabcardboard"),
  9027. w.filter(".device-headset-side").attr("src", R),
  9028. _.find(".title").text(C.localizeText("WEBVR_FOR_CARDBOARD"))),
  9029. $("#vr").on("click", function(e) {
  9030. e.preventDefault(),
  9031. c("click_webvr_button"),
  9032. E.is(":hidden") && (N.emit(A.OPENED),
  9033. I.fadeOut(g.guiAnimationSpeed),
  9034. E.fadeIn(g.guiAnimationSpeed),
  9035. function() {
  9036. if (!d) {
  9037. var n = "https://static.port.com/webvr/" + (f.valueFromHash("webvr") || g.appConfig.webvr_version) + "/js/main.js";
  9038. d = new Promise(function(e, t) {
  9039. var i = document.createElement("script");
  9040. i.type = "text/javascript",
  9041. i.src = n,
  9042. i.onload = e,
  9043. document.head.appendChild(i)
  9044. }
  9045. )
  9046. }
  9047. _.find(".enter-button").on("click", a)
  9048. }())
  9049. }),
  9050. $(".webvr-popup .close").on("click", function(e) {
  9051. e.preventDefault(),
  9052. _.hasClass("hidden") ? (c("webvr_help_close"),
  9053. l()) : s()
  9054. }),
  9055. $("#tabcardboard").on("click", r),
  9056. $("#tabdaydream").on("click", r),
  9057. $("#tabnative").on("click", r),
  9058. $(".webvr-popup .open-with-app").on("click", function(e) {
  9059. e.preventDefault(),
  9060. c("webvr_learn_more"),
  9061. o("tabnative"),
  9062. l()
  9063. }),
  9064. $(".webvr-popup .help").on("click", function(e) {
  9065. e.preventDefault(),
  9066. c(_.hasClass("hidden") ? "webvr_help_close" : "webvr_help_show"),
  9067. l()
  9068. }),
  9069. $(".webvr-popup .terms").on("click", function(e) {
  9070. e.preventDefault(),
  9071. c("webvr_click_terms"),
  9072. s(),
  9073. N.emit(A.SHOW_TERMS)
  9074. }),
  9075. T.on("click", function(e) {
  9076. e.preventDefault(),
  9077. c(D),
  9078. window.open(L, "_blank")
  9079. }),
  9080. x.on("click", function(e) {
  9081. e.preventDefault(),
  9082. c("webvr_phone_link"),
  9083. window.open("https://vr.google.com/daydream/phones/", "_blank")
  9084. }),
  9085. $(".webvr-popup .badge-cardboard").on("click", function(e) {
  9086. e.preventDefault(),
  9087. c("webvr_cardboard_link"),
  9088. y.launch(v.CardboardAndroid)
  9089. }),
  9090. $(".webvr-popup .badge-oculus").on("click", function(e) {
  9091. e.preventDefault(),
  9092. c("webvr_oculus_link"),
  9093. y.launch(v.GearVR)
  9094. })
  9095. }
  9096. }, F = {
  9097. tabcardboard: function() {
  9098. w.filter(".device-headset").attr("src", R),
  9099. w.filter(".device-phone").attr("src", "images/ico-android-robot.png"),
  9100. L = "https://vr.google.com/cardboard/get-cardboard/",
  9101. D = "webvr_cardboard_link",
  9102. T.text(C.localizeText("VR_GOOGLE_CARDBOARD")),
  9103. x.text(C.localizeText("VR_COMPATIBLE_ANDROID_LONG")),
  9104. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !0),
  9105. t()
  9106. },
  9107. tabdaydream: function() {
  9108. w.filter(".device-headset").attr("src", "images/device-daydream.png"),
  9109. w.filter(".device-phone").attr("src", "images/device-pixel.png"),
  9110. L = P,
  9111. D = O,
  9112. T.text(C.localizeText("WEBVR_DAYDREAM_VIEW")),
  9113. x.text(C.localizeText("VR_NEED_DAYDREAM_PHONE")),
  9114. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !1),
  9115. t()
  9116. },
  9117. tabnative: function() {
  9118. w.filter(".badge-cardboard").attr("src", "images/badge-cardboard.png"),
  9119. w.filter(".badge-oculus").attr("src", "images/badge-oculus.png"),
  9120. M.toggleClass("hidden", !1),
  9121. S.toggleClass("hidden", !0)
  9122. }
  9123. };
  9124. n.extendObject(N, o.prototype),
  9125. $(window).resize(h),
  9126. V.exports = N
  9127. }
  9128. ).call(this, "/js/gui/webvr/webVRgui.js")
  9129. }
  9130. , {
  9131. "../../analytics": 4,
  9132. "../../constants": 8,
  9133. "../../enum/VRApps": 46,
  9134. "../../enum/VRPlatforms": 49,
  9135. "../../localization/localize": 108,
  9136. "../../settings": 166,
  9137. "../../util/browser": 182,
  9138. "../../util/common": 185,
  9139. "../../util/logger": 189,
  9140. "./../gui": 65,
  9141. "./../vr/vrLink": 86,
  9142. "./WebVrEvent": 88,
  9143. events: 202
  9144. }],
  9145. 90: [function(e, t, i) {
  9146. "use strict";
  9147. function n(e, t, i, n, r) {
  9148. this.floorId = n || 0 === n ? n : -1,
  9149. this.roomId = r || "",
  9150. this.labelId = e,
  9151. this.position = (new o.Vector3).copy(t),
  9152. this.text = i
  9153. }
  9154. var o = e("three")
  9155. , r = e("../util/browser");
  9156. n.prototype.build = function() {
  9157. var e = window.document.createElement("div");
  9158. r.isMobile() ? e.setAttribute("class", "gui-floorplan-label gui-floorplan-label-mobile") : e.setAttribute("class", "gui-floorplan-label");
  9159. var t = window.document.createElement("div");
  9160. t.setAttribute("class", "gui-floorplan-label-text");
  9161. var i = window.document.createTextNode(this.text);
  9162. t.appendChild(i),
  9163. e.appendChild(t),
  9164. window.document.body.appendChild(e),
  9165. this.labelGui = e,
  9166. this.textBlock = t,
  9167. $(this.labelGui).hide();
  9168. var n = window.getComputedStyle(this.labelGui);
  9169. this.initialTransform = n.transform || n.webkitTransform
  9170. }
  9171. ,
  9172. t.exports = n
  9173. }
  9174. , {
  9175. "../util/browser": 182,
  9176. three: 217
  9177. }],
  9178. 91: [function(e, t, i) {
  9179. "use strict";
  9180. function n() {
  9181. this.player = null,
  9182. this.modelManager = null,
  9183. this.container = null
  9184. }
  9185. var c, o, r = e("three"), a = (e("../util/common"),
  9186. e("../enum/PlayerEvents")), s = (e("../enum/DirectorEvents"),
  9187. e("../enum/ModelManagerEvents")), l = e("../settings"), h = e("../enum/Viewmode"), u = (e("../enum/WarpStyle"),
  9188. e("../util/transitions"),
  9189. e("../util/lerp"),
  9190. e("../util/browser"));
  9191. n.prototype.init = function(e, t, i) {
  9192. this.player = e,
  9193. this.modelManager = t,
  9194. this.container = i,
  9195. this.updateModel(),
  9196. this.bindEvents()
  9197. }
  9198. ,
  9199. n.prototype.bindEvents = function() {
  9200. this.modelManager.on(s.ActiveModelChanged, this.updateModel.bind(this)),
  9201. this.player.on(a.ViewChanged, this.handlePlayerViewChanged.bind(this)),
  9202. this.player.on(a.ModeChanged, this.handlePlayerViewChanged.bind(this)),
  9203. this.player.on(a.StartInside, this.handleStartInside.bind(this)),
  9204. this.player.on(a.StartOutside, this.handleStartOutside.bind(this))
  9205. }
  9206. ,
  9207. n.prototype.updateModel = function() {
  9208. this.model = this.modelManager.getActiveModel()
  9209. }
  9210. ,
  9211. n.prototype.handlePlayerViewChanged = function() {
  9212. this.updateLabelVisibility(),
  9213. this.updateLabelDisplay()
  9214. }
  9215. ,
  9216. n.prototype.getLabelsForFloor = function(t, i) {
  9217. return (i = i || []).length = 0,
  9218. this.model.labels.forEach(function(e) {
  9219. this.labelVisibleForFloor(e, t) && i.push(e)
  9220. }
  9221. .bind(this)),
  9222. i
  9223. }
  9224. ,
  9225. n.prototype.getLabelsForCurrentFloor = function(e) {
  9226. return this.getLabelsForFloor(this.model.currentFloor.floorIndex, e)
  9227. }
  9228. ,
  9229. n.prototype.labelVisibleForFloor = function(e, t) {
  9230. var i = u.isMobile() && this.player.getLabelScaleFactor() < l.labels.zoomHideThreshhold.mobile || !u.isMobile() && this.player.getLabelScaleFactor() < l.labels.zoomHideThreshhold.desktop;
  9231. if (!this.model.showingLabels || !e.labelGui || !i)
  9232. return !1;
  9233. var n = e.floorId === this.model.floors.size() - 1;
  9234. return this.model.allFloorsVisible ? n : e.floorId === t
  9235. }
  9236. ,
  9237. n.prototype.updateLabelVisibility = function(e) {
  9238. this.model.labels.forEach(function(e) {
  9239. this.supportedMode() && this.labelVisibleForFloor(e, this.model.currentFloor.floorIndex) ? this.showLabel(e, l.labels.fadeInDelay, l.labels.fadeInDuration) : this.hideLabel(e, l.labels.fadeOutDelay, l.labels.fadeOutDuration)
  9240. }
  9241. .bind(this))
  9242. }
  9243. ,
  9244. n.prototype.showAllLabels = function(t, i) {
  9245. this.model.labels.forEach(function(e) {
  9246. this.showLabel(e, t, i)
  9247. }
  9248. .bind(this))
  9249. }
  9250. ,
  9251. n.prototype.hideAllLabels = function(t, i) {
  9252. this.model.labels.forEach(function(e) {
  9253. this.hideLabel(e, t, i)
  9254. }
  9255. .bind(this))
  9256. }
  9257. ,
  9258. n.prototype.showLabel = function(e, t, i) {
  9259. this.model.showingLabels && (e.visible || (e.visible = !0,
  9260. e.labelGui.style.display = "block",
  9261. e.labelGui.style.opacity = 0,
  9262. $(e.labelGui).delay(t).fadeTo(i, 1)))
  9263. }
  9264. ,
  9265. n.prototype.hideLabel = function(e, t, i) {
  9266. e.visible && (e.visible = !1,
  9267. u.isMobile() ? $(e.labelGui).hide() : $(e.labelGui).delay(t).fadeOut(i))
  9268. }
  9269. ,
  9270. n.prototype.supportedMode = function() {
  9271. return this.player.mode === h.FLOORPLAN
  9272. }
  9273. ,
  9274. n.prototype.updateLabelDisplay = (new r.Vector3,
  9275. new r.Vector3,
  9276. o = [],
  9277. function() {
  9278. var e = this.player.getLabelScaleFactor()
  9279. , t = 1.2 * (1 - e) + .6
  9280. , i = u.isMobile() ? l.labels.zoomTruncateThreshhold.mobile : l.labels.zoomTruncateThreshhold.desktop;
  9281. this.getLabelsForCurrentFloor(o);
  9282. for (var n = 0; n < o.length; n++) {
  9283. var r = o[n];
  9284. this.supportedMode() && r.labelGui && (this.updateProjectedGuiElement(r.labelGui, r.textBlock, r.position, t, t),
  9285. i <= e && r.text.length >= l.labels.minLengthForTruncate ? r.textBlock.innerText = r.text.substring(0, l.labels.truncateLength) + l.labels.truncateSuffix : r.textBlock.innerText = r.text)
  9286. }
  9287. }
  9288. ),
  9289. n.prototype.updateProjectedGuiElement = (c = new r.Vector3,
  9290. new r.Vector3,
  9291. function(e, t, i, n, r) {
  9292. t.style.fontSize = 100 * r + "%";
  9293. var o = .5 * $("#player").width()
  9294. , a = .5 * $("#player").height();
  9295. c.copy(i),
  9296. c.project(this.player.camera);
  9297. var s = c.x * o + o
  9298. , l = -c.y * a + a;
  9299. s -= e.offsetWidth / 2,
  9300. l -= e.offsetHeight / 2,
  9301. e.style.left = s + "px",
  9302. e.style.top = l + "px"
  9303. }
  9304. ),
  9305. n.prototype.handleStartInside = function(e) {
  9306. this.updateLabelVisibility()
  9307. }
  9308. ,
  9309. n.prototype.handleStartOutside = function() {
  9310. this.updateLabelVisibility()
  9311. }
  9312. ,
  9313. t.exports = n
  9314. }
  9315. , {
  9316. "../enum/DirectorEvents": 23,
  9317. "../enum/ModelManagerEvents": 33,
  9318. "../enum/PlayerEvents": 40,
  9319. "../enum/Viewmode": 51,
  9320. "../enum/WarpStyle": 52,
  9321. "../settings": 166,
  9322. "../util/browser": 182,
  9323. "../util/common": 185,
  9324. "../util/lerp": 188,
  9325. "../util/transitions": 195,
  9326. three: 217
  9327. }],
  9328. 92: [function(e, t, i) {
  9329. "use strict";
  9330. Array.prototype.findIndex || (Array.prototype.findIndex = function(e) {
  9331. if (null == this)
  9332. throw new TypeError("Array.prototype.findIndex called on null or undefined");
  9333. if ("function" != typeof e)
  9334. throw new TypeError("predicate must be a function");
  9335. for (var t, i = Object(this), n = i.length >>> 0, r = arguments[1], o = 0; o < n; o++)
  9336. if (t = i[o],
  9337. e.call(r, t, o, i))
  9338. return o;
  9339. return -1
  9340. }
  9341. ),
  9342. Array.prototype.find || Object.defineProperty(Array.prototype, "find", {
  9343. value: function(e) {
  9344. if (null == this)
  9345. throw new TypeError('"this" is null or not defined');
  9346. var t = Object(this)
  9347. , i = t.length >>> 0;
  9348. if ("function" != typeof e)
  9349. throw new TypeError("predicate must be a function");
  9350. for (var n = arguments[1], r = 0; r < i; ) {
  9351. var o = t[r];
  9352. if (e.call(n, o, r, t))
  9353. return o;
  9354. r++
  9355. }
  9356. }
  9357. })
  9358. }
  9359. , {}],
  9360. 93: [function(e, t, i) {
  9361. "use strict";
  9362. var n, r, o, a, s, l, c, h, u, d, p, f, g, m, v, y, A, C, I, E, _, b, w, T, x, S, M, R, P, O, L, D, N, F, B, V, k, U, H, z, G, W, j, Y, q, X, Z, K, Q, J, ee = ee || {};
  9363. function te() {
  9364. this.backgroundElement = document.createElement("div"),
  9365. r.extend(this.backgroundElement.style, {
  9366. backgroundColor: "rgba(0,0,0,0.8)",
  9367. top: 0,
  9368. left: 0,
  9369. display: "none",
  9370. zIndex: "1000",
  9371. opacity: 0,
  9372. WebkitTransition: "opacity 0.2s linear"
  9373. }),
  9374. n.makeFullscreen(this.backgroundElement),
  9375. this.backgroundElement.style.position = "fixed",
  9376. this.domElement = document.createElement("div"),
  9377. r.extend(this.domElement.style, {
  9378. position: "fixed",
  9379. display: "none",
  9380. zIndex: "1001",
  9381. opacity: 0,
  9382. WebkitTransition: "-webkit-transform 0.2s ease-out, opacity 0.2s linear"
  9383. }),
  9384. document.body.appendChild(this.backgroundElement),
  9385. document.body.appendChild(this.domElement);
  9386. var e = this;
  9387. n.bind(this.backgroundElement, "click", function() {
  9388. e.hide()
  9389. })
  9390. }
  9391. function ie(e, t, i) {
  9392. Object.defineProperty(e, t, {
  9393. get: function() {
  9394. return "RGB" === this.__state.space || re(this, t, i),
  9395. this.__state[t]
  9396. },
  9397. set: function(e) {
  9398. "RGB" !== this.__state.space && (re(this, t, i),
  9399. this.__state.space = "RGB"),
  9400. this.__state[t] = e
  9401. }
  9402. })
  9403. }
  9404. function ne(e, t) {
  9405. Object.defineProperty(e, t, {
  9406. get: function() {
  9407. return "HSV" === this.__state.space || oe(this),
  9408. this.__state[t]
  9409. },
  9410. set: function(e) {
  9411. "HSV" !== this.__state.space && (oe(this),
  9412. this.__state.space = "HSV"),
  9413. this.__state[t] = e
  9414. }
  9415. })
  9416. }
  9417. function re(e, t, i) {
  9418. if ("HEX" === e.__state.space)
  9419. e.__state[t] = a.component_from_hex(e.__state.hex, i);
  9420. else {
  9421. if ("HSV" !== e.__state.space)
  9422. throw "Corrupted color state";
  9423. l.extend(e.__state, a.hsv_to_rgb(e.__state.h, e.__state.s, e.__state.v))
  9424. }
  9425. }
  9426. function oe(e) {
  9427. var t = a.rgb_to_hsv(e.r, e.g, e.b);
  9428. l.extend(e.__state, {
  9429. s: t.s,
  9430. v: t.v
  9431. }),
  9432. l.isNaN(t.h) ? l.isUndefined(e.__state.h) && (e.__state.h = 0) : e.__state.h = t.h
  9433. }
  9434. function ae() {
  9435. if (this.__state = o.apply(this, arguments),
  9436. !1 === this.__state)
  9437. throw "Failed to interpret color arguments";
  9438. this.__state.a = this.__state.a || 1
  9439. }
  9440. function se(e) {
  9441. return -1 < (e = e.toString()).indexOf(".") ? e.length - e.indexOf(".") - 1 : 0
  9442. }
  9443. function le(e, t) {
  9444. this.initialValue = e[t],
  9445. this.domElement = document.createElement("div"),
  9446. this.object = e,
  9447. this.property = t,
  9448. this.__onChange = void 0,
  9449. this.__onFinishChange = void 0
  9450. }
  9451. (t.exports = ee).gui = ee.gui || {},
  9452. ee.utils = ee.utils || {},
  9453. ee.controllers = ee.controllers || {},
  9454. ee.dom = ee.dom || {},
  9455. ee.color = ee.color || {},
  9456. ee.utils.css = {
  9457. load: function(e, t) {
  9458. var i = (t = t || document).createElement("link");
  9459. i.type = "text/css",
  9460. i.rel = "stylesheet",
  9461. i.href = e,
  9462. t.getElementsByTagName("head")[0].appendChild(i)
  9463. },
  9464. inject: function(e, t) {
  9465. t = t || document;
  9466. var i = document.createElement("style");
  9467. i.type = "text/css",
  9468. i.innerHTML = e,
  9469. t.getElementsByTagName("head")[0].appendChild(i)
  9470. }
  9471. },
  9472. ee.utils.common = (Q = Array.prototype.forEach,
  9473. J = Array.prototype.slice,
  9474. {
  9475. BREAK: {},
  9476. extend: function(i) {
  9477. return this.each(J.call(arguments, 1), function(e) {
  9478. for (var t in e)
  9479. this.isUndefined(e[t]) || (i[t] = e[t])
  9480. }, this),
  9481. i
  9482. },
  9483. defaults: function(i) {
  9484. return this.each(J.call(arguments, 1), function(e) {
  9485. for (var t in e)
  9486. this.isUndefined(i[t]) && (i[t] = e[t])
  9487. }, this),
  9488. i
  9489. },
  9490. compose: function() {
  9491. var i = J.call(arguments);
  9492. return function() {
  9493. for (var e = J.call(arguments), t = i.length - 1; 0 <= t; t--)
  9494. e = [i[t].apply(this, e)];
  9495. return e[0]
  9496. }
  9497. },
  9498. each: function(e, t, i) {
  9499. if (e)
  9500. if (Q && e.forEach && e.forEach === Q)
  9501. e.forEach(t, i);
  9502. else if (e.length === e.length + 0) {
  9503. for (var n = 0, r = e.length; n < r; n++)
  9504. if (n in e && t.call(i, e[n], n) === this.BREAK)
  9505. return
  9506. } else
  9507. for (var n in e)
  9508. if (t.call(i, e[n], n) === this.BREAK)
  9509. return
  9510. },
  9511. defer: function(e) {
  9512. setTimeout(e, 0)
  9513. },
  9514. toArray: function(e) {
  9515. return e.toArray ? e.toArray() : J.call(e)
  9516. },
  9517. isUndefined: function(e) {
  9518. return void 0 === e
  9519. },
  9520. isNull: function(e) {
  9521. return null === e
  9522. },
  9523. isNaN: function(e) {
  9524. return e != e
  9525. },
  9526. isArray: Array.isArray || function(e) {
  9527. return e.constructor === Array
  9528. }
  9529. ,
  9530. isObject: function(e) {
  9531. return e === Object(e)
  9532. },
  9533. isNumber: function(e) {
  9534. return e === e + 0
  9535. },
  9536. isString: function(e) {
  9537. return e === e + ""
  9538. },
  9539. isBoolean: function(e) {
  9540. return !1 === e || !0 === e
  9541. },
  9542. isFunction: function(e) {
  9543. return "[object Function]" === Object.prototype.toString.call(e)
  9544. }
  9545. }),
  9546. ee.controllers.Controller = (ee.utils.common.extend(le.prototype, {
  9547. onChange: function(e) {
  9548. return this.__onChange = e,
  9549. this
  9550. },
  9551. onFinishChange: function(e) {
  9552. return this.__onFinishChange = e,
  9553. this
  9554. },
  9555. setValue: function(e) {
  9556. return this.object[this.property] = e,
  9557. this.__onChange && this.__onChange.call(this, e),
  9558. this.updateDisplay(),
  9559. this
  9560. },
  9561. getValue: function() {
  9562. return this.object[this.property]
  9563. },
  9564. updateDisplay: function() {
  9565. return this
  9566. },
  9567. isModified: function() {
  9568. return this.initialValue !== this.getValue()
  9569. }
  9570. }),
  9571. le),
  9572. ee.dom.dom = function(c) {
  9573. function i(e) {
  9574. if ("0" === e || c.isUndefined(e))
  9575. return 0;
  9576. var t = e.match(n);
  9577. return c.isNull(t) ? 0 : parseFloat(t[1])
  9578. }
  9579. var h = {};
  9580. c.each({
  9581. HTMLEvents: ["change"],
  9582. MouseEvents: ["click", "mousemove", "mousedown", "mouseup", "mouseover"],
  9583. KeyboardEvents: ["keydown"]
  9584. }, function(e, t) {
  9585. c.each(e, function(e) {
  9586. h[e] = t
  9587. })
  9588. });
  9589. var n = /(\d+(\.\d+)?)px/
  9590. , r = {
  9591. makeSelectable: function(e, t) {
  9592. void 0 !== e && void 0 !== e.style && (e.onselectstart = t ? function() {
  9593. return !1
  9594. }
  9595. : function() {}
  9596. ,
  9597. e.style.MozUserSelect = t ? "auto" : "none",
  9598. e.style.KhtmlUserSelect = t ? "auto" : "none",
  9599. e.unselectable = t ? "on" : "off")
  9600. },
  9601. makeFullscreen: function(e, t, i) {
  9602. c.isUndefined(t) && (t = !0),
  9603. c.isUndefined(i) && (i = !0),
  9604. e.style.position = "absolute",
  9605. t && (e.style.left = 0,
  9606. e.style.right = 0),
  9607. i && (e.style.top = 0,
  9608. e.style.bottom = 0)
  9609. },
  9610. fakeEvent: function(e, t, i, n) {
  9611. i = i || {};
  9612. var r = h[t];
  9613. if (!r)
  9614. throw new Error("Event type " + t + " not supported.");
  9615. var o = document.createEvent(r);
  9616. switch (r) {
  9617. case "MouseEvents":
  9618. var a = i.x || i.clientX || 0
  9619. , s = i.y || i.clientY || 0;
  9620. o.initMouseEvent(t, i.bubbles || !1, i.cancelable || !0, window, i.clickCount || 1, 0, 0, a, s, !1, !1, !1, !1, 0, null);
  9621. break;
  9622. case "KeyboardEvents":
  9623. var l = o.initKeyboardEvent || o.initKeyEvent;
  9624. c.defaults(i, {
  9625. cancelable: !0,
  9626. ctrlKey: !1,
  9627. altKey: !1,
  9628. shiftKey: !1,
  9629. metaKey: !1,
  9630. keyCode: void 0,
  9631. charCode: void 0
  9632. }),
  9633. l(t, i.bubbles || !1, i.cancelable, window, i.ctrlKey, i.altKey, i.shiftKey, i.metaKey, i.keyCode, i.charCode);
  9634. break;
  9635. default:
  9636. o.initEvent(t, i.bubbles || !1, i.cancelable || !0)
  9637. }
  9638. c.defaults(o, n),
  9639. e.dispatchEvent(o)
  9640. },
  9641. bind: function(e, t, i, n) {
  9642. return n = n || !1,
  9643. e.addEventListener ? e.addEventListener(t, i, n) : e.attachEvent && e.attachEvent("on" + t, i),
  9644. r
  9645. },
  9646. unbind: function(e, t, i, n) {
  9647. return n = n || !1,
  9648. e.removeEventListener ? e.removeEventListener(t, i, n) : e.detachEvent && e.detachEvent("on" + t, i),
  9649. r
  9650. },
  9651. addClass: function(e, t) {
  9652. if (void 0 === e.className)
  9653. e.className = t;
  9654. else if (e.className !== t) {
  9655. var i = e.className.split(/ +/);
  9656. -1 == i.indexOf(t) && (i.push(t),
  9657. e.className = i.join(" ").replace(/^\s+/, "").replace(/\s+$/, ""))
  9658. }
  9659. return r
  9660. },
  9661. removeClass: function(e, t) {
  9662. if (t)
  9663. if (void 0 === e.className)
  9664. ;
  9665. else if (e.className === t)
  9666. e.removeAttribute("class");
  9667. else {
  9668. var i = e.className.split(/ +/)
  9669. , n = i.indexOf(t);
  9670. -1 != n && (i.splice(n, 1),
  9671. e.className = i.join(" "))
  9672. }
  9673. else
  9674. e.className = void 0;
  9675. return r
  9676. },
  9677. hasClass: function(e, t) {
  9678. return new RegExp("(?:^|\\s+)" + t + "(?:\\s+|$)").test(e.className) || !1
  9679. },
  9680. getWidth: function(e) {
  9681. var t = getComputedStyle(e);
  9682. return i(t["border-left-width"]) + i(t["border-right-width"]) + i(t["padding-left"]) + i(t["padding-right"]) + i(t.width)
  9683. },
  9684. getHeight: function(e) {
  9685. var t = getComputedStyle(e);
  9686. return i(t["border-top-width"]) + i(t["border-bottom-width"]) + i(t["padding-top"]) + i(t["padding-bottom"]) + i(t.height)
  9687. },
  9688. getOffset: function(e) {
  9689. var t = {
  9690. left: 0,
  9691. top: 0
  9692. };
  9693. if (e.offsetParent)
  9694. for (; t.left += e.offsetLeft,
  9695. t.top += e.offsetTop,
  9696. e = e.offsetParent; )
  9697. ;
  9698. return t
  9699. },
  9700. isActive: function(e) {
  9701. return e === document.activeElement && (e.type || e.href)
  9702. }
  9703. };
  9704. return r
  9705. }(ee.utils.common),
  9706. ee.controllers.OptionController = (q = ee.controllers.Controller,
  9707. X = ee.dom.dom,
  9708. Z = ee.utils.common,
  9709. (K = function(e, t, i) {
  9710. K.superclass.call(this, e, t);
  9711. var n = this;
  9712. if (this.__select = document.createElement("select"),
  9713. Z.isArray(i)) {
  9714. var r = {};
  9715. Z.each(i, function(e) {
  9716. r[e] = e
  9717. }),
  9718. i = r
  9719. }
  9720. Z.each(i, function(e, t) {
  9721. var i = document.createElement("option");
  9722. i.innerHTML = t,
  9723. i.setAttribute("value", e),
  9724. n.__select.appendChild(i)
  9725. }),
  9726. this.updateDisplay(),
  9727. X.bind(this.__select, "change", function() {
  9728. var e = this.options[this.selectedIndex].value;
  9729. n.setValue(e)
  9730. }),
  9731. this.domElement.appendChild(this.__select)
  9732. }
  9733. ).superclass = q,
  9734. Z.extend(K.prototype, q.prototype, {
  9735. setValue: function(e) {
  9736. var t = K.superclass.prototype.setValue.call(this, e);
  9737. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  9738. t
  9739. },
  9740. updateDisplay: function() {
  9741. return this.__select.value = this.getValue(),
  9742. K.superclass.prototype.updateDisplay.call(this)
  9743. }
  9744. }),
  9745. K),
  9746. ee.controllers.NumberController = (W = ee.controllers.Controller,
  9747. j = ee.utils.common,
  9748. (Y = function(e, t, i) {
  9749. Y.superclass.call(this, e, t),
  9750. i = i || {},
  9751. this.__min = i.min,
  9752. this.__max = i.max,
  9753. this.__step = i.step,
  9754. j.isUndefined(this.__step) ? 0 == this.initialValue ? this.__impliedStep = 1 : this.__impliedStep = Math.pow(10, Math.floor(Math.log(this.initialValue) / Math.LN10)) / 10 : this.__impliedStep = this.__step,
  9755. this.__precision = se(this.__impliedStep)
  9756. }
  9757. ).superclass = W,
  9758. j.extend(Y.prototype, W.prototype, {
  9759. setValue: function(e) {
  9760. return void 0 !== this.__min && e < this.__min ? e = this.__min : void 0 !== this.__max && e > this.__max && (e = this.__max),
  9761. void 0 !== this.__step && e % this.__step != 0 && (e = Math.round(e / this.__step) * this.__step),
  9762. Y.superclass.prototype.setValue.call(this, e)
  9763. },
  9764. min: function(e) {
  9765. return this.__min = e,
  9766. this
  9767. },
  9768. max: function(e) {
  9769. return this.__max = e,
  9770. this
  9771. },
  9772. step: function(e) {
  9773. return this.__step = e,
  9774. this.__impliedStep = e,
  9775. this.__precision = se(e),
  9776. this
  9777. }
  9778. }),
  9779. Y),
  9780. ee.controllers.NumberControllerBox = (U = ee.controllers.NumberController,
  9781. H = ee.dom.dom,
  9782. z = ee.utils.common,
  9783. (G = function(e, t, i) {
  9784. function n() {
  9785. var e = parseFloat(s.__input.value);
  9786. z.isNaN(e) || s.setValue(e)
  9787. }
  9788. function r(e) {
  9789. var t = a - e.clientY;
  9790. s.setValue(s.getValue() + t * s.__impliedStep),
  9791. a = e.clientY
  9792. }
  9793. function o() {
  9794. H.unbind(window, "mousemove", r),
  9795. H.unbind(window, "mouseup", o)
  9796. }
  9797. this.__truncationSuspended = !1,
  9798. G.superclass.call(this, e, t, i);
  9799. var a, s = this;
  9800. this.__input = document.createElement("input"),
  9801. this.__input.setAttribute("type", "text"),
  9802. H.bind(this.__input, "change", n),
  9803. H.bind(this.__input, "blur", function() {
  9804. n(),
  9805. s.__onFinishChange && s.__onFinishChange.call(s, s.getValue())
  9806. }),
  9807. H.bind(this.__input, "mousedown", function(e) {
  9808. H.bind(window, "mousemove", r),
  9809. H.bind(window, "mouseup", o),
  9810. a = e.clientY
  9811. }),
  9812. H.bind(this.__input, "keydown", function(e) {
  9813. 13 === e.keyCode && (s.__truncationSuspended = !0,
  9814. this.blur(),
  9815. s.__truncationSuspended = !1)
  9816. }),
  9817. this.updateDisplay(),
  9818. this.domElement.appendChild(this.__input)
  9819. }
  9820. ).superclass = U,
  9821. z.extend(G.prototype, U.prototype, {
  9822. updateDisplay: function() {
  9823. return this.__input.value = this.__truncationSuspended ? this.getValue() : function(e, t) {
  9824. var i = Math.pow(10, t);
  9825. return Math.round(e * i) / i
  9826. }(this.getValue(), this.__precision),
  9827. G.superclass.prototype.updateDisplay.call(this)
  9828. }
  9829. }),
  9830. G),
  9831. ee.controllers.NumberControllerSlider = (N = ee.controllers.NumberController,
  9832. F = ee.dom.dom,
  9833. B = ee.utils.css,
  9834. V = ee.utils.common,
  9835. (k = function(e, t, i, n, r) {
  9836. function o(e) {
  9837. e.preventDefault();
  9838. var t = F.getOffset(s.__background)
  9839. , i = F.getWidth(s.__background);
  9840. return s.setValue(function(e, t, i, n, r) {
  9841. return n + (e - t) / (i - t) * (r - n)
  9842. }(e.clientX, t.left, t.left + i, s.__min, s.__max)),
  9843. !1
  9844. }
  9845. function a() {
  9846. F.unbind(window, "mousemove", o),
  9847. F.unbind(window, "mouseup", a),
  9848. s.__onFinishChange && s.__onFinishChange.call(s, s.getValue())
  9849. }
  9850. k.superclass.call(this, e, t, {
  9851. min: i,
  9852. max: n,
  9853. step: r
  9854. });
  9855. var s = this;
  9856. this.__background = document.createElement("div"),
  9857. this.__foreground = document.createElement("div"),
  9858. F.bind(this.__background, "mousedown", function(e) {
  9859. F.bind(window, "mousemove", o),
  9860. F.bind(window, "mouseup", a),
  9861. o(e)
  9862. }),
  9863. F.addClass(this.__background, "slider"),
  9864. F.addClass(this.__foreground, "slider-fg"),
  9865. this.updateDisplay(),
  9866. this.__background.appendChild(this.__foreground),
  9867. this.domElement.appendChild(this.__background)
  9868. }
  9869. ).superclass = N,
  9870. k.useDefaultStyles = function() {
  9871. B.inject("/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\n.slider {\n box-shadow: inset 0 2px 4px rgba(0,0,0,0.15);\n height: 1em;\n border-radius: 1em;\n background-color: #eee;\n padding: 0 0.5em;\n overflow: hidden;\n}\n\n.slider-fg {\n padding: 1px 0 2px 0;\n background-color: #aaa;\n height: 1em;\n margin-left: -0.5em;\n padding-right: 0.5em;\n border-radius: 1em 0 0 1em;\n}\n\n.slider-fg:after {\n display: inline-block;\n border-radius: 1em;\n background-color: #fff;\n border: 1px solid #aaa;\n content: '';\n float: right;\n margin-right: -1em;\n margin-top: -1px;\n height: 0.9em;\n width: 0.9em;\n}")
  9872. }
  9873. ,
  9874. V.extend(k.prototype, N.prototype, {
  9875. updateDisplay: function() {
  9876. var e = (this.getValue() - this.__min) / (this.__max - this.__min);
  9877. return this.__foreground.style.width = 100 * e + "%",
  9878. k.superclass.prototype.updateDisplay.call(this)
  9879. }
  9880. }),
  9881. k),
  9882. ee.controllers.FunctionController = (P = ee.controllers.Controller,
  9883. O = ee.dom.dom,
  9884. L = ee.utils.common,
  9885. (D = function(e, t, i) {
  9886. D.superclass.call(this, e, t);
  9887. var n = this;
  9888. this.__button = document.createElement("div"),
  9889. this.__button.innerHTML = void 0 === i ? "Fire" : i,
  9890. O.bind(this.__button, "click", function(e) {
  9891. return e.preventDefault(),
  9892. n.fire(),
  9893. !1
  9894. }),
  9895. O.addClass(this.__button, "button"),
  9896. this.domElement.appendChild(this.__button)
  9897. }
  9898. ).superclass = P,
  9899. L.extend(D.prototype, P.prototype, {
  9900. fire: function() {
  9901. this.__onChange && this.__onChange.call(this),
  9902. this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  9903. this.getValue().call(this.object)
  9904. }
  9905. }),
  9906. D),
  9907. ee.controllers.BooleanController = (x = ee.controllers.Controller,
  9908. S = ee.dom.dom,
  9909. M = ee.utils.common,
  9910. (R = function(e, t) {
  9911. R.superclass.call(this, e, t);
  9912. var i = this;
  9913. this.__prev = this.getValue(),
  9914. this.__checkbox = document.createElement("input"),
  9915. this.__checkbox.setAttribute("type", "checkbox"),
  9916. S.bind(this.__checkbox, "change", function() {
  9917. i.setValue(!i.__prev)
  9918. }, !1),
  9919. this.domElement.appendChild(this.__checkbox),
  9920. this.updateDisplay()
  9921. }
  9922. ).superclass = x,
  9923. M.extend(R.prototype, x.prototype, {
  9924. setValue: function(e) {
  9925. var t = R.superclass.prototype.setValue.call(this, e);
  9926. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  9927. this.__prev = this.getValue(),
  9928. t
  9929. },
  9930. updateDisplay: function() {
  9931. return !0 === this.getValue() ? (this.__checkbox.setAttribute("checked", "checked"),
  9932. this.__checkbox.checked = !0) : this.__checkbox.checked = !1,
  9933. R.superclass.prototype.updateDisplay.call(this)
  9934. }
  9935. }),
  9936. R),
  9937. ee.color.toString = (T = ee.utils.common,
  9938. function(e) {
  9939. if (1 == e.a || T.isUndefined(e.a)) {
  9940. for (var t = e.hex.toString(16); t.length < 6; )
  9941. t = "0" + t;
  9942. return "#" + t
  9943. }
  9944. return "rgba(" + Math.round(e.r) + "," + Math.round(e.g) + "," + Math.round(e.b) + "," + e.a + ")"
  9945. }
  9946. ),
  9947. ee.color.interpret = (I = ee.color.toString,
  9948. E = ee.utils.common,
  9949. w = [{
  9950. litmus: E.isString,
  9951. conversions: {
  9952. THREE_CHAR_HEX: {
  9953. read: function(e) {
  9954. var t = e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);
  9955. return null !== t && {
  9956. space: "HEX",
  9957. hex: parseInt("0x" + t[1].toString() + t[1].toString() + t[2].toString() + t[2].toString() + t[3].toString() + t[3].toString())
  9958. }
  9959. },
  9960. write: I
  9961. },
  9962. SIX_CHAR_HEX: {
  9963. read: function(e) {
  9964. var t = e.match(/^#([A-F0-9]{6})$/i);
  9965. return null !== t && {
  9966. space: "HEX",
  9967. hex: parseInt("0x" + t[1].toString())
  9968. }
  9969. },
  9970. write: I
  9971. },
  9972. CSS_RGB: {
  9973. read: function(e) {
  9974. var t = e.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);
  9975. return null !== t && {
  9976. space: "RGB",
  9977. r: parseFloat(t[1]),
  9978. g: parseFloat(t[2]),
  9979. b: parseFloat(t[3])
  9980. }
  9981. },
  9982. write: I
  9983. },
  9984. CSS_RGBA: {
  9985. read: function(e) {
  9986. var t = e.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/);
  9987. return null !== t && {
  9988. space: "RGB",
  9989. r: parseFloat(t[1]),
  9990. g: parseFloat(t[2]),
  9991. b: parseFloat(t[3]),
  9992. a: parseFloat(t[4])
  9993. }
  9994. },
  9995. write: I
  9996. }
  9997. }
  9998. }, {
  9999. litmus: E.isNumber,
  10000. conversions: {
  10001. HEX: {
  10002. read: function(e) {
  10003. return {
  10004. space: "HEX",
  10005. hex: e,
  10006. conversionName: "HEX"
  10007. }
  10008. },
  10009. write: function(e) {
  10010. return e.hex
  10011. }
  10012. }
  10013. }
  10014. }, {
  10015. litmus: E.isArray,
  10016. conversions: {
  10017. RGB_ARRAY: {
  10018. read: function(e) {
  10019. return 3 == e.length && {
  10020. space: "RGB",
  10021. r: e[0],
  10022. g: e[1],
  10023. b: e[2]
  10024. }
  10025. },
  10026. write: function(e) {
  10027. return [e.r, e.g, e.b]
  10028. }
  10029. },
  10030. RGBA_ARRAY: {
  10031. read: function(e) {
  10032. return 4 == e.length && {
  10033. space: "RGB",
  10034. r: e[0],
  10035. g: e[1],
  10036. b: e[2],
  10037. a: e[3]
  10038. }
  10039. },
  10040. write: function(e) {
  10041. return [e.r, e.g, e.b, e.a]
  10042. }
  10043. }
  10044. }
  10045. }, {
  10046. litmus: E.isObject,
  10047. conversions: {
  10048. RGBA_OBJ: {
  10049. read: function(e) {
  10050. return !!(E.isNumber(e.r) && E.isNumber(e.g) && E.isNumber(e.b) && E.isNumber(e.a)) && {
  10051. space: "RGB",
  10052. r: e.r,
  10053. g: e.g,
  10054. b: e.b,
  10055. a: e.a
  10056. }
  10057. },
  10058. write: function(e) {
  10059. return {
  10060. r: e.r,
  10061. g: e.g,
  10062. b: e.b,
  10063. a: e.a
  10064. }
  10065. }
  10066. },
  10067. RGB_OBJ: {
  10068. read: function(e) {
  10069. return !!(E.isNumber(e.r) && E.isNumber(e.g) && E.isNumber(e.b)) && {
  10070. space: "RGB",
  10071. r: e.r,
  10072. g: e.g,
  10073. b: e.b
  10074. }
  10075. },
  10076. write: function(e) {
  10077. return {
  10078. r: e.r,
  10079. g: e.g,
  10080. b: e.b
  10081. }
  10082. }
  10083. },
  10084. HSVA_OBJ: {
  10085. read: function(e) {
  10086. return !!(E.isNumber(e.h) && E.isNumber(e.s) && E.isNumber(e.v) && E.isNumber(e.a)) && {
  10087. space: "HSV",
  10088. h: e.h,
  10089. s: e.s,
  10090. v: e.v,
  10091. a: e.a
  10092. }
  10093. },
  10094. write: function(e) {
  10095. return {
  10096. h: e.h,
  10097. s: e.s,
  10098. v: e.v,
  10099. a: e.a
  10100. }
  10101. }
  10102. },
  10103. HSV_OBJ: {
  10104. read: function(e) {
  10105. return !!(E.isNumber(e.h) && E.isNumber(e.s) && E.isNumber(e.v)) && {
  10106. space: "HSV",
  10107. h: e.h,
  10108. s: e.s,
  10109. v: e.v
  10110. }
  10111. },
  10112. write: function(e) {
  10113. return {
  10114. h: e.h,
  10115. s: e.s,
  10116. v: e.v
  10117. }
  10118. }
  10119. }
  10120. }
  10121. }],
  10122. function() {
  10123. b = !1;
  10124. var i = 1 < arguments.length ? E.toArray(arguments) : arguments[0];
  10125. return E.each(w, function(e) {
  10126. if (e.litmus(i))
  10127. return E.each(e.conversions, function(e, t) {
  10128. if (_ = e.read(i),
  10129. !1 === b && !1 !== _)
  10130. return (b = _).conversionName = t,
  10131. _.conversion = e,
  10132. E.BREAK
  10133. }),
  10134. E.BREAK
  10135. }),
  10136. b
  10137. }
  10138. ),
  10139. ee.GUI = ee.gui.GUI = function(e, t, i, c, h, u, d, p, f, n, g, r, o, m, v) {
  10140. function y(e, t, i, n) {
  10141. if (void 0 === t[i])
  10142. throw new Error("Object " + t + ' has no property "' + i + '"');
  10143. var r;
  10144. if (n.color)
  10145. r = new g(t,i);
  10146. else {
  10147. var o = [t, i].concat(n.factoryArgs);
  10148. r = c.apply(e, o)
  10149. }
  10150. n.before instanceof h && (n.before = n.before.__li),
  10151. C(e, r),
  10152. m.addClass(r.domElement, "c");
  10153. var a = document.createElement("span");
  10154. m.addClass(a, "property-name"),
  10155. a.innerHTML = r.property;
  10156. var s = document.createElement("div");
  10157. s.appendChild(a),
  10158. s.appendChild(r.domElement);
  10159. var l = A(e, s, n.before);
  10160. return m.addClass(l, R.CLASS_CONTROLLER_ROW),
  10161. m.addClass(l, typeof r.getValue()),
  10162. function(t, i, n) {
  10163. if (n.__li = i,
  10164. n.__gui = t,
  10165. v.extend(n, {
  10166. options: function(e) {
  10167. return 1 < arguments.length ? (n.remove(),
  10168. y(t, n.object, n.property, {
  10169. before: n.__li.nextElementSibling,
  10170. factoryArgs: [v.toArray(arguments)]
  10171. })) : v.isArray(e) || v.isObject(e) ? (n.remove(),
  10172. y(t, n.object, n.property, {
  10173. before: n.__li.nextElementSibling,
  10174. factoryArgs: [e]
  10175. })) : void 0
  10176. },
  10177. name: function(e) {
  10178. return n.__li.firstElementChild.firstElementChild.innerHTML = e,
  10179. n
  10180. },
  10181. listen: function() {
  10182. return n.__gui.listen(n),
  10183. n
  10184. },
  10185. remove: function() {
  10186. return n.__gui.remove(n),
  10187. n
  10188. }
  10189. }),
  10190. n instanceof f) {
  10191. var r = new p(n.object,n.property,{
  10192. min: n.__min,
  10193. max: n.__max,
  10194. step: n.__step
  10195. });
  10196. v.each(["updateDisplay", "onChange", "onFinishChange"], function(e) {
  10197. var t = n[e]
  10198. , i = r[e];
  10199. n[e] = r[e] = function() {
  10200. var e = Array.prototype.slice.call(arguments);
  10201. return t.apply(n, e),
  10202. i.apply(r, e)
  10203. }
  10204. }),
  10205. m.addClass(i, "has-slider"),
  10206. n.domElement.insertBefore(r.domElement, n.domElement.firstElementChild)
  10207. } else if (n instanceof p) {
  10208. var e = function(e) {
  10209. return v.isNumber(n.__min) && v.isNumber(n.__max) ? (n.remove(),
  10210. y(t, n.object, n.property, {
  10211. before: n.__li.nextElementSibling,
  10212. factoryArgs: [n.__min, n.__max, n.__step]
  10213. })) : e
  10214. };
  10215. n.min = v.compose(e, n.min),
  10216. n.max = v.compose(e, n.max)
  10217. } else
  10218. n instanceof u ? (m.bind(i, "click", function() {
  10219. m.fakeEvent(n.__checkbox, "click")
  10220. }),
  10221. m.bind(n.__checkbox, "click", function(e) {
  10222. e.stopPropagation()
  10223. })) : n instanceof d ? (m.bind(i, "click", function() {
  10224. m.fakeEvent(n.__button, "click")
  10225. }),
  10226. m.bind(i, "mouseover", function() {
  10227. m.addClass(n.__button, "hover")
  10228. }),
  10229. m.bind(i, "mouseout", function() {
  10230. m.removeClass(n.__button, "hover")
  10231. })) : n instanceof g && (m.addClass(i, "color"),
  10232. n.updateDisplay = v.compose(function(e) {
  10233. return i.style.borderLeftColor = n.__color.toString(),
  10234. e
  10235. }, n.updateDisplay),
  10236. n.updateDisplay());
  10237. n.setValue = v.compose(function(e) {
  10238. return t.getRoot().__preset_select && n.isModified() && _(t.getRoot(), !0),
  10239. e
  10240. }, n.setValue)
  10241. }(e, l, r),
  10242. e.__controllers.push(r),
  10243. r
  10244. }
  10245. function A(e, t, i) {
  10246. var n = document.createElement("li");
  10247. return t && n.appendChild(t),
  10248. i ? e.__ul.insertBefore(n, params.before) : e.__ul.appendChild(n),
  10249. e.onResize(),
  10250. n
  10251. }
  10252. function C(e, t) {
  10253. var i = e.getRoot()
  10254. , n = i.__rememberedObjects.indexOf(t.object);
  10255. if (-1 != n) {
  10256. var r = i.__rememberedObjectIndecesToControllers[n];
  10257. if (void 0 === r && (r = {},
  10258. i.__rememberedObjectIndecesToControllers[n] = r),
  10259. r[t.property] = t,
  10260. i.load && i.load.remembered) {
  10261. var o, a = i.load.remembered;
  10262. if (a[e.preset])
  10263. o = a[e.preset];
  10264. else {
  10265. if (!a[T])
  10266. return;
  10267. o = a[T]
  10268. }
  10269. if (o[n] && void 0 !== o[n][t.property]) {
  10270. var s = o[n][t.property];
  10271. t.initialValue = s,
  10272. t.setValue(s)
  10273. }
  10274. }
  10275. }
  10276. }
  10277. function I(e, t) {
  10278. return document.location.href + "." + t
  10279. }
  10280. function l(e, t) {
  10281. e.domElement.style.width = t + "px",
  10282. e.__save_row && e.autoPlace && (e.__save_row.style.width = t + "px"),
  10283. e.__closeButton && (e.__closeButton.style.width = t + "px")
  10284. }
  10285. function a(r, o) {
  10286. var a = {};
  10287. return v.each(r.__rememberedObjects, function(e, t) {
  10288. var i = {}
  10289. , n = r.__rememberedObjectIndecesToControllers[t];
  10290. v.each(n, function(e, t) {
  10291. i[t] = o ? e.initialValue : e.getValue()
  10292. }),
  10293. a[t] = i
  10294. }),
  10295. a
  10296. }
  10297. function E(e, t, i) {
  10298. var n = document.createElement("option");
  10299. n.innerHTML = t,
  10300. n.value = t,
  10301. e.__preset_select.appendChild(n),
  10302. i && (e.__preset_select.selectedIndex = e.__preset_select.length - 1)
  10303. }
  10304. function _(e, t) {
  10305. var i = e.__preset_select[e.__preset_select.selectedIndex];
  10306. i.innerHTML = t ? i.value + "*" : i.value
  10307. }
  10308. e.inject(".dg {\n /** Clear list styles */\n /* Auto-place container */\n /* Auto-placed GUI's */\n /* Line items that don't contain folders. */\n /** Folder names */\n /** Hides closed items */\n /** Controller row */\n /** Name-half (left) */\n /** Controller-half (right) */\n /** Controller placement */\n /** Shorter number boxes when slider is present. */\n /** Ensure the entire boolean and function row shows a hand */ }\n .dg ul {\n list-style: none;\n margin: 0;\n padding: 0;\n width: 100%;\n clear: both; }\n .dg.ac {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n height: 0;\n z-index: 0; }\n .dg:not(.ac) .main {\n /** Exclude mains in ac so that we don't hide close button */\n overflow: hidden; }\n .dg.main {\n -webkit-transition: opacity 0.1s linear;\n -o-transition: opacity 0.1s linear;\n -moz-transition: opacity 0.1s linear;\n transition: opacity 0.1s linear; }\n .dg.main.taller-than-window {\n overflow-y: auto; }\n .dg.main.taller-than-window .close-button {\n opacity: 1;\n /* TODO, these are style notes */\n margin-top: -1px;\n border-top: 1px solid #2c2c2c; }\n .dg.main ul.closed .close-button {\n opacity: 1 !important; }\n .dg.main:hover .close-button,\n .dg.main .close-button.drag {\n opacity: 1; }\n .dg.main .close-button {\n /*opacity: 0;*/\n -webkit-transition: opacity 0.1s linear;\n -o-transition: opacity 0.1s linear;\n -moz-transition: opacity 0.1s linear;\n transition: opacity 0.1s linear;\n border: 0;\n position: absolute;\n line-height: 19px;\n height: 20px;\n /* TODO, these are style notes */\n cursor: pointer;\n text-align: center;\n background-color: #000; }\n .dg.main .close-button:hover {\n background-color: #111; }\n .dg.a {\n float: right;\n margin-right: 15px;\n overflow-x: hidden; }\n .dg.a.has-save > ul {\n margin-top: 27px; }\n .dg.a.has-save > ul.closed {\n margin-top: 0; }\n .dg.a .save-row {\n position: fixed;\n top: 0;\n z-index: 1002; }\n .dg li {\n -webkit-transition: height 0.1s ease-out;\n -o-transition: height 0.1s ease-out;\n -moz-transition: height 0.1s ease-out;\n transition: height 0.1s ease-out; }\n .dg li:not(.folder) {\n cursor: auto;\n height: 27px;\n line-height: 27px;\n overflow: hidden;\n padding: 0 4px 0 5px; }\n .dg li.folder {\n padding: 0;\n border-left: 4px solid rgba(0, 0, 0, 0); }\n .dg li.title {\n cursor: pointer;\n margin-left: -4px; }\n .dg .closed li:not(.title),\n .dg .closed ul li,\n .dg .closed ul li > * {\n height: 0;\n overflow: hidden;\n border: 0; }\n .dg .cr {\n clear: both;\n padding-left: 3px;\n height: 27px; }\n .dg .property-name {\n cursor: default;\n float: left;\n clear: left;\n width: 40%;\n overflow: hidden;\n text-overflow: ellipsis; }\n .dg .c {\n float: left;\n width: 60%; }\n .dg .c input[type=text] {\n border: 0;\n margin-top: 4px;\n padding: 3px;\n width: 100%;\n float: right; }\n .dg .has-slider input[type=text] {\n width: 30%;\n /*display: none;*/\n margin-left: 0; }\n .dg .slider {\n float: left;\n width: 66%;\n margin-left: -5px;\n margin-right: 0;\n height: 19px;\n margin-top: 4px; }\n .dg .slider-fg {\n height: 100%; }\n .dg .c input[type=checkbox] {\n margin-top: 9px; }\n .dg .c select {\n margin-top: 5px; }\n .dg .cr.function,\n .dg .cr.function .property-name,\n .dg .cr.function *,\n .dg .cr.boolean,\n .dg .cr.boolean * {\n cursor: pointer; }\n .dg .selector {\n display: none;\n position: absolute;\n margin-left: -9px;\n margin-top: 23px;\n z-index: 10; }\n .dg .c:hover .selector,\n .dg .selector.drag {\n display: block; }\n .dg li.save-row {\n padding: 0; }\n .dg li.save-row .button {\n display: inline-block;\n padding: 0px 6px; }\n .dg.dialogue {\n background-color: #222;\n width: 460px;\n padding: 15px;\n font-size: 13px;\n line-height: 15px; }\n\n/* TODO Separate style and structure */\n#dg-new-constructor {\n padding: 10px;\n color: #222;\n font-family: Monaco, monospace;\n font-size: 10px;\n border: 0;\n resize: none;\n box-shadow: inset 1px 1px 1px #888;\n word-wrap: break-word;\n margin: 12px 0;\n display: block;\n width: 440px;\n overflow-y: scroll;\n height: 100px;\n position: relative; }\n\n#dg-local-explain {\n display: none;\n font-size: 11px;\n line-height: 17px;\n border-radius: 3px;\n background-color: #333;\n padding: 8px;\n margin-top: 10px; }\n #dg-local-explain code {\n font-size: 10px; }\n\n#dat-gui-save-locally {\n display: none; }\n\n/** Main type */\n.dg {\n color: #eee;\n font: 11px 'Lucida Grande', sans-serif;\n text-shadow: 0 -1px 0 #111;\n /** Auto place */\n /* Controller row, <li> */\n /** Controllers */ }\n .dg.main {\n /** Scrollbar */ }\n .dg.main::-webkit-scrollbar {\n width: 5px;\n background: #1a1a1a; }\n .dg.main::-webkit-scrollbar-corner {\n height: 0;\n display: none; }\n .dg.main::-webkit-scrollbar-thumb {\n border-radius: 5px;\n background: #676767; }\n .dg li:not(.folder) {\n background: #1a1a1a;\n border-bottom: 1px solid #2c2c2c; }\n .dg li.save-row {\n line-height: 25px;\n background: #dad5cb;\n border: 0; }\n .dg li.save-row select {\n margin-left: 5px;\n width: 108px; }\n .dg li.save-row .button {\n margin-left: 5px;\n margin-top: 1px;\n border-radius: 2px;\n font-size: 9px;\n line-height: 7px;\n padding: 4px 4px 5px 4px;\n background: #c5bdad;\n color: #fff;\n text-shadow: 0 1px 0 #b0a58f;\n box-shadow: 0 -1px 0 #b0a58f;\n cursor: pointer; }\n .dg li.save-row .button.gears {\n background: #c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;\n height: 7px;\n width: 8px; }\n .dg li.save-row .button:hover {\n background-color: #bab19e;\n box-shadow: 0 -1px 0 #b0a58f; }\n .dg li.folder {\n border-bottom: 0; }\n .dg li.title {\n padding-left: 16px;\n background: black url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;\n cursor: pointer;\n border-bottom: 1px solid rgba(255, 255, 255, 0.2); }\n .dg .closed li.title {\n background-image: url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==); }\n .dg .cr.boolean {\n border-left: 3px solid #806787; }\n .dg .cr.function {\n border-left: 3px solid #e61d5f; }\n .dg .cr.number {\n border-left: 3px solid #2fa1d6; }\n .dg .cr.number input[type=text] {\n color: #2fa1d6; }\n .dg .cr.string {\n border-left: 3px solid #1ed36f; }\n .dg .cr.string input[type=text] {\n color: #1ed36f; }\n .dg .cr.function:hover, .dg .cr.boolean:hover {\n background: #111; }\n .dg .c input[type=text] {\n background: #303030;\n outline: none; }\n .dg .c input[type=text]:hover {\n background: #3c3c3c; }\n .dg .c input[type=text]:focus {\n background: #494949;\n color: #fff; }\n .dg .c .slider {\n background: #303030;\n cursor: ew-resize; }\n .dg .c .slider-fg {\n background: #2fa1d6; }\n .dg .c .slider:hover {\n background: #3c3c3c; }\n .dg .c .slider:hover .slider-fg {\n background: #44abda; }\n");
  10309. var b, w, T = "Default", x = function() {
  10310. try {
  10311. return "localStorage"in window && null !== window.localStorage
  10312. } catch (e) {
  10313. return !1
  10314. }
  10315. }(), S = !0, s = !1, M = [], R = function(t) {
  10316. var i = this;
  10317. this.domElement = document.createElement("div"),
  10318. this.__ul = document.createElement("ul"),
  10319. this.domElement.appendChild(this.__ul),
  10320. m.addClass(this.domElement, "dg"),
  10321. this.__folders = {},
  10322. this.__controllers = [],
  10323. this.__rememberedObjects = [],
  10324. this.__rememberedObjectIndecesToControllers = [],
  10325. this.__listening = [],
  10326. t = t || {},
  10327. t = v.defaults(t, {
  10328. autoPlace: !0,
  10329. width: R.DEFAULT_WIDTH
  10330. }),
  10331. t = v.defaults(t, {
  10332. resizable: t.autoPlace,
  10333. hideable: t.autoPlace
  10334. }),
  10335. v.isUndefined(t.load) ? t.load = {
  10336. preset: T
  10337. } : t.preset && (t.load.preset = t.preset),
  10338. v.isUndefined(t.parent) && t.hideable && M.push(this),
  10339. t.resizable = v.isUndefined(t.parent) && t.resizable,
  10340. t.autoPlace && v.isUndefined(t.scrollable) && (t.scrollable = !0);
  10341. var n, e, r = x && "true" === localStorage.getItem(I(0, "isLocal"));
  10342. if (Object.defineProperties(this, {
  10343. parent: {
  10344. get: function() {
  10345. return t.parent
  10346. }
  10347. },
  10348. scrollable: {
  10349. get: function() {
  10350. return t.scrollable
  10351. }
  10352. },
  10353. autoPlace: {
  10354. get: function() {
  10355. return t.autoPlace
  10356. }
  10357. },
  10358. preset: {
  10359. get: function() {
  10360. return i.parent ? i.getRoot().preset : t.load.preset
  10361. },
  10362. set: function(e) {
  10363. i.parent ? i.getRoot().preset = e : t.load.preset = e,
  10364. function(e) {
  10365. for (var t = 0; t < e.__preset_select.length; t++)
  10366. e.__preset_select[t].value == e.preset && (e.__preset_select.selectedIndex = t)
  10367. }(this),
  10368. i.revert()
  10369. }
  10370. },
  10371. width: {
  10372. get: function() {
  10373. return t.width
  10374. },
  10375. set: function(e) {
  10376. t.width = e,
  10377. l(i, e)
  10378. }
  10379. },
  10380. name: {
  10381. get: function() {
  10382. return t.name
  10383. },
  10384. set: function(e) {
  10385. t.name = e,
  10386. a && (a.innerHTML = t.name)
  10387. }
  10388. },
  10389. closed: {
  10390. get: function() {
  10391. return t.closed
  10392. },
  10393. set: function(e) {
  10394. t.closed = e,
  10395. t.closed ? m.addClass(i.__ul, R.CLASS_CLOSED) : m.removeClass(i.__ul, R.CLASS_CLOSED),
  10396. this.onResize(),
  10397. i.__closeButton && (i.__closeButton.innerHTML = e ? R.TEXT_OPEN : R.TEXT_CLOSED)
  10398. }
  10399. },
  10400. load: {
  10401. get: function() {
  10402. return t.load
  10403. }
  10404. },
  10405. useLocalStorage: {
  10406. get: function() {
  10407. return r
  10408. },
  10409. set: function(e) {
  10410. x && ((r = e) ? m.bind(window, "unload", n) : m.unbind(window, "unload", n),
  10411. localStorage.setItem(I(0, "isLocal"), e))
  10412. }
  10413. }
  10414. }),
  10415. v.isUndefined(t.parent)) {
  10416. if (t.closed = !1,
  10417. m.addClass(this.domElement, R.CLASS_MAIN),
  10418. m.makeSelectable(this.domElement, !1),
  10419. x && r) {
  10420. i.useLocalStorage = !0;
  10421. var o = localStorage.getItem(I(0, "gui"));
  10422. o && (t.load = JSON.parse(o))
  10423. }
  10424. this.__closeButton = document.createElement("div"),
  10425. this.__closeButton.innerHTML = R.TEXT_CLOSED,
  10426. m.addClass(this.__closeButton, R.CLASS_CLOSE_BUTTON),
  10427. this.domElement.appendChild(this.__closeButton),
  10428. m.bind(this.__closeButton, "click", function() {
  10429. i.closed = !i.closed
  10430. })
  10431. } else {
  10432. void 0 === t.closed && (t.closed = !0);
  10433. var a = document.createTextNode(t.name);
  10434. m.addClass(a, "controller-name");
  10435. var s = A(i, a);
  10436. m.addClass(this.__ul, R.CLASS_CLOSED),
  10437. m.addClass(s, "title"),
  10438. m.bind(s, "click", function(e) {
  10439. return e.preventDefault(),
  10440. i.closed = !i.closed,
  10441. !1
  10442. }),
  10443. t.closed || (this.closed = !1)
  10444. }
  10445. t.autoPlace && (v.isUndefined(t.parent) && (S && (w = document.createElement("div"),
  10446. m.addClass(w, "dg"),
  10447. m.addClass(w, R.CLASS_AUTO_PLACE_CONTAINER),
  10448. document.body.appendChild(w),
  10449. S = !1),
  10450. w.appendChild(this.domElement),
  10451. m.addClass(this.domElement, R.CLASS_AUTO_PLACE)),
  10452. this.parent || l(i, t.width)),
  10453. m.bind(window, "resize", function() {
  10454. i.onResize()
  10455. }),
  10456. m.bind(this.__ul, "webkitTransitionEnd", function() {
  10457. i.onResize()
  10458. }),
  10459. m.bind(this.__ul, "transitionend", function() {
  10460. i.onResize()
  10461. }),
  10462. m.bind(this.__ul, "oTransitionEnd", function() {
  10463. i.onResize()
  10464. }),
  10465. this.onResize(),
  10466. t.resizable && function(t) {
  10467. function e(e) {
  10468. return e.preventDefault(),
  10469. r = e.clientX,
  10470. m.addClass(t.__closeButton, R.CLASS_DRAG),
  10471. m.bind(window, "mousemove", i),
  10472. m.bind(window, "mouseup", n),
  10473. !1
  10474. }
  10475. function i(e) {
  10476. return e.preventDefault(),
  10477. t.width += r - e.clientX,
  10478. t.onResize(),
  10479. r = e.clientX,
  10480. !1
  10481. }
  10482. function n() {
  10483. m.removeClass(t.__closeButton, R.CLASS_DRAG),
  10484. m.unbind(window, "mousemove", i),
  10485. m.unbind(window, "mouseup", n)
  10486. }
  10487. var r;
  10488. t.__resize_handle = document.createElement("div"),
  10489. v.extend(t.__resize_handle.style, {
  10490. width: "6px",
  10491. marginLeft: "-3px",
  10492. height: "200px",
  10493. cursor: "ew-resize",
  10494. position: "absolute"
  10495. }),
  10496. m.bind(t.__resize_handle, "mousedown", e),
  10497. m.bind(t.__closeButton, "mousedown", e),
  10498. t.domElement.insertBefore(t.__resize_handle, t.domElement.firstElementChild)
  10499. }(this),
  10500. n = function() {
  10501. x && "true" === localStorage.getItem(I(0, "isLocal")) && localStorage.setItem(I(0, "gui"), JSON.stringify(i.getSaveObject()))
  10502. }
  10503. ,
  10504. this.saveToLocalStorageIfPossible = n,
  10505. i.getRoot(),
  10506. t.parent || ((e = i.getRoot()).width += 1,
  10507. v.defer(function() {
  10508. e.width -= 1
  10509. }))
  10510. };
  10511. return R.toggleHide = function() {
  10512. s = !s,
  10513. v.each(M, function(e) {
  10514. e.domElement.style.zIndex = s ? -999 : 999,
  10515. e.domElement.style.opacity = s ? 0 : 1
  10516. })
  10517. }
  10518. ,
  10519. R.CLASS_AUTO_PLACE = "a",
  10520. R.CLASS_AUTO_PLACE_CONTAINER = "ac",
  10521. R.CLASS_MAIN = "main",
  10522. R.CLASS_CONTROLLER_ROW = "cr",
  10523. R.CLASS_TOO_TALL = "taller-than-window",
  10524. R.CLASS_CLOSED = "closed",
  10525. R.CLASS_CLOSE_BUTTON = "close-button",
  10526. R.CLASS_DRAG = "drag",
  10527. R.DEFAULT_WIDTH = 245,
  10528. R.TEXT_CLOSED = "Close Controls",
  10529. R.TEXT_OPEN = "Open Controls",
  10530. m.bind(window, "keydown", function(e) {
  10531. "text" === document.activeElement.type || 72 !== e.which && 72 != e.keyCode || R.toggleHide()
  10532. }, !1),
  10533. v.extend(R.prototype, {
  10534. add: function(e, t) {
  10535. return y(this, e, t, {
  10536. factoryArgs: Array.prototype.slice.call(arguments, 2)
  10537. })
  10538. },
  10539. addColor: function(e, t) {
  10540. return y(this, e, t, {
  10541. color: !0
  10542. })
  10543. },
  10544. remove: function(e) {
  10545. this.__ul.removeChild(e.__li),
  10546. this.__controllers.slice(this.__controllers.indexOf(e), 1);
  10547. var t = this;
  10548. v.defer(function() {
  10549. t.onResize()
  10550. })
  10551. },
  10552. destroy: function() {
  10553. this.autoPlace && w.removeChild(this.domElement)
  10554. },
  10555. addFolder: function(e) {
  10556. if (void 0 !== this.__folders[e])
  10557. throw new Error('You already have a folder in this GUI by the name "' + e + '"');
  10558. var t = {
  10559. name: e,
  10560. parent: this
  10561. };
  10562. t.autoPlace = this.autoPlace,
  10563. this.load && this.load.folders && this.load.folders[e] && (t.closed = this.load.folders[e].closed,
  10564. t.load = this.load.folders[e]);
  10565. var i = new R(t);
  10566. this.__folders[e] = i;
  10567. var n = A(this, i.domElement);
  10568. return m.addClass(n, "folder"),
  10569. i
  10570. },
  10571. open: function() {
  10572. this.closed = !1
  10573. },
  10574. close: function() {
  10575. this.closed = !0
  10576. },
  10577. onResize: function() {
  10578. var t = this.getRoot();
  10579. if (t.scrollable) {
  10580. var e = m.getOffset(t.__ul).top
  10581. , i = 0;
  10582. v.each(t.__ul.childNodes, function(e) {
  10583. t.autoPlace && e === t.__save_row || (i += m.getHeight(e))
  10584. }),
  10585. $("#player").height() - e - 20 < i ? (m.addClass(t.domElement, R.CLASS_TOO_TALL),
  10586. t.__ul.style.height = $("#player").height() - e - 20 + "px") : (m.removeClass(t.domElement, R.CLASS_TOO_TALL),
  10587. t.__ul.style.height = "auto")
  10588. }
  10589. t.__resize_handle && v.defer(function() {
  10590. t.__resize_handle.style.height = t.__ul.offsetHeight + "px"
  10591. }),
  10592. t.__closeButton && (t.__closeButton.style.width = t.width + "px")
  10593. },
  10594. remember: function() {
  10595. if (v.isUndefined(b) && ((b = new o).domElement.innerHTML = '<div id="dg-save" class="dg dialogue">\n\n Here\'s the new load parameter for your <code>GUI</code>\'s constructor:\n\n <textarea id="dg-new-constructor"></textarea>\n\n <div id="dg-save-locally">\n\n <input id="dg-local-storage" type="checkbox"/> Automatically save\n values to <code>localStorage</code> on exit.\n\n <div id="dg-local-explain">The values saved to <code>localStorage</code> will\n override those passed to <code>dat.GUI</code>\'s constructor. This makes it\n easier to work incrementally, but <code>localStorage</code> is fragile,\n and your friends may not see the same values you do.\n \n </div>\n \n </div>\n\n</div>'),
  10596. this.parent)
  10597. throw new Error("You can only call remember on a top level GUI.");
  10598. var t = this;
  10599. v.each(Array.prototype.slice.call(arguments), function(e) {
  10600. 0 == t.__rememberedObjects.length && function(i) {
  10601. var e = i.__save_row = document.createElement("li");
  10602. m.addClass(i.domElement, "has-save"),
  10603. i.__ul.insertBefore(e, i.__ul.firstChild),
  10604. m.addClass(e, "save-row");
  10605. var t = document.createElement("span");
  10606. t.innerHTML = "&nbsp;",
  10607. m.addClass(t, "button gears");
  10608. var n = document.createElement("span");
  10609. n.innerHTML = "Save",
  10610. m.addClass(n, "button"),
  10611. m.addClass(n, "save");
  10612. var r = document.createElement("span");
  10613. r.innerHTML = "New",
  10614. m.addClass(r, "button"),
  10615. m.addClass(r, "save-as");
  10616. var o = document.createElement("span");
  10617. o.innerHTML = "Revert",
  10618. m.addClass(o, "button"),
  10619. m.addClass(o, "revert");
  10620. var a = i.__preset_select = document.createElement("select");
  10621. if (i.load && i.load.remembered ? v.each(i.load.remembered, function(e, t) {
  10622. E(i, t, t == i.preset)
  10623. }) : E(i, T, !1),
  10624. m.bind(a, "change", function() {
  10625. for (var e = 0; e < i.__preset_select.length; e++)
  10626. i.__preset_select[e].innerHTML = i.__preset_select[e].value;
  10627. i.preset = this.value
  10628. }),
  10629. e.appendChild(a),
  10630. e.appendChild(t),
  10631. e.appendChild(n),
  10632. e.appendChild(r),
  10633. e.appendChild(o),
  10634. x) {
  10635. var s = document.getElementById("dg-save-locally")
  10636. , l = document.getElementById("dg-local-explain");
  10637. s.style.display = "block";
  10638. var c = document.getElementById("dg-local-storage");
  10639. "true" === localStorage.getItem(I(0, "isLocal")) && c.setAttribute("checked", "checked");
  10640. var h = function() {
  10641. l.style.display = i.useLocalStorage ? "block" : "none"
  10642. };
  10643. h(),
  10644. m.bind(c, "change", function() {
  10645. i.useLocalStorage = !i.useLocalStorage,
  10646. h()
  10647. })
  10648. }
  10649. var u = document.getElementById("dg-new-constructor");
  10650. m.bind(u, "keydown", function(e) {
  10651. !e.metaKey || 67 !== e.which && 67 != e.keyCode || b.hide()
  10652. }),
  10653. m.bind(t, "click", function() {
  10654. u.innerHTML = JSON.stringify(i.getSaveObject(), void 0, 2),
  10655. b.show(),
  10656. u.focus(),
  10657. u.select()
  10658. }),
  10659. m.bind(n, "click", function() {
  10660. i.save()
  10661. }),
  10662. m.bind(r, "click", function() {
  10663. var e = prompt("Enter a new preset name.");
  10664. e && i.saveAs(e)
  10665. }),
  10666. m.bind(o, "click", function() {
  10667. i.revert()
  10668. })
  10669. }(t),
  10670. -1 == t.__rememberedObjects.indexOf(e) && t.__rememberedObjects.push(e)
  10671. }),
  10672. this.autoPlace && l(this, this.width)
  10673. },
  10674. getRoot: function() {
  10675. for (var e = this; e.parent; )
  10676. e = e.parent;
  10677. return e
  10678. },
  10679. getSaveObject: function() {
  10680. var i = this.load;
  10681. return i.closed = this.closed,
  10682. 0 < this.__rememberedObjects.length && (i.preset = this.preset,
  10683. i.remembered || (i.remembered = {}),
  10684. i.remembered[this.preset] = a(this)),
  10685. i.folders = {},
  10686. v.each(this.__folders, function(e, t) {
  10687. i.folders[t] = e.getSaveObject()
  10688. }),
  10689. i
  10690. },
  10691. save: function() {
  10692. this.load.remembered || (this.load.remembered = {}),
  10693. this.load.remembered[this.preset] = a(this),
  10694. _(this, !1),
  10695. this.saveToLocalStorageIfPossible()
  10696. },
  10697. saveAs: function(e) {
  10698. this.load.remembered || (this.load.remembered = {},
  10699. this.load.remembered[T] = a(this, !0)),
  10700. this.load.remembered[e] = a(this),
  10701. this.preset = e,
  10702. E(this, e, !0),
  10703. this.saveToLocalStorageIfPossible()
  10704. },
  10705. revert: function(t) {
  10706. v.each(this.__controllers, function(e) {
  10707. this.getRoot().load.remembered ? C(t || this.getRoot(), e) : e.setValue(e.initialValue)
  10708. }, this),
  10709. v.each(this.__folders, function(e) {
  10710. e.revert(e)
  10711. }),
  10712. t || _(this.getRoot(), !1)
  10713. },
  10714. listen: function(e) {
  10715. var t = 0 == this.__listening.length;
  10716. this.__listening.push(e),
  10717. t && function e(t) {
  10718. 0 != t.length && r(function() {
  10719. e(t)
  10720. }),
  10721. v.each(t, function(e) {
  10722. e.updateDisplay()
  10723. })
  10724. }(this.__listening)
  10725. }
  10726. }),
  10727. R
  10728. }(ee.utils.css, 0, 0, ee.controllers.factory = (h = ee.controllers.OptionController,
  10729. u = ee.controllers.NumberControllerBox,
  10730. d = ee.controllers.NumberControllerSlider,
  10731. p = ee.controllers.StringController = (v = ee.controllers.Controller,
  10732. y = ee.dom.dom,
  10733. A = ee.utils.common,
  10734. (C = function(e, t) {
  10735. function i() {
  10736. n.setValue(n.__input.value)
  10737. }
  10738. C.superclass.call(this, e, t);
  10739. var n = this;
  10740. this.__input = document.createElement("input"),
  10741. this.__input.setAttribute("type", "text"),
  10742. y.bind(this.__input, "keyup", i),
  10743. y.bind(this.__input, "change", i),
  10744. y.bind(this.__input, "blur", function() {
  10745. n.__onFinishChange && n.__onFinishChange.call(n, n.getValue())
  10746. }),
  10747. y.bind(this.__input, "keydown", function(e) {
  10748. 13 === e.keyCode && this.blur()
  10749. }),
  10750. this.updateDisplay(),
  10751. this.domElement.appendChild(this.__input)
  10752. }
  10753. ).superclass = v,
  10754. A.extend(C.prototype, v.prototype, {
  10755. updateDisplay: function() {
  10756. return y.isActive(this.__input) || (this.__input.value = this.getValue()),
  10757. C.superclass.prototype.updateDisplay.call(this)
  10758. }
  10759. }),
  10760. C),
  10761. f = ee.controllers.FunctionController,
  10762. g = ee.controllers.BooleanController,
  10763. m = ee.utils.common,
  10764. function(e, t) {
  10765. var i = e[t];
  10766. return m.isArray(arguments[2]) || m.isObject(arguments[2]) ? new h(e,t,arguments[2]) : m.isNumber(i) ? m.isNumber(arguments[2]) && m.isNumber(arguments[3]) ? new d(e,t,arguments[2],arguments[3]) : new u(e,t,{
  10767. min: arguments[2],
  10768. max: arguments[3]
  10769. }) : m.isString(i) ? new p(e,t) : m.isFunction(i) ? new f(e,t,"") : m.isBoolean(i) ? new g(e,t) : void 0
  10770. }
  10771. ), ee.controllers.Controller, ee.controllers.BooleanController, ee.controllers.FunctionController, ee.controllers.NumberControllerBox, ee.controllers.NumberControllerSlider, ee.controllers.OptionController, ee.controllers.ColorController = function(e, h, u, d, p) {
  10772. function f(t, i, n, r) {
  10773. t.style.background = "",
  10774. p.each(o, function(e) {
  10775. t.style.cssText += "background: " + e + "linear-gradient(" + i + ", " + n + " 0%, " + r + " 100%); "
  10776. })
  10777. }
  10778. var g = function(e, t) {
  10779. function i(e) {
  10780. a(e),
  10781. h.bind(window, "mousemove", a),
  10782. h.bind(window, "mouseup", n)
  10783. }
  10784. function n() {
  10785. h.unbind(window, "mousemove", a),
  10786. h.unbind(window, "mouseup", n)
  10787. }
  10788. function r() {
  10789. var e = d(this.value);
  10790. !1 !== e ? (l.__color.__state = e,
  10791. l.setValue(l.__color.toOriginal())) : this.value = l.__color.toString()
  10792. }
  10793. function o() {
  10794. h.unbind(window, "mousemove", s),
  10795. h.unbind(window, "mouseup", o)
  10796. }
  10797. function a(e) {
  10798. e.preventDefault();
  10799. var t = h.getWidth(l.__saturation_field)
  10800. , i = h.getOffset(l.__saturation_field)
  10801. , n = (e.clientX - i.left + document.body.scrollLeft) / t
  10802. , r = 1 - (e.clientY - i.top + document.body.scrollTop) / t;
  10803. return 1 < r ? r = 1 : r < 0 && (r = 0),
  10804. 1 < n ? n = 1 : n < 0 && (n = 0),
  10805. l.__color.v = r,
  10806. l.__color.s = n,
  10807. l.setValue(l.__color.toOriginal()),
  10808. !1
  10809. }
  10810. function s(e) {
  10811. e.preventDefault();
  10812. var t = h.getHeight(l.__hue_field)
  10813. , i = h.getOffset(l.__hue_field)
  10814. , n = 1 - (e.clientY - i.top + document.body.scrollTop) / t;
  10815. return 1 < n ? n = 1 : n < 0 && (n = 0),
  10816. l.__color.h = 360 * n,
  10817. l.setValue(l.__color.toOriginal()),
  10818. !1
  10819. }
  10820. g.superclass.call(this, e, t),
  10821. this.__color = new u(this.getValue()),
  10822. this.__temp = new u(0);
  10823. var l = this;
  10824. this.domElement = document.createElement("div"),
  10825. h.makeSelectable(this.domElement, !1),
  10826. this.__selector = document.createElement("div"),
  10827. this.__selector.className = "selector",
  10828. this.__saturation_field = document.createElement("div"),
  10829. this.__saturation_field.className = "saturation-field",
  10830. this.__field_knob = document.createElement("div"),
  10831. this.__field_knob.className = "field-knob",
  10832. this.__field_knob_border = "2px solid ",
  10833. this.__hue_knob = document.createElement("div"),
  10834. this.__hue_knob.className = "hue-knob",
  10835. this.__hue_field = document.createElement("div"),
  10836. this.__hue_field.className = "hue-field",
  10837. this.__input = document.createElement("input"),
  10838. this.__input.type = "text",
  10839. this.__input_textShadow = "0 1px 1px ",
  10840. h.bind(this.__input, "keydown", function(e) {
  10841. 13 === e.keyCode && r.call(this)
  10842. }),
  10843. h.bind(this.__input, "blur", r),
  10844. h.bind(this.__selector, "mousedown", function(e) {
  10845. h.addClass(this, "drag").bind(window, "mouseup", function(e) {
  10846. h.removeClass(l.__selector, "drag")
  10847. })
  10848. });
  10849. var c = document.createElement("div");
  10850. p.extend(this.__selector.style, {
  10851. width: "122px",
  10852. height: "102px",
  10853. padding: "3px",
  10854. backgroundColor: "#222",
  10855. boxShadow: "0px 1px 3px rgba(0,0,0,0.3)"
  10856. }),
  10857. p.extend(this.__field_knob.style, {
  10858. position: "absolute",
  10859. width: "12px",
  10860. height: "12px",
  10861. border: this.__field_knob_border + (this.__color.v < .5 ? "#fff" : "#000"),
  10862. boxShadow: "0px 1px 3px rgba(0,0,0,0.5)",
  10863. borderRadius: "12px",
  10864. zIndex: 1
  10865. }),
  10866. p.extend(this.__hue_knob.style, {
  10867. position: "absolute",
  10868. width: "15px",
  10869. height: "2px",
  10870. borderRight: "4px solid #fff",
  10871. zIndex: 1
  10872. }),
  10873. p.extend(this.__saturation_field.style, {
  10874. width: "100px",
  10875. height: "100px",
  10876. border: "1px solid #555",
  10877. marginRight: "3px",
  10878. display: "inline-block",
  10879. cursor: "pointer"
  10880. }),
  10881. p.extend(c.style, {
  10882. width: "100%",
  10883. height: "100%",
  10884. background: "none"
  10885. }),
  10886. f(c, "top", "rgba(0,0,0,0)", "#000"),
  10887. p.extend(this.__hue_field.style, {
  10888. width: "15px",
  10889. height: "100px",
  10890. display: "inline-block",
  10891. border: "1px solid #555",
  10892. cursor: "ns-resize"
  10893. }),
  10894. function(e) {
  10895. e.style.background = "",
  10896. e.style.cssText += "background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",
  10897. e.style.cssText += "background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  10898. e.style.cssText += "background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  10899. e.style.cssText += "background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  10900. e.style.cssText += "background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"
  10901. }(this.__hue_field),
  10902. p.extend(this.__input.style, {
  10903. outline: "none",
  10904. textAlign: "center",
  10905. color: "#fff",
  10906. border: 0,
  10907. fontWeight: "bold",
  10908. textShadow: this.__input_textShadow + "rgba(0,0,0,0.7)"
  10909. }),
  10910. h.bind(this.__saturation_field, "mousedown", i),
  10911. h.bind(this.__field_knob, "mousedown", i),
  10912. h.bind(this.__hue_field, "mousedown", function(e) {
  10913. s(e),
  10914. h.bind(window, "mousemove", s),
  10915. h.bind(window, "mouseup", o)
  10916. }),
  10917. this.__saturation_field.appendChild(c),
  10918. this.__selector.appendChild(this.__field_knob),
  10919. this.__selector.appendChild(this.__saturation_field),
  10920. this.__selector.appendChild(this.__hue_field),
  10921. this.__hue_field.appendChild(this.__hue_knob),
  10922. this.domElement.appendChild(this.__input),
  10923. this.domElement.appendChild(this.__selector),
  10924. this.updateDisplay()
  10925. };
  10926. g.superclass = e,
  10927. p.extend(g.prototype, e.prototype, {
  10928. updateDisplay: function() {
  10929. var t = d(this.getValue());
  10930. if (!1 !== t) {
  10931. var i = !1;
  10932. p.each(u.COMPONENTS, function(e) {
  10933. if (!p.isUndefined(t[e]) && !p.isUndefined(this.__color.__state[e]) && t[e] !== this.__color.__state[e])
  10934. return i = !0,
  10935. {}
  10936. }, this),
  10937. i && p.extend(this.__color.__state, t)
  10938. }
  10939. p.extend(this.__temp.__state, this.__color.__state),
  10940. this.__temp.a = 1;
  10941. var e = this.__color.v < .5 || .5 < this.__color.s ? 255 : 0
  10942. , n = 255 - e;
  10943. p.extend(this.__field_knob.style, {
  10944. marginLeft: 100 * this.__color.s - 7 + "px",
  10945. marginTop: 100 * (1 - this.__color.v) - 7 + "px",
  10946. backgroundColor: this.__temp.toString(),
  10947. border: this.__field_knob_border + "rgb(" + e + "," + e + "," + e + ")"
  10948. }),
  10949. this.__hue_knob.style.marginTop = 100 * (1 - this.__color.h / 360) + "px",
  10950. this.__temp.s = 1,
  10951. this.__temp.v = 1,
  10952. f(this.__saturation_field, "left", "#fff", this.__temp.toString()),
  10953. p.extend(this.__input.style, {
  10954. backgroundColor: this.__input.value = this.__color.toString(),
  10955. color: "rgb(" + e + "," + e + "," + e + ")",
  10956. textShadow: this.__input_textShadow + "rgba(" + n + "," + n + "," + n + ",.7)"
  10957. })
  10958. }
  10959. });
  10960. var o = ["-moz-", "-o-", "-webkit-", "-ms-", ""];
  10961. return g
  10962. }(ee.controllers.Controller, ee.dom.dom, ee.color.Color = (o = ee.color.interpret,
  10963. a = ee.color.math = {
  10964. hsv_to_rgb: function(e, t, i) {
  10965. var n = Math.floor(e / 60) % 6
  10966. , r = e / 60 - Math.floor(e / 60)
  10967. , o = i * (1 - t)
  10968. , a = i * (1 - r * t)
  10969. , s = i * (1 - (1 - r) * t)
  10970. , l = [[i, s, o], [a, i, o], [o, i, s], [o, a, i], [s, o, i], [i, o, a]][n];
  10971. return {
  10972. r: 255 * l[0],
  10973. g: 255 * l[1],
  10974. b: 255 * l[2]
  10975. }
  10976. },
  10977. rgb_to_hsv: function(e, t, i) {
  10978. var n, r = Math.min(e, t, i), o = Math.max(e, t, i), a = o - r;
  10979. return 0 == o ? {
  10980. h: NaN,
  10981. s: 0,
  10982. v: 0
  10983. } : (n = e == o ? (t - i) / a : t == o ? 2 + (i - e) / a : 4 + (e - t) / a,
  10984. (n /= 6) < 0 && (n += 1),
  10985. {
  10986. h: 360 * n,
  10987. s: a / o,
  10988. v: o / 255
  10989. })
  10990. },
  10991. rgb_to_hex: function(e, t, i) {
  10992. var n = this.hex_with_component(0, 2, e);
  10993. return n = this.hex_with_component(n, 1, t),
  10994. this.hex_with_component(n, 0, i)
  10995. },
  10996. component_from_hex: function(e, t) {
  10997. return e >> 8 * t & 255
  10998. },
  10999. hex_with_component: function(e, t, i) {
  11000. return i << (c = 8 * t) | e & ~(255 << c)
  11001. }
  11002. },
  11003. s = ee.color.toString,
  11004. l = ee.utils.common,
  11005. ae.COMPONENTS = ["r", "g", "b", "h", "s", "v", "hex", "a"],
  11006. l.extend(ae.prototype, {
  11007. toString: function() {
  11008. return s(this)
  11009. },
  11010. toOriginal: function() {
  11011. return this.__state.conversion.write(this)
  11012. }
  11013. }),
  11014. ie(ae.prototype, "r", 2),
  11015. ie(ae.prototype, "g", 1),
  11016. ie(ae.prototype, "b", 0),
  11017. ne(ae.prototype, "h"),
  11018. ne(ae.prototype, "s"),
  11019. ne(ae.prototype, "v"),
  11020. Object.defineProperty(ae.prototype, "a", {
  11021. get: function() {
  11022. return this.__state.a
  11023. },
  11024. set: function(e) {
  11025. this.__state.a = e
  11026. }
  11027. }),
  11028. Object.defineProperty(ae.prototype, "hex", {
  11029. get: function() {
  11030. return "HEX" !== !this.__state.space && (this.__state.hex = a.rgb_to_hex(this.r, this.g, this.b)),
  11031. this.__state.hex
  11032. },
  11033. set: function(e) {
  11034. this.__state.space = "HEX",
  11035. this.__state.hex = e
  11036. }
  11037. }),
  11038. ae), ee.color.interpret, ee.utils.common), ee.utils.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(e, t) {
  11039. window.setTimeout(e, 1e3 / 60)
  11040. }
  11041. , ee.dom.CenteredDiv = (n = ee.dom.dom,
  11042. r = ee.utils.common,
  11043. te.prototype.show = function() {
  11044. var e = this;
  11045. this.backgroundElement.style.display = "block",
  11046. this.domElement.style.display = "block",
  11047. this.domElement.style.opacity = 0,
  11048. this.domElement.style.webkitTransform = "scale(1.1)",
  11049. this.layout(),
  11050. r.defer(function() {
  11051. e.backgroundElement.style.opacity = 1,
  11052. e.domElement.style.opacity = 1,
  11053. e.domElement.style.webkitTransform = "scale(1)"
  11054. })
  11055. }
  11056. ,
  11057. te.prototype.hide = function() {
  11058. var e = this
  11059. , t = function() {
  11060. e.domElement.style.display = "none",
  11061. e.backgroundElement.style.display = "none",
  11062. n.unbind(e.domElement, "webkitTransitionEnd", t),
  11063. n.unbind(e.domElement, "transitionend", t),
  11064. n.unbind(e.domElement, "oTransitionEnd", t)
  11065. };
  11066. n.bind(this.domElement, "webkitTransitionEnd", t),
  11067. n.bind(this.domElement, "transitionend", t),
  11068. n.bind(this.domElement, "oTransitionEnd", t),
  11069. this.backgroundElement.style.opacity = 0,
  11070. this.domElement.style.opacity = 0,
  11071. this.domElement.style.webkitTransform = "scale(1.1)"
  11072. }
  11073. ,
  11074. te.prototype.layout = function() {
  11075. this.domElement.style.left = $("#player").width() / 2 - n.getWidth(this.domElement) / 2 + "px",
  11076. this.domElement.style.top = $("#player").height() / 2 - n.getHeight(this.domElement) / 2 + "px"
  11077. }
  11078. ,
  11079. te), ee.dom.dom, ee.utils.common)
  11080. }
  11081. , {}],
  11082. 94: [function(e, t, i) {
  11083. (function(J) {
  11084. "use strict";
  11085. function i(e) {
  11086. function t(e, t) {
  11087. for (var i = 0, n = 0, r = new Array, o = 1; o <= 16; o++) {
  11088. for (var a = 1; a <= e[o]; a++)
  11089. r[t[n]] = [],
  11090. r[t[n]][0] = i,
  11091. r[t[n]][1] = o,
  11092. n++,
  11093. i++;
  11094. i *= 2
  11095. }
  11096. return r
  11097. }
  11098. function _(e) {
  11099. for (var t = e[0], i = e[1] - 1; 0 <= i; )
  11100. t & 1 << i && (B |= 1 << V),
  11101. i--,
  11102. --V < 0 && (255 == B ? (b(255),
  11103. b(0)) : b(B),
  11104. V = 7,
  11105. B = 0)
  11106. }
  11107. function b(e) {
  11108. F.push(e)
  11109. }
  11110. function w(e) {
  11111. b(e >> 8 & 255),
  11112. b(255 & e)
  11113. }
  11114. function T(e, t, i, n, r) {
  11115. for (var o, a = r[0], s = r[240], l = function(e, t) {
  11116. var i, n, r, o, a, s, l, c, h, u, d = 0;
  11117. for (h = 0; h < 8; ++h) {
  11118. i = e[d],
  11119. n = e[d + 1],
  11120. r = e[d + 2],
  11121. o = e[d + 3],
  11122. a = e[d + 4],
  11123. s = e[d + 5],
  11124. l = e[d + 6];
  11125. var p = i + (c = e[d + 7])
  11126. , f = i - c
  11127. , g = n + l
  11128. , m = n - l
  11129. , v = r + s
  11130. , y = r - s
  11131. , A = o + a
  11132. , C = o - a
  11133. , I = p + A
  11134. , E = p - A
  11135. , _ = g + v
  11136. , b = g - v;
  11137. e[d] = I + _,
  11138. e[d + 4] = I - _;
  11139. var w = .707106781 * (b + E);
  11140. e[d + 2] = E + w,
  11141. e[d + 6] = E - w;
  11142. var T = .382683433 * ((I = C + y) - (b = m + f))
  11143. , x = .5411961 * I + T
  11144. , S = 1.306562965 * b + T
  11145. , M = .707106781 * (_ = y + m)
  11146. , R = f + M
  11147. , P = f - M;
  11148. e[d + 5] = P + x,
  11149. e[d + 3] = P - x,
  11150. e[d + 1] = R + S,
  11151. e[d + 7] = R - S,
  11152. d += 8
  11153. }
  11154. for (h = d = 0; h < 8; ++h) {
  11155. i = e[d],
  11156. n = e[d + 8],
  11157. r = e[d + 16],
  11158. o = e[d + 24],
  11159. a = e[d + 32],
  11160. s = e[d + 40],
  11161. l = e[d + 48];
  11162. var O = i + (c = e[d + 56])
  11163. , L = i - c
  11164. , D = n + l
  11165. , N = n - l
  11166. , F = r + s
  11167. , B = r - s
  11168. , V = o + a
  11169. , k = o - a
  11170. , U = O + V
  11171. , H = O - V
  11172. , z = D + F
  11173. , G = D - F;
  11174. e[d] = U + z,
  11175. e[d + 32] = U - z;
  11176. var W = .707106781 * (G + H);
  11177. e[d + 16] = H + W,
  11178. e[d + 48] = H - W;
  11179. var j = .382683433 * ((U = k + B) - (G = N + L))
  11180. , Y = .5411961 * U + j
  11181. , q = 1.306562965 * G + j
  11182. , X = .707106781 * (z = B + N)
  11183. , Z = L + X
  11184. , K = L - X;
  11185. e[d + 40] = K + Y,
  11186. e[d + 24] = K - Y,
  11187. e[d + 8] = Z + q,
  11188. e[d + 56] = Z - q,
  11189. d++
  11190. }
  11191. for (h = 0; h < 64; ++h)
  11192. u = e[h] * t[h],
  11193. Q[h] = 0 < u ? .5 + u | 0 : u - .5 | 0;
  11194. return Q
  11195. }(e, t), c = 0; c < 64; ++c)
  11196. A[C[c]] = l[c];
  11197. var h = A[0] - i;
  11198. i = A[0],
  11199. 0 == h ? _(n[0]) : (_(n[y[o = 32767 + h]]),
  11200. _(v[o]));
  11201. for (var u = 63; 0 < u && 0 == A[u]; u--)
  11202. ;
  11203. if (0 == u)
  11204. return _(a),
  11205. i;
  11206. for (var d, p = 1; p <= u; ) {
  11207. for (var f = p; 0 == A[p] && p <= u; ++p)
  11208. ;
  11209. var g = p - f;
  11210. if (16 <= g) {
  11211. d = g >> 4;
  11212. for (var m = 1; m <= d; ++m)
  11213. _(s);
  11214. g &= 15
  11215. }
  11216. o = 32767 + A[p],
  11217. _(r[(g << 4) + y[o]]),
  11218. _(v[o]),
  11219. p++
  11220. }
  11221. return 63 != u && _(a),
  11222. i
  11223. }
  11224. function x(e) {
  11225. if (e <= 0 && (e = 1),
  11226. 100 < e && (e = 100),
  11227. i != e) {
  11228. (function(e) {
  11229. 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++) {
  11230. var n = u((t[i] * e + 50) / 100);
  11231. n < 1 ? n = 1 : 255 < n && (n = 255),
  11232. O[C[i]] = n
  11233. }
  11234. 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++) {
  11235. var a = u((r[o] * e + 50) / 100);
  11236. a < 1 ? a = 1 : 255 < a && (a = 255),
  11237. L[C[o]] = a
  11238. }
  11239. for (var s = [1, 1.387039845, 1.306562965, 1.175875602, 1, .785694958, .5411961, .275899379], l = 0, c = 0; c < 8; c++)
  11240. for (var h = 0; h < 8; h++)
  11241. D[l] = 1 / (O[C[l]] * s[c] * s[h] * 8),
  11242. N[l] = 1 / (L[C[l]] * s[c] * s[h] * 8),
  11243. l++
  11244. }
  11245. )(e < 50 ? Math.floor(5e3 / e) : Math.floor(200 - 2 * e)),
  11246. i = e
  11247. }
  11248. }
  11249. var S, M, R, P, i, u = (Math.round,
  11250. Math.floor), O = new Array(64), L = new Array(64), D = new Array(64), N = new Array(64), v = new Array(65535), y = new Array(65535), Q = new Array(64), A = new Array(64), F = [], B = 0, V = 7, k = new Array(64), U = new Array(64), H = new Array(64), n = new Array(256), z = new Array(2048), C = [0, 1, 5, 6, 14, 15, 27, 28, 2, 4, 7, 13, 16, 26, 29, 42, 3, 8, 12, 17, 25, 30, 41, 43, 9, 11, 18, 24, 31, 40, 44, 53, 10, 19, 23, 32, 39, 45, 52, 54, 20, 22, 33, 38, 46, 51, 55, 60, 21, 34, 37, 47, 50, 56, 59, 61, 35, 36, 48, 49, 57, 58, 62, 63], G = [0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0], W = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], j = [0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 125], Y = [1, 2, 3, 0, 4, 17, 5, 18, 33, 49, 65, 6, 19, 81, 97, 7, 34, 113, 20, 50, 129, 145, 161, 8, 35, 66, 177, 193, 21, 82, 209, 240, 36, 51, 98, 114, 130, 9, 10, 22, 23, 24, 25, 26, 37, 38, 39, 40, 41, 42, 52, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115, 116, 117, 118, 119, 120, 121, 122, 131, 132, 133, 134, 135, 136, 137, 138, 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178, 179, 180, 181, 182, 183, 184, 185, 186, 194, 195, 196, 197, 198, 199, 200, 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250], q = [0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0], X = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], Z = [0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 119], K = [0, 1, 2, 3, 17, 4, 5, 33, 49, 6, 18, 65, 81, 7, 97, 113, 19, 34, 50, 129, 8, 20, 66, 145, 161, 177, 193, 9, 35, 51, 82, 240, 21, 98, 114, 209, 10, 22, 36, 52, 225, 37, 241, 23, 24, 25, 26, 38, 39, 40, 41, 42, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115, 116, 117, 118, 119, 120, 121, 122, 130, 131, 132, 133, 134, 135, 136, 137, 138, 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178, 179, 180, 181, 182, 183, 184, 185, 186, 194, 195, 196, 197, 198, 199, 200, 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 226, 227, 228, 229, 230, 231, 232, 233, 234, 242, 243, 244, 245, 246, 247, 248, 249, 250];
  11251. this.encode = function(e, t) {
  11252. var i = ((new Date).getTime(),
  11253. t.quality);
  11254. i && x(i),
  11255. F = new Array,
  11256. B = 0,
  11257. V = 7,
  11258. w(65496),
  11259. w(65504),
  11260. w(16),
  11261. b(74),
  11262. b(70),
  11263. b(73),
  11264. b(70),
  11265. b(0),
  11266. b(1),
  11267. b(1),
  11268. b(0),
  11269. w(1),
  11270. w(1),
  11271. b(0),
  11272. b(0),
  11273. function() {
  11274. w(65499),
  11275. w(132),
  11276. b(0);
  11277. for (var e = 0; e < 64; e++)
  11278. b(O[e]);
  11279. b(1);
  11280. for (var t = 0; t < 64; t++)
  11281. b(L[t])
  11282. }(),
  11283. function(e, t) {
  11284. w(65472),
  11285. w(17),
  11286. b(8),
  11287. w(t),
  11288. w(e),
  11289. b(3),
  11290. b(1),
  11291. b(17),
  11292. b(0),
  11293. b(2),
  11294. b(17),
  11295. b(1),
  11296. b(3),
  11297. b(17),
  11298. b(1)
  11299. }(e.width, e.height),
  11300. function() {
  11301. w(65476),
  11302. w(418),
  11303. b(0);
  11304. for (var e = 0; e < 16; e++)
  11305. b(G[e + 1]);
  11306. for (var t = 0; t <= 11; t++)
  11307. b(W[t]);
  11308. b(16);
  11309. for (var i = 0; i < 16; i++)
  11310. b(j[i + 1]);
  11311. for (var n = 0; n <= 161; n++)
  11312. b(Y[n]);
  11313. b(1);
  11314. for (var r = 0; r < 16; r++)
  11315. b(q[r + 1]);
  11316. for (var o = 0; o <= 11; o++)
  11317. b(X[o]);
  11318. b(17);
  11319. for (var a = 0; a < 16; a++)
  11320. b(Z[a + 1]);
  11321. for (var s = 0; s <= 161; s++)
  11322. b(K[s])
  11323. }(),
  11324. w(65498),
  11325. w(12),
  11326. b(3),
  11327. b(1),
  11328. b(0),
  11329. b(2),
  11330. b(17),
  11331. b(3),
  11332. b(17),
  11333. b(0),
  11334. b(63),
  11335. b(0);
  11336. var n = 0
  11337. , r = 0
  11338. , o = 0;
  11339. B = 0,
  11340. V = 7,
  11341. this.encode.displayName = "_encode_";
  11342. for (var a, s, l, c, h, u, d, p, f, g = e.data, m = e.width, v = e.height, y = t.flipY, A = 4 * m, C = y ? v : 0, I = y ? -8 : 8; y && 0 < C || !y && C < v; ) {
  11343. for (a = 0; a < A; ) {
  11344. for (u = h = A * C + a,
  11345. d = -1,
  11346. f = p = 0; f < 64; f++)
  11347. u = h + (p = (y ? 63 - f : f) >> 3) * A + (d = 4 * (7 & f)),
  11348. v <= C + p && (u -= A * (C + 1 + p - v)),
  11349. A <= a + d && (u -= a + d - A + 4),
  11350. s = g[u++],
  11351. l = g[u++],
  11352. c = g[u++],
  11353. k[f] = (z[s] + z[l + 256 >> 0] + z[c + 512 >> 0] >> 16) - 128,
  11354. U[f] = (z[s + 768 >> 0] + z[l + 1024 >> 0] + z[c + 1280 >> 0] >> 16) - 128,
  11355. H[f] = (z[s + 1280 >> 0] + z[l + 1536 >> 0] + z[c + 1792 >> 0] >> 16) - 128;
  11356. n = T(k, D, n, S, R),
  11357. r = T(U, N, r, M, P),
  11358. o = T(H, N, o, M, P),
  11359. a += 32
  11360. }
  11361. C += I
  11362. }
  11363. if (0 <= V) {
  11364. var E = [];
  11365. E[1] = V + 1,
  11366. E[0] = (1 << V + 1) - 1,
  11367. _(E)
  11368. }
  11369. return w(65497),
  11370. new J(F)
  11371. }
  11372. ,
  11373. (new Date).getTime(),
  11374. e = e || 50,
  11375. function() {
  11376. for (var e = String.fromCharCode, t = 0; t < 256; t++)
  11377. n[t] = e(t)
  11378. }(),
  11379. S = t(G, W),
  11380. M = t(q, X),
  11381. R = t(j, Y),
  11382. P = t(Z, K),
  11383. function() {
  11384. for (var e = 1, t = 2, i = 1; i <= 15; i++) {
  11385. for (var n = e; n < t; n++)
  11386. y[32767 + n] = i,
  11387. v[32767 + n] = [],
  11388. v[32767 + n][1] = i,
  11389. v[32767 + n][0] = n;
  11390. for (var r = -(t - 1); r <= -e; r++)
  11391. y[32767 + r] = i,
  11392. v[32767 + r] = [],
  11393. v[32767 + r][1] = i,
  11394. v[32767 + r][0] = t - 1 + r;
  11395. e <<= 1,
  11396. t <<= 1
  11397. }
  11398. }(),
  11399. function() {
  11400. for (var e = 0; e < 256; e++)
  11401. z[e] = 19595 * e,
  11402. z[e + 256 >> 0] = 38470 * e,
  11403. z[e + 512 >> 0] = 7471 * e + 32768,
  11404. z[e + 768 >> 0] = -11059 * e,
  11405. z[e + 1024 >> 0] = -21709 * e,
  11406. z[e + 1280 >> 0] = 32768 * e + 8421375,
  11407. z[e + 1536 >> 0] = -27439 * e,
  11408. z[e + 1792 >> 0] = -5329 * e
  11409. }(),
  11410. x(e),
  11411. (new Date).getTime()
  11412. }
  11413. t.exports.encode = function(e, t) {
  11414. return (t = t || {}).quality = t.quality || 50,
  11415. {
  11416. data: new i(t.quality).encode(e, t),
  11417. width: e.width,
  11418. height: e.height
  11419. }
  11420. }
  11421. }
  11422. ).call(this, e("buffer").Buffer)
  11423. }
  11424. , {
  11425. buffer: 198
  11426. }],
  11427. 95: [function(e, t, i) {
  11428. "use strict";
  11429. !function() {
  11430. if ("performance"in window == 0 && (window.performance = {}),
  11431. Date.now = Date.now || function() {
  11432. return (new Date).getTime()
  11433. }
  11434. ,
  11435. "now"in window.performance == 0) {
  11436. var e = Date.now();
  11437. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  11438. window.performance.now = function() {
  11439. return Date.now() - e
  11440. }
  11441. }
  11442. }()
  11443. }
  11444. , {}],
  11445. 96: [function(e, t, i) {
  11446. "use strict";
  11447. var a = e("three");
  11448. a.EffectComposer = function(e, t) {
  11449. if (this.renderer = e,
  11450. void 0 === t) {
  11451. var i = {
  11452. minFilter: a.LinearFilter,
  11453. magFilter: a.LinearFilter,
  11454. format: a.RGBAFormat,
  11455. stencilBuffer: !1
  11456. }
  11457. , n = e.getSize();
  11458. t = new a.WebGLRenderTarget(n.width,n.height,i)
  11459. }
  11460. this.renderTarget1 = t,
  11461. this.renderTarget2 = t.clone(),
  11462. this.writeBuffer = this.renderTarget1,
  11463. this.readBuffer = this.renderTarget2,
  11464. this.passes = [],
  11465. void 0 === a.CopyShader && console.error("THREE.EffectComposer relies on THREE.CopyShader"),
  11466. this.copyPass = new a.ShaderPass(a.CopyShader)
  11467. }
  11468. ,
  11469. a.EffectComposer.prototype = {
  11470. swapBuffers: function() {
  11471. var e = this.readBuffer;
  11472. this.readBuffer = this.writeBuffer,
  11473. this.writeBuffer = e
  11474. },
  11475. addPass: function(e) {
  11476. this.passes.push(e)
  11477. },
  11478. insertPass: function(e, t) {
  11479. this.passes.splice(t, 0, e)
  11480. },
  11481. render: function(e) {
  11482. this.writeBuffer = this.renderTarget1,
  11483. this.readBuffer = this.renderTarget2;
  11484. var t, i, n = !1, r = this.passes.length;
  11485. for (i = 0; i < r; i++)
  11486. if ((t = this.passes[i]).enabled) {
  11487. if (t.render(this.renderer, this.writeBuffer, this.readBuffer, e, n),
  11488. t.needsSwap) {
  11489. if (n) {
  11490. var o = this.renderer.context;
  11491. o.stencilFunc(o.NOTEQUAL, 1, 4294967295),
  11492. this.copyPass.render(this.renderer, this.writeBuffer, this.readBuffer, e),
  11493. o.stencilFunc(o.EQUAL, 1, 4294967295)
  11494. }
  11495. this.swapBuffers()
  11496. }
  11497. t instanceof a.MaskPass ? n = !0 : t instanceof a.ClearMaskPass && (n = !1)
  11498. }
  11499. },
  11500. reset: function(e) {
  11501. if (void 0 === e) {
  11502. var t = this.renderer.getSize();
  11503. (e = this.renderTarget1.clone()).setSize(t.width, t.height)
  11504. }
  11505. this.renderTarget1.dispose(),
  11506. this.renderTarget2.dispose(),
  11507. this.renderTarget1 = e,
  11508. this.renderTarget2 = e.clone(),
  11509. this.writeBuffer = this.renderTarget1,
  11510. this.readBuffer = this.renderTarget2
  11511. },
  11512. setSize: function(e, t) {
  11513. this.renderTarget1.setSize(e, t),
  11514. this.renderTarget2.setSize(e, t)
  11515. }
  11516. }
  11517. }
  11518. , {
  11519. three: 217
  11520. }],
  11521. 97: [function(e, t, i) {
  11522. "use strict";
  11523. var n = e("three");
  11524. n.MaskPass = function(e, t) {
  11525. this.scene = e,
  11526. this.camera = t,
  11527. this.enabled = !0,
  11528. this.clear = !0,
  11529. this.needsSwap = !1,
  11530. this.inverse = !1
  11531. }
  11532. ,
  11533. n.MaskPass.prototype = {
  11534. render: function(e, t, i, n) {
  11535. var r, o, a = e.context;
  11536. a.colorMask(!1, !1, !1, !1),
  11537. a.depthMask(!1),
  11538. o = this.inverse ? (r = 0,
  11539. 1) : (r = 1,
  11540. 0),
  11541. a.enable(a.STENCIL_TEST),
  11542. a.stencilOp(a.REPLACE, a.REPLACE, a.REPLACE),
  11543. a.stencilFunc(a.ALWAYS, r, 4294967295),
  11544. a.clearStencil(o),
  11545. e.render(this.scene, this.camera, i, this.clear),
  11546. e.render(this.scene, this.camera, t, this.clear),
  11547. a.colorMask(!0, !0, !0, !0),
  11548. a.depthMask(!0),
  11549. a.stencilFunc(a.EQUAL, 1, 4294967295),
  11550. a.stencilOp(a.KEEP, a.KEEP, a.KEEP)
  11551. }
  11552. },
  11553. n.ClearMaskPass = function() {
  11554. this.enabled = !0
  11555. }
  11556. ,
  11557. n.ClearMaskPass.prototype = {
  11558. render: function(e, t, i, n) {
  11559. var r = e.context;
  11560. r.disable(r.STENCIL_TEST)
  11561. }
  11562. }
  11563. }
  11564. , {
  11565. three: 217
  11566. }],
  11567. 98: [function(e, t, i) {
  11568. "use strict";
  11569. var o = e("three");
  11570. o.RenderPass = function(e, t, i, n, r) {
  11571. this.scene = e,
  11572. this.camera = t,
  11573. this.overrideMaterial = i,
  11574. this.clearColor = n,
  11575. this.clearAlpha = void 0 !== r ? r : 1,
  11576. this.oldClearColor = new o.Color,
  11577. this.oldClearAlpha = 1,
  11578. this.enabled = !0,
  11579. this.clear = !0,
  11580. this.needsSwap = !1
  11581. }
  11582. ,
  11583. o.RenderPass.prototype = {
  11584. render: function(e, t, i, n) {
  11585. this.scene.overrideMaterial = this.overrideMaterial,
  11586. this.clearColor && (this.oldClearColor.copy(e.getClearColor()),
  11587. this.oldClearAlpha = e.getClearAlpha(),
  11588. e.setClearColor(this.clearColor, this.clearAlpha)),
  11589. e.render(this.scene, this.camera, i, this.clear),
  11590. this.clearColor && e.setClearColor(this.oldClearColor, this.oldClearAlpha),
  11591. this.scene.overrideMaterial = null
  11592. }
  11593. }
  11594. }
  11595. , {
  11596. three: 217
  11597. }],
  11598. 99: [function(e, t, i) {
  11599. "use strict";
  11600. var n = e("three");
  11601. n.ShaderPass = function(e, t) {
  11602. this.textureID = void 0 !== t ? t : "tDiffuse",
  11603. e instanceof n.ShaderMaterial ? (this.uniforms = e.uniforms,
  11604. this.material = e) : e && (this.uniforms = n.UniformsUtils.clone(e.uniforms),
  11605. this.material = new n.ShaderMaterial({
  11606. defines: e.defines || {},
  11607. uniforms: this.uniforms,
  11608. vertexShader: e.vertexShader,
  11609. fragmentShader: e.fragmentShader
  11610. })),
  11611. this.renderToScreen = !1,
  11612. this.enabled = !0,
  11613. this.needsSwap = !0,
  11614. this.clear = !1,
  11615. this.camera = new n.OrthographicCamera(-1,1,1,-1,0,1),
  11616. this.scene = new n.Scene,
  11617. this.quad = new n.Mesh(new n.PlaneBufferGeometry(2,2),null),
  11618. this.scene.add(this.quad)
  11619. }
  11620. ,
  11621. n.ShaderPass.prototype = {
  11622. render: function(e, t, i, n) {
  11623. this.uniforms[this.textureID] && (this.uniforms[this.textureID].value = i),
  11624. this.quad.material = this.material,
  11625. this.renderToScreen ? e.render(this.scene, this.camera) : e.render(this.scene, this.camera, t, this.clear)
  11626. }
  11627. }
  11628. }
  11629. , {
  11630. three: 217
  11631. }],
  11632. 100: [function(e, t, i) {
  11633. "use strict";
  11634. e("three").CopyShader = {
  11635. uniforms: {
  11636. tDiffuse: {
  11637. type: "t",
  11638. value: null
  11639. },
  11640. opacity: {
  11641. type: "f",
  11642. value: 1
  11643. }
  11644. },
  11645. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11646. fragmentShader: ["uniform float opacity;", "uniform sampler2D tDiffuse;", "varying vec2 vUv;", "void main() {", "vec4 texel = texture2D( tDiffuse, vUv );", "gl_FragColor = opacity * texel;", "}"].join("\n")
  11647. }
  11648. }
  11649. , {
  11650. three: 217
  11651. }],
  11652. 101: [function(e, t, i) {
  11653. "use strict";
  11654. e("three").HorizontalBlurShader = {
  11655. uniforms: {
  11656. tDiffuse: {
  11657. type: "t",
  11658. value: null
  11659. },
  11660. h: {
  11661. type: "f",
  11662. value: 1 / 512
  11663. }
  11664. },
  11665. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11666. 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")
  11667. }
  11668. }
  11669. , {
  11670. three: 217
  11671. }],
  11672. 102: [function(e, t, i) {
  11673. "use strict";
  11674. e("three").VerticalBlurShader = {
  11675. uniforms: {
  11676. tDiffuse: {
  11677. type: "t",
  11678. value: null
  11679. },
  11680. v: {
  11681. type: "f",
  11682. value: 1 / 512
  11683. }
  11684. },
  11685. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11686. 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")
  11687. }
  11688. }
  11689. , {
  11690. three: 217
  11691. }],
  11692. 103: [function(e, t, i) {
  11693. "use strict";
  11694. var z = e("three");
  11695. !function() {
  11696. if ("performance"in window == 0 && (window.performance = {}),
  11697. "now"in window.performance == 0) {
  11698. var e = Date.now();
  11699. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  11700. window.performance.now = function() {
  11701. return Date.now() - e
  11702. }
  11703. }
  11704. }(),
  11705. z.WebGLRenderer.prototype.paramThreeToGL = function(e) {
  11706. var t, i = this.extensions, n = this.context;
  11707. if (e === z.RepeatWrapping)
  11708. return n.REPEAT;
  11709. if (e === z.ClampToEdgeWrapping)
  11710. return n.CLAMP_TO_EDGE;
  11711. if (e === z.MirroredRepeatWrapping)
  11712. return n.MIRRORED_REPEAT;
  11713. if (e === z.NearestFilter)
  11714. return n.NEAREST;
  11715. if (e === z.NearestMipMapNearestFilter)
  11716. return n.NEAREST_MIPMAP_NEAREST;
  11717. if (e === z.NearestMipMapLinearFilter)
  11718. return n.NEAREST_MIPMAP_LINEAR;
  11719. if (e === z.LinearFilter)
  11720. return n.LINEAR;
  11721. if (e === z.LinearMipMapNearestFilter)
  11722. return n.LINEAR_MIPMAP_NEAREST;
  11723. if (e === z.LinearMipMapLinearFilter)
  11724. return n.LINEAR_MIPMAP_LINEAR;
  11725. if (e === z.UnsignedByteType)
  11726. return n.UNSIGNED_BYTE;
  11727. if (e === z.UnsignedShort4444Type)
  11728. return n.UNSIGNED_SHORT_4_4_4_4;
  11729. if (e === z.UnsignedShort5551Type)
  11730. return n.UNSIGNED_SHORT_5_5_5_1;
  11731. if (e === z.UnsignedShort565Type)
  11732. return n.UNSIGNED_SHORT_5_6_5;
  11733. if (e === z.ByteType)
  11734. return n.BYTE;
  11735. if (e === z.ShortType)
  11736. return n.SHORT;
  11737. if (e === z.UnsignedShortType)
  11738. return n.UNSIGNED_SHORT;
  11739. if (e === z.IntType)
  11740. return n.INT;
  11741. if (e === z.UnsignedIntType)
  11742. return n.UNSIGNED_INT;
  11743. if (e === z.FloatType)
  11744. return n.FLOAT;
  11745. if (null !== (t = i.get("OES_texture_half_float")) && e === z.HalfFloatType)
  11746. return t.HALF_FLOAT_OES;
  11747. if (e === z.AlphaFormat)
  11748. return n.ALPHA;
  11749. if (e === z.RGBFormat)
  11750. return n.RGB;
  11751. if (e === z.RGBAFormat)
  11752. return n.RGBA;
  11753. if (e === z.LuminanceFormat)
  11754. return n.LUMINANCE;
  11755. if (e === z.LuminanceAlphaFormat)
  11756. return n.LUMINANCE_ALPHA;
  11757. if (e === z.AddEquation)
  11758. return n.FUNC_ADD;
  11759. if (e === z.SubtractEquation)
  11760. return n.FUNC_SUBTRACT;
  11761. if (e === z.ReverseSubtractEquation)
  11762. return n.FUNC_REVERSE_SUBTRACT;
  11763. if (e === z.ZeroFactor)
  11764. return n.ZERO;
  11765. if (e === z.OneFactor)
  11766. return n.ONE;
  11767. if (e === z.SrcColorFactor)
  11768. return n.SRC_COLOR;
  11769. if (e === z.OneMinusSrcColorFactor)
  11770. return n.ONE_MINUS_SRC_COLOR;
  11771. if (e === z.SrcAlphaFactor)
  11772. return n.SRC_ALPHA;
  11773. if (e === z.OneMinusSrcAlphaFactor)
  11774. return n.ONE_MINUS_SRC_ALPHA;
  11775. if (e === z.DstAlphaFactor)
  11776. return n.DST_ALPHA;
  11777. if (e === z.OneMinusDstAlphaFactor)
  11778. return n.ONE_MINUS_DST_ALPHA;
  11779. if (e === z.DstColorFactor)
  11780. return n.DST_COLOR;
  11781. if (e === z.OneMinusDstColorFactor)
  11782. return n.ONE_MINUS_DST_COLOR;
  11783. if (e === z.SrcAlphaSaturateFactor)
  11784. return n.SRC_ALPHA_SATURATE;
  11785. if (null !== (t = i.get("WEBGL_compressed_texture_s3tc"))) {
  11786. if (e === z.RGB_S3TC_DXT1_Format)
  11787. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  11788. if (e === z.RGBA_S3TC_DXT1_Format)
  11789. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  11790. if (e === z.RGBA_S3TC_DXT3_Format)
  11791. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  11792. if (e === z.RGBA_S3TC_DXT5_Format)
  11793. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  11794. }
  11795. if (null !== (t = i.get("WEBGL_compressed_texture_pvrtc"))) {
  11796. if (e === z.RGB_PVRTC_4BPPV1_Format)
  11797. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  11798. if (e === z.RGB_PVRTC_2BPPV1_Format)
  11799. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  11800. if (e === z.RGBA_PVRTC_4BPPV1_Format)
  11801. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  11802. if (e === z.RGBA_PVRTC_2BPPV1_Format)
  11803. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  11804. }
  11805. if (null !== (t = i.get("WEBGL_compressed_texture_etc1")) && e === z.RGB_ETC1_Format)
  11806. return t.COMPRESSED_RGB_ETC1_WEBGL;
  11807. if (null !== (t = i.get("EXT_blend_minmax"))) {
  11808. if (e === z.MinEquation)
  11809. return t.MIN_EXT;
  11810. if (e === z.MaxEquation)
  11811. return t.MAX_EXT
  11812. }
  11813. return 0
  11814. }
  11815. ,
  11816. z.WebGLState = function(l, i, c) {
  11817. var n = this
  11818. , r = new z.Vector4
  11819. , e = l.getParameter(l.MAX_VERTEX_ATTRIBS)
  11820. , o = new Uint8Array(e)
  11821. , a = new Uint8Array(e)
  11822. , s = new Uint8Array(e)
  11823. , t = {}
  11824. , h = null
  11825. , u = null
  11826. , d = null
  11827. , p = null
  11828. , f = null
  11829. , g = null
  11830. , m = null
  11831. , v = null
  11832. , y = !1
  11833. , A = null
  11834. , C = null
  11835. , I = null
  11836. , E = null
  11837. , _ = null
  11838. , b = null
  11839. , w = null
  11840. , T = null
  11841. , x = null
  11842. , S = null
  11843. , M = null
  11844. , R = null
  11845. , P = null
  11846. , O = null
  11847. , L = null
  11848. , D = l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS)
  11849. , N = void 0
  11850. , F = {}
  11851. , B = new z.Vector4
  11852. , V = null
  11853. , k = null
  11854. , U = new z.Vector4
  11855. , H = new z.Vector4;
  11856. this.init = function() {
  11857. this.clearColor(0, 0, 0, 1),
  11858. this.clearDepth(1),
  11859. this.clearStencil(0),
  11860. this.enable(l.DEPTH_TEST),
  11861. l.depthFunc(l.LEQUAL),
  11862. l.frontFace(l.CCW),
  11863. l.cullFace(l.BACK),
  11864. this.enable(l.CULL_FACE),
  11865. this.enable(l.BLEND),
  11866. l.blendEquation(l.FUNC_ADD),
  11867. l.blendFunc(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA)
  11868. }
  11869. ,
  11870. this.initAttributes = function() {
  11871. for (var e = 0, t = o.length; e < t; e++)
  11872. o[e] = 0
  11873. }
  11874. ,
  11875. this.enableAttribute = function(e) {
  11876. o[e] = 1,
  11877. 0 === a[e] && (l.enableVertexAttribArray(e),
  11878. a[e] = 1),
  11879. 0 !== s[e] && (i.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(e, 0),
  11880. s[e] = 0)
  11881. }
  11882. ,
  11883. this.enableAttributeAndDivisor = function(e, t, i) {
  11884. o[e] = 1,
  11885. 0 === a[e] && (l.enableVertexAttribArray(e),
  11886. a[e] = 1),
  11887. s[e] !== t && (i.vertexAttribDivisorANGLE(e, t),
  11888. s[e] = t)
  11889. }
  11890. ,
  11891. this.disableUnusedAttributes = function() {
  11892. for (var e = 0, t = a.length; e < t; e++)
  11893. a[e] !== o[e] && (l.disableVertexAttribArray(e),
  11894. a[e] = 0)
  11895. }
  11896. ,
  11897. this.enable = function(e) {
  11898. !0 !== t[e] && (l.enable(e),
  11899. t[e] = !0)
  11900. }
  11901. ,
  11902. this.disable = function(e) {
  11903. !1 !== t[e] && (l.disable(e),
  11904. t[e] = !1)
  11905. }
  11906. ,
  11907. this.getCompressedTextureFormats = function() {
  11908. if (null === h && (h = [],
  11909. i.get("WEBGL_compressed_texture_pvrtc") || i.get("WEBGL_compressed_texture_s3tc") || i.get("WEBGL_compressed_texture_etc1")))
  11910. for (var e = l.getParameter(l.COMPRESSED_TEXTURE_FORMATS), t = 0; t < e.length; t++)
  11911. h.push(e[t]);
  11912. return h
  11913. }
  11914. ,
  11915. this.setBlending = function(e, t, i, n, r, o, a, s) {
  11916. e === z.NoBlending ? this.disable(l.BLEND) : this.enable(l.BLEND),
  11917. e === u && s === y || (e === z.AdditiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  11918. l.blendFuncSeparate(l.ONE, l.ONE, l.ONE, l.ONE)) : (l.blendEquation(l.FUNC_ADD),
  11919. l.blendFunc(l.SRC_ALPHA, l.ONE)) : e === z.SubtractiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  11920. l.blendFuncSeparate(l.ZERO, l.ZERO, l.ONE_MINUS_SRC_COLOR, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  11921. l.blendFunc(l.ZERO, l.ONE_MINUS_SRC_COLOR)) : e === z.MultiplyBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  11922. l.blendFuncSeparate(l.ZERO, l.ZERO, l.SRC_COLOR, l.SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  11923. l.blendFunc(l.ZERO, l.SRC_COLOR)) : s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  11924. l.blendFuncSeparate(l.ONE, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  11925. l.blendFuncSeparate(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)),
  11926. u = e,
  11927. y = s),
  11928. e === z.CustomBlending ? (r = r || t,
  11929. o = o || i,
  11930. a = a || n,
  11931. t === d && r === g || (l.blendEquationSeparate(c(t), c(r)),
  11932. d = t,
  11933. g = r),
  11934. i === p && n === f && o === m && a === v || (l.blendFuncSeparate(c(i), c(n), c(o), c(a)),
  11935. p = i,
  11936. f = n,
  11937. m = o,
  11938. v = a)) : v = m = g = f = p = d = null
  11939. }
  11940. ,
  11941. this.setDepthFunc = function(e) {
  11942. if (A !== e) {
  11943. if (e)
  11944. switch (e) {
  11945. case z.NeverDepth:
  11946. l.depthFunc(l.NEVER);
  11947. break;
  11948. case z.AlwaysDepth:
  11949. l.depthFunc(l.ALWAYS);
  11950. break;
  11951. case z.LessDepth:
  11952. l.depthFunc(l.LESS);
  11953. break;
  11954. case z.LessEqualDepth:
  11955. l.depthFunc(l.LEQUAL);
  11956. break;
  11957. case z.EqualDepth:
  11958. l.depthFunc(l.EQUAL);
  11959. break;
  11960. case z.GreaterEqualDepth:
  11961. l.depthFunc(l.GEQUAL);
  11962. break;
  11963. case z.GreaterDepth:
  11964. l.depthFunc(l.GREATER);
  11965. break;
  11966. case z.NotEqualDepth:
  11967. l.depthFunc(l.NOTEQUAL);
  11968. break;
  11969. default:
  11970. l.depthFunc(l.LEQUAL)
  11971. }
  11972. else
  11973. l.depthFunc(l.LEQUAL);
  11974. A = e
  11975. }
  11976. }
  11977. ,
  11978. this.setDepthTest = function(e) {
  11979. e ? this.enable(l.DEPTH_TEST) : this.disable(l.DEPTH_TEST)
  11980. }
  11981. ,
  11982. this.setDepthWrite = function(e) {
  11983. C !== e && (l.depthMask(e),
  11984. C = e)
  11985. }
  11986. ,
  11987. this.setColorWrite = function(e) {
  11988. I !== e && (l.colorMask(e, e, e, e),
  11989. I = e)
  11990. }
  11991. ,
  11992. this.setStencilFunc = function(e, t, i) {
  11993. _ === e && b === t && w === i || (l.stencilFunc(e, t, i),
  11994. _ = e,
  11995. b = t,
  11996. w = i)
  11997. }
  11998. ,
  11999. this.setStencilOp = function(e, t, i) {
  12000. T === e && x === t && S === i || (l.stencilOp(e, t, i),
  12001. T = e,
  12002. x = t,
  12003. S = i)
  12004. }
  12005. ,
  12006. this.setStencilTest = function(e) {
  12007. e ? this.enable(l.STENCIL_TEST) : this.disable(l.STENCIL_TEST)
  12008. }
  12009. ,
  12010. this.setStencilWrite = function(e) {
  12011. E !== e && (l.stencilMask(e),
  12012. E = e)
  12013. }
  12014. ,
  12015. this.setFlipSided = function(e) {
  12016. M !== e && (e ? l.frontFace(l.CW) : l.frontFace(l.CCW),
  12017. M = e)
  12018. }
  12019. ,
  12020. this.setLineWidth = function(e) {
  12021. e !== R && (l.lineWidth(e),
  12022. R = e)
  12023. }
  12024. ,
  12025. this.setPolygonOffset = function(e, t, i) {
  12026. e ? this.enable(l.POLYGON_OFFSET_FILL) : this.disable(l.POLYGON_OFFSET_FILL),
  12027. !e || P === t && O === i || (l.polygonOffset(t, i),
  12028. P = t,
  12029. O = i)
  12030. }
  12031. ,
  12032. this.getScissorTest = function() {
  12033. return L
  12034. }
  12035. ,
  12036. this.setScissorTest = function(e) {
  12037. (L = e) ? this.enable(l.SCISSOR_TEST) : this.disable(l.SCISSOR_TEST)
  12038. }
  12039. ,
  12040. this.activeTexture = function(e) {
  12041. void 0 === e && (e = l.TEXTURE0 + D - 1),
  12042. N !== e && (l.activeTexture(e),
  12043. N = e)
  12044. }
  12045. ,
  12046. this.bindTexture = function(e, t) {
  12047. void 0 === N && n.activeTexture();
  12048. var i = F[N];
  12049. void 0 === i && (i = {
  12050. type: void 0,
  12051. texture: void 0
  12052. },
  12053. F[N] = i),
  12054. i.type === e && i.texture === t || (l.bindTexture(e, t),
  12055. i.type = e,
  12056. i.texture = t)
  12057. }
  12058. ,
  12059. this.compressedTexImage2D = function() {
  12060. try {
  12061. l.compressedTexImage2D.apply(l, arguments)
  12062. } catch (e) {
  12063. console.error(e)
  12064. }
  12065. }
  12066. ,
  12067. this.texImage2D = function() {
  12068. try {
  12069. l.texImage2D.apply(l, arguments)
  12070. } catch (e) {
  12071. console.error(e)
  12072. }
  12073. }
  12074. ,
  12075. this.clearColor = function(e, t, i, n) {
  12076. r.set(e, t, i, n),
  12077. !1 === B.equals(r) && (l.clearColor(e, t, i, n),
  12078. B.copy(r))
  12079. }
  12080. ,
  12081. this.clearDepth = function(e) {
  12082. V !== e && (l.clearDepth(e),
  12083. V = e)
  12084. }
  12085. ,
  12086. this.clearStencil = function(e) {
  12087. k !== e && (l.clearStencil(e),
  12088. k = e)
  12089. }
  12090. ,
  12091. this.scissor = function(e) {
  12092. !1 === U.equals(e) && (l.scissor(e.x, e.y, e.z, e.w),
  12093. U.copy(e))
  12094. }
  12095. ,
  12096. this.viewport = function(e) {
  12097. !1 === H.equals(e) && (l.viewport(e.x, e.y, e.z, e.w),
  12098. H.copy(e))
  12099. }
  12100. ,
  12101. this.reset = function() {
  12102. for (var e = 0; e < a.length; e++)
  12103. 1 === a[e] && (l.disableVertexAttribArray(e),
  12104. a[e] = 0);
  12105. t = {},
  12106. N = void 0,
  12107. F = {},
  12108. M = E = C = I = u = h = null
  12109. }
  12110. }
  12111. }
  12112. , {
  12113. three: 217
  12114. }],
  12115. 104: [function(a, h, e) {
  12116. (function(i, e) {
  12117. "use strict";
  12118. function t(e) {
  12119. this.urls = e;
  12120. var t = i("bWVzc2FnZSBiaW5hcnlfbWVzaCB7CglyZXBlYXRlZCBjaHVua19zaW1wbGUgY2h1bmsgPSAxOwoJcmVwZWF0ZWQgY2h1bmtfcXVhbnRpemVkIHF1YW50aXplZF9jaHVuayA9IDI7Cn0KCi8vIERlZmluaXRpb24gb2YgdmVydGljZXM6IDNEIGNvb3JkaW5hdGVzLCBhbmQgMkQgdGV4dHVyZSBjb29yZGluYXRlcy4KbWVzc2FnZSB2ZXJ0aWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgZmxvYXQgeHl6ID0gMSBbcGFja2VkPXRydWVdOyAgLy8geF8wLHlfMCx6XzAsIHhfMSx5XzEsel8xLCAuLi4KCXJlcGVhdGVkIGZsb2F0IHV2ID0gMiBbcGFja2VkPXRydWVdOyAgLy8gdV8wLHZfMCwgdV8xLHZfMSwgLi4uCn0KCi8vIEluZGV4ZXMgb2YgdmVydGljZXMgb2YgZmFjZXMKbWVzc2FnZSBmYWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgdWludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgovLyBBIHNpbXBseSBlbmNvZGVkIGNodW5rLgovLyBUT0RPOiBhZGQgY2h1bmsgcHJvcGVyaXRlcyAoc3VjaCBhcyAicmVmbGVjdGl2ZSIpCm1lc3NhZ2UgY2h1bmtfc2ltcGxlIHsKCW9wdGlvbmFsIHZlcnRpY2VzX3NpbXBsZSB2ZXJ0aWNlcyA9IDE7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSAyOwoJb3B0aW9uYWwgc3RyaW5nIGNodW5rX25hbWUgPSAzOwoJb3B0aW9uYWwgc3RyaW5nIG1hdGVyaWFsX25hbWUgPSA0Owp9CgovLyBRdWFudGl6ZWQgdmVyc2lvbnMgZm9sbG93OgptZXNzYWdlIHZlcnRpY2VzX3F1YW50aXplZCB7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAxOwoJcmVwZWF0ZWQgZmxvYXQgdHJhbnNsYXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHggPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgeSA9IDQgW3BhY2tlZD10cnVlXTsKCXJlcGVhdGVkIHNpbnQzMiB6ID0gNSBbcGFja2VkPXRydWVdOwp9CgptZXNzYWdlIHV2X3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgbmFtZSA9IDE7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHUgPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgdiA9IDQgW3BhY2tlZD10cnVlXTsKfQoKLy8gSW5kZXhlcyBvZiB2ZXJ0aWNlcyBvZiBmYWNlcwptZXNzYWdlIGZhY2VzX2NvbXByZXNzZWQgewoJcmVwZWF0ZWQgc2ludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgptZXNzYWdlIGNodW5rX3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgY2h1bmtfbmFtZSA9IDE7CglvcHRpb25hbCBzdHJpbmcgbWF0ZXJpYWxfbmFtZSA9IDI7CglvcHRpb25hbCB2ZXJ0aWNlc19xdWFudGl6ZWQgdmVydGljZXMgPSAzOwoJcmVwZWF0ZWQgdXZfcXVhbnRpemVkIHV2cyA9IDQ7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSA1Owp9Cg==", "base64");
  12121. this.builder = n.loadProto(t),
  12122. this.decoder = this.builder.build("binary_mesh")
  12123. }
  12124. var s = a("three")
  12125. , n = a("protobufjs")
  12126. , r = a("../util/logger")
  12127. , o = (a("../util/common"),
  12128. a("../util/ajax"))
  12129. , l = a("../objects/Chunk")
  12130. , c = new r(e);
  12131. t.prototype = {
  12132. constructor: t,
  12133. load: function(t, i, n, r) {
  12134. return c.time("download"),
  12135. o.get(t, {
  12136. responseType: "arraybuffer"
  12137. }).done(function(e) {
  12138. c.timeEnd("download"),
  12139. this.parse(e, t, i, n, r)
  12140. }
  12141. .bind(this)).fail(r)
  12142. },
  12143. parse: function(e, t, i, n, r) {
  12144. var o = this.readProtobuf(e);
  12145. if (!o)
  12146. return r();
  12147. try {
  12148. c.time("convert to webgl"),
  12149. this.convertProtobufToSceneObject(o, t, i, n, r),
  12150. c.timeEnd("convert to webgl")
  12151. } catch (e) {
  12152. return c.error("failed parsing .dam"),
  12153. c.error(e.message),
  12154. r()
  12155. }
  12156. },
  12157. readProtobuf: function(e) {
  12158. var t;
  12159. try {
  12160. c.time("parse proto"),
  12161. t = this.decoder.decode(e),
  12162. c.timeEnd("parse proto")
  12163. } catch (e) {
  12164. return c.error("failed parsing proto for .dam"),
  12165. c.error(e.message),
  12166. null
  12167. }
  12168. return t
  12169. },
  12170. convertProtobufToSceneObject: function(e, i, t, n, r) {
  12171. if (0 === e.chunk.length)
  12172. return c.warn("No chunks in damfile..."),
  12173. t([]);
  12174. var o = new s.Matrix4;
  12175. o.set(1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1);
  12176. var a = e.chunk.map(function(e) {
  12177. var t = new s.BufferGeometry;
  12178. return t.addAttribute("position", new s.BufferAttribute(new Float32Array(e.vertices.xyz,0,3),3)),
  12179. 0 < e.vertices.uv.length && t.addAttribute("uv", new s.BufferAttribute(new Float32Array(e.vertices.uv,0,2),2)),
  12180. t.setIndex(new s.BufferAttribute(new Uint32Array(e.faces.faces,0,1),1)),
  12181. t.applyMatrix(o),
  12182. t.computeBoundingBox(),
  12183. new l({
  12184. geometry: t,
  12185. textureName: e.material_name,
  12186. name: e.chunk_name,
  12187. meshUrl: i
  12188. })
  12189. });
  12190. return a ? t(a) : (c.error(".dam protobuf came out with no chunks..."),
  12191. r())
  12192. }
  12193. },
  12194. h.exports = t
  12195. }
  12196. ).call(this, a("buffer").Buffer, "/js/loaders/DamLoader.js")
  12197. }
  12198. , {
  12199. "../objects/Chunk": 144,
  12200. "../util/ajax": 181,
  12201. "../util/common": 185,
  12202. "../util/logger": 189,
  12203. buffer: 198,
  12204. protobufjs: 214,
  12205. three: 217
  12206. }],
  12207. 105: [function(n, r, e) {
  12208. (function(e) {
  12209. "use strict";
  12210. var t = (n("three"),
  12211. n("../settings"),
  12212. n("../util/browser"),
  12213. n("./DamLoader"))
  12214. , i = n("../util/logger")
  12215. , u = (n("../ab"),
  12216. new i(e));
  12217. r.exports = {
  12218. getLoaders: function() {
  12219. return [["_50k", ".dam", t], ["", ".dam", t]]
  12220. },
  12221. load: function(e, t, i, n, r, o) {
  12222. var a = this.getLoaders()[o = o || 0];
  12223. if (a) {
  12224. var s = a[0]
  12225. , l = a[1]
  12226. , c = new a[2](t)
  12227. , h = t.get(e + s + l);
  12228. h ? (u.debug("Trying " + s + l),
  12229. c.load(h, i, n, function() {
  12230. this.load(e, t, i, n, r, ++o)
  12231. }
  12232. .bind(this))) : (u.debug("Skipping " + l + ", not available"),
  12233. this.load(e, t, i, n, r, ++o))
  12234. } else
  12235. r && r("No suitable model file found...")
  12236. }
  12237. }
  12238. }
  12239. ).call(this, "/js/loaders/ModelLoader.js")
  12240. }
  12241. , {
  12242. "../ab": 3,
  12243. "../settings": 166,
  12244. "../util/browser": 182,
  12245. "../util/logger": 189,
  12246. "./DamLoader": 104,
  12247. three: 217
  12248. }],
  12249. 106: [function(i, n, e) {
  12250. (function(e) {
  12251. "use strict";
  12252. var l = i("../util/common")
  12253. , c = i("../util/texture")
  12254. , h = i("../util/browser")
  12255. , t = i("../util/logger")
  12256. , u = i("../settings")
  12257. , d = new t(e);
  12258. n.exports = {
  12259. load: function(i, n) {
  12260. if (!i.chunks[0] || !i.chunks[0].meshUrl)
  12261. return $.when();
  12262. var r = l.countUnique(i.chunks.map(function(e) {
  12263. return e.textureName
  12264. }))
  12265. , e = -1 !== i.chunks[0].meshUrl.indexOf("_50k") ? "_50k" : ""
  12266. , t = "_50k" == e ? "high" : "low";
  12267. u.minimalMemoryMode && "high" === t && (h.detectSamsungS6() ? (d.warn("Galaxy S6 cannot handle large textures, turning down quality."),
  12268. t = "low") : r > u.maxMobileTextures && (d.warn("Model probably too large for mobile, turning down quality."),
  12269. t = "low"));
  12270. var o = i.data.job.uuid + e + "_texture_jpg_" + t + "/"
  12271. , a = $.Deferred()
  12272. , s = 0;
  12273. return i.chunks.forEach(function(e) {
  12274. if (!e.material.map && e.textureName) {
  12275. var t = i.urls.get(o + e.textureName);
  12276. e.setTextureMap(c.load(t, function(e, t) {
  12277. e || (n.push(t),
  12278. s++,
  12279. a.notify(s, r),
  12280. s === r && a.resolve())
  12281. }
  12282. .bind(this, c.isLoaded(t))))
  12283. }
  12284. }),
  12285. a.promise()
  12286. }
  12287. }
  12288. }
  12289. ).call(this, "/js/loaders/ModelTextureLoader.js")
  12290. }
  12291. , {
  12292. "../settings": 166,
  12293. "../util/browser": 182,
  12294. "../util/common": 185,
  12295. "../util/logger": 189,
  12296. "../util/texture": 194
  12297. }],
  12298. 107: [function(s, l, e) {
  12299. (function(n, e) {
  12300. "use strict";
  12301. function t(e) {
  12302. this.model = e,
  12303. this.modelDataPath = this.model.urls.get("vision.modeldata")+"?m="+new Date().getTime(),
  12304. this.sweepLocationsPath = this.model.urls.get("sweep_locations.csv");
  12305. var t = n("Ly8gUHJvdG9jb2wgQnVmZmVyIGZvciBwdWNrIHZpc2liaWxpdHkgYW5kIHJlbGF0ZWQgZGF0YQovLwovLyBUbyBkdW1wIG91dCBhIGJpbnJheSBtYW5pZmVzdCBpbiB0ZXh0IGZvcm1hdCwgeW91IGNhbiB1c2UgcHJvdG9jIGRpcmVjdGx5OgovLyAgIHByb3RvYyAtLXByb3RvX3BhdGggfi9kZXYvbXBfdmlzaW9uLyAgLS1kZWNvZGU9ZW9zLnN0b3JhZ2UuVmlzaW9uTW9kZWxkYXRhIH4vZGV2L21wX3Zpc2lvbi9lb3Mvc3RvcmFnZS92aXNpb25fbW9kZWxkYXRhLnByb3RvIDwgdmlzaW9uLm1vZGVsZGF0YQoKLy8gcGFja2FnZSBlb3Muc3RvcmFnZTsKCi8vIGltcG9ydCAiZW9zL2luZnJhL2NvbW1vbi5wcm90byI7Ci8vIFRoZSBmb2xsb3dpbmcgd2VyZSBtYW51YWxseSBleHRyYWN0ZWQgaGVyZSwgSlMgZG9lcyBub3QgbGlrZSBwcm90b2J1ZiBpbXBvcnRzCgptZXNzYWdlIEFmZmluZTNmIHsKCW9wdGlvbmFsIFF1YXRlcm5pb25mIHJvdGF0aW9uID0gMTsKCW9wdGlvbmFsIFZlY3RvcjNmIHRyYW5zbGF0aW9uID0gMjsKfQoKbWVzc2FnZSBRdWF0ZXJuaW9uZiB7CglvcHRpb25hbCBmbG9hdCB3ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHggPSAyOwoJb3B0aW9uYWwgZmxvYXQgeSA9IDM7CglvcHRpb25hbCBmbG9hdCB6ID0gNDsKfQoKbWVzc2FnZSBWZWN0b3IzZiB7CglvcHRpb25hbCBmbG9hdCB4ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHkgPSAyOwoJb3B0aW9uYWwgZmxvYXQgeiA9IDM7Cn0KCi8vCi8vIE9uZSBzd2VlcCAvIHBhbm8KLy8KbWVzc2FnZSBTd2VlcExvY2F0aW9uIHsKCW9wdGlvbmFsIGJ5dGVzIHV1aWQgPSAxOyAgLyogdXVpZCAqLwoJb3B0aW9uYWwgQWZmaW5lM2YgcG9zZSA9IDI7ICAvKiBjYW1lcmEgcG9zZSAoeCwgeSx6KSBpbiBtZXRlciBhbmQgYSBxdWF0ZXJuaW9uKi8KCW9wdGlvbmFsIFZlY3RvcjNmIHB1Y2sgPSAzOyAgLyogcHVjayBsb2NhdGlvbiAtIHggYW55IGlzIGdlbmVyYWxseSB0aGUgc2FtZSBhcyBwb3NlLCB6IGlzIHRoZSBoZWlnaHQgb2YgdGhlIGNsb3Nlc3QgZmxvb3IgdW5kZXIgdGhlIGNhbWVyYSAqLwoJb3B0aW9uYWwgaW50MzIgZ3JvdXAgPSA0OyAgLyogZmxvb3IgaW5kZXggKi8KCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gNTsgIC8qIHJvb20gaW5kZXggKi8KCXJlcGVhdGVkIGludDMyIHZpc2libGVzID0gNjsgIC8qIGxpc3Qgb2YgaW5kaWNlcyB0byBhbGwgcHVja3MgdmlzaWJsZSBmcm9tIHRoaXMgcHVjayAqLwoJcmVwZWF0ZWQgZmxvYXQgc2NvcmVzID0gNzsgLyogdXNlZCBhcyBwYXJ0IG9mIHNjb3JpbmcgZnVuY3Rpb24gZm9yIGRldGVybWluaW5nIHdoaWNoIHB1Y2sgdG8gZ28gdG8gbmV4dCAqLwogIG9wdGlvbmFsIHN0cmluZyBzd2VlcF9uYW1lID0gODsKCiAgLy8gV2l0aCBvdXRkb29yIHBhbm9zLCB3ZSBoYXZlIGEgY291cGxlIG9mIGRpZmZlcmVudCBzaXR1YXRpb25zIGZvciBhbGlnbm1lbnQuIFRoZSBjb21tb24KICAvLyBjYXNlIGlzIHRoYXQgdGhlIHBhbm8gYWxpZ25lZCBub3JtYWxseS4gSXQgY291bGQgYWxzbyBoYXZlIGJlZW4gcGxhY2VkIG1hbnVhbGx5IGluCiAgLy8gQ2FwdHVyZUFwcCBvciBXb3Jrc2hvcCwgb3IgbGVmdCB1bmFsaWduZWQgZm9yIGhpZ2hsaWdodC1yZWVsIHZpZXdpbmcuCiAgZW51bSBBbGlnbm1lbnRUeXBlCiAgewogICAgICBVTktOT1dOID0gMDsKICAgICAgQUxJR05FRCA9IDE7CiAgICAgIFVOQUxJR05FRCA9IDI7CiAgICAgIE1BTlVBTExZX1BMQUNFRCA9IDM7CiAgfQogIG9wdGlvbmFsIEFsaWdubWVudFR5cGUgYWxpZ25tZW50X3R5cGUgPSA5IFtkZWZhdWx0ID0gQUxJR05FRF07Cn0KCm1lc3NhZ2UgU3ViZ3JvdXBJbmZvIHsKCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gMTsKCW9wdGlvbmFsIGZsb2F0IGFyZWEgPSAyOyAvKiBmbG9vciBhcmVhIGluIG1eMiAoc3F1YXJlIG1ldGVyYWdlKSAqLwp9CgovKiBBbGwgcHVja3MgaW4gYSBtb2RlbC4gUHVja3MgYXJlIHN0b3JlZCBpbiBzY2FubmluZyBvcmRlci4gKi8KbWVzc2FnZSBWaXNpb25Nb2RlbGRhdGEgewoJcmVwZWF0ZWQgU3dlZXBMb2NhdGlvbiBzd2VlcExvY2F0aW9ucyA9IDE7CglyZXBlYXRlZCBTdWJncm91cEluZm8gc3ViZ3JvdXBJbmZvcyA9IDI7Cn0K", "base64")
  12306. , i = r.loadProto(t);
  12307. this.decoder = i.build("VisionModeldata")
  12308. }
  12309. var r = s("protobufjs")
  12310. , i = s("../util/ajax")
  12311. , o = (s("../util/common"),
  12312. s("../util/math"))
  12313. , a = new (s("../util/logger"))(e);
  12314. t.prototype.load = function() {
  12315. return this.modelDataPath ? (a.info("Using vision.modeldata"),
  12316. this.loadVisionModelData()) : this.sweepLocationsPath ? (a.warn("Using sweep_locations.csv"),
  12317. this.loadSweepLocationsCSV()) : (a.warn("No sweep file found"),
  12318. $.when([]))
  12319. }
  12320. ,
  12321. t.prototype.loadVisionModelData = function() {
  12322. return i.get(this.modelDataPath, {
  12323. responseType: "arraybuffer"
  12324. }).then(function(e) {
  12325. var t;
  12326. try {
  12327. t = this.decoder.decode(e)
  12328. } catch (e) {
  12329. return a.warn("Could not decode vision.modeldata, trying sweep_locations.csv"),
  12330. this.loadSweepLocationsCSV()
  12331. }
  12332. var i = t.sweepLocations.map(function(e) {
  12333. return {
  12334. uuid: e.uuid.toUTF8().replace(/-/g, ""),
  12335. position: {
  12336. x: e.pose.translation.x,
  12337. y: e.pose.translation.y,
  12338. z: e.pose.translation.z
  12339. },
  12340. quaternion: {
  12341. x: e.pose.rotation.x,
  12342. y: e.pose.rotation.y,
  12343. z: e.pose.rotation.z,
  12344. w: e.pose.rotation.w
  12345. },
  12346. puck: {
  12347. x: e.puck.x,
  12348. y: e.puck.y,
  12349. z: e.puck.z
  12350. },
  12351. floor: e.group,
  12352. neighbours: e.visibles,
  12353. alignmentType: e.alignment_type
  12354. }
  12355. }).map(function(e) {
  12356. return e.position = o.convertVisionVector(e.position),
  12357. e.quaternion = o.convertVisionQuaternion(e.quaternion),
  12358. e.puck = o.convertVisionVector(e.puck),
  12359. e
  12360. });
  12361. return i.forEach(function(e) {
  12362. e.neighbours = e.neighbours.map(function(e) {
  12363. return i[e].uuid
  12364. })
  12365. }),
  12366. i
  12367. }
  12368. .bind(this), function() {
  12369. return a.warn("Could not load vision.modeldata, trying sweep_locations.csv"),
  12370. this.loadSweepLocationsCSV()
  12371. }
  12372. .bind(this))
  12373. }
  12374. ,
  12375. t.prototype.loadSweepLocationsCSV = function() {
  12376. return i.get(this.sweepLocationsPath).then(function(e) {
  12377. return e.split("\n").map(function(e) {
  12378. return e.split(", ")
  12379. }).filter(function(e) {
  12380. return 1 < e.length
  12381. }).map(function(e) {
  12382. return {
  12383. uuid: e[0],
  12384. position: {
  12385. x: parseFloat(e[1]),
  12386. y: parseFloat(e[2]),
  12387. z: parseFloat(e[3])
  12388. },
  12389. quaternion: {
  12390. x: parseFloat(e[4]),
  12391. y: parseFloat(e[5]),
  12392. z: parseFloat(e[6]),
  12393. w: parseFloat(e[7])
  12394. }
  12395. }
  12396. }).map(function(e) {
  12397. return e.position = o.convertVisionVector(e.position),
  12398. e.quaternion = o.convertVisionQuaternion(e.quaternion),
  12399. e
  12400. })
  12401. }).fail(function() {
  12402. a.warn("Could not load sweep_locations.csv, no sweeps loaded.")
  12403. })
  12404. }
  12405. ,
  12406. l.exports = t
  12407. }
  12408. ).call(this, s("buffer").Buffer, "/js/loaders/SweepDataLoader.js")
  12409. }
  12410. , {
  12411. "../util/ajax": 181,
  12412. "../util/common": 185,
  12413. "../util/logger": 189,
  12414. "../util/math": 190,
  12415. buffer: 198,
  12416. protobufjs: 214
  12417. }],
  12418. 108: [function(s, l, e) {
  12419. (function(e) {
  12420. "use strict";
  12421. function t() {
  12422. this.locale = null
  12423. }
  12424. var i = s("../settings")
  12425. , n = s("../util/common")
  12426. , r = s("../util/logger")
  12427. , o = s("../enum/Locale")
  12428. , a = new r(e);
  12429. t.prototype.init = function() {
  12430. var e;
  12431. switch (i.languageTag) {
  12432. case null:
  12433. case "en":
  12434. case o.EN_US:
  12435. this.locale = o.EN_US,
  12436. e = s("./strings-en-US");
  12437. break;
  12438. case "es":
  12439. case o.ES_MX:
  12440. this.locale = o.ES_MX,
  12441. e = s("./strings-es-MX");
  12442. break;
  12443. case "fr":
  12444. case o.FR_FR:
  12445. this.locale = o.FR_FR,
  12446. e = s("./strings-fr-FR");
  12447. break;
  12448. case "de":
  12449. case o.DE_DE:
  12450. this.locale = o.DE_DE,
  12451. e = s("./strings-de-DE");
  12452. break;
  12453. case "ru":
  12454. case o.RU_RU:
  12455. this.locale = o.RU_RU,
  12456. e = s("./strings-ru-RU");
  12457. break;
  12458. case "cn":
  12459. case o.CN_CN:
  12460. this.locale = o.CN_CN,
  12461. e = s("./strings-cn-CN");
  12462. break;
  12463. case "jp":
  12464. case o.JP_JP:
  12465. this.locale = o.JP_JP,
  12466. e = s("./strings-jp-JP");
  12467. break;
  12468. default:
  12469. a.info("Unsupported language tag, defaulting to 'en-US'"),
  12470. this.locale = o.EN_US,
  12471. e = s("./strings-en-US")
  12472. }
  12473. a.info("Using locale '" + this.locale + "'"),
  12474. n.extendObject(this, e)
  12475. }
  12476. ,
  12477. t.prototype.localizeGUI = function() {
  12478. var e = document.querySelector("#gui-parent");
  12479. this.localizeTree(e),
  12480. this.localizeLoadingText()
  12481. }
  12482. ,
  12483. t.prototype.localizeLoadingText = function() {
  12484. document.querySelector("#help-dialog").classList.add(this.locale),
  12485. document.querySelector("#interaction-modal").classList.add(this.locale),
  12486. document.querySelector("#gui").classList.add(this.locale)
  12487. }
  12488. ,
  12489. t.prototype.localizeTree = function(e) {
  12490. var t, i, n = /{\[{ ?(\w+) ?}\]}/;
  12491. if (e.nodeType === Node.TEXT_NODE)
  12492. (t = e.data.match(n)) && (i = t[1],
  12493. e.data = this.localizeText(i) || i);
  12494. else if (e.nodeType === Node.ELEMENT_NODE) {
  12495. var r = e.getAttribute("title");
  12496. r && ((t = r.match(n)) && (i = t[1],
  12497. e.setAttribute("title", this.localizeText(i) || i)))
  12498. }
  12499. for (e = e.firstChild; e; )
  12500. this.localizeTree(e),
  12501. e = e.nextSibling
  12502. }
  12503. ,
  12504. t.prototype.localizeText = function(e) {
  12505. var t = this[e];
  12506. return t || this.locale === o.EN_US || (a.warn("Localization key '" + e + "' not available for locale '" + this.locale + "', defaulting to English."),
  12507. t = s("./strings-en-US")[e]),
  12508. t || a.warn("Localization key '" + e + "' not available for locale 'en-US'"),
  12509. t
  12510. }
  12511. ,
  12512. l.exports = new t
  12513. }
  12514. ).call(this, "/js/localization/localize.js")
  12515. }
  12516. , {
  12517. "../enum/Locale": 31,
  12518. "../settings": 166,
  12519. "../util/common": 185,
  12520. "../util/logger": 189,
  12521. "./strings-cn-CN": 109,
  12522. "./strings-de-DE": 110,
  12523. "./strings-en-US": 111,
  12524. "./strings-es-MX": 112,
  12525. "./strings-fr-FR": 113,
  12526. "./strings-jp-JP": 114,
  12527. "./strings-ru-RU": 115
  12528. }],
  12529. 109: [function(e, t, i) {
  12530. "use strict";
  12531. t.exports = {
  12532. PAGE_TITLE: "",
  12533. LOADING: "正在加载",
  12534. PRESENTED_BY_CAPS: "呈现者:",
  12535. POWERED_BY: "技术支持:",
  12536. POWERED_BY_CAPS: "技术支持:",
  12537. DESKTOP_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  12538. MOBILE_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  12539. PRESENTED_BY: "呈现者:",
  12540. MORE: "更多 ",
  12541. LESS: "更少 ",
  12542. TAG_CONTENT: "tag™ 内容",
  12543. SHOW: "显示",
  12544. HIDE: "隐藏",
  12545. DOLLHOUSE: "场景屋",
  12546. FLOOR_PLAN: "楼层平面图",
  12547. OPEN_HIGHLIGHTS: "打开精彩片段",
  12548. CLOSE_HIGHLIGHTS: "关闭",
  12549. PREVIOUS: "上一个",
  12550. PLAY: "播放",
  12551. PAUSE: "暂停",
  12552. NEXT: "下一个",
  12553. EXPLORE_3D_SPACE: "探索 3D 空间",
  12554. VIEW_DOLLHOUSE: "观看场景屋",
  12555. SOCIAL_SHARING: "分享这个空间",
  12556. VIEW_IN_VR: "以 VR 观看",
  12557. VIEW_FULLSCREEN: "全屏观看",
  12558. EXIT_FULLSCREEN: " 退出全屏",
  12559. ZOOM_IN: "放大",
  12560. ZOOM_OUT: "缩小",
  12561. FLOOR_NAME: "楼层",
  12562. FLOOR_ALL: "ALL",
  12563. FLOOR_Lang: ["Floor", ""],
  12564. TERMS: "条款",
  12565. PORT_TERMS: "port 条款",
  12566. TERMS_OF_USE: "使用条款",
  12567. CLOSE_TERMS: "关闭",
  12568. TERMS_TEXT_FILE: "terms-cn-CN.html",
  12569. TERMS_FAIL: "无法获取条款。请确保您有互联网连接以查看使用条款。",
  12570. WEBVR_FOR_DAYDREAM: "用于 Daydream 视图",
  12571. WEBVR_ENTER_WEBVR: "进入 VR",
  12572. WEBVR_DIFFERENT_HEADSET: "有其他耳机吗?",
  12573. WEBVR_LEARN_MORE: "了解更多",
  12574. WEBVR_VIEW_SPACE: "在 VR 中观看空间",
  12575. WEBVR_DAYDREAM_VIEW: "Daydream 视图",
  12576. WEBVR_DAYDREAM_PHONE: "支持 Daydream 的手机",
  12577. WEBVR_FOR_CARDBOARD: "用于 Google Cardboard",
  12578. WEBVR_VIEW_CARDBOARD: "或在 Google Cardboard 上观看",
  12579. VR_VIEW_SPACE: "在虚拟现实中观看空间",
  12580. VR_LEARN_MORE_CAPS: "了解更多",
  12581. VR_PREVIOUS_CAPS: "上一个’,",
  12582. VR_NEXT_CAPS: "下一个",
  12583. VR_GOT_IT_CAPS: "明白了",
  12584. VR_SHOW_SUPPORTED: "点击以使用 VR 观看空间",
  12585. VR_SHOW_UNSUPPORTED: "很遗憾,您的设备不符合在 VR 中观看空间的最低要求。",
  12586. VR_SHOW_IOS_1: "点击以使用 VR 观看空间",
  12587. VR_SHOW_IOS_2: "需要有 port VR 应用程序和兼容的 iPhone 才能观看",
  12588. VR_WHAT_YOU_NEED: "关于...您需要什么",
  12589. VR_NEED_CARDBOARD: "您使用 Google Cardboard 时需要什么",
  12590. VR_NEED_SAMSUNG: "您使用 Samsung Gear VR 时需要什么",
  12591. VR_NEED_DAYDREAM: "需要事先与 DAYDREAM VIEW 配对",
  12592. VR_NEED_DAYDREAM_PHONE: "支持 Daydream 的手机",
  12593. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  12594. VR_GOOGLE_DAYDREAM: "Google Daydream",
  12595. VR_APP: "port VR 应用程序",
  12596. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  12597. VR_COMPATIBLE_IPHONES_1: "iPhones",
  12598. VR_COMPATIBLE_IPHONES_2: "iPhone 5s 和更高版本,运行 iOS 9.1 和更高版本",
  12599. VR_COMPATIBLE_IPHONES_3: "兼容的 iPhone",
  12600. VR_COMPATIBLE_ANDROID: "兼容的 Android 设备",
  12601. VR_COMPATIBLE_ANDROID_LONG: "4.5-5.5 英寸、运行 Android OS 4.4.4 和更高版本的兼容型 Android 设备显示屏",
  12602. VR_ANDROID_DETAIL: "4.5 至 5.5 英寸、运行 Android OS 4.4.4 和更高版本的显示屏",
  12603. VR_ANDROID_DVICES: "Android 设备",
  12604. VR_COMPATIBLE_SAMSUNG: "兼容的 Samsung 设备",
  12605. VR_SAMSUNG_DETAIL: "Galaxy S6 和更高版本",
  12606. VR_APP_FOR_CARDBOARD: "用于 Google Cardboard 的 port VR 应用程序",
  12607. VR_APP_FOR_SAMSUNG: "用于 Gear VR 的 port VR 应用程序",
  12608. VR_APP_FOR_ANDROID: "用于 Android 手机的 port VR 应用程序",
  12609. VR_APP_OPEN: "请使用 port VR 应用程序打开",
  12610. VR_DOWNLOAD_HERE: "在此下载",
  12611. VR_REQUIRE_HEADSET: "需要一副 VR 耳机并安装用于 Android 的 port VR 应用程序",
  12612. VR_REDIRECT_TO_STORE: "如果未安装应用程序,您将跳转到应用程序商店。",
  12613. VR_IMPROPER_EMBED: "port 空间未正确嵌入,无法在您的 Web 浏览器支持 VR。",
  12614. VR_OPEN_ANDROID_LINK: "在您的手机上打开链接",
  12615. VR_ANDROID_OPTIONS: "可用的 VR 耳机选项",
  12616. SHARE_TO: "分享到",
  12617. SHARE_LINK: "直接链接",
  12618. SHARE_EXPLORE: "探索",
  12619. SHARE_AT: "在",
  12620. SHARE_WITH: "使用",
  12621. SHARE_3D: "以 3D",
  12622. SHARE_COPIED: "已复制!",
  12623. ERROR_BROWSER_SOLUTION: "安装更新的浏览器以探索 3D。",
  12624. ERROR_BROWSER_EXPLANATION: "WebGL 需要现代的浏览器。",
  12625. ERROR_GENERIC_PROBLEM: "糟糕,出现问题。",
  12626. ERROR_GENERIC_SOLUTION: "重新启动您的浏览器。",
  12627. ERROR_GENERIC_ACTIONS_1: "如果问题仍然存在,",
  12628. ERROR_GENERIC_ACTIONS_2: "请安装支持的浏览器",
  12629. ERROR_GENERIC_ACTIONS_3: " 或",
  12630. ERROR_GENERIC_ACTIONS_4: "查看我们的故障排除指南",
  12631. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "浏览器不受支持。",
  12632. ERROR_WEBGL_IOS_PROBLEM: "iOS 版本不受支持。",
  12633. ERROR_WEBGL_IOS_SOLUTION: "升级到 iOS 8 或更高版本以在 3D 中探索。",
  12634. ERROR_WEBGL_IOS_ACTIONS_1: "点击 ",
  12635. ERROR_WEBGL_IOS_ACTIONS_2: "设置 > 通用 > 软件更新",
  12636. ERROR_WEBGL_SAFARI_PROBLEM: "启用 WebGL 以在 3D 中探索。",
  12637. ERROR_WEBGL_SAFARI_ACTIONS_1: "单击",
  12638. ERROR_WEBGL_SAFARI_ACTIONS_2: "菜单栏中的首选项 > 高级 > 显示开发菜单",
  12639. ERROR_WEBGL_SAFARI_ACTIONS_3: "然后单击",
  12640. ERROR_WEBGL_SAFARI_ACTIONS_4: "开发 > 启用 WebGL",
  12641. ERROR_MISSING_URLS_PROBLEM: "糟糕,没有此模型的全景。",
  12642. ERROR_MISSING_URLS_EXPLANATION: "这是较早的模型。网站所有者可能正在开发一种新模型。",
  12643. ERROR_LOADING_FAILED_PROBLEM: "糟糕,模式不可用。",
  12644. ERROR_LOADING_FAILED_ACTIONS_1: "如果问题仍然存在,",
  12645. ERROR_LOADING_FAILED_ACTIONS_2: "查看我们的故障排除指南",
  12646. ERROR_MAINTENANCE_PROBLEM: "正在进行维护",
  12647. ERROR_MAINTENANCE_SOLUTION: "请过几分钟再来。",
  12648. LINK_TO_LOCATION: "地点链接",
  12649. MENU_COPY: "复制",
  12650. LINK_ALERT_COPY: "请使用 CTRL/CMD + C 复制。",
  12651. ROTATE: "旋转",
  12652. MOVE: "移动",
  12653. INSIDE: "内部",
  12654. ZOOM: "缩放",
  12655. HELP: "小帮手",
  12656. HELP_NAVIGATION_TAB: "导航",
  12657. HELP_MORE_HELP_TAB: "更多帮助",
  12658. HELP_DESKTOP_PANORAMA_1A: "单击并拖动以环顾空间。",
  12659. HELP_DESKTOP_PANORAMA_2A: "单击整个空间内的圆环以四处移动。",
  12660. HELP_DESKTOP_PANORAMA_3A: "使用鼠标滚轮来放大和缩小。",
  12661. HELP_DESKTOP_PANORAMA_1B: "或者,使用箭头键向左向右转。",
  12662. HELP_DESKTOP_PANORAMA_2B: "或者,使用箭头键向前移动和向后移动。",
  12663. HELP_DESKTOP_PANORAMA_3B: "或者,使用加号和减号键来放大和缩小。",
  12664. HELP_DESKTOP_360_2A: "单击内部视图图标以进入空间。",
  12665. HELP_DESKTOP_360_2B: "或者,按 1 号键进入内部视图。 ",
  12666. HELP_DESKTOP_DOLLHOUSE_1A: "左键单击并向左、向右、向上和向下拖动以旋转场景屋。",
  12667. HELP_DESKTOP_DOLLHOUSE_2A: "右键单击并向左、向右、向上和向下拖动以改变场景屋在屏幕上的位置。",
  12668. HELP_DESKTOP_DOLLHOUSE_3A: "使用鼠标滚轮来放大和缩小。",
  12669. HELP_DESKTOP_DOLLHOUSE_1B: "或者,使用箭头键来旋转场景屋。",
  12670. HELP_DESKTOP_FLOORPLAN_1A: "左键单击并向左、向右、向上和向下拖动以改变楼层平面图在屏幕上的位置。",
  12671. HELP_DESKTOP_FLOORPLAN_2A: "右键单击并向左或向右拖动以旋转楼层平面图。",
  12672. HELP_DESKTOP_FLOORPLAN_3A: "使用鼠标滚轮来放大和缩小。",
  12673. HELP_DESKTOP_FLOORPLAN_2B: "或者,使用箭头键以向左或向右旋转。",
  12674. HELP_DESKTOP_FLOORPLAN_3B: "或者,使用箭头键来放大和缩小。",
  12675. HELP_MOBILE_PANORAMA_1: "触摸并拖动以环顾空间。",
  12676. HELP_MOBILE_PANORAMA_2: "点击整个空间内的圆环以四处移动。",
  12677. HELP_MOBILE_3: "使用捏合手势来放大和缩小。",
  12678. HELP_MOBILE_360_2: "点击内部视图图标以进入空间。",
  12679. HELP_MOBILE_DOLLHOUSE_1: "触摸并向上、向下、向左和向右拖动以旋转场景屋。",
  12680. HELP_MOBILE_DOLLHOUSE_2: "用两指触摸并拖动以定位场景屋。",
  12681. HELP_MOBILE_FLOORPLAN_1: "触摸并拖动以定位楼层平面图。",
  12682. HELP_MOBILE_FLOORPLAN_2: "用两指触摸并拖动以旋转楼层平面图。",
  12683. HELP_MORE_HLR_A: "精彩片段集锦",
  12684. HELP_DESKTOP_MORE_HLR_B: "打开以使用缩略图图像在空间中流览。",
  12685. HELP_MORE_DOLLHOUSE_A: "场景屋",
  12686. HELP_DESKTOP_MORE_DOLLHOUSE_B: "单击以查看和旋转 3D 内整个空间的俯视图。",
  12687. HELP_MOBILE_MORE_DOLLHOUSE_B: "点击以查看和旋转 3D 内整个空间的俯视图。",
  12688. HELP_MORE_FLOORS_A: "楼层选择器",
  12689. HELP_DESKTOP_MORE_FLOORS_B: "在空间中的楼层之间切换。",
  12690. HELP_MORE_TAG_A: "tag™ 贴文",
  12691. HELP_DESKTOP_MORE_TAG_B: "单击或悬停鼠标以查看空间中的功能信息。",
  12692. HELP_MOBILE_MORE_TAG_B: "点击以查看空间中的功能信息。",
  12693. HELP_MORE_ZOOM_A: "缩放控件",
  12694. HELP_DESKTOP_MORE_ZOOM_B: "使用这些控件来放大和缩小或使用滚轮。",
  12695. HELP_MORE_TOUR_A: "导览控件",
  12696. HELP_DESKTOP_MORE_TOUR_B: "通过导览播放、暂停以及向前和向后流览。",
  12697. HELP_MORE_INSIDE_A: "内部视图",
  12698. HELP_DESKTOP_MORE_INSIDE_B: "单击以探索空间内部。",
  12699. HELP_MOBILE_MORE_INSIDE_B: "点击以探索空间内部。",
  12700. HELP_MORE_VR_A: "VR 模式",
  12701. HELP_DESKTOP_MORE_VR_B: "单击以在虚拟现实中启动空间。",
  12702. HELP_MOBILE_MORE_VR_B: "点击以在虚拟现实中启动空间。",
  12703. HELP_MORE_360_A: "360° 视图",
  12704. HELP_DESKTOP_MORE_360_B: "单击精彩片段集锦中的 360 视图中以观看室外场景。",
  12705. HELP_MOBILE_MORE_360_B: "点击精彩片段集锦中的 360 视图中以观看室外场景。",
  12706. HELP_MORE_FULLSCREEN_A: "全屏",
  12707. HELP_DESKTOP_MORE_FULLSCREEN_B: "将 3D Showcase 扩展到全屏。",
  12708. CLOSE: "关闭"
  12709. }
  12710. }
  12711. , {}],
  12712. 110: [function(e, t, i) {
  12713. "use strict";
  12714. t.exports = {
  12715. PAGE_TITLE: "",
  12716. LOADING: "Lädt",
  12717. PRESENTED_BY_CAPS: "PRÄSENTIERT VON",
  12718. POWERED_BY: "Angetrieben von",
  12719. POWERED_BY_CAPS: "ANGETRIEBEN VON",
  12720. DESKTOP_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  12721. MOBILE_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  12722. PRESENTED_BY: "Präsentiert von ",
  12723. MORE: "Mehr ",
  12724. LESS: "Weniger ",
  12725. TAG_CONTENT: "tag™ Inhalt",
  12726. SHOW: "Anzeigen",
  12727. HIDE: "Verbergen",
  12728. DOLLHOUSE: "Puppenhaus",
  12729. FLOOR_PLAN: "Grundriss",
  12730. OPEN_HIGHLIGHTS: "Highlights anzeigen",
  12731. CLOSE_HIGHLIGHTS: "Schließen",
  12732. PREVIOUS: "Vorheriges",
  12733. PLAY: "Abspielen",
  12734. PAUSE: "Pausieren",
  12735. NEXT: "Nächstes",
  12736. EXPLORE_3D_SPACE: "Innenraum betreten",
  12737. VIEW_DOLLHOUSE: "Puppenhaus ansehen",
  12738. SOCIAL_SHARING: "Teilen Sie diesen Raum",
  12739. VIEW_IN_VR: "In VR ansehen",
  12740. VIEW_FULLSCREEN: "Ansicht im Vollbildmodus",
  12741. EXIT_FULLSCREEN: "Beenden des Vollbildmodus",
  12742. ZOOM_IN: "Vergrößern",
  12743. ZOOM_OUT: "Verkleinern",
  12744. FLOOR_NAME: "Etage ",
  12745. FLOOR_ALL: "Alle",
  12746. TERMS: "Bedingungen",
  12747. PORT_TERMS: "port Bedingungen",
  12748. TERMS_OF_USE: "Nutzungsbedingungen",
  12749. TERMS_TEXT_FILE: "terms-de-DE.html",
  12750. CLOSE_TERMS: "Schließen",
  12751. TERMS_FAIL: "Konnte die Nutzungsbedingungen nicht abrufen. Bitte stellen Sie sicher, dass Sie zum Internet verbunden sind.",
  12752. HELP: "Hilfe",
  12753. HELP_NAVIGATION_TAB: "Navigation",
  12754. HELP_MORE_HELP_TAB: "Hilfe-Details",
  12755. CLOSE: "Schließen",
  12756. HELP_DESKTOP_PANORAMA_1A: "Klicken und ziehen Sie um sich im Raum umzusehen.",
  12757. HELP_DESKTOP_PANORAMA_2A: "Klicken Sie auf die Ringe im Raum um sich zu bewegen.",
  12758. HELP_DESKTOP_PANORAMA_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12759. HELP_DESKTOP_PANORAMA_1B: "Oder verwenden Sie die Pfeiltasten um sich nach links und rechts zu bewegen.",
  12760. HELP_DESKTOP_PANORAMA_2B: "Oder verwenden Sie die Pfeiltasten um sich vorwärts und rückwärts zubewegen.",
  12761. HELP_DESKTOP_PANORAMA_3B: "Oder verwenden Sie die Plus- und Minus-Tasten zum Vergrößern und Verkleinern.",
  12762. HELP_DESKTOP_360_2A: "Klicken Sie die Innenansicht ikone, um diesen Raum zu starten .",
  12763. HELP_DESKTOP_360_2B: "Oder, drücken Sie die 1-Taste um die Innenraumansicht zu starten.",
  12764. HELP_DESKTOP_DOLLHOUSE_1A: "Klicken Sie mit der linken Maustaste und ziehen Sie nach links, rechts, oben und unten um das Puppenhaus zu drehen.",
  12765. 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.",
  12766. HELP_DESKTOP_DOLLHOUSE_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12767. HELP_DESKTOP_DOLLHOUSE_1B: "Oder verwenden Sie die Pfeiltasten um das Puppenhaus zu drehen.",
  12768. 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.",
  12769. HELP_DESKTOP_FLOORPLAN_2A: "Klicken Sie mit der rechten Maustaste und ziehen Sie nach links oder rechts um den Grundriss zu drehen.",
  12770. HELP_DESKTOP_FLOORPLAN_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12771. HELP_DESKTOP_FLOORPLAN_2B: "Oder verwenden Sie die Pfeiltasten um das Modell nach links oder rechts zu drehen.",
  12772. HELP_DESKTOP_FLOORPLAN_3B: "Oder verwenden Sie die Pfeiltasten zum Vergrößern und Verkleinern.",
  12773. HELP_MOBILE_PANORAMA_1: "Berühren und ziehen an dem Raum um sich umzusehen.",
  12774. HELP_MOBILE_PANORAMA_2: "Klicken Sie auf die Ringe im Raum, um sich zu bewegen.",
  12775. HELP_MOBILE_3: "Benutzen Sie die Zoom-Gäste zum Vergrößern und Verkleinern.",
  12776. HELP_MOBILE_360_2: "Tippen Sie die Innenansicht ikone, um diesen Raum zu starten.",
  12777. HELP_MOBILE_DOLLHOUSE_1: "Berühren und nach oben, unten, links und rechts ziehen um das Puppenhaus zu drehen.",
  12778. HELP_MOBILE_DOLLHOUSE_2: "Berühren und mit zwei Fingern ziehen um das Puppenhaus zu positionieren.",
  12779. HELP_MOBILE_FLOORPLAN_1: "Berühren und ziehen, um den Grundriss zu positionieren.",
  12780. HELP_MOBILE_FLOORPLAN_2: "Berühren und ziehen mit zwei Fingern, um den Grundriss zu drehen.",
  12781. HELP_MORE_HLR_A: "Liste das Highlight",
  12782. HELP_DESKTOP_MORE_HLR_B: "Öffnen um durch den Raum mit Vorschau-Bildern zu navigieren.",
  12783. HELP_MORE_DOLLHOUSE_A: "Puppenhaus Ansicht",
  12784. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Klicken Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  12785. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tippen Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  12786. HELP_MORE_FLOORS_A: "Etage auswählen",
  12787. HELP_DESKTOP_MORE_FLOORS_B: "Zwischen den Etagen im Raum wechseln.",
  12788. HELP_MORE_TAG_A: "tag™ Posts",
  12789. HELP_DESKTOP_MORE_TAG_B: "Klicken Sie auf oder bewegen Sie Ihren Mauszeiger über die Informationen über die Funktionen im Raum.",
  12790. HELP_MOBILE_MORE_TAG_B: "Tippen Sie für Informationen über die Funktionen im Raum.",
  12791. HELP_MORE_ZOOM_A: "Zoom Steuerung",
  12792. HELP_DESKTOP_MORE_ZOOM_B: "Verwenden Sie diese Steuerung oder das Scrollrad zum Vergrößern und Verkleinern.",
  12793. HELP_MORE_TOUR_A: "Tour Steuerung",
  12794. HELP_DESKTOP_MORE_TOUR_B: "Abspielen, pausieren und vorwärts und rückwärts durch eine geführte Tour navigieren.",
  12795. HELP_MORE_INSIDE_A: "Innenansicht",
  12796. HELP_DESKTOP_MORE_INSIDE_B: "Klicken Sie hier um sich im Raum umzusehen.",
  12797. HELP_MOBILE_MORE_INSIDE_B: "Sehen Sie sich in diesen 3D Raum um.",
  12798. HELP_MORE_VR_A: "VR Modus",
  12799. HELP_DESKTOP_MORE_VR_B: "Klicken Sie hier, um den Raum in der virtuellen Realität zu starten.",
  12800. HELP_MOBILE_MORE_VR_B: "Tippen Sie um den Raum in der virtuellen Realität zu starten.",
  12801. HELP_MORE_360_A: "360° Views Ansicht ",
  12802. HELP_DESKTOP_MORE_360_B: "Klicken Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  12803. HELP_MOBILE_MORE_360_B: "Tippen Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  12804. HELP_MORE_FULLSCREEN_A: "Vollbild",
  12805. HELP_DESKTOP_MORE_FULLSCREEN_B: "Erweitern Sie 3D Showcase im Vollbildmodus.",
  12806. WEBVR_FOR_CARDBOARD: "Für Google Cardboard",
  12807. WEBVR_FOR_DAYDREAM: "Für Daydream View",
  12808. WEBVR_ENTER_WEBVR: "Starten Sie VR",
  12809. WEBVR_DIFFERENT_HEADSET: "Haben Sie anderes Headset?",
  12810. WEBVR_LEARN_MORE: "Mehr Infos",
  12811. WEBVR_VIEW_SPACE: "Ansicht des Raumes in VR",
  12812. WEBVR_DAYDREAM_VIEW: "Daydream View",
  12813. WEBVR_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  12814. WEBVR_VIEW_CARDBOARD: "Oder mit Google Cardboard ansehen",
  12815. VR_WHAT_YOU_NEED: "Was Sie dafür brauchen...",
  12816. VR_NEED_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  12817. VR_GOOGLE_DAYDREAM: "Google Daydream",
  12818. VR_APP: "port VR App",
  12819. VR_APP_OPEN: "Oder öffnen Sie die port VR App",
  12820. 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",
  12821. VR_SAMSUNG_DETAIL: "Galaxy S6 und neuer",
  12822. VR_APP_FOR_ANDROID: "port VR app für Android",
  12823. VR_NEED_DAYDREAM: "ERFORDERT VOR DER 'PAIRING' MIT DAYDREAM VIEW",
  12824. VR_VIEW_SPACE: "Ansicht des Raumes in VR",
  12825. VR_LEARN_MORE_CAPS: "MEHR INFOS",
  12826. VR_PREVIOUS_CAPS: "ZURÜCK",
  12827. VR_NEXT_CAPS: "WEITER",
  12828. VR_GOT_IT_CAPS: "VERSTANDEN",
  12829. VR_SHOW_SUPPORTED: "Tippen Sie um den Raum in VR zu sehen",
  12830. VR_SHOW_UNSUPPORTED: "Schade, aber Ihr Gerät erfüllt nicht die Mindestanforderungen um den Raum in VR zu sehen.",
  12831. VR_SHOW_IOS_1: "Tippen Sie um den Raum in VR zu sehen",
  12832. VR_SHOW_IOS_2: "port VR App sowie kompatibles iPhone sind von nöten um diesen Raum zu sehen",
  12833. VR_NEED_CARDBOARD: "Was Sie dafür brauchen ist Google Cardboard",
  12834. VR_NEED_SAMSUNG: "Was Sie dafür brauchen ist Samsung Gear VR",
  12835. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  12836. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  12837. VR_COMPATIBLE_IPHONES_1: "iPhones",
  12838. VR_COMPATIBLE_IPHONES_2: "iPhone 5s oder neuer, mit iOS 9.1 und später",
  12839. VR_COMPATIBLE_IPHONES_3: "Kompatibles iPhones",
  12840. VR_COMPATIBLE_ANDROID: "Kompatibles Android Gerät",
  12841. VR_ANDROID_DETAIL: "Bildschirmdiagonale von 11,5 bis 14 cm (4,5 - 5,5 Zoll) und Android 4.4.4 und neuer",
  12842. VR_ANDROID_DVICES: "Android Geräte",
  12843. VR_COMPATIBLE_SAMSUNG: "Kompatible Samsung Geräte",
  12844. VR_APP_FOR_CARDBOARD: "port VR App für Google Cardboard",
  12845. VR_APP_FOR_SAMSUNG: "port VR App für Gear VR",
  12846. VR_DOWNLOAD_HERE: "Hier runterladen",
  12847. VR_REQUIRE_HEADSET: "Benötigt das ein VR-Headset und port VR App für Android installiert wird",
  12848. VR_REDIRECT_TO_STORE: "Wenn App nicht installiert ist, werden Sie zum App Store umgeleitet.",
  12849. VR_IMPROPER_EMBED: "Der port Raum ist nicht richtig eingebettet um VR in Ihrem Webbrowser zu unterstützen.",
  12850. VR_OPEN_ANDROID_LINK: "Öffnen Sie den Link auf Ihrem Handy",
  12851. VR_ANDROID_OPTIONS: "VR Headset Optionen",
  12852. SHARE_TO: "Teilen auf",
  12853. SHARE_LINK: "Direkter Link",
  12854. SHARE_EXPLORE: "Umsehen",
  12855. SHARE_AT: "auf",
  12856. SHARE_WITH: "mit",
  12857. SHARE_3D: "in 3D",
  12858. SHARE_COPIED: "Kopiert!",
  12859. ERROR_BROWSER_SOLUTION: "Installieren Sie einen neueren Browser um sich in 3D umzusehen.",
  12860. ERROR_BROWSER_EXPLANATION: "WebGL benötigt einen modernen Browser.",
  12861. ERROR_GENERIC_PROBLEM: "Huch, etwas ist schief gelaufen.",
  12862. ERROR_GENERIC_SOLUTION: "Starten Sie Ihren Browser neu.",
  12863. ERROR_GENERIC_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  12864. ERROR_GENERIC_ACTIONS_2: "Installieren Sie einen unterstützten Browser",
  12865. ERROR_GENERIC_ACTIONS_3: " oder ",
  12866. ERROR_GENERIC_ACTIONS_4: "Sehen Sie unseren Leitfaden zur Fehlerbehebung",
  12867. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser wird nicht unterstützt.",
  12868. ERROR_WEBGL_IOS_PROBLEM: "iOS-Version wird nicht unterstützt.",
  12869. ERROR_WEBGL_IOS_SOLUTION: "Aktualisieren Sie auf iOS 8 oder neuer um sich in 3D umzusehen.",
  12870. ERROR_WEBGL_IOS_ACTIONS_1: "Tippen ",
  12871. ERROR_WEBGL_IOS_ACTIONS_2: "Einstellungen > Allgemein > Softwareaktualisierung",
  12872. ERROR_WEBGL_SAFARI_PROBLEM: "Aktivieren Sie WebVR um sich in 3D umzusehen.",
  12873. ERROR_WEBGL_SAFARI_ACTIONS_1: "Klicken ",
  12874. ERROR_WEBGL_SAFARI_ACTIONS_2: "Präferenzen > Fortgeschrittene > Entwickler-Menü anzeigen",
  12875. ERROR_WEBGL_SAFARI_ACTIONS_3: "Klicken Sie dann ",
  12876. ERROR_WEBGL_SAFARI_ACTIONS_4: "Entwickler > WebGL Aktivieren",
  12877. ERROR_MISSING_URLS_PROBLEM: "Huch, es gibt keine Panoramen für dieses Modell .",
  12878. ERROR_MISSING_URLS_EXPLANATION: "Dies ist ein älteres Modell. Der Website-Besitzer hat eventuell ein neues Modell in Arbeit.",
  12879. ERROR_LOADING_FAILED_PROBLEM: "Huch, das Modell ist nicht verfügbar.",
  12880. ERROR_LOADING_FAILED_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  12881. ERROR_LOADING_FAILED_ACTIONS_2: "sehen Sie unseren Leitfaden zur Fehlerbehebung",
  12882. ERROR_MAINTENANCE_PROBLEM: "Wartung im Gange.",
  12883. ERROR_MAINTENANCE_SOLUTION: "Bitte versuchen Sie es in ein paar Minuten nochmal.",
  12884. LINK_TO_LOCATION: "Link zu",
  12885. MENU_COPY: "Kopieren",
  12886. LINK_ALERT_COPY: "Bitte benutzen Sie CTRL/CMD + C zum kopieren.",
  12887. ROTATE: "Drehen",
  12888. INSIDE: "Drinnen",
  12889. MOVE: "Bewegen",
  12890. ZOOM: "Vergrößern"
  12891. }
  12892. }
  12893. , {}],
  12894. 111: [function(e, t, i) {
  12895. "use strict";
  12896. t.exports = {
  12897. PAGE_TITLE: "",
  12898. LOADING: "Loading",
  12899. PRESENTED_BY_CAPS: "PRESENTED BY",
  12900. POWERED_BY: "powered by ",
  12901. POWERED_BY_CAPS: "POWERED BY",
  12902. DESKTOP_SHORT_CTA: "Click to explore this 3D space.",
  12903. MOBILE_SHORT_CTA: "Tap to explore this 3D space.",
  12904. PRESENTED_BY: "Presented by ",
  12905. MORE: "More ",
  12906. LESS: "Less ",
  12907. TAG_CONTENT: "tag™ Content",
  12908. SHOW: "Show",
  12909. HIDE: "Hide",
  12910. DOLLHOUSE: "Dollhouse",
  12911. FLOOR_PLAN: "Floor plan",
  12912. OPEN_HIGHLIGHTS: "Open Highlights",
  12913. CLOSE_HIGHLIGHTS: "Close",
  12914. PREVIOUS: "Previous",
  12915. PLAY: "Play",
  12916. PAUSE: "Pause",
  12917. NEXT: "Next",
  12918. EXPLORE_3D_SPACE: "Explore 3D Space",
  12919. VIEW_DOLLHOUSE: "View dollhouse",
  12920. SOCIAL_SHARING: "Share this Space",
  12921. VIEW_IN_VR: "View in VR",
  12922. VIEW_FULLSCREEN: "全屏",
  12923. EXIT_FULLSCREEN: "退出全屏",
  12924. ZOOM_IN: "Zoom in",
  12925. ZOOM_OUT: "Zoom out",
  12926. FLOOR_NAME: "Floor ",
  12927. FLOOR_ALL: "全部",
  12928. TERMS: "Terms",
  12929. PORT_TERMS: "port terms",
  12930. TERMS_OF_USE: "Terms of Use",
  12931. TERMS_TEXT_FILE: "terms-en-US.html",
  12932. CLOSE_TERMS: "Close",
  12933. TERMS_FAIL: "Could not fetch terms. Please make sure you have an internet connection to view the terms of use.",
  12934. HELP: "Help",
  12935. HELP_NAVIGATION_TAB: "Navigation",
  12936. HELP_MORE_HELP_TAB: "More Help",
  12937. CLOSE: "Close",
  12938. HELP_DESKTOP_PANORAMA_1A: "Click and Drag to look around the Space.",
  12939. HELP_DESKTOP_PANORAMA_2A: "Click on the rings throughout the space to move around.",
  12940. HELP_DESKTOP_PANORAMA_3A: "Use the scroll wheel to zoom in and out.",
  12941. HELP_DESKTOP_PANORAMA_1B: "Or, use the arrow keys to turn left and right.",
  12942. HELP_DESKTOP_PANORAMA_2B: "Or, use the arrow keys to move forward and back.",
  12943. HELP_DESKTOP_PANORAMA_3B: "Or, use the plus and minus keys to zoom in and out.",
  12944. HELP_DESKTOP_360_2A: "Click the Inside View icon to enter the Space.",
  12945. HELP_DESKTOP_360_2B: "Or, press the number 1 key to enter Inside View.",
  12946. HELP_DESKTOP_DOLLHOUSE_1A: "Left click and drag left, right, up, and down to rotate the Dollhouse.",
  12947. HELP_DESKTOP_DOLLHOUSE_2A: "Right click and drag left, right, up, and down to change the Dollhouse position on screen.",
  12948. HELP_DESKTOP_DOLLHOUSE_3A: "Use the scroll wheel to zoom in and out.",
  12949. HELP_DESKTOP_DOLLHOUSE_1B: "Or, use the arrow keys to rotate the Dollhouse.",
  12950. HELP_DESKTOP_FLOORPLAN_1A: "Left click and drag left, right, up, and down to change the Floorplan position on screen.",
  12951. HELP_DESKTOP_FLOORPLAN_2A: "Right click and drag left or right to rotate the Floorplan.",
  12952. HELP_DESKTOP_FLOORPLAN_3A: "Use the scroll wheel to zoom in and out.",
  12953. HELP_DESKTOP_FLOORPLAN_2B: "Or, use the arrow keys to rotate left or right.",
  12954. HELP_DESKTOP_FLOORPLAN_3B: "Or, use the arrow keys to zoom in and out.",
  12955. HELP_MOBILE_PANORAMA_1: "Touch and Drag to look around the Space.",
  12956. HELP_MOBILE_PANORAMA_2: "Tap on the rings throughout the Space to move around.",
  12957. HELP_MOBILE_3: "Use a pinch gesture to zoom in and out.",
  12958. HELP_MOBILE_360_2: "Tap the Inside View icon to enter the Space.",
  12959. HELP_MOBILE_DOLLHOUSE_1: "Touch and drag up, down, left, and right to rotate the Dollhouse.",
  12960. HELP_MOBILE_DOLLHOUSE_2: "Touch and drag with two fingers to position the Dollhouse.",
  12961. HELP_MOBILE_FLOORPLAN_1: "Touch and drag to position the Floorplan.",
  12962. HELP_MOBILE_FLOORPLAN_2: "Touch and drag with two fingers to rotate the Floorplan.",
  12963. HELP_MORE_HLR_A: "Highlight Reel",
  12964. HELP_DESKTOP_MORE_HLR_B: "Open to navigate through the Space using thumbnail images.",
  12965. HELP_MORE_DOLLHOUSE_A: "Dollhouse View",
  12966. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Click to view and rotate a top-down view of the entire Space in 3D.",
  12967. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tap to view and rotate a top-down view of the entire Space in 3D.",
  12968. HELP_MORE_FLOORS_A: "Floor Selector",
  12969. HELP_DESKTOP_MORE_FLOORS_B: "Switch between floors in the Space.",
  12970. HELP_MORE_TAG_A: "tag™ Posts",
  12971. HELP_DESKTOP_MORE_TAG_B: "Click or hover over for information about features in the Space.",
  12972. HELP_MOBILE_MORE_TAG_B: "Tap for information about features in the Space.",
  12973. HELP_MORE_ZOOM_A: "Zoom Controls",
  12974. HELP_DESKTOP_MORE_ZOOM_B: "Use these controls to zoom in and out or use the scroll wheel.",
  12975. HELP_MORE_TOUR_A: "Tour Controls",
  12976. HELP_DESKTOP_MORE_TOUR_B: "Play, pause, and navigate forward and backward through a Guided Tour.",
  12977. HELP_MORE_INSIDE_A: "Inside View",
  12978. HELP_DESKTOP_MORE_INSIDE_B: "Click to explore inside the Space.",
  12979. HELP_MOBILE_MORE_INSIDE_B: "Tap to explore inside the Space.",
  12980. HELP_MORE_VR_A: "VR Mode",
  12981. HELP_DESKTOP_MORE_VR_B: "Click to launch the Space in virtual reality.",
  12982. HELP_MOBILE_MORE_VR_B: "Tap to launch the Space in virtual reality.",
  12983. HELP_MORE_360_A: "360° Views",
  12984. HELP_DESKTOP_MORE_360_B: "Click 360 Views in the Highlight Reel to view outdoor scenes.",
  12985. HELP_MOBILE_MORE_360_B: "Tap 360 Views in the Highlight Reel to view outdoor scenes.",
  12986. HELP_MORE_FULLSCREEN_A: "Full screen",
  12987. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expand 3D Showcase to full screen.",
  12988. WEBVR_FOR_CARDBOARD: "For Google Cardboard",
  12989. WEBVR_VIEW_CARDBOARD: "Or View on Google Cardboard",
  12990. WEBVR_FOR_DAYDREAM: "For Daydream View",
  12991. WEBVR_ENTER_WEBVR: "ENTER VR",
  12992. WEBVR_DIFFERENT_HEADSET: "Have a different headset?",
  12993. WEBVR_LEARN_MORE: "Learn more",
  12994. WEBVR_VIEW_SPACE: "View Space in VR",
  12995. WEBVR_DAYDREAM_VIEW: "Daydream View",
  12996. WEBVR_DAYDREAM_PHONE: "Daydream-ready phone",
  12997. VR_VIEW_SPACE: "View Space in Virtual Reality",
  12998. VR_LEARN_MORE_CAPS: "LEARN MORE",
  12999. VR_PREVIOUS_CAPS: "PREVIOUS",
  13000. VR_NEXT_CAPS: "NEXT",
  13001. VR_GOT_IT_CAPS: "GOT IT",
  13002. VR_SHOW_SUPPORTED: "Tap to view the Space in VR with",
  13003. VR_SHOW_UNSUPPORTED: "Sorry, but your device doesn't meet the minimum requirements to view a space in VR.",
  13004. VR_SHOW_IOS_1: "Tap to view the space in VR",
  13005. VR_SHOW_IOS_2: "Requires port VR app and compatible iPhone to view",
  13006. VR_WHAT_YOU_NEED: "What You'll Need For...",
  13007. VR_NEED_CARDBOARD: "What you'll need with Google Cardboard",
  13008. VR_NEED_SAMSUNG: "What you'll need with Samsung Gear VR",
  13009. VR_NEED_DAYDREAM: "NEEDS PRIOR PAIRING WITH DAYDREAM VIEW",
  13010. VR_NEED_DAYDREAM_PHONE: "Daydream-ready phone",
  13011. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13012. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13013. VR_APP: "port VR App",
  13014. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13015. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13016. VR_COMPATIBLE_IPHONES_2: "iPhone 5s and newer, running iOS 9.1 and higher",
  13017. VR_COMPATIBLE_IPHONES_3: "Compatible iPhones",
  13018. VR_COMPATIBLE_ANDROID: "Compatible Android Devices",
  13019. VR_COMPATIBLE_ANDROID_LONG: 'Compatible Android Devices Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13020. VR_ANDROID_DETAIL: 'Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13021. VR_ANDROID_DVICES: "Android Devices",
  13022. VR_COMPATIBLE_SAMSUNG: "Compatible Samsung Devices",
  13023. VR_SAMSUNG_DETAIL: "Galaxy S6 and Above",
  13024. VR_APP_FOR_CARDBOARD: "port VR app for Google Cardboard",
  13025. VR_APP_FOR_SAMSUNG: "port VR app for Gear VR",
  13026. VR_APP_FOR_ANDROID: "port VR app for Android Phones",
  13027. VR_APP_OPEN: "Open with the port VR app instead",
  13028. VR_DOWNLOAD_HERE: "Download here",
  13029. VR_REQUIRE_HEADSET: "Requires a VR headset and port VR app for Android to be installed",
  13030. VR_REDIRECT_TO_STORE: "If app is not installed, you will be redirected to the app store.",
  13031. VR_IMPROPER_EMBED: "The port Space is not embedded properly to support VR in your web browser.",
  13032. VR_OPEN_ANDROID_LINK: "Open the Link on Your Mobile Phone",
  13033. VR_ANDROID_OPTIONS: "Available VR Headset Options",
  13034. SHARE_TO: "Share to",
  13035. SHARE_LINK: "Direct Link",
  13036. SHARE_EXPLORE: "Explore ",
  13037. SHARE_AT: "at",
  13038. SHARE_WITH: "with",
  13039. SHARE_3D: " in 3D",
  13040. SHARE_COPIED: "Copied!",
  13041. ERROR_BROWSER_SOLUTION: "Install a new browser to explore in 3D.",
  13042. ERROR_BROWSER_EXPLANATION: "WebGL requires a modern browser.",
  13043. ERROR_GENERIC_PROBLEM: "Oops, something went wrong.",
  13044. ERROR_GENERIC_SOLUTION: "Restart your browser.",
  13045. ERROR_GENERIC_ACTIONS_1: "If the problem persists, ",
  13046. ERROR_GENERIC_ACTIONS_2: "install a supported browser",
  13047. ERROR_GENERIC_ACTIONS_3: " or ",
  13048. ERROR_GENERIC_ACTIONS_4: "see our troubleshooting guide",
  13049. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser not supported.",
  13050. ERROR_WEBGL_IOS_PROBLEM: "iOS version not supported.",
  13051. ERROR_WEBGL_IOS_SOLUTION: "Upgrade to iOS 8 or higher to explore in 3D.",
  13052. ERROR_WEBGL_IOS_ACTIONS_1: "Tap ",
  13053. ERROR_WEBGL_IOS_ACTIONS_2: "Settings > General > Software Update",
  13054. ERROR_WEBGL_SAFARI_PROBLEM: "Enable WebGL to explore in 3D.",
  13055. ERROR_WEBGL_SAFARI_ACTIONS_1: "Click ",
  13056. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferences > Advanced > Show Develop menu",
  13057. ERROR_WEBGL_SAFARI_ACTIONS_3: "Then click ",
  13058. ERROR_WEBGL_SAFARI_ACTIONS_4: "Develop > Enable WebGL",
  13059. ERROR_MISSING_URLS_PROBLEM: "Oops, there are no panoramas for this model.",
  13060. ERROR_MISSING_URLS_EXPLANATION: "This is an older model. The website owner may have a new model on the way.",
  13061. ERROR_LOADING_FAILED_PROBLEM: "模型不可用.",
  13062. ERROR_LOADING_FAILED_ACTIONS_1: "If the problem persists, ",
  13063. ERROR_LOADING_FAILED_ACTIONS_2: "see our troubleshooting guide",
  13064. ERROR_MAINTENANCE_PROBLEM: "Maintenance in progress.",
  13065. ERROR_MAINTENANCE_SOLUTION: "Please come back in a few minutes.",
  13066. LINK_TO_LOCATION: "Link to location",
  13067. MENU_COPY: "Copy",
  13068. LINK_ALERT_COPY: "Please use CTRL/CMD + C to copy.",
  13069. ROTATE: "Rotate",
  13070. INSIDE: "Inside",
  13071. MOVE: "Move",
  13072. ZOOM: "Zoom"
  13073. }
  13074. }
  13075. , {}],
  13076. 112: [function(e, t, i) {
  13077. "use strict";
  13078. t.exports = {
  13079. PAGE_TITLE: "",
  13080. LOADING: "Cargando",
  13081. PRESENTED_BY_CAPS: "PRESENTADO POR",
  13082. POWERED_BY: "potenciando por ",
  13083. POWERED_BY_CAPS: "POTENCIADO POR ",
  13084. DESKTOP_SHORT_CTA: "Haga clic para explorar este Espacio 3D.",
  13085. MOBILE_SHORT_CTA: "Pulse para explorar este Espacio 3D.",
  13086. PRESENTED_BY: "Presentado por ",
  13087. MORE: "Más ",
  13088. LESS: "Menos ",
  13089. TAG_CONTENT: "Contenido de tag™",
  13090. SHOW: "Mostrar",
  13091. HIDE: "Ocultar",
  13092. DOLLHOUSE: "Dollhouse",
  13093. FLOOR_PLAN: "Planos",
  13094. OPEN_HIGHLIGHTS: "Aspectos Destacados",
  13095. CLOSE_HIGHLIGHTS: "Cerrar",
  13096. PREVIOUS: "Anterior",
  13097. PLAY: "Play",
  13098. PAUSE: "Pausa",
  13099. NEXT: "Siguiente",
  13100. EXPLORE_3D_SPACE: "Explorar el Espacio 3D",
  13101. VIEW_DOLLHOUSE: "Ver dollhouse",
  13102. SOCIAL_SHARING: "Compartir este espacio",
  13103. VIEW_IN_VR: "Ver en realidad virtual",
  13104. VIEW_FULLSCREEN: "Ver en pantalla completa",
  13105. EXIT_FULLSCREEN: "Salir de pantalla completa",
  13106. ZOOM_IN: "Acercar",
  13107. ZOOM_OUT: "Alejar",
  13108. FLOOR_NAME: "Piso ",
  13109. FLOOR_ALL: "Todas",
  13110. TERMS: "Condiciones",
  13111. PORT_TERMS: "port términos de uso",
  13112. TERMS_OF_USE: "Términos de uso",
  13113. TERMS_TEXT_FILE: "terms-es-MX.html",
  13114. CLOSE_TERMS: "Cerrar",
  13115. 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.",
  13116. HELP: "Ayuda",
  13117. HELP_NAVIGATION_TAB: "Navegación",
  13118. HELP_MORE_HELP_TAB: "Más Ayuda",
  13119. CLOSE: "Cerrar",
  13120. HELP_DESKTOP_PANORAMA_1A: "Haga clic y arrastre para mirar alrededor del espacio.",
  13121. HELP_DESKTOP_PANORAMA_2A: "Haga clic en los aros a lo largo del espacio para moverse.",
  13122. HELP_DESKTOP_PANORAMA_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13123. HELP_DESKTOP_PANORAMA_1B: "O use las teclas de flecha para girar a la izquierda y a la derecha.",
  13124. HELP_DESKTOP_PANORAMA_2B: "O use las teclas de dirección para adelantar o retroceder.",
  13125. HELP_DESKTOP_PANORAMA_3B: "O use la tecla más para acercar y la tecla menos para alejar.",
  13126. HELP_DESKTOP_360_2A: "Haga clic en el icono Vista Interior para ingresar al Espacio.",
  13127. HELP_DESKTOP_360_2B: "O bien, presione la tecla numero 1 para entrar en la Vista Interior.",
  13128. HELP_DESKTOP_DOLLHOUSE_1A: "Haga clic izquierdo y arrastre hacia la izquierda, derecha, arriba o abajo para girar la Dollhouse.",
  13129. HELP_DESKTOP_DOLLHOUSE_2A: "Haga clic derecho y arrastre hacia la izquierda, derecha, arriba o abajo para cambiar la posición della dollhouse.",
  13130. HELP_DESKTOP_DOLLHOUSE_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13131. HELP_DESKTOP_DOLLHOUSE_1B: "O use las teclas de dirección para girar la Dollhouse.",
  13132. 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.",
  13133. HELP_DESKTOP_FLOORPLAN_2A: "Haga clic derecho y arrastre hacia la izquierda o derecha para girar la planta.",
  13134. HELP_DESKTOP_FLOORPLAN_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13135. HELP_DESKTOP_FLOORPLAN_2B: "O use las teclas para girar hacia la izquierda o derecha.",
  13136. HELP_DESKTOP_FLOORPLAN_3B: "O use las teclas de dirección para acercar o alejar.",
  13137. HELP_MOBILE_PANORAMA_1: "Toque y arrastre para mirar alrededor del espacio.",
  13138. HELP_MOBILE_PANORAMA_2: "Toque en los aros a lo largo del espacio para moverse.",
  13139. HELP_MOBILE_3: "Use el gesto de pellizcar para acercar o alejar.",
  13140. HELP_MOBILE_360_2: "Toque el ícono Vista Interior para entrar en el Espacio.",
  13141. HELP_MOBILE_DOLLHOUSE_1: "Toque y arrastre con dos dedos para cambiar la posición della dollhouse.",
  13142. HELP_MOBILE_DOLLHOUSE_2: "Toque y arrastre con dos dedos para cambiar la posición de la vista aérea.",
  13143. HELP_MOBILE_FLOORPLAN_1: "Toque y arrastre para cambiar la posición de la planta.",
  13144. HELP_MOBILE_FLOORPLAN_2: "Toque y arrastre con dos dedos para girar la planta.",
  13145. HELP_MORE_HLR_A: "Galería destacada",
  13146. HELP_DESKTOP_MORE_HLR_B: "Abra para navegar a través del espacio utilizando imágenes en miniatura.",
  13147. HELP_MORE_DOLLHOUSE_A: "Vista aérea por pisos",
  13148. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Haga clic para ver y girar la Dollhouse del espacio completo en 3D.",
  13149. HELP_MOBILE_MORE_DOLLHOUSE_B: "Toque para ver y girar la vista Dollhouse del espacio completo en 3D.",
  13150. HELP_MORE_FLOORS_A: "Seleccionador de plantas",
  13151. HELP_DESKTOP_MORE_FLOORS_B: "Cambie de una planta a otra en el espacio.",
  13152. HELP_MORE_TAG_A: "tag™ Posts",
  13153. HELP_DESKTOP_MORE_TAG_B: "Haga clic o coloque el cursor para obtener más información acerca de las características del espacio.",
  13154. HELP_MOBILE_MORE_TAG_B: "Toque para obtener más información acerca de las características del espacio.",
  13155. HELP_MORE_ZOOM_A: "Controles de zoom",
  13156. HELP_DESKTOP_MORE_ZOOM_B: "Use estos controles o la rueda de desplazamiento para acercar o alejar.",
  13157. HELP_MORE_TOUR_A: "Controles de recorrido",
  13158. HELP_DESKTOP_MORE_TOUR_B: "Reproduzca, pause, adelante o retroceda a través de un recorrido guiado.",
  13159. HELP_MORE_INSIDE_A: "Vista interior",
  13160. HELP_DESKTOP_MORE_INSIDE_B: "Haga clic para explorar el interior del espacio.",
  13161. HELP_MOBILE_MORE_INSIDE_B: "Toque para explorar el interior del espacio.",
  13162. HELP_MORE_VR_A: "Modo de realidad virtual",
  13163. HELP_DESKTOP_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13164. HELP_MOBILE_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13165. HELP_MORE_360_A: "360° Views",
  13166. HELP_DESKTOP_MORE_360_B: "Una vez que se encuentre en galería destacada, haga clic en vistas de 360º para ver el exterior.",
  13167. HELP_MOBILE_MORE_360_B: "Una vez que se encuentre en galería destacada, toque en vistas de 360º para ver el exterior.",
  13168. HELP_MORE_FULLSCREEN_A: "Pantalla completa",
  13169. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expanda el escenario 3D para verlo en pantalla completa.",
  13170. WEBVR_FOR_CARDBOARD: "Para Google Cardboard",
  13171. WEBVR_FOR_DAYDREAM: "Para Daydream View",
  13172. WEBVR_ENTER_WEBVR: "ENTRAR VR",
  13173. WEBVR_DIFFERENT_HEADSET: "¿Tiene un auricular diferente?",
  13174. WEBVR_LEARN_MORE: "Más información",
  13175. WEBVR_VIEW_SPACE: "Ver Espacio en VR",
  13176. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13177. WEBVR_DAYDREAM_PHONE: "Daydream Teléfono listos",
  13178. WEBVR_VIEW_CARDBOARD: "O Ver en Google Cardboard",
  13179. VR_NEED_DAYDREAM: "Necesidades antes de acoplarse con Daydream View",
  13180. VR_NEED_DAYDREAM_PHONE: "Teléfono listo para Daydream",
  13181. VR_GOOGLE_DAYDREAM: "Daydream de Google",
  13182. VR_APP: "port VR App",
  13183. VR_COMPATIBLE_ANDROID_LONG: 'Compatible con los Dispositivos Android con Pantallas de 4.5"-5.5" operando Android OS 4.4.4 y posteriores',
  13184. VR_APP_FOR_ANDROID: "Aplicación port VR para Teléfonos Android",
  13185. VR_APP_OPEN: "Abrir con la aplicación port VR en su lugar",
  13186. VR_VIEW_SPACE: "Ver Espacio en realidad virtual",
  13187. VR_LEARN_MORE_CAPS: "SABER MÁS",
  13188. VR_PREVIOUS_CAPS: "ANTERIOR",
  13189. VR_NEXT_CAPS: "SIGUIENTE",
  13190. VR_GOT_IT_CAPS: "COMPRENDIDO",
  13191. VR_SHOW_SUPPORTED: "Pulse para ver el Espacio en realidad virtual con",
  13192. VR_SHOW_UNSUPPORTED: "Lo sentimos, pero su dispositivo no cumple los requisitos mínimos para ver un Espacio en realidad virtual.",
  13193. VR_SHOW_IOS_1: "Pulse para ver el Espacio en realidad virtual",
  13194. VR_SHOW_IOS_2: "Necesita la aplicación port VR y un iPhone compatible para ver",
  13195. VR_WHAT_YOU_NEED: "Lo que necesitaras...",
  13196. VR_NEED_CARDBOARD: "Lo que necesitaras con Google Cardboard",
  13197. VR_NEED_SAMSUNG: "Lo que necesitaras con el Samsung Gear VR",
  13198. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13199. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13200. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13201. VR_COMPATIBLE_IPHONES_2: "Compatible con iPhone 6S o superior y con iOS 9.1 en adelante",
  13202. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13203. VR_COMPATIBLE_ANDROID: "Dispositivos Android compatibles",
  13204. VR_ANDROID_DETAIL: "Pantallas de 11.43 cm a 13.97 cm con OS de Android 4.4.4 en adelante",
  13205. VR_ANDROID_DVICES: "Dispositivos Android",
  13206. VR_COMPATIBLE_SAMSUNG: "Dispositivos compatibles del Samsung",
  13207. VR_SAMSUNG_DETAIL: "Galaxy S5 en adelante",
  13208. VR_APP_FOR_CARDBOARD: "Aplicación port VR para Google Cardboard",
  13209. VR_APP_FOR_SAMSUNG: "Aplicación port VR para Gear VR",
  13210. VR_DOWNLOAD_HERE: "Descargar aquí",
  13211. VR_REQUIRE_HEADSET: "Necesita un casco de realidad virtual y que se instale la aplicación port VR para Android",
  13212. VR_REDIRECT_TO_STORE: "Si la aplicación no está instalada, se le redirigirá a la tienda de aplicaciones.",
  13213. VR_IMPROPER_EMBED: "El espacio de port no está incorporado correctamente para apoyar VR en su navegador web.",
  13214. VR_OPEN_ANDROID_LINK: "Abre el enlace en tu teléfono móvil",
  13215. VR_ANDROID_OPTIONS: "Opciones de auriculares en RV disponibles",
  13216. SHARE_TO: "Compartir en",
  13217. SHARE_LINK: "Enlace directo",
  13218. SHARE_EXPLORE: "Explorar ",
  13219. SHARE_AT: "en",
  13220. SHARE_WITH: "con",
  13221. SHARE_3D: " en 3D",
  13222. SHARE_COPIED: "¡Copiado!",
  13223. ERROR_BROWSER_SOLUTION: "Instale un nuevo navegador para explorar en 3D.",
  13224. ERROR_BROWSER_EXPLANATION: "WebGL requiere un navegador moderno.",
  13225. ERROR_GENERIC_PROBLEM: "Vaya, algo ha ido mal.",
  13226. ERROR_GENERIC_SOLUTION: "Reinicie su navegador.",
  13227. ERROR_GENERIC_ACTIONS_1: "Si el problema persiste, ",
  13228. ERROR_GENERIC_ACTIONS_2: "instale un navegador compatible",
  13229. ERROR_GENERIC_ACTIONS_3: " o ",
  13230. ERROR_GENERIC_ACTIONS_4: "consulte nuestra guía de solución de problemas",
  13231. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navegador no compatible.",
  13232. ERROR_WEBGL_IOS_PROBLEM: "Versión de iOS no compatible.",
  13233. ERROR_WEBGL_IOS_SOLUTION: "Actualice a iOS 8 o superior para explorar en 3D.",
  13234. ERROR_WEBGL_IOS_ACTIONS_1: "Pulse ",
  13235. ERROR_WEBGL_IOS_ACTIONS_2: "Ajustes > General > Actualización de software",
  13236. ERROR_WEBGL_SAFARI_PROBLEM: "Habilite WebGL para explorar en 3D.",
  13237. ERROR_WEBGL_SAFARI_ACTIONS_1: "Haga clic en ",
  13238. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferencias > Avanzado > Mostrar el menú Desarrollar",
  13239. ERROR_WEBGL_SAFARI_ACTIONS_3: "Después, haga clic en ",
  13240. ERROR_WEBGL_SAFARI_ACTIONS_4: "Desarrollar > Habilitar WebGL",
  13241. ERROR_MISSING_URLS_PROBLEM: "Vaya, no hay panoramas para este modelo.",
  13242. ERROR_MISSING_URLS_EXPLANATION: "Este es un modelo antiguo. El propietario del sitio web puede tener un nuevo modelo en mente.",
  13243. ERROR_LOADING_FAILED_PROBLEM: "Vaya, modelo no disponible.",
  13244. ERROR_LOADING_FAILED_ACTIONS_1: "Si el problema persiste, ",
  13245. ERROR_LOADING_FAILED_ACTIONS_2: "consulte nuestra guía de solución de problemas",
  13246. ERROR_MAINTENANCE_PROBLEM: "Mantenimiento en progreso.",
  13247. ERROR_MAINTENANCE_SOLUTION: "Regrese en unos minutos.",
  13248. LINK_TO_LOCATION: "Enlace a la ubicación",
  13249. MENU_COPY: "Copiar",
  13250. LINK_ALERT_COPY: "Utilice CTRL/CMD + C para copiar.",
  13251. ROTATE: "Girar",
  13252. INSIDE: "Interior",
  13253. MOVE: "Moverse",
  13254. ZOOM: "Acercar o alejar"
  13255. }
  13256. }
  13257. , {}],
  13258. 113: [function(e, t, i) {
  13259. "use strict";
  13260. t.exports = {
  13261. PAGE_TITLE: "",
  13262. LOADING: "Chargement",
  13263. PRESENTED_BY_CAPS: "PRÉSENTÉ PAR",
  13264. POWERED_BY: "alimenté par ",
  13265. POWERED_BY_CAPS: "ALIMENTÉ PAR",
  13266. DESKTOP_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13267. MOBILE_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13268. PRESENTED_BY: "Présenté par ",
  13269. MORE: "Plus ",
  13270. LESS: "Moins ",
  13271. TAG_CONTENT: "Contenu tag™",
  13272. SHOW: "Montrer",
  13273. HIDE: "Cacher",
  13274. DOLLHOUSE: "Dollhouse",
  13275. FLOOR_PLAN: "Plan de sol",
  13276. OPEN_HIGHLIGHTS: "Ouvrir les faits saillants",
  13277. CLOSE_HIGHLIGHTS: "Fermer",
  13278. PREVIOUS: "Précédent",
  13279. PLAY: "Lecture",
  13280. PAUSE: "Pause",
  13281. NEXT: "Suivant",
  13282. EXPLORE_3D_SPACE: "Explorer l'Espace en 3D",
  13283. VIEW_DOLLHOUSE: "Voir dollhouse",
  13284. SOCIAL_SHARING: "Partager cet espace",
  13285. VIEW_IN_VR: "Voir en VR",
  13286. VIEW_FULLSCREEN: "Plein écran",
  13287. EXIT_FULLSCREEN: "Fermer plein écran",
  13288. ZOOM_IN: "Zoom avant",
  13289. ZOOM_OUT: "Zoom arrière",
  13290. FLOOR_NAME: "Étage ",
  13291. FLOOR_ALL: "Tous",
  13292. TERMS: "Mentions légales",
  13293. PORT_TERMS: "port mentions légales",
  13294. TERMS_OF_USE: "Conditions d'utilisation",
  13295. TERMS_TEXT_FILE: "terms-fr-FR.html",
  13296. CLOSE_TERMS: "Fermer",
  13297. TERMS_FAIL: "Impossible d'accéder aux mentions légales. Vérifiez que vous avez une connexion Internet pour afficher les conditions d'utilisation.",
  13298. HELP: "Aide",
  13299. HELP_NAVIGATION_TAB: "Navigation",
  13300. HELP_MORE_HELP_TAB: "Aide",
  13301. CLOSE: "Fermer",
  13302. HELP_DESKTOP_PANORAMA_1A: "Cliquez et faites glisser pour regarder autour de l’espace.",
  13303. HELP_DESKTOP_PANORAMA_2A: "Cliquez sur les anneaux pour vous déplacer.",
  13304. HELP_DESKTOP_PANORAMA_3A: "Utilisez la molette de votre souris pour zoomer.",
  13305. HELP_DESKTOP_PANORAMA_1B: "Ou utilisez les touches pour tourner.",
  13306. HELP_DESKTOP_PANORAMA_2B: "Ou utilisez les touches pour avancer et reculer.",
  13307. HELP_DESKTOP_PANORAMA_3B: "Ou utilisez les touches plus et moins pour zoomer.",
  13308. HELP_DESKTOP_360_2A: "Cliquez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13309. HELP_DESKTOP_360_2B: "Ou, appuyez sur la touche numéro 1 pour entrer dans la Vue Intérieure.",
  13310. HELP_DESKTOP_DOLLHOUSE_1A: "Faites un clic gauche et bougez votre souris pour faire pivoter la vue Dollhouse.",
  13311. HELP_DESKTOP_DOLLHOUSE_2A: "Faites un clic droit et bougez votre souris pour changer la position de la vue Dollhouse.",
  13312. HELP_DESKTOP_DOLLHOUSE_3A: "Utilisez la molette de votre souris pour zoomer.",
  13313. HELP_DESKTOP_DOLLHOUSE_1B: "Ou utilisez les touches pour faire pivoter la vue Dollhouse.",
  13314. HELP_DESKTOP_FLOORPLAN_1A: "Faites un clic droit pour changer la position du plan sur l’écran.",
  13315. HELP_DESKTOP_FLOORPLAN_2A: "Faites un clic droit et faites glisser à gauche ou à droite pour faire pivoter le plan.",
  13316. HELP_DESKTOP_FLOORPLAN_3A: "Utilisez la molette de votre souris pour zoomer.",
  13317. HELP_DESKTOP_FLOORPLAN_2B: "Ou utilisez les touches pour faire pivoter à gauche ou à droite.",
  13318. HELP_DESKTOP_FLOORPLAN_3B: "Ou utilisez les touches pour effectuer un zoom avant ou arrière.",
  13319. HELP_MOBILE_PANORAMA_1: "Touchez et faites glisser pour regarder autour de l’espace.",
  13320. HELP_MOBILE_PANORAMA_2: "Tapez sur les anneaux dans tout l’espace pour vous déplacer.",
  13321. HELP_MOBILE_3: "Utilisez un geste de pincement pour zoomer avant/arrière.",
  13322. HELP_MOBILE_360_2: "Tapez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13323. HELP_MOBILE_DOLLHOUSE_1: "Touchez et faites glisser vers le haut/bas/gauche/droite pour faire pivoter la vue Dollhouse.",
  13324. HELP_MOBILE_DOLLHOUSE_2: "Touchez et faites glisser avec deux doigts pour positionner vue en coupe.",
  13325. HELP_MOBILE_FLOORPLAN_1: "Touchez et faites glisser pour positionner le plan.",
  13326. HELP_MOBILE_FLOORPLAN_2: "Touchez et faites glisser avec deux doigts pour faire pivoter le plan.",
  13327. HELP_MORE_HLR_A: "Carrousel",
  13328. HELP_DESKTOP_MORE_HLR_B: "Ouvrez pour naviguer dans l’espace en utilisant les vignettes.",
  13329. HELP_MORE_DOLLHOUSE_A: "Vue en coupe",
  13330. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Cliquez pour afficher et faire pivoter l’espace entier en 3D.",
  13331. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tapez pour afficher et faire pivoter l’espace entier en 3D.",
  13332. HELP_MORE_FLOORS_A: "Sélecteur d’étage",
  13333. HELP_DESKTOP_MORE_FLOORS_B: "Basculer entre les étages dans l’espace.",
  13334. HELP_MORE_TAG_A: "tag™ Posts",
  13335. HELP_DESKTOP_MORE_TAG_B: "Cliquez ou survolez pour obtenir des informations sur l’espace.",
  13336. HELP_MOBILE_MORE_TAG_B: "Tapez pour obtenir des informations sur l’espace.",
  13337. HELP_MORE_ZOOM_A: "Commandes de zoom",
  13338. HELP_DESKTOP_MORE_ZOOM_B: "Utilisez votre clavier ou la molette de votre souris pour zoomer.",
  13339. HELP_MORE_TOUR_A: "Commandes de la visite",
  13340. HELP_DESKTOP_MORE_TOUR_B: "Mettez en marche ou en pause, avancez et reculez lors d'une visite guidée.",
  13341. HELP_MORE_INSIDE_A: "Vue intérieure",
  13342. HELP_DESKTOP_MORE_INSIDE_B: "Cliquez pour explorer l’intérieur de l’espace.",
  13343. HELP_MOBILE_MORE_INSIDE_B: "Tapez pour explorer l’intérieur de l’espace.",
  13344. HELP_MORE_VR_A: "Mode RV",
  13345. HELP_DESKTOP_MORE_VR_B: "Cliquez pour lancer l’espace en réalité virtuelle.",
  13346. HELP_MOBILE_MORE_VR_B: "Tapez pour lancer l’espace en réalité virtuelle.",
  13347. HELP_MORE_360_A: "Vues 360°",
  13348. HELP_DESKTOP_MORE_360_B: "Cliquez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13349. HELP_MOBILE_MORE_360_B: "Tapez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13350. HELP_MORE_FULLSCREEN_A: "Plein écran",
  13351. HELP_DESKTOP_MORE_FULLSCREEN_B: "Voir 3D Showcase en plein écran.",
  13352. WEBVR_FOR_CARDBOARD: "Pour Google Cardboard",
  13353. WEBVR_FOR_DAYDREAM: "Pour Daydream View",
  13354. WEBVR_ENTER_WEBVR: "ENTRER VR",
  13355. WEBVR_DIFFERENT_HEADSET: "Avez-vous un casque différent?",
  13356. WEBVR_LEARN_MORE: "En savoir plus",
  13357. WEBVR_VIEW_SPACE: "Voir Espace en VR",
  13358. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13359. WEBVR_DAYDREAM_PHONE: "Téléphone compatibles Daydream",
  13360. WEBVR_VIEW_CARDBOARD: "Ou Afficher sur Google Cardboard",
  13361. VR_VIEW_SPACE: "Voir l'Espace en Réalité Virtuelle",
  13362. VR_LEARN_MORE_CAPS: "EN SAVOIR PLUS",
  13363. VR_PREVIOUS_CAPS: "PRÉCÉDENT",
  13364. VR_NEXT_CAPS: "SUIVANT",
  13365. VR_GOT_IT_CAPS: "BIEN COMPRIS",
  13366. VR_SHOW_SUPPORTED: "Taper pour voir l'Espace en VR avec",
  13367. VR_SHOW_UNSUPPORTED: "Désolé mais votre appareil ne répond pas aux critères minimaux pour voir cet Espace en mode VR.",
  13368. VR_SHOW_IOS_1: "Taper pour voir l’Espace en Realité Virtuelle",
  13369. VR_SHOW_IOS_2: "Nécessite l’application port VR et un iPhone compatible pour voir",
  13370. VR_WHAT_YOU_NEED: "Ce dont vous aurez besoin pour...",
  13371. VR_NEED_CARDBOARD: "Ce dont vous aurez besoin avec Google Cardboard",
  13372. VR_NEED_SAMSUNG: "Ce dont vous aurez besoin avec Samsung Gear VR",
  13373. VR_NEED_DAYDREAM: "BESOINS AVANT APPARIEMENT AVEC DAYDREAM VIEW",
  13374. VR_NEED_DAYDREAM_PHONE: "Téléphone compatible avec Daydream",
  13375. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13376. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13377. VR_APP: "port VR App",
  13378. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13379. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13380. VR_COMPATIBLE_IPHONES_2: "iPhone 5s et plus récent, avec iOS 9.1 et plus récent",
  13381. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13382. VR_COMPATIBLE_ANDROID: "Appareils Android compatibles",
  13383. 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",
  13384. VR_ANDROID_DETAIL: 'Écrans 4.5" à 5.5" avec Android 4.4.4 ou plus récent',
  13385. VR_ANDROID_DVICES: "Appareils Android",
  13386. VR_COMPATIBLE_SAMSUNG: "Appareils Samsung Compatibles",
  13387. VR_SAMSUNG_DETAIL: "Galaxy S6 et plus récents",
  13388. VR_APP_FOR_CARDBOARD: "Application port VR pour Google Cardboard",
  13389. VR_APP_FOR_SAMSUNG: "Application port VR pour Gear VR",
  13390. VR_APP_FOR_ANDROID: "Application port VR pour téléphones Android",
  13391. VR_APP_OPEN: "Ouvrir plutôt avec l’application port VR",
  13392. VR_DOWNLOAD_HERE: "Télécharger ici",
  13393. VR_REQUIRE_HEADSET: "Nécessite un casque VR et l'application port VR pour Android afin d'être installé",
  13394. VR_REDIRECT_TO_STORE: "Si l'application n'est pas installée, vous serez rediriger vers l'App store.",
  13395. VR_IMPROPER_EMBED: "L'Espace port n'est pas correctement intégré pour supporter VR dans votre navigateur Web.",
  13396. VR_OPEN_ANDROID_LINK: "Ouvrez ce lien avec votre appareil mobile",
  13397. VR_ANDROID_OPTIONS: "Options disponibles pour casque VR sous",
  13398. SHARE_TO: "Partager sur",
  13399. SHARE_LINK: "Lien direct",
  13400. SHARE_EXPLORE: "Explorer ",
  13401. SHARE_AT: "à",
  13402. SHARE_WITH: "avec",
  13403. SHARE_3D: " en 3D",
  13404. SHARE_COPIED: "Copié!",
  13405. ERROR_BROWSER_SOLUTION: "Installer un nouveau navigateur pour explorer en 3D.",
  13406. ERROR_BROWSER_EXPLANATION: "WebGL a besoin d'un navigateur récent.",
  13407. ERROR_GENERIC_PROBLEM: "Il y eu un problème.",
  13408. ERROR_GENERIC_SOLUTION: "Redémarrer votre navigateur.",
  13409. ERROR_GENERIC_ACTIONS_1: "Si le problème persiste, ",
  13410. ERROR_GENERIC_ACTIONS_2: "installez un navigateur plus récent",
  13411. ERROR_GENERIC_ACTIONS_3: " ou ",
  13412. ERROR_GENERIC_ACTIONS_4: "voir notre guide de dépannage",
  13413. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navigateur non-supporté.",
  13414. ERROR_WEBGL_IOS_PROBLEM: "Version iOS non-supportée.",
  13415. ERROR_WEBGL_IOS_SOLUTION: "Mettre à jour avec iOS8 au minimum pour voir l'Espace en 3D.",
  13416. ERROR_WEBGL_IOS_ACTIONS_1: "Tapez ",
  13417. ERROR_WEBGL_IOS_ACTIONS_2: "Paramètres > Général > Mise à jour Software",
  13418. ERROR_WEBGL_SAFARI_PROBLEM: "Activez WegGL pour explorer en 3D.",
  13419. ERROR_WEBGL_SAFARI_ACTIONS_1: "Cliquez ",
  13420. ERROR_WEBGL_SAFARI_ACTIONS_2: "Préferences > Avancés > Voir menu développeur",
  13421. ERROR_WEBGL_SAFARI_ACTIONS_3: "Puis cliquez ",
  13422. ERROR_WEBGL_SAFARI_ACTIONS_4: "Développe > Activé WebGL",
  13423. ERROR_MISSING_URLS_PROBLEM: "Il n'y a pas de panoromas pour ce modèle.",
  13424. ERROR_MISSING_URLS_EXPLANATION: "Ceci est un ancien modèle. Le propriétaire du site a peut-être un nouveau modèle en cours.",
  13425. ERROR_LOADING_FAILED_PROBLEM: "Ce modèle n'est pas disponible.",
  13426. ERROR_LOADING_FAILED_ACTIONS_1: "Si le problème persiste, ",
  13427. ERROR_LOADING_FAILED_ACTIONS_2: "voir notre guide de dépannage",
  13428. ERROR_MAINTENANCE_PROBLEM: "Maintenance en cours.",
  13429. ERROR_MAINTENANCE_SOLUTION: "Revenez dans quelques instants.",
  13430. LINK_TO_LOCATION: "Lien vers l'emplacement",
  13431. MENU_COPY: "Copie",
  13432. LINK_ALERT_COPY: "Utiliser CTRL+CMD C pour copier.",
  13433. ROTATE: "Faire pivoter",
  13434. INSIDE: "Intérieure",
  13435. MOVE: "Se déplacer",
  13436. ZOOM: "Zoom"
  13437. }
  13438. }
  13439. , {}],
  13440. 114: [function(e, t, i) {
  13441. "use strict";
  13442. t.exports = {
  13443. PAGE_TITLE: "",
  13444. LOADING: "読み込み中",
  13445. PRESENTED_BY_CAPS: "PRESENTED BY",
  13446. POWERED_BY: "powered by",
  13447. POWERED_BY_CAPS: "POWERED BY",
  13448. DESKTOP_SHORT_CTA: "クリックしてこの3D Spaceを探索",
  13449. MOBILE_SHORT_CTA: "タップしてこの3D Spaceを探索",
  13450. PRESENTED_BY: "Presented by ",
  13451. MORE: "全て表示 ",
  13452. LESS: "閉じる ",
  13453. TAG_CONTENT: "tag™コンテンツ ",
  13454. SHOW: "表示",
  13455. HIDE: "非表示",
  13456. DOLLHOUSE: "ドールハウス",
  13457. FLOOR_PLAN: "フロアプラン",
  13458. OPEN_HIGHLIGHTS: "ハイライトを開く",
  13459. CLOSE_HIGHLIGHTS: "閉じる",
  13460. PREVIOUS: "前へ",
  13461. PLAY: "再生",
  13462. PAUSE: "一時停止",
  13463. NEXT: "次へ",
  13464. EXPLORE_3D_SPACE: "3DSpaceの探索",
  13465. VIEW_DOLLHOUSE: "ドールハウスの表示",
  13466. SOCIAL_SHARING: "このSpaceを共有する",
  13467. VIEW_IN_VR: "VRで表示",
  13468. VIEW_FULLSCREEN: "フルスクリーン表示",
  13469. EXIT_FULLSCREEN: "フルスクリーン表示を終了",
  13470. ZOOM_IN: "ズームイン",
  13471. ZOOM_OUT: "ズームアウト",
  13472. FLOOR_NAME: "フロア ",
  13473. FLOOR_ALL: "すべて",
  13474. TERMS: "規約",
  13475. PORT_TERMS: "port規約",
  13476. TERMS_OF_USE: "利用規約",
  13477. CLOSE_TERMS: "閉じる",
  13478. TERMS_TEXT_FILE: "terms-jp-JP.html",
  13479. TERMS_FAIL: "規約を取得できませんでした。利用規約を表示するためにインターネットに接続されていることを確認してください。",
  13480. WEBVR_FOR_DAYDREAM: "Daydream View用",
  13481. WEBVR_ENTER_WEBVR: "VRに入る",
  13482. WEBVR_DIFFERENT_HEADSET: "別のヘッドセットをお持ちですか?",
  13483. WEBVR_LEARN_MORE: "もっと詳しく",
  13484. WEBVR_VIEW_SPACE: "VRでSpaceを表示",
  13485. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13486. WEBVR_DAYDREAM_PHONE: "Daydream対応スマホ",
  13487. WEBVR_FOR_CARDBOARD: "Google Cardboard用",
  13488. WEBVR_VIEW_CARDBOARD: "またはGoogle Cardboardで表示",
  13489. VR_VIEW_SPACE: "バーチャルリアリティでSpaceを表示",
  13490. VR_LEARN_MORE_CAPS: "もっと詳しく",
  13491. VR_PREVIOUS_CAPS: "前へ",
  13492. VR_NEXT_CAPS: "次へ",
  13493. VR_GOT_IT_CAPS: "了解",
  13494. VR_SHOW_SUPPORTED: "タップして次を使用してVRでSpaceを表示: ",
  13495. VR_SHOW_UNSUPPORTED: "お使いのデバイスはVRでSpaceを表示する最低要件を満たしていません",
  13496. VR_SHOW_IOS_1: "タップしてVRでSpaceを表示",
  13497. VR_SHOW_IOS_2: "表示するにはport VRアプリと互換性のあるiPhoneが必要です",
  13498. VR_WHAT_YOU_NEED: "必要なもの",
  13499. VR_NEED_CARDBOARD: "Google Cardboardに必要なもの",
  13500. VR_NEED_SAMSUNG: "Samsung Gear VRに必要なもの",
  13501. VR_NEED_DAYDREAM: "事前にDaydream Viewとのペアリングが必要です",
  13502. VR_NEED_DAYDREAM_PHONE: "Daydream対応スマホ",
  13503. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13504. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13505. VR_APP: "port VRアプリ",
  13506. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13507. VR_COMPATIBLE_IPHONES_1: "iPhone",
  13508. VR_COMPATIBLE_IPHONES_2: "iOS 9.1以降で動作するiPhone 5s以降のモデル",
  13509. VR_COMPATIBLE_IPHONES_3: "互換性のあるiPhone",
  13510. VR_COMPATIBLE_ANDROID: "互換性のあるAndroidデバイス",
  13511. VR_COMPATIBLE_ANDROID_LONG: "Android OS 4.4.4以降で動作する互換性のあるAndroidデバイスの4.5~5.5インチディスプレイ",
  13512. VR_ANDROID_DETAIL: "Android OS 4.4.4以降で動作する4.5~5.5インチディスプレイ",
  13513. VR_ANDROID_DVICES: "Androidデバイス",
  13514. VR_COMPATIBLE_SAMSUNG: "互換性のあるSamsungデバイス",
  13515. VR_SAMSUNG_DETAIL: "Galaxy S5以降のモデル",
  13516. VR_APP_FOR_CARDBOARD: "Google Cardboard用のport VRアプリ",
  13517. VR_APP_FOR_SAMSUNG: "Gear VR 用のport VRアプリ",
  13518. VR_APP_FOR_ANDROID: "Androidフォン用のport VRアプリ",
  13519. VR_APP_OPEN: "port VRアプリで開く",
  13520. VR_DOWNLOAD_HERE: "ここからダウンロード",
  13521. VR_REQUIRE_HEADSET: "Android 用のVRヘッドセットとport VRアプリ をインストールする必要があります",
  13522. VR_REDIRECT_TO_STORE: "アプリがインストールされていない場合、App Storeにリダイレクトされます",
  13523. VR_IMPROPER_EMBED: "お使いのウェブブラウザでVRがサポートされるようport Spaceが適切に埋め込まれていません。",
  13524. VR_OPEN_ANDROID_LINK: "お使いの携帯電話でリンクを開いてください",
  13525. VR_ANDROID_OPTIONS: "利用可能なVRヘッドセットオプション",
  13526. SHARE_TO: "共有先",
  13527. SHARE_LINK: "ダイレクトリンク",
  13528. SHARE_EXPLORE: "探索",
  13529. SHARE_AT: "場所",
  13530. SHARE_WITH: "使用アプリ",
  13531. SHARE_3D: "3Dで",
  13532. SHARE_COPIED: "コピーされました!",
  13533. ERROR_BROWSER_SOLUTION: "3D探索するには、新しいバージョンのブラウザをインストールしてください",
  13534. ERROR_BROWSER_EXPLANATION: "WebGLにはモダンブラウザが必要です。",
  13535. ERROR_GENERIC_PROBLEM: "問題が発生しました。",
  13536. ERROR_GENERIC_SOLUTION: "ブラウザを再起動してください。",
  13537. ERROR_GENERIC_ACTIONS_1: "問題が解決しない場合は、",
  13538. ERROR_GENERIC_ACTIONS_2: "サポートされているブラウザをインストールしてください",
  13539. ERROR_GENERIC_ACTIONS_3: "または",
  13540. ERROR_GENERIC_ACTIONS_4: "トラブルシューティングガイドを参照してください",
  13541. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "ブラウザがサポートされていません。",
  13542. ERROR_WEBGL_IOS_PROBLEM: "サポートされていないiOSバージョンです。",
  13543. ERROR_WEBGL_IOS_SOLUTION: "3D探索するには、iOS 8以降にアップグレードしてください。",
  13544. ERROR_WEBGL_IOS_ACTIONS_1: "以下の順にタップします:",
  13545. ERROR_WEBGL_IOS_ACTIONS_2: "設定 > 全般 > ソフトウェアの更新",
  13546. ERROR_WEBGL_SAFARI_PROBLEM: "WebGLを有効にして3Dで探索します。",
  13547. ERROR_WEBGL_SAFARI_ACTIONS_1: "以下の順にクリックします:",
  13548. ERROR_WEBGL_SAFARI_ACTIONS_2: "環境設定 > 詳細 > メニューバーに開発メニューを表示",
  13549. ERROR_WEBGL_SAFARI_ACTIONS_3: "その後、以下の順にクリックします:",
  13550. ERROR_WEBGL_SAFARI_ACTIONS_4: "開発 > WebGLを有効にする",
  13551. ERROR_MISSING_URLS_PROBLEM: "このモデルではパノラマを使用できません。",
  13552. ERROR_MISSING_URLS_EXPLANATION: "これは古いモデルです。ウェブサイト所有者が新しいモデルを開発中かもしれません。",
  13553. ERROR_LOADING_FAILED_PROBLEM: "モデルは利用できません。",
  13554. ERROR_LOADING_FAILED_ACTIONS_1: "問題が解決しない場合は、",
  13555. ERROR_LOADING_FAILED_ACTIONS_2: "トラブルシューティングガイドを参照してください",
  13556. ERROR_MAINTENANCE_PROBLEM: "メンテナンスは進行中です。",
  13557. ERROR_MAINTENANCE_SOLUTION: "しばらくしてからやり直し てください。",
  13558. LINK_TO_LOCATION: "ロケーションへのリンク",
  13559. MENU_COPY: "コピー",
  13560. LINK_ALERT_COPY: "コピーするにはCTRL/CMD + Cを使用してください。",
  13561. ROTATE: "回転",
  13562. MOVE: "移動",
  13563. INSIDE: "内側",
  13564. ZOOM: "ズーム",
  13565. HELP: "ヘルプ",
  13566. HELP_NAVIGATION_TAB: "ナビゲーション",
  13567. HELP_MORE_HELP_TAB: "その他のヘルプ",
  13568. HELP_DESKTOP_PANORAMA_1A: "Spaceを見回すには、クリックしてドラッグします。",
  13569. HELP_DESKTOP_PANORAMA_2A: "移動するには、Space全体にあるリングをクリックします。",
  13570. HELP_DESKTOP_PANORAMA_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13571. HELP_DESKTOP_PANORAMA_1B: "または、矢印キーを使用して左右に向きを変えます。",
  13572. HELP_DESKTOP_PANORAMA_2B: "または、矢印キーを使用して前後に向きを変えます。",
  13573. HELP_DESKTOP_PANORAMA_3B: "あるいは、プラス(+)キーまたはマイナス(-)キーを使用して、ズームイン、ズームアウトします。",
  13574. HELP_DESKTOP_360_2A: "内側ビューアイコンをクリックしてSpaceに入ります。",
  13575. HELP_DESKTOP_360_2B: "または、数字キー1を押して内側ビューに入ります。",
  13576. HELP_DESKTOP_DOLLHOUSE_1A: "左クリックと左右、上下のドラッグでドールハウスを回転します。",
  13577. HELP_DESKTOP_DOLLHOUSE_2A: "右クリックと左右、上下のドラッグでドールハウスの画面上の位置を変更します。",
  13578. HELP_DESKTOP_DOLLHOUSE_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13579. HELP_DESKTOP_DOLLHOUSE_1B: "または、矢印キーを使用してドールハウスを回転します。",
  13580. HELP_DESKTOP_FLOORPLAN_1A: "左ボタンを押しながら、上下左右にドラッグしてフロアプランの画面上の位置を変更します。",
  13581. HELP_DESKTOP_FLOORPLAN_2A: "右ボタンを押しながら左右にドラッグして、フロアプランを回転します。",
  13582. HELP_DESKTOP_FLOORPLAN_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13583. HELP_DESKTOP_FLOORPLAN_2B: "または、矢印キーを使用して左右に回転します。",
  13584. HELP_DESKTOP_FLOORPLAN_3B: "または、矢印キーを使用して、ズームイン、ズームアウトします。",
  13585. HELP_MOBILE_PANORAMA_1: "Spaceを見回すには、タッチしてドラッグします。",
  13586. HELP_MOBILE_PANORAMA_2: "移動するには、Space全体にあるリングをタップします。",
  13587. HELP_MOBILE_3: "ピンチジェスチャーを使用してズームイン、ズームアウトします。",
  13588. HELP_MOBILE_360_2: "内側ビューアイコンをタップしてSpaceに入ります。",
  13589. HELP_MOBILE_DOLLHOUSE_1: "タッチして上下左右にドラッグしてドールハウスを回転します。",
  13590. HELP_MOBILE_DOLLHOUSE_2: "タッチして、2本指でドラッグしてドールハウスを配置します。",
  13591. HELP_MOBILE_FLOORPLAN_1: "タッチ&ドラッグしてフロアプランを配置します。",
  13592. HELP_MOBILE_FLOORPLAN_2: "タッチして、2本指でドラッグしてフロアプランを回転します。",
  13593. HELP_MORE_HLR_A: "ハイライト",
  13594. HELP_DESKTOP_MORE_HLR_B: "サムネイル画像を使用してSpaceを移動するために開きます。",
  13595. HELP_MORE_DOLLHOUSE_A: "ドールハウス",
  13596. HELP_DESKTOP_MORE_DOLLHOUSE_B: "クリックして3DでSpace全体のトップダウンビューを表示して回転します。",
  13597. HELP_MOBILE_MORE_DOLLHOUSE_B: "タップして3DでSpace全体のトップダウンビューを表示して回転します。",
  13598. HELP_MORE_FLOORS_A: "フロアセレクター",
  13599. HELP_DESKTOP_MORE_FLOORS_B: "Space内のフロアを切り替えます。",
  13600. HELP_MORE_TAG_A: "tag™ Posts",
  13601. HELP_DESKTOP_MORE_TAG_B: "クリックするか、カーソルを置くとSpace内の機能についての説明が表示されます。",
  13602. HELP_MOBILE_MORE_TAG_B: "タップするとSpace内の機能についての説明が表示されます。",
  13603. HELP_MORE_ZOOM_A: "ズームコントロール",
  13604. HELP_DESKTOP_MORE_ZOOM_B: "これらのコントロールまたはスクロールホイールを使用して、ズームイン、ズームアウトします。",
  13605. HELP_MORE_TOUR_A: "ツアーコントロール",
  13606. HELP_DESKTOP_MORE_TOUR_B: "ガイド付きツアー中に再生、一時停止、前方・後方に移動します。",
  13607. HELP_MORE_INSIDE_A: "内側ビュー",
  13608. HELP_DESKTOP_MORE_INSIDE_B: "クリックしてSpace内を探索します。",
  13609. HELP_MOBILE_MORE_INSIDE_B: "タップしてSpace内を探索します。",
  13610. HELP_MORE_VR_A: "VRモード",
  13611. HELP_DESKTOP_MORE_VR_B: "クリックしてバーチャルリアリティでSpaceを起動します。",
  13612. HELP_MOBILE_MORE_VR_B: "タップしてバーチャルリアリティでSpaceを起動します。",
  13613. HELP_MORE_360_A: "360° Views",
  13614. HELP_DESKTOP_MORE_360_B: "Highlight Reelの360° Viewsをクリックして屋外シーンを表示します。",
  13615. HELP_MOBILE_MORE_360_B: "Highlight Reelの360° Viewsをタップして屋外シーンを表示します。",
  13616. HELP_MORE_FULLSCREEN_A: "フルスクリーン",
  13617. HELP_DESKTOP_MORE_FULLSCREEN_B: "3D Showcaseをフルスクリーン表示にします。",
  13618. CLOSE: "閉じる"
  13619. }
  13620. }
  13621. , {}],
  13622. 115: [function(e, t, i) {
  13623. "use strict";
  13624. t.exports = {
  13625. PAGE_TITLE: "",
  13626. LOADING: "Загрузка",
  13627. PRESENTED_BY_CAPS: "ПРЕДСТАВЛЕНО",
  13628. POWERED_BY: "разработано на платформе ",
  13629. POWERED_BY_CAPS: "РАЗРАБОТАНО НА ПЛАТФОРМЕ",
  13630. DESKTOP_SHORT_CTA: "Нажмите для просмотра.",
  13631. MOBILE_SHORT_CTA: "Нажмите для просмотра.",
  13632. PRESENTED_BY: "Представлено ",
  13633. MORE: "Больше ",
  13634. LESS: "Меньше ",
  13635. TAG_CONTENT: "tag™ Контент",
  13636. SHOW: "Показать",
  13637. HIDE: "Скрыть",
  13638. DOLLHOUSE: "Dollhouse",
  13639. FLOOR_PLAN: "Планировка",
  13640. OPEN_HIGHLIGHTS: "Открыть Фотоколлаж",
  13641. CLOSE_HIGHLIGHTS: "Закрыть",
  13642. PREVIOUS: "Предыдущий",
  13643. PLAY: "Воспроизвести",
  13644. PAUSE: "Пауза",
  13645. NEXT: "Следующий",
  13646. EXPLORE_3D_SPACE: "Просмотреть 3D модель",
  13647. VIEW_DOLLHOUSE: "Посмотреть Dollhouse",
  13648. SOCIAL_SHARING: "Поделиться этой моделью",
  13649. VIEW_IN_VR: "Посмотреть в VR",
  13650. VIEW_FULLSCREEN: "Полный экран",
  13651. EXIT_FULLSCREEN: "Выйти из полноэкранного режима",
  13652. ZOOM_IN: "Увеличить",
  13653. ZOOM_OUT: "Уменьшить",
  13654. FLOOR_NAME: "Этаж ",
  13655. FLOOR_ALL: "Все",
  13656. TERMS: "Условия",
  13657. PORT_TERMS: "Правила пользования",
  13658. TERMS_OF_USE: "Условия использования",
  13659. TERMS_TEXT_FILE: "terms-ru-RU.html",
  13660. CLOSE_TERMS: "Закрыть",
  13661. TERMS_FAIL: "Не удалось загрузить условия использования. Для просмотра условий использования, пожалуйста, убедитесь, что у Вас есть подключение к Интернету.",
  13662. HELP: "Помощь",
  13663. HELP_NAVIGATION_TAB: "Навигация",
  13664. HELP_MORE_HELP_TAB: "Доп. Помощь",
  13665. CLOSE: "Закрыть",
  13666. HELP_DESKTOP_PANORAMA_1A: "Нажмите и перетащите, чтобы осмотреть пространство вокруг.",
  13667. HELP_DESKTOP_PANORAMA_2A: "Для передвижения по модели нажимайте на круги .",
  13668. HELP_DESKTOP_PANORAMA_3A: "Используйте колесо прокрутки для увеличения и уменьшения.",
  13669. HELP_DESKTOP_PANORAMA_1B: "Или используйте клавиши со стрелками для поворота влево и вправо.",
  13670. HELP_DESKTOP_PANORAMA_2B: "Или используйте стрелки для перемещения вперед и назад.",
  13671. HELP_DESKTOP_PANORAMA_3B: "Или используйте клавиши ‘плюс’ и ‘минус’ для увеличения и уменьшения изображения.",
  13672. HELP_DESKTOP_360_2A: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  13673. HELP_DESKTOP_360_2B: "или нажмите 1 на клавиатуре, чтобы увидеть внутреннюю панораму.",
  13674. HELP_DESKTOP_DOLLHOUSE_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы повернуть Dollhouse.",
  13675. HELP_DESKTOP_DOLLHOUSE_2A: "Нажмите правую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить позицию Dollhouse на экране.",
  13676. HELP_DESKTOP_DOLLHOUSE_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  13677. HELP_DESKTOP_DOLLHOUSE_1B: "Или используйте клавиши со стрелками, чтобы повернуть Dollhouse.",
  13678. HELP_DESKTOP_FLOORPLAN_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить положение Планировки на экране.",
  13679. HELP_DESKTOP_FLOORPLAN_2A: "Нажмите правую кнопку мыши и перетащите влево или вправо, чтобы повернуть Планировку.",
  13680. HELP_DESKTOP_FLOORPLAN_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  13681. HELP_DESKTOP_FLOORPLAN_2B: "Или используйте клавиши со стрелками для поворота влево или вправо.",
  13682. HELP_DESKTOP_FLOORPLAN_3B: "Или используйте стрелки для увеличения и уменьшения.",
  13683. HELP_MOBILE_PANORAMA_1: "Нажмите и перетащите, чтобы осмотреть модель.",
  13684. HELP_MOBILE_PANORAMA_2: "Для передвижения по модели нажимайте на круги.",
  13685. HELP_MOBILE_3: "Используйте движение двумя пальцами в разные стороны, чтобы увеличить и уменьшить.",
  13686. HELP_MOBILE_360_2: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  13687. HELP_MOBILE_DOLLHOUSE_1: "Нажмите и перетащите вверх, вниз, влево и вправо, чтобы повернуть Dollhouse.",
  13688. HELP_MOBILE_DOLLHOUSE_2: "Нажмите и перетащите, чтобы расположить Dollhouse.",
  13689. HELP_MOBILE_FLOORPLAN_1: "Нажмите и перетащите, чтобы расположить план здания.",
  13690. HELP_MOBILE_FLOORPLAN_2: "Коснитесь и перетащите двумя пальцами, чтобы повернуть план здания.",
  13691. HELP_MORE_HLR_A: "Фотоколлаж",
  13692. HELP_DESKTOP_MORE_HLR_B: "Откройте для перемещения по модели, используя иконки изображений.",
  13693. HELP_MORE_DOLLHOUSE_A: "Dollhouse",
  13694. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  13695. HELP_MOBILE_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  13696. HELP_MORE_FLOORS_A: "Выбор Этажа",
  13697. HELP_DESKTOP_MORE_FLOORS_B: "Переключение между этажами.",
  13698. HELP_MORE_TAG_A: "tag™ Posts",
  13699. HELP_DESKTOP_MORE_TAG_B: "Нажмите или наведите курсор мыши для получения информации о функциях в Пространстве.",
  13700. HELP_MOBILE_MORE_TAG_B: "Нажмите для получения информации о функциях.",
  13701. HELP_MORE_ZOOM_A: "Масштаб",
  13702. HELP_DESKTOP_MORE_ZOOM_B: "Используйте эти кнопки для увеличения и уменьшения изображения или используйте колесо прокрутки.",
  13703. HELP_MORE_TOUR_A: "Управление Туром",
  13704. HELP_DESKTOP_MORE_TOUR_B: "Используйте кнопки Воспроизвести, Пауза, Вперед и Назад для управления фотоколлажем.",
  13705. HELP_MORE_INSIDE_A: "Вид Изнутри",
  13706. HELP_DESKTOP_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  13707. HELP_MOBILE_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  13708. HELP_MORE_VR_A: "Режим VR",
  13709. HELP_DESKTOP_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  13710. HELP_MOBILE_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  13711. HELP_MORE_360_A: "360° Views",
  13712. HELP_DESKTOP_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  13713. HELP_MOBILE_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  13714. HELP_MORE_FULLSCREEN_A: "Полный экран",
  13715. HELP_DESKTOP_MORE_FULLSCREEN_B: "Развернуть 3D Showcase во весь экран.",
  13716. WEBVR_FOR_CARDBOARD: "Для Google Cardboard",
  13717. WEBVR_FOR_DAYDREAM: "Для просмотра в Daydream",
  13718. WEBVR_ENTER_WEBVR: "ВОЙТИ В VR ",
  13719. WEBVR_DIFFERENT_HEADSET: "Есть другой VR-шлем?",
  13720. WEBVR_LEARN_MORE: "Узнать больше",
  13721. WEBVR_VIEW_SPACE: "Запустить модель в VR",
  13722. WEBVR_DAYDREAM_VIEW: "Посмотреть в Daydream",
  13723. WEBVR_DAYDREAM_PHONE: "Daydream-готовый телефон",
  13724. WEBVR_VIEW_CARDBOARD: "Или просмотреть в Google Cardboard",
  13725. VR_WHAT_YOU_NEED: "Что Вам потребуется...",
  13726. VR_NEED_DAYDREAM_PHONE: "Daydream-готовый телефон",
  13727. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13728. VR_APP: "port VR App",
  13729. VR_APP_OPEN: "Или открыть через приложение port VR",
  13730. VR_COMPATIBLE_ANDROID_LONG: 'Совместимые Android устройства с диагональю экрана 4.5"-5.5" дюймов и Android версией 4.4.4, и выше',
  13731. VR_SAMSUNG_DETAIL: "Galaxy S6 и выше",
  13732. VR_APP_FOR_ANDROID: "Приложение port VR для Android",
  13733. VR_NEED_DAYDREAM: "Необходимо для соединением с Daydream",
  13734. VR_VIEW_SPACE: "Запустить модель в VR",
  13735. VR_LEARN_MORE_CAPS: "УЗНАТЬ БОЛЬШЕ",
  13736. VR_PREVIOUS_CAPS: "ПРЕДЫДУЩИЙ",
  13737. VR_NEXT_CAPS: "СЛЕДУЮЩИЙ",
  13738. VR_GOT_IT_CAPS: "ЯСНО",
  13739. VR_SHOW_SUPPORTED: "Нажмите, чтобы просмотреть модель в VR с помощью",
  13740. VR_SHOW_UNSUPPORTED: "Извините, но Ваше устройство не соответствует минимальным требованиям для просмотра модели в VR.",
  13741. VR_SHOW_IOS_1: "Нажмите, чтобы просмотреть модель в VR",
  13742. VR_SHOW_IOS_2: "Для просмотра требуется приложение port VR и совместимый iPhone",
  13743. VR_NEED_CARDBOARD: "Что Вам потребуется для Google Cardboard",
  13744. VR_NEED_SAMSUNG: "Что Вам потребуется для Samsung Gear VR",
  13745. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13746. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13747. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13748. VR_COMPATIBLE_IPHONES_2: "iPhone 5s или новее с iOS 9.1 и выше",
  13749. VR_COMPATIBLE_IPHONES_3: "Совместимые модели iPhone",
  13750. VR_COMPATIBLE_ANDROID: "Совместимые Android устройства",
  13751. VR_ANDROID_DETAIL: 'Экран от 4.5" до 5.5" и Android 4.4.4, и выше',
  13752. VR_ANDROID_DVICES: "Android устройства",
  13753. VR_COMPATIBLE_SAMSUNG: "Совместимые Samsung устройства",
  13754. VR_APP_FOR_CARDBOARD: "Приложение port VR для Google Cardboard",
  13755. VR_APP_FOR_SAMSUNG: "Приложение port VR для Gear VR",
  13756. VR_DOWNLOAD_HERE: "Скачать здесь",
  13757. VR_REQUIRE_HEADSET: "Требуется VR-шлем и установленное приложение port VR для Android",
  13758. VR_REDIRECT_TO_STORE: "Если приложение не установлено, Вы будете перенаправлены на страницу магазина приложений.",
  13759. VR_IMPROPER_EMBED: "port модель не встроена должным образом для поддержки VR в вашем веб-браузере.",
  13760. VR_OPEN_ANDROID_LINK: "Откройте ссылку на Вашем мобильном телефоне",
  13761. VR_ANDROID_OPTIONS: "Доступные опции VR-шлемов",
  13762. SHARE_TO: "Поделиться",
  13763. SHARE_LINK: "Прямая ссылка",
  13764. SHARE_EXPLORE: "просмотреть",
  13765. SHARE_AT: "на",
  13766. SHARE_WITH: "с",
  13767. SHARE_3D: "в 3D",
  13768. SHARE_COPIED: "Скопировано!",
  13769. ERROR_BROWSER_SOLUTION: "установите новый браузер, чтобы просмотреть 3D пространство.",
  13770. ERROR_BROWSER_EXPLANATION: "WebGL требует современный браузер.",
  13771. ERROR_GENERIC_PROBLEM: "Ой, что-то пошло не так.",
  13772. ERROR_GENERIC_SOLUTION: "Перезапустите браузер.",
  13773. ERROR_GENERIC_ACTIONS_1: "Если проблема не устранена, ",
  13774. ERROR_GENERIC_ACTIONS_2: "установите поддерживаемый браузер",
  13775. ERROR_GENERIC_ACTIONS_3: " или ",
  13776. ERROR_GENERIC_ACTIONS_4: "смотрите наше руководство по устранению неполадок",
  13777. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Браузер не поддерживается.",
  13778. ERROR_WEBGL_IOS_PROBLEM: "iOS-версия не поддерживается.",
  13779. ERROR_WEBGL_IOS_SOLUTION: "Обновите до iOS 8 или выше, чтобы просмотреть пространство в 3D.",
  13780. ERROR_WEBGL_IOS_ACTIONS_1: "Нажмите ",
  13781. ERROR_WEBGL_IOS_ACTIONS_2: "Настройки > Общие > Обновление ПО",
  13782. ERROR_WEBGL_SAFARI_PROBLEM: "Включите WebGL для 3D-просмотра.",
  13783. ERROR_WEBGL_SAFARI_ACTIONS_1: "Нажмите ",
  13784. ERROR_WEBGL_SAFARI_ACTIONS_2: "Настойки > Дополнения > Показывать меню “Разработка” в строке меню",
  13785. ERROR_WEBGL_SAFARI_ACTIONS_3: "Затем нажмите ",
  13786. ERROR_WEBGL_SAFARI_ACTIONS_4: "Разработка > Разрешить WebGL",
  13787. ERROR_MISSING_URLS_PROBLEM: "Ой, для этой модели нет панорамы.",
  13788. ERROR_MISSING_URLS_EXPLANATION: "Эта модель устарела. У владельца веб-сайта может быть новая модель.",
  13789. ERROR_LOADING_FAILED_PROBLEM: "Ой, модель недоступна.",
  13790. ERROR_LOADING_FAILED_ACTIONS_1: "Если проблема не устранена, ",
  13791. ERROR_LOADING_FAILED_ACTIONS_2: "посмотрите наше руководство по устранению неполадок",
  13792. ERROR_MAINTENANCE_PROBLEM: "Выполняется техническое обслуживание.",
  13793. ERROR_MAINTENANCE_SOLUTION: "Пожалуйста, попробуйте снова через несколько минут.",
  13794. LINK_TO_LOCATION: "Ссылка на местоположение",
  13795. MENU_COPY: "Копировать",
  13796. LINK_ALERT_COPY: "Для того, чтобы скопировать, пожалуйста, используйте CTRL/CMD + C.",
  13797. ROTATE: "Вращать",
  13798. MOVE: "Передвигаться",
  13799. INSIDE: "Вид изнутри",
  13800. ZOOM: "Масштаб"
  13801. }
  13802. }
  13803. , {}],
  13804. 116: [function(r, e, t) {
  13805. (function(i) {
  13806. "use strict";
  13807. function re(e) {
  13808. console.log("e1:" + e),
  13809. e = Math.round(.4 * e * 100),
  13810. console.log("e2:" + e);
  13811. var t = $(".progressbar");
  13812. t.find(".bar").css("width", e + "%"),
  13813. t.find(".label").css("left", t.width() * e / 100 - 15 + "px"),
  13814. t.find(".perc").text(e + "%")
  13815. }
  13816. $("#gui-loading").fadeIn(200),
  13817. re(.1);
  13818. var e = g_version ? "modeldata.js" : "someData.json";
  13819. $.ajax(g_Prefix + "data/" + window.number + "/" + e + "?" + randomTime().getTime(), {
  13820. dataType: "json"
  13821. }).done(function(e) {
  13822. var t = matcher(e);
  13823. t.files.templates[0] = g_Prefix + e.files.templates[0].replace("{{number}}", window.number),
  13824. t.user = {
  13825. is_authenticated: !1,
  13826. flags: ["payment_show_past_due", "sc_imgopt_100", "mattertags", "labels", "fastly_v2_urls", "vr", "uhql", "sc_segment_100", "show_segment_metrics", "content_distribution", "workshop_webgl", "show360views", "showcase_vr", "ws_zooming", "model_settings", "ws_360snapshots", "img_multi_dl", "vrworkshop", "tag_links", "ws_img_multi_dl", "mattertag_links", "billing_tab_hidden", "static_cloud_ui", "metrics", "mattertag_media", "img_size_download", "show_360snapshots", "floorplan", "sc_tilegen_0", "showcase_webvr", "sc_mixpanel_0", "show_clickbait", "zooming", "showcase_tiling", "list_signed_urls_default_3", "fastly_image_opto"]
  13827. }
  13828. /* t.model.images = [
  13829. {
  13830. "metadata": "{\"camera_position\":{\"x\":0.8559,\"y\":-0.1097,\"z\":0.6656},\"camera_quaternion\":{\"x\":-0.1975,\"y\":-0.0952,\"z\":-0.0193,\"w\":0.9755},\"scan_id\":\"11\",\"zoom\":1}",
  13831. "name": "1",
  13832. "thumbnail_signed_src": "https://super.4dage.com/data/LYW/edit/20201210_175837426.",
  13833. "sid": "20201210_175837426"
  13834. },
  13835. {
  13836. "metadata": "{\"camera_position\":{\"x\":1.1559,\"y\":-0.1083,\"z\":1.9191},\"camera_quaternion\":{\"x\":-0.0396,\"y\":0.1251,\"z\":0.005,\"w\":0.9913},\"scan_id\":\"12\",\"zoom\":1}",
  13837. "name": "2",
  13838. "thumbnail_signed_src": "https://super.4dage.com/data/LYW/edit/20201210_175835333.",
  13839. "sid": "20201210_175835333"
  13840. },
  13841. {
  13842. "name": "区域1 hasmusic",
  13843. "momentTour": "black",
  13844. "musicInfo": {
  13845. "name": "一段音乐.mp3",
  13846. "music": "///super.4dage.com/data/LYW/edit/20210425_152844547.mp3",
  13847. "time": 7818
  13848. },
  13849. "locations": [
  13850. {
  13851. "metadata": "{\"camera_position\":{\"x\":-2.4032,\"y\":-0.1215,\"z\":-0.882},\"camera_quaternion\":{\"x\":-0.0898,\"y\":0.9081,\"z\":0.2552,\"w\":0.3196},\"scan_id\":\"5\",\"zoom\":1}",
  13852. "sid": "20210425_152818526",
  13853. "name": "20210425_152818526",
  13854. "thumbnail_signed_src": "https://super.4dage.com/data/LYW/edit/20210425_152818526."
  13855. }
  13856. ]
  13857. },
  13858. {
  13859. "name": "区域2",
  13860. "momentTour": "black",
  13861. "locations": [
  13862. {
  13863. "metadata": "{\"camera_position\":{\"x\":-1.2063,\"y\":-0.1163,\"z\":0.4791},\"camera_quaternion\":{\"x\":0.0326,\"y\":0.9667,\"z\":0.1605,\"w\":-0.1966},\"scan_id\":\"2\",\"zoom\":1}",
  13864. "sid": "20210425_152857293",
  13865. "name": "20210425_152857293",
  13866. "thumbnail_signed_src": "https://super.4dage.com/data/LYW/edit/20210425_152857293."
  13867. },
  13868. {
  13869. "metadata": "{\"camera_position\":{\"x\":-0.2906,\"y\":-0.1122,\"z\":-0.2226},\"camera_quaternion\":{\"x\":-0.258,\"y\":-0.3481,\"z\":-0.1003,\"w\":0.8956},\"scan_id\":\"1\",\"zoom\":1}",
  13870. "sid": "20210425_152900502",
  13871. "name": "20210425_152900502",
  13872. "thumbnail_signed_src": "https://super.4dage.com/data/LYW/edit/20210425_152900502."
  13873. }
  13874. ]
  13875. },
  13876. {
  13877. "metadata": "{\"camera_position\":{\"x\":-1.2063,\"y\":-0.1163,\"z\":0.4791},\"camera_quaternion\":{\"x\":-0.0023,\"y\":-0.8326,\"z\":-0.0034,\"w\":0.5539},\"scan_id\":\"2\",\"zoom\":1}",
  13878. "sid": "20210425_152929593",
  13879. "name": "5",
  13880. "thumbnail_signed_src": "https://super.4dage.com/data/LYW/edit/20210425_152929593."
  13881. }
  13882. ] */
  13883. try{//处理一下导览数据
  13884. t.model.images = t.model.images.filter(e=>{
  13885. if(!e.locations && !e.thumbnail_signed_src)return; //旧的曾有导览数据是错误的,将它删除
  13886. if(e.locations)e.locations = e.locations.filter(e=>e)
  13887. if(e.locations && e.locations.length == 0)return;
  13888. return e
  13889. })
  13890. }catch(e){console.log(e) }
  13891. window.MP_PREFETCHED_MODELDATA = t
  13892. t.model.summary = t.summary
  13893. t.model.name = t.name
  13894. for(let i in t){
  13895. t[i] == "false" && (t[i] = false)
  13896. }
  13897. re(.7),
  13898. function() {
  13899. function y(e) {
  13900. t.update(e)
  13901. }
  13902. function A(e, t) {
  13903. ne.error(t),
  13904. n.error(t),
  13905. N.report(e, "error-" + t)
  13906. }
  13907. function C(e, t, i) {
  13908. try {
  13909. e.start(t)
  13910. } catch (e) {
  13911. throw ne.warn(e.message),
  13912. function(e) {
  13913. var t = O.details();
  13914. t && "Safari" === t.name && 500 < t.version && t.version < 600 ? (n.error("webgl-safari"),
  13915. N.report(e, "error-webgl-safari")) : (n.error("webgl-generic"),
  13916. N.report(e, "error-webgl-generic"))
  13917. }(i.sid),
  13918. e
  13919. }
  13920. }
  13921. function I(e) {
  13922. e.stopPropagation(),
  13923. e.preventDefault()
  13924. }
  13925. window.MP_PREFETCHED_MODELDATA.hoticon && (g_HotImage = {
  13926. point: window.MP_PREFETCHED_MODELDATA.hoticon.default || "https://super.4dage.com/images/4dagePoint2.png",
  13927. point2: window.MP_PREFETCHED_MODELDATA.hoticon.higt || "https://super.4dage.com/images/4dagePoint.png"
  13928. });
  13929. /* window.MP_PREFETCHED_MODELDATA.backgroundMusic ? (g_bgAudio.src = window.MP_PREFETCHED_MODELDATA.backgroundMusic,
  13930. $("#volume").show()) : "one" === g_version && (g_bgAudio.src = g_Prefix + "/audio/audio" + window.number + "/background.mp3");
  13931. */
  13932. if (window.MP_PREFETCHED_MODELDATA.backgroundMusic) {
  13933. if(window.isLocal) g_bgAudio.src = manage.dealURL(window.MP_PREFETCHED_MODELDATA.backgroundMusic) ;
  13934. else g_bgAudio.src = window.MP_PREFETCHED_MODELDATA.backgroundMusic.substr(0,4)=="http" ? window.MP_PREFETCHED_MODELDATA.backgroundMusic : "//" + window.MP_PREFETCHED_MODELDATA.backgroundMusic;
  13935. $("#volume").show();
  13936. }else if (g_version === "one"){
  13937. g_bgAudio.src = g_Prefix+"/audio/"+"audio"+window.number + "/background.mp3";
  13938. //g_bgAudio.src = manage.dealURL(src) ;
  13939. }
  13940. //隐藏公司logo
  13941. window.MP_PREFETCHED_MODELDATA.loadlogo && showLogo();
  13942. r("./lib/three75-shim"),
  13943. r("./lib/array-polyfill"),
  13944. r("./lib/performance-polyfill"),
  13945. r("./lib/shaders/CopyShader.js"),
  13946. r("./lib/shaders/HorizontalBlurShader.js"),
  13947. r("./lib/shaders/VerticalBlurShader.js"),
  13948. r("./lib/postprocessing/EffectComposer.js"),
  13949. r("./lib/postprocessing/RenderPass.js"),
  13950. r("./lib/postprocessing/MaskPass.js"),
  13951. r("./lib/postprocessing/ShaderPass.js"),
  13952. window.Promise || (window.Promise = r("promise-polyfill"));
  13953. var E = r("three")
  13954. , _ = r("three")
  13955. , b = (r("./util/sentry"),
  13956. r("./player"))
  13957. , w = r("./director")
  13958. , T = r("./controls/CameraControls")
  13959. , x = r("./model/ModelManager")
  13960. , S = r("./DisplayController")
  13961. , M = r("./label/LabelDisplayController")
  13962. , R = r("./enum/Viewmode")
  13963. , e = r("./util/logger")
  13964. , P = r("./showcase")
  13965. , O = r("./util/browser")
  13966. , L = r("./settings")
  13967. , D = r("./gui/gui")
  13968. , n = r("./gui/error")
  13969. , N = r("./analytics")
  13970. , F = r("./util/transitions")
  13971. , B = r("./effects")
  13972. , V = r("./objects/Skybox")
  13973. , k = (r("./util/common"),
  13974. r("./util/PanoramaCollection"),
  13975. r("./util/math"),
  13976. r("./util/showcase"))
  13977. , U = r("./util/camera")
  13978. , H = (r("./objects/Panorama"),
  13979. r("./cameras/PanoramaCamera"),
  13980. r("./preloaders"))
  13981. , z = r("events").EventEmitter
  13982. , G = r("./featureflags")
  13983. , W = (r("./util/lerp"),
  13984. r("./util/ajax"),
  13985. r("./ab"))
  13986. , j = r("./sdk/automation.js")
  13987. , Y = r("./scene/SceneRenderer")
  13988. , q = r("./scene/QuickstartManager")
  13989. , X = r("./tile/QualityManager.js")
  13990. , Z = r("./localization/localize")
  13991. , K = r("./tag/tagManager")
  13992. , Q = r("./tile/TileDownloader")
  13993. , J = r("./tile/PanoRenderer")
  13994. , ee = (r("./enum/PanoSizeClass"),
  13995. r("./enum/PanoramaEvents"),
  13996. r("./enum/SceneRendererEvents"))
  13997. , t = r("./gui/memoryUsage")
  13998. , te = r("./enum/RenderLayers")
  13999. , ie = r("./TimingData")
  14000. , ne = new e(i);
  14001. e.level = L.logLevel,
  14002. e.consoleEnabled = L.console,
  14003. function() {
  14004. var e = k.getModelIDFromQueryString();
  14005. if (!e)
  14006. return A(null, "loading-failed");
  14007. var t = k.parseSidUrl(e)
  14008. , i = O.valueFromHash("play", !1) ? "autoplay" : O.inIframe() ? "click" : "fullpage"
  14009. , n = {
  14010. panoElementsToLoad: 6,
  14011. modelElementsToLoad: 0,
  14012. totalElementsLoaded: 0,
  14013. totalElementsToLoad: 0,
  14014. totalPercentageLoaded: 0,
  14015. progressCallback: null
  14016. }
  14017. , r = document.getElementById("player")
  14018. , o = L.quickstart.enabled
  14019. , a = null
  14020. , s = null
  14021. , l = null
  14022. , c = null
  14023. , h = null
  14024. , u = null
  14025. , d = null
  14026. , p = null
  14027. , f = null
  14028. , g = null
  14029. , m = null
  14030. , v = new ie;
  14031. !function(e) {
  14032. ne.info("Version", "2.25.6-0-gd87e5b1"),
  14033. z.defaultMaxListeners = 1e3,
  14034. function(e) {
  14035. e.addEventListener("dragenter", I, !1),
  14036. e.addEventListener("dragover", I, !1)
  14037. }(e),
  14038. O.valueFromHash("title", !0) || $(document).ready(function() {
  14039. $(".model-title").hide()
  14040. })
  14041. }(r),
  14042. function(e) {
  14043. return G.loadFeatureFlags(e).done(function(e) {
  14044. G.updateDependentSettings(e, L)
  14045. })
  14046. }({
  14047. urlBase: t.urlBase
  14048. }).then(function() {
  14049. return Z.init(),
  14050. function(e, t) {
  14051. var i = P.getModel({
  14052. url: t,
  14053. floors: O.valueFromHash("f", !0),
  14054. autoload: !1
  14055. });
  14056. return $.when(i, y).then(null, function(e) {
  14057. return this
  14058. })
  14059. }(0, e)
  14060. }).then(function(e) {
  14061. return re(.9),
  14062. function(e, t, i, n, r) {
  14063. ne.info("Model data loaded"),
  14064. ne.debug("UUID: " + e.data.job.uuid),
  14065. W.init(G.getFlags()),
  14066. i && N.initKeen({
  14067. token: i,
  14068. appId: n
  14069. }),
  14070. N.initSegment({
  14071. model: e.sid,
  14072. version: "2.25.6-0-gd87e5b1",
  14073. startSource: r.startSource,
  14074. token: t,
  14075. autoplay: r.autoplay,
  14076. quickstart: r.quickstart
  14077. })
  14078. }(g = e, L.appConfig.segment_key, L.appConfig.keen_write_key, L.appConfig.keen_project_id, {
  14079. startSource: i,
  14080. autoplay: L.autoplay,
  14081. quickstart: o
  14082. }),
  14083. g.urls.init()
  14084. }).then(function() {
  14085. return g.loadPanos()
  14086. }).then(function() {
  14087. s = U.getStartCameraOptions(g, g.panos);
  14088. //初始画面
  14089. window.MP_PREFETCHED_MODELDATA.camera_start && window.MP_PREFETCHED_MODELDATA.camera_start.thumbImg && function(e) {
  14090. $("<img/>").attr("src", e).on("load", function() {
  14091. $("#gui-thumb").css("backgroundImage", "url(" + e + ")").fadeIn(500),
  14092. $(this).remove()
  14093. $(".shotImg.innerBtn").removeClass('blank').css("background-image", "url(" + e + ")")
  14094. })
  14095. }(window.MP_PREFETCHED_MODELDATA.camera_start.thumbImg);
  14096. d = function(e) {
  14097. var t = new E.PerspectiveCamera;
  14098. t.layers.enable(te.PANOMARKERS),
  14099. t.layers.enable(te.RETICULE),
  14100. t.layers.enable(te.TAG);
  14101. var o = new E.Scene
  14102. , i = new E.AmbientLight(16777215);
  14103. return o.add(i),
  14104. o.skybox = new V,
  14105. o.add(o.skybox),
  14106. o.plane = new E.Mesh(new E.PlaneBufferGeometry(1e5,1e5),new E.RawShaderMaterial({
  14107. side: E.DoubleSide
  14108. })),
  14109. o.plane.position.y = 0,
  14110. o.plane.rotateX(-Math.PI / 2),
  14111. o.plane.material.visible = !1,
  14112. o.add(o.plane),
  14113. o.updateMatrixWorld(),
  14114. L.showScreenshotLocations && e.data.images.forEach(function(e) {
  14115. if (e.metadata && e.metadata.camera_position) {
  14116. var t = e.metadata.camera_position
  14117. , i = new E.Mesh(new E.BoxGeometry(.3,.3,.3));
  14118. i.position = t.clone(),
  14119. o.add(i);
  14120. var n = e.metadata.camera_quaternion
  14121. , r = new E.Vector3(0,0,-1).applyQuaternion(n);
  14122. o.add(new E.ArrowHelper(r,t.clone(),1,16711680))
  14123. }
  14124. }),
  14125. L.showAxis && (o.add(new E.ArrowHelper(new E.Vector3(0,1,0),new E.Vector3(0,0,0),1,255)),
  14126. o.add(new E.ArrowHelper(new E.Vector3(0,0,1),new E.Vector3(0,0,0),1,16711680)),
  14127. o.add(new E.ArrowHelper(new E.Vector3(1,0,0),new E.Vector3(0,0,0),1,65280))),
  14128. new Y(o,t,B)
  14129. }(g),
  14130. m = function(e, t) {
  14131. var i = e ? 1 : 1e3
  14132. , n = W.tilegen || W.imgopt ? 6 : 2;
  14133. n = O.valueFromHash("tileconc", n);
  14134. var r = new X
  14135. , o = new Q({
  14136. concurrentDownloads: n
  14137. })
  14138. , a = new J
  14139. , s = new x
  14140. , l = new w
  14141. , c = new b(t)
  14142. , h = new T
  14143. , u = new S(i)
  14144. , d = new M
  14145. , p = new K;
  14146. return {
  14147. qualityManager: r,
  14148. panoRenderer: a,
  14149. tileDownloader: o,
  14150. player: c,
  14151. director: l,
  14152. modelManager: s,
  14153. tagManager: p,
  14154. displayController: u,
  14155. labelDisplayController: d,
  14156. controls: h
  14157. }
  14158. }(o, s.mode),
  14159. l = m.controls,
  14160. c = m.player,
  14161. h = m.director,
  14162. u = m.tagManager,
  14163. p = m.tileDownloader,
  14164. f = m.qualityManager,
  14165. m.panoRenderer,
  14166. function(e, t, i, n) {
  14167. var r = i.controls
  14168. , o = i.qualityManager
  14169. , a = i.panoRenderer
  14170. , s = i.tileDownloader
  14171. , l = i.modelManager;
  14172. r.init(n, l),
  14173. j.init(i.director, r, i.player, l, t),
  14174. o.init(l),
  14175. s.init(o),
  14176. a.init(t, s, o),
  14177. l.init(s, a, o),
  14178. l.addModel(e),
  14179. t.addComponent(F)
  14180. }(g, d, m, r),
  14181. c.director = h,
  14182. g.supportsTiles && p.start(),
  14183. !o || s.mode === R.PANORAMA && s.pano || (ne.warn("Tried to quickstart, but failed as we are not starting in inside mode."),
  14184. o = !1);
  14185. var e = null;
  14186. if (o) {
  14187. ne.warn("Quickstart engaged. Hold on to your knickers.");
  14188. var t = l.controls[R.PANORAMA];
  14189. a = new q(f,d.scene,d.camera,t,r),
  14190. C(d, r, g),
  14191. e = a.load(s).then(function() {
  14192. d.addComponent(a),
  14193. d.once(ee.AfterRender, function() {
  14194. ne.warn("First render after quickstart load finished.")
  14195. })
  14196. })
  14197. }
  14198. return window.flyToFirst = function() {
  14199. var e = c.model.panos.get("8d778e19657f433fb9cf8947d823bb70")
  14200. , t = new _.Quaternion(.7099827027821568,-.07708150183830938,.6958985789714591,.07555241737970636)
  14201. , i = new _.Vector3(0,0,-1).applyQuaternion(t).add(e.position);
  14202. c.flyToPano({
  14203. pano: e,
  14204. lookAtPoint: i
  14205. })
  14206. }
  14207. ,
  14208. $.when(e, D.startLoading(g, c, h, L.autoplay, o, v))
  14209. }).then(function() {
  14210. return function(e, t, i, n, r) {
  14211. return r.progressCallback = t,
  14212. N.sessionStart(),
  14213. e.load(n).progress(function(e, t) {
  14214. e.modelElementsToLoad = t[1],
  14215. function(e) {
  14216. e.totalElementsToLoad = e.modelElementsToLoad + e.panoElementsToLoad
  14217. }(e),
  14218. function(e) {
  14219. e.totalElementsLoaded++,
  14220. e.totalPercentageLoaded = e.totalElementsLoaded / e.totalElementsToLoad,
  14221. isNaN(e.totalPercentageLoaded) && (e.totalPercentageLoaded = 0),
  14222. e.totalPercentageLoaded = .4 + .6 * e.totalPercentageLoaded,
  14223. console.log("pro:" + e.totalPercentageLoaded),
  14224. e.progressCallback && e.progressCallback(100 * e.totalPercentageLoaded)
  14225. }(e)
  14226. }
  14227. .bind(this, r))
  14228. }(g, D.onProgress, 0, !o, n)
  14229. }).then(function() {
  14230. s.quickstart = o,
  14231. function(e, t, i, n) {
  14232. var r = i.qualityManager
  14233. , o = i.panoRenderer
  14234. , a = i.tileDownloader
  14235. , s = i.modelManager
  14236. , l = i.player
  14237. , c = i.director
  14238. , h = i.tagManager
  14239. , u = i.displayController
  14240. , d = i.labelDisplayController
  14241. , p = i.controls;
  14242. t.scene.add(e),
  14243. t.qualityManager = r;
  14244. var f = {
  14245. camera: t.camera,
  14246. director: c,
  14247. modelManager: s,
  14248. tileDownloader: a,
  14249. panoRenderer: o,
  14250. qualityManager: r,
  14251. tagManager: h,
  14252. container: n,
  14253. controls: p
  14254. };
  14255. l.init(f),
  14256. l.setScene(t.scene),
  14257. h.init(s, l),
  14258. c.init(l, s),
  14259. u.init(c, l, s, h, n),
  14260. d.init(l, s, n),
  14261. B.bindEvents(l),
  14262. t.addComponent(h),
  14263. t.addComponent(l),
  14264. t.addComponent(o),
  14265. l.sceneRenderer = t
  14266. }(g, d, m, r),
  14267. d.started || C(d, r, g),
  14268. N.modelLoaded(g, c, l, L.autoplay),
  14269. function(e, t, i, n) {
  14270. return ne.info("Starting player in " + i.mode),
  14271. N.report(t.sid, "started-playing", n, i.quickstart),
  14272. e.start(i)
  14273. }(c, g, s, L.autoplay).done(function() {
  14274. h.autoTour()
  14275. }),
  14276. g.supportsTiles || new H(g,c).start();
  14277. o && (d.removeComponent(a),
  14278. a.destroy(),
  14279. s.pano.enter()),
  14280. D.init(g, h, c, l, d, s, N.getSessionId()),
  14281. D.endLoading(g, h, u),
  14282. d.once(ee.AfterRender, function() {
  14283. v.setAppReadyTime();
  14284. var e = v.calcFullLoadingTime();
  14285. ne.warn("Total load time: " + e / 1e3),
  14286. N.loadComplete(e),
  14287. ne.warn("First render after model load finished.")
  14288. }),
  14289. d.on(ee.MemoryUsageUpdated, y)
  14290. }).fail(A.bind(this, e))
  14291. }()
  14292. }()
  14293. })
  14294. }
  14295. ).call(this, "/js/main.js")
  14296. }
  14297. , {
  14298. "./DisplayController": 1,
  14299. "./TimingData": 2,
  14300. "./ab": 3,
  14301. "./analytics": 4,
  14302. "./cameras/PanoramaCamera": 7,
  14303. "./controls/CameraControls": 9,
  14304. "./director": 15,
  14305. "./effects": 16,
  14306. "./enum/PanoSizeClass": 36,
  14307. "./enum/PanoramaEvents": 37,
  14308. "./enum/RenderLayers": 41,
  14309. "./enum/SceneRendererEvents": 43,
  14310. "./enum/Viewmode": 51,
  14311. "./featureflags": 59,
  14312. "./gui/error": 64,
  14313. "./gui/gui": 65,
  14314. "./gui/memoryUsage": 73,
  14315. "./label/LabelDisplayController": 91,
  14316. "./lib/array-polyfill": 92,
  14317. "./lib/performance-polyfill": 95,
  14318. "./lib/postprocessing/EffectComposer.js": 96,
  14319. "./lib/postprocessing/MaskPass.js": 97,
  14320. "./lib/postprocessing/RenderPass.js": 98,
  14321. "./lib/postprocessing/ShaderPass.js": 99,
  14322. "./lib/shaders/CopyShader.js": 100,
  14323. "./lib/shaders/HorizontalBlurShader.js": 101,
  14324. "./lib/shaders/VerticalBlurShader.js": 102,
  14325. "./lib/three75-shim": 103,
  14326. "./localization/localize": 108,
  14327. "./tag/tagManager": 124,
  14328. "./model/ModelManager": 140,
  14329. "./objects/Panorama": 148,
  14330. "./objects/Skybox": 152,
  14331. "./player": 155,
  14332. "./preloaders": 156,
  14333. "./scene/QuickstartManager": 157,
  14334. "./scene/SceneRenderer": 158,
  14335. "./sdk/automation.js": 164,
  14336. "./settings": 166,
  14337. "./showcase": 168,
  14338. "./tile/PanoRenderer": 169,
  14339. "./tile/QualityManager.js": 170,
  14340. "./tile/TileDownloader": 171,
  14341. "./util/PanoramaCollection": 178,
  14342. "./util/ajax": 181,
  14343. "./util/browser": 182,
  14344. "./util/camera": 183,
  14345. "./util/common": 185,
  14346. "./util/lerp": 188,
  14347. "./util/logger": 189,
  14348. "./util/math": 190,
  14349. "./util/sentry": 192,
  14350. "./util/showcase": 193,
  14351. "./util/transitions": 195,
  14352. events: 202,
  14353. "promise-polyfill": 213,
  14354. three: 217
  14355. }],
  14356. 117: [function(e, t, i) {
  14357. "use strict";
  14358. function n(e) {
  14359. e = e || {},
  14360. r.RawShaderMaterial.call(this, a.extendObject({
  14361. fragmentShader: o.cube.fragmentShader,
  14362. vertexShader: o.cube.vertexShader,
  14363. uniforms: r.UniformsUtils.clone(o.cube.uniforms),
  14364. name: "CubemapMaterial"
  14365. }, e))
  14366. }
  14367. var r = e("three")
  14368. , o = e("../shaders")
  14369. , a = e("../util/common");
  14370. (n.prototype = Object.create(r.RawShaderMaterial.prototype)).constructor = n,
  14371. t.exports = n
  14372. }
  14373. , {
  14374. "../shaders": 167,
  14375. "../util/common": 185,
  14376. three: 217
  14377. }],
  14378. 118: [function(e, t, i) {
  14379. "use strict";
  14380. function n(e) {
  14381. e = e || {},
  14382. r.RawShaderMaterial.call(this, a.extendObject({
  14383. fragmentShader: o.model.fragmentShader,
  14384. vertexShader: o.model.vertexShader,
  14385. uniforms: r.UniformsUtils.clone(o.model.uniforms),
  14386. name: "ModelTextureMaterial"
  14387. }, e))
  14388. }
  14389. var r = e("three")
  14390. , o = e("../shaders")
  14391. , a = e("../util/common");
  14392. ((n.prototype = Object.create(r.RawShaderMaterial.prototype)).constructor = n).prototype.setProjectedPanos = function(e, t, i) {
  14393. i && (this.uniforms.progress.value = 0),
  14394. e.ensureSkyboxReadyForRender(),
  14395. this.uniforms.pano0Map.value = e.getSkyboxTexture(),
  14396. this.uniforms.pano0Position.value.copy(e.position),
  14397. this.uniforms.pano0Matrix.value.copy(e.skyboxMesh.matrixWorld),
  14398. t.ensureSkyboxReadyForRender(),
  14399. this.uniforms.pano1Map.value = t.getSkyboxTexture(),
  14400. this.uniforms.pano1Position.value.copy(t.position),
  14401. this.uniforms.pano1Matrix.value.copy(t.skyboxMesh.matrixWorld)
  14402. }
  14403. ,
  14404. t.exports = n
  14405. }
  14406. , {
  14407. "../shaders": 167,
  14408. "../util/common": 185,
  14409. three: 217
  14410. }],
  14411. 119: [function(m, v, e) {
  14412. (function(e) {
  14413. "use strict";
  14414. function t(e, t, i, n) {
  14415. this.div = null,
  14416. this.body = null,
  14417. this.label = e,
  14418. this.description = t,
  14419. this.parsedDescription = [],
  14420. this.media = i || {
  14421. type: null
  14422. },
  14423. this.loadingSpinner = null,
  14424. this.parser = new r({
  14425. supportLinks: !c.valueFromHash("mls"),
  14426. keepLinkLabels: !0
  14427. }),
  14428. this.state = g.CLOSED,
  14429. this.orientation = "",
  14430. this.initialTransform = "",
  14431. this.hovering = !1,
  14432. this.openTransition = null,
  14433. this.closeTransition = null,
  14434. this.openPromise = null,
  14435. this.closePromise = null,
  14436. this.animationTransition = null,
  14437. this.animationScale = 0
  14438. }
  14439. var r = m("../Parser/DescriptionParser")
  14440. , i = m("../Media/Link")
  14441. , n = m("../Media/Image")
  14442. , o = m("../Media/EmbedlyPlayer")
  14443. , a = m("../Media/EmbedlyEmbed")
  14444. , s = m("../../util/transitions")
  14445. , l = m("../../util/lerp")
  14446. , c = m("../../util/browser")
  14447. , b = m("./BillboardEvent")
  14448. , w = m("../Media/MediaEvent")
  14449. , h = m("../Parser/DescriptionChunkType")
  14450. , u = m("events").EventEmitter
  14451. , d = m("./billboardSettings")
  14452. , T = m("./overlaySettings")
  14453. , p = new (m("../../util/logger"))(e)
  14454. , f = document.getElementById("tag-billboards");
  14455. f.addEventListener("touchend", function(e) {
  14456. f.style.pointerEvents = "none"
  14457. }),
  14458. f.addEventListener("touchcancel", function(e) {
  14459. f.style.pointerEvents = "none"
  14460. });
  14461. var g = {
  14462. CLOSED: "closed",
  14463. OPENING: "opening",
  14464. OPEN: "open",
  14465. CLOSING: "closing",
  14466. ACTIVE: "active"
  14467. };
  14468. (t.prototype = Object.create(u.prototype)).build = function(e) {
  14469. this.parsedDescription = this.parser.parse(this.description);
  14470. var t = document.createElement("div");
  14471. t.className = "tag-container has-hotzone",
  14472. this.div = t,
  14473. this.body = document.createElement("div"),
  14474. this.body.className = "tag-body";
  14475. var i = document.createElement("div");
  14476. i.classList.add("tag-content");
  14477. var n = document.createElement("div");
  14478. n.classList.add("tag-text-content");
  14479. var r = document.createElement("div");
  14480. r.className = "tag-label",
  14481. r.textContent = this.label,
  14482. n.appendChild(r);
  14483. var o = document.createElement("div");
  14484. o.className = "tag-desc",
  14485. n.appendChild(o),
  14486. i.appendChild(n),
  14487. this.body.appendChild(i),
  14488. this.appendDescriptionElements(this.parsedDescription, o),
  14489. this.appendMedia(),
  14490. t.appendChild(this.body),
  14491. f.appendChild(t),
  14492. this.bindEvents(t, this.body)
  14493. }
  14494. ,
  14495. t.prototype.bindEvents = function(i, e) {
  14496. function t(n) {
  14497. return function(e) {
  14498. if (!this.div.classList.contains("overlay")) {
  14499. var t, i = document.getElementById("player");
  14500. try {
  14501. t = new MouseEvent(n,e)
  14502. } catch (i) {
  14503. (t = document.createEvent("MouseEvents")).initMouseEvent(n, e.bubbles, e.cancelable, e.view, e.detail, e.screenX, e.screenY, e.clientX, e.clientY, e.ctrlKey, e.altKey, e.shiftKey, e.metaKey, e.button, e.relatedTarget)
  14504. }
  14505. i.dispatchEvent(t)
  14506. }
  14507. }
  14508. }
  14509. e.addEventListener("mousedown", function(e) {
  14510. e.stopPropagation()
  14511. }),
  14512. e.addEventListener("mouseup", function(e) {
  14513. e.stopPropagation()
  14514. }),
  14515. i.addEventListener("touchstart", function(e) {
  14516. f.style.pointerEvents = "auto"
  14517. }),
  14518. i.addEventListener("mousedown", t("mousedown").bind(this)),
  14519. i.addEventListener("mouseup", t("mouseup").bind(this)),
  14520. e.addEventListener("mouseover", function(e) {
  14521. this.state === g.OPEN && i.classList.remove("has-hotzone")
  14522. }
  14523. .bind(this)),
  14524. i.addEventListener("mouseenter", function(e) {
  14525. this.state !== g.CLOSING && (this.hovering = !0,
  14526. this.emit(b.ENTER))
  14527. }
  14528. .bind(this)),
  14529. i.addEventListener("mouseleave", function(e) {
  14530. this.hovering = !1,
  14531. this.emit(b.LEAVE)
  14532. }
  14533. .bind(this)),
  14534. i.addEventListener("gesturestart", function(e) {
  14535. e.preventDefault()
  14536. });
  14537. var n = i.querySelector(".tag-text-content")
  14538. , r = 0;
  14539. n.addEventListener("touchstart", function(e) {
  14540. r = e.changedTouches[0].clientY
  14541. }),
  14542. n.addEventListener("touchmove", function(t) {
  14543. function e(e) {
  14544. e && (0 === e.scrollTop && t.changedTouches[0].clientY > r || e.scrollTop + e.clientHeight - e.scrollHeight == 0 && t.changedTouches[0].clientY < r) && t.preventDefault()
  14545. }
  14546. return i.classList.contains("overlay") ? e(this.querySelector(".tag-desc")) : void e(this)
  14547. }),
  14548. i.addEventListener("touchmove", function(e) {
  14549. 0 == (n.compareDocumentPosition(e.target) & Node.DOCUMENT_POSITION_CONTAINED_BY) && e.preventDefault()
  14550. })
  14551. }
  14552. ,
  14553. t.prototype.appendDescriptionElements = function(e, i) {
  14554. 0 < e.length && this.div.classList.add("has-text"),
  14555. e.forEach(function(e, t) {
  14556. switch (e.type) {
  14557. case h.TEXT:
  14558. i.appendChild(this.createTextElement(e.text));
  14559. break;
  14560. case h.LINK:
  14561. i.appendChild(this.createLinkElement(e.link))
  14562. }
  14563. }
  14564. .bind(this))
  14565. }
  14566. ,
  14567. t.prototype.appendLoadingSpinner = function() {
  14568. this.loadingSpinner = document.createElement("div"),
  14569. this.loadingSpinner.classList.add("loading-spinner");
  14570. var e = document.createElement("div");
  14571. e.classList.add("gui-spinner-icon"),
  14572. this.loadingSpinner.appendChild(e),
  14573. this.body.appendChild(this.loadingSpinner)
  14574. }
  14575. ,
  14576. t.prototype.onMediaLoadFinished = function() {
  14577. this.loadingSpinner && (this.loadingSpinner.parentNode.removeChild(this.loadingSpinner),
  14578. this.applyOrientation(this.orientation),
  14579. this.loadingSpinner = null)
  14580. }
  14581. ,
  14582. t.prototype.appendMedia = function() {
  14583. if (this.media && this.media.type && "error" !== this.media.type && (!c.valueFromHash("mls", 0) || this.media.type === h.IMAGE)) {
  14584. this.appendLoadingSpinner();
  14585. var e = document.createElement("div");
  14586. e.classList.add("tag-media-content");
  14587. var t = document.createElement("i");
  14588. switch (["icon", "icon-close-thin", "close"].forEach(function(e) {
  14589. t.classList.add(e)
  14590. }),
  14591. this.body.appendChild(t),
  14592. this.body.appendChild(e),
  14593. this.media.type) {
  14594. case h.IMAGE:
  14595. e.appendChild(this.createImageElement(this.media, this.body));
  14596. break;
  14597. case h.VIDEO:
  14598. e.appendChild(this.createVideoElement(this.media, this.body));
  14599. break;
  14600. case h.RICH:
  14601. e.appendChild(this.createEmbedElement(this.media, this.body))
  14602. }
  14603. }
  14604. }
  14605. ,
  14606. t.prototype.createTextElement = function(e) {
  14607. var t = document.createElement("span");
  14608. return t.textContent = e,
  14609. t
  14610. }
  14611. ,
  14612. t.prototype.createLinkElement = function(e) {
  14613. var t = new i(e);
  14614. return t.on(w.LINK_CLICK, this.emit.bind(this, w.LINK_CLICK)),
  14615. t.createDomElement()
  14616. }
  14617. ,
  14618. t.prototype.createImageElement = function(t, C) {
  14619. function e() {
  14620. function e() {
  14621. p || (E.classList.remove("view-image"),
  14622. a.classList.add("overlay"),
  14623. t(),
  14624. window.addEventListener("resize", A),
  14625. a.addEventListener("click", i),
  14626. c.addEventListener("click", r),
  14627. o.addEventListener("click", n),
  14628. p = !0,
  14629. _.emit(w.IMAGE_OPENED))
  14630. }
  14631. function t() {
  14632. C.classList.add("show-info"),
  14633. s.classList.remove("collapsible"),
  14634. s.style.height = "";
  14635. var e = parseFloat(getComputedStyle(v).lineHeight)
  14636. , t = g + e
  14637. , i = a.clientWidth - 2 * T.boundaryWidth - m
  14638. , n = a.clientHeight - 2 * T.boundaryHeight - m - t
  14639. , r = n
  14640. , o = r * I.aspect;
  14641. i < o && (r = (o = i) / I.aspect),
  14642. n < r && (o = (r = n) * I.aspect),
  14643. o += m,
  14644. r += m + t,
  14645. C.style.width = o + "px",
  14646. C.style.height = r + "px",
  14647. l.style.paddingTop = e + m + "px",
  14648. 0 < _.description.length && (s.classList.add("collapsible"),
  14649. s.style.height = s.clientHeight + 12 + "px",
  14650. y.style.height = "calc(100% - " + v.clientHeight + "px)")
  14651. }
  14652. function i(e) {
  14653. e.target === a && n()
  14654. }
  14655. function n() {
  14656. p && (p = !1,
  14657. E.classList.add("view-image"),
  14658. a.classList.remove("overlay"),
  14659. s.style.height = "",
  14660. l.style.paddingTop = "",
  14661. C.style.width = "",
  14662. C.style.height = "",
  14663. window.removeEventListener("resize", A),
  14664. a.removeEventListener("click", i),
  14665. c.removeEventListener("click", r),
  14666. o.removeEventListener("click", n),
  14667. _.emit(w.IMAGE_CLOSED),
  14668. _.close(!0))
  14669. }
  14670. function r(e) {
  14671. C.classList.toggle("show-info")
  14672. }
  14673. var a = _.div
  14674. , s = a.getElementsByClassName("tag-content")[0]
  14675. , l = a.getElementsByClassName("tag-media-content")[0]
  14676. , o = C.getElementsByClassName("close")[0]
  14677. , c = s.getElementsByClassName("tag-label")[0];
  14678. a.classList.add("has-image"),
  14679. E.classList.add("view-image"),
  14680. a.classList.add(1 <= I.aspect ? "image-landscape" : "image-portrait"),
  14681. _.applyOrientation(_.orientation);
  14682. var h, u, d, p = !1, f = getComputedStyle(s), g = parseFloat(f.paddingTop) + parseFloat(f.paddingBottom), m = 2 * parseFloat(getComputedStyle(l).paddingLeft), v = s.querySelector(".tag-label"), y = s.querySelector(".tag-desc"), A = (d = 0,
  14683. function() {
  14684. clearInterval(h),
  14685. clearTimeout(u),
  14686. h = setInterval(function() {
  14687. var e = a.clientHeight;
  14688. d !== e && (t(),
  14689. d = e)
  14690. }, 100),
  14691. u = setTimeout(clearInterval.bind(this, h), 1e3)
  14692. }
  14693. );
  14694. I.on(w.IMAGE_OPENING, e),
  14695. _.on(b.ACTIVATE, e),
  14696. _.on(w.IMAGE_CLOSED, I.onClosed.bind(I)),
  14697. _.on(b.CLOSING, n)
  14698. }
  14699. var I = new n
  14700. , E = I.createDomElement();
  14701. this.once(b.OPENED, function() {
  14702. I.load(t.src).then(e).catch(function(e) {
  14703. p.warn("Failed to load image:", t.src),
  14704. p.warn("with error:", e)
  14705. }).then(this.onMediaLoadFinished.bind(this))
  14706. });
  14707. var _ = this;
  14708. return E
  14709. }
  14710. ,
  14711. t.prototype.createVideoElement = function(t, e) {
  14712. var i = new o({
  14713. autoPlay: !0,
  14714. autoResume: !0,
  14715. startMuted: !1,
  14716. loop: !1
  14717. })
  14718. , n = i.createDomElement();
  14719. return this.once(b.OPENED, function() {
  14720. i.load(t.src).then(function() {
  14721. this.div.classList.add("has-video"),
  14722. this.state !== g.OPEN && this.state !== g.ACTIVE || (i.show(),
  14723. i.play()),
  14724. this.on(b.OPENING, i.show.bind(i)),
  14725. this.on(b.OPENED, i.play.bind(i)),
  14726. this.on(b.CLOSING, i.pause.bind(i)),
  14727. this.on(b.CLOSED, i.hide.bind(i))
  14728. }
  14729. .bind(this)).catch(function(e) {
  14730. p.warn("Failed to embed video:", t.src),
  14731. p.warn("with error:", e)
  14732. }).then(this.onMediaLoadFinished.bind(this))
  14733. }
  14734. .bind(this)),
  14735. n
  14736. }
  14737. ,
  14738. t.prototype.createEmbedElement = function(t, e) {
  14739. var i = new a
  14740. , n = i.createDomElement();
  14741. return this.once(b.OPENED, function() {
  14742. i.load(t.src).then(function() {
  14743. this.div.classList.add("has-embed"),
  14744. this.state !== g.OPEN && this.state !== g.ACTIVE || i.show(),
  14745. this.applyOrientation(this.orientation),
  14746. this.on(b.OPENING, i.show.bind(i)),
  14747. this.on(b.CLOSED, i.hide.bind(i))
  14748. }
  14749. .bind(this)).catch(function(e) {
  14750. p.warn("Failed to embed:", t.src),
  14751. p.warn("with error:", e)
  14752. }).then(this.onMediaLoadFinished.bind(this))
  14753. }
  14754. .bind(this)),
  14755. n
  14756. }
  14757. ,
  14758. t.prototype.open = function(e) {
  14759. return this.openPromise = $.Deferred(),
  14760. this.state === g.ACTIVE ? this.openPromise.resolve().promise() : (this.hovering || this.div.classList.add("has-hotzone"),
  14761. this.openTransition ? e && this.setActiveState() : this.openTransition = s.setTimeout(function() {
  14762. this.state !== g.OPEN && (this.emit(b.OPENING),
  14763. e && this.emit(b.ACTIVATING),
  14764. this.state = g.OPENING,
  14765. this.animateOpen(function() {
  14766. e && this.setActiveState(),
  14767. this.openPromise.resolve()
  14768. }
  14769. .bind(this)))
  14770. }
  14771. .bind(this), d.animation.openDelay),
  14772. s.cancel(this.closeTransition),
  14773. this.closePromise && this.closePromise.reject(),
  14774. this.closeTransition = void 0,
  14775. this.openPromise.promise())
  14776. }
  14777. ,
  14778. t.prototype.close = function(e) {
  14779. return this.closePromise = $.Deferred(),
  14780. !e && this.hovering ? this.closePromise.reject().promise() : (this.closeTransition || (this.closeTransition = s.setTimeout(function() {
  14781. this.state !== g.CLOSED && (this.emit(b.CLOSING),
  14782. this.state = g.CLOSING,
  14783. this.animateClose())
  14784. }
  14785. .bind(this), d.animation.closeDelay)),
  14786. s.cancel(this.openTransition),
  14787. this.openPromise && this.openPromise.reject(),
  14788. this.openTransition = void 0,
  14789. this.closePromise.resolve(),
  14790. this.closePromise.promise())
  14791. }
  14792. ,
  14793. t.prototype.setActiveState = function() {
  14794. this.state !== g.CLOSED && (this.state = g.ACTIVE,
  14795. this.emit(b.ACTIVATE),
  14796. this.div.classList.remove("has-hotzone"))
  14797. }
  14798. ,
  14799. t.prototype.animateOpen = function(e) {
  14800. if (this.state === g.OPENING) {
  14801. if (s.cancel(this.animationTransition),
  14802. c.detectSamsungNative())
  14803. return this.boardOrientation = null,
  14804. this.div.style.visibility = "visible",
  14805. this.emit(b.OPENED),
  14806. this.state = g.OPEN,
  14807. void (e && e());
  14808. this.div.style.webkitTransform = "scale(0)",
  14809. this.div.style.transform = "scale(0)",
  14810. this.div.style.visibility = "visible",
  14811. this.animationTransition = s.start(l.property(this, "animationScale", 1), d.animation.openDuration, function() {
  14812. this.emit(b.OPENED),
  14813. this.state = g.OPEN,
  14814. e && e()
  14815. }
  14816. .bind(this))
  14817. }
  14818. }
  14819. ,
  14820. t.prototype.animateClose = function(e) {
  14821. this.state === g.CLOSING && (s.cancel(this.animationTransition),
  14822. this.animationTransition = s.start(l.property(this, "animationScale", 0), d.animation.closeDuration, function() {
  14823. this.emit(b.CLOSED),
  14824. this.state = g.CLOSED,
  14825. this.div.style.visibility = "hidden",
  14826. this.div.classList.contains("has-hotzone") || this.div.classList.add("has-hotzone"),
  14827. e && e()
  14828. }
  14829. .bind(this)))
  14830. }
  14831. ,
  14832. t.prototype.needsUpdate = function() {
  14833. return this.state !== g.CLOSED
  14834. }
  14835. ,
  14836. t.prototype.update = function(e, t) {
  14837. if (this.needsUpdate()) {
  14838. var i = (this.updateOrientation(e),
  14839. this.calcScale(t))
  14840. , n = {
  14841. x: (e.x + 1) * $("#player").width() / 2,
  14842. y: (e.y + 1) * $("#player").height() / 2
  14843. };
  14844. this.div.screenTransform = this.initialTransform + " translate(" + n.x + "px, " + n.y + "px) scale(" + i * this.animationScale + ")",
  14845. this.div.style.webkitTransform = this.div.screenTransform,
  14846. this.div.style.transform = this.div.screenTransform
  14847. }
  14848. }
  14849. ,
  14850. t.prototype.getDimensions = function() {
  14851. return this.div.getBoundingClientRect()
  14852. }
  14853. ,
  14854. t.prototype.calcScale = function(e) {
  14855. return Math.sqrt(e / 40) * d.boardToDiscRatio
  14856. }
  14857. ,
  14858. t.prototype.updateOrientation = function(e) {
  14859. if (this.state !== g.ACTIVE) {
  14860. var t = e.y < -1 / 3 ? 0 : e.y < 1 / 3 ? 1 : 2
  14861. , i = e.x < -1 / 3 ? 0 : e.x < 1 / 3 ? 1 : 2
  14862. , n = "";
  14863. n += 0 == i ? "right" : 2 == i ? "left" : "",
  14864. n += 0 == t ? "-down" : 2 == t ? "-up" : "",
  14865. 1 == i && (n = 0 == t ? "bottom" : 2 == t ? "top" : "",
  14866. 1 == t && (n = $("#player").width() > $("#player").height() ? e.x < 0 ? "right" : "left" : e.y < 0 ? "bottom" : "top")),
  14867. 1 == i && 1 == t && n === this.orientation || this.applyOrientation(n)
  14868. }
  14869. }
  14870. ,
  14871. t.prototype.applyOrientation = function(e) {
  14872. this.div.style.transform = this.div.style.webkitTransform = "",
  14873. this.div.classList.remove("tag-container-" + this.orientation),
  14874. this.div.classList.add("tag-container-" + e);
  14875. var t = window.getComputedStyle(this.div);
  14876. this.initialTransform = t.transform || t.webkitTransform,
  14877. "none" === this.initialTransform && (this.initialTransform = "");
  14878. var i = t.transform.slice(7, -1).split(",")
  14879. , n = -i[4]
  14880. , r = -i[5];
  14881. this.div.style.webkitTransformOrigin = n + "px " + r + "px",
  14882. this.div.style.transformOrigin = n + "px " + r + "px",
  14883. this.orientation = e
  14884. }
  14885. ,
  14886. v.exports = t
  14887. }
  14888. ).call(this, "/js/tag/Billboard/Billboard.js")
  14889. }
  14890. , {
  14891. "../../util/browser": 182,
  14892. "../../util/lerp": 188,
  14893. "../../util/logger": 189,
  14894. "../../util/transitions": 195,
  14895. "../Media/EmbedlyEmbed": 125,
  14896. "../Media/EmbedlyPlayer": 126,
  14897. "../Media/Image": 128,
  14898. "../Media/Link": 129,
  14899. "../Media/MediaEvent": 131,
  14900. "../Parser/DescriptionChunkType": 133,
  14901. "../Parser/DescriptionParser": 134,
  14902. "./BillboardEvent": 120,
  14903. "./billboardSettings": 121,
  14904. "./overlaySettings": 122,
  14905. events: 202
  14906. }],
  14907. 120: [function(e, t, i) {
  14908. "use strict";
  14909. t.exports = Object.freeze({
  14910. ENTER: "billboard.enter",
  14911. LEAVE: "billboard.leave",
  14912. OPENING: "billboard.opening",
  14913. OPENED: "billboard.open",
  14914. CLOSING: "billboard.closing",
  14915. CLOSED: "billboard.closed",
  14916. ACTIVATING: "billboard.activating",
  14917. ACTIVATE: "billboard.activate"
  14918. })
  14919. }
  14920. , {}],
  14921. 121: [function(e, t, i) {
  14922. "use strict";
  14923. t.exports = Object.freeze({
  14924. animation: Object.freeze({
  14925. hoverOnClosing: !1,
  14926. openDelay: 100,
  14927. closeDelay: 50,
  14928. openDuration: 200,
  14929. closeDuration: 100
  14930. }),
  14931. boardToDiscRatio: 1.2
  14932. })
  14933. }
  14934. , {}],
  14935. 122: [function(e, t, i) {
  14936. "use strict";
  14937. t.exports = Object.freeze({
  14938. boundaryWidth: 30,
  14939. boundaryHeight: 0
  14940. })
  14941. }
  14942. , {}],
  14943. hot: [function(e, t, i) {
  14944. "use strict";
  14945. function n(e, t, i) {
  14946. this.sid = e,
  14947. this.position = this.convertValue(t.position, g.Vector3)
  14948. if(t.quaternion){
  14949. this.quaternion = this.convertValue(t.quaternion, g.Quaternion)
  14950. }else{
  14951. this.rotation = new g.Euler().setFromVector3(this.convertValue(t.rotation, g.Vector3 ))
  14952. }
  14953. this.quaternion || (this.quaternion = new THREE.Quaternion().setFromEuler(this.rotation))
  14954. this.isSprite = t.isSprite
  14955. this.noAction = t.noAction
  14956. this.linkType = t.linkType || "common"
  14957. this.link = t.link,
  14958. this.model = i,
  14959. this.size = t.size;
  14960. this.styleTex = [] // 存储热点icon的图片 [{src:...}, {src:...} ] 最多两个,里面是带有src的object, 可以是img
  14961. this.build()
  14962. t.infoAttribute && t.infoAttribute.title && this.createTitleElem(t.infoAttribute.title)
  14963. this.changeTex()
  14964. this.setVisiblePanos(t.visiblePanos);
  14965. this.infoAttribute = t.infoAttribute;
  14966. }
  14967. var g = e("three")
  14968. , r = e("../shaders")
  14969. , m = e("../settings")
  14970. , v = e("../enum/Viewmode")
  14971. , d = e("../objects/Panorama")
  14972. , o = e("../util/texture")
  14973. , math = e("../util/math")
  14974. , p = new g.Raycaster
  14975. , a = new g.PlaneBufferGeometry(g_HotMeshSize.g_HotMeshWidth,g_HotMeshSize.g_HotMeshHeight,1,1)
  14976. var defaultTex1 = o.load(g_HotImage.point);
  14977. var defaultTex2 = o.load(g_HotImage.point2)
  14978. n.prototype.changeTex = function(){
  14979. var u = this.mesh.material.uniforms
  14980. if(this.styleTex.length){
  14981. u.texture1.value = o.load(this.styleTex[0].src);
  14982. u.texture2.value = o.load(this.styleTex[1]&&this.styleTex[1].src || this.styleTex[0].src);
  14983. }else{
  14984. u.texture1.value = defaultTex1;
  14985. u.texture2.value = defaultTex2;
  14986. }
  14987. }
  14988. n.prototype.initStyleImg = function(t){
  14989. this.styleTex = []
  14990. t.styleImg = t.styleImg || [];
  14991. t.styleImg.forEach((src)=>{
  14992. this.styleTex.push({src:manage.dealURL(src)})
  14993. })
  14994. this.changeTex()
  14995. }
  14996. n.prototype.update = function(camera) {
  14997. if(this.isSprite){
  14998. this.mesh.quaternion.copy(camera.quaternion)
  14999. }
  15000. }
  15001. n.prototype.setVisiblePanos = function(visibleData){
  15002. if(visibleData == "get"){
  15003. this.visiblePanos = player.model.panos.list.map((pano)=>{return pano.id})
  15004. }else if(visibleData){
  15005. this.visiblePanos = visibleData;
  15006. }
  15007. }
  15008. n.prototype.build = function() {
  15009. var t = g.UniformsUtils.clone(r.hot.uniforms);
  15010. var e = new g.Mesh(a, new g.ShaderMaterial({
  15011. uniforms: t,
  15012. vertexShader: r.hot.vertexShader,
  15013. fragmentShader: r.hot.fragmentShader,
  15014. transparent: !0
  15015. }))
  15016. , t = parseFloat(window.MP_PREFETCHED_MODELDATA.hotIconScale);
  15017. e.dynamic = !0,
  15018. e.position.copy(this.position);
  15019. e.quaternion.copy(this.quaternion)
  15020. t && e.scale.set(t, t, t),
  15021. e.name = this.sid,
  15022. e.type = "hotSprite",
  15023. (e.belongHot = this).link && (e.hotLink = this.link),
  15024. this.mesh = e,
  15025. this.model.add(e),
  15026. g_HotMeshes.push(e);
  15027. }
  15028. n.prototype.createTitleElem = function(title){
  15029. var root = $("#hot");
  15030. var elem = $(`<div> ${title}</div>`)
  15031. root.append(elem);
  15032. this.titleElem = elem;
  15033. }
  15034. n.prototype.showTitle = function(){
  15035. if(!this.titleElem)return;
  15036. var pos = math.getPos2d(this.position, player.camera, $("#player")[0])
  15037. this.titleElem.css( { "left" : `${pos.pos.x}px`, "top": `${pos.pos.y}px ` });
  15038. this.titleElem.css("display","block");
  15039. }
  15040. n.prototype.hideTitle = function(){
  15041. if(!this.titleElem)return;
  15042. this.titleElem.css("display","none");
  15043. }
  15044. ,
  15045. n.prototype.closestPanoTowardTag = function(e, t) {
  15046. var i = []
  15047. , n = []
  15048. , r = this.mesh.position;
  15049. if (e === v.PANORAMA) {
  15050. var o = t.position.clone().sub(r).normalize();
  15051. n.push(d.scoreFunctions.direction(r, o))
  15052. }
  15053. var a = new g.Vector3;
  15054. i.push(function(e) {
  15055. return Math.abs(e.position.x - r.x) > m.tags.visibility.cameraClearance || Math.abs(e.position.z - r.z) > m.tags.visibility.cameraClearance
  15056. }, function(e) {
  15057. a.copy(r).sub(e.position);
  15058. var t = -g.Math.radToDeg(Math.atan(a.y / Math.sqrt(a.x * a.x + a.z * a.z)))
  15059. , i = m.tags.navigate.tiltTolerance;
  15060. return m.insideLookLimitDown - i < t && t < m.insideLookLimitUp + i
  15061. },
  15062. (pano)=>{ // add
  15063. player.checkHasNeighbor(pano)
  15064. }
  15065. ),
  15066. n.push(d.scoreFunctions.distanceSquared(this.mesh, -2));
  15067. var s = t.model.panos.sortByScore(i, n);
  15068. if (s && m.tags.navigate.lineOfSight) {
  15069. for (var l = 0; l < s.length; l++) {
  15070. var c = s[l].pano
  15071. , h = c.position.distanceTo(r);
  15072. p.set(c.position, r.clone().sub(c.position).normalize());
  15073. var u = p.intersectObjects(t.model.colliders);
  15074. if (0 === u.length || u[0].distance > h)
  15075. return console.log(l),
  15076. c
  15077. }
  15078. return null
  15079. }
  15080. return s && 0 < s.length && s[0].pano
  15081. }
  15082. var getLink = function(link){
  15083. var src = '';
  15084. var r = link.substring(link.indexOf("html") + 4)
  15085. , o = "en" == manage.number("lang") ? "&lang=" + manage.number("lang") : "";
  15086. -1 == r.indexOf("?") ? src = link + "?time=" + randomTime().getTime() + "&id=" + window.number + o : src = link + "&time=" + randomTime().getTime() + "&id=" + window.number + o
  15087. return src
  15088. }
  15089. n.prototype.examine = function(e, options) {
  15090. options = options || {}
  15091. if(this.linkType!="common" && this.infoAttribute.iframe && this.infoAttribute.iframe[0] && !options.dontOpen){
  15092. var src = getLink(this.infoAttribute.iframe[0]);
  15093. if(this.linkType=="jumpLink"){
  15094. var newPage = window.open(src, "_blank" );
  15095. newPage.focus();
  15096. }else if(this.linkType=="iframeDiv"){
  15097. var div = document.createElement("div");
  15098. $("body").append(div);
  15099. div.style.position = 'fixed';
  15100. div.style.width = div.style.height = "100%";
  15101. div.style.left = div.style.top = '0';
  15102. div.style["z-index"] = "999"
  15103. var exit = document.createElement("div");
  15104. exit.style["background-image"] = "url(images/vrOffImg.png)";
  15105. exit.style.position = 'absolute';
  15106. exit.style.width = exit.style.height = "50px";
  15107. exit.style.left = '17px'; exit.style.top = "20px"
  15108. exit.style.cursor = "pointer";
  15109. exit.style["background-repeat"] = "no-repeat";
  15110. exit.style["background-size"] = "25%";
  15111. exit.style["background-position"] = "center center";
  15112. exit.style["background-color"] = "rgba(0, 0, 0, 0.2)";
  15113. exit.style["border-radius"] = "50%";
  15114. exit.style["z-index"] = "3"
  15115. exit.onclick = ()=>{
  15116. $(div).remove()
  15117. if(g_bgAudio && g_bgAudio.pauseByHot){
  15118. manage.switchBgmState(true)
  15119. }
  15120. }
  15121. var myElement = document.createElement("iframe");
  15122. myElement.style.position = 'absolute';
  15123. myElement.style.width = myElement.style.height = "100%";
  15124. myElement.style.left = myElement.style.top = '0';
  15125. myElement.src = src
  15126. div.appendChild(exit);
  15127. div.appendChild(myElement)
  15128. if(g_bgAudio && !g_bgAudio.paused){
  15129. manage.switchBgmState(false);
  15130. g_bgAudio.pauseByHot = true
  15131. }
  15132. if(g_tourAudio)g_tourAudio.pause()
  15133. }
  15134. return;
  15135. }
  15136. if(!player.currentPano)return;
  15137. var i = document.getElementById("popup");
  15138. if (this.link && !options.dontOpen) {
  15139. g_currentHot = this,
  15140. i.style.display = "block",
  15141. i.classList.add("wait");
  15142. var n = document.createElement("iframe");
  15143. if(g_bgAudio && !g_bgAudio.paused){
  15144. manage.switchBgmState(false);
  15145. g_bgAudio.pauseByHot = true
  15146. }
  15147. if(g_tourAudio)g_tourAudio.pause()
  15148. var src = getLink(this.link )
  15149. n.src = src;
  15150. n.id = "id1",
  15151. n.allowTransparency = "true";
  15152. var a = document.getElementById("id1");
  15153. if (void 0 === a || null == a) {
  15154. document.querySelector(".popup-content").appendChild(n);
  15155. var s = !1;
  15156. window.loaddingSuccess = function() {
  15157. s = !0
  15158. }
  15159. ,
  15160. setTimeout(function e() {
  15161. if (s) {
  15162. var t = document.querySelector("#id1").contentWindow.document;
  15163. t.querySelector("video") && (t.querySelector("video").play(),
  15164. !t.querySelector("video").paused && t.querySelector(".playPause") && t.querySelector(".playPause").classList.add("fa-pause")),
  15165. t.querySelector("audio") && t.querySelector("audio").play()
  15166. } else
  15167. setTimeout(e, 300)
  15168. }, 800)
  15169. }
  15170. }
  15171. var l = e.mode
  15172. , c = m.tags.navigate.nearestPano && this.closestPanoTowardTag(l, e.currentPano) || e.currentPano
  15173. , h = this.mesh.position;
  15174. e.flyingToTag = !0;
  15175. var u = function() {
  15176. e.flyingToTag = !1;
  15177. options.dontOpen || this.link && i.classList.remove("wait")
  15178. }
  15179. .bind(this);
  15180. if (l === v.PANORAMA) {
  15181. var d = {
  15182. pano: c,
  15183. lookAtPoint: h,
  15184. duration: null,
  15185. maxDistanceOverride: null,
  15186. skipWarpingCheck: !1
  15187. };
  15188. e.flyToPano(d, u)
  15189. } else {
  15190. var p = {
  15191. pano: c
  15192. };
  15193. if (h) {
  15194. var f = (new g.Matrix4).lookAt(c.position, h, new g.Vector3(0,1,0));
  15195. p.quaternion = (new g.Quaternion).setFromRotationMatrix(f)
  15196. }
  15197. p.callback = u,
  15198. p.duration = 1500,
  15199. p.mode = v.PANORAMA,
  15200. e.flyToNewMode(p)
  15201. }
  15202. }
  15203. ,
  15204. n.prototype.dispose = function(){
  15205. this.mesh.parent.remove(this.mesh);
  15206. var index = g_HotMeshes.indexOf(this.mesh);
  15207. g_HotMeshes.splice(index,1)
  15208. }
  15209. /* n.prototype.conversionArray = function(e) {
  15210. if ("[object Array]" == Object.prototype.toString.call(e))
  15211. return e;
  15212. var t = [];
  15213. for (var i in e)
  15214. t.push(parseFloat(e[i]));
  15215. return t
  15216. } */
  15217. n.prototype.convertValue = function(v ,Type){
  15218. var value;
  15219. if(v instanceof Array){
  15220. v.forEach((v1)=>{v1 = parseFloat(v1)})
  15221. value = new Type().fromArray(v);
  15222. }else{
  15223. for(let i in v){v[i] = parseFloat(v[i])}
  15224. value = new Type().copy(v);
  15225. }
  15226. return value
  15227. }
  15228. ,
  15229. t.exports = n
  15230. }
  15231. , {
  15232. three: 217,
  15233. "../shaders": 167,
  15234. "../enum/Viewmode": 51,
  15235. "../objects/Panorama": 148,
  15236. "../util/texture": 194,
  15237. "../settings": 166,
  15238. "../util/math": 190,
  15239. }],
  15240. 123: [function(M, R, e) {
  15241. (function(e) {
  15242. "use strict";
  15243. function d(e, t, i) {
  15244. var n = i.version || "0";
  15245. "0" !== n && w.info("tag defined using version " + n),
  15246. this.model = e,
  15247. this.sid = t,
  15248. this.color = (new f.Color).set(i.color || o.tagDefault),
  15249. this.hoverColor = o._darken(this.color, .2),
  15250. this.floor = null,
  15251. this.floorIndex = i.floor,
  15252. this.mode = m.PANORAMA,
  15253. i.preferred_camera && i.preferred_camera.mode && (this.mode = i.preferred_camera.mode),
  15254. this.obj3d = null,
  15255. this.disc = null,
  15256. this.materials = {
  15257. disc: null,
  15258. pole: null
  15259. },
  15260. this.position = (new f.Vector3).copy(i.position),
  15261. this.discPosition = (new f.Vector3).copy(i.stem.direction),
  15262. this.discWorldPosition = null,
  15263. this.discScale = .05,
  15264. this.poleEnabled = i.stem.enabled,
  15265. this.billboard = new r(i.label,i.description,i.media,this),
  15266. this.visibleTransition = null,
  15267. this.hoveringDisc = !1
  15268. }
  15269. var i, l, c, h, u, p, n, f = M("three"), r = M("./Billboard/Billboard"), g = M("../settings"), m = M("../enum/Viewmode"), o = M("../enum/Colors"), a = M("../enum/RenderLayers"), s = M("../enum/RenderOrder"), v = (M("../util/common"),
  15270. M("../util/math")), t = M("../util/texture"), y = M("../objects/Panorama"), A = M("../shaders"), C = M("../util/transitions"), I = M("../util/lerp"), E = M("../util/easing"), _ = M("./Billboard/BillboardEvent"), b = M("events").EventEmitter, w = new (M("../util/logger"))(e), T = t.loadBase64("iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4QYPFigDGhCnowAABQFJREFUeNrtXTtyFEEMHXX5FK7iAiYFQ+KAiMyZCQnxRXwVFwkngSKD2BQXEYlNLXaZnZ7RX0/xbrek96RW9/RnWSCthSoaxcys4iwiAgGagN2FFATQe5OBAHpvMhBA700GAvC9iUBVgZd2dmTd9siIAvxOB9/RI9GI3kftf3a0t0YG2OOEaOk0qy2UyWFZKutMthGc09tWiuyQKkuvke2miE6ouOYe1QcE4HsTgSIY2gX4iP4ZHcFn5kt+KpfmFfhK2zXXDMgR/FdE9D3ivNyaqMz8YlmW3x46kIfjNQyxXlnzskG6X8psQJjlVGObJPtLqXj1DSGWvhyZFI70EUVTv3tf3VkEAWmDLwV8xmmehe17+6DIymFHkL6fKaJS2BFk5+8RzUlVwY9qG0ViY2XwLfyzpV2KoEQX4C18NdsmAfzeJBiRDekg3ruGhpCi7wC+eXH4XqI9kc+Rs4wE+DZ+XNPeiKY0MoHtUHCyU6nTLOBnISoz84yuRETP6bqmLdrjiMhOjXw0zJKsx9oaxcC/1j4atizLdaah4GidYEEAbfC9NpVGsmsrVgTwe5PgZEkqUbaSP+iRds9CxuiPeo4ggr2z2A1Efg/dNs0CokV/Bgd7b3mf7X9EWQCpFF2ZhqiZDHDqFf0p79/zXYhajRWt7cgr/Wc/OOrli7U4DmllAb6eDRr4jKhAVDoyHtl/otNAfOrNt9YwIoJX8lr2QDYdYh1xIehN4QB+G46YUtW/2GHF4tfFWPvpGK7RMsCvBsP4F2SAptHv4atVGQDVe9/ZxLEh4AOiP+aMYMLnH48OAUj/fYeBsUBaCwgAAtQYEzvWAcgAEBAA4kwArCHknkkgAyADQEAACAgAAQEgIMC8dH3vJ4JI+B4ZABkAAgI4S8fFpCg2IwMgA0BAgOfT1BVclH6o+S+GR++3wbawmOO/BC5/t4RhLt93DWFUiwxU/ygCIZIEsH4FnJk/FY5+Edsk6zJa82McEI2V/qUKwH8yQNTz6wBfrwAUrwEwm7AFz6wI9GBvpSwQ2X9Dml3RbsWqBL4GPjOvhp2hHsihOzO/1FgH+Dnx2/PuJFDQecanP1ZnhBnlcVl0Dttn8Btahnnfmg3w5YcAzKcLDlVp3wyKNhxkfC1kWRK/GfRgbPVHo7RlbGGedy3wWBdmvnEA/qb0s3GSw4BlpFgQLqIdKgTISgINIrR8OnZFxxeRa4RDsf6/oZ27MCBthlUrmipFv8g6gMeb9wBfLphEnoxh5luQwBz8W4n2TNMNhgMb3820J7YUvAVMZAL/wBHvHJnAF/zZNkkj2rdGdhciaPlnS7ubUzBIkB980RpAaoGicl2wA3y1U9q0E2TWBLNKNtD2w572h6Zh96uoF3vaz5wR9urPzBfaQSZ1no8NouD1sixfk2B/TkTfovtUjACWCkceGiztk+rL/JNpxYMj1jZJ9ueyc7fCjmEvG1zOBko75r44vJXu91C0CjqN9pn51itw1Cps64slJHSLpIuVbmoLQTOXGFjvLKJnxBj4iwhBQlEY7hWBHhLJJ9TRaADvQIAtlXoVIkS2m6I7IzMRMthqfjh0S8F1sDv7LAHoZ1u2knt990h7rq7S4VBPWyi787ycWOVy7DCvh0t8M38kV4JgX0meFIr0mTtkcVV1W1jEYjZ0dY0dQc0JkJkMWaaubebXAL0QASKRIftqJa5lbwQ2BPJE/gA4gL5xbiNHuQAAAABJRU5ErkJggg=="), x = t.loadBase64("iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4QYPFgoIKnA4CwAAAkVJREFUeNrt3Uluw0AMRFHTvv+NrSibBAgyILGjodn16gbS/yxyYUOXi0SnZnyodV3XXV5WVREgBHaKFAV6tgwFerYMBXq2DAV8tggFfLYIBXy2CAV8tggFfrYEBXy2CAV+tgQFfrYEBXy2CAV+tgQFfrYEBX62BAV+tgQFfrYEBX62BAV+tgQFfrYEBX62BAV+tgRXry5cHNOf3QIFfrYEBX62BG4AN4DpT26BAj9bAivACjD9yS2gATSA6U9uAQ2gAUx/cgtoAA1g+pNbQAOEhwBWgPpPXgMawAoQK0D9x64BDWAFiBWg/mPXgAawAoQAQgAJPgIdgLmHoAawAoQAQgAhgBBACCAEEAIIAYQAQgAhgBBACCAEEAIIAYQAQgAhgEwQfw1LBe+vYUIAIQAB3rIsy4vXEXwEOgTzDkArQAhgBXyKNZBT/xpACGAFfBNrIKP+NYAQwAr4IdbA/PWvAcR3A5OnXwOIbwcnT78GkN8bQAvMO/1/bgA/FglvAC0w5/Q/JAAJ5oPvCJTHGkALzDX9TwlAgnngPy0ACeaA7waQ5xtAC/Sf/n8LQILe8DcRgAR94W8mAAl6wt9UABL0g7+5ACToBX8XAUjQB/5uApCgB/xdBSDB+PB3F4AEY8M/RAAijAn+cAFIMB78wwUgwVjwTxGACGOAf8/1zAf2a+Nz4Z/aANrgXPBDCZAmwgjghxRgdhFGAj+0ALOJMCL4FgJ0lmFk6C0F6CBDF+jtBfiY+/2+3G63K+ihAhzZEN1hi3zJK04kLKvtOfg1AAAAAElFTkSuQmCC"), S = new f.PlaneBufferGeometry(1,1);
  15271. d.prototype = Object.create(b.prototype),
  15272. d.raycaster = new f.Raycaster,
  15273. d.prototype.bindEvents = function() {
  15274. this.billboard.on(_.ENTER, this.setHoverState.bind(this)),
  15275. this.billboard.on(_.LEAVE, this.setFreeState.bind(this))
  15276. }
  15277. ,
  15278. d.prototype.build = function() {
  15279. return this.floor = this.model.floors.get(this.floorIndex) || this.model.floors.first(),
  15280. this.floor && (this.billboard.build(this.model.sid),
  15281. this.obj3d = this.buildObject3D(),
  15282. this.floor.add(this.obj3d)),
  15283. this
  15284. }
  15285. ,
  15286. d.prototype.buildObject3D = function() {
  15287. var e = new f.Object3D;
  15288. e.position.copy(this.position);
  15289. var t = f.UniformsUtils.clone(A.tagDisc.uniforms);
  15290. t.bg.value = x,
  15291. t.mask.value = T,
  15292. t.color.value.copy(this.color),
  15293. this.materials.disc = new f.RawShaderMaterial({
  15294. transparent: !0,
  15295. vertexShader: A.tagDisc.vertexShader,
  15296. fragmentShader: A.tagDisc.fragmentShader,
  15297. uniforms: t
  15298. }),
  15299. this.disc = new f.Mesh(S,this.materials.disc),
  15300. this.disc.layers.set(a.TAG),
  15301. this.disc.position.copy(this.discPosition),
  15302. this.disc.renderOrder = s.tagDisc;
  15303. var i = (this.disc.tag = this).buildPole();
  15304. return i.layers.set(a.TAG),
  15305. i.renderOrder = s.tagStem,
  15306. e.add(i),
  15307. e.layers.set(a.TAG),
  15308. e.add(this.disc)
  15309. }
  15310. ,
  15311. d.prototype.buildPole = function() {
  15312. var e = new f.BufferGeometry
  15313. , t = new Float32Array(6);
  15314. return t[0] = t[1] = t[2] = 0,
  15315. t[3] = this.discPosition.x,
  15316. t[4] = this.discPosition.y,
  15317. t[5] = this.discPosition.z,
  15318. e.addAttribute("position", new f.BufferAttribute(t,3)),
  15319. this.materials.pole = new f.LineBasicMaterial({
  15320. linewidth: g.tags.pole.width,
  15321. color: g.tags.pole.color,
  15322. opacity: 0,
  15323. visible: this.poleEnabled,
  15324. transparent: !0,
  15325. depthWrite: !1
  15326. }),
  15327. new f.Line(e,this.materials.pole)
  15328. }
  15329. ,
  15330. d.prototype.setFreeState = function(e) {
  15331. !e && this.hoveringDisc || this.billboard.close(e).then(function() {
  15332. this.materials.disc.uniforms.color.value = this.color
  15333. }
  15334. .bind(this))
  15335. }
  15336. ,
  15337. d.prototype.setHoverState = function(e) {
  15338. this.billboard.open(e),
  15339. this.materials.disc.uniforms.color.value = this.hoverColor
  15340. }
  15341. ,
  15342. d.prototype.hide = function(e, t) {
  15343. var i = $.Deferred();
  15344. if (0 === this.materials.disc.uniforms.opacity.value && !C.isRunning(this.visibleTransition))
  15345. return i.resolve().promise();
  15346. e = e || 0,
  15347. t = t || 0,
  15348. C.cancel(this.visibleTransition);
  15349. var n, r, o, a = this.materials.disc.uniforms.opacity.value / g.tags.disc.opacity, s = t + e, l = t / s;
  15350. return this.visibleTransition = C.start((n = this,
  15351. r = I.property(n.materials.disc.uniforms.opacity, "value", 0),
  15352. o = I.property(n.materials.pole, "opacity", 0),
  15353. function(e) {
  15354. r(e),
  15355. n.materials.pole && o(e)
  15356. }
  15357. ), s * a, function() {
  15358. i.resolve()
  15359. }, l, E[g.warp.blendEasing]),
  15360. i.promise()
  15361. }
  15362. ,
  15363. d.prototype.show = function(e, t) {
  15364. var i = $.Deferred();
  15365. if (this.materials.disc.uniforms.opacity.value === g.tags.disc.opacity && !C.isRunning(this.visibleTransition))
  15366. return i.resolve().promise();
  15367. e = e || 0,
  15368. t = t || 0,
  15369. C.cancel(this.visibleTransition);
  15370. var n, r, o, a = (g.tags.disc.opacity - this.materials.disc.uniforms.opacity.value) / g.tags.disc.opacity, s = t + e, l = t / s;
  15371. return this.visibleTransition = C.start((n = this,
  15372. r = I.property(n.materials.disc.uniforms.opacity, "value", g.tags.disc.opacity),
  15373. o = I.property(n.materials.pole, "opacity", g.tags.pole.opacity),
  15374. function(e) {
  15375. r(e),
  15376. n.materials.pole && o(e)
  15377. }
  15378. ), s * a, function() {
  15379. i.resolve()
  15380. }, l, E[g.warp.blendEasing]),
  15381. i.promise()
  15382. }
  15383. ,
  15384. d.prototype.closestPanoTowardTag = function(e, t) {
  15385. var i = []
  15386. , n = []
  15387. , r = this.disc.getWorldPosition();
  15388. if (e === m.PANORAMA) {
  15389. var o = t.position.clone().sub(r).normalize();
  15390. i.push(y.filters.isPanoAligned()),
  15391. i.push(y.filters.inPanoDirection(r, o, .5)),
  15392. i.push(y.filters.isNeighbourPanoTo(t)),
  15393. n.push(y.scoreFunctions.direction(r, o))
  15394. }
  15395. var a = new f.Vector3;
  15396. i.push(function(e) {
  15397. return Math.abs(e.position.x - r.x) > g.tags.visibility.cameraClearance || Math.abs(e.position.z - r.z) > g.tags.visibility.cameraClearance
  15398. }, function(e) {
  15399. a.copy(r).sub(e.position);
  15400. var t = -f.Math.radToDeg(Math.atan(a.y / Math.sqrt(a.x * a.x + a.z * a.z)))
  15401. , i = g.tags.navigate.tiltTolerance;
  15402. return g.insideLookLimitDown - i < t && t < g.insideLookLimitUp + i
  15403. }),
  15404. n.push(y.scoreFunctions.distanceSquared(this, -2));
  15405. var s = this.model.panos.sortByScore(i, n);
  15406. if (g.tags.navigate.lineOfSight) {
  15407. for (var l = 0; l < s.length; l++) {
  15408. var c = s[l].pano
  15409. , h = c.position.distanceTo(r);
  15410. if (!g.tags.visibility.anyDistance && h > g.tags.visibility.visibleDistance)
  15411. return null;
  15412. d.raycaster.set(c.position, r.clone().sub(c.position).normalize());
  15413. var u = d.raycaster.intersectObjects(this.model.colliders);
  15414. if (0 === u.length || u[0].distance > h)
  15415. return c
  15416. }
  15417. return null
  15418. }
  15419. return 0 < s.length && s[0].pano
  15420. }
  15421. ,
  15422. d.prototype.examine = function(i) {
  15423. if(!player.currentPano)return;
  15424. var e = i.mode
  15425. , n = g.tags.navigate.nearestPano && this.closestPanoTowardTag(e, i.currentPano) || i.currentPano
  15426. , t = this.disc.getWorldPosition();
  15427. this.billboard.setActiveState();
  15428. var r = function() {
  15429. var e = this.billboard.getDimensions()
  15430. , t = new f.Vector3;
  15431. v.convertScreenPositionToNDC(e.left + e.width / 2, e.top + e.height / 2, t),
  15432. t.unproject(i.camera),
  15433. i.flyToPano({
  15434. pano: n,
  15435. lookAtPoint: t
  15436. })
  15437. }
  15438. .bind(this);
  15439. if (e === m.PANORAMA)
  15440. if (n !== i.currentPano) {
  15441. var o = {
  15442. pano: n,
  15443. lookAtPoint: t,
  15444. duration: null,
  15445. maxDistanceOverride: null,
  15446. skipWarpingCheck: !1
  15447. };
  15448. i.flyToPano(o, r)
  15449. } else
  15450. setTimeout(function() {
  15451. this.billboard.open().then(function() {
  15452. r()
  15453. })
  15454. }
  15455. .bind(this), 0);
  15456. else {
  15457. var a = {
  15458. pano: n
  15459. };
  15460. if (t) {
  15461. var s = (new f.Matrix4).lookAt(n.position, t, new f.Vector3(0,1,0));
  15462. a.quaternion = (new f.Quaternion).setFromRotationMatrix(s)
  15463. }
  15464. a.callback = r,
  15465. a.duration = 1500,
  15466. a.mode = m.PANORAMA,
  15467. i.flyToNewMode(a)
  15468. }
  15469. }
  15470. ,
  15471. d.prototype.update = (n = new f.Vector3,
  15472. function(e, t) {
  15473. this.discWorldPosition = this.disc.getWorldPosition(),
  15474. this.updateDisc(e, t),
  15475. this.billboard.needsUpdate() && (n.copy(this.discWorldPosition).project(t),
  15476. n.z < 1 && (n.y *= -1,
  15477. this.billboard.update(n, this.getDiscRadius(n, t))))
  15478. }
  15479. ),
  15480. d.prototype.updateDisc = (l = new f.Vector3,
  15481. c = new f.Vector3,
  15482. h = new f.Vector3,
  15483. u = new f.Vector3,
  15484. p = new f.Vector3,
  15485. function(e, t) {
  15486. var i = g.tags.visibility
  15487. , n = g.tags.disc.scale
  15488. , r = e === m.DOLLHOUSE || e === m.FLOORPLAN ? g.tags.visibility.visibleDistance : t.position.distanceTo(this.discWorldPosition);
  15489. if (this.obj3d.visible = 0 !== this.disc.material.opacity && (i.anyDistance || r <= i.visibleDistance || e === m.TRANSITIONING) && (!i.hideViaFloor || this.tagVisibleOnCurrentFloor(e)) && (!i.hideOffScreenDisc || !this.offScreen(this.disc, t)) && (!i.hideOffScreenObject || !this.offScreen(this.obj3d, t)),
  15490. this.obj3d.visible) {
  15491. this.disc.quaternion.copy(t.quaternion);
  15492. var o = n.maxSize - (n.maxSize - n.minSize) * f.Math.smoothstep(r, n.nearBound, n.farBound);
  15493. l.copy(this.discWorldPosition).project(t),
  15494. c.set($("#player").width() / 2, $("#player").height() / 2, 1).multiply(l),
  15495. h.set(o / 2, 0, 0).add(c),
  15496. u.set(2 / $("#player").width(), 2 / $("#player").height(), 1).multiply(h),
  15497. p.copy(u).unproject(t);
  15498. var a = p.distanceTo(this.discWorldPosition)
  15499. , s = 1 + g.tags.disc.scale.responsiveness / 100 * (d.viewportScale() - 1);
  15500. this.discScale = a * s,
  15501. this.disc.scale.set(this.discScale, this.discScale, this.discScale)
  15502. }
  15503. }
  15504. ),
  15505. d.prototype.getDiscRadius = (i = new f.Vector3,
  15506. function(e, t) {
  15507. return i.set(-this.discScale / 2, 0, 0).applyQuaternion(t.quaternion).add(this.discWorldPosition).project(t),
  15508. Math.abs(e.x - i.x) * $("#player").width()
  15509. }
  15510. ),
  15511. d.prototype.tagVisibleOnCurrentFloor = function(e) {
  15512. return !(e === m.DOLLHOUSE || e === m.FLOORPLAN) || this.model.allFloorsVisible || !this.floor.hidden
  15513. }
  15514. ,
  15515. d.prototype.offScreen = function(e, t) {
  15516. var i = e.getWorldPosition().project(t);
  15517. return !(-1 < i.x && i.x < 1 && -1 < i.y && i.y < 1)
  15518. }
  15519. ,
  15520. d.viewportScale = function() {
  15521. return d.viewportWidth === $("#player").width() && d.viewportHeight === $("#player").height() || (d.viewportWidth = $("#player").width(),
  15522. d.viewportHeight = $("#player").height(),
  15523. d.currentViewportScale = Math.sqrt(Math.min(d.viewportWidth, d.viewportHeight) / g.tags.disc.scale.baseViewportSize)),
  15524. d.currentViewportScale
  15525. }
  15526. ,
  15527. R.exports = d
  15528. }
  15529. ).call(this, "/js/tag/tag.js")
  15530. }
  15531. , {
  15532. "../enum/Colors": 19,
  15533. "../enum/RenderLayers": 41,
  15534. "../enum/RenderOrder": 42,
  15535. "../enum/Viewmode": 51,
  15536. "../objects/Panorama": 148,
  15537. "../settings": 166,
  15538. "../shaders": 167,
  15539. "../util/common": 185,
  15540. "../util/easing": 186,
  15541. "../util/lerp": 188,
  15542. "../util/logger": 189,
  15543. "../util/math": 190,
  15544. "../util/texture": 194,
  15545. "../util/transitions": 195,
  15546. "./Billboard/Billboard": 119,
  15547. "./Billboard/BillboardEvent": 120,
  15548. events: 202,
  15549. three: 217
  15550. }],
  15551. 124: [function(M, R, e) {
  15552. (function(e) {
  15553. "use strict";
  15554. function t() {
  15555. this.tagState = T.IDLE,
  15556. this.intersectTag = null,
  15557. this.hoveredTag = null,
  15558. this.activeTag = null,
  15559. this.tagDiscs = [],
  15560. this.raycaster = new i.Raycaster,
  15561. this.modelManager = null,
  15562. this.player = null,
  15563. this.totaltags = 0,
  15564. this.navigatingViaTag = !1,
  15565. this.enabled = !1
  15566. }
  15567. var o, h, u, d, p, f, s, l, c, i = M("three"), n = M("../util/logger"), r = M("../util/common"), a = M("../controls/serializer"), g = M("../objects/Snapshot"), m = M("../settings"), v = M("./Billboard/BillboardEvent"), y = M("./Media/MediaEvent"), A = M("./Media/LinkType"), C = M("../enum/Viewmode"), I = M("../enum/WarpStyle"), E = M("../enum/BlackoutStyle"), _ = M("../enum/ModelManagerEvents"), b = M("../enum/tagEvents"), w = M("../enum/PlayerEvents"), T = (M("../util/lerp"),
  15568. M("../enum/TagStates")), x = M("events").EventEmitter, S = new n(e);
  15569. r.extend(t, x),
  15570. t.prototype.init = function(e, t) {
  15571. this.modelManager = e,
  15572. this.player = t,
  15573. this.updateModel(),
  15574. this.bindEvents()
  15575. }
  15576. ,
  15577. t.prototype.update = function(e) {
  15578. this.updateTags(this.player.mode, this.player.camera, this.player.currentPano, this.player.flying)
  15579. }
  15580. ,
  15581. t.prototype.updateTags = function(e, t, i, n) {
  15582. for (var r in this.model.tags)
  15583. this.model.tags[r].update(e, t, i, n)
  15584. }
  15585. ,
  15586. t.prototype.updateModel = function() {
  15587. this.model = this.modelManager.getActiveModel(),
  15588. this.gettagsFromModel(),
  15589. this.totaltags = Object.keys(this.model.tags).length
  15590. }
  15591. ,
  15592. t.prototype.gettagsFromModel = function() {
  15593. for (var e in this.tagDiscs = [],
  15594. this.model.tags) {
  15595. var t = this.model.tags[e].disc;
  15596. t && this.tagDiscs.push(t)
  15597. }
  15598. }
  15599. ,
  15600. t.prototype.bindEvents = function() {
  15601. function e() {
  15602. Object.keys(this.model.tags).forEach(function(e) {
  15603. var t = this.model.tags[e];
  15604. t.bindEvents(),
  15605. t.billboard.on(y.LINK_CLICK, function(e) {
  15606. e.type === A.NAVIGATION && this.navigateViaLink(e.url)
  15607. }
  15608. .bind(this)),
  15609. t.billboard.on(y.IMAGE_OPENED, function() {
  15610. this.tagState = T.EXAMINE,
  15611. this.emit(y.IMAGE_OPENED)
  15612. }
  15613. .bind(this)),
  15614. t.billboard.on(v.CLOSING, this.dismissExaminedTag.bind(this))
  15615. }
  15616. .bind(this))
  15617. }
  15618. this.modelManager.on(_.ActiveModelChanged, this.updateModel.bind(this)),
  15619. this.modelManager.on(_.ActiveModelChanged, e.bind(this)),
  15620. this.player.on(w.ModeChanging, this.onPlayerModeChanging.bind(this)),
  15621. this.player.on(w.PanoChosen, this.onPanoChange.bind(this)),
  15622. this.player.on(w.Ready, this.onPlayerReady.bind(this)),
  15623. this.player.on(w.FlyingEnded, this.onPlayerFlyingEnded.bind(this)),
  15624. this.player.on(w.WarpStarted, this.handleWarpStart.bind(this)),
  15625. this.player.on(w.WarpInterrupted, this.handleWarpInterruption.bind(this)),
  15626. e.call(this)
  15627. }
  15628. ,
  15629. t.prototype.navigateViaLink = function(e) {
  15630. var t = a.deserialize(e);
  15631. if (t)
  15632. if (t.mode === C.PANORAMA) {
  15633. try {
  15634. this.player.model.panos.get(t.panoId)
  15635. } catch (e) {
  15636. return void S.warn("Unable to find panorama location", t.panoId)
  15637. }
  15638. this.player.warpToPanoById(t.panoId, t.quaternion, null, null, I.BLACK)
  15639. } else {
  15640. var i = {
  15641. cameraMode: t.mode,
  15642. position: t.position,
  15643. quaternion: t.quaternion,
  15644. scanId: t.panoId,
  15645. orthoZoom: t.zoom,
  15646. floorVisibility: t.floorVisibility,
  15647. thumbUrl: null,
  15648. name: null
  15649. };
  15650. this.player.flyToNewMode({
  15651. mode: t.mode,
  15652. duration: m.warp.outsideTime,
  15653. warpDest: new g(i),
  15654. force: !0
  15655. })
  15656. }
  15657. }
  15658. ,
  15659. t.prototype.handleWarpStart = function(e, t, i, n) {
  15660. this.dismissExaminedTag(),
  15661. t === I.BLACK && (null != n || (n = m.warp.teleportTime),
  15662. e && (i = E.END),
  15663. this.hideShowTagsForBlackoutStyle(i, n))
  15664. }
  15665. ,
  15666. t.prototype.handleWarpInterruption = function(e, t, i) {
  15667. null != i || (i = m.warp.teleportTime),
  15668. this.hideShowTagsForBlackoutStyle(t, i)
  15669. }
  15670. ,
  15671. t.prototype.hideShowTagsForBlackoutStyle = function(e, t) {
  15672. var i = 0
  15673. , n = 0
  15674. , r = t / 2;
  15675. switch (null != e || (e = E.MIDDLE),
  15676. e) {
  15677. case E.END:
  15678. this.hideAlltags(r);
  15679. break;
  15680. case E.BEGINNING:
  15681. this.hideAlltags().done(this.showAlltags.bind(this, r));
  15682. break;
  15683. case E.NONE:
  15684. break;
  15685. case E.MIDDLE:
  15686. n = i = r,
  15687. this.hideAlltags(n),
  15688. setTimeout(function() {
  15689. this.showAlltags(i)
  15690. }
  15691. .bind(this), n);
  15692. break;
  15693. case E.FADEIN:
  15694. setTimeout(function() {
  15695. this.showAlltags(r)
  15696. }
  15697. .bind(this), r)
  15698. }
  15699. }
  15700. ,
  15701. t.prototype.onPlayerModeChanging = function(e, t) {
  15702. t !== C.PANORAMA && this.dismissExaminedTag(),
  15703. t === C.PANORAMA && player.currentPano && !player.currentPano.isAligned() && (t = C.OUTDOOR);
  15704. var i = t !== C.OUTDOOR;
  15705. i !== this.model.tagsShown && (i ? this.showAlltags(m.tags.startup.fadeInDuration) : this.hideAlltags(m.tags.startup.fadeInDuration))
  15706. }
  15707. ,
  15708. t.prototype.onPanoChange = function(e, t) {
  15709. var i = this.navigatingViaTag;
  15710. if (this.navigatingViaTag = !1,
  15711. !i) {
  15712. this.dismissExaminedTag();
  15713. var n = e && !e.isAligned() ? C.OUTDOOR : C.PANORAMA
  15714. , r = t && !t.isAligned() ? C.OUTDOOR : C.PANORAMA;
  15715. n !== r && (r === C.PANORAMA ? this.showAlltags(m.tags.startup.fadeInDuration, null, !0) : this.hideAlltags(m.tags.startup.fadeInDuration))
  15716. }
  15717. }
  15718. ,
  15719. t.prototype.onPlayerReady = function(e, t, i) {
  15720. this.startAlltags(e, t ? i : null)
  15721. }
  15722. ,
  15723. t.prototype.onPlayerFlyingEnded = function(e, t) {
  15724. this.updateClosestTags(e)
  15725. }
  15726. ,
  15727. t.prototype.dismissExaminedTag = function() {
  15728. this.activeTag && this.tagState === T.EXAMINE && this.dismissActiveTag(),
  15729. this.hoveredTag && (this.hoveredTag.setFreeState(!0),
  15730. this.hoveredTag = null)
  15731. }
  15732. ,
  15733. t.prototype.startAlltags = function(e, t) {
  15734. this.model.shouldShowtags = m.tags.enabled,
  15735. this.enabled = !0,
  15736. e || (this.showAlltags(m.tags.startup.fadeInDuration, m.tags.startup.fadeInDelay),
  15737. t && setTimeout(function() {
  15738. this.activateTag(this.model.getTagBySid(t))
  15739. }
  15740. .bind(this), m.tags.startup.fadeInDuration / 2))
  15741. }
  15742. ,
  15743. t.prototype.showAlltags = function(e, t, i) {
  15744. function n() {
  15745. ++o === this.totaltags && (this.model.tagsShown = !0,
  15746. r.resolve())
  15747. }
  15748. var r = $.Deferred();
  15749. if (!i && this.player.mode === C.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || !this.model.shouldShowtags)
  15750. return r.resolve().promise();
  15751. var o = 0;
  15752. for (var a in this.model.tags) {
  15753. this.model.tags[a].show(e, t).done(n.bind(this))
  15754. }
  15755. return r.promise()
  15756. }
  15757. ,
  15758. t.prototype.hideAlltags = function(e, t) {
  15759. function i() {
  15760. ++r === this.totaltags && (this.model.tagsShown = !1,
  15761. n.resolve())
  15762. }
  15763. var n = $.Deferred()
  15764. , r = 0;
  15765. for (var o in this.model.tags) {
  15766. var a = this.model.tags[o];
  15767. a.hide(e, t).done(i.bind(this)),
  15768. a === this.activeTag && this.dismissActiveTag()
  15769. }
  15770. return n.promise()
  15771. }
  15772. ,
  15773. t.prototype.enableHovering = function() {
  15774. this.enabled = !0
  15775. }
  15776. ,
  15777. t.prototype.disableHovering = function() {
  15778. this.enabled = !1
  15779. }
  15780. ,
  15781. t.prototype.activateTag = function(e, t) {
  15782. t = t || T.EXAMINE,
  15783. this.activeTag = e,
  15784. this.activeTag.hoveringDisc = !0,
  15785. this.activeTag.setHoverState(t === T.EXAMINE),
  15786. this.tagState = t,
  15787. this.emit(b.TagActivated, e)
  15788. }
  15789. ,
  15790. t.prototype.dismissActiveTag = function() {
  15791. this.activeTag.hoveringDisc = !1,
  15792. this.activeTag.setFreeState(!0);
  15793. var e = this.activeTag;
  15794. this.activeTag = null,
  15795. this.tagState = T.IDLE,
  15796. this.emit(b.TagDismissed, e)
  15797. }
  15798. ,
  15799. t.prototype.clickedOnTag = function(e) {
  15800. var t = function() {
  15801. this.navigatingViaTag = !0,
  15802. this.activeTag.examine(this.player),
  15803. this.emit(b.TagNavigation, this.activeTag)
  15804. }
  15805. .bind(this);
  15806. return this.tagState !== T.EXAMINE ? (this.activateTag(this.intersectTag, T.EXAMINE),
  15807. this.activeTag = this.intersectTag,
  15808. t(),
  15809. !0) : (this.dismissActiveTag(),
  15810. !1)
  15811. }
  15812. ,
  15813. t.prototype.intersecttag = (s = new i.Vector3,
  15814. l = new i.Vector3,
  15815. c = new i.Vector3,
  15816. function(e, t, i) {
  15817. if (!this.enabled)
  15818. return null;
  15819. var n = null
  15820. , r = this.tagDiscs.filter(function(e) {
  15821. return e.parent.visible
  15822. });
  15823. if (0 < r.length) {
  15824. var o = this.model.floors.reduce(function(e, t) {
  15825. return t.hidden ? e : e.concat(t.collider.children)
  15826. }, r);
  15827. s.set(e.x, e.y, -1).unproject(i),
  15828. l.set(e.x, e.y, 1).unproject(i),
  15829. c.copy(l).sub(s).normalize(),
  15830. this.raycaster.set(s, c);
  15831. var a = this.raycaster.intersectObjects(o);
  15832. 0 < a.length && -1 !== r.indexOf(a[0].object) && (n = a[0].object.tag)
  15833. }
  15834. return this.intersectTag = n,
  15835. t && (this.activeTag && n !== this.activeTag && (this.tagState === T.BROWSE || this.tagState === T.EXAMINE && n) && this.dismissActiveTag(),
  15836. n && n !== this.activeTag && (n.listeners(v.ENTER).length < 1 && (n.billboard.on(v.ENTER, function() {
  15837. this.hoveredTag = n
  15838. }
  15839. .bind(this)),
  15840. n.billboard.on(v.LEAVE, function() {
  15841. this.hoveredTag = null
  15842. }
  15843. .bind(this))),
  15844. this.activateTag(n, T.BROWSE))),
  15845. n
  15846. }
  15847. ),
  15848. t.prototype.rankedtagInDirection = (h = [],
  15849. u = [],
  15850. d = new i.Vector3,
  15851. p = new i.Vector3,
  15852. f = new i.Vector3,
  15853. function(e, t, i, n) {
  15854. for (var r = 0, o = u.length = 0; o < this.closesttags.length; o++) {
  15855. var a = this.closesttags[o];
  15856. p.copy(a.position),
  15857. p.add(a.discPosition),
  15858. d.copy(t),
  15859. d.sub(p).negate(),
  15860. d.normalize();
  15861. var s = d.dot(n);
  15862. if (0 <= s && (f.copy(p),
  15863. f.project(i),
  15864. this.intersecttag(f, !1, i))) {
  15865. if (r >= h.length)
  15866. for (var l = 0; l < 64; l++)
  15867. h.push({
  15868. tag: a,
  15869. dot: s
  15870. });
  15871. var c = h[r];
  15872. c.tag = a,
  15873. c.dot = s,
  15874. c.position = math.projectPositionToCanvas(p, i),
  15875. u.push(c),
  15876. r++
  15877. }
  15878. }
  15879. return u.sort(function(e, t) {
  15880. return e.dot > t.dot ? -1 : e.dot < t.dot ? 1 : 0
  15881. }),
  15882. e < u.length ? u[e].tag : null
  15883. }
  15884. ),
  15885. t.prototype.updateClosestTags = (o = new i.Vector3,
  15886. function(e) {
  15887. this.closesttags || (this.closesttags = []),
  15888. this.closesttags.length = 0;
  15889. var t = this.model.tags;
  15890. if (t)
  15891. for (var i in t)
  15892. if (t.hasOwnProperty(i)) {
  15893. var n = t[i]
  15894. , r = n.position;
  15895. o.copy(e),
  15896. o.sub(r).negate(),
  15897. o.lengthSq() < 30 && this.closesttags.push(n)
  15898. }
  15899. }
  15900. ),
  15901. R.exports = t
  15902. }
  15903. ).call(this, "/js/tag/tagManager.js")
  15904. }
  15905. , {
  15906. "../controls/serializer": 14,
  15907. "../enum/BlackoutStyle": 18,
  15908. "../enum/tagEvents": 32,
  15909. "../enum/ModelManagerEvents": 33,
  15910. "../enum/PlayerEvents": 40,
  15911. "../enum/TagStates": 44,
  15912. "../enum/Viewmode": 51,
  15913. "../enum/WarpStyle": 52,
  15914. "../objects/Snapshot": 153,
  15915. "../settings": 166,
  15916. "../util/common": 185,
  15917. "../util/lerp": 188,
  15918. "../util/logger": 189,
  15919. "./Billboard/BillboardEvent": 120,
  15920. "./Media/LinkType": 130,
  15921. "./Media/MediaEvent": 131,
  15922. events: 202,
  15923. three: 217
  15924. }],
  15925. 125: [function(r, o, e) {
  15926. (function(e) {
  15927. "use strict";
  15928. function t() {
  15929. this.embedWrapper = null,
  15930. this.embedElement = null
  15931. }
  15932. var i = r("../../util/ajax")
  15933. , a = r("./mediaSettings")
  15934. , n = r("../../settings")
  15935. , s = new (r("../../util/logger"))(e);
  15936. t.prototype.createDomElement = function() {
  15937. return this.embedWrapper = document.createElement("div"),
  15938. this.embedWrapper.classList.add("tag-embed"),
  15939. this.embedWrapper.classList.add("hidden"),
  15940. this.embedWrapper
  15941. }
  15942. ,
  15943. t.prototype.load = function(e) {
  15944. var t = "https://api.embedly.com/1/oembed?key=" + n.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&maxwidth=" + a.maxEmbedWidth;
  15945. return new Promise(function(r, o) {
  15946. i.get(t).then(function(e) {
  15947. if ((e = JSON.parse(e)).html && -1 === e.html.indexOf("<script")) {
  15948. this.embedWrapper.innerHTML = e.html;
  15949. var t = Math.min(e.width, a.maxEmbedWidth) || a.maxEmbedWidth;
  15950. if (this.embedWrapper.style.width = t + "px",
  15951. e.height) {
  15952. var i = e.height / e.width;
  15953. this.embedWrapper.style.height = t * i + "px"
  15954. }
  15955. this.embedElement = this.embedWrapper.firstChild;
  15956. var n = [];
  15957. try {
  15958. n = [].slice.call(this.embedElement.querySelectorAll("a"))
  15959. } catch (e) {
  15960. s.debug("Error getting `a` elements for embed; was it an iframe?")
  15961. }
  15962. n.forEach(function(e) {
  15963. e.setAttribute("target", "_blank")
  15964. }),
  15965. this.embedElement.classList.add("hidden"),
  15966. this.embedWrapper.classList.remove("hidden"),
  15967. r()
  15968. } else
  15969. o("Not a valid embed")
  15970. }
  15971. .bind(this), function(e) {
  15972. o(e.response)
  15973. })
  15974. }
  15975. .bind(this))
  15976. }
  15977. ,
  15978. t.prototype.show = function() {
  15979. this.embedElement && this.embedElement.classList.remove("hidden")
  15980. }
  15981. ,
  15982. t.prototype.hide = function() {
  15983. this.embedElement && this.embedElement.classList.add("hidden")
  15984. }
  15985. ,
  15986. o.exports = t
  15987. }
  15988. ).call(this, "/js/tag/Media/EmbedlyEmbed.js")
  15989. }
  15990. , {
  15991. "../../settings": 166,
  15992. "../../util/ajax": 181,
  15993. "../../util/logger": 189,
  15994. "./mediaSettings": 132
  15995. }],
  15996. 126: [function(a, s, e) {
  15997. (function(e) {
  15998. "use strict";
  15999. function t(e) {
  16000. r.call(this),
  16001. this.options = e,
  16002. this.playerControls = null,
  16003. this.state = o.NOT_READY
  16004. }
  16005. var i, n = a("../../util/browser"), r = a("./EmbedlyEmbed"), o = (new (a("../../util/logger"))(e),
  16006. Object.freeze({
  16007. NOT_READY: "player.not.ready",
  16008. CUED: "player.cued",
  16009. PLAYING: "player.playing",
  16010. PAUSED: "player.paused"
  16011. }));
  16012. (t.prototype = Object.create(r.prototype)).createDomElement = function() {
  16013. return this.embedWrapper = document.createElement("div"),
  16014. this.embedWrapper.classList.add("tag-video"),
  16015. this.embedWrapper.classList.add("hidden"),
  16016. this.embedWrapper
  16017. }
  16018. ,
  16019. t.prototype.load = function(e) {
  16020. var t = function() {
  16021. function e(e) {
  16022. this.playerState = e
  16023. }
  16024. this.playerControls = new playerjs.Player(this.embedElement),
  16025. this.playerControls.on("ready", function(e) {
  16026. this.playerState = o.CUED,
  16027. this.options.startMuted && this.playerControls.mute()
  16028. }
  16029. .bind(this)),
  16030. this.playerControls.on("play", e.bind(this, o.PLAYING)),
  16031. this.playerControls.on("pause", e.bind(this, o.PAUSED)),
  16032. this.playerControls.on("ended", function(e) {
  16033. this.playerControls.setCurrentTime(0),
  16034. this.options.loop ? this.playerControls.play() : this.playerControls.pause()
  16035. }
  16036. .bind(this))
  16037. }
  16038. .bind(this);
  16039. return r.prototype.load.call(this, e).then(t.bind(this))
  16040. }
  16041. ,
  16042. t.prototype.play = (i = n.isMobile(),
  16043. function() {
  16044. this.playerState !== o.NOT_READY && this.playerControls && !i && (this.state === o.CUED && this.options.autoPlay || this.options.autoResume) && this.playerControls.play()
  16045. }
  16046. ),
  16047. t.prototype.pause = function() {
  16048. this.playerState !== o.NOT_READY && this.playerControls && this.playerControls.pause()
  16049. }
  16050. ,
  16051. s.exports = t
  16052. }
  16053. ).call(this, "/js/tag/Media/EmbedlyPlayer.js")
  16054. }
  16055. , {
  16056. "../../util/browser": 182,
  16057. "../../util/logger": 189,
  16058. "./EmbedlyEmbed": 125
  16059. }],
  16060. 127: [function(t, i, e) {
  16061. (function(e) {
  16062. "use strict";
  16063. var r = t("../../util/ajax")
  16064. , o = new (t("./mediaSettings"),
  16065. t("../../util/logger"))(e)
  16066. , a = Promise.resolve();
  16067. i.exports.enqueue = function(i) {
  16068. function n() {}
  16069. return a = new Promise(function(e, t) {
  16070. a.catch(n).then(function() {
  16071. (o.debug("requesting file from embedly:", i.href),
  16072. r.get(i.href, {
  16073. responseType: i.responseType
  16074. }).then(function(e) {
  16075. return o.debug("requesting file finished:", i.href),
  16076. e
  16077. })).then(e, t)
  16078. })
  16079. }
  16080. )
  16081. }
  16082. }
  16083. ).call(this, "/js/tag/Media/EmbedlyQueue.js")
  16084. }
  16085. , {
  16086. "../../util/ajax": 181,
  16087. "../../util/logger": 189,
  16088. "./mediaSettings": 132
  16089. }],
  16090. 128: [function(s, l, e) {
  16091. (function(e) {
  16092. "use strict";
  16093. function t() {
  16094. this.imageWrapper = null,
  16095. this.width = 0,
  16096. this.height = 0,
  16097. this.aspect = 1
  16098. }
  16099. var i = s("./MediaEvent")
  16100. , n = s("./EmbedlyQueue")
  16101. , r = s("events").EventEmitter
  16102. , o = s("../../util/logger")
  16103. , a = s("../../settings");
  16104. new o(e),
  16105. (t.prototype = Object.create(r.prototype)).createDomElement = function() {
  16106. return this.imageWrapper = document.createElement("div"),
  16107. this.imageWrapper.classList.add("tag-image"),
  16108. this.imageWrapper.classList.add("hidden"),
  16109. this.imageWrapper.addEventListener("click", function(e) {
  16110. e.stopPropagation(),
  16111. this.emit(i.IMAGE_OPENING),
  16112. this.imageWrapper.style.pointerEvents = "none"
  16113. }
  16114. .bind(this)),
  16115. this.imageWrapper
  16116. }
  16117. ,
  16118. t.prototype.onClosed = function() {
  16119. this.imageWrapper.style.pointerEvents = "auto"
  16120. }
  16121. ,
  16122. t.prototype.load = function(e) {
  16123. var t = Math.max(window.screen.height, window.screen.width)
  16124. , i = "https://i.embed.ly/1/display/resize?key=" + a.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&width=" + t + "&height=" + t;
  16125. return new Promise(function(o, e) {
  16126. n.enqueue({
  16127. href: i,
  16128. responseType: "arraybuffer"
  16129. }).then(function(e) {
  16130. var t = new Uint8Array(e)
  16131. , i = new Blob([t])
  16132. , n = new window.Image;
  16133. n.addEventListener("load", function(e) {
  16134. var t = e.target;
  16135. this.width = t.naturalWidth,
  16136. this.height = t.naturalHeight,
  16137. this.aspect = this.width / this.height;
  16138. var i = e.target.src;
  16139. this.imageWrapper.style.backgroundImage = 'url("' + i + '")',
  16140. this.imageWrapper.style.width = this.width + "px",
  16141. this.imageWrapper.style.height = this.height + "px",
  16142. this.imageWrapper.classList.remove("hidden"),
  16143. o()
  16144. }
  16145. .bind(this));
  16146. var r = URL.createObjectURL(i);
  16147. n.src = r
  16148. }
  16149. .bind(this), e)
  16150. }
  16151. .bind(this))
  16152. }
  16153. ,
  16154. l.exports = t
  16155. }
  16156. ).call(this, "/js/tag/Media/Image.js")
  16157. }
  16158. , {
  16159. "../../settings": 166,
  16160. "../../util/logger": 189,
  16161. "./EmbedlyQueue": 127,
  16162. "./MediaEvent": 131,
  16163. events: 202
  16164. }],
  16165. 129: [function(e, t, i) {
  16166. "use strict";
  16167. function n(e) {
  16168. this.label = e.label,
  16169. this.href = e.url,
  16170. this.type = this.updateLinkForType(),
  16171. this.domElement = null,
  16172. this.id = c++
  16173. }
  16174. var r = e("./LinkType")
  16175. , o = e("./MediaEvent")
  16176. , a = e("../../util/browser")
  16177. , s = e("../../analytics")
  16178. , l = e("events").EventEmitter
  16179. , c = 0;
  16180. (n.prototype = Object.create(l.prototype)).updateLinkForType = function() {
  16181. var e, t = a.valueFromHash("m") || a.valueFromHash("model");
  16182. return -1 !== this.href.indexOf("port.com/show") || -1 !== this.href.indexOf(window.location.host + "/show") ? -1 !== this.href.indexOf(t) && -1 !== this.href.indexOf("start=") ? (this.href = (e = this.href,
  16183. new RegExp("[#&?]start=([^#&?]*)").exec(e)[1]),
  16184. r.NAVIGATION) : (this.href = this.href + "&play=1",
  16185. r.MODEL) : r.EXT_LINK
  16186. }
  16187. ;
  16188. var h = {};
  16189. n.prototype.createDomElement = function() {
  16190. if (this.domElement = document.createElement("a"),
  16191. this.domElement.classList.add("tag-link"),
  16192. this.domElement.textContent = this.label,
  16193. this.type === r.EXT_LINK) {
  16194. this.domElement.textContent += " ";
  16195. var e = document.createElement("i");
  16196. e.classList.add("icon-ext-link"),
  16197. e.title = "Link to external web site",
  16198. this.domElement.appendChild(e)
  16199. }
  16200. return this.domElement.addEventListener("click", function(e) {
  16201. switch (e.stopPropagation(),
  16202. h[this.id] = !0,
  16203. s.trackAlways("click_tag_link", {
  16204. link_type: this.type,
  16205. link_count: c,
  16206. links_clicked: Object.keys(h).length
  16207. }),
  16208. this.type) {
  16209. case r.MODEL:
  16210. window.location.replace(this.href);
  16211. break;
  16212. case r.EXT_LINK:
  16213. window.open(this.href, "_blank")
  16214. }
  16215. this.emit(o.LINK_CLICK, {
  16216. type: this.type,
  16217. url: this.href
  16218. })
  16219. }
  16220. .bind(this)),
  16221. this.domElement
  16222. }
  16223. ,
  16224. t.exports = n
  16225. }
  16226. , {
  16227. "../../analytics": 4,
  16228. "../../util/browser": 182,
  16229. "./LinkType": 130,
  16230. "./MediaEvent": 131,
  16231. events: 202
  16232. }],
  16233. 130: [function(e, t, i) {
  16234. "use strict";
  16235. t.exports = {
  16236. NAVIGATION: "navigation",
  16237. MODEL: "model",
  16238. EXT_LINK: "ext-link"
  16239. }
  16240. }
  16241. , {}],
  16242. 131: [function(e, t, i) {
  16243. "use strict";
  16244. t.exports = Object.freeze({
  16245. LINK_CLICK: "mtmedia.link",
  16246. IMAGE_LOADED: "mtmedia.image.loaded",
  16247. IMAGE_OPENING: "mtmedia.image.opening",
  16248. IMAGE_OPENED: "mtmedia.image.opened",
  16249. IMAGE_CLOSING: "mtmedia.image.closing",
  16250. IMAGE_CLOSED: "mtmedia.image.closed",
  16251. VIDEO_START: "mtmedia.video.start",
  16252. VIDEO_PAUSE: "mtmedia.video.pause",
  16253. VIDEO_ENDED: "mtmedia.video.end"
  16254. })
  16255. }
  16256. , {}],
  16257. 132: [function(e, t, i) {
  16258. "use strict";
  16259. t.exports = Object.freeze({
  16260. maxEmbedWidth: 350,
  16261. defaultAspectRatio: .75
  16262. })
  16263. }
  16264. , {}],
  16265. 133: [function(e, t, i) {
  16266. "use strict";
  16267. t.exports = Object.freeze({
  16268. TEXT: "text",
  16269. LINK: "link",
  16270. IMAGE: "photo",
  16271. VIDEO: "video",
  16272. RICH: "rich"
  16273. })
  16274. }
  16275. , {}],
  16276. 134: [function(e, t, i) {
  16277. "use strict";
  16278. function n(e) {
  16279. this.capabilities = {
  16280. links: {
  16281. enable: e.supportLinks,
  16282. keepLabels: e.keepLinkLabels
  16283. }
  16284. }
  16285. }
  16286. var r = e("./DescriptionChunkType");
  16287. n.prototype.parse = function(e, i) {
  16288. var n = [];
  16289. return e.split("[").map(function(e, t) {
  16290. return 0 === t ? e : "[" + e
  16291. }).forEach(function(e) {
  16292. var t = this.findMarkdown(e);
  16293. if (t) {
  16294. if (-1 !== t.url.indexOf("javascript:"))
  16295. return;
  16296. this.addLinkChunk(n, t, i),
  16297. this.addTextChunk(n, e.slice(t.markdown.length))
  16298. } else
  16299. this.addTextChunk(n, e)
  16300. }
  16301. .bind(this)),
  16302. n
  16303. }
  16304. ,
  16305. n.prototype.findMarkdown = function(e) {
  16306. var t = e.match(/\[([^\]]*)\]\((.*)\)/);
  16307. if (t) {
  16308. for (var i = t[2], n = 1, r = 0; r < i.length && ("(" === i[r] ? n++ : ")" === i[r] && n--,
  16309. 0 !== n); )
  16310. r++;
  16311. var o = i.length - r;
  16312. return {
  16313. markdown: t[0].substring(0, t[0].length - o),
  16314. label: t[1],
  16315. url: t[2].substring(0, r)
  16316. }
  16317. }
  16318. }
  16319. ,
  16320. n.prototype.addTextChunk = function(e, t) {
  16321. 0 !== t.length && e.push({
  16322. type: r.TEXT,
  16323. text: t
  16324. })
  16325. }
  16326. ,
  16327. n.prototype.addLinkChunk = function(e, t) {
  16328. if (this.capabilities.links.enable) {
  16329. var i = {
  16330. label: t.label,
  16331. url: t.url
  16332. };
  16333. -1 === i.url.indexOf("://") && (i.url = "http://" + i.url),
  16334. e.push({
  16335. type: r.LINK,
  16336. link: i
  16337. })
  16338. } else
  16339. this.capabilities.links.keepLabels && this.addTextChunk(e, t.label)
  16340. }
  16341. ,
  16342. t.exports = n
  16343. }
  16344. , {
  16345. "./DescriptionChunkType": 133
  16346. }],
  16347. 135: [function(t, r, e) {
  16348. (function(e) {
  16349. "use strict";
  16350. var i = new (t("../util/logger"))(e)
  16351. , n = {
  16352. parseIdsFromChunkName: function(e, t) {
  16353. t.floorId = n.parseFloor(e),
  16354. t.roomId = n.parseRoom(e)
  16355. },
  16356. parseFloor: function(e) {
  16357. var t = e.match(/_group([0-9]+)/);
  16358. if (!t)
  16359. return 0;
  16360. try {
  16361. return parseInt(t[1], 10)
  16362. } catch (e) {
  16363. return i.warn('Non-int value "' + t[1] + '" for mesh group, defaulting to floor 0'),
  16364. 0
  16365. }
  16366. },
  16367. parseRoom: function(e) {
  16368. var t = e.match(/_sub([0-9]+)/);
  16369. if (!t)
  16370. return -1;
  16371. try {
  16372. return parseInt(t[1], 10)
  16373. } catch (e) {
  16374. return i.warn('Non-int value "' + t[1] + '" for mesh subgroup, defaulting to subgroup 0'),
  16375. 0
  16376. }
  16377. }
  16378. };
  16379. r.exports = n
  16380. }
  16381. ).call(this, "/js/model/Chunks.js")
  16382. }
  16383. , {
  16384. "../util/logger": 189
  16385. }],
  16386. 136: [function(a, c, e) {
  16387. (function(e) {
  16388. "use strict";
  16389. function t(e) {
  16390. r.call(this),
  16391. this.model = e,
  16392. this.exploded = !1
  16393. }
  16394. var i = a("../objects/Floor")
  16395. , n = (a("../settings"),
  16396. a("../util/logger"))
  16397. , s = a("../util/transitions")
  16398. , r = a("../util/IndexedCollection")
  16399. , o = a("../util/common")
  16400. , l = a("../util/easing");
  16401. new n(e),
  16402. o.inherit(t, r),
  16403. t.prototype.add = function(e) {
  16404. r.prototype.add.call(this, e),
  16405. this.model.add(e)
  16406. }
  16407. ,
  16408. t.prototype.getIndex = function(e) {
  16409. return e.floorIndex
  16410. }
  16411. ,
  16412. t.prototype.build = function() {
  16413. this.list.forEach(function(e) {
  16414. e.build()
  16415. })
  16416. }
  16417. ,
  16418. t.prototype.size = function() {
  16419. return this.length
  16420. }
  16421. ,
  16422. t.prototype.sort = function() {
  16423. r.prototype.sort.call(this, function(e, t) {
  16424. return e.floorIndex - t.floorIndex
  16425. })
  16426. }
  16427. ,
  16428. t.prototype.nextFloor = function(e, t) {
  16429. return this.index[e.floorIndex + t] || null
  16430. }
  16431. ,
  16432. t.prototype.getFloorAtPoint = function(e) {
  16433. for (var t = null, i = 1 / 0, n = 0; n < this.list.length; n++) {
  16434. var r = this.list[n]
  16435. , o = r.distanceToPoint(e);
  16436. (!t || o < i) && (i = o,
  16437. t = r)
  16438. }
  16439. return t
  16440. }
  16441. ,
  16442. t.prototype.getOrMakeFloor = function(e) {
  16443. var t = this.index[e];
  16444. return t || (t = new i(this.model,e),
  16445. this.add(t)),
  16446. t
  16447. }
  16448. ,
  16449. t.prototype.hide = function() {
  16450. this.list.forEach(function(e) {
  16451. e.hide()
  16452. })
  16453. }
  16454. ,
  16455. t.prototype.show = function() {
  16456. this.list.forEach(function(e) {
  16457. e.show()
  16458. })
  16459. }
  16460. ,
  16461. t.prototype.names = function() {
  16462. return this.list.reduce(function(e, t) {
  16463. return e.concat(t.name)
  16464. }, [])
  16465. }
  16466. ,
  16467. t.prototype.toggleExplodeHorizontal = function() {
  16468. function i(e, t) {
  16469. a.copy(e.position),
  16470. e.position.x = r[e.floorIndex] * t,
  16471. e.position.y = 1 * e.floorIndex * t,
  16472. a.sub(e.position).multiplyScalar(-1),
  16473. e.panos.forEach(function(e) {
  16474. e.translate(a)
  16475. })
  16476. }
  16477. var n, r = [], o = 0;
  16478. this.list.forEach(function(e, t, i) {
  16479. n = 0 < t ? Math.max(i[t - 1].boundingBox.max.x - e.boundingBox.min.x, e.boundingBox.size().x / 2) : 0,
  16480. o += n,
  16481. r[t] = o
  16482. }),
  16483. r = r.map(function(e) {
  16484. return e - o / 2
  16485. });
  16486. var a = this.list[0].position.clone();
  16487. this.exploded ? this.list.forEach(function(t) {
  16488. s.start(function(e) {
  16489. i(t, 1 - e)
  16490. }, 1500, null, 0, l.easeOutExpo)
  16491. }) : this.list.forEach(function(t) {
  16492. s.start(function(e) {
  16493. i(t, e)
  16494. }, 1500, null, 0, l.easeOutExpo)
  16495. }),
  16496. this.exploded = !this.exploded
  16497. }
  16498. ,
  16499. t.prototype.toggleExplodeVertical = function() {
  16500. function i(e, t) {
  16501. var i = i.copy(e.position);
  16502. e.position.y = (5 * e.floorIndex - n.y / 2) * t,
  16503. i.sub(e.position).multiplyScalar(-1),
  16504. e.panos.forEach(function(e) {
  16505. e.translate(i)
  16506. })
  16507. }
  16508. var n = this.model.size;
  16509. this.list[0].position.clone(),
  16510. this.exploded ? this.list.forEach(function(t) {
  16511. s.start(function(e) {
  16512. i(t, 1 - e)
  16513. }, 1500, null, 0, l.easeOutExpo)
  16514. }) : this.list.forEach(function(t) {
  16515. s.start(function(e) {
  16516. i(t, e)
  16517. }, 1500, null, 0, l.easeOutExpo)
  16518. }),
  16519. this.exploded = !this.exploded
  16520. }
  16521. ,
  16522. c.exports = t
  16523. }
  16524. ).call(this, "/js/model/FloorCollection.js")
  16525. }
  16526. , {
  16527. "../objects/Floor": 146,
  16528. "../settings": 166,
  16529. "../util/IndexedCollection": 175,
  16530. "../util/common": 185,
  16531. "../util/easing": 186,
  16532. "../util/logger": 189,
  16533. "../util/transitions": 195
  16534. }],
  16535. 137: [function(r, o, e) {
  16536. (function(e) {
  16537. "use strict";
  16538. function h() {
  16539. n.call(this)
  16540. }
  16541. var u = r("../settings")
  16542. , t = r("../util/logger")
  16543. , d = r("../enum/Viewmode")
  16544. , p = r("../objects/Snapshot")
  16545. , i = (r("../util/math"),
  16546. r("../util/common"))
  16547. , n = r("../util/IndexedCollection")
  16548. , l = new t(e);
  16549. i.inherit(h, n),
  16550. h.prototype.getImage = function(e) {
  16551. return e && this.index.hasOwnProperty(e) ? this.index[e] : null
  16552. }
  16553. ,
  16554. h.prototype.filterByModesAndReel = function(e, t) {
  16555. for (var i = [], n = 0; n < t.length; n += 1) {
  16556. var r = t[n]
  16557. , o = this.index[r.sid];
  16558. o && i.push(o)
  16559. }
  16560. var a = e[d.DOLLHOUSE]
  16561. , s = e[d.FLOORPLAN];
  16562. (i = i.filter(function(e) {
  16563. if (!e.metadata || void 0 === e.metadata.camera_mode)
  16564. return !0;
  16565. var t;
  16566. try {
  16567. t = d.convertWorkshopModeInt(e.metadata.camera_mode)
  16568. } catch (e) {
  16569. return l.debug(e.message),
  16570. !1
  16571. }
  16572. return t === d.PANORAMA || t === d.FLOORPLAN && s || t === d.DOLLHOUSE && a
  16573. })).length !== this.list.length && l.info("Disallowed " + (this.list.length - i.length) + " highlight images"),
  16574. this.list = i,
  16575. this.reIndex()
  16576. }
  16577. ,
  16578. h.prototype.getHeroLocations = function(panos) {//改 增加二级location
  16579. if (0 === this.list.length)
  16580. return [];
  16581. var locations = [];
  16582. var deal = (n, container)=>{
  16583. var r = n.thumbnail_signed_src,
  16584. o = n.name || "";
  16585. if (n.metadata && void 0 !== n.metadata.camera_quaternion) {
  16586. if (!u.show360Views.enabled && n.metadata.scan_id) {
  16587. var a = panos.get(n.metadata.scan_id);
  16588. if (a && !a.isAligned()) return
  16589. }
  16590. var s = d.convertWorkshopModeInt(n.metadata.camera_mode);
  16591. if (s === d.MESH) return
  16592. if(window.isLocal)var src = manage.dealURL(r)
  16593. else var src = "one" === g_version ? g_Prefix + r + "?" + randomTime().getTime() : r + "?" + randomTime().getTime()
  16594. var l = {
  16595. cameraMode: s,
  16596. position: n.metadata.camera_position,
  16597. quaternion: n.metadata.camera_quaternion,
  16598. zoom: n.metadata.zoom,
  16599. panoId: n.metadata.scan_id,
  16600. orthoZoom: n.metadata.ortho_zoom,
  16601. floorVisibility: void 0 !== n.metadata.floor_visibility ? n.metadata.floor_visibility.slice(0) : [],
  16602. thumbUrl: src,
  16603. name: h.filterImageName(o),
  16604. sid: n.sid
  16605. }
  16606. var item = new p(l);
  16607. container.push(item)
  16608. return item
  16609. }
  16610. }
  16611. this.list.forEach(image=>{
  16612. if(image.images){
  16613. var folder = $.extend({}, image )
  16614. folder.heroLocations = [];
  16615. image.images.list.forEach(child=>{
  16616. deal(child, folder.heroLocations);
  16617. })
  16618. folder.musicInfo = folder.musicInfo || {}
  16619. locations.push(folder)
  16620. delete folder.images;
  16621. delete folder.locations;
  16622. }else{
  16623. var item = deal(image, locations);
  16624. item.musicInfo = image.musicInfo || g_data2.tourAudio[item.sid] || {}//新的music数据统一写在每个info下,如果有musicInfo则覆盖g_data2.tourAudio
  16625. }
  16626. })
  16627. return locations
  16628. }
  16629. ,
  16630. h.prototype.getIndex = function(e) {
  16631. return e.sid
  16632. }
  16633. ,
  16634. h.filterImageName = function(e) {
  16635. return "" === e || e.match(/^[0-9.]+_[0-9.]+$/) ? null : e
  16636. }
  16637. ,
  16638. o.exports = h
  16639. }
  16640. ).call(this, "/js/model/ImageCollection.js")
  16641. }
  16642. , {
  16643. "../enum/Viewmode": 51,
  16644. "../objects/Snapshot": 153,
  16645. "../settings": 166,
  16646. "../util/IndexedCollection": 175,
  16647. "../util/common": 185,
  16648. "../util/logger": 189,
  16649. "../util/math": 190
  16650. }],
  16651. 138: [function(h, u, e) {
  16652. (function(e) {
  16653. "use strict";
  16654. function n() {
  16655. c.call(this)
  16656. }
  16657. var r = h("../label/Label")
  16658. , i = h("../settings")
  16659. , t = h("../util/logger")
  16660. , o = h("../util/math")
  16661. , a = h("../util/ajax")
  16662. , s = h("./RoomCollection")
  16663. , l = h("../util/common")
  16664. , c = h("../util/IndexedCollection");
  16665. new t(e),
  16666. l.inherit(n, c),
  16667. n.prototype.getIndex = function(e) {
  16668. return e.labelId
  16669. }
  16670. ,
  16671. n.prototype.associateWithRooms = function(e) {
  16672. this.forEach(function(t) {
  16673. e.forEach(function(e) {
  16674. e.roomId === t.roomId && (t.room = e)
  16675. })
  16676. })
  16677. }
  16678. ,
  16679. n.prototype.createFromLabelData = function(e) {
  16680. e.forEach(function(e) {
  16681. var t = n.parseRoomIndexFromWorkshopRoomId(e.roomId);
  16682. t = s.generateRoomId(e.floorId, t);
  16683. var i = new r(e.sid,e.position || e.positions[0],e.text,e.floorId,t);
  16684. i.position = o.convertWorkshopVector(i.position),
  16685. this.add(i),
  16686. i.build()
  16687. }
  16688. .bind(this))
  16689. }
  16690. ,
  16691. n.prototype.load = function(e, t) {
  16692. return a.get(e, {
  16693. responseType: "json",
  16694. auth: t ? i.authorizationHeader : null
  16695. }).done(function(e) {
  16696. var t = [];
  16697. for (var i in e) {
  16698. var n = e[i];
  16699. t.push(n)
  16700. }
  16701. this.createFromLabelData(t)
  16702. }
  16703. .bind(this))
  16704. }
  16705. ,
  16706. n.parseRoomIndexFromWorkshopRoomId = function(e) {
  16707. var t = -1;
  16708. if (e) {
  16709. var i = e.split("_");
  16710. t = parseInt(i[0])
  16711. }
  16712. return t
  16713. }
  16714. ,
  16715. u.exports = n
  16716. }
  16717. ).call(this, "/js/model/LabelCollection.js")
  16718. }
  16719. , {
  16720. "../label/Label": 90,
  16721. "../settings": 166,
  16722. "../util/IndexedCollection": 175,
  16723. "../util/ajax": 181,
  16724. "../util/common": 185,
  16725. "../util/logger": 189,
  16726. "../util/math": 190,
  16727. "./RoomCollection": 141
  16728. }],
  16729. 139: [function(P, O, e) {
  16730. (function(e) {
  16731. "use strict";
  16732. function t(e, t) {
  16733. o.Object3D.call(this),
  16734. this.sid = window.number;//t.sid,
  16735. this.data = t,
  16736. this.options = e,
  16737. this.urls = new i(e.urlFiles),
  16738. this.isPublic = void 0 !== t.is_public && t.is_public,
  16739. //创建heroLocations
  16740. this.images = new E(this),
  16741. this.images.extend(t.images),
  16742. this.images.forEach((info)=>{
  16743. if(info.locations){
  16744. info.images = new E(this);
  16745. info.images.extend(info.locations)
  16746. }
  16747. })
  16748. this.heroLocations = []
  16749. //this.heroImage = this.images.getImage(t.icon), //初始画面沒有用到icon
  16750. this.outdoorPanoLocations = [],
  16751. this.floors = new c(this),
  16752. this.floorsEnabled = void 0 === e.floors || e.floors,
  16753. this.changingFloor = !1,
  16754. this.chunks = [],
  16755. this.panos = new g,
  16756. this.colliders = [],
  16757. this.loadPanosPromise = null,
  16758. this.loadMeshTexturesPromise = null,
  16759. this.auxDataPromise = null,
  16760. this.meshTexturesLoaded = !1,
  16761. this.meshTextures = [],
  16762. this.tags = {},
  16763. this.tagsShown = !1,
  16764. this.shouldShowtags = !1,
  16765. this.has360Views = !1,
  16766. this.showingLabels = u.labels.enabled && t.player_options.labels,
  16767. this.supportedModes = {},
  16768. this.supportedModes[s.PANORAMA] = !0,
  16769. this.supportedModes[s.DOLLHOUSE] = !t.player_options || t.player_options.dollhouse && I.valueFromHash("dh", 1),
  16770. this.supportedModes[s.FLOORPLAN] = !t.player_options || t.player_options.floor_plan && I.valueFromHash("dh", 1),
  16771. this.supportedModes[s.TRANSITIONING] = !0,
  16772. this.supportsTiles = this.configureTiling(),
  16773. this.supportsVR = window.MP_PREFETCHED_MODELDATA.supportsVR || false//!0,
  16774. this.mode = s.DOLLHOUSE,
  16775. this.size = null,
  16776. this.center = null,
  16777. this.boundingBox = new o.Box3,
  16778. this.currentFloor = null,
  16779. this.allFloorsVisible = !0,
  16780. this.projectedPano0 = null,
  16781. this.projectedPano1 = null,
  16782. this.floorsEnabled && t.floors && -1 !== t.floors.indexOf(",") && t.floors.split(",").forEach(function(e, t) {
  16783. this.addFloor(new r(this,t,e.trim()))
  16784. }
  16785. .bind(this)),
  16786. this.waitQueue = [],
  16787. this.on("load", function(e) {
  16788. 0 !== this.waitQueue.length && (this.waitQueue = this.waitQueue.filter(function(e) {
  16789. return !e.isLoadedCallback()
  16790. }),
  16791. 0 === this.waitQueue.length && this.emit("waiting-done"))
  16792. }
  16793. .bind(this)),
  16794. this.setupCustomProperties(),
  16795. this.hots = {}
  16796. }
  16797. var o = P("three")
  16798. , a = P("../util/ajax")
  16799. , i = P("../util/ModelUrls")
  16800. , n = P("../objects/BoundingTextureSkybox")
  16801. , s = P("../enum/Viewmode")
  16802. , l = P("../enum/RenderOrder")
  16803. , r = (P("../enum/AlignmentType"),
  16804. P("../objects/Floor"))
  16805. , c = P("./FloorCollection")
  16806. , h = P("../objects/Chunk")
  16807. , u = (P("../objects/Room"),
  16808. P("../objects/Snapshot"),
  16809. P("../label/Label"),
  16810. P("../util/math"),
  16811. P("../settings"))
  16812. , d = P("../shaders")
  16813. , p = P("../util/logger")
  16814. , f = (P("../tag/tag"),
  16815. P("../tag/tagManager"),
  16816. P("../objects/Panorama"))
  16817. , g = P("../util/PanoramaCollection")
  16818. , m = P("../loaders/ModelLoader")
  16819. , v = P("../loaders/ModelTextureLoader")
  16820. , y = P("../loaders/SweepDataLoader")
  16821. , A = P("../util/transitions")
  16822. , C = (P("../util/easing"),
  16823. P("../util/lerp"),
  16824. P("../util/common"))
  16825. , I = (P("../util/texture"),
  16826. P("./../util/browser"))
  16827. , E = P("./ImageCollection")
  16828. , _ = P("./RoomCollection")
  16829. , b = P("./LabelCollection")
  16830. , w = P("./Chunks")
  16831. , T = P("./../util/showcase")
  16832. , x = P("../exception/BasicException")
  16833. , S = (P("../constants"),
  16834. P("events").EventEmitter)
  16835. , M = P("hot")
  16836. , R = new p(e);
  16837. t.prototype = Object.create(o.Object3D.prototype),
  16838. C.extend(t, S),
  16839. t.prototype.setupCustomProperties = function() {
  16840. var t = u.modelAlpha;
  16841. Object.defineProperty(this, "alpha", {
  16842. get: function() {
  16843. return t
  16844. },
  16845. set: function(e) {
  16846. t = e,
  16847. this.chunks.forEach(function(e) {
  16848. e.material && e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = t)
  16849. })
  16850. }
  16851. })
  16852. }
  16853. ,
  16854. t.prototype.configureTiling = function() {
  16855. var e = function() {
  16856. try {
  16857. var e = document.createElement("canvas")
  16858. , t = e.getContext("webgl");
  16859. return (t = t || e.getContext("experimental-webgl")).getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE)
  16860. } catch (e) {
  16861. return 0
  16862. }
  16863. }();
  16864. if (e < 2048)
  16865. return !1;
  16866. R.warn("Max cube texture size: " + e);
  16867. for (var t = 0; t < u.tiling.tilingFlagNames.length; t++) {
  16868. var i = u.tiling.tilingFlagNames[t];
  16869. if ("1" === I.valueFromHash(i, null))
  16870. return !0;
  16871. if ("0" === I.valueFromHash(i, null))
  16872. return !1
  16873. }
  16874. return !!T.modelDataPromisesTiles(this.data)
  16875. }
  16876. ,
  16877. t.prototype.toggleAlpha = function() {
  16878. this.alpha < 1 ? this.alpha = 1 : this.alpha = 0
  16879. }
  16880. ,
  16881. t.prototype.load = function(e) {
  16882. var t = this.urls.init().then(function() {
  16883. return $.when(this.loadPanos(), this.loadMesh())
  16884. }
  16885. .bind(this));
  16886. return e ? t = t.then(this.loadMeshTextures.bind(this)) : t.then(this.loadMeshTextures.bind(this)),
  16887. this.auxDataPromise = $.when(this.loadhots(), this.loadLabels()),
  16888. $.when(t, this.auxDataPromise).done(this.build.bind(this))
  16889. }
  16890. ,
  16891. t.prototype.loadMesh = function() {
  16892. var n = $.Deferred()
  16893. , r = this;
  16894. return m.load(r.data.job.uuid, r.urls, function(e, t) {
  16895. if (0 === e.length) {
  16896. R.warn("No geometry found for model, loading faux geometry, disabling outside mode"),
  16897. r.supportedModes[s.DOLLHOUSE] = !1,
  16898. r.supportedModes[s.FLOORPLAN] = !1;
  16899. var i = new h({
  16900. geometry: new o.PlaneBufferGeometry(5,5,1,1)
  16901. });
  16902. i.material.visible = !1,
  16903. i.rotateX(-Math.PI / 2),
  16904. i.geometry.computeBoundingBox(),
  16905. e = [i]
  16906. }
  16907. e.forEach(function(e) {
  16908. var t = r.floorsEnabled ? w.parseFloor(e.name) : 0;
  16909. r.addChunk(t, e)
  16910. }),
  16911. r.floors.sort(),
  16912. n.resolve(r)
  16913. }, function(e, t) {
  16914. n.notify(e, t)
  16915. }, function(e) {
  16916. R.error(e),
  16917. n.reject("loading-failed")
  16918. }),
  16919. n.promise()
  16920. }
  16921. ,
  16922. t.prototype.loadMeshTextures = function() {
  16923. return this.loadTexturesPromise || (this.loadTexturesPromise = v.load(this, this.meshTextures).then(function() {
  16924. this.meshTexturesLoaded = !0
  16925. }
  16926. .bind(this))),
  16927. this.loadTexturesPromise
  16928. }
  16929. ,
  16930. t.prototype.shineHots = function() {
  16931. A.trigger({
  16932. func: function(e) {
  16933. var opa = e <= .5 ? 2 * e : -2 * e + 2
  16934. for(var i in this.hots){
  16935. this.hots[i].mesh.material.uniforms.opac.value = opa;
  16936. }
  16937. }
  16938. .bind(this),
  16939. cycling: !0,
  16940. duration: 3e3,
  16941. name: "hotShine"
  16942. })
  16943. }
  16944. ,
  16945. t.prototype.createHotItem = function(e, t) {
  16946. for (var i = document.createDocumentFragment(), n = Object.keys(e), r = 0; r < n.length; r++) {
  16947. var o = document.createElement("li")
  16948. , a = document.createElement("span");
  16949. a.innerHTML = e[n[r]].title || e[n[r]].infoAttribute.title || "热点",
  16950. o.hot = t[n[r]],
  16951. o.appendChild(a),
  16952. i.appendChild(o)
  16953. }
  16954. document.querySelector("#hotListContent ul").appendChild(i),
  16955. console.log(i)
  16956. }
  16957. ,
  16958. t.prototype.loadOverlays = function(overlays){
  16959. var overlays = window.data2 && window.data2.overlays /* ||
  16960. [
  16961. { depth: 0.02,
  16962. file: "https://super.4dage.com/data/TEST/overlay/b6fe7cb6bd2b6.mp4",
  16963. hasBox: 0,
  16964. height: 0.8165,
  16965. media: ["video"],
  16966. pos: [-4.3132, 0.6788, -13.5162],
  16967. qua: [0, 0.9396, 0, 0.3421],
  16968. sid: "1591079418827",
  16969. width: 0.6124
  16970. }] */
  16971. overlays && overlays.forEach((info)=>{
  16972. new Overlay(info)
  16973. })
  16974. }
  16975. ,
  16976. t.prototype.loadhots = function() {
  16977. var r = $.Deferred()
  16978. , e = g_Prefix + "data/" + this.sid + "/data2.js?" + randomTime().getTime();
  16979. return a.get(e, {
  16980. responseType: "json",
  16981. auth: this.isPublic ? null : u.authorizationHeader
  16982. }).done(function(e) {
  16983. window.data2 = e;
  16984. if(!e){
  16985. console.error("data2 is null")
  16986. }else{
  16987. g_data2 = hotMatcher(e)
  16988. this.hotsCount = 0;
  16989. //因为热点保存后在hots里的顺序会被修改,所以使用order来记录顺序,这里要重排序:
  16990. window.hotData = {}
  16991. if(e.hots){
  16992. var sids = Object.keys(e.hots).sort((a,b)=>{return e.hots[a].order - e.hots[b].order});
  16993. sids.forEach((sid)=>{
  16994. this.hotsCount++,
  16995. this.hots[sid] = new M(sid,e.hots[sid] ,this);
  16996. e.hots[sid].infoAttribute || (e.hots[sid].infoAttribute = {})
  16997. this.hots[sid].initStyleImg(e.hots[sid].infoAttribute);
  16998. window.hotData[sid] = e.hots[sid];
  16999. })
  17000. }
  17001. this.createHotItem(window.hotData, this.hots);
  17002. g_index = I.valueFromHash("m")
  17003. /* e.tourAudio && (g_tourAudio = new Audio,
  17004. g_tourAudio.loop = !1,
  17005. g_tourAudio.addEventListener("ended", function() {
  17006. var e = document.createEvent("MouseEvent");
  17007. e.initEvent("tourAudioEnded", !0, !0),
  17008. window.dispatchEvent(e)
  17009. })); */
  17010. e.weixinDesc && (g_weixinObj.desc = e.weixinDesc)
  17011. //window.wx && manage.weixinShare(),
  17012. }
  17013. /* var i = $.Deferred()
  17014. , n = g_Prefix + "data/" + this.sid + "/hot/js/data.js?" + randomTime().getTime();
  17015. a.get(n, {
  17016. responseType: "json",
  17017. auth: this.isPublic ? null : u.authorizationHeader
  17018. }).done(function(e) {
  17019. window.hotData = e,
  17020. this.createHotItem(e, this.hots);
  17021. for(let i in this.hots){
  17022. e[i] && this.hots[i].initStyleImg(e[i]);
  17023. }
  17024. i.resolve()
  17025. }
  17026. .bind(this)).fail(function() {
  17027. console.log("Data.js is empty");
  17028. i.resolve()
  17029. }),
  17030. */
  17031. r.resolve()
  17032. }
  17033. .bind(this)).fail(function() {
  17034. console.log("没有热点"),
  17035. //window.wx && manage.weixinShare(),
  17036. r.resolve()
  17037. }),
  17038. r
  17039. }
  17040. ,
  17041. t.prototype.loadPanos = function() {
  17042. if (this.loadPanosPromise)
  17043. return this.loadPanosPromise;
  17044. var e = new y(this);
  17045. return this.loadPanosPromise = e.load().then(function(e) {
  17046. return this.data.sweeps && 0 < Object.keys(this.data.sweeps).length && (e = e.filter(function(e) {
  17047. if(this.data.sweeps[e.uuid])return this.data.sweeps[e.uuid].enabled
  17048. else console.log(e.uuid)
  17049. //return this.data.sototype.loadOverlaysweeps[e.uuid].enabled
  17050. }
  17051. .bind(this))),
  17052. this.panos.extend(e.map(function(e) {
  17053. return new f(this,e.uuid,e,this.supportsTiles)
  17054. }
  17055. .bind(this))),
  17056. this.panos.forEach(function(i) {
  17057. i.neighbourUUIDs && (i.neighbourUUIDs.forEach(function(e) {
  17058. var t = this.panos.get(e);
  17059. t && this.panos.setNeighbour(i, t, !0)
  17060. }
  17061. .bind(this)),
  17062. i.neighbourPanos = this.panos.getNeighbours(i) || this.panos.setNeighbour(i, i, !0))
  17063. }
  17064. .bind(this)),
  17065. 0 === this.panos.length && (R.warn("Model has no panos, turning off inside mode"),
  17066. this.supportedModes[s.PANORAMA] = !1),
  17067. $.when(this)
  17068. }
  17069. .bind(this)),
  17070. this.loadPanosPromise
  17071. }
  17072. ,
  17073. t.prototype.loadHighlightReel = function() {
  17074. var t = $.Deferred()
  17075. , e = this.options.urlBase + "data/" + this.sid + "/active_reel.json";
  17076. return a.get(e, {
  17077. responseType: "json",
  17078. auth: this.isPublic ? null : u.authorizationHeader
  17079. }).done(function(e) {
  17080. e.reel ? (R.info("Got highlight reel with " + e.reel.length + " items"),
  17081. this.images.filterByModesAndReel(this.supportedModes, e.reel)) : R.info("No highlight reel found"),
  17082. t.resolve()
  17083. }
  17084. .bind(this)).fail(function() {
  17085. R.warn("Getting highlight reel failed, no highlights available"),
  17086. t.resolve()
  17087. }),
  17088. t
  17089. }
  17090. ,
  17091. t.prototype.waitForLoad = function(e, t) {
  17092. t() || (this.waitQueue.push({
  17093. object: e,
  17094. isLoadedCallback: t
  17095. }),
  17096. 1 === this.waitQueue.length && this.emit("waiting"))
  17097. }
  17098. ,
  17099. t.prototype.hide = function() {
  17100. this.floors.hide()
  17101. }
  17102. ,
  17103. t.prototype.show = function() {
  17104. this.floors.show()
  17105. }
  17106. ,
  17107. t.prototype.floorNames = function() {
  17108. return this.floors.names()
  17109. }
  17110. ,
  17111. t.prototype.warpDestFloors = function(e, t) {
  17112. if (e && this.floors.length === e.length) {
  17113. var i = e.findIndex(function(e) {
  17114. return e
  17115. }
  17116. .bind(this));
  17117. -1 !== i && this.setFloor(this.floors.list[i], null, t)
  17118. } else
  17119. this.toggleAllFloors(!0)
  17120. }
  17121. ,
  17122. t.prototype.setFloor = function(e, t, i) {
  17123. this.allFloorsVisible && this.emit("allfloors.toggled", !1, this.currentFloor),
  17124. this.allFloorsVisible = !1,
  17125. this._setFloor(e, t, i)
  17126. }
  17127. ,
  17128. t.prototype.toggleAllFloors = function(e) {
  17129. this.allFloorsVisible = void 0 !== e ? e : !this.allFloorsVisible,
  17130. this.emit("allfloors.toggled", this.allFloorsVisible, this.currentFloor),
  17131. this._setFloor(this.currentFloor)
  17132. }
  17133. ,
  17134. t.prototype._setFloor = function(e, t, i) {
  17135. var n;
  17136. if (t = t || this.mode,
  17137. this.emit("floor.changed", e, t, this.currentFloor),
  17138. this.currentFloor = e,
  17139. t === s.PANORAMA) {
  17140. if (this.show(),
  17141. this.shouldShowtags && this.tagsShown)
  17142. for (n in this.tags)
  17143. this.tags[n].show(u.showFloorDuration)
  17144. } else if ((t === s.FLOORPLAN || t === s.DOLLHOUSE) && (this.floors.list.forEach(function(e, t) {
  17145. e.toggle(e === this.currentFloor || this.allFloorsVisible, i || this.allFloorsVisible)
  17146. }
  17147. .bind(this)),
  17148. this.shouldShowtags && this.tagsShown))
  17149. for (n in this.tags) {
  17150. var r = this.tags[n];
  17151. this.allFloorsVisible ? r.show(u.showFloorDuration) : r.floor === this.currentFloor ? r.show(u.showFloorDuration, u.showFloorDelay) : r.hide(u.hideFloorDuration, u.hideFloorDelay)
  17152. }
  17153. var o = this
  17154. , a = e;
  17155. A.start(function() {}, u.showFloorDelay, function() {
  17156. o.floors.forEach(function(t) {
  17157. t.chunks.forEach(function(e) {
  17158. e.renderOrder = t === a ? l.visibleFloor : l.ghostFloor
  17159. })
  17160. })
  17161. }
  17162. .bind(this))
  17163. }
  17164. ,
  17165. t.prototype.toggleExplode = function() {
  17166. this.floors.toggleExplodeHorizontal()
  17167. }
  17168. ,
  17169. t.prototype.toggleExplodeUp = function() {
  17170. this.floors.toggleExplodeVertical()
  17171. }
  17172. ,
  17173. t.prototype.nextFloor = function(e) {
  17174. return this.floors.nextFloor(this.currentFloor, e)
  17175. }
  17176. ,
  17177. t.prototype.addFloor = function(e) {
  17178. this.floors.add(e)
  17179. }
  17180. ,
  17181. t.prototype.getFloorAtPoint = function(e) {
  17182. return this.floors.getFloorAtPoint(e)
  17183. }
  17184. ,
  17185. t.prototype.getTagBySid = function(e) {
  17186. return this.tags[e]
  17187. }
  17188. ,
  17189. t.prototype.addChunk = function(e, t) {
  17190. this.floors.getOrMakeFloor(e).addChunk(t),
  17191. this.chunks.push(t)
  17192. }
  17193. ,
  17194. t.prototype.setMode = function(t) {
  17195. if (!this.supportedModes[t])
  17196. throw new x("Mode not supported for this model: " + t);
  17197. this.mode = t
  17198. this.skybox.material.transparent = t == "panorama" ? false : true //xzw add // 如果skybox透明,会让其中其他mesh 如热点的透明出问题
  17199. this.chunks.forEach(function(e) {
  17200. e.setMode(t)
  17201. })
  17202. }
  17203. ,
  17204. t.prototype.build = function() {
  17205. this.heroLocations = this.images.getHeroLocations(this.panos);
  17206. var e = function() {
  17207. 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()
  17208. }
  17209. .bind(this)();
  17210. for (var t in this.has360Views = u.show360Views.enabled && this.heroLocations.some(function(e) {
  17211. return e.cameraMode === s.PANORAMA && this.panos.get(e.panoId) && !this.panos.get(e.panoId).isAligned()
  17212. }
  17213. .bind(this)) || e,
  17214. null === this.heroImage && R.warn("No hero image defined."),
  17215. this.currentFloor = this.floors.last(),
  17216. this.floors.build(),
  17217. this.colliders = this.floors.reduce(function(e, t) {
  17218. return e.concat(t.collider.children)
  17219. }, []),
  17220. this.panos.forEach(function(e) {
  17221. e.build1(),
  17222. e.on("enter", function() {
  17223. e.floor !== this.currentFloor && this.setFloor(e.floor)
  17224. }
  17225. .bind(this))
  17226. }
  17227. .bind(this)),
  17228. this.panos.forEach(function(e) {
  17229. e.build2()
  17230. }),
  17231. this.floors.forEach(function(e) {
  17232. this.boundingBox.union(e.boundingBox)
  17233. }
  17234. .bind(this)),
  17235. this.size = this.boundingBox.size(),
  17236. this.center = this.boundingBox.center(),
  17237. this.floors.forEach(function(e) {
  17238. R.info("Floor " + e + ": " + e.children.length + " chunks, " + e.panos.length + " panos.")
  17239. }
  17240. .bind(this)),
  17241. this.panos.populate_path_graph(),
  17242. this.skybox = new n(this.boundingBox),
  17243. this.skybox.matrixWorldNeedsUpdate = !0,
  17244. this.add(this.skybox),
  17245. setTimeout(function() {
  17246. this.hotsCount && this.shineHots()
  17247. }
  17248. .bind(this), 1300),
  17249. this.tags)
  17250. this.tags[t].build();
  17251. return R.debug("Done building model"),
  17252. 0 < f.raycastsDone && (R.warn("raycasts: " + f.raycastsDone),
  17253. R.warn("raycasts skipped: " + f.raycastsSkipped)),
  17254. this.buildRooms(),
  17255. this.labels.associateWithRooms(this.rooms),
  17256. $.when(this)
  17257. }
  17258. ,
  17259. t.prototype.loadLabels = function() {
  17260. this.labels = new b(this);
  17261. var e = $.Deferred();
  17262. /* if (window.MP_PREFETCHED_MODELDATA.model.player_options.labels && (this.showingLabels = !0),
  17263. !this.showingLabels) */
  17264. return e.resolve();
  17265. var t = g_Prefix + "data/" + this.sid + "/labels.json";
  17266. return this.labels.load(t, !this.isPublic).done(e.resolve.bind(e)).fail(function() {
  17267. R.warn("Getting labels failed, not displaying labels."),
  17268. e.resolve()
  17269. }),
  17270. e
  17271. }
  17272. ,
  17273. t.prototype.buildRooms = function() {
  17274. this.rooms = new _(this),
  17275. this.rooms.createFromChunks(this.chunks),
  17276. this.rooms.calcRoomBoundaries()
  17277. }
  17278. ,
  17279. t.prototype.updateProjectedPanos = function() {
  17280. this.projectedPano0 && this.projectedPano1 && this.setProjectedPanos(this.projectedPano0, this.projectedPano1, !1)
  17281. }
  17282. ,
  17283. t.prototype.setProjectedPanos = function(t, i, n) {
  17284. null != n || (n = !0),
  17285. n = !!n,
  17286. this.projectedPano0 = t,
  17287. this.projectedPano1 = i,
  17288. this.skybox.material.setProjectedPanos(t, i, n),
  17289. this.chunks.forEach(function(e) {
  17290. e.materialInside.setProjectedPanos(t, i, n)
  17291. })
  17292. }
  17293. ,
  17294. t.prototype.setSide = function(t) {
  17295. this.floors.forEach(function(e) {
  17296. e.collider.material.side = t
  17297. })
  17298. }
  17299. ,
  17300. t.prototype.heroCount = function() {
  17301. return this.heroLocations ? this.heroLocations.length : 0
  17302. }
  17303. ,
  17304. t.prototype.getHeroDescriptorByIndex = function(e=[]) {//改 因增加了二级目录
  17305. if (e[0] < 0)
  17306. return R.warn("Model.getHeroDescriptorByHeroIndex() -> heroIndex is less than 0."),
  17307. null;
  17308. if (this.heroCount() < 1)
  17309. return R.warn("Model.getHeroDescriptorByIndex() -> No hero locations in this model"),
  17310. null;
  17311. var t = this.heroLocations[e[0]];
  17312. if(t.heroLocations && e[1]!=void 0){
  17313. t = t.heroLocations[e[1]];
  17314. }
  17315. return void 0 === t ? (R.warn("Model.getHeroDescriptorByIndex() -> Index " + e + " is not a validindex"),
  17316. null) : t
  17317. }
  17318. ,
  17319. t.prototype.findPanoramicHero = function() {
  17320. for (var e in this.heroLocations)
  17321. if (this.heroLocations[e].cameraMode === s.PANORAMA)
  17322. return this.heroLocations[e];
  17323. return null
  17324. }
  17325. ,
  17326. t.prototype.listImagePanos = function() {
  17327. var i = []
  17328. , n = this;
  17329. return this.images.forEach(function(e) {
  17330. if (e.metadata && e.metadata.scan_id) {
  17331. var t = n.panos.get(e.metadata.scan_id);
  17332. t && (n.supportsTiles || t.isLoaded("high") || i.push(t))
  17333. }
  17334. }),
  17335. i
  17336. }
  17337. ,
  17338. t.prototype.fadePanoMarkers = function(e, t) {
  17339. this.panos.fadeMarkerOpacity(e, t)
  17340. }
  17341. ,
  17342. t.prototype.setSweepVisibility = function(t) {
  17343. this.panos.forEach(function(e) {
  17344. e.marker && (e.marker.visible = t)
  17345. })
  17346. }
  17347. ,
  17348. t.prototype.outsideAllowed = function() {
  17349. return this.supportedModes[s.DOLLHOUSE] && this.supportedModes[s.FLOORPLAN]
  17350. }
  17351. ,
  17352. O.exports = t
  17353. }
  17354. ).call(this, "/js/model/Model.js")
  17355. }
  17356. , {
  17357. "../constants": 8,
  17358. "../enum/AlignmentType": 17,
  17359. "../enum/RenderOrder": 42,
  17360. "../enum/Viewmode": 51,
  17361. "../exception/BasicException": 55,
  17362. "../label/Label": 90,
  17363. "../loaders/ModelLoader": 105,
  17364. "../loaders/ModelTextureLoader": 106,
  17365. "../loaders/SweepDataLoader": 107,
  17366. "../tag/tag": 123,
  17367. "../tag/tagManager": 124,
  17368. "../objects/BoundingTextureSkybox": 143,
  17369. "../objects/Chunk": 144,
  17370. "../objects/Floor": 146,
  17371. "../objects/Panorama": 148,
  17372. "../objects/Room": 150,
  17373. "../objects/Snapshot": 153,
  17374. "../settings": 166,
  17375. "../shaders": 167,
  17376. "../util/ModelUrls": 177,
  17377. "../util/PanoramaCollection": 178,
  17378. "../util/ajax": 181,
  17379. "../util/common": 185,
  17380. "../util/easing": 186,
  17381. "../util/lerp": 188,
  17382. "../util/logger": 189,
  17383. "../util/math": 190,
  17384. "../util/texture": 194,
  17385. "../util/transitions": 195,
  17386. "./../util/browser": 182,
  17387. "./../util/showcase": 193,
  17388. "./Chunks": 135,
  17389. "./FloorCollection": 136,
  17390. "./ImageCollection": 137,
  17391. "./LabelCollection": 138,
  17392. "./RoomCollection": 141,
  17393. events: 202,
  17394. three: 217,
  17395. hot: "hot"
  17396. }],
  17397. 140: [function(e, t, i) {
  17398. "use strict";
  17399. function n() {
  17400. this.modelMap = {},
  17401. this.activeModel = null,
  17402. this.modelCount = 0,
  17403. this.tileDownloader = null,
  17404. this.panoRenderer = null
  17405. }
  17406. var r = (e("three"),
  17407. e("../util/common"))
  17408. , o = e("../exception/BasicException")
  17409. , a = e("../enum/ModelManagerEvents")
  17410. , s = e("../enum/PanoRendererEvents")
  17411. , l = e("events").EventEmitter;
  17412. n.prototype.init = function(e, t, i) {
  17413. this.tileDownloader = e,
  17414. this.panoRenderer = t,
  17415. this.qualityManager = i,
  17416. this.bindEvents()
  17417. }
  17418. ,
  17419. n.prototype.bindEvents = function() {
  17420. this.panoRenderer.on(s.TileRenderSuccess, this.onTileRendered.bind(this))
  17421. }
  17422. ,
  17423. n.prototype.onTileRendered = function(e, t, i, n) {}
  17424. ,
  17425. n.prototype.addModel = function(e) {
  17426. this.modelMap[e.sid] = e,
  17427. 0 === this.modelCount && this.activateModel(e.sid),
  17428. this.modelCount++,
  17429. this.emit(a.ModelAdded)
  17430. }
  17431. ,
  17432. n.prototype.getModel = function(e) {
  17433. return this.modelMap[e]
  17434. }
  17435. ,
  17436. n.prototype.activateModel = function(e) {
  17437. var t = this.modelMap[e];
  17438. if (!t)
  17439. throw new o("Tried to activate invalid model!");
  17440. var i = this.activeModel;
  17441. this.activeModel = t,
  17442. this.tileDownloader.setPanoData(t.panos, t.listImagePanos(), t.sid),
  17443. this.tileDownloader.setUrls(t.urls),
  17444. t.panos.forEach(function(e) {
  17445. e.attachToPanoRenderer(this.panoRenderer),
  17446. e.tileDownloader = this.tileDownloader,
  17447. e.qualityManager = this.qualityManager
  17448. }
  17449. .bind(this)),
  17450. this.emit(a.ActiveModelChanged, {
  17451. oldModel: i,
  17452. model: t
  17453. })
  17454. }
  17455. ,
  17456. n.prototype.getActiveModel = function() {
  17457. return this.activeModel
  17458. }
  17459. ,
  17460. r.extend(n, l),
  17461. t.exports = n
  17462. }
  17463. , {
  17464. "../enum/ModelManagerEvents": 33,
  17465. "../enum/PanoRendererEvents": 35,
  17466. "../exception/BasicException": 55,
  17467. "../util/common": 185,
  17468. events: 202,
  17469. three: 217
  17470. }],
  17471. 141: [function(r, l, e) {
  17472. (function(e) {
  17473. "use strict";
  17474. function o() {
  17475. n.call(this)
  17476. }
  17477. var a = r("../objects/Room")
  17478. , t = (r("../settings"),
  17479. r("../util/logger"))
  17480. , i = (r("../util/transitions"),
  17481. r("../util/easing"),
  17482. r("../util/common"))
  17483. , n = r("../util/IndexedCollection")
  17484. , s = r("./Chunks");
  17485. new t(e),
  17486. i.inherit(o, n),
  17487. o.prototype.getIndex = function(e) {
  17488. return e.roomId
  17489. }
  17490. ,
  17491. o.prototype.calcRoomBoundaries = function() {
  17492. this.forEach(function(e) {
  17493. e.calcBoundaries()
  17494. })
  17495. }
  17496. ,
  17497. o.prototype.createFromChunks = function(e) {
  17498. var n = {
  17499. floorId: -1,
  17500. roomId: -1
  17501. }
  17502. , r = {};
  17503. e.forEach(function(e) {
  17504. s.parseIdsFromChunkName(e.name, n);
  17505. var t = r[n.roomId];
  17506. if (!t) {
  17507. var i = o.generateRoomId(n.floorId, n.roomId);
  17508. t = new a(n.floorId,i),
  17509. this.add(t),
  17510. r[n.roomId] = t
  17511. }
  17512. t.addChunk(e)
  17513. }
  17514. .bind(this)),
  17515. this.calcRoomBoundaries()
  17516. }
  17517. ,
  17518. o.generateRoomId = function(e, t) {
  17519. return e + "_" + t
  17520. }
  17521. ,
  17522. l.exports = o
  17523. }
  17524. ).call(this, "/js/model/RoomCollection.js")
  17525. }
  17526. , {
  17527. "../objects/Room": 150,
  17528. "../settings": 166,
  17529. "../util/IndexedCollection": 175,
  17530. "../util/common": 185,
  17531. "../util/easing": 186,
  17532. "../util/logger": 189,
  17533. "../util/transitions": 195,
  17534. "./Chunks": 135
  17535. }],
  17536. 142: [function(e, t, i) {
  17537. "use strict";
  17538. function n(e, t, i) {
  17539. var n = (e = e.clone().expandByScalar(0.01)).size()
  17540. , r = new o.BoxGeometry(n.x,n.y,n.z);
  17541. r.boundingBox = e,
  17542. o.Mesh.call(this, r, t),
  17543. this.position.copy(e.center()),
  17544. this.frustumCulled = !1,
  17545. i && this.add(new o.WireframeHelper(this))
  17546. }
  17547. var o = e("three");
  17548. (n.prototype = Object.create(o.Mesh.prototype)).constructor = n,
  17549. t.exports = n
  17550. }
  17551. , {
  17552. three: 217
  17553. }],
  17554. 143: [function(l, c, e) {
  17555. (function(e) {
  17556. "use strict";
  17557. function t(e) {
  17558. s.time("Computing a nice bounding cubemap");
  17559. var t = new r({
  17560. side: i.BackSide,
  17561. transparent: !0
  17562. });
  17563. t.uniforms.modelAlpha.value = 0,
  17564. t.uniforms.opacity.value = 1 - o.modelAlpha,
  17565. this.renderOrder = a.boundingSkybox,
  17566. n.call(this, e, t),
  17567. s.timeEnd("Computing a nice bounding cubemap")
  17568. }
  17569. var i = l("three")
  17570. , n = (l("../enum/Viewmode"),
  17571. l("../shaders"),
  17572. l("./BoundingMesh"))
  17573. , r = l("../materials/ModelTextureMaterial")
  17574. , o = l("../settings")
  17575. , a = l("../enum/RenderOrder")
  17576. , s = new (l("../util/logger"))(e);
  17577. (t.prototype = Object.create(n.prototype)).constructor = t,
  17578. c.exports = t
  17579. }
  17580. ).call(this, "/js/objects/BoundingTextureSkybox.js")
  17581. }
  17582. , {
  17583. "../enum/RenderOrder": 42,
  17584. "../enum/Viewmode": 51,
  17585. "../materials/ModelTextureMaterial": 118,
  17586. "../settings": 166,
  17587. "../shaders": 167,
  17588. "../util/logger": 189,
  17589. "./BoundingMesh": 142,
  17590. three: 217
  17591. }],
  17592. 144: [function(e, t, i) {
  17593. "use strict";
  17594. function n(e) {
  17595. this.materialInside = new s({
  17596. side: r.DoubleSide
  17597. });
  17598. var t = r.UniformsUtils.clone(o.modelOutside.uniforms);
  17599. this.materialOutside = new r.RawShaderMaterial({
  17600. fragmentShader: o.modelOutside.fragmentShader,
  17601. vertexShader: o.modelOutside.vertexShader,
  17602. uniforms: t,
  17603. side: r.FrontSide,
  17604. name: "chunkOut"
  17605. }),
  17606. r.Mesh.call(this, e.geometry, this.materialInside),
  17607. this.name = e.name || "",
  17608. this.textureName = e.textureName,
  17609. this.meshUrl = e.meshUrl
  17610. }
  17611. var r = e("three")
  17612. , o = e("../shaders")
  17613. , a = e("../enum/Viewmode")
  17614. , s = e("../materials/ModelTextureMaterial");
  17615. (n.prototype = Object.create(r.Mesh.prototype)).setTextureMap = function(e) {
  17616. this.materialInside.uniforms.map.value = e,
  17617. this.materialOutside.uniforms.map.value = e
  17618. }
  17619. ,
  17620. n.prototype.setMode = function(e) {
  17621. var t = e === a.DOLLHOUSE || e === a.FLOORPLAN ? this.materialOutside : this.materialInside;
  17622. t.side = e === a.PANORAMA ? r.DoubleSide : r.FrontSide,
  17623. t.transparent = this.material.transparent,
  17624. t.uniforms.opacity.value = this.material.uniforms.opacity.value;
  17625. this.material = t
  17626. }
  17627. ,
  17628. t.exports = n
  17629. }
  17630. , {
  17631. "../enum/Viewmode": 51,
  17632. "../materials/ModelTextureMaterial": 118,
  17633. "../shaders": 167,
  17634. three: 217
  17635. }],
  17636. 145: [function(e, t, i) {
  17637. "use strict";
  17638. function n(e) {
  17639. this.chunksize = e || 10,
  17640. this.chunks = {},
  17641. this.boundingBoxes = {},
  17642. this.children = [],
  17643. this.offset = new m.Vector3(0,.5,0),
  17644. this.material = new m.MeshBasicMaterial({
  17645. color: 16777215 * Math.random(),
  17646. side: m.DoubleSide
  17647. })
  17648. }
  17649. var m = e("three");
  17650. e("../enum/Viewmode"),
  17651. n.prototype.add = function(e) {
  17652. var t, i, n, r, o, a, s, l, c, h, u = e.attributes;
  17653. u ? (t = u.position.array,
  17654. i = void 0 !== e.index ? e.index.array : void 0) : (t = e.vertices,
  17655. e.faces);
  17656. var d = new m.Vector3;
  17657. if (i)
  17658. for (n = 0,
  17659. r = i.length; n < r; n += 3) {
  17660. var p = 3 * i[n]
  17661. , f = 3 * i[n + 1]
  17662. , g = 3 * i[n + 2];
  17663. o = (t[p] + t[f] + t[g]) / 3,
  17664. a = (t[1 + p] + t[1 + f] + t[1 + g]) / 3,
  17665. s = (t[2 + p] + t[2 + f] + t[2 + g]) / 3,
  17666. c = (l = Math.floor(o / this.chunksize) + "." + Math.floor(a / this.chunksize) + "." + Math.floor(s / this.chunksize))in this.chunks ? (h = this.chunks[l],
  17667. this.boundingBoxes[l]) : (h = this.chunks[l] = [],
  17668. this.boundingBoxes[l] = new m.Box3),
  17669. h.push(t[p], t[1 + p], t[2 + p], t[f], t[1 + f], t[2 + f], t[g], t[1 + g], t[2 + g]),
  17670. c.expandByPoint(d.set(t[p], t[1 + p], t[2 + p])),
  17671. c.expandByPoint(d.set(t[f], t[1 + f], t[2 + f])),
  17672. c.expandByPoint(d.set(t[g], t[1 + g], t[2 + g]))
  17673. }
  17674. else
  17675. for (n = 0,
  17676. r = t.length; n < r; n += 9)
  17677. o = (t[n] + t[n + 3] + t[n + 6]) / 3,
  17678. a = (t[n + 1] + t[n + 4] + t[n + 7]) / 3,
  17679. s = (t[n + 2] + t[n + 5] + t[n + 8]) / 3,
  17680. c = (l = Math.floor(o / this.chunksize) + "." + Math.floor(a / this.chunksize) + "." + Math.floor(s / this.chunksize))in this.chunks ? (h = this.chunks[l],
  17681. this.boundingBoxes[l]) : (h = this.chunks[l] = [],
  17682. this.boundingBoxes[l] = new m.Box3),
  17683. h.push(t[n], t[n + 1], t[n + 2], t[n + 3], t[n + 4], t[n + 5], t[n + 6], t[n + 7], t[n + 8]),
  17684. c.expandByPoint(d.set(t[n], t[n + 1], t[n + 2])),
  17685. c.expandByPoint(d.set(t[n + 3], t[n + 4], t[n + 5])),
  17686. c.expandByPoint(d.set(t[n + 6], t[n + 7], t[n + 8]))
  17687. }
  17688. ,
  17689. n.prototype.build = function() {
  17690. var e = new m.Object3D;
  17691. for (var t in e.material = this.material,
  17692. this.chunks) {
  17693. var i = this.chunks[t]
  17694. , n = new m.BufferGeometry;
  17695. n.addAttribute("position", new m.BufferAttribute(new Float32Array(i),3)),
  17696. n.boundingBox = this.boundingBoxes[t];
  17697. var r = new m.Mesh(n,this.material);
  17698. r.material.visible = !1,
  17699. e.add(r),
  17700. this.chunks[t] = []
  17701. }
  17702. return e
  17703. }
  17704. ,
  17705. t.exports = n
  17706. }
  17707. , {
  17708. "../enum/Viewmode": 51,
  17709. three: 217
  17710. }],
  17711. 146: [function(e, t, i) {
  17712. "use strict";
  17713. var n = e("three")
  17714. , r = e("../settings")
  17715. , o = e("../util/common")
  17716. , a = e("../util/lerp")
  17717. , s = e("./ChunkedCollider")
  17718. , l = e("../util/transitions")
  17719. , c = e("../util/easing")
  17720. , h = (e("../objects/Panorama"),
  17721. e("../enum/RenderOrder"));
  17722. e("../localization/localize");
  17723. function u(e, t, i) {
  17724. n.Object3D.call(this),
  17725. this.model = e,
  17726. this.floorIndex = t,
  17727. this.lang = r.languageTag,
  17728. this.name = i || "cn" === r.languageTag ? "Floor " + (t + 1) : "第" + (t + 1) + "层",
  17729. this.panos = [],
  17730. this.chunks = [],
  17731. this.colliderBuilder = new s(3),
  17732. this.collider = null,
  17733. this.center = null,
  17734. this.boundingBox = new n.Box3,
  17735. this.size = null,
  17736. this.hidden = !1,
  17737. this.conservativeBoundingBox = new n.Box3,
  17738. this.debugColor = 16777215 * Math.random(),
  17739. this.transition = null
  17740. }
  17741. (u.prototype = Object.create(n.Object3D.prototype)).enter = function(e) {
  17742. this.model.setFloor(this, e)
  17743. }
  17744. ,
  17745. u.prototype.hide = function(e) {
  17746. if (!this.hidden || this.transition) {
  17747. this.chunks.forEach(function(e) {
  17748. e.material.transparent = !0
  17749. }),
  17750. l.cancel(this.transition);
  17751. var t = e ? 0 : r.hideFloorDuration + r.hideFloorDelay
  17752. , i = e ? 0 : r.hideFloorDelay / t;
  17753. this.transition = l.start(a.allUniforms(this.chunks, "opacity", .08), t, function() {
  17754. this.hidden = !0
  17755. }
  17756. .bind(this), i, c.easeInOutQuad)
  17757. }
  17758. }
  17759. ,
  17760. u.prototype.show = function(e) {
  17761. if (this.hidden || this.transition) {
  17762. this.hidden = !1,
  17763. l.cancel(this.transition);
  17764. var t = e ? r.showFloorDuration : r.showFloorDuration + r.showFloorDelay
  17765. , i = e ? 0 : r.showFloorDelay / t;
  17766. this.transition = l.start(a.allUniforms(this.chunks, "opacity", 1), t, function() {
  17767. this.hidden || this.chunks.forEach(function(e) {
  17768. e.material.transparent = !1
  17769. })
  17770. }
  17771. .bind(this), i, c.easeInOutQuad)
  17772. }
  17773. }
  17774. ,
  17775. u.prototype.toggle = function(e, t) {
  17776. (e = void 0 === e ? this.hidden : e) ? this.show(t) : this.hide(t)
  17777. }
  17778. ,
  17779. u.prototype.containsPoint = function(t) {
  17780. return this.collider.children.some(function(e) {
  17781. return e.geometry.boundingBox || e.geometry.computeBoundingBox(),
  17782. e.geometry.boundingBox.containsPoint(t)
  17783. })
  17784. }
  17785. ,
  17786. u.prototype.distanceToPoint = function(i) {
  17787. var n = null
  17788. , r = 1 / 0;
  17789. return this.collider.children.forEach(function(e) {
  17790. e.geometry.boundingBox || e.geometry.computeBoundingBox();
  17791. var t = e.geometry.boundingBox.distanceToPoint(i);
  17792. (!n || t < r) && (r = t,
  17793. n = e)
  17794. }),
  17795. r
  17796. }
  17797. ,
  17798. u.prototype.addChunk = function(e) {
  17799. e.renderOrder = h.ghostFloor,
  17800. this.add(e),
  17801. this.chunks.push(e),
  17802. this.boundingBox.union(e.geometry.boundingBox),
  17803. this.size = this.boundingBox.size(),
  17804. this.colliderBuilder.add(e.geometry)
  17805. }
  17806. ,
  17807. u.prototype.addPano = function(e) {
  17808. this.panos.push(e),
  17809. this.add(e.skyboxMesh),
  17810. e.marker && this.add(e.marker);
  17811. var t = new n.Vector3(1,1,1)
  17812. , i = (new n.Box3).setFromCenterAndSize(e.position, t);
  17813. this.boundingBox.union(i)
  17814. }
  17815. ,
  17816. u.prototype.build = function() {
  17817. this.collider = this.colliderBuilder.build(!0),
  17818. this.add(this.collider),
  17819. this.center = this.boundingBox.center(),
  17820. this.conservativeBoundingBox.copy(this.boundingBox),
  17821. this.conservativeBoundingBox.min.y = o.lowerMedian(this.collider.children.map(function(e) {
  17822. return e.geometry.boundingBox.min.y
  17823. }), 5),
  17824. this.conservativeBoundingBox.max.y = o.lowerMedian(this.collider.children.map(function(e) {
  17825. return e.geometry.boundingBox.max.y
  17826. }), 5),
  17827. this.colliderBuilder = null
  17828. }
  17829. ,
  17830. u.prototype.toShortString = function() {
  17831. return o.nth(this.floorIndex + 1)
  17832. }
  17833. ,
  17834. u.prototype.toString = function() {
  17835. return this.name
  17836. }
  17837. ,
  17838. t.exports = u
  17839. }
  17840. , {
  17841. "../enum/RenderOrder": 42,
  17842. "../localization/localize": 108,
  17843. "./strings-cn-CN": 109,
  17844. "../objects/Panorama": 148,
  17845. "../settings": 166,
  17846. "../util/common": 185,
  17847. "../util/easing": 186,
  17848. "../util/lerp": 188,
  17849. "../util/transitions": 195,
  17850. "./ChunkedCollider": 145,
  17851. three: 217
  17852. }],
  17853. 147: [function(e, t, i) {
  17854. "use strict";
  17855. function n(e) {
  17856. this.player = e,
  17857. this.obj3d = null,
  17858. this.UP = new u.Vector3(0,1,0)
  17859. }
  17860. var u = e("three")
  17861. , d = e("../settings");
  17862. n.prototype.prefs = {
  17863. linewidth: 3,
  17864. height: .07,
  17865. opacity: .45,
  17866. endScale: .05
  17867. },
  17868. n.prototype.discard = function() {
  17869. if (this.obj3d) {
  17870. var e = this.obj3d.parent;
  17871. e && e.remove(this.obj3d)
  17872. }
  17873. this.obj3d = null
  17874. }
  17875. ,
  17876. n.prototype.draw = function() {
  17877. if (this.discard(),
  17878. d.showNeighbors) {
  17879. var e = this.player.currentPano.floor;
  17880. this.obj3d = new u.Object3D;
  17881. var t = this.player.model.panos.getNeighbours(this.player.currentPano)
  17882. , i = this.player.currentPano.floorPosition.clone().sub(this.player.model.position);
  17883. i.y += this.prefs.height;
  17884. var n = .1525
  17885. , r = new u.Matrix4;
  17886. for (var o in t)
  17887. if (t[o]) {
  17888. var a = this.player.model.panos.get(o)
  17889. , s = (a.position.clone().sub(this.player.model.position),
  17890. a.position.clone().sub(a.floorPosition))
  17891. , l = a.floorPosition.clone().sub(this.player.model.position);
  17892. l.y += this.prefs.height;
  17893. var c = new u.Geometry;
  17894. c.vertices.push(new u.Vector3(0,-.0127,0), new u.Vector3(-.0127,0,0), new u.Vector3(0,.0127,0), new u.Vector3(.0127,0,0), new u.Vector3(0,-.0127,0)),
  17895. c.vertices.push(new u.Vector3(0,-.255,0), new u.Vector3(.255,-.255,0), new u.Vector3(.255,n,0), new u.Vector3(-n,n,0), new u.Vector3(-n,.127,0), new u.Vector3(-.19,.1,0), new u.Vector3(-.19,-.2032,0), new u.Vector3(-n,-.2286,0), new u.Vector3(-n,-.255,0), new u.Vector3(0,-.255,0)),
  17896. r.identity().setPosition(s),
  17897. c.applyMatrix(r),
  17898. c.vertices.push(new u.Vector3(0,-this.prefs.endScale,0)),
  17899. c.vertices.push(new u.Vector3(-this.prefs.endScale,-this.prefs.endScale,0), new u.Vector3(-this.prefs.endScale,this.prefs.endScale,0), new u.Vector3(this.prefs.endScale,this.prefs.endScale,0), new u.Vector3(this.prefs.endScale,-this.prefs.endScale,0)),
  17900. r.lookAt(l, i, this.UP).setPosition(l),
  17901. c.applyMatrix(r),
  17902. c.vertices.push(l, i);
  17903. var h = new u.Line(c,new u.LineBasicMaterial({
  17904. color: a.debugColor.getHex(),
  17905. transparent: !0,
  17906. opacity: this.prefs.opacity,
  17907. depthWrite: !1,
  17908. name: "sLine" + o,
  17909. linewidth: this.prefs.linewidth
  17910. }));
  17911. this.obj3d.add(h)
  17912. }
  17913. e.add(this.obj3d)
  17914. }
  17915. }
  17916. ,
  17917. n.prototype.update = function() {
  17918. d.showNeighbors && this.obj3d && this.obj3d.updateMatrixWorld()
  17919. }
  17920. ,
  17921. t.exports = n
  17922. }
  17923. , {
  17924. "../settings": 166,
  17925. three: 217
  17926. }],
  17927. 148: [function(S, M, e) {
  17928. (function(e) {
  17929. "use strict";
  17930. function r(e, t, i, n) {
  17931. this.model = e,
  17932. this.id = t,
  17933. this.alignmentType = i.alignmentType || c.ALIGNED,
  17934. this.neighbourUUIDs = i.neighbours || null,
  17935. this.neighbourPanos = null,
  17936. this.floor = null,
  17937. this.floorIndex = i.floor,
  17938. this.failedLoadingAt = 0,
  17939. this.maxLoadRetries = 4,
  17940. this.origin = i.position.clone(),
  17941. this.position = this.alignmentType === c.UNALIGNED ? new s.Vector3(0,-5,0) : i.position.clone(),
  17942. this.quaternion = i.quaternion.clone(),
  17943. this.skyboxMesh = new s.Mesh(E),
  17944. this.skyboxMesh.position.copy(this.position),
  17945. this.skyboxMesh.quaternion.copy(this.quaternion),
  17946. this.skyboxMesh.name = "skybox",
  17947. this.skyboxMesh.visible = !1,
  17948. this.skyboxMesh.updateMatrix(),
  17949. this.skyboxMesh.updateMatrixWorld(),
  17950. this.marker = null,
  17951. this.showFloorMarker = this.showFloorMarker = !window.MP_PREFETCHED_MODELDATA.hideFloorMarker,
  17952. this.isAligned() && (this.marker = new s.Mesh(_,new s.MeshBasicMaterial({
  17953. map: b,
  17954. side: s.DoubleSide,
  17955. opacity: 0,
  17956. transparent: !0,
  17957. depthWrite: !1
  17958. })),
  17959. this.marker.visible = this.showFloorMarker,
  17960. this.marker.renderOrder = l.panoMarker,
  17961. this.marker.name = "marker",
  17962. (this.marker.pano = this).marker.layers.set(v.PANOMARKERS),
  17963. this.marker.updateMatrixWorld(),
  17964. a.colorMarkerOnLoad && this.on("load", function() {
  17965. this.marker.material.color.set(65280)
  17966. })),
  17967. this.debugColor = (new s.Color).setHSL(.06 + .53 * Math.random(), .8 + .2 * Math.random(), .5 + .2 * Math.random()),
  17968. this.floorPosition = i.puck ? i.puck.clone() : null,
  17969. this.tiled = n,
  17970. this.tiled ? this.solidSkybox = null : (this.solidSkybox = new s.Texture([null, null, null, null, null, null]),
  17971. this.solidSkybox.flipY = !1,
  17972. a.minimalMemoryMode && (this.solidSkybox.minFilter = s.LinearFilter,
  17973. this.solidSkybox.magFilter = s.LinearFilter,
  17974. this.solidSkybox.generateMipmaps = !1)),
  17975. this.zoomed = !1,
  17976. this.panoRenderer = null,
  17977. this.qualityManager = null,
  17978. this.tileDownloader = null,
  17979. this.tiledPanoRenderTarget = null,
  17980. this.minimumTiledPanoLoaded = !1,
  17981. this.highestPartialTileRenderOpCompleted = 0,
  17982. this.highestFullTileRenderOpCompleted = 0,
  17983. this.shouldRedrawOnBaseLoaded = !1,
  17984. this.lockUntilRenderingComplete = !1,
  17985. a.colorMarkerOnLoad && this.on("load", function() {
  17986. this.marker.material.color.set(65280)
  17987. }),
  17988. (e = new s.TextureLoader).setCrossOrigin(!0);
  17989. var r = e.load("images/texture.jpg");
  17990. if (this.vrMarker = new s.Mesh(new s.OctahedronGeometry(.1,0),new s.MeshLambertMaterial({
  17991. color: 16777215,
  17992. transparent: !0,
  17993. opacity: .75,
  17994. map: r
  17995. })),
  17996. this.vrMarker.boluoType = "vr",
  17997. this.vrMarker.position.z = 1,
  17998. this.vrMarker.enabled = !0,
  17999. this.vrMarker.visible = !1,
  18000. window.vrMarkers = window.vrMarkers || [],
  18001. window.vrMarkers.push(this.vrMarker),
  18002. this.marker && this.marker.add(this.vrMarker),
  18003. a.showAxis && (this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(0,1,0),new s.Vector3(0,0,0),1,255)),
  18004. this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(0,0,1),new s.Vector3(0,0,0),1,16711680)),
  18005. this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(1,0,0),new s.Vector3(0,0,0),1,65280))),
  18006. this.adjustAngleEnable) {
  18007. (i = new s.Quaternion).setFromAxisAngle(new s.Vector3(1,0,0), this.adjustAngleX),
  18008. this.skyboxMesh.quaternion.multiply(i);
  18009. var o = new s.Quaternion;
  18010. o.setFromAxisAngle(new s.Vector3(0,1,0), this.adjustAngleY),
  18011. this.skyboxMesh.quaternion.multiply(o),
  18012. (n = new s.Quaternion).setFromAxisAngle(new s.Vector3(0,0,1), this.adjustAngleZ),
  18013. this.skyboxMesh.quaternion.multiply(n),
  18014. this.skyboxMesh.updateMatrix(),
  18015. this.skyboxMesh.updateMatrixWorld(),
  18016. this.model.updateProjectedPanos()
  18017. }
  18018. }
  18019. var i, t, s = S("three"), n = S("../util/logger"), a = S("../settings"), l = (S("../enum/Viewmode"),
  18020. S("../enum/RenderOrder")), c = S("../enum/AlignmentType"), o = (S("../util/common"),
  18021. S("../util/transitions")), h = S("../util/lerp"), u = S("../util/ajax"), d = S("../util/texture"), p = S("../util/panorama"), f = (S("../enum/TileDownloaderEvents"),
  18022. S("../enum/PanoramaEvents")), g = S("../enum/PanoRendererEvents"), m = S("../enum/PanoSizeClass"), v = S("../enum/RenderLayers"), y = (S("../scene/SceneRenderer"),
  18023. S("../enum/GLCubeFaces"),
  18024. S("../exception/BasicException")), A = S("../tile/TileUtils"), C = S("events").EventEmitter, I = new n(e), E = new s.SphereBufferGeometry(.1), _ = new s.PlaneBufferGeometry(.4,.4,1,1), b = d.load("images/marker-256x256.png");
  18025. (r.prototype = Object.create(C.prototype)).enter = (t = null,
  18026. function() {
  18027. this.setZoomed(!1),
  18028. this.emit("enter", {
  18029. oldPano: t,
  18030. newPano: this
  18031. }),
  18032. t = this
  18033. }
  18034. ),
  18035. r.prototype.exit = function() {
  18036. this.tiled ? (this.clearWaitDeferreds(),
  18037. this.minimumTiledPanoLoaded = !1,
  18038. this.tiledPanoRenderTarget = null,
  18039. this.setZoomed(!1),
  18040. this.panoRenderer.deactivateTiledPano(this),
  18041. this.highestPartialTileRenderOpCompleted = 0,
  18042. this.highestFullTileRenderOpCompleted = 0) : (this.solidSkybox.dispose(),
  18043. this.solidSkybox.loaded = !1,
  18044. this.solidSkybox.version = 0),
  18045. this.emit("exit")
  18046. }
  18047. ,
  18048. r.prototype.hoverOn = function(e) {
  18049. this.marker && (o.start(h.property(this.marker.material, "opacity", a[e].markerOpacityOnHover), 250),
  18050. a.navigation.panoScores & a.navigation.mouseDirection && this.addTextSprite("HIT", 12525854))
  18051. }
  18052. ,
  18053. r.prototype.hoverOff = function(e) {
  18054. this.marker && o.start(h.property(this.marker.material, "opacity", a[e].markerOpacity), 250)
  18055. }
  18056. ,
  18057. r.prototype.build1 = function() {
  18058. this.floor = this.floor || this.model.floors.get(this.floorIndex) || this.raycastToFindFloor() || this.model.getFloorAtPoint(this.position),
  18059. this.floor.addPano(this),
  18060. this.floorPosition = this.floorPosition || this.raycastFloorPosition(),
  18061. this.neighbourPanos = this.neighbourPanos || this.findNeighourPanos(),
  18062. a.colorMarkerByFloor && this.marker && this.marker.material.color.set(this.floor.debugColor)
  18063. }
  18064. ,
  18065. r.prototype.build2 = function() {
  18066. this.floorPosition = this.floorPosition || this.interpolateFloorPosition(),
  18067. this.height = this.position.distanceTo(this.floorPosition),
  18068. this.placeMarker()
  18069. }
  18070. ,
  18071. r.prototype.interpolateFloorPosition = function() {
  18072. var e = this.model.panos.filter(r.filters.isNeighbourPanoTo(this)).filter(function(e) {
  18073. return !!e.floorPosition
  18074. }).sort(function(e, t) {
  18075. return e.position.distanceTo(this.position) - t.position.distanceTo(this.position)
  18076. }
  18077. .bind(this))
  18078. , t = this.position.clone();
  18079. return 2 <= e.length ? t.y = (e[0].floorPosition.y + e[1].floorPosition.y) / 2 : t.add(a.noMeshFloorPositionOffset),
  18080. t
  18081. }
  18082. ,
  18083. r.prototype.raycastFloorPosition = function() {
  18084. I.warn("Performance warning: Raycasting to find floor position");
  18085. var e = new s.Raycaster(this.position,new s.Vector3(0,-1,0)).intersectObjects(this.model.colliders);
  18086. return e.length ? e[0].point : null
  18087. }
  18088. ,
  18089. r.prototype.raycastToFindFloor = (i = [new s.Vector3(0,-1,0), new s.Vector3(1,-1,0), new s.Vector3(0,-1,1), new s.Vector3(-1,-1,0), new s.Vector3(0,-1,-1), new s.Vector3(1,0,0), new s.Vector3(0,0,1), new s.Vector3(-1,0,0), new s.Vector3(0,0,-1)],
  18090. function() {
  18091. I.warn("Performance warning: Raycasting to find floor index");
  18092. for (var e = 0; e < i.length; e++) {
  18093. var t = new s.Raycaster(this.position.clone(),i[e].clone()).intersectObjects(this.model.colliders);
  18094. if (t.length)
  18095. return t[0].object.parent.parent
  18096. }
  18097. return null
  18098. }
  18099. ),
  18100. r.prototype.placeMarker = function() {
  18101. this.marker && (this.marker.position.copy(this.floorPosition),
  18102. this.marker.position.y += .05,
  18103. this.marker.lookAt(new s.Vector3(0,1,0).add(this.marker.position)))
  18104. }
  18105. ,
  18106. r.prototype.translate = function(e) {
  18107. this.position.add(e),
  18108. this.floorPosition.add(e)
  18109. }
  18110. ,
  18111. r.prototype.findClosestMidtpointPanoTo = function(e) {
  18112. return (new s.Vector3).addVectors(this.position, e.position).divideScalar(2),
  18113. this.model.panos.find([r.filters.notIn([this, e])], [r.sortFunctions.distanceToPoint(point)])
  18114. }
  18115. ,
  18116. r.prototype.attachToPanoRenderer = function(e) {
  18117. this.panoRenderer = e,
  18118. this.panoRenderer.on(g.TileRenderSuccess, this.onTileRendered.bind(this)),
  18119. this.panoRenderer.on(g.PanoRenderComplete, this.onPanoRendered.bind(this)),
  18120. this.panoRenderer.on(g.TileRenderFailure, this.onTileRenderFail.bind(this)),
  18121. this.panoRenderer.on(g.UploadAttemptedForAllTiles, this.onUploadAttemptedForAllTiles.bind(this))
  18122. }
  18123. ;
  18124. var w, T, x = {};
  18125. r.prototype.getWaitDeferred = function(e) {
  18126. var t = x[this.id];
  18127. t || (t = {},
  18128. x[this.id] = t);
  18129. var i = t[e];
  18130. return i || (i = {
  18131. deferred: $.Deferred(),
  18132. active: !1
  18133. },
  18134. t[e] = i),
  18135. i
  18136. }
  18137. ,
  18138. r.prototype.resetWaitDeferred = function(e) {
  18139. var t = this.getWaitDeferred(e);
  18140. t.active = !1,
  18141. t.deferred = $.Deferred()
  18142. }
  18143. ,
  18144. r.prototype.clearWaitDeferreds = function() {
  18145. var e = x[this.id];
  18146. for (var t in e || (e = {},
  18147. x[this.id] = e),
  18148. e)
  18149. if (e.hasOwnProperty(t)) {
  18150. var i = e[t];
  18151. i.active = !1,
  18152. i.deferred = $.Deferred()
  18153. }
  18154. }
  18155. ,
  18156. r.prototype.loadTiledPano = (new s.Vector3,
  18157. w = [],
  18158. T = [],
  18159. function(e, t, i, n, r, o) {
  18160. null != n || (n = !0),
  18161. null != r || (r = !0);
  18162. var a = this.getWaitDeferred(e)
  18163. , s = a.deferred
  18164. , l = null
  18165. , c = null;
  18166. if (i && ("number" == typeof i ? l = i : (l = i.hFov,
  18167. c = i.vFov)),
  18168. !this.isLoaded(e)) {
  18169. if (!a.active) {
  18170. if (a.active = !0,
  18171. i) {
  18172. var h = A.matchingTilesInDirection(this, e, t, l, c);
  18173. w[this.id + ":" + e] = {
  18174. tileCount: 0,
  18175. targetTileCount: h
  18176. },
  18177. I.info("Loading partial pano: " + this.id + " with " + h + " tiles")
  18178. }
  18179. T[this.id] || (T[this.id] = !0,
  18180. this.on(f.LoadComplete, function(e, t) {
  18181. var i = this.getWaitDeferred(e).deferred;
  18182. i && "pending" === i.state() && this.highestPartialTileRenderOpCompleted >= e && (i.resolve(e, t),
  18183. this.resetWaitDeferred(e))
  18184. }
  18185. .bind(this)),
  18186. this.on(f.LoadFailed, function(e) {
  18187. var t = this.getWaitDeferred(e).deferred;
  18188. t && "pending" === t.state() && this.highestPartialTileRenderOpCompleted >= e && (t.reject(e),
  18189. this.resetWaitDeferred(e))
  18190. }
  18191. .bind(this)),
  18192. this.on(f.TileLoaded, function(e, t, i) {
  18193. var n = this.getWaitDeferred(e).deferred;
  18194. if (n && "pending" === n.state()) {
  18195. n.notify(e, t, i);
  18196. var r = w[this.id + ":" + e];
  18197. r && (r.tileCount++,
  18198. r.tileCount === r.targetTileCount && (this.onPanoRendered(this.id, e, i, !0),
  18199. n.resolve(e, i),
  18200. this.resetWaitDeferred(e)))
  18201. }
  18202. }
  18203. .bind(this)))
  18204. }
  18205. this.tileDownloader.clearForceQueue(),
  18206. this.tileDownloader.forceQueueTilesForPano(this, e, t, l, c, o),
  18207. this.tiledPanoRenderTarget = this.panoRenderer.activateTiledPano(this, this.qualityManager.getMaxNavPanoSize(), n),
  18208. this.panoRenderer.renderPanoTiles(this.id, t, r)
  18209. }
  18210. return s.promise()
  18211. }
  18212. ),
  18213. r.prototype.onUploadAttemptedForAllTiles = function(e, t, i) {
  18214. e === this.id && t === this.qualityManager.getPanoSize(m.BASE) && this.shouldRedrawOnBaseLoaded && (this.shouldRedrawOnBaseLoaded = !1,
  18215. this.panoRenderer.resetRenderStatus(this.id, !0, !1),
  18216. this.panoRenderer.renderPanoTiles(this.id, null, !0, !0))
  18217. }
  18218. ,
  18219. r.prototype.onTileRendered = function(e, t, i, n) {
  18220. e === this.id && this.emit(f.TileLoaded, t, i, n)
  18221. }
  18222. ,
  18223. r.prototype.onPanoRendered = function(e, t, i, n) {
  18224. e === this.id && (this.minimumTiledPanoLoaded = !0,
  18225. this.updateSkyboxForZoomLevel(),
  18226. t > this.highestPartialTileRenderOpCompleted && (this.highestPartialTileRenderOpCompleted = t),
  18227. !n && t > this.highestFullTileRenderOpCompleted && (this.highestFullTileRenderOpCompleted = t),
  18228. this.emit("load", t),
  18229. this.model.emit("load", this),
  18230. this.emit(f.LoadComplete, t, i))
  18231. }
  18232. ,
  18233. r.prototype.setZoomed = function(e) {
  18234. this.zoomed = e,
  18235. this.updateSkyboxForZoomLevel()
  18236. }
  18237. ,
  18238. r.prototype.ensureSkyboxReadyForRender = function() {
  18239. this.tiled || (this.solidSkybox.loaded || (this.solidSkybox.needsUpdate = !0),
  18240. this.solidSkybox.loaded = !0)
  18241. }
  18242. ,
  18243. r.prototype.updateSkyboxForZoomLevel = function() {
  18244. this.minimumTiledPanoLoaded && this.model.updateProjectedPanos()
  18245. }
  18246. ,
  18247. r.prototype.getSkyboxTexture = function() {
  18248. return this.tiled ? this.minimumTiledPanoLoaded ? this.zoomed ? this.panoRenderer.zoomRenderTarget.texture : this.tiledPanoRenderTarget.texture : null : this.solidSkybox
  18249. }
  18250. ,
  18251. r.prototype.onTileRenderFail = function(e, t, i) {
  18252. e === this.id && this.emit(f.LoadFailed, t)
  18253. }
  18254. ,
  18255. r.prototype.isLoaded = function(e) {
  18256. if (this.tiled) {
  18257. if (e && "string" == typeof e)
  18258. throw new y("Wrong panoSize given to Panorama.isLoaded(); a tiled pano uses PanoSizeClass");
  18259. return !!this.minimumTiledPanoLoaded && (!e || this.highestPartialTileRenderOpCompleted >= e)
  18260. }
  18261. if (e && "number" == typeof e)
  18262. throw new y("Wrong panoSize given to Panorama.isLoaded(); a non-tiled pano uses high/low.");
  18263. return !!this.solidSkybox.high || e in this.solidSkybox
  18264. }
  18265. ,
  18266. r.prototype.loadCube = function(a) {
  18267. if (this.isLoaded(a))
  18268. return I.info("Skipping load of pano, already loaded"),
  18269. $.when();
  18270. this.emit("loading", a),
  18271. this.model.emit("loading", this);
  18272. var n = p.getCubemapUrls(this.model.urls, this.id, a)
  18273. , e = n.filter(function(e) {
  18274. return !e
  18275. });
  18276. "low" === a && 0 < e.length && (I.info("Pano", this.id, "not available in low res, loading high res right away"),
  18277. a = "high",
  18278. n = p.getCubemapUrls(this.model.urls, this.id, a));
  18279. var t = 0
  18280. , i = [0, 1, 2, 3, 4, 5].map(function(e, t, i) {
  18281. return u.getImage(n[t])
  18282. }
  18283. .bind(this));
  18284. return $.when(i[0], i[1], i[2], i[3], i[4], i[5]).then(function(e, t, i, n, r, o) {
  18285. return this.solidSkybox[a] = [e, t, i, n, r, o],
  18286. "high" !== a && this.solidSkybox.high || (this.solidSkybox.image = this.solidSkybox[a],
  18287. this.solidSkybox.low = null),
  18288. this.solidSkybox.needsUpdate = !0,
  18289. this.emit("load", a),
  18290. this.model.emit("load", this),
  18291. this
  18292. }
  18293. .bind(this), function() {
  18294. I.error("Downloading cubemap for pano", this.id, "failed"),
  18295. this.failedLoadingAt = Date.now()
  18296. }
  18297. .bind(this), function() {
  18298. return $.when(++t, 6)
  18299. })
  18300. }
  18301. ,
  18302. r.raycastsSkipped = 0,
  18303. r.raycastsDone = 0,
  18304. r.prototype.findNeighourPanos = function() {
  18305. return this.model.panos.setNeighbour(this.id, this.id, !1),
  18306. this.model.panos.forEach(function(e) {
  18307. if (e !== this && (!this.model.panos.neighbourMap[this.id] || void 0 === this.model.panos.neighbourMap[this.id][e.id])) {
  18308. var t = this.position.distanceTo(e.position);
  18309. if (t > a.panoramaNeighbourMaxDistance)
  18310. return this.model.panos.setNeighbour(this, e, !1),
  18311. void r.raycastsSkipped++;
  18312. var i = e.position.clone().sub(this.position).normalize()
  18313. , n = new s.Raycaster(this.position,i.clone(),0,t).intersectObjects(this.model.colliders);
  18314. r.raycastsDone++,
  18315. this.model.panos.setNeighbour(this, e, 0 === n.length),
  18316. a.showNeighbourRaycasts && (n.length ? this.floor.model.add(new s.ArrowHelper(i,this.position,n[0].distance,16711680)) : this.floor.model.add(new s.ArrowHelper(i,this.position,t,16777215,0,0)))
  18317. }
  18318. }
  18319. .bind(this)),
  18320. this.model.panos.neighbourMap[this.id]
  18321. }
  18322. ,
  18323. r.prototype.worldPosition = function() {
  18324. return this.position
  18325. }
  18326. ,
  18327. r.prototype.addTextSprite = function(e, t) {
  18328. this.removeTextSprite();
  18329. var i = document.createElement("canvas")
  18330. , n = i.getContext("2d");
  18331. i.width = 256,
  18332. i.height = 256;
  18333. n.font = "bold 60px Arial",
  18334. n.fillStyle = "white";
  18335. var r = n.measureText(e).width;
  18336. n.fillText(e, (i.width - r) / 2, (i.height + 60) / 2);
  18337. var o = new s.Texture(i);
  18338. o.needsUpdate = !0;
  18339. var a = new s.SpriteMaterial({
  18340. map: o,
  18341. color: t || 16428055
  18342. });
  18343. this.text3d = new s.Sprite(a),
  18344. this.text3d.position.copy(this.skyboxMesh.position),
  18345. this.floor.add(this.text3d)
  18346. }
  18347. ,
  18348. r.prototype.removeTextSprite = function() {
  18349. this.text3d && (this.floor.remove(this.text3d),
  18350. this.text3d = null)
  18351. }
  18352. ,
  18353. r.prototype.isAligned = function() {
  18354. return this.alignmentType === c.ALIGNED
  18355. }
  18356. ,
  18357. r.filters = {
  18358. inDirection: function(t, i, n) {
  18359. return function(e) {
  18360. return e.position.clone().sub(t).normalize().dot(i) > n
  18361. }
  18362. },
  18363. inFloorDirection: function(t, i, n) {
  18364. return function(e) {
  18365. return e.floorPosition.clone().sub(t).normalize().dot(i) > n
  18366. }
  18367. },
  18368. inPanoDirection: function(n, r, o) {
  18369. return o = a.navigation.panoScores ? a.navigation.filterStrictness : o,
  18370. function(e) {
  18371. var t = e.floorPosition.clone().sub(n).normalize()
  18372. , i = e.position.clone().sub(n).normalize();
  18373. return t.dot(r) > o || i.dot(r) > o
  18374. }
  18375. },
  18376. atFloor: function(t) {
  18377. return function(e) {
  18378. return !t || e.floor === t
  18379. }
  18380. },
  18381. not: function(t) {
  18382. return function(e) {
  18383. return e !== t
  18384. }
  18385. },
  18386. notIn: function(t) {
  18387. return function(e) {
  18388. return -1 === t.indexOf(e)
  18389. }
  18390. },
  18391. isLoaded: function() {
  18392. return function(e) {
  18393. return e.isLoaded()
  18394. }
  18395. },
  18396. isNotLoaded: function() {
  18397. return function(e) {
  18398. return !e.isLoaded()
  18399. }
  18400. },
  18401. isCloseEnoughTo: function(t, i) {
  18402. return function(e) {
  18403. return t.distanceTo(e.floorPosition) < i
  18404. }
  18405. },
  18406. hasMinimumHeightDifferenceTo: function(t, i) {
  18407. return function(e) {
  18408. return Math.abs(e.position.y - t.y) > i
  18409. }
  18410. },
  18411. isNotBehindNormal: function(t, i) {
  18412. var n = new s.Vector3;
  18413. return i = i.clone(),
  18414. function(e) {
  18415. return 0 < n.copy(e.position).sub(t).normalize().dot(i)
  18416. }
  18417. },
  18418. isNeighbourPanoTo: function(t) {
  18419. return function(e) {
  18420. return !t || !t.neighbourPanos || !!t.neighbourPanos[e.id]
  18421. }
  18422. },
  18423. isNeighbourOfNeighbourTo: function(n) {
  18424. return function(i) {
  18425. return !!n.neighbourPanos[i.id] || n.neighbourUUIDs.some(function(e) {
  18426. var t = n.model.panos.get(e);
  18427. return !!t && t.neighbourPanos[i.id]
  18428. })
  18429. }
  18430. },
  18431. isNotRecentlyFailed: function(t) {
  18432. return function(e) {
  18433. return Date.now() - e.failedLoadingAt > t
  18434. }
  18435. },
  18436. isOnVisibleFloor: function() {
  18437. return function(e) {
  18438. return !e.floor.hidden
  18439. }
  18440. },
  18441. isPanoAligned: function() {
  18442. return function(e) {
  18443. return e.isAligned()
  18444. }
  18445. }
  18446. },
  18447. r.sortFunctions = {
  18448. distanceToPoint: function(i) {
  18449. return function(e, t) {
  18450. return e.position.distanceTo(i) - t.position.distanceTo(i)
  18451. }
  18452. },
  18453. floorDistanceToPoint: function(i) {
  18454. return function(e, t) {
  18455. return e.floorPosition.distanceTo(i) - t.floorPosition.distanceTo(i)
  18456. }
  18457. },
  18458. choose: function(i) {
  18459. return function(e, t) {
  18460. return i.id === e.id ? -1 : i.id === t.id ? 1 : 0
  18461. }
  18462. }
  18463. },
  18464. r.scoreFunctions = {
  18465. distance: function(t, i) {
  18466. return i = i || a.navigation.distanceFactor,
  18467. function(e) {
  18468. return t ? t.position.distanceTo(e.position) * i : 0
  18469. }
  18470. },
  18471. distanceSquared: function(t, i) {
  18472. return i = i || a.navigation.distanceFactor,
  18473. function(e) {
  18474. return t ? t.position.distanceToSquared(e.position) * i : 0
  18475. }
  18476. },
  18477. direction: function(t, i) {
  18478. return function(e) {
  18479. return e.position.clone().sub(t).normalize().dot(i) * a.navigation.directionFactor
  18480. }
  18481. },
  18482. angle: function(t, i) {
  18483. return function(e) {
  18484. return e.position.clone().sub(t).normalize().angleTo(i) * a.navigation.angleFactor
  18485. }
  18486. },
  18487. inFieldOfView: function(t, i) {
  18488. return function(e) {
  18489. return .75 < e.position.clone().sub(t).normalize().dot(i) ? 10 : -1
  18490. }
  18491. },
  18492. optionality: function(t) {
  18493. return function(e) {
  18494. return e.neighbourUUIDs.filter(function(e) {
  18495. return !(e in t.neighbourUUIDs) && e !== t.id
  18496. }).length * a.navigation.optionalityFactor
  18497. }
  18498. },
  18499. penalizeHeightDifferenceUnder: function(t, i) {
  18500. return function(e) {
  18501. return t.y - e.position.y < i ? -20 : 0
  18502. }
  18503. }
  18504. },
  18505. M.exports = r
  18506. }
  18507. ).call(this, "/js/objects/Panorama.js")
  18508. }
  18509. , {
  18510. "../enum/AlignmentType": 17,
  18511. "../enum/GLCubeFaces": 25,
  18512. "../enum/PanoRendererEvents": 35,
  18513. "../enum/PanoSizeClass": 36,
  18514. "../enum/PanoramaEvents": 37,
  18515. "../enum/RenderLayers": 41,
  18516. "../enum/RenderOrder": 42,
  18517. "../enum/TileDownloaderEvents": 45,
  18518. "../enum/Viewmode": 51,
  18519. "../exception/BasicException": 55,
  18520. "../scene/SceneRenderer": 158,
  18521. "../settings": 166,
  18522. "../tile/TileUtils": 174,
  18523. "../util/ajax": 181,
  18524. "../util/common": 185,
  18525. "../util/lerp": 188,
  18526. "../util/logger": 189,
  18527. "../util/panorama": 191,
  18528. "../util/texture": 194,
  18529. "../util/transitions": 195,
  18530. events: 202,
  18531. three: 217
  18532. }],
  18533. 149: [function(e, t, i) {
  18534. "use strict";
  18535. function n(e) {
  18536. var t = r.UniformsUtils.clone(c.waypoint.uniforms);
  18537. t.map.value = d,
  18538. t.opacity.value = 0,
  18539. t.color.value.set(o.reticuleColor),
  18540. t.showMouseMarker = !window.MP_PREFETCHED_MODELDATA.hideMouseMarker;
  18541. r.Mesh.call(this, new r.PlaneBufferGeometry(.4,.4,1,1), new r.RawShaderMaterial({
  18542. side: r.DoubleSide,
  18543. depthWrite: !1,
  18544. depthTest: !1,
  18545. transparent: !0,
  18546. vertexShader: c.waypoint.vertexShader,
  18547. fragmentShader: c.waypoint.fragmentShader,
  18548. uniforms: t,
  18549. name: "waypoint",
  18550. opacity: 0,
  18551. visible: t.showMouseMarker
  18552. })),
  18553. this.layers.set(h.RETICULE),
  18554. this.renderOrder = u.reticule,
  18555. this.player = e,
  18556. this.direction = new r.Vector3,
  18557. this.hidden = !0,
  18558. this.mouseLastMoveTime = Date.now()
  18559. }
  18560. var r = e("three")
  18561. , o = e("../settings")
  18562. , a = e("../util/transitions")
  18563. , s = e("../util/texture")
  18564. , l = e("../util/lerp")
  18565. , c = e("../shaders")
  18566. , h = e("../enum/RenderLayers")
  18567. , u = e("../enum/RenderOrder")
  18568. , d = s.load("images/reticule-256x256.png");
  18569. (n.prototype = Object.create(r.Mesh.prototype)).move = function(e, t, i) {
  18570. this.hidden = i,
  18571. this.mouseLastMoveTime = Date.now()
  18572. }
  18573. ,
  18574. n.prototype.hide = function() {
  18575. this.hidden || (this.hidden = !0,
  18576. a.start(l.property(this.material.uniforms.opacity, "value", 0), o.reticuleOpacityTransitionTime))
  18577. }
  18578. ,
  18579. n.prototype.show = function() {
  18580. this.hidden = !1,
  18581. this.material.opacity <= 0 && a.start(l.property(this.material.uniforms.opacity, "value", o[this.player.mode].reticuleOpacity), o.reticuleOpacityTransitionTime)
  18582. }
  18583. ,
  18584. n.prototype.update = function() {
  18585. Date.now() - this.mouseLastMoveTime > o.hideReticuleTimeout && !this.hidden && this.hide()
  18586. }
  18587. ,
  18588. n.prototype.updatePosition = function(e, t) {
  18589. if (!this.hidden) {
  18590. if (!t)
  18591. return this.hide();
  18592. var i = t.point
  18593. , n = e.distanceTo(i)
  18594. , r = 1 + .01 * n;
  18595. n < 1 && (r -= 1 - n),
  18596. this.show(),
  18597. this.scale.set(r, r, r),
  18598. this.direction = this.direction.multiplyScalar(.8),
  18599. this.direction.add(t.face.normal.clone().multiplyScalar(.2)),
  18600. this.position.copy(i).add(t.face.normal.clone().multiplyScalar(.01)),
  18601. this.lookAt(this.position.clone().add(this.direction))
  18602. }
  18603. }
  18604. ,
  18605. n.prototype.writeAstag = function() {
  18606. var e = Math.floor(4294967296 * (1 + Math.random())).toString(16) + Math.floor(16 * (1 + Math.random())).toString(16)
  18607. , t = new Date;
  18608. this.tagCount = void 0 === this.tagCount ? 1 : this.tagCount + 1;
  18609. var i = {
  18610. enabled: !0,
  18611. version: "0",
  18612. created: t.toISOString(),
  18613. created_by: "APITest",
  18614. position: this.position.clone(),
  18615. stem: {
  18616. enabled: o.tags.pole.enabled,
  18617. direction: this.direction.multiplyScalar(o.tags.pole.height)
  18618. },
  18619. label: "tag " + this.tagCount,
  18620. description: "Description " + e,
  18621. floor: function(e) {
  18622. if (e.currentFloor) {
  18623. var t = e.floors.indexOf(e.currentFloor);
  18624. return -1 < t ? t : void 0
  18625. }
  18626. }(this.player.model),
  18627. type: "info",
  18628. metadata: {
  18629. preferred_camera: {
  18630. mode: this.player.mode
  18631. }
  18632. }
  18633. };
  18634. console.log("--------------------------"),
  18635. console.log(JSON.stringify(i));
  18636. var n = this.player.model.addtag(e, i).build();
  18637. n && (n.disc && this.player.tagDiscs.push(n.disc),
  18638. n.visible || n.show(o.tags.startup.fadeInDuration))
  18639. }
  18640. ,
  18641. t.exports = n
  18642. }
  18643. , {
  18644. "../enum/RenderLayers": 41,
  18645. "../enum/RenderOrder": 42,
  18646. "../settings": 166,
  18647. "../shaders": 167,
  18648. "../util/lerp": 188,
  18649. "../util/texture": 194,
  18650. "../util/transitions": 195,
  18651. three: 217
  18652. }],
  18653. 150: [function(e, t, i) {
  18654. "use strict";
  18655. function n(e, t) {
  18656. this.chunks = [],
  18657. this.floorId = e,
  18658. this.roomId = t,
  18659. this.position = new l.Vector3
  18660. }
  18661. var l = e("three");
  18662. n.prototype.addChunk = function(e) {
  18663. this.chunks.push(e)
  18664. }
  18665. ,
  18666. n.prototype.calcBoundaries = function() {
  18667. for (var e = new l.Vector3, t = new l.Vector3(0,0,0), i = new l.Vector3(0,0,0), n = new l.Vector3(0,0,0), r = 0, o = 0; o < this.chunks.length; o++) {
  18668. var a = this.chunks[o].geometry.attributes.position;
  18669. if (a)
  18670. for (var s = 0; s < a.array.length; s += 3)
  18671. e.set(a.array[s], a.array[s + 1], a.array[s + 2]),
  18672. t.add(e),
  18673. 0 === s ? (i.copy(e),
  18674. n.copy(e)) : (i.max(e),
  18675. n.min(e)),
  18676. r++
  18677. }
  18678. 0 < r ? (t.multiplyScalar(1 / r),
  18679. this.average = t) : this.average = null,
  18680. this.boundsMax = i,
  18681. this.boundsMin = n,
  18682. this.center = new l.Vector3,
  18683. this.center.copy(i).sub(n).multiplyScalar(.5).add(n)
  18684. }
  18685. ,
  18686. t.exports = n
  18687. }
  18688. , {
  18689. three: 217
  18690. }],
  18691. 151: [function(o, v, e) {
  18692. (function(e) {
  18693. "use strict";
  18694. function t(e, t, i) {
  18695. this.obj3d = null,
  18696. this.nodes = [],
  18697. this.colorHull = [],
  18698. this.shortPaths = {},
  18699. this.floorHull = null,
  18700. this.cameraHull = null,
  18701. this.floorPathDistance = 0,
  18702. this.floorCurvePoints = null,
  18703. this.floorCurveColors = null,
  18704. this.camCurvePoints = null,
  18705. this.warpDestHeroLoc = null,
  18706. this.warpDestPano = null,
  18707. this.warpPathPoints = null,
  18708. this.warpPathLengths = [0],
  18709. this.warpLength = 0,
  18710. this.closeWarpDistance = 4,
  18711. this.UP = U.UP.clone(),
  18712. this.longestStep = 0,
  18713. this.upcomingTransType = null,
  18714. this.burnsDir = 1,
  18715. this.prevNextDist = 0,
  18716. this.nextI = 0,
  18717. this.activeTransType = null,
  18718. this.lastTransType = null,
  18719. this.bunnyObj = null,
  18720. this.director = e,
  18721. this.player = t,
  18722. this.playerControls = i,
  18723. this.modelManager = t.modelManager,
  18724. this.updateModel(),
  18725. this.updateDefaultsFromModelData(),
  18726. this.bindEvents(),
  18727. this.warping = !1,
  18728. this.waitingToWarp = !1,
  18729. this.warpInterrupted = !1,
  18730. this.warpInterruptionBlackoutStyle = null,
  18731. this.warpInterruptionTravelTime = null
  18732. }
  18733. var c, h, u, d, p, f, a, s, P = o("three"), i = o("../util/logger"), O = o("../enum/Viewmode"), A = o("../enum/RenderOrder"), L = o("../enum/WarpStyle"), D = o("../settings"), N = o("../util/math"), F = o("../util/lerp"), B = o("../util/easing"), V = o("../util/transitions"), l = o("../objects/Snapshot"), k = o("../effects"), C = o("../shaders"), n = (o("../gui/gui"),
  18734. o("../util/texture")), U = o("../enum/Vectors"), H = (o("../model/ModelManager"),
  18735. new i(e)), g = o("../enum/PlayerEvents"), z = o("../enum/BlackoutStyle"), r = o("../enum/ModelManagerEvents"), m = o("../constants"), I = {
  18736. path: n.loadBase64("iVBORw0KGgoAAAANSUhEUgAAAIAAAAAgCAYAAADaInAlAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKxGlDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjarZZnUFP5Gsbfc046CS0hAlJCb4IU6dJrAAXpYCMkIQmEEFJQsKEiruBaEBHBsqIrIAquBZC1IBZsi2DvC7IoqOtiwYbK/cAS7r1z74c7c9+ZM/ObZ97/c57/OV8eAOogRyoVo5oA2RKFLDYskJWcksoi/g54oIEmUMCUw5VLA2JiouA/DwLw4Q4gAAA37TlSqRj+t9Hi8eVcACQGANJ5cm42AHIMAOniSmUKAKwIAMwWKaQKAKwOABiy5JRUAOwkADAE49wNAIz0cf4DABiy+NggAOwTAInK4cgEAFQcALDyuAIFANUcABwlPJEEgBoPAL5cIYcHQC0HgGnZ2Tk8AGo7AFin/5OP4F8801WeHI5AxeN3AQAAUrBILhVz8uH/Pdli5cQ7TAGAKpSFxwKAJQBSl5UTqWJJ+uzoCRbxACZYqAxPmGCuPCh1gnmc4MgJVmYlBEwwRzZ5VqRgx0+wLCdW5c+Xh8Sp/PnsKFUG8WwVZ4hC2RNcIIxPmuA8UeLsCZZnxUVO7gSpdJkyVpU5QxaqumO2fDIblzOZQSGMD5/MlqzKwOMHh6h0SYJqX6oIVHlKxTGqfb44TKXL8+JUZxWyeJWeyYmImfSJUX0fiAchKEECPOCDDNIhB8SgABYEgwjkIAUxcCAfQMFfrAAACMqR5stEAqGCFSCVivkstoTrMI3l7OjkCpCcksoa/+XvmIAAAMK8MqnltgN4lgAggkmNYwZw4hkA/cOkZvYWgLoJ4FQ3VynLG9dwAAB4oIAGMEAPjMAMrMEenMENvMEfQiACoiEeUmABcEEI2SCDRbAUVkIxlMIm2ApVsBv2Qh0cgiPQAifhLFyEq9ANt+Eh9MIAvIRh+ACjCIIQERpCR/QQY8QCsUOcEQ/EFwlBopBYJAVJQwSIBFEiS5HVSClShlQhe5B65BfkBHIWuYz0IPeRPmQIeYt8QTGUijJQQ9QSnY56oAFoJBqPzkcFaC5agBahG9BKtAY9iDajZ9Gr6G20F32JjmCAqWFMzASzxzywICwaS8UyMBm2HCvBKrAarBFrwzqxm1gv9gr7jCPg6DgWzh7njQvHJeC4uFzcctx6XBWuDteMO4+7ievDDeO+42l4A7wd3gvPxifjBfhF+GJ8BX4//jj+Av42fgD/gUAgMAlWBHdCOCGFkElYQlhP2EloIrQTegj9hBEikahHtCP6EKOJHKKCWEzcTjxIPEO8QRwgfiKpkYxJzqRQUipJQlpFqiAdIJ0m3SA9J42SNckWZC9yNJlHzidvJO8jt5GvkwfIoxQtihXFhxJPyaSspFRSGikXKI8o79TU1EzVPNXmqInUCtUq1Q6rXVLrU/tM1abaUoOo86hK6gZqLbWdep/6jkajWdL8aak0BW0DrZ52jvaE9kmdru6gzlbnqa9Qr1ZvVr+h/lqDrGGhEaCxQKNAo0LjqMZ1jVeaZE1LzSBNjuZyzWrNE5p3NUe06FpOWtFa2VrrtQ5oXdYa1CZqW2qHaPO0i7T3ap/T7qdjdDN6EJ1LX03fR79AH2AQGFYMNiOTUco4xOhiDOto68zQSdRZrFOtc0qnl4kxLZlsppi5kXmEeYf5ZYrhlIAp/CnrpjROuTHlo+5UXX9dvm6JbpPubd0veiy9EL0svc16LXqP9XH6tvpz9Bfp79K/oP9qKmOq91Tu1JKpR6Y+MEANbA1iDZYY7DW4ZjBiaGQYZig13G54zvCVEdPI3yjTqNzotNGQMd3Y11hkXG58xvgFS4cVwBKzKlnnWcMmBibhJkqTPSZdJqOmVqYJpqtMm0wfm1HMPMwyzMrNOsyGzY3NZ5kvNW8wf2BBtvCwEFpss+i0+GhpZZlkudayxXLQSteKbVVg1WD1yJpm7Weda11jfcuGYONhk2Wz06bbFrV1tRXaVttet0Pt3OxEdjvteqbhp3lOk0yrmXbXnmofYJ9n32Df58B0iHJY5dDi8Hq6+fTU6Zund07/7ujqKHbc5/jQSdspwmmVU5vTW2dbZ65ztfMtF5pLqMsKl1aXNzPsZvBn7Jpxz5XuOst1rWuH6zc3dzeZW6PbkLu5e5r7Dve7HgyPGI/1Hpc88Z6Bnis8T3p+9nLzUngd8frL2947y/uA9+BMq5n8mftm9vuY+nB89vj0+rJ803x/8u31M/Hj+NX4PfU38+f57/d/HmATkBlwMOB1oGOgLPB44Mcgr6BlQe3BWHBYcElwV4h2SEJIVciTUNNQQWhD6HCYa9iSsPZwfHhk+Obwu2xDNpddzx6OcI9YFnE+khoZF1kV+TTKNkoW1TYLnRUxa8usR7MtZktmt0RDNDt6S/TjGKuY3Jhf5xDmxMypnvMs1il2aWxnHD1uYdyBuA/xgfEb4x8mWCcoEzoSNRLnJdYnfkwKTipL6k2enrws+WqKfooopTWVmJqYuj91ZG7I3K1zB+a5ziued2e+1fzF8y8v0F8gXnBqocZCzsKjafi0pLQDaV850Zwazkg6O31H+jA3iLuN+5LnzyvnDfF9+GX85xk+GWUZgwIfwRbBkNBPWCF8JQoSVYneZIZn7s78mBWdVZs1Jk4SN2WTstOyT0i0JVmS8zlGOYtzeqR20mJpb65X7tbcYVmkbL8ckc+XtyoYCqnimtJauUbZl+ebV533aVHioqOLtRZLFl/Lt81fl/+8ILTg5yW4JdwlHUtNlq5c2rcsYNme5cjy9OUdK8xWFK0YKAwrrFtJWZm18rdVjqvKVr1fnbS6rciwqLCof03YmoZi9WJZ8d213mt3/4D7QfRD1zqXddvXfS/hlVwpdSytKP26nrv+yo9OP1b+OLYhY0PXRreNuzYRNkk23dnst7muTKusoKx/y6wtzeWs8pLy91sXbr1cMaNi9zbKNuW23sqoytbt5ts3bf9aJay6XR1Y3bTDYMe6HR938nbe2OW/q3G34e7S3V9+Ev10b0/YnuYay5qKvYS9eXuf7Uvc1/mzx8/1+/X3l+7/Viup7a2LrTtf715ff8DgwMYGtEHZMHRw3sHuQ8GHWhvtG/c0MZtKD8Nh5eEXv6T9cudI5JGOox5HG49ZHNtxnH68pBlpzm8ebhG29LamtPaciDjR0ebddvxXh19rT5qcrD6lc2rjacrpotNjZwrOjLRL21+dFZzt71jY8fBc8rlb5+ec77oQeeHSxdCL5zoDOs9c8rl08rLX5RNXPK60XHW72nzN9drx31x/O97l1tV83f16a7dnd1vPzJ7TN/xunL0ZfPPiLfatq7dn3+65k3Dn3t15d3vv8e4N3hfff/Mg78How8JH+EcljzUfVzwxeFLzu83vTb1uvaf6gvuuPY17+rCf2//yD/kfXweKntGeVTw3fl4/6Dx4cih0qPvF3BcDL6UvR18V/6n1547X1q+P/eX/17Xh5OGBN7I3Y2/Xv9N7V/t+xvuOkZiRJx+yP4x+LPmk96nus8fnzi9JX56PLvpK/Fr5zeZb2/fI74/GssfGpBwZBwAAMABAMzIA3tYC0FIA6N0AFPXxzvx310cmW/9/4/FeDQAAbgC1/gAJhQBR7QC72gEsCse7dQwAxPsD6uKiev4eeYaL87gXVQaA/zQ29s4QgNgG8E02Nja6c2zs2z4A7D5Ae+54VwcAIGgClFnpWusMd8e8L/z3zvwPWFMLsyHkoksAAD+UaVRYdFhNTDpjb20uYWRvYmUueG1wAAAAAAA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/Pgo8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA1LjYtYzA2NyA3OS4xNTc3NDcsIDIwMTUvMDMvMzAtMjM6NDA6NDIgICAgICAgICI+CiAgIDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+CiAgICAgIDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiCiAgICAgICAgICAgIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyIKICAgICAgICAgICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICAgICAgICAgICB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIKICAgICAgICAgICAgeG1sbnM6c3RFdnQ9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZUV2ZW50IyIKICAgICAgICAgICAgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiCiAgICAgICAgICAgIHhtbG5zOnBob3Rvc2hvcD0iaHR0cDovL25zLmFkb2JlLmNvbS9waG90b3Nob3AvMS4wLyIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iCiAgICAgICAgICAgIHhtbG5zOmV4aWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20vZXhpZi8xLjAvIj4KICAgICAgICAgPHhtcDpDcmVhdG9yVG9vbD5BZG9iZSBQaG90b3Nob3AgQ0MgMjAxNSAoTWFjaW50b3NoKTwveG1wOkNyZWF0b3JUb29sPgogICAgICAgICA8eG1wOkNyZWF0ZURhdGU+MjAxNS0wNy0yMVQxODoyMDo1My0wNzowMDwveG1wOkNyZWF0ZURhdGU+CiAgICAgICAgIDx4bXA6TWV0YWRhdGFEYXRlPjIwMTUtMDctMjFUMTg6MjE6MzgtMDc6MDA8L3htcDpNZXRhZGF0YURhdGU+CiAgICAgICAgIDx4bXA6TW9kaWZ5RGF0ZT4yMDE1LTA3LTIxVDE4OjIxOjM4LTA3OjAwPC94bXA6TW9kaWZ5RGF0ZT4KICAgICAgICAgPGRjOmZvcm1hdD5pbWFnZS9wbmc8L2RjOmZvcm1hdD4KICAgICAgICAgPHhtcE1NOkluc3RhbmNlSUQ+eG1wLmlpZDoyYWI5MzcwNS0xYjZjLTQ1ZGMtYTQyNy1jYWQzOGNiZTUxYjM8L3htcE1NOkluc3RhbmNlSUQ+CiAgICAgICAgIDx4bXBNTTpEb2N1bWVudElEPmFkb2JlOmRvY2lkOnBob3Rvc2hvcDpjYjc1NjFhOC03MDlhLTExNzgtOTQ1Zi1kNDlkZmJlYjBjMWE8L3htcE1NOkRvY3VtZW50SUQ+CiAgICAgICAgIDx4bXBNTTpPcmlnaW5hbERvY3VtZW50SUQ+eG1wLmRpZDpjZjg0YWIzMi1lNTA2LTRkYzUtOGUxZC01MjgxMjhhN2NlOWM8L3htcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD4KICAgICAgICAgPHhtcE1NOkhpc3Rvcnk+CiAgICAgICAgICAgIDxyZGY6U2VxPgogICAgICAgICAgICAgICA8cmRmOmxpIHJkZjpwYXJzZVR5cGU9IlJlc291cmNlIj4KICAgICAgICAgICAgICAgICAgPHN0RXZ0OmFjdGlvbj5jcmVhdGVkPC9zdEV2dDphY3Rpb24+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDppbnN0YW5jZUlEPnhtcC5paWQ6Y2Y4NGFiMzItZTUwNi00ZGM1LThlMWQtNTI4MTI4YTdjZTljPC9zdEV2dDppbnN0YW5jZUlEPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6d2hlbj4yMDE1LTA3LTIxVDE4OjIwOjUzLTA3OjAwPC9zdEV2dDp3aGVuPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6c29mdHdhcmVBZ2VudD5BZG9iZSBQaG90b3Nob3AgQ0MgMjAxNSAoTWFjaW50b3NoKTwvc3RFdnQ6c29mdHdhcmVBZ2VudD4KICAgICAgICAgICAgICAgPC9yZGY6bGk+CiAgICAgICAgICAgICAgIDxyZGY6bGkgcmRmOnBhcnNlVHlwZT0iUmVzb3VyY2UiPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6YWN0aW9uPnNhdmVkPC9zdEV2dDphY3Rpb24+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDppbnN0YW5jZUlEPnhtcC5paWQ6MWIzNzcxZGMtZGU3Ni00YTQ4LTkzNjEtMGQ4NzdkOWY0ODkwPC9zdEV2dDppbnN0YW5jZUlEPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6d2hlbj4yMDE1LTA3LTIxVDE4OjIxOjM4LTA3OjAwPC9zdEV2dDp3aGVuPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6c29mdHdhcmVBZ2VudD5BZG9iZSBQaG90b3Nob3AgQ0MgMjAxNSAoTWFjaW50b3NoKTwvc3RFdnQ6c29mdHdhcmVBZ2VudD4KICAgICAgICAgICAgICAgICAgPHN0RXZ0OmNoYW5nZWQ+Lzwvc3RFdnQ6Y2hhbmdlZD4KICAgICAgICAgICAgICAgPC9yZGY6bGk+CiAgICAgICAgICAgICAgIDxyZGY6bGkgcmRmOnBhcnNlVHlwZT0iUmVzb3VyY2UiPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6YWN0aW9uPmNvbnZlcnRlZDwvc3RFdnQ6YWN0aW9uPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6cGFyYW1ldGVycz5mcm9tIGFwcGxpY2F0aW9uL3ZuZC5hZG9iZS5waG90b3Nob3AgdG8gaW1hZ2UvcG5nPC9zdEV2dDpwYXJhbWV0ZXJzPgogICAgICAgICAgICAgICA8L3JkZjpsaT4KICAgICAgICAgICAgICAgPHJkZjpsaSByZGY6cGFyc2VUeXBlPSJSZXNvdXJjZSI+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDphY3Rpb24+ZGVyaXZlZDwvc3RFdnQ6YWN0aW9uPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6cGFyYW1ldGVycz5jb252ZXJ0ZWQgZnJvbSBhcHBsaWNhdGlvbi92bmQuYWRvYmUucGhvdG9zaG9wIHRvIGltYWdlL3BuZzwvc3RFdnQ6cGFyYW1ldGVycz4KICAgICAgICAgICAgICAgPC9yZGY6bGk+CiAgICAgICAgICAgICAgIDxyZGY6bGkgcmRmOnBhcnNlVHlwZT0iUmVzb3VyY2UiPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6YWN0aW9uPnNhdmVkPC9zdEV2dDphY3Rpb24+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDppbnN0YW5jZUlEPnhtcC5paWQ6MmFiOTM3MDUtMWI2Yy00NWRjLWE0MjctY2FkMzhjYmU1MWIzPC9zdEV2dDppbnN0YW5jZUlEPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6d2hlbj4yMDE1LTA3LTIxVDE4OjIxOjM4LTA3OjAwPC9zdEV2dDp3aGVuPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6c29mdHdhcmVBZ2VudD5BZG9iZSBQaG90b3Nob3AgQ0MgMjAxNSAoTWFjaW50b3NoKTwvc3RFdnQ6c29mdHdhcmVBZ2VudD4KICAgICAgICAgICAgICAgICAgPHN0RXZ0OmNoYW5nZWQ+Lzwvc3RFdnQ6Y2hhbmdlZD4KICAgICAgICAgICAgICAgPC9yZGY6bGk+CiAgICAgICAgICAgIDwvcmRmOlNlcT4KICAgICAgICAgPC94bXBNTTpIaXN0b3J5PgogICAgICAgICA8eG1wTU06RGVyaXZlZEZyb20gcmRmOnBhcnNlVHlwZT0iUmVzb3VyY2UiPgogICAgICAgICAgICA8c3RSZWY6aW5zdGFuY2VJRD54bXAuaWlkOjFiMzc3MWRjLWRlNzYtNGE0OC05MzYxLTBkODc3ZDlmNDg5MDwvc3RSZWY6aW5zdGFuY2VJRD4KICAgICAgICAgICAgPHN0UmVmOmRvY3VtZW50SUQ+eG1wLmRpZDpjZjg0YWIzMi1lNTA2LTRkYzUtOGUxZC01MjgxMjhhN2NlOWM8L3N0UmVmOmRvY3VtZW50SUQ+CiAgICAgICAgICAgIDxzdFJlZjpvcmlnaW5hbERvY3VtZW50SUQ+eG1wLmRpZDpjZjg0YWIzMi1lNTA2LTRkYzUtOGUxZC01MjgxMjhhN2NlOWM8L3N0UmVmOm9yaWdpbmFsRG9jdW1lbnRJRD4KICAgICAgICAgPC94bXBNTTpEZXJpdmVkRnJvbT4KICAgICAgICAgPHBob3Rvc2hvcDpDb2xvck1vZGU+MzwvcGhvdG9zaG9wOkNvbG9yTW9kZT4KICAgICAgICAgPHBob3Rvc2hvcDpJQ0NQcm9maWxlPkRpc3BsYXk8L3Bob3Rvc2hvcDpJQ0NQcm9maWxlPgogICAgICAgICA8dGlmZjpPcmllbnRhdGlvbj4xPC90aWZmOk9yaWVudGF0aW9uPgogICAgICAgICA8dGlmZjpYUmVzb2x1dGlvbj43MjAwMDAvMTAwMDA8L3RpZmY6WFJlc29sdXRpb24+CiAgICAgICAgIDx0aWZmOllSZXNvbHV0aW9uPjcyMDAwMC8xMDAwMDwvdGlmZjpZUmVzb2x1dGlvbj4KICAgICAgICAgPHRpZmY6UmVzb2x1dGlvblVuaXQ+MjwvdGlmZjpSZXNvbHV0aW9uVW5pdD4KICAgICAgICAgPGV4aWY6Q29sb3JTcGFjZT42NTUzNTwvZXhpZjpDb2xvclNwYWNlPgogICAgICAgICA8ZXhpZjpQaXhlbFhEaW1lbnNpb24+MTI4PC9leGlmOlBpeGVsWERpbWVuc2lvbj4KICAgICAgICAgPGV4aWY6UGl4ZWxZRGltZW5zaW9uPjMyPC9leGlmOlBpeGVsWURpbWVuc2lvbj4KICAgICAgPC9yZGY6RGVzY3JpcHRpb24+CiAgIDwvcmRmOlJERj4KPC94OnhtcG1ldGE+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgCjw/eHBhY2tldCBlbmQ9InciPz6SKsKfAAAAIGNIUk0AAG11AABzoAAA/N0AAINkAABw6AAA7GgAADA+AAAQkOTsmeoAAAOCSURBVHja7FtRi9ZADJxETzkQRf3/P9FTREQ9bXwpUvYyk+x3PiawtPS6/UozmUyyexYROO0OwItzOICX57g7j68u4/U57pfzewDvAXxcjh8AvAPwFsCb83ljuf0G8A3A13N8AvAZwMN5/gDgC4DvAH4s4+d5fATw6xyPAP5cjtfx6JcfjuRl7Lxu5GXjcp8lc7Nnx/hY2rGcW/JNlU+c+Mmyb+/EYdlEBpDKjABkjH8vFWxVAAW5toIgGFquL2FLlDNErUyRzTnGt20LcW7NAFTs/G+uF2hhP+KCKa7zjuQ5wwR7LGDi75mTbbkWimFcUHYkkRwLSNRLZekjRgO0GSAKBr4y7yGeIwOuKwI7uSrIvLhBNwwD8MCCCFBbwGCVCPeGas9yfZYmgoDGyH1jmgGy75h9a1tYg6Vny0Dhzei2BTSWRPmKNicIHOs5nwWlCjQIFo+MNZQIZKVHCJa4vtQxOf9Z9B8b6ZcBKEQpHkwDmEgHVb8gA5VNBXAzC1jBBkyrHYSln1Rj3mwmdOlGiZVhg9t6AJ0G3CHmKuBQAFTlBFP4saA3EqEyVqcAE9VUFdVW9A7QqQKqvn6QFzVRekxLuA+AaDR/lJ+iUVmEEoHsWizAMdK06LDHWG4H8kWfTipQ5XkKHm+gMaOnIDUmGtXD2F4TKDYYuttClhrARPSuVBJCcIAgeVLAfi+ARXrcEHBWlYEg9T2aFAQiTGJRrGO6CjiEAOyIvRDs0C4DoxB1IdgkCmCM5eaLg00wg9Jrnvgy1kDsVgHMwUaYIjufdYB9HRBLjW8bDBJFKvEqBWTNhm6f2gn9T/T3HFh1ZdVyPBORqU7zotbPqAmiCcQ0wUT/bTqAAcFEeraiX1NWAQwMCkms73y93wcEWzoA4Ov+rETMloplC943Kagj8kB+eNLAXjMoim+WNdiOokfwBAzVaiCr7x29JUlLxOCwQC0A15EtrWe7fzos29IAlbiIhgaYrWDPF4HVPUpzKT+VKSCj8o6g6+wDHCDsCUGgXvQxUSGorfo0BWRUrh6OQm3OruD9FACiqyqwOPQ+AroaaM2HZ6jKjtYUk2M5vXvh8Crdtpp83U2h1b8lOZ5uCwv09reN1WW4LeLbGvpKtfFlCsjyjxGVupYfFVCGBfZKwayFfv3G3mQUxhyt/QBRqFRD/m9hPj78byxggnUrMW7Kn38HAONAllI0EmS1AAAAAElFTkSuQmCC"),
  18737. pathEnd: n.load("images/End.png"),
  18738. pathStart: n.loadBase64("iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAAAXNSR0IArs4c6QAAM6VJREFUeAHtfQl0HNWZ7r3VXd2SLLEa2xgc2ySGxwOMiSRsC2IsG1vbMCGGsCYsWcibGSAhEEJeFkyIhyRAkknmvXOGJBMggQAhDAlIsjFY4NjCtqSwH55xDjYDAWN2JGvp6q77vr/UMpLcS3V3Lbeqbx3L3V1177989///uvvlTF2BRmBx96uVNbFpsyMiMpcx83Cu8UOh0FQm6FMcyuk7YwcLxivwGWOcxXEvxgSLW7/xH64E7o8I+hRshH5zJobx+R7uvc0Yf4dx8Q5+vy1M+tTeSPHUzv7EnleebJg1hPvqCigCsAV1yY7A0q6uaGVlw9EiwuZzTTueC34UnBsOz+dwzmb4Kb8QbDdk2QVZdgouXham+TxPsWeHhrpferyxMemnbIp3fgRUAMiPkacplnbtrKioObIOBbOQMz4fzjWfcX4sftMbOzAXag4jTIgXERieFUzgj20d7n+t9/HGuVSzUJckCKgA4HNBtGzsP4xVVZ4CRz9F4wyfvBYixXwWyy32CejZZwq2GXpuZoNDmzuX1LzlFjNFNz8CKgDkx8jRFLW9vfoMduKpqDq3oPregrf78Y4yCBoxIZ4HFp3AonM3e2ZTX12dETQVgiyvCgAelN6KTXtn6nH9DDg7nJ4vB8tqD9gGkcWAEOIxNB06jRHjofWnTnk9iEoESWYVAFwqreVbBqbH9djZ6LA7V3B+KoBWWBeANfoM0KcoNuG/e0eMxP2PLap+s4DsKqlNBJRR2gTKTrKm7g8OieiVn8Wb/ly86U9DHs1OPpUmLwImagZPoGZwb8oY+sO6hgPfzZtDJbCFgAoAtmDKnai5x1iqcf5lpFqFtiyNt6vLJQTQX0CjCA8gIvxybb3+uEtsyoasCgBFFvXKzf3TIrGKSzSNfQm1+3lFklHZSkJA7DBN9qtUYvj2R06p2VMSqTLNrAJAgQXftDVxYiSqXY0Zc+fhba8XmF0ldwEB1AoM9LDck0qat65bGHvGBRahJakCgM2ibe4zmiKMXYO3/ek2s6hkviAgHk0xdsvaWn2dL+wDxlQFgFwFdt99kZa5Z16IDr1r8HdCrqTqmVwIoNPwOfzd0rnzwbvYOecgJqgrEwIqAGRCZfVqrbXtW+cyrq2G4x+dKYm6FwwEEAReYsJc3dF+071s9WozGFJ7J6UKABOx5q09SfTkixswlHfcxEfqV6AREOIFIfj1HfXRB6AHphmoixBQASBtB609xgqg8WO88Rco0wgvAqgRPA33v7ajXl8fXi3ta1b2AWDFluF5uh65FSvvzrAPm0oZdASwQvEhw0hdvX5RxY6g61KK/GUbAFq2vHMAix7wXUzguRIAhnX1XSm2UQ55E5hQ9HOW/PDGzkWHflgOCk/WsSwDQOu2xKUsov0Qyk+bDIj6XX4IoENgD0uZ13WcHPtNuWlfVgGgqXv4E5FY5Da08xvLraCVvvkRQP9AVyqRumxdQ8Xf8qcOR4qyCADWllrVp34d1f3V6OirDEfRKS1cQUCwITQLVg8NbPpJOWxpFvoA0NKTOAlv/F/j7yRXDEYRDSUCqA08hb8vdtbHngqlgmmlQr1ctaUv8TXOta3K+cNswu7oRjZDtkM25A4HOaiGsgbQ9pf3DxaVU36DQvy0HDArKYKMAGoCf+JDey9t/9RB7wVZj0yyhy4AtPYmFmIK771QbHYmhdU9hUAxCGCk4BVMKT63oy62tZj8suYJVROgtdf4Ojbh+YtyflnNLbhyjdqU9pdRGwuuHpMlD0UNwNqKK151u5rNN7l41W83EKBZhKmRwUvCsDVZ4ANA81ZjcSTC78Hw3sfcKGxFUyGQEQHB/juVEuetXag/mfF5QG4GuQnAW/uMb2gRvlE5f0CsLUxi4oVDtkc2CLUC+yINpOB0fFbVAUfehSr/qjDZlNIlmAigSfDA4IevXRjEY88CFwBO7333wBiv+TOcf0kwzUVJHUYEEAQ2JkT/Pz5ad8gHQdIvUAGgqXfv4REeWwvnx6GZ6lIIyIUAgsCzKZFoXlc35Q25JMsuTWACwOi6/egjEHhOdnXUE4WAvwhgvsAuw0iuDMo+A4EIAK1bE3UsqnVA2MP8LV7FXSGQHwEEgbdY0mztWBjrzZ/a3xTSjwK09Rin86jWpZzfX0NR3O0jQLZKNku2az+XPymlDgDNPSPnMY23Axp1mq4/9qG4Fo9ANdmuZcPF03A9p7QBoK03cYWmRe4GAmq7LtfNQDFwCYEY2TDZskv0SyYrZR8AJldcj57+1SVrV2YE0PbcixN0X8IqyO3Y1OIljYm3hckGBNf6hSb6IymGT7PfNMx+QzP6d7/yaj9BNGP2rBrd1Gs0XavhplaTijB88houzBqusWqT8anYTOVorIo7BtulHw2jmVJm0JasLkYIVnfU6jeUTMhhAtIFACtacu3nDusZNnKvw9Gfg8Nv50xsT5l8OzeN7Z2Lql7zQtGWLYNHCk0/JqKJYwTjx8CIKDDQyUkzveAfWB7CvLK9LvYLmeSXKgBQe4mqTBBKKrn8LjCrV1mwLixH3WCkzA2yDjFZQ7URbRmWY+OPNaIQ1ajNOONBOQrTTF2wtj5+z7jbvn6VxtGsHtPRDj/V5mfsfVS3n4C9bMBfV0dd/HlYCewnUBdv7R05HrG8EX/L0Cw5DdIfFCgN3BE2wUzR1l6vP+oO+cKoShEAaJyfhk0gevn29gu0zzm73zTFnWvb12wM3Tl2OG+xue3bSzSNX8QFOxs1hJrCTDVUqQdE0myUYZ6A7wEgPcNvMwQpv+qiYCnBxXpmmne+Z+x58MmGWUOhMvMsyizufrXyYH3amUzTEAw4HcmGk9fL60J17i3MGDzF7+acrwFgdG5/vBtCzCmz4n9GCHYnM0fu7ji5end56T5R29ZtAzOYFr+Ac3YRmgonTnwa7l8IArtSYqTBz7UDvgWA9Kq+jWW0sMdEz/0DjIsfttfG+sJt2sVp19aXqGWCX4cRBVrmLe0cleK0y5yLFhBhFeESv1YR+hIA0uv515XDkl686ZOo4v6eJ1I3tS+Ov5jZDNTd8Qi0PTlyrIhFvoVuz/NRM4iOfxbG7wgCG7GfQJMf+wn4EQB4W6/xR0T5z4SxMMfplMD3242k8cNHFlbuHHdffbWJwMqtQ3P1qH4dkl+Cv1CPDiEIPICJQmdDT7QMvLs8DwAtPca16An+kXcqesxJsEFU9W8bMoxbNjRU/d1j7qFkt6x78IhKXb8GL43LUJuqCqWSUApB4FoEgZu91M/TAEAbeNI+aqGt1gn2h6FE4irl+O6YsBUIYrGfIgh81h0O/lKl5qKZEku83GjUswBAW3dHY1OeQuGFcPdescMU7PLOOv0Rf02oPLi39BorNc7+HaMG80KnMXYbTib2nuTVluNe9bTyCPbtD53zj54k+z3zzV0nKOf3zhUJa8IcC56+h3pzuOZO4AVp+YpHcHpSA0DEvhqryW7xSCdP2GCqbnsylbxCdfB5AndWJtRRGI1Ef4Gpxm1ZEwXwAYLbNQh0t7otuusBAKerLuJCo3a/7rYyntAX7E201b7SUR/9kyf8FBNbCLT2JD8NG/sP1DKn28ogeSLYmCG4uaSzNrbFTVFdDQDWKb1V1U+ByWw3lfCKNt76XZi9d0G5z97zCu9C+aRnFd6N2kBjoXllTI/xwFf44MBJbp5K7GofgHVEdzic3xSmuKHj4TWnK+eX0VVGZaKyoTKissIdU15J7UlGL07yIXupi0sFHu5crT2Jq7im/cQd6t5RRVVsNxbsXNhZq2NprrqCgkBLn7EMC43uQrNgRlBkzianycyr0BT4Wbbnpdx3JQA09SY+GWHaluC3+8Vjw8bIhY8tqn6zFJBVXn8QWL5lYHqFHr8Lw4XL/ZHAGa5Wf4AwF3bWx55yhuJHVBxvAizt6opGGP9VkJ0fbS9MyhLXtz+0ZqVy/o+MJWjfqOyoDKksrTINmgJpecmX0K/xa/Itp1VwvAYQ9Km+FG1NkbpIpm2bnC70cqRnbTfHI3cG+cWEzWK+2Vmv/9jJ8nM0ADR1D38iGos+i6GYSieF9JDWADqQVnXU6+s95KlYeYRAa4+xgmv8AbAL5s5TmPSUTCTnr2uo+JtTkDnaBIjEIrcF1flRRXzL2qZJOb9TtiUdHQrsVMZU1tIJZ0cgvFgtH7OT1mYaxwJAS0/iC0Edf4VB7GLJ5Kky7NFms9xUsiIRsMoYZW2VeZE0/MxGPta6LXGpUzI40gRo2fLOAVw/cAeITXNKMK/oYHLPcymWaPJzWyavdFV8PkLA2o6OxdbBoeg8g0BdCF57hPHBvM5Fh35YquDO1ACiB3w3kM7PRPdg/8AS5fylmlHw8lOZU9ljuKc7aNJbvgafc0LukmsAtKtvTI/SvvWB2rGF3vxkAI83Hvy+E0AqGsFEYGnXewdV1VRjrUrgagKJhJE8vtRdhUuuAeh6hFYsBcv5aTdWVPuV8wfTaZ2UmmyAbCGAfQKxtO+VBEdJNYD0sEqgNsFAQb812uFX8VJJyKnMoUKgdevw0Swa3QSHCNT5FBi2XlnKsHUpNQBs6sscnZTggUUNYNOl1o6Fyvk9wDpQLCybgG1A6IFACT7qg0W/yIsOAFh/vQrtpgVBAcuaT02TfBbGeoMis5LTWwTINmgiGNmKt5yL50Y+SL5YLIXiAgDOeePcWnJZLF9P86Haj3JNXVRKVclTgRUz3xAgGyFbIZvxTYgCGVu+CJ8sMJuVvKiqQ2vPyPkcx3gXw9CPPLR3HLZXutEP3opnMBHA2RXfwzbkNwRFeoFjxzvq478vVN7Co8Z992Gxn7a6UEb+pRePdT68Zo1//BXnICLQ/vCaH6AS8FhgZCefJN8s8Cq4BoApvxdpmnZHgXx8SY623O6R5PACtaQ3M/y0XyM9cXvfuczc5b9L+wnEoxVPYwVhIDYVMU3zYuwZcGchyBZcA0Dj/xuFMPAxrUk7+Sjnz14CGtO+Sn/ZU5T3E7IdsiGgEIjtxdAheE2hJVZQAGjuM5rQLjq+UCZ+pEev341qG6/syK/YtHcmakhn0R99z56yvJ+QDZEtBQEFms1o+WgBwhYUANDAKDjCFCCLY0lp996O9jXfd4xgCAnF4rF/Gd1phun0PYQqOqYS2ZK1I7RjFN0jVKiP2u4DaNqaODEa1Z52T3SHKNO+/ebwArV7b3Y86Xj2KTWzXsVErqlWKsHe3tv/6iw/jqfOLqVcT2jLca5VPA3MpD93IJk0F6xbGHvGDoK2awCRqHa1HYJ+p0GV9ivK+XOXwpTqIy7c5/yUFIHAupc7W1k/JZsi2woCCIX4qq0AQL2hmBZxnuzKo5r2sDqxJ38pCY1fOTlVpnuT05T7b7It2Fi79DjAVy2ftSGorQAQi8Qvln4zRdovLZXcz7BtYFBWSTDBpRGLOOZPVpru0bPJ99XviQjQeZCyH0hKvko+O1HyzL9sBQBNY1/KnF2eu9jY4V/VQZ35ywPzW7MO++V6lp9yeaQgGzOZuEl2be36bN4A0NxjLJX/HHaxQ+zZdbPsheK3fHSSLoaKzsgmBz2jNNmeq/tpBPbswipYsUNuPPi8Ud/NLWXeAICJP1/OTcL/p6Zgl3e2zhvxXxK5JYhGo1dAwlxlrqXTyK2Iz9KRrZHN+SxGXvZ2fDfnMGBT9weHROJTXkeieF5ufiUQ7A/tddFz/GIfFL5Lu/ZUV9Uc8hrahwfmkhk93R8M9r975OON04K1Lj6XUi49a+tN3ocRlM+6RL5ksijL4VRi7xHrGg58NxuxXG8DFolVniO58w8OJRJXZVNO3f8Igcrqgy7J5/yUmtJQ2o9yqm/ZELBsT7DBbM/9vo+yrCAfziVHzgAAc8iZORdhT54JcduGhqq/e8Ir2EzQvOdU/bd1pdPmrB3aIhTyRJbtwQblVjO3D2cNANbMJ85Pk1i5xJBh3CKxfNKI1tyTbIFTH21XIEpLeeymL+d0aRtMyIoByvI08uVs8mUNAKj/n4VM2Z9no+jRfQxZ/Ua9/e2BrXGRdegvG4Vi8mSjFeb7ZINkixLrqKV9OaOIWR2cC35uxhwS3ETnRjKZNH4kgSjSi7Cyd+R/oGG/omBBkcfKW3DG8stAtkg2KavmuXw5YwCwlopyfqqsCqHn9fdq0o+90omyyFfRmC+4PU95KK89LuWdyrJF2KSsKAj4crYl3xkDgB7XzyjGaDwCwOSJlPQzsTzCIicbOvUGrv/5nIlyPURei0auNOqZhUDaJqXcOIR8mXw6U1FlDACoMsrbASTEA+2L4y9mUkbdm4hA1QHVX0bhT5l41/4vyks07Oco35SWTcI2pUUgi0/vFwBqe3t19Bwul1WRZADmYUuBnbVBJHdgow/QKGKzSSkw8FoILn7oNUu7/Minybcnp98vAMxgJ1Lbv3pyQjl+i2fW1cX+KocsckvROnfVmXiDzy5VSqJBtEqlUw7522tjfVgjYGsjDh/wqE779gTW+wUA9GZKW/2HbHdOkF79yIoADotwrAPPSVpZBQ7JA5ltNJNv7xcAMH1QzgAgWIqZI4E5jMRPe27dlliAfpxPOSYDaFk0HSMYYkJko2SrEl6ZfHtCAGjZ2H8YDEfKXX+xPfN6tdWXPavimvY1eyntp3KDpn3uwUlpbR0GW5VSYvi25ePjhJsQAFhV5Snjnsn11TRV9d9Giazc3D9NcOe3byOaRNuGCCqJzLY6yccnBgAm5AwAgvW/Z+x5UFlWfgT0eMX/Qsed48u3iSbRzi+BSmHZKmxWTiQm+viEAKBxJmUAwNvn/icbZg3JCag8UtEwj2DcNScl2pmGkuRBQA5JyFbJZuWQZqIUk318XwCgveIxYah2YnI5fpmmUNV/G0UxwzzhXHT0HG4jaVFJiDbxKCpzmWWS12Z57aivjxbIvgBQUXNkHW7FJCyn99e2r9kooVzSiSQi2pVuC+UFD7d18IJ+2mbf94JXgTxiaV+3su0LAGjjLSyQkCfJsQ/7E2z1ainnWHsCgE0mbduMBmztXW8zedHJiAfxKppAuWSEzVq2K6G+4319XADYf694OWQXG+SQQ24pcLCHYxN/8mnqJa98ssj9XE7bHX8uxL4AgCmM82UEMynkBFEmrFq2DB4JeVZ5KNOqNE8PWQaPlby2+5GvWwFgaVdXFBOAjpUNYuy08tYj9fEXZJNLNnl4VKeTfqNeyUW8iKdX/ILKh2yXbFg6+eHrls9DMCsAVFY2HO3G2HHJigvWBRrAUF3ZEFjc/WolqnSeL9klnsQ7m1zqvoUADqyybFgqOMjXyedJKCsAiAiTsvrPhKna/3lM56D49M9h049D8yRz/jF4WrydpxwuipLa8JjPWwEA87ylnP9vpFQAyOcNmtj/pN98eZx67idvp3Rwm46sNjzm81YA0Bj/uNtAFEH/9fWLKnYUka9ssjRvM5b7ungLi0ssGcoG8cIVTdvw64XndDcHNgo9ijiMNgGEmOMuuyKoC/FcEbnKKosWyX7Sr1dAyCCDV7oWzUdKWxZzSR8rAGAK8Bx8l+pCz992qQSSTJiW3uGPoyOuzW+xSAaSxW85ZOYvpy3zOYSZZvUic5b15BBK5MfFmVABIAfwnEXynfSbI7ejj7C+xJLFUaJhIiajLWModwb5vlYTmzZbRrBTJlcBIEvBnLLprRrU2i7N8tiH2/zSUZl8YB0AlrLaMvm+FhERqy0gG47cNFQAyFIoB1YceCki+AFZHnt+m2QhmTxnHBCGstoy+T76AMzDZcMRbaa9nYuqXpNNLknkwQ7P/HJJZNknRlomvu+G+rIPAbJlsul9N6T5Yh6ucY17P4kkDwBcqPZ/Noha+5Lo+OPzsj337z6fNyqbfxJIzVmIl2STj3yfRgGmyiYYdp5R1f8shYIOJc9W/WURIettmWXLKrRnD/j/84yVfUZTNSbkqwEwCaOlfUzdS9myZeR/4u1/unscSqXMTx+VsVQ64cuPRQHyTWqD76MGIKSrAeAginfCZwKla6Tp8p/WGwQZSy+JwingTft24bncziGmYgzXh4UkefTChor9eZKU3eOm7g8Owcqyz0mvOGS0ZJVeUG8FlNGmyfexnoMd4i0UNriZmgoAk2CKxqq+jFV/VZNuy/cTMlqyyieZvxLJadMHUx+A43vIl4o0TgFSAWA8iDidFx2jgdmAw5JVnSg8vgThZvLZNMqpgkYB5AsAKdUEGG89bUetWoXJNrPG35P5O8lKMssso9eyCTltOo6VwPJtBa5FzAGvC0hmfuhBlnboLxtuQZQ5my5O3JfSpuH71Ako3VkApmGqJkDa6tr6ErWYZSfliU25HINkJtlzpSmnZzLaNPk++gDkawIYmqECQNo7BNMC9/Yfc+wgyz6mg1OfUto0fJ/6AKSrAex+5VUVAFAwy7cMTEeUDuxRXCQ76eCUEwWZjqQ2jRqAuqRFIB6J/xOEky5AFwBYLK1DAVlUUi8RoACQ8JKhHV4zZs/Cevfyvo6774UY2tGunfTrFbqkA+niFT9Z+Uhq0wkaBRiRDTTd1Ms+AHxs7rzzUDbBrz5DB0sX2YzMY3mktGn4voZ1ytLVADRdK/sAoGn+bffttG+ESZdisZHRpsn3aRRAuhoAN8s7ADT3Gqdi1V+IhtB47ahOxbpP8PNJadPwfSn7AFIRVtY1gAjzf7tvp10ujDoVgpGkNp3ARCAxXIgiXqTlJi/bALBy2yCm/PLPeIGztzz4Z0Z185arLNxktGnyfaoBvCcLSGNycGGWbQCIRvTL0fmHF2bILuhk6RYyteyqI6lNv0edgO/YVcKrdFxj1V7xkolPbe/rVVg29iWZZHJUFuhm6ego0WAQk9Gm4ftvowbApdupxGRcul2KvDCz6WLq57GSTr79GRxSnnQjHR0iFygycto0fwfzAOTbfkvj/OhAla5TwoZo6C8rJOWgYwblpbRp+D71AUhXAxBCHJMBw1Dfau0xVuCcPWz6Ge6LdCRdw63l/tpJatNva8KUrwaAI6/LrwbAwzf0t78bpO+Uk65jIEho0+T7qAFob4zJKMsnVpFNadkyeKQs8rgtR1P38CcQ9Frd5iMNfehq6SyNQO4KQrZMNu0ul2Koa29oKZ7aWUxWt/MITS+bZoAWi14JA8G/8rhIV9K5PLTFxvuS2jL5vtaf2POKjAUR0cqjH6BlyzsHoBp2iYxl4KZMpDPp7iYPWWjLasvk+9qTDbOGhGC7ZQFrTA7sWFoeNQC95gt495ffxCfSmXQvg0tGWyafJ99HIKZL7LI+JPoP1cTwB4DVqzUutMslgt1TUSzdgYGnTH1gJqctj/p8GnwuXz8A5yf4UFaesmxu+84/YHLMxz1lKhEz0p0wkEgkd0SR0pZHfd4KADi04GV3NC+J6swVW4YlPAa7JJ0mZMbrP7Abfk5QpIQfYccgbcMzS4DIlaxjPj8aAEzzeVe4lEhUj2jLSiQhbfaVPSPHY7us0OpnF3jCgLCwmz5o6WS1YZH2eSsA8BR7VkpgeXgDQJTLf9KvVzYRaiwkteExn7cCwNBQ90tYGSTdzkDoHW+EEaIPJVzX8q0fHgqlLgyXVsVrQ1gQJsVTkDYnZj5bNiyVgOTr5PMklBUAHm9sTDIhXpRKSggDwzgM1cPjZJOrVHnikcrLoFxlqXRCkx9YWJiERqFRRVp70cyDDUunFnzd8nkIZgWAUQG5lM2AaMjayUu7uqIIbf8snVH4LhD/51FsfBfEQQF4o4PEHCT1ka/vCwA4zFHKAABnWeag5r6TqpzScBaGv8pmnYNdwAkTwsZu+mCkk9N2x/v6uADAtsoIKnqJT2MhmiyiRYJ71p/b9hEqbGiSF9muhBf6APb5+r4AMNz/Wi9kle6MAMh0UHPbt5dIiGPBIjVvS9SjRrO44Ixlk4EvHsUo+AqnbfYgCTVJpH3dEm1fAHi8cS52BxZ9EgrMcLDERTLKVahMEU29/fNhFhaM5LVZ0Tfq66MlsS8A0E9TsM35CsiP51ywsxd3vxroXvOm3r2Ho+p1jh/4BYknYURYBUnmybKSrZLNTr4vw+/JPj4hAKB6KmUAwJBZzcH6tDNlALBYGaIs9k/o6NKLzV8u+QgjwirI+lq2Sqsdpbwm+vjEADA4JGcAICA1LbDNgJaOHXHB+VektAcJhSKsCDMJRbMnksy2OsnHJwSAziU1b2FCkJTrArjgK1q3DcywVwJypeLTZ5+PCSHT5JJKXmkIK8JMXgmzS0Y2SraaPYWPT+Dblo+PE2FCAKD72Cigc9xzeb7SaTla/AJ5BCpAEsHLftVfAWiNJg0qZmSjkp7slMm39wsAaIPJGQBgFpAtcM2A1m3GEowHLyjYAco8A2FG2AUNBpltNJNv7xcAdrNnNgH0ATmB5ye29SWCdWx2pIy2+3baaAKG3aht8hOdhsEhegNp355Abr8A0FdXZ+AQg8cmpJLph+DXySROLllaNw/NRnvw07nSqGfZESDsCMPsKSR7IrFtkk+Tb09GbL8AYCUQQtpmANoBq9qeHDl2siIy/hbxaDhP+vUKbLSlLQy94lcCH8smYZslkHA3axafzhgAjBHjIUzIwD8pL03EIt+SUrJxQq1ct3sKJoPLfdIvjfhIOuozBiVhSFiO/Zb1M22TGf3Jb5nJl8mnM8mRUeD1p055nQtBfQFyXoKdv3Lr0Fw5hRuVKnLoIdRhKd1ccPQEv4u//5tKmSe31+kn0B99p3v0TEJMD0pjKaFooyJZtgiblFVA8mXy6UzyZQwAlBCbBt6bKYMM99CbGdWjusx9ATgOnktz8g0cmzZ86UCd7pxXXt5+eEdd9F/WnhzrGStL+k736BmlobRWnrEEPn+mscT0ADkvskWySTmly+3LWUFdvmVgeoVeQVEja5DwWeHE0EjiqA0NVX/3WY792Df3GU0Rxtfu98DrG6jeC87uZKmR33acXF3Q4S/WpKtI/POY034R+l1837QzxUTz2lp9ndcQ5uO3rHvwiMp47GWki+VL69Nzc9gYnvnYouo3M/HP6tyUAT2HT2TKJMm9WKWuXyOJLBPEAKj+TfwR7B1hsv8jkmY9Ve87avWbC3V+UobyUF6iQbSIJmoH70xQ1MMfvmKaQ8+0Dcrq/KjMiSeyOT+plTUAWDoLeZsBlnycX0YR2PouyX+tW4ePxpSlZi/Foeo6CrrdNNlnd728fWZHffTyjoUx2t/BkYtoEU2iTTyIl/dNBN48iq0jKjlCxLI92KAjxNwikseHc7ZbUsbQHyKxKT9D+6bCLflKostZVWUs9lPQkGeZrebhSb+jPfh3jCRHfpsrypeE8bjML5xzXOIFxu7HrfutJmI0/nl8v9iLJgLaqjhJzDpR+PJxIvn61bI92KCvQuRgjiA9TD6cIwltvJv7au1N3oUAIPUcfFOIps46/ZHcmrj/9PTedw+M8wNeA6dq17hRNZyz32P3htvba2NSbOAyOgNOuwRNhPMhm5vbew+MiA+PfLTukA9cw9cm4ZZeYyWGKKXrkxgvPgLA3ejczbn9fO4mAKjBuX45nqiM3zXO/l2G5aMxVvNF4OO486er+A+jHX42VcPba6NXyOL8ZA8kC8lEspGMaCI87FIToTqNsa9mSLZGNuerEDaY2/HdvDUA4tPWZ7yEGtg8Gzx9SwJlv4dawI2+CYBNINv+4Tt/wxtwrlMywJGewySOOxLJkd95UcV3Sm6iQ02EWDT+ORjYxVjYc4JjtAXb2f7wDz6BjWJNx2gWSAhv/+/i7f/9ArN5nFzsaK/V0R+V+7IVAFp6jGuxx9mPcpPy+algQ0bKOO6RhZU7/ZCkpTd5Jt4K/1Uyb1TxYdl3m6jir6uL/bVkehIQaOpNfFJj2iWobtJS2ZKbCNjW6jOdddEH/VCNJv3oEf0F6FHpB3+7PE1TfLOzXv9xvvR5mwBEIJUYvh1Vuv0WEuQj7ulzFEg0Ev2FpzzHMdNY8Sf9WlV8Jh5iKXYWVaNh3FeGxfkJItKFdCLdSEfsS/9QKU2EUrAeV2RFfbVsTHLnJ18ln7WjoK0aABFq7UveicTU6yv1hTbomRiy+pOXQjZvGZkf0SPPFMrTOqBBsDuSI8O/e+SUmj2F5g9y+pWb+6dF4xWfw5v0YhygN79QXVJG6sS1i+KeHmbjWC2vUGULTI9m4287aqM0FT3vZTsANG1NnBiNak/npeh3AsHeFObwgmImvxQreltf8tfI+wVb+QV7G45/N9r3t3fWx56ylSfkiVp6Eiehn+ASBAJqIky1qe5/ouOROl09uaytvrSKpyHfdE8YlsAkmTQXrFsYs/VCstUEIFlGCYpHS5DLm6xUQFr8bq9OE1ra++FUVLlyDpOOVnfFn1OMrdrNnp7ZUad/VTn/R+ZAWBAmhA1hhNnrf87XRCDMCfuPqLj4jU6mIpsKgPMDu0ftOj8hZrsGQImlmeNOwuS5hClu6KjXV+dJVvLjth7j20zjP8hMSDwDOe4QQyO/m7wZY+b06u4YAi0b+w/jlRhF0PjFMNMTx+5P+DTFd9rr9TUT7rnwo7XHWA05rneBtOMkC10zUVAAIGlbe41nHR3WcRyCfQQxa1Ws6KzVN+y74/CX2t5efQZfsAtkZ+4jPVrFvwsTKG7vODkmf5Npn+DyfmndlliAIHsJmggX4pU1/q3/+m7x9JxMO904pU1Ln7EMqxHXg57t2rJTvAulQ8PGqEkV1J9SsFJgckuhgvmUXsOWUnfReLRb/KeLE84G7ZmojtI2an+i4al0Ff9ryvmdQ52whGF/jbAljAlrwpywT5eBc8zGUSLbIRvCrYL9ZBwZ774KcXOhzApWrHPng3ehADAxSP4LU5hnVOjxu1zrD9Aip2G8/ioxOHQEDPRMGpt2820kP+LuSkjYEsaENWFO2DOUgStc0e4n2yEbcoW+w0TJJzt2Pnh3oWQLbgIQg9aekfO5FimYWaHCOZZeiOuxrPX7jtFThEKPQFuv8T0scrohKIoKM3VBR30ca0QKuwquARD5jvab7sVCYywMC8aFo6ZWN/eMnBcMaZWUfiNAtkI247cctvnDFy2ftJ3ho4RF1QAoe2tP8izse3X/R6Tk/ma1GYVow8gAdeioSyGQEQH0+K/Am78dVX89YwIJb9ICLEx++2MxohUdAMCMY0TgrxgRWFAMY5/yDGB3m0YnN8vwSQ/F1gUEWrcm6nhU6wJpx1d0uiCuRRJtf+og/SR+iGJ4FNUESDPChDZ2bTFMfcxTzaJah2w7y/iIh2KdRsCyCdgGfgbG+S3RR32wKOen/KUEAEbVaVrYYQkSkP9Q5TmMRaPrmnr3Hh4QkZWYLiNg2QJswrINl3k5SZ58r9QmbUkBgJQxjNTV+Eg4qZjbtFDQcyIstm5p13sHuc1L0ZcbAbIBsgWyCbkl3U+6RNr39ntQyI2SA8D6RRU7sBnHzwthKkNams1YdUB1uwoCMpSGPzJQ2ZMNBGRm6wSQyOfI9ybcLOJHyQHA4pn88EY0QgK3nBVTSxuqaqo3quZAEZYT8CxU5lT2ZANBU8XyNficE3I7EgA6Fx36IUuZMp/UkxUriv4RHu9WHYNZIQrdAyprKvMgvvmtwoCvWT7nQMmg6ePchWHBDQC10TmK3lFCVH2LJc1WNUToHeZ+cKKhPhoJguEf5gf/Unli2K8Lw37LSqUzlt+RGsAYsVQidRmGBofGfgfpkwyCxoCtiSBBElzJahsBKlsq46A6P/mW5WO2Nc6f0NEAsK6h4m/onFidn620KappFpiaNixt+RQtmFWmKFsQCNY4/ziNybfIx8bdKvmrowGApBka2PQTVFMCu9UVTQHVsNDJWgxCO8GoK9gI0HbtWNhDZRqk6b2TQSefIt+afL/U36gNOX+N7vGmbQ0y4KOoiMeGjZELg7Ynv/MlGkyK1vFltByc8eXB1CBthdZ+E+ZCN7aRc+UNR4IKbgZtmnAGG+HL49GKp2lXmAwP1S2JEaAyo7ILuvMTxORLbjg/0XYlABDhztrYz1Bt8XR7buLr9IVazAzaEor2hXNtYxGnhS5neqjyU1lRmVHZBR0K8iHyJbf0cKUJMCZs21/eP1hUVT8FJrPH7gX5E4XRxcyRC7zccjzIeHktO23dTbv3BnUoejJeGJp+hQ8OnNT+qYPem/zMqd+uBgASsrU3sRAVjb8Evz8gDTmdOyDYV7w+fMSpAg8rHexP8WnY2H9g01DX9oD0ErvRPQ/NT3XUxba6ydf1AEDCY4LQ1xGVb3VTEa9pozbQnkwlr/DrLEKv9ZWVH53VR8d1wb7aZJWxGLlgX1djwo/jvf6TZfEkABDT1j7jz5h3fcZkAQL9GxMzsCTzX8WeXTd3ts4bCbQuAROejujm0+Z8Azb1v/HWl/qgzkKhtZb51ur/WGi+YtK71gk4WZjUyOAlmMn035PvB/o3DA9vnhu16XOew5HRKwOtS4CEJ6wJc8I+bM5PPmL5ikfl4VkNgPRp3mos1iJ8I9pqUY/085aNYH8YSiSu2tBQ9XdvGZcHt2Xdg0dUxmI/hdN/Nowao92fNFNiydqF+pNe6edpACCl0BSgalvec8u9AsBxPoINYsfk24YM4xYVCJxB13J8Xb8G07Qvg/NXOUNVPiqo+l/bUasXfLhHKZp4HgAgLEcQuB9BAIdAhvpKYBjnN8mk8SPVUVhcOVMHnx7VaZn5JfiLFUclGLng/A/A+emkKZiNd5cfAYAt7dpZUXXAkdiGiS/xTlV/OFG1Dm+t3/NE6qb2xfEX/ZEiWFzbnhw5VsQi34IrnB/a5uK4IoHzbxz88LWmxxvnDo+77clXXwIAaXZ677sHxngN7chS0GGGnqDiDhOcVSoeYFz8sL021ucOi2BTbetL1GLe63Wo6lPt0LMOaj9Rg/M/mxD9Sx6tO+QDP+TwLQCQsrQtk7UzC2Nz/FDeP544NlywOzGr8O5yn1WYnr13Ad70F6F1mPkYcP8KylXOqOvvSomRhnV1U95wlVEO4r4GAJJrxZbheboe3QxBArlDSw5s8z8SLCW4WM9M8873jD0PPtkwK5CbqeRXdGKKxd2vVh6sTzuTadpFOH0XJ/GwyMQU4f8F53/LMJKnOLGxZylo+R4ASPggnshSCugZ8wrWLzi73zTFnWvb12zEwiMzY7qg3sQinea2by/RNA6nZ2fD6WuCqooDcktzQpUUAYAAbesxTmeatWNLqHt7bRrP+5gK+gQ6hDckhdjwSH38BeTztHfYppy5kvGVPSPHRTlfhqr9MkzaOQ2J1TkMdIaGKdra6/VHc4Hn1TNpAgApTNs2WTu3wGK8AiAIfKi6CPfvYsLcYKTMDX5XG7NhZjXnItoyxumPNaIQy69Zlw0c3Ec5ChPHeK+tj9+TI5mnj6RztLbexBUwoMAdNOJpqTH2OkYUnoNBbedMbE+ZfDs3je2di6pe80KOli2DRwpNPyaiiWME48fAiI5Bz/0J4D3TC/6B5SHMK9vrYr+QSX7pAgCBg4lC12N4cLVMQAVBFgSEvVyI7XBK/IkdGhNvo1+hn5ka+hdEv0ixfi1iDpiG2W9oRv/uV17tJ71mzJ5Vo5t6jaZrNWZKq+YRVoPOuRqmmfhkNSbjU1Ee8xBsjhHccvgpQcBDKhmFuL69Tv++VDJBGCkDAIFENQHBtX+DgNLKKFthKnnkQ4Cq/VyYX5XtzT+GlNTORX0CES1yB4RVHYNjJaY+g4RAImWmLpapzT8ZPKkDAAmbHh34L3wN7H7uk0FXv8sCgQH09n9Glt7+bIhLHwBI8KAf55QNfHU/nAig2h+YY+YCEQDITNIzBh+BwHPCaTZKqzAgAOffhRl+K2Udqp2McWAWXBCgNG+aFk9MVkL9VgjIgADZJtloUJyfMAtMACBhadEErZwC0Bvpt7oUArIgQDZJtunnwp5isAhUACAFadkkrZ0G4A8Uo7DKoxBwGgGyRbJJv5b0lqJPYPoAMijJW3qwvRjna8ph04gM+qtbPiNAm71gzca3O+utbbzQ/A/eFeQAYKFNG41GIvweTBf6WPDgVxIHFgHavTclzvNyA083sApcE2AyCFQAycTek1ANe2jyM/VbIeAGAmRrZHNBd37CJvA1gHEFzLFf/NcxZ/0mNAn0cffVV4WAIwigym/A+b/VOXpiTyCr/JOBCFMAsHSzziLk2r1QbPZkZdVvhUCxCMDbX8Fi3nPdPquvWPmKzRf4JsBkxamA6ERVdM4E/mjyybqp3/4gQLZENhU25yc0Q1cDGG8irT2Jq7C3wI9Uk2A8Kuq7XQSoyo+3/jc76nEaUUivUAcAKrOWnsRJGCr8Nf5OCmkZKrVcQABv/afw98XO+thTLpCXhmTomgCTkaUCHOzfdDI22/wm9mQqi113J2OgfheAAGyEbIVsJuzOT6iEvgYwvuibuoc/EYlFbkNtoHH8ffVdIUAI4I3flUqkLlvXUPG3ckGkrALAWKGiWfAFrmk3QflpY/fUZ/kigB7+PSxlXtdxcuw35YZC6JsAmQoUVbv/FMYH80whbsHzRKY06l5ZIJAgGyBbKEfnpxIuyxrAeNMe3WcgcismEJ0x/r76Hm4EaDafYaSuDtLSXTdKpOwDwBiorT0GHVH1Y/QPLBi7pz7DhwDa+U+jM/jajnp9ffi0K1wjFQAmYsZbe5KrOBc3YJ/74yY+Ur8CjYAQLwjBr++oj9IycjT71UUIlGUfQI6iFzCQP7Y/vGa+wAkueFu8lCOtehQABKgMqSypTKlsIbJy/nHlpmoA48DY7+t990Va5p55ocb5N1AjOH6/5+qGvAgI8Tw6+G7u3PngXeycc1LyCuqvZCoA2MS/uc9owhnW16Df9HSbWVQyXxAQj8Lbb1lbq6/zhX3AmKoAUGCBNW1NnBiJalejInmeWmNQIHguJbfm7HN2Typp3rpuYewZl9iEkqwKAEUW6/ItA9NjkfjFmsa+hFrBvCLJqGwlISB2mCb7VSI1csdji6rfLIlUmWZWAcCBgm/uMZain+DLGEY8C4DGHSCpSGRBAD14I6h9/RHt+1+urdcfz5JM3baJgAoANoGyk6yp+4NDIrHKc1AjOAfzCU5DHjXKYge4/Gng7+IJdODfl0oM3beu4cB382dRKewgoAKAHZSKSNO6bWAGi8TOwjHb5+JI7VMBtMK6ABzxpsepumIT/ruXpRJ/7Di5encB2VVSmwgoo7QJVCnJVmzaO1OP62dgKLEFNYPloKUOOs0M6ADe9I9hWV6nMWI8tP7UKa9nTqbuOoWACgBOIWmTznH3vRCbc9TRp6DnGsGAtZT9/AKM1wOLTmDRuZs9s6mvrs6wCaVK5gACKgA4AGIpJFo29h/GqipPQY33FI0zfPJa0IuVQlPivFh5KfpMwTZDz81scGhz55KatySWN/SiqQAgWREv7dpZUVFzZB0KZiFWKM6Hw8xHLeFY/A7U6MJob714EY7+LFbe4Y9tHe5/rffxxrnDkkFe1uKoABCA4l/a1RWtrGw4WkTYfGxkcjw6Fo9CYJgL55qDqvMMP1VA9R2dc2IXZNmJDruXhWk+z1Ps2aGh7pceb2xM+imb4p0fARUA8mMkdYrF3a9W1sSmzY6ICAKCeTjX+KEQeCr60PEppqKA6ffBgvEKfMYxFhHDvRjG0qlGMdbUSOD+CN7SCdynDVJGOBP0pn4P996Bc7/NuMAne1uY9Km9keKpnf2JPa882TBL7bMIYIJ6/X8QmpCW0hsGOwAAAABJRU5ErkJggg==")
  18739. };
  18740. t.prototype.setScene = function(e) {
  18741. this.createCpm(e),
  18742. this.createBunnyObj(e)
  18743. }
  18744. ,
  18745. t.prototype.updateModel = function() {
  18746. this.model = this.modelManager.getActiveModel()
  18747. }
  18748. ,
  18749. t.prototype.bindEvents = function() {
  18750. this.modelManager.on(r.ActiveModelChanged, this.updateModel.bind(this))
  18751. }
  18752. ,
  18753. t.prototype.updateDefaultsFromModelData = function() {
  18754. this.model.data
  18755. }
  18756. ,
  18757. t.prototype.pointPathDistance = function(e) {
  18758. for (var t = 0, i = 1; i < e.length; i += 1)
  18759. t += e[i - 1].distanceTo(e[i]);
  18760. return t
  18761. }
  18762. ,
  18763. t.prototype.pointPathLengths = function(e) {
  18764. for (var t = [0], i = 1; i < e.length; i += 1)
  18765. t.push(t[i - 1] + e[i - 1].distanceTo(e[i]));
  18766. return t
  18767. }
  18768. ,
  18769. t.prototype.interpAlongPath = function(e, t, i) {
  18770. var n, r = new P.Vector3, o = t[t.length - 1];
  18771. if (i < 1) {
  18772. n = i * o;
  18773. for (var a = 1; a < t.length; a += 1)
  18774. if (t[a] > n) {
  18775. var s = (n - t[a - 1]) / (t[a] - t[a - 1]);
  18776. return r.copy(e[a]),
  18777. r.sub(e[a - 1]),
  18778. r.multiplyScalar(s),
  18779. r.add(e[a - 1]),
  18780. r
  18781. }
  18782. } else
  18783. r.copy(e[e.length - 1]);
  18784. return r
  18785. }
  18786. ,
  18787. t.prototype.pathHeight = function() {
  18788. return this.player.mode !== O.FLOORPLAN ? D.path.height : D.path.outsideHeight
  18789. }
  18790. ,
  18791. t.prototype.createBunnyObj = function(e) {
  18792. this.bunnyObj || (this.bunnyObj = new P.AxisHelper(.1),
  18793. this.bunnyObj.visible = D.warp.showBunny),
  18794. this.bunnyObj.parent && this.bunnyObj.parent.remove(bunnyObj),
  18795. e.add(this.bunnyObj)
  18796. }
  18797. ,
  18798. t.prototype.createCpm = function(e) {
  18799. if (!this.currentPanoMarker) {
  18800. var t = this.makeWaypointObj(I.pathEnd, "Current");
  18801. t.material.uniforms.opacity.value = 0,
  18802. this.currentPanoMarker = {
  18803. mesh: t,
  18804. placed: !1
  18805. }
  18806. }
  18807. this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  18808. this.placeCpm(),
  18809. this.currentPanoMarker.mesh.parent || e.add(this.currentPanoMarker.mesh)
  18810. }
  18811. ,
  18812. t.prototype.placeCpm = function() {
  18813. if (D.path.mapGuides && this.player.currentPano && this.player.currentPano.isAligned()) {
  18814. var e = this.player.currentPano.floor;
  18815. this.currentPanoMarker.mesh.parent !== this.player.currentPano.floor && (this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  18816. e.add(this.currentPanoMarker.mesh)),
  18817. this.currentPanoMarker.mesh.position.copy(this.player.currentPano.floorPosition).sub(e.position),
  18818. this.currentPanoMarker.mesh.position.y += this.pathHeight(),
  18819. this.currentPanoMarker.placed = !0
  18820. } else
  18821. this.popOutCpm()
  18822. }
  18823. ,
  18824. t.prototype.fadeInCpm = function(e) {
  18825. this.player.mode === O.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || D.path.mapGuides && this.currentPanoMarker.placed && V.start(F.property(this.currentPanoMarker.mesh.material.uniforms.opacity, "value", 1), e)
  18826. }
  18827. ,
  18828. t.prototype.fadeOutCpm = function(e) {
  18829. V.start(F.property(this.currentPanoMarker.mesh.material.uniforms.opacity, "value", 0), e)
  18830. }
  18831. ,
  18832. t.prototype.popInCpm = function() {
  18833. D.path.mapGuides && this.currentPanoMarker.placed && this.fadeInCpm(2)
  18834. }
  18835. ,
  18836. t.prototype.popOutCpm = function() {
  18837. this.fadeOutCpm(2)
  18838. }
  18839. ,
  18840. t.prototype.brushPrefs = {
  18841. linewidth: 7,
  18842. strokeWidth: 15,
  18843. cvSegments: 48,
  18844. paveStep: .1,
  18845. paveWidth: .2,
  18846. lookBlendDist: 3,
  18847. maxTurn: P.Math.degToRad(2)
  18848. },
  18849. t.prototype.panoPathDistance = function(e) {
  18850. var t = this.model.panos;
  18851. if (!e || e.length < 2)
  18852. return 0;
  18853. for (var i = [], n = 0; n < e.length; n += 1)
  18854. i.push(t.get(e[n]).floorPosition);
  18855. return this.pointPathDistance(i)
  18856. }
  18857. ,
  18858. t.prototype.loadTileTexture = function(t) {
  18859. var e = n.load(t, function(e) {
  18860. e.wrapS = P.RepeatWrapping,
  18861. e.wrapT = P.RepeatWrapping,
  18862. e.needsUpdate = !0,
  18863. H.debug('path texture "' + t + '" is ready')
  18864. }, function() {
  18865. H.error('path texture "' + t + '" failed')
  18866. });
  18867. return e.mapping = P.UVMapping,
  18868. e
  18869. }
  18870. ,
  18871. t.prototype.buildWarpDestinationDescriptor = function(e, t, i, n, r, o) {
  18872. return new l({
  18873. cameraMode: n,
  18874. position: e,
  18875. quaternion: t,
  18876. panoId: i,
  18877. orthoZoom: o,
  18878. floorVisibility: r,
  18879. thumbUrl: null,
  18880. name: null
  18881. })
  18882. }
  18883. ,
  18884. t.prototype.buildWarpDestinationDescriptorFromHero = function(e) {
  18885. return this.buildWarpDestinationDescriptor(e.position, e.quaternion, this.getHeroId(e), e.cameraMode, e.floorVisibility, e.orthoZoom)
  18886. }
  18887. ,
  18888. t.prototype.setWarpDestination = function(e) {
  18889. this.warpDestHeroLoc = e
  18890. }
  18891. ,
  18892. t.prototype.setWarpDestinationByHeroIndex = function(e) {
  18893. var t = this.getHeroDescriptorByHeroIndex(e);
  18894. return null !== t && (this.setWarpDestination(t),
  18895. !0)
  18896. }
  18897. ,
  18898. t.prototype.setWarpDestinationByPano = function(e, t) {
  18899. return !!this.model.panos.get(e.id) && this.setWarpDestinationByPanoId(e.id, t)
  18900. }
  18901. ,
  18902. t.prototype.setWarpDestinationByPanoId = function(e, t) {
  18903. var i = this.model.panos.get(e);
  18904. if (i) {
  18905. t = t || new P.Quaternion;
  18906. var n = this.buildWarpDestinationDescriptor(i.position, t, i.id, "panorama", [], -1);
  18907. return this.setWarpDestination(n),
  18908. !0
  18909. }
  18910. return !1
  18911. }
  18912. ,
  18913. t.prototype.getHeroDescriptorByHeroIndex = function(e) {
  18914. var t = this.model.heroCount();
  18915. if (null !== this.warpDestHeroLoc && t < 2)
  18916. return H.info("ShowPath.getHeroDescriptorByHeroIndex() -> Only one hero location is available."),
  18917. this.model.getHeroDescriptorByIndex(0);
  18918. var i = this.model.getHeroDescriptorByIndex(e);
  18919. if (i) {
  18920. var n = i.isPano() ? i.panoId : i.cameraMode;
  18921. H.debug('ShowPath.getHeroDescriptorByHeroIndex() -> New brush/warp destination: "' + n + '" out of ' + t + " choices.")
  18922. }
  18923. return i
  18924. }
  18925. ,
  18926. t.prototype.getHeroDescriptorByPano = function(e) {
  18927. return this.model.panos.get(e.id) ? this.getHeroDescriptorByPanoId(e.id) : null
  18928. }
  18929. ,
  18930. t.prototype.getHeroDescriptorByPanoId = function(e) {
  18931. var t = this.getHeroIndexFromPanoId(e);
  18932. return this.getHeroDescriptorByHeroIndex(t)
  18933. }
  18934. ,
  18935. t.prototype.getHeroIndexFromPanoId = function(e) {
  18936. for (var t = 0; t < this.model.heroLocations.length; t++) {
  18937. var i = this.model.heroLocations[t]
  18938. , n = this.getHeroId(i);
  18939. if (n && n === e)
  18940. return t
  18941. }
  18942. return -1
  18943. }
  18944. ,
  18945. t.prototype.getHeroPano = function(e) {
  18946. if (null === e)
  18947. return H.warn("getHeroPano(): no destination"),
  18948. null;
  18949. var t = this.getHeroId(e)
  18950. , i = this.model.panos.get(t);
  18951. return void 0 === i && (i = null,
  18952. "" !== t && H.debug('unable to find pano "' + t + '"')),
  18953. i
  18954. }
  18955. ,
  18956. t.prototype.getHeroId = function(e) {
  18957. return e.panoId
  18958. }
  18959. ,
  18960. t.prototype.setWarpDestPano = function() {
  18961. return this.warpDestPano = this.getHeroPano(this.warpDestHeroLoc),
  18962. this.warpDestPano
  18963. }
  18964. ,
  18965. t.prototype.brushToWarpPano = function(e, t) {
  18966. if (this.discardPathObject(),
  18967. !this.setWarpDestPano())
  18968. return !1;
  18969. if (this.warpDestHeroLoc.cameraMode !== O.PANORAMA && H.warn("Can only brush from pano to pano"),
  18970. !this.warpDestPano)
  18971. return H.info("No brush"),
  18972. !1;
  18973. if (!this.player.currentPano)
  18974. return H.debug("No current pano, visibility undefined"),
  18975. !1;
  18976. if (!this.warpDestPano)
  18977. return H.info("No wPano, visibility undefined"),
  18978. !1;
  18979. if (!this.warpDestPano.isAligned())
  18980. return H.debug("Cannot brush to unaligned pano"),
  18981. !1;
  18982. var i = (e === L.STD || e === L.WALK) && D.path.mapGuides
  18983. , n = !0;
  18984. if (this.player.currentPano.id === this.warpDestPano.id)
  18985. H.debug("Already at destination pano");
  18986. else {
  18987. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  18988. n = void 0 === this.nodes || null === this.nodes || this.nodes.length < 1,
  18989. this.obj3d = new P.Object3D,
  18990. H.debug('Brushing from "' + this.player.currentPano.id + '" to "' + this.warpDestPano.id + '" (' + (this.nodes ? this.nodes.length : 0) + ")"),
  18991. n ? (H.info('No "walkable" route, using fall-back warp style transition'),
  18992. e = t) : (this.setPathHulls(this.nodes),
  18993. this.setFloorCurves(),
  18994. i && ("chevron" === D.path.style ? this.obj3d.add(this.drawPathPavement(this.floorCurvePoints)) : "ribbon" === D.path.style && this.obj3d.add(this.drawPathRibbon(this.floorCurvePoints, this.floorCurveColors)))),
  18995. this.player.currentPano.floor.add(this.obj3d);
  18996. var r = this.player.mode === O.DOLLHOUSE || this.player.mode === O.FLOORPLAN
  18997. , o = e === L.STD;
  18998. if (!n && (i || o)) {
  18999. if (r) {
  19000. var a = this.makeStartMarker(this.floorHull[0], this.floorCurvePoints);
  19001. this.obj3d.add(a)
  19002. }
  19003. var s = this.makeEndMarker(this.floorHull[this.floorHull.length - 1]);
  19004. this.obj3d.add(s)
  19005. }
  19006. this.appearSlow()
  19007. }
  19008. return this.upcomingTransType = e,
  19009. !n
  19010. }
  19011. ,
  19012. t.prototype.findShortestPath = function(e, t) {
  19013. if (!e || !t)
  19014. return null;
  19015. var i = D.warp.walkExtraPanosDistance
  19016. , n = e.id + ":" + t.id + ":" + i;
  19017. if (this.shortPaths.hasOwnProperty(n))
  19018. return this.shortPaths[n] ? this.shortPaths[n].slice() : null;
  19019. var r = t.id + ":" + e.id + ":" + i;
  19020. if (this.shortPaths.hasOwnProperty(r))
  19021. return this.shortPaths[r] ? this.shortPaths[r].slice().reverse() : null;
  19022. var o = this.model.panos.aStarSearch(e, t);
  19023. return this.model.panos.includeNodesNearPath(o, i),
  19024. this.shortPaths[n] = o ? o.slice() : null,
  19025. o
  19026. }
  19027. ,
  19028. t.prototype.makePathHulls = function(e) {
  19029. var t, i, n, r, o, a = 0, s = [], l = [], c = [], h = this.model.panos;
  19030. r = (t = h.get(e[0])).floor.floorIndex;
  19031. for (var u = 0; u < e.length; u += 1)
  19032. (i = (t = h.get(e[u])).floorPosition.clone().sub(this.model.position)).y += this.pathHeight(),
  19033. s.push(i),
  19034. l.push(t.position.clone()),
  19035. n = t.floor.floorIndex,
  19036. c.push(r < n ? D.path.colorUp : n < r ? D.path.colorDown : D.path.color),
  19037. 0 < u && (a < (o = l[u].distanceTo(l[u - 1])) && (a = o));
  19038. return a > this.longestStep && (this.longestStep = a,
  19039. H.debug("path contains " + a + " meter segment")),
  19040. {
  19041. floor: s,
  19042. camera: l,
  19043. color: c
  19044. }
  19045. }
  19046. ,
  19047. t.prototype.makeFloorCurves = function(e, t, i) {
  19048. var n = this.player.mode === O.PANORAMA ? D.path.waypointIndoorRadius : D.path.waypointRadius
  19049. , r = this.pointPathDistance(e) - 2 * n
  19050. , o = e.slice(0)
  19051. , a = o[1].clone().sub(o[0]);
  19052. a.y = 0,
  19053. a.normalize().multiplyScalar(n),
  19054. o[0] = (new P.Vector3).copy(o[0]).add(a),
  19055. (a = o[o.length - 2].clone().sub(o[o.length - 1])).y = 0,
  19056. a.normalize().multiplyScalar(n),
  19057. o[o.length - 1] = (new P.Vector3).copy(o[o.length - 1]).add(a);
  19058. var s = new P.CatmullRomCurve3(o)
  19059. , l = Math.floor(r / i);
  19060. l = 4 * Math.floor(l / 4),
  19061. l = Math.max(4, l);
  19062. for (var c, h, u = s.getSpacedPoints(l), d = [], p = new P.Vector3, f = 0; f < u.length; f += 1) {
  19063. h = 0,
  19064. c = u[f].distanceTo(e[0]);
  19065. for (var g = 1; g < e.length; g += 1)
  19066. p.copy(u[f]).sub(e[g]),
  19067. p.y *= 4,
  19068. p.length() < c && (h = g);
  19069. d.push(t[h])
  19070. }
  19071. return {
  19072. distance: r,
  19073. points: u,
  19074. colors: d
  19075. }
  19076. }
  19077. ,
  19078. t.prototype.makeCameraCurvePoints = function(e, t) {
  19079. var i = this.pointPathDistance(e);
  19080. return new P.CatmullRomCurve3(e).getSpacedPoints(Math.max(2, Math.floor(i / t)))
  19081. }
  19082. ,
  19083. t.prototype.makeCameraCurveTangents = function(e, t) {
  19084. var i = this.pointPathDistance(e)
  19085. , n = new P.CatmullRomCurve3(e)
  19086. , r = Math.max(2, Math.floor(i / t));
  19087. r = r || 5;
  19088. for (var o = [], a = 0; a <= r; a++)
  19089. o.push(n.getTangentAt(a / r));
  19090. return o
  19091. }
  19092. ,
  19093. t.prototype.setPathHulls = function(e) {
  19094. var t = this.makePathHulls(e);
  19095. this.floorHull = t.floor,
  19096. this.cameraHull = t.camera,
  19097. this.colorHull = t.color
  19098. }
  19099. ,
  19100. t.prototype.setFloorCurves = function() {
  19101. var e = this.makeFloorCurves(this.floorHull, this.colorHull, this.brushPrefs.paveStep);
  19102. this.floorPathDistance = e.distance,
  19103. this.floorCurvePoints = e.points,
  19104. this.floorCurveColors = e.colors
  19105. }
  19106. ,
  19107. t.prototype.setCameraCurvePoints = function() {
  19108. this.camCurvePoints = this.makeCameraCurvePoints(this.cameraHull, D.warp.stepFactor * this.brushPrefs.paveStep)
  19109. }
  19110. ,
  19111. t.prototype.chooseWarpPath = function(e) {
  19112. var t, i, n, r = this.playerControls.cameras[O.PANORAMA];
  19113. if (this.player.currentPano === this.warpDestPano || !e)
  19114. return this.warpPathPoints = null,
  19115. this.warpLength = 0,
  19116. !1;
  19117. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  19118. void 0 === this.nodes || null === this.nodes || this.nodes.length < 1 ? (H.debug("warp path to unreachable node"),
  19119. i = (t = this.warpDestPano.position.clone().sub(r.position)).clone().negate(),
  19120. t.multiplyScalar(.15).add(r.position),
  19121. i.multiplyScalar(.15).add(this.warpDestPano.position),
  19122. t.y = r.position.y,
  19123. i.y = this.warpDestPano.position.y,
  19124. n = new P.CubicBezierCurve3(r.position.clone(),t,i,this.warpDestPano.position.clone()),
  19125. this.warpPathPoints = n.getSpacedPoints(this.brushPrefs.cvSegments)) : (H.debug("follow warp path (path distance was " + this.nodes.length + " nodes, " + this.floorPathDistance + ")"),
  19126. this.setCameraCurvePoints(),
  19127. this.warpPathPoints = this.camCurvePoints.slice(0)),
  19128. this.warpLength = 0,
  19129. this.warpPathLengths = [0];
  19130. for (var o = new P.Vector3, a = new P.Vector3, s = Math.cos(P.Math.degToRad(D.warp.minBrakeAngle)), l = Math.cos(P.Math.degToRad(D.warp.maxBrakeAngle)), c = 1; c < this.warpPathPoints.length; c += 1) {
  19131. o.copy(this.warpPathPoints[c - 1]).sub(this.warpPathPoints[c]);
  19132. var h = o.length();
  19133. o.y *= D.warp.climbEffort;
  19134. var u = o.length() / h;
  19135. if (1 < c) {
  19136. o.setY(0).normalize(),
  19137. a.copy(this.warpPathPoints[c - 2]).sub(this.warpPathPoints[c - 1]).setY(0).normalize();
  19138. var d = Math.min(1, o.dot(a))
  19139. , p = 1 + (D.warp.brakeStrength - 1) * (1 - P.Math.smoothstep(d, l, s));
  19140. u = Math.max(p, u)
  19141. }
  19142. this.warpLength += h * u,
  19143. this.warpPathLengths[c] = this.warpLength
  19144. }
  19145. return !0
  19146. }
  19147. ,
  19148. t.prototype.drawPathRibbon = function(e, t) {
  19149. this.bunnyObj.visible = D.warp.showBunny;
  19150. for (var i = .6 * D.path.ribbonWidth * .5, n = new P.Vector3, r = new P.Vector3(0,this.pathHeight(),0), o = new P.Geometry, a = new P.Vector3, s = 0; s < e.length; s += 1) {
  19151. a.copy(e[s]),
  19152. 0 === s ? a.sub(e[s + 1]) : a.sub(e[s - 1]).negate(),
  19153. a.normalize(),
  19154. n.crossVectors(a, U.UP),
  19155. n.multiplyScalar(i);
  19156. var l = (new P.Vector3).copy(e[s]).add(r);
  19157. l.sub(n),
  19158. o.vertices.push(l),
  19159. (l = (new P.Vector3).copy(e[s]).add(r)).add(n),
  19160. o.vertices.push(l)
  19161. }
  19162. var c, h, u, d = 0;
  19163. for (s = 0; s < e.length - 1; s += 1) {
  19164. var p = 2 * s
  19165. , f = d
  19166. , g = d += e[s + 1].distanceTo(e[s])
  19167. , m = t[s]
  19168. , v = t[s + 1];
  19169. (c = new P.Face3(p,1 + p,2 + p)).vertexColors = [new P.Color(m), new P.Color(m), new P.Color(v)],
  19170. o.faces.push(c),
  19171. o.faceVertexUvs[0].push([new P.Vector2(0,f), new P.Vector2(1,f), new P.Vector2(0,g)]),
  19172. (c = new P.Face3(2 + p,1 + p,3 + p)).vertexColors = [new P.Color(v), new P.Color(m), new P.Color(v)],
  19173. o.faces.push(c),
  19174. o.faceVertexUvs[0].push([new P.Vector2(0,g), new P.Vector2(1,f), new P.Vector2(1,g)])
  19175. }
  19176. o.computeFaceNormals(),
  19177. o.computeVertexNormals(),
  19178. h = this.player.mode === O.PANORAMA ? ((u = P.UniformsUtils.clone(C.ribbon.uniforms)).map.value = I.path,
  19179. u.opacity.value = 0,
  19180. u.color.value.set(D.path.color),
  19181. new P.RawShaderMaterial({
  19182. side: P.DoubleSide,
  19183. depthWrite: !1,
  19184. transparent: !0,
  19185. vertexShader: C.ribbon.vertexShader,
  19186. fragmentShader: C.ribbon.fragmentShader,
  19187. uniforms: u,
  19188. name: "ribbonT",
  19189. opacity: 0
  19190. })) : new P.MeshBasicMaterial({
  19191. color: 16777215,
  19192. side: P.DoubleSide,
  19193. name: "ribbonOut",
  19194. vertexColors: P.VertexColors
  19195. });
  19196. var y = new P.Mesh(o,h);
  19197. return y.name = "ribbon",
  19198. this.player.mode === O.PANORAMA && (y.renderOrder = A.ribbon),
  19199. y
  19200. }
  19201. ,
  19202. t.prototype.drawPathPavement = function(e) {
  19203. for (var t, i = new P.Vector3, n = new P.Geometry, r = new P.Vector3, o = 0; o < e.length; o += 1)
  19204. r.copy(e[o]),
  19205. 0 === o ? r.sub(e[o + 1]).negate() : r.sub(e[o - 1]),
  19206. r.normalize(),
  19207. i.crossVectors(r, U.UP),
  19208. i.multiplyScalar(this.brushPrefs.paveWidth),
  19209. (t = (new P.Vector3).copy(e[o])).sub(i),
  19210. n.vertices.push(t),
  19211. n.vertices.push((new P.Vector3).copy(e[o])),
  19212. (t = (new P.Vector3).copy(e[o])).add(i),
  19213. n.vertices.push(t);
  19214. var a, s, l;
  19215. for (o = 0; o < e.length - 1; o += 1)
  19216. a = 3 * o + 1,
  19217. l = .25 + (s = .25 * o),
  19218. n.faces.push(new P.Face3(a - 1,a,3 + a)),
  19219. n.faceVertexUvs[0].push([new P.Vector2(0,s), new P.Vector2(.5,s), new P.Vector2(.5,l)]),
  19220. n.faces.push(new P.Face3(3 + a,2 + a,a - 1)),
  19221. n.faceVertexUvs[0].push([new P.Vector2(.5,l), new P.Vector2(0,l), new P.Vector2(0,s)]),
  19222. n.faces.push(new P.Face3(3 + a,a,1 + a)),
  19223. n.faceVertexUvs[0].push([new P.Vector2(.5,l), new P.Vector2(.5,s), new P.Vector2(1,s)]),
  19224. n.faces.push(new P.Face3(3 + a,1 + a,4 + a)),
  19225. n.faceVertexUvs[0].push([new P.Vector2(.5,l), new P.Vector2(1,s), new P.Vector2(1,l)]);
  19226. var c = this.player.mode === O.PANORAMA ? new P.MeshBasicMaterial({
  19227. color: D.path.color,
  19228. side: P.DoubleSide,
  19229. transparent: !0,
  19230. depthWrite: !1,
  19231. opacity: 0,
  19232. name: "paveT",
  19233. map: I.path
  19234. }) : new P.MeshBasicMaterial({
  19235. color: D.path.color,
  19236. side: P.DoubleSide,
  19237. transparent: !0,
  19238. depthWrite: !1,
  19239. opacity: 1,
  19240. name: "paveO",
  19241. map: I.path
  19242. });
  19243. return new P.Mesh(n,c)
  19244. }
  19245. ,
  19246. t.prototype.hintPrefs = {
  19247. rad: .18,
  19248. width: .0125,
  19249. depth: .0625,
  19250. setBack: -.04,
  19251. markRad: .25,
  19252. markInnerRad: .16
  19253. },
  19254. t.prototype.makeWaypointObj = function(e, t) {
  19255. var i = new P.Geometry
  19256. , n = this.player.mode === O.PANORAMA ? D.path.waypointIndoorRadius : D.path.waypointRadius
  19257. , r = this.pathHeight();
  19258. i.vertices.push(new P.Vector3(-n,r,n), new P.Vector3(-n,r,-n), new P.Vector3(n,r,-n), new P.Vector3(n,r,n)),
  19259. i.faces.push(new P.Face3(0,1,2), new P.Face3(2,3,0)),
  19260. i.faceVertexUvs[0].push([new P.Vector2(0,0), new P.Vector2(1,0), new P.Vector2(1,1)]),
  19261. i.faceVertexUvs[0].push([new P.Vector2(1,1), new P.Vector2(0,1), new P.Vector2(0,0)]);
  19262. var o = P.UniformsUtils.clone(C.waypoint.uniforms);
  19263. o.map.value = e,
  19264. o.opacity.value = 0,
  19265. o.color.value.set(D.path.color);
  19266. var a = {
  19267. side: P.DoubleSide,
  19268. depthWrite: !1,
  19269. transparent: !0,
  19270. vertexShader: C.waypoint.vertexShader,
  19271. fragmentShader: C.waypoint.fragmentShader,
  19272. uniforms: o,
  19273. name: "waypoint",
  19274. opacity: 0
  19275. };
  19276. this.player.mode !== O.PANORAMA && (a.depthTest = !1,
  19277. a.name = "wayPtOut");
  19278. var s = new P.RawShaderMaterial(a)
  19279. , l = new P.Mesh(i,s);
  19280. return l.name = t,
  19281. l
  19282. }
  19283. ,
  19284. t.prototype.makeStartMarker = function(e, t) {
  19285. var i = (new P.Vector3).copy(t[1]).sub(t[0]);
  19286. i.y = 0,
  19287. i.normalize();
  19288. var n = Math.acos(i.x)
  19289. , r = this.makeWaypointObj(I.pathStart, "Start");
  19290. return r.rotateOnAxis(new P.Vector3(0,1,0), n),
  19291. r.position.copy(e),
  19292. r
  19293. }
  19294. ,
  19295. t.prototype.makeEndMarker = function(e) {
  19296. var t = this.makeWaypointObj(I.pathEnd, "End")
  19297. , i = this.model.panos.get(this.nodes[0]).floor.floorIndex
  19298. , n = this.model.panos.get(this.nodes[this.nodes.length - 1]).floor.floorIndex;
  19299. return i < n ? t.material.uniforms.color.value.set(D.path.colorUp) : n < i && t.material.uniforms.color.value.set(D.path.colorDown),
  19300. t.position.copy(e),
  19301. t
  19302. }
  19303. ,
  19304. t.prototype.pathClean = function(e) {
  19305. if (e) {
  19306. for (var t in e.children)
  19307. this.pathClean(e.children[t]);
  19308. e.geometry && e.geometry.dispose(),
  19309. e.material && e.material.dispose()
  19310. }
  19311. }
  19312. ,
  19313. t.prototype.discardPathObject = function() {
  19314. if (this.obj3d) {
  19315. var e = this.obj3d.parent;
  19316. e && e.remove(this.obj3d),
  19317. this.pathClean(this.obj3d)
  19318. }
  19319. this.obj3d = null,
  19320. this.popInCpm()
  19321. }
  19322. ,
  19323. t.prototype.discardSlow = function() {
  19324. if (this.obj3d) {
  19325. if (this.player.mode !== O.PANORAMA)
  19326. return void this.discardPathObject();
  19327. for (var e, t = 0, i = function() {
  19328. this.discardPathObject()
  19329. }
  19330. .bind(this), n = 0; n < this.obj3d.children.length; n += 1)
  19331. void 0 !== (e = this.obj3d.children[n]).material && !0 === e.material.transparent && (void 0 !== e.material.uniforms ? V.start(F.property(e.material.uniforms.opacity, "value", 0), D.path.fadeOutTime, i, 0, B[D.warp.blendEasing]) : V.start(F.property(e.material, "opacity", 0), D.path.fadeOutTime, i, 0, B[D.warp.blendEasing]),
  19332. t += 1,
  19333. i = null);
  19334. 0 === t && this.discardPathObject(),
  19335. this.player.mode !== O.PANORAMA && this.fadeInCpm(D.path.fadeInTime - 3)
  19336. }
  19337. }
  19338. ,
  19339. t.prototype.appearSlow = function() {
  19340. var e;
  19341. this.fadeOutCpm(D.path.fadeInTime);
  19342. for (var t = this.player.mode === O.PANORAMA ? D.path.opacity : 1, i = 0; i < this.obj3d.children.length; i += 1)
  19343. void 0 !== (e = this.obj3d.children[i]).material && !0 === e.material.transparent && (void 0 !== e.material.uniforms ? V.start(F.property(e.material.uniforms.opacity, "value", t), D.path.fadeInTime, null, 0, B[D.warp.blendEasing]) : V.start(F.property(e.material, "opacity", t), D.path.fadeInTime, null, 0, B[D.warp.blendEasing]))
  19344. }
  19345. ,
  19346. t.prototype.update = function() {
  19347. this.obj3d && this.obj3d.updateMatrixWorld()
  19348. }
  19349. ,
  19350. t.prototype.calcBurnsAmount = function(e) {
  19351. var n = P.Math.degToRad(D.warp.burnsAngle);
  19352. if (this.player.mode !== O.PANORAMA)
  19353. return this.player.mode === O.DOLLHOUSE ? .02 * this.burnsDir : this.burnsDir;
  19354. var t = this.burnsDir * n;
  19355. if (this.upcomingTransType === L.BLACK)
  19356. return t;
  19357. var i = e;
  19358. if (null === i)
  19359. return H.warn("Transition request for non-highlight"),
  19360. t;
  19361. var r = this.getHeroDescriptorByHeroIndex(i);
  19362. if (null === r)
  19363. return t;
  19364. if (!r.isPano())
  19365. return t;
  19366. function o(e) {
  19367. var t = Math.acos(Math.min(1, e.dot(l)))
  19368. , i = (new P.Vector3).crossVectors(l, e);
  19369. return Math.max(c, Math.min(Math.abs(t), n)) * Math.sign(i.y)
  19370. }
  19371. var a = this.getHeroPano(r)
  19372. , s = this.playerControls.cameras[O.PANORAMA]
  19373. , l = U.FORWARD.clone().applyQuaternion(s.quaternion).setY(0).normalize()
  19374. , c = Math.min(P.Math.degToRad(D.warp.minBurnsAngle), n);
  19375. if (a === this.player.currentPano)
  19376. return o(U.FORWARD.clone().applyQuaternion(r.quaternion).setY(0).normalize());
  19377. var h = this.findShortestPath(this.player.currentPano, a);
  19378. if (null == h || h.length < 1)
  19379. return H.debug("Empty path ahead..."),
  19380. t;
  19381. var u = this.makePathHulls(h)
  19382. , d = new P.CatmullRomCurve3(u.camera)
  19383. , p = Math.min(.1, D.warp.lookAheadDist / d.getLength());
  19384. return o(d.getPointAt(p).clone().sub(s.position).setY(0).normalize())
  19385. }
  19386. ,
  19387. t.prototype.waitNextStep = function(e, t, i) {
  19388. var o = null == i ? D.warp.tourStepDelay : i;
  19389. o = o || (this.lastTransType === L.BLACK ? m.tourStepDelaySlideShow : m.tourStepDelayDefault);
  19390. var a = new P.Euler
  19391. , s = new P.Vector3;
  19392. H.debug("Starting wait: " + (void 0 !== t));
  19393. var l = this.calcBurnsAmount(e)
  19394. , c = function() {
  19395. this.endWarpState(),
  19396. this.player.mode === O.DOLLHOUSE && (this.playerControls.cameras[O.DOLLHOUSE].controls.rotationAcceleration.x = 0),
  19397. t && t()
  19398. }
  19399. .bind(this)
  19400. , n = function(e, t) {
  19401. if (this.warpInterrupted)
  19402. return c(),
  19403. !0;
  19404. var i = t || 1e3 / 60;
  19405. if (D.warp.doBurns)
  19406. if (this.player.mode === O.PANORAMA) {
  19407. var n = this.playerControls.cameras[O.PANORAMA];
  19408. a.setFromQuaternion(n.quaternion, D.warp.eOrder);
  19409. var r = i * l / o;
  19410. a.y += r,
  19411. s.set(0, 0, -1),
  19412. s.applyEuler(a),
  19413. s.add(n.position),
  19414. n.controls.lookAt(s),
  19415. n.controls.lookVector.copy(s),
  19416. n.lookAt(s)
  19417. } else
  19418. this.player.mode === O.DOLLHOUSE ? this.playerControls.controls[O.DOLLHOUSE].rotationAcceleration.x = l : this.playerControls.controls[O.FLOORPLAN].absoluteScale *= .9996
  19419. }
  19420. .bind(this);
  19421. this.startWarpState(),
  19422. V.start(n, o, c, 0, B.easeInOutQuad, "wait");
  19423. /* var r = player.model.heroLocations[app.director.currentItem];
  19424. this.player.zoomEnabled = !0;
  19425. var h = function(e, t) {
  19426. //console.log(e),
  19427. this.player.zoomTo(e * r.zoom.toFixed(2), !0)
  19428. }
  19429. .bind(this);
  19430. V.start(h, 2e3, null, 0, B.easeOutQuad, "zoom") */
  19431. }
  19432. ,
  19433. t.prototype.warpToNonPano = function(e) {
  19434. if (this.discardPathObject(),
  19435. this.warpDestHeroLoc.cameraMode === O.DOLLHOUSE || this.warpDestHeroLoc.cameraMode === O.FLOORPLAN) {
  19436. var t = function() {
  19437. e && e()
  19438. }
  19439. .bind(this);
  19440. this.player.flyToNewMode({
  19441. mode: this.warpDestHeroLoc.cameraMode,
  19442. duration: D.warp.outsideTime,
  19443. warpDest: this.warpDestHeroLoc,
  19444. callback: t,
  19445. force: !0
  19446. })
  19447. } else
  19448. H.warn("no warp destination!!!"),
  19449. e && e()
  19450. }
  19451. ,
  19452. t.prototype._resetWarpShaderParams = function(e) {
  19453. this.player.mode === O.PANORAMA && (void 0 !== e.material.uniforms.blackout && (e.material.uniforms.blackout.value = 0),
  19454. void 0 !== e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = 0))
  19455. }
  19456. ,
  19457. t.prototype._clearWarpShading = function() {
  19458. for (var e = this.model.chunks, t = 0; t < e.length; t += 1)
  19459. this._resetWarpShaderParams(e[t]),
  19460. e[t].visible = !0;
  19461. this._resetWarpShaderParams(this.model.skybox)
  19462. }
  19463. ,
  19464. t.prototype._warpStopFlying = function() {
  19465. this.activeTransType = null,
  19466. this.placeCpm()
  19467. }
  19468. ,
  19469. t.prototype._wrapupTravelOnlyBits = function() {
  19470. this._warpStopFlying(),
  19471. this.warpPathPoints && (this.player.currentPano.exit(),
  19472. this.warpDestPano.enter(),
  19473. this.player.currentPano = this.warpDestPano),
  19474. this.player.spider.draw(),
  19475. this.placeCpm()
  19476. }
  19477. ,
  19478. t.prototype._wrapupTravel = function(e) {
  19479. this._wrapupTravelOnlyBits(),
  19480. this.warpCameraAim(e)
  19481. }
  19482. ,
  19483. t.prototype._wrapupWarpShading = function(e) {
  19484. this._clearWarpShading(),
  19485. this._wrapupTravel(e)
  19486. }
  19487. ,
  19488. t.prototype.wrapupWarpShadingOnly = function(e, t) {
  19489. t !== z.END && this._clearWarpShading(),
  19490. this._wrapupTravelOnlyBits(),
  19491. this.upcomingTransType = null,
  19492. e && e()
  19493. }
  19494. ,
  19495. t.prototype._warpCameraAim = function(e, t) {
  19496. var i = this.warpDestHeroLoc.quaternion
  19497. , n = this.playerControls.cameras[O.PANORAMA]
  19498. , r = new P.Vector3(0,0,1).applyQuaternion(i).normalize()
  19499. , o = new P.Vector3(0,0,1).applyQuaternion(n.quaternion).normalize().dot(r)
  19500. , a = P.Math.radToDeg(Math.acos(o))
  19501. , s = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(i, D.warp.eOrder)
  19502. , l = (new P.Euler).setFromQuaternion(n.quaternion, D.warp.eOrder)
  19503. , c = new P.Euler(s.x - l.x,s.y - l.y,s.z - l.z,D.warp.eOrder);
  19504. c.y = N.constrainedTurn(c.y),
  19505. this.burnsDir = Math.sign(c.y);
  19506. var h = new P.Euler(0,0,0,D.warp.eOrder)
  19507. , u = new P.Vector3
  19508. , d = function(e, t) {
  19509. return !!this.warpInterrupted || (h.x = l.x + e * c.x,
  19510. h.y = l.y + e * c.y,
  19511. h.z = l.z + e * c.z,
  19512. u.set(0, 0, -1),
  19513. u.applyEuler(h),
  19514. u.add(n.position),
  19515. n.controls.lookAt(u),
  19516. n.controls.lookVector.copy(u),
  19517. void n.lookAt(u))
  19518. }
  19519. .bind(this);
  19520. return a > D.warp.minRotation ? V.start(d, e, t, 0, B[D.warp.movementEasing]) : (H.info("Aim angle only is " + a.toPrecision(3) + " degrees, skipping explicit re-aim"),
  19521. void (t && t()))
  19522. }
  19523. ,
  19524. t.prototype._warpBendAim = function(e, t, i, n) {
  19525. var r = n || 0
  19526. , o = this.playerControls.cameras[O.PANORAMA]
  19527. , a = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19528. , s = (new P.Euler).setFromQuaternion(o.quaternion, D.warp.eOrder)
  19529. , l = new P.Euler(a.x - s.x,a.y - s.y,a.z - s.z,D.warp.eOrder);
  19530. l.y = N.constrainedTurn(l.y);
  19531. var c = Math.min(P.Math.degToRad(D.warp.softBendTilt), Math.abs(l.x));
  19532. l.x = c * Math.sign(l.x),
  19533. c = Math.min(P.Math.degToRad(Math.max(0, D.warp.softBendAngle)), c),
  19534. this.burnsDir = Math.sign(l.y),
  19535. c *= Math.sign(l.y),
  19536. l.y = c;
  19537. var h = new P.Euler(0,0,0,D.warp.eOrder)
  19538. , u = new P.Vector3
  19539. , d = function(e, t) {
  19540. if (e < .5)
  19541. h.x = s.x + e * l.x,
  19542. h.y = s.y + e * l.y,
  19543. h.z = s.z + e * l.z;
  19544. else {
  19545. var i = (1 - e) * D.warp.softBendEnd;
  19546. h.x = a.x - i * l.x,
  19547. h.y = a.y - i * l.y,
  19548. h.z = a.z - i * l.z
  19549. }
  19550. u.set(0, 0, -1),
  19551. u.applyEuler(h),
  19552. u.add(o.position),
  19553. o.controls.lookAt(u),
  19554. o.controls.lookVector.copy(u),
  19555. o.lookAt(u)
  19556. }
  19557. .bind(this);
  19558. return V.start(d, t, i, r, B[D.warp.movementEasing])
  19559. }
  19560. ,
  19561. t.prototype._warpStepCameraAim = function(e, t, i) {
  19562. var n = this.playerControls.cameras[O.PANORAMA]
  19563. , r = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19564. , o = (new P.Euler).setFromQuaternion(n.quaternion, D.warp.eOrder)
  19565. , a = new P.Euler(r.x - o.x,r.y - o.y,r.z - o.z,D.warp.eOrder);
  19566. a.y = N.constrainedTurn(a.y),
  19567. this.burnsDir = Math.sign(a.y);
  19568. var s = new P.Euler(0,0,0,D.warp.eOrder)
  19569. , l = new P.Vector3
  19570. , c = function(e, t) {
  19571. e < .5 ? s.copy(o) : s.copy(r),
  19572. l.set(0, 0, -1),
  19573. l.applyEuler(s),
  19574. l.add(n.position),
  19575. n.controls.lookAt(l),
  19576. n.controls.lookVector.copy(l),
  19577. n.lookAt(l)
  19578. }
  19579. .bind(this);
  19580. return V.start(c, t, i, 0, B[D.warp.movementEasing])
  19581. }
  19582. ,
  19583. t.prototype.setBurnsDir = function() {
  19584. var e = this.playerControls.cameras[O.PANORAMA]
  19585. , t = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19586. , i = (new P.Euler).setFromQuaternion(e.quaternion, D.warp.eOrder)
  19587. , n = new P.Euler(t.x - i.x,t.y - i.y,t.z - i.z,D.warp.eOrder);
  19588. n.y = N.constrainedTurn(n.y),
  19589. this.burnsDir = Math.sign(n.y)
  19590. }
  19591. ,
  19592. t.prototype.stepWarpPath = function(e, t) {
  19593. var i = this.playerControls.cameras[O.PANORAMA];
  19594. if (!this.warpPathPoints)
  19595. return i.position.copy(this.warpDestPano.position),
  19596. !0;
  19597. var n = this.warpPathPoints[0]
  19598. , r = this.warpDestPano.position;
  19599. if (null !== this.nodes && 1 < this.cameraHull.length) {
  19600. var o = new P.Vector3;
  19601. e < .5 ? o.copy(this.cameraHull[1]).sub(n).normalize().multiplyScalar(D.warp.softPushDist * e).add(n) : o.copy(this.cameraHull[this.cameraHull.length - 2]).sub(r).normalize().multiplyScalar(D.warp.softPushDist * D.warp.softPushEnd * (1 - e)).add(r),
  19602. i.position.copy(o)
  19603. } else
  19604. e < .5 ? i.position.copy(n) : i.position.copy(r)
  19605. }
  19606. ,
  19607. t.prototype.interruptAndFastForward = function(e, t) {
  19608. this.warping && (this.warpInterrupted = !0,
  19609. this.warpInterruptionBlackoutStyle = e,
  19610. this.warpInterruptionTravelTime = t,
  19611. null !== this.warpInterruptionBlackoutStyle && void 0 !== this.warpInterruptionBlackoutStyle || (this.warpInterruptionBlackoutStyle = z.MIDDLE),
  19612. null !== this.warpInterruptionTravelTime && void 0 !== this.warpInterruptionTravelTime || (this.warpInterruptionTravelTime = D.minWarpTime))
  19613. }
  19614. ,
  19615. t.prototype.warpCameraAim = function(e) {
  19616. var t = D.warp.minWarpTime;
  19617. if (this.upcomingTransType === L.BLACK)
  19618. t = D.warp.teleportTime;
  19619. else {
  19620. var i = this.playerControls.cameras[O.PANORAMA]
  19621. , n = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19622. , r = (new P.Euler).setFromQuaternion(i.quaternion, D.warp.eOrder)
  19623. , o = new P.Euler(n.x - r.x,n.y - r.y,n.z - r.z,D.warp.eOrder);
  19624. o.y = N.constrainedTurn(o.y);
  19625. var a = 1e3 * Math.abs(o.y) / P.Math.degToRad(D.warp.maxAimPerSec);
  19626. t = Math.max(t, a)
  19627. }
  19628. var s = function() {
  19629. this._warpStopFlying(),
  19630. this.discardSlow(),
  19631. e && e()
  19632. }
  19633. .bind(this);
  19634. this._warpCameraAim(t, s)
  19635. }
  19636. ,
  19637. t.prototype.warpCommonParameters = function(e, t, i, n) {
  19638. this.model.skybox.material.uniforms.blackout.value = n;
  19639. var r = F.uniform(this.model.skybox, "progress", 1)
  19640. , o = F.allUniforms(this.model.chunks, "progress", 1)
  19641. , a = !1
  19642. , s = function() {
  19643. if (this.warpInterrupted)
  19644. return a = !0
  19645. }
  19646. .bind(this)
  19647. , l = function(e, t) {
  19648. return i && a ? !(this.model.skybox.material.uniforms.progress.value = 0) : void r(e, t)
  19649. }
  19650. .bind(this)
  19651. , c = function(e, t) {
  19652. return i && a ? (o(0),
  19653. !0) : void o(e, t)
  19654. }
  19655. .bind(this);
  19656. V.start(s, e, null, t, null, "safeHaltWatch"),
  19657. V.start(l, e, null, t, B[D.warp.blendEasing], "skyboxProgress"),
  19658. V.start(c, e, null, t, B[D.warp.blendEasing], "chunkProgress")
  19659. }
  19660. ,
  19661. t.prototype.warpTravel_STD = function(e) {
  19662. var l, c = Math.min(D.warp.lookAheadMax, D.warp.lookAheadDist / this.warpLength), h = this.playerControls.cameras[O.PANORAMA], i = (Math.min(.25, 3 / this.warpLength),
  19663. Math.min(.35, 7 / this.warpLength)), u = new P.Euler(0,0,0,D.warp.eOrder), d = new P.Vector3, p = (new P.Euler).setFromQuaternion(h.quaternion, D.warp.eOrder), f = (new P.Euler).copy(p), g = h.position.clone(), m = new P.Matrix4, v = new P.Euler, t = D.warp.minWarpTime;
  19664. t += this.warpLength * D.warp.timePerMeter,
  19665. .01 < D.warp.flySpeed && (t = 1e3 * this.warpLength / D.warp.flySpeed);
  19666. function n(e) {
  19667. var t = i;
  19668. return P.Math.smoothstep(e, 0, t) * (1 - P.Math.smoothstep(e, 1 - t, 1))
  19669. }
  19670. var y = !1
  19671. , r = this.warpDestHeroLoc.quaternion
  19672. , o = new P.Vector3(0,0,-1).applyQuaternion(r).normalize()
  19673. , A = this.warpPathPoints[this.warpPathPoints.length - 1].clone().sub(this.warpPathPoints[this.warpPathPoints.length - 2]).normalize()
  19674. , a = A.dot(o)
  19675. , C = P.Math.radToDeg(Math.acos(a))
  19676. , s = function() {
  19677. return m.lookAt(g, l, U.UP),
  19678. u.setFromRotationMatrix(m, D.warp.eOrder),
  19679. p.setFromQuaternion(h.quaternion, D.warp.eOrder),
  19680. v.set(u.x - p.x, u.y - p.y, u.z - p.z, D.warp.eOrder),
  19681. N.constrainedTurn(v.y)
  19682. }
  19683. .bind(this)
  19684. , I = function(e, t) {
  19685. if (this.warpInterrupted)
  19686. return y = !0
  19687. }
  19688. .bind(this)
  19689. , E = function(e, t) {
  19690. return y || !this.warpPathPoints ? (k.blur(0),
  19691. !0) : void k.blur(e)
  19692. }
  19693. .bind(this)
  19694. , _ = F.allUniforms(this.model.chunks, "modelAlpha", 1)
  19695. , b = function(e, t) {
  19696. return y || !this.warpPathPoints ? (_(0),
  19697. !0) : void _(e, t)
  19698. }
  19699. .bind(this)
  19700. , w = function(e, t) {
  19701. if (!this.warpPathPoints)
  19702. return h.position.copy(this.warpDestPano.position),
  19703. !0;
  19704. if (y)
  19705. return !0;
  19706. var i = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, e);
  19707. h.position.copy(i),
  19708. g = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, .99 * e)
  19709. }
  19710. .bind(this)
  19711. , T = function(e, t) {
  19712. return this.warpPathPoints ? !!y || void (l = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, Math.min(e + c, 1))) : (H.debug("Lost bunny."),
  19713. !0)
  19714. }
  19715. .bind(this)
  19716. , x = function(e, t) {
  19717. if (y)
  19718. return H.debug(">>>> Walkthrough interupted at t=" + e),
  19719. !0;
  19720. if (!this.warpPathPoints)
  19721. return !0;
  19722. var i = this.warpLength * e
  19723. , n = P.Math.smoothstep(i, 0, this.brushPrefs.lookBlendDist)
  19724. , r = P.Math.smoothstep(i, this.warpLength - this.brushPrefs.lookBlendDist, this.warpLength);
  19725. D.warp.matchCam && (n *= 1 - r),
  19726. m.lookAt(g, l, U.UP),
  19727. u.setFromRotationMatrix(m, D.warp.eOrder),
  19728. p.setFromQuaternion(h.quaternion, D.warp.eOrder),
  19729. v.set(u.x - p.x, u.y - p.y, u.z - p.z, D.warp.eOrder),
  19730. v.y = N.constrainedTurn(v.y),
  19731. u.x = p.x + n * v.x,
  19732. u.y = p.y + n * v.y,
  19733. u.z = p.z + n * v.z,
  19734. v.set(u.x - f.x, u.y - f.y, u.z - f.z, D.warp.eOrder),
  19735. v.y = N.constrainedTurn(v.y);
  19736. var o = P.Math.degToRad(D.warp.maxTurnPerSec) * t / 1e3;
  19737. v.y = Math.sign(v.y) * Math.min(o, Math.abs(v.y)),
  19738. f.x = f.x + v.x * D.warp.turnFriction,
  19739. f.y = f.y + v.y * D.warp.turnFriction,
  19740. f.z = f.z + v.z * D.warp.turnFriction,
  19741. f.x = Math.max(P.Math.degToRad(D.warp.minDownAngle), f.x);
  19742. var a = l.clone().sub(g).normalize();
  19743. if (C < D.warp.maxAimRotation && 0 < r) {
  19744. var s = 1 - r;
  19745. a.x = a.x * s + r * A.x,
  19746. a.y = a.y * s + r * A.y,
  19747. a.z = a.z * s + r * A.z,
  19748. a.normalize()
  19749. }
  19750. this.bunnyObj.position.copy(h.position).add(a),
  19751. d.set(0, 0, -1).applyEuler(f).normalize(),
  19752. d.multiplyScalar(8),
  19753. d.add(h.position),
  19754. 1 - c < e && D.warp.matchCam || (h.controls.lookAt(d),
  19755. h.controls.lookVector.copy(d),
  19756. h.lookAt(d))
  19757. }
  19758. .bind(this)
  19759. , S = function() {
  19760. y ? (this.discardSlow(),
  19761. this.upcomingTransType = L.BLACK,
  19762. this.warpTravel_BLACK(-.5, this.warpInterruptionTravelTime, z.BEGINNING, e)) : this._wrapupWarpShading(e)
  19763. }
  19764. .bind(this);
  19765. T(0);
  19766. var M = D.warp.motionLeadTime + 1e3 * Math.abs(s()) / P.Math.degToRad(D.warp.maxTurnPerSec)
  19767. , R = M / (t += M);
  19768. this.warpCommonParameters(t, R, !0, z.NONE),
  19769. V.start(I, t, null, 0, null, "_haltWatcher"),
  19770. 0 < D.warp.blur && (k.blurStrength = D.warp.blur,
  19771. V.start(E, t, null, R, n, "blurring")),
  19772. V.start(b, t, null, R, n, "modelAlpha"),
  19773. V.start(w, t, null, R, B[D.warp.blendEasing], "followPath"),
  19774. V.start(T, t, null, R, B[D.warp.blendEasing], "goBunny"),
  19775. V.start(x, t, S, 0, B[D.warp.blendEasing], "lookAtBunny")
  19776. }
  19777. ,
  19778. t.prototype.warpTravel_BLACK = function(e, t, i, n) {
  19779. var r = e || 0;
  19780. null != t || (t = D.warp.teleportTime),
  19781. this.warpCommonParameters(t, r, !1, i),
  19782. this.model.chunks.forEach(function(e) {
  19783. e.material.uniforms.blackout.value = i
  19784. }),
  19785. this._warpBendAim(null, t, null, r);
  19786. var o = function() {
  19787. this.wrapupWarpShadingOnly(n, i)
  19788. }
  19789. .bind(this);
  19790. V.start(this.stepWarpPath.bind(this), t, o, r, B[D.warp.blendEasing], "stepMotion")
  19791. }
  19792. ,
  19793. t.prototype.flightStepWalk = (a = new P.Vector3,
  19794. s = new P.Vector3,
  19795. function(e, t, i) {
  19796. if (this.warpInterrupted)
  19797. i && i();
  19798. else if (this.activeTransType !== L.WALK)
  19799. this._clearWarpShading(),
  19800. this._warpStopFlying(),
  19801. this.player.spider.draw(),
  19802. this.placeCpm(),
  19803. i && i();
  19804. else if (this.player.currentPano !== e) {
  19805. var n = {
  19806. pano: e,
  19807. lookAtPoint: t,
  19808. duration: null,
  19809. maxDistanceOverride: D.warp.walkMaxDist,
  19810. skipWarpingCheck: !1,
  19811. constantMoveSpeed: !0
  19812. };
  19813. n.duration = function(e, t) {
  19814. var i = Math.min(this.player.position.distanceTo(e.position), D.transition.flytimeMaxDistanceThreshold) * D.transition.flytimeDistanceMultiplier + D.transition.flyTime;
  19815. s.copy(U.FORWARD),
  19816. this.player.getDirection(s),
  19817. a.copy(t).sub(e.position).normalize();
  19818. var n = a.dot(s)
  19819. , r = Math.acos(n)
  19820. , o = r / i;
  19821. return .001 < o && (i *= o / .001,
  19822. r < 1 && (i *= 1.2)),
  19823. i
  19824. }
  19825. .call(this, e, t),
  19826. this.player.nonInterruptingFlyToPano(n, i)
  19827. } else
  19828. i && i()
  19829. }
  19830. ),
  19831. t.prototype.makeWalkFlightFunc = function(e, t, i) {
  19832. return this.flightStepWalk.bind(this, e, t, i)
  19833. }
  19834. ,
  19835. t.prototype.warpTravel_WALK = (f = [],
  19836. function(e) {
  19837. for (var t = this.player.model.panos, i = null, n = !1, r = f.length = 0; r < this.nodes.length; r++) {
  19838. var o = this.nodes[r]
  19839. , a = t.get(o);
  19840. this.nodes.length,
  19841. n = i && a.position.distanceTo(i.position) < D.warp.walkMinDist,
  19842. i && n || (f.push(o),
  19843. i = a)
  19844. }
  19845. n && 1 < this.nodes.length && (f[f.length - 1] = this.nodes[this.nodes.length - 1]);
  19846. var s = f.length
  19847. , l = t.get(f[s - 1])
  19848. , c = new Array(s + 1);
  19849. c[c.length - 1] = function() {
  19850. e && e()
  19851. }
  19852. .bind(this);
  19853. for (var h = s - 1, u = c.length - 1; 0 < u; u -= 1) {
  19854. var d = f[h];
  19855. l = t.get(d);
  19856. var p = new P.Vector3;
  19857. this.getLookAtForWalkingTourNode(f, h, p),
  19858. c[u - 1] = this.makeWalkFlightFunc(l, p, c[u]),
  19859. h--
  19860. }
  19861. c[0]()
  19862. }
  19863. ),
  19864. t.prototype.getLookAtForWalkingTourNode = (c = new P.Vector3,
  19865. h = new P.Vector3,
  19866. u = new P.Vector3,
  19867. d = new P.Vector3,
  19868. p = new P.Vector3,
  19869. function(e, t, i) {
  19870. var n = e.length;
  19871. if (n <= t)
  19872. return !1;
  19873. var r = 1
  19874. , o = 1;
  19875. h.set(0, 0, 0),
  19876. p.set(0, 0, 0);
  19877. for (var a = null, s = t; s < t + 3 && !(n <= s); s++) {
  19878. if (a = this.player.model.panos.get(e[s]),
  19879. this.getOrientationForWalkingTourNode(e, s, u),
  19880. s === t && c.copy(u),
  19881. d.copy(u),
  19882. t < s) {
  19883. var l = d.dot(c) < .65;
  19884. r *= l ? .2 : .75,
  19885. o *= l ? .2 : .4
  19886. }
  19887. u.multiplyScalar(r),
  19888. h.add(u),
  19889. p.lerp(a.position, o)
  19890. }
  19891. return h.normalize(),
  19892. i.copy(p),
  19893. i.add(h),
  19894. !0
  19895. }
  19896. ),
  19897. t.prototype.getOrientationForWalkingTourNode = function(e, t, i) {
  19898. var n = e.length;
  19899. if (n <= t)
  19900. return !1;
  19901. if (t === n - 1)
  19902. i.copy(U.FORWARD).applyQuaternion(this.warpDestHeroLoc.quaternion);
  19903. else {
  19904. var r = this.player.model.panos.get(e[t])
  19905. , o = this.player.model.panos.get(e[t + 1]);
  19906. i.copy(o.position).sub(r.position)
  19907. }
  19908. return i.normalize(),
  19909. !0
  19910. }
  19911. ,
  19912. t.prototype.warpCameraTravel = function(e, t, i, n) {
  19913. if (this.activeTransType = this.upcomingTransType,
  19914. this.lastTransType = this.activeTransType,
  19915. this.upcomingTransType = null,
  19916. e)
  19917. this.activeTransType === L.BLACK ? this.warpTravel_BLACK(null, i, t, n) : this.activeTransType === L.WALK ? this.warpTravel_WALK(function() {
  19918. this._clearWarpShading(),
  19919. this._warpStopFlying(),
  19920. this.player.spider.draw(),
  19921. this.placeCpm(),
  19922. n && n()
  19923. }
  19924. .bind(this)) : this.warpTravel_STD(n);
  19925. else {
  19926. var r = function() {
  19927. this._wrapupTravel(n)
  19928. }
  19929. .bind(this)
  19930. , o = {
  19931. pano: this.warpDestPano,
  19932. lookAtPoint: null,
  19933. duration: null,
  19934. maxDistanceOverride: null,
  19935. skipWarpingCheck: !1
  19936. };
  19937. this.player.flyToPano(o, r)
  19938. }
  19939. }
  19940. ,
  19941. t.prototype.startWarpState = function() {
  19942. this.warping = !0,
  19943. this.warpInterrupted = !1,
  19944. this.warpInterruptionBlackoutStyle = null,
  19945. this.warpInterruptionTravelTime = null
  19946. }
  19947. ,
  19948. t.prototype.endWarpState = function() {
  19949. this.warping = !1
  19950. }
  19951. ,
  19952. t.prototype.warpToPano = function(e, t, i, n) {
  19953. if (this.warping)
  19954. H.warn("Cannot warp when already warping");
  19955. else {
  19956. if (this.upcomingTransType = e,
  19957. this.activeTransType = null,
  19958. !this.setWarpDestPano())
  19959. return this.upcomingTransType = null,
  19960. void this.warpToNonPano(n);
  19961. if (this.player.mode !== O.PANORAMA)
  19962. return this.upcomingTransType = null,
  19963. this.discardSlow(),
  19964. void this.player.flyToNewMode({
  19965. mode: O.PANORAMA,
  19966. pano: this.warpDestPano,
  19967. duration: D.warp.outsideTime,
  19968. warpDest: this.warpDestHeroLoc,
  19969. callback: n,
  19970. force: !0
  19971. });
  19972. if (!this.warpDestPano)
  19973. return H.warn("no warp destination, callback dropped"),
  19974. void (this.upcomingTransType = null);
  19975. var r = !(this.model.panos.isNeighbour(this.player.currentPano, this.warpDestPano) && this.warpDestPano !== this.player.currentPano && this.warpDestPano.position.distanceTo(this.player.currentPano.position) < D.warp.nearPanoDist)
  19976. , o = this.chooseWarpPath(r);
  19977. if (o && this.upcomingTransType !== L.WALK) {
  19978. var a = function() {
  19979. this.waitingToWarp = !1,
  19980. this.warpToPano(e, t, i, n)
  19981. }
  19982. .bind(this);
  19983. if (this.player.checkAndWaitForPanoLoad(this.warpDestPano, "high", "low", this.player.basePanoSize, a))
  19984. return void (this.waitingToWarp = !0)
  19985. }
  19986. this.player.currentPano || (H.warn("Arrived at a very strange spot!"),
  19987. this.player.currentPano = this.warpDestPano,
  19988. this.placeCpm(),
  19989. this.fadeOutCpm(D.path.fadeOutTime),
  19990. this.player.spider.draw()),
  19991. H.debug("Warping to pano ", this.warpDestPano.position),
  19992. this.upcomingTransType !== L.WALK && this.player.emit(g.PanoChosen, this.player.currentPano, this.warpDestPano),
  19993. this.startWarpState();
  19994. var s = function() {
  19995. this.endWarpState(),
  19996. n && n()
  19997. }
  19998. .bind(this);
  19999. o ? this.warpCameraTravel(r, t, i, s) : this.warpCameraAim(s)
  20000. }
  20001. }
  20002. ,
  20003. v.exports = t
  20004. }
  20005. ).call(this, "/js/objects/ShowPath.js")
  20006. }
  20007. , {
  20008. "../constants": 8,
  20009. "../effects": 16,
  20010. "../enum/BlackoutStyle": 18,
  20011. "../enum/ModelManagerEvents": 33,
  20012. "../enum/PlayerEvents": 40,
  20013. "../enum/RenderOrder": 42,
  20014. "../enum/Vectors": 50,
  20015. "../enum/Viewmode": 51,
  20016. "../enum/WarpStyle": 52,
  20017. "../gui/gui": 65,
  20018. "../model/ModelManager": 140,
  20019. "../objects/Snapshot": 153,
  20020. "../settings": 166,
  20021. "../shaders": 167,
  20022. "../util/easing": 186,
  20023. "../util/lerp": 188,
  20024. "../util/logger": 189,
  20025. "../util/math": 190,
  20026. "../util/texture": 194,
  20027. "../util/transitions": 195,
  20028. three: 217
  20029. }],
  20030. 152: [function(e, t, i) {
  20031. "use strict";
  20032. function n() {
  20033. var e = new r.SphereBufferGeometry(a.skyboxRadius,20,5)
  20034. , t = new r.RawShaderMaterial({
  20035. fragmentShader: o.skysphere.fragmentShader,
  20036. vertexShader: o.skysphere.vertexShader,
  20037. uniforms: r.UniformsUtils.clone(o.skysphere.uniforms),
  20038. side: r.BackSide,
  20039. name: "skysphere"
  20040. });
  20041. t.uniforms.radius.value = e.parameters.radius,
  20042. r.Mesh.call(this, e, t)
  20043. }
  20044. var r = e("three")
  20045. , o = e("../shaders")
  20046. , a = e("../settings");
  20047. (n.prototype = Object.create(r.Mesh.prototype)).constructor = n,
  20048. t.exports = n
  20049. }
  20050. , {
  20051. "../settings": 166,
  20052. "../shaders": 167,
  20053. three: 217
  20054. }],
  20055. 153: [function(r, o, e) {
  20056. (function(e) {
  20057. "use strict";
  20058. function t(e) {
  20059. n.call(this, e),
  20060. this.sid = e.sid,
  20061. this.panoId = e.panoId,
  20062. this.orthoZoom = e.orthoZoom,
  20063. this.floorVisibility = e.floorVisibility,
  20064. this.thumbUrl = e.thumbUrl,
  20065. this.name = e.name,
  20066. this.zoom = e.zoom
  20067. }
  20068. var i = (r("three"),
  20069. r("../util/logger"))
  20070. , n = (r("../settings"),
  20071. r("../enum/Viewmode"),
  20072. r("../util/common"),
  20073. r("../util/transitions"),
  20074. r("../util/lerp"),
  20075. r("../util/ajax"),
  20076. r("../util/texture"),
  20077. r("./View"));
  20078. r("events").EventEmitter,
  20079. new i(e),
  20080. (t.prototype = Object.create(n.prototype)).isPano = function() {
  20081. return this.panoId && "" !== this.panoId && this.panoId != "outside"
  20082. }
  20083. ,
  20084. o.exports = t
  20085. }
  20086. ).call(this, "/js/objects/Snapshot.js")
  20087. }
  20088. , {
  20089. "../enum/Viewmode": 51,
  20090. "../settings": 166,
  20091. "../util/ajax": 181,
  20092. "../util/common": 185,
  20093. "../util/lerp": 188,
  20094. "../util/logger": 189,
  20095. "../util/texture": 194,
  20096. "../util/transitions": 195,
  20097. "./View": 154,
  20098. events: 202,
  20099. three: 217
  20100. }],
  20101. 154: [function(o, a, e) {
  20102. (function(e) {
  20103. "use strict";
  20104. function t(e) {
  20105. e = e || {},
  20106. this.position = new i.Vector3,
  20107. this.quaternion = new i.Quaternion,
  20108. this.update(e)
  20109. }
  20110. var i = o("three")
  20111. , n = o("../util/logger")
  20112. , r = (o("../settings"),
  20113. o("../enum/Viewmode"),
  20114. o("../util/common"),
  20115. o("../util/transitions"),
  20116. o("../util/lerp"),
  20117. o("../util/ajax"),
  20118. o("../util/texture"),
  20119. o("events").EventEmitter);
  20120. new n(e),
  20121. (t.prototype = Object.create(r.prototype)).isValid = function() {
  20122. return !!this.cameraMode
  20123. }
  20124. ,
  20125. t.prototype.update = function(e) {
  20126. return this.cameraMode = e.cameraMode || this.cameraMode,
  20127. this.pano = e.pano || this.pano,
  20128. e.position && this.position.copy(e.position),
  20129. e.quaternion && this.quaternion.copy(e.quaternion),
  20130. this
  20131. }
  20132. ,
  20133. a.exports = t
  20134. }
  20135. ).call(this, "/js/objects/View.js")
  20136. }
  20137. , {
  20138. "../enum/Viewmode": 51,
  20139. "../settings": 166,
  20140. "../util/ajax": 181,
  20141. "../util/common": 185,
  20142. "../util/lerp": 188,
  20143. "../util/logger": 189,
  20144. "../util/texture": 194,
  20145. "../util/transitions": 195,
  20146. events: 202,
  20147. three: 217
  20148. }],
  20149. 155: [function(J, ee, e) {
  20150. (function(e) {
  20151. "use strict";
  20152. function t(e) {
  20153. this.currentPano = null,
  20154. this.nextPano = null,
  20155. this.camera = null,
  20156. this.paused = !1,
  20157. this.flying = !1,
  20158. this.sceneIntersectionPlane = null,
  20159. this.target = new B.Vector3,
  20160. this.mouse = new B.Vector3(1.1,1.1,.5),
  20161. this.mouseAtMouseDown = new B.Vector2,
  20162. this.mouseCouldBeClickToMove = !1,
  20163. this.mouseLastMoveTime = Date.now(),
  20164. this.mouseDown = !1,
  20165. this.mouseDownTimer = null,
  20166. this.couldBeLongTap = !1,
  20167. this.containsMouse = !0,
  20168. this.isTouchEvent = !1,
  20169. this.isPanoHover = !1,
  20170. this.reticule = new n(this),
  20171. this.panoMarkers = [],
  20172. this.spider = new s(this),
  20173. this.quaternion = new B.Quaternion,
  20174. this.position = new B.Vector3(15,10,15),
  20175. this.previousState = null,
  20176. this.lastInsideView = new o,
  20177. this.last360View = new o,
  20178. this.raycaster = new B.Raycaster,
  20179. this.intersect = null,
  20180. this.lastChangeTime = Date.now(),
  20181. this.history = new h,
  20182. this.cameraControls = null,
  20183. this.path = null,
  20184. this.model = null,
  20185. this.domElement = null,
  20186. this.cachedPanoCandidates = null,
  20187. this.basePanoSize = 0,
  20188. this.standardPanoSize = 0,
  20189. this.highPanoSize = 0,
  20190. this.ultraHighPanoSize = 0,
  20191. this.zoomLevel = 1,
  20192. this.zooming = 0,
  20193. this.zoomSpeed = .5,
  20194. this.scrollZoomSpeed = .06,
  20195. this.zoomSpeedAdjust = .05,
  20196. this.defaultZoomIncrement = .2,
  20197. this.baseFov = k.insideFOV,
  20198. this.zoomFov = this.baseFov,
  20199. this.zoomEnabled = !0,
  20200. this.preRenderingEnabled = !1,
  20201. this.setupCustomProperties(e),
  20202. this.zoomStats = new v,
  20203. this.modeTran = ''
  20204. this.currentCursor = '';
  20205. }
  20206. var B = J("three")
  20207. , i = J("./util/logger")
  20208. , n = J("./objects/Reticule")
  20209. , a = J("./objects/Panorama")
  20210. , r = J("./objects/ShowPath")
  20211. , o = J("./objects/View")
  20212. , s = (J("./objects/Snapshot"),
  20213. J("./objects/NSpider"))
  20214. , V = J("./enum/Viewmode")
  20215. , T = (J("./enum/TagStates"),
  20216. J("./enum/Vectors"))
  20217. , l = J("./enum/Keys")
  20218. , k = (J("./enum/AlignmentType"),
  20219. J("./settings"))
  20220. , x = J("./util/common")
  20221. , U = (J("./util/browser"),
  20222. J("./util/math"))
  20223. , H = J("./util/lerp")
  20224. , z = J("./util/easing")
  20225. , G = J("./util/transitions")
  20226. , c = J("events").EventEmitter
  20227. , h = (J("./shaders"),
  20228. J("./util/history"))
  20229. , S = (J("./util/camera"),
  20230. J("./model/ModelManager"),
  20231. J("./enum/PathDiscardMode"))
  20232. , M = J("./enum/PathDisplayMode")
  20233. , W = J("./enum/PlayerEvents")
  20234. , u = J("./enum/ControlEvents")
  20235. , d = J("./enum/ModelManagerEvents")
  20236. , R = J("./enum/WarpStyle")
  20237. , P = J("./enum/BlackoutStyle")
  20238. , p = J("./exception/BasicException")
  20239. , f = J("./enum/PanoSizeClass")
  20240. , g = (J("./tile/TileDownloader"),
  20241. J("./tile/TilePrioritizer"))
  20242. , m = (J("./enum/PanoramaEvents"),
  20243. J("./enum/ZoomEvents"))
  20244. , v = J("./util/ZoomStats")
  20245. , y = J("./constants")
  20246. , j = J("./util/common")
  20247. , A = J("./util/cameraLight")
  20248. , C = J("hot")
  20249. , Y = new i(e)
  20250. , q = Object.freeze({
  20251. FlyToPano: G.getUniqueId(),
  20252. FlyToNewMode: G.getUniqueId(),
  20253. FlyToSameMode: G.getUniqueId(),
  20254. FlyToViewFloor: G.getUniqueId(),
  20255. LookTransition: G.getUniqueId(),
  20256. ZoomTransition: G.getUniqueId()
  20257. });
  20258. function I(e) {
  20259. for (var t = e.split(","), i = t[0].match(/:(.*?);/)[1], n = atob(t[1]), r = n.length, o = new Uint8Array(r); r--; )
  20260. o[r] = n.charCodeAt(r);
  20261. return new Blob([o],{
  20262. type: i
  20263. })
  20264. }
  20265. (t.prototype = Object.create(c.prototype)).init = function(e) {
  20266. (window.player = this).modelManager = e.modelManager,
  20267. this.tileDownloader = e.tileDownloader,
  20268. this.panoRenderer = e.panoRenderer,
  20269. this.qualityManager = e.qualityManager,
  20270. this.domElement = e.container,
  20271. this.camera = e.camera,
  20272. this.tagManager = e.tagManager,
  20273. this.cameraControls = e.controls,
  20274. this.path = new r(e.director,this,e.controls),
  20275. this.basePanoSize = this.qualityManager.getPanoSize(f.BASE),
  20276. this.standardPanoSize = this.qualityManager.getPanoSize(f.STANDARD),
  20277. this.highPanoSize = this.qualityManager.getPanoSize(f.HIGH),
  20278. this.ultraHighPanoSize = this.qualityManager.getPanoSize(f.ULTRAHIGH),
  20279. this.tileDownloader.processPriorityQueue = !1,
  20280. this.tileDownloader.tilePrioritizer = new g(this.qualityManager,this.basePanoSize,this.standardPanoSize,this.highPanoSize,this.ultraHighPanoSize),
  20281. this.bindEvents(e.container),
  20282. this.updateModel()
  20283. }
  20284. ,
  20285. t.prototype.screenShot = function(i) {
  20286. if (!this.flying && !this.flyingToTag) {
  20287. var n = this.sceneRenderer;
  20288. for (var e in n.updateScreenSize(i),
  20289. this.model.panos.index)
  20290. this.model.panos.index[e].marker && (this.model.panos.index[e].marker.forceHide = this.model.panos.index[e].marker.visible,
  20291. this.model.panos.index[e].marker.visible = !1);
  20292. for (var e in this.model.hots)
  20293. this.model.hots[e].mesh.visible = !1;
  20294. this.reticule.visible = !1,
  20295. this.reticule.forceUnvisible = !0,
  20296. this.path.currentPanoMarker.mesh.visible = !1,
  20297. setTimeout(function() {
  20298. n.renderer.clear(!0, !0, !0),
  20299. n.renderer.render(n.scene, n.camera);
  20300. var e = n.renderer.domElement.toDataURL(i.type, .9);
  20301. for (var t in i.f && i.f(e),
  20302. n.updateScreenSize({
  20303. resize: !0
  20304. }),
  20305. this.reticule.visible = !0,
  20306. this.model.hots)
  20307. this.model.hots[t].mesh.visible = !0;
  20308. for (var t in this.model.panos.index)
  20309. this.model.panos.index[t].marker.visible = this.model.panos.index[t].marker.forceHide;
  20310. this.path.currentPanoMarker.mesh.visible = !0,
  20311. n.renderer.render(n.scene, n.camera)
  20312. }
  20313. .bind(this), 30)
  20314. }
  20315. }
  20316. ;
  20317. var E, _, b, w, O, L, D, N, F, X, Z, K, Q = J("scaleImg");
  20318. t.prototype.getWrapShot = function() {
  20319. var i = this.getSnapAngleInfo()
  20320. , n = ",{\r\t" + i
  20321. , r = arguments[0];
  20322. this.screenShot({
  20323. width: g_snapShotWidth,
  20324. height: g_snapShotHeight,
  20325. type: "image/jpeg",
  20326. f: function(e) {
  20327. if (r && r.__callback)
  20328. return r.__callback(e, i);
  20329. var t = new Image;
  20330. t.src = e,
  20331. t.onload = function() {
  20332. var e = function(r, i) {
  20333. function n(e, t) {
  20334. var i = o || r
  20335. , n = document.createElement("canvas");
  20336. n.width = i.width,
  20337. n.height = i.height,
  20338. n.getContext("2d").drawImage(i, 0, 0, i.width, i.height),
  20339. o = Q(e, n, t)
  20340. }
  20341. function e() {
  20342. var e = o || r
  20343. , t = I(e.src);
  20344. i.maxWeight && t.size > i.maxWeight && (n(i.maxWeight / t.size, "jpeg"),
  20345. t = I(e.src)),
  20346. (o = o || new Image).base64Src = e.src,
  20347. o.src = window.URL.createObjectURL(t)
  20348. }
  20349. var o, t = Math.max(r.width, r.height);
  20350. return "png" != i.toType && ("jpeg" == i.oldType ? (t > i.maxSize && n(i.maxSize / t, "jpeg"),
  20351. e()) : "png" == i.oldType && i.maxWeight && i.weight > i.maxWeight && (n(t > i.maxSize ? i.maxSize / t : 1, "jpeg"),
  20352. e())),
  20353. o || r
  20354. }(this, {
  20355. maxSize: g_snapShotWidth,
  20356. oldType: "jpeg"
  20357. });
  20358. e.src.replace(function(e) {
  20359. return "image/" + (e = e.toLowerCase().replace(/jpg/i, "jpeg")).match(/png|jpeg|bmp|gif/)[0]
  20360. }("image/jpeg"), "image/octet-stream");
  20361. var t = "snap" + (new Date).getTime();
  20362. !function(e, t) {
  20363. var i = document.createElementNS("http://www.w3.org/1999/xhtml", "a");
  20364. i.href = e,
  20365. i.download = t;
  20366. var n = document.createEvent("MouseEvents");
  20367. n.initMouseEvent("click", !0, !1, window, 0, 0, 0, 0, 0, !1, !1, !1, !1, 0, null),
  20368. i.dispatchEvent(n)
  20369. }(e.src, t + ".jpg"),
  20370. n += ',\r\t"thumbnail_signed_src":"' + t + '.jpg",',
  20371. n += '\r\t"sid":"' + t + '",',
  20372. n += '\r\t"name":"' + t + '"\r}',
  20373. logData(n)
  20374. }
  20375. }
  20376. })
  20377. }
  20378. /* ,
  20379. t.prototype.getSnapAngleInfo = function() {
  20380. var e = {}
  20381. , t = '"metadata":{'
  20382. , i = this.camera.quaternion.clone();
  20383. switch (this.mode) {
  20384. case "panorama":
  20385. e.scan_id = this.currentPano.id,
  20386. t += '"scan_id":"' + this.currentPano.id + '",';
  20387. break;
  20388. case "floorplan":
  20389. e.camera_mode = 1,
  20390. (i = (new B.Quaternion).setFromAxisAngle(new B.Vector3(0,1,0), B.Math.degToRad(90))).multiply(this.camera.quaternion),
  20391. t += '"camera_mode":1,',
  20392. t += '"ortho_zoom":' + U.toPrecision(this.cameraControls.activeControl.currentScale, 4) + ",";
  20393. break;
  20394. case "dollhouse":
  20395. e.camera_mode = 2,
  20396. t += '"camera_mode":2,'
  20397. }
  20398. var n = new B.Quaternion(i.x,i.y,i.z,i.w);
  20399. return n.multiply(new B.Quaternion(Math.sqrt(2) / 2,Math.sqrt(2) / 2,0,0).conjugate()),
  20400. n.x *= -1,
  20401. n.w *= -1,
  20402. e.camera_position = U.toPrecision(this.camera.position.toArray(), 4),
  20403. e.camera_quaternion = U.toPrecision(n.toArray(), 4),
  20404. e.zoom = this.zoomLevel,
  20405. t += '"camera_position":[' + e.camera_position + '],"camera_quaternion":[' + e.camera_quaternion + '], "zoom":' + e.zoom + "}"
  20406. }
  20407. , */
  20408. t.prototype.getSnapAngleInfo = function(){
  20409. var info = {};
  20410. var str = '"metadata":{';
  20411. var q = this.camera.quaternion.clone();
  20412. switch (this.mode) {
  20413. case "panorama":
  20414. info.scan_id = this.currentPano.id;
  20415. str += ('"scan_id":"'+this.currentPano.id+'",');
  20416. break;
  20417. case "floorplan":
  20418. info.camera_mode = 1;
  20419. q = (new B.Quaternion).setFromAxisAngle(new B.Vector3(0,1,0), B.Math.degToRad(90))
  20420. q.multiply(this.camera.quaternion);
  20421. str += ('"camera_mode":1,');
  20422. //str += ('"ortho_zoom":'+m.toPrecision(this.cameraControls.activeControl.currentScale * $("#player").height() / $("#player").width() * D.workshopApsect * 16, 4)+",");
  20423. str += ('"ortho_zoom":'+ U.toPrecision(this.cameraControls.activeControl.currentScale, 4 )+",");
  20424. break;
  20425. case "dollhouse":
  20426. info.camera_mode = 2;
  20427. str += ('"camera_mode":2,');
  20428. break;
  20429. }
  20430. info.camera_position = U.toPrecision(this.camera.position.toArray(),4);
  20431. //console.log(info.camera_position)
  20432. info.camera_quaternion = U.toPrecision(q.toArray(),4);
  20433. /* if(window.screenSta === 'tour'){ // fyz 导览截屏需要做额外的 fyz 对相机截屏的角度进行校对
  20434. var out = new B.Quaternion(q.x, q.y, q.z, q.w)
  20435. out.multiply(new B.Quaternion(Math.sqrt(2) / 2, Math.sqrt(2) / 2, 0, 0).conjugate())
  20436. out.x *= -1;
  20437. out.w *= -1;
  20438. info.camera_quaternion = U.toPrecision(out.toArray(),4);
  20439. }else{
  20440. info.camera_quaternion = U.toPrecision(q.toArray(),4);;
  20441. } */
  20442. info.zoom = this.zoomLevel;
  20443. //console.log(info.camera_quaternion)
  20444. // str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+"]}");
  20445. // fyz 扩展编辑页面, 加上导览点缩放值
  20446. str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+'], "zoom":' + info.zoom + '}');
  20447. console.log(str)
  20448. return str;
  20449. }
  20450. //------end
  20451. t.prototype.closePopup = function() {
  20452. if (g_currentHot) {
  20453. g_currentHot = null,
  20454. document.getElementById("popup").style.display = "none",
  20455. document.querySelector(".popup-content").removeChild(document.getElementById("id1")),
  20456. $("#popup iframe:last").remove();
  20457. document.getElementById("bgaudio");
  20458. if(g_bgAudio && g_bgAudio.pauseByHot){
  20459. manage.switchBgmState(true)
  20460. }
  20461. return false
  20462. }
  20463. }
  20464. ,
  20465. t.prototype.setupCustomProperties = function(e) {
  20466. var i = e || V.PANORAMA;
  20467. Object.defineProperty(this, "mode", {
  20468. get: function() {
  20469. return i
  20470. },
  20471. set: function(e) {
  20472. var t = i;
  20473. i = e,
  20474. this.onModeUpdated(t, i)
  20475. }
  20476. })
  20477. }
  20478. ,
  20479. t.prototype.isInMode = function() {
  20480. for (var e = 0; e < arguments.length; e++)
  20481. if (this.mode === arguments[e])
  20482. return !0;
  20483. return !1
  20484. }
  20485. ,
  20486. t.prototype.isOutsideMode = function(e) {
  20487. return (e = e || this.mode) === V.DOLLHOUSE || e === V.FLOORPLAN
  20488. }
  20489. ,
  20490. t.prototype.is360View = function(e, t) {
  20491. return e === V.PANORAMA && t && !t.isAligned()
  20492. }
  20493. ,
  20494. t.prototype.setScene = function(e) {
  20495. this.sceneIntersectionPlane = e.plane,
  20496. this.path.setScene(e),
  20497. this.moveReticuleToScene(e)
  20498. }
  20499. ,
  20500. t.prototype.moveReticuleToScene = function(e) {
  20501. this.reticule.parent && this.reticule.parent.remove(this.reticule),
  20502. e.add(this.reticule)
  20503. }
  20504. ,
  20505. t.prototype.updateModel = function() {
  20506. function n(e) {
  20507. var t = this.cameraControls.cameras[V.DOLLHOUSE]
  20508. , i = this.cameraControls.controls[V.DOLLHOUSE]
  20509. , n = t.position.y + (e - i.target.y)
  20510. , r = k.showFloorDuration + k.showFloorDelay;
  20511. G.start(H.property(i.target, "y", e), r, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToViewFloor),
  20512. G.start(H.property(t.position, "y", n), r, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToViewFloor)
  20513. }
  20514. this.model = this.modelManager.getActiveModel(),
  20515. this.model.on("floor.changed", function(e, t, i) {
  20516. this.mode === V.DOLLHOUSE && e !== i && n.call(this, e.center.y)
  20517. }
  20518. .bind(this)),
  20519. this.model.on("allfloors.toggled", function(e, t) {
  20520. if (this.mode === V.DOLLHOUSE) {
  20521. var i = e ? this.model.center.y : i = t.center.y;
  20522. n.call(this, i)
  20523. }
  20524. }
  20525. .bind(this)),
  20526. this.on(W.PanoChosen, this.model.setProjectedPanos.bind(this.model));
  20527. var t = this;
  20528. this.model.panos.list.forEach(function(e) {
  20529. e.vrMarker.addEventListener("click", function() {
  20530. t.flyToPano({
  20531. pano: e
  20532. })
  20533. })
  20534. })
  20535. }
  20536. ,
  20537. t.prototype.updateModelDependentData = function() {
  20538. this.cameraControls.setModelForControls(this.model),
  20539. this.getPanoMarkersFromModel(this.model)
  20540. }
  20541. ,
  20542. t.prototype.onModelChanged = function() {
  20543. this.updateModel(),
  20544. this.updateModelDependentData()
  20545. }
  20546. ,
  20547. t.prototype.getPanoMarkersFromModel = function(e) {
  20548. this.panoMarkers = e.panos.list.reduce(function(e, t) {
  20549. return t.marker ? e.concat(t.marker) : e
  20550. }, [])
  20551. }
  20552. ,
  20553. t.prototype.handleControlMove = function(e) {
  20554. this.emit(W.Move, e)
  20555. }
  20556. ,
  20557. t.prototype.handleControlInputStart = function(e) {
  20558. this.emit(W.InputStart, e)
  20559. }
  20560. ,
  20561. t.prototype.onModeUpdated = function(e, t) {
  20562. this.cameraControls.activateControls(t),
  20563. this.emit(W.ModeChanged, e, t)
  20564. }
  20565. ,
  20566. t.prototype.isWarping = function() {
  20567. return this.path.warping
  20568. }
  20569. ,
  20570. t.prototype.isWaitingToWarp = function() {
  20571. return this.path.waitingToWarp
  20572. }
  20573. ,
  20574. t.prototype.getLabelScaleFactor = function() {
  20575. if (this.isOutsideMode()) {
  20576. return Math.sqrt(this.cameraControls.controls[V.FLOORPLAN].currentScale / 10)
  20577. }
  20578. return .5
  20579. }
  20580. ,
  20581. t.prototype.changeMusic = function() {
  20582. if(!this.director.tourIsPlaying) this.director.bgmReplay()
  20583. }
  20584. ,
  20585. t.prototype.bindEvents = function(e) {
  20586. e !== document && e.setAttribute("tabindex", -1),
  20587. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  20588. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  20589. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  20590. e.addEventListener("mouseout", this.onMouseOut.bind(this)),
  20591. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  20592. this.modelManager.on(d.ActiveModelChanged, this.onModelChanged.bind(this)),
  20593. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  20594. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  20595. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  20596. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  20597. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  20598. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  20599. document.addEventListener("pointerup", ()=>{//add
  20600. window.transformControls && transformControls.onPointerUp()
  20601. }),
  20602. e.addEventListener("pointerout", this.onPointerOut.bind(this)),
  20603. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  20604. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  20605. this.cameraControls.on(u.Move, this.handleControlMove.bind(this)),
  20606. this.cameraControls.on(u.InputStart, this.handleControlInputStart.bind(this)),
  20607. this.cameraControls.on(u.Pinch, this.handleControlPinch.bind(this)),
  20608. this.cameraControls.on(u.Scroll, this.handleControlScroll.bind(this)),
  20609. window.addEventListener("snapshotBegin", this.getWrapShot.bind(this)),
  20610. window.addEventListener("tourAudioEnded", this.changeMusic.bind(this)),
  20611. window.getSeft && getSeft(this),
  20612. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? $("#closepop").on("touchstart", this.closePopup.bind(this)) : $("#closepop").on("click", this.closePopup.bind(this))
  20613. }
  20614. ,
  20615. t.prototype.onMouseDown = function(e) {
  20616. e.currentTarget !== document && e.currentTarget.focus(),
  20617. 0 === e.button && (this.handleInputStart.call(this, e.clientX, e.clientY, !1),
  20618. this.updateIntersect())
  20619. }
  20620. ,
  20621. t.prototype.onMouseMove = function(e) {
  20622. this.isTouchEvent = !1,
  20623. this.handleInputMove.call(this, e.clientX, e.clientY, !1)
  20624. }
  20625. ,
  20626. t.prototype.onMouseOver = function(e) {
  20627. this.containsMouse = !0,
  20628. !this.mouseDown || 0 !== e.which && 0 !== e.buttons || (this.mouseDown = !1)
  20629. }
  20630. ,
  20631. t.prototype.onMouseOut = function(e) {
  20632. this.containsMouse = !1
  20633. }
  20634. ,
  20635. t.prototype.onMouseUp = function(e) {
  20636. this.handleInputEnd.call(this, e.clientX, e.clientY, !1)
  20637. }
  20638. ,
  20639. t.prototype.onTouchStart = function(e) {
  20640. if (e.currentTarget !== document && e.currentTarget.focus(),
  20641. !this.mouseDown) {
  20642. this.couldBeLongTap = !0;
  20643. var t = x.average(e.changedTouches, "clientX")
  20644. , i = x.average(e.changedTouches, "clientY");
  20645. this.handleInputStart.call(this, t, i, !0),
  20646. this.mouseDownTimer = setTimeout(function() {
  20647. this.updateIntersect(),
  20648. this.handleInputEnd.call(this, t, i, !0)
  20649. }
  20650. .bind(this), k.input.longTapThreshold)
  20651. }
  20652. }
  20653. ,
  20654. t.prototype.onTouchMove = function(e) {
  20655. var t = x.average(e.changedTouches, "clientX")
  20656. , i = x.average(e.changedTouches, "clientY");
  20657. this.handleInputMove.call(this, t, i, !0)
  20658. }
  20659. ,
  20660. t.prototype.onTouchEnd = function(e) {
  20661. if (clearTimeout(this.mouseDownTimer),
  20662. this.mouseDown) {
  20663. this.couldBeLongTap = !1,
  20664. this.updateIntersect();
  20665. var t = x.average(e.changedTouches, "clientX")
  20666. , i = x.average(e.changedTouches, "clientY");
  20667. this.handleInputEnd.call(this, t, i, !0)
  20668. }
  20669. }
  20670. ,
  20671. t.prototype.onPointerDown = function(e) {
  20672. return e.currentTarget !== document && e.currentTarget.focus(),
  20673. this.mouseDown || "mouse" === e.pointerType ? this.onMouseDown(e) : (this.couldBeLongTap = !0,
  20674. this.handleInputStart.call(this, e.clientX, e.clientY, !0),
  20675. void (this.mouseDownTimer = setTimeout(function() {
  20676. this.updateIntersect(),
  20677. this.handleInputEnd.call(this, e.clientX, e.clientY, !0)
  20678. }
  20679. .bind(this), k.input.longTapThreshold)))
  20680. }
  20681. ,
  20682. t.prototype.onPointerMove = function(e) {
  20683. "mouse" !== e.pointerType ? this.handleInputMove.call(this, e.clientX, e.clientY, !0) : this.onMouseMove(e)
  20684. }
  20685. ,
  20686. t.prototype.onPointerUp = function(e) {
  20687. return this.mouseDown && "mouse" !== e.pointerType ? (clearTimeout(this.mouseDownTimer),
  20688. this.couldBeLongTap = !1,
  20689. this.updateIntersect(),
  20690. void this.handleInputEnd.call(this, e.clientX, e.clientY, !0)) : this.onMouseUp(e)
  20691. }
  20692. ,
  20693. t.prototype.onPointerOut = function(e) {
  20694. this.mouseDown = !1
  20695. }
  20696. ,
  20697. t.prototype.onPointerCancel = function(e) {
  20698. this.mouseDown = !1
  20699. }
  20700. ,
  20701. t.prototype.onKeyDown = function(e) {
  20702. var t = function() {
  20703. this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.Move, "key")
  20704. }
  20705. .bind(this)
  20706. , i = e.which;
  20707. switch (i) {
  20708. case l.F:
  20709. t(),
  20710. this.changeFloor(-1);
  20711. break;
  20712. case l.R:
  20713. t(),
  20714. this.changeFloor(1)
  20715. }
  20716. if (this.mode === V.PANORAMA)
  20717. switch (i) {
  20718. case l.UPARROW:
  20719. case l.W:
  20720. this.flyLocalDirection(T.FORWARD.clone());
  20721. break;
  20722. case l.DOWNARROW:
  20723. case l.S:
  20724. this.flyLocalDirection(T.BACK.clone());
  20725. break;
  20726. case l.A:
  20727. this.flyLocalDirection(T.LEFT.clone());
  20728. break;
  20729. case l.D:
  20730. this.flyLocalDirection(T.RIGHT.clone())
  20731. }
  20732. }
  20733. ,
  20734. t.prototype.handleScrollPinchZoom = function(e) {
  20735. var t = e
  20736. , i = this.zoomLevel;
  20737. this.zoomBy(t),
  20738. this.currentPano && this.zoomStats.addZoomAction(i, this.zoomLevel, this.currentPano.id)
  20739. }
  20740. ,
  20741. t.prototype.handleControlPinch = function(e) {
  20742. k.zoom.enabled ? this.handleScrollPinchZoom(1 - e) : this.flyLocalDirection(new B.Vector3(0,0,e).normalize())
  20743. }
  20744. ,
  20745. t.prototype.handleControlScroll = function(e) {
  20746. k.zoom.enabled ? (0 < e ? e = 1 + this.scrollZoomSpeed : e < 0 && (e = 1 - this.scrollZoomSpeed),
  20747. 0 !== e && this.handleScrollPinchZoom(e)) : this.flyLocalDirection(new B.Vector3(0,0,-e).normalize())
  20748. }
  20749. ,
  20750. t.prototype.handleInputStart = function(e, t, i) {
  20751. var n = this.handelPadding(e, t);
  20752. e = n.x,
  20753. t = n.y,
  20754. this.isTouchEvent = i,
  20755. U.convertScreenPositionToNDC(e, t, this.mouse),
  20756. U.convertScreenPositionToNDC(e, t, this.mouseAtMouseDown),
  20757. this.mouseCouldBeClickToMove = !0,
  20758. this.mouseDown = !0,
  20759. this.mouseCouldBeClickToMove && window.Hotpoint && (new Hotpoint).state(this, C)
  20760. window.transformControls && transformControls.onPointerDown()
  20761. if(!this.overlayInitedPlay && this.overlayGroup.children.length){
  20762. try{
  20763. this.overlayGroup.children.forEach((overlay)=>{
  20764. overlay.overlayType == "video" && overlay.plane.material.map.image.play()
  20765. })
  20766. }catch(e){}
  20767. this.overlayInitedPlay = true
  20768. }
  20769. }
  20770. ,
  20771. t.prototype.handelPadding = function(e, t) {
  20772. return this.pad || (this.pad = {
  20773. x: dom.getOffset("left", $("#player")[0]),
  20774. y: dom.getOffset("top", $("#player")[0])
  20775. }),
  20776. {
  20777. x: e - this.pad.x,
  20778. y: t - this.pad.y
  20779. }
  20780. }
  20781. ,
  20782. t.prototype.handleInputMove = function(e, t, i) {
  20783. var n = this.handelPadding(e, t);
  20784. e = n.x,
  20785. t = n.y,
  20786. this.isTouchEvent = i,
  20787. U.convertScreenPositionToNDC(e, t, this.mouse);
  20788. var moveToleranceNDC = (window.transformControls && transformControls.visible) ? 0.0000001 : k.input.moveToleranceNDC
  20789. this.mouseAtMouseDown.distanceTo(this.mouse) > moveToleranceNDC && (this.mouseCouldBeClickToMove = !1,
  20790. this.couldBeLongTap = !1,
  20791. clearTimeout(this.mouseDownTimer)),
  20792. this.mouseLastMoveTime = Date.now(),
  20793. this.reticule.move(e, t, i)
  20794. window.transformControls && transformControls.onPointerMove()
  20795. }
  20796. ,
  20797. t.prototype.handleInputEnd = function(e, t, i) {
  20798. if (this.isTouchEvent = i,
  20799. this.mouseDown = !1,
  20800. this.cameraControls.controls[V.PANORAMA].emit("interaction.direct"),
  20801. !i && this.couldBeLongTap)
  20802. return !0;
  20803. if (this.handleLongTap())
  20804. return !0;
  20805. window.transformControls && transformControls.onPointerUp()
  20806. if (this.mouseCouldBeClickToMove) {
  20807. if (this.flying)
  20808. return this.path.activeTransType === R.WALK && this.emit(W.WarpInterruptedWithFlyTo, this.path.activeTransType),
  20809. !0;
  20810. //add----
  20811. if (this.checkHotClick())
  20812. return !0;
  20813. if (window.VisiSet && VisiSet.setPanoVisible) {//正在设置漫游可行
  20814. this.intersect && this.intersect.object.visible && VisiSet.dealPanoVisible(this.intersect.object.name);
  20815. return;
  20816. }
  20817. if (window.VisiSet && VisiSet.setTagVisible ) {
  20818. VisiSet.tagVsetting && this.intersect && this.intersect.object.visible && VisiSet.dealTagVisible(VisiSet.tagVsetting, this.intersect.object.name);
  20819. return;
  20820. }
  20821. if(this.hoveringPlane){
  20822. this.clickOverlay(this.hoveringPlane)
  20823. return;
  20824. }
  20825. if(window.EditOverlay && EditOverlay.objCursorType == "overlay"){
  20826. return EditOverlay.addPlane({intersect:this.intersect});
  20827. }
  20828. /* if(objects.mainDesign && objects.mainDesign.editing && objects.mainDesign.handleClickEnd(this)){//许钟文加
  20829. if(objects.mainDesign.editType == "wallDesign" && this.mode == "panorama") return !0;
  20830. else if(objects.mainDesign.editType == "addOverlay")return !0;
  20831. } */
  20832. //----------
  20833. if (this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.Move, this.isTouchEvent ? "touch" : "mouse"),
  20834. this.history.invalidate(),
  20835. this.intersect)
  20836. return this.flyToPanoClosestToMouse();
  20837. if (this.mode === V.PANORAMA) {
  20838. var n = this.closestPanoInDirection(this.getMouseDirection());
  20839. return n ? this.flyToPano({
  20840. pano: n
  20841. }) : this.bump(this.getMouseDirection())
  20842. }
  20843. }
  20844. this.intersect && this.closestPano && this.closestPano.hoverOff(this.mode)
  20845. }
  20846. ,
  20847. t.prototype.handleLongTap = function() {
  20848. if (this.couldBeLongTap && (!this.isPanoHover || this.mode !== V.PANORAMA))
  20849. return this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.LongTap, "touch"),
  20850. !0
  20851. }
  20852. ,
  20853. t.prototype.checktagClick = function() {
  20854. if (this.tagManager.intersectTag) {
  20855. var e = this.isTouchEvent
  20856. , t = this.tagManager.clickedOnTag(e, this);
  20857. return e || t || G.cancelById(q.LookTransition),
  20858. !0
  20859. }
  20860. if (this.tagManager.activeTag)
  20861. return this.tagManager.dismissActiveTag(),
  20862. !1
  20863. }
  20864. ,
  20865. t.prototype.rankedtagInDirection = function(e, t) {
  20866. return this.tagManager.rankedtagInDirection(e, this.position, this.camera, t)
  20867. }
  20868. ,
  20869. t.prototype.start = function(e) {
  20870. $(".toolLeft").removeClass("unable");
  20871. $(".toolTop").removeClass("unable");
  20872. //-------------------
  20873. window.initTransformCtl(B)
  20874. window.initOverlay(B)
  20875. this.model.loadOverlays()
  20876. window.EditOverlay && window.EditOverlay.init(B);
  20877. window.VisiSet && VisiSet.init()
  20878. //-------------------
  20879. var t = e.mode
  20880. , i = e.pano
  20881. , n = e.position
  20882. , r = e.quaternion
  20883. , o = e.tag
  20884. , a = e.quickstart
  20885. , s = $.Deferred();
  20886. this.updateModelDependentData(),
  20887. this.updateFromControls(),
  20888. this.findDefaultViews();
  20889. var l = this.is360View(t, i);
  20890. return !this.model.outsideAllowed() || l || a ? this.startInside(i, n, r, o, s) : this.startOutside(e, s),
  20891. s.done(function(e) {
  20892. this.emit(W.Ready, l, e, o)
  20893. }
  20894. .bind(this)),
  20895. s.promise()
  20896. }
  20897. ,
  20898. t.prototype.startOutside = function(e, t) {
  20899. var i = e.mode
  20900. , n = e.pano
  20901. , r = e.position
  20902. , o = e.quaternion
  20903. , a = e.zoom
  20904. , s = e.floorVisibility
  20905. , l = e.tag;
  20906. this.emit(W.StartOutside, k[i].transitionTime),
  20907. this.isOutsideMode(i) ? (this.model.warpDestFloors(s, !0),
  20908. G.cancelById(q.FlyToViewFloor),
  20909. i === V.FLOORPLAN ? this.floorplanMode(r, o, a) : this.dollhouseMode(r, o),
  20910. t.resolve(!1)) : this.startInsideWithFlyin(n, r, o, l, t)
  20911. }
  20912. ,
  20913. t.prototype.startInside = function(e, t, i, n, r) {
  20914. r = r || $.Deferred();
  20915. var o = (this.currentPano = e) && !e.isAligned();
  20916. if (t = o ? e.position : t || e.position,
  20917. i = i || e.quaternion,
  20918. e) {
  20919. var a = this.startInside.bind(this, e, t, i, n, r);
  20920. if (this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, a))
  20921. return
  20922. }
  20923. //add
  20924. this.transitionPos({type:"beforeFlytopano", pano:this.currentPano, dur:0})
  20925. return this.mode = V.PANORAMA,
  20926. e.floor.enter(this.mode),
  20927. this.emit(W.PanoChosen, this.currentPano, this.currentPano),
  20928. this.switchCameraMode(this.mode, i),
  20929. this.emit(W.StartInside, o),
  20930. r.resolve(!0),
  20931. r
  20932. }
  20933. ,
  20934. t.prototype.startInsideWithFlyin = function(i, e, n, t, r) {
  20935. if (r = r || $.Deferred(),
  20936. this.dollhouseMode(),
  20937. !i)
  20938. return Y.warn("Player.startInsideWithFlyin() -> targetPano is invalid."),
  20939. r.resolve(!1),
  20940. r;
  20941. e = e || i.position;
  20942. var o = n || this.cameraControls.activeControl.camera.quaternion
  20943. , a = i.position;
  20944. return this.fitDollhouse(a, e, o),
  20945. setTimeout(function(e) {
  20946. this.cameraControls.activeControl && (this.cameraControls.activeControl.maxDistance = e);
  20947. var t = {
  20948. mode: V.PANORAMA,
  20949. pano: i,
  20950. quaternion: n,
  20951. callback: function() {
  20952. this.emit(W.FlyinFinished),
  20953. r.resolve(!0)
  20954. }
  20955. .bind(this)
  20956. };
  20957. this.flyToNewMode(t)
  20958. }
  20959. .bind(this, this.cameraControls.activeControl.maxDistance), k.startupFlyinDelay),
  20960. r
  20961. }
  20962. ,
  20963. t.prototype.checkAndWaitForPanoLoad = (Z = {},
  20964. K = {},
  20965. function(t, e, i, n, r, o, a, s, l, c) {
  20966. if (function() {
  20967. for (var e in Z)
  20968. if (Z.hasOwnProperty(e) && Z[e] && performance.now() - K[e] < 5e3)
  20969. return !0;
  20970. return !1
  20971. }())
  20972. return !0;
  20973. var h = function(e, t, i) {
  20974. j.delayOneFrame(function() {
  20975. Z[e] = !1,
  20976. r && r(t, i)
  20977. }
  20978. .bind(this))
  20979. }
  20980. .bind(this, t.id)
  20981. , u = function(e, t) {
  20982. j.delayOneFrame(function() {
  20983. Z[e] = !1,
  20984. o && o(t)
  20985. }
  20986. .bind(this))
  20987. }
  20988. .bind(this, t.id);
  20989. try {
  20990. return null != s || (s = !0),
  20991. this.model.supportsTiles ? Z[t.id] = this.checkAndWaitForTiledPanoLoad(t, n, h, u, a, s, l, c) : Z[t.id] = this.checkAndWaitForWholePanoLoad(t, e, i, h, s),
  20992. Z[t.id] && (K[t.id] = performance.now()),
  20993. Z[t.id]
  20994. } catch (e) {
  20995. throw Z[t.id] = !1,
  20996. K[t.id] = performance.now() - 5e3,
  20997. e
  20998. }
  20999. }
  21000. ),
  21001. t.prototype.checkAndWaitForWholePanoLoad = function(e, t, i, n, r) {
  21002. if (!e)
  21003. throw new p("Player.checkAndWaitForWholePanoLoad() -> Cannot load texture for null pano.");
  21004. return r && this.model.waitForLoad(e, function() {
  21005. return e.isLoaded(i)
  21006. }),
  21007. !e.isLoaded(t) && (e.loadCube(t).done(n),
  21008. !0)
  21009. }
  21010. ,
  21011. t.prototype.checkAndWaitForTiledPanoLoad = (X = new B.Vector3,
  21012. function(e, t, i, n, r, o, a, s) {
  21013. if (!e)
  21014. throw new p("Player.checkAndWaitForTiledPanoLoad() -> Cannot load texture for null pano.");
  21015. return X.copy(T.FORWARD),
  21016. this.getDirection(X),
  21017. !e.isLoaded(t) && (o && this.model.waitForLoad(e, function() {
  21018. return e.isLoaded(t)
  21019. }),
  21020. e.loadTiledPano(t, X, null, a, s).done(function(e, t) {
  21021. i && i(e, t)
  21022. }
  21023. .bind(this)).fail(function(e) {
  21024. n && n(e)
  21025. }
  21026. .bind(this)).progress(function(e, t, i) {
  21027. r && r(e, t, i)
  21028. }
  21029. .bind(this)),
  21030. !0)
  21031. }
  21032. ),
  21033. t.prototype.switchCameraMode = function(e, t) {
  21034. var i = this.cameraControls.controls[e]
  21035. , n = i.camera;
  21036. switch (e) {
  21037. case V.PANORAMA:
  21038. n.position.copy(this.currentPano.position);
  21039. var r = t ? T.FORWARD.clone().applyQuaternion(t) : this.getDirection().setY(0).normalize();
  21040. i.lookAt(r.add(n.position));
  21041. break;
  21042. case V.DOLLHOUSE:
  21043. /* var o = this.position.clone();
  21044. this.mode === V.PANORAMA ? o.add(new B.Vector3(0,6,0)).add(this.getDirection().multiplyScalar(-10)) : o.add(T.DOWN.clone().applyQuaternion(this.quaternion).multiplyScalar(6)).setY(6),
  21045. n.position.copy(o),
  21046. i.target.copy(this.target.clone().setY(this.model.center.y));
  21047. break; */
  21048. //for多楼层 且 让模型刚好适应屏幕
  21049. var box = this.model.boundingBox.clone();
  21050. box.applyMatrix4(this.camera.matrixWorld);//将 boundingbox、也就是模型, 转换到当前相机朝向
  21051. var boxSize = box.size() //其中boxSize.x是模型在当前相机视角下的横向宽度,当飞出后,该宽度要刚好占满窗口宽度
  21052. var fov = A.getHFOVFromVFOV(k.insideFOV, n.aspect, 1); //获得在当前窗口的横向的fov
  21053. var distance = Math.abs(boxSize.x) / 2 / Math.tan(THREE.Math.degToRad(fov / 2))//根据上面获得的参数得到target到相机的距离
  21054. console.log(boxSize.x,distance, boxSize.length() / 2)
  21055. distance += boxSize.length() / 2 //由于此时模型从中心向相机的部分由于近大远小仍超出屏幕,所以将target放在靠近模型靠近相机的这一端,故而再加上box的对角线长度的一半, 虽然本该加上Math.sqrt(boxSize.z*boxSize.z +boxSize.y+boxSize.y)/2,但是这样模型显得比较满
  21056. if(this.mode === V.PANORAMA){
  21057. i.target.copy(this.model.center);
  21058. var vec = this.getDirection().negate().setY(1).normalize()//获得朝向
  21059. }else{
  21060. i.target.copy(this.target.clone().setY(this.model.center.y))
  21061. var vec = T.DOWN.clone().applyQuaternion(this.quaternion).setY(1).normalize()
  21062. }
  21063. vec.multiplyScalar(distance )
  21064. n.position.copy(i.target.clone().add(vec))
  21065. break
  21066. case V.FLOORPLAN:
  21067. n.position.copy(this.model.center).setY(k.floorplan.cameraHeight),
  21068. i.target.copy(this.model.center).setY(0),
  21069. i.zoomToContain(this.model.size),
  21070. i.rotateToView(this.model.size, this.getDirection())
  21071. }
  21072. i.update(0)
  21073. }
  21074. ,
  21075. t.prototype.update = (new B.Vector3,
  21076. N = {},
  21077. F = [],
  21078. function(e) {
  21079. this.updatePersistentZooming(e),
  21080. this.updateFromControls(e),
  21081. this.getCurrentNodePanos(F)
  21082. if(this.hasChanged(N)){
  21083. this.lastChangeTime = Date.now(),
  21084. !this.mouseDown && this.containsMouse && this.updateIntersect()
  21085. this.emit(W.ViewChanged)
  21086. //add:
  21087. if (window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setTagVisible)) VisiSet.updateFootIconSize();
  21088. this.intersectHot && this.intersectHot.showTitle()
  21089. for(var i in this.model.hots){
  21090. this.model.hots[i].update(this.camera)
  21091. }
  21092. }
  21093. this.mode == "panorama" && window.cad && cad.setSign({ x: this.position.x, y: this.position.z },this.cameraControls.controls.panorama.lon);
  21094. this.model.supportsTiles && (this.updateTileDownloader(F),
  21095. this.updatePanoRenderer(F)),
  21096. this.updatePreRendering(F),
  21097. this.reticule.update(),
  21098. this.path.update(),
  21099. this.spider.update(),
  21100. this.cachedPanoCandidates && k.navigation.panoScores && this.model.panos.showPanoScores(this.cachedPanoCandidates),
  21101. this.updateControlLocks(),
  21102. this.model.supportsTiles && this.updateZoomPano()
  21103. }
  21104. ),
  21105. t.prototype.updatePersistentZooming = function(e) {
  21106. 1 === this.zooming ? this.zoomBy(1 + this.zoomSpeed * e) : -1 === this.zooming && this.zoomBy(1 - this.zoomSpeed * e)
  21107. }
  21108. ,
  21109. t.prototype.updateControlLocks = function() {
  21110. this.currentPano && this.model.supportsTiles && (this.cameraControls.controls[V.PANORAMA].locked = !this.currentPano.highestFullTileRenderOpCompleted && this.currentPano.lockUntilRenderingComplete)
  21111. }
  21112. ,
  21113. t.prototype.updatePanoRenderer = (D = new B.Vector3,
  21114. function(e) {
  21115. var t = this.nextPano || this.currentPano;
  21116. this.panoRenderer.hasQueuedTiles() && t && (D.copy(T.FORWARD),
  21117. this.getDirection(D),
  21118. this.panoRenderer.updateDirection(D))
  21119. }
  21120. ),
  21121. t.prototype.cleanupInactivePanos = (O = [],
  21122. L = [],
  21123. function() {
  21124. O.length = 0,
  21125. O.push(this.currentPano),
  21126. this.nextPano && O.push(this.nextPano);
  21127. for (var e = L.length = 0; e < this.panoRenderer.activePanos.length; e++)
  21128. L.push(this.panoRenderer.activePanos[e]);
  21129. for (var t = 0; t < L.length; t++) {
  21130. for (var i = L[t], n = !0, r = 0; r < O.length; r++)
  21131. i.id === O[r].id && (n = !1);
  21132. n && i.exit()
  21133. }
  21134. }
  21135. ),
  21136. t.prototype.updatePreRendering = (w = {},
  21137. function(e) {
  21138. if (1 === k.tiling.preRenderTourPanos && this.preRenderingEnabled) {
  21139. var t = this.nextPano || this.currentPano;
  21140. if (t && e && 1 < e.length) {
  21141. var i = e.findIndex(function(e) {
  21142. if (e.id === t.id)
  21143. return !0
  21144. });
  21145. if (0 <= i && i + 1 < e.length) {
  21146. var n = e[i + 1];
  21147. n.isLoaded(this.basePanoSize) || w[n.id] || (window.setTimeout(function(e) {
  21148. this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, null, null, null, !1, !1, !1),
  21149. window.setTimeout(function(e) {
  21150. w[e.id] = !1
  21151. }
  21152. .bind(this, e), k.tiling.panoPreRenderRepeatDelay)
  21153. }
  21154. .bind(this, n), k.tiling.panoPreRenderDelay),
  21155. w[n.id] = !0)
  21156. }
  21157. }
  21158. }
  21159. }
  21160. ),
  21161. t.prototype.enablePreRendering = function() {
  21162. this.preRenderingEnabled = !0
  21163. }
  21164. ,
  21165. t.prototype.disablePreRendering = function() {
  21166. this.preRenderingEnabled = !1,
  21167. this.cleanupInactivePanos()
  21168. }
  21169. ,
  21170. t.prototype.updateTileDownloader = (b = new B.Vector3,
  21171. function(e) {
  21172. var t = this.nextPano || this.currentPano;
  21173. t && (b.copy(T.FORWARD),
  21174. this.getDirection(b),
  21175. this.tileDownloader.tilePrioritizer.updateCriteria(t, this.position, b, 0 < e.length ? e : null),
  21176. this.tileDownloader.processPriorityQueue = !0)
  21177. }
  21178. ),
  21179. t.prototype.updateFromControls = function(e) {
  21180. null != e || (e = 0),
  21181. this.cameraControls.activeControl && (this.cameraControls.activeControl.update(e),
  21182. this.quaternion.copy(this.cameraControls.activeControl.camera.quaternion),
  21183. this.position.copy(this.cameraControls.activeControl.camera.position),
  21184. this.target.copy(this.cameraControls.activeControl.target),
  21185. this.cameraControls.activeControl.camera.updateProjectionMatrix(),
  21186. this.camera.projectionMatrix.copy(this.cameraControls.activeControl.camera.projectionMatrix)),
  21187. this.camera.position.copy(this.position),
  21188. this.camera.quaternion.copy(this.quaternion),
  21189. this.camera.updateMatrix(),
  21190. this.camera.updateMatrixWorld()
  21191. }
  21192. ,
  21193. t.prototype.hasChanged = function(e) {
  21194. if (!this.previousState)
  21195. return this.previousState = {
  21196. allFloorsVisible: this.model.allFloorsVisible,
  21197. position: this.position.clone(),
  21198. quaternion: this.quaternion.clone(),
  21199. mouse: this.mouse.clone(),
  21200. labelScaleFactor: this.getLabelScaleFactor(),
  21201. currentFloor: this.model.currentFloor,
  21202. projectionMatrix: this.camera.projectionMatrix.clone(),
  21203. worldMatrix: this.camera.matrixWorld.clone(),
  21204. mode: this.mode,
  21205. modelPosition: this.model.position.clone(),
  21206. modelCenter: this.model.center.clone(),
  21207. zoomLevel: this.zoomLevel
  21208. },
  21209. !0;
  21210. 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;
  21211. return e.allFloorsVisible = this.model.allFloorsVisible !== this.previousState.allFloorsVisible,
  21212. e.moved = !this.position.equals(this.previousState.position),
  21213. e.rotated = !this.quaternion.equals(this.previousState.quaternion),
  21214. e.mouseMoved = !this.mouse.equals(this.previousState.mouse),
  21215. e.labelScaleFactor = this.getLabelScaleFactor() !== this.previousState.labelScaleFactor,
  21216. e.floorChanged = this.model.currentFloor !== this.previousState.currentFloor,
  21217. e.cameraProjectionChanged = !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix),
  21218. e.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(this.previousState.worldMatrix),
  21219. e.modeChanged = this.mode !== this.previousState.mode,
  21220. e.modelPositionChanged = !this.model.position.equals(this.previousState.modelPosition),
  21221. e.modelCenterChanged = !this.model.center.equals(this.previousState.modelCenter),
  21222. e.nextPanoActive = null !== this.nextPano,
  21223. e.zoomLevel = this.zoomLevel !== this.previousState.zoomLevel,
  21224. this.previousState.allFloorsVisible = this.model.allFloorsVisible,
  21225. this.previousState.position.copy(this.position),
  21226. this.previousState.quaternion.copy(this.quaternion),
  21227. this.previousState.mouse.copy(this.mouse),
  21228. this.previousState.labelScaleFactor = this.getLabelScaleFactor(),
  21229. this.previousState.currentFloor = this.model.currentFloor,
  21230. this.previousState.projectionMatrix.copy(this.camera.projectionMatrix),
  21231. this.previousState.worldMatrix.copy(this.camera.matrixWorld),
  21232. this.previousState.mode = this.mode,
  21233. this.previousState.modelPosition.copy(this.model.position),
  21234. this.previousState.modelCenter.copy(this.model.center),
  21235. this.previousState.zoomLevel = this.zoomLevel,
  21236. !t
  21237. }
  21238. ,
  21239. t.prototype.updateIntersect = function() {
  21240. var e = this.flying || this.isWarping()
  21241. , t = this.isOutsideMode() && this.cameraControls.controls[this.mode].isEngaged()
  21242. , i = G.getById(q.LookTransition);
  21243. e || t || this.isTouchEvent || i.length && i[0].running;
  21244. if (window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setTagVisible)) {
  21245. this.intersect = this.getMouseIntersect(null, VisiSet.footIcons);
  21246. if (this.intersect && this.intersect.object.visible )
  21247. $("#player").css("cursor", "pointer");
  21248. else
  21249. $("#player").css("cursor", "")
  21250. return;
  21251. }
  21252. this.intersect = this.getMouseIntersect(),
  21253. this.intersect && this.updateClosestPano(this.intersect),
  21254. this.closestPano || this.closestPanoInDirection(this.getMouseDirection()) ? (this.reticule.updatePosition(this.position, this.intersect),
  21255. k.navigation.panoScores && !k.navigation.mouseDirection && this.closestPanoInDirection(this.getDirection())) : this.reticule.hide()
  21256. }
  21257. ,
  21258. t.prototype.checkHotClick = function() {
  21259. if (this.intersectHot){
  21260. if (window.VisiSet && VisiSet.setTagVisible ) {
  21261. VisiSet.SetOneTagVisible(this.intersectHot); //设置这个热点的可见性
  21262. return;
  21263. }
  21264. this.intersectHot.noAction || this.intersectHot.examine(this)
  21265. return !0
  21266. }
  21267. }
  21268. ,
  21269. t.prototype.getMouseDirection = function(e) {
  21270. e = e || this.mouse;
  21271. var t = new B.Vector3(e.x,e.y,-1).unproject(this.camera);
  21272. return new B.Vector3(e.x,e.y,1).unproject(this.camera).sub(t).normalize()
  21273. }
  21274. ,
  21275. t.prototype.hoverOverlay = function(mesh){
  21276. if(!mesh){
  21277. this.hoveringPlane = null;
  21278. $("#player").css("cursor",this.currentCursor || "" );
  21279. }else{
  21280. var overlay = mesh.parent;
  21281. $("#player").css("cursor","pointer");
  21282. this.hoveringPlane = overlay;
  21283. return true;
  21284. }
  21285. },
  21286. t.prototype.clickOverlay = function(overlay){
  21287. if(this.openOverlay && !overlay)return;
  21288. var plane = overlay.plane;
  21289. if(overlay.overlayType == "video"){
  21290. if(plane.material.map.image.paused)plane.material.map.image.play()
  21291. else plane.material.map.image.pause();
  21292. }
  21293. if(window.EditOverlay &&EditOverlay.editing){
  21294. if(EditOverlay.editPlane && overlay != EditOverlay.editPlane) EditOverlay.closeOverlayPanel('cancel')
  21295. $('#overlayProp').removeClass('atRight').removeClass('hide')
  21296. EditOverlay.endAddPlane();
  21297. EditOverlay.updateOverlayPanel(overlay)
  21298. transformControls.attach(overlay)
  21299. return;
  21300. }
  21301. },
  21302. t.prototype.getMouseIntersect = function(e, t) {
  21303. e = e || this.mouse.clone(),
  21304. t = t || this.model.floors.reduce(function(e, t) {
  21305. return t.hidden ? e : e.concat(t.collider.children)
  21306. }, this.mode === V.PANORAMA ? this.panoMarkers : []),
  21307. t = t.slice(0)
  21308. for (var i in this.model.hots) t.push(this.model.hots[i].mesh);
  21309. this.overlayGroup && (t = t.concat(this.overlayGroup.children));
  21310. i = new B.Vector3(e.x,e.y,-1).unproject(this.camera);
  21311. this.raycaster.set(i, this.getMouseDirection(e));
  21312. var n = this.raycaster.intersectObjects(t, true);//add true
  21313. if ("add" == g_HotStatus) {
  21314. var r = this.raycaster.intersectObjects(window.player.model.chunks);
  21315. //console.log(r[0]),
  21316. 1 <= r.length ? ($("#player").css("cursor", "cell"),
  21317. window.hotIntersect = r[0]) : ($("#player").css("cursor", "not-allowed"),
  21318. window.hotIntersect = !1)
  21319. return;
  21320. }
  21321. this.intersectHot && this.intersectHot.hideTitle()
  21322. if (0 === n.length)
  21323. return this.intersectHot = null,
  21324. "add" != g_HotStatus && $("#player").css("cursor", ""),
  21325. null;
  21326. var o = n[0];
  21327. if ("hotSprite" == o.object.type){
  21328. this.intersectHot = o.object.belongHot
  21329. this.intersectHot.showTitle()
  21330. $(`.toolRight .spotList ul li[data-spid=${this.intersectHot.sid}]`).addClass("active")
  21331. this.intersectHot.noAction || $("#player").css("cursor", "pointer");
  21332. return;
  21333. }
  21334. $(".toolRight .spotList ul li").removeClass("active")
  21335. this.intersectHot = null;
  21336. /* if(window.EditOverlay && n && n.length){
  21337. if(n[0].object.parent.parent == this.overlayGroup){
  21338. this.hoverOverlay(n[0].object);
  21339. }else()
  21340. } */
  21341. var intersect = this.hoverOverlay(this.overlayGroup && o && o.object.parent.parent == this.overlayGroup && o.object)
  21342. intersect || "add" != g_HotStatus && $("#player").css("cursor", this.currentCursor),
  21343. o.face && (o.normal = o.face.normal.applyQuaternion(o.object.quaternion),
  21344. this.position.clone().sub(o.point).dot(o.normal) < 0 && o.normal.negate(),
  21345. this.currentPano ? o.onFloor = o.point.y < this.position.y - .5 * this.currentPano.height : o.onFloor = o.point.y < this.position.y - .5,
  21346. o.horizontal = .8 < o.normal.y);
  21347. return o
  21348. }
  21349. ,
  21350. t.prototype.updateClosestPano = function(e) {
  21351. var t = [a.filters.isPanoAligned()];
  21352. if (this.mode === V.PANORAMA) {
  21353. if (!this.currentPano)
  21354. return;
  21355. t.push(a.filters.not(this.currentPano)),
  21356. t.push(a.filters.inFloorDirection(this.currentPano.floorPosition, this.getDirection(), .25)),
  21357. t.push(a.filters.isNeighbourPanoTo(this.currentPano)),
  21358. t.push(a.filters.isCloseEnoughTo(e.point, k.panoFloorClickRadius)),
  21359. t.push(a.filters.isNotBehindNormal(e.point, e.normal))
  21360. } else{
  21361. t.push((pano)=>{ // add
  21362. return this.checkHasNeighbor(pano)
  21363. })
  21364. t.push(a.filters.isOnVisibleFloor()),
  21365. this.mode !== V.FLOORPLAN && t.push(a.filters.inDirection(this.position, this.getDirection(), .25));
  21366. }
  21367. var i = this.model.panos.find(t, [a.sortFunctions.floorDistanceToPoint(e.point)]);
  21368. i !== this.closestPano ? (i && (this.isPanoHover = !0),
  21369. this.emit(W.ClosestPanoChanging, this.closestPano, i, this.mode),
  21370. this.closestPano = i) : this.isPanoHover = !1
  21371. }
  21372. ,
  21373. t.prototype.dollhouseMode = function(e, t) {
  21374. this.emit(W.ModeChanging, this.mode, V.DOLLHOUSE),
  21375. this.mode = V.DOLLHOUSE,
  21376. this.cameraControls.controls[V.DOLLHOUSE].reset();
  21377. var i = new B.Vector3(this.model.center.x,0,this.model.center.z)
  21378. , n = new B.Vector3(15,10,15);
  21379. if (e && t) {
  21380. var r = T.FORWARD.clone().applyQuaternion(t)
  21381. , o = this.model.center.clone().sub(e).dot(r);
  21382. 0 < o ? (i = r.clone().multiplyScalar(o).add(e),
  21383. n.copy(e)) : Y.warn("Tried to initiate dollhouse mode that wasn't looking at the model", e, t)
  21384. }
  21385. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(0, !0),
  21386. this.cameraControls.controls[V.DOLLHOUSE].target.copy(i),
  21387. this.cameraControls.cameras[V.DOLLHOUSE].position.copy(n),
  21388. this.updateFromControls(),
  21389. this.model.alpha = 1,
  21390. this.model.skybox.material.uniforms.opacity.value = 0
  21391. }
  21392. ,
  21393. t.prototype.insideMode = function(e, t) {
  21394. var i = $.Deferred()
  21395. , n = t || null;
  21396. if (this.mode !== V.PANORAMA && this.mode !== V.TRANSITIONING) {
  21397. var r = [a.filters.isPanoAligned()];
  21398. this.model.currentFloor && r.push(a.filters.atFloor(this.model.currentFloor)),
  21399. e = e || this.currentPano || this.model.panos.find(r, [a.sortFunctions.distanceToPoint(this.cameraControls.activeControl.target)]),
  21400. this.flyToNewMode({
  21401. mode: V.PANORAMA,
  21402. pano: e,
  21403. callback: n
  21404. }).done(i.resolve.bind(i)).fail(i.reject.bind(i))
  21405. } else {
  21406. var o = this.mode === V.PANORAMA ? "Already in panorama mode" : "Cannot change mode during mode transition";
  21407. i.reject(o)
  21408. }
  21409. return i.promise()
  21410. }
  21411. ,
  21412. t.prototype.fitDollhouse = function(e, t, i) {
  21413. var maxY = this.model.boundingBox.max.y;//add
  21414. var n = T.FORWARD.clone().applyQuaternion(i);
  21415. i = n.clone().add(e);
  21416. this.cameraControls.activeControl.target.copy(i),
  21417. this.cameraControls.activeControl.camera.position.set(0, maxY * 2.4, 0).add(e).add(n.multiplyScalar(-10))
  21418. }
  21419. ,
  21420. t.prototype.floorplanMode = function(e, t, i) {
  21421. this.mode = V.FLOORPLAN;
  21422. var n = this.cameraControls.controls[V.FLOORPLAN];
  21423. n.reset();
  21424. var r = e || this.model.center;
  21425. if (n.target.copy(r).setY(0),
  21426. n.camera.position.copy(r).setY(k.floorplan.cameraHeight),
  21427. i ? (n.currentScale = i / ($("#player").width() / $("#player").height()),
  21428. n.absoluteScale = n.currentScale) : n.zoomToContain(this.model.size),
  21429. t) {
  21430. var o = T.LEFT.clone().applyQuaternion(t);
  21431. n.rotateLeft(-Math.atan2(o.x, o.z))
  21432. } else
  21433. n.rotateToView(this.model.size, this.getDirection());
  21434. n.update(0)
  21435. }
  21436. ,
  21437. t.prototype.nonInterruptingFlyToPano = function(e, t) {
  21438. return e.skipWarpingCheck = !0,
  21439. this.flyToPano(e, t)
  21440. }
  21441. ,
  21442. t.prototype.updateMarkerVisi = function() {//加
  21443. if(this.mode != "panorama")return;
  21444. this.model.panos.list.forEach((pano)=>{
  21445. if(!pano.marker)return;
  21446. pano.marker.material.visible = !!pano.neighbourPanos[this.currentPano.id];
  21447. })
  21448. }
  21449. ,
  21450. t.prototype.updateHotVisible = function(pano){
  21451. var hots = this.model.hots;
  21452. pano = pano || this.currentPano;
  21453. for (var index in hots){
  21454. var visible;
  21455. if(this.mode != "panorama"){
  21456. visible = true;
  21457. }else{
  21458. //hots[index].mesh.material.depthTest = false;
  21459. visible = !hots[index].visiblePanos || hots[index].visiblePanos.indexOf(pano.id) > -1
  21460. }
  21461. hots[index].mesh.visible = visible;
  21462. }
  21463. },
  21464. t.prototype.flyToPano = function(e, t) {
  21465. //e.duration = 100
  21466. var i, n = e.pano, r = e.lookAtPoint, o = e.duration, a = e.aimDuration, s = e.maxDistanceOverride, l = e.skipWarpingCheck, c = e.constantMoveSpeed, h = null, u = null;
  21467. if (window.specialScene && specialScene.special().specifySpot && specialScene.special().specifySpot(n),
  21468. this.isWarping() && !l && (this.path.activeTransType === R.BLACK || this.path.activeTransType === R.STD))
  21469. return Y.warn("Player.flyToPano() -> Cannot fly when warping"),
  21470. t && t(),
  21471. !1;
  21472. if (this.updateLastView(),
  21473. this.mode !== V.PANORAMA)
  21474. return r && (i = (new B.Quaternion).setFromUnitVectors(T.FORWARD, r.sub(n.position).normalize())),
  21475. void this.flyToNewMode({
  21476. mode: V.PANORAMA,
  21477. pano: n,
  21478. duration: o,
  21479. quaternion: i,
  21480. callback: t
  21481. });
  21482. if (!n || (h = x.deepExtend(e),
  21483. u = function() {
  21484. j.delayOneFrame(function() {
  21485. this.flyToPano(h, t)
  21486. }
  21487. .bind(this))
  21488. }
  21489. .bind(this),
  21490. !this.checkAndWaitForPanoLoad(n, "high", "low", this.basePanoSize, u))) {
  21491. var d = function(e) {
  21492. t && t(e)
  21493. }
  21494. .bind(this);
  21495. this.currentPano || (this.currentPano = n,
  21496. this.path.placeCpm(),
  21497. this.path.fadeOutCpm(k.path.fadeOutTime),
  21498. this.spider.draw());
  21499. var p = o;
  21500. if ("number" != typeof o) {
  21501. var f = s || k.transition.flytimeMaxDistanceThreshold;
  21502. p = Math.min(this.currentPano.position.distanceTo(n.position), f) * k.transition.flytimeDistanceMultiplier + k.transition.flyTime
  21503. }
  21504. if (.01 < k.transition.flySpeed && (p = 1e3 * this.currentPano.position.distanceTo(n.position) / k.transition.flySpeed),
  21505. 1 !== this.zoomLevel)
  21506. switch (k.zoom.transitionStyle) {
  21507. case 1:
  21508. this.smoothZoomToDefault(p / 2);
  21509. break;
  21510. case 2:
  21511. return h = x.deepExtend(e),
  21512. u = this.flyToPano.bind(this, h, t),
  21513. void this.smoothZoomToDefault(k.zoom.restoreTime * (this.zoomLevel - 1), u)
  21514. }
  21515. if (r) {
  21516. G.cancelById(q.LookTransition),
  21517. p *= k.transition.aimSlowFactor;
  21518. var g = this.cameraControls.activeControl.camera.quaternion.clone()
  21519. , m = (new B.Matrix4).lookAt(n.position, r, T.UP)
  21520. , v = (new B.Quaternion).setFromRotationMatrix(m)
  21521. , y = g.clone()
  21522. , A = new B.Vector3;
  21523. if (n === this.currentPano) {
  21524. var C = T.FORWARD.clone().applyQuaternion(g)
  21525. , I = T.FORWARD.clone().applyQuaternion(v)
  21526. , E = C.angleTo(I);
  21527. return null != a || (a = 1 * Math.sqrt(E) / k.tags.navigate.rotateSpeedFactor * 1e3),
  21528. void G.start(function(e) {
  21529. y.copy(g),
  21530. H.quaternion(y, v)(e),
  21531. A.copy(T.FORWARD).applyQuaternion(y).add(this.cameraControls.activeControl.camera.position),
  21532. this.cameraControls.activeControl.lookAt(A)
  21533. }
  21534. .bind(this), a, d, 0, z[k.transition.movementEasing], null, q.LookTransition)
  21535. }
  21536. }
  21537. if (n === this.currentPano || this.flying)
  21538. return void d();
  21539. this.flying = !0;
  21540. var _ = this.position.clone()
  21541. , b = this.currentPano;
  21542. Y.debug("Flying to pano ", n.position);
  21543. this.emit(W.PanoChosen, this.currentPano, n);
  21544. this.emit(W.FlyingStarted, n.position, _, n, b);
  21545. this.updateHotVisible(n); //更新热点显示
  21546. this.transitionPos({type:"beforeFlytopano", pano:n, dur:p})//add
  21547. r && G.start(function(e) {
  21548. y.copy(g),
  21549. H.quaternion(y, v)(e),
  21550. A.copy(T.FORWARD).applyQuaternion(y).add(this.cameraControls.activeControl.camera.position),
  21551. this.cameraControls.activeControl.lookAt(A)
  21552. }
  21553. .bind(this), p, null, 0, z[k.transition.movementEasing], null, q.LookTransition);
  21554. var w = c ? null : z[k.transition.movementEasing];
  21555. this.nextPano = n;
  21556. G.start(H.uniform(this.model.skybox, "progress", 1), p, null, 0, z[k.transition.blendEasing], "skyFly", q.FlyToPano),
  21557. G.start(H.allUniforms(this.model.chunks, "progress", 1), p, null, 0, z[k.transition.blendEasing], "chunkFly", q.FlyToPano),
  21558. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, n.position), p, function(e) {
  21559. this.flying = !1,
  21560. this.currentPano !== n && this.currentPano.exit(),
  21561. n.enter(),
  21562. this.currentPano = n,
  21563. this.nextPano = null,
  21564. this.path.placeCpm(),
  21565. this.path.fadeOutCpm(k.path.fadeOutTime),
  21566. this.spider.draw(),
  21567. this.emit(W.FlyingEnded, n.position, _, n, b),
  21568. this.updateMarkerVisi();//add
  21569. d(e)
  21570. if(this.mode == "panorama" && EditOverlay.editing){
  21571. EditOverlay.updatePano(this.currentPano)
  21572. }
  21573. }
  21574. .bind(this), 0, w, "camFly", q.FlyToPano)
  21575. }
  21576. }
  21577. ,
  21578. window._transitionPosId = 9999
  21579. t.prototype.transitionPos = function(o={}) {//渐变overlay和热点的位置
  21580. G.cancelById(_transitionPosId)
  21581. var begin = function(object, pos, qua, scale){
  21582. if(pos){
  21583. if(!same(object.position, pos, 0.01)){
  21584. G.start(H.vector(object.position, pos), o.dur, (e)=>{
  21585. },0, z[k.transition.movementEasing], "transitionPos", _transitionPosId)
  21586. }
  21587. if(!same(object.quaternion, qua, 1e-6)){
  21588. G.start(H.quaternion(object.quaternion, qua), o.dur, (e)=>{
  21589. },0, z[k.transition.movementEasing], "transitionPos", _transitionPosId)
  21590. }
  21591. if(!same(object.scale, scale, 0.001)){
  21592. G.start(H.vector(object.scale, scale), o.dur, (e)=>{
  21593. },0, z[k.transition.movementEasing], "transitionPos", _transitionPosId)
  21594. }
  21595. }
  21596. }
  21597. var same = function(vec1, vec2, diff){
  21598. var s = Math.abs(vec1.x-vec2.x) < diff && Math.abs(vec1.y-vec2.y) < diff && Math.abs(vec1.z-vec2.z) < diff
  21599. if(s && vec1.w) s = Math.abs(vec1.w-vec2.w) < diff
  21600. return s
  21601. }
  21602. this.overlayGroup.children.forEach(overlay=>{
  21603. var panoData = o.pano != void 0 && overlay.transformAtPanos[o.pano.id]
  21604. var useCustom = o.type == "beforeFlyOut" || !panoData
  21605. var pos = useCustom ? overlay.posCustom : panoData.pos;
  21606. var qua = useCustom ? overlay.quaCustom : panoData.qua;
  21607. var scale = useCustom ? overlay.getScaleBySize(overlay.widthCustom, overlay.heightCustom) :
  21608. overlay.getScaleBySize(panoData.width , panoData.height)
  21609. scale = new THREE.Vector3(scale.x, scale.y, overlay.scale.z)
  21610. begin(overlay, pos, qua, scale )
  21611. })
  21612. }
  21613. t.prototype.fastForwardActivePanoFlight = function(e) {
  21614. e = e || k.transition.fastForwardFactor / 10 * 4 + 1,
  21615. G.adjustSpeed(q.FlyToPano, e),
  21616. G.adjustSpeed(q.LookTransition, e)
  21617. }
  21618. ,
  21619. t.prototype.flyToPanoClosestToMouse = function() {
  21620. if (50 < Date.now() - this.mouseLastMoveTime && (this.intersect = this.getMouseIntersect(),
  21621. this.intersect && this.updateClosestPano(this.intersect)),
  21622. this.closestPano)
  21623. return this.flyToPano({
  21624. pano: this.closestPano
  21625. });
  21626. var e = this.getMouseDirection();
  21627. this.flyDirection(e) || this.flyToPano({
  21628. pano: this.currentPano
  21629. })
  21630. }
  21631. ,
  21632. t.prototype.flyLocalDirection = function(e) {
  21633. var t = this.getDirection(e)
  21634. , i = 1 === e.z ? .4 : .75
  21635. , n = 1 === Math.abs(e.x);
  21636. return this.flyDirection(t, i, n)
  21637. }
  21638. ,
  21639. t.prototype.flyDirection = function(e, t, i) {
  21640. this.closePopup();
  21641. var n = $.Deferred();
  21642. this.history.invalidate();
  21643. var r = this.closestPanoInDirection(e, t, i);
  21644. return r ? this.flyToPano({
  21645. pano: r
  21646. }, n.resolve.bind(n, !0)) : (this.bump(e),
  21647. n.resolve(!1)),
  21648. n.promise()
  21649. }
  21650. ,
  21651. t.prototype.closestPanoInDirection = function(e, t, i) {
  21652. return this.rankedPanoInDirection(0, e, t, i)
  21653. }
  21654. ,
  21655. t.prototype.rankedPanoInDirection = (_ = {
  21656. pano: null,
  21657. candidates: []
  21658. },
  21659. function(e, t, i, n) {
  21660. e = e || 0,
  21661. i = void 0 !== i ? i : .75;
  21662. var r = n ? "angle" : "direction";
  21663. return this.model.panos.findRankedByScore(e, [a.filters.isPanoAligned(), a.filters.inPanoDirection(this.position, t, i), a.filters.isNeighbourPanoTo(this.currentPano), a.filters.not(this.currentPano)], [a.scoreFunctions.distanceSquared(this.currentPano), a.scoreFunctions[r](this.position, t)], _),
  21664. this.cachedPanoCandidates = _.candidates,
  21665. _.pano
  21666. }
  21667. ),
  21668. t.prototype.bump = function(e) {
  21669. if (this.mode === V.PANORAMA && !this.flying && !this.isWarping()) {
  21670. var t, i, n, r = k.transition, o = (r.flytimeMaxDistanceThreshold * r.flytimeDistanceMultiplier + r.flyTime) / 8, a = this.camera.getWorldDirection().dot(e);
  21671. if (.5 < Math.abs(a))
  21672. t = function() {
  21673. G.start(H.property(this.cameraControls.cameras[V.PANORAMA], "zoom", 0 < a ? 1.04 : .96), o, i, 0, z.easeInOutSine, "bumpZStart")
  21674. }
  21675. .bind(this),
  21676. i = function() {
  21677. G.start(H.property(this.cameraControls.cameras[V.PANORAMA], "zoom", 1), 5 * o, n, 0, z.easeInOutSine, "bumpZRelax")
  21678. }
  21679. .bind(this);
  21680. else {
  21681. var s = this.camera.position.clone()
  21682. , l = e.clone();
  21683. this.raycaster.set(s, l);
  21684. var c = this.model.floors.reduce(function(e, t) {
  21685. return e.concat(t.collider.children)
  21686. }, [])
  21687. , h = this.raycaster.intersectObjects(c)
  21688. , u = 0 < h.length ? h[0].distance / 25 : .04
  21689. , d = s.clone().add(l.multiplyScalar(u));
  21690. t = function() {
  21691. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, d), o, i, 0, z.easeInOutSine, "bumpTStart")
  21692. }
  21693. .bind(this),
  21694. i = function() {
  21695. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, s), 5 * o, n, 0, z.easeInOutSine, "bumpTRelax")
  21696. }
  21697. .bind(this)
  21698. }
  21699. n = function() {
  21700. this.flying = !1
  21701. }
  21702. .bind(this),
  21703. this.flying = !0,
  21704. t()
  21705. }
  21706. }
  21707. ,
  21708. t.prototype.changeFloor = function(e) {
  21709. if (!this.is360View(this.mode, this.currentPano))
  21710. if (this.mode === V.PANORAMA) {
  21711. var t = this.history.reversePano(e);
  21712. t && t.isAligned() ? this.flyToPano({
  21713. pano: t
  21714. }) : this.changeFloorByScore(e)
  21715. } else
  21716. this.model.setFloor(this.model.nextFloor(e) || this.model.currentFloor)
  21717. }
  21718. ,
  21719. t.prototype.changeFloorByScore = (E = {
  21720. pano: null,
  21721. candidates: []
  21722. },
  21723. function(e) {
  21724. var t = this.model.nextFloor(e);
  21725. return t ? (this.model.panos.lowestByScore([a.filters.atFloor(t), a.filters.isPanoAligned()], [a.scoreFunctions.distance(this.currentPano), a.scoreFunctions.direction(this.position, new B.Vector3(0,e,0)), a.scoreFunctions.penalizeHeightDifferenceUnder(this.position, .5)], E),
  21726. void (E.pano ? (this.cachedPanoCandidates = E.candidates,
  21727. this.history.push(e, this.currentPano),
  21728. this.flyToPano({
  21729. pano: E.pano
  21730. })) : Y.warn("No pano found on selected floor, not moving there."))) : void Y.debug("player.changeFloor(" + e + "): no such floor")
  21731. }
  21732. ),
  21733. t.prototype.gotoFloor = function(e) {
  21734. var t = e - this.model.currentFloor.floorIndex;
  21735. this.changeFloor(t)
  21736. }
  21737. ,
  21738. t.prototype.getDirection = function(e) {
  21739. return (e = e || (new B.Vector3).copy(T.FORWARD)).applyQuaternion(this.camera.quaternion)
  21740. }
  21741. ,
  21742. t.prototype.flyToSameMode = function(e, t, i, n, r) {
  21743. if (r = r || $.Deferred(),
  21744. this.mode === V.TRANSITIONING)
  21745. return Y.warn("should not be transitioning here"),
  21746. n && n(!1),
  21747. r.reject().promise();
  21748. var o = i || !1
  21749. , a = i ? i.position : this.position
  21750. , s = this.position.clone()
  21751. , l = this.currentPano;
  21752. if (Y.debug("New pose in mode " + this.mode),
  21753. !e || (retryCallback = function() {
  21754. j.delayOneFrame(function() {
  21755. this.flyToSameMode(e, t, i, n, r)
  21756. }
  21757. .bind(this))
  21758. }
  21759. .bind(this),
  21760. !this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, retryCallback))) {
  21761. var c = function() {
  21762. this.emit(W.FlyingEnded, a, s, e, l),
  21763. n && n(!0)
  21764. }
  21765. .bind(this)
  21766. , h = k[this.mode]
  21767. , u = void 0 !== t ? t : h.transitionTime
  21768. , d = new B.Vector3
  21769. , p = new B.Vector3;
  21770. if (this.emit(W.FlyingStarted, a, s, e, l),
  21771. this.mode === V.PANORAMA)
  21772. Y.warn("we should not be here for panorama views");
  21773. else if (this.mode === V.DOLLHOUSE)
  21774. if (o) {
  21775. var f = new B.Vector3(0,1,0);
  21776. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(1, !0),
  21777. this.model.warpDestFloors(i.floorVisibility),
  21778. p.copy(i.position);
  21779. var g = new B.Vector3(0,0,-1).applyQuaternion(i.quaternion)
  21780. , m = new B.Raycaster(p.clone(),g.clone(),0,1 / 0).intersectObjects(this.model.colliders)
  21781. , v = 3;
  21782. m.length ? (d.copy(m[0].point),
  21783. v = .75 * p.distanceTo(d)) : (d.copy(g).multiplyScalar(3).add(p),
  21784. Y.debug("Tried to restore dollhouse mode that did not intersect...", i.position, i.quaternion));
  21785. var y = (new B.Matrix4).lookAt(p, d, f)
  21786. , A = (new B.Euler).setFromRotationMatrix(y, k.warp.eOrder)
  21787. , C = d.distanceTo(p)
  21788. , I = (new B.Matrix4).lookAt(this.cameraControls.cameras[V.DOLLHOUSE].position, this.cameraControls.controls[V.DOLLHOUSE].target, f)
  21789. , E = (new B.Euler).setFromRotationMatrix(I, k.warp.eOrder)
  21790. , _ = this.cameraControls.cameras[V.DOLLHOUSE].position.distanceTo(this.cameraControls.controls[V.DOLLHOUSE].target);
  21791. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(Math.min(_, v), !0);
  21792. var b = new B.Euler(A.x - E.x,A.y - E.y,A.z - E.z,k.warp.eOrder);
  21793. b.y = b.y > Math.PI ? b.y -= 2 * Math.PI : b.y < -Math.PI ? b.y += 2 * Math.PI : b.y,
  21794. this.path.burnsDir = Math.sign(b.y);
  21795. var w = new B.Euler(0,0,0,k.warp.eOrder)
  21796. , T = new B.Vector3;
  21797. G.start(H.vector(this.cameraControls.controls[V.DOLLHOUSE].target, d), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode),
  21798. G.start(function(e, t) {
  21799. w.x = E.x + e * b.x,
  21800. w.y = E.y + e * b.y,
  21801. w.z = E.z + e * b.z;
  21802. var i = _ + e * (C - _);
  21803. T.set(0, 0, i).applyEuler(w).add(this.cameraControls.controls[V.DOLLHOUSE].target),
  21804. this.cameraControls.cameras[V.DOLLHOUSE].position.copy(T).add(this.model.position)
  21805. }
  21806. .bind(this), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode),
  21807. G.start(function(e, t) {
  21808. this.cameraControls.controls[V.DOLLHOUSE].update(),
  21809. this.quaternion.copy(this.cameraControls.cameras[V.DOLLHOUSE].quaternion),
  21810. this.position.copy(this.cameraControls.cameras[V.DOLLHOUSE].position)
  21811. }
  21812. .bind(this), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode)
  21813. } else
  21814. Y.warn("invalid warp destination in flyToSameMode()? ignore it then");
  21815. else if (this.path.placeCpm(),
  21816. this.path.fadeInCpm(k.path.fadeInTime),
  21817. i) {
  21818. this.model.warpDestFloors(i.floorVisibility);
  21819. var x = this.cameraControls.cameras[V.FLOORPLAN]
  21820. , S = this.cameraControls.controls[V.FLOORPLAN]
  21821. , M = S.target.clone()
  21822. , R = i.position.clone().sub(M)
  21823. , P = x.position.clone().sub(S.target).length()
  21824. , O = new B.Vector3(-1,0,0).applyQuaternion(i.quaternion).normalize()
  21825. , L = Math.atan2(S.offset.x, S.offset.z)
  21826. , D = Math.atan2(O.x, O.z)
  21827. , N = S.absoluteScale
  21828. , F = U.convertWorkshopOrthoZoom(i.orthoZoom);
  21829. G.start(function(e, t) {
  21830. S.target.copy(R).multiplyScalar(e).add(M);
  21831. var i = L + (D - L) * e;
  21832. S.offset.x = P * Math.sin(i),
  21833. S.offset.z = P * Math.cos(i),
  21834. x.position.copy(S.target).add(S.offset),
  21835. S.absoluteScale = N + e * (F - N),
  21836. S.update(),
  21837. this.quaternion.copy(x.quaternion),
  21838. this.position.copy(x.position),
  21839. this.target.copy(S.target),
  21840. this.camera.projectionMatrix.copy(x.projectionMatrix)
  21841. }
  21842. .bind(this), u, null, 0, z[k.flydown.movementEasing], null, q.FlyToSameMode)
  21843. } else
  21844. Y.info("flyToSameMode() funny floorplan view? skipping");
  21845. return G.setTimeout(function(e) {
  21846. this.mode = e,
  21847. c(),
  21848. r.resolve(!0)
  21849. }
  21850. .bind(this, this.mode), u, q.FlyToSameMode),
  21851. this.mode = V.TRANSITIONING,
  21852. r.promise()
  21853. }
  21854. }
  21855. ,
  21856. t.prototype.flyToNewMode = function(e, t) {
  21857. var i = (e = e || {}).mode
  21858. , n = e.pano
  21859. , r = e.duration
  21860. , o = e.warpDest
  21861. , a = e.callback
  21862. , s = e.force
  21863. , l = e.quaternion;
  21864. if (t = t || $.Deferred(),
  21865. this.isWarping())
  21866. return Y.warn("Player.flyToNewMode() -> Cannot fly when warping"),
  21867. a && a(!1),
  21868. t.reject("Cannot change mode during tour transition").promise();
  21869. if (this.mode === V.TRANSITIONING)
  21870. return a && a(!1),
  21871. t.reject("Cannot change mode during mode transition").promise();
  21872. if (i === this.mode)
  21873. return s ? (this.flyToSameMode(n, r, o, a).done(t.resolve.bind(t)).fail(t.reject.bind(t)),
  21874. t.promise()) : (a && a(!1),
  21875. t.reject("Already in " + i + " mode").promise());
  21876. var c = o || !1;
  21877. Y.debug("Switching mode to " + i);
  21878. var h = function() {
  21879. j.delayOneFrame(function() {
  21880. this.flyToNewMode(e, t)
  21881. }
  21882. .bind(this))
  21883. }
  21884. .bind(this);
  21885. if (n && this.checkAndWaitForPanoLoad(n, "low", "low", this.basePanoSize, h))
  21886. return t.promise();
  21887. if (!this.model.meshTexturesLoaded && this.isOutsideMode(i))
  21888. return Y.info("Waiting for model textures to be loaded before going out to dollhouse"),
  21889. this.model.waitForLoad(this.model, function() {
  21890. return this.model.meshTexturesLoaded
  21891. }
  21892. .bind(this)),
  21893. this.model.loadMeshTextures().done(h),
  21894. t.promise();
  21895. this.history.invalidate(),
  21896. this.updateLastView();
  21897. var u = this.mode
  21898. , d = this.cameraControls.cameras[i];
  21899. e = x.deepExtend({}, k[i], k[u + "-" + i]);
  21900. var p = void 0 !== r ? r : e.transitionTime;
  21901. this.emit(W.ModeChanging, u, i, n),
  21902. n && (this.currentPano = n),
  21903. this.switchCameraMode(i, l),
  21904. G.cancelById(q.LookTransition);
  21905. var f = (new B.Vector3).copy(this.position);
  21906. this.modeTran = this.mode + "-" + i;
  21907. if(this.mode == "floorplan" && window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setTagVisible)){
  21908. VisiSet.finishSetPanoVisible()
  21909. VisiSet.finishSetTagVisible()
  21910. }
  21911. if(editTool.atPanel == "screen"){
  21912. if(this.mode == "panorama") $(".confirmSnap").addClass("unable")
  21913. else if(i == "panorama") $(".confirmSnap").removeClass("unable")
  21914. }
  21915. if(i == "panorama"){
  21916. this.transitionPos({type:"beforeFlyIn", pano:n, dur:p})//add
  21917. }else{
  21918. this.transitionPos({type:"beforeFlyOut", dur:p/2})//add
  21919. }
  21920. if (i === V.PANORAMA)
  21921. this.emit(W.PanoChosen, n, n),
  21922. setTimeout(function() {
  21923. n.floor.enter(i)
  21924. }
  21925. .bind(this), p / 2),
  21926. this.path.fadeOutCpm(k.path.fadeOutTime);
  21927. else if (i === V.DOLLHOUSE) {
  21928. if (c && (this.model.stayPut = !0),
  21929. o ? (this.cameraControls.controls[V.DOLLHOUSE].resetRanges(1, !0),
  21930. this.model.warpDestFloors(o.floorVisibility)) : this.model.toggleAllFloors(!0),
  21931. this.path.placeCpm(),
  21932. this.path.fadeInCpm(k.path.fadeInTime),
  21933. c) {
  21934. var g = new B.Vector3(this.model.center.x,0,this.model.center.z);
  21935. f.set(15, 10, 15);
  21936. var m = new B.Vector3(0,0,-1).applyQuaternion(o.quaternion)
  21937. , v = new B.Raycaster(o.position.clone(),m.clone(),0,1 / 0).intersectObjects([this.sceneIntersectionPlane]);
  21938. v.length ? (g.copy(v[0].point),
  21939. f.copy(o.position),
  21940. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(.75 * f.distanceTo(g), !0)) : (Y.warn("Tried to restore dollhouse mode that did not intersect...", o.position, o.quaternion),
  21941. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(3, !0)),
  21942. this.cameraControls.controls[V.DOLLHOUSE].target.copy(g),
  21943. f.add(this.model.position),
  21944. d.position.copy(f),
  21945. this.cameraControls.controls[V.DOLLHOUSE].update()
  21946. }
  21947. } else if (this.path.placeCpm(),
  21948. this.path.fadeInCpm(k.path.fadeInTime),
  21949. o) {
  21950. this.model.warpDestFloors(o.floorVisibility);
  21951. var y = this.cameraControls.cameras[V.FLOORPLAN]
  21952. , A = this.cameraControls.controls[V.FLOORPLAN]
  21953. , C = y.position.clone().sub(A.target)
  21954. , I = new B.Vector3(-1,0,0).applyQuaternion(o.quaternion).normalize()
  21955. , E = Math.atan2(I.x, I.z);
  21956. A.target.copy(o.position);
  21957. var _ = C.length();
  21958. A.offset.x = _ * Math.sin(E),
  21959. A.offset.y = 0,
  21960. A.offset.z = _ * Math.cos(E),
  21961. y.position.copy(A.target).add(A.offset),
  21962. A.target.clone().sub(d.position),
  21963. d.quaternion.copy(o.quaternion),
  21964. A.currentScale = U.convertWorkshopOrthoZoom(o.orthoZoom),
  21965. A.absoluteScale = A.currentScale,
  21966. A.update()
  21967. } else
  21968. this.model.currentFloor.enter(i);
  21969. var b = this.currentPano
  21970. , w = this.position.clone();
  21971. return this.emit(W.FlyingStarted, f, w, n, this.currentPano),
  21972. this.flying = !0,
  21973. this.isOutsideMode(i) && this.is360View(u, b) ? (c || i !== V.DOLLHOUSE || (d.position.set(15, 10, 15),
  21974. d.controls.target.set(this.model.center.x, 0, this.model.center.z),
  21975. d.controls.update()),
  21976. e.blackoutStyle = P.FADEIN,
  21977. p = k.show360Views.transitionTime,
  21978. this.fade360View(p, d, e)) : this.isOutsideMode(u) && this.is360View(i, n) ? (c && this.switchCameraMode(i, c.quaternion),
  21979. this.mode = i,
  21980. this.path && this.path.popOutCpm(),
  21981. e.blackoutStyle = P.END,
  21982. p = k.show360Views.transitionTime,
  21983. this.fade360View(p, d, e)) : (G.start(H.property(this.model, "alpha", e.modelAlpha, null), p * e.modelAlphaLength, null, e.modelAlphaDelay, null, q.FlyToNewMode),
  21984. G.start(H.vector(this.position, d.position), p, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToNewMode),
  21985. G.start(H.quaternion(this.quaternion, d.quaternion), p * e.rotationDuration, null, e.rotationDelay, z[k.flydown.rotationEasing], null, q.FlyToNewMode),
  21986. G.start(H.matrix4(this.camera.projectionMatrix, d.projectionMatrix), p * e.cameraMatrixDuration, null, e.cameraMatrixDelay, e.cameraMatrixEase, null, q.FlyToNewMode),
  21987. G.start(H.uniform(this.model.skybox, "opacity", e.skyboxOpacity), p * e.skyboxOpacityLength, null, e.skyboxOpacityDelay, null, q.FlyToNewMode),
  21988. G.start(H.property(this.reticule.material.uniforms.opacity, "value", 0), p, null, q.FlyToNewMode)),
  21989. G.setTimeout(function() {
  21990. this.flying = !1,
  21991. u === V.PANORAMA && i !== V.PANORAMA ? this.currentPano.exit() : u !== V.PANORAMA && i === V.PANORAMA && (this.currentPano !== b && b.exit(),
  21992. this.currentPano.enter(),
  21993. this.path.placeCpm(),
  21994. this.path.fadeOutCpm(k.path.fadeOutTime),
  21995. this.spider.draw()),
  21996. u === V.DOLLHOUSE && this.cameraControls.controls[V.DOLLHOUSE].resetRanges(),
  21997. this.mode = i,
  21998. this.emit(W.FlyingEnded, f, w, this.currentPano, b)
  21999. if (this.afterCModeFuc) {
  22000. //手动加的函数
  22001. var cf = this.afterCModeFuc;
  22002. this.afterCModeFuc = null;//因为可能在执行afterCModeFuc时需要再添加afterCModeFuc所以要置空的话提前
  22003. cf();
  22004. }
  22005. this.updateMarkerVisi();//add
  22006. (u === V.PANORAMA || i == V.PANORAMA) && this.updateHotVisible()//add
  22007. if(this.mode == "panorama" && EditOverlay.editing){
  22008. EditOverlay.updatePano(this.currentPano)
  22009. }
  22010. //this.mode == u.PANORAMA && this.transitionPos({type:"flyDone", this.currentPano})//add
  22011. c && u !== V.PANORAMA && i === V.PANORAMA ? this.startWarp(M.Retain, S.Retain, R.BLACK, null, null, a) : (a && a(),
  22012. t.resolve())
  22013. }
  22014. .bind(this), p, q.FlyToNewMode),
  22015. this.mode = V.TRANSITIONING,
  22016. t.promise()
  22017. }
  22018. ,
  22019. t.prototype.fade360View = function(e, t, i) {
  22020. this.tagManager.hideShowTagsForBlackoutStyle(i.blackoutStyle, e),
  22021. $(this.domElement).fadeOut(.5 * e, function() {
  22022. this.model.skybox.material.uniforms.opacity.value = i.skyboxOpacity,
  22023. this.model.alpha = i.modelAlpha,
  22024. this.position.copy(t.position),
  22025. this.quaternion.copy(t.quaternion),
  22026. this.camera.projectionMatrix.copy(t.projectionMatrix),
  22027. $(this.domElement).fadeIn(.5 * e)
  22028. }
  22029. .bind(this))
  22030. }
  22031. ,
  22032. t.prototype.findDefaultViews = function() {
  22033. this.findDefaultView(this.lastInsideView, !0),
  22034. this.findDefaultView(this.last360View, !1)
  22035. }
  22036. ,
  22037. t.prototype.findDefaultView = function(e, i) {
  22038. var t, n = this.model.heroLocations, r = this.model.panos, o = n.findIndex(function(e) {
  22039. if (e.cameraMode !== V.PANORAMA)
  22040. return !1;
  22041. var t = r.get(e.panoId);
  22042. return t && t.isAligned() === i
  22043. });
  22044. 0 <= o ? (t = r.get(n[o].panoId),
  22045. e.update({
  22046. cameraMode: V.PANORAMA,
  22047. pano: t,
  22048. position: n[o].position,
  22049. quaternion: n[o].quaternion
  22050. })) : 0 <= (o = r.list.findIndex(function(e) {
  22051. return e.isAligned() === i
  22052. })) ? (t = r.list[o],
  22053. e.update({
  22054. cameraMode: V.PANORAMA,
  22055. pano: t,
  22056. position: t.position
  22057. })) : Y.warn("There are no", i ? "inside" : "360º", "views in this model")
  22058. }
  22059. ,
  22060. t.prototype.updateLastView = function() {
  22061. this.mode === V.PANORAMA && (this.currentPano.isAligned() ? this.lastInsideView : this.last360View).update({
  22062. pano: this.currentPano,
  22063. position: this.position,
  22064. quaternion: this.quaternion
  22065. })
  22066. }
  22067. ,
  22068. t.prototype.goToLastView = function(e, t) {
  22069. var i = $.Deferred()
  22070. , n = i.resolve.bind(i)
  22071. , r = i.reject.bind(i)
  22072. , o = e ? this.lastInsideView : this.last360View;
  22073. return this.isInMode(V.PANORAMA) && this.currentPano.isAligned() !== e && this.updateLastView(),
  22074. this.isInMode(V.PANORAMA) ? (this.path && this.path.popOutCpm(),
  22075. this.fadeToView(e, o, k.show360Views.transitionTime, t).done(n).fail(r)) : this.isOutsideMode() && this.flyToNewMode({
  22076. mode: o.cameraMode,
  22077. pano: o.pano,
  22078. quaternion: o.quaternion,
  22079. callback: t
  22080. }).done(n).fail(r),
  22081. i.promise()
  22082. }
  22083. ,
  22084. t.prototype.fadeToView = function(e, t, i, n) {
  22085. var r = $.Deferred()
  22086. , o = r.resolve.bind(r)
  22087. , a = r.reject.bind(r);
  22088. if (!t.isValid() || t.cameraMode === V.PANORAMA && !t.pano)
  22089. return Y.warn("Tried to fade to an illegal view", t.cameraMode),
  22090. a("Cannot go to illegal view"),
  22091. r.promise();
  22092. var s = (k[t.cameraMode],
  22093. function() {
  22094. $(this.domElement).fadeIn(.5 * i),
  22095. n && n(),
  22096. o()
  22097. }
  22098. .bind(this))
  22099. , l = e ? P.FADEIN : P.END;
  22100. return this.tagManager.hideShowTagsForBlackoutStyle(l, i),
  22101. $(this.domElement).fadeOut(.5 * i, function() {
  22102. this.model.fadePanoMarkers(e ? k.panorama.markerOpacity : 0),
  22103. t.cameraMode === V.PANORAMA ? this.flyToPano({
  22104. pano: t.pano,
  22105. lookAtPoint: T.FORWARD.clone().applyQuaternion(t.quaternion).add(t.pano.position),
  22106. duration: 0
  22107. }, s) : this.flyToNewMode({
  22108. mode: t.cameraMode,
  22109. quaternion: t.quaternion,
  22110. duration: 0,
  22111. callback: s
  22112. })
  22113. }
  22114. .bind(this)),
  22115. r.promise()
  22116. }
  22117. ,
  22118. t.prototype.startWarp = function(e, t, i, n, r, o) {
  22119. if (this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !1),
  22120. this.flying)
  22121. return Y.warn("Player.startWarp() -> Cannot warp when flying"),
  22122. o && o(),
  22123. !1;
  22124. null != e || (e = M.Show),
  22125. this.history.invalidate(),
  22126. e !== M.Retain ? this.path.brushToWarpPano(i, R.BLACK) || (i = R.BLACK) : i = this.path.upcomingTransType;
  22127. var a = this.path.warpDestPano && !this.path.warpDestPano.isAligned();
  22128. return this.emit(W.WarpStarted, a, i, n, r),
  22129. n = n || P.MIDDLE,
  22130. this.path.warpToPano(i, n, r, function() {
  22131. t === S.Slow ? this.path.discardSlow() : t === S.Standard && this.path.discardPathObject(),
  22132. this.emit(W.WarpEnded, i),
  22133. this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !0),
  22134. o && o()
  22135. }
  22136. .bind(this)),
  22137. e === M.Hide && this.path.discardPathObject(),
  22138. !0
  22139. }
  22140. ,
  22141. t.prototype.warpToPanoById = function(e, t, i, n, r, o, a, s) {
  22142. return this.path.setWarpDestinationByPanoId(e, t) ? this.startWarp(i, n, r, o, a, s) : (Y.warn("Player.warpToPanoById() -> Could not setWarpDestinationByPanoId()"),
  22143. s && s(),
  22144. !1)
  22145. }
  22146. ,
  22147. t.prototype.warpToPanoByHeroIndex = function(e, t, i, n, r, o, a) {
  22148. return this.path.setWarpDestinationByHeroIndex(e) ? this.startWarp(t, i, n, r, o, a) : (Y.warn("Player.warpToPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  22149. a && a(),
  22150. !1)
  22151. }
  22152. ,
  22153. t.prototype.warpToPano = function(e, t, i, n, r, o, a, s) {
  22154. return this.warpToPanoById(e.id, t, i, n, r, o, a, s)
  22155. }
  22156. ,
  22157. t.prototype.warpToNonPanoByHeroIndex = function(e, t) {
  22158. return this.path.setWarpDestinationByHeroIndex(e) ? (this.path.warpToNonPano(t),
  22159. !0) : (Y.warn("Player.warpToNonPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  22160. t && t(),
  22161. !1)
  22162. }
  22163. ,
  22164. t.prototype.aimTourCamera = function(e, t, i, n) {
  22165. return Y.debug("player.aimTourCamera(" + e + ") calling warpToPanoByHeroIndex(" + e + ")"),
  22166. this.warpToPanoByHeroIndex(e, t, i, null, null, null, n)
  22167. }
  22168. ,
  22169. t.prototype.showPathToHeroLocation = function(e) {
  22170. this.path.setWarpDestinationByHeroIndex(e) && this.path.brushToWarpPano(R.STD, R.BLACK)
  22171. }
  22172. ,
  22173. t.prototype.tourInterlude = function(e, t) {
  22174. this.history.invalidate(),
  22175. this.path.discardSlow();
  22176. var currentLocation = this.model.heroLocations[this.director.currentItem[0]]
  22177. var restChildCount = currentLocation.heroLocations ? (currentLocation.heroLocations.length-this.director.currentItem[1]-1) : 0
  22178. var current = g_tourAudio ? 1e3 * g_tourAudio.currentTime : 0
  22179. var waitTime = currentLocation && currentLocation.musicInfo.music ? currentLocation.musicInfo.time - current : 2e3;
  22180. if(restChildCount){//如果当前folder中还有剩下的item,平分一下时间
  22181. var timeEachItem = 2000;//假设每个item飞的时间
  22182. var waitTime = Math.max(0, (waitTime-timeEachItem*restChildCount) / (restChildCount+1));
  22183. }
  22184. console.log("waitTime "+waitTime +" at item "+this.director.currentItem + ",musicCurrentTime:"+current)
  22185. this.path.waitNextStep(e, function() {//等待音乐播放一段时间再下一步,此时镜头会缓慢旋转
  22186. t && t()
  22187. }
  22188. .bind(this), waitTime)
  22189. }
  22190. ,
  22191. t.prototype.stopInterlude = function() {
  22192. this.interruptAndFastForward(null, 0)
  22193. }
  22194. ,
  22195. t.prototype.interruptAndFastForward = function(e, t) {
  22196. this.isWarping() && this.emit(W.WarpInterrupted, this.path.activeTransType, e, t),
  22197. this.flying && this.emit(W.FlyingInterrupted),
  22198. this.path.interruptAndFastForward(e, t)
  22199. }
  22200. ,
  22201. t.prototype.setSize = function(e, t) {
  22202. var i = e / t;
  22203. this.baseFov = A.clampVFOV(k.insideFOV, k.insideFOVMax, e, t);
  22204. var n = A.getHFOVFromVFOV(k.insideFOV, e, t);
  22205. for (var r in n > k.insideFOVMax ? this.baseFov = A.getVFOVFromHFOV(k.insideFOVMax, e, t) : this.baseFov = k.insideFOV,
  22206. this.cameraControls.cameras) {
  22207. var o = this.cameraControls.cameras[r];
  22208. o.fov = this.baseFov * (1 / this.zoomLevel),
  22209. o.updateAspect(i)
  22210. }
  22211. }
  22212. ,
  22213. t.prototype.toJSON = function() {
  22214. var e = {};
  22215. return this.cameraControls.activeControl && ((e = this.cameraControls.activeControl.toJSON()).camera_mode = V.toInt(this.mode),
  22216. this.isOutsideMode() ? this.model.allFloorsVisible ? e.floor_visibility = [] : e.floor_visibility = this.model.floors.list.map(function(e) {
  22217. return e.hidden ? 0 : 1
  22218. }) : V.PANORAMA && (e.scan_id = this.currentPano.id)),
  22219. e
  22220. }
  22221. ,
  22222. t.prototype.getCurrentNodePanos = function(e) {
  22223. if (this.model.panos.map,
  22224. e.length = 0,
  22225. this.path.nodes)
  22226. for (var t = 0; t < this.path.nodes.length; t++) {
  22227. var i = this.path.nodes[t];
  22228. e.push(this.model.panos.get(i))
  22229. }
  22230. }
  22231. ,
  22232. t.prototype.zoomIncrementally = function(e) {
  22233. var t = this.zoomLevel;
  22234. this.zoomTo(this.zoomLevel + e),
  22235. t !== this.zoomLevel && this.currentPano && this.zoomStats.addZoomAction(t, this.zoomLevel, this.currentPano.id)
  22236. }
  22237. ,
  22238. t.prototype.zoomInIncrementally = function(e) {
  22239. e = e || this.defaultZoomIncrement,
  22240. this.zoomIncrementally(e)
  22241. }
  22242. ,
  22243. t.prototype.zoomOutIncrementally = function(e) {
  22244. e = e || -this.defaultZoomIncrement,
  22245. this.zoomIncrementally(e)
  22246. }
  22247. ,
  22248. t.prototype.zoomBy = function(e) {
  22249. this.zoomTo(this.zoomLevel * e)
  22250. }
  22251. ,
  22252. t.prototype.zoomIn = function() {
  22253. this.zoomBy(1 + this.zoomSpeed)
  22254. }
  22255. ,
  22256. t.prototype.zoomOut = function() {
  22257. this.zoomBy(1 - this.zoomSpeed)
  22258. }
  22259. ,
  22260. t.prototype.zoomTo = function(e, t) {
  22261. if ((t || k.zoom.enabled && this.mode === V.PANORAMA && this.zoomEnabled) && (e < k.zoom.min && (e = k.zoom.min),
  22262. e > k.zoom.max && (e = k.zoom.max),
  22263. e > this.zoomLevel ? (this.emit(m.ZoomIn),
  22264. e === k.zoom.max && this.emit(m.ZoomMax)) : e < this.zoomLevel && (this.emit(m.ZoomOut),
  22265. e === k.zoom.min && this.emit(m.ZoomMin)),
  22266. this.cameraControls.activeControl)) {
  22267. var i = this.cameraControls.activeControl.camera;
  22268. this.zoomLevel = e,
  22269. i.fov = this.baseFov * (1 / this.zoomLevel),
  22270. i.updateProjectionMatrix(),
  22271. this.zoomFov = i.fov
  22272. }
  22273. }
  22274. ,
  22275. t.prototype.increaseZoomSpeed = function() {
  22276. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed + this.zoomSpeedAdjust)
  22277. }
  22278. ,
  22279. t.prototype.decreaseZoomSpeed = function() {
  22280. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed - this.zoomSpeedAdjust)
  22281. }
  22282. ,
  22283. t.prototype.clampZoomSpeed = function(e) {
  22284. return e < 0 ? 0 : e
  22285. }
  22286. ,
  22287. t.prototype.activatePersistentZooming = function(e) {
  22288. this.zooming = e ? 1 : -1
  22289. }
  22290. ,
  22291. t.prototype.deactivatePersistentZooming = function() {
  22292. this.zooming = 0
  22293. }
  22294. ,
  22295. t.prototype.zoomDefault = function() {
  22296. this.zoomTo(1, !0)
  22297. }
  22298. ,
  22299. t.prototype.smoothZoomToDefault = function(e, t) {
  22300. var i, n = this.zoomLevel, r = function(e) {
  22301. 1 < e && (e = 1),
  22302. i = n * (1 - e) + e,
  22303. this.zoomTo(i, !0)
  22304. }
  22305. .bind(this), o = function() {
  22306. this.zoomDefault(),
  22307. t && window.setTimeout(t, 50)
  22308. }
  22309. .bind(this);
  22310. G.start(r, e, o, null, 0, z[k.transition.blendEasing])
  22311. }
  22312. ,
  22313. t.prototype.updateZoomPano = function() {
  22314. if (!this.panoRenderer.zoomPanoRenderingDisabled && this.mode === V.PANORAMA) {
  22315. var e = this.currentPano;
  22316. if (e) {
  22317. var t = this.zoomLevel > k.zoom.activationThreshold
  22318. , i = (this.flying && this.nextPano && this.nextPano !== this.currentPano || this.isWarping(),
  22319. t);
  22320. this.tileDownloader.tilePrioritizer.setZoomingActive(i),
  22321. this.panoRenderer.setZoomingActive(i, e, !0);
  22322. var n = function(e, t) {
  22323. this.panoRenderer.resetRenderStatus(e.id, !1, !0, this.qualityManager.getMaxNavPanoSize()),
  22324. this.panoRenderer.clearAllQueuedUploadsForPano(e.id),
  22325. this.panoRenderer.renderPanoTiles(e.id, null, !1, !1),
  22326. e.setZoomed(t)
  22327. }
  22328. .bind(this);
  22329. i && !e.zoomed ? (n(e, !0),
  22330. this.panoRenderer.enableUltraHighQualityMode(function() {
  22331. this.qualityManager.useUltraHighResolutionPanos && !k.zoom.overridemax && (k.zoom.max = y.ultraHighQualityMaxZoom),
  22332. i && n(e, !0)
  22333. }
  22334. .bind(this))) : !t && e.zoomed && n(e, !1)
  22335. }
  22336. }
  22337. },
  22338. //--------
  22339. t.prototype.flyToMode = function(mode, f1){ //飞到某个模式后再执行f1函数
  22340. var f2;
  22341. if (this.mode == mode) {
  22342. f1 && f1()
  22343. } else {
  22344. f2 = f1;
  22345. if (this.mode == "transitioning" && this.modeTran.split('-')[1] != mode) {//正飞向其他模式,就要先飞完再飞进来然后执行
  22346. this.afterCModeFuc = function() {
  22347. this.afterCModeFuc = f2
  22348. this.flyToNewMode({mode:mode, pano: mode == "panorama" && this.currentPano });
  22349. }.bind(this)
  22350. } else {
  22351. this.afterCModeFuc = f2;//飞入后执行
  22352. try{ //在场景刚开始加载 control还没建好时这句可能会报错所以用try。 不用callback而用 afterCModeFuc也是这个原因,因为会有别的函数可以飞入然后执行它
  22353. this.flyToNewMode({mode:mode, pano: mode == "panorama" && this.currentPano});
  22354. }catch(e){}
  22355. }
  22356. }
  22357. }
  22358. ,
  22359. t.prototype.checkHasNeighbor = function(pano){//add
  22360. for(var i in pano.neighbourPanos ){
  22361. if(i == pano.id)continue;
  22362. if(pano.neighbourPanos[i]){
  22363. return true;
  22364. }
  22365. }
  22366. }
  22367. ,
  22368. ee.exports = t
  22369. }
  22370. ).call(this, "/js/player.js")
  22371. }
  22372. , {
  22373. "./constants": 8,
  22374. "./enum/AlignmentType": 17,
  22375. "./enum/BlackoutStyle": 18,
  22376. "./enum/ControlEvents": 21,
  22377. "./enum/Keys": 30,
  22378. "./enum/ModelManagerEvents": 33,
  22379. "./enum/PanoSizeClass": 36,
  22380. "./enum/PanoramaEvents": 37,
  22381. "./enum/PathDiscardMode": 38,
  22382. "./enum/PathDisplayMode": 39,
  22383. "./enum/PlayerEvents": 40,
  22384. "./enum/TagStates": 44,
  22385. "./enum/Vectors": 50,
  22386. "./enum/Viewmode": 51,
  22387. "./enum/WarpStyle": 52,
  22388. "./enum/ZoomEvents": 53,
  22389. "./exception/BasicException": 55,
  22390. "./model/ModelManager": 140,
  22391. "./objects/NSpider": 147,
  22392. "./objects/Panorama": 148,
  22393. "./objects/Reticule": 149,
  22394. "./objects/ShowPath": 151,
  22395. "./objects/Snapshot": 153,
  22396. "./objects/View": 154,
  22397. "./settings": 166,
  22398. "./shaders": 167,
  22399. "./tile/TileDownloader": 171,
  22400. "./tile/TilePrioritizer": 172,
  22401. "./util/ZoomStats": 179,
  22402. "./util/browser": 182,
  22403. "./util/camera": 183,
  22404. "./util/cameraLight": 184,
  22405. "./util/common": 185,
  22406. "./util/easing": 186,
  22407. "./util/history": 187,
  22408. "./util/lerp": 188,
  22409. "./util/logger": 189,
  22410. "./util/math": 190,
  22411. "./util/transitions": 195,
  22412. hot: "hot",
  22413. scaleImg: "scaleImg",
  22414. events: 202,
  22415. three: 217
  22416. }],
  22417. scaleImg: [function(e, t) {
  22418. var i = t;
  22419. (function() {
  22420. function e(e, t, i, n) {
  22421. function r() {
  22422. (U = "object" == typeof i ? i : t.src || n ? s : document.createElement("canvas")).width = d,
  22423. U.height = p,
  22424. H = U.getContext("2d")
  22425. }
  22426. function o(e) {
  22427. if (e) {
  22428. var t, i = H.getImageData(0, 0, d, p), n = i.data;
  22429. for (t = 0; t < ie; t += 4)
  22430. n[t] = e[t] * ne | 0,
  22431. n[t + 1] = e[t + 1] * ne | 0,
  22432. n[t + 2] = e[t + 2] * ne | 0,
  22433. n[t + 3] = e[t + 3] * ne | 0;
  22434. return delete e,
  22435. i
  22436. }
  22437. return H.getImageData(0, 0, d, p)
  22438. }
  22439. function a(e, t, i, n, r) {
  22440. return .5 * (n - t + (2 * t - 5 * i + 4 * n - r + (3 * (i - n) + r - t) * e) * e) * e + i
  22441. }
  22442. var s, l;
  22443. if (t || (t = e.input,
  22444. i = e.output,
  22445. n = e.inputRemovable,
  22446. e.scale && (e = e.scale)),
  22447. t.src)
  22448. if (s = document.createElement("canvas"),
  22449. null != t.naturalWidth)
  22450. s.width = t.naturalWidth,
  22451. s.height = t.naturalHeight;
  22452. else if (null != t.runtimeStyle) {
  22453. var c = t.runtimeStyle
  22454. , h = c.width
  22455. , u = c.height;
  22456. c.width = "auto",
  22457. c.height = "auto",
  22458. s.width = t.width,
  22459. s.height = t.height,
  22460. c.width = h,
  22461. c.height = u
  22462. } else {
  22463. h = t.width,
  22464. u = t.height;
  22465. t.removeAttribute && (t.removeAttribute("width"),
  22466. t.removeAttribute("height")),
  22467. s.width = t.width,
  22468. s.height = t.height,
  22469. t.width = h,
  22470. t.height = u
  22471. }
  22472. else
  22473. s = t;
  22474. l = s.getContext("2d"),
  22475. t.src && l.drawImage(t, 0, 0);
  22476. var d, p, f = s.width, g = s.height, m = l.getImageData(0, 0, f, g).data;
  22477. if (!f || !g)
  22478. return !1;
  22479. (t.src || n) && s.clearRect(0, 0, f, g),
  22480. p = "object" == typeof e ? e.width ? (d = e.width + .5 | 0,
  22481. e.height + .5 | 0) : (d = f * e.scaleX + .5 | 0,
  22482. g * e.scaleY + .5 | 0) : (d = e * f + .5 | 0,
  22483. e * g + .5 | 0);
  22484. var v, y, A, C, I, E, _, b, w, T, x, S, M, R, P, O, L, D, N, F, B, V, k, U, H, z, G, W, j, Y, q, X, Z, K, Q, J = d << 2, $ = f << 2, ee = 0, te = 0, ie = J * p, ne = 255.99 / 255, re = d / f, oe = p / g, ae = re * oe;
  22485. if (1 < re || 1 < oe)
  22486. for (r(),
  22487. G = (z = o()).data,
  22488. C = 0; C < p; C++)
  22489. for (V = (y = C / oe) - (w = 0 | y),
  22490. j = w * $,
  22491. W = w < 1 ? j : j - $,
  22492. w < g - 2 ? (Y = j + $,
  22493. q = (2 + w) * $) : Y = q = g - 2 < w ? j : j + $,
  22494. A = 0; A < d; A++,
  22495. te += 4)
  22496. Z = (b = 0 | (v = A / re)) << 2,
  22497. b < f - 2 ? (K = Z + 4,
  22498. Q = Z + 8) : K = Q = f - 2 < b ? Z : Z + 4,
  22499. D = a(V, a(k = v - b, m[W + (X = b < 1 ? Z : Z - 4)], m[W + Z], m[W + K], m[W + Q]), a(k, m[j + X], m[j + Z], m[j + K], m[j + Q]), a(k, m[Y + X], m[Y + Z], m[Y + K], m[Y + Q]), a(k, m[q + X], m[q + Z], m[q + K], m[q + Q])) * ne | 0,
  22500. ++Z,
  22501. ++K,
  22502. ++Q,
  22503. F = a(V, a(k, m[W + ++X], m[W + Z], m[W + K], m[W + Q]), a(k, m[j + X], m[j + Z], m[j + K], m[j + Q]), a(k, m[Y + X], m[Y + Z], m[Y + K], m[Y + Q]), a(k, m[q + X], m[q + Z], m[q + K], m[q + Q])) * ne | 0,
  22504. ++Z,
  22505. ++K,
  22506. ++Q,
  22507. B = a(V, a(k, m[W + ++X], m[W + Z], m[W + K], m[W + Q]), a(k, m[j + X], m[j + Z], m[j + K], m[j + Q]), a(k, m[Y + X], m[Y + Z], m[Y + K], m[Y + Q]), a(k, m[q + X], m[q + Z], m[q + K], m[q + Q])) * ne | 0,
  22508. ++Z,
  22509. ++K,
  22510. ++Q,
  22511. N = a(V, a(k, m[W + ++X], m[W + Z], m[W + K], m[W + Q]), a(k, m[j + X], m[j + Z], m[j + K], m[j + Q]), a(k, m[Y + X], m[Y + Z], m[Y + K], m[Y + Q]), a(k, m[q + X], m[q + Z], m[q + K], m[q + Q])) * ne | 0,
  22512. G[te] = 0 <= D ? D < 256 ? D : 255 : 0,
  22513. G[te + 1] = 0 <= F ? F < 256 ? F : 255 : 0,
  22514. G[te + 2] = 0 <= B ? B < 256 ? B : 255 : 0,
  22515. G[te + 3] = 0 <= N ? N < 256 ? N : 255 : 0;
  22516. else {
  22517. if (le.Float32Array)
  22518. L = new Float32Array(ie);
  22519. else
  22520. for (L = [],
  22521. te = 0; te < ie; ++te)
  22522. L[te] = 0;
  22523. for (y = 0; y < g; y++)
  22524. for (I = (_ = 0 | (C = y * oe)) * J,
  22525. (O = !!((_ - (C + oe | 0)) * (g - 1 - y)) << 1) && (M = 1 + _ - C,
  22526. R = C + oe - _ - 1),
  22527. v = 0; v < f; v++,
  22528. ee += 4)
  22529. switch (A = v * re,
  22530. E = 0 | A,
  22531. te = I + (E << 2),
  22532. P = !!((E - (A + re | 0)) * (f - 1 - v)),
  22533. P && (x = 1 + E - A,
  22534. S = A + re - E - 1),
  22535. D = m[ee],
  22536. F = m[ee + 1],
  22537. B = m[ee + 2],
  22538. N = m[ee + 3],
  22539. P + O) {
  22540. case 0:
  22541. L[te] += D * ae,
  22542. L[te + 1] += F * ae,
  22543. L[te + 2] += B * ae,
  22544. L[te + 3] += N * ae;
  22545. break;
  22546. case 1:
  22547. T = x * oe,
  22548. L[te] += D * T,
  22549. L[te + 1] += F * T,
  22550. L[te + 2] += B * T,
  22551. L[te + 3] += N * T,
  22552. T = S * oe,
  22553. L[te + 4] += D * T,
  22554. L[te + 5] += F * T,
  22555. L[te + 6] += B * T,
  22556. L[te + 7] += N * T;
  22557. break;
  22558. case 2:
  22559. T = re * M,
  22560. L[te] += D * T,
  22561. L[te + 1] += F * T,
  22562. L[te + 2] += B * T,
  22563. L[te + 3] += N * T,
  22564. T = re * R,
  22565. L[te += J] += D * T,
  22566. L[te + 1] += F * T,
  22567. L[te + 2] += B * T,
  22568. L[te + 3] += N * T;
  22569. break;
  22570. default:
  22571. T = x * M,
  22572. L[te] += D * T,
  22573. L[te + 1] += F * T,
  22574. L[te + 2] += B * T,
  22575. L[te + 3] += N * T,
  22576. T = S * M,
  22577. L[te + 4] += D * T,
  22578. L[te + 5] += F * T,
  22579. L[te + 6] += B * T,
  22580. L[te + 7] += N * T,
  22581. T = x * R,
  22582. L[te += J] += D * T,
  22583. L[te + 1] += F * T,
  22584. L[te + 2] += B * T,
  22585. L[te + 3] += N * T,
  22586. T = S * R,
  22587. L[te + 4] += D * T,
  22588. L[te + 5] += F * T,
  22589. L[te + 6] += B * T,
  22590. L[te + 7] += N * T
  22591. }
  22592. delete m,
  22593. r(),
  22594. z = o(L)
  22595. }
  22596. if (H.putImageData(z, 0, 0),
  22597. "string" == typeof i) {
  22598. var se;
  22599. if ("png" === i || "jpeg" === i)
  22600. return (se = n && t.src ? t : new Image).width = d,
  22601. se.height = p,
  22602. se.src = U.toDataURL("image/" + i, .85),
  22603. se;
  22604. if ("png-src" === i || "jpeg-src" === i)
  22605. return U.toDataURL("image/" + i.split("-")[0], .85)
  22606. }
  22607. return U
  22608. }
  22609. var le = this;
  22610. "undefined" != typeof exports ? ("undefined" != typeof module && module.exports && (exports = module.exports = e),
  22611. exports.scale = e) : c = e
  22612. }
  22613. ).call(this),
  22614. i.exports = c
  22615. }
  22616. , {}],
  22617. 156: [function(i, n, e) {
  22618. (function(e) {
  22619. "use strict";
  22620. function t(e, t) {
  22621. this.model = e,
  22622. this.panos = e.panos,
  22623. this.player = t,
  22624. this.imagePanos = this.listImagePanos(),
  22625. this.retryMinimumTime = 1e4
  22626. }
  22627. var r = (i("three"),
  22628. i("./enum/Viewmode"))
  22629. , o = (i("./settings"),
  22630. i("./objects/Panorama"))
  22631. , a = new (i("./util/logger"))(e);
  22632. t.prototype.start = function() {
  22633. this.loadNextPano(function(e) {
  22634. e ? this.start() : (a.debug("No suitable pano loaded, waiting a little while before looking again"),
  22635. setTimeout(function() {
  22636. this.start()
  22637. }
  22638. .bind(this), 1e3))
  22639. }
  22640. .bind(this))
  22641. }
  22642. ,
  22643. t.prototype.validLoadTarget = function(e) {
  22644. return e && !e.isLoaded("high") && Date.now() - e.failedLoadingAt > this.retryMinimumTime
  22645. }
  22646. ,
  22647. t.prototype.listImagePanos = function() {
  22648. var i = []
  22649. , n = this;
  22650. return this.model.images.forEach(function(e) {
  22651. if (e.metadata && e.metadata.scan_id) {
  22652. var t = n.model.panos.get(e.metadata.scan_id);
  22653. t && !t.isLoaded("high") && i.push(t)
  22654. }
  22655. }),
  22656. i
  22657. }
  22658. ,
  22659. t.prototype.nextNotLoadedImage = function() {
  22660. for (; 0 < this.imagePanos.length; ) {
  22661. var e = this.imagePanos[0];
  22662. if (!e.isLoaded("high"))
  22663. return e;
  22664. this.imagePanos.shift()
  22665. }
  22666. return null
  22667. }
  22668. ,
  22669. t.prototype.loadNextPano = function(e) {
  22670. var t, i, n = this.model.waitQueue.filter(function(e) {
  22671. return e.object instanceof o
  22672. });
  22673. 0 < n.length ? (t = n[0].object,
  22674. a.debug("Overrode pano selection: Flying to an unloaded pano " + t.id)) : this.validLoadTarget(this.player.currentPano) ? (t = this.player.currentPano,
  22675. a.debug("Overrode pano selection: Currently at an unloaded pano " + t.id)) : this.validLoadTarget(this.player.closestPano) ? (t = this.player.closestPano,
  22676. a.debug("Overrode pano selection: Hovering over an unloaded pano " + t.id)) : this.validLoadTarget(this.nextNotLoadedImage()) ? (i = "high",
  22677. t = this.imagePanos[0],
  22678. a.debug("Overrode pano selection: Highlight image " + t.id)) : this.player.mode !== r.PANORAMA || (t = this.panos.lowestByScore([this.validLoadTarget.bind(this), o.filters.isNeighbourPanoTo(this.player.currentPano)], [o.scoreFunctions.distance(this.player.currentPano), o.scoreFunctions.direction(this.player.position, this.player.getDirection()), o.scoreFunctions.inFieldOfView(this.player.position, this.player.getDirection())])) && a.debug("Normal pano selection: neighbor " + t.id),
  22679. t ? (i = i || t.isLoaded("low") ? "high" : "low",
  22680. a.debug("Preloading " + i + "-res pano " + t.id),
  22681. t.loadCube(i).done(e).fail(function() {
  22682. a.warn("Failed preloading pano", t.id, ", marking it as failed and forgetting it for a while"),
  22683. e()
  22684. })) : e && e(null)
  22685. }
  22686. ,
  22687. n.exports = t
  22688. }
  22689. ).call(this, "/js/preloaders.js")
  22690. }
  22691. , {
  22692. "./enum/Viewmode": 51,
  22693. "./objects/Panorama": 148,
  22694. "./settings": 166,
  22695. "./util/logger": 189,
  22696. three: 217
  22697. }],
  22698. 157: [function(a, s, e) {
  22699. (function(e) {
  22700. "use strict";
  22701. function t(e, t, i, n, r) {
  22702. this.qualityManager = e,
  22703. this.scene = t,
  22704. this.camera = i,
  22705. this.container = r,
  22706. this.controls = n,
  22707. this.controls.enabled = !0,
  22708. this.controls.locked = !0,
  22709. this.quickstartCamera = n.camera,
  22710. this.quickstartCamera.fov = d.clampVFOV(o.insideFOV, o.insideFOVMax, $("#player").width(), $("#player").height()),
  22711. this.skybox = null
  22712. }
  22713. var i = a("three")
  22714. , n = a("../util/logger")
  22715. , o = a("../constants")
  22716. , h = (a("../util/transitions"),
  22717. a("../util/lerp"),
  22718. a("../util/easing"),
  22719. a("../enum/Vectors"))
  22720. , u = a("../enum/PanoSizeClass")
  22721. , r = (a("../materials/ModelTextureMaterial"),
  22722. a("../materials/CubemapMaterial"))
  22723. , d = (a("../cameras/PanoramaCamera"),
  22724. a("../controls/PanoramaControls"),
  22725. a("../tile/TileUtils"),
  22726. a("../util/camera"),
  22727. a("../util/cameraLight"))
  22728. , p = (a("../util/browser"),
  22729. a("../settings"),
  22730. a("../gui/helpManager"),
  22731. new n(e));
  22732. t.prototype.load = function(e) {
  22733. e.pano.shouldRedrawOnBaseLoaded = !0;
  22734. var t, i, n = this, r = h.FORWARD.clone().applyQuaternion(e.quaternion), o = r.clone().negate();
  22735. this.controls.lookAt(r.add(this.quickstartCamera.position));
  22736. var a = this.qualityManager.getPanoSize(u.BASE)
  22737. , s = this.qualityManager.getPanoSize(u.STANDARD);
  22738. if (e.pano.tiled) {
  22739. p.warn("Loading startPano, TILED", e.pano.id);
  22740. var l = d.getHFOVForCamera(this.quickstartCamera, $("#player").width(), $("#player").height())
  22741. , c = this.quickstartCamera.fov;
  22742. p.warn("Quickstart loading tiles in frustum: [horizontal FOV: " + l + ", vertical FOV: " + c + "]"),
  22743. t = e.pano.loadTiledPano(s, r, {
  22744. hFov: l,
  22745. vFov: c
  22746. }, !1, !1, !0),
  22747. i = e.pano.loadTiledPano(a, o, null, !1, !1, !0)
  22748. } else
  22749. p.warn("Loading startPano", e.pano.id),
  22750. t = e.pano.loadCube("high");
  22751. return $.when(t).then(function() {
  22752. n.init(e.pano, e.quaternion),
  22753. e.pano.tiled ? i.done(function() {
  22754. e.pano.lockUntilRenderingComplete = !1,
  22755. this.controls.locked = !1
  22756. }
  22757. .bind(this)) : this.controls.locked = !1
  22758. }
  22759. .bind(this))
  22760. }
  22761. ,
  22762. t.prototype.init = function(e, t) {
  22763. p.info("Quickstart done loading, adding scene objects"),
  22764. e.lockUntilRenderingComplete = !0,
  22765. this.skybox = new i.Mesh(new i.CubeGeometry(1,1,1),new r({
  22766. side: i.BackSide
  22767. })),
  22768. this.skybox.material.uniforms.map.value = e.getSkyboxTexture(),
  22769. this.skybox.quaternion.copy(e.quaternion),
  22770. this.scene.add(this.skybox),
  22771. $(this.container).show()
  22772. }
  22773. ,
  22774. t.prototype.update = function(e) {
  22775. this.controls.update(e),
  22776. this.camera.copy(this.quickstartCamera)
  22777. }
  22778. ,
  22779. t.prototype.setSize = function(e, t) {
  22780. this.quickstartCamera.updateAspect(e / t)
  22781. }
  22782. ,
  22783. t.prototype.destroy = function() {
  22784. this.scene.remove(this.skybox)
  22785. }
  22786. ,
  22787. s.exports = t
  22788. }
  22789. ).call(this, "/js/scene/QuickstartManager.js")
  22790. }
  22791. , {
  22792. "../cameras/PanoramaCamera": 7,
  22793. "../constants": 8,
  22794. "../controls/PanoramaControls": 13,
  22795. "../enum/PanoSizeClass": 36,
  22796. "../enum/Vectors": 50,
  22797. "../gui/helpManager": 68,
  22798. "../materials/CubemapMaterial": 117,
  22799. "../materials/ModelTextureMaterial": 118,
  22800. "../settings": 166,
  22801. "../tile/TileUtils": 174,
  22802. "../util/browser": 182,
  22803. "../util/camera": 183,
  22804. "../util/cameraLight": 184,
  22805. "../util/easing": 186,
  22806. "../util/lerp": 188,
  22807. "../util/logger": 189,
  22808. "../util/transitions": 195,
  22809. three: 217
  22810. }],
  22811. 158: [function(e, t, i) {
  22812. "use strict";
  22813. function h(e, t, i) {
  22814. this.scene = e,
  22815. this.camera = t,
  22816. this.renderer = null,
  22817. this.effects = i,
  22818. this.animateCallback = null,
  22819. this.composer = null,
  22820. this.qualityManager = null,
  22821. e.renderWidth = 0,
  22822. e.renderHeight = 0,
  22823. this.updateClock = new M.Clock,
  22824. this.components = [],
  22825. this.updateListeners = [],
  22826. this.resizeListeners = [],
  22827. this.forceUpdateSize = !1,
  22828. this.started = !1,
  22829. this.textures = {},
  22830. this.suspendedObjects = []
  22831. }
  22832. var o, a, n, M = e("three"), R = e("../shaders"), r = e("../enum/SceneRendererEvents"), f = e("../enum/GLTextureType"), s = e("../enum/GLCubeFaces"), l = e("../exception/BasicException"), c = e("../exception/RendererCreationException"), u = e("../util/browser"), d = e("../settings"), p = e("events").EventEmitter;
  22833. window.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame,
  22834. (h.prototype = Object.create(p.prototype)).addComponent = function(e) {
  22835. this.components.push(e),
  22836. e.update && this.updateListeners.push(e),
  22837. e.setSize && (this.resizeListeners.push(e),
  22838. this.forceUpdateSize = !0)
  22839. }
  22840. ,
  22841. h.prototype.removeComponent = function(t) {
  22842. function e(e) {
  22843. return e !== t
  22844. }
  22845. this.components = this.components.filter(e),
  22846. this.updateListeners = this.updateListeners.filter(e),
  22847. this.resizeListeners = this.resizeListeners.filter(e)
  22848. }
  22849. ,
  22850. h.prototype.start = function(e) {
  22851. if (this.started)
  22852. throw new l("Can't start SceneRenderer, already started");
  22853. this.createContext(e),
  22854. //u.isMobile() && this.boluoVrInit(),
  22855. this.initComposer(),
  22856. this.started = !0,
  22857. (b = b.bind(this))()
  22858. }
  22859. ,
  22860. h.prototype.createContext = function(e) {
  22861. try {
  22862. this.renderer = new M.WebGLRenderer({antialias: !u.isMobile()}),
  22863. this.renderer.autoClear = !0,
  22864. this.renderer.setPixelRatio(window.devicePixelRatio ? window.devicePixelRatio : 1),
  22865. this.renderer.setSize($("#player").width(), $("#player").height(), !1),
  22866. this.emit(r.ContextCreated)
  22867. } catch (e) {
  22868. throw new c("Unable to create a WebGL rendering context")
  22869. }
  22870. d.profiling.enabled && this.overrideTextures(),
  22871. e.appendChild(this.renderer.domElement)
  22872. }
  22873. ,
  22874. h.prototype.overrideTextures = function() {
  22875. var d = this.renderer.context
  22876. , t = 0
  22877. , i = d.createTexture;
  22878. d.createTexture = function() {
  22879. var e = i.call(d);
  22880. return e.id = t++,
  22881. this.textures[e.id] = e
  22882. }
  22883. .bind(this);
  22884. var p = d.texImage2D;
  22885. d.texImage2D = function(e, t, i, n, r, o, a, s, l) {
  22886. var c, h = this.getTextureTypeFromTarget(d, e);
  22887. c = h === f.TextureCube ? d.getParameter(d.TEXTURE_BINDING_CUBE_MAP) : d.getParameter(d.TEXTURE_BINDING_2D),
  22888. void 0 !== a ? p.call(d, e, t, i, n, r, o, a, s, l) : (a = n,
  22889. s = r,
  22890. n = (l = o).naturalWidth,
  22891. r = l.naturalHeight,
  22892. p.call(d, e, t, i, a, s, l));
  22893. var u = this.textures[c.id];
  22894. u.width = h === f.TextureCube ? 6 * n : n,
  22895. u.height = r
  22896. }
  22897. .bind(this);
  22898. var n = d.deleteTexture;
  22899. d.deleteTexture = function(e) {
  22900. delete this.textures[e.id],
  22901. n.call(d, e)
  22902. }
  22903. .bind(this)
  22904. }
  22905. ,
  22906. h.prototype.updateTextureMemory = (n = null,
  22907. function() {
  22908. var e = 0;
  22909. for (var t in this.textures) {
  22910. var i = this.textures[t];
  22911. i.width && i.height && (e += i.width * i.height * 4)
  22912. }
  22913. e !== n && this.emit(r.MemoryUsageUpdated, e),
  22914. n = e
  22915. }
  22916. ),
  22917. h.prototype.getTextureTypeFromTarget = function(e, t) {
  22918. switch (t) {
  22919. case e.TEXTURE_CUBE_MAP_POSITIVE_X:
  22920. case e.TEXTURE_CUBE_MAP_NEGATIVE_X:
  22921. case e.TEXTURE_CUBE_MAP_POSITIVE_Y:
  22922. case e.TEXTURE_CUBE_MAP_NEGATIVE_Y:
  22923. case e.TEXTURE_CUBE_MAP_POSITIVE_Z:
  22924. case e.TEXTURE_CUBE_MAP_NEGATIVE_Z:
  22925. return f.TextureCube;
  22926. case e.TEXTURE_2D:
  22927. return f.Texture2D;
  22928. default:
  22929. return null
  22930. }
  22931. }
  22932. ,
  22933. h.prototype.initComposer = function() {
  22934. this.composer = new M.EffectComposer(this.renderer),
  22935. this.composer.addPass(new M.RenderPass(this.scene,this.camera)),
  22936. this.composer.addPass(this.effects.hblurPass),
  22937. this.composer.addPass(this.effects.vblurPass)
  22938. }
  22939. ,
  22940. h.prototype.setSize = function(e, t, i) {
  22941. this.renderWidth = e,
  22942. this.renderHeight = t,
  22943. this.effects.aspect = e / t,
  22944. this.renderer.setSize(e, t, !1, i),
  22945. this.composer.setSize(e, t);
  22946. for (var n = 0; n < this.resizeListeners.length; n++)
  22947. this.resizeListeners[n].setSize(e, t)
  22948. }
  22949. ,
  22950. h.prototype.render = function() {
  22951. 0 < this.effects.currentBlur ? this.composer.render() : this.renderer.render(this.scene, this.camera)
  22952. }
  22953. ,
  22954. h.prototype.boluoVrInit = function() {
  22955. console.log("boluoVrInit"),
  22956. this.isHuawei5X = u.detectHUAWEI5X(),
  22957. this.oldRenderer = this.renderer,
  22958. this.newRenderer = new this.vrRenderer(this.renderer,this,this.camera),
  22959. window.panoCamera = this.camera;
  22960. var i = this;
  22961. window._vrEnabled = !1,
  22962. Object.defineProperty(window, "vrEnabled", {
  22963. get: function() {
  22964. return window._vrEnabled
  22965. },
  22966. set: function(e) {
  22967. (e = !!e) ? (i.renderer = i.newRenderer,
  22968. window.vrMarkers.forEach(function(e) {
  22969. e.visible = !0
  22970. })) : (i.renderer = i.oldRenderer,
  22971. window.vrMarkers.forEach(function(e) {
  22972. e.visible = !1
  22973. })),
  22974. i.cursor.visible = e,
  22975. i.setSize(window.innerWidth, window.innerHeight),
  22976. window._vrEnabled = e,
  22977. setTimeout(function() {
  22978. console.log(player.cameraControls.activeControl.camera.fov)
  22979. }, 500)
  22980. }
  22981. }),
  22982. this.createCursor(.5, !1, 1, 16777215, 0);
  22983. var e = {
  22984. setSize: function(e, t) {
  22985. i.camera.aspect = e / t
  22986. }
  22987. };
  22988. this.resizeListeners.push(e),
  22989. this.vrLoadingInit()
  22990. }
  22991. ,
  22992. h.prototype.vrLoadingInit = function() {
  22993. var e = new (e = function(camera) {
  22994. var t = this
  22995. , e = new M.RingGeometry(1.3,1.5,32,32,0,1.2 * Math.PI)
  22996. , i = new M.MeshBasicMaterial({
  22997. color: 4967932,
  22998. side: M.DoubleSide
  22999. })
  23000. , n = new M.Mesh(e,i);
  23001. (this.mesh = n).position.z = -2,
  23002. n.scale.set(.08, .08, .08),
  23003. n.visible = !1,
  23004. //window.player.camera.add(n),
  23005. camera.add(n),
  23006. t.enabled = !1,
  23007. this.update = function(e) {
  23008. 1 == t.enabled && (n.rotation.z += 15 * e)
  23009. }
  23010. }
  23011. )(this.camera);
  23012. window.Loading = e,
  23013. this.updateListeners.push(e)
  23014. }
  23015. ,
  23016. h.prototype.createCursor = function(e, t, i, n, r) {
  23017. var o, a = new M.SpriteMaterial({
  23018. opacity: i,
  23019. color: n,
  23020. transparent: t,
  23021. map: this.boluoGetTexture("images/cursor.png"),
  23022. needsUpdate: !0,
  23023. side: M.DoubleSide
  23024. });
  23025. a.map.offset = new M.Vector2(1 / 17 * r,0),
  23026. a.map.repeat = new M.Vector2(1 / 17,1),
  23027. a.depthTest = !1,
  23028. a.blending = M.AdditiveBlending,
  23029. (o = new M.Sprite(a)).scale.set(.3, .3, .3),
  23030. o.position.z = -2,
  23031. o.visible = !1,
  23032. o.name = "cursor",
  23033. this.camera.add(o),
  23034. this.scene.add(this.camera),
  23035. this.cursor = o;
  23036. var s = new this.CursorAnimation(this.scene,o,this.camera);
  23037. this.cursor.triggerTargetEvent = s.triggerTargetEvent,
  23038. this.updateListeners.push(s)
  23039. }
  23040. ,
  23041. h.prototype.CursorAnimation = function(e, t, o) {
  23042. this.cursor = t,
  23043. this.raycaster = new M.Raycaster,
  23044. this.targetEventObj = {},
  23045. this.type = 1,
  23046. this.tweenFlag = !0;
  23047. var s = this;
  23048. this.target = o,
  23049. console.log(o.uuid),
  23050. this.euler = new M.Euler,
  23051. this.q0 = new M.Quaternion,
  23052. this.q1 = new M.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5)),
  23053. this.zee = new M.Vector3(0,0,1),
  23054. this.alpha = -1e3,
  23055. this.beta = -1e3,
  23056. this.gamma = -1e3,
  23057. this.orient = M.Math.degToRad(window.orientation || 0),
  23058. window.addEventListener("orientationchange", function() {
  23059. s.orient = M.Math.degToRad(window.orientation || 0)
  23060. }),
  23061. window.addEventListener("deviceorientation", function(e) {
  23062. var t = M.Math.degToRad(e.alpha)
  23063. , i = M.Math.degToRad(e.beta)
  23064. , n = M.Math.degToRad(e.gamma);
  23065. if (this.isHuawei5X ? (-1e3 === s.alpha && (s.alpha = t),
  23066. -1e3 === s.beta && (s.beta = i),
  23067. -1e3 === s.gamma && (s.gamma = n),
  23068. .06 < Math.abs(t - s.alpha) && (s.alpha = t),
  23069. .006 < Math.abs(i - s.beta) && (s.beta = i),
  23070. .006 < Math.abs(n - s.gamma) && (s.gamma = n)) : (s.alpha = t,
  23071. s.beta = i,
  23072. s.gamma = n),
  23073. h.vrDebug) {
  23074. $("#info-device-orientation").css("display", "block");
  23075. var r = "";
  23076. r += "alpha=(" + s.alpha + ")<BR/>",
  23077. r += "beta=(" + s.beta + ")<BR/>",
  23078. r += "gamma=" + s.gamma + "<BR/>",
  23079. document.getElementById("info-device-orientation").innerHTML = r
  23080. }
  23081. }),
  23082. this.setObjectQuaternion = function(e, t, i, n, r) {
  23083. s.euler.set(i, t, -n, "YXZ"),
  23084. e.setFromEuler(s.euler),
  23085. e.multiply(s.q1),
  23086. e.multiply(s.q0.setFromAxisAngle(s.zee, -r)),
  23087. o.updateMatrixWorld()
  23088. }
  23089. ,
  23090. parent !== window && window.addEventListener("message", function(e) {
  23091. var t, i, n, r, o = JSON.parse(e.data), a = -1 !== window.navigator.userAgent.indexOf("KIW-TL00H");
  23092. o && o.alpha && o.beta && o.gamma && (t = a,
  23093. i = M.Math.degToRad(o.alpha),
  23094. n = M.Math.degToRad(o.beta),
  23095. r = M.Math.degToRad(o.gamma),
  23096. t ? (-1e3 === s.alpha && (s.alpha = i),
  23097. -1e3 === s.beta && (s.beta = n),
  23098. -1e3 === s.gamma && (s.gamma = r),
  23099. .06 < Math.abs(i - s.alpha) && (s.alpha = i),
  23100. .006 < Math.abs(n - s.beta) && (s.beta = n),
  23101. .006 < Math.abs(r - s.gamma) && (s.gamma = r)) : (s.alpha = i,
  23102. s.beta = n,
  23103. s.gamma = r))
  23104. }),
  23105. this.update = function(e) {
  23106. TWEEN.update(),
  23107. window.vrEnabled && (this.setObjectQuaternion(this.target.quaternion, this.alpha, this.beta, this.gamma, this.orient),
  23108. this.triggerTargetEvent())
  23109. }
  23110. ,
  23111. this.triggerTargetEvent = function() {
  23112. var e = this.choseObj()
  23113. , t = e ? e.object : void 0;
  23114. (this.targetEventObj.currentObj = t) !== this.targetEventObj.lastObj && (t && this.autoCursorPosition(e),
  23115. 1 === this.type ? (this.cursorAnimate && this.cursorAnimate.stop(),
  23116. t && t.enabled && this.startAnimate(function() {
  23117. this.clickCallback(t)
  23118. }
  23119. .bind(this))) : this.type,
  23120. this.targetEventObj.lastObj = t)
  23121. }
  23122. ,
  23123. this.choseObj = function() {
  23124. this.raycaster.setFromCamera({
  23125. x: 0,
  23126. y: 0
  23127. }, o);
  23128. var e = (this.raycaster.ray,
  23129. window.vrMarkers)
  23130. , t = this.raycaster.intersectObjects(e);
  23131. if (0 < t.length)
  23132. return t[0]
  23133. }
  23134. ,
  23135. this.clickCallback = function(e) {
  23136. this.runTHREEAction(e, "onclick")
  23137. }
  23138. ,
  23139. this.runTHREEAction = function(e, t) {
  23140. switch (t) {
  23141. case "onclick":
  23142. e._listeners && e._listeners.click && e._listeners.click.forEach(function(e) {
  23143. e()
  23144. });
  23145. break;
  23146. case "onhover":
  23147. e._listeners && e._listeners.hover && e._listeners.hover.forEach(function(e) {
  23148. e()
  23149. });
  23150. break;
  23151. case "onout":
  23152. e._listeners && e._listeners.out && e._listeners.out.forEach(function(e) {
  23153. e()
  23154. })
  23155. }
  23156. }
  23157. ,
  23158. this.startAnimate = function(e) {
  23159. this.tweenFlag && this.initAnimation(e)
  23160. }
  23161. ,
  23162. this.initAnimation = function(e) {
  23163. var t = this
  23164. , i = this.cursor.material.map.offset;
  23165. t.tweenFlag = !1,
  23166. this.cursorAnimate = new TWEEN.Tween(i).to({
  23167. x: 1
  23168. }, 1e3).onStart(function() {
  23169. t.tweenFlag = !1
  23170. }).onStop(function() {
  23171. t.tweenFlag = !0,
  23172. this.x = 0,
  23173. i.x = 0
  23174. }).onUpdate(function() {}).onComplete(function() {
  23175. e(),
  23176. i.x = 0,
  23177. setTimeout(function() {
  23178. t.tweenFlag = !0
  23179. }, 1500)
  23180. }),
  23181. this.cursorAnimate.easing(function(e) {
  23182. return Math.floor(17 * e) / 17
  23183. }),
  23184. this.cursorAnimate.start()
  23185. }
  23186. ,
  23187. this.autoCursorPosition = function(e) {
  23188. this.cursor.scale.set(.3, .3, .3)
  23189. }
  23190. }
  23191. ,
  23192. h.prototype.vrRenderer = function(a, i, e) {
  23193. var s = new i.vrCamera(e);
  23194. s.bananaAspect = .8,
  23195. this.width,
  23196. this.height;
  23197. i = this;
  23198. this.setSize = function(e, t) {
  23199. a.setSize.call(this, e, t),
  23200. i.width = e,
  23201. i.height = t
  23202. }
  23203. ,
  23204. this.render = function(e, t, i, n) {
  23205. var r, o;
  23206. if (window.cameraQua = t.quaternion.clone(),
  23207. t.__RESS__SKIP__STEREO__)
  23208. return a.render(e, t, i, n);
  23209. if ("PerspectiveCamera" === t.type)
  23210. r = s.cameraL,
  23211. o = s.cameraR,
  23212. e.updateMatrixWorld(),
  23213. null === t.parent && t.updateMatrixWorld(),
  23214. s.vrCameraUpdate(t);
  23215. else {
  23216. if ("OrthographicCamera" !== t.type)
  23217. return DEBUG && console.error("Unsupported renderer: ", t.type);
  23218. r = o = t
  23219. }
  23220. a.setScissorTest(!0),
  23221. a.setScissor(0, 0, this.width / 2, this.height),
  23222. a.setViewport(0, 0, this.width / 2, this.height),
  23223. a.render.call(this, e, r, i, n),
  23224. a.setScissor(this.width / 2, 0, this.width / 2, this.height),
  23225. a.setViewport(this.width / 2, 0, this.width / 2, this.height),
  23226. a.render.call(this, e, o, i, n),
  23227. a.setScissorTest(!1)
  23228. }
  23229. ,
  23230. this.__proto__ = {
  23231. __proto__: a
  23232. }
  23233. }
  23234. ,
  23235. h.prototype.vrCamera = function(e) {
  23236. this.type = "StereoCamera",
  23237. this._aspect = 1,
  23238. this._overlap = .064,
  23239. this.cameraL = new M.PerspectiveCamera,
  23240. this.cameraL.layers.enable(1),
  23241. this.cameraL.matrixAutoUpdate = !1,
  23242. this.cameraR = new M.PerspectiveCamera,
  23243. this.cameraR.layers.enable(2),
  23244. this.cameraR.matrixAutoUpdate = !1,
  23245. this.eyeRight = new M.Matrix4,
  23246. this.eyeLeft = new M.Matrix4,
  23247. this.vrCameraNeedsUpdate = !0,
  23248. window.vrCameraL = this.cameraL,
  23249. Object.defineProperty(this, "bananaAspect", {
  23250. get: function() {
  23251. return this._aspect
  23252. },
  23253. set: function(e) {
  23254. this._aspect !== e && (this.vrCameraNeedsUpdate = !0),
  23255. this._aspect = e
  23256. }
  23257. }),
  23258. Object.defineProperty(this, "overlap", {
  23259. get: function() {
  23260. return this._overlap
  23261. },
  23262. set: function(e) {
  23263. this._overlap !== e && (this.vrCameraNeedsUpdate = !0),
  23264. this._overlap = e
  23265. }
  23266. }),
  23267. this.vrCameraUpdate = function(e) {
  23268. if (this.vrCameraNeedsUpdate = !0,
  23269. this.vrCameraNeedsUpdate = this.vrCameraNeedsUpdate || this.bananaFov !== e.fov || this.bananaReal_aspect !== e.aspect * this.bananaAspect || this.bananaNear !== e.near || this.bananaFar !== e.far,
  23270. this.vrCameraNeedsUpdate) {
  23271. this.vrCameraNeedsUpdate = !1,
  23272. console.debug("vrCameraUpdate"),
  23273. this.bananaFocus = e.focus,
  23274. this.bananaFov = e.fov,
  23275. this.bananaReal_aspect = e.aspect * this.bananaAspect,
  23276. this.bananaNear = e.near,
  23277. this.bananaFar = e.far,
  23278. console.debug(e.aspect),
  23279. this.bananaFocus = 10;
  23280. var t, i, n = e.projectionMatrix.clone(), r = this.overlap / 2, o = r * this.bananaNear / this.bananaFocus, a = this.bananaNear * Math.tan(Math.PI / 180 * this.bananaFov * .5);
  23281. this.eyeLeft.elements[12] = -r,
  23282. this.eyeRight.elements[12] = r,
  23283. t = -a * this.bananaReal_aspect + o,
  23284. i = a * this.bananaReal_aspect + o,
  23285. n.elements[0] = 2 * this.bananaNear / (i - t),
  23286. n.elements[8] = (i + t) / (i - t),
  23287. this.cameraL.projectionMatrix.copy(n),
  23288. t = -a * this.bananaReal_aspect - o,
  23289. i = a * this.bananaReal_aspect - o,
  23290. n.elements[0] = 2 * this.bananaNear / (i - t),
  23291. n.elements[8] = (i + t) / (i - t),
  23292. this.cameraR.projectionMatrix.copy(n)
  23293. }
  23294. this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(this.eyeLeft),
  23295. this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(this.eyeRight)
  23296. }
  23297. }
  23298. ,
  23299. h.prototype.boluoGetTexture = function(e) {
  23300. var t = new M.TextureLoader;
  23301. return t.crossOrigin = "anonymous",
  23302. t.load(e)
  23303. }
  23304. ,
  23305. h.prototype.updateScreenSize = function(e) {
  23306. var t, i, n, r = !1;
  23307. e && !e.resize && null != e.width && null != e.height ? (i = e.width,
  23308. n = e.height,
  23309. r = !0,
  23310. t = 1) : (i = $("#player").width(),
  23311. n = $("#player").height(),
  23312. e && e.resize && (o = this.renderWidth,
  23313. a = this.renderHeight),
  23314. i === o && n === a && !this.forceUpdateSize || (o = i,
  23315. a = n,
  23316. r = !0,
  23317. t = window.devicePixelRatio)),
  23318. r && (this.setSize(i, n, t),
  23319. this.forceUpdateSize = !1)
  23320. }
  23321. ,
  23322. h.prototype.updateComponents = function() {
  23323. for (var e = Math.min(1, this.updateClock.getDelta()), t = 0; t < this.updateListeners.length; t++)
  23324. this.updateListeners[t].update(e)
  23325. }
  23326. ,
  23327. h.prototype.suspend = function() {
  23328. this.started = !1,
  23329. this.suspendedObjects = this.scene.children.map(function(e) {
  23330. return this.scene.remove(e),
  23331. e
  23332. }
  23333. .bind(this)),
  23334. this.render()
  23335. }
  23336. ,
  23337. h.prototype.resume = function() {
  23338. this.suspendedObjects.forEach(function(e) {
  23339. this.scene.add(e)
  23340. }
  23341. .bind(this)),
  23342. this.suspendedObjects = [],
  23343. this.started = !0,
  23344. b()
  23345. }
  23346. ;
  23347. var g, m, v, y, A, C, I, P, O, L, D, N, F, E, _, b = function() {
  23348. this.started && (window.requestAnimationFrame(b),
  23349. this.updateScreenSize(),
  23350. this.updateComponents(),
  23351. this.updateTextureMemory(),
  23352. this.render(),
  23353. this.emit(r.AfterRender))
  23354. };
  23355. h.prototype.getImageData = (E = document.createElement("canvas"),
  23356. _ = E.getContext("2d"),
  23357. function(e, t, i) {
  23358. return E.width === t && E.height === i || (E.width = t,
  23359. E.height = i),
  23360. _.drawImage(e, 0, 0, t, i),
  23361. _.getImageData(0, 0, t, i)
  23362. }
  23363. ),
  23364. h.prototype.initSizedTexture2D = function(e, t, i) {
  23365. var n = this.renderer
  23366. , r = n.context
  23367. , o = n.state
  23368. , a = new M.Texture(null);
  23369. !(a.flipY = !1) !== i && (i = !1),
  23370. a.generateMipmaps = i;
  23371. var s = n.paramThreeToGL(a.format)
  23372. , l = n.paramThreeToGL(a.type)
  23373. , c = n.properties.get(a)
  23374. , h = r.createTexture();
  23375. o.bindTexture(r.TEXTURE_2D, h),
  23376. r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL, a.flipY),
  23377. r.texImage2D(r.TEXTURE_2D, 0, s, e, e, 0, s, l, null),
  23378. a.wrapS = t,
  23379. a.wrapT = t;
  23380. var u = n.paramThreeToGL(t);
  23381. return r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_S, u),
  23382. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_T, u),
  23383. i ? (a.magFilter = M.LinearFilter,
  23384. a.minFilter = M.LinearMipMapLinearFilter,
  23385. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MAG_FILTER, r.LINEAR),
  23386. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, r.LINEAR_MIPMAP_NEAREST),
  23387. r.generateMipmap(r.TEXTURE_2D)) : (a.magFilter = M.LinearFilter,
  23388. a.minFilter = M.LinearFilter,
  23389. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MAG_FILTER, r.LINEAR),
  23390. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, r.LINEAR)),
  23391. o.bindTexture(r.TEXTURE_2D, null),
  23392. c.__webglTexture = h,
  23393. a
  23394. }
  23395. ,
  23396. h.prototype.initSizedCubeMap = function(e, t) {
  23397. var i = this.renderer
  23398. , n = i.context
  23399. , r = i.state
  23400. , o = new M.CubeTexture([null, null, null, null, null, null]);
  23401. o.flipY = !1,
  23402. o.generateMipmaps = t;
  23403. var a = i.paramThreeToGL(o.format)
  23404. , s = i.paramThreeToGL(o.type)
  23405. , l = i.properties.get(o)
  23406. , c = n.createTexture();
  23407. r.bindTexture(n.TEXTURE_CUBE_MAP, c),
  23408. n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL, o.flipY);
  23409. for (var h = 0; h < 6; h++)
  23410. n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + h, 0, a, e, e, 0, a, s, null);
  23411. return t ? (o.magFilter = M.LinearFilter,
  23412. o.minFilter = M.LinearMipMapLinearFilter,
  23413. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  23414. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR_MIPMAP_LINEAR),
  23415. n.texParameteri(n.TEXTURE_CUBE_MAP, n.GENERATE_MIPMAP, n.TRUE),
  23416. n.generateMipmap(n.TEXTURE_CUBE_MAP)) : (o.magFilter = M.LinearFilter,
  23417. o.minFilter = M.LinearFilter,
  23418. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  23419. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR)),
  23420. r.bindTexture(n.TEXTURE_CUBE_MAP, null),
  23421. l.__image__webglTextureCube = c,
  23422. o
  23423. }
  23424. ,
  23425. h.prototype.deallocateCubeTexture = function(e) {
  23426. var t = this.renderer
  23427. , i = t.context
  23428. , n = t.properties.get(e);
  23429. i.deleteTexture(n.__image__webglTextureCube)
  23430. }
  23431. ,
  23432. h.prototype.uploadTexture2D = function(e, t, i, n, r, o) {
  23433. var a = this.renderer
  23434. , s = a.context
  23435. , l = a.state
  23436. , c = a.properties.get(t);
  23437. l.bindTexture(s.TEXTURE_2D, c.__webglTexture),
  23438. s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, t.flipY),
  23439. s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  23440. s.pixelStorei(s.UNPACK_ALIGNMENT, t.unpackAlignment),
  23441. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_S, a.paramThreeToGL(t.wrapS)),
  23442. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_T, a.paramThreeToGL(t.wrapT)),
  23443. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MAG_FILTER, a.paramThreeToGL(t.magFilter)),
  23444. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MIN_FILTER, a.paramThreeToGL(t.minFilter)),
  23445. s.texSubImage2D(s.TEXTURE_2D, 0, i, n, s.RGBA, s.UNSIGNED_BYTE, e),
  23446. t.generateMipmaps && s.generateMipmap(s.TEXTURE_2D),
  23447. l.bindTexture(s.TEXTURE_2D, null)
  23448. }
  23449. ,
  23450. h.prototype.uploadTexture3D = function(e, t, i, n, r, o, a) {
  23451. var s = this.renderer
  23452. , l = s.context
  23453. , c = s.state
  23454. , h = s.properties.get(t);
  23455. c.bindTexture(l.TEXTURE_CUBE_MAP, h.__image__webglTextureCube),
  23456. l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL, t.flipY),
  23457. l.texSubImage2D(r, 0, i, n, l.RGBA, l.UNSIGNED_BYTE, e),
  23458. t.generateMipmaps && l.generateMipmap(l.TEXTURE_CUBE_MAP),
  23459. c.bindTexture(l.TEXTURE_CUBE_MAP, null)
  23460. }
  23461. ,
  23462. h.prototype.rebuildMipMaps2D = function(e) {
  23463. var t = this.renderer
  23464. , i = t.context
  23465. , n = t.state;
  23466. t.properties.get(e),
  23467. i.generateMipmap(i.TEXTURE_2D),
  23468. n.bindTexture(i.TEXTURE_2D, null)
  23469. }
  23470. ,
  23471. h.prototype.rebuildMipMaps3D = function(e) {
  23472. var t = this.renderer
  23473. , i = t.context
  23474. , n = t.state
  23475. , r = t.properties.get(e);
  23476. n.bindTexture(i.TEXTURE_CUBE_MAP, r.__image__webglTextureCube),
  23477. i.generateMipmap(i.TEXTURE_CUBE_MAP),
  23478. n.bindTexture(i.TEXTURE_CUBE_MAP, null)
  23479. }
  23480. ,
  23481. h.prototype.renderToCubeMap = (P = !1,
  23482. F = N = D = L = O = null,
  23483. function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  23484. this.renderer.context,
  23485. P || ((L = new M.OrthographicCamera(-.5,.5,.5,-.5,-200,200)).position.z = 150,
  23486. (O = new M.Scene).add(L),
  23487. D = new M.ShaderMaterial({
  23488. uniforms: {
  23489. tDiffuse: {
  23490. type: "t",
  23491. value: null
  23492. },
  23493. alpha: {
  23494. type: "f",
  23495. value: 1
  23496. }
  23497. },
  23498. vertexShader: R.basicTextured.vertexShader,
  23499. fragmentShader: R.basicTextured.fragmentShader,
  23500. depthWrite: !1,
  23501. depthTest: !1,
  23502. side: M.DoubleSide
  23503. }),
  23504. N = new M.PlaneBufferGeometry(1,1),
  23505. (F = new M.Mesh(N,D)).position.z = 0,
  23506. O.add(F),
  23507. P = !0);
  23508. var m = N.getAttribute("uv");
  23509. m.setDynamic(!0),
  23510. m.needsUpdate = !0;
  23511. var v = m.array
  23512. , y = r / i
  23513. , A = o / n
  23514. , C = a / i
  23515. , I = s / n;
  23516. v[0] = y,
  23517. v[1] = A + I,
  23518. v[2] = y + C,
  23519. v[3] = A + I,
  23520. v[4] = y,
  23521. v[5] = A,
  23522. v[6] = y + C,
  23523. v[7] = A;
  23524. var E = N.getAttribute("position");
  23525. E.setDynamic(!0),
  23526. E.needsUpdate = !0;
  23527. var _ = E.array
  23528. , b = l / t.width - .5
  23529. , w = c / t.height - .5
  23530. , T = h / t.width
  23531. , x = u / t.height;
  23532. _[0] = b,
  23533. _[1] = w + x,
  23534. _[3] = b + T,
  23535. _[4] = w + x,
  23536. _[6] = b,
  23537. _[7] = w,
  23538. _[9] = b + T,
  23539. _[10] = w,
  23540. this.renderer.properties.get(e),
  23541. D.uniforms.tDiffuse.value = e,
  23542. D.blending = p || M.NoBlending,
  23543. D.transparent = !!f,
  23544. null != g || (g = 1),
  23545. D.uniforms.alpha.value = g,
  23546. D.needUpdate = !0,
  23547. t.activeCubeFace = d,
  23548. t.viewport.set(0, 0, t.width, t.height);
  23549. var S = this.renderer.autoClear;
  23550. this.renderer.autoClear = !1,
  23551. this.renderer.render(O, L, t, !1),
  23552. this.renderer.autoClear = S
  23553. }
  23554. ),
  23555. h.prototype.copyCubeMap = (g = !1,
  23556. C = A = y = v = m = null,
  23557. I = new M.Euler,
  23558. new M.Vector3,
  23559. function(e, t, i, n, r, o, a, s, l) {
  23560. this.renderer,
  23561. g || ((v = new M.OrthographicCamera(-1,1,1,-1,0,200)).position.set(0, 0, 0),
  23562. (m = new M.Scene).add(v),
  23563. y = new M.ShaderMaterial({
  23564. uniforms: {
  23565. tDiffuse: {
  23566. type: "t",
  23567. value: null
  23568. },
  23569. alpha: {
  23570. type: "f",
  23571. value: 1
  23572. }
  23573. },
  23574. vertexShader: R.copyCubeMap.vertexShader,
  23575. fragmentShader: R.copyCubeMap.fragmentShader,
  23576. depthWrite: !1,
  23577. depthTest: !1,
  23578. side: M.DoubleSide
  23579. }),
  23580. A = new M.BoxGeometry(2,2,2),
  23581. C = new M.Mesh(A,y),
  23582. m.add(C),
  23583. g = !0);
  23584. for (var c = 0; c < 6; c++)
  23585. h.getCubeOrientationForCubeFace(c, I),
  23586. C.rotation.copy(I),
  23587. C.matrixWorldNeedsUpdate = !0,
  23588. C.updateMatrixWorld(),
  23589. y.uniforms.tDiffuse.value = e,
  23590. y.blending = a || M.NoBlending,
  23591. y.transparent = !!s,
  23592. null != l || (l = 1),
  23593. y.uniforms.alpha.value = l,
  23594. y.needUpdate = !0,
  23595. t.activeCubeFace = c,
  23596. t.viewport.set(0, 0, r, o),
  23597. this.renderer.render(m, v, t, !1)
  23598. }
  23599. ),
  23600. h.getLookAtForCubeFace = function(e, t) {
  23601. switch (e) {
  23602. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  23603. t.set(1, 0, 0);
  23604. break;
  23605. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  23606. t.set(-1, 0, 0);
  23607. break;
  23608. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  23609. t.set(0, 1, 0);
  23610. break;
  23611. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  23612. t.set(0, -1, 0);
  23613. break;
  23614. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  23615. t.set(0, 0, 1);
  23616. break;
  23617. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  23618. t.set(0, 0, -1)
  23619. }
  23620. }
  23621. ,
  23622. h.getCubeOrientationForCubeFace = function(e, t) {
  23623. switch (e) {
  23624. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  23625. t.set(0, -Math.PI / 2, 0);
  23626. break;
  23627. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  23628. t.set(0, Math.PI / 2, 0);
  23629. break;
  23630. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  23631. t.set(Math.PI / 2, Math.PI, 0);
  23632. break;
  23633. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  23634. t.set(-Math.PI / 2, Math.PI, 0);
  23635. break;
  23636. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  23637. t.set(0, -Math.PI, 0);
  23638. break;
  23639. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  23640. t.set(0, 0, 0)
  23641. }
  23642. }
  23643. ,
  23644. t.exports = h
  23645. }
  23646. , {
  23647. "../enum/GLCubeFaces": 25,
  23648. "../enum/GLTextureType": 26,
  23649. "../enum/SceneRendererEvents": 43,
  23650. "../exception/BasicException": 55,
  23651. "../exception/RendererCreationException": 57,
  23652. "../settings": 166,
  23653. "../shaders": 167,
  23654. "../util/browser": 182,
  23655. events: 202,
  23656. three: 217
  23657. }],
  23658. 159: [function(e, t, i) {
  23659. "use strict";
  23660. function n(e) {
  23661. this.messenger = new a(e),
  23662. this.clientKey = null
  23663. }
  23664. var o = e("../util/ajax")
  23665. , r = e("./PostMessageType")
  23666. , a = e("./postmessage")
  23667. , s = e("./VersionInfo")
  23668. , l = e("events").EventEmitter
  23669. , c = window.location.origin + "/api/v1/user/";
  23670. (n.prototype = Object.create(l.prototype)).bindEvents = function() {
  23671. this.messenger.on(r.ACTION, this.onMessageReceived.bind(this))
  23672. }
  23673. ,
  23674. n.prototype.waitForConnection = function() {
  23675. return new Promise(function(t, i) {
  23676. this.messenger.on(r.CONNECT, function(e) {
  23677. this.onConnectionReceived(e).then(t.bind(this, e.sdkVersion), i.bind())
  23678. }
  23679. .bind(this))
  23680. }
  23681. .bind(this))
  23682. }
  23683. ,
  23684. n.prototype.onConnectionReceived = function(i) {
  23685. return this.messenger.setTarget(i.source, i.origin),
  23686. this.verifyConnection(i).then(function(e, t) {
  23687. this.messenger.send({
  23688. type: r.ACCEPT,
  23689. toId: i.fromId,
  23690. warning: t
  23691. }),
  23692. this.clientKey = e,
  23693. this.messenger.removeAllListeners(r.CONNECT),
  23694. this.bindEvents()
  23695. }
  23696. .bind(this), function(e) {
  23697. this.messenger.send({
  23698. type: r.REJECT,
  23699. toId: i.fromId,
  23700. reason: e
  23701. }),
  23702. this.messenger.setTarget()
  23703. }
  23704. .bind(this))
  23705. }
  23706. ,
  23707. n.prototype.verifyConnection = function(r) {
  23708. return new Promise(function(e, t) {
  23709. var i;
  23710. if (s.isDeprecated(r.sdkVersion))
  23711. i = "这个版本正在被弃用";
  23712. else if (!s.isSupported(r.sdkVersion))
  23713. return t("不支持此版本的SDK");
  23714. var n = {
  23715. cache: !1,
  23716. headers: {
  23717. "X-port-Application-Key": r.applicationKey,
  23718. "X-port-Referrer": r.origin
  23719. }
  23720. };
  23721. o.get(c, n).done(e.bind(this, r.applicationKey, i)).fail(t.bind(this, "key/referrer mismatch"))
  23722. }
  23723. )
  23724. }
  23725. ,
  23726. n.prototype.onMessageReceived = function(t) {
  23727. if (this.validateClientApplicationKey(t.applicationKey)) {
  23728. var i = this;
  23729. t.onDone = function(e) {
  23730. e.toId = t.fromId,
  23731. e.uid = t.uid,
  23732. e.type = r.RESPONSE,
  23733. i.messenger.send(e)
  23734. }
  23735. ,
  23736. this.emit(r.ACTION, t)
  23737. }
  23738. }
  23739. ,
  23740. n.prototype.validateClientApplicationKey = function(e) {
  23741. return this.clientKey === e
  23742. }
  23743. ,
  23744. n.prototype.sendEvent = function(e, t) {
  23745. this.messenger.send({
  23746. type: r.EVENT,
  23747. eventType: e,
  23748. eventData: t
  23749. })
  23750. }
  23751. ,
  23752. t.exports = n
  23753. }
  23754. , {
  23755. "../util/ajax": 181,
  23756. "./PostMessageType": 160,
  23757. "./VersionInfo": 163,
  23758. "./postmessage": 165,
  23759. events: 202
  23760. }],
  23761. 160: [function(e, t, i) {
  23762. "use strict";
  23763. t.exports = Object.freeze({
  23764. CONNECT: "postmessage.connect",
  23765. ACCEPT: "postmessage.accept",
  23766. REJECT: "postmessage.reject",
  23767. ACTION: "postmessage.action",
  23768. RESPONSE: "postmessage.response",
  23769. EVENT: "postmessage.event"
  23770. })
  23771. }
  23772. , {}],
  23773. 161: [function(e, t, i) {
  23774. "use strict";
  23775. t.exports = Object.freeze({
  23776. MOVE: "sdk.move",
  23777. ENTER_PANO: "sdk.enterpano",
  23778. MODEL_LOADED: "sdk.modelloaded"
  23779. })
  23780. }
  23781. , {}],
  23782. 162: [function(e, t, i) {
  23783. "use strict";
  23784. t.exports = Object.freeze({
  23785. FLY: "transition.fly",
  23786. FADEOUT: "transition.fade",
  23787. INSTANT: "transition.instant"
  23788. })
  23789. }
  23790. , {}],
  23791. 163: [function(e, t, i) {
  23792. "use strict";
  23793. t.exports = {
  23794. current: "1.0",
  23795. supported: ["1.0"],
  23796. deprecated: [],
  23797. isSupported: function(e) {
  23798. return -1 !== this.supported.indexOf(e)
  23799. },
  23800. isDeprecated: function(e) {
  23801. return -1 !== this.deprecated.indexOf(e)
  23802. },
  23803. isValid: function(e) {
  23804. return this.isSupported(e) || this.isDeprecated(e)
  23805. }
  23806. }
  23807. }
  23808. , {}],
  23809. 164: [function(q, X, e) {
  23810. (function(e) {
  23811. "use strict";
  23812. function r(e, t, i) {
  23813. e = e && e.toLowerCase().trim();
  23814. var n = new C.UP.clone
  23815. , r = Math.PI / 3
  23816. , o = Math.PI / 2;
  23817. switch (e) {
  23818. case "left":
  23819. i.copy(t),
  23820. i.applyAxisAngle(n, o);
  23821. break;
  23822. case "right":
  23823. i.copy(t),
  23824. i.applyAxisAngle(n, -o);
  23825. break;
  23826. case "forwardleft":
  23827. i.copy(t),
  23828. i.applyAxisAngle(n, r);
  23829. break;
  23830. case "forwardright":
  23831. i.copy(t),
  23832. i.applyAxisAngle(n, -r);
  23833. break;
  23834. case "forward":
  23835. default:
  23836. i.copy(t)
  23837. }
  23838. return i
  23839. }
  23840. function o(e, t) {
  23841. if (e) {
  23842. var i = {
  23843. pano: e,
  23844. lookAtPoint: null,
  23845. duration: null,
  23846. maxDistanceOverride: null,
  23847. skipWarpingCheck: !1
  23848. };
  23849. this.player.flyToPano(i, function() {
  23850. t && t({
  23851. success: !0,
  23852. message: "Transition complete."
  23853. })
  23854. })
  23855. } else
  23856. M.warn("Showcase -> clickPanoObject: Unable to find pano."),
  23857. t && t({
  23858. success: !1,
  23859. error: "Unable to find pano."
  23860. })
  23861. }
  23862. function a(e, t) {
  23863. t.copy(C.FORWARD),
  23864. e.getDirection(t)
  23865. }
  23866. function c(i) {
  23867. return {
  23868. panos: i.panos.list.map(function(e) {
  23869. var t = y.getCubemapUrls(i.urls, e.id, "high")[A.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z];
  23870. return {
  23871. uuid: e.id,
  23872. aligned: e.alignmentType === g.ALIGNED,
  23873. neighbourUUIDs: e.neighbourUUIDs.slice(),
  23874. position: function(e) {
  23875. return e.alignmentType !== g.ALIGNED ? null : {
  23876. x: e.position.x,
  23877. y: e.position.y,
  23878. z: e.position.z
  23879. }
  23880. }(e),
  23881. rotation: function(e) {
  23882. var t = (new h.Euler).setFromQuaternion(e.quaternion, "YXZ");
  23883. return {
  23884. x: h.Math.radToDeg(t._x),
  23885. y: h.Math.radToDeg(t._y),
  23886. z: h.Math.radToDeg(t._z)
  23887. }
  23888. }(e),
  23889. thumbnail: t
  23890. }
  23891. })
  23892. }
  23893. }
  23894. var t, l, i, h = q("three"), u = q("./ApiHost"), n = q("../util/logger"), d = q("../util/common"), s = q("../util/math"), p = q("../enum/ModelManagerEvents"), f = q("./PostMessageType"), g = q("../enum/AlignmentType"), m = q("../enum/Direction"), v = q("./TransitionStyles"), y = q("../util/panorama"), A = q("../enum/GLCubeFaces"), C = q("../enum/Vectors"), I = q("../enum/Viewmode"), E = q("../enum/WarpStyle"), _ = (q("../enum/Keys"),
  23895. q("../enum/PlayerEvents")), b = q("../sdk/SdkEvents"), w = (C = q("../enum/Vectors"),
  23896. q("../enum/ControlEvents")), T = q("../enum/RenderLayers"), x = (q("../constants"),
  23897. q("../settings")), S = q("../lib/jpeg_encoder"), M = new n(e), R = (N.active = !1,
  23898. N.angle = 0,
  23899. N.angleTravelled = 0,
  23900. N.playerDirection = new h.Vector3,
  23901. N.lastFacingDirection = new h.Vector3,
  23902. N.onDone = null,
  23903. N.player = null,
  23904. N.start = function(e, t, i, n) {
  23905. N.active = !0,
  23906. e && t && (t = 0),
  23907. N.angle = e || t,
  23908. N.xAngle = e,
  23909. N.yAngle = t,
  23910. N.angleTravelled = 0,
  23911. N.playerDirection.copy(i.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  23912. i.getDirection(N.playerDirection),
  23913. N.lastFacingDirection.copy(N.playerDirection),
  23914. N.projectVectors(),
  23915. N.onDone = n,
  23916. N.player = i,
  23917. N()
  23918. }
  23919. ,
  23920. N.projectVectors = function() {
  23921. N.xAngle && (N.playerDirection.projectOnPlane(C.UP),
  23922. N.lastFacingDirection.projectOnPlane(C.UP))
  23923. }
  23924. ,
  23925. N), P = (i = new h.Vector3,
  23926. function(e) {
  23927. e ? (i.copy(e.position),
  23928. i.add(e.discPosition),
  23929. s.projectPositionToCanvas(i, this.player.camera, i),
  23930. this.click(i.x, i.y)) : M.warn("Showcase -> clicktagObject: Unable to find tag.")
  23931. }
  23932. ), O = (l = new h.Vector3,
  23933. function(e) {
  23934. var t = this.player.getDirection();
  23935. l.copy(t);
  23936. var i = l.y;
  23937. l.y = 0,
  23938. l.normalize();
  23939. var n = h.Math.radToDeg(l.angleTo(t)) * (i < 0 ? -1 : 1);
  23940. if (this.player.mode !== I.DOLLHOUSE && this.player.mode !== I.PANORAMA)
  23941. return 0 !== e && M.warn("Cannot rotate in y direction when in " + this.player.mode + " mode"),
  23942. 0;
  23943. this.player.mode === I.DOLLHOUSE && (n = -n);
  23944. var r = function() {
  23945. return this.player.mode === I.PANORAMA ? x.insideLookLimitUp : this.player.mode === I.DOLLHOUSE ? 90 - h.Math.radToDeg(x.dollhouseDefault.minPolarAngle) : null
  23946. }
  23947. .call(this) - .1
  23948. , o = function() {
  23949. return this.player.mode === I.PANORAMA ? x.insideLookLimitDown : this.player.mode === I.DOLLHOUSE ? 90 - h.Math.radToDeg(x.dollhouseDefault.maxPolarAngle) : null
  23950. }
  23951. .call(this) + .1
  23952. , a = n + e;
  23953. r < a ? a = r : a < o && (a = o);
  23954. var s = a - n;
  23955. return 0 < e && s < .01 && (s = 0),
  23956. e < 0 && -.01 < s && (s = 0),
  23957. s
  23958. }
  23959. ), L = (t = new h.Euler,
  23960. function(e) {
  23961. return t.setFromQuaternion(e.quaternion, "YXZ"),
  23962. {
  23963. position: {
  23964. x: e.position.x,
  23965. y: e.position.y,
  23966. z: e.position.z
  23967. },
  23968. rotation: {
  23969. x: h.Math.radToDeg(t.x),
  23970. y: h.Math.radToDeg(t.y),
  23971. z: 0
  23972. },
  23973. pano: e.currentPano ? e.currentPano.id : null,
  23974. mode: e.mode
  23975. }
  23976. }
  23977. ), D = null;
  23978. function N() {
  23979. N.playerDirection.copy(N.player.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  23980. N.player.getDirection(N.playerDirection),
  23981. N.projectVectors();
  23982. var e = N.playerDirection.angleTo(N.lastFacingDirection);
  23983. (N.angleTravelled += Math.abs(e)) >= Math.abs(N.angle) ? (N.active = !1,
  23984. N.onDone && (0,
  23985. N.onDone)()) : (N.lastFacingDirection.copy(N.playerDirection),
  23986. window.setTimeout(N, 4))
  23987. }
  23988. X.exports = {
  23989. init: function(e, t, i, n, r) {
  23990. Y.init(e, t, i, r),
  23991. D = new Promise(function(e, t) {
  23992. i.on(_.Ready, function() {
  23993. e()
  23994. })
  23995. }
  23996. .bind(this));
  23997. var o = new u(window)
  23998. , a = o.waitForConnection();
  23999. a.then(function(e) {
  24000. o.on(f.ACTION, Y.onMessageReceive.bind(Y))
  24001. });
  24002. var s, l = (s = Date.now(),
  24003. function() {
  24004. if (!(Date.now() - s < 100)) {
  24005. var e = L(i);
  24006. o.sendEvent(b.MOVE, {
  24007. state: e
  24008. }),
  24009. s = Date.now()
  24010. }
  24011. }
  24012. );
  24013. i.on(_.Move, l),
  24014. i.on(_.ViewChanged, l),
  24015. n.on(p.ActiveModelChanged, function(e) {
  24016. function t(e) {
  24017. var t, i = e.newPano.id;
  24018. e.oldPano && (t = e.oldPano.id),
  24019. i !== t && o.sendEvent(b.ENTER_PANO, {
  24020. oldPano: t,
  24021. newPano: i
  24022. })
  24023. }
  24024. var i = e.model
  24025. , n = e.oldModel;
  24026. Y.model = i,
  24027. a.then(function() {
  24028. o.sendEvent(b.MODEL_LOADED, {
  24029. metadata: c(i)
  24030. })
  24031. }),
  24032. n && n.panos.forEach(function(e) {
  24033. e.removeEventListener("enter", t)
  24034. }),
  24035. i.panos.forEach(function(e) {
  24036. e.on("enter", t)
  24037. })
  24038. })
  24039. }
  24040. };
  24041. var F, B, V, k, U, H, z, G, W, j, Y = {
  24042. director: null,
  24043. player: null,
  24044. controls: null,
  24045. sceneRenderer: null,
  24046. model: null,
  24047. init: function(e, t, i, n) {
  24048. this.director = e,
  24049. this.player = i,
  24050. this.controls = t,
  24051. this.sceneRenderer = n
  24052. },
  24053. handleToObject: {},
  24054. objectToHandle: {},
  24055. handleCount: 0,
  24056. onMessageReceive: function(e) {
  24057. if (e) {
  24058. var t = e.targetFunction
  24059. , i = e.params
  24060. , n = e.onDone;
  24061. t && this[t] && this[t](i, n)
  24062. }
  24063. },
  24064. waitForInit: function(e, t) {
  24065. D.then(t.bind({
  24066. success: !0,
  24067. message: "Init complete."
  24068. }))
  24069. },
  24070. moveToPano: (W = new h.Euler(0,0,0,"YXZ"),
  24071. j = new h.Quaternion,
  24072. function(e, t) {
  24073. var i = e.pano
  24074. , n = e.rotation
  24075. , r = e.transition;
  24076. if (!this.model)
  24077. return t({
  24078. success: !1,
  24079. error: "The model has not been loaded yet"
  24080. });
  24081. var o = this.model.panos.get(i);
  24082. if (!o)
  24083. return t({
  24084. success: !1,
  24085. error: i + " does not exist in this model"
  24086. });
  24087. if (!n)
  24088. return t({
  24089. sucess: !1,
  24090. erorr: n + " is not a valid rotation"
  24091. });
  24092. W.set(h.Math.degToRad(n.x || 0), h.Math.degToRad(n.y || 0), h.Math.degToRad(n.z || 0), "YXZ"),
  24093. console.log(n.z);
  24094. var a = {
  24095. success: !0,
  24096. message: i
  24097. };
  24098. if (r === v.FADEOUT)
  24099. j.setFromEuler(W),
  24100. this.player.warpToPano(o, j, null, null, E.BLACK, null, null, t.bind(this, a));
  24101. else {
  24102. var s, l;
  24103. r === v.INSTANT && (l = s = 0);
  24104. var c = C.FORWARD.clone().applyEuler(W).add(o.position);
  24105. this.player.flyToPano({
  24106. pano: o,
  24107. lookAtPoint: c,
  24108. duration: s,
  24109. aimDuration: l
  24110. }, t.bind(this, a))
  24111. }
  24112. }
  24113. ),
  24114. moveInDirection: function(e, t) {
  24115. var i = e.direction;
  24116. return void 0 === m[i] ? (M.warn("Showcase -> moveInDirection: Cannot move in invalid direction."),
  24117. void (t && t({
  24118. success: !1,
  24119. error: "Invalid direction."
  24120. }))) : void this.player.flyLocalDirection(C[i].clone()).then(function(e) {
  24121. t(e ? {
  24122. success: !0,
  24123. message: "moved " + i
  24124. } : {
  24125. success: !1,
  24126. error: "Cannot move in direction: " + i
  24127. })
  24128. })
  24129. },
  24130. getPose: function(e, t) {
  24131. return this.player.camera.position,
  24132. (new h.Euler).setFromQuaternion(this.player.camera.quaternion, "YXZ"),
  24133. t({
  24134. success: !0,
  24135. message: L(this.player)
  24136. })
  24137. },
  24138. takeScreenShot: (z = new h.PerspectiveCamera,
  24139. G = new h.WebGLRenderTarget,
  24140. function(e, t) {
  24141. if (!e.resolution)
  24142. return t({
  24143. success: !1,
  24144. error: "An invalid resolution was specified"
  24145. });
  24146. if (-1 === e.resolution.width || -1 === e.resolution.height) {
  24147. var i = this.sceneRenderer.renderer.getSize();
  24148. e.resolution.width = i.width,
  24149. e.resolution.height = i.height
  24150. }
  24151. z.layers.set(T.DEFAULT),
  24152. e.visibleObjects && (e.visibleObjects.showtags && z.layers.enable(T.TAG),
  24153. e.visibleObjects.showPucks && z.layers.enable(T.PANOMARKERS),
  24154. e.visibleObjects.showReticule && z.layers.enable(T.RETICULE));
  24155. var n = e.resolution.width
  24156. , r = e.resolution.height
  24157. , o = n / r;
  24158. z.position.copy(this.sceneRenderer.camera.position),
  24159. z.quaternion.copy(this.sceneRenderer.camera.quaternion),
  24160. z.projectionMatrix.copy(this.player.camera.projectionMatrix),
  24161. z.projectionMatrix.elements[0] = this.player.camera.projectionMatrix.elements[5] / o,
  24162. G.setSize(n, r),
  24163. this.sceneRenderer.renderer.render(this.sceneRenderer.scene, z, G);
  24164. var a = new Uint8Array(n * r * 4);
  24165. this.sceneRenderer.renderer.readRenderTargetPixels(G, 0, 0, n, r, a);
  24166. var s = S.encode({
  24167. data: a,
  24168. width: n,
  24169. height: r,
  24170. heading: 180,
  24171. pitch: 0
  24172. }, {
  24173. quality: 75,
  24174. flipY: !0
  24175. });
  24176. t({
  24177. success: !0,
  24178. message: "data:image/jpg;base64," + d.uint8ToBase64(s.data)
  24179. })
  24180. }
  24181. ),
  24182. findRankedPano: (U = new h.Vector3,
  24183. H = new h.Vector3,
  24184. function(e, t) {
  24185. a(this.player, H),
  24186. r(t, H, U);
  24187. var i = this.player.rankedPanoInDirection(e, U);
  24188. if (i) {
  24189. var n = this.objectToHandle[i.id];
  24190. return n || (this.objectToHandle[i.id] = n = this.handleCount++,
  24191. this.handleToObject[n] = i),
  24192. n
  24193. }
  24194. return M.warn("Showcase -> findRankedPano: Unable to find nearby pano."),
  24195. -1
  24196. }
  24197. ),
  24198. findRankedtag: (V = new h.Vector3,
  24199. k = new h.Vector3,
  24200. function(e, t) {
  24201. a(this.player, k),
  24202. r(t, k, V);
  24203. var i = this.player.rankedtagInDirection(e, V);
  24204. if (i) {
  24205. var n = this.objectToHandle[i.sid];
  24206. return n || (this.objectToHandle[i.sid] = n = this.handleCount++,
  24207. this.handleToObject[n] = i),
  24208. n
  24209. }
  24210. return M.warn("Showcase -> findRankedtag: Unable to find nearby tag."),
  24211. -1
  24212. }
  24213. ),
  24214. clickNearesttag: function(e) {
  24215. this.clickRankedtag(0, e)
  24216. },
  24217. clickRankedtag: function(e, t) {
  24218. var i = function(e, t) {
  24219. var i = this.findRankedtag(e, t);
  24220. return 0 <= i ? this.handleToObject[i] : (M.warn("Showcase -> findRankedtagObject: Unable to find nearby tag."),
  24221. null)
  24222. }
  24223. .call(this, e, t);
  24224. i && P.call(this, i)
  24225. },
  24226. clickNearestPano: function(e, t) {
  24227. this.clickRankedPano(0, e, t)
  24228. },
  24229. clickRankedPano: function(e, t, i) {
  24230. var n = function(e, t) {
  24231. var i = this.findRankedPano(e, t);
  24232. return 0 <= i ? this.handleToObject[i] : (M.warn("Showcase -> findRankedPanoObject: Unable to find nearby pano."),
  24233. null)
  24234. }
  24235. .call(this, e, t);
  24236. n ? o.call(this, n, i) : i(null)
  24237. },
  24238. clickPano: function(e, t) {
  24239. var i = this.handleTable[e];
  24240. i ? o.call(this, i, t) : t(null)
  24241. },
  24242. rotateDirection: function(e, t) {
  24243. var i = e.direction
  24244. , n = e.angle;
  24245. if (!R.active) {
  24246. var r = 0
  24247. , o = 0
  24248. , a = 0
  24249. , s = 0;
  24250. if (!n || isNaN(n))
  24251. return M.warn("Showcase -> rotateDirection: Invalid rotation angle."),
  24252. void (t && t({
  24253. success: !1,
  24254. error: "Invalid rotation angle."
  24255. }));
  24256. if (this.player.mode === I.TRANSITIONING)
  24257. return M.warn("Automation -> rotateDirection: Cannot rotate while transitioning"),
  24258. void (t && t({
  24259. success: !1,
  24260. error: "Cannot rotate while transitioning"
  24261. }));
  24262. if (i === m.RIGHT || i === m.LEFT)
  24263. i === m.RIGHT && (n = -n),
  24264. r = 0 < n ? -1 : 1,
  24265. a = n;
  24266. else {
  24267. if (i !== m.UP && i !== m.DOWN)
  24268. return M.warn("Showcase -> rotateDirection: Invalid direction for rotation: " + i),
  24269. void (t && t({
  24270. success: !1,
  24271. error: "Invalid direction for rotation."
  24272. }));
  24273. if (this.player.mode === I.FLOORPLAN)
  24274. return M.warn("Showcase -> rotateDirection: Cannot rotate " + i + " in floorplan mode"),
  24275. void (t && t({
  24276. success: !1,
  24277. error: "Cannot rotate " + i + " in floorplan mode"
  24278. }));
  24279. if (i === m.DOWN && (n = -n),
  24280. 0 === (n = O.call(this, n)))
  24281. return M.warn("Showcase -> rotateDirection: Already at maximum rotation in direction: " + i),
  24282. void (t && t({
  24283. success: !1,
  24284. error: "Already at maximum rotation in direction: " + i
  24285. }));
  24286. o = 0 < n ? 1 : -1,
  24287. s = n
  24288. }
  24289. var l = n;
  24290. n = h.Math.degToRad(n),
  24291. a = h.Math.degToRad(a),
  24292. s = h.Math.degToRad(s);
  24293. var c = this.controls.activeControl;
  24294. c.startRotating(r, o),
  24295. R.start(a, s, this.player, function() {
  24296. c.stopRotating(!0),
  24297. t && t({
  24298. success: !0,
  24299. message: "Rotated " + l.toFixed(2) + "° in direction: " + e.direction
  24300. })
  24301. })
  24302. }
  24303. },
  24304. rotate: (F = new h.Vector3,
  24305. B = new h.Vector3,
  24306. function(e, t) {
  24307. var i = e.xAngle
  24308. , n = e.yAngle;
  24309. if (!R.active) {
  24310. if (i = i || 0,
  24311. n = n || 0,
  24312. isNaN(i) || isNaN(n))
  24313. return M.warn("Showcase -> rotate: Invalid rotation angle."),
  24314. void (t && t({
  24315. success: !1,
  24316. error: "Invalid rotation angle."
  24317. }));
  24318. if (this.player.mode === I.TRANSITIONING)
  24319. return M.warn("Automation -> rotate: Cannot rotate while transitioning"),
  24320. void (t && t({
  24321. success: !1,
  24322. error: "Cannot rotate while transitioning"
  24323. }));
  24324. Math.abs(i) < .01 && (i = 0),
  24325. Math.abs(n) < .01 && (n = 0);
  24326. var r = n;
  24327. n = O.call(this, n);
  24328. var o = 0 < r ? "UP" : "DOWN";
  24329. if (!(i = -i) && r && !n)
  24330. return M.warn("Showcase -> rotate: Already at maximum rotation in direction: " + o),
  24331. void (t && t({
  24332. success: !1,
  24333. error: "Already at maximum rotation in direction: " + o
  24334. }));
  24335. n < r && M.warn("Showcase -> rotate: Reached maximum rotation in direction: " + o);
  24336. var a = n;
  24337. n = h.Math.degToRad(n),
  24338. i = h.Math.degToRad(i),
  24339. F.copy(this.player.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  24340. this.player.getDirection(F),
  24341. B.copy(F).applyAxisAngle(C.UP, i),
  24342. B.applyAxisAngle(C.RIGHT, n);
  24343. var s = (F.angleTo(B),
  24344. 0 < i ? -1 : i < 0 ? 1 : 0)
  24345. , l = 0 < n ? 1 : n < 0 ? -1 : 0;
  24346. Math.abs(i) > Math.abs(n) ? l *= Math.abs(n / i) : Math.abs(n) > Math.abs(i) && (s *= Math.abs(i / n));
  24347. var c = this.controls.activeControl;
  24348. c.startRotating(s, l),
  24349. R.start(i, n, this.player, function() {
  24350. c.stopRotating(!0),
  24351. t && t({
  24352. success: !0,
  24353. message: "Rotated " + e.xAngle.toFixed(2) + "° horizontally, " + a.toFixed(2) + "° vertically"
  24354. })
  24355. })
  24356. }
  24357. }
  24358. ),
  24359. panCamera: function(e, i) {
  24360. function t(e) {
  24361. switch (r.removeAllListeners(w.AutoPanComplete),
  24362. r.removeAllListeners(w.AutoPanInterrupt),
  24363. r.removeAllListeners(w.AutoPanClamped),
  24364. e) {
  24365. case w.AutoPanInterrupt:
  24366. i({
  24367. success: !0,
  24368. message: "Camera panning interrupted."
  24369. });
  24370. break;
  24371. case w.AutoPanClamped:
  24372. if (r.autoPanPosition.x !== n.x || r.autoPanPosition.z !== n.z) {
  24373. if (Math.abs(this.player.position.x - r.autoPanPosition.x) < .01 && Math.abs(this.player.position.z - r.autoPanPosition.z) < .01)
  24374. return void i({
  24375. success: !1,
  24376. error: "Already at edge of current model bounds."
  24377. });
  24378. var t = "The view point is outside the bounds for the current model. ";
  24379. t += "The view point was clamped to " + o(r.target.x, r.target.z),
  24380. console.warn(t)
  24381. }
  24382. case w.AutoPanComplete:
  24383. i({
  24384. success: !0,
  24385. message: "Panned camera to position " + o(r.autoPanPosition.x, r.autoPanPosition.z)
  24386. })
  24387. }
  24388. }
  24389. if (this.player.mode !== I.DOLLHOUSE && this.player.mode !== I.FLOORPLAN)
  24390. return i({
  24391. success: !1,
  24392. error: "Camera panning is not available in the current mode: " + this.player.mode
  24393. });
  24394. var n = e.position
  24395. , r = this.player.control;
  24396. r.setAutoPanPosition(n.x, n.z),
  24397. r.autoPan = !0;
  24398. var o = function(e, t) {
  24399. return "(" + e.toFixed(2) + ", " + t.toFixed(2) + ")"
  24400. };
  24401. r.on(w.AutoPanComplete, t.bind(this, w.AutoPanComplete)),
  24402. r.on(w.AutoPanInterrupt, t.bind(this, w.AutoPanInterrupt)),
  24403. r.on(w.AutoPanClamped, t.bind(this, w.AutoPanClamped))
  24404. },
  24405. click: function(e, t) {
  24406. var i = e.x
  24407. , n = e.y;
  24408. !0 === e.percentage && (i = i / 100 * $("#player").width(),
  24409. n = n / 100 * $("#player").height()),
  24410. this.player.handleInputStart(i, n),
  24411. this.player.updateIntersect(),
  24412. this.player.handleInputEnd(i, n)
  24413. },
  24414. mouseOver: function(e, t) {
  24415. var i = e.x
  24416. , n = e.y;
  24417. !0 === e.percentage && (i = i / 100 * $("#player").width(),
  24418. n = n / 100 * $("#player").height()),
  24419. this.player.handleInputMove(i, n),
  24420. this.player.updateIntersect()
  24421. },
  24422. moveToMode: function(e, t) {
  24423. function i(e) {
  24424. t(e ? {
  24425. success: !1,
  24426. error: "Failed to load new mode: " + e
  24427. } : {
  24428. success: !0,
  24429. message: "Moved to new mode: " + n
  24430. })
  24431. }
  24432. var n = e.mode;
  24433. n === I.PANORAMA || n === I.DOLLHOUSE || n === I.FLOORPLAN ? this.director.changeMode(n).then(function() {
  24434. i()
  24435. }, function(e) {
  24436. i(e)
  24437. }) : t({
  24438. success: !1,
  24439. error: "Invalid mode selection"
  24440. })
  24441. }
  24442. }
  24443. }
  24444. ).call(this, "/js/sdk/automation.js")
  24445. }
  24446. , {
  24447. "../constants": 8,
  24448. "../enum/AlignmentType": 17,
  24449. "../enum/ControlEvents": 21,
  24450. "../enum/Direction": 22,
  24451. "../enum/GLCubeFaces": 25,
  24452. "../enum/Keys": 30,
  24453. "../enum/ModelManagerEvents": 33,
  24454. "../enum/PlayerEvents": 40,
  24455. "../enum/RenderLayers": 41,
  24456. "../enum/Vectors": 50,
  24457. "../enum/Viewmode": 51,
  24458. "../enum/WarpStyle": 52,
  24459. "../lib/jpeg_encoder": 94,
  24460. "../sdk/SdkEvents": 161,
  24461. "../settings": 166,
  24462. "../util/common": 185,
  24463. "../util/logger": 189,
  24464. "../util/math": 190,
  24465. "../util/panorama": 191,
  24466. "./ApiHost": 159,
  24467. "./PostMessageType": 160,
  24468. "./TransitionStyles": 162,
  24469. three: 217
  24470. }],
  24471. 165: [function(e, t, i) {
  24472. "use strict";
  24473. function n(e) {
  24474. this.sourceWindow = e,
  24475. this.targetWindow = null,
  24476. this.targetOrigin = null,
  24477. this.id = Math.floor(1e5 * Math.random()),
  24478. this.bindEvents()
  24479. }
  24480. var r = e("./PostMessageType")
  24481. , o = e("events").EventEmitter;
  24482. (n.prototype = Object.create(o.prototype)).bindEvents = function() {
  24483. this.sourceWindow.addEventListener("message", this.onPostmessageReceived.bind(this))
  24484. }
  24485. ,
  24486. n.prototype.setTarget = function(e, t) {
  24487. this.targetWindow = e,
  24488. this.targetOrigin = t
  24489. }
  24490. ,
  24491. n.prototype.onPostmessageReceived = function(e) {
  24492. var t = e.origin || e.originalEvent.origin
  24493. , i = e.source;
  24494. switch (e.data.type) {
  24495. case r.CONNECT:
  24496. break;
  24497. case r.RESPONSE:
  24498. if (this.id !== e.data.toId)
  24499. return;
  24500. default:
  24501. if (!this.validateMessageOrigin(t))
  24502. return
  24503. }
  24504. var n = e.data;
  24505. n.source = i,
  24506. n.origin = t,
  24507. n.timestamp = Date.now(),
  24508. this.emit(e.data.type, n)
  24509. }
  24510. ,
  24511. n.prototype.validateMessageOrigin = function(e) {
  24512. return "*" === this.targetOrigin || e === this.targetOrigin
  24513. }
  24514. ,
  24515. n.prototype.send = function(e) {
  24516. this.targetWindow && this.targetOrigin && (e.fromId = this.id,
  24517. this.targetWindow.postMessage(e, this.targetOrigin))
  24518. }
  24519. ,
  24520. t.exports = n
  24521. }
  24522. , {
  24523. "./PostMessageType": 160,
  24524. events: 202
  24525. }],
  24526. 166: [function(e, t, i) {
  24527. "use strict";
  24528. var n = e("three")
  24529. , r = e("./util/browser")
  24530. , o = e("./enum/Viewmode")
  24531. , a = e("./enum/VROption")
  24532. , s = e("./enum/Colors")
  24533. , l = e("./enum/WarpStyle")
  24534. , c = e("./util/easing")
  24535. , h = e("./util/common")
  24536. , u = e("./util/showcase")
  24537. , d = e("./constants")
  24538. , p = {
  24539. debug: !1,
  24540. version: "2.25.6-0-gd87e5b1",
  24541. languageTag: r.valueFromHash("lang", null),
  24542. pageTitle: "四维虚拟漫游",
  24543. authorizationHeader: u.getAuthorizationHeader(),
  24544. autoplay: r.valueFromHash("play", !1) || !r.inIframe(),
  24545. logLevel: r.valueFromHash("log", 2),
  24546. skyboxRadius: 2500,
  24547. modelBoundsPadding: 5,
  24548. showNeighbors: !1,
  24549. brand: r.valueFromHash("brand", !0),
  24550. showHighlights: r.valueFromHash("hhl", !0) && r.valueFromHash("hr", 1),
  24551. startHighlights: r.valueFromHash("hl", -1),
  24552. specialEdition: r.valueFromHash("bn", 0),
  24553. useWheel: r.valueFromHash("wh", !0),
  24554. crossOrigin: "anonymous",
  24555. fancierTransition: !1,
  24556. wireframe: !1,
  24557. skyboxWireframe: !1,
  24558. modelAlpha: 1,
  24559. highlightPanoSelection: !1,
  24560. showSweeps: !0,
  24561. showSkyboxes: !1,
  24562. showMesh: !0,
  24563. showFloors: !1,
  24564. showFloorDuration: 300,
  24565. showFloorDelay: 300,
  24566. hideFloorDuration: 300,
  24567. hideFloorDelay: 0,
  24568. reticuleOpacityTransitionTime: 250,
  24569. reticuleColor: window.MP_PREFETCHED_MODELDATA.mouseMarkerColor || s.newBlue,
  24570. markerOpacityTransitionTime: 500,
  24571. guiAnimationSpeed: 250,
  24572. highlightAnimationDuration: 500,
  24573. modelComponentLoadSpinnerDelay: 150,
  24574. captureErrors: !1,
  24575. maxMobileTextures: 6,
  24576. minimalMemoryMode: r.valueFromHash("m3", r.isMobile()),
  24577. startupFlyinDelay: 3e3,
  24578. dollhouseDefault: {
  24579. minDistance: 1,//15, //编辑页面给近一些
  24580. maxDistance: 50,
  24581. minPolarAngle: n.Math.degToRad(10),
  24582. maxPolarAngle: n.Math.degToRad(90)
  24583. },
  24584. hideReticuleTimeout: 1e3,
  24585. analytics: {
  24586. inactivityThreshold: 30,
  24587. sessionTrackingRate: .15,
  24588. maxTrackedErrors: 20,
  24589. sessionDurationPingFrequency: 10,
  24590. sessionDurationTimeout: 15
  24591. },
  24592. flydown: {
  24593. movementEasing: "easeInOutQuad",
  24594. movementDelay: .001,
  24595. rotationEasing: "easeInOutQuad",
  24596. rotationDelay: .5,
  24597. modelTextureDelay: .75,
  24598. skyboxDelay: .75
  24599. },
  24600. transition: {
  24601. flySpeed: .001,
  24602. flyTime: 750,
  24603. flytimeMaxDistanceThreshold: 5,
  24604. flytimeDistanceMultiplier: 150,
  24605. aimTime: 1500,
  24606. aimSlowFactor: 1.5,
  24607. blur: .8,
  24608. movementEasing: "easeInOutQuad",
  24609. blendEasing: "easeInOutQuad",
  24610. fastForwardFactor: 3
  24611. },
  24612. show360Views: {
  24613. enabled: !0,
  24614. transitionTime: 1e3
  24615. },
  24616. quickstart: {
  24617. enabled: 1 === r.valueFromHash("qust", 0) || 1 === r.valueFromHash("qs", 0),
  24618. animation: 1400,
  24619. showTextDelay: 500,
  24620. fadeOutDelay: 3e3,
  24621. fovChange: 10
  24622. },
  24623. appConfig: {
  24624. webvr_version: null,
  24625. segment_key: null,
  24626. embedly_key: null,
  24627. branch_key: null,
  24628. keen_write_key: null,
  24629. keen_project_id: null
  24630. },
  24631. vr: {
  24632. enabled: !0,
  24633. allowWebVR: !1,
  24634. option: r.valueFromHash("vr", a.CONTEXTUAL)
  24635. },
  24636. share: {
  24637. enabled: !r.valueFromHash("mls", 0) && r.valueFromHash("brand", !0)
  24638. },
  24639. input: {
  24640. longTapThreshold: 200,
  24641. moveToleranceNDC: .08,
  24642. touchMoveThreshold: 25
  24643. },
  24644. help: {
  24645. modalStayDuration: 600
  24646. },
  24647. immersive: {
  24648. timeToShowAgain: 1250,
  24649. uiStayDuration: 600
  24650. },
  24651. tourInteraction: {
  24652. disabled: "0" === r.valueFromHash("tourcta", null),
  24653. showPauseButton: 1e3,
  24654. showModal: 1500,
  24655. allowNextClick: 200,
  24656. largeModal: "1" === r.valueFromHash("tourcta", null),
  24657. smallModal: "2" === r.valueFromHash("tourcta", null)
  24658. },
  24659. labels: {
  24660. enabled: !1,
  24661. hideUntilStart: !0,
  24662. fadeInDuration: 250,
  24663. fadeInDelay: 250,
  24664. fadeOutDuration: 250,
  24665. fadeOutDelay: 0,
  24666. zoomHideThreshhold: {
  24667. mobile: r.isSmallScreen() ? .45 : .6,
  24668. desktop: 2
  24669. },
  24670. zoomTruncateThreshhold: {
  24671. mobile: r.isSmallScreen() ? .35 : .45,
  24672. desktop: .85
  24673. },
  24674. minLengthForTruncate: 16,
  24675. truncateLength: 12,
  24676. truncateSuffix: "..."
  24677. },
  24678. tags: {
  24679. enabled: r.valueFromHash("mt", 1),
  24680. startup: {
  24681. hideUntilStart: !0,
  24682. fadeInDuration: 500,
  24683. fadeInDelay: 100
  24684. },
  24685. visibility: {
  24686. anyDistance: !0,
  24687. visibleDistance: 8,
  24688. cameraClearance: .1,
  24689. alphaTestLevel: .05,
  24690. hideViaFloor: !0,
  24691. hideOffScreenDisc: !1,
  24692. hideOffScreenObject: !1
  24693. },
  24694. disc: {
  24695. opacity: 1,
  24696. disabledOpacity: .5,
  24697. scale: {
  24698. nearBound: 1.5,
  24699. farBound: 4.8,
  24700. linkFarBound: !1,
  24701. linkPercent: 40,
  24702. maxSize: 80,
  24703. minSize: 40,
  24704. baseViewportSize: 800,
  24705. responsiveness: 100
  24706. }
  24707. },
  24708. pole: {
  24709. enabled: !0,
  24710. height: .5,
  24711. width: 2,
  24712. opacity: .5,
  24713. color: "white"
  24714. },
  24715. navigate: {
  24716. nearestPano: !0,
  24717. lineOfSight: !0,
  24718. reactivate: !0,
  24719. aimAt: "disc",
  24720. tiltTolerance: 25,
  24721. rotateSpeedFactor: .6
  24722. }
  24723. },
  24724. path: {
  24725. color: window.MP_PREFETCHED_MODELDATA.floorMarkerColor || s.newBlue,
  24726. colorUp: s._desat(s.newBlue, .5),
  24727. colorDown: s._darken(s.newBlue, .35),
  24728. opacity: .5,
  24729. style: "ribbon",
  24730. height: .025,
  24731. ribbonWidth: .24,
  24732. outsideHeight: .5,
  24733. waypointRadius: .5,
  24734. waypointIndoorRadius: .24,
  24735. waypointPulse: 1e3,
  24736. typ: l.BLACK,
  24737. meshFree: r.valueFromHash("mf", 1),
  24738. mapGuides: r.valueFromHash("guides", !0),
  24739. fadeInTime: 400,
  24740. fadeOutTime: 300
  24741. },
  24742. warp: {
  24743. nearPanoDist: .1,
  24744. matchCam: !1,
  24745. blur: .33,
  24746. fastTime: 1500,
  24747. teleportTime: 1500,
  24748. outsideTime: 2e3,
  24749. lookAheadMax: .3,
  24750. lookAheadDist: 2.5,
  24751. softPushDist: .37,
  24752. softPushEnd: .3,
  24753. softBendAngle: 8,
  24754. softBendTilt: 4,
  24755. softBendEnd: .3,
  24756. doBurns: !0,
  24757. burnsAngle: 8,
  24758. minBurnsAngle: 35,
  24759. minDownAngle: -35,
  24760. maxTurnPerSec: 280,
  24761. maxAimPerSec: 35,
  24762. minRotation: 12,
  24763. maxAimRotation: 33.2,
  24764. turnFriction: .2,
  24765. flySpeed: .01,
  24766. minWarpTime: 1200,
  24767. warpInterruptionRedirectTime: 500,
  24768. tourStepDelay: r.valueFromHash("st", 0),
  24769. walkDelay: 0,
  24770. walkMaxDist: 50,
  24771. walkMinDist: .8,
  24772. walkSlideShowThreshhold: 3e3,
  24773. walkExtraPanosDistance: .4,
  24774. timePerMeter: 1200,
  24775. motionLeadTime: 5e3,
  24776. movementEasing: "easeInOutQuad",
  24777. blendEasing: "easeInOutQuad",
  24778. showBunny: !1,
  24779. loop: r.valueFromHash("lp", !1),
  24780. auto: r.valueFromHash("ts", -1),
  24781. eOrder: "YXZ",
  24782. stepFactor: .25,
  24783. brakeStrength: 2,
  24784. minBrakeAngle: .1,
  24785. maxBrakeAngle: 1.8,
  24786. climbEffort: 4
  24787. },
  24788. rotationFriction: .05,
  24789. rotationAccelerationInside: 4.5,
  24790. rotationAccelerationOutside: .15,
  24791. rotationAfterMoveMultiplier: 40,
  24792. rotationAfterMoveHistoryCount: 5,
  24793. panFriction: .09,
  24794. panAccelerationOutside: 60,
  24795. onload: r.valueFromHash("onload", o.PANORAMA),
  24796. zoomNearLimit: .1,
  24797. zoomFarLimit: 50,
  24798. navigation: {
  24799. panoScores: !1,
  24800. mouseDirection: !0,
  24801. filterStrictness: .75,
  24802. angleFactor: -30,
  24803. directionFactor: 10,
  24804. distanceFactor: -1,
  24805. optionalityFactor: 3
  24806. },
  24807. sdkInit: !1,
  24808. secretPanelWord: [38, 38, 40, 40, 37, 39, 37, 39, 66, 65],
  24809. console: r.valueFromHash("console", !1),
  24810. noMeshFloorPositionOffset: new n.Vector3(0,-1.2,0),
  24811. panoramaNeighbourMaxDistance: 5,
  24812. panoFloorClickRadius: .35,
  24813. showScreenshotLocations: !1,
  24814. showAxis: !1,
  24815. showNeighbourRaycasts: !1,
  24816. colorMarkerOnLoad: !1,
  24817. colorMarkerByFloor: !1,
  24818. tiling: {
  24819. panoPreRenderRepeatDelay: 2500,
  24820. panoPreRenderDelay: 500,
  24821. preRenderTourPanos: r.valueFromHash("tileprerender", 0),
  24822. tilingFlagNames: ["usetiles", "tiles"],
  24823. maxNavPanoQuality: r.valueFromHash("maxtileq", null),
  24824. maxZoomPanoQuality: r.valueFromHash("maxztileq", null),
  24825. overlayStyle: r.valueFromHash("tileoverlay", 0),
  24826. uploadIntervalDelay: r.valueFromHash("tileupdelay", 10),
  24827. initialIntervalDelay: r.valueFromHash("itiledelay", 0),
  24828. maxNonBaseUploadsPerFrame: r.valueFromHash("maxnbtpf", 2),
  24829. maxBaseUploadsPerFrame: r.valueFromHash("maxbtpf", 6),
  24830. customCompression: r.valueFromHash("tilecustcomp", 0),
  24831. mobileHighQualityOverride: 1,
  24832. allowUltraHighResolution: !0
  24833. },
  24834. zoom: {
  24835. enabled: !0,
  24836. forceOff: r.valueFromHash("nozoom", 0),
  24837. overridemax: r.valueFromHash("maxzoom", null),
  24838. overridemin: r.valueFromHash("minzoom", null),
  24839. max: d.highQualityMaxZoom,
  24840. min: 1,
  24841. transitionStyle: r.valueFromHash("zoomtrans", 1),
  24842. activationThreshold: 1.1,
  24843. restoreTime: 500
  24844. },
  24845. profiling: {
  24846. enabled: r.valueFromHash("mem", !1)
  24847. }
  24848. };
  24849. (p = h.deepExtend(p, d, {
  24850. insideFOV: r.valueFromHash("fov", d.insideFOV),
  24851. insideFOVMax: r.valueFromHash("fovmax", d.insideFOVMax),
  24852. panorama: {
  24853. transitionTime: 1e3,
  24854. modelAlpha: 0,
  24855. modelAlphaDelay: p.flydown.modelTextureDelay,
  24856. modelAlphaLength: 1,
  24857. skyboxOpacity: 1,
  24858. skyboxOpacityDelay: p.flydown.skyboxDelay,
  24859. skyboxOpacityLength: .9,
  24860. fovLength: 1,
  24861. fovDelay: 0,
  24862. cameraMatrixDuration: .8,
  24863. cameraMatrixDelay: 0,
  24864. cameraMatrixEase: c.easeInCubic,
  24865. reticuleOpacity: 1,
  24866. markerOpacity: .3,
  24867. markerOpacityOnHover: 1
  24868. },
  24869. dollhouse: {
  24870. transitionTime: 1e3,
  24871. modelAlpha: 1,
  24872. modelAlphaDelay: 0,
  24873. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  24874. skyboxOpacity: 0,
  24875. skyboxOpacityDelay: 0,
  24876. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  24877. fovLength: 1,
  24878. fovDelay: 0,
  24879. cameraMatrixDuration: .8,
  24880. cameraMatrixDelay: .3,
  24881. cameraMatrixEase: c.easeInCubic,
  24882. reticuleOpacity: 1,
  24883. markerOpacity: 0,
  24884. markerOpacityOnHover: 0
  24885. },
  24886. floorplan: {
  24887. transitionTime: 1e3,
  24888. modelAlpha: 1,
  24889. modelAlphaDelay: 0,
  24890. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  24891. skyboxOpacity: 0,
  24892. skyboxOpacityDelay: 0,
  24893. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  24894. fovLength: 1,
  24895. fovDelay: 0,
  24896. cameraMatrixDuration: .5,
  24897. cameraMatrixDelay: 0,
  24898. cameraMatrixEase: c.easeOutCubic,
  24899. reticuleOpacity: 1,
  24900. markerOpacity: 0,
  24901. markerOpacityOnHover: 0,
  24902. cameraHeight: 50
  24903. },
  24904. transitioning: {
  24905. reticuleOpacity: 0,
  24906. markerOpacity: .3,
  24907. markerOpacityOnHover: 1
  24908. },
  24909. "floorplan-dollhouse": {
  24910. rotationDelay: 0,
  24911. rotationDuration: 1
  24912. },
  24913. "floorplan-panorama": {
  24914. rotationDelay: .5,
  24915. rotationDuration: 1
  24916. },
  24917. "dollhouse-panorama": {
  24918. rotationDelay: .5,
  24919. rotationDuration: 1
  24920. },
  24921. "dollhouse-floorplan": {
  24922. rotationDelay: 0,
  24923. rotationDuration: 1,
  24924. cameraMatrixDuration: 1.05,
  24925. cameraMatrixDelay: .5
  24926. },
  24927. "panorama-dollhouse": {
  24928. rotationDelay: 0,
  24929. rotationDuration: .5
  24930. },
  24931. "panorama-floorplan": {
  24932. transitionTime: 1500,
  24933. rotationDelay: 0,
  24934. rotationDuration: .5
  24935. }
  24936. })).path.meshFree && (p.path.typ = l.WALK),
  24937. p.zoom.max = p.zoom.overridemax || p.zoom.max,
  24938. p.zoom.min = p.zoom.overridemin || p.zoom.min,
  24939. t.exports = p
  24940. }
  24941. , {
  24942. "./constants": 8,
  24943. "./enum/Colors": 19,
  24944. "./enum/VROption": 47,
  24945. "./enum/Viewmode": 51,
  24946. "./enum/WarpStyle": 52,
  24947. "./util/browser": 182,
  24948. "./util/common": 185,
  24949. "./util/easing": 186,
  24950. "./util/showcase": 193,
  24951. three: 217
  24952. }],
  24953. 167: [function(e, t, i) {
  24954. "use strict";
  24955. var n = e("three")
  24956. , r = e("./settings")
  24957. , 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"
  24958. , a = "precision highp float;\nprecision highp int;\n\nuniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n";
  24959. t.exports = {
  24960. basicTextured: {
  24961. uniforms: {
  24962. tDiffuse: {
  24963. type: "t",
  24964. value: null
  24965. },
  24966. alpha: {
  24967. type: "f",
  24968. value: 1
  24969. }
  24970. },
  24971. vertexShader: "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  24972. 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}"
  24973. },
  24974. copyCubeMap: {
  24975. uniforms: {
  24976. tDiffuse: {
  24977. type: "t",
  24978. value: null
  24979. },
  24980. alpha: {
  24981. type: "f",
  24982. value: 1
  24983. }
  24984. },
  24985. 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}",
  24986. 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}"
  24987. },
  24988. cube: {
  24989. uniforms: {
  24990. map: {
  24991. type: "t",
  24992. value: null
  24993. },
  24994. opacity: {
  24995. type: "f",
  24996. value: 1
  24997. }
  24998. },
  24999. vertexShader: o + "varying vec3 vWorldPosition;\n\nvoid main() {\n vWorldPosition = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n",
  25000. 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"
  25001. },
  25002. model: {
  25003. uniforms: {
  25004. map: {
  25005. type: "t",
  25006. value: null
  25007. },
  25008. modelAlpha: {
  25009. type: "f",
  25010. value: r.modelAlpha
  25011. },
  25012. opacity: {
  25013. type: "f",
  25014. value: 1
  25015. },
  25016. progress: {
  25017. type: "f",
  25018. value: 0
  25019. },
  25020. blackout: {
  25021. type: "i",
  25022. value: 0
  25023. },
  25024. pano0Map: {
  25025. type: "t",
  25026. value: null
  25027. },
  25028. pano0Position: {
  25029. type: "v3",
  25030. value: new n.Vector3
  25031. },
  25032. pano0Matrix: {
  25033. type: "m4",
  25034. value: new n.Matrix4
  25035. },
  25036. pano1Map: {
  25037. type: "t",
  25038. value: null
  25039. },
  25040. pano1Position: {
  25041. type: "v3",
  25042. value: new n.Vector3
  25043. },
  25044. pano1Matrix: {
  25045. type: "m4",
  25046. value: new n.Matrix4
  25047. }
  25048. },
  25049. 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",
  25050. 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"
  25051. },
  25052. hot: {
  25053. uniforms: {
  25054. color: {
  25055. type: "c",
  25056. value: new n.Color(16720384)
  25057. },
  25058. opac: {
  25059. type: "f",
  25060. value: 0
  25061. },
  25062. texture1: {
  25063. type: "t",
  25064. value: null
  25065. },
  25066. texture2: {
  25067. type: "t",
  25068. value: null
  25069. }
  25070. },
  25071. vertexShader: "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv ;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  25072. fragmentShader: "varying vec3 vNormal;\n\nvarying vec2 vUv;\n\nuniform float opac;\n\nuniform vec3 color;\n\nuniform sampler2D texture1;\n\nuniform sampler2D texture2;\n\nvoid main() {\n\nvec4 tcolor1 = texture2D( texture1, vUv );\n\nvec4 tcolor2 = texture2D( texture2, vUv );\n\ngl_FragColor = mix(tcolor1,tcolor2 ,opac) + tcolor2*0.2; }\n"
  25073. },
  25074. modelOutside: {
  25075. uniforms: {
  25076. map: {
  25077. type: "t",
  25078. value: null
  25079. },
  25080. opacity: {
  25081. type: "f",
  25082. value: 1
  25083. }
  25084. },
  25085. vertexShader: o + "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  25086. 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"
  25087. },
  25088. ribbon: {
  25089. uniforms: {
  25090. map: {
  25091. type: "t",
  25092. value: null
  25093. },
  25094. opacity: {
  25095. type: "f",
  25096. value: 1
  25097. },
  25098. color: {
  25099. type: "c",
  25100. value: new n.Color(r.path.color)
  25101. }
  25102. },
  25103. 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",
  25104. 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"
  25105. },
  25106. waypoint: {
  25107. uniforms: {
  25108. map: {
  25109. type: "t",
  25110. value: null
  25111. },
  25112. opacity: {
  25113. type: "f",
  25114. value: 1
  25115. },
  25116. pulse: {
  25117. type: "f",
  25118. value: 1
  25119. },
  25120. nearFade: {
  25121. type: "v2",
  25122. value: new n.Vector2(2 * r.insideNear,2 * r.path.waypointIndoorRadius)
  25123. },
  25124. color: {
  25125. type: "c",
  25126. value: new n.Color(r.reticuleColor)
  25127. }
  25128. },
  25129. 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",
  25130. 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"
  25131. },
  25132. modelDebug: {
  25133. uniforms: {
  25134. map: {
  25135. type: "t",
  25136. value: null
  25137. },
  25138. modelAlpha: {
  25139. type: "f",
  25140. value: r.modelAlpha
  25141. },
  25142. depthmapRatio: {
  25143. type: "f",
  25144. value: 0
  25145. },
  25146. opacity: {
  25147. type: "f",
  25148. value: 1
  25149. },
  25150. progress: {
  25151. type: "f",
  25152. value: 0
  25153. },
  25154. considerOcclusion: {
  25155. type: "i",
  25156. value: r.fancierTransition
  25157. },
  25158. highlightPanoSelection: {
  25159. type: "i",
  25160. value: 0
  25161. },
  25162. useThirdPano: {
  25163. type: "i",
  25164. value: r.useThirdPano
  25165. },
  25166. pano0Map: {
  25167. type: "t",
  25168. value: null
  25169. },
  25170. pano0Depth: {
  25171. type: "t",
  25172. value: null
  25173. },
  25174. pano0Position: {
  25175. type: "v3",
  25176. value: new n.Vector3
  25177. },
  25178. pano0Matrix: {
  25179. type: "m4",
  25180. value: new n.Matrix4
  25181. },
  25182. pano0Weight: {
  25183. type: "f",
  25184. value: r.transition.pano0Weight
  25185. },
  25186. pano1Map: {
  25187. type: "t",
  25188. value: null
  25189. },
  25190. pano1Depth: {
  25191. type: "t",
  25192. value: null
  25193. },
  25194. pano1Position: {
  25195. type: "v3",
  25196. value: new n.Vector3
  25197. },
  25198. pano1Matrix: {
  25199. type: "m4",
  25200. value: new n.Matrix4
  25201. },
  25202. pano1Weight: {
  25203. type: "f",
  25204. value: r.transition.pano1Weight
  25205. },
  25206. pano2Map: {
  25207. type: "t",
  25208. value: null
  25209. },
  25210. pano2Depth: {
  25211. type: "t",
  25212. value: null
  25213. },
  25214. pano2Position: {
  25215. type: "v3",
  25216. value: new n.Vector3
  25217. },
  25218. pano2Matrix: {
  25219. type: "m4",
  25220. value: new n.Matrix4
  25221. },
  25222. pano2Weight: {
  25223. type: "f",
  25224. value: r.transition.pano2Weight
  25225. }
  25226. },
  25227. 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",
  25228. 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"
  25229. },
  25230. customDepth: {
  25231. uniforms: {
  25232. panoPosition: {
  25233. type: "v3",
  25234. value: new n.Vector3
  25235. }
  25236. },
  25237. 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",
  25238. 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"
  25239. },
  25240. skysphere: {
  25241. uniforms: {
  25242. radius: {
  25243. type: "f",
  25244. value: 0
  25245. }
  25246. },
  25247. 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",
  25248. 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"
  25249. },
  25250. tagDisc: {
  25251. uniforms: {
  25252. opacity: {
  25253. type: "f",
  25254. value: 0
  25255. },
  25256. color: {
  25257. type: "c",
  25258. value: new n.Color
  25259. },
  25260. bg: {
  25261. type: "t",
  25262. value: null
  25263. },
  25264. mask: {
  25265. type: "t",
  25266. value: null
  25267. }
  25268. },
  25269. vertexShader: o + "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  25270. 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"
  25271. }
  25272. }
  25273. window.shaders = t.exports;
  25274. }
  25275. , {
  25276. "./settings": 166,
  25277. three: 217
  25278. }],
  25279. 168: [function(E, _, e) {
  25280. (function(e) {
  25281. "use strict";
  25282. var t = E("three")
  25283. , i = (E("url"),
  25284. E("./util/ajax"))
  25285. , n = E("./settings")
  25286. , r = E("./util/logger")
  25287. , o = E("./util/math")
  25288. , a = E("./util/showcase")
  25289. , s = E("./objects/Panorama")
  25290. , l = new r(e)
  25291. , c = E("./model/Model")
  25292. , h = E("./shaders")
  25293. , u = E("./util/transitions")
  25294. , d = E("./objects/Chunk")
  25295. , p = E("./objects/Reticule")
  25296. , f = E("./objects/Skybox")
  25297. , g = E("./objects/Floor")
  25298. , m = E("./cameras/DollhouseCamera")
  25299. , v = E("./cameras/FloorplanCamera")
  25300. , y = E("./cameras/PanoramaCamera")
  25301. , A = E("./controls/DollhouseControls")
  25302. , C = E("./controls/FloorplanControls")
  25303. , I = E("./controls/PanoramaControls");
  25304. t.ImageUtils.crossOrigin = n.crossOrigin,
  25305. _.exports = {
  25306. shaders: h,
  25307. transitions: u,
  25308. Model: c,
  25309. Chunk: d,
  25310. Floor: g,
  25311. Skybox: f,
  25312. Reticule: p,
  25313. Panorama: s,
  25314. DollhouseCamera: m,
  25315. FloorplanCamera: v,
  25316. PanoramaCamera: y,
  25317. DollhouseControls: A,
  25318. FloorplanControls: C,
  25319. PanoramaControls: I,
  25320. getModel: function(e) {
  25321. if (!e.url)
  25322. throw 'getModel(): missing parameter "url"';
  25323. e.autoload = void 0 === e.autoload || e.autoload;
  25324. var t = a.parseSidUrl(e.url);
  25325. e.urlBase = t.urlBase,
  25326. e.urlModel = t.urlModel,
  25327. e.urlFiles = t.urlFiles;
  25328. var i = this._getPlatformError();
  25329. return i ? $.Deferred().reject(i).promise() : (this.options = e,
  25330. this._loadModel().then(this._buildModel.bind(this)))
  25331. },
  25332. _getPlatformError: function() {
  25333. 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"
  25334. },
  25335. _loadModel: function() {
  25336. return i.get(this.options.urlModel, {
  25337. responseType: "json",
  25338. prefetchFrom: "model",
  25339. auth: a.getAuthorizationHeader()
  25340. }).then(null, function() {
  25341. return l.warn("Model loading failed at initial metadata load"),
  25342. "loading-failed"
  25343. })
  25344. },
  25345. _buildModel: function(e) {
  25346. e = a.normalizeModeldata(e, o);
  25347. var t = new c(this.options,e);
  25348. return this.options.autoload ? t.load(!0) : $.when(t)
  25349. }
  25350. }
  25351. }
  25352. ).call(this, "/js/showcase.js")
  25353. }
  25354. , {
  25355. "./cameras/DollhouseCamera": 5,
  25356. "./cameras/FloorplanCamera": 6,
  25357. "./cameras/PanoramaCamera": 7,
  25358. "./controls/DollhouseControls": 10,
  25359. "./controls/FloorplanControls": 11,
  25360. "./controls/PanoramaControls": 13,
  25361. "./model/Model": 139,
  25362. "./objects/Chunk": 144,
  25363. "./objects/Floor": 146,
  25364. "./objects/Panorama": 148,
  25365. "./objects/Reticule": 149,
  25366. "./objects/Skybox": 152,
  25367. "./settings": 166,
  25368. "./shaders": 167,
  25369. "./util/ajax": 181,
  25370. "./util/logger": 189,
  25371. "./util/math": 190,
  25372. "./util/showcase": 193,
  25373. "./util/transitions": 195,
  25374. three: 217,
  25375. url: 208
  25376. }],
  25377. 169: [function(e, t, i) {
  25378. "use strict";
  25379. function l(e) {
  25380. var t = {
  25381. renderTarget: null,
  25382. inUse: !1,
  25383. size: -1,
  25384. pano: null
  25385. };
  25386. return t.inUse = !0,
  25387. t.size = e,
  25388. function(e) {
  25389. O.push(e)
  25390. }(t),
  25391. t
  25392. }
  25393. function c(e) {
  25394. for (var t = 0; t < O.length; t++) {
  25395. var i = O[t];
  25396. if (i.renderTarget === e)
  25397. return !(i.inUse = !1)
  25398. }
  25399. return !1
  25400. }
  25401. function n() {
  25402. this.tileDirectory = {},
  25403. this.activeRenderTargetDescriptors = {},
  25404. this.activePanos = [],
  25405. this.panoLODDescriptors = {},
  25406. this.panoDescriptors = {},
  25407. this.tileTrees = {},
  25408. this.sceneRenderer = null,
  25409. this.tileDownloader = null,
  25410. this.forceQueue = [],
  25411. this.uploadQueues = {},
  25412. this.uploadInterval = null,
  25413. this.uploadIntervalCancelled = !1,
  25414. this.usingTileOverlay = !1,
  25415. this.overlayTilesLoaded = !1,
  25416. this.overlayTileBase = null,
  25417. this.overlayTilesBasic = {},
  25418. this.overlayTilesEnhanced = {},
  25419. this.zoomRenderTarget = null,
  25420. this.zoomPano = null,
  25421. this.zoomingActive = !1,
  25422. this.zoomPanoId = null,
  25423. this.zoomPanoRenderingDisabled = !1,
  25424. this.direction = new _.Vector3,
  25425. this.initTime = -1,
  25426. this.maxBaseUploadsPerFrame = R,
  25427. this.maxNonBaseUploadsPerFrame = M
  25428. }
  25429. var I, E, r, o, a, h, s, _ = e("three"), u = e("../exception/BasicException"), d = e("../settings"), p = e("../enum/PanoSizeClass"), b = (e("../objects/Panorama"),
  25430. e("../enum/PanoRendererEvents")), f = e("../enum/SceneRendererEvents"), g = e("../enum/TileDownloaderEvents"), m = e("../enum/Vectors"), v = (e("../enum/GLCubeFaces"),
  25431. e("../objects/Panorama"),
  25432. e("./TileTree")), y = (e("./TileDownloader"),
  25433. e("./TilePrioritizer")), A = e("./TileUtils"), C = (p = e("../enum/PanoSizeClass"),
  25434. e("../util/browser"),
  25435. e("../util/panorama")), w = e("events").EventEmitter, T = !1, x = d.tiling.uploadIntervalDelay, S = d.tiling.initialIntervalDelay, M = d.tiling.maxNonBaseUploadsPerFrame, R = d.tiling.maxBaseUploadsPerFrame, P = {
  25436. Base: 0,
  25437. Remaining: 1
  25438. }, O = [];
  25439. function L(e) {
  25440. var t = e.shift();
  25441. return t.uploadQueued = !1,
  25442. t
  25443. }
  25444. (n.prototype = Object.create(w.prototype)).init = function(e, t, i) {
  25445. this.sceneRenderer = e,
  25446. this.tileDownloader = t,
  25447. this.qualityManager = i,
  25448. this.bindEvents(),
  25449. this.sceneRenderer.on(f.ContextCreated, this.loadOverlayTiles.bind(this)),
  25450. this.initTime = performance.now()
  25451. }
  25452. ,
  25453. n.prototype.getActivePanoTextures = function(e) {
  25454. e = e || [];
  25455. for (var t = 0; t < O.length; t++) {
  25456. var i = O[t];
  25457. i.renderTarget && i.renderTarget.texture && e.push(i.renderTarget.texture)
  25458. }
  25459. }
  25460. ,
  25461. n.prototype.hasQueuedTiles = function() {
  25462. var e = this.peekNextFromUploadQueue();
  25463. return null != e
  25464. }
  25465. ,
  25466. n.prototype.getActiveRenderTargetDescriptor = function(e) {
  25467. return this.activeRenderTargetDescriptors[e]
  25468. }
  25469. ,
  25470. n.prototype.setActiveRenderTargetDescriptor = function(e, t) {
  25471. this.activeRenderTargetDescriptors[e] = t
  25472. }
  25473. ,
  25474. n.prototype.loadOverlayTiles = function() {
  25475. if (0 !== d.tiling.overlayStyle) {
  25476. var n = 0
  25477. , e = function(e, t, i) {
  25478. e = t ? e[t] = this.sceneRenderer.initSizedTexture2D(A.TILE_SIZE, _.ClampToEdgeWrapping) : this.overlayTileBase = this.sceneRenderer.initSizedTexture2D(A.TILE_SIZE, _.ClampToEdgeWrapping),
  25479. this.sceneRenderer.uploadTexture2D(i, e, 0, 0, A.TILE_SIZE, A.TILE_SIZE),
  25480. ++n === r.length && (this.overlayTilesLoaded = !0)
  25481. }
  25482. .bind(this)
  25483. , r = [["images/outlineBase.png", e.bind(this, this.overlayTileBase, null)], ["images/outlineBasic512.png", e.bind(this, this.overlayTilesBasic, 256)], ["images/outlineBasic512.png", e.bind(this, this.overlayTilesBasic, 512)], ["images/outlineBasic1024.png", e.bind(this, this.overlayTilesBasic, 1024)], ["images/outlineBasic2048.png", e.bind(this, this.overlayTilesBasic, 2048)], ["images/outlineBasic4096.png", e.bind(this, this.overlayTilesBasic, 4096)], ["images/outlineEnhanced512.png", e.bind(this, this.overlayTilesEnhanced, 256)], ["images/outlineEnhanced512.png", e.bind(this, this.overlayTilesEnhanced, 512)], ["images/outlineEnhanced1024.png", e.bind(this, this.overlayTilesEnhanced, 1024)], ["images/outlineEnhanced2048.png", e.bind(this, this.overlayTilesEnhanced, 2048)], ["images/outlineEnhanced4096.png", e.bind(this, this.overlayTilesEnhanced, 4096)]];
  25484. r.forEach(function(e) {
  25485. this.tileDownloader.loadImage(e[0], 0, e[1])
  25486. }
  25487. .bind(this)),
  25488. this.usingTileOverlay = !0
  25489. } else
  25490. this.usingTileOverlay = !1
  25491. }
  25492. ,
  25493. n.prototype.bindEvents = function() {
  25494. this.tileDownloader.on(g.TileDownloadSuccess, this.onTileDownloaded.bind(this))
  25495. }
  25496. ,
  25497. n.prototype.setupZoomRenderTarget = function() {
  25498. if (this.qualityManager.getMaxZoomPanoSize() >= this.qualityManager.getMaxNavPanoSize()) {
  25499. if (this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize())
  25500. return;
  25501. var e = this.zoomRenderTarget;
  25502. if (this.zoomRenderTarget = this.initTiledPano(this.qualityManager.getMaxZoomPanoSize(), !1),
  25503. e) {
  25504. var t = e.width
  25505. , i = this.zoomRenderTarget.width;
  25506. this.sceneRenderer.copyCubeMap(e.texture, this.zoomRenderTarget, t, t, i, i),
  25507. e.texture.dispose(),
  25508. e.texture.loaded = !1,
  25509. e.texture.version = 0,
  25510. this.sceneRenderer.deallocateCubeTexture(e.texture),
  25511. e.texture = null
  25512. }
  25513. this.zoomPanoRenderingDisabled = !1
  25514. } else
  25515. this.zoomPanoRenderingDisabled = !0
  25516. }
  25517. ,
  25518. n.prototype.enableUltraHighQualityMode = function(t) {
  25519. if (!this.qualityManager.ultraHighQualityModeEnabled()) {
  25520. var e = this.qualityManager.getPanoSize(p.ULTRAHIGH);
  25521. this.tileDownloader.testDownload(e, A.TILE_SIZE, function(e) {
  25522. e && (this.qualityManager.enableUltraHighQualityMode(),
  25523. this.setupZoomRenderTarget(),
  25524. t())
  25525. }
  25526. .bind(this))
  25527. }
  25528. }
  25529. ,
  25530. n.prototype.activateTiledPano = function(e, t, i) {
  25531. i && this.clearAllQueuedUploads();
  25532. for (var n = 0; n < A.FACES_PER_PANO; n++)
  25533. this.initTileTree(e.id, n, this.qualityManager.getMaxPossiblePanoSize());
  25534. this.linkAllTilesAndNodes(e);
  25535. var r = this.getActiveRenderTargetDescriptor(e.id)
  25536. , o = t;
  25537. if (o > this.qualityManager.getMaxNavPanoSize() && (o = this.qualityManager.getMaxNavPanoSize()),
  25538. !r || o !== r.size) {
  25539. if (r && c(r.renderTarget),
  25540. !(r = function(e) {
  25541. for (var t = 0; t < O.length; t++) {
  25542. var i = O[t];
  25543. if (!i.inUse && i.size === e)
  25544. return i.inUse = !0,
  25545. i
  25546. }
  25547. return null
  25548. }(o))) {
  25549. var a = this.initTiledPano(o, !1);
  25550. (r = l(a.width)).renderTarget = a
  25551. }
  25552. r.pano = e,
  25553. this.resetPanoDescriptor(e.id),
  25554. this.resetPanoLODDescriptors(e.id),
  25555. this.resetRenderStatus(e.id, !0, !0)
  25556. }
  25557. this.setActiveRenderTargetDescriptor(e.id, r);
  25558. var s = i ? 0 : 1;
  25559. return this.updateActivePanos(e, s),
  25560. r.renderTarget
  25561. }
  25562. ,
  25563. n.prototype.deactivateTiledPano = function(e) {
  25564. var t = this.getActiveRenderTargetDescriptor(e.id);
  25565. this.isRenderTargetDescriptorValid(t) && c(t.renderTarget),
  25566. this.setActiveRenderTargetDescriptor(e.id, null);
  25567. var i = this.getUploadQueueForPano(e.id);
  25568. this.clearUploadQueue(i),
  25569. this.updateActivePanos()
  25570. }
  25571. ,
  25572. n.prototype.updateActivePanos = (s = [],
  25573. function(e, t) {
  25574. for (var i = s.length = 0; i < this.activePanos.length; i++) {
  25575. e && s.length === t && s.push(e);
  25576. var n = this.activePanos[i]
  25577. , r = this.getActiveRenderTargetDescriptor(n.id);
  25578. e && n.id === e.id || !this.isRenderTargetDescriptorValid(r) || s.push(n)
  25579. }
  25580. e && t >= s.length && s.push(e),
  25581. this.activePanos.length = 0,
  25582. this.activePanos.push.apply(this.activePanos, s)
  25583. }
  25584. ),
  25585. n.prototype.getActivePanoCount = function() {
  25586. return this.activePanos.length
  25587. }
  25588. ,
  25589. n.prototype.resetRenderStatus = function(e, r, o, t) {
  25590. var i = null;
  25591. t && (i = v.getLevelCountForSize(A.TILE_SIZE, t) + 1);
  25592. for (var n = function(e, t, i, n) {
  25593. o && (t.tile.zoomUploaded = !1),
  25594. r && (t.tile.uploaded = !1)
  25595. }, a = 0; a < A.FACES_PER_PANO; a++) {
  25596. this.getTileTree(e, a).breadthFirst({
  25597. callback: n.bind(this, a),
  25598. minLevel: i
  25599. })
  25600. }
  25601. }
  25602. ,
  25603. n.prototype.copyBaseRenderStatusToZoomed = function(e) {
  25604. for (var t = v.getLevelCountForSize(A.TILE_SIZE, this.qualityManager.getMaxNavPanoSize()), i = function(e, t, i, n) {
  25605. t.tile.zoomUploaded = t.tile.uploaded,
  25606. t.zoomCovered = t.covered
  25607. }, n = 0; n < A.FACES_PER_PANO; n++) {
  25608. this.getTileTree(e, n).breadthFirst({
  25609. callback: i.bind(this, n),
  25610. maxLevel: t
  25611. })
  25612. }
  25613. }
  25614. ,
  25615. n.prototype.renderPanoTiles = (h = [],
  25616. function(e, t, i, n) {
  25617. this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize() || this.zoomPanoRenderingDisabled || this.setupZoomRenderTarget(),
  25618. t = t || this.direction || m.FORWARD;
  25619. var r = this.getActiveRenderTargetDescriptor(e);
  25620. if (!this.isRenderTargetDescriptorValid(r))
  25621. throw new u("PanoRenderer.renderPanoTiles() -> Cannot render to a pano that is not activated.");
  25622. for (var o = 0; o < A.FACES_PER_PANO; o++) {
  25623. var a = this.getTileTree(e, o);
  25624. h.length = 0,
  25625. a.breadthFirst({
  25626. saveVisited: h
  25627. });
  25628. for (var s = 0; s < h.length; s++) {
  25629. var l = h[s];
  25630. this.queueTileUpload(l.tile, !1, n || 0 === s && i)
  25631. }
  25632. }
  25633. this.updateDirection(t)
  25634. }
  25635. ),
  25636. n.prototype.isRenderTargetDescriptorValid = function(e) {
  25637. return e && e.renderTarget
  25638. }
  25639. ,
  25640. n.prototype.isPanoActive = function(e) {
  25641. var t = this.getActiveRenderTargetDescriptor(e);
  25642. return this.isRenderTargetDescriptorValid(t)
  25643. }
  25644. ,
  25645. n.prototype.isPanoZoomed = function(e) {
  25646. return this.zoomingActive && this.zoomPanoId === e
  25647. }
  25648. ,
  25649. n.prototype.initTileTree = function(e, t, i) {
  25650. var n = this.tileTrees[e];
  25651. n || (n = [],
  25652. this.tileTrees[e] = n);
  25653. var r = n[t];
  25654. if (!r) {
  25655. var o = v.getLevelCountForSize(A.TILE_SIZE, i);
  25656. r = new v(A.TILE_SIZE,o),
  25657. n[t] = r
  25658. }
  25659. }
  25660. ,
  25661. n.prototype.getTileTree = function(e, t) {
  25662. var i = this.tileTrees[e];
  25663. if (!i)
  25664. throw new u("PanoRenderer.getTileTree() -> Tree array not yet initialized!");
  25665. var n = i[t];
  25666. if (!n)
  25667. throw new u("PanoRenderer.getTileTree() -> Tree not yet initialized!");
  25668. return n
  25669. }
  25670. ,
  25671. n.prototype.initTiledPano = function(e, t) {
  25672. var i = this.sceneRenderer.renderer
  25673. , n = (i.context,
  25674. new _.WebGLRenderTargetCube(e,e,{
  25675. stencilBuffer: !1
  25676. }))
  25677. , r = new _.CubeTexture([]);
  25678. (n.texture = r).image = [null, null, null, null, null, null],
  25679. r.flipY = !0,
  25680. t ? (r.generateMipmaps = !0,
  25681. r.magFilter = _.LinearFilter,
  25682. r.minFilter = _.LinearMipMapLinearFilter) : (r.generateMipmaps = !1,
  25683. r.magFilter = _.LinearFilter,
  25684. r.minFilter = _.LinearFilter),
  25685. r.format = _.RGBAFormat,
  25686. i.setRenderTarget(n),
  25687. i.setRenderTarget(null);
  25688. var o = i.properties.get(r);
  25689. return o.__image__webglTextureCube = o.__webglTexture,
  25690. n
  25691. }
  25692. ,
  25693. n.prototype.getUploadQueueForPano = function(e) {
  25694. var t = this.uploadQueues[e];
  25695. return t || (t = [],
  25696. this.uploadQueues[e] = t),
  25697. t
  25698. }
  25699. ,
  25700. n.prototype.isTileUploaded = function(e) {
  25701. return this.isPanoZoomed(e.panoId) ? e.zoomUploaded : e.uploaded
  25702. }
  25703. ,
  25704. n.prototype.setUploaded = function(e, t) {
  25705. this.isPanoZoomed(e.panoId) ? e.zoomUploaded = t : e.uploaded = t
  25706. }
  25707. ,
  25708. n.prototype.queueTileUpload = function(e, t, i) {
  25709. var n = this.getActiveRenderTargetDescriptor(e.panoId);
  25710. if (this.isRenderTargetDescriptorValid(n) && e.downloaded && !this.isTileUploaded(e) && (!e.uploadQueued || i) && (!(e.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive)) {
  25711. var r = this.getUploadQueueForPano(e.panoId);
  25712. 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),
  25713. e.uploadQueued = !0,
  25714. this.uploadInterval || this.uploadIntervalCancelled || this.refreshUploadInterval(0))
  25715. }
  25716. }
  25717. ,
  25718. n.prototype.shoulPushToFrontOfQueue = function(e) {
  25719. return 0 === v.getLevelCountForSize(A.TILE_SIZE, e.panoSize)
  25720. }
  25721. ,
  25722. n.prototype.getTopUploadQueue = function() {
  25723. for (var e = null, t = null, i = P.Base; i <= P.Remaining; i++)
  25724. for (var n = 0; n < this.activePanos.length; n++)
  25725. if (e = this.activePanos[n],
  25726. 0 < (t = this.getUploadQueueForPano(e.id)).length)
  25727. switch (i) {
  25728. case P.Base:
  25729. if (0 === t[0].level)
  25730. return t;
  25731. break;
  25732. case P.Remaining:
  25733. return t
  25734. }
  25735. return null
  25736. }
  25737. ,
  25738. n.prototype.getNextFromUploadQueue = function() {
  25739. if (0 < this.forceQueue.length)
  25740. return L(this.forceQueue);
  25741. var e = this.getTopUploadQueue();
  25742. return e && 0 < e.length ? L(e) : null
  25743. }
  25744. ,
  25745. n.prototype.peekNextFromUploadQueue = function() {
  25746. if (0 < this.forceQueue.length)
  25747. return this.forceQueue[0];
  25748. var e = this.getTopUploadQueue();
  25749. return e && 0 < e.length ? e[0] : null
  25750. }
  25751. ,
  25752. n.prototype.clearAllQueuedUploads = function() {
  25753. this.clearAllUploadQueues(null, 0)
  25754. }
  25755. ,
  25756. n.prototype.clearAllQueuedUploadsForPano = function(e) {
  25757. this.clearAllUploadQueues(e, 0)
  25758. }
  25759. ,
  25760. n.prototype.clearAllUploadQueues = function(e, t) {
  25761. if (e)
  25762. this.clearUploadQueue(this.getUploadQueueForPano(e), t),
  25763. this.clearUploadQueue(this.forceQueue, t, e);
  25764. else {
  25765. for (var i = 0; i < this.activePanos.length; i++) {
  25766. var n = this.activePanos[i];
  25767. this.clearUploadQueue(this.getUploadQueueForPano(n.id), t)
  25768. }
  25769. this.clearUploadQueue(this.forceQueue, t)
  25770. }
  25771. }
  25772. ,
  25773. n.prototype.clearUploadQueue = function(e, t, i) {
  25774. null != t || (t = 0);
  25775. for (var n = 0; n < e.length; ) {
  25776. var r = e[n];
  25777. (!i || i && i === r.tile.panoId) && r.level >= t ? (r.uploadQueued = !1,
  25778. e.splice(n, 1)) : n++
  25779. }
  25780. }
  25781. ,
  25782. n.prototype.refreshUploadInterval = (a = null,
  25783. function(e) {
  25784. this.uploadIntervalCancelled || (a = a || function() {
  25785. this.uploadIntervalCancelled || (this.overlayTilesLoaded || !this.usingTileOverlay ? (T = !0,
  25786. this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  25787. this.peekNextFromUploadQueue() ? this.refreshUploadInterval(x) : this.uploadInterval = null) : this.refreshUploadInterval(this.uploadIntervalDelay))
  25788. }
  25789. .bind(this),
  25790. null != e || (e = x),
  25791. T || (e = S),
  25792. this.uploadInterval = window.setTimeout(a, e),
  25793. this.uploadIntervalDelay = e)
  25794. }
  25795. ),
  25796. n.prototype.update = (r = performance.now(),
  25797. o = 0,
  25798. function() {
  25799. this.uploadIntervalCancelled = !0,
  25800. window.clearTimeout(this.uploadInterval),
  25801. this.uploadInterval = null;
  25802. var e = performance.now() - r;
  25803. !(x < e || 0 === o) || !this.overlayTilesLoaded && this.usingTileOverlay || (this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  25804. r = performance.now()),
  25805. o++
  25806. }
  25807. ),
  25808. n.prototype.updateUploadQueue = function(e, t) {
  25809. e = e || 1;
  25810. for (var i = 0, n = 0; !(t <= n || e <= i); ) {
  25811. var r = this.getNextFromUploadQueue();
  25812. if (!r)
  25813. break;
  25814. if (0 !== r.level ? i++ : n++,
  25815. !(r.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive) {
  25816. var o = this.getActiveRenderTargetDescriptor(r.panoId);
  25817. this.isRenderTargetDescriptorValid(o) && this.uploadTile(r, r.forceUpload)
  25818. }
  25819. }
  25820. }
  25821. ,
  25822. n.prototype.updateDirection = function(e) {
  25823. if (e = e || this.direction) {
  25824. this.direction = e;
  25825. for (var t = 0; t < this.activePanos.length; t++) {
  25826. var i = this.activePanos[t]
  25827. , n = this.getUploadQueueForPano(i.id);
  25828. y.sortPanoTiles(n, i, this.direction)
  25829. }
  25830. }
  25831. }
  25832. ,
  25833. n.prototype.uploadTile = (I = {},
  25834. new _.Vector4,
  25835. E = d.tiling.overlayStyle,
  25836. function(e, t) {
  25837. var i = e.panoId
  25838. , n = e.image
  25839. , r = e.tileSize
  25840. , o = e.panoSize
  25841. , a = e.tileIndex
  25842. , s = (e.faceTileIndex,
  25843. e.totalTiles)
  25844. , l = (e.face,
  25845. e.tileX)
  25846. , c = e.tileY
  25847. , h = !0
  25848. , u = !1
  25849. , d = (this.getPanoDescriptor(i),
  25850. this.getPanoLODDescriptor(i, o))
  25851. , p = this.getActiveRenderTargetDescriptor(i)
  25852. , f = p.renderTarget
  25853. , g = p.size;
  25854. if (this.isPanoZoomed(i) && (f = this.zoomRenderTarget,
  25855. g = this.qualityManager.getMaxZoomPanoSize()),
  25856. this.isRenderTargetDescriptorValid(p) || (u = h = !1),
  25857. t || (this.anyUploaded(e.node) && (u = !(h = !1)),
  25858. this.isTileUploaded(e) && (u = h = !1)),
  25859. h) {
  25860. var m = r / o * g
  25861. , v = l * r / o * g
  25862. , y = c * r / o * g;
  25863. I[r] || (I[r] = this.sceneRenderer.initSizedTexture2D(r, _.ClampToEdgeWrapping));
  25864. var A = I[r];
  25865. if (this.sceneRenderer.uploadTexture2D(n, A, 0, 0, r, r),
  25866. 1 === E || 2 === E) {
  25867. var C = 1 === E ? this.overlayTilesBasic : this.overlayTilesEnhanced;
  25868. this.sceneRenderer.renderToCubeMap(A, f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace),
  25869. this.sceneRenderer.renderToCubeMap(C[o], f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace, _.NormalBlending, !0, .5)
  25870. } else
  25871. this.sceneRenderer.renderToCubeMap(A, f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace);
  25872. d.uploadCount++,
  25873. this.emit(b.TileRenderSuccess, i, o, a, s),
  25874. d.uploadCount === s && this.emit(b.PanoRenderComplete, i, o, s),
  25875. this.setUploaded(e, !0),
  25876. this.addCoverageForNode(e.node)
  25877. } else
  25878. this.setUploaded(e, !1);
  25879. return e.uploadAttempted || (d.uploadAttempts++,
  25880. this.emit(b.TileUploadAttempted, i, o, a, s)),
  25881. e.uploadAttempted = !0,
  25882. d.uploadAttempts === s && this.emit(b.UploadAttemptedForAllTiles, i, o, s),
  25883. u
  25884. }
  25885. ),
  25886. n.prototype.linkTileAndNode = function(e, t) {
  25887. (t.tile = e).node = t
  25888. }
  25889. ,
  25890. n.prototype.linkAllTilesAndNodes = function(a) {
  25891. for (var e = function(e, t, i, n, r) {
  25892. var o = this.getTileDirectoryEntry(a.id, t, n, r);
  25893. this.linkTileAndNode(o, i)
  25894. }, t = 0; t < A.FACES_PER_PANO; t++) {
  25895. var i = this.getTileTree(a.id, t);
  25896. i.breadthFirst({
  25897. callback: e.bind(this, i, t)
  25898. })
  25899. }
  25900. }
  25901. ,
  25902. n.prototype.anyUploaded = function(e) {
  25903. if (!e)
  25904. return !1;
  25905. if (e.tile && this.isTileUploaded(e.tile))
  25906. return !0;
  25907. if (e.children)
  25908. for (var t = 0; t < e.children.length; t++) {
  25909. var i = e.children[t];
  25910. if (this.anyUploaded(i))
  25911. return !0
  25912. }
  25913. return !1
  25914. }
  25915. ,
  25916. n.prototype.setNodeCovered = function(e, t) {
  25917. this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered = t : e.covered = t
  25918. }
  25919. ,
  25920. n.prototype.isNodeCovered = function(e) {
  25921. return !!e && (this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered : e.covered)
  25922. }
  25923. ,
  25924. n.prototype.addCoverageForNode = function(e) {
  25925. if (this.setNodeCovered(e, !0),
  25926. e.parent && e.covered) {
  25927. var t = e.parent;
  25928. this.nodeSubcovered(t) && this.addCoverageForNode(t, !0)
  25929. }
  25930. }
  25931. ,
  25932. n.prototype.calcFullCoverage = function(e) {
  25933. var t = !1;
  25934. if (e.children)
  25935. for (var i = 0; i < e.children.length; i++) {
  25936. var n = e.children[i];
  25937. t = t || this.calcFullCoverage(n)
  25938. }
  25939. e.covered = e.tile.uploaded || t
  25940. }
  25941. ,
  25942. n.prototype.nodeSubcovered = function(e) {
  25943. if (!e.children)
  25944. return !1;
  25945. for (var t = 0; t < e.children.length; t++)
  25946. if (!e.children[t] || !this.isNodeCovered(e.children[t]))
  25947. return !1;
  25948. return !0
  25949. }
  25950. ,
  25951. n.prototype.resetPanoDescriptor = function(e) {
  25952. this.getPanoDescriptor(e)
  25953. }
  25954. ,
  25955. n.prototype.getPanoDescriptor = function(e) {
  25956. var t = this.panoDescriptors[e];
  25957. return t || (t = {},
  25958. this.panoDescriptors[e] = t),
  25959. t
  25960. }
  25961. ,
  25962. n.prototype.resetPanoLODDescriptors = function(e) {
  25963. var t = this.getPanoLODDescriptors(e);
  25964. for (var i in t)
  25965. if (t.hasOwnProperty(i)) {
  25966. var n = t[i];
  25967. n.uploadCount = 0,
  25968. n.uploadAttempts = 0
  25969. }
  25970. }
  25971. ,
  25972. n.prototype.getPanoLODDescriptor = function(e, t) {
  25973. var i = this.getPanoLODDescriptors(e)
  25974. , n = i[t];
  25975. return n || (n = {
  25976. uploadCount: 0,
  25977. uploadAttempts: 0
  25978. },
  25979. i[t] = n),
  25980. n
  25981. }
  25982. ,
  25983. n.prototype.getPanoLODDescriptors = function(e) {
  25984. var t = this.panoLODDescriptors[e];
  25985. return t || (t = {},
  25986. this.panoLODDescriptors[e] = t),
  25987. t
  25988. }
  25989. ,
  25990. n.prototype.onTileDownloaded = function(e) {
  25991. var t = v.getLevelCountForSize(A.TILE_SIZE, e.panoSize)
  25992. , i = this.getTileDirectoryEntry(e.panoId, e.face, t, e.faceTileIndex);
  25993. if (i.downloaded = !0,
  25994. i.image = e.image,
  25995. i.panoSize = e.panoSize,
  25996. i.tileX = e.tileX,
  25997. i.tileY = e.tileY,
  25998. i.totalTiles = e.totalTiles,
  25999. i.tileIndex = e.tileIndex,
  26000. i.faceTileIndex = e.faceTileIndex,
  26001. i.face = e.face,
  26002. i.cubeFace = C.mapFaceToCubemapFace(e.face),
  26003. i.panoId = e.panoId,
  26004. i.tileSize = e.tileSize,
  26005. i.direction = (new _.Vector3).copy(e.direction),
  26006. i.node = null,
  26007. i.level = v.getLevelCountForSize(A.TILE_SIZE, i.panoSize),
  26008. this.isPanoActive(i.panoId)) {
  26009. var n = this.getTileTree(i.panoId, i.face).getSubNode(i.panoSize, i.tileX, i.tileY);
  26010. this.linkTileAndNode(i, n),
  26011. this.queueTileUpload(i, !0)
  26012. }
  26013. }
  26014. ,
  26015. n.prototype.getTileDirectoryEntry = function(e, t, i, n) {
  26016. var r = this.tileDirectory[e];
  26017. r || (r = {},
  26018. this.tileDirectory[e] = r);
  26019. var o = 16384 * t + 1024 * i + n
  26020. , a = r[o];
  26021. return a || (a = {
  26022. downloaded: !1,
  26023. uploaded: !1,
  26024. zoomUploaded: !1
  26025. },
  26026. r[o] = a),
  26027. a._key = e + ":" + t + ":" + i + ":" + n,
  26028. a._tileKey = o,
  26029. a
  26030. }
  26031. ,
  26032. n.prototype.setZoomingActive = function(e, t, i) {
  26033. this.zoomPanoRenderingDisabled || e === this.zoomingActive && this.zoomPanoId === t.id || (this.zoomingActive = e,
  26034. this.zoomPanoId = t.id,
  26035. this.zoomingActive && (this.zoomPanoId !== t.id || i) && this.updateZoomedPanoFromBase(t))
  26036. }
  26037. ,
  26038. n.prototype.updateZoomedPanoFromBase = function(e) {
  26039. if (!this.zoomPanoRenderingDisabled) {
  26040. var t = this.getActiveRenderTargetDescriptor(e.id);
  26041. if (t && t.renderTarget) {
  26042. var i = this.qualityManager.getMaxZoomPanoSize()
  26043. , n = t.renderTarget
  26044. , r = t.size;
  26045. this.sceneRenderer.copyCubeMap(n.texture, this.zoomRenderTarget, r, r, i, i),
  26046. this.copyBaseRenderStatusToZoomed(e.id)
  26047. }
  26048. }
  26049. }
  26050. ,
  26051. t.exports = n
  26052. }
  26053. , {
  26054. "../enum/GLCubeFaces": 25,
  26055. "../enum/PanoRendererEvents": 35,
  26056. "../enum/PanoSizeClass": 36,
  26057. "../enum/SceneRendererEvents": 43,
  26058. "../enum/TileDownloaderEvents": 45,
  26059. "../enum/Vectors": 50,
  26060. "../exception/BasicException": 55,
  26061. "../objects/Panorama": 148,
  26062. "../settings": 166,
  26063. "../util/browser": 182,
  26064. "../util/panorama": 191,
  26065. "./TileDownloader": 171,
  26066. "./TilePrioritizer": 172,
  26067. "./TileTree": 173,
  26068. "./TileUtils": 174,
  26069. events: 202,
  26070. three: 217
  26071. }],
  26072. 170: [function(e, t, i) {
  26073. "use strict";
  26074. function n(e, t, i) {
  26075. this.maxNavPanoSize = -1,
  26076. this.maxZoomPanoSize = -1,
  26077. this.devicePixelDensity = e,
  26078. this.deviceScreenSize = t,
  26079. this.clientBandwidth = i,
  26080. this.panoSizeClassMap = {},
  26081. this.useHighResolutionPanos = !0,
  26082. this.useUltraHighResolutionPanos = !1,
  26083. this.modelHasUltraHighPanos = !1
  26084. }
  26085. var r = e("../enum/PanoSizeClass")
  26086. , o = e("../settings")
  26087. , a = e("../util/browser")
  26088. , s = e("../constants")
  26089. , l = e("../util/showcase")
  26090. , c = e("../enum/ModelManagerEvents");
  26091. n.prototype.init = function(e) {
  26092. this.buildPanoSizeClassMap(this.devicePixelDensity, this.deviceScreenSize, this.clientBandwidth),
  26093. this.ultraHighSize = this.getPanoSize(r.ULTRAHIGH),
  26094. this.highSize = this.getPanoSize(r.HIGH),
  26095. this.standardSize = this.getPanoSize(r.STANDARD),
  26096. this.baseSize = this.getPanoSize(r.BASE),
  26097. o.tiling.maxZoomPanoQuality && this.ultraHighSize <= o.tiling.maxZoomPanoQuality && (o.tiling.allowUltraHighResolution = !0),
  26098. this.highQualityThreshold = a.valueFromHash("threshold2k", s.windowHeightHighQualityThreshold),
  26099. this.updateMaximums(),
  26100. e.on(c.ActiveModelChanged, this.onModelChanged.bind(this))
  26101. }
  26102. ,
  26103. n.prototype.updateFromModel = function(e) {
  26104. this.updateHighResolutionSettings(e),
  26105. this.updateUltraHighResolutionSettings(e)
  26106. }
  26107. ,
  26108. n.prototype.updateHighResolutionSettings = function(e) {
  26109. l.modelDataPromisesTiles(e.data) ? this.useHighResolutionPanos = !0 : this.useHighResolutionPanos = !1,
  26110. this.updateMaximums()
  26111. }
  26112. ,
  26113. n.prototype.updateUltraHighResolutionSettings = function(e) {
  26114. o.tiling.allowUltraHighResolution && this.modelHasUltraHighPanos ? this.useUltraHighResolutionPanos = !0 : this.useUltraHighResolutionPanos = !1,
  26115. this.updateMaximums()
  26116. }
  26117. ,
  26118. n.prototype.enableUltraHighQualityMode = function() {
  26119. this.modelHasUltraHighPanos = !0,
  26120. this.updateUltraHighResolutionSettings(null)
  26121. }
  26122. ,
  26123. n.prototype.ultraHighQualityModeEnabled = function() {
  26124. return this.modelHasUltraHighPanos
  26125. }
  26126. ,
  26127. n.prototype.onModelChanged = function(e) {
  26128. this.updateFromModel(e.model),
  26129. this.updateMaximums()
  26130. }
  26131. ,
  26132. n.prototype.updateMaximums = function() {
  26133. this.maxNavPanoSize = o.tiling.maxNavPanoQuality || this.detectMaxNavPanoSize(),
  26134. this.maxZoomPanoSize = o.tiling.maxZoomPanoQuality || this.detectMaxZoomPanoSize(),
  26135. this.maxZoomPanoSize < this.maxNavPanoSize && (this.maxNavPanoSize = this.maxZoomPanoSize)
  26136. }
  26137. ,
  26138. n.prototype.buildPanoSizeClassMap = function() {
  26139. this.panoSizeClassMap[r.BASE] = 512,
  26140. this.panoSizeClassMap[r.STANDARD] = 1024,
  26141. this.panoSizeClassMap[r.HIGH] = 2048,
  26142. this.panoSizeClassMap[r.ULTRAHIGH] = 4096
  26143. }
  26144. ,
  26145. n.prototype.getPanoSize = function(e) {
  26146. return this.panoSizeClassMap[e]
  26147. }
  26148. ,
  26149. n.prototype.getMaxPossiblePanoSize = function() {
  26150. return this.getPanoSize(r.ULTRAHIGH)
  26151. }
  26152. ,
  26153. n.prototype.getMaxPanoSize = function() {
  26154. return this.maxZoomPanoSize
  26155. }
  26156. ,
  26157. n.prototype.getMaxNavPanoSize = function() {
  26158. return this.maxNavPanoSize
  26159. }
  26160. ,
  26161. n.prototype.getMaxZoomPanoSize = function() {
  26162. return this.maxZoomPanoSize
  26163. }
  26164. ,
  26165. n.prototype.detectMaxNavPanoSizeClass = function() {
  26166. return this.useHighResolutionPanos ? a.isMobile() ? r.STANDARD : $("#player").height() < this.highQualityThreshold ? r.STANDARD : r.HIGH : r.STANDARD
  26167. }
  26168. ,
  26169. n.prototype.detectMaxNavPanoSize = function() {
  26170. var e = this.detectMaxNavPanoSizeClass();
  26171. return this.getPanoSize(e)
  26172. }
  26173. ,
  26174. n.prototype.detectMaxZoomPanoSize = function() {
  26175. 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)
  26176. }
  26177. ,
  26178. t.exports = n
  26179. }
  26180. , {
  26181. "../constants": 8,
  26182. "../enum/ModelManagerEvents": 33,
  26183. "../enum/PanoSizeClass": 36,
  26184. "../settings": 166,
  26185. "../util/browser": 182,
  26186. "../util/showcase": 193
  26187. }],
  26188. 171: [function(A, C, e) {
  26189. (function(e) {
  26190. "use strict";
  26191. function i(e) {
  26192. this.panos = null,
  26193. this.retryMinimumTime = 1e4,
  26194. this.urls = null,
  26195. this.panoLoadCallbacks = {},
  26196. this.downloadDescriptors = {},
  26197. this.priorityQueue = [],
  26198. this.forceQueue = [],
  26199. this.activeDownloads = [],
  26200. this.qualityManager = null,
  26201. this.tilePrioritizer = null,
  26202. this.refreshInterval = null,
  26203. this.processPriorityQueue = !1,
  26204. this.concurrentDownloads = e.concurrentDownloads || 1,
  26205. this.downloadTestResults = {}
  26206. }
  26207. var c, h, n, p, f, t = A("three"), u = (A("../enum/Viewmode"),
  26208. A("../settings")), r = (A("../objects/Panorama"),
  26209. A("../util/logger")), o = (A("../enum/Vectors"),
  26210. A("../enum/PanoSizeClass"),
  26211. A("../enum/TileDownloaderEvents")), g = A("./TilePrioritizer"), m = A("./TileUtils"), v = (A("../enum/GLCubeFaces"),
  26212. A("../enum/DownloadStatus")), a = A("../util/panorama"), s = A("../util/ajax"), d = A("../ab"), l = A("events").EventEmitter, y = (new r(e),
  26213. Object.freeze({
  26214. Testing: 1,
  26215. Success: 2,
  26216. Fail: 3
  26217. }));
  26218. i.prototype = Object.create(l.prototype),
  26219. i.IDLE_REFRESH_DELAY = 500,
  26220. i.ACTIVE_REFRESH_DELAY = 16,
  26221. i.DOWNLOAD_RETRIES = 4,
  26222. i.prototype.init = function(e) {
  26223. this.qualityManager = e
  26224. }
  26225. ,
  26226. i.prototype.setUrls = function(e) {
  26227. this.urls = e
  26228. }
  26229. ,
  26230. i.prototype.setPanoData = function(e, t, i) {
  26231. this.panos = e,
  26232. this.imagePanos = t,
  26233. this.panoGroupId = i
  26234. }
  26235. ,
  26236. i.prototype.start = function() {
  26237. this.refreshUpdateInterval(0)
  26238. }
  26239. ,
  26240. i.prototype.stop = function() {
  26241. window.cancel(this.refreshInterval)
  26242. }
  26243. ,
  26244. i.prototype.refreshUpdateInterval = function(e) {
  26245. e = e || 0,
  26246. this.refreshInterval = window.setTimeout(function() {
  26247. this.update() ? this.refreshUpdateInterval(i.ACTIVE_REFRESH_DELAY) : this.refreshUpdateInterval(i.IDLE_REFRESH_DELAY)
  26248. }
  26249. .bind(this), e)
  26250. }
  26251. ,
  26252. i.prototype.update = function() {
  26253. var e = 0 < this.forceQueue.length;
  26254. return this.processQueueForDownloading(this.forceQueue),
  26255. this.processPriorityQueue && (this.queuePrioritizedTilesForPanos(this.panos),
  26256. 0 < this.priorityQueue.length && (e = !0),
  26257. this.processQueueForDownloading(this.priorityQueue)),
  26258. e
  26259. }
  26260. ,
  26261. i.prototype.forceQueueTilesForPano = (p = [],
  26262. f = [],
  26263. function(e, t, i, n, r, o) {
  26264. p.length = 0;
  26265. for (var a = this.getTileDownloadDescriptors(e, t), s = 0; s < a.length; s++) {
  26266. var l = a[s];
  26267. l.status !== v.None && l.status !== v.Queued || p.push(l)
  26268. }
  26269. if (i && 0 < p.length) {
  26270. g.sortPanoTiles(p, e, i),
  26271. f.length = 0,
  26272. m.matchingTilesInDirection(e, t, i, n, r, f);
  26273. for (var c = 0, h = function(e) {
  26274. return e.face === u.face && e.faceTileIndex === u.faceTileIndex
  26275. }; c < p.length; ) {
  26276. var u = p[c];
  26277. f.findIndex(h) < 0 ? p.splice(c, 1) : c++
  26278. }
  26279. }
  26280. for (var d = 0; d < p.length; d++)
  26281. this.forceQueue.push(p[d]);
  26282. this.setStatusForAllDescriptors(this.forceQueue, v.ForceQueued),
  26283. this.clearFromQueue(this.priorityQueue, v.ForceQueued, !1),
  26284. o && this.processQueueForDownloading(this.forceQueue, !0)
  26285. }
  26286. ),
  26287. i.prototype.clearForceQueue = function() {
  26288. this.clearQueue(this.forceQueue)
  26289. }
  26290. ,
  26291. i.prototype.queuePrioritizedTilesForPanos = function(e) {
  26292. this.tilePrioritizer && (this.clearQueue(this.priorityQueue),
  26293. this.tilePrioritizer.filterAndPrioritize(this.priorityQueue, e, this),
  26294. this.clearFromQueue(this.priorityQueue, v.None, !0),
  26295. this.setStatusOrRemoveForAllDescriptors(this.priorityQueue, v.Queued))
  26296. }
  26297. ,
  26298. i.prototype.clearQueue = function(e) {
  26299. this.setStatusForAllDescriptors(e, v.None),
  26300. e.length = 0
  26301. }
  26302. ,
  26303. i.prototype.clearFromQueue = function(e, t, i) {
  26304. for (var n = 0; n < e.length; n++) {
  26305. var r = e[n];
  26306. r && (t === r.status && !i || t !== r.status && i) && (e[n] = null)
  26307. }
  26308. }
  26309. ,
  26310. i.prototype.setStatusForAllDescriptors = function(e, t) {
  26311. for (var i = 0; i < e.length; i++) {
  26312. var n = e[i];
  26313. n && (n.status = t)
  26314. }
  26315. }
  26316. ,
  26317. i.prototype.setStatusOrRemoveForAllDescriptors = function(e, t) {
  26318. for (var i = 0; i < e.length; i++) {
  26319. var n = e[i];
  26320. n && (n.status !== t ? n.status = t : e[i] = null)
  26321. }
  26322. }
  26323. ,
  26324. i.prototype.getTileDownloadDescriptors = function(e, t) {
  26325. var i = this.getAllTileDownloadDescriptorsForPano(e)
  26326. , n = i[t];
  26327. return n || (n = this.buildDownloadDescriptorArray(t),
  26328. i[t] = n,
  26329. this.initTileDownloadDescriptors(n, e, t)),
  26330. n
  26331. }
  26332. ,
  26333. i.prototype.getAllTileDownloadDescriptorsForPano = function(e) {
  26334. var t = this.downloadDescriptors[e.id];
  26335. return t || (t = {},
  26336. this.downloadDescriptors[e.id] = t),
  26337. t
  26338. }
  26339. ,
  26340. i.prototype.processQueueForDownloading = function(e, t) {
  26341. if (this.cleanupActiveDownloads(),
  26342. this.activeDownloads.length < this.concurrentDownloads || t)
  26343. for (var i = t ? e.length : this.concurrentDownloads - this.activeDownloads.length, n = 0; n < i && 0 < e.length; 0) {
  26344. var r = e.shift();
  26345. r && (this.startDownload(r),
  26346. n++)
  26347. }
  26348. }
  26349. ,
  26350. i.prototype.testDownload = function(t, e, i) {
  26351. var n = this.downloadTestResults[t];
  26352. if (n)
  26353. n === y.Success ? i(!0) : n === y.Fail && i(!1);
  26354. else {
  26355. this.downloadTestResults[t] = y.Testing;
  26356. var r = this.panos.list[0]
  26357. , o = this.getTileUrl(r.id, t, e, 0)
  26358. , a = function(e) {
  26359. this.downloadTestResults[t] = y.Success,
  26360. i(!0)
  26361. }
  26362. .bind(this)
  26363. , s = function() {
  26364. this.downloadTestResults[t] = y.Fail,
  26365. i(!1)
  26366. }
  26367. .bind(this);
  26368. this.loadImage(o, 0, a, s)
  26369. }
  26370. }
  26371. ,
  26372. i.prototype.startDownload = function(e) {
  26373. e.status = v.Downloading;
  26374. var t = this.getTileUrl(e.pano.id, e.panoSize, e.tileSize, e.tileIndex);
  26375. this.activeDownloads.push(e),
  26376. this.loadImage(t, i.DOWNLOAD_RETRIES, this.downloadComplete.bind(this, e), this.downloadFailed.bind(this, e))
  26377. }
  26378. ,
  26379. i.prototype.downloadFailed = function(e, t) {}
  26380. ,
  26381. i.prototype.downloadComplete = function(e, t) {
  26382. if (e.panoGroupId === this.panoGroupId) {
  26383. var i = this.getPanoLoadCallbacks(e.pano, e.panoSize);
  26384. e.status = v.Downloaded,
  26385. i && i.onProgress && i.onProgress(e.pano, e.panoSize);
  26386. var n = {
  26387. panoId: e.pano.id,
  26388. image: t,
  26389. tileSize: e.tileSize,
  26390. panoSize: e.panoSize,
  26391. tileIndex: e.tileIndex,
  26392. faceTileIndex: e.faceTileIndex,
  26393. totalTiles: e.totalTiles,
  26394. face: e.face,
  26395. tileX: e.tileX,
  26396. tileY: e.tileY,
  26397. direction: e.direction
  26398. };
  26399. e.image = t,
  26400. this.emit(o.TileDownloadSuccess, n),
  26401. this.isPanoDownloaded(e.pano, e.panoSize) && (n = {
  26402. panoId: e.pano.id,
  26403. tileSize: e.tileSize,
  26404. panoSize: e.panoSize
  26405. },
  26406. this.emit(o.PanoDownloadComplete, n),
  26407. i && i.onLoad && i.onLoad(e.pano, e.panoSize))
  26408. }
  26409. }
  26410. ,
  26411. i.prototype.cleanupActiveDownloads = (n = [],
  26412. function() {
  26413. for (var e = n.length = 0; e < this.activeDownloads.length; e++) {
  26414. var t = this.activeDownloads[e];
  26415. t.status !== v.Downloaded && t.status !== v.Failed && n.push(t)
  26416. }
  26417. this.activeDownloads.length = 0,
  26418. this.activeDownloads.push.apply(this.activeDownloads, n)
  26419. }
  26420. ),
  26421. i.prototype.isPanoDownloaded = function(e, t) {
  26422. var i = this.getTileDownloadDescriptors(e, t);
  26423. if (i.length <= 0)
  26424. return !1;
  26425. for (var n = 0; n < i.length; n++) {
  26426. if (i[n].status !== v.Downloaded)
  26427. return !1
  26428. }
  26429. return !0
  26430. }
  26431. ,
  26432. i.prototype.setPanoLoadCallbacks = function(e, t, i, n, r) {
  26433. var o = e.id + ":" + this.qualityManager.getPanoSize(t);
  26434. this.panoLoadCallbacks[o] = {
  26435. onLoad: i,
  26436. onFail: n,
  26437. onProgress: r
  26438. }
  26439. }
  26440. ,
  26441. i.prototype.getPanoLoadCallbacks = function(e, t) {
  26442. var i = e.id + ":" + t;
  26443. return this.panoLoadCallbacks[i]
  26444. }
  26445. ,
  26446. i.prototype.buildDownloadDescriptorArray = function(e) {
  26447. for (var t = m.getTileCountForSize(e), i = [], n = 0; n < t; n++) {
  26448. var r = this.buildDownloadDescriptor();
  26449. i.push(r)
  26450. }
  26451. return i
  26452. }
  26453. ,
  26454. i.prototype.buildDownloadDescriptor = function() {
  26455. return {
  26456. panoGroupId: null,
  26457. pano: null,
  26458. panoSize: -1,
  26459. tileSize: -1,
  26460. tileIndex: -1,
  26461. totalTiles: -1,
  26462. faceTileIndex: -1,
  26463. status: v.None,
  26464. url: null,
  26465. image: null,
  26466. direction: new t.Vector3,
  26467. face: -1,
  26468. cubeFace: -1,
  26469. tileX: -1,
  26470. tileY: -1
  26471. }
  26472. }
  26473. ,
  26474. i.prototype.initTileDownloadDescriptors = function(e, t, i) {
  26475. for (var n = 0; n < e.length; n++) {
  26476. var r = e[n];
  26477. this.initTileDownloadDescriptor(r, t, i, n)
  26478. }
  26479. }
  26480. ,
  26481. i.prototype.initTileDownloadDescriptor = function(e, t, i, n) {
  26482. var r = i >= m.TILE_SIZE ? m.TILE_SIZE : i;
  26483. e.face = m.getFaceForTile(i, n),
  26484. e.cubeFace = a.mapFaceToCubemapFace(e.face),
  26485. e.panoGroupId = this.panoGroupId,
  26486. e.pano = t,
  26487. e.panoSize = i,
  26488. e.tileSize = r,
  26489. e.tileIndex = n,
  26490. e.totalTiles = m.getTileCountForSize(i),
  26491. e.status = v.None,
  26492. e.image = null,
  26493. m.getTileLocation(e.panoSize, e.tileIndex, e),
  26494. m.getTileVector(e.panoSize, e.tileSize, e.cubeFace, e.tileX, e.tileY, m.LocationOnTile.Center, 0, e.direction)
  26495. }
  26496. ,
  26497. i.prototype.getTileUrl = (c = {
  26498. 256: "256",
  26499. 512: "512",
  26500. 1024: "1k",
  26501. 2048: "2k",
  26502. 4096: "4k"
  26503. },
  26504. h = {
  26505. face: -1,
  26506. faceTileIndex: -1,
  26507. tileX: -1,
  26508. tileY: -1
  26509. },
  26510. function(e, t, i, n) {
  26511. m.getTileLocation(t, n, h);
  26512. var r = Math.floor(t / i)
  26513. , o = r * r
  26514. , a = Math.floor(n / o)
  26515. , s = "";
  26516. 1 === u.tiling.customCompression && (s = "_" + u.tiling["q" + c[t]]);
  26517. var l = this.urls.get("tiles/" + e + "/" + c[t] + s + "_face" + a + "_" + h.tileX + "_" + h.tileY + ".jpg");
  26518. return d.changeIfTileGenerating(l)
  26519. }
  26520. ),
  26521. i.prototype.loadImage = function(e, t, i, n) {
  26522. s.getImage(e, t).then(function(e) {
  26523. i(e)
  26524. }).fail(n)
  26525. }
  26526. ,
  26527. C.exports = i
  26528. }
  26529. ).call(this, "/js/tile/TileDownloader.js")
  26530. }
  26531. , {
  26532. "../ab": 3,
  26533. "../enum/DownloadStatus": 24,
  26534. "../enum/GLCubeFaces": 25,
  26535. "../enum/PanoSizeClass": 36,
  26536. "../enum/TileDownloaderEvents": 45,
  26537. "../enum/Vectors": 50,
  26538. "../enum/Viewmode": 51,
  26539. "../objects/Panorama": 148,
  26540. "../settings": 166,
  26541. "../util/ajax": 181,
  26542. "../util/logger": 189,
  26543. "../util/panorama": 191,
  26544. "./TilePrioritizer": 172,
  26545. "./TileUtils": 174,
  26546. events: 202,
  26547. three: 217
  26548. }],
  26549. 172: [function(n, C, e) {
  26550. (function(e) {
  26551. "use strict";
  26552. function h(e, t, i, n, r) {
  26553. this.qualityManager = e,
  26554. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  26555. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize(),
  26556. this.baseSize = t,
  26557. this.standardSize = i,
  26558. this.highSize = n,
  26559. this.ultraHighSize = r,
  26560. this.priorityCriteria = new h.PriorityCriteria(null,new o.Vector3(0,0,0),new o.Vector3(0,0,-1),new o.Vector3(0,0,-1))
  26561. }
  26562. var c, s, l, d, r, u, p, f, o = n("three"), g = (n("../enum/Viewmode"),
  26563. n("../settings"),
  26564. n("../settings"),
  26565. n("../objects/Panorama")), t = n("../util/logger"), i = (n("../enum/Vectors"),
  26566. n("../enum/PanoSizeClass"),
  26567. n("../enum/ModelManagerEvents"),
  26568. n("../enum/GLCubeFaces"),
  26569. n("../enum/DownloadStatus")), m = (n("../util/browser"),
  26570. n("./TileUtils")), v = n("../util/math"), a = (n("events").EventEmitter,
  26571. new t(e),
  26572. Object.freeze({
  26573. None: 0,
  26574. DirectionalFOV: 1
  26575. }));
  26576. h.PriorityCriteria = function(e, t, i, n, r) {
  26577. this.pano = e,
  26578. this.cameraPosition = (new o.Vector3).copy(t),
  26579. this.cameraDir = (new o.Vector3).copy(i),
  26580. this.panoSpaceDir = (new o.Vector3).copy(n),
  26581. this.upcomingPanos = r,
  26582. this.copy = function(e) {
  26583. this.pano = e.pano,
  26584. this.cameraPosition.copy(e.cameraPosition),
  26585. this.cameraDir.copy(e.cameraDir),
  26586. this.panoSpaceDir.copy(e.panoSpaceDir),
  26587. this.upcomingPanos = r
  26588. }
  26589. ,
  26590. this.zoomingActive = !1
  26591. }
  26592. ,
  26593. h.DIRECTIONAL_FOV = 180,
  26594. h.DIRECTIONAL_FOV_NARROW = 120,
  26595. h.MAX_SCORED_PANOS_TOCONSIDER = 6,
  26596. h.MAX_SCORED_PANOS_TOADD = 2,
  26597. h.MAX_UPCOMING_PANOS_TOADD = 3,
  26598. h.DIRECTION_SCORE_STRICTNESS = .75,
  26599. h.appendQueue = function(e, t) {
  26600. if (e && t)
  26601. for (var i = 0; i < t.length; i++)
  26602. e.push(t[i])
  26603. }
  26604. ,
  26605. h.prototype.updateCriteria = function(e, t, i, n) {
  26606. this.priorityCriteria.pano = e,
  26607. this.priorityCriteria.cameraPosition.copy(t),
  26608. this.priorityCriteria.cameraDir.copy(i),
  26609. this.priorityCriteria.upcomingPanos = n,
  26610. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  26611. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize()
  26612. }
  26613. ,
  26614. h.prototype.filterAndPrioritize = (u = [],
  26615. p = [],
  26616. f = [],
  26617. function(e, t, i) {
  26618. this.populateNeighborPanos(this.priorityCriteria.pano, t, u),
  26619. this.populateScoredPanos(this.priorityCriteria.pano, t, p, this.priorityCriteria.cameraDir, h.MAX_SCORED_PANOS_TOCONSIDER);
  26620. var n = this.baseSize
  26621. , r = this.standardSize
  26622. , o = this.highSize
  26623. , a = this.ultraHighSize;
  26624. this.queueTilesForPano(e, i, this.priorityCriteria.pano, n),
  26625. this.priorityCriteria.upcomingPanos && this.queueTilesForPanos(e, this.priorityCriteria.upcomingPanos, i, n, h.MAX_UPCOMING_PANOS_TOADD),
  26626. f.length = 0,
  26627. this.canDownloadSize(r) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, r, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  26628. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26629. h.appendQueue(e, f),
  26630. this.queueTilesForPanos(e, p, i, n, h.MAX_SCORED_PANOS_TOADD),
  26631. f.length = 0,
  26632. this.canDownloadSize(o) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, o, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  26633. this.canDownloadSize(a) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, a, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  26634. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26635. h.appendQueue(e, f),
  26636. f.length = 0,
  26637. this.canDownloadSize(r) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, r, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  26638. this.canDownloadSize(o) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, o, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  26639. this.canDownloadSize(a) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, a, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  26640. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26641. h.appendQueue(e, f),
  26642. this.queueTilesForPanos(e, u, i, n)
  26643. }
  26644. ),
  26645. h.prototype.canDownloadSize = function(e) {
  26646. return this.maxNavQuality >= e || this.maxZoomQuality >= e && this.zoomingActive
  26647. }
  26648. ,
  26649. h.prototype.populateNeighborPanos = function(e, t, i) {
  26650. (i = i || []).length = 0;
  26651. var n = t.getNeighbours(e);
  26652. for (var r in n)
  26653. if (n.hasOwnProperty(r)) {
  26654. var o = t.get(r);
  26655. i.push(o)
  26656. }
  26657. return i
  26658. }
  26659. ,
  26660. h.prototype.populateScoredPanos = function(e, t, i, n, r) {
  26661. (i = i || []).length = 0;
  26662. var o = [g.filters.inPanoDirection(e.position, n, h.DIRECTION_SCORE_STRICTNESS), g.filters.not(e)]
  26663. , a = [g.scoreFunctions.distanceSquared(e), g.scoreFunctions.direction(e.position, n)]
  26664. , s = t.sortByScore(o, a);
  26665. if (s)
  26666. for (var l = 0; l < s.length && l < r; l++) {
  26667. var c = s[l].pano;
  26668. i.push(c)
  26669. }
  26670. return i
  26671. }
  26672. ,
  26673. h.prototype.queueTilesForPanos = function(e, t, i, n, r) {
  26674. for (var o = 0, a = 0; a < t.length; a++) {
  26675. var s = t[a];
  26676. if (o += 0 < this.queueTilesForPano(e, i, s, n) ? 1 : 0,
  26677. r && r <= o)
  26678. break
  26679. }
  26680. return o
  26681. }
  26682. ,
  26683. h.prototype.queueTilesForPano = (r = {
  26684. filter: a.None
  26685. },
  26686. function(e, t, i, n) {
  26687. return this.filterAndQueueTileDownloadDescriptors(e, t, i, n, r)
  26688. }
  26689. ),
  26690. h.prototype.queueTilesForPanosInDirection = (d = new o.Vector3,
  26691. function(e, t, i, n, r, o, a, s) {
  26692. for (var l = 0, c = 0; c < i.length; c++) {
  26693. var h = i[c];
  26694. d.copy(h.position),
  26695. d.sub(r),
  26696. d.normalize();
  26697. var u = Math.max(Math.min(o.dot(d), 1), -1);
  26698. if (v.getFOVDotThreshold(a) <= u && (l += 0 < this.queueTilesInDirectionForPano(e, t, h, n, r, o, a) ? 1 : 0,
  26699. s && s <= l))
  26700. break
  26701. }
  26702. return l
  26703. }
  26704. ),
  26705. h.prototype.queueTilesInDirectionForPanos = function(e, t, i, n, r, o, a, s) {
  26706. for (var l = 0, c = 0; c < i.length; c++) {
  26707. var h = i[c];
  26708. if (l += 0 < this.queueTilesInDirectionForPano(e, t, h, n, o, a) ? 1 : 0,
  26709. s && s <= l)
  26710. break
  26711. }
  26712. return l
  26713. }
  26714. ,
  26715. h.prototype.queueTilesInDirectionForPano = (s = {
  26716. filter: a.DirectionalFOV,
  26717. direction: new o.Vector3,
  26718. fov: 60
  26719. },
  26720. l = new o.Vector3,
  26721. function(e, t, i, n, r, o, a) {
  26722. return l.copy(o),
  26723. m.getRelativeDirection(i.quaternion, l),
  26724. s.direction.copy(l),
  26725. s.fov = a,
  26726. this.filterAndQueueTileDownloadDescriptors(e, t, i, n, s)
  26727. }
  26728. ),
  26729. h.prototype.filterAndQueueTileDownloadDescriptors = (c = [],
  26730. function(e, t, i, n, r) {
  26731. var o = t.getTileDownloadDescriptors(i, n);
  26732. c.length = 0,
  26733. this.filterTileDownloadDescriptors(i, o, c, r);
  26734. for (var a = 0, s = 0; s < c.length; s++) {
  26735. var l = c[s];
  26736. l && (e.push(l),
  26737. a++)
  26738. }
  26739. return a
  26740. }
  26741. ),
  26742. h.prototype.filterTileDownloadDescriptors = (new o.Vector3,
  26743. function(e, t, i, n) {
  26744. var r, o;
  26745. switch (n.filter) {
  26746. case a.DirectionalFOV:
  26747. for (r = 0; r < t.length; r++)
  26748. o = t[r],
  26749. m.isTileWithinFOV(o.panoSize, o.tileSize, o.face, o.tileX, o.tileY, n.direction, n.fov) && i.push(o);
  26750. break;
  26751. default:
  26752. for (r = 0; r < t.length; r++)
  26753. o = t[r],
  26754. i.push(o)
  26755. }
  26756. for (r = 0; r < i.length; r++)
  26757. o = i[r],
  26758. this.canIncludeDescriptor(o) || (i[r] = null)
  26759. }
  26760. ),
  26761. h.prototype.canIncludeDescriptor = function(e) {
  26762. return e.status !== i.Downloading && e.status !== i.Downloaded
  26763. }
  26764. ,
  26765. h.prototype.canIncludePano = function(e, t) {
  26766. return !e.isLoaded(t)
  26767. }
  26768. ,
  26769. h.getFOVDotThreshold = function(e) {
  26770. return Math.cos(o.Math.degToRad(e / 2))
  26771. }
  26772. ;
  26773. var y = (A._panoSpaceDir = new o.Vector3,
  26774. A._fovThreshold = -1,
  26775. A._fovThresholdNarrow = -1,
  26776. A);
  26777. function A(e, t) {
  26778. var i = A._panoSpaceDir
  26779. , n = A._fovThreshold
  26780. , r = A._fovThresholdNarrow
  26781. , o = Math.max(Math.min(i.dot(e.direction), 1), -1)
  26782. , a = Math.max(Math.min(i.dot(t.direction), 1), -1);
  26783. return e._dot = o,
  26784. t._dot = a,
  26785. n <= o && a < n ? -1 : o < n && n <= a ? 1 : r <= o && a < r ? -1 : o < r && r <= a ? 1 : e.panoSize > t.panoSize ? 1 : t.panoSize > e.panoSize ? -1 : -(o - a)
  26786. }
  26787. h.sortPanoTiles = function(e, t, i) {
  26788. y._panoSpaceDir.copy(i),
  26789. m.getRelativeDirection(t.quaternion, y._panoSpaceDir),
  26790. y._fovThresholdNarrow = v.getFOVDotThreshold(h.DIRECTIONAL_FOV_NARROW),
  26791. y._fovThreshold = v.getFOVDotThreshold(h.DIRECTIONAL_FOV),
  26792. e.sort(y)
  26793. }
  26794. ,
  26795. h.insertSortedPanoTile = function(e, t, i, n) {
  26796. y._panoSpaceDir.copy(n),
  26797. m.getRelativeDirection(i.quaternion, y._panoSpaceDir),
  26798. y._fovThresholdNarrow = v.getFOVDotThreshold(h.DIRECTIONAL_FOV_NARROW),
  26799. y._fovThreshold = v.getFOVDotThreshold(h.DIRECTIONAL_FOV);
  26800. for (var r = -1, o = 0; o < e.length; o++) {
  26801. if (y(t, e[o]) <= 0) {
  26802. r = o;
  26803. break
  26804. }
  26805. }
  26806. if (-1 === r)
  26807. e[e.length] = t;
  26808. else {
  26809. for (var a = e.length; r < a; a--)
  26810. e[a] = e[a - 1];
  26811. e[r] = t
  26812. }
  26813. }
  26814. ,
  26815. h.prototype.setZoomingActive = function(e) {
  26816. e !== this.zoomingActive && (this.zoomingActive = e)
  26817. }
  26818. ,
  26819. C.exports = h
  26820. }
  26821. ).call(this, "/js/tile/TilePrioritizer.js")
  26822. }
  26823. , {
  26824. "../enum/DownloadStatus": 24,
  26825. "../enum/GLCubeFaces": 25,
  26826. "../enum/ModelManagerEvents": 33,
  26827. "../enum/PanoSizeClass": 36,
  26828. "../enum/Vectors": 50,
  26829. "../enum/Viewmode": 51,
  26830. "../objects/Panorama": 148,
  26831. "../settings": 166,
  26832. "../util/browser": 182,
  26833. "../util/logger": 189,
  26834. "../util/math": 190,
  26835. "./TileUtils": 174,
  26836. events: 202,
  26837. three: 217
  26838. }],
  26839. 173: [function(e, t, i) {
  26840. "use strict";
  26841. function f(e, t) {
  26842. this.levels = t,
  26843. this.tileSize = e,
  26844. this.root = null,
  26845. this.allNodes = [],
  26846. function(e) {
  26847. e.root = function e(t, i, n) {
  26848. if (n > t.levels)
  26849. return null;
  26850. var r = new a(t,i);
  26851. t.allNodes.push(r);
  26852. for (var o = 0; o < s; o++)
  26853. r.children[o] = e(t, r, n + 1);
  26854. return r
  26855. }(e, null, 0)
  26856. }(this)
  26857. }
  26858. function a(e, t) {
  26859. this.tree = e,
  26860. this.parent = t,
  26861. this.children = [],
  26862. this.id = ++n
  26863. }
  26864. var g = (e("three"),
  26865. e("./TileUtils"),
  26866. e("../objects/Panorama"),
  26867. e("../util/panorama"),
  26868. e("events").EventEmitter,
  26869. 2)
  26870. , s = g * g;
  26871. f.TraversalType = Object.freeze({
  26872. PreOrder: 0,
  26873. PostOrder: 1
  26874. });
  26875. var n = 0;
  26876. f.getLevelCountForSize = function(e, t) {
  26877. var i = 0;
  26878. for (t < e && (t = e); !((t /= g) < e); )
  26879. i++;
  26880. return i
  26881. }
  26882. ,
  26883. f.getSizeForLevel = function(e, t) {
  26884. return Math.pow(g, t) * e
  26885. }
  26886. ,
  26887. f.prototype.getSubNode = function(e, t, i) {
  26888. (!t || e < this.tileSize) && (t = 0),
  26889. (!i || e < this.tileSize) && (i = 0),
  26890. e < this.tileSize && (e = this.tileSize);
  26891. var n = f.getLevelCountForSize(this.tileSize, e);
  26892. return function e(t, i, n, r, o) {
  26893. if (!t)
  26894. return null;
  26895. if (0 === n)
  26896. return t;
  26897. if (!t.children || 0 === t.children.length)
  26898. return null;
  26899. var a = Math.pow(g, n) / g
  26900. , s = r % a
  26901. , l = o % a
  26902. , c = Math.floor(o / a)
  26903. , h = Math.floor(r / a)
  26904. , u = c * g + h;
  26905. return e(t.children[u], i + 1, n - 1, s, l)
  26906. }(this.root, 0, n, t, i)
  26907. }
  26908. ,
  26909. f.prototype.breadthFirst = function(e) {
  26910. var t = !!(e = e || {}).nullLevelEnd
  26911. , i = e.maxLevel
  26912. , n = e.minLevel
  26913. , r = e.callback
  26914. , o = e.saveVisited
  26915. , a = []
  26916. , s = {}
  26917. , l = 0;
  26918. for (a.push(this.root),
  26919. a.push(s); 0 < a.length && !(i && i < l); ) {
  26920. var c = a.shift();
  26921. if (c === s)
  26922. (!n || n <= l) && (r && t && r(null),
  26923. o && t && o.push(null)),
  26924. 0 < a.length && a.push(s),
  26925. l++,
  26926. 0;
  26927. else {
  26928. if (c.children)
  26929. for (var h = 0; h < c.children.length; h++) {
  26930. c.children[h] && a.push(c.children[h])
  26931. }
  26932. var u = this.getFaceIndexFromNode(c);
  26933. (!n || n <= l) && (r && r(c, l, u),
  26934. o && o.push(c)),
  26935. 0
  26936. }
  26937. }
  26938. }
  26939. ,
  26940. f.prototype.getFaceIndexFromNode = function(e) {
  26941. if (!e)
  26942. return -1;
  26943. for (var t = 1, i = e, n = 0, r = 0; ; ) {
  26944. var o = i.parent;
  26945. if (!o)
  26946. break;
  26947. for (var a = -1, s = 0; s < o.children.length; s++)
  26948. o.children[s] === i && (a = s);
  26949. n = a % g * t + n,
  26950. r = Math.floor(a / g) * t + r,
  26951. t *= g,
  26952. i = o
  26953. }
  26954. return r * t + n
  26955. }
  26956. ,
  26957. f.prototype.depthFirst = function(e, t, i) {
  26958. !function e(t, i, n, r, o, a, s, l) {
  26959. if (t) {
  26960. s = s || f.TraversalType.PreOrder;
  26961. var c = r * g + n;
  26962. if (s === f.TraversalType.PreOrder && (o && o(t, i, c, n, r),
  26963. a && a.push(t)),
  26964. t.children && 0 !== t.children.length) {
  26965. for (var h = r * g, u = n * g, d = 0; d < g; d++)
  26966. for (var p = 0; p < g; p++)
  26967. e(t.children[p * g + d], i + 1, u + d, h + p, o, a, s, l);
  26968. s === f.TraversalType.PostOrder && (o && o(t, i, c, n, r),
  26969. a && a.push(t))
  26970. }
  26971. }
  26972. }(this.root, 0, 0, 0, e, t, i, this.tileSize)
  26973. }
  26974. ,
  26975. t.exports = f
  26976. }
  26977. , {
  26978. "../objects/Panorama": 148,
  26979. "../util/panorama": 191,
  26980. "./TileUtils": 174,
  26981. events: 202,
  26982. three: 217
  26983. }],
  26984. 174: [function(e, t, i) {
  26985. "use strict";
  26986. var n, a, s, p, f, g, E, l, c, h, u, d, r, o, m = e("../enum/GLCubeFaces"), _ = e("../util/MathLight"), b = {};
  26987. b.TILE_SIZE = 512,
  26988. b.FACES_PER_PANO = 6,
  26989. b.LocationOnTile = {
  26990. Center: 0,
  26991. UpperLeft: 1,
  26992. UpperRight: 2,
  26993. LowerRight: 3,
  26994. LowerLeft: 4
  26995. },
  26996. b.getTileVector = function(e, t, i, n, r, o, a, s) {
  26997. var l = e / t
  26998. , c = t / e * 2
  26999. , h = c / 2
  27000. , u = n / l * 2 - 1 + h
  27001. , d = (r = l - 1 - r) / l * 2 - 1 + h;
  27002. switch (o = o || b.LocationOnTile.Center) {
  27003. case b.LocationOnTile.UpperLeft:
  27004. u -= h,
  27005. d += h,
  27006. u += a * c;
  27007. break;
  27008. case b.LocationOnTile.UpperRight:
  27009. u += h,
  27010. d += h,
  27011. d -= a * c;
  27012. break;
  27013. case b.LocationOnTile.LowerRight:
  27014. u += h,
  27015. d -= h,
  27016. u -= a * c;
  27017. break;
  27018. case b.LocationOnTile.LowerLeft:
  27019. u -= h,
  27020. d -= h,
  27021. d += a * c;
  27022. break;
  27023. case b.LocationOnTile.Center:
  27024. }
  27025. switch (i) {
  27026. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  27027. _.setVector(s, -1, d, -u);
  27028. break;
  27029. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  27030. _.setVector(s, 1, d, u);
  27031. break;
  27032. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  27033. _.setVector(s, -u, 1, -d);
  27034. break;
  27035. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  27036. _.setVector(s, -u, -1, d);
  27037. break;
  27038. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  27039. _.setVector(s, -u, d, 1);
  27040. break;
  27041. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  27042. _.setVector(s, u, d, -1)
  27043. }
  27044. _.normalize(s)
  27045. }
  27046. ,
  27047. b.getFaceForTile = function(e, t) {
  27048. var i = b.TILE_SIZE;
  27049. e < b.TILE_SIZE && (i = e);
  27050. var n = Math.floor(e / i)
  27051. , r = n * n;
  27052. return Math.floor(t / r)
  27053. }
  27054. ,
  27055. b.getTileLocation = function(e, t, i) {
  27056. var n = b.TILE_SIZE;
  27057. e < b.TILE_SIZE && (n = e);
  27058. var r = b.getFaceForTile(e, t)
  27059. , o = Math.floor(e / n)
  27060. , a = t - r * (o * o);
  27061. i.tileX = a % o,
  27062. i.tileY = Math.floor(a / o),
  27063. i.face = r,
  27064. i.faceTileIndex = a
  27065. }
  27066. ,
  27067. b.getTileCountForSize = function(e) {
  27068. if (e <= b.TILE_SIZE)
  27069. return b.FACES_PER_PANO;
  27070. var t = Math.floor(e / b.TILE_SIZE);
  27071. return t * t * b.FACES_PER_PANO
  27072. }
  27073. ,
  27074. b.getRelativeDirection = (r = new _.Matrix4,
  27075. o = new _.Quaternion,
  27076. function(e, t) {
  27077. o.copy(e),
  27078. o.inverse(),
  27079. r.makeRotationFromQuaternion(o),
  27080. r.applyToVector3(t),
  27081. _.normalize(t)
  27082. }
  27083. ),
  27084. b.matchingTilesInDirection = (c = new _.Vector3,
  27085. h = new _.Vector3(0,0,-1),
  27086. u = new _.Quaternion,
  27087. l = {
  27088. face: -1,
  27089. faceTileIndex: -1,
  27090. tileX: -1,
  27091. tileY: -1
  27092. },
  27093. d = function(e, t, i) {
  27094. for (var n = b.getTileCountForSize(e), r = 0, o = 0; o < n; o++)
  27095. b.getTileLocation(e, o, l),
  27096. t && !t(l) || (r++,
  27097. i && (a = l,
  27098. i.push({
  27099. face: a.face,
  27100. faceTileIndex: a.faceTileIndex,
  27101. tileX: a.tileX,
  27102. tileY: a.tileY
  27103. })));
  27104. var a;
  27105. return r
  27106. }
  27107. ,
  27108. function(e, t, i, n, r, o) {
  27109. var a = t < b.TILE_SIZE ? t : b.TILE_SIZE;
  27110. if (b.getTileCountForSize(t),
  27111. !n && !r)
  27112. return d(t, null, o);
  27113. var s = !!r;
  27114. return r = r || n,
  27115. r = Math.max(0, Math.min(r, 360)),
  27116. n = Math.max(0, Math.min(n, 360)),
  27117. _.copyVector(i, c),
  27118. b.getRelativeDirection(e.quaternion, c),
  27119. s ? (u.setFromUnitVectors(c, h),
  27120. d(t, function(e) {
  27121. return b.isTileWithinFrustum(t, a, e.face, e.tileX, e.tileY, u, n, r)
  27122. }, o)) : d(t, function(e) {
  27123. return b.isTileWithinFOV(t, a, e.face, e.tileX, e.tileY, c, n)
  27124. }, o)
  27125. }
  27126. ),
  27127. b.isTileWithinFrustum = (E = new _.Vector3,
  27128. function(e, t, i, n, r, o, a, s) {
  27129. for (var l = Math.tan(.5 * s * _.RADIANS_PER_DEGREE), c = -l, h = Math.tan(.5 * a * _.RADIANS_PER_DEGREE), u = -h, d = b.mapFaceToCubemapFace(i), p = 0, f = 0, g = 0, m = 0, v = 0, y = b.LocationOnTile.Center; y <= b.LocationOnTile.LowerLeft; y++)
  27130. if (b.getTileVector(e, t, d, n, r, y, 0, E),
  27131. _.applyQuaternionToVector(o, E),
  27132. -1e-5 <= E.z)
  27133. ;
  27134. else {
  27135. var A = -1 / E.z
  27136. , C = E.x * A
  27137. , I = E.y * A;
  27138. l < I ? p++ : I < c && f++,
  27139. h < C ? g++ : C < u && m++,
  27140. v++
  27141. }
  27142. return f !== v && p !== v && g !== v && m !== v
  27143. }
  27144. ),
  27145. b.isTileWithinFOV = (p = new _.Vector3,
  27146. f = new _.Vector3(0,1,0),
  27147. g = new _.Vector3(1,0,0),
  27148. function(e, t, i, n, r, o, a) {
  27149. var s = b.mapFaceToCubemapFace(i);
  27150. if (_.cross(o, f, g),
  27151. b.getTileVector(e, t, s, n, r, b.LocationOnTile.Center, 0, p),
  27152. b.isWithinFOV(p, o, a, null))
  27153. return !0;
  27154. for (var l = a / 360, c = Math.floor(1 / l), h = 0, u = 0; u < c; u++) {
  27155. for (var d = b.LocationOnTile.UpperLeft; d <= b.LocationOnTile.LowerLeft; d++)
  27156. if (b.getTileVector(e, t, s, n, r, d, h, p),
  27157. b.isWithinFOV(p, o, a, null))
  27158. return !0;
  27159. h += l
  27160. }
  27161. return !1
  27162. }
  27163. ),
  27164. b.isWithinFOV = (a = new _.Vector3,
  27165. s = new _.Vector3,
  27166. function(e, t, i, n) {
  27167. if (_.copyVector(e, s),
  27168. n) {
  27169. _.copyVector(n, a),
  27170. _.normalize(a);
  27171. var r = _.dot(a, e);
  27172. a.x *= r,
  27173. a.y *= r,
  27174. a.z *= r,
  27175. _.subVector(s, a)
  27176. }
  27177. var o = i / 2 * _.RADIANS_PER_DEGREE;
  27178. return Math.cos(o) <= _.dot(s, t)
  27179. }
  27180. ),
  27181. b.mapFaceToCubemapFace = (n = {
  27182. 0: m.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  27183. 1: m.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  27184. 2: m.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  27185. 3: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  27186. 4: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  27187. 5: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  27188. },
  27189. function(e) {
  27190. return n[e]
  27191. }
  27192. ),
  27193. t.exports = b
  27194. }
  27195. , {
  27196. "../enum/GLCubeFaces": 25,
  27197. "../util/MathLight": 176
  27198. }],
  27199. 175: [function(i, n, e) {
  27200. (function(e) {
  27201. "use strict";
  27202. function t() {
  27203. this.list = [],
  27204. this.index = {},
  27205. Object.defineProperty(this, "length", {
  27206. get: function() {
  27207. return this.list.length
  27208. }
  27209. })
  27210. }
  27211. new (i("./common"),
  27212. i("./logger"))(e),
  27213. t.prototype.forEach = function(e) {
  27214. this.list.forEach(e)
  27215. }
  27216. ,
  27217. t.prototype.add = function(e) {
  27218. this.list.push(e),
  27219. this.index[this.getIndex(e)] = e
  27220. }
  27221. ,
  27222. t.prototype.getIndex = function(e) {
  27223. throw new Error("IndexedCollection.getIndex not implemented in subclass.")
  27224. }
  27225. ,
  27226. t.prototype.extend = function(e) {
  27227. for (var t = 0; t < e.length; t++)
  27228. this.add(e[t])
  27229. }
  27230. ,
  27231. t.prototype.get = function(e) {
  27232. return this.index[e]
  27233. }
  27234. ,
  27235. t.prototype.first = function() {
  27236. return this.list[0]
  27237. }
  27238. ,
  27239. t.prototype.last = function() {
  27240. return this.list[this.list.length - 1]
  27241. }
  27242. ,
  27243. t.prototype.reIndex = function() {
  27244. this.index = {};
  27245. var t = this;
  27246. this.forEach(function(e) {
  27247. t.index[t.getIndex(e)] = e
  27248. })
  27249. }
  27250. ,
  27251. t.prototype.filter = function(e) {
  27252. var t = this.list.filter(e);
  27253. return this.reIndex(),
  27254. t
  27255. }
  27256. ,
  27257. t.prototype.reduce = function(e, t) {
  27258. return this.list.reduce(e, t)
  27259. }
  27260. ,
  27261. t.prototype.sort = function(e) {
  27262. return this.list.sort(e)
  27263. }
  27264. ,
  27265. t.prototype.indexOf = function(e) {
  27266. for (var t = 0; t < this.list.length; ++t)
  27267. if (this.list[t] === e)
  27268. return t;
  27269. return -1
  27270. }
  27271. ,
  27272. n.exports = t
  27273. }
  27274. ).call(this, "/js/util/IndexedCollection.js")
  27275. }
  27276. , {
  27277. "./common": 185,
  27278. "./logger": 189
  27279. }],
  27280. 176: [function(e, t, i) {
  27281. "use strict";
  27282. e("../constants");
  27283. var n, r, o = {};
  27284. o.RADIANS_PER_DEGREE = Math.PI / 180,
  27285. o.DEGREES_PER_RADIAN = 180 / Math.PI,
  27286. o.Vector3 = function(e, t, i) {
  27287. this.x = e || 0,
  27288. this.y = t || 0,
  27289. this.z = i || 0
  27290. }
  27291. ,
  27292. o.Matrix4 = function() {
  27293. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  27294. 0 < arguments.length && console.error("MathLight.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  27295. }
  27296. ,
  27297. o.Matrix4.prototype = {
  27298. identity: function() {
  27299. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  27300. this
  27301. },
  27302. copy: function(e) {
  27303. return this.elements.set(e.elements),
  27304. this
  27305. },
  27306. applyToVector3: function(e) {
  27307. var t = e.x
  27308. , i = e.y
  27309. , n = e.z
  27310. , r = this.elements;
  27311. return e.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  27312. e.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  27313. e.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  27314. this
  27315. },
  27316. getInverse: function(e, t) {
  27317. var i = this.elements
  27318. , n = e.elements
  27319. , r = n[0]
  27320. , o = n[1]
  27321. , a = n[2]
  27322. , s = n[3]
  27323. , l = n[4]
  27324. , c = n[5]
  27325. , h = n[6]
  27326. , u = n[7]
  27327. , d = n[8]
  27328. , p = n[9]
  27329. , f = n[10]
  27330. , g = n[11]
  27331. , m = n[12]
  27332. , v = n[13]
  27333. , y = n[14]
  27334. , A = n[15]
  27335. , C = p * y * u - v * f * u + v * h * g - c * y * g - p * h * A + c * f * A
  27336. , I = m * f * u - d * y * u - m * h * g + l * y * g + d * h * A - l * f * A
  27337. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * A + l * p * A
  27338. , _ = m * p * h - d * v * h - m * c * f + l * v * f + d * c * y - l * p * y
  27339. , b = r * C + o * I + a * E + s * _;
  27340. if (0 == b) {
  27341. var w = "MathLight.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  27342. if (t)
  27343. throw new Error(w);
  27344. return console.warn(w),
  27345. this.identity()
  27346. }
  27347. var T = 1 / b;
  27348. return i[0] = C * T,
  27349. i[1] = (v * f * s - p * y * s - v * a * g + o * y * g + p * a * A - o * f * A) * T,
  27350. i[2] = (c * y * s - v * h * s + v * a * u - o * y * u - c * a * A + o * h * A) * T,
  27351. i[3] = (p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g) * T,
  27352. i[4] = I * T,
  27353. i[5] = (d * y * s - m * f * s + m * a * g - r * y * g - d * a * A + r * f * A) * T,
  27354. i[6] = (m * h * s - l * y * s - m * a * u + r * y * u + l * a * A - r * h * A) * T,
  27355. i[7] = (l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g) * T,
  27356. i[8] = E * T,
  27357. i[9] = (m * p * s - d * v * s - m * o * g + r * v * g + d * o * A - r * p * A) * T,
  27358. i[10] = (l * v * s - m * c * s + m * o * u - r * v * u - l * o * A + r * c * A) * T,
  27359. i[11] = (d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g) * T,
  27360. i[12] = _ * T,
  27361. i[13] = (d * v * a - m * p * a + m * o * f - r * v * f - d * o * y + r * p * y) * T,
  27362. i[14] = (m * c * a - l * v * a - m * o * h + r * v * h + l * o * y - r * c * y) * T,
  27363. i[15] = (l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f) * T,
  27364. this
  27365. },
  27366. makeRotationFromQuaternion: function(e) {
  27367. var t = this.elements
  27368. , i = e.x
  27369. , n = e.y
  27370. , r = e.z
  27371. , o = e.w
  27372. , a = i + i
  27373. , s = n + n
  27374. , l = r + r
  27375. , c = i * a
  27376. , h = i * s
  27377. , u = i * l
  27378. , d = n * s
  27379. , p = n * l
  27380. , f = r * l
  27381. , g = o * a
  27382. , m = o * s
  27383. , v = o * l;
  27384. return t[0] = 1 - (d + f),
  27385. t[4] = h - v,
  27386. t[8] = u + m,
  27387. t[1] = h + v,
  27388. t[5] = 1 - (c + f),
  27389. t[9] = p - g,
  27390. t[2] = u - m,
  27391. t[6] = p + g,
  27392. t[10] = 1 - (c + d),
  27393. t[3] = 0,
  27394. t[7] = 0,
  27395. t[11] = 0,
  27396. t[12] = 0,
  27397. t[13] = 0,
  27398. t[14] = 0,
  27399. t[15] = 1,
  27400. this
  27401. }
  27402. },
  27403. o.Quaternion = function(e, t, i, n) {
  27404. this._x = e || 0,
  27405. this._y = t || 0,
  27406. this._z = i || 0,
  27407. this._w = void 0 !== n ? n : 1
  27408. }
  27409. ,
  27410. o.Quaternion.prototype = {
  27411. get x() {
  27412. return this._x
  27413. },
  27414. set x(e) {
  27415. this._x = e
  27416. },
  27417. get y() {
  27418. return this._y
  27419. },
  27420. set y(e) {
  27421. this._y = e
  27422. },
  27423. get z() {
  27424. return this._z
  27425. },
  27426. set z(e) {
  27427. this._z = e
  27428. },
  27429. get w() {
  27430. return this._w
  27431. },
  27432. set w(e) {
  27433. this._w = e
  27434. },
  27435. copy: function(e) {
  27436. this._x = e.x,
  27437. this._y = e.y,
  27438. this._z = e.z,
  27439. this._w = e.w
  27440. },
  27441. inverse: function() {
  27442. return this.conjugate().normalize()
  27443. },
  27444. conjugate: function() {
  27445. return this._x *= -1,
  27446. this._y *= -1,
  27447. this._z *= -1,
  27448. this
  27449. },
  27450. length: function() {
  27451. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  27452. },
  27453. normalize: function() {
  27454. var e = this.length();
  27455. return 0 === e ? (this._x = 0,
  27456. this._y = 0,
  27457. this._z = 0,
  27458. this._w = 1) : (e = 1 / e,
  27459. this._x = this._x * e,
  27460. this._y = this._y * e,
  27461. this._z = this._z * e,
  27462. this._w = this._w * e),
  27463. this
  27464. },
  27465. setFromAxisAngle: function(e, t) {
  27466. var i = t / 2
  27467. , n = Math.sin(i);
  27468. return this._x = e.x * n,
  27469. this._y = e.y * n,
  27470. this._z = e.z * n,
  27471. this._w = Math.cos(i),
  27472. this
  27473. },
  27474. setFromUnitVectors: function(e, t) {
  27475. return void 0 === n && (n = new o.Vector3),
  27476. (r = o.dot(e, t) + 1) < 1e-6 ? (r = 0,
  27477. Math.abs(e.x) > Math.abs(e.z) ? o.setVector(n, -e.y, e.x, 0) : o.setVector(n, 0, -e.z, e.y)) : o.cross(e, t, n),
  27478. this._x = n.x,
  27479. this._y = n.y,
  27480. this._z = n.z,
  27481. this._w = r,
  27482. this.normalize()
  27483. },
  27484. multiply: function(e) {
  27485. return this.multiplyQuaternions(this, e)
  27486. },
  27487. premultiply: function(e) {
  27488. return this.multiplyQuaternions(e, this)
  27489. },
  27490. multiplyQuaternions: function(e, t) {
  27491. var i = e._x
  27492. , n = e._y
  27493. , r = e._z
  27494. , o = e._w
  27495. , a = t._x
  27496. , s = t._y
  27497. , l = t._z
  27498. , c = t._w;
  27499. return this._x = i * c + o * a + n * l - r * s,
  27500. this._y = n * c + o * s + r * a - i * l,
  27501. this._z = r * c + o * l + i * s - n * a,
  27502. this._w = o * c - i * a - n * s - r * l,
  27503. this
  27504. }
  27505. },
  27506. o.convertWorkshopVector = function(e) {
  27507. return new o.Vector3(-e.x,e.y,e.z)
  27508. }
  27509. ,
  27510. o.convertWorkshopQuaternion = function(e) {
  27511. return new o.Quaternion(-e.x,e.y,e.z,-e.w).multiply(new o.Quaternion(Math.sqrt(2) / 2,Math.sqrt(2) / 2,0,0))
  27512. }
  27513. ,
  27514. o.convertWorkshopOrthoZoom = function(e) {
  27515. return -1 === e ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight
  27516. }
  27517. ,
  27518. o.convertWorkshopPanoramaQuaternion = function(e) {
  27519. return new o.Quaternion(e.x,-e.y,-e.z,e.w).normalize().multiply((new o.Quaternion).setFromAxisAngle(new o.Vector3(0,1,0), 270 * o.RADIANS_PER_DEGREE))
  27520. }
  27521. ,
  27522. o.normalize = function(e) {
  27523. var t = e.x * e.x + e.y * e.y + e.z * e.z
  27524. , i = Math.sqrt(t);
  27525. e.x /= i,
  27526. e.y /= i,
  27527. e.z /= i
  27528. }
  27529. ,
  27530. o.dot = function(e, t) {
  27531. return e.x * t.x + e.y * t.y + e.z * t.z
  27532. }
  27533. ,
  27534. o.cross = function(e, t, i) {
  27535. var n = e.x
  27536. , r = e.y
  27537. , o = e.z;
  27538. i.x = r * t.z - o * t.y,
  27539. i.y = o * t.x - n * t.z,
  27540. i.z = n * t.y - r * t.x
  27541. }
  27542. ,
  27543. o.setVector = function(e, t, i, n) {
  27544. e.x = t,
  27545. e.y = i,
  27546. e.z = n
  27547. }
  27548. ,
  27549. o.copyVector = function(e, t) {
  27550. t.x = e.x,
  27551. t.y = e.y,
  27552. t.z = e.z
  27553. }
  27554. ,
  27555. o.addVector = function(e, t) {
  27556. e.x += t.x,
  27557. e.y += t.y,
  27558. e.z += t.z
  27559. }
  27560. ,
  27561. o.subVector = function(e, t) {
  27562. e.x -= t.x,
  27563. e.y -= t.y,
  27564. e.z -= t.z
  27565. }
  27566. ,
  27567. o.applyQuaternionToVector = function(e, t) {
  27568. var i = t.x
  27569. , n = t.y
  27570. , r = t.z
  27571. , o = e.x
  27572. , a = e.y
  27573. , s = e.z
  27574. , l = e.w
  27575. , c = l * i + a * r - s * n
  27576. , h = l * n + s * i - o * r
  27577. , u = l * r + o * n - a * i
  27578. , d = -o * i - a * n - s * r;
  27579. t.x = c * l + d * -o + h * -s - u * -a,
  27580. t.y = h * l + d * -a + u * -o - c * -s,
  27581. t.z = u * l + d * -s + c * -a - h * -o
  27582. }
  27583. ,
  27584. o.angleBetweenVectors = function(e, t) {
  27585. return Math.acos(o.dot(e, t))
  27586. }
  27587. ,
  27588. t.exports = o
  27589. }
  27590. , {
  27591. "../constants": 8
  27592. }],
  27593. 177: [function(c, h, e) {
  27594. (function(e) {
  27595. "use strict";
  27596. function t(e) {
  27597. this.cache = null,
  27598. this.expires = 0
  27599. }
  27600. function i() {
  27601. this.baseUrl = null,
  27602. this.cache = null,
  27603. this.expires = 0
  27604. }
  27605. function n() {
  27606. this.baseUrl = null,
  27607. this.expires = 0
  27608. }
  27609. function r(e) {
  27610. this.initialLoadingPromise = null,
  27611. this.endpoint = e + "?type=3",
  27612. this.urlContainer = null,
  27613. this.authorizationHeader = s.getAuthorizationHeader(),
  27614. this.containerClasses = [n, i, t]
  27615. }
  27616. c("./ajax");
  27617. var o = c("./logger")
  27618. , a = c("../constants")
  27619. , s = c("./showcase")
  27620. , l = (c("../ab"),
  27621. new o(e));
  27622. t.prototype = {
  27623. version: 1,
  27624. validate: function(e) {
  27625. return "catalog.json"in e && 0 < Object.keys(e).length
  27626. },
  27627. update: function(e) {
  27628. return this.cache = e,
  27629. this.expires = Date.now() + a.signedUrlDefaultExpireTime,
  27630. $.when()
  27631. },
  27632. get: function(e) {
  27633. return this.cache[e]
  27634. }
  27635. },
  27636. i.prototype = {
  27637. version: 2,
  27638. validate: function(e) {
  27639. return "catalog.json"in e && "base.url"in e && 1 < Object.keys(e).length
  27640. },
  27641. update: function(e) {
  27642. return this.baseUrl = e["base.url"],
  27643. this.cache = e,
  27644. this.expires = Date.now() + a.signedUrlDefaultExpireTime,
  27645. $.when()
  27646. },
  27647. get: function(e) {
  27648. var t = this.cache[e];
  27649. return t ? this.baseUrl.replace("{{filename}}", e) + t : null
  27650. }
  27651. },
  27652. n.prototype = {
  27653. version: 3,
  27654. validate: function(e) {
  27655. return e.templates && e.catalog_file && (!e.expires || 1e3 * e.expires > Date.now())
  27656. },
  27657. update: function(e) {
  27658. return this.baseUrl = e.templates[0],
  27659. e.expires ? this.expires = 1e3 * e.expires : this.expires = Date.now() + a.signedUrlDefaultExpireTime,
  27660. $.when()
  27661. },
  27662. get: function(e) {
  27663. return this.baseUrl.replace("{{filename}}", e)
  27664. }
  27665. },
  27666. r.prototype = {
  27667. init: function() {
  27668. return this.initialLoadingPromise || (setInterval(function() {
  27669. var e = this.urlContainer ? this.urlContainer.expires : Date.now();
  27670. Date.now() + a.signedUrlRefreshBuffer > e && (l.debug("Refreshing urls..."),
  27671. this.refresh().done(function() {
  27672. l.debug("Refreshed")
  27673. }).fail(function() {
  27674. l.error("Failed url refresh, urls might go stale soon")
  27675. }))
  27676. }
  27677. .bind(this), a.signedUrlCheckInterval),
  27678. this.initialLoadingPromise = this.refresh()),
  27679. this.initialLoadingPromise
  27680. },
  27681. refresh: function(e) {
  27682. return {},
  27683. $.Deferred().resolve()
  27684. },
  27685. get: function(e) {
  27686. return window.MP_PREFETCHED_MODELDATA.files.templates[0].replace("{{filename}}", e)
  27687. }
  27688. },
  27689. h.exports = r
  27690. }
  27691. ).call(this, "/js/util/ModelUrls.js")
  27692. }
  27693. , {
  27694. "../ab": 3,
  27695. "../constants": 8,
  27696. "./ajax": 181,
  27697. "./logger": 189,
  27698. "./showcase": 193
  27699. }],
  27700. 178: [function(l, c, e) {
  27701. (function(e) {
  27702. "use strict";
  27703. function t() {
  27704. i.call(this),
  27705. this.neighbourMap = {},
  27706. this.map = null
  27707. }
  27708. var f, g, m, v, y, A, C, I, E, _, b, w = l("three"), n = l("./common"), a = l("../settings"), r = l("../objects/Panorama"), o = (a = l("../settings"),
  27709. l("./aStar")), T = new (l("./logger"))(e), i = l("./IndexedCollection"), s = l("./transitions");
  27710. n.inherit(t, i),
  27711. t.prototype.getIndex = function(e) {
  27712. return e.id
  27713. }
  27714. ,
  27715. t.prototype.find = function(e, t) {
  27716. var i = n.filterAll(this.list, e);
  27717. return 0 === i.length ? null : (t && t.forEach(function(e) {
  27718. i = n.stableSort(i, e)
  27719. }),
  27720. i[0])
  27721. }
  27722. ,
  27723. t.prototype.sortByScore = function(e, t) {
  27724. var i = n.filterAll(this.list, e);
  27725. return 0 === i.length ? null : i = i.map(function(i) {
  27726. return {
  27727. pano: i,
  27728. score: t.reduce(function(e, t) {
  27729. return e + t(i)
  27730. }, 0)
  27731. }
  27732. }).sort(function(e, t) {
  27733. return t.score - e.score
  27734. })
  27735. }
  27736. ,
  27737. t.prototype.lowestByScore = function(e, t, i) {
  27738. return this.findRankedByScore(0, e, t, i)
  27739. }
  27740. ,
  27741. t.prototype.findRankedByScore = function(e, t, i, n) {
  27742. n && (n.candidates = null,
  27743. n.pano = null),
  27744. e = e || 0;
  27745. var r = this.sortByScore(t, i);
  27746. return !r || 0 === r.length || e >= r.length ? null : (n && (n.candidates = r,
  27747. n.pano = r[e].pano),
  27748. r[e].pano)
  27749. }
  27750. ,
  27751. t.prototype.showPanoScores = function(e) {
  27752. this.list.forEach(function(e) {
  27753. e.removeTextSprite()
  27754. });
  27755. var t = 6344768;
  27756. e.forEach(function(e) {
  27757. e.pano.addTextSprite(e.score.toFixed(2), t),
  27758. t = 16428055
  27759. })
  27760. }
  27761. ,
  27762. t.prototype.isNeighbour = function(e, t) {
  27763. return this.neighbourMap[e.id][t.id]
  27764. }
  27765. ,
  27766. t.prototype.getNeighbours = function(e) {
  27767. return this.neighbourMap[e.id]
  27768. }
  27769. ,
  27770. t.prototype.setNeighbour = function(e, t, i) {
  27771. return this.neighbourMap[e.id] || (this.neighbourMap[e.id] = {}),
  27772. this.neighbourMap[t.id] || (this.neighbourMap[t.id] = {}),
  27773. this.neighbourMap[e.id][e.id] = !0,
  27774. this.neighbourMap[t.id][t.id] = !0,
  27775. this.neighbourMap[e.id][t.id] = i,
  27776. this.neighbourMap[t.id][e.id] = i,
  27777. this.neighbourMap[e.id]
  27778. }
  27779. ,
  27780. t.prototype.findClosest = function(e, t) {
  27781. var i = [r.filters.isPanoAligned()];
  27782. return t && i.push(r.filters.inDirection(e, t, .75)),
  27783. this.find(i, [r.sortFunctions.distanceToPoint(e)])
  27784. }
  27785. ,
  27786. t.prototype.dualNeighbors = function(e, t) {
  27787. var i, n = [];
  27788. for (i in this.neighbourMap[e.id])
  27789. this.neighbourMap[t.id][i] && n.push(i);
  27790. return n
  27791. }
  27792. ,
  27793. t.prototype.populate_path_graph = function() {
  27794. var e, t, i, n, r, o, a, s, l = Date.now(), c = {}, h = 0, u = new w.Vector3(0,0,0);
  27795. for (e = 0; e < this.list.length; e += 1) {
  27796. for (t in s = !(a = {}),
  27797. i = (r = this.list[e]).neighbourPanos || r.findNeighourPanos())
  27798. if (i[t]) {
  27799. o = this.index[t],
  27800. u.copy(r.floorPosition),
  27801. u.sub(o.floorPosition);
  27802. var d = Math.sqrt(u.x * u.x + u.z * u.z)
  27803. , p = (Math.abs(u.y),
  27804. Math.max(d, .01),
  27805. Math.max(0, Math.abs(u.y) - .2));
  27806. n = 0 < p ? (1,
  27807. p = Math.pow(4 * p, 2),
  27808. d = Math.pow(d, 2),
  27809. Math.sqrt(p * p + d * d)) : (1,
  27810. u.length()),
  27811. a[o.id] = n,
  27812. s = !0
  27813. }
  27814. s ? c[r.id] = a : h += 1
  27815. }
  27816. this.map = c,
  27817. T.info("graph ready in " + (Date.now() - l) + "ms, " + h + " had no neighbors")
  27818. }
  27819. ,
  27820. t.prototype.aStarSearch = function(e, t) {
  27821. var i = Date.now()
  27822. , n = new o({
  27823. start: e,
  27824. isEnd: function(e) {
  27825. return e === t
  27826. },
  27827. neighbor: function(e) {
  27828. var t = e.neighbourPanos || e.findNeighourPanos()
  27829. , i = [];
  27830. for (var n in t)
  27831. i.push(this.index[n]);
  27832. return i
  27833. }
  27834. .bind(this),
  27835. distance: function(e, t) {
  27836. return this.map[e.id][t.id]
  27837. }
  27838. .bind(this),
  27839. heuristic: function(e, t) {
  27840. return 1
  27841. }
  27842. .bind(this),
  27843. hash: function(e) {
  27844. return e.id
  27845. },
  27846. timeout: 5e3
  27847. });
  27848. if (T.debug("A* search in " + (Date.now() - i) + "ms"),
  27849. "success" !== n.status)
  27850. return T.debug("Did not find A* path from " + e + " to " + t),
  27851. null;
  27852. T.debug("Total cost " + n.cost.toPrecision(3) + ", " + n.path.length + " steps");
  27853. var r = [];
  27854. return n.path.forEach(function(e) {
  27855. r.push(e.id)
  27856. }),
  27857. r
  27858. }
  27859. ,
  27860. t.prototype.includeNodesNearPath = (f = new w.Vector3,
  27861. g = new w.Vector3,
  27862. m = new w.Vector3,
  27863. v = new w.Vector3,
  27864. y = new w.Vector3,
  27865. A = new w.Vector3,
  27866. C = new w.Vector3,
  27867. I = new w.Vector3,
  27868. E = [],
  27869. _ = new w.Vector3,
  27870. b = new w.Vector3,
  27871. function(e, t) {
  27872. if (e)
  27873. for (var i = function(e, t, i) {
  27874. return y.copy(t).sub(e),
  27875. y.dot(i)
  27876. }, n = function(e, t) {
  27877. return i(_, e.position, m) - i(_, t.position, m)
  27878. }, r = 0; r < e.length - 1; ) {
  27879. var o = e[r]
  27880. , a = e[r + 1]
  27881. , s = this.index[o]
  27882. , l = this.index[a];
  27883. _.copy(s.position),
  27884. b.copy(l.position),
  27885. E.length = 0,
  27886. f.copy(b).sub(_),
  27887. m.copy(f).normalize();
  27888. for (var c = 0; c < this.list.length; c++) {
  27889. var h = this.list[c];
  27890. y.copy(h.position).sub(_);
  27891. var u = y.dot(m);
  27892. 0 < u && (C.copy(m),
  27893. C.multiplyScalar(u),
  27894. A.copy(y),
  27895. A.sub(C),
  27896. A.length() < t && (g.copy(f).negate(),
  27897. v.copy(g).normalize(),
  27898. I.copy(h.position).sub(b),
  27899. 0 < I.dot(v) && E.push(h)))
  27900. }
  27901. if (0 < E.length) {
  27902. E.sort(n);
  27903. for (var d = e.length + E.length - 1; d >= r + E.length; d--)
  27904. e[d] = e[d - E.length];
  27905. for (var p = 0; p < E.length; p++)
  27906. e[p + r + 1] = E[p].id
  27907. }
  27908. r += E.length + 1
  27909. }
  27910. }
  27911. ),
  27912. t.prototype.fadeMarkerOpacity = function(e, t) {
  27913. var i = void 0 === e ? a.panorama.markerOpacity : e
  27914. , n = this.list.findIndex(function(e) {
  27915. return e.marker
  27916. });
  27917. if (!(n < 0)) {
  27918. var r = this.list[n].marker.material.opacity;
  27919. if (r !== e) {
  27920. var o = i - r;
  27921. s.trigger({
  27922. func: function(e, t) {
  27923. var i = r + e * o;
  27924. this.forEach(function(e) {
  27925. e.marker && (e.marker.material.opacity = i)
  27926. })
  27927. }
  27928. .bind(this),
  27929. duration: void 0 === t ? a.markerOpacityTransitionTime : t,
  27930. name: "_fpm"
  27931. })
  27932. }
  27933. }
  27934. }
  27935. ,
  27936. c.exports = t
  27937. }
  27938. ).call(this, "/js/util/PanoramaCollection.js")
  27939. }
  27940. , {
  27941. "../objects/Panorama": 148,
  27942. "../settings": 166,
  27943. "./IndexedCollection": 175,
  27944. "./aStar": 180,
  27945. "./common": 185,
  27946. "./logger": 189,
  27947. "./transitions": 195,
  27948. three: 217
  27949. }],
  27950. 179: [function(e, t, i) {
  27951. "use strict";
  27952. function n() {
  27953. this.actionSequence = [],
  27954. this.actionSequenceInProgress = !1
  27955. }
  27956. function r(e, t, i, n) {
  27957. c.trackAlways("zoom_" + e, {
  27958. from: t,
  27959. to: i,
  27960. pano: n
  27961. })
  27962. }
  27963. var o, a, s, l, c = e("../analytics");
  27964. n.prototype.reset = function(e) {
  27965. this.actionSequenceInProgress = !1,
  27966. this.actionSequence.length = 0
  27967. }
  27968. ,
  27969. n.prototype.addZoomAction = (a = o = null,
  27970. s = !1,
  27971. l = function() {
  27972. if (o = null,
  27973. 0 < this.actionSequence.length) {
  27974. var e = this.actionSequence[0].start
  27975. , t = this.actionSequence[this.actionSequence.length - 1].end;
  27976. 1 === e ? function(e, t) {
  27977. r("initial", 1, e, t)
  27978. }(t, a) : function(e, t, i) {
  27979. r("followup", e, t, i)
  27980. }(e, t, a)
  27981. }
  27982. this.reset()
  27983. }
  27984. ,
  27985. function(e, t, i) {
  27986. if (e !== t) {
  27987. s || (l = l.bind(this),
  27988. s = !0),
  27989. o && (window.clearTimeout(o),
  27990. o = null),
  27991. i === a && this.actionSequenceInProgress || (this.reset(),
  27992. a = i),
  27993. this.actionSequenceInProgress = !0;
  27994. var n = {
  27995. start: e,
  27996. end: t
  27997. };
  27998. this.actionSequence.push(n),
  27999. o = window.setTimeout(l, 150)
  28000. }
  28001. }
  28002. ),
  28003. t.exports = n
  28004. }
  28005. , {
  28006. "../analytics": 4
  28007. }],
  28008. 180: [function(e, t, i) {
  28009. "use strict";
  28010. function g(e) {
  28011. if (void 0 === e.parent)
  28012. return [e.data];
  28013. var t = g(e.parent);
  28014. return t.push(e.data),
  28015. t
  28016. }
  28017. function m(e) {
  28018. return e.toString()
  28019. }
  28020. function v(e, t) {
  28021. return e.f - t.f
  28022. }
  28023. var y = e("Set")
  28024. , A = e("heap")
  28025. , C = e("dict");
  28026. t.exports = function(e) {
  28027. void 0 === e.timeout && (e.timeout = 1 / 0);
  28028. var t = e.hash || m
  28029. , i = {
  28030. data: e.start,
  28031. g: 0,
  28032. h: e.heuristic(e.start)
  28033. }
  28034. , n = i;
  28035. i.f = i.h;
  28036. var r = new y
  28037. , o = new A(v)
  28038. , a = C();
  28039. o.push(i),
  28040. a.set(t(i.data), i);
  28041. for (var s = new Date; o.size(); ) {
  28042. if (new Date - s > e.timeout)
  28043. return {
  28044. status: "timeout",
  28045. cost: n.g,
  28046. path: g(n)
  28047. };
  28048. var l = o.pop();
  28049. if (a.delete(t(l.data)),
  28050. e.isEnd(l.data))
  28051. return {
  28052. status: "success",
  28053. cost: l.g,
  28054. path: g(l)
  28055. };
  28056. r.add(t(l.data));
  28057. for (var c = e.neighbor(l.data), h = 0; h < c.length; h++) {
  28058. var u = c[h];
  28059. if (!r.contains(t(u))) {
  28060. var d = l.g + e.distance(l.data, u)
  28061. , p = a.get(t(u))
  28062. , f = !1;
  28063. if (void 0 === p)
  28064. p = {
  28065. data: u
  28066. },
  28067. a.set(t(u), p);
  28068. else {
  28069. if (p.g < d)
  28070. continue;
  28071. f = !0
  28072. }
  28073. p.parent = l,
  28074. p.g = d,
  28075. p.h = e.heuristic(u),
  28076. p.f = d + p.h,
  28077. p.h < n.h && (n = p),
  28078. f ? o.heapify() : o.push(p)
  28079. }
  28080. }
  28081. }
  28082. return {
  28083. status: "noPath",
  28084. cost: n.g,
  28085. path: g(n)
  28086. }
  28087. }
  28088. }
  28089. , {
  28090. Set: 196,
  28091. dict: 210,
  28092. heap: 211
  28093. }],
  28094. 181: [function(i, n, e) {
  28095. (function(e) {
  28096. "use strict";
  28097. function s(e, t, i) {
  28098. function n() {
  28099. l.warn("Retrying ", t),
  28100. s(e, t, i).done(a.resolve.bind(a)).progress(a.notify.bind(a)).fail(a.reject.bind(a))
  28101. }
  28102. var r = function(e, t, i) {
  28103. var n = new XMLHttpRequest;
  28104. if (i && "withCredentials"in n)
  28105. n.open(e, t, i);
  28106. else if ("undefined" != typeof XDomainRequest)
  28107. (n = new XDomainRequest).open(e, t);
  28108. else {
  28109. if (i)
  28110. throw "Browser does not support CORS!";
  28111. n.open(e, t)
  28112. }
  28113. return n
  28114. }(e, t, !1);
  28115. if ((i = i || {}).retries = void 0 !== i.retries ? i.retries : 0,
  28116. i.retry = void 0 !== i.retry ? i.retry : "get" === e.toLowerCase(),
  28117. i.responseType)
  28118. if (-1 < ["arraybuffer", "text", "json"].indexOf(i.responseType))
  28119. r.responseType = i.responseType;
  28120. else {
  28121. if ("image/jpeg" !== i.responseType)
  28122. throw new Error('reponseType can only be one of "arraybuffer", "text" or "json", "image/jpeg"');
  28123. r.responseType = "arraybuffer"
  28124. }
  28125. if ("json" === i.responseType && r.setRequestHeader("Accept", "application/json"),
  28126. i.auth && r.setRequestHeader("Authorization", i.auth),
  28127. "object" == typeof i.data && (i.data = JSON.stringify(i.data),
  28128. r.setRequestHeader("Content-Type", "application/json")),
  28129. "object" == typeof i.headers)
  28130. for (var o in i.headers)
  28131. r.setRequestHeader(o, i.headers[o]);
  28132. var a = $.Deferred();
  28133. return r.onreadystatechange = function(e) {
  28134. if (4 === this.readyState)
  28135. if (500 <= this.status && this.status <= 600 && i.retry && i.retries < 3)
  28136. i.retries++,
  28137. setTimeout(n, 1e3);
  28138. else if (200 === this.status) {
  28139. var t = function(e, t) {
  28140. var i = e.response;
  28141. if ("json" === t && "object" != typeof i)
  28142. try {
  28143. i = JSON.parse(e.responseText)
  28144. } catch (e) {
  28145. return void a.reject({
  28146. error: "Failed parsing JSON"
  28147. })
  28148. }
  28149. else if ("image/jpeg" === t) {
  28150. var n = new Uint8Array(e.response)
  28151. , r = new Blob([n],{
  28152. type: "image/jpeg"
  28153. })
  28154. , o = URL.createObjectURL(r);
  28155. (i = new Image).src = o,
  28156. i.crossOrigin = "Anonymous",
  28157. i.onload = function() {
  28158. URL.revokeObjectURL(o)
  28159. }
  28160. }
  28161. return i
  28162. }(this, i.responseType);
  28163. a.resolve(t)
  28164. } else
  28165. a.reject(this)
  28166. }
  28167. ,
  28168. r.onprogress = function(e) {
  28169. a.notify(e)
  28170. }
  28171. ,
  28172. r.send(i.data),
  28173. a.promise()
  28174. }
  28175. function o(e, t) {
  28176. var i = e + "__" + (t.responseType || null) + "__" + (t.auth || null) + "__" + (t.prefetchFrom || null);
  28177. return t.headers && function(t) {
  28178. return Object.keys(t).sort().map(function(e) {
  28179. return {
  28180. key: e,
  28181. value: t[e]
  28182. }
  28183. })
  28184. }(t.headers).forEach(function(e) {
  28185. i += "__" + e.key + ":" + e.value
  28186. }),
  28187. i
  28188. }
  28189. var t = i("./logger")
  28190. , a = i("../ab")
  28191. , l = new t(e);
  28192. window.URL = window.URL || window.webkitURL,
  28193. window.MP_REQUEST_CACHE = window.MP_REQUEST_CACHE || {},
  28194. window.MP_PREFETCHED_MODELDATA = window.MP_PREFETCHED_MODELDATA || {},
  28195. n.exports = {
  28196. get: function(e, t) {
  28197. var i, n = void 0 === (t = t || {}).cache || t.cache;
  28198. if (n) {
  28199. var r = function(e, t) {
  28200. return window.MP_REQUEST_CACHE ? window.MP_REQUEST_CACHE[o(e, t)] : null
  28201. }(e, t);
  28202. if (r)
  28203. return r
  28204. }
  28205. return i = t.prefetchFrom && window.MP_PREFETCHED_MODELDATA[t.prefetchFrom] ? $.when(window.MP_PREFETCHED_MODELDATA[t.prefetchFrom]) : s("GET", e, t),
  28206. n && function(e, t, i) {
  28207. window.MP_REQUEST_CACHE && (window.MP_REQUEST_CACHE[o(e, t)] = i)
  28208. }(e, t, i),
  28209. i
  28210. },
  28211. post: function(e, t) {
  28212. return s("POST", e, t)
  28213. },
  28214. patch: function(e, t) {
  28215. return s("PATCH", e, t)
  28216. },
  28217. getImage: function(e, t) {
  28218. function i() {
  28219. l.warn("Retrying ", e),
  28220. o.getImage(e, t - 1).done(n.resolve.bind(n)).progress(n.notify.bind(n)).fail(n.reject.bind(n))
  28221. }
  28222. var n = $.Deferred()
  28223. , r = new Image
  28224. , o = this;
  28225. return e = a.changeIfImageOptimzing(e),
  28226. null != t || (t = 3),
  28227. r.onerror = function() {
  28228. 0 < t ? setTimeout(i, 1e3) : n.reject()
  28229. }
  28230. ,
  28231. r.onload = function() {
  28232. n.resolve(r)
  28233. }
  28234. ,
  28235. r.crossOrigin = "anonymous",
  28236. r.src = e,
  28237. n
  28238. }
  28239. }
  28240. }
  28241. ).call(this, "/js/util/ajax.js")
  28242. }
  28243. , {
  28244. "../ab": 3,
  28245. "./logger": 189
  28246. }],
  28247. 182: [function(e, t, i) {
  28248. "use strict";
  28249. function n(e, t) {
  28250. var i = window.navigator.userAgent.match(e);
  28251. return i = i ? i[1].split(t) : [],
  28252. {
  28253. major: parseInt(i[0]) || 0,
  28254. minor: parseInt(i[1]) || 0,
  28255. patch: parseInt(i[2]) || 0
  28256. }
  28257. }
  28258. var r = e("../exception/DeviceMismatchException");
  28259. t.exports = {
  28260. isFullscreen: function() {
  28261. return document.fullscreenElement || document.mozFullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement
  28262. },
  28263. supportsFullscreen: function() {
  28264. return document.fullscreenEnabled || document.mozFullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled || document.msFullscreenEnabled
  28265. },
  28266. isPointerLocked: function() {
  28267. return document.pointerLockElement || document.mozPointerLockElement || document.webkitPointerLockElement
  28268. },
  28269. requestFullscreen: function(e, t) {
  28270. e.requestFullscreen ? e.requestFullscreen() : e.mozRequestFullScreen ? e.mozRequestFullScreen() : e.webkitRequestFullscreen ? e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT) : e.msRequestFullscreen && e.msRequestFullscreen(),
  28271. t && $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", browser.requestPointerLock)
  28272. },
  28273. requestPointerLock: function() {
  28274. var e;
  28275. if (document.fullscreenElement)
  28276. e = document.fullscreenElement();
  28277. else if (document.mozFullscreenElement)
  28278. e = document.mozFullscreenElement();
  28279. else if (document.mozFullScreenElement)
  28280. e = document.mozFullScreenElement();
  28281. else {
  28282. if (!document.webkitFullscreenElement)
  28283. return;
  28284. e = document.webkitFullscreenElement()
  28285. }
  28286. e.requestPointerLock = e.requestPointerLock || e.mozRequestPointerLock || e.webkitRequestPointerLock,
  28287. e.requestPointerLock(),
  28288. $(document).off("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", this)
  28289. },
  28290. exitPointerLock: function() {
  28291. document.exitPointerLock = document.exitPointerLock || document.mozExitPointerLock || document.webkitExitPointerLock,
  28292. document.exitPointerLock()
  28293. },
  28294. exitFullscreen: function() {
  28295. document.exitFullscreen ? document.exitFullscreen() : document.msExitFullscreen ? document.msExitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.webkitExitFullscreen && document.webkitExitFullscreen()
  28296. },
  28297. details: function() {
  28298. var e = navigator.userAgent.match("(Firefox|Chrome|Safari)/([\\d]+)");
  28299. return e ? {
  28300. name: e[1],
  28301. version: parseInt(e[2]),
  28302. platform: navigator.platform
  28303. } : {}
  28304. },
  28305. is: function(e) {
  28306. return this.details() && this.details().name === e
  28307. },
  28308. inIframe: function() {
  28309. return window.parent !== window
  28310. },
  28311. aspectRatio: function() {
  28312. var e = $("#player").width() / $("#player").height();
  28313. return isFinite(e) ? e : 0
  28314. },
  28315. userAgent: function() {
  28316. return window.navigator.userAgent
  28317. },
  28318. isMobile: function() {
  28319. var e = navigator.userAgent || navigator.vendor || window.opera;
  28320. 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))
  28321. },
  28322. isLandscape: function() {
  28323. return this.isMobile && 1 < this.aspectRatio()
  28324. },
  28325. isSmallScreen: function() {
  28326. return screen.width / window.devicePixelRatio < 240
  28327. },
  28328. detectIE: function() {
  28329. return -1 !== window.navigator.userAgent.indexOf("MSIE ") || !!navigator.userAgent.match(/Trident.*rv\:11\./)
  28330. },
  28331. detectSafari: function() {
  28332. return -1 !== window.navigator.userAgent.indexOf("Safari") && !this.detectChrome()
  28333. },
  28334. detectFirefox: function() {
  28335. return -1 !== window.navigator.userAgent.indexOf("Firefox")
  28336. },
  28337. detectChrome: function() {
  28338. return -1 !== window.navigator.userAgent.indexOf("Chrome") && !this.detectOpera()
  28339. },
  28340. detectOpera: function() {
  28341. return -1 !== window.navigator.userAgent.indexOf("OPR")
  28342. },
  28343. detectIOS: function() {
  28344. return this.detectIPhone() || this.detectIPad() || this.detectIPod()
  28345. },
  28346. detectIPad: function() {
  28347. var e = window.navigator.userAgent;
  28348. return /iPad/.test(e)
  28349. },
  28350. detectIPod: function() {
  28351. var e = window.navigator.userAgent;
  28352. return /iPod/.test(e)
  28353. },
  28354. detectIPhone: function() {
  28355. var e = window.navigator.userAgent;
  28356. return /iPhone/.test(e)
  28357. },
  28358. detectAndroid: function() {
  28359. return -1 !== window.navigator.userAgent.indexOf("Android")
  28360. },
  28361. detectAndroidMobile: function() {
  28362. var e = window.navigator.userAgent;
  28363. return this.detectAndroid() && -1 !== e.indexOf("Mobile")
  28364. },
  28365. detectSamsungNative: function() {
  28366. var e = window.navigator.userAgent;
  28367. return -1 !== e.indexOf("SM-G900H") || -1 !== e.indexOf("GT-I9500") || -1 !== e.indexOf("SM-N900")
  28368. },
  28369. detectSamsungS6: function() {
  28370. return -1 !== window.navigator.userAgent.indexOf("SM-G92")
  28371. },
  28372. detectHUAWEI5X: function() {
  28373. return -1 !== window.navigator.userAgent.indexOf("KIW-TL00H")
  28374. },
  28375. detectWebVR: function() {
  28376. return !(!window.navigator.getVRDisplays || !window.VRDisplay)
  28377. },
  28378. getVRDisplay: function() {
  28379. var t = $.Deferred();
  28380. return this.detectWebVR() ? (navigator.getVRDisplays().then(function(e) {
  28381. 1 <= e.length && t.resolve(e[0]),
  28382. t.reject(null)
  28383. }),
  28384. t) : t.reject(null)
  28385. },
  28386. iosVersion: function() {
  28387. if (!this.detectIOS())
  28388. throw new r("Did not detect an iDevice");
  28389. return n(/((?:\d+\_?){1,3}) like Mac OS/, "_")
  28390. },
  28391. androidVersion: function() {
  28392. if (!this.detectAndroid())
  28393. throw new r("Did not detect an Android based device");
  28394. return n(/Android ((?:\d+\.?){1,3})/, ".")
  28395. },
  28396. valueFromCookie: function(e, t) {
  28397. var i = new RegExp(e + "=([0-9a-f]+)(; ?|$)").exec(document.cookie);
  28398. if (!i)
  28399. return t;
  28400. var n = i[1];
  28401. return "boolean" == typeof t ? "true" === n || "1" === n : "number" == typeof t ? parseFloat(n) : n
  28402. },
  28403. valueFromHash: function(e, t) {
  28404. var i = new RegExp("[#&?]" + e + "=([^#&?]*)").exec(window.location.href);
  28405. if (!i)
  28406. return t;
  28407. var n = i[1];
  28408. return "boolean" == typeof t ? "true" === n || "1" === n : "number" == typeof t ? parseFloat(n) : window.decodeURIComponent(n)
  28409. }
  28410. }
  28411. }
  28412. , {
  28413. "../exception/DeviceMismatchException": 56
  28414. }],
  28415. 183: [function(i, n, e) {
  28416. (function(e) {
  28417. "use strict";
  28418. var o = i("../controls/serializer")
  28419. , a = i("../util/math")
  28420. , s = i("./browser")
  28421. , l = i("../enum/Viewmode")
  28422. , t = i("../util/logger")
  28423. , c = i("three")
  28424. , h = new t(e);
  28425. n.exports = {
  28426. getStartCameraOptions: function(e, t) {
  28427. var i = function(e) {
  28428. var t = s.valueFromHash("start", "")
  28429. , i = {};
  28430. if ("" !== t) {
  28431. h.debug("Start override found in parameters, trying to parse..."),
  28432. i = function(e) {
  28433. return o.deserialize(e)
  28434. }(t) || {};
  28435. var n = s.valueFromHash("tag", null);
  28436. n && (i.tag = n),
  28437. i.panoId && (i.pano = e.get(i.panoId))
  28438. }
  28439. return i
  28440. }(t);
  28441. if (0 < Object.keys(i).length)
  28442. return i;
  28443. if (e.heroImage)
  28444. i = function(e, t) {
  28445. if (!e.heroImage || !e.heroImage.metadata.camera_position)
  28446. return {};
  28447. var i = {}
  28448. , n = e.heroImage.metadata;
  28449. h.debug("Using start position from thumbnail image"),
  28450. i.position = n.camera_position,
  28451. i.quaternion = n.camera_quaternion;
  28452. try {
  28453. i.mode = l.convertWorkshopModeInt(n.camera_mode),
  28454. i.mode === l.PANORAMA ? i.pano = t.get(n.scan_id) : i.floorVisibility = n.floor_visibility
  28455. } catch (e) {
  28456. h.debug(e.message)
  28457. }
  28458. return i
  28459. }(e, t);
  28460. else if (window.MP_PREFETCHED_MODELDATA.camera_start) {
  28461. var n = window.MP_PREFETCHED_MODELDATA.camera_start;
  28462. try {
  28463. 0 < Object.keys(n).length && !a.isEmptyQuaternion(n.camera.quaternion) && (i.mode = l.convertWorkshopModeInt(n.mode),
  28464. i.position = (new c.Vector3).fromArray(n.camera.position),
  28465. i.quaternion = (new c.Quaternion).fromArray(n.camera.quaternion),
  28466. i.zoom = a.convertWorkshopOrthoZoom(n.camera.zoom),
  28467. n.pano && (i.pano = t.get(n.pano.uuid) || t.findClosest(i.position),
  28468. h.debug("Using camera_start"),
  28469. h.debug("Modeldata pano: ", i.pano.quaternion),
  28470. h.debug("Camera start pano: ", n.pano.quaternion)),
  28471. i.mode !== l.PANORAMA && (i.floorVisibility = e.heroImage.metadata.floor_visibility));
  28472. } catch (e) {
  28473. h.warn(e.message)
  28474. if(i.mode == "panorama" && !i.pano){
  28475. i.pano = t.list[0]
  28476. }
  28477. }
  28478. }
  28479. if (e.outsideAllowed() || i.mode === l.PANORAMA || (i = {}),
  28480. i.mode === l.MESH && i.position && (i.mode = l.PANORAMA,
  28481. i.pano = t.findClosest(i.position) ,
  28482. i.quaternion = i.pano.quaternion),
  28483. 0 === Object.keys(i).length) {
  28484. var r = t.list[0];
  28485. r && (i.mode = l.PANORAMA,
  28486. i.pano = r,
  28487. i.position = r.position,
  28488. i.quaternion = r.quaternion,
  28489. h.info("Starting at 1st pano " + r.id))
  28490. }
  28491. return i.mode = i.mode || l.DOLLHOUSE,
  28492. i
  28493. }
  28494. }
  28495. }
  28496. ).call(this, "/js/util/camera.js")
  28497. }
  28498. , {
  28499. "../controls/serializer": 14,
  28500. "../enum/Viewmode": 51,
  28501. "../util/logger": 189,
  28502. "../util/math": 190,
  28503. "./browser": 182,
  28504. three: 217
  28505. }],
  28506. 184: [function(e, t, i) {
  28507. "use strict";
  28508. function r(e, t, i) {
  28509. var n = t
  28510. , r = i;
  28511. return 2 * Math.atan(Math.tan(e * a.RADIANS_PER_DEGREE / 2) * (n / r)) * a.DEGREES_PER_RADIAN
  28512. }
  28513. function o(e, t, i) {
  28514. var n = t
  28515. , r = i;
  28516. return 2 * Math.atan(Math.tan(e * a.RADIANS_PER_DEGREE / 2) * (r / n)) * a.DEGREES_PER_RADIAN
  28517. }
  28518. var a = e("./MathLight");
  28519. t.exports = {
  28520. clampVFOV: function(e, t, i, n) {
  28521. return t < r(e, i, n) ? o(t, i, n) : e
  28522. },
  28523. getHFOVForCamera: function(e, t, i) {
  28524. return r(e.fov, t, i)
  28525. },
  28526. getHFOVFromVFOV: r,
  28527. getVFOVFromHFOV: o
  28528. }
  28529. }
  28530. , {
  28531. "./MathLight": 176
  28532. }],
  28533. 185: [function(e, t, i) {
  28534. "use strict";
  28535. var a = e("three");
  28536. t.exports = {
  28537. delayOneFrame: function(e) {
  28538. window.setTimeout(e, 1)
  28539. },
  28540. normalizeUrl: function(e) {
  28541. return e.replace("https://", "http://")
  28542. },
  28543. domainFromUrl: function(e) {
  28544. var t = /^([^:]*:\/\/)?(www\.)?([^\/]+)/.exec(e);
  28545. return t ? t[3] : e
  28546. },
  28547. average: function(e, t) {
  28548. if (0 === e.length)
  28549. return null;
  28550. for (var i = 0, n = 0, r = 0; r < e.length; r++) {
  28551. i += t ? e[r][t] : e[r],
  28552. n++
  28553. }
  28554. return i / n
  28555. },
  28556. countUnique: function(e) {
  28557. for (var t = {}, i = 0; i < e.length; i++)
  28558. t[e[i]] = 1 + (t[e[i]] || 0);
  28559. return Object.keys(t).length
  28560. },
  28561. averageVectors: function(e, t) {
  28562. var i = new a.Vector3;
  28563. if (0 === e.length)
  28564. return i;
  28565. for (var n = 0, r = 0; r < e.length; r++) {
  28566. var o = t ? e[r][t] : e[r];
  28567. i.add(o),
  28568. n++
  28569. }
  28570. return i.divideScalar(n)
  28571. },
  28572. equalLists: function(e, t) {
  28573. if (e.length !== t.length)
  28574. return !1;
  28575. for (var i = 0; i < e.length; i++)
  28576. if (e[i] !== t[i])
  28577. return !1;
  28578. return !0
  28579. },
  28580. lowerMedian: function(e, t) {
  28581. return 0 === e.length ? null : (t = t || 2,
  28582. e.sort(function(e, t) {
  28583. return e - t
  28584. }),
  28585. e[Math.floor(e.length / t)])
  28586. },
  28587. stableSort: function(e, n) {
  28588. return e.map(function(e, t) {
  28589. return {
  28590. value: e,
  28591. index: t
  28592. }
  28593. }).sort(function(e, t) {
  28594. var i = n(e.value, t.value);
  28595. return 0 !== i ? i : e.index - t.index
  28596. }).map(function(e) {
  28597. return e.value
  28598. })
  28599. },
  28600. filterAll: function(e, i) {
  28601. return e.filter(function(t) {
  28602. return i.every(function(e) {
  28603. return e(t)
  28604. })
  28605. })
  28606. },
  28607. formatDate: function(e) {
  28608. return [e.getFullYear(), e.getMonth() + 1, e.getDate()].join("-")
  28609. },
  28610. formatDatetime: function(e) {
  28611. return [e.getFullYear(), e.getMonth() + 1, e.getDate(), e.getHours(), e.getMinutes()].join("-")
  28612. },
  28613. randomString: function(e) {
  28614. for (var t = "", i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", n = 0; n < e; n++)
  28615. t += i.charAt(Math.floor(Math.random() * i.length));
  28616. return t
  28617. },
  28618. uint8ToBase64: function(e, t) {
  28619. t && "number" == typeof t || (t = 8192);
  28620. for (var i = [], n = 0; n < e.length; n += t)
  28621. i.push(String.fromCharCode.apply(null, e.subarray(n, n + t)));
  28622. return btoa(i.join(""))
  28623. },
  28624. uuid4: function e(t) {
  28625. return t ? (t ^ 16 * Math.random() >> t / 4).toString(16) : ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, e)
  28626. },
  28627. nth: function(e) {
  28628. return 1 === (e %= 10) ? e + "st" : 2 === e ? e + "nd" : 3 === e ? e + "rd" : e + "th"
  28629. },
  28630. extendObject: function(t, i) {
  28631. return Object.keys(i).forEach(function(e) {
  28632. t[e] = i[e]
  28633. }),
  28634. t
  28635. },
  28636. deepExtend: function e(t) {
  28637. t = t || {};
  28638. for (var i = 1; i < arguments.length; i++) {
  28639. var n = arguments[i];
  28640. if (n)
  28641. for (var r in n)
  28642. n.hasOwnProperty(r) && ("object" == typeof n[r] ? t[r] = e(t[r], n[r]) : t[r] = n[r])
  28643. }
  28644. return t
  28645. },
  28646. inherit: function(e, t) {
  28647. e.prototype = Object.create(t.prototype),
  28648. e.prototype.constructor = e
  28649. },
  28650. extend: function(e, t) {
  28651. for (var i in t.prototype)
  28652. e.prototype[i] = t.prototype[i]
  28653. }
  28654. },
  28655. Math.sign = function(e) {
  28656. return e < 0 ? -1 : 1
  28657. }
  28658. }
  28659. , {
  28660. three: 217
  28661. }],
  28662. 186: [function(e, t, i) {
  28663. "use strict";
  28664. var r = {
  28665. linearTween: function(e, t, i, n) {
  28666. return i * e / n + t
  28667. },
  28668. easeInQuad: function(e, t, i, n) {
  28669. return i * (e /= n) * e + t
  28670. },
  28671. easeOutQuad: function(e, t, i, n) {
  28672. return -i * (e /= n) * (e - 2) + t
  28673. },
  28674. easeInOutQuad: function(e, t, i, n) {
  28675. return (e /= n / 2) < 1 ? i / 2 * e * e + t : -i / 2 * (--e * (e - 2) - 1) + t
  28676. },
  28677. easeInCubic: function(e, t, i, n) {
  28678. return i * (e /= n) * e * e + t
  28679. },
  28680. easeOutCubic: function(e, t, i, n) {
  28681. return e /= n,
  28682. i * (--e * e * e + 1) + t
  28683. },
  28684. easeInOutCubic: function(e, t, i, n) {
  28685. return (e /= n / 2) < 1 ? i / 2 * e * e * e + t : i / 2 * ((e -= 2) * e * e + 2) + t
  28686. },
  28687. easeInQuart: function(e, t, i, n) {
  28688. return i * (e /= n) * e * e * e + t
  28689. },
  28690. easeOutQuart: function(e, t, i, n) {
  28691. return e /= n,
  28692. -i * (--e * e * e * e - 1) + t
  28693. },
  28694. easeInOutQuart: function(e, t, i, n) {
  28695. return (e /= n / 2) < 1 ? i / 2 * e * e * e * e + t : -i / 2 * ((e -= 2) * e * e * e - 2) + t
  28696. },
  28697. easeInQuint: function(e, t, i, n) {
  28698. return i * (e /= n) * e * e * e * e + t
  28699. },
  28700. easeOutQuint: function(e, t, i, n) {
  28701. return e /= n,
  28702. i * (--e * e * e * e * e + 1) + t
  28703. },
  28704. easeInOutQuint: function(e, t, i, n) {
  28705. return (e /= n / 2) < 1 ? i / 2 * e * e * e * e * e + t : i / 2 * ((e -= 2) * e * e * e * e + 2) + t
  28706. },
  28707. easeInSine: function(e, t, i, n) {
  28708. return -i * Math.cos(e / n * (Math.PI / 2)) + i + t
  28709. },
  28710. easeOutSine: function(e, t, i, n) {
  28711. return i * Math.sin(e / n * (Math.PI / 2)) + t
  28712. },
  28713. easeInOutSine: function(e, t, i, n) {
  28714. return -i / 2 * (Math.cos(Math.PI * e / n) - 1) + t
  28715. },
  28716. easeInExpo: function(e, t, i, n) {
  28717. return i * Math.pow(2, 10 * (e / n - 1)) + t
  28718. },
  28719. easeOutExpo: function(e, t, i, n) {
  28720. return i * (1 - Math.pow(2, -10 * e / n)) + t
  28721. },
  28722. easeInOutExpo: function(e, t, i, n) {
  28723. return (e /= n / 2) < 1 ? i / 2 * Math.pow(2, 10 * (e - 1)) + t : (e--,
  28724. i / 2 * (2 - Math.pow(2, -10 * e)) + t)
  28725. },
  28726. easeInCirc: function(e, t, i, n) {
  28727. return e /= n,
  28728. -i * (Math.sqrt(1 - e * e) - 1) + t
  28729. },
  28730. easeOutCirc: function(e, t, i, n) {
  28731. return e /= n,
  28732. e--,
  28733. i * Math.sqrt(1 - e * e) + t
  28734. },
  28735. easeInOutCirc: function(e, t, i, n) {
  28736. return (e /= n / 2) < 1 ? -i / 2 * (Math.sqrt(1 - e * e) - 1) + t : (e -= 2,
  28737. i / 2 * (Math.sqrt(1 - e * e) + 1) + t)
  28738. },
  28739. easeInElastic: function(e, t, i, n) {
  28740. var r = 1.70158
  28741. , o = 0
  28742. , a = i;
  28743. return 0 === e ? t : 1 == (e /= n) ? t + i : (o = o || .3 * n,
  28744. r = a < Math.abs(i) ? (a = i,
  28745. o / 4) : o / (2 * Math.PI) * Math.asin(i / a),
  28746. -a * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o) + t)
  28747. },
  28748. easeOutElastic: function(e, t, i, n) {
  28749. var r = 1.70158
  28750. , o = 0
  28751. , a = i;
  28752. return 0 === e ? t : 1 == (e /= n) ? t + i : (o = o || .3 * n,
  28753. r = a < Math.abs(i) ? (a = i,
  28754. o / 4) : o / (2 * Math.PI) * Math.asin(i / a),
  28755. a * Math.pow(2, -10 * e) * Math.sin((e * n - r) * (2 * Math.PI) / o) + i + t)
  28756. },
  28757. easeInOutElastic: function(e, t, i, n) {
  28758. var r = 1.70158
  28759. , o = 0
  28760. , a = i;
  28761. return 0 === e ? t : 2 == (e /= n / 2) ? t + i : (o = o || n * (.3 * 1.5),
  28762. r = a < Math.abs(i) ? (a = i,
  28763. o / 4) : o / (2 * Math.PI) * Math.asin(i / a),
  28764. e < 1 ? a * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o) * -.5 + t : a * Math.pow(2, -10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o) * .5 + i + t)
  28765. },
  28766. easeInBack: function(e, t, i, n, r) {
  28767. return void 0 === r && (r = 1.70158),
  28768. i * (e /= n) * e * ((r + 1) * e - r) + t
  28769. },
  28770. easeOutBack: function(e, t, i, n, r) {
  28771. return void 0 === r && (r = 1.70158),
  28772. i * ((e = e / n - 1) * e * ((r + 1) * e + r) + 1) + t
  28773. },
  28774. easeInOutBack: function(e, t, i, n, r) {
  28775. return void 0 === r && (r = 1.70158),
  28776. (e /= n / 2) < 1 ? i / 2 * (e * e * ((1 + (r *= 1.525)) * e - r)) + t : i / 2 * ((e -= 2) * e * ((1 + (r *= 1.525)) * e + r) + 2) + t
  28777. },
  28778. easeOutBounce: function(e, t, i, n) {
  28779. 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
  28780. },
  28781. easeInBounce: function(e, t, i, n) {
  28782. return i - r.easeOutBounce(n - e, 0, i, n) + t
  28783. },
  28784. easeInOutBounce: function(e, t, i, n) {
  28785. return e < n / 2 ? .5 * r.easeInBounce(2 * e, 0, i, n) + t : .5 * r.easeOutBounce(x, 2 * e - n, 0, i, n) + .5 * i + t
  28786. }
  28787. };
  28788. t.exports = r
  28789. }
  28790. , {}],
  28791. 187: [function(e, t, i) {
  28792. "use strict";
  28793. function n() {
  28794. this.events = [],
  28795. this.valid = !1
  28796. }
  28797. var r = e("../enum/Joystick");
  28798. n.prototype.push = function(e, t) {
  28799. this.events.push({
  28800. direction: e,
  28801. pano: t
  28802. }),
  28803. this.valid = !0
  28804. }
  28805. ,
  28806. n.prototype.pop = function(e) {
  28807. var t = this.events.pop();
  28808. return this.events.length < 1 && (this.valid = !1),
  28809. t
  28810. }
  28811. ,
  28812. n.prototype.peek = function() {
  28813. return this.events.length ? this.events[this.events.length - 1] : {
  28814. direction: null,
  28815. pano: null
  28816. }
  28817. }
  28818. ,
  28819. n.prototype.invalidate = function() {
  28820. this.events = [],
  28821. this.valid = !1
  28822. }
  28823. ,
  28824. n.prototype.reversePano = function(e) {
  28825. if (!this.valid)
  28826. return null;
  28827. var t = this.peek();
  28828. return r.opposite(e) === t.direction ? (this.pop(),
  28829. t.pano) : null
  28830. }
  28831. ,
  28832. t.exports = n
  28833. }
  28834. , {
  28835. "../enum/Joystick": 29
  28836. }],
  28837. 188: [function(e, t, i) {
  28838. "use strict";
  28839. t.exports = {
  28840. vector: function(t, i) {
  28841. var n = t.clone();
  28842. return i = i.clone(),
  28843. function(e) {
  28844. t.set(n.x * (1 - e) + i.x * e, n.y * (1 - e) + i.y * e, n.z * (1 - e) + i.z * e)
  28845. }
  28846. },
  28847. quaternion: function(t, i) {
  28848. var n = t.clone();
  28849. return function(e) {
  28850. t.copy(n).slerp(i, e)
  28851. }
  28852. },
  28853. property: function(t, i, n, r) {
  28854. var o = t[i];
  28855. return function(e) {
  28856. t[i] = o * (1 - e) + n * e,
  28857. r && r(t[i])
  28858. }
  28859. },
  28860. uniform: function(t, i, n) {
  28861. var r = t.material.uniforms[i].value;
  28862. return function(e) {
  28863. t.material.uniforms[i] && (t.material.uniforms[i].value = r * (1 - e) + n * e)
  28864. }
  28865. },
  28866. matrix4: function(o, a) {
  28867. var s = o.clone();
  28868. return function(e) {
  28869. for (var t = o.elements, i = s.elements, n = a.elements, r = 0; r < 16; r++)
  28870. t[r] = i[r] * (1 - e) + n[r] * e
  28871. }
  28872. },
  28873. allUniforms: function(e, t, i) {
  28874. var n = e.map(function(e) {
  28875. return this.uniform(e, t, i)
  28876. }
  28877. .bind(this));
  28878. return function(t) {
  28879. n.forEach(function(e) {
  28880. e(t)
  28881. })
  28882. }
  28883. }
  28884. }
  28885. }
  28886. , {}],
  28887. 189: [function(e, t, i) {
  28888. "use strict";
  28889. function h(n) {
  28890. var e, t, i, r, o = n.split("/"), a = "[" + o[o.length - 1].replace(".js", "") + "]", s = {};
  28891. if (h.consoleEnabled) {
  28892. var l = function(e) {
  28893. $("#debug-console").append("<p>" + e + "</p>"),
  28894. $("#debug-console")[0].scrollTop = $("#debug-console")[0].scrollHeight
  28895. };
  28896. e = function(e) {
  28897. l(Array.prototype.slice.call(arguments).join(" "))
  28898. }
  28899. ,
  28900. t = function(e) {
  28901. l(Array.prototype.slice.call(arguments).join(" "))
  28902. }
  28903. ,
  28904. i = function(e) {
  28905. l("WARN: " + Array.prototype.slice.call(arguments).join(" "))
  28906. }
  28907. ,
  28908. r = function(e) {
  28909. l("ERROR: " + Array.prototype.slice.call(arguments).join(" "))
  28910. }
  28911. } else
  28912. console.log ? (e = console.log,
  28913. t = console.info ? console.info : console.log,
  28914. i = console.warn ? console.warn : console.log,
  28915. r = console.error ? console.error : console.log) : e = t = i = r = function() {}
  28916. ;
  28917. function c(e) {
  28918. return [a, h.timestamp()].concat(Array.prototype.slice.call(e))
  28919. }
  28920. return {
  28921. debug: function() {
  28922. h.level >= h.levels.debug && e.apply(console, c(arguments))
  28923. },
  28924. info: function() {
  28925. h.level >= h.levels.info && t.apply(console, c(arguments))
  28926. },
  28927. warn: function() {
  28928. (function(e, t) {
  28929. if (u) {
  28930. var i = Array.prototype.slice.call(e).join(" ");
  28931. u.captureMessage(i, {
  28932. level: t,
  28933. path: n,
  28934. timestamp: h.timestamp()
  28935. })
  28936. }
  28937. }
  28938. )(arguments, "warn"),
  28939. h.level >= h.levels.warn && i.apply(console, c(arguments))
  28940. },
  28941. error: function() {
  28942. (function(e, t) {
  28943. if (u) {
  28944. var i = Array.prototype.slice.call(e).join(" ");
  28945. u.captureException(new Error(i), {
  28946. level: t,
  28947. path: n,
  28948. timestamp: h.timestamp()
  28949. })
  28950. }
  28951. }
  28952. )(arguments, "error"),
  28953. h.level >= h.levels.error && r.apply(console, c(arguments))
  28954. },
  28955. v3str: function(e, t) {
  28956. var i = void 0 === t ? 2 : t;
  28957. return "(" + e.x.toPrecision(i) + ", " + e.y.toPrecision(i) + ", " + e.z.toPrecision(i) + ")"
  28958. },
  28959. eulstr: function(e, t) {
  28960. var i = void 0 === t ? 2 : t;
  28961. return "(" + THREE.Math.radToDeg(e.x).toPrecision(i) + ", " + THREE.Math.radToDeg(e.y).toPrecision(i) + ", " + THREE.Math.radToDeg(e.z).toPrecision(i) + ' "' + e.order + '")'
  28962. },
  28963. time: function(e) {
  28964. h.level >= h.levels.debug && (s[e] = Date.now())
  28965. },
  28966. timeEnd: function(e) {
  28967. if (h.level >= h.levels.debug) {
  28968. var t = s[e];
  28969. if (!t)
  28970. return;
  28971. var i = (Date.now() - t) / 1e3;
  28972. this.debug(e, i + "s")
  28973. }
  28974. }
  28975. }
  28976. }
  28977. var u = window.Raven;
  28978. h.timestamp = function() {
  28979. return (Date.now() - window.navigationStart) / 1e3 + "s"
  28980. }
  28981. ,
  28982. h.level = (h.levels = {
  28983. debug: 3,
  28984. info: 2,
  28985. warn: 1,
  28986. error: 0
  28987. }).info,
  28988. t.exports = h
  28989. }
  28990. , {}],
  28991. 190: [function(e, t, i) {
  28992. "use strict";
  28993. var o = e("three")
  28994. , r = e("../enum/GLCubeFaces");
  28995. e("../constants");
  28996. t.exports = {
  28997. convertVisionVector: function(e) {
  28998. return new o.Vector3(e.x,e.z,-e.y)
  28999. },
  29000. convertVisionQuaternion: function(e) {
  29001. return new o.Quaternion(e.x,e.z,-e.y,e.w).multiply((new o.Quaternion).setFromAxisAngle(new o.Vector3(0,1,0), o.Math.degToRad(90)))
  29002. },
  29003. convertWorkshopVector: function(e) {
  29004. return new o.Vector3(-e.x,e.y,e.z)
  29005. },
  29006. convertWorkshopQuaternion: function(e) {
  29007. return new o.Quaternion(-e.x,e.y,e.z,-e.w).multiply(new o.Quaternion(Math.sqrt(2) / 2,Math.sqrt(2) / 2,0,0))
  29008. },
  29009. convertWorkshopPanoramaQuaternion: function(e) {
  29010. return new o.Quaternion(e.x,-e.y,-e.z,e.w).normalize().multiply((new o.Quaternion).setFromAxisAngle(new o.Vector3(0,1,0), o.Math.degToRad(270)))
  29011. },
  29012. convertWorkshopOrthoZoom: function(e) {
  29013. return -1 === e ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight
  29014. },
  29015. toPrecision: function(e, t) {
  29016. function i(e, t) {
  29017. var i = Math.pow(10, t);
  29018. return Math.round(e * i) / i
  29019. }
  29020. if (e instanceof Array) {
  29021. for (var n = 0; n < e.length; n++)
  29022. e[n] = i(e[n], t);
  29023. return e
  29024. }
  29025. return i(e, t)
  29026. },
  29027. isEmptyQuaternion: function(e) {
  29028. return 0 === Math.abs(e.x) && 0 === Math.abs(e.y) && 0 === Math.abs(e.z) && 0 === Math.abs(e.w)
  29029. },
  29030. projectPositionToCanvas: function(e, t, i) {
  29031. (i = i || new o.Vector3).copy(e);
  29032. var n = .5 * $("#player").width()
  29033. , r = .5 * $("#player").height();
  29034. return i.project(t),
  29035. i.x = i.x * n + n,
  29036. i.y = -i.y * r + r,
  29037. i
  29038. },
  29039. convertScreenPositionToNDC: function(e, t, i) {
  29040. return (i = i || new o.Vector2).x = e / $("#player").width() * 2 - 1,
  29041. i.y = -t / $("#player").height() * 2 + 1,
  29042. i
  29043. },
  29044. constrainedTurn: function(e) {
  29045. var t = e % (2 * Math.PI);
  29046. return t > Math.PI ? t -= 2 * Math.PI : t < -Math.PI ? t += 2 * Math.PI : t
  29047. },
  29048. getFOVDotThreshold: function(e) {
  29049. return Math.cos(o.Math.degToRad(e / 2))
  29050. },
  29051. transform2DForwardVectorByCubeFace: function(e, t, i, n) {
  29052. switch (e) {
  29053. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  29054. i.set(1, t.y, t.x);
  29055. break;
  29056. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  29057. i.set(-1, t.y, -t.x);
  29058. break;
  29059. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  29060. i.set(-t.x, 1, -t.y);
  29061. break;
  29062. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  29063. i.set(-t.x, -1, t.y);
  29064. break;
  29065. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  29066. i.set(-t.x, t.y, 1);
  29067. break;
  29068. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  29069. i.set(t.x, t.y, -1)
  29070. }
  29071. n && i.normalize()
  29072. },
  29073. //add:
  29074. getPos2d : function(point, camera, dom){
  29075. var camera = camera ;
  29076. var dom = dom;
  29077. var pos = point.clone().project(camera) //比之前hotspot的计算方式写得简单 project用于3转2(求法同shader); unproject用于2转3 :new r.Vector3(e.x, e.y, -1).unproject(this.camera);
  29078. var x,y;
  29079. x = (pos.x + 1) / 2 * dom.clientWidth;
  29080. y = (1 - (pos.y + 1) / 2) * dom.clientHeight;
  29081. var inSight = x <= dom.clientWidth && x >= 0
  29082. && y <= dom.clientHeight && y >= 0
  29083. return {
  29084. pos: new THREE.Vector2(x,y),
  29085. vector: pos,
  29086. trueSide : pos.z<1, //trueSide为false时,即使在屏幕范围内可见,也是反方向的另一个不可以被渲染的点 参见Tag.update
  29087. inSight : inSight //在屏幕范围内可见
  29088. };
  29089. },
  29090. }
  29091. }
  29092. , {
  29093. "../constants": 8,
  29094. "../enum/GLCubeFaces": 25,
  29095. three: 217
  29096. }],
  29097. 191: [function(e, t, i) {
  29098. "use strict";
  29099. function o(e) {
  29100. return r[e]
  29101. }
  29102. var n = e("../enum/GLCubeFaces")
  29103. , a = [0, 1, 2, 3, 4, 5]
  29104. , r = {
  29105. 0: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  29106. 1: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  29107. 2: n.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  29108. 3: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  29109. 4: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  29110. 5: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  29111. };
  29112. t.exports = {
  29113. mapFaceToCubemapFace: o,
  29114. getCubemapUrls: function(i, n, r) {
  29115. return a.map(function(e, t) {
  29116. return i.get("pan/" + r + "/" + n + "_skybox" + o(e) + ".jpg")
  29117. }
  29118. .bind(this))
  29119. }
  29120. }
  29121. }
  29122. , {
  29123. "../enum/GLCubeFaces": 25
  29124. }],
  29125. 192: [function(e, t, i) {
  29126. "use strict";
  29127. t.exports = {
  29128. captureErrors: function(e, t, i) {
  29129. if ("Raven"in window) {
  29130. Raven.config(e, t).install(),
  29131. i && Raven.setTagsContext(i);
  29132. var n = console.warn
  29133. , r = console.error;
  29134. console.warn = function() {
  29135. var e = Array.prototype.slice.call(arguments);
  29136. Raven.captureMessage(e.join(" "), {
  29137. level: "warning"
  29138. }),
  29139. n.apply(console, e)
  29140. }
  29141. ,
  29142. console.error = function() {
  29143. var e = Array.prototype.slice.call(arguments);
  29144. Raven.captureException(new Error(e.join(" ")), {
  29145. level: "error"
  29146. }),
  29147. r.apply(console, e)
  29148. }
  29149. } else
  29150. console.error("Raven not found, not capturing errors.")
  29151. }
  29152. }
  29153. }
  29154. , {}],
  29155. 193: [function(c, h, e) {
  29156. (function(e) {
  29157. "use strict";
  29158. var i, n = c("./browser"), r = c("../constants"), o = c("url"), t = c("./logger"), a = c("three"), s = new t(e), l = {
  29159. getAuthorizationHeader: function() {
  29160. var e = n.valueFromHash("auth");
  29161. if (e)
  29162. return e.replace(",", " ");
  29163. var t = n.valueFromCookie("token");
  29164. return t ? "Token " + t : null
  29165. },
  29166. parseSidUrl: function(e) {
  29167. var t, i;
  29168. if (t = g_Prefix,
  29169. (e = e || "").match(/^https?/)) {
  29170. o.parse(e);
  29171. t = g_Prefix,
  29172. i = e
  29173. } else
  29174. i = (t = g_Prefix) + "data/" + e;
  29175. return {
  29176. urlBase: t,
  29177. urlModel: i,
  29178. urlFiles: i + (i.match(/\/$/) ? "files" : "/files"),
  29179. urlThumb: i + (i.match(/\/$/) ? "thumb" : "/thumb")
  29180. }
  29181. },
  29182. getModelIDFromQueryString: function() {
  29183. return n.valueFromHash("model") || n.valueFromHash("m")
  29184. },
  29185. /* normalizeModeldata: function(e, i) {
  29186. e = JSON.parse(JSON.stringify(e));
  29187. var n = null;
  29188. if (e.images.forEach(function(t) {
  29189. if (t.metadata) {
  29190. if ("string" == typeof t.metadata)
  29191. try {
  29192. t.metadata = JSON.parse(t.metadata)
  29193. } catch (e) {
  29194. s.warn("Unable to parse image metadata"),
  29195. t.metadata = null
  29196. }
  29197. else
  29198. "object" == typeof t.metadata && s.debug("image.metadata already a JSON object");
  29199. t.metadata.camera_position instanceof Array ? (t.metadata.camera_position = (new a.Vector3).fromArray(t.metadata.camera_position),
  29200. t.metadata.camera_quaternion = (new a.Quaternion).fromArray(t.metadata.camera_quaternion)) : (t.metadata.camera_quaternion && (t.metadata.camera_quaternion = i.convertWorkshopQuaternion(t.metadata.camera_quaternion)),
  29201. t.metadata.camera_position && (t.metadata.camera_position = i.convertWorkshopVector(t.metadata.camera_position)),
  29202. t.metadata.zoom = t.metadata.zoom || 1),
  29203. !n && e.icon && e.icon === t.sid && (n = t.metadata)
  29204. }
  29205. }),
  29206. n && n.camera_quaternion && n.camera_position && n.scan_position && n.scan_quaternion) {
  29207. var t = {};
  29208. t.pano = {
  29209. quaternion: i.convertWorkshopPanoramaQuaternion(n.scan_quaternion),
  29210. position: i.convertWorkshopVector(n.scan_position),
  29211. uuid: n.scan_id
  29212. },
  29213. t.camera = {
  29214. quaternion: n.camera_quaternion,
  29215. position: n.camera_position
  29216. },
  29217. e.startPano = t
  29218. }
  29219. return e
  29220. }, */
  29221. normalizeModeldata: function(e, t) {//xzw 修改导览images数据
  29222. e = JSON.parse(JSON.stringify(e));
  29223. var i = null;
  29224. var deal = function(n) {
  29225. if(!n.metadata) return;
  29226. if ("string" == typeof n.metadata)
  29227. try {
  29228. n.metadata = JSON.parse(n.metadata)
  29229. } catch (e) {
  29230. s.warn("Unable to parse image metadata"),
  29231. n.metadata = null
  29232. }
  29233. else{
  29234. "object" == typeof n.metadata && s.debug("image.metadata already a JSON object");
  29235. }
  29236. if(n.metadata.camera_position instanceof Array){//xzw 改的格式
  29237. n.metadata.camera_position = new a.Vector3().fromArray(n.metadata.camera_position);
  29238. n.metadata.camera_quaternion = new a.Quaternion().fromArray(n.metadata.camera_quaternion);
  29239. }else{
  29240. n.metadata.camera_position = new a.Vector3().copy(n.metadata.camera_position)
  29241. n.metadata.camera_quaternion = new a.Quaternion().copy(n.metadata.camera_quaternion)
  29242. /* n.metadata.camera_quaternion && (n.metadata.camera_quaternion = i.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  29243. n.metadata.camera_position && (n.metadata.camera_position = i.convertWorkshopVector(n.metadata.camera_position)) */
  29244. }
  29245. !i && e.icon && e.icon === n.sid && (i = n.metadata)
  29246. }
  29247. //改
  29248. e.images.forEach(info=>{
  29249. if(info.locations){
  29250. info.locations.forEach(a=>deal(a))
  29251. }else{
  29252. deal(info)
  29253. }
  29254. })
  29255. //icon初始视角的:
  29256. if(i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
  29257. var n = {};
  29258. n.pano = {
  29259. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  29260. position: t.convertWorkshopVector(i.scan_position),
  29261. uuid: i.scan_id
  29262. },
  29263. n.camera = {
  29264. quaternion: i.camera_quaternion,
  29265. position: i.camera_position
  29266. },
  29267. e.startPano = n
  29268. }
  29269. return e
  29270. },
  29271. visionVersionToInt: (i = new RegExp(["(?:[0-9.]+\\.){1,4}", "([0-9]+)", "[^\\.]*$"].join("")),
  29272. function(e) {
  29273. if (!e)
  29274. throw new Error("Vision version is required");
  29275. var t = i.exec(e);
  29276. if (null === t)
  29277. throw new Error("String is not a vision version: " + e);
  29278. return parseInt(t[1])
  29279. }
  29280. ),
  29281. modelDataPromisesTiles: function(e) {
  29282. var t = e.vision_version || window.MP_PREFETCHED_MODELDATA.vision_version;
  29283. if (t)
  29284. try {
  29285. return l.visionVersionToInt(t) >= l.visionVersionToInt(r.visionTilingStartVersion)
  29286. } catch (e) {
  29287. s.warn("Invalid vision version: " + t)
  29288. }
  29289. return !1
  29290. }
  29291. };
  29292. h.exports = l
  29293. }
  29294. ).call(this, "/js/util/showcase.js")
  29295. }
  29296. , {
  29297. "../constants": 8,
  29298. "./browser": 182,
  29299. "./logger": 189,
  29300. three: 217,
  29301. url: 208
  29302. }],
  29303. 194: [function(e, t, i) {
  29304. "use strict";
  29305. var r = e("../util/ajax")
  29306. , o = e("three")
  29307. , a = e("../settings")
  29308. , s = {};
  29309. t.exports = {
  29310. load: function(e, t, i) {
  29311. var n = s[e];
  29312. return n ? t && setTimeout(function() {
  29313. t(n)
  29314. }, 1) : (n = new o.Texture,
  29315. a.minimalMemoryMode && (n.minFilter = o.LinearFilter,
  29316. n.magFilter = o.LinearFilter,
  29317. n.generateMipmaps = !1),
  29318. n.sourceFile = e,
  29319. s[e] = n,
  29320. r.getImage(e).then(function(e) {
  29321. n.image = e,
  29322. n.needsUpdate = !0,
  29323. t && t(n)
  29324. }).fail(i)),
  29325. n
  29326. },
  29327. loadBase64: function(e, t) {
  29328. t = t || "png";
  29329. var i = new o.Texture;
  29330. return i.image = document.createElement("img"),
  29331. i.image.setAttribute("src", "data:image/" + t + ";base64," + e),
  29332. a.minimalMemoryMode && (i.minFilter = o.LinearFilter,
  29333. i.magFilter = o.LinearFilter,
  29334. i.generateMipmaps = !1),
  29335. i.needsUpdate = !0,
  29336. i
  29337. },
  29338. isLoaded: function(e) {
  29339. return !!s[e]
  29340. }
  29341. }
  29342. window.Texture = t.exports
  29343. }
  29344. , {
  29345. "../settings": 166,
  29346. "../util/ajax": 181,
  29347. three: 217
  29348. }],
  29349. 195: [function(e, t, i) {
  29350. "use strict";
  29351. var l = e("./easing");
  29352. t.exports = {
  29353. globalDone: null,
  29354. funcs: [],
  29355. counter: 0,
  29356. uniqueID: 0,
  29357. start: function(e, t, i, n, r, o, a) {
  29358. return n = n || 0,
  29359. this.funcs.push({
  29360. func: e,
  29361. current: -n * Math.abs(t),
  29362. duration: (1 - Math.max(n, 0)) * Math.abs(t),
  29363. done: i,
  29364. easing: r || l.linearTween,
  29365. cycling: t < 0,
  29366. running: !0,
  29367. debug: n < 0,
  29368. name: o || "T" + this.counter,
  29369. id: void 0 === a ? this.counter : a,
  29370. paused: !1
  29371. }),
  29372. e(0, 16),
  29373. this.counter += 1,
  29374. e
  29375. },
  29376. trigger: function(e) {
  29377. var t = void 0 === e.delayRatio ? 0 : e.delayRatio
  29378. , i = e.func || function() {}
  29379. , n = void 0 === e.duration ? 0 : e.duration;
  29380. void 0 !== e.cycling && e.cycling && (n = -Math.abs(n));
  29381. var r = e.done || null
  29382. , o = e.easing || l.linearTween
  29383. , a = e.name || "R" + this.counter
  29384. , s = void 0 === e.id ? this.counter : e.id;
  29385. return this.start(i, n, r, t, o, a, s)
  29386. },
  29387. setTimeout: function(e, t, i) {
  29388. var n = void 0 === i ? this.counter : i;
  29389. return this.trigger({
  29390. done: e,
  29391. duration: void 0 === t ? 0 : t,
  29392. name: "O" + this.counter,
  29393. id: n
  29394. })
  29395. },
  29396. pause: function() {
  29397. this.paused = !0
  29398. },
  29399. resume: function() {
  29400. this.paused = !1
  29401. },
  29402. update: function(n) {
  29403. this.funcs.forEach(function(e) {
  29404. if (!(e.paused || (e.current += 1e3 * n,
  29405. e.current < 0)))
  29406. if (e.current >= e.duration && !e.cycling) {
  29407. var t = e.easing(1, 0, 1, 1);
  29408. e.func(t, 1e3 * n),
  29409. e.done && e.done(),
  29410. e.running = !1
  29411. } else {
  29412. var i = e.easing(e.current % e.duration / e.duration, 0, 1, 1);
  29413. (e.func(i, 1e3 * n) || !1) && (e.done && e.done(),
  29414. e.running = !1)
  29415. }
  29416. });
  29417. var e = this.funcs.length;
  29418. this.funcs = this.funcs.filter(function(e) {
  29419. return e.running
  29420. });
  29421. var t = this.funcs.length;
  29422. if (0 < e && 0 === t && this.globalDone) {
  29423. var i = this.globalDone;
  29424. this.globalDone = null,
  29425. i()
  29426. }
  29427. },
  29428. adjustSpeed: function(e, t) {
  29429. for (var i = this.getById(e), n = 0; n < i.length; n++) {
  29430. var r = i[n];
  29431. r.duration /= t,
  29432. r.current /= t
  29433. }
  29434. },
  29435. getById: function(t) {
  29436. return this.funcs.filter(function(e) {
  29437. return t === e.id
  29438. })
  29439. },
  29440. get: function(e) {
  29441. for (var t = 0; t < this.funcs.length; t += 1)
  29442. if (this.funcs[t].func === e)
  29443. return this.funcs[t];
  29444. return null
  29445. },
  29446. isRunning: function(e) {
  29447. var t = this.get(e);
  29448. return null !== t && t.running
  29449. },
  29450. countActive: function() {
  29451. for (var e = 0, t = 0; t < this.funcs.length; t += 1)
  29452. e += this.funcs[t].running;
  29453. return e
  29454. },
  29455. listActive: function() {
  29456. for (var e = [], t = 0; t < this.funcs.length; t += 1)
  29457. this.funcs[t].running && e.push(this.funcs[t].name);
  29458. return e
  29459. },
  29460. done: function(e) {
  29461. this.globalDone = e
  29462. },
  29463. cancelById: function(e) {
  29464. var t = void 0 === e ? 0 : e;
  29465. this.funcs = this.funcs.filter(function(e) {
  29466. return e.id !== t
  29467. })
  29468. },
  29469. cancel: function(t) {
  29470. this.funcs = this.funcs.filter(function(e) {
  29471. return e.func !== t
  29472. })
  29473. },
  29474. getUniqueId: function() {
  29475. return this.uniqueID -= 1,
  29476. this.uniqueID
  29477. }
  29478. }
  29479. }
  29480. , {
  29481. "./easing": 186
  29482. }],
  29483. 196: [function(e, t, i) {
  29484. function n(e) {
  29485. if (this.set = {},
  29486. this.infContains = function() {
  29487. return !0
  29488. }
  29489. ,
  29490. "object" == typeof e)
  29491. if (e instanceof Array)
  29492. for (var t = 0; t < e.length; t++)
  29493. this.set[e[t]] = !0;
  29494. else
  29495. this.set = e;
  29496. else if ("function" == typeof e)
  29497. this.infContains = e;
  29498. else if (void 0 !== e)
  29499. throw new Error("set must be either an array or an object.")
  29500. }
  29501. (t.exports = n).prototype.has = n.prototype.contains = function(e) {
  29502. return !!this.set[e]
  29503. }
  29504. ,
  29505. n.prototype.add = function(e) {
  29506. if (1 == arguments.length)
  29507. this.set[e] = !0;
  29508. else
  29509. for (var t = 0; t < arguments.length; t++)
  29510. this.set[arguments[t]] = !0
  29511. }
  29512. ,
  29513. n.prototype.addAll = function(e) {
  29514. if ("object" != typeof e && !(e instanceof Array))
  29515. throw new Error("arr must be an array.");
  29516. for (var t = 0; t < e.length; t++)
  29517. this.add(e[t])
  29518. }
  29519. ,
  29520. n.prototype.delete = n.prototype.remove = function(e) {
  29521. if (1 == arguments.length)
  29522. delete this.set[e];
  29523. else
  29524. for (var t = 0; t < arguments.length; t++)
  29525. delete this.set[arguments[t]]
  29526. }
  29527. ,
  29528. n.prototype.clear = function() {
  29529. this.set = {}
  29530. }
  29531. ,
  29532. n.prototype.size = function() {
  29533. return Object.keys(this.set).length
  29534. }
  29535. ,
  29536. n.prototype.toString = function() {
  29537. return "{" + Object.keys(this.set).toString() + "}"
  29538. }
  29539. ,
  29540. n.prototype["*values"] = n.prototype.toArray = function() {
  29541. return void 0 === this.set ? [] : Object.keys(this.set)
  29542. }
  29543. }
  29544. , {}],
  29545. 197: [function(e, t, i) {}
  29546. , {}],
  29547. 198: [function(N, e, F) {
  29548. (function(e) {
  29549. "use strict";
  29550. function i() {
  29551. return u.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823
  29552. }
  29553. function o(e, t) {
  29554. if (i() < t)
  29555. throw new RangeError("Invalid typed array length");
  29556. return u.TYPED_ARRAY_SUPPORT ? (e = new Uint8Array(t)).__proto__ = u.prototype : (null === e && (e = new u(t)),
  29557. e.length = t),
  29558. e
  29559. }
  29560. function u(e, t, i) {
  29561. if (!(u.TYPED_ARRAY_SUPPORT || this instanceof u))
  29562. return new u(e,t,i);
  29563. if ("number" != typeof e)
  29564. return n(this, e, t, i);
  29565. if ("string" == typeof t)
  29566. throw new Error("If encoding is specified then the first argument must be a string");
  29567. return a(this, e)
  29568. }
  29569. function n(e, t, i, n) {
  29570. if ("number" == typeof t)
  29571. throw new TypeError('"value" argument must not be a number');
  29572. return "undefined" != typeof ArrayBuffer && t instanceof ArrayBuffer ? function(e, t, i, n) {
  29573. if (t.byteLength,
  29574. i < 0 || t.byteLength < i)
  29575. throw new RangeError("'offset' is out of bounds");
  29576. if (t.byteLength < i + (n || 0))
  29577. throw new RangeError("'length' is out of bounds");
  29578. return t = void 0 === i && void 0 === n ? new Uint8Array(t) : void 0 === n ? new Uint8Array(t,i) : new Uint8Array(t,i,n),
  29579. u.TYPED_ARRAY_SUPPORT ? (e = t).__proto__ = u.prototype : e = s(e, t),
  29580. e
  29581. }(e, t, i, n) : "string" == typeof t ? function(e, t, i) {
  29582. if ("string" == typeof i && "" !== i || (i = "utf8"),
  29583. !u.isEncoding(i))
  29584. throw new TypeError('"encoding" must be a valid string encoding');
  29585. var n = 0 | c(t, i)
  29586. , r = (e = o(e, n)).write(t, i);
  29587. return r !== n && (e = e.slice(0, r)),
  29588. e
  29589. }(e, t, i) : function(e, t) {
  29590. if (u.isBuffer(t)) {
  29591. var i = 0 | l(t.length);
  29592. return 0 === (e = o(e, i)).length || t.copy(e, 0, 0, i),
  29593. e
  29594. }
  29595. if (t) {
  29596. if ("undefined" != typeof ArrayBuffer && t.buffer instanceof ArrayBuffer || "length"in t)
  29597. return "number" != typeof t.length || function(e) {
  29598. return e != e
  29599. }(t.length) ? o(e, 0) : s(e, t);
  29600. if ("Buffer" === t.type && L(t.data))
  29601. return s(e, t.data)
  29602. }
  29603. throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")
  29604. }(e, t)
  29605. }
  29606. function r(e) {
  29607. if ("number" != typeof e)
  29608. throw new TypeError('"size" argument must be a number');
  29609. if (e < 0)
  29610. throw new RangeError('"size" argument must not be negative')
  29611. }
  29612. function a(e, t) {
  29613. if (r(t),
  29614. e = o(e, t < 0 ? 0 : 0 | l(t)),
  29615. !u.TYPED_ARRAY_SUPPORT)
  29616. for (var i = 0; i < t; ++i)
  29617. e[i] = 0;
  29618. return e
  29619. }
  29620. function s(e, t) {
  29621. var i = t.length < 0 ? 0 : 0 | l(t.length);
  29622. e = o(e, i);
  29623. for (var n = 0; n < i; n += 1)
  29624. e[n] = 255 & t[n];
  29625. return e
  29626. }
  29627. function l(e) {
  29628. if (e >= i())
  29629. throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + i().toString(16) + " bytes");
  29630. return 0 | e
  29631. }
  29632. function c(e, t) {
  29633. if (u.isBuffer(e))
  29634. return e.length;
  29635. if ("undefined" != typeof ArrayBuffer && "function" == typeof ArrayBuffer.isView && (ArrayBuffer.isView(e) || e instanceof ArrayBuffer))
  29636. return e.byteLength;
  29637. "string" != typeof e && (e = "" + e);
  29638. var i = e.length;
  29639. if (0 === i)
  29640. return 0;
  29641. for (var n = !1; ; )
  29642. switch (t) {
  29643. case "ascii":
  29644. case "latin1":
  29645. case "binary":
  29646. return i;
  29647. case "utf8":
  29648. case "utf-8":
  29649. case void 0:
  29650. return S(e).length;
  29651. case "ucs2":
  29652. case "ucs-2":
  29653. case "utf16le":
  29654. case "utf-16le":
  29655. return 2 * i;
  29656. case "hex":
  29657. return i >>> 1;
  29658. case "base64":
  29659. return M(e).length;
  29660. default:
  29661. if (n)
  29662. return S(e).length;
  29663. t = ("" + t).toLowerCase(),
  29664. n = !0
  29665. }
  29666. }
  29667. function h(e, t, i) {
  29668. var n = e[t];
  29669. e[t] = e[i],
  29670. e[i] = n
  29671. }
  29672. function d(e, t, i, n, r) {
  29673. if (0 === e.length)
  29674. return -1;
  29675. if ("string" == typeof i ? (n = i,
  29676. i = 0) : 2147483647 < i ? i = 2147483647 : i < -2147483648 && (i = -2147483648),
  29677. i = +i,
  29678. isNaN(i) && (i = r ? 0 : e.length - 1),
  29679. i < 0 && (i = e.length + i),
  29680. i >= e.length) {
  29681. if (r)
  29682. return -1;
  29683. i = e.length - 1
  29684. } else if (i < 0) {
  29685. if (!r)
  29686. return -1;
  29687. i = 0
  29688. }
  29689. if ("string" == typeof t && (t = u.from(t, n)),
  29690. u.isBuffer(t))
  29691. return 0 === t.length ? -1 : p(e, t, i, n, r);
  29692. if ("number" == typeof t)
  29693. return t &= 255,
  29694. u.TYPED_ARRAY_SUPPORT && "function" == typeof Uint8Array.prototype.indexOf ? r ? Uint8Array.prototype.indexOf.call(e, t, i) : Uint8Array.prototype.lastIndexOf.call(e, t, i) : p(e, [t], i, n, r);
  29695. throw new TypeError("val must be string, number or Buffer")
  29696. }
  29697. function p(e, t, i, n, r) {
  29698. function o(e, t) {
  29699. return 1 === s ? e[t] : e.readUInt16BE(t * s)
  29700. }
  29701. var a, s = 1, l = e.length, c = t.length;
  29702. if (void 0 !== n && ("ucs2" === (n = String(n).toLowerCase()) || "ucs-2" === n || "utf16le" === n || "utf-16le" === n)) {
  29703. if (e.length < 2 || t.length < 2)
  29704. return -1;
  29705. l /= s = 2,
  29706. c /= 2,
  29707. i /= 2
  29708. }
  29709. if (r) {
  29710. var h = -1;
  29711. for (a = i; a < l; a++)
  29712. if (o(e, a) === o(t, -1 === h ? 0 : a - h)) {
  29713. if (-1 === h && (h = a),
  29714. a - h + 1 === c)
  29715. return h * s
  29716. } else
  29717. -1 !== h && (a -= a - h),
  29718. h = -1
  29719. } else
  29720. for (l < i + c && (i = l - c),
  29721. a = i; 0 <= a; a--) {
  29722. for (var u = !0, d = 0; d < c; d++)
  29723. if (o(e, a + d) !== o(t, d)) {
  29724. u = !1;
  29725. break
  29726. }
  29727. if (u)
  29728. return a
  29729. }
  29730. return -1
  29731. }
  29732. function g(e, t, i, n) {
  29733. i = Number(i) || 0;
  29734. var r = e.length - i;
  29735. n ? r < (n = Number(n)) && (n = r) : n = r;
  29736. var o = t.length;
  29737. if (o % 2 != 0)
  29738. throw new TypeError("Invalid hex string");
  29739. o / 2 < n && (n = o / 2);
  29740. for (var a = 0; a < n; ++a) {
  29741. var s = parseInt(t.substr(2 * a, 2), 16);
  29742. if (isNaN(s))
  29743. return a;
  29744. e[i + a] = s
  29745. }
  29746. return a
  29747. }
  29748. function m(e, t, i, n) {
  29749. return R(function(e) {
  29750. for (var t = [], i = 0; i < e.length; ++i)
  29751. t.push(255 & e.charCodeAt(i));
  29752. return t
  29753. }(t), e, i, n)
  29754. }
  29755. function f(e, t, i) {
  29756. i = Math.min(e.length, i);
  29757. for (var n = [], r = t; r < i; ) {
  29758. var o, a, s, l, c = e[r], h = null, u = 239 < c ? 4 : 223 < c ? 3 : 191 < c ? 2 : 1;
  29759. if (r + u <= i)
  29760. switch (u) {
  29761. case 1:
  29762. c < 128 && (h = c);
  29763. break;
  29764. case 2:
  29765. 128 == (192 & (o = e[r + 1])) && (127 < (l = (31 & c) << 6 | 63 & o) && (h = l));
  29766. break;
  29767. case 3:
  29768. o = e[r + 1],
  29769. a = e[r + 2],
  29770. 128 == (192 & o) && 128 == (192 & a) && (2047 < (l = (15 & c) << 12 | (63 & o) << 6 | 63 & a) && (l < 55296 || 57343 < l) && (h = l));
  29771. break;
  29772. case 4:
  29773. o = e[r + 1],
  29774. a = e[r + 2],
  29775. s = e[r + 3],
  29776. 128 == (192 & o) && 128 == (192 & a) && 128 == (192 & s) && (65535 < (l = (15 & c) << 18 | (63 & o) << 12 | (63 & a) << 6 | 63 & s) && l < 1114112 && (h = l))
  29777. }
  29778. null === h ? (h = 65533,
  29779. u = 1) : 65535 < h && (h -= 65536,
  29780. n.push(h >>> 10 & 1023 | 55296),
  29781. h = 56320 | 1023 & h),
  29782. n.push(h),
  29783. r += u
  29784. }
  29785. return function(e) {
  29786. var t = e.length;
  29787. if (t <= D)
  29788. return String.fromCharCode.apply(String, e);
  29789. for (var i = "", n = 0; n < t; )
  29790. i += String.fromCharCode.apply(String, e.slice(n, n += D));
  29791. return i
  29792. }(n)
  29793. }
  29794. function v(e, t, i) {
  29795. var n = "";
  29796. i = Math.min(e.length, i);
  29797. for (var r = t; r < i; ++r)
  29798. n += String.fromCharCode(127 & e[r]);
  29799. return n
  29800. }
  29801. function y(e, t, i) {
  29802. var n = "";
  29803. i = Math.min(e.length, i);
  29804. for (var r = t; r < i; ++r)
  29805. n += String.fromCharCode(e[r]);
  29806. return n
  29807. }
  29808. function A(e, t, i) {
  29809. var n, r = e.length;
  29810. (!t || t < 0) && (t = 0),
  29811. (!i || i < 0 || r < i) && (i = r);
  29812. for (var o = "", a = t; a < i; ++a)
  29813. o += (n = e[a]) < 16 ? "0" + n.toString(16) : n.toString(16);
  29814. return o
  29815. }
  29816. function C(e, t, i) {
  29817. for (var n = e.slice(t, i), r = "", o = 0; o < n.length; o += 2)
  29818. r += String.fromCharCode(n[o] + 256 * n[o + 1]);
  29819. return r
  29820. }
  29821. function I(e, t, i) {
  29822. if (e % 1 != 0 || e < 0)
  29823. throw new RangeError("offset is not uint");
  29824. if (i < e + t)
  29825. throw new RangeError("Trying to access beyond buffer length")
  29826. }
  29827. function E(e, t, i, n, r, o) {
  29828. if (!u.isBuffer(e))
  29829. throw new TypeError('"buffer" argument must be a Buffer instance');
  29830. if (r < t || t < o)
  29831. throw new RangeError('"value" argument is out of bounds');
  29832. if (i + n > e.length)
  29833. throw new RangeError("Index out of range")
  29834. }
  29835. function _(e, t, i, n) {
  29836. t < 0 && (t = 65535 + t + 1);
  29837. for (var r = 0, o = Math.min(e.length - i, 2); r < o; ++r)
  29838. e[i + r] = (t & 255 << 8 * (n ? r : 1 - r)) >>> 8 * (n ? r : 1 - r)
  29839. }
  29840. function b(e, t, i, n) {
  29841. t < 0 && (t = 4294967295 + t + 1);
  29842. for (var r = 0, o = Math.min(e.length - i, 4); r < o; ++r)
  29843. e[i + r] = t >>> 8 * (n ? r : 3 - r) & 255
  29844. }
  29845. function w(e, t, i, n) {
  29846. if (i + n > e.length)
  29847. throw new RangeError("Index out of range");
  29848. if (i < 0)
  29849. throw new RangeError("Index out of range")
  29850. }
  29851. function T(e, t, i, n, r) {
  29852. return r || w(e, 0, i, 4),
  29853. O.write(e, t, i, n, 23, 4),
  29854. i + 4
  29855. }
  29856. function x(e, t, i, n, r) {
  29857. return r || w(e, 0, i, 8),
  29858. O.write(e, t, i, n, 52, 8),
  29859. i + 8
  29860. }
  29861. function S(e, t) {
  29862. t = t || 1 / 0;
  29863. for (var i, n = e.length, r = null, o = [], a = 0; a < n; ++a) {
  29864. if (55295 < (i = e.charCodeAt(a)) && i < 57344) {
  29865. if (!r) {
  29866. if (56319 < i) {
  29867. -1 < (t -= 3) && o.push(239, 191, 189);
  29868. continue
  29869. }
  29870. if (a + 1 === n) {
  29871. -1 < (t -= 3) && o.push(239, 191, 189);
  29872. continue
  29873. }
  29874. r = i;
  29875. continue
  29876. }
  29877. if (i < 56320) {
  29878. -1 < (t -= 3) && o.push(239, 191, 189),
  29879. r = i;
  29880. continue
  29881. }
  29882. i = 65536 + (r - 55296 << 10 | i - 56320)
  29883. } else
  29884. r && -1 < (t -= 3) && o.push(239, 191, 189);
  29885. if (r = null,
  29886. i < 128) {
  29887. if ((t -= 1) < 0)
  29888. break;
  29889. o.push(i)
  29890. } else if (i < 2048) {
  29891. if ((t -= 2) < 0)
  29892. break;
  29893. o.push(i >> 6 | 192, 63 & i | 128)
  29894. } else if (i < 65536) {
  29895. if ((t -= 3) < 0)
  29896. break;
  29897. o.push(i >> 12 | 224, i >> 6 & 63 | 128, 63 & i | 128)
  29898. } else {
  29899. if (!(i < 1114112))
  29900. throw new Error("Invalid code point");
  29901. if ((t -= 4) < 0)
  29902. break;
  29903. o.push(i >> 18 | 240, i >> 12 & 63 | 128, i >> 6 & 63 | 128, 63 & i | 128)
  29904. }
  29905. }
  29906. return o
  29907. }
  29908. function M(e) {
  29909. return P.toByteArray(function(e) {
  29910. if ((e = function(e) {
  29911. return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, "")
  29912. }(e).replace(t, "")).length < 2)
  29913. return "";
  29914. for (; e.length % 4 != 0; )
  29915. e += "=";
  29916. return e
  29917. }(e))
  29918. }
  29919. function R(e, t, i, n) {
  29920. for (var r = 0; r < n && !(r + i >= t.length || r >= e.length); ++r)
  29921. t[r + i] = e[r];
  29922. return r
  29923. }
  29924. var P = N("base64-js")
  29925. , O = N("ieee754")
  29926. , L = N("isarray");
  29927. F.Buffer = u,
  29928. F.SlowBuffer = function(e) {
  29929. return +e != e && (e = 0),
  29930. u.alloc(+e)
  29931. }
  29932. ,
  29933. F.INSPECT_MAX_BYTES = 50,
  29934. u.TYPED_ARRAY_SUPPORT = void 0 !== e.TYPED_ARRAY_SUPPORT ? e.TYPED_ARRAY_SUPPORT : function() {
  29935. try {
  29936. var e = new Uint8Array(1);
  29937. return e.__proto__ = {
  29938. __proto__: Uint8Array.prototype,
  29939. foo: function() {
  29940. return 42
  29941. }
  29942. },
  29943. 42 === e.foo() && "function" == typeof e.subarray && 0 === e.subarray(1, 1).byteLength
  29944. } catch (e) {
  29945. return !1
  29946. }
  29947. }(),
  29948. F.kMaxLength = i(),
  29949. u.poolSize = 8192,
  29950. u._augment = function(e) {
  29951. return e.__proto__ = u.prototype,
  29952. e
  29953. }
  29954. ,
  29955. u.from = function(e, t, i) {
  29956. return n(null, e, t, i)
  29957. }
  29958. ,
  29959. u.TYPED_ARRAY_SUPPORT && (u.prototype.__proto__ = Uint8Array.prototype,
  29960. u.__proto__ = Uint8Array,
  29961. "undefined" != typeof Symbol && Symbol.species && u[Symbol.species] === u && Object.defineProperty(u, Symbol.species, {
  29962. value: null,
  29963. configurable: !0
  29964. })),
  29965. u.alloc = function(e, t, i) {
  29966. return function(e, t, i, n) {
  29967. return r(t),
  29968. 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)
  29969. }(null, e, t, i)
  29970. }
  29971. ,
  29972. u.allocUnsafe = function(e) {
  29973. return a(null, e)
  29974. }
  29975. ,
  29976. u.allocUnsafeSlow = function(e) {
  29977. return a(null, e)
  29978. }
  29979. ,
  29980. u.isBuffer = function(e) {
  29981. return !(null == e || !e._isBuffer)
  29982. }
  29983. ,
  29984. u.compare = function(e, t) {
  29985. if (!u.isBuffer(e) || !u.isBuffer(t))
  29986. throw new TypeError("Arguments must be Buffers");
  29987. if (e === t)
  29988. return 0;
  29989. for (var i = e.length, n = t.length, r = 0, o = Math.min(i, n); r < o; ++r)
  29990. if (e[r] !== t[r]) {
  29991. i = e[r],
  29992. n = t[r];
  29993. break
  29994. }
  29995. return i < n ? -1 : n < i ? 1 : 0
  29996. }
  29997. ,
  29998. u.isEncoding = function(e) {
  29999. switch (String(e).toLowerCase()) {
  30000. case "hex":
  30001. case "utf8":
  30002. case "utf-8":
  30003. case "ascii":
  30004. case "latin1":
  30005. case "binary":
  30006. case "base64":
  30007. case "ucs2":
  30008. case "ucs-2":
  30009. case "utf16le":
  30010. case "utf-16le":
  30011. return !0;
  30012. default:
  30013. return !1
  30014. }
  30015. }
  30016. ,
  30017. u.concat = function(e, t) {
  30018. if (!L(e))
  30019. throw new TypeError('"list" argument must be an Array of Buffers');
  30020. if (0 === e.length)
  30021. return u.alloc(0);
  30022. var i;
  30023. if (void 0 === t)
  30024. for (i = t = 0; i < e.length; ++i)
  30025. t += e[i].length;
  30026. var n = u.allocUnsafe(t)
  30027. , r = 0;
  30028. for (i = 0; i < e.length; ++i) {
  30029. var o = e[i];
  30030. if (!u.isBuffer(o))
  30031. throw new TypeError('"list" argument must be an Array of Buffers');
  30032. o.copy(n, r),
  30033. r += o.length
  30034. }
  30035. return n
  30036. }
  30037. ,
  30038. u.byteLength = c,
  30039. u.prototype._isBuffer = !0,
  30040. u.prototype.swap16 = function() {
  30041. var e = this.length;
  30042. if (e % 2 != 0)
  30043. throw new RangeError("Buffer size must be a multiple of 16-bits");
  30044. for (var t = 0; t < e; t += 2)
  30045. h(this, t, t + 1);
  30046. return this
  30047. }
  30048. ,
  30049. u.prototype.swap32 = function() {
  30050. var e = this.length;
  30051. if (e % 4 != 0)
  30052. throw new RangeError("Buffer size must be a multiple of 32-bits");
  30053. for (var t = 0; t < e; t += 4)
  30054. h(this, t, t + 3),
  30055. h(this, t + 1, t + 2);
  30056. return this
  30057. }
  30058. ,
  30059. u.prototype.swap64 = function() {
  30060. var e = this.length;
  30061. if (e % 8 != 0)
  30062. throw new RangeError("Buffer size must be a multiple of 64-bits");
  30063. for (var t = 0; t < e; t += 8)
  30064. h(this, t, t + 7),
  30065. h(this, t + 1, t + 6),
  30066. h(this, t + 2, t + 5),
  30067. h(this, t + 3, t + 4);
  30068. return this
  30069. }
  30070. ,
  30071. u.prototype.toString = function() {
  30072. var e = 0 | this.length;
  30073. return 0 == e ? "" : 0 === arguments.length ? f(this, 0, e) : function(e, t, i) {
  30074. var n, r, o, a = !1;
  30075. if ((void 0 === t || t < 0) && (t = 0),
  30076. t > this.length)
  30077. return "";
  30078. if ((void 0 === i || i > this.length) && (i = this.length),
  30079. i <= 0)
  30080. return "";
  30081. if ((i >>>= 0) <= (t >>>= 0))
  30082. return "";
  30083. for (e = e || "utf8"; ; )
  30084. switch (e) {
  30085. case "hex":
  30086. return A(this, t, i);
  30087. case "utf8":
  30088. case "utf-8":
  30089. return f(this, t, i);
  30090. case "ascii":
  30091. return v(this, t, i);
  30092. case "latin1":
  30093. case "binary":
  30094. return y(this, t, i);
  30095. case "base64":
  30096. return n = this,
  30097. o = i,
  30098. 0 === (r = t) && o === n.length ? P.fromByteArray(n) : P.fromByteArray(n.slice(r, o));
  30099. case "ucs2":
  30100. case "ucs-2":
  30101. case "utf16le":
  30102. case "utf-16le":
  30103. return C(this, t, i);
  30104. default:
  30105. if (a)
  30106. throw new TypeError("Unknown encoding: " + e);
  30107. e = (e + "").toLowerCase(),
  30108. a = !0
  30109. }
  30110. }
  30111. .apply(this, arguments)
  30112. }
  30113. ,
  30114. u.prototype.equals = function(e) {
  30115. if (!u.isBuffer(e))
  30116. throw new TypeError("Argument must be a Buffer");
  30117. return this === e || 0 === u.compare(this, e)
  30118. }
  30119. ,
  30120. u.prototype.inspect = function() {
  30121. var e = ""
  30122. , t = F.INSPECT_MAX_BYTES;
  30123. return 0 < this.length && (e = this.toString("hex", 0, t).match(/.{2}/g).join(" "),
  30124. this.length > t && (e += " ... ")),
  30125. "<Buffer " + e + ">"
  30126. }
  30127. ,
  30128. u.prototype.compare = function(e, t, i, n, r) {
  30129. if (!u.isBuffer(e))
  30130. throw new TypeError("Argument must be a Buffer");
  30131. if (void 0 === t && (t = 0),
  30132. void 0 === i && (i = e ? e.length : 0),
  30133. void 0 === n && (n = 0),
  30134. void 0 === r && (r = this.length),
  30135. t < 0 || i > e.length || n < 0 || r > this.length)
  30136. throw new RangeError("out of range index");
  30137. if (r <= n && i <= t)
  30138. return 0;
  30139. if (r <= n)
  30140. return -1;
  30141. if (i <= t)
  30142. return 1;
  30143. if (this === e)
  30144. return 0;
  30145. for (var o = (r >>>= 0) - (n >>>= 0), a = (i >>>= 0) - (t >>>= 0), s = Math.min(o, a), l = this.slice(n, r), c = e.slice(t, i), h = 0; h < s; ++h)
  30146. if (l[h] !== c[h]) {
  30147. o = l[h],
  30148. a = c[h];
  30149. break
  30150. }
  30151. return o < a ? -1 : a < o ? 1 : 0
  30152. }
  30153. ,
  30154. u.prototype.includes = function(e, t, i) {
  30155. return -1 !== this.indexOf(e, t, i)
  30156. }
  30157. ,
  30158. u.prototype.indexOf = function(e, t, i) {
  30159. return d(this, e, t, i, !0)
  30160. }
  30161. ,
  30162. u.prototype.lastIndexOf = function(e, t, i) {
  30163. return d(this, e, t, i, !1)
  30164. }
  30165. ,
  30166. u.prototype.write = function(e, t, i, n) {
  30167. if (void 0 === t)
  30168. n = "utf8",
  30169. i = this.length,
  30170. t = 0;
  30171. else if (void 0 === i && "string" == typeof t)
  30172. n = t,
  30173. i = this.length,
  30174. t = 0;
  30175. else {
  30176. if (!isFinite(t))
  30177. throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
  30178. t |= 0,
  30179. isFinite(i) ? (i |= 0,
  30180. void 0 === n && (n = "utf8")) : (n = i,
  30181. i = void 0)
  30182. }
  30183. var r, o, a, s, l, c, h, u, d, p = this.length - t;
  30184. if ((void 0 === i || p < i) && (i = p),
  30185. 0 < e.length && (i < 0 || t < 0) || t > this.length)
  30186. throw new RangeError("Attempt to write outside buffer bounds");
  30187. n = n || "utf8";
  30188. for (var f = !1; ; )
  30189. switch (n) {
  30190. case "hex":
  30191. return g(this, e, t, i);
  30192. case "utf8":
  30193. case "utf-8":
  30194. return u = t,
  30195. d = i,
  30196. R(S(e, (h = this).length - u), h, u, d);
  30197. case "ascii":
  30198. return m(this, e, t, i);
  30199. case "latin1":
  30200. case "binary":
  30201. return m(this, e, t, i);
  30202. case "base64":
  30203. return s = this,
  30204. l = t,
  30205. c = i,
  30206. R(M(e), s, l, c);
  30207. case "ucs2":
  30208. case "ucs-2":
  30209. case "utf16le":
  30210. case "utf-16le":
  30211. return o = t,
  30212. a = i,
  30213. R(function(e, t) {
  30214. for (var i, n, r, o = [], a = 0; a < e.length && !((t -= 2) < 0); ++a)
  30215. i = e.charCodeAt(a),
  30216. n = i >> 8,
  30217. r = i % 256,
  30218. o.push(r),
  30219. o.push(n);
  30220. return o
  30221. }(e, (r = this).length - o), r, o, a);
  30222. default:
  30223. if (f)
  30224. throw new TypeError("Unknown encoding: " + n);
  30225. n = ("" + n).toLowerCase(),
  30226. f = !0
  30227. }
  30228. }
  30229. ,
  30230. u.prototype.toJSON = function() {
  30231. return {
  30232. type: "Buffer",
  30233. data: Array.prototype.slice.call(this._arr || this, 0)
  30234. }
  30235. }
  30236. ;
  30237. var D = 4096;
  30238. u.prototype.slice = function(e, t) {
  30239. var i, n = this.length;
  30240. if ((e = ~~e) < 0 ? (e += n) < 0 && (e = 0) : n < e && (e = n),
  30241. (t = void 0 === t ? n : ~~t) < 0 ? (t += n) < 0 && (t = 0) : n < t && (t = n),
  30242. t < e && (t = e),
  30243. u.TYPED_ARRAY_SUPPORT)
  30244. (i = this.subarray(e, t)).__proto__ = u.prototype;
  30245. else {
  30246. var r = t - e;
  30247. i = new u(r,void 0);
  30248. for (var o = 0; o < r; ++o)
  30249. i[o] = this[o + e]
  30250. }
  30251. return i
  30252. }
  30253. ,
  30254. u.prototype.readUIntLE = function(e, t, i) {
  30255. e |= 0,
  30256. t |= 0,
  30257. i || I(e, t, this.length);
  30258. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  30259. n += this[e + o] * r;
  30260. return n
  30261. }
  30262. ,
  30263. u.prototype.readUIntBE = function(e, t, i) {
  30264. e |= 0,
  30265. t |= 0,
  30266. i || I(e, t, this.length);
  30267. for (var n = this[e + --t], r = 1; 0 < t && (r *= 256); )
  30268. n += this[e + --t] * r;
  30269. return n
  30270. }
  30271. ,
  30272. u.prototype.readUInt8 = function(e, t) {
  30273. return t || I(e, 1, this.length),
  30274. this[e]
  30275. }
  30276. ,
  30277. u.prototype.readUInt16LE = function(e, t) {
  30278. return t || I(e, 2, this.length),
  30279. this[e] | this[e + 1] << 8
  30280. }
  30281. ,
  30282. u.prototype.readUInt16BE = function(e, t) {
  30283. return t || I(e, 2, this.length),
  30284. this[e] << 8 | this[e + 1]
  30285. }
  30286. ,
  30287. u.prototype.readUInt32LE = function(e, t) {
  30288. return t || I(e, 4, this.length),
  30289. (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + 16777216 * this[e + 3]
  30290. }
  30291. ,
  30292. u.prototype.readUInt32BE = function(e, t) {
  30293. return t || I(e, 4, this.length),
  30294. 16777216 * this[e] + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3])
  30295. }
  30296. ,
  30297. u.prototype.readIntLE = function(e, t, i) {
  30298. e |= 0,
  30299. t |= 0,
  30300. i || I(e, t, this.length);
  30301. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  30302. n += this[e + o] * r;
  30303. return (r *= 128) <= n && (n -= Math.pow(2, 8 * t)),
  30304. n
  30305. }
  30306. ,
  30307. u.prototype.readIntBE = function(e, t, i) {
  30308. e |= 0,
  30309. t |= 0,
  30310. i || I(e, t, this.length);
  30311. for (var n = t, r = 1, o = this[e + --n]; 0 < n && (r *= 256); )
  30312. o += this[e + --n] * r;
  30313. return (r *= 128) <= o && (o -= Math.pow(2, 8 * t)),
  30314. o
  30315. }
  30316. ,
  30317. u.prototype.readInt8 = function(e, t) {
  30318. return t || I(e, 1, this.length),
  30319. 128 & this[e] ? -1 * (255 - this[e] + 1) : this[e]
  30320. }
  30321. ,
  30322. u.prototype.readInt16LE = function(e, t) {
  30323. t || I(e, 2, this.length);
  30324. var i = this[e] | this[e + 1] << 8;
  30325. return 32768 & i ? 4294901760 | i : i
  30326. }
  30327. ,
  30328. u.prototype.readInt16BE = function(e, t) {
  30329. t || I(e, 2, this.length);
  30330. var i = this[e + 1] | this[e] << 8;
  30331. return 32768 & i ? 4294901760 | i : i
  30332. }
  30333. ,
  30334. u.prototype.readInt32LE = function(e, t) {
  30335. return t || I(e, 4, this.length),
  30336. this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24
  30337. }
  30338. ,
  30339. u.prototype.readInt32BE = function(e, t) {
  30340. return t || I(e, 4, this.length),
  30341. this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]
  30342. }
  30343. ,
  30344. u.prototype.readFloatLE = function(e, t) {
  30345. return t || I(e, 4, this.length),
  30346. O.read(this, e, !0, 23, 4)
  30347. }
  30348. ,
  30349. u.prototype.readFloatBE = function(e, t) {
  30350. return t || I(e, 4, this.length),
  30351. O.read(this, e, !1, 23, 4)
  30352. }
  30353. ,
  30354. u.prototype.readDoubleLE = function(e, t) {
  30355. return t || I(e, 8, this.length),
  30356. O.read(this, e, !0, 52, 8)
  30357. }
  30358. ,
  30359. u.prototype.readDoubleBE = function(e, t) {
  30360. return t || I(e, 8, this.length),
  30361. O.read(this, e, !1, 52, 8)
  30362. }
  30363. ,
  30364. u.prototype.writeUIntLE = function(e, t, i, n) {
  30365. e = +e,
  30366. t |= 0,
  30367. i |= 0,
  30368. n || E(this, e, t, i, Math.pow(2, 8 * i) - 1, 0);
  30369. var r = 1
  30370. , o = 0;
  30371. for (this[t] = 255 & e; ++o < i && (r *= 256); )
  30372. this[t + o] = e / r & 255;
  30373. return t + i
  30374. }
  30375. ,
  30376. u.prototype.writeUIntBE = function(e, t, i, n) {
  30377. e = +e,
  30378. t |= 0,
  30379. i |= 0,
  30380. n || E(this, e, t, i, Math.pow(2, 8 * i) - 1, 0);
  30381. var r = i - 1
  30382. , o = 1;
  30383. for (this[t + r] = 255 & e; 0 <= --r && (o *= 256); )
  30384. this[t + r] = e / o & 255;
  30385. return t + i
  30386. }
  30387. ,
  30388. u.prototype.writeUInt8 = function(e, t, i) {
  30389. return e = +e,
  30390. t |= 0,
  30391. i || E(this, e, t, 1, 255, 0),
  30392. u.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  30393. this[t] = 255 & e,
  30394. t + 1
  30395. }
  30396. ,
  30397. u.prototype.writeUInt16LE = function(e, t, i) {
  30398. return e = +e,
  30399. t |= 0,
  30400. i || E(this, e, t, 2, 65535, 0),
  30401. u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30402. this[t + 1] = e >>> 8) : _(this, e, t, !0),
  30403. t + 2
  30404. }
  30405. ,
  30406. u.prototype.writeUInt16BE = function(e, t, i) {
  30407. return e = +e,
  30408. t |= 0,
  30409. i || E(this, e, t, 2, 65535, 0),
  30410. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  30411. this[t + 1] = 255 & e) : _(this, e, t, !1),
  30412. t + 2
  30413. }
  30414. ,
  30415. u.prototype.writeUInt32LE = function(e, t, i) {
  30416. return e = +e,
  30417. t |= 0,
  30418. i || E(this, e, t, 4, 4294967295, 0),
  30419. u.TYPED_ARRAY_SUPPORT ? (this[t + 3] = e >>> 24,
  30420. this[t + 2] = e >>> 16,
  30421. this[t + 1] = e >>> 8,
  30422. this[t] = 255 & e) : b(this, e, t, !0),
  30423. t + 4
  30424. }
  30425. ,
  30426. u.prototype.writeUInt32BE = function(e, t, i) {
  30427. return e = +e,
  30428. t |= 0,
  30429. i || E(this, e, t, 4, 4294967295, 0),
  30430. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  30431. this[t + 1] = e >>> 16,
  30432. this[t + 2] = e >>> 8,
  30433. this[t + 3] = 255 & e) : b(this, e, t, !1),
  30434. t + 4
  30435. }
  30436. ,
  30437. u.prototype.writeIntLE = function(e, t, i, n) {
  30438. if (e = +e,
  30439. t |= 0,
  30440. !n) {
  30441. var r = Math.pow(2, 8 * i - 1);
  30442. E(this, e, t, i, r - 1, -r)
  30443. }
  30444. var o = 0
  30445. , a = 1
  30446. , s = 0;
  30447. for (this[t] = 255 & e; ++o < i && (a *= 256); )
  30448. e < 0 && 0 === s && 0 !== this[t + o - 1] && (s = 1),
  30449. this[t + o] = (e / a >> 0) - s & 255;
  30450. return t + i
  30451. }
  30452. ,
  30453. u.prototype.writeIntBE = function(e, t, i, n) {
  30454. if (e = +e,
  30455. t |= 0,
  30456. !n) {
  30457. var r = Math.pow(2, 8 * i - 1);
  30458. E(this, e, t, i, r - 1, -r)
  30459. }
  30460. var o = i - 1
  30461. , a = 1
  30462. , s = 0;
  30463. for (this[t + o] = 255 & e; 0 <= --o && (a *= 256); )
  30464. e < 0 && 0 === s && 0 !== this[t + o + 1] && (s = 1),
  30465. this[t + o] = (e / a >> 0) - s & 255;
  30466. return t + i
  30467. }
  30468. ,
  30469. u.prototype.writeInt8 = function(e, t, i) {
  30470. return e = +e,
  30471. t |= 0,
  30472. i || E(this, e, t, 1, 127, -128),
  30473. u.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  30474. e < 0 && (e = 255 + e + 1),
  30475. this[t] = 255 & e,
  30476. t + 1
  30477. }
  30478. ,
  30479. u.prototype.writeInt16LE = function(e, t, i) {
  30480. return e = +e,
  30481. t |= 0,
  30482. i || E(this, e, t, 2, 32767, -32768),
  30483. u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30484. this[t + 1] = e >>> 8) : _(this, e, t, !0),
  30485. t + 2
  30486. }
  30487. ,
  30488. u.prototype.writeInt16BE = function(e, t, i) {
  30489. return e = +e,
  30490. t |= 0,
  30491. i || E(this, e, t, 2, 32767, -32768),
  30492. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  30493. this[t + 1] = 255 & e) : _(this, e, t, !1),
  30494. t + 2
  30495. }
  30496. ,
  30497. u.prototype.writeInt32LE = function(e, t, i) {
  30498. return e = +e,
  30499. t |= 0,
  30500. i || E(this, e, t, 4, 2147483647, -2147483648),
  30501. u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30502. this[t + 1] = e >>> 8,
  30503. this[t + 2] = e >>> 16,
  30504. this[t + 3] = e >>> 24) : b(this, e, t, !0),
  30505. t + 4
  30506. }
  30507. ,
  30508. u.prototype.writeInt32BE = function(e, t, i) {
  30509. return e = +e,
  30510. t |= 0,
  30511. i || E(this, e, t, 4, 2147483647, -2147483648),
  30512. e < 0 && (e = 4294967295 + e + 1),
  30513. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  30514. this[t + 1] = e >>> 16,
  30515. this[t + 2] = e >>> 8,
  30516. this[t + 3] = 255 & e) : b(this, e, t, !1),
  30517. t + 4
  30518. }
  30519. ,
  30520. u.prototype.writeFloatLE = function(e, t, i) {
  30521. return T(this, e, t, !0, i)
  30522. }
  30523. ,
  30524. u.prototype.writeFloatBE = function(e, t, i) {
  30525. return T(this, e, t, !1, i)
  30526. }
  30527. ,
  30528. u.prototype.writeDoubleLE = function(e, t, i) {
  30529. return x(this, e, t, !0, i)
  30530. }
  30531. ,
  30532. u.prototype.writeDoubleBE = function(e, t, i) {
  30533. return x(this, e, t, !1, i)
  30534. }
  30535. ,
  30536. u.prototype.copy = function(e, t, i, n) {
  30537. if (i = i || 0,
  30538. n || 0 === n || (n = this.length),
  30539. t >= e.length && (t = e.length),
  30540. t = t || 0,
  30541. 0 < n && n < i && (n = i),
  30542. n === i)
  30543. return 0;
  30544. if (0 === e.length || 0 === this.length)
  30545. return 0;
  30546. if (t < 0)
  30547. throw new RangeError("targetStart out of bounds");
  30548. if (i < 0 || i >= this.length)
  30549. throw new RangeError("sourceStart out of bounds");
  30550. if (n < 0)
  30551. throw new RangeError("sourceEnd out of bounds");
  30552. n > this.length && (n = this.length),
  30553. e.length - t < n - i && (n = e.length - t + i);
  30554. var r, o = n - i;
  30555. if (this === e && i < t && t < n)
  30556. for (r = o - 1; 0 <= r; --r)
  30557. e[r + t] = this[r + i];
  30558. else if (o < 1e3 || !u.TYPED_ARRAY_SUPPORT)
  30559. for (r = 0; r < o; ++r)
  30560. e[r + t] = this[r + i];
  30561. else
  30562. Uint8Array.prototype.set.call(e, this.subarray(i, i + o), t);
  30563. return o
  30564. }
  30565. ,
  30566. u.prototype.fill = function(e, t, i, n) {
  30567. if ("string" == typeof e) {
  30568. if ("string" == typeof t ? (n = t,
  30569. t = 0,
  30570. i = this.length) : "string" == typeof i && (n = i,
  30571. i = this.length),
  30572. 1 === e.length) {
  30573. var r = e.charCodeAt(0);
  30574. r < 256 && (e = r)
  30575. }
  30576. if (void 0 !== n && "string" != typeof n)
  30577. throw new TypeError("encoding must be a string");
  30578. if ("string" == typeof n && !u.isEncoding(n))
  30579. throw new TypeError("Unknown encoding: " + n)
  30580. } else
  30581. "number" == typeof e && (e &= 255);
  30582. if (t < 0 || this.length < t || this.length < i)
  30583. throw new RangeError("Out of range index");
  30584. if (i <= t)
  30585. return this;
  30586. var o;
  30587. if (t >>>= 0,
  30588. i = void 0 === i ? this.length : i >>> 0,
  30589. "number" == typeof (e = e || 0))
  30590. for (o = t; o < i; ++o)
  30591. this[o] = e;
  30592. else {
  30593. var a = u.isBuffer(e) ? e : S(new u(e,n).toString())
  30594. , s = a.length;
  30595. for (o = 0; o < i - t; ++o)
  30596. this[o + t] = a[o % s]
  30597. }
  30598. return this
  30599. }
  30600. ;
  30601. var t = /[^+\/0-9A-Za-z-_]/g
  30602. }
  30603. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  30604. }
  30605. , {
  30606. "base64-js": 199,
  30607. ieee754: 200,
  30608. isarray: 201
  30609. }],
  30610. 199: [function(e, t, i) {
  30611. "use strict";
  30612. function l(e) {
  30613. var t = e.length;
  30614. if (0 < t % 4)
  30615. throw new Error("Invalid string. Length must be a multiple of 4");
  30616. return "=" === e[t - 2] ? 2 : "=" === e[t - 1] ? 1 : 0
  30617. }
  30618. function c(e, t, i) {
  30619. for (var n, r = [], o = t; o < i; o += 3)
  30620. n = (e[o] << 16) + (e[o + 1] << 8) + e[o + 2],
  30621. r.push(h[(a = n) >> 18 & 63] + h[a >> 12 & 63] + h[a >> 6 & 63] + h[63 & a]);
  30622. var a;
  30623. return r.join("")
  30624. }
  30625. i.byteLength = function(e) {
  30626. return 3 * e.length / 4 - l(e)
  30627. }
  30628. ,
  30629. i.toByteArray = function(e) {
  30630. var t, i, n, r, o, a = e.length;
  30631. r = l(e),
  30632. o = new d(3 * a / 4 - r),
  30633. i = 0 < r ? a - 4 : a;
  30634. var s = 0;
  30635. for (t = 0; t < i; t += 4,
  30636. 3)
  30637. n = u[e.charCodeAt(t)] << 18 | u[e.charCodeAt(t + 1)] << 12 | u[e.charCodeAt(t + 2)] << 6 | u[e.charCodeAt(t + 3)],
  30638. o[s++] = n >> 16 & 255,
  30639. o[s++] = n >> 8 & 255,
  30640. o[s++] = 255 & n;
  30641. return 2 === r ? (n = u[e.charCodeAt(t)] << 2 | u[e.charCodeAt(t + 1)] >> 4,
  30642. o[s++] = 255 & n) : 1 === r && (n = u[e.charCodeAt(t)] << 10 | u[e.charCodeAt(t + 1)] << 4 | u[e.charCodeAt(t + 2)] >> 2,
  30643. o[s++] = n >> 8 & 255,
  30644. o[s++] = 255 & n),
  30645. o
  30646. }
  30647. ,
  30648. i.fromByteArray = function(e) {
  30649. for (var t, i = e.length, n = i % 3, r = "", o = [], a = 0, s = i - n; a < s; a += 16383)
  30650. o.push(c(e, a, s < a + 16383 ? s : a + 16383));
  30651. return 1 == n ? (t = e[i - 1],
  30652. r += h[t >> 2],
  30653. r += h[t << 4 & 63],
  30654. r += "==") : 2 == n && (t = (e[i - 2] << 8) + e[i - 1],
  30655. r += h[t >> 10],
  30656. r += h[t >> 4 & 63],
  30657. r += h[t << 2 & 63],
  30658. r += "="),
  30659. o.push(r),
  30660. o.join("")
  30661. }
  30662. ;
  30663. for (var h = [], u = [], d = "undefined" != typeof Uint8Array ? Uint8Array : Array, n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", r = 0, o = n.length; r < o; ++r)
  30664. h[r] = n[r],
  30665. u[n.charCodeAt(r)] = r;
  30666. u["-".charCodeAt(0)] = 62,
  30667. u["_".charCodeAt(0)] = 63
  30668. }
  30669. , {}],
  30670. 200: [function(e, t, i) {
  30671. i.read = function(e, t, i, n, r) {
  30672. 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];
  30673. for (u += d,
  30674. o = p & (1 << -h) - 1,
  30675. p >>= -h,
  30676. h += s; 0 < h; o = 256 * o + e[t + u],
  30677. u += d,
  30678. h -= 8)
  30679. ;
  30680. for (a = o & (1 << -h) - 1,
  30681. o >>= -h,
  30682. h += n; 0 < h; a = 256 * a + e[t + u],
  30683. u += d,
  30684. h -= 8)
  30685. ;
  30686. if (0 === o)
  30687. o = 1 - c;
  30688. else {
  30689. if (o === l)
  30690. return a ? NaN : 1 / 0 * (p ? -1 : 1);
  30691. a += Math.pow(2, n),
  30692. o -= c
  30693. }
  30694. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  30695. }
  30696. ,
  30697. i.write = function(e, t, i, n, r, o) {
  30698. 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;
  30699. for (t = Math.abs(t),
  30700. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  30701. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  30702. t * (l = Math.pow(2, -a)) < 1 && (a--,
  30703. l *= 2),
  30704. 2 <= (t += 1 <= a + u ? d / l : d * Math.pow(2, 1 - u)) * l && (a++,
  30705. l /= 2),
  30706. h <= a + u ? (s = 0,
  30707. a = h) : 1 <= a + u ? (s = (t * l - 1) * Math.pow(2, r),
  30708. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  30709. a = 0)); 8 <= r; e[i + p] = 255 & s,
  30710. p += f,
  30711. s /= 256,
  30712. r -= 8)
  30713. ;
  30714. for (a = a << r | s,
  30715. c += r; 0 < c; e[i + p] = 255 & a,
  30716. p += f,
  30717. a /= 256,
  30718. c -= 8)
  30719. ;
  30720. e[i + p - f] |= 128 * g
  30721. }
  30722. }
  30723. , {}],
  30724. 201: [function(e, t, i) {
  30725. var n = {}.toString;
  30726. t.exports = Array.isArray || function(e) {
  30727. return "[object Array]" == n.call(e)
  30728. }
  30729. }
  30730. , {}],
  30731. 202: [function(e, t, i) {
  30732. function n() {
  30733. this._events = this._events || {},
  30734. this._maxListeners = this._maxListeners || void 0
  30735. }
  30736. function l(e) {
  30737. return "function" == typeof e
  30738. }
  30739. function c(e) {
  30740. return "object" == typeof e && null !== e
  30741. }
  30742. function h(e) {
  30743. return void 0 === e
  30744. }
  30745. ((t.exports = n).EventEmitter = n).prototype._events = void 0,
  30746. n.prototype._maxListeners = void 0,
  30747. n.defaultMaxListeners = 10,
  30748. n.prototype.setMaxListeners = function(e) {
  30749. if (!function(e) {
  30750. return "number" == typeof e
  30751. }(e) || e < 0 || isNaN(e))
  30752. throw TypeError("n must be a positive number");
  30753. return this._maxListeners = e,
  30754. this
  30755. }
  30756. ,
  30757. n.prototype.emit = function(e) {
  30758. var t, i, n, r, o, a;
  30759. if (this._events || (this._events = {}),
  30760. "error" === e && (!this._events.error || c(this._events.error) && !this._events.error.length)) {
  30761. if ((t = arguments[1])instanceof Error)
  30762. throw t;
  30763. var s = new Error('Uncaught, unspecified "error" event. (' + t + ")");
  30764. throw s.context = t,
  30765. s
  30766. }
  30767. if (h(i = this._events[e]))
  30768. return !1;
  30769. if (l(i))
  30770. switch (arguments.length) {
  30771. case 1:
  30772. i.call(this);
  30773. break;
  30774. case 2:
  30775. i.call(this, arguments[1]);
  30776. break;
  30777. case 3:
  30778. i.call(this, arguments[1], arguments[2]);
  30779. break;
  30780. default:
  30781. r = Array.prototype.slice.call(arguments, 1),
  30782. i.apply(this, r)
  30783. }
  30784. else if (c(i))
  30785. for (r = Array.prototype.slice.call(arguments, 1),
  30786. n = (a = i.slice()).length,
  30787. o = 0; o < n; o++)
  30788. a[o].apply(this, r);
  30789. return !0
  30790. }
  30791. ,
  30792. n.prototype.on = n.prototype.addListener = function(e, t) {
  30793. var i;
  30794. if (!l(t))
  30795. throw TypeError("listener must be a function");
  30796. return this._events || (this._events = {}),
  30797. this._events.newListener && this.emit("newListener", e, l(t.listener) ? t.listener : t),
  30798. this._events[e] ? c(this._events[e]) ? this._events[e].push(t) : this._events[e] = [this._events[e], t] : this._events[e] = t,
  30799. c(this._events[e]) && !this._events[e].warned && ((i = h(this._maxListeners) ? n.defaultMaxListeners : this._maxListeners) && 0 < i && this._events[e].length > i && (this._events[e].warned = !0,
  30800. console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.", this._events[e].length),
  30801. "function" == typeof console.trace && console.trace())),
  30802. this
  30803. }
  30804. ,
  30805. n.prototype.once = function(e, t) {
  30806. function i() {
  30807. this.removeListener(e, i),
  30808. n || (n = !0,
  30809. t.apply(this, arguments))
  30810. }
  30811. if (!l(t))
  30812. throw TypeError("listener must be a function");
  30813. var n = !1;
  30814. return i.listener = t,
  30815. this.on(e, i),
  30816. this
  30817. }
  30818. ,
  30819. n.prototype.removeListener = function(e, t) {
  30820. var i, n, r, o;
  30821. if (!l(t))
  30822. throw TypeError("listener must be a function");
  30823. if (!this._events || !this._events[e])
  30824. return this;
  30825. if (r = (i = this._events[e]).length,
  30826. n = -1,
  30827. i === t || l(i.listener) && i.listener === t)
  30828. delete this._events[e],
  30829. this._events.removeListener && this.emit("removeListener", e, t);
  30830. else if (c(i)) {
  30831. for (o = r; 0 < o--; )
  30832. if (i[o] === t || i[o].listener && i[o].listener === t) {
  30833. n = o;
  30834. break
  30835. }
  30836. if (n < 0)
  30837. return this;
  30838. 1 === i.length ? (i.length = 0,
  30839. delete this._events[e]) : i.splice(n, 1),
  30840. this._events.removeListener && this.emit("removeListener", e, t)
  30841. }
  30842. return this
  30843. }
  30844. ,
  30845. n.prototype.removeAllListeners = function(e) {
  30846. var t, i;
  30847. if (!this._events)
  30848. return this;
  30849. if (!this._events.removeListener)
  30850. return 0 === arguments.length ? this._events = {} : this._events[e] && delete this._events[e],
  30851. this;
  30852. if (0 === arguments.length) {
  30853. for (t in this._events)
  30854. "removeListener" !== t && this.removeAllListeners(t);
  30855. return this.removeAllListeners("removeListener"),
  30856. this._events = {},
  30857. this
  30858. }
  30859. if (l(i = this._events[e]))
  30860. this.removeListener(e, i);
  30861. else if (i)
  30862. for (; i.length; )
  30863. this.removeListener(e, i[i.length - 1]);
  30864. return delete this._events[e],
  30865. this
  30866. }
  30867. ,
  30868. n.prototype.listeners = function(e) {
  30869. return this._events && this._events[e] ? l(this._events[e]) ? [this._events[e]] : this._events[e].slice() : []
  30870. }
  30871. ,
  30872. n.prototype.listenerCount = function(e) {
  30873. if (this._events) {
  30874. var t = this._events[e];
  30875. if (l(t))
  30876. return 1;
  30877. if (t)
  30878. return t.length
  30879. }
  30880. return 0
  30881. }
  30882. ,
  30883. n.listenerCount = function(e, t) {
  30884. return e.listenerCount(t)
  30885. }
  30886. }
  30887. , {}],
  30888. 203: [function(e, t, i) {
  30889. function n() {
  30890. throw new Error("setTimeout has not been defined")
  30891. }
  30892. function r() {
  30893. throw new Error("clearTimeout has not been defined")
  30894. }
  30895. function o(t) {
  30896. if (h === setTimeout)
  30897. return setTimeout(t, 0);
  30898. if ((h === n || !h) && setTimeout)
  30899. return h = setTimeout,
  30900. setTimeout(t, 0);
  30901. try {
  30902. return h(t, 0)
  30903. } catch (e) {
  30904. try {
  30905. return h.call(null, t, 0)
  30906. } catch (e) {
  30907. return h.call(this, t, 0)
  30908. }
  30909. }
  30910. }
  30911. function a() {
  30912. g && p && (g = !1,
  30913. p.length ? f = p.concat(f) : m = -1,
  30914. f.length && s())
  30915. }
  30916. function s() {
  30917. if (!g) {
  30918. var e = o(a);
  30919. g = !0;
  30920. for (var t = f.length; t; ) {
  30921. for (p = f,
  30922. f = []; ++m < t; )
  30923. p && p[m].run();
  30924. m = -1,
  30925. t = f.length
  30926. }
  30927. p = null,
  30928. g = !1,
  30929. function(t) {
  30930. if (u === clearTimeout)
  30931. return clearTimeout(t);
  30932. if ((u === r || !u) && clearTimeout)
  30933. return u = clearTimeout,
  30934. clearTimeout(t);
  30935. try {
  30936. u(t)
  30937. } catch (e) {
  30938. try {
  30939. return u.call(null, t)
  30940. } catch (e) {
  30941. return u.call(this, t)
  30942. }
  30943. }
  30944. }(e)
  30945. }
  30946. }
  30947. function l(e, t) {
  30948. this.fun = e,
  30949. this.array = t
  30950. }
  30951. function c() {}
  30952. var h, u, d = t.exports = {};
  30953. !function() {
  30954. try {
  30955. h = "function" == typeof setTimeout ? setTimeout : n
  30956. } catch (e) {
  30957. h = n
  30958. }
  30959. try {
  30960. u = "function" == typeof clearTimeout ? clearTimeout : r
  30961. } catch (e) {
  30962. u = r
  30963. }
  30964. }();
  30965. var p, f = [], g = !1, m = -1;
  30966. d.nextTick = function(e) {
  30967. var t = new Array(arguments.length - 1);
  30968. if (1 < arguments.length)
  30969. for (var i = 1; i < arguments.length; i++)
  30970. t[i - 1] = arguments[i];
  30971. f.push(new l(e,t)),
  30972. 1 !== f.length || g || o(s)
  30973. }
  30974. ,
  30975. l.prototype.run = function() {
  30976. this.fun.apply(null, this.array)
  30977. }
  30978. ,
  30979. d.title = "browser",
  30980. d.browser = !0,
  30981. d.env = {},
  30982. d.argv = [],
  30983. d.version = "",
  30984. d.versions = {},
  30985. d.on = c,
  30986. d.addListener = c,
  30987. d.once = c,
  30988. d.off = c,
  30989. d.removeListener = c,
  30990. d.removeAllListeners = c,
  30991. d.emit = c,
  30992. d.binding = function(e) {
  30993. throw new Error("process.binding is not supported")
  30994. }
  30995. ,
  30996. d.cwd = function() {
  30997. return "/"
  30998. }
  30999. ,
  31000. d.chdir = function(e) {
  31001. throw new Error("process.chdir is not supported")
  31002. }
  31003. ,
  31004. d.umask = function() {
  31005. return 0
  31006. }
  31007. }
  31008. , {}],
  31009. 204: [function(e, O, L) {
  31010. (function(P) {
  31011. !function(e) {
  31012. function v(e) {
  31013. throw new RangeError(g[e])
  31014. }
  31015. function r(e, t) {
  31016. for (var i = e.length, n = []; i--; )
  31017. n[i] = t(e[i]);
  31018. return n
  31019. }
  31020. function t(e, t) {
  31021. var i = e.split("@")
  31022. , n = "";
  31023. return 1 < i.length && (n = i[0] + "@",
  31024. e = i[1]),
  31025. n + r((e = e.replace(f, ".")).split("."), t).join(".")
  31026. }
  31027. function y(e) {
  31028. for (var t, i, n = [], r = 0, o = e.length; r < o; )
  31029. 55296 <= (t = e.charCodeAt(r++)) && t <= 56319 && r < o ? 56320 == (64512 & (i = e.charCodeAt(r++))) ? n.push(((1023 & t) << 10) + (1023 & i) + 65536) : (n.push(t),
  31030. r--) : n.push(t);
  31031. return n
  31032. }
  31033. function A(e) {
  31034. return r(e, function(e) {
  31035. var t = "";
  31036. return 65535 < e && (t += R((e -= 65536) >>> 10 & 1023 | 55296),
  31037. e = 56320 | 1023 & e),
  31038. t + R(e)
  31039. }).join("")
  31040. }
  31041. function C(e, t) {
  31042. return e + 22 + 75 * (e < 26) - ((0 != t) << 5)
  31043. }
  31044. function I(e, t, i) {
  31045. var n = 0;
  31046. for (e = i ? M(e / u) : e >> 1,
  31047. e += M(e / t); m * w >> 1 < e; n += _)
  31048. e = M(e / m);
  31049. return M(n + (m + 1) * e / (e + h))
  31050. }
  31051. function i(e) {
  31052. var t, i, n, r, o, a, s, l, c, h, u, d = [], p = e.length, f = 0, g = x, m = T;
  31053. for ((i = e.lastIndexOf(S)) < 0 && (i = 0),
  31054. n = 0; n < i; ++n)
  31055. 128 <= e.charCodeAt(n) && v("not-basic"),
  31056. d.push(e.charCodeAt(n));
  31057. for (r = 0 < i ? i + 1 : 0; r < p; ) {
  31058. for (o = f,
  31059. a = 1,
  31060. s = _; p <= r && v("invalid-input"),
  31061. u = e.charCodeAt(r++),
  31062. (_ <= (l = u - 48 < 10 ? u - 22 : u - 65 < 26 ? u - 65 : u - 97 < 26 ? u - 97 : _) || l > M((E - f) / a)) && v("overflow"),
  31063. f += l * a,
  31064. !(l < (c = s <= m ? b : m + w <= s ? w : s - m)); s += _)
  31065. a > M(E / (h = _ - c)) && v("overflow"),
  31066. a *= h;
  31067. m = I(f - o, t = d.length + 1, 0 == o),
  31068. M(f / t) > E - g && v("overflow"),
  31069. g += M(f / t),
  31070. f %= t,
  31071. d.splice(f++, 0, g)
  31072. }
  31073. return A(d)
  31074. }
  31075. function n(e) {
  31076. var t, i, n, r, o, a, s, l, c, h, u, d, p, f, g, m = [];
  31077. for (d = (e = y(e)).length,
  31078. t = x,
  31079. o = T,
  31080. a = i = 0; a < d; ++a)
  31081. (u = e[a]) < 128 && m.push(R(u));
  31082. for (n = r = m.length,
  31083. r && m.push(S); n < d; ) {
  31084. for (s = E,
  31085. a = 0; a < d; ++a)
  31086. t <= (u = e[a]) && u < s && (s = u);
  31087. for (s - t > M((E - i) / (p = n + 1)) && v("overflow"),
  31088. i += (s - t) * p,
  31089. t = s,
  31090. a = 0; a < d; ++a)
  31091. if ((u = e[a]) < t && ++i > E && v("overflow"),
  31092. u == t) {
  31093. for (l = i,
  31094. c = _; !(l < (h = c <= o ? b : o + w <= c ? w : c - o)); c += _)
  31095. g = l - h,
  31096. f = _ - h,
  31097. m.push(R(C(h + g % f, 0))),
  31098. l = M(g / f);
  31099. m.push(R(C(l, 0))),
  31100. o = I(i, p, n == r),
  31101. i = 0,
  31102. ++n
  31103. }
  31104. ++i,
  31105. ++t
  31106. }
  31107. return m.join("")
  31108. }
  31109. var o = "object" == typeof L && L && !L.nodeType && L
  31110. , a = "object" == typeof O && O && !O.nodeType && O
  31111. , s = "object" == typeof P && P;
  31112. s.global !== s && s.window !== s && s.self !== s || (e = s);
  31113. var l, c, E = 2147483647, _ = 36, b = 1, w = 26, h = 38, u = 700, T = 72, x = 128, S = "-", d = /^xn--/, p = /[^\x20-\x7E]/, f = /[\x2E\u3002\uFF0E\uFF61]/g, g = {
  31114. overflow: "Overflow: input needs wider integers to process",
  31115. "not-basic": "Illegal input >= 0x80 (not a basic code point)",
  31116. "invalid-input": "Invalid input"
  31117. }, m = _ - b, M = Math.floor, R = String.fromCharCode;
  31118. if (l = {
  31119. version: "1.4.1",
  31120. ucs2: {
  31121. decode: y,
  31122. encode: A
  31123. },
  31124. decode: i,
  31125. encode: n,
  31126. toASCII: function(e) {
  31127. return t(e, function(e) {
  31128. return p.test(e) ? "xn--" + n(e) : e
  31129. })
  31130. },
  31131. toUnicode: function(e) {
  31132. return t(e, function(e) {
  31133. return d.test(e) ? i(e.slice(4).toLowerCase()) : e
  31134. })
  31135. }
  31136. },
  31137. "function" == typeof define && "object" == typeof define.amd && define.amd)
  31138. define("punycode", function() {
  31139. return l
  31140. });
  31141. else if (o && a)
  31142. if (O.exports == o)
  31143. a.exports = l;
  31144. else
  31145. for (c in l)
  31146. l.hasOwnProperty(c) && (o[c] = l[c]);
  31147. else
  31148. e.punycode = l
  31149. }(this)
  31150. }
  31151. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  31152. }
  31153. , {}],
  31154. 205: [function(e, t, i) {
  31155. "use strict";
  31156. t.exports = function(e, t, i, n) {
  31157. t = t || "&",
  31158. i = i || "=";
  31159. var r = {};
  31160. if ("string" != typeof e || 0 === e.length)
  31161. return r;
  31162. var o = /\+/g;
  31163. e = e.split(t);
  31164. var a = 1e3;
  31165. n && "number" == typeof n.maxKeys && (a = n.maxKeys);
  31166. var s, l, c = e.length;
  31167. 0 < a && a < c && (c = a);
  31168. for (var h = 0; h < c; ++h) {
  31169. var u, d, p, f, g = e[h].replace(o, "%20"), m = g.indexOf(i);
  31170. d = 0 <= m ? (u = g.substr(0, m),
  31171. g.substr(m + 1)) : (u = g,
  31172. ""),
  31173. p = decodeURIComponent(u),
  31174. f = decodeURIComponent(d),
  31175. s = r,
  31176. l = p,
  31177. Object.prototype.hasOwnProperty.call(s, l) ? v(r[p]) ? r[p].push(f) : r[p] = [r[p], f] : r[p] = f
  31178. }
  31179. return r
  31180. }
  31181. ;
  31182. var v = Array.isArray || function(e) {
  31183. return "[object Array]" === Object.prototype.toString.call(e)
  31184. }
  31185. }
  31186. , {}],
  31187. 206: [function(e, t, i) {
  31188. "use strict";
  31189. function o(e, t) {
  31190. if (e.map)
  31191. return e.map(t);
  31192. for (var i = [], n = 0; n < e.length; n++)
  31193. i.push(t(e[n], n));
  31194. return i
  31195. }
  31196. function a(e) {
  31197. switch (typeof e) {
  31198. case "string":
  31199. return e;
  31200. case "boolean":
  31201. return e ? "true" : "false";
  31202. case "number":
  31203. return isFinite(e) ? e : "";
  31204. default:
  31205. return ""
  31206. }
  31207. }
  31208. t.exports = function(i, n, r, e) {
  31209. return n = n || "&",
  31210. r = r || "=",
  31211. null === i && (i = void 0),
  31212. "object" == typeof i ? o(l(i), function(e) {
  31213. var t = encodeURIComponent(a(e)) + r;
  31214. return s(i[e]) ? o(i[e], function(e) {
  31215. return t + encodeURIComponent(a(e))
  31216. }).join(n) : t + encodeURIComponent(a(i[e]))
  31217. }).join(n) : e ? encodeURIComponent(a(e)) + r + encodeURIComponent(a(i)) : ""
  31218. }
  31219. ;
  31220. var s = Array.isArray || function(e) {
  31221. return "[object Array]" === Object.prototype.toString.call(e)
  31222. }
  31223. , l = Object.keys || function(e) {
  31224. var t = [];
  31225. for (var i in e)
  31226. Object.prototype.hasOwnProperty.call(e, i) && t.push(i);
  31227. return t
  31228. }
  31229. }
  31230. , {}],
  31231. 207: [function(e, t, i) {
  31232. "use strict";
  31233. i.decode = i.parse = e("./decode"),
  31234. i.encode = i.stringify = e("./encode")
  31235. }
  31236. , {
  31237. "./decode": 205,
  31238. "./encode": 206
  31239. }],
  31240. 208: [function(e, t, i) {
  31241. "use strict";
  31242. function x() {
  31243. this.protocol = null,
  31244. this.slashes = null,
  31245. this.auth = null,
  31246. this.host = null,
  31247. this.port = null,
  31248. this.hostname = null,
  31249. this.hash = null,
  31250. this.search = null,
  31251. this.query = null,
  31252. this.pathname = null,
  31253. this.path = null,
  31254. this.href = null
  31255. }
  31256. function n(e, t, i) {
  31257. if (e && D.isObject(e) && e instanceof x)
  31258. return e;
  31259. var n = new x;
  31260. return n.parse(e, t, i),
  31261. n
  31262. }
  31263. var L = e("punycode")
  31264. , D = e("./util");
  31265. i.parse = n,
  31266. i.resolve = function(e, t) {
  31267. return n(e, !1, !0).resolve(t)
  31268. }
  31269. ,
  31270. i.resolveObject = function(e, t) {
  31271. return e ? n(e, !1, !0).resolveObject(t) : t
  31272. }
  31273. ,
  31274. i.format = function(e) {
  31275. return D.isString(e) && (e = n(e)),
  31276. e instanceof x ? e.format() : x.prototype.format.call(e)
  31277. }
  31278. ,
  31279. i.Url = x;
  31280. var N = /^([a-z0-9.+-]+:)/i
  31281. , r = /:[0-9]*$/
  31282. , F = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/
  31283. , o = ["{", "}", "|", "\\", "^", "`"].concat(["<", ">", '"', "`", " ", "\r", "\n", "\t"])
  31284. , B = ["'"].concat(o)
  31285. , V = ["%", "/", "?", ";", "#"].concat(B)
  31286. , k = ["/", "?", "#"]
  31287. , U = /^[+a-z0-9A-Z_-]{0,63}$/
  31288. , H = /^([+a-z0-9A-Z_-]{0,63})(.*)$/
  31289. , z = {
  31290. javascript: !0,
  31291. "javascript:": !0
  31292. }
  31293. , G = {
  31294. javascript: !0,
  31295. "javascript:": !0
  31296. }
  31297. , W = {
  31298. http: !0,
  31299. https: !0,
  31300. ftp: !0,
  31301. gopher: !0,
  31302. file: !0,
  31303. "http:": !0,
  31304. "https:": !0,
  31305. "ftp:": !0,
  31306. "gopher:": !0,
  31307. "file:": !0
  31308. }
  31309. , j = e("querystring");
  31310. x.prototype.parse = function(e, t, i) {
  31311. if (!D.isString(e))
  31312. throw new TypeError("Parameter 'url' must be a string, not " + typeof e);
  31313. var n = e.indexOf("?")
  31314. , r = -1 !== n && n < e.indexOf("#") ? "?" : "#"
  31315. , o = e.split(r);
  31316. o[0] = o[0].replace(/\\/g, "/");
  31317. var a = e = o.join(r);
  31318. if (a = a.trim(),
  31319. !i && 1 === e.split("#").length) {
  31320. var s = F.exec(a);
  31321. if (s)
  31322. return this.path = a,
  31323. this.href = a,
  31324. this.pathname = s[1],
  31325. s[2] ? (this.search = s[2],
  31326. this.query = t ? j.parse(this.search.substr(1)) : this.search.substr(1)) : t && (this.search = "",
  31327. this.query = {}),
  31328. this
  31329. }
  31330. var l = N.exec(a);
  31331. if (l) {
  31332. var c = (l = l[0]).toLowerCase();
  31333. this.protocol = c,
  31334. a = a.substr(l.length)
  31335. }
  31336. if (i || l || a.match(/^\/\/[^@\/]+@[^@\/]+/)) {
  31337. var h = "//" === a.substr(0, 2);
  31338. !h || l && G[l] || (a = a.substr(2),
  31339. this.slashes = !0)
  31340. }
  31341. if (!G[l] && (h || l && !W[l])) {
  31342. for (var u = -1, d = 0; d < k.length; d++) {
  31343. -1 !== (g = a.indexOf(k[d])) && (-1 === u || g < u) && (u = g)
  31344. }
  31345. var p, f;
  31346. -1 !== (f = -1 === u ? a.lastIndexOf("@") : a.lastIndexOf("@", u)) && (p = a.slice(0, f),
  31347. a = a.slice(f + 1),
  31348. this.auth = decodeURIComponent(p)),
  31349. u = -1;
  31350. for (d = 0; d < V.length; d++) {
  31351. var g;
  31352. -1 !== (g = a.indexOf(V[d])) && (-1 === u || g < u) && (u = g)
  31353. }
  31354. -1 === u && (u = a.length),
  31355. this.host = a.slice(0, u),
  31356. a = a.slice(u),
  31357. this.parseHost(),
  31358. this.hostname = this.hostname || "";
  31359. var m = "[" === this.hostname[0] && "]" === this.hostname[this.hostname.length - 1];
  31360. if (!m)
  31361. for (var v = this.hostname.split(/\./), y = (d = 0,
  31362. v.length); d < y; d++) {
  31363. var A = v[d];
  31364. if (A && !A.match(U)) {
  31365. for (var C = "", I = 0, E = A.length; I < E; I++)
  31366. C += 127 < A.charCodeAt(I) ? "x" : A[I];
  31367. if (!C.match(U)) {
  31368. var _ = v.slice(0, d)
  31369. , b = v.slice(d + 1)
  31370. , w = A.match(H);
  31371. w && (_.push(w[1]),
  31372. b.unshift(w[2])),
  31373. b.length && (a = "/" + b.join(".") + a),
  31374. this.hostname = _.join(".");
  31375. break
  31376. }
  31377. }
  31378. }
  31379. 255 < this.hostname.length ? this.hostname = "" : this.hostname = this.hostname.toLowerCase(),
  31380. m || (this.hostname = L.toASCII(this.hostname));
  31381. var T = this.port ? ":" + this.port : ""
  31382. , x = this.hostname || "";
  31383. this.host = x + T,
  31384. this.href += this.host,
  31385. m && (this.hostname = this.hostname.substr(1, this.hostname.length - 2),
  31386. "/" !== a[0] && (a = "/" + a))
  31387. }
  31388. if (!z[c])
  31389. for (d = 0,
  31390. y = B.length; d < y; d++) {
  31391. var S = B[d];
  31392. if (-1 !== a.indexOf(S)) {
  31393. var M = encodeURIComponent(S);
  31394. M === S && (M = escape(S)),
  31395. a = a.split(S).join(M)
  31396. }
  31397. }
  31398. var R = a.indexOf("#");
  31399. -1 !== R && (this.hash = a.substr(R),
  31400. a = a.slice(0, R));
  31401. var P = a.indexOf("?");
  31402. if (-1 !== P ? (this.search = a.substr(P),
  31403. this.query = a.substr(P + 1),
  31404. t && (this.query = j.parse(this.query)),
  31405. a = a.slice(0, P)) : t && (this.search = "",
  31406. this.query = {}),
  31407. a && (this.pathname = a),
  31408. W[c] && this.hostname && !this.pathname && (this.pathname = "/"),
  31409. this.pathname || this.search) {
  31410. T = this.pathname || "";
  31411. var O = this.search || "";
  31412. this.path = T + O
  31413. }
  31414. return this.href = this.format(),
  31415. this
  31416. }
  31417. ,
  31418. x.prototype.format = function() {
  31419. var e = this.auth || "";
  31420. e && (e = (e = encodeURIComponent(e)).replace(/%3A/i, ":"),
  31421. e += "@");
  31422. var t = this.protocol || ""
  31423. , i = this.pathname || ""
  31424. , n = this.hash || ""
  31425. , r = !1
  31426. , o = "";
  31427. this.host ? r = e + this.host : this.hostname && (r = e + (-1 === this.hostname.indexOf(":") ? this.hostname : "[" + this.hostname + "]"),
  31428. this.port && (r += ":" + this.port)),
  31429. this.query && D.isObject(this.query) && Object.keys(this.query).length && (o = j.stringify(this.query));
  31430. var a = this.search || o && "?" + o || "";
  31431. return t && ":" !== t.substr(-1) && (t += ":"),
  31432. this.slashes || (!t || W[t]) && !1 !== r ? (r = "//" + (r || ""),
  31433. i && "/" !== i.charAt(0) && (i = "/" + i)) : r = r || "",
  31434. n && "#" !== n.charAt(0) && (n = "#" + n),
  31435. a && "?" !== a.charAt(0) && (a = "?" + a),
  31436. t + r + (i = i.replace(/[?#]/g, function(e) {
  31437. return encodeURIComponent(e)
  31438. })) + (a = a.replace("#", "%23")) + n
  31439. }
  31440. ,
  31441. x.prototype.resolve = function(e) {
  31442. return this.resolveObject(n(e, !1, !0)).format()
  31443. }
  31444. ,
  31445. x.prototype.resolveObject = function(e) {
  31446. if (D.isString(e)) {
  31447. var t = new x;
  31448. t.parse(e, !1, !0),
  31449. e = t
  31450. }
  31451. for (var i = new x, n = Object.keys(this), r = 0; r < n.length; r++) {
  31452. var o = n[r];
  31453. i[o] = this[o]
  31454. }
  31455. if (i.hash = e.hash,
  31456. "" === e.href)
  31457. return i.href = i.format(),
  31458. i;
  31459. if (e.slashes && !e.protocol) {
  31460. for (var a = Object.keys(e), s = 0; s < a.length; s++) {
  31461. var l = a[s];
  31462. "protocol" !== l && (i[l] = e[l])
  31463. }
  31464. return W[i.protocol] && i.hostname && !i.pathname && (i.path = i.pathname = "/"),
  31465. i.href = i.format(),
  31466. i
  31467. }
  31468. if (e.protocol && e.protocol !== i.protocol) {
  31469. if (!W[e.protocol]) {
  31470. for (var c = Object.keys(e), h = 0; h < c.length; h++) {
  31471. var u = c[h];
  31472. i[u] = e[u]
  31473. }
  31474. return i.href = i.format(),
  31475. i
  31476. }
  31477. if (i.protocol = e.protocol,
  31478. e.host || G[e.protocol])
  31479. i.pathname = e.pathname;
  31480. else {
  31481. for (var d = (e.pathname || "").split("/"); d.length && !(e.host = d.shift()); )
  31482. ;
  31483. e.host || (e.host = ""),
  31484. e.hostname || (e.hostname = ""),
  31485. "" !== d[0] && d.unshift(""),
  31486. d.length < 2 && d.unshift(""),
  31487. i.pathname = d.join("/")
  31488. }
  31489. if (i.search = e.search,
  31490. i.query = e.query,
  31491. i.host = e.host || "",
  31492. i.auth = e.auth,
  31493. i.hostname = e.hostname || e.host,
  31494. i.port = e.port,
  31495. i.pathname || i.search) {
  31496. var p = i.pathname || ""
  31497. , f = i.search || "";
  31498. i.path = p + f
  31499. }
  31500. return i.slashes = i.slashes || e.slashes,
  31501. i.href = i.format(),
  31502. i
  31503. }
  31504. var g = i.pathname && "/" === i.pathname.charAt(0)
  31505. , m = e.host || e.pathname && "/" === e.pathname.charAt(0)
  31506. , v = m || g || i.host && e.pathname
  31507. , y = v
  31508. , A = i.pathname && i.pathname.split("/") || []
  31509. , C = (d = e.pathname && e.pathname.split("/") || [],
  31510. i.protocol && !W[i.protocol]);
  31511. if (C && (i.hostname = "",
  31512. i.port = null,
  31513. i.host && ("" === A[0] ? A[0] = i.host : A.unshift(i.host)),
  31514. i.host = "",
  31515. e.protocol && (e.hostname = null,
  31516. e.port = null,
  31517. e.host && ("" === d[0] ? d[0] = e.host : d.unshift(e.host)),
  31518. e.host = null),
  31519. v = v && ("" === d[0] || "" === A[0])),
  31520. m)
  31521. i.host = e.host || "" === e.host ? e.host : i.host,
  31522. i.hostname = e.hostname || "" === e.hostname ? e.hostname : i.hostname,
  31523. i.search = e.search,
  31524. i.query = e.query,
  31525. A = d;
  31526. else if (d.length)
  31527. (A = A || []).pop(),
  31528. A = A.concat(d),
  31529. i.search = e.search,
  31530. i.query = e.query;
  31531. else if (!D.isNullOrUndefined(e.search)) {
  31532. if (C)
  31533. i.hostname = i.host = A.shift(),
  31534. (w = !!(i.host && 0 < i.host.indexOf("@")) && i.host.split("@")) && (i.auth = w.shift(),
  31535. i.host = i.hostname = w.shift());
  31536. return i.search = e.search,
  31537. i.query = e.query,
  31538. D.isNull(i.pathname) && D.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  31539. i.href = i.format(),
  31540. i
  31541. }
  31542. if (!A.length)
  31543. return i.pathname = null,
  31544. i.search ? i.path = "/" + i.search : i.path = null,
  31545. i.href = i.format(),
  31546. i;
  31547. for (var I = A.slice(-1)[0], E = (i.host || e.host || 1 < A.length) && ("." === I || ".." === I) || "" === I, _ = 0, b = A.length; 0 <= b; b--)
  31548. "." === (I = A[b]) ? A.splice(b, 1) : ".." === I ? (A.splice(b, 1),
  31549. _++) : _ && (A.splice(b, 1),
  31550. _--);
  31551. if (!v && !y)
  31552. for (; _--; )
  31553. A.unshift("..");
  31554. !v || "" === A[0] || A[0] && "/" === A[0].charAt(0) || A.unshift(""),
  31555. E && "/" !== A.join("/").substr(-1) && A.push("");
  31556. var w, T = "" === A[0] || A[0] && "/" === A[0].charAt(0);
  31557. C && (i.hostname = i.host = T ? "" : A.length ? A.shift() : "",
  31558. (w = !!(i.host && 0 < i.host.indexOf("@")) && i.host.split("@")) && (i.auth = w.shift(),
  31559. i.host = i.hostname = w.shift()));
  31560. return (v = v || i.host && A.length) && !T && A.unshift(""),
  31561. A.length ? i.pathname = A.join("/") : (i.pathname = null,
  31562. i.path = null),
  31563. D.isNull(i.pathname) && D.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  31564. i.auth = e.auth || i.auth,
  31565. i.slashes = i.slashes || e.slashes,
  31566. i.href = i.format(),
  31567. i
  31568. }
  31569. ,
  31570. x.prototype.parseHost = function() {
  31571. var e = this.host
  31572. , t = r.exec(e);
  31573. t && (":" !== (t = t[0]) && (this.port = t.substr(1)),
  31574. e = e.substr(0, e.length - t.length)),
  31575. e && (this.hostname = e)
  31576. }
  31577. }
  31578. , {
  31579. "./util": 209,
  31580. punycode: 204,
  31581. querystring: 207
  31582. }],
  31583. 209: [function(e, t, i) {
  31584. "use strict";
  31585. t.exports = {
  31586. isString: function(e) {
  31587. return "string" == typeof e
  31588. },
  31589. isObject: function(e) {
  31590. return "object" == typeof e && null !== e
  31591. },
  31592. isNull: function(e) {
  31593. return null === e
  31594. },
  31595. isNullOrUndefined: function(e) {
  31596. return null == e
  31597. }
  31598. }
  31599. }
  31600. , {}],
  31601. 210: [function(e, t, i) {
  31602. "use strict";
  31603. function r(e) {
  31604. return c + e
  31605. }
  31606. function s(e) {
  31607. if ("string" != typeof e)
  31608. throw new TypeError("key must be a string.")
  31609. }
  31610. var l = Object.prototype.hasOwnProperty
  31611. , c = "~";
  31612. t.exports = function(t) {
  31613. var o = Object.create(null)
  31614. , n = 0
  31615. , a = {};
  31616. return function(e, t) {
  31617. for (var i in t)
  31618. Object.defineProperty(e, i, {
  31619. value: t[i],
  31620. configurable: !0,
  31621. writable: !0
  31622. })
  31623. }(a, {
  31624. get: function(e, t) {
  31625. s(e);
  31626. var i = r(e);
  31627. return i in o ? o[i] : t
  31628. },
  31629. set: function(e, t) {
  31630. s(e);
  31631. var i = r(e);
  31632. return i in o || ++n,
  31633. o[i] = t
  31634. },
  31635. has: function(e) {
  31636. return s(e),
  31637. r(e)in o
  31638. },
  31639. delete: function(e) {
  31640. s(e);
  31641. var t = r(e);
  31642. return t in o && (--n,
  31643. delete o[t],
  31644. !0)
  31645. },
  31646. clear: function() {
  31647. o = Object.create(null),
  31648. n = 0
  31649. },
  31650. forEach: function(e, t) {
  31651. if ("function" != typeof e)
  31652. throw new TypeError("`callback` must be a function");
  31653. for (var i in o)
  31654. if (l.call(o, i)) {
  31655. var n = i.substring(c.length)
  31656. , r = o[i];
  31657. e.call(t, r, n, a)
  31658. }
  31659. }
  31660. }),
  31661. Object.defineProperty(a, "size", {
  31662. get: function() {
  31663. return n
  31664. },
  31665. configurable: !0
  31666. }),
  31667. "object" == typeof t && null !== t && Object.keys(t).forEach(function(e) {
  31668. a.set(e, t[e])
  31669. }),
  31670. a
  31671. }
  31672. }
  31673. , {}],
  31674. 211: [function(e, t, i) {
  31675. t.exports = e("./lib/heap")
  31676. }
  31677. , {
  31678. "./lib/heap": 212
  31679. }],
  31680. 212: [function(e, y, A) {
  31681. (function() {
  31682. var e, d, l, p, f, t, c, i, g, m, n, r, o, h, u, a, s;
  31683. function v(e) {
  31684. this.cmp = null != e ? e : d,
  31685. this.nodes = []
  31686. }
  31687. l = Math.floor,
  31688. m = Math.min,
  31689. d = function(e, t) {
  31690. return e < t ? -1 : t < e ? 1 : 0
  31691. }
  31692. ,
  31693. g = function(e, t, i, n, r) {
  31694. var o;
  31695. if (null == i && (i = 0),
  31696. null == r && (r = d),
  31697. i < 0)
  31698. throw new Error("lo must be non-negative");
  31699. for (null == n && (n = e.length); i < n; )
  31700. r(t, e[o = l((i + n) / 2)]) < 0 ? n = o : i = o + 1;
  31701. return [].splice.apply(e, [i, i - i].concat(t)),
  31702. t
  31703. }
  31704. ,
  31705. t = function(e, t, i) {
  31706. return null == i && (i = d),
  31707. e.push(t),
  31708. h(e, 0, e.length - 1, i)
  31709. }
  31710. ,
  31711. f = function(e, t) {
  31712. var i, n;
  31713. return null == t && (t = d),
  31714. i = e.pop(),
  31715. e.length ? (n = e[0],
  31716. e[0] = i,
  31717. u(e, 0, t)) : n = i,
  31718. n
  31719. }
  31720. ,
  31721. i = function(e, t, i) {
  31722. var n;
  31723. return null == i && (i = d),
  31724. n = e[0],
  31725. e[0] = t,
  31726. u(e, 0, i),
  31727. n
  31728. }
  31729. ,
  31730. c = function(e, t, i) {
  31731. var n;
  31732. return null == i && (i = d),
  31733. e.length && i(e[0], t) < 0 && (t = (n = [e[0], t])[0],
  31734. e[0] = n[1],
  31735. u(e, 0, i)),
  31736. t
  31737. }
  31738. ,
  31739. p = function(i, e) {
  31740. var t, n, r, o, a, s;
  31741. for (null == e && (e = d),
  31742. a = [],
  31743. n = 0,
  31744. r = (o = function() {
  31745. s = [];
  31746. for (var e = 0, t = l(i.length / 2); 0 <= t ? e < t : t < e; 0 <= t ? e++ : e--)
  31747. s.push(e);
  31748. return s
  31749. }
  31750. .apply(this).reverse()).length; n < r; n++)
  31751. t = o[n],
  31752. a.push(u(i, t, e));
  31753. return a
  31754. }
  31755. ,
  31756. o = function(e, t, i) {
  31757. var n;
  31758. if (null == i && (i = d),
  31759. -1 !== (n = e.indexOf(t)))
  31760. return h(e, 0, n, i),
  31761. u(e, n, i)
  31762. }
  31763. ,
  31764. n = function(e, t, i) {
  31765. var n, r, o, a, s;
  31766. if (null == i && (i = d),
  31767. !(r = e.slice(0, t)).length)
  31768. return r;
  31769. for (p(r, i),
  31770. o = 0,
  31771. a = (s = e.slice(t)).length; o < a; o++)
  31772. n = s[o],
  31773. c(r, n, i);
  31774. return r.sort(i).reverse()
  31775. }
  31776. ,
  31777. r = function(e, t, i) {
  31778. var n, r, o, a, s, l, c, h, u;
  31779. if (null == i && (i = d),
  31780. 10 * t <= e.length) {
  31781. if (!(o = e.slice(0, t).sort(i)).length)
  31782. return o;
  31783. for (r = o[o.length - 1],
  31784. a = 0,
  31785. l = (c = e.slice(t)).length; a < l; a++)
  31786. i(n = c[a], r) < 0 && (g(o, n, 0, null, i),
  31787. o.pop(),
  31788. r = o[o.length - 1]);
  31789. return o
  31790. }
  31791. for (p(e, i),
  31792. u = [],
  31793. s = 0,
  31794. h = m(t, e.length); 0 <= h ? s < h : h < s; 0 <= h ? ++s : --s)
  31795. u.push(f(e, i));
  31796. return u
  31797. }
  31798. ,
  31799. h = function(e, t, i, n) {
  31800. var r, o, a;
  31801. for (null == n && (n = d),
  31802. r = e[i]; t < i && n(r, o = e[a = i - 1 >> 1]) < 0; )
  31803. e[i] = o,
  31804. i = a;
  31805. return e[i] = r
  31806. }
  31807. ,
  31808. u = function(e, t, i) {
  31809. var n, r, o, a, s;
  31810. for (null == i && (i = d),
  31811. r = e.length,
  31812. o = e[s = t],
  31813. n = 2 * t + 1; n < r; )
  31814. (a = n + 1) < r && !(i(e[n], e[a]) < 0) && (n = a),
  31815. e[t] = e[n],
  31816. n = 2 * (t = n) + 1;
  31817. return e[t] = o,
  31818. h(e, s, t, i)
  31819. }
  31820. ,
  31821. v.push = t,
  31822. v.pop = f,
  31823. v.replace = i,
  31824. v.pushpop = c,
  31825. v.heapify = p,
  31826. v.updateItem = o,
  31827. v.nlargest = n,
  31828. v.nsmallest = r,
  31829. v.prototype.push = function(e) {
  31830. return t(this.nodes, e, this.cmp)
  31831. }
  31832. ,
  31833. v.prototype.pop = function() {
  31834. return f(this.nodes, this.cmp)
  31835. }
  31836. ,
  31837. v.prototype.peek = function() {
  31838. return this.nodes[0]
  31839. }
  31840. ,
  31841. v.prototype.contains = function(e) {
  31842. return -1 !== this.nodes.indexOf(e)
  31843. }
  31844. ,
  31845. v.prototype.replace = function(e) {
  31846. return i(this.nodes, e, this.cmp)
  31847. }
  31848. ,
  31849. v.prototype.pushpop = function(e) {
  31850. return c(this.nodes, e, this.cmp)
  31851. }
  31852. ,
  31853. v.prototype.heapify = function() {
  31854. return p(this.nodes, this.cmp)
  31855. }
  31856. ,
  31857. v.prototype.updateItem = function(e) {
  31858. return o(this.nodes, e, this.cmp)
  31859. }
  31860. ,
  31861. v.prototype.clear = function() {
  31862. return this.nodes = []
  31863. }
  31864. ,
  31865. v.prototype.empty = function() {
  31866. return 0 === this.nodes.length
  31867. }
  31868. ,
  31869. v.prototype.size = function() {
  31870. return this.nodes.length
  31871. }
  31872. ,
  31873. v.prototype.clone = function() {
  31874. var e;
  31875. return (e = new v).nodes = this.nodes.slice(0),
  31876. e
  31877. }
  31878. ,
  31879. v.prototype.toArray = function() {
  31880. return this.nodes.slice(0)
  31881. }
  31882. ,
  31883. v.prototype.insert = v.prototype.push,
  31884. v.prototype.top = v.prototype.peek,
  31885. v.prototype.front = v.prototype.peek,
  31886. v.prototype.has = v.prototype.contains,
  31887. v.prototype.copy = v.prototype.clone,
  31888. e = v,
  31889. a = this,
  31890. s = function() {
  31891. return e
  31892. }
  31893. ,
  31894. "function" == typeof define && define.amd ? define([], s) : "object" == typeof A ? y.exports = s() : a.Heap = s()
  31895. }
  31896. ).call(this)
  31897. }
  31898. , {}],
  31899. 213: [function(e, t, i) {
  31900. function n() {}
  31901. function o(e) {
  31902. if ("object" != typeof this)
  31903. throw new TypeError("Promises must be constructed via new");
  31904. if ("function" != typeof e)
  31905. throw new TypeError("not a function");
  31906. this._state = 0,
  31907. this._handled = !1,
  31908. this._value = void 0,
  31909. this._deferreds = [],
  31910. h(e, this)
  31911. }
  31912. function r(i, n) {
  31913. for (; 3 === i._state; )
  31914. i = i._value;
  31915. return 0 === i._state ? void i._deferreds.push(n) : (i._handled = !0,
  31916. void o._immediateFn(function() {
  31917. var e = 1 === i._state ? n.onFulfilled : n.onRejected;
  31918. if (null !== e) {
  31919. var t;
  31920. try {
  31921. t = e(i._value)
  31922. } catch (e) {
  31923. return void s(n.promise, e)
  31924. }
  31925. a(n.promise, t)
  31926. } else
  31927. (1 === i._state ? a : s)(n.promise, i._value)
  31928. }))
  31929. }
  31930. function a(e, t) {
  31931. try {
  31932. if (t === e)
  31933. throw new TypeError("A promise cannot be resolved with itself.");
  31934. if (t && ("object" == typeof t || "function" == typeof t)) {
  31935. var i = t.then;
  31936. if (t instanceof o)
  31937. return e._state = 3,
  31938. e._value = t,
  31939. void l(e);
  31940. if ("function" == typeof i)
  31941. return void h(function(e, t) {
  31942. return function() {
  31943. e.apply(t, arguments)
  31944. }
  31945. }(i, t), e)
  31946. }
  31947. e._state = 1,
  31948. e._value = t,
  31949. l(e)
  31950. } catch (t) {
  31951. s(e, t)
  31952. }
  31953. }
  31954. function s(e, t) {
  31955. e._state = 2,
  31956. e._value = t,
  31957. l(e)
  31958. }
  31959. function l(e) {
  31960. 2 === e._state && 0 === e._deferreds.length && o._immediateFn(function() {
  31961. e._handled || o._unhandledRejectionFn(e._value)
  31962. });
  31963. for (var t = 0, i = e._deferreds.length; t < i; t++)
  31964. r(e, e._deferreds[t]);
  31965. e._deferreds = null
  31966. }
  31967. function c(e, t, i) {
  31968. this.onFulfilled = "function" == typeof e ? e : null,
  31969. this.onRejected = "function" == typeof t ? t : null,
  31970. this.promise = i
  31971. }
  31972. function h(e, t) {
  31973. var i = !1;
  31974. try {
  31975. e(function(e) {
  31976. i || (i = !0,
  31977. a(t, e))
  31978. }, function(e) {
  31979. i || (i = !0,
  31980. s(t, e))
  31981. })
  31982. } catch (e) {
  31983. if (i)
  31984. return;
  31985. i = !0,
  31986. s(t, e)
  31987. }
  31988. }
  31989. var u, d;
  31990. u = this,
  31991. d = setTimeout,
  31992. o.prototype.catch = function(e) {
  31993. return this.then(null, e)
  31994. }
  31995. ,
  31996. o.prototype.then = function(e, t) {
  31997. var i = new this.constructor(n);
  31998. return r(this, new c(e,t,i)),
  31999. i
  32000. }
  32001. ,
  32002. o.all = function(e) {
  32003. var s = Array.prototype.slice.call(e);
  32004. return new o(function(n, r) {
  32005. function o(t, e) {
  32006. try {
  32007. if (e && ("object" == typeof e || "function" == typeof e)) {
  32008. var i = e.then;
  32009. if ("function" == typeof i)
  32010. return void i.call(e, function(e) {
  32011. o(t, e)
  32012. }, r)
  32013. }
  32014. s[t] = e,
  32015. 0 == --a && n(s)
  32016. } catch (e) {
  32017. r(e)
  32018. }
  32019. }
  32020. if (0 === s.length)
  32021. return n([]);
  32022. for (var a = s.length, e = 0; e < s.length; e++)
  32023. o(e, s[e])
  32024. }
  32025. )
  32026. }
  32027. ,
  32028. o.resolve = function(t) {
  32029. return t && "object" == typeof t && t.constructor === o ? t : new o(function(e) {
  32030. e(t)
  32031. }
  32032. )
  32033. }
  32034. ,
  32035. o.reject = function(i) {
  32036. return new o(function(e, t) {
  32037. t(i)
  32038. }
  32039. )
  32040. }
  32041. ,
  32042. o.race = function(r) {
  32043. return new o(function(e, t) {
  32044. for (var i = 0, n = r.length; i < n; i++)
  32045. r[i].then(e, t)
  32046. }
  32047. )
  32048. }
  32049. ,
  32050. o._immediateFn = "function" == typeof setImmediate && function(e) {
  32051. setImmediate(e)
  32052. }
  32053. || function(e) {
  32054. d(e, 0)
  32055. }
  32056. ,
  32057. o._unhandledRejectionFn = function(e) {
  32058. "undefined" != typeof console && console && console.warn("Possible Unhandled Promise Rejection:", e)
  32059. }
  32060. ,
  32061. o._setImmediateFn = function(e) {
  32062. o._immediateFn = e
  32063. }
  32064. ,
  32065. o._setUnhandledRejectionFn = function(e) {
  32066. o._unhandledRejectionFn = e
  32067. }
  32068. ,
  32069. void 0 !== t && t.exports ? t.exports = o : u.Promise || (u.Promise = o)
  32070. }
  32071. , {}],
  32072. 214: [function(p, i, e) {
  32073. (function(d) {
  32074. var e, t;
  32075. e = this,
  32076. t = function(I, e) {
  32077. "use strict";
  32078. var a, t, u, i, s, n, r, o = {};
  32079. return o.ByteBuffer = I,
  32080. o.Long = I.Long || null,
  32081. o.VERSION = "5.0.1",
  32082. o.WIRE_TYPES = {},
  32083. o.WIRE_TYPES.VARINT = 0,
  32084. o.WIRE_TYPES.BITS64 = 1,
  32085. o.WIRE_TYPES.LDELIM = 2,
  32086. o.WIRE_TYPES.STARTGROUP = 3,
  32087. o.WIRE_TYPES.ENDGROUP = 4,
  32088. o.WIRE_TYPES.BITS32 = 5,
  32089. o.PACKABLE_WIRE_TYPES = [o.WIRE_TYPES.VARINT, o.WIRE_TYPES.BITS64, o.WIRE_TYPES.BITS32],
  32090. o.TYPES = {
  32091. int32: {
  32092. name: "int32",
  32093. wireType: o.WIRE_TYPES.VARINT,
  32094. defaultValue: 0
  32095. },
  32096. uint32: {
  32097. name: "uint32",
  32098. wireType: o.WIRE_TYPES.VARINT,
  32099. defaultValue: 0
  32100. },
  32101. sint32: {
  32102. name: "sint32",
  32103. wireType: o.WIRE_TYPES.VARINT,
  32104. defaultValue: 0
  32105. },
  32106. int64: {
  32107. name: "int64",
  32108. wireType: o.WIRE_TYPES.VARINT,
  32109. defaultValue: o.Long ? o.Long.ZERO : void 0
  32110. },
  32111. uint64: {
  32112. name: "uint64",
  32113. wireType: o.WIRE_TYPES.VARINT,
  32114. defaultValue: o.Long ? o.Long.UZERO : void 0
  32115. },
  32116. sint64: {
  32117. name: "sint64",
  32118. wireType: o.WIRE_TYPES.VARINT,
  32119. defaultValue: o.Long ? o.Long.ZERO : void 0
  32120. },
  32121. bool: {
  32122. name: "bool",
  32123. wireType: o.WIRE_TYPES.VARINT,
  32124. defaultValue: !1
  32125. },
  32126. double: {
  32127. name: "double",
  32128. wireType: o.WIRE_TYPES.BITS64,
  32129. defaultValue: 0
  32130. },
  32131. string: {
  32132. name: "string",
  32133. wireType: o.WIRE_TYPES.LDELIM,
  32134. defaultValue: ""
  32135. },
  32136. bytes: {
  32137. name: "bytes",
  32138. wireType: o.WIRE_TYPES.LDELIM,
  32139. defaultValue: null
  32140. },
  32141. fixed32: {
  32142. name: "fixed32",
  32143. wireType: o.WIRE_TYPES.BITS32,
  32144. defaultValue: 0
  32145. },
  32146. sfixed32: {
  32147. name: "sfixed32",
  32148. wireType: o.WIRE_TYPES.BITS32,
  32149. defaultValue: 0
  32150. },
  32151. fixed64: {
  32152. name: "fixed64",
  32153. wireType: o.WIRE_TYPES.BITS64,
  32154. defaultValue: o.Long ? o.Long.UZERO : void 0
  32155. },
  32156. sfixed64: {
  32157. name: "sfixed64",
  32158. wireType: o.WIRE_TYPES.BITS64,
  32159. defaultValue: o.Long ? o.Long.ZERO : void 0
  32160. },
  32161. float: {
  32162. name: "float",
  32163. wireType: o.WIRE_TYPES.BITS32,
  32164. defaultValue: 0
  32165. },
  32166. enum: {
  32167. name: "enum",
  32168. wireType: o.WIRE_TYPES.VARINT,
  32169. defaultValue: 0
  32170. },
  32171. message: {
  32172. name: "message",
  32173. wireType: o.WIRE_TYPES.LDELIM,
  32174. defaultValue: null
  32175. },
  32176. group: {
  32177. name: "group",
  32178. wireType: o.WIRE_TYPES.STARTGROUP,
  32179. defaultValue: null
  32180. }
  32181. },
  32182. o.MAP_KEY_TYPES = [o.TYPES.int32, o.TYPES.sint32, o.TYPES.sfixed32, o.TYPES.uint32, o.TYPES.fixed32, o.TYPES.int64, o.TYPES.sint64, o.TYPES.sfixed64, o.TYPES.uint64, o.TYPES.fixed64, o.TYPES.bool, o.TYPES.string, o.TYPES.bytes],
  32183. o.ID_MIN = 1,
  32184. o.ID_MAX = 536870911,
  32185. o.convertFieldsToCamelCase = !1,
  32186. o.populateAccessors = !0,
  32187. o.populateDefaults = !0,
  32188. o.Util = ((r = {}).IS_NODE = !("object" != typeof d || d + "" != "[object process]" || d.browser),
  32189. r.XHR = function() {
  32190. for (var e = [function() {
  32191. return new XMLHttpRequest
  32192. }
  32193. , function() {
  32194. return new ActiveXObject("Msxml2.XMLHTTP")
  32195. }
  32196. , function() {
  32197. return new ActiveXObject("Msxml3.XMLHTTP")
  32198. }
  32199. , function() {
  32200. return new ActiveXObject("Microsoft.XMLHTTP")
  32201. }
  32202. ], t = null, i = 0; i < e.length; i++) {
  32203. try {
  32204. t = e[i]()
  32205. } catch (e) {
  32206. continue
  32207. }
  32208. break
  32209. }
  32210. if (!t)
  32211. throw Error("XMLHttpRequest is not supported");
  32212. return t
  32213. }
  32214. ,
  32215. r.fetch = function(e, i) {
  32216. if (i && "function" != typeof i && (i = null),
  32217. r.IS_NODE) {
  32218. var t = p("fs");
  32219. if (i)
  32220. t.readFile(e, function(e, t) {
  32221. i(e ? null : "" + t)
  32222. });
  32223. else
  32224. try {
  32225. return t.readFileSync(e)
  32226. } catch (e) {
  32227. return null
  32228. }
  32229. } else {
  32230. var n = r.XHR();
  32231. if (n.open("GET", e, !!i),
  32232. n.setRequestHeader("Accept", "text/plain"),
  32233. "function" == typeof n.overrideMimeType && n.overrideMimeType("text/plain"),
  32234. !i)
  32235. return n.send(null),
  32236. 200 == n.status || 0 == n.status && "string" == typeof n.responseText ? n.responseText : null;
  32237. if (n.onreadystatechange = function() {
  32238. 4 == n.readyState && i(200 == n.status || 0 == n.status && "string" == typeof n.responseText ? n.responseText : null)
  32239. }
  32240. ,
  32241. 4 == n.readyState)
  32242. return;
  32243. n.send(null)
  32244. }
  32245. }
  32246. ,
  32247. r.toCamelCase = function(e) {
  32248. return e.replace(/_([a-zA-Z])/g, function(e, t) {
  32249. return t.toUpperCase()
  32250. })
  32251. }
  32252. ,
  32253. r),
  32254. o.Lang = {
  32255. DELIM: /[\s\{\}=;:\[\],'"\(\)<>]/g,
  32256. RULE: /^(?:required|optional|repeated|map)$/,
  32257. TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,
  32258. NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,
  32259. TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,
  32260. TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,
  32261. FQTYPEREF: /^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,
  32262. NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,
  32263. NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,
  32264. NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/,
  32265. NUMBER_OCT: /^0[0-7]+$/,
  32266. NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,
  32267. BOOL: /^(?:true|false)$/i,
  32268. ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  32269. NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  32270. WHITESPACE: /\s/,
  32271. STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,
  32272. STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,
  32273. STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g
  32274. },
  32275. o.DotProto = function(r, a) {
  32276. function s(e, t) {
  32277. var i = -1
  32278. , n = 1;
  32279. if ("-" == e.charAt(0) && (n = -1,
  32280. e = e.substring(1)),
  32281. a.NUMBER_DEC.test(e))
  32282. i = parseInt(e);
  32283. else if (a.NUMBER_HEX.test(e))
  32284. i = parseInt(e.substring(2), 16);
  32285. else {
  32286. if (!a.NUMBER_OCT.test(e))
  32287. throw Error("illegal id value: " + (n < 0 ? "-" : "") + e);
  32288. i = parseInt(e.substring(1), 8)
  32289. }
  32290. if (i = n * i | 0,
  32291. !t && i < 0)
  32292. throw Error("illegal id value: " + (n < 0 ? "-" : "") + e);
  32293. return i
  32294. }
  32295. function o(e) {
  32296. var t = 1;
  32297. if ("-" == e.charAt(0) && (t = -1,
  32298. e = e.substring(1)),
  32299. a.NUMBER_DEC.test(e))
  32300. return t * parseInt(e, 10);
  32301. if (a.NUMBER_HEX.test(e))
  32302. return t * parseInt(e.substring(2), 16);
  32303. if (a.NUMBER_OCT.test(e))
  32304. return t * parseInt(e.substring(1), 8);
  32305. if ("inf" === e)
  32306. return t * (1 / 0);
  32307. if ("nan" === e)
  32308. return NaN;
  32309. if (a.NUMBER_FLT.test(e))
  32310. return t * parseFloat(e);
  32311. throw Error("illegal number value: " + (t < 0 ? "-" : "") + e)
  32312. }
  32313. function n(e, t, i) {
  32314. void 0 === e[t] ? e[t] = i : (Array.isArray(e[t]) || (e[t] = [e[t]]),
  32315. e[t].push(i))
  32316. }
  32317. function t(e) {
  32318. this.source = e + "",
  32319. this.index = 0,
  32320. this.line = 1,
  32321. this.stack = [],
  32322. this._stringOpen = null
  32323. }
  32324. var e = {}
  32325. , i = t.prototype;
  32326. i._readString = function() {
  32327. var e = '"' === this._stringOpen ? a.STRING_DQ : a.STRING_SQ;
  32328. e.lastIndex = this.index - 1;
  32329. var t = e.exec(this.source);
  32330. if (!t)
  32331. throw Error("unterminated string");
  32332. return this.index = e.lastIndex,
  32333. this.stack.push(this._stringOpen),
  32334. this._stringOpen = null,
  32335. t[1]
  32336. }
  32337. ,
  32338. i.next = function() {
  32339. if (0 < this.stack.length)
  32340. return this.stack.shift();
  32341. if (this.index >= this.source.length)
  32342. return null;
  32343. if (null !== this._stringOpen)
  32344. return this._readString();
  32345. var e, t, i;
  32346. do {
  32347. for (e = !1; a.WHITESPACE.test(i = this.source.charAt(this.index)); )
  32348. if ("\n" === i && ++this.line,
  32349. ++this.index === this.source.length)
  32350. return null;
  32351. if ("/" === this.source.charAt(this.index))
  32352. if (++this.index,
  32353. "/" === this.source.charAt(this.index)) {
  32354. for (; "\n" !== this.source.charAt(++this.index); )
  32355. if (this.index == this.source.length)
  32356. return null;
  32357. ++this.index,
  32358. ++this.line,
  32359. e = !0
  32360. } else {
  32361. if ("*" !== (i = this.source.charAt(this.index)))
  32362. return "/";
  32363. do {
  32364. if ("\n" === i && ++this.line,
  32365. ++this.index === this.source.length)
  32366. return null;
  32367. t = i,
  32368. i = this.source.charAt(this.index)
  32369. } while ("*" !== t || "/" !== i);++this.index,
  32370. e = !0
  32371. }
  32372. } while (e);if (this.index === this.source.length)
  32373. return null;
  32374. var n = this.index;
  32375. if (a.DELIM.lastIndex = 0,
  32376. !a.DELIM.test(this.source.charAt(n++)))
  32377. for (; n < this.source.length && !a.DELIM.test(this.source.charAt(n)); )
  32378. ++n;
  32379. var r = this.source.substring(this.index, this.index = n);
  32380. return '"' !== r && "'" !== r || (this._stringOpen = r),
  32381. r
  32382. }
  32383. ,
  32384. i.peek = function() {
  32385. if (0 === this.stack.length) {
  32386. var e = this.next();
  32387. if (null === e)
  32388. return null;
  32389. this.stack.push(e)
  32390. }
  32391. return this.stack[0]
  32392. }
  32393. ,
  32394. i.skip = function(e) {
  32395. var t = this.next();
  32396. if (t !== e)
  32397. throw Error("illegal '" + t + "', '" + e + "' expected")
  32398. }
  32399. ,
  32400. i.omit = function(e) {
  32401. return this.peek() === e && (this.next(),
  32402. !0)
  32403. }
  32404. ,
  32405. i.toString = function() {
  32406. return "Tokenizer (" + this.index + "/" + this.source.length + " at line " + this.line + ")"
  32407. }
  32408. ,
  32409. e.Tokenizer = t;
  32410. function l(e) {
  32411. this.tn = new t(e),
  32412. this.proto3 = !1
  32413. }
  32414. var c = l.prototype;
  32415. return c.parse = function() {
  32416. var e, t, i = {
  32417. name: "[ROOT]",
  32418. package: null,
  32419. messages: [],
  32420. enums: [],
  32421. imports: [],
  32422. options: {},
  32423. services: []
  32424. }, n = !0;
  32425. try {
  32426. for (; e = this.tn.next(); )
  32427. switch (e) {
  32428. case "package":
  32429. if (!n || null !== i.package)
  32430. throw Error("unexpected 'package'");
  32431. if (e = this.tn.next(),
  32432. !a.TYPEREF.test(e))
  32433. throw Error("illegal package name: " + e);
  32434. this.tn.skip(";"),
  32435. i.package = e;
  32436. break;
  32437. case "import":
  32438. if (!n)
  32439. throw Error("unexpected 'import'");
  32440. "public" !== (e = this.tn.peek()) && !(t = "weak" === e) || this.tn.next(),
  32441. e = this._readString(),
  32442. this.tn.skip(";"),
  32443. t || i.imports.push(e);
  32444. break;
  32445. case "syntax":
  32446. if (!n)
  32447. throw Error("unexpected 'syntax'");
  32448. this.tn.skip("="),
  32449. "proto3" === (i.syntax = this._readString()) && (this.proto3 = !0),
  32450. this.tn.skip(";");
  32451. break;
  32452. case "message":
  32453. this._parseMessage(i, null),
  32454. n = !1;
  32455. break;
  32456. case "enum":
  32457. this._parseEnum(i),
  32458. n = !1;
  32459. break;
  32460. case "option":
  32461. this._parseOption(i);
  32462. break;
  32463. case "service":
  32464. this._parseService(i);
  32465. break;
  32466. case "extend":
  32467. this._parseExtend(i);
  32468. break;
  32469. default:
  32470. throw Error("unexpected '" + e + "'")
  32471. }
  32472. } catch (e) {
  32473. throw e.message = "Parse error at line " + this.tn.line + ": " + e.message,
  32474. e
  32475. }
  32476. return delete i.name,
  32477. i
  32478. }
  32479. ,
  32480. l.parse = function(e) {
  32481. return new l(e).parse()
  32482. }
  32483. ,
  32484. c._readString = function() {
  32485. var e, t, i = "";
  32486. do {
  32487. if ("'" !== (t = this.tn.next()) && '"' !== t)
  32488. throw Error("illegal string delimiter: " + t);
  32489. i += this.tn.next(),
  32490. this.tn.skip(t),
  32491. e = this.tn.peek()
  32492. } while ('"' === e || '"' === e);return i
  32493. }
  32494. ,
  32495. c._readValue = function(e) {
  32496. var t = this.tn.peek();
  32497. if ('"' === t || "'" === t)
  32498. return this._readString();
  32499. if (this.tn.next(),
  32500. a.NUMBER.test(t))
  32501. return o(t);
  32502. if (a.BOOL.test(t))
  32503. return "true" === t.toLowerCase();
  32504. if (e && a.TYPEREF.test(t))
  32505. return t;
  32506. throw Error("illegal value: " + t)
  32507. }
  32508. ,
  32509. c._parseOption = function(e, t) {
  32510. var i = this.tn.next()
  32511. , n = !1;
  32512. if ("(" === i && (n = !0,
  32513. i = this.tn.next()),
  32514. !a.TYPEREF.test(i))
  32515. throw Error("illegal option name: " + i);
  32516. var r = i;
  32517. n && (this.tn.skip(")"),
  32518. r = "(" + r + ")",
  32519. i = this.tn.peek(),
  32520. a.FQTYPEREF.test(i) && (r += i,
  32521. this.tn.next())),
  32522. this.tn.skip("="),
  32523. this._parseOptionValue(e, r),
  32524. t || this.tn.skip(";")
  32525. }
  32526. ,
  32527. c._parseOptionValue = function(e, t) {
  32528. var i = this.tn.peek();
  32529. if ("{" !== i)
  32530. n(e.options, t, this._readValue(!0));
  32531. else
  32532. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); ) {
  32533. if (!a.NAME.test(i))
  32534. throw Error("illegal option name: " + t + "." + i);
  32535. this.tn.omit(":") ? n(e.options, t + "." + i, this._readValue(!0)) : this._parseOptionValue(e, t + "." + i)
  32536. }
  32537. }
  32538. ,
  32539. c._parseService = function(e) {
  32540. var t = this.tn.next();
  32541. if (!a.NAME.test(t))
  32542. throw Error("illegal service name at line " + this.tn.line + ": " + t);
  32543. var i = {
  32544. name: t,
  32545. rpc: {},
  32546. options: {}
  32547. };
  32548. for (this.tn.skip("{"); "}" !== (t = this.tn.next()); )
  32549. if ("option" === t)
  32550. this._parseOption(i);
  32551. else {
  32552. if ("rpc" !== t)
  32553. throw Error("illegal service token: " + t);
  32554. this._parseServiceRPC(i)
  32555. }
  32556. this.tn.omit(";"),
  32557. e.services.push(i)
  32558. }
  32559. ,
  32560. c._parseServiceRPC = function(e) {
  32561. var t = this.tn.next();
  32562. if (!a.NAME.test(t))
  32563. throw Error("illegal rpc service method name: " + t);
  32564. var i = t
  32565. , n = {
  32566. request: null,
  32567. response: null,
  32568. request_stream: !1,
  32569. response_stream: !1,
  32570. options: {}
  32571. };
  32572. if (this.tn.skip("("),
  32573. "stream" === (t = this.tn.next()).toLowerCase() && (n.request_stream = !0,
  32574. t = this.tn.next()),
  32575. !a.TYPEREF.test(t))
  32576. throw Error("illegal rpc service request type: " + t);
  32577. if (n.request = t,
  32578. this.tn.skip(")"),
  32579. "returns" !== (t = this.tn.next()).toLowerCase())
  32580. throw Error("illegal rpc service request type delimiter: " + t);
  32581. if (this.tn.skip("("),
  32582. "stream" === (t = this.tn.next()).toLowerCase() && (n.response_stream = !0,
  32583. t = this.tn.next()),
  32584. n.response = t,
  32585. this.tn.skip(")"),
  32586. "{" === (t = this.tn.peek())) {
  32587. for (this.tn.next(); "}" !== (t = this.tn.next()); ) {
  32588. if ("option" !== t)
  32589. throw Error("illegal rpc service token: " + t);
  32590. this._parseOption(n)
  32591. }
  32592. this.tn.omit(";")
  32593. } else
  32594. this.tn.skip(";");
  32595. void 0 === e.rpc && (e.rpc = {}),
  32596. e.rpc[i] = n
  32597. }
  32598. ,
  32599. c._parseMessage = function(e, t) {
  32600. var i = !!t
  32601. , n = this.tn.next()
  32602. , r = {
  32603. name: "",
  32604. fields: [],
  32605. enums: [],
  32606. messages: [],
  32607. options: {},
  32608. services: [],
  32609. oneofs: {}
  32610. };
  32611. if (!a.NAME.test(n))
  32612. throw Error("illegal " + (i ? "group" : "message") + " name: " + n);
  32613. for (r.name = n,
  32614. i && (this.tn.skip("="),
  32615. t.id = s(this.tn.next()),
  32616. r.isGroup = !0),
  32617. "[" === (n = this.tn.peek()) && t && this._parseFieldOptions(t),
  32618. this.tn.skip("{"); "}" !== (n = this.tn.next()); )
  32619. if (a.RULE.test(n))
  32620. this._parseMessageField(r, n);
  32621. else if ("oneof" === n)
  32622. this._parseMessageOneOf(r);
  32623. else if ("enum" === n)
  32624. this._parseEnum(r);
  32625. else if ("message" === n)
  32626. this._parseMessage(r);
  32627. else if ("option" === n)
  32628. this._parseOption(r);
  32629. else if ("service" === n)
  32630. this._parseService(r);
  32631. else if ("extensions" === n)
  32632. r.extensions = this._parseExtensionRanges();
  32633. else if ("reserved" === n)
  32634. this._parseIgnored();
  32635. else if ("extend" === n)
  32636. this._parseExtend(r);
  32637. else {
  32638. if (!a.TYPEREF.test(n))
  32639. throw Error("illegal message token: " + n);
  32640. if (!this.proto3)
  32641. throw Error("illegal field rule: " + n);
  32642. this._parseMessageField(r, "optional", n)
  32643. }
  32644. return this.tn.omit(";"),
  32645. e.messages.push(r),
  32646. r
  32647. }
  32648. ,
  32649. c._parseIgnored = function() {
  32650. for (; ";" !== this.tn.peek(); )
  32651. this.tn.next();
  32652. this.tn.skip(";")
  32653. }
  32654. ,
  32655. c._parseMessageField = function(e, t, i) {
  32656. if (!a.RULE.test(t))
  32657. throw Error("illegal message field rule: " + t);
  32658. var n, r = {
  32659. rule: t,
  32660. type: "",
  32661. name: "",
  32662. options: {},
  32663. id: 0
  32664. };
  32665. if ("map" === t) {
  32666. if (i)
  32667. throw Error("illegal type: " + i);
  32668. if (this.tn.skip("<"),
  32669. n = this.tn.next(),
  32670. !a.TYPE.test(n) && !a.TYPEREF.test(n))
  32671. throw Error("illegal message field type: " + n);
  32672. if (r.keytype = n,
  32673. this.tn.skip(","),
  32674. n = this.tn.next(),
  32675. !a.TYPE.test(n) && !a.TYPEREF.test(n))
  32676. throw Error("illegal message field: " + n);
  32677. if (r.type = n,
  32678. this.tn.skip(">"),
  32679. n = this.tn.next(),
  32680. !a.NAME.test(n))
  32681. throw Error("illegal message field name: " + n);
  32682. r.name = n,
  32683. this.tn.skip("="),
  32684. r.id = s(this.tn.next()),
  32685. "[" === (n = this.tn.peek()) && this._parseFieldOptions(r),
  32686. this.tn.skip(";")
  32687. } else if ("group" === (i = void 0 !== i ? i : this.tn.next())) {
  32688. var o = this._parseMessage(e, r);
  32689. if (!/^[A-Z]/.test(o.name))
  32690. throw Error("illegal group name: " + o.name);
  32691. r.type = o.name,
  32692. r.name = o.name.toLowerCase(),
  32693. this.tn.omit(";")
  32694. } else {
  32695. if (!a.TYPE.test(i) && !a.TYPEREF.test(i))
  32696. throw Error("illegal message field type: " + i);
  32697. if (r.type = i,
  32698. n = this.tn.next(),
  32699. !a.NAME.test(n))
  32700. throw Error("illegal message field name: " + n);
  32701. r.name = n,
  32702. this.tn.skip("="),
  32703. r.id = s(this.tn.next()),
  32704. "[" === (n = this.tn.peek()) && this._parseFieldOptions(r),
  32705. this.tn.skip(";")
  32706. }
  32707. return e.fields.push(r),
  32708. r
  32709. }
  32710. ,
  32711. c._parseMessageOneOf = function(e) {
  32712. var t = this.tn.next();
  32713. if (!a.NAME.test(t))
  32714. throw Error("illegal oneof name: " + t);
  32715. var i, n = t, r = [];
  32716. for (this.tn.skip("{"); "}" !== (t = this.tn.next()); )
  32717. (i = this._parseMessageField(e, "optional", t)).oneof = n,
  32718. r.push(i.id);
  32719. this.tn.omit(";"),
  32720. e.oneofs[n] = r
  32721. }
  32722. ,
  32723. c._parseFieldOptions = function(e) {
  32724. this.tn.skip("[");
  32725. for (var t = !0; "]" !== this.tn.peek(); )
  32726. t || this.tn.skip(","),
  32727. this._parseOption(e, !0),
  32728. t = !1;
  32729. this.tn.next()
  32730. }
  32731. ,
  32732. c._parseEnum = function(e) {
  32733. var t = {
  32734. name: "",
  32735. values: [],
  32736. options: {}
  32737. }
  32738. , i = this.tn.next();
  32739. if (!a.NAME.test(i))
  32740. throw Error("illegal name: " + i);
  32741. for (t.name = i,
  32742. this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  32743. if ("option" === i)
  32744. this._parseOption(t);
  32745. else {
  32746. if (!a.NAME.test(i))
  32747. throw Error("illegal name: " + i);
  32748. this.tn.skip("=");
  32749. var n = {
  32750. name: i,
  32751. id: s(this.tn.next(), !0)
  32752. };
  32753. "[" === (i = this.tn.peek()) && this._parseFieldOptions({
  32754. options: {}
  32755. }),
  32756. this.tn.skip(";"),
  32757. t.values.push(n)
  32758. }
  32759. this.tn.omit(";"),
  32760. e.enums.push(t)
  32761. }
  32762. ,
  32763. c._parseExtensionRanges = function() {
  32764. var e, t, i, n = [];
  32765. do {
  32766. for (t = []; ; ) {
  32767. switch (e = this.tn.next()) {
  32768. case "min":
  32769. i = r.ID_MIN;
  32770. break;
  32771. case "max":
  32772. i = r.ID_MAX;
  32773. break;
  32774. default:
  32775. i = o(e)
  32776. }
  32777. if (t.push(i),
  32778. 2 === t.length)
  32779. break;
  32780. if ("to" !== this.tn.peek()) {
  32781. t.push(i);
  32782. break
  32783. }
  32784. this.tn.next()
  32785. }
  32786. n.push(t)
  32787. } while (this.tn.omit(","));return this.tn.skip(";"),
  32788. n
  32789. }
  32790. ,
  32791. c._parseExtend = function(e) {
  32792. var t = this.tn.next();
  32793. if (!a.TYPEREF.test(t))
  32794. throw Error("illegal extend reference: " + t);
  32795. var i = {
  32796. ref: t,
  32797. fields: []
  32798. };
  32799. for (this.tn.skip("{"); "}" !== (t = this.tn.next()); )
  32800. if (a.RULE.test(t))
  32801. this._parseMessageField(i, t);
  32802. else {
  32803. if (!a.TYPEREF.test(t))
  32804. throw Error("illegal extend token: " + t);
  32805. if (!this.proto3)
  32806. throw Error("illegal field rule: " + t);
  32807. this._parseMessageField(i, "optional", t)
  32808. }
  32809. return this.tn.omit(";"),
  32810. e.messages.push(i),
  32811. i
  32812. }
  32813. ,
  32814. c.toString = function() {
  32815. return "Parser at line " + this.tn.line
  32816. }
  32817. ,
  32818. e.Parser = l,
  32819. e
  32820. }(o, o.Lang),
  32821. o.Reflect = function(g) {
  32822. function a(e, t) {
  32823. if (e && "number" == typeof e.low && "number" == typeof e.high && "boolean" == typeof e.unsigned && e.low == e.low && e.high == e.high)
  32824. return new g.Long(e.low,e.high,void 0 === t ? e.unsigned : t);
  32825. if ("string" == typeof e)
  32826. return g.Long.fromString(e, t || !1, 10);
  32827. if ("number" == typeof e)
  32828. return g.Long.fromNumber(e, t || !1);
  32829. throw Error("not convertible to Long")
  32830. }
  32831. function m(e, t) {
  32832. var i = t.readVarint32()
  32833. , n = 7 & i
  32834. , r = i >>> 3;
  32835. switch (n) {
  32836. case g.WIRE_TYPES.VARINT:
  32837. for (; 128 == (128 & (i = t.readUint8())); )
  32838. ;
  32839. break;
  32840. case g.WIRE_TYPES.BITS64:
  32841. t.offset += 8;
  32842. break;
  32843. case g.WIRE_TYPES.LDELIM:
  32844. i = t.readVarint32(),
  32845. t.offset += i;
  32846. break;
  32847. case g.WIRE_TYPES.STARTGROUP:
  32848. m(r, t);
  32849. break;
  32850. case g.WIRE_TYPES.ENDGROUP:
  32851. if (r === e)
  32852. return !1;
  32853. throw Error("Illegal GROUPEND after unknown group: " + r + " (" + e + " expected)");
  32854. case g.WIRE_TYPES.BITS32:
  32855. t.offset += 4;
  32856. break;
  32857. default:
  32858. throw Error("Illegal wire type in unknown group " + e + ": " + n)
  32859. }
  32860. return !0
  32861. }
  32862. function h(e, t, i) {
  32863. this.builder = e,
  32864. this.parent = t,
  32865. this.name = i,
  32866. this.className
  32867. }
  32868. var s = {}
  32869. , e = h.prototype;
  32870. e.fqn = function() {
  32871. for (var e = this.name, t = this; null != (t = t.parent); )
  32872. e = t.name + "." + e;
  32873. return e
  32874. }
  32875. ,
  32876. e.toString = function(e) {
  32877. return (e ? this.className + " " : "") + this.fqn()
  32878. }
  32879. ,
  32880. e.build = function() {
  32881. throw Error(this.toString(!0) + " cannot be built directly")
  32882. }
  32883. ,
  32884. s.T = h;
  32885. function l(e, t, i, n, r) {
  32886. h.call(this, e, t, i),
  32887. this.className = "Namespace",
  32888. this.children = [],
  32889. this.options = n || {},
  32890. this.syntax = r || "proto2"
  32891. }
  32892. var t = l.prototype = Object.create(h.prototype);
  32893. t.getChildren = function(e) {
  32894. if (null == (e = e || null))
  32895. return this.children.slice();
  32896. for (var t = [], i = 0, n = this.children.length; i < n; ++i)
  32897. this.children[i]instanceof e && t.push(this.children[i]);
  32898. return t
  32899. }
  32900. ,
  32901. t.addChild = function(e) {
  32902. var t;
  32903. if (t = this.getChild(e.name))
  32904. if (t instanceof d.Field && t.name !== t.originalName && null === this.getChild(t.originalName))
  32905. t.name = t.originalName;
  32906. else {
  32907. if (!(e instanceof d.Field && e.name !== e.originalName && null === this.getChild(e.originalName)))
  32908. throw Error("Duplicate name in namespace " + this.toString(!0) + ": " + e.name);
  32909. e.name = e.originalName
  32910. }
  32911. this.children.push(e)
  32912. }
  32913. ,
  32914. t.getChild = function(e) {
  32915. for (var t = "number" == typeof e ? "id" : "name", i = 0, n = this.children.length; i < n; ++i)
  32916. if (this.children[i][t] === e)
  32917. return this.children[i];
  32918. return null
  32919. }
  32920. ,
  32921. t.resolve = function(e, t) {
  32922. var i, n = "string" == typeof e ? e.split(".") : e, r = this, o = 0;
  32923. if ("" === n[o]) {
  32924. for (; null !== r.parent; )
  32925. r = r.parent;
  32926. o++
  32927. }
  32928. do {
  32929. do {
  32930. if (!(r instanceof s.Namespace)) {
  32931. r = null;
  32932. break
  32933. }
  32934. if (!(i = r.getChild(n[o])) || !(i instanceof s.T) || t && !(i instanceof s.Namespace)) {
  32935. r = null;
  32936. break
  32937. }
  32938. r = i,
  32939. o++
  32940. } while (o < n.length);if (null != r)
  32941. break;
  32942. if (null !== this.parent)
  32943. return this.parent.resolve(e, t)
  32944. } while (null != r);return r
  32945. }
  32946. ,
  32947. t.qn = function(e) {
  32948. for (var t = [], i = e; t.unshift(i.name),
  32949. null !== (i = i.parent); )
  32950. ;
  32951. for (var n = 1; n <= t.length; n++) {
  32952. var r = t.slice(t.length - n);
  32953. if (e === this.resolve(r, e instanceof s.Namespace))
  32954. return r.join(".")
  32955. }
  32956. return e.fqn()
  32957. }
  32958. ,
  32959. t.build = function() {
  32960. for (var e, t = {}, i = this.children, n = 0, r = i.length; n < r; ++n)
  32961. (e = i[n])instanceof l && (t[e.name] = e.build());
  32962. return Object.defineProperty && Object.defineProperty(t, "$options", {
  32963. value: this.buildOpt()
  32964. }),
  32965. t
  32966. }
  32967. ,
  32968. t.buildOpt = function() {
  32969. for (var e = {}, t = Object.keys(this.options), i = 0, n = t.length; i < n; ++i) {
  32970. var r = t[i]
  32971. , o = this.options[t[i]];
  32972. e[r] = o
  32973. }
  32974. return e
  32975. }
  32976. ,
  32977. t.getOption = function(e) {
  32978. return void 0 === e ? this.options : void 0 !== this.options[e] ? this.options[e] : null
  32979. }
  32980. ,
  32981. s.Namespace = l;
  32982. function u(e, t, i, n) {
  32983. if (this.type = e,
  32984. this.resolvedType = t,
  32985. this.isMapKey = i,
  32986. this.syntax = n,
  32987. i && g.MAP_KEY_TYPES.indexOf(e) < 0)
  32988. throw Error("Invalid map key type: " + e.name)
  32989. }
  32990. var i = u.prototype;
  32991. u.defaultFieldValue = function(e) {
  32992. if ("string" == typeof e && (e = g.TYPES[e]),
  32993. void 0 === e.defaultValue)
  32994. throw Error("default value for type " + e.name + " is not supported");
  32995. return e == g.TYPES.bytes ? new I(0) : e.defaultValue
  32996. }
  32997. ,
  32998. i.verifyValue = function(t) {
  32999. function i(e, t) {
  33000. throw Error("Illegal value for " + n.toString(!0) + " of type " + n.type.name + ": " + e + " (" + t + ")")
  33001. }
  33002. var n = this;
  33003. switch (this.type) {
  33004. case g.TYPES.int32:
  33005. case g.TYPES.sint32:
  33006. case g.TYPES.sfixed32:
  33007. return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"),
  33008. 4294967295 < t ? 0 | t : t;
  33009. case g.TYPES.uint32:
  33010. case g.TYPES.fixed32:
  33011. return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"),
  33012. t < 0 ? t >>> 0 : t;
  33013. case g.TYPES.int64:
  33014. case g.TYPES.sint64:
  33015. case g.TYPES.sfixed64:
  33016. if (g.Long)
  33017. try {
  33018. return a(t, !1)
  33019. } catch (e) {
  33020. i(typeof t, e.message)
  33021. }
  33022. else
  33023. i(typeof t, "requires Long.js");
  33024. case g.TYPES.uint64:
  33025. case g.TYPES.fixed64:
  33026. if (g.Long)
  33027. try {
  33028. return a(t, !0)
  33029. } catch (e) {
  33030. i(typeof t, e.message)
  33031. }
  33032. else
  33033. i(typeof t, "requires Long.js");
  33034. case g.TYPES.bool:
  33035. return "boolean" != typeof t && i(typeof t, "not a boolean"),
  33036. t;
  33037. case g.TYPES.float:
  33038. case g.TYPES.double:
  33039. return "number" != typeof t && i(typeof t, "not a number"),
  33040. t;
  33041. case g.TYPES.string:
  33042. return "string" == typeof t || t && t instanceof String || i(typeof t, "not a string"),
  33043. "" + t;
  33044. case g.TYPES.bytes:
  33045. return I.isByteBuffer(t) ? t : I.wrap(t, "base64");
  33046. case g.TYPES.enum:
  33047. var e = this.resolvedType.getChildren(g.Reflect.Enum.Value);
  33048. for (o = 0; o < e.length; o++) {
  33049. if (e[o].name == t)
  33050. return e[o].id;
  33051. if (e[o].id == t)
  33052. return e[o].id
  33053. }
  33054. if ("proto3" === this.syntax)
  33055. return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"),
  33056. (4294967295 < t || t < 0) && i(typeof t, "not in range for uint32"),
  33057. t;
  33058. i(t, "not a valid enum value");
  33059. case g.TYPES.group:
  33060. case g.TYPES.message:
  33061. if (t && "object" == typeof t || i(typeof t, "object expected"),
  33062. t instanceof this.resolvedType.clazz)
  33063. return t;
  33064. if (t instanceof g.Builder.Message) {
  33065. var r = {};
  33066. for (var o in t)
  33067. t.hasOwnProperty(o) && (r[o] = t[o]);
  33068. t = r
  33069. }
  33070. return new this.resolvedType.clazz(t)
  33071. }
  33072. throw Error("[INTERNAL] Illegal value for " + this.toString(!0) + ": " + t + " (undefined type " + this.type + ")")
  33073. }
  33074. ,
  33075. i.calculateLength = function(e, t) {
  33076. if (null === t)
  33077. return 0;
  33078. var i;
  33079. switch (this.type) {
  33080. case g.TYPES.int32:
  33081. return t < 0 ? I.calculateVarint64(t) : I.calculateVarint32(t);
  33082. case g.TYPES.uint32:
  33083. return I.calculateVarint32(t);
  33084. case g.TYPES.sint32:
  33085. return I.calculateVarint32(I.zigZagEncode32(t));
  33086. case g.TYPES.fixed32:
  33087. case g.TYPES.sfixed32:
  33088. case g.TYPES.float:
  33089. return 4;
  33090. case g.TYPES.int64:
  33091. case g.TYPES.uint64:
  33092. return I.calculateVarint64(t);
  33093. case g.TYPES.sint64:
  33094. return I.calculateVarint64(I.zigZagEncode64(t));
  33095. case g.TYPES.fixed64:
  33096. case g.TYPES.sfixed64:
  33097. return 8;
  33098. case g.TYPES.bool:
  33099. return 1;
  33100. case g.TYPES.enum:
  33101. return I.calculateVarint32(t);
  33102. case g.TYPES.double:
  33103. return 8;
  33104. case g.TYPES.string:
  33105. return i = I.calculateUTF8Bytes(t),
  33106. I.calculateVarint32(i) + i;
  33107. case g.TYPES.bytes:
  33108. if (t.remaining() < 0)
  33109. throw Error("Illegal value for " + this.toString(!0) + ": " + t.remaining() + " bytes remaining");
  33110. return I.calculateVarint32(t.remaining()) + t.remaining();
  33111. case g.TYPES.message:
  33112. return i = this.resolvedType.calculate(t),
  33113. I.calculateVarint32(i) + i;
  33114. case g.TYPES.group:
  33115. return (i = this.resolvedType.calculate(t)) + I.calculateVarint32(e << 3 | g.WIRE_TYPES.ENDGROUP)
  33116. }
  33117. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + t + " (unknown type)")
  33118. }
  33119. ,
  33120. i.encodeValue = function(e, t, i) {
  33121. if (null === t)
  33122. return i;
  33123. switch (this.type) {
  33124. case g.TYPES.int32:
  33125. t < 0 ? i.writeVarint64(t) : i.writeVarint32(t);
  33126. break;
  33127. case g.TYPES.uint32:
  33128. i.writeVarint32(t);
  33129. break;
  33130. case g.TYPES.sint32:
  33131. i.writeVarint32ZigZag(t);
  33132. break;
  33133. case g.TYPES.fixed32:
  33134. i.writeUint32(t);
  33135. break;
  33136. case g.TYPES.sfixed32:
  33137. i.writeInt32(t);
  33138. break;
  33139. case g.TYPES.int64:
  33140. case g.TYPES.uint64:
  33141. i.writeVarint64(t);
  33142. break;
  33143. case g.TYPES.sint64:
  33144. i.writeVarint64ZigZag(t);
  33145. break;
  33146. case g.TYPES.fixed64:
  33147. i.writeUint64(t);
  33148. break;
  33149. case g.TYPES.sfixed64:
  33150. i.writeInt64(t);
  33151. break;
  33152. case g.TYPES.bool:
  33153. "string" == typeof t ? i.writeVarint32("false" === t.toLowerCase() ? 0 : !!t) : i.writeVarint32(t ? 1 : 0);
  33154. break;
  33155. case g.TYPES.enum:
  33156. i.writeVarint32(t);
  33157. break;
  33158. case g.TYPES.float:
  33159. i.writeFloat32(t);
  33160. break;
  33161. case g.TYPES.double:
  33162. i.writeFloat64(t);
  33163. break;
  33164. case g.TYPES.string:
  33165. i.writeVString(t);
  33166. break;
  33167. case g.TYPES.bytes:
  33168. if (t.remaining() < 0)
  33169. throw Error("Illegal value for " + this.toString(!0) + ": " + t.remaining() + " bytes remaining");
  33170. var n = t.offset;
  33171. i.writeVarint32(t.remaining()),
  33172. i.append(t),
  33173. t.offset = n;
  33174. break;
  33175. case g.TYPES.message:
  33176. var r = (new I).LE();
  33177. this.resolvedType.encode(t, r),
  33178. i.writeVarint32(r.offset),
  33179. i.append(r.flip());
  33180. break;
  33181. case g.TYPES.group:
  33182. this.resolvedType.encode(t, i),
  33183. i.writeVarint32(e << 3 | g.WIRE_TYPES.ENDGROUP);
  33184. break;
  33185. default:
  33186. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + t + " (unknown type)")
  33187. }
  33188. return i
  33189. }
  33190. ,
  33191. i.decode = function(e, t, i) {
  33192. if (t != this.type.wireType)
  33193. throw Error("Unexpected wire type for element");
  33194. var n, r;
  33195. switch (this.type) {
  33196. case g.TYPES.int32:
  33197. return 0 | e.readVarint32();
  33198. case g.TYPES.uint32:
  33199. return e.readVarint32() >>> 0;
  33200. case g.TYPES.sint32:
  33201. return 0 | e.readVarint32ZigZag();
  33202. case g.TYPES.fixed32:
  33203. return e.readUint32() >>> 0;
  33204. case g.TYPES.sfixed32:
  33205. return 0 | e.readInt32();
  33206. case g.TYPES.int64:
  33207. return e.readVarint64();
  33208. case g.TYPES.uint64:
  33209. return e.readVarint64().toUnsigned();
  33210. case g.TYPES.sint64:
  33211. return e.readVarint64ZigZag();
  33212. case g.TYPES.fixed64:
  33213. return e.readUint64();
  33214. case g.TYPES.sfixed64:
  33215. return e.readInt64();
  33216. case g.TYPES.bool:
  33217. return !!e.readVarint32();
  33218. case g.TYPES.enum:
  33219. return e.readVarint32();
  33220. case g.TYPES.float:
  33221. return e.readFloat();
  33222. case g.TYPES.double:
  33223. return e.readDouble();
  33224. case g.TYPES.string:
  33225. return e.readVString();
  33226. case g.TYPES.bytes:
  33227. if (r = e.readVarint32(),
  33228. e.remaining() < r)
  33229. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + r + " required but got only " + e.remaining());
  33230. return (n = e.clone()).limit = n.offset + r,
  33231. e.offset += r,
  33232. n;
  33233. case g.TYPES.message:
  33234. return r = e.readVarint32(),
  33235. this.resolvedType.decode(e, r);
  33236. case g.TYPES.group:
  33237. return this.resolvedType.decode(e, -1, i)
  33238. }
  33239. throw Error("[INTERNAL] Illegal decode type")
  33240. }
  33241. ,
  33242. i.valueFromString = function(e) {
  33243. if (!this.isMapKey)
  33244. throw Error("valueFromString() called on non-map-key element");
  33245. switch (this.type) {
  33246. case g.TYPES.int32:
  33247. case g.TYPES.sint32:
  33248. case g.TYPES.sfixed32:
  33249. case g.TYPES.uint32:
  33250. case g.TYPES.fixed32:
  33251. return this.verifyValue(parseInt(e));
  33252. case g.TYPES.int64:
  33253. case g.TYPES.sint64:
  33254. case g.TYPES.sfixed64:
  33255. case g.TYPES.uint64:
  33256. case g.TYPES.fixed64:
  33257. return this.verifyValue(e);
  33258. case g.TYPES.bool:
  33259. return "true" === e;
  33260. case g.TYPES.string:
  33261. return this.verifyValue(e);
  33262. case g.TYPES.bytes:
  33263. return I.fromBinary(e)
  33264. }
  33265. }
  33266. ,
  33267. i.valueToString = function(e) {
  33268. if (!this.isMapKey)
  33269. throw Error("valueToString() called on non-map-key element");
  33270. return this.type === g.TYPES.bytes ? e.toString("binary") : e.toString()
  33271. }
  33272. ,
  33273. s.Element = u;
  33274. var d = function(e, t, i, n, r, o) {
  33275. l.call(this, e, t, i, n, o),
  33276. this.className = "Message",
  33277. this.extensions = void 0,
  33278. this.clazz = null,
  33279. this.isGroup = !!r,
  33280. this._fields = null,
  33281. this._fieldsById = null,
  33282. this._fieldsByName = null
  33283. }
  33284. , n = d.prototype = Object.create(l.prototype);
  33285. n.build = function(e) {
  33286. if (this.clazz && !e)
  33287. return this.clazz;
  33288. var t = function(u, a) {
  33289. function d(e, i, n, r) {
  33290. if (null === e || "object" != typeof e) {
  33291. if (r && r instanceof u.Reflect.Enum) {
  33292. var t = u.Reflect.Enum.getName(r.object, e);
  33293. if (null !== t)
  33294. return t
  33295. }
  33296. return e
  33297. }
  33298. if (I.isByteBuffer(e))
  33299. return i ? e.toBase64() : e.toBuffer();
  33300. if (u.Long.isLong(e))
  33301. return n ? e.toString() : u.Long.fromValue(e);
  33302. var o;
  33303. if (Array.isArray(e))
  33304. return o = [],
  33305. e.forEach(function(e, t) {
  33306. o[t] = d(e, i, n, r)
  33307. }),
  33308. o;
  33309. if (o = {},
  33310. e instanceof u.Map) {
  33311. for (var a = e.entries(), s = a.next(); !s.done; s = a.next())
  33312. o[e.keyElem.valueToString(s.value[0])] = d(s.value[1], i, n, e.valueElem.resolvedType);
  33313. return o
  33314. }
  33315. var l = e.$type
  33316. , c = void 0;
  33317. for (var h in e)
  33318. e.hasOwnProperty(h) && (l && (c = l.getChild(h)) ? o[h] = d(e[h], i, n, c.resolvedType) : o[h] = d(e[h], i, n));
  33319. return o
  33320. }
  33321. var s = a.getChildren(u.Reflect.Message.Field)
  33322. , l = a.getChildren(u.Reflect.Message.OneOf)
  33323. , c = function(e, t) {
  33324. u.Builder.Message.call(this);
  33325. for (var i = 0, n = l.length; i < n; ++i)
  33326. this[l[i].name] = null;
  33327. for (i = 0,
  33328. n = s.length; i < n; ++i) {
  33329. var r = s[i];
  33330. this[r.name] = r.repeated ? [] : r.map ? new u.Map(r) : null,
  33331. !r.required && "proto3" !== a.syntax || null === r.defaultValue || (this[r.name] = r.defaultValue)
  33332. }
  33333. var o;
  33334. if (0 < arguments.length)
  33335. if (1 !== arguments.length || null === e || "object" != typeof e || !("function" != typeof e.encode || e instanceof c) || Array.isArray(e) || e instanceof u.Map || I.isByteBuffer(e) || e instanceof ArrayBuffer || u.Long && e instanceof u.Long)
  33336. for (i = 0,
  33337. n = arguments.length; i < n; ++i)
  33338. void 0 !== (o = arguments[i]) && this.$set(s[i].name, o);
  33339. else
  33340. this.$set(e)
  33341. }
  33342. , o = c.prototype = Object.create(u.Builder.Message.prototype);
  33343. o.add = function(e, t, i) {
  33344. var n = a._fieldsByName[e];
  33345. if (!i) {
  33346. if (!n)
  33347. throw Error(this + "#" + e + " is undefined");
  33348. if (!(n instanceof u.Reflect.Message.Field))
  33349. throw Error(this + "#" + e + " is not a field: " + n.toString(!0));
  33350. if (!n.repeated)
  33351. throw Error(this + "#" + e + " is not a repeated field");
  33352. t = n.verifyValue(t, !0)
  33353. }
  33354. return null === this[e] && (this[e] = []),
  33355. this[e].push(t),
  33356. this
  33357. }
  33358. ,
  33359. o.$add = o.add,
  33360. o.set = function(e, t, i) {
  33361. if (e && "object" == typeof e) {
  33362. for (var n in i = t,
  33363. e)
  33364. e.hasOwnProperty(n) && void 0 !== (t = e[n]) && this.$set(n, t, i);
  33365. return this
  33366. }
  33367. var r = a._fieldsByName[e];
  33368. if (i)
  33369. this[e] = t;
  33370. else {
  33371. if (!r)
  33372. throw Error(this + "#" + e + " is not a field: undefined");
  33373. if (!(r instanceof u.Reflect.Message.Field))
  33374. throw Error(this + "#" + e + " is not a field: " + r.toString(!0));
  33375. this[r.name] = t = r.verifyValue(t)
  33376. }
  33377. if (r && r.oneof) {
  33378. var o = this[r.oneof.name];
  33379. null !== t ? (null !== o && o !== r.name && (this[o] = null),
  33380. this[r.oneof.name] = r.name) : o === e && (this[r.oneof.name] = null)
  33381. }
  33382. return this
  33383. }
  33384. ,
  33385. o.$set = o.set,
  33386. o.get = function(e, t) {
  33387. if (t)
  33388. return this[e];
  33389. var i = a._fieldsByName[e];
  33390. if (!(i && i instanceof u.Reflect.Message.Field))
  33391. throw Error(this + "#" + e + " is not a field: undefined");
  33392. if (!(i instanceof u.Reflect.Message.Field))
  33393. throw Error(this + "#" + e + " is not a field: " + i.toString(!0));
  33394. return this[i.name]
  33395. }
  33396. ,
  33397. o.$get = o.get;
  33398. for (var e = 0; e < s.length; e++) {
  33399. var t = s[e];
  33400. t instanceof u.Reflect.Message.ExtensionField || a.builder.options.populateAccessors && function(i) {
  33401. var e = i.originalName.replace(/(_[a-zA-Z])/g, function(e) {
  33402. return e.toUpperCase().replace("_", "")
  33403. });
  33404. e = e.substring(0, 1).toUpperCase() + e.substring(1);
  33405. function t(e, t) {
  33406. return this[i.name] = t ? e : i.verifyValue(e),
  33407. this
  33408. }
  33409. function n() {
  33410. return this[i.name]
  33411. }
  33412. var r = i.originalName.replace(/([A-Z])/g, function(e) {
  33413. return "_" + e
  33414. });
  33415. null === a.getChild("set" + e) && (o["set" + e] = t),
  33416. null === a.getChild("set_" + r) && (o["set_" + r] = t),
  33417. null === a.getChild("get" + e) && (o["get" + e] = n),
  33418. null === a.getChild("get_" + r) && (o["get_" + r] = n)
  33419. }(t)
  33420. }
  33421. return o.encode = function(t, e) {
  33422. "boolean" == typeof t && (e = t,
  33423. t = void 0);
  33424. var i = !1;
  33425. t || (t = new I,
  33426. i = !0);
  33427. var n = t.littleEndian;
  33428. try {
  33429. return a.encode(this, t.LE(), e),
  33430. (i ? t.flip() : t).LE(n)
  33431. } catch (e) {
  33432. throw t.LE(n),
  33433. e
  33434. }
  33435. }
  33436. ,
  33437. c.encode = function(e, t, i) {
  33438. return new c(e).encode(t, i)
  33439. }
  33440. ,
  33441. o.calculate = function() {
  33442. return a.calculate(this)
  33443. }
  33444. ,
  33445. o.encodeDelimited = function(e, t) {
  33446. var i = !1;
  33447. e || (e = new I,
  33448. i = !0);
  33449. var n = (new I).LE();
  33450. return a.encode(this, n, t).flip(),
  33451. e.writeVarint32(n.remaining()),
  33452. e.append(n),
  33453. i ? e.flip() : e
  33454. }
  33455. ,
  33456. o.encodeAB = function() {
  33457. try {
  33458. return this.encode().toArrayBuffer()
  33459. } catch (e) {
  33460. throw e.encoded && (e.encoded = e.encoded.toArrayBuffer()),
  33461. e
  33462. }
  33463. }
  33464. ,
  33465. o.toArrayBuffer = o.encodeAB,
  33466. o.encodeNB = function() {
  33467. try {
  33468. return this.encode().toBuffer()
  33469. } catch (e) {
  33470. throw e.encoded && (e.encoded = e.encoded.toBuffer()),
  33471. e
  33472. }
  33473. }
  33474. ,
  33475. o.toBuffer = o.encodeNB,
  33476. o.encode64 = function() {
  33477. try {
  33478. return this.encode().toBase64()
  33479. } catch (e) {
  33480. throw e.encoded && (e.encoded = e.encoded.toBase64()),
  33481. e
  33482. }
  33483. }
  33484. ,
  33485. o.toBase64 = o.encode64,
  33486. o.encodeHex = function() {
  33487. try {
  33488. return this.encode().toHex()
  33489. } catch (e) {
  33490. throw e.encoded && (e.encoded = e.encoded.toHex()),
  33491. e
  33492. }
  33493. }
  33494. ,
  33495. o.toHex = o.encodeHex,
  33496. o.toRaw = function(e, t) {
  33497. return d(this, !!e, !!t, this.$type)
  33498. }
  33499. ,
  33500. o.encodeJSON = function() {
  33501. return JSON.stringify(d(this, !0, !0, this.$type))
  33502. }
  33503. ,
  33504. c.decode = function(t, e, i) {
  33505. "string" == typeof e && (i = e,
  33506. e = -1),
  33507. "string" == typeof t && (t = I.wrap(t, i || "base64"));
  33508. var n = (t = I.isByteBuffer(t) ? t : I.wrap(t)).littleEndian;
  33509. try {
  33510. var r = a.decode(t.LE());
  33511. return t.LE(n),
  33512. r
  33513. } catch (e) {
  33514. throw t.LE(n),
  33515. e
  33516. }
  33517. }
  33518. ,
  33519. c.decodeDelimited = function(t, e) {
  33520. if ("string" == typeof t && (t = I.wrap(t, e || "base64")),
  33521. (t = I.isByteBuffer(t) ? t : I.wrap(t)).remaining() < 1)
  33522. return null;
  33523. var i = t.offset
  33524. , n = t.readVarint32();
  33525. if (t.remaining() < n)
  33526. return t.offset = i,
  33527. null;
  33528. try {
  33529. var r = a.decode(t.slice(t.offset, t.offset + n).LE());
  33530. return t.offset += n,
  33531. r
  33532. } catch (e) {
  33533. throw t.offset += n,
  33534. e
  33535. }
  33536. }
  33537. ,
  33538. c.decode64 = function(e) {
  33539. return c.decode(e, "base64")
  33540. }
  33541. ,
  33542. c.decodeHex = function(e) {
  33543. return c.decode(e, "hex")
  33544. }
  33545. ,
  33546. c.decodeJSON = function(e) {
  33547. return new c(JSON.parse(e))
  33548. }
  33549. ,
  33550. o.toString = function() {
  33551. return a.toString()
  33552. }
  33553. ,
  33554. Object.defineProperty && (Object.defineProperty(c, "$options", {
  33555. value: a.buildOpt()
  33556. }),
  33557. Object.defineProperty(o, "$options", {
  33558. value: c.$options
  33559. }),
  33560. Object.defineProperty(c, "$type", {
  33561. value: a
  33562. }),
  33563. Object.defineProperty(o, "$type", {
  33564. value: a
  33565. })),
  33566. c
  33567. }(g, this);
  33568. this._fields = [],
  33569. this._fieldsById = {},
  33570. this._fieldsByName = {};
  33571. for (var i, n = 0, r = this.children.length; n < r; n++)
  33572. if ((i = this.children[n])instanceof p || i instanceof d || i instanceof y) {
  33573. if (t.hasOwnProperty(i.name))
  33574. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + i.toString(!0) + " cannot override static property '" + i.name + "'");
  33575. t[i.name] = i.build()
  33576. } else if (i instanceof d.Field)
  33577. i.build(),
  33578. this._fields.push(i),
  33579. this._fieldsById[i.id] = i,
  33580. this._fieldsByName[i.name] = i;
  33581. else if (!(i instanceof d.OneOf || i instanceof v))
  33582. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + this.children[n].toString(!0));
  33583. return this.clazz = t
  33584. }
  33585. ,
  33586. n.encode = function(e, t, i) {
  33587. for (var n, r, o = null, a = 0, s = this._fields.length; a < s; ++a)
  33588. r = e[(n = this._fields[a]).name],
  33589. n.required && null === r ? null === o && (o = n) : n.encode(i ? r : n.verifyValue(r), t, e);
  33590. if (null === o)
  33591. return t;
  33592. var l = Error("Missing at least one required field for " + this.toString(!0) + ": " + o);
  33593. throw l.encoded = t,
  33594. l
  33595. }
  33596. ,
  33597. n.calculate = function(e) {
  33598. for (var t, i, n = 0, r = 0, o = this._fields.length; r < o; ++r) {
  33599. if (i = e[(t = this._fields[r]).name],
  33600. t.required && null === i)
  33601. throw Error("Missing at least one required field for " + this.toString(!0) + ": " + t);
  33602. n += t.calculate(i, e)
  33603. }
  33604. return n
  33605. }
  33606. ,
  33607. n.decode = function(e, t, i) {
  33608. t = "number" == typeof t ? t : -1;
  33609. for (var n, r, o, a, s = e.offset, l = new this.clazz; e.offset < s + t || -1 === t && 0 < e.remaining(); ) {
  33610. if (o = (n = e.readVarint32()) >>> 3,
  33611. (r = 7 & n) === g.WIRE_TYPES.ENDGROUP) {
  33612. if (o !== i)
  33613. throw Error("Illegal group end indicator for " + this.toString(!0) + ": " + o + " (" + (i ? i + " expected" : "not a group") + ")");
  33614. break
  33615. }
  33616. if (a = this._fieldsById[o]) {
  33617. if (a.repeated && !a.options.packed)
  33618. l[a.name].push(a.decode(r, e));
  33619. else if (a.map) {
  33620. var c = a.decode(r, e);
  33621. l[a.name].set(c[0], c[1])
  33622. } else if (l[a.name] = a.decode(r, e),
  33623. a.oneof) {
  33624. var h = l[a.oneof.name];
  33625. null !== h && h !== a.name && (l[h] = null),
  33626. l[a.oneof.name] = a.name
  33627. }
  33628. } else
  33629. switch (r) {
  33630. case g.WIRE_TYPES.VARINT:
  33631. e.readVarint32();
  33632. break;
  33633. case g.WIRE_TYPES.BITS32:
  33634. e.offset += 4;
  33635. break;
  33636. case g.WIRE_TYPES.BITS64:
  33637. e.offset += 8;
  33638. break;
  33639. case g.WIRE_TYPES.LDELIM:
  33640. var u = e.readVarint32();
  33641. e.offset += u;
  33642. break;
  33643. case g.WIRE_TYPES.STARTGROUP:
  33644. for (; m(o, e); )
  33645. ;
  33646. break;
  33647. default:
  33648. throw Error("Illegal wire type for unknown field " + o + " in " + this.toString(!0) + "#decode: " + r)
  33649. }
  33650. }
  33651. for (var d = 0, p = this._fields.length; d < p; ++d)
  33652. if (null === l[(a = this._fields[d]).name])
  33653. if ("proto3" === this.syntax)
  33654. l[a.name] = a.defaultValue;
  33655. else {
  33656. if (a.required) {
  33657. var f = Error("Missing at least one required field for " + this.toString(!0) + ": " + a.name);
  33658. throw f.decoded = l,
  33659. f
  33660. }
  33661. g.populateDefaults && null !== a.defaultValue && (l[a.name] = a.defaultValue)
  33662. }
  33663. return l
  33664. }
  33665. ,
  33666. s.Message = d;
  33667. function c(e, t, i, n, r, o, a, s, l, c) {
  33668. h.call(this, e, t, o),
  33669. this.className = "Message.Field",
  33670. this.required = "required" === i,
  33671. this.repeated = "repeated" === i,
  33672. this.map = "map" === i,
  33673. this.keyType = n || null,
  33674. this.type = r,
  33675. this.resolvedType = null,
  33676. this.id = a,
  33677. this.options = s || {},
  33678. this.defaultValue = null,
  33679. this.oneof = l || null,
  33680. this.syntax = c || "proto2",
  33681. this.originalName = this.name,
  33682. this.element = null,
  33683. this.keyElement = null,
  33684. !this.builder.options.convertFieldsToCamelCase || this instanceof d.ExtensionField || (this.name = g.Util.toCamelCase(this.name))
  33685. }
  33686. var r = c.prototype = Object.create(h.prototype);
  33687. r.build = function() {
  33688. this.element = new u(this.type,this.resolvedType,!1,this.syntax),
  33689. this.map && (this.keyElement = new u(this.keyType,void 0,!0,this.syntax)),
  33690. "proto3" !== this.syntax || this.repeated || this.map ? void 0 !== this.options.default && (this.defaultValue = this.verifyValue(this.options.default)) : this.defaultValue = u.defaultFieldValue(this.type)
  33691. }
  33692. ,
  33693. r.verifyValue = function(e, t) {
  33694. function i(e, t) {
  33695. throw Error("Illegal value for " + r.toString(!0) + " of type " + r.type.name + ": " + e + " (" + t + ")")
  33696. }
  33697. t = t || !1;
  33698. var n, r = this;
  33699. if (null === e)
  33700. return this.required && i(typeof e, "required"),
  33701. "proto3" === this.syntax && this.type !== g.TYPES.message && i(typeof e, "proto3 field without field presence cannot be null"),
  33702. null;
  33703. if (!this.repeated || t)
  33704. return this.map && !t ? e instanceof g.Map ? e : (e instanceof Object || i(typeof e, "expected ProtoBuf.Map or raw object for map field"),
  33705. new g.Map(this,e)) : (!this.repeated && Array.isArray(e) && i(typeof e, "no array expected"),
  33706. this.element.verifyValue(e));
  33707. Array.isArray(e) || (e = [e]);
  33708. var o = [];
  33709. for (n = 0; n < e.length; n++)
  33710. o.push(this.element.verifyValue(e[n]));
  33711. return o
  33712. }
  33713. ,
  33714. r.hasWirePresence = function(e, t) {
  33715. if ("proto3" !== this.syntax)
  33716. return null !== e;
  33717. if (this.oneof && t[this.oneof.name] === this.name)
  33718. return !0;
  33719. switch (this.type) {
  33720. case g.TYPES.int32:
  33721. case g.TYPES.sint32:
  33722. case g.TYPES.sfixed32:
  33723. case g.TYPES.uint32:
  33724. case g.TYPES.fixed32:
  33725. return 0 !== e;
  33726. case g.TYPES.int64:
  33727. case g.TYPES.sint64:
  33728. case g.TYPES.sfixed64:
  33729. case g.TYPES.uint64:
  33730. case g.TYPES.fixed64:
  33731. return 0 !== e.low || 0 !== e.high;
  33732. case g.TYPES.bool:
  33733. return e;
  33734. case g.TYPES.float:
  33735. case g.TYPES.double:
  33736. return 0 !== e;
  33737. case g.TYPES.string:
  33738. return 0 < e.length;
  33739. case g.TYPES.bytes:
  33740. return 0 < e.remaining();
  33741. case g.TYPES.enum:
  33742. return 0 !== e;
  33743. case g.TYPES.message:
  33744. return null !== e;
  33745. default:
  33746. return !0
  33747. }
  33748. }
  33749. ,
  33750. r.encode = function(t, r, e) {
  33751. if (null === this.type || "object" != typeof this.type)
  33752. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  33753. if (null === t || this.repeated && 0 == t.length)
  33754. return r;
  33755. try {
  33756. var i;
  33757. if (this.repeated)
  33758. if (this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)) {
  33759. r.writeVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  33760. r.ensureCapacity(r.offset += 1);
  33761. var n = r.offset;
  33762. for (i = 0; i < t.length; i++)
  33763. this.element.encodeValue(this.id, t[i], r);
  33764. var o = r.offset - n
  33765. , a = I.calculateVarint32(o);
  33766. if (1 < a) {
  33767. var s = r.slice(n, r.offset);
  33768. n += a - 1,
  33769. r.offset = n,
  33770. r.append(s)
  33771. }
  33772. r.writeVarint32(o, n - a)
  33773. } else
  33774. for (i = 0; i < t.length; i++)
  33775. r.writeVarint32(this.id << 3 | this.type.wireType),
  33776. this.element.encodeValue(this.id, t[i], r);
  33777. else
  33778. this.map ? t.forEach(function(e, t, i) {
  33779. var n = I.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, t) + I.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, e);
  33780. r.writeVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  33781. r.writeVarint32(n),
  33782. r.writeVarint32(8 | this.keyType.wireType),
  33783. this.keyElement.encodeValue(1, t, r),
  33784. r.writeVarint32(16 | this.type.wireType),
  33785. this.element.encodeValue(2, e, r)
  33786. }, this) : this.hasWirePresence(t, e) && (r.writeVarint32(this.id << 3 | this.type.wireType),
  33787. this.element.encodeValue(this.id, t, r))
  33788. } catch (e) {
  33789. throw Error("Illegal value for " + this.toString(!0) + ": " + t + " (" + e + ")")
  33790. }
  33791. return r
  33792. }
  33793. ,
  33794. r.calculate = function(t, e) {
  33795. if (t = this.verifyValue(t),
  33796. null === this.type || "object" != typeof this.type)
  33797. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  33798. if (null === t || this.repeated && 0 == t.length)
  33799. return 0;
  33800. var r = 0;
  33801. try {
  33802. var i, n;
  33803. if (this.repeated)
  33804. if (this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)) {
  33805. for (r += I.calculateVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  33806. i = n = 0; i < t.length; i++)
  33807. n += this.element.calculateLength(this.id, t[i]);
  33808. r += I.calculateVarint32(n),
  33809. r += n
  33810. } else
  33811. for (i = 0; i < t.length; i++)
  33812. r += I.calculateVarint32(this.id << 3 | this.type.wireType),
  33813. r += this.element.calculateLength(this.id, t[i]);
  33814. else
  33815. this.map ? t.forEach(function(e, t, i) {
  33816. var n = I.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, t) + I.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, e);
  33817. r += I.calculateVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  33818. r += I.calculateVarint32(n),
  33819. r += n
  33820. }, this) : this.hasWirePresence(t, e) && (r += I.calculateVarint32(this.id << 3 | this.type.wireType),
  33821. r += this.element.calculateLength(this.id, t))
  33822. } catch (e) {
  33823. throw Error("Illegal value for " + this.toString(!0) + ": " + t + " (" + e + ")")
  33824. }
  33825. return r
  33826. }
  33827. ,
  33828. r.decode = function(e, t, i) {
  33829. var n, r;
  33830. if (!(!this.map && e == this.type.wireType || !i && this.repeated && this.options.packed && e == g.WIRE_TYPES.LDELIM || this.map && e == g.WIRE_TYPES.LDELIM))
  33831. throw Error("Illegal wire type for field " + this.toString(!0) + ": " + e + " (" + this.type.wireType + " expected)");
  33832. if (e == g.WIRE_TYPES.LDELIM && this.repeated && this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) && !i) {
  33833. r = t.readVarint32(),
  33834. r = t.offset + r;
  33835. for (var o = []; t.offset < r; )
  33836. o.push(this.decode(this.type.wireType, t, !0));
  33837. return o
  33838. }
  33839. if (this.map) {
  33840. var a = u.defaultFieldValue(this.keyType);
  33841. if (n = u.defaultFieldValue(this.type),
  33842. r = t.readVarint32(),
  33843. t.remaining() < r)
  33844. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + r + " required but got only " + t.remaining());
  33845. var s = t.clone();
  33846. for (s.limit = s.offset + r,
  33847. t.offset += r; 0 < s.remaining(); ) {
  33848. var l = s.readVarint32();
  33849. e = 7 & l;
  33850. var c = l >>> 3;
  33851. if (1 == c)
  33852. a = this.keyElement.decode(s, e, c);
  33853. else {
  33854. if (2 != c)
  33855. throw Error("Unexpected tag in map field key/value submessage");
  33856. n = this.element.decode(s, e, c)
  33857. }
  33858. }
  33859. return [a, n]
  33860. }
  33861. return this.element.decode(t, e, this.id)
  33862. }
  33863. ,
  33864. s.Message.Field = c;
  33865. function o(e, t, i, n, r, o, a) {
  33866. c.call(this, e, t, i, null, n, r, o, a),
  33867. this.extension
  33868. }
  33869. o.prototype = Object.create(c.prototype),
  33870. s.Message.ExtensionField = o;
  33871. s.Message.OneOf = function(e, t, i) {
  33872. h.call(this, e, t, i),
  33873. this.fields = []
  33874. }
  33875. ;
  33876. var p = function(e, t, i, n, r) {
  33877. l.call(this, e, t, i, n, r),
  33878. this.className = "Enum",
  33879. this.object = null
  33880. };
  33881. p.getName = function(e, t) {
  33882. for (var i, n = Object.keys(e), r = 0; r < n.length; ++r)
  33883. if (e[i = n[r]] === t)
  33884. return i;
  33885. return null
  33886. }
  33887. ,
  33888. (p.prototype = Object.create(l.prototype)).build = function(e) {
  33889. if (this.object && !e)
  33890. return this.object;
  33891. for (var t = new g.Builder.Enum, i = this.getChildren(p.Value), n = 0, r = i.length; n < r; ++n)
  33892. t[i[n].name] = i[n].id;
  33893. return Object.defineProperty && Object.defineProperty(t, "$options", {
  33894. value: this.buildOpt(),
  33895. enumerable: !1
  33896. }),
  33897. this.object = t
  33898. }
  33899. ,
  33900. s.Enum = p;
  33901. function f(e, t, i, n) {
  33902. h.call(this, e, t, i),
  33903. this.className = "Enum.Value",
  33904. this.id = n
  33905. }
  33906. f.prototype = Object.create(h.prototype),
  33907. s.Enum.Value = f;
  33908. var v = function(e, t, i, n) {
  33909. h.call(this, e, t, i),
  33910. this.field = n
  33911. };
  33912. v.prototype = Object.create(h.prototype),
  33913. s.Extension = v;
  33914. var y = function(e, t, i, n) {
  33915. l.call(this, e, t, i, n),
  33916. this.className = "Service",
  33917. this.clazz = null
  33918. };
  33919. (y.prototype = Object.create(l.prototype)).build = function(e) {
  33920. return this.clazz && !e ? this.clazz : this.clazz = function(t, r) {
  33921. for (var o = function(e) {
  33922. t.Builder.Service.call(this),
  33923. this.rpcImpl = e || function(e, t, i) {
  33924. setTimeout(i.bind(this, Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")), 0)
  33925. }
  33926. }, e = o.prototype = Object.create(t.Builder.Service.prototype), i = r.getChildren(t.Reflect.Service.RPCMethod), n = 0; n < i.length; n++)
  33927. !function(n) {
  33928. e[n.name] = function(e, i) {
  33929. try {
  33930. try {
  33931. e = n.resolvedRequestType.clazz.decode(I.wrap(e))
  33932. } catch (e) {
  33933. if (!(e instanceof TypeError))
  33934. throw e
  33935. }
  33936. if (null === e || "object" != typeof e)
  33937. throw Error("Illegal arguments");
  33938. e instanceof n.resolvedRequestType.clazz || (e = new n.resolvedRequestType.clazz(e)),
  33939. this.rpcImpl(n.fqn(), e, function(e, t) {
  33940. if (!e) {
  33941. null === t && (t = "");
  33942. try {
  33943. t = n.resolvedResponseType.clazz.decode(t)
  33944. } catch (e) {}
  33945. return t && t instanceof n.resolvedResponseType.clazz ? void i(null, t) : void i(Error("Illegal response type received in service method " + r.name + "#" + n.name))
  33946. }
  33947. i(e)
  33948. })
  33949. } catch (e) {
  33950. setTimeout(i.bind(this, e), 0)
  33951. }
  33952. }
  33953. ,
  33954. o[n.name] = function(e, t, i) {
  33955. new o(e)[n.name](t, i)
  33956. }
  33957. ,
  33958. Object.defineProperty && (Object.defineProperty(o[n.name], "$options", {
  33959. value: n.buildOpt()
  33960. }),
  33961. Object.defineProperty(e[n.name], "$options", {
  33962. value: o[n.name].$options
  33963. }))
  33964. }(i[n]);
  33965. return Object.defineProperty && (Object.defineProperty(o, "$options", {
  33966. value: r.buildOpt()
  33967. }),
  33968. Object.defineProperty(e, "$options", {
  33969. value: o.$options
  33970. }),
  33971. Object.defineProperty(o, "$type", {
  33972. value: r
  33973. }),
  33974. Object.defineProperty(e, "$type", {
  33975. value: r
  33976. })),
  33977. o
  33978. }(g, this)
  33979. }
  33980. ,
  33981. s.Service = y;
  33982. function A(e, t, i, n) {
  33983. h.call(this, e, t, i),
  33984. this.className = "Service.Method",
  33985. this.options = n || {}
  33986. }
  33987. (A.prototype = Object.create(h.prototype)).buildOpt = t.buildOpt,
  33988. s.Service.Method = A;
  33989. function C(e, t, i, n, r, o, a, s) {
  33990. A.call(this, e, t, i, s),
  33991. this.className = "Service.RPCMethod",
  33992. this.requestName = n,
  33993. this.responseName = r,
  33994. this.requestStream = o,
  33995. this.responseStream = a,
  33996. this.resolvedRequestType = null,
  33997. this.resolvedResponseType = null
  33998. }
  33999. return C.prototype = Object.create(A.prototype),
  34000. s.Service.RPCMethod = C,
  34001. s
  34002. }(o),
  34003. o.Builder = (i = (u = o).Lang,
  34004. s = o.Reflect,
  34005. n = h.prototype,
  34006. h.isMessage = function(e) {
  34007. return "string" == typeof e.name && void 0 === e.values && void 0 === e.rpc
  34008. }
  34009. ,
  34010. h.isMessageField = function(e) {
  34011. return "string" == typeof e.rule && "string" == typeof e.name && "string" == typeof e.type && void 0 !== e.id
  34012. }
  34013. ,
  34014. h.isEnum = function(e) {
  34015. return "string" == typeof e.name && !(void 0 === e.values || !Array.isArray(e.values) || 0 === e.values.length)
  34016. }
  34017. ,
  34018. h.isService = function(e) {
  34019. return !("string" != typeof e.name || "object" != typeof e.rpc || !e.rpc)
  34020. }
  34021. ,
  34022. h.isExtend = function(e) {
  34023. return "string" == typeof e.ref
  34024. }
  34025. ,
  34026. n.reset = function() {
  34027. return this.ptr = this.ns,
  34028. this
  34029. }
  34030. ,
  34031. n.define = function(e) {
  34032. if ("string" != typeof e || !i.TYPEREF.test(e))
  34033. throw Error("illegal namespace: " + e);
  34034. return e.split(".").forEach(function(e) {
  34035. var t = this.ptr.getChild(e);
  34036. null === t && this.ptr.addChild(t = new s.Namespace(this,this.ptr,e)),
  34037. this.ptr = t
  34038. }, this),
  34039. this
  34040. }
  34041. ,
  34042. n.create = function(e) {
  34043. if (!e)
  34044. return this;
  34045. if (Array.isArray(e)) {
  34046. if (0 === e.length)
  34047. return this;
  34048. e = e.slice()
  34049. } else
  34050. e = [e];
  34051. for (var t = [e]; 0 < t.length; ) {
  34052. if (e = t.pop(),
  34053. !Array.isArray(e))
  34054. throw Error("not a valid namespace: " + JSON.stringify(e));
  34055. for (; 0 < e.length; ) {
  34056. var i = e.shift();
  34057. if (h.isMessage(i)) {
  34058. var o = new s.Message(this,this.ptr,i.name,i.options,i.isGroup,i.syntax)
  34059. , n = {};
  34060. i.oneofs && Object.keys(i.oneofs).forEach(function(e) {
  34061. o.addChild(n[e] = new s.Message.OneOf(this,o,e))
  34062. }, this),
  34063. i.fields && i.fields.forEach(function(e) {
  34064. if (null !== o.getChild(0 | e.id))
  34065. throw Error("duplicate or invalid field id in " + o.name + ": " + e.id);
  34066. if (e.options && "object" != typeof e.options)
  34067. throw Error("illegal field options in " + o.name + "#" + e.name);
  34068. var t = null;
  34069. if ("string" == typeof e.oneof && !(t = n[e.oneof]))
  34070. throw Error("illegal oneof in " + o.name + "#" + e.name + ": " + e.oneof);
  34071. e = new s.Message.Field(this,o,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,i.syntax),
  34072. t && t.fields.push(e),
  34073. o.addChild(e)
  34074. }, this);
  34075. var r = [];
  34076. if (i.enums && i.enums.forEach(function(e) {
  34077. r.push(e)
  34078. }),
  34079. i.messages && i.messages.forEach(function(e) {
  34080. r.push(e)
  34081. }),
  34082. i.services && i.services.forEach(function(e) {
  34083. r.push(e)
  34084. }),
  34085. i.extensions && ("number" == typeof i.extensions[0] ? o.extensions = [i.extensions] : o.extensions = i.extensions),
  34086. this.ptr.addChild(o),
  34087. 0 < r.length) {
  34088. t.push(e),
  34089. e = r,
  34090. r = null,
  34091. this.ptr = o,
  34092. o = null;
  34093. continue
  34094. }
  34095. r = null
  34096. } else if (h.isEnum(i))
  34097. o = new s.Enum(this,this.ptr,i.name,i.options,i.syntax),
  34098. i.values.forEach(function(e) {
  34099. o.addChild(new s.Enum.Value(this,o,e.name,e.id))
  34100. }, this),
  34101. this.ptr.addChild(o);
  34102. else if (h.isService(i))
  34103. o = new s.Service(this,this.ptr,i.name,i.options),
  34104. Object.keys(i.rpc).forEach(function(e) {
  34105. var t = i.rpc[e];
  34106. o.addChild(new s.Service.RPCMethod(this,o,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))
  34107. }, this),
  34108. this.ptr.addChild(o);
  34109. else {
  34110. if (!h.isExtend(i))
  34111. throw Error("not a valid definition: " + JSON.stringify(i));
  34112. if (o = this.ptr.resolve(i.ref, !0))
  34113. i.fields.forEach(function(t) {
  34114. if (null !== o.getChild(0 | t.id))
  34115. throw Error("duplicate extended field id in " + o.name + ": " + t.id);
  34116. if (o.extensions) {
  34117. var i = !1;
  34118. if (o.extensions.forEach(function(e) {
  34119. t.id >= e[0] && t.id <= e[1] && (i = !0)
  34120. }),
  34121. !i)
  34122. throw Error("illegal extended field id in " + o.name + ": " + t.id + " (not within valid ranges)")
  34123. }
  34124. var e = t.name;
  34125. this.options.convertFieldsToCamelCase && (e = u.Util.toCamelCase(e));
  34126. var n = new s.Message.ExtensionField(this,o,t.rule,t.type,this.ptr.fqn() + "." + e,t.id,t.options)
  34127. , r = new s.Extension(this,this.ptr,t.name,n);
  34128. n.extension = r,
  34129. this.ptr.addChild(r),
  34130. o.addChild(n)
  34131. }, this);
  34132. else if (!/\.?google\.protobuf\./.test(i.ref))
  34133. throw Error("extended message " + i.ref + " is not defined")
  34134. }
  34135. o = i = null
  34136. }
  34137. e = null,
  34138. this.ptr = this.ptr.parent
  34139. }
  34140. return this.resolved = !1,
  34141. this.result = null,
  34142. this
  34143. }
  34144. ,
  34145. n.import = function(t, e) {
  34146. var i = "/";
  34147. if ("string" == typeof e) {
  34148. if (u.Util.IS_NODE && (e = p("path").resolve(e)),
  34149. !0 === this.files[e])
  34150. return this.reset();
  34151. this.files[e] = !0
  34152. } else if ("object" == typeof e) {
  34153. var n = e.root;
  34154. u.Util.IS_NODE && (n = p("path").resolve(n)),
  34155. (0 <= n.indexOf("\\") || 0 <= e.file.indexOf("\\")) && (i = "\\");
  34156. var r = n + i + e.file;
  34157. if (!0 === this.files[r])
  34158. return this.reset();
  34159. this.files[r] = !0
  34160. }
  34161. if (t.imports && 0 < t.imports.length) {
  34162. var o, a = !1;
  34163. "object" == typeof e ? (this.importRoot = e.root,
  34164. a = !0,
  34165. o = this.importRoot,
  34166. e = e.file,
  34167. (0 <= o.indexOf("\\") || 0 <= e.indexOf("\\")) && (i = "\\")) : "string" == typeof e ? this.importRoot ? o = this.importRoot : 0 <= e.indexOf("/") ? "" === (o = e.replace(/\/[^\/]*$/, "")) && (o = "/") : 0 <= e.indexOf("\\") ? (o = e.replace(/\\[^\\]*$/, ""),
  34168. i = "\\") : o = "." : o = null;
  34169. for (var s = 0; s < t.imports.length; s++)
  34170. if ("string" == typeof t.imports[s]) {
  34171. if (!o)
  34172. throw Error("cannot determine import root");
  34173. var l = t.imports[s];
  34174. if ("google/protobuf/descriptor.proto" === l)
  34175. continue;
  34176. if (l = o + i + l,
  34177. !0 === this.files[l])
  34178. continue;
  34179. /\.proto$/i.test(l) && !u.DotProto && (l = l.replace(/\.proto$/, ".json"));
  34180. var c = u.Util.fetch(l);
  34181. if (null === c)
  34182. throw Error("failed to import '" + l + "' in '" + e + "': file not found");
  34183. /\.json$/i.test(l) ? this.import(JSON.parse(c + ""), l) : this.import(u.DotProto.Parser.parse(c), l)
  34184. } else
  34185. e ? /\.(\w+)$/.test(e) ? this.import(t.imports[s], e.replace(/^(.+)\.(\w+)$/, function(e, t, i) {
  34186. return t + "_import" + s + "." + i
  34187. })) : this.import(t.imports[s], e + "_import" + s) : this.import(t.imports[s]);
  34188. a && (this.importRoot = null)
  34189. }
  34190. t.package && this.define(t.package),
  34191. t.syntax && function t(i) {
  34192. i.messages && i.messages.forEach(function(e) {
  34193. e.syntax = i.syntax,
  34194. t(e)
  34195. }),
  34196. i.enums && i.enums.forEach(function(e) {
  34197. e.syntax = i.syntax
  34198. })
  34199. }(t);
  34200. var h = this.ptr;
  34201. return t.options && Object.keys(t.options).forEach(function(e) {
  34202. h.options[e] = t.options[e]
  34203. }),
  34204. t.messages && (this.create(t.messages),
  34205. this.ptr = h),
  34206. t.enums && (this.create(t.enums),
  34207. this.ptr = h),
  34208. t.services && (this.create(t.services),
  34209. this.ptr = h),
  34210. t.extends && this.create(t.extends),
  34211. this.reset()
  34212. }
  34213. ,
  34214. n.resolveAll = function() {
  34215. var e;
  34216. if (null == this.ptr || "object" == typeof this.ptr.type)
  34217. return this;
  34218. if (this.ptr instanceof s.Namespace)
  34219. this.ptr.children.forEach(function(e) {
  34220. this.ptr = e,
  34221. this.resolveAll()
  34222. }, this);
  34223. else if (this.ptr instanceof s.Message.Field) {
  34224. if (i.TYPE.test(this.ptr.type))
  34225. this.ptr.type = u.TYPES[this.ptr.type];
  34226. else {
  34227. if (!i.TYPEREF.test(this.ptr.type))
  34228. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  34229. if (!(e = (this.ptr instanceof s.Message.ExtensionField ? this.ptr.extension.parent : this.ptr.parent).resolve(this.ptr.type, !0)))
  34230. throw Error("unresolvable type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  34231. if ((this.ptr.resolvedType = e)instanceof s.Enum) {
  34232. if (this.ptr.type = u.TYPES.enum,
  34233. "proto3" === this.ptr.syntax && "proto3" !== e.syntax)
  34234. throw Error("proto3 message cannot reference proto2 enum")
  34235. } else {
  34236. if (!(e instanceof s.Message))
  34237. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  34238. this.ptr.type = e.isGroup ? u.TYPES.group : u.TYPES.message
  34239. }
  34240. }
  34241. if (this.ptr.map) {
  34242. if (!i.TYPE.test(this.ptr.keyType))
  34243. throw Error("illegal key type for map field in " + this.ptr.toString(!0) + ": " + this.ptr.keyType);
  34244. this.ptr.keyType = u.TYPES[this.ptr.keyType]
  34245. }
  34246. } else if (this.ptr instanceof u.Reflect.Service.Method) {
  34247. if (!(this.ptr instanceof u.Reflect.Service.RPCMethod))
  34248. throw Error("illegal service type in " + this.ptr.toString(!0));
  34249. if (!((e = this.ptr.parent.resolve(this.ptr.requestName, !0)) && e instanceof u.Reflect.Message))
  34250. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.requestName);
  34251. if (this.ptr.resolvedRequestType = e,
  34252. !((e = this.ptr.parent.resolve(this.ptr.responseName, !0)) && e instanceof u.Reflect.Message))
  34253. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.responseName);
  34254. this.ptr.resolvedResponseType = e
  34255. } else if (!(this.ptr instanceof u.Reflect.Message.OneOf || this.ptr instanceof u.Reflect.Extension || this.ptr instanceof u.Reflect.Enum.Value))
  34256. throw Error("illegal object in namespace: " + typeof this.ptr + ": " + this.ptr);
  34257. return this.reset()
  34258. }
  34259. ,
  34260. n.build = function(e) {
  34261. if (this.reset(),
  34262. this.resolved || (this.resolveAll(),
  34263. this.resolved = !0,
  34264. this.result = null),
  34265. null === this.result && (this.result = this.ns.build()),
  34266. !e)
  34267. return this.result;
  34268. for (var t = "string" == typeof e ? e.split(".") : e, i = this.result, n = 0; n < t.length; n++) {
  34269. if (!i[t[n]]) {
  34270. i = null;
  34271. break
  34272. }
  34273. i = i[t[n]]
  34274. }
  34275. return i
  34276. }
  34277. ,
  34278. n.lookup = function(e, t) {
  34279. return e ? this.ns.resolve(e, t) : this.ns
  34280. }
  34281. ,
  34282. n.toString = function() {
  34283. return "Builder"
  34284. }
  34285. ,
  34286. h.Message = function() {}
  34287. ,
  34288. h.Enum = function() {}
  34289. ,
  34290. h.Service = function() {}
  34291. ,
  34292. h),
  34293. o.Map = (a = o.Reflect,
  34294. (t = c.prototype).clear = function() {
  34295. this.map = {}
  34296. }
  34297. ,
  34298. t.delete = function(e) {
  34299. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e))
  34300. , i = t in this.map;
  34301. return delete this.map[t],
  34302. i
  34303. }
  34304. ,
  34305. t.entries = function() {
  34306. for (var e, t = [], i = Object.keys(this.map), n = 0; n < i.length; n++)
  34307. t.push([(e = this.map[i[n]]).key, e.value]);
  34308. return l(t)
  34309. }
  34310. ,
  34311. t.keys = function() {
  34312. for (var e = [], t = Object.keys(this.map), i = 0; i < t.length; i++)
  34313. e.push(this.map[t[i]].key);
  34314. return l(e)
  34315. }
  34316. ,
  34317. t.values = function() {
  34318. for (var e = [], t = Object.keys(this.map), i = 0; i < t.length; i++)
  34319. e.push(this.map[t[i]].value);
  34320. return l(e)
  34321. }
  34322. ,
  34323. t.forEach = function(e, t) {
  34324. for (var i, n = Object.keys(this.map), r = 0; r < n.length; r++)
  34325. e.call(t, (i = this.map[n[r]]).value, i.key, this)
  34326. }
  34327. ,
  34328. t.set = function(e, t) {
  34329. var i = this.keyElem.verifyValue(e)
  34330. , n = this.valueElem.verifyValue(t);
  34331. return this.map[this.keyElem.valueToString(i)] = {
  34332. key: i,
  34333. value: n
  34334. },
  34335. this
  34336. }
  34337. ,
  34338. t.get = function(e) {
  34339. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  34340. if (t in this.map)
  34341. return this.map[t].value
  34342. }
  34343. ,
  34344. t.has = function(e) {
  34345. return this.keyElem.valueToString(this.keyElem.verifyValue(e))in this.map
  34346. }
  34347. ,
  34348. c),
  34349. o.loadProto = function(e, t, i) {
  34350. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  34351. t = void 0),
  34352. o.loadJson(o.DotProto.Parser.parse(e), t, i)
  34353. }
  34354. ,
  34355. o.protoFromString = o.loadProto,
  34356. o.loadProtoFile = function(t, i, n) {
  34357. if (i && "object" == typeof i ? (n = i,
  34358. i = null) : i && "function" == typeof i || (i = null),
  34359. i)
  34360. return o.Util.fetch("string" == typeof t ? t : t.root + "/" + t.file, function(e) {
  34361. if (null !== e)
  34362. try {
  34363. i(null, o.loadProto(e, n, t))
  34364. } catch (e) {
  34365. i(e)
  34366. }
  34367. else
  34368. i(Error("Failed to fetch file"))
  34369. });
  34370. var e = o.Util.fetch("object" == typeof t ? t.root + "/" + t.file : t);
  34371. return null === e ? null : o.loadProto(e, n, t)
  34372. }
  34373. ,
  34374. o.protoFromFile = o.loadProtoFile,
  34375. o.newBuilder = function(e) {
  34376. return void 0 === (e = e || {}).convertFieldsToCamelCase && (e.convertFieldsToCamelCase = o.convertFieldsToCamelCase),
  34377. void 0 === e.populateAccessors && (e.populateAccessors = o.populateAccessors),
  34378. new o.Builder(e)
  34379. }
  34380. ,
  34381. o.loadJson = function(e, t, i) {
  34382. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  34383. t = null),
  34384. t && "object" == typeof t || (t = o.newBuilder()),
  34385. "string" == typeof e && (e = JSON.parse(e)),
  34386. t.import(e, i),
  34387. t.resolveAll(),
  34388. t
  34389. }
  34390. ,
  34391. o.loadJsonFile = function(t, i, n) {
  34392. if (i && "object" == typeof i ? (n = i,
  34393. i = null) : i && "function" == typeof i || (i = null),
  34394. i)
  34395. return o.Util.fetch("string" == typeof t ? t : t.root + "/" + t.file, function(e) {
  34396. if (null !== e)
  34397. try {
  34398. i(null, o.loadJson(JSON.parse(e), n, t))
  34399. } catch (e) {
  34400. i(e)
  34401. }
  34402. else
  34403. i(Error("Failed to fetch file"))
  34404. });
  34405. var e = o.Util.fetch("object" == typeof t ? t.root + "/" + t.file : t);
  34406. return null === e ? null : o.loadJson(JSON.parse(e), n, t)
  34407. }
  34408. ,
  34409. o;
  34410. function l(e) {
  34411. var t = 0;
  34412. return {
  34413. next: function() {
  34414. return t < e.length ? {
  34415. done: !1,
  34416. value: e[t++]
  34417. } : {
  34418. done: !0
  34419. }
  34420. }
  34421. }
  34422. }
  34423. function c(e, t) {
  34424. if (!e.map)
  34425. throw Error("field is not a map");
  34426. if (this.field = e,
  34427. this.keyElem = new a.Element(e.keyType,null,!0,e.syntax),
  34428. this.valueElem = new a.Element(e.type,e.resolvedType,!1,e.syntax),
  34429. this.map = {},
  34430. Object.defineProperty(this, "size", {
  34431. get: function() {
  34432. return Object.keys(this.map).length
  34433. }
  34434. }),
  34435. t)
  34436. for (var i = Object.keys(t), n = 0; n < i.length; n++) {
  34437. var r = this.keyElem.valueFromString(i[n])
  34438. , o = this.valueElem.verifyValue(t[i[n]]);
  34439. this.map[this.keyElem.valueToString(r)] = {
  34440. key: r,
  34441. value: o
  34442. }
  34443. }
  34444. }
  34445. function h(e) {
  34446. this.ns = new s.Namespace(this,null,""),
  34447. this.ptr = this.ns,
  34448. this.resolved = !1,
  34449. this.result = null,
  34450. this.files = {},
  34451. this.importRoot = null,
  34452. this.options = e || {}
  34453. }
  34454. }
  34455. ,
  34456. "function" == typeof define && define.amd ? define(["bytebuffer"], t) : "function" == typeof p && "object" == typeof i && i && i.exports ? i.exports = t(p("bytebuffer")) : (e.dcodeIO = e.dcodeIO || {}).ProtoBuf = t(e.dcodeIO.ByteBuffer)
  34457. }
  34458. ).call(this, p("_process"))
  34459. }
  34460. , {
  34461. _process: 203,
  34462. bytebuffer: 215,
  34463. fs: 197,
  34464. path: 197
  34465. }],
  34466. 215: [function(t, e, i) {
  34467. var n, r;
  34468. n = this,
  34469. r = function(l) {
  34470. "use strict";
  34471. function s(e) {
  34472. var t = 0;
  34473. return function() {
  34474. return t < e.length ? e.charCodeAt(t++) : null
  34475. }
  34476. }
  34477. function c() {
  34478. var e = []
  34479. , t = [];
  34480. return function() {
  34481. return 0 === arguments.length ? t.join("") + i.apply(String, e) : (1024 < e.length + arguments.length && (t.push(i.apply(String, e)),
  34482. e.length = 0),
  34483. void Array.prototype.push.apply(e, arguments))
  34484. }
  34485. }
  34486. function n(e, t, i, n, r) {
  34487. 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];
  34488. for (u += d,
  34489. o = p & (1 << -h) - 1,
  34490. p >>= -h,
  34491. h += s; 0 < h; o = 256 * o + e[t + u],
  34492. u += d,
  34493. h -= 8)
  34494. ;
  34495. for (a = o & (1 << -h) - 1,
  34496. o >>= -h,
  34497. h += n; 0 < h; a = 256 * a + e[t + u],
  34498. u += d,
  34499. h -= 8)
  34500. ;
  34501. if (0 === o)
  34502. o = 1 - c;
  34503. else {
  34504. if (o === l)
  34505. return a ? NaN : 1 / 0 * (p ? -1 : 1);
  34506. a += Math.pow(2, n),
  34507. o -= c
  34508. }
  34509. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  34510. }
  34511. function r(e, t, i, n, r, o) {
  34512. 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;
  34513. for (t = Math.abs(t),
  34514. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  34515. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  34516. t * (l = Math.pow(2, -a)) < 1 && (a--,
  34517. l *= 2),
  34518. 2 <= (t += 1 <= a + u ? d / l : d * Math.pow(2, 1 - u)) * l && (a++,
  34519. l /= 2),
  34520. h <= a + u ? (s = 0,
  34521. a = h) : 1 <= a + u ? (s = (t * l - 1) * Math.pow(2, r),
  34522. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  34523. a = 0)); 8 <= r; e[i + p] = 255 & s,
  34524. p += f,
  34525. s /= 256,
  34526. r -= 8)
  34527. ;
  34528. for (a = a << r | s,
  34529. c += r; 0 < c; e[i + p] = 255 & a,
  34530. p += f,
  34531. a /= 256,
  34532. c -= 8)
  34533. ;
  34534. e[i + p - f] |= 128 * g
  34535. }
  34536. var f = function(e, t, i) {
  34537. if (void 0 === e && (e = f.DEFAULT_CAPACITY),
  34538. void 0 === t && (t = f.DEFAULT_ENDIAN),
  34539. void 0 === i && (i = f.DEFAULT_NOASSERT),
  34540. !i) {
  34541. if ((e |= 0) < 0)
  34542. throw RangeError("Illegal capacity");
  34543. t = !!t,
  34544. i = !!i
  34545. }
  34546. this.buffer = 0 === e ? o : new ArrayBuffer(e),
  34547. this.view = 0 === e ? null : new Uint8Array(this.buffer),
  34548. this.offset = 0,
  34549. this.markedOffset = -1,
  34550. this.limit = e,
  34551. this.littleEndian = t,
  34552. this.noAssert = i
  34553. };
  34554. f.VERSION = "5.0.1",
  34555. f.LITTLE_ENDIAN = !0,
  34556. f.BIG_ENDIAN = !1,
  34557. f.DEFAULT_CAPACITY = 16,
  34558. f.DEFAULT_ENDIAN = f.BIG_ENDIAN,
  34559. f.DEFAULT_NOASSERT = !1,
  34560. f.Long = l || null;
  34561. var a = f.prototype;
  34562. a.__isByteBuffer__,
  34563. Object.defineProperty(a, "__isByteBuffer__", {
  34564. value: !0,
  34565. enumerable: !1,
  34566. configurable: !1
  34567. });
  34568. var o = new ArrayBuffer(0)
  34569. , i = String.fromCharCode;
  34570. f.accessor = function() {
  34571. return Uint8Array
  34572. }
  34573. ,
  34574. f.allocate = function(e, t, i) {
  34575. return new f(e,t,i)
  34576. }
  34577. ,
  34578. f.concat = function(e, t, i, n) {
  34579. "boolean" != typeof t && "string" == typeof t || (n = i,
  34580. i = t,
  34581. t = void 0);
  34582. for (var r, o = 0, a = 0, s = e.length; a < s; ++a)
  34583. f.isByteBuffer(e[a]) || (e[a] = f.wrap(e[a], t)),
  34584. 0 < (r = e[a].limit - e[a].offset) && (o += r);
  34585. if (0 === o)
  34586. return new f(0,i,n);
  34587. var l, c = new f(o,i,n);
  34588. for (a = 0; a < s; )
  34589. (r = (l = e[a++]).limit - l.offset) <= 0 || (c.view.set(l.view.subarray(l.offset, l.limit), c.offset),
  34590. c.offset += r);
  34591. return c.limit = c.offset,
  34592. c.offset = 0,
  34593. c
  34594. }
  34595. ,
  34596. f.isByteBuffer = function(e) {
  34597. return !0 === (e && e.__isByteBuffer__)
  34598. }
  34599. ,
  34600. f.type = function() {
  34601. return ArrayBuffer
  34602. }
  34603. ,
  34604. f.wrap = function(e, t, i, n) {
  34605. if ("string" != typeof t && (n = i,
  34606. i = t,
  34607. t = void 0),
  34608. "string" == typeof e)
  34609. switch (void 0 === t && (t = "utf8"),
  34610. t) {
  34611. case "base64":
  34612. return f.fromBase64(e, i);
  34613. case "hex":
  34614. return f.fromHex(e, i);
  34615. case "binary":
  34616. return f.fromBinary(e, i);
  34617. case "utf8":
  34618. return f.fromUTF8(e, i);
  34619. case "debug":
  34620. return f.fromDebug(e, i);
  34621. default:
  34622. throw Error("Unsupported encoding: " + t)
  34623. }
  34624. if (null === e || "object" != typeof e)
  34625. throw TypeError("Illegal buffer");
  34626. var r;
  34627. if (f.isByteBuffer(e))
  34628. return (r = a.clone.call(e)).markedOffset = -1,
  34629. r;
  34630. if (e instanceof Uint8Array)
  34631. r = new f(0,i,n),
  34632. 0 < e.length && (r.buffer = e.buffer,
  34633. r.offset = e.byteOffset,
  34634. r.limit = e.byteOffset + e.byteLength,
  34635. r.view = new Uint8Array(e.buffer));
  34636. else if (e instanceof ArrayBuffer)
  34637. r = new f(0,i,n),
  34638. 0 < e.byteLength && (r.buffer = e,
  34639. r.offset = 0,
  34640. r.limit = e.byteLength,
  34641. r.view = 0 < e.byteLength ? new Uint8Array(e) : null);
  34642. else {
  34643. if ("[object Array]" !== Object.prototype.toString.call(e))
  34644. throw TypeError("Illegal buffer");
  34645. (r = new f(e.length,i,n)).limit = e.length;
  34646. for (var o = 0; o < e.length; ++o)
  34647. r.view[o] = e[o]
  34648. }
  34649. return r
  34650. }
  34651. ,
  34652. a.writeBitSet = function(e, t) {
  34653. var i = void 0 === t;
  34654. if (i && (t = this.offset),
  34655. !this.noAssert) {
  34656. if (!(e instanceof Array))
  34657. throw TypeError("Illegal BitSet: Not an array");
  34658. if ("number" != typeof t || t % 1 != 0)
  34659. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34660. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34661. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34662. }
  34663. var n, r = t, o = e.length, a = o >> 3, s = 0;
  34664. for (t += this.writeVarint32(o, t); a--; )
  34665. 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,
  34666. this.writeByte(n, t++);
  34667. if (s < o) {
  34668. var l = 0;
  34669. for (n = 0; s < o; )
  34670. n |= (1 & !!e[s++]) << l++;
  34671. this.writeByte(n, t++)
  34672. }
  34673. return i ? (this.offset = t,
  34674. this) : t - r
  34675. }
  34676. ,
  34677. a.readBitSet = function(e) {
  34678. var t = void 0 === e;
  34679. t && (e = this.offset);
  34680. var i, n = this.readVarint32(e), r = n.value, o = r >> 3, a = 0, s = [];
  34681. for (e += n.length; o--; )
  34682. i = this.readByte(e++),
  34683. s[a++] = !!(1 & i),
  34684. s[a++] = !!(2 & i),
  34685. s[a++] = !!(4 & i),
  34686. s[a++] = !!(8 & i),
  34687. s[a++] = !!(16 & i),
  34688. s[a++] = !!(32 & i),
  34689. s[a++] = !!(64 & i),
  34690. s[a++] = !!(128 & i);
  34691. if (a < r) {
  34692. var l = 0;
  34693. for (i = this.readByte(e++); a < r; )
  34694. s[a++] = !!(i >> l++ & 1)
  34695. }
  34696. return t && (this.offset = e),
  34697. s
  34698. }
  34699. ,
  34700. a.readBytes = function(e, t) {
  34701. var i = void 0 === t;
  34702. if (i && (t = this.offset),
  34703. !this.noAssert) {
  34704. if ("number" != typeof t || t % 1 != 0)
  34705. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34706. if ((t >>>= 0) < 0 || t + e > this.buffer.byteLength)
  34707. throw RangeError("Illegal offset: 0 <= " + t + " (+" + e + ") <= " + this.buffer.byteLength)
  34708. }
  34709. var n = this.slice(t, t + e);
  34710. return i && (this.offset += e),
  34711. n
  34712. }
  34713. ,
  34714. a.writeBytes = a.append,
  34715. a.writeInt8 = function(e, t) {
  34716. var i = void 0 === t;
  34717. if (i && (t = this.offset),
  34718. !this.noAssert) {
  34719. if ("number" != typeof e || e % 1 != 0)
  34720. throw TypeError("Illegal value: " + e + " (not an integer)");
  34721. if (e |= 0,
  34722. "number" != typeof t || t % 1 != 0)
  34723. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34724. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34725. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34726. }
  34727. t += 1;
  34728. var n = this.buffer.byteLength;
  34729. return n < t && this.resize((n *= 2) > t ? n : t),
  34730. t -= 1,
  34731. this.view[t] = e,
  34732. i && (this.offset += 1),
  34733. this
  34734. }
  34735. ,
  34736. a.writeByte = a.writeInt8,
  34737. a.readInt8 = function(e) {
  34738. var t = void 0 === e;
  34739. if (t && (e = this.offset),
  34740. !this.noAssert) {
  34741. if ("number" != typeof e || e % 1 != 0)
  34742. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34743. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  34744. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  34745. }
  34746. var i = this.view[e];
  34747. return 128 == (128 & i) && (i = -(255 - i + 1)),
  34748. t && (this.offset += 1),
  34749. i
  34750. }
  34751. ,
  34752. a.readByte = a.readInt8,
  34753. a.writeUint8 = function(e, t) {
  34754. var i = void 0 === t;
  34755. if (i && (t = this.offset),
  34756. !this.noAssert) {
  34757. if ("number" != typeof e || e % 1 != 0)
  34758. throw TypeError("Illegal value: " + e + " (not an integer)");
  34759. if (e >>>= 0,
  34760. "number" != typeof t || t % 1 != 0)
  34761. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34762. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34763. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34764. }
  34765. t += 1;
  34766. var n = this.buffer.byteLength;
  34767. return n < t && this.resize((n *= 2) > t ? n : t),
  34768. t -= 1,
  34769. this.view[t] = e,
  34770. i && (this.offset += 1),
  34771. this
  34772. }
  34773. ,
  34774. a.writeUInt8 = a.writeUint8,
  34775. a.readUint8 = function(e) {
  34776. var t = void 0 === e;
  34777. if (t && (e = this.offset),
  34778. !this.noAssert) {
  34779. if ("number" != typeof e || e % 1 != 0)
  34780. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34781. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  34782. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  34783. }
  34784. var i = this.view[e];
  34785. return t && (this.offset += 1),
  34786. i
  34787. }
  34788. ,
  34789. a.readUInt8 = a.readUint8,
  34790. a.writeInt16 = function(e, t) {
  34791. var i = void 0 === t;
  34792. if (i && (t = this.offset),
  34793. !this.noAssert) {
  34794. if ("number" != typeof e || e % 1 != 0)
  34795. throw TypeError("Illegal value: " + e + " (not an integer)");
  34796. if (e |= 0,
  34797. "number" != typeof t || t % 1 != 0)
  34798. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34799. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34800. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34801. }
  34802. t += 2;
  34803. var n = this.buffer.byteLength;
  34804. return n < t && this.resize((n *= 2) > t ? n : t),
  34805. t -= 2,
  34806. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  34807. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  34808. this.view[t + 1] = 255 & e),
  34809. i && (this.offset += 2),
  34810. this
  34811. }
  34812. ,
  34813. a.writeShort = a.writeInt16,
  34814. a.readInt16 = function(e) {
  34815. var t = void 0 === e;
  34816. if (t && (e = this.offset),
  34817. !this.noAssert) {
  34818. if ("number" != typeof e || e % 1 != 0)
  34819. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34820. if ((e >>>= 0) < 0 || e + 2 > this.buffer.byteLength)
  34821. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  34822. }
  34823. var i = 0;
  34824. return this.littleEndian ? (i = this.view[e],
  34825. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  34826. i |= this.view[e + 1]),
  34827. 32768 == (32768 & i) && (i = -(65535 - i + 1)),
  34828. t && (this.offset += 2),
  34829. i
  34830. }
  34831. ,
  34832. a.readShort = a.readInt16,
  34833. a.writeUint16 = function(e, t) {
  34834. var i = void 0 === t;
  34835. if (i && (t = this.offset),
  34836. !this.noAssert) {
  34837. if ("number" != typeof e || e % 1 != 0)
  34838. throw TypeError("Illegal value: " + e + " (not an integer)");
  34839. if (e >>>= 0,
  34840. "number" != typeof t || t % 1 != 0)
  34841. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34842. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34843. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34844. }
  34845. t += 2;
  34846. var n = this.buffer.byteLength;
  34847. return n < t && this.resize((n *= 2) > t ? n : t),
  34848. t -= 2,
  34849. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  34850. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  34851. this.view[t + 1] = 255 & e),
  34852. i && (this.offset += 2),
  34853. this
  34854. }
  34855. ,
  34856. a.writeUInt16 = a.writeUint16,
  34857. a.readUint16 = function(e) {
  34858. var t = void 0 === e;
  34859. if (t && (e = this.offset),
  34860. !this.noAssert) {
  34861. if ("number" != typeof e || e % 1 != 0)
  34862. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34863. if ((e >>>= 0) < 0 || e + 2 > this.buffer.byteLength)
  34864. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  34865. }
  34866. var i = 0;
  34867. return this.littleEndian ? (i = this.view[e],
  34868. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  34869. i |= this.view[e + 1]),
  34870. t && (this.offset += 2),
  34871. i
  34872. }
  34873. ,
  34874. a.readUInt16 = a.readUint16,
  34875. a.writeInt32 = function(e, t) {
  34876. var i = void 0 === t;
  34877. if (i && (t = this.offset),
  34878. !this.noAssert) {
  34879. if ("number" != typeof e || e % 1 != 0)
  34880. throw TypeError("Illegal value: " + e + " (not an integer)");
  34881. if (e |= 0,
  34882. "number" != typeof t || t % 1 != 0)
  34883. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34884. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34885. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34886. }
  34887. t += 4;
  34888. var n = this.buffer.byteLength;
  34889. return n < t && this.resize((n *= 2) > t ? n : t),
  34890. t -= 4,
  34891. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  34892. this.view[t + 2] = e >>> 16 & 255,
  34893. this.view[t + 1] = e >>> 8 & 255,
  34894. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  34895. this.view[t + 1] = e >>> 16 & 255,
  34896. this.view[t + 2] = e >>> 8 & 255,
  34897. this.view[t + 3] = 255 & e),
  34898. i && (this.offset += 4),
  34899. this
  34900. }
  34901. ,
  34902. a.writeInt = a.writeInt32,
  34903. a.readInt32 = function(e) {
  34904. var t = void 0 === e;
  34905. if (t && (e = this.offset),
  34906. !this.noAssert) {
  34907. if ("number" != typeof e || e % 1 != 0)
  34908. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34909. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  34910. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  34911. }
  34912. var i = 0;
  34913. return this.littleEndian ? (i = this.view[e + 2] << 16,
  34914. i |= this.view[e + 1] << 8,
  34915. i |= this.view[e],
  34916. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  34917. i |= this.view[e + 2] << 8,
  34918. i |= this.view[e + 3],
  34919. i += this.view[e] << 24 >>> 0),
  34920. i |= 0,
  34921. t && (this.offset += 4),
  34922. i
  34923. }
  34924. ,
  34925. a.readInt = a.readInt32,
  34926. a.writeUint32 = function(e, t) {
  34927. var i = void 0 === t;
  34928. if (i && (t = this.offset),
  34929. !this.noAssert) {
  34930. if ("number" != typeof e || e % 1 != 0)
  34931. throw TypeError("Illegal value: " + e + " (not an integer)");
  34932. if (e >>>= 0,
  34933. "number" != typeof t || t % 1 != 0)
  34934. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34935. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34936. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34937. }
  34938. t += 4;
  34939. var n = this.buffer.byteLength;
  34940. return n < t && this.resize((n *= 2) > t ? n : t),
  34941. t -= 4,
  34942. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  34943. this.view[t + 2] = e >>> 16 & 255,
  34944. this.view[t + 1] = e >>> 8 & 255,
  34945. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  34946. this.view[t + 1] = e >>> 16 & 255,
  34947. this.view[t + 2] = e >>> 8 & 255,
  34948. this.view[t + 3] = 255 & e),
  34949. i && (this.offset += 4),
  34950. this
  34951. }
  34952. ,
  34953. a.writeUInt32 = a.writeUint32,
  34954. a.readUint32 = function(e) {
  34955. var t = void 0 === e;
  34956. if (t && (e = this.offset),
  34957. !this.noAssert) {
  34958. if ("number" != typeof e || e % 1 != 0)
  34959. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34960. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  34961. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  34962. }
  34963. var i = 0;
  34964. return this.littleEndian ? (i = this.view[e + 2] << 16,
  34965. i |= this.view[e + 1] << 8,
  34966. i |= this.view[e],
  34967. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  34968. i |= this.view[e + 2] << 8,
  34969. i |= this.view[e + 3],
  34970. i += this.view[e] << 24 >>> 0),
  34971. t && (this.offset += 4),
  34972. i
  34973. }
  34974. ,
  34975. a.readUInt32 = a.readUint32,
  34976. l && (a.writeInt64 = function(e, t) {
  34977. var i = void 0 === t;
  34978. if (i && (t = this.offset),
  34979. !this.noAssert) {
  34980. if ("number" == typeof e)
  34981. e = l.fromNumber(e);
  34982. else if ("string" == typeof e)
  34983. e = l.fromString(e);
  34984. else if (!(e && e instanceof l))
  34985. throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  34986. if ("number" != typeof t || t % 1 != 0)
  34987. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34988. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34989. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34990. }
  34991. "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e)),
  34992. t += 8;
  34993. var n = this.buffer.byteLength;
  34994. n < t && this.resize((n *= 2) > t ? n : t),
  34995. t -= 8;
  34996. var r = e.low
  34997. , o = e.high;
  34998. return this.littleEndian ? (this.view[t + 3] = r >>> 24 & 255,
  34999. this.view[t + 2] = r >>> 16 & 255,
  35000. this.view[t + 1] = r >>> 8 & 255,
  35001. this.view[t] = 255 & r,
  35002. t += 4,
  35003. this.view[t + 3] = o >>> 24 & 255,
  35004. this.view[t + 2] = o >>> 16 & 255,
  35005. this.view[t + 1] = o >>> 8 & 255,
  35006. this.view[t] = 255 & o) : (this.view[t] = o >>> 24 & 255,
  35007. this.view[t + 1] = o >>> 16 & 255,
  35008. this.view[t + 2] = o >>> 8 & 255,
  35009. this.view[t + 3] = 255 & o,
  35010. t += 4,
  35011. this.view[t] = r >>> 24 & 255,
  35012. this.view[t + 1] = r >>> 16 & 255,
  35013. this.view[t + 2] = r >>> 8 & 255,
  35014. this.view[t + 3] = 255 & r),
  35015. i && (this.offset += 8),
  35016. this
  35017. }
  35018. ,
  35019. a.writeLong = a.writeInt64,
  35020. a.readInt64 = function(e) {
  35021. var t = void 0 === e;
  35022. if (t && (e = this.offset),
  35023. !this.noAssert) {
  35024. if ("number" != typeof e || e % 1 != 0)
  35025. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35026. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength)
  35027. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  35028. }
  35029. var i = 0
  35030. , n = 0;
  35031. this.littleEndian ? (i = this.view[e + 2] << 16,
  35032. i |= this.view[e + 1] << 8,
  35033. i |= this.view[e],
  35034. i += this.view[e + 3] << 24 >>> 0,
  35035. e += 4,
  35036. n = this.view[e + 2] << 16,
  35037. n |= this.view[e + 1] << 8,
  35038. n |= this.view[e],
  35039. n += this.view[e + 3] << 24 >>> 0) : (n = this.view[e + 1] << 16,
  35040. n |= this.view[e + 2] << 8,
  35041. n |= this.view[e + 3],
  35042. n += this.view[e] << 24 >>> 0,
  35043. e += 4,
  35044. i = this.view[e + 1] << 16,
  35045. i |= this.view[e + 2] << 8,
  35046. i |= this.view[e + 3],
  35047. i += this.view[e] << 24 >>> 0);
  35048. var r = new l(i,n,!1);
  35049. return t && (this.offset += 8),
  35050. r
  35051. }
  35052. ,
  35053. a.readLong = a.readInt64,
  35054. a.writeUint64 = function(e, t) {
  35055. var i = void 0 === t;
  35056. if (i && (t = this.offset),
  35057. !this.noAssert) {
  35058. if ("number" == typeof e)
  35059. e = l.fromNumber(e);
  35060. else if ("string" == typeof e)
  35061. e = l.fromString(e);
  35062. else if (!(e && e instanceof l))
  35063. throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  35064. if ("number" != typeof t || t % 1 != 0)
  35065. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35066. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35067. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35068. }
  35069. "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e)),
  35070. t += 8;
  35071. var n = this.buffer.byteLength;
  35072. n < t && this.resize((n *= 2) > t ? n : t),
  35073. t -= 8;
  35074. var r = e.low
  35075. , o = e.high;
  35076. return this.littleEndian ? (this.view[t + 3] = r >>> 24 & 255,
  35077. this.view[t + 2] = r >>> 16 & 255,
  35078. this.view[t + 1] = r >>> 8 & 255,
  35079. this.view[t] = 255 & r,
  35080. t += 4,
  35081. this.view[t + 3] = o >>> 24 & 255,
  35082. this.view[t + 2] = o >>> 16 & 255,
  35083. this.view[t + 1] = o >>> 8 & 255,
  35084. this.view[t] = 255 & o) : (this.view[t] = o >>> 24 & 255,
  35085. this.view[t + 1] = o >>> 16 & 255,
  35086. this.view[t + 2] = o >>> 8 & 255,
  35087. this.view[t + 3] = 255 & o,
  35088. t += 4,
  35089. this.view[t] = r >>> 24 & 255,
  35090. this.view[t + 1] = r >>> 16 & 255,
  35091. this.view[t + 2] = r >>> 8 & 255,
  35092. this.view[t + 3] = 255 & r),
  35093. i && (this.offset += 8),
  35094. this
  35095. }
  35096. ,
  35097. a.writeUInt64 = a.writeUint64,
  35098. a.readUint64 = function(e) {
  35099. var t = void 0 === e;
  35100. if (t && (e = this.offset),
  35101. !this.noAssert) {
  35102. if ("number" != typeof e || e % 1 != 0)
  35103. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35104. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength)
  35105. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  35106. }
  35107. var i = 0
  35108. , n = 0;
  35109. this.littleEndian ? (i = this.view[e + 2] << 16,
  35110. i |= this.view[e + 1] << 8,
  35111. i |= this.view[e],
  35112. i += this.view[e + 3] << 24 >>> 0,
  35113. e += 4,
  35114. n = this.view[e + 2] << 16,
  35115. n |= this.view[e + 1] << 8,
  35116. n |= this.view[e],
  35117. n += this.view[e + 3] << 24 >>> 0) : (n = this.view[e + 1] << 16,
  35118. n |= this.view[e + 2] << 8,
  35119. n |= this.view[e + 3],
  35120. n += this.view[e] << 24 >>> 0,
  35121. e += 4,
  35122. i = this.view[e + 1] << 16,
  35123. i |= this.view[e + 2] << 8,
  35124. i |= this.view[e + 3],
  35125. i += this.view[e] << 24 >>> 0);
  35126. var r = new l(i,n,!0);
  35127. return t && (this.offset += 8),
  35128. r
  35129. }
  35130. ,
  35131. a.readUInt64 = a.readUint64),
  35132. a.writeFloat32 = function(e, t) {
  35133. var i = void 0 === t;
  35134. if (i && (t = this.offset),
  35135. !this.noAssert) {
  35136. if ("number" != typeof e)
  35137. throw TypeError("Illegal value: " + e + " (not a number)");
  35138. if ("number" != typeof t || t % 1 != 0)
  35139. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35140. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35141. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35142. }
  35143. t += 4;
  35144. var n = this.buffer.byteLength;
  35145. return n < t && this.resize((n *= 2) > t ? n : t),
  35146. t -= 4,
  35147. r(this.view, e, t, this.littleEndian, 23, 4),
  35148. i && (this.offset += 4),
  35149. this
  35150. }
  35151. ,
  35152. a.writeFloat = a.writeFloat32,
  35153. a.readFloat32 = function(e) {
  35154. var t = void 0 === e;
  35155. if (t && (e = this.offset),
  35156. !this.noAssert) {
  35157. if ("number" != typeof e || e % 1 != 0)
  35158. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35159. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  35160. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35161. }
  35162. var i = n(this.view, e, this.littleEndian, 23, 4);
  35163. return t && (this.offset += 4),
  35164. i
  35165. }
  35166. ,
  35167. a.readFloat = a.readFloat32,
  35168. a.writeFloat64 = function(e, t) {
  35169. var i = void 0 === t;
  35170. if (i && (t = this.offset),
  35171. !this.noAssert) {
  35172. if ("number" != typeof e)
  35173. throw TypeError("Illegal value: " + e + " (not a number)");
  35174. if ("number" != typeof t || t % 1 != 0)
  35175. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35176. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35177. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35178. }
  35179. t += 8;
  35180. var n = this.buffer.byteLength;
  35181. return n < t && this.resize((n *= 2) > t ? n : t),
  35182. t -= 8,
  35183. r(this.view, e, t, this.littleEndian, 52, 8),
  35184. i && (this.offset += 8),
  35185. this
  35186. }
  35187. ,
  35188. a.writeDouble = a.writeFloat64,
  35189. a.readFloat64 = function(e) {
  35190. var t = void 0 === e;
  35191. if (t && (e = this.offset),
  35192. !this.noAssert) {
  35193. if ("number" != typeof e || e % 1 != 0)
  35194. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35195. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength)
  35196. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  35197. }
  35198. var i = n(this.view, e, this.littleEndian, 52, 8);
  35199. return t && (this.offset += 8),
  35200. i
  35201. }
  35202. ,
  35203. a.readDouble = a.readFloat64,
  35204. f.MAX_VARINT32_BYTES = 5,
  35205. f.calculateVarint32 = function(e) {
  35206. return (e >>>= 0) < 128 ? 1 : e < 16384 ? 2 : e < 1 << 21 ? 3 : e < 1 << 28 ? 4 : 5
  35207. }
  35208. ,
  35209. f.zigZagEncode32 = function(e) {
  35210. return ((e |= 0) << 1 ^ e >> 31) >>> 0
  35211. }
  35212. ,
  35213. f.zigZagDecode32 = function(e) {
  35214. return e >>> 1 ^ -(1 & e) | 0
  35215. }
  35216. ,
  35217. a.writeVarint32 = function(e, t) {
  35218. var i = void 0 === t;
  35219. if (i && (t = this.offset),
  35220. !this.noAssert) {
  35221. if ("number" != typeof e || e % 1 != 0)
  35222. throw TypeError("Illegal value: " + e + " (not an integer)");
  35223. if (e |= 0,
  35224. "number" != typeof t || t % 1 != 0)
  35225. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35226. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35227. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35228. }
  35229. var n, r = f.calculateVarint32(e);
  35230. t += r;
  35231. var o = this.buffer.byteLength;
  35232. for (o < t && this.resize((o *= 2) > t ? o : t),
  35233. t -= r,
  35234. e >>>= 0; 128 <= e; )
  35235. n = 127 & e | 128,
  35236. this.view[t++] = n,
  35237. e >>>= 7;
  35238. return this.view[t++] = e,
  35239. i ? (this.offset = t,
  35240. this) : r
  35241. }
  35242. ,
  35243. a.writeVarint32ZigZag = function(e, t) {
  35244. return this.writeVarint32(f.zigZagEncode32(e), t)
  35245. }
  35246. ,
  35247. a.readVarint32 = function(e) {
  35248. var t = void 0 === e;
  35249. if (t && (e = this.offset),
  35250. !this.noAssert) {
  35251. if ("number" != typeof e || e % 1 != 0)
  35252. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35253. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35254. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35255. }
  35256. var i, n = 0, r = 0;
  35257. do {
  35258. if (!this.noAssert && e > this.limit) {
  35259. var o = Error("Truncated");
  35260. throw o.truncated = !0,
  35261. o
  35262. }
  35263. i = this.view[e++],
  35264. n < 5 && (r |= (127 & i) << 7 * n),
  35265. ++n
  35266. } while (0 != (128 & i));return r |= 0,
  35267. t ? (this.offset = e,
  35268. r) : {
  35269. value: r,
  35270. length: n
  35271. }
  35272. }
  35273. ,
  35274. a.readVarint32ZigZag = function(e) {
  35275. var t = this.readVarint32(e);
  35276. return "object" == typeof t ? t.value = f.zigZagDecode32(t.value) : t = f.zigZagDecode32(t),
  35277. t
  35278. }
  35279. ,
  35280. l && (f.MAX_VARINT64_BYTES = 10,
  35281. f.calculateVarint64 = function(e) {
  35282. "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e));
  35283. var t = e.toInt() >>> 0
  35284. , i = e.shiftRightUnsigned(28).toInt() >>> 0
  35285. , n = e.shiftRightUnsigned(56).toInt() >>> 0;
  35286. return 0 == n ? 0 == i ? t < 16384 ? t < 128 ? 1 : 2 : t < 1 << 21 ? 3 : 4 : i < 16384 ? i < 128 ? 5 : 6 : i < 1 << 21 ? 7 : 8 : n < 128 ? 9 : 10
  35287. }
  35288. ,
  35289. f.zigZagEncode64 = function(e) {
  35290. return "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned()),
  35291. e.shiftLeft(1).xor(e.shiftRight(63)).toUnsigned()
  35292. }
  35293. ,
  35294. f.zigZagDecode64 = function(e) {
  35295. return "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned()),
  35296. e.shiftRightUnsigned(1).xor(e.and(l.ONE).toSigned().negate()).toSigned()
  35297. }
  35298. ,
  35299. a.writeVarint64 = function(e, t) {
  35300. var i = void 0 === t;
  35301. if (i && (t = this.offset),
  35302. !this.noAssert) {
  35303. if ("number" == typeof e)
  35304. e = l.fromNumber(e);
  35305. else if ("string" == typeof e)
  35306. e = l.fromString(e);
  35307. else if (!(e && e instanceof l))
  35308. throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  35309. if ("number" != typeof t || t % 1 != 0)
  35310. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35311. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35312. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35313. }
  35314. "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned());
  35315. var n = f.calculateVarint64(e)
  35316. , r = e.toInt() >>> 0
  35317. , o = e.shiftRightUnsigned(28).toInt() >>> 0
  35318. , a = e.shiftRightUnsigned(56).toInt() >>> 0;
  35319. t += n;
  35320. var s = this.buffer.byteLength;
  35321. switch (s < t && this.resize((s *= 2) > t ? s : t),
  35322. t -= n,
  35323. n) {
  35324. case 10:
  35325. this.view[t + 9] = a >>> 7 & 1;
  35326. case 9:
  35327. this.view[t + 8] = 9 !== n ? 128 | a : 127 & a;
  35328. case 8:
  35329. this.view[t + 7] = 8 !== n ? o >>> 21 | 128 : o >>> 21 & 127;
  35330. case 7:
  35331. this.view[t + 6] = 7 !== n ? o >>> 14 | 128 : o >>> 14 & 127;
  35332. case 6:
  35333. this.view[t + 5] = 6 !== n ? o >>> 7 | 128 : o >>> 7 & 127;
  35334. case 5:
  35335. this.view[t + 4] = 5 !== n ? 128 | o : 127 & o;
  35336. case 4:
  35337. this.view[t + 3] = 4 !== n ? r >>> 21 | 128 : r >>> 21 & 127;
  35338. case 3:
  35339. this.view[t + 2] = 3 !== n ? r >>> 14 | 128 : r >>> 14 & 127;
  35340. case 2:
  35341. this.view[t + 1] = 2 !== n ? r >>> 7 | 128 : r >>> 7 & 127;
  35342. case 1:
  35343. this.view[t] = 1 !== n ? 128 | r : 127 & r
  35344. }
  35345. return i ? (this.offset += n,
  35346. this) : n
  35347. }
  35348. ,
  35349. a.writeVarint64ZigZag = function(e, t) {
  35350. return this.writeVarint64(f.zigZagEncode64(e), t)
  35351. }
  35352. ,
  35353. a.readVarint64 = function(e) {
  35354. var t = void 0 === e;
  35355. if (t && (e = this.offset),
  35356. !this.noAssert) {
  35357. if ("number" != typeof e || e % 1 != 0)
  35358. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35359. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35360. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35361. }
  35362. var i = e
  35363. , n = 0
  35364. , r = 0
  35365. , o = 0
  35366. , a = 0;
  35367. if (n = 127 & (a = this.view[e++]),
  35368. 128 & a && (n |= (127 & (a = this.view[e++])) << 7,
  35369. (128 & a || this.noAssert && void 0 === a) && (n |= (127 & (a = this.view[e++])) << 14,
  35370. (128 & a || this.noAssert && void 0 === a) && (n |= (127 & (a = this.view[e++])) << 21,
  35371. (128 & a || this.noAssert && void 0 === a) && (r = 127 & (a = this.view[e++]),
  35372. (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 7,
  35373. (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 14,
  35374. (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 21,
  35375. (128 & a || this.noAssert && void 0 === a) && (o = 127 & (a = this.view[e++]),
  35376. (128 & a || this.noAssert && void 0 === a) && (o |= (127 & (a = this.view[e++])) << 7,
  35377. 128 & a || this.noAssert && void 0 === a))))))))))
  35378. throw Error("Buffer overrun");
  35379. var s = l.fromBits(n | r << 28, r >>> 4 | o << 24, !1);
  35380. return t ? (this.offset = e,
  35381. s) : {
  35382. value: s,
  35383. length: e - i
  35384. }
  35385. }
  35386. ,
  35387. a.readVarint64ZigZag = function(e) {
  35388. var t = this.readVarint64(e);
  35389. return t && t.value instanceof l ? t.value = f.zigZagDecode64(t.value) : t = f.zigZagDecode64(t),
  35390. t
  35391. }
  35392. ),
  35393. a.writeCString = function(e, t) {
  35394. var i = void 0 === t;
  35395. i && (t = this.offset);
  35396. var n, r = e.length;
  35397. if (!this.noAssert) {
  35398. if ("string" != typeof e)
  35399. throw TypeError("Illegal str: Not a string");
  35400. for (n = 0; n < r; ++n)
  35401. if (0 === e.charCodeAt(n))
  35402. throw RangeError("Illegal str: Contains NULL-characters");
  35403. if ("number" != typeof t || t % 1 != 0)
  35404. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35405. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35406. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35407. }
  35408. r = d.calculateUTF16asUTF8(s(e))[1],
  35409. t += r + 1;
  35410. var o = this.buffer.byteLength;
  35411. return o < t && this.resize((o *= 2) > t ? o : t),
  35412. t -= r + 1,
  35413. d.encodeUTF16toUTF8(s(e), function(e) {
  35414. this.view[t++] = e
  35415. }
  35416. .bind(this)),
  35417. this.view[t++] = 0,
  35418. i ? (this.offset = t,
  35419. this) : r
  35420. }
  35421. ,
  35422. a.readCString = function(e) {
  35423. var t = void 0 === e;
  35424. if (t && (e = this.offset),
  35425. !this.noAssert) {
  35426. if ("number" != typeof e || e % 1 != 0)
  35427. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35428. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35429. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35430. }
  35431. var i, n = e, r = -1;
  35432. return d.decodeUTF8toUTF16(function() {
  35433. if (0 === r)
  35434. return null;
  35435. if (e >= this.limit)
  35436. throw RangeError("Illegal range: Truncated data, " + e + " < " + this.limit);
  35437. return 0 === (r = this.view[e++]) ? null : r
  35438. }
  35439. .bind(this), i = c(), !0),
  35440. t ? (this.offset = e,
  35441. i()) : {
  35442. string: i(),
  35443. length: e - n
  35444. }
  35445. }
  35446. ,
  35447. a.writeIString = function(e, t) {
  35448. var i = void 0 === t;
  35449. if (i && (t = this.offset),
  35450. !this.noAssert) {
  35451. if ("string" != typeof e)
  35452. throw TypeError("Illegal str: Not a string");
  35453. if ("number" != typeof t || t % 1 != 0)
  35454. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35455. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35456. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35457. }
  35458. var n, r = t;
  35459. n = d.calculateUTF16asUTF8(s(e), this.noAssert)[1],
  35460. t += 4 + n;
  35461. var o = this.buffer.byteLength;
  35462. if (o < t && this.resize((o *= 2) > t ? o : t),
  35463. t -= 4 + n,
  35464. this.littleEndian ? (this.view[t + 3] = n >>> 24 & 255,
  35465. this.view[t + 2] = n >>> 16 & 255,
  35466. this.view[t + 1] = n >>> 8 & 255,
  35467. this.view[t] = 255 & n) : (this.view[t] = n >>> 24 & 255,
  35468. this.view[t + 1] = n >>> 16 & 255,
  35469. this.view[t + 2] = n >>> 8 & 255,
  35470. this.view[t + 3] = 255 & n),
  35471. t += 4,
  35472. d.encodeUTF16toUTF8(s(e), function(e) {
  35473. this.view[t++] = e
  35474. }
  35475. .bind(this)),
  35476. t !== r + 4 + n)
  35477. throw RangeError("Illegal range: Truncated data, " + t + " == " + (t + 4 + n));
  35478. return i ? (this.offset = t,
  35479. this) : t - r
  35480. }
  35481. ,
  35482. a.readIString = function(e) {
  35483. var t = void 0 === e;
  35484. if (t && (e = this.offset),
  35485. !this.noAssert) {
  35486. if ("number" != typeof e || e % 1 != 0)
  35487. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35488. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  35489. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35490. }
  35491. var i = e
  35492. , n = this.readUint32(e)
  35493. , r = this.readUTF8String(n, f.METRICS_BYTES, e += 4);
  35494. return e += r.length,
  35495. t ? (this.offset = e,
  35496. r.string) : {
  35497. string: r.string,
  35498. length: e - i
  35499. }
  35500. }
  35501. ,
  35502. f.METRICS_CHARS = "c",
  35503. f.METRICS_BYTES = "b",
  35504. a.writeUTF8String = function(e, t) {
  35505. var i = void 0 === t;
  35506. if (i && (t = this.offset),
  35507. !this.noAssert) {
  35508. if ("number" != typeof t || t % 1 != 0)
  35509. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35510. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35511. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35512. }
  35513. var n, r = t;
  35514. n = d.calculateUTF16asUTF8(s(e))[1],
  35515. t += n;
  35516. var o = this.buffer.byteLength;
  35517. return o < t && this.resize((o *= 2) > t ? o : t),
  35518. t -= n,
  35519. d.encodeUTF16toUTF8(s(e), function(e) {
  35520. this.view[t++] = e
  35521. }
  35522. .bind(this)),
  35523. i ? (this.offset = t,
  35524. this) : t - r
  35525. }
  35526. ,
  35527. a.writeString = a.writeUTF8String,
  35528. f.calculateUTF8Chars = function(e) {
  35529. return d.calculateUTF16asUTF8(s(e))[0]
  35530. }
  35531. ,
  35532. f.calculateUTF8Bytes = function(e) {
  35533. return d.calculateUTF16asUTF8(s(e))[1]
  35534. }
  35535. ,
  35536. f.calculateString = f.calculateUTF8Bytes,
  35537. a.readUTF8String = function(e, t, i) {
  35538. "number" == typeof t && (i = t,
  35539. t = void 0);
  35540. var n = void 0 === i;
  35541. if (n && (i = this.offset),
  35542. void 0 === t && (t = f.METRICS_CHARS),
  35543. !this.noAssert) {
  35544. if ("number" != typeof e || e % 1 != 0)
  35545. throw TypeError("Illegal length: " + e + " (not an integer)");
  35546. if (e |= 0,
  35547. "number" != typeof i || i % 1 != 0)
  35548. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35549. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength)
  35550. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35551. }
  35552. var r, o = 0, a = i;
  35553. if (t === f.METRICS_CHARS) {
  35554. if (r = c(),
  35555. d.decodeUTF8(function() {
  35556. return o < e && i < this.limit ? this.view[i++] : null
  35557. }
  35558. .bind(this), function(e) {
  35559. ++o,
  35560. d.UTF8toUTF16(e, r)
  35561. }),
  35562. o !== e)
  35563. throw RangeError("Illegal range: Truncated data, " + o + " == " + e);
  35564. return n ? (this.offset = i,
  35565. r()) : {
  35566. string: r(),
  35567. length: i - a
  35568. }
  35569. }
  35570. if (t !== f.METRICS_BYTES)
  35571. throw TypeError("Unsupported metrics: " + t);
  35572. if (!this.noAssert) {
  35573. if ("number" != typeof i || i % 1 != 0)
  35574. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35575. if ((i >>>= 0) < 0 || i + e > this.buffer.byteLength)
  35576. throw RangeError("Illegal offset: 0 <= " + i + " (+" + e + ") <= " + this.buffer.byteLength)
  35577. }
  35578. var s = i + e;
  35579. if (d.decodeUTF8toUTF16(function() {
  35580. return i < s ? this.view[i++] : null
  35581. }
  35582. .bind(this), r = c(), this.noAssert),
  35583. i !== s)
  35584. throw RangeError("Illegal range: Truncated data, " + i + " == " + s);
  35585. return n ? (this.offset = i,
  35586. r()) : {
  35587. string: r(),
  35588. length: i - a
  35589. }
  35590. }
  35591. ,
  35592. a.readString = a.readUTF8String,
  35593. a.writeVString = function(e, t) {
  35594. var i = void 0 === t;
  35595. if (i && (t = this.offset),
  35596. !this.noAssert) {
  35597. if ("string" != typeof e)
  35598. throw TypeError("Illegal str: Not a string");
  35599. if ("number" != typeof t || t % 1 != 0)
  35600. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35601. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35602. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35603. }
  35604. var n, r, o = t;
  35605. n = d.calculateUTF16asUTF8(s(e), this.noAssert)[1],
  35606. r = f.calculateVarint32(n),
  35607. t += r + n;
  35608. var a = this.buffer.byteLength;
  35609. if (a < t && this.resize((a *= 2) > t ? a : t),
  35610. t -= r + n,
  35611. t += this.writeVarint32(n, t),
  35612. d.encodeUTF16toUTF8(s(e), function(e) {
  35613. this.view[t++] = e
  35614. }
  35615. .bind(this)),
  35616. t !== o + n + r)
  35617. throw RangeError("Illegal range: Truncated data, " + t + " == " + (t + n + r));
  35618. return i ? (this.offset = t,
  35619. this) : t - o
  35620. }
  35621. ,
  35622. a.readVString = function(e) {
  35623. var t = void 0 === e;
  35624. if (t && (e = this.offset),
  35625. !this.noAssert) {
  35626. if ("number" != typeof e || e % 1 != 0)
  35627. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35628. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35629. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35630. }
  35631. var i = e
  35632. , n = this.readVarint32(e)
  35633. , r = this.readUTF8String(n.value, f.METRICS_BYTES, e += n.length);
  35634. return e += r.length,
  35635. t ? (this.offset = e,
  35636. r.string) : {
  35637. string: r.string,
  35638. length: e - i
  35639. }
  35640. }
  35641. ,
  35642. a.append = function(e, t, i) {
  35643. "number" != typeof t && "string" == typeof t || (i = t,
  35644. t = void 0);
  35645. var n = void 0 === i;
  35646. if (n && (i = this.offset),
  35647. !this.noAssert) {
  35648. if ("number" != typeof i || i % 1 != 0)
  35649. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35650. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength)
  35651. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35652. }
  35653. e instanceof f || (e = f.wrap(e, t));
  35654. var r = e.limit - e.offset;
  35655. if (r <= 0)
  35656. return this;
  35657. i += r;
  35658. var o = this.buffer.byteLength;
  35659. return o < i && this.resize((o *= 2) > i ? o : i),
  35660. i -= r,
  35661. this.view.set(e.view.subarray(e.offset, e.limit), i),
  35662. e.offset += r,
  35663. n && (this.offset += r),
  35664. this
  35665. }
  35666. ,
  35667. a.appendTo = function(e, t) {
  35668. return e.append(this, t),
  35669. this
  35670. }
  35671. ,
  35672. a.assert = function(e) {
  35673. return this.noAssert = !e,
  35674. this
  35675. }
  35676. ,
  35677. a.capacity = function() {
  35678. return this.buffer.byteLength
  35679. }
  35680. ,
  35681. a.clear = function() {
  35682. return this.offset = 0,
  35683. this.limit = this.buffer.byteLength,
  35684. this.markedOffset = -1,
  35685. this
  35686. }
  35687. ,
  35688. a.clone = function(e) {
  35689. var t = new f(0,this.littleEndian,this.noAssert);
  35690. return e ? (t.buffer = new ArrayBuffer(this.buffer.byteLength),
  35691. t.view = new Uint8Array(t.buffer)) : (t.buffer = this.buffer,
  35692. t.view = this.view),
  35693. t.offset = this.offset,
  35694. t.markedOffset = this.markedOffset,
  35695. t.limit = this.limit,
  35696. t
  35697. }
  35698. ,
  35699. a.compact = function(e, t) {
  35700. if (void 0 === e && (e = this.offset),
  35701. void 0 === t && (t = this.limit),
  35702. !this.noAssert) {
  35703. if ("number" != typeof e || e % 1 != 0)
  35704. throw TypeError("Illegal begin: Not an integer");
  35705. if (e >>>= 0,
  35706. "number" != typeof t || t % 1 != 0)
  35707. throw TypeError("Illegal end: Not an integer");
  35708. if (t >>>= 0,
  35709. e < 0 || t < e || t > this.buffer.byteLength)
  35710. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35711. }
  35712. if (0 === e && t === this.buffer.byteLength)
  35713. return this;
  35714. var i = t - e;
  35715. if (0 == i)
  35716. return this.buffer = o,
  35717. this.view = null,
  35718. 0 <= this.markedOffset && (this.markedOffset -= e),
  35719. this.offset = 0,
  35720. this.limit = 0,
  35721. this;
  35722. var n = new ArrayBuffer(i)
  35723. , r = new Uint8Array(n);
  35724. return r.set(this.view.subarray(e, t)),
  35725. this.buffer = n,
  35726. this.view = r,
  35727. 0 <= this.markedOffset && (this.markedOffset -= e),
  35728. this.offset = 0,
  35729. this.limit = i,
  35730. this
  35731. }
  35732. ,
  35733. a.copy = function(e, t) {
  35734. if (void 0 === e && (e = this.offset),
  35735. void 0 === t && (t = this.limit),
  35736. !this.noAssert) {
  35737. if ("number" != typeof e || e % 1 != 0)
  35738. throw TypeError("Illegal begin: Not an integer");
  35739. if (e >>>= 0,
  35740. "number" != typeof t || t % 1 != 0)
  35741. throw TypeError("Illegal end: Not an integer");
  35742. if (t >>>= 0,
  35743. e < 0 || t < e || t > this.buffer.byteLength)
  35744. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35745. }
  35746. if (e === t)
  35747. return new f(0,this.littleEndian,this.noAssert);
  35748. var i = t - e
  35749. , n = new f(i,this.littleEndian,this.noAssert);
  35750. return n.offset = 0,
  35751. n.limit = i,
  35752. 0 <= n.markedOffset && (n.markedOffset -= e),
  35753. this.copyTo(n, 0, e, t),
  35754. n
  35755. }
  35756. ,
  35757. a.copyTo = function(e, t, i, n) {
  35758. var r, o;
  35759. if (!this.noAssert && !f.isByteBuffer(e))
  35760. throw TypeError("Illegal target: Not a ByteBuffer");
  35761. if (t = (o = void 0 === t) ? e.offset : 0 | t,
  35762. i = (r = void 0 === i) ? this.offset : 0 | i,
  35763. n = void 0 === n ? this.limit : 0 | n,
  35764. t < 0 || t > e.buffer.byteLength)
  35765. throw RangeError("Illegal target range: 0 <= " + t + " <= " + e.buffer.byteLength);
  35766. if (i < 0 || n > this.buffer.byteLength)
  35767. throw RangeError("Illegal source range: 0 <= " + i + " <= " + this.buffer.byteLength);
  35768. var a = n - i;
  35769. return 0 == a ? e : (e.ensureCapacity(t + a),
  35770. e.view.set(this.view.subarray(i, n), t),
  35771. r && (this.offset += a),
  35772. o && (e.offset += a),
  35773. this)
  35774. }
  35775. ,
  35776. a.ensureCapacity = function(e) {
  35777. var t = this.buffer.byteLength;
  35778. return t < e ? this.resize((t *= 2) > e ? t : e) : this
  35779. }
  35780. ,
  35781. a.fill = function(e, t, i) {
  35782. var n = void 0 === t;
  35783. if (n && (t = this.offset),
  35784. "string" == typeof e && 0 < e.length && (e = e.charCodeAt(0)),
  35785. void 0 === t && (t = this.offset),
  35786. void 0 === i && (i = this.limit),
  35787. !this.noAssert) {
  35788. if ("number" != typeof e || e % 1 != 0)
  35789. throw TypeError("Illegal value: " + e + " (not an integer)");
  35790. if (e |= 0,
  35791. "number" != typeof t || t % 1 != 0)
  35792. throw TypeError("Illegal begin: Not an integer");
  35793. if (t >>>= 0,
  35794. "number" != typeof i || i % 1 != 0)
  35795. throw TypeError("Illegal end: Not an integer");
  35796. if (i >>>= 0,
  35797. t < 0 || i < t || i > this.buffer.byteLength)
  35798. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  35799. }
  35800. if (i <= t)
  35801. return this;
  35802. for (; t < i; )
  35803. this.view[t++] = e;
  35804. return n && (this.offset = t),
  35805. this
  35806. }
  35807. ,
  35808. a.flip = function() {
  35809. return this.limit = this.offset,
  35810. this.offset = 0,
  35811. this
  35812. }
  35813. ,
  35814. a.mark = function(e) {
  35815. if (e = void 0 === e ? this.offset : e,
  35816. !this.noAssert) {
  35817. if ("number" != typeof e || e % 1 != 0)
  35818. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35819. if ((e >>>= 0) < 0 || e + 0 > this.buffer.byteLength)
  35820. throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
  35821. }
  35822. return this.markedOffset = e,
  35823. this
  35824. }
  35825. ,
  35826. a.order = function(e) {
  35827. if (!this.noAssert && "boolean" != typeof e)
  35828. throw TypeError("Illegal littleEndian: Not a boolean");
  35829. return this.littleEndian = !!e,
  35830. this
  35831. }
  35832. ,
  35833. a.LE = function(e) {
  35834. return this.littleEndian = void 0 === e || !!e,
  35835. this
  35836. }
  35837. ,
  35838. a.BE = function(e) {
  35839. return this.littleEndian = void 0 !== e && !e,
  35840. this
  35841. }
  35842. ,
  35843. a.prepend = function(e, t, i) {
  35844. "number" != typeof t && "string" == typeof t || (i = t,
  35845. t = void 0);
  35846. var n = void 0 === i;
  35847. if (n && (i = this.offset),
  35848. !this.noAssert) {
  35849. if ("number" != typeof i || i % 1 != 0)
  35850. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35851. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength)
  35852. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35853. }
  35854. e instanceof f || (e = f.wrap(e, t));
  35855. var r = e.limit - e.offset;
  35856. if (r <= 0)
  35857. return this;
  35858. var o = r - i;
  35859. if (0 < o) {
  35860. var a = new ArrayBuffer(this.buffer.byteLength + o)
  35861. , s = new Uint8Array(a);
  35862. s.set(this.view.subarray(i, this.buffer.byteLength), r),
  35863. this.buffer = a,
  35864. this.view = s,
  35865. this.offset += o,
  35866. 0 <= this.markedOffset && (this.markedOffset += o),
  35867. this.limit += o,
  35868. i += o
  35869. } else
  35870. new Uint8Array(this.buffer);
  35871. return this.view.set(e.view.subarray(e.offset, e.limit), i - r),
  35872. e.offset = e.limit,
  35873. n && (this.offset -= r),
  35874. this
  35875. }
  35876. ,
  35877. a.prependTo = function(e, t) {
  35878. return e.prepend(this, t),
  35879. this
  35880. }
  35881. ,
  35882. a.printDebug = function(e) {
  35883. "function" != typeof e && (e = console.log.bind(console)),
  35884. e(this.toString() + "\n-------------------------------------------------------------------\n" + this.toDebug(!0))
  35885. }
  35886. ,
  35887. a.remaining = function() {
  35888. return this.limit - this.offset
  35889. }
  35890. ,
  35891. a.reset = function() {
  35892. return 0 <= this.markedOffset ? (this.offset = this.markedOffset,
  35893. this.markedOffset = -1) : this.offset = 0,
  35894. this
  35895. }
  35896. ,
  35897. a.resize = function(e) {
  35898. if (!this.noAssert) {
  35899. if ("number" != typeof e || e % 1 != 0)
  35900. throw TypeError("Illegal capacity: " + e + " (not an integer)");
  35901. if ((e |= 0) < 0)
  35902. throw RangeError("Illegal capacity: 0 <= " + e)
  35903. }
  35904. if (this.buffer.byteLength < e) {
  35905. var t = new ArrayBuffer(e)
  35906. , i = new Uint8Array(t);
  35907. i.set(this.view),
  35908. this.buffer = t,
  35909. this.view = i
  35910. }
  35911. return this
  35912. }
  35913. ,
  35914. a.reverse = function(e, t) {
  35915. if (void 0 === e && (e = this.offset),
  35916. void 0 === t && (t = this.limit),
  35917. !this.noAssert) {
  35918. if ("number" != typeof e || e % 1 != 0)
  35919. throw TypeError("Illegal begin: Not an integer");
  35920. if (e >>>= 0,
  35921. "number" != typeof t || t % 1 != 0)
  35922. throw TypeError("Illegal end: Not an integer");
  35923. if (t >>>= 0,
  35924. e < 0 || t < e || t > this.buffer.byteLength)
  35925. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35926. }
  35927. return e === t || Array.prototype.reverse.call(this.view.subarray(e, t)),
  35928. this
  35929. }
  35930. ,
  35931. a.skip = function(e) {
  35932. if (!this.noAssert) {
  35933. if ("number" != typeof e || e % 1 != 0)
  35934. throw TypeError("Illegal length: " + e + " (not an integer)");
  35935. e |= 0
  35936. }
  35937. var t = this.offset + e;
  35938. if (!this.noAssert && (t < 0 || t > this.buffer.byteLength))
  35939. throw RangeError("Illegal length: 0 <= " + this.offset + " + " + e + " <= " + this.buffer.byteLength);
  35940. return this.offset = t,
  35941. this
  35942. }
  35943. ,
  35944. a.slice = function(e, t) {
  35945. if (void 0 === e && (e = this.offset),
  35946. void 0 === t && (t = this.limit),
  35947. !this.noAssert) {
  35948. if ("number" != typeof e || e % 1 != 0)
  35949. throw TypeError("Illegal begin: Not an integer");
  35950. if (e >>>= 0,
  35951. "number" != typeof t || t % 1 != 0)
  35952. throw TypeError("Illegal end: Not an integer");
  35953. if (t >>>= 0,
  35954. e < 0 || t < e || t > this.buffer.byteLength)
  35955. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35956. }
  35957. var i = this.clone();
  35958. return i.offset = e,
  35959. i.limit = t,
  35960. i
  35961. }
  35962. ,
  35963. a.toBuffer = function(e) {
  35964. var t = this.offset
  35965. , i = this.limit;
  35966. if (!this.noAssert) {
  35967. if ("number" != typeof t || t % 1 != 0)
  35968. throw TypeError("Illegal offset: Not an integer");
  35969. if (t >>>= 0,
  35970. "number" != typeof i || i % 1 != 0)
  35971. throw TypeError("Illegal limit: Not an integer");
  35972. if (i >>>= 0,
  35973. t < 0 || i < t || i > this.buffer.byteLength)
  35974. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  35975. }
  35976. if (!e && 0 === t && i === this.buffer.byteLength)
  35977. return this.buffer;
  35978. if (t === i)
  35979. return o;
  35980. var n = new ArrayBuffer(i - t);
  35981. return new Uint8Array(n).set(new Uint8Array(this.buffer).subarray(t, i), 0),
  35982. n
  35983. }
  35984. ,
  35985. a.toArrayBuffer = a.toBuffer,
  35986. a.toString = function(e, t, i) {
  35987. if (void 0 === e)
  35988. return "ByteBufferAB(offset=" + this.offset + ",markedOffset=" + this.markedOffset + ",limit=" + this.limit + ",capacity=" + this.capacity() + ")";
  35989. switch ("number" == typeof e && (i = t = e = "utf8"),
  35990. e) {
  35991. case "utf8":
  35992. return this.toUTF8(t, i);
  35993. case "base64":
  35994. return this.toBase64(t, i);
  35995. case "hex":
  35996. return this.toHex(t, i);
  35997. case "binary":
  35998. return this.toBinary(t, i);
  35999. case "debug":
  36000. return this.toDebug();
  36001. case "columns":
  36002. return this.toColumns();
  36003. default:
  36004. throw Error("Unsupported encoding: " + e)
  36005. }
  36006. }
  36007. ;
  36008. var h = function() {
  36009. for (var e = {}, r = [65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 43, 47], a = [], t = 0, i = r.length; t < i; ++t)
  36010. a[r[t]] = t;
  36011. return e.encode = function(e, t) {
  36012. for (var i, n; null !== (i = e()); )
  36013. t(r[i >> 2 & 63]),
  36014. n = (3 & i) << 4,
  36015. null !== (i = e()) ? (t(r[63 & ((n |= i >> 4 & 15) | i >> 4 & 15)]),
  36016. n = (15 & i) << 2,
  36017. null !== (i = e()) ? (t(r[63 & (n | i >> 6 & 3)]),
  36018. t(r[63 & i])) : (t(r[63 & n]),
  36019. t(61))) : (t(r[63 & n]),
  36020. t(61),
  36021. t(61))
  36022. }
  36023. ,
  36024. e.decode = function(e, t) {
  36025. function i(e) {
  36026. throw Error("Illegal character code: " + e)
  36027. }
  36028. for (var n, r, o; null !== (n = e()); )
  36029. if (void 0 === (r = a[n]) && i(n),
  36030. null !== (n = e()) && (void 0 === (o = a[n]) && i(n),
  36031. t(r << 2 >>> 0 | (48 & o) >> 4),
  36032. null !== (n = e()))) {
  36033. if (void 0 === (r = a[n])) {
  36034. if (61 === n)
  36035. break;
  36036. i(n)
  36037. }
  36038. if (t((15 & o) << 4 >>> 0 | (60 & r) >> 2),
  36039. null !== (n = e())) {
  36040. if (void 0 === (o = a[n])) {
  36041. if (61 === n)
  36042. break;
  36043. i(n)
  36044. }
  36045. t((3 & r) << 6 >>> 0 | o)
  36046. }
  36047. }
  36048. }
  36049. ,
  36050. e.test = function(e) {
  36051. return /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)
  36052. }
  36053. ,
  36054. e
  36055. }();
  36056. a.toBase64 = function(e, t) {
  36057. if (void 0 === e && (e = this.offset),
  36058. void 0 === t && (t = this.limit),
  36059. t |= 0,
  36060. (e |= 0) < 0 || t > this.capacity || t < e)
  36061. throw RangeError("begin, end");
  36062. var i;
  36063. return h.encode(function() {
  36064. return e < t ? this.view[e++] : null
  36065. }
  36066. .bind(this), i = c()),
  36067. i()
  36068. }
  36069. ,
  36070. f.fromBase64 = function(e, t) {
  36071. if ("string" != typeof e)
  36072. throw TypeError("str");
  36073. var i = new f(e.length / 4 * 3,t)
  36074. , n = 0;
  36075. return h.decode(s(e), function(e) {
  36076. i.view[n++] = e
  36077. }),
  36078. i.limit = n,
  36079. i
  36080. }
  36081. ,
  36082. f.btoa = function(e) {
  36083. return f.fromBinary(e).toBase64()
  36084. }
  36085. ,
  36086. f.atob = function(e) {
  36087. return f.fromBase64(e).toBinary()
  36088. }
  36089. ,
  36090. a.toBinary = function(e, t) {
  36091. if (void 0 === e && (e = this.offset),
  36092. void 0 === t && (t = this.limit),
  36093. t |= 0,
  36094. (e |= 0) < 0 || t > this.capacity() || t < e)
  36095. throw RangeError("begin, end");
  36096. if (e === t)
  36097. return "";
  36098. for (var i = [], n = []; e < t; )
  36099. i.push(this.view[e++]),
  36100. 1024 <= i.length && (n.push(String.fromCharCode.apply(String, i)),
  36101. i = []);
  36102. return n.join("") + String.fromCharCode.apply(String, i)
  36103. }
  36104. ,
  36105. f.fromBinary = function(e, t) {
  36106. if ("string" != typeof e)
  36107. throw TypeError("str");
  36108. for (var i, n = 0, r = e.length, o = new f(r,t); n < r; ) {
  36109. if (255 < (i = e.charCodeAt(n)))
  36110. throw RangeError("illegal char code: " + i);
  36111. o.view[n++] = i
  36112. }
  36113. return o.limit = r,
  36114. o
  36115. }
  36116. ,
  36117. a.toDebug = function(e) {
  36118. for (var t, i = -1, n = this.buffer.byteLength, r = "", o = "", a = ""; i < n; ) {
  36119. if (-1 !== i && (r += (t = this.view[i]) < 16 ? "0" + t.toString(16).toUpperCase() : t.toString(16).toUpperCase(),
  36120. e && (o += 32 < t && t < 127 ? String.fromCharCode(t) : ".")),
  36121. ++i,
  36122. e && 0 < i && i % 16 == 0 && i !== n) {
  36123. for (; r.length < 51; )
  36124. r += " ";
  36125. a += r + o + "\n",
  36126. r = o = ""
  36127. }
  36128. 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 ? " " : ""
  36129. }
  36130. if (e && " " !== r) {
  36131. for (; r.length < 51; )
  36132. r += " ";
  36133. a += r + o + "\n"
  36134. }
  36135. return e ? a : r
  36136. }
  36137. ,
  36138. f.fromDebug = function(e, t, i) {
  36139. for (var n, r, o = e.length, a = new f((o + 1) / 3 | 0,t,i), s = 0, l = 0, c = !1, h = !1, u = !1, d = !1, p = !1; s < o; ) {
  36140. switch (n = e.charAt(s++)) {
  36141. case "!":
  36142. if (!i) {
  36143. if (h || u || d) {
  36144. p = !0;
  36145. break
  36146. }
  36147. h = u = d = !0
  36148. }
  36149. a.offset = a.markedOffset = a.limit = l,
  36150. c = !1;
  36151. break;
  36152. case "|":
  36153. if (!i) {
  36154. if (h || d) {
  36155. p = !0;
  36156. break
  36157. }
  36158. h = d = !0
  36159. }
  36160. a.offset = a.limit = l,
  36161. c = !1;
  36162. break;
  36163. case "[":
  36164. if (!i) {
  36165. if (h || u) {
  36166. p = !0;
  36167. break
  36168. }
  36169. h = u = !0
  36170. }
  36171. a.offset = a.markedOffset = l,
  36172. c = !1;
  36173. break;
  36174. case "<":
  36175. if (!i) {
  36176. if (h) {
  36177. p = !0;
  36178. break
  36179. }
  36180. h = !0
  36181. }
  36182. a.offset = l,
  36183. c = !1;
  36184. break;
  36185. case "]":
  36186. if (!i) {
  36187. if (d || u) {
  36188. p = !0;
  36189. break
  36190. }
  36191. d = u = !0
  36192. }
  36193. a.limit = a.markedOffset = l,
  36194. c = !1;
  36195. break;
  36196. case ">":
  36197. if (!i) {
  36198. if (d) {
  36199. p = !0;
  36200. break
  36201. }
  36202. d = !0
  36203. }
  36204. a.limit = l,
  36205. c = !1;
  36206. break;
  36207. case "'":
  36208. if (!i) {
  36209. if (u) {
  36210. p = !0;
  36211. break
  36212. }
  36213. u = !0
  36214. }
  36215. a.markedOffset = l,
  36216. c = !1;
  36217. break;
  36218. case " ":
  36219. c = !1;
  36220. break;
  36221. default:
  36222. if (!i && c) {
  36223. p = !0;
  36224. break
  36225. }
  36226. if (r = parseInt(n + e.charAt(s++), 16),
  36227. !i && (isNaN(r) || r < 0 || 255 < r))
  36228. throw TypeError("Illegal str: Not a debug encoded string");
  36229. a.view[l++] = r,
  36230. c = !0
  36231. }
  36232. if (p)
  36233. throw TypeError("Illegal str: Invalid symbol at " + s)
  36234. }
  36235. if (!i) {
  36236. if (!h || !d)
  36237. throw TypeError("Illegal str: Missing offset or limit");
  36238. if (l < a.buffer.byteLength)
  36239. throw TypeError("Illegal str: Not a debug encoded string (is it hex?) " + l + " < " + o)
  36240. }
  36241. return a
  36242. }
  36243. ,
  36244. a.toHex = function(e, t) {
  36245. if (e = void 0 === e ? this.offset : e,
  36246. t = void 0 === t ? this.limit : t,
  36247. !this.noAssert) {
  36248. if ("number" != typeof e || e % 1 != 0)
  36249. throw TypeError("Illegal begin: Not an integer");
  36250. if (e >>>= 0,
  36251. "number" != typeof t || t % 1 != 0)
  36252. throw TypeError("Illegal end: Not an integer");
  36253. if (t >>>= 0,
  36254. e < 0 || t < e || t > this.buffer.byteLength)
  36255. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  36256. }
  36257. for (var i, n = new Array(t - e); e < t; )
  36258. (i = this.view[e++]) < 16 ? n.push("0", i.toString(16)) : n.push(i.toString(16));
  36259. return n.join("")
  36260. }
  36261. ,
  36262. f.fromHex = function(e, t, i) {
  36263. if (!i) {
  36264. if ("string" != typeof e)
  36265. throw TypeError("Illegal str: Not a string");
  36266. if (e.length % 2 != 0)
  36267. throw TypeError("Illegal str: Length not a multiple of 2")
  36268. }
  36269. for (var n, r = e.length, o = new f(r / 2 | 0,t), a = 0, s = 0; a < r; a += 2) {
  36270. if (n = parseInt(e.substring(a, a + 2), 16),
  36271. !i && (!isFinite(n) || n < 0 || 255 < n))
  36272. throw TypeError("Illegal str: Contains non-hex characters");
  36273. o.view[s++] = n
  36274. }
  36275. return o.limit = s,
  36276. o
  36277. }
  36278. ;
  36279. var u, d = u = {
  36280. MAX_CODEPOINT: 1114111,
  36281. encodeUTF8: function(e, t) {
  36282. var i = null;
  36283. for ("number" == typeof e && (i = e,
  36284. e = function() {
  36285. return null
  36286. }
  36287. ); null !== i || null !== (i = e()); )
  36288. i < 128 ? t(127 & i) : (i < 2048 ? t(i >> 6 & 31 | 192) : (i < 65536 ? t(i >> 12 & 15 | 224) : (t(i >> 18 & 7 | 240),
  36289. t(i >> 12 & 63 | 128)),
  36290. t(i >> 6 & 63 | 128)),
  36291. t(63 & i | 128)),
  36292. i = null
  36293. },
  36294. decodeUTF8: function(e, t) {
  36295. for (var i, n, r, o, a = function(e) {
  36296. e = e.slice(0, e.indexOf(null));
  36297. var t = Error(e.toString());
  36298. throw t.name = "TruncatedError",
  36299. t.bytes = e,
  36300. t
  36301. }; null !== (i = e()); )
  36302. if (0 == (128 & i))
  36303. t(i);
  36304. else if (192 == (224 & i))
  36305. null === (n = e()) && a([i, n]),
  36306. t((31 & i) << 6 | 63 & n);
  36307. else if (224 == (240 & i))
  36308. null !== (n = e()) && null !== (r = e()) || a([i, n, r]),
  36309. t((15 & i) << 12 | (63 & n) << 6 | 63 & r);
  36310. else {
  36311. if (240 != (248 & i))
  36312. throw RangeError("Illegal starting byte: " + i);
  36313. null !== (n = e()) && null !== (r = e()) && null !== (o = e()) || a([i, n, r, o]),
  36314. t((7 & i) << 18 | (63 & n) << 12 | (63 & r) << 6 | 63 & o)
  36315. }
  36316. },
  36317. UTF16toUTF8: function(e, t) {
  36318. for (var i, n = null; null !== (i = null !== n ? n : e()); )
  36319. 55296 <= i && i <= 57343 && null !== (n = e()) && 56320 <= n && n <= 57343 ? (t(1024 * (i - 55296) + n - 56320 + 65536),
  36320. n = null) : t(i);
  36321. null !== n && t(n)
  36322. },
  36323. UTF8toUTF16: function(e, t) {
  36324. var i = null;
  36325. for ("number" == typeof e && (i = e,
  36326. e = function() {
  36327. return null
  36328. }
  36329. ); null !== i || null !== (i = e()); )
  36330. i <= 65535 ? t(i) : (t(55296 + ((i -= 65536) >> 10)),
  36331. t(i % 1024 + 56320)),
  36332. i = null
  36333. },
  36334. encodeUTF16toUTF8: function(e, t) {
  36335. u.UTF16toUTF8(e, function(e) {
  36336. u.encodeUTF8(e, t)
  36337. })
  36338. },
  36339. decodeUTF8toUTF16: function(e, t) {
  36340. u.decodeUTF8(e, function(e) {
  36341. u.UTF8toUTF16(e, t)
  36342. })
  36343. },
  36344. calculateCodePoint: function(e) {
  36345. return e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  36346. },
  36347. calculateUTF8: function(e) {
  36348. for (var t, i = 0; null !== (t = e()); )
  36349. i += t < 128 ? 1 : t < 2048 ? 2 : t < 65536 ? 3 : 4;
  36350. return i
  36351. },
  36352. calculateUTF16asUTF8: function(e) {
  36353. var t = 0
  36354. , i = 0;
  36355. return u.UTF16toUTF8(e, function(e) {
  36356. ++t,
  36357. i += e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  36358. }),
  36359. [t, i]
  36360. }
  36361. };
  36362. return a.toUTF8 = function(t, i) {
  36363. if (void 0 === t && (t = this.offset),
  36364. void 0 === i && (i = this.limit),
  36365. !this.noAssert) {
  36366. if ("number" != typeof t || t % 1 != 0)
  36367. throw TypeError("Illegal begin: Not an integer");
  36368. if (t >>>= 0,
  36369. "number" != typeof i || i % 1 != 0)
  36370. throw TypeError("Illegal end: Not an integer");
  36371. if (i >>>= 0,
  36372. t < 0 || i < t || i > this.buffer.byteLength)
  36373. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  36374. }
  36375. var e;
  36376. try {
  36377. d.decodeUTF8toUTF16(function() {
  36378. return t < i ? this.view[t++] : null
  36379. }
  36380. .bind(this), e = c())
  36381. } catch (e) {
  36382. if (t !== i)
  36383. throw RangeError("Illegal range: Truncated data, " + t + " != " + i)
  36384. }
  36385. return e()
  36386. }
  36387. ,
  36388. f.fromUTF8 = function(e, t, i) {
  36389. if (!i && "string" != typeof e)
  36390. throw TypeError("Illegal str: Not a string");
  36391. var n = new f(d.calculateUTF16asUTF8(s(e), !0)[1],t,i)
  36392. , r = 0;
  36393. return d.encodeUTF16toUTF8(s(e), function(e) {
  36394. n.view[r++] = e
  36395. }),
  36396. n.limit = r,
  36397. n
  36398. }
  36399. ,
  36400. f
  36401. }
  36402. ,
  36403. "function" == typeof define && define.amd ? define(["long"], r) : "function" == typeof t && "object" == typeof e && e && e.exports ? e.exports = function() {
  36404. var e;
  36405. try {
  36406. e = t("long")
  36407. } catch (e) {}
  36408. return r(e)
  36409. }() : (n.dcodeIO = n.dcodeIO || {}).ByteBuffer = r(n.dcodeIO.Long)
  36410. }
  36411. , {
  36412. long: 216
  36413. }],
  36414. 216: [function(e, t, i) {
  36415. var n, r;
  36416. n = this,
  36417. r = function() {
  36418. "use strict";
  36419. function n(e, t, i) {
  36420. this.low = 0 | e,
  36421. this.high = 0 | t,
  36422. this.unsigned = !!i
  36423. }
  36424. function p(e) {
  36425. return !0 === (e && e.__isLong__)
  36426. }
  36427. function e(e, t) {
  36428. var i, n, r;
  36429. return t ? (r = 0 <= (e >>>= 0) && e < 256) && (n = a[e]) ? n : (i = g(e, (0 | e) < 0 ? -1 : 0, !0),
  36430. r && (a[e] = i),
  36431. i) : (r = -128 <= (e |= 0) && e < 128) && (n = o[e]) ? n : (i = g(e, e < 0 ? -1 : 0, !1),
  36432. r && (o[e] = i),
  36433. i)
  36434. }
  36435. function f(e, t) {
  36436. if (isNaN(e) || !isFinite(e))
  36437. return t ? l : y;
  36438. if (t) {
  36439. if (e < 0)
  36440. return l;
  36441. if (r <= e)
  36442. return I
  36443. } else {
  36444. if (e <= -s)
  36445. return E;
  36446. if (s <= e + 1)
  36447. return C
  36448. }
  36449. return e < 0 ? f(-e, t).neg() : g(e % i | 0, e / i | 0, t)
  36450. }
  36451. function g(e, t, i) {
  36452. return new n(e,t,i)
  36453. }
  36454. function h(e, t, i) {
  36455. if (0 === e.length)
  36456. throw Error("empty string");
  36457. if ("NaN" === e || "Infinity" === e || "+Infinity" === e || "-Infinity" === e)
  36458. return y;
  36459. if (t = "number" == typeof t ? (i = t,
  36460. !1) : !!t,
  36461. (i = i || 10) < 2 || 36 < i)
  36462. throw RangeError("radix");
  36463. var n;
  36464. if (0 < (n = e.indexOf("-")))
  36465. throw Error("interior hyphen");
  36466. if (0 === n)
  36467. return h(e.substring(1), t, i).neg();
  36468. for (var r = f(u(i, 8)), o = y, a = 0; a < e.length; a += 8) {
  36469. var s = Math.min(8, e.length - a)
  36470. , l = parseInt(e.substring(a, a + s), i);
  36471. if (s < 8) {
  36472. var c = f(u(i, s));
  36473. o = o.mul(c).add(f(l))
  36474. } else
  36475. o = (o = o.mul(r)).add(f(l))
  36476. }
  36477. return o.unsigned = t,
  36478. o
  36479. }
  36480. function m(e) {
  36481. return e instanceof n ? e : "number" == typeof e ? f(e) : "string" == typeof e ? h(e) : g(e.low, e.high, e.unsigned)
  36482. }
  36483. Object.defineProperty(n.prototype, "__isLong__", {
  36484. value: !0,
  36485. enumerable: !1,
  36486. configurable: !1
  36487. }),
  36488. n.isLong = p;
  36489. var o = {}
  36490. , a = {};
  36491. n.fromInt = e,
  36492. n.fromNumber = f,
  36493. n.fromBits = g;
  36494. var u = Math.pow;
  36495. n.fromString = h,
  36496. n.fromValue = m;
  36497. var i = 4294967296
  36498. , r = 0x10000000000000000
  36499. , s = r / 2
  36500. , v = e(1 << 24)
  36501. , y = e(0);
  36502. n.ZERO = y;
  36503. var l = e(0, !0);
  36504. n.UZERO = l;
  36505. var c = e(1);
  36506. n.ONE = c;
  36507. var d = e(1, !0);
  36508. n.UONE = d;
  36509. var A = e(-1);
  36510. n.NEG_ONE = A;
  36511. var C = g(-1, 2147483647, !1);
  36512. n.MAX_VALUE = C;
  36513. var I = g(-1, -1, !0);
  36514. n.MAX_UNSIGNED_VALUE = I;
  36515. var E = g(0, -2147483648, !1);
  36516. n.MIN_VALUE = E;
  36517. var t = n.prototype;
  36518. return t.toInt = function() {
  36519. return this.unsigned ? this.low >>> 0 : this.low
  36520. }
  36521. ,
  36522. t.toNumber = function() {
  36523. return this.unsigned ? (this.high >>> 0) * i + (this.low >>> 0) : this.high * i + (this.low >>> 0)
  36524. }
  36525. ,
  36526. t.toString = function(e) {
  36527. if ((e = e || 10) < 2 || 36 < e)
  36528. throw RangeError("radix");
  36529. if (this.isZero())
  36530. return "0";
  36531. if (this.isNegative()) {
  36532. if (this.eq(E)) {
  36533. var t = f(e)
  36534. , i = this.div(t)
  36535. , n = i.mul(t).sub(this);
  36536. return i.toString(e) + n.toInt().toString(e)
  36537. }
  36538. return "-" + this.neg().toString(e)
  36539. }
  36540. for (var r = f(u(e, 6), this.unsigned), o = this, a = ""; ; ) {
  36541. var s = o.div(r)
  36542. , l = (o.sub(s.mul(r)).toInt() >>> 0).toString(e);
  36543. if ((o = s).isZero())
  36544. return l + a;
  36545. for (; l.length < 6; )
  36546. l = "0" + l;
  36547. a = "" + l + a
  36548. }
  36549. }
  36550. ,
  36551. t.getHighBits = function() {
  36552. return this.high
  36553. }
  36554. ,
  36555. t.getHighBitsUnsigned = function() {
  36556. return this.high >>> 0
  36557. }
  36558. ,
  36559. t.getLowBits = function() {
  36560. return this.low
  36561. }
  36562. ,
  36563. t.getLowBitsUnsigned = function() {
  36564. return this.low >>> 0
  36565. }
  36566. ,
  36567. t.getNumBitsAbs = function() {
  36568. if (this.isNegative())
  36569. return this.eq(E) ? 64 : this.neg().getNumBitsAbs();
  36570. for (var e = 0 != this.high ? this.high : this.low, t = 31; 0 < t && 0 == (e & 1 << t); t--)
  36571. ;
  36572. return 0 != this.high ? t + 33 : t + 1
  36573. }
  36574. ,
  36575. t.isZero = function() {
  36576. return 0 === this.high && 0 === this.low
  36577. }
  36578. ,
  36579. t.isNegative = function() {
  36580. return !this.unsigned && this.high < 0
  36581. }
  36582. ,
  36583. t.isPositive = function() {
  36584. return this.unsigned || 0 <= this.high
  36585. }
  36586. ,
  36587. t.isOdd = function() {
  36588. return 1 == (1 & this.low)
  36589. }
  36590. ,
  36591. t.isEven = function() {
  36592. return 0 == (1 & this.low)
  36593. }
  36594. ,
  36595. t.equals = function(e) {
  36596. return p(e) || (e = m(e)),
  36597. (this.unsigned === e.unsigned || this.high >>> 31 != 1 || e.high >>> 31 != 1) && this.high === e.high && this.low === e.low
  36598. }
  36599. ,
  36600. t.eq = t.equals,
  36601. t.notEquals = function(e) {
  36602. return !this.eq(e)
  36603. }
  36604. ,
  36605. t.neq = t.notEquals,
  36606. t.lessThan = function(e) {
  36607. return this.comp(e) < 0
  36608. }
  36609. ,
  36610. t.lt = t.lessThan,
  36611. t.lessThanOrEqual = function(e) {
  36612. return this.comp(e) <= 0
  36613. }
  36614. ,
  36615. t.lte = t.lessThanOrEqual,
  36616. t.greaterThan = function(e) {
  36617. return 0 < this.comp(e)
  36618. }
  36619. ,
  36620. t.gt = t.greaterThan,
  36621. t.greaterThanOrEqual = function(e) {
  36622. return 0 <= this.comp(e)
  36623. }
  36624. ,
  36625. t.gte = t.greaterThanOrEqual,
  36626. t.compare = function(e) {
  36627. if (p(e) || (e = m(e)),
  36628. this.eq(e))
  36629. return 0;
  36630. var t = this.isNegative()
  36631. , i = e.isNegative();
  36632. return t && !i ? -1 : !t && i ? 1 : this.unsigned ? e.high >>> 0 > this.high >>> 0 || e.high === this.high && e.low >>> 0 > this.low >>> 0 ? -1 : 1 : this.sub(e).isNegative() ? -1 : 1
  36633. }
  36634. ,
  36635. t.comp = t.compare,
  36636. t.negate = function() {
  36637. return !this.unsigned && this.eq(E) ? E : this.not().add(c)
  36638. }
  36639. ,
  36640. t.neg = t.negate,
  36641. t.add = function(e) {
  36642. p(e) || (e = m(e));
  36643. var t = this.high >>> 16
  36644. , i = 65535 & this.high
  36645. , n = this.low >>> 16
  36646. , r = 65535 & this.low
  36647. , o = e.high >>> 16
  36648. , a = 65535 & e.high
  36649. , s = e.low >>> 16
  36650. , l = 0
  36651. , c = 0
  36652. , h = 0
  36653. , u = 0;
  36654. return h += (u += r + (65535 & e.low)) >>> 16,
  36655. c += (h += n + s) >>> 16,
  36656. l += (c += i + a) >>> 16,
  36657. l += t + o,
  36658. g((h &= 65535) << 16 | (u &= 65535), (l &= 65535) << 16 | (c &= 65535), this.unsigned)
  36659. }
  36660. ,
  36661. t.subtract = function(e) {
  36662. return p(e) || (e = m(e)),
  36663. this.add(e.neg())
  36664. }
  36665. ,
  36666. t.sub = t.subtract,
  36667. t.multiply = function(e) {
  36668. if (this.isZero())
  36669. return y;
  36670. if (p(e) || (e = m(e)),
  36671. e.isZero())
  36672. return y;
  36673. if (this.eq(E))
  36674. return e.isOdd() ? E : y;
  36675. if (e.eq(E))
  36676. return this.isOdd() ? E : y;
  36677. if (this.isNegative())
  36678. return e.isNegative() ? this.neg().mul(e.neg()) : this.neg().mul(e).neg();
  36679. if (e.isNegative())
  36680. return this.mul(e.neg()).neg();
  36681. if (this.lt(v) && e.lt(v))
  36682. return f(this.toNumber() * e.toNumber(), this.unsigned);
  36683. var t = this.high >>> 16
  36684. , i = 65535 & this.high
  36685. , n = this.low >>> 16
  36686. , r = 65535 & this.low
  36687. , o = e.high >>> 16
  36688. , a = 65535 & e.high
  36689. , s = e.low >>> 16
  36690. , l = 65535 & e.low
  36691. , c = 0
  36692. , h = 0
  36693. , u = 0
  36694. , d = 0;
  36695. return u += (d += r * l) >>> 16,
  36696. h += (u += n * l) >>> 16,
  36697. u &= 65535,
  36698. h += (u += r * s) >>> 16,
  36699. c += (h += i * l) >>> 16,
  36700. h &= 65535,
  36701. c += (h += n * s) >>> 16,
  36702. h &= 65535,
  36703. c += (h += r * a) >>> 16,
  36704. c += t * l + i * s + n * a + r * o,
  36705. g((u &= 65535) << 16 | (d &= 65535), (c &= 65535) << 16 | (h &= 65535), this.unsigned)
  36706. }
  36707. ,
  36708. t.mul = t.multiply,
  36709. t.divide = function(e) {
  36710. if (p(e) || (e = m(e)),
  36711. e.isZero())
  36712. throw Error("division by zero");
  36713. if (this.isZero())
  36714. return this.unsigned ? l : y;
  36715. var t, i, n;
  36716. if (this.unsigned) {
  36717. if (e.unsigned || (e = e.toUnsigned()),
  36718. e.gt(this))
  36719. return l;
  36720. if (e.gt(this.shru(1)))
  36721. return d;
  36722. n = l
  36723. } else {
  36724. if (this.eq(E))
  36725. return e.eq(c) || e.eq(A) ? E : e.eq(E) ? c : (t = this.shr(1).div(e).shl(1)).eq(y) ? e.isNegative() ? c : A : (i = this.sub(e.mul(t)),
  36726. n = t.add(i.div(e)));
  36727. if (e.eq(E))
  36728. return this.unsigned ? l : y;
  36729. if (this.isNegative())
  36730. return e.isNegative() ? this.neg().div(e.neg()) : this.neg().div(e).neg();
  36731. if (e.isNegative())
  36732. return this.div(e.neg()).neg();
  36733. n = y
  36734. }
  36735. for (i = this; i.gte(e); ) {
  36736. t = Math.max(1, Math.floor(i.toNumber() / e.toNumber()));
  36737. for (var r = Math.ceil(Math.log(t) / Math.LN2), o = r <= 48 ? 1 : u(2, r - 48), a = f(t), s = a.mul(e); s.isNegative() || s.gt(i); )
  36738. s = (a = f(t -= o, this.unsigned)).mul(e);
  36739. a.isZero() && (a = c),
  36740. n = n.add(a),
  36741. i = i.sub(s)
  36742. }
  36743. return n
  36744. }
  36745. ,
  36746. t.div = t.divide,
  36747. t.modulo = function(e) {
  36748. return p(e) || (e = m(e)),
  36749. this.sub(this.div(e).mul(e))
  36750. }
  36751. ,
  36752. t.mod = t.modulo,
  36753. t.not = function() {
  36754. return g(~this.low, ~this.high, this.unsigned)
  36755. }
  36756. ,
  36757. t.and = function(e) {
  36758. return p(e) || (e = m(e)),
  36759. g(this.low & e.low, this.high & e.high, this.unsigned)
  36760. }
  36761. ,
  36762. t.or = function(e) {
  36763. return p(e) || (e = m(e)),
  36764. g(this.low | e.low, this.high | e.high, this.unsigned)
  36765. }
  36766. ,
  36767. t.xor = function(e) {
  36768. return p(e) || (e = m(e)),
  36769. g(this.low ^ e.low, this.high ^ e.high, this.unsigned)
  36770. }
  36771. ,
  36772. t.shiftLeft = function(e) {
  36773. return p(e) && (e = e.toInt()),
  36774. 0 == (e &= 63) ? this : e < 32 ? g(this.low << e, this.high << e | this.low >>> 32 - e, this.unsigned) : g(0, this.low << e - 32, this.unsigned)
  36775. }
  36776. ,
  36777. t.shl = t.shiftLeft,
  36778. t.shiftRight = function(e) {
  36779. return p(e) && (e = e.toInt()),
  36780. 0 == (e &= 63) ? this : e < 32 ? g(this.low >>> e | this.high << 32 - e, this.high >> e, this.unsigned) : g(this.high >> e - 32, 0 <= this.high ? 0 : -1, this.unsigned)
  36781. }
  36782. ,
  36783. t.shr = t.shiftRight,
  36784. t.shiftRightUnsigned = function(e) {
  36785. if (p(e) && (e = e.toInt()),
  36786. 0 === (e &= 63))
  36787. return this;
  36788. var t = this.high;
  36789. return e < 32 ? g(this.low >>> e | t << 32 - e, t >>> e, this.unsigned) : g(32 === e ? t : t >>> e - 32, 0, this.unsigned)
  36790. }
  36791. ,
  36792. t.shru = t.shiftRightUnsigned,
  36793. t.toSigned = function() {
  36794. return this.unsigned ? g(this.low, this.high, !1) : this
  36795. }
  36796. ,
  36797. t.toUnsigned = function() {
  36798. return this.unsigned ? this : g(this.low, this.high, !0)
  36799. }
  36800. ,
  36801. t.toBytes = function(e) {
  36802. return e ? this.toBytesLE() : this.toBytesBE()
  36803. }
  36804. ,
  36805. t.toBytesLE = function() {
  36806. var e = this.high
  36807. , t = this.low;
  36808. return [255 & t, t >>> 8 & 255, t >>> 16 & 255, t >>> 24 & 255, 255 & e, e >>> 8 & 255, e >>> 16 & 255, e >>> 24 & 255]
  36809. }
  36810. ,
  36811. t.toBytesBE = function() {
  36812. var e = this.high
  36813. , t = this.low;
  36814. return [e >>> 24 & 255, e >>> 16 & 255, e >>> 8 & 255, 255 & e, t >>> 24 & 255, t >>> 16 & 255, t >>> 8 & 255, 255 & t]
  36815. }
  36816. ,
  36817. n
  36818. }
  36819. ,
  36820. "function" == typeof define && define.amd ? define([], r) : "function" == typeof e && "object" == typeof t && t && t.exports ? t.exports = r() : (n.dcodeIO = n.dcodeIO || {}).Long = r()
  36821. }
  36822. , {}],
  36823. 217: [function(e, t, i) {
  36824. var n, r, o, a, s, l, c, h, u, d, p, f, g, m, v, y, A, C, I, E, _, b, w, T, x, S, M, R, P, O, L, D, N, F, B, V, k, U, H, z, G, W, j, Y, q, X, Z, K, Q, J, $, ee, te, ie, ne, re, oe, ae, se, le, ce, he, ue, de, pe, fe, ge, me, ve, ye, Ae, Ce, Ie, Ee, _e, be, we, Te, xe, Se, Me, Re, Pe, Oe, Le, De, Ne, Fe, Be, Ve, ke, Ue, He, ze, Ge, We, je, Ye, qe, Xe, Ze, Ke, Qe, Je, $e, et, tt, it, nt, rt, ot, at, st, lt, ct, ht, ut, dt, pt, ft, gt, mt, vt, yt, At, Ct, It, Et, _t, bt, wt, Tt, xt, St, Mt, Rt, Pt, Ot, Lt, Dt, Nt, Ft, Bt, Vt, kt, Ut, Ht, zt, Gt, Wt, jt, Yt, qt, Xt, Zt, Kt, Qt, Jt, $t, ei, ti, ii, ni, ri, oi, ai, si, li, ci, hi, ui, di, pi, fi, gi, mi, vi, yi, Ai, Ci = {
  36825. REVISION: "75"
  36826. };
  36827. function Ii(e, t) {
  36828. return e.distance - t.distance
  36829. }
  36830. function Ei(e, t, i, n) {
  36831. if (!1 !== e.visible && (e.raycast(t, i),
  36832. !0 === n))
  36833. for (var r = e.children, o = 0, a = r.length; o < a; o++)
  36834. Ei(r[o], t, i, !0)
  36835. }
  36836. function _i(e, t, i) {
  36837. return i < 0 && (i += 1),
  36838. 1 < i && (i -= 1),
  36839. i < 1 / 6 ? e + 6 * (t - e) * i : i < .5 ? t : i < 2 / 3 ? e + 6 * (t - e) * (2 / 3 - i) : e
  36840. }
  36841. function bi(e, t, i, n, r, o, a) {
  36842. return Ci.Triangle.barycoordFromPoint(e, t, i, n, Vt),
  36843. r.multiplyScalar(Vt.x),
  36844. o.multiplyScalar(Vt.y),
  36845. a.multiplyScalar(Vt.z),
  36846. r.add(o).add(a),
  36847. r.clone()
  36848. }
  36849. function wi(e, t, i, n, r, o, a) {
  36850. var s = e.material;
  36851. if (null === (s.side === Ci.BackSide ? i.intersectTriangle(o, r, n, !0, a) : i.intersectTriangle(n, r, o, s.side !== Ci.DoubleSide, a)))
  36852. return null;
  36853. Ut.copy(a),
  36854. Ut.applyMatrix4(e.matrixWorld);
  36855. var l = t.ray.origin.distanceTo(Ut);
  36856. return l < t.near || l > t.far ? null : {
  36857. distance: l,
  36858. point: Ut.clone(),
  36859. object: e
  36860. }
  36861. }
  36862. function Ti(e, t, i, n, r, o, a, s) {
  36863. Mt.fromArray(n, 3 * o),
  36864. Rt.fromArray(n, 3 * a),
  36865. Pt.fromArray(n, 3 * s);
  36866. var l = wi(e, t, i, Mt, Rt, Pt, kt);
  36867. return l && (r && (Nt.fromArray(r, 2 * o),
  36868. Ft.fromArray(r, 2 * a),
  36869. Bt.fromArray(r, 2 * s),
  36870. l.uv = bi(kt, Mt, Rt, Pt, Nt, Ft, Bt)),
  36871. l.face = new Ci.Face3(o,a,s,Ci.Triangle.normal(Mt, Rt, Pt)),
  36872. l.faceIndex = o),
  36873. l
  36874. }
  36875. function xi() {}
  36876. function Si(e, t, i, n, r, o) {
  36877. var a, s, l, c, h, u, d, p, f, g, m, v, y, A, C, I, E;
  36878. if (s = e[o[t]].x,
  36879. l = e[o[t]].y,
  36880. c = e[o[i]].x,
  36881. h = e[o[i]].y,
  36882. u = e[o[n]].x,
  36883. d = e[o[n]].y,
  36884. Number.EPSILON > (c - s) * (d - l) - (h - l) * (u - s))
  36885. return !1;
  36886. for (g = u - c,
  36887. m = d - h,
  36888. v = s - u,
  36889. y = l - d,
  36890. A = c - s,
  36891. C = h - l,
  36892. a = 0; a < r; a++)
  36893. if (p = e[o[a]].x,
  36894. f = e[o[a]].y,
  36895. !(p === s && f === l || p === c && f === h || p === u && f === d) && (I = A * (f - l) - C * (p - s),
  36896. E = v * (f - d) - y * (p - u),
  36897. g * (f - h) - m * (p - c) >= -Number.EPSILON && E >= -Number.EPSILON && I >= -Number.EPSILON))
  36898. return !1;
  36899. return !0
  36900. }
  36901. function Mi(e) {
  36902. switch (e) {
  36903. case Ci.LinearEncoding:
  36904. return ["Linear", "( value )"];
  36905. case Ci.sRGBEncoding:
  36906. return ["sRGB", "( value )"];
  36907. case Ci.RGBEEncoding:
  36908. return ["RGBE", "( value )"];
  36909. case Ci.RGBM7Encoding:
  36910. return ["RGBM", "( value, 7.0 )"];
  36911. case Ci.RGBM16Encoding:
  36912. return ["RGBM", "( value, 16.0 )"];
  36913. case Ci.RGBDEncoding:
  36914. return ["RGBD", "( value, 256.0 )"];
  36915. case Ci.GammaEncoding:
  36916. return ["Gamma", "( value, float( GAMMA_FACTOR ) )"];
  36917. default:
  36918. throw new Error("unsupported encoding: " + e)
  36919. }
  36920. }
  36921. function Ri(e, t) {
  36922. var i = Mi(t);
  36923. return "vec4 " + e + "( vec4 value ) { return " + i[0] + "ToLinear" + i[1] + "; }"
  36924. }
  36925. function Pi(e) {
  36926. return "" !== e
  36927. }
  36928. function Oi(e, t) {
  36929. 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)
  36930. }
  36931. function Li(e) {
  36932. return e.replace(/#include +<([\w\d.]+)>/g, function(e, t) {
  36933. var i = Ci.ShaderChunk[t];
  36934. if (void 0 === i)
  36935. throw new Error("Can not resolve #include <" + t + ">");
  36936. return Li(i)
  36937. })
  36938. }
  36939. function Di(e) {
  36940. return e.replace(/for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g, function(e, t, i, n) {
  36941. for (var r = "", o = parseInt(t); o < parseInt(i); o++)
  36942. r += n.replace(/\[ i \]/g, "[ " + o + " ]");
  36943. return r
  36944. })
  36945. }
  36946. function Ni(e, t, i, n) {
  36947. gi.set(t, i, n).unproject(mi);
  36948. var r = fi[e];
  36949. if (void 0 !== r)
  36950. for (var o = 0, a = r.length; o < a; o++)
  36951. pi.vertices[r[o]].copy(gi)
  36952. }
  36953. "function" == typeof define && define.amd ? define("three", Ci) : void 0 !== i && void 0 !== t && (t.exports = Ci),
  36954. void 0 === Number.EPSILON && (Number.EPSILON = Math.pow(2, -52)),
  36955. void 0 === Math.sign && (Math.sign = function(e) {
  36956. return e < 0 ? -1 : 0 < e ? 1 : +e
  36957. }
  36958. ),
  36959. void 0 === Function.prototype.name && void 0 !== Object.defineProperty && Object.defineProperty(Function.prototype, "name", {
  36960. get: function() {
  36961. return this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]
  36962. }
  36963. }),
  36964. void 0 === Object.assign && Object.defineProperty(Object, "assign", {
  36965. writable: !0,
  36966. configurable: !0,
  36967. value: function(e) {
  36968. "use strict";
  36969. if (null == e)
  36970. throw new TypeError("Cannot convert first argument to object");
  36971. for (var t = Object(e), i = 1, n = arguments.length; i !== n; ++i) {
  36972. var r = arguments[i];
  36973. if (null != r) {
  36974. r = Object(r);
  36975. for (var o = Object.keys(r), a = 0, s = o.length; a !== s; ++a) {
  36976. var l = o[a]
  36977. , c = Object.getOwnPropertyDescriptor(r, l);
  36978. void 0 !== c && c.enumerable && (t[l] = r[l])
  36979. }
  36980. }
  36981. }
  36982. return t
  36983. }
  36984. }),
  36985. Ci.MOUSE = {
  36986. LEFT: 0,
  36987. MIDDLE: 1,
  36988. RIGHT: 2
  36989. },
  36990. Ci.CullFaceNone = 0,
  36991. Ci.CullFaceBack = 1,
  36992. Ci.CullFaceFront = 2,
  36993. Ci.CullFaceFrontBack = 3,
  36994. Ci.FrontFaceDirectionCW = 0,
  36995. Ci.FrontFaceDirectionCCW = 1,
  36996. Ci.BasicShadowMap = 0,
  36997. Ci.PCFShadowMap = 1,
  36998. Ci.PCFSoftShadowMap = 2,
  36999. Ci.FrontSide = 0,
  37000. Ci.BackSide = 1,
  37001. Ci.DoubleSide = 2,
  37002. Ci.FlatShading = 1,
  37003. Ci.SmoothShading = 2,
  37004. Ci.NoColors = 0,
  37005. Ci.FaceColors = 1,
  37006. Ci.VertexColors = 2,
  37007. Ci.NoBlending = 0,
  37008. Ci.NormalBlending = 1,
  37009. Ci.AdditiveBlending = 2,
  37010. Ci.SubtractiveBlending = 3,
  37011. Ci.MultiplyBlending = 4,
  37012. Ci.CustomBlending = 5,
  37013. Ci.AddEquation = 100,
  37014. Ci.SubtractEquation = 101,
  37015. Ci.ReverseSubtractEquation = 102,
  37016. Ci.MinEquation = 103,
  37017. Ci.MaxEquation = 104,
  37018. Ci.ZeroFactor = 200,
  37019. Ci.OneFactor = 201,
  37020. Ci.SrcColorFactor = 202,
  37021. Ci.OneMinusSrcColorFactor = 203,
  37022. Ci.SrcAlphaFactor = 204,
  37023. Ci.OneMinusSrcAlphaFactor = 205,
  37024. Ci.DstAlphaFactor = 206,
  37025. Ci.OneMinusDstAlphaFactor = 207,
  37026. Ci.DstColorFactor = 208,
  37027. Ci.OneMinusDstColorFactor = 209,
  37028. Ci.SrcAlphaSaturateFactor = 210,
  37029. Ci.NeverDepth = 0,
  37030. Ci.AlwaysDepth = 1,
  37031. Ci.LessDepth = 2,
  37032. Ci.LessEqualDepth = 3,
  37033. Ci.EqualDepth = 4,
  37034. Ci.GreaterEqualDepth = 5,
  37035. Ci.GreaterDepth = 6,
  37036. Ci.NotEqualDepth = 7,
  37037. Ci.MultiplyOperation = 0,
  37038. Ci.MixOperation = 1,
  37039. Ci.AddOperation = 2,
  37040. Ci.NoToneMapping = 0,
  37041. Ci.LinearToneMapping = 1,
  37042. Ci.ReinhardToneMapping = 2,
  37043. Ci.Uncharted2ToneMapping = 3,
  37044. Ci.CineonToneMapping = 4,
  37045. Ci.UVMapping = 300,
  37046. Ci.CubeReflectionMapping = 301,
  37047. Ci.CubeRefractionMapping = 302,
  37048. Ci.EquirectangularReflectionMapping = 303,
  37049. Ci.EquirectangularRefractionMapping = 304,
  37050. Ci.SphericalReflectionMapping = 305,
  37051. Ci.CubeUVReflectionMapping = 306,
  37052. Ci.CubeUVRefractionMapping = 307,
  37053. Ci.RepeatWrapping = 1e3,
  37054. Ci.ClampToEdgeWrapping = 1001,
  37055. Ci.MirroredRepeatWrapping = 1002,
  37056. Ci.NearestFilter = 1003,
  37057. Ci.NearestMipMapNearestFilter = 1004,
  37058. Ci.NearestMipMapLinearFilter = 1005,
  37059. Ci.LinearFilter = 1006,
  37060. Ci.LinearMipMapNearestFilter = 1007,
  37061. Ci.LinearMipMapLinearFilter = 1008,
  37062. Ci.UnsignedByteType = 1009,
  37063. Ci.ByteType = 1010,
  37064. Ci.ShortType = 1011,
  37065. Ci.UnsignedShortType = 1012,
  37066. Ci.IntType = 1013,
  37067. Ci.UnsignedIntType = 1014,
  37068. Ci.FloatType = 1015,
  37069. Ci.HalfFloatType = 1025,
  37070. Ci.UnsignedShort4444Type = 1016,
  37071. Ci.UnsignedShort5551Type = 1017,
  37072. Ci.UnsignedShort565Type = 1018,
  37073. Ci.AlphaFormat = 1019,
  37074. Ci.RGBFormat = 1020,
  37075. Ci.RGBAFormat = 1021,
  37076. Ci.LuminanceFormat = 1022,
  37077. Ci.LuminanceAlphaFormat = 1023,
  37078. Ci.RGBEFormat = Ci.RGBAFormat,
  37079. Ci.RGB_S3TC_DXT1_Format = 2001,
  37080. Ci.RGBA_S3TC_DXT1_Format = 2002,
  37081. Ci.RGBA_S3TC_DXT3_Format = 2003,
  37082. Ci.RGBA_S3TC_DXT5_Format = 2004,
  37083. Ci.RGB_PVRTC_4BPPV1_Format = 2100,
  37084. Ci.RGB_PVRTC_2BPPV1_Format = 2101,
  37085. Ci.RGBA_PVRTC_4BPPV1_Format = 2102,
  37086. Ci.RGBA_PVRTC_2BPPV1_Format = 2103,
  37087. Ci.RGB_ETC1_Format = 2151,
  37088. Ci.LoopOnce = 2200,
  37089. Ci.LoopRepeat = 2201,
  37090. Ci.LoopPingPong = 2202,
  37091. Ci.InterpolateDiscrete = 2300,
  37092. Ci.InterpolateLinear = 2301,
  37093. Ci.InterpolateSmooth = 2302,
  37094. Ci.ZeroCurvatureEnding = 2400,
  37095. Ci.ZeroSlopeEnding = 2401,
  37096. Ci.WrapAroundEnding = 2402,
  37097. Ci.TrianglesDrawMode = 0,
  37098. Ci.TriangleStripDrawMode = 1,
  37099. Ci.TriangleFanDrawMode = 2,
  37100. Ci.LinearEncoding = 3e3,
  37101. Ci.sRGBEncoding = 3001,
  37102. Ci.GammaEncoding = 3007,
  37103. Ci.RGBEEncoding = 3002,
  37104. Ci.LogLuvEncoding = 3003,
  37105. Ci.RGBM7Encoding = 3004,
  37106. Ci.RGBM16Encoding = 3005,
  37107. Ci.RGBDEncoding = 3006,
  37108. Ci.Color = function(e) {
  37109. return 3 === arguments.length ? this.fromArray(arguments) : this.set(e)
  37110. }
  37111. ,
  37112. Ci.Color.prototype = {
  37113. constructor: Ci.Color,
  37114. r: 1,
  37115. g: 1,
  37116. b: 1,
  37117. set: function(e) {
  37118. return e instanceof Ci.Color ? this.copy(e) : "number" == typeof e ? this.setHex(e) : "string" == typeof e && this.setStyle(e),
  37119. this
  37120. },
  37121. setScalar: function(e) {
  37122. this.r = e,
  37123. this.g = e,
  37124. this.b = e
  37125. },
  37126. setHex: function(e) {
  37127. return e = Math.floor(e),
  37128. this.r = (e >> 16 & 255) / 255,
  37129. this.g = (e >> 8 & 255) / 255,
  37130. this.b = (255 & e) / 255,
  37131. this
  37132. },
  37133. setRGB: function(e, t, i) {
  37134. return this.r = e,
  37135. this.g = t,
  37136. this.b = i,
  37137. this
  37138. },
  37139. setHSL: function(e, t, i) {
  37140. if (e = Ci.Math.euclideanModulo(e, 1),
  37141. t = Ci.Math.clamp(t, 0, 1),
  37142. i = Ci.Math.clamp(i, 0, 1),
  37143. 0 === t)
  37144. this.r = this.g = this.b = i;
  37145. else {
  37146. var n = i <= .5 ? i * (1 + t) : i + t - i * t
  37147. , r = 2 * i - n;
  37148. this.r = _i(r, n, e + 1 / 3),
  37149. this.g = _i(r, n, e),
  37150. this.b = _i(r, n, e - 1 / 3)
  37151. }
  37152. return this
  37153. },
  37154. setStyle: function(t) {
  37155. function e(e) {
  37156. void 0 !== e && parseFloat(e) < 1 && console.warn("THREE.Color: Alpha component of " + t + " will be ignored.")
  37157. }
  37158. var i;
  37159. if (i = /^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(t)) {
  37160. var n, r = i[1], o = i[2];
  37161. switch (r) {
  37162. case "rgb":
  37163. case "rgba":
  37164. if (n = /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))
  37165. return this.r = Math.min(255, parseInt(n[1], 10)) / 255,
  37166. this.g = Math.min(255, parseInt(n[2], 10)) / 255,
  37167. this.b = Math.min(255, parseInt(n[3], 10)) / 255,
  37168. e(n[5]),
  37169. this;
  37170. if (n = /^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))
  37171. return this.r = Math.min(100, parseInt(n[1], 10)) / 100,
  37172. this.g = Math.min(100, parseInt(n[2], 10)) / 100,
  37173. this.b = Math.min(100, parseInt(n[3], 10)) / 100,
  37174. e(n[5]),
  37175. this;
  37176. break;
  37177. case "hsl":
  37178. case "hsla":
  37179. if (n = /^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o)) {
  37180. var a = parseFloat(n[1]) / 360
  37181. , s = parseInt(n[2], 10) / 100
  37182. , l = parseInt(n[3], 10) / 100;
  37183. return e(n[5]),
  37184. this.setHSL(a, s, l)
  37185. }
  37186. }
  37187. } else if (i = /^\#([A-Fa-f0-9]+)$/.exec(t)) {
  37188. var c, h = (c = i[1]).length;
  37189. if (3 === h)
  37190. return this.r = parseInt(c.charAt(0) + c.charAt(0), 16) / 255,
  37191. this.g = parseInt(c.charAt(1) + c.charAt(1), 16) / 255,
  37192. this.b = parseInt(c.charAt(2) + c.charAt(2), 16) / 255,
  37193. this;
  37194. if (6 === h)
  37195. return this.r = parseInt(c.charAt(0) + c.charAt(1), 16) / 255,
  37196. this.g = parseInt(c.charAt(2) + c.charAt(3), 16) / 255,
  37197. this.b = parseInt(c.charAt(4) + c.charAt(5), 16) / 255,
  37198. this
  37199. }
  37200. t && 0 < t.length && (void 0 !== (c = Ci.ColorKeywords[t]) ? this.setHex(c) : console.warn("THREE.Color: Unknown color " + t));
  37201. return this
  37202. },
  37203. clone: function() {
  37204. return new this.constructor(this.r,this.g,this.b)
  37205. },
  37206. copy: function(e) {
  37207. return this.r = e.r,
  37208. this.g = e.g,
  37209. this.b = e.b,
  37210. this
  37211. },
  37212. copyGammaToLinear: function(e, t) {
  37213. return void 0 === t && (t = 2),
  37214. this.r = Math.pow(e.r, t),
  37215. this.g = Math.pow(e.g, t),
  37216. this.b = Math.pow(e.b, t),
  37217. this
  37218. },
  37219. copyLinearToGamma: function(e, t) {
  37220. void 0 === t && (t = 2);
  37221. var i = 0 < t ? 1 / t : 1;
  37222. return this.r = Math.pow(e.r, i),
  37223. this.g = Math.pow(e.g, i),
  37224. this.b = Math.pow(e.b, i),
  37225. this
  37226. },
  37227. convertGammaToLinear: function() {
  37228. var e = this.r
  37229. , t = this.g
  37230. , i = this.b;
  37231. return this.r = e * e,
  37232. this.g = t * t,
  37233. this.b = i * i,
  37234. this
  37235. },
  37236. convertLinearToGamma: function() {
  37237. return this.r = Math.sqrt(this.r),
  37238. this.g = Math.sqrt(this.g),
  37239. this.b = Math.sqrt(this.b),
  37240. this
  37241. },
  37242. getHex: function() {
  37243. return 255 * this.r << 16 ^ 255 * this.g << 8 ^ 255 * this.b << 0
  37244. },
  37245. getHexString: function() {
  37246. return ("000000" + this.getHex().toString(16)).slice(-6)
  37247. },
  37248. getHSL: function(e) {
  37249. var t, i, n = e || {
  37250. h: 0,
  37251. s: 0,
  37252. l: 0
  37253. }, 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;
  37254. if (l === s)
  37255. i = t = 0;
  37256. else {
  37257. var h = s - l;
  37258. switch (i = c <= .5 ? h / (s + l) : h / (2 - s - l),
  37259. s) {
  37260. case r:
  37261. t = (o - a) / h + (o < a ? 6 : 0);
  37262. break;
  37263. case o:
  37264. t = (a - r) / h + 2;
  37265. break;
  37266. case a:
  37267. t = (r - o) / h + 4
  37268. }
  37269. t /= 6
  37270. }
  37271. return n.h = t,
  37272. n.s = i,
  37273. n.l = c,
  37274. n
  37275. },
  37276. getStyle: function() {
  37277. return "rgb(" + (255 * this.r | 0) + "," + (255 * this.g | 0) + "," + (255 * this.b | 0) + ")"
  37278. },
  37279. offsetHSL: function(e, t, i) {
  37280. var n = this.getHSL();
  37281. return n.h += e,
  37282. n.s += t,
  37283. n.l += i,
  37284. this.setHSL(n.h, n.s, n.l),
  37285. this
  37286. },
  37287. add: function(e) {
  37288. return this.r += e.r,
  37289. this.g += e.g,
  37290. this.b += e.b,
  37291. this
  37292. },
  37293. addColors: function(e, t) {
  37294. return this.r = e.r + t.r,
  37295. this.g = e.g + t.g,
  37296. this.b = e.b + t.b,
  37297. this
  37298. },
  37299. addScalar: function(e) {
  37300. return this.r += e,
  37301. this.g += e,
  37302. this.b += e,
  37303. this
  37304. },
  37305. multiply: function(e) {
  37306. return this.r *= e.r,
  37307. this.g *= e.g,
  37308. this.b *= e.b,
  37309. this
  37310. },
  37311. multiplyScalar: function(e) {
  37312. return this.r *= e,
  37313. this.g *= e,
  37314. this.b *= e,
  37315. this
  37316. },
  37317. lerp: function(e, t) {
  37318. return this.r += (e.r - this.r) * t,
  37319. this.g += (e.g - this.g) * t,
  37320. this.b += (e.b - this.b) * t,
  37321. this
  37322. },
  37323. equals: function(e) {
  37324. return e.r === this.r && e.g === this.g && e.b === this.b
  37325. },
  37326. fromArray: function(e, t) {
  37327. return void 0 === t && (t = 0),
  37328. this.r = e[t],
  37329. this.g = e[t + 1],
  37330. this.b = e[t + 2],
  37331. this
  37332. },
  37333. toArray: function(e, t) {
  37334. return void 0 === e && (e = []),
  37335. void 0 === t && (t = 0),
  37336. e[t] = this.r,
  37337. e[t + 1] = this.g,
  37338. e[t + 2] = this.b,
  37339. e
  37340. }
  37341. },
  37342. Ci.ColorKeywords = {
  37343. aliceblue: 15792383,
  37344. antiquewhite: 16444375,
  37345. aqua: 65535,
  37346. aquamarine: 8388564,
  37347. azure: 15794175,
  37348. beige: 16119260,
  37349. bisque: 16770244,
  37350. black: 0,
  37351. blanchedalmond: 16772045,
  37352. blue: 255,
  37353. blueviolet: 9055202,
  37354. brown: 10824234,
  37355. burlywood: 14596231,
  37356. cadetblue: 6266528,
  37357. chartreuse: 8388352,
  37358. chocolate: 13789470,
  37359. coral: 16744272,
  37360. cornflowerblue: 6591981,
  37361. cornsilk: 16775388,
  37362. crimson: 14423100,
  37363. cyan: 65535,
  37364. darkblue: 139,
  37365. darkcyan: 35723,
  37366. darkgoldenrod: 12092939,
  37367. darkgray: 11119017,
  37368. darkgreen: 25600,
  37369. darkgrey: 11119017,
  37370. darkkhaki: 12433259,
  37371. darkmagenta: 9109643,
  37372. darkolivegreen: 5597999,
  37373. darkorange: 16747520,
  37374. darkorchid: 10040012,
  37375. darkred: 9109504,
  37376. darksalmon: 15308410,
  37377. darkseagreen: 9419919,
  37378. darkslateblue: 4734347,
  37379. darkslategray: 3100495,
  37380. darkslategrey: 3100495,
  37381. darkturquoise: 52945,
  37382. darkviolet: 9699539,
  37383. deeppink: 16716947,
  37384. deepskyblue: 49151,
  37385. dimgray: 6908265,
  37386. dimgrey: 6908265,
  37387. dodgerblue: 2003199,
  37388. firebrick: 11674146,
  37389. floralwhite: 16775920,
  37390. forestgreen: 2263842,
  37391. fuchsia: 16711935,
  37392. gainsboro: 14474460,
  37393. ghostwhite: 16316671,
  37394. gold: 16766720,
  37395. goldenrod: 14329120,
  37396. gray: 8421504,
  37397. green: 32768,
  37398. greenyellow: 11403055,
  37399. grey: 8421504,
  37400. honeydew: 15794160,
  37401. hotpink: 16738740,
  37402. indianred: 13458524,
  37403. indigo: 4915330,
  37404. ivory: 16777200,
  37405. khaki: 15787660,
  37406. lavender: 15132410,
  37407. lavenderblush: 16773365,
  37408. lawngreen: 8190976,
  37409. lemonchiffon: 16775885,
  37410. lightblue: 11393254,
  37411. lightcoral: 15761536,
  37412. lightcyan: 14745599,
  37413. lightgoldenrodyellow: 16448210,
  37414. lightgray: 13882323,
  37415. lightgreen: 9498256,
  37416. lightgrey: 13882323,
  37417. lightpink: 16758465,
  37418. lightsalmon: 16752762,
  37419. lightseagreen: 2142890,
  37420. lightskyblue: 8900346,
  37421. lightslategray: 7833753,
  37422. lightslategrey: 7833753,
  37423. lightsteelblue: 11584734,
  37424. lightyellow: 16777184,
  37425. lime: 65280,
  37426. limegreen: 3329330,
  37427. linen: 16445670,
  37428. magenta: 16711935,
  37429. maroon: 8388608,
  37430. mediumaquamarine: 6737322,
  37431. mediumblue: 205,
  37432. mediumorchid: 12211667,
  37433. mediumpurple: 9662683,
  37434. mediumseagreen: 3978097,
  37435. mediumslateblue: 8087790,
  37436. mediumspringgreen: 64154,
  37437. mediumturquoise: 4772300,
  37438. mediumvioletred: 13047173,
  37439. midnightblue: 1644912,
  37440. mintcream: 16121850,
  37441. mistyrose: 16770273,
  37442. moccasin: 16770229,
  37443. navajowhite: 16768685,
  37444. navy: 128,
  37445. oldlace: 16643558,
  37446. olive: 8421376,
  37447. olivedrab: 7048739,
  37448. orange: 16753920,
  37449. orangered: 16729344,
  37450. orchid: 14315734,
  37451. palegoldenrod: 15657130,
  37452. palegreen: 10025880,
  37453. paleturquoise: 11529966,
  37454. palevioletred: 14381203,
  37455. papayawhip: 16773077,
  37456. peachpuff: 16767673,
  37457. peru: 13468991,
  37458. pink: 16761035,
  37459. plum: 14524637,
  37460. powderblue: 11591910,
  37461. purple: 8388736,
  37462. red: 16711680,
  37463. rosybrown: 12357519,
  37464. royalblue: 4286945,
  37465. saddlebrown: 9127187,
  37466. salmon: 16416882,
  37467. sandybrown: 16032864,
  37468. seagreen: 3050327,
  37469. seashell: 16774638,
  37470. sienna: 10506797,
  37471. silver: 12632256,
  37472. skyblue: 8900331,
  37473. slateblue: 6970061,
  37474. slategray: 7372944,
  37475. slategrey: 7372944,
  37476. snow: 16775930,
  37477. springgreen: 65407,
  37478. steelblue: 4620980,
  37479. tan: 13808780,
  37480. teal: 32896,
  37481. thistle: 14204888,
  37482. tomato: 16737095,
  37483. turquoise: 4251856,
  37484. violet: 15631086,
  37485. wheat: 16113331,
  37486. white: 16777215,
  37487. whitesmoke: 16119285,
  37488. yellow: 16776960,
  37489. yellowgreen: 10145074
  37490. },
  37491. Ci.Quaternion = function(e, t, i, n) {
  37492. this._x = e || 0,
  37493. this._y = t || 0,
  37494. this._z = i || 0,
  37495. this._w = void 0 !== n ? n : 1
  37496. }
  37497. ,
  37498. Ci.Quaternion.prototype = {
  37499. constructor: Ci.Quaternion,
  37500. get x() {
  37501. return this._x
  37502. },
  37503. set x(e) {
  37504. this._x = e,
  37505. this.onChangeCallback()
  37506. },
  37507. get y() {
  37508. return this._y
  37509. },
  37510. set y(e) {
  37511. this._y = e,
  37512. this.onChangeCallback()
  37513. },
  37514. get z() {
  37515. return this._z
  37516. },
  37517. set z(e) {
  37518. this._z = e,
  37519. this.onChangeCallback()
  37520. },
  37521. get w() {
  37522. return this._w
  37523. },
  37524. set w(e) {
  37525. this._w = e,
  37526. this.onChangeCallback()
  37527. },
  37528. set: function(e, t, i, n) {
  37529. return this._x = e,
  37530. this._y = t,
  37531. this._z = i,
  37532. this._w = n,
  37533. this.onChangeCallback(),
  37534. this
  37535. },
  37536. clone: function() {
  37537. return new this.constructor(this._x,this._y,this._z,this._w)
  37538. },
  37539. toObject:function(){//add
  37540. return {x:this.x, y:this.y,z:this.z, w:this.w};
  37541. },
  37542. copy: function(e) {
  37543. return this._x = e.x,
  37544. this._y = e.y,
  37545. this._z = e.z,
  37546. this._w = e.w,
  37547. this.onChangeCallback(),
  37548. this
  37549. },
  37550. setFromEuler: function(e, t) {
  37551. if (e instanceof Ci.Euler == 0)
  37552. throw new Error("THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  37553. var i = Math.cos(e._x / 2)
  37554. , n = Math.cos(e._y / 2)
  37555. , r = Math.cos(e._z / 2)
  37556. , o = Math.sin(e._x / 2)
  37557. , a = Math.sin(e._y / 2)
  37558. , s = Math.sin(e._z / 2)
  37559. , l = e.order;
  37560. return "XYZ" === l ? (this._x = o * n * r + i * a * s,
  37561. this._y = i * a * r - o * n * s,
  37562. this._z = i * n * s + o * a * r,
  37563. this._w = i * n * r - o * a * s) : "YXZ" === l ? (this._x = o * n * r + i * a * s,
  37564. this._y = i * a * r - o * n * s,
  37565. this._z = i * n * s - o * a * r,
  37566. this._w = i * n * r + o * a * s) : "ZXY" === l ? (this._x = o * n * r - i * a * s,
  37567. this._y = i * a * r + o * n * s,
  37568. this._z = i * n * s + o * a * r,
  37569. this._w = i * n * r - o * a * s) : "ZYX" === l ? (this._x = o * n * r - i * a * s,
  37570. this._y = i * a * r + o * n * s,
  37571. this._z = i * n * s - o * a * r,
  37572. this._w = i * n * r + o * a * s) : "YZX" === l ? (this._x = o * n * r + i * a * s,
  37573. this._y = i * a * r + o * n * s,
  37574. this._z = i * n * s - o * a * r,
  37575. this._w = i * n * r - o * a * s) : "XZY" === l && (this._x = o * n * r - i * a * s,
  37576. this._y = i * a * r - o * n * s,
  37577. this._z = i * n * s + o * a * r,
  37578. this._w = i * n * r + o * a * s),
  37579. !1 !== t && this.onChangeCallback(),
  37580. this
  37581. },
  37582. setFromAxisAngle: function(e, t) {
  37583. var i = t / 2
  37584. , n = Math.sin(i);
  37585. return this._x = e.x * n,
  37586. this._y = e.y * n,
  37587. this._z = e.z * n,
  37588. this._w = Math.cos(i),
  37589. this.onChangeCallback(),
  37590. this
  37591. },
  37592. setFromRotationMatrix: function(e) {
  37593. 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;
  37594. return 0 < d ? (t = .5 / Math.sqrt(d + 1),
  37595. this._w = .25 / t,
  37596. this._x = (h - l) * t,
  37597. this._y = (o - c) * t,
  37598. this._z = (a - r) * t) : s < n && u < n ? (t = 2 * Math.sqrt(1 + n - s - u),
  37599. this._w = (h - l) / t,
  37600. this._x = .25 * t,
  37601. this._y = (r + a) / t,
  37602. this._z = (o + c) / t) : u < s ? (t = 2 * Math.sqrt(1 + s - n - u),
  37603. this._w = (o - c) / t,
  37604. this._x = (r + a) / t,
  37605. this._y = .25 * t,
  37606. this._z = (l + h) / t) : (t = 2 * Math.sqrt(1 + u - n - s),
  37607. this._w = (a - r) / t,
  37608. this._x = (o + c) / t,
  37609. this._y = (l + h) / t,
  37610. this._z = .25 * t),
  37611. this.onChangeCallback(),
  37612. this
  37613. },
  37614. setFromUnitVectors: function(e, t) {
  37615. return void 0 === Be && (Be = new Ci.Vector3),
  37616. (Ve = e.dot(t) + 1) < 1e-6 ? (Ve = 0,
  37617. Math.abs(e.x) > Math.abs(e.z) ? Be.set(-e.y, e.x, 0) : Be.set(0, -e.z, e.y)) : Be.crossVectors(e, t),
  37618. this._x = Be.x,
  37619. this._y = Be.y,
  37620. this._z = Be.z,
  37621. this._w = Ve,
  37622. this.normalize(),
  37623. this
  37624. },
  37625. inverse: function() {
  37626. return this.conjugate().normalize(),
  37627. this
  37628. },
  37629. conjugate: function() {
  37630. return this._x *= -1,
  37631. this._y *= -1,
  37632. this._z *= -1,
  37633. this.onChangeCallback(),
  37634. this
  37635. },
  37636. dot: function(e) {
  37637. return this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w
  37638. },
  37639. lengthSq: function() {
  37640. return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w
  37641. },
  37642. length: function() {
  37643. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  37644. },
  37645. normalize: function() {
  37646. var e = this.length();
  37647. return 0 === e ? (this._x = 0,
  37648. this._y = 0,
  37649. this._z = 0,
  37650. this._w = 1) : (e = 1 / e,
  37651. this._x = this._x * e,
  37652. this._y = this._y * e,
  37653. this._z = this._z * e,
  37654. this._w = this._w * e),
  37655. this.onChangeCallback(),
  37656. this
  37657. },
  37658. multiply: function(e, t) {
  37659. return void 0 !== t ? (console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),
  37660. this.multiplyQuaternions(e, t)) : this.multiplyQuaternions(this, e)
  37661. },
  37662. multiplyQuaternions: function(e, t) {
  37663. var i = e._x
  37664. , n = e._y
  37665. , r = e._z
  37666. , o = e._w
  37667. , a = t._x
  37668. , s = t._y
  37669. , l = t._z
  37670. , c = t._w;
  37671. return this._x = i * c + o * a + n * l - r * s,
  37672. this._y = n * c + o * s + r * a - i * l,
  37673. this._z = r * c + o * l + i * s - n * a,
  37674. this._w = o * c - i * a - n * s - r * l,
  37675. this.onChangeCallback(),
  37676. this
  37677. },
  37678. slerp: function(e, t) {
  37679. if (0 === t)
  37680. return this;
  37681. if (1 === t)
  37682. return this.copy(e);
  37683. var i = this._x
  37684. , n = this._y
  37685. , r = this._z
  37686. , o = this._w
  37687. , a = o * e._w + i * e._x + n * e._y + r * e._z;
  37688. if (a < 0 ? (this._w = -e._w,
  37689. this._x = -e._x,
  37690. this._y = -e._y,
  37691. this._z = -e._z,
  37692. a = -a) : this.copy(e),
  37693. 1 <= a)
  37694. return this._w = o,
  37695. this._x = i,
  37696. this._y = n,
  37697. this._z = r,
  37698. this;
  37699. var s = Math.sqrt(1 - a * a);
  37700. if (Math.abs(s) < .001)
  37701. return this._w = .5 * (o + this._w),
  37702. this._x = .5 * (i + this._x),
  37703. this._y = .5 * (n + this._y),
  37704. this._z = .5 * (r + this._z),
  37705. this;
  37706. var l = Math.atan2(s, a)
  37707. , c = Math.sin((1 - t) * l) / s
  37708. , h = Math.sin(t * l) / s;
  37709. return this._w = o * c + this._w * h,
  37710. this._x = i * c + this._x * h,
  37711. this._y = n * c + this._y * h,
  37712. this._z = r * c + this._z * h,
  37713. this.onChangeCallback(),
  37714. this
  37715. },
  37716. equals: function(e) {
  37717. return e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w
  37718. },
  37719. fromArray: function(e, t) {
  37720. return void 0 === t && (t = 0),
  37721. this._x = e[t],
  37722. this._y = e[t + 1],
  37723. this._z = e[t + 2],
  37724. this._w = e[t + 3],
  37725. this.onChangeCallback(),
  37726. this
  37727. },
  37728. toArray: function(e, t) {
  37729. return void 0 === e && (e = []),
  37730. void 0 === t && (t = 0),
  37731. e[t] = this._x,
  37732. e[t + 1] = this._y,
  37733. e[t + 2] = this._z,
  37734. e[t + 3] = this._w,
  37735. e
  37736. },
  37737. onChange: function(e) {
  37738. return this.onChangeCallback = e,
  37739. this
  37740. },
  37741. onChangeCallback: function() {}
  37742. },
  37743. Object.assign(Ci.Quaternion, {
  37744. slerp: function(e, t, i, n) {
  37745. return i.copy(e).slerp(t, n)
  37746. },
  37747. slerpFlat: function(e, t, i, n, r, o, a) {
  37748. var s = i[n + 0]
  37749. , l = i[n + 1]
  37750. , c = i[n + 2]
  37751. , h = i[n + 3]
  37752. , u = r[o + 0]
  37753. , d = r[o + 1]
  37754. , p = r[o + 2]
  37755. , f = r[o + 3];
  37756. if (h !== f || s !== u || l !== d || c !== p) {
  37757. var g = 1 - a
  37758. , m = s * u + l * d + c * p + h * f
  37759. , v = 0 <= m ? 1 : -1
  37760. , y = 1 - m * m;
  37761. if (y > Number.EPSILON) {
  37762. var A = Math.sqrt(y)
  37763. , C = Math.atan2(A, m * v);
  37764. g = Math.sin(g * C) / A,
  37765. a = Math.sin(a * C) / A
  37766. }
  37767. var I = a * v;
  37768. if (s = s * g + u * I,
  37769. l = l * g + d * I,
  37770. c = c * g + p * I,
  37771. h = h * g + f * I,
  37772. g === 1 - a) {
  37773. var E = 1 / Math.sqrt(s * s + l * l + c * c + h * h);
  37774. s *= E,
  37775. l *= E,
  37776. c *= E,
  37777. h *= E
  37778. }
  37779. }
  37780. e[t] = s,
  37781. e[t + 1] = l,
  37782. e[t + 2] = c,
  37783. e[t + 3] = h
  37784. }
  37785. }),
  37786. Ci.Vector2 = function(e, t) {
  37787. this.x = e || 0,
  37788. this.y = t || 0
  37789. }
  37790. ,
  37791. Ci.Vector2.prototype = {
  37792. constructor: Ci.Vector2,
  37793. get width() {
  37794. return this.x
  37795. },
  37796. set width(e) {
  37797. this.x = e
  37798. },
  37799. get height() {
  37800. return this.y
  37801. },
  37802. set height(e) {
  37803. this.y = e
  37804. },
  37805. set: function(e, t) {
  37806. return this.x = e,
  37807. this.y = t,
  37808. this
  37809. },
  37810. setScalar: function(e) {
  37811. return this.x = e,
  37812. this.y = e,
  37813. this
  37814. },
  37815. setX: function(e) {
  37816. return this.x = e,
  37817. this
  37818. },
  37819. setY: function(e) {
  37820. return this.y = e,
  37821. this
  37822. },
  37823. setComponent: function(e, t) {
  37824. switch (e) {
  37825. case 0:
  37826. this.x = t;
  37827. break;
  37828. case 1:
  37829. this.y = t;
  37830. break;
  37831. default:
  37832. throw new Error("index is out of range: " + e)
  37833. }
  37834. },
  37835. getComponent: function(e) {
  37836. switch (e) {
  37837. case 0:
  37838. return this.x;
  37839. case 1:
  37840. return this.y;
  37841. default:
  37842. throw new Error("index is out of range: " + e)
  37843. }
  37844. },
  37845. clone: function() {
  37846. return new this.constructor(this.x,this.y)
  37847. },
  37848. copy: function(e) {
  37849. return this.x = e.x,
  37850. this.y = e.y,
  37851. this
  37852. },
  37853. add: function(e, t) {
  37854. return void 0 !== t ? (console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  37855. this.addVectors(e, t)) : (this.x += e.x,
  37856. this.y += e.y,
  37857. this)
  37858. },
  37859. addScalar: function(e) {
  37860. return this.x += e,
  37861. this.y += e,
  37862. this
  37863. },
  37864. addVectors: function(e, t) {
  37865. return this.x = e.x + t.x,
  37866. this.y = e.y + t.y,
  37867. this
  37868. },
  37869. addScaledVector: function(e, t) {
  37870. return this.x += e.x * t,
  37871. this.y += e.y * t,
  37872. this
  37873. },
  37874. sub: function(e, t) {
  37875. return void 0 !== t ? (console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  37876. this.subVectors(e, t)) : (this.x -= e.x,
  37877. this.y -= e.y,
  37878. this)
  37879. },
  37880. subScalar: function(e) {
  37881. return this.x -= e,
  37882. this.y -= e,
  37883. this
  37884. },
  37885. subVectors: function(e, t) {
  37886. return this.x = e.x - t.x,
  37887. this.y = e.y - t.y,
  37888. this
  37889. },
  37890. multiply: function(e) {
  37891. return this.x *= e.x,
  37892. this.y *= e.y,
  37893. this
  37894. },
  37895. multiplyScalar: function(e) {
  37896. return isFinite(e) ? (this.x *= e,
  37897. this.y *= e) : (this.x = 0,
  37898. this.y = 0),
  37899. this
  37900. },
  37901. divide: function(e) {
  37902. return this.x /= e.x,
  37903. this.y /= e.y,
  37904. this
  37905. },
  37906. divideScalar: function(e) {
  37907. return this.multiplyScalar(1 / e)
  37908. },
  37909. min: function(e) {
  37910. return this.x = Math.min(this.x, e.x),
  37911. this.y = Math.min(this.y, e.y),
  37912. this
  37913. },
  37914. max: function(e) {
  37915. return this.x = Math.max(this.x, e.x),
  37916. this.y = Math.max(this.y, e.y),
  37917. this
  37918. },
  37919. clamp: function(e, t) {
  37920. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  37921. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  37922. this
  37923. },
  37924. clampScalar: function(e, t) {
  37925. return void 0 === Ne && (Ne = new Ci.Vector2,
  37926. Fe = new Ci.Vector2),
  37927. Ne.set(e, e),
  37928. Fe.set(t, t),
  37929. this.clamp(Ne, Fe)
  37930. },
  37931. clampLength: function(e, t) {
  37932. var i = this.length();
  37933. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  37934. this
  37935. },
  37936. floor: function() {
  37937. return this.x = Math.floor(this.x),
  37938. this.y = Math.floor(this.y),
  37939. this
  37940. },
  37941. ceil: function() {
  37942. return this.x = Math.ceil(this.x),
  37943. this.y = Math.ceil(this.y),
  37944. this
  37945. },
  37946. round: function() {
  37947. return this.x = Math.round(this.x),
  37948. this.y = Math.round(this.y),
  37949. this
  37950. },
  37951. roundToZero: function() {
  37952. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  37953. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  37954. this
  37955. },
  37956. negate: function() {
  37957. return this.x = -this.x,
  37958. this.y = -this.y,
  37959. this
  37960. },
  37961. dot: function(e) {
  37962. return this.x * e.x + this.y * e.y
  37963. },
  37964. lengthSq: function() {
  37965. return this.x * this.x + this.y * this.y
  37966. },
  37967. length: function() {
  37968. return Math.sqrt(this.x * this.x + this.y * this.y)
  37969. },
  37970. lengthManhattan: function() {
  37971. return Math.abs(this.x) + Math.abs(this.y)
  37972. },
  37973. normalize: function() {
  37974. return this.divideScalar(this.length())
  37975. },
  37976. angle: function() {
  37977. var e = Math.atan2(this.y, this.x);
  37978. return e < 0 && (e += 2 * Math.PI),
  37979. e
  37980. },
  37981. distanceTo: function(e) {
  37982. return Math.sqrt(this.distanceToSquared(e))
  37983. },
  37984. distanceToSquared: function(e) {
  37985. var t = this.x - e.x
  37986. , i = this.y - e.y;
  37987. return t * t + i * i
  37988. },
  37989. setLength: function(e) {
  37990. return this.multiplyScalar(e / this.length())
  37991. },
  37992. lerp: function(e, t) {
  37993. return this.x += (e.x - this.x) * t,
  37994. this.y += (e.y - this.y) * t,
  37995. this
  37996. },
  37997. lerpVectors: function(e, t, i) {
  37998. return this.subVectors(t, e).multiplyScalar(i).add(e),
  37999. this
  38000. },
  38001. equals: function(e) {
  38002. return e.x === this.x && e.y === this.y
  38003. },
  38004. fromArray: function(e, t) {
  38005. return void 0 === t && (t = 0),
  38006. this.x = e[t],
  38007. this.y = e[t + 1],
  38008. this
  38009. },
  38010. toArray: function(e, t) {
  38011. return void 0 === e && (e = []),
  38012. void 0 === t && (t = 0),
  38013. e[t] = this.x,
  38014. e[t + 1] = this.y,
  38015. e
  38016. },
  38017. fromAttribute: function(e, t, i) {
  38018. return void 0 === i && (i = 0),
  38019. t = t * e.itemSize + i,
  38020. this.x = e.array[t],
  38021. this.y = e.array[t + 1],
  38022. this
  38023. },
  38024. rotateAround: function(e, t) {
  38025. var i = Math.cos(t)
  38026. , n = Math.sin(t)
  38027. , r = this.x - e.x
  38028. , o = this.y - e.y;
  38029. return this.x = r * i - o * n + e.x,
  38030. this.y = r * n + o * i + e.y,
  38031. this
  38032. }
  38033. },
  38034. Ci.Vector3 = function(e, t, i) {
  38035. this.x = e || 0,
  38036. this.y = t || 0,
  38037. this.z = i || 0
  38038. }
  38039. ,
  38040. Ci.Vector3.prototype = {
  38041. constructor: Ci.Vector3,
  38042. set: function(e, t, i) {
  38043. return this.x = e,
  38044. this.y = t,
  38045. this.z = i,
  38046. this
  38047. },
  38048. setScalar: function(e) {
  38049. return this.x = e,
  38050. this.y = e,
  38051. this.z = e,
  38052. this
  38053. },
  38054. setX: function(e) {
  38055. return this.x = e,
  38056. this
  38057. },
  38058. setY: function(e) {
  38059. return this.y = e,
  38060. this
  38061. },
  38062. setZ: function(e) {
  38063. return this.z = e,
  38064. this
  38065. },
  38066. setComponent: function(e, t) {
  38067. switch (e) {
  38068. case 0:
  38069. this.x = t;
  38070. break;
  38071. case 1:
  38072. this.y = t;
  38073. break;
  38074. case 2:
  38075. this.z = t;
  38076. break;
  38077. default:
  38078. throw new Error("index is out of range: " + e)
  38079. }
  38080. },
  38081. getComponent: function(e) {
  38082. switch (e) {
  38083. case 0:
  38084. return this.x;
  38085. case 1:
  38086. return this.y;
  38087. case 2:
  38088. return this.z;
  38089. default:
  38090. throw new Error("index is out of range: " + e)
  38091. }
  38092. },
  38093. clone: function() {
  38094. return new this.constructor(this.x,this.y,this.z)
  38095. },
  38096. copy: function(e) {
  38097. return this.x = e.x,
  38098. this.y = e.y,
  38099. this.z = e.z,
  38100. this
  38101. },
  38102. add: function(e, t) {
  38103. return void 0 !== t ? (console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  38104. this.addVectors(e, t)) : (this.x += e.x,
  38105. this.y += e.y,
  38106. this.z += e.z,
  38107. this)
  38108. },
  38109. addScalar: function(e) {
  38110. return this.x += e,
  38111. this.y += e,
  38112. this.z += e,
  38113. this
  38114. },
  38115. addVectors: function(e, t) {
  38116. return this.x = e.x + t.x,
  38117. this.y = e.y + t.y,
  38118. this.z = e.z + t.z,
  38119. this
  38120. },
  38121. addScaledVector: function(e, t) {
  38122. return this.x += e.x * t,
  38123. this.y += e.y * t,
  38124. this.z += e.z * t,
  38125. this
  38126. },
  38127. sub: function(e, t) {
  38128. return void 0 !== t ? (console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  38129. this.subVectors(e, t)) : (this.x -= e.x,
  38130. this.y -= e.y,
  38131. this.z -= e.z,
  38132. this)
  38133. },
  38134. subScalar: function(e) {
  38135. return this.x -= e,
  38136. this.y -= e,
  38137. this.z -= e,
  38138. this
  38139. },
  38140. subVectors: function(e, t) {
  38141. return this.x = e.x - t.x,
  38142. this.y = e.y - t.y,
  38143. this.z = e.z - t.z,
  38144. this
  38145. },
  38146. multiply: function(e, t) {
  38147. return void 0 !== t ? (console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),
  38148. this.multiplyVectors(e, t)) : (this.x *= e.x,
  38149. this.y *= e.y,
  38150. this.z *= e.z,
  38151. this)
  38152. },
  38153. multiplyScalar: function(e) {
  38154. return isFinite(e) ? (this.x *= e,
  38155. this.y *= e,
  38156. this.z *= e) : (this.x = 0,
  38157. this.y = 0,
  38158. this.z = 0),
  38159. this
  38160. },
  38161. multiplyVectors: function(e, t) {
  38162. return this.x = e.x * t.x,
  38163. this.y = e.y * t.y,
  38164. this.z = e.z * t.z,
  38165. this
  38166. },
  38167. applyEuler: function(e) {
  38168. return e instanceof Ci.Euler == 0 && console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),
  38169. void 0 === De && (De = new Ci.Quaternion),
  38170. this.applyQuaternion(De.setFromEuler(e)),
  38171. this
  38172. },
  38173. applyAxisAngle: function(e, t) {
  38174. return void 0 === Le && (Le = new Ci.Quaternion),
  38175. this.applyQuaternion(Le.setFromAxisAngle(e, t)),
  38176. this
  38177. },
  38178. applyMatrix3: function(e) {
  38179. var t = this.x
  38180. , i = this.y
  38181. , n = this.z
  38182. , r = e.elements;
  38183. return this.x = r[0] * t + r[3] * i + r[6] * n,
  38184. this.y = r[1] * t + r[4] * i + r[7] * n,
  38185. this.z = r[2] * t + r[5] * i + r[8] * n,
  38186. this
  38187. },
  38188. applyMatrix4: function(e) {
  38189. var t = this.x
  38190. , i = this.y
  38191. , n = this.z
  38192. , r = e.elements;
  38193. return this.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  38194. this.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  38195. this.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  38196. this
  38197. },
  38198. applyProjection: function(e) {
  38199. var t = this.x
  38200. , i = this.y
  38201. , n = this.z
  38202. , r = e.elements
  38203. , o = 1 / (r[3] * t + r[7] * i + r[11] * n + r[15]);
  38204. return this.x = (r[0] * t + r[4] * i + r[8] * n + r[12]) * o,
  38205. this.y = (r[1] * t + r[5] * i + r[9] * n + r[13]) * o,
  38206. this.z = (r[2] * t + r[6] * i + r[10] * n + r[14]) * o,
  38207. this
  38208. },
  38209. applyQuaternion: function(e) {
  38210. var t = this.x
  38211. , i = this.y
  38212. , n = this.z
  38213. , r = e.x
  38214. , o = e.y
  38215. , a = e.z
  38216. , s = e.w
  38217. , l = s * t + o * n - a * i
  38218. , c = s * i + a * t - r * n
  38219. , h = s * n + r * i - o * t
  38220. , u = -r * t - o * i - a * n;
  38221. return this.x = l * s + u * -r + c * -a - h * -o,
  38222. this.y = c * s + u * -o + h * -r - l * -a,
  38223. this.z = h * s + u * -a + l * -o - c * -r,
  38224. this
  38225. },
  38226. project: function(e) {
  38227. return void 0 === Oe && (Oe = new Ci.Matrix4),
  38228. Oe.multiplyMatrices(e.projectionMatrix, Oe.getInverse(e.matrixWorld)),
  38229. this.applyProjection(Oe)
  38230. },
  38231. unproject: function(e) {
  38232. return void 0 === Pe && (Pe = new Ci.Matrix4),
  38233. Pe.multiplyMatrices(e.matrixWorld, Pe.getInverse(e.projectionMatrix)),
  38234. this.applyProjection(Pe)
  38235. },
  38236. transformDirection: function(e) {
  38237. var t = this.x
  38238. , i = this.y
  38239. , n = this.z
  38240. , r = e.elements;
  38241. return this.x = r[0] * t + r[4] * i + r[8] * n,
  38242. this.y = r[1] * t + r[5] * i + r[9] * n,
  38243. this.z = r[2] * t + r[6] * i + r[10] * n,
  38244. this.normalize(),
  38245. this
  38246. },
  38247. divide: function(e) {
  38248. return this.x /= e.x,
  38249. this.y /= e.y,
  38250. this.z /= e.z,
  38251. this
  38252. },
  38253. divideScalar: function(e) {
  38254. return this.multiplyScalar(1 / e)
  38255. },
  38256. min: function(e) {
  38257. return this.x = Math.min(this.x, e.x),
  38258. this.y = Math.min(this.y, e.y),
  38259. this.z = Math.min(this.z, e.z),
  38260. this
  38261. },
  38262. max: function(e) {
  38263. return this.x = Math.max(this.x, e.x),
  38264. this.y = Math.max(this.y, e.y),
  38265. this.z = Math.max(this.z, e.z),
  38266. this
  38267. },
  38268. clamp: function(e, t) {
  38269. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  38270. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  38271. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  38272. this
  38273. },
  38274. clampScalar: function(e, t) {
  38275. return void 0 === Me && (Me = new Ci.Vector3,
  38276. Re = new Ci.Vector3),
  38277. Me.set(e, e, e),
  38278. Re.set(t, t, t),
  38279. this.clamp(Me, Re)
  38280. },
  38281. clampLength: function(e, t) {
  38282. var i = this.length();
  38283. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  38284. this
  38285. },
  38286. floor: function() {
  38287. return this.x = Math.floor(this.x),
  38288. this.y = Math.floor(this.y),
  38289. this.z = Math.floor(this.z),
  38290. this
  38291. },
  38292. ceil: function() {
  38293. return this.x = Math.ceil(this.x),
  38294. this.y = Math.ceil(this.y),
  38295. this.z = Math.ceil(this.z),
  38296. this
  38297. },
  38298. round: function() {
  38299. return this.x = Math.round(this.x),
  38300. this.y = Math.round(this.y),
  38301. this.z = Math.round(this.z),
  38302. this
  38303. },
  38304. roundToZero: function() {
  38305. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  38306. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  38307. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  38308. this
  38309. },
  38310. negate: function() {
  38311. return this.x = -this.x,
  38312. this.y = -this.y,
  38313. this.z = -this.z,
  38314. this
  38315. },
  38316. dot: function(e) {
  38317. return this.x * e.x + this.y * e.y + this.z * e.z
  38318. },
  38319. lengthSq: function() {
  38320. return this.x * this.x + this.y * this.y + this.z * this.z
  38321. },
  38322. length: function() {
  38323. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z)
  38324. },
  38325. lengthManhattan: function() {
  38326. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z)
  38327. },
  38328. normalize: function() {
  38329. return this.divideScalar(this.length())
  38330. },
  38331. setLength: function(e) {
  38332. return this.multiplyScalar(e / this.length())
  38333. },
  38334. lerp: function(e, t) {
  38335. return this.x += (e.x - this.x) * t,
  38336. this.y += (e.y - this.y) * t,
  38337. this.z += (e.z - this.z) * t,
  38338. this
  38339. },
  38340. lerpVectors: function(e, t, i) {
  38341. return this.subVectors(t, e).multiplyScalar(i).add(e),
  38342. this
  38343. },
  38344. cross: function(e, t) {
  38345. if (void 0 !== t)
  38346. return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),
  38347. this.crossVectors(e, t);
  38348. var i = this.x
  38349. , n = this.y
  38350. , r = this.z;
  38351. return this.x = n * e.z - r * e.y,
  38352. this.y = r * e.x - i * e.z,
  38353. this.z = i * e.y - n * e.x,
  38354. this
  38355. },
  38356. crossVectors: function(e, t) {
  38357. var i = e.x
  38358. , n = e.y
  38359. , r = e.z
  38360. , o = t.x
  38361. , a = t.y
  38362. , s = t.z;
  38363. return this.x = n * s - r * a,
  38364. this.y = r * o - i * s,
  38365. this.z = i * a - n * o,
  38366. this
  38367. },
  38368. projectOnVector: function(e) {
  38369. return void 0 === xe && (xe = new Ci.Vector3),
  38370. xe.copy(e).normalize(),
  38371. Se = this.dot(xe),
  38372. this.copy(xe).multiplyScalar(Se)
  38373. },
  38374. projectOnPlane: function(e) {
  38375. return void 0 === Te && (Te = new Ci.Vector3),
  38376. Te.copy(this).projectOnVector(e),
  38377. this.sub(Te)
  38378. },
  38379. reflect: function(e) {
  38380. return void 0 === we && (we = new Ci.Vector3),
  38381. this.sub(we.copy(e).multiplyScalar(2 * this.dot(e)))
  38382. },
  38383. angleTo: function(e) {
  38384. var t = this.dot(e) / Math.sqrt(this.lengthSq() * e.lengthSq());
  38385. return Math.acos(Ci.Math.clamp(t, -1, 1))
  38386. },
  38387. distanceTo: function(e) {
  38388. return Math.sqrt(this.distanceToSquared(e))
  38389. },
  38390. distanceToSquared: function(e) {
  38391. var t = this.x - e.x
  38392. , i = this.y - e.y
  38393. , n = this.z - e.z;
  38394. return t * t + i * i + n * n
  38395. },
  38396. setFromSpherical: function(e) {
  38397. var t = Math.sin(e.phi) * e.radius;
  38398. return this.x = t * Math.sin(e.theta),
  38399. this.y = Math.cos(e.phi) * e.radius,
  38400. this.z = t * Math.cos(e.theta),
  38401. this
  38402. },
  38403. setFromMatrixPosition: function(e) {
  38404. return this.setFromMatrixColumn(e, 3)
  38405. },
  38406. setFromMatrixScale: function(e) {
  38407. var t = this.setFromMatrixColumn(e, 0).length()
  38408. , i = this.setFromMatrixColumn(e, 1).length()
  38409. , n = this.setFromMatrixColumn(e, 2).length();
  38410. return this.x = t,
  38411. this.y = i,
  38412. this.z = n,
  38413. this
  38414. },
  38415. setFromMatrixColumn: function(e, t) {
  38416. return "number" == typeof e && (console.warn("THREE.Vector3: setFromMatrixColumn now expects ( matrix, index )."),
  38417. t = e = t),
  38418. this.fromArray(e.elements, 4 * t)
  38419. },
  38420. equals: function(e) {
  38421. return e.x === this.x && e.y === this.y && e.z === this.z
  38422. },
  38423. fromArray: function(e, t) {
  38424. return void 0 === t && (t = 0),
  38425. this.x = e[t],
  38426. this.y = e[t + 1],
  38427. this.z = e[t + 2],
  38428. this
  38429. },
  38430. toArray: function(e, t) {
  38431. return void 0 === e && (e = []),
  38432. void 0 === t && (t = 0),
  38433. e[t] = this.x,
  38434. e[t + 1] = this.y,
  38435. e[t + 2] = this.z,
  38436. e
  38437. },
  38438. fromAttribute: function(e, t, i) {
  38439. return void 0 === i && (i = 0),
  38440. t = t * e.itemSize + i,
  38441. this.x = e.array[t],
  38442. this.y = e.array[t + 1],
  38443. this.z = e.array[t + 2],
  38444. this
  38445. }
  38446. },
  38447. Ci.Vector4 = function(e, t, i, n) {
  38448. this.x = e || 0,
  38449. this.y = t || 0,
  38450. this.z = i || 0,
  38451. this.w = void 0 !== n ? n : 1
  38452. }
  38453. ,
  38454. Ci.Vector4.prototype = {
  38455. constructor: Ci.Vector4,
  38456. set: function(e, t, i, n) {
  38457. return this.x = e,
  38458. this.y = t,
  38459. this.z = i,
  38460. this.w = n,
  38461. this
  38462. },
  38463. setScalar: function(e) {
  38464. return this.x = e,
  38465. this.y = e,
  38466. this.z = e,
  38467. this.w = e,
  38468. this
  38469. },
  38470. setX: function(e) {
  38471. return this.x = e,
  38472. this
  38473. },
  38474. setY: function(e) {
  38475. return this.y = e,
  38476. this
  38477. },
  38478. setZ: function(e) {
  38479. return this.z = e,
  38480. this
  38481. },
  38482. setW: function(e) {
  38483. return this.w = e,
  38484. this
  38485. },
  38486. setComponent: function(e, t) {
  38487. switch (e) {
  38488. case 0:
  38489. this.x = t;
  38490. break;
  38491. case 1:
  38492. this.y = t;
  38493. break;
  38494. case 2:
  38495. this.z = t;
  38496. break;
  38497. case 3:
  38498. this.w = t;
  38499. break;
  38500. default:
  38501. throw new Error("index is out of range: " + e)
  38502. }
  38503. },
  38504. getComponent: function(e) {
  38505. switch (e) {
  38506. case 0:
  38507. return this.x;
  38508. case 1:
  38509. return this.y;
  38510. case 2:
  38511. return this.z;
  38512. case 3:
  38513. return this.w;
  38514. default:
  38515. throw new Error("index is out of range: " + e)
  38516. }
  38517. },
  38518. clone: function() {
  38519. return new this.constructor(this.x,this.y,this.z,this.w)
  38520. },
  38521. copy: function(e) {
  38522. return this.x = e.x,
  38523. this.y = e.y,
  38524. this.z = e.z,
  38525. this.w = void 0 !== e.w ? e.w : 1,
  38526. this
  38527. },
  38528. add: function(e, t) {
  38529. return void 0 !== t ? (console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  38530. this.addVectors(e, t)) : (this.x += e.x,
  38531. this.y += e.y,
  38532. this.z += e.z,
  38533. this.w += e.w,
  38534. this)
  38535. },
  38536. addScalar: function(e) {
  38537. return this.x += e,
  38538. this.y += e,
  38539. this.z += e,
  38540. this.w += e,
  38541. this
  38542. },
  38543. addVectors: function(e, t) {
  38544. return this.x = e.x + t.x,
  38545. this.y = e.y + t.y,
  38546. this.z = e.z + t.z,
  38547. this.w = e.w + t.w,
  38548. this
  38549. },
  38550. addScaledVector: function(e, t) {
  38551. return this.x += e.x * t,
  38552. this.y += e.y * t,
  38553. this.z += e.z * t,
  38554. this.w += e.w * t,
  38555. this
  38556. },
  38557. sub: function(e, t) {
  38558. return void 0 !== t ? (console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  38559. this.subVectors(e, t)) : (this.x -= e.x,
  38560. this.y -= e.y,
  38561. this.z -= e.z,
  38562. this.w -= e.w,
  38563. this)
  38564. },
  38565. subScalar: function(e) {
  38566. return this.x -= e,
  38567. this.y -= e,
  38568. this.z -= e,
  38569. this.w -= e,
  38570. this
  38571. },
  38572. subVectors: function(e, t) {
  38573. return this.x = e.x - t.x,
  38574. this.y = e.y - t.y,
  38575. this.z = e.z - t.z,
  38576. this.w = e.w - t.w,
  38577. this
  38578. },
  38579. multiplyScalar: function(e) {
  38580. return isFinite(e) ? (this.x *= e,
  38581. this.y *= e,
  38582. this.z *= e,
  38583. this.w *= e) : (this.x = 0,
  38584. this.y = 0,
  38585. this.z = 0,
  38586. this.w = 0),
  38587. this
  38588. },
  38589. applyMatrix4: function(e) {
  38590. var t = this.x
  38591. , i = this.y
  38592. , n = this.z
  38593. , r = this.w
  38594. , o = e.elements;
  38595. return this.x = o[0] * t + o[4] * i + o[8] * n + o[12] * r,
  38596. this.y = o[1] * t + o[5] * i + o[9] * n + o[13] * r,
  38597. this.z = o[2] * t + o[6] * i + o[10] * n + o[14] * r,
  38598. this.w = o[3] * t + o[7] * i + o[11] * n + o[15] * r,
  38599. this
  38600. },
  38601. divideScalar: function(e) {
  38602. return this.multiplyScalar(1 / e)
  38603. },
  38604. setAxisAngleFromQuaternion: function(e) {
  38605. this.w = 2 * Math.acos(e.w);
  38606. var t = Math.sqrt(1 - e.w * e.w);
  38607. return t < 1e-4 ? (this.x = 1,
  38608. this.y = 0,
  38609. this.z = 0) : (this.x = e.x / t,
  38610. this.y = e.y / t,
  38611. this.z = e.z / t),
  38612. this
  38613. },
  38614. setAxisAngleFromRotationMatrix: function(e) {
  38615. var t, i, n, r, o = e.elements, a = o[0], s = o[4], l = o[8], c = o[1], h = o[5], u = o[9], d = o[2], p = o[6], f = o[10];
  38616. if (Math.abs(s - c) < .01 && Math.abs(l - d) < .01 && Math.abs(u - p) < .01) {
  38617. if (Math.abs(s + c) < .1 && Math.abs(l + d) < .1 && Math.abs(u + p) < .1 && Math.abs(a + h + f - 3) < .1)
  38618. return this.set(1, 0, 0, 0),
  38619. this;
  38620. t = Math.PI;
  38621. var g = (a + 1) / 2
  38622. , m = (h + 1) / 2
  38623. , v = (f + 1) / 2
  38624. , y = (s + c) / 4
  38625. , A = (l + d) / 4
  38626. , C = (u + p) / 4;
  38627. return m < g && v < g ? r = g < .01 ? (i = 0,
  38628. n = .707106781) : (n = y / (i = Math.sqrt(g)),
  38629. A / i) : v < m ? r = m < .01 ? (n = 0,
  38630. i = .707106781) : (i = y / (n = Math.sqrt(m)),
  38631. C / n) : v < .01 ? (n = i = .707106781,
  38632. r = 0) : (i = A / (r = Math.sqrt(v)),
  38633. n = C / r),
  38634. this.set(i, n, r, t),
  38635. this
  38636. }
  38637. var I = Math.sqrt((p - u) * (p - u) + (l - d) * (l - d) + (c - s) * (c - s));
  38638. return Math.abs(I) < .001 && (I = 1),
  38639. this.x = (p - u) / I,
  38640. this.y = (l - d) / I,
  38641. this.z = (c - s) / I,
  38642. this.w = Math.acos((a + h + f - 1) / 2),
  38643. this
  38644. },
  38645. min: function(e) {
  38646. return this.x = Math.min(this.x, e.x),
  38647. this.y = Math.min(this.y, e.y),
  38648. this.z = Math.min(this.z, e.z),
  38649. this.w = Math.min(this.w, e.w),
  38650. this
  38651. },
  38652. max: function(e) {
  38653. return this.x = Math.max(this.x, e.x),
  38654. this.y = Math.max(this.y, e.y),
  38655. this.z = Math.max(this.z, e.z),
  38656. this.w = Math.max(this.w, e.w),
  38657. this
  38658. },
  38659. clamp: function(e, t) {
  38660. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  38661. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  38662. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  38663. this.w = Math.max(e.w, Math.min(t.w, this.w)),
  38664. this
  38665. },
  38666. clampScalar: function(e, t) {
  38667. return void 0 === _e && (_e = new Ci.Vector4,
  38668. be = new Ci.Vector4),
  38669. _e.set(e, e, e, e),
  38670. be.set(t, t, t, t),
  38671. this.clamp(_e, be)
  38672. },
  38673. floor: function() {
  38674. return this.x = Math.floor(this.x),
  38675. this.y = Math.floor(this.y),
  38676. this.z = Math.floor(this.z),
  38677. this.w = Math.floor(this.w),
  38678. this
  38679. },
  38680. ceil: function() {
  38681. return this.x = Math.ceil(this.x),
  38682. this.y = Math.ceil(this.y),
  38683. this.z = Math.ceil(this.z),
  38684. this.w = Math.ceil(this.w),
  38685. this
  38686. },
  38687. round: function() {
  38688. return this.x = Math.round(this.x),
  38689. this.y = Math.round(this.y),
  38690. this.z = Math.round(this.z),
  38691. this.w = Math.round(this.w),
  38692. this
  38693. },
  38694. roundToZero: function() {
  38695. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  38696. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  38697. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  38698. this.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w),
  38699. this
  38700. },
  38701. negate: function() {
  38702. return this.x = -this.x,
  38703. this.y = -this.y,
  38704. this.z = -this.z,
  38705. this.w = -this.w,
  38706. this
  38707. },
  38708. dot: function(e) {
  38709. return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w
  38710. },
  38711. lengthSq: function() {
  38712. return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w
  38713. },
  38714. length: function() {
  38715. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w)
  38716. },
  38717. lengthManhattan: function() {
  38718. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w)
  38719. },
  38720. normalize: function() {
  38721. return this.divideScalar(this.length())
  38722. },
  38723. setLength: function(e) {
  38724. return this.multiplyScalar(e / this.length())
  38725. },
  38726. lerp: function(e, t) {
  38727. return this.x += (e.x - this.x) * t,
  38728. this.y += (e.y - this.y) * t,
  38729. this.z += (e.z - this.z) * t,
  38730. this.w += (e.w - this.w) * t,
  38731. this
  38732. },
  38733. lerpVectors: function(e, t, i) {
  38734. return this.subVectors(t, e).multiplyScalar(i).add(e),
  38735. this
  38736. },
  38737. equals: function(e) {
  38738. return e.x === this.x && e.y === this.y && e.z === this.z && e.w === this.w
  38739. },
  38740. fromArray: function(e, t) {
  38741. return void 0 === t && (t = 0),
  38742. this.x = e[t],
  38743. this.y = e[t + 1],
  38744. this.z = e[t + 2],
  38745. this.w = e[t + 3],
  38746. this
  38747. },
  38748. toArray: function(e, t) {
  38749. return void 0 === e && (e = []),
  38750. void 0 === t && (t = 0),
  38751. e[t] = this.x,
  38752. e[t + 1] = this.y,
  38753. e[t + 2] = this.z,
  38754. e[t + 3] = this.w,
  38755. e
  38756. },
  38757. fromAttribute: function(e, t, i) {
  38758. return void 0 === i && (i = 0),
  38759. t = t * e.itemSize + i,
  38760. this.x = e.array[t],
  38761. this.y = e.array[t + 1],
  38762. this.z = e.array[t + 2],
  38763. this.w = e.array[t + 3],
  38764. this
  38765. }
  38766. },
  38767. Ci.Euler = function(e, t, i, n) {
  38768. this._x = e || 0,
  38769. this._y = t || 0,
  38770. this._z = i || 0,
  38771. this._order = n || Ci.Euler.DefaultOrder
  38772. }
  38773. ,
  38774. Ci.Euler.RotationOrders = ["XYZ", "YZX", "ZXY", "XZY", "YXZ", "ZYX"],
  38775. Ci.Euler.DefaultOrder = "XYZ",
  38776. Ci.Euler.prototype = {
  38777. constructor: Ci.Euler,
  38778. get x() {
  38779. return this._x
  38780. },
  38781. set x(e) {
  38782. this._x = e,
  38783. this.onChangeCallback()
  38784. },
  38785. get y() {
  38786. return this._y
  38787. },
  38788. set y(e) {
  38789. this._y = e,
  38790. this.onChangeCallback()
  38791. },
  38792. get z() {
  38793. return this._z
  38794. },
  38795. set z(e) {
  38796. this._z = e,
  38797. this.onChangeCallback()
  38798. },
  38799. get order() {
  38800. return this._order
  38801. },
  38802. set order(e) {
  38803. this._order = e,
  38804. this.onChangeCallback()
  38805. },
  38806. set: function(e, t, i, n) {
  38807. return this._x = e,
  38808. this._y = t,
  38809. this._z = i,
  38810. this._order = n || this._order,
  38811. this.onChangeCallback(),
  38812. this
  38813. },
  38814. clone: function() {
  38815. return new this.constructor(this._x,this._y,this._z,this._order)
  38816. },
  38817. copy: function(e) {
  38818. return this._x = e._x,
  38819. this._y = e._y,
  38820. this._z = e._z,
  38821. this._order = e._order,
  38822. this.onChangeCallback(),
  38823. this
  38824. },
  38825. toObject: function() {//xzw
  38826. return {x:this.x,y:this.y,z:this.z}
  38827. },
  38828. setFromRotationMatrix: function(e, t, i) {
  38829. var n = Ci.Math.clamp
  38830. , r = e.elements
  38831. , o = r[0]
  38832. , a = r[4]
  38833. , s = r[8]
  38834. , l = r[1]
  38835. , c = r[5]
  38836. , h = r[9]
  38837. , u = r[2]
  38838. , d = r[6]
  38839. , p = r[10];
  38840. return "XYZ" === (t = t || this._order) ? (this._y = Math.asin(n(s, -1, 1)),
  38841. Math.abs(s) < .99999 ? (this._x = Math.atan2(-h, p),
  38842. this._z = Math.atan2(-a, o)) : (this._x = Math.atan2(d, c),
  38843. this._z = 0)) : "YXZ" === t ? (this._x = Math.asin(-n(h, -1, 1)),
  38844. Math.abs(h) < .99999 ? (this._y = Math.atan2(s, p),
  38845. this._z = Math.atan2(l, c)) : (this._y = Math.atan2(-u, o),
  38846. this._z = 0)) : "ZXY" === t ? (this._x = Math.asin(n(d, -1, 1)),
  38847. Math.abs(d) < .99999 ? (this._y = Math.atan2(-u, p),
  38848. this._z = Math.atan2(-a, c)) : (this._y = 0,
  38849. this._z = Math.atan2(l, o))) : "ZYX" === t ? (this._y = Math.asin(-n(u, -1, 1)),
  38850. Math.abs(u) < .99999 ? (this._x = Math.atan2(d, p),
  38851. this._z = Math.atan2(l, o)) : (this._x = 0,
  38852. this._z = Math.atan2(-a, c))) : "YZX" === t ? (this._z = Math.asin(n(l, -1, 1)),
  38853. Math.abs(l) < .99999 ? (this._x = Math.atan2(-h, c),
  38854. this._y = Math.atan2(-u, o)) : (this._x = 0,
  38855. this._y = Math.atan2(s, p))) : "XZY" === t ? (this._z = Math.asin(-n(a, -1, 1)),
  38856. Math.abs(a) < .99999 ? (this._x = Math.atan2(d, c),
  38857. this._y = Math.atan2(s, o)) : (this._x = Math.atan2(-h, p),
  38858. this._y = 0)) : console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: " + t),
  38859. this._order = t,
  38860. !1 !== i && this.onChangeCallback(),
  38861. this
  38862. },
  38863. setFromQuaternion: function(e, t, i) {
  38864. return void 0 === Ee && (Ee = new Ci.Matrix4),
  38865. Ee.makeRotationFromQuaternion(e),
  38866. this.setFromRotationMatrix(Ee, t, i),
  38867. this
  38868. },
  38869. setFromVector3: function(e, t) {
  38870. return this.set(e.x, e.y, e.z, t || this._order)
  38871. },
  38872. reorder: (Ie = new Ci.Quaternion,
  38873. function(e) {
  38874. Ie.setFromEuler(this),
  38875. this.setFromQuaternion(Ie, e)
  38876. }
  38877. ),
  38878. equals: function(e) {
  38879. return e._x === this._x && e._y === this._y && e._z === this._z && e._order === this._order
  38880. },
  38881. fromArray: function(e) {
  38882. return this._x = e[0],
  38883. this._y = e[1],
  38884. this._z = e[2],
  38885. void 0 !== e[3] && (this._order = e[3]),
  38886. this.onChangeCallback(),
  38887. this
  38888. },
  38889. toArray: function(e, t) {
  38890. return void 0 === e && (e = []),
  38891. void 0 === t && (t = 0),
  38892. e[t] = this._x,
  38893. e[t + 1] = this._y,
  38894. e[t + 2] = this._z,
  38895. e[t + 3] = this._order,
  38896. e
  38897. },
  38898. toVector3: function(e) {
  38899. return e ? e.set(this._x, this._y, this._z) : new Ci.Vector3(this._x,this._y,this._z)
  38900. },
  38901. onChange: function(e) {
  38902. return this.onChangeCallback = e,
  38903. this
  38904. },
  38905. onChangeCallback: function() {}
  38906. },
  38907. Ci.Line3 = function(e, t) {
  38908. this.start = void 0 !== e ? e : new Ci.Vector3,
  38909. this.end = void 0 !== t ? t : new Ci.Vector3
  38910. }
  38911. ,
  38912. Ci.Line3.prototype = {
  38913. constructor: Ci.Line3,
  38914. set: function(e, t) {
  38915. return this.start.copy(e),
  38916. this.end.copy(t),
  38917. this
  38918. },
  38919. clone: function() {
  38920. return (new this.constructor).copy(this)
  38921. },
  38922. copy: function(e) {
  38923. return this.start.copy(e.start),
  38924. this.end.copy(e.end),
  38925. this
  38926. },
  38927. center: function(e) {
  38928. return (e || new Ci.Vector3).addVectors(this.start, this.end).multiplyScalar(.5)
  38929. },
  38930. delta: function(e) {
  38931. return (e || new Ci.Vector3).subVectors(this.end, this.start)
  38932. },
  38933. distanceSq: function() {
  38934. return this.start.distanceToSquared(this.end)
  38935. },
  38936. distance: function() {
  38937. return this.start.distanceTo(this.end)
  38938. },
  38939. at: function(e, t) {
  38940. var i = t || new Ci.Vector3;
  38941. return this.delta(i).multiplyScalar(e).add(this.start)
  38942. },
  38943. closestPointToPointParameter: (Ae = new Ci.Vector3,
  38944. Ce = new Ci.Vector3,
  38945. function(e, t) {
  38946. Ae.subVectors(e, this.start),
  38947. Ce.subVectors(this.end, this.start);
  38948. var i = Ce.dot(Ce)
  38949. , n = Ce.dot(Ae) / i;
  38950. return t && (n = Ci.Math.clamp(n, 0, 1)),
  38951. n
  38952. }
  38953. ),
  38954. closestPointToPoint: function(e, t, i) {
  38955. var n = this.closestPointToPointParameter(e, t)
  38956. , r = i || new Ci.Vector3;
  38957. return this.delta(r).multiplyScalar(n).add(this.start)
  38958. },
  38959. applyMatrix4: function(e) {
  38960. return this.start.applyMatrix4(e),
  38961. this.end.applyMatrix4(e),
  38962. this
  38963. },
  38964. equals: function(e) {
  38965. return e.start.equals(this.start) && e.end.equals(this.end)
  38966. }
  38967. },
  38968. Ci.Box2 = function(e, t) {
  38969. this.min = void 0 !== e ? e : new Ci.Vector2(1 / 0,1 / 0),
  38970. this.max = void 0 !== t ? t : new Ci.Vector2(-1 / 0,-1 / 0)
  38971. }
  38972. ,
  38973. Ci.Box2.prototype = {
  38974. constructor: Ci.Box2,
  38975. set: function(e, t) {
  38976. return this.min.copy(e),
  38977. this.max.copy(t),
  38978. this
  38979. },
  38980. setFromPoints: function(e) {
  38981. this.makeEmpty();
  38982. for (var t = 0, i = e.length; t < i; t++)
  38983. this.expandByPoint(e[t]);
  38984. return this
  38985. },
  38986. setFromCenterAndSize: (ye = new Ci.Vector2,
  38987. function(e, t) {
  38988. var i = ye.copy(t).multiplyScalar(.5);
  38989. return this.min.copy(e).sub(i),
  38990. this.max.copy(e).add(i),
  38991. this
  38992. }
  38993. ),
  38994. clone: function() {
  38995. return (new this.constructor).copy(this)
  38996. },
  38997. copy: function(e) {
  38998. return this.min.copy(e.min),
  38999. this.max.copy(e.max),
  39000. this
  39001. },
  39002. makeEmpty: function() {
  39003. return this.min.x = this.min.y = 1 / 0,
  39004. this.max.x = this.max.y = -1 / 0,
  39005. this
  39006. },
  39007. isEmpty: function() {
  39008. return this.max.x < this.min.x || this.max.y < this.min.y
  39009. },
  39010. center: function(e) {
  39011. return (e || new Ci.Vector2).addVectors(this.min, this.max).multiplyScalar(.5)
  39012. },
  39013. size: function(e) {
  39014. return (e || new Ci.Vector2).subVectors(this.max, this.min)
  39015. },
  39016. expandByPoint: function(e) {
  39017. return this.min.min(e),
  39018. this.max.max(e),
  39019. this
  39020. },
  39021. expandByVector: function(e) {
  39022. return this.min.sub(e),
  39023. this.max.add(e),
  39024. this
  39025. },
  39026. expandByScalar: function(e) {
  39027. return this.min.addScalar(-e),
  39028. this.max.addScalar(e),
  39029. this
  39030. },
  39031. containsPoint: function(e) {
  39032. return !(e.x < this.min.x || e.x > this.max.x || e.y < this.min.y || e.y > this.max.y)
  39033. },
  39034. containsBox: function(e) {
  39035. 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
  39036. },
  39037. getParameter: function(e, t) {
  39038. return (t || new Ci.Vector2).set((e.x - this.min.x) / (this.max.x - this.min.x), (e.y - this.min.y) / (this.max.y - this.min.y))
  39039. },
  39040. intersectsBox: function(e) {
  39041. 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)
  39042. },
  39043. clampPoint: function(e, t) {
  39044. return (t || new Ci.Vector2).copy(e).clamp(this.min, this.max)
  39045. },
  39046. distanceToPoint: (ve = new Ci.Vector2,
  39047. function(e) {
  39048. return ve.copy(e).clamp(this.min, this.max).sub(e).length()
  39049. }
  39050. ),
  39051. intersect: function(e) {
  39052. return this.min.max(e.min),
  39053. this.max.min(e.max),
  39054. this
  39055. },
  39056. union: function(e) {
  39057. return this.min.min(e.min),
  39058. this.max.max(e.max),
  39059. this
  39060. },
  39061. translate: function(e) {
  39062. return this.min.add(e),
  39063. this.max.add(e),
  39064. this
  39065. },
  39066. equals: function(e) {
  39067. return e.min.equals(this.min) && e.max.equals(this.max)
  39068. }
  39069. },
  39070. Ci.Box3 = function(e, t) {
  39071. this.min = void 0 !== e ? e : new Ci.Vector3(1 / 0,1 / 0,1 / 0),
  39072. this.max = void 0 !== t ? t : new Ci.Vector3(-1 / 0,-1 / 0,-1 / 0)
  39073. }
  39074. ,
  39075. Ci.Box3.prototype = {
  39076. constructor: Ci.Box3,
  39077. set: function(e, t) {
  39078. return this.min.copy(e),
  39079. this.max.copy(t),
  39080. this
  39081. },
  39082. setFromArray: function(e) {
  39083. this.makeEmpty();
  39084. 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) {
  39085. var c = e[s]
  39086. , h = e[s + 1]
  39087. , u = e[s + 2];
  39088. c < t && (t = c),
  39089. h < i && (i = h),
  39090. u < n && (n = u),
  39091. r < c && (r = c),
  39092. o < h && (o = h),
  39093. a < u && (a = u)
  39094. }
  39095. this.min.set(t, i, n),
  39096. this.max.set(r, o, a)
  39097. },
  39098. setFromPoints: function(e) {
  39099. this.makeEmpty();
  39100. for (var t = 0, i = e.length; t < i; t++)
  39101. this.expandByPoint(e[t]);
  39102. return this
  39103. },
  39104. setFromCenterAndSize: (me = new Ci.Vector3,
  39105. function(e, t) {
  39106. var i = me.copy(t).multiplyScalar(.5);
  39107. return this.min.copy(e).sub(i),
  39108. this.max.copy(e).add(i),
  39109. this
  39110. }
  39111. ),
  39112. setFromObject: function(e) {
  39113. void 0 === ge && (ge = new Ci.Box3);
  39114. var i = this;
  39115. return this.makeEmpty(),
  39116. e.updateMatrixWorld(!0),
  39117. e.traverse(function(e) {
  39118. var t = e.geometry;
  39119. void 0 !== t && (null === t.boundingBox && t.computeBoundingBox(),
  39120. !1 === t.boundingBox.isEmpty() && (ge.copy(t.boundingBox),
  39121. ge.applyMatrix4(e.matrixWorld),
  39122. i.union(ge)))
  39123. }),
  39124. this
  39125. },
  39126. clone: function() {
  39127. return (new this.constructor).copy(this)
  39128. },
  39129. copy: function(e) {
  39130. return this.min.copy(e.min),
  39131. this.max.copy(e.max),
  39132. this
  39133. },
  39134. makeEmpty: function() {
  39135. return this.min.x = this.min.y = this.min.z = 1 / 0,
  39136. this.max.x = this.max.y = this.max.z = -1 / 0,
  39137. this
  39138. },
  39139. isEmpty: function() {
  39140. return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z
  39141. },
  39142. center: function(e) {
  39143. return (e || new Ci.Vector3).addVectors(this.min, this.max).multiplyScalar(.5)
  39144. },
  39145. size: function(e) {
  39146. return (e || new Ci.Vector3).subVectors(this.max, this.min)
  39147. },
  39148. expandByPoint: function(e) {
  39149. return this.min.min(e),
  39150. this.max.max(e),
  39151. this
  39152. },
  39153. expandByVector: function(e) {
  39154. return this.min.sub(e),
  39155. this.max.add(e),
  39156. this
  39157. },
  39158. expandByScalar: function(e) {
  39159. return this.min.addScalar(-e),
  39160. this.max.addScalar(e),
  39161. this
  39162. },
  39163. containsPoint: function(e) {
  39164. 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)
  39165. },
  39166. containsBox: function(e) {
  39167. 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
  39168. },
  39169. getParameter: function(e, t) {
  39170. return (t || new Ci.Vector3).set((e.x - this.min.x) / (this.max.x - this.min.x), (e.y - this.min.y) / (this.max.y - this.min.y), (e.z - this.min.z) / (this.max.z - this.min.z))
  39171. },
  39172. intersectsBox: function(e) {
  39173. 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)
  39174. },
  39175. intersectsSphere: function(e) {
  39176. return void 0 === fe && (fe = new Ci.Vector3),
  39177. this.clampPoint(e.center, fe),
  39178. fe.distanceToSquared(e.center) <= e.radius * e.radius
  39179. },
  39180. intersectsPlane: function(e) {
  39181. var t, i;
  39182. return i = 0 < e.normal.x ? (t = e.normal.x * this.min.x,
  39183. e.normal.x * this.max.x) : (t = e.normal.x * this.max.x,
  39184. e.normal.x * this.min.x),
  39185. 0 < e.normal.y ? (t += e.normal.y * this.min.y,
  39186. i += e.normal.y * this.max.y) : (t += e.normal.y * this.max.y,
  39187. i += e.normal.y * this.min.y),
  39188. 0 < e.normal.z ? (t += e.normal.z * this.min.z,
  39189. i += e.normal.z * this.max.z) : (t += e.normal.z * this.max.z,
  39190. i += e.normal.z * this.min.z),
  39191. t <= e.constant && i >= e.constant
  39192. },
  39193. clampPoint: function(e, t) {
  39194. return (t || new Ci.Vector3).copy(e).clamp(this.min, this.max)
  39195. },
  39196. distanceToPoint: (pe = new Ci.Vector3,
  39197. function(e) {
  39198. return pe.copy(e).clamp(this.min, this.max).sub(e).length()
  39199. }
  39200. ),
  39201. getBoundingSphere: (de = new Ci.Vector3,
  39202. function(e) {
  39203. var t = e || new Ci.Sphere;
  39204. return t.center = this.center(),
  39205. t.radius = .5 * this.size(de).length(),
  39206. t
  39207. }
  39208. ),
  39209. intersect: function(e) {
  39210. return this.min.max(e.min),
  39211. this.max.min(e.max),
  39212. this
  39213. },
  39214. union: function(e) {
  39215. return this.min.min(e.min),
  39216. this.max.max(e.max),
  39217. this
  39218. },
  39219. applyMatrix4: (ue = [new Ci.Vector3, new Ci.Vector3, new Ci.Vector3, new Ci.Vector3, new Ci.Vector3, new Ci.Vector3, new Ci.Vector3, new Ci.Vector3],
  39220. function(e) {
  39221. return ue[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(e),
  39222. ue[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(e),
  39223. ue[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(e),
  39224. ue[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(e),
  39225. ue[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(e),
  39226. ue[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(e),
  39227. ue[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(e),
  39228. ue[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(e),
  39229. this.makeEmpty(),
  39230. this.setFromPoints(ue),
  39231. this
  39232. }
  39233. ),
  39234. translate: function(e) {
  39235. return this.min.add(e),
  39236. this.max.add(e),
  39237. this
  39238. },
  39239. equals: function(e) {
  39240. return e.min.equals(this.min) && e.max.equals(this.max)
  39241. }
  39242. },
  39243. Ci.Matrix3 = function() {
  39244. this.elements = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]),
  39245. 0 < arguments.length && console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")
  39246. }
  39247. ,
  39248. Ci.Matrix3.prototype = {
  39249. constructor: Ci.Matrix3,
  39250. set: function(e, t, i, n, r, o, a, s, l) {
  39251. var c = this.elements;
  39252. return c[0] = e,
  39253. c[1] = n,
  39254. c[2] = a,
  39255. c[3] = t,
  39256. c[4] = r,
  39257. c[5] = s,
  39258. c[6] = i,
  39259. c[7] = o,
  39260. c[8] = l,
  39261. this
  39262. },
  39263. identity: function() {
  39264. return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1),
  39265. this
  39266. },
  39267. clone: function() {
  39268. return (new this.constructor).fromArray(this.elements)
  39269. },
  39270. copy: function(e) {
  39271. var t = e.elements;
  39272. return this.set(t[0], t[3], t[6], t[1], t[4], t[7], t[2], t[5], t[8]),
  39273. this
  39274. },
  39275. setFromMatrix4: function(e) {
  39276. var t = e.elements;
  39277. return this.set(t[0], t[4], t[8], t[1], t[5], t[9], t[2], t[6], t[10]),
  39278. this
  39279. },
  39280. applyToVector3Array: function(e, t, i) {
  39281. void 0 === he && (he = new Ci.Vector3),
  39282. void 0 === t && (t = 0),
  39283. void 0 === i && (i = e.length);
  39284. for (var n = 0, r = t; n < i; n += 3,
  39285. r += 3)
  39286. he.fromArray(e, r),
  39287. he.applyMatrix3(this),
  39288. he.toArray(e, r);
  39289. return e
  39290. },
  39291. applyToBuffer: function(e, t, i) {
  39292. void 0 === ce && (ce = new Ci.Vector3),
  39293. void 0 === t && (t = 0),
  39294. void 0 === i && (i = e.length / e.itemSize);
  39295. for (var n = 0, r = t; n < i; n++,
  39296. r++)
  39297. ce.x = e.getX(r),
  39298. ce.y = e.getY(r),
  39299. ce.z = e.getZ(r),
  39300. ce.applyMatrix3(this),
  39301. e.setXYZ(ce.x, ce.y, ce.z);
  39302. return e
  39303. },
  39304. multiplyScalar: function(e) {
  39305. var t = this.elements;
  39306. return t[0] *= e,
  39307. t[3] *= e,
  39308. t[6] *= e,
  39309. t[1] *= e,
  39310. t[4] *= e,
  39311. t[7] *= e,
  39312. t[2] *= e,
  39313. t[5] *= e,
  39314. t[8] *= e,
  39315. this
  39316. },
  39317. determinant: function() {
  39318. var e = this.elements
  39319. , t = e[0]
  39320. , i = e[1]
  39321. , n = e[2]
  39322. , r = e[3]
  39323. , o = e[4]
  39324. , a = e[5]
  39325. , s = e[6]
  39326. , l = e[7]
  39327. , c = e[8];
  39328. return t * o * c - t * a * l - i * r * c + i * a * s + n * r * l - n * o * s
  39329. },
  39330. getInverse: function(e, t) {
  39331. e instanceof Ci.Matrix4 && console.warn("THREE.Matrix3.getInverse no longer takes a Matrix4 argument.");
  39332. var i = e.elements
  39333. , n = this.elements
  39334. , r = i[0]
  39335. , o = i[1]
  39336. , a = i[2]
  39337. , s = i[3]
  39338. , l = i[4]
  39339. , c = i[5]
  39340. , h = i[6]
  39341. , u = i[7]
  39342. , d = i[8]
  39343. , p = d * l - c * u
  39344. , f = c * h - d * s
  39345. , g = u * s - l * h
  39346. , m = r * p + o * f + a * g;
  39347. if (0 != m)
  39348. return n[0] = p,
  39349. n[1] = a * u - d * o,
  39350. n[2] = c * o - a * l,
  39351. n[3] = f,
  39352. n[4] = d * r - a * h,
  39353. n[5] = a * s - c * r,
  39354. n[6] = g,
  39355. n[7] = o * h - u * r,
  39356. n[8] = l * r - o * s,
  39357. this.multiplyScalar(1 / m);
  39358. var v = "THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0";
  39359. if (t)
  39360. throw new Error(v);
  39361. return console.warn(v),
  39362. this.identity()
  39363. },
  39364. transpose: function() {
  39365. var e, t = this.elements;
  39366. return e = t[1],
  39367. t[1] = t[3],
  39368. t[3] = e,
  39369. e = t[2],
  39370. t[2] = t[6],
  39371. t[6] = e,
  39372. e = t[5],
  39373. t[5] = t[7],
  39374. t[7] = e,
  39375. this
  39376. },
  39377. flattenToArrayOffset: function(e, t) {
  39378. var i = this.elements;
  39379. return e[t] = i[0],
  39380. e[t + 1] = i[1],
  39381. e[t + 2] = i[2],
  39382. e[t + 3] = i[3],
  39383. e[t + 4] = i[4],
  39384. e[t + 5] = i[5],
  39385. e[t + 6] = i[6],
  39386. e[t + 7] = i[7],
  39387. e[t + 8] = i[8],
  39388. e
  39389. },
  39390. getNormalMatrix: function(e) {
  39391. return this.setFromMatrix4(e).getInverse(this).transpose()
  39392. },
  39393. transposeIntoArray: function(e) {
  39394. var t = this.elements;
  39395. return e[0] = t[0],
  39396. e[1] = t[3],
  39397. e[2] = t[6],
  39398. e[3] = t[1],
  39399. e[4] = t[4],
  39400. e[5] = t[7],
  39401. e[6] = t[2],
  39402. e[7] = t[5],
  39403. e[8] = t[8],
  39404. this
  39405. },
  39406. fromArray: function(e) {
  39407. return this.elements.set(e),
  39408. this
  39409. },
  39410. toArray: function() {
  39411. var e = this.elements;
  39412. return [e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8]]
  39413. }
  39414. },
  39415. Ci.Matrix4 = function() {
  39416. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  39417. 0 < arguments.length && console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  39418. }
  39419. ,
  39420. Ci.Matrix4.prototype = {
  39421. constructor: Ci.Matrix4,
  39422. set: function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  39423. var m = this.elements;
  39424. return m[0] = e,
  39425. m[4] = t,
  39426. m[8] = i,
  39427. m[12] = n,
  39428. m[1] = r,
  39429. m[5] = o,
  39430. m[9] = a,
  39431. m[13] = s,
  39432. m[2] = l,
  39433. m[6] = c,
  39434. m[10] = h,
  39435. m[14] = u,
  39436. m[3] = d,
  39437. m[7] = p,
  39438. m[11] = f,
  39439. m[15] = g,
  39440. this
  39441. },
  39442. identity: function() {
  39443. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  39444. this
  39445. },
  39446. clone: function() {
  39447. return (new Ci.Matrix4).fromArray(this.elements)
  39448. },
  39449. copy: function(e) {
  39450. return this.elements.set(e.elements),
  39451. this
  39452. },
  39453. copyPosition: function(e) {
  39454. var t = this.elements
  39455. , i = e.elements;
  39456. return t[12] = i[12],
  39457. t[13] = i[13],
  39458. t[14] = i[14],
  39459. this
  39460. },
  39461. extractBasis: function(e, t, i) {
  39462. return e.setFromMatrixColumn(this, 0),
  39463. t.setFromMatrixColumn(this, 1),
  39464. i.setFromMatrixColumn(this, 2),
  39465. this
  39466. },
  39467. makeBasis: function(e, t, i) {
  39468. 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),
  39469. this
  39470. },
  39471. extractRotation: function(e) {
  39472. void 0 === le && (le = new Ci.Vector3);
  39473. var t = this.elements
  39474. , i = e.elements
  39475. , n = 1 / le.setFromMatrixColumn(e, 0).length()
  39476. , r = 1 / le.setFromMatrixColumn(e, 1).length()
  39477. , o = 1 / le.setFromMatrixColumn(e, 2).length();
  39478. return t[0] = i[0] * n,
  39479. t[1] = i[1] * n,
  39480. t[2] = i[2] * n,
  39481. t[4] = i[4] * r,
  39482. t[5] = i[5] * r,
  39483. t[6] = i[6] * r,
  39484. t[8] = i[8] * o,
  39485. t[9] = i[9] * o,
  39486. t[10] = i[10] * o,
  39487. this
  39488. },
  39489. makeRotationFromEuler: function(e) {
  39490. e instanceof Ci.Euler == 0 && console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  39491. var t = this.elements
  39492. , i = e.x
  39493. , n = e.y
  39494. , r = e.z
  39495. , o = Math.cos(i)
  39496. , a = Math.sin(i)
  39497. , s = Math.cos(n)
  39498. , l = Math.sin(n)
  39499. , c = Math.cos(r)
  39500. , h = Math.sin(r);
  39501. if ("XYZ" === e.order) {
  39502. var u = o * c
  39503. , d = o * h
  39504. , p = a * c
  39505. , f = a * h;
  39506. t[0] = s * c,
  39507. t[4] = -s * h,
  39508. t[8] = l,
  39509. t[1] = d + p * l,
  39510. t[5] = u - f * l,
  39511. t[9] = -a * s,
  39512. t[2] = f - u * l,
  39513. t[6] = p + d * l,
  39514. t[10] = o * s
  39515. } else if ("YXZ" === e.order) {
  39516. var g = s * c
  39517. , m = s * h
  39518. , v = l * c
  39519. , y = l * h;
  39520. t[0] = g + y * a,
  39521. t[4] = v * a - m,
  39522. t[8] = o * l,
  39523. t[1] = o * h,
  39524. t[5] = o * c,
  39525. t[9] = -a,
  39526. t[2] = m * a - v,
  39527. t[6] = y + g * a,
  39528. t[10] = o * s
  39529. } else if ("ZXY" === e.order) {
  39530. g = s * c,
  39531. m = s * h,
  39532. v = l * c,
  39533. y = l * h;
  39534. t[0] = g - y * a,
  39535. t[4] = -o * h,
  39536. t[8] = v + m * a,
  39537. t[1] = m + v * a,
  39538. t[5] = o * c,
  39539. t[9] = y - g * a,
  39540. t[2] = -o * l,
  39541. t[6] = a,
  39542. t[10] = o * s
  39543. } else if ("ZYX" === e.order) {
  39544. u = o * c,
  39545. d = o * h,
  39546. p = a * c,
  39547. f = a * h;
  39548. t[0] = s * c,
  39549. t[4] = p * l - d,
  39550. t[8] = u * l + f,
  39551. t[1] = s * h,
  39552. t[5] = f * l + u,
  39553. t[9] = d * l - p,
  39554. t[2] = -l,
  39555. t[6] = a * s,
  39556. t[10] = o * s
  39557. } else if ("YZX" === e.order) {
  39558. var A = o * s
  39559. , C = o * l
  39560. , I = a * s
  39561. , E = a * l;
  39562. t[0] = s * c,
  39563. t[4] = E - A * h,
  39564. t[8] = I * h + C,
  39565. t[1] = h,
  39566. t[5] = o * c,
  39567. t[9] = -a * c,
  39568. t[2] = -l * c,
  39569. t[6] = C * h + I,
  39570. t[10] = A - E * h
  39571. } else if ("XZY" === e.order) {
  39572. A = o * s,
  39573. C = o * l,
  39574. I = a * s,
  39575. E = a * l;
  39576. t[0] = s * c,
  39577. t[4] = -h,
  39578. t[8] = l * c,
  39579. t[1] = A * h + E,
  39580. t[5] = o * c,
  39581. t[9] = C * h - I,
  39582. t[2] = I * h - C,
  39583. t[6] = a * c,
  39584. t[10] = E * h + A
  39585. }
  39586. return t[3] = 0,
  39587. t[7] = 0,
  39588. t[11] = 0,
  39589. t[12] = 0,
  39590. t[13] = 0,
  39591. t[14] = 0,
  39592. t[15] = 1,
  39593. this
  39594. },
  39595. makeRotationFromQuaternion: function(e) {
  39596. var t = this.elements
  39597. , i = e.x
  39598. , n = e.y
  39599. , r = e.z
  39600. , o = e.w
  39601. , a = i + i
  39602. , s = n + n
  39603. , l = r + r
  39604. , c = i * a
  39605. , h = i * s
  39606. , u = i * l
  39607. , d = n * s
  39608. , p = n * l
  39609. , f = r * l
  39610. , g = o * a
  39611. , m = o * s
  39612. , v = o * l;
  39613. return t[0] = 1 - (d + f),
  39614. t[4] = h - v,
  39615. t[8] = u + m,
  39616. t[1] = h + v,
  39617. t[5] = 1 - (c + f),
  39618. t[9] = p - g,
  39619. t[2] = u - m,
  39620. t[6] = p + g,
  39621. t[10] = 1 - (c + d),
  39622. t[3] = 0,
  39623. t[7] = 0,
  39624. t[11] = 0,
  39625. t[12] = 0,
  39626. t[13] = 0,
  39627. t[14] = 0,
  39628. t[15] = 1,
  39629. this
  39630. },
  39631. lookAt: function(e, t, i) {
  39632. void 0 === oe && (oe = new Ci.Vector3),
  39633. void 0 === ae && (ae = new Ci.Vector3),
  39634. void 0 === se && (se = new Ci.Vector3);
  39635. var n = this.elements;
  39636. return se.subVectors(e, t).normalize(),
  39637. 0 === se.lengthSq() && (se.z = 1),
  39638. oe.crossVectors(i, se).normalize(),
  39639. 0 === oe.lengthSq() && (se.x += 1e-4,
  39640. oe.crossVectors(i, se).normalize()),
  39641. ae.crossVectors(se, oe),
  39642. n[0] = oe.x,
  39643. n[4] = ae.x,
  39644. n[8] = se.x,
  39645. n[1] = oe.y,
  39646. n[5] = ae.y,
  39647. n[9] = se.y,
  39648. n[2] = oe.z,
  39649. n[6] = ae.z,
  39650. n[10] = se.z,
  39651. this
  39652. },
  39653. multiply: function(e, t) {
  39654. return void 0 !== t ? (console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),
  39655. this.multiplyMatrices(e, t)) : this.multiplyMatrices(this, e)
  39656. },
  39657. multiplyMatrices: function(e, t) {
  39658. var i = e.elements
  39659. , n = t.elements
  39660. , r = this.elements
  39661. , o = i[0]
  39662. , a = i[4]
  39663. , s = i[8]
  39664. , l = i[12]
  39665. , c = i[1]
  39666. , h = i[5]
  39667. , u = i[9]
  39668. , d = i[13]
  39669. , p = i[2]
  39670. , f = i[6]
  39671. , g = i[10]
  39672. , m = i[14]
  39673. , v = i[3]
  39674. , y = i[7]
  39675. , A = i[11]
  39676. , C = i[15]
  39677. , I = n[0]
  39678. , E = n[4]
  39679. , _ = n[8]
  39680. , b = n[12]
  39681. , w = n[1]
  39682. , T = n[5]
  39683. , x = n[9]
  39684. , S = n[13]
  39685. , M = n[2]
  39686. , R = n[6]
  39687. , P = n[10]
  39688. , O = n[14]
  39689. , L = n[3]
  39690. , D = n[7]
  39691. , N = n[11]
  39692. , F = n[15];
  39693. return r[0] = o * I + a * w + s * M + l * L,
  39694. r[4] = o * E + a * T + s * R + l * D,
  39695. r[8] = o * _ + a * x + s * P + l * N,
  39696. r[12] = o * b + a * S + s * O + l * F,
  39697. r[1] = c * I + h * w + u * M + d * L,
  39698. r[5] = c * E + h * T + u * R + d * D,
  39699. r[9] = c * _ + h * x + u * P + d * N,
  39700. r[13] = c * b + h * S + u * O + d * F,
  39701. r[2] = p * I + f * w + g * M + m * L,
  39702. r[6] = p * E + f * T + g * R + m * D,
  39703. r[10] = p * _ + f * x + g * P + m * N,
  39704. r[14] = p * b + f * S + g * O + m * F,
  39705. r[3] = v * I + y * w + A * M + C * L,
  39706. r[7] = v * E + y * T + A * R + C * D,
  39707. r[11] = v * _ + y * x + A * P + C * N,
  39708. r[15] = v * b + y * S + A * O + C * F,
  39709. this
  39710. },
  39711. multiplyToArray: function(e, t, i) {
  39712. var n = this.elements;
  39713. return this.multiplyMatrices(e, t),
  39714. i[0] = n[0],
  39715. i[1] = n[1],
  39716. i[2] = n[2],
  39717. i[3] = n[3],
  39718. i[4] = n[4],
  39719. i[5] = n[5],
  39720. i[6] = n[6],
  39721. i[7] = n[7],
  39722. i[8] = n[8],
  39723. i[9] = n[9],
  39724. i[10] = n[10],
  39725. i[11] = n[11],
  39726. i[12] = n[12],
  39727. i[13] = n[13],
  39728. i[14] = n[14],
  39729. i[15] = n[15],
  39730. this
  39731. },
  39732. multiplyScalar: function(e) {
  39733. var t = this.elements;
  39734. return t[0] *= e,
  39735. t[4] *= e,
  39736. t[8] *= e,
  39737. t[12] *= e,
  39738. t[1] *= e,
  39739. t[5] *= e,
  39740. t[9] *= e,
  39741. t[13] *= e,
  39742. t[2] *= e,
  39743. t[6] *= e,
  39744. t[10] *= e,
  39745. t[14] *= e,
  39746. t[3] *= e,
  39747. t[7] *= e,
  39748. t[11] *= e,
  39749. t[15] *= e,
  39750. this
  39751. },
  39752. applyToVector3Array: function(e, t, i) {
  39753. void 0 === re && (re = new Ci.Vector3),
  39754. void 0 === t && (t = 0),
  39755. void 0 === i && (i = e.length);
  39756. for (var n = 0, r = t; n < i; n += 3,
  39757. r += 3)
  39758. re.fromArray(e, r),
  39759. re.applyMatrix4(this),
  39760. re.toArray(e, r);
  39761. return e
  39762. },
  39763. applyToBuffer: function(e, t, i) {
  39764. void 0 === ne && (ne = new Ci.Vector3),
  39765. void 0 === t && (t = 0),
  39766. void 0 === i && (i = e.length / e.itemSize);
  39767. for (var n = 0, r = t; n < i; n++,
  39768. r++)
  39769. ne.x = e.getX(r),
  39770. ne.y = e.getY(r),
  39771. ne.z = e.getZ(r),
  39772. ne.applyMatrix4(this),
  39773. e.setXYZ(ne.x, ne.y, ne.z);
  39774. return e
  39775. },
  39776. determinant: function() {
  39777. var e = this.elements
  39778. , t = e[0]
  39779. , i = e[4]
  39780. , n = e[8]
  39781. , r = e[12]
  39782. , o = e[1]
  39783. , a = e[5]
  39784. , s = e[9]
  39785. , l = e[13]
  39786. , c = e[2]
  39787. , h = e[6]
  39788. , u = e[10]
  39789. , d = e[14];
  39790. return e[3] * (+r * s * h - n * l * h - r * a * u + i * l * u + n * a * d - i * s * d) + e[7] * (+t * s * d - t * l * u + r * o * u - n * o * d + n * l * c - r * s * c) + e[11] * (+t * l * h - t * a * d - r * o * h + i * o * d + r * a * c - i * l * c) + e[15] * (-n * a * c - t * s * h + t * a * u + n * o * h - i * o * u + i * s * c)
  39791. },
  39792. transpose: function() {
  39793. var e, t = this.elements;
  39794. return e = t[1],
  39795. t[1] = t[4],
  39796. t[4] = e,
  39797. e = t[2],
  39798. t[2] = t[8],
  39799. t[8] = e,
  39800. e = t[6],
  39801. t[6] = t[9],
  39802. t[9] = e,
  39803. e = t[3],
  39804. t[3] = t[12],
  39805. t[12] = e,
  39806. e = t[7],
  39807. t[7] = t[13],
  39808. t[13] = e,
  39809. e = t[11],
  39810. t[11] = t[14],
  39811. t[14] = e,
  39812. this
  39813. },
  39814. flattenToArrayOffset: function(e, t) {
  39815. var i = this.elements;
  39816. return e[t] = i[0],
  39817. e[t + 1] = i[1],
  39818. e[t + 2] = i[2],
  39819. e[t + 3] = i[3],
  39820. e[t + 4] = i[4],
  39821. e[t + 5] = i[5],
  39822. e[t + 6] = i[6],
  39823. e[t + 7] = i[7],
  39824. e[t + 8] = i[8],
  39825. e[t + 9] = i[9],
  39826. e[t + 10] = i[10],
  39827. e[t + 11] = i[11],
  39828. e[t + 12] = i[12],
  39829. e[t + 13] = i[13],
  39830. e[t + 14] = i[14],
  39831. e[t + 15] = i[15],
  39832. e
  39833. },
  39834. getPosition: function() {
  39835. return void 0 === ie && (ie = new Ci.Vector3),
  39836. console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),
  39837. ie.setFromMatrixColumn(this, 3)
  39838. },
  39839. setPosition: function(e) {
  39840. var t = this.elements;
  39841. return t[12] = e.x,
  39842. t[13] = e.y,
  39843. t[14] = e.z,
  39844. this
  39845. },
  39846. getInverse: function(e, t) {
  39847. var i = this.elements
  39848. , n = e.elements
  39849. , r = n[0]
  39850. , o = n[1]
  39851. , a = n[2]
  39852. , s = n[3]
  39853. , l = n[4]
  39854. , c = n[5]
  39855. , h = n[6]
  39856. , u = n[7]
  39857. , d = n[8]
  39858. , p = n[9]
  39859. , f = n[10]
  39860. , g = n[11]
  39861. , m = n[12]
  39862. , v = n[13]
  39863. , y = n[14]
  39864. , A = n[15]
  39865. , C = p * y * u - v * f * u + v * h * g - c * y * g - p * h * A + c * f * A
  39866. , I = m * f * u - d * y * u - m * h * g + l * y * g + d * h * A - l * f * A
  39867. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * A + l * p * A
  39868. , _ = m * p * h - d * v * h - m * c * f + l * v * f + d * c * y - l * p * y
  39869. , b = r * C + o * I + a * E + s * _;
  39870. if (0 != b)
  39871. return i[0] = C,
  39872. i[1] = v * f * s - p * y * s - v * a * g + o * y * g + p * a * A - o * f * A,
  39873. i[2] = c * y * s - v * h * s + v * a * u - o * y * u - c * a * A + o * h * A,
  39874. i[3] = p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g,
  39875. i[4] = I,
  39876. i[5] = d * y * s - m * f * s + m * a * g - r * y * g - d * a * A + r * f * A,
  39877. i[6] = m * h * s - l * y * s - m * a * u + r * y * u + l * a * A - r * h * A,
  39878. i[7] = l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g,
  39879. i[8] = E,
  39880. i[9] = m * p * s - d * v * s - m * o * g + r * v * g + d * o * A - r * p * A,
  39881. i[10] = l * v * s - m * c * s + m * o * u - r * v * u - l * o * A + r * c * A,
  39882. i[11] = d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g,
  39883. i[12] = _,
  39884. i[13] = d * v * a - m * p * a + m * o * f - r * v * f - d * o * y + r * p * y,
  39885. i[14] = m * c * a - l * v * a - m * o * h + r * v * h + l * o * y - r * c * y,
  39886. i[15] = l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f,
  39887. this.multiplyScalar(1 / b);
  39888. var w = "THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  39889. if (t)
  39890. throw new Error(w);
  39891. return console.warn(w),
  39892. this.identity()
  39893. },
  39894. scale: function(e) {
  39895. var t = this.elements
  39896. , i = e.x
  39897. , n = e.y
  39898. , r = e.z;
  39899. return t[0] *= i,
  39900. t[4] *= n,
  39901. t[8] *= r,
  39902. t[1] *= i,
  39903. t[5] *= n,
  39904. t[9] *= r,
  39905. t[2] *= i,
  39906. t[6] *= n,
  39907. t[10] *= r,
  39908. t[3] *= i,
  39909. t[7] *= n,
  39910. t[11] *= r,
  39911. this
  39912. },
  39913. getMaxScaleOnAxis: function() {
  39914. var e = this.elements
  39915. , t = e[0] * e[0] + e[1] * e[1] + e[2] * e[2]
  39916. , i = e[4] * e[4] + e[5] * e[5] + e[6] * e[6]
  39917. , n = e[8] * e[8] + e[9] * e[9] + e[10] * e[10];
  39918. return Math.sqrt(Math.max(t, i, n))
  39919. },
  39920. makeTranslation: function(e, t, i) {
  39921. return this.set(1, 0, 0, e, 0, 1, 0, t, 0, 0, 1, i, 0, 0, 0, 1),
  39922. this
  39923. },
  39924. makeRotationX: function(e) {
  39925. var t = Math.cos(e)
  39926. , i = Math.sin(e);
  39927. return this.set(1, 0, 0, 0, 0, t, -i, 0, 0, i, t, 0, 0, 0, 0, 1),
  39928. this
  39929. },
  39930. makeRotationY: function(e) {
  39931. var t = Math.cos(e)
  39932. , i = Math.sin(e);
  39933. return this.set(t, 0, i, 0, 0, 1, 0, 0, -i, 0, t, 0, 0, 0, 0, 1),
  39934. this
  39935. },
  39936. makeRotationZ: function(e) {
  39937. var t = Math.cos(e)
  39938. , i = Math.sin(e);
  39939. return this.set(t, -i, 0, 0, i, t, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  39940. this
  39941. },
  39942. makeRotationAxis: function(e, t) {
  39943. var i = Math.cos(t)
  39944. , n = Math.sin(t)
  39945. , r = 1 - i
  39946. , o = e.x
  39947. , a = e.y
  39948. , s = e.z
  39949. , l = r * o
  39950. , c = r * a;
  39951. 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),
  39952. this
  39953. },
  39954. makeScale: function(e, t, i) {
  39955. return this.set(e, 0, 0, 0, 0, t, 0, 0, 0, 0, i, 0, 0, 0, 0, 1),
  39956. this
  39957. },
  39958. compose: function(e, t, i) {
  39959. return this.makeRotationFromQuaternion(t),
  39960. this.scale(i),
  39961. this.setPosition(e),
  39962. this
  39963. },
  39964. decompose: function(e, t, i) {
  39965. void 0 === ee && (ee = new Ci.Vector3),
  39966. void 0 === te && (te = new Ci.Matrix4);
  39967. var n = this.elements
  39968. , r = ee.set(n[0], n[1], n[2]).length()
  39969. , o = ee.set(n[4], n[5], n[6]).length()
  39970. , a = ee.set(n[8], n[9], n[10]).length();
  39971. this.determinant() < 0 && (r = -r),
  39972. e.x = n[12],
  39973. e.y = n[13],
  39974. e.z = n[14],
  39975. te.elements.set(this.elements);
  39976. var s = 1 / r
  39977. , l = 1 / o
  39978. , c = 1 / a;
  39979. return te.elements[0] *= s,
  39980. te.elements[1] *= s,
  39981. te.elements[2] *= s,
  39982. te.elements[4] *= l,
  39983. te.elements[5] *= l,
  39984. te.elements[6] *= l,
  39985. te.elements[8] *= c,
  39986. te.elements[9] *= c,
  39987. te.elements[10] *= c,
  39988. t.setFromRotationMatrix(te),
  39989. i.x = r,
  39990. i.y = o,
  39991. i.z = a,
  39992. this
  39993. },
  39994. makeFrustum: function(e, t, i, n, r, o) {
  39995. var a = this.elements
  39996. , s = 2 * r / (t - e)
  39997. , l = 2 * r / (n - i)
  39998. , c = (t + e) / (t - e)
  39999. , h = (n + i) / (n - i)
  40000. , u = -(o + r) / (o - r)
  40001. , d = -2 * o * r / (o - r);
  40002. return a[0] = s,
  40003. a[4] = 0,
  40004. a[8] = c,
  40005. a[12] = 0,
  40006. a[1] = 0,
  40007. a[5] = l,
  40008. a[9] = h,
  40009. a[13] = 0,
  40010. a[2] = 0,
  40011. a[6] = 0,
  40012. a[10] = u,
  40013. a[14] = d,
  40014. a[3] = 0,
  40015. a[7] = 0,
  40016. a[11] = -1,
  40017. a[15] = 0,
  40018. this
  40019. },
  40020. makePerspective: function(e, t, i, n) {
  40021. var r = i * Math.tan(Ci.Math.degToRad(.5 * e))
  40022. , o = -r
  40023. , a = o * t
  40024. , s = r * t;
  40025. return this.makeFrustum(a, s, o, r, i, n)
  40026. },
  40027. makeOrthographic: function(e, t, i, n, r, o) {
  40028. var a = this.elements
  40029. , s = 1 / (t - e)
  40030. , l = 1 / (i - n)
  40031. , c = 1 / (o - r)
  40032. , h = (t + e) * s
  40033. , u = (i + n) * l
  40034. , d = (o + r) * c;
  40035. return a[0] = 2 * s,
  40036. a[4] = 0,
  40037. a[8] = 0,
  40038. a[12] = -h,
  40039. a[1] = 0,
  40040. a[5] = 2 * l,
  40041. a[9] = 0,
  40042. a[13] = -u,
  40043. a[2] = 0,
  40044. a[6] = 0,
  40045. a[10] = -2 * c,
  40046. a[14] = -d,
  40047. a[3] = 0,
  40048. a[7] = 0,
  40049. a[11] = 0,
  40050. a[15] = 1,
  40051. this
  40052. },
  40053. equals: function(e) {
  40054. for (var t = this.elements, i = e.elements, n = 0; n < 16; n++)
  40055. if (t[n] !== i[n])
  40056. return !1;
  40057. return !0
  40058. },
  40059. fromArray: function(e) {
  40060. return this.elements.set(e),
  40061. this
  40062. },
  40063. toArray: function() {
  40064. var e = this.elements;
  40065. 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]]
  40066. }
  40067. },
  40068. Ci.Ray = function(e, t) {
  40069. this.origin = void 0 !== e ? e : new Ci.Vector3,
  40070. this.direction = void 0 !== t ? t : new Ci.Vector3
  40071. }
  40072. ,
  40073. Ci.Ray.prototype = {
  40074. constructor: Ci.Ray,
  40075. set: function(e, t) {
  40076. return this.origin.copy(e),
  40077. this.direction.copy(t),
  40078. this
  40079. },
  40080. clone: function() {
  40081. return (new this.constructor).copy(this)
  40082. },
  40083. copy: function(e) {
  40084. return this.origin.copy(e.origin),
  40085. this.direction.copy(e.direction),
  40086. this
  40087. },
  40088. at: function(e, t) {
  40089. return (t || new Ci.Vector3).copy(this.direction).multiplyScalar(e).add(this.origin)
  40090. },
  40091. lookAt: function(e) {
  40092. this.direction.copy(e).sub(this.origin).normalize()
  40093. },
  40094. recast: ($ = new Ci.Vector3,
  40095. function(e) {
  40096. return this.origin.copy(this.at(e, $)),
  40097. this
  40098. }
  40099. ),
  40100. closestPointToPoint: function(e, t) {
  40101. var i = t || new Ci.Vector3;
  40102. i.subVectors(e, this.origin);
  40103. var n = i.dot(this.direction);
  40104. return n < 0 ? i.copy(this.origin) : i.copy(this.direction).multiplyScalar(n).add(this.origin)
  40105. },
  40106. distanceToPoint: function(e) {
  40107. return Math.sqrt(this.distanceSqToPoint(e))
  40108. },
  40109. distanceSqToPoint: (J = new Ci.Vector3,
  40110. function(e) {
  40111. var t = J.subVectors(e, this.origin).dot(this.direction);
  40112. return t < 0 ? this.origin.distanceToSquared(e) : (J.copy(this.direction).multiplyScalar(t).add(this.origin),
  40113. J.distanceToSquared(e))
  40114. }
  40115. ),
  40116. distanceSqToSegment: (Z = new Ci.Vector3,
  40117. K = new Ci.Vector3,
  40118. Q = new Ci.Vector3,
  40119. function(e, t, i, n) {
  40120. Z.copy(e).add(t).multiplyScalar(.5),
  40121. K.copy(t).sub(e).normalize(),
  40122. Q.copy(this.origin).sub(Z);
  40123. var r, o, a, s, l = .5 * e.distanceTo(t), c = -this.direction.dot(K), h = Q.dot(this.direction), u = -Q.dot(K), d = Q.lengthSq(), p = Math.abs(1 - c * c);
  40124. if (0 < p)
  40125. if (o = c * h - u,
  40126. s = l * p,
  40127. 0 <= (r = c * u - h))
  40128. if (-s <= o)
  40129. if (o <= s) {
  40130. var f = 1 / p;
  40131. a = (r *= f) * (r + c * (o *= f) + 2 * h) + o * (c * r + o + 2 * u) + d
  40132. } else
  40133. o = l,
  40134. a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
  40135. else
  40136. o = -l,
  40137. a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
  40138. else
  40139. a = o <= -s ? -(r = Math.max(0, -(-c * l + h))) * r + (o = 0 < r ? -l : Math.min(Math.max(-l, -u), l)) * (o + 2 * u) + d : o <= s ? (r = 0,
  40140. (o = Math.min(Math.max(-l, -u), l)) * (o + 2 * u) + d) : -(r = Math.max(0, -(c * l + h))) * r + (o = 0 < r ? l : Math.min(Math.max(-l, -u), l)) * (o + 2 * u) + d;
  40141. else
  40142. o = 0 < c ? -l : l,
  40143. a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
  40144. return i && i.copy(this.direction).multiplyScalar(r).add(this.origin),
  40145. n && n.copy(K).multiplyScalar(o).add(Z),
  40146. a
  40147. }
  40148. ),
  40149. intersectSphere: (X = new Ci.Vector3,
  40150. function(e, t) {
  40151. X.subVectors(e.center, this.origin);
  40152. var i = X.dot(this.direction)
  40153. , n = X.dot(X) - i * i
  40154. , r = e.radius * e.radius;
  40155. if (r < n)
  40156. return null;
  40157. var o = Math.sqrt(r - n)
  40158. , a = i - o
  40159. , s = i + o;
  40160. return a < 0 && s < 0 ? null : a < 0 ? this.at(s, t) : this.at(a, t)
  40161. }
  40162. ),
  40163. intersectsSphere: function(e) {
  40164. return this.distanceToPoint(e.center) <= e.radius
  40165. },
  40166. distanceToPlane: function(e) {
  40167. var t = e.normal.dot(this.direction);
  40168. if (0 === t)
  40169. return 0 === e.distanceToPoint(this.origin) ? 0 : null;
  40170. var i = -(this.origin.dot(e.normal) + e.constant) / t;
  40171. return 0 <= i ? i : null
  40172. },
  40173. intersectPlane: function(e, t) {
  40174. var i = this.distanceToPlane(e);
  40175. return null === i ? null : this.at(i, t)
  40176. },
  40177. intersectsPlane: function(e) {
  40178. var t = e.distanceToPoint(this.origin);
  40179. return 0 === t || e.normal.dot(this.direction) * t < 0
  40180. },
  40181. intersectBox: function(e, t) {
  40182. 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;
  40183. return n = 0 <= l ? (i = (e.min.x - u.x) * l,
  40184. (e.max.x - u.x) * l) : (i = (e.max.x - u.x) * l,
  40185. (e.min.x - u.x) * l),
  40186. (o = 0 <= c ? (r = (e.min.y - u.y) * c,
  40187. (e.max.y - u.y) * c) : (r = (e.max.y - u.y) * c,
  40188. (e.min.y - u.y) * c)) < i || n < r ? null : ((i < r || i != i) && (i = r),
  40189. (o < n || n != n) && (n = o),
  40190. (s = 0 <= h ? (a = (e.min.z - u.z) * h,
  40191. (e.max.z - u.z) * h) : (a = (e.max.z - u.z) * h,
  40192. (e.min.z - u.z) * h)) < i || n < a ? null : ((i < a || i != i) && (i = a),
  40193. (s < n || n != n) && (n = s),
  40194. n < 0 ? null : this.at(0 <= i ? i : n, t)))
  40195. },
  40196. intersectsBox: (q = new Ci.Vector3,
  40197. function(e) {
  40198. return null !== this.intersectBox(e, q)
  40199. }
  40200. ),
  40201. intersectTriangle: (G = new Ci.Vector3,
  40202. W = new Ci.Vector3,
  40203. j = new Ci.Vector3,
  40204. Y = new Ci.Vector3,
  40205. function(e, t, i, n, r) {
  40206. W.subVectors(t, e),
  40207. j.subVectors(i, e),
  40208. Y.crossVectors(W, j);
  40209. var o, a = this.direction.dot(Y);
  40210. if (0 < a) {
  40211. if (n)
  40212. return null;
  40213. o = 1
  40214. } else {
  40215. if (!(a < 0))
  40216. return null;
  40217. o = -1,
  40218. a = -a
  40219. }
  40220. G.subVectors(this.origin, e);
  40221. var s = o * this.direction.dot(j.crossVectors(G, j));
  40222. if (s < 0)
  40223. return null;
  40224. var l = o * this.direction.dot(W.cross(G));
  40225. if (l < 0)
  40226. return null;
  40227. if (a < s + l)
  40228. return null;
  40229. var c = -o * G.dot(Y);
  40230. return c < 0 ? null : this.at(c / a, r)
  40231. }
  40232. ),
  40233. applyMatrix4: function(e) {
  40234. return this.direction.add(this.origin).applyMatrix4(e),
  40235. this.origin.applyMatrix4(e),
  40236. this.direction.sub(this.origin),
  40237. this.direction.normalize(),
  40238. this
  40239. },
  40240. equals: function(e) {
  40241. return e.origin.equals(this.origin) && e.direction.equals(this.direction)
  40242. }
  40243. },
  40244. Ci.Sphere = function(e, t) {
  40245. this.center = void 0 !== e ? e : new Ci.Vector3,
  40246. this.radius = void 0 !== t ? t : 0
  40247. }
  40248. ,
  40249. Ci.Sphere.prototype = {
  40250. constructor: Ci.Sphere,
  40251. set: function(e, t) {
  40252. return this.center.copy(e),
  40253. this.radius = t,
  40254. this
  40255. },
  40256. setFromPoints: (z = new Ci.Box3,
  40257. function(e, t) {
  40258. var i = this.center;
  40259. void 0 !== t ? i.copy(t) : z.setFromPoints(e).center(i);
  40260. for (var n = 0, r = 0, o = e.length; r < o; r++)
  40261. n = Math.max(n, i.distanceToSquared(e[r]));
  40262. return this.radius = Math.sqrt(n),
  40263. this
  40264. }
  40265. ),
  40266. clone: function() {
  40267. return (new this.constructor).copy(this)
  40268. },
  40269. copy: function(e) {
  40270. return this.center.copy(e.center),
  40271. this.radius = e.radius,
  40272. this
  40273. },
  40274. empty: function() {
  40275. return this.radius <= 0
  40276. },
  40277. containsPoint: function(e) {
  40278. return e.distanceToSquared(this.center) <= this.radius * this.radius
  40279. },
  40280. distanceToPoint: function(e) {
  40281. return e.distanceTo(this.center) - this.radius
  40282. },
  40283. intersectsSphere: function(e) {
  40284. var t = this.radius + e.radius;
  40285. return e.center.distanceToSquared(this.center) <= t * t
  40286. },
  40287. intersectsBox: function(e) {
  40288. return e.intersectsSphere(this)
  40289. },
  40290. intersectsPlane: function(e) {
  40291. return Math.abs(this.center.dot(e.normal) - e.constant) <= this.radius
  40292. },
  40293. clampPoint: function(e, t) {
  40294. var i = this.center.distanceToSquared(e)
  40295. , n = t || new Ci.Vector3;
  40296. return n.copy(e),
  40297. i > this.radius * this.radius && (n.sub(this.center).normalize(),
  40298. n.multiplyScalar(this.radius).add(this.center)),
  40299. n
  40300. },
  40301. getBoundingBox: function(e) {
  40302. var t = e || new Ci.Box3;
  40303. return t.set(this.center, this.center),
  40304. t.expandByScalar(this.radius),
  40305. t
  40306. },
  40307. applyMatrix4: function(e) {
  40308. return this.center.applyMatrix4(e),
  40309. this.radius = this.radius * e.getMaxScaleOnAxis(),
  40310. this
  40311. },
  40312. translate: function(e) {
  40313. return this.center.add(e),
  40314. this
  40315. },
  40316. equals: function(e) {
  40317. return e.center.equals(this.center) && e.radius === this.radius
  40318. }
  40319. },
  40320. Ci.Frustum = function(e, t, i, n, r, o) {
  40321. this.planes = [void 0 !== e ? e : new Ci.Plane, void 0 !== t ? t : new Ci.Plane, void 0 !== i ? i : new Ci.Plane, void 0 !== n ? n : new Ci.Plane, void 0 !== r ? r : new Ci.Plane, void 0 !== o ? o : new Ci.Plane]
  40322. }
  40323. ,
  40324. Ci.Frustum.prototype = {
  40325. constructor: Ci.Frustum,
  40326. set: function(e, t, i, n, r, o) {
  40327. var a = this.planes;
  40328. return a[0].copy(e),
  40329. a[1].copy(t),
  40330. a[2].copy(i),
  40331. a[3].copy(n),
  40332. a[4].copy(r),
  40333. a[5].copy(o),
  40334. this
  40335. },
  40336. clone: function() {
  40337. return (new this.constructor).copy(this)
  40338. },
  40339. copy: function(e) {
  40340. for (var t = this.planes, i = 0; i < 6; i++)
  40341. t[i].copy(e.planes[i]);
  40342. return this
  40343. },
  40344. setFromMatrix: function(e) {
  40345. var t = this.planes
  40346. , i = e.elements
  40347. , n = i[0]
  40348. , r = i[1]
  40349. , o = i[2]
  40350. , a = i[3]
  40351. , s = i[4]
  40352. , l = i[5]
  40353. , c = i[6]
  40354. , h = i[7]
  40355. , u = i[8]
  40356. , d = i[9]
  40357. , p = i[10]
  40358. , f = i[11]
  40359. , g = i[12]
  40360. , m = i[13]
  40361. , v = i[14]
  40362. , y = i[15];
  40363. return t[0].setComponents(a - n, h - s, f - u, y - g).normalize(),
  40364. t[1].setComponents(a + n, h + s, f + u, y + g).normalize(),
  40365. t[2].setComponents(a + r, h + l, f + d, y + m).normalize(),
  40366. t[3].setComponents(a - r, h - l, f - d, y - m).normalize(),
  40367. t[4].setComponents(a - o, h - c, f - p, y - v).normalize(),
  40368. t[5].setComponents(a + o, h + c, f + p, y + v).normalize(),
  40369. this
  40370. },
  40371. intersectsObject: (H = new Ci.Sphere,
  40372. function(e) {
  40373. var t = e.geometry;
  40374. return null === t.boundingSphere && t.computeBoundingSphere(),
  40375. H.copy(t.boundingSphere),
  40376. H.applyMatrix4(e.matrixWorld),
  40377. this.intersectsSphere(H)
  40378. }
  40379. ),
  40380. intersectsSphere: function(e) {
  40381. for (var t = this.planes, i = e.center, n = -e.radius, r = 0; r < 6; r++) {
  40382. if (t[r].distanceToPoint(i) < n)
  40383. return !1
  40384. }
  40385. return !0
  40386. },
  40387. intersectsBox: (k = new Ci.Vector3,
  40388. U = new Ci.Vector3,
  40389. function(e) {
  40390. for (var t = this.planes, i = 0; i < 6; i++) {
  40391. var n = t[i];
  40392. k.x = 0 < n.normal.x ? e.min.x : e.max.x,
  40393. U.x = 0 < n.normal.x ? e.max.x : e.min.x,
  40394. k.y = 0 < n.normal.y ? e.min.y : e.max.y,
  40395. U.y = 0 < n.normal.y ? e.max.y : e.min.y,
  40396. k.z = 0 < n.normal.z ? e.min.z : e.max.z,
  40397. U.z = 0 < n.normal.z ? e.max.z : e.min.z;
  40398. var r = n.distanceToPoint(k)
  40399. , o = n.distanceToPoint(U);
  40400. if (r < 0 && o < 0)
  40401. return !1
  40402. }
  40403. return !0
  40404. }
  40405. ),
  40406. containsPoint: function(e) {
  40407. for (var t = this.planes, i = 0; i < 6; i++)
  40408. if (t[i].distanceToPoint(e) < 0)
  40409. return !1;
  40410. return !0
  40411. }
  40412. },
  40413. Ci.Plane = function(e, t) {
  40414. this.normal = void 0 !== e ? e : new Ci.Vector3(1,0,0),
  40415. this.constant = void 0 !== t ? t : 0
  40416. }
  40417. ,
  40418. Ci.Plane.prototype = {
  40419. constructor: Ci.Plane,
  40420. set: function(e, t) {
  40421. return this.normal.copy(e),
  40422. this.constant = t,
  40423. this
  40424. },
  40425. setComponents: function(e, t, i, n) {
  40426. return this.normal.set(e, t, i),
  40427. this.constant = n,
  40428. this
  40429. },
  40430. setFromNormalAndCoplanarPoint: function(e, t) {
  40431. return this.normal.copy(e),
  40432. this.constant = -t.dot(this.normal),
  40433. this
  40434. },
  40435. setFromCoplanarPoints: (B = new Ci.Vector3,
  40436. V = new Ci.Vector3,
  40437. function(e, t, i) {
  40438. var n = B.subVectors(i, t).cross(V.subVectors(e, t)).normalize();
  40439. return this.setFromNormalAndCoplanarPoint(n, e),
  40440. this
  40441. }
  40442. ),
  40443. clone: function() {
  40444. return (new this.constructor).copy(this)
  40445. },
  40446. copy: function(e) {
  40447. return this.normal.copy(e.normal),
  40448. this.constant = e.constant,
  40449. this
  40450. },
  40451. normalize: function() {
  40452. var e = 1 / this.normal.length();
  40453. return this.normal.multiplyScalar(e),
  40454. this.constant *= e,
  40455. this
  40456. },
  40457. negate: function() {
  40458. return this.constant *= -1,
  40459. this.normal.negate(),
  40460. this
  40461. },
  40462. distanceToPoint: function(e) {
  40463. return this.normal.dot(e) + this.constant
  40464. },
  40465. distanceToSphere: function(e) {
  40466. return this.distanceToPoint(e.center) - e.radius
  40467. },
  40468. projectPoint: function(e, t) {
  40469. return this.orthoPoint(e, t).sub(e).negate()
  40470. },
  40471. orthoPoint: function(e, t) {
  40472. var i = this.distanceToPoint(e);
  40473. return (t || new Ci.Vector3).copy(this.normal).multiplyScalar(i)
  40474. },
  40475. intersectLine: (F = new Ci.Vector3,
  40476. function(e, t) {
  40477. var i = t || new Ci.Vector3
  40478. , n = e.delta(F)
  40479. , r = this.normal.dot(n);
  40480. if (0 !== r) {
  40481. var o = -(e.start.dot(this.normal) + this.constant) / r;
  40482. if (!(o < 0 || 1 < o))
  40483. return i.copy(n).multiplyScalar(o).add(e.start)
  40484. } else if (0 === this.distanceToPoint(e.start))
  40485. return i.copy(e.start)
  40486. }
  40487. ),
  40488. intersectsLine: function(e) {
  40489. var t = this.distanceToPoint(e.start)
  40490. , i = this.distanceToPoint(e.end);
  40491. return t < 0 && 0 < i || i < 0 && 0 < t
  40492. },
  40493. intersectsBox: function(e) {
  40494. return e.intersectsPlane(this)
  40495. },
  40496. intersectsSphere: function(e) {
  40497. return e.intersectsPlane(this)
  40498. },
  40499. coplanarPoint: function(e) {
  40500. return (e || new Ci.Vector3).copy(this.normal).multiplyScalar(-this.constant)
  40501. },
  40502. applyMatrix4: (L = new Ci.Vector3,
  40503. D = new Ci.Vector3,
  40504. N = new Ci.Matrix3,
  40505. function(e, t) {
  40506. var i = t || N.getNormalMatrix(e)
  40507. , n = L.copy(this.normal).applyMatrix3(i)
  40508. , r = this.coplanarPoint(D);
  40509. return r.applyMatrix4(e),
  40510. this.setFromNormalAndCoplanarPoint(n, r),
  40511. this
  40512. }
  40513. ),
  40514. translate: function(e) {
  40515. return this.constant = this.constant - e.dot(this.normal),
  40516. this
  40517. },
  40518. equals: function(e) {
  40519. return e.normal.equals(this.normal) && e.constant === this.constant
  40520. }
  40521. },
  40522. Ci.Spherical = function(e, t, i) {
  40523. return this.radius = void 0 !== e ? e : 1,
  40524. this.phi = void 0 !== t ? t : 0,
  40525. this.theta = void 0 !== i ? i : 0,
  40526. this
  40527. }
  40528. ,
  40529. Ci.Spherical.prototype = {
  40530. constructor: Ci.Spherical,
  40531. set: function(e, t, i) {
  40532. this.radius = e,
  40533. this.phi = t,
  40534. this.theta = i
  40535. },
  40536. clone: function() {
  40537. return (new this.constructor).copy(this)
  40538. },
  40539. copy: function(e) {
  40540. return this.radius.copy(e.radius),
  40541. this.phi.copy(e.phi),
  40542. this.theta.copy(e.theta),
  40543. this
  40544. },
  40545. makeSafe: function() {
  40546. this.phi = Math.max(1e-6, Math.min(Math.PI - 1e-6, this.phi))
  40547. },
  40548. setFromVector3: function(e) {
  40549. return this.radius = e.length(),
  40550. 0 === this.radius ? (this.theta = 0,
  40551. this.phi = 0) : (this.theta = Math.atan2(e.x, e.z),
  40552. this.phi = Math.acos(Ci.Math.clamp(e.y / this.radius, -1, 1))),
  40553. this
  40554. }
  40555. },
  40556. Ci.Math = {
  40557. generateUUID: (R = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),
  40558. P = new Array(36),
  40559. O = 0,
  40560. function() {
  40561. for (var e = 0; e < 36; e++)
  40562. 8 === e || 13 === e || 18 === e || 23 === e ? P[e] = "-" : 14 === e ? P[e] = "4" : (O <= 2 && (O = 33554432 + 16777216 * Math.random() | 0),
  40563. M = 15 & O,
  40564. O >>= 4,
  40565. P[e] = R[19 === e ? 3 & M | 8 : M]);
  40566. return P.join("")
  40567. }
  40568. ),
  40569. clamp: function(e, t, i) {
  40570. return Math.max(t, Math.min(i, e))
  40571. },
  40572. euclideanModulo: function(e, t) {
  40573. return (e % t + t) % t
  40574. },
  40575. mapLinear: function(e, t, i, n, r) {
  40576. return n + (e - t) * (r - n) / (i - t)
  40577. },
  40578. smoothstep: function(e, t, i) {
  40579. return e <= t ? 0 : i <= e ? 1 : (e = (e - t) / (i - t)) * e * (3 - 2 * e)
  40580. },
  40581. smootherstep: function(e, t, i) {
  40582. return e <= t ? 0 : i <= e ? 1 : (e = (e - t) / (i - t)) * e * e * (e * (6 * e - 15) + 10)
  40583. },
  40584. random16: function() {
  40585. return console.warn("THREE.Math.random16() has been deprecated. Use Math.random() instead."),
  40586. Math.random()
  40587. },
  40588. randInt: function(e, t) {
  40589. return e + Math.floor(Math.random() * (t - e + 1))
  40590. },
  40591. randFloat: function(e, t) {
  40592. return e + Math.random() * (t - e)
  40593. },
  40594. randFloatSpread: function(e) {
  40595. return e * (.5 - Math.random())
  40596. },
  40597. degToRad: (S = Math.PI / 180,
  40598. function(e) {
  40599. return e * S
  40600. }
  40601. ),
  40602. radToDeg: (x = 180 / Math.PI,
  40603. function(e) {
  40604. return e * x
  40605. }
  40606. ),
  40607. isPowerOfTwo: function(e) {
  40608. return 0 == (e & e - 1) && 0 !== e
  40609. },
  40610. nearestPowerOfTwo: function(e) {
  40611. return Math.pow(2, Math.round(Math.log(e) / Math.LN2))
  40612. },
  40613. nextPowerOfTwo: function(e) {
  40614. return e--,
  40615. e |= e >> 1,
  40616. e |= e >> 2,
  40617. e |= e >> 4,
  40618. e |= e >> 8,
  40619. e |= e >> 16,
  40620. ++e
  40621. }
  40622. },
  40623. Ci.Spline = function(e) {
  40624. function t(e, t, i, n, r, o, a) {
  40625. var s = .5 * (i - e)
  40626. , l = .5 * (n - t);
  40627. return (2 * (t - i) + s + l) * a + (-3 * (t - i) - 2 * s - l) * o + s * r + t
  40628. }
  40629. this.points = e;
  40630. var i, n, r, o, a, s, l, c, h, u = [], d = {
  40631. x: 0,
  40632. y: 0,
  40633. z: 0
  40634. };
  40635. this.initFromArray = function(e) {
  40636. this.points = [];
  40637. for (var t = 0; t < e.length; t++)
  40638. this.points[t] = {
  40639. x: e[t][0],
  40640. y: e[t][1],
  40641. z: e[t][2]
  40642. }
  40643. }
  40644. ,
  40645. this.getPoint = function(e) {
  40646. return i = (this.points.length - 1) * e,
  40647. n = Math.floor(i),
  40648. r = i - n,
  40649. u[0] = 0 === n ? n : n - 1,
  40650. u[1] = n,
  40651. u[2] = n > this.points.length - 2 ? this.points.length - 1 : n + 1,
  40652. u[3] = n > this.points.length - 3 ? this.points.length - 1 : n + 2,
  40653. s = this.points[u[0]],
  40654. l = this.points[u[1]],
  40655. c = this.points[u[2]],
  40656. h = this.points[u[3]],
  40657. a = r * (o = r * r),
  40658. d.x = t(s.x, l.x, c.x, h.x, r, o, a),
  40659. d.y = t(s.y, l.y, c.y, h.y, r, o, a),
  40660. d.z = t(s.z, l.z, c.z, h.z, r, o, a),
  40661. d
  40662. }
  40663. ,
  40664. this.getControlPointsArray = function() {
  40665. var e, t, i = this.points.length, n = [];
  40666. for (e = 0; e < i; e++)
  40667. t = this.points[e],
  40668. n[e] = [t.x, t.y, t.z];
  40669. return n
  40670. }
  40671. ,
  40672. this.getLength = function(e) {
  40673. var t, i, n, r, o = 0, a = 0, s = 0, l = new Ci.Vector3, c = new Ci.Vector3, h = [], u = 0;
  40674. for (h[0] = 0,
  40675. e = e || 100,
  40676. n = this.points.length * e,
  40677. l.copy(this.points[0]),
  40678. t = 1; t < n; t++)
  40679. i = t / n,
  40680. r = this.getPoint(i),
  40681. c.copy(r),
  40682. u += c.distanceTo(l),
  40683. l.copy(r),
  40684. o = (this.points.length - 1) * i,
  40685. (a = Math.floor(o)) !== s && (h[a] = u,
  40686. s = a);
  40687. return h[h.length] = u,
  40688. {
  40689. chunks: h,
  40690. total: u
  40691. }
  40692. }
  40693. ,
  40694. this.reparametrizeByArcLength = function(e) {
  40695. var t, i, n, r, o, a, s, l, c = [], h = new Ci.Vector3, u = this.getLength();
  40696. for (c.push(h.copy(this.points[0]).clone()),
  40697. t = 1; t < this.points.length; t++) {
  40698. for (a = u.chunks[t] - u.chunks[t - 1],
  40699. s = Math.ceil(e * a / u.total),
  40700. r = (t - 1) / (this.points.length - 1),
  40701. o = t / (this.points.length - 1),
  40702. i = 1; i < s - 1; i++)
  40703. n = r + i * (1 / s) * (o - r),
  40704. l = this.getPoint(n),
  40705. c.push(h.copy(l).clone());
  40706. c.push(h.copy(this.points[t]).clone())
  40707. }
  40708. this.points = c
  40709. }
  40710. }
  40711. ,
  40712. Ci.Triangle = function(e, t, i) {
  40713. this.a = void 0 !== e ? e : new Ci.Vector3,
  40714. this.b = void 0 !== t ? t : new Ci.Vector3,
  40715. this.c = void 0 !== i ? i : new Ci.Vector3
  40716. }
  40717. ,
  40718. Ci.Triangle.normal = (T = new Ci.Vector3,
  40719. function(e, t, i, n) {
  40720. var r = n || new Ci.Vector3;
  40721. r.subVectors(i, t),
  40722. T.subVectors(e, t),
  40723. r.cross(T);
  40724. var o = r.lengthSq();
  40725. return 0 < o ? r.multiplyScalar(1 / Math.sqrt(o)) : r.set(0, 0, 0)
  40726. }
  40727. ),
  40728. Ci.Triangle.barycoordFromPoint = (_ = new Ci.Vector3,
  40729. b = new Ci.Vector3,
  40730. w = new Ci.Vector3,
  40731. function(e, t, i, n, r) {
  40732. _.subVectors(n, t),
  40733. b.subVectors(i, t),
  40734. w.subVectors(e, t);
  40735. var o = _.dot(_)
  40736. , a = _.dot(b)
  40737. , s = _.dot(w)
  40738. , l = b.dot(b)
  40739. , c = b.dot(w)
  40740. , h = o * l - a * a
  40741. , u = r || new Ci.Vector3;
  40742. if (0 == h)
  40743. return u.set(-2, -1, -1);
  40744. var d = 1 / h
  40745. , p = (l * s - a * c) * d
  40746. , f = (o * c - a * s) * d;
  40747. return u.set(1 - p - f, f, p)
  40748. }
  40749. ),
  40750. Ci.Triangle.containsPoint = (E = new Ci.Vector3,
  40751. function(e, t, i, n) {
  40752. var r = Ci.Triangle.barycoordFromPoint(e, t, i, n, E);
  40753. return 0 <= r.x && 0 <= r.y && r.x + r.y <= 1
  40754. }
  40755. ),
  40756. Ci.Triangle.prototype = {
  40757. constructor: Ci.Triangle,
  40758. set: function(e, t, i) {
  40759. return this.a.copy(e),
  40760. this.b.copy(t),
  40761. this.c.copy(i),
  40762. this
  40763. },
  40764. setFromPointsAndIndices: function(e, t, i, n) {
  40765. return this.a.copy(e[t]),
  40766. this.b.copy(e[i]),
  40767. this.c.copy(e[n]),
  40768. this
  40769. },
  40770. clone: function() {
  40771. return (new this.constructor).copy(this)
  40772. },
  40773. copy: function(e) {
  40774. return this.a.copy(e.a),
  40775. this.b.copy(e.b),
  40776. this.c.copy(e.c),
  40777. this
  40778. },
  40779. area: (C = new Ci.Vector3,
  40780. I = new Ci.Vector3,
  40781. function() {
  40782. return C.subVectors(this.c, this.b),
  40783. I.subVectors(this.a, this.b),
  40784. .5 * C.cross(I).length()
  40785. }
  40786. ),
  40787. midpoint: function(e) {
  40788. return (e || new Ci.Vector3).addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3)
  40789. },
  40790. normal: function(e) {
  40791. return Ci.Triangle.normal(this.a, this.b, this.c, e)
  40792. },
  40793. plane: function(e) {
  40794. return (e || new Ci.Plane).setFromCoplanarPoints(this.a, this.b, this.c)
  40795. },
  40796. barycoordFromPoint: function(e, t) {
  40797. return Ci.Triangle.barycoordFromPoint(e, this.a, this.b, this.c, t)
  40798. },
  40799. containsPoint: function(e) {
  40800. return Ci.Triangle.containsPoint(e, this.a, this.b, this.c)
  40801. },
  40802. equals: function(e) {
  40803. return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c)
  40804. }
  40805. },
  40806. Ci.Interpolant = function(e, t, i, n) {
  40807. this.parameterPositions = e,
  40808. this._cachedIndex = 0,
  40809. this.resultBuffer = void 0 !== n ? n : new t.constructor(i),
  40810. this.sampleValues = t,
  40811. this.valueSize = i
  40812. }
  40813. ,
  40814. Ci.Interpolant.prototype = {
  40815. constructor: Ci.Interpolant,
  40816. evaluate: function(e) {
  40817. var t = this.parameterPositions
  40818. , i = this._cachedIndex
  40819. , n = t[i]
  40820. , r = t[i - 1];
  40821. e: {
  40822. t: {
  40823. var o;
  40824. i: {
  40825. n: if (!(e < n)) {
  40826. for (var a = i + 2; ; ) {
  40827. if (void 0 === n) {
  40828. if (e < r)
  40829. break n;
  40830. return i = t.length,
  40831. this._cachedIndex = i,
  40832. this.afterEnd_(i - 1, e, r)
  40833. }
  40834. if (i === a)
  40835. break;
  40836. if (r = n,
  40837. e < (n = t[++i]))
  40838. break t
  40839. }
  40840. o = t.length;
  40841. break i
  40842. }
  40843. if (r <= e)
  40844. break e;
  40845. var s = t[1];
  40846. e < s && (i = 2,
  40847. r = s);
  40848. for (a = i - 2; ; ) {
  40849. if (void 0 === r)
  40850. return this._cachedIndex = 0,
  40851. this.beforeStart_(0, e, n);
  40852. if (i === a)
  40853. break;
  40854. if (n = r,
  40855. (r = t[--i - 1]) <= e)
  40856. break t
  40857. }
  40858. o = i,
  40859. i = 0
  40860. }
  40861. for (; i < o; ) {
  40862. var l = i + o >>> 1;
  40863. e < t[l] ? o = l : i = 1 + l
  40864. }
  40865. if (n = t[i],
  40866. void 0 === (r = t[i - 1]))
  40867. return this._cachedIndex = 0,
  40868. this.beforeStart_(0, e, n);
  40869. if (void 0 === n)
  40870. return i = t.length,
  40871. this._cachedIndex = i,
  40872. this.afterEnd_(i - 1, r, e)
  40873. }
  40874. this._cachedIndex = i,
  40875. this.intervalChanged_(i, r, n)
  40876. }
  40877. return this.interpolate_(i, r, e, n)
  40878. },
  40879. settings: null,
  40880. DefaultSettings_: {},
  40881. getSettings_: function() {
  40882. return this.settings || this.DefaultSettings_
  40883. },
  40884. copySampleValue_: function(e) {
  40885. for (var t = this.resultBuffer, i = this.sampleValues, n = this.valueSize, r = e * n, o = 0; o !== n; ++o)
  40886. t[o] = i[r + o];
  40887. return t
  40888. },
  40889. interpolate_: function(e, t, i, n) {
  40890. throw new Error("call to abstract method")
  40891. },
  40892. intervalChanged_: function(e, t, i) {}
  40893. },
  40894. Object.assign(Ci.Interpolant.prototype, {
  40895. beforeStart_: Ci.Interpolant.prototype.copySampleValue_,
  40896. afterEnd_: Ci.Interpolant.prototype.copySampleValue_
  40897. }),
  40898. Ci.CubicInterpolant = function(e, t, i, n) {
  40899. Ci.Interpolant.call(this, e, t, i, n),
  40900. this._weightPrev = -0,
  40901. this._offsetPrev = -0,
  40902. this._weightNext = -0,
  40903. this._offsetNext = -0
  40904. }
  40905. ,
  40906. Ci.CubicInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  40907. constructor: Ci.CubicInterpolant,
  40908. DefaultSettings_: {
  40909. endingStart: Ci.ZeroCurvatureEnding,
  40910. endingEnd: Ci.ZeroCurvatureEnding
  40911. },
  40912. intervalChanged_: function(e, t, i) {
  40913. var n = this.parameterPositions
  40914. , r = e - 2
  40915. , o = e + 1
  40916. , a = n[r]
  40917. , s = n[o];
  40918. if (void 0 === a)
  40919. switch (this.getSettings_().endingStart) {
  40920. case Ci.ZeroSlopeEnding:
  40921. r = e,
  40922. a = 2 * t - i;
  40923. break;
  40924. case Ci.WrapAroundEnding:
  40925. a = t + n[r = n.length - 2] - n[r + 1];
  40926. break;
  40927. default:
  40928. r = e,
  40929. a = i
  40930. }
  40931. if (void 0 === s)
  40932. switch (this.getSettings_().endingEnd) {
  40933. case Ci.ZeroSlopeEnding:
  40934. o = e,
  40935. s = 2 * i - t;
  40936. break;
  40937. case Ci.WrapAroundEnding:
  40938. s = i + n[o = 1] - n[0];
  40939. break;
  40940. default:
  40941. o = e - 1,
  40942. s = t
  40943. }
  40944. var l = .5 * (i - t)
  40945. , c = this.valueSize;
  40946. this._weightPrev = l / (t - a),
  40947. this._weightNext = l / (s - i),
  40948. this._offsetPrev = r * c,
  40949. this._offsetNext = o * c
  40950. },
  40951. interpolate_: function(e, t, i, n) {
  40952. for (var r = this.resultBuffer, o = this.sampleValues, a = this.valueSize, s = e * a, l = s - a, c = this._offsetPrev, h = this._offsetNext, u = this._weightPrev, d = this._weightNext, p = (i - t) / (n - t), f = p * p, g = f * p, m = -u * g + 2 * u * f - u * p, v = (1 + u) * g + (-1.5 - 2 * u) * f + (-.5 + u) * p + 1, y = (-1 - d) * g + (1.5 + d) * f + .5 * p, A = d * g - d * f, C = 0; C !== a; ++C)
  40953. r[C] = m * o[c + C] + v * o[l + C] + y * o[s + C] + A * o[h + C];
  40954. return r
  40955. }
  40956. }),
  40957. Ci.DiscreteInterpolant = function(e, t, i, n) {
  40958. Ci.Interpolant.call(this, e, t, i, n)
  40959. }
  40960. ,
  40961. Ci.DiscreteInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  40962. constructor: Ci.DiscreteInterpolant,
  40963. interpolate_: function(e, t, i, n) {
  40964. return this.copySampleValue_(e - 1)
  40965. }
  40966. }),
  40967. Ci.LinearInterpolant = function(e, t, i, n) {
  40968. Ci.Interpolant.call(this, e, t, i, n)
  40969. }
  40970. ,
  40971. Ci.LinearInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  40972. constructor: Ci.LinearInterpolant,
  40973. interpolate_: function(e, t, i, n) {
  40974. 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)
  40975. r[u] = o[l + u] * h + o[s + u] * c;
  40976. return r
  40977. }
  40978. }),
  40979. Ci.QuaternionLinearInterpolant = function(e, t, i, n) {
  40980. Ci.Interpolant.call(this, e, t, i, n)
  40981. }
  40982. ,
  40983. Ci.QuaternionLinearInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  40984. constructor: Ci.QuaternionLinearInterpolant,
  40985. interpolate_: function(e, t, i, n) {
  40986. for (var r = this.resultBuffer, o = this.sampleValues, a = this.valueSize, s = e * a, l = (i - t) / (n - t), c = s + a; s !== c; s += 4)
  40987. Ci.Quaternion.slerpFlat(r, 0, o, s - a, o, s, l);
  40988. return r
  40989. }
  40990. }),
  40991. Ci.Clock = function(e) {
  40992. this.autoStart = void 0 === e || e,
  40993. this.startTime = 0,
  40994. this.oldTime = 0,
  40995. this.elapsedTime = 0,
  40996. this.running = !1
  40997. }
  40998. ,
  40999. Ci.Clock.prototype = {
  41000. constructor: Ci.Clock,
  41001. start: function() {
  41002. this.startTime = performance.now(),
  41003. this.oldTime = this.startTime,
  41004. this.running = !0
  41005. },
  41006. stop: function() {
  41007. this.getElapsedTime(),
  41008. this.running = !1
  41009. },
  41010. getElapsedTime: function() {
  41011. return this.getDelta(),
  41012. this.elapsedTime
  41013. },
  41014. getDelta: function() {
  41015. var e = 0;
  41016. if (this.autoStart && !this.running && this.start(),
  41017. this.running) {
  41018. var t = performance.now();
  41019. e = .001 * (t - this.oldTime),
  41020. this.oldTime = t,
  41021. this.elapsedTime += e
  41022. }
  41023. return e
  41024. }
  41025. },
  41026. Ci.EventDispatcher = function() {}
  41027. ,
  41028. Ci.EventDispatcher.prototype = {
  41029. constructor: Ci.EventDispatcher,
  41030. apply: function(e) {
  41031. e.addEventListener = Ci.EventDispatcher.prototype.addEventListener,
  41032. e.hasEventListener = Ci.EventDispatcher.prototype.hasEventListener,
  41033. e.removeEventListener = Ci.EventDispatcher.prototype.removeEventListener,
  41034. e.dispatchEvent = Ci.EventDispatcher.prototype.dispatchEvent
  41035. },
  41036. addEventListener: function(e, t) {
  41037. void 0 === this._listeners && (this._listeners = {});
  41038. var i = this._listeners;
  41039. void 0 === i[e] && (i[e] = []),
  41040. -1 === i[e].indexOf(t) && i[e].push(t)
  41041. },
  41042. hasEventListener: function(e, t) {
  41043. if (void 0 === this._listeners)
  41044. return !1;
  41045. var i = this._listeners;
  41046. return void 0 !== i[e] && -1 !== i[e].indexOf(t)
  41047. },
  41048. removeEventListener: function(e, t) {
  41049. if (void 0 !== this._listeners) {
  41050. var i = this._listeners[e];
  41051. if (void 0 !== i) {
  41052. var n = i.indexOf(t);
  41053. -1 !== n && i.splice(n, 1)
  41054. }
  41055. }
  41056. },
  41057. dispatchEvent: function(e) {
  41058. if (void 0 !== this._listeners) {
  41059. var t = this._listeners[e.type];
  41060. if (void 0 !== t) {
  41061. e.target = this;
  41062. for (var i = [], n = t.length, r = 0; r < n; r++)
  41063. i[r] = t[r];
  41064. for (r = 0; r < n; r++)
  41065. i[r].call(this, e)
  41066. }
  41067. }
  41068. }
  41069. },
  41070. Ci.Layers = function() {
  41071. this.mask = 1
  41072. }
  41073. ,
  41074. Ci.Layers.prototype = {
  41075. constructor: Ci.Layers,
  41076. set: function(e) {
  41077. this.mask = 1 << e
  41078. },
  41079. enable: function(e) {
  41080. this.mask |= 1 << e
  41081. },
  41082. toggle: function(e) {
  41083. this.mask ^= 1 << e
  41084. },
  41085. disable: function(e) {
  41086. this.mask &= ~(1 << e)
  41087. },
  41088. test: function(e) {
  41089. return 0 != (this.mask & e.mask)
  41090. }
  41091. },
  41092. (A = Ci).Raycaster = function(e, t, i, n) {
  41093. this.ray = new A.Ray(e,t),
  41094. this.near = i || 0,
  41095. this.far = n || 1 / 0,
  41096. this.params = {
  41097. Mesh: {},
  41098. Line: {},
  41099. LOD: {},
  41100. Points: {
  41101. threshold: 1
  41102. },
  41103. Sprite: {}
  41104. },
  41105. Object.defineProperties(this.params, {
  41106. PointCloud: {
  41107. get: function() {
  41108. return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),
  41109. this.Points
  41110. }
  41111. }
  41112. })
  41113. }
  41114. ,
  41115. A.Raycaster.prototype = {
  41116. constructor: A.Raycaster,
  41117. linePrecision: 1,
  41118. set: function(e, t) {
  41119. this.ray.set(e, t)
  41120. },
  41121. setFromCamera: function(e, t) {
  41122. t instanceof A.PerspectiveCamera ? (this.ray.origin.setFromMatrixPosition(t.matrixWorld),
  41123. this.ray.direction.set(e.x, e.y, .5).unproject(t).sub(this.ray.origin).normalize()) : t instanceof A.OrthographicCamera ? (this.ray.origin.set(e.x, e.y, -1).unproject(t),
  41124. this.ray.direction.set(0, 0, -1).transformDirection(t.matrixWorld)) : console.error("THREE.Raycaster: Unsupported camera type.")
  41125. },
  41126. intersectObject: function(e, t) {
  41127. var i = [];
  41128. return Ei(e, this, i, t),
  41129. i.sort(Ii),
  41130. i
  41131. },
  41132. intersectObjects: function(e, t) {
  41133. var i = [];
  41134. if (!1 === Array.isArray(e))
  41135. return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),
  41136. i;
  41137. for (var n = 0, r = e.length; n < r; n++)
  41138. Ei(e[n], this, i, t);
  41139. return i.sort(Ii),
  41140. i
  41141. }
  41142. },
  41143. Ci.Object3D = function() {
  41144. Object.defineProperty(this, "id", {
  41145. value: Ci.Object3DIdCount++
  41146. }),
  41147. this.uuid = Ci.Math.generateUUID(),
  41148. this.name = "",
  41149. this.type = "Object3D",
  41150. this.parent = null,
  41151. this.children = [],
  41152. this.up = Ci.Object3D.DefaultUp.clone();
  41153. var e = new Ci.Vector3
  41154. , t = new Ci.Euler
  41155. , i = new Ci.Quaternion
  41156. , n = new Ci.Vector3(1,1,1);
  41157. t.onChange(function() {
  41158. i.setFromEuler(t, !1)
  41159. }),
  41160. i.onChange(function() {
  41161. t.setFromQuaternion(i, void 0, !1)
  41162. }),
  41163. Object.defineProperties(this, {
  41164. position: {
  41165. enumerable: !0,
  41166. value: e
  41167. },
  41168. rotation: {
  41169. enumerable: !0,
  41170. value: t
  41171. },
  41172. quaternion: {
  41173. enumerable: !0,
  41174. value: i
  41175. },
  41176. scale: {
  41177. enumerable: !0,
  41178. value: n
  41179. },
  41180. modelViewMatrix: {
  41181. value: new Ci.Matrix4
  41182. },
  41183. normalMatrix: {
  41184. value: new Ci.Matrix3
  41185. }
  41186. }),
  41187. this.rotationAutoUpdate = !0,
  41188. this.matrix = new Ci.Matrix4,
  41189. this.matrixWorld = new Ci.Matrix4,
  41190. this.matrixAutoUpdate = Ci.Object3D.DefaultMatrixAutoUpdate,
  41191. this.matrixWorldNeedsUpdate = !1,
  41192. this.layers = new Ci.Layers,
  41193. this.visible = !0,
  41194. this.castShadow = !1,
  41195. this.receiveShadow = !1,
  41196. this.frustumCulled = !0,
  41197. this.renderOrder = 0,
  41198. this.userData = {}
  41199. }
  41200. ,
  41201. Ci.Object3D.DefaultUp = new Ci.Vector3(0,1,0),
  41202. Ci.Object3D.DefaultMatrixAutoUpdate = !0,
  41203. Ci.Object3D.prototype = {
  41204. constructor: Ci.Object3D,
  41205. applyMatrix: function(e) {
  41206. this.matrix.multiplyMatrices(e, this.matrix),
  41207. this.matrix.decompose(this.position, this.quaternion, this.scale)
  41208. },
  41209. setRotationFromAxisAngle: function(e, t) {
  41210. this.quaternion.setFromAxisAngle(e, t)
  41211. },
  41212. setRotationFromEuler: function(e) {
  41213. this.quaternion.setFromEuler(e, !0)
  41214. },
  41215. setRotationFromMatrix: function(e) {
  41216. this.quaternion.setFromRotationMatrix(e)
  41217. },
  41218. setRotationFromQuaternion: function(e) {
  41219. this.quaternion.copy(e)
  41220. },
  41221. rotateOnAxis: (y = new Ci.Quaternion,
  41222. function(e, t) {
  41223. return y.setFromAxisAngle(e, t),
  41224. this.quaternion.multiply(y),
  41225. this
  41226. }
  41227. ),
  41228. rotateX: (v = new Ci.Vector3(1,0,0),
  41229. function(e) {
  41230. return this.rotateOnAxis(v, e)
  41231. }
  41232. ),
  41233. rotateY: (m = new Ci.Vector3(0,1,0),
  41234. function(e) {
  41235. return this.rotateOnAxis(m, e)
  41236. }
  41237. ),
  41238. rotateZ: (g = new Ci.Vector3(0,0,1),
  41239. function(e) {
  41240. return this.rotateOnAxis(g, e)
  41241. }
  41242. ),
  41243. translateOnAxis: (f = new Ci.Vector3,
  41244. function(e, t) {
  41245. return f.copy(e).applyQuaternion(this.quaternion),
  41246. this.position.add(f.multiplyScalar(t)),
  41247. this
  41248. }
  41249. ),
  41250. translateX: (p = new Ci.Vector3(1,0,0),
  41251. function(e) {
  41252. return this.translateOnAxis(p, e)
  41253. }
  41254. ),
  41255. translateY: (d = new Ci.Vector3(0,1,0),
  41256. function(e) {
  41257. return this.translateOnAxis(d, e)
  41258. }
  41259. ),
  41260. translateZ: (u = new Ci.Vector3(0,0,1),
  41261. function(e) {
  41262. return this.translateOnAxis(u, e)
  41263. }
  41264. ),
  41265. localToWorld: function(e) {
  41266. return e.applyMatrix4(this.matrixWorld)
  41267. },
  41268. worldToLocal: (h = new Ci.Matrix4,
  41269. function(e) {
  41270. return e.applyMatrix4(h.getInverse(this.matrixWorld))
  41271. }
  41272. ),
  41273. lookAt: (c = new Ci.Matrix4,
  41274. function(e) {
  41275. c.lookAt(e, this.position, this.up),
  41276. this.quaternion.setFromRotationMatrix(c)
  41277. }
  41278. ),
  41279. add: function(e) {
  41280. if (1 < arguments.length) {
  41281. for (var t = 0; t < arguments.length; t++)
  41282. this.add(arguments[t]);
  41283. return this
  41284. }
  41285. return e === this ? console.error("THREE.Object3D.add: object can't be added as a child of itself.", e) : e instanceof Ci.Object3D ? (null !== e.parent && e.parent.remove(e),
  41286. e.parent = this,
  41287. e.dispatchEvent({
  41288. type: "added"
  41289. }),
  41290. this.children.push(e)) : console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.", e),
  41291. this
  41292. },
  41293. remove: function(e) {
  41294. if (1 < arguments.length)
  41295. for (var t = 0; t < arguments.length; t++)
  41296. this.remove(arguments[t]);
  41297. var i = this.children.indexOf(e);
  41298. -1 !== i && (e.parent = null,
  41299. e.dispatchEvent({
  41300. type: "removed"
  41301. }),
  41302. this.children.splice(i, 1))
  41303. },
  41304. getObjectById: function(e) {
  41305. return this.getObjectByProperty("id", e)
  41306. },
  41307. getObjectByName: function(e) {
  41308. return this.getObjectByProperty("name", e)
  41309. },
  41310. getObjectByProperty: function(e, t) {
  41311. if (this[e] === t)
  41312. return this;
  41313. for (var i = 0, n = this.children.length; i < n; i++) {
  41314. var r = this.children[i].getObjectByProperty(e, t);
  41315. if (void 0 !== r)
  41316. return r
  41317. }
  41318. },
  41319. getWorldPosition: function(e) {
  41320. var t = e || new Ci.Vector3;
  41321. return this.updateMatrixWorld(!0),
  41322. t.setFromMatrixPosition(this.matrixWorld)
  41323. },
  41324. getWorldQuaternion: (s = new Ci.Vector3,
  41325. l = new Ci.Vector3,
  41326. function(e) {
  41327. var t = e || new Ci.Quaternion;
  41328. return this.updateMatrixWorld(!0),
  41329. this.matrixWorld.decompose(s, t, l),
  41330. t
  41331. }
  41332. ),
  41333. getWorldRotation: (a = new Ci.Quaternion,
  41334. function(e) {
  41335. var t = e || new Ci.Euler;
  41336. return this.getWorldQuaternion(a),
  41337. t.setFromQuaternion(a, this.rotation.order, !1)
  41338. }
  41339. ),
  41340. getWorldScale: (r = new Ci.Vector3,
  41341. o = new Ci.Quaternion,
  41342. function(e) {
  41343. var t = e || new Ci.Vector3;
  41344. return this.updateMatrixWorld(!0),
  41345. this.matrixWorld.decompose(r, o, t),
  41346. t
  41347. }
  41348. ),
  41349. getWorldDirection: (n = new Ci.Quaternion,
  41350. function(e) {
  41351. var t = e || new Ci.Vector3;
  41352. return this.getWorldQuaternion(n),
  41353. t.set(0, 0, 1).applyQuaternion(n)
  41354. }
  41355. ),
  41356. raycast: function() {},
  41357. traverse: function(e) {
  41358. e(this);
  41359. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  41360. t[i].traverse(e)
  41361. },
  41362. traverseVisible: function(e) {
  41363. if (!1 !== this.visible) {
  41364. e(this);
  41365. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  41366. t[i].traverseVisible(e)
  41367. }
  41368. },
  41369. traverseAncestors: function(e) {
  41370. var t = this.parent;
  41371. null !== t && (e(t),
  41372. t.traverseAncestors(e))
  41373. },
  41374. updateMatrix: function() {
  41375. this.matrix.compose(this.position, this.quaternion, this.scale),
  41376. this.matrixWorldNeedsUpdate = !0
  41377. },
  41378. updateMatrixWorld: function(e) {
  41379. !0 === this.matrixAutoUpdate && this.updateMatrix(),
  41380. !0 !== this.matrixWorldNeedsUpdate && !0 !== e || (null === this.parent ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix),
  41381. e = !(this.matrixWorldNeedsUpdate = !1));
  41382. for (var t = 0, i = this.children.length; t < i; t++)
  41383. this.children[t].updateMatrixWorld(e)
  41384. },
  41385. toJSON: function(e) {
  41386. function t(e) {
  41387. var t = [];
  41388. for (var i in e) {
  41389. var n = e[i];
  41390. delete n.metadata,
  41391. t.push(n)
  41392. }
  41393. return t
  41394. }
  41395. var i = void 0 === e
  41396. , n = {};
  41397. i && (e = {
  41398. geometries: {},
  41399. materials: {},
  41400. textures: {},
  41401. images: {}
  41402. },
  41403. n.metadata = {
  41404. version: 4.4,
  41405. type: "Object",
  41406. generator: "Object3D.toJSON"
  41407. });
  41408. var r = {};
  41409. if (r.uuid = this.uuid,
  41410. r.type = this.type,
  41411. "" !== this.name && (r.name = this.name),
  41412. "{}" !== JSON.stringify(this.userData) && (r.userData = this.userData),
  41413. !0 === this.castShadow && (r.castShadow = !0),
  41414. !0 === this.receiveShadow && (r.receiveShadow = !0),
  41415. !1 === this.visible && (r.visible = !1),
  41416. r.matrix = this.matrix.toArray(),
  41417. void 0 !== this.geometry && (void 0 === e.geometries[this.geometry.uuid] && (e.geometries[this.geometry.uuid] = this.geometry.toJSON(e)),
  41418. r.geometry = this.geometry.uuid),
  41419. void 0 !== this.material && (void 0 === e.materials[this.material.uuid] && (e.materials[this.material.uuid] = this.material.toJSON(e)),
  41420. r.material = this.material.uuid),
  41421. 0 < this.children.length) {
  41422. r.children = [];
  41423. for (var o = 0; o < this.children.length; o++)
  41424. r.children.push(this.children[o].toJSON(e).object)
  41425. }
  41426. if (i) {
  41427. var a = t(e.geometries)
  41428. , s = t(e.materials)
  41429. , l = t(e.textures)
  41430. , c = t(e.images);
  41431. 0 < a.length && (n.geometries = a),
  41432. 0 < s.length && (n.materials = s),
  41433. 0 < l.length && (n.textures = l),
  41434. 0 < c.length && (n.images = c)
  41435. }
  41436. return n.object = r,
  41437. n
  41438. },
  41439. clone: function(e) {
  41440. return (new this.constructor).copy(this, e)
  41441. },
  41442. copy: function(e, t) {
  41443. if (void 0 === t && (t = !0),
  41444. this.name = e.name,
  41445. this.up.copy(e.up),
  41446. this.position.copy(e.position),
  41447. this.quaternion.copy(e.quaternion),
  41448. this.scale.copy(e.scale),
  41449. this.rotationAutoUpdate = e.rotationAutoUpdate,
  41450. this.matrix.copy(e.matrix),
  41451. this.matrixWorld.copy(e.matrixWorld),
  41452. this.matrixAutoUpdate = e.matrixAutoUpdate,
  41453. this.matrixWorldNeedsUpdate = e.matrixWorldNeedsUpdate,
  41454. this.visible = e.visible,
  41455. this.castShadow = e.castShadow,
  41456. this.receiveShadow = e.receiveShadow,
  41457. this.frustumCulled = e.frustumCulled,
  41458. this.renderOrder = e.renderOrder,
  41459. this.userData = JSON.parse(JSON.stringify(e.userData)),
  41460. !0 === t)
  41461. for (var i = 0; i < e.children.length; i++) {
  41462. var n = e.children[i];
  41463. this.add(n.clone())
  41464. }
  41465. return this
  41466. }
  41467. },
  41468. Ci.EventDispatcher.prototype.apply(Ci.Object3D.prototype),
  41469. Ci.Object3DIdCount = 0,
  41470. Ci.Face3 = function(e, t, i, n, r, o) {
  41471. this.a = e,
  41472. this.b = t,
  41473. this.c = i,
  41474. this.normal = n instanceof Ci.Vector3 ? n : new Ci.Vector3,
  41475. this.vertexNormals = Array.isArray(n) ? n : [],
  41476. this.color = r instanceof Ci.Color ? r : new Ci.Color,
  41477. this.vertexColors = Array.isArray(r) ? r : [],
  41478. this.materialIndex = void 0 !== o ? o : 0
  41479. }
  41480. ,
  41481. Ci.Face3.prototype = {
  41482. constructor: Ci.Face3,
  41483. clone: function() {
  41484. return (new this.constructor).copy(this)
  41485. },
  41486. copy: function(e) {
  41487. this.a = e.a,
  41488. this.b = e.b,
  41489. this.c = e.c,
  41490. this.normal.copy(e.normal),
  41491. this.color.copy(e.color),
  41492. this.materialIndex = e.materialIndex;
  41493. for (var t = 0, i = e.vertexNormals.length; t < i; t++)
  41494. this.vertexNormals[t] = e.vertexNormals[t].clone();
  41495. for (t = 0,
  41496. i = e.vertexColors.length; t < i; t++)
  41497. this.vertexColors[t] = e.vertexColors[t].clone();
  41498. return this
  41499. }
  41500. },
  41501. Ci.BufferAttribute = function(e, t) {
  41502. this.uuid = Ci.Math.generateUUID(),
  41503. this.array = e,
  41504. this.itemSize = t,
  41505. this.dynamic = !1,
  41506. this.updateRange = {
  41507. offset: 0,
  41508. count: -1
  41509. },
  41510. this.version = 0
  41511. }
  41512. ,
  41513. Ci.BufferAttribute.prototype = {
  41514. constructor: Ci.BufferAttribute,
  41515. get count() {
  41516. return this.array.length / this.itemSize
  41517. },
  41518. set needsUpdate(e) {
  41519. !0 === e && this.version++
  41520. },
  41521. setDynamic: function(e) {
  41522. return this.dynamic = e,
  41523. this
  41524. },
  41525. copy: function(e) {
  41526. return this.array = new e.array.constructor(e.array),
  41527. this.itemSize = e.itemSize,
  41528. this.dynamic = e.dynamic,
  41529. this
  41530. },
  41531. copyAt: function(e, t, i) {
  41532. e *= this.itemSize,
  41533. i *= t.itemSize;
  41534. for (var n = 0, r = this.itemSize; n < r; n++)
  41535. this.array[e + n] = t.array[i + n];
  41536. return this
  41537. },
  41538. copyArray: function(e) {
  41539. return this.array.set(e),
  41540. this
  41541. },
  41542. copyColorsArray: function(e) {
  41543. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41544. var o = e[n];
  41545. void 0 === o && (console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined", n),
  41546. o = new Ci.Color),
  41547. t[i++] = o.r,
  41548. t[i++] = o.g,
  41549. t[i++] = o.b
  41550. }
  41551. return this
  41552. },
  41553. copyIndicesArray: function(e) {
  41554. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41555. var o = e[n];
  41556. t[i++] = o.a,
  41557. t[i++] = o.b,
  41558. t[i++] = o.c
  41559. }
  41560. return this
  41561. },
  41562. copyVector2sArray: function(e) {
  41563. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41564. var o = e[n];
  41565. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined", n),
  41566. o = new Ci.Vector2),
  41567. t[i++] = o.x,
  41568. t[i++] = o.y
  41569. }
  41570. return this
  41571. },
  41572. copyVector3sArray: function(e) {
  41573. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41574. var o = e[n];
  41575. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined", n),
  41576. o = new Ci.Vector3),
  41577. t[i++] = o.x,
  41578. t[i++] = o.y,
  41579. t[i++] = o.z
  41580. }
  41581. return this
  41582. },
  41583. copyVector4sArray: function(e) {
  41584. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41585. var o = e[n];
  41586. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined", n),
  41587. o = new Ci.Vector4),
  41588. t[i++] = o.x,
  41589. t[i++] = o.y,
  41590. t[i++] = o.z,
  41591. t[i++] = o.w
  41592. }
  41593. return this
  41594. },
  41595. set: function(e, t) {
  41596. return void 0 === t && (t = 0),
  41597. this.array.set(e, t),
  41598. this
  41599. },
  41600. getX: function(e) {
  41601. return this.array[e * this.itemSize]
  41602. },
  41603. setX: function(e, t) {
  41604. return this.array[e * this.itemSize] = t,
  41605. this
  41606. },
  41607. getY: function(e) {
  41608. return this.array[e * this.itemSize + 1]
  41609. },
  41610. setY: function(e, t) {
  41611. return this.array[e * this.itemSize + 1] = t,
  41612. this
  41613. },
  41614. getZ: function(e) {
  41615. return this.array[e * this.itemSize + 2]
  41616. },
  41617. setZ: function(e, t) {
  41618. return this.array[e * this.itemSize + 2] = t,
  41619. this
  41620. },
  41621. getW: function(e) {
  41622. return this.array[e * this.itemSize + 3]
  41623. },
  41624. setW: function(e, t) {
  41625. return this.array[e * this.itemSize + 3] = t,
  41626. this
  41627. },
  41628. setXY: function(e, t, i) {
  41629. return e *= this.itemSize,
  41630. this.array[e + 0] = t,
  41631. this.array[e + 1] = i,
  41632. this
  41633. },
  41634. setXYZ: function(e, t, i, n) {
  41635. return e *= this.itemSize,
  41636. this.array[e + 0] = t,
  41637. this.array[e + 1] = i,
  41638. this.array[e + 2] = n,
  41639. this
  41640. },
  41641. setXYZW: function(e, t, i, n, r) {
  41642. return e *= this.itemSize,
  41643. this.array[e + 0] = t,
  41644. this.array[e + 1] = i,
  41645. this.array[e + 2] = n,
  41646. this.array[e + 3] = r,
  41647. this
  41648. },
  41649. clone: function() {
  41650. return (new this.constructor).copy(this)
  41651. }
  41652. },
  41653. Ci.Int8Attribute = function(e, t) {
  41654. return new Ci.BufferAttribute(new Int8Array(e),t)
  41655. }
  41656. ,
  41657. Ci.Uint8Attribute = function(e, t) {
  41658. return new Ci.BufferAttribute(new Uint8Array(e),t)
  41659. }
  41660. ,
  41661. Ci.Uint8ClampedAttribute = function(e, t) {
  41662. return new Ci.BufferAttribute(new Uint8ClampedArray(e),t)
  41663. }
  41664. ,
  41665. Ci.Int16Attribute = function(e, t) {
  41666. return new Ci.BufferAttribute(new Int16Array(e),t)
  41667. }
  41668. ,
  41669. Ci.Uint16Attribute = function(e, t) {
  41670. return new Ci.BufferAttribute(new Uint16Array(e),t)
  41671. }
  41672. ,
  41673. Ci.Int32Attribute = function(e, t) {
  41674. return new Ci.BufferAttribute(new Int32Array(e),t)
  41675. }
  41676. ,
  41677. Ci.Uint32Attribute = function(e, t) {
  41678. return new Ci.BufferAttribute(new Uint32Array(e),t)
  41679. }
  41680. ,
  41681. Ci.Float32Attribute = function(e, t) {
  41682. return new Ci.BufferAttribute(new Float32Array(e),t)
  41683. }
  41684. ,
  41685. Ci.Float64Attribute = function(e, t) {
  41686. return new Ci.BufferAttribute(new Float64Array(e),t)
  41687. }
  41688. ,
  41689. Ci.DynamicBufferAttribute = function(e, t) {
  41690. return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),
  41691. new Ci.BufferAttribute(e,t).setDynamic(!0)
  41692. }
  41693. ,
  41694. Ci.InstancedBufferAttribute = function(e, t, i) {
  41695. Ci.BufferAttribute.call(this, e, t),
  41696. this.meshPerAttribute = i || 1
  41697. }
  41698. ,
  41699. Ci.InstancedBufferAttribute.prototype = Object.create(Ci.BufferAttribute.prototype),
  41700. Ci.InstancedBufferAttribute.prototype.constructor = Ci.InstancedBufferAttribute,
  41701. Ci.InstancedBufferAttribute.prototype.copy = function(e) {
  41702. return Ci.BufferAttribute.prototype.copy.call(this, e),
  41703. this.meshPerAttribute = e.meshPerAttribute,
  41704. this
  41705. }
  41706. ,
  41707. Ci.InterleavedBuffer = function(e, t) {
  41708. this.uuid = Ci.Math.generateUUID(),
  41709. this.array = e,
  41710. this.stride = t,
  41711. this.dynamic = !1,
  41712. this.updateRange = {
  41713. offset: 0,
  41714. count: -1
  41715. },
  41716. this.version = 0
  41717. }
  41718. ,
  41719. Ci.InterleavedBuffer.prototype = {
  41720. constructor: Ci.InterleavedBuffer,
  41721. get length() {
  41722. return this.array.length
  41723. },
  41724. get count() {
  41725. return this.array.length / this.stride
  41726. },
  41727. set needsUpdate(e) {
  41728. !0 === e && this.version++
  41729. },
  41730. setDynamic: function(e) {
  41731. return this.dynamic = e,
  41732. this
  41733. },
  41734. copy: function(e) {
  41735. return this.array = new e.array.constructor(e.array),
  41736. this.stride = e.stride,
  41737. this.dynamic = e.dynamic,
  41738. this
  41739. },
  41740. copyAt: function(e, t, i) {
  41741. e *= this.stride,
  41742. i *= t.stride;
  41743. for (var n = 0, r = this.stride; n < r; n++)
  41744. this.array[e + n] = t.array[i + n];
  41745. return this
  41746. },
  41747. set: function(e, t) {
  41748. return void 0 === t && (t = 0),
  41749. this.array.set(e, t),
  41750. this
  41751. },
  41752. clone: function() {
  41753. return (new this.constructor).copy(this)
  41754. }
  41755. },
  41756. Ci.InstancedInterleavedBuffer = function(e, t, i) {
  41757. Ci.InterleavedBuffer.call(this, e, t),
  41758. this.meshPerAttribute = i || 1
  41759. }
  41760. ,
  41761. Ci.InstancedInterleavedBuffer.prototype = Object.create(Ci.InterleavedBuffer.prototype),
  41762. Ci.InstancedInterleavedBuffer.prototype.constructor = Ci.InstancedInterleavedBuffer,
  41763. Ci.InstancedInterleavedBuffer.prototype.copy = function(e) {
  41764. return Ci.InterleavedBuffer.prototype.copy.call(this, e),
  41765. this.meshPerAttribute = e.meshPerAttribute,
  41766. this
  41767. }
  41768. ,
  41769. Ci.InterleavedBufferAttribute = function(e, t, i) {
  41770. this.uuid = Ci.Math.generateUUID(),
  41771. this.data = e,
  41772. this.itemSize = t,
  41773. this.offset = i
  41774. }
  41775. ,
  41776. Ci.InterleavedBufferAttribute.prototype = {
  41777. constructor: Ci.InterleavedBufferAttribute,
  41778. get length() {
  41779. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  41780. this.array.length
  41781. },
  41782. get count() {
  41783. return this.data.count
  41784. },
  41785. setX: function(e, t) {
  41786. return this.data.array[e * this.data.stride + this.offset] = t,
  41787. this
  41788. },
  41789. setY: function(e, t) {
  41790. return this.data.array[e * this.data.stride + this.offset + 1] = t,
  41791. this
  41792. },
  41793. setZ: function(e, t) {
  41794. return this.data.array[e * this.data.stride + this.offset + 2] = t,
  41795. this
  41796. },
  41797. setW: function(e, t) {
  41798. return this.data.array[e * this.data.stride + this.offset + 3] = t,
  41799. this
  41800. },
  41801. getX: function(e) {
  41802. return this.data.array[e * this.data.stride + this.offset]
  41803. },
  41804. getY: function(e) {
  41805. return this.data.array[e * this.data.stride + this.offset + 1]
  41806. },
  41807. getZ: function(e) {
  41808. return this.data.array[e * this.data.stride + this.offset + 2]
  41809. },
  41810. getW: function(e) {
  41811. return this.data.array[e * this.data.stride + this.offset + 3]
  41812. },
  41813. setXY: function(e, t, i) {
  41814. return e = e * this.data.stride + this.offset,
  41815. this.data.array[e + 0] = t,
  41816. this.data.array[e + 1] = i,
  41817. this
  41818. },
  41819. setXYZ: function(e, t, i, n) {
  41820. return e = e * this.data.stride + this.offset,
  41821. this.data.array[e + 0] = t,
  41822. this.data.array[e + 1] = i,
  41823. this.data.array[e + 2] = n,
  41824. this
  41825. },
  41826. setXYZW: function(e, t, i, n, r) {
  41827. return e = e * this.data.stride + this.offset,
  41828. this.data.array[e + 0] = t,
  41829. this.data.array[e + 1] = i,
  41830. this.data.array[e + 2] = n,
  41831. this.data.array[e + 3] = r,
  41832. this
  41833. }
  41834. },
  41835. Ci.Geometry = function() {
  41836. Object.defineProperty(this, "id", {
  41837. value: Ci.GeometryIdCount++
  41838. }),
  41839. this.uuid = Ci.Math.generateUUID(),
  41840. this.name = "",
  41841. this.type = "Geometry",
  41842. this.vertices = [],
  41843. this.colors = [],
  41844. this.faces = [],
  41845. this.faceVertexUvs = [[]],
  41846. this.morphTargets = [],
  41847. this.morphNormals = [],
  41848. this.skinWeights = [],
  41849. this.skinIndices = [],
  41850. this.lineDistances = [],
  41851. this.boundingBox = null,
  41852. this.boundingSphere = null,
  41853. this.verticesNeedUpdate = !1,
  41854. this.elementsNeedUpdate = !1,
  41855. this.uvsNeedUpdate = !1,
  41856. this.normalsNeedUpdate = !1,
  41857. this.colorsNeedUpdate = !1,
  41858. this.lineDistancesNeedUpdate = !1,
  41859. this.groupsNeedUpdate = !1
  41860. }
  41861. ,
  41862. Ci.Geometry.prototype = {
  41863. constructor: Ci.Geometry,
  41864. applyMatrix: function(e) {
  41865. for (var t = (new Ci.Matrix3).getNormalMatrix(e), i = 0, n = this.vertices.length; i < n; i++) {
  41866. this.vertices[i].applyMatrix4(e)
  41867. }
  41868. for (i = 0,
  41869. n = this.faces.length; i < n; i++) {
  41870. var r = this.faces[i];
  41871. r.normal.applyMatrix3(t).normalize();
  41872. for (var o = 0, a = r.vertexNormals.length; o < a; o++)
  41873. r.vertexNormals[o].applyMatrix3(t).normalize()
  41874. }
  41875. return null !== this.boundingBox && this.computeBoundingBox(),
  41876. null !== this.boundingSphere && this.computeBoundingSphere(),
  41877. this.verticesNeedUpdate = !0,
  41878. this.normalsNeedUpdate = !0,
  41879. this
  41880. },
  41881. rotateX: function(e) {
  41882. return void 0 === mt && (mt = new Ci.Matrix4),
  41883. mt.makeRotationX(e),
  41884. this.applyMatrix(mt),
  41885. this
  41886. },
  41887. rotateY: function(e) {
  41888. return void 0 === gt && (gt = new Ci.Matrix4),
  41889. gt.makeRotationY(e),
  41890. this.applyMatrix(gt),
  41891. this
  41892. },
  41893. rotateZ: function(e) {
  41894. return void 0 === ft && (ft = new Ci.Matrix4),
  41895. ft.makeRotationZ(e),
  41896. this.applyMatrix(ft),
  41897. this
  41898. },
  41899. translate: function(e, t, i) {
  41900. return void 0 === pt && (pt = new Ci.Matrix4),
  41901. pt.makeTranslation(e, t, i),
  41902. this.applyMatrix(pt),
  41903. this
  41904. },
  41905. scale: function(e, t, i) {
  41906. return void 0 === dt && (dt = new Ci.Matrix4),
  41907. dt.makeScale(e, t, i),
  41908. this.applyMatrix(dt),
  41909. this
  41910. },
  41911. lookAt: function(e) {
  41912. void 0 === ut && (ut = new Ci.Object3D),
  41913. ut.lookAt(e),
  41914. ut.updateMatrix(),
  41915. this.applyMatrix(ut.matrix)
  41916. },
  41917. fromBufferGeometry: function(e) {
  41918. function t(e, t, i, n) {
  41919. var r = void 0 !== l ? [d[e].clone(), d[t].clone(), d[i].clone()] : []
  41920. , o = void 0 !== c ? [s.colors[e].clone(), s.colors[t].clone(), s.colors[i].clone()] : []
  41921. , a = new Ci.Face3(e,t,i,r,o,n);
  41922. s.faces.push(a),
  41923. void 0 !== h && s.faceVertexUvs[0].push([p[e].clone(), p[t].clone(), p[i].clone()]),
  41924. void 0 !== u && s.faceVertexUvs[1].push([f[e].clone(), f[t].clone(), f[i].clone()])
  41925. }
  41926. var s = this
  41927. , i = null !== e.index ? e.index.array : void 0
  41928. , n = e.attributes
  41929. , r = n.position.array
  41930. , l = void 0 !== n.normal ? n.normal.array : void 0
  41931. , c = void 0 !== n.color ? n.color.array : void 0
  41932. , h = void 0 !== n.uv ? n.uv.array : void 0
  41933. , u = void 0 !== n.uv2 ? n.uv2.array : void 0;
  41934. void 0 !== u && (this.faceVertexUvs[1] = []);
  41935. for (var d = [], p = [], f = [], o = 0, a = 0; o < r.length; o += 3,
  41936. a += 2)
  41937. s.vertices.push(new Ci.Vector3(r[o],r[o + 1],r[o + 2])),
  41938. void 0 !== l && d.push(new Ci.Vector3(l[o],l[o + 1],l[o + 2])),
  41939. void 0 !== c && s.colors.push(new Ci.Color(c[o],c[o + 1],c[o + 2])),
  41940. void 0 !== h && p.push(new Ci.Vector2(h[a],h[a + 1])),
  41941. void 0 !== u && f.push(new Ci.Vector2(u[a],u[a + 1]));
  41942. if (void 0 !== i) {
  41943. var g = e.groups;
  41944. if (0 < g.length)
  41945. for (o = 0; o < g.length; o++)
  41946. for (var m = g[o], v = m.start, y = (a = v,
  41947. v + m.count); a < y; a += 3)
  41948. t(i[a], i[a + 1], i[a + 2], m.materialIndex);
  41949. else
  41950. for (o = 0; o < i.length; o += 3)
  41951. t(i[o], i[o + 1], i[o + 2])
  41952. } else
  41953. for (o = 0; o < r.length / 3; o += 3)
  41954. t(o, o + 1, o + 2);
  41955. return this.computeFaceNormals(),
  41956. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  41957. null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  41958. this
  41959. },
  41960. center: function() {
  41961. this.computeBoundingBox();
  41962. var e = this.boundingBox.center().negate();
  41963. return this.translate(e.x, e.y, e.z),
  41964. e
  41965. },
  41966. normalize: function() {
  41967. this.computeBoundingSphere();
  41968. var e = this.boundingSphere.center
  41969. , t = this.boundingSphere.radius
  41970. , i = 0 === t ? 1 : 1 / t
  41971. , n = new Ci.Matrix4;
  41972. return n.set(i, 0, 0, -i * e.x, 0, i, 0, -i * e.y, 0, 0, i, -i * e.z, 0, 0, 0, 1),
  41973. this.applyMatrix(n),
  41974. this
  41975. },
  41976. computeFaceNormals: function() {
  41977. for (var e = new Ci.Vector3, t = new Ci.Vector3, i = 0, n = this.faces.length; i < n; i++) {
  41978. var r = this.faces[i]
  41979. , o = this.vertices[r.a]
  41980. , a = this.vertices[r.b]
  41981. , s = this.vertices[r.c];
  41982. e.subVectors(s, a),
  41983. t.subVectors(o, a),
  41984. e.cross(t),
  41985. e.normalize(),
  41986. r.normal.copy(e)
  41987. }
  41988. },
  41989. computeVertexNormals: function(e) {
  41990. var t, i, n, r, o, a;
  41991. for (void 0 === e && (e = !0),
  41992. a = new Array(this.vertices.length),
  41993. t = 0,
  41994. i = this.vertices.length; t < i; t++)
  41995. a[t] = new Ci.Vector3;
  41996. if (e) {
  41997. var s, l, c, h = new Ci.Vector3, u = new Ci.Vector3;
  41998. for (n = 0,
  41999. r = this.faces.length; n < r; n++)
  42000. o = this.faces[n],
  42001. s = this.vertices[o.a],
  42002. l = this.vertices[o.b],
  42003. c = this.vertices[o.c],
  42004. h.subVectors(c, l),
  42005. u.subVectors(s, l),
  42006. h.cross(u),
  42007. a[o.a].add(h),
  42008. a[o.b].add(h),
  42009. a[o.c].add(h)
  42010. } else
  42011. for (n = 0,
  42012. r = this.faces.length; n < r; n++)
  42013. a[(o = this.faces[n]).a].add(o.normal),
  42014. a[o.b].add(o.normal),
  42015. a[o.c].add(o.normal);
  42016. for (t = 0,
  42017. i = this.vertices.length; t < i; t++)
  42018. a[t].normalize();
  42019. for (n = 0,
  42020. r = this.faces.length; n < r; n++) {
  42021. var d = (o = this.faces[n]).vertexNormals;
  42022. 3 === d.length ? (d[0].copy(a[o.a]),
  42023. d[1].copy(a[o.b]),
  42024. d[2].copy(a[o.c])) : (d[0] = a[o.a].clone(),
  42025. d[1] = a[o.b].clone(),
  42026. d[2] = a[o.c].clone())
  42027. }
  42028. 0 < this.faces.length && (this.normalsNeedUpdate = !0)
  42029. },
  42030. computeMorphNormals: function() {
  42031. var e, t, i, n, r;
  42032. for (i = 0,
  42033. n = this.faces.length; i < n; i++)
  42034. for ((r = this.faces[i]).__originalFaceNormal ? r.__originalFaceNormal.copy(r.normal) : r.__originalFaceNormal = r.normal.clone(),
  42035. r.__originalVertexNormals || (r.__originalVertexNormals = []),
  42036. e = 0,
  42037. t = r.vertexNormals.length; e < t; e++)
  42038. r.__originalVertexNormals[e] ? r.__originalVertexNormals[e].copy(r.vertexNormals[e]) : r.__originalVertexNormals[e] = r.vertexNormals[e].clone();
  42039. var o = new Ci.Geometry;
  42040. for (o.faces = this.faces,
  42041. e = 0,
  42042. t = this.morphTargets.length; e < t; e++) {
  42043. if (!this.morphNormals[e]) {
  42044. this.morphNormals[e] = {},
  42045. this.morphNormals[e].faceNormals = [],
  42046. this.morphNormals[e].vertexNormals = [];
  42047. var a = this.morphNormals[e].faceNormals
  42048. , s = this.morphNormals[e].vertexNormals;
  42049. for (i = 0,
  42050. n = this.faces.length; i < n; i++)
  42051. l = new Ci.Vector3,
  42052. c = {
  42053. a: new Ci.Vector3,
  42054. b: new Ci.Vector3,
  42055. c: new Ci.Vector3
  42056. },
  42057. a.push(l),
  42058. s.push(c)
  42059. }
  42060. var l, c, h = this.morphNormals[e];
  42061. for (o.vertices = this.morphTargets[e].vertices,
  42062. o.computeFaceNormals(),
  42063. o.computeVertexNormals(),
  42064. i = 0,
  42065. n = this.faces.length; i < n; i++)
  42066. r = this.faces[i],
  42067. l = h.faceNormals[i],
  42068. c = h.vertexNormals[i],
  42069. l.copy(r.normal),
  42070. c.a.copy(r.vertexNormals[0]),
  42071. c.b.copy(r.vertexNormals[1]),
  42072. c.c.copy(r.vertexNormals[2])
  42073. }
  42074. for (i = 0,
  42075. n = this.faces.length; i < n; i++)
  42076. (r = this.faces[i]).normal = r.__originalFaceNormal,
  42077. r.vertexNormals = r.__originalVertexNormals
  42078. },
  42079. computeTangents: function() {
  42080. console.warn("THREE.Geometry: .computeTangents() has been removed.")
  42081. },
  42082. computeLineDistances: function() {
  42083. for (var e = 0, t = this.vertices, i = 0, n = t.length; i < n; i++)
  42084. 0 < i && (e += t[i].distanceTo(t[i - 1])),
  42085. this.lineDistances[i] = e
  42086. },
  42087. computeBoundingBox: function() {
  42088. null === this.boundingBox && (this.boundingBox = new Ci.Box3),
  42089. this.boundingBox.setFromPoints(this.vertices)
  42090. },
  42091. computeBoundingSphere: function() {
  42092. null === this.boundingSphere && (this.boundingSphere = new Ci.Sphere),
  42093. this.boundingSphere.setFromPoints(this.vertices)
  42094. },
  42095. merge: function(e, t, i) {
  42096. if (e instanceof Ci.Geometry != 0) {
  42097. var n, r = this.vertices.length, o = this.vertices, a = e.vertices, s = this.faces, l = e.faces, c = this.faceVertexUvs[0], h = e.faceVertexUvs[0];
  42098. void 0 === i && (i = 0),
  42099. void 0 !== t && (n = (new Ci.Matrix3).getNormalMatrix(t));
  42100. for (var u = 0, d = a.length; u < d; u++) {
  42101. var p = a[u].clone();
  42102. void 0 !== t && p.applyMatrix4(t),
  42103. o.push(p)
  42104. }
  42105. for (u = 0,
  42106. d = l.length; u < d; u++) {
  42107. var f, g, m, v = l[u], y = v.vertexNormals, A = v.vertexColors;
  42108. (f = new Ci.Face3(v.a + r,v.b + r,v.c + r)).normal.copy(v.normal),
  42109. void 0 !== n && f.normal.applyMatrix3(n).normalize();
  42110. for (var C = 0, I = y.length; C < I; C++)
  42111. g = y[C].clone(),
  42112. void 0 !== n && g.applyMatrix3(n).normalize(),
  42113. f.vertexNormals.push(g);
  42114. f.color.copy(v.color);
  42115. for (C = 0,
  42116. I = A.length; C < I; C++)
  42117. m = A[C],
  42118. f.vertexColors.push(m.clone());
  42119. f.materialIndex = v.materialIndex + i,
  42120. s.push(f)
  42121. }
  42122. for (u = 0,
  42123. d = h.length; u < d; u++) {
  42124. var E = h[u]
  42125. , _ = [];
  42126. if (void 0 !== E) {
  42127. for (C = 0,
  42128. I = E.length; C < I; C++)
  42129. _.push(E[C].clone());
  42130. c.push(_)
  42131. }
  42132. }
  42133. } else
  42134. console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.", e)
  42135. },
  42136. mergeMesh: function(e) {
  42137. return e instanceof Ci.Mesh == 0 ? void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.", e) : (e.matrixAutoUpdate && e.updateMatrix(),
  42138. void this.merge(e.geometry, e.matrix))
  42139. },
  42140. mergeVertices: function() {
  42141. var e, t, i, n, r, o, a, s, l = {}, c = [], h = [], u = Math.pow(10, 4);
  42142. for (i = 0,
  42143. n = this.vertices.length; i < n; i++)
  42144. e = this.vertices[i],
  42145. void 0 === l[t = Math.round(e.x * u) + "_" + Math.round(e.y * u) + "_" + Math.round(e.z * u)] ? (l[t] = i,
  42146. c.push(this.vertices[i]),
  42147. h[i] = c.length - 1) : h[i] = h[l[t]];
  42148. var d = [];
  42149. for (i = 0,
  42150. n = this.faces.length; i < n; i++) {
  42151. (r = this.faces[i]).a = h[r.a],
  42152. r.b = h[r.b],
  42153. r.c = h[r.c],
  42154. o = [r.a, r.b, r.c];
  42155. for (var p = 0; p < 3; p++)
  42156. if (o[p] === o[(p + 1) % 3]) {
  42157. p,
  42158. d.push(i);
  42159. break
  42160. }
  42161. }
  42162. for (i = d.length - 1; 0 <= i; i--) {
  42163. var f = d[i];
  42164. for (this.faces.splice(f, 1),
  42165. a = 0,
  42166. s = this.faceVertexUvs.length; a < s; a++)
  42167. this.faceVertexUvs[a].splice(f, 1)
  42168. }
  42169. var g = this.vertices.length - c.length;
  42170. return this.vertices = c,
  42171. g
  42172. },
  42173. sortFacesByMaterialIndex: function() {
  42174. for (var e = this.faces, t = e.length, i = 0; i < t; i++)
  42175. e[i]._id = i;
  42176. e.sort(function(e, t) {
  42177. return e.materialIndex - t.materialIndex
  42178. });
  42179. var n, r, o = this.faceVertexUvs[0], a = this.faceVertexUvs[1];
  42180. o && o.length === t && (n = []),
  42181. a && a.length === t && (r = []);
  42182. for (i = 0; i < t; i++) {
  42183. var s = e[i]._id;
  42184. n && n.push(o[s]),
  42185. r && r.push(a[s])
  42186. }
  42187. n && (this.faceVertexUvs[0] = n),
  42188. r && (this.faceVertexUvs[1] = r)
  42189. },
  42190. toJSON: function() {
  42191. function e(e, t, i) {
  42192. return i ? e | 1 << t : e & ~(1 << t)
  42193. }
  42194. function t(e) {
  42195. var t = e.x.toString() + e.y.toString() + e.z.toString();
  42196. return void 0 !== d[t] || (d[t] = u.length / 3,
  42197. u.push(e.x, e.y, e.z)),
  42198. d[t]
  42199. }
  42200. function i(e) {
  42201. var t = e.r.toString() + e.g.toString() + e.b.toString();
  42202. return void 0 !== f[t] || (f[t] = p.length,
  42203. p.push(e.getHex())),
  42204. f[t]
  42205. }
  42206. function n(e) {
  42207. var t = e.x.toString() + e.y.toString();
  42208. return void 0 !== m[t] || (m[t] = g.length / 2,
  42209. g.push(e.x, e.y)),
  42210. m[t]
  42211. }
  42212. var r = {
  42213. metadata: {
  42214. version: 4.4,
  42215. type: "Geometry",
  42216. generator: "Geometry.toJSON"
  42217. }
  42218. };
  42219. if (r.uuid = this.uuid,
  42220. r.type = this.type,
  42221. "" !== this.name && (r.name = this.name),
  42222. void 0 !== this.parameters) {
  42223. var o = this.parameters;
  42224. for (var a in o)
  42225. void 0 !== o[a] && (r[a] = o[a]);
  42226. return r
  42227. }
  42228. for (var s = [], l = 0; l < this.vertices.length; l++) {
  42229. var c = this.vertices[l];
  42230. s.push(c.x, c.y, c.z)
  42231. }
  42232. var h = []
  42233. , u = []
  42234. , d = {}
  42235. , p = []
  42236. , f = {}
  42237. , g = []
  42238. , m = {};
  42239. for (l = 0; l < this.faces.length; l++) {
  42240. var v = this.faces[l]
  42241. , y = void 0 !== this.faceVertexUvs[0][l]
  42242. , A = 0 < v.normal.length()
  42243. , C = 0 < v.vertexNormals.length
  42244. , I = 1 !== v.color.r || 1 !== v.color.g || 1 !== v.color.b
  42245. , E = 0 < v.vertexColors.length
  42246. , _ = 0;
  42247. if (_ = e(_ = e(_ = e(_ = e(_ = e(_ = e(_ = e(_ = e(_, 0, 0), 1, !0), 2, !1), 3, y), 4, A), 5, C), 6, I), 7, E),
  42248. h.push(_),
  42249. h.push(v.a, v.b, v.c),
  42250. h.push(v.materialIndex),
  42251. y) {
  42252. var b = this.faceVertexUvs[0][l];
  42253. h.push(n(b[0]), n(b[1]), n(b[2]))
  42254. }
  42255. if (A && h.push(t(v.normal)),
  42256. C) {
  42257. var w = v.vertexNormals;
  42258. h.push(t(w[0]), t(w[1]), t(w[2]))
  42259. }
  42260. if (I && h.push(i(v.color)),
  42261. E) {
  42262. var T = v.vertexColors;
  42263. h.push(i(T[0]), i(T[1]), i(T[2]))
  42264. }
  42265. }
  42266. return r.data = {},
  42267. r.data.vertices = s,
  42268. r.data.normals = u,
  42269. 0 < p.length && (r.data.colors = p),
  42270. 0 < g.length && (r.data.uvs = [g]),
  42271. r.data.faces = h,
  42272. r
  42273. },
  42274. clone: function() {
  42275. return (new Ci.Geometry).copy(this)
  42276. },
  42277. copy: function(e) {
  42278. this.vertices = [],
  42279. this.faces = [],
  42280. this.faceVertexUvs = [[]];
  42281. for (var t = e.vertices, i = 0, n = t.length; i < n; i++)
  42282. this.vertices.push(t[i].clone());
  42283. var r = e.faces;
  42284. for (i = 0,
  42285. n = r.length; i < n; i++)
  42286. this.faces.push(r[i].clone());
  42287. for (i = 0,
  42288. n = e.faceVertexUvs.length; i < n; i++) {
  42289. var o = e.faceVertexUvs[i];
  42290. void 0 === this.faceVertexUvs[i] && (this.faceVertexUvs[i] = []);
  42291. for (var a = 0, s = o.length; a < s; a++) {
  42292. for (var l = o[a], c = [], h = 0, u = l.length; h < u; h++) {
  42293. var d = l[h];
  42294. c.push(d.clone())
  42295. }
  42296. this.faceVertexUvs[i].push(c)
  42297. }
  42298. }
  42299. return this
  42300. },
  42301. dispose: function() {
  42302. this.dispatchEvent({
  42303. type: "dispose"
  42304. })
  42305. }
  42306. },
  42307. Ci.EventDispatcher.prototype.apply(Ci.Geometry.prototype),
  42308. Ci.GeometryIdCount = 0,
  42309. Ci.DirectGeometry = function() {
  42310. Object.defineProperty(this, "id", {
  42311. value: Ci.GeometryIdCount++
  42312. }),
  42313. this.uuid = Ci.Math.generateUUID(),
  42314. this.name = "",
  42315. this.type = "DirectGeometry",
  42316. this.indices = [],
  42317. this.vertices = [],
  42318. this.normals = [],
  42319. this.colors = [],
  42320. this.uvs = [],
  42321. this.uvs2 = [],
  42322. this.groups = [],
  42323. this.morphTargets = {},
  42324. this.skinWeights = [],
  42325. this.skinIndices = [],
  42326. this.boundingBox = null,
  42327. this.boundingSphere = null,
  42328. this.verticesNeedUpdate = !1,
  42329. this.normalsNeedUpdate = !1,
  42330. this.colorsNeedUpdate = !1,
  42331. this.uvsNeedUpdate = !1,
  42332. this.groupsNeedUpdate = !1
  42333. }
  42334. ,
  42335. Ci.DirectGeometry.prototype = {
  42336. constructor: Ci.DirectGeometry,
  42337. computeBoundingBox: Ci.Geometry.prototype.computeBoundingBox,
  42338. computeBoundingSphere: Ci.Geometry.prototype.computeBoundingSphere,
  42339. computeFaceNormals: function() {
  42340. console.warn("THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.")
  42341. },
  42342. computeVertexNormals: function() {
  42343. console.warn("THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.")
  42344. },
  42345. computeGroups: function(e) {
  42346. for (var t, i, n = [], r = e.faces, o = 0; o < r.length; o++) {
  42347. var a = r[o];
  42348. a.materialIndex !== i && (i = a.materialIndex,
  42349. void 0 !== t && (t.count = 3 * o - t.start,
  42350. n.push(t)),
  42351. t = {
  42352. start: 3 * o,
  42353. materialIndex: i
  42354. })
  42355. }
  42356. void 0 !== t && (t.count = 3 * o - t.start,
  42357. n.push(t)),
  42358. this.groups = n
  42359. },
  42360. fromGeometry: function(e) {
  42361. var t, i = e.faces, n = e.vertices, r = e.faceVertexUvs, o = r[0] && 0 < r[0].length, a = r[1] && 0 < r[1].length, s = e.morphTargets, l = s.length;
  42362. if (0 < l) {
  42363. t = [];
  42364. for (var c = 0; c < l; c++)
  42365. t[c] = [];
  42366. this.morphTargets.position = t
  42367. }
  42368. var h, u = e.morphNormals, d = u.length;
  42369. if (0 < d) {
  42370. h = [];
  42371. for (c = 0; c < d; c++)
  42372. h[c] = [];
  42373. this.morphTargets.normal = h
  42374. }
  42375. var p = e.skinIndices
  42376. , f = e.skinWeights
  42377. , g = p.length === n.length
  42378. , m = f.length === n.length;
  42379. for (c = 0; c < i.length; c++) {
  42380. var v = i[c];
  42381. this.vertices.push(n[v.a], n[v.b], n[v.c]);
  42382. var y = v.vertexNormals;
  42383. if (3 === y.length)
  42384. this.normals.push(y[0], y[1], y[2]);
  42385. else {
  42386. var A = v.normal;
  42387. this.normals.push(A, A, A)
  42388. }
  42389. var C, I = v.vertexColors;
  42390. if (3 === I.length)
  42391. this.colors.push(I[0], I[1], I[2]);
  42392. else {
  42393. var E = v.color;
  42394. this.colors.push(E, E, E)
  42395. }
  42396. if (!0 === o)
  42397. void 0 !== (C = r[0][c]) ? this.uvs.push(C[0], C[1], C[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ", c),
  42398. this.uvs.push(new Ci.Vector2, new Ci.Vector2, new Ci.Vector2));
  42399. if (!0 === a)
  42400. void 0 !== (C = r[1][c]) ? this.uvs2.push(C[0], C[1], C[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ", c),
  42401. this.uvs2.push(new Ci.Vector2, new Ci.Vector2, new Ci.Vector2));
  42402. for (var _ = 0; _ < l; _++) {
  42403. var b = s[_].vertices;
  42404. t[_].push(b[v.a], b[v.b], b[v.c])
  42405. }
  42406. for (_ = 0; _ < d; _++) {
  42407. var w = u[_].vertexNormals[c];
  42408. h[_].push(w.a, w.b, w.c)
  42409. }
  42410. g && this.skinIndices.push(p[v.a], p[v.b], p[v.c]),
  42411. m && this.skinWeights.push(f[v.a], f[v.b], f[v.c])
  42412. }
  42413. return this.computeGroups(e),
  42414. this.verticesNeedUpdate = e.verticesNeedUpdate,
  42415. this.normalsNeedUpdate = e.normalsNeedUpdate,
  42416. this.colorsNeedUpdate = e.colorsNeedUpdate,
  42417. this.uvsNeedUpdate = e.uvsNeedUpdate,
  42418. this.groupsNeedUpdate = e.groupsNeedUpdate,
  42419. this
  42420. },
  42421. dispose: function() {
  42422. this.dispatchEvent({
  42423. type: "dispose"
  42424. })
  42425. }
  42426. },
  42427. Ci.EventDispatcher.prototype.apply(Ci.DirectGeometry.prototype),
  42428. Ci.BufferGeometry = function() {
  42429. Object.defineProperty(this, "id", {
  42430. value: Ci.GeometryIdCount++
  42431. }),
  42432. this.uuid = Ci.Math.generateUUID(),
  42433. this.name = "",
  42434. this.type = "BufferGeometry",
  42435. this.index = null,
  42436. this.attributes = {},
  42437. this.morphAttributes = {},
  42438. this.groups = [],
  42439. this.boundingBox = null,
  42440. this.boundingSphere = null,
  42441. this.drawRange = {
  42442. start: 0,
  42443. count: 1 / 0
  42444. }
  42445. }
  42446. ,
  42447. Ci.BufferGeometry.prototype = {
  42448. constructor: Ci.BufferGeometry,
  42449. getIndex: function() {
  42450. return this.index
  42451. },
  42452. setIndex: function(e) {
  42453. this.index = e
  42454. },
  42455. addAttribute: function(e, t) {
  42456. return t instanceof Ci.BufferAttribute == 0 && t instanceof Ci.InterleavedBufferAttribute == 0 ? (console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),
  42457. void this.addAttribute(e, new Ci.BufferAttribute(t,arguments[2]))) : "index" === e ? (console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),
  42458. void this.setIndex(t)) : (this.attributes[e] = t,
  42459. this)
  42460. },
  42461. getAttribute: function(e) {
  42462. return this.attributes[e]
  42463. },
  42464. removeAttribute: function(e) {
  42465. return delete this.attributes[e],
  42466. this
  42467. },
  42468. addGroup: function(e, t, i) {
  42469. this.groups.push({
  42470. start: e,
  42471. count: t,
  42472. materialIndex: void 0 !== i ? i : 0
  42473. })
  42474. },
  42475. clearGroups: function() {
  42476. this.groups = []
  42477. },
  42478. setDrawRange: function(e, t) {
  42479. this.drawRange.start = e,
  42480. this.drawRange.count = t
  42481. },
  42482. applyMatrix: function(e) {
  42483. var t = this.attributes.position;
  42484. void 0 !== t && (e.applyToVector3Array(t.array),
  42485. t.needsUpdate = !0);
  42486. var i = this.attributes.normal;
  42487. void 0 !== i && ((new Ci.Matrix3).getNormalMatrix(e).applyToVector3Array(i.array),
  42488. i.needsUpdate = !0);
  42489. return null !== this.boundingBox && this.computeBoundingBox(),
  42490. null !== this.boundingSphere && this.computeBoundingSphere(),
  42491. this
  42492. },
  42493. rotateX: function(e) {
  42494. return void 0 === ht && (ht = new Ci.Matrix4),
  42495. ht.makeRotationX(e),
  42496. this.applyMatrix(ht),
  42497. this
  42498. },
  42499. rotateY: function(e) {
  42500. return void 0 === ct && (ct = new Ci.Matrix4),
  42501. ct.makeRotationY(e),
  42502. this.applyMatrix(ct),
  42503. this
  42504. },
  42505. rotateZ: function(e) {
  42506. return void 0 === lt && (lt = new Ci.Matrix4),
  42507. lt.makeRotationZ(e),
  42508. this.applyMatrix(lt),
  42509. this
  42510. },
  42511. translate: function(e, t, i) {
  42512. return void 0 === st && (st = new Ci.Matrix4),
  42513. st.makeTranslation(e, t, i),
  42514. this.applyMatrix(st),
  42515. this
  42516. },
  42517. scale: function(e, t, i) {
  42518. return void 0 === at && (at = new Ci.Matrix4),
  42519. at.makeScale(e, t, i),
  42520. this.applyMatrix(at),
  42521. this
  42522. },
  42523. lookAt: function(e) {
  42524. void 0 === ot && (ot = new Ci.Object3D),
  42525. ot.lookAt(e),
  42526. ot.updateMatrix(),
  42527. this.applyMatrix(ot.matrix)
  42528. },
  42529. center: function() {
  42530. this.computeBoundingBox();
  42531. var e = this.boundingBox.center().negate();
  42532. return this.translate(e.x, e.y, e.z),
  42533. e
  42534. },
  42535. setFromObject: function(e) {
  42536. var t = e.geometry;
  42537. if (e instanceof Ci.Points || e instanceof Ci.Line) {
  42538. var i = new Ci.Float32Attribute(3 * t.vertices.length,3)
  42539. , n = new Ci.Float32Attribute(3 * t.colors.length,3);
  42540. if (this.addAttribute("position", i.copyVector3sArray(t.vertices)),
  42541. this.addAttribute("color", n.copyColorsArray(t.colors)),
  42542. t.lineDistances && t.lineDistances.length === t.vertices.length) {
  42543. var r = new Ci.Float32Attribute(t.lineDistances.length,1);
  42544. this.addAttribute("lineDistance", r.copyArray(t.lineDistances))
  42545. }
  42546. null !== t.boundingSphere && (this.boundingSphere = t.boundingSphere.clone()),
  42547. null !== t.boundingBox && (this.boundingBox = t.boundingBox.clone())
  42548. } else
  42549. e instanceof Ci.Mesh && t instanceof Ci.Geometry && this.fromGeometry(t);
  42550. return this
  42551. },
  42552. updateFromObject: function(e) {
  42553. var t, i = e.geometry;
  42554. if (e instanceof Ci.Mesh) {
  42555. var n = i.__directGeometry;
  42556. if (void 0 === n)
  42557. return this.fromGeometry(i);
  42558. n.verticesNeedUpdate = i.verticesNeedUpdate,
  42559. n.normalsNeedUpdate = i.normalsNeedUpdate,
  42560. n.colorsNeedUpdate = i.colorsNeedUpdate,
  42561. n.uvsNeedUpdate = i.uvsNeedUpdate,
  42562. n.groupsNeedUpdate = i.groupsNeedUpdate,
  42563. i.verticesNeedUpdate = !1,
  42564. i.normalsNeedUpdate = !1,
  42565. i.colorsNeedUpdate = !1,
  42566. i.uvsNeedUpdate = !1,
  42567. i.groupsNeedUpdate = !1,
  42568. i = n
  42569. }
  42570. !0 === i.verticesNeedUpdate && (void 0 !== (t = this.attributes.position) && (t.copyVector3sArray(i.vertices),
  42571. t.needsUpdate = !0),
  42572. i.verticesNeedUpdate = !1);
  42573. !0 === i.normalsNeedUpdate && (void 0 !== (t = this.attributes.normal) && (t.copyVector3sArray(i.normals),
  42574. t.needsUpdate = !0),
  42575. i.normalsNeedUpdate = !1);
  42576. !0 === i.colorsNeedUpdate && (void 0 !== (t = this.attributes.color) && (t.copyColorsArray(i.colors),
  42577. t.needsUpdate = !0),
  42578. i.colorsNeedUpdate = !1);
  42579. i.uvsNeedUpdate && (void 0 !== (t = this.attributes.uv) && (t.copyVector2sArray(i.uvs),
  42580. t.needsUpdate = !0),
  42581. i.uvsNeedUpdate = !1);
  42582. i.lineDistancesNeedUpdate && (void 0 !== (t = this.attributes.lineDistance) && (t.copyArray(i.lineDistances),
  42583. t.needsUpdate = !0),
  42584. i.lineDistancesNeedUpdate = !1);
  42585. return i.groupsNeedUpdate && (i.computeGroups(e.geometry),
  42586. this.groups = i.groups,
  42587. i.groupsNeedUpdate = !1),
  42588. this
  42589. },
  42590. fromGeometry: function(e) {
  42591. return e.__directGeometry = (new Ci.DirectGeometry).fromGeometry(e),
  42592. this.fromDirectGeometry(e.__directGeometry)
  42593. },
  42594. fromDirectGeometry: function(e) {
  42595. var t = new Float32Array(3 * e.vertices.length);
  42596. if (this.addAttribute("position", new Ci.BufferAttribute(t,3).copyVector3sArray(e.vertices)),
  42597. 0 < e.normals.length) {
  42598. var i = new Float32Array(3 * e.normals.length);
  42599. this.addAttribute("normal", new Ci.BufferAttribute(i,3).copyVector3sArray(e.normals))
  42600. }
  42601. if (0 < e.colors.length) {
  42602. var n = new Float32Array(3 * e.colors.length);
  42603. this.addAttribute("color", new Ci.BufferAttribute(n,3).copyColorsArray(e.colors))
  42604. }
  42605. if (0 < e.uvs.length) {
  42606. var r = new Float32Array(2 * e.uvs.length);
  42607. this.addAttribute("uv", new Ci.BufferAttribute(r,2).copyVector2sArray(e.uvs))
  42608. }
  42609. if (0 < e.uvs2.length) {
  42610. var o = new Float32Array(2 * e.uvs2.length);
  42611. this.addAttribute("uv2", new Ci.BufferAttribute(o,2).copyVector2sArray(e.uvs2))
  42612. }
  42613. if (0 < e.indices.length) {
  42614. var a = new (65535 < e.vertices.length ? Uint32Array : Uint16Array)(3 * e.indices.length);
  42615. this.setIndex(new Ci.BufferAttribute(a,1).copyIndicesArray(e.indices))
  42616. }
  42617. for (var s in this.groups = e.groups,
  42618. e.morphTargets) {
  42619. for (var l = [], c = e.morphTargets[s], h = 0, u = c.length; h < u; h++) {
  42620. var d = c[h]
  42621. , p = new Ci.Float32Attribute(3 * d.length,3);
  42622. l.push(p.copyVector3sArray(d))
  42623. }
  42624. this.morphAttributes[s] = l
  42625. }
  42626. if (0 < e.skinIndices.length) {
  42627. var f = new Ci.Float32Attribute(4 * e.skinIndices.length,4);
  42628. this.addAttribute("skinIndex", f.copyVector4sArray(e.skinIndices))
  42629. }
  42630. if (0 < e.skinWeights.length) {
  42631. var g = new Ci.Float32Attribute(4 * e.skinWeights.length,4);
  42632. this.addAttribute("skinWeight", g.copyVector4sArray(e.skinWeights))
  42633. }
  42634. return null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  42635. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  42636. this
  42637. },
  42638. computeBoundingBox: (new Ci.Vector3,
  42639. function() {
  42640. null === this.boundingBox && (this.boundingBox = new Ci.Box3);
  42641. var e = this.attributes.position.array;
  42642. e && this.boundingBox.setFromArray(e),
  42643. void 0 !== e && 0 !== e.length || (this.boundingBox.min.set(0, 0, 0),
  42644. this.boundingBox.max.set(0, 0, 0)),
  42645. (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)
  42646. }
  42647. ),
  42648. computeBoundingSphere: (nt = new Ci.Box3,
  42649. rt = new Ci.Vector3,
  42650. function() {
  42651. null === this.boundingSphere && (this.boundingSphere = new Ci.Sphere);
  42652. var e = this.attributes.position.array;
  42653. if (e) {
  42654. var t = this.boundingSphere.center;
  42655. nt.setFromArray(e),
  42656. nt.center(t);
  42657. for (var i = 0, n = 0, r = e.length; n < r; n += 3)
  42658. rt.fromArray(e, n),
  42659. i = Math.max(i, t.distanceToSquared(rt));
  42660. this.boundingSphere.radius = Math.sqrt(i),
  42661. isNaN(this.boundingSphere.radius) && console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this)
  42662. }
  42663. }
  42664. ),
  42665. computeFaceNormals: function() {},
  42666. computeVertexNormals: function() {
  42667. var e = this.index
  42668. , t = this.attributes
  42669. , i = this.groups;
  42670. if (t.position) {
  42671. var n = t.position.array;
  42672. if (void 0 === t.normal)
  42673. this.addAttribute("normal", new Ci.BufferAttribute(new Float32Array(n.length),3));
  42674. else
  42675. for (var r = t.normal.array, o = 0, a = r.length; o < a; o++)
  42676. r[o] = 0;
  42677. var s, l, c, h = t.normal.array, u = new Ci.Vector3, d = new Ci.Vector3, p = new Ci.Vector3, f = new Ci.Vector3, g = new Ci.Vector3;
  42678. if (e) {
  42679. var m = e.array;
  42680. 0 === i.length && this.addGroup(0, m.length);
  42681. for (var v = 0, y = i.length; v < y; ++v) {
  42682. var A = i[v]
  42683. , C = A.start;
  42684. for (o = C,
  42685. a = C + A.count; o < a; o += 3)
  42686. s = 3 * m[o + 0],
  42687. l = 3 * m[o + 1],
  42688. c = 3 * m[o + 2],
  42689. u.fromArray(n, s),
  42690. d.fromArray(n, l),
  42691. p.fromArray(n, c),
  42692. f.subVectors(p, d),
  42693. g.subVectors(u, d),
  42694. f.cross(g),
  42695. h[s] += f.x,
  42696. h[1 + s] += f.y,
  42697. h[2 + s] += f.z,
  42698. h[l] += f.x,
  42699. h[1 + l] += f.y,
  42700. h[2 + l] += f.z,
  42701. h[c] += f.x,
  42702. h[1 + c] += f.y,
  42703. h[2 + c] += f.z
  42704. }
  42705. } else
  42706. for (o = 0,
  42707. a = n.length; o < a; o += 9)
  42708. u.fromArray(n, o),
  42709. d.fromArray(n, o + 3),
  42710. p.fromArray(n, o + 6),
  42711. f.subVectors(p, d),
  42712. g.subVectors(u, d),
  42713. f.cross(g),
  42714. h[o] = f.x,
  42715. h[o + 1] = f.y,
  42716. h[o + 2] = f.z,
  42717. h[o + 3] = f.x,
  42718. h[o + 4] = f.y,
  42719. h[o + 5] = f.z,
  42720. h[o + 6] = f.x,
  42721. h[o + 7] = f.y,
  42722. h[o + 8] = f.z;
  42723. this.normalizeNormals(),
  42724. t.normal.needsUpdate = !0
  42725. }
  42726. },
  42727. merge: function(e, t) {
  42728. if (e instanceof Ci.BufferGeometry != 0) {
  42729. void 0 === t && (t = 0);
  42730. var i = this.attributes;
  42731. for (var n in i)
  42732. if (void 0 !== e.attributes[n])
  42733. for (var r = i[n].array, o = e.attributes[n], a = o.array, s = 0, l = o.itemSize * t; s < a.length; s++,
  42734. l++)
  42735. r[l] = a[s];
  42736. return this
  42737. }
  42738. console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.", e)
  42739. },
  42740. normalizeNormals: function() {
  42741. for (var e, t, i, n, r = this.attributes.normal.array, o = 0, a = r.length; o < a; o += 3)
  42742. e = r[o],
  42743. t = r[o + 1],
  42744. i = r[o + 2],
  42745. n = 1 / Math.sqrt(e * e + t * t + i * i),
  42746. r[o] *= n,
  42747. r[o + 1] *= n,
  42748. r[o + 2] *= n
  42749. },
  42750. toNonIndexed: function() {
  42751. if (null === this.index)
  42752. return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),
  42753. this;
  42754. var e = new Ci.BufferGeometry
  42755. , t = this.index.array
  42756. , i = this.attributes;
  42757. for (var n in i) {
  42758. for (var r = i[n], o = r.array, a = r.itemSize, s = new o.constructor(t.length * a), l = 0, c = 0, h = 0, u = t.length; h < u; h++) {
  42759. l = t[h] * a;
  42760. for (var d = 0; d < a; d++)
  42761. s[c++] = o[l++]
  42762. }
  42763. e.addAttribute(n, new Ci.BufferAttribute(s,a))
  42764. }
  42765. return e
  42766. },
  42767. toJSON: function() {
  42768. var e = {
  42769. metadata: {
  42770. version: 4.4,
  42771. type: "BufferGeometry",
  42772. generator: "BufferGeometry.toJSON"
  42773. }
  42774. };
  42775. if (e.uuid = this.uuid,
  42776. e.type = this.type,
  42777. "" !== this.name && (e.name = this.name),
  42778. void 0 !== this.parameters) {
  42779. var t = this.parameters;
  42780. for (var i in t)
  42781. void 0 !== t[i] && (e[i] = t[i]);
  42782. return e
  42783. }
  42784. e.data = {
  42785. attributes: {}
  42786. };
  42787. var n = this.index;
  42788. if (null !== n) {
  42789. var r = Array.prototype.slice.call(n.array);
  42790. e.data.index = {
  42791. type: n.array.constructor.name,
  42792. array: r
  42793. }
  42794. }
  42795. var o = this.attributes;
  42796. for (var i in o) {
  42797. var a = o[i];
  42798. r = Array.prototype.slice.call(a.array);
  42799. e.data.attributes[i] = {
  42800. itemSize: a.itemSize,
  42801. type: a.array.constructor.name,
  42802. array: r
  42803. }
  42804. }
  42805. var s = this.groups;
  42806. 0 < s.length && (e.data.groups = JSON.parse(JSON.stringify(s)));
  42807. var l = this.boundingSphere;
  42808. return null !== l && (e.data.boundingSphere = {
  42809. center: l.center.toArray(),
  42810. radius: l.radius
  42811. }),
  42812. e
  42813. },
  42814. clone: function() {
  42815. return (new Ci.BufferGeometry).copy(this)
  42816. },
  42817. copy: function(e) {
  42818. var t = e.index;
  42819. null !== t && this.setIndex(t.clone());
  42820. var i = e.attributes;
  42821. for (var n in i) {
  42822. var r = i[n];
  42823. this.addAttribute(n, r.clone())
  42824. }
  42825. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  42826. var l = o[a];
  42827. this.addGroup(l.start, l.count)
  42828. }
  42829. return this
  42830. },
  42831. dispose: function() {
  42832. this.dispatchEvent({
  42833. type: "dispose"
  42834. })
  42835. }
  42836. },
  42837. Ci.EventDispatcher.prototype.apply(Ci.BufferGeometry.prototype),
  42838. Ci.BufferGeometry.MaxIndex = 65535,
  42839. Ci.InstancedBufferGeometry = function() {
  42840. Ci.BufferGeometry.call(this),
  42841. this.type = "InstancedBufferGeometry",
  42842. this.maxInstancedCount = void 0
  42843. }
  42844. ,
  42845. Ci.InstancedBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  42846. Ci.InstancedBufferGeometry.prototype.constructor = Ci.InstancedBufferGeometry,
  42847. Ci.InstancedBufferGeometry.prototype.addGroup = function(e, t, i) {
  42848. this.groups.push({
  42849. start: e,
  42850. count: t,
  42851. instances: i
  42852. })
  42853. }
  42854. ,
  42855. Ci.InstancedBufferGeometry.prototype.copy = function(e) {
  42856. var t = e.index;
  42857. null !== t && this.setIndex(t.clone());
  42858. var i = e.attributes;
  42859. for (var n in i) {
  42860. var r = i[n];
  42861. this.addAttribute(n, r.clone())
  42862. }
  42863. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  42864. var l = o[a];
  42865. this.addGroup(l.start, l.count, l.instances)
  42866. }
  42867. return this
  42868. }
  42869. ,
  42870. Ci.EventDispatcher.prototype.apply(Ci.InstancedBufferGeometry.prototype),
  42871. Ci.Uniform = function(e, t) {
  42872. this.type = e,
  42873. this.value = t,
  42874. this.dynamic = !1
  42875. }
  42876. ,
  42877. Ci.Uniform.prototype = {
  42878. constructor: Ci.Uniform,
  42879. onUpdate: function(e) {
  42880. return this.dynamic = !0,
  42881. this.onUpdateCallback = e,
  42882. this
  42883. }
  42884. },
  42885. Ci.AnimationClip = function(e, t, i) {
  42886. this.name = e || Ci.Math.generateUUID(),
  42887. this.tracks = i,
  42888. this.duration = void 0 !== t ? t : -1,
  42889. this.duration < 0 && this.resetDuration(),
  42890. this.trim(),
  42891. this.optimize()
  42892. }
  42893. ,
  42894. Ci.AnimationClip.prototype = {
  42895. constructor: Ci.AnimationClip,
  42896. resetDuration: function() {
  42897. for (var e = 0, t = 0, i = this.tracks.length; t !== i; ++t) {
  42898. var n = this.tracks[t];
  42899. e = Math.max(e, n.times[n.times.length - 1])
  42900. }
  42901. this.duration = e
  42902. },
  42903. trim: function() {
  42904. for (var e = 0; e < this.tracks.length; e++)
  42905. this.tracks[e].trim(0, this.duration);
  42906. return this
  42907. },
  42908. optimize: function() {
  42909. for (var e = 0; e < this.tracks.length; e++)
  42910. this.tracks[e].optimize();
  42911. return this
  42912. }
  42913. },
  42914. Object.assign(Ci.AnimationClip, {
  42915. parse: function(e) {
  42916. for (var t = [], i = e.tracks, n = 1 / (e.fps || 1), r = 0, o = i.length; r !== o; ++r)
  42917. t.push(Ci.KeyframeTrack.parse(i[r]).scale(n));
  42918. return new Ci.AnimationClip(e.name,e.duration,t)
  42919. },
  42920. toJSON: function(e) {
  42921. for (var t = [], i = e.tracks, n = {
  42922. name: e.name,
  42923. duration: e.duration,
  42924. tracks: t
  42925. }, r = 0, o = i.length; r !== o; ++r)
  42926. t.push(Ci.KeyframeTrack.toJSON(i[r]));
  42927. return n
  42928. },
  42929. CreateFromMorphTargetSequence: function(e, t, i) {
  42930. for (var n = t.length, r = [], o = 0; o < n; o++) {
  42931. var a = []
  42932. , s = [];
  42933. a.push((o + n - 1) % n, o, (o + 1) % n),
  42934. s.push(0, 1, 0);
  42935. var l = Ci.AnimationUtils.getKeyframeOrder(a);
  42936. a = Ci.AnimationUtils.sortedArray(a, 1, l),
  42937. s = Ci.AnimationUtils.sortedArray(s, 1, l),
  42938. 0 === a[0] && (a.push(n),
  42939. s.push(s[0])),
  42940. r.push(new Ci.NumberKeyframeTrack(".morphTargetInfluences[" + t[o].name + "]",a,s).scale(1 / i))
  42941. }
  42942. return new Ci.AnimationClip(e,-1,r)
  42943. },
  42944. findByName: function(e, t) {
  42945. for (var i = 0; i < e.length; i++)
  42946. if (e[i].name === t)
  42947. return e[i];
  42948. return null
  42949. },
  42950. CreateClipsFromMorphTargetSequences: function(e, t) {
  42951. for (var i = {}, n = /^([\w-]*?)([\d]+)$/, r = 0, o = e.length; r < o; r++) {
  42952. var a = e[r]
  42953. , s = a.name.match(n);
  42954. if (s && 1 < s.length) {
  42955. var l = i[h = s[1]];
  42956. l || (i[h] = l = []),
  42957. l.push(a)
  42958. }
  42959. }
  42960. var c = [];
  42961. for (var h in i)
  42962. c.push(Ci.AnimationClip.CreateFromMorphTargetSequence(h, i[h], t));
  42963. return c
  42964. },
  42965. parseAnimation: function(e, t, i) {
  42966. if (!e)
  42967. return console.error(" no animation in JSONLoader data"),
  42968. null;
  42969. function n(e, t, i, n, r) {
  42970. if (0 !== i.length) {
  42971. var o = []
  42972. , a = [];
  42973. Ci.AnimationUtils.flattenJSON(i, o, a, n),
  42974. 0 !== o.length && r.push(new e(t,o,a))
  42975. }
  42976. }
  42977. for (var r = [], o = e.name || "default", a = e.length || -1, s = e.fps || 30, l = e.hierarchy || [], c = 0; c < l.length; c++) {
  42978. var h = l[c].keys;
  42979. if (h && 0 != h.length)
  42980. if (h[0].morphTargets) {
  42981. for (var u = {}, d = 0; d < h.length; d++)
  42982. if (h[d].morphTargets)
  42983. for (var p = 0; p < h[d].morphTargets.length; p++)
  42984. u[h[d].morphTargets[p]] = -1;
  42985. for (var f in u) {
  42986. var g = []
  42987. , m = [];
  42988. for (p = 0; p !== h[d].morphTargets.length; ++p) {
  42989. var v = h[d];
  42990. g.push(v.time),
  42991. m.push(v.morphTarget === f ? 1 : 0)
  42992. }
  42993. r.push(new Ci.NumberKeyframeTrack(".morphTargetInfluence[" + f + "]",g,m))
  42994. }
  42995. a = u.length * (s || 1)
  42996. } else {
  42997. var y = ".bones[" + t[c].name + "]";
  42998. n(Ci.VectorKeyframeTrack, y + ".position", h, "pos", r),
  42999. n(Ci.QuaternionKeyframeTrack, y + ".quaternion", h, "rot", r),
  43000. n(Ci.VectorKeyframeTrack, y + ".scale", h, "scl", r)
  43001. }
  43002. }
  43003. return 0 === r.length ? null : new Ci.AnimationClip(o,a,r)
  43004. }
  43005. }),
  43006. Ci.AnimationMixer = function(e) {
  43007. this._root = e,
  43008. this._initMemoryManager(),
  43009. this._accuIndex = 0,
  43010. this.time = 0,
  43011. this.timeScale = 1
  43012. }
  43013. ,
  43014. Ci.AnimationMixer.prototype = {
  43015. constructor: Ci.AnimationMixer,
  43016. clipAction: function(e, t) {
  43017. var i, n = (t || this._root).uuid, r = "string" == typeof e ? e : e.name, o = e !== r ? e : null, a = this._actionsByClip[r];
  43018. if (void 0 !== a) {
  43019. var s = a.actionByRoot[n];
  43020. if (void 0 !== s)
  43021. return s;
  43022. if (o = (i = a.knownActions[0])._clip,
  43023. e !== r && e !== o)
  43024. throw new Error("Different clips with the same name detected!")
  43025. }
  43026. if (null === o)
  43027. return null;
  43028. var l = new Ci.AnimationMixer._Action(this,o,t);
  43029. return this._bindAction(l, i),
  43030. this._addInactiveAction(l, r, n),
  43031. l
  43032. },
  43033. existingAction: function(e, t) {
  43034. var i = (t || this._root).uuid
  43035. , n = "string" == typeof e ? e : e.name
  43036. , r = this._actionsByClip[n];
  43037. return void 0 !== r && r.actionByRoot[i] || null
  43038. },
  43039. stopAllAction: function() {
  43040. var e = this._actions
  43041. , t = this._nActiveActions
  43042. , i = this._bindings
  43043. , n = this._nActiveBindings;
  43044. this._nActiveActions = 0;
  43045. for (var r = this._nActiveBindings = 0; r !== t; ++r)
  43046. e[r].reset();
  43047. for (r = 0; r !== n; ++r)
  43048. i[r].useCount = 0;
  43049. return this
  43050. },
  43051. update: function(e) {
  43052. e *= this.timeScale;
  43053. 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) {
  43054. var s = t[a];
  43055. s.enabled && s._update(n, e, r, o)
  43056. }
  43057. var l = this._bindings
  43058. , c = this._nActiveBindings;
  43059. for (a = 0; a !== c; ++a)
  43060. l[a].apply(o);
  43061. return this
  43062. },
  43063. getRoot: function() {
  43064. return this._root
  43065. },
  43066. uncacheClip: function(e) {
  43067. var t = this._actions
  43068. , i = e.name
  43069. , n = this._actionsByClip
  43070. , r = n[i];
  43071. if (void 0 !== r) {
  43072. for (var o = r.knownActions, a = 0, s = o.length; a !== s; ++a) {
  43073. var l = o[a];
  43074. this._deactivateAction(l);
  43075. var c = l._cacheIndex
  43076. , h = t[t.length - 1];
  43077. l._cacheIndex = null,
  43078. l._byClipCacheIndex = null,
  43079. t[h._cacheIndex = c] = h,
  43080. t.pop(),
  43081. this._removeInactiveBindingsForAction(l)
  43082. }
  43083. delete n[i]
  43084. }
  43085. },
  43086. uncacheRoot: function(e) {
  43087. var t = e.uuid
  43088. , i = this._actionsByClip;
  43089. for (var n in i) {
  43090. var r = i[n].actionByRoot[t];
  43091. void 0 !== r && (this._deactivateAction(r),
  43092. this._removeInactiveAction(r))
  43093. }
  43094. var o = this._bindingsByRootAndName[t];
  43095. if (void 0 !== o)
  43096. for (var a in o) {
  43097. var s = o[a];
  43098. s.restoreOriginalState(),
  43099. this._removeInactiveBinding(s)
  43100. }
  43101. },
  43102. uncacheAction: function(e, t) {
  43103. var i = this.existingAction(e, t);
  43104. null !== i && (this._deactivateAction(i),
  43105. this._removeInactiveAction(i))
  43106. }
  43107. },
  43108. Ci.EventDispatcher.prototype.apply(Ci.AnimationMixer.prototype),
  43109. Ci.AnimationMixer._Action = function(e, t, i) {
  43110. this._mixer = e,
  43111. this._clip = t,
  43112. this._localRoot = i || null;
  43113. for (var n = t.tracks, r = n.length, o = new Array(r), a = {
  43114. endingStart: Ci.ZeroCurvatureEnding,
  43115. endingEnd: Ci.ZeroCurvatureEnding
  43116. }, s = 0; s !== r; ++s) {
  43117. var l = n[s].createInterpolant(null);
  43118. (o[s] = l).settings = a
  43119. }
  43120. this._interpolantSettings = a,
  43121. this._interpolants = o,
  43122. this._propertyBindings = new Array(r),
  43123. this._cacheIndex = null,
  43124. this._byClipCacheIndex = null,
  43125. this._timeScaleInterpolant = null,
  43126. this._weightInterpolant = null,
  43127. this.loop = Ci.LoopRepeat,
  43128. this._loopCount = -1,
  43129. this._startTime = null,
  43130. this.time = 0,
  43131. this.timeScale = 1,
  43132. this._effectiveTimeScale = 1,
  43133. this.weight = 1,
  43134. this._effectiveWeight = 1,
  43135. this.repetitions = 1 / 0,
  43136. this.paused = !1,
  43137. this.enabled = !0,
  43138. this.clampWhenFinished = !1,
  43139. this.zeroSlopeAtStart = !0,
  43140. this.zeroSlopeAtEnd = !0
  43141. }
  43142. ,
  43143. Ci.AnimationMixer._Action.prototype = {
  43144. constructor: Ci.AnimationMixer._Action,
  43145. play: function() {
  43146. return this._mixer._activateAction(this),
  43147. this
  43148. },
  43149. stop: function() {
  43150. return this._mixer._deactivateAction(this),
  43151. this.reset()
  43152. },
  43153. reset: function() {
  43154. return this.paused = !1,
  43155. this.enabled = !0,
  43156. this.time = 0,
  43157. this._loopCount = -1,
  43158. this._startTime = null,
  43159. this.stopFading().stopWarping()
  43160. },
  43161. isRunning: function() {
  43162. return this._startTime,
  43163. this.enabled && !this.paused && 0 !== this.timeScale && null === this._startTime && this._mixer._isActiveAction(this)
  43164. },
  43165. isScheduled: function() {
  43166. return this._mixer._isActiveAction(this)
  43167. },
  43168. startAt: function(e) {
  43169. return this._startTime = e,
  43170. this
  43171. },
  43172. setLoop: function(e, t) {
  43173. return this.loop = e,
  43174. this.repetitions = t,
  43175. this
  43176. },
  43177. setEffectiveWeight: function(e) {
  43178. return this.weight = e,
  43179. this._effectiveWeight = this.enabled ? e : 0,
  43180. this.stopFading()
  43181. },
  43182. getEffectiveWeight: function() {
  43183. return this._effectiveWeight
  43184. },
  43185. fadeIn: function(e) {
  43186. return this._scheduleFading(e, 0, 1)
  43187. },
  43188. fadeOut: function(e) {
  43189. return this._scheduleFading(e, 1, 0)
  43190. },
  43191. crossFadeFrom: function(e, t, i) {
  43192. if (this._mixer,
  43193. e.fadeOut(t),
  43194. this.fadeIn(t),
  43195. i) {
  43196. var n = this._clip.duration
  43197. , r = e._clip.duration
  43198. , o = r / n
  43199. , a = n / r;
  43200. e.warp(1, o, t),
  43201. this.warp(a, 1, t)
  43202. }
  43203. return this
  43204. },
  43205. crossFadeTo: function(e, t, i) {
  43206. return e.crossFadeFrom(this, t, i)
  43207. },
  43208. stopFading: function() {
  43209. var e = this._weightInterpolant;
  43210. return null !== e && (this._weightInterpolant = null,
  43211. this._mixer._takeBackControlInterpolant(e)),
  43212. this
  43213. },
  43214. setEffectiveTimeScale: function(e) {
  43215. return this.timeScale = e,
  43216. this._effectiveTimeScale = this.paused ? 0 : e,
  43217. this.stopWarping()
  43218. },
  43219. getEffectiveTimeScale: function() {
  43220. return this._effectiveTimeScale
  43221. },
  43222. setDuration: function(e) {
  43223. return this.timeScale = this._clip.duration / e,
  43224. this.stopWarping()
  43225. },
  43226. syncWith: function(e) {
  43227. return this.time = e.time,
  43228. this.timeScale = e.timeScale,
  43229. this.stopWarping()
  43230. },
  43231. halt: function(e) {
  43232. return this.warp(this._currentTimeScale, 0, e)
  43233. },
  43234. warp: function(e, t, i) {
  43235. var n = this._mixer
  43236. , r = n.time
  43237. , o = this._timeScaleInterpolant
  43238. , a = this.timeScale;
  43239. null === o && (o = n._lendControlInterpolant(),
  43240. this._timeScaleInterpolant = o);
  43241. var s = o.parameterPositions
  43242. , l = o.sampleValues;
  43243. return s[0] = r,
  43244. s[1] = r + i,
  43245. l[0] = e / a,
  43246. l[1] = t / a,
  43247. this
  43248. },
  43249. stopWarping: function() {
  43250. var e = this._timeScaleInterpolant;
  43251. return null !== e && (this._timeScaleInterpolant = null,
  43252. this._mixer._takeBackControlInterpolant(e)),
  43253. this
  43254. },
  43255. getMixer: function() {
  43256. return this._mixer
  43257. },
  43258. getClip: function() {
  43259. return this._clip
  43260. },
  43261. getRoot: function() {
  43262. return this._localRoot || this._mixer._root
  43263. },
  43264. _update: function(e, t, i, n) {
  43265. var r = this._startTime;
  43266. if (null !== r) {
  43267. var o = (e - r) * i;
  43268. if (o < 0 || 0 === i)
  43269. return;
  43270. this._startTime = null,
  43271. t = i * o
  43272. }
  43273. t *= this._updateTimeScale(e);
  43274. var a = this._updateTime(t)
  43275. , s = this._updateWeight(e);
  43276. if (0 < s)
  43277. for (var l = this._interpolants, c = this._propertyBindings, h = 0, u = l.length; h !== u; ++h)
  43278. l[h].evaluate(a),
  43279. c[h].accumulate(n, s)
  43280. },
  43281. _updateWeight: function(e) {
  43282. var t = 0;
  43283. if (this.enabled) {
  43284. t = this.weight;
  43285. var i = this._weightInterpolant;
  43286. if (null !== i) {
  43287. var n = i.evaluate(e)[0];
  43288. t *= n,
  43289. e > i.parameterPositions[1] && (this.stopFading(),
  43290. 0 === n && (this.enabled = !1))
  43291. }
  43292. }
  43293. return this._effectiveWeight = t
  43294. },
  43295. _updateTimeScale: function(e) {
  43296. var t = 0;
  43297. if (!this.paused) {
  43298. t = this.timeScale;
  43299. var i = this._timeScaleInterpolant;
  43300. if (null !== i)
  43301. t *= i.evaluate(e)[0],
  43302. e > i.parameterPositions[1] && (this.stopWarping(),
  43303. 0 === t ? this.pause = !0 : this.timeScale = t)
  43304. }
  43305. return this._effectiveTimeScale = t
  43306. },
  43307. _updateTime: function(e) {
  43308. var t = this.time + e;
  43309. if (0 === e)
  43310. return t;
  43311. var i = this._clip.duration
  43312. , n = this.loop
  43313. , r = this._loopCount
  43314. , o = !1;
  43315. switch (n) {
  43316. case Ci.LoopOnce:
  43317. if (-1 === r && (this.loopCount = 0,
  43318. this._setEndings(!0, !0, !1)),
  43319. i <= t)
  43320. t = i;
  43321. else {
  43322. if (!(t < 0))
  43323. break;
  43324. t = 0
  43325. }
  43326. this.clampWhenFinished ? this.pause = !0 : this.enabled = !1,
  43327. this._mixer.dispatchEvent({
  43328. type: "finished",
  43329. action: this,
  43330. direction: e < 0 ? -1 : 1
  43331. });
  43332. break;
  43333. case Ci.LoopPingPong:
  43334. o = !0;
  43335. case Ci.LoopRepeat:
  43336. if (-1 === r && (0 < e ? (r = 0,
  43337. this._setEndings(!0, 0 === this.repetitions, o)) : this._setEndings(0 === this.repetitions, !0, o)),
  43338. i <= t || t < 0) {
  43339. var a = Math.floor(t / i);
  43340. t -= i * a,
  43341. r += Math.abs(a);
  43342. var s = this.repetitions - r;
  43343. if (s < 0) {
  43344. this.clampWhenFinished ? this.paused = !0 : this.enabled = !1,
  43345. t = 0 < e ? i : 0,
  43346. this._mixer.dispatchEvent({
  43347. type: "finished",
  43348. action: this,
  43349. direction: 0 < e ? 1 : -1
  43350. });
  43351. break
  43352. }
  43353. if (0 == s) {
  43354. var l = e < 0;
  43355. this._setEndings(l, !l, o)
  43356. } else
  43357. this._setEndings(!1, !1, o);
  43358. this._loopCount = r,
  43359. this._mixer.dispatchEvent({
  43360. type: "loop",
  43361. action: this,
  43362. loopDelta: a
  43363. })
  43364. }
  43365. if (n === Ci.LoopPingPong && 1 == (1 & r))
  43366. return i - (this.time = t)
  43367. }
  43368. return this.time = t
  43369. },
  43370. _setEndings: function(e, t, i) {
  43371. var n = this._interpolantSettings;
  43372. i ? (n.endingStart = Ci.ZeroSlopeEnding,
  43373. n.endingEnd = Ci.ZeroSlopeEnding) : (n.endingStart = e ? this.zeroSlopeAtStart ? Ci.ZeroSlopeEnding : Ci.ZeroCurvatureEnding : Ci.WrapAroundEnding,
  43374. n.endingEnd = t ? this.zeroSlopeAtEnd ? Ci.ZeroSlopeEnding : Ci.ZeroCurvatureEnding : Ci.WrapAroundEnding)
  43375. },
  43376. _scheduleFading: function(e, t, i) {
  43377. var n = this._mixer
  43378. , r = n.time
  43379. , o = this._weightInterpolant;
  43380. null === o && (o = n._lendControlInterpolant(),
  43381. this._weightInterpolant = o);
  43382. var a = o.parameterPositions
  43383. , s = o.sampleValues;
  43384. return a[0] = r,
  43385. s[0] = t,
  43386. a[1] = r + e,
  43387. s[1] = i,
  43388. this
  43389. }
  43390. },
  43391. Object.assign(Ci.AnimationMixer.prototype, {
  43392. _bindAction: function(e, t) {
  43393. var i = e._localRoot || this._root
  43394. , n = e._clip.tracks
  43395. , r = n.length
  43396. , o = e._propertyBindings
  43397. , a = e._interpolants
  43398. , s = i.uuid
  43399. , l = this._bindingsByRootAndName
  43400. , c = l[s];
  43401. void 0 === c && (c = {},
  43402. l[s] = c);
  43403. for (var h = 0; h !== r; ++h) {
  43404. var u = n[h]
  43405. , d = u.name
  43406. , p = c[d];
  43407. if (void 0 !== p)
  43408. o[h] = p;
  43409. else {
  43410. if (void 0 !== (p = o[h])) {
  43411. null === p._cacheIndex && (++p.referenceCount,
  43412. this._addInactiveBinding(p, s, d));
  43413. continue
  43414. }
  43415. var f = t && t._propertyBindings[h].binding.parsedPath;
  43416. ++(p = new Ci.PropertyMixer(Ci.PropertyBinding.create(i, d, f),u.ValueTypeName,u.getValueSize())).referenceCount,
  43417. this._addInactiveBinding(p, s, d),
  43418. o[h] = p
  43419. }
  43420. a[h].resultBuffer = p.buffer
  43421. }
  43422. },
  43423. _activateAction: function(e) {
  43424. if (!this._isActiveAction(e)) {
  43425. if (null === e._cacheIndex) {
  43426. var t = (e._localRoot || this._root).uuid
  43427. , i = e._clip.name
  43428. , n = this._actionsByClip[i];
  43429. this._bindAction(e, n && n.knownActions[0]),
  43430. this._addInactiveAction(e, i, t)
  43431. }
  43432. for (var r = e._propertyBindings, o = 0, a = r.length; o !== a; ++o) {
  43433. var s = r[o];
  43434. 0 == s.useCount++ && (this._lendBinding(s),
  43435. s.saveOriginalState())
  43436. }
  43437. this._lendAction(e)
  43438. }
  43439. },
  43440. _deactivateAction: function(e) {
  43441. if (this._isActiveAction(e)) {
  43442. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  43443. var r = t[i];
  43444. 0 == --r.useCount && (r.restoreOriginalState(),
  43445. this._takeBackBinding(r))
  43446. }
  43447. this._takeBackAction(e)
  43448. }
  43449. },
  43450. _initMemoryManager: function() {
  43451. this._actions = [],
  43452. this._nActiveActions = 0,
  43453. this._actionsByClip = {},
  43454. this._bindings = [],
  43455. this._nActiveBindings = 0,
  43456. this._bindingsByRootAndName = {},
  43457. this._controlInterpolants = [],
  43458. this._nActiveControlInterpolants = 0;
  43459. var e = this;
  43460. this.stats = {
  43461. actions: {
  43462. get total() {
  43463. return e._actions.length
  43464. },
  43465. get inUse() {
  43466. return e._nActiveActions
  43467. }
  43468. },
  43469. bindings: {
  43470. get total() {
  43471. return e._bindings.length
  43472. },
  43473. get inUse() {
  43474. return e._nActiveBindings
  43475. }
  43476. },
  43477. controlInterpolants: {
  43478. get total() {
  43479. return e._controlInterpolants.length
  43480. },
  43481. get inUse() {
  43482. return e._nActiveControlInterpolants
  43483. }
  43484. }
  43485. }
  43486. },
  43487. _isActiveAction: function(e) {
  43488. var t = e._cacheIndex;
  43489. return null !== t && t < this._nActiveActions
  43490. },
  43491. _addInactiveAction: function(e, t, i) {
  43492. var n = this._actions
  43493. , r = this._actionsByClip
  43494. , o = r[t];
  43495. if (void 0 === o)
  43496. o = {
  43497. knownActions: [e],
  43498. actionByRoot: {}
  43499. },
  43500. e._byClipCacheIndex = 0,
  43501. r[t] = o;
  43502. else {
  43503. var a = o.knownActions;
  43504. e._byClipCacheIndex = a.length,
  43505. a.push(e)
  43506. }
  43507. e._cacheIndex = n.length,
  43508. n.push(e),
  43509. o.actionByRoot[i] = e
  43510. },
  43511. _removeInactiveAction: function(e) {
  43512. var t = this._actions
  43513. , i = t[t.length - 1]
  43514. , n = e._cacheIndex;
  43515. t[i._cacheIndex = n] = i,
  43516. t.pop(),
  43517. e._cacheIndex = null;
  43518. var r = e._clip.name
  43519. , o = this._actionsByClip
  43520. , a = o[r]
  43521. , s = a.knownActions
  43522. , l = s[s.length - 1]
  43523. , c = e._byClipCacheIndex;
  43524. s[l._byClipCacheIndex = c] = l,
  43525. s.pop(),
  43526. e._byClipCacheIndex = null,
  43527. delete a.actionByRoot[(t._localRoot || this._root).uuid],
  43528. 0 === s.length && delete o[r],
  43529. this._removeInactiveBindingsForAction(e)
  43530. },
  43531. _removeInactiveBindingsForAction: function(e) {
  43532. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  43533. var r = t[i];
  43534. 0 == --r.referenceCount && this._removeInactiveBinding(r)
  43535. }
  43536. },
  43537. _lendAction: function(e) {
  43538. var t = this._actions
  43539. , i = e._cacheIndex
  43540. , n = this._nActiveActions++
  43541. , r = t[n];
  43542. t[e._cacheIndex = n] = e,
  43543. t[r._cacheIndex = i] = r
  43544. },
  43545. _takeBackAction: function(e) {
  43546. var t = this._actions
  43547. , i = e._cacheIndex
  43548. , n = --this._nActiveActions
  43549. , r = t[n];
  43550. t[e._cacheIndex = n] = e,
  43551. t[r._cacheIndex = i] = r
  43552. },
  43553. _addInactiveBinding: function(e, t, i) {
  43554. var n = this._bindingsByRootAndName
  43555. , r = n[t]
  43556. , o = this._bindings;
  43557. void 0 === r && (r = {},
  43558. n[t] = r),
  43559. (r[i] = e)._cacheIndex = o.length,
  43560. o.push(e)
  43561. },
  43562. _removeInactiveBinding: function(e) {
  43563. var t = this._bindings
  43564. , i = e.binding
  43565. , n = i.rootNode.uuid
  43566. , r = i.path
  43567. , o = this._bindingsByRootAndName
  43568. , a = o[n]
  43569. , s = t[t.length - 1]
  43570. , l = e._cacheIndex;
  43571. t[s._cacheIndex = l] = s,
  43572. t.pop(),
  43573. delete a[r];
  43574. e: {
  43575. for (var c in a)
  43576. break e;
  43577. delete o[n]
  43578. }
  43579. },
  43580. _lendBinding: function(e) {
  43581. var t = this._bindings
  43582. , i = e._cacheIndex
  43583. , n = this._nActiveBindings++
  43584. , r = t[n];
  43585. t[e._cacheIndex = n] = e,
  43586. t[r._cacheIndex = i] = r
  43587. },
  43588. _takeBackBinding: function(e) {
  43589. var t = this._bindings
  43590. , i = e._cacheIndex
  43591. , n = --this._nActiveBindings
  43592. , r = t[n];
  43593. t[e._cacheIndex = n] = e,
  43594. t[r._cacheIndex = i] = r
  43595. },
  43596. _lendControlInterpolant: function() {
  43597. var e = this._controlInterpolants
  43598. , t = this._nActiveControlInterpolants++
  43599. , i = e[t];
  43600. return void 0 === i && (e[(i = new Ci.LinearInterpolant(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer)).__cacheIndex = t] = i),
  43601. i
  43602. },
  43603. _takeBackControlInterpolant: function(e) {
  43604. var t = this._controlInterpolants
  43605. , i = e.__cacheIndex
  43606. , n = --this._nActiveControlInterpolants
  43607. , r = t[n];
  43608. t[e.__cacheIndex = n] = e,
  43609. t[r.__cacheIndex = i] = r
  43610. },
  43611. _controlInterpolantsResultBuffer: new Float32Array(1)
  43612. }),
  43613. Ci.AnimationObjectGroup = function(e) {
  43614. this.uuid = Ci.Math.generateUUID(),
  43615. this._objects = Array.prototype.slice.call(arguments),
  43616. this.nCachedObjects_ = 0;
  43617. var t = {};
  43618. this._indicesByUUID = t;
  43619. for (var i = 0, n = arguments.length; i !== n; ++i)
  43620. t[arguments[i].uuid] = i;
  43621. this._paths = [],
  43622. this._parsedPaths = [],
  43623. this._bindings = [],
  43624. this._bindingsIndicesByPath = {};
  43625. var r = this;
  43626. this.stats = {
  43627. objects: {
  43628. get total() {
  43629. return r._objects.length
  43630. },
  43631. get inUse() {
  43632. return this.total - r.nCachedObjects_
  43633. }
  43634. },
  43635. get bindingsPerObject() {
  43636. return r._bindings.length
  43637. }
  43638. }
  43639. }
  43640. ,
  43641. Ci.AnimationObjectGroup.prototype = {
  43642. constructor: Ci.AnimationObjectGroup,
  43643. add: function(e) {
  43644. for (var t = this._objects, i = t.length, n = this.nCachedObjects_, r = this._indicesByUUID, o = this._paths, a = this._parsedPaths, s = this._bindings, l = s.length, c = 0, h = arguments.length; c !== h; ++c) {
  43645. var u = arguments[c]
  43646. , d = u.uuid
  43647. , p = r[d];
  43648. if (void 0 === p) {
  43649. p = i++,
  43650. r[d] = p,
  43651. t.push(u);
  43652. for (var f = 0, g = l; f !== g; ++f)
  43653. s[f].push(new Ci.PropertyBinding(u,o[f],a[f]))
  43654. } else if (p < n) {
  43655. var m = t[p]
  43656. , v = --n
  43657. , y = t[v];
  43658. t[r[y.uuid] = p] = y,
  43659. t[r[d] = v] = u;
  43660. for (f = 0,
  43661. g = l; f !== g; ++f) {
  43662. var A = s[f]
  43663. , C = A[v]
  43664. , I = A[p];
  43665. A[p] = C,
  43666. void 0 === I && (I = new Ci.PropertyBinding(u,o[f],a[f])),
  43667. A[v] = I
  43668. }
  43669. } else
  43670. t[p] !== m && console.error("Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes...")
  43671. }
  43672. this.nCachedObjects_ = n
  43673. },
  43674. remove: function(e) {
  43675. for (var t = this._objects, i = (t.length,
  43676. this.nCachedObjects_), n = this._indicesByUUID, r = this._bindings, o = r.length, a = 0, s = arguments.length; a !== s; ++a) {
  43677. var l = arguments[a]
  43678. , c = l.uuid
  43679. , h = n[c];
  43680. if (void 0 !== h && i <= h) {
  43681. var u = i++
  43682. , d = t[u];
  43683. t[n[d.uuid] = h] = d,
  43684. t[n[c] = u] = l;
  43685. for (var p = 0, f = o; p !== f; ++p) {
  43686. var g = r[p]
  43687. , m = g[u]
  43688. , v = g[h];
  43689. g[h] = m,
  43690. g[u] = v
  43691. }
  43692. }
  43693. }
  43694. this.nCachedObjects_ = i
  43695. },
  43696. uncache: function(e) {
  43697. 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) {
  43698. var c = arguments[s].uuid
  43699. , h = r[c];
  43700. if (void 0 !== h)
  43701. if (delete r[c],
  43702. h < n) {
  43703. var u = --n
  43704. , d = t[u]
  43705. , p = t[y = --i];
  43706. t[r[d.uuid] = h] = d,
  43707. t[r[p.uuid] = u] = p,
  43708. t.pop();
  43709. for (var f = 0, g = a; f !== g; ++f) {
  43710. var m = (A = o[f])[u]
  43711. , v = A[y];
  43712. A[h] = m,
  43713. A[u] = v,
  43714. A.pop()
  43715. }
  43716. } else {
  43717. var y;
  43718. t[r[(p = t[y = --i]).uuid] = h] = p,
  43719. t.pop();
  43720. for (f = 0,
  43721. g = a; f !== g; ++f) {
  43722. var A;
  43723. (A = o[f])[h] = A[y],
  43724. A.pop()
  43725. }
  43726. }
  43727. }
  43728. this.nCachedObjects_ = n
  43729. },
  43730. subscribe_: function(e, t) {
  43731. var i = this._bindingsIndicesByPath
  43732. , n = i[e]
  43733. , r = this._bindings;
  43734. if (void 0 !== n)
  43735. return r[n];
  43736. var o = this._paths
  43737. , a = this._parsedPaths
  43738. , s = this._objects
  43739. , l = s.length
  43740. , c = this.nCachedObjects_
  43741. , h = new Array(l);
  43742. n = r.length,
  43743. i[e] = n,
  43744. o.push(e),
  43745. a.push(t),
  43746. r.push(h);
  43747. for (var u = c, d = s.length; u !== d; ++u) {
  43748. var p = s[u];
  43749. h[u] = new Ci.PropertyBinding(p,e,t)
  43750. }
  43751. return h
  43752. },
  43753. unsubscribe_: function(e) {
  43754. var t = this._bindingsIndicesByPath
  43755. , i = t[e];
  43756. if (void 0 !== i) {
  43757. var n = this._paths
  43758. , r = this._parsedPaths
  43759. , o = this._bindings
  43760. , a = o.length - 1
  43761. , s = o[a];
  43762. o[t[e[a]] = i] = s,
  43763. o.pop(),
  43764. r[i] = r[a],
  43765. r.pop(),
  43766. n[i] = n[a],
  43767. n.pop()
  43768. }
  43769. }
  43770. },
  43771. Ci.AnimationUtils = {
  43772. arraySlice: function(e, t, i) {
  43773. return Ci.AnimationUtils.isTypedArray(e) ? new e.constructor(e.subarray(t, i)) : e.slice(t, i)
  43774. },
  43775. convertArray: function(e, t, i) {
  43776. return !e || !i && e.constructor === t ? e : "number" == typeof t.BYTES_PER_ELEMENT ? new t(e) : Array.prototype.slice.call(e)
  43777. },
  43778. isTypedArray: function(e) {
  43779. return ArrayBuffer.isView(e) && !(e instanceof DataView)
  43780. },
  43781. getKeyframeOrder: function(i) {
  43782. for (var e = i.length, t = new Array(e), n = 0; n !== e; ++n)
  43783. t[n] = n;
  43784. return t.sort(function(e, t) {
  43785. return i[e] - i[t]
  43786. }),
  43787. t
  43788. },
  43789. sortedArray: function(e, t, i) {
  43790. for (var n = e.length, r = new e.constructor(n), o = 0, a = 0; a !== n; ++o)
  43791. for (var s = i[o] * t, l = 0; l !== t; ++l)
  43792. r[a++] = e[s + l];
  43793. return r
  43794. },
  43795. flattenJSON: function(e, t, i, n) {
  43796. for (var r = 1, o = e[0]; void 0 !== o && void 0 === o[n]; )
  43797. o = e[r++];
  43798. if (void 0 !== o) {
  43799. var a = o[n];
  43800. if (void 0 !== a)
  43801. if (Array.isArray(a))
  43802. for (; void 0 !== (a = o[n]) && (t.push(o.time),
  43803. i.push.apply(i, a)),
  43804. void 0 !== (o = e[r++]); )
  43805. ;
  43806. else if (void 0 !== a.toArray)
  43807. for (; void 0 !== (a = o[n]) && (t.push(o.time),
  43808. a.toArray(i, i.length)),
  43809. void 0 !== (o = e[r++]); )
  43810. ;
  43811. else
  43812. for (; void 0 !== (a = o[n]) && (t.push(o.time),
  43813. i.push(a)),
  43814. void 0 !== (o = e[r++]); )
  43815. ;
  43816. }
  43817. }
  43818. },
  43819. Ci.KeyframeTrack = function(e, t, i, n) {
  43820. if (void 0 === e)
  43821. throw new Error("track name is undefined");
  43822. if (void 0 === t || 0 === t.length)
  43823. throw new Error("no keyframes in track named " + e);
  43824. this.name = e,
  43825. this.times = Ci.AnimationUtils.convertArray(t, this.TimeBufferType),
  43826. this.values = Ci.AnimationUtils.convertArray(i, this.ValueBufferType),
  43827. this.setInterpolation(n || this.DefaultInterpolation),
  43828. this.validate(),
  43829. this.optimize()
  43830. }
  43831. ,
  43832. Ci.KeyframeTrack.prototype = {
  43833. constructor: Ci.KeyframeTrack,
  43834. TimeBufferType: Float32Array,
  43835. ValueBufferType: Float32Array,
  43836. DefaultInterpolation: Ci.InterpolateLinear,
  43837. InterpolantFactoryMethodDiscrete: function(e) {
  43838. return new Ci.DiscreteInterpolant(this.times,this.values,this.getValueSize(),e)
  43839. },
  43840. InterpolantFactoryMethodLinear: function(e) {
  43841. return new Ci.LinearInterpolant(this.times,this.values,this.getValueSize(),e)
  43842. },
  43843. InterpolantFactoryMethodSmooth: function(e) {
  43844. return new Ci.CubicInterpolant(this.times,this.values,this.getValueSize(),e)
  43845. },
  43846. setInterpolation: function(e) {
  43847. var t = void 0;
  43848. switch (e) {
  43849. case Ci.InterpolateDiscrete:
  43850. t = this.InterpolantFactoryMethodDiscrete;
  43851. break;
  43852. case Ci.InterpolateLinear:
  43853. t = this.InterpolantFactoryMethodLinear;
  43854. break;
  43855. case Ci.InterpolateSmooth:
  43856. t = this.InterpolantFactoryMethodSmooth
  43857. }
  43858. if (void 0 !== t)
  43859. this.createInterpolant = t;
  43860. else {
  43861. var i = "unsupported interpolation for " + this.ValueTypeName + " keyframe track named " + this.name;
  43862. if (void 0 === this.createInterpolant) {
  43863. if (e === this.DefaultInterpolation)
  43864. throw new Error(i);
  43865. this.setInterpolation(this.DefaultInterpolation)
  43866. }
  43867. console.warn(i)
  43868. }
  43869. },
  43870. getInterpolation: function() {
  43871. switch (this.createInterpolant) {
  43872. case this.InterpolantFactoryMethodDiscrete:
  43873. return Ci.InterpolateDiscrete;
  43874. case this.InterpolantFactoryMethodLinear:
  43875. return Ci.InterpolateLinear;
  43876. case this.InterpolantFactoryMethodSmooth:
  43877. return Ci.InterpolateSmooth
  43878. }
  43879. },
  43880. getValueSize: function() {
  43881. return this.values.length / this.times.length
  43882. },
  43883. shift: function(e) {
  43884. if (0 !== e)
  43885. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  43886. t[i] += e;
  43887. return this
  43888. },
  43889. scale: function(e) {
  43890. if (1 !== e)
  43891. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  43892. t[i] *= e;
  43893. return this
  43894. },
  43895. trim: function(e, t) {
  43896. for (var i = this.times, n = i.length, r = 0, o = n - 1; r !== n && i[r] < e; )
  43897. ++r;
  43898. for (; -1 !== o && i[o] > t; )
  43899. --o;
  43900. if (++o,
  43901. 0 !== r || o !== n) {
  43902. o <= r && (r = (o = Math.max(o, 1)) - 1);
  43903. var a = this.getValueSize();
  43904. this.times = Ci.AnimationUtils.arraySlice(i, r, o),
  43905. this.values = Ci.AnimationUtils.arraySlice(this.values, r * a, o * a)
  43906. }
  43907. return this
  43908. },
  43909. validate: function() {
  43910. var e = !0
  43911. , t = this.getValueSize();
  43912. t - Math.floor(t) != 0 && (console.error("invalid value size in track", this),
  43913. e = !1);
  43914. var i = this.times
  43915. , n = this.values
  43916. , r = i.length;
  43917. 0 === r && (console.error("track is empty", this),
  43918. e = !1);
  43919. for (var o = null, a = 0; a !== r; a++) {
  43920. var s = i[a];
  43921. if ("number" == typeof s && isNaN(s)) {
  43922. console.error("time is not a valid number", this, a, s),
  43923. e = !1;
  43924. break
  43925. }
  43926. if (null !== o && s < o) {
  43927. console.error("out of order keys", this, a, s, o),
  43928. e = !1;
  43929. break
  43930. }
  43931. o = s
  43932. }
  43933. if (void 0 !== n && Ci.AnimationUtils.isTypedArray(n)) {
  43934. a = 0;
  43935. for (var l = n.length; a !== l; ++a) {
  43936. var c = n[a];
  43937. if (isNaN(c)) {
  43938. console.error("value is not a valid number", this, a, c),
  43939. e = !1;
  43940. break
  43941. }
  43942. }
  43943. }
  43944. return e
  43945. },
  43946. optimize: function() {
  43947. for (var e = this.times, t = this.values, i = this.getValueSize(), n = 1, r = 1, o = e.length - 1; r <= o; ++r) {
  43948. var a = !1
  43949. , s = e[r];
  43950. if (s !== e[r + 1] && (1 !== r || s !== s[0]))
  43951. for (var l = r * i, c = l - i, h = l + i, u = 0; u !== i; ++u) {
  43952. var d = t[l + u];
  43953. if (d !== t[c + u] || d !== t[h + u]) {
  43954. a = !0;
  43955. break
  43956. }
  43957. }
  43958. if (a) {
  43959. if (r !== n) {
  43960. e[n] = e[r];
  43961. var p = r * i
  43962. , f = n * i;
  43963. for (u = 0; u !== i; ++u)
  43964. t[f + u] = t[p + u]
  43965. }
  43966. ++n
  43967. }
  43968. }
  43969. return n !== e.length && (this.times = Ci.AnimationUtils.arraySlice(e, 0, n),
  43970. this.values = Ci.AnimationUtils.arraySlice(t, 0, n * i)),
  43971. this
  43972. }
  43973. },
  43974. Object.assign(Ci.KeyframeTrack, {
  43975. parse: function(e) {
  43976. if (void 0 === e.type)
  43977. throw new Error("track type undefined, can not parse");
  43978. var t = Ci.KeyframeTrack._getTrackTypeForValueTypeName(e.type);
  43979. if (void 0 === e.times) {
  43980. console.warn("legacy JSON format detected, converting");
  43981. var i = []
  43982. , n = [];
  43983. Ci.AnimationUtils.flattenJSON(e.keys, i, n, "value"),
  43984. e.times = i,
  43985. e.values = n
  43986. }
  43987. return void 0 !== t.parse ? t.parse(e) : new t(e.name,e.times,e.values,e.interpolation)
  43988. },
  43989. toJSON: function(e) {
  43990. var t, i = e.constructor;
  43991. if (void 0 !== i.toJSON)
  43992. t = i.toJSON(e);
  43993. else {
  43994. t = {
  43995. name: e.name,
  43996. times: Ci.AnimationUtils.convertArray(e.times, Array),
  43997. values: Ci.AnimationUtils.convertArray(e.values, Array)
  43998. };
  43999. var n = e.getInterpolation();
  44000. n !== e.DefaultInterpolation && (t.interpolation = n)
  44001. }
  44002. return t.type = e.ValueTypeName,
  44003. t
  44004. },
  44005. _getTrackTypeForValueTypeName: function(e) {
  44006. switch (e.toLowerCase()) {
  44007. case "scalar":
  44008. case "double":
  44009. case "float":
  44010. case "number":
  44011. case "integer":
  44012. return Ci.NumberKeyframeTrack;
  44013. case "vector":
  44014. case "vector2":
  44015. case "vector3":
  44016. case "vector4":
  44017. return Ci.VectorKeyframeTrack;
  44018. case "color":
  44019. return Ci.ColorKeyframeTrack;
  44020. case "quaternion":
  44021. return Ci.QuaternionKeyframeTrack;
  44022. case "bool":
  44023. case "boolean":
  44024. return Ci.BooleanKeyframeTrack;
  44025. case "string":
  44026. return Ci.StringKeyframeTrack
  44027. }
  44028. throw new Error("Unsupported typeName: " + e)
  44029. }
  44030. }),
  44031. Ci.PropertyBinding = function(e, t, i) {
  44032. this.path = t,
  44033. this.parsedPath = i || Ci.PropertyBinding.parseTrackName(t),
  44034. this.node = Ci.PropertyBinding.findNode(e, this.parsedPath.nodeName) || e,
  44035. this.rootNode = e
  44036. }
  44037. ,
  44038. Ci.PropertyBinding.prototype = {
  44039. constructor: Ci.PropertyBinding,
  44040. getValue: function(e, t) {
  44041. this.bind(),
  44042. this.getValue(e, t)
  44043. },
  44044. setValue: function(e, t) {
  44045. this.bind(),
  44046. this.setValue(e, t)
  44047. },
  44048. bind: function() {
  44049. var e = this.node
  44050. , t = this.parsedPath
  44051. , i = t.objectName
  44052. , n = t.propertyName
  44053. , r = t.propertyIndex;
  44054. if (e || (e = Ci.PropertyBinding.findNode(this.rootNode, t.nodeName) || this.rootNode,
  44055. this.node = e),
  44056. this.getValue = this._getValue_unavailable,
  44057. this.setValue = this._setValue_unavailable,
  44058. e) {
  44059. if (i) {
  44060. var o = t.objectIndex;
  44061. switch (i) {
  44062. case "materials":
  44063. if (!e.material)
  44064. return void console.error(" can not bind to material as node does not have a material", this);
  44065. if (!e.material.materials)
  44066. return void console.error(" can not bind to material.materials as node.material does not have a materials array", this);
  44067. e = e.material.materials;
  44068. break;
  44069. case "bones":
  44070. if (!e.skeleton)
  44071. return void console.error(" can not bind to bones as node does not have a skeleton", this);
  44072. e = e.skeleton.bones;
  44073. for (var a = 0; a < e.length; a++)
  44074. if (e[a].name === o) {
  44075. o = a;
  44076. break
  44077. }
  44078. break;
  44079. default:
  44080. if (void 0 === e[i])
  44081. return void console.error(" can not bind to objectName of node, undefined", this);
  44082. e = e[i]
  44083. }
  44084. if (void 0 !== o) {
  44085. if (void 0 === e[o])
  44086. return void console.error(" trying to bind to objectIndex of objectName, but is undefined:", this, e);
  44087. e = e[o]
  44088. }
  44089. }
  44090. var s = e[n];
  44091. if (s) {
  44092. var l = this.Versioning.None;
  44093. void 0 !== e.needsUpdate ? (l = this.Versioning.NeedsUpdate,
  44094. this.targetObject = e) : void 0 !== e.matrixWorldNeedsUpdate && (l = this.Versioning.MatrixWorldNeedsUpdate,
  44095. this.targetObject = e);
  44096. var c = this.BindingType.Direct;
  44097. if (void 0 !== r) {
  44098. if ("morphTargetInfluences" === n) {
  44099. if (!e.geometry)
  44100. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry", this);
  44101. if (!e.geometry.morphTargets)
  44102. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets", this);
  44103. for (a = 0; a < this.node.geometry.morphTargets.length; a++)
  44104. if (e.geometry.morphTargets[a].name === r) {
  44105. r = a;
  44106. break
  44107. }
  44108. }
  44109. c = this.BindingType.ArrayElement,
  44110. this.resolvedProperty = s,
  44111. this.propertyIndex = r
  44112. } else
  44113. void 0 !== s.fromArray && void 0 !== s.toArray ? (c = this.BindingType.HasFromToArray,
  44114. this.resolvedProperty = s) : void 0 !== s.length ? (c = this.BindingType.EntireArray,
  44115. this.resolvedProperty = s) : this.propertyName = n;
  44116. this.getValue = this.GetterByBindingType[c],
  44117. this.setValue = this.SetterByBindingTypeAndVersioning[c][l]
  44118. } else {
  44119. var h = t.nodeName;
  44120. console.error(" trying to update property for track: " + h + "." + n + " but it wasn't found.", e)
  44121. }
  44122. } else
  44123. console.error(" trying to update node for track: " + this.path + " but it wasn't found.")
  44124. },
  44125. unbind: function() {
  44126. this.node = null,
  44127. this.getValue = this._getValue_unbound,
  44128. this.setValue = this._setValue_unbound
  44129. }
  44130. },
  44131. Object.assign(Ci.PropertyBinding.prototype, {
  44132. _getValue_unavailable: function() {},
  44133. _setValue_unavailable: function() {},
  44134. _getValue_unbound: Ci.PropertyBinding.prototype.getValue,
  44135. _setValue_unbound: Ci.PropertyBinding.prototype.setValue,
  44136. BindingType: {
  44137. Direct: 0,
  44138. EntireArray: 1,
  44139. ArrayElement: 2,
  44140. HasFromToArray: 3
  44141. },
  44142. Versioning: {
  44143. None: 0,
  44144. NeedsUpdate: 1,
  44145. MatrixWorldNeedsUpdate: 2
  44146. },
  44147. GetterByBindingType: [function(e, t) {
  44148. e[t] = this.node[this.propertyName]
  44149. }
  44150. , function(e, t) {
  44151. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44152. e[t++] = i[n]
  44153. }
  44154. , function(e, t) {
  44155. e[t] = this.resolvedProperty[this.propertyIndex]
  44156. }
  44157. , function(e, t) {
  44158. this.resolvedProperty.toArray(e, t)
  44159. }
  44160. ],
  44161. SetterByBindingTypeAndVersioning: [[function(e, t) {
  44162. this.node[this.propertyName] = e[t]
  44163. }
  44164. , function(e, t) {
  44165. this.node[this.propertyName] = e[t],
  44166. this.targetObject.needsUpdate = !0
  44167. }
  44168. , function(e, t) {
  44169. this.node[this.propertyName] = e[t],
  44170. this.targetObject.matrixWorldNeedsUpdate = !0
  44171. }
  44172. ], [function(e, t) {
  44173. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44174. i[n] = e[t++]
  44175. }
  44176. , function(e, t) {
  44177. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44178. i[n] = e[t++];
  44179. this.targetObject.needsUpdate = !0
  44180. }
  44181. , function(e, t) {
  44182. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44183. i[n] = e[t++];
  44184. this.targetObject.matrixWorldNeedsUpdate = !0
  44185. }
  44186. ], [function(e, t) {
  44187. this.resolvedProperty[this.propertyIndex] = e[t]
  44188. }
  44189. , function(e, t) {
  44190. this.resolvedProperty[this.propertyIndex] = e[t],
  44191. this.targetObject.needsUpdate = !0
  44192. }
  44193. , function(e, t) {
  44194. this.resolvedProperty[this.propertyIndex] = e[t],
  44195. this.targetObject.matrixWorldNeedsUpdate = !0
  44196. }
  44197. ], [function(e, t) {
  44198. this.resolvedProperty.fromArray(e, t)
  44199. }
  44200. , function(e, t) {
  44201. this.resolvedProperty.fromArray(e, t),
  44202. this.targetObject.needsUpdate = !0
  44203. }
  44204. , function(e, t) {
  44205. this.resolvedProperty.fromArray(e, t),
  44206. this.targetObject.matrixWorldNeedsUpdate = !0
  44207. }
  44208. ]]
  44209. }),
  44210. Ci.PropertyBinding.Composite = function(e, t, i) {
  44211. var n = i || Ci.PropertyBinding.parseTrackName(t);
  44212. this._targetGroup = e,
  44213. this._bindings = e.subscribe_(t, n)
  44214. }
  44215. ,
  44216. Ci.PropertyBinding.Composite.prototype = {
  44217. constructor: Ci.PropertyBinding.Composite,
  44218. getValue: function(e, t) {
  44219. this.bind();
  44220. var i = this._targetGroup.nCachedObjects_
  44221. , n = this._bindings[i];
  44222. void 0 !== n && n.getValue(e, t)
  44223. },
  44224. setValue: function(e, t) {
  44225. for (var i = this._bindings, n = this._targetGroup.nCachedObjects_, r = i.length; n !== r; ++n)
  44226. i[n].setValue(e, t)
  44227. },
  44228. bind: function() {
  44229. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  44230. e[t].bind()
  44231. },
  44232. unbind: function() {
  44233. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  44234. e[t].unbind()
  44235. }
  44236. },
  44237. Ci.PropertyBinding.create = function(e, t, i) {
  44238. return e instanceof Ci.AnimationObjectGroup ? new Ci.PropertyBinding.Composite(e,t,i) : new Ci.PropertyBinding(e,t,i)
  44239. }
  44240. ,
  44241. Ci.PropertyBinding.parseTrackName = function(e) {
  44242. var t = /^(([\w]+\/)*)([\w-\d]+)?(\.([\w]+)(\[([\w\d\[\]\_.:\- ]+)\])?)?(\.([\w.]+)(\[([\w\d\[\]\_. ]+)\])?)$/
  44243. , i = t.exec(e);
  44244. if (!i)
  44245. throw new Error("cannot parse trackName at all: " + e);
  44246. i.index === t.lastIndex && t.lastIndex++;
  44247. var n = {
  44248. nodeName: i[3],
  44249. objectName: i[5],
  44250. objectIndex: i[7],
  44251. propertyName: i[9],
  44252. propertyIndex: i[11]
  44253. };
  44254. if (null === n.propertyName || 0 === n.propertyName.length)
  44255. throw new Error("can not parse propertyName from trackName: " + e);
  44256. return n
  44257. }
  44258. ,
  44259. Ci.PropertyBinding.findNode = function(e, r) {
  44260. if (!r || "" === r || "root" === r || "." === r || -1 === r || r === e.name || r === e.uuid)
  44261. return e;
  44262. if (e.skeleton) {
  44263. var t = function(e) {
  44264. for (var t = 0; t < e.bones.length; t++) {
  44265. var i = e.bones[t];
  44266. if (i.name === r)
  44267. return i
  44268. }
  44269. return null
  44270. }(e.skeleton);
  44271. if (t)
  44272. return t
  44273. }
  44274. if (e.children) {
  44275. var o = function(e) {
  44276. for (var t = 0; t < e.length; t++) {
  44277. var i = e[t];
  44278. if (i.name === r || i.uuid === r)
  44279. return i;
  44280. var n = o(i.children);
  44281. if (n)
  44282. return n
  44283. }
  44284. return null
  44285. }
  44286. , i = o(e.children);
  44287. if (i)
  44288. return i
  44289. }
  44290. return null
  44291. }
  44292. ,
  44293. Ci.PropertyMixer = function(e, t, i) {
  44294. this.binding = e,
  44295. this.valueSize = i;
  44296. var n, r = Float64Array;
  44297. switch (t) {
  44298. case "quaternion":
  44299. n = this._slerp;
  44300. break;
  44301. case "string":
  44302. case "bool":
  44303. r = Array,
  44304. n = this._select;
  44305. break;
  44306. default:
  44307. n = this._lerp
  44308. }
  44309. this.buffer = new r(4 * i),
  44310. this._mixBufferRegion = n,
  44311. this.cumulativeWeight = 0,
  44312. this.useCount = 0,
  44313. this.referenceCount = 0
  44314. }
  44315. ,
  44316. Ci.PropertyMixer.prototype = {
  44317. constructor: Ci.PropertyMixer,
  44318. accumulate: function(e, t) {
  44319. var i = this.buffer
  44320. , n = this.valueSize
  44321. , r = e * n + n
  44322. , o = this.cumulativeWeight;
  44323. if (0 === o) {
  44324. for (var a = 0; a !== n; ++a)
  44325. i[r + a] = i[a];
  44326. o = t
  44327. } else {
  44328. var s = t / (o += t);
  44329. this._mixBufferRegion(i, r, 0, s, n)
  44330. }
  44331. this.cumulativeWeight = o
  44332. },
  44333. apply: function(e) {
  44334. var t = this.valueSize
  44335. , i = this.buffer
  44336. , n = e * t + t
  44337. , r = this.cumulativeWeight
  44338. , o = this.binding;
  44339. if (this.cumulativeWeight = 0,
  44340. r < 1) {
  44341. var a = 3 * t;
  44342. this._mixBufferRegion(i, n, a, 1 - r, t)
  44343. }
  44344. for (var s = t, l = t + t; s !== l; ++s)
  44345. if (i[s] !== i[s + t]) {
  44346. o.setValue(i, n);
  44347. break
  44348. }
  44349. },
  44350. saveOriginalState: function() {
  44351. var e = this.binding
  44352. , t = this.buffer
  44353. , i = this.valueSize
  44354. , n = 3 * i;
  44355. e.getValue(t, n);
  44356. for (var r = i, o = n; r !== o; ++r)
  44357. t[r] = t[n + r % i];
  44358. this.cumulativeWeight = 0
  44359. },
  44360. restoreOriginalState: function() {
  44361. var e = 3 * this.valueSize;
  44362. this.binding.setValue(this.buffer, e)
  44363. },
  44364. _select: function(e, t, i, n, r) {
  44365. if (.5 <= n)
  44366. for (var o = 0; o !== r; ++o)
  44367. e[t + o] = e[i + o]
  44368. },
  44369. _slerp: function(e, t, i, n, r) {
  44370. Ci.Quaternion.slerpFlat(e, t, e, t, e, i, n)
  44371. },
  44372. _lerp: function(e, t, i, n, r) {
  44373. for (var o = 1 - n, a = 0; a !== r; ++a) {
  44374. var s = t + a;
  44375. e[s] = e[s] * o + e[i + a] * n
  44376. }
  44377. }
  44378. },
  44379. Ci.BooleanKeyframeTrack = function(e, t, i) {
  44380. Ci.KeyframeTrack.call(this, e, t, i)
  44381. }
  44382. ,
  44383. Ci.BooleanKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44384. constructor: Ci.BooleanKeyframeTrack,
  44385. ValueTypeName: "bool",
  44386. ValueBufferType: Array,
  44387. DefaultInterpolation: Ci.IntepolateDiscrete,
  44388. InterpolantFactoryMethodLinear: void 0,
  44389. InterpolantFactoryMethodSmooth: void 0
  44390. }),
  44391. Ci.NumberKeyframeTrack = function(e, t, i, n) {
  44392. Ci.KeyframeTrack.call(this, e, t, i, n)
  44393. }
  44394. ,
  44395. Ci.NumberKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44396. constructor: Ci.NumberKeyframeTrack,
  44397. ValueTypeName: "number"
  44398. }),
  44399. Ci.QuaternionKeyframeTrack = function(e, t, i, n) {
  44400. Ci.KeyframeTrack.call(this, e, t, i, n)
  44401. }
  44402. ,
  44403. Ci.QuaternionKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44404. constructor: Ci.QuaternionKeyframeTrack,
  44405. ValueTypeName: "quaternion",
  44406. DefaultInterpolation: Ci.InterpolateLinear,
  44407. InterpolantFactoryMethodLinear: function(e) {
  44408. return new Ci.QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),e)
  44409. },
  44410. InterpolantFactoryMethodSmooth: void 0
  44411. }),
  44412. Ci.StringKeyframeTrack = function(e, t, i, n) {
  44413. Ci.KeyframeTrack.call(this, e, t, i, n)
  44414. }
  44415. ,
  44416. Ci.StringKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44417. constructor: Ci.StringKeyframeTrack,
  44418. ValueTypeName: "string",
  44419. ValueBufferType: Array,
  44420. DefaultInterpolation: Ci.IntepolateDiscrete,
  44421. InterpolantFactoryMethodLinear: void 0,
  44422. InterpolantFactoryMethodSmooth: void 0
  44423. }),
  44424. Ci.VectorKeyframeTrack = function(e, t, i, n) {
  44425. Ci.KeyframeTrack.call(this, e, t, i, n)
  44426. }
  44427. ,
  44428. Ci.VectorKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44429. constructor: Ci.VectorKeyframeTrack,
  44430. ValueTypeName: "vector"
  44431. }),
  44432. Ci.Audio = function(e) {
  44433. Ci.Object3D.call(this),
  44434. this.type = "Audio",
  44435. this.context = e.context,
  44436. this.source = this.context.createBufferSource(),
  44437. this.source.onended = this.onEnded.bind(this),
  44438. this.gain = this.context.createGain(),
  44439. this.gain.connect(e.getInput()),
  44440. this.autoplay = !1,
  44441. this.startTime = 0,
  44442. this.playbackRate = 1,
  44443. this.isPlaying = !1,
  44444. this.hasPlaybackControl = !0,
  44445. this.sourceType = "empty",
  44446. this.filter = null
  44447. }
  44448. ,
  44449. Ci.Audio.prototype = Object.create(Ci.Object3D.prototype),
  44450. Ci.Audio.prototype.constructor = Ci.Audio,
  44451. Ci.Audio.prototype.getOutput = function() {
  44452. return this.gain
  44453. }
  44454. ,
  44455. Ci.Audio.prototype.load = function(e) {
  44456. var t = new Ci.AudioBuffer(this.context);
  44457. return t.load(e),
  44458. this.setBuffer(t),
  44459. this
  44460. }
  44461. ,
  44462. Ci.Audio.prototype.setNodeSource = function(e) {
  44463. return this.hasPlaybackControl = !1,
  44464. this.sourceType = "audioNode",
  44465. this.source = e,
  44466. this.connect(),
  44467. this
  44468. }
  44469. ,
  44470. Ci.Audio.prototype.setBuffer = function(e) {
  44471. var t = this;
  44472. return e.onReady(function(e) {
  44473. t.source.buffer = e,
  44474. t.sourceType = "buffer",
  44475. t.autoplay && t.play()
  44476. }),
  44477. this
  44478. }
  44479. ,
  44480. Ci.Audio.prototype.play = function() {
  44481. if (!0 !== this.isPlaying)
  44482. if (!1 !== this.hasPlaybackControl) {
  44483. var e = this.context.createBufferSource();
  44484. e.buffer = this.source.buffer,
  44485. e.loop = this.source.loop,
  44486. e.onended = this.source.onended,
  44487. e.start(0, this.startTime),
  44488. e.playbackRate.value = this.playbackRate,
  44489. this.isPlaying = !0,
  44490. this.source = e,
  44491. this.connect()
  44492. } else
  44493. console.warn("THREE.Audio: this Audio has no playback control.");
  44494. else
  44495. console.warn("THREE.Audio: Audio is already playing.")
  44496. }
  44497. ,
  44498. Ci.Audio.prototype.pause = function() {
  44499. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  44500. void (this.startTime = this.context.currentTime))
  44501. }
  44502. ,
  44503. Ci.Audio.prototype.stop = function() {
  44504. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  44505. void (this.startTime = 0))
  44506. }
  44507. ,
  44508. Ci.Audio.prototype.connect = function() {
  44509. null !== this.filter ? (this.source.connect(this.filter),
  44510. this.filter.connect(this.getOutput())) : this.source.connect(this.getOutput())
  44511. }
  44512. ,
  44513. Ci.Audio.prototype.disconnect = function() {
  44514. null !== this.filter ? (this.source.disconnect(this.filter),
  44515. this.filter.disconnect(this.getOutput())) : this.source.disconnect(this.getOutput())
  44516. }
  44517. ,
  44518. Ci.Audio.prototype.getFilter = function() {
  44519. return this.filter
  44520. }
  44521. ,
  44522. Ci.Audio.prototype.setFilter = function(e) {
  44523. void 0 === e && (e = null),
  44524. !0 === this.isPlaying ? (this.disconnect(),
  44525. this.filter = e,
  44526. this.connect()) : this.filter = e
  44527. }
  44528. ,
  44529. Ci.Audio.prototype.setPlaybackRate = function(e) {
  44530. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.playbackRate = e,
  44531. void (!0 === this.isPlaying && (this.source.playbackRate.value = this.playbackRate)))
  44532. }
  44533. ,
  44534. Ci.Audio.prototype.getPlaybackRate = function() {
  44535. return this.playbackRate
  44536. }
  44537. ,
  44538. Ci.Audio.prototype.onEnded = function() {
  44539. this.isPlaying = !1
  44540. }
  44541. ,
  44542. Ci.Audio.prototype.setLoop = function(e) {
  44543. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : void (this.source.loop = e)
  44544. }
  44545. ,
  44546. Ci.Audio.prototype.getLoop = function() {
  44547. return !1 === this.hasPlaybackControl ? (console.warn("THREE.Audio: this Audio has no playback control."),
  44548. !1) : this.source.loop
  44549. }
  44550. ,
  44551. Ci.Audio.prototype.setVolume = function(e) {
  44552. this.gain.gain.value = e
  44553. }
  44554. ,
  44555. Ci.Audio.prototype.getVolume = function() {
  44556. return this.gain.gain.value
  44557. }
  44558. ,
  44559. Ci.AudioAnalyser = function(e, t) {
  44560. this.analyser = e.context.createAnalyser(),
  44561. this.analyser.fftSize = void 0 !== t ? t : 2048,
  44562. this.data = new Uint8Array(this.analyser.frequencyBinCount),
  44563. e.getOutput().connect(this.analyser)
  44564. }
  44565. ,
  44566. Ci.AudioAnalyser.prototype = {
  44567. constructor: Ci.AudioAnalyser,
  44568. getData: function() {
  44569. return this.analyser.getByteFrequencyData(this.data),
  44570. this.data
  44571. }
  44572. },
  44573. Ci.AudioBuffer = function(e) {
  44574. this.context = e,
  44575. this.ready = !1,
  44576. this.readyCallbacks = []
  44577. }
  44578. ,
  44579. Ci.AudioBuffer.prototype.load = function(e) {
  44580. var i = this
  44581. , t = new XMLHttpRequest;
  44582. return t.open("GET", e, !0),
  44583. t.responseType = "arraybuffer",
  44584. t.onload = function(e) {
  44585. i.context.decodeAudioData(this.response, function(e) {
  44586. i.buffer = e,
  44587. i.ready = !0;
  44588. for (var t = 0; t < i.readyCallbacks.length; t++)
  44589. i.readyCallbacks[t](i.buffer);
  44590. i.readyCallbacks = []
  44591. })
  44592. }
  44593. ,
  44594. t.send(),
  44595. this
  44596. }
  44597. ,
  44598. Ci.AudioBuffer.prototype.onReady = function(e) {
  44599. this.ready ? e(this.buffer) : this.readyCallbacks.push(e)
  44600. }
  44601. ,
  44602. Ci.PositionalAudio = function(e) {
  44603. Ci.Audio.call(this, e),
  44604. this.panner = this.context.createPanner(),
  44605. this.panner.connect(this.gain)
  44606. }
  44607. ,
  44608. Ci.PositionalAudio.prototype = Object.create(Ci.Audio.prototype),
  44609. Ci.PositionalAudio.prototype.constructor = Ci.PositionalAudio,
  44610. Ci.PositionalAudio.prototype.getOutput = function() {
  44611. return this.panner
  44612. }
  44613. ,
  44614. Ci.PositionalAudio.prototype.setRefDistance = function(e) {
  44615. this.panner.refDistance = e
  44616. }
  44617. ,
  44618. Ci.PositionalAudio.prototype.getRefDistance = function() {
  44619. return this.panner.refDistance
  44620. }
  44621. ,
  44622. Ci.PositionalAudio.prototype.setRolloffFactor = function(e) {
  44623. this.panner.rolloffFactor = e
  44624. }
  44625. ,
  44626. Ci.PositionalAudio.prototype.getRolloffFactor = function() {
  44627. return this.panner.rolloffFactor
  44628. }
  44629. ,
  44630. Ci.PositionalAudio.prototype.setDistanceModel = function(e) {
  44631. this.panner.distanceModel = e
  44632. }
  44633. ,
  44634. Ci.PositionalAudio.prototype.getDistanceModel = function() {
  44635. return this.panner.distanceModel
  44636. }
  44637. ,
  44638. Ci.PositionalAudio.prototype.setMaxDistance = function(e) {
  44639. this.panner.maxDistance = e
  44640. }
  44641. ,
  44642. Ci.PositionalAudio.prototype.getMaxDistance = function() {
  44643. return this.panner.maxDistance
  44644. }
  44645. ,
  44646. Ci.PositionalAudio.prototype.updateMatrixWorld = (it = new Ci.Vector3,
  44647. function(e) {
  44648. Ci.Object3D.prototype.updateMatrixWorld.call(this, e),
  44649. it.setFromMatrixPosition(this.matrixWorld),
  44650. this.panner.setPosition(it.x, it.y, it.z)
  44651. }
  44652. ),
  44653. Ci.AudioListener = function() {
  44654. Ci.Object3D.call(this),
  44655. this.type = "AudioListener",
  44656. this.context = new (window.AudioContext || window.webkitAudioContext),
  44657. this.gain = this.context.createGain(),
  44658. this.gain.connect(this.context.destination),
  44659. this.filter = null
  44660. }
  44661. ,
  44662. Ci.AudioListener.prototype = Object.create(Ci.Object3D.prototype),
  44663. Ci.AudioListener.prototype.constructor = Ci.AudioListener,
  44664. Ci.AudioListener.prototype.getInput = function() {
  44665. return this.gain
  44666. }
  44667. ,
  44668. Ci.AudioListener.prototype.removeFilter = function() {
  44669. null !== this.filter && (this.gain.disconnect(this.filter),
  44670. this.filter.disconnect(this.context.destination),
  44671. this.gain.connect(this.context.destination),
  44672. this.filter = null)
  44673. }
  44674. ,
  44675. Ci.AudioListener.prototype.setFilter = function(e) {
  44676. null !== this.filter ? (this.gain.disconnect(this.filter),
  44677. this.filter.disconnect(this.context.destination)) : this.gain.disconnect(this.context.destination),
  44678. this.filter = e,
  44679. this.gain.connect(this.filter),
  44680. this.filter.connect(this.context.destination)
  44681. }
  44682. ,
  44683. Ci.AudioListener.prototype.getFilter = function() {
  44684. return this.filter
  44685. }
  44686. ,
  44687. Ci.AudioListener.prototype.setMasterVolume = function(e) {
  44688. this.gain.gain.value = e
  44689. }
  44690. ,
  44691. Ci.AudioListener.prototype.getMasterVolume = function() {
  44692. return this.gain.gain.value
  44693. }
  44694. ,
  44695. Ci.AudioListener.prototype.updateMatrixWorld = (Je = new Ci.Vector3,
  44696. $e = new Ci.Quaternion,
  44697. et = new Ci.Vector3,
  44698. tt = new Ci.Vector3,
  44699. function(e) {
  44700. Ci.Object3D.prototype.updateMatrixWorld.call(this, e);
  44701. var t = this.context.listener
  44702. , i = this.up;
  44703. this.matrixWorld.decompose(Je, $e, et),
  44704. tt.set(0, 0, -1).applyQuaternion($e),
  44705. t.setPosition(Je.x, Je.y, Je.z),
  44706. t.setOrientation(tt.x, tt.y, tt.z, i.x, i.y, i.z)
  44707. }
  44708. ),
  44709. Ci.Camera = function() {
  44710. Ci.Object3D.call(this),
  44711. this.type = "Camera",
  44712. this.matrixWorldInverse = new Ci.Matrix4,
  44713. this.projectionMatrix = new Ci.Matrix4
  44714. }
  44715. ,
  44716. Ci.Camera.prototype = Object.create(Ci.Object3D.prototype),
  44717. Ci.Camera.prototype.constructor = Ci.Camera,
  44718. Ci.Camera.prototype.getWorldDirection = (Qe = new Ci.Quaternion,
  44719. function(e) {
  44720. var t = e || new Ci.Vector3;
  44721. return this.getWorldQuaternion(Qe),
  44722. t.set(0, 0, -1).applyQuaternion(Qe)
  44723. }
  44724. ),
  44725. Ci.Camera.prototype.lookAt = (Ke = new Ci.Matrix4,
  44726. function(e) {
  44727. Ke.lookAt(this.position, e, this.up),
  44728. this.quaternion.setFromRotationMatrix(Ke)
  44729. }
  44730. ),
  44731. Ci.Camera.prototype.clone = function() {
  44732. return (new this.constructor).copy(this)
  44733. }
  44734. ,
  44735. Ci.Camera.prototype.copy = function(e) {
  44736. return Ci.Object3D.prototype.copy.call(this, e),
  44737. this.matrixWorldInverse.copy(e.matrixWorldInverse),
  44738. this.projectionMatrix.copy(e.projectionMatrix),
  44739. this
  44740. }
  44741. ,
  44742. Ci.CubeCamera = function(e, t, i) {
  44743. Ci.Object3D.call(this),
  44744. this.type = "CubeCamera";
  44745. var r = new Ci.PerspectiveCamera(90,1,e,t);
  44746. r.up.set(0, -1, 0),
  44747. r.lookAt(new Ci.Vector3(1,0,0)),
  44748. this.add(r);
  44749. var o = new Ci.PerspectiveCamera(90,1,e,t);
  44750. o.up.set(0, -1, 0),
  44751. o.lookAt(new Ci.Vector3(-1,0,0)),
  44752. this.add(o);
  44753. var a = new Ci.PerspectiveCamera(90,1,e,t);
  44754. a.up.set(0, 0, 1),
  44755. a.lookAt(new Ci.Vector3(0,1,0)),
  44756. this.add(a);
  44757. var s = new Ci.PerspectiveCamera(90,1,e,t);
  44758. s.up.set(0, 0, -1),
  44759. s.lookAt(new Ci.Vector3(0,-1,0)),
  44760. this.add(s);
  44761. var l = new Ci.PerspectiveCamera(90,1,e,t);
  44762. l.up.set(0, -1, 0),
  44763. l.lookAt(new Ci.Vector3(0,0,1)),
  44764. this.add(l);
  44765. var c = new Ci.PerspectiveCamera(90,1,e,t);
  44766. c.up.set(0, -1, 0),
  44767. c.lookAt(new Ci.Vector3(0,0,-1)),
  44768. this.add(c);
  44769. var n = {
  44770. format: Ci.RGBFormat,
  44771. magFilter: Ci.LinearFilter,
  44772. minFilter: Ci.LinearFilter
  44773. };
  44774. this.renderTarget = new Ci.WebGLRenderTargetCube(i,i,n),
  44775. this.updateCubeMap = function(e, t) {
  44776. null === this.parent && this.updateMatrixWorld();
  44777. var i = this.renderTarget
  44778. , n = i.texture.generateMipmaps;
  44779. i.texture.generateMipmaps = !1,
  44780. i.activeCubeFace = 0,
  44781. e.render(t, r, i),
  44782. i.activeCubeFace = 1,
  44783. e.render(t, o, i),
  44784. i.activeCubeFace = 2,
  44785. e.render(t, a, i),
  44786. i.activeCubeFace = 3,
  44787. e.render(t, s, i),
  44788. i.activeCubeFace = 4,
  44789. e.render(t, l, i),
  44790. i.texture.generateMipmaps = n,
  44791. i.activeCubeFace = 5,
  44792. e.render(t, c, i),
  44793. e.setRenderTarget(null)
  44794. }
  44795. }
  44796. ,
  44797. Ci.CubeCamera.prototype = Object.create(Ci.Object3D.prototype),
  44798. Ci.CubeCamera.prototype.constructor = Ci.CubeCamera,
  44799. Ci.OrthographicCamera = function(e, t, i, n, r, o) {
  44800. Ci.Camera.call(this),
  44801. this.type = "OrthographicCamera",
  44802. this.zoom = 1,
  44803. this.left = e,
  44804. this.right = t,
  44805. this.top = i,
  44806. this.bottom = n,
  44807. this.near = void 0 !== r ? r : .1,
  44808. this.far = void 0 !== o ? o : 2e3,
  44809. this.updateProjectionMatrix()
  44810. }
  44811. ,
  44812. Ci.OrthographicCamera.prototype = Object.create(Ci.Camera.prototype),
  44813. Ci.OrthographicCamera.prototype.constructor = Ci.OrthographicCamera,
  44814. Ci.OrthographicCamera.prototype.updateProjectionMatrix = function() {
  44815. var e = (this.right - this.left) / (2 * this.zoom)
  44816. , t = (this.top - this.bottom) / (2 * this.zoom)
  44817. , i = (this.right + this.left) / 2
  44818. , n = (this.top + this.bottom) / 2;
  44819. this.projectionMatrix.makeOrthographic(i - e, i + e, n + t, n - t, this.near, this.far)
  44820. }
  44821. ,
  44822. Ci.OrthographicCamera.prototype.copy = function(e) {
  44823. return Ci.Camera.prototype.copy.call(this, e),
  44824. this.left = e.left,
  44825. this.right = e.right,
  44826. this.top = e.top,
  44827. this.bottom = e.bottom,
  44828. this.near = e.near,
  44829. this.far = e.far,
  44830. this.zoom = e.zoom,
  44831. this
  44832. }
  44833. ,
  44834. Ci.OrthographicCamera.prototype.toJSON = function(e) {
  44835. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  44836. return t.object.zoom = this.zoom,
  44837. t.object.left = this.left,
  44838. t.object.right = this.right,
  44839. t.object.top = this.top,
  44840. t.object.bottom = this.bottom,
  44841. t.object.near = this.near,
  44842. t.object.far = this.far,
  44843. t
  44844. }
  44845. ,
  44846. Ci.PerspectiveCamera = function(e, t, i, n) {
  44847. Ci.Camera.call(this),
  44848. this.type = "PerspectiveCamera",
  44849. this.focalLength = 10,
  44850. this.zoom = 1,
  44851. this.fov = void 0 !== e ? e : 50,
  44852. this.aspect = void 0 !== t ? t : 1,
  44853. this.near = void 0 !== i ? i : .1,
  44854. this.far = void 0 !== n ? n : 2e3,
  44855. this.updateProjectionMatrix()
  44856. }
  44857. ,
  44858. Ci.PerspectiveCamera.prototype = Object.create(Ci.Camera.prototype),
  44859. Ci.PerspectiveCamera.prototype.constructor = Ci.PerspectiveCamera,
  44860. Ci.PerspectiveCamera.prototype.setLens = function(e, t) {
  44861. void 0 === t && (t = 24),
  44862. this.fov = 2 * Ci.Math.radToDeg(Math.atan(t / (2 * e))),
  44863. this.updateProjectionMatrix()
  44864. }
  44865. ,
  44866. Ci.PerspectiveCamera.prototype.setViewOffset = function(e, t, i, n, r, o) {
  44867. this.fullWidth = e,
  44868. this.fullHeight = t,
  44869. this.x = i,
  44870. this.y = n,
  44871. this.width = r,
  44872. this.height = o,
  44873. this.updateProjectionMatrix()
  44874. }
  44875. ,
  44876. Ci.PerspectiveCamera.prototype.updateProjectionMatrix = function() {
  44877. var e = Ci.Math.radToDeg(2 * Math.atan(Math.tan(.5 * Ci.Math.degToRad(this.fov)) / this.zoom));
  44878. if (this.fullWidth) {
  44879. var t = this.fullWidth / this.fullHeight
  44880. , i = Math.tan(Ci.Math.degToRad(.5 * e)) * this.near
  44881. , n = -i
  44882. , r = t * n
  44883. , o = t * i
  44884. , a = Math.abs(o - r)
  44885. , s = Math.abs(i - n);
  44886. this.projectionMatrix.makeFrustum(r + this.x * a / this.fullWidth, r + (this.x + this.width) * a / this.fullWidth, i - (this.y + this.height) * s / this.fullHeight, i - this.y * s / this.fullHeight, this.near, this.far)
  44887. } else
  44888. this.projectionMatrix.makePerspective(e, this.aspect, this.near, this.far)
  44889. }
  44890. ,
  44891. Ci.PerspectiveCamera.prototype.copy = function(e) {
  44892. return Ci.Camera.prototype.copy.call(this, e),
  44893. this.focalLength = e.focalLength,
  44894. this.zoom = e.zoom,
  44895. this.fov = e.fov,
  44896. this.aspect = e.aspect,
  44897. this.near = e.near,
  44898. this.far = e.far,
  44899. this
  44900. }
  44901. ,
  44902. Ci.PerspectiveCamera.prototype.toJSON = function(e) {
  44903. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  44904. return t.object.focalLength = this.focalLength,
  44905. t.object.zoom = this.zoom,
  44906. t.object.fov = this.fov,
  44907. t.object.aspect = this.aspect,
  44908. t.object.near = this.near,
  44909. t.object.far = this.far,
  44910. t
  44911. }
  44912. ,
  44913. Ci.StereoCamera = function() {
  44914. this.type = "StereoCamera",
  44915. this.aspect = 1,
  44916. this.cameraL = new Ci.PerspectiveCamera,
  44917. this.cameraL.layers.enable(1),
  44918. this.cameraL.matrixAutoUpdate = !1,
  44919. this.cameraR = new Ci.PerspectiveCamera,
  44920. this.cameraR.layers.enable(2),
  44921. this.cameraR.matrixAutoUpdate = !1
  44922. }
  44923. ,
  44924. Ci.StereoCamera.prototype = {
  44925. constructor: Ci.StereoCamera,
  44926. update: (Xe = new Ci.Matrix4,
  44927. Ze = new Ci.Matrix4,
  44928. function(e) {
  44929. if (Ge !== e.focalLength || We !== e.fov || je !== e.aspect * this.aspect || Ye !== e.near || qe !== e.far) {
  44930. Ge = e.focalLength,
  44931. We = e.fov,
  44932. je = e.aspect * this.aspect,
  44933. Ye = e.near,
  44934. qe = e.far;
  44935. var t, i, n = e.projectionMatrix.clone(), r = .032 * Ye / Ge, o = Ye * Math.tan(Ci.Math.degToRad(.5 * We));
  44936. Ze.elements[12] = -.032,
  44937. Xe.elements[12] = .032,
  44938. t = -o * je + r,
  44939. i = o * je + r,
  44940. n.elements[0] = 2 * Ye / (i - t),
  44941. n.elements[8] = (i + t) / (i - t),
  44942. this.cameraL.projectionMatrix.copy(n),
  44943. t = -o * je - r,
  44944. i = o * je - r,
  44945. n.elements[0] = 2 * Ye / (i - t),
  44946. n.elements[8] = (i + t) / (i - t),
  44947. this.cameraR.projectionMatrix.copy(n)
  44948. }
  44949. this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(Ze),
  44950. this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(Xe)
  44951. }
  44952. )
  44953. },
  44954. Ci.Light = function(e, t) {
  44955. Ci.Object3D.call(this),
  44956. this.type = "Light",
  44957. this.color = new Ci.Color(e),
  44958. this.intensity = void 0 !== t ? t : 1,
  44959. this.receiveShadow = void 0
  44960. }
  44961. ,
  44962. Ci.Light.prototype = Object.create(Ci.Object3D.prototype),
  44963. Ci.Light.prototype.constructor = Ci.Light,
  44964. Ci.Light.prototype.copy = function(e) {
  44965. return Ci.Object3D.prototype.copy.call(this, e),
  44966. this.color.copy(e.color),
  44967. this.intensity = e.intensity,
  44968. this
  44969. }
  44970. ,
  44971. Ci.Light.prototype.toJSON = function(e) {
  44972. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  44973. return t.object.color = this.color.getHex(),
  44974. t.object.intensity = this.intensity,
  44975. void 0 !== this.groundColor && (t.object.groundColor = this.groundColor.getHex()),
  44976. void 0 !== this.distance && (t.object.distance = this.distance),
  44977. void 0 !== this.angle && (t.object.angle = this.angle),
  44978. void 0 !== this.decay && (t.object.decay = this.decay),
  44979. void 0 !== this.penumbra && (t.object.penumbra = this.penumbra),
  44980. t
  44981. }
  44982. ,
  44983. Ci.LightShadow = function(e) {
  44984. this.camera = e,
  44985. this.bias = 0,
  44986. this.radius = 1,
  44987. this.mapSize = new Ci.Vector2(512,512),
  44988. this.map = null,
  44989. this.matrix = new Ci.Matrix4
  44990. }
  44991. ,
  44992. Ci.LightShadow.prototype = {
  44993. constructor: Ci.LightShadow,
  44994. copy: function(e) {
  44995. return this.camera = e.camera.clone(),
  44996. this.bias = e.bias,
  44997. this.radius = e.radius,
  44998. this.mapSize.copy(e.mapSize),
  44999. this
  45000. },
  45001. clone: function() {
  45002. return (new this.constructor).copy(this)
  45003. }
  45004. },
  45005. Ci.AmbientLight = function(e, t) {
  45006. Ci.Light.call(this, e, t),
  45007. this.type = "AmbientLight",
  45008. this.castShadow = void 0
  45009. }
  45010. ,
  45011. Ci.AmbientLight.prototype = Object.create(Ci.Light.prototype),
  45012. Ci.AmbientLight.prototype.constructor = Ci.AmbientLight,
  45013. Ci.DirectionalLight = function(e, t) {
  45014. Ci.Light.call(this, e, t),
  45015. this.type = "DirectionalLight",
  45016. this.position.set(0, 1, 0),
  45017. this.updateMatrix(),
  45018. this.target = new Ci.Object3D,
  45019. this.shadow = new Ci.LightShadow(new Ci.OrthographicCamera(-5,5,5,-5,.5,500))
  45020. }
  45021. ,
  45022. Ci.DirectionalLight.prototype = Object.create(Ci.Light.prototype),
  45023. Ci.DirectionalLight.prototype.constructor = Ci.DirectionalLight,
  45024. Ci.DirectionalLight.prototype.copy = function(e) {
  45025. return Ci.Light.prototype.copy.call(this, e),
  45026. this.target = e.target.clone(),
  45027. this.shadow = e.shadow.clone(),
  45028. this
  45029. }
  45030. ,
  45031. Ci.HemisphereLight = function(e, t, i) {
  45032. Ci.Light.call(this, e, i),
  45033. this.type = "HemisphereLight",
  45034. this.castShadow = void 0,
  45035. this.position.set(0, 1, 0),
  45036. this.updateMatrix(),
  45037. this.groundColor = new Ci.Color(t)
  45038. }
  45039. ,
  45040. Ci.HemisphereLight.prototype = Object.create(Ci.Light.prototype),
  45041. Ci.HemisphereLight.prototype.constructor = Ci.HemisphereLight,
  45042. Ci.HemisphereLight.prototype.copy = function(e) {
  45043. return Ci.Light.prototype.copy.call(this, e),
  45044. this.groundColor.copy(e.groundColor),
  45045. this
  45046. }
  45047. ,
  45048. Ci.PointLight = function(e, t, i, n) {
  45049. Ci.Light.call(this, e, t),
  45050. this.type = "PointLight",
  45051. this.distance = void 0 !== i ? i : 0,
  45052. this.decay = void 0 !== n ? n : 1,
  45053. this.shadow = new Ci.LightShadow(new Ci.PerspectiveCamera(90,1,.5,500))
  45054. }
  45055. ,
  45056. Ci.PointLight.prototype = Object.create(Ci.Light.prototype),
  45057. Ci.PointLight.prototype.constructor = Ci.PointLight,
  45058. Object.defineProperty(Ci.PointLight.prototype, "power", {
  45059. get: function() {
  45060. return 4 * this.intensity * Math.PI
  45061. },
  45062. set: function(e) {
  45063. this.intensity = e / (4 * Math.PI)
  45064. }
  45065. }),
  45066. Ci.PointLight.prototype.copy = function(e) {
  45067. return Ci.Light.prototype.copy.call(this, e),
  45068. this.distance = e.distance,
  45069. this.decay = e.decay,
  45070. this.shadow = e.shadow.clone(),
  45071. this
  45072. }
  45073. ,
  45074. Ci.SpotLight = function(e, t, i, n, r, o) {
  45075. Ci.Light.call(this, e, t),
  45076. this.type = "SpotLight",
  45077. this.position.set(0, 1, 0),
  45078. this.updateMatrix(),
  45079. this.target = new Ci.Object3D,
  45080. this.distance = void 0 !== i ? i : 0,
  45081. this.angle = void 0 !== n ? n : Math.PI / 3,
  45082. this.penumbra = void 0 !== r ? r : 0,
  45083. this.decay = void 0 !== o ? o : 1,
  45084. this.shadow = new Ci.LightShadow(new Ci.PerspectiveCamera(50,1,.5,500))
  45085. }
  45086. ,
  45087. Ci.SpotLight.prototype = Object.create(Ci.Light.prototype),
  45088. Ci.SpotLight.prototype.constructor = Ci.SpotLight,
  45089. Object.defineProperty(Ci.SpotLight.prototype, "power", {
  45090. get: function() {
  45091. return this.intensity * Math.PI
  45092. },
  45093. set: function(e) {
  45094. this.intensity = e / Math.PI
  45095. }
  45096. }),
  45097. Ci.SpotLight.prototype.copy = function(e) {
  45098. return Ci.Light.prototype.copy.call(this, e),
  45099. this.distance = e.distance,
  45100. this.angle = e.angle,
  45101. this.penumbra = e.penumbra,
  45102. this.decay = e.decay,
  45103. this.target = e.target.clone(),
  45104. this.shadow = e.shadow.clone(),
  45105. this
  45106. }
  45107. ,
  45108. Ci.Cache = {
  45109. enabled: !1,
  45110. files: {},
  45111. add: function(e, t) {
  45112. !1 !== this.enabled && (this.files[e] = t)
  45113. },
  45114. get: function(e) {
  45115. if (!1 !== this.enabled)
  45116. return this.files[e]
  45117. },
  45118. remove: function(e) {
  45119. delete this.files[e]
  45120. },
  45121. clear: function() {
  45122. this.files = {}
  45123. }
  45124. },
  45125. Ci.Loader = function() {
  45126. this.onLoadStart = function() {}
  45127. ,
  45128. this.onLoadProgress = function() {}
  45129. ,
  45130. this.onLoadComplete = function() {}
  45131. }
  45132. ,
  45133. Ci.Loader.prototype = {
  45134. constructor: Ci.Loader,
  45135. crossOrigin: void 0,
  45136. extractUrlBase: function(e) {
  45137. var t = e.split("/");
  45138. return 1 === t.length ? "./" : (t.pop(),
  45139. t.join("/") + "/")
  45140. },
  45141. initMaterials: function(e, t, i) {
  45142. for (var n = [], r = 0; r < e.length; ++r)
  45143. n[r] = this.createMaterial(e[r], t, i);
  45144. return n
  45145. },
  45146. createMaterial: function(e, c, h) {
  45147. function t(e, t, i, n, r) {
  45148. var o, a = c + e, s = Ci.Loader.Handlers.get(a);
  45149. o = null !== s ? s.load(a) : (He.setCrossOrigin(h),
  45150. He.load(a)),
  45151. void 0 !== t && (o.repeat.fromArray(t),
  45152. 1 !== t[0] && (o.wrapS = Ci.RepeatWrapping),
  45153. 1 !== t[1] && (o.wrapT = Ci.RepeatWrapping)),
  45154. void 0 !== i && o.offset.fromArray(i),
  45155. void 0 !== n && ("repeat" === n[0] && (o.wrapS = Ci.RepeatWrapping),
  45156. "mirror" === n[0] && (o.wrapS = Ci.MirroredRepeatWrapping),
  45157. "repeat" === n[1] && (o.wrapT = Ci.RepeatWrapping),
  45158. "mirror" === n[1] && (o.wrapT = Ci.MirroredRepeatWrapping)),
  45159. void 0 !== r && (o.anisotropy = r);
  45160. var l = Ci.Math.generateUUID();
  45161. return u[l] = o,
  45162. l
  45163. }
  45164. void 0 === Ue && (Ue = new Ci.Color),
  45165. void 0 === He && (He = new Ci.TextureLoader),
  45166. void 0 === ze && (ze = new Ci.MaterialLoader);
  45167. var u = {}
  45168. , i = {
  45169. uuid: Ci.Math.generateUUID(),
  45170. type: "MeshLambertMaterial"
  45171. };
  45172. for (var n in e) {
  45173. var r = e[n];
  45174. switch (n) {
  45175. case "DbgColor":
  45176. case "DbgIndex":
  45177. case "opticalDensity":
  45178. case "illumination":
  45179. break;
  45180. case "DbgName":
  45181. i.name = r;
  45182. break;
  45183. case "blending":
  45184. i.blending = Ci[r];
  45185. break;
  45186. case "colorAmbient":
  45187. case "mapAmbient":
  45188. console.warn("THREE.Loader.createMaterial:", n, "is no longer supported.");
  45189. break;
  45190. case "colorDiffuse":
  45191. i.color = Ue.fromArray(r).getHex();
  45192. break;
  45193. case "colorSpecular":
  45194. i.specular = Ue.fromArray(r).getHex();
  45195. break;
  45196. case "colorEmissive":
  45197. i.emissive = Ue.fromArray(r).getHex();
  45198. break;
  45199. case "specularCoef":
  45200. i.shininess = r;
  45201. break;
  45202. case "shading":
  45203. "basic" === r.toLowerCase() && (i.type = "MeshBasicMaterial"),
  45204. "phong" === r.toLowerCase() && (i.type = "MeshPhongMaterial");
  45205. break;
  45206. case "mapDiffuse":
  45207. i.map = t(r, e.mapDiffuseRepeat, e.mapDiffuseOffset, e.mapDiffuseWrap, e.mapDiffuseAnisotropy);
  45208. break;
  45209. case "mapDiffuseRepeat":
  45210. case "mapDiffuseOffset":
  45211. case "mapDiffuseWrap":
  45212. case "mapDiffuseAnisotropy":
  45213. break;
  45214. case "mapLight":
  45215. i.lightMap = t(r, e.mapLightRepeat, e.mapLightOffset, e.mapLightWrap, e.mapLightAnisotropy);
  45216. break;
  45217. case "mapLightRepeat":
  45218. case "mapLightOffset":
  45219. case "mapLightWrap":
  45220. case "mapLightAnisotropy":
  45221. break;
  45222. case "mapAO":
  45223. i.aoMap = t(r, e.mapAORepeat, e.mapAOOffset, e.mapAOWrap, e.mapAOAnisotropy);
  45224. break;
  45225. case "mapAORepeat":
  45226. case "mapAOOffset":
  45227. case "mapAOWrap":
  45228. case "mapAOAnisotropy":
  45229. break;
  45230. case "mapBump":
  45231. i.bumpMap = t(r, e.mapBumpRepeat, e.mapBumpOffset, e.mapBumpWrap, e.mapBumpAnisotropy);
  45232. break;
  45233. case "mapBumpScale":
  45234. i.bumpScale = r;
  45235. break;
  45236. case "mapBumpRepeat":
  45237. case "mapBumpOffset":
  45238. case "mapBumpWrap":
  45239. case "mapBumpAnisotropy":
  45240. break;
  45241. case "mapNormal":
  45242. i.normalMap = t(r, e.mapNormalRepeat, e.mapNormalOffset, e.mapNormalWrap, e.mapNormalAnisotropy);
  45243. break;
  45244. case "mapNormalFactor":
  45245. i.normalScale = [r, r];
  45246. break;
  45247. case "mapNormalRepeat":
  45248. case "mapNormalOffset":
  45249. case "mapNormalWrap":
  45250. case "mapNormalAnisotropy":
  45251. break;
  45252. case "mapSpecular":
  45253. i.specularMap = t(r, e.mapSpecularRepeat, e.mapSpecularOffset, e.mapSpecularWrap, e.mapSpecularAnisotropy);
  45254. break;
  45255. case "mapSpecularRepeat":
  45256. case "mapSpecularOffset":
  45257. case "mapSpecularWrap":
  45258. case "mapSpecularAnisotropy":
  45259. break;
  45260. case "mapAlpha":
  45261. i.alphaMap = t(r, e.mapAlphaRepeat, e.mapAlphaOffset, e.mapAlphaWrap, e.mapAlphaAnisotropy);
  45262. break;
  45263. case "mapAlphaRepeat":
  45264. case "mapAlphaOffset":
  45265. case "mapAlphaWrap":
  45266. case "mapAlphaAnisotropy":
  45267. break;
  45268. case "flipSided":
  45269. i.side = Ci.BackSide;
  45270. break;
  45271. case "doubleSided":
  45272. i.side = Ci.DoubleSide;
  45273. break;
  45274. case "transparency":
  45275. console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),
  45276. i.opacity = r;
  45277. break;
  45278. case "depthTest":
  45279. case "depthWrite":
  45280. case "colorWrite":
  45281. case "opacity":
  45282. case "reflectivity":
  45283. case "transparent":
  45284. case "visible":
  45285. case "wireframe":
  45286. i[n] = r;
  45287. break;
  45288. case "vertexColors":
  45289. !0 === r && (i.vertexColors = Ci.VertexColors),
  45290. "face" === r && (i.vertexColors = Ci.FaceColors);
  45291. break;
  45292. default:
  45293. console.error("THREE.Loader.createMaterial: Unsupported", n, r)
  45294. }
  45295. }
  45296. return "MeshBasicMaterial" === i.type && delete i.emissive,
  45297. "MeshPhongMaterial" !== i.type && delete i.specular,
  45298. i.opacity < 1 && (i.transparent = !0),
  45299. ze.setTextures(u),
  45300. ze.parse(i)
  45301. }
  45302. },
  45303. Ci.Loader.Handlers = {
  45304. handlers: [],
  45305. add: function(e, t) {
  45306. this.handlers.push(e, t)
  45307. },
  45308. get: function(e) {
  45309. for (var t = this.handlers, i = 0, n = t.length; i < n; i += 2) {
  45310. var r = t[i]
  45311. , o = t[i + 1];
  45312. if (r.test(e))
  45313. return o
  45314. }
  45315. return null
  45316. }
  45317. },
  45318. Ci.XHRLoader = function(e) {
  45319. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45320. }
  45321. ,
  45322. Ci.XHRLoader.prototype = {
  45323. constructor: Ci.XHRLoader,
  45324. load: function(i, n, t, r) {
  45325. void 0 !== this.path && (i = this.path + i);
  45326. var o = this
  45327. , e = Ci.Cache.get(i);
  45328. if (void 0 !== e)
  45329. return n && setTimeout(function() {
  45330. n(e)
  45331. }, 0),
  45332. e;
  45333. var a = new XMLHttpRequest;
  45334. return a.overrideMimeType("text/plain"),
  45335. a.open("GET", i, !0),
  45336. a.addEventListener("load", function(e) {
  45337. var t = e.target.response;
  45338. Ci.Cache.add(i, t),
  45339. 200 === this.status ? (n && n(t),
  45340. o.manager.itemEnd(i)) : 0 === this.status ? (console.warn("THREE.XHRLoader: HTTP Status 0 received."),
  45341. n && n(t),
  45342. o.manager.itemEnd(i)) : (r && r(e),
  45343. o.manager.itemError(i))
  45344. }, !1),
  45345. void 0 !== t && a.addEventListener("progress", function(e) {
  45346. t(e)
  45347. }, !1),
  45348. a.addEventListener("error", function(e) {
  45349. r && r(e),
  45350. o.manager.itemError(i)
  45351. }, !1),
  45352. void 0 !== this.responseType && (a.responseType = this.responseType),
  45353. void 0 !== this.withCredentials && (a.withCredentials = this.withCredentials),
  45354. a.send(null),
  45355. o.manager.itemStart(i),
  45356. a
  45357. },
  45358. setPath: function(e) {
  45359. this.path = e
  45360. },
  45361. setResponseType: function(e) {
  45362. this.responseType = e
  45363. },
  45364. setWithCredentials: function(e) {
  45365. this.withCredentials = e
  45366. }
  45367. },
  45368. Ci.FontLoader = function(e) {
  45369. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45370. }
  45371. ,
  45372. Ci.FontLoader.prototype = {
  45373. constructor: Ci.FontLoader,
  45374. load: function(e, t, i, n) {
  45375. new Ci.XHRLoader(this.manager).load(e, function(e) {
  45376. t(new Ci.Font(JSON.parse(e.substring(65, e.length - 2))))
  45377. }, i, n)
  45378. }
  45379. },
  45380. Ci.ImageLoader = function(e) {
  45381. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45382. }
  45383. ,
  45384. Ci.ImageLoader.prototype = {
  45385. constructor: Ci.ImageLoader,
  45386. load: function(t, i, n, r) {
  45387. void 0 !== this.path && (t = this.path + t);
  45388. var o = this
  45389. , e = Ci.Cache.get(t);
  45390. if (void 0 !== e)
  45391. return o.manager.itemStart(t),
  45392. i ? setTimeout(function() {
  45393. i(e),
  45394. o.manager.itemEnd(t)
  45395. }, 0) : o.manager.itemEnd(t),
  45396. e;
  45397. var a = document.createElement("img");
  45398. return a.addEventListener("load", function(e) {
  45399. Ci.Cache.add(t, this),
  45400. i && i(this),
  45401. o.manager.itemEnd(t)
  45402. }, !1),
  45403. void 0 !== n && a.addEventListener("progress", function(e) {
  45404. n(e)
  45405. }, !1),
  45406. a.addEventListener("error", function(e) {
  45407. r && r(e),
  45408. o.manager.itemError(t)
  45409. }, !1),
  45410. void 0 !== this.crossOrigin && (a.crossOrigin = this.crossOrigin),
  45411. o.manager.itemStart(t),
  45412. a.src = t,
  45413. a
  45414. },
  45415. setCrossOrigin: function(e) {
  45416. this.crossOrigin = e
  45417. },
  45418. setPath: function(e) {
  45419. this.path = e
  45420. }
  45421. },
  45422. Ci.JSONLoader = function(e) {
  45423. "boolean" == typeof e && (console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),
  45424. e = void 0),
  45425. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  45426. this.withCredentials = !1
  45427. }
  45428. ,
  45429. Ci.JSONLoader.prototype = {
  45430. constructor: Ci.JSONLoader,
  45431. get statusDomElement() {
  45432. return void 0 === this._statusDomElement && (this._statusDomElement = document.createElement("div")),
  45433. console.warn("THREE.JSONLoader: .statusDomElement has been removed."),
  45434. this._statusDomElement
  45435. },
  45436. load: function(o, a, e, t) {
  45437. var s = this
  45438. , l = this.texturePath && "string" == typeof this.texturePath ? this.texturePath : Ci.Loader.prototype.extractUrlBase(o)
  45439. , i = new Ci.XHRLoader(this.manager);
  45440. i.setWithCredentials(this.withCredentials),
  45441. i.load(o, function(e) {
  45442. var t = JSON.parse(e)
  45443. , i = t.metadata;
  45444. if (void 0 !== i) {
  45445. var n = i.type;
  45446. if (void 0 !== n) {
  45447. if ("object" === n.toLowerCase())
  45448. return void console.error("THREE.JSONLoader: " + o + " should be loaded with THREE.ObjectLoader instead.");
  45449. if ("scene" === n.toLowerCase())
  45450. return void console.error("THREE.JSONLoader: " + o + " should be loaded with THREE.SceneLoader instead.")
  45451. }
  45452. }
  45453. var r = s.parse(t, l);
  45454. a(r.geometry, r.materials)
  45455. }, e, t)
  45456. },
  45457. setTexturePath: function(e) {
  45458. this.texturePath = e
  45459. },
  45460. parse: function(D, e) {
  45461. var N = new Ci.Geometry
  45462. , t = void 0 !== D.scale ? 1 / D.scale : 1;
  45463. if (function(e) {
  45464. function t(e, t) {
  45465. return e & 1 << t
  45466. }
  45467. var i, n, r, o, a, s, l, c, h, u, d, p, f, g, m, v, y, A, C, I, E, _, b, w, T, x, S, M = D.faces, R = D.vertices, P = D.normals, O = D.colors, L = 0;
  45468. if (void 0 !== D.uvs) {
  45469. for (i = 0; i < D.uvs.length; i++)
  45470. D.uvs[i].length && L++;
  45471. for (i = 0; i < L; i++)
  45472. N.faceVertexUvs[i] = []
  45473. }
  45474. for (o = 0,
  45475. a = R.length; o < a; )
  45476. (A = new Ci.Vector3).x = R[o++] * e,
  45477. A.y = R[o++] * e,
  45478. A.z = R[o++] * e,
  45479. N.vertices.push(A);
  45480. for (o = 0,
  45481. a = M.length; o < a; )
  45482. if (d = t(u = M[o++], 0),
  45483. p = t(u, 1),
  45484. f = t(u, 3),
  45485. g = t(u, 4),
  45486. m = t(u, 5),
  45487. v = t(u, 6),
  45488. y = t(u, 7),
  45489. d) {
  45490. if ((I = new Ci.Face3).a = M[o],
  45491. I.b = M[o + 1],
  45492. I.c = M[o + 3],
  45493. (E = new Ci.Face3).a = M[o + 1],
  45494. E.b = M[o + 2],
  45495. E.c = M[o + 3],
  45496. o += 4,
  45497. p && (h = M[o++],
  45498. I.materialIndex = h,
  45499. E.materialIndex = h),
  45500. r = N.faces.length,
  45501. f)
  45502. for (i = 0; i < L; i++)
  45503. for (w = D.uvs[i],
  45504. N.faceVertexUvs[i][r] = [],
  45505. N.faceVertexUvs[i][r + 1] = [],
  45506. n = 0; n < 4; n++)
  45507. x = w[2 * (c = M[o++])],
  45508. S = w[2 * c + 1],
  45509. T = new Ci.Vector2(x,S),
  45510. 2 !== n && N.faceVertexUvs[i][r].push(T),
  45511. 0 !== n && N.faceVertexUvs[i][r + 1].push(T);
  45512. if (g && (l = 3 * M[o++],
  45513. I.normal.set(P[l++], P[l++], P[l]),
  45514. E.normal.copy(I.normal)),
  45515. m)
  45516. for (i = 0; i < 4; i++)
  45517. l = 3 * M[o++],
  45518. b = new Ci.Vector3(P[l++],P[l++],P[l]),
  45519. 2 !== i && I.vertexNormals.push(b),
  45520. 0 !== i && E.vertexNormals.push(b);
  45521. if (v && (_ = O[s = M[o++]],
  45522. I.color.setHex(_),
  45523. E.color.setHex(_)),
  45524. y)
  45525. for (i = 0; i < 4; i++)
  45526. _ = O[s = M[o++]],
  45527. 2 !== i && I.vertexColors.push(new Ci.Color(_)),
  45528. 0 !== i && E.vertexColors.push(new Ci.Color(_));
  45529. N.faces.push(I),
  45530. N.faces.push(E)
  45531. } else {
  45532. if ((C = new Ci.Face3).a = M[o++],
  45533. C.b = M[o++],
  45534. C.c = M[o++],
  45535. p && (h = M[o++],
  45536. C.materialIndex = h),
  45537. r = N.faces.length,
  45538. f)
  45539. for (i = 0; i < L; i++)
  45540. for (w = D.uvs[i],
  45541. N.faceVertexUvs[i][r] = [],
  45542. n = 0; n < 3; n++)
  45543. x = w[2 * (c = M[o++])],
  45544. S = w[2 * c + 1],
  45545. T = new Ci.Vector2(x,S),
  45546. N.faceVertexUvs[i][r].push(T);
  45547. if (g && (l = 3 * M[o++],
  45548. C.normal.set(P[l++], P[l++], P[l])),
  45549. m)
  45550. for (i = 0; i < 3; i++)
  45551. l = 3 * M[o++],
  45552. b = new Ci.Vector3(P[l++],P[l++],P[l]),
  45553. C.vertexNormals.push(b);
  45554. if (v && (s = M[o++],
  45555. C.color.setHex(O[s])),
  45556. y)
  45557. for (i = 0; i < 3; i++)
  45558. s = M[o++],
  45559. C.vertexColors.push(new Ci.Color(O[s]));
  45560. N.faces.push(C)
  45561. }
  45562. }(t),
  45563. function() {
  45564. var e = void 0 !== D.influencesPerVertex ? D.influencesPerVertex : 2;
  45565. if (D.skinWeights)
  45566. for (var t = 0, i = D.skinWeights.length; t < i; t += e) {
  45567. var n = D.skinWeights[t]
  45568. , r = 1 < e ? D.skinWeights[t + 1] : 0
  45569. , o = 2 < e ? D.skinWeights[t + 2] : 0
  45570. , a = 3 < e ? D.skinWeights[t + 3] : 0;
  45571. N.skinWeights.push(new Ci.Vector4(n,r,o,a))
  45572. }
  45573. if (D.skinIndices)
  45574. for (t = 0,
  45575. i = D.skinIndices.length; t < i; t += e) {
  45576. var s = D.skinIndices[t]
  45577. , l = 1 < e ? D.skinIndices[t + 1] : 0
  45578. , c = 2 < e ? D.skinIndices[t + 2] : 0
  45579. , h = 3 < e ? D.skinIndices[t + 3] : 0;
  45580. N.skinIndices.push(new Ci.Vector4(s,l,c,h))
  45581. }
  45582. N.bones = D.bones,
  45583. N.bones && 0 < N.bones.length && (N.skinWeights.length !== N.skinIndices.length || N.skinIndices.length !== N.vertices.length) && console.warn("When skinning, number of vertices (" + N.vertices.length + "), skinIndices (" + N.skinIndices.length + "), and skinWeights (" + N.skinWeights.length + ") should match.")
  45584. }(),
  45585. function(e) {
  45586. if (void 0 !== D.morphTargets)
  45587. for (var t = 0, i = D.morphTargets.length; t < i; t++) {
  45588. N.morphTargets[t] = {},
  45589. N.morphTargets[t].name = D.morphTargets[t].name,
  45590. N.morphTargets[t].vertices = [];
  45591. for (var n = N.morphTargets[t].vertices, r = D.morphTargets[t].vertices, o = 0, a = r.length; o < a; o += 3) {
  45592. var s = new Ci.Vector3;
  45593. s.x = r[o] * e,
  45594. s.y = r[o + 1] * e,
  45595. s.z = r[o + 2] * e,
  45596. n.push(s)
  45597. }
  45598. }
  45599. if (void 0 !== D.morphColors && 0 < D.morphColors.length) {
  45600. console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');
  45601. var l = N.faces
  45602. , c = D.morphColors[0].colors;
  45603. for (t = 0,
  45604. i = l.length; t < i; t++)
  45605. l[t].color.fromArray(c, 3 * t)
  45606. }
  45607. }(t),
  45608. function() {
  45609. var e = []
  45610. , t = [];
  45611. void 0 !== D.animation && t.push(D.animation),
  45612. void 0 !== D.animations && (D.animations.length ? t = t.concat(D.animations) : t.push(D.animations));
  45613. for (var i = 0; i < t.length; i++) {
  45614. var n = Ci.AnimationClip.parseAnimation(t[i], N.bones);
  45615. n && e.push(n)
  45616. }
  45617. if (N.morphTargets) {
  45618. var r = Ci.AnimationClip.CreateClipsFromMorphTargetSequences(N.morphTargets, 10);
  45619. e = e.concat(r)
  45620. }
  45621. 0 < e.length && (N.animations = e)
  45622. }(),
  45623. N.computeFaceNormals(),
  45624. N.computeBoundingSphere(),
  45625. void 0 === D.materials || 0 === D.materials.length)
  45626. return {
  45627. geometry: N
  45628. };
  45629. var i = Ci.Loader.prototype.initMaterials(D.materials, e, this.crossOrigin);
  45630. return {
  45631. geometry: N,
  45632. materials: i
  45633. }
  45634. }
  45635. },
  45636. Ci.LoadingManager = function(e, t, i) {
  45637. var n = this
  45638. , r = !1
  45639. , o = 0
  45640. , a = 0;
  45641. this.onStart = void 0,
  45642. this.onLoad = e,
  45643. this.onProgress = t,
  45644. this.onError = i,
  45645. this.itemStart = function(e) {
  45646. a++,
  45647. !1 === r && void 0 !== n.onStart && n.onStart(e, o, a),
  45648. r = !0
  45649. }
  45650. ,
  45651. this.itemEnd = function(e) {
  45652. o++,
  45653. void 0 !== n.onProgress && n.onProgress(e, o, a),
  45654. o === a && (r = !1,
  45655. void 0 !== n.onLoad && n.onLoad())
  45656. }
  45657. ,
  45658. this.itemError = function(e) {
  45659. void 0 !== n.onError && n.onError(e)
  45660. }
  45661. }
  45662. ,
  45663. Ci.DefaultLoadingManager = new Ci.LoadingManager,
  45664. Ci.BufferGeometryLoader = function(e) {
  45665. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45666. }
  45667. ,
  45668. Ci.BufferGeometryLoader.prototype = {
  45669. constructor: Ci.BufferGeometryLoader,
  45670. load: function(e, t, i, n) {
  45671. var r = this;
  45672. new Ci.XHRLoader(r.manager).load(e, function(e) {
  45673. t(r.parse(JSON.parse(e)))
  45674. }, i, n)
  45675. },
  45676. parse: function(e) {
  45677. var t = new Ci.BufferGeometry
  45678. , i = e.data.index
  45679. , n = {
  45680. Int8Array: Int8Array,
  45681. Uint8Array: Uint8Array,
  45682. Uint8ClampedArray: Uint8ClampedArray,
  45683. Int16Array: Int16Array,
  45684. Uint16Array: Uint16Array,
  45685. Int32Array: Int32Array,
  45686. Uint32Array: Uint32Array,
  45687. Float32Array: Float32Array,
  45688. Float64Array: Float64Array
  45689. };
  45690. if (void 0 !== i) {
  45691. var r = new n[i.type](i.array);
  45692. t.setIndex(new Ci.BufferAttribute(r,1))
  45693. }
  45694. var o = e.data.attributes;
  45695. for (var a in o) {
  45696. var s = o[a];
  45697. r = new n[s.type](s.array);
  45698. t.addAttribute(a, new Ci.BufferAttribute(r,s.itemSize))
  45699. }
  45700. var l = e.data.groups || e.data.drawcalls || e.data.offsets;
  45701. if (void 0 !== l)
  45702. for (var c = 0, h = l.length; c !== h; ++c) {
  45703. var u = l[c];
  45704. t.addGroup(u.start, u.count, u.materialIndex)
  45705. }
  45706. var d = e.data.boundingSphere;
  45707. if (void 0 !== d) {
  45708. var p = new Ci.Vector3;
  45709. void 0 !== d.center && p.fromArray(d.center),
  45710. t.boundingSphere = new Ci.Sphere(p,d.radius)
  45711. }
  45712. return t
  45713. }
  45714. },
  45715. Ci.MaterialLoader = function(e) {
  45716. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  45717. this.textures = {}
  45718. }
  45719. ,
  45720. Ci.MaterialLoader.prototype = {
  45721. constructor: Ci.MaterialLoader,
  45722. load: function(e, t, i, n) {
  45723. var r = this;
  45724. new Ci.XHRLoader(r.manager).load(e, function(e) {
  45725. t(r.parse(JSON.parse(e)))
  45726. }, i, n)
  45727. },
  45728. setTextures: function(e) {
  45729. this.textures = e
  45730. },
  45731. getTexture: function(e) {
  45732. var t = this.textures;
  45733. return void 0 === t[e] && console.warn("THREE.MaterialLoader: Undefined texture", e),
  45734. t[e]
  45735. },
  45736. parse: function(e) {
  45737. var t = new Ci[e.type];
  45738. if (void 0 !== e.uuid && (t.uuid = e.uuid),
  45739. void 0 !== e.name && (t.name = e.name),
  45740. void 0 !== e.color && t.color.setHex(e.color),
  45741. void 0 !== e.roughness && (t.roughness = e.roughness),
  45742. void 0 !== e.metalness && (t.metalness = e.metalness),
  45743. void 0 !== e.emissive && t.emissive.setHex(e.emissive),
  45744. void 0 !== e.specular && t.specular.setHex(e.specular),
  45745. void 0 !== e.shininess && (t.shininess = e.shininess),
  45746. void 0 !== e.uniforms && (t.uniforms = e.uniforms),
  45747. void 0 !== e.vertexShader && (t.vertexShader = e.vertexShader),
  45748. void 0 !== e.fragmentShader && (t.fragmentShader = e.fragmentShader),
  45749. void 0 !== e.vertexColors && (t.vertexColors = e.vertexColors),
  45750. void 0 !== e.shading && (t.shading = e.shading),
  45751. void 0 !== e.blending && (t.blending = e.blending),
  45752. void 0 !== e.side && (t.side = e.side),
  45753. void 0 !== e.opacity && (t.opacity = e.opacity),
  45754. void 0 !== e.transparent && (t.transparent = e.transparent),
  45755. void 0 !== e.alphaTest && (t.alphaTest = e.alphaTest),
  45756. void 0 !== e.depthTest && (t.depthTest = e.depthTest),
  45757. void 0 !== e.depthWrite && (t.depthWrite = e.depthWrite),
  45758. void 0 !== e.colorWrite && (t.colorWrite = e.colorWrite),
  45759. void 0 !== e.wireframe && (t.wireframe = e.wireframe),
  45760. void 0 !== e.wireframeLinewidth && (t.wireframeLinewidth = e.wireframeLinewidth),
  45761. void 0 !== e.size && (t.size = e.size),
  45762. void 0 !== e.sizeAttenuation && (t.sizeAttenuation = e.sizeAttenuation),
  45763. void 0 !== e.map && (t.map = this.getTexture(e.map)),
  45764. void 0 !== e.alphaMap && (t.alphaMap = this.getTexture(e.alphaMap),
  45765. t.transparent = !0),
  45766. void 0 !== e.bumpMap && (t.bumpMap = this.getTexture(e.bumpMap)),
  45767. void 0 !== e.bumpScale && (t.bumpScale = e.bumpScale),
  45768. void 0 !== e.normalMap && (t.normalMap = this.getTexture(e.normalMap)),
  45769. void 0 !== e.normalScale) {
  45770. var i = e.normalScale;
  45771. !1 === Array.isArray(i) && (i = [i, i]),
  45772. t.normalScale = (new Ci.Vector2).fromArray(i)
  45773. }
  45774. if (void 0 !== e.displacementMap && (t.displacementMap = this.getTexture(e.displacementMap)),
  45775. void 0 !== e.displacementScale && (t.displacementScale = e.displacementScale),
  45776. void 0 !== e.displacementBias && (t.displacementBias = e.displacementBias),
  45777. void 0 !== e.roughnessMap && (t.roughnessMap = this.getTexture(e.roughnessMap)),
  45778. void 0 !== e.metalnessMap && (t.metalnessMap = this.getTexture(e.metalnessMap)),
  45779. void 0 !== e.emissiveMap && (t.emissiveMap = this.getTexture(e.emissiveMap)),
  45780. void 0 !== e.emissiveIntensity && (t.emissiveIntensity = e.emissiveIntensity),
  45781. void 0 !== e.specularMap && (t.specularMap = this.getTexture(e.specularMap)),
  45782. void 0 !== e.envMap && (t.envMap = this.getTexture(e.envMap),
  45783. t.combine = Ci.MultiplyOperation),
  45784. e.reflectivity && (t.reflectivity = e.reflectivity),
  45785. void 0 !== e.lightMap && (t.lightMap = this.getTexture(e.lightMap)),
  45786. void 0 !== e.lightMapIntensity && (t.lightMapIntensity = e.lightMapIntensity),
  45787. void 0 !== e.aoMap && (t.aoMap = this.getTexture(e.aoMap)),
  45788. void 0 !== e.aoMapIntensity && (t.aoMapIntensity = e.aoMapIntensity),
  45789. void 0 !== e.materials)
  45790. for (var n = 0, r = e.materials.length; n < r; n++)
  45791. t.materials.push(this.parse(e.materials[n]));
  45792. return t
  45793. }
  45794. },
  45795. Ci.ObjectLoader = function(e) {
  45796. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  45797. this.texturePath = ""
  45798. }
  45799. ,
  45800. Ci.ObjectLoader.prototype = {
  45801. constructor: Ci.ObjectLoader,
  45802. load: function(e, t, i, n) {
  45803. "" === this.texturePath && (this.texturePath = e.substring(0, e.lastIndexOf("/") + 1));
  45804. var r = this;
  45805. new Ci.XHRLoader(r.manager).load(e, function(e) {
  45806. r.parse(JSON.parse(e), t)
  45807. }, i, n)
  45808. },
  45809. setTexturePath: function(e) {
  45810. this.texturePath = e
  45811. },
  45812. setCrossOrigin: function(e) {
  45813. this.crossOrigin = e
  45814. },
  45815. parse: function(e, t) {
  45816. var i = this.parseGeometries(e.geometries)
  45817. , n = this.parseImages(e.images, function() {
  45818. void 0 !== t && t(a)
  45819. })
  45820. , r = this.parseTextures(e.textures, n)
  45821. , o = this.parseMaterials(e.materials, r)
  45822. , a = this.parseObject(e.object, i, o);
  45823. return e.animations && (a.animations = this.parseAnimations(e.animations)),
  45824. void 0 !== e.images && 0 !== e.images.length || void 0 !== t && t(a),
  45825. a
  45826. },
  45827. parseGeometries: function(e) {
  45828. var t = {};
  45829. if (void 0 !== e)
  45830. for (var i = new Ci.JSONLoader, n = new Ci.BufferGeometryLoader, r = 0, o = e.length; r < o; r++) {
  45831. var a, s = e[r];
  45832. switch (s.type) {
  45833. case "PlaneGeometry":
  45834. case "PlaneBufferGeometry":
  45835. a = new Ci[s.type](s.width,s.height,s.widthSegments,s.heightSegments);
  45836. break;
  45837. case "BoxGeometry":
  45838. case "BoxBufferGeometry":
  45839. case "CubeGeometry":
  45840. a = new Ci[s.type](s.width,s.height,s.depth,s.widthSegments,s.heightSegments,s.depthSegments);
  45841. break;
  45842. case "CircleGeometry":
  45843. case "CircleBufferGeometry":
  45844. a = new Ci[s.type](s.radius,s.segments,s.thetaStart,s.thetaLength);
  45845. break;
  45846. case "CylinderGeometry":
  45847. case "CylinderBufferGeometry":
  45848. a = new Ci[s.type](s.radiusTop,s.radiusBottom,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);
  45849. break;
  45850. case "SphereGeometry":
  45851. case "SphereBufferGeometry":
  45852. a = new Ci[s.type](s.radius,s.widthSegments,s.heightSegments,s.phiStart,s.phiLength,s.thetaStart,s.thetaLength);
  45853. break;
  45854. case "DodecahedronGeometry":
  45855. a = new Ci.DodecahedronGeometry(s.radius,s.detail);
  45856. break;
  45857. case "IcosahedronGeometry":
  45858. a = new Ci.IcosahedronGeometry(s.radius,s.detail);
  45859. break;
  45860. case "OctahedronGeometry":
  45861. a = new Ci.OctahedronGeometry(s.radius,s.detail);
  45862. break;
  45863. case "TetrahedronGeometry":
  45864. a = new Ci.TetrahedronGeometry(s.radius,s.detail);
  45865. break;
  45866. case "RingGeometry":
  45867. case "RingBufferGeometry":
  45868. a = new Ci[s.type](s.innerRadius,s.outerRadius,s.thetaSegments,s.phiSegments,s.thetaStart,s.thetaLength);
  45869. break;
  45870. case "TorusGeometry":
  45871. case "TorusBufferGeometry":
  45872. a = new Ci[s.type](s.radius,s.tube,s.radialSegments,s.tubularSegments,s.arc);
  45873. break;
  45874. case "TorusKnotGeometry":
  45875. case "TorusKnotBufferGeometry":
  45876. a = new Ci[s.type](s.radius,s.tube,s.tubularSegments,s.radialSegments,s.p,s.q);
  45877. break;
  45878. case "LatheGeometry":
  45879. a = new Ci.LatheGeometry(s.points,s.segments,s.phiStart,s.phiLength);
  45880. break;
  45881. case "BufferGeometry":
  45882. a = n.parse(s);
  45883. break;
  45884. case "Geometry":
  45885. a = i.parse(s.data, this.texturePath).geometry;
  45886. break;
  45887. default:
  45888. console.warn('THREE.ObjectLoader: Unsupported geometry type "' + s.type + '"');
  45889. continue
  45890. }
  45891. a.uuid = s.uuid,
  45892. void 0 !== s.name && (a.name = s.name),
  45893. t[s.uuid] = a
  45894. }
  45895. return t
  45896. },
  45897. parseMaterials: function(e, t) {
  45898. var i = {};
  45899. if (void 0 !== e) {
  45900. var n = new Ci.MaterialLoader;
  45901. n.setTextures(t);
  45902. for (var r = 0, o = e.length; r < o; r++) {
  45903. var a = n.parse(e[r]);
  45904. i[a.uuid] = a
  45905. }
  45906. }
  45907. return i
  45908. },
  45909. parseAnimations: function(e) {
  45910. for (var t = [], i = 0; i < e.length; i++) {
  45911. var n = Ci.AnimationClip.parse(e[i]);
  45912. t.push(n)
  45913. }
  45914. return t
  45915. },
  45916. parseImages: function(e, t) {
  45917. function i(e) {
  45918. return n.manager.itemStart(e),
  45919. a.load(e, function() {
  45920. n.manager.itemEnd(e)
  45921. })
  45922. }
  45923. var n = this
  45924. , r = {};
  45925. if (void 0 !== e && 0 < e.length) {
  45926. var o = new Ci.LoadingManager(t)
  45927. , a = new Ci.ImageLoader(o);
  45928. a.setCrossOrigin(this.crossOrigin);
  45929. for (var s = 0, l = e.length; s < l; s++) {
  45930. var c = e[s]
  45931. , h = /^(\/\/)|([a-z]+:(\/\/)?)/i.test(c.url) ? c.url : n.texturePath + c.url;
  45932. r[c.uuid] = i(h)
  45933. }
  45934. }
  45935. return r
  45936. },
  45937. parseTextures: function(e, t) {
  45938. function i(e) {
  45939. return "number" == typeof e ? e : (console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.", e),
  45940. Ci[e])
  45941. }
  45942. var n = {};
  45943. if (void 0 !== e)
  45944. for (var r = 0, o = e.length; r < o; r++) {
  45945. var a = e[r];
  45946. void 0 === a.image && console.warn('THREE.ObjectLoader: No "image" specified for', a.uuid),
  45947. void 0 === t[a.image] && console.warn("THREE.ObjectLoader: Undefined image", a.image);
  45948. var s = new Ci.Texture(t[a.image]);
  45949. s.needsUpdate = !0,
  45950. s.uuid = a.uuid,
  45951. void 0 !== a.name && (s.name = a.name),
  45952. void 0 !== a.mapping && (s.mapping = i(a.mapping)),
  45953. void 0 !== a.offset && (s.offset = new Ci.Vector2(a.offset[0],a.offset[1])),
  45954. void 0 !== a.repeat && (s.repeat = new Ci.Vector2(a.repeat[0],a.repeat[1])),
  45955. void 0 !== a.minFilter && (s.minFilter = i(a.minFilter)),
  45956. void 0 !== a.magFilter && (s.magFilter = i(a.magFilter)),
  45957. void 0 !== a.anisotropy && (s.anisotropy = a.anisotropy),
  45958. Array.isArray(a.wrap) && (s.wrapS = i(a.wrap[0]),
  45959. s.wrapT = i(a.wrap[1])),
  45960. n[a.uuid] = s
  45961. }
  45962. return n
  45963. },
  45964. parseObject: (ke = new Ci.Matrix4,
  45965. function(e, t, i) {
  45966. function n(e) {
  45967. return void 0 === t[e] && console.warn("THREE.ObjectLoader: Undefined geometry", e),
  45968. t[e]
  45969. }
  45970. function r(e) {
  45971. if (void 0 !== e)
  45972. return void 0 === i[e] && console.warn("THREE.ObjectLoader: Undefined material", e),
  45973. i[e]
  45974. }
  45975. var o;
  45976. switch (e.type) {
  45977. case "Scene":
  45978. o = new Ci.Scene;
  45979. break;
  45980. case "PerspectiveCamera":
  45981. o = new Ci.PerspectiveCamera(e.fov,e.aspect,e.near,e.far);
  45982. break;
  45983. case "OrthographicCamera":
  45984. o = new Ci.OrthographicCamera(e.left,e.right,e.top,e.bottom,e.near,e.far);
  45985. break;
  45986. case "AmbientLight":
  45987. o = new Ci.AmbientLight(e.color,e.intensity);
  45988. break;
  45989. case "DirectionalLight":
  45990. o = new Ci.DirectionalLight(e.color,e.intensity);
  45991. break;
  45992. case "PointLight":
  45993. o = new Ci.PointLight(e.color,e.intensity,e.distance,e.decay);
  45994. break;
  45995. case "SpotLight":
  45996. o = new Ci.SpotLight(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);
  45997. break;
  45998. case "HemisphereLight":
  45999. o = new Ci.HemisphereLight(e.color,e.groundColor,e.intensity);
  46000. break;
  46001. case "Mesh":
  46002. var a = n(e.geometry)
  46003. , s = r(e.material);
  46004. o = a.bones && 0 < a.bones.length ? new Ci.SkinnedMesh(a,s) : new Ci.Mesh(a,s);
  46005. break;
  46006. case "LOD":
  46007. o = new Ci.LOD;
  46008. break;
  46009. case "Line":
  46010. o = new Ci.Line(n(e.geometry),r(e.material),e.mode);
  46011. break;
  46012. case "PointCloud":
  46013. case "Points":
  46014. o = new Ci.Points(n(e.geometry),r(e.material));
  46015. break;
  46016. case "Sprite":
  46017. o = new Ci.Sprite(r(e.material));
  46018. break;
  46019. case "Group":
  46020. o = new Ci.Group;
  46021. break;
  46022. default:
  46023. o = new Ci.Object3D
  46024. }
  46025. if (o.uuid = e.uuid,
  46026. void 0 !== e.name && (o.name = e.name),
  46027. void 0 !== e.matrix ? (ke.fromArray(e.matrix),
  46028. ke.decompose(o.position, o.quaternion, o.scale)) : (void 0 !== e.position && o.position.fromArray(e.position),
  46029. void 0 !== e.rotation && o.rotation.fromArray(e.rotation),
  46030. void 0 !== e.scale && o.scale.fromArray(e.scale)),
  46031. void 0 !== e.castShadow && (o.castShadow = e.castShadow),
  46032. void 0 !== e.receiveShadow && (o.receiveShadow = e.receiveShadow),
  46033. void 0 !== e.visible && (o.visible = e.visible),
  46034. void 0 !== e.userData && (o.userData = e.userData),
  46035. void 0 !== e.children)
  46036. for (var l in e.children)
  46037. o.add(this.parseObject(e.children[l], t, i));
  46038. if ("LOD" === e.type)
  46039. for (var c = e.levels, h = 0; h < c.length; h++) {
  46040. var u = c[h];
  46041. void 0 !== (l = o.getObjectByProperty("uuid", u.object)) && o.addLevel(l, u.distance)
  46042. }
  46043. return o
  46044. }
  46045. )
  46046. },
  46047. Ci.TextureLoader = function(e) {
  46048. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  46049. }
  46050. ,
  46051. Ci.TextureLoader.prototype = {
  46052. constructor: Ci.TextureLoader,
  46053. load: function(e, t, i, n) {
  46054. var r = new Ci.Texture
  46055. , o = new Ci.ImageLoader(this.manager);
  46056. return o.setCrossOrigin(this.crossOrigin),
  46057. o.setPath(this.path),
  46058. o.load(e, function(e) {
  46059. r.image = e,
  46060. r.needsUpdate = !0,
  46061. void 0 !== t && t(r)
  46062. }, i, n),
  46063. r
  46064. },
  46065. setCrossOrigin: function(e) {
  46066. this.crossOrigin = e
  46067. },
  46068. setPath: function(e) {
  46069. this.path = e
  46070. }
  46071. },
  46072. Ci.CubeTextureLoader = function(e) {
  46073. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  46074. }
  46075. ,
  46076. Ci.CubeTextureLoader.prototype = {
  46077. constructor: Ci.CubeTextureLoader,
  46078. load: function(e, i, t, n) {
  46079. function r(t) {
  46080. a.load(e[t], function(e) {
  46081. o.images[t] = e,
  46082. 6 === ++s && (o.needsUpdate = !0,
  46083. i && i(o))
  46084. }, void 0, n)
  46085. }
  46086. var o = new Ci.CubeTexture
  46087. , a = new Ci.ImageLoader(this.manager);
  46088. a.setCrossOrigin(this.crossOrigin),
  46089. a.setPath(this.path);
  46090. for (var s = 0, l = 0; l < e.length; ++l)
  46091. r(l);
  46092. return o
  46093. },
  46094. setCrossOrigin: function(e) {
  46095. this.crossOrigin = e
  46096. },
  46097. setPath: function(e) {
  46098. this.path = e
  46099. }
  46100. },
  46101. Ci.DataTextureLoader = Ci.BinaryTextureLoader = function(e) {
  46102. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  46103. this._parser = null
  46104. }
  46105. ,
  46106. Ci.BinaryTextureLoader.prototype = {
  46107. constructor: Ci.BinaryTextureLoader,
  46108. load: function(e, i, t, n) {
  46109. var r = this
  46110. , o = new Ci.DataTexture
  46111. , a = new Ci.XHRLoader(this.manager);
  46112. return a.setResponseType("arraybuffer"),
  46113. a.load(e, function(e) {
  46114. var t = r._parser(e);
  46115. t && (void 0 !== t.image ? o.image = t.image : void 0 !== t.data && (o.image.width = t.width,
  46116. o.image.height = t.height,
  46117. o.image.data = t.data),
  46118. o.wrapS = void 0 !== t.wrapS ? t.wrapS : Ci.ClampToEdgeWrapping,
  46119. o.wrapT = void 0 !== t.wrapT ? t.wrapT : Ci.ClampToEdgeWrapping,
  46120. o.magFilter = void 0 !== t.magFilter ? t.magFilter : Ci.LinearFilter,
  46121. o.minFilter = void 0 !== t.minFilter ? t.minFilter : Ci.LinearMipMapLinearFilter,
  46122. o.anisotropy = void 0 !== t.anisotropy ? t.anisotropy : 1,
  46123. void 0 !== t.format && (o.format = t.format),
  46124. void 0 !== t.type && (o.type = t.type),
  46125. void 0 !== t.mipmaps && (o.mipmaps = t.mipmaps),
  46126. 1 === t.mipmapCount && (o.minFilter = Ci.LinearFilter),
  46127. o.needsUpdate = !0,
  46128. i && i(o, t))
  46129. }, t, n),
  46130. o
  46131. }
  46132. },
  46133. Ci.CompressedTextureLoader = function(e) {
  46134. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  46135. this._parser = null
  46136. }
  46137. ,
  46138. Ci.CompressedTextureLoader.prototype = {
  46139. constructor: Ci.CompressedTextureLoader,
  46140. load: function(e, o, t, n) {
  46141. function i(i) {
  46142. r.load(e[i], function(e) {
  46143. var t = a._parser(e, !0);
  46144. s[i] = {
  46145. width: t.width,
  46146. height: t.height,
  46147. format: t.format,
  46148. mipmaps: t.mipmaps
  46149. },
  46150. 6 === (c += 1) && (1 === t.mipmapCount && (l.minFilter = Ci.LinearFilter),
  46151. l.format = t.format,
  46152. l.needsUpdate = !0,
  46153. o && o(l))
  46154. }, t, n)
  46155. }
  46156. var a = this
  46157. , s = []
  46158. , l = new Ci.CompressedTexture;
  46159. l.image = s;
  46160. var r = new Ci.XHRLoader(this.manager);
  46161. if (r.setPath(this.path),
  46162. r.setResponseType("arraybuffer"),
  46163. Array.isArray(e))
  46164. for (var c = 0, h = 0, u = e.length; h < u; ++h)
  46165. i(h);
  46166. else
  46167. r.load(e, function(e) {
  46168. var t = a._parser(e, !0);
  46169. if (t.isCubemap)
  46170. for (var i = t.mipmaps.length / t.mipmapCount, n = 0; n < i; n++) {
  46171. s[n] = {
  46172. mipmaps: []
  46173. };
  46174. for (var r = 0; r < t.mipmapCount; r++)
  46175. s[n].mipmaps.push(t.mipmaps[n * t.mipmapCount + r]),
  46176. s[n].format = t.format,
  46177. s[n].width = t.width,
  46178. s[n].height = t.height
  46179. }
  46180. else
  46181. l.image.width = t.width,
  46182. l.image.height = t.height,
  46183. l.mipmaps = t.mipmaps;
  46184. 1 === t.mipmapCount && (l.minFilter = Ci.LinearFilter),
  46185. l.format = t.format,
  46186. l.needsUpdate = !0,
  46187. o && o(l)
  46188. }, t, n);
  46189. return l
  46190. },
  46191. setPath: function(e) {
  46192. this.path = e
  46193. }
  46194. },
  46195. Ci.Material = function() {
  46196. Object.defineProperty(this, "id", {
  46197. value: Ci.MaterialIdCount++
  46198. }),
  46199. this.uuid = Ci.Math.generateUUID(),
  46200. this.name = "",
  46201. this.type = "Material",
  46202. this.side = Ci.FrontSide,
  46203. this.opacity = 1,
  46204. this.transparent = !1,
  46205. this.blending = Ci.NormalBlending,
  46206. this.blendSrc = Ci.SrcAlphaFactor,
  46207. this.blendDst = Ci.OneMinusSrcAlphaFactor,
  46208. this.blendEquation = Ci.AddEquation,
  46209. this.blendSrcAlpha = null,
  46210. this.blendDstAlpha = null,
  46211. this.blendEquationAlpha = null,
  46212. this.depthFunc = Ci.LessEqualDepth,
  46213. this.depthTest = !0,
  46214. this.depthWrite = !0,
  46215. this.colorWrite = !0,
  46216. this.precision = null,
  46217. this.polygonOffset = !1,
  46218. this.polygonOffsetFactor = 0,
  46219. this.polygonOffsetUnits = 0,
  46220. this.alphaTest = 0,
  46221. this.premultipliedAlpha = !1,
  46222. this.overdraw = 0,
  46223. this.visible = !0,
  46224. this._needsUpdate = !0
  46225. }
  46226. ,
  46227. Ci.Material.prototype = {
  46228. constructor: Ci.Material,
  46229. get needsUpdate() {
  46230. return this._needsUpdate
  46231. },
  46232. set needsUpdate(e) {
  46233. !0 === e && this.update(),
  46234. this._needsUpdate = e
  46235. },
  46236. setValues: function(e) {
  46237. if (void 0 !== e)
  46238. for (var t in e) {
  46239. var i = e[t];
  46240. if (void 0 !== i) {
  46241. var n = this[t];
  46242. void 0 !== n ? n instanceof Ci.Color ? n.set(i) : n instanceof Ci.Vector3 && i instanceof Ci.Vector3 ? n.copy(i) : this[t] = "overdraw" === t ? Number(i) : i : console.warn("THREE." + this.type + ": '" + t + "' is not a property of this material.")
  46243. } else
  46244. console.warn("THREE.Material: '" + t + "' parameter is undefined.")
  46245. }
  46246. },
  46247. toJSON: function(e) {
  46248. function t(e) {
  46249. var t = [];
  46250. for (var i in e) {
  46251. var n = e[i];
  46252. delete n.metadata,
  46253. t.push(n)
  46254. }
  46255. return t
  46256. }
  46257. var i = void 0 === e;
  46258. i && (e = {
  46259. textures: {},
  46260. images: {}
  46261. });
  46262. var n = {
  46263. metadata: {
  46264. version: 4.4,
  46265. type: "Material",
  46266. generator: "Material.toJSON"
  46267. }
  46268. };
  46269. if (n.uuid = this.uuid,
  46270. n.type = this.type,
  46271. "" !== this.name && (n.name = this.name),
  46272. this.color instanceof Ci.Color && (n.color = this.color.getHex()),
  46273. .5 !== this.roughness && (n.roughness = this.roughness),
  46274. .5 !== this.metalness && (n.metalness = this.metalness),
  46275. this.emissive instanceof Ci.Color && (n.emissive = this.emissive.getHex()),
  46276. this.specular instanceof Ci.Color && (n.specular = this.specular.getHex()),
  46277. void 0 !== this.shininess && (n.shininess = this.shininess),
  46278. this.map instanceof Ci.Texture && (n.map = this.map.toJSON(e).uuid),
  46279. this.alphaMap instanceof Ci.Texture && (n.alphaMap = this.alphaMap.toJSON(e).uuid),
  46280. this.lightMap instanceof Ci.Texture && (n.lightMap = this.lightMap.toJSON(e).uuid),
  46281. this.bumpMap instanceof Ci.Texture && (n.bumpMap = this.bumpMap.toJSON(e).uuid,
  46282. n.bumpScale = this.bumpScale),
  46283. this.normalMap instanceof Ci.Texture && (n.normalMap = this.normalMap.toJSON(e).uuid,
  46284. n.normalScale = this.normalScale.toArray()),
  46285. this.displacementMap instanceof Ci.Texture && (n.displacementMap = this.displacementMap.toJSON(e).uuid,
  46286. n.displacementScale = this.displacementScale,
  46287. n.displacementBias = this.displacementBias),
  46288. this.roughnessMap instanceof Ci.Texture && (n.roughnessMap = this.roughnessMap.toJSON(e).uuid),
  46289. this.metalnessMap instanceof Ci.Texture && (n.metalnessMap = this.metalnessMap.toJSON(e).uuid),
  46290. this.emissiveMap instanceof Ci.Texture && (n.emissiveMap = this.emissiveMap.toJSON(e).uuid),
  46291. this.specularMap instanceof Ci.Texture && (n.specularMap = this.specularMap.toJSON(e).uuid),
  46292. this.envMap instanceof Ci.Texture && (n.envMap = this.envMap.toJSON(e).uuid,
  46293. n.reflectivity = this.reflectivity),
  46294. void 0 !== this.size && (n.size = this.size),
  46295. void 0 !== this.sizeAttenuation && (n.sizeAttenuation = this.sizeAttenuation),
  46296. void 0 !== this.vertexColors && this.vertexColors !== Ci.NoColors && (n.vertexColors = this.vertexColors),
  46297. void 0 !== this.shading && this.shading !== Ci.SmoothShading && (n.shading = this.shading),
  46298. void 0 !== this.blending && this.blending !== Ci.NormalBlending && (n.blending = this.blending),
  46299. void 0 !== this.side && this.side !== Ci.FrontSide && (n.side = this.side),
  46300. this.opacity < 1 && (n.opacity = this.opacity),
  46301. !0 === this.transparent && (n.transparent = this.transparent),
  46302. 0 < this.alphaTest && (n.alphaTest = this.alphaTest),
  46303. !0 === this.premultipliedAlpha && (n.premultipliedAlpha = this.premultipliedAlpha),
  46304. !0 === this.wireframe && (n.wireframe = this.wireframe),
  46305. 1 < this.wireframeLinewidth && (n.wireframeLinewidth = this.wireframeLinewidth),
  46306. i) {
  46307. var r = t(e.textures)
  46308. , o = t(e.images);
  46309. 0 < r.length && (n.textures = r),
  46310. 0 < o.length && (n.images = o)
  46311. }
  46312. return n
  46313. },
  46314. clone: function() {
  46315. return (new this.constructor).copy(this)
  46316. },
  46317. copy: function(e) {
  46318. return this.name = e.name,
  46319. this.side = e.side,
  46320. this.opacity = e.opacity,
  46321. this.transparent = e.transparent,
  46322. this.blending = e.blending,
  46323. this.blendSrc = e.blendSrc,
  46324. this.blendDst = e.blendDst,
  46325. this.blendEquation = e.blendEquation,
  46326. this.blendSrcAlpha = e.blendSrcAlpha,
  46327. this.blendDstAlpha = e.blendDstAlpha,
  46328. this.blendEquationAlpha = e.blendEquationAlpha,
  46329. this.depthFunc = e.depthFunc,
  46330. this.depthTest = e.depthTest,
  46331. this.depthWrite = e.depthWrite,
  46332. this.colorWrite = e.colorWrite,
  46333. this.precision = e.precision,
  46334. this.polygonOffset = e.polygonOffset,
  46335. this.polygonOffsetFactor = e.polygonOffsetFactor,
  46336. this.polygonOffsetUnits = e.polygonOffsetUnits,
  46337. this.alphaTest = e.alphaTest,
  46338. this.premultipliedAlpha = e.premultipliedAlpha,
  46339. this.overdraw = e.overdraw,
  46340. this.visible = e.visible,
  46341. this
  46342. },
  46343. update: function() {
  46344. this.dispatchEvent({
  46345. type: "update"
  46346. })
  46347. },
  46348. dispose: function() {
  46349. this.dispatchEvent({
  46350. type: "dispose"
  46351. })
  46352. }
  46353. },
  46354. Ci.EventDispatcher.prototype.apply(Ci.Material.prototype),
  46355. Ci.MaterialIdCount = 0,
  46356. Ci.LineBasicMaterial = function(e) {
  46357. Ci.Material.call(this),
  46358. this.type = "LineBasicMaterial",
  46359. this.color = new Ci.Color(16777215),
  46360. this.linewidth = 1,
  46361. this.linecap = "round",
  46362. this.linejoin = "round",
  46363. this.blending = Ci.NormalBlending,
  46364. this.vertexColors = Ci.NoColors,
  46365. this.fog = !0,
  46366. this.setValues(e)
  46367. }
  46368. ,
  46369. Ci.LineBasicMaterial.prototype = Object.create(Ci.Material.prototype),
  46370. Ci.LineBasicMaterial.prototype.constructor = Ci.LineBasicMaterial,
  46371. Ci.LineBasicMaterial.prototype.copy = function(e) {
  46372. return Ci.Material.prototype.copy.call(this, e),
  46373. this.color.copy(e.color),
  46374. this.linewidth = e.linewidth,
  46375. this.linecap = e.linecap,
  46376. this.linejoin = e.linejoin,
  46377. this.vertexColors = e.vertexColors,
  46378. this.fog = e.fog,
  46379. this
  46380. }
  46381. ,
  46382. Ci.LineDashedMaterial = function(e) {
  46383. Ci.Material.call(this),
  46384. this.type = "LineDashedMaterial",
  46385. this.color = new Ci.Color(16777215),
  46386. this.linewidth = 1,
  46387. this.scale = 1,
  46388. this.dashSize = 3,
  46389. this.gapSize = 1,
  46390. this.blending = Ci.NormalBlending,
  46391. this.vertexColors = Ci.NoColors,
  46392. this.fog = !0,
  46393. this.setValues(e)
  46394. }
  46395. ,
  46396. Ci.LineDashedMaterial.prototype = Object.create(Ci.Material.prototype),
  46397. Ci.LineDashedMaterial.prototype.constructor = Ci.LineDashedMaterial,
  46398. Ci.LineDashedMaterial.prototype.copy = function(e) {
  46399. return Ci.Material.prototype.copy.call(this, e),
  46400. this.color.copy(e.color),
  46401. this.linewidth = e.linewidth,
  46402. this.scale = e.scale,
  46403. this.dashSize = e.dashSize,
  46404. this.gapSize = e.gapSize,
  46405. this.vertexColors = e.vertexColors,
  46406. this.fog = e.fog,
  46407. this
  46408. }
  46409. ,
  46410. Ci.MeshBasicMaterial = function(e) {
  46411. Ci.Material.call(this),
  46412. this.type = "MeshBasicMaterial",
  46413. this.color = new Ci.Color(16777215),
  46414. this.map = null,
  46415. this.aoMap = null,
  46416. this.aoMapIntensity = 1,
  46417. this.specularMap = null,
  46418. this.alphaMap = null,
  46419. this.envMap = null,
  46420. this.combine = Ci.MultiplyOperation,
  46421. this.reflectivity = 1,
  46422. this.refractionRatio = .98,
  46423. this.fog = !0,
  46424. this.shading = Ci.SmoothShading,
  46425. this.blending = Ci.NormalBlending,
  46426. this.wireframe = !1,
  46427. this.wireframeLinewidth = 1,
  46428. this.wireframeLinecap = "round",
  46429. this.wireframeLinejoin = "round",
  46430. this.vertexColors = Ci.NoColors,
  46431. this.skinning = !1,
  46432. this.morphTargets = !1,
  46433. this.setValues(e)
  46434. }
  46435. ,
  46436. Ci.MeshBasicMaterial.prototype = Object.create(Ci.Material.prototype),
  46437. Ci.MeshBasicMaterial.prototype.constructor = Ci.MeshBasicMaterial,
  46438. Ci.MeshBasicMaterial.prototype.copy = function(e) {
  46439. return Ci.Material.prototype.copy.call(this, e),
  46440. this.color.copy(e.color),
  46441. this.map = e.map,
  46442. this.aoMap = e.aoMap,
  46443. this.aoMapIntensity = e.aoMapIntensity,
  46444. this.specularMap = e.specularMap,
  46445. this.alphaMap = e.alphaMap,
  46446. this.envMap = e.envMap,
  46447. this.combine = e.combine,
  46448. this.reflectivity = e.reflectivity,
  46449. this.refractionRatio = e.refractionRatio,
  46450. this.fog = e.fog,
  46451. this.shading = e.shading,
  46452. this.wireframe = e.wireframe,
  46453. this.wireframeLinewidth = e.wireframeLinewidth,
  46454. this.wireframeLinecap = e.wireframeLinecap,
  46455. this.wireframeLinejoin = e.wireframeLinejoin,
  46456. this.vertexColors = e.vertexColors,
  46457. this.skinning = e.skinning,
  46458. this.morphTargets = e.morphTargets,
  46459. this
  46460. }
  46461. ,
  46462. Ci.MeshLambertMaterial = function(e) {
  46463. Ci.Material.call(this),
  46464. this.type = "MeshLambertMaterial",
  46465. this.color = new Ci.Color(16777215),
  46466. this.map = null,
  46467. this.lightMap = null,
  46468. this.lightMapIntensity = 1,
  46469. this.aoMap = null,
  46470. this.aoMapIntensity = 1,
  46471. this.emissive = new Ci.Color(0),
  46472. this.emissiveIntensity = 1,
  46473. this.emissiveMap = null,
  46474. this.specularMap = null,
  46475. this.alphaMap = null,
  46476. this.envMap = null,
  46477. this.combine = Ci.MultiplyOperation,
  46478. this.reflectivity = 1,
  46479. this.refractionRatio = .98,
  46480. this.fog = !0,
  46481. this.blending = Ci.NormalBlending,
  46482. this.wireframe = !1,
  46483. this.wireframeLinewidth = 1,
  46484. this.wireframeLinecap = "round",
  46485. this.wireframeLinejoin = "round",
  46486. this.vertexColors = Ci.NoColors,
  46487. this.skinning = !1,
  46488. this.morphTargets = !1,
  46489. this.morphNormals = !1,
  46490. this.setValues(e)
  46491. }
  46492. ,
  46493. Ci.MeshLambertMaterial.prototype = Object.create(Ci.Material.prototype),
  46494. Ci.MeshLambertMaterial.prototype.constructor = Ci.MeshLambertMaterial,
  46495. Ci.MeshLambertMaterial.prototype.copy = function(e) {
  46496. return Ci.Material.prototype.copy.call(this, e),
  46497. this.color.copy(e.color),
  46498. this.map = e.map,
  46499. this.lightMap = e.lightMap,
  46500. this.lightMapIntensity = e.lightMapIntensity,
  46501. this.aoMap = e.aoMap,
  46502. this.aoMapIntensity = e.aoMapIntensity,
  46503. this.emissive.copy(e.emissive),
  46504. this.emissiveMap = e.emissiveMap,
  46505. this.emissiveIntensity = e.emissiveIntensity,
  46506. this.specularMap = e.specularMap,
  46507. this.alphaMap = e.alphaMap,
  46508. this.envMap = e.envMap,
  46509. this.combine = e.combine,
  46510. this.reflectivity = e.reflectivity,
  46511. this.refractionRatio = e.refractionRatio,
  46512. this.fog = e.fog,
  46513. this.wireframe = e.wireframe,
  46514. this.wireframeLinewidth = e.wireframeLinewidth,
  46515. this.wireframeLinecap = e.wireframeLinecap,
  46516. this.wireframeLinejoin = e.wireframeLinejoin,
  46517. this.vertexColors = e.vertexColors,
  46518. this.skinning = e.skinning,
  46519. this.morphTargets = e.morphTargets,
  46520. this.morphNormals = e.morphNormals,
  46521. this
  46522. }
  46523. ,
  46524. Ci.MeshPhongMaterial = function(e) {
  46525. Ci.Material.call(this),
  46526. this.type = "MeshPhongMaterial",
  46527. this.color = new Ci.Color(16777215),
  46528. this.specular = new Ci.Color(1118481),
  46529. this.shininess = 30,
  46530. this.map = null,
  46531. this.lightMap = null,
  46532. this.lightMapIntensity = 1,
  46533. this.aoMap = null,
  46534. this.aoMapIntensity = 1,
  46535. this.emissive = new Ci.Color(0),
  46536. this.emissiveIntensity = 1,
  46537. this.emissiveMap = null,
  46538. this.bumpMap = null,
  46539. this.bumpScale = 1,
  46540. this.normalMap = null,
  46541. this.normalScale = new Ci.Vector2(1,1),
  46542. this.displacementMap = null,
  46543. this.displacementScale = 1,
  46544. this.displacementBias = 0,
  46545. this.specularMap = null,
  46546. this.alphaMap = null,
  46547. this.envMap = null,
  46548. this.combine = Ci.MultiplyOperation,
  46549. this.reflectivity = 1,
  46550. this.refractionRatio = .98,
  46551. this.fog = !0,
  46552. this.shading = Ci.SmoothShading,
  46553. this.blending = Ci.NormalBlending,
  46554. this.wireframe = !1,
  46555. this.wireframeLinewidth = 1,
  46556. this.wireframeLinecap = "round",
  46557. this.wireframeLinejoin = "round",
  46558. this.vertexColors = Ci.NoColors,
  46559. this.skinning = !1,
  46560. this.morphTargets = !1,
  46561. this.morphNormals = !1,
  46562. this.setValues(e)
  46563. }
  46564. ,
  46565. Ci.MeshPhongMaterial.prototype = Object.create(Ci.Material.prototype),
  46566. Ci.MeshPhongMaterial.prototype.constructor = Ci.MeshPhongMaterial,
  46567. Ci.MeshPhongMaterial.prototype.copy = function(e) {
  46568. return Ci.Material.prototype.copy.call(this, e),
  46569. this.color.copy(e.color),
  46570. this.specular.copy(e.specular),
  46571. this.shininess = e.shininess,
  46572. this.map = e.map,
  46573. this.lightMap = e.lightMap,
  46574. this.lightMapIntensity = e.lightMapIntensity,
  46575. this.aoMap = e.aoMap,
  46576. this.aoMapIntensity = e.aoMapIntensity,
  46577. this.emissive.copy(e.emissive),
  46578. this.emissiveMap = e.emissiveMap,
  46579. this.emissiveIntensity = e.emissiveIntensity,
  46580. this.bumpMap = e.bumpMap,
  46581. this.bumpScale = e.bumpScale,
  46582. this.normalMap = e.normalMap,
  46583. this.normalScale.copy(e.normalScale),
  46584. this.displacementMap = e.displacementMap,
  46585. this.displacementScale = e.displacementScale,
  46586. this.displacementBias = e.displacementBias,
  46587. this.specularMap = e.specularMap,
  46588. this.alphaMap = e.alphaMap,
  46589. this.envMap = e.envMap,
  46590. this.combine = e.combine,
  46591. this.reflectivity = e.reflectivity,
  46592. this.refractionRatio = e.refractionRatio,
  46593. this.fog = e.fog,
  46594. this.shading = e.shading,
  46595. this.wireframe = e.wireframe,
  46596. this.wireframeLinewidth = e.wireframeLinewidth,
  46597. this.wireframeLinecap = e.wireframeLinecap,
  46598. this.wireframeLinejoin = e.wireframeLinejoin,
  46599. this.vertexColors = e.vertexColors,
  46600. this.skinning = e.skinning,
  46601. this.morphTargets = e.morphTargets,
  46602. this.morphNormals = e.morphNormals,
  46603. this
  46604. }
  46605. ,
  46606. Ci.MeshStandardMaterial = function(e) {
  46607. Ci.Material.call(this),
  46608. this.type = "MeshStandardMaterial",
  46609. this.color = new Ci.Color(16777215),
  46610. this.roughness = .5,
  46611. this.metalness = .5,
  46612. this.map = null,
  46613. this.lightMap = null,
  46614. this.lightMapIntensity = 1,
  46615. this.aoMap = null,
  46616. this.aoMapIntensity = 1,
  46617. this.emissive = new Ci.Color(0),
  46618. this.emissiveIntensity = 1,
  46619. this.emissiveMap = null,
  46620. this.bumpMap = null,
  46621. this.bumpScale = 1,
  46622. this.normalMap = null,
  46623. this.normalScale = new Ci.Vector2(1,1),
  46624. this.displacementMap = null,
  46625. this.displacementScale = 1,
  46626. this.displacementBias = 0,
  46627. this.roughnessMap = null,
  46628. this.metalnessMap = null,
  46629. this.alphaMap = null,
  46630. this.envMap = null,
  46631. this.envMapIntensity = 1,
  46632. this.refractionRatio = .98,
  46633. this.fog = !0,
  46634. this.shading = Ci.SmoothShading,
  46635. this.blending = Ci.NormalBlending,
  46636. this.wireframe = !1,
  46637. this.wireframeLinewidth = 1,
  46638. this.wireframeLinecap = "round",
  46639. this.wireframeLinejoin = "round",
  46640. this.vertexColors = Ci.NoColors,
  46641. this.skinning = !1,
  46642. this.morphTargets = !1,
  46643. this.morphNormals = !1,
  46644. this.setValues(e)
  46645. }
  46646. ,
  46647. Ci.MeshStandardMaterial.prototype = Object.create(Ci.Material.prototype),
  46648. Ci.MeshStandardMaterial.prototype.constructor = Ci.MeshStandardMaterial,
  46649. Ci.MeshStandardMaterial.prototype.copy = function(e) {
  46650. return Ci.Material.prototype.copy.call(this, e),
  46651. this.color.copy(e.color),
  46652. this.roughness = e.roughness,
  46653. this.metalness = e.metalness,
  46654. this.map = e.map,
  46655. this.lightMap = e.lightMap,
  46656. this.lightMapIntensity = e.lightMapIntensity,
  46657. this.aoMap = e.aoMap,
  46658. this.aoMapIntensity = e.aoMapIntensity,
  46659. this.emissive.copy(e.emissive),
  46660. this.emissiveMap = e.emissiveMap,
  46661. this.emissiveIntensity = e.emissiveIntensity,
  46662. this.bumpMap = e.bumpMap,
  46663. this.bumpScale = e.bumpScale,
  46664. this.normalMap = e.normalMap,
  46665. this.normalScale.copy(e.normalScale),
  46666. this.displacementMap = e.displacementMap,
  46667. this.displacementScale = e.displacementScale,
  46668. this.displacementBias = e.displacementBias,
  46669. this.roughnessMap = e.roughnessMap,
  46670. this.metalnessMap = e.metalnessMap,
  46671. this.alphaMap = e.alphaMap,
  46672. this.envMap = e.envMap,
  46673. this.envMapIntensity = e.envMapIntensity,
  46674. this.refractionRatio = e.refractionRatio,
  46675. this.fog = e.fog,
  46676. this.shading = e.shading,
  46677. this.wireframe = e.wireframe,
  46678. this.wireframeLinewidth = e.wireframeLinewidth,
  46679. this.wireframeLinecap = e.wireframeLinecap,
  46680. this.wireframeLinejoin = e.wireframeLinejoin,
  46681. this.vertexColors = e.vertexColors,
  46682. this.skinning = e.skinning,
  46683. this.morphTargets = e.morphTargets,
  46684. this.morphNormals = e.morphNormals,
  46685. this
  46686. }
  46687. ,
  46688. Ci.MeshDepthMaterial = function(e) {
  46689. Ci.Material.call(this),
  46690. this.type = "MeshDepthMaterial",
  46691. this.morphTargets = !1,
  46692. this.wireframe = !1,
  46693. this.wireframeLinewidth = 1,
  46694. this.setValues(e)
  46695. }
  46696. ,
  46697. Ci.MeshDepthMaterial.prototype = Object.create(Ci.Material.prototype),
  46698. Ci.MeshDepthMaterial.prototype.constructor = Ci.MeshDepthMaterial,
  46699. Ci.MeshDepthMaterial.prototype.copy = function(e) {
  46700. return Ci.Material.prototype.copy.call(this, e),
  46701. this.wireframe = e.wireframe,
  46702. this.wireframeLinewidth = e.wireframeLinewidth,
  46703. this
  46704. }
  46705. ,
  46706. Ci.MeshNormalMaterial = function(e) {
  46707. Ci.Material.call(this, e),
  46708. this.type = "MeshNormalMaterial",
  46709. this.wireframe = !1,
  46710. this.wireframeLinewidth = 1,
  46711. this.morphTargets = !1,
  46712. this.setValues(e)
  46713. }
  46714. ,
  46715. Ci.MeshNormalMaterial.prototype = Object.create(Ci.Material.prototype),
  46716. Ci.MeshNormalMaterial.prototype.constructor = Ci.MeshNormalMaterial,
  46717. Ci.MeshNormalMaterial.prototype.copy = function(e) {
  46718. return Ci.Material.prototype.copy.call(this, e),
  46719. this.wireframe = e.wireframe,
  46720. this.wireframeLinewidth = e.wireframeLinewidth,
  46721. this
  46722. }
  46723. ,
  46724. Ci.MultiMaterial = function(e) {
  46725. this.uuid = Ci.Math.generateUUID(),
  46726. this.type = "MultiMaterial",
  46727. this.materials = e instanceof Array ? e : [],
  46728. this.visible = !0
  46729. }
  46730. ,
  46731. Ci.MultiMaterial.prototype = {
  46732. constructor: Ci.MultiMaterial,
  46733. toJSON: function(e) {
  46734. for (var t = {
  46735. metadata: {
  46736. version: 4.2,
  46737. type: "material",
  46738. generator: "MaterialExporter"
  46739. },
  46740. uuid: this.uuid,
  46741. type: this.type,
  46742. materials: []
  46743. }, i = this.materials, n = 0, r = i.length; n < r; n++) {
  46744. var o = i[n].toJSON(e);
  46745. delete o.metadata,
  46746. t.materials.push(o)
  46747. }
  46748. return t.visible = this.visible,
  46749. t
  46750. },
  46751. clone: function() {
  46752. for (var e = new this.constructor, t = 0; t < this.materials.length; t++)
  46753. e.materials.push(this.materials[t].clone());
  46754. return e.visible = this.visible,
  46755. e
  46756. }
  46757. },
  46758. Ci.PointsMaterial = function(e) {
  46759. Ci.Material.call(this),
  46760. this.type = "PointsMaterial",
  46761. this.color = new Ci.Color(16777215),
  46762. this.map = null,
  46763. this.size = 1,
  46764. this.sizeAttenuation = !0,
  46765. this.blending = Ci.NormalBlending,
  46766. this.vertexColors = Ci.NoColors,
  46767. this.fog = !0,
  46768. this.setValues(e)
  46769. }
  46770. ,
  46771. Ci.PointsMaterial.prototype = Object.create(Ci.Material.prototype),
  46772. Ci.PointsMaterial.prototype.constructor = Ci.PointsMaterial,
  46773. Ci.PointsMaterial.prototype.copy = function(e) {
  46774. return Ci.Material.prototype.copy.call(this, e),
  46775. this.color.copy(e.color),
  46776. this.map = e.map,
  46777. this.size = e.size,
  46778. this.sizeAttenuation = e.sizeAttenuation,
  46779. this.vertexColors = e.vertexColors,
  46780. this.fog = e.fog,
  46781. this
  46782. }
  46783. ,
  46784. Ci.ShaderMaterial = function(e) {
  46785. Ci.Material.call(this),
  46786. this.type = "ShaderMaterial",
  46787. this.defines = {},
  46788. this.uniforms = {},
  46789. this.vertexShader = "void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",
  46790. this.fragmentShader = "void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",
  46791. this.shading = Ci.SmoothShading,
  46792. this.linewidth = 1,
  46793. this.wireframe = !1,
  46794. this.wireframeLinewidth = 1,
  46795. this.fog = !1,
  46796. this.lights = !1,
  46797. this.vertexColors = Ci.NoColors,
  46798. this.skinning = !1,
  46799. this.morphTargets = !1,
  46800. this.morphNormals = !1,
  46801. this.extensions = {
  46802. derivatives: !1,
  46803. fragDepth: !1,
  46804. drawBuffers: !1,
  46805. shaderTextureLOD: !1
  46806. },
  46807. this.defaultAttributeValues = {
  46808. color: [1, 1, 1],
  46809. uv: [0, 0],
  46810. uv2: [0, 0]
  46811. },
  46812. (this.index0AttributeName = void 0) !== e && (void 0 !== e.attributes && console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),
  46813. this.setValues(e))
  46814. }
  46815. ,
  46816. Ci.ShaderMaterial.prototype = Object.create(Ci.Material.prototype),
  46817. Ci.ShaderMaterial.prototype.constructor = Ci.ShaderMaterial,
  46818. Ci.ShaderMaterial.prototype.copy = function(e) {
  46819. return Ci.Material.prototype.copy.call(this, e),
  46820. this.fragmentShader = e.fragmentShader,
  46821. this.vertexShader = e.vertexShader,
  46822. this.uniforms = Ci.UniformsUtils.clone(e.uniforms),
  46823. this.defines = e.defines,
  46824. this.shading = e.shading,
  46825. this.wireframe = e.wireframe,
  46826. this.wireframeLinewidth = e.wireframeLinewidth,
  46827. this.fog = e.fog,
  46828. this.lights = e.lights,
  46829. this.vertexColors = e.vertexColors,
  46830. this.skinning = e.skinning,
  46831. this.morphTargets = e.morphTargets,
  46832. this.morphNormals = e.morphNormals,
  46833. this.extensions = e.extensions,
  46834. this
  46835. }
  46836. ,
  46837. Ci.ShaderMaterial.prototype.toJSON = function(e) {
  46838. var t = Ci.Material.prototype.toJSON.call(this, e);
  46839. return t.uniforms = this.uniforms,
  46840. t.vertexShader = this.vertexShader,
  46841. t.fragmentShader = this.fragmentShader,
  46842. t
  46843. }
  46844. ,
  46845. Ci.RawShaderMaterial = function(e) {
  46846. Ci.ShaderMaterial.call(this, e),
  46847. this.type = "RawShaderMaterial"
  46848. }
  46849. ,
  46850. Ci.RawShaderMaterial.prototype = Object.create(Ci.ShaderMaterial.prototype),
  46851. Ci.RawShaderMaterial.prototype.constructor = Ci.RawShaderMaterial,
  46852. Ci.SpriteMaterial = function(e) {
  46853. Ci.Material.call(this),
  46854. this.type = "SpriteMaterial",
  46855. this.color = new Ci.Color(16777215),
  46856. this.map = null,
  46857. this.rotation = 0,
  46858. this.fog = !1,
  46859. this.setValues(e)
  46860. }
  46861. ,
  46862. Ci.SpriteMaterial.prototype = Object.create(Ci.Material.prototype),
  46863. Ci.SpriteMaterial.prototype.constructor = Ci.SpriteMaterial,
  46864. Ci.SpriteMaterial.prototype.copy = function(e) {
  46865. return Ci.Material.prototype.copy.call(this, e),
  46866. this.color.copy(e.color),
  46867. this.map = e.map,
  46868. this.rotation = e.rotation,
  46869. this.fog = e.fog,
  46870. this
  46871. }
  46872. ,
  46873. Ci.Texture = function(e, t, i, n, r, o, a, s, l) {
  46874. Object.defineProperty(this, "id", {
  46875. value: Ci.TextureIdCount++
  46876. }),
  46877. this.uuid = Ci.Math.generateUUID(),
  46878. this.name = "",
  46879. this.sourceFile = "",
  46880. this.image = void 0 !== e ? e : Ci.Texture.DEFAULT_IMAGE,
  46881. this.mipmaps = [],
  46882. this.mapping = void 0 !== t ? t : Ci.Texture.DEFAULT_MAPPING,
  46883. this.wrapS = void 0 !== i ? i : Ci.ClampToEdgeWrapping,
  46884. this.wrapT = void 0 !== n ? n : Ci.ClampToEdgeWrapping,
  46885. this.magFilter = void 0 !== r ? r : Ci.LinearFilter,
  46886. this.minFilter = void 0 !== o ? o : Ci.LinearMipMapLinearFilter,
  46887. this.anisotropy = void 0 !== l ? l : 1,
  46888. this.format = void 0 !== a ? a : Ci.RGBAFormat,
  46889. this.type = void 0 !== s ? s : Ci.UnsignedByteType,
  46890. this.offset = new Ci.Vector2(0,0),
  46891. this.repeat = new Ci.Vector2(1,1),
  46892. this.generateMipmaps = !0,
  46893. this.premultiplyAlpha = !1,
  46894. this.flipY = !0,
  46895. this.unpackAlignment = 4,
  46896. this.encoding = Ci.LinearEncoding,
  46897. this.version = 0,
  46898. this.onUpdate = null
  46899. }
  46900. ,
  46901. Ci.Texture.DEFAULT_IMAGE = void 0,
  46902. Ci.Texture.DEFAULT_MAPPING = Ci.UVMapping,
  46903. Ci.Texture.prototype = {
  46904. constructor: Ci.Texture,
  46905. set needsUpdate(e) {
  46906. !0 === e && this.version++
  46907. },
  46908. clone: function() {
  46909. return (new this.constructor).copy(this)
  46910. },
  46911. copy: function(e) {
  46912. return this.image = e.image,
  46913. this.mipmaps = e.mipmaps.slice(0),
  46914. this.mapping = e.mapping,
  46915. this.wrapS = e.wrapS,
  46916. this.wrapT = e.wrapT,
  46917. this.magFilter = e.magFilter,
  46918. this.minFilter = e.minFilter,
  46919. this.anisotropy = e.anisotropy,
  46920. this.format = e.format,
  46921. this.type = e.type,
  46922. this.offset.copy(e.offset),
  46923. this.repeat.copy(e.repeat),
  46924. this.generateMipmaps = e.generateMipmaps,
  46925. this.premultiplyAlpha = e.premultiplyAlpha,
  46926. this.flipY = e.flipY,
  46927. this.unpackAlignment = e.unpackAlignment,
  46928. this.encoding = e.encoding,
  46929. this
  46930. },
  46931. toJSON: function(e) {
  46932. if (void 0 !== e.textures[this.uuid])
  46933. return e.textures[this.uuid];
  46934. var t, i, n = {
  46935. metadata: {
  46936. version: 4.4,
  46937. type: "Texture",
  46938. generator: "Texture.toJSON"
  46939. },
  46940. uuid: this.uuid,
  46941. name: this.name,
  46942. mapping: this.mapping,
  46943. repeat: [this.repeat.x, this.repeat.y],
  46944. offset: [this.offset.x, this.offset.y],
  46945. wrap: [this.wrapS, this.wrapT],
  46946. minFilter: this.minFilter,
  46947. magFilter: this.magFilter,
  46948. anisotropy: this.anisotropy
  46949. };
  46950. if (void 0 !== this.image) {
  46951. var r = this.image;
  46952. void 0 === r.uuid && (r.uuid = Ci.Math.generateUUID()),
  46953. void 0 === e.images[r.uuid] && (e.images[r.uuid] = {
  46954. uuid: r.uuid,
  46955. url: (t = r,
  46956. void 0 !== t.toDataURL ? i = t : ((i = document.createElement("canvas")).width = t.width,
  46957. i.height = t.height,
  46958. i.getContext("2d").drawImage(t, 0, 0, t.width, t.height)),
  46959. 2048 < i.width || 2048 < i.height ? i.toDataURL("image/jpeg", .6) : i.toDataURL("image/png"))
  46960. }),
  46961. n.image = r.uuid
  46962. }
  46963. return e.textures[this.uuid] = n
  46964. },
  46965. dispose: function() {
  46966. this.dispatchEvent({
  46967. type: "dispose"
  46968. })
  46969. },
  46970. transformUv: function(e) {
  46971. if (this.mapping === Ci.UVMapping) {
  46972. if (e.multiply(this.repeat),
  46973. e.add(this.offset),
  46974. e.x < 0 || 1 < e.x)
  46975. switch (this.wrapS) {
  46976. case Ci.RepeatWrapping:
  46977. e.x = e.x - Math.floor(e.x);
  46978. break;
  46979. case Ci.ClampToEdgeWrapping:
  46980. e.x = e.x < 0 ? 0 : 1;
  46981. break;
  46982. case Ci.MirroredRepeatWrapping:
  46983. 1 === Math.abs(Math.floor(e.x) % 2) ? e.x = Math.ceil(e.x) - e.x : e.x = e.x - Math.floor(e.x)
  46984. }
  46985. if (e.y < 0 || 1 < e.y)
  46986. switch (this.wrapT) {
  46987. case Ci.RepeatWrapping:
  46988. e.y = e.y - Math.floor(e.y);
  46989. break;
  46990. case Ci.ClampToEdgeWrapping:
  46991. e.y = e.y < 0 ? 0 : 1;
  46992. break;
  46993. case Ci.MirroredRepeatWrapping:
  46994. 1 === Math.abs(Math.floor(e.y) % 2) ? e.y = Math.ceil(e.y) - e.y : e.y = e.y - Math.floor(e.y)
  46995. }
  46996. this.flipY && (e.y = 1 - e.y)
  46997. }
  46998. }
  46999. },
  47000. Ci.EventDispatcher.prototype.apply(Ci.Texture.prototype),
  47001. Ci.TextureIdCount = 0,
  47002. Ci.CanvasTexture = function(e, t, i, n, r, o, a, s, l) {
  47003. Ci.Texture.call(this, e, t, i, n, r, o, a, s, l),
  47004. this.needsUpdate = !0
  47005. }
  47006. ,
  47007. Ci.CanvasTexture.prototype = Object.create(Ci.Texture.prototype),
  47008. Ci.CanvasTexture.prototype.constructor = Ci.CanvasTexture,
  47009. Ci.CubeTexture = function(e, t, i, n, r, o, a, s, l) {
  47010. e = void 0 !== e ? e : [],
  47011. t = void 0 !== t ? t : Ci.CubeReflectionMapping,
  47012. Ci.Texture.call(this, e, t, i, n, r, o, a, s, l),
  47013. this.flipY = !1
  47014. }
  47015. ,
  47016. Ci.CubeTexture.prototype = Object.create(Ci.Texture.prototype),
  47017. Ci.CubeTexture.prototype.constructor = Ci.CubeTexture,
  47018. Object.defineProperty(Ci.CubeTexture.prototype, "images", {
  47019. get: function() {
  47020. return this.image
  47021. },
  47022. set: function(e) {
  47023. this.image = e
  47024. }
  47025. }),
  47026. Ci.CompressedTexture = function(e, t, i, n, r, o, a, s, l, c, h) {
  47027. Ci.Texture.call(this, null, o, a, s, l, c, n, r, h),
  47028. this.image = {
  47029. width: t,
  47030. height: i
  47031. },
  47032. this.mipmaps = e,
  47033. this.flipY = !1,
  47034. this.generateMipmaps = !1
  47035. }
  47036. ,
  47037. Ci.CompressedTexture.prototype = Object.create(Ci.Texture.prototype),
  47038. Ci.CompressedTexture.prototype.constructor = Ci.CompressedTexture,
  47039. Ci.DataTexture = function(e, t, i, n, r, o, a, s, l, c, h) {
  47040. Ci.Texture.call(this, null, o, a, s, l, c, n, r, h),
  47041. this.image = {
  47042. data: e,
  47043. width: t,
  47044. height: i
  47045. },
  47046. this.magFilter = void 0 !== l ? l : Ci.NearestFilter,
  47047. this.minFilter = void 0 !== c ? c : Ci.NearestFilter,
  47048. this.flipY = !1,
  47049. this.generateMipmaps = !1
  47050. }
  47051. ,
  47052. Ci.DataTexture.prototype = Object.create(Ci.Texture.prototype),
  47053. Ci.DataTexture.prototype.constructor = Ci.DataTexture,
  47054. Ci.VideoTexture = function(t, e, i, n, r, o, a, s, l) {
  47055. Ci.Texture.call(this, t, e, i, n, r, o, a, s, l),
  47056. this.generateMipmaps = !1;
  47057. var c = this;
  47058. !function e() {
  47059. requestAnimationFrame(e),
  47060. t.readyState === t.HAVE_ENOUGH_DATA && (c.needsUpdate = !0)
  47061. }()
  47062. }
  47063. ,
  47064. Ci.VideoTexture.prototype = Object.create(Ci.Texture.prototype),
  47065. Ci.VideoTexture.prototype.constructor = Ci.VideoTexture,
  47066. Ci.Group = function() {
  47067. Ci.Object3D.call(this),
  47068. this.type = "Group"
  47069. }
  47070. ,
  47071. Ci.Group.prototype = Object.create(Ci.Object3D.prototype),
  47072. Ci.Group.prototype.constructor = Ci.Group,
  47073. Ci.Points = function(e, t) {
  47074. Ci.Object3D.call(this),
  47075. this.type = "Points",
  47076. this.geometry = void 0 !== e ? e : new Ci.Geometry,
  47077. this.material = void 0 !== t ? t : new Ci.PointsMaterial({
  47078. color: 16777215 * Math.random()
  47079. })
  47080. }
  47081. ,
  47082. Ci.Points.prototype = Object.create(Ci.Object3D.prototype),
  47083. Ci.Points.prototype.constructor = Ci.Points,
  47084. Ci.Points.prototype.raycast = (Wt = new Ci.Matrix4,
  47085. jt = new Ci.Ray,
  47086. Yt = new Ci.Sphere,
  47087. function(o, a) {
  47088. function e(e, t) {
  47089. var i = jt.distanceSqToPoint(e);
  47090. if (i < c) {
  47091. var n = jt.closestPointToPoint(e);
  47092. n.applyMatrix4(l);
  47093. var r = o.ray.origin.distanceTo(n);
  47094. if (r < o.near || r > o.far)
  47095. return;
  47096. a.push({
  47097. distance: r,
  47098. distanceToRay: Math.sqrt(i),
  47099. point: n.clone(),
  47100. index: t,
  47101. face: null,
  47102. object: s
  47103. })
  47104. }
  47105. }
  47106. var s = this
  47107. , t = this.geometry
  47108. , l = this.matrixWorld
  47109. , i = o.params.Points.threshold;
  47110. if (null === t.boundingSphere && t.computeBoundingSphere(),
  47111. Yt.copy(t.boundingSphere),
  47112. Yt.applyMatrix4(l),
  47113. !1 !== o.ray.intersectsSphere(Yt)) {
  47114. Wt.getInverse(l),
  47115. jt.copy(o.ray).applyMatrix4(Wt);
  47116. var n = i / ((this.scale.x + this.scale.y + this.scale.z) / 3)
  47117. , c = n * n
  47118. , r = new Ci.Vector3;
  47119. if (t instanceof Ci.BufferGeometry) {
  47120. var h = t.index
  47121. , u = t.attributes.position.array;
  47122. if (null !== h)
  47123. for (var d = h.array, p = 0, f = d.length; p < f; p++) {
  47124. var g = d[p];
  47125. r.fromArray(u, 3 * g),
  47126. e(r, g)
  47127. }
  47128. else {
  47129. p = 0;
  47130. for (var m = u.length / 3; p < m; p++)
  47131. r.fromArray(u, 3 * p),
  47132. e(r, p)
  47133. }
  47134. } else {
  47135. var v = t.vertices;
  47136. for (p = 0,
  47137. m = v.length; p < m; p++)
  47138. e(v[p], p)
  47139. }
  47140. }
  47141. }
  47142. ),
  47143. Ci.Points.prototype.clone = function() {
  47144. return new this.constructor(this.geometry,this.material).copy(this)
  47145. }
  47146. ,
  47147. Ci.Line = function(e, t, i) {
  47148. return 1 === i ? (console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),
  47149. new Ci.LineSegments(e,t)) : (Ci.Object3D.call(this),
  47150. this.type = "Line",
  47151. this.geometry = void 0 !== e ? e : new Ci.Geometry,
  47152. void (this.material = void 0 !== t ? t : new Ci.LineBasicMaterial({
  47153. color: 16777215 * Math.random()
  47154. })))
  47155. }
  47156. ,
  47157. Ci.Line.prototype = Object.create(Ci.Object3D.prototype),
  47158. Ci.Line.prototype.constructor = Ci.Line,
  47159. Ci.Line.prototype.raycast = (Ht = new Ci.Matrix4,
  47160. zt = new Ci.Ray,
  47161. Gt = new Ci.Sphere,
  47162. function(e, t) {
  47163. var i = e.linePrecision
  47164. , n = i * i
  47165. , r = this.geometry
  47166. , o = this.matrixWorld;
  47167. if (null === r.boundingSphere && r.computeBoundingSphere(),
  47168. Gt.copy(r.boundingSphere),
  47169. Gt.applyMatrix4(o),
  47170. !1 !== e.ray.intersectsSphere(Gt)) {
  47171. Ht.getInverse(o),
  47172. zt.copy(e.ray).applyMatrix4(Ht);
  47173. var a = new Ci.Vector3
  47174. , s = new Ci.Vector3
  47175. , l = new Ci.Vector3
  47176. , c = new Ci.Vector3
  47177. , h = this instanceof Ci.LineSegments ? 2 : 1;
  47178. if (r instanceof Ci.BufferGeometry) {
  47179. var u = r.index
  47180. , d = r.attributes.position.array;
  47181. if (null !== u)
  47182. for (var p = u.array, f = 0, g = p.length - 1; f < g; f += h) {
  47183. var m = p[f]
  47184. , v = p[f + 1];
  47185. a.fromArray(d, 3 * m),
  47186. s.fromArray(d, 3 * v),
  47187. n < zt.distanceSqToSegment(a, s, c, l) || (c.applyMatrix4(this.matrixWorld),
  47188. (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
  47189. distance: C,
  47190. point: l.clone().applyMatrix4(this.matrixWorld),
  47191. index: f,
  47192. face: null,
  47193. faceIndex: null,
  47194. object: this
  47195. }))
  47196. }
  47197. else
  47198. for (f = 0,
  47199. g = d.length / 3 - 1; f < g; f += h)
  47200. a.fromArray(d, 3 * f),
  47201. s.fromArray(d, 3 * f + 3),
  47202. n < zt.distanceSqToSegment(a, s, c, l) || (c.applyMatrix4(this.matrixWorld),
  47203. (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
  47204. distance: C,
  47205. point: l.clone().applyMatrix4(this.matrixWorld),
  47206. index: f,
  47207. face: null,
  47208. faceIndex: null,
  47209. object: this
  47210. }))
  47211. } else if (r instanceof Ci.Geometry) {
  47212. var y = r.vertices
  47213. , A = y.length;
  47214. for (f = 0; f < A - 1; f += h) {
  47215. var C;
  47216. n < zt.distanceSqToSegment(y[f], y[f + 1], c, l) || (c.applyMatrix4(this.matrixWorld),
  47217. (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
  47218. distance: C,
  47219. point: l.clone().applyMatrix4(this.matrixWorld),
  47220. index: f,
  47221. face: null,
  47222. faceIndex: null,
  47223. object: this
  47224. }))
  47225. }
  47226. }
  47227. }
  47228. }
  47229. ),
  47230. Ci.Line.prototype.clone = function() {
  47231. return new this.constructor(this.geometry,this.material).copy(this)
  47232. }
  47233. ,
  47234. Ci.LineStrip = 0,
  47235. Ci.LinePieces = 1,
  47236. Ci.LineSegments = function(e, t) {
  47237. Ci.Line.call(this, e, t),
  47238. this.type = "LineSegments"
  47239. }
  47240. ,
  47241. Ci.LineSegments.prototype = Object.create(Ci.Line.prototype),
  47242. Ci.LineSegments.prototype.constructor = Ci.LineSegments,
  47243. Ci.Mesh = function(e, t) {
  47244. Ci.Object3D.call(this),
  47245. this.type = "Mesh",
  47246. this.geometry = void 0 !== e ? e : new Ci.Geometry,
  47247. this.material = void 0 !== t ? t : new Ci.MeshBasicMaterial({
  47248. color: 16777215 * Math.random()
  47249. }),
  47250. this.drawMode = Ci.TrianglesDrawMode,
  47251. this.updateMorphTargets()
  47252. }
  47253. ,
  47254. Ci.Mesh.prototype = Object.create(Ci.Object3D.prototype),
  47255. Ci.Mesh.prototype.constructor = Ci.Mesh,
  47256. Ci.Mesh.prototype.setDrawMode = function(e) {
  47257. this.drawMode = e
  47258. }
  47259. ,
  47260. Ci.Mesh.prototype.updateMorphTargets = function() {
  47261. if (void 0 !== this.geometry.morphTargets && 0 < this.geometry.morphTargets.length) {
  47262. this.morphTargetBase = -1,
  47263. this.morphTargetInfluences = [],
  47264. this.morphTargetDictionary = {};
  47265. for (var e = 0, t = this.geometry.morphTargets.length; e < t; e++)
  47266. this.morphTargetInfluences.push(0),
  47267. this.morphTargetDictionary[this.geometry.morphTargets[e].name] = e
  47268. }
  47269. }
  47270. ,
  47271. Ci.Mesh.prototype.getMorphTargetIndexByName = function(e) {
  47272. return void 0 !== this.morphTargetDictionary[e] ? this.morphTargetDictionary[e] : (console.warn("THREE.Mesh.getMorphTargetIndexByName: morph target " + e + " does not exist. Returning 0."),
  47273. 0)
  47274. }
  47275. ,
  47276. Ci.Mesh.prototype.raycast = (Tt = new Ci.Matrix4,
  47277. xt = new Ci.Ray,
  47278. St = new Ci.Sphere,
  47279. Mt = new Ci.Vector3,
  47280. Rt = new Ci.Vector3,
  47281. Pt = new Ci.Vector3,
  47282. Ot = new Ci.Vector3,
  47283. Lt = new Ci.Vector3,
  47284. Dt = new Ci.Vector3,
  47285. Nt = new Ci.Vector2,
  47286. Ft = new Ci.Vector2,
  47287. Bt = new Ci.Vector2,
  47288. Vt = new Ci.Vector3,
  47289. kt = new Ci.Vector3,
  47290. Ut = new Ci.Vector3,
  47291. function(e, t) {
  47292. var i, n, r = this.geometry, o = this.material, a = this.matrixWorld;
  47293. if (void 0 !== o && (null === r.boundingSphere && r.computeBoundingSphere(),
  47294. St.copy(r.boundingSphere),
  47295. St.applyMatrix4(a),
  47296. !1 !== e.ray.intersectsSphere(St) && (Tt.getInverse(a),
  47297. xt.copy(e.ray).applyMatrix4(Tt),
  47298. null === r.boundingBox || !1 !== xt.intersectsBox(r.boundingBox))))
  47299. if (r instanceof Ci.BufferGeometry) {
  47300. var s, l, c, h = r.index, u = r.attributes, d = u.position.array;
  47301. if (void 0 !== u.uv && (i = u.uv.array),
  47302. null !== h)
  47303. for (var p = h.array, f = 0, g = p.length; f < g; f += 3)
  47304. s = p[f],
  47305. l = p[f + 1],
  47306. c = p[f + 2],
  47307. (n = Ti(this, e, xt, d, i, s, l, c)) && (n.faceIndex = Math.floor(f / 3),
  47308. t.push(n));
  47309. else
  47310. for (f = 0,
  47311. g = d.length; f < g; f += 9)
  47312. (n = Ti(this, e, xt, d, i, s = f / 3, l = s + 1, c = s + 2)) && (n.index = s,
  47313. t.push(n))
  47314. } else if (r instanceof Ci.Geometry) {
  47315. var m, v, y, A = o instanceof Ci.MultiMaterial, C = 1 == A ? o.materials : null, I = r.vertices, E = r.faces, _ = r.faceVertexUvs[0];
  47316. 0 < _.length && (i = _);
  47317. for (var b = 0, w = E.length; b < w; b++) {
  47318. var T = E[b]
  47319. , x = 1 == A ? C[T.materialIndex] : o;
  47320. if (void 0 !== x) {
  47321. if (m = I[T.a],
  47322. v = I[T.b],
  47323. y = I[T.c],
  47324. !0 === x.morphTargets) {
  47325. var S = r.morphTargets
  47326. , M = this.morphTargetInfluences;
  47327. Mt.set(0, 0, 0),
  47328. Rt.set(0, 0, 0),
  47329. Pt.set(0, 0, 0);
  47330. for (var R = 0, P = S.length; R < P; R++) {
  47331. var O = M[R];
  47332. if (0 !== O) {
  47333. var L = S[R].vertices;
  47334. Mt.addScaledVector(Ot.subVectors(L[T.a], m), O),
  47335. Rt.addScaledVector(Lt.subVectors(L[T.b], v), O),
  47336. Pt.addScaledVector(Dt.subVectors(L[T.c], y), O)
  47337. }
  47338. }
  47339. Mt.add(m),
  47340. Rt.add(v),
  47341. Pt.add(y),
  47342. m = Mt,
  47343. v = Rt,
  47344. y = Pt
  47345. }
  47346. if (n = wi(this, e, xt, m, v, y, kt)) {
  47347. if (i) {
  47348. var D = i[b];
  47349. Nt.copy(D[0]),
  47350. Ft.copy(D[1]),
  47351. Bt.copy(D[2]),
  47352. n.uv = bi(kt, m, v, y, Nt, Ft, Bt)
  47353. }
  47354. n.face = T,
  47355. n.faceIndex = b,
  47356. t.push(n)
  47357. }
  47358. }
  47359. }
  47360. }
  47361. }
  47362. ),
  47363. Ci.Mesh.prototype.clone = function() {
  47364. return new this.constructor(this.geometry,this.material).copy(this)
  47365. }
  47366. ,
  47367. Ci.Bone = function(e) {
  47368. Ci.Object3D.call(this),
  47369. this.type = "Bone",
  47370. this.skin = e
  47371. }
  47372. ,
  47373. Ci.Bone.prototype = Object.create(Ci.Object3D.prototype),
  47374. Ci.Bone.prototype.constructor = Ci.Bone,
  47375. Ci.Bone.prototype.copy = function(e) {
  47376. return Ci.Object3D.prototype.copy.call(this, e),
  47377. this.skin = e.skin,
  47378. this
  47379. }
  47380. ,
  47381. Ci.Skeleton = function(e, t, i) {
  47382. if (this.useVertexTexture = void 0 === i || i,
  47383. this.identityMatrix = new Ci.Matrix4,
  47384. e = e || [],
  47385. this.bones = e.slice(0),
  47386. this.useVertexTexture) {
  47387. var n = Math.sqrt(4 * this.bones.length);
  47388. n = Ci.Math.nextPowerOfTwo(Math.ceil(n)),
  47389. n = Math.max(n, 4),
  47390. this.boneTextureWidth = n,
  47391. this.boneTextureHeight = n,
  47392. this.boneMatrices = new Float32Array(this.boneTextureWidth * this.boneTextureHeight * 4),
  47393. this.boneTexture = new Ci.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,Ci.RGBAFormat,Ci.FloatType)
  47394. } else
  47395. this.boneMatrices = new Float32Array(16 * this.bones.length);
  47396. if (void 0 === t)
  47397. this.calculateInverses();
  47398. else if (this.bones.length === t.length)
  47399. this.boneInverses = t.slice(0);
  47400. else {
  47401. console.warn("THREE.Skeleton bonInverses is the wrong length."),
  47402. this.boneInverses = [];
  47403. for (var r = 0, o = this.bones.length; r < o; r++)
  47404. this.boneInverses.push(new Ci.Matrix4)
  47405. }
  47406. }
  47407. ,
  47408. Ci.Skeleton.prototype.calculateInverses = function() {
  47409. this.boneInverses = [];
  47410. for (var e = 0, t = this.bones.length; e < t; e++) {
  47411. var i = new Ci.Matrix4;
  47412. this.bones[e] && i.getInverse(this.bones[e].matrixWorld),
  47413. this.boneInverses.push(i)
  47414. }
  47415. }
  47416. ,
  47417. Ci.Skeleton.prototype.pose = function() {
  47418. for (var e, t = 0, i = this.bones.length; t < i; t++)
  47419. (e = this.bones[t]) && e.matrixWorld.getInverse(this.boneInverses[t]);
  47420. for (t = 0,
  47421. i = this.bones.length; t < i; t++)
  47422. (e = this.bones[t]) && (e.parent ? (e.matrix.getInverse(e.parent.matrixWorld),
  47423. e.matrix.multiply(e.matrixWorld)) : e.matrix.copy(e.matrixWorld),
  47424. e.matrix.decompose(e.position, e.quaternion, e.scale))
  47425. }
  47426. ,
  47427. Ci.Skeleton.prototype.update = (wt = new Ci.Matrix4,
  47428. function() {
  47429. for (var e = 0, t = this.bones.length; e < t; e++) {
  47430. var i = this.bones[e] ? this.bones[e].matrixWorld : this.identityMatrix;
  47431. wt.multiplyMatrices(i, this.boneInverses[e]),
  47432. wt.flattenToArrayOffset(this.boneMatrices, 16 * e)
  47433. }
  47434. this.useVertexTexture && (this.boneTexture.needsUpdate = !0)
  47435. }
  47436. ),
  47437. Ci.Skeleton.prototype.clone = function() {
  47438. return new Ci.Skeleton(this.bones,this.boneInverses,this.useVertexTexture)
  47439. }
  47440. ,
  47441. Ci.SkinnedMesh = function(e, t, i) {
  47442. Ci.Mesh.call(this, e, t),
  47443. this.type = "SkinnedMesh",
  47444. this.bindMode = "attached",
  47445. this.bindMatrix = new Ci.Matrix4,
  47446. this.bindMatrixInverse = new Ci.Matrix4;
  47447. var n = [];
  47448. if (this.geometry && void 0 !== this.geometry.bones) {
  47449. for (var r, o, a = 0, s = this.geometry.bones.length; a < s; ++a)
  47450. o = this.geometry.bones[a],
  47451. r = new Ci.Bone(this),
  47452. n.push(r),
  47453. r.name = o.name,
  47454. r.position.fromArray(o.pos),
  47455. r.quaternion.fromArray(o.rotq),
  47456. void 0 !== o.scl && r.scale.fromArray(o.scl);
  47457. for (a = 0,
  47458. s = this.geometry.bones.length; a < s; ++a)
  47459. -1 !== (o = this.geometry.bones[a]).parent && null !== o.parent ? n[o.parent].add(n[a]) : this.add(n[a])
  47460. }
  47461. this.normalizeSkinWeights(),
  47462. this.updateMatrixWorld(!0),
  47463. this.bind(new Ci.Skeleton(n,void 0,i), this.matrixWorld)
  47464. }
  47465. ,
  47466. Ci.SkinnedMesh.prototype = Object.create(Ci.Mesh.prototype),
  47467. Ci.SkinnedMesh.prototype.constructor = Ci.SkinnedMesh,
  47468. Ci.SkinnedMesh.prototype.bind = function(e, t) {
  47469. this.skeleton = e,
  47470. void 0 === t && (this.updateMatrixWorld(!0),
  47471. this.skeleton.calculateInverses(),
  47472. t = this.matrixWorld),
  47473. this.bindMatrix.copy(t),
  47474. this.bindMatrixInverse.getInverse(t)
  47475. }
  47476. ,
  47477. Ci.SkinnedMesh.prototype.pose = function() {
  47478. this.skeleton.pose()
  47479. }
  47480. ,
  47481. Ci.SkinnedMesh.prototype.normalizeSkinWeights = function() {
  47482. if (this.geometry instanceof Ci.Geometry)
  47483. for (var e = 0; e < this.geometry.skinWeights.length; e++) {
  47484. var t = this.geometry.skinWeights[e];
  47485. (r = 1 / t.lengthManhattan()) !== 1 / 0 ? t.multiplyScalar(r) : t.set(1, 0, 0, 0)
  47486. }
  47487. else if (this.geometry instanceof Ci.BufferGeometry) {
  47488. var i = new Ci.Vector4
  47489. , n = this.geometry.attributes.skinWeight;
  47490. for (e = 0; e < n.count; e++) {
  47491. var r;
  47492. i.x = n.getX(e),
  47493. i.y = n.getY(e),
  47494. i.z = n.getZ(e),
  47495. i.w = n.getW(e),
  47496. (r = 1 / i.lengthManhattan()) !== 1 / 0 ? i.multiplyScalar(r) : i.set(1, 0, 0, 0),
  47497. n.setXYZW(e, i.x, i.y, i.z, i.w)
  47498. }
  47499. }
  47500. }
  47501. ,
  47502. Ci.SkinnedMesh.prototype.updateMatrixWorld = function(e) {
  47503. Ci.Mesh.prototype.updateMatrixWorld.call(this, !0),
  47504. "attached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.matrixWorld) : "detached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.bindMatrix) : console.warn("THREE.SkinnedMesh unrecognized bindMode: " + this.bindMode)
  47505. }
  47506. ,
  47507. Ci.SkinnedMesh.prototype.clone = function() {
  47508. return new this.constructor(this.geometry,this.material,this.useVertexTexture).copy(this)
  47509. }
  47510. ,
  47511. Ci.LOD = function() {
  47512. Ci.Object3D.call(this),
  47513. this.type = "LOD",
  47514. Object.defineProperties(this, {
  47515. levels: {
  47516. enumerable: !0,
  47517. value: []
  47518. },
  47519. objects: {
  47520. get: function() {
  47521. return console.warn("THREE.LOD: .objects has been renamed to .levels."),
  47522. this.levels
  47523. }
  47524. }
  47525. })
  47526. }
  47527. ,
  47528. Ci.LOD.prototype = Object.create(Ci.Object3D.prototype),
  47529. Ci.LOD.prototype.constructor = Ci.LOD,
  47530. Ci.LOD.prototype.addLevel = function(e, t) {
  47531. void 0 === t && (t = 0),
  47532. t = Math.abs(t);
  47533. for (var i = this.levels, n = 0; n < i.length && !(t < i[n].distance); n++)
  47534. ;
  47535. i.splice(n, 0, {
  47536. distance: t,
  47537. object: e
  47538. }),
  47539. this.add(e)
  47540. }
  47541. ,
  47542. Ci.LOD.prototype.getObjectForDistance = function(e) {
  47543. for (var t = this.levels, i = 1, n = t.length; i < n && !(e < t[i].distance); i++)
  47544. ;
  47545. return t[i - 1].object
  47546. }
  47547. ,
  47548. Ci.LOD.prototype.raycast = (bt = new Ci.Vector3,
  47549. function(e, t) {
  47550. bt.setFromMatrixPosition(this.matrixWorld);
  47551. var i = e.ray.origin.distanceTo(bt);
  47552. this.getObjectForDistance(i).raycast(e, t)
  47553. }
  47554. ),
  47555. Ci.LOD.prototype.update = (Et = new Ci.Vector3,
  47556. _t = new Ci.Vector3,
  47557. function(e) {
  47558. var t = this.levels;
  47559. if (1 < t.length) {
  47560. Et.setFromMatrixPosition(e.matrixWorld),
  47561. _t.setFromMatrixPosition(this.matrixWorld);
  47562. var i = Et.distanceTo(_t);
  47563. t[0].object.visible = !0;
  47564. for (var n = 1, r = t.length; n < r && i >= t[n].distance; n++)
  47565. t[n - 1].object.visible = !1,
  47566. t[n].object.visible = !0;
  47567. for (; n < r; n++)
  47568. t[n].object.visible = !1
  47569. }
  47570. }
  47571. ),
  47572. Ci.LOD.prototype.copy = function(e) {
  47573. Ci.Object3D.prototype.copy.call(this, e, !1);
  47574. for (var t = e.levels, i = 0, n = t.length; i < n; i++) {
  47575. var r = t[i];
  47576. this.addLevel(r.object.clone(), r.distance)
  47577. }
  47578. return this
  47579. }
  47580. ,
  47581. Ci.LOD.prototype.toJSON = function(e) {
  47582. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  47583. t.object.levels = [];
  47584. for (var i = this.levels, n = 0, r = i.length; n < r; n++) {
  47585. var o = i[n];
  47586. t.object.levels.push({
  47587. object: o.object.uuid,
  47588. distance: o.distance
  47589. })
  47590. }
  47591. return t
  47592. }
  47593. ,
  47594. Ci.Sprite = (yt = new Uint16Array([0, 1, 2, 0, 2, 3]),
  47595. At = new Float32Array([-.5, -.5, 0, .5, -.5, 0, .5, .5, 0, -.5, .5, 0]),
  47596. Ct = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]),
  47597. (It = new Ci.BufferGeometry).setIndex(new Ci.BufferAttribute(yt,1)),
  47598. It.addAttribute("position", new Ci.BufferAttribute(At,3)),
  47599. It.addAttribute("uv", new Ci.BufferAttribute(Ct,2)),
  47600. function(e) {
  47601. Ci.Object3D.call(this),
  47602. this.type = "Sprite",
  47603. this.geometry = It,
  47604. this.material = void 0 !== e ? e : new Ci.SpriteMaterial
  47605. }
  47606. ),
  47607. Ci.Sprite.prototype = Object.create(Ci.Object3D.prototype),
  47608. Ci.Sprite.prototype.constructor = Ci.Sprite,
  47609. Ci.Sprite.prototype.raycast = (vt = new Ci.Vector3,
  47610. function(e, t) {
  47611. vt.setFromMatrixPosition(this.matrixWorld);
  47612. var i = e.ray.distanceSqToPoint(vt);
  47613. this.scale.x * this.scale.y < i || t.push({
  47614. distance: Math.sqrt(i),
  47615. point: this.position,
  47616. face: null,
  47617. object: this
  47618. })
  47619. }
  47620. ),
  47621. Ci.Sprite.prototype.clone = function() {
  47622. return new this.constructor(this.material).copy(this)
  47623. }
  47624. ,
  47625. Ci.Particle = Ci.Sprite,
  47626. Ci.LensFlare = function(e, t, i, n, r) {
  47627. Ci.Object3D.call(this),
  47628. this.lensFlares = [],
  47629. this.positionScreen = new Ci.Vector3,
  47630. (this.customUpdateCallback = void 0) !== e && this.add(e, t, i, n, r)
  47631. }
  47632. ,
  47633. Ci.LensFlare.prototype = Object.create(Ci.Object3D.prototype),
  47634. Ci.LensFlare.prototype.constructor = Ci.LensFlare,
  47635. Ci.LensFlare.prototype.add = function(e, t, i, n, r, o) {
  47636. void 0 === t && (t = -1),
  47637. void 0 === i && (i = 0),
  47638. void 0 === o && (o = 1),
  47639. void 0 === r && (r = new Ci.Color(16777215)),
  47640. void 0 === n && (n = Ci.NormalBlending),
  47641. i = Math.min(i, Math.max(0, i)),
  47642. this.lensFlares.push({
  47643. texture: e,
  47644. size: t,
  47645. distance: i,
  47646. x: 0,
  47647. y: 0,
  47648. z: 0,
  47649. scale: 1,
  47650. rotation: 0,
  47651. opacity: o,
  47652. color: r,
  47653. blending: n
  47654. })
  47655. }
  47656. ,
  47657. Ci.LensFlare.prototype.updateLensFlares = function() {
  47658. var e, t, i = this.lensFlares.length, n = 2 * -this.positionScreen.x, r = 2 * -this.positionScreen.y;
  47659. for (e = 0; e < i; e++)
  47660. (t = this.lensFlares[e]).x = this.positionScreen.x + n * t.distance,
  47661. t.y = this.positionScreen.y + r * t.distance,
  47662. t.wantedRotation = t.x * Math.PI * .25,
  47663. t.rotation += .25 * (t.wantedRotation - t.rotation)
  47664. }
  47665. ,
  47666. Ci.LensFlare.prototype.copy = function(e) {
  47667. Ci.Object3D.prototype.copy.call(this, e),
  47668. this.positionScreen.copy(e.positionScreen),
  47669. this.customUpdateCallback = e.customUpdateCallback;
  47670. for (var t = 0, i = e.lensFlares.length; t < i; t++)
  47671. this.lensFlares.push(e.lensFlares[t]);
  47672. return this
  47673. }
  47674. ,
  47675. Ci.Scene = function() {
  47676. Ci.Object3D.call(this),
  47677. this.type = "Scene",
  47678. this.fog = null,
  47679. this.overrideMaterial = null,
  47680. this.autoUpdate = !0
  47681. }
  47682. ,
  47683. Ci.Scene.prototype = Object.create(Ci.Object3D.prototype),
  47684. Ci.Scene.prototype.constructor = Ci.Scene,
  47685. Ci.Scene.prototype.copy = function(e, t) {
  47686. return Ci.Object3D.prototype.copy.call(this, e, t),
  47687. null !== e.fog && (this.fog = e.fog.clone()),
  47688. null !== e.overrideMaterial && (this.overrideMaterial = e.overrideMaterial.clone()),
  47689. this.autoUpdate = e.autoUpdate,
  47690. this.matrixAutoUpdate = e.matrixAutoUpdate,
  47691. this
  47692. }
  47693. ,
  47694. Ci.Fog = function(e, t, i) {
  47695. this.name = "",
  47696. this.color = new Ci.Color(e),
  47697. this.near = void 0 !== t ? t : 1,
  47698. this.far = void 0 !== i ? i : 1e3
  47699. }
  47700. ,
  47701. Ci.Fog.prototype.clone = function() {
  47702. return new Ci.Fog(this.color.getHex(),this.near,this.far)
  47703. }
  47704. ,
  47705. Ci.FogExp2 = function(e, t) {
  47706. this.name = "",
  47707. this.color = new Ci.Color(e),
  47708. this.density = void 0 !== t ? t : 25e-5
  47709. }
  47710. ,
  47711. Ci.FogExp2.prototype.clone = function() {
  47712. return new Ci.FogExp2(this.color.getHex(),this.density)
  47713. }
  47714. ,
  47715. Ci.ShaderChunk = {},
  47716. Ci.ShaderChunk.alphamap_fragment = "#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n",
  47717. Ci.ShaderChunk.alphamap_pars_fragment = "#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n",
  47718. Ci.ShaderChunk.alphatest_fragment = "#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n",
  47719. Ci.ShaderChunk.aomap_fragment = "#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\t#endif\n#endif\n",
  47720. Ci.ShaderChunk.aomap_pars_fragment = "#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",
  47721. Ci.ShaderChunk.begin_vertex = "\nvec3 transformed = vec3( position );\n",
  47722. Ci.ShaderChunk.beginnormal_vertex = "\nvec3 objectNormal = vec3( normal );\n",
  47723. Ci.ShaderChunk.bsdfs = "bool testLightInRange( const in float lightDistance, const in float cutoffDistance ) {\n\treturn any( bvec2( cutoffDistance == 0.0, lightDistance < cutoffDistance ) );\n}\nfloat punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\t\tif( decayExponent > 0.0 ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\t\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\t\tfloat maxDistanceCutoffFactor = pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t\treturn distanceFalloff * maxDistanceCutoffFactor;\n#else\n\t\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n#endif\n\t\t}\n\t\treturn 1.0;\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_Smith( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec3 BRDF_Specular_GGX_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 AB = vec2( -1.04, 1.04 ) * a004 + r.zw;\n\treturn specularColor * AB.x + AB.y;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n",
  47724. Ci.ShaderChunk.bumpmap_pars_fragment = "#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = dFdx( surf_pos );\n\t\tvec3 vSigmaY = dFdy( surf_pos );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif\n",
  47725. Ci.ShaderChunk.color_fragment = "#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",
  47726. Ci.ShaderChunk.color_pars_fragment = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n",
  47727. Ci.ShaderChunk.color_pars_vertex = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",
  47728. Ci.ShaderChunk.color_vertex = "#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",
  47729. Ci.ShaderChunk.common = "#define PI 3.14159\n#define PI2 6.28318\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#define whiteCompliment(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\n",
  47730. Ci.ShaderChunk.cube_uv_reflection_fragment = "#ifdef ENVMAP_TYPE_CUBE_UV\nconst float cubeUV_textureSize = 1024.0;\nint getFaceFromDirection(vec3 direction) {\n vec3 absDirection = abs(direction);\n int face = -1;\n if( absDirection.x > absDirection.z ) {\n if(absDirection.x > absDirection.y )\n face = direction.x > 0.0 ? 0 : 3;\n else\n face = direction.y > 0.0 ? 1 : 4;\n }\n else {\n if(absDirection.z > absDirection.y )\n face = direction.z > 0.0 ? 2 : 5;\n else\n face = direction.y > 0.0 ? 1 : 4;\n }\n return face;\n}\nconst float cubeUV_maxLods1 = log2(cubeUV_textureSize*0.25) - 1.0;\nconst float cubeUV_rangeClamp = exp2((6.0 - 1.0) * 2.0);\nvec2 MipLevelInfo( vec3 vec, float roughnessLevel, float roughness ) {\n float scale = exp2(cubeUV_maxLods1 - roughnessLevel);\n float dxRoughness = dFdx(roughness);\n float dyRoughness = dFdy(roughness);\n vec3 dx = dFdx( vec * scale * dxRoughness );\n vec3 dy = dFdy( vec * scale * dyRoughness );\n float d = max( dot( dx, dx ), dot( dy, dy ) );\n d = clamp(d, 1.0, cubeUV_rangeClamp);\n float mipLevel = 0.5 * log2(d);\n return vec2(floor(mipLevel), fract(mipLevel));\n}\nconst float cubeUV_maxLods2 = log2(cubeUV_textureSize*0.25) - 2.0;\nconst float cubeUV_rcpTextureSize = 1.0 / cubeUV_textureSize;\nvec2 getCubeUV(vec3 direction, float roughnessLevel, float mipLevel) {\n mipLevel = roughnessLevel > cubeUV_maxLods2 - 3.0 ? 0.0 : mipLevel;\n float a = 16.0 * cubeUV_rcpTextureSize;\n vec2 exp2_packed = exp2( vec2( roughnessLevel, mipLevel ) );\n vec2 rcp_exp2_packed = vec2( 1.0 ) / exp2_packed;\n float powScale = exp2_packed.x * exp2_packed.y;\n float scale = rcp_exp2_packed.x * rcp_exp2_packed.y * 0.25;\n float mipOffset = 0.75*(1.0 - rcp_exp2_packed.y) * rcp_exp2_packed.x;\n bool bRes = mipLevel == 0.0;\n scale = bRes && (scale < a) ? a : scale;\n vec3 r;\n vec2 offset;\n int face = getFaceFromDirection(direction);\n float rcpPowScale = 1.0 / powScale;\n if( face == 0) {\n r = vec3(direction.x, -direction.z, direction.y);\n offset = vec2(0.0+mipOffset,0.75 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n }\n else if( face == 1) {\n r = vec3(direction.y, direction.x, direction.z);\n offset = vec2(scale+mipOffset, 0.75 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n }\n else if( face == 2) {\n r = vec3(direction.z, direction.x, direction.y);\n offset = vec2(2.0*scale+mipOffset, 0.75 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n }\n else if( face == 3) {\n r = vec3(direction.x, direction.z, direction.y);\n offset = vec2(0.0+mipOffset,0.5 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n }\n else if( face == 4) {\n r = vec3(direction.y, direction.x, -direction.z);\n offset = vec2(scale+mipOffset, 0.5 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n }\n else {\n r = vec3(direction.z, -direction.x, direction.y);\n offset = vec2(2.0*scale+mipOffset, 0.5 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n }\n r = normalize(r);\n float texelOffset = 0.5 * cubeUV_rcpTextureSize;\n vec2 s = ( r.yz / abs( r.x ) + vec2( 1.0 ) ) * 0.5;\n vec2 base = offset + vec2( texelOffset );\n return base + s * ( scale - 2.0 * texelOffset );\n}\nconst float cubeUV_maxLods3 = log2(cubeUV_textureSize*0.25) - 3.0;\nvec4 textureCubeUV(vec3 reflectedDirection, float roughness ) {\n float roughnessVal = roughness* cubeUV_maxLods3;\n float r1 = floor(roughnessVal);\n float r2 = r1 + 1.0;\n float t = fract(roughnessVal);\n vec2 mipInfo = MipLevelInfo(reflectedDirection, r1, roughness);\n float s = mipInfo.y;\n float level0 = mipInfo.x;\n float level1 = level0 + 1.0;\n level1 = level1 > 5.0 ? 5.0 : level1;\n level0 += min( floor( s + 0.5 ), 5.0 );\n vec2 uv_10 = getCubeUV(reflectedDirection, r1, level0);\n vec4 color10 = envMapTexelToLinear(texture2D(envMap, uv_10));\n vec2 uv_20 = getCubeUV(reflectedDirection, r2, level0);\n vec4 color20 = envMapTexelToLinear(texture2D(envMap, uv_20));\n vec4 result = mix(color10, color20, t);\n return vec4(result.rgb, 1.0);\n}\n#endif\n",
  47731. Ci.ShaderChunk.defaultnormal_vertex = "#ifdef FLIP_SIDED\n\tobjectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n",
  47732. Ci.ShaderChunk.displacementmap_vertex = "#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n",
  47733. Ci.ShaderChunk.displacementmap_pars_vertex = "#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n",
  47734. Ci.ShaderChunk.emissivemap_fragment = "#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif\n",
  47735. Ci.ShaderChunk.emissivemap_pars_fragment = "#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n",
  47736. Ci.ShaderChunk.encodings_pars_fragment = "\nvec4 LinearToLinear( in vec4 value ) {\n return value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n return vec4( pow( value.xyz, vec3( gammaFactor ) ), value.w );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n return vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.w );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.w );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n float maxComponent = max( max( value.r, value.g ), value.b );\n float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n return vec4( value.xyz * value.w * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n float maxRGB = max( value.x, max( value.g, value.b ) );\n float M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n M = ceil( M * 255.0 ) / 255.0;\n return vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n float maxRGB = max( value.x, max( value.g, value.b ) );\n float D = max( maxRange / maxRGB, 1.0 );\n D = min( floor( D ) / 255.0, 1.0 );\n return vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n vec3 Xp_Y_XYZp = value.rgb * cLogLuvM;\n Xp_Y_XYZp = max(Xp_Y_XYZp, vec3(1e-6, 1e-6, 1e-6));\n vec4 vResult;\n vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n vResult.w = fract(Le);\n vResult.z = (Le - (floor(vResult.w*255.0))/255.0)/255.0;\n return vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n float Le = value.z * 255.0 + value.w;\n vec3 Xp_Y_XYZp;\n Xp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);\n Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n vec3 vRGB = Xp_Y_XYZp.rgb * cLogLuvInverseM;\n return vec4( max(vRGB, 0.0), 1.0 );\n}\n",
  47737. Ci.ShaderChunk.encodings_fragment = " gl_FragColor = linearToOutputTexel( gl_FragColor );\n",
  47738. Ci.ShaderChunk.envmap_fragment = "#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tfloat flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#else\n\t\tfloat flipNormal = 1.0;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\tvec2 sampleUV;\n\t\tsampleUV.y = saturate( flipNormal * reflectVec.y * 0.5 + 0.5 );\n\t\tsampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\tvec3 reflectView = flipNormal * normalize((viewMatrix * vec4( reflectVec, 0.0 )).xyz + vec3(0.0,0.0,1.0));\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n\t#endif\n\tenvColor = envMapTexelToLinear( envColor );\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif\n",
  47739. Ci.ShaderChunk.envmap_pars_fragment = "#if defined( USE_ENVMAP ) || defined( STANDARD )\n\tuniform float reflectivity;\n\tuniform float envMapIntenstiy;\n#endif\n#ifdef USE_ENVMAP\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\tuniform float flipEnvMap;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( STANDARD )\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif\n",
  47740. Ci.ShaderChunk.envmap_pars_vertex = "#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP ) && ! defined( PHONG ) && ! defined( STANDARD )\n\tvarying vec3 vReflect;\n\tuniform float refractionRatio;\n#endif\n",
  47741. Ci.ShaderChunk.envmap_vertex = "#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP ) && ! defined( PHONG ) && ! defined( STANDARD )\n\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t#ifdef ENVMAP_MODE_REFLECTION\n\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t#else\n\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t#endif\n#endif\n",
  47742. Ci.ShaderChunk.fog_fragment = "#ifdef USE_FOG\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tfloat depth = gl_FragDepthEXT / gl_FragCoord.w;\n\t#else\n\t\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\t#endif\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * depth * depth * LOG2 ) );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, depth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif\n",
  47743. Ci.ShaderChunk.fog_pars_fragment = "#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",
  47744. Ci.ShaderChunk.lightmap_fragment = "#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n",
  47745. Ci.ShaderChunk.lightmap_pars_fragment = "#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",
  47746. Ci.ShaderChunk.lights_lambert_vertex = "vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\n#if NUM_POINT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tdirectLight = getPointDirectLightIrradiance( pointLights[ i ], geometry );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tdirectLight = getSpotDirectLightIrradiance( spotLights[ i ], geometry );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_DIR_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectLight = getDirectionalDirectLightIrradiance( directionalLights[ i ], geometry );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvLightFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n#endif\n",
  47747. Ci.ShaderChunk.lights_pars = "uniform vec3 ambientLightColor;\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tIncidentLight getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry ) {\n\t\tIncidentLight directLight;\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t\treturn directLight;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tIncidentLight getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry ) {\n\t\tIncidentLight directLight;\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tif ( testLightInRange( lightDistance, pointLight.distance ) ) {\n\t\t\tdirectLight.color = pointLight.color;\n\t\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t\treturn directLight;\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tIncidentLight getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry ) {\n\t\tIncidentLight directLight;\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( all( bvec2( angleCos > spotLight.coneCos, testLightInRange( lightDistance, spotLight.distance ) ) ) ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t\treturn directLight;\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif\n#if defined( USE_ENVMAP ) && defined( STANDARD )\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tfloat flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#else\n\t\t\tfloat flipNormal = 1.0;\n\t\t#endif\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = flipNormal * vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryVec = flipNormal * vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\tvec4 envMapColor = textureCubeUV( queryVec, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar - 0.79248 - 0.5 * log2( pow2( blinnShininessExponent ) + 1.0 );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in GeometricContext geometry, const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -geometry.viewDir, geometry.normal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -geometry.viewDir, geometry.normal, refractionRatio );\n\t\t#endif\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tfloat flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#else\n\t\t\tfloat flipNormal = 1.0;\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( blinnShininessExponent, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryReflectVec = flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\tvec4 envMapColor = textureCubeUV(queryReflectVec, BlinnExponentToGGXRoughness(blinnShininessExponent));\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\t\tvec2 sampleUV;\n\t\t\tsampleUV.y = saturate( flipNormal * reflectVec.y * 0.5 + 0.5 );\n\t\t\tsampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n\t\t\t#endif\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\t\tvec3 reflectView = flipNormal * normalize((viewMatrix * vec4( reflectVec, 0.0 )).xyz + vec3(0.0,0.0,1.0));\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#endif\n\t\t#endif\n\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif\n",
  47748. Ci.ShaderChunk.lights_phong_fragment = "BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",
  47749. Ci.ShaderChunk.lights_phong_pars_fragment = "#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)\n",
  47750. Ci.ShaderChunk.lights_phong_pars_vertex = "#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\n",
  47751. Ci.ShaderChunk.lights_phong_vertex = "#ifdef USE_ENVMAP\n\tvWorldPosition = worldPosition.xyz;\n#endif\n",
  47752. Ci.ShaderChunk.lights_standard_fragment = "StandardMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nmaterial.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );\nmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n",
  47753. Ci.ShaderChunk.lights_standard_pars_fragment = "struct StandardMaterial {\n\tvec3\tdiffuseColor;\n\tfloat\tspecularRoughness;\n\tvec3\tspecularColor;\n};\nvoid RE_Direct_Standard( const in IncidentLight directLight, const in GeometricContext geometry, const in StandardMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_GGX( directLight, geometry, material.specularColor, material.specularRoughness );\n}\nvoid RE_IndirectDiffuse_Standard( const in vec3 irradiance, const in GeometricContext geometry, const in StandardMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Standard( const in vec3 radiance, const in GeometricContext geometry, const in StandardMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectSpecular += radiance * BRDF_Specular_GGX_Environment( geometry, material.specularColor, material.specularRoughness );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Standard\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Standard\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Standard\n#define Material_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.specularRoughness )\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}\n",
  47754. Ci.ShaderChunk.lights_template = "\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = normalize( vViewPosition );\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tdirectLight = getPointDirectLightIrradiance( pointLight, geometry );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( pointLight.shadow, directLight.visible ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tdirectLight = getSpotDirectLightIrradiance( spotLight, geometry );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( spotLight.shadow, directLight.visible ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tdirectLight = getDirectionalDirectLightIrradiance( directionalLight, geometry );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( directionalLight.shadow, directLight.visible ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\t#ifdef USE_LIGHTMAP\n\t\tvec3 lightMapIrradiance = texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t \tirradiance += getLightProbeIndirectIrradiance( geometry, 8 );\n\t#endif\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tvec3 radiance = getLightProbeIndirectRadiance( geometry, Material_BlinnShininessExponent( material ), 8 );\n\tRE_IndirectSpecular( radiance, geometry, material, reflectedLight );\n#endif\n",
  47755. Ci.ShaderChunk.logdepthbuf_fragment = "#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif",
  47756. Ci.ShaderChunk.logdepthbuf_pars_fragment = "#ifdef USE_LOGDEPTHBUF\n\tuniform float logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n#endif\n",
  47757. Ci.ShaderChunk.logdepthbuf_pars_vertex = "#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n\tuniform float logDepthBufFC;\n#endif",
  47758. Ci.ShaderChunk.logdepthbuf_vertex = "#ifdef USE_LOGDEPTHBUF\n\tgl_Position.z = log2(max( EPSILON, gl_Position.w + 1.0 )) * logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t#else\n\t\tgl_Position.z = (gl_Position.z - 1.0) * gl_Position.w;\n\t#endif\n#endif\n",
  47759. Ci.ShaderChunk.map_fragment = "#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n",
  47760. Ci.ShaderChunk.map_pars_fragment = "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n",
  47761. Ci.ShaderChunk.map_particle_fragment = "#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y ) * offsetRepeat.zw + offsetRepeat.xy );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n",
  47762. Ci.ShaderChunk.map_particle_pars_fragment = "#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n",
  47763. Ci.ShaderChunk.metalnessmap_fragment = "float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.r;\n#endif\n",
  47764. Ci.ShaderChunk.metalnessmap_pars_fragment = "#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",
  47765. Ci.ShaderChunk.morphnormal_vertex = "#ifdef USE_MORPHNORMALS\n\tobjectNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\n\tobjectNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\n\tobjectNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\n\tobjectNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\n#endif\n",
  47766. Ci.ShaderChunk.morphtarget_pars_vertex = "#ifdef USE_MORPHTARGETS\n\t#ifndef USE_MORPHNORMALS\n\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",
  47767. Ci.ShaderChunk.morphtarget_vertex = "#ifdef USE_MORPHTARGETS\n\ttransformed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\n\ttransformed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\n\ttransformed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\n\ttransformed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\ttransformed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\n\ttransformed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\n\ttransformed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\n\ttransformed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\n\t#endif\n#endif\n",
  47768. Ci.ShaderChunk.normal_fragment = "#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( -1.0 + 2.0 * float( gl_FrontFacing ) );\n\t#endif\n#endif\n#ifdef USE_NORMALMAP\n\tnormal = perturbNormal2Arb( -vViewPosition, normal );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif\n",
  47769. Ci.ShaderChunk.normalmap_pars_fragment = "#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tvec3 S = normalize( q0 * st1.t - q1 * st0.t );\n\t\tvec3 T = normalize( -q0 * st1.s + q1 * st0.s );\n\t\tvec3 N = normalize( surf_norm );\n\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\tmapN.xy = normalScale * mapN.xy;\n\t\tmat3 tsn = mat3( S, T, N );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif\n",
  47770. Ci.ShaderChunk.premultiplied_alpha_fragment = "#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n",
  47771. Ci.ShaderChunk.project_vertex = "#ifdef USE_SKINNING\n\tvec4 mvPosition = modelViewMatrix * skinned;\n#else\n\tvec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\n#endif\ngl_Position = projectionMatrix * mvPosition;\n",
  47772. Ci.ShaderChunk.roughnessmap_fragment = "float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.r;\n#endif\n",
  47773. Ci.ShaderChunk.roughnessmap_pars_fragment = "#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",
  47774. Ci.ShaderChunk.shadowmap_pars_fragment = "#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n\tfloat unpackDepth( const in vec4 rgba_depth ) {\n\t\tconst vec4 bit_shift = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\n\t\treturn dot( rgba_depth, bit_shift );\n\t}\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackDepth( texture2D( depths, uv ) ) );\n\t}\n\tfloat texture2DShadowLerp( sampler2D depths, vec2 size, vec2 uv, float compare ) {\n\t\tconst vec2 offset = vec2( 0.0, 1.0 );\n\t\tvec2 texelSize = vec2( 1.0 ) / size;\n\t\tvec2 centroidUV = floor( uv * size + 0.5 ) / size;\n\t\tfloat lb = texture2DCompare( depths, centroidUV + texelSize * offset.xx, compare );\n\t\tfloat lt = texture2DCompare( depths, centroidUV + texelSize * offset.xy, compare );\n\t\tfloat rb = texture2DCompare( depths, centroidUV + texelSize * offset.yx, compare );\n\t\tfloat rt = texture2DCompare( depths, centroidUV + texelSize * offset.yy, compare );\n\t\tvec2 f = fract( uv * size + 0.5 );\n\t\tfloat a = mix( lb, lt, f.y );\n\t\tfloat b = mix( rb, rt, f.y );\n\t\tfloat c = mix( a, b, f.x );\n\t\treturn c;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\treturn (\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn 1.0;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\tfloat dp = ( length( lightToPosition ) - shadowBias ) / 1000.0;\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif\n",
  47775. Ci.ShaderChunk.shadowmap_pars_vertex = "#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n#endif\n",
  47776. Ci.ShaderChunk.shadowmap_vertex = "#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n#endif\n",
  47777. Ci.ShaderChunk.shadowmask_pars_fragment = "float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tDirectionalLight directionalLight;\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tshadow *= bool( directionalLight.shadow ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tSpotLight spotLight;\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tshadow *= bool( spotLight.shadow ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tPointLight pointLight;\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tshadow *= bool( pointLight.shadow ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#endif\n\treturn shadow;\n}\n",
  47778. Ci.ShaderChunk.skinbase_vertex = "#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",
  47779. Ci.ShaderChunk.skinning_pars_vertex = "#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform sampler2D boneTexture;\n\t\tuniform int boneTextureWidth;\n\t\tuniform int boneTextureHeight;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureWidth ) );\n\t\t\tfloat y = floor( j / float( boneTextureWidth ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureWidth );\n\t\t\tfloat dy = 1.0 / float( boneTextureHeight );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneGlobalMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneGlobalMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif\n",
  47780. Ci.ShaderChunk.skinning_vertex = "#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\tskinned = bindMatrixInverse * skinned;\n#endif\n",
  47781. Ci.ShaderChunk.skinnormal_vertex = "#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n#endif\n",
  47782. Ci.ShaderChunk.specularmap_fragment = "float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",
  47783. Ci.ShaderChunk.specularmap_pars_fragment = "#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",
  47784. Ci.ShaderChunk.tonemapping_fragment = "#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n",
  47785. Ci.ShaderChunk.tonemapping_pars_fragment = "#define saturate(a) clamp( a, 0.0, 1.0 )\nuniform float toneMappingExposure;\nuniform float toneMappingWhitePoint;\nvec3 LinearToneMapping( vec3 color ) {\n return toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n return saturate( color / ( vec3( 1.0 ) + color ) );\n}\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\nvec3 Uncharted2ToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n return saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n color = max( vec3( 0.0 ), color - 0.004 );\n return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\n",
  47786. Ci.ShaderChunk.uv2_pars_fragment = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",
  47787. Ci.ShaderChunk.uv2_pars_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",
  47788. Ci.ShaderChunk.uv2_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",
  47789. Ci.ShaderChunk.uv_pars_fragment = "#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n#endif",
  47790. Ci.ShaderChunk.uv_pars_vertex = "#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n\tuniform vec4 offsetRepeat;\n#endif\n",
  47791. Ci.ShaderChunk.uv_vertex = "#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvUv = uv * offsetRepeat.zw + offsetRepeat.xy;\n#endif",
  47792. Ci.ShaderChunk.worldpos_vertex = "#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( STANDARD ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP )\n\t#ifdef USE_SKINNING\n\t\tvec4 worldPosition = modelMatrix * skinned;\n\t#else\n\t\tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\n\t#endif\n#endif\n",
  47793. Ci.UniformsUtils = {
  47794. merge: function(e) {
  47795. for (var t = {}, i = 0; i < e.length; i++) {
  47796. var n = this.clone(e[i]);
  47797. for (var r in n)
  47798. t[r] = n[r]
  47799. }
  47800. return t
  47801. },
  47802. clone: function(e) {
  47803. var t = {};
  47804. for (var i in e)
  47805. for (var n in t[i] = {},
  47806. e[i]) {
  47807. var r = e[i][n];
  47808. r instanceof Ci.Color || r instanceof Ci.Vector2 || r instanceof Ci.Vector3 || r instanceof Ci.Vector4 || r instanceof Ci.Matrix3 || r instanceof Ci.Matrix4 || r instanceof Ci.Texture ? t[i][n] = r.clone() : Array.isArray(r) ? t[i][n] = r.slice() : t[i][n] = r
  47809. }
  47810. return t
  47811. }
  47812. },
  47813. Ci.UniformsLib = {
  47814. common: {
  47815. diffuse: {
  47816. type: "c",
  47817. value: new Ci.Color(15658734)
  47818. },
  47819. opacity: {
  47820. type: "f",
  47821. value: 1
  47822. },
  47823. map: {
  47824. type: "t",
  47825. value: null
  47826. },
  47827. offsetRepeat: {
  47828. type: "v4",
  47829. value: new Ci.Vector4(0,0,1,1)
  47830. },
  47831. specularMap: {
  47832. type: "t",
  47833. value: null
  47834. },
  47835. alphaMap: {
  47836. type: "t",
  47837. value: null
  47838. },
  47839. envMap: {
  47840. type: "t",
  47841. value: null
  47842. },
  47843. flipEnvMap: {
  47844. type: "f",
  47845. value: -1
  47846. },
  47847. reflectivity: {
  47848. type: "f",
  47849. value: 1
  47850. },
  47851. refractionRatio: {
  47852. type: "f",
  47853. value: .98
  47854. }
  47855. },
  47856. aomap: {
  47857. aoMap: {
  47858. type: "t",
  47859. value: null
  47860. },
  47861. aoMapIntensity: {
  47862. type: "f",
  47863. value: 1
  47864. }
  47865. },
  47866. lightmap: {
  47867. lightMap: {
  47868. type: "t",
  47869. value: null
  47870. },
  47871. lightMapIntensity: {
  47872. type: "f",
  47873. value: 1
  47874. }
  47875. },
  47876. emissivemap: {
  47877. emissiveMap: {
  47878. type: "t",
  47879. value: null
  47880. }
  47881. },
  47882. bumpmap: {
  47883. bumpMap: {
  47884. type: "t",
  47885. value: null
  47886. },
  47887. bumpScale: {
  47888. type: "f",
  47889. value: 1
  47890. }
  47891. },
  47892. normalmap: {
  47893. normalMap: {
  47894. type: "t",
  47895. value: null
  47896. },
  47897. normalScale: {
  47898. type: "v2",
  47899. value: new Ci.Vector2(1,1)
  47900. }
  47901. },
  47902. displacementmap: {
  47903. displacementMap: {
  47904. type: "t",
  47905. value: null
  47906. },
  47907. displacementScale: {
  47908. type: "f",
  47909. value: 1
  47910. },
  47911. displacementBias: {
  47912. type: "f",
  47913. value: 0
  47914. }
  47915. },
  47916. roughnessmap: {
  47917. roughnessMap: {
  47918. type: "t",
  47919. value: null
  47920. }
  47921. },
  47922. metalnessmap: {
  47923. metalnessMap: {
  47924. type: "t",
  47925. value: null
  47926. }
  47927. },
  47928. fog: {
  47929. fogDensity: {
  47930. type: "f",
  47931. value: 25e-5
  47932. },
  47933. fogNear: {
  47934. type: "f",
  47935. value: 1
  47936. },
  47937. fogFar: {
  47938. type: "f",
  47939. value: 2e3
  47940. },
  47941. fogColor: {
  47942. type: "c",
  47943. value: new Ci.Color(16777215)
  47944. }
  47945. },
  47946. lights: {
  47947. ambientLightColor: {
  47948. type: "fv",
  47949. value: []
  47950. },
  47951. directionalLights: {
  47952. type: "sa",
  47953. value: [],
  47954. properties: {
  47955. direction: {
  47956. type: "v3"
  47957. },
  47958. color: {
  47959. type: "c"
  47960. },
  47961. shadow: {
  47962. type: "i"
  47963. },
  47964. shadowBias: {
  47965. type: "f"
  47966. },
  47967. shadowRadius: {
  47968. type: "f"
  47969. },
  47970. shadowMapSize: {
  47971. type: "v2"
  47972. }
  47973. }
  47974. },
  47975. directionalShadowMap: {
  47976. type: "tv",
  47977. value: []
  47978. },
  47979. directionalShadowMatrix: {
  47980. type: "m4v",
  47981. value: []
  47982. },
  47983. spotLights: {
  47984. type: "sa",
  47985. value: [],
  47986. properties: {
  47987. color: {
  47988. type: "c"
  47989. },
  47990. position: {
  47991. type: "v3"
  47992. },
  47993. direction: {
  47994. type: "v3"
  47995. },
  47996. distance: {
  47997. type: "f"
  47998. },
  47999. coneCos: {
  48000. type: "f"
  48001. },
  48002. penumbraCos: {
  48003. type: "f"
  48004. },
  48005. decay: {
  48006. type: "f"
  48007. },
  48008. shadow: {
  48009. type: "i"
  48010. },
  48011. shadowBias: {
  48012. type: "f"
  48013. },
  48014. shadowRadius: {
  48015. type: "f"
  48016. },
  48017. shadowMapSize: {
  48018. type: "v2"
  48019. }
  48020. }
  48021. },
  48022. spotShadowMap: {
  48023. type: "tv",
  48024. value: []
  48025. },
  48026. spotShadowMatrix: {
  48027. type: "m4v",
  48028. value: []
  48029. },
  48030. pointLights: {
  48031. type: "sa",
  48032. value: [],
  48033. properties: {
  48034. color: {
  48035. type: "c"
  48036. },
  48037. position: {
  48038. type: "v3"
  48039. },
  48040. decay: {
  48041. type: "f"
  48042. },
  48043. distance: {
  48044. type: "f"
  48045. },
  48046. shadow: {
  48047. type: "i"
  48048. },
  48049. shadowBias: {
  48050. type: "f"
  48051. },
  48052. shadowRadius: {
  48053. type: "f"
  48054. },
  48055. shadowMapSize: {
  48056. type: "v2"
  48057. }
  48058. }
  48059. },
  48060. pointShadowMap: {
  48061. type: "tv",
  48062. value: []
  48063. },
  48064. pointShadowMatrix: {
  48065. type: "m4v",
  48066. value: []
  48067. },
  48068. hemisphereLights: {
  48069. type: "sa",
  48070. value: [],
  48071. properties: {
  48072. direction: {
  48073. type: "v3"
  48074. },
  48075. skyColor: {
  48076. type: "c"
  48077. },
  48078. groundColor: {
  48079. type: "c"
  48080. }
  48081. }
  48082. }
  48083. },
  48084. points: {
  48085. diffuse: {
  48086. type: "c",
  48087. value: new Ci.Color(15658734)
  48088. },
  48089. opacity: {
  48090. type: "f",
  48091. value: 1
  48092. },
  48093. size: {
  48094. type: "f",
  48095. value: 1
  48096. },
  48097. scale: {
  48098. type: "f",
  48099. value: 1
  48100. },
  48101. map: {
  48102. type: "t",
  48103. value: null
  48104. },
  48105. offsetRepeat: {
  48106. type: "v4",
  48107. value: new Ci.Vector4(0,0,1,1)
  48108. }
  48109. }
  48110. },
  48111. Ci.ShaderChunk.cube_frag = "uniform samplerCube tCube;\nuniform float tFlip;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tgl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );\n\t#include <logdepthbuf_fragment>\n}\n",
  48112. Ci.ShaderChunk.cube_vert = "varying vec3 vWorldPosition;\n#include <common>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t#include <logdepthbuf_vertex>\n}\n",
  48113. Ci.ShaderChunk.depth_frag = "uniform float mNear;\nuniform float mFar;\nuniform float opacity;\n#include <common>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tfloat depth = gl_FragDepthEXT / gl_FragCoord.w;\n\t#else\n\t\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\t#endif\n\tfloat color = 1.0 - smoothstep( mNear, mFar, depth );\n\tgl_FragColor = vec4( vec3( color ), opacity );\n}\n",
  48114. Ci.ShaderChunk.depth_vert = "#include <common>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n}\n",
  48115. Ci.ShaderChunk.depthRGBA_frag = "#include <common>\n#include <logdepthbuf_pars_fragment>\nvec4 pack_depth( const in float depth ) {\n\tconst vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\n\tconst vec4 bit_mask = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\n\tvec4 res = mod( depth * bit_shift * vec4( 255 ), vec4( 256 ) ) / vec4( 255 );\n\tres -= res.xxyz * bit_mask;\n\treturn res;\n}\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragDepthEXT );\n\t#else\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );\n\t#endif\n}\n",
  48116. Ci.ShaderChunk.depthRGBA_vert = "#include <common>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <skinbase_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n}\n",
  48117. Ci.ShaderChunk.distanceRGBA_frag = "uniform vec3 lightPos;\nvarying vec4 vWorldPosition;\n#include <common>\nvec4 pack1K ( float depth ) {\n\tdepth /= 1000.0;\n\tconst vec4 bitSh = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\n\tconst vec4 bitMsk = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\n\tvec4 res = mod( depth * bitSh * vec4( 255 ), vec4( 256 ) ) / vec4( 255 );\n\tres -= res.xxyz * bitMsk;\n\treturn res;\n}\nfloat unpack1K ( vec4 color ) {\n\tconst vec4 bitSh = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\n\treturn dot( color, bitSh ) * 1000.0;\n}\nvoid main () {\n\tgl_FragColor = pack1K( length( vWorldPosition.xyz - lightPos.xyz ) );\n}\n",
  48118. Ci.ShaderChunk.distanceRGBA_vert = "varying vec4 vWorldPosition;\n#include <common>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\nvoid main() {\n\t#include <skinbase_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\tvWorldPosition = worldPosition;\n}\n",
  48119. Ci.ShaderChunk.equirect_frag = "uniform sampler2D tEquirect;\nuniform float tFlip;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec3 direction = normalize( vWorldPosition );\n\tvec2 sampleUV;\n\tsampleUV.y = saturate( tFlip * direction.y * -0.5 + 0.5 );\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include <logdepthbuf_fragment>\n}\n",
  48120. Ci.ShaderChunk.equirect_vert = "varying vec3 vWorldPosition;\n#include <common>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t#include <logdepthbuf_vertex>\n}\n",
  48121. Ci.ShaderChunk.linedashed_frag = "uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",
  48122. Ci.ShaderChunk.linedashed_vert = "uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\tvLineDistance = scale * lineDistance;\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n}\n",
  48123. Ci.ShaderChunk.meshbasic_frag = "uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight;\n\treflectedLight.directDiffuse = vec3( 0.0 );\n\treflectedLight.directSpecular = vec3( 0.0 );\n\treflectedLight.indirectDiffuse = diffuseColor.rgb;\n\treflectedLight.indirectSpecular = vec3( 0.0 );\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",
  48124. Ci.ShaderChunk.meshbasic_vert = "#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_ENVMAP\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n}\n",
  48125. Ci.ShaderChunk.meshlambert_frag = "uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <bsdfs>\n#include <lights_pars>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <emissivemap_fragment>\n\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\n\t#include <lightmap_fragment>\n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",
  48126. Ci.ShaderChunk.meshlambert_vert = "#define LAMBERT\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <bsdfs>\n#include <lights_pars>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_lambert_vertex>\n\t#include <shadowmap_vertex>\n}\n",
  48127. Ci.ShaderChunk.meshphong_frag = "#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_template>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",
  48128. Ci.ShaderChunk.meshphong_vert = "#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <lights_phong_pars_vertex>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <displacementmap_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_phong_vertex>\n\t#include <shadowmap_vertex>\n}\n",
  48129. Ci.ShaderChunk.meshstandard_frag = "#define STANDARD\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\nuniform float envMapIntensity;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <lights_pars>\n#include <lights_standard_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment>\n\t#include <emissivemap_fragment>\n\t#include <lights_standard_fragment>\n\t#include <lights_template>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",
  48130. Ci.ShaderChunk.meshstandard_vert = "#define STANDARD\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <displacementmap_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n}\n",
  48131. Ci.ShaderChunk.normal_frag = "uniform float opacity;\nvarying vec3 vNormal;\n#include <common>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( 0.5 * normalize( vNormal ) + 0.5, opacity );\n\t#include <logdepthbuf_fragment>\n}\n",
  48132. Ci.ShaderChunk.normal_vert = "varying vec3 vNormal;\n#include <common>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\tvNormal = normalize( normalMatrix * normal );\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n}\n",
  48133. Ci.ShaderChunk.points_frag = "uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",
  48134. Ci.ShaderChunk.points_vert = "uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#ifdef USE_SIZEATTENUATION\n\t\tgl_PointSize = size * ( scale / - mvPosition.z );\n\t#else\n\t\tgl_PointSize = size;\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n}\n",
  48135. Ci.ShaderLib = {
  48136. basic: {
  48137. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.aomap, Ci.UniformsLib.fog]),
  48138. vertexShader: Ci.ShaderChunk.meshbasic_vert,
  48139. fragmentShader: Ci.ShaderChunk.meshbasic_frag
  48140. },
  48141. lambert: {
  48142. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.aomap, Ci.UniformsLib.lightmap, Ci.UniformsLib.emissivemap, Ci.UniformsLib.fog, Ci.UniformsLib.lights, {
  48143. emissive: {
  48144. type: "c",
  48145. value: new Ci.Color(0)
  48146. }
  48147. }]),
  48148. vertexShader: Ci.ShaderChunk.meshlambert_vert,
  48149. fragmentShader: Ci.ShaderChunk.meshlambert_frag
  48150. },
  48151. phong: {
  48152. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.aomap, Ci.UniformsLib.lightmap, Ci.UniformsLib.emissivemap, Ci.UniformsLib.bumpmap, Ci.UniformsLib.normalmap, Ci.UniformsLib.displacementmap, Ci.UniformsLib.fog, Ci.UniformsLib.lights, {
  48153. emissive: {
  48154. type: "c",
  48155. value: new Ci.Color(0)
  48156. },
  48157. specular: {
  48158. type: "c",
  48159. value: new Ci.Color(1118481)
  48160. },
  48161. shininess: {
  48162. type: "f",
  48163. value: 30
  48164. }
  48165. }]),
  48166. vertexShader: Ci.ShaderChunk.meshphong_vert,
  48167. fragmentShader: Ci.ShaderChunk.meshphong_frag
  48168. },
  48169. standard: {
  48170. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.aomap, Ci.UniformsLib.lightmap, Ci.UniformsLib.emissivemap, Ci.UniformsLib.bumpmap, Ci.UniformsLib.normalmap, Ci.UniformsLib.displacementmap, Ci.UniformsLib.roughnessmap, Ci.UniformsLib.metalnessmap, Ci.UniformsLib.fog, Ci.UniformsLib.lights, {
  48171. emissive: {
  48172. type: "c",
  48173. value: new Ci.Color(0)
  48174. },
  48175. roughness: {
  48176. type: "f",
  48177. value: .5
  48178. },
  48179. metalness: {
  48180. type: "f",
  48181. value: 0
  48182. },
  48183. envMapIntensity: {
  48184. type: "f",
  48185. value: 1
  48186. }
  48187. }]),
  48188. vertexShader: Ci.ShaderChunk.meshstandard_vert,
  48189. fragmentShader: Ci.ShaderChunk.meshstandard_frag
  48190. },
  48191. points: {
  48192. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.points, Ci.UniformsLib.fog]),
  48193. vertexShader: Ci.ShaderChunk.points_vert,
  48194. fragmentShader: Ci.ShaderChunk.points_frag
  48195. },
  48196. dashed: {
  48197. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.fog, {
  48198. scale: {
  48199. type: "f",
  48200. value: 1
  48201. },
  48202. dashSize: {
  48203. type: "f",
  48204. value: 1
  48205. },
  48206. totalSize: {
  48207. type: "f",
  48208. value: 2
  48209. }
  48210. }]),
  48211. vertexShader: Ci.ShaderChunk.linedashed_vert,
  48212. fragmentShader: Ci.ShaderChunk.linedashed_frag
  48213. },
  48214. depth: {
  48215. uniforms: {
  48216. mNear: {
  48217. type: "f",
  48218. value: 1
  48219. },
  48220. mFar: {
  48221. type: "f",
  48222. value: 2e3
  48223. },
  48224. opacity: {
  48225. type: "f",
  48226. value: 1
  48227. }
  48228. },
  48229. vertexShader: Ci.ShaderChunk.depth_vert,
  48230. fragmentShader: Ci.ShaderChunk.depth_frag
  48231. },
  48232. normal: {
  48233. uniforms: {
  48234. opacity: {
  48235. type: "f",
  48236. value: 1
  48237. }
  48238. },
  48239. vertexShader: Ci.ShaderChunk.normal_vert,
  48240. fragmentShader: Ci.ShaderChunk.normal_frag
  48241. },
  48242. cube: {
  48243. uniforms: {
  48244. tCube: {
  48245. type: "t",
  48246. value: null
  48247. },
  48248. tFlip: {
  48249. type: "f",
  48250. value: -1
  48251. }
  48252. },
  48253. vertexShader: Ci.ShaderChunk.cube_vert,
  48254. fragmentShader: Ci.ShaderChunk.cube_frag
  48255. },
  48256. equirect: {
  48257. uniforms: {
  48258. tEquirect: {
  48259. type: "t",
  48260. value: null
  48261. },
  48262. tFlip: {
  48263. type: "f",
  48264. value: -1
  48265. }
  48266. },
  48267. vertexShader: Ci.ShaderChunk.equirect_vert,
  48268. fragmentShader: Ci.ShaderChunk.equirect_frag
  48269. },
  48270. depthRGBA: {
  48271. uniforms: {},
  48272. vertexShader: Ci.ShaderChunk.depthRGBA_vert,
  48273. fragmentShader: Ci.ShaderChunk.depthRGBA_frag
  48274. },
  48275. distanceRGBA: {
  48276. uniforms: {
  48277. lightPos: {
  48278. type: "v3",
  48279. value: new Ci.Vector3(0,0,0)
  48280. }
  48281. },
  48282. vertexShader: Ci.ShaderChunk.distanceRGBA_vert,
  48283. fragmentShader: Ci.ShaderChunk.distanceRGBA_frag
  48284. }
  48285. },
  48286. Ci.WebGLRenderer = function(e) {
  48287. function S() {
  48288. return null === Q ? he : 1
  48289. }
  48290. function i(e, t, i, n) {
  48291. !0 === V && (e *= n,
  48292. t *= n,
  48293. i *= n),
  48294. _e.clearColor(e, t, i, n)
  48295. }
  48296. function t() {
  48297. _e.init(),
  48298. _e.scissor(ie.copy(ue).multiplyScalar(he)),
  48299. _e.viewport(re.copy(pe).multiplyScalar(he)),
  48300. i(ae.r, ae.g, ae.b, se)
  48301. }
  48302. function n() {
  48303. te = K = null,
  48304. ee = "",
  48305. $ = -1,
  48306. _e.reset()
  48307. }
  48308. function r(e) {
  48309. e.preventDefault(),
  48310. n(),
  48311. t(),
  48312. be.clear()
  48313. }
  48314. function f(e) {
  48315. var t = e.target;
  48316. t.removeEventListener("dispose", f),
  48317. function(e) {
  48318. var t = be.get(e);
  48319. if (e.image && t.__image__webglTextureCube)
  48320. X.deleteTexture(t.__image__webglTextureCube);
  48321. else {
  48322. if (void 0 === t.__webglInit)
  48323. return;
  48324. X.deleteTexture(t.__webglTexture)
  48325. }
  48326. be.delete(e)
  48327. }(t),
  48328. ye.textures--
  48329. }
  48330. function a(e) {
  48331. var t = e.target;
  48332. t.removeEventListener("dispose", a),
  48333. function(e) {
  48334. var t = be.get(e)
  48335. , i = be.get(e.texture);
  48336. if (e && void 0 !== i.__webglTexture) {
  48337. if (X.deleteTexture(i.__webglTexture),
  48338. e instanceof Ci.WebGLRenderTargetCube)
  48339. for (var n = 0; n < 6; n++)
  48340. X.deleteFramebuffer(t.__webglFramebuffer[n]),
  48341. X.deleteRenderbuffer(t.__webglDepthbuffer[n]);
  48342. else
  48343. X.deleteFramebuffer(t.__webglFramebuffer),
  48344. X.deleteRenderbuffer(t.__webglDepthbuffer);
  48345. be.delete(e.texture),
  48346. be.delete(e)
  48347. }
  48348. }(t),
  48349. ye.textures--
  48350. }
  48351. function v(e) {
  48352. var t = e.target;
  48353. t.removeEventListener("dispose", v),
  48354. function(e) {
  48355. y(e),
  48356. be.delete(e)
  48357. }(t)
  48358. }
  48359. function y(e) {
  48360. var t = be.get(e).program;
  48361. (e.program = void 0) !== t && Te.releaseProgram(t)
  48362. }
  48363. function M(e, t) {
  48364. return Math.abs(t[0]) - Math.abs(e[0])
  48365. }
  48366. function s(e, t) {
  48367. 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
  48368. }
  48369. function l(e, t) {
  48370. 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
  48371. }
  48372. function d(e, t, i, n, r) {
  48373. var o, a;
  48374. a = i.transparent ? (o = G,
  48375. ++W) : (o = H,
  48376. ++z);
  48377. var s = o[a];
  48378. void 0 !== s ? (s.id = e.id,
  48379. s.object = e,
  48380. s.geometry = t,
  48381. s.material = i,
  48382. s.z = me.z,
  48383. s.group = r) : (s = {
  48384. id: e.id,
  48385. object: e,
  48386. geometry: t,
  48387. material: i,
  48388. z: me.z,
  48389. group: r
  48390. },
  48391. o.push(s))
  48392. }
  48393. function c(e, t, i, n) {
  48394. for (var r = 0, o = e.length; r < o; r++) {
  48395. var a = e[r]
  48396. , s = a.object
  48397. , l = a.geometry
  48398. , c = void 0 === n ? a.material : n
  48399. , h = a.group;
  48400. if (s.modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, s.matrixWorld),
  48401. s.normalMatrix.getNormalMatrix(s.modelViewMatrix),
  48402. s instanceof Ci.ImmediateRenderObject) {
  48403. R(c);
  48404. var u = P(t, i, c, s);
  48405. ee = "",
  48406. s.render(function(e) {
  48407. Z.renderBufferImmediate(e, u, c)
  48408. })
  48409. } else
  48410. Z.renderBufferDirect(t, i, l, c, s, h)
  48411. }
  48412. }
  48413. function R(e) {
  48414. (function(e) {
  48415. e.side !== Ci.DoubleSide ? _e.enable(X.CULL_FACE) : _e.disable(X.CULL_FACE),
  48416. _e.setFlipSided(e.side === Ci.BackSide)
  48417. }
  48418. )(e),
  48419. !0 === e.transparent ? _e.setBlending(e.blending, e.blendEquation, e.blendSrc, e.blendDst, e.blendEquationAlpha, e.blendSrcAlpha, e.blendDstAlpha, e.premultipliedAlpha) : _e.setBlending(Ci.NoBlending),
  48420. _e.setDepthFunc(e.depthFunc),
  48421. _e.setDepthTest(e.depthTest),
  48422. _e.setDepthWrite(e.depthWrite),
  48423. _e.setColorWrite(e.colorWrite),
  48424. _e.setPolygonOffset(e.polygonOffset, e.polygonOffsetFactor, e.polygonOffsetUnits)
  48425. }
  48426. function P(e, t, i, n) {
  48427. oe = 0;
  48428. var r = be.get(i);
  48429. void 0 === r.program && (i.needsUpdate = !0),
  48430. void 0 !== r.lightsHash && r.lightsHash !== ve.hash && (i.needsUpdate = !0),
  48431. i.needsUpdate && (function(e, t, i) {
  48432. var n = be.get(e)
  48433. , r = Te.getParameters(e, ve, t, i)
  48434. , o = Te.getProgramCode(e, r)
  48435. , a = n.program
  48436. , s = !0;
  48437. if (void 0 === a)
  48438. e.addEventListener("dispose", v);
  48439. else if (a.code !== o)
  48440. y(e);
  48441. else {
  48442. if (void 0 !== r.shaderID)
  48443. return;
  48444. s = !1
  48445. }
  48446. if (s) {
  48447. if (r.shaderID) {
  48448. var l = Ci.ShaderLib[r.shaderID];
  48449. n.__webglShader = {
  48450. name: e.type,
  48451. uniforms: Ci.UniformsUtils.clone(l.uniforms),
  48452. vertexShader: l.vertexShader,
  48453. fragmentShader: l.fragmentShader
  48454. }
  48455. } else
  48456. n.__webglShader = {
  48457. name: e.type,
  48458. uniforms: e.uniforms,
  48459. vertexShader: e.vertexShader,
  48460. fragmentShader: e.fragmentShader
  48461. };
  48462. e.__webglShader = n.__webglShader,
  48463. a = Te.acquireProgram(e, r, o),
  48464. n.program = a,
  48465. e.program = a
  48466. }
  48467. var c = a.getAttributes();
  48468. if (e.morphTargets)
  48469. for (var h = e.numSupportedMorphTargets = 0; h < Z.maxMorphTargets; h++)
  48470. 0 <= c["morphTarget" + h] && e.numSupportedMorphTargets++;
  48471. if (e.morphNormals)
  48472. for (h = e.numSupportedMorphNormals = 0; h < Z.maxMorphNormals; h++)
  48473. 0 <= c["morphNormal" + h] && e.numSupportedMorphNormals++;
  48474. n.uniformsList = [];
  48475. var u = n.__webglShader.uniforms
  48476. , d = n.program.getUniforms();
  48477. for (var p in u) {
  48478. var f = d[p];
  48479. f && n.uniformsList.push([n.__webglShader.uniforms[p], f])
  48480. }
  48481. (e instanceof Ci.MeshPhongMaterial || e instanceof Ci.MeshLambertMaterial || e instanceof Ci.MeshStandardMaterial || e.lights) && (n.lightsHash = ve.hash,
  48482. u.ambientLightColor.value = ve.ambient,
  48483. u.directionalLights.value = ve.directional,
  48484. u.spotLights.value = ve.spot,
  48485. u.pointLights.value = ve.point,
  48486. u.hemisphereLights.value = ve.hemi,
  48487. u.directionalShadowMap.value = ve.directionalShadowMap,
  48488. u.directionalShadowMatrix.value = ve.directionalShadowMatrix,
  48489. u.spotShadowMap.value = ve.spotShadowMap,
  48490. u.spotShadowMatrix.value = ve.spotShadowMatrix,
  48491. u.pointShadowMap.value = ve.pointShadowMap,
  48492. u.pointShadowMatrix.value = ve.pointShadowMatrix),
  48493. n.hasDynamicUniforms = !1;
  48494. for (var g = 0, m = n.uniformsList.length; g < m; g++) {
  48495. if (!0 === n.uniformsList[g][0].dynamic) {
  48496. n.hasDynamicUniforms = !0;
  48497. break
  48498. }
  48499. }
  48500. }(i, t, n),
  48501. i.needsUpdate = !1);
  48502. var o = !1
  48503. , a = !1
  48504. , s = !1
  48505. , l = r.program
  48506. , c = l.getUniforms()
  48507. , h = r.__webglShader.uniforms;
  48508. if (l.id !== K && (X.useProgram(l.program),
  48509. K = l.id,
  48510. s = a = o = !0),
  48511. i.id !== $ && ($ = i.id,
  48512. a = !0),
  48513. !o && e === te || (X.uniformMatrix4fv(c.projectionMatrix, !1, e.projectionMatrix.elements),
  48514. Ee.logarithmicDepthBuffer && X.uniform1f(c.logDepthBufFC, 2 / (Math.log(e.far + 1) / Math.LN2)),
  48515. e !== te && (te = e,
  48516. s = a = !0),
  48517. (i instanceof Ci.ShaderMaterial || i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshStandardMaterial || i.envMap) && void 0 !== c.cameraPosition && (me.setFromMatrixPosition(e.matrixWorld),
  48518. X.uniform3f(c.cameraPosition, me.x, me.y, me.z)),
  48519. (i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshLambertMaterial || i instanceof Ci.MeshBasicMaterial || i instanceof Ci.MeshStandardMaterial || i instanceof Ci.ShaderMaterial || i.skinning) && void 0 !== c.viewMatrix && X.uniformMatrix4fv(c.viewMatrix, !1, e.matrixWorldInverse.elements),
  48520. void 0 !== c.toneMappingExposure && X.uniform1f(c.toneMappingExposure, Z.toneMappingExposure),
  48521. void 0 !== c.toneMappingWhitePoint && X.uniform1f(c.toneMappingWhitePoint, Z.toneMappingWhitePoint)),
  48522. i.skinning)
  48523. if (n.bindMatrix && void 0 !== c.bindMatrix && X.uniformMatrix4fv(c.bindMatrix, !1, n.bindMatrix.elements),
  48524. n.bindMatrixInverse && void 0 !== c.bindMatrixInverse && X.uniformMatrix4fv(c.bindMatrixInverse, !1, n.bindMatrixInverse.elements),
  48525. Ee.floatVertexTextures && n.skeleton && n.skeleton.useVertexTexture) {
  48526. if (void 0 !== c.boneTexture) {
  48527. var u = A();
  48528. X.uniform1i(c.boneTexture, u),
  48529. Z.setTexture(n.skeleton.boneTexture, u)
  48530. }
  48531. void 0 !== c.boneTextureWidth && X.uniform1i(c.boneTextureWidth, n.skeleton.boneTextureWidth),
  48532. void 0 !== c.boneTextureHeight && X.uniform1i(c.boneTextureHeight, n.skeleton.boneTextureHeight)
  48533. } else
  48534. n.skeleton && n.skeleton.boneMatrices && void 0 !== c.boneGlobalMatrices && X.uniformMatrix4fv(c.boneGlobalMatrices, !1, n.skeleton.boneMatrices);
  48535. return a && ((i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshLambertMaterial || i instanceof Ci.MeshStandardMaterial || i.lights) && function(e, t) {
  48536. e.ambientLightColor.needsUpdate = t,
  48537. e.directionalLights.needsUpdate = t,
  48538. e.pointLights.needsUpdate = t,
  48539. e.spotLights.needsUpdate = t,
  48540. e.hemisphereLights.needsUpdate = t
  48541. }(h, s),
  48542. t && i.fog && function(e, t) {
  48543. e.fogColor.value = t.color,
  48544. t instanceof Ci.Fog ? (e.fogNear.value = t.near,
  48545. e.fogFar.value = t.far) : t instanceof Ci.FogExp2 && (e.fogDensity.value = t.density)
  48546. }(h, t),
  48547. (i instanceof Ci.MeshBasicMaterial || i instanceof Ci.MeshLambertMaterial || i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshStandardMaterial) && function(e, t) {
  48548. var i;
  48549. if (e.opacity.value = t.opacity,
  48550. e.diffuse.value = t.color,
  48551. t.emissive && e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),
  48552. e.map.value = t.map,
  48553. e.specularMap.value = t.specularMap,
  48554. e.alphaMap.value = t.alphaMap,
  48555. t.aoMap && (e.aoMap.value = t.aoMap,
  48556. e.aoMapIntensity.value = t.aoMapIntensity),
  48557. 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),
  48558. void 0 !== i) {
  48559. i instanceof Ci.WebGLRenderTarget && (i = i.texture);
  48560. var n = i.offset
  48561. , r = i.repeat;
  48562. e.offsetRepeat.value.set(n.x, n.y, r.x, r.y)
  48563. }
  48564. e.envMap.value = t.envMap,
  48565. e.flipEnvMap.value = t.envMap instanceof Ci.WebGLRenderTargetCube ? 1 : -1,
  48566. e.reflectivity.value = t.reflectivity,
  48567. e.refractionRatio.value = t.refractionRatio
  48568. }(h, i),
  48569. i instanceof Ci.LineBasicMaterial ? p(h, i) : i instanceof Ci.LineDashedMaterial ? (p(h, i),
  48570. function(e, t) {
  48571. e.dashSize.value = t.dashSize,
  48572. e.totalSize.value = t.dashSize + t.gapSize,
  48573. e.scale.value = t.scale
  48574. }(h, i)) : i instanceof Ci.PointsMaterial ? function(e, t) {
  48575. if (e.diffuse.value = t.color,
  48576. e.opacity.value = t.opacity,
  48577. e.size.value = t.size * he,
  48578. e.scale.value = O.clientHeight / 2,
  48579. e.map.value = t.map,
  48580. null !== t.map) {
  48581. var i = t.map.offset
  48582. , n = t.map.repeat;
  48583. e.offsetRepeat.value.set(i.x, i.y, n.x, n.y)
  48584. }
  48585. }(h, i) : i instanceof Ci.MeshLambertMaterial ? function(e, t) {
  48586. t.lightMap && (e.lightMap.value = t.lightMap,
  48587. e.lightMapIntensity.value = t.lightMapIntensity),
  48588. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap)
  48589. }(h, i) : i instanceof Ci.MeshPhongMaterial ? function(e, t) {
  48590. e.specular.value = t.specular,
  48591. e.shininess.value = Math.max(t.shininess, 1e-4),
  48592. t.lightMap && (e.lightMap.value = t.lightMap,
  48593. e.lightMapIntensity.value = t.lightMapIntensity),
  48594. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  48595. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  48596. e.bumpScale.value = t.bumpScale),
  48597. t.normalMap && (e.normalMap.value = t.normalMap,
  48598. e.normalScale.value.copy(t.normalScale)),
  48599. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  48600. e.displacementScale.value = t.displacementScale,
  48601. e.displacementBias.value = t.displacementBias)
  48602. }(h, i) : i instanceof Ci.MeshStandardMaterial ? function(e, t) {
  48603. e.roughness.value = t.roughness,
  48604. e.metalness.value = t.metalness,
  48605. t.roughnessMap && (e.roughnessMap.value = t.roughnessMap),
  48606. t.metalnessMap && (e.metalnessMap.value = t.metalnessMap),
  48607. t.lightMap && (e.lightMap.value = t.lightMap,
  48608. e.lightMapIntensity.value = t.lightMapIntensity),
  48609. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  48610. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  48611. e.bumpScale.value = t.bumpScale),
  48612. t.normalMap && (e.normalMap.value = t.normalMap,
  48613. e.normalScale.value.copy(t.normalScale)),
  48614. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  48615. e.displacementScale.value = t.displacementScale,
  48616. e.displacementBias.value = t.displacementBias),
  48617. t.envMap && (e.envMapIntensity.value = t.envMapIntensity)
  48618. }(h, i) : i instanceof Ci.MeshDepthMaterial ? (h.mNear.value = e.near,
  48619. h.mFar.value = e.far,
  48620. h.opacity.value = i.opacity) : i instanceof Ci.MeshNormalMaterial && (h.opacity.value = i.opacity),
  48621. g(r.uniformsList)),
  48622. function(e, t) {
  48623. X.uniformMatrix4fv(e.modelViewMatrix, !1, t.modelViewMatrix.elements),
  48624. e.normalMatrix && X.uniformMatrix3fv(e.normalMatrix, !1, t.normalMatrix.elements)
  48625. }(c, n),
  48626. void 0 !== c.modelMatrix && X.uniformMatrix4fv(c.modelMatrix, !1, n.matrixWorld.elements),
  48627. !0 === r.hasDynamicUniforms && function(e, t, i) {
  48628. for (var n = [], r = 0, o = e.length; r < o; r++) {
  48629. var a = e[r][0]
  48630. , s = a.onUpdateCallback;
  48631. void 0 !== s && (s.bind(a)(t, i),
  48632. n.push(e[r]))
  48633. }
  48634. g(n)
  48635. }(r.uniformsList, n, e),
  48636. l
  48637. }
  48638. function p(e, t) {
  48639. e.diffuse.value = t.color,
  48640. e.opacity.value = t.opacity
  48641. }
  48642. function A() {
  48643. var e = oe;
  48644. return e >= Ee.maxTextures && console.warn("WebGLRenderer: trying to use " + e + " texture units while this GPU supports only " + Ee.maxTextures),
  48645. oe += 1,
  48646. e
  48647. }
  48648. function C(e, t, i, n) {
  48649. var r, o;
  48650. if ("1i" === t)
  48651. X.uniform1i(i, n);
  48652. else if ("1f" === t)
  48653. X.uniform1f(i, n);
  48654. else if ("2f" === t)
  48655. X.uniform2f(i, n[0], n[1]);
  48656. else if ("3f" === t)
  48657. X.uniform3f(i, n[0], n[1], n[2]);
  48658. else if ("4f" === t)
  48659. X.uniform4f(i, n[0], n[1], n[2], n[3]);
  48660. else if ("1iv" === t)
  48661. X.uniform1iv(i, n);
  48662. else if ("3iv" === t)
  48663. X.uniform3iv(i, n);
  48664. else if ("1fv" === t)
  48665. X.uniform1fv(i, n);
  48666. else if ("2fv" === t)
  48667. X.uniform2fv(i, n);
  48668. else if ("3fv" === t)
  48669. X.uniform3fv(i, n);
  48670. else if ("4fv" === t)
  48671. X.uniform4fv(i, n);
  48672. else if ("Matrix2fv" === t)
  48673. X.uniformMatrix2fv(i, !1, n);
  48674. else if ("Matrix3fv" === t)
  48675. X.uniformMatrix3fv(i, !1, n);
  48676. else if ("Matrix4fv" === t)
  48677. X.uniformMatrix4fv(i, !1, n);
  48678. else if ("i" === t)
  48679. X.uniform1i(i, n);
  48680. else if ("f" === t)
  48681. X.uniform1f(i, n);
  48682. else if ("v2" === t)
  48683. X.uniform2f(i, n.x, n.y);
  48684. else if ("v3" === t)
  48685. X.uniform3f(i, n.x, n.y, n.z);
  48686. else if ("v4" === t)
  48687. X.uniform4f(i, n.x, n.y, n.z, n.w);
  48688. else if ("c" === t)
  48689. X.uniform3f(i, n.r, n.g, n.b);
  48690. else if ("s" === t) {
  48691. var a = e.properties;
  48692. for (var s in a) {
  48693. var l = a[s]
  48694. , c = i[s]
  48695. , h = n[s];
  48696. C(l, l.type, c, h)
  48697. }
  48698. } else if ("sa" === t) {
  48699. a = e.properties;
  48700. for (var u = 0, d = n.length; u < d; u++)
  48701. for (var s in a) {
  48702. l = a[s],
  48703. c = i[u][s],
  48704. h = n[u][s];
  48705. C(l, l.type, c, h)
  48706. }
  48707. } else if ("iv1" === t)
  48708. X.uniform1iv(i, n);
  48709. else if ("iv" === t)
  48710. X.uniform3iv(i, n);
  48711. else if ("fv1" === t)
  48712. X.uniform1fv(i, n);
  48713. else if ("fv" === t)
  48714. X.uniform3fv(i, n);
  48715. else if ("v2v" === t) {
  48716. void 0 === e._array && (e._array = new Float32Array(2 * n.length));
  48717. u = 0;
  48718. for (var p = 0, f = n.length; u < f; u++,
  48719. p += 2)
  48720. e._array[p + 0] = n[u].x,
  48721. e._array[p + 1] = n[u].y;
  48722. X.uniform2fv(i, e._array)
  48723. } else if ("v3v" === t) {
  48724. void 0 === e._array && (e._array = new Float32Array(3 * n.length));
  48725. u = 0;
  48726. var g = 0;
  48727. for (f = n.length; u < f; u++,
  48728. g += 3)
  48729. e._array[g + 0] = n[u].x,
  48730. e._array[g + 1] = n[u].y,
  48731. e._array[g + 2] = n[u].z;
  48732. X.uniform3fv(i, e._array)
  48733. } else if ("v4v" === t) {
  48734. void 0 === e._array && (e._array = new Float32Array(4 * n.length));
  48735. u = 0;
  48736. var m = 0;
  48737. for (f = n.length; u < f; u++,
  48738. m += 4)
  48739. e._array[m + 0] = n[u].x,
  48740. e._array[m + 1] = n[u].y,
  48741. e._array[m + 2] = n[u].z,
  48742. e._array[m + 3] = n[u].w;
  48743. X.uniform4fv(i, e._array)
  48744. } else if ("m2" === t)
  48745. X.uniformMatrix2fv(i, !1, n.elements);
  48746. else if ("m3" === t)
  48747. X.uniformMatrix3fv(i, !1, n.elements);
  48748. else if ("m3v" === t) {
  48749. void 0 === e._array && (e._array = new Float32Array(9 * n.length));
  48750. for (u = 0,
  48751. f = n.length; u < f; u++)
  48752. n[u].flattenToArrayOffset(e._array, 9 * u);
  48753. X.uniformMatrix3fv(i, !1, e._array)
  48754. } else if ("m4" === t)
  48755. X.uniformMatrix4fv(i, !1, n.elements);
  48756. else if ("m4v" === t) {
  48757. void 0 === e._array && (e._array = new Float32Array(16 * n.length));
  48758. for (u = 0,
  48759. f = n.length; u < f; u++)
  48760. n[u].flattenToArrayOffset(e._array, 16 * u);
  48761. X.uniformMatrix4fv(i, !1, e._array)
  48762. } else if ("t" === t) {
  48763. if (r = n,
  48764. o = A(),
  48765. X.uniform1i(i, o),
  48766. !r)
  48767. return;
  48768. r instanceof Ci.CubeTexture || Array.isArray(r.image) && 6 === r.image.length ? _(r, o) : r instanceof Ci.WebGLRenderTargetCube ? b(r.texture, o) : r instanceof Ci.WebGLRenderTarget ? Z.setTexture(r.texture, o) : Z.setTexture(r, o)
  48769. } else if ("tv" === t) {
  48770. void 0 === e._array && (e._array = []);
  48771. for (u = 0,
  48772. f = e.value.length; u < f; u++)
  48773. e._array[u] = A();
  48774. X.uniform1iv(i, e._array);
  48775. for (u = 0,
  48776. f = e.value.length; u < f; u++)
  48777. r = e.value[u],
  48778. o = e._array[u],
  48779. r && (r instanceof Ci.CubeTexture || r.image instanceof Array && 6 === r.image.length ? _(r, o) : r instanceof Ci.WebGLRenderTarget ? Z.setTexture(r.texture, o) : r instanceof Ci.WebGLRenderTargetCube ? b(r.texture, o) : Z.setTexture(r, o))
  48780. } else
  48781. console.warn("THREE.WebGLRenderer: Unknown uniform type: " + t)
  48782. }
  48783. function g(e) {
  48784. for (var t = 0, i = e.length; t < i; t++) {
  48785. var n = e[t][0];
  48786. if (!1 !== n.needsUpdate)
  48787. C(n, n.type, e[t][1], n.value)
  48788. }
  48789. }
  48790. function m(e, t, i) {
  48791. var n;
  48792. if (i ? (X.texParameteri(e, X.TEXTURE_WRAP_S, x(t.wrapS)),
  48793. X.texParameteri(e, X.TEXTURE_WRAP_T, x(t.wrapT)),
  48794. X.texParameteri(e, X.TEXTURE_MAG_FILTER, x(t.magFilter)),
  48795. X.texParameteri(e, X.TEXTURE_MIN_FILTER, x(t.minFilter))) : (X.texParameteri(e, X.TEXTURE_WRAP_S, X.CLAMP_TO_EDGE),
  48796. X.texParameteri(e, X.TEXTURE_WRAP_T, X.CLAMP_TO_EDGE),
  48797. t.wrapS === Ci.ClampToEdgeWrapping && t.wrapT === Ci.ClampToEdgeWrapping || console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.", t),
  48798. X.texParameteri(e, X.TEXTURE_MAG_FILTER, T(t.magFilter)),
  48799. X.texParameteri(e, X.TEXTURE_MIN_FILTER, T(t.minFilter)),
  48800. t.minFilter !== Ci.NearestFilter && t.minFilter !== Ci.LinearFilter && console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.", t)),
  48801. n = Ie.get("EXT_texture_filter_anisotropic")) {
  48802. if (t.type === Ci.FloatType && null === Ie.get("OES_texture_float_linear"))
  48803. return;
  48804. if (t.type === Ci.HalfFloatType && null === Ie.get("OES_texture_half_float_linear"))
  48805. return;
  48806. (1 < t.anisotropy || be.get(t).__currentAnisotropy) && (X.texParameterf(e, n.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(t.anisotropy, Z.getMaxAnisotropy())),
  48807. be.get(t).__currentAnisotropy = t.anisotropy)
  48808. }
  48809. }
  48810. function o(e, t, i) {
  48811. void 0 === e.__webglInit && (e.__webglInit = !0,
  48812. t.addEventListener("dispose", f),
  48813. e.__webglTexture = X.createTexture(),
  48814. ye.textures++),
  48815. _e.activeTexture(X.TEXTURE0 + i),
  48816. _e.bindTexture(X.TEXTURE_2D, e.__webglTexture),
  48817. X.pixelStorei(X.UNPACK_FLIP_Y_WEBGL, t.flipY),
  48818. X.pixelStorei(X.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  48819. X.pixelStorei(X.UNPACK_ALIGNMENT, t.unpackAlignment);
  48820. var n = I(t.image, Ee.maxTextureSize);
  48821. !function(e) {
  48822. return e.wrapS !== Ci.ClampToEdgeWrapping || e.wrapT !== Ci.ClampToEdgeWrapping || e.minFilter !== Ci.NearestFilter && e.minFilter !== Ci.LinearFilter
  48823. }(t) || !1 !== E(n) || (n = function(e) {
  48824. if (e instanceof HTMLImageElement || e instanceof HTMLCanvasElement) {
  48825. var t = document.createElement("canvas");
  48826. return t.width = Ci.Math.nearestPowerOfTwo(e.width),
  48827. t.height = Ci.Math.nearestPowerOfTwo(e.height),
  48828. t.getContext("2d").drawImage(e, 0, 0, t.width, t.height),
  48829. console.warn("THREE.WebGLRenderer: image is not power of two (" + e.width + "x" + e.height + "). Resized to " + t.width + "x" + t.height, e),
  48830. t
  48831. }
  48832. return e
  48833. }(n));
  48834. var r = E(n)
  48835. , o = x(t.format)
  48836. , a = x(t.type);
  48837. m(X.TEXTURE_2D, t, r);
  48838. var s, l = t.mipmaps;
  48839. if (t instanceof Ci.DataTexture)
  48840. if (0 < l.length && r) {
  48841. for (var c = 0, h = l.length; c < h; c++)
  48842. s = l[c],
  48843. _e.texImage2D(X.TEXTURE_2D, c, o, s.width, s.height, 0, o, a, s.data);
  48844. t.generateMipmaps = !1
  48845. } else
  48846. _e.texImage2D(X.TEXTURE_2D, 0, o, n.width, n.height, 0, o, a, n.data);
  48847. else if (t instanceof Ci.CompressedTexture)
  48848. for (c = 0,
  48849. h = l.length; c < h; c++)
  48850. s = l[c],
  48851. t.format !== Ci.RGBAFormat && t.format !== Ci.RGBFormat ? -1 < _e.getCompressedTextureFormats().indexOf(o) ? _e.compressedTexImage2D(X.TEXTURE_2D, c, o, s.width, s.height, 0, s.data) : console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()") : _e.texImage2D(X.TEXTURE_2D, c, o, s.width, s.height, 0, o, a, s.data);
  48852. else if (0 < l.length && r) {
  48853. for (c = 0,
  48854. h = l.length; c < h; c++)
  48855. s = l[c],
  48856. _e.texImage2D(X.TEXTURE_2D, c, o, o, a, s);
  48857. t.generateMipmaps = !1
  48858. } else
  48859. _e.texImage2D(X.TEXTURE_2D, 0, o, o, a, n);
  48860. t.generateMipmaps && r && X.generateMipmap(X.TEXTURE_2D),
  48861. e.__version = t.version,
  48862. t.onUpdate && t.onUpdate(t)
  48863. }
  48864. function I(e, t) {
  48865. if (e.width > t || e.height > t) {
  48866. var i = t / Math.max(e.width, e.height)
  48867. , n = document.createElement("canvas");
  48868. return n.width = Math.floor(e.width * i),
  48869. n.height = Math.floor(e.height * i),
  48870. n.getContext("2d").drawImage(e, 0, 0, e.width, e.height, 0, 0, n.width, n.height),
  48871. console.warn("THREE.WebGLRenderer: image is too big (" + e.width + "x" + e.height + "). Resized to " + n.width + "x" + n.height, e),
  48872. n
  48873. }
  48874. return e
  48875. }
  48876. function E(e) {
  48877. return Ci.Math.isPowerOfTwo(e.width) && Ci.Math.isPowerOfTwo(e.height)
  48878. }
  48879. function _(e, t) {
  48880. var i = be.get(e);
  48881. if (6 === e.image.length)
  48882. if (0 < e.version && i.__version !== e.version) {
  48883. i.__image__webglTextureCube || (e.addEventListener("dispose", f),
  48884. i.__image__webglTextureCube = X.createTexture(),
  48885. ye.textures++),
  48886. _e.activeTexture(X.TEXTURE0 + t),
  48887. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__image__webglTextureCube),
  48888. X.pixelStorei(X.UNPACK_FLIP_Y_WEBGL, e.flipY);
  48889. for (var n = e instanceof Ci.CompressedTexture, r = e.image[0]instanceof Ci.DataTexture, o = [], a = 0; a < 6; a++)
  48890. !Z.autoScaleCubemaps || n || r ? o[a] = r ? e.image[a].image : e.image[a] : o[a] = I(e.image[a], Ee.maxCubemapSize);
  48891. var s = E(o[0])
  48892. , l = x(e.format)
  48893. , c = x(e.type);
  48894. m(X.TEXTURE_CUBE_MAP, e, s);
  48895. for (a = 0; a < 6; a++)
  48896. if (n)
  48897. for (var h, u = o[a].mipmaps, d = 0, p = u.length; d < p; d++)
  48898. h = u[d],
  48899. e.format !== Ci.RGBAFormat && e.format !== Ci.RGBFormat ? -1 < _e.getCompressedTextureFormats().indexOf(l) ? _e.compressedTexImage2D(X.TEXTURE_CUBE_MAP_POSITIVE_X + a, d, l, h.width, h.height, 0, h.data) : console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setCubeTexture()") : _e.texImage2D(X.TEXTURE_CUBE_MAP_POSITIVE_X + a, d, l, h.width, h.height, 0, l, c, h.data);
  48900. else
  48901. r ? _e.texImage2D(X.TEXTURE_CUBE_MAP_POSITIVE_X + a, 0, l, o[a].width, o[a].height, 0, l, c, o[a].data) : _e.texImage2D(X.TEXTURE_CUBE_MAP_POSITIVE_X + a, 0, l, l, c, o[a]);
  48902. e.generateMipmaps && s && X.generateMipmap(X.TEXTURE_CUBE_MAP),
  48903. i.__version = e.version,
  48904. e.onUpdate && e.onUpdate(e)
  48905. } else
  48906. _e.activeTexture(X.TEXTURE0 + t),
  48907. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__image__webglTextureCube)
  48908. }
  48909. function b(e, t) {
  48910. _e.activeTexture(X.TEXTURE0 + t),
  48911. _e.bindTexture(X.TEXTURE_CUBE_MAP, be.get(e).__webglTexture)
  48912. }
  48913. function h(e, t, i, n) {
  48914. var r = x(t.texture.format)
  48915. , o = x(t.texture.type);
  48916. _e.texImage2D(n, 0, r, t.width, t.height, 0, r, o, null),
  48917. X.bindFramebuffer(X.FRAMEBUFFER, e),
  48918. X.framebufferTexture2D(X.FRAMEBUFFER, i, n, be.get(t.texture).__webglTexture, 0),
  48919. X.bindFramebuffer(X.FRAMEBUFFER, null)
  48920. }
  48921. function u(e, t) {
  48922. X.bindRenderbuffer(X.RENDERBUFFER, e),
  48923. t.depthBuffer && !t.stencilBuffer ? (X.renderbufferStorage(X.RENDERBUFFER, X.DEPTH_COMPONENT16, t.width, t.height),
  48924. X.framebufferRenderbuffer(X.FRAMEBUFFER, X.DEPTH_ATTACHMENT, X.RENDERBUFFER, e)) : t.depthBuffer && t.stencilBuffer ? (X.renderbufferStorage(X.RENDERBUFFER, X.DEPTH_STENCIL, t.width, t.height),
  48925. X.framebufferRenderbuffer(X.FRAMEBUFFER, X.DEPTH_STENCIL_ATTACHMENT, X.RENDERBUFFER, e)) : X.renderbufferStorage(X.RENDERBUFFER, X.RGBA4, t.width, t.height),
  48926. X.bindRenderbuffer(X.RENDERBUFFER, null)
  48927. }
  48928. function w(e) {
  48929. var t = be.get(e)
  48930. , i = be.get(e.texture);
  48931. e.addEventListener("dispose", a),
  48932. i.__webglTexture = X.createTexture(),
  48933. ye.textures++;
  48934. var n = e instanceof Ci.WebGLRenderTargetCube
  48935. , r = Ci.Math.isPowerOfTwo(e.width) && Ci.Math.isPowerOfTwo(e.height);
  48936. if (n) {
  48937. t.__webglFramebuffer = [];
  48938. for (var o = 0; o < 6; o++)
  48939. t.__webglFramebuffer[o] = X.createFramebuffer()
  48940. } else
  48941. t.__webglFramebuffer = X.createFramebuffer();
  48942. if (n) {
  48943. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__webglTexture),
  48944. m(X.TEXTURE_CUBE_MAP, e.texture, r);
  48945. for (o = 0; o < 6; o++)
  48946. h(t.__webglFramebuffer[o], e, X.COLOR_ATTACHMENT0, X.TEXTURE_CUBE_MAP_POSITIVE_X + o);
  48947. e.texture.generateMipmaps && r && X.generateMipmap(X.TEXTURE_CUBE_MAP),
  48948. _e.bindTexture(X.TEXTURE_CUBE_MAP, null)
  48949. } else
  48950. _e.bindTexture(X.TEXTURE_2D, i.__webglTexture),
  48951. m(X.TEXTURE_2D, e.texture, r),
  48952. h(t.__webglFramebuffer, e, X.COLOR_ATTACHMENT0, X.TEXTURE_2D),
  48953. e.texture.generateMipmaps && r && X.generateMipmap(X.TEXTURE_2D),
  48954. _e.bindTexture(X.TEXTURE_2D, null);
  48955. e.depthBuffer && function(e) {
  48956. var t = be.get(e);
  48957. if (e instanceof Ci.WebGLRenderTargetCube) {
  48958. t.__webglDepthbuffer = [];
  48959. for (var i = 0; i < 6; i++)
  48960. X.bindFramebuffer(X.FRAMEBUFFER, t.__webglFramebuffer[i]),
  48961. t.__webglDepthbuffer[i] = X.createRenderbuffer(),
  48962. u(t.__webglDepthbuffer[i], e)
  48963. } else
  48964. X.bindFramebuffer(X.FRAMEBUFFER, t.__webglFramebuffer),
  48965. t.__webglDepthbuffer = X.createRenderbuffer(),
  48966. u(t.__webglDepthbuffer, e);
  48967. X.bindFramebuffer(X.FRAMEBUFFER, null)
  48968. }(e)
  48969. }
  48970. function T(e) {
  48971. return e === Ci.NearestFilter || e === Ci.NearestMipMapNearestFilter || e === Ci.NearestMipMapLinearFilter ? X.NEAREST : X.LINEAR
  48972. }
  48973. function x(e) {
  48974. var t;
  48975. if (e === Ci.RepeatWrapping)
  48976. return X.REPEAT;
  48977. if (e === Ci.ClampToEdgeWrapping)
  48978. return X.CLAMP_TO_EDGE;
  48979. if (e === Ci.MirroredRepeatWrapping)
  48980. return X.MIRRORED_REPEAT;
  48981. if (e === Ci.NearestFilter)
  48982. return X.NEAREST;
  48983. if (e === Ci.NearestMipMapNearestFilter)
  48984. return X.NEAREST_MIPMAP_NEAREST;
  48985. if (e === Ci.NearestMipMapLinearFilter)
  48986. return X.NEAREST_MIPMAP_LINEAR;
  48987. if (e === Ci.LinearFilter)
  48988. return X.LINEAR;
  48989. if (e === Ci.LinearMipMapNearestFilter)
  48990. return X.LINEAR_MIPMAP_NEAREST;
  48991. if (e === Ci.LinearMipMapLinearFilter)
  48992. return X.LINEAR_MIPMAP_LINEAR;
  48993. if (e === Ci.UnsignedByteType)
  48994. return X.UNSIGNED_BYTE;
  48995. if (e === Ci.UnsignedShort4444Type)
  48996. return X.UNSIGNED_SHORT_4_4_4_4;
  48997. if (e === Ci.UnsignedShort5551Type)
  48998. return X.UNSIGNED_SHORT_5_5_5_1;
  48999. if (e === Ci.UnsignedShort565Type)
  49000. return X.UNSIGNED_SHORT_5_6_5;
  49001. if (e === Ci.ByteType)
  49002. return X.BYTE;
  49003. if (e === Ci.ShortType)
  49004. return X.SHORT;
  49005. if (e === Ci.UnsignedShortType)
  49006. return X.UNSIGNED_SHORT;
  49007. if (e === Ci.IntType)
  49008. return X.INT;
  49009. if (e === Ci.UnsignedIntType)
  49010. return X.UNSIGNED_INT;
  49011. if (e === Ci.FloatType)
  49012. return X.FLOAT;
  49013. if (null !== (t = Ie.get("OES_texture_half_float")) && e === Ci.HalfFloatType)
  49014. return t.HALF_FLOAT_OES;
  49015. if (e === Ci.AlphaFormat)
  49016. return X.ALPHA;
  49017. if (e === Ci.RGBFormat)
  49018. return X.RGB;
  49019. if (e === Ci.RGBAFormat)
  49020. return X.RGBA;
  49021. if (e === Ci.LuminanceFormat)
  49022. return X.LUMINANCE;
  49023. if (e === Ci.LuminanceAlphaFormat)
  49024. return X.LUMINANCE_ALPHA;
  49025. if (e === Ci.AddEquation)
  49026. return X.FUNC_ADD;
  49027. if (e === Ci.SubtractEquation)
  49028. return X.FUNC_SUBTRACT;
  49029. if (e === Ci.ReverseSubtractEquation)
  49030. return X.FUNC_REVERSE_SUBTRACT;
  49031. if (e === Ci.ZeroFactor)
  49032. return X.ZERO;
  49033. if (e === Ci.OneFactor)
  49034. return X.ONE;
  49035. if (e === Ci.SrcColorFactor)
  49036. return X.SRC_COLOR;
  49037. if (e === Ci.OneMinusSrcColorFactor)
  49038. return X.ONE_MINUS_SRC_COLOR;
  49039. if (e === Ci.SrcAlphaFactor)
  49040. return X.SRC_ALPHA;
  49041. if (e === Ci.OneMinusSrcAlphaFactor)
  49042. return X.ONE_MINUS_SRC_ALPHA;
  49043. if (e === Ci.DstAlphaFactor)
  49044. return X.DST_ALPHA;
  49045. if (e === Ci.OneMinusDstAlphaFactor)
  49046. return X.ONE_MINUS_DST_ALPHA;
  49047. if (e === Ci.DstColorFactor)
  49048. return X.DST_COLOR;
  49049. if (e === Ci.OneMinusDstColorFactor)
  49050. return X.ONE_MINUS_DST_COLOR;
  49051. if (e === Ci.SrcAlphaSaturateFactor)
  49052. return X.SRC_ALPHA_SATURATE;
  49053. if (null !== (t = Ie.get("WEBGL_compressed_texture_s3tc"))) {
  49054. if (e === Ci.RGB_S3TC_DXT1_Format)
  49055. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  49056. if (e === Ci.RGBA_S3TC_DXT1_Format)
  49057. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  49058. if (e === Ci.RGBA_S3TC_DXT3_Format)
  49059. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  49060. if (e === Ci.RGBA_S3TC_DXT5_Format)
  49061. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  49062. }
  49063. if (null !== (t = Ie.get("WEBGL_compressed_texture_pvrtc"))) {
  49064. if (e === Ci.RGB_PVRTC_4BPPV1_Format)
  49065. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  49066. if (e === Ci.RGB_PVRTC_2BPPV1_Format)
  49067. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  49068. if (e === Ci.RGBA_PVRTC_4BPPV1_Format)
  49069. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  49070. if (e === Ci.RGBA_PVRTC_2BPPV1_Format)
  49071. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  49072. }
  49073. if (null !== (t = Ie.get("WEBGL_compressed_texture_etc1")) && e === Ci.RGB_ETC1_Format)
  49074. return t.COMPRESSED_RGB_ETC1_WEBGL;
  49075. if (null !== (t = Ie.get("EXT_blend_minmax"))) {
  49076. if (e === Ci.MinEquation)
  49077. return t.MIN_EXT;
  49078. if (e === Ci.MaxEquation)
  49079. return t.MAX_EXT
  49080. }
  49081. return 0
  49082. }
  49083. console.log("THREE.WebGLRenderer", Ci.REVISION);
  49084. var O = void 0 !== (e = e || {}).canvas ? e.canvas : document.createElement("canvas")
  49085. , L = void 0 !== e.context ? e.context : null
  49086. , D = void 0 !== e.alpha && e.alpha
  49087. , N = void 0 === e.depth || e.depth
  49088. , F = void 0 === e.stencil || e.stencil
  49089. , B = void 0 !== e.antialias && e.antialias
  49090. , V = void 0 === e.premultipliedAlpha || e.premultipliedAlpha
  49091. , k = void 0 !== e.preserveDrawingBuffer && e.preserveDrawingBuffer
  49092. , U = []
  49093. , H = []
  49094. , z = -1
  49095. , G = []
  49096. , W = -1
  49097. , j = new Float32Array(8)
  49098. , Y = []
  49099. , q = [];
  49100. this.domElement = O,
  49101. this.context = null,
  49102. this.autoClear = !0,
  49103. this.autoClearColor = !0,
  49104. this.autoClearDepth = !0,
  49105. this.autoClearStencil = !0,
  49106. this.sortObjects = !0,
  49107. this.gammaFactor = 2,
  49108. this.gammaInput = !1,
  49109. this.gammaOutput = !1,
  49110. this.physicallyCorrectLights = !1,
  49111. this.toneMapping = Ci.LinearToneMapping,
  49112. this.toneMappingExposure = 1,
  49113. this.toneMappingWhitePoint = 1,
  49114. this.maxMorphTargets = 8,
  49115. this.maxMorphNormals = 4,
  49116. this.autoScaleCubemaps = !0;
  49117. var X, Z = this, K = null, Q = null, J = null, $ = -1, ee = "", te = null, ie = new Ci.Vector4, ne = null, re = new Ci.Vector4, oe = 0, ae = new Ci.Color(0), se = 0, le = O.width, ce = O.height, he = 1, ue = new Ci.Vector4(0,0,le,ce), de = !1, pe = new Ci.Vector4(0,0,le,ce), fe = new Ci.Frustum, ge = new Ci.Matrix4, me = new Ci.Vector3, ve = {
  49118. hash: "",
  49119. ambient: [0, 0, 0],
  49120. directional: [],
  49121. directionalShadowMap: [],
  49122. directionalShadowMatrix: [],
  49123. spot: [],
  49124. spotShadowMap: [],
  49125. spotShadowMatrix: [],
  49126. point: [],
  49127. pointShadowMap: [],
  49128. pointShadowMatrix: [],
  49129. hemi: [],
  49130. shadows: [],
  49131. shadowsPointLight: 0
  49132. }, ye = {
  49133. geometries: 0,
  49134. textures: 0
  49135. }, Ae = {
  49136. calls: 0,
  49137. vertices: 0,
  49138. faces: 0,
  49139. points: 0
  49140. };
  49141. this.info = {
  49142. render: Ae,
  49143. memory: ye,
  49144. programs: null
  49145. };
  49146. try {
  49147. var Ce = {
  49148. alpha: D,
  49149. depth: N,
  49150. stencil: F,
  49151. antialias: B,
  49152. premultipliedAlpha: V,
  49153. preserveDrawingBuffer: k
  49154. };
  49155. if (null === (X = L || O.getContext("webgl", Ce) || O.getContext("experimental-webgl", Ce)))
  49156. throw null !== O.getContext("webgl") ? "Error creating WebGL context with your selected attributes." : "Error creating WebGL context.";
  49157. void 0 === X.getShaderPrecisionFormat && (X.getShaderPrecisionFormat = function() {
  49158. return {
  49159. rangeMin: 1,
  49160. rangeMax: 1,
  49161. precision: 1
  49162. }
  49163. }
  49164. ),
  49165. O.addEventListener("webglcontextlost", r, !1)
  49166. } catch (e) {
  49167. console.error("THREE.WebGLRenderer: " + e)
  49168. }
  49169. var Ie = new Ci.WebGLExtensions(X);
  49170. Ie.get("OES_texture_float"),
  49171. Ie.get("OES_texture_float_linear"),
  49172. Ie.get("OES_texture_half_float"),
  49173. Ie.get("OES_texture_half_float_linear"),
  49174. Ie.get("OES_standard_derivatives"),
  49175. Ie.get("ANGLE_instanced_arrays"),
  49176. Ie.get("OES_element_index_uint") && (Ci.BufferGeometry.MaxIndex = 4294967296);
  49177. var Ee = new Ci.WebGLCapabilities(X,Ie,e)
  49178. , _e = new Ci.WebGLState(X,Ie,x)
  49179. , be = new Ci.WebGLProperties
  49180. , we = new Ci.WebGLObjects(X,be,this.info)
  49181. , Te = new Ci.WebGLPrograms(this,Ee)
  49182. , xe = new Ci.WebGLLights;
  49183. this.info.programs = Te.programs;
  49184. var Se = new Ci.WebGLBufferRenderer(X,Ie,Ae)
  49185. , Me = new Ci.WebGLIndexedBufferRenderer(X,Ie,Ae);
  49186. t(),
  49187. this.context = X,
  49188. this.capabilities = Ee,
  49189. this.extensions = Ie,
  49190. this.properties = be,
  49191. this.state = _e;
  49192. var Re = new Ci.WebGLShadowMap(this,ve,we);
  49193. this.shadowMap = Re;
  49194. var Pe, Oe = new Ci.SpritePlugin(this,Y), Le = new Ci.LensFlarePlugin(this,q);
  49195. this.getContext = function() {
  49196. return X
  49197. }
  49198. ,
  49199. this.getContextAttributes = function() {
  49200. return X.getContextAttributes()
  49201. }
  49202. ,
  49203. this.forceContextLoss = function() {
  49204. Ie.get("WEBGL_lose_context").loseContext()
  49205. }
  49206. ,
  49207. this.getMaxAnisotropy = function() {
  49208. if (void 0 !== Pe)
  49209. return Pe;
  49210. var e = Ie.get("EXT_texture_filter_anisotropic");
  49211. return Pe = null !== e ? X.getParameter(e.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 0
  49212. }
  49213. ,
  49214. this.getPrecision = function() {
  49215. return Ee.precision
  49216. }
  49217. ,
  49218. this.getPixelRatio = function() {
  49219. return he
  49220. }
  49221. ,
  49222. this.setPixelRatio = function(e) {
  49223. void 0 !== e && (he = e,
  49224. this.setSize(pe.z, pe.w, !1))
  49225. }
  49226. ,
  49227. this.getSize = function() {
  49228. return {
  49229. width: le,
  49230. height: ce
  49231. }
  49232. }
  49233. ,
  49234. this.setSize = function(e, t, i, n) {
  49235. null != n && (he = n),
  49236. le = e,
  49237. ce = t,
  49238. O.width = e * he,
  49239. O.height = t * he,
  49240. !1 !== i && (O.style.width = e + "px",
  49241. O.style.height = t + "px"),
  49242. this.setViewport(0, 0, e, t)
  49243. }
  49244. ,
  49245. this.setViewport = function(e, t, i, n) {
  49246. _e.viewport(pe.set(e, t, i, n))
  49247. }
  49248. ,
  49249. this.setScissor = function(e, t, i, n) {
  49250. _e.scissor(ue.set(e, t, i, n))
  49251. }
  49252. ,
  49253. this.setScissorTest = function(e) {
  49254. _e.setScissorTest(de = e)
  49255. }
  49256. ,
  49257. this.getClearColor = function() {
  49258. return ae
  49259. }
  49260. ,
  49261. this.setClearColor = function(e, t) {
  49262. ae.set(e),
  49263. se = void 0 !== t ? t : 1,
  49264. i(ae.r, ae.g, ae.b, se)
  49265. }
  49266. ,
  49267. this.getClearAlpha = function() {
  49268. return se
  49269. }
  49270. ,
  49271. this.setClearAlpha = function(e) {
  49272. se = e,
  49273. i(ae.r, ae.g, ae.b, se)
  49274. }
  49275. ,
  49276. this.clear = function(e, t, i) {
  49277. var n = 0;
  49278. void 0 !== e && !e || (n |= X.COLOR_BUFFER_BIT),
  49279. void 0 !== t && !t || (n |= X.DEPTH_BUFFER_BIT),
  49280. void 0 !== i && !i || (n |= X.STENCIL_BUFFER_BIT),
  49281. X.clear(n)
  49282. }
  49283. ,
  49284. this.clearColor = function() {
  49285. this.clear(!0, !1, !1)
  49286. }
  49287. ,
  49288. this.clearDepth = function() {
  49289. this.clear(!1, !0, !1)
  49290. }
  49291. ,
  49292. this.clearStencil = function() {
  49293. this.clear(!1, !1, !0)
  49294. }
  49295. ,
  49296. this.clearTarget = function(e, t, i, n) {
  49297. this.setRenderTarget(e),
  49298. this.clear(t, i, n)
  49299. }
  49300. ,
  49301. this.resetGLState = n,
  49302. this.dispose = function() {
  49303. O.removeEventListener("webglcontextlost", r, !1)
  49304. }
  49305. ,
  49306. this.renderBufferImmediate = function(e, t, i) {
  49307. _e.initAttributes();
  49308. var n = be.get(e);
  49309. e.hasPositions && !n.position && (n.position = X.createBuffer()),
  49310. e.hasNormals && !n.normal && (n.normal = X.createBuffer()),
  49311. e.hasUvs && !n.uv && (n.uv = X.createBuffer()),
  49312. e.hasColors && !n.color && (n.color = X.createBuffer());
  49313. var r = t.getAttributes();
  49314. if (e.hasPositions && (X.bindBuffer(X.ARRAY_BUFFER, n.position),
  49315. X.bufferData(X.ARRAY_BUFFER, e.positionArray, X.DYNAMIC_DRAW),
  49316. _e.enableAttribute(r.position),
  49317. X.vertexAttribPointer(r.position, 3, X.FLOAT, !1, 0, 0)),
  49318. e.hasNormals) {
  49319. if (X.bindBuffer(X.ARRAY_BUFFER, n.normal),
  49320. "MeshPhongMaterial" !== i.type && "MeshStandardMaterial" !== i.type && i.shading === Ci.FlatShading)
  49321. for (var o = 0, a = 3 * e.count; o < a; o += 9) {
  49322. var s = e.normalArray
  49323. , l = (s[o + 0] + s[o + 3] + s[o + 6]) / 3
  49324. , c = (s[o + 1] + s[o + 4] + s[o + 7]) / 3
  49325. , h = (s[o + 2] + s[o + 5] + s[o + 8]) / 3;
  49326. s[o + 0] = l,
  49327. s[o + 1] = c,
  49328. s[o + 2] = h,
  49329. s[o + 3] = l,
  49330. s[o + 4] = c,
  49331. s[o + 5] = h,
  49332. s[o + 6] = l,
  49333. s[o + 7] = c,
  49334. s[o + 8] = h
  49335. }
  49336. X.bufferData(X.ARRAY_BUFFER, e.normalArray, X.DYNAMIC_DRAW),
  49337. _e.enableAttribute(r.normal),
  49338. X.vertexAttribPointer(r.normal, 3, X.FLOAT, !1, 0, 0)
  49339. }
  49340. e.hasUvs && i.map && (X.bindBuffer(X.ARRAY_BUFFER, n.uv),
  49341. X.bufferData(X.ARRAY_BUFFER, e.uvArray, X.DYNAMIC_DRAW),
  49342. _e.enableAttribute(r.uv),
  49343. X.vertexAttribPointer(r.uv, 2, X.FLOAT, !1, 0, 0)),
  49344. e.hasColors && i.vertexColors !== Ci.NoColors && (X.bindBuffer(X.ARRAY_BUFFER, n.color),
  49345. X.bufferData(X.ARRAY_BUFFER, e.colorArray, X.DYNAMIC_DRAW),
  49346. _e.enableAttribute(r.color),
  49347. X.vertexAttribPointer(r.color, 3, X.FLOAT, !1, 0, 0)),
  49348. _e.disableUnusedAttributes(),
  49349. X.drawArrays(X.TRIANGLES, 0, e.count),
  49350. e.count = 0
  49351. }
  49352. ,
  49353. this.renderBufferDirect = function(e, t, i, n, r, o) {
  49354. R(n);
  49355. var a = P(e, t, n, r)
  49356. , s = !1
  49357. , l = i.id + "_" + a.id + "_" + n.wireframe;
  49358. l !== ee && (ee = l,
  49359. s = !0);
  49360. var c = r.morphTargetInfluences;
  49361. if (void 0 !== c) {
  49362. for (var h = [], u = 0, d = c.length; u < d; u++) {
  49363. var p = c[u];
  49364. h.push([p, u])
  49365. }
  49366. h.sort(M),
  49367. 8 < h.length && (h.length = 8);
  49368. var f = i.morphAttributes;
  49369. for (u = 0,
  49370. d = h.length; u < d; u++) {
  49371. p = h[u];
  49372. if (j[u] = p[0],
  49373. 0 !== p[0]) {
  49374. var g = p[1];
  49375. !0 === n.morphTargets && f.position && i.addAttribute("morphTarget" + u, f.position[g]),
  49376. !0 === n.morphNormals && f.normal && i.addAttribute("morphNormal" + u, f.normal[g])
  49377. } else
  49378. !0 === n.morphTargets && i.removeAttribute("morphTarget" + u),
  49379. !0 === n.morphNormals && i.removeAttribute("morphNormal" + u)
  49380. }
  49381. var m = a.getUniforms();
  49382. null !== m.morphTargetInfluences && X.uniform1fv(m.morphTargetInfluences, j),
  49383. s = !0
  49384. }
  49385. g = i.index;
  49386. var v, y = i.attributes.position;
  49387. !0 === n.wireframe && (g = we.getWireframeAttribute(i)),
  49388. null !== g ? (v = Me).setIndex(g) : v = Se,
  49389. s && (function(e, t, i, n) {
  49390. var r;
  49391. if (i instanceof Ci.InstancedBufferGeometry && null === (r = Ie.get("ANGLE_instanced_arrays")))
  49392. console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
  49393. else {
  49394. void 0 === n && (n = 0),
  49395. _e.initAttributes();
  49396. var o = i.attributes
  49397. , a = t.getAttributes()
  49398. , s = e.defaultAttributeValues;
  49399. for (var l in a) {
  49400. var c = a[l];
  49401. if (0 <= c) {
  49402. var h = o[l];
  49403. if (void 0 !== h) {
  49404. var u = h.itemSize
  49405. , d = we.getAttributeBuffer(h);
  49406. if (h instanceof Ci.InterleavedBufferAttribute) {
  49407. var p = h.data
  49408. , f = p.stride
  49409. , g = h.offset;
  49410. p instanceof Ci.InstancedInterleavedBuffer ? (_e.enableAttributeAndDivisor(c, p.meshPerAttribute, r),
  49411. void 0 === i.maxInstancedCount && (i.maxInstancedCount = p.meshPerAttribute * p.count)) : _e.enableAttribute(c),
  49412. X.bindBuffer(X.ARRAY_BUFFER, d),
  49413. X.vertexAttribPointer(c, u, X.FLOAT, !1, f * p.array.BYTES_PER_ELEMENT, (n * f + g) * p.array.BYTES_PER_ELEMENT)
  49414. } else
  49415. h instanceof Ci.InstancedBufferAttribute ? (_e.enableAttributeAndDivisor(c, h.meshPerAttribute, r),
  49416. void 0 === i.maxInstancedCount && (i.maxInstancedCount = h.meshPerAttribute * h.count)) : _e.enableAttribute(c),
  49417. X.bindBuffer(X.ARRAY_BUFFER, d),
  49418. X.vertexAttribPointer(c, u, X.FLOAT, !1, 0, n * u * 4)
  49419. } else if (void 0 !== s) {
  49420. var m = s[l];
  49421. if (void 0 !== m)
  49422. switch (m.length) {
  49423. case 2:
  49424. X.vertexAttrib2fv(c, m);
  49425. break;
  49426. case 3:
  49427. X.vertexAttrib3fv(c, m);
  49428. break;
  49429. case 4:
  49430. X.vertexAttrib4fv(c, m);
  49431. break;
  49432. default:
  49433. X.vertexAttrib1fv(c, m)
  49434. }
  49435. }
  49436. }
  49437. }
  49438. _e.disableUnusedAttributes()
  49439. }
  49440. }(n, a, i),
  49441. null !== g && X.bindBuffer(X.ELEMENT_ARRAY_BUFFER, we.getAttributeBuffer(g)));
  49442. var A = 1 / 0;
  49443. null !== g ? A = g.count : void 0 !== y && (A = y.count);
  49444. var C = i.drawRange.start
  49445. , I = i.drawRange.count
  49446. , E = null !== o ? o.start : 0
  49447. , _ = null !== o ? o.count : 1 / 0
  49448. , b = Math.max(0, C, E)
  49449. , w = Math.min(0 + A, C + I, E + _) - 1
  49450. , T = Math.max(0, w - b + 1);
  49451. if (r instanceof Ci.Mesh)
  49452. if (!0 === n.wireframe)
  49453. _e.setLineWidth(n.wireframeLinewidth * S()),
  49454. v.setMode(X.LINES);
  49455. else
  49456. switch (r.drawMode) {
  49457. case Ci.TrianglesDrawMode:
  49458. v.setMode(X.TRIANGLES);
  49459. break;
  49460. case Ci.TriangleStripDrawMode:
  49461. v.setMode(X.TRIANGLE_STRIP);
  49462. break;
  49463. case Ci.TriangleFanDrawMode:
  49464. v.setMode(X.TRIANGLE_FAN)
  49465. }
  49466. else if (r instanceof Ci.Line) {
  49467. var x = n.linewidth;
  49468. void 0 === x && (x = 1),
  49469. _e.setLineWidth(x * S()),
  49470. r instanceof Ci.LineSegments ? v.setMode(X.LINES) : v.setMode(X.LINE_STRIP)
  49471. } else
  49472. r instanceof Ci.Points && v.setMode(X.POINTS);
  49473. i instanceof Ci.InstancedBufferGeometry ? 0 < i.maxInstancedCount && v.renderInstances(i, b, T) : v.render(b, T)
  49474. }
  49475. ,
  49476. this.render = function(e, t, i, n) {
  49477. if (t instanceof Ci.Camera != 0) {
  49478. var r = e.fog;
  49479. if (ee = "",
  49480. $ = -1,
  49481. !(te = null) === e.autoUpdate && e.updateMatrixWorld(),
  49482. null === t.parent && t.updateMatrixWorld(),
  49483. t.matrixWorldInverse.getInverse(t.matrixWorld),
  49484. ge.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse),
  49485. fe.setFromMatrix(ge),
  49486. U.length = 0,
  49487. W = z = -1,
  49488. Y.length = 0,
  49489. q.length = 0,
  49490. function e(t, i) {
  49491. if (!1 !== t.visible) {
  49492. if (t.layers.test(i.layers))
  49493. if (t instanceof Ci.Light)
  49494. U.push(t);
  49495. else if (t instanceof Ci.Sprite)
  49496. !1 !== t.frustumCulled && !0 !== fe.intersectsObject(t) || Y.push(t);
  49497. else if (t instanceof Ci.LensFlare)
  49498. q.push(t);
  49499. else if (t instanceof Ci.ImmediateRenderObject)
  49500. !0 === Z.sortObjects && (me.setFromMatrixPosition(t.matrixWorld),
  49501. me.applyProjection(ge)),
  49502. d(t, null, t.material, me.z, null);
  49503. else if ((t instanceof Ci.Mesh || t instanceof Ci.Line || t instanceof Ci.Points) && (t instanceof Ci.SkinnedMesh && t.skeleton.update(),
  49504. !1 === t.frustumCulled || !0 === fe.intersectsObject(t))) {
  49505. var n = t.material;
  49506. if (!0 === n.visible) {
  49507. !0 === Z.sortObjects && (me.setFromMatrixPosition(t.matrixWorld),
  49508. me.applyProjection(ge));
  49509. var r = we.update(t);
  49510. if (n instanceof Ci.MultiMaterial)
  49511. for (var o = r.groups, a = n.materials, s = 0, l = o.length; s < l; s++) {
  49512. var c = o[s]
  49513. , h = a[c.materialIndex];
  49514. !0 === h.visible && d(t, r, h, me.z, c)
  49515. }
  49516. else
  49517. d(t, r, n, me.z, null)
  49518. }
  49519. }
  49520. var u = t.children;
  49521. for (s = 0,
  49522. l = u.length; s < l; s++)
  49523. e(u[s], i)
  49524. }
  49525. }(e, t),
  49526. H.length = z + 1,
  49527. G.length = W + 1,
  49528. !0 === Z.sortObjects && (H.sort(s),
  49529. G.sort(l)),
  49530. function(e, t) {
  49531. var i, n, r, o, a, s, l = 0, c = 0, h = 0, u = t.matrixWorldInverse, d = 0, p = 0, f = 0, g = 0, m = 0;
  49532. for (i = ve.shadowsPointLight = 0,
  49533. n = e.length; i < n; i++)
  49534. if (o = (r = e[i]).color,
  49535. a = r.intensity,
  49536. s = r.distance,
  49537. r instanceof Ci.AmbientLight)
  49538. l += o.r * a,
  49539. c += o.g * a,
  49540. h += o.b * a;
  49541. else if (r instanceof Ci.DirectionalLight) {
  49542. (v = xe.get(r)).color.copy(r.color).multiplyScalar(r.intensity),
  49543. v.direction.setFromMatrixPosition(r.matrixWorld),
  49544. me.setFromMatrixPosition(r.target.matrixWorld),
  49545. v.direction.sub(me),
  49546. v.direction.transformDirection(u),
  49547. v.shadow = r.castShadow,
  49548. r.castShadow && (v.shadowBias = r.shadow.bias,
  49549. v.shadowRadius = r.shadow.radius,
  49550. v.shadowMapSize = r.shadow.mapSize,
  49551. ve.shadows[m++] = r),
  49552. ve.directionalShadowMap[d] = r.shadow.map,
  49553. ve.directionalShadowMatrix[d] = r.shadow.matrix,
  49554. ve.directional[d++] = v
  49555. } else if (r instanceof Ci.SpotLight) {
  49556. (v = xe.get(r)).position.setFromMatrixPosition(r.matrixWorld),
  49557. v.position.applyMatrix4(u),
  49558. v.color.copy(o).multiplyScalar(a),
  49559. v.distance = s,
  49560. v.direction.setFromMatrixPosition(r.matrixWorld),
  49561. me.setFromMatrixPosition(r.target.matrixWorld),
  49562. v.direction.sub(me),
  49563. v.direction.transformDirection(u),
  49564. v.coneCos = Math.cos(r.angle),
  49565. v.penumbraCos = Math.cos(r.angle * (1 - r.penumbra)),
  49566. v.decay = 0 === r.distance ? 0 : r.decay,
  49567. v.shadow = r.castShadow,
  49568. r.castShadow && (v.shadowBias = r.shadow.bias,
  49569. v.shadowRadius = r.shadow.radius,
  49570. v.shadowMapSize = r.shadow.mapSize,
  49571. ve.shadows[m++] = r),
  49572. ve.spotShadowMap[f] = r.shadow.map,
  49573. ve.spotShadowMatrix[f] = r.shadow.matrix,
  49574. ve.spot[f++] = v
  49575. } else if (r instanceof Ci.PointLight) {
  49576. (v = xe.get(r)).position.setFromMatrixPosition(r.matrixWorld),
  49577. v.position.applyMatrix4(u),
  49578. v.color.copy(r.color).multiplyScalar(r.intensity),
  49579. v.distance = r.distance,
  49580. v.decay = 0 === r.distance ? 0 : r.decay,
  49581. v.shadow = r.castShadow,
  49582. r.castShadow && (v.shadowBias = r.shadow.bias,
  49583. v.shadowRadius = r.shadow.radius,
  49584. v.shadowMapSize = r.shadow.mapSize,
  49585. ve.shadows[m++] = r),
  49586. ve.pointShadowMap[p] = r.shadow.map,
  49587. void 0 === ve.pointShadowMatrix[p] && (ve.pointShadowMatrix[p] = new Ci.Matrix4),
  49588. me.setFromMatrixPosition(r.matrixWorld).negate(),
  49589. ve.pointShadowMatrix[p].identity().setPosition(me),
  49590. ve.point[p++] = v
  49591. } else if (r instanceof Ci.HemisphereLight) {
  49592. var v;
  49593. (v = xe.get(r)).direction.setFromMatrixPosition(r.matrixWorld),
  49594. v.direction.transformDirection(u),
  49595. v.direction.normalize(),
  49596. v.skyColor.copy(r.color).multiplyScalar(a),
  49597. v.groundColor.copy(r.groundColor).multiplyScalar(a),
  49598. ve.hemi[g++] = v
  49599. }
  49600. ve.ambient[0] = l,
  49601. ve.ambient[1] = c,
  49602. ve.ambient[2] = h,
  49603. ve.directional.length = d,
  49604. ve.spot.length = f,
  49605. ve.point.length = p,
  49606. ve.hemi.length = g,
  49607. ve.shadows.length = m,
  49608. ve.hash = d + "," + p + "," + f + "," + g + "," + m
  49609. }(U, t),
  49610. Re.render(e, t),
  49611. Ae.calls = 0,
  49612. Ae.vertices = 0,
  49613. Ae.faces = 0,
  49614. void (Ae.points = 0) === i && (i = null),
  49615. this.setRenderTarget(i),
  49616. (this.autoClear || n) && this.clear(this.autoClearColor, this.autoClearDepth, this.autoClearStencil),
  49617. e.overrideMaterial) {
  49618. var o = e.overrideMaterial;
  49619. c(H, t, r, o),
  49620. c(G, t, r, o)
  49621. } else
  49622. _e.setBlending(Ci.NoBlending),
  49623. c(H, t, r),
  49624. c(G, t, r);
  49625. if (Oe.render(e, t),
  49626. Le.render(e, t, re),
  49627. i) {
  49628. var a = i.texture;
  49629. a.generateMipmaps && E(i) && a.minFilter !== Ci.NearestFilter && a.minFilter !== Ci.LinearFilter && function(e) {
  49630. var t = e instanceof Ci.WebGLRenderTargetCube ? X.TEXTURE_CUBE_MAP : X.TEXTURE_2D
  49631. , i = be.get(e.texture).__webglTexture;
  49632. _e.bindTexture(t, i),
  49633. X.generateMipmap(t),
  49634. _e.bindTexture(t, null)
  49635. }(i)
  49636. }
  49637. _e.setDepthTest(!0),
  49638. _e.setDepthWrite(!0),
  49639. _e.setColorWrite(!0)
  49640. } else
  49641. console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")
  49642. }
  49643. ,
  49644. this.setFaceCulling = function(e, t) {
  49645. e === Ci.CullFaceNone ? _e.disable(X.CULL_FACE) : (t === Ci.FrontFaceDirectionCW ? X.frontFace(X.CW) : X.frontFace(X.CCW),
  49646. e === Ci.CullFaceBack ? X.cullFace(X.BACK) : e === Ci.CullFaceFront ? X.cullFace(X.FRONT) : X.cullFace(X.FRONT_AND_BACK),
  49647. _e.enable(X.CULL_FACE))
  49648. }
  49649. ,
  49650. this.setTexture = function(e, t) {
  49651. var i = be.get(e);
  49652. if (0 < e.version && i.__version !== e.version) {
  49653. var n = e.image;
  49654. return void 0 === n ? void console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined", e) : !1 === n.complete ? void console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete", e) : void o(i, e, t)
  49655. }
  49656. _e.activeTexture(X.TEXTURE0 + t),
  49657. _e.bindTexture(X.TEXTURE_2D, i.__webglTexture)
  49658. }
  49659. ,
  49660. this.getCurrentRenderTarget = function() {
  49661. return Q
  49662. }
  49663. ,
  49664. this.setRenderTarget = function(e) {
  49665. (Q = e) && void 0 === be.get(e).__webglFramebuffer && w(e);
  49666. var t, i = e instanceof Ci.WebGLRenderTargetCube;
  49667. if (e) {
  49668. var n = be.get(e);
  49669. t = i ? n.__webglFramebuffer[e.activeCubeFace] : n.__webglFramebuffer,
  49670. ie.copy(e.scissor),
  49671. ne = e.scissorTest,
  49672. re.copy(e.viewport)
  49673. } else
  49674. t = null,
  49675. ie.copy(ue).multiplyScalar(he),
  49676. ne = de,
  49677. re.copy(pe).multiplyScalar(he);
  49678. if (J !== t && (X.bindFramebuffer(X.FRAMEBUFFER, t),
  49679. J = t),
  49680. _e.scissor(ie),
  49681. _e.setScissorTest(ne),
  49682. _e.viewport(re),
  49683. i) {
  49684. var r = be.get(e.texture);
  49685. X.framebufferTexture2D(X.FRAMEBUFFER, X.COLOR_ATTACHMENT0, X.TEXTURE_CUBE_MAP_POSITIVE_X + e.activeCubeFace, r.__webglTexture, e.activeMipMapLevel)
  49686. }
  49687. }
  49688. ,
  49689. this.readRenderTargetPixels = function(e, t, i, n, r, o) {
  49690. if (e instanceof Ci.WebGLRenderTarget != 0) {
  49691. var a = be.get(e).__webglFramebuffer;
  49692. if (a) {
  49693. var s = !1;
  49694. a !== J && (X.bindFramebuffer(X.FRAMEBUFFER, a),
  49695. s = !0);
  49696. try {
  49697. var l = e.texture;
  49698. if (l.format !== Ci.RGBAFormat && x(l.format) !== X.getParameter(X.IMPLEMENTATION_COLOR_READ_FORMAT))
  49699. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");
  49700. if (!(l.type === Ci.UnsignedByteType || x(l.type) === X.getParameter(X.IMPLEMENTATION_COLOR_READ_TYPE) || l.type === Ci.FloatType && Ie.get("WEBGL_color_buffer_float") || l.type === Ci.HalfFloatType && Ie.get("EXT_color_buffer_half_float")))
  49701. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");
  49702. X.checkFramebufferStatus(X.FRAMEBUFFER) === X.FRAMEBUFFER_COMPLETE ? X.readPixels(t, i, n, r, x(l.format), x(l.type), o) : console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")
  49703. } finally {
  49704. s && X.bindFramebuffer(X.FRAMEBUFFER, J)
  49705. }
  49706. }
  49707. } else
  49708. console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")
  49709. }
  49710. }
  49711. ,
  49712. Ci.WebGLRenderTarget = function(e, t, i) {
  49713. this.uuid = Ci.Math.generateUUID(),
  49714. this.width = e,
  49715. this.height = t,
  49716. this.scissor = new Ci.Vector4(0,0,e,t),
  49717. this.scissorTest = !1,
  49718. this.viewport = new Ci.Vector4(0,0,e,t),
  49719. void 0 === (i = i || {}).minFilter && (i.minFilter = Ci.LinearFilter),
  49720. this.texture = new Ci.Texture(void 0,void 0,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy),
  49721. this.depthBuffer = void 0 === i.depthBuffer || i.depthBuffer,
  49722. this.stencilBuffer = void 0 === i.stencilBuffer || i.stencilBuffer
  49723. }
  49724. ,
  49725. Ci.WebGLRenderTarget.prototype = {
  49726. constructor: Ci.WebGLRenderTarget,
  49727. setSize: function(e, t) {
  49728. this.width === e && this.height === t || (this.width = e,
  49729. this.height = t,
  49730. this.dispose()),
  49731. this.viewport.set(0, 0, e, t),
  49732. this.scissor.set(0, 0, e, t)
  49733. },
  49734. clone: function() {
  49735. return (new this.constructor).copy(this)
  49736. },
  49737. copy: function(e) {
  49738. return this.width = e.width,
  49739. this.height = e.height,
  49740. this.viewport.copy(e.viewport),
  49741. this.texture = e.texture.clone(),
  49742. this.depthBuffer = e.depthBuffer,
  49743. this.stencilBuffer = e.stencilBuffer,
  49744. this
  49745. },
  49746. dispose: function() {
  49747. this.dispatchEvent({
  49748. type: "dispose"
  49749. })
  49750. }
  49751. },
  49752. Ci.EventDispatcher.prototype.apply(Ci.WebGLRenderTarget.prototype),
  49753. Ci.WebGLRenderTargetCube = function(e, t, i) {
  49754. Ci.WebGLRenderTarget.call(this, e, t, i),
  49755. this.activeCubeFace = 0,
  49756. this.activeMipMapLevel = 0
  49757. }
  49758. ,
  49759. Ci.WebGLRenderTargetCube.prototype = Object.create(Ci.WebGLRenderTarget.prototype),
  49760. Ci.WebGLRenderTargetCube.prototype.constructor = Ci.WebGLRenderTargetCube,
  49761. Ci.WebGLBufferRenderer = function(r, o, a) {
  49762. var s;
  49763. this.setMode = function(e) {
  49764. s = e
  49765. }
  49766. ,
  49767. this.render = function(e, t) {
  49768. r.drawArrays(s, e, t),
  49769. a.calls++,
  49770. a.vertices += t,
  49771. s === r.TRIANGLES && (a.faces += t / 3)
  49772. }
  49773. ,
  49774. this.renderInstances = function(e) {
  49775. var t = o.get("ANGLE_instanced_arrays");
  49776. if (null !== t) {
  49777. var i = e.attributes.position
  49778. , n = 0;
  49779. n = i instanceof Ci.InterleavedBufferAttribute ? i.data.count : i.count,
  49780. t.drawArraysInstancedANGLE(s, 0, n, e.maxInstancedCount),
  49781. a.calls++,
  49782. a.vertices += n * e.maxInstancedCount,
  49783. s === r.TRIANGLES && (a.faces += e.maxInstancedCount * n / 3)
  49784. } else
  49785. console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.")
  49786. }
  49787. }
  49788. ,
  49789. Ci.WebGLIndexedBufferRenderer = function(r, o, a) {
  49790. var s, l, c;
  49791. this.setMode = function(e) {
  49792. s = e
  49793. }
  49794. ,
  49795. this.setIndex = function(e) {
  49796. c = e.array instanceof Uint32Array && o.get("OES_element_index_uint") ? (l = r.UNSIGNED_INT,
  49797. 4) : (l = r.UNSIGNED_SHORT,
  49798. 2)
  49799. }
  49800. ,
  49801. this.render = function(e, t) {
  49802. r.drawElements(s, t, l, e * c),
  49803. a.calls++,
  49804. a.vertices += t,
  49805. s === r.TRIANGLES && (a.faces += t / 3)
  49806. }
  49807. ,
  49808. this.renderInstances = function(e, t, i) {
  49809. var n = o.get("ANGLE_instanced_arrays");
  49810. return null === n ? void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.") : (n.drawElementsInstancedANGLE(s, i, l, t * c, e.maxInstancedCount),
  49811. a.calls++,
  49812. a.vertices += i * e.maxInstancedCount,
  49813. void (s === r.TRIANGLES && (a.faces += e.maxInstancedCount * i / 3)))
  49814. }
  49815. }
  49816. ,
  49817. Ci.WebGLExtensions = function(i) {
  49818. var n = {};
  49819. this.get = function(e) {
  49820. if (void 0 !== n[e])
  49821. return n[e];
  49822. var t;
  49823. switch (e) {
  49824. case "EXT_texture_filter_anisotropic":
  49825. t = i.getExtension("EXT_texture_filter_anisotropic") || i.getExtension("MOZ_EXT_texture_filter_anisotropic") || i.getExtension("WEBKIT_EXT_texture_filter_anisotropic");
  49826. break;
  49827. case "WEBGL_compressed_texture_s3tc":
  49828. t = i.getExtension("WEBGL_compressed_texture_s3tc") || i.getExtension("MOZ_WEBGL_compressed_texture_s3tc") || i.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");
  49829. break;
  49830. case "WEBGL_compressed_texture_pvrtc":
  49831. t = i.getExtension("WEBGL_compressed_texture_pvrtc") || i.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");
  49832. break;
  49833. case "WEBGL_compressed_texture_etc1":
  49834. t = i.getExtension("WEBGL_compressed_texture_etc1");
  49835. break;
  49836. default:
  49837. t = i.getExtension(e)
  49838. }
  49839. return null === t && console.warn("THREE.WebGLRenderer: " + e + " extension not supported."),
  49840. n[e] = t
  49841. }
  49842. }
  49843. ,
  49844. Ci.WebGLCapabilities = function(t, e, i) {
  49845. function n(e) {
  49846. if ("highp" === e) {
  49847. if (0 < t.getShaderPrecisionFormat(t.VERTEX_SHADER, t.HIGH_FLOAT).precision && 0 < t.getShaderPrecisionFormat(t.FRAGMENT_SHADER, t.HIGH_FLOAT).precision)
  49848. return "highp";
  49849. e = "mediump"
  49850. }
  49851. return "mediump" === e && 0 < t.getShaderPrecisionFormat(t.VERTEX_SHADER, t.MEDIUM_FLOAT).precision && 0 < t.getShaderPrecisionFormat(t.FRAGMENT_SHADER, t.MEDIUM_FLOAT).precision ? "mediump" : "lowp"
  49852. }
  49853. this.getMaxPrecision = n,
  49854. this.precision = void 0 !== i.precision ? i.precision : "highp",
  49855. this.logarithmicDepthBuffer = void 0 !== i.logarithmicDepthBuffer && i.logarithmicDepthBuffer,
  49856. this.maxTextures = t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),
  49857. this.maxVertexTextures = t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),
  49858. this.maxTextureSize = t.getParameter(t.MAX_TEXTURE_SIZE),
  49859. this.maxCubemapSize = t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),
  49860. this.maxAttributes = t.getParameter(t.MAX_VERTEX_ATTRIBS),
  49861. this.maxVertexUniforms = t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),
  49862. this.maxVaryings = t.getParameter(t.MAX_VARYING_VECTORS),
  49863. this.maxFragmentUniforms = t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),
  49864. this.vertexTextures = 0 < this.maxVertexTextures,
  49865. this.floatFragmentTextures = !!e.get("OES_texture_float"),
  49866. this.floatVertexTextures = this.vertexTextures && this.floatFragmentTextures;
  49867. var r = n(this.precision);
  49868. r !== this.precision && (console.warn("THREE.WebGLRenderer:", this.precision, "not supported, using", r, "instead."),
  49869. this.precision = r),
  49870. this.logarithmicDepthBuffer && (this.logarithmicDepthBuffer = !!e.get("EXT_frag_depth"))
  49871. }
  49872. ,
  49873. Ci.WebGLGeometries = function(i, o, a) {
  49874. function s(e) {
  49875. var t = e.target
  49876. , i = c[t.id];
  49877. null !== i.index && l(i.index),
  49878. function(e) {
  49879. for (var t in e)
  49880. l(e[t])
  49881. }(i.attributes),
  49882. t.removeEventListener("dispose", s),
  49883. delete c[t.id];
  49884. var n = o.get(t);
  49885. n.wireframe && l(n.wireframe),
  49886. o.delete(t);
  49887. var r = o.get(i);
  49888. r.wireframe && l(r.wireframe),
  49889. o.delete(i),
  49890. a.memory.geometries--
  49891. }
  49892. function l(e) {
  49893. var t = function(e) {
  49894. return e instanceof Ci.InterleavedBufferAttribute ? o.get(e.data).__webglBuffer : o.get(e).__webglBuffer
  49895. }(e);
  49896. void 0 !== t && (i.deleteBuffer(t),
  49897. function(e) {
  49898. e instanceof Ci.InterleavedBufferAttribute ? o.delete(e.data) : o.delete(e)
  49899. }(e))
  49900. }
  49901. var c = {};
  49902. this.get = function(e) {
  49903. var t, i = e.geometry;
  49904. return void 0 !== c[i.id] ? c[i.id] : (i.addEventListener("dispose", s),
  49905. i instanceof Ci.BufferGeometry ? t = i : i instanceof Ci.Geometry && (void 0 === i._bufferGeometry && (i._bufferGeometry = (new Ci.BufferGeometry).setFromObject(e)),
  49906. t = i._bufferGeometry),
  49907. c[i.id] = t,
  49908. a.memory.geometries++,
  49909. t)
  49910. }
  49911. }
  49912. ,
  49913. Ci.WebGLLights = function() {
  49914. var i = {};
  49915. this.get = function(e) {
  49916. if (void 0 !== i[e.id])
  49917. return i[e.id];
  49918. var t;
  49919. switch (e.type) {
  49920. case "DirectionalLight":
  49921. t = {
  49922. direction: new Ci.Vector3,
  49923. color: new Ci.Color,
  49924. shadow: !1,
  49925. shadowBias: 0,
  49926. shadowRadius: 1,
  49927. shadowMapSize: new Ci.Vector2
  49928. };
  49929. break;
  49930. case "SpotLight":
  49931. t = {
  49932. position: new Ci.Vector3,
  49933. direction: new Ci.Vector3,
  49934. color: new Ci.Color,
  49935. distance: 0,
  49936. coneCos: 0,
  49937. penumbraCos: 0,
  49938. decay: 0,
  49939. shadow: !1,
  49940. shadowBias: 0,
  49941. shadowRadius: 1,
  49942. shadowMapSize: new Ci.Vector2
  49943. };
  49944. break;
  49945. case "PointLight":
  49946. t = {
  49947. position: new Ci.Vector3,
  49948. color: new Ci.Color,
  49949. distance: 0,
  49950. decay: 0,
  49951. shadow: !1,
  49952. shadowBias: 0,
  49953. shadowRadius: 1,
  49954. shadowMapSize: new Ci.Vector2
  49955. };
  49956. break;
  49957. case "HemisphereLight":
  49958. t = {
  49959. direction: new Ci.Vector3,
  49960. skyColor: new Ci.Color,
  49961. groundColor: new Ci.Color
  49962. }
  49963. }
  49964. return i[e.id] = t
  49965. }
  49966. }
  49967. ,
  49968. Ci.WebGLObjects = function(g, m, e) {
  49969. function v(e, t) {
  49970. var i = e instanceof Ci.InterleavedBufferAttribute ? e.data : e
  49971. , n = m.get(i);
  49972. void 0 === n.__webglBuffer ? function(e, t, i) {
  49973. e.__webglBuffer = g.createBuffer(),
  49974. g.bindBuffer(i, e.__webglBuffer);
  49975. var n = t.dynamic ? g.DYNAMIC_DRAW : g.STATIC_DRAW;
  49976. g.bufferData(i, t.array, n),
  49977. e.version = t.version
  49978. }(n, i, t) : n.version !== i.version && function(e, t, i) {
  49979. g.bindBuffer(i, e.__webglBuffer),
  49980. !1 === t.dynamic || -1 === t.updateRange.count ? g.bufferSubData(i, 0, t.array) : 0 === t.updateRange.count ? console.error("THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually.") : (g.bufferSubData(i, t.updateRange.offset * t.array.BYTES_PER_ELEMENT, t.array.subarray(t.updateRange.offset, t.updateRange.offset + t.updateRange.count)),
  49981. t.updateRange.count = 0),
  49982. e.version = t.version
  49983. }(n, i, t)
  49984. }
  49985. function y(e, t, i) {
  49986. if (i < t) {
  49987. var n = t;
  49988. t = i,
  49989. i = n
  49990. }
  49991. var r = e[t];
  49992. return void 0 === r ? (e[t] = [i],
  49993. !0) : -1 === r.indexOf(i) && (r.push(i),
  49994. !0)
  49995. }
  49996. var c = new Ci.WebGLGeometries(g,m,e);
  49997. this.getAttributeBuffer = function(e) {
  49998. return e instanceof Ci.InterleavedBufferAttribute ? m.get(e.data).__webglBuffer : m.get(e).__webglBuffer
  49999. }
  50000. ,
  50001. this.getWireframeAttribute = function(e) {
  50002. var t = m.get(e);
  50003. if (void 0 !== t.wireframe)
  50004. return t.wireframe;
  50005. var i, n = [], r = e.index, o = e.attributes, a = o.position;
  50006. if (null !== r)
  50007. for (var s = {}, l = 0, c = (i = r.array).length; l < c; l += 3) {
  50008. var h = i[l + 0]
  50009. , u = i[l + 1]
  50010. , d = i[l + 2];
  50011. y(s, h, u) && n.push(h, u),
  50012. y(s, u, d) && n.push(u, d),
  50013. y(s, d, h) && n.push(d, h)
  50014. }
  50015. else
  50016. for (l = 0,
  50017. c = (i = o.position.array).length / 3 - 1; l < c; l += 3) {
  50018. h = l + 0,
  50019. u = l + 1,
  50020. d = l + 2;
  50021. n.push(h, u, u, d, d, h)
  50022. }
  50023. var p = 65535 < a.count ? Uint32Array : Uint16Array
  50024. , f = new Ci.BufferAttribute(new p(n),1);
  50025. return v(f, g.ELEMENT_ARRAY_BUFFER),
  50026. t.wireframe = f
  50027. }
  50028. ,
  50029. this.update = function(e) {
  50030. var t = c.get(e);
  50031. e.geometry instanceof Ci.Geometry && t.updateFromObject(e);
  50032. var i = t.index
  50033. , n = t.attributes;
  50034. for (var r in null !== i && v(i, g.ELEMENT_ARRAY_BUFFER),
  50035. n)
  50036. v(n[r], g.ARRAY_BUFFER);
  50037. var o = t.morphAttributes;
  50038. for (var r in o)
  50039. for (var a = o[r], s = 0, l = a.length; s < l; s++)
  50040. v(a[s], g.ARRAY_BUFFER);
  50041. return t
  50042. }
  50043. }
  50044. ,
  50045. Ci.WebGLProgram = (Qt = 0,
  50046. Jt = /^([\w\d_]+)\.([\w\d_]+)$/,
  50047. $t = /^([\w\d_]+)\[(\d+)\]\.([\w\d_]+)$/,
  50048. ei = /^([\w\d_]+)\[0\]$/,
  50049. function(e, t, i, n) {
  50050. var r = e.context
  50051. , o = i.extensions
  50052. , a = i.defines
  50053. , s = i.__webglShader.vertexShader
  50054. , l = i.__webglShader.fragmentShader
  50055. , c = "SHADOWMAP_TYPE_BASIC";
  50056. n.shadowMapType === Ci.PCFShadowMap ? c = "SHADOWMAP_TYPE_PCF" : n.shadowMapType === Ci.PCFSoftShadowMap && (c = "SHADOWMAP_TYPE_PCF_SOFT");
  50057. var h = "ENVMAP_TYPE_CUBE"
  50058. , u = "ENVMAP_MODE_REFLECTION"
  50059. , d = "ENVMAP_BLENDING_MULTIPLY";
  50060. if (n.envMap) {
  50061. switch (i.envMap.mapping) {
  50062. case Ci.CubeReflectionMapping:
  50063. case Ci.CubeRefractionMapping:
  50064. h = "ENVMAP_TYPE_CUBE";
  50065. break;
  50066. case Ci.CubeUVReflectionMapping:
  50067. case Ci.CubeUVRefractionMapping:
  50068. h = "ENVMAP_TYPE_CUBE_UV";
  50069. break;
  50070. case Ci.EquirectangularReflectionMapping:
  50071. case Ci.EquirectangularRefractionMapping:
  50072. h = "ENVMAP_TYPE_EQUIREC";
  50073. break;
  50074. case Ci.SphericalReflectionMapping:
  50075. h = "ENVMAP_TYPE_SPHERE"
  50076. }
  50077. switch (i.envMap.mapping) {
  50078. case Ci.CubeRefractionMapping:
  50079. case Ci.EquirectangularRefractionMapping:
  50080. u = "ENVMAP_MODE_REFRACTION"
  50081. }
  50082. switch (i.combine) {
  50083. case Ci.MultiplyOperation:
  50084. d = "ENVMAP_BLENDING_MULTIPLY";
  50085. break;
  50086. case Ci.MixOperation:
  50087. d = "ENVMAP_BLENDING_MIX";
  50088. break;
  50089. case Ci.AddOperation:
  50090. d = "ENVMAP_BLENDING_ADD"
  50091. }
  50092. }
  50093. var p, f, g = 0 < e.gammaFactor ? e.gammaFactor : 1, m = function(e, t, i) {
  50094. return [(e = e || {}).derivatives || t.envMapCubeUV || t.bumpMap || t.normalMap || t.flatShading ? "#extension GL_OES_standard_derivatives : enable" : "", (e.fragDepth || t.logarithmicDepthBuffer) && i.get("EXT_frag_depth") ? "#extension GL_EXT_frag_depth : enable" : "", e.drawBuffers && i.get("WEBGL_draw_buffers") ? "#extension GL_EXT_draw_buffers : require" : "", (e.shaderTextureLOD || t.envMap) && i.get("EXT_shader_texture_lod") ? "#extension GL_EXT_shader_texture_lod : enable" : ""].filter(Pi).join("\n")
  50095. }(o, n, e.extensions), v = function(e) {
  50096. var t = [];
  50097. for (var i in e) {
  50098. var n = e[i];
  50099. !1 !== n && t.push("#define " + i + " " + n)
  50100. }
  50101. return t.join("\n")
  50102. }(a), y = r.createProgram();
  50103. f = i instanceof Ci.RawShaderMaterial ? p = "" : (p = ["precision " + n.precision + " float;", "precision " + n.precision + " int;", "#define SHADER_NAME " + i.__webglShader.name, v, n.supportsVertexTextures ? "#define VERTEX_TEXTURES" : "", "#define GAMMA_FACTOR " + g, "#define MAX_BONES " + n.maxBones, n.map ? "#define USE_MAP" : "", n.envMap ? "#define USE_ENVMAP" : "", n.envMap ? "#define " + u : "", n.lightMap ? "#define USE_LIGHTMAP" : "", n.aoMap ? "#define USE_AOMAP" : "", n.emissiveMap ? "#define USE_EMISSIVEMAP" : "", n.bumpMap ? "#define USE_BUMPMAP" : "", n.normalMap ? "#define USE_NORMALMAP" : "", n.displacementMap && n.supportsVertexTextures ? "#define USE_DISPLACEMENTMAP" : "", n.specularMap ? "#define USE_SPECULARMAP" : "", n.roughnessMap ? "#define USE_ROUGHNESSMAP" : "", n.metalnessMap ? "#define USE_METALNESSMAP" : "", n.alphaMap ? "#define USE_ALPHAMAP" : "", n.vertexColors ? "#define USE_COLOR" : "", n.flatShading ? "#define FLAT_SHADED" : "", n.skinning ? "#define USE_SKINNING" : "", n.useVertexTexture ? "#define BONE_TEXTURE" : "", n.morphTargets ? "#define USE_MORPHTARGETS" : "", n.morphNormals && !1 === n.flatShading ? "#define USE_MORPHNORMALS" : "", n.doubleSided ? "#define DOUBLE_SIDED" : "", n.flipSided ? "#define FLIP_SIDED" : "", n.shadowMapEnabled ? "#define USE_SHADOWMAP" : "", n.shadowMapEnabled ? "#define " + c : "", 0 < n.pointLightShadows ? "#define POINT_LIGHT_SHADOWS" : "", n.sizeAttenuation ? "#define USE_SIZEATTENUATION" : "", n.logarithmicDepthBuffer ? "#define USE_LOGDEPTHBUF" : "", n.logarithmicDepthBuffer && e.extensions.get("EXT_frag_depth") ? "#define USE_LOGDEPTHBUF_EXT" : "", "uniform mat4 modelMatrix;", "uniform mat4 modelViewMatrix;", "uniform mat4 projectionMatrix;", "uniform mat4 viewMatrix;", "uniform mat3 normalMatrix;", "uniform vec3 cameraPosition;", "attribute vec3 position;", "attribute vec3 normal;", "attribute vec2 uv;", "#ifdef USE_COLOR", "\tattribute vec3 color;", "#endif", "#ifdef USE_MORPHTARGETS", "\tattribute vec3 morphTarget0;", "\tattribute vec3 morphTarget1;", "\tattribute vec3 morphTarget2;", "\tattribute vec3 morphTarget3;", "\t#ifdef USE_MORPHNORMALS", "\t\tattribute vec3 morphNormal0;", "\t\tattribute vec3 morphNormal1;", "\t\tattribute vec3 morphNormal2;", "\t\tattribute vec3 morphNormal3;", "\t#else", "\t\tattribute vec3 morphTarget4;", "\t\tattribute vec3 morphTarget5;", "\t\tattribute vec3 morphTarget6;", "\t\tattribute vec3 morphTarget7;", "\t#endif", "#endif", "#ifdef USE_SKINNING", "\tattribute vec4 skinIndex;", "\tattribute vec4 skinWeight;", "#endif", "\n"].filter(Pi).join("\n"),
  50104. [m, "precision " + n.precision + " float;", "precision " + n.precision + " int;", "#define SHADER_NAME " + i.__webglShader.name, v, n.alphaTest ? "#define ALPHATEST " + n.alphaTest : "", "#define GAMMA_FACTOR " + g, n.useFog && n.fog ? "#define USE_FOG" : "", n.useFog && n.fogExp ? "#define FOG_EXP2" : "", n.map ? "#define USE_MAP" : "", n.envMap ? "#define USE_ENVMAP" : "", n.envMap ? "#define " + h : "", n.envMap ? "#define " + u : "", n.envMap ? "#define " + d : "", n.lightMap ? "#define USE_LIGHTMAP" : "", n.aoMap ? "#define USE_AOMAP" : "", n.emissiveMap ? "#define USE_EMISSIVEMAP" : "", n.bumpMap ? "#define USE_BUMPMAP" : "", n.normalMap ? "#define USE_NORMALMAP" : "", n.specularMap ? "#define USE_SPECULARMAP" : "", n.roughnessMap ? "#define USE_ROUGHNESSMAP" : "", n.metalnessMap ? "#define USE_METALNESSMAP" : "", n.alphaMap ? "#define USE_ALPHAMAP" : "", n.vertexColors ? "#define USE_COLOR" : "", n.flatShading ? "#define FLAT_SHADED" : "", n.doubleSided ? "#define DOUBLE_SIDED" : "", n.flipSided ? "#define FLIP_SIDED" : "", n.shadowMapEnabled ? "#define USE_SHADOWMAP" : "", n.shadowMapEnabled ? "#define " + c : "", 0 < n.pointLightShadows ? "#define POINT_LIGHT_SHADOWS" : "", n.premultipliedAlpha ? "#define PREMULTIPLIED_ALPHA" : "", n.physicallyCorrectLights ? "#define PHYSICALLY_CORRECT_LIGHTS" : "", n.logarithmicDepthBuffer ? "#define USE_LOGDEPTHBUF" : "", n.logarithmicDepthBuffer && e.extensions.get("EXT_frag_depth") ? "#define USE_LOGDEPTHBUF_EXT" : "", n.envMap && e.extensions.get("EXT_shader_texture_lod") ? "#define TEXTURE_LOD_EXT" : "", "uniform mat4 viewMatrix;", "uniform vec3 cameraPosition;", n.toneMapping !== Ci.NoToneMapping ? "#define TONE_MAPPING" : "", n.toneMapping !== Ci.NoToneMapping ? Ci.ShaderChunk.tonemapping_pars_fragment : "", n.toneMapping !== Ci.NoToneMapping ? function(e, t) {
  50105. var i;
  50106. switch (t) {
  50107. case Ci.LinearToneMapping:
  50108. i = "Linear";
  50109. break;
  50110. case Ci.ReinhardToneMapping:
  50111. i = "Reinhard";
  50112. break;
  50113. case Ci.Uncharted2ToneMapping:
  50114. i = "Uncharted2";
  50115. break;
  50116. case Ci.CineonToneMapping:
  50117. i = "OptimizedCineon";
  50118. break;
  50119. default:
  50120. throw new Error("unsupported toneMapping: " + t)
  50121. }
  50122. return "vec3 " + e + "( vec3 color ) { return " + i + "ToneMapping( color ); }"
  50123. }("toneMapping", n.toneMapping) : "", n.outputEncoding || n.mapEncoding || n.envMapEncoding || n.emissiveMapEncoding ? Ci.ShaderChunk.encodings_pars_fragment : "", n.mapEncoding ? Ri("mapTexelToLinear", n.mapEncoding) : "", n.envMapEncoding ? Ri("envMapTexelToLinear", n.envMapEncoding) : "", n.emissiveMapEncoding ? Ri("emissiveMapTexelToLinear", n.emissiveMapEncoding) : "", n.outputEncoding ? function(e, t) {
  50124. var i = Mi(t);
  50125. return "vec4 " + e + "( vec4 value ) { return LinearTo" + i[0] + i[1] + "; }"
  50126. }("linearToOutputTexel", n.outputEncoding) : "", "\n"].filter(Pi).join("\n")),
  50127. s = Oi(s = Li(s), n),
  50128. l = Oi(l = Li(l), n),
  50129. i instanceof Ci.ShaderMaterial == 0 && (s = Di(s),
  50130. l = Di(l));
  50131. var A = p + s
  50132. , C = f + l
  50133. , I = Ci.WebGLShader(r, r.VERTEX_SHADER, A)
  50134. , E = Ci.WebGLShader(r, r.FRAGMENT_SHADER, C);
  50135. r.attachShader(y, I),
  50136. r.attachShader(y, E),
  50137. void 0 !== i.index0AttributeName ? r.bindAttribLocation(y, 0, i.index0AttributeName) : !0 === n.morphTargets && r.bindAttribLocation(y, 0, "position"),
  50138. r.linkProgram(y);
  50139. var _, b, w = r.getProgramInfoLog(y), T = r.getShaderInfoLog(I), x = r.getShaderInfoLog(E), S = !0, M = !0;
  50140. return !1 === r.getProgramParameter(y, r.LINK_STATUS) ? (S = !1,
  50141. console.error("THREE.WebGLProgram: shader error: ", r.getError(), "gl.VALIDATE_STATUS", r.getProgramParameter(y, r.VALIDATE_STATUS), "gl.getProgramInfoLog", w, T, x)) : "" !== w ? console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()", w) : "" !== T && "" !== x || (M = !1),
  50142. M && (this.diagnostics = {
  50143. runnable: S,
  50144. material: i,
  50145. programLog: w,
  50146. vertexShader: {
  50147. log: T,
  50148. prefix: p
  50149. },
  50150. fragmentShader: {
  50151. log: x,
  50152. prefix: f
  50153. }
  50154. }),
  50155. r.deleteShader(I),
  50156. r.deleteShader(E),
  50157. this.getUniforms = function() {
  50158. return void 0 === _ && (_ = function(e, t) {
  50159. for (var i = {}, n = e.getProgramParameter(t, e.ACTIVE_UNIFORMS), r = 0; r < n; r++) {
  50160. var o = e.getActiveUniform(t, r).name
  50161. , a = e.getUniformLocation(t, o)
  50162. , s = Jt.exec(o);
  50163. if (s) {
  50164. var l = s[1]
  50165. , c = s[2]
  50166. , h = i[l];
  50167. (h = h || (i[l] = {}))[c] = a
  50168. } else if (s = $t.exec(o)) {
  50169. var u = s[1]
  50170. , d = s[2]
  50171. , p = s[3]
  50172. , f = i[u]
  50173. , g = (f = f || (i[u] = []))[d];
  50174. (g = g || (f[d] = {}))[p] = a
  50175. } else
  50176. (s = ei.exec(o)) ? i[u = s[1]] = a : i[o] = a
  50177. }
  50178. return i
  50179. }(r, y)),
  50180. _
  50181. }
  50182. ,
  50183. this.getAttributes = function() {
  50184. return void 0 === b && (b = function(e, t) {
  50185. for (var i = {}, n = e.getProgramParameter(t, e.ACTIVE_ATTRIBUTES), r = 0; r < n; r++) {
  50186. var o = e.getActiveAttrib(t, r).name;
  50187. i[o] = e.getAttribLocation(t, o)
  50188. }
  50189. return i
  50190. }(r, y)),
  50191. b
  50192. }
  50193. ,
  50194. this.destroy = function() {
  50195. r.deleteProgram(y),
  50196. this.program = void 0
  50197. }
  50198. ,
  50199. Object.defineProperties(this, {
  50200. uniforms: {
  50201. get: function() {
  50202. return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),
  50203. this.getUniforms()
  50204. }
  50205. },
  50206. attributes: {
  50207. get: function() {
  50208. return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),
  50209. this.getAttributes()
  50210. }
  50211. }
  50212. }),
  50213. this.id = Qt++,
  50214. this.code = t,
  50215. this.usedTimes = 1,
  50216. this.program = y,
  50217. this.vertexShader = I,
  50218. this.fragmentShader = E,
  50219. this
  50220. }
  50221. ),
  50222. Ci.WebGLPrograms = function(s, l) {
  50223. function c(e, t) {
  50224. var i;
  50225. return e ? e instanceof Ci.Texture ? i = e.encoding : e instanceof Ci.WebGLRenderTarget && (i = e.texture.encoding) : i = Ci.LinearEncoding,
  50226. i === Ci.LinearEncoding && t && (i = Ci.GammaEncoding),
  50227. i
  50228. }
  50229. var h = []
  50230. , u = {
  50231. MeshDepthMaterial: "depth",
  50232. MeshNormalMaterial: "normal",
  50233. MeshBasicMaterial: "basic",
  50234. MeshLambertMaterial: "lambert",
  50235. MeshPhongMaterial: "phong",
  50236. MeshStandardMaterial: "standard",
  50237. LineBasicMaterial: "basic",
  50238. LineDashedMaterial: "dashed",
  50239. PointsMaterial: "points"
  50240. }
  50241. , a = ["precision", "supportsVertexTextures", "map", "mapEncoding", "envMap", "envMapMode", "envMapEncoding", "lightMap", "aoMap", "emissiveMap", "emissiveMapEncoding", "bumpMap", "normalMap", "displacementMap", "specularMap", "roughnessMap", "metalnessMap", "alphaMap", "combine", "vertexColors", "fog", "useFog", "fogExp", "flatShading", "sizeAttenuation", "logarithmicDepthBuffer", "skinning", "maxBones", "useVertexTexture", "morphTargets", "morphNormals", "maxMorphTargets", "maxMorphNormals", "premultipliedAlpha", "numDirLights", "numPointLights", "numSpotLights", "numHemiLights", "shadowMapEnabled", "pointLightShadows", "toneMapping", "physicallyCorrectLights", "shadowMapType", "alphaTest", "doubleSided", "flipSided"];
  50242. this.getParameters = function(e, t, i, n) {
  50243. var r = u[e.type]
  50244. , o = function(e) {
  50245. if (l.floatVertexTextures && e && e.skeleton && e.skeleton.useVertexTexture)
  50246. return 1024;
  50247. var t = l.maxVertexUniforms
  50248. , i = Math.floor((t - 20) / 4);
  50249. return void 0 !== e && e instanceof Ci.SkinnedMesh && ((i = Math.min(e.skeleton.bones.length, i)) < e.skeleton.bones.length && console.warn("WebGLRenderer: too many bones - " + e.skeleton.bones.length + ", this GPU supports just " + i + " (try OpenGL instead of ANGLE)")),
  50250. i
  50251. }(n)
  50252. , a = s.getPrecision();
  50253. return null === e.precision || (a = l.getMaxPrecision(e.precision)) !== e.precision && console.warn("THREE.WebGLProgram.getParameters:", e.precision, "not supported, using", a, "instead."),
  50254. {
  50255. shaderID: r,
  50256. precision: a,
  50257. supportsVertexTextures: l.vertexTextures,
  50258. outputEncoding: c(s.getCurrentRenderTarget(), s.gammaOutput),
  50259. map: !!e.map,
  50260. mapEncoding: c(e.map, s.gammaInput),
  50261. envMap: !!e.envMap,
  50262. envMapMode: e.envMap && e.envMap.mapping,
  50263. envMapEncoding: c(e.envMap, s.gammaInput),
  50264. envMapCubeUV: !!e.envMap && (e.envMap.mapping === Ci.CubeUVReflectionMapping || e.envMap.mapping === Ci.CubeUVRefractionMapping),
  50265. lightMap: !!e.lightMap,
  50266. aoMap: !!e.aoMap,
  50267. emissiveMap: !!e.emissiveMap,
  50268. emissiveMapEncoding: c(e.emissiveMap, s.gammaInput),
  50269. bumpMap: !!e.bumpMap,
  50270. normalMap: !!e.normalMap,
  50271. displacementMap: !!e.displacementMap,
  50272. roughnessMap: !!e.roughnessMap,
  50273. metalnessMap: !!e.metalnessMap,
  50274. specularMap: !!e.specularMap,
  50275. alphaMap: !!e.alphaMap,
  50276. combine: e.combine,
  50277. vertexColors: e.vertexColors,
  50278. fog: i,
  50279. useFog: e.fog,
  50280. fogExp: i instanceof Ci.FogExp2,
  50281. flatShading: e.shading === Ci.FlatShading,
  50282. sizeAttenuation: e.sizeAttenuation,
  50283. logarithmicDepthBuffer: l.logarithmicDepthBuffer,
  50284. skinning: e.skinning,
  50285. maxBones: o,
  50286. useVertexTexture: l.floatVertexTextures && n && n.skeleton && n.skeleton.useVertexTexture,
  50287. morphTargets: e.morphTargets,
  50288. morphNormals: e.morphNormals,
  50289. maxMorphTargets: s.maxMorphTargets,
  50290. maxMorphNormals: s.maxMorphNormals,
  50291. numDirLights: t.directional.length,
  50292. numPointLights: t.point.length,
  50293. numSpotLights: t.spot.length,
  50294. numHemiLights: t.hemi.length,
  50295. pointLightShadows: t.shadowsPointLight,
  50296. shadowMapEnabled: s.shadowMap.enabled && n.receiveShadow && 0 < t.shadows.length,
  50297. shadowMapType: s.shadowMap.type,
  50298. toneMapping: s.toneMapping,
  50299. physicallyCorrectLights: s.physicallyCorrectLights,
  50300. premultipliedAlpha: e.premultipliedAlpha,
  50301. alphaTest: e.alphaTest,
  50302. doubleSided: e.side === Ci.DoubleSide,
  50303. flipSided: e.side === Ci.BackSide
  50304. }
  50305. }
  50306. ,
  50307. this.getProgramCode = function(e, t) {
  50308. var i = [];
  50309. if (t.shaderID ? i.push(t.shaderID) : (i.push(e.fragmentShader),
  50310. i.push(e.vertexShader)),
  50311. void 0 !== e.defines)
  50312. for (var n in e.defines)
  50313. i.push(n),
  50314. i.push(e.defines[n]);
  50315. for (var r = 0; r < a.length; r++) {
  50316. var o = a[r];
  50317. i.push(o),
  50318. i.push(t[o])
  50319. }
  50320. return i.join()
  50321. }
  50322. ,
  50323. this.acquireProgram = function(e, t, i) {
  50324. for (var n, r = 0, o = h.length; r < o; r++) {
  50325. var a = h[r];
  50326. if (a.code === i) {
  50327. ++(n = a).usedTimes;
  50328. break
  50329. }
  50330. }
  50331. return void 0 === n && (n = new Ci.WebGLProgram(s,i,e,t),
  50332. h.push(n)),
  50333. n
  50334. }
  50335. ,
  50336. this.releaseProgram = function(e) {
  50337. if (0 == --e.usedTimes) {
  50338. var t = h.indexOf(e);
  50339. h[t] = h[h.length - 1],
  50340. h.pop(),
  50341. e.destroy()
  50342. }
  50343. }
  50344. ,
  50345. this.programs = h
  50346. }
  50347. ,
  50348. Ci.WebGLProperties = function() {
  50349. var n = {};
  50350. this.get = function(e) {
  50351. var t = e.uuid
  50352. , i = n[t];
  50353. return void 0 === i && (i = {},
  50354. n[t] = i),
  50355. i
  50356. }
  50357. ,
  50358. this.delete = function(e) {
  50359. delete n[e.uuid]
  50360. }
  50361. ,
  50362. this.clear = function() {
  50363. n = {}
  50364. }
  50365. }
  50366. ,
  50367. Ci.WebGLShader = function(e, t, i) {
  50368. var n = e.createShader(t);
  50369. return e.shaderSource(n, i),
  50370. e.compileShader(n),
  50371. !1 === e.getShaderParameter(n, e.COMPILE_STATUS) && console.error("THREE.WebGLShader: Shader couldn't compile."),
  50372. "" !== e.getShaderInfoLog(n) && console.warn("THREE.WebGLShader: gl.getShaderInfoLog()", t === e.VERTEX_SHADER ? "vertex" : "fragment", e.getShaderInfoLog(n), function(e) {
  50373. for (var t = e.split("\n"), i = 0; i < t.length; i++)
  50374. t[i] = i + 1 + ": " + t[i];
  50375. return t.join("\n")
  50376. }(i)),
  50377. n
  50378. }
  50379. ,
  50380. Ci.WebGLShadowMap = function(P, O, L) {
  50381. function D(e, t, i, n) {
  50382. var r = e.geometry
  50383. , o = null
  50384. , a = p
  50385. , s = e.customDepthMaterial;
  50386. if (i && (a = f,
  50387. s = e.customDistanceMaterial),
  50388. s)
  50389. o = s;
  50390. else {
  50391. var l = void 0 !== r.morphTargets && 0 < r.morphTargets.length && t.morphTargets
  50392. , c = e instanceof Ci.SkinnedMesh && t.skinning
  50393. , h = 0;
  50394. l && (h |= u),
  50395. c && (h |= d),
  50396. o = a[h]
  50397. }
  50398. return o.visible = t.visible,
  50399. o.wireframe = t.wireframe,
  50400. o.wireframeLinewidth = t.wireframeLinewidth,
  50401. i && void 0 !== o.uniforms.lightPos && o.uniforms.lightPos.value.copy(n),
  50402. o
  50403. }
  50404. function N(e, t, i) {
  50405. if (!1 !== e.visible) {
  50406. if (e.layers.test(t.layers) && (e instanceof Ci.Mesh || e instanceof Ci.Line || e instanceof Ci.Points) && e.castShadow && (!1 === e.frustumCulled || !0 === V.intersectsObject(e)))
  50407. !0 === e.material.visible && (e.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse, e.matrixWorld),
  50408. G.push(e));
  50409. for (var n = e.children, r = 0, o = n.length; r < o; r++)
  50410. N(n[r], t, i)
  50411. }
  50412. }
  50413. for (var F = P.context, B = P.state, V = new Ci.Frustum, k = new Ci.Matrix4, U = new Ci.Vector2, H = new Ci.Vector3, z = new Ci.Vector3, G = [], u = 1, d = 2, e = 1 + (u | d), p = new Array(e), f = new Array(e), W = [new Ci.Vector3(1,0,0), new Ci.Vector3(-1,0,0), new Ci.Vector3(0,0,1), new Ci.Vector3(0,0,-1), new Ci.Vector3(0,1,0), new Ci.Vector3(0,-1,0)], j = [new Ci.Vector3(0,1,0), new Ci.Vector3(0,1,0), new Ci.Vector3(0,1,0), new Ci.Vector3(0,1,0), new Ci.Vector3(0,0,1), new Ci.Vector3(0,0,-1)], Y = [new Ci.Vector4, new Ci.Vector4, new Ci.Vector4, new Ci.Vector4, new Ci.Vector4, new Ci.Vector4], t = Ci.ShaderLib.depthRGBA, i = Ci.UniformsUtils.clone(t.uniforms), n = Ci.ShaderLib.distanceRGBA, r = Ci.UniformsUtils.clone(n.uniforms), o = 0; o !== e; ++o) {
  50414. var a = 0 != (o & u)
  50415. , s = 0 != (o & d)
  50416. , l = new Ci.ShaderMaterial({
  50417. uniforms: i,
  50418. vertexShader: t.vertexShader,
  50419. fragmentShader: t.fragmentShader,
  50420. morphTargets: a,
  50421. skinning: s
  50422. });
  50423. p[o] = l;
  50424. var c = new Ci.ShaderMaterial({
  50425. defines: {
  50426. USE_SHADOWMAP: ""
  50427. },
  50428. uniforms: r,
  50429. vertexShader: n.vertexShader,
  50430. fragmentShader: n.fragmentShader,
  50431. morphTargets: a,
  50432. skinning: s
  50433. });
  50434. f[o] = c
  50435. }
  50436. var q = this;
  50437. this.enabled = !1,
  50438. this.autoUpdate = !0,
  50439. this.needsUpdate = !1,
  50440. this.type = Ci.PCFShadowMap,
  50441. this.cullFace = Ci.CullFaceFront,
  50442. this.render = function(e, t) {
  50443. var i, n, r = O.shadows;
  50444. if (0 !== r.length && !1 !== q.enabled && (!1 !== q.autoUpdate || !1 !== q.needsUpdate)) {
  50445. B.clearColor(1, 1, 1, 1),
  50446. B.disable(F.BLEND),
  50447. B.enable(F.CULL_FACE),
  50448. F.frontFace(F.CCW),
  50449. F.cullFace(q.cullFace === Ci.CullFaceFront ? F.FRONT : F.BACK),
  50450. B.setDepthTest(!0),
  50451. B.setScissorTest(!1);
  50452. for (var o = 0, a = r.length; o < a; o++) {
  50453. var s = r[o]
  50454. , l = s.shadow
  50455. , c = l.camera;
  50456. if (U.copy(l.mapSize),
  50457. s instanceof Ci.PointLight) {
  50458. i = 6,
  50459. n = !0;
  50460. var h = U.x
  50461. , u = U.y;
  50462. Y[0].set(2 * h, u, h, u),
  50463. Y[1].set(0, u, h, u),
  50464. Y[2].set(3 * h, u, h, u),
  50465. Y[3].set(h, u, h, u),
  50466. Y[4].set(3 * h, 0, h, u),
  50467. Y[5].set(h, 0, h, u),
  50468. U.x *= 4,
  50469. U.y *= 2
  50470. } else
  50471. n = !(i = 1);
  50472. if (null === l.map) {
  50473. var d = {
  50474. minFilter: Ci.NearestFilter,
  50475. magFilter: Ci.NearestFilter,
  50476. format: Ci.RGBAFormat
  50477. };
  50478. l.map = new Ci.WebGLRenderTarget(U.x,U.y,d),
  50479. s instanceof Ci.SpotLight && (c.aspect = U.x / U.y),
  50480. c.updateProjectionMatrix()
  50481. }
  50482. var p = l.map
  50483. , f = l.matrix;
  50484. z.setFromMatrixPosition(s.matrixWorld),
  50485. c.position.copy(z),
  50486. P.setRenderTarget(p),
  50487. P.clear();
  50488. for (var g = 0; g < i; g++) {
  50489. if (n) {
  50490. H.copy(c.position),
  50491. H.add(W[g]),
  50492. c.up.copy(j[g]),
  50493. c.lookAt(H);
  50494. var m = Y[g];
  50495. B.viewport(m)
  50496. } else
  50497. H.setFromMatrixPosition(s.target.matrixWorld),
  50498. c.lookAt(H);
  50499. c.updateMatrixWorld(),
  50500. c.matrixWorldInverse.getInverse(c.matrixWorld),
  50501. f.set(.5, 0, 0, .5, 0, .5, 0, .5, 0, 0, .5, .5, 0, 0, 0, 1),
  50502. f.multiply(c.projectionMatrix),
  50503. f.multiply(c.matrixWorldInverse),
  50504. k.multiplyMatrices(c.projectionMatrix, c.matrixWorldInverse),
  50505. V.setFromMatrix(k),
  50506. G.length = 0,
  50507. N(e, t, c);
  50508. for (var v = 0, y = G.length; v < y; v++) {
  50509. var A = G[v]
  50510. , C = L.update(A)
  50511. , I = A.material;
  50512. if (I instanceof Ci.MultiMaterial)
  50513. for (var E = C.groups, _ = I.materials, b = 0, w = E.length; b < w; b++) {
  50514. var T = E[b]
  50515. , x = _[T.materialIndex];
  50516. if (!0 === x.visible) {
  50517. var S = D(A, x, n, z);
  50518. P.renderBufferDirect(c, null, C, S, A, T)
  50519. }
  50520. }
  50521. else {
  50522. S = D(A, I, n, z);
  50523. P.renderBufferDirect(c, null, C, S, A, null)
  50524. }
  50525. }
  50526. }
  50527. }
  50528. var M = P.getClearColor()
  50529. , R = P.getClearAlpha();
  50530. P.setClearColor(M, R),
  50531. B.enable(F.BLEND),
  50532. q.cullFace === Ci.CullFaceFront && F.cullFace(F.BACK),
  50533. q.needsUpdate = !1
  50534. }
  50535. }
  50536. }
  50537. ,
  50538. Ci.WebGLState = function(l, i, c) {
  50539. var n = this
  50540. , r = new Ci.Vector4
  50541. , o = new Uint8Array(16)
  50542. , a = new Uint8Array(16)
  50543. , s = new Uint8Array(16)
  50544. , t = {}
  50545. , h = null
  50546. , u = null
  50547. , d = null
  50548. , p = null
  50549. , f = null
  50550. , g = null
  50551. , m = null
  50552. , v = null
  50553. , y = !1
  50554. , A = null
  50555. , C = null
  50556. , I = null
  50557. , E = null
  50558. , _ = null
  50559. , b = null
  50560. , w = null
  50561. , T = null
  50562. , x = null
  50563. , S = null
  50564. , M = null
  50565. , R = null
  50566. , P = null
  50567. , O = null
  50568. , L = null
  50569. , D = l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS)
  50570. , N = void 0
  50571. , F = {}
  50572. , B = new Ci.Vector4
  50573. , V = null
  50574. , k = null
  50575. , U = new Ci.Vector4
  50576. , H = new Ci.Vector4
  50577. , z = l.createTexture();
  50578. l.bindTexture(l.TEXTURE_2D, z),
  50579. l.texParameteri(l.TEXTURE_2D, l.TEXTURE_MIN_FILTER, l.LINEAR),
  50580. l.texImage2D(l.TEXTURE_2D, 0, l.RGB, 1, 1, 0, l.RGB, l.UNSIGNED_BYTE, new Uint8Array(3)),
  50581. this.init = function() {
  50582. this.clearColor(0, 0, 0, 1),
  50583. this.clearDepth(1),
  50584. this.clearStencil(0),
  50585. this.enable(l.DEPTH_TEST),
  50586. l.depthFunc(l.LEQUAL),
  50587. l.frontFace(l.CCW),
  50588. l.cullFace(l.BACK),
  50589. this.enable(l.CULL_FACE),
  50590. this.enable(l.BLEND),
  50591. l.blendEquation(l.FUNC_ADD),
  50592. l.blendFunc(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA)
  50593. }
  50594. ,
  50595. this.initAttributes = function() {
  50596. for (var e = 0, t = o.length; e < t; e++)
  50597. o[e] = 0
  50598. }
  50599. ,
  50600. this.enableAttribute = function(e) {
  50601. o[e] = 1,
  50602. 0 === a[e] && (l.enableVertexAttribArray(e),
  50603. a[e] = 1),
  50604. 0 !== s[e] && (i.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(e, 0),
  50605. s[e] = 0)
  50606. }
  50607. ,
  50608. this.enableAttributeAndDivisor = function(e, t, i) {
  50609. o[e] = 1,
  50610. 0 === a[e] && (l.enableVertexAttribArray(e),
  50611. a[e] = 1),
  50612. s[e] !== t && (i.vertexAttribDivisorANGLE(e, t),
  50613. s[e] = t)
  50614. }
  50615. ,
  50616. this.disableUnusedAttributes = function() {
  50617. for (var e = 0, t = a.length; e < t; e++)
  50618. a[e] !== o[e] && (l.disableVertexAttribArray(e),
  50619. a[e] = 0)
  50620. }
  50621. ,
  50622. this.enable = function(e) {
  50623. !0 !== t[e] && (l.enable(e),
  50624. t[e] = !0)
  50625. }
  50626. ,
  50627. this.disable = function(e) {
  50628. !1 !== t[e] && (l.disable(e),
  50629. t[e] = !1)
  50630. }
  50631. ,
  50632. this.getCompressedTextureFormats = function() {
  50633. if (null === h && (h = [],
  50634. i.get("WEBGL_compressed_texture_pvrtc") || i.get("WEBGL_compressed_texture_s3tc") || i.get("WEBGL_compressed_texture_etc1")))
  50635. for (var e = l.getParameter(l.COMPRESSED_TEXTURE_FORMATS), t = 0; t < e.length; t++)
  50636. h.push(e[t]);
  50637. return h
  50638. }
  50639. ,
  50640. this.setBlending = function(e, t, i, n, r, o, a, s) {
  50641. e === Ci.NoBlending ? this.disable(l.BLEND) : this.enable(l.BLEND),
  50642. e === u && s === y || (e === Ci.AdditiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50643. l.blendFuncSeparate(l.ONE, l.ONE, l.ONE, l.ONE)) : (l.blendEquation(l.FUNC_ADD),
  50644. l.blendFunc(l.SRC_ALPHA, l.ONE)) : e === Ci.SubtractiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50645. l.blendFuncSeparate(l.ZERO, l.ZERO, l.ONE_MINUS_SRC_COLOR, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  50646. l.blendFunc(l.ZERO, l.ONE_MINUS_SRC_COLOR)) : e === Ci.MultiplyBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50647. l.blendFuncSeparate(l.ZERO, l.ZERO, l.SRC_COLOR, l.SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  50648. l.blendFunc(l.ZERO, l.SRC_COLOR)) : s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50649. l.blendFuncSeparate(l.ONE, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50650. l.blendFuncSeparate(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)),
  50651. u = e,
  50652. y = s),
  50653. e === Ci.CustomBlending ? (r = r || t,
  50654. o = o || i,
  50655. a = a || n,
  50656. t === d && r === g || (l.blendEquationSeparate(c(t), c(r)),
  50657. d = t,
  50658. g = r),
  50659. i === p && n === f && o === m && a === v || (l.blendFuncSeparate(c(i), c(n), c(o), c(a)),
  50660. p = i,
  50661. f = n,
  50662. m = o,
  50663. v = a)) : v = m = g = f = p = d = null
  50664. }
  50665. ,
  50666. this.setDepthFunc = function(e) {
  50667. if (A !== e) {
  50668. if (e)
  50669. switch (e) {
  50670. case Ci.NeverDepth:
  50671. l.depthFunc(l.NEVER);
  50672. break;
  50673. case Ci.AlwaysDepth:
  50674. l.depthFunc(l.ALWAYS);
  50675. break;
  50676. case Ci.LessDepth:
  50677. l.depthFunc(l.LESS);
  50678. break;
  50679. case Ci.LessEqualDepth:
  50680. l.depthFunc(l.LEQUAL);
  50681. break;
  50682. case Ci.EqualDepth:
  50683. l.depthFunc(l.EQUAL);
  50684. break;
  50685. case Ci.GreaterEqualDepth:
  50686. l.depthFunc(l.GEQUAL);
  50687. break;
  50688. case Ci.GreaterDepth:
  50689. l.depthFunc(l.GREATER);
  50690. break;
  50691. case Ci.NotEqualDepth:
  50692. l.depthFunc(l.NOTEQUAL);
  50693. break;
  50694. default:
  50695. l.depthFunc(l.LEQUAL)
  50696. }
  50697. else
  50698. l.depthFunc(l.LEQUAL);
  50699. A = e
  50700. }
  50701. }
  50702. ,
  50703. this.setDepthTest = function(e) {
  50704. e ? this.enable(l.DEPTH_TEST) : this.disable(l.DEPTH_TEST)
  50705. }
  50706. ,
  50707. this.setDepthWrite = function(e) {
  50708. C !== e && (l.depthMask(e),
  50709. C = e)
  50710. }
  50711. ,
  50712. this.setColorWrite = function(e) {
  50713. I !== e && (l.colorMask(e, e, e, e),
  50714. I = e)
  50715. }
  50716. ,
  50717. this.setStencilFunc = function(e, t, i) {
  50718. _ === e && b === t && w === i || (l.stencilFunc(e, t, i),
  50719. _ = e,
  50720. b = t,
  50721. w = i)
  50722. }
  50723. ,
  50724. this.setStencilOp = function(e, t, i) {
  50725. T === e && x === t && S === i || (l.stencilOp(e, t, i),
  50726. T = e,
  50727. x = t,
  50728. S = i)
  50729. }
  50730. ,
  50731. this.setStencilTest = function(e) {
  50732. e ? this.enable(l.STENCIL_TEST) : this.disable(l.STENCIL_TEST)
  50733. }
  50734. ,
  50735. this.setStencilWrite = function(e) {
  50736. E !== e && (l.stencilMask(e),
  50737. E = e)
  50738. }
  50739. ,
  50740. this.setFlipSided = function(e) {
  50741. M !== e && (e ? l.frontFace(l.CW) : l.frontFace(l.CCW),
  50742. M = e)
  50743. }
  50744. ,
  50745. this.setLineWidth = function(e) {
  50746. e !== R && (l.lineWidth(e),
  50747. R = e)
  50748. }
  50749. ,
  50750. this.setPolygonOffset = function(e, t, i) {
  50751. e ? this.enable(l.POLYGON_OFFSET_FILL) : this.disable(l.POLYGON_OFFSET_FILL),
  50752. !e || P === t && O === i || (l.polygonOffset(t, i),
  50753. P = t,
  50754. O = i)
  50755. }
  50756. ,
  50757. this.getScissorTest = function() {
  50758. return L
  50759. }
  50760. ,
  50761. this.setScissorTest = function(e) {
  50762. (L = e) ? this.enable(l.SCISSOR_TEST) : this.disable(l.SCISSOR_TEST)
  50763. }
  50764. ,
  50765. this.activeTexture = function(e) {
  50766. void 0 === e && (e = l.TEXTURE0 + D - 1),
  50767. N !== e && (l.activeTexture(e),
  50768. N = e)
  50769. }
  50770. ,
  50771. this.bindTexture = function(e, t) {
  50772. void 0 === N && n.activeTexture();
  50773. var i = F[N];
  50774. void 0 === i && (i = {
  50775. type: void 0,
  50776. texture: void 0
  50777. },
  50778. F[N] = i),
  50779. i.type === e && i.texture === t || (l.bindTexture(e, t || z),
  50780. i.type = e,
  50781. i.texture = t)
  50782. }
  50783. ,
  50784. this.compressedTexImage2D = function() {
  50785. try {
  50786. l.compressedTexImage2D.apply(l, arguments)
  50787. } catch (e) {
  50788. console.error(e)
  50789. }
  50790. }
  50791. ,
  50792. this.texImage2D = function() {
  50793. try {
  50794. l.texImage2D.apply(l, arguments)
  50795. } catch (e) {
  50796. console.error(e)
  50797. }
  50798. }
  50799. ,
  50800. this.clearColor = function(e, t, i, n) {
  50801. r.set(e, t, i, n),
  50802. !1 === B.equals(r) && (l.clearColor(e, t, i, n),
  50803. B.copy(r))
  50804. }
  50805. ,
  50806. this.clearDepth = function(e) {
  50807. V !== e && (l.clearDepth(e),
  50808. V = e)
  50809. }
  50810. ,
  50811. this.clearStencil = function(e) {
  50812. k !== e && (l.clearStencil(e),
  50813. k = e)
  50814. }
  50815. ,
  50816. this.scissor = function(e) {
  50817. !1 === U.equals(e) && (l.scissor(e.x, e.y, e.z, e.w),
  50818. U.copy(e))
  50819. }
  50820. ,
  50821. this.viewport = function(e) {
  50822. !1 === H.equals(e) && (l.viewport(e.x, e.y, e.z, e.w),
  50823. H.copy(e))
  50824. }
  50825. ,
  50826. this.reset = function() {
  50827. for (var e = 0; e < a.length; e++)
  50828. 1 === a[e] && (l.disableVertexAttribArray(e),
  50829. a[e] = 0);
  50830. t = {},
  50831. N = void 0,
  50832. F = {},
  50833. M = E = C = I = u = h = null
  50834. }
  50835. }
  50836. ,
  50837. Ci.LensFlarePlugin = function(v, y) {
  50838. function A() {
  50839. var e, t = new Float32Array([-1, -1, 0, 0, 1, -1, 1, 0, 1, 1, 1, 1, -1, 1, 0, 1]), i = new Uint16Array([0, 1, 2, 0, 2, 3]);
  50840. C = S.createBuffer(),
  50841. I = S.createBuffer(),
  50842. S.bindBuffer(S.ARRAY_BUFFER, C),
  50843. S.bufferData(S.ARRAY_BUFFER, t, S.STATIC_DRAW),
  50844. S.bindBuffer(S.ELEMENT_ARRAY_BUFFER, I),
  50845. S.bufferData(S.ELEMENT_ARRAY_BUFFER, i, S.STATIC_DRAW),
  50846. T = S.createTexture(),
  50847. x = S.createTexture(),
  50848. M.bindTexture(S.TEXTURE_2D, T),
  50849. S.texImage2D(S.TEXTURE_2D, 0, S.RGB, 16, 16, 0, S.RGB, S.UNSIGNED_BYTE, null),
  50850. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_S, S.CLAMP_TO_EDGE),
  50851. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_T, S.CLAMP_TO_EDGE),
  50852. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MAG_FILTER, S.NEAREST),
  50853. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MIN_FILTER, S.NEAREST),
  50854. M.bindTexture(S.TEXTURE_2D, x),
  50855. S.texImage2D(S.TEXTURE_2D, 0, S.RGBA, 16, 16, 0, S.RGBA, S.UNSIGNED_BYTE, null),
  50856. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_S, S.CLAMP_TO_EDGE),
  50857. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_T, S.CLAMP_TO_EDGE),
  50858. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MAG_FILTER, S.NEAREST),
  50859. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MIN_FILTER, S.NEAREST),
  50860. e = (w = 0 < S.getParameter(S.MAX_VERTEX_TEXTURE_IMAGE_UNITS)) ? {
  50861. 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"),
  50862. 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")
  50863. } : {
  50864. 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"),
  50865. 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")
  50866. },
  50867. E = function(e) {
  50868. var t = S.createProgram()
  50869. , i = S.createShader(S.FRAGMENT_SHADER)
  50870. , n = S.createShader(S.VERTEX_SHADER)
  50871. , r = "precision " + v.getPrecision() + " float;\n";
  50872. return S.shaderSource(i, r + e.fragmentShader),
  50873. S.shaderSource(n, r + e.vertexShader),
  50874. S.compileShader(i),
  50875. S.compileShader(n),
  50876. S.attachShader(t, i),
  50877. S.attachShader(t, n),
  50878. S.linkProgram(t),
  50879. t
  50880. }(e),
  50881. _ = {
  50882. vertex: S.getAttribLocation(E, "position"),
  50883. uv: S.getAttribLocation(E, "uv")
  50884. },
  50885. b = {
  50886. renderType: S.getUniformLocation(E, "renderType"),
  50887. map: S.getUniformLocation(E, "map"),
  50888. occlusionMap: S.getUniformLocation(E, "occlusionMap"),
  50889. opacity: S.getUniformLocation(E, "opacity"),
  50890. color: S.getUniformLocation(E, "color"),
  50891. scale: S.getUniformLocation(E, "scale"),
  50892. rotation: S.getUniformLocation(E, "rotation"),
  50893. screenPosition: S.getUniformLocation(E, "screenPosition")
  50894. }
  50895. }
  50896. var C, I, E, _, b, w, T, x, S = v.context, M = v.state;
  50897. this.render = function(e, t, i) {
  50898. if (0 !== y.length) {
  50899. var n = new Ci.Vector3
  50900. , r = i.w / i.z
  50901. , o = .5 * i.z
  50902. , a = .5 * i.w
  50903. , s = 16 / i.w
  50904. , l = new Ci.Vector2(s * r,s)
  50905. , c = new Ci.Vector3(1,1,0)
  50906. , h = new Ci.Vector2(1,1);
  50907. void 0 === E && A(),
  50908. S.useProgram(E),
  50909. M.initAttributes(),
  50910. M.enableAttribute(_.vertex),
  50911. M.enableAttribute(_.uv),
  50912. M.disableUnusedAttributes(),
  50913. S.uniform1i(b.occlusionMap, 0),
  50914. S.uniform1i(b.map, 1),
  50915. S.bindBuffer(S.ARRAY_BUFFER, C),
  50916. S.vertexAttribPointer(_.vertex, 2, S.FLOAT, !1, 16, 0),
  50917. S.vertexAttribPointer(_.uv, 2, S.FLOAT, !1, 16, 8),
  50918. S.bindBuffer(S.ELEMENT_ARRAY_BUFFER, I),
  50919. M.disable(S.CULL_FACE),
  50920. M.setDepthWrite(!1);
  50921. for (var u = 0, d = y.length; u < d; u++) {
  50922. s = 16 / i.w,
  50923. l.set(s * r, s);
  50924. var p = y[u];
  50925. if (n.set(p.matrixWorld.elements[12], p.matrixWorld.elements[13], p.matrixWorld.elements[14]),
  50926. n.applyMatrix4(t.matrixWorldInverse),
  50927. n.applyProjection(t.projectionMatrix),
  50928. c.copy(n),
  50929. h.x = c.x * o + o,
  50930. h.y = c.y * a + a,
  50931. w || 0 < h.x && h.x < i.z && 0 < h.y && h.y < i.w) {
  50932. M.activeTexture(S.TEXTURE0),
  50933. M.bindTexture(S.TEXTURE_2D, null),
  50934. M.activeTexture(S.TEXTURE1),
  50935. M.bindTexture(S.TEXTURE_2D, T),
  50936. S.copyTexImage2D(S.TEXTURE_2D, 0, S.RGB, i.x + h.x - 8, i.y + h.y - 8, 16, 16, 0),
  50937. S.uniform1i(b.renderType, 0),
  50938. S.uniform2f(b.scale, l.x, l.y),
  50939. S.uniform3f(b.screenPosition, c.x, c.y, c.z),
  50940. M.disable(S.BLEND),
  50941. M.enable(S.DEPTH_TEST),
  50942. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0),
  50943. M.activeTexture(S.TEXTURE0),
  50944. M.bindTexture(S.TEXTURE_2D, x),
  50945. S.copyTexImage2D(S.TEXTURE_2D, 0, S.RGBA, i.x + h.x - 8, i.y + h.y - 8, 16, 16, 0),
  50946. S.uniform1i(b.renderType, 1),
  50947. M.disable(S.DEPTH_TEST),
  50948. M.activeTexture(S.TEXTURE1),
  50949. M.bindTexture(S.TEXTURE_2D, T),
  50950. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0),
  50951. p.positionScreen.copy(c),
  50952. p.customUpdateCallback ? p.customUpdateCallback(p) : p.updateLensFlares(),
  50953. S.uniform1i(b.renderType, 2),
  50954. M.enable(S.BLEND);
  50955. for (var f = 0, g = p.lensFlares.length; f < g; f++) {
  50956. var m = p.lensFlares[f];
  50957. .001 < m.opacity && .001 < m.scale && (c.x = m.x,
  50958. c.y = m.y,
  50959. c.z = m.z,
  50960. s = m.size * m.scale / i.w,
  50961. l.x = s * r,
  50962. l.y = s,
  50963. S.uniform3f(b.screenPosition, c.x, c.y, c.z),
  50964. S.uniform2f(b.scale, l.x, l.y),
  50965. S.uniform1f(b.rotation, m.rotation),
  50966. S.uniform1f(b.opacity, m.opacity),
  50967. S.uniform3f(b.color, m.color.r, m.color.g, m.color.b),
  50968. M.setBlending(m.blending, m.blendEquation, m.blendSrc, m.blendDst),
  50969. v.setTexture(m.texture, 1),
  50970. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0))
  50971. }
  50972. }
  50973. }
  50974. M.enable(S.CULL_FACE),
  50975. M.enable(S.DEPTH_TEST),
  50976. M.setDepthWrite(!0),
  50977. v.resetGLState()
  50978. }
  50979. }
  50980. }
  50981. ,
  50982. Ci.SpritePlugin = function(u, d) {
  50983. function p() {
  50984. var e = new Float32Array([-.5, -.5, 0, 0, .5, -.5, 1, 0, .5, .5, 1, 1, -.5, .5, 0, 1])
  50985. , t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  50986. g = I.createBuffer(),
  50987. m = I.createBuffer(),
  50988. I.bindBuffer(I.ARRAY_BUFFER, g),
  50989. I.bufferData(I.ARRAY_BUFFER, e, I.STATIC_DRAW),
  50990. I.bindBuffer(I.ELEMENT_ARRAY_BUFFER, m),
  50991. I.bufferData(I.ELEMENT_ARRAY_BUFFER, t, I.STATIC_DRAW),
  50992. v = function() {
  50993. var e = I.createProgram()
  50994. , t = I.createShader(I.VERTEX_SHADER)
  50995. , i = I.createShader(I.FRAGMENT_SHADER);
  50996. return I.shaderSource(t, ["precision " + u.getPrecision() + " float;", "uniform mat4 modelViewMatrix;", "uniform mat4 projectionMatrix;", "uniform float rotation;", "uniform vec2 scale;", "uniform vec2 uvOffset;", "uniform vec2 uvScale;", "attribute vec2 position;", "attribute vec2 uv;", "varying vec2 vUV;", "void main() {", "vUV = uvOffset + uv * uvScale;", "vec2 alignedPosition = position * scale;", "vec2 rotatedPosition;", "rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;", "rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;", "vec4 finalPosition;", "finalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );", "finalPosition.xy += rotatedPosition;", "finalPosition = projectionMatrix * finalPosition;", "gl_Position = finalPosition;", "}"].join("\n")),
  50997. I.shaderSource(i, ["precision " + u.getPrecision() + " float;", "uniform vec3 color;", "uniform sampler2D map;", "uniform float opacity;", "uniform int fogType;", "uniform vec3 fogColor;", "uniform float fogDensity;", "uniform float fogNear;", "uniform float fogFar;", "uniform float alphaTest;", "varying vec2 vUV;", "void main() {", "vec4 texture = texture2D( map, vUV );", "if ( texture.a < alphaTest ) discard;", "gl_FragColor = vec4( color * texture.xyz, texture.a * opacity );", "if ( fogType > 0 ) {", "float depth = gl_FragCoord.z / gl_FragCoord.w;", "float fogFactor = 0.0;", "if ( fogType == 1 ) {", "fogFactor = smoothstep( fogNear, fogFar, depth );", "} else {", "const float LOG2 = 1.442695;", "fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );", "fogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );", "}", "gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );", "}", "}"].join("\n")),
  50998. I.compileShader(t),
  50999. I.compileShader(i),
  51000. I.attachShader(e, t),
  51001. I.attachShader(e, i),
  51002. I.linkProgram(e),
  51003. e
  51004. }(),
  51005. y = {
  51006. position: I.getAttribLocation(v, "position"),
  51007. uv: I.getAttribLocation(v, "uv")
  51008. },
  51009. A = {
  51010. uvOffset: I.getUniformLocation(v, "uvOffset"),
  51011. uvScale: I.getUniformLocation(v, "uvScale"),
  51012. rotation: I.getUniformLocation(v, "rotation"),
  51013. scale: I.getUniformLocation(v, "scale"),
  51014. color: I.getUniformLocation(v, "color"),
  51015. map: I.getUniformLocation(v, "map"),
  51016. opacity: I.getUniformLocation(v, "opacity"),
  51017. modelViewMatrix: I.getUniformLocation(v, "modelViewMatrix"),
  51018. projectionMatrix: I.getUniformLocation(v, "projectionMatrix"),
  51019. fogType: I.getUniformLocation(v, "fogType"),
  51020. fogDensity: I.getUniformLocation(v, "fogDensity"),
  51021. fogNear: I.getUniformLocation(v, "fogNear"),
  51022. fogFar: I.getUniformLocation(v, "fogFar"),
  51023. fogColor: I.getUniformLocation(v, "fogColor"),
  51024. alphaTest: I.getUniformLocation(v, "alphaTest")
  51025. };
  51026. var i = document.createElement("canvas");
  51027. i.width = 8,
  51028. i.height = 8;
  51029. var n = i.getContext("2d");
  51030. n.fillStyle = "white",
  51031. n.fillRect(0, 0, 8, 8),
  51032. (C = new Ci.Texture(i)).needsUpdate = !0
  51033. }
  51034. function f(e, t) {
  51035. return e.renderOrder !== t.renderOrder ? e.renderOrder - t.renderOrder : e.z !== t.z ? t.z - e.z : t.id - e.id
  51036. }
  51037. var g, m, v, y, A, C, I = u.context, E = u.state, _ = new Ci.Vector3, b = new Ci.Quaternion, w = new Ci.Vector3;
  51038. this.render = function(e, t) {
  51039. if (0 !== d.length) {
  51040. void 0 === v && p(),
  51041. I.useProgram(v),
  51042. E.initAttributes(),
  51043. E.enableAttribute(y.position),
  51044. E.enableAttribute(y.uv),
  51045. E.disableUnusedAttributes(),
  51046. E.disable(I.CULL_FACE),
  51047. E.enable(I.BLEND),
  51048. I.bindBuffer(I.ARRAY_BUFFER, g),
  51049. I.vertexAttribPointer(y.position, 2, I.FLOAT, !1, 16, 0),
  51050. I.vertexAttribPointer(y.uv, 2, I.FLOAT, !1, 16, 8),
  51051. I.bindBuffer(I.ELEMENT_ARRAY_BUFFER, m),
  51052. I.uniformMatrix4fv(A.projectionMatrix, !1, t.projectionMatrix.elements),
  51053. E.activeTexture(I.TEXTURE0),
  51054. I.uniform1i(A.map, 0);
  51055. var i = 0
  51056. , n = 0
  51057. , r = e.fog;
  51058. r ? (I.uniform3f(A.fogColor, r.color.r, r.color.g, r.color.b),
  51059. r instanceof Ci.Fog ? (I.uniform1f(A.fogNear, r.near),
  51060. I.uniform1f(A.fogFar, r.far),
  51061. I.uniform1i(A.fogType, 1),
  51062. n = i = 1) : r instanceof Ci.FogExp2 && (I.uniform1f(A.fogDensity, r.density),
  51063. I.uniform1i(A.fogType, 2),
  51064. n = i = 2)) : (I.uniform1i(A.fogType, 0),
  51065. n = i = 0);
  51066. for (var o = 0, a = d.length; o < a; o++) {
  51067. (l = d[o]).modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, l.matrixWorld),
  51068. l.z = -l.modelViewMatrix.elements[14]
  51069. }
  51070. d.sort(f);
  51071. var s = [];
  51072. for (o = 0,
  51073. a = d.length; o < a; o++) {
  51074. var l, c = (l = d[o]).material;
  51075. I.uniform1f(A.alphaTest, c.alphaTest),
  51076. I.uniformMatrix4fv(A.modelViewMatrix, !1, l.modelViewMatrix.elements),
  51077. l.matrixWorld.decompose(_, b, w),
  51078. s[0] = w.x,
  51079. s[1] = w.y;
  51080. var h = 0;
  51081. e.fog && c.fog && (h = n),
  51082. i !== h && (I.uniform1i(A.fogType, h),
  51083. i = h),
  51084. null !== c.map ? (I.uniform2f(A.uvOffset, c.map.offset.x, c.map.offset.y),
  51085. I.uniform2f(A.uvScale, c.map.repeat.x, c.map.repeat.y)) : (I.uniform2f(A.uvOffset, 0, 0),
  51086. I.uniform2f(A.uvScale, 1, 1)),
  51087. I.uniform1f(A.opacity, c.opacity),
  51088. I.uniform3f(A.color, c.color.r, c.color.g, c.color.b),
  51089. I.uniform1f(A.rotation, c.rotation),
  51090. I.uniform2fv(A.scale, s),
  51091. E.setBlending(c.blending, c.blendEquation, c.blendSrc, c.blendDst),
  51092. E.setDepthTest(c.depthTest),
  51093. E.setDepthWrite(c.depthWrite),
  51094. c.map && c.map.image && c.map.image.width ? u.setTexture(c.map, 0) : u.setTexture(C, 0),
  51095. I.drawElements(I.TRIANGLES, 6, I.UNSIGNED_SHORT, 0)
  51096. }
  51097. E.enable(I.CULL_FACE),
  51098. u.resetGLState()
  51099. }
  51100. }
  51101. }
  51102. ,
  51103. Object.defineProperties(Ci.Box2.prototype, {
  51104. empty: {
  51105. value: function() {
  51106. return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),
  51107. this.isEmpty()
  51108. }
  51109. },
  51110. isIntersectionBox: {
  51111. value: function(e) {
  51112. return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),
  51113. this.intersectsBox(e)
  51114. }
  51115. }
  51116. }),
  51117. Object.defineProperties(Ci.Box3.prototype, {
  51118. empty: {
  51119. value: function() {
  51120. return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),
  51121. this.isEmpty()
  51122. }
  51123. },
  51124. isIntersectionBox: {
  51125. value: function(e) {
  51126. return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),
  51127. this.intersectsBox(e)
  51128. }
  51129. },
  51130. isIntersectionSphere: {
  51131. value: function(e) {
  51132. return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  51133. this.intersectsSphere(e)
  51134. }
  51135. }
  51136. }),
  51137. Object.defineProperties(Ci.Matrix3.prototype, {
  51138. multiplyVector3: {
  51139. value: function(e) {
  51140. return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),
  51141. e.applyMatrix3(this)
  51142. }
  51143. },
  51144. multiplyVector3Array: {
  51145. value: function(e) {
  51146. return console.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  51147. this.applyToVector3Array(e)
  51148. }
  51149. }
  51150. }),
  51151. Object.defineProperties(Ci.Matrix4.prototype, {
  51152. extractPosition: {
  51153. value: function(e) {
  51154. return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),
  51155. this.copyPosition(e)
  51156. }
  51157. },
  51158. setRotationFromQuaternion: {
  51159. value: function(e) {
  51160. return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),
  51161. this.makeRotationFromQuaternion(e)
  51162. }
  51163. },
  51164. multiplyVector3: {
  51165. value: function(e) {
  51166. return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead."),
  51167. e.applyProjection(this)
  51168. }
  51169. },
  51170. multiplyVector4: {
  51171. value: function(e) {
  51172. return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  51173. e.applyMatrix4(this)
  51174. }
  51175. },
  51176. multiplyVector3Array: {
  51177. value: function(e) {
  51178. return console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  51179. this.applyToVector3Array(e)
  51180. }
  51181. },
  51182. rotateAxis: {
  51183. value: function(e) {
  51184. console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),
  51185. e.transformDirection(this)
  51186. }
  51187. },
  51188. crossVector: {
  51189. value: function(e) {
  51190. return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  51191. e.applyMatrix4(this)
  51192. }
  51193. },
  51194. translate: {
  51195. value: function(e) {
  51196. console.error("THREE.Matrix4: .translate() has been removed.")
  51197. }
  51198. },
  51199. rotateX: {
  51200. value: function(e) {
  51201. console.error("THREE.Matrix4: .rotateX() has been removed.")
  51202. }
  51203. },
  51204. rotateY: {
  51205. value: function(e) {
  51206. console.error("THREE.Matrix4: .rotateY() has been removed.")
  51207. }
  51208. },
  51209. rotateZ: {
  51210. value: function(e) {
  51211. console.error("THREE.Matrix4: .rotateZ() has been removed.")
  51212. }
  51213. },
  51214. rotateByAxis: {
  51215. value: function(e, t) {
  51216. console.error("THREE.Matrix4: .rotateByAxis() has been removed.")
  51217. }
  51218. }
  51219. }),
  51220. Object.defineProperties(Ci.Plane.prototype, {
  51221. isIntersectionLine: {
  51222. value: function(e) {
  51223. return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),
  51224. this.intersectsLine(e)
  51225. }
  51226. }
  51227. }),
  51228. Object.defineProperties(Ci.Quaternion.prototype, {
  51229. multiplyVector3: {
  51230. value: function(e) {
  51231. return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),
  51232. e.applyQuaternion(this)
  51233. }
  51234. }
  51235. }),
  51236. Object.defineProperties(Ci.Ray.prototype, {
  51237. isIntersectionBox: {
  51238. value: function(e) {
  51239. return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),
  51240. this.intersectsBox(e)
  51241. }
  51242. },
  51243. isIntersectionPlane: {
  51244. value: function(e) {
  51245. return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),
  51246. this.intersectsPlane(e)
  51247. }
  51248. },
  51249. isIntersectionSphere: {
  51250. value: function(e) {
  51251. return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  51252. this.intersectsSphere(e)
  51253. }
  51254. }
  51255. }),
  51256. Object.defineProperties(Ci.Vector3.prototype, {
  51257. setEulerFromRotationMatrix: {
  51258. value: function() {
  51259. console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")
  51260. }
  51261. },
  51262. setEulerFromQuaternion: {
  51263. value: function() {
  51264. console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")
  51265. }
  51266. },
  51267. getPositionFromMatrix: {
  51268. value: function(e) {
  51269. return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),
  51270. this.setFromMatrixPosition(e)
  51271. }
  51272. },
  51273. getScaleFromMatrix: {
  51274. value: function(e) {
  51275. return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),
  51276. this.setFromMatrixScale(e)
  51277. }
  51278. },
  51279. getColumnFromMatrix: {
  51280. value: function(e, t) {
  51281. return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),
  51282. this.setFromMatrixColumn(e, t)
  51283. }
  51284. }
  51285. }),
  51286. Ci.Face4 = function(e, t, i, n, r, o, a) {
  51287. return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),
  51288. new Ci.Face3(e,t,i,r,o,a)
  51289. }
  51290. ,
  51291. Ci.Vertex = function(e, t, i) {
  51292. return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),
  51293. new Ci.Vector3(e,t,i)
  51294. }
  51295. ,
  51296. Object.defineProperties(Ci.Object3D.prototype, {
  51297. eulerOrder: {
  51298. get: function() {
  51299. return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  51300. this.rotation.order
  51301. },
  51302. set: function(e) {
  51303. console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  51304. this.rotation.order = e
  51305. }
  51306. },
  51307. getChildByName: {
  51308. value: function(e) {
  51309. return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),
  51310. this.getObjectByName(e)
  51311. }
  51312. },
  51313. renderDepth: {
  51314. set: function(e) {
  51315. console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")
  51316. }
  51317. },
  51318. translate: {
  51319. value: function(e, t) {
  51320. return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),
  51321. this.translateOnAxis(t, e)
  51322. }
  51323. },
  51324. useQuaternion: {
  51325. get: function() {
  51326. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  51327. },
  51328. set: function(e) {
  51329. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  51330. }
  51331. }
  51332. }),
  51333. Object.defineProperties(Ci, {
  51334. PointCloud: {
  51335. value: function(e, t) {
  51336. return console.warn("THREE.PointCloud has been renamed to THREE.Points."),
  51337. new Ci.Points(e,t)
  51338. }
  51339. },
  51340. ParticleSystem: {
  51341. value: function(e, t) {
  51342. return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),
  51343. new Ci.Points(e,t)
  51344. }
  51345. }
  51346. }),
  51347. Object.defineProperties(Ci.Light.prototype, {
  51348. onlyShadow: {
  51349. set: function(e) {
  51350. console.warn("THREE.Light: .onlyShadow has been removed.")
  51351. }
  51352. },
  51353. shadowCameraFov: {
  51354. set: function(e) {
  51355. console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),
  51356. this.shadow.camera.fov = e
  51357. }
  51358. },
  51359. shadowCameraLeft: {
  51360. set: function(e) {
  51361. console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),
  51362. this.shadow.camera.left = e
  51363. }
  51364. },
  51365. shadowCameraRight: {
  51366. set: function(e) {
  51367. console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),
  51368. this.shadow.camera.right = e
  51369. }
  51370. },
  51371. shadowCameraTop: {
  51372. set: function(e) {
  51373. console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),
  51374. this.shadow.camera.top = e
  51375. }
  51376. },
  51377. shadowCameraBottom: {
  51378. set: function(e) {
  51379. console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),
  51380. this.shadow.camera.bottom = e
  51381. }
  51382. },
  51383. shadowCameraNear: {
  51384. set: function(e) {
  51385. console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),
  51386. this.shadow.camera.near = e
  51387. }
  51388. },
  51389. shadowCameraFar: {
  51390. set: function(e) {
  51391. console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),
  51392. this.shadow.camera.far = e
  51393. }
  51394. },
  51395. shadowCameraVisible: {
  51396. set: function(e) {
  51397. console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")
  51398. }
  51399. },
  51400. shadowBias: {
  51401. set: function(e) {
  51402. console.warn("THREE.Light: .shadowBias is now .shadow.bias."),
  51403. this.shadow.bias = e
  51404. }
  51405. },
  51406. shadowDarkness: {
  51407. set: function(e) {
  51408. console.warn("THREE.Light: .shadowDarkness has been removed.")
  51409. }
  51410. },
  51411. shadowMapWidth: {
  51412. set: function(e) {
  51413. console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),
  51414. this.shadow.mapSize.width = e
  51415. }
  51416. },
  51417. shadowMapHeight: {
  51418. set: function(e) {
  51419. console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),
  51420. this.shadow.mapSize.height = e
  51421. }
  51422. }
  51423. }),
  51424. Object.defineProperties(Ci.BufferAttribute.prototype, {
  51425. length: {
  51426. get: function() {
  51427. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  51428. this.array.length
  51429. }
  51430. }
  51431. }),
  51432. Object.defineProperties(Ci.BufferGeometry.prototype, {
  51433. drawcalls: {
  51434. get: function() {
  51435. return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),
  51436. this.groups
  51437. }
  51438. },
  51439. offsets: {
  51440. get: function() {
  51441. return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),
  51442. this.groups
  51443. }
  51444. },
  51445. addIndex: {
  51446. value: function(e) {
  51447. console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),
  51448. this.setIndex(e)
  51449. }
  51450. },
  51451. addDrawCall: {
  51452. value: function(e, t, i) {
  51453. void 0 !== i && console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),
  51454. console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),
  51455. this.addGroup(e, t)
  51456. }
  51457. },
  51458. clearDrawCalls: {
  51459. value: function() {
  51460. console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),
  51461. this.clearGroups()
  51462. }
  51463. },
  51464. computeTangents: {
  51465. value: function() {
  51466. console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")
  51467. }
  51468. },
  51469. computeOffsets: {
  51470. value: function() {
  51471. console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")
  51472. }
  51473. }
  51474. }),
  51475. Object.defineProperties(Ci.Material.prototype, {
  51476. wrapAround: {
  51477. get: function() {
  51478. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  51479. },
  51480. set: function(e) {
  51481. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  51482. }
  51483. },
  51484. wrapRGB: {
  51485. get: function() {
  51486. return console.warn("THREE." + this.type + ": .wrapRGB has been removed."),
  51487. new Ci.Color
  51488. }
  51489. }
  51490. }),
  51491. Object.defineProperties(Ci, {
  51492. PointCloudMaterial: {
  51493. value: function(e) {
  51494. return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),
  51495. new Ci.PointsMaterial(e)
  51496. }
  51497. },
  51498. ParticleBasicMaterial: {
  51499. value: function(e) {
  51500. return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),
  51501. new Ci.PointsMaterial(e)
  51502. }
  51503. },
  51504. ParticleSystemMaterial: {
  51505. value: function(e) {
  51506. return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),
  51507. new Ci.PointsMaterial(e)
  51508. }
  51509. }
  51510. }),
  51511. Object.defineProperties(Ci.MeshPhongMaterial.prototype, {
  51512. metal: {
  51513. get: function() {
  51514. return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),
  51515. !1
  51516. },
  51517. set: function(e) {
  51518. console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")
  51519. }
  51520. }
  51521. }),
  51522. Object.defineProperties(Ci.ShaderMaterial.prototype, {
  51523. derivatives: {
  51524. get: function() {
  51525. return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  51526. this.extensions.derivatives
  51527. },
  51528. set: function(e) {
  51529. console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  51530. this.extensions.derivatives = e
  51531. }
  51532. }
  51533. }),
  51534. Object.defineProperties(Ci.WebGLRenderer.prototype, {
  51535. supportsFloatTextures: {
  51536. value: function() {
  51537. return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),
  51538. this.extensions.get("OES_texture_float")
  51539. }
  51540. },
  51541. supportsHalfFloatTextures: {
  51542. value: function() {
  51543. return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),
  51544. this.extensions.get("OES_texture_half_float")
  51545. }
  51546. },
  51547. supportsStandardDerivatives: {
  51548. value: function() {
  51549. return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),
  51550. this.extensions.get("OES_standard_derivatives")
  51551. }
  51552. },
  51553. supportsCompressedTextureS3TC: {
  51554. value: function() {
  51555. return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),
  51556. this.extensions.get("WEBGL_compressed_texture_s3tc")
  51557. }
  51558. },
  51559. supportsCompressedTexturePVRTC: {
  51560. value: function() {
  51561. return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),
  51562. this.extensions.get("WEBGL_compressed_texture_pvrtc")
  51563. }
  51564. },
  51565. supportsBlendMinMax: {
  51566. value: function() {
  51567. return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),
  51568. this.extensions.get("EXT_blend_minmax")
  51569. }
  51570. },
  51571. supportsVertexTextures: {
  51572. value: function() {
  51573. return this.capabilities.vertexTextures
  51574. }
  51575. },
  51576. supportsInstancedArrays: {
  51577. value: function() {
  51578. return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),
  51579. this.extensions.get("ANGLE_instanced_arrays")
  51580. }
  51581. },
  51582. enableScissorTest: {
  51583. value: function(e) {
  51584. console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),
  51585. this.setScissorTest(e)
  51586. }
  51587. },
  51588. initMaterial: {
  51589. value: function() {
  51590. console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")
  51591. }
  51592. },
  51593. addPrePlugin: {
  51594. value: function() {
  51595. console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")
  51596. }
  51597. },
  51598. addPostPlugin: {
  51599. value: function() {
  51600. console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")
  51601. }
  51602. },
  51603. updateShadowMap: {
  51604. value: function() {
  51605. console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")
  51606. }
  51607. },
  51608. shadowMapEnabled: {
  51609. get: function() {
  51610. return this.shadowMap.enabled
  51611. },
  51612. set: function(e) {
  51613. console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),
  51614. this.shadowMap.enabled = e
  51615. }
  51616. },
  51617. shadowMapType: {
  51618. get: function() {
  51619. return this.shadowMap.type
  51620. },
  51621. set: function(e) {
  51622. console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),
  51623. this.shadowMap.type = e
  51624. }
  51625. },
  51626. shadowMapCullFace: {
  51627. get: function() {
  51628. return this.shadowMap.cullFace
  51629. },
  51630. set: function(e) {
  51631. console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace."),
  51632. this.shadowMap.cullFace = e
  51633. }
  51634. }
  51635. }),
  51636. Object.defineProperties(Ci.WebGLRenderTarget.prototype, {
  51637. wrapS: {
  51638. get: function() {
  51639. return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  51640. this.texture.wrapS
  51641. },
  51642. set: function(e) {
  51643. console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  51644. this.texture.wrapS = e
  51645. }
  51646. },
  51647. wrapT: {
  51648. get: function() {
  51649. return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  51650. this.texture.wrapT
  51651. },
  51652. set: function(e) {
  51653. console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  51654. this.texture.wrapT = e
  51655. }
  51656. },
  51657. magFilter: {
  51658. get: function() {
  51659. return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  51660. this.texture.magFilter
  51661. },
  51662. set: function(e) {
  51663. console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  51664. this.texture.magFilter = e
  51665. }
  51666. },
  51667. minFilter: {
  51668. get: function() {
  51669. return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  51670. this.texture.minFilter
  51671. },
  51672. set: function(e) {
  51673. console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  51674. this.texture.minFilter = e
  51675. }
  51676. },
  51677. anisotropy: {
  51678. get: function() {
  51679. return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  51680. this.texture.anisotropy
  51681. },
  51682. set: function(e) {
  51683. console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  51684. this.texture.anisotropy = e
  51685. }
  51686. },
  51687. offset: {
  51688. get: function() {
  51689. return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  51690. this.texture.offset
  51691. },
  51692. set: function(e) {
  51693. console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  51694. this.texture.offset = e
  51695. }
  51696. },
  51697. repeat: {
  51698. get: function() {
  51699. return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  51700. this.texture.repeat
  51701. },
  51702. set: function(e) {
  51703. console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  51704. this.texture.repeat = e
  51705. }
  51706. },
  51707. format: {
  51708. get: function() {
  51709. return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  51710. this.texture.format
  51711. },
  51712. set: function(e) {
  51713. console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  51714. this.texture.format = e
  51715. }
  51716. },
  51717. type: {
  51718. get: function() {
  51719. return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  51720. this.texture.type
  51721. },
  51722. set: function(e) {
  51723. console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  51724. this.texture.type = e
  51725. }
  51726. },
  51727. generateMipmaps: {
  51728. get: function() {
  51729. return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  51730. this.texture.generateMipmaps
  51731. },
  51732. set: function(e) {
  51733. console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  51734. this.texture.generateMipmaps = e
  51735. }
  51736. }
  51737. }),
  51738. Ci.GeometryUtils = {
  51739. merge: function(e, t, i) {
  51740. var n;
  51741. console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead."),
  51742. t instanceof Ci.Mesh && (t.matrixAutoUpdate && t.updateMatrix(),
  51743. n = t.matrix,
  51744. t = t.geometry),
  51745. e.merge(t, n, i)
  51746. },
  51747. center: function(e) {
  51748. return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),
  51749. e.center()
  51750. }
  51751. },
  51752. Ci.ImageUtils = {
  51753. crossOrigin: void 0,
  51754. loadTexture: function(e, t, i, n) {
  51755. console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");
  51756. var r = new Ci.TextureLoader;
  51757. r.setCrossOrigin(this.crossOrigin);
  51758. var o = r.load(e, i, void 0, n);
  51759. return t && (o.mapping = t),
  51760. o
  51761. },
  51762. loadTextureCube: function(e, t, i, n) {
  51763. console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");
  51764. var r = new Ci.CubeTextureLoader;
  51765. r.setCrossOrigin(this.crossOrigin);
  51766. var o = r.load(e, i, void 0, n);
  51767. return t && (o.mapping = t),
  51768. o
  51769. },
  51770. loadCompressedTexture: function() {
  51771. console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")
  51772. },
  51773. loadCompressedTextureCube: function() {
  51774. console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")
  51775. }
  51776. },
  51777. Ci.Projector = function() {
  51778. console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),
  51779. this.projectVector = function(e, t) {
  51780. console.warn("THREE.Projector: .projectVector() is now vector.project()."),
  51781. e.project(t)
  51782. }
  51783. ,
  51784. this.unprojectVector = function(e, t) {
  51785. console.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),
  51786. e.unproject(t)
  51787. }
  51788. ,
  51789. this.pickingRay = function(e, t) {
  51790. console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")
  51791. }
  51792. }
  51793. ,
  51794. Ci.CanvasRenderer = function() {
  51795. console.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"),
  51796. this.domElement = document.createElement("canvas"),
  51797. this.clear = function() {}
  51798. ,
  51799. this.render = function() {}
  51800. ,
  51801. this.setClearColor = function() {}
  51802. ,
  51803. this.setSize = function() {}
  51804. }
  51805. ,
  51806. Ci.MeshFaceMaterial = Ci.MultiMaterial,
  51807. Ci.CurveUtils = {
  51808. tangentQuadraticBezier: function(e, t, i, n) {
  51809. return 2 * (1 - e) * (i - t) + 2 * e * (n - i)
  51810. },
  51811. tangentCubicBezier: function(e, t, i, n, r) {
  51812. 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
  51813. },
  51814. tangentSpline: function(e, t, i, n, r) {
  51815. return 6 * e * e - 6 * e + (3 * e * e - 4 * e + 1) + (-6 * e * e + 6 * e) + (3 * e * e - 2 * e)
  51816. },
  51817. interpolate: function(e, t, i, n, r) {
  51818. var o = .5 * (i - e)
  51819. , a = .5 * (n - t)
  51820. , s = r * r;
  51821. return (2 * t - 2 * i + o + a) * (r * s) + (-3 * t + 3 * i - 2 * o - a) * s + o * r + t
  51822. }
  51823. },
  51824. Ci.SceneUtils = {
  51825. createMultiMaterialObject: function(e, t) {
  51826. for (var i = new Ci.Group, n = 0, r = t.length; n < r; n++)
  51827. i.add(new Ci.Mesh(e,t[n]));
  51828. return i
  51829. },
  51830. detach: function(e, t, i) {
  51831. e.applyMatrix(t.matrixWorld),
  51832. t.remove(e),
  51833. i.add(e)
  51834. },
  51835. attach: function(e, t, i) {
  51836. var n = new Ci.Matrix4;
  51837. n.getInverse(i.matrixWorld),
  51838. e.applyMatrix(n),
  51839. t.remove(e),
  51840. i.add(e)
  51841. }
  51842. },
  51843. Ci.ShapeUtils = {
  51844. area: function(e) {
  51845. for (var t = e.length, i = 0, n = t - 1, r = 0; r < t; n = r++)
  51846. i += e[n].x * e[r].y - e[r].x * e[n].y;
  51847. return .5 * i
  51848. },
  51849. triangulate: function(e, t) {
  51850. var i = e.length;
  51851. if (i < 3)
  51852. return null;
  51853. var n, r, o, a = [], s = [], l = [];
  51854. if (0 < Ci.ShapeUtils.area(e))
  51855. for (r = 0; r < i; r++)
  51856. s[r] = r;
  51857. else
  51858. for (r = 0; r < i; r++)
  51859. s[r] = i - 1 - r;
  51860. var c = i
  51861. , h = 2 * c;
  51862. for (r = c - 1; 2 < c; ) {
  51863. if (h-- <= 0)
  51864. return console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()"),
  51865. t ? l : a;
  51866. if (c <= (n = r) && (n = 0),
  51867. c <= (r = n + 1) && (r = 0),
  51868. c <= (o = r + 1) && (o = 0),
  51869. Si(e, n, r, o, c, s)) {
  51870. var u, d, p, f, g;
  51871. for (u = s[n],
  51872. d = s[r],
  51873. p = s[o],
  51874. a.push([e[u], e[d], e[p]]),
  51875. l.push([s[n], s[r], s[o]]),
  51876. g = (f = r) + 1; g < c; f++,
  51877. g++)
  51878. s[f] = s[g];
  51879. h = 2 * --c
  51880. }
  51881. }
  51882. return t ? l : a
  51883. },
  51884. triangulateShape: function(e, t) {
  51885. function w(e, t, i) {
  51886. 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
  51887. }
  51888. function b(e, t, i, n, r) {
  51889. var o = t.x - e.x
  51890. , a = t.y - e.y
  51891. , s = n.x - i.x
  51892. , l = n.y - i.y
  51893. , c = e.x - i.x
  51894. , h = e.y - i.y
  51895. , u = a * s - o * l
  51896. , d = a * c - o * h;
  51897. if (Math.abs(u) > Number.EPSILON) {
  51898. var p;
  51899. if (0 < u) {
  51900. if (d < 0 || u < d)
  51901. return [];
  51902. if ((p = l * c - s * h) < 0 || u < p)
  51903. return []
  51904. } else {
  51905. if (0 < d || d < u)
  51906. return [];
  51907. if (0 < (p = l * c - s * h) || p < u)
  51908. return []
  51909. }
  51910. if (0 === p)
  51911. return !r || 0 != d && d != u ? [e] : [];
  51912. if (p === u)
  51913. return !r || 0 != d && d != u ? [t] : [];
  51914. if (0 == d)
  51915. return [i];
  51916. if (d == u)
  51917. return [n];
  51918. var f = p / u;
  51919. return [{
  51920. x: e.x + f * o,
  51921. y: e.y + f * a
  51922. }]
  51923. }
  51924. if (0 != d || l * c != s * h)
  51925. return [];
  51926. var g, m, v, y, A, C, I, E, _ = 0 == o && 0 == a, b = 0 == s && 0 == l;
  51927. return _ && b ? e.x !== i.x || e.y !== i.y ? [] : [e] : _ ? w(i, n, e) ? [e] : [] : b ? w(e, t, i) ? [i] : [] : (E = 0 != o ? (y = e.x < t.x ? (v = (g = e).x,
  51928. (m = t).x) : (v = (g = t).x,
  51929. (m = e).x),
  51930. i.x < n.x ? (I = (A = i).x,
  51931. (C = n).x) : (I = (A = n).x,
  51932. (C = i).x)) : (y = e.y < t.y ? (v = (g = e).y,
  51933. (m = t).y) : (v = (g = t).y,
  51934. (m = e).y),
  51935. i.y < n.y ? (I = (A = i).y,
  51936. (C = n).y) : (I = (A = n).y,
  51937. (C = i).y)),
  51938. v <= I ? y < I ? [] : y === I ? r ? [] : [A] : y <= E ? [A, m] : [A, C] : E < v ? [] : v === E ? r ? [] : [g] : y <= E ? [g, m] : [g, C])
  51939. }
  51940. function T(e, t, i, n) {
  51941. var r = t.x - e.x
  51942. , o = t.y - e.y
  51943. , a = i.x - e.x
  51944. , s = i.y - e.y
  51945. , l = n.x - e.x
  51946. , c = n.y - e.y
  51947. , h = r * s - o * a
  51948. , u = r * c - o * l;
  51949. if (Math.abs(h) > Number.EPSILON) {
  51950. var d = l * s - c * a;
  51951. return 0 < h ? 0 <= u && 0 <= d : 0 <= u || 0 <= d
  51952. }
  51953. return 0 < u
  51954. }
  51955. for (var i, n, r, o, a, s, l = {}, c = e.concat(), h = 0, u = t.length; h < u; h++)
  51956. Array.prototype.push.apply(c, t[h]);
  51957. for (i = 0,
  51958. n = c.length; i < n; i++)
  51959. void 0 !== l[a = c[i].x + ":" + c[i].y] && console.warn("THREE.Shape: Duplicate point", a),
  51960. l[a] = i;
  51961. var d = function(e, a) {
  51962. function t(e, t) {
  51963. var i = m.length - 1
  51964. , n = e - 1;
  51965. n < 0 && (n = i);
  51966. var r = e + 1;
  51967. i < r && (r = 0);
  51968. var o = T(m[e], m[n], m[r], c[t]);
  51969. if (!o)
  51970. return !1;
  51971. var a = c.length - 1
  51972. , s = t - 1;
  51973. s < 0 && (s = a);
  51974. var l = t + 1;
  51975. return a < l && (l = 0),
  51976. !!(o = T(c[t], c[s], c[l], m[e]))
  51977. }
  51978. function i(e, t) {
  51979. var i, n;
  51980. for (i = 0; i < m.length; i++)
  51981. if (n = i + 1,
  51982. n %= m.length,
  51983. 0 < b(e, t, m[i], m[n], !0).length)
  51984. return !0;
  51985. return !1
  51986. }
  51987. function n(e, t) {
  51988. var i, n, r, o;
  51989. for (i = 0; i < v.length; i++)
  51990. for (n = a[v[i]],
  51991. r = 0; r < n.length; r++)
  51992. if (o = r + 1,
  51993. o %= n.length,
  51994. 0 < b(e, t, n[r], n[o], !0).length)
  51995. return !0;
  51996. return !1
  51997. }
  51998. for (var c, r, o, s, l, h, u, d, p, f, g, m = e.concat(), v = [], y = [], A = 0, C = a.length; A < C; A++)
  51999. v.push(A);
  52000. for (var I = 0, E = 2 * v.length; 0 < v.length; ) {
  52001. if (--E < 0) {
  52002. console.log("Infinite Loop! Holes left:" + v.length + ", Probably Hole outside Shape!");
  52003. break
  52004. }
  52005. for (o = I; o < m.length; o++) {
  52006. s = m[o],
  52007. r = -1;
  52008. for (A = 0; A < v.length; A++)
  52009. if (h = v[A],
  52010. void 0 === y[u = s.x + ":" + s.y + ":" + h]) {
  52011. c = a[h];
  52012. for (var _ = 0; _ < c.length; _++)
  52013. if (l = c[_],
  52014. t(o, _) && !i(s, l) && !n(s, l)) {
  52015. r = _,
  52016. v.splice(A, 1),
  52017. d = m.slice(0, o + 1),
  52018. p = m.slice(o),
  52019. f = c.slice(r),
  52020. g = c.slice(0, r + 1),
  52021. m = d.concat(f).concat(g).concat(p),
  52022. I = o;
  52023. break
  52024. }
  52025. if (0 <= r)
  52026. break;
  52027. y[u] = !0
  52028. }
  52029. if (0 <= r)
  52030. break
  52031. }
  52032. }
  52033. return m
  52034. }(e, t)
  52035. , p = Ci.ShapeUtils.triangulate(d, !1);
  52036. for (i = 0,
  52037. n = p.length; i < n; i++)
  52038. for (o = p[i],
  52039. r = 0; r < 3; r++)
  52040. void 0 !== (s = l[a = o[r].x + ":" + o[r].y]) && (o[r] = s);
  52041. return p.concat()
  52042. },
  52043. isClockWise: function(e) {
  52044. return Ci.ShapeUtils.area(e) < 0
  52045. },
  52046. b2: function(e, t, i, n) {
  52047. return function(e, t) {
  52048. var i = 1 - e;
  52049. return i * i * t
  52050. }(e, t) + function(e, t) {
  52051. return 2 * (1 - e) * e * t
  52052. }(e, i) + function(e, t) {
  52053. return e * e * t
  52054. }(e, n)
  52055. },
  52056. b3: function(e, t, i, n, r) {
  52057. return function(e, t) {
  52058. var i = 1 - e;
  52059. return i * i * i * t
  52060. }(e, t) + function(e, t) {
  52061. var i = 1 - e;
  52062. return 3 * i * i * e * t
  52063. }(e, i) + function(e, t) {
  52064. return 3 * (1 - e) * e * e * t
  52065. }(e, n) + function(e, t) {
  52066. return e * e * e * t
  52067. }(e, r)
  52068. }
  52069. },
  52070. Ci.Curve = function() {}
  52071. ,
  52072. Ci.Curve.prototype = {
  52073. constructor: Ci.Curve,
  52074. getPoint: function(e) {
  52075. return console.warn("THREE.Curve: Warning, getPoint() not implemented!"),
  52076. null
  52077. },
  52078. getPointAt: function(e) {
  52079. var t = this.getUtoTmapping(e);
  52080. return this.getPoint(t)
  52081. },
  52082. getPoints: function(e) {
  52083. e = e || 5;
  52084. var t, i = [];
  52085. for (t = 0; t <= e; t++)
  52086. i.push(this.getPoint(t / e));
  52087. return i
  52088. },
  52089. getSpacedPoints: function(e) {
  52090. e = e || 5;
  52091. var t, i = [];
  52092. for (t = 0; t <= e; t++)
  52093. i.push(this.getPointAt(t / e));
  52094. return i
  52095. },
  52096. getLength: function() {
  52097. var e = this.getLengths();
  52098. return e[e.length - 1]
  52099. },
  52100. getLengths: function(e) {
  52101. if (e = e || (this.__arcLengthDivisions ? this.__arcLengthDivisions : 200),
  52102. this.cacheArcLengths && this.cacheArcLengths.length === e + 1 && !this.needsUpdate)
  52103. return this.cacheArcLengths;
  52104. this.needsUpdate = !1;
  52105. var t, i, n = [], r = this.getPoint(0), o = 0;
  52106. for (n.push(0),
  52107. i = 1; i <= e; i++)
  52108. o += (t = this.getPoint(i / e)).distanceTo(r),
  52109. n.push(o),
  52110. r = t;
  52111. return this.cacheArcLengths = n
  52112. },
  52113. updateArcLengths: function() {
  52114. this.needsUpdate = !0,
  52115. this.getLengths()
  52116. },
  52117. getUtoTmapping: function(e, t) {
  52118. var i, n = this.getLengths(), r = 0, o = n.length;
  52119. i = t || e * n[o - 1];
  52120. for (var a, s = 0, l = o - 1; s <= l; )
  52121. if ((a = n[r = Math.floor(s + (l - s) / 2)] - i) < 0)
  52122. s = r + 1;
  52123. else {
  52124. if (!(0 < a)) {
  52125. l = r;
  52126. break
  52127. }
  52128. l = r - 1
  52129. }
  52130. if (n[r = l] === i)
  52131. return r / (o - 1);
  52132. var c = n[r];
  52133. return (r + (i - c) / (n[r + 1] - c)) / (o - 1)
  52134. },
  52135. getTangent: function(e) {
  52136. var t = e - 1e-4
  52137. , i = e + 1e-4;
  52138. t < 0 && (t = 0),
  52139. 1 < i && (i = 1);
  52140. var n = this.getPoint(t);
  52141. return this.getPoint(i).clone().sub(n).normalize()
  52142. },
  52143. getTangentAt: function(e) {
  52144. var t = this.getUtoTmapping(e);
  52145. return this.getTangent(t)
  52146. }
  52147. },
  52148. Ci.Curve.create = function(e, t) {
  52149. return e.prototype = Object.create(Ci.Curve.prototype),
  52150. (e.prototype.constructor = e).prototype.getPoint = t,
  52151. e
  52152. }
  52153. ,
  52154. Ci.CurvePath = function() {
  52155. this.curves = [],
  52156. this.autoClose = !1
  52157. }
  52158. ,
  52159. Ci.CurvePath.prototype = Object.create(Ci.Curve.prototype),
  52160. Ci.CurvePath.prototype.constructor = Ci.CurvePath,
  52161. Ci.CurvePath.prototype.add = function(e) {
  52162. this.curves.push(e)
  52163. }
  52164. ,
  52165. Ci.CurvePath.prototype.closePath = function() {
  52166. var e = this.curves[0].getPoint(0)
  52167. , t = this.curves[this.curves.length - 1].getPoint(1);
  52168. e.equals(t) || this.curves.push(new Ci.LineCurve(t,e))
  52169. }
  52170. ,
  52171. Ci.CurvePath.prototype.getPoint = function(e) {
  52172. for (var t = e * this.getLength(), i = this.getCurveLengths(), n = 0; n < i.length; ) {
  52173. if (i[n] >= t) {
  52174. var r = i[n] - t
  52175. , o = this.curves[n]
  52176. , a = 1 - r / o.getLength();
  52177. return o.getPointAt(a)
  52178. }
  52179. n++
  52180. }
  52181. return null
  52182. }
  52183. ,
  52184. Ci.CurvePath.prototype.getLength = function() {
  52185. var e = this.getCurveLengths();
  52186. return e[e.length - 1]
  52187. }
  52188. ,
  52189. Ci.CurvePath.prototype.getCurveLengths = function() {
  52190. if (this.cacheLengths && this.cacheLengths.length === this.curves.length)
  52191. return this.cacheLengths;
  52192. for (var e = [], t = 0, i = 0, n = this.curves.length; i < n; i++)
  52193. t += this.curves[i].getLength(),
  52194. e.push(t);
  52195. return this.cacheLengths = e
  52196. }
  52197. ,
  52198. Ci.CurvePath.prototype.createPointsGeometry = function(e) {
  52199. var t = this.getPoints(e);
  52200. return this.createGeometry(t)
  52201. }
  52202. ,
  52203. Ci.CurvePath.prototype.createSpacedPointsGeometry = function(e) {
  52204. var t = this.getSpacedPoints(e);
  52205. return this.createGeometry(t)
  52206. }
  52207. ,
  52208. Ci.CurvePath.prototype.createGeometry = function(e) {
  52209. for (var t = new Ci.Geometry, i = 0, n = e.length; i < n; i++) {
  52210. var r = e[i];
  52211. t.vertices.push(new Ci.Vector3(r.x,r.y,r.z || 0))
  52212. }
  52213. return t
  52214. }
  52215. ,
  52216. Ci.Font = function(e) {
  52217. this.data = e
  52218. }
  52219. ,
  52220. Ci.Font.prototype = {
  52221. constructor: Ci.Font,
  52222. generateShapes: function(e, s, b) {
  52223. function l(e, t, i) {
  52224. var n = w.glyphs[e] || w.glyphs["?"];
  52225. if (n) {
  52226. var r, o, a, s, l, c, h, u, d, p, f, g = new Ci.Path, m = [], v = Ci.ShapeUtils.b2, y = Ci.ShapeUtils.b3;
  52227. if (n.o)
  52228. for (var A = n._cachedOutline || (n._cachedOutline = n.o.split(" ")), C = 0, I = A.length; C < I; ) {
  52229. switch (A[C++]) {
  52230. case "m":
  52231. r = A[C++] * t + i,
  52232. o = A[C++] * t,
  52233. g.moveTo(r, o);
  52234. break;
  52235. case "l":
  52236. r = A[C++] * t + i,
  52237. o = A[C++] * t,
  52238. g.lineTo(r, o);
  52239. break;
  52240. case "q":
  52241. if (a = A[C++] * t + i,
  52242. s = A[C++] * t,
  52243. h = A[C++] * t + i,
  52244. u = A[C++] * t,
  52245. g.quadraticCurveTo(h, u, a, s),
  52246. f = m[m.length - 1]) {
  52247. l = f.x,
  52248. c = f.y;
  52249. for (var E = 1; E <= b; E++) {
  52250. v(_ = E / b, l, h, a),
  52251. v(_, c, u, s)
  52252. }
  52253. }
  52254. break;
  52255. case "b":
  52256. if (a = A[C++] * t + i,
  52257. s = A[C++] * t,
  52258. h = A[C++] * t + i,
  52259. u = A[C++] * t,
  52260. d = A[C++] * t + i,
  52261. p = A[C++] * t,
  52262. g.bezierCurveTo(h, u, d, p, a, s),
  52263. f = m[m.length - 1]) {
  52264. l = f.x,
  52265. c = f.y;
  52266. for (E = 1; E <= b; E++) {
  52267. var _;
  52268. y(_ = E / b, l, h, d, a),
  52269. y(_, c, u, p, s)
  52270. }
  52271. }
  52272. }
  52273. }
  52274. return {
  52275. offset: n.ha * t,
  52276. path: g
  52277. }
  52278. }
  52279. }
  52280. void 0 === s && (s = 100),
  52281. void 0 === b && (b = 4);
  52282. for (var w = this.data, t = function(e) {
  52283. for (var t = String(e).split(""), i = s / w.resolution, n = 0, r = [], o = 0; o < t.length; o++) {
  52284. var a = l(t[o], i, n);
  52285. n += a.offset,
  52286. r.push(a.path)
  52287. }
  52288. return r
  52289. }(e), i = [], n = 0, r = t.length; n < r; n++)
  52290. Array.prototype.push.apply(i, t[n].toShapes());
  52291. return i
  52292. }
  52293. },
  52294. Ci.Path = function(e) {
  52295. Ci.CurvePath.call(this),
  52296. this.actions = [],
  52297. e && this.fromPoints(e)
  52298. }
  52299. ,
  52300. Ci.Path.prototype = Object.create(Ci.CurvePath.prototype),
  52301. Ci.Path.prototype.constructor = Ci.Path,
  52302. Ci.Path.prototype.fromPoints = function(e) {
  52303. this.moveTo(e[0].x, e[0].y);
  52304. for (var t = 1, i = e.length; t < i; t++)
  52305. this.lineTo(e[t].x, e[t].y)
  52306. }
  52307. ,
  52308. Ci.Path.prototype.moveTo = function(e, t) {
  52309. this.actions.push({
  52310. action: "moveTo",
  52311. args: [e, t]
  52312. })
  52313. }
  52314. ,
  52315. Ci.Path.prototype.lineTo = function(e, t) {
  52316. var i = this.actions[this.actions.length - 1].args
  52317. , n = i[i.length - 2]
  52318. , r = i[i.length - 1]
  52319. , o = new Ci.LineCurve(new Ci.Vector2(n,r),new Ci.Vector2(e,t));
  52320. this.curves.push(o),
  52321. this.actions.push({
  52322. action: "lineTo",
  52323. args: [e, t]
  52324. })
  52325. }
  52326. ,
  52327. Ci.Path.prototype.quadraticCurveTo = function(e, t, i, n) {
  52328. var r = this.actions[this.actions.length - 1].args
  52329. , o = r[r.length - 2]
  52330. , a = r[r.length - 1]
  52331. , s = new Ci.QuadraticBezierCurve(new Ci.Vector2(o,a),new Ci.Vector2(e,t),new Ci.Vector2(i,n));
  52332. this.curves.push(s),
  52333. this.actions.push({
  52334. action: "quadraticCurveTo",
  52335. args: [e, t, i, n]
  52336. })
  52337. }
  52338. ,
  52339. Ci.Path.prototype.bezierCurveTo = function(e, t, i, n, r, o) {
  52340. var a = this.actions[this.actions.length - 1].args
  52341. , s = a[a.length - 2]
  52342. , l = a[a.length - 1]
  52343. , c = new Ci.CubicBezierCurve(new Ci.Vector2(s,l),new Ci.Vector2(e,t),new Ci.Vector2(i,n),new Ci.Vector2(r,o));
  52344. this.curves.push(c),
  52345. this.actions.push({
  52346. action: "bezierCurveTo",
  52347. args: [e, t, i, n, r, o]
  52348. })
  52349. }
  52350. ,
  52351. Ci.Path.prototype.splineThru = function(e) {
  52352. var t = Array.prototype.slice.call(arguments)
  52353. , i = this.actions[this.actions.length - 1].args
  52354. , n = i[i.length - 2]
  52355. , r = i[i.length - 1]
  52356. , o = [new Ci.Vector2(n,r)];
  52357. Array.prototype.push.apply(o, e);
  52358. var a = new Ci.SplineCurve(o);
  52359. this.curves.push(a),
  52360. this.actions.push({
  52361. action: "splineThru",
  52362. args: t
  52363. })
  52364. }
  52365. ,
  52366. Ci.Path.prototype.arc = function(e, t, i, n, r, o) {
  52367. var a = this.actions[this.actions.length - 1].args
  52368. , s = a[a.length - 2]
  52369. , l = a[a.length - 1];
  52370. this.absarc(e + s, t + l, i, n, r, o)
  52371. }
  52372. ,
  52373. Ci.Path.prototype.absarc = function(e, t, i, n, r, o) {
  52374. this.absellipse(e, t, i, i, n, r, o)
  52375. }
  52376. ,
  52377. Ci.Path.prototype.ellipse = function(e, t, i, n, r, o, a, s) {
  52378. var l = this.actions[this.actions.length - 1].args
  52379. , c = l[l.length - 2]
  52380. , h = l[l.length - 1];
  52381. this.absellipse(e + c, t + h, i, n, r, o, a, s)
  52382. }
  52383. ,
  52384. Ci.Path.prototype.absellipse = function(e, t, i, n, r, o, a, s) {
  52385. var l = [e, t, i, n, r, o, a, s || 0]
  52386. , c = new Ci.EllipseCurve(e,t,i,n,r,o,a,s);
  52387. this.curves.push(c);
  52388. var h = c.getPoint(1);
  52389. l.push(h.x),
  52390. l.push(h.y),
  52391. this.actions.push({
  52392. action: "ellipse",
  52393. args: l
  52394. })
  52395. }
  52396. ,
  52397. Ci.Path.prototype.getSpacedPoints = function(e) {
  52398. e = e || 40;
  52399. for (var t = [], i = 0; i < e; i++)
  52400. t.push(this.getPoint(i / e));
  52401. return this.autoClose && t.push(t[0]),
  52402. t
  52403. }
  52404. ,
  52405. Ci.Path.prototype.getPoints = function(e) {
  52406. e = e || 12;
  52407. for (var t, i, n, r, o, a, s, l, c, h, u, d = Ci.ShapeUtils.b2, p = Ci.ShapeUtils.b3, f = [], g = 0, m = this.actions.length; g < m; g++) {
  52408. var v = this.actions[g]
  52409. , y = v.action
  52410. , A = v.args;
  52411. switch (y) {
  52412. case "moveTo":
  52413. case "lineTo":
  52414. f.push(new Ci.Vector2(A[0],A[1]));
  52415. break;
  52416. case "quadraticCurveTo":
  52417. t = A[2],
  52418. i = A[3],
  52419. o = A[0],
  52420. a = A[1],
  52421. l = 0 < f.length ? (s = (c = f[f.length - 1]).x,
  52422. c.y) : (s = (c = this.actions[g - 1].args)[c.length - 2],
  52423. c[c.length - 1]);
  52424. for (var C = 1; C <= e; C++) {
  52425. h = d(O = C / e, s, o, t),
  52426. u = d(O, l, a, i),
  52427. f.push(new Ci.Vector2(h,u))
  52428. }
  52429. break;
  52430. case "bezierCurveTo":
  52431. t = A[4],
  52432. i = A[5],
  52433. o = A[0],
  52434. a = A[1],
  52435. n = A[2],
  52436. r = A[3],
  52437. l = 0 < f.length ? (s = (c = f[f.length - 1]).x,
  52438. c.y) : (s = (c = this.actions[g - 1].args)[c.length - 2],
  52439. c[c.length - 1]);
  52440. for (C = 1; C <= e; C++) {
  52441. h = p(O = C / e, s, o, n, t),
  52442. u = p(O, l, a, r, i),
  52443. f.push(new Ci.Vector2(h,u))
  52444. }
  52445. break;
  52446. case "splineThru":
  52447. c = this.actions[g - 1].args;
  52448. var I = [new Ci.Vector2(c[c.length - 2],c[c.length - 1])]
  52449. , E = e * A[0].length;
  52450. I = I.concat(A[0]);
  52451. var _ = new Ci.SplineCurve(I);
  52452. for (C = 1; C <= E; C++)
  52453. f.push(_.getPointAt(C / E));
  52454. break;
  52455. case "arc":
  52456. var b = A[0]
  52457. , w = A[1]
  52458. , T = A[2]
  52459. , x = A[3]
  52460. , S = A[4]
  52461. , M = !!A[5]
  52462. , R = S - x
  52463. , P = 2 * e;
  52464. for (C = 1; C <= P; C++) {
  52465. var O = C / P;
  52466. M || (O = 1 - O),
  52467. L = x + O * R,
  52468. h = b + T * Math.cos(L),
  52469. u = w + T * Math.sin(L),
  52470. f.push(new Ci.Vector2(h,u))
  52471. }
  52472. break;
  52473. case "ellipse":
  52474. b = A[0],
  52475. w = A[1];
  52476. var L, D, N, F = A[2], B = A[3], V = (x = A[4],
  52477. S = A[5],
  52478. M = !!A[6],
  52479. A[7]);
  52480. R = S - x,
  52481. P = 2 * e;
  52482. 0 !== V && (D = Math.cos(V),
  52483. N = Math.sin(V));
  52484. for (C = 1; C <= P; C++) {
  52485. O = C / P;
  52486. if (M || (O = 1 - O),
  52487. L = x + O * R,
  52488. h = b + F * Math.cos(L),
  52489. u = w + B * Math.sin(L),
  52490. 0 !== V) {
  52491. var k = h;
  52492. h = (k - b) * D - (u - w) * N + b,
  52493. u = (k - b) * N + (u - w) * D + w
  52494. }
  52495. f.push(new Ci.Vector2(h,u))
  52496. }
  52497. }
  52498. }
  52499. var U = f[f.length - 1];
  52500. return Math.abs(U.x - f[0].x) < Number.EPSILON && Math.abs(U.y - f[0].y) < Number.EPSILON && f.splice(f.length - 1, 1),
  52501. this.autoClose && f.push(f[0]),
  52502. f
  52503. }
  52504. ,
  52505. Ci.Path.prototype.toShapes = function(e, t) {
  52506. function i(e) {
  52507. for (var t = [], i = 0, n = e.length; i < n; i++) {
  52508. var r = e[i]
  52509. , o = new Ci.Shape;
  52510. o.actions = r.actions,
  52511. o.curves = r.curves,
  52512. t.push(o)
  52513. }
  52514. return t
  52515. }
  52516. function n(e, t) {
  52517. for (var i = t.length, n = !1, r = i - 1, o = 0; o < i; r = o++) {
  52518. var a = t[r]
  52519. , s = t[o]
  52520. , l = s.x - a.x
  52521. , c = s.y - a.y;
  52522. if (Math.abs(c) > Number.EPSILON) {
  52523. if (c < 0 && (a = t[o],
  52524. l = -l,
  52525. s = t[r],
  52526. c = -c),
  52527. e.y < a.y || e.y > s.y)
  52528. continue;
  52529. if (e.y === a.y) {
  52530. if (e.x === a.x)
  52531. return !0
  52532. } else {
  52533. var h = c * (e.x - a.x) - l * (e.y - a.y);
  52534. if (0 == h)
  52535. return !0;
  52536. if (h < 0)
  52537. continue;
  52538. n = !n
  52539. }
  52540. } else {
  52541. if (e.y !== a.y)
  52542. continue;
  52543. if (s.x <= e.x && e.x <= a.x || a.x <= e.x && e.x <= s.x)
  52544. return !0
  52545. }
  52546. }
  52547. return n
  52548. }
  52549. var r = Ci.ShapeUtils.isClockWise
  52550. , o = function(e) {
  52551. for (var t = [], i = new Ci.Path, n = 0, r = e.length; n < r; n++) {
  52552. var o = e[n]
  52553. , a = o.args
  52554. , s = o.action;
  52555. "moveTo" === s && 0 !== i.actions.length && (t.push(i),
  52556. i = new Ci.Path),
  52557. i[s].apply(i, a)
  52558. }
  52559. return 0 !== i.actions.length && t.push(i),
  52560. t
  52561. }(this.actions);
  52562. if (0 === o.length)
  52563. return [];
  52564. if (!0 === t)
  52565. return i(o);
  52566. var a, s, l, c = [];
  52567. if (1 === o.length)
  52568. return s = o[0],
  52569. (l = new Ci.Shape).actions = s.actions,
  52570. l.curves = s.curves,
  52571. c.push(l),
  52572. c;
  52573. var h = !r(o[0].getPoints());
  52574. h = e ? !h : h;
  52575. var u, d = [], p = [], f = [], g = 0;
  52576. p[g] = void 0,
  52577. f[g] = [];
  52578. for (var m = 0, v = o.length; m < v; m++)
  52579. a = r(u = (s = o[m]).getPoints()),
  52580. (a = e ? !a : a) ? (!h && p[g] && g++,
  52581. p[g] = {
  52582. s: new Ci.Shape,
  52583. p: u
  52584. },
  52585. p[g].s.actions = s.actions,
  52586. p[g].s.curves = s.curves,
  52587. h && g++,
  52588. f[g] = []) : f[g].push({
  52589. h: s,
  52590. p: u[0]
  52591. });
  52592. if (!p[0])
  52593. return i(o);
  52594. if (1 < p.length) {
  52595. for (var y = !1, A = [], C = 0, I = p.length; C < I; C++)
  52596. d[C] = [];
  52597. for (C = 0,
  52598. I = p.length; C < I; C++)
  52599. for (var E = f[C], _ = 0; _ < E.length; _++) {
  52600. for (var b = E[_], w = !0, T = 0; T < p.length; T++)
  52601. n(b.p, p[T].p) && (C !== T && A.push({
  52602. froms: C,
  52603. tos: T,
  52604. hole: _
  52605. }),
  52606. w ? (w = !1,
  52607. d[T].push(b)) : y = !0);
  52608. w && d[C].push(b)
  52609. }
  52610. 0 < A.length && (y || (f = d))
  52611. }
  52612. m = 0;
  52613. for (var x, S = p.length; m < S; m++) {
  52614. l = p[m].s,
  52615. c.push(l);
  52616. for (var M = 0, R = (x = f[m]).length; M < R; M++)
  52617. l.holes.push(x[M].h)
  52618. }
  52619. return c
  52620. }
  52621. ,
  52622. Ci.Shape = function() {
  52623. Ci.Path.apply(this, arguments),
  52624. this.holes = []
  52625. }
  52626. ,
  52627. Ci.Shape.prototype = Object.create(Ci.Path.prototype),
  52628. Ci.Shape.prototype.constructor = Ci.Shape,
  52629. Ci.Shape.prototype.extrude = function(e) {
  52630. return new Ci.ExtrudeGeometry(this,e)
  52631. }
  52632. ,
  52633. Ci.Shape.prototype.makeGeometry = function(e) {
  52634. return new Ci.ShapeGeometry(this,e)
  52635. }
  52636. ,
  52637. Ci.Shape.prototype.getPointsHoles = function(e) {
  52638. for (var t = [], i = 0, n = this.holes.length; i < n; i++)
  52639. t[i] = this.holes[i].getPoints(e);
  52640. return t
  52641. }
  52642. ,
  52643. Ci.Shape.prototype.extractAllPoints = function(e) {
  52644. return {
  52645. shape: this.getPoints(e),
  52646. holes: this.getPointsHoles(e)
  52647. }
  52648. }
  52649. ,
  52650. Ci.Shape.prototype.extractPoints = function(e) {
  52651. return this.extractAllPoints(e)
  52652. }
  52653. ,
  52654. Ci.LineCurve = function(e, t) {
  52655. this.v1 = e,
  52656. this.v2 = t
  52657. }
  52658. ,
  52659. Ci.LineCurve.prototype = Object.create(Ci.Curve.prototype),
  52660. Ci.LineCurve.prototype.constructor = Ci.LineCurve,
  52661. Ci.LineCurve.prototype.getPoint = function(e) {
  52662. var t = this.v2.clone().sub(this.v1);
  52663. return t.multiplyScalar(e).add(this.v1),
  52664. t
  52665. }
  52666. ,
  52667. Ci.LineCurve.prototype.getPointAt = function(e) {
  52668. return this.getPoint(e)
  52669. }
  52670. ,
  52671. Ci.LineCurve.prototype.getTangent = function(e) {
  52672. return this.v2.clone().sub(this.v1).normalize()
  52673. }
  52674. ,
  52675. Ci.QuadraticBezierCurve = function(e, t, i) {
  52676. this.v0 = e,
  52677. this.v1 = t,
  52678. this.v2 = i
  52679. }
  52680. ,
  52681. Ci.QuadraticBezierCurve.prototype = Object.create(Ci.Curve.prototype),
  52682. Ci.QuadraticBezierCurve.prototype.constructor = Ci.QuadraticBezierCurve,
  52683. Ci.QuadraticBezierCurve.prototype.getPoint = function(e) {
  52684. var t = Ci.ShapeUtils.b2;
  52685. return new Ci.Vector2(t(e, this.v0.x, this.v1.x, this.v2.x),t(e, this.v0.y, this.v1.y, this.v2.y))
  52686. }
  52687. ,
  52688. Ci.QuadraticBezierCurve.prototype.getTangent = function(e) {
  52689. var t = Ci.CurveUtils.tangentQuadraticBezier;
  52690. return new Ci.Vector2(t(e, this.v0.x, this.v1.x, this.v2.x),t(e, this.v0.y, this.v1.y, this.v2.y)).normalize()
  52691. }
  52692. ,
  52693. Ci.CubicBezierCurve = function(e, t, i, n) {
  52694. this.v0 = e,
  52695. this.v1 = t,
  52696. this.v2 = i,
  52697. this.v3 = n
  52698. }
  52699. ,
  52700. Ci.CubicBezierCurve.prototype = Object.create(Ci.Curve.prototype),
  52701. Ci.CubicBezierCurve.prototype.constructor = Ci.CubicBezierCurve,
  52702. Ci.CubicBezierCurve.prototype.getPoint = function(e) {
  52703. var t = Ci.ShapeUtils.b3;
  52704. return new Ci.Vector2(t(e, this.v0.x, this.v1.x, this.v2.x, this.v3.x),t(e, this.v0.y, this.v1.y, this.v2.y, this.v3.y))
  52705. }
  52706. ,
  52707. Ci.CubicBezierCurve.prototype.getTangent = function(e) {
  52708. var t = Ci.CurveUtils.tangentCubicBezier;
  52709. return new Ci.Vector2(t(e, this.v0.x, this.v1.x, this.v2.x, this.v3.x),t(e, this.v0.y, this.v1.y, this.v2.y, this.v3.y)).normalize()
  52710. }
  52711. ,
  52712. Ci.SplineCurve = function(e) {
  52713. this.points = null == e ? [] : e
  52714. }
  52715. ,
  52716. Ci.SplineCurve.prototype = Object.create(Ci.Curve.prototype),
  52717. Ci.SplineCurve.prototype.constructor = Ci.SplineCurve,
  52718. Ci.SplineCurve.prototype.getPoint = function(e) {
  52719. var t = this.points
  52720. , i = (t.length - 1) * e
  52721. , n = Math.floor(i)
  52722. , r = i - n
  52723. , o = t[0 === n ? n : n - 1]
  52724. , a = t[n]
  52725. , s = t[n > t.length - 2 ? t.length - 1 : n + 1]
  52726. , l = t[n > t.length - 3 ? t.length - 1 : n + 2]
  52727. , c = Ci.CurveUtils.interpolate;
  52728. return new Ci.Vector2(c(o.x, a.x, s.x, l.x, r),c(o.y, a.y, s.y, l.y, r))
  52729. }
  52730. ,
  52731. Ci.EllipseCurve = function(e, t, i, n, r, o, a, s) {
  52732. this.aX = e,
  52733. this.aY = t,
  52734. this.xRadius = i,
  52735. this.yRadius = n,
  52736. this.aStartAngle = r,
  52737. this.aEndAngle = o,
  52738. this.aClockwise = a,
  52739. this.aRotation = s || 0
  52740. }
  52741. ,
  52742. Ci.EllipseCurve.prototype = Object.create(Ci.Curve.prototype),
  52743. Ci.EllipseCurve.prototype.constructor = Ci.EllipseCurve,
  52744. Ci.EllipseCurve.prototype.getPoint = function(e) {
  52745. var t, i = this.aEndAngle - this.aStartAngle;
  52746. i < 0 && (i += 2 * Math.PI),
  52747. i > 2 * Math.PI && (i -= 2 * Math.PI),
  52748. t = !0 === this.aClockwise ? this.aEndAngle + (1 - e) * (2 * Math.PI - i) : this.aStartAngle + e * i;
  52749. var n = this.aX + this.xRadius * Math.cos(t)
  52750. , r = this.aY + this.yRadius * Math.sin(t);
  52751. if (0 !== this.aRotation) {
  52752. var o = Math.cos(this.aRotation)
  52753. , a = Math.sin(this.aRotation)
  52754. , s = n
  52755. , l = r;
  52756. n = (s - this.aX) * o - (l - this.aY) * a + this.aX,
  52757. r = (s - this.aX) * a + (l - this.aY) * o + this.aY
  52758. }
  52759. return new Ci.Vector2(n,r)
  52760. }
  52761. ,
  52762. Ci.ArcCurve = function(e, t, i, n, r, o) {
  52763. Ci.EllipseCurve.call(this, e, t, i, i, n, r, o)
  52764. }
  52765. ,
  52766. Ci.ArcCurve.prototype = Object.create(Ci.EllipseCurve.prototype),
  52767. Ci.ArcCurve.prototype.constructor = Ci.ArcCurve,
  52768. Ci.LineCurve3 = Ci.Curve.create(function(e, t) {
  52769. this.v1 = e,
  52770. this.v2 = t
  52771. }, function(e) {
  52772. var t = new Ci.Vector3;
  52773. return t.subVectors(this.v2, this.v1),
  52774. t.multiplyScalar(e),
  52775. t.add(this.v1),
  52776. t
  52777. }),
  52778. Ci.QuadraticBezierCurve3 = Ci.Curve.create(function(e, t, i) {
  52779. this.v0 = e,
  52780. this.v1 = t,
  52781. this.v2 = i
  52782. }, function(e) {
  52783. var t = Ci.ShapeUtils.b2;
  52784. return new Ci.Vector3(t(e, this.v0.x, this.v1.x, this.v2.x),t(e, this.v0.y, this.v1.y, this.v2.y),t(e, this.v0.z, this.v1.z, this.v2.z))
  52785. }),
  52786. Ci.CubicBezierCurve3 = Ci.Curve.create(function(e, t, i, n) {
  52787. this.v0 = e,
  52788. this.v1 = t,
  52789. this.v2 = i,
  52790. this.v3 = n
  52791. }, function(e) {
  52792. var t = Ci.ShapeUtils.b3;
  52793. return new Ci.Vector3(t(e, this.v0.x, this.v1.x, this.v2.x, this.v3.x),t(e, this.v0.y, this.v1.y, this.v2.y, this.v3.y),t(e, this.v0.z, this.v1.z, this.v2.z, this.v3.z))
  52794. }),
  52795. Ci.SplineCurve3 = Ci.Curve.create(function(e) {
  52796. console.warn("THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3"),
  52797. this.points = null == e ? [] : e
  52798. }, function(e) {
  52799. var t = this.points
  52800. , i = (t.length - 1) * e
  52801. , n = Math.floor(i)
  52802. , r = i - n
  52803. , o = t[0 == n ? n : n - 1]
  52804. , a = t[n]
  52805. , s = t[n > t.length - 2 ? t.length - 1 : n + 1]
  52806. , l = t[n > t.length - 3 ? t.length - 1 : n + 2]
  52807. , c = Ci.CurveUtils.interpolate;
  52808. return new Ci.Vector3(c(o.x, a.x, s.x, l.x, r),c(o.y, a.y, s.y, l.y, r),c(o.z, a.z, s.z, l.z, r))
  52809. }),
  52810. Ci.CatmullRomCurve3 = (qt = new Ci.Vector3,
  52811. Xt = new xi,
  52812. Zt = new xi,
  52813. Kt = new xi,
  52814. xi.prototype.init = function(e, t, i, n) {
  52815. this.c0 = e,
  52816. this.c1 = i,
  52817. this.c2 = -3 * e + 3 * t - 2 * i - n,
  52818. this.c3 = 2 * e - 2 * t + i + n
  52819. }
  52820. ,
  52821. xi.prototype.initNonuniformCatmullRom = function(e, t, i, n, r, o, a) {
  52822. var s = (t - e) / r - (i - e) / (r + o) + (i - t) / o
  52823. , l = (i - t) / o - (n - t) / (o + a) + (n - i) / a;
  52824. s *= o,
  52825. l *= o,
  52826. this.init(t, i, s, l)
  52827. }
  52828. ,
  52829. xi.prototype.initCatmullRom = function(e, t, i, n, r) {
  52830. this.init(t, i, r * (i - e), r * (n - t))
  52831. }
  52832. ,
  52833. xi.prototype.calc = function(e) {
  52834. var t = e * e
  52835. , i = t * e;
  52836. return this.c0 + this.c1 * e + this.c2 * t + this.c3 * i
  52837. }
  52838. ,
  52839. Ci.Curve.create(function(e) {
  52840. this.points = e || [],
  52841. this.closed = !1
  52842. }, function(e) {
  52843. var t, i, n, r, o, a, s, l, c = this.points;
  52844. if ((r = c.length) < 2 && console.log("duh, you need at least 2 points"),
  52845. n = (t = (r - (this.closed ? 0 : 1)) * e) - (i = Math.floor(t)),
  52846. this.closed ? i += 0 < i ? 0 : (Math.floor(Math.abs(i) / c.length) + 1) * c.length : 0 === n && i === r - 1 && (i = r - 2,
  52847. n = 1),
  52848. o = this.closed || 0 < i ? c[(i - 1) % r] : (qt.subVectors(c[0], c[1]).add(c[0]),
  52849. qt),
  52850. a = c[i % r],
  52851. s = c[(i + 1) % r],
  52852. l = this.closed || i + 2 < r ? c[(i + 2) % r] : (qt.subVectors(c[r - 1], c[r - 2]).add(c[r - 1]),
  52853. qt),
  52854. void 0 === this.type || "centripetal" === this.type || "chordal" === this.type) {
  52855. var h = "chordal" === this.type ? .5 : .25
  52856. , u = Math.pow(o.distanceToSquared(a), h)
  52857. , d = Math.pow(a.distanceToSquared(s), h)
  52858. , p = Math.pow(s.distanceToSquared(l), h);
  52859. d < 1e-4 && (d = 1),
  52860. u < 1e-4 && (u = d),
  52861. p < 1e-4 && (p = d),
  52862. Xt.initNonuniformCatmullRom(o.x, a.x, s.x, l.x, u, d, p),
  52863. Zt.initNonuniformCatmullRom(o.y, a.y, s.y, l.y, u, d, p),
  52864. Kt.initNonuniformCatmullRom(o.z, a.z, s.z, l.z, u, d, p)
  52865. } else if ("catmullrom" === this.type) {
  52866. var f = void 0 !== this.tension ? this.tension : .5;
  52867. Xt.initCatmullRom(o.x, a.x, s.x, l.x, f),
  52868. Zt.initCatmullRom(o.y, a.y, s.y, l.y, f),
  52869. Kt.initCatmullRom(o.z, a.z, s.z, l.z, f)
  52870. }
  52871. return new Ci.Vector3(Xt.calc(n),Zt.calc(n),Kt.calc(n))
  52872. })),
  52873. Ci.ClosedSplineCurve3 = function(e) {
  52874. console.warn("THREE.ClosedSplineCurve3 has been deprecated. Please use THREE.CatmullRomCurve3."),
  52875. Ci.CatmullRomCurve3.call(this, e),
  52876. this.type = "catmullrom",
  52877. this.closed = !0
  52878. }
  52879. ,
  52880. Ci.ClosedSplineCurve3.prototype = Object.create(Ci.CatmullRomCurve3.prototype),
  52881. Ci.BoxGeometry = function(e, t, i, n, r, o) {
  52882. Ci.Geometry.call(this),
  52883. this.type = "BoxGeometry",
  52884. this.parameters = {
  52885. width: e,
  52886. height: t,
  52887. depth: i,
  52888. widthSegments: n,
  52889. heightSegments: r,
  52890. depthSegments: o
  52891. },
  52892. this.fromBufferGeometry(new Ci.BoxBufferGeometry(e,t,i,n,r,o)),
  52893. this.mergeVertices()
  52894. }
  52895. ,
  52896. Ci.BoxGeometry.prototype = Object.create(Ci.Geometry.prototype),
  52897. Ci.BoxGeometry.prototype.constructor = Ci.BoxGeometry,
  52898. Ci.CubeGeometry = Ci.BoxGeometry,
  52899. Ci.BoxBufferGeometry = function(e, t, i, n, r, o) {
  52900. function a(e, t, i, n, r, o, a, s, l, c, h) {
  52901. for (var u = o / l, d = a / c, p = o / 2, f = a / 2, g = s / 2, m = l + 1, v = c + 1, y = 0, A = 0, C = new Ci.Vector3, I = 0; I < v; I++)
  52902. for (var E = I * d - f, _ = 0; _ < m; _++) {
  52903. var b = _ * u - p;
  52904. C[e] = b * n,
  52905. C[t] = E * r,
  52906. C[i] = g,
  52907. P[D] = C.x,
  52908. P[D + 1] = C.y,
  52909. P[D + 2] = C.z,
  52910. C[e] = 0,
  52911. C[t] = 0,
  52912. C[i] = 0 < s ? 1 : -1,
  52913. O[D] = C.x,
  52914. O[D + 1] = C.y,
  52915. O[D + 2] = C.z,
  52916. L[N] = _ / l,
  52917. L[N + 1] = 1 - I / c,
  52918. D += 3,
  52919. N += 2,
  52920. y += 1
  52921. }
  52922. for (I = 0; I < c; I++)
  52923. for (_ = 0; _ < l; _++) {
  52924. var w = B + _ + m * I
  52925. , T = B + _ + m * (I + 1)
  52926. , x = B + (_ + 1) + m * (I + 1)
  52927. , S = B + (_ + 1) + m * I;
  52928. R[F] = w,
  52929. R[F + 1] = T,
  52930. R[F + 2] = S,
  52931. R[F + 3] = T,
  52932. R[F + 4] = x,
  52933. R[F + 5] = S,
  52934. F += 6,
  52935. A += 6
  52936. }
  52937. M.addGroup(V, A, h),
  52938. V += A,
  52939. B += y
  52940. }
  52941. Ci.BufferGeometry.call(this),
  52942. this.type = "BoxBufferGeometry",
  52943. this.parameters = {
  52944. width: e,
  52945. height: t,
  52946. depth: i,
  52947. widthSegments: n,
  52948. heightSegments: r,
  52949. depthSegments: o
  52950. };
  52951. var M = this;
  52952. n = Math.floor(n) || 1,
  52953. r = Math.floor(r) || 1,
  52954. o = Math.floor(o) || 1;
  52955. var s, l, c, h, u = (h = 0,
  52956. h += (s = n) * (l = r) * 2,
  52957. h += s * (c = o) * 2,
  52958. 4 * (h += c * l * 2)), d = u / 4 * 6, R = new (65535 < d ? Uint32Array : Uint16Array)(d), P = new Float32Array(3 * u), O = new Float32Array(3 * u), L = new Float32Array(2 * u), D = 0, N = 0, F = 0, B = 0, V = 0;
  52959. a("z", "y", "x", -1, -1, i, t, e, o, r, 0),
  52960. a("z", "y", "x", 1, -1, i, t, -e, o, r, 1),
  52961. a("x", "z", "y", 1, 1, e, i, t, n, o, 2),
  52962. a("x", "z", "y", 1, -1, e, i, -t, n, o, 3),
  52963. a("x", "y", "z", 1, -1, e, t, i, n, r, 4),
  52964. a("x", "y", "z", -1, -1, e, t, -i, n, r, 5),
  52965. this.setIndex(new Ci.BufferAttribute(R,1)),
  52966. this.addAttribute("position", new Ci.BufferAttribute(P,3)),
  52967. this.addAttribute("normal", new Ci.BufferAttribute(O,3)),
  52968. this.addAttribute("uv", new Ci.BufferAttribute(L,2))
  52969. }
  52970. ,
  52971. Ci.BoxBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  52972. Ci.BoxBufferGeometry.prototype.constructor = Ci.BoxBufferGeometry,
  52973. Ci.CircleGeometry = function(e, t, i, n) {
  52974. Ci.Geometry.call(this),
  52975. this.type = "CircleGeometry",
  52976. this.parameters = {
  52977. radius: e,
  52978. segments: t,
  52979. thetaStart: i,
  52980. thetaLength: n
  52981. },
  52982. this.fromBufferGeometry(new Ci.CircleBufferGeometry(e,t,i,n))
  52983. }
  52984. ,
  52985. Ci.CircleGeometry.prototype = Object.create(Ci.Geometry.prototype),
  52986. Ci.CircleGeometry.prototype.constructor = Ci.CircleGeometry,
  52987. Ci.CircleBufferGeometry = function(e, t, i, n) {
  52988. Ci.BufferGeometry.call(this),
  52989. this.type = "CircleBufferGeometry",
  52990. this.parameters = {
  52991. radius: e,
  52992. segments: t,
  52993. thetaStart: i,
  52994. thetaLength: n
  52995. },
  52996. e = e || 50,
  52997. t = void 0 !== t ? Math.max(3, t) : 8,
  52998. i = void 0 !== i ? i : 0,
  52999. n = void 0 !== n ? n : 2 * Math.PI;
  53000. var r = t + 2
  53001. , o = new Float32Array(3 * r)
  53002. , a = new Float32Array(3 * r)
  53003. , s = new Float32Array(2 * r);
  53004. a[2] = 1,
  53005. s[0] = .5,
  53006. s[1] = .5;
  53007. for (var l = 0, c = 3, h = 2; l <= t; l++,
  53008. c += 3,
  53009. h += 2) {
  53010. var u = i + l / t * n;
  53011. o[c] = e * Math.cos(u),
  53012. o[c + 1] = e * Math.sin(u),
  53013. a[c + 2] = 1,
  53014. s[h] = (o[c] / e + 1) / 2,
  53015. s[h + 1] = (o[c + 1] / e + 1) / 2
  53016. }
  53017. var d = [];
  53018. for (c = 1; c <= t; c++)
  53019. d.push(c, c + 1, 0);
  53020. this.setIndex(new Ci.BufferAttribute(new Uint16Array(d),1)),
  53021. this.addAttribute("position", new Ci.BufferAttribute(o,3)),
  53022. this.addAttribute("normal", new Ci.BufferAttribute(a,3)),
  53023. this.addAttribute("uv", new Ci.BufferAttribute(s,2)),
  53024. this.boundingSphere = new Ci.Sphere(new Ci.Vector3,e)
  53025. }
  53026. ,
  53027. Ci.CircleBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53028. Ci.CircleBufferGeometry.prototype.constructor = Ci.CircleBufferGeometry,
  53029. Ci.CylinderBufferGeometry = function(p, f, g, m, v, e, y, A) {
  53030. function t(e) {
  53031. var t, i, n, r = new Ci.Vector2, o = new Ci.Vector3, a = !0 === e ? p : f, s = !0 === e ? 1 : -1;
  53032. for (i = b,
  53033. t = 1; t <= m; t++)
  53034. I.setXYZ(b, 0, x * s, 0),
  53035. E.setXYZ(b, 0, s, 0),
  53036. !0 === e ? (r.x = t / m,
  53037. r.y = 0) : (r.x = (t - 1) / m,
  53038. r.y = 1),
  53039. _.setXY(b, r.x, r.y),
  53040. b++;
  53041. for (n = b,
  53042. t = 0; t <= m; t++) {
  53043. var l = t / m;
  53044. o.x = a * Math.sin(l * A + y),
  53045. o.y = x * s,
  53046. o.z = a * Math.cos(l * A + y),
  53047. I.setXYZ(b, o.x, o.y, o.z),
  53048. E.setXYZ(b, 0, s, 0),
  53049. _.setXY(b, l, !0 === e ? 1 : 0),
  53050. b++
  53051. }
  53052. for (t = 0; t < m; t++) {
  53053. var c = i + t
  53054. , h = n + t;
  53055. !0 === e ? (C.setX(w, h),
  53056. w++,
  53057. C.setX(w, h + 1)) : (C.setX(w, h + 1),
  53058. w++,
  53059. C.setX(w, h)),
  53060. w++,
  53061. C.setX(w, c),
  53062. w++
  53063. }
  53064. }
  53065. Ci.BufferGeometry.call(this),
  53066. this.type = "CylinderBufferGeometry",
  53067. this.parameters = {
  53068. radiusTop: p,
  53069. radiusBottom: f,
  53070. height: g,
  53071. radialSegments: m,
  53072. heightSegments: v,
  53073. openEnded: e,
  53074. thetaStart: y,
  53075. thetaLength: A
  53076. },
  53077. p = void 0 !== p ? p : 20,
  53078. f = void 0 !== f ? f : 20,
  53079. g = void 0 !== g ? g : 100,
  53080. m = Math.floor(m) || 8,
  53081. v = Math.floor(v) || 1,
  53082. e = void 0 !== e && e,
  53083. y = void 0 !== y ? y : 0,
  53084. A = void 0 !== A ? A : 2 * Math.PI;
  53085. var i, n, r = (n = (m + 1) * (v + 1),
  53086. !1 === e && (n += 2 * (m + 1) + 2 * m),
  53087. n), o = (i = m * v * 2 * 3,
  53088. !1 === e && (i += 2 * m * 3),
  53089. i), C = new Ci.BufferAttribute(new (65535 < o ? Uint32Array : Uint16Array)(o),1), I = new Ci.BufferAttribute(new Float32Array(3 * r),3), E = new Ci.BufferAttribute(new Float32Array(3 * r),3), _ = new Ci.BufferAttribute(new Float32Array(2 * r),2), b = 0, w = 0, T = [], x = g / 2;
  53090. (function() {
  53091. var e, t, i = new Ci.Vector3, n = new Ci.Vector3, r = (f - p) / g;
  53092. for (t = 0; t <= v; t++) {
  53093. var o = []
  53094. , a = t / v
  53095. , s = a * (f - p) + p;
  53096. for (e = 0; e <= m; e++) {
  53097. var l = e / m;
  53098. n.x = s * Math.sin(l * A + y),
  53099. n.y = -a * g + x,
  53100. n.z = s * Math.cos(l * A + y),
  53101. I.setXYZ(b, n.x, n.y, n.z),
  53102. i.copy(n),
  53103. (0 === p && 0 === t || 0 === f && t === v) && (i.x = Math.sin(l * A + y),
  53104. i.z = Math.cos(l * A + y)),
  53105. i.setY(Math.sqrt(i.x * i.x + i.z * i.z) * r).normalize(),
  53106. E.setXYZ(b, i.x, i.y, i.z),
  53107. _.setXY(b, l, 1 - a),
  53108. o.push(b),
  53109. b++
  53110. }
  53111. T.push(o)
  53112. }
  53113. for (e = 0; e < m; e++)
  53114. for (t = 0; t < v; t++) {
  53115. var c = T[t][e]
  53116. , h = T[t + 1][e]
  53117. , u = T[t + 1][e + 1]
  53118. , d = T[t][e + 1];
  53119. C.setX(w, c),
  53120. w++,
  53121. C.setX(w, h),
  53122. w++,
  53123. C.setX(w, d),
  53124. w++,
  53125. C.setX(w, h),
  53126. w++,
  53127. C.setX(w, u),
  53128. w++,
  53129. C.setX(w, d),
  53130. w++
  53131. }
  53132. }
  53133. )(),
  53134. !1 === e && (0 < p && t(!0),
  53135. 0 < f && t(!1)),
  53136. this.setIndex(C),
  53137. this.addAttribute("position", I),
  53138. this.addAttribute("normal", E),
  53139. this.addAttribute("uv", _)
  53140. }
  53141. ,
  53142. Ci.CylinderBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53143. Ci.CylinderBufferGeometry.prototype.constructor = Ci.CylinderBufferGeometry,
  53144. Ci.CylinderGeometry = function(e, t, i, n, r, o, a, s) {
  53145. Ci.Geometry.call(this),
  53146. this.type = "CylinderGeometry",
  53147. this.parameters = {
  53148. radiusTop: e,
  53149. radiusBottom: t,
  53150. height: i,
  53151. radialSegments: n,
  53152. heightSegments: r,
  53153. openEnded: o,
  53154. thetaStart: a,
  53155. thetaLength: s
  53156. },
  53157. this.fromBufferGeometry(new Ci.CylinderBufferGeometry(e,t,i,n,r,o,a,s)),
  53158. this.mergeVertices()
  53159. }
  53160. ,
  53161. Ci.CylinderGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53162. Ci.CylinderGeometry.prototype.constructor = Ci.CylinderGeometry,
  53163. Ci.EdgesGeometry = function(e, t) {
  53164. function i(e, t) {
  53165. return e - t
  53166. }
  53167. Ci.BufferGeometry.call(this),
  53168. t = void 0 !== t ? t : 1;
  53169. var n, r = Math.cos(Ci.Math.degToRad(t)), o = [0, 0], a = {}, s = ["a", "b", "c"];
  53170. e instanceof Ci.BufferGeometry ? (n = new Ci.Geometry).fromBufferGeometry(e) : n = e.clone(),
  53171. n.mergeVertices(),
  53172. n.computeFaceNormals();
  53173. for (var l = n.vertices, c = n.faces, h = 0, u = c.length; h < u; h++)
  53174. for (var d = c[h], p = 0; p < 3; p++) {
  53175. o[0] = d[s[p]],
  53176. o[1] = d[s[(p + 1) % 3]],
  53177. o.sort(i),
  53178. void 0 === a[g = o.toString()] ? a[g] = {
  53179. vert1: o[0],
  53180. vert2: o[1],
  53181. face1: h,
  53182. face2: void 0
  53183. } : a[g].face2 = h
  53184. }
  53185. var f = [];
  53186. for (var g in a) {
  53187. var m = a[g];
  53188. if (void 0 === m.face2 || c[m.face1].normal.dot(c[m.face2].normal) <= r) {
  53189. var v = l[m.vert1];
  53190. f.push(v.x),
  53191. f.push(v.y),
  53192. f.push(v.z),
  53193. v = l[m.vert2],
  53194. f.push(v.x),
  53195. f.push(v.y),
  53196. f.push(v.z)
  53197. }
  53198. }
  53199. this.addAttribute("position", new Ci.BufferAttribute(new Float32Array(f),3))
  53200. }
  53201. ,
  53202. Ci.EdgesGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53203. Ci.EdgesGeometry.prototype.constructor = Ci.EdgesGeometry,
  53204. Ci.ExtrudeGeometry = function(e, t) {
  53205. return void 0 === e ? void (e = []) : (Ci.Geometry.call(this),
  53206. this.type = "ExtrudeGeometry",
  53207. e = Array.isArray(e) ? e : [e],
  53208. this.addShapeList(e, t),
  53209. void this.computeFaceNormals())
  53210. }
  53211. ;
  53212. Ci.ExtrudeGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53213. Ci.ExtrudeGeometry.prototype.constructor = Ci.ExtrudeGeometry,
  53214. Ci.ExtrudeGeometry.prototype.addShapeList = function(e, t) {
  53215. for (var i = e.length, n = 0; n < i; n++) {
  53216. var r = e[n];
  53217. this.addShape(r, t)
  53218. }
  53219. }
  53220. ,
  53221. Ci.ExtrudeGeometry.prototype.addShape = function(e, t) {
  53222. function i(e, t, i) {
  53223. return t || console.error("THREE.ExtrudeGeometry: vec does not exist"),
  53224. t.clone().multiplyScalar(i).add(e)
  53225. }
  53226. function n(e, t, i) {
  53227. var n, r, o = 1, a = e.x - t.x, s = e.y - t.y, l = i.x - e.x, c = i.y - e.y, h = a * a + s * s, u = a * c - s * l;
  53228. if (Math.abs(u) > Number.EPSILON) {
  53229. var d = Math.sqrt(h)
  53230. , p = Math.sqrt(l * l + c * c)
  53231. , f = t.x - s / d
  53232. , g = t.y + a / d
  53233. , m = ((i.x - c / p - f) * c - (i.y + l / p - g) * l) / (a * c - s * l)
  53234. , v = (n = f + a * m - e.x) * n + (r = g + s * m - e.y) * r;
  53235. if (v <= 2)
  53236. return new Ci.Vector2(n,r);
  53237. o = Math.sqrt(v / 2)
  53238. } else {
  53239. var y = !1;
  53240. a > Number.EPSILON ? l > Number.EPSILON && (y = !0) : a < -Number.EPSILON ? l < -Number.EPSILON && (y = !0) : Math.sign(s) === Math.sign(c) && (y = !0),
  53241. o = y ? (n = -s,
  53242. r = a,
  53243. Math.sqrt(h)) : (n = a,
  53244. r = s,
  53245. Math.sqrt(h / 2))
  53246. }
  53247. return new Ci.Vector2(n / o,r / o)
  53248. }
  53249. function r(e, t) {
  53250. var i, n;
  53251. for (G = e.length; 0 <= --G; ) {
  53252. (n = (i = G) - 1) < 0 && (n = e.length - 1);
  53253. var r = 0
  53254. , o = A + 2 * m;
  53255. for (r = 0; r < o; r++) {
  53256. var a = U * r
  53257. , s = U * (r + 1);
  53258. l(t + i + a, t + n + a, t + n + s, t + i + s, e, r, o, i, n)
  53259. }
  53260. }
  53261. }
  53262. function o(e, t, i) {
  53263. T.vertices.push(new Ci.Vector3(e,t,i))
  53264. }
  53265. function a(e, t, i) {
  53266. e += x,
  53267. t += x,
  53268. i += x,
  53269. T.faces.push(new Ci.Face3(e,t,i,null,null,0));
  53270. var n = E.generateTopUV(T, e, t, i);
  53271. T.faceVertexUvs[0].push(n)
  53272. }
  53273. function l(e, t, i, n) {
  53274. e += x,
  53275. t += x,
  53276. i += x,
  53277. n += x,
  53278. T.faces.push(new Ci.Face3(e,t,n,null,null,1)),
  53279. T.faces.push(new Ci.Face3(t,i,n,null,null,1));
  53280. var r = E.generateSideWallUV(T, e, t, i, n);
  53281. T.faceVertexUvs[0].push([r[0], r[1], r[3]]),
  53282. T.faceVertexUvs[0].push([r[1], r[2], r[3]])
  53283. }
  53284. var s, c, h, u, d, p = void 0 !== t.amount ? t.amount : 100, f = void 0 !== t.bevelThickness ? t.bevelThickness : 6, g = void 0 !== t.bevelSize ? t.bevelSize : f - 2, m = void 0 !== t.bevelSegments ? t.bevelSegments : 3, v = void 0 === t.bevelEnabled || t.bevelEnabled, y = void 0 !== t.curveSegments ? t.curveSegments : 12, A = void 0 !== t.steps ? t.steps : 1, C = t.extrudePath, I = !1, E = void 0 !== t.UVGenerator ? t.UVGenerator : Ci.ExtrudeGeometry.WorldUVGenerator;
  53285. C && (s = C.getSpacedPoints(A),
  53286. v = !(I = !0),
  53287. c = void 0 !== t.frames ? t.frames : new Ci.TubeGeometry.FrenetFrames(C,A,!1),
  53288. h = new Ci.Vector3,
  53289. u = new Ci.Vector3,
  53290. d = new Ci.Vector3),
  53291. v || (g = f = m = 0);
  53292. var _, b, w, T = this, x = this.vertices.length, S = e.extractPoints(y), M = S.shape, R = S.holes, P = !Ci.ShapeUtils.isClockWise(M);
  53293. if (P) {
  53294. for (M = M.reverse(),
  53295. b = 0,
  53296. w = R.length; b < w; b++)
  53297. _ = R[b],
  53298. Ci.ShapeUtils.isClockWise(_) && (R[b] = _.reverse());
  53299. P = !1
  53300. }
  53301. var O = Ci.ShapeUtils.triangulateShape(M, R)
  53302. , L = M;
  53303. for (b = 0,
  53304. w = R.length; b < w; b++)
  53305. _ = R[b],
  53306. M = M.concat(_);
  53307. for (var D, N, F, B, V, k, U = M.length, H = O.length, z = [], G = 0, W = L.length, j = W - 1, Y = G + 1; G < W; G++,
  53308. j++,
  53309. Y++)
  53310. j === W && (j = 0),
  53311. Y === W && (Y = 0),
  53312. z[G] = n(L[G], L[j], L[Y]);
  53313. var q, X, Z = [], K = z.concat();
  53314. for (b = 0,
  53315. w = R.length; b < w; b++) {
  53316. for (_ = R[b],
  53317. q = [],
  53318. G = 0,
  53319. j = (W = _.length) - 1,
  53320. Y = G + 1; G < W; G++,
  53321. j++,
  53322. Y++)
  53323. j === W && (j = 0),
  53324. Y === W && (Y = 0),
  53325. q[G] = n(_[G], _[j], _[Y]);
  53326. Z.push(q),
  53327. K = K.concat(q)
  53328. }
  53329. for (D = 0; D < m; D++) {
  53330. for (B = f * (1 - (F = D / m)),
  53331. N = g * Math.sin(F * Math.PI / 2),
  53332. G = 0,
  53333. W = L.length; G < W; G++)
  53334. o((V = i(L[G], z[G], N)).x, V.y, -B);
  53335. for (b = 0,
  53336. w = R.length; b < w; b++)
  53337. for (_ = R[b],
  53338. q = Z[b],
  53339. G = 0,
  53340. W = _.length; G < W; G++)
  53341. o((V = i(_[G], q[G], N)).x, V.y, -B)
  53342. }
  53343. for (N = g,
  53344. G = 0; G < U; G++)
  53345. V = v ? i(M[G], K[G], N) : M[G],
  53346. I ? (u.copy(c.normals[0]).multiplyScalar(V.x),
  53347. h.copy(c.binormals[0]).multiplyScalar(V.y),
  53348. d.copy(s[0]).add(u).add(h),
  53349. o(d.x, d.y, d.z)) : o(V.x, V.y, 0);
  53350. for (X = 1; X <= A; X++)
  53351. for (G = 0; G < U; G++)
  53352. V = v ? i(M[G], K[G], N) : M[G],
  53353. I ? (u.copy(c.normals[X]).multiplyScalar(V.x),
  53354. h.copy(c.binormals[X]).multiplyScalar(V.y),
  53355. d.copy(s[X]).add(u).add(h),
  53356. o(d.x, d.y, d.z)) : o(V.x, V.y, p / A * X);
  53357. for (D = m - 1; 0 <= D; D--) {
  53358. for (B = f * (1 - (F = D / m)),
  53359. N = g * Math.sin(F * Math.PI / 2),
  53360. G = 0,
  53361. W = L.length; G < W; G++)
  53362. o((V = i(L[G], z[G], N)).x, V.y, p + B);
  53363. for (b = 0,
  53364. w = R.length; b < w; b++)
  53365. for (_ = R[b],
  53366. q = Z[b],
  53367. G = 0,
  53368. W = _.length; G < W; G++)
  53369. V = i(_[G], q[G], N),
  53370. I ? o(V.x, V.y + s[A - 1].y, s[A - 1].x + B) : o(V.x, V.y, p + B)
  53371. }
  53372. (function() {
  53373. if (v) {
  53374. var e = 0
  53375. , t = U * e;
  53376. for (G = 0; G < H; G++)
  53377. a((k = O[G])[2] + t, k[1] + t, k[0] + t);
  53378. for (t = U * (e = A + 2 * m),
  53379. G = 0; G < H; G++)
  53380. a((k = O[G])[0] + t, k[1] + t, k[2] + t)
  53381. } else {
  53382. for (G = 0; G < H; G++)
  53383. a((k = O[G])[2], k[1], k[0]);
  53384. for (G = 0; G < H; G++)
  53385. a((k = O[G])[0] + U * A, k[1] + U * A, k[2] + U * A)
  53386. }
  53387. }
  53388. )(),
  53389. function() {
  53390. var e = 0;
  53391. for (r(L, e),
  53392. e += L.length,
  53393. b = 0,
  53394. w = R.length; b < w; b++)
  53395. r(_ = R[b], e),
  53396. e += _.length
  53397. }()
  53398. }
  53399. ,
  53400. Ci.ExtrudeGeometry.WorldUVGenerator = {
  53401. generateTopUV: function(e, t, i, n) {
  53402. var r = e.vertices
  53403. , o = r[t]
  53404. , a = r[i]
  53405. , s = r[n];
  53406. return [new Ci.Vector2(o.x,o.y), new Ci.Vector2(a.x,a.y), new Ci.Vector2(s.x,s.y)]
  53407. },
  53408. generateSideWallUV: function(e, t, i, n, r) {
  53409. var o = e.vertices
  53410. , a = o[t]
  53411. , s = o[i]
  53412. , l = o[n]
  53413. , c = o[r];
  53414. return Math.abs(a.y - s.y) < .01 ? [new Ci.Vector2(a.x,1 - a.z), new Ci.Vector2(s.x,1 - s.z), new Ci.Vector2(l.x,1 - l.z), new Ci.Vector2(c.x,1 - c.z)] : [new Ci.Vector2(a.y,1 - a.z), new Ci.Vector2(s.y,1 - s.z), new Ci.Vector2(l.y,1 - l.z), new Ci.Vector2(c.y,1 - c.z)]
  53415. }
  53416. },
  53417. Ci.ShapeGeometry = function(e, t) {
  53418. Ci.Geometry.call(this),
  53419. !(this.type = "ShapeGeometry") === Array.isArray(e) && (e = [e]),
  53420. this.addShapeList(e, t),
  53421. this.computeFaceNormals()
  53422. }
  53423. ,
  53424. Ci.ShapeGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53425. Ci.ShapeGeometry.prototype.constructor = Ci.ShapeGeometry,
  53426. Ci.ShapeGeometry.prototype.addShapeList = function(e, t) {
  53427. for (var i = 0, n = e.length; i < n; i++)
  53428. this.addShape(e[i], t);
  53429. return this
  53430. }
  53431. ,
  53432. Ci.ShapeGeometry.prototype.addShape = function(e, t) {
  53433. void 0 === t && (t = {});
  53434. var i, n, r, o = void 0 !== t.curveSegments ? t.curveSegments : 12, a = t.material, s = void 0 === t.UVGenerator ? Ci.ExtrudeGeometry.WorldUVGenerator : t.UVGenerator, l = this.vertices.length, c = e.extractPoints(o), h = c.shape, u = c.holes, d = !Ci.ShapeUtils.isClockWise(h);
  53435. if (d) {
  53436. for (h = h.reverse(),
  53437. i = 0,
  53438. n = u.length; i < n; i++)
  53439. r = u[i],
  53440. Ci.ShapeUtils.isClockWise(r) && (u[i] = r.reverse());
  53441. d = !1
  53442. }
  53443. var p = Ci.ShapeUtils.triangulateShape(h, u);
  53444. for (i = 0,
  53445. n = u.length; i < n; i++)
  53446. r = u[i],
  53447. h = h.concat(r);
  53448. var f, g, m = h.length, v = p.length;
  53449. for (i = 0; i < m; i++)
  53450. f = h[i],
  53451. this.vertices.push(new Ci.Vector3(f.x,f.y,0));
  53452. for (i = 0; i < v; i++) {
  53453. var y = (g = p[i])[0] + l
  53454. , A = g[1] + l
  53455. , C = g[2] + l;
  53456. this.faces.push(new Ci.Face3(y,A,C,null,null,a)),
  53457. this.faceVertexUvs[0].push(s.generateTopUV(this, y, A, C))
  53458. }
  53459. }
  53460. ,
  53461. Ci.LatheBufferGeometry = function(e, t, i, n) {
  53462. Ci.BufferGeometry.call(this),
  53463. this.type = "LatheBufferGeometry",
  53464. this.parameters = {
  53465. points: e,
  53466. segments: t,
  53467. phiStart: i,
  53468. phiLength: n
  53469. },
  53470. t = Math.floor(t) || 12,
  53471. i = i || 0,
  53472. n = n || 2 * Math.PI,
  53473. n = Ci.Math.clamp(n, 0, 2 * Math.PI);
  53474. var r, o, a, s = (t + 1) * e.length, l = t * e.length * 2 * 3, c = new Ci.BufferAttribute(new (65535 < l ? Uint32Array : Uint16Array)(l),1), h = new Ci.BufferAttribute(new Float32Array(3 * s),3), u = new Ci.BufferAttribute(new Float32Array(2 * s),2), d = 0, p = 0, f = (e.length,
  53475. 1 / t), g = new Ci.Vector3, m = new Ci.Vector2;
  53476. for (o = 0; o <= t; o++) {
  53477. var v = i + o * f * n
  53478. , y = Math.sin(v)
  53479. , A = Math.cos(v);
  53480. for (a = 0; a <= e.length - 1; a++)
  53481. g.x = e[a].x * y,
  53482. g.y = e[a].y,
  53483. g.z = e[a].x * A,
  53484. h.setXYZ(d, g.x, g.y, g.z),
  53485. m.x = o / t,
  53486. m.y = a / (e.length - 1),
  53487. u.setXY(d, m.x, m.y),
  53488. d++
  53489. }
  53490. for (o = 0; o < t; o++)
  53491. for (a = 0; a < e.length - 1; a++) {
  53492. var C = r = a + o * e.length
  53493. , I = r + e.length
  53494. , E = r + e.length + 1
  53495. , _ = r + 1;
  53496. c.setX(p, C),
  53497. p++,
  53498. c.setX(p, I),
  53499. p++,
  53500. c.setX(p, _),
  53501. p++,
  53502. c.setX(p, I),
  53503. p++,
  53504. c.setX(p, E),
  53505. p++,
  53506. c.setX(p, _),
  53507. p++
  53508. }
  53509. if (this.setIndex(c),
  53510. this.addAttribute("position", h),
  53511. this.addAttribute("uv", u),
  53512. this.computeVertexNormals(),
  53513. n === 2 * Math.PI) {
  53514. var b = this.attributes.normal.array
  53515. , w = new Ci.Vector3
  53516. , T = new Ci.Vector3
  53517. , x = new Ci.Vector3;
  53518. for (r = t * e.length * 3,
  53519. a = o = 0; o < e.length; o++,
  53520. a += 3)
  53521. w.x = b[a + 0],
  53522. w.y = b[a + 1],
  53523. w.z = b[a + 2],
  53524. T.x = b[r + a + 0],
  53525. T.y = b[r + a + 1],
  53526. T.z = b[r + a + 2],
  53527. x.addVectors(w, T).normalize(),
  53528. b[a + 0] = b[r + a + 0] = x.x,
  53529. b[a + 1] = b[r + a + 1] = x.y,
  53530. b[a + 2] = b[r + a + 2] = x.z
  53531. }
  53532. }
  53533. ,
  53534. Ci.LatheBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53535. Ci.LatheBufferGeometry.prototype.constructor = Ci.LatheBufferGeometry,
  53536. Ci.LatheGeometry = function(e, t, i, n) {
  53537. Ci.Geometry.call(this),
  53538. this.type = "LatheGeometry",
  53539. this.parameters = {
  53540. points: e,
  53541. segments: t,
  53542. phiStart: i,
  53543. phiLength: n
  53544. },
  53545. this.fromBufferGeometry(new Ci.LatheBufferGeometry(e,t,i,n)),
  53546. this.mergeVertices()
  53547. }
  53548. ,
  53549. Ci.LatheGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53550. Ci.LatheGeometry.prototype.constructor = Ci.LatheGeometry,
  53551. Ci.PlaneGeometry = function(e, t, i, n) {
  53552. Ci.Geometry.call(this),
  53553. this.type = "PlaneGeometry",
  53554. this.parameters = {
  53555. width: e,
  53556. height: t,
  53557. widthSegments: i,
  53558. heightSegments: n
  53559. },
  53560. this.fromBufferGeometry(new Ci.PlaneBufferGeometry(e,t,i,n))
  53561. }
  53562. ,
  53563. Ci.PlaneGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53564. Ci.PlaneGeometry.prototype.constructor = Ci.PlaneGeometry,
  53565. Ci.PlaneBufferGeometry = function(e, t, i, n) {
  53566. Ci.BufferGeometry.call(this),
  53567. this.type = "PlaneBufferGeometry",
  53568. this.parameters = {
  53569. width: e,
  53570. height: t,
  53571. widthSegments: i,
  53572. heightSegments: n
  53573. };
  53574. for (var r = e / 2, o = t / 2, a = Math.floor(i) || 1, s = Math.floor(n) || 1, l = a + 1, c = s + 1, h = e / a, u = t / s, d = new Float32Array(l * c * 3), p = new Float32Array(l * c * 3), f = new Float32Array(l * c * 2), g = 0, m = 0, v = 0; v < c; v++)
  53575. for (var y = v * u - o, A = 0; A < l; A++) {
  53576. var C = A * h - r;
  53577. d[g] = C,
  53578. d[g + 1] = -y,
  53579. p[g + 2] = 1,
  53580. f[m] = A / a,
  53581. f[m + 1] = 1 - v / s,
  53582. g += 3,
  53583. m += 2
  53584. }
  53585. g = 0;
  53586. var I = new (65535 < d.length / 3 ? Uint32Array : Uint16Array)(a * s * 6);
  53587. for (v = 0; v < s; v++)
  53588. for (A = 0; A < a; A++) {
  53589. var E = A + l * v
  53590. , _ = A + l * (v + 1)
  53591. , b = A + 1 + l * (v + 1)
  53592. , w = A + 1 + l * v;
  53593. I[g] = E,
  53594. I[g + 1] = _,
  53595. I[g + 2] = w,
  53596. I[g + 3] = _,
  53597. I[g + 4] = b,
  53598. I[g + 5] = w,
  53599. g += 6
  53600. }
  53601. this.setIndex(new Ci.BufferAttribute(I,1)),
  53602. this.addAttribute("position", new Ci.BufferAttribute(d,3)),
  53603. this.addAttribute("normal", new Ci.BufferAttribute(p,3)),
  53604. this.addAttribute("uv", new Ci.BufferAttribute(f,2))
  53605. }
  53606. ,
  53607. Ci.PlaneBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53608. Ci.PlaneBufferGeometry.prototype.constructor = Ci.PlaneBufferGeometry,
  53609. Ci.RingBufferGeometry = function(e, t, i, n, r, o) {
  53610. Ci.BufferGeometry.call(this),
  53611. this.type = "RingBufferGeometry",
  53612. this.parameters = {
  53613. innerRadius: e,
  53614. outerRadius: t,
  53615. thetaSegments: i,
  53616. phiSegments: n,
  53617. thetaStart: r,
  53618. thetaLength: o
  53619. },
  53620. e = e || 20,
  53621. t = t || 50,
  53622. r = void 0 !== r ? r : 0,
  53623. o = void 0 !== o ? o : 2 * Math.PI;
  53624. var a, s, l, c = ((i = void 0 !== i ? Math.max(3, i) : 8) + 1) * ((n = void 0 !== n ? Math.max(1, n) : 1) + 1), h = i * n * 2 * 3, u = new Ci.BufferAttribute(new (65535 < h ? Uint32Array : Uint16Array)(h),1), d = new Ci.BufferAttribute(new Float32Array(3 * c),3), p = new Ci.BufferAttribute(new Float32Array(3 * c),3), f = new Ci.BufferAttribute(new Float32Array(2 * c),2), g = 0, m = 0, v = e, y = (t - e) / n, A = new Ci.Vector3, C = new Ci.Vector2;
  53625. for (s = 0; s <= n; s++) {
  53626. for (l = 0; l <= i; l++)
  53627. a = r + l / i * o,
  53628. A.x = v * Math.cos(a),
  53629. A.y = v * Math.sin(a),
  53630. d.setXYZ(g, A.x, A.y, A.z),
  53631. p.setXYZ(g, 0, 0, 1),
  53632. C.x = (A.x / t + 1) / 2,
  53633. C.y = (A.y / t + 1) / 2,
  53634. f.setXY(g, C.x, C.y),
  53635. g++;
  53636. v += y
  53637. }
  53638. for (s = 0; s < n; s++) {
  53639. var I = s * (i + 1);
  53640. for (l = 0; l < i; l++) {
  53641. var E = a = l + I
  53642. , _ = a + i + 1
  53643. , b = a + i + 2
  53644. , w = a + 1;
  53645. u.setX(m, E),
  53646. m++,
  53647. u.setX(m, _),
  53648. m++,
  53649. u.setX(m, b),
  53650. m++,
  53651. u.setX(m, E),
  53652. m++,
  53653. u.setX(m, b),
  53654. m++,
  53655. u.setX(m, w),
  53656. m++
  53657. }
  53658. }
  53659. this.setIndex(u),
  53660. this.addAttribute("position", d),
  53661. this.addAttribute("normal", p),
  53662. this.addAttribute("uv", f)
  53663. }
  53664. ,
  53665. Ci.RingBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53666. Ci.RingBufferGeometry.prototype.constructor = Ci.RingBufferGeometry,
  53667. Ci.RingGeometry = function(e, t, i, n, r, o) {
  53668. Ci.Geometry.call(this),
  53669. this.type = "RingGeometry",
  53670. this.parameters = {
  53671. innerRadius: e,
  53672. outerRadius: t,
  53673. thetaSegments: i,
  53674. phiSegments: n,
  53675. thetaStart: r,
  53676. thetaLength: o
  53677. },
  53678. this.fromBufferGeometry(new Ci.RingBufferGeometry(e,t,i,n,r,o))
  53679. }
  53680. ,
  53681. Ci.RingGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53682. Ci.RingGeometry.prototype.constructor = Ci.RingGeometry,
  53683. Ci.SphereGeometry = function(e, t, i, n, r, o, a) {
  53684. Ci.Geometry.call(this),
  53685. this.type = "SphereGeometry",
  53686. this.parameters = {
  53687. radius: e,
  53688. widthSegments: t,
  53689. heightSegments: i,
  53690. phiStart: n,
  53691. phiLength: r,
  53692. thetaStart: o,
  53693. thetaLength: a
  53694. },
  53695. this.fromBufferGeometry(new Ci.SphereBufferGeometry(e,t,i,n,r,o,a))
  53696. }
  53697. ,
  53698. Ci.SphereGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53699. Ci.SphereGeometry.prototype.constructor = Ci.SphereGeometry,
  53700. Ci.SphereBufferGeometry = function(e, t, i, n, r, o, a) {
  53701. Ci.BufferGeometry.call(this),
  53702. this.type = "SphereBufferGeometry",
  53703. this.parameters = {
  53704. radius: e,
  53705. widthSegments: t,
  53706. heightSegments: i,
  53707. phiStart: n,
  53708. phiLength: r,
  53709. thetaStart: o,
  53710. thetaLength: a
  53711. },
  53712. e = e || 50,
  53713. t = Math.max(3, Math.floor(t) || 8),
  53714. i = Math.max(2, Math.floor(i) || 6),
  53715. n = void 0 !== n ? n : 0,
  53716. r = void 0 !== r ? r : 2 * Math.PI;
  53717. for (var s = (o = void 0 !== o ? o : 0) + (a = void 0 !== a ? a : Math.PI), l = (t + 1) * (i + 1), c = new Ci.BufferAttribute(new Float32Array(3 * l),3), h = new Ci.BufferAttribute(new Float32Array(3 * l),3), u = new Ci.BufferAttribute(new Float32Array(2 * l),2), d = 0, p = [], f = new Ci.Vector3, g = 0; g <= i; g++) {
  53718. for (var m = [], v = g / i, y = 0; y <= t; y++) {
  53719. var A = y / t
  53720. , C = -e * Math.cos(n + A * r) * Math.sin(o + v * a)
  53721. , I = e * Math.cos(o + v * a)
  53722. , E = e * Math.sin(n + A * r) * Math.sin(o + v * a);
  53723. f.set(C, I, E).normalize(),
  53724. c.setXYZ(d, C, I, E),
  53725. h.setXYZ(d, f.x, f.y, f.z),
  53726. u.setXY(d, A, 1 - v),
  53727. m.push(d),
  53728. d++
  53729. }
  53730. p.push(m)
  53731. }
  53732. var _ = [];
  53733. for (g = 0; g < i; g++)
  53734. for (y = 0; y < t; y++) {
  53735. var b = p[g][y + 1]
  53736. , w = p[g][y]
  53737. , T = p[g + 1][y]
  53738. , x = p[g + 1][y + 1];
  53739. (0 !== g || 0 < o) && _.push(b, w, x),
  53740. (g !== i - 1 || s < Math.PI) && _.push(w, T, x)
  53741. }
  53742. this.setIndex(new (65535 < c.count ? Ci.Uint32Attribute : Ci.Uint16Attribute)(_,1)),
  53743. this.addAttribute("position", c),
  53744. this.addAttribute("normal", h),
  53745. this.addAttribute("uv", u),
  53746. this.boundingSphere = new Ci.Sphere(new Ci.Vector3,e)
  53747. }
  53748. ,
  53749. Ci.SphereBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53750. Ci.SphereBufferGeometry.prototype.constructor = Ci.SphereBufferGeometry,
  53751. Ci.TextGeometry = function(e, t) {
  53752. var i = (t = t || {}).font;
  53753. if (i instanceof Ci.Font == 0)
  53754. return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),
  53755. new Ci.Geometry;
  53756. var n = i.generateShapes(e, t.size, t.curveSegments);
  53757. t.amount = void 0 !== t.height ? t.height : 50,
  53758. void 0 === t.bevelThickness && (t.bevelThickness = 10),
  53759. void 0 === t.bevelSize && (t.bevelSize = 8),
  53760. void 0 === t.bevelEnabled && (t.bevelEnabled = !1),
  53761. Ci.ExtrudeGeometry.call(this, n, t),
  53762. this.type = "TextGeometry"
  53763. }
  53764. ,
  53765. Ci.TextGeometry.prototype = Object.create(Ci.ExtrudeGeometry.prototype),
  53766. Ci.TextGeometry.prototype.constructor = Ci.TextGeometry,
  53767. Ci.TorusBufferGeometry = function(e, t, i, n, r) {
  53768. Ci.BufferGeometry.call(this),
  53769. this.type = "TorusBufferGeometry",
  53770. this.parameters = {
  53771. radius: e,
  53772. tube: t,
  53773. radialSegments: i,
  53774. tubularSegments: n,
  53775. arc: r
  53776. },
  53777. e = e || 100,
  53778. t = t || 40,
  53779. i = Math.floor(i) || 8,
  53780. n = Math.floor(n) || 6,
  53781. r = r || 2 * Math.PI;
  53782. var o, a, s = (i + 1) * (n + 1), l = i * n * 2 * 3, c = new (65535 < l ? Uint32Array : Uint16Array)(l), h = new Float32Array(3 * s), u = new Float32Array(3 * s), d = new Float32Array(2 * s), p = 0, f = 0, g = 0, m = new Ci.Vector3, v = new Ci.Vector3, y = new Ci.Vector3;
  53783. for (o = 0; o <= i; o++)
  53784. for (a = 0; a <= n; a++) {
  53785. var A = a / n * r
  53786. , C = o / i * Math.PI * 2;
  53787. v.x = (e + t * Math.cos(C)) * Math.cos(A),
  53788. v.y = (e + t * Math.cos(C)) * Math.sin(A),
  53789. v.z = t * Math.sin(C),
  53790. h[p] = v.x,
  53791. h[p + 1] = v.y,
  53792. h[p + 2] = v.z,
  53793. m.x = e * Math.cos(A),
  53794. m.y = e * Math.sin(A),
  53795. y.subVectors(v, m).normalize(),
  53796. u[p] = y.x,
  53797. u[p + 1] = y.y,
  53798. u[p + 2] = y.z,
  53799. d[f] = a / n,
  53800. d[f + 1] = o / i,
  53801. p += 3,
  53802. f += 2
  53803. }
  53804. for (o = 1; o <= i; o++)
  53805. for (a = 1; a <= n; a++) {
  53806. var I = (n + 1) * o + a - 1
  53807. , E = (n + 1) * (o - 1) + a - 1
  53808. , _ = (n + 1) * (o - 1) + a
  53809. , b = (n + 1) * o + a;
  53810. c[g] = I,
  53811. c[g + 1] = E,
  53812. c[g + 2] = b,
  53813. c[g + 3] = E,
  53814. c[g + 4] = _,
  53815. c[g + 5] = b,
  53816. g += 6
  53817. }
  53818. this.setIndex(new Ci.BufferAttribute(c,1)),
  53819. this.addAttribute("position", new Ci.BufferAttribute(h,3)),
  53820. this.addAttribute("normal", new Ci.BufferAttribute(u,3)),
  53821. this.addAttribute("uv", new Ci.BufferAttribute(d,2))
  53822. }
  53823. ,
  53824. Ci.TorusBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53825. Ci.TorusBufferGeometry.prototype.constructor = Ci.TorusBufferGeometry,
  53826. Ci.TorusGeometry = function(e, t, i, n, r) {
  53827. Ci.Geometry.call(this),
  53828. this.type = "TorusGeometry",
  53829. this.parameters = {
  53830. radius: e,
  53831. tube: t,
  53832. radialSegments: i,
  53833. tubularSegments: n,
  53834. arc: r
  53835. },
  53836. this.fromBufferGeometry(new Ci.TorusBufferGeometry(e,t,i,n,r))
  53837. }
  53838. ,
  53839. Ci.TorusGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53840. Ci.TorusGeometry.prototype.constructor = Ci.TorusGeometry,
  53841. Ci.TorusKnotBufferGeometry = function(e, t, i, n, r, o) {
  53842. function a(e, t, i, n, r) {
  53843. var o = Math.cos(e)
  53844. , a = Math.sin(e)
  53845. , s = i / t * e
  53846. , l = Math.cos(s);
  53847. r.x = n * (2 + l) * .5 * o,
  53848. r.y = n * (2 + l) * a * .5,
  53849. r.z = n * Math.sin(s) * .5
  53850. }
  53851. Ci.BufferGeometry.call(this),
  53852. this.type = "TorusKnotBufferGeometry",
  53853. this.parameters = {
  53854. radius: e,
  53855. tube: t,
  53856. tubularSegments: i,
  53857. radialSegments: n,
  53858. p: r,
  53859. q: o
  53860. },
  53861. e = e || 100,
  53862. t = t || 40,
  53863. i = Math.floor(i) || 64,
  53864. r = r || 2,
  53865. o = o || 3;
  53866. var s, l, c = ((n = Math.floor(n) || 8) + 1) * (i + 1), h = n * i * 2 * 3, u = new Ci.BufferAttribute(new (65535 < h ? Uint32Array : Uint16Array)(h),1), d = new Ci.BufferAttribute(new Float32Array(3 * c),3), p = new Ci.BufferAttribute(new Float32Array(3 * c),3), f = new Ci.BufferAttribute(new Float32Array(2 * c),2), g = 0, m = 0, v = new Ci.Vector3, y = new Ci.Vector3, A = new Ci.Vector2, C = new Ci.Vector3, I = new Ci.Vector3, E = new Ci.Vector3, _ = new Ci.Vector3, b = new Ci.Vector3;
  53867. for (s = 0; s <= i; ++s) {
  53868. var w = s / i * r * Math.PI * 2;
  53869. for (a(w, r, o, e, C),
  53870. a(.01 + w, r, o, e, I),
  53871. _.subVectors(I, C),
  53872. b.addVectors(I, C),
  53873. E.crossVectors(_, b),
  53874. b.crossVectors(E, _),
  53875. E.normalize(),
  53876. b.normalize(),
  53877. l = 0; l <= n; ++l) {
  53878. var T = l / n * Math.PI * 2
  53879. , x = -t * Math.cos(T)
  53880. , S = t * Math.sin(T);
  53881. v.x = C.x + (x * b.x + S * E.x),
  53882. v.y = C.y + (x * b.y + S * E.y),
  53883. v.z = C.z + (x * b.z + S * E.z),
  53884. d.setXYZ(g, v.x, v.y, v.z),
  53885. y.subVectors(v, C).normalize(),
  53886. p.setXYZ(g, y.x, y.y, y.z),
  53887. A.x = s / i,
  53888. A.y = l / n,
  53889. f.setXY(g, A.x, A.y),
  53890. g++
  53891. }
  53892. }
  53893. for (l = 1; l <= i; l++)
  53894. for (s = 1; s <= n; s++) {
  53895. var M = (n + 1) * (l - 1) + (s - 1)
  53896. , R = (n + 1) * l + (s - 1)
  53897. , P = (n + 1) * l + s
  53898. , O = (n + 1) * (l - 1) + s;
  53899. u.setX(m, M),
  53900. m++,
  53901. u.setX(m, R),
  53902. m++,
  53903. u.setX(m, O),
  53904. m++,
  53905. u.setX(m, R),
  53906. m++,
  53907. u.setX(m, P),
  53908. m++,
  53909. u.setX(m, O),
  53910. m++
  53911. }
  53912. this.setIndex(u),
  53913. this.addAttribute("position", d),
  53914. this.addAttribute("normal", p),
  53915. this.addAttribute("uv", f)
  53916. }
  53917. ,
  53918. Ci.TorusKnotBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53919. Ci.TorusKnotBufferGeometry.prototype.constructor = Ci.TorusKnotBufferGeometry,
  53920. Ci.TorusKnotGeometry = function(e, t, i, n, r, o, a) {
  53921. Ci.Geometry.call(this),
  53922. this.type = "TorusKnotGeometry",
  53923. this.parameters = {
  53924. radius: e,
  53925. tube: t,
  53926. tubularSegments: i,
  53927. radialSegments: n,
  53928. p: r,
  53929. q: o
  53930. },
  53931. void 0 !== a && console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),
  53932. this.fromBufferGeometry(new Ci.TorusKnotBufferGeometry(e,t,i,n,r,o)),
  53933. this.mergeVertices()
  53934. }
  53935. ,
  53936. Ci.TorusKnotGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53937. Ci.TorusKnotGeometry.prototype.constructor = Ci.TorusKnotGeometry,
  53938. Ci.TubeGeometry = function(e, t, i, n, r, o) {
  53939. Ci.Geometry.call(this),
  53940. this.type = "TubeGeometry",
  53941. this.parameters = {
  53942. path: e,
  53943. segments: t,
  53944. radius: i,
  53945. radialSegments: n,
  53946. closed: r,
  53947. taper: o
  53948. },
  53949. t = t || 64,
  53950. i = i || 1,
  53951. n = n || 8,
  53952. r = r || !1,
  53953. o = o || Ci.TubeGeometry.NoTaper;
  53954. var a, s, l, c, h, u, d, p, f, g, m, v, y, A, C, I, E, _, b, w, T, x, S, M = [], R = this, P = t + 1, O = new Ci.Vector3, L = new Ci.TubeGeometry.FrenetFrames(e,t,r), D = L.tangents, N = L.normals, F = L.binormals;
  53955. for (this.tangents = D,
  53956. this.normals = N,
  53957. this.binormals = F,
  53958. f = 0; f < P; f++)
  53959. for (M[f] = [],
  53960. l = f / (P - 1),
  53961. p = e.getPointAt(l),
  53962. D[f],
  53963. a = N[f],
  53964. s = F[f],
  53965. h = i * o(l),
  53966. g = 0; g < n; g++)
  53967. c = g / n * 2 * Math.PI,
  53968. u = -h * Math.cos(c),
  53969. d = h * Math.sin(c),
  53970. O.copy(p),
  53971. O.x += u * a.x + d * s.x,
  53972. O.y += u * a.y + d * s.y,
  53973. O.z += u * a.z + d * s.z,
  53974. M[f][g] = (T = O.x,
  53975. x = O.y,
  53976. S = O.z,
  53977. R.vertices.push(new Ci.Vector3(T,x,S)) - 1);
  53978. for (f = 0; f < t; f++)
  53979. for (g = 0; g < n; g++)
  53980. m = r ? (f + 1) % t : f + 1,
  53981. v = (g + 1) % n,
  53982. y = M[f][g],
  53983. A = M[m][g],
  53984. C = M[m][v],
  53985. I = M[f][v],
  53986. E = new Ci.Vector2(f / t,g / n),
  53987. _ = new Ci.Vector2((f + 1) / t,g / n),
  53988. b = new Ci.Vector2((f + 1) / t,(g + 1) / n),
  53989. w = new Ci.Vector2(f / t,(g + 1) / n),
  53990. this.faces.push(new Ci.Face3(y,A,I)),
  53991. this.faceVertexUvs[0].push([E, _, w]),
  53992. this.faces.push(new Ci.Face3(A,C,I)),
  53993. this.faceVertexUvs[0].push([_.clone(), b, w.clone()]);
  53994. this.computeFaceNormals(),
  53995. this.computeVertexNormals()
  53996. }
  53997. ,
  53998. Ci.TubeGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53999. Ci.TubeGeometry.prototype.constructor = Ci.TubeGeometry,
  54000. Ci.TubeGeometry.NoTaper = function(e) {
  54001. return 1
  54002. }
  54003. ,
  54004. Ci.TubeGeometry.SinusoidalTaper = function(e) {
  54005. return Math.sin(Math.PI * e)
  54006. }
  54007. ,
  54008. Ci.TubeGeometry.FrenetFrames = function(e, t, i) {
  54009. var n, r, o, a, s, l, c, h = new Ci.Vector3, u = [], d = [], p = [], f = new Ci.Vector3, g = new Ci.Matrix4, m = t + 1;
  54010. for (this.tangents = u,
  54011. this.normals = d,
  54012. this.binormals = p,
  54013. l = 0; l < m; l++)
  54014. c = l / (m - 1),
  54015. u[l] = e.getTangentAt(c),
  54016. u[l].normalize();
  54017. for (d[0] = new Ci.Vector3,
  54018. p[0] = new Ci.Vector3,
  54019. r = Number.MAX_VALUE,
  54020. o = Math.abs(u[0].x),
  54021. a = Math.abs(u[0].y),
  54022. s = Math.abs(u[0].z),
  54023. o <= r && (r = o,
  54024. h.set(1, 0, 0)),
  54025. a <= r && (r = a,
  54026. h.set(0, 1, 0)),
  54027. s <= r && h.set(0, 0, 1),
  54028. f.crossVectors(u[0], h).normalize(),
  54029. d[0].crossVectors(u[0], f),
  54030. p[0].crossVectors(u[0], d[0]),
  54031. l = 1; l < m; l++)
  54032. d[l] = d[l - 1].clone(),
  54033. p[l] = p[l - 1].clone(),
  54034. f.crossVectors(u[l - 1], u[l]),
  54035. f.length() > Number.EPSILON && (f.normalize(),
  54036. n = Math.acos(Ci.Math.clamp(u[l - 1].dot(u[l]), -1, 1)),
  54037. d[l].applyMatrix4(g.makeRotationAxis(f, n))),
  54038. p[l].crossVectors(u[l], d[l]);
  54039. if (i)
  54040. for (n = Math.acos(Ci.Math.clamp(d[0].dot(d[m - 1]), -1, 1)),
  54041. n /= m - 1,
  54042. 0 < u[0].dot(f.crossVectors(d[0], d[m - 1])) && (n = -n),
  54043. l = 1; l < m; l++)
  54044. d[l].applyMatrix4(g.makeRotationAxis(u[l], n * l)),
  54045. p[l].crossVectors(u[l], d[l])
  54046. }
  54047. ,
  54048. Ci.PolyhedronGeometry = function(e, t, i, n) {
  54049. function f(e) {
  54050. var t = e.normalize().clone();
  54051. t.index = m.vertices.push(t) - 1;
  54052. var i = a(e) / 2 / Math.PI + .5
  54053. , n = function(e) {
  54054. return Math.atan2(-e.y, Math.sqrt(e.x * e.x + e.z * e.z))
  54055. }(e) / Math.PI + .5;
  54056. return t.uv = new Ci.Vector2(i,1 - n),
  54057. t
  54058. }
  54059. function g(e, t, i, n) {
  54060. var r = new Ci.Face3(e.index,t.index,i.index,[e.clone(), t.clone(), i.clone()],void 0,n);
  54061. m.faces.push(r),
  54062. y.copy(e).add(t).add(i).divideScalar(3);
  54063. var o = a(y);
  54064. m.faceVertexUvs[0].push([s(e.uv, e, o), s(t.uv, t, o), s(i.uv, i, o)])
  54065. }
  54066. function r(e, t) {
  54067. for (var i = Math.pow(2, t), n = f(m.vertices[e.a]), r = f(m.vertices[e.b]), o = f(m.vertices[e.c]), a = [], s = e.materialIndex, l = 0; l <= i; l++) {
  54068. a[l] = [];
  54069. for (var c = f(n.clone().lerp(o, l / i)), h = f(r.clone().lerp(o, l / i)), u = i - l, d = 0; d <= u; d++)
  54070. a[l][d] = 0 === d && l === i ? c : f(c.clone().lerp(h, d / u))
  54071. }
  54072. for (l = 0; l < i; l++)
  54073. for (d = 0; d < 2 * (i - l) - 1; d++) {
  54074. var p = Math.floor(d / 2);
  54075. d % 2 == 0 ? g(a[l][p + 1], a[l + 1][p], a[l][p], s) : g(a[l][p + 1], a[l + 1][p + 1], a[l + 1][p], s)
  54076. }
  54077. }
  54078. function a(e) {
  54079. return Math.atan2(e.z, -e.x)
  54080. }
  54081. function s(e, t, i) {
  54082. return i < 0 && 1 === e.x && (e = new Ci.Vector2(e.x - 1,e.y)),
  54083. 0 === t.x && 0 === t.z && (e = new Ci.Vector2(i / 2 / Math.PI + .5,e.y)),
  54084. e.clone()
  54085. }
  54086. Ci.Geometry.call(this),
  54087. this.type = "PolyhedronGeometry",
  54088. this.parameters = {
  54089. vertices: e,
  54090. indices: t,
  54091. radius: i,
  54092. detail: n
  54093. },
  54094. i = i || 1,
  54095. n = n || 0;
  54096. for (var m = this, o = 0, l = e.length; o < l; o += 3)
  54097. f(new Ci.Vector3(e[o],e[o + 1],e[o + 2]));
  54098. var c = this.vertices
  54099. , h = []
  54100. , u = (o = 0,
  54101. 0);
  54102. for (l = t.length; o < l; o += 3,
  54103. u++) {
  54104. var d = c[t[o]]
  54105. , p = c[t[o + 1]]
  54106. , v = c[t[o + 2]];
  54107. h[u] = new Ci.Face3(d.index,p.index,v.index,[d.clone(), p.clone(), v.clone()],void 0,u)
  54108. }
  54109. var y = new Ci.Vector3;
  54110. for (o = 0,
  54111. l = h.length; o < l; o++)
  54112. r(h[o], n);
  54113. for (o = 0,
  54114. l = this.faceVertexUvs[0].length; o < l; o++) {
  54115. var A = this.faceVertexUvs[0][o]
  54116. , C = A[0].x
  54117. , I = A[1].x
  54118. , E = A[2].x
  54119. , _ = Math.max(C, I, E)
  54120. , b = Math.min(C, I, E);
  54121. .9 < _ && b < .1 && (C < .2 && (A[0].x += 1),
  54122. I < .2 && (A[1].x += 1),
  54123. E < .2 && (A[2].x += 1))
  54124. }
  54125. for (o = 0,
  54126. l = this.vertices.length; o < l; o++)
  54127. this.vertices[o].multiplyScalar(i);
  54128. this.mergeVertices(),
  54129. this.computeFaceNormals(),
  54130. this.boundingSphere = new Ci.Sphere(new Ci.Vector3,i)
  54131. }
  54132. ,
  54133. Ci.PolyhedronGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54134. Ci.PolyhedronGeometry.prototype.constructor = Ci.PolyhedronGeometry,
  54135. Ci.DodecahedronGeometry = function(e, t) {
  54136. var i = (1 + Math.sqrt(5)) / 2
  54137. , n = 1 / i
  54138. , r = [-1, -1, -1, -1, -1, 1, -1, 1, -1, -1, 1, 1, 1, -1, -1, 1, -1, 1, 1, 1, -1, 1, 1, 1, 0, -n, -i, 0, -n, i, 0, n, -i, 0, n, i, -n, -i, 0, -n, i, 0, n, -i, 0, n, i, 0, -i, 0, -n, i, 0, -n, -i, 0, n, i, 0, n];
  54139. Ci.PolyhedronGeometry.call(this, r, [3, 11, 7, 3, 7, 15, 3, 15, 13, 7, 19, 17, 7, 17, 6, 7, 6, 15, 17, 4, 8, 17, 8, 10, 17, 10, 6, 8, 0, 16, 8, 16, 2, 8, 2, 10, 0, 12, 1, 0, 1, 18, 0, 18, 16, 6, 10, 2, 6, 2, 13, 6, 13, 15, 2, 16, 18, 2, 18, 3, 2, 3, 13, 18, 1, 9, 18, 9, 11, 18, 11, 3, 4, 14, 12, 4, 12, 0, 4, 0, 8, 11, 9, 5, 11, 5, 19, 11, 19, 7, 19, 5, 14, 19, 14, 4, 19, 4, 17, 1, 12, 14, 1, 14, 5, 1, 5, 9], e, t),
  54140. this.type = "DodecahedronGeometry",
  54141. this.parameters = {
  54142. radius: e,
  54143. detail: t
  54144. }
  54145. }
  54146. ,
  54147. Ci.DodecahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  54148. Ci.DodecahedronGeometry.prototype.constructor = Ci.DodecahedronGeometry,
  54149. Ci.IcosahedronGeometry = function(e, t) {
  54150. var i = (1 + Math.sqrt(5)) / 2
  54151. , n = [-1, i, 0, 1, i, 0, -1, -i, 0, 1, -i, 0, 0, -1, i, 0, 1, i, 0, -1, -i, 0, 1, -i, i, 0, -1, i, 0, 1, -i, 0, -1, -i, 0, 1];
  54152. Ci.PolyhedronGeometry.call(this, n, [0, 11, 5, 0, 5, 1, 0, 1, 7, 0, 7, 10, 0, 10, 11, 1, 5, 9, 5, 11, 4, 11, 10, 2, 10, 7, 6, 7, 1, 8, 3, 9, 4, 3, 4, 2, 3, 2, 6, 3, 6, 8, 3, 8, 9, 4, 9, 5, 2, 4, 11, 6, 2, 10, 8, 6, 7, 9, 8, 1], e, t),
  54153. this.type = "IcosahedronGeometry",
  54154. this.parameters = {
  54155. radius: e,
  54156. detail: t
  54157. }
  54158. }
  54159. ,
  54160. Ci.IcosahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  54161. Ci.IcosahedronGeometry.prototype.constructor = Ci.IcosahedronGeometry,
  54162. Ci.OctahedronGeometry = function(e, t) {
  54163. Ci.PolyhedronGeometry.call(this, [1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1], [0, 2, 4, 0, 4, 3, 0, 3, 5, 0, 5, 2, 1, 2, 5, 1, 5, 3, 1, 3, 4, 1, 4, 2], e, t),
  54164. this.type = "OctahedronGeometry",
  54165. this.parameters = {
  54166. radius: e,
  54167. detail: t
  54168. }
  54169. }
  54170. ,
  54171. Ci.OctahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  54172. Ci.OctahedronGeometry.prototype.constructor = Ci.OctahedronGeometry,
  54173. Ci.TetrahedronGeometry = function(e, t) {
  54174. Ci.PolyhedronGeometry.call(this, [1, 1, 1, -1, -1, 1, -1, 1, -1, 1, -1, -1], [2, 1, 0, 0, 3, 2, 1, 3, 0, 2, 3, 1], e, t),
  54175. this.type = "TetrahedronGeometry",
  54176. this.parameters = {
  54177. radius: e,
  54178. detail: t
  54179. }
  54180. }
  54181. ,
  54182. Ci.TetrahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  54183. Ci.TetrahedronGeometry.prototype.constructor = Ci.TetrahedronGeometry,
  54184. Ci.ParametricGeometry = function(e, t, i) {
  54185. Ci.Geometry.call(this),
  54186. this.type = "ParametricGeometry",
  54187. this.parameters = {
  54188. func: e,
  54189. slices: t,
  54190. stacks: i
  54191. };
  54192. var n, r, o, a, s, l, c, h, u, d, p, f, g = this.vertices, m = this.faces, v = this.faceVertexUvs[0], y = t + 1;
  54193. for (n = 0; n <= i; n++)
  54194. for (a = n / i,
  54195. r = 0; r <= t; r++)
  54196. o = e(r / t, a),
  54197. g.push(o);
  54198. for (n = 0; n < i; n++)
  54199. for (r = 0; r < t; r++)
  54200. l = (s = n * y + r) + 1,
  54201. c = (n + 1) * y + r + 1,
  54202. h = (n + 1) * y + r,
  54203. u = new Ci.Vector2(r / t,n / i),
  54204. d = new Ci.Vector2((r + 1) / t,n / i),
  54205. p = new Ci.Vector2((r + 1) / t,(n + 1) / i),
  54206. f = new Ci.Vector2(r / t,(n + 1) / i),
  54207. m.push(new Ci.Face3(s,l,h)),
  54208. v.push([u, d, f]),
  54209. m.push(new Ci.Face3(l,c,h)),
  54210. v.push([d.clone(), p, f.clone()]);
  54211. this.computeFaceNormals(),
  54212. this.computeVertexNormals()
  54213. }
  54214. ,
  54215. Ci.ParametricGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54216. Ci.ParametricGeometry.prototype.constructor = Ci.ParametricGeometry,
  54217. Ci.WireframeGeometry = function(e) {
  54218. function t(e, t) {
  54219. return e - t
  54220. }
  54221. Ci.BufferGeometry.call(this);
  54222. var i = [0, 0]
  54223. , n = {}
  54224. , r = ["a", "b", "c"];
  54225. if (e instanceof Ci.Geometry) {
  54226. for (var o = e.vertices, a = e.faces, s = 0, l = new Uint32Array(6 * a.length), c = 0, h = a.length; c < h; c++)
  54227. for (var u = a[c], d = 0; d < 3; d++) {
  54228. i[0] = u[r[d]],
  54229. i[1] = u[r[(d + 1) % 3]],
  54230. i.sort(t),
  54231. void 0 === n[E = i.toString()] && (l[2 * s] = i[0],
  54232. l[2 * s + 1] = i[1],
  54233. n[E] = !0,
  54234. s++)
  54235. }
  54236. var p = new Float32Array(2 * s * 3);
  54237. for (c = 0,
  54238. h = s; c < h; c++)
  54239. for (d = 0; d < 2; d++) {
  54240. var f = o[l[2 * c + d]];
  54241. p[(_ = 6 * c + 3 * d) + 0] = f.x,
  54242. p[_ + 1] = f.y,
  54243. p[_ + 2] = f.z
  54244. }
  54245. this.addAttribute("position", new Ci.BufferAttribute(p,3))
  54246. } else if (e instanceof Ci.BufferGeometry)
  54247. if (null !== e.index) {
  54248. var g = e.index.array
  54249. , m = (o = e.attributes.position,
  54250. e.groups);
  54251. s = 0;
  54252. 0 === m.length && e.addGroup(0, g.length);
  54253. l = new Uint32Array(2 * g.length);
  54254. for (var v = 0, y = m.length; v < y; ++v)
  54255. for (var A = m[v], C = A.start, I = (c = C,
  54256. C + A.count); c < I; c += 3)
  54257. for (d = 0; d < 3; d++) {
  54258. var E;
  54259. i[0] = g[c + d],
  54260. i[1] = g[c + (d + 1) % 3],
  54261. i.sort(t),
  54262. void 0 === n[E = i.toString()] && (l[2 * s] = i[0],
  54263. l[2 * s + 1] = i[1],
  54264. n[E] = !0,
  54265. s++)
  54266. }
  54267. for (p = new Float32Array(2 * s * 3),
  54268. c = 0,
  54269. h = s; c < h; c++)
  54270. for (d = 0; d < 2; d++) {
  54271. var _ = 6 * c + 3 * d
  54272. , b = l[2 * c + d];
  54273. p[_ + 0] = o.getX(b),
  54274. p[_ + 1] = o.getY(b),
  54275. p[_ + 2] = o.getZ(b)
  54276. }
  54277. this.addAttribute("position", new Ci.BufferAttribute(p,3))
  54278. } else {
  54279. var w = (s = (o = e.attributes.position.array).length / 3) / 3;
  54280. for (p = new Float32Array(2 * s * 3),
  54281. c = 0,
  54282. h = w; c < h; c++)
  54283. for (d = 0; d < 3; d++) {
  54284. var T = 9 * c + 3 * d;
  54285. p[(_ = 18 * c + 6 * d) + 0] = o[T],
  54286. p[_ + 1] = o[1 + T],
  54287. p[_ + 2] = o[2 + T];
  54288. b = 9 * c + (d + 1) % 3 * 3;
  54289. p[_ + 3] = o[b],
  54290. p[_ + 4] = o[b + 1],
  54291. p[_ + 5] = o[b + 2]
  54292. }
  54293. this.addAttribute("position", new Ci.BufferAttribute(p,3))
  54294. }
  54295. }
  54296. ,
  54297. Ci.WireframeGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  54298. Ci.WireframeGeometry.prototype.constructor = Ci.WireframeGeometry,
  54299. Ci.AxisHelper = function(e) {
  54300. e = e || 1;
  54301. var t = new Float32Array([0, 0, 0, e, 0, 0, 0, 0, 0, 0, e, 0, 0, 0, 0, 0, 0, e])
  54302. , i = new Float32Array([1, 0, 0, 1, .6, 0, 0, 1, 0, .6, 1, 0, 0, 0, 1, 0, .6, 1])
  54303. , n = new Ci.BufferGeometry;
  54304. n.addAttribute("position", new Ci.BufferAttribute(t,3)),
  54305. n.addAttribute("color", new Ci.BufferAttribute(i,3));
  54306. var r = new Ci.LineBasicMaterial({
  54307. vertexColors: Ci.VertexColors
  54308. });
  54309. Ci.LineSegments.call(this, n, r)
  54310. }
  54311. ,
  54312. Ci.AxisHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54313. Ci.AxisHelper.prototype.constructor = Ci.AxisHelper,
  54314. Ci.ArrowHelper = function() {
  54315. var a = new Ci.Geometry;
  54316. a.vertices.push(new Ci.Vector3(0,0,0), new Ci.Vector3(0,1,0));
  54317. var s = new Ci.CylinderGeometry(0,.5,1,5,1);
  54318. return s.translate(0, -.5, 0),
  54319. function(e, t, i, n, r, o) {
  54320. Ci.Object3D.call(this),
  54321. void 0 === n && (n = 16776960),
  54322. void 0 === i && (i = 1),
  54323. void 0 === r && (r = .2 * i),
  54324. void 0 === o && (o = .2 * r),
  54325. this.position.copy(t),
  54326. this.line = new Ci.Line(a,new Ci.LineBasicMaterial({
  54327. color: n
  54328. })),
  54329. this.line.matrixAutoUpdate = !1,
  54330. this.add(this.line),
  54331. this.cone = new Ci.Mesh(s,new Ci.MeshBasicMaterial({
  54332. color: n
  54333. })),
  54334. this.cone.matrixAutoUpdate = !1,
  54335. this.add(this.cone),
  54336. this.setDirection(e),
  54337. this.setLength(i, r, o)
  54338. }
  54339. }(),
  54340. Ci.ArrowHelper.prototype = Object.create(Ci.Object3D.prototype),
  54341. Ci.ArrowHelper.prototype.constructor = Ci.ArrowHelper,
  54342. Ci.ArrowHelper.prototype.setDirection = (Ai = new Ci.Vector3,
  54343. function(e) {
  54344. .99999 < e.y ? this.quaternion.set(0, 0, 0, 1) : e.y < -.99999 ? this.quaternion.set(1, 0, 0, 0) : (Ai.set(e.z, 0, -e.x).normalize(),
  54345. yi = Math.acos(e.y),
  54346. this.quaternion.setFromAxisAngle(Ai, yi))
  54347. }
  54348. ),
  54349. Ci.ArrowHelper.prototype.setLength = function(e, t, i) {
  54350. void 0 === t && (t = .2 * e),
  54351. void 0 === i && (i = .2 * t),
  54352. this.line.scale.set(1, Math.max(0, e - t), 1),
  54353. this.line.updateMatrix(),
  54354. this.cone.scale.set(i, t, i),
  54355. this.cone.position.y = e,
  54356. this.cone.updateMatrix()
  54357. }
  54358. ,
  54359. Ci.ArrowHelper.prototype.setColor = function(e) {
  54360. this.line.material.color.set(e),
  54361. this.cone.material.color.set(e)
  54362. }
  54363. ,
  54364. Ci.BoxHelper = function(e) {
  54365. 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])
  54366. , i = new Float32Array(24)
  54367. , n = new Ci.BufferGeometry;
  54368. n.setIndex(new Ci.BufferAttribute(t,1)),
  54369. n.addAttribute("position", new Ci.BufferAttribute(i,3)),
  54370. Ci.LineSegments.call(this, n, new Ci.LineBasicMaterial({
  54371. color: 16776960
  54372. })),
  54373. void 0 !== e && this.update(e)
  54374. }
  54375. ,
  54376. Ci.BoxHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54377. Ci.BoxHelper.prototype.constructor = Ci.BoxHelper,
  54378. Ci.BoxHelper.prototype.update = (vi = new Ci.Box3,
  54379. function(e) {
  54380. if (vi.setFromObject(e),
  54381. !vi.isEmpty()) {
  54382. var t = vi.min
  54383. , i = vi.max
  54384. , n = this.geometry.attributes.position
  54385. , r = n.array;
  54386. r[0] = i.x,
  54387. r[1] = i.y,
  54388. r[2] = i.z,
  54389. r[3] = t.x,
  54390. r[4] = i.y,
  54391. r[5] = i.z,
  54392. r[6] = t.x,
  54393. r[7] = t.y,
  54394. r[8] = i.z,
  54395. r[9] = i.x,
  54396. r[10] = t.y,
  54397. r[11] = i.z,
  54398. r[12] = i.x,
  54399. r[13] = i.y,
  54400. r[14] = t.z,
  54401. r[15] = t.x,
  54402. r[16] = i.y,
  54403. r[17] = t.z,
  54404. r[18] = t.x,
  54405. r[19] = t.y,
  54406. r[20] = t.z,
  54407. r[21] = i.x,
  54408. r[22] = t.y,
  54409. r[23] = t.z,
  54410. n.needsUpdate = !0,
  54411. this.geometry.computeBoundingSphere()
  54412. }
  54413. }
  54414. ),
  54415. Ci.BoundingBoxHelper = function(e, t) {
  54416. var i = void 0 !== t ? t : 8947848;
  54417. this.object = e,
  54418. this.box = new Ci.Box3,
  54419. Ci.Mesh.call(this, new Ci.BoxGeometry(1,1,1), new Ci.MeshBasicMaterial({
  54420. color: i,
  54421. wireframe: !0
  54422. }))
  54423. }
  54424. ,
  54425. Ci.BoundingBoxHelper.prototype = Object.create(Ci.Mesh.prototype),
  54426. Ci.BoundingBoxHelper.prototype.constructor = Ci.BoundingBoxHelper,
  54427. Ci.BoundingBoxHelper.prototype.update = function() {
  54428. this.box.setFromObject(this.object),
  54429. this.box.size(this.scale),
  54430. this.box.center(this.position)
  54431. }
  54432. ,
  54433. Ci.CameraHelper = function(e) {
  54434. function t(e, t, i) {
  54435. n(e, i),
  54436. n(t, i)
  54437. }
  54438. function n(e, t) {
  54439. i.vertices.push(new Ci.Vector3),
  54440. i.colors.push(new Ci.Color(t)),
  54441. void 0 === o[e] && (o[e] = []),
  54442. o[e].push(i.vertices.length - 1)
  54443. }
  54444. var i = new Ci.Geometry
  54445. , r = new Ci.LineBasicMaterial({
  54446. color: 16777215,
  54447. vertexColors: Ci.FaceColors
  54448. })
  54449. , o = {}
  54450. , a = 16755200
  54451. , s = 16711680
  54452. , l = 3355443;
  54453. t("n1", "n2", a),
  54454. t("n2", "n4", a),
  54455. t("n4", "n3", a),
  54456. t("n3", "n1", a),
  54457. t("f1", "f2", a),
  54458. t("f2", "f4", a),
  54459. t("f4", "f3", a),
  54460. t("f3", "f1", a),
  54461. t("n1", "f1", a),
  54462. t("n2", "f2", a),
  54463. t("n3", "f3", a),
  54464. t("n4", "f4", a),
  54465. t("p", "n1", s),
  54466. t("p", "n2", s),
  54467. t("p", "n3", s),
  54468. t("p", "n4", s),
  54469. t("u1", "u2", 43775),
  54470. t("u2", "u3", 43775),
  54471. t("u3", "u1", 43775),
  54472. t("c", "t", 16777215),
  54473. t("p", "c", l),
  54474. t("cn1", "cn2", l),
  54475. t("cn3", "cn4", l),
  54476. t("cf1", "cf2", l),
  54477. t("cf3", "cf4", l),
  54478. Ci.LineSegments.call(this, i, r),
  54479. this.camera = e,
  54480. this.camera.updateProjectionMatrix(),
  54481. this.matrix = e.matrixWorld,
  54482. this.matrixAutoUpdate = !1,
  54483. this.pointMap = o,
  54484. this.update()
  54485. }
  54486. ,
  54487. Ci.CameraHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54488. Ci.CameraHelper.prototype.constructor = Ci.CameraHelper,
  54489. Ci.CameraHelper.prototype.update = (gi = new Ci.Vector3,
  54490. mi = new Ci.Camera,
  54491. function() {
  54492. pi = this.geometry,
  54493. fi = this.pointMap,
  54494. mi.projectionMatrix.copy(this.camera.projectionMatrix),
  54495. Ni("c", 0, 0, -1),
  54496. Ni("t", 0, 0, 1),
  54497. Ni("n1", -1, -1, -1),
  54498. Ni("n2", 1, -1, -1),
  54499. Ni("n3", -1, 1, -1),
  54500. Ni("n4", 1, 1, -1),
  54501. Ni("f1", -1, -1, 1),
  54502. Ni("f2", 1, -1, 1),
  54503. Ni("f3", -1, 1, 1),
  54504. Ni("f4", 1, 1, 1),
  54505. Ni("u1", .7, 1.1, -1),
  54506. Ni("u2", -.7, 1.1, -1),
  54507. Ni("u3", 0, 2, -1),
  54508. Ni("cf1", -1, 0, 1),
  54509. Ni("cf2", 1, 0, 1),
  54510. Ni("cf3", 0, -1, 1),
  54511. Ni("cf4", 0, 1, 1),
  54512. Ni("cn1", -1, 0, -1),
  54513. Ni("cn2", 1, 0, -1),
  54514. Ni("cn3", 0, -1, -1),
  54515. Ni("cn4", 0, 1, -1),
  54516. pi.verticesNeedUpdate = !0
  54517. }
  54518. ),
  54519. Ci.DirectionalLightHelper = function(e, t) {
  54520. Ci.Object3D.call(this),
  54521. this.light = e,
  54522. this.light.updateMatrixWorld(),
  54523. this.matrix = e.matrixWorld,
  54524. this.matrixAutoUpdate = !1,
  54525. t = t || 1;
  54526. var i = new Ci.Geometry;
  54527. i.vertices.push(new Ci.Vector3(-t,t,0), new Ci.Vector3(t,t,0), new Ci.Vector3(t,-t,0), new Ci.Vector3(-t,-t,0), new Ci.Vector3(-t,t,0));
  54528. var n = new Ci.LineBasicMaterial({
  54529. fog: !1
  54530. });
  54531. n.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54532. this.lightPlane = new Ci.Line(i,n),
  54533. this.add(this.lightPlane),
  54534. (i = new Ci.Geometry).vertices.push(new Ci.Vector3, new Ci.Vector3),
  54535. (n = new Ci.LineBasicMaterial({
  54536. fog: !1
  54537. })).color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54538. this.targetLine = new Ci.Line(i,n),
  54539. this.add(this.targetLine),
  54540. this.update()
  54541. }
  54542. ,
  54543. Ci.DirectionalLightHelper.prototype = Object.create(Ci.Object3D.prototype),
  54544. Ci.DirectionalLightHelper.prototype.constructor = Ci.DirectionalLightHelper,
  54545. Ci.DirectionalLightHelper.prototype.dispose = function() {
  54546. this.lightPlane.geometry.dispose(),
  54547. this.lightPlane.material.dispose(),
  54548. this.targetLine.geometry.dispose(),
  54549. this.targetLine.material.dispose()
  54550. }
  54551. ,
  54552. Ci.DirectionalLightHelper.prototype.update = (hi = new Ci.Vector3,
  54553. ui = new Ci.Vector3,
  54554. di = new Ci.Vector3,
  54555. function() {
  54556. hi.setFromMatrixPosition(this.light.matrixWorld),
  54557. ui.setFromMatrixPosition(this.light.target.matrixWorld),
  54558. di.subVectors(ui, hi),
  54559. this.lightPlane.lookAt(di),
  54560. this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54561. this.targetLine.geometry.vertices[1].copy(di),
  54562. this.targetLine.geometry.verticesNeedUpdate = !0,
  54563. this.targetLine.material.color.copy(this.lightPlane.material.color)
  54564. }
  54565. ),
  54566. Ci.EdgesHelper = function(e, t, i) {
  54567. var n = void 0 !== t ? t : 16777215;
  54568. Ci.LineSegments.call(this, new Ci.EdgesGeometry(e.geometry,i), new Ci.LineBasicMaterial({
  54569. color: n
  54570. })),
  54571. this.matrix = e.matrixWorld,
  54572. this.matrixAutoUpdate = !1
  54573. }
  54574. ,
  54575. Ci.EdgesHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54576. Ci.EdgesHelper.prototype.constructor = Ci.EdgesHelper,
  54577. Ci.FaceNormalsHelper = function(e, t, i, n) {
  54578. this.object = e,
  54579. this.size = void 0 !== t ? t : 1;
  54580. var r = void 0 !== i ? i : 16776960
  54581. , o = void 0 !== n ? n : 1
  54582. , a = 0
  54583. , s = this.object.geometry;
  54584. s instanceof Ci.Geometry ? a = s.faces.length : console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");
  54585. var l = new Ci.BufferGeometry
  54586. , c = new Ci.Float32Attribute(2 * a * 3,3);
  54587. l.addAttribute("position", c),
  54588. Ci.LineSegments.call(this, l, new Ci.LineBasicMaterial({
  54589. color: r,
  54590. linewidth: o
  54591. })),
  54592. this.matrixAutoUpdate = !1,
  54593. this.update()
  54594. }
  54595. ,
  54596. Ci.FaceNormalsHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54597. Ci.FaceNormalsHelper.prototype.constructor = Ci.FaceNormalsHelper,
  54598. Ci.FaceNormalsHelper.prototype.update = (si = new Ci.Vector3,
  54599. li = new Ci.Vector3,
  54600. ci = new Ci.Matrix3,
  54601. function() {
  54602. this.object.updateMatrixWorld(!0),
  54603. ci.getNormalMatrix(this.object.matrixWorld);
  54604. for (var e = this.object.matrixWorld, t = this.geometry.attributes.position, i = this.object.geometry, n = i.vertices, r = i.faces, o = 0, a = 0, s = r.length; a < s; a++) {
  54605. var l = r[a]
  54606. , c = l.normal;
  54607. si.copy(n[l.a]).add(n[l.b]).add(n[l.c]).divideScalar(3).applyMatrix4(e),
  54608. li.copy(c).applyMatrix3(ci).normalize().multiplyScalar(this.size).add(si),
  54609. t.setXYZ(o, si.x, si.y, si.z),
  54610. o += 1,
  54611. t.setXYZ(o, li.x, li.y, li.z),
  54612. o += 1
  54613. }
  54614. return t.needsUpdate = !0,
  54615. this
  54616. }
  54617. ),
  54618. Ci.GridHelper = function(e, t) {
  54619. var i = new Ci.Geometry
  54620. , n = new Ci.LineBasicMaterial({
  54621. vertexColors: Ci.VertexColors
  54622. });
  54623. this.color1 = new Ci.Color(4473924),
  54624. this.color2 = new Ci.Color(8947848);
  54625. for (var r = -e; r <= e; r += t) {
  54626. i.vertices.push(new Ci.Vector3(-e,0,r), new Ci.Vector3(e,0,r), new Ci.Vector3(r,0,-e), new Ci.Vector3(r,0,e));
  54627. var o = 0 === r ? this.color1 : this.color2;
  54628. i.colors.push(o, o, o, o)
  54629. }
  54630. Ci.LineSegments.call(this, i, n)
  54631. }
  54632. ,
  54633. Ci.GridHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54634. Ci.GridHelper.prototype.constructor = Ci.GridHelper,
  54635. Ci.GridHelper.prototype.setColors = function(e, t) {
  54636. this.color1.set(e),
  54637. this.color2.set(t),
  54638. this.geometry.colorsNeedUpdate = !0
  54639. }
  54640. ,
  54641. Ci.HemisphereLightHelper = function(e, t) {
  54642. Ci.Object3D.call(this),
  54643. this.light = e,
  54644. this.light.updateMatrixWorld(),
  54645. this.matrix = e.matrixWorld,
  54646. this.matrixAutoUpdate = !1,
  54647. this.colors = [new Ci.Color, new Ci.Color];
  54648. var i = new Ci.SphereGeometry(t,4,2);
  54649. i.rotateX(-Math.PI / 2);
  54650. for (var n = 0; n < 8; n++)
  54651. i.faces[n].color = this.colors[n < 4 ? 0 : 1];
  54652. var r = new Ci.MeshBasicMaterial({
  54653. vertexColors: Ci.FaceColors,
  54654. wireframe: !0
  54655. });
  54656. this.lightSphere = new Ci.Mesh(i,r),
  54657. this.add(this.lightSphere),
  54658. this.update()
  54659. }
  54660. ,
  54661. Ci.HemisphereLightHelper.prototype = Object.create(Ci.Object3D.prototype),
  54662. Ci.HemisphereLightHelper.prototype.constructor = Ci.HemisphereLightHelper,
  54663. Ci.HemisphereLightHelper.prototype.dispose = function() {
  54664. this.lightSphere.geometry.dispose(),
  54665. this.lightSphere.material.dispose()
  54666. }
  54667. ,
  54668. Ci.HemisphereLightHelper.prototype.update = (ai = new Ci.Vector3,
  54669. function() {
  54670. this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity),
  54671. this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity),
  54672. this.lightSphere.lookAt(ai.setFromMatrixPosition(this.light.matrixWorld).negate()),
  54673. this.lightSphere.geometry.colorsNeedUpdate = !0
  54674. }
  54675. ),
  54676. Ci.PointLightHelper = function(e, t) {
  54677. this.light = e,
  54678. this.light.updateMatrixWorld();
  54679. var i = new Ci.SphereGeometry(t,4,2)
  54680. , n = new Ci.MeshBasicMaterial({
  54681. wireframe: !0,
  54682. fog: !1
  54683. });
  54684. n.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54685. Ci.Mesh.call(this, i, n),
  54686. this.matrix = this.light.matrixWorld,
  54687. this.matrixAutoUpdate = !1
  54688. }
  54689. ,
  54690. Ci.PointLightHelper.prototype = Object.create(Ci.Mesh.prototype),
  54691. Ci.PointLightHelper.prototype.constructor = Ci.PointLightHelper,
  54692. Ci.PointLightHelper.prototype.dispose = function() {
  54693. this.geometry.dispose(),
  54694. this.material.dispose()
  54695. }
  54696. ,
  54697. Ci.PointLightHelper.prototype.update = function() {
  54698. this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  54699. }
  54700. ,
  54701. Ci.SkeletonHelper = function(e) {
  54702. this.bones = this.getBoneList(e);
  54703. for (var t = new Ci.Geometry, i = 0; i < this.bones.length; i++) {
  54704. this.bones[i].parent instanceof Ci.Bone && (t.vertices.push(new Ci.Vector3),
  54705. t.vertices.push(new Ci.Vector3),
  54706. t.colors.push(new Ci.Color(0,0,1)),
  54707. t.colors.push(new Ci.Color(0,1,0)))
  54708. }
  54709. t.dynamic = !0;
  54710. var n = new Ci.LineBasicMaterial({
  54711. vertexColors: Ci.VertexColors,
  54712. depthTest: !1,
  54713. depthWrite: !1,
  54714. transparent: !0
  54715. });
  54716. Ci.LineSegments.call(this, t, n),
  54717. this.root = e,
  54718. this.matrix = e.matrixWorld,
  54719. this.matrixAutoUpdate = !1,
  54720. this.update()
  54721. }
  54722. ,
  54723. Ci.SkeletonHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54724. Ci.SkeletonHelper.prototype.constructor = Ci.SkeletonHelper,
  54725. Ci.SkeletonHelper.prototype.getBoneList = function(e) {
  54726. var t = [];
  54727. e instanceof Ci.Bone && t.push(e);
  54728. for (var i = 0; i < e.children.length; i++)
  54729. t.push.apply(t, this.getBoneList(e.children[i]));
  54730. return t
  54731. }
  54732. ,
  54733. Ci.SkeletonHelper.prototype.update = function() {
  54734. for (var e = this.geometry, t = (new Ci.Matrix4).getInverse(this.root.matrixWorld), i = new Ci.Matrix4, n = 0, r = 0; r < this.bones.length; r++) {
  54735. var o = this.bones[r];
  54736. o.parent instanceof Ci.Bone && (i.multiplyMatrices(t, o.matrixWorld),
  54737. e.vertices[n].setFromMatrixPosition(i),
  54738. i.multiplyMatrices(t, o.parent.matrixWorld),
  54739. e.vertices[n + 1].setFromMatrixPosition(i),
  54740. n += 2)
  54741. }
  54742. e.verticesNeedUpdate = !0,
  54743. e.computeBoundingSphere()
  54744. }
  54745. ,
  54746. Ci.SpotLightHelper = function(e) {
  54747. Ci.Object3D.call(this),
  54748. this.light = e,
  54749. this.light.updateMatrixWorld(),
  54750. this.matrix = e.matrixWorld,
  54751. this.matrixAutoUpdate = !1;
  54752. var t = new Ci.CylinderGeometry(0,1,1,8,1,!0);
  54753. t.translate(0, -.5, 0),
  54754. t.rotateX(-Math.PI / 2);
  54755. var i = new Ci.MeshBasicMaterial({
  54756. wireframe: !0,
  54757. fog: !1
  54758. });
  54759. this.cone = new Ci.Mesh(t,i),
  54760. this.add(this.cone),
  54761. this.update()
  54762. }
  54763. ,
  54764. Ci.SpotLightHelper.prototype = Object.create(Ci.Object3D.prototype),
  54765. Ci.SpotLightHelper.prototype.constructor = Ci.SpotLightHelper,
  54766. Ci.SpotLightHelper.prototype.dispose = function() {
  54767. this.cone.geometry.dispose(),
  54768. this.cone.material.dispose()
  54769. }
  54770. ,
  54771. Ci.SpotLightHelper.prototype.update = (ri = new Ci.Vector3,
  54772. oi = new Ci.Vector3,
  54773. function() {
  54774. var e = this.light.distance ? this.light.distance : 1e4
  54775. , t = e * Math.tan(this.light.angle);
  54776. this.cone.scale.set(t, t, e),
  54777. ri.setFromMatrixPosition(this.light.matrixWorld),
  54778. oi.setFromMatrixPosition(this.light.target.matrixWorld),
  54779. this.cone.lookAt(oi.sub(ri)),
  54780. this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  54781. }
  54782. ),
  54783. Ci.VertexNormalsHelper = function(e, t, i, n) {
  54784. this.object = e,
  54785. this.size = void 0 !== t ? t : 1;
  54786. var r = void 0 !== i ? i : 16711680
  54787. , o = void 0 !== n ? n : 1
  54788. , a = 0
  54789. , s = this.object.geometry;
  54790. s instanceof Ci.Geometry ? a = 3 * s.faces.length : s instanceof Ci.BufferGeometry && (a = s.attributes.normal.count);
  54791. var l = new Ci.BufferGeometry
  54792. , c = new Ci.Float32Attribute(2 * a * 3,3);
  54793. l.addAttribute("position", c),
  54794. Ci.LineSegments.call(this, l, new Ci.LineBasicMaterial({
  54795. color: r,
  54796. linewidth: o
  54797. })),
  54798. this.matrixAutoUpdate = !1,
  54799. this.update()
  54800. }
  54801. ,
  54802. Ci.VertexNormalsHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54803. Ci.VertexNormalsHelper.prototype.constructor = Ci.VertexNormalsHelper,
  54804. Ci.VertexNormalsHelper.prototype.update = (ti = new Ci.Vector3,
  54805. ii = new Ci.Vector3,
  54806. ni = new Ci.Matrix3,
  54807. function() {
  54808. var e = ["a", "b", "c"];
  54809. this.object.updateMatrixWorld(!0),
  54810. ni.getNormalMatrix(this.object.matrixWorld);
  54811. var t = this.object.matrixWorld
  54812. , i = this.geometry.attributes.position
  54813. , n = this.object.geometry;
  54814. if (n instanceof Ci.Geometry)
  54815. for (var r = n.vertices, o = n.faces, a = 0, s = 0, l = o.length; s < l; s++)
  54816. for (var c = o[s], h = 0, u = c.vertexNormals.length; h < u; h++) {
  54817. var d = r[c[e[h]]]
  54818. , p = c.vertexNormals[h];
  54819. ti.copy(d).applyMatrix4(t),
  54820. ii.copy(p).applyMatrix3(ni).normalize().multiplyScalar(this.size).add(ti),
  54821. i.setXYZ(a, ti.x, ti.y, ti.z),
  54822. a += 1,
  54823. i.setXYZ(a, ii.x, ii.y, ii.z),
  54824. a += 1
  54825. }
  54826. else if (n instanceof Ci.BufferGeometry) {
  54827. var f = n.attributes.position
  54828. , g = n.attributes.normal;
  54829. for (h = a = 0,
  54830. u = f.count; h < u; h++)
  54831. ti.set(f.getX(h), f.getY(h), f.getZ(h)).applyMatrix4(t),
  54832. ii.set(g.getX(h), g.getY(h), g.getZ(h)),
  54833. ii.applyMatrix3(ni).normalize().multiplyScalar(this.size).add(ti),
  54834. i.setXYZ(a, ti.x, ti.y, ti.z),
  54835. a += 1,
  54836. i.setXYZ(a, ii.x, ii.y, ii.z),
  54837. a += 1
  54838. }
  54839. return i.needsUpdate = !0,
  54840. this
  54841. }
  54842. ),
  54843. Ci.WireframeHelper = function(e, t) {
  54844. var i = void 0 !== t ? t : 16777215;
  54845. Ci.LineSegments.call(this, new Ci.WireframeGeometry(e.geometry), new Ci.LineBasicMaterial({
  54846. color: i
  54847. })),
  54848. this.matrix = e.matrixWorld,
  54849. this.matrixAutoUpdate = !1
  54850. }
  54851. ,
  54852. Ci.WireframeHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54853. Ci.WireframeHelper.prototype.constructor = Ci.WireframeHelper,
  54854. Ci.ImmediateRenderObject = function(e) {
  54855. Ci.Object3D.call(this),
  54856. this.material = e,
  54857. this.render = function(e) {}
  54858. }
  54859. ,
  54860. Ci.ImmediateRenderObject.prototype = Object.create(Ci.Object3D.prototype),
  54861. Ci.ImmediateRenderObject.prototype.constructor = Ci.ImmediateRenderObject,
  54862. Ci.MorphBlendMesh = function(e, t) {
  54863. Ci.Mesh.call(this, e, t),
  54864. this.animationsMap = {},
  54865. this.animationsList = [];
  54866. var i = this.geometry.morphTargets.length
  54867. , n = i - 1
  54868. , r = i / 1;
  54869. this.createAnimation("__default", 0, n, r),
  54870. this.setAnimationWeight("__default", 1)
  54871. }
  54872. ,
  54873. Ci.MorphBlendMesh.prototype = Object.create(Ci.Mesh.prototype),
  54874. Ci.MorphBlendMesh.prototype.constructor = Ci.MorphBlendMesh,
  54875. Ci.MorphBlendMesh.prototype.createAnimation = function(e, t, i, n) {
  54876. var r = {
  54877. start: t,
  54878. end: i,
  54879. length: i - t + 1,
  54880. fps: n,
  54881. duration: (i - t) / n,
  54882. lastFrame: 0,
  54883. currentFrame: 0,
  54884. active: !1,
  54885. time: 0,
  54886. direction: 1,
  54887. weight: 1,
  54888. directionBackwards: !1,
  54889. mirroredLoop: !1
  54890. };
  54891. this.animationsMap[e] = r,
  54892. this.animationsList.push(r)
  54893. }
  54894. ,
  54895. Ci.MorphBlendMesh.prototype.autoCreateAnimations = function(e) {
  54896. for (var t, i = /([a-z]+)_?(\d+)/i, n = {}, r = this.geometry, o = 0, a = r.morphTargets.length; o < a; o++) {
  54897. var s = r.morphTargets[o].name.match(i);
  54898. if (s && 1 < s.length)
  54899. n[l = s[1]] || (n[l] = {
  54900. start: 1 / 0,
  54901. end: -1 / 0
  54902. }),
  54903. o < (c = n[l]).start && (c.start = o),
  54904. o > c.end && (c.end = o),
  54905. t = t || l
  54906. }
  54907. for (var l in n) {
  54908. var c = n[l];
  54909. this.createAnimation(l, c.start, c.end, e)
  54910. }
  54911. this.firstAnimation = t
  54912. }
  54913. ,
  54914. Ci.MorphBlendMesh.prototype.setAnimationDirectionForward = function(e) {
  54915. var t = this.animationsMap[e];
  54916. t && (t.direction = 1,
  54917. t.directionBackwards = !1)
  54918. }
  54919. ,
  54920. Ci.MorphBlendMesh.prototype.setAnimationDirectionBackward = function(e) {
  54921. var t = this.animationsMap[e];
  54922. t && (t.direction = -1,
  54923. t.directionBackwards = !0)
  54924. }
  54925. ,
  54926. Ci.MorphBlendMesh.prototype.setAnimationFPS = function(e, t) {
  54927. var i = this.animationsMap[e];
  54928. i && (i.fps = t,
  54929. i.duration = (i.end - i.start) / i.fps)
  54930. }
  54931. ,
  54932. Ci.MorphBlendMesh.prototype.setAnimationDuration = function(e, t) {
  54933. var i = this.animationsMap[e];
  54934. i && (i.duration = t,
  54935. i.fps = (i.end - i.start) / i.duration)
  54936. }
  54937. ,
  54938. Ci.MorphBlendMesh.prototype.setAnimationWeight = function(e, t) {
  54939. var i = this.animationsMap[e];
  54940. i && (i.weight = t)
  54941. }
  54942. ,
  54943. Ci.MorphBlendMesh.prototype.setAnimationTime = function(e, t) {
  54944. var i = this.animationsMap[e];
  54945. i && (i.time = t)
  54946. }
  54947. ,
  54948. Ci.MorphBlendMesh.prototype.getAnimationTime = function(e) {
  54949. var t = 0
  54950. , i = this.animationsMap[e];
  54951. return i && (t = i.time),
  54952. t
  54953. }
  54954. ,
  54955. Ci.MorphBlendMesh.prototype.getAnimationDuration = function(e) {
  54956. var t = -1
  54957. , i = this.animationsMap[e];
  54958. return i && (t = i.duration),
  54959. t
  54960. }
  54961. ,
  54962. Ci.MorphBlendMesh.prototype.playAnimation = function(e) {
  54963. var t = this.animationsMap[e];
  54964. t ? (t.time = 0,
  54965. t.active = !0) : console.warn("THREE.MorphBlendMesh: animation[" + e + "] undefined in .playAnimation()")
  54966. }
  54967. ,
  54968. Ci.MorphBlendMesh.prototype.stopAnimation = function(e) {
  54969. var t = this.animationsMap[e];
  54970. t && (t.active = !1)
  54971. }
  54972. ,
  54973. Ci.MorphBlendMesh.prototype.update = function(e) {
  54974. for (var t = 0, i = this.animationsList.length; t < i; t++) {
  54975. var n = this.animationsList[t];
  54976. if (n.active) {
  54977. var r = n.duration / n.length;
  54978. n.time += n.direction * e,
  54979. n.mirroredLoop ? (n.time > n.duration || n.time < 0) && (n.direction *= -1,
  54980. n.time > n.duration && (n.time = n.duration,
  54981. n.directionBackwards = !0),
  54982. n.time < 0 && (n.time = 0,
  54983. n.directionBackwards = !1)) : (n.time = n.time % n.duration,
  54984. n.time < 0 && (n.time += n.duration));
  54985. var o = n.start + Ci.Math.clamp(Math.floor(n.time / r), 0, n.length - 1)
  54986. , a = n.weight;
  54987. o !== n.currentFrame && (this.morphTargetInfluences[n.lastFrame] = 0,
  54988. this.morphTargetInfluences[n.currentFrame] = 1 * a,
  54989. this.morphTargetInfluences[o] = 0,
  54990. n.lastFrame = n.currentFrame,
  54991. n.currentFrame = o);
  54992. var s = n.time % r / r;
  54993. n.directionBackwards && (s = 1 - s),
  54994. n.currentFrame !== n.lastFrame ? (this.morphTargetInfluences[n.currentFrame] = s * a,
  54995. this.morphTargetInfluences[n.lastFrame] = (1 - s) * a) : this.morphTargetInfluences[n.currentFrame] = a
  54996. }
  54997. }
  54998. }
  54999. ,
  55000. void 0 !== i ? (void 0 !== t && t.exports && (i = t.exports = Ci),
  55001. i.THREE = Ci) : this.THREE = Ci
  55002. }
  55003. , {}]
  55004. }, {}, [116]);