main_2020_edit.js 2.4 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190381913819238193381943819538196381973819838199382003820138202382033820438205382063820738208382093821038211382123821338214382153821638217382183821938220382213822238223382243822538226382273822838229382303823138232382333823438235382363823738238382393824038241382423824338244382453824638247382483824938250382513825238253382543825538256382573825838259382603826138262382633826438265382663826738268382693827038271382723827338274382753827638277382783827938280382813828238283382843828538286382873828838289382903829138292382933829438295382963829738298382993830038301383023830338304383053830638307383083830938310383113831238313383143831538316383173831838319383203832138322383233832438325383263832738328383293833038331383323833338334383353833638337383383833938340383413834238343383443834538346383473834838349383503835138352383533835438355383563835738358383593836038361383623836338364383653836638367383683836938370383713837238373383743837538376383773837838379383803838138382383833838438385383863838738388383893839038391383923839338394383953839638397383983839938400384013840238403384043840538406384073840838409384103841138412384133841438415384163841738418384193842038421384223842338424384253842638427384283842938430384313843238433384343843538436384373843838439384403844138442384433844438445384463844738448384493845038451384523845338454384553845638457384583845938460384613846238463384643846538466384673846838469384703847138472384733847438475384763847738478384793848038481384823848338484384853848638487384883848938490384913849238493384943849538496384973849838499385003850138502385033850438505385063850738508385093851038511385123851338514385153851638517385183851938520385213852238523385243852538526385273852838529385303853138532385333853438535385363853738538385393854038541385423854338544385453854638547385483854938550385513855238553385543855538556385573855838559385603856138562385633856438565385663856738568385693857038571385723857338574385753857638577385783857938580385813858238583385843858538586385873858838589385903859138592385933859438595385963859738598385993860038601386023860338604386053860638607386083860938610386113861238613386143861538616386173861838619386203862138622386233862438625386263862738628386293863038631386323863338634386353863638637386383863938640386413864238643386443864538646386473864838649386503865138652386533865438655386563865738658386593866038661386623866338664386653866638667386683866938670386713867238673386743867538676386773867838679386803868138682386833868438685386863868738688386893869038691386923869338694386953869638697386983869938700387013870238703387043870538706387073870838709387103871138712387133871438715387163871738718387193872038721387223872338724387253872638727387283872938730387313873238733387343873538736387373873838739387403874138742387433874438745387463874738748387493875038751387523875338754387553875638757387583875938760387613876238763387643876538766387673876838769387703877138772387733877438775387763877738778387793878038781387823878338784387853878638787387883878938790387913879238793387943879538796387973879838799388003880138802388033880438805388063880738808388093881038811388123881338814388153881638817388183881938820388213882238823388243882538826388273882838829388303883138832388333883438835388363883738838388393884038841388423884338844388453884638847388483884938850388513885238853388543885538856388573885838859388603886138862388633886438865388663886738868388693887038871388723887338874388753887638877388783887938880388813888238883388843888538886388873888838889388903889138892388933889438895388963889738898388993890038901389023890338904389053890638907389083890938910389113891238913389143891538916389173891838919389203892138922389233892438925389263892738928389293893038931389323893338934389353893638937389383893938940389413894238943389443894538946389473894838949389503895138952389533895438955389563895738958389593896038961389623896338964389653896638967389683896938970389713897238973389743897538976389773897838979389803898138982389833898438985389863898738988389893899038991389923899338994389953899638997389983899939000390013900239003390043900539006390073900839009390103901139012390133901439015390163901739018390193902039021390223902339024390253902639027390283902939030390313903239033390343903539036390373903839039390403904139042390433904439045390463904739048390493905039051390523905339054390553905639057390583905939060390613906239063390643906539066390673906839069390703907139072390733907439075390763907739078390793908039081390823908339084390853908639087390883908939090390913909239093390943909539096390973909839099391003910139102391033910439105391063910739108391093911039111391123911339114391153911639117391183911939120391213912239123391243912539126391273912839129391303913139132391333913439135391363913739138391393914039141391423914339144391453914639147391483914939150391513915239153391543915539156391573915839159391603916139162391633916439165391663916739168391693917039171391723917339174391753917639177391783917939180391813918239183391843918539186391873918839189391903919139192391933919439195391963919739198391993920039201392023920339204392053920639207392083920939210392113921239213392143921539216392173921839219392203922139222392233922439225392263922739228392293923039231392323923339234392353923639237392383923939240392413924239243392443924539246392473924839249392503925139252392533925439255392563925739258392593926039261392623926339264392653926639267392683926939270392713927239273392743927539276392773927839279392803928139282392833928439285392863928739288392893929039291392923929339294392953929639297392983929939300393013930239303393043930539306393073930839309393103931139312393133931439315393163931739318393193932039321393223932339324393253932639327393283932939330393313933239333393343933539336393373933839339393403934139342393433934439345393463934739348393493935039351393523935339354393553935639357393583935939360393613936239363393643936539366393673936839369393703937139372393733937439375393763937739378393793938039381393823938339384393853938639387393883938939390393913939239393393943939539396393973939839399394003940139402394033940439405394063940739408394093941039411394123941339414394153941639417394183941939420394213942239423394243942539426394273942839429394303943139432394333943439435394363943739438394393944039441394423944339444394453944639447394483944939450394513945239453394543945539456394573945839459394603946139462394633946439465394663946739468394693947039471394723947339474394753947639477394783947939480394813948239483394843948539486394873948839489394903949139492394933949439495394963949739498394993950039501395023950339504395053950639507395083950939510395113951239513395143951539516395173951839519395203952139522395233952439525395263952739528395293953039531395323953339534395353953639537395383953939540395413954239543395443954539546395473954839549395503955139552395533955439555395563955739558395593956039561395623956339564395653956639567395683956939570395713957239573395743957539576395773957839579395803958139582395833958439585395863958739588395893959039591395923959339594395953959639597395983959939600396013960239603396043960539606396073960839609396103961139612396133961439615396163961739618396193962039621396223962339624396253962639627396283962939630396313963239633396343963539636396373963839639396403964139642396433964439645396463964739648396493965039651396523965339654396553965639657396583965939660396613966239663396643966539666396673966839669396703967139672396733967439675396763967739678396793968039681396823968339684396853968639687396883968939690396913969239693396943969539696396973969839699397003970139702397033970439705397063970739708397093971039711397123971339714397153971639717397183971939720397213972239723397243972539726397273972839729397303973139732397333973439735397363973739738397393974039741397423974339744397453974639747397483974939750397513975239753397543975539756397573975839759397603976139762397633976439765397663976739768397693977039771397723977339774397753977639777397783977939780397813978239783397843978539786397873978839789397903979139792397933979439795397963979739798397993980039801398023980339804398053980639807398083980939810398113981239813398143981539816398173981839819398203982139822398233982439825398263982739828398293983039831398323983339834398353983639837398383983939840398413984239843398443984539846398473984839849398503985139852398533985439855398563985739858398593986039861398623986339864398653986639867398683986939870398713987239873398743987539876398773987839879398803988139882398833988439885398863988739888398893989039891398923989339894398953989639897398983989939900399013990239903399043990539906399073990839909399103991139912399133991439915399163991739918399193992039921399223992339924399253992639927399283992939930399313993239933399343993539936399373993839939399403994139942399433994439945399463994739948399493995039951399523995339954399553995639957399583995939960399613996239963399643996539966399673996839969399703997139972399733997439975399763997739978399793998039981399823998339984399853998639987399883998939990399913999239993399943999539996399973999839999400004000140002400034000440005400064000740008400094001040011400124001340014400154001640017400184001940020400214002240023400244002540026400274002840029400304003140032400334003440035400364003740038400394004040041400424004340044400454004640047400484004940050400514005240053400544005540056400574005840059400604006140062400634006440065400664006740068400694007040071400724007340074400754007640077400784007940080400814008240083400844008540086400874008840089400904009140092400934009440095400964009740098400994010040101401024010340104401054010640107401084010940110401114011240113401144011540116401174011840119401204012140122401234012440125401264012740128401294013040131401324013340134401354013640137401384013940140401414014240143401444014540146401474014840149401504015140152401534015440155401564015740158401594016040161401624016340164401654016640167401684016940170401714017240173401744017540176401774017840179401804018140182401834018440185401864018740188401894019040191401924019340194401954019640197401984019940200402014020240203402044020540206402074020840209402104021140212402134021440215402164021740218402194022040221402224022340224402254022640227402284022940230402314023240233402344023540236402374023840239402404024140242402434024440245402464024740248402494025040251402524025340254402554025640257402584025940260402614026240263402644026540266402674026840269402704027140272402734027440275402764027740278402794028040281402824028340284402854028640287402884028940290402914029240293402944029540296402974029840299403004030140302403034030440305403064030740308403094031040311403124031340314403154031640317403184031940320403214032240323403244032540326403274032840329403304033140332403334033440335403364033740338403394034040341403424034340344403454034640347403484034940350403514035240353403544035540356403574035840359403604036140362403634036440365403664036740368403694037040371403724037340374403754037640377403784037940380403814038240383403844038540386403874038840389403904039140392403934039440395403964039740398403994040040401404024040340404404054040640407404084040940410404114041240413404144041540416404174041840419404204042140422404234042440425404264042740428404294043040431404324043340434404354043640437404384043940440404414044240443404444044540446404474044840449404504045140452404534045440455404564045740458404594046040461404624046340464404654046640467404684046940470404714047240473404744047540476404774047840479404804048140482404834048440485404864048740488404894049040491404924049340494404954049640497404984049940500405014050240503405044050540506405074050840509405104051140512405134051440515405164051740518405194052040521405224052340524405254052640527405284052940530405314053240533405344053540536405374053840539405404054140542405434054440545405464054740548405494055040551405524055340554405554055640557405584055940560405614056240563405644056540566405674056840569405704057140572405734057440575405764057740578405794058040581405824058340584405854058640587405884058940590405914059240593405944059540596405974059840599406004060140602406034060440605406064060740608406094061040611406124061340614406154061640617406184061940620406214062240623406244062540626406274062840629406304063140632406334063440635406364063740638406394064040641406424064340644406454064640647406484064940650406514065240653406544065540656406574065840659406604066140662406634066440665406664066740668406694067040671406724067340674406754067640677406784067940680406814068240683406844068540686406874068840689406904069140692406934069440695406964069740698406994070040701407024070340704407054070640707407084070940710407114071240713407144071540716407174071840719407204072140722407234072440725407264072740728407294073040731407324073340734407354073640737407384073940740407414074240743407444074540746407474074840749407504075140752407534075440755407564075740758407594076040761407624076340764407654076640767407684076940770407714077240773407744077540776407774077840779407804078140782407834078440785407864078740788407894079040791407924079340794407954079640797407984079940800408014080240803408044080540806408074080840809408104081140812408134081440815408164081740818408194082040821408224082340824408254082640827408284082940830408314083240833408344083540836408374083840839408404084140842408434084440845408464084740848408494085040851408524085340854408554085640857408584085940860408614086240863408644086540866408674086840869408704087140872408734087440875408764087740878408794088040881408824088340884408854088640887408884088940890408914089240893408944089540896408974089840899409004090140902409034090440905409064090740908409094091040911409124091340914409154091640917409184091940920409214092240923409244092540926409274092840929409304093140932409334093440935409364093740938409394094040941409424094340944409454094640947409484094940950409514095240953409544095540956409574095840959409604096140962409634096440965409664096740968409694097040971409724097340974409754097640977409784097940980409814098240983409844098540986409874098840989409904099140992409934099440995409964099740998409994100041001410024100341004410054100641007410084100941010410114101241013410144101541016410174101841019410204102141022410234102441025410264102741028410294103041031410324103341034410354103641037410384103941040410414104241043410444104541046410474104841049410504105141052410534105441055410564105741058410594106041061410624106341064410654106641067410684106941070410714107241073410744107541076410774107841079410804108141082410834108441085410864108741088410894109041091410924109341094410954109641097410984109941100411014110241103411044110541106411074110841109411104111141112411134111441115411164111741118411194112041121411224112341124411254112641127411284112941130411314113241133411344113541136411374113841139411404114141142411434114441145411464114741148411494115041151411524115341154411554115641157411584115941160411614116241163411644116541166411674116841169411704117141172411734117441175411764117741178411794118041181411824118341184411854118641187411884118941190411914119241193411944119541196411974119841199412004120141202412034120441205412064120741208412094121041211412124121341214412154121641217412184121941220412214122241223412244122541226412274122841229412304123141232412334123441235412364123741238412394124041241412424124341244412454124641247412484124941250412514125241253412544125541256412574125841259412604126141262412634126441265412664126741268412694127041271412724127341274412754127641277412784127941280412814128241283412844128541286412874128841289412904129141292412934129441295412964129741298412994130041301413024130341304413054130641307413084130941310413114131241313413144131541316413174131841319413204132141322413234132441325413264132741328413294133041331413324133341334413354133641337413384133941340413414134241343413444134541346413474134841349413504135141352413534135441355413564135741358413594136041361413624136341364413654136641367413684136941370413714137241373413744137541376413774137841379413804138141382413834138441385413864138741388413894139041391413924139341394413954139641397413984139941400414014140241403414044140541406414074140841409414104141141412414134141441415414164141741418414194142041421414224142341424414254142641427414284142941430414314143241433414344143541436414374143841439414404144141442414434144441445414464144741448414494145041451414524145341454414554145641457414584145941460414614146241463414644146541466414674146841469414704147141472414734147441475414764147741478414794148041481414824148341484414854148641487414884148941490414914149241493414944149541496414974149841499415004150141502415034150441505415064150741508415094151041511415124151341514415154151641517415184151941520415214152241523415244152541526415274152841529415304153141532415334153441535415364153741538415394154041541415424154341544415454154641547415484154941550415514155241553415544155541556415574155841559415604156141562415634156441565415664156741568415694157041571415724157341574415754157641577415784157941580415814158241583415844158541586415874158841589415904159141592415934159441595415964159741598415994160041601416024160341604416054160641607416084160941610416114161241613416144161541616416174161841619416204162141622416234162441625416264162741628416294163041631416324163341634416354163641637416384163941640416414164241643416444164541646416474164841649416504165141652416534165441655416564165741658416594166041661416624166341664416654166641667416684166941670416714167241673416744167541676416774167841679416804168141682416834168441685416864168741688416894169041691416924169341694416954169641697416984169941700417014170241703417044170541706417074170841709417104171141712417134171441715417164171741718417194172041721417224172341724417254172641727417284172941730417314173241733417344173541736417374173841739417404174141742417434174441745417464174741748417494175041751417524175341754417554175641757417584175941760417614176241763417644176541766417674176841769417704177141772417734177441775417764177741778417794178041781417824178341784417854178641787417884178941790417914179241793417944179541796417974179841799418004180141802418034180441805418064180741808418094181041811418124181341814418154181641817418184181941820418214182241823418244182541826418274182841829418304183141832418334183441835418364183741838418394184041841418424184341844418454184641847418484184941850418514185241853418544185541856418574185841859418604186141862418634186441865418664186741868418694187041871418724187341874418754187641877418784187941880418814188241883418844188541886418874188841889418904189141892418934189441895418964189741898418994190041901419024190341904419054190641907419084190941910419114191241913419144191541916419174191841919419204192141922419234192441925419264192741928419294193041931419324193341934419354193641937419384193941940419414194241943419444194541946419474194841949419504195141952419534195441955419564195741958419594196041961419624196341964419654196641967419684196941970419714197241973419744197541976419774197841979419804198141982419834198441985419864198741988419894199041991419924199341994419954199641997419984199942000420014200242003420044200542006420074200842009420104201142012420134201442015420164201742018420194202042021420224202342024420254202642027420284202942030420314203242033420344203542036420374203842039420404204142042420434204442045420464204742048420494205042051420524205342054420554205642057420584205942060420614206242063420644206542066420674206842069420704207142072420734207442075420764207742078420794208042081420824208342084420854208642087420884208942090420914209242093420944209542096420974209842099421004210142102421034210442105421064210742108421094211042111421124211342114421154211642117421184211942120421214212242123421244212542126421274212842129421304213142132421334213442135421364213742138421394214042141421424214342144421454214642147421484214942150421514215242153421544215542156421574215842159421604216142162421634216442165421664216742168421694217042171421724217342174421754217642177421784217942180421814218242183421844218542186421874218842189421904219142192421934219442195421964219742198421994220042201422024220342204422054220642207422084220942210422114221242213422144221542216422174221842219422204222142222422234222442225422264222742228422294223042231422324223342234422354223642237422384223942240422414224242243422444224542246422474224842249422504225142252422534225442255422564225742258422594226042261422624226342264422654226642267422684226942270422714227242273422744227542276422774227842279422804228142282422834228442285422864228742288422894229042291422924229342294422954229642297422984229942300423014230242303423044230542306423074230842309423104231142312423134231442315423164231742318423194232042321423224232342324423254232642327423284232942330423314233242333423344233542336423374233842339423404234142342423434234442345423464234742348423494235042351423524235342354423554235642357423584235942360423614236242363423644236542366423674236842369423704237142372423734237442375423764237742378423794238042381423824238342384423854238642387423884238942390423914239242393423944239542396423974239842399424004240142402424034240442405424064240742408424094241042411424124241342414424154241642417424184241942420424214242242423424244242542426424274242842429424304243142432424334243442435424364243742438424394244042441424424244342444424454244642447424484244942450424514245242453424544245542456424574245842459424604246142462424634246442465424664246742468424694247042471424724247342474424754247642477424784247942480424814248242483424844248542486424874248842489424904249142492424934249442495424964249742498424994250042501425024250342504425054250642507425084250942510425114251242513425144251542516425174251842519425204252142522425234252442525425264252742528425294253042531425324253342534425354253642537425384253942540425414254242543425444254542546425474254842549425504255142552425534255442555425564255742558425594256042561425624256342564425654256642567425684256942570425714257242573425744257542576425774257842579425804258142582425834258442585425864258742588425894259042591425924259342594425954259642597425984259942600426014260242603426044260542606426074260842609426104261142612426134261442615426164261742618426194262042621426224262342624426254262642627426284262942630426314263242633426344263542636426374263842639426404264142642426434264442645426464264742648426494265042651426524265342654426554265642657426584265942660426614266242663426644266542666426674266842669426704267142672426734267442675426764267742678426794268042681426824268342684426854268642687426884268942690426914269242693426944269542696426974269842699427004270142702427034270442705427064270742708427094271042711427124271342714427154271642717427184271942720427214272242723427244272542726427274272842729427304273142732427334273442735427364273742738427394274042741427424274342744427454274642747427484274942750427514275242753427544275542756427574275842759427604276142762427634276442765427664276742768427694277042771427724277342774427754277642777427784277942780427814278242783427844278542786427874278842789427904279142792427934279442795427964279742798427994280042801428024280342804428054280642807428084280942810428114281242813428144281542816428174281842819428204282142822428234282442825428264282742828428294283042831428324283342834428354283642837428384283942840428414284242843428444284542846428474284842849428504285142852428534285442855428564285742858428594286042861428624286342864428654286642867428684286942870428714287242873428744287542876428774287842879428804288142882428834288442885428864288742888428894289042891428924289342894428954289642897428984289942900429014290242903429044290542906429074290842909429104291142912429134291442915429164291742918429194292042921429224292342924429254292642927429284292942930429314293242933429344293542936429374293842939429404294142942429434294442945429464294742948429494295042951429524295342954429554295642957429584295942960429614296242963429644296542966429674296842969429704297142972429734297442975429764297742978429794298042981429824298342984429854298642987429884298942990429914299242993429944299542996429974299842999430004300143002430034300443005430064300743008430094301043011430124301343014430154301643017430184301943020430214302243023430244302543026430274302843029430304303143032430334303443035430364303743038430394304043041430424304343044430454304643047430484304943050430514305243053430544305543056430574305843059430604306143062430634306443065430664306743068430694307043071430724307343074430754307643077430784307943080430814308243083430844308543086430874308843089430904309143092430934309443095430964309743098430994310043101431024310343104431054310643107431084310943110431114311243113431144311543116431174311843119431204312143122431234312443125431264312743128431294313043131431324313343134431354313643137431384313943140431414314243143431444314543146431474314843149431504315143152431534315443155431564315743158431594316043161431624316343164431654316643167431684316943170431714317243173431744317543176431774317843179431804318143182431834318443185431864318743188431894319043191431924319343194431954319643197431984319943200432014320243203432044320543206432074320843209432104321143212432134321443215432164321743218432194322043221432224322343224432254322643227432284322943230432314323243233432344323543236432374323843239432404324143242432434324443245432464324743248432494325043251432524325343254432554325643257432584325943260432614326243263432644326543266432674326843269432704327143272432734327443275432764327743278432794328043281432824328343284432854328643287432884328943290432914329243293432944329543296432974329843299433004330143302433034330443305433064330743308433094331043311433124331343314433154331643317433184331943320433214332243323433244332543326433274332843329433304333143332433334333443335433364333743338433394334043341433424334343344433454334643347433484334943350433514335243353433544335543356433574335843359433604336143362433634336443365433664336743368433694337043371433724337343374433754337643377433784337943380433814338243383433844338543386433874338843389433904339143392433934339443395433964339743398433994340043401434024340343404434054340643407434084340943410434114341243413434144341543416434174341843419434204342143422434234342443425434264342743428434294343043431434324343343434434354343643437434384343943440434414344243443434444344543446434474344843449434504345143452434534345443455434564345743458434594346043461434624346343464434654346643467434684346943470434714347243473434744347543476434774347843479434804348143482434834348443485434864348743488434894349043491434924349343494434954349643497434984349943500435014350243503435044350543506435074350843509435104351143512435134351443515435164351743518435194352043521435224352343524435254352643527435284352943530435314353243533435344353543536435374353843539435404354143542435434354443545435464354743548435494355043551435524355343554435554355643557435584355943560435614356243563435644356543566435674356843569435704357143572435734357443575435764357743578435794358043581435824358343584435854358643587435884358943590435914359243593435944359543596435974359843599436004360143602436034360443605436064360743608436094361043611436124361343614436154361643617436184361943620436214362243623436244362543626436274362843629436304363143632436334363443635436364363743638436394364043641436424364343644436454364643647436484364943650436514365243653436544365543656436574365843659436604366143662436634366443665436664366743668436694367043671436724367343674436754367643677436784367943680436814368243683436844368543686436874368843689436904369143692436934369443695436964369743698436994370043701437024370343704437054370643707437084370943710437114371243713437144371543716437174371843719437204372143722437234372443725437264372743728437294373043731437324373343734437354373643737437384373943740437414374243743437444374543746437474374843749437504375143752437534375443755437564375743758437594376043761437624376343764437654376643767437684376943770437714377243773437744377543776437774377843779437804378143782437834378443785437864378743788437894379043791437924379343794437954379643797437984379943800438014380243803438044380543806438074380843809438104381143812438134381443815438164381743818438194382043821438224382343824438254382643827438284382943830438314383243833438344383543836438374383843839438404384143842438434384443845438464384743848438494385043851438524385343854438554385643857438584385943860438614386243863438644386543866438674386843869438704387143872438734387443875438764387743878438794388043881438824388343884438854388643887438884388943890438914389243893438944389543896438974389843899439004390143902439034390443905439064390743908439094391043911439124391343914439154391643917439184391943920439214392243923439244392543926439274392843929439304393143932439334393443935439364393743938439394394043941439424394343944439454394643947439484394943950439514395243953439544395543956439574395843959439604396143962439634396443965439664396743968439694397043971439724397343974439754397643977439784397943980439814398243983439844398543986439874398843989439904399143992439934399443995439964399743998439994400044001440024400344004440054400644007440084400944010440114401244013440144401544016440174401844019440204402144022440234402444025440264402744028440294403044031440324403344034440354403644037440384403944040440414404244043440444404544046440474404844049440504405144052440534405444055440564405744058440594406044061440624406344064440654406644067440684406944070440714407244073440744407544076440774407844079440804408144082440834408444085440864408744088440894409044091440924409344094440954409644097440984409944100441014410244103441044410544106441074410844109441104411144112441134411444115441164411744118441194412044121441224412344124441254412644127441284412944130441314413244133441344413544136441374413844139441404414144142441434414444145441464414744148441494415044151441524415344154441554415644157441584415944160441614416244163441644416544166441674416844169441704417144172441734417444175441764417744178441794418044181441824418344184441854418644187441884418944190441914419244193441944419544196441974419844199442004420144202442034420444205442064420744208442094421044211442124421344214442154421644217442184421944220442214422244223442244422544226442274422844229442304423144232442334423444235442364423744238442394424044241442424424344244442454424644247442484424944250442514425244253442544425544256442574425844259442604426144262442634426444265442664426744268442694427044271442724427344274442754427644277442784427944280442814428244283442844428544286442874428844289442904429144292442934429444295442964429744298442994430044301443024430344304443054430644307443084430944310443114431244313443144431544316443174431844319443204432144322443234432444325443264432744328443294433044331443324433344334443354433644337443384433944340443414434244343443444434544346443474434844349443504435144352443534435444355443564435744358443594436044361443624436344364443654436644367443684436944370443714437244373443744437544376443774437844379443804438144382443834438444385443864438744388443894439044391443924439344394443954439644397443984439944400444014440244403444044440544406444074440844409444104441144412444134441444415444164441744418444194442044421444224442344424444254442644427444284442944430444314443244433444344443544436444374443844439444404444144442444434444444445444464444744448444494445044451444524445344454444554445644457444584445944460444614446244463444644446544466444674446844469444704447144472444734447444475444764447744478444794448044481444824448344484444854448644487444884448944490444914449244493444944449544496444974449844499445004450144502445034450444505445064450744508445094451044511445124451344514445154451644517445184451944520445214452244523445244452544526445274452844529445304453144532445334453444535445364453744538445394454044541445424454344544445454454644547445484454944550445514455244553445544455544556445574455844559445604456144562445634456444565445664456744568445694457044571445724457344574445754457644577445784457944580445814458244583445844458544586445874458844589445904459144592445934459444595445964459744598445994460044601446024460344604446054460644607446084460944610446114461244613446144461544616446174461844619446204462144622446234462444625446264462744628446294463044631446324463344634446354463644637446384463944640446414464244643446444464544646446474464844649446504465144652446534465444655446564465744658446594466044661446624466344664446654466644667446684466944670446714467244673446744467544676446774467844679446804468144682446834468444685446864468744688446894469044691446924469344694446954469644697446984469944700447014470244703447044470544706447074470844709447104471144712447134471444715447164471744718447194472044721447224472344724447254472644727447284472944730447314473244733447344473544736447374473844739447404474144742447434474444745447464474744748447494475044751447524475344754447554475644757447584475944760447614476244763447644476544766447674476844769447704477144772447734477444775447764477744778447794478044781447824478344784447854478644787447884478944790447914479244793447944479544796447974479844799448004480144802448034480444805448064480744808448094481044811448124481344814448154481644817448184481944820448214482244823448244482544826448274482844829448304483144832448334483444835448364483744838448394484044841448424484344844448454484644847448484484944850448514485244853448544485544856448574485844859448604486144862448634486444865448664486744868448694487044871448724487344874448754487644877448784487944880448814488244883448844488544886448874488844889448904489144892448934489444895448964489744898448994490044901449024490344904449054490644907449084490944910449114491244913449144491544916449174491844919449204492144922449234492444925449264492744928449294493044931449324493344934449354493644937449384493944940449414494244943449444494544946449474494844949449504495144952449534495444955449564495744958449594496044961449624496344964449654496644967449684496944970449714497244973449744497544976449774497844979449804498144982449834498444985449864498744988449894499044991449924499344994449954499644997449984499945000450014500245003450044500545006450074500845009450104501145012450134501445015450164501745018450194502045021450224502345024450254502645027450284502945030450314503245033450344503545036450374503845039450404504145042450434504445045450464504745048450494505045051450524505345054450554505645057450584505945060450614506245063450644506545066450674506845069450704507145072450734507445075450764507745078450794508045081450824508345084450854508645087450884508945090450914509245093450944509545096450974509845099451004510145102451034510445105451064510745108451094511045111451124511345114451154511645117451184511945120451214512245123451244512545126451274512845129451304513145132451334513445135451364513745138451394514045141451424514345144451454514645147451484514945150451514515245153451544515545156451574515845159451604516145162451634516445165451664516745168451694517045171451724517345174451754517645177451784517945180451814518245183451844518545186451874518845189451904519145192451934519445195451964519745198451994520045201452024520345204452054520645207452084520945210452114521245213452144521545216452174521845219452204522145222452234522445225452264522745228452294523045231452324523345234452354523645237452384523945240452414524245243452444524545246452474524845249452504525145252452534525445255452564525745258452594526045261452624526345264452654526645267452684526945270452714527245273452744527545276452774527845279452804528145282452834528445285452864528745288452894529045291452924529345294452954529645297452984529945300453014530245303453044530545306453074530845309453104531145312453134531445315453164531745318453194532045321453224532345324453254532645327453284532945330453314533245333453344533545336453374533845339453404534145342453434534445345453464534745348453494535045351453524535345354453554535645357453584535945360453614536245363453644536545366453674536845369453704537145372453734537445375453764537745378453794538045381453824538345384453854538645387453884538945390453914539245393453944539545396453974539845399454004540145402454034540445405454064540745408454094541045411454124541345414454154541645417454184541945420454214542245423454244542545426454274542845429454304543145432454334543445435454364543745438454394544045441454424544345444454454544645447454484544945450454514545245453454544545545456454574545845459454604546145462454634546445465454664546745468454694547045471454724547345474454754547645477454784547945480454814548245483454844548545486454874548845489454904549145492454934549445495454964549745498454994550045501455024550345504455054550645507455084550945510455114551245513455144551545516455174551845519455204552145522455234552445525455264552745528455294553045531455324553345534455354553645537455384553945540455414554245543455444554545546455474554845549455504555145552455534555445555455564555745558455594556045561455624556345564455654556645567455684556945570455714557245573455744557545576455774557845579455804558145582455834558445585455864558745588455894559045591455924559345594455954559645597455984559945600456014560245603456044560545606456074560845609456104561145612456134561445615456164561745618456194562045621456224562345624456254562645627456284562945630456314563245633456344563545636456374563845639456404564145642456434564445645456464564745648456494565045651456524565345654456554565645657456584565945660456614566245663456644566545666456674566845669456704567145672456734567445675456764567745678456794568045681456824568345684456854568645687456884568945690456914569245693456944569545696456974569845699457004570145702457034570445705457064570745708457094571045711457124571345714457154571645717457184571945720457214572245723457244572545726457274572845729457304573145732457334573445735457364573745738457394574045741457424574345744457454574645747457484574945750457514575245753457544575545756457574575845759457604576145762457634576445765457664576745768457694577045771457724577345774457754577645777457784577945780457814578245783457844578545786457874578845789457904579145792457934579445795457964579745798457994580045801458024580345804458054580645807458084580945810458114581245813458144581545816458174581845819458204582145822458234582445825458264582745828458294583045831458324583345834458354583645837458384583945840458414584245843458444584545846458474584845849458504585145852458534585445855458564585745858458594586045861458624586345864458654586645867458684586945870458714587245873458744587545876458774587845879458804588145882458834588445885458864588745888458894589045891458924589345894458954589645897458984589945900459014590245903459044590545906459074590845909459104591145912459134591445915459164591745918459194592045921459224592345924459254592645927459284592945930459314593245933459344593545936459374593845939459404594145942459434594445945459464594745948459494595045951459524595345954459554595645957459584595945960459614596245963459644596545966459674596845969459704597145972459734597445975459764597745978459794598045981459824598345984459854598645987459884598945990459914599245993459944599545996459974599845999460004600146002460034600446005460064600746008460094601046011460124601346014460154601646017460184601946020460214602246023460244602546026460274602846029460304603146032460334603446035460364603746038460394604046041460424604346044460454604646047460484604946050460514605246053460544605546056460574605846059460604606146062460634606446065460664606746068460694607046071460724607346074460754607646077460784607946080460814608246083460844608546086460874608846089460904609146092460934609446095460964609746098460994610046101461024610346104461054610646107461084610946110461114611246113461144611546116461174611846119461204612146122461234612446125461264612746128461294613046131461324613346134461354613646137461384613946140461414614246143461444614546146461474614846149461504615146152461534615446155461564615746158461594616046161461624616346164461654616646167461684616946170461714617246173461744617546176461774617846179461804618146182461834618446185461864618746188461894619046191461924619346194461954619646197461984619946200462014620246203462044620546206462074620846209462104621146212462134621446215462164621746218462194622046221462224622346224462254622646227462284622946230462314623246233462344623546236462374623846239462404624146242462434624446245462464624746248462494625046251462524625346254462554625646257462584625946260462614626246263462644626546266462674626846269462704627146272462734627446275462764627746278462794628046281462824628346284462854628646287462884628946290462914629246293462944629546296462974629846299463004630146302463034630446305463064630746308463094631046311463124631346314463154631646317463184631946320463214632246323463244632546326463274632846329463304633146332463334633446335463364633746338463394634046341463424634346344463454634646347463484634946350463514635246353463544635546356463574635846359463604636146362463634636446365463664636746368463694637046371463724637346374463754637646377463784637946380463814638246383463844638546386463874638846389463904639146392463934639446395463964639746398463994640046401464024640346404464054640646407464084640946410464114641246413464144641546416464174641846419464204642146422464234642446425464264642746428464294643046431464324643346434464354643646437464384643946440464414644246443464444644546446464474644846449464504645146452464534645446455464564645746458464594646046461464624646346464464654646646467464684646946470464714647246473464744647546476464774647846479464804648146482464834648446485464864648746488464894649046491464924649346494464954649646497464984649946500465014650246503465044650546506465074650846509465104651146512465134651446515465164651746518465194652046521465224652346524465254652646527465284652946530465314653246533465344653546536465374653846539465404654146542465434654446545465464654746548465494655046551465524655346554465554655646557465584655946560465614656246563465644656546566465674656846569465704657146572465734657446575465764657746578465794658046581465824658346584465854658646587465884658946590465914659246593465944659546596465974659846599466004660146602466034660446605466064660746608466094661046611466124661346614466154661646617466184661946620466214662246623466244662546626466274662846629466304663146632466334663446635466364663746638466394664046641466424664346644466454664646647466484664946650466514665246653466544665546656466574665846659466604666146662466634666446665466664666746668466694667046671466724667346674466754667646677466784667946680466814668246683466844668546686466874668846689466904669146692466934669446695466964669746698466994670046701467024670346704467054670646707467084670946710467114671246713467144671546716467174671846719467204672146722467234672446725467264672746728467294673046731467324673346734467354673646737467384673946740467414674246743467444674546746467474674846749467504675146752467534675446755467564675746758467594676046761467624676346764467654676646767467684676946770467714677246773467744677546776467774677846779467804678146782467834678446785467864678746788467894679046791467924679346794467954679646797467984679946800468014680246803468044680546806468074680846809468104681146812468134681446815468164681746818468194682046821468224682346824468254682646827468284682946830468314683246833468344683546836468374683846839468404684146842468434684446845468464684746848468494685046851468524685346854468554685646857468584685946860468614686246863468644686546866468674686846869468704687146872468734687446875468764687746878468794688046881468824688346884468854688646887468884688946890468914689246893468944689546896468974689846899469004690146902469034690446905469064690746908469094691046911469124691346914469154691646917469184691946920469214692246923469244692546926469274692846929469304693146932469334693446935469364693746938469394694046941469424694346944469454694646947469484694946950469514695246953469544695546956469574695846959469604696146962469634696446965469664696746968469694697046971469724697346974469754697646977469784697946980469814698246983469844698546986469874698846989469904699146992469934699446995469964699746998469994700047001470024700347004470054700647007470084700947010470114701247013470144701547016470174701847019470204702147022470234702447025470264702747028470294703047031470324703347034470354703647037470384703947040470414704247043470444704547046470474704847049470504705147052470534705447055470564705747058470594706047061470624706347064470654706647067470684706947070470714707247073470744707547076470774707847079470804708147082470834708447085470864708747088470894709047091470924709347094470954709647097470984709947100471014710247103471044710547106471074710847109471104711147112471134711447115471164711747118471194712047121471224712347124471254712647127471284712947130471314713247133471344713547136471374713847139471404714147142471434714447145471464714747148471494715047151471524715347154471554715647157471584715947160471614716247163471644716547166471674716847169471704717147172471734717447175471764717747178471794718047181471824718347184471854718647187471884718947190471914719247193471944719547196471974719847199472004720147202472034720447205472064720747208472094721047211472124721347214472154721647217472184721947220472214722247223472244722547226472274722847229472304723147232472334723447235472364723747238472394724047241472424724347244472454724647247472484724947250472514725247253472544725547256472574725847259472604726147262472634726447265472664726747268472694727047271472724727347274472754727647277472784727947280472814728247283472844728547286472874728847289472904729147292472934729447295472964729747298472994730047301473024730347304473054730647307473084730947310473114731247313473144731547316473174731847319473204732147322473234732447325473264732747328473294733047331473324733347334473354733647337473384733947340473414734247343473444734547346473474734847349473504735147352473534735447355473564735747358473594736047361473624736347364473654736647367473684736947370473714737247373473744737547376473774737847379473804738147382473834738447385473864738747388473894739047391473924739347394473954739647397473984739947400474014740247403474044740547406474074740847409474104741147412474134741447415474164741747418474194742047421474224742347424474254742647427474284742947430474314743247433474344743547436474374743847439474404744147442474434744447445474464744747448474494745047451474524745347454474554745647457474584745947460474614746247463474644746547466474674746847469474704747147472474734747447475474764747747478474794748047481474824748347484474854748647487474884748947490474914749247493474944749547496474974749847499475004750147502475034750447505475064750747508475094751047511475124751347514475154751647517475184751947520475214752247523475244752547526475274752847529475304753147532475334753447535475364753747538475394754047541475424754347544475454754647547475484754947550475514755247553475544755547556475574755847559475604756147562475634756447565475664756747568475694757047571475724757347574475754757647577475784757947580475814758247583475844758547586475874758847589475904759147592475934759447595475964759747598475994760047601476024760347604476054760647607476084760947610476114761247613476144761547616476174761847619476204762147622476234762447625476264762747628476294763047631476324763347634476354763647637476384763947640476414764247643476444764547646476474764847649476504765147652476534765447655476564765747658476594766047661476624766347664476654766647667476684766947670476714767247673476744767547676476774767847679476804768147682476834768447685476864768747688476894769047691476924769347694476954769647697476984769947700477014770247703477044770547706477074770847709477104771147712477134771447715477164771747718477194772047721477224772347724477254772647727477284772947730477314773247733477344773547736477374773847739477404774147742477434774447745477464774747748477494775047751477524775347754477554775647757477584775947760477614776247763477644776547766477674776847769477704777147772477734777447775477764777747778477794778047781477824778347784477854778647787477884778947790477914779247793477944779547796477974779847799478004780147802478034780447805478064780747808478094781047811478124781347814478154781647817478184781947820478214782247823478244782547826478274782847829478304783147832478334783447835478364783747838478394784047841478424784347844478454784647847478484784947850478514785247853478544785547856478574785847859478604786147862478634786447865478664786747868478694787047871478724787347874478754787647877478784787947880478814788247883478844788547886478874788847889478904789147892478934789447895478964789747898478994790047901479024790347904479054790647907479084790947910479114791247913479144791547916479174791847919479204792147922479234792447925479264792747928479294793047931479324793347934479354793647937479384793947940479414794247943479444794547946479474794847949479504795147952479534795447955479564795747958479594796047961479624796347964479654796647967479684796947970479714797247973479744797547976479774797847979479804798147982479834798447985479864798747988479894799047991479924799347994479954799647997479984799948000480014800248003480044800548006480074800848009480104801148012480134801448015480164801748018480194802048021480224802348024480254802648027480284802948030480314803248033480344803548036480374803848039480404804148042480434804448045480464804748048480494805048051480524805348054480554805648057480584805948060480614806248063480644806548066480674806848069480704807148072480734807448075480764807748078480794808048081480824808348084480854808648087480884808948090480914809248093480944809548096480974809848099481004810148102481034810448105481064810748108481094811048111481124811348114481154811648117481184811948120481214812248123481244812548126481274812848129481304813148132481334813448135481364813748138481394814048141481424814348144481454814648147481484814948150481514815248153481544815548156481574815848159481604816148162481634816448165481664816748168481694817048171481724817348174481754817648177481784817948180481814818248183481844818548186481874818848189481904819148192481934819448195481964819748198481994820048201482024820348204482054820648207482084820948210482114821248213482144821548216482174821848219482204822148222482234822448225482264822748228482294823048231482324823348234482354823648237482384823948240482414824248243482444824548246482474824848249482504825148252482534825448255482564825748258482594826048261482624826348264482654826648267482684826948270482714827248273482744827548276482774827848279482804828148282482834828448285482864828748288482894829048291482924829348294482954829648297482984829948300483014830248303483044830548306483074830848309483104831148312483134831448315483164831748318483194832048321483224832348324483254832648327483284832948330483314833248333483344833548336483374833848339483404834148342483434834448345483464834748348483494835048351483524835348354483554835648357483584835948360483614836248363483644836548366483674836848369483704837148372483734837448375483764837748378483794838048381483824838348384483854838648387483884838948390483914839248393483944839548396483974839848399484004840148402484034840448405484064840748408484094841048411484124841348414484154841648417484184841948420484214842248423484244842548426484274842848429484304843148432484334843448435484364843748438484394844048441484424844348444484454844648447484484844948450484514845248453484544845548456484574845848459484604846148462484634846448465484664846748468484694847048471484724847348474484754847648477484784847948480484814848248483484844848548486484874848848489484904849148492484934849448495484964849748498484994850048501485024850348504485054850648507485084850948510485114851248513485144851548516485174851848519485204852148522485234852448525485264852748528485294853048531485324853348534485354853648537485384853948540485414854248543485444854548546485474854848549485504855148552485534855448555485564855748558485594856048561485624856348564485654856648567485684856948570485714857248573485744857548576485774857848579485804858148582485834858448585485864858748588485894859048591485924859348594485954859648597485984859948600486014860248603486044860548606486074860848609486104861148612486134861448615486164861748618486194862048621486224862348624486254862648627486284862948630486314863248633486344863548636486374863848639486404864148642486434864448645486464864748648486494865048651486524865348654486554865648657486584865948660486614866248663486644866548666486674866848669486704867148672486734867448675486764867748678486794868048681486824868348684486854868648687486884868948690486914869248693486944869548696486974869848699487004870148702487034870448705487064870748708487094871048711487124871348714487154871648717487184871948720487214872248723487244872548726487274872848729487304873148732487334873448735487364873748738487394874048741487424874348744487454874648747487484874948750487514875248753487544875548756487574875848759487604876148762487634876448765487664876748768487694877048771487724877348774487754877648777487784877948780487814878248783487844878548786487874878848789487904879148792487934879448795487964879748798487994880048801488024880348804488054880648807488084880948810488114881248813488144881548816488174881848819488204882148822488234882448825488264882748828488294883048831488324883348834488354883648837488384883948840488414884248843488444884548846488474884848849488504885148852488534885448855488564885748858488594886048861488624886348864488654886648867488684886948870488714887248873488744887548876488774887848879488804888148882488834888448885488864888748888488894889048891488924889348894488954889648897488984889948900489014890248903489044890548906489074890848909489104891148912489134891448915489164891748918489194892048921489224892348924489254892648927489284892948930489314893248933489344893548936489374893848939489404894148942489434894448945489464894748948489494895048951489524895348954489554895648957489584895948960489614896248963489644896548966489674896848969489704897148972489734897448975489764897748978489794898048981489824898348984489854898648987489884898948990489914899248993489944899548996489974899848999490004900149002490034900449005490064900749008490094901049011490124901349014490154901649017490184901949020490214902249023490244902549026490274902849029490304903149032490334903449035490364903749038490394904049041490424904349044490454904649047490484904949050490514905249053490544905549056490574905849059490604906149062490634906449065490664906749068490694907049071490724907349074490754907649077490784907949080490814908249083490844908549086490874908849089490904909149092490934909449095490964909749098490994910049101491024910349104491054910649107491084910949110491114911249113491144911549116491174911849119491204912149122491234912449125491264912749128491294913049131491324913349134491354913649137491384913949140491414914249143491444914549146491474914849149491504915149152491534915449155491564915749158491594916049161491624916349164491654916649167491684916949170491714917249173491744917549176491774917849179491804918149182491834918449185491864918749188491894919049191491924919349194491954919649197491984919949200492014920249203492044920549206492074920849209492104921149212492134921449215492164921749218492194922049221492224922349224492254922649227492284922949230492314923249233492344923549236492374923849239492404924149242492434924449245492464924749248492494925049251492524925349254492554925649257492584925949260492614926249263492644926549266492674926849269492704927149272492734927449275492764927749278492794928049281492824928349284492854928649287492884928949290492914929249293492944929549296492974929849299493004930149302493034930449305493064930749308493094931049311493124931349314493154931649317493184931949320493214932249323493244932549326493274932849329493304933149332493334933449335493364933749338493394934049341493424934349344493454934649347493484934949350493514935249353493544935549356493574935849359493604936149362493634936449365493664936749368493694937049371493724937349374493754937649377493784937949380493814938249383493844938549386493874938849389493904939149392493934939449395493964939749398493994940049401494024940349404494054940649407494084940949410494114941249413494144941549416494174941849419494204942149422494234942449425494264942749428494294943049431494324943349434494354943649437494384943949440494414944249443494444944549446494474944849449494504945149452494534945449455494564945749458494594946049461494624946349464494654946649467494684946949470494714947249473494744947549476494774947849479494804948149482494834948449485494864948749488494894949049491494924949349494494954949649497494984949949500495014950249503495044950549506495074950849509495104951149512495134951449515495164951749518495194952049521495224952349524495254952649527495284952949530495314953249533495344953549536495374953849539495404954149542495434954449545495464954749548495494955049551495524955349554495554955649557495584955949560495614956249563495644956549566495674956849569495704957149572495734957449575495764957749578495794958049581495824958349584495854958649587495884958949590495914959249593495944959549596495974959849599496004960149602496034960449605496064960749608496094961049611496124961349614496154961649617496184961949620496214962249623496244962549626496274962849629496304963149632496334963449635496364963749638496394964049641496424964349644496454964649647496484964949650496514965249653496544965549656496574965849659496604966149662496634966449665496664966749668496694967049671496724967349674496754967649677496784967949680496814968249683496844968549686496874968849689496904969149692496934969449695496964969749698496994970049701497024970349704497054970649707497084970949710497114971249713497144971549716497174971849719497204972149722497234972449725497264972749728497294973049731497324973349734497354973649737497384973949740497414974249743497444974549746497474974849749497504975149752497534975449755497564975749758497594976049761497624976349764497654976649767497684976949770497714977249773497744977549776497774977849779497804978149782497834978449785497864978749788497894979049791497924979349794497954979649797497984979949800498014980249803498044980549806498074980849809498104981149812498134981449815498164981749818498194982049821498224982349824498254982649827498284982949830498314983249833498344983549836498374983849839498404984149842498434984449845498464984749848498494985049851498524985349854498554985649857498584985949860498614986249863498644986549866498674986849869498704987149872498734987449875498764987749878498794988049881498824988349884498854988649887498884988949890498914989249893498944989549896498974989849899499004990149902499034990449905499064990749908499094991049911499124991349914499154991649917499184991949920499214992249923499244992549926499274992849929499304993149932499334993449935499364993749938499394994049941499424994349944499454994649947499484994949950499514995249953499544995549956499574995849959499604996149962499634996449965499664996749968499694997049971499724997349974499754997649977499784997949980499814998249983499844998549986499874998849989499904999149992499934999449995499964999749998499995000050001500025000350004500055000650007500085000950010500115001250013500145001550016500175001850019500205002150022500235002450025500265002750028500295003050031500325003350034500355003650037500385003950040500415004250043500445004550046500475004850049500505005150052500535005450055500565005750058500595006050061500625006350064500655006650067500685006950070500715007250073500745007550076500775007850079500805008150082500835008450085500865008750088500895009050091500925009350094500955009650097500985009950100501015010250103501045010550106501075010850109501105011150112501135011450115501165011750118501195012050121501225012350124501255012650127501285012950130501315013250133501345013550136501375013850139501405014150142501435014450145501465014750148501495015050151501525015350154501555015650157501585015950160501615016250163501645016550166501675016850169501705017150172501735017450175501765017750178501795018050181501825018350184501855018650187501885018950190501915019250193501945019550196501975019850199502005020150202502035020450205502065020750208502095021050211502125021350214502155021650217502185021950220502215022250223502245022550226502275022850229502305023150232502335023450235502365023750238502395024050241502425024350244502455024650247502485024950250502515025250253502545025550256502575025850259502605026150262502635026450265502665026750268502695027050271502725027350274502755027650277502785027950280502815028250283502845028550286502875028850289502905029150292502935029450295502965029750298502995030050301503025030350304503055030650307503085030950310503115031250313503145031550316503175031850319503205032150322503235032450325503265032750328503295033050331503325033350334503355033650337503385033950340503415034250343503445034550346503475034850349503505035150352503535035450355503565035750358503595036050361503625036350364503655036650367503685036950370503715037250373503745037550376503775037850379503805038150382503835038450385503865038750388503895039050391503925039350394503955039650397503985039950400504015040250403504045040550406504075040850409504105041150412504135041450415504165041750418504195042050421504225042350424504255042650427504285042950430504315043250433504345043550436504375043850439504405044150442504435044450445504465044750448504495045050451504525045350454504555045650457504585045950460504615046250463504645046550466504675046850469504705047150472504735047450475504765047750478504795048050481504825048350484504855048650487504885048950490504915049250493504945049550496504975049850499505005050150502505035050450505505065050750508505095051050511505125051350514505155051650517505185051950520505215052250523505245052550526505275052850529505305053150532505335053450535505365053750538505395054050541505425054350544505455054650547505485054950550505515055250553505545055550556505575055850559505605056150562505635056450565505665056750568505695057050571505725057350574505755057650577505785057950580505815058250583505845058550586505875058850589505905059150592505935059450595505965059750598505995060050601506025060350604506055060650607506085060950610506115061250613506145061550616506175061850619506205062150622506235062450625506265062750628506295063050631506325063350634506355063650637506385063950640506415064250643506445064550646506475064850649506505065150652506535065450655506565065750658506595066050661506625066350664506655066650667506685066950670506715067250673506745067550676506775067850679506805068150682506835068450685506865068750688506895069050691506925069350694506955069650697506985069950700507015070250703507045070550706507075070850709507105071150712507135071450715507165071750718507195072050721507225072350724507255072650727507285072950730507315073250733507345073550736507375073850739507405074150742507435074450745507465074750748507495075050751507525075350754507555075650757507585075950760507615076250763507645076550766507675076850769507705077150772507735077450775507765077750778507795078050781507825078350784507855078650787507885078950790507915079250793507945079550796507975079850799508005080150802508035080450805508065080750808508095081050811508125081350814508155081650817508185081950820508215082250823508245082550826508275082850829508305083150832508335083450835508365083750838508395084050841508425084350844508455084650847508485084950850508515085250853508545085550856508575085850859508605086150862508635086450865508665086750868508695087050871508725087350874508755087650877508785087950880508815088250883508845088550886508875088850889508905089150892508935089450895508965089750898508995090050901509025090350904509055090650907509085090950910509115091250913509145091550916509175091850919509205092150922509235092450925509265092750928509295093050931509325093350934509355093650937509385093950940509415094250943509445094550946509475094850949509505095150952509535095450955509565095750958509595096050961509625096350964509655096650967509685096950970509715097250973509745097550976509775097850979509805098150982509835098450985509865098750988509895099050991509925099350994509955099650997509985099951000510015100251003510045100551006510075100851009510105101151012510135101451015510165101751018510195102051021510225102351024510255102651027510285102951030510315103251033510345103551036510375103851039510405104151042510435104451045510465104751048510495105051051510525105351054510555105651057510585105951060510615106251063510645106551066510675106851069510705107151072510735107451075510765107751078510795108051081510825108351084510855108651087510885108951090510915109251093510945109551096510975109851099511005110151102511035110451105511065110751108511095111051111511125111351114511155111651117511185111951120511215112251123511245112551126511275112851129511305113151132511335113451135511365113751138511395114051141511425114351144511455114651147511485114951150511515115251153511545115551156511575115851159511605116151162511635116451165511665116751168511695117051171511725117351174511755117651177511785117951180511815118251183511845118551186511875118851189511905119151192511935119451195511965119751198511995120051201512025120351204512055120651207512085120951210512115121251213512145121551216512175121851219512205122151222512235122451225512265122751228512295123051231512325123351234512355123651237512385123951240512415124251243512445124551246512475124851249512505125151252512535125451255512565125751258512595126051261512625126351264512655126651267512685126951270512715127251273512745127551276512775127851279512805128151282512835128451285512865128751288512895129051291512925129351294512955129651297512985129951300513015130251303513045130551306513075130851309513105131151312513135131451315513165131751318513195132051321513225132351324513255132651327513285132951330513315133251333513345133551336513375133851339513405134151342513435134451345513465134751348513495135051351513525135351354513555135651357513585135951360513615136251363513645136551366513675136851369513705137151372513735137451375513765137751378513795138051381513825138351384513855138651387513885138951390513915139251393513945139551396513975139851399514005140151402514035140451405514065140751408514095141051411514125141351414514155141651417514185141951420514215142251423514245142551426514275142851429514305143151432514335143451435514365143751438514395144051441514425144351444514455144651447514485144951450514515145251453514545145551456514575145851459514605146151462514635146451465514665146751468514695147051471514725147351474514755147651477514785147951480514815148251483514845148551486514875148851489514905149151492514935149451495514965149751498514995150051501515025150351504515055150651507515085150951510515115151251513515145151551516515175151851519515205152151522515235152451525515265152751528515295153051531515325153351534515355153651537515385153951540515415154251543515445154551546515475154851549515505155151552515535155451555515565155751558515595156051561515625156351564515655156651567515685156951570515715157251573515745157551576515775157851579515805158151582515835158451585515865158751588515895159051591515925159351594515955159651597515985159951600516015160251603516045160551606516075160851609516105161151612516135161451615516165161751618516195162051621516225162351624516255162651627516285162951630516315163251633516345163551636516375163851639516405164151642516435164451645516465164751648516495165051651516525165351654516555165651657516585165951660516615166251663516645166551666516675166851669516705167151672516735167451675516765167751678516795168051681516825168351684516855168651687516885168951690516915169251693516945169551696516975169851699517005170151702517035170451705517065170751708517095171051711517125171351714517155171651717517185171951720517215172251723517245172551726517275172851729517305173151732517335173451735517365173751738517395174051741517425174351744517455174651747517485174951750517515175251753517545175551756517575175851759517605176151762517635176451765517665176751768517695177051771517725177351774517755177651777517785177951780517815178251783517845178551786517875178851789517905179151792517935179451795517965179751798517995180051801518025180351804518055180651807518085180951810518115181251813518145181551816518175181851819518205182151822518235182451825518265182751828518295183051831518325183351834518355183651837518385183951840518415184251843518445184551846518475184851849518505185151852518535185451855518565185751858518595186051861518625186351864518655186651867518685186951870518715187251873518745187551876518775187851879518805188151882518835188451885518865188751888518895189051891518925189351894518955189651897518985189951900519015190251903519045190551906519075190851909519105191151912519135191451915519165191751918519195192051921519225192351924519255192651927519285192951930519315193251933519345193551936519375193851939519405194151942519435194451945519465194751948519495195051951519525195351954519555195651957519585195951960519615196251963519645196551966519675196851969519705197151972519735197451975519765197751978519795198051981519825198351984519855198651987519885198951990519915199251993519945199551996519975199851999520005200152002520035200452005520065200752008520095201052011520125201352014520155201652017520185201952020520215202252023520245202552026520275202852029520305203152032520335203452035520365203752038520395204052041520425204352044520455204652047520485204952050520515205252053520545205552056520575205852059520605206152062520635206452065520665206752068520695207052071520725207352074520755207652077520785207952080520815208252083520845208552086520875208852089520905209152092520935209452095520965209752098520995210052101521025210352104521055210652107521085210952110521115211252113521145211552116521175211852119521205212152122521235212452125521265212752128521295213052131521325213352134521355213652137521385213952140521415214252143521445214552146521475214852149521505215152152521535215452155521565215752158521595216052161521625216352164521655216652167521685216952170521715217252173521745217552176521775217852179521805218152182521835218452185521865218752188521895219052191521925219352194521955219652197521985219952200522015220252203522045220552206522075220852209522105221152212522135221452215522165221752218522195222052221522225222352224522255222652227522285222952230522315223252233522345223552236522375223852239522405224152242522435224452245522465224752248522495225052251522525225352254522555225652257522585225952260522615226252263522645226552266522675226852269522705227152272522735227452275522765227752278522795228052281522825228352284522855228652287522885228952290522915229252293522945229552296522975229852299523005230152302523035230452305523065230752308523095231052311523125231352314523155231652317523185231952320523215232252323523245232552326523275232852329523305233152332523335233452335523365233752338523395234052341523425234352344523455234652347523485234952350523515235252353523545235552356523575235852359523605236152362523635236452365523665236752368523695237052371523725237352374523755237652377523785237952380523815238252383523845238552386523875238852389523905239152392523935239452395523965239752398523995240052401524025240352404524055240652407524085240952410524115241252413524145241552416524175241852419524205242152422524235242452425524265242752428524295243052431524325243352434524355243652437524385243952440524415244252443524445244552446524475244852449524505245152452524535245452455524565245752458524595246052461524625246352464524655246652467524685246952470524715247252473524745247552476524775247852479524805248152482524835248452485524865248752488524895249052491524925249352494524955249652497524985249952500525015250252503525045250552506525075250852509525105251152512525135251452515525165251752518525195252052521525225252352524525255252652527525285252952530525315253252533525345253552536525375253852539525405254152542525435254452545525465254752548525495255052551525525255352554525555255652557525585255952560525615256252563525645256552566525675256852569525705257152572525735257452575525765257752578525795258052581525825258352584525855258652587525885258952590525915259252593525945259552596525975259852599526005260152602526035260452605526065260752608526095261052611526125261352614526155261652617526185261952620526215262252623526245262552626526275262852629526305263152632526335263452635526365263752638526395264052641526425264352644526455264652647526485264952650526515265252653526545265552656526575265852659526605266152662526635266452665526665266752668526695267052671526725267352674526755267652677526785267952680526815268252683526845268552686526875268852689526905269152692526935269452695526965269752698526995270052701527025270352704527055270652707527085270952710527115271252713527145271552716527175271852719527205272152722527235272452725527265272752728527295273052731527325273352734527355273652737527385273952740527415274252743527445274552746527475274852749527505275152752527535275452755527565275752758527595276052761527625276352764527655276652767527685276952770527715277252773527745277552776527775277852779527805278152782527835278452785527865278752788527895279052791527925279352794527955279652797527985279952800528015280252803528045280552806528075280852809528105281152812528135281452815528165281752818528195282052821528225282352824528255282652827528285282952830528315283252833528345283552836528375283852839528405284152842528435284452845528465284752848528495285052851528525285352854528555285652857528585285952860528615286252863528645286552866528675286852869528705287152872528735287452875528765287752878528795288052881528825288352884528855288652887528885288952890528915289252893528945289552896528975289852899529005290152902529035290452905529065290752908529095291052911529125291352914529155291652917529185291952920529215292252923529245292552926529275292852929529305293152932529335293452935529365293752938529395294052941529425294352944529455294652947529485294952950529515295252953529545295552956529575295852959529605296152962529635296452965529665296752968529695297052971529725297352974529755297652977529785297952980529815298252983529845298552986529875298852989529905299152992529935299452995529965299752998529995300053001530025300353004530055300653007530085300953010530115301253013530145301553016530175301853019530205302153022530235302453025530265302753028530295303053031530325303353034530355303653037530385303953040530415304253043530445304553046530475304853049530505305153052530535305453055530565305753058530595306053061530625306353064530655306653067530685306953070530715307253073530745307553076530775307853079530805308153082530835308453085530865308753088530895309053091530925309353094530955309653097530985309953100531015310253103531045310553106531075310853109531105311153112531135311453115531165311753118531195312053121531225312353124531255312653127531285312953130531315313253133531345313553136531375313853139531405314153142531435314453145531465314753148531495315053151531525315353154531555315653157531585315953160531615316253163531645316553166531675316853169531705317153172531735317453175531765317753178531795318053181531825318353184531855318653187531885318953190531915319253193531945319553196531975319853199532005320153202532035320453205532065320753208532095321053211532125321353214532155321653217532185321953220532215322253223532245322553226532275322853229532305323153232532335323453235532365323753238532395324053241532425324353244532455324653247532485324953250532515325253253532545325553256532575325853259532605326153262532635326453265532665326753268532695327053271532725327353274532755327653277532785327953280532815328253283532845328553286532875328853289532905329153292532935329453295532965329753298532995330053301533025330353304533055330653307533085330953310533115331253313533145331553316533175331853319533205332153322533235332453325533265332753328533295333053331533325333353334533355333653337533385333953340533415334253343533445334553346533475334853349533505335153352533535335453355533565335753358533595336053361533625336353364533655336653367533685336953370533715337253373533745337553376533775337853379533805338153382533835338453385533865338753388533895339053391533925339353394533955339653397533985339953400534015340253403534045340553406534075340853409534105341153412534135341453415534165341753418534195342053421534225342353424534255342653427534285342953430534315343253433534345343553436534375343853439534405344153442534435344453445534465344753448534495345053451534525345353454534555345653457534585345953460534615346253463534645346553466534675346853469534705347153472534735347453475534765347753478534795348053481534825348353484534855348653487534885348953490534915349253493534945349553496534975349853499535005350153502535035350453505535065350753508535095351053511535125351353514535155351653517535185351953520535215352253523535245352553526535275352853529535305353153532535335353453535535365353753538535395354053541535425354353544535455354653547535485354953550535515355253553535545355553556535575355853559535605356153562535635356453565535665356753568535695357053571535725357353574535755357653577535785357953580535815358253583535845358553586535875358853589535905359153592535935359453595535965359753598535995360053601536025360353604536055360653607536085360953610536115361253613536145361553616536175361853619536205362153622536235362453625536265362753628536295363053631536325363353634536355363653637536385363953640536415364253643536445364553646536475364853649536505365153652536535365453655536565365753658536595366053661536625366353664536655366653667536685366953670536715367253673536745367553676536775367853679536805368153682536835368453685536865368753688536895369053691536925369353694536955369653697536985369953700537015370253703537045370553706537075370853709537105371153712537135371453715537165371753718537195372053721537225372353724537255372653727537285372953730537315373253733537345373553736537375373853739537405374153742537435374453745537465374753748537495375053751537525375353754537555375653757537585375953760537615376253763537645376553766537675376853769537705377153772537735377453775537765377753778537795378053781537825378353784537855378653787537885378953790537915379253793537945379553796537975379853799538005380153802538035380453805538065380753808538095381053811538125381353814538155381653817538185381953820538215382253823538245382553826538275382853829538305383153832538335383453835538365383753838538395384053841538425384353844538455384653847538485384953850538515385253853538545385553856538575385853859538605386153862538635386453865538665386753868538695387053871538725387353874538755387653877538785387953880538815388253883538845388553886538875388853889538905389153892538935389453895538965389753898538995390053901539025390353904539055390653907539085390953910539115391253913539145391553916539175391853919539205392153922539235392453925539265392753928539295393053931539325393353934539355393653937539385393953940539415394253943539445394553946539475394853949539505395153952539535395453955539565395753958539595396053961539625396353964539655396653967539685396953970539715397253973539745397553976539775397853979539805398153982539835398453985539865398753988539895399053991539925399353994539955399653997539985399954000540015400254003540045400554006540075400854009540105401154012540135401454015540165401754018540195402054021540225402354024540255402654027540285402954030540315403254033540345403554036540375403854039540405404154042540435404454045540465404754048540495405054051540525405354054540555405654057540585405954060540615406254063540645406554066540675406854069540705407154072540735407454075540765407754078540795408054081540825408354084540855408654087540885408954090540915409254093540945409554096540975409854099541005410154102541035410454105541065410754108541095411054111541125411354114541155411654117541185411954120541215412254123541245412554126541275412854129541305413154132541335413454135541365413754138541395414054141541425414354144541455414654147541485414954150541515415254153541545415554156541575415854159541605416154162541635416454165541665416754168541695417054171541725417354174541755417654177541785417954180541815418254183541845418554186541875418854189541905419154192541935419454195541965419754198541995420054201542025420354204542055420654207542085420954210542115421254213542145421554216542175421854219542205422154222542235422454225542265422754228542295423054231542325423354234542355423654237542385423954240542415424254243542445424554246542475424854249542505425154252542535425454255542565425754258542595426054261542625426354264542655426654267542685426954270542715427254273542745427554276542775427854279542805428154282542835428454285542865428754288542895429054291542925429354294542955429654297542985429954300543015430254303543045430554306543075430854309543105431154312543135431454315543165431754318543195432054321543225432354324543255432654327543285432954330543315433254333543345433554336543375433854339543405434154342543435434454345543465434754348543495435054351543525435354354543555435654357543585435954360543615436254363543645436554366543675436854369543705437154372543735437454375543765437754378543795438054381543825438354384543855438654387543885438954390543915439254393543945439554396543975439854399544005440154402544035440454405544065440754408544095441054411544125441354414544155441654417544185441954420544215442254423544245442554426544275442854429544305443154432544335443454435544365443754438544395444054441544425444354444544455444654447544485444954450544515445254453544545445554456544575445854459544605446154462544635446454465544665446754468544695447054471544725447354474544755447654477544785447954480544815448254483544845448554486544875448854489544905449154492544935449454495544965449754498544995450054501545025450354504545055450654507545085450954510545115451254513545145451554516545175451854519545205452154522545235452454525545265452754528545295453054531545325453354534545355453654537545385453954540545415454254543545445454554546545475454854549545505455154552545535455454555545565455754558545595456054561545625456354564545655456654567545685456954570545715457254573545745457554576545775457854579545805458154582545835458454585545865458754588545895459054591545925459354594545955459654597545985459954600546015460254603546045460554606546075460854609546105461154612546135461454615546165461754618546195462054621546225462354624546255462654627546285462954630546315463254633546345463554636546375463854639546405464154642546435464454645546465464754648546495465054651546525465354654546555465654657546585465954660546615466254663546645466554666546675466854669546705467154672546735467454675546765467754678546795468054681546825468354684546855468654687546885468954690546915469254693546945469554696546975469854699547005470154702547035470454705547065470754708547095471054711547125471354714547155471654717547185471954720547215472254723547245472554726547275472854729547305473154732547335473454735547365473754738547395474054741547425474354744547455474654747547485474954750547515475254753547545475554756547575475854759547605476154762547635476454765547665476754768547695477054771547725477354774547755477654777547785477954780547815478254783547845478554786547875478854789547905479154792547935479454795547965479754798547995480054801548025480354804548055480654807548085480954810548115481254813548145481554816548175481854819548205482154822548235482454825548265482754828548295483054831548325483354834548355483654837548385483954840548415484254843548445484554846548475484854849548505485154852548535485454855548565485754858548595486054861548625486354864548655486654867548685486954870548715487254873548745487554876548775487854879548805488154882548835488454885548865488754888548895489054891548925489354894548955489654897548985489954900549015490254903549045490554906549075490854909549105491154912549135491454915549165491754918549195492054921549225492354924549255492654927549285492954930549315493254933549345493554936549375493854939549405494154942549435494454945549465494754948549495495054951549525495354954549555495654957549585495954960549615496254963549645496554966549675496854969549705497154972549735497454975549765497754978549795498054981549825498354984549855498654987549885498954990549915499254993549945499554996549975499854999550005500155002550035500455005550065500755008550095501055011550125501355014550155501655017550185501955020550215502255023550245502555026550275502855029550305503155032550335503455035550365503755038550395504055041550425504355044550455504655047550485504955050550515505255053550545505555056550575505855059550605506155062550635506455065550665506755068550695507055071550725507355074550755507655077550785507955080550815508255083550845508555086550875508855089550905509155092550935509455095550965509755098550995510055101551025510355104551055510655107551085510955110551115511255113551145511555116551175511855119551205512155122551235512455125551265512755128551295513055131551325513355134551355513655137
  1. hardwareHotList = {}
  2. //热点 设备控制
  3. $("#hotPannel .close").on('click',()=>{
  4. $("#hotPannel>div").css("display","");
  5. window.hotNeedUpdatePannel = null;
  6. })
  7. $("#hotPannel input.mui-switch").on('change',()=>{
  8. var ifOn = $('#hotPannel input.mui-switch').is(':checked');
  9. })
  10. var dom = {
  11. getOffset: function(e, t, i) {
  12. for (left = "left" == e ? t.offsetLeft : t.offsetTop,
  13. i = i || $("body")[0]; (t = t.offsetParent) && t != i; )
  14. left += "left" == e ? t.offsetLeft : t.offsetTop;
  15. return left
  16. }
  17. };
  18. if (function() {
  19. "use strict";
  20. function o(e, t) {
  21. return typeof e === t
  22. }
  23. function a(e, t) {
  24. return e instanceof t
  25. }
  26. function s(e) {
  27. return e && e.nodeType
  28. }
  29. function l(e) {
  30. return s(e) ? e : a(e, y) ? e[0] : void 0
  31. }
  32. function e(e, i, n) {
  33. return y.each(e, function(e, t) {
  34. n = i.call(t, n, e, t)
  35. }),
  36. n
  37. }
  38. function t(e, t, i) {
  39. var n, r, o;
  40. if (e === t)
  41. return !0;
  42. if (!e || !t || e.constructor !== t.constructor)
  43. return !1;
  44. for (n = 0,
  45. r = i.length; n < r; n += 1) {
  46. if (e[o = i[n]] && E(e[o].equals) && !e[o].equals(t[o]))
  47. return !1;
  48. if (e[o] !== t[o])
  49. return !1
  50. }
  51. return !0
  52. }
  53. function c(e, t, i, n) {
  54. this.left = w(e),
  55. this.top = w(t),
  56. this.width = w(i),
  57. this.height = w(n),
  58. this.right = this.left + this.width,
  59. this.bottom = this.top + this.height
  60. }
  61. function h(e, t, i, n) {
  62. this.visible = e || 0,
  63. this.viewport = t || 0,
  64. this.possible = i || 0,
  65. this.rects = n && I({}, n) || null
  66. }
  67. function r(e, t) {
  68. this.els = e,
  69. this.viewport = t
  70. }
  71. function n(e, t) {
  72. return e.val - t.val
  73. }
  74. function u(e, t) {
  75. return t.val - e.val
  76. }
  77. function d(e) {
  78. var t = c.ofContent(e, !0)
  79. , i = c.ofViewport(e, !0)
  80. , n = t.width - i.width
  81. , r = t.height - i.height;
  82. this.content = t,
  83. this.viewport = i,
  84. this.width = n <= 0 ? null : i.left / n,
  85. this.height = r <= 0 ? null : i.top / r,
  86. this.left = i.left,
  87. this.top = i.top,
  88. this.right = t.right - i.right,
  89. this.bottom = t.bottom - i.bottom
  90. }
  91. function p(e) {
  92. this.el = e || window
  93. }
  94. function f(e, t) {
  95. this.context = e,
  96. this.viewport = t,
  97. this.init()
  98. }
  99. function g(e, t, i, n) {
  100. this.context = new r(e,t),
  101. this.property = i,
  102. this.descending = n,
  103. this.init()
  104. }
  105. function m(e) {
  106. e && e !== window && e !== document ? (this.context = e,
  107. this.$autoTarget = y(e)) : this.context = window,
  108. this.init()
  109. }
  110. 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 = {},
  111. v = 1,
  112. function(e) {
  113. return e ? (i[e] || (i[e] = v,
  114. v += 1),
  115. i[e]) : 0
  116. }
  117. );
  118. I(c.prototype, {
  119. equals: function(e) {
  120. return t(this, e, ["left", "top", "width", "height"])
  121. },
  122. area: function() {
  123. return this.width * this.height
  124. },
  125. relativeTo: function(e) {
  126. return new c(this.left - e.left,this.top - e.top,this.width,this.height)
  127. },
  128. intersection: function(e) {
  129. if (!a(e, c))
  130. return null;
  131. var t = _(this.left, e.left)
  132. , i = b(this.right, e.right)
  133. , n = _(this.top, e.top)
  134. , r = i - t
  135. , o = b(this.bottom, e.bottom) - n;
  136. return 0 <= r && 0 <= o ? new c(t,n,r,o) : null
  137. },
  138. envelope: function(e) {
  139. if (!a(e, c))
  140. return this;
  141. var t = b(this.left, e.left)
  142. , i = _(this.right, e.right)
  143. , n = b(this.top, e.top);
  144. return new c(t,n,i - t,_(this.bottom, e.bottom) - n)
  145. }
  146. }),
  147. I(c, {
  148. ofContent: function(e, t) {
  149. 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())
  150. },
  151. ofViewport: function(e, t) {
  152. 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())
  153. },
  154. ofElement: function(e) {
  155. var t = y(e);
  156. if (!t.is(":visible"))
  157. return null;
  158. var i = t.offset();
  159. return new c(i.left,i.top,t.outerWidth(),t.outerHeight())
  160. }
  161. }),
  162. I(h.prototype, {
  163. equals: function(e) {
  164. return this.fracsEqual(e) && this.rectsEqual(e)
  165. },
  166. fracsEqual: function(e) {
  167. return t(this, e, ["visible", "viewport", "possible"])
  168. },
  169. rectsEqual: function(e) {
  170. return t(this.rects, e.rects, ["document", "element", "viewport"])
  171. }
  172. }),
  173. I(h, {
  174. of: function(e, t) {
  175. var i, n, r;
  176. return e = s(e) && c.ofElement(e) || e,
  177. t = s(t) && c.ofViewport(t) || t || c.ofViewport(),
  178. e instanceof c && (i = e.intersection(t)) ? (n = i.area(),
  179. r = b(e.width, t.width) * b(e.height, t.height),
  180. new h(n / e.area(),n / t.area(),n / r,{
  181. document: i,
  182. element: i.relativeTo(e),
  183. viewport: i.relativeTo(t)
  184. })) : new h
  185. }
  186. });
  187. var x = ["width", "height", "left", "right", "top", "bottom"]
  188. , S = ["possible", "visible", "viewport"];
  189. I(r.prototype, {
  190. sorted: function(t, e) {
  191. var i = this.viewport;
  192. return y.map(this.els, function(e) {
  193. return {
  194. el: e,
  195. val: function(e, t, i) {
  196. var n;
  197. return 0 <= y.inArray(i, x) ? n = c.ofElement(e) : 0 <= y.inArray(i, S) && (n = h.of(e, t)),
  198. n ? n[i] : 0
  199. }(e, i, t)
  200. }
  201. }).sort(e ? u : n)
  202. },
  203. best: function(e, t) {
  204. return this.els.length ? this.sorted(e, t)[0] : null
  205. }
  206. }),
  207. I(d.prototype, {
  208. equals: function(e) {
  209. return t(this, e, ["width", "height", "left", "top", "right", "bottom", "content", "viewport"])
  210. }
  211. }),
  212. I(p.prototype, {
  213. equals: function(e) {
  214. return t(this, e, ["el"])
  215. },
  216. scrollState: function() {
  217. return new d(this.el)
  218. },
  219. scrollTo: function(e, t, i) {
  220. var n = y(this.el === window ? "html,body" : this.el);
  221. e = e || 0,
  222. t = t || 0,
  223. i = isNaN(i) ? 1e3 : i,
  224. n.stop(!0).animate({
  225. scrollLeft: e,
  226. scrollTop: t
  227. }, i)
  228. },
  229. scroll: function(e, t, i) {
  230. var n = this.el === window ? A : y(this.el);
  231. e = e || 0,
  232. t = t || 0,
  233. this.scrollTo(n.scrollLeft() + e, n.scrollTop() + t, i)
  234. },
  235. scrollToRect: function(e, t, i, n) {
  236. t = t || 0,
  237. i = i || 0,
  238. this.scrollTo(e.left - t, e.top - i, n)
  239. },
  240. scrollToElement: function(e, t, i, n) {
  241. var r = c.ofElement(e).relativeTo(c.ofContent(this.el));
  242. this.scrollToRect(r, t, i, n)
  243. }
  244. });
  245. var M = {
  246. init: function() {
  247. this.callbacks = y.Callbacks("memory unique"),
  248. this.currVal = null,
  249. this.prevVal = null,
  250. this.checkProxy = y.proxy(this.check, this),
  251. this.autoCheck()
  252. },
  253. bind: function(e) {
  254. this.callbacks.add(e)
  255. },
  256. unbind: function(e) {
  257. e ? this.callbacks.remove(e) : this.callbacks.empty()
  258. },
  259. trigger: function() {
  260. this.callbacks.fireWith(this.context, [this.currVal, this.prevVal])
  261. },
  262. check: function(e) {
  263. var t = this.updatedValue(e);
  264. return void 0 !== t && (this.prevVal = this.currVal,
  265. this.currVal = t,
  266. this.trigger(),
  267. !0)
  268. },
  269. $autoTarget: A,
  270. autoEvents: "load resize scroll",
  271. autoCheck: function(e) {
  272. this.$autoTarget[!1 === e ? "off" : "on"](this.autoEvents, this.checkProxy)
  273. }
  274. };
  275. I(f.prototype, M, {
  276. updatedValue: function() {
  277. var e = h.of(this.context, this.viewport);
  278. return this.currVal && this.currVal.equals(e) ? void 0 : e
  279. }
  280. }),
  281. I(g.prototype, M, {
  282. updatedValue: function() {
  283. var e = this.context.best(this.property, this.descending);
  284. return e && (e = 0 < e.val ? e.el : null,
  285. this.currVal !== e) ? e : void 0
  286. }
  287. }),
  288. I(m.prototype, M, {
  289. updatedValue: function() {
  290. var e = new d(this.context);
  291. return this.currVal && this.currVal.equals(e) ? void 0 : e
  292. }
  293. });
  294. var R, P, O, L, D, N, F, B, V, k, U = "fracs";
  295. function H(e, t, i, n) {
  296. return i = N(i) ? i.apply(e, t) : i,
  297. N(n[i]) ? n[i].apply(e, t) : void L.error('Method "' + i + '" does not exist on jQuery.' + R)
  298. }
  299. R = U,
  300. P = {
  301. statics: {
  302. version: "0.15.0",
  303. Rect: c,
  304. Fractions: h,
  305. Group: r,
  306. ScrollState: d,
  307. Viewport: p,
  308. FracsCallbacks: f,
  309. GroupCallbacks: g,
  310. ScrollStateCallbacks: m,
  311. fracs: function(e, t) {
  312. return h.of(e, t)
  313. }
  314. },
  315. methods: {
  316. content: function(e) {
  317. return this.length ? c.ofContent(this[0], e) : null
  318. },
  319. envelope: function() {
  320. return e(this, function(e) {
  321. var t = c.ofElement(this);
  322. return e ? e.envelope(t) : t
  323. })
  324. },
  325. fracs: function(e, i, n) {
  326. o(e, "string") || (n = i,
  327. i = e,
  328. e = null),
  329. E(i) || (n = i,
  330. i = null),
  331. n = l(n);
  332. var r = U + ".fracs." + T(n);
  333. return "unbind" === e ? this.each(function() {
  334. var e = y(this).data(r);
  335. e && e.unbind(i)
  336. }) : "check" === e ? this.each(function() {
  337. var e = y(this).data(r);
  338. e && e.check()
  339. }) : E(i) ? this.each(function() {
  340. var e = y(this)
  341. , t = e.data(r);
  342. t || (t = new f(this,n),
  343. e.data(r, t)),
  344. t.bind(i)
  345. }) : this.length ? h.of(this[0], n) : null
  346. },
  347. intersection: function() {
  348. return e(this, function(e) {
  349. var t = c.ofElement(this);
  350. return e ? e.intersection(t) : t
  351. })
  352. },
  353. max: function(e, t, i) {
  354. return E(t) || (i = t,
  355. t = null),
  356. i = l(i),
  357. t ? (new g(this,i,e,!0).bind(t),
  358. this) : this.pushStack(new r(this,i).best(e, !0).el)
  359. },
  360. min: function(e, t, i) {
  361. return E(t) || (i = t,
  362. t = null),
  363. i = l(i),
  364. t ? (new g(this,i,e).bind(t),
  365. this) : this.pushStack(new r(this,i).best(e).el)
  366. },
  367. rect: function() {
  368. return this.length ? c.ofElement(this[0]) : null
  369. },
  370. scrollState: function(e, i) {
  371. var n = U + ".scrollState";
  372. return o(e, "string") || (i = e,
  373. e = null),
  374. "unbind" === e ? this.each(function() {
  375. var e = y(this).data(n);
  376. e && e.unbind(i)
  377. }) : "check" === e ? this.each(function() {
  378. var e = y(this).data(n);
  379. e && e.check()
  380. }) : E(i) ? this.each(function() {
  381. var e = y(this)
  382. , t = e.data(n);
  383. t || (t = new m(this),
  384. e.data(n, t)),
  385. t.bind(i)
  386. }) : this.length ? new d(this[0]) : null
  387. },
  388. scroll: function(e, t, i) {
  389. return this.each(function() {
  390. new p(this).scroll(e, t, i)
  391. })
  392. },
  393. scrollTo: function(e, t, i, n) {
  394. return y.isNumeric(e) && (n = i,
  395. i = t,
  396. t = e,
  397. e = null),
  398. e = l(e),
  399. this.each(function() {
  400. e ? new p(this).scrollToElement(e, t, i, n) : new p(this).scrollTo(t, i, n)
  401. })
  402. },
  403. scrollToThis: function(e, t, i, n) {
  404. return (n = new p(l(n))).scrollToElement(this[0], e, t, i),
  405. this
  406. },
  407. softLink: function(t, i, n, r) {
  408. return r = new p(l(r)),
  409. this.filter("a[href^=#]").each(function() {
  410. var e = y(this);
  411. e.on("click", function() {
  412. r.scrollToElement(y(e.attr("href"))[0], t, i, n)
  413. })
  414. })
  415. },
  416. sort: function(e, t, i) {
  417. return o(t, "boolean") || (i = t,
  418. t = null),
  419. i = l(i),
  420. this.pushStack(y.map(new r(this,i).sorted(e, !t), function(e) {
  421. return e.el
  422. }))
  423. },
  424. viewport: function(e) {
  425. return this.length ? c.ofViewport(this[0], e) : null
  426. }
  427. },
  428. defaultStatic: "fracs",
  429. defaultMethod: "fracs"
  430. },
  431. O = [].slice,
  432. L = jQuery,
  433. D = L.extend,
  434. N = L.isFunction,
  435. F = D({}, P),
  436. B = function() {
  437. return H(this, O.call(arguments), F.defaultStatic, B)
  438. }
  439. ,
  440. V = function(e) {
  441. return N(V[e]) ? V[e].apply(this, O.call(arguments, 1)) : H(this, O.call(arguments), F.defaultMethod, V)
  442. }
  443. ,
  444. (k = function(e) {
  445. e && (D(B, e.statics),
  446. D(V, e.methods)),
  447. B.modplug = k
  448. }
  449. ).prev = {
  450. statics: L[R],
  451. methods: L.fn[R]
  452. },
  453. k(P),
  454. L[R] = B,
  455. L.fn[R] = V
  456. }(),
  457. "undefined" == typeof jQuery)
  458. throw new Error("Bootstrap's JavaScript requires jQuery");
  459. !function(m) {
  460. "use strict";
  461. function r(e, t) {
  462. this.type = this.options = this.enabled = this.timeout = this.hoverState = this.$element = null,
  463. this.init("tooltip", e, t)
  464. }
  465. r.VERSION = "3.2.0",
  466. r.DEFAULTS = {
  467. animation: !0,
  468. placement: "top",
  469. selector: !1,
  470. template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
  471. trigger: "hover focus",
  472. title: "",
  473. delay: 0,
  474. html: !1,
  475. container: !1,
  476. viewport: {
  477. selector: "body",
  478. padding: 0
  479. }
  480. },
  481. r.prototype.init = function(e, t, i) {
  482. this.enabled = !0,
  483. this.type = e,
  484. this.$element = m(t),
  485. this.options = this.getOptions(i),
  486. this.$viewport = this.options.viewport && m(this.options.viewport.selector || this.options.viewport);
  487. for (var n = this.options.trigger.split(" "), r = n.length; r--; ) {
  488. var o = n[r];
  489. if ("click" == o)
  490. this.$element.on("click." + this.type, this.options.selector, m.proxy(this.toggle, this));
  491. else if ("manual" != o) {
  492. var a = "hover" == o ? "mouseenter" : "focusin"
  493. , s = "hover" == o ? "mouseleave" : "focusout";
  494. this.$element.on(a + "." + this.type, this.options.selector, m.proxy(this.enter, this)),
  495. this.$element.on(s + "." + this.type, this.options.selector, m.proxy(this.leave, this))
  496. }
  497. }
  498. this.options.selector ? this._options = m.extend({}, this.options, {
  499. trigger: "manual",
  500. selector: ""
  501. }) : this.fixTitle()
  502. }
  503. ,
  504. r.prototype.getDefaults = function() {
  505. return r.DEFAULTS
  506. }
  507. ,
  508. r.prototype.getOptions = function(e) {
  509. return (e = m.extend({}, this.getDefaults(), this.$element.data(), e)).delay && "number" == typeof e.delay && (e.delay = {
  510. show: e.delay,
  511. hide: e.delay
  512. }),
  513. e
  514. }
  515. ,
  516. r.prototype.getDelegateOptions = function() {
  517. var i = {}
  518. , n = this.getDefaults();
  519. return this._options && m.each(this._options, function(e, t) {
  520. n[e] != t && (i[e] = t)
  521. }),
  522. i
  523. }
  524. ,
  525. r.prototype.enter = function(e) {
  526. var t = e instanceof this.constructor ? e : m(e.currentTarget).data("bs." + this.type);
  527. return t || (t = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  528. m(e.currentTarget).data("bs." + this.type, t)),
  529. clearTimeout(t.timeout),
  530. t.hoverState = "in",
  531. t.options.delay && t.options.delay.show ? void (t.timeout = setTimeout(function() {}, t.options.delay.show)) : t.show()
  532. }
  533. ,
  534. r.prototype.leave = function(e) {
  535. var t = e instanceof this.constructor ? e : m(e.currentTarget).data("bs." + this.type);
  536. return t || (t = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  537. m(e.currentTarget).data("bs." + this.type, t)),
  538. clearTimeout(t.timeout),
  539. t.hoverState = "out",
  540. t.options.delay && t.options.delay.hide ? void (t.timeout = setTimeout(function() {
  541. "out" == t.hoverState && t.hide()
  542. }, t.options.delay.hide)) : t.hide()
  543. }
  544. ,
  545. r.prototype.show = function() {
  546. var e = m.Event("show.bs." + this.type);
  547. if (this.hasContent() && this.enabled) {
  548. this.$element.trigger(e);
  549. var t = m.contains(document.documentElement, this.$element[0]);
  550. if (e.isDefaultPrevented() || !t)
  551. return;
  552. var i = this
  553. , n = this.tip()
  554. , r = this.getUID(this.type);
  555. this.setContent(),
  556. n.attr("id", r),
  557. this.$element.attr("aria-describedby", r),
  558. this.options.animation && n.addClass("fade");
  559. var o = "function" == typeof this.options.placement ? this.options.placement.call(this, n[0], this.$element[0]) : this.options.placement
  560. , a = /\s?auto?\s?/i
  561. , s = a.test(o);
  562. s && (o = o.replace(a, "") || "top"),
  563. n.detach().css({
  564. top: 0,
  565. left: 0,
  566. display: "block"
  567. }).addClass(o).data("bs." + this.type, this),
  568. this.options.container ? n.appendTo(this.options.container) : n.insertAfter(this.$element);
  569. var l = this.getPosition()
  570. , c = n[0].offsetWidth
  571. , h = n[0].offsetHeight;
  572. if (s) {
  573. var u = o
  574. , d = this.$element.parent()
  575. , p = this.getPosition(d);
  576. 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,
  577. n.removeClass(u).addClass(o)
  578. }
  579. var f = this.getCalculatedOffset(o, l, c, h);
  580. this.applyPlacement(f, o);
  581. var g = function() {
  582. i.$element.trigger("shown.bs." + i.type),
  583. i.hoverState = null
  584. };
  585. m.support.transition && this.$tip.hasClass("fade") ? n.one("bsTransitionEnd", g).emulateTransitionEnd(150) : g()
  586. }
  587. }
  588. ,
  589. r.prototype.applyPlacement = function(e, t) {
  590. var i = this.tip()
  591. , n = i[0].offsetWidth
  592. , r = i[0].offsetHeight
  593. , o = parseInt(i.css("margin-top"), 10)
  594. , a = parseInt(i.css("margin-left"), 10);
  595. isNaN(o) && (o = 0),
  596. isNaN(a) && (a = 0),
  597. e.top = e.top + o,
  598. e.left = e.left + a,
  599. m.offset.setOffset(i[0], m.extend({
  600. using: function(e) {
  601. i.css({
  602. top: Math.round(e.top),
  603. left: Math.round(e.left)
  604. })
  605. }
  606. }, e), 0),
  607. i.addClass("in");
  608. var s = i[0].offsetWidth
  609. , l = i[0].offsetHeight;
  610. "top" == t && l != r && (e.top = e.top + r - l);
  611. var c = this.getViewportAdjustedDelta(t, e, s, l);
  612. c.left ? e.left += c.left : e.top += c.top;
  613. var h = c.left ? 2 * c.left - n + s : 2 * c.top - r + l
  614. , u = c.left ? "left" : "top"
  615. , d = c.left ? "offsetWidth" : "offsetHeight";
  616. i.offset(e),
  617. this.replaceArrow(h, i[0][d], u)
  618. }
  619. ,
  620. r.prototype.replaceArrow = function(e, t, i) {
  621. this.arrow().css(i, e ? 50 * (1 - e / t) + "%" : "")
  622. }
  623. ,
  624. r.prototype.setContent = function() {
  625. var e = this.tip()
  626. , t = this.getTitle();
  627. e.find(".tooltip-inner")[this.options.html ? "html" : "text"](t),
  628. e.removeClass("fade in top bottom left right")
  629. }
  630. ,
  631. r.prototype.hide = function() {
  632. function e() {
  633. "in" != t.hoverState && i.detach(),
  634. t.$element.trigger("hidden.bs." + t.type)
  635. }
  636. var t = this
  637. , i = this.tip()
  638. , n = m.Event("hide.bs." + this.type);
  639. if (this.$element.removeAttr("aria-describedby"),
  640. this.$element.trigger(n),
  641. !n.isDefaultPrevented())
  642. return i.removeClass("in"),
  643. m.support.transition && this.$tip.hasClass("fade") ? i.one("bsTransitionEnd", e).emulateTransitionEnd(150) : e(),
  644. this.hoverState = null,
  645. this
  646. }
  647. ,
  648. r.prototype.fixTitle = function() {
  649. var e = this.$element;
  650. !e.attr("title") && "string" == typeof e.attr("data-original-title") || e.attr("data-original-title", e.attr("title") || "").attr("title", "")
  651. }
  652. ,
  653. r.prototype.hasContent = function() {
  654. return this.getTitle()
  655. }
  656. ,
  657. r.prototype.getPosition = function(e) {
  658. var t = (e = e || this.$element)[0]
  659. , i = "BODY" == t.tagName;
  660. return m.extend({}, "function" == typeof t.getBoundingClientRect ? t.getBoundingClientRect() : null, {
  661. scroll: i ? document.documentElement.scrollTop || document.body.scrollTop : e.scrollTop(),
  662. width: i ? m(window).width() : e.outerWidth(),
  663. height: i ? m(window).height() : e.outerHeight()
  664. }, i ? {
  665. top: 0,
  666. left: 0
  667. } : e.offset())
  668. }
  669. ,
  670. r.prototype.getCalculatedOffset = function(e, t, i, n) {
  671. return "bottom" == e ? {
  672. top: t.top + t.height,
  673. left: t.left + t.width / 2 - i / 2
  674. } : "top" == e ? {
  675. top: t.top - n,
  676. left: t.left + t.width / 2 - i / 2
  677. } : "left" == e ? {
  678. top: t.top + t.height / 2 - n / 2,
  679. left: t.left - i
  680. } : {
  681. top: t.top + t.height / 2 - n / 2,
  682. left: t.left + t.width
  683. }
  684. }
  685. ,
  686. r.prototype.getViewportAdjustedDelta = function(e, t, i, n) {
  687. var r = {
  688. top: 0,
  689. left: 0
  690. };
  691. if (!this.$viewport)
  692. return r;
  693. var o = this.options.viewport && this.options.viewport.padding || 0
  694. , a = this.getPosition(this.$viewport);
  695. if (/right|left/.test(e)) {
  696. var s = t.top - o - a.scroll
  697. , l = t.top + o - a.scroll + n;
  698. s < a.top ? r.top = a.top - s : l > a.top + a.height && (r.top = a.top + a.height - l)
  699. } else {
  700. var c = t.left - o
  701. , h = t.left + o + i;
  702. c < a.left ? r.left = a.left - c : h > a.width && (r.left = a.left + a.width - h)
  703. }
  704. return r
  705. }
  706. ,
  707. r.prototype.getTitle = function() {
  708. var e = this.$element
  709. , t = this.options;
  710. return e.attr("data-original-title") || ("function" == typeof t.title ? t.title.call(e[0]) : t.title)
  711. }
  712. ,
  713. r.prototype.getUID = function(e) {
  714. for (; e += ~~(1e6 * Math.random()),
  715. document.getElementById(e); )
  716. ;
  717. return e
  718. }
  719. ,
  720. r.prototype.tip = function() {
  721. return this.$tip = this.$tip || m(this.options.template)
  722. }
  723. ,
  724. r.prototype.arrow = function() {
  725. return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
  726. }
  727. ,
  728. r.prototype.validate = function() {
  729. this.$element[0].parentNode || (this.hide(),
  730. this.$element = null,
  731. this.options = null)
  732. }
  733. ,
  734. r.prototype.enable = function() {
  735. this.enabled = !0
  736. }
  737. ,
  738. r.prototype.disable = function() {
  739. this.enabled = !1
  740. }
  741. ,
  742. r.prototype.toggleEnabled = function() {
  743. this.enabled = !this.enabled
  744. }
  745. ,
  746. r.prototype.toggle = function(e) {
  747. var t = this;
  748. e && ((t = m(e.currentTarget).data("bs." + this.type)) || (t = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  749. m(e.currentTarget).data("bs." + this.type, t))),
  750. t.tip().hasClass("in") ? t.leave(t) : t.enter(t)
  751. }
  752. ,
  753. r.prototype.destroy = function() {
  754. clearTimeout(this.timeout),
  755. this.hide().$element.off("." + this.type).removeData("bs." + this.type)
  756. }
  757. ;
  758. var e = m.fn.tooltip;
  759. m.fn.tooltip = function(n) {
  760. return this.each(function() {
  761. var e = m(this)
  762. , t = e.data("bs.tooltip")
  763. , i = "object" == typeof n && n;
  764. !t && "destroy" == n || (t || e.data("bs.tooltip", t = new r(this,i)),
  765. "string" == typeof n && t[n]())
  766. })
  767. }
  768. ,
  769. m.fn.tooltip.Constructor = r,
  770. m.fn.tooltip.noConflict = function() {
  771. return m.fn.tooltip = e,
  772. this
  773. }
  774. }(jQuery),
  775. function(e, t, i) {
  776. "undefined" != typeof module && module.exports ? module.exports = i() : "function" == typeof define && define.amd ? define(i) : t.Keen = i()
  777. }(0, this, function() {
  778. "use strict";
  779. function Keen() {
  780. return _init.apply(this, arguments)
  781. }
  782. function _init(e) {
  783. if (_isUndefined(e))
  784. throw new Error("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  785. if (_isUndefined(e.projectId) || "String" !== _type(e.projectId) || e.projectId.length < 1)
  786. throw new Error("Please provide a projectId");
  787. this.configure(e)
  788. }
  789. function _extend(e) {
  790. for (var t = 1; t < arguments.length; t++)
  791. for (var i in arguments[t])
  792. e[i] = arguments[t][i];
  793. return e
  794. }
  795. function _isUndefined(e) {
  796. return void 0 === e
  797. }
  798. function _type(e) {
  799. var t = e && e.constructor ? e.constructor.toString() : void 0;
  800. return t ? t.match(/function (.*)\(/)[1] : "Null"
  801. }
  802. function _each(e, t, i) {
  803. var n;
  804. if (!e)
  805. return 0;
  806. if (i = i || e,
  807. "array" === _type(e)) {
  808. for (n = 0; n < e.length; n++)
  809. if (!1 === t.call(i, e[n], n, e))
  810. return 0
  811. } else
  812. for (n in e)
  813. if (e.hasOwnProperty(n) && !1 === t.call(i, e[n], n, e))
  814. return 0;
  815. return 1
  816. }
  817. function _parse_params(e) {
  818. for (var t, i = {}, n = /\+/g, r = /([^&=]+)=?([^&]*)/g, o = function(e) {
  819. return decodeURIComponent(e.replace(n, " "))
  820. }, a = e.split("?")[1]; t = r.exec(a); )
  821. i[o(t[1])] = o(t[2]);
  822. return i
  823. }
  824. function _set_protocol(e) {
  825. switch (e) {
  826. case "http":
  827. return "http";
  828. case "auto":
  829. return location.protocol.replace(/:/g, "");
  830. case "https":
  831. case void 0:
  832. default:
  833. return "https"
  834. }
  835. }
  836. function _set_request_type(e) {
  837. var t = e || "jsonp"
  838. , i = !1;
  839. return ("Object" === _type(XMLHttpRequest) || "Function" === _type(XMLHttpRequest)) && "withCredentials"in new XMLHttpRequest && (i = !0),
  840. null == t || "xhr" == t ? i ? "xhr" : "jsonp" : t
  841. }
  842. function _build_url(e) {
  843. return this.client.endpoint + "/projects/" + this.client.projectId + e
  844. }
  845. function _uploadEvent(e, t, i, n, r) {
  846. var o = _build_url.apply(this, ["/events/" + e])
  847. , a = {};
  848. for (var s in i = !1 !== i,
  849. this.client.globalProperties && (a = this.client.globalProperties(e)),
  850. t)
  851. t.hasOwnProperty(s) && (a[s] = t[s]);
  852. switch (this.client.requestType) {
  853. case "xhr":
  854. _request.xhr.apply(this, ["POST", o, null, a, this.client.writeKey, i, n, r]);
  855. break;
  856. case "jsonp":
  857. var l = JSON.stringify(a)
  858. , c = Keen.Base64.encode(l);
  859. o = (o = (o = o + "?api_key=" + this.client.writeKey) + "&data=" + c) + "&modified=" + (new Date).getTime(),
  860. _request.jsonp.apply(this, [o, this.client.writeKey, n, r]);
  861. break;
  862. case "beacon":
  863. l = JSON.stringify(a),
  864. c = Keen.Base64.encode(l);
  865. o = (o = (o = o + "?api_key=" + encodeURIComponent(this.client.writeKey)) + "&data=" + encodeURIComponent(c)) + "&modified=" + encodeURIComponent((new Date).getTime()),
  866. o += "&c=clv1",
  867. _request.beacon.apply(this, [o, null, n, r])
  868. }
  869. }
  870. Keen.prototype.configure = function(e) {
  871. return e.host = _isUndefined(e.host) ? "api.keen.io/3.0" : e.host.replace(/.*?:\/\//g, ""),
  872. e.protocol = _set_protocol(e.protocol),
  873. e.requestType = _set_request_type(e.requestType),
  874. this.client = {
  875. projectId: e.projectId,
  876. writeKey: e.writeKey,
  877. readKey: e.readKey,
  878. globalProperties: null,
  879. endpoint: e.protocol + "://" + e.host,
  880. requestType: e.requestType
  881. },
  882. Keen.trigger("client", this, e),
  883. this.trigger("ready"),
  884. this
  885. }
  886. ;
  887. var _request = {
  888. xhr: function(e, t, i, n, r, o, a, s) {
  889. if (!r)
  890. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  891. var l = new XMLHttpRequest;
  892. if (l.onreadystatechange = function() {
  893. if (4 == l.readyState)
  894. if (200 <= l.status && l.status < 300) {
  895. var e;
  896. try {
  897. e = JSON.parse(l.responseText)
  898. } catch (e) {
  899. Keen.log("Could not JSON parse HTTP response: " + l.responseText),
  900. s && s(l, e)
  901. }
  902. a && e && a(e)
  903. } else
  904. Keen.log("HTTP request failed."),
  905. s && s(l, null)
  906. }
  907. ,
  908. l.open(e, t, o),
  909. r && l.setRequestHeader("Authorization", r),
  910. n && l.setRequestHeader("Content-Type", "application/json"),
  911. i)
  912. for (var c in i)
  913. i.hasOwnProperty(c) && l.setRequestHeader(c, i[c]);
  914. var h = n ? JSON.stringify(n) : null;
  915. l.send(h)
  916. },
  917. jsonp: function(e, t, i, n) {
  918. if (!t)
  919. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  920. if (t && e.indexOf("api_key") < 0) {
  921. var r = 0 < e.indexOf("?") ? "&" : "?";
  922. e = e + r + "api_key=" + t
  923. }
  924. for (var o = "keenJSONPCallback" + (new Date).getTime(); o in window; )
  925. o += "a";
  926. var a = !1;
  927. window[o] = function(e) {
  928. a = !0,
  929. i && e && i(e),
  930. window[o] = void 0
  931. }
  932. ,
  933. e = e + "&jsonp=" + o;
  934. var s = document.createElement("script");
  935. s.id = "keen-jsonp",
  936. s.src = e,
  937. document.getElementsByTagName("head")[0].appendChild(s),
  938. s.onreadystatechange = function() {
  939. !1 === a && "loaded" === this.readyState && (a = !0,
  940. n && n())
  941. }
  942. ,
  943. s.onerror = function() {
  944. !1 === a && (a = !0,
  945. n && n())
  946. }
  947. },
  948. beacon: function(e, t, i, n) {
  949. if (t && e.indexOf("api_key") < 0) {
  950. var r = 0 < e.indexOf("?") ? "&" : "?";
  951. e = e + r + "api_key=" + t
  952. }
  953. var o = document.createElement("img");
  954. o.onload = function() {
  955. if (!0,
  956. "naturalHeight"in this) {
  957. if (this.naturalHeight + this.naturalWidth === 0)
  958. return void this.onerror()
  959. } else if (this.width + this.height === 0)
  960. return void this.onerror();
  961. i && i({
  962. created: !0
  963. })
  964. }
  965. ,
  966. o.onerror = function() {
  967. !0,
  968. n && n()
  969. }
  970. ,
  971. o.src = e
  972. }
  973. }
  974. , Events = Keen.Events = {
  975. on: function(e, t) {
  976. return this.listeners || (this.listeners = {}),
  977. (this.listeners[e] || (this.listeners[e] = [])).push({
  978. callback: t
  979. }),
  980. this
  981. },
  982. off: function(e, t) {
  983. if (!e && !t)
  984. return this.listeners = void 0,
  985. delete this.listeners,
  986. this;
  987. for (var i = this.listeners[e] || [], n = i.length; n--; )
  988. t && t == i[n].callback && this.listeners[e].splice(n, 1),
  989. t && 0 != i.length || (this.listeners[e] = void 0,
  990. delete this.listeners[e]);
  991. return this
  992. },
  993. trigger: function(e) {
  994. if (!this.listeners)
  995. return this;
  996. for (var t = Array.prototype.slice.call(arguments, 1), i = this.listeners[e] || [], n = 0; n < i.length; n++)
  997. i[n].callback.apply(this, t);
  998. return this
  999. }
  1000. };
  1001. _extend(Keen.prototype, Events),
  1002. _extend(Keen, Events),
  1003. Keen.loaded = !0,
  1004. Keen.utils = {
  1005. each: _each,
  1006. extend: _extend,
  1007. parseParams: _parse_params
  1008. },
  1009. Keen.ready = function(e) {
  1010. Keen.loaded ? e() : Keen.on("ready", e)
  1011. }
  1012. ,
  1013. Keen.log = function(e) {
  1014. "object" == typeof console && console.log("[Keen IO]", e)
  1015. }
  1016. ;
  1017. var Plugins = Keen.Plugins = {}, Hh, Ih;
  1018. Keen.prototype.addEvent = function() {
  1019. _uploadEvent.apply(this, arguments)
  1020. }
  1021. ,
  1022. Keen.prototype.addEventSync = function(e, t, i, n) {
  1023. _uploadEvent.apply(this, [e, t, !1, i, n])
  1024. }
  1025. ,
  1026. Keen.prototype.trackExternalLink = function(e, t, i, n, r) {
  1027. var o = e
  1028. , a = o.metaKey
  1029. , s = o.target
  1030. , l = !1
  1031. , c = function() {};
  1032. return void 0 === n && (n = 500),
  1033. "A" === s.nodeName ? c = function() {
  1034. a || l || (l = !0,
  1035. window.location = s.href)
  1036. }
  1037. : "FORM" === s.nodeName && (c = function() {
  1038. l || (l = !0,
  1039. s.submit())
  1040. }
  1041. ),
  1042. r && (c = function() {
  1043. l || (l = !0,
  1044. r())
  1045. }
  1046. ),
  1047. _uploadEvent.call(this, t, i, c, c),
  1048. setTimeout(function() {
  1049. c()
  1050. }, n),
  1051. !!a && void 0
  1052. }
  1053. ,
  1054. Keen.prototype.setGlobalProperties = function(e) {
  1055. if (!this.client)
  1056. return Keen.log("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  1057. if (!e || "function" != typeof e)
  1058. throw new Error("Invalid value for global properties: " + e);
  1059. this.client.globalProperties = e
  1060. }
  1061. ,
  1062. Keen.Base64 = {
  1063. map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  1064. encode: function(e) {
  1065. var t, i, n, r, o, a, s, l = "", c = 0, h = this.map;
  1066. for (e = this.utf8.encode(e); c < e.length; )
  1067. t = e.charCodeAt(c++),
  1068. i = e.charCodeAt(c++),
  1069. n = e.charCodeAt(c++),
  1070. r = t >> 2,
  1071. o = (3 & t) << 4 | i >> 4,
  1072. a = isNaN(i) ? 64 : (15 & i) << 2 | n >> 6,
  1073. s = isNaN(i) || isNaN(n) ? 64 : 63 & n,
  1074. l = l + h.charAt(r) + h.charAt(o) + h.charAt(a) + h.charAt(s);
  1075. return l
  1076. },
  1077. decode: function(e) {
  1078. var t, i, n, r, o, a, s = "", l = 0, c = this.map, h = String.fromCharCode;
  1079. for (e = e.replace(/[^A-Za-z0-9\+\/\=]/g, ""); l < e.length; )
  1080. t = c.indexOf(e.charAt(l++)),
  1081. o = (15 & (i = c.indexOf(e.charAt(l++)))) << 4 | (n = c.indexOf(e.charAt(l++))) >> 2,
  1082. a = (3 & n) << 6 | (r = c.indexOf(e.charAt(l++))),
  1083. s = s + (h(t << 2 | i >> 4) + (64 != n ? h(o) : "")) + (64 != r ? h(a) : "");
  1084. return this.utf8.decode(s)
  1085. },
  1086. utf8: {
  1087. encode: function(e) {
  1088. for (var t, i = "", n = 0, r = String.fromCharCode; n < e.length; )
  1089. 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);
  1090. return i
  1091. },
  1092. decode: function(e) {
  1093. for (var t, i = "", n = 0, r = String.fromCharCode; n < e.length; )
  1094. 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];
  1095. return i
  1096. }
  1097. }
  1098. },
  1099. "object" != typeof JSON && (JSON = {}),
  1100. function() {
  1101. function f(e) {
  1102. return e < 10 ? "0" + e : e
  1103. }
  1104. function quote(e) {
  1105. return escapable.lastIndex = 0,
  1106. escapable.test(e) ? '"' + e.replace(escapable, function(e) {
  1107. var t = meta[e];
  1108. return "string" == typeof t ? t : "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1109. }) + '"' : '"' + e + '"'
  1110. }
  1111. function str(e, t) {
  1112. var i, n, r, o, a, s = gap, l = t[e];
  1113. switch (l && "object" == typeof l && "function" == typeof l.toJSON && (l = l.toJSON(e)),
  1114. "function" == typeof rep && (l = rep.call(t, e, l)),
  1115. typeof l) {
  1116. case "string":
  1117. return quote(l);
  1118. case "number":
  1119. return isFinite(l) ? String(l) : "null";
  1120. case "boolean":
  1121. case "null":
  1122. return String(l);
  1123. case "object":
  1124. if (!l)
  1125. return "null";
  1126. if (gap += indent,
  1127. a = [],
  1128. "[object Array]" === Object.prototype.toString.apply(l)) {
  1129. for (o = l.length,
  1130. i = 0; i < o; i += 1)
  1131. a[i] = str(i, l) || "null";
  1132. return r = 0 === a.length ? "[]" : gap ? "[\n" + gap + a.join(",\n" + gap) + "\n" + s + "]" : "[" + a.join(",") + "]",
  1133. gap = s,
  1134. r
  1135. }
  1136. if (rep && "object" == typeof rep)
  1137. for (o = rep.length,
  1138. i = 0; i < o; i += 1)
  1139. "string" == typeof rep[i] && ((r = str(n = rep[i], l)) && a.push(quote(n) + (gap ? ": " : ":") + r));
  1140. else
  1141. for (n in l)
  1142. Object.prototype.hasOwnProperty.call(l, n) && ((r = str(n, l)) && a.push(quote(n) + (gap ? ": " : ":") + r));
  1143. return r = 0 === a.length ? "{}" : gap ? "{\n" + gap + a.join(",\n" + gap) + "\n" + s + "}" : "{" + a.join(",") + "}",
  1144. gap = s,
  1145. r
  1146. }
  1147. }
  1148. "function" != typeof Date.prototype.toJSON && (Date.prototype.toJSON = function() {
  1149. 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
  1150. }
  1151. ,
  1152. String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function() {
  1153. return this.valueOf()
  1154. }
  1155. );
  1156. 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 = {
  1157. "\b": "\\b",
  1158. "\t": "\\t",
  1159. "\n": "\\n",
  1160. "\f": "\\f",
  1161. "\r": "\\r",
  1162. '"': '\\"',
  1163. "\\": "\\\\"
  1164. }, rep;
  1165. "function" != typeof JSON.stringify && (JSON.stringify = function(e, t, i) {
  1166. var n;
  1167. if (indent = gap = "",
  1168. "number" == typeof i)
  1169. for (n = 0; n < i; n += 1)
  1170. indent += " ";
  1171. else
  1172. "string" == typeof i && (indent = i);
  1173. if ((rep = t) && "function" != typeof t && ("object" != typeof t || "number" != typeof t.length))
  1174. throw new Error("JSON.stringify");
  1175. return str("", {
  1176. "": e
  1177. })
  1178. }
  1179. ),
  1180. "function" != typeof JSON.parse && (JSON.parse = function(text, reviver) {
  1181. function walk(e, t) {
  1182. var i, n, r = e[t];
  1183. if (r && "object" == typeof r)
  1184. for (i in r)
  1185. Object.prototype.hasOwnProperty.call(r, i) && (void 0 !== (n = walk(r, i)) ? r[i] = n : delete r[i]);
  1186. return reviver.call(e, t, r)
  1187. }
  1188. var j;
  1189. if (text = String(text),
  1190. cx.lastIndex = 0,
  1191. cx.test(text) && (text = text.replace(cx, function(e) {
  1192. return "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1193. })),
  1194. /^[\],:{}\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, "")))
  1195. return j = eval("(" + text + ")"),
  1196. "function" == typeof reviver ? walk({
  1197. "": j
  1198. }, "") : j;
  1199. throw new SyntaxError("JSON.parse")
  1200. }
  1201. )
  1202. }(),
  1203. Hh = Keen.utils,
  1204. Ih = function(i) {
  1205. function e(e) {
  1206. for (u = 1; e = n.shift(); )
  1207. e()
  1208. }
  1209. 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]);
  1210. return r[l] && r[l](s, t = function() {
  1211. r.removeEventListener(s, t, !1),
  1212. e()
  1213. }
  1214. , !1),
  1215. a && r.attachEvent(c, t = function() {
  1216. /^c/.test(r[h]) && (r.detachEvent(c, t),
  1217. e())
  1218. }
  1219. ),
  1220. i = a ? function(t) {
  1221. self != top ? u ? t() : n.push(t) : function() {
  1222. try {
  1223. o.doScroll("left")
  1224. } catch (e) {
  1225. return setTimeout(function() {
  1226. i(t)
  1227. }, 50)
  1228. }
  1229. t()
  1230. }()
  1231. }
  1232. : function(e) {
  1233. u ? e() : n.push(e)
  1234. }
  1235. }
  1236. ,
  1237. "undefined" != typeof module && module.exports ? module.exports = Ih() : "function" == typeof define && define.amd ? define(Ih) : Hh.domready = Ih();
  1238. var loaded = window.Keen, cached = window._Keen || {}, clients, ready;
  1239. if (loaded && cached) {
  1240. for (var instance in clients = cached.clients || {},
  1241. ready = cached.ready || [],
  1242. clients)
  1243. if (clients.hasOwnProperty(instance)) {
  1244. var client = clients[instance];
  1245. for (var method in Keen.prototype)
  1246. Keen.prototype.hasOwnProperty(method) && (loaded.prototype[method] = Keen.prototype[method]);
  1247. if (loaded.Query = Keen.Query ? Keen.Query : function() {}
  1248. ,
  1249. loaded.Visualization = Keen.Visualization ? Keen.Visualization : function() {}
  1250. ,
  1251. client._config && (client.configure.call(client, client._config),
  1252. delete client._config),
  1253. client._setGlobalProperties) {
  1254. for (var globals = client._setGlobalProperties, i = 0; i < globals.length; i++)
  1255. client.setGlobalProperties.apply(client, globals[i]);
  1256. delete client._setGlobalProperties
  1257. }
  1258. if (client._addEvent) {
  1259. for (var queue = client._addEvent || [], i = 0; i < queue.length; i++)
  1260. client.addEvent.apply(client, queue[i]);
  1261. delete client._addEvent
  1262. }
  1263. var callback = client._on || [];
  1264. if (client._on) {
  1265. for (var i = 0; i < callback.length; i++)
  1266. client.on.apply(client, callback[i]);
  1267. client.trigger("ready"),
  1268. delete client._on
  1269. }
  1270. }
  1271. for (var i = 0; i < ready.length; i++) {
  1272. var callback = ready[i];
  1273. Keen.on("ready", function() {
  1274. callback()
  1275. })
  1276. }
  1277. }
  1278. return Keen.loaded && setTimeout(function() {
  1279. Keen.utils.domready(function() {
  1280. Keen.trigger("ready")
  1281. })
  1282. }, 0),
  1283. Keen
  1284. }),
  1285. function() {
  1286. var i = window.analytics = window.analytics || [];
  1287. if (!i.initialize) {
  1288. if (i.invoked)
  1289. return window.console && console.error && console.error("Segment snippet included twice.");
  1290. i.invoked = !0,
  1291. i.methods = ["trackSubmit", "trackClick", "trackLink", "trackForm", "pageview", "identify", "reset", "group", "track", "ready", "alias", "debug", "page", "once", "off", "on"],
  1292. i.factory = function(t) {
  1293. return function() {
  1294. var e = Array.prototype.slice.call(arguments);
  1295. return e.unshift(t),
  1296. i.push(e),
  1297. i
  1298. }
  1299. }
  1300. ;
  1301. for (var e = 0; e < i.methods.length; e++) {
  1302. var t = i.methods[e];
  1303. i[t] = i.factory(t)
  1304. }
  1305. i.load = function(e) {
  1306. var t = document.createElement("script");
  1307. t.type = "text/javascript",
  1308. t.async = !0,
  1309. t.src = ("https:" === document.location.protocol ? "https://" : "http://") + "cdn.segment.com/analytics.js/v1/" + e + "/analytics.min.js";
  1310. var i = document.getElementsByTagName("script")[0];
  1311. i.parentNode.insertBefore(t, i)
  1312. }
  1313. ,
  1314. i.SNIPPET_VERSION = "4.0.0"
  1315. }
  1316. }(),
  1317. function(i, u) {
  1318. "use strict";
  1319. var d = "function"
  1320. , p = "undefined"
  1321. , f = "object"
  1322. , e = "major"
  1323. , t = "model"
  1324. , n = "name"
  1325. , r = "type"
  1326. , o = "vendor"
  1327. , a = "version"
  1328. , s = "architecture"
  1329. , l = "console"
  1330. , c = "mobile"
  1331. , h = "tablet"
  1332. , g = {
  1333. has: function(e, t) {
  1334. return -1 !== t.toLowerCase().indexOf(e.toLowerCase())
  1335. },
  1336. lowerize: function(e) {
  1337. return e.toLowerCase()
  1338. }
  1339. }
  1340. , m = {
  1341. rgx: function() {
  1342. for (var e, t, i, n, r, o, a, s = 0, l = arguments; s < l.length; s += 2) {
  1343. var c = l[s]
  1344. , h = l[s + 1];
  1345. if (typeof e == p)
  1346. for (n in e = {},
  1347. h)
  1348. typeof (r = h[n]) == f ? e[r[0]] = u : e[r] = u;
  1349. for (t = i = 0; t < c.length; t++)
  1350. if (o = c[t].exec(this.getUA())) {
  1351. for (n = 0; n < h.length; n++)
  1352. a = o[++i],
  1353. 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;
  1354. break
  1355. }
  1356. if (o)
  1357. break
  1358. }
  1359. return e
  1360. },
  1361. str: function(e, t) {
  1362. for (var i in t)
  1363. if (typeof t[i] == f && 0 < t[i].length) {
  1364. for (var n = 0; n < t[i].length; n++)
  1365. if (g.has(t[i][n], e))
  1366. return "?" === i ? u : i
  1367. } else if (g.has(t[i], e))
  1368. return "?" === i ? u : i;
  1369. return e
  1370. }
  1371. }
  1372. , v = {
  1373. browser: {
  1374. oldsafari: {
  1375. major: {
  1376. 1: ["/8", "/1", "/3"],
  1377. 2: "/4",
  1378. "?": "/"
  1379. },
  1380. version: {
  1381. "1.0": "/8",
  1382. 1.2: "/1",
  1383. 1.3: "/3",
  1384. "2.0": "/412",
  1385. "2.0.2": "/416",
  1386. "2.0.3": "/417",
  1387. "2.0.4": "/419",
  1388. "?": "/"
  1389. }
  1390. }
  1391. },
  1392. device: {
  1393. sprint: {
  1394. model: {
  1395. "Evo Shift 4G": "7373KT"
  1396. },
  1397. vendor: {
  1398. HTC: "APA",
  1399. Sprint: "Sprint"
  1400. }
  1401. }
  1402. },
  1403. os: {
  1404. windows: {
  1405. version: {
  1406. ME: "4.90",
  1407. "NT 3.11": "NT3.51",
  1408. "NT 4.0": "NT4.0",
  1409. 2e3: "NT 5.0",
  1410. XP: ["NT 5.1", "NT 5.2"],
  1411. Vista: "NT 6.0",
  1412. 7: "NT 6.1",
  1413. 8: "NT 6.2",
  1414. 8.1: "NT 6.3",
  1415. RT: "ARM"
  1416. }
  1417. }
  1418. }
  1419. }
  1420. , y = {
  1421. 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]],
  1422. 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]],
  1423. 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]],
  1424. 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]],
  1425. 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]]
  1426. }
  1427. , A = function(e) {
  1428. var t = e || (i && i.navigator && i.navigator.userAgent ? i.navigator.userAgent : "");
  1429. return this instanceof A ? (this.getBrowser = function() {
  1430. return m.rgx.apply(this, y.browser)
  1431. }
  1432. ,
  1433. this.getCPU = function() {
  1434. return m.rgx.apply(this, y.cpu)
  1435. }
  1436. ,
  1437. this.getDevice = function() {
  1438. return m.rgx.apply(this, y.device)
  1439. }
  1440. ,
  1441. this.getEngine = function() {
  1442. return m.rgx.apply(this, y.engine)
  1443. }
  1444. ,
  1445. this.getOS = function() {
  1446. return m.rgx.apply(this, y.os)
  1447. }
  1448. ,
  1449. this.getResult = function() {
  1450. return {
  1451. ua: this.getUA(),
  1452. browser: this.getBrowser(),
  1453. engine: this.getEngine(),
  1454. os: this.getOS(),
  1455. device: this.getDevice(),
  1456. cpu: this.getCPU()
  1457. }
  1458. }
  1459. ,
  1460. this.getUA = function() {
  1461. return t
  1462. }
  1463. ,
  1464. this.setUA = function(e) {
  1465. return t = e,
  1466. this
  1467. }
  1468. ,
  1469. void this.setUA(t)) : new A(e).getResult()
  1470. };
  1471. if (typeof exports != p)
  1472. typeof module != p && module.exports && (exports = module.exports = A),
  1473. exports.UAParser = A;
  1474. else if (i.UAParser = A,
  1475. typeof define == d && define.amd && define(function() {
  1476. return A
  1477. }),
  1478. typeof i.jQuery != p) {
  1479. var C = i.jQuery
  1480. , I = new A;
  1481. C.ua = I.getResult(),
  1482. C.ua.get = function() {
  1483. return I.getUA()
  1484. }
  1485. ,
  1486. C.ua.set = function(e) {
  1487. I.setUA(e);
  1488. var t = I.getResult();
  1489. for (var i in t)
  1490. C.ua[i] = t[i]
  1491. }
  1492. }
  1493. }(this),
  1494. window.Modernizr = function(e, t) {
  1495. function i(e, t) {
  1496. return typeof e === t
  1497. }
  1498. var n, r, o, a = {}, s = t.documentElement, l = t.createElement("modernizr"), c = l.style, h = {}, u = [], d = u.slice, p = {}.hasOwnProperty;
  1499. for (var f in r = i(p, "undefined") || i(p.call, "undefined") ? function(e, t) {
  1500. return t in e && i(e.constructor.prototype[t], "undefined")
  1501. }
  1502. : function(e, t) {
  1503. return p.call(e, t)
  1504. }
  1505. ,
  1506. Function.prototype.bind || (Function.prototype.bind = function(n) {
  1507. var r = this;
  1508. if ("function" != typeof r)
  1509. throw new TypeError;
  1510. var o = d.call(arguments, 1)
  1511. , a = function() {
  1512. if (this instanceof a) {
  1513. function e() {}
  1514. e.prototype = r.prototype;
  1515. var t = new e
  1516. , i = r.apply(t, o.concat(d.call(arguments)));
  1517. return Object(i) === i ? i : t
  1518. }
  1519. return r.apply(n, o.concat(d.call(arguments)))
  1520. };
  1521. return a
  1522. }
  1523. ),
  1524. h.webgl = function() {
  1525. return !!e.WebGLRenderingContext
  1526. }
  1527. ,
  1528. h)
  1529. r(h, f) && (n = f.toLowerCase(),
  1530. a[n] = h[f](),
  1531. u.push((a[n] ? "" : "no-") + n));
  1532. return a.addTest = function(e, t) {
  1533. if ("object" == typeof e)
  1534. for (var i in e)
  1535. r(e, i) && a.addTest(i, e[i]);
  1536. else {
  1537. if (e = e.toLowerCase(),
  1538. void 0 !== a[e])
  1539. return a;
  1540. t = "function" == typeof t ? t() : t,
  1541. "undefined" != typeof enableClasses && enableClasses && (s.className += " " + (t ? "" : "no-") + e),
  1542. a[e] = t
  1543. }
  1544. return a
  1545. }
  1546. ,
  1547. o = "",
  1548. c.cssText = o,
  1549. l = null,
  1550. a._version = "2.8.2",
  1551. a
  1552. }(this, this.document),
  1553. function(xe, e, Se) {
  1554. "use strict";
  1555. function Me(s, e, n) {
  1556. function a(e) {
  1557. var t = Q.length;
  1558. if (G.old = xe.extend({}, G),
  1559. H = V ? 0 : k[F.horizontal ? "width" : "height"](),
  1560. Y = W[F.horizontal ? "width" : "height"](),
  1561. z = V ? s : U[F.horizontal ? "outerWidth" : "outerHeight"](),
  1562. Q.length = 0,
  1563. G.start = 0,
  1564. G.end = nt(z - H, 0),
  1565. le) {
  1566. $.length,
  1567. J = U.children(F.itemSelector),
  1568. $.length = 0;
  1569. 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;
  1570. z = 0,
  1571. J.each(function(e, t) {
  1572. var i = xe(t)
  1573. , n = t.getBoundingClientRect()
  1574. , r = it(F.horizontal ? n.width || n.right - n.left : n.height || n.bottom - n.top)
  1575. , o = Ne(i, F.horizontal ? "marginLeft" : "marginTop")
  1576. , a = Ne(i, F.horizontal ? "marginRight" : "marginBottom")
  1577. , s = r + o + a
  1578. , l = !o || !a
  1579. , c = {};
  1580. c.el = t,
  1581. c.size = l ? r : s,
  1582. c.half = c.size / 2,
  1583. c.start = z + (l ? o : 0),
  1584. c.center = c.start - it(H / 2 - c.size / 2),
  1585. c.end = c.start - H + c.size,
  1586. e || (z += u),
  1587. z += s,
  1588. F.horizontal || p || a && o && 0 < e && (z -= rt(o, a)),
  1589. e === g && (c.end += d,
  1590. z += d,
  1591. f = l ? a : 0),
  1592. $.push(c),
  1593. h = c
  1594. }),
  1595. U[0].style[F.horizontal ? "width" : "height"] = (i ? z : z - u - d) + "px",
  1596. z -= f,
  1597. $.length ? (G.start = $[0][ae ? "center" : "start"],
  1598. G.end = ae ? h.center : H < z ? h.end : G.start) : G.start = G.end = 0
  1599. }
  1600. if (G.center = it(G.end / 2 + G.start / 2),
  1601. v(),
  1602. j.length && 0 < Y && (F.dynamicHandle ? (q = Fe(q = G.start === G.end ? Y : it(Y * H / z), F.minHandleSize, Y),
  1603. j[0].style[F.horizontal ? "width" : "height"] = q + "px") : q = j[F.horizontal ? "outerWidth" : "outerHeight"](),
  1604. X.end = Y - q,
  1605. _e || c()),
  1606. !V && 0 < H) {
  1607. var n = G.start
  1608. , r = "";
  1609. if (le)
  1610. xe.each($, function(e, t) {
  1611. ae ? Q.push(t.center) : t.start + t.size > n && n <= G.end && (n = t.start,
  1612. Q.push(n),
  1613. (n += H) > G.end && n < G.end + H && Q.push(G.end))
  1614. });
  1615. else
  1616. for (; n - H < G.end; )
  1617. Q.push(n),
  1618. n += H;
  1619. if (Z[0] && t !== Q.length) {
  1620. for (var o = 0; o < Q.length; o++)
  1621. r += F.pageBuilder.call(B, o);
  1622. (K = Z.html(r).children()).eq(ee.activePage).addClass(F.activeClass)
  1623. }
  1624. }
  1625. if (ee.slideeSize = z,
  1626. ee.frameSize = H,
  1627. ee.sbSize = Y,
  1628. ee.handleSize = q,
  1629. le) {
  1630. e && null != F.startAt && (m(F.startAt),
  1631. B[se ? "toCenter" : "toStart"](F.startAt));
  1632. var a = $[ee.activeItem];
  1633. l(se && a ? a.center : Fe(G.dest, G.start, G.end))
  1634. } else
  1635. e ? null != F.startAt && l(F.startAt, 1) : l(Fe(G.dest, G.start, G.end));
  1636. L("load")
  1637. }
  1638. function l(e, t, i) {
  1639. if (le && Ie.released && !i) {
  1640. var n = d(e)
  1641. , r = e > G.start && e < G.end;
  1642. se ? (r && (e = $[n.centerItem].center),
  1643. ae && F.activateMiddle && m(n.centerItem)) : r && (e = $[n.firstItem].start)
  1644. }
  1645. 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),
  1646. Ae.start = +new Date,
  1647. Ae.time = 0,
  1648. Ae.from = G.cur,
  1649. Ae.to = e,
  1650. Ae.delta = e - G.cur,
  1651. Ae.tweesing = Ie.tweese || Ie.init && !Ie.slidee,
  1652. Ae.immediate = !Ae.tweesing && (t || Ie.init && Ie.slidee || !F.speed),
  1653. Ie.tweese = 0,
  1654. e !== G.dest && (G.dest = e,
  1655. L("change"),
  1656. _e || o()),
  1657. g(),
  1658. v(),
  1659. p(),
  1660. K[0] && ye.page !== ee.activePage && (ye.page = ee.activePage,
  1661. K.removeClass(F.activeClass).eq(ee.activePage).addClass(F.activeClass),
  1662. L("activePage", ye.page))
  1663. }
  1664. function o() {
  1665. if (B.initialized) {
  1666. if (!_e)
  1667. return _e = Ge(o),
  1668. void (Ie.released && L("moveStart"));
  1669. Ae.immediate ? G.cur = Ae.to : Ae.tweesing ? (Ae.tweeseDelta = Ae.to - G.cur,
  1670. $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),
  1671. G.cur = Ae.from + Ae.delta * xe.easing[F.easing](Ae.time / F.speed, Ae.time, 0, 1, F.speed)),
  1672. Ae.to === G.cur ? (G.cur = Ae.to,
  1673. Ie.tweese = _e = 0) : _e = Ge(o),
  1674. L("move"),
  1675. 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"),
  1676. !_e && Ie.released && L("moveEnd"),
  1677. c()
  1678. }
  1679. }
  1680. function c() {
  1681. 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,
  1682. X.cur = Fe(it(X.cur), X.start, X.end),
  1683. ye.hPos !== X.cur && (ye.hPos = X.cur,
  1684. Ve ? j[0].style[Ve] = ke + (F.horizontal ? "translateX" : "translateY") + "(" + X.cur + "px)" : j[0].style[F.horizontal ? "left" : "top"] = X.cur + "px"))
  1685. }
  1686. function t() {
  1687. Ce.speed && G.cur !== (0 < Ce.speed ? G.end : G.start) || B.stop(),
  1688. Te = Ie.init ? Ge(t) : 0,
  1689. Ce.now = +new Date,
  1690. Ce.pos = G.cur + (Ce.now - Ce.lastTime) / 1e3 * Ce.speed,
  1691. l(Ie.init ? Ce.pos : it(Ce.pos)),
  1692. Ie.init || G.cur !== G.dest || L("moveEnd"),
  1693. Ce.lastTime = Ce.now
  1694. }
  1695. function i(e, t, i) {
  1696. if ("boolean" === Re(t) && (i = t,
  1697. t = Se),
  1698. t === Se)
  1699. l(G[e], i);
  1700. else {
  1701. if (se && "center" !== e)
  1702. return;
  1703. var n = B.getPos(t);
  1704. n && l(n[e], i, !se)
  1705. }
  1706. }
  1707. function h(e) {
  1708. return null != e ? De(e) ? 0 <= e && e < $.length ? e : -1 : J.index(e) : -1
  1709. }
  1710. function u(e) {
  1711. return h(De(e) && e < 0 ? e + $.length : e)
  1712. }
  1713. function m(e, t) {
  1714. var i = h(e);
  1715. return !(!le || i < 0) && (ye.active === i && !t || (J.eq(ee.activeItem).removeClass(F.activeClass),
  1716. J.eq(i).addClass(F.activeClass),
  1717. ye.active = ee.activeItem = i,
  1718. p(),
  1719. L("active", i)),
  1720. i)
  1721. }
  1722. function d(e) {
  1723. e = Fe(De(e) ? e : G.dest, G.start, G.end);
  1724. var t = {}
  1725. , i = ae ? 0 : H / 2;
  1726. if (!V)
  1727. for (var n = 0, r = Q.length; n < r; n++) {
  1728. if (e >= G.end || n === Q.length - 1) {
  1729. t.activePage = Q.length - 1;
  1730. break
  1731. }
  1732. if (e <= Q[n] + i) {
  1733. t.activePage = n;
  1734. break
  1735. }
  1736. }
  1737. if (le) {
  1738. for (var o = !1, a = !1, s = !1, l = 0, c = $.length; l < c; l++)
  1739. if (!1 === o && e <= $[l].start + $[l].half && (o = l),
  1740. !1 === s && e <= $[l].center + $[l].half && (s = l),
  1741. l === c - 1 || e <= $[l].end + $[l].half) {
  1742. a = l;
  1743. break
  1744. }
  1745. t.firstItem = De(o) ? o : 0,
  1746. t.centerItem = De(s) ? s : t.firstItem,
  1747. t.lastItem = De(a) ? a : t.centerItem
  1748. }
  1749. return t
  1750. }
  1751. function v(e) {
  1752. xe.extend(ee, d(e))
  1753. }
  1754. function p() {
  1755. var e = G.dest <= G.start
  1756. , t = G.dest >= G.end
  1757. , i = (e ? 1 : 0) | (t ? 2 : 0);
  1758. if (ye.slideePosState !== i && (ye.slideePosState = i,
  1759. ge.is("button,input") && ge.prop("disabled", e),
  1760. me.is("button,input") && me.prop("disabled", t),
  1761. ge.add(de)[e ? "addClass" : "removeClass"](F.disabledClass),
  1762. me.add(ue)[t ? "addClass" : "removeClass"](F.disabledClass)),
  1763. ye.fwdbwdState !== i && Ie.released && (ye.fwdbwdState = i,
  1764. de.is("button,input") && de.prop("disabled", e),
  1765. ue.is("button,input") && ue.prop("disabled", t)),
  1766. le && null != ee.activeItem) {
  1767. var n = 0 === ee.activeItem
  1768. , r = ee.activeItem >= $.length - 1
  1769. , o = (n ? 1 : 0) | (r ? 2 : 0);
  1770. ye.itemsButtonState !== o && (ye.itemsButtonState = o,
  1771. pe.is("button,input") && pe.prop("disabled", n),
  1772. fe.is("button,input") && fe.prop("disabled", r),
  1773. pe[n ? "addClass" : "removeClass"](F.disabledClass),
  1774. fe[r ? "addClass" : "removeClass"](F.disabledClass))
  1775. }
  1776. }
  1777. function r(e, t, i) {
  1778. if (e = u(e),
  1779. t = u(t),
  1780. -1 < e && -1 < t && e !== t && (!i || t !== e - 1) && (i || t !== e + 1)) {
  1781. J.eq(e)[i ? "insertAfter" : "insertBefore"]($[t].el);
  1782. var n = e < t ? e : i ? t : t - 1
  1783. , r = t < e ? e : i ? t + 1 : t
  1784. , o = t < e;
  1785. 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)),
  1786. a()
  1787. }
  1788. }
  1789. function f(e, t) {
  1790. for (var i = 0, n = ve[e].length; i < n; i++)
  1791. if (ve[e][i] === t)
  1792. return i;
  1793. return -1
  1794. }
  1795. function g() {
  1796. Ie.released && !B.isPaused && B.resume()
  1797. }
  1798. function y(e) {
  1799. return it(Fe(e, X.start, X.end) / X.end * (G.end - G.start)) + G.start
  1800. }
  1801. function A() {
  1802. Ie.history[0] = Ie.history[1],
  1803. Ie.history[1] = Ie.history[2],
  1804. Ie.history[2] = Ie.history[3],
  1805. Ie.history[3] = Ie.delta
  1806. }
  1807. function C(e) {
  1808. Ie.released = 0,
  1809. Ie.source = e,
  1810. Ie.slidee = "slidee" === e
  1811. }
  1812. function I(e) {
  1813. var t = "touchstart" === e.type
  1814. , i = e.data.source
  1815. , n = "slidee" === i;
  1816. 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),
  1817. C(i),
  1818. Ie.init = 0,
  1819. Ie.$source = xe(e.target),
  1820. Ie.touch = t,
  1821. Ie.pointer = t ? e.originalEvent.touches[0] : e,
  1822. Ie.initX = Ie.pointer.pageX,
  1823. Ie.initY = Ie.pointer.pageY,
  1824. Ie.initPos = n ? G.cur : X.cur,
  1825. Ie.start = +new Date,
  1826. Ie.time = 0,
  1827. Ie.path = 0,
  1828. Ie.delta = 0,
  1829. Ie.locked = 0,
  1830. Ie.history = [0, 0, 0, 0],
  1831. Ie.pathToLock = n ? t ? 30 : 10 : 0,
  1832. We.on(t ? qe : Ye, E),
  1833. B.pause(1),
  1834. (n ? U : j).addClass(F.draggedClass),
  1835. L("moveStart"),
  1836. n && (be = setInterval(A, 10)))
  1837. }
  1838. function E(e) {
  1839. if (Ie.released = "mouseup" === e.type || "touchend" === e.type,
  1840. Ie.pointer = Ie.touch ? e.originalEvent[Ie.released ? "changedTouches" : "touches"][0] : e,
  1841. Ie.pathX = Ie.pointer.pageX - Ie.initX,
  1842. Ie.pathY = Ie.pointer.pageY - Ie.initY,
  1843. Ie.path = et(tt(Ie.pathX, 2) + tt(Ie.pathY, 2)),
  1844. Ie.delta = F.horizontal ? Ie.pathX : Ie.pathY,
  1845. Ie.released || !(Ie.path < 1)) {
  1846. if (!Ie.init) {
  1847. if (!(F.horizontal ? $e(Ie.pathX) > $e(Ie.pathY) : $e(Ie.pathX) < $e(Ie.pathY)))
  1848. return _();
  1849. Ie.init = 1
  1850. }
  1851. Pe(e),
  1852. !Ie.locked && Ie.path > Ie.pathToLock && Ie.slidee && (Ie.locked = 1,
  1853. Ie.$source.on(Ze, Oe)),
  1854. Ie.released && (_(),
  1855. F.releaseSwing && Ie.slidee && (Ie.swing = (Ie.delta - Ie.history[0]) / 40 * 300,
  1856. Ie.delta += Ie.swing,
  1857. Ie.tweese = 10 < $e(Ie.swing))),
  1858. l(Ie.slidee ? it(Ie.initPos - Ie.delta) : y(Ie.initPos + Ie.delta))
  1859. }
  1860. }
  1861. function _() {
  1862. clearInterval(be),
  1863. Ie.released = !0,
  1864. We.off(Ie.touch ? qe : Ye, E),
  1865. (Ie.slidee ? U : j).removeClass(F.draggedClass),
  1866. setTimeout(function() {
  1867. Ie.$source.off(Ze, Oe)
  1868. }),
  1869. G.cur === G.dest && Ie.init && L("moveEnd"),
  1870. B.resume(1),
  1871. Ie.init = 0
  1872. }
  1873. function b(e) {
  1874. return ~xe.inArray(e.nodeName, Qe) || xe(e).is(F.interactive)
  1875. }
  1876. function w() {
  1877. B.stop(),
  1878. We.off("mouseup", w)
  1879. }
  1880. function T(e) {
  1881. switch (Pe(e),
  1882. this) {
  1883. case ue[0]:
  1884. case de[0]:
  1885. B.moveBy(ue.is(this) ? F.moveBy : -F.moveBy),
  1886. We.on("mouseup", w);
  1887. break;
  1888. case pe[0]:
  1889. B.prev();
  1890. break;
  1891. case fe[0]:
  1892. B.next();
  1893. break;
  1894. case ge[0]:
  1895. B.prevPage();
  1896. break;
  1897. case me[0]:
  1898. B.nextPage()
  1899. }
  1900. }
  1901. function x(e) {
  1902. e.originalEvent[He] = B;
  1903. var t = +new Date;
  1904. if (ot + F.scrollHijack > t && ce[0] !== document && ce[0] !== window)
  1905. ot = t;
  1906. else if (F.scrollBy && G.start !== G.end) {
  1907. var i = function(e) {
  1908. return Ee.curDelta = (F.horizontal ? e.deltaY || e.deltaX : e.deltaY) || -e.wheelDelta,
  1909. Ee.curDelta /= 1 === e.deltaMode ? 3 : 100,
  1910. le ? (Ue = +new Date,
  1911. Ee.last < Ue - Ee.resetTime && (Ee.delta = 0),
  1912. Ee.last = Ue,
  1913. Ee.delta += Ee.curDelta,
  1914. $e(Ee.delta) < 1 ? Ee.finalDelta = 0 : (Ee.finalDelta = it(Ee.delta / 1),
  1915. Ee.delta %= 1),
  1916. Ee.finalDelta) : Ee.curDelta
  1917. }(e.originalEvent);
  1918. (F.scrollTrap || 0 < i && G.dest < G.end || i < 0 && G.dest > G.start) && Pe(e, 1),
  1919. B.slideBy(F.scrollBy * i)
  1920. }
  1921. }
  1922. function S(e) {
  1923. F.clickBar && e.target === W[0] && (Pe(e),
  1924. l(y((F.horizontal ? e.pageX - W.offset().left : e.pageY - W.offset().top) - q / 2)))
  1925. }
  1926. function M(e) {
  1927. if (F.keyboardNavBy)
  1928. switch (e.which) {
  1929. case F.horizontal ? 37 : 38:
  1930. Pe(e),
  1931. B["pages" === F.keyboardNavBy ? "prevPage" : "prev"]();
  1932. break;
  1933. case F.horizontal ? 39 : 40:
  1934. Pe(e),
  1935. B["pages" === F.keyboardNavBy ? "nextPage" : "next"]()
  1936. }
  1937. }
  1938. function R(e) {
  1939. return b(this) ? void (e.originalEvent[He + "ignore"] = !0) : void (this.parentNode !== U[0] || e.originalEvent[He + "ignore"] || B.activate(this))
  1940. }
  1941. function P() {
  1942. this.parentNode === Z[0] && B.activatePage(K.index(this))
  1943. }
  1944. function O(e) {
  1945. F.pauseOnHover && B["mouseenter" === e.type ? "pause" : "resume"](2)
  1946. }
  1947. function L(e, t) {
  1948. if (ve[e]) {
  1949. for (N = ve[e].length,
  1950. Je.length = 0,
  1951. D = 0; D < N; D++)
  1952. Je.push(ve[e][D]);
  1953. for (D = 0; D < N; D++)
  1954. Je[D].call(B, e, t)
  1955. }
  1956. }
  1957. 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 = {
  1958. start: 0,
  1959. center: 0,
  1960. end: 0,
  1961. cur: 0,
  1962. dest: 0
  1963. }, W = xe(F.scrollBar).eq(0), j = W.children().eq(0), Y = 0, q = 0, X = {
  1964. start: 0,
  1965. end: 0,
  1966. cur: 0
  1967. }, Z = xe(F.pagesBar), K = 0, Q = [], J = 0, $ = [], ee = {
  1968. firstItem: 0,
  1969. lastItem: 0,
  1970. centerItem: 0,
  1971. activeItem: null,
  1972. activePage: 0
  1973. }, 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 = {
  1974. released: 1
  1975. }, Ee = {
  1976. last: 0,
  1977. delta: 0,
  1978. resetTime: 200
  1979. }, _e = 0, be = 0, we = 0, Te = 0;
  1980. V || (s = k[0]),
  1981. B.initialized = 0,
  1982. B.frame = s,
  1983. B.slidee = U[0],
  1984. B.pos = G,
  1985. B.rel = ee,
  1986. B.items = $,
  1987. B.pages = Q,
  1988. B.isPaused = 0,
  1989. B.options = F,
  1990. B.dragging = Ie,
  1991. B.reload = function() {
  1992. a()
  1993. }
  1994. ,
  1995. B.getPos = function(e) {
  1996. if (le) {
  1997. var t = h(e);
  1998. return -1 !== t && $[t]
  1999. }
  2000. var i = U.find(e).eq(0);
  2001. if (i[0]) {
  2002. var n = F.horizontal ? i.offset().left - U.offset().left : i.offset().top - U.offset().top
  2003. , r = i[F.horizontal ? "outerWidth" : "outerHeight"]();
  2004. return {
  2005. start: n,
  2006. center: n - H / 2 + r / 2,
  2007. end: n - H + r,
  2008. size: r
  2009. }
  2010. }
  2011. return !1
  2012. }
  2013. ,
  2014. B.moveBy = function(e) {
  2015. Ce.speed = e,
  2016. !Ie.init && Ce.speed && G.cur !== (0 < Ce.speed ? G.end : G.start) && (Ce.lastTime = +new Date,
  2017. Ce.startPos = G.cur,
  2018. C("button"),
  2019. Ie.init = 1,
  2020. L("moveStart"),
  2021. ze(Te),
  2022. t())
  2023. }
  2024. ,
  2025. B.stop = function() {
  2026. "button" === Ie.source && (Ie.init = 0,
  2027. Ie.released = 1)
  2028. }
  2029. ,
  2030. B.prev = function() {
  2031. B.activate(null == ee.activeItem ? 0 : ee.activeItem - 1)
  2032. }
  2033. ,
  2034. B.next = function() {
  2035. B.activate(null == ee.activeItem ? 0 : ee.activeItem + 1)
  2036. }
  2037. ,
  2038. B.prevPage = function() {
  2039. B.activatePage(ee.activePage - 1)
  2040. }
  2041. ,
  2042. B.nextPage = function() {
  2043. B.activatePage(ee.activePage + 1)
  2044. }
  2045. ,
  2046. B.slideBy = function(e, t) {
  2047. e && (le ? B[se ? "toCenter" : "toStart"](Fe((se ? ee.centerItem : ee.firstItem) + F.scrollBy * e, 0, $.length)) : l(G.dest + e, t))
  2048. }
  2049. ,
  2050. B.slideTo = function(e, t) {
  2051. l(e, t)
  2052. }
  2053. ,
  2054. B.toStart = function(e, t) {
  2055. i("start", e, t)
  2056. }
  2057. ,
  2058. B.toEnd = function(e, t) {
  2059. i("end", e, t)
  2060. }
  2061. ,
  2062. B.toCenter = function(e, t) {
  2063. i("center", e, t)
  2064. }
  2065. ,
  2066. B.getIndex = h,
  2067. B.activate = function(e, t) {
  2068. var i = m(e);
  2069. F.smart && !1 !== i && (se ? B.toCenter(i, t) : i >= ee.lastItem ? B.toStart(i, t) : i <= ee.firstItem ? B.toEnd(i, t) : g())
  2070. }
  2071. ,
  2072. B.activatePage = function(e, t) {
  2073. De(e) && l(Q[Fe(e, 0, Q.length - 1)], t)
  2074. }
  2075. ,
  2076. B.resume = function(e) {
  2077. F.cycleBy && F.cycleInterval && ("items" !== F.cycleBy || $[0] && null != ee.activeItem) && !(e < B.isPaused) && (B.isPaused = 0,
  2078. we ? we = clearTimeout(we) : L("resume"),
  2079. we = setTimeout(function() {
  2080. switch (L("cycle"),
  2081. F.cycleBy) {
  2082. case "items":
  2083. B.activate(ee.activeItem >= $.length - 1 ? 0 : ee.activeItem + 1);
  2084. break;
  2085. case "pages":
  2086. B.activatePage(ee.activePage >= Q.length - 1 ? 0 : ee.activePage + 1)
  2087. }
  2088. }, F.cycleInterval))
  2089. }
  2090. ,
  2091. B.pause = function(e) {
  2092. e < B.isPaused || (B.isPaused = e || 100,
  2093. we && (we = clearTimeout(we),
  2094. L("pause")))
  2095. }
  2096. ,
  2097. B.toggle = function() {
  2098. B[we ? "pause" : "resume"]()
  2099. }
  2100. ,
  2101. B.set = function(e, t) {
  2102. xe.isPlainObject(e) ? xe.extend(F, e) : F.hasOwnProperty(e) && (F[e] = t)
  2103. }
  2104. ,
  2105. B.add = function(e, t) {
  2106. var i = xe(e);
  2107. le ? (null == t || !$[0] || t >= $.length ? i.appendTo(U) : $.length && i.insertBefore($[t].el),
  2108. null != ee.activeItem && t <= ee.activeItem && (ye.active = ee.activeItem += i.length)) : U.append(i),
  2109. a()
  2110. }
  2111. ,
  2112. B.remove = function(e) {
  2113. if (le) {
  2114. var t = u(e);
  2115. if (-1 < t) {
  2116. J.eq(t).remove();
  2117. var i = t === ee.activeItem;
  2118. null != ee.activeItem && t < ee.activeItem && (ye.active = --ee.activeItem),
  2119. a(),
  2120. i && (ye.active = null,
  2121. B.activate(ee.activeItem))
  2122. }
  2123. } else
  2124. xe(e).remove(),
  2125. a()
  2126. }
  2127. ,
  2128. B.moveAfter = function(e, t) {
  2129. r(e, t, 1)
  2130. }
  2131. ,
  2132. B.moveBefore = function(e, t) {
  2133. r(e, t)
  2134. }
  2135. ,
  2136. B.on = function(e, t) {
  2137. if ("object" === Re(e))
  2138. for (var i in e)
  2139. e.hasOwnProperty(i) && B.on(i, e[i]);
  2140. else if ("function" === Re(t))
  2141. for (var n = e.split(" "), r = 0, o = n.length; r < o; r++)
  2142. ve[n[r]] = ve[n[r]] || [],
  2143. -1 === f(n[r], t) && ve[n[r]].push(t);
  2144. else if ("array" === Re(t))
  2145. for (var a = 0, s = t.length; a < s; a++)
  2146. B.on(e, t[a])
  2147. }
  2148. ,
  2149. B.one = function(t, i) {
  2150. B.on(t, function e() {
  2151. i.apply(B, arguments),
  2152. B.off(t, e)
  2153. })
  2154. }
  2155. ,
  2156. B.off = function(e, t) {
  2157. if (t instanceof Array)
  2158. for (var i = 0, n = t.length; i < n; i++)
  2159. B.off(e, t[i]);
  2160. else
  2161. for (var r = e.split(" "), o = 0, a = r.length; o < a; o++)
  2162. if (ve[r[o]] = ve[r[o]] || [],
  2163. null == t)
  2164. ve[r[o]].length = 0;
  2165. else {
  2166. var s = f(r[o], t);
  2167. -1 !== s && ve[r[o]].splice(s, 1)
  2168. }
  2169. }
  2170. ,
  2171. B.destroy = function() {
  2172. return ce.add(j).add(W).add(Z).add(ue).add(de).add(pe).add(fe).add(ge).add(me).off("." + He),
  2173. We.off("keydown", M),
  2174. pe.add(fe).add(ge).add(me).removeClass(F.disabledClass),
  2175. J && null != ee.activeItem && J.eq(ee.activeItem).removeClass(F.activeClass),
  2176. Z.empty(),
  2177. V || (k.off("." + He),
  2178. te.restore(),
  2179. ie.restore(),
  2180. ne.restore(),
  2181. re.restore(),
  2182. xe.removeData(s, He)),
  2183. $.length = Q.length = 0,
  2184. ye = {},
  2185. B.initialized = 0,
  2186. B
  2187. }
  2188. ,
  2189. B.init = function() {
  2190. if (!B.initialized) {
  2191. B.on(n);
  2192. var e = ["overflow", "position"]
  2193. , t = ["position", "webkitTransform", "msTransform", "transform", "left", "top", "width", "height"];
  2194. te.save.apply(te, e),
  2195. ne.save.apply(ne, e),
  2196. ie.save.apply(ie, t),
  2197. re.save.apply(re, t);
  2198. var i = j;
  2199. return V || (i = i.add(U),
  2200. k.css("overflow", "hidden"),
  2201. Ve || "static" !== k.css("position") || k.css("position", "relative")),
  2202. Ve ? ke && i.css(Ve, ke) : ("static" === W.css("position") && W.css("position", "relative"),
  2203. i.css({
  2204. position: "absolute"
  2205. })),
  2206. F.forward && ue.on(Ke, T),
  2207. F.backward && de.on(Ke, T),
  2208. F.prev && pe.on(Ze, T),
  2209. F.next && fe.on(Ze, T),
  2210. F.prevPage && ge.on(Ze, T),
  2211. F.nextPage && me.on(Ze, T),
  2212. ce.on(Xe, x),
  2213. W[0] && W.on(Ze, S),
  2214. le && F.activateOn && k.on(F.activateOn + "." + He, "*", R),
  2215. Z[0] && F.activatePageOn && Z.on(F.activatePageOn + "." + He, "*", P),
  2216. he.on(je, {
  2217. source: "slidee"
  2218. }, I),
  2219. j && j.on(je, {
  2220. source: "handle"
  2221. }, I),
  2222. We.on("keydown", M),
  2223. V || (k.on("mouseenter." + He + " mouseleave." + He, O),
  2224. k.on("scroll." + He, Le)),
  2225. B.initialized = 1,
  2226. a(!0),
  2227. F.cycleBy && !V && B[F.startPaused ? "pause" : "resume"](),
  2228. B
  2229. }
  2230. }
  2231. }
  2232. function Re(e) {
  2233. 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
  2234. }
  2235. function Pe(e, t) {
  2236. e.preventDefault(),
  2237. t && e.stopPropagation()
  2238. }
  2239. function Oe(e) {
  2240. Pe(e, 1),
  2241. xe(this).off(e.type, Oe)
  2242. }
  2243. function Le() {
  2244. this.scrollLeft = 0,
  2245. this.scrollTop = 0
  2246. }
  2247. function De(e) {
  2248. return !isNaN(parseFloat(e)) && isFinite(e)
  2249. }
  2250. function Ne(e, t) {
  2251. return 0 | it(String(e.css(t)).replace(/[^\-0-9.]/g, ""))
  2252. }
  2253. function Fe(e, t, i) {
  2254. return e < t ? t : i < e ? i : e
  2255. }
  2256. function Be(t) {
  2257. var i = {
  2258. style: {},
  2259. save: function() {
  2260. if (t && t.nodeType) {
  2261. for (var e = 0; e < arguments.length; e++)
  2262. i.style[arguments[e]] = t.style[arguments[e]];
  2263. return i
  2264. }
  2265. },
  2266. restore: function() {
  2267. if (t && t.nodeType) {
  2268. for (var e in i.style)
  2269. i.style.hasOwnProperty(e) && (t.style[e] = i.style[e]);
  2270. return i
  2271. }
  2272. }
  2273. };
  2274. return i
  2275. }
  2276. 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;
  2277. function t(e) {
  2278. for (var t = 0, i = r.length; t < i; t++) {
  2279. var n = r[t] ? r[t] + e.charAt(0).toUpperCase() + e.slice(1) : e;
  2280. if (null != o.style[n])
  2281. return n
  2282. }
  2283. }
  2284. We.on(Xe, function(e) {
  2285. var t = e.originalEvent[He]
  2286. , i = +new Date;
  2287. (!t || t.options.scrollHijack < i - ot) && (ot = i)
  2288. }),
  2289. function(t) {
  2290. Ge = t.requestAnimationFrame || t.webkitRequestAnimationFrame || function(e) {
  2291. var t = (new Date).getTime()
  2292. , i = Math.max(0, 16 - (t - r))
  2293. , n = setTimeout(e, i);
  2294. return r = t,
  2295. n
  2296. }
  2297. ;
  2298. var r = (new Date).getTime()
  2299. , i = t.cancelAnimationFrame || t.webkitCancelAnimationFrame || t.clearTimeout;
  2300. ze = function(e) {
  2301. i.call(t, e)
  2302. }
  2303. }(window),
  2304. r = ["", "webkit", "moz", "ms", "o"],
  2305. o = document.createElement("div"),
  2306. Ve = t("transform"),
  2307. ke = t("perspective") ? "translateZ(0) " : "",
  2308. e.Sly = Me,
  2309. xe.fn.sly = function(n, r) {
  2310. var o, a;
  2311. return xe.isPlainObject(n) || ("string" !== Re(n) && !1 !== n || (o = !1 === n ? "destroy" : n,
  2312. a = Array.prototype.slice.call(arguments, 1)),
  2313. n = {}),
  2314. this.each(function(e, t) {
  2315. var i = xe.data(t, He);
  2316. i || o ? i && o && i[o] && i[o].apply(i, a) : i = xe.data(t, He, new Me(t,n,r).init())
  2317. })
  2318. }
  2319. ,
  2320. Me.defaults = {
  2321. slidee: null,
  2322. horizontal: !1,
  2323. itemNav: null,
  2324. itemSelector: null,
  2325. smart: !1,
  2326. activateOn: null,
  2327. activateMiddle: !1,
  2328. scrollSource: null,
  2329. scrollBy: 0,
  2330. scrollHijack: 300,
  2331. scrollTrap: !1,
  2332. dragSource: null,
  2333. mouseDragging: !1,
  2334. touchDragging: !1,
  2335. releaseSwing: !1,
  2336. swingSpeed: .2,
  2337. elasticBounds: !1,
  2338. interactive: null,
  2339. scrollBar: null,
  2340. dragHandle: !1,
  2341. dynamicHandle: !1,
  2342. minHandleSize: 50,
  2343. clickBar: !1,
  2344. syncSpeed: .5,
  2345. pagesBar: null,
  2346. activatePageOn: null,
  2347. pageBuilder: function(e) {
  2348. return "<li>" + (e + 1) + "</li>"
  2349. },
  2350. forward: null,
  2351. backward: null,
  2352. prev: null,
  2353. next: null,
  2354. prevPage: null,
  2355. nextPage: null,
  2356. cycleBy: null,
  2357. cycleInterval: 5e3,
  2358. pauseOnHover: !1,
  2359. startPaused: !1,
  2360. moveBy: 300,
  2361. speed: 0,
  2362. easing: "swing",
  2363. startAt: null,
  2364. keyboardNavBy: null,
  2365. draggedClass: "dragged",
  2366. activeClass: "active",
  2367. disabledClass: "disabled"
  2368. }
  2369. }(jQuery, window),
  2370. function o(a, s, l) {
  2371. function c(i, e) {
  2372. if (!s[i]) {
  2373. if (!a[i]) {
  2374. var t = "function" == typeof require && require;
  2375. if (!e && t)
  2376. return t(i, !0);
  2377. if (h)
  2378. return h(i, !0);
  2379. var n = new Error("Cannot find module '" + i + "'");
  2380. throw n.code = "MODULE_NOT_FOUND",
  2381. n
  2382. }
  2383. var r = s[i] = {
  2384. exports: {}
  2385. };
  2386. a[i][0].call(r.exports, function(e) {
  2387. var t = a[i][1][e];
  2388. return c(t || e)
  2389. }, r, r.exports, o, a, s, l)
  2390. }
  2391. return s[i].exports
  2392. }
  2393. for (var h = "function" == typeof require && require, e = 0; e < l.length; e++)
  2394. c(l[e]);
  2395. return c
  2396. }({
  2397. 1: [function(p, f, e) {
  2398. (function(e) {
  2399. "use strict";
  2400. function t(e) {
  2401. this.player = null,
  2402. this.director = null,
  2403. this.modelManager = null,
  2404. this.container = null,
  2405. this.tagManager = null,
  2406. this.fadeInSpeed = e,
  2407. null !== this.fadeInSpeed && void 0 !== this.fadeInSpeed || (this.fadeInSpeed = 0)
  2408. }
  2409. var r = p("three")
  2410. , i = p("./util/logger")
  2411. , n = (p("./util/common"),
  2412. p("./enum/PlayerEvents"))
  2413. , o = p("./enum/DirectorEvents")
  2414. , a = p("./settings")
  2415. , s = p("./enum/Viewmode")
  2416. , l = (p("./enum/WarpStyle"),
  2417. p("./enum/BlackoutStyle"),
  2418. p("./enum/ModelManagerEvents"))
  2419. , c = p("./enum/tagEvents")
  2420. , h = p("./util/transitions")
  2421. , u = p("./util/lerp")
  2422. , d = new i(e);
  2423. window.THREE = r,
  2424. t.prototype.init = function(e, t, i, n, r) {
  2425. (window.app = this).player = t,
  2426. this.director = e,
  2427. this.modelManager = i,
  2428. this.tagManager = n,
  2429. this.container = r,
  2430. this.updateModel(),
  2431. this.bindEvents()
  2432. }
  2433. ,
  2434. t.prototype.bindEvents = function() {
  2435. this.modelManager.on(l.ActiveModelChanged, this.updateModel.bind(this)),
  2436. this.player.on(n.ModeChanging, this.handlePlayerModeChanging.bind(this)),
  2437. this.player.on(n.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  2438. this.player.on(n.ClosestPanoChanging, this.handleClosestPanoChanging.bind(this)),
  2439. this.player.on(n.StartInside, this.handleStartInside.bind(this)),
  2440. this.player.on(n.StartOutside, this.handleStartOutside.bind(this)),
  2441. this.player.on(n.WarpStarted, this.handleWarpStarted.bind(this)),
  2442. this.director.on(o.ActionInterrupted, this.handleActionInterruption.bind(this)),
  2443. this.tagManager.on(c.TagActivated, this.ontagActivated.bind(this)),
  2444. this.tagManager.on(c.TagNavigation, this.onNavigationTotag.bind(this))
  2445. }
  2446. ,
  2447. t.prototype.updateModel = function() {
  2448. this.model = this.modelManager.getActiveModel()
  2449. }
  2450. ,
  2451. t.prototype.handleWarpStarted = function() {
  2452. this.hidePlayerReticule()
  2453. }
  2454. ,
  2455. t.prototype.ontagActivated = function() {
  2456. this.hidePlayerReticule()
  2457. }
  2458. ,
  2459. t.prototype.onNavigationTotag = function() {
  2460. this.hidePlayerReticule()
  2461. }
  2462. ,
  2463. t.prototype.handlePlayerModeChanging = function(e, t, i) {
  2464. var n = this.modelManager.getActiveModel()
  2465. , r = this.player.is360View(t, i) || this.director.tourIsPlaying ? 0 : a[t].markerOpacity;
  2466. n.fadePanoMarkers(r),
  2467. n.setMode(t)
  2468. }
  2469. ,
  2470. t.prototype.handlePlayerModeChanged = function(e, t) {
  2471. var i = this.modelManager.getActiveModel()
  2472. , n = t === s.PANORAMA ? r.DoubleSide : r.FrontSide;
  2473. i.setSide(n),
  2474. i.setMode(t)
  2475. }
  2476. ,
  2477. t.prototype.handleClosestPanoChanging = function(e, t, i) {
  2478. i !== s.TRANSITIONING && (e && !this.director.tourIsPlaying && e.hoverOff(i),
  2479. t && !this.director.tourIsPlaying && t.hoverOn(i))
  2480. }
  2481. ,
  2482. t.prototype.handleActionInterruption = function() {}
  2483. ,
  2484. t.prototype.handleStartInside = function(e) {
  2485. var t = a[this.player.mode]
  2486. , i = e ? 0 : t.transitionTime * t.skyboxOpacityLength;
  2487. this.fadeIn(this.fadeInSpeed),
  2488. this.model.alpha = 0,
  2489. this.model.skybox.material.uniforms.opacity.value = 1,
  2490. this.model.fadePanoMarkers(e ? 0 : t.markerOpacity);
  2491. var n = this.player.reticule;
  2492. h.start(u.property(n.material, "opacity", 0), i, null, 0, null, "retReOpac")
  2493. }
  2494. ,
  2495. t.prototype.handleStartOutside = function(e) {
  2496. this.fadeIn(e)
  2497. }
  2498. ,
  2499. t.prototype.fadeIn = function(e) {
  2500. null != e || (e = 2e3,
  2501. d.warn("DisplayController.fadeIn -> no transition time specified, defaulting to 2000 ms.")),
  2502. $(this.container).fadeIn(e)
  2503. }
  2504. ,
  2505. t.prototype.hidePlayerReticule = function() {
  2506. this.player.reticule.hide()
  2507. }
  2508. ,
  2509. f.exports = t
  2510. }
  2511. ).call(this, "/js/DisplayController.js")
  2512. }
  2513. , {
  2514. "./enum/BlackoutStyle": 18,
  2515. "./enum/DirectorEvents": 23,
  2516. "./enum/tagEvents": 32,
  2517. "./enum/ModelManagerEvents": 33,
  2518. "./enum/PlayerEvents": 40,
  2519. "./enum/Viewmode": 51,
  2520. "./enum/WarpStyle": 52,
  2521. "./settings": 166,
  2522. "./util/common": 185,
  2523. "./util/lerp": 188,
  2524. "./util/logger": 189,
  2525. "./util/transitions": 195,
  2526. three: 217
  2527. }],
  2528. 2: [function(e, t, i) {
  2529. "use strict";
  2530. function n() {
  2531. this.baseStartTime = performance.timing.navigationStart,
  2532. this.loadingStartTime = null,
  2533. this.waitingStartTime = null,
  2534. this.appReadyTime = null
  2535. }
  2536. n.prototype.setBaseStartTime = function(e) {
  2537. this.baseStartTime = e || Date.now()
  2538. }
  2539. ,
  2540. n.prototype.setWaitingStartTime = function(e) {
  2541. this.waitingStartTime = e || Date.now()
  2542. }
  2543. ,
  2544. n.prototype.setLoadingStartTime = function(e) {
  2545. this.loadingStartTime = e || Date.now()
  2546. }
  2547. ,
  2548. n.prototype.setAppReadyTime = function(e) {
  2549. this.appReadyTime = e || Date.now()
  2550. }
  2551. ,
  2552. n.prototype.calcFullLoadingTime = function() {
  2553. var e = this.appReadyTime - this.baseStartTime;
  2554. return this.waitingStartTime && (e -= this.loadingStartTime - this.waitingStartTime),
  2555. e
  2556. }
  2557. ,
  2558. t.exports = n
  2559. }
  2560. , {}],
  2561. 3: [function(i, n, e) {
  2562. (function(e) {
  2563. "use strict";
  2564. function a() {
  2565. return 100 * Math.random()
  2566. }
  2567. var t = i("./util/logger")
  2568. , s = i("./util/browser")
  2569. , l = new t(e)
  2570. , c = window.MP_AB_TESTS = window.MP_AB_TESTS || {
  2571. initialized: !1,
  2572. init: function(e, t) {
  2573. if (t = t || {},
  2574. !this.initialized) {
  2575. for (var i in this.initialized = !0,
  2576. s.valueFromHash("tilegen") && (t.tilegen = 1 === s.valueFromHash("tilegen", 0)),
  2577. s.valueFromHash("imgopt") && (t.imgopt = 1 === s.valueFromHash("imgopt", 0)),
  2578. e) {
  2579. var n = i.match("^sc_tilegen_([0-9]+)$");
  2580. n && (c.tilegen = a() < parseInt(n[1]));
  2581. var r = i.match("^sc_imgopt_([0-9]+)$");
  2582. r && (c.imgopt = a() < parseInt(r[1]))
  2583. }
  2584. for (var o in t)
  2585. c[o] = t[o],
  2586. l.debug("A/B override:", o, c[o])
  2587. }
  2588. },
  2589. changeIfTileGenerating: function(e) {
  2590. return c.tilegen && (e += -1 === e.indexOf("?") ? "?" : "&",
  2591. e += ""),
  2592. e
  2593. },
  2594. changeIfImageOptimzing: function(e) {
  2595. if(e.includes("blob:http"))return e;//add
  2596. return c.imgopt && -1 === e.indexOf("imgopt=1") && (e += -1 === e.indexOf("?") ? "?" : "&",
  2597. e += ""),
  2598. e
  2599. },
  2600. tilegen: !1,
  2601. imgopt: !1
  2602. };
  2603. n.exports = c
  2604. }
  2605. ).call(this, "/js/ab.js")
  2606. }
  2607. , {
  2608. "./util/browser": 182,
  2609. "./util/logger": 189
  2610. }],
  2611. 4: [function(u, d, e) {
  2612. (function(e) {
  2613. "use strict";
  2614. function r(n, e, t, i) {
  2615. function r(e) {
  2616. a[e.sid] = !0;
  2617. var t = e.billboard.media && e.billboard.media.type
  2618. , i = {
  2619. tag_id: e.sid,
  2620. tags_visited: Object.keys(a).length,
  2621. tag_count: Object.keys(n.tags).length,
  2622. tag_view_count: ++d,
  2623. has_media: !!t
  2624. };
  2625. t && (i.media_type = t),
  2626. g("tag_opened", i)
  2627. }
  2628. var o, a = {}, s = Date.now() - P, l = null;
  2629. i && (l = Date.now() - window.navigationStart);
  2630. try {
  2631. o = /* n.data.player_options.highlight_reel && */ 0 < n.heroLocations.length
  2632. } catch (n) {
  2633. o = !1
  2634. }
  2635. var c, h = n.supportsVR;
  2636. h || (c = "VR disabled at the model/account level",
  2637. 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"))),
  2638. g("model_loaded", {
  2639. duration: s,
  2640. duration_from_navigation_start: l,
  2641. has_hlr: o,
  2642. has_vr: h,
  2643. vr_reason: c
  2644. });
  2645. var u = 0;
  2646. n.panos.forEach(function(e) {
  2647. e.on("enter", function() {
  2648. f("pano_viewed", {
  2649. pano_id: e.id,
  2650. pano_view_count: ++u,
  2651. alignment_type: e.alignmentType,
  2652. interaction_source: R,
  2653. navigation_source: v
  2654. })
  2655. })
  2656. });
  2657. var d = 0;
  2658. for (var p in n.tags)
  2659. n.tags[p].billboard.on(M.OPENED, r.bind(this, n.tags[p]));
  2660. e.on("tour_auto", function(e) {
  2661. v = "tour_" + e
  2662. }),
  2663. e.on("tour_manual", function(e) {
  2664. R = "gui-" + e,
  2665. v = "tour_manual"
  2666. }),
  2667. t.on(C.InteractionKey, function() {
  2668. e.mode === A.TRANSITIONING || e.flying || m(C.InteractionKey)
  2669. }),
  2670. t.on(C.InteractionDirect, function() {
  2671. e.mode === A.TRANSITIONING || e.flying || m(C.InteractionDirect)
  2672. }),
  2673. function(t) {
  2674. I.on(T.OPENED, function() {
  2675. f("showcase_share_intent", {
  2676. pano_id: t.currentPano && t.currentPano.id
  2677. })
  2678. }),
  2679. I.on(T.LINK_CLICKED, function(e) {
  2680. f("showcase_share_action", {
  2681. channel: e.channel,
  2682. pano_id: t.currentPano && t.currentPano.id
  2683. })
  2684. }),
  2685. E.on(x.ORIGIN_LINK_CLICKED, function() {
  2686. f("showcase_share_origin_link_clicked")
  2687. })
  2688. }(e),
  2689. function() {
  2690. _.on(S.OPENED, f.bind(this, "showcase_gui", {
  2691. gui_action: "click_vr_button"
  2692. })),
  2693. _.on(S.LAUNCH, function(e) {
  2694. f("showcase_gui", {
  2695. gui_action: "launch_vr",
  2696. vr_platform: e.vr_platform,
  2697. vr_app: e.vr_app
  2698. })
  2699. }),
  2700. _.on(S.PREV, f.bind(this, "showcase_gui", {
  2701. gui_action: "vr_modal_prev"
  2702. })),
  2703. _.on(S.NEXT, function(e) {
  2704. f("showcase_gui", {
  2705. gui_action: e.nextAction
  2706. })
  2707. }),
  2708. _.on(S.CLOSED, f.bind(this, "showcase_gui", {
  2709. gui_action: "vr_modal_close"
  2710. })),
  2711. _.on(S.falseICECHOSEN, function(e) {
  2712. f("showcase_gui", {
  2713. gui_action: e.name + " "
  2714. })
  2715. }),
  2716. _.on(S.STORE, function(e) {
  2717. f("showcase_gui", {
  2718. gui_action: "launch_store",
  2719. store: e
  2720. })
  2721. })
  2722. }()
  2723. }
  2724. function f(e, t) {
  2725. if (t = t || {},
  2726. i)
  2727. try {
  2728. window.analytics.track(e, s.extendObject(t, c), {
  2729. context: {
  2730. app: {
  2731. name: "showcase",
  2732. version: "2.25.6-0-gd87e5b1"
  2733. },
  2734. screen: {
  2735. width: window.screen.width,
  2736. height: window.screen.height,
  2737. density: window.devicePixelRatio
  2738. }
  2739. }
  2740. })
  2741. } catch (t) {
  2742. console.warn("Failed to send data to segment for " + e)
  2743. }
  2744. }
  2745. function g(e, t) {
  2746. f(e, t = t || {})
  2747. }
  2748. function m(e, t) {
  2749. R = e === C.InteractionGui ? "gui-" + t : e,
  2750. v = "self_guided"
  2751. }
  2752. var v, o, a = (u("three"),
  2753. u("./util/ajax"),
  2754. u("./ab")), y = u("./util/browser"), s = u("./util/common"), t = u("./settings"), A = (u("./localization/localize"),
  2755. 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"),
  2756. "direct"), i = null, n = !1, P = null, c = null, h = s.uuid4();
  2757. d.exports = {
  2758. report: function(e, t, i, n) {
  2759. !function(e, t) {
  2760. if (o)
  2761. try {
  2762. o.addEvent(e, s.extendObject({
  2763. host: window.location.host,
  2764. keen: {
  2765. addons: [{
  2766. name: "keen:ua_parser",
  2767. input: {
  2768. ua_string: "user_agent"
  2769. },
  2770. output: "parsed_user_agent"
  2771. }]
  2772. },
  2773. user_agent: "${keen.user_agent}",
  2774. referrer: {
  2775. url: s.normalizeUrl(document.referrer),
  2776. domain: s.domainFromUrl(document.referrer),
  2777. url_original: document.referrer
  2778. },
  2779. embedded: y.inIframe(),
  2780. is_mobile: y.isMobile(),
  2781. version: "2.25.6-0-gd87e5b1"
  2782. }, t))
  2783. } catch (e) {
  2784. l.warn("analytics.report -> client.addEvent() error (is there blocking software installed?). Error message: " + e)
  2785. }
  2786. }("Session starts", {
  2787. model: e,
  2788. status: t,
  2789. loadtime: Date.now() - (P || Date.now()),
  2790. loadtime_from_navigation_start: i ? Date.now() - window.navigationStart : null,
  2791. autoplay: i,
  2792. quickstart: n,
  2793. ab_tilegen: a.tilegen,
  2794. ab_imgopt: a.imgopt
  2795. })
  2796. },
  2797. impression: function(e) {
  2798. g("impression", {
  2799. visible: void 0 === (e = e || {}).isVisible || e.isVisible,
  2800. url_params: (void 0 !== e.immediate && e.immediate,
  2801. window.location.search.substr(1).split("&"))
  2802. })
  2803. },
  2804. initKeen: function(e) {
  2805. return e.token && e.appId ? void (o = new Keen({
  2806. projectId: e.appId,
  2807. writeKey: e.token,
  2808. readKey: "",
  2809. requestType: "xhr"
  2810. })) : void l.warn("no keen token/appId")
  2811. },
  2812. initSegment: function(e) {
  2813. return e.token ? (i = e.token,
  2814. window.analytics.load(e.token),
  2815. c = {
  2816. model_id: e.model,
  2817. start_source: e.startSource,
  2818. autoplay: e.autoplay,
  2819. quickstart: e.quickstart,
  2820. language_tag: t.languageTag,
  2821. is_mobile: y.isMobile(),
  2822. iframe: y.inIframe(),
  2823. aspect_ratio: y.aspectRatio(),
  2824. session_id: h,
  2825. window: {
  2826. width: $("#player").width(),
  2827. height: $("#player").height()
  2828. },
  2829. platform: {
  2830. browser: {
  2831. name: $.ua.browser.name,
  2832. major: $.ua.browser.major,
  2833. version: $.ua.browser.version
  2834. },
  2835. os: {
  2836. name: $.ua.os.name,
  2837. version: $.ua.os.version
  2838. },
  2839. device: {
  2840. vendor: $.ua.device.vendor,
  2841. model: $.ua.device.model,
  2842. type: $.ua.device.type
  2843. }
  2844. }
  2845. },
  2846. n = Math.random() < t.analytics.sessionTrackingRate,
  2847. l.debug("tracking sample rate = " + t.analytics.sessionTrackingRate),
  2848. void l.debug("tracking this session = " + n)) : void l.warn("no segment token")
  2849. },
  2850. sessionStart: function(e) {
  2851. l.debug("analytics user_session_start"),
  2852. f("session_started"),
  2853. P = Date.now(),
  2854. window.addEventListener("unload", function() {
  2855. !function(e, t) {
  2856. if (t = t || {},
  2857. navigator.sendBeacon && i)
  2858. try {
  2859. navigator.sendBeacon("https://api.segment.io/v1/t", JSON.stringify({
  2860. event: e,
  2861. anonymousId: window.analytics.user().anonymousId(),
  2862. properties: s.extendObject(t, c),
  2863. writeKey: i,
  2864. sentAt: Date.now(),
  2865. type: "track",
  2866. context: {
  2867. userAgent: y.userAgent(),
  2868. library: {
  2869. name: "showcase-beacon",
  2870. version: "2.25.6-0-gd87e5b1"
  2871. },
  2872. app: {
  2873. name: "showcase",
  2874. version: "2.25.6-0-gd87e5b1"
  2875. }
  2876. }
  2877. }))
  2878. } catch (e) {
  2879. console.warn("Failed to send async segment request")
  2880. }
  2881. }("session_ended", {
  2882. duration: Date.now() - P
  2883. })
  2884. })
  2885. },
  2886. modelLoaded: function(e, t, i, n) {
  2887. r(e, t, i, n)
  2888. },
  2889. loadComplete: function(e) {
  2890. f("load_times", {
  2891. time_to_app_start: e
  2892. })
  2893. },
  2894. track: function(e, t) {
  2895. n && (l.debug('analytics.track("' + e + '", ' + JSON.stringify(t) + " )"),
  2896. f(e, t))
  2897. },
  2898. trackAlways: function(e, t) {
  2899. l.debug('analytics.trackAlways("' + e + '", ' + JSON.stringify(t) + " )"),
  2900. f(e, t)
  2901. },
  2902. getSessionId: function() {
  2903. return h
  2904. },
  2905. updateInteraction: m
  2906. }
  2907. }
  2908. ).call(this, "/js/analytics.js")
  2909. }
  2910. , {
  2911. "./ab": 3,
  2912. "./enum/ControlEvents": 21,
  2913. "./enum/PlayerEvents": 40,
  2914. "./enum/VROption": 47,
  2915. "./enum/VRPlatforms": 49,
  2916. "./enum/Viewmode": 51,
  2917. "./gui/sharing/ShareEvents": 76,
  2918. "./gui/sharing/modal": 77,
  2919. "./gui/title/TitleEvents": 80,
  2920. "./gui/title/titleBar": 82,
  2921. "./gui/vr/vrEvent": 85,
  2922. "./gui/vr/vrModal": 87,
  2923. "./localization/localize": 108,
  2924. "./tag/Billboard/BillboardEvent": 120,
  2925. "./settings": 166,
  2926. "./util/ajax": 181,
  2927. "./util/browser": 182,
  2928. "./util/common": 185,
  2929. "./util/logger": 189,
  2930. three: 217
  2931. }],
  2932. 5: [function(e, t, i) {
  2933. "use strict";
  2934. function n() {
  2935. r.PerspectiveCamera.call(this, a.clampVFOV(o.dollhouseFOV), $("#player").width() / $("#player").height(), o.dollhouseNear, o.dollhouseFar),
  2936. this.controls = null
  2937. }
  2938. var r = e("three")
  2939. , o = e("../constants")
  2940. , a = e("../util/cameraLight");
  2941. (n.prototype = Object.create(r.PerspectiveCamera.prototype)).updateAspect = function(e) {
  2942. this.aspect = e,
  2943. this.updateProjectionMatrix()
  2944. }
  2945. ,
  2946. t.exports = n
  2947. }
  2948. , {
  2949. "../constants": 8,
  2950. "../util/cameraLight": 184,
  2951. three: 217
  2952. }],
  2953. 6: [function(e, t, i) {
  2954. "use strict";
  2955. function n() {
  2956. var e = $("#player").width() / $("#player").height();
  2957. r.OrthographicCamera.call(this, -o.orthoBase, o.orthoBase, o.orthoBase / e, -o.orthoBase / e, o.orthoNear, o.orthoFar),
  2958. this.controls = null,
  2959. this.updateAspect(e)
  2960. }
  2961. var r = e("three")
  2962. , o = e("../constants");
  2963. (n.prototype = Object.create(r.OrthographicCamera.prototype)).updateAspect = function(e) {
  2964. this.aspect = e,
  2965. this.top = o.orthoBase / e,
  2966. this.bottom = -o.orthoBase / e,
  2967. this.updateProjectionMatrix()
  2968. }
  2969. ,
  2970. t.exports = n
  2971. }
  2972. , {
  2973. "../constants": 8,
  2974. three: 217
  2975. }],
  2976. 7: [function(e, t, i) {
  2977. "use strict";
  2978. function n() {
  2979. r.PerspectiveCamera.call(this, a.clampVFOV(o.insideFOV), $("#player").width() / $("#player").height(), o.insideNear, o.insideFar),
  2980. this.controls = null
  2981. }
  2982. var r = e("three")
  2983. , o = e("../settings")
  2984. , a = e("../util/cameraLight");
  2985. (n.prototype = Object.create(r.PerspectiveCamera.prototype)).updateAspect = function(e) {
  2986. this.aspect = e,
  2987. this.updateProjectionMatrix()
  2988. }
  2989. ,
  2990. t.exports = n
  2991. }
  2992. , {
  2993. "../settings": 166,
  2994. "../util/cameraLight": 184,
  2995. three: 217
  2996. }],
  2997. 8: [function(e, t, i) {
  2998. "use strict";
  2999. t.exports = {
  3000. signedUrlDefaultExpireTime: 24e4,
  3001. signedUrlCheckInterval: 1e4,
  3002. signedUrlRefreshBuffer: 15e3,
  3003. dollhouseFOV: 70,
  3004. dollhouseNear: .1,//1,
  3005. dollhouseFar: 5e3,
  3006. insideFOV: 70,
  3007. insideFOVMax: 120,
  3008. insideNear: .1,
  3009. insideFar: 5e3,
  3010. insideLookSpeed: .12,
  3011. insideLookLimitUp: 40,
  3012. insideLookLimitDown: -40,
  3013. orthoNear: 1,
  3014. orthoFar: 5e3,
  3015. orthoBase: 10,
  3016. narrowLandscapeHeight: 290,
  3017. reallyNarrowLandscapeHeight: 250,
  3018. visionTilingStartDate: new Date("8/26/2016"),
  3019. visionTilingStartVersion: "1.1.407.13667",
  3020. windowHeightHighQualityThreshold: 900,
  3021. tourStepDelayDefault: 3500,
  3022. tourStepDelaySlideShow: 5e3,
  3023. workshopApsect: 9 / 16,
  3024. highQualityMaxZoom: 2,
  3025. ultraHighQualityMaxZoom: 3
  3026. }
  3027. }
  3028. , {}],
  3029. 9: [function(e, t, i) {
  3030. "use strict";
  3031. function n() {
  3032. this.activeControl = null,
  3033. this.controls = {},
  3034. this.cameras = {}
  3035. }
  3036. var a = e("./PanoramaControls")
  3037. , s = e("./DollhouseControls")
  3038. , l = e("./FloorplanControls")
  3039. , c = e("../cameras/PanoramaCamera")
  3040. , h = e("../cameras/DollhouseCamera")
  3041. , u = e("../cameras/FloorplanCamera")
  3042. , r = e("events").EventEmitter
  3043. , d = e("../enum/ControlEvents")
  3044. , o = e("../enum/ModelManagerEvents")
  3045. , p = e("../enum/Viewmode")
  3046. , f = e("../settings");
  3047. (n.prototype = Object.create(r.prototype)).init = function(e, t) {
  3048. this.setUpControls(),
  3049. this.bindEvents(e, t)
  3050. }
  3051. ,
  3052. n.prototype.activateControls = function(e) {
  3053. this.activeControl && (this.activeControl.reset(),
  3054. this.activeControl.enabled = !1),
  3055. this.controls[e] && (this.controls[e].enabled = !0),
  3056. this.activeControl = this.controls[e]
  3057. }
  3058. ,
  3059. n.prototype.setUpControls = function() {
  3060. var i = {}
  3061. , n = {}
  3062. , e = [p.PANORAMA, p.DOLLHOUSE, p.FLOORPLAN]
  3063. , r = [c, h, u]
  3064. , o = [a, s, l];
  3065. e.forEach(function(e, t) {
  3066. i[e] = new r[t],
  3067. n[e] = new o[t](i[e]),
  3068. n[e].on(d.Move, this.emit.bind(this, d.Move)),
  3069. n[e].on(d.InputStart, this.emit.bind(this, d.InputStart)),
  3070. n[e].on(d.InteractionDirect, this.emit.bind(this, d.InteractionDirect)),
  3071. n[e].on(d.InteractionKey, this.emit.bind(this, d.InteractionKey)),
  3072. n[e].on(d.Pinch, this.emit.bind(this, d.Pinch)),
  3073. n[e].on(d.Scroll, this.emit.bind(this, d.Scroll))
  3074. }
  3075. .bind(this)),
  3076. this.controls = n,
  3077. this.cameras = i
  3078. }
  3079. ,
  3080. n.prototype.bindEvents = function(e, t) {
  3081. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  3082. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  3083. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  3084. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  3085. f.useWheel && (e.addEventListener("mousewheel", this.onMouseWheel.bind(this), {
  3086. passive: !1
  3087. }),
  3088. e.addEventListener("DOMMouseScroll", this.onMouseWheel.bind(this))),
  3089. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  3090. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  3091. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  3092. e.addEventListener("contextmenu", function(e) {
  3093. e.preventDefault()
  3094. }),
  3095. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  3096. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  3097. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  3098. e.addEventListener("pointerout", this.onPointerCancel.bind(this)),
  3099. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  3100. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  3101. document.addEventListener("keyup", this.onKeyUp.bind(this)),
  3102. t.on(o.ActiveModelChanged, function(e) {
  3103. this.setModelForControls(e.model)
  3104. }
  3105. .bind(this))
  3106. }
  3107. ,
  3108. n.prototype.setModelForControls = function(e) {
  3109. this.controls[p.DOLLHOUSE].setZoomBounds(e.boundingBox);
  3110. var t = e.boundingBox.clone().expandByScalar(f.modelBoundsPadding);
  3111. [p.DOLLHOUSE, p.FLOORPLAN].forEach(function(e) {
  3112. this.controls[e].setBounds(t)
  3113. }
  3114. .bind(this))
  3115. }
  3116. ,
  3117. n.prototype.onMouseDown = function(e) {
  3118. e.preventDefault(),
  3119. this.activeControl && this.activeControl.onMouseDown(e)
  3120. }
  3121. ,
  3122. n.prototype.onMouseMove = function(e) {
  3123. e.preventDefault(),
  3124. this.activeControl && this.activeControl.onMouseMove(e)
  3125. }
  3126. ,
  3127. n.prototype.onMouseUp = function(e) {
  3128. e.preventDefault(),
  3129. this.activeControl && this.activeControl.onMouseUp(e)
  3130. }
  3131. ,
  3132. n.prototype.onMouseOver = function(e) {
  3133. e.preventDefault(),
  3134. this.activeControl && this.activeControl.onMouseOver(e)
  3135. }
  3136. ,
  3137. n.prototype.onMouseWheel = function(e) {
  3138. e.preventDefault(),
  3139. this.activeControl && this.activeControl.onMouseWheel(e)
  3140. }
  3141. ,
  3142. n.prototype.onTouchStart = function(e) {
  3143. e.preventDefault(),
  3144. this.activeControl && this.activeControl.onTouchStart(e),
  3145. $("#hotListWrap")[0].classList.remove("hotListActive"),
  3146. $("#hotListContent ul .active").removeClass("active"),
  3147. $("#hotList")[0].classList.remove("active")
  3148. }
  3149. ,
  3150. n.prototype.onTouchMove = function(e) {
  3151. e.preventDefault(),
  3152. this.activeControl && this.activeControl.onTouchMove(e)
  3153. }
  3154. ,
  3155. n.prototype.onTouchEnd = function(e) {
  3156. e.preventDefault(),
  3157. this.activeControl && this.activeControl.onTouchEnd(e)
  3158. }
  3159. ,
  3160. n.prototype.onPointerDown = function(e) {
  3161. if (e.preventDefault(),
  3162. this.activeControl)
  3163. switch (e.pointerType) {
  3164. case "mouse":
  3165. this.activeControl.onMouseDown(e);
  3166. break;
  3167. default:
  3168. this.activeControl.onPointerDown(e)
  3169. }
  3170. }
  3171. ,
  3172. n.prototype.onPointerMove = function(e) {
  3173. if (e.preventDefault(),
  3174. this.activeControl)
  3175. switch (e.pointerType) {
  3176. case "mouse":
  3177. this.activeControl.onMouseMove(e);
  3178. break;
  3179. default:
  3180. this.activeControl.onPointerMove(e)
  3181. }
  3182. }
  3183. ,
  3184. n.prototype.onPointerUp = function(e) {
  3185. if (e.preventDefault(),
  3186. this.activeControl)
  3187. switch (e.pointerType) {
  3188. case "mouse":
  3189. this.activeControl.onMouseUp(e);
  3190. break;
  3191. default:
  3192. this.activeControl.onPointerUp(e)
  3193. }
  3194. }
  3195. ,
  3196. n.prototype.onPointerCancel = function(e) {
  3197. e.preventDefault(),
  3198. this.activeControl && "mouse" !== e.pointerType && this.activeControl.onPointerUp(e)
  3199. }
  3200. ,
  3201. n.prototype.onKeyDown = function(e) {
  3202. e.metaKey || e.ctrlKey || (e.preventDefault(),
  3203. this.activeControl && this.activeControl.onKeyDown(e))
  3204. }
  3205. ,
  3206. n.prototype.onKeyUp = function(e) {
  3207. e.preventDefault(),
  3208. this.activeControl && this.activeControl.onKeyUp(e)
  3209. }
  3210. ,
  3211. t.exports = n
  3212. }
  3213. , {
  3214. "../cameras/DollhouseCamera": 5,
  3215. "../cameras/FloorplanCamera": 6,
  3216. "../cameras/PanoramaCamera": 7,
  3217. "../enum/ControlEvents": 21,
  3218. "../enum/ModelManagerEvents": 33,
  3219. "../enum/Viewmode": 51,
  3220. "../settings": 166,
  3221. "./DollhouseControls": 10,
  3222. "./FloorplanControls": 11,
  3223. "./PanoramaControls": 13,
  3224. events: 202
  3225. }],
  3226. 10: [function(e, t, i) {
  3227. "use strict";
  3228. function n(e) {
  3229. a.call(this, e),
  3230. this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3231. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle,
  3232. this.minDistance = o.dollhouseDefault.minDistance,
  3233. this.maxDistance = o.dollhouseDefault.maxDistance,
  3234. this.adjustedMinDistance = this.minDistance,
  3235. this.adjustedMaxDistance = this.maxDistance
  3236. }
  3237. var r = e("three")
  3238. , o = e("../settings")
  3239. , a = e("./OutsideControls");
  3240. (n.prototype = Object.create(a.prototype)).pan = function(e, t) {
  3241. this.camera.updateMatrix();
  3242. var i = this.camera.position.clone().sub(this.target).length();
  3243. i *= Math.tan(this.camera.fov / 2 * Math.PI / 180),
  3244. this.panLeft(2 * e * i / $("#player").height()),
  3245. this.panUp(-2 * t * i / $("#player").height())
  3246. }
  3247. ,
  3248. n.prototype.updateZoom = function() {
  3249. return this.offset.length() * this.scale
  3250. }
  3251. ,
  3252. n.prototype.setZoomBounds = function(e) {
  3253. var t = e.min.distanceTo(e.max);
  3254. this.adjustedMinDistance = Math.max(Math.min(t / 2, o.dollhouseDefault.minDistance), 0),
  3255. this.adjustedMaxDistance = Math.min(Math.max(t, o.dollhouseDefault.maxDistance), o.skyboxRadius),
  3256. this.minDistance = this.adjustedMinDistance,
  3257. this.maxDistance = this.adjustedMaxDistance
  3258. }
  3259. ,
  3260. n.prototype.resetRanges = function(e, t) {
  3261. e ? (this.minDistance = Math.min(e, this.minDistance),
  3262. this.maxDistance = Math.max(e, this.maxDistance)) : (this.minDistance = this.adjustedMinDistance,
  3263. this.maxDistance = this.adjustedMaxDistance),
  3264. t ? (this.minPolarAngle = r.Math.degToRad(-15),
  3265. this.maxPolarAngle = r.Math.degToRad(89.9)) : (this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3266. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle)
  3267. }
  3268. ,
  3269. n.prototype.toJSON = function() {
  3270. return a.prototype.toJSON.call(this)
  3271. }
  3272. ,
  3273. t.exports = n
  3274. }
  3275. , {
  3276. "../settings": 166,
  3277. "./OutsideControls": 12,
  3278. three: 217
  3279. }],
  3280. 11: [function(e, t, i) {
  3281. "use strict";
  3282. function n(e) {
  3283. c.call(this, e),
  3284. this.minDistance = 15,
  3285. this.maxDistance = 50,
  3286. this.noRotateUpDown = !0,
  3287. this.minPolarAngle = 0,
  3288. this.maxPolarAngle = 0,
  3289. this.mouseActions[u.LEFT] = h.PAN,
  3290. this.mouseActions[u.MIDDLE] = h.DOLLY,
  3291. this.mouseActions[u.RIGHT] = h.ROTATE,
  3292. this.touchActions[1] = h.PAN,
  3293. this.touchActions[2] = h.ROTATE_DOLLY,
  3294. this.absoluteScale = 1,
  3295. this.currentScale = 1
  3296. }
  3297. 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");
  3298. (n.prototype = Object.create(c.prototype)).zoomToContain = function(e) {
  3299. this.absoluteScale = this.getDefaultAbsoluteScale(e);
  3300. this.currentScale = this.absoluteScale
  3301. }
  3302. ,
  3303. n.prototype.getDefaultAbsoluteScale = function(modelSize) {
  3304. var t = Math.max(modelSize.x, modelSize.z)
  3305. , i = Math.min(modelSize.x, modelSize.z)
  3306. , n = Math.max(t, i * this.camera.aspect)
  3307. , r = Math.max(i, t * this.camera.aspect);
  3308. var absoluteScale = (p.aspectRatio() < 1 ? r : n) / 2 / l.orthoBase * 1.2
  3309. return absoluteScale
  3310. },
  3311. n.prototype.rotateToView = function(e, t) {
  3312. var i = 0;
  3313. p.aspectRatio() < 1 == e.x < e.z ? 0 < t.z && (i = Math.PI) : i = 0 < t.x ? Math.PI / 2 : -Math.PI / 2,
  3314. this.rotateLeft(i),
  3315. this.update(0)
  3316. }
  3317. ,
  3318. n.prototype.pan = function(e, t) {
  3319. this.camera.updateMatrix(),
  3320. this.panLeft(e * (this.camera.right - this.camera.left) / $("#player").width()),
  3321. this.panUp(-t * (this.camera.top - this.camera.bottom) / $("#player").height())
  3322. }
  3323. ,
  3324. n.prototype.updateZoom = function() {
  3325. return this.absoluteScale *= this.scale - .03 * this.keyboardZoomSpeed,
  3326. this.absoluteScale = Math.max(l.zoomNearLimit, Math.min(this.absoluteScale, l.zoomFarLimit)),
  3327. this.currentScale = .8 * this.currentScale + .2 * this.absoluteScale,
  3328. this.camera.left = -l.orthoBase * this.currentScale,
  3329. this.camera.right = l.orthoBase * this.currentScale,
  3330. this.camera.top = l.orthoBase * this.currentScale / this.camera.aspect,
  3331. this.camera.bottom = -l.orthoBase * this.currentScale / this.camera.aspect,
  3332. this.camera.updateProjectionMatrix(),
  3333. this.offset.length()
  3334. }
  3335. ,
  3336. n.prototype.toJSON = (r = new s.Quaternion,
  3337. o = (new s.Quaternion).setFromAxisAngle(new s.Vector3(0,1,0), s.Math.degToRad(90)),
  3338. a = new s.Quaternion,
  3339. function() {
  3340. var e = c.prototype.toJSON.call(this);
  3341. return r.copy(e.camera_quaternion),
  3342. a.copy(o),
  3343. a.multiply(r),
  3344. e.camera_quaternion.x = d.toPrecision(a.x, 4),
  3345. e.camera_quaternion.y = d.toPrecision(a.y, 4),
  3346. e.camera_quaternion.z = d.toPrecision(a.z, 4),
  3347. e.camera_quaternion.w = d.toPrecision(a.w, 4),
  3348. e.ortho_zoom = d.toPrecision(this.currentScale * this.camera.aspect, 4),
  3349. e
  3350. }
  3351. ),
  3352. t.exports = n
  3353. }
  3354. , {
  3355. "../enum/ControlActions": 20,
  3356. "../enum/MouseButton": 34,
  3357. "../settings": 166,
  3358. "../util/browser": 182,
  3359. "../util/math": 190,
  3360. "./OutsideControls": 12,
  3361. three: 217
  3362. }],
  3363. 12: [function(e, t, i) {
  3364. "use strict";
  3365. function n(e) {
  3366. this.camera = e,
  3367. (this.camera.controls = this).enabled = !1,
  3368. this.target = new a.Vector3,
  3369. this.targetBounds = new a.Box3,
  3370. this.zoomSpeed = 2,//编辑时缩放快一些
  3371. this.minDistance = 0,
  3372. this.maxDistance = 1 / 0,
  3373. this.noRotateUpDown = !1,
  3374. this.rotateSpeed = 1,
  3375. this.keyboardZoomSpeed = 0,
  3376. this.keyPanSpeed = 7,
  3377. this.autoRotate = !1,
  3378. this.autoRotateSpeed = 2,
  3379. this.autoPan = !1,
  3380. this.autoPanPosition = new a.Vector3,
  3381. this.minPolarAngle = a.Math.degToRad(25),
  3382. this.maxPolarAngle = a.Math.degToRad(65),
  3383. this.rotationAcceleration = new a.Vector2,
  3384. this.rotationSpeed = new a.Vector2,
  3385. this.panAcceleration = new a.Vector2,
  3386. this.panSpeed = new a.Vector2,
  3387. this.rotateStart = new a.Vector2,
  3388. this.rotateEnd = new a.Vector2,
  3389. this.rotateDelta = new a.Vector2,
  3390. this.panStart = new a.Vector2,
  3391. this.panEnd = new a.Vector2,
  3392. this.panDelta = new a.Vector2,
  3393. this.panOffset = new a.Vector3,
  3394. this.offset = new a.Vector3,
  3395. this.dollyStart = new a.Vector2,
  3396. this.dollyEnd = new a.Vector2,
  3397. this.dollyDelta = new a.Vector2,
  3398. this.phiDelta = 0,
  3399. this.thetaDelta = 0,
  3400. this.scale = 1,
  3401. this.panVector = new a.Vector3,
  3402. this.lastPosition = new a.Vector3,
  3403. this.state = u.NONE,
  3404. this.mouseActions = {},
  3405. this.mouseActions[d.LEFT] = u.ROTATE,
  3406. this.mouseActions[d.MIDDLE] = u.DOLLY,
  3407. this.mouseActions[d.RIGHT] = u.PAN,
  3408. this.touchActions = {},
  3409. this.touchActions[1] = u.ROTATE,
  3410. this.touchActions[2] = u.PAN_DOLLY,
  3411. this.lastMoveTime = 0,
  3412. this.pointersLimit = 2,
  3413. this.pointers = []
  3414. }
  3415. 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;
  3416. (n.prototype = Object.create(g.prototype)).setBounds = function(e) {
  3417. this.targetBounds = e
  3418. }
  3419. ,
  3420. n.prototype.isEngaged = function() {
  3421. return this.state !== u.NONE
  3422. }
  3423. ,
  3424. n.prototype.rotateLeft = function(e) {
  3425. void 0 === e && (e = this.getAutoRotationAngle()),
  3426. this.thetaDelta -= e
  3427. }
  3428. ,
  3429. n.prototype.rotateUp = function(e) {
  3430. this.noRotateUpDown || (void 0 === e && (e = this.getAutoRotationAngle()),
  3431. this.phiDelta -= e)
  3432. }
  3433. ,
  3434. n.prototype.panLeft = function(e) {
  3435. var t = this.camera.matrix.elements;
  3436. this.panOffset.set(t[0], 0, t[2]).normalize(),
  3437. this.panOffset.multiplyScalar(-e),
  3438. this.panVector.add(this.panOffset)
  3439. }
  3440. ,
  3441. n.prototype.panUp = function(e) {
  3442. var t = this.camera.matrix.elements;
  3443. this.panOffset.set(t[4], 0, t[6]).normalize(),
  3444. this.panOffset.multiplyScalar(-e),
  3445. this.panVector.add(this.panOffset)
  3446. }
  3447. ,
  3448. n.prototype.startRotating = function(e, t) {
  3449. e && this.navRotationAcc("x", e),
  3450. t && this.navRotationAcc("y", t)
  3451. }
  3452. ,
  3453. n.prototype.stopRotating = function(e) {
  3454. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  3455. this.navRotationAcc("x", 0),
  3456. this.navRotationAcc("y", 0)
  3457. }
  3458. ,
  3459. n.prototype.setAutoPanPosition = (r = new a.Vector3,
  3460. o = new a.Vector3,
  3461. function(e, t) {
  3462. r.copy(this.camera.position),
  3463. void 0 === e && null === e || r.setX(e),
  3464. void 0 === t && null === t || r.setZ(t);
  3465. var i = this.camera.position.distanceTo(this.target)
  3466. , n = l.FORWARD.clone().applyQuaternion(this.camera.quaternion);
  3467. this.targetClamped = !1,
  3468. o.copy(r).addScaledVector(n, i),
  3469. this.targetBounds.containsPoint(o) || (this.targetBounds.clampPoint(o, o),
  3470. r.copy(o).addScaledVector(n, -i),
  3471. this.targetClamped = !0),
  3472. this.autoPanPosition.x = r.x,
  3473. this.autoPanPosition.z = r.z,
  3474. this.autoPan && this.stopAutoPanning()
  3475. }
  3476. ),
  3477. n.prototype.stopAutoPanning = function() {
  3478. var e = this.autoPan;
  3479. this.autoPan = !1,
  3480. this.emit(this.targetClamped ? f.AutoPanClamped : e ? f.AutoPanInterrupt : f.AutoPanComplete)
  3481. }
  3482. ,
  3483. n.prototype.dollyIn = function(e) {
  3484. void 0 === e && (e = this.getZoomScale()),
  3485. this.scale /= e
  3486. }
  3487. ,
  3488. n.prototype.dollyOut = function(e) {
  3489. void 0 === e && (e = this.getZoomScale()),
  3490. this.scale *= e
  3491. }
  3492. ,
  3493. n.prototype.updatePan = function(e) {
  3494. if (this.panSpeed.multiplyScalar(1 - c.panFriction).addScaledVector(this.panAcceleration, c.panAccelerationOutside * e),
  3495. this.pan(-this.panSpeed.x, this.panSpeed.y),
  3496. this.autoPan) {
  3497. var t = (new a.Vector3).copy(this.autoPanPosition).sub(this.camera.position);
  3498. t.setY(0).clampLength(0, 50 * e),
  3499. this.target.add(t),
  3500. this.camera.position.add(t),
  3501. this.autoPanPosition.x === this.camera.position.x && this.autoPanPosition.z === this.camera.position.z && (this.autoPan = !1,
  3502. this.stopAutoPanning())
  3503. }
  3504. }
  3505. ,
  3506. n.prototype.update = function(e) {
  3507. e = e || 1 / 60,
  3508. this.rotationSpeed.multiplyScalar(1 - c.rotationFriction).addScaledVector(this.rotationAcceleration, c.rotationAccelerationOutside * e),
  3509. this.rotateLeft(-this.rotationSpeed.x),
  3510. this.noRotateUpDown || this.rotateUp(this.rotationSpeed.y),
  3511. this.updatePan(e);
  3512. var t = this.camera.position;
  3513. this.offset.copy(t).sub(this.target);
  3514. var i = Math.atan2(this.offset.x, this.offset.z)
  3515. , n = Math.atan2(Math.sqrt(this.offset.x * this.offset.x + this.offset.z * this.offset.z), this.offset.y);
  3516. this.autoRotate && this.rotateLeft(this.getAutoRotationAngle()),
  3517. i += this.thetaDelta,
  3518. n += this.phiDelta,
  3519. n = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, n)),
  3520. n = Math.max(1e-6, Math.min(Math.PI - 1e-6, n));
  3521. var r = this.updateZoom();
  3522. r = Math.max(this.minDistance, Math.min(this.maxDistance, r)),
  3523. this.target.add(this.panVector),
  3524. this.targetBounds.clampPoint(this.target, this.target),
  3525. this.offset.x = r * Math.sin(n) * Math.sin(i),
  3526. this.offset.y = r * Math.cos(n),
  3527. this.offset.z = r * Math.sin(n) * Math.cos(i),
  3528. t.copy(this.target).add(this.offset),
  3529. this.camera.lookAt(this.target),
  3530. this.thetaDelta = 0,
  3531. this.phiDelta = 0,
  3532. this.scale = 1,
  3533. this.panVector.set(0, 0, 0),
  3534. 0 < this.lastPosition.distanceTo(this.camera.position) && this.lastPosition.copy(this.camera.position)
  3535. }
  3536. ,
  3537. n.prototype.getAutoRotationAngle = function() {
  3538. return 2 * Math.PI / 60 / 60 * this.autoRotateSpeed
  3539. }
  3540. ,
  3541. n.prototype.getZoomScale = function() {
  3542. return Math.pow(.95, this.zoomSpeed)
  3543. }
  3544. ,
  3545. n.prototype.onMouseDown = function(e) {
  3546. if (this.enabled) {
  3547. switch (e.preventDefault(),
  3548. this.stopAutoPanning(),
  3549. this.mouseDown = !0,
  3550. this.state = this.mouseActions[e.button],
  3551. this.state) {
  3552. case u.ROTATE:
  3553. this.rotateStart.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3554. this.rotationSpeed.set(0, 0);
  3555. break;
  3556. case u.DOLLY:
  3557. this.dollyStart.set(e.clientX, e.clientY);
  3558. break;
  3559. case u.PAN:
  3560. this.panStart.set(e.clientX, e.clientY)
  3561. }
  3562. this.emit(f.InputStart, "mouse")
  3563. }
  3564. }
  3565. ,
  3566. n.prototype.onMouseMove = function(e) {
  3567. if (this.enabled && this.mouseDown && 0 !== e.buttons) {
  3568. switch (e.preventDefault(),
  3569. this.state) {
  3570. case u.ROTATE:
  3571. this.rotateEnd.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3572. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3573. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3574. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3575. this.rotateStart.copy(this.rotateEnd);
  3576. break;
  3577. case u.DOLLY:
  3578. this.dollyEnd.set(e.clientX, e.clientY),
  3579. this.dollyDelta.subVectors(this.dollyEnd, this.dollyStart),
  3580. (0 < this.dollyDelta.y ? this.dollyIn : this.dollyOut).call(this),
  3581. this.dollyStart.copy(this.dollyEnd);
  3582. break;
  3583. case u.PAN:
  3584. this.panEnd.set(e.clientX, e.clientY),
  3585. this.panDelta.subVectors(this.panEnd, this.panStart),
  3586. this.pan(this.panDelta.x, this.panDelta.y),
  3587. this.panStart.copy(this.panEnd)
  3588. }
  3589. this.emit(f.Move, "mouse"),
  3590. this.lastMoveTime = e.timeStamp,
  3591. this.update()
  3592. }
  3593. }
  3594. ,
  3595. n.prototype.onMouseUp = function(e) {
  3596. this.enabled && (this.mouseDown = !1,
  3597. this.state = u.NONE,
  3598. "mouseover" !== e.type && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3599. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y),
  3600. this.update(),
  3601. this.rotationAcceleration.set(0, 0),
  3602. this.rotateDelta.set(0, 0)))
  3603. }
  3604. ,
  3605. n.prototype.onMouseOver = function(e) {
  3606. 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  3607. }
  3608. ,
  3609. n.prototype.onMouseWheel = function(e) {
  3610. this.enabled && c.useWheel && (this.emit(f.Move, "wheel"),
  3611. (0 < (e.wheelDelta || -e.detail) ? this.dollyOut : this.dollyIn).call(this),
  3612. this.update())
  3613. }
  3614. ,
  3615. n.prototype.onKeyDown = function(e) {
  3616. this.enabled && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  3617. this.handleKeyDown(e.which)))
  3618. }
  3619. ,
  3620. n.prototype.navRotationAcc = function(e, t) {
  3621. "y" === e ? this.noRotateUpDown ? this.keyboardZoomSpeed = t : this.rotationAcceleration.y = t : this.rotationAcceleration.x = t
  3622. }
  3623. ,
  3624. n.prototype.navPanAcc = function(e, t) {
  3625. this.stopAutoPanning(),
  3626. this.panAcceleration[e] = t
  3627. }
  3628. ,
  3629. n.prototype.handleKeyDown = function(e) {
  3630. var t = !0;
  3631. switch (e) {
  3632. case p.UPARROW:
  3633. case p.I:
  3634. this.navRotationAcc("y", 1);
  3635. break;
  3636. case p.DOWNARROW:
  3637. case p.K:
  3638. this.navRotationAcc("y", -1);
  3639. break;
  3640. case p.LEFTARROW:
  3641. case p.J:
  3642. this.navRotationAcc("x", -1);
  3643. break;
  3644. case p.RIGHTARROW:
  3645. case p.L:
  3646. this.navRotationAcc("x", 1);
  3647. break;
  3648. case p.W:
  3649. this.navPanAcc("y", 1);
  3650. break;
  3651. case p.S:
  3652. this.navPanAcc("y", -1);
  3653. break;
  3654. case p.A:
  3655. this.navPanAcc("x", -1);
  3656. break;
  3657. case p.D:
  3658. this.navPanAcc("x", 1);
  3659. break;
  3660. default:
  3661. t = !1
  3662. }
  3663. t && this.emit(f.Move, "key")
  3664. }
  3665. ,
  3666. n.prototype.onKeyUp = function(e) {
  3667. this.enabled && (e.preventDefault(),
  3668. e.stopPropagation(),
  3669. this.handleKeyUp(e.which))
  3670. }
  3671. ,
  3672. n.prototype.handleKeyUp = function(e) {
  3673. switch (e) {
  3674. case p.I:
  3675. case p.K:
  3676. case p.UPARROW:
  3677. case p.DOWNARROW:
  3678. this.keyboardZoomSpeed = 0,
  3679. this.rotationAcceleration.y = 0;
  3680. break;
  3681. case p.J:
  3682. case p.L:
  3683. case p.LEFTARROW:
  3684. case p.RIGHTARROW:
  3685. this.rotationAcceleration.x = 0;
  3686. break;
  3687. case p.S:
  3688. case p.W:
  3689. this.panAcceleration.y = 0;
  3690. break;
  3691. case p.A:
  3692. case p.D:
  3693. this.panAcceleration.x = 0
  3694. }
  3695. }
  3696. ,
  3697. n.prototype.onTouchStart = function(i) {
  3698. if (this.enabled || this.state === u.NONE) {
  3699. i.preventDefault(),
  3700. i.stopPropagation(),
  3701. this.stopAutoPanning();
  3702. var e = function() {
  3703. if (2 === i.touches.length) {
  3704. var e = i.touches[0].pageX - i.touches[1].pageX
  3705. , t = i.touches[0].pageY - i.touches[1].pageY;
  3706. this.dollyStart.set(e, t)
  3707. }
  3708. }
  3709. .bind(this)
  3710. , t = function() {
  3711. this.panStart.set(h.average(i.touches, "pageX"), h.average(i.touches, "pageY"))
  3712. }
  3713. .bind(this)
  3714. , n = function() {
  3715. this.rotateStart.set(h.average(i.touches, "pageX"), h.average(i.touches, "pageY"))
  3716. }
  3717. .bind(this);
  3718. switch (this.state = this.touchActions[i.touches.length],
  3719. this.state) {
  3720. case u.PAN_DOLLY:
  3721. e();
  3722. case u.PAN:
  3723. t();
  3724. break;
  3725. case u.ROTATE_DOLLY:
  3726. e();
  3727. case u.ROTATE:
  3728. n()
  3729. }
  3730. this.rotationSpeed.set(0, 0),
  3731. this.emit(f.InputStart, "touch")
  3732. }
  3733. }
  3734. ,
  3735. n.prototype.onTouchMove = function(a) {
  3736. if (this.enabled && this.state !== u.NONE) {
  3737. a.preventDefault(),
  3738. a.stopPropagation();
  3739. var s = function() {
  3740. var e = a.touches[0].pageX - a.touches[1].pageX
  3741. , t = a.touches[0].pageY - a.touches[1].pageY;
  3742. this.dollyEnd.set(e, t);
  3743. var i = this.dollyStart.length() - this.dollyEnd.length();
  3744. 0 < i ? this.dollyOut(1 + i / 500) : this.dollyIn(1 - i / 500),
  3745. this.dollyStart.copy(this.dollyEnd)
  3746. }
  3747. .bind(this)
  3748. , e = function() {
  3749. this.panEnd.set(h.average(a.touches, "pageX"), h.average(a.touches, "pageY")),
  3750. this.panDelta.subVectors(this.panEnd, this.panStart),
  3751. this.pan(this.panDelta.x, this.panDelta.y),
  3752. this.panStart.copy(this.panEnd),
  3753. this.rotateDelta.set(0, 0)
  3754. }
  3755. .bind(this)
  3756. , l = function() {
  3757. this.rotateEnd.set(h.average(a.touches, "pageX"), h.average(a.touches, "pageY")),
  3758. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3759. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3760. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3761. this.rotateStart.copy(this.rotateEnd)
  3762. }
  3763. .bind(this)
  3764. , t = function() {
  3765. if (2 === a.touches.length) {
  3766. var e = window.devicePixelRatio || 1
  3767. , t = a.touches[1].pageX - a.touches[0].pageX
  3768. , i = a.touches[1].pageY - a.touches[0].pageY
  3769. , n = Math.sqrt(t * t + i * i);
  3770. if (Math.abs(this.dollyStart.length() - n) > c.input.touchMoveThreshold * e)
  3771. this.state = u.DOLLY,
  3772. s();
  3773. else {
  3774. var r = h.average(a.touches, "pageX")
  3775. , o = h.average(a.touches, "pageY");
  3776. this.rotateDelta.set(r, o).sub(this.rotateStart).length() > c.input.touchMoveThreshold && (this.state = u.ROTATE,
  3777. this.rotateStart.set(r, o),
  3778. l())
  3779. }
  3780. }
  3781. }
  3782. .bind(this);
  3783. switch (this.state) {
  3784. case u.PAN_DOLLY:
  3785. s();
  3786. case u.PAN:
  3787. e();
  3788. break;
  3789. case u.ROTATE_DOLLY:
  3790. t();
  3791. break;
  3792. case u.DOLLY:
  3793. s();
  3794. break;
  3795. case u.ROTATE:
  3796. l();
  3797. break;
  3798. default:
  3799. this.state = u.NONE
  3800. }
  3801. this.lastMoveTime = a.timeStamp,
  3802. this.emit(f.Move, "touch")
  3803. }
  3804. }
  3805. ,
  3806. n.prototype.onTouchEnd = function(e) {
  3807. this.enabled && (this.state === u.ROTATE && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3808. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y)),
  3809. this.state = u.NONE,
  3810. this.update(),
  3811. this.rotationAcceleration.set(0, 0),
  3812. this.rotateDelta.set(0, 0))
  3813. }
  3814. ,
  3815. n.prototype.onPointerDown = function(e) {
  3816. this.enabled && ("touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  3817. id: e.pointerId,
  3818. pageX: e.pageX,
  3819. pageY: e.pageY
  3820. }),
  3821. e.touches = this.pointers,
  3822. this.onTouchStart(e)),
  3823. this.emit(f.InputStart, "pointer"))
  3824. }
  3825. ,
  3826. n.prototype.onPointerMove = function(t) {
  3827. this.enabled && "touch" === t.pointerType && (this.pointers.forEach(function(e) {
  3828. t.pointerId === e.id && (e.pageX = t.pageX,
  3829. e.pageY = t.pageY)
  3830. }),
  3831. t.touches = this.pointers,
  3832. this.onTouchMove(t))
  3833. }
  3834. ,
  3835. n.prototype.onPointerUp = function(i) {
  3836. this.enabled && "touch" === i.pointerType && (this.pointers.forEach(function(e, t) {
  3837. i.pointerId === e.id && this.pointers.splice(t, 1)
  3838. }
  3839. .bind(this)),
  3840. i.touches = this.pointers,
  3841. this.onTouchEnd(i))
  3842. }
  3843. ,
  3844. n.prototype.reset = function() {
  3845. this.state = u.NONE,
  3846. this.stopAutoPanning(),
  3847. this.rotationSpeed.set(0, 0),
  3848. this.rotationAcceleration.set(0, 0),
  3849. this.panSpeed.set(0, 0),
  3850. this.panAcceleration.set(0, 0)
  3851. }
  3852. ,
  3853. n.prototype.toJSON = function() {
  3854. return {
  3855. camera_position: {
  3856. x: s.toPrecision(this.camera.position.x, 4),
  3857. y: s.toPrecision(this.camera.position.y, 4),
  3858. z: s.toPrecision(this.camera.position.z, 4)
  3859. },
  3860. camera_quaternion: {
  3861. x: s.toPrecision(this.camera.quaternion.x, 4),
  3862. y: s.toPrecision(this.camera.quaternion.y, 4),
  3863. z: s.toPrecision(this.camera.quaternion.z, 4),
  3864. w: s.toPrecision(this.camera.quaternion.w, 4)
  3865. }
  3866. }
  3867. }
  3868. ,
  3869. t.exports = n
  3870. }
  3871. , {
  3872. "../enum/ControlActions": 20,
  3873. "../enum/ControlEvents": 21,
  3874. "../enum/Keys": 30,
  3875. "../enum/MouseButton": 34,
  3876. "../enum/Vectors": 50,
  3877. "../settings": 166,
  3878. "../util/common": 185,
  3879. "../util/math": 190,
  3880. events: 202,
  3881. three: 217
  3882. }],
  3883. 13: [function(u, d, e) {
  3884. (function(e) {
  3885. "use strict";
  3886. function t(e) {
  3887. this.camera = e,
  3888. (this.camera.controls = this).target = new s.Vector3(0,0,0),
  3889. this.lookVector = new s.Vector3,
  3890. this.lookSpeed = .05,
  3891. this.rotationAcc = new s.Vector2,
  3892. this.rotationSpeed = new s.Vector2,
  3893. this.lat = 0,
  3894. this.lon = 0,
  3895. this.phi = 0,
  3896. this.theta = 0,
  3897. this.enabled = !1,
  3898. this.locked = !1,
  3899. this.pointer = new s.Vector2(0,0),
  3900. this.rotationHistory = [],
  3901. this.rotationDifference = new s.Vector2,
  3902. this.pointerDragOn = !1,
  3903. this.pointerDragStart = new s.Vector2(0,0),
  3904. this.pinchDistance = 0,
  3905. this.moveStart = new s.Vector2,
  3906. this.moveTolerance = .01,
  3907. this.pointersLimit = 2,
  3908. this.pointers = []
  3909. }
  3910. var s = u("three")
  3911. , i = u("../util/logger")
  3912. , n = u("../settings")
  3913. , r = u("../util/common")
  3914. , o = u("../util/math")
  3915. , a = (u("../enum/Vectors"),
  3916. u("../enum/MouseButton"))
  3917. , l = u("../enum/Keys")
  3918. , c = u("../enum/ControlEvents")
  3919. , h = u("events").EventEmitter;
  3920. new i(e),
  3921. (t.prototype = Object.create(h.prototype)).usable = function() {
  3922. return this.enabled && !this.locked
  3923. }
  3924. ,
  3925. t.prototype.lookAt = function(e) {
  3926. var t = this.camera.position.clone().sub(e)
  3927. , i = Math.atan(t.z / t.x);
  3928. i += t.x < 0 ? Math.PI : 0,
  3929. i += 0 < t.x && t.z < 0 ? 2 * Math.PI : 0,
  3930. this.lon = s.Math.radToDeg(i) + 180;
  3931. var n = Math.sqrt(t.x * t.x + t.z * t.z)
  3932. , r = Math.atan(t.y / n);
  3933. this.lat = -s.Math.radToDeg(r)
  3934. }
  3935. ,
  3936. t.prototype.startRotationFrom = function(e, t) {
  3937. o.convertScreenPositionToNDC(e, t, this.pointer),
  3938. this.pointerDragOn = !0,
  3939. this.pointerDragStart.copy(this.pointer),
  3940. this.moveStart.copy(this.pointer),
  3941. this.rotationHistory = [],
  3942. this.rotationSpeed.set(0, 0)
  3943. }
  3944. ,
  3945. t.prototype.onMouseOver = function(e) {
  3946. !this.pointerDragOn || 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  3947. }
  3948. ,
  3949. t.prototype.onTouchStart = function(e) {
  3950. if (this.usable()) {
  3951. switch (e.preventDefault(),
  3952. e.stopPropagation(),
  3953. e.touches.length) {
  3954. case 1:
  3955. this.startRotationFrom(e.touches[0].clientX, e.touches[0].clientY);
  3956. break;
  3957. case 2:
  3958. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  3959. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height();
  3960. this.pinchDistance = Math.sqrt(t * t + i * i)
  3961. }
  3962. this.emit(c.InputStart, "touch")
  3963. }
  3964. }
  3965. ,
  3966. t.prototype.onPointerDown = function(e) {
  3967. this.usable() && "touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  3968. id: e.pointerId,
  3969. clientX: e.clientX,
  3970. clientY: e.clientY
  3971. }),
  3972. e.touches = this.pointers,
  3973. this.onTouchStart(e),
  3974. this.emit(c.InputStart, "pointer"))
  3975. }
  3976. ,
  3977. t.prototype.onMouseDown = function(e) {
  3978. if (this.usable()) {
  3979. switch (e.preventDefault(),
  3980. e.stopPropagation(),
  3981. e.button) {
  3982. case a.LEFT:
  3983. this.startRotationFrom(e.clientX, e.clientY)
  3984. }
  3985. this.emit(c.InputStart, "mouse")
  3986. }
  3987. }
  3988. ,
  3989. t.prototype.updateRotation = function() {
  3990. if (this.usable() && this.pointerDragOn) {
  3991. var e = new s.Vector3(this.pointerDragStart.x,this.pointerDragStart.y,-1).unproject(this.camera)
  3992. , t = new s.Vector3(this.pointer.x,this.pointer.y,-1).unproject(this.camera)
  3993. , i = Math.sqrt(e.x * e.x + e.z * e.z)
  3994. , n = Math.sqrt(t.x * t.x + t.z * t.z)
  3995. , r = Math.atan2(e.y, i)
  3996. , o = Math.atan2(t.y, n);
  3997. this.rotationDifference.y = s.Math.radToDeg(r - o),
  3998. e.y = 0,
  3999. t.y = 0;
  4000. var a = Math.acos(e.dot(t) / e.length() / t.length());
  4001. isNaN(a) || (this.rotationDifference.x = s.Math.radToDeg(a),
  4002. this.pointerDragStart.x < this.pointer.x && (this.rotationDifference.x *= -1)),
  4003. this.pointerDragStart.copy(this.pointer)
  4004. }
  4005. }
  4006. ,
  4007. t.prototype.onMouseMove = function(e) {
  4008. this.usable() && (o.convertScreenPositionToNDC(e.clientX, e.clientY, this.pointer),
  4009. 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"))
  4010. }
  4011. ,
  4012. t.prototype.onTouchMove = function(e) {
  4013. if (this.usable())
  4014. switch (this.emit(c.Move, "touch"),
  4015. e.touches.length) {
  4016. case 1:
  4017. o.convertScreenPositionToNDC(e.touches[0].clientX, e.touches[0].clientY, this.pointer);
  4018. break;
  4019. case 2:
  4020. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  4021. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height()
  4022. , n = this.pinchDistance - Math.sqrt(t * t + i * i);
  4023. .01 < Math.abs(n) && (this.emit(c.InteractionDirect),
  4024. this.emit(c.Pinch, n),
  4025. this.pinchDistance -= n)
  4026. }
  4027. }
  4028. ,
  4029. t.prototype.onPointerMove = function(t) {
  4030. this.usable() && "touch" === t.pointerType && (this.pointers.forEach(function(e) {
  4031. t.pointerId === e.id && (e.clientX = t.clientX,
  4032. e.clientY = t.clientY)
  4033. }),
  4034. t.touches = this.pointers,
  4035. this.onTouchMove(t))
  4036. }
  4037. ,
  4038. t.prototype.endRotation = function() {
  4039. this.pointerDragOn = !1;
  4040. var e = r.averageVectors(this.rotationHistory);
  4041. this.rotationSpeed.set(e.x * n.rotationAfterMoveMultiplier, e.y * n.rotationAfterMoveMultiplier)
  4042. }
  4043. ,
  4044. t.prototype.onTouchEnd = function(e) {
  4045. this.usable() && (e.preventDefault(),
  4046. e.stopPropagation(),
  4047. this.endRotation())
  4048. }
  4049. ,
  4050. t.prototype.onMouseUp = function(e) {
  4051. this.usable() && (e.preventDefault(),
  4052. e.stopPropagation(),
  4053. this.endRotation())
  4054. }
  4055. ,
  4056. t.prototype.onPointerUp = function(i) {
  4057. this.usable() && "touch" === i.pointerType && (this.pointers.forEach(function(e, t) {
  4058. i.pointerId === e.id && this.pointers.splice(t, 1)
  4059. }
  4060. .bind(this)),
  4061. i.touches = this.pointers,
  4062. this.onTouchEnd(i))
  4063. }
  4064. ,
  4065. t.prototype.update = function(e) {
  4066. for (this.lon,
  4067. this.lat,
  4068. this.updateRotation(),
  4069. this.rotationHistory.push(this.rotationDifference.clone()); this.rotationHistory.length > n.rotationAfterMoveHistoryCount; )
  4070. this.rotationHistory.shift();
  4071. this.lon += this.rotationDifference.x,
  4072. this.lat += this.rotationDifference.y,
  4073. this.rotationDifference.set(0, 0),
  4074. this.rotationSpeed.x = this.rotationSpeed.x * (1 - n.rotationFriction) + this.rotationAcc.x * n.rotationAccelerationInside,
  4075. this.rotationSpeed.y = this.rotationSpeed.y * (1 - n.rotationFriction) + this.rotationAcc.y * n.rotationAccelerationInside,
  4076. this.lon += this.rotationSpeed.x * e,
  4077. this.lat += this.rotationSpeed.y * e,
  4078. this.lat = Math.max(n.insideLookLimitDown, Math.min(n.insideLookLimitUp, this.lat)),
  4079. this.phi = s.Math.degToRad(90 - this.lat),
  4080. this.theta = s.Math.degToRad(this.lon),
  4081. this.lookVector.x = Math.sin(this.phi) * Math.cos(this.theta),
  4082. this.lookVector.y = Math.cos(this.phi),
  4083. this.lookVector.z = Math.sin(this.phi) * Math.sin(this.theta),
  4084. this.target.copy(this.lookVector).add(this.camera.position),
  4085. this.camera.lookAt(this.target)
  4086. }
  4087. ,
  4088. t.prototype.onMouseWheel = function(e) {
  4089. if (this.usable()) {
  4090. var t = e.wheelDelta || -e.detail;
  4091. this.emit(c.InteractionDirect),
  4092. this.emit(c.Scroll, t)
  4093. }
  4094. }
  4095. ,
  4096. t.prototype.onKeyDown = function(e) {
  4097. this.usable() && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  4098. this.handleKeyDown(e.which)))
  4099. }
  4100. ,
  4101. t.prototype.handleKeyDown = function(e) {
  4102. var t = function(e, t) {
  4103. this.rotationAcc[e] = t
  4104. }
  4105. .bind(this);
  4106. this.emit(c.InteractionKey);
  4107. var i = !0;
  4108. switch (e) {
  4109. case l.LEFTARROW:
  4110. case l.J:
  4111. t("x", -1);
  4112. break;
  4113. case l.RIGHTARROW:
  4114. case l.L:
  4115. t("x", 1);
  4116. break;
  4117. case l.I:
  4118. t("y", 1);
  4119. break;
  4120. case l.K:
  4121. t("y", -1);
  4122. break;
  4123. default:
  4124. i = !1
  4125. }
  4126. i && this.emit(c.Move, "key")
  4127. }
  4128. ,
  4129. t.prototype.onKeyUp = function(e) {
  4130. this.usable() && (e.preventDefault(),
  4131. e.stopPropagation(),
  4132. this.handleKeyUp(e.which))
  4133. }
  4134. ,
  4135. t.prototype.handleKeyUp = function(e) {
  4136. switch (e) {
  4137. case l.LEFTARROW:
  4138. case l.J:
  4139. case l.RIGHTARROW:
  4140. case l.L:
  4141. this.rotationAcc.x = 0;
  4142. break;
  4143. case l.I:
  4144. case l.K:
  4145. this.rotationAcc.y = 0
  4146. }
  4147. }
  4148. ,
  4149. t.prototype.startRotating = function(e, t) {
  4150. e && (this.rotationAcc.x = e),
  4151. t && (this.rotationAcc.y = t)
  4152. }
  4153. ,
  4154. t.prototype.stopRotating = function(e) {
  4155. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  4156. this.rotationAcc.set(0, 0)
  4157. }
  4158. ,
  4159. t.prototype.reset = function() {
  4160. this.pointerDragOn = !1,
  4161. this.rotationAcc.set(0, 0),
  4162. this.rotationSpeed.set(0, 0),
  4163. this.pointers = []
  4164. }
  4165. ,
  4166. t.prototype.toJSON = function() {
  4167. return {
  4168. camera_position: {
  4169. x: o.toPrecision(this.camera.position.x, 4),
  4170. y: o.toPrecision(this.camera.position.y, 4),
  4171. z: o.toPrecision(this.camera.position.z, 4)
  4172. },
  4173. camera_quaternion: {
  4174. x: o.toPrecision(this.camera.quaternion.x, 4),
  4175. y: o.toPrecision(this.camera.quaternion.y, 4),
  4176. z: o.toPrecision(this.camera.quaternion.z, 4),
  4177. w: o.toPrecision(this.camera.quaternion.w, 4)
  4178. }
  4179. }
  4180. }
  4181. ,
  4182. t.prototype.setStateFromJSON = function(e) {
  4183. this.camera.position.copy(e.camera_position),
  4184. this.camera.quaternion.copy(e.camera_quaternion)
  4185. }
  4186. ,
  4187. d.exports = t
  4188. }
  4189. ).call(this, "/js/controls/PanoramaControls.js")
  4190. }
  4191. , {
  4192. "../enum/ControlEvents": 21,
  4193. "../enum/Keys": 30,
  4194. "../enum/MouseButton": 34,
  4195. "../enum/Vectors": 50,
  4196. "../settings": 166,
  4197. "../util/common": 185,
  4198. "../util/logger": 189,
  4199. "../util/math": 190,
  4200. events: 202,
  4201. three: 217
  4202. }],
  4203. 14: [function(t, i, e) {
  4204. (function(e) {
  4205. "use strict";
  4206. var c = t("three")
  4207. , h = t("../enum/Viewmode")
  4208. , u = new (t("../util/logger"))(e);
  4209. i.exports = {
  4210. serialize: function(e) {
  4211. return encodeURI(JSON.stringify(e))
  4212. },
  4213. deserialize: function(e) {
  4214. function t(e) {
  4215. return e.reduce(function(e, t) {
  4216. return e && "number" == typeof t && !isNaN(t)
  4217. }, !0)
  4218. }
  4219. try {
  4220. var i = JSON.parse(decodeURI(e))
  4221. , n = {
  4222. mode: h.fromInt(i.camera_mode),
  4223. panoId: i.scan_id,
  4224. position: (new c.Vector3).copy(i.camera_position),
  4225. quaternion: (new c.Quaternion).copy(i.camera_quaternion),
  4226. zoom: i.ortho_zoom,
  4227. floorVisibility: i.floor_visibility
  4228. }
  4229. , r = n.position;
  4230. t([r.x, r.y, r.z]) || n.position.set(0, 0, 0);
  4231. var o = n.quaternion;
  4232. return t([o.x, o.y, o.z, o.w]) || n.quaternion.set(0, 0, 0, 1),
  4233. n
  4234. } catch (i) {
  4235. u.debug("Not able to parse start location as JSON; falling back to old array style parsing");
  4236. try {
  4237. var a = e.split(",")
  4238. , s = {
  4239. x: parseFloat(a[2]),
  4240. y: parseFloat(a[3]),
  4241. z: parseFloat(a[4])
  4242. }
  4243. , l = {
  4244. x: parseFloat(a[5]),
  4245. y: parseFloat(a[6]),
  4246. z: parseFloat(a[7]),
  4247. w: parseFloat(a[8])
  4248. };
  4249. return t([s.x, s.y, s.z]) || (s.x = 0,
  4250. s.y = 0,
  4251. s.z = 0),
  4252. t([l.x, l.y, l.z, l.w]) || (l.x = 0,
  4253. l.y = 0,
  4254. l.z = 0,
  4255. l.w = 1),
  4256. {
  4257. mode: h.fromInt(a[0]),
  4258. panoId: a[1],
  4259. position: (new c.Vector3).copy(s),
  4260. quaternion: (new c.Quaternion).copy(l)
  4261. }
  4262. } catch (t) {
  4263. u.warn('Invalid start override, ignoring: "' + e + '"', t.message)
  4264. }
  4265. }
  4266. return null
  4267. }
  4268. }
  4269. }
  4270. ).call(this, "/js/controls/serializer.js")
  4271. }
  4272. , {
  4273. "../enum/Viewmode": 51,
  4274. "../util/logger": 189,
  4275. three: 217
  4276. }],
  4277. 15: [function(C, I, e) {
  4278. (function(e) {
  4279. "use strict";
  4280. function t() {
  4281. this.endlessLoop = r.warp.loop,
  4282. this.clock = new i.Clock(!0),
  4283. this.model = null,
  4284. this.player = null,
  4285. this.currentItem = null,
  4286. this.destinationItem = null,
  4287. this.tourIsPlaying = !1,
  4288. this.transitionStage = v.None,
  4289. this.nextFunc = null,
  4290. this.onTheBus = !1,
  4291. this.tourInProgress = !1,
  4292. this.reachSource = null,
  4293. this.interrupted = !1,
  4294. this.nItems = 0,
  4295. this.walkingSectionPaused = !1
  4296. }
  4297. var i = C("three")
  4298. , n = C("./util/logger")
  4299. , r = C("./settings")
  4300. , o = C("./util/transitions")
  4301. , a = C("events").EventEmitter
  4302. , s = C("./enum/Viewmode")
  4303. , l = C("./analytics")
  4304. , c = C("./enum/WarpStyle")
  4305. , h = (o = C("./util/transitions"),
  4306. C("./model/ModelManager"),
  4307. C("./enum/ModelManagerEvents"))
  4308. , u = C("./enum/DirectorEvents")
  4309. , d = C("./enum/PlayerEvents")
  4310. , p = (C("./enum/ControlEvents"),
  4311. C("./enum/BlackoutStyle"))
  4312. , f = C("./enum/PathDiscardMode")
  4313. , g = C("./enum/PathDisplayMode")
  4314. , m = (C("./player"),
  4315. new n(e))
  4316. , v = Object.freeze({
  4317. None: 0,
  4318. Moving: 1,
  4319. Aiming: 2,
  4320. Interlude: 3
  4321. })
  4322. , y = Object.freeze({
  4323. Forward: 1,
  4324. NoChange: 0,
  4325. Backwards: -1
  4326. })
  4327. , A = o.getUniqueId();
  4328. (t.prototype = Object.create(a.prototype)).init = function(e, t) {
  4329. this.player = e,
  4330. this.modelManager = t,
  4331. this.updateModel(),
  4332. this.resetAll(),
  4333. this.bindEvents()
  4334. }
  4335. ,
  4336. t.prototype.resetAll = function() {
  4337. if (this.currentItem = null,
  4338. this.destinationItem = null,
  4339. this.tourIsPlaying = !1,
  4340. this.bgmReplay(),
  4341. this.transitionStage = v.None,
  4342. this.nextFunc = null,
  4343. this.onTheBus = !1,
  4344. this.reachSource = null,
  4345. this.interrupted = !1,
  4346. this.model) {
  4347. var e = r.path.typ === c.WALK ? c.WALK : c.STD;
  4348. this.defaultWarpStyle = this.model.data.hasOwnProperty("player_options") && this.model.data.player_options && !1 === this.model.data.player_options.fast_transitions ? e : c.BLACK
  4349. } else
  4350. this.defaultWarpStyle = c.BLACK,
  4351. m.warn('No model yet, choosing "' + this.defaultWarpStyle + '" transitions');
  4352. this.resetSpecialTransition()
  4353. }
  4354. ,
  4355. t.prototype.updateModel = function() {
  4356. this.model = this.modelManager.getActiveModel(),
  4357. this.nItems = this.model.heroLocations.length
  4358. }
  4359. ,
  4360. t.prototype.bindEvents = function() {
  4361. this.modelManager.on(h.ActiveModelChanged, this.updateModel.bind(this)),
  4362. this.player.on(d.WarpInterruptedWithFlyTo, this.checkAndHandleWalkingtourInterruption.bind(this)),
  4363. this.player.on(d.Move, this.handlePlayerMove.bind(this)),
  4364. this.player.on(d.PanoChosen, this.handlePlayerPanoChosen.bind(this)),
  4365. this.player.on(d.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  4366. this.player.on(d.InputStart, this.handlePlayerInputStart.bind(this)),
  4367. this.player.on(d.FlyingStarted, this.handlePlayerFlyingStarted.bind(this)),
  4368. this.player.once(d.Move, function() {
  4369. o.cancelById(A)
  4370. })
  4371. }
  4372. ,
  4373. t.prototype.checkAndHandleWalkingtourInterruption = function(e) {
  4374. return e === c.WALK && (this.interrupt(p.NONE),
  4375. this.pauseWalkingSection(),
  4376. this.player.fastForwardActivePanoFlight(),
  4377. !0)
  4378. }
  4379. ,
  4380. t.prototype.handlePlayerMove = function(e) {
  4381. this.transitionStage === v.Interlude && this.interrupt(p.NONE),
  4382. this.emit("update.controls")
  4383. }
  4384. ,
  4385. t.prototype.handlePlayerPanoChosen = function(e, t) {
  4386. this.intermediateState() || e.id === t.id || (this.onTheBus = !1,
  4387. this.emit("update.controls"))
  4388. }
  4389. ,
  4390. t.prototype.handlePlayerModeChanged = function(e, t) {
  4391. this.intermediateState() || e === t || (this.onTheBus = !1,
  4392. this.emit("update.controls"))
  4393. }
  4394. ,
  4395. t.prototype.handlePlayerInputStart = function(e) {
  4396. this.transitionStage === v.Interlude && this.interrupt(p.NONE)
  4397. }
  4398. ,
  4399. t.prototype.handlePlayerFlyingStarted = function() {
  4400. this.clearWalkingSectionPaused()
  4401. }
  4402. ,
  4403. t.prototype.describe = function() {
  4404. return {
  4405. nItems: this.nItems,
  4406. currentItem: this.currentItem,
  4407. destinationItem: this.destinationItem,
  4408. tourIsPlaying: this.tourIsPlaying,
  4409. onTheBus: this.onTheBus,
  4410. endlessLoop: this.endlessLoop,
  4411. viewMode: this.player.mode,
  4412. inTransition: this._inTransition(),
  4413. transitionStage: this.transitionStage,
  4414. tourInProgress: this.tourInProgress
  4415. }
  4416. }
  4417. ,
  4418. t.prototype._inTransition = function() {
  4419. return this.player.flying || this.player.isWarping() || this.player.isWaitingToWarp() || this.player.mode === s.TRANSITIONING || this.tourIsPlaying
  4420. }
  4421. ,
  4422. t.prototype.bounceable = function() {
  4423. var e = this.clock.getDelta();
  4424. return this.isInterrupted() || e < .9 && .01 < e || this.player.flying && !this.player.isWarping()
  4425. }
  4426. ,
  4427. t.prototype.currentMoveDirection = function() {
  4428. return null === this.currentItem || void 0 === this.currentItem ? y.Forward : this.destinationItem === this.currentItem ? y.NoChange : this.destinationItem > this.currentItem ? y.Forward : y.Backwards
  4429. }
  4430. ,
  4431. t.prototype.clearPath = function() {
  4432. this._inTransition() || this.player.path.discardPathObject()
  4433. }
  4434. ,
  4435. t.prototype.allFloors = function() {
  4436. this.model.toggleAllFloors()
  4437. }
  4438. ,
  4439. t.prototype.actionComplete = function(e) {
  4440. if (this.interrupted = !1,
  4441. this.transitionStage = v.None,
  4442. this.resetSpecialTransition(),
  4443. null !== this.destinationItem && this.setCurrentItem(this.destinationItem),
  4444. this.tourIsPlaying || (this.player.disablePreRendering(),
  4445. this.player.mode === s.PANORAMA && this.player.currentPano.isAligned() && this.model.fadePanoMarkers()),
  4446. this.emit("update.controls"),
  4447. this.nextFunc) {
  4448. var t = this.nextFunc;
  4449. this.nextFunc = null,
  4450. t()
  4451. }
  4452. }
  4453. ,
  4454. t.prototype.awaitCompletion = function(e, t) {
  4455. this.nextFunc = t,
  4456. e()
  4457. }
  4458. ,
  4459. t.prototype.updateSuccessFunction = function(e) {
  4460. this.nextFunc = e
  4461. }
  4462. ,
  4463. t.prototype.interrupt = function(e, t) {
  4464. return !!this.wouldInterrupt() && (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4465. this.tourIsPlaying = !1,
  4466. this.bgmReplay(),
  4467. this.interrupted = !0,
  4468. this.nextFunc = null,
  4469. this.emit(u.ActionInterrupted),
  4470. null != e || (e = p.BEGINNING),
  4471. this.player.interruptAndFastForward(e, t),
  4472. !0)
  4473. }
  4474. ,
  4475. t.prototype.wouldInterrupt = function() {
  4476. return this.transitionStage !== v.None
  4477. }
  4478. ,
  4479. t.prototype.intermediateState = function() {
  4480. return this.transitionStage !== v.None
  4481. }
  4482. ,
  4483. t.prototype.isInterrupted = function() {
  4484. return this.interrupted
  4485. }
  4486. ,
  4487. t.prototype.pauseWalkingSection = function() {
  4488. this.walkingSectionPaused = !0
  4489. }
  4490. ,
  4491. t.prototype.clearWalkingSectionPaused = function() {
  4492. this.walkingSectionPaused = !1
  4493. }
  4494. ,
  4495. t.prototype.autoTour = function() {
  4496. var i = Date.now();
  4497. this.model.auxDataPromise.then(function() {
  4498. i = Date.now() - i;
  4499. var e = r.warp.auto
  4500. , t = this.model.data && this.model.data.player_options/* && this.model.data.player_options.highlight_reel */;
  4501. 0 <= e && 1 < this.model.heroCount() && t && o.trigger({
  4502. duration: Math.max(1e3 * Math.min(300, e) - i, 0),
  4503. done: function() {
  4504. this.playTour()
  4505. }
  4506. .bind(this),
  4507. name: "_atr",
  4508. id: A
  4509. })
  4510. }
  4511. .bind(this))
  4512. }
  4513. ,
  4514. t.prototype.atDestinationPano = function() {
  4515. if (!this.player.currentPano || null === this.destinationItem)
  4516. return !1;
  4517. var e = this.player.currentPano.id;
  4518. if (void 0 === e)
  4519. return !1;
  4520. var t = this.model.heroLocations;
  4521. return null !== this.destinationItem && void 0 !== t[this.destinationItem] && e === t[this.destinationItem].panoId
  4522. }
  4523. ,
  4524. t.prototype.redirectToItem = function(e, t) {
  4525. if (null != e)
  4526. if (this.wouldInterrupt())
  4527. if (this.player.mode !== s.TRANSITIONING) {
  4528. m.debug("Director.redirectToItem() -> Redirecting to " + e + " via " + t);
  4529. var i = function() {
  4530. o.setTimeout(function() {
  4531. this.setDestinationItem(e),
  4532. this.goToDestination(!0, p.BEGINNING, r.warp.warpInterruptionRedirectTime, !1)
  4533. }
  4534. .bind(this), 0)
  4535. }
  4536. .bind(this);
  4537. this.interrupt(p.END, 0),
  4538. this.updateSuccessFunction(i)
  4539. } else
  4540. m.debug("Director.redirectToItem() -> Cannot redirect while transitioning.");
  4541. else
  4542. m.warn("Director.redirectToItem() -> Director cannot redirect if there is nothing to interrupt.");
  4543. else
  4544. m.warn("Director.redirectToItem() -> Redirecting to null item.")
  4545. }
  4546. ,
  4547. t.prototype.useSpecialTransition = function(e) {
  4548. void 0 !== e && this.defaultWarpStyle !== c.BLACK && m.debug("useSpecialTransition(): " + e),
  4549. this.nextWarpStyle = c.BLACK
  4550. }
  4551. ,
  4552. t.prototype.resetSpecialTransition = function() {
  4553. this.nextWarpStyle = this.defaultWarpStyle
  4554. }
  4555. ,
  4556. t.prototype.arrivedAtDestination = function(e) {
  4557. if (this.player.flying || this.player.isWarping())
  4558. m.warn("Cannot advance to interlude or aiming while player is flying or warping.");
  4559. else {
  4560. this.transitionStage = v.Aiming;
  4561. var t = this.tourIsPlaying ? this.tourInterlude.bind(this, this.nextItem(this.currentItem)) : null;
  4562. this.player.model.fadePanoMarkers(0),
  4563. this.awaitCompletion(function() {
  4564. this.resetSpecialTransition(),
  4565. e ? this.player.aimTourCamera(this.destinationItem, g.Retain, g.Slow, this.actionComplete.bind(this)) : this.actionComplete()
  4566. }
  4567. .bind(this), t)
  4568. }
  4569. }
  4570. ,
  4571. t.prototype.goToDestination = function(e, t, i, n) {
  4572. if (void 0 !== g_data2.tourAudio && null !== g_data2.tourAudio) {
  4573. var r = g_data2.tourAudio[this.model.heroLocations[this.destinationItem].sid];
  4574. if (r && 0 < r.music.length) {
  4575. var o = r.music.includes(g_Prefix.slice(-10)) ? r.music : g_Prefix + r.music;
  4576. g_tourAudio.src = manage.dealURL(o);
  4577. g_tourAudio.load(),
  4578. g_tourAudio.crossOrigin = "anonymous",
  4579. g_tourAudio.oncanplaythrough = function() {
  4580. g_tourAudio.play();
  4581. if(g_bgAudio && !g_bgAudio.paused){
  4582. manage.switchBgmState(false);
  4583. g_bgAudio.pauseByTour = true
  4584. }
  4585. g_playAudio = g_tourAudio;
  4586. }
  4587. }
  4588. }
  4589. if (this.onTheBus = !0,
  4590. this.emit("update.controls"),
  4591. this.player.updateLastView(),
  4592. n || !this.atDestinationPano())
  4593. if (this.player.flying || this.player.isWarping())
  4594. m.warn("Cannot go to new destination while player is flying or warping.");
  4595. else {
  4596. var a = this.model.getHeroDescriptorByIndex(this.destinationItem)
  4597. , s = null
  4598. , l = null;
  4599. if (a.isPano()) {
  4600. o = window.MP_PREFETCHED_MODELDATA.momentTour || "walk";
  4601. l = this.player.warpToPanoByHeroIndex.bind(this.player, this.destinationItem, g.Show, f.Slow, o, !0, i, this.actionComplete.bind(this)),
  4602. s = this.arrivedAtDestination.bind(this, !0)
  4603. } else
  4604. l = this.player.warpToNonPanoByHeroIndex.bind(this.player, this.destinationItem, this.actionComplete.bind(this)),
  4605. s = this.arrivedAtDestination.bind(this, !1);
  4606. this.transitionStage = v.Moving,
  4607. this.model.fadePanoMarkers(0),
  4608. this.awaitCompletion(function() {
  4609. l()
  4610. }
  4611. .bind(this), s),
  4612. this.emit("update.controls")
  4613. }
  4614. else
  4615. this.arrivedAtDestination(!0)
  4616. }
  4617. ,
  4618. t.prototype.tourInterlude = function() {
  4619. if (l.trackAlways("reach_highlight", {
  4620. reach_source: this.reachSource
  4621. }),
  4622. this.model.fadePanoMarkers(0),
  4623. this.emit("update.controls"),
  4624. this.tourIsPlaying)
  4625. return this.atEndOfTour() && !this.endlessLoop ? (this.tourInProgress = !1,
  4626. this.stopTour(),
  4627. this.emit(u.TourEnd),
  4628. void (this.player.mode === s.PANORAMA && this.model.fadePanoMarkers(r.panorama.markerOpacity))) : void this.awaitCompletion(function() {
  4629. this.transitionStage = v.Interlude,
  4630. this.player.tourInterlude(this.nextItem(this.currentItem), this.actionComplete.bind(this))
  4631. }
  4632. .bind(this), this.goNext.bind(this))
  4633. }
  4634. ,
  4635. t.prototype.playTour = function() {
  4636. if (!this.bounceable())
  4637. return this.tourIsPlaying ? void m.info("tour is already playing") : void (this.wouldInterrupt() || (this.player.emit("tour_auto", this.defaultWarpStyle),
  4638. this.tourInProgress = !0,
  4639. this.reachSource = "play",
  4640. this.tourIsPlaying = !0,
  4641. this.wasZoomEnabled = this.player.zoomEnabled,
  4642. this.player.zoomEnabled = !1,
  4643. this.resetSpecialTransition(),
  4644. this.emit("update.controls"),
  4645. this.emit(u.TourStart),
  4646. this.player.enablePreRendering(),
  4647. this.walkingSectionPaused ? (this.clearWalkingSectionPaused(),
  4648. this.goToDestination()) : this.goNext()))
  4649. }
  4650. ,
  4651. t.prototype.bgmReplay = function() {
  4652. if(g_bgAudio && g_bgAudio.paused && g_bgAudio.pauseByTour){
  4653. g_playAudio = g_bgAudio;
  4654. g_tourAudio && g_tourAudio.pause();
  4655. //window.tourAudio && window.tourAudio.pause();
  4656. manage.switchBgmState(true);
  4657. }
  4658. }
  4659. ,
  4660. t.prototype.stopTour = function(isAutoStop) {//停止导览 isAutoStop 希望仅在飞完结束自动停止时的stopTour不停止tourSound, 这样才能完整播放tourSound. 不过似乎会在倒数第二个片段点击按钮停止导览时也视作自动结束的(执行this.interrupt() )。
  4661. this.isInterrupted() || this.transitionStage === v.Moving && this.checkAndHandleWalkingtourInterruption(this.nextWarpStyle) || (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4662. this.tourIsPlaying = !1,
  4663. (!isAutoStop || g_tourAudio && g_tourAudio.paused )&&this.bgmReplay(),//xzw
  4664. this.interrupt(),
  4665. this.clearWalkingSectionPaused(),
  4666. this.resetSpecialTransition(),
  4667. this.emit("update.controls"))
  4668. if(!isAutoStop && g_tourAudio && g_tourAudio.paused == false )
  4669. {
  4670. g_tourAudio.pause();
  4671. g_tourAudio.src = ""
  4672. }
  4673. }
  4674. ,
  4675. t.prototype.endTourProgress = function() {
  4676. this.tourInProgress = !1,
  4677. this.emit("update.controls"),
  4678. this.emit(u.TourEnd)
  4679. }
  4680. ,
  4681. t.prototype.goToHighlight = function(e) {
  4682. if (this.wouldInterrupt())
  4683. e === this.destinationItem ? this.interrupt() : this.redirectToItem(e, "goToHighlight");
  4684. else {
  4685. if (m.debug("<tour.goto " + e + ">"),
  4686. this.isInterrupted())
  4687. return;
  4688. this.clearWalkingSectionPaused(),
  4689. this.setDestinationItem(e),
  4690. this.useSpecialTransition("Hilight"),
  4691. this.goToDestination(),
  4692. l.trackAlways("reach_highlight", {
  4693. reach_source: "thumb"
  4694. })
  4695. }
  4696. }
  4697. ,
  4698. t.prototype.prevHighlight = function() {
  4699. this.bounceable() || (this.player.emit("tour_manual", "prev"),
  4700. this.interrupt(p.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4701. this.reachSource = "prev",
  4702. this.goPrev()))
  4703. }
  4704. ,
  4705. t.prototype.nextHighlight = function() {
  4706. this.bounceable() || (this.player.emit("tour_manual", "next"),
  4707. this.interrupt(p.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4708. this.reachSource = "next",
  4709. this.goNext()))
  4710. }
  4711. ,
  4712. t.prototype.changeMode = function(e) {
  4713. var t = $.Deferred()
  4714. , i = t.resolve.bind(t)
  4715. , n = t.reject.bind(t);
  4716. if (this.emit(u.StartModeChange),
  4717. !function() {
  4718. return this.clearWalkingSectionPaused(),
  4719. !!this.wouldInterrupt() && (this.interrupt(),
  4720. !0)
  4721. }
  4722. .bind(this)()) {
  4723. switch (e) {
  4724. case s.PANORAMA:
  4725. 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);
  4726. break;
  4727. case s.DOLLHOUSE:
  4728. case s.FLOORPLAN:
  4729. this.player.flyToNewMode({
  4730. mode: e
  4731. }).done(i).fail(n);
  4732. break;
  4733. case s.OUTDOOR:
  4734. 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)
  4735. }
  4736. return t.promise()
  4737. }
  4738. }
  4739. ,
  4740. t.prototype.atEndOfTour = function() {
  4741. return this.currentItem >= this.nItems - 1
  4742. }
  4743. ,
  4744. t.prototype.firstDestination = function() {
  4745. return 0 < this.nItems ? 0 : null
  4746. }
  4747. ,
  4748. t.prototype.finalDestination = function() {
  4749. return 0 < this.nItems ? this.nItems - 1 : null
  4750. }
  4751. ,
  4752. t.prototype.goPrev = function() {
  4753. this.tourAdvance(-1)
  4754. }
  4755. ,
  4756. t.prototype.goNext = function() {
  4757. this.tourAdvance(1)
  4758. }
  4759. ,
  4760. t.prototype.setDestinationItem = function(e) {
  4761. this.destinationItem = e,
  4762. this.emit("update.controls")
  4763. }
  4764. ,
  4765. t.prototype.setCurrentItem = function(e) {
  4766. this.currentItem = e,
  4767. this.emit("update.controls")
  4768. }
  4769. ,
  4770. t.prototype.nextItem = function(e) {
  4771. return null === e ? this.firstDestination() : e >= this.nItems - 1 ? this.endlessLoop ? this.firstDestination() : null : e + 1
  4772. }
  4773. ,
  4774. t.prototype.prevItem = function(e) {
  4775. return null === e ? this.firstDestination() : e < 0 ? this.endlessLoop ? this.lastDestination() : null : e - 1
  4776. }
  4777. ,
  4778. t.prototype.tourAdvance = function(e) {
  4779. if (m.debug("tourAdvance(" + e + ")"),
  4780. null === this.currentItem || void 0 === this.currentItem ? this.setDestinationItem(this.firstDestination()) : this.setDestinationItem(this.currentItem + e),
  4781. this.destinationItem < 0 ? (this.setDestinationItem(this.finalDestination()),
  4782. this.useSpecialTransition("reverse-looping to end")) : this.destinationItem >= this.nItems && (this.setDestinationItem(this.firstDestination()),
  4783. this.useSpecialTransition("looping back to start")),
  4784. "black" === window.MP_PREFETCHED_MODELDATA.momentTour) {
  4785. var i = this.player.zoomLevel;
  4786. this.player.zoomEnabled = !0;
  4787. var t = function(e, t) {
  4788. this.player.zoomTo((1 - e) * i, !0)
  4789. }
  4790. .bind(this);
  4791. o.start(t, 1500, function() {}, 0, h.easeOutQuad, "zoom")
  4792. }
  4793. this.goToDestination()
  4794. }
  4795. ,
  4796. I.exports = t
  4797. }
  4798. ).call(this, "/js/director.js")
  4799. }
  4800. , {
  4801. "./analytics": 4,
  4802. "./enum/BlackoutStyle": 18,
  4803. "./enum/ControlEvents": 21,
  4804. "./enum/DirectorEvents": 23,
  4805. "./enum/ModelManagerEvents": 33,
  4806. "./enum/PathDiscardMode": 38,
  4807. "./enum/PathDisplayMode": 39,
  4808. "./enum/PlayerEvents": 40,
  4809. "./enum/Viewmode": 51,
  4810. "./enum/WarpStyle": 52,
  4811. "./model/ModelManager": 140,
  4812. "./player": 155,
  4813. "./settings": 166,
  4814. "./util/logger": 189,
  4815. "./util/transitions": 195,
  4816. events: 202,
  4817. three: 217
  4818. }],
  4819. 16: [function(e, t, i) {
  4820. "use strict";
  4821. var n = e("three")
  4822. , r = e("./enum/Viewmode")
  4823. , o = (e("./settings"),
  4824. e("./util/transitions"))
  4825. , a = e("./enum/PlayerEvents")
  4826. , s = new n.ShaderPass(n.HorizontalBlurShader)
  4827. , l = new n.ShaderPass(n.VerticalBlurShader);
  4828. l.renderToScreen = !0;
  4829. var c = $("#player").width() / $("#player").height();
  4830. isNaN(c) && (c = 1);
  4831. var h = {
  4832. currentBlur: 0,
  4833. aspect: c,
  4834. blurStrength: 1,
  4835. hblurPass: s,
  4836. vblurPass: l,
  4837. bindEvents: function(e) {
  4838. e.on(a.ModeChanged, function(e, t) {
  4839. e === r.PANORAMA && (o.cancel(h.blur),
  4840. o.cancel(h.addBlur),
  4841. o.start(h.removeBlur, 500, null, 0, null, "deblur"))
  4842. })
  4843. },
  4844. blur: function(e) {
  4845. var t = (h.currentBlur = e) * h.blurStrength;
  4846. l.uniforms.v.value = t / 512 * h.aspect,
  4847. s.uniforms.h.value = t / 512
  4848. },
  4849. addBlur: function(e) {
  4850. e = Math.max(e, h.currentBlur),
  4851. h.blur(e)
  4852. },
  4853. removeBlur: function(e) {
  4854. e = Math.min(1 - e, h.currentBlur),
  4855. h.blur(e)
  4856. }
  4857. };
  4858. h.blur(0),
  4859. t.exports = h
  4860. }
  4861. , {
  4862. "./enum/PlayerEvents": 40,
  4863. "./enum/Viewmode": 51,
  4864. "./settings": 166,
  4865. "./util/transitions": 195,
  4866. three: 217
  4867. }],
  4868. 17: [function(e, t, i) {
  4869. "use strict";
  4870. t.exports = {
  4871. UNKNOWN: 0,
  4872. ALIGNED: 1,
  4873. UNALIGNED: 2,
  4874. PLACED: 3
  4875. }
  4876. }
  4877. , {}],
  4878. 18: [function(e, t, i) {
  4879. "use strict";
  4880. t.exports = {
  4881. NONE: 0,
  4882. MIDDLE: 1,
  4883. END: 2,
  4884. BEGINNING: 3,
  4885. FADEIN: 4
  4886. }
  4887. }
  4888. , {}],
  4889. 19: [function(e, t, i) {
  4890. "use strict";
  4891. var r = e("three");
  4892. t.exports = {
  4893. newBlue: new r.Color(4967932),
  4894. altBlue: new r.Color(47355),
  4895. tagDefault: new r.Color(223357),
  4896. classicBlue: new r.Color(53759),
  4897. mpYellow: new r.Color(16502016),
  4898. mpOrange: new r.Color(16428055),
  4899. mpBlue: new r.Color(12096),
  4900. mpLtGrey: new r.Color(13751252),
  4901. mpDkGrey: new r.Color(10000019),
  4902. mpRed: new r.Color(12525854),
  4903. mpOrangeDesat: new r.Color(16764529),
  4904. mpBlueDesat: new r.Color(4034734),
  4905. mpRedDesat: new r.Color(14705505),
  4906. white: new r.Color(16777215),
  4907. black: new r.Color(0),
  4908. _desat: function(e, t) {
  4909. var i = t || .3
  4910. , n = (new r.Color).copy(e).getHSL();
  4911. return (new r.Color).setHSL(n.h, n.s * (1 - i), n.l)
  4912. },
  4913. _darken: function(e, t) {
  4914. var i = t || .2
  4915. , n = e.getHSL();
  4916. return (new r.Color).setHSL(n.h, n.s, n.l * (1 - i))
  4917. }
  4918. }
  4919. }
  4920. , {
  4921. three: 217
  4922. }],
  4923. 20: [function(e, t, i) {
  4924. "use strict";
  4925. t.exports = {
  4926. NONE: -1,
  4927. ROTATE: 0,
  4928. DOLLY: 1,
  4929. PAN: 2,
  4930. ROTATE_DOLLY: 3,
  4931. PAN_DOLLY: 4
  4932. }
  4933. }
  4934. , {}],
  4935. 21: [function(e, t, i) {
  4936. "use strict";
  4937. t.exports = {
  4938. Move: "move",
  4939. InteractionDirect: "interaction.direct",
  4940. InteractionKey: "interaction.key",
  4941. InteractionGui: "interaction.gui",
  4942. FlyInDirection: "fly.direction",
  4943. InputStart: "input.start",
  4944. Pinch: "input.pinch",
  4945. Scroll: "input.scroll",
  4946. AutoPanInterrupt: "autopan.interrupt",
  4947. AutoPanComplete: "autopan.complete",
  4948. AutoPanClamped: "autopan.clamped",
  4949. LongTap: "longtap"
  4950. }
  4951. }
  4952. , {}],
  4953. 22: [function(e, t, i) {
  4954. "use strict";
  4955. t.exports = Object.freeze({
  4956. FORWARD: "FORWARD",
  4957. LEFT: "LEFT",
  4958. RIGHT: "RIGHT",
  4959. BACK: "BACK",
  4960. UP: "UP",
  4961. DOWN: "DOWN"
  4962. })
  4963. }
  4964. , {}],
  4965. 23: [function(e, t, i) {
  4966. "use strict";
  4967. t.exports = {
  4968. ActionInterrupted: "action.interrupted",
  4969. TourStart: "tour.start",
  4970. TourEnd: "tour.end",
  4971. StartModeChange: "mode.startChange"
  4972. }
  4973. }
  4974. , {}],
  4975. 24: [function(e, t, i) {
  4976. "use strict";
  4977. t.exports = Object.freeze({
  4978. None: 0,
  4979. Queued: 1,
  4980. ForceQueued: 2,
  4981. Downloading: 3,
  4982. Downloaded: 4,
  4983. DownloadFailed: 5
  4984. })
  4985. }
  4986. , {}],
  4987. 25: [function(e, t, i) {
  4988. "use strict";
  4989. t.exports = {
  4990. GL_TEXTURE_CUBE_MAP_POSITIVE_X: 0,
  4991. GL_TEXTURE_CUBE_MAP_NEGATIVE_X: 1,
  4992. GL_TEXTURE_CUBE_MAP_POSITIVE_Y: 2,
  4993. GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: 3,
  4994. GL_TEXTURE_CUBE_MAP_POSITIVE_Z: 4,
  4995. GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: 5
  4996. }
  4997. }
  4998. , {}],
  4999. 26: [function(e, t, i) {
  5000. "use strict";
  5001. t.exports = {
  5002. Texture2D: 0,
  5003. TextureCube: 1
  5004. }
  5005. }
  5006. , {}],
  5007. 27: [function(e, t, i) {
  5008. "use strict";
  5009. t.exports = {
  5010. SMALL: "small",
  5011. LARGE: "large"
  5012. }
  5013. }
  5014. , {}],
  5015. 28: [function(e, t, i) {
  5016. "use strict";
  5017. var n = e("./Viewmode")
  5018. , r = {
  5019. LANDING: {},
  5020. NAVIGATION: "navigation",
  5021. MORE_HELP: "moreHelp",
  5022. TOUR_INTERACTION: {}
  5023. };
  5024. r.LANDING[n.PANORAMA] = "panorama.landing",
  5025. r.LANDING[n.OUTDOOR] = "outdoor.landing",
  5026. r.LANDING[n.DOLLHOUSE] = "dollhouse.landing",
  5027. r.LANDING[n.FLOORPLAN] = "floorplan.landing",
  5028. r.TOUR_INTERACTION.standard = "standard.tour",
  5029. r.TOUR_INTERACTION[n.OUTDOOR] = "outdoor.tour",
  5030. r.TOUR_INTERACTION[n.FLOORPLAN] = "floorplan.tour",
  5031. t.exports = r
  5032. }
  5033. , {
  5034. "./Viewmode": 51
  5035. }],
  5036. 29: [function(e, t, i) {
  5037. "use strict";
  5038. var n = {
  5039. UP: 1,
  5040. DOWN: -1,
  5041. LEFT: "L",
  5042. RIGHT: "R",
  5043. FORWARD: "F",
  5044. BACK: "B",
  5045. reverse: {},
  5046. opposite: function(e) {
  5047. return this.reverse[e.toString()]
  5048. }
  5049. };
  5050. n.reverse[n.UP] = n.DOWN,
  5051. n.reverse[n.DOWN] = n.UP,
  5052. n.reverse[n.LEFT] = n.RIGHT,
  5053. n.reverse[n.RIGHT] = n.LEFT,
  5054. n.reverse[n.FORWARD] = n.BACK,
  5055. n.reverse[n.BACK] = n.FORWARD,
  5056. t.exports = n
  5057. }
  5058. , {}],
  5059. 30: [function(e, t, i) {
  5060. "use strict";
  5061. var n = {
  5062. ZERO: 48,
  5063. ONE: 49,
  5064. TWO: 50,
  5065. THREE: 51,
  5066. FOUR: 52,
  5067. FIVE: 53,
  5068. SIX: 54,
  5069. SEVEN: 55,
  5070. EIGHT: 56,
  5071. NINE: 57,
  5072. LEFTARROW: 37,
  5073. UPARROW: 38,
  5074. RIGHTARROW: 39,
  5075. DOWNARROW: 40,
  5076. A: 65,
  5077. B: 66,
  5078. C: 67,
  5079. D: 68,
  5080. E: 69,
  5081. F: 70,
  5082. G: 71,
  5083. H: 72,
  5084. I: 73,
  5085. J: 74,
  5086. K: 75,
  5087. L: 76,
  5088. M: 77,
  5089. N: 78,
  5090. O: 79,
  5091. P: 80,
  5092. Q: 81,
  5093. R: 82,
  5094. S: 83,
  5095. T: 84,
  5096. U: 85,
  5097. V: 86,
  5098. W: 87,
  5099. X: 88,
  5100. Y: 89,
  5101. Z: 90,
  5102. SPACE: 32,
  5103. RETURN: 13,
  5104. SEMICOLON: 186,
  5105. PLUSEQUALS: 187,
  5106. DASHUNDERSCORE: 189,
  5107. OPENBRACKET: 219
  5108. };
  5109. e("../util/browser").detectFirefox() && (n.SEMICOLON = 59,
  5110. n.PLUSEQUALS = 61,
  5111. n.DASHUNDERSCORE = 173),
  5112. t.exports = n
  5113. }
  5114. , {
  5115. "../util/browser": 182
  5116. }],
  5117. 31: [function(e, t, i) {
  5118. "use strict";
  5119. t.exports = {
  5120. EN_US: "en-US",
  5121. ES_MX: "es-MX",
  5122. FR_FR: "fr-FR",
  5123. DE_DE: "de-DE",
  5124. RU_RU: "ru-RU",
  5125. CN_CN: "cn-CN",
  5126. JP_JP: "jp-JP"
  5127. }
  5128. }
  5129. , {}],
  5130. 32: [function(e, t, i) {
  5131. "use strict";
  5132. t.exports = {
  5133. TagActivated: "tag.activated",
  5134. TagDismissed: "tag.dismissed",
  5135. TagNavigation: "tag.navigation"
  5136. }
  5137. }
  5138. , {}],
  5139. 33: [function(e, t, i) {
  5140. "use strict";
  5141. t.exports = {
  5142. ModelAdded: "model-added",
  5143. ActiveModelChanged: "active-model-changed"
  5144. }
  5145. }
  5146. , {}],
  5147. 34: [function(e, t, i) {
  5148. "use strict";
  5149. t.exports = {
  5150. LEFT: 0,
  5151. MIDDLE: 1,
  5152. RIGHT: 2
  5153. }
  5154. }
  5155. , {}],
  5156. 35: [function(e, t, i) {
  5157. "use strict";
  5158. t.exports = {
  5159. PanoRenderComplete: "panorama.render.complete",
  5160. TileRenderFailure: "panorama.tile.render.failed",
  5161. TileRenderSuccess: "panorama.tile.render.success",
  5162. TileUploadAttempted: "panorama.tile.upload.attempted",
  5163. UploadAttemptedForAllTiles: "panorama.upload.attempted.all.tiles",
  5164. ZoomLevelRenderStarted: "panorama.zoom.render.started"
  5165. }
  5166. }
  5167. , {}],
  5168. 36: [function(e, t, i) {
  5169. "use strict";
  5170. t.exports = {
  5171. BASE: 1,
  5172. STANDARD: 2,
  5173. HIGH: 3,
  5174. ULTRAHIGH: 4
  5175. }
  5176. }
  5177. , {}],
  5178. 37: [function(e, t, i) {
  5179. "use strict";
  5180. t.exports = {
  5181. LoadComplete: "panorama.load.complete",
  5182. LoadFailed: "panorama.load.failed",
  5183. TileLoaded: "panorama.tile.loaded"
  5184. }
  5185. }
  5186. , {}],
  5187. 38: [function(e, t, i) {
  5188. "use strict";
  5189. t.exports = Object.freeze({
  5190. Standard: 0,
  5191. Slow: 1,
  5192. Retain: 2
  5193. })
  5194. }
  5195. , {}],
  5196. 39: [function(e, t, i) {
  5197. "use strict";
  5198. t.exports = Object.freeze({
  5199. Show: 0,
  5200. Hide: 1,
  5201. Retain: 2
  5202. })
  5203. }
  5204. , {}],
  5205. 40: [function(e, t, i) {
  5206. "use strict";
  5207. t.exports = {
  5208. Move: "move",
  5209. MoveComplete: "move.complete",
  5210. ModeChanged: "mode.changed",
  5211. ModeChanging: "mode.changing",
  5212. PanoChosen: "pano.chosen",
  5213. ClosestPanoChanging: "closest.pano.changing",
  5214. WarpStarted: "warp.started",
  5215. WarpInterrupted: "warp.interrupted",
  5216. WarpEnded: "warp.ended",
  5217. FlyinFinished: "flyin.finished",
  5218. FlyingStarted: "flying.started",
  5219. FlyingInterrupted: "flying.interrupted",
  5220. FlyingEnded: "flying.ended",
  5221. Ready: "ready",
  5222. StartInside: "start.inside",
  5223. StartOutside: "start.outside",
  5224. ViewChanged: "view.changed",
  5225. WarpInterruptedWithFlyTo: "warp.interrupted.flyto",
  5226. InputStart: "input.start"
  5227. }
  5228. }
  5229. , {}],
  5230. 41: [function(e, t, i) {
  5231. "use strict";
  5232. t.exports = Object.freeze({
  5233. DEFAULT: 0,
  5234. PANOMARKERS: 1,
  5235. RETICULE: 2,
  5236. TAG: 3
  5237. })
  5238. }
  5239. , {}],
  5240. 42: [function(e, t, i) {
  5241. "use strict";
  5242. t.exports = {
  5243. visibleFloor: 1,
  5244. ghostFloor: 3,
  5245. boundingSkybox: 1,
  5246. panoMarker: 2,
  5247. reticule: 3,
  5248. tagStem: 4,
  5249. tagDisc: 5,
  5250. ribbon: 100
  5251. }
  5252. }
  5253. , {}],
  5254. 43: [function(e, t, i) {
  5255. "use strict";
  5256. t.exports = {
  5257. ContextCreated: "scene-renderer-context-created",
  5258. AfterRender: "after-render",
  5259. MemoryUsageUpdated: "scene-renderer-memory-usage-updated"
  5260. }
  5261. }
  5262. , {}],
  5263. 44: [function(e, t, i) {
  5264. "use strict";
  5265. t.exports = {
  5266. IDLE: "idle",
  5267. BROWSE: "browse",
  5268. EXAMINE: "examine"
  5269. }
  5270. }
  5271. , {}],
  5272. 45: [function(e, t, i) {
  5273. "use strict";
  5274. t.exports = {
  5275. TileDownloadSuccess: "tiledownloader.download.success",
  5276. TileDownloadFailure: "tiledownloader.download.failure",
  5277. PanoDownloadComplete: "tiledownloader.pano.download.complete"
  5278. }
  5279. }
  5280. , {}],
  5281. 46: [function(e, t, i) {
  5282. "use strict";
  5283. t.exports = {
  5284. CardboardAndroid: "googlevr",
  5285. GearVR: "gearvr",
  5286. CardboardIOS: "googlevrios",
  5287. Cardboard: "googlevr"
  5288. }
  5289. }
  5290. , {}],
  5291. 47: [function(e, t, i) {
  5292. "use strict";
  5293. t.exports = {
  5294. NONE: 0,
  5295. CONTEXTUAL: 1,
  5296. ANDROID: 2
  5297. }
  5298. }
  5299. , {}],
  5300. 48: [function(e, t, i) {
  5301. "use strict";
  5302. var n = {
  5303. Title: 0,
  5304. Cardboard: 1
  5305. }
  5306. , r = {
  5307. Title: 0,
  5308. Cardboard: 1,
  5309. Gear: 2
  5310. };
  5311. [n, r].forEach(function(e) {
  5312. e.pageCount = Object.keys(e).length
  5313. }),
  5314. t.exports.ios = n,
  5315. t.exports.standard = r
  5316. }
  5317. , {}],
  5318. 49: [function(e, t, i) {
  5319. "use strict";
  5320. t.exports = {
  5321. Android: "android",
  5322. IOS: "ios",
  5323. Desktop: "desktop",
  5324. UnsupportedAndroid: "android-unsupported"
  5325. }
  5326. }
  5327. , {}],
  5328. 50: [function(e, t, i) {
  5329. "use strict";
  5330. var n = e("three");
  5331. t.exports = {
  5332. UP: new n.Vector3(0,1,0),
  5333. DOWN: new n.Vector3(0,-1,0),
  5334. LEFT: new n.Vector3(-1,0,0),
  5335. RIGHT: new n.Vector3(1,0,0),
  5336. FORWARD: new n.Vector3(0,0,-1),
  5337. BACK: new n.Vector3(0,0,1)
  5338. }
  5339. }
  5340. , {
  5341. three: 217
  5342. }],
  5343. 51: [function(e, t, i) {
  5344. "use strict";
  5345. var n = e("../exception/ViewmodeConvertException")
  5346. , r = e("./coreViewmodes")
  5347. , o = {
  5348. MESH: "mesh",
  5349. OUTDOOR: "outdoor",
  5350. TRANSITIONING: "transitioning",
  5351. toInt: function(e) {
  5352. switch (e) {
  5353. case this.PANORAMA:
  5354. return 1;
  5355. case this.DOLLHOUSE:
  5356. return 2;
  5357. case this.FLOORPLAN:
  5358. return 3;
  5359. case this.OUTDOOR:
  5360. return 4;
  5361. case this.TRANSITIONING:
  5362. return -1
  5363. }
  5364. throw new n("No known conversion for Viewmode to int for mode: " + e)
  5365. },
  5366. fromInt: function(e) {
  5367. switch (e) {
  5368. case "1":
  5369. case 1:
  5370. return this.PANORAMA;
  5371. case "2":
  5372. case 2:
  5373. return this.DOLLHOUSE;
  5374. case "3":
  5375. case 3:
  5376. return this.FLOORPLAN;
  5377. case "4":
  5378. case 4:
  5379. return this.OUTDOOR
  5380. }
  5381. throw new n("No known conversion for int to viewmode for int: " + e)
  5382. },
  5383. convertWorkshopModeInt: function(e) {
  5384. switch (e) {
  5385. case "0":
  5386. case 0:
  5387. case void 0:
  5388. return this.PANORAMA;
  5389. case "1":
  5390. case 1:
  5391. return this.FLOORPLAN;
  5392. case "2":
  5393. case 2:
  5394. return this.DOLLHOUSE;
  5395. case "3":
  5396. case 3:
  5397. return this.MESH
  5398. }
  5399. throw new n("No known conversion for Workshop int to viewmode for int: " + e)
  5400. }
  5401. };
  5402. e("../util/common").extendObject(o, r),
  5403. t.exports = o
  5404. }
  5405. , {
  5406. "../exception/ViewmodeConvertException": 58,
  5407. "../util/common": 185,
  5408. "./coreViewmodes": 54
  5409. }],
  5410. 52: [function(e, t, i) {
  5411. "use strict";
  5412. t.exports = {
  5413. BLACK: "black",
  5414. STD: "std",
  5415. WALK: "walk"
  5416. }
  5417. }
  5418. , {}],
  5419. 53: [function(e, t, i) {
  5420. "use strict";
  5421. t.exports = {
  5422. ZoomIn: "zoom.in",
  5423. ZoomOut: "zoom.out",
  5424. ZoomMax: "zoom.max",
  5425. ZoomMin: "zoom.min"
  5426. }
  5427. }
  5428. , {}],
  5429. 54: [function(e, t, i) {
  5430. "use strict";
  5431. t.exports = {
  5432. PANORAMA: "panorama",
  5433. DOLLHOUSE: "dollhouse",
  5434. FLOORPLAN: "floorplan"
  5435. }
  5436. }
  5437. , {}],
  5438. 55: [function(e, t, i) {
  5439. "use strict";
  5440. t.exports = function(e) {
  5441. this.message = e
  5442. }
  5443. }
  5444. , {}],
  5445. 56: [function(e, t, i) {
  5446. "use strict";
  5447. function n(e) {
  5448. r.call(this, e)
  5449. }
  5450. var r = e("./BasicException");
  5451. n.prototype = Object.create(r.prototype),
  5452. t.exports = n
  5453. }
  5454. , {
  5455. "./BasicException": 55
  5456. }],
  5457. 57: [function(e, t, i) {
  5458. "use strict";
  5459. function n(e) {
  5460. r.call(this, e)
  5461. }
  5462. var r = e("./BasicException");
  5463. n.prototype = Object.create(r.prototype),
  5464. t.exports = n
  5465. }
  5466. , {
  5467. "./BasicException": 55
  5468. }],
  5469. 58: [function(e, t, i) {
  5470. "use strict";
  5471. function n(e) {
  5472. r.call(this, e)
  5473. }
  5474. var r = e("./BasicException");
  5475. n.prototype = Object.create(r.prototype),
  5476. t.exports = n
  5477. }
  5478. , {
  5479. "./BasicException": 55
  5480. }],
  5481. 59: [function(a, s, e) {
  5482. (function(e) {
  5483. "use strict";
  5484. var i = a("./util/ajax")
  5485. , n = a("./util/showcase")
  5486. , t = a("./util/logger")
  5487. , r = new t(e)
  5488. , o = {};
  5489. s.exports = {
  5490. loadFeatureFlags: function(e) {
  5491. var t = $.Deferred();
  5492. return i.get(e.urlBase + "", {
  5493. responseType: "json",
  5494. prefetchFrom: "user",
  5495. auth: n.getAuthorizationHeader()
  5496. }).done(function(e) {
  5497. (o = function(e) {
  5498. var t = {};
  5499. if (e) {
  5500. var i = e.flags;
  5501. if (i)
  5502. for (var n in i)
  5503. i.hasOwnProperty(n) && (t[i[n]] = !0);
  5504. return t
  5505. }
  5506. return r.debug("Feature flags -> parseFeatureFlags: rawData is null."),
  5507. null
  5508. }(e)) ? t.resolve(o) : t.reject("loading-failed")
  5509. }).fail(function() {
  5510. r.debug("Retrieval of feature flags failed."),
  5511. t.reject("loading-failed")
  5512. }),
  5513. t.promise()
  5514. },
  5515. getFlags: function() {
  5516. return o
  5517. },
  5518. updateDependentSettings: function(e, t) {
  5519. (e = e || o).labels && (t.labels.enabled = !0),
  5520. e.zooming && !t.zoom.forceOff && (t.zoom.enabled = !0),
  5521. e.showcase_sdk && (t.sdkInit = !0),
  5522. e.mobile_highq_override && (t.tiling.mobileHighQualityOverride = !0),
  5523. e.showcase_webvr && (t.vr.allowWebVR = !0),
  5524. e.uhql && (t.tiling.allowUltraHighResolution = !0),
  5525. e.hide_sc_sharing && (t.share.enabled = !1)
  5526. }
  5527. }
  5528. }
  5529. ).call(this, "/js/featureflags.js")
  5530. }
  5531. , {
  5532. "./util/ajax": 181,
  5533. "./util/logger": 189,
  5534. "./util/showcase": 193
  5535. }],
  5536. 60: [function(e, t, i) {
  5537. "use strict";
  5538. var n = (e("../util/common"),
  5539. {
  5540. status: 0,
  5541. set: function(e) {
  5542. if (isNaN(e))
  5543. return !1;
  5544. var t = $(".progressbar");
  5545. e < 0 && (e = 0),
  5546. 100 < e && (e = 100);
  5547. var i = e * (parseInt(t.css("width").replace("px", "")) / 100)
  5548. , n = Math.round(e)
  5549. , r = parseInt(i) - 15;
  5550. t.find(".bar").css("width", i),
  5551. t.find(".label").css("left", r),
  5552. t.find(".perc").text(n + "%"),
  5553. this.status = e
  5554. },
  5555. done: function(e) {
  5556. return e || this.status ? (this.status = null,
  5557. this.set(100)) : this
  5558. }
  5559. });
  5560. t.exports.circleLoader = n
  5561. }
  5562. , {
  5563. "../util/common": 185
  5564. }],
  5565. 61: [function(e, t, i) {
  5566. "use strict";
  5567. t.exports = Object.freeze({
  5568. CLOSE: "modal.closer.close"
  5569. })
  5570. }
  5571. , {}],
  5572. 62: [function(e, t, i) {
  5573. "use strict";
  5574. function n(t, e) {
  5575. function i() {
  5576. var e = t.offsetHeight >= $("#player").height() && t.offsetWidth >= $("#player").width();
  5577. e !== p && ((p = e) ? (t.classList.add("closeByFooter"),
  5578. c.classList.add("closeByFooter")) : (t.classList.remove("closeByFooter"),
  5579. c.classList.remove("closeByFooter")))
  5580. }
  5581. e ? setTimeout(i, r.guiAnimationSpeed) : i()
  5582. }
  5583. var r = e("../../settings")
  5584. , o = (e("../../tag/Media/MediaEvent"),
  5585. e("../../util/browser"))
  5586. , a = e("../../util/common")
  5587. , s = e("./ModalCloserEvent")
  5588. , l = e("events").EventEmitter
  5589. , c = document.getElementsByClassName("footer")[0]
  5590. , h = c.querySelectorAll(".close")[0]
  5591. , u = null
  5592. , d = null
  5593. , p = null
  5594. , f = (o.isMobile(),
  5595. {
  5596. open: function(e) {
  5597. e && (n(e),
  5598. u && h.removeEventListener("click", u, !0),
  5599. u = function(e, t) {
  5600. t && (t.stopPropagation(),
  5601. t.preventDefault()),
  5602. e && this.emit(s.CLOSE, e),
  5603. f.reset()
  5604. }
  5605. .bind(this, e.id),
  5606. h.addEventListener("click", u, !0),
  5607. d && window.removeEventListener("resize", d, !0),
  5608. d = n.bind(this, e),
  5609. window.addEventListener("resize", d, !0))
  5610. },
  5611. reset: function() {
  5612. c.classList.remove("closeByFooter"),
  5613. h.removeEventListener("click", u, !0),
  5614. window.removeEventListener("resize", d, !0),
  5615. u = d = p = null
  5616. }
  5617. });
  5618. a.extendObject(f, l.prototype),
  5619. t.exports = f
  5620. }
  5621. , {
  5622. "../../tag/Media/MediaEvent": 131,
  5623. "../../settings": 166,
  5624. "../../util/browser": 182,
  5625. "../../util/common": 185,
  5626. "./ModalCloserEvent": 61,
  5627. events: 202
  5628. }],
  5629. 63: [function(e, t, i) {
  5630. "use strict";
  5631. var A = e("../lib/dat.gui")
  5632. , C = e("three")
  5633. , I = e("../util/easing")
  5634. , E = e("../enum/Viewmode")
  5635. , _ = e("../enum/Colors")
  5636. , b = e("../enum/WarpStyle")
  5637. , w = e("../settings");
  5638. e("../tag/tag"),
  5639. A.GUI.prototype.removeFolder = function(e) {
  5640. var t = this.__folders[e];
  5641. t && (t.close(),
  5642. this.__ul.removeChild(t.domElement.parentNode),
  5643. delete this.__folders[e],
  5644. this.onResize())
  5645. }
  5646. ,
  5647. t.exports.toggle = function(t, e, i) {
  5648. var n = new A.GUI({
  5649. width: 400
  5650. })
  5651. , r = n.addFolder("Flydown from Dollhouse");
  5652. r.add(w.flydown, "movementEasing", Object.keys(I)),
  5653. r.add(w.flydown, "movementDelay", 0, 1).step(.01),
  5654. r.add(w.flydown, "rotationEasing", Object.keys(I)),
  5655. r.add(w.flydown, "rotationDelay", 0, 1).step(.01),
  5656. r.add(w.flydown, "modelTextureDelay", 0, 1).step(.01),
  5657. r.add(w.flydown, "skyboxDelay", 0, 1).step(.01),
  5658. r.add(w.dollhouseDefault, "minPolarAngle", 0, C.Math.degToRad(50)),
  5659. r.add(w.dollhouseDefault, "maxPolarAngle", C.Math.degToRad(50), C.Math.degToRad(170));
  5660. var o = n.addFolder("Transition between panos");
  5661. o.add(w.transition, "blur", 0, 10).onFinishChange(function() {}),
  5662. o.add(w.transition, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  5663. w.transition.flyTime = 0,
  5664. o.__controllers.forEach(function(e) {
  5665. e.updateDisplay()
  5666. })
  5667. }),
  5668. o.add(w.transition, "flyTime", 0, 5e3).onFinishChange(function() {
  5669. w.transition.flySpeed = 0,
  5670. o.__controllers.forEach(function(e) {
  5671. e.updateDisplay()
  5672. })
  5673. }),
  5674. o.add(w.transition, "aimTime", 500, 2500).step(50),
  5675. o.add(w.transition, "aimSlowFactor", 1, 3).step(.1),
  5676. o.add(w.transition, "movementEasing", Object.keys(I));
  5677. var a = n.addFolder("Path Display");
  5678. a.add(w.path, "opacity", 0, 1).step(.01).onFinishChange(function() {}),
  5679. a.add(w.path, "height", 0, .2).step(.01).onFinishChange(function() {}),
  5680. a.add(w.path, "outsideHeight", 0, 2).step(.01).onFinishChange(function() {}),
  5681. a.add(w.path, "ribbonWidth", .01, .35).step(.01).onFinishChange(function() {}),
  5682. a.add(w.path, "waypointRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5683. a.add(w.path, "waypointPulse", 0, 3600).step(20).onFinishChange(function() {}),
  5684. a.add(w.path, "waypointIndoorRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5685. a.add(w.path, "fadeInTime", 0, 1200).step(10).onFinishChange(function() {}),
  5686. a.add(w.path, "fadeOutTime", 0, 1200).step(10).onFinishChange(function() {}),
  5687. a.add(w.path, "color", Object.keys(_)).onFinishChange(function() {
  5688. w.path.color = _[w.path.color],
  5689. w.path.colorUp = _._desat(w.path.color),
  5690. w.path.colorDown = _.darken(w.path.color)
  5691. }),
  5692. a.add(w, "reticuleColor", Object.keys(_)).onFinishChange(function() {
  5693. w.reticuleColor = _[w.reticuleColor]
  5694. });
  5695. var s = n.addFolder("Warping")
  5696. , l = s.addFolder("Warp/Teleport");
  5697. l.add(w.warp, "softPushDist", 0, 2).onFinishChange(function() {}),
  5698. l.add(w.warp, "softPushEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5699. l.add(w.warp, "softBendAngle", 0, 45).onFinishChange(function() {}),
  5700. l.add(w.warp, "softBendTilt", 0, 45).onFinishChange(function() {}),
  5701. l.add(w.warp, "softBendEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5702. l.add(w.warp, "burnsAngle", 0, 30).onFinishChange(function() {}),
  5703. l.add(w.warp, "minBurnsAngle", 0, 10).onFinishChange(function() {}),
  5704. l.add(w.warp, "brakeStrength", 1, 8).onFinishChange(function() {}),
  5705. l.add(w.warp, "minBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  5706. l.add(w.warp, "maxBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  5707. l.add(w.path, "mapGuides").onFinishChange(function() {}),
  5708. l.add(w.warp, "teleportTime", 0, 5e3).step(10).onFinishChange(function() {}),
  5709. l.add(w.warp, "outsideTime", 0, 5e3).step(10).onFinishChange(function() {}),
  5710. l.add(w.path, "typ", Object.keys(b)).onFinishChange(function() {
  5711. w.path.typ = b[w.path.typ]
  5712. }),
  5713. l.add(w.warp, "loop").onChange(function() {}).onFinishChange(function() {
  5714. e.endlessLoop = w.warp.loop
  5715. }),
  5716. l.add(w.warp, "walkSlideShowThreshhold", 1, 1e4).step(1).onFinishChange(function() {}),
  5717. l.add(w.warp, "walkExtraPanosDistance", 0, 3).step(.1).onFinishChange(function() {}),
  5718. l.add(w.transition, "fastForwardFactor", 1, 10).step(1).onFinishChange(function() {});
  5719. var c = s.addFolder("Long Warp Only");
  5720. c.add(w.warp, "minWarpTime", 0, 5e3).step(10).onFinishChange(function() {
  5721. w.warp.flySpeed = 0,
  5722. c.__controllers.forEach(function(e) {
  5723. e.updateDisplay()
  5724. })
  5725. }),
  5726. c.add(w.warp, "timePerMeter", 0, 5e3).step(10).onFinishChange(function() {}),
  5727. c.add(w.warp, "lookAheadMax", .01, 1).step(.01).onFinishChange(function() {}),
  5728. c.add(w.warp, "lookAheadDist", .01, 4).step(.01).onFinishChange(function() {}),
  5729. c.add(w.warp, "maxTurnPerSec", 0, 720).step(1).onFinishChange(function() {}),
  5730. c.add(w.warp, "maxAimPerSec", 0, 720).step(1).onFinishChange(function() {}),
  5731. c.add(w.warp, "turnFriction", 0, 1).step(.01).onFinishChange(function() {}),
  5732. c.add(w.warp, "walkDelay", 0, 2e3).step(10).onFinishChange(function() {}),
  5733. c.add(w.transition, "flytimeMaxDistanceThreshold", 0, 25).step(10).onFinishChange(function() {}),
  5734. c.add(w.warp, "walkMaxDist", 0, 100).step(1).onFinishChange(function() {});
  5735. var h = n.addFolder("Warp Esoterica");
  5736. h.add(w.warp, "nearPanoDist", .01, 12).step(0).onFinishChange(function() {}),
  5737. h.add(w.warp, "blur", .01, 1).onFinishChange(function() {}),
  5738. h.add(w.warp, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  5739. w.warp.minWarpTime = 0,
  5740. h.__controllers.forEach(function(e) {
  5741. e.updateDisplay()
  5742. })
  5743. }),
  5744. h.add(w.warp, "showBunny").onFinishChange(function() {}),
  5745. h.add(w.warp, "fastTime", 0, 2500).step(10).onFinishChange(function() {}),
  5746. h.add(w.warp, "movementEasing", Object.keys(I));
  5747. var u = n.addFolder("Misc");
  5748. u.add(w, "dollhouseFOV", 10, 180).onChange(function() {
  5749. i.cameras[E.DOLLHOUSE].fov = w.dollhouseFOV
  5750. }),
  5751. u.add(w, "insideFOV", 10, 180).onChange(function() {
  5752. i.cameras[E.PANORAMA].fov = w.insideFOV
  5753. }),
  5754. u.add(w, "insideLookSpeed", .01, .3).step(.01).onChange(function() {}),
  5755. u.add(w, "rotationAccelerationInside", .1, 10).step(.1).onChange(function() {}),
  5756. u.add(w, "rotationAccelerationOutside", .1, 10).step(.1).onChange(function() {});
  5757. var d = n.addFolder("Navigation");
  5758. d.add(w.navigation, "panoScores").onFinishChange(function() {
  5759. w.navigation.panoScores || t.panos.forEach(function(e) {
  5760. e.floor.remove(e.text3d),
  5761. e.text3d = null
  5762. })
  5763. }),
  5764. d.add(w.navigation, "mouseDirection"),
  5765. d.add(w.navigation, "filterStrictness", 0, 1),
  5766. d.add(w.navigation, "angleFactor", -60, 0),
  5767. d.add(w.navigation, "directionFactor", 1, 20),
  5768. d.add(w.navigation, "distanceFactor", -5, 5),
  5769. d.add(w.navigation, "optionalityFactor", .1, 10);
  5770. var p = n.addFolder("tags")
  5771. , f = p.addFolder("Tag Creation");
  5772. f.add(w.tags.pole, "enabled").name("poleEnabled"),
  5773. f.add(w.tags.pole, "height", 0, 2.5).step(.01).name("poleHeight"),
  5774. f.add(w.tags.pole, "width", 1, 10).step(1).name("poleWidth"),
  5775. f.add(w.tags.pole, "opacity", .1, 1).step(.1).name("poleOpacity");
  5776. var g = p.addFolder("Visibility");
  5777. g.add(w.tags.visibility, "anyDistance"),
  5778. g.add(w.tags.visibility, "visibleDistance", .1, 30).step(.1),
  5779. g.add(w.tags.visibility, "cameraClearance", 0, 1).step(.01),
  5780. g.add(w.tags.visibility, "hideViaFloor"),
  5781. g.add(w.tags.visibility, "hideOffScreenDisc").name("hideEdgeDisc"),
  5782. g.add(w.tags.visibility, "hideOffScreenObject").name("hideEdgeObject");
  5783. var m = p.addFolder("Disc Parameters");
  5784. m.add(w.tags.disc.scale, "nearBound", .1, 10).step(.1),
  5785. m.add(w.tags.disc.scale, "farBound", .1, 20).step(.1).listen(),
  5786. m.add(w.tags.disc.scale, "linkFarBound").onChange(function(e) {
  5787. e && (w.tags.disc.scale.farBound = w.tags.visibility.visibleDistance * (1 - w.tags.disc.scale.linkPercent / 100))
  5788. }),
  5789. m.add(w.tags.disc.scale, "linkPercent", 0, 100).step(1).onChange(function(e) {
  5790. w.tags.disc.scale.linkFarBound && (w.tags.disc.scale.farBound = w.tags.visibility.visibleDistance * (1 - e / 100))
  5791. }),
  5792. m.add(w.tags.disc.scale, "maxSize", 40, 200).step(1),
  5793. m.add(w.tags.disc.scale, "minSize", 20, 100).step(1),
  5794. m.add(w.tags.disc.scale, "responsiveness", 0, 100).step(1);
  5795. var v = p.addFolder("Navigate");
  5796. v.add(w.tags.navigate, "nearestPano").name("nearestPano"),
  5797. v.add(w.tags.navigate, "lineOfSight").name("lineOfSight"),
  5798. v.add(w.tags.navigate, "reactivate").name("reactivate"),
  5799. v.add(w.tags.navigate, "aimAt", ["disc", "object", "pole", "nothing"]).name("aim at"),
  5800. v.add(w.tags.navigate, "tiltTolerance", 0, 50).step(1),
  5801. v.add(w.tags.navigate, "rotateSpeedFactor", 0, 5).step(.1);
  5802. var y = n.addFolder("Debug");
  5803. y.add(w, "wireframe").onFinishChange(function() {
  5804. t.chunks.forEach(function(e) {
  5805. e.material && (e.wireframeTwin || (e.wireframeTwin = new C.WireframeHelper(e),
  5806. e.wireframeTwin.material.depthWrite = !1,
  5807. e.wireframeTwin.material.depthTest = !1,
  5808. e.wireframeTwin.material.opacity = .5,
  5809. e.wireframeTwin.material.transparent = !0),
  5810. w.wireframe ? t.add(e.wireframeTwin) : t.remove(e.wireframeTwin))
  5811. })
  5812. }),
  5813. y.add(w, "skyboxWireframe").onFinishChange(function() {
  5814. w.skyboxWireframe ? (t.skybox.wireframe = new C.WireframeHelper(t.skybox),
  5815. t.add(t.skybox.wireframe)) : (t.remove(t.skybox.wireframe),
  5816. t.skybox.wireframe = null)
  5817. }),
  5818. y.add(w, "showSweeps").onFinishChange(function() {
  5819. t.setSweepVisibility(w.showSweeps)
  5820. }),
  5821. y.add(w, "showMesh").onFinishChange(function() {
  5822. t.chunks.forEach(function(e) {
  5823. e.visible = w.showMesh
  5824. })
  5825. }),
  5826. y.add(w, "showFloors").onFinishChange(function() {
  5827. t.floors.forEach(function(e) {
  5828. e.collider.children.forEach(function(e) {
  5829. e.material.visible = w.showFloors
  5830. })
  5831. })
  5832. }),
  5833. y.add(w, "showSkyboxes").onFinishChange(function() {
  5834. t.panos.forEach(function(e) {
  5835. e.skyboxMesh.visible = w.showSkyboxes
  5836. })
  5837. }),
  5838. y.add(w, "showNeighbors").onChange(function() {}),
  5839. y.add(t, "alpha", 0, 1)
  5840. }
  5841. }
  5842. , {
  5843. "../enum/Colors": 19,
  5844. "../enum/Viewmode": 51,
  5845. "../enum/WarpStyle": 52,
  5846. "../lib/dat.gui": 93,
  5847. "../tag/tag": 123,
  5848. "../settings": 166,
  5849. "../util/easing": 186,
  5850. three: 217
  5851. }],
  5852. 64: [function(c, h, e) {
  5853. (function(e) {
  5854. "use strict";
  5855. function i(e, t, i, n) {
  5856. $(".gui-error .error-problem-text").text(e),
  5857. $(".gui-error .error-solution-text").text(t),
  5858. $(".gui-error .error-explanation").text(i),
  5859. $(".gui-error .error-actions").html(n),
  5860. $(window).resize(),
  5861. $(".gui-error").fadeIn(),
  5862. $("#bottom-logo").fadeIn()
  5863. }
  5864. function n(e) {
  5865. 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("");
  5866. i(e, s.ERROR_BROWSER_SOLUTION, s.ERROR_BROWSER_EXPLANATION, t),
  5867. r.isMobile() || $("[rel=tiletip]").tooltip({
  5868. placement: "bottom",
  5869. delay: {
  5870. show: 50,
  5871. hide: 0
  5872. },
  5873. trigger: "hover",
  5874. viewport: {
  5875. selector: "body",
  5876. padding: 10
  5877. }
  5878. })
  5879. }
  5880. function t() {
  5881. var e = r.isMobile() ? "" : '<span class="link install-browser">' + s.ERROR_GENERIC_ACTIONS_2 + "</span>" + s.ERROR_GENERIC_ACTIONS_3
  5882. , t = [s.ERROR_GENERIC_ACTIONS_1, e].join("");
  5883. i(s.ERROR_GENERIC_PROBLEM, s.ERROR_GENERIC_SOLUTION, "", t),
  5884. r.isMobile() || $(".install-browser").on("click touchstart", function(e) {
  5885. e.preventDefault(),
  5886. e.stopPropagation(),
  5887. n(" ")
  5888. })
  5889. }
  5890. var r = c("./../util/browser")
  5891. , o = c("./../analytics")
  5892. , a = c("./../settings")
  5893. , s = c("../localization/localize")
  5894. , l = new (c("./../util/logger"))(e);
  5895. h.exports.error = function(e) {
  5896. if ($("head title").text(a.pageTitle),
  5897. $("#gui-message, #gui-loading, #nprogress, #gui-thumb, #bottom-logo").hide(),
  5898. $("#gui-loading").fadeOut(250),
  5899. $("#quick-blackout").hide(),
  5900. o.track("showcase_error", {
  5901. error_key: e
  5902. }),
  5903. s.locale || s.init(),
  5904. "webgl-unsupported" === e)
  5905. r.isMobile() ? t() : n(s.ERROR_WEBGL_UNSUPPORTED_PROBLEM);
  5906. else if ("webgl-ios" === e)
  5907. 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>.");
  5908. else if ("webgl-safari" === e)
  5909. 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>.");
  5910. else if ("webgl-generic" === e)
  5911. t();
  5912. else if ("missing-urls" === e)
  5913. i(s.ERROR_MISSING_URLS_PROBLEM, "", s.ERROR_MISSING_URLS_EXPLANATION);
  5914. else if ("loading-failed" === e)
  5915. 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>.");
  5916. else {
  5917. if ("loading-failed-maintenance" !== e)
  5918. return void l.error("Unhandled error: " + e);
  5919. i(s.ERROR_MAINTENANCE_PROBLEM, s.ERROR_MAINTENANCE_SOLUTION)
  5920. }
  5921. }
  5922. }
  5923. ).call(this, "/js/gui/error.js")
  5924. }
  5925. , {
  5926. "../localization/localize": 108,
  5927. "./../analytics": 4,
  5928. "./../settings": 166,
  5929. "./../util/browser": 182,
  5930. "./../util/logger": 189
  5931. }],
  5932. 65: [function(Oe, Le, e) {
  5933. (function(e) {
  5934. "use strict";
  5935. function c() {
  5936. for (var e in Ce)
  5937. if (Ce.hasOwnProperty(e)) {
  5938. var t = Ce[e];
  5939. if (!t.visible)
  5940. for (var i = 0; i < t.elements.length; i++)
  5941. $(t.elements[i]).hide()
  5942. }
  5943. Ce.highlight.visible && $(".pinBottom").addClass("highlightExists"),
  5944. !1 === Ce.tourControls.visible && $("#drawer").addClass("fullWidth"),
  5945. ge = [],
  5946. Ce.floors.visible && ge.push(".gui-floor", ".gui-floor-title"),
  5947. ge.push(".hideTarget", ".pinTop.right")
  5948. }
  5949. function v(e, t) {
  5950. var i = !S.isMobile() && M.zoom.enabled && t.mode === ie.PANORAMA && !e.tourIsPlaying;
  5951. $("#gui-zoomin").toggle(i),
  5952. $("#gui-zoomout").toggle(i)
  5953. }
  5954. function l() {
  5955. n(),
  5956. $(".pinBottom").toggleClass("open"),
  5957. $("#drawer").toggleClass("open"),
  5958. $(".footer").toggleClass("open"),
  5959. $("#drawer").hasClass("open") ? ($("#pullTab .icon").attr("data-original-title", se.CLOSE_HIGHLIGHTS),
  5960. _e("highlights")) : ($("#pullTab .icon").attr("data-original-title", se.OPEN_HIGHLIGHTS),
  5961. O.resetDrawer()),
  5962. setTimeout(function() {
  5963. $("#pullTab").toggleClass("opened")
  5964. }, $("#drawer").hasClass("open") ? 0 : M.highlightAnimationDuration),
  5965. $(".pinBottom").hasClass("open") && t($(".vr-popup")) && $(".vr-popup").is(":visible") && X.dismiss()
  5966. }
  5967. function t(e) {
  5968. var t;
  5969. return "none" !== e.css("display") ? t = e.position().top + e.outerHeight() : (e.attr("style", "visibility: hidden"),
  5970. t = e.position().top + e.outerHeight(),
  5971. e.attr("style", "display: none")),
  5972. $("#player").outerHeight() - 130 < t + 25
  5973. }
  5974. function y(e) {
  5975. "touchstart" === e.type && e.preventDefault(),
  5976. e.stopPropagation()
  5977. }
  5978. function n() {
  5979. w && (w.reload(),
  5980. w.init())
  5981. }
  5982. function r() {
  5983. $("#gui-spinner").stop(!0, !0),
  5984. $("#gui-spinner").fadeOut(1e3),
  5985. !(Ae = !0)
  5986. }
  5987. function A(e, t) {
  5988. var i = e.mode
  5989. , n = t || e.currentPano;
  5990. $("#gui-modes-dollhouse").toggleClass("active", i === ie.DOLLHOUSE),
  5991. $("#gui-modes-floorplan").toggleClass("active", i === ie.FLOORPLAN),
  5992. $("#gui-modes-inside").toggleClass("active", i === ie.PANORAMA),
  5993. i === ie.PANORAMA ? ($("#view-controllers").slideUp(500),
  5994. M.show360Views.enabled && !n.isAligned() ? ($(".gui-floor").addClass("hidden"),
  5995. $("#gui-modes-outside").addClass("desktop-only")) : ($(".gui-floor").removeClass("hidden"),
  5996. $("#gui-modes-outside").removeClass("desktop-only")),
  5997. $("#gui-modes-outside").removeClass("hidden")) : i !== ie.TRANSITIONING && (r(),
  5998. pe = i,
  5999. $("#gui-modes-outside").addClass("hidden"),
  6000. e.model.has360Views && $(".gui-floor").removeClass("hidden"),
  6001. $("#view-controllers").is(":visible") || $("#view-controllers").slideDown(M.guiAnimationSpeed))
  6002. }
  6003. function C(t, i) {
  6004. function e() {
  6005. document.getElementById("vr").classList.remove("hidden"),
  6006. M.vr.allowWebVR ? S.getVRDisplay().then(function(e) {
  6007. S.supportsFullscreen() ? function(e) {
  6008. ue.info(e.displayName + " detected, VR button activates WebVR experience"),
  6009. Q.init(t.data, i, e, x),
  6010. Q.on(J.OPENED, _e.bind(gui, "vr")),
  6011. Q.on(J.SHOW_TERMS, W.show.bind(W))
  6012. }(e) : (ue.warn("Unable to use WebVR when full screen is not supported"),
  6013. $(".improper-embed").toggleClass("hidden", !1),
  6014. n())
  6015. }, function(e) {
  6016. n()
  6017. }) : n()
  6018. }
  6019. function n() {
  6020. var e;
  6021. ue.info("WebVR support not found, VR button activates native app VR modal"),
  6022. X.init(t.data, x),
  6023. X.on(Z.OPENED, (e = document.getElementById("vr-modal"),
  6024. function() {
  6025. _e("vr"),
  6026. V.open(e)
  6027. }
  6028. )),
  6029. X.on(Z.CLOSED, V.reset)
  6030. }
  6031. if (M.vr.enabled && t.supportsVR && !S.valueFromHash("mls", 0))
  6032. switch (M.vr.option) {
  6033. case le.CONTEXTUAL:
  6034. e();
  6035. break;
  6036. case le.ANDROID:
  6037. S.detectAndroid() && e();
  6038. break;
  6039. case le.NONE:
  6040. }
  6041. }
  6042. function h(e, i) {
  6043. for (var n = $(".gui-floor"), t = 0; t < e.floors.length; t++)
  6044. if ("372" !== getQueryVariable("m")) {
  6045. var r = $('<div class="floorChoice" data-index="' + t + '"></div>').text(e.floors.get(t).name);
  6046. $(".gui-floor").find(".container").prepend(r)
  6047. }
  6048. n.find(".container").prepend('<div class="floorChoice darkGlass allFloorBtn" data-index="all" style="display:none">' + se.FLOOR_ALL + "</div>"),
  6049. n.on("click", function(e) {
  6050. y(e),
  6051. _e("floor"),
  6052. n.toggleClass("open")
  6053. }),
  6054. $(".floorChoice").on("click", function(e) {
  6055. y(e);
  6056. var t = $(this).data("index");
  6057. "all" !== t ? (R.updateInteraction(oe.InteractionGui, "floor-control"),
  6058. i.player.gotoFloor(t),
  6059. R.track("showcase_gui", {
  6060. gui_action: "click_floor_select_button",
  6061. interaction_source: "gui"
  6062. })) : (R.updateInteraction(oe.InteractionGui, "floor-control"),
  6063. _e("move"),
  6064. i.allFloors(),
  6065. R.track("showcase_gui", {
  6066. gui_action: "click_toggle_all_floors_button",
  6067. interaction_source: "gui"
  6068. })),
  6069. n.removeClass("open")
  6070. })
  6071. }
  6072. function I(e, t) {
  6073. e && (t === ie.DOLLHOUSE || t === ie.FLOORPLAN ? ($(".allFloorBtn").show(),
  6074. $(".gui-floor-icon").hide(),
  6075. $(".gui-floor-title").show()) : ($(".allFloorBtn").hide(),
  6076. $(".gui-floor-icon").show(),
  6077. $(".gui-floor-title").hide()),
  6078. e.model.allFloorsVisible ? ($(".gui-floor-title").text(se.FLOOR_ALL),
  6079. $(".gui-floor-number").text(se.FLOOR_ALL),
  6080. $(".floorChoice").removeClass("active"),
  6081. $('.floorChoice[data-index="all"]').addClass("active")) : ($(".gui-floor-title").text(e.name),
  6082. $(".gui-floor-number").text(" " + (e.floorIndex + 1)),
  6083. $(".floorChoice").removeClass("active"),
  6084. $(".floorChoice[data-index=" + e.floorIndex + "]").addClass("active")))
  6085. }
  6086. function E() {
  6087. var e = $("#player").width() - 20
  6088. , t = $("#scroller")
  6089. , i = $("#drawer")
  6090. , n = $(".pinBottom");
  6091. $("#player").width() < 488 || $("#player").height() < 488 ? (t.addClass("hidden"),
  6092. i.addClass("noScroll"),
  6093. n.addClass("noScroll")) : e < T != !i.hasClass("noScroll") && (t.toggleClass("hidden"),
  6094. i.toggleClass("noScroll"),
  6095. n.toggleClass("noScroll"))
  6096. }
  6097. function _(e) {
  6098. e.waitQueue.length <= 0 ? r() : ye || function(e) {
  6099. e = e || 0,
  6100. Ae = !1,
  6101. window.setTimeout(function() {
  6102. Ae || (!0,
  6103. $("#gui-spinner").stop(!0, !0).show())
  6104. }
  6105. .bind(this), e)
  6106. }(M.modelComponentLoadSpinnerDelay)
  6107. }
  6108. function b(e, t) {
  6109. for (var i = []; e; )
  6110. i.push(e),
  6111. e = e.parentNode;
  6112. for (; t && -1 === i.indexOf(t); )
  6113. t = t.parentNode;
  6114. return t
  6115. }
  6116. var w, T, o, a, x, i, s, u, d, p, f, g, S = (Oe("three"),
  6117. Oe("../util/ajax"),
  6118. Oe("../util/browser")), M = Oe("../settings"), R = Oe("../analytics"), m = (Oe("../util/transitions"),
  6119. Oe("../util/camera"),
  6120. Oe("../util/logger")), P = (Oe("../objects/Snapshot"),
  6121. 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"),
  6122. Oe("../tag/Media/MediaEvent")), re = (Oe("../enum/PathDiscardMode"),
  6123. Oe("../enum/PathDisplayMode"),
  6124. Oe("../enum/DirectorEvents"),
  6125. Oe("../enum/PlayerEvents")), oe = Oe("../enum/ControlEvents"), ae = Oe("./sharing/ShareEvents"), se = Oe("../localization/localize"), le = (Oe("../enum/Vectors"),
  6126. Oe("../enum/WarpStyle"),
  6127. Oe("../enum/AlignmentType"),
  6128. Oe("../enum/VROption")), ce = Oe("./konami"), he = Oe("../lib/dat.gui"), ue = new m(e), de = (Oe("../util/showcase"),
  6129. Oe("../enum/ZoomEvents")), pe = ie.DOLLHOUSE, fe = 0, ge = [".hideTarget"], me = null, ve = null, ye = !1, Ae = !1, Ce = {
  6130. coBrand: {
  6131. visible: !0,
  6132. elements: [".co-brand", "#loaderCoBrand"]
  6133. },
  6134. help: {
  6135. visible: !0,
  6136. elements: [".nav-help", "#nav-help"]
  6137. },
  6138. tourControls: {
  6139. visible: !0,
  6140. elements: [".next", ".previous", "#play"]
  6141. },
  6142. highlight: {
  6143. visible: !0,
  6144. elements: ["#drawer", "#pullTab"]
  6145. },
  6146. share: {
  6147. visible: !0,
  6148. elements: [".socialButton", "#share"]
  6149. },
  6150. fullScreen: {
  6151. visible: !0,
  6152. elements: ["#gui-fullscreen"]
  6153. },
  6154. floors: {
  6155. visible: !0,
  6156. elements: [".gui-floor"]
  6157. }
  6158. }, Ie = (g = document.getElementById("drawer"),
  6159. function() {
  6160. $("#player").height() < 400 && g.classList.contains("open") && l()
  6161. }
  6162. ), Ee = (f = document.getElementById("meta-info"),
  6163. function() {
  6164. $("#player").height() < 400 && f.classList.contains("expand") && z.toggleMeta(!0)
  6165. }
  6166. ), _e = (i = document.getElementById("meta-info"),
  6167. s = document.getElementById("interaction-modal"),
  6168. u = $("#drawer").eq(0),
  6169. d = $(".gui-floor").eq(0),
  6170. p = $(".vr-popup").eq(0),
  6171. function(e) {
  6172. switch (e) {
  6173. case "info":
  6174. we(),
  6175. Te(),
  6176. Ie(),
  6177. Me(),
  6178. Re(),
  6179. xe(),
  6180. Pe();
  6181. break;
  6182. case "terms":
  6183. be(),
  6184. Te(),
  6185. Se(),
  6186. Me(),
  6187. Re(),
  6188. xe(),
  6189. Pe();
  6190. break;
  6191. case "help":
  6192. be(),
  6193. we(),
  6194. Me(),
  6195. Re(),
  6196. xe(),
  6197. Pe();
  6198. break;
  6199. case "vr":
  6200. be(),
  6201. we(),
  6202. Me(),
  6203. Re(),
  6204. Te(),
  6205. Pe(),
  6206. t(p) && Se();
  6207. break;
  6208. case "highlights":
  6209. Ee(),
  6210. we(),
  6211. Me(),
  6212. Re();
  6213. break;
  6214. case "share":
  6215. be(),
  6216. we(),
  6217. Te(),
  6218. Re(),
  6219. xe(),
  6220. Pe();
  6221. break;
  6222. case "floor":
  6223. we(),
  6224. Me(),
  6225. xe();
  6226. break;
  6227. case "view":
  6228. Re(),
  6229. Me(),
  6230. we(),
  6231. xe();
  6232. break;
  6233. case "tour":
  6234. case "move":
  6235. we(),
  6236. Me(),
  6237. Re(),
  6238. xe();
  6239. break;
  6240. case "resize":
  6241. be(),
  6242. Ie(),
  6243. Re();
  6244. break;
  6245. case "tag":
  6246. we(),
  6247. Te(),
  6248. Me(),
  6249. Re(),
  6250. xe()
  6251. }
  6252. }
  6253. );
  6254. function be() {
  6255. i.classList.contains("expand") && z.toggleMeta(!0)
  6256. }
  6257. function we() {
  6258. W.hide()
  6259. }
  6260. function Te() {
  6261. U.close()
  6262. }
  6263. function xe() {
  6264. X.dismiss()
  6265. }
  6266. function Se() {
  6267. u.hasClass("open") && l()
  6268. }
  6269. function Me() {
  6270. K.hide()
  6271. }
  6272. function Re() {
  6273. d.hasClass("open") && d.removeClass("open")
  6274. }
  6275. function Pe() {
  6276. s.classList.contains("fadeIn") && (s.classList.contains("landing") ? D.dismissModal() : s.classList.contains("tour") && q.dismissModal())
  6277. }
  6278. $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", function(e) {
  6279. $("#gui-fullscreen").toggle(!S.isFullscreen()),
  6280. $("#gui-fullscreen-exit").toggle(!!S.isFullscreen()),
  6281. setTimeout(function() {
  6282. $(".icon:visible").hide().show(0)
  6283. }, 100)
  6284. }),
  6285. $("#gui-fullscreen").find("a").on("click", function(e) {
  6286. y(e),
  6287. S.requestFullscreen($("body")[0]),
  6288. R.track("showcase_gui", {
  6289. gui_action: "click_enter_fullscreen",
  6290. interaction_source: "gui"
  6291. })
  6292. }),
  6293. $("#gui-fullscreen-exit").find("a").on("click", function(e) {
  6294. y(e),
  6295. S.exitFullscreen(),
  6296. R.track("showcase_gui", {
  6297. gui_action: "click_exit_fullscreen",
  6298. interaction_source: "gui"
  6299. })
  6300. }),
  6301. $(window).on("resize", function(e) {
  6302. var t = e.target.innerHeight
  6303. , i = e.target.innerWidth;
  6304. t === o && i === a || (Ce.highlight.visible && E(),
  6305. _e("resize"),
  6306. $(".pinTop.right").removeClass("hideUnderMeta"),
  6307. n(),
  6308. o = t,
  6309. a = i)
  6310. }).resize(),
  6311. S.supportsFullscreen() || $("#gui-fullscreen").hide(),
  6312. $("#pullTab").on("click", function(e) {
  6313. y(e),
  6314. $("#drawer").hasClass("open") ? (R.trackAlways("showcase_gui", {
  6315. gui_action: "hide_highlight_reel"
  6316. }),
  6317. $(this).addClass("open").children("img").attr("src", "images/auto.png")) : (R.trackAlways("showcase_gui", {
  6318. gui_action: "show_highlight_reel"
  6319. }),
  6320. $(this).removeClass("open").children("img").attr("src", "images/auto-suspend.png")),
  6321. l()
  6322. }),
  6323. window.MP_PREFETCHED_MODELDATA.showHotListSta && ($("#hotList").css("display", ""),
  6324. $("#hotList").on("click", function(e) {
  6325. y(e);
  6326. var t = $("#hotListWrap")[0];
  6327. t.classList.contains("hotListActive") ? (t.classList.remove("hotListActive"),
  6328. this.classList.remove("active")) : (t.classList.add("hotListActive"),
  6329. this.classList.add("active"))
  6330. }),
  6331. $("#hotListContent ul").on("mouseover", function(e) {
  6332. y(e);
  6333. var t = e.target
  6334. , i = document.getElementById("hotListWrap");
  6335. if ("SPAN" === t.tagName) {
  6336. var n = t.parentElement.parentElement;
  6337. t.offsetWidth + 116 >= n.clientWidth ? i.style.width = t.offsetWidth + 116 + "px" : i.style.width = ""
  6338. } else if ("LI" === t.tagName) {
  6339. n = t.parentElement;
  6340. t.children[0].offsetWidth + 116 >= n.clientWidth ? i.style.width = t.children[0].offsetWidth + 116 + "px" : i.style.width = ""
  6341. } else
  6342. i.style.width = ""
  6343. }),
  6344. $("#hotListContent ul").on("click", function(e) {
  6345. y(e),
  6346. this.preElem && this.preElem.classList.remove("active"),
  6347. "SPAN" === e.target.tagName ? (e.target.parentElement.classList.add("active"),
  6348. e.target.parentElement.hot && e.target.parentElement.hot.examine(window.player, !0),
  6349. this.preElem = e.target.parentElement) : (e.target.classList.add("active"),
  6350. e.target.hot && e.target.hot.examine(window.player, !0),
  6351. this.preElem = e.target)
  6352. }),
  6353. $("#hotListClose").on("click", function(e) {
  6354. y(e),
  6355. $("#hotListWrap")[0].classList.remove("hotListActive"),
  6356. $("#hotListContent ul .active").removeClass("active"),
  6357. $("#hotList")[0].classList.remove("active")
  6358. })),
  6359. "true" === window.MP_PREFETCHED_MODELDATA.supportsVR && $("#vr").css("display", ""),
  6360. $("#more-menu-button").on("click", function(e) {
  6361. y(e),
  6362. $("#more-menu").toggleClass("open")
  6363. }),
  6364. Le.exports.init = function(s, l, c, e, t, i, n) {
  6365. var r;
  6366. x = n,
  6367. s.outsideAllowed() || $("#gui-modes-outside").addClass("invisible"),
  6368. s.supportedModes[ie.PANORAMA] || $("#gui-modes-inside").addClass("invisible"),
  6369. F.init(),
  6370. D.init(s, i),
  6371. ce.init(s, l, e),
  6372. $(".icon").on("mouseover", function() {
  6373. l.player && l.player.reticule.hide()
  6374. }),
  6375. function(e, t) {
  6376. var i = t.player;
  6377. $("#gui-modes-inside").on("mousedown touchstart", function(e) {
  6378. y(e),
  6379. R.updateInteraction(oe.InteractionGui, "inside-button"),
  6380. R.track("USER", {
  6381. event_type: "showcase_gui",
  6382. gui_action: "click_inside_mode_button"
  6383. }),
  6384. t.changeMode(ie.PANORAMA)
  6385. }),
  6386. $("#gui-modes-outside").find("a").on("click", function(e) {
  6387. y(e),
  6388. R.track("showcase_gui", {
  6389. gui_action: "click_outside_mode_button"
  6390. }),
  6391. t.changeMode(pe)
  6392. }),
  6393. $("#gui-modes-floorplan").on("click", function(e) {
  6394. y(e),
  6395. i.mode !== ie.FLOORPLAN && (R.track("showcase_gui", {
  6396. gui_action: "click_floorplan_mode_button"
  6397. }),
  6398. t.changeMode(ie.FLOORPLAN))
  6399. }),
  6400. $("#gui-modes-dollhouse").on("click", function(e) {
  6401. y(e),
  6402. i.mode !== ie.DOLLHOUSE && (R.track("showcase_gui", {
  6403. gui_action: "click_dollhouse_mode_button"
  6404. }),
  6405. t.changeMode(ie.DOLLHOUSE))
  6406. })
  6407. }(0, l),
  6408. function(e, t) {
  6409. $("#play").on("mousedown touchstart", function(e) {
  6410. y(e),
  6411. _e("tour"),
  6412. q.play(),
  6413. R.trackAlways("showcase_gui", {
  6414. gui_action: "play_highlights"
  6415. })
  6416. }),
  6417. window.startAndPlay = function(e) {
  6418. _e("tour"),
  6419. q.play(),
  6420. R.trackAlways("showcase_gui", {
  6421. gui_action: "play_highlights"
  6422. })
  6423. }
  6424. ,
  6425. $("#pause").on("mousedown touchstart", function(e) {
  6426. y(e),
  6427. q.pause(),
  6428. R.trackAlways("showcase_gui", {
  6429. gui_action: "pause_highlights"
  6430. })
  6431. }),
  6432. $("#gui-zoomin").find("a").on("click", function(e) {
  6433. y(e),
  6434. t.player.zoomInIncrementally()
  6435. }),
  6436. $("#gui-zoomout").find("a").on("click", function(e) {
  6437. y(e),
  6438. t.player.zoomOutIncrementally()
  6439. })
  6440. }(0, l),
  6441. s.data.enable_social_sharing && s.data.is_public && M.share.enabled && (K.init(MP_PREFETCHED_MODELDATA.name/* s.data.name */),
  6442. K.on(ae.OPENED, (r = document.getElementById("share-modal"),
  6443. function() {
  6444. _e("share"),
  6445. V.open(r)
  6446. }
  6447. )),
  6448. K.on(ae.CLOSED, V.reset)),
  6449. //1 < s.heroLocations.length ? function(e, i, t) {
  6450. 0 < s.heroLocations.length ? function(e, i, t) {
  6451. var n = 100 / (fe = e.heroLocations.length) + "%"
  6452. , r = $("#thumb-container")
  6453. , o = $("#progressBar");
  6454. $("#status").find(".totalSteps").text(fe);
  6455. for (var a = 0; a < fe; a++) {
  6456. var s = e.heroLocations[a]
  6457. , l = $('<li class="thumbImg" data-index=""><img src=""></li>');
  6458. var tmp = s.thumbUrl.replace('https://','').replace('http://','')
  6459. if (l.attr("data-index", a),
  6460. //Ce.highlight.visible && l.find("img").attr("src",'https://'+tmp),
  6461. Ce.highlight.visible && l.find("img").attr("src", 'http://'+tmp),// xzw改 导览图片 https在某些服务器打不开
  6462. s.name) {
  6463. var c = $('<div class="overlay"></div>').text(s.name);
  6464. l.prepend(c)
  6465. }
  6466. if (e.has360Views && s.cameraMode === ie.PANORAMA) {
  6467. var h = e.panos.get(s.panoId)
  6468. , 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>';
  6469. l.prepend(u)
  6470. }
  6471. r.append(l),
  6472. o.append('<div class="step" data-idx="' + a + '" style="width:' + n + '"></div>')
  6473. }
  6474. T = 144 * fe,
  6475. 111 * fe,
  6476. $(".thumbImg").on("mouseover", function() {
  6477. !function(e) {
  6478. return e.describe().inTransition
  6479. }(i) && t.showPathToHeroLocation($(this).data("index"))
  6480. }),
  6481. $(".thumbImg").on("mouseout", function() {
  6482. i.clearPath()
  6483. }),
  6484. $(".thumbImg").on("click", function(e) {
  6485. y(e);
  6486. var t = $(this);
  6487. R.updateInteraction(oe.InteractionGui, "thumbnail"),
  6488. R.trackAlways("showcase_gui", {
  6489. gui_action: "click_highlight"
  6490. }),
  6491. i.goToHighlight(t.data("index"))
  6492. }),
  6493. $(".previous").find("a").on("click", function(e) {
  6494. y(e),
  6495. R.trackAlways("showcase_gui", {
  6496. gui_action: "prev_highlight"
  6497. }),
  6498. i.prevHighlight()
  6499. }),
  6500. $(".next").find("a").on("click", function(e) {
  6501. y(e),
  6502. R.trackAlways("showcase_gui", {
  6503. gui_action: "next_highlight"
  6504. }),
  6505. i.nextHighlight()
  6506. }),
  6507. $("#drawer").on("mouseleave", function(t) {
  6508. var i;
  6509. y(t);
  6510. try {
  6511. i = new MouseEvent("mouseup",{
  6512. clientX: t.clientX,
  6513. clientY: t.clientY,
  6514. screenX: t.screenX,
  6515. screenY: t.screenY
  6516. })
  6517. } catch (e) {
  6518. (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)
  6519. }
  6520. document.dispatchEvent(i)
  6521. }),
  6522. (w = new Sly($("#scrollFrame"),{
  6523. horizontal: !0,
  6524. itemNav: "centered",
  6525. smart: !0,
  6526. scrollTrap: !0,
  6527. scrollBy: 1,
  6528. mouseDragging: !0,
  6529. touchDragging: !0,
  6530. speed: 300,
  6531. dragHandle: !0,
  6532. dynamicHandle: !0,
  6533. clickBar: !0,
  6534. scrollBar: $("#scroller"),
  6535. activateOn: null
  6536. }).init()).on("active", function(e, t) {
  6537. t,
  6538. _e("tour"),
  6539. $(".step").removeClass("active"),
  6540. $("#status").find(".curIdx").text(t + 1);
  6541. for (var i = 0; i <= t; i++)
  6542. $("#progressBar").find("[data-idx='" + i + "']").addClass("active")
  6543. }),
  6544. E()
  6545. }(s, l, c) : (Ce.highlight.visible = !1,
  6546. Ce.tourControls.visible = !1),
  6547. z.on(G.OPEN_INFO, _e.bind(this, "info")),
  6548. function() {
  6549. var n;
  6550. document.body.addEventListener("mousedown", function(e) {
  6551. n = 0 === e.button || 1 === e.which ? e.target : null
  6552. }, !0),
  6553. document.body.addEventListener("mouseup", function(t) {
  6554. n !== t.target && (n = b(n, t.target));
  6555. var e = document.getElementById("gui-parent");
  6556. if (b(e, n) !== e && (n = null),
  6557. n) {
  6558. var i;
  6559. try {
  6560. i = new MouseEvent("click",t)
  6561. } catch (e) {
  6562. (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)
  6563. }
  6564. i.syntheticClick = !0,
  6565. n.dispatchEvent(i),
  6566. n = null
  6567. }
  6568. }, !0),
  6569. document.getElementById("gui-parent").addEventListener("click", function(e) {
  6570. e.syntheticClick || (e.stopPropagation(),
  6571. "A" === e.target.nodeName && e.preventDefault())
  6572. }, !0)
  6573. }(),
  6574. A(c),
  6575. C(s, t),
  6576. s.on("floor.changed", I),
  6577. s.on("waiting", function(e) {
  6578. _(e)
  6579. }
  6580. .bind(this, s)),
  6581. s.on("waiting-done", function(e) {
  6582. _(e)
  6583. }
  6584. .bind(this, s)),
  6585. c.on(re.ModeChanged, function(e, t) {
  6586. A(c),
  6587. v(l, c),
  6588. t === ie.PANORAMA && c.currentPano && !c.currentPano.isAligned() && (t = ie.OUTDOOR),
  6589. U.updateMode(t)
  6590. }),
  6591. e.on(oe.Move, _e.bind(this, "move")),
  6592. c.on(re.Ready, function() {
  6593. O.init(e, c, c.tagManager, l),
  6594. c.on(re.ModeChanged, function(e, t) {
  6595. e !== t && $(".vr-popup").is(":visible") && X.dismiss()
  6596. })
  6597. }),
  6598. c.on(re.PanoChosen, function(e, t) {
  6599. A(c, t),
  6600. U.updateMode(t && !t.isAligned() ? ie.OUTDOOR : ie.PANORAMA)
  6601. }),
  6602. V.on(k.CLOSE, function(e) {
  6603. switch (e) {
  6604. case "vr-modal":
  6605. X.dismiss();
  6606. break;
  6607. case "share-modal":
  6608. K.hide();
  6609. break;
  6610. case "terms-modal":
  6611. W.hide()
  6612. }
  6613. });
  6614. 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();
  6615. l.on("update.controls", function() {
  6616. var e, t, i, n = l.describe();
  6617. if (n.tourIsPlaying || c.isWarping() ? (Ce.tourControls.visible && (h.hide(),
  6618. u.show()),
  6619. n.tourInProgress && (d.forEach(function(e) {
  6620. e.classList.add("playing")
  6621. }),
  6622. p.addClass("playing"),
  6623. f.addClass("playing"))) : (Ce.tourControls.visible && (h.show(),
  6624. u.hide()),
  6625. n.tourInProgress || (q.stopTour(),
  6626. d.forEach(function(e) {
  6627. e.classList.remove("playing")
  6628. }),
  6629. p.removeClass("playing"),
  6630. f.removeClass("playing"))),
  6631. null !== n.currentItem) {
  6632. var r, o;
  6633. $("#status").find(".curIdx").text(n.currentItem + 1),
  6634. n.onTheBus ? (r = "active",
  6635. o = "recent") : (o = "active",
  6636. r = "recent");
  6637. var a = null === n.destinationItem || n.currentItem === n.destinationItem;
  6638. for (e = 0; e < s.heroLocations.length; e += 1)
  6639. i = g.eq(e),
  6640. t = m.eq(e),
  6641. i.removeClass(o),
  6642. t.removeClass(o),
  6643. n.onTheBus && e === n.destinationItem ? (i.addClass(r),
  6644. t.addClass(r),
  6645. w.activate(e)) : n.onTheBus && a && e === n.currentItem ? (i.addClass(r),
  6646. t.addClass(r)) : (i.removeClass(r),
  6647. t.removeClass(r))
  6648. } else
  6649. for (e = 0; e < s.heroLocations.length; e += 1)
  6650. i = g.eq(e),
  6651. t = m.eq(e),
  6652. i.removeClass("active recent"),
  6653. t.removeClass("active recent");
  6654. v(l, c)
  6655. }),
  6656. document.addEventListener("keydown", function(e) {
  6657. switch (R.updateInteraction(oe.InteractionKey),
  6658. e.which) {
  6659. case te.ZERO:
  6660. M.debug && s.toggleAlpha();
  6661. break;
  6662. case te.NINE:
  6663. M.debug && B.toggle();
  6664. break;
  6665. case te.ONE:
  6666. c.isInMode(ie.TRANSITIONING) || l.changeMode(ie.PANORAMA);
  6667. break;
  6668. case te.TWO:
  6669. s.outsideAllowed() && !c.isInMode(ie.DOLLHOUSE, ie.TRANSITIONING) && l.changeMode(ie.DOLLHOUSE);
  6670. break;
  6671. case te.THREE:
  6672. s.outsideAllowed() && !c.isInMode(ie.FLOORPLAN, ie.TRANSITIONING) && l.changeMode(ie.FLOORPLAN);
  6673. break;
  6674. case te.FOUR:
  6675. c.isInMode(ie.TRANSITIONING) || l.changeMode(ie.OUTDOOR);
  6676. break;
  6677. case te.SPACE:
  6678. Ce.tourControls.visible && ($("#playHead").hasClass("playing") || _e("tour"));
  6679. break;
  6680. case te.RETURN:
  6681. M.debug && s.toggleExplodeUp();
  6682. break;
  6683. case te.P:
  6684. !function(e) {
  6685. me.gui || (me.gui = function(e) {
  6686. var t = new he.GUI;
  6687. return t.add(M, "showSweeps").name("Show sweeps").onFinishChange(function() {
  6688. e.setSweepVisibility(M.showSweeps)
  6689. }),
  6690. t.add(M, "rotationAccelerationInside", .1, 10).name("Rotation speed").step(.1),
  6691. t.add(M.transition, "flyTime", 0, 5e3).name("Transition time").onFinishChange(function() {
  6692. M.transition.flySpeed = 0,
  6693. t.__controllers.forEach(function(e) {
  6694. e.updateDisplay()
  6695. })
  6696. }),
  6697. t.add(M.path, "opacity", 0, 1).name("Path opacity"),
  6698. $(t.__closeButton).hide(),
  6699. t
  6700. }(me.model)),
  6701. (me.visible = e) ? $(me.gui.domElement).show() : $(me.gui.domElement).hide()
  6702. }(!me.visible);
  6703. break;
  6704. case te.U:
  6705. !function(e) {
  6706. ve.gui || (ve.gui = function(t, i) {
  6707. function e() {
  6708. var e = i.toJSON();
  6709. n.linkToLocation = window.location.protocol + "//" + window.location.host + window.location.pathname + "?m=" + t.sid + "&start=" + ee.serialize(e),
  6710. i.tagManager.activeTag && (n.linkToLocation += "&tag=" + i.tagManager.activeTag.sid)
  6711. }
  6712. var n = {}
  6713. , r = new he.GUI({
  6714. autoPlace: !0,
  6715. width: "60%"
  6716. });
  6717. return e(),
  6718. i.on(re.ViewChanged, e),
  6719. r.add(n, "linkToLocation").name(se.LINK_TO_LOCATION).listen(),
  6720. r.domElement.id = "datLinks",
  6721. [].slice.call(r.domElement.querySelectorAll(".property-name")).forEach(function(e) {
  6722. if (!S.detectSafari()) {
  6723. var t = document.createElement("button");
  6724. t.classList.add("btn-deep-link"),
  6725. t.innerText = se.MENU_COPY,
  6726. e.nextSibling.appendChild(t);
  6727. var n = function() {
  6728. alert(se.LINK_ALERT_COPY),
  6729. t.hide()
  6730. };
  6731. t.addEventListener("click", function(e) {
  6732. try {
  6733. var t = e.target.parentNode.childNodes[0];
  6734. t.select();
  6735. var i = document.execCommand("copy");
  6736. t.blur(),
  6737. i || n()
  6738. } catch (e) {
  6739. n()
  6740. }
  6741. })
  6742. }
  6743. }),
  6744. $(r.__closeButton).hide(),
  6745. r
  6746. }(ve.model, ve.player)),
  6747. (ve.visible = e) ? $(ve.gui.domElement).show() : $(ve.gui.domElement).hide()
  6748. }(!ve.visible);
  6749. break;
  6750. case te.X:
  6751. M.debug && s.toggleExplode();
  6752. break;
  6753. case te.PLUSEQUALS:
  6754. l.player.activatePersistentZooming(!0),
  6755. O.hideUi();
  6756. break;
  6757. case te.DASHUNDERSCORE:
  6758. l.player.activatePersistentZooming(!1),
  6759. O.hideUi();
  6760. break;
  6761. case te.SEVEN:
  6762. ue.info("Zoom level: " + l.player.zoomLevel + ", FOV: " + l.player.zoomFov);
  6763. break;
  6764. case te.EIGHT:
  6765. l.player.decreaseZoomSpeed();
  6766. break;
  6767. case te.NINE:
  6768. l.player.increaseZoomSpeed()
  6769. }
  6770. return c && c.reticule.hide(),
  6771. !0
  6772. }
  6773. .bind(this)),
  6774. document.addEventListener("keyup", function(e) {
  6775. switch (e.which) {
  6776. case te.PLUSEQUALS:
  6777. l.player.deactivatePersistentZooming();
  6778. break;
  6779. case te.DASHUNDERSCORE:
  6780. l.player.deactivatePersistentZooming()
  6781. }
  6782. }
  6783. .bind(this)),
  6784. function(e) {
  6785. me = {
  6786. gui: null,
  6787. visible: !1,
  6788. model: e
  6789. }
  6790. }(s),
  6791. function(e, t) {
  6792. ve = {
  6793. gui: null,
  6794. visible: !1,
  6795. model: e,
  6796. player: t
  6797. }
  6798. }(s, l.player),
  6799. function(e) {
  6800. function t(e, i) {
  6801. $(e).find("a").each(function(e, t) {
  6802. i ? $(t).removeClass("buttonZoomDisabled").addClass("buttonZoomEnabled") : $(t).addClass("buttonZoomDisabled").removeClass("buttonZoomEnabled"),
  6803. t.style.pointerEvents = i ? "auto" : "none"
  6804. })
  6805. }
  6806. e.on(de.ZoomMax, function() {
  6807. t("#gui-zoomin", !1),
  6808. t("#gui-zoomout", !0)
  6809. }),
  6810. e.on(de.ZoomMin, function() {
  6811. t("#gui-zoomin", !0),
  6812. t("#gui-zoomout", !1)
  6813. }),
  6814. e.on(de.ZoomIn, function() {
  6815. t("#gui-zoomout", !0)
  6816. }),
  6817. e.on(de.ZoomOut, function() {
  6818. t("#gui-zoomin", !0)
  6819. }),
  6820. e.zoomLevel >= M.zoom.max ? t("#gui-zoomin", !1) : t("#gui-zoomin", !0),
  6821. e.zoomLevel <= M.zoom.min ? t("#gui-zoomout", !1) : t("#gui-zoomout", !0)
  6822. }(c),
  6823. P.setAutoPlay(s.heroCount()),
  6824. U.init(c, i.mode),
  6825. U.on(H.OPENED, _e.bind(this, "help")),
  6826. W.init(),
  6827. W.on(j.OPENED, (o = document.getElementById("terms-modal"),
  6828. function() {
  6829. _e("terms"),
  6830. V.open(o)
  6831. }
  6832. )),
  6833. W.on(j.CLOSED, V.reset),
  6834. M.quickstart.enabled || D.delayLanding(i.mode).then(D.showMessage.bind(this, c, l, Ce.coBrand.visible)),
  6835. (M.quickstart.enabled || c.model.outsideAllowed()) && O.init(e, c, c.tagManager, l),
  6836. M.profiling.enabled && B.show(),
  6837. q.init(l)
  6838. }
  6839. ,
  6840. Le.exports.startLoading = function(e, t, i, n, r, o) {
  6841. function a() {
  6842. o.setLoadingStartTime(),
  6843. function() {
  6844. function e(e) {
  6845. e.target === t || $.contains(t, e.target) || e.target === i || $.contains(i, e.target) || e.target === n || $.contains(n, e.target)
  6846. }
  6847. $("body").css("touch-action", "none"),
  6848. $("#gui-parent").find("*:not(#tag-billboards)").on("touchmove", function(e) {});
  6849. var t = document.getElementById("terms-text")
  6850. , i = document.getElementById("more-help-wrapper")
  6851. , n = (document.getElementById("navigation-help-wrapper"),
  6852. document.getElementById("help-dialog"),
  6853. document.getElementById("tag-billboards"));
  6854. M.useWheel && (document.body.addEventListener("mousewheel", e, {
  6855. passive: !1
  6856. }),
  6857. document.body.addEventListener("DOMMouseScroll", e)),
  6858. $("#terms-text, #more-help-wrapper, #navigation-help-wrapper").off("touchmove").on("touchmove", function(e) {
  6859. e.stopPropagation()
  6860. })
  6861. }(),
  6862. r ? (D.showMessage(t, i, Ce.coBrand.visible),
  6863. l()) : function(e) {
  6864. L.show(e),
  6865. c()
  6866. }(l)
  6867. }
  6868. var s = $.Deferred()
  6869. , l = s.resolve.bind(s);
  6870. ye = !0,
  6871. _(e);
  6872. e.data.player_options && function(e) {
  6873. Ce.tourControls.visible = true//e.tour_buttons && S.valueFromHash("gt", 1),
  6874. Ce.coBrand.visible = e.presented_by && 1 !== M.specialEdition && M.brand && !S.valueFromHash("mls", !1),
  6875. Ce.highlight.visible = /* e.highlight_reel && */ 1 !== M.specialEdition && M.showHighlights
  6876. }(e.data.player_options),
  6877. 1 === M.specialEdition && $("body").addClass("specialEdition");
  6878. se.localizeGUI();
  6879. !function(i) {
  6880. function e(e, t) {
  6881. return !!i.player_options[e] && i[t || e]
  6882. }
  6883. $(".model-title").text(i.name);
  6884. var t = M.pageTitle;
  6885. 2 !== S.valueFromHash("mls", 0) && i.name && (t = i.name),
  6886. document.title = t,
  6887. S.isMobile() ? $("#gui-fullscreen").css("display", "none") : ($("[rel=tooltip]").tooltip({
  6888. delay: {
  6889. show: 50,
  6890. hide: 0
  6891. },
  6892. trigger: "hover",
  6893. html: !1,
  6894. viewport: {
  6895. selector: "body",
  6896. padding: 10
  6897. }
  6898. }),
  6899. S.inIframe() && document.getElementsByClassName("pinBottom-container")[0].classList.add("embed")),
  6900. z.populate({
  6901. name: e("model_name", "name"),
  6902. coBrand: e("presented_by"),
  6903. description: e("model_summary", "summary") || "暂无内容",
  6904. contactName: e("contact_name"),
  6905. address: e("address"),
  6906. phone: e("contact_phone"),
  6907. formattedPhone: i.formatted_contact_phone,
  6908. email: e("contact_email"),
  6909. url: e("external_url"),
  6910. socialSharing: i.enable_social_sharing && i.is_public
  6911. })
  6912. }(e.data);
  6913. r || $(".quick").addClass("hidden");
  6914. n ? (R.impression(),
  6915. a()) : (o.setWaitingStartTime(),
  6916. N.show(r, a))
  6917. return s
  6918. }
  6919. ,
  6920. Le.exports.endLoading = function(e, t, i) {
  6921. var n = t.player;
  6922. function r() {
  6923. i.dismissExaminedTag(),
  6924. i.disableHovering()
  6925. }
  6926. $("#gui-thumb").fadeOut(2500),
  6927. L.hide(function() {
  6928. ye = !1
  6929. }),
  6930. Y.init(e, i),
  6931. z.finishSetup(Object.keys(e.tags).length),
  6932. i.on(ne.IMAGE_OPENED, _e.bind(this, "tag")),
  6933. X.on(Z.OPENED, r),
  6934. K.on(ae.OPENED, r),
  6935. U.on(H.OPENED, r),
  6936. W.on(j.OPENED, r);
  6937. var o = i.enableHovering.bind(i);
  6938. if (X.on(Z.CLOSED, o),
  6939. K.on(ae.CLOSED, o),
  6940. U.on(H.CLOSED, o),
  6941. W.on(j.CLOSED, o),
  6942. M.labels.enabled && Object.keys(e.labels).length,
  6943. e.floors.length <= 1 || !Ce.floors.visible ? Ce.floors.visible = !1 : (h(e, t),
  6944. I(e.currentFloor, n.mode)),
  6945. "372" === getQueryVariable("m") && (Ce.floors.visible = 1,
  6946. h(e, t)),
  6947. c(),
  6948. v(t, t.player),
  6949. $("#gui").fadeIn(1500),
  6950. Ce.highlight.visible && (2 !== M.startHighlights || e.has360Views) && setTimeout(function() {
  6951. l(),
  6952. (!e.has360Views && 1 !== M.startHighlights || e.has360Views && 0 === M.startHighlights) && setTimeout(l, 2e3)
  6953. }, 2e3),
  6954. !S.isMobile())
  6955. for (var a = ["a", "#title-toggle", ".next-button", ".prev-button", ".gui-floor", ".meta-toggle", ".thumbImg", "logo-button"], s = 0; s < a.length; s++)
  6956. $(a[s]).addClass("hasHover");
  6957. _(e),
  6958. z.setupToggling(),
  6959. window.editHotPanel && editHotPanel(),
  6960. function() {
  6961. var i = $("#pullTab")
  6962. , e = {
  6963. bottom: {
  6964. "border-bottom-left-radius": "10px",
  6965. "border-bottom-right-radius": "10px"
  6966. },
  6967. top: {
  6968. "border-top-left-radius": "10px",
  6969. "border-top-right-radius": "10px"
  6970. }
  6971. }
  6972. , t = {
  6973. bottom: {
  6974. "border-top-right-radius": "10px",
  6975. "border-bottom-right-radius": "10px"
  6976. },
  6977. top: {
  6978. "border-bottom-left-radius": "10px",
  6979. "border-top-left-radius": "10px"
  6980. }
  6981. };
  6982. function n(e, t) {
  6983. $("#gui-modes-map > div:visible:last").css(e),
  6984. i.is(":visible") ? $(".viewContainer > div:visible:first").css(t) : $("#gui-modes-map > div:visible:first").css(t)
  6985. }
  6986. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? n(e.bottom, e.top) : n(t.bottom, t.top);
  6987. (window.MP_PREFETCHED_MODELDATA.model.special || "true" === window.MP_PREFETCHED_MODELDATA.special) && window.specialScene && specialScene.special().afterImplement()
  6988. }(),
  6989. window.EditTools && (window.editTool = new EditTools(n.sceneRenderer))
  6990. }
  6991. ,
  6992. Le.exports.onProgress = function(e) {
  6993. L.progress(e)
  6994. }
  6995. }
  6996. ).call(this, "/js/gui/gui.js")
  6997. }
  6998. , {
  6999. "../analytics": 4,
  7000. "../controls/serializer": 14,
  7001. "../enum/AlignmentType": 17,
  7002. "../enum/BlackoutStyle": 18,
  7003. "../enum/ControlEvents": 21,
  7004. "../enum/DirectorEvents": 23,
  7005. "../enum/Keys": 30,
  7006. "../enum/PathDiscardMode": 38,
  7007. "../enum/PathDisplayMode": 39,
  7008. "../enum/PlayerEvents": 40,
  7009. "../enum/VROption": 47,
  7010. "../enum/Vectors": 50,
  7011. "../enum/Viewmode": 51,
  7012. "../enum/WarpStyle": 52,
  7013. "../enum/ZoomEvents": 53,
  7014. "../lib/dat.gui": 93,
  7015. "../localization/localize": 108,
  7016. "../tag/Media/MediaEvent": 131,
  7017. "../objects/Snapshot": 153,
  7018. "../settings": 166,
  7019. "../util/ajax": 181,
  7020. "../util/browser": 182,
  7021. "../util/camera": 183,
  7022. "../util/logger": 189,
  7023. "../util/showcase": 193,
  7024. "../util/transitions": 195,
  7025. "./closer/ModalCloserEvent": 61,
  7026. "./closer/modalCloser": 62,
  7027. "./help/HelpEvent": 66,
  7028. "./help/help": 67,
  7029. "./helpManager": 68,
  7030. "./immersiveMode": 69,
  7031. "./konami": 70,
  7032. "./landingScreen": 71,
  7033. "./loadingScreen": 72,
  7034. "./memoryUsage": 73,
  7035. "./playButton": 74,
  7036. "./populateModal": 75,
  7037. "./sharing/ShareEvents": 76,
  7038. "./sharing/modal": 77,
  7039. "./terms/TermsEvent": 78,
  7040. "./terms/terms": 79,
  7041. "./title/TitleEvents": 80,
  7042. "./title/tagToggle": 81,
  7043. "./title/titleBar": 82,
  7044. "./tourInteraction": 84,
  7045. "./vr/vrEvent": 85,
  7046. "./vr/vrModal": 87,
  7047. "./webvr/WebVrEvent": 88,
  7048. "./webvr/webVRgui": 89,
  7049. three: 217
  7050. }],
  7051. 66: [function(e, t, i) {
  7052. "use strict";
  7053. t.exports = Object.freeze({
  7054. OPENED: "help.opened",
  7055. CLOSED: "help.closed"
  7056. })
  7057. }
  7058. , {}],
  7059. 67: [function(e, t, i) {
  7060. "use strict";
  7061. function n() {
  7062. p.on("click", function(e) {
  7063. T && T !== a.TRANSITIONING && (0 < window.getComputedStyle(v).getPropertyValue("opacity") && !x ? S.close() : T && T !== a.TRANSITIONING && (x = !0,
  7064. setTimeout(function() {
  7065. x = !1
  7066. }, h.help.modalStayDuration),
  7067. S.emit(l.OPENED),
  7068. f.addClass("open " + T),
  7069. p.addClass("open"),
  7070. o(),
  7071. r(),
  7072. v.style.removeProperty ? v.style.removeProperty("display") : v.style.removeAttribute("display"),
  7073. v.classList.add("fadeIn")))
  7074. }),
  7075. E.on("click", function(e) {
  7076. S.close()
  7077. }),
  7078. C.on("click", function(e) {
  7079. T && T !== a.TRANSITIONING && (o(),
  7080. r())
  7081. }),
  7082. I.on("click", function(e) {
  7083. o(),
  7084. I.addClass("underline-tab"),
  7085. c.fill(b, s.MORE_HELP),
  7086. f.addClass("more-help")
  7087. })
  7088. }
  7089. function r() {
  7090. C.addClass("underline-tab"),
  7091. c.fill(_, s.NAVIGATION, T),
  7092. f.addClass(T)
  7093. }
  7094. function o() {
  7095. f.removeClass("more-help " + a.PANORAMA + " " + a.DOLLHOUSE + " " + a.FLOORPLAN + " " + a.OUTDOOR),
  7096. A.forEach(function(e) {
  7097. e.classList.remove("underline-tab")
  7098. })
  7099. }
  7100. var a = e("../../enum/Viewmode")
  7101. , s = e("../../enum/HelpModalType")
  7102. , l = e("./HelpEvent")
  7103. , c = (e("../helpManager"),
  7104. e("./../populateModal"))
  7105. , h = e("../../settings")
  7106. , u = e("../../util/common")
  7107. , d = e("events").EventEmitter
  7108. , p = $(".footer-help").eq(0)
  7109. , f = $("#help-dialog").eq(0)
  7110. , g = document.querySelector("#quick-logo")
  7111. , m = document.querySelector("#loaderCoBrand")
  7112. , v = document.querySelector("#help-dialog")
  7113. , y = document.querySelector(".footer")
  7114. , A = $(".help-tabs").children().toArray()
  7115. , C = $(".navigation-tab").eq(0)
  7116. , I = $(".more-help-tab").eq(0)
  7117. , E = ($("#interaction-modal").eq(0).find(".interaction").toArray(),
  7118. f.find(".close").eq(0))
  7119. , _ = f.find(".interactions").toArray()
  7120. , b = f.find(".ui-instructions").toArray()
  7121. , w = a.PANORAMA
  7122. , T = a.PANORAMA
  7123. , x = !1
  7124. , S = {
  7125. init: function(e, t) {
  7126. w = T = t,
  7127. [v, m, g, y].forEach(function(e) {
  7128. e.classList.add(c.deviceType)
  7129. }),
  7130. n()
  7131. },
  7132. close: function() {
  7133. if (f.hasClass("open") && (this.emit(l.CLOSED),
  7134. p.removeClass("open"),
  7135. f.removeClass("open"),
  7136. v.classList.contains("fadeIn"))) {
  7137. v.classList.remove("fadeIn");
  7138. var e = T === a.TRANSITIONING ? w : T;
  7139. c.clear(_, s.NAVIGATION, e)
  7140. }
  7141. },
  7142. updateMode: function(e) {
  7143. w = T,
  7144. T = e
  7145. }
  7146. };
  7147. u.extendObject(S, d.prototype),
  7148. t.exports = S
  7149. }
  7150. , {
  7151. "../../enum/HelpModalType": 28,
  7152. "../../enum/Viewmode": 51,
  7153. "../../settings": 166,
  7154. "../../util/common": 185,
  7155. "../helpManager": 68,
  7156. "./../populateModal": 75,
  7157. "./HelpEvent": 66,
  7158. events: 202
  7159. }],
  7160. 68: [function(s, l, e) {
  7161. (function(e) {
  7162. "use strict";
  7163. var t = s("../util/browser")
  7164. , i = s("./../util/logger")
  7165. , n = s("./../settings")
  7166. , r = new i(e)
  7167. , o = function() {
  7168. var t;
  7169. try {
  7170. return t = window.localStorage.getItem("visitCount") || "0",
  7171. t = (parseFloat(t) + 1).toString(),
  7172. window.localStorage.setItem("visitCount", t),
  7173. r.debug("visitCount = " + t),
  7174. t
  7175. } catch (e) {
  7176. t = "1",
  7177. r.debug("couldn't set local storage")
  7178. }
  7179. }()
  7180. , a = !1;
  7181. l.exports = {
  7182. isHelpDisabled: function() {
  7183. return "0" === t.valueFromHash("help", null) || a
  7184. },
  7185. isLargeHelpEnabled: function() {
  7186. return ("1" === o || "1" === t.valueFromHash("help", null)) && !this.isHelpDisabled()
  7187. },
  7188. isSmallHelpEnabled: function() {
  7189. return "2" === t.valueFromHash("help", null) && !this.isHelpDisabled()
  7190. },
  7191. isHelpEnabled: function() {
  7192. return this.isLargeHelpEnabled() || this.isSmallHelpEnabled()
  7193. },
  7194. setAutoPlay: function(e) {
  7195. a = 0 <= n.warp.auto && 1 < e
  7196. }
  7197. }
  7198. }
  7199. ).call(this, "/js/gui/helpManager.js")
  7200. }
  7201. , {
  7202. "../util/browser": 182,
  7203. "./../settings": 166,
  7204. "./../util/logger": 189
  7205. }],
  7206. 69: [function(e, t, i) {
  7207. "use strict";
  7208. function r(e) {
  7209. M || n(e) && C.hasClass("playing") || (clearTimeout(x),
  7210. T = !0,
  7211. h.close(),
  7212. function(e) {
  7213. !n(e) && S ? v.forEach(function(e) {
  7214. e.classList.remove("drawerOpen"),
  7215. e.classList.add("duringTour")
  7216. }) : C.hasClass("open") ? v.forEach(function(e) {
  7217. e.classList.remove("duringTour"),
  7218. e.classList.add("drawerOpen")
  7219. }) : P || R === g.FLOORPLAN || R === g.DOLLHOUSE || v.forEach(function(e) {
  7220. e.classList.add("fadeOut")
  7221. })
  7222. }(e),
  7223. R !== g.DOLLHOUSE && R !== g.FLOORPLAN && (E.hasClass("expand") && !_.hasClass("closed") || l.valueFromHash("title", 1),
  7224. C.hasClass("playing") || (y.forEach(function(e) {
  7225. e.classList.add("detectHover")
  7226. }),
  7227. x = setTimeout(a, c.immersive.timeToShowAgain))))
  7228. }
  7229. function o() {
  7230. C.hasClass("playing") || (clearTimeout(x),
  7231. x = setTimeout(a, c.immersive.timeToShowAgain))
  7232. }
  7233. function a() {
  7234. clearTimeout(x),
  7235. T = !1,
  7236. m.forEach(function(e) {
  7237. e.classList.remove("drawerOpen")
  7238. }),
  7239. S || v.forEach(function(e) {
  7240. e.classList.remove("duringTour")
  7241. }),
  7242. y.forEach(function(e) {
  7243. e.classList.remove("detectHover")
  7244. })
  7245. }
  7246. function s() {
  7247. T ? a() : r(),
  7248. M = !0,
  7249. setTimeout(function() {
  7250. M = !1
  7251. }, c.immersive.uiStayDuration)
  7252. }
  7253. function n(e) {
  7254. return "mouse" === e || "touch" === e || "key" === e || "gui" === e
  7255. }
  7256. var l = e("../util/browser")
  7257. , c = e("../settings")
  7258. , h = e("./help/help")
  7259. , u = e("../enum/tagEvents")
  7260. , d = e("../enum/ControlEvents")
  7261. , p = e("../enum/PlayerEvents")
  7262. , f = e("../enum/DirectorEvents")
  7263. , g = (p = e("../enum/PlayerEvents"),
  7264. e("../enum/Viewmode"))
  7265. , m = $(".pinTop.left, .pinBottom-container, #drawer-container, #drawer, .footer").toArray()
  7266. , v = $(".pinBottom-container, #drawer-container, .footer").toArray()
  7267. , y = $("#hover-bottom, #hover-top").toArray()
  7268. , A = ($("#pullTab").eq(0),
  7269. $("#playHead").eq(0),
  7270. $(".pinBottom-container").eq(0))
  7271. , C = $("#drawer").eq(0)
  7272. , I = $("#drawer-container").eq(0)
  7273. , E = $("#meta-info").eq(0)
  7274. , _ = $(".pinTop.left").eq(0)
  7275. , b = $("#player").eq(0)
  7276. , w = document.getElementById("pullTab")
  7277. , T = !1
  7278. , x = null
  7279. , S = !1
  7280. , M = !1
  7281. , R = null
  7282. , P = !1;
  7283. t.exports.init = function(e, t, i, n) {
  7284. (function(t, i, e, n) {
  7285. [g.PANORAMA, g.DOLLHOUSE, g.FLOORPLAN].forEach(function(e) {
  7286. t.controls[e].on(d.Move, r),
  7287. t.controls[e].on(d.LongTap, s)
  7288. }),
  7289. b.on("mousewheel DOMMouseScroll", r),
  7290. e.on(u.TagActivated, r),
  7291. e.on(u.TagNavigation, r),
  7292. i.on(p.FlyingEnded, o),
  7293. i.on(p.ModeChanging, function(e, t) {
  7294. P = t !== g.PANORAMA && e !== g.PANORAMA
  7295. }),
  7296. i.on(p.ModeChanged, function(e, t) {
  7297. R = i.mode,
  7298. t !== g.TRANSITIONING ? a() : r("modeChange")
  7299. }),
  7300. n.on(f.TourStart, function() {
  7301. S = !0,
  7302. r()
  7303. }),
  7304. n.on(f.TourEnd, function() {
  7305. S = !1,
  7306. a()
  7307. }),
  7308. n.on(f.ActionInterrupted, function() {
  7309. S = !1
  7310. }),
  7311. w.addEventListener("touchend", function() {
  7312. $("#pullTab").hasClass("opened") && !S && a()
  7313. }, !0)
  7314. }
  7315. )(e, t, i, n),
  7316. l.isMobile() ? (y.forEach(function(e) {
  7317. e.classList.add("mobile")
  7318. }),
  7319. A.click(a)) : (y.forEach(function(e) {
  7320. e.addEventListener("mouseleave", function() {
  7321. !b.is(":hover") && y[0].classList.contains("detectHover") && a()
  7322. }, !0)
  7323. }),
  7324. b.mouseleave(function() {
  7325. y[0].classList.contains("detectHover") && a()
  7326. })),
  7327. R = t.mode
  7328. }
  7329. ,
  7330. t.exports.hideUi = r,
  7331. t.exports.resetDrawer = function() {
  7332. I.hasClass("duringTour") || (S = !1,
  7333. r("gui"),
  7334. a())
  7335. }
  7336. }
  7337. , {
  7338. "../enum/ControlEvents": 21,
  7339. "../enum/DirectorEvents": 23,
  7340. "../enum/tagEvents": 32,
  7341. "../enum/PlayerEvents": 40,
  7342. "../enum/Viewmode": 51,
  7343. "../settings": 166,
  7344. "../util/browser": 182,
  7345. "./help/help": 67
  7346. }],
  7347. 70: [function(i, n, e) {
  7348. (function(e) {
  7349. "use strict";
  7350. var t = i("./../util/logger")
  7351. , o = i("./../settings")
  7352. , a = i("./debug")
  7353. , s = i("./../util/common")
  7354. , l = (i("./gui"),
  7355. new t(e));
  7356. o.console && $("body").append('<div id="debug-console"></div>'),
  7357. n.exports.init = function(i, n, r) {
  7358. l.debug("konami has the modelInstance");
  7359. var t = [];
  7360. $(window).on("keydown", function(e) {
  7361. t.push(e.which),
  7362. t.length > o.secretPanelWord.length && t.shift(),
  7363. s.equalLists(t, o.secretPanelWord) && (l.debug("Developer mode active."),
  7364. o.debug = !0)
  7365. }),
  7366. $(window).on("keydown", function e(t) {
  7367. o.debug && 72 === t.which && (i && r ? (a.toggle(i, n, r),
  7368. $(window).off("keydown", e)) : console.warn("sorry we're not ready yet"))
  7369. })
  7370. }
  7371. }
  7372. ).call(this, "/js/gui/konami.js")
  7373. }
  7374. , {
  7375. "./../settings": 166,
  7376. "./../util/common": 185,
  7377. "./../util/logger": 189,
  7378. "./debug": 63,
  7379. "./gui": 65
  7380. }],
  7381. 71: [function(e, t, i) {
  7382. "use strict";
  7383. function r() {
  7384. s.clear(m, l.LANDING[v]),
  7385. g.removeClass("fadeIn")
  7386. }
  7387. var o = e("../settings")
  7388. , a = (e("./help/help"),
  7389. e("./helpManager"))
  7390. , s = e("./populateModal")
  7391. , l = e("../enum/HelpModalType")
  7392. , n = e("../enum/Viewmode")
  7393. , c = e("../enum/DirectorEvents")
  7394. , h = e("../enum/PlayerEvents")
  7395. , u = $("#quick-blackout").eq(0)
  7396. , d = $("#quick-logo").eq(0)
  7397. , p = $(".quick-brand").toArray()
  7398. , f = $("#loaderCoBrand").eq(0)
  7399. , g = $("#interaction-modal").eq(0)
  7400. , m = g.find(".interaction").toArray()
  7401. , v = ($("#model-title, .pinBottom-container, #drawer-container, #drawer, .footer").toArray(),
  7402. "");
  7403. t.exports.delayLanding = function(e) {
  7404. var t = $.Deferred();
  7405. e || t.resolve();
  7406. var i = o.startupFlyinDelay;
  7407. return e === n.PANORAMA && (i += o.dollhouse.transitionTime),
  7408. setTimeout(t.resolve.bind(t), i),
  7409. t
  7410. }
  7411. ,
  7412. t.exports.showMessage = function(e, t, i) {
  7413. var n = 0;
  7414. o.quickstart.enabled && (function(e) {
  7415. /* e && (f.addClass("quick-brand"), //quick-brand样式有问题 会遮住屏幕
  7416. d.before(f),
  7417. p = $(".quick-brand").toArray()), */
  7418. u.addClass("fadeOut")
  7419. /* setTimeout(function() {
  7420. p.forEach(function(e) {
  7421. e.classList.add("fadeIn")
  7422. })
  7423. }, o.quickstart.showTextDelay),
  7424. setTimeout(function() {
  7425. p.forEach(function(e) {
  7426. e.classList.add("fadeOut")
  7427. })
  7428. }, o.quickstart.fadeOutDelay) */
  7429. }(i),
  7430. n = o.quickstart.showTextDelay + o.quickstart.fadeOutDelay),
  7431. function(e, t) {
  7432. setTimeout(function() {
  7433. if (a.isHelpEnabled()) {
  7434. if (t(),
  7435. s.init(),
  7436. g.addClass("fadeIn landing " + s.deviceType),
  7437. a.isSmallHelpEnabled())
  7438. return void g.addClass("small");
  7439. s.fill(m, l.LANDING[v]),
  7440. g.addClass(v)
  7441. }
  7442. }, e);
  7443. var i = {
  7444. pc: ["images/pc_step1.png", "images/pc_step2.png", "images/pc_step3.png"],
  7445. mobile: ["images/phone_step1.png", "images/phone_step2.png", "images/phone_step3.png"]
  7446. }
  7447. , n = $(".nav-icon .icon");
  7448. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) && n.attr("src", i.mobile[0]);
  7449. function r(e) {
  7450. e.on("click", function() {
  7451. var e = null;
  7452. if (e = "plus" == $(this).attr("data-id") ? +n.attr("data-page") + 1 : +n.attr("data-page") - 1,
  7453. i.length < e || e < 1)
  7454. return !1;
  7455. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? n.attr({
  7456. "data-page": e,
  7457. src: i.mobile[e - 1]
  7458. }) : n.attr({
  7459. "data-page": e,
  7460. src: i.pc[e - 1]
  7461. })
  7462. })
  7463. }
  7464. r($(".next-button")),
  7465. r($(".prev-button"))
  7466. }(n, function() {
  7467. e.once(h.Move, r),
  7468. t.once(c.TourStart, r)
  7469. })
  7470. }
  7471. ,
  7472. t.exports.init = function(e, t) {
  7473. v = t.mode === n.PANORAMA && t.pano && !t.pano.isAligned() ? n.OUTDOOR : t.mode
  7474. }
  7475. ,
  7476. t.exports.dismissModal = r
  7477. }
  7478. , {
  7479. "../enum/DirectorEvents": 23,
  7480. "../enum/HelpModalType": 28,
  7481. "../enum/PlayerEvents": 40,
  7482. "../enum/Viewmode": 51,
  7483. "../settings": 166,
  7484. "./help/help": 67,
  7485. "./helpManager": 68,
  7486. "./populateModal": 75
  7487. }],
  7488. 72: [function(e, t, i) {
  7489. "use strict";
  7490. var n = e("./circleLoader").circleLoader;
  7491. t.exports = {
  7492. element: $("#gui-loading"),
  7493. hide: function(e) {
  7494. n.done(),
  7495. this.element.fadeOut(1500, e)
  7496. },
  7497. show: function(e) {
  7498. this.element.fadeIn(500, function() {
  7499. this.element.css("display", "table"),
  7500. e && e()
  7501. }
  7502. .bind(this))
  7503. },
  7504. progress: function(e) {
  7505. n.set(e)
  7506. }
  7507. }
  7508. }
  7509. , {
  7510. "./circleLoader": 60
  7511. }],
  7512. 73: [function(e, t, i) {
  7513. "use strict";
  7514. var n = e("../settings")
  7515. , r = $("#memory-info")
  7516. , o = r.find("#memory-gpu")
  7517. , a = !1;
  7518. t.exports = {
  7519. show: function() {
  7520. n.profiling.enabled && (r.show(),
  7521. a = !0)
  7522. },
  7523. hide: function() {
  7524. r.hide(),
  7525. a = !1
  7526. },
  7527. toggle: function() {
  7528. a ? this.hide() : this.show()
  7529. },
  7530. update: function(e) {
  7531. n.profiling.enabled && o.text(Math.floor(e / 1e6) + "MB")
  7532. }
  7533. }
  7534. }
  7535. , {
  7536. "../settings": 166
  7537. }],
  7538. 74: [function(e, t, i) {
  7539. "use strict";
  7540. e("../util/browser"),
  7541. e("../analytics");
  7542. e("../settings"),
  7543. t.exports = {
  7544. show: function(e, t) {
  7545. $("#gui-message").fadeOut(500, function() {
  7546. t()
  7547. })
  7548. }
  7549. }
  7550. }
  7551. , {
  7552. "../analytics": 4,
  7553. "../settings": 166,
  7554. "../util/browser": 182
  7555. }],
  7556. 75: [function(e, t, i) {
  7557. "use strict";
  7558. function n(e, t, i, n) {
  7559. i ? this.assets[t][i][this.deviceType] : this.assets[t][this.deviceType]
  7560. }
  7561. var r = e("../util/browser")
  7562. , o = e("../localization/localize")
  7563. , a = e("../enum/HelpModalType")
  7564. , s = (e("../enum/HelpModalSize"),
  7565. e("../enum/Viewmode"));
  7566. t.exports = {
  7567. init: function() {
  7568. if (!this.hasInitialized) {
  7569. this.hasInitialized = !0,
  7570. this.deviceType = r.isMobile() ? "mobile" : "desktop",
  7571. this.assets = {},
  7572. this.assets[a.LANDING[s.PANORAMA]] = {
  7573. desktop: {
  7574. left: {
  7575. "top-info": o.ROTATE,
  7576. "big-image": "images/nav_help_mouse_drag_left.png",
  7577. keyboard: "images/nav_help_keyboard_left_right.png"
  7578. },
  7579. middle: {
  7580. "top-info": o.MOVE,
  7581. "big-image": "images/nav_help_mouse_click.png",
  7582. keyboard: "images/nav_help_keyboard_up_down.png"
  7583. },
  7584. right: {
  7585. "top-info": o.ZOOM,
  7586. "big-image": "images/nav_help_mouse_zoom.png",
  7587. keyboard: "images/nav_help_zoom_keys.png"
  7588. }
  7589. },
  7590. mobile: {
  7591. left: {
  7592. "top-info": o.ROTATE,
  7593. "big-image": "images/nav_help_gesture_drag.png"
  7594. },
  7595. middle: {
  7596. "top-info": o.MOVE,
  7597. "big-image": "images/nav_help_gesture_tap.png"
  7598. },
  7599. right: {
  7600. "top-info": o.ZOOM,
  7601. "big-image": "images/nav_help_gesture_pinch.png"
  7602. }
  7603. }
  7604. },
  7605. this.assets[a.LANDING[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.LANDING[s.PANORAMA]])),
  7606. this.assets[a.LANDING[s.DOLLHOUSE]] = {
  7607. desktop: {
  7608. left: {
  7609. "top-info": o.ROTATE,
  7610. "big-image": "images/nav_help_mouse_drag_left.png",
  7611. keyboard: "images/nav_help_keyboard_left_right.png"
  7612. },
  7613. middle: {
  7614. "top-info": o.MOVE,
  7615. "big-image": "images/nav_help_mouse_position_right.png"
  7616. }
  7617. },
  7618. mobile: {
  7619. left: {
  7620. "top-info": o.ROTATE,
  7621. "big-image": "images/nav_help_gesture_drag.png"
  7622. },
  7623. middle: {
  7624. "top-info": o.MOVE,
  7625. "big-image": "images/nav_help_gesture_position_two_finger.png"
  7626. }
  7627. }
  7628. },
  7629. this.assets[a.LANDING[s.FLOORPLAN]] = {
  7630. desktop: {
  7631. left: {
  7632. "top-info": o.MOVE,
  7633. "big-image": "images/nav_help_mouse_position_left.png"
  7634. },
  7635. middle: {
  7636. "top-info": o.ROTATE,
  7637. "big-image": "images/nav_help_mouse_drag_right.png",
  7638. keyboard: "images/nav_help_keyboard_left_right.png"
  7639. }
  7640. },
  7641. mobile: {
  7642. left: {
  7643. "top-info": o.MOVE,
  7644. "big-image": "images/nav_help_gesture_position.png"
  7645. },
  7646. middle: {
  7647. "top-info": o.ROTATE,
  7648. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  7649. }
  7650. }
  7651. };
  7652. var e = {
  7653. "top-info": o.INSIDE,
  7654. "big-image": "images/nav_help_click_inside.png",
  7655. keyboard: "images/nav_help_inside_key.png"
  7656. };
  7657. this.assets[a.LANDING[s.OUTDOOR]].desktop.middle = e,
  7658. this.assets[a.LANDING[s.DOLLHOUSE]].desktop.right = e,
  7659. this.assets[a.LANDING[s.FLOORPLAN]].desktop.right = e;
  7660. var t = {
  7661. "top-info": o.INSIDE,
  7662. "big-image": "images/nav_help_tap_inside.png"
  7663. };
  7664. this.assets[a.LANDING[s.OUTDOOR]].mobile.middle = t,
  7665. this.assets[a.LANDING[s.DOLLHOUSE]].mobile.right = t,
  7666. this.assets[a.LANDING[s.FLOORPLAN]].mobile.right = t,
  7667. this.assets[a.NAVIGATION] = {},
  7668. this.assets[a.NAVIGATION][s.PANORAMA] = {
  7669. desktop: {
  7670. left: {
  7671. "top-info": o.HELP_DESKTOP_PANORAMA_1A,
  7672. "bottom-info": o.HELP_DESKTOP_PANORAMA_1B,
  7673. "big-image": "images/nav_help_mouse_drag_left.png",
  7674. keyboard: "images/nav_help_keyboard_left_right.png"
  7675. },
  7676. middle: {
  7677. "top-info": o.HELP_DESKTOP_PANORAMA_2A,
  7678. "bottom-info": o.HELP_DESKTOP_PANORAMA_2B,
  7679. "big-image": "images/nav_help_mouse_click.png",
  7680. keyboard: "images/nav_help_keyboard_up_down.png"
  7681. },
  7682. right: {
  7683. "top-info": o.HELP_DESKTOP_PANORAMA_3A,
  7684. "bottom-info": o.HELP_DESKTOP_PANORAMA_3B,
  7685. "big-image": "images/nav_help_mouse_zoom.png",
  7686. keyboard: "images/nav_help_zoom_keys.png"
  7687. }
  7688. },
  7689. mobile: {
  7690. left: {
  7691. "top-info": o.HELP_MOBILE_PANORAMA_1,
  7692. "big-image": "images/nav_help_gesture_drag.png"
  7693. },
  7694. middle: {
  7695. "top-info": o.HELP_MOBILE_PANORAMA_2,
  7696. "big-image": "images/nav_help_gesture_tap.png"
  7697. },
  7698. right: {
  7699. "top-info": o.HELP_MOBILE_3,
  7700. "big-image": "images/nav_help_gesture_pinch.png"
  7701. }
  7702. }
  7703. },
  7704. this.assets[a.NAVIGATION][s.DOLLHOUSE] = {
  7705. desktop: {
  7706. left: {
  7707. "top-info": o.HELP_DESKTOP_DOLLHOUSE_1A,
  7708. "bottom-info": o.HELP_DESKTOP_DOLLHOUSE_1B,
  7709. "big-image": "images/nav_help_mouse_drag_left.png",
  7710. keyboard: "images/nav_help_keyboard_all.png"
  7711. },
  7712. middle: {
  7713. "top-info": o.HELP_DESKTOP_DOLLHOUSE_2A,
  7714. "big-image": "images/nav_help_mouse_position_right.png"
  7715. },
  7716. right: {
  7717. "top-info": o.HELP_DESKTOP_DOLLHOUSE_3A,
  7718. "big-image": "images/nav_help_mouse_zoom.png"
  7719. }
  7720. },
  7721. mobile: {
  7722. left: {
  7723. "top-info": o.HELP_MOBILE_DOLLHOUSE_1,
  7724. "big-image": "images/nav_help_gesture_drag.png"
  7725. },
  7726. middle: {
  7727. "top-info": o.HELP_MOBILE_DOLLHOUSE_2,
  7728. "big-image": "images/nav_help_gesture_position_two_finger.png"
  7729. },
  7730. right: {
  7731. "top-info": o.HELP_MOBILE_3,
  7732. "big-image": "images/nav_help_gesture_pinch.png"
  7733. }
  7734. }
  7735. },
  7736. this.assets[a.NAVIGATION][s.FLOORPLAN] = {
  7737. desktop: {
  7738. left: {
  7739. "top-info": o.HELP_DESKTOP_FLOORPLAN_1A,
  7740. "big-image": "images/nav_help_mouse_position_left.png"
  7741. },
  7742. middle: {
  7743. "top-info": o.HELP_DESKTOP_FLOORPLAN_2A,
  7744. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_2B,
  7745. "big-image": "images/nav_help_mouse_drag_right.png",
  7746. keyboard: "images/nav_help_keyboard_left_right.png"
  7747. },
  7748. right: {
  7749. "top-info": o.HELP_DESKTOP_FLOORPLAN_3A,
  7750. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_3B,
  7751. "big-image": "images/nav_help_mouse_zoom.png",
  7752. keyboard: "images/nav_help_keyboard_up_down.png"
  7753. }
  7754. },
  7755. mobile: {
  7756. left: {
  7757. "top-info": o.HELP_MOBILE_FLOORPLAN_1,
  7758. "big-image": "images/nav_help_gesture_position.png"
  7759. },
  7760. middle: {
  7761. "top-info": o.HELP_MOBILE_FLOORPLAN_2,
  7762. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  7763. },
  7764. right: {
  7765. "top-info": o.HELP_MOBILE_3,
  7766. "big-image": "images/nav_help_gesture_pinch.png"
  7767. }
  7768. }
  7769. },
  7770. this.assets[a.NAVIGATION][s.OUTDOOR] = JSON.parse(JSON.stringify(this.assets[a.NAVIGATION][s.PANORAMA])),
  7771. this.assets[a.NAVIGATION][s.OUTDOOR].desktop.middle = {
  7772. "top-info": o.HELP_DESKTOP_360_2A,
  7773. "bottom-info": o.HELP_DESKTOP_360_2B,
  7774. "big-image": "images/nav_help_click_inside.png",
  7775. keyboard: "images/nav_help_inside_key.png"
  7776. },
  7777. this.assets[a.NAVIGATION][s.OUTDOOR].mobile.middle = {
  7778. "top-info": o.HELP_MOBILE_360_2,
  7779. "big-image": "images/nav_help_tap_inside.png"
  7780. },
  7781. this.assets[a.MORE_HELP] = {
  7782. desktop: {
  7783. "more-help-hlr": {
  7784. "top-info": o.HELP_MORE_HLR_A,
  7785. "big-image": "images/nav_help_expand.svg",
  7786. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  7787. },
  7788. "more-help-dollhouse": {
  7789. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  7790. "big-image": "images/nav_help_dollhouse.svg",
  7791. "bottom-info": o.HELP_DESKTOP_MORE_DOLLHOUSE_B
  7792. },
  7793. "more-help-floors": {
  7794. "top-info": o.HELP_MORE_FLOORS_A,
  7795. "big-image": "images/nav_help_floor picker.svg",
  7796. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  7797. },
  7798. "more-help-tag": {
  7799. "top-info": o.HELP_MORE_TAG_A,
  7800. "big-image": "images/nav_help_tag.svg",
  7801. "bottom-info": o.HELP_DESKTOP_MORE_TAG_B
  7802. },
  7803. "more-help-zoom": {
  7804. "top-info": o.HELP_MORE_ZOOM_A,
  7805. "big-image": "images/nav_help_zoom.svg",
  7806. "bottom-info": o.HELP_DESKTOP_MORE_ZOOM_B
  7807. },
  7808. "more-help-tour": {
  7809. "top-info": o.HELP_MORE_TOUR_A,
  7810. "big-image": "images/nav_help_play.png",
  7811. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  7812. },
  7813. "more-help-inside": {
  7814. "top-info": o.HELP_MORE_INSIDE_A,
  7815. "big-image": "images/nav_help_inside.svg",
  7816. "bottom-info": o.HELP_DESKTOP_MORE_INSIDE_B
  7817. },
  7818. "more-help-vr": {
  7819. "top-info": o.HELP_MORE_VR_A,
  7820. "big-image": "images/nav_help_vr.svg",
  7821. "bottom-info": o.HELP_DESKTOP_MORE_VR_B
  7822. },
  7823. "more-help-360": {
  7824. "top-info": o.HELP_MORE_360_A,
  7825. "big-image": "images/nav_help_360.svg",
  7826. "bottom-info": o.HELP_DESKTOP_MORE_360_B
  7827. },
  7828. "more-help-fullscreen": {
  7829. "top-info": o.HELP_MORE_FULLSCREEN_A,
  7830. "big-image": "images/nav_help_fullscreen.svg",
  7831. "bottom-info": o.HELP_DESKTOP_MORE_FULLSCREEN_B
  7832. }
  7833. },
  7834. mobile: {
  7835. "more-help-hlr": {
  7836. "top-info": o.HELP_MORE_HLR_A,
  7837. "big-image": "images/nav_help_expand.svg",
  7838. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  7839. },
  7840. "more-help-dollhouse": {
  7841. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  7842. "big-image": "images/nav_help_dollhouse.svg",
  7843. "bottom-info": o.HELP_MOBILE_MORE_DOLLHOUSE_B
  7844. },
  7845. "more-help-floors": {
  7846. "top-info": o.HELP_MORE_FLOORS_A,
  7847. "big-image": "images/nav_help_floor picker.svg",
  7848. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  7849. },
  7850. "more-help-tag": {
  7851. "top-info": o.HELP_MORE_TAG_A,
  7852. "big-image": "images/nav_help_tag.svg",
  7853. "bottom-info": o.HELP_MOBILE_MORE_TAG_B
  7854. },
  7855. "more-help-tour": {
  7856. "top-info": o.HELP_MORE_TOUR_A,
  7857. "big-image": "images/nav_help_play.png",
  7858. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  7859. },
  7860. "more-help-inside": {
  7861. "top-info": o.HELP_MORE_INSIDE_A,
  7862. "big-image": "images/nav_help_inside.svg",
  7863. "bottom-info": o.HELP_MOBILE_MORE_INSIDE_B
  7864. },
  7865. "more-help-vr": {
  7866. "top-info": o.HELP_MORE_VR_A,
  7867. "big-image": "images/webvr.svg",
  7868. "bottom-info": o.HELP_MOBILE_MORE_VR_B
  7869. },
  7870. "more-help-360": {
  7871. "top-info": o.HELP_MORE_360_A,
  7872. "big-image": "images/nav_help_360.svg",
  7873. "bottom-info": o.HELP_MOBILE_MORE_360_B
  7874. }
  7875. }
  7876. },
  7877. this.assets[a.TOUR_INTERACTION[s.PANORAMA]] = {
  7878. desktop: {
  7879. left: {
  7880. "top-info": o.ROTATE,
  7881. "big-image": "images/nav_help_mouse_drag_left.png",
  7882. keyboard: "images/nav_help_keyboard_left_right.png"
  7883. },
  7884. middle: {
  7885. "top-info": o.MOVE,
  7886. "big-image": "images/nav_help_mouse_click.png",
  7887. keyboard: "images/nav_help_keyboard_up_down.png"
  7888. },
  7889. right: {
  7890. "top-info": o.PLAY,
  7891. "big-image": "images/Desktop-help-play-button.svg",
  7892. keyboard: "images/Desktop-help-spacebar-2.svg"
  7893. }
  7894. },
  7895. mobile: {
  7896. left: {
  7897. "top-info": o.ROTATE,
  7898. "big-image": "images/nav_help_gesture_drag.png"
  7899. },
  7900. middle: {
  7901. "top-info": o.MOVE,
  7902. "big-image": "images/nav_help_gesture_tap.png"
  7903. },
  7904. right: {
  7905. "top-info": o.PLAY,
  7906. "big-image": "images/mobile-help-play-button.svg"
  7907. }
  7908. }
  7909. },
  7910. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.PANORAMA]])),
  7911. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].desktop.middle = this.assets[a.LANDING[s.OUTDOOR]].desktop.middle,
  7912. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].mobile.middle = this.assets[a.LANDING[s.OUTDOOR]].mobile.middle,
  7913. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.OUTDOOR]])),
  7914. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].desktop.left = this.assets[a.LANDING[s.FLOORPLAN]].desktop.left,
  7915. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].mobile.left = this.assets[a.LANDING[s.FLOORPLAN]].mobile.left
  7916. }
  7917. },
  7918. fill: function(e, t, i) {
  7919. n.call(this, e, t, i, !0)
  7920. },
  7921. clear: function(e, t, i) {
  7922. n.call(this, e, t, i, !1)
  7923. }
  7924. }
  7925. }
  7926. , {
  7927. "../enum/HelpModalSize": 27,
  7928. "../enum/HelpModalType": 28,
  7929. "../enum/Viewmode": 51,
  7930. "../localization/localize": 108,
  7931. "../util/browser": 182
  7932. }],
  7933. 76: [function(e, t, i) {
  7934. "use strict";
  7935. t.exports = Object.freeze({
  7936. OPENED: "share.open",
  7937. CLOSED: "share.closed",
  7938. LINK_CLICKED: "share.linked"
  7939. })
  7940. }
  7941. , {}],
  7942. 77: [function(e, t, i) {
  7943. "use strict";
  7944. function n(n) {
  7945. function e(e, t) {
  7946. var i = "top=" + (window.screenY + ($("#player").height() - t) / 2) + ",left=" + (window.screenX + ($("#player").width() - e) / 2) + ",width=" + e + ",height=" + t;
  7947. I.emit(l.LINK_CLICKED, {
  7948. channel: n
  7949. }),
  7950. window.open(C[n], "shareWindow", i)
  7951. }
  7952. switch (n) {
  7953. case A.FACEBOOK:
  7954. e(580, 420);
  7955. break;
  7956. case A.TWITTER:
  7957. e(550, 440);
  7958. break;
  7959. case A.MAIL:
  7960. I.emit(l.LINK_CLICKED, {
  7961. channel: "email"
  7962. }),
  7963. window.open(C[n], "_blank");
  7964. break;
  7965. case A.LINKEDIN:
  7966. }
  7967. }
  7968. function r(e) {
  7969. I.emit(l.LINK_CLICKED, {
  7970. channel: "copylink"
  7971. });
  7972. var t = document.createRange();
  7973. t.selectNodeContents(v);
  7974. var i = window.getSelection();
  7975. i.removeAllRanges(),
  7976. i.addRange(t),
  7977. document.execCommand("copy"),
  7978. y.classList.remove("hidden"),
  7979. v.classList.add("highlighted")
  7980. }
  7981. function o(e) {
  7982. e && (e.stopPropagation(),
  7983. e.target === v) || (window.getSelection().removeAllRanges(),
  7984. v.classList.remove("highlighted"),
  7985. y.classList.add("hidden"))
  7986. }
  7987. var a = e("../../util/browser")
  7988. , s = e("../../localization/localize")
  7989. , l = e("./ShareEvents")
  7990. , c = e("../../util/common")
  7991. , h = e("events").EventEmitter
  7992. , u = document.getElementById("sharing")
  7993. , d = document.getElementById("share-modal")
  7994. , p = document.getElementById("share-close")
  7995. , f = document.getElementById("facebook-share")
  7996. , g = document.getElementById("twitter-share")
  7997. , m = document.getElementById("mail-share")
  7998. , v = document.getElementById("share-url-text")
  7999. , y = document.getElementById("copy-success")
  8000. , A = Object.freeze({
  8001. FACEBOOK: "facebook",
  8002. TWITTER: "twitter",
  8003. MAIL: "mail",
  8004. LINKEDIN: "linkedin"
  8005. })
  8006. , C = {};
  8007. C[A.FACEBOOK] = "http://www.facebook.com/sharer.php?u=" + encodeURIComponent(window.location.href + "&utm_source=1") + "&t=",
  8008. C[A.TWITTER] = "http://twitter.com/intent/tweet?text=",
  8009. C[A.MAIL] = "mailto:?subject=";
  8010. var I = {
  8011. init: function(e) {
  8012. var t = encodeURIComponent(s.SHARE_EXPLORE + e + " " + s.SHARE_AT + " ");
  8013. C[A.FACEBOOK] += t + encodeURIComponent(window.location.href + "&utm_source=1"),
  8014. C[A.TWITTER] += t + encodeURIComponent(window.location.href + "&utm_source=2 " + s.SHARE_WITH + " #port"),
  8015. C[A.MAIL] += encodeURIComponent(s.SHARE_EXPLORE + e + s.SHARE_3D) + "&body=" + t + encodeURIComponent(window.location.href + "&utm_source=3"),
  8016. u.addEventListener("click", this.toggle.bind(this)),
  8017. p.addEventListener("click", this.hide.bind(this)),
  8018. v.addEventListener("click", r),
  8019. d.addEventListener("click", o),
  8020. f.addEventListener("click", n.bind(this, A.FACEBOOK)),
  8021. g.addEventListener("click", n.bind(this, A.TWITTER)),
  8022. m.addEventListener("click", n.bind(this, A.MAIL)),
  8023. v.textContent = window.location.href + "&utm_source=4",
  8024. d.classList.add(a.isMobile() ? "mobile" : "desktop"),
  8025. u.classList.remove("hidden")
  8026. },
  8027. show: function() {
  8028. this.emit(l.OPENED),
  8029. d.classList.add("fadeIn")
  8030. },
  8031. hide: function() {
  8032. d.classList.contains("fadeIn") && (this.emit(l.CLOSED),
  8033. document.selection && document.selection.empty(),
  8034. window.getSelection().removeAllRanges(),
  8035. o(),
  8036. d.classList.remove("fadeIn"))
  8037. },
  8038. toggle: function() {
  8039. d.classList.contains("fadeIn") ? this.hide() : this.show()
  8040. }
  8041. };
  8042. c.extendObject(I, h.prototype),
  8043. t.exports = I
  8044. }
  8045. , {
  8046. "../../localization/localize": 108,
  8047. "../../util/browser": 182,
  8048. "../../util/common": 185,
  8049. "./ShareEvents": 76,
  8050. events: 202
  8051. }],
  8052. 78: [function(e, t, i) {
  8053. "use strict";
  8054. t.exports = Object.freeze({
  8055. OPENED: "terms.opened",
  8056. CLOSED: "terms.closed"
  8057. })
  8058. }
  8059. , {}],
  8060. 79: [function(e, t, i) {
  8061. "use strict";
  8062. var n = e("./TermsEvent")
  8063. , r = e("../../localization/localize")
  8064. , o = e("../../analytics")
  8065. , a = e("../../util/ajax")
  8066. , s = e("../../util/common")
  8067. , l = e("events").EventEmitter
  8068. , c = document.getElementById("terms-modal")
  8069. , h = {
  8070. init: function() {
  8071. $(".footer-terms").on("click", function(e) {
  8072. e.preventDefault(),
  8073. this.show()
  8074. }
  8075. .bind(this)),
  8076. $("#terms-modal .close").on("click", this.hide.bind(this))
  8077. },
  8078. show: function() {
  8079. this.emit(n.OPENED),
  8080. a.get("static/" + r.TERMS_TEXT_FILE).done(function(e) {
  8081. var t = $("#terms-text").html(e);
  8082. o.track("showcase_gui", {
  8083. gui_action: "click_terms_button",
  8084. interaction_source: "gui"
  8085. }),
  8086. t.find("a").attr("target", "_blank")
  8087. }).fail(function() {
  8088. $("#terms-text").html("<h1>" + r.TERMS_OF_USE + "</h1><p>" + r.TERMS_FAIL)
  8089. }),
  8090. c.classList.add("fadeIn")
  8091. },
  8092. hide: function(e) {
  8093. e && e.preventDefault(),
  8094. c.classList.contains("fadeIn") && this.emit(n.CLOSED),
  8095. c.classList.remove("fadeIn")
  8096. }
  8097. };
  8098. s.extendObject(h, l.prototype),
  8099. t.exports = h
  8100. }
  8101. , {
  8102. "../../analytics": 4,
  8103. "../../localization/localize": 108,
  8104. "../../util/ajax": 181,
  8105. "../../util/common": 185,
  8106. "./TermsEvent": 78,
  8107. events: 202
  8108. }],
  8109. 80: [function(e, t, i) {
  8110. "use strict";
  8111. t.exports = Object.freeze({
  8112. OPEN_INFO: "title.open.info",
  8113. CLOSE_INFO: "title.close.info",
  8114. SHOW_INFO: "title.show.info",
  8115. HIDE_INFO: "title.hide.info",
  8116. LINK_CLICKED: "title.link.click",
  8117. CONTACT_LINK_CLICKED: "title.contact.click",
  8118. ORIGIN_LINK_CLICKED: "title.origin.click"
  8119. })
  8120. }
  8121. , {}],
  8122. 81: [function(e, t, i) {
  8123. "use strict";
  8124. var o = e("../../settings");
  8125. t.exports.init = function(e, t) {
  8126. o.tags.enabled && 0 !== Object.keys(e.tags).length && function(t, i) {
  8127. function e(e) {
  8128. t.shouldShowtags = "show" === this.value,
  8129. t.shouldShowtags ? i.showAlltags(o.tags.startup.fadeInDuration) : i.hideAlltags(o.tags.startup.fadeInDuration)
  8130. }
  8131. document.getElementById("tag-toggles").classList.remove("hidden"),
  8132. document.getElementById("radio-tag-show").checked = !0;
  8133. for (var n = document.getElementById("tag-inputs").querySelectorAll("input"), r = 0; r < n.length; r++)
  8134. n[r].addEventListener("change", e)
  8135. }(e, t)
  8136. }
  8137. }
  8138. , {
  8139. "../../settings": 166
  8140. }],
  8141. 82: [function(S, M, e) {
  8142. (function(e) {
  8143. "use strict";
  8144. function i(e) {
  8145. return !(!e || l.inIframe() && document.referrer === e || (E.classList.remove("hidden"),
  8146. _.innerHTML = r.WEBVR_LEARN_MORE + ": ",
  8147. _.appendChild(function(e) {
  8148. var t = document.createElement("a");
  8149. return t.id = "url",
  8150. t.target = "_blank",
  8151. t.href = e,
  8152. t.innerText = e,
  8153. t.addEventListener("click", x.emit.bind(x, a.ORIGIN_LINK_CLICKED)),
  8154. t
  8155. }(e)),
  8156. b.forEach(function(e) {
  8157. e.classList.add("share-link")
  8158. }),
  8159. 0))
  8160. }
  8161. function s(e, t) {
  8162. var i = e
  8163. , n = t;
  8164. return function(e, t) {
  8165. i.push(t || n, e)
  8166. }
  8167. }
  8168. var l = S("../../util/browser")
  8169. , t = S("../../util/common")
  8170. , n = S("../../util/logger")
  8171. , r = S("../../localization/localize")
  8172. , o = S("./titleBarSettings")
  8173. , c = S("../../settings")
  8174. , a = S("./TitleEvents")
  8175. , h = S("events").EventEmitter
  8176. , u = new n(e)
  8177. , d = document.querySelector(".pinTop.left")
  8178. , p = document.getElementsByClassName("title-container")[0]
  8179. , f = document.getElementById("title-toggle").querySelector("i")
  8180. , g = document.getElementById("meta-info-wrapper")
  8181. , m = document.getElementById("meta-info")
  8182. , v = document.getElementById("meta-description")
  8183. , y = document.getElementsByClassName("contact-info")[0]
  8184. , A = document.getElementById("contact-data")
  8185. , C = document.getElementById("addressTxt")
  8186. , I = document.getElementById("tag-toggles")
  8187. , E = document.getElementById("share-origin")
  8188. , _ = document.getElementById("share-link-wrapper")
  8189. , b = [m, g, p]
  8190. , w = !1
  8191. , T = !1
  8192. , x = {
  8193. populate: function(e) {
  8194. if (function(e, t) {
  8195. return e && l.valueFromHash("title", 1) && 2 !== l.valueFromHash("mls", 0) ? (document.getElementsByClassName("titleText")[0].innerText = e,
  8196. (g_weixinObj.title = e).length > o.minTooltipCharacters && p.parentElement.setAttribute("data-original-title", e),
  8197. t && 1 !== c.specialEdition && c.brand && !c.mls ? document.getElementById("cobrandTitle").innerText = t : (document.getElementsByClassName("co-brand")[0].classList.add("hidden"),
  8198. document.getElementById("gui-name").classList.add("noCoBrand"),
  8199. document.getElementById("cobrandTitle").classList.add("hidden")),
  8200. !0) : (document.getElementById("model-title").classList.add("hidden"),
  8201. !1)
  8202. }(MP_PREFETCHED_MODELDATA.name, e.coBrand)) {
  8203. if (function(e) {
  8204. e ? (w = !0,
  8205. v.innerHTML = e) : v.classList.add("hidden")
  8206. }(e.description),
  8207. function(e, t, i, n) {
  8208. if ((e || t || i) && c.brand && !l.valueFromHash("mls", !1)) {
  8209. w = !0;
  8210. var r = []
  8211. , o = s(r, "<br>");
  8212. if (e && o('<span id="contactName">' + e + "</span>"),
  8213. t) {
  8214. var a = n || t;
  8215. o(l.isMobile() ? '<a id="phone" href="callto:' + t + '">' + a + "</a>" : "<span>" + a + "</span>")
  8216. }
  8217. i && o('<a id="email" href="mailTo:' + i + '">' + i + "</a>"),
  8218. r[0] = "",
  8219. A.innerHTML = r.join("")
  8220. } else
  8221. y.classList.add("hidden")
  8222. }(e.contactName, e.phone, e.email, e.formatted_contact_phone),
  8223. function(e) {
  8224. if ("string" == typeof e)
  8225. try {
  8226. e = JSON.parse(e)
  8227. } catch (e) {
  8228. return u.warn("Unable to parse address data"),
  8229. C.parentElement.classList.add("hidden")
  8230. }
  8231. if (e && (e.address_1 || e.address_2 || e.city || e.state || e.zip)) {
  8232. w = !0;
  8233. var t = []
  8234. , i = s(t, " ");
  8235. e.address_1 && i(e.address_1),
  8236. e.address_2 && i(e.address_2),
  8237. e.city && i(e.city, ", "),
  8238. e.state && i(e.state, ", "),
  8239. e.zip && i(e.zip, e.state ? " " : ", "),
  8240. t[0] = "",
  8241. C.innerText = t.join("")
  8242. } else
  8243. C.parentElement.classList.add("hidden")
  8244. }(e.address),
  8245. w) {
  8246. var t = document.createElement("br");
  8247. I.insertBefore(t, I.firstElementChild)
  8248. }
  8249. e.socialSharing && c.share.enabled && (T = i(e.url))
  8250. }
  8251. },
  8252. finishSetup: function(e) {
  8253. w = w || !!e,
  8254. document.getElementById("title-toggle").addEventListener("click", x.toggleTitle.bind(x)),
  8255. w && p.addEventListener("click", x.toggleMeta.bind(x, !1)),
  8256. [].slice.call(v.querySelectorAll("a")).forEach(function(e) {
  8257. e.addEventListener("click", x.emit.bind(x, a.LINK_CLICKED))
  8258. }),
  8259. [].slice.call(y.querySelectorAll("a")).forEach(function(e) {
  8260. e.addEventListener("click", x.emit.bind(x, a.CONTACT_LINK_CLICKED, {
  8261. contact_type: e.getAttribute("id")
  8262. }))
  8263. }),
  8264. w || (T ? p.classList.add("share-only") : p.classList.add("no-meta"))
  8265. },
  8266. toggleMeta: function(e, t) {
  8267. var i = document.getElementById("model-title");
  8268. t && t.preventDefault();
  8269. var n = m.classList.contains("expand");
  8270. e && !n || (n ? (b.forEach(function(e) {
  8271. e.classList.remove("expand")
  8272. }),
  8273. this.emit(a.CLOSE_INFO),
  8274. i.classList.remove("expand")) : (b.forEach(function(e) {
  8275. e.classList.add("expand")
  8276. }),
  8277. i.classList.add("expand"),
  8278. this.emit(a.OPEN_INFO)))
  8279. },
  8280. setupToggling: function() {
  8281. g.style.height = m.offsetHeight + "px",
  8282. m.addEventListener("transitionend", function() {
  8283. g.style.height = m.offsetHeight + "px"
  8284. })
  8285. },
  8286. toggleTitle: function(e) {
  8287. e && e.preventDefault(),
  8288. d.classList.contains("closed") ? (d.classList.add("open"),
  8289. f.classList.remove("icon-dpad-right"),
  8290. f.classList.add("icon-dpad-left"),
  8291. this.emit(a.SHOW_INFO),
  8292. setTimeout(function() {
  8293. d.classList.remove("closed"),
  8294. d.classList.remove("open")
  8295. }, o.removeAnimationClasses)) : (d.classList.add("closed"),
  8296. f.classList.remove("icon-dpad-left"),
  8297. f.classList.add("icon-dpad-right"),
  8298. this.emit(a.HIDE_INFO))
  8299. }
  8300. };
  8301. t.extendObject(x, h.prototype),
  8302. M.exports = x
  8303. }
  8304. ).call(this, "/js/gui/title/titleBar.js")
  8305. }
  8306. , {
  8307. "../../localization/localize": 108,
  8308. "../../settings": 166,
  8309. "../../util/browser": 182,
  8310. "../../util/common": 185,
  8311. "../../util/logger": 189,
  8312. "./TitleEvents": 80,
  8313. "./titleBarSettings": 83,
  8314. events: 202
  8315. }],
  8316. 83: [function(e, t, i) {
  8317. "use strict";
  8318. t.exports = Object.freeze({
  8319. minTooltipCharacters: 19,
  8320. removeAnimationClasses: 500
  8321. })
  8322. }
  8323. , {}],
  8324. 84: [function(e, t, i) {
  8325. "use strict";
  8326. function n() {
  8327. v.playTour(),
  8328. y && clearTimeout(y),
  8329. c(),
  8330. E.removeClass("fadeIn")
  8331. }
  8332. function r() {
  8333. A.classList.contains("playing") && (v.stopTour(),
  8334. E.addClass("fadeIn"),
  8335. setTimeout(function() {
  8336. E.removeClass("fadeIn")
  8337. }, h.tourInteraction.showPauseButton),
  8338. M || (clearTimeout(y),
  8339. y = setTimeout(s, h.tourInteraction.showModal)),
  8340. setTimeout(function() {
  8341. A.classList.remove("playing")
  8342. }, h.tourInteraction.allowNextClick))
  8343. }
  8344. function o() {
  8345. v.tourInProgress && (v.stopTour(),
  8346. v.endTourProgress(),
  8347. A.classList.remove("playing"))
  8348. }
  8349. function a() {
  8350. _.is(":visible") ? n() : r()
  8351. }
  8352. function s() {//去掉导览结束时的提示
  8353. /* if (!h.tourInteraction.disabled) {
  8354. T.removeClass("small landing " + d.FLOORPLAN + " " + d.OUTDOOR + " " + d.PANORAMA),
  8355. T.addClass("fadeIn tour " + p.deviceType);
  8356. var e, t = h.tourInteraction.smallModal ? m.SMALL : m.LARGE;
  8357. if (!h.tourInteraction.smallModal)
  8358. 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,
  8359. p.fill(x, g.TOUR_INTERACTION[e]),
  8360. T.addClass(e);
  8361. T.addClass(t)
  8362. } */
  8363. }
  8364. function l(e, t) {
  8365. if (t) {
  8366. var i = "keydown" === t.type
  8367. , n = t.which === u.SPACE || v.tourIsPlaying;
  8368. i && n || e || (M = !0),
  8369. v.atEndOfTour() && c(),
  8370. !v.tourIsPlaying && v.tourInProgress && (E.removeClass("fadeIn"),
  8371. c(),
  8372. t.which !== u.SPACE && o()),
  8373. i && n && a()
  8374. }
  8375. }
  8376. function c() {
  8377. T.removeClass("fadeIn")
  8378. }
  8379. var h = (e("../util/browser"),
  8380. e("../settings"))
  8381. , u = e("../enum/Keys")
  8382. , d = e("../enum/Viewmode")
  8383. , p = (e("./helpManager"),
  8384. e("./populateModal"))
  8385. , f = e("../enum/DirectorEvents")
  8386. , g = e("../enum/HelpModalType")
  8387. , m = e("../enum/HelpModalSize")
  8388. , v = null
  8389. , y = null
  8390. , A = document.getElementById("pause-overlay")
  8391. , C = document.getElementById("player")
  8392. , I = document.getElementById("gui")
  8393. , E = $("#pause-icon").eq(0)
  8394. , _ = $("#play").eq(0)
  8395. , b = $("#playHead").eq(0)
  8396. , w = $(".rightViewContainer, #previous, #next, #gui-modes-inside, #gui-modes-outside, #gui-modes-dollhouse, #gui-modes-floorplan").toArray()
  8397. , T = $("#interaction-modal").eq(0)
  8398. , x = $("#interaction-modal .interaction").toArray()
  8399. , S = ["touchstart", "mousedown", "pointerdown"]
  8400. , M = !1;
  8401. t.exports.init = function(e) {
  8402. v = e,
  8403. S.forEach(function(t) {
  8404. C.addEventListener(t, l.bind(this, !1), !0),
  8405. I.addEventListener(t, l.bind(this, !0), !0),
  8406. A.addEventListener(t, r, !0),
  8407. w.forEach(function(e) {
  8408. e.addEventListener(t, o, !0)
  8409. }),
  8410. $("#drawer img").on(t, o)
  8411. }),
  8412. document.addEventListener("keydown", l.bind(this, !1), !0),
  8413. v.on(f.TourStart, function() {
  8414. A.classList.add("playing")
  8415. })
  8416. }
  8417. ,
  8418. t.exports.play = n,
  8419. t.exports.pause = r,
  8420. t.exports.pauseWithoutCTA = o,
  8421. t.exports.togglePlay = a,
  8422. t.exports.stopTour = function() {
  8423. b.hasClass("playing") && (clearTimeout(y),
  8424. v.atEndOfTour() ? (A.classList.remove("playing"),
  8425. s()) : E.removeClass("fadeIn"))
  8426. }
  8427. ,
  8428. t.exports.dismissModal = c
  8429. }
  8430. , {
  8431. "../enum/DirectorEvents": 23,
  8432. "../enum/HelpModalSize": 27,
  8433. "../enum/HelpModalType": 28,
  8434. "../enum/Keys": 30,
  8435. "../enum/Viewmode": 51,
  8436. "../settings": 166,
  8437. "../util/browser": 182,
  8438. "./helpManager": 68,
  8439. "./populateModal": 75
  8440. }],
  8441. 85: [function(e, t, i) {
  8442. "use strict";
  8443. t.exports = Object.freeze({
  8444. OPENED: "vr.modal.opened",
  8445. LAUNCH: "vr.modal.launch",
  8446. CLOSED: "vr.modal.closed",
  8447. NEXT: "vr.modal.next",
  8448. PREV: "vr.modal.prev",
  8449. STORE: "vr.modal.store",
  8450. falseICECHOSEN: "vr.modal.device"
  8451. })
  8452. }
  8453. , {}],
  8454. 86: [function(e, t, i) {
  8455. "use strict";
  8456. var h = e("../../util/browser")
  8457. , u = e("../../enum/VRApps")
  8458. , n = e("../../enum/VRPlatforms")
  8459. , d = e("../../util/ajax")
  8460. , p = e("../../settings")
  8461. , r = {};
  8462. for (var o in r[u.CardboardAndroid] = "https://play.google.com/store/apps/details?id=com.port.mpvrcardboard&redirect_uri=",
  8463. r[u.CardboardIOS] = "https://itunes.apple.com/us/app/port-vr/id1168808473&redirect_uri=",
  8464. r[u.GearVR] = "https://www.oculus.com/experiences/gear-vr/811670972252145/?redirect_uri=",
  8465. u) {
  8466. var a = u[o];
  8467. r[a] += encodeURIComponent(document.referrer + "&display=" + a)
  8468. }
  8469. var s, f = {}, g = (-1 === (s = window.location.host).indexOf(".port.com") && -1 === s.indexOf("localhost") && (s = "my.port.com"),
  8470. "https://" + s);
  8471. t.exports.init = function(e, t, o) {
  8472. function a(e, t, i, n) {
  8473. function r() {
  8474. return "&utm_medium=" + (h.inIframe() ? "embed" : "direct") + ("&utm_source=" + s) + ("&utm_showcase_session_id=" + o)
  8475. }
  8476. 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()
  8477. }
  8478. var s = h.inIframe() ? encodeURIComponent(document.referrer) : encodeURIComponent(window.location.href)
  8479. , l = g + "/vr/dlist/?ret=" + s
  8480. , c = g + "/vr/show/?ret=" + s;
  8481. switch (e) {
  8482. case n.IOS:
  8483. !function(t, e, i, n) {
  8484. var r = a(t, e, i, n)
  8485. , o = {
  8486. responseType: "json",
  8487. data: {
  8488. branch_key: p.appConfig.branch_key,
  8489. data: {
  8490. m: e,
  8491. full_url: r,
  8492. $desktop_url: "",
  8493. $og_app_id: "331853976762864119",
  8494. $og_title: i,
  8495. $og_description: n,
  8496. $og_image_url: location.origin + "/api/v1/player/models/" + e + "/thumb",
  8497. $canonical_url: window.location.href
  8498. }
  8499. }
  8500. };
  8501. d.post("https://api.branch.io/v1/url", o).done(function(e) {
  8502. f[t] = e.url
  8503. }).fail(function(e) {
  8504. f[t] = e
  8505. }
  8506. .bind(this, r))
  8507. }(u.CardboardIOS, t.sid, t.name, t.summary);
  8508. break;
  8509. default:
  8510. !function(e, t, i) {
  8511. for (var n in u) {
  8512. var r = u[n]
  8513. , o = a(r, e, t, i);
  8514. f[r] = o
  8515. }
  8516. }(t.sid, t.name, t.summary)
  8517. }
  8518. }
  8519. ,
  8520. t.exports.launch = function(e) {
  8521. var t = f[e];
  8522. window.open(t, "_blank")
  8523. }
  8524. ,
  8525. t.exports.launchStore = function(e) {
  8526. var t = r[e];
  8527. window.open(t, "_blank")
  8528. }
  8529. }
  8530. , {
  8531. "../../enum/VRApps": 46,
  8532. "../../enum/VRPlatforms": 49,
  8533. "../../settings": 166,
  8534. "../../util/ajax": 181,
  8535. "../../util/browser": 182
  8536. }],
  8537. 87: [function(e, t, i) {
  8538. "use strict";
  8539. function c(e) {
  8540. var t;
  8541. switch (e) {
  8542. case y.IOS:
  8543. return 9 < (t = g.iosVersion()).major || 9 === t.major && 1 <= t.minor;
  8544. case y.Android:
  8545. return 4 < (t = g.androidVersion()).major || 4 === t.major && 4 < t.minor || 4 === t.major && 4 === t.minor && 4 <= t.patch
  8546. }
  8547. return !1
  8548. }
  8549. function h(e) {
  8550. switch (e) {
  8551. case y.Android:
  8552. x.filter(".cardboard").off().on("click", q.cardboardAndroid),
  8553. x.filter(".gearvr").off().on("click", q.gear),
  8554. n(k, U, "logo-button", "same-line");
  8555. break;
  8556. case y.UnsupportedAndroid:
  8557. n("", H, "", "");
  8558. break;
  8559. case y.IOS:
  8560. x.filter(".cardboard").off().on("click", q.cardboardIOS),
  8561. n(k, "", "logo-button", "");
  8562. break;
  8563. case y.Desktop:
  8564. x.filter(".cardboard").off().on("click", r.bind(this, null, N, B)),
  8565. x.filter(".gearvr").off().on("click", r.bind(this, U, F, null)),
  8566. n(k, U, "logo-button", "same-line"),
  8567. Q.cardboard()
  8568. }
  8569. }
  8570. function u(e) {
  8571. $(".p1, .p2, .p3").hide(),
  8572. l.insertAfter(T),
  8573. w.removeClass("front-page"),
  8574. w.removeClass("details-page"),
  8575. w.removeClass("lastPage"),
  8576. x.removeClass("logo-button"),
  8577. x.removeClass("same-line"),
  8578. T.removeClass("headsetOptions"),
  8579. S.attr("src", ""),
  8580. S.filter(".second").removeClass("gear"),
  8581. S.css("display", "inline-block"),
  8582. S.off(),
  8583. M.filter(".second").css("display", ""),
  8584. O.css("display", "none"),
  8585. $(".p" + (e + 1) + _).show(),
  8586. S.filter(".third").insertBefore(M.filter(".third"))
  8587. }
  8588. function n(e, t, i, n) {
  8589. w.addClass("front-page"),
  8590. S.filter(".first").attr("src", e),
  8591. S.filter(".second").attr("src", t),
  8592. x.filter(".first").addClass(i),
  8593. x.filter(".second").addClass(i),
  8594. x.addClass(n),
  8595. ".show-desktop" === _ && T.insertAfter(l)
  8596. }
  8597. function r(e, t, i) {
  8598. T.addClass("headsetOptions"),
  8599. x.off(),
  8600. S.filter(".second").attr("src", t),
  8601. O.css("display", "block"),
  8602. M.filter(".second").css("display", "none"),
  8603. O.on("click", function() {
  8604. u(b.Title),
  8605. h(y.Desktop)
  8606. }),
  8607. e && (X.emit(C.falseICECHOSEN, {
  8608. name: v.GearVR
  8609. }),
  8610. S.filter(".first").attr("src", e),
  8611. S.filter(".second").addClass("gear"),
  8612. S.filter(".second").on("click", m.launchStore.bind(this, v.GearVR)),
  8613. Q.gearvr()),
  8614. i && (X.emit(C.falseICECHOSEN, {
  8615. name: v.Cardboard
  8616. }),
  8617. S.filter(".third").attr("src", i),
  8618. S.filter(".third").show(),
  8619. S.filter(".third").insertAfter(S.filter(".second")),
  8620. S.filter(".third").addClass("link"),
  8621. S.filter(".second").addClass("link"),
  8622. S.filter(".second").on("click", m.launchStore.bind(this, v.CardboardIOS)),
  8623. S.filter(".third").on("click", m.launchStore.bind(this, v.CardboardAndroid)),
  8624. Q.cardboard())
  8625. }
  8626. function d(e, t) {
  8627. switch (t) {
  8628. case y.IOS:
  8629. j = W,
  8630. Y = G;
  8631. break;
  8632. case y.Desktop:
  8633. e === b.Cardboard ? (j = N,
  8634. Y = B,
  8635. S.filter(".second").on("click", m.launchStore.bind(this, v.CardboardIOS)),
  8636. S.filter(".third").on("click", m.launchStore.bind(this, v.CardboardAndroid))) : (j = F,
  8637. S.filter(".second").on("click", m.launchStore.bind(this, v.GearVR)),
  8638. Y = "");
  8639. break;
  8640. default:
  8641. Y = e === b.Cardboard ? (j = H,
  8642. G) : (j = V,
  8643. z)
  8644. }
  8645. }
  8646. function p(e, t, i) {
  8647. w.find(".inner").addClass("details-page"),
  8648. w.addClass("details-page"),
  8649. S.filter(".first").attr("src", e),
  8650. S.filter(".second").attr("src", t),
  8651. S.filter(".third").attr("src", i)
  8652. }
  8653. function f() {
  8654. var e = 1 < g.aspectRatio() && g.isMobile();
  8655. w.toggleClass("landscape", e).toggleClass("portrait", !e),
  8656. w.toggleClass("tiny", $("#player").height() <= o.narrowLandscapeHeight),
  8657. w.toggleClass("tinier", $("#player").height() <= o.reallyNarrowLandscapeHeight)
  8658. }
  8659. var g = e("../../util/browser")
  8660. , m = e("./vrLink")
  8661. , v = e("../../enum/VRApps")
  8662. , y = e("../../enum/VRPlatforms")
  8663. , A = e("../../enum/VRPages")
  8664. , C = e("./vrEvent")
  8665. , o = (e("../../settings"),
  8666. e("../../constants"))
  8667. , I = e("../../localization/localize")
  8668. , a = e("../../util/common")
  8669. , s = e("events").EventEmitter
  8670. , E = 0
  8671. , _ = null
  8672. , b = A.standard
  8673. , w = $(".vr-popup")
  8674. , l = w.find(".vr-popup-body")
  8675. , T = w.find(".vr-images")
  8676. , x = w.find(".img-container")
  8677. , S = w.find(".vr-sm-image")
  8678. , M = x.find(".vr-img-caption")
  8679. , R = $(".vr-buttons").find(".prev-button")
  8680. , P = $(".vr-buttons").find(".next-button")
  8681. , O = T.find(".front-close")
  8682. , L = $(".vr-page")
  8683. , D = w.find("img")
  8684. , N = "images/apple-store.png"
  8685. , F = "images/badge-oculus.png"
  8686. , B = "images/badge-cardboard.png"
  8687. , V = "images/logo-samsung.png"
  8688. , k = "images/headset-cardboard.png"
  8689. , U = "images/headset-gearvr.png"
  8690. , H = "images/ico-android-robot.png"
  8691. , z = "images/ico-gearvr.png"
  8692. , G = "images/ico-vr.png"
  8693. , W = "images/apple-logo-white.svg"
  8694. , j = null
  8695. , Y = null
  8696. , q = {}
  8697. , X = {
  8698. init: function(e, t) {
  8699. function i(e) {
  8700. X.emit(C.STORE, {
  8701. type: e
  8702. }),
  8703. m.launchStore(e)
  8704. }
  8705. function n(e) {
  8706. switch (e !== b.pageCount && (u(e),
  8707. L.text(e + 1 + " / " + b.pageCount)),
  8708. e) {
  8709. case b.Title:
  8710. R.css("display", "none"),
  8711. P.text(a[e]),
  8712. h(r);
  8713. break;
  8714. case b.Cardboard:
  8715. R.css("display", "block"),
  8716. P.text(a[e]),
  8717. x.filter(".cardboard").off(),
  8718. x.filter(".gearvr").off(),
  8719. d(e, r),
  8720. p(k, j, Y);
  8721. break;
  8722. case b.Gear:
  8723. P.text(a[e]),
  8724. d(e, r),
  8725. w.addClass("lastPage"),
  8726. p(U, j, Y);
  8727. break;
  8728. case b.pageCount:
  8729. w.removeClass("fadeIn"),
  8730. X.emit(C.CLOSED)
  8731. }
  8732. D.filter("[src='']").hide()
  8733. }
  8734. var r = g.detectAndroid() ? g.detectAndroidMobile() && c(y.Android) ? (w.addClass("supported"),
  8735. _ = ".show-supported",
  8736. y.Android) : (w.addClass("unsupported"),
  8737. _ = ".show-unsupported",
  8738. y.UnsupportedAndroid) : g.detectIPhone() || g.detectIPod() ? (w.addClass("ios"),
  8739. _ = ".show-ios",
  8740. b = A.ios,
  8741. y.IOS) : (w.addClass("desktop"),
  8742. _ = ".show-desktop",
  8743. y.Desktop);
  8744. function o(e) {
  8745. X.emit(C.LAUNCH, {
  8746. vr_platform: r,
  8747. vr_app: e
  8748. }),
  8749. m.launch(e)
  8750. }
  8751. m.init(r, e, t),
  8752. r !== y.Desktop && w.addClass("mobile"),
  8753. q.cardboardAndroid = o.bind(this, v.CardboardAndroid),
  8754. q.gear = o.bind(this, v.GearVR),
  8755. q.cardboardIOS = o.bind(this, v.CardboardIOS),
  8756. f(),
  8757. $(".show-supported, .show-unsupported, .show-ios, .show-desktop").hide(),
  8758. $(_).show();
  8759. var a = [I.VR_LEARN_MORE_CAPS, I.VR_NEXT_CAPS, I.VR_GOT_IT_CAPS]
  8760. , s = ["vr_modal_learn_more", "vr_modal_next", "vr_modal_done"];
  8761. r === y.IOS && (a.splice(1, 1),
  8762. s.splice(1, 1)),
  8763. $("#vr").on("click", function(e) {
  8764. e.preventDefault(),
  8765. window.vrEnabled || (window.vrEnabled = !0,
  8766. this.classList.add("active"),
  8767. $("#gui div").not("#vrOff").addClass("vrHide"),
  8768. $("#vrOffImg").css({
  8769. display: "inline-block"
  8770. }))
  8771. }),
  8772. $("#vrOff").on("click", function() {
  8773. window.vrEnabled = !1,
  8774. $("#gui div").not("#vrOff").removeClass("vrHide"),
  8775. $("#vrOffImg").css({
  8776. display: "none"
  8777. }),
  8778. $("#player canvas").css({
  8779. width: "",
  8780. height: ""
  8781. }),
  8782. $("#vr").removeClass("active")
  8783. });
  8784. var l = "https://my.port.com/vr/show/?m=" + e.sid;
  8785. r === y.IOS ? $(".cardboardLink").on("click", i.bind(this, v.CardboardIOS)) : $(".cardboardLink").on("click", i.bind(this, v.CardboardAndroid)),
  8786. $(".gearLink").on("click", i.bind(this, v.GearVR)),
  8787. $("span.modelLink").text(l),
  8788. R.on("click", function(e) {
  8789. X.emit(C.PREV),
  8790. n(--E)
  8791. }),
  8792. P.on("click", function(e) {
  8793. P.text(),
  8794. X.emit(C.NEXT, {
  8795. nextAction: s[E]
  8796. }),
  8797. n(++E)
  8798. }),
  8799. w.find(".close").on("click", X.dismiss)
  8800. },
  8801. dismiss: function() {
  8802. w.hasClass("fadeIn") && (w.removeClass("fadeIn"),
  8803. X.emit(C.CLOSED))
  8804. },
  8805. isDeviceSupported: c
  8806. };
  8807. a.extendObject(X, s.prototype),
  8808. $(window).resize(f);
  8809. var Z, K, Q = (Z = M.filter(".first").find(".cardboard"),
  8810. K = M.filter(".first").find(".gearvr"),
  8811. {
  8812. cardboard: function() {
  8813. K.addClass("hidden"),
  8814. Z.removeClass("hidden")
  8815. },
  8816. gearvr: function() {
  8817. Z.addClass("hidden"),
  8818. K.removeClass("hidden")
  8819. }
  8820. });
  8821. t.exports = X
  8822. }
  8823. , {
  8824. "../../constants": 8,
  8825. "../../enum/VRApps": 46,
  8826. "../../enum/VRPages": 48,
  8827. "../../enum/VRPlatforms": 49,
  8828. "../../localization/localize": 108,
  8829. "../../settings": 166,
  8830. "../../util/browser": 182,
  8831. "../../util/common": 185,
  8832. "./vrEvent": 85,
  8833. "./vrLink": 86,
  8834. events: 202
  8835. }],
  8836. 88: [function(e, t, i) {
  8837. "use strict";
  8838. t.exports = Object.freeze({
  8839. OPENED: "webvr.modal.opened",
  8840. SHOW_TERMS: "webvr.footer.show.terms"
  8841. })
  8842. }
  8843. , {}],
  8844. 89: [function(B, V, e) {
  8845. (function(e) {
  8846. "use strict";
  8847. function a() {
  8848. function t() {
  8849. p.isPresenting || (r.info("exiting webVR"),
  8850. c("webvr_exit_app"),
  8851. -1 === window.location.search.indexOf("&qs=1") ? window.location = window.location + "&qs=1" : window.location = window.location,
  8852. window.removeEventListener("vrdisplaypresentchange", t))
  8853. }
  8854. r.info("Headset mounted"),
  8855. u.suspend();
  8856. var e = document.createElement("canvas");
  8857. for (e.getContext("webgl"),
  8858. e.className = "webvr-canvas",
  8859. document.bgColor = "#000",
  8860. document.body.style.backgroundColor = "#000"; document.body.firstChild; )
  8861. document.body.removeChild(document.body.firstChild);
  8862. document.body.appendChild(e),
  8863. c("webvr_enter_app"),
  8864. p.requestPresent([{
  8865. source: e,
  8866. predistorted: !0
  8867. }]).catch(function(e) {
  8868. r.error("Failed to present: " + e),
  8869. c("webvr_exit_calibrate"),
  8870. t()
  8871. }),
  8872. d.then(function() {
  8873. window.dispatchEvent(new Event("vrapp-start"))
  8874. }),
  8875. window.addEventListener("vrdisplaypresentchange", t)
  8876. }
  8877. function s() {
  8878. c("webvr_modal_close"),
  8879. _.find(".enter-button").off("click", a),
  8880. E.fadeOut(g.guiAnimationSpeed, function() {
  8881. _.toggleClass("hidden", !1),
  8882. b.toggleClass("hidden", !0),
  8883. f.exitFullscreen()
  8884. }),
  8885. I.fadeIn(g.guiAnimationSpeed)
  8886. }
  8887. function t() {
  8888. M.toggleClass("hidden", !0),
  8889. S.toggleClass("hidden", !1)
  8890. }
  8891. function l() {
  8892. _.toggleClass("hidden"),
  8893. b.toggleClass("hidden")
  8894. }
  8895. function c(e) {
  8896. var t = f.isLandscape() ? "landscape" : "portrait";
  8897. i.trackAlways("showcase_gui", {
  8898. gui_action: e,
  8899. orientation: t
  8900. })
  8901. }
  8902. function h() {
  8903. var e = f.isLandscape();
  8904. E.toggleClass("landscape", e).toggleClass("portrait", !e)
  8905. }
  8906. var u, d, p, f = B("../../util/browser"), g = B("../../settings"), m = (B("./../gui"),
  8907. B("../../enum/VRPlatforms")), v = B("../../enum/VRApps"), y = B("./../vr/vrLink"), A = B("./WebVrEvent"), i = B("../../analytics"), C = (B("../../constants"),
  8908. 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 = {
  8909. init: function(e, t, i, n) {
  8910. function r(e) {
  8911. e.preventDefault(),
  8912. o(e.currentTarget.id)
  8913. }
  8914. function o(i) {
  8915. F[i](),
  8916. Object.keys(F).map(function(e, t) {
  8917. $("#" + e).toggleClass("tabs-underlined", e === i)
  8918. })
  8919. }
  8920. p = i,
  8921. u = t,
  8922. y.init(m.Android, e, n),
  8923. h(),
  8924. new RegExp("daydream","i").test(p.displayName) ? (o("tabdaydream"),
  8925. w.filter(".device-headset-side").attr("src", "images/device-daydream-side.png"),
  8926. _.find(".title").text(C.localizeText("WEBVR_FOR_DAYDREAM"))) : (o("tabcardboard"),
  8927. w.filter(".device-headset-side").attr("src", R),
  8928. _.find(".title").text(C.localizeText("WEBVR_FOR_CARDBOARD"))),
  8929. $("#vr").on("click", function(e) {
  8930. e.preventDefault(),
  8931. c("click_webvr_button"),
  8932. E.is(":hidden") && (N.emit(A.OPENED),
  8933. I.fadeOut(g.guiAnimationSpeed),
  8934. E.fadeIn(g.guiAnimationSpeed),
  8935. function() {
  8936. if (!d) {
  8937. var n = "https://static.port.com/webvr/" + (f.valueFromHash("webvr") || g.appConfig.webvr_version) + "/js/main.js";
  8938. d = new Promise(function(e, t) {
  8939. var i = document.createElement("script");
  8940. i.type = "text/javascript",
  8941. i.src = n,
  8942. i.onload = e,
  8943. document.head.appendChild(i)
  8944. }
  8945. )
  8946. }
  8947. _.find(".enter-button").on("click", a)
  8948. }())
  8949. }),
  8950. $(".webvr-popup .close").on("click", function(e) {
  8951. e.preventDefault(),
  8952. _.hasClass("hidden") ? (c("webvr_help_close"),
  8953. l()) : s()
  8954. }),
  8955. $("#tabcardboard").on("click", r),
  8956. $("#tabdaydream").on("click", r),
  8957. $("#tabnative").on("click", r),
  8958. $(".webvr-popup .open-with-app").on("click", function(e) {
  8959. e.preventDefault(),
  8960. c("webvr_learn_more"),
  8961. o("tabnative"),
  8962. l()
  8963. }),
  8964. $(".webvr-popup .help").on("click", function(e) {
  8965. e.preventDefault(),
  8966. c(_.hasClass("hidden") ? "webvr_help_close" : "webvr_help_show"),
  8967. l()
  8968. }),
  8969. $(".webvr-popup .terms").on("click", function(e) {
  8970. e.preventDefault(),
  8971. c("webvr_click_terms"),
  8972. s(),
  8973. N.emit(A.SHOW_TERMS)
  8974. }),
  8975. T.on("click", function(e) {
  8976. e.preventDefault(),
  8977. c(D),
  8978. window.open(L, "_blank")
  8979. }),
  8980. x.on("click", function(e) {
  8981. e.preventDefault(),
  8982. c("webvr_phone_link"),
  8983. window.open("https://vr.google.com/daydream/phones/", "_blank")
  8984. }),
  8985. $(".webvr-popup .badge-cardboard").on("click", function(e) {
  8986. e.preventDefault(),
  8987. c("webvr_cardboard_link"),
  8988. y.launch(v.CardboardAndroid)
  8989. }),
  8990. $(".webvr-popup .badge-oculus").on("click", function(e) {
  8991. e.preventDefault(),
  8992. c("webvr_oculus_link"),
  8993. y.launch(v.GearVR)
  8994. })
  8995. }
  8996. }, F = {
  8997. tabcardboard: function() {
  8998. w.filter(".device-headset").attr("src", R),
  8999. w.filter(".device-phone").attr("src", "images/ico-android-robot.png"),
  9000. L = "https://vr.google.com/cardboard/get-cardboard/",
  9001. D = "webvr_cardboard_link",
  9002. T.text(C.localizeText("VR_GOOGLE_CARDBOARD")),
  9003. x.text(C.localizeText("VR_COMPATIBLE_ANDROID_LONG")),
  9004. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !0),
  9005. t()
  9006. },
  9007. tabdaydream: function() {
  9008. w.filter(".device-headset").attr("src", "images/device-daydream.png"),
  9009. w.filter(".device-phone").attr("src", "images/device-pixel.png"),
  9010. L = P,
  9011. D = O,
  9012. T.text(C.localizeText("WEBVR_DAYDREAM_VIEW")),
  9013. x.text(C.localizeText("VR_NEED_DAYDREAM_PHONE")),
  9014. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !1),
  9015. t()
  9016. },
  9017. tabnative: function() {
  9018. w.filter(".badge-cardboard").attr("src", "images/badge-cardboard.png"),
  9019. w.filter(".badge-oculus").attr("src", "images/badge-oculus.png"),
  9020. M.toggleClass("hidden", !1),
  9021. S.toggleClass("hidden", !0)
  9022. }
  9023. };
  9024. n.extendObject(N, o.prototype),
  9025. $(window).resize(h),
  9026. V.exports = N
  9027. }
  9028. ).call(this, "/js/gui/webvr/webVRgui.js")
  9029. }
  9030. , {
  9031. "../../analytics": 4,
  9032. "../../constants": 8,
  9033. "../../enum/VRApps": 46,
  9034. "../../enum/VRPlatforms": 49,
  9035. "../../localization/localize": 108,
  9036. "../../settings": 166,
  9037. "../../util/browser": 182,
  9038. "../../util/common": 185,
  9039. "../../util/logger": 189,
  9040. "./../gui": 65,
  9041. "./../vr/vrLink": 86,
  9042. "./WebVrEvent": 88,
  9043. events: 202
  9044. }],
  9045. 90: [function(e, t, i) {
  9046. "use strict";
  9047. function n(e, t, i, n, r) {
  9048. this.floorId = n || 0 === n ? n : -1,
  9049. this.roomId = r || "",
  9050. this.labelId = e,
  9051. this.position = (new o.Vector3).copy(t),
  9052. this.text = i
  9053. }
  9054. var o = e("three")
  9055. , r = e("../util/browser");
  9056. n.prototype.build = function() {
  9057. var e = window.document.createElement("div");
  9058. r.isMobile() ? e.setAttribute("class", "gui-floorplan-label gui-floorplan-label-mobile") : e.setAttribute("class", "gui-floorplan-label");
  9059. var t = window.document.createElement("div");
  9060. t.setAttribute("class", "gui-floorplan-label-text");
  9061. var i = window.document.createTextNode(this.text);
  9062. t.appendChild(i),
  9063. e.appendChild(t),
  9064. window.document.body.appendChild(e),
  9065. this.labelGui = e,
  9066. this.textBlock = t,
  9067. $(this.labelGui).hide();
  9068. var n = window.getComputedStyle(this.labelGui);
  9069. this.initialTransform = n.transform || n.webkitTransform
  9070. }
  9071. ,
  9072. t.exports = n
  9073. }
  9074. , {
  9075. "../util/browser": 182,
  9076. three: 217
  9077. }],
  9078. 91: [function(e, t, i) {
  9079. "use strict";
  9080. function n() {
  9081. this.player = null,
  9082. this.modelManager = null,
  9083. this.container = null
  9084. }
  9085. var c, o, r = e("three"), a = (e("../util/common"),
  9086. e("../enum/PlayerEvents")), s = (e("../enum/DirectorEvents"),
  9087. e("../enum/ModelManagerEvents")), l = e("../settings"), h = e("../enum/Viewmode"), u = (e("../enum/WarpStyle"),
  9088. e("../util/transitions"),
  9089. e("../util/lerp"),
  9090. e("../util/browser"));
  9091. n.prototype.init = function(e, t, i) {
  9092. this.player = e,
  9093. this.modelManager = t,
  9094. this.container = i,
  9095. this.updateModel(),
  9096. this.bindEvents()
  9097. }
  9098. ,
  9099. n.prototype.bindEvents = function() {
  9100. this.modelManager.on(s.ActiveModelChanged, this.updateModel.bind(this)),
  9101. this.player.on(a.ViewChanged, this.handlePlayerViewChanged.bind(this)),
  9102. this.player.on(a.ModeChanged, this.handlePlayerViewChanged.bind(this)),
  9103. this.player.on(a.StartInside, this.handleStartInside.bind(this)),
  9104. this.player.on(a.StartOutside, this.handleStartOutside.bind(this))
  9105. }
  9106. ,
  9107. n.prototype.updateModel = function() {
  9108. this.model = this.modelManager.getActiveModel()
  9109. }
  9110. ,
  9111. n.prototype.handlePlayerViewChanged = function() {
  9112. this.updateLabelVisibility(),
  9113. this.updateLabelDisplay()
  9114. }
  9115. ,
  9116. n.prototype.getLabelsForFloor = function(t, i) {
  9117. return (i = i || []).length = 0,
  9118. this.model.labels.forEach(function(e) {
  9119. this.labelVisibleForFloor(e, t) && i.push(e)
  9120. }
  9121. .bind(this)),
  9122. i
  9123. }
  9124. ,
  9125. n.prototype.getLabelsForCurrentFloor = function(e) {
  9126. return this.getLabelsForFloor(this.model.currentFloor.floorIndex, e)
  9127. }
  9128. ,
  9129. n.prototype.labelVisibleForFloor = function(e, t) {
  9130. var i = u.isMobile() && this.player.getLabelScaleFactor() < l.labels.zoomHideThreshhold.mobile || !u.isMobile() && this.player.getLabelScaleFactor() < l.labels.zoomHideThreshhold.desktop;
  9131. if (!this.model.showingLabels || !e.labelGui || !i)
  9132. return !1;
  9133. var n = e.floorId === this.model.floors.size() - 1;
  9134. return this.model.allFloorsVisible ? n : e.floorId === t
  9135. }
  9136. ,
  9137. n.prototype.updateLabelVisibility = function(e) {
  9138. this.model.labels.forEach(function(e) {
  9139. 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)
  9140. }
  9141. .bind(this))
  9142. }
  9143. ,
  9144. n.prototype.showAllLabels = function(t, i) {
  9145. this.model.labels.forEach(function(e) {
  9146. this.showLabel(e, t, i)
  9147. }
  9148. .bind(this))
  9149. }
  9150. ,
  9151. n.prototype.hideAllLabels = function(t, i) {
  9152. this.model.labels.forEach(function(e) {
  9153. this.hideLabel(e, t, i)
  9154. }
  9155. .bind(this))
  9156. }
  9157. ,
  9158. n.prototype.showLabel = function(e, t, i) {
  9159. this.model.showingLabels && (e.visible || (e.visible = !0,
  9160. e.labelGui.style.display = "block",
  9161. e.labelGui.style.opacity = 0,
  9162. $(e.labelGui).delay(t).fadeTo(i, 1)))
  9163. }
  9164. ,
  9165. n.prototype.hideLabel = function(e, t, i) {
  9166. e.visible && (e.visible = !1,
  9167. u.isMobile() ? $(e.labelGui).hide() : $(e.labelGui).delay(t).fadeOut(i))
  9168. }
  9169. ,
  9170. n.prototype.supportedMode = function() {
  9171. return this.player.mode === h.FLOORPLAN
  9172. }
  9173. ,
  9174. n.prototype.updateLabelDisplay = (new r.Vector3,
  9175. new r.Vector3,
  9176. o = [],
  9177. function() {
  9178. var e = this.player.getLabelScaleFactor()
  9179. , t = 1.2 * (1 - e) + .6
  9180. , i = u.isMobile() ? l.labels.zoomTruncateThreshhold.mobile : l.labels.zoomTruncateThreshhold.desktop;
  9181. this.getLabelsForCurrentFloor(o);
  9182. for (var n = 0; n < o.length; n++) {
  9183. var r = o[n];
  9184. this.supportedMode() && r.labelGui && (this.updateProjectedGuiElement(r.labelGui, r.textBlock, r.position, t, t),
  9185. 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)
  9186. }
  9187. }
  9188. ),
  9189. n.prototype.updateProjectedGuiElement = (c = new r.Vector3,
  9190. new r.Vector3,
  9191. function(e, t, i, n, r) {
  9192. t.style.fontSize = 100 * r + "%";
  9193. var o = .5 * $("#player").width()
  9194. , a = .5 * $("#player").height();
  9195. c.copy(i),
  9196. c.project(this.player.camera);
  9197. var s = c.x * o + o
  9198. , l = -c.y * a + a;
  9199. s -= e.offsetWidth / 2,
  9200. l -= e.offsetHeight / 2,
  9201. e.style.left = s + "px",
  9202. e.style.top = l + "px"
  9203. }
  9204. ),
  9205. n.prototype.handleStartInside = function(e) {
  9206. this.updateLabelVisibility()
  9207. }
  9208. ,
  9209. n.prototype.handleStartOutside = function() {
  9210. this.updateLabelVisibility()
  9211. }
  9212. ,
  9213. t.exports = n
  9214. }
  9215. , {
  9216. "../enum/DirectorEvents": 23,
  9217. "../enum/ModelManagerEvents": 33,
  9218. "../enum/PlayerEvents": 40,
  9219. "../enum/Viewmode": 51,
  9220. "../enum/WarpStyle": 52,
  9221. "../settings": 166,
  9222. "../util/browser": 182,
  9223. "../util/common": 185,
  9224. "../util/lerp": 188,
  9225. "../util/transitions": 195,
  9226. three: 217
  9227. }],
  9228. 92: [function(e, t, i) {
  9229. "use strict";
  9230. Array.prototype.findIndex || (Array.prototype.findIndex = function(e) {
  9231. if (null == this)
  9232. throw new TypeError("Array.prototype.findIndex called on null or undefined");
  9233. if ("function" != typeof e)
  9234. throw new TypeError("predicate must be a function");
  9235. for (var t, i = Object(this), n = i.length >>> 0, r = arguments[1], o = 0; o < n; o++)
  9236. if (t = i[o],
  9237. e.call(r, t, o, i))
  9238. return o;
  9239. return -1
  9240. }
  9241. ),
  9242. Array.prototype.find || Object.defineProperty(Array.prototype, "find", {
  9243. value: function(e) {
  9244. if (null == this)
  9245. throw new TypeError('"this" is null or not defined');
  9246. var t = Object(this)
  9247. , i = t.length >>> 0;
  9248. if ("function" != typeof e)
  9249. throw new TypeError("predicate must be a function");
  9250. for (var n = arguments[1], r = 0; r < i; ) {
  9251. var o = t[r];
  9252. if (e.call(n, o, r, t))
  9253. return o;
  9254. r++
  9255. }
  9256. }
  9257. })
  9258. }
  9259. , {}],
  9260. 93: [function(e, t, i) {
  9261. "use strict";
  9262. 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 || {};
  9263. function te() {
  9264. this.backgroundElement = document.createElement("div"),
  9265. r.extend(this.backgroundElement.style, {
  9266. backgroundColor: "rgba(0,0,0,0.8)",
  9267. top: 0,
  9268. left: 0,
  9269. display: "none",
  9270. zIndex: "1000",
  9271. opacity: 0,
  9272. WebkitTransition: "opacity 0.2s linear"
  9273. }),
  9274. n.makeFullscreen(this.backgroundElement),
  9275. this.backgroundElement.style.position = "fixed",
  9276. this.domElement = document.createElement("div"),
  9277. r.extend(this.domElement.style, {
  9278. position: "fixed",
  9279. display: "none",
  9280. zIndex: "1001",
  9281. opacity: 0,
  9282. WebkitTransition: "-webkit-transform 0.2s ease-out, opacity 0.2s linear"
  9283. }),
  9284. document.body.appendChild(this.backgroundElement),
  9285. document.body.appendChild(this.domElement);
  9286. var e = this;
  9287. n.bind(this.backgroundElement, "click", function() {
  9288. e.hide()
  9289. })
  9290. }
  9291. function ie(e, t, i) {
  9292. Object.defineProperty(e, t, {
  9293. get: function() {
  9294. return "RGB" === this.__state.space || re(this, t, i),
  9295. this.__state[t]
  9296. },
  9297. set: function(e) {
  9298. "RGB" !== this.__state.space && (re(this, t, i),
  9299. this.__state.space = "RGB"),
  9300. this.__state[t] = e
  9301. }
  9302. })
  9303. }
  9304. function ne(e, t) {
  9305. Object.defineProperty(e, t, {
  9306. get: function() {
  9307. return "HSV" === this.__state.space || oe(this),
  9308. this.__state[t]
  9309. },
  9310. set: function(e) {
  9311. "HSV" !== this.__state.space && (oe(this),
  9312. this.__state.space = "HSV"),
  9313. this.__state[t] = e
  9314. }
  9315. })
  9316. }
  9317. function re(e, t, i) {
  9318. if ("HEX" === e.__state.space)
  9319. e.__state[t] = a.component_from_hex(e.__state.hex, i);
  9320. else {
  9321. if ("HSV" !== e.__state.space)
  9322. throw "Corrupted color state";
  9323. l.extend(e.__state, a.hsv_to_rgb(e.__state.h, e.__state.s, e.__state.v))
  9324. }
  9325. }
  9326. function oe(e) {
  9327. var t = a.rgb_to_hsv(e.r, e.g, e.b);
  9328. l.extend(e.__state, {
  9329. s: t.s,
  9330. v: t.v
  9331. }),
  9332. l.isNaN(t.h) ? l.isUndefined(e.__state.h) && (e.__state.h = 0) : e.__state.h = t.h
  9333. }
  9334. function ae() {
  9335. if (this.__state = o.apply(this, arguments),
  9336. !1 === this.__state)
  9337. throw "Failed to interpret color arguments";
  9338. this.__state.a = this.__state.a || 1
  9339. }
  9340. function se(e) {
  9341. return -1 < (e = e.toString()).indexOf(".") ? e.length - e.indexOf(".") - 1 : 0
  9342. }
  9343. function le(e, t) {
  9344. this.initialValue = e[t],
  9345. this.domElement = document.createElement("div"),
  9346. this.object = e,
  9347. this.property = t,
  9348. this.__onChange = void 0,
  9349. this.__onFinishChange = void 0
  9350. }
  9351. (t.exports = ee).gui = ee.gui || {},
  9352. ee.utils = ee.utils || {},
  9353. ee.controllers = ee.controllers || {},
  9354. ee.dom = ee.dom || {},
  9355. ee.color = ee.color || {},
  9356. ee.utils.css = {
  9357. load: function(e, t) {
  9358. var i = (t = t || document).createElement("link");
  9359. i.type = "text/css",
  9360. i.rel = "stylesheet",
  9361. i.href = e,
  9362. t.getElementsByTagName("head")[0].appendChild(i)
  9363. },
  9364. inject: function(e, t) {
  9365. t = t || document;
  9366. var i = document.createElement("style");
  9367. i.type = "text/css",
  9368. i.innerHTML = e,
  9369. t.getElementsByTagName("head")[0].appendChild(i)
  9370. }
  9371. },
  9372. ee.utils.common = (Q = Array.prototype.forEach,
  9373. J = Array.prototype.slice,
  9374. {
  9375. BREAK: {},
  9376. extend: function(i) {
  9377. return this.each(J.call(arguments, 1), function(e) {
  9378. for (var t in e)
  9379. this.isUndefined(e[t]) || (i[t] = e[t])
  9380. }, this),
  9381. i
  9382. },
  9383. defaults: function(i) {
  9384. return this.each(J.call(arguments, 1), function(e) {
  9385. for (var t in e)
  9386. this.isUndefined(i[t]) && (i[t] = e[t])
  9387. }, this),
  9388. i
  9389. },
  9390. compose: function() {
  9391. var i = J.call(arguments);
  9392. return function() {
  9393. for (var e = J.call(arguments), t = i.length - 1; 0 <= t; t--)
  9394. e = [i[t].apply(this, e)];
  9395. return e[0]
  9396. }
  9397. },
  9398. each: function(e, t, i) {
  9399. if (e)
  9400. if (Q && e.forEach && e.forEach === Q)
  9401. e.forEach(t, i);
  9402. else if (e.length === e.length + 0) {
  9403. for (var n = 0, r = e.length; n < r; n++)
  9404. if (n in e && t.call(i, e[n], n) === this.BREAK)
  9405. return
  9406. } else
  9407. for (var n in e)
  9408. if (t.call(i, e[n], n) === this.BREAK)
  9409. return
  9410. },
  9411. defer: function(e) {
  9412. setTimeout(e, 0)
  9413. },
  9414. toArray: function(e) {
  9415. return e.toArray ? e.toArray() : J.call(e)
  9416. },
  9417. isUndefined: function(e) {
  9418. return void 0 === e
  9419. },
  9420. isNull: function(e) {
  9421. return null === e
  9422. },
  9423. isNaN: function(e) {
  9424. return e != e
  9425. },
  9426. isArray: Array.isArray || function(e) {
  9427. return e.constructor === Array
  9428. }
  9429. ,
  9430. isObject: function(e) {
  9431. return e === Object(e)
  9432. },
  9433. isNumber: function(e) {
  9434. return e === e + 0
  9435. },
  9436. isString: function(e) {
  9437. return e === e + ""
  9438. },
  9439. isBoolean: function(e) {
  9440. return !1 === e || !0 === e
  9441. },
  9442. isFunction: function(e) {
  9443. return "[object Function]" === Object.prototype.toString.call(e)
  9444. }
  9445. }),
  9446. ee.controllers.Controller = (ee.utils.common.extend(le.prototype, {
  9447. onChange: function(e) {
  9448. return this.__onChange = e,
  9449. this
  9450. },
  9451. onFinishChange: function(e) {
  9452. return this.__onFinishChange = e,
  9453. this
  9454. },
  9455. setValue: function(e) {
  9456. return this.object[this.property] = e,
  9457. this.__onChange && this.__onChange.call(this, e),
  9458. this.updateDisplay(),
  9459. this
  9460. },
  9461. getValue: function() {
  9462. return this.object[this.property]
  9463. },
  9464. updateDisplay: function() {
  9465. return this
  9466. },
  9467. isModified: function() {
  9468. return this.initialValue !== this.getValue()
  9469. }
  9470. }),
  9471. le),
  9472. ee.dom.dom = function(c) {
  9473. function i(e) {
  9474. if ("0" === e || c.isUndefined(e))
  9475. return 0;
  9476. var t = e.match(n);
  9477. return c.isNull(t) ? 0 : parseFloat(t[1])
  9478. }
  9479. var h = {};
  9480. c.each({
  9481. HTMLEvents: ["change"],
  9482. MouseEvents: ["click", "mousemove", "mousedown", "mouseup", "mouseover"],
  9483. KeyboardEvents: ["keydown"]
  9484. }, function(e, t) {
  9485. c.each(e, function(e) {
  9486. h[e] = t
  9487. })
  9488. });
  9489. var n = /(\d+(\.\d+)?)px/
  9490. , r = {
  9491. makeSelectable: function(e, t) {
  9492. void 0 !== e && void 0 !== e.style && (e.onselectstart = t ? function() {
  9493. return !1
  9494. }
  9495. : function() {}
  9496. ,
  9497. e.style.MozUserSelect = t ? "auto" : "none",
  9498. e.style.KhtmlUserSelect = t ? "auto" : "none",
  9499. e.unselectable = t ? "on" : "off")
  9500. },
  9501. makeFullscreen: function(e, t, i) {
  9502. c.isUndefined(t) && (t = !0),
  9503. c.isUndefined(i) && (i = !0),
  9504. e.style.position = "absolute",
  9505. t && (e.style.left = 0,
  9506. e.style.right = 0),
  9507. i && (e.style.top = 0,
  9508. e.style.bottom = 0)
  9509. },
  9510. fakeEvent: function(e, t, i, n) {
  9511. i = i || {};
  9512. var r = h[t];
  9513. if (!r)
  9514. throw new Error("Event type " + t + " not supported.");
  9515. var o = document.createEvent(r);
  9516. switch (r) {
  9517. case "MouseEvents":
  9518. var a = i.x || i.clientX || 0
  9519. , s = i.y || i.clientY || 0;
  9520. o.initMouseEvent(t, i.bubbles || !1, i.cancelable || !0, window, i.clickCount || 1, 0, 0, a, s, !1, !1, !1, !1, 0, null);
  9521. break;
  9522. case "KeyboardEvents":
  9523. var l = o.initKeyboardEvent || o.initKeyEvent;
  9524. c.defaults(i, {
  9525. cancelable: !0,
  9526. ctrlKey: !1,
  9527. altKey: !1,
  9528. shiftKey: !1,
  9529. metaKey: !1,
  9530. keyCode: void 0,
  9531. charCode: void 0
  9532. }),
  9533. l(t, i.bubbles || !1, i.cancelable, window, i.ctrlKey, i.altKey, i.shiftKey, i.metaKey, i.keyCode, i.charCode);
  9534. break;
  9535. default:
  9536. o.initEvent(t, i.bubbles || !1, i.cancelable || !0)
  9537. }
  9538. c.defaults(o, n),
  9539. e.dispatchEvent(o)
  9540. },
  9541. bind: function(e, t, i, n) {
  9542. return n = n || !1,
  9543. e.addEventListener ? e.addEventListener(t, i, n) : e.attachEvent && e.attachEvent("on" + t, i),
  9544. r
  9545. },
  9546. unbind: function(e, t, i, n) {
  9547. return n = n || !1,
  9548. e.removeEventListener ? e.removeEventListener(t, i, n) : e.detachEvent && e.detachEvent("on" + t, i),
  9549. r
  9550. },
  9551. addClass: function(e, t) {
  9552. if (void 0 === e.className)
  9553. e.className = t;
  9554. else if (e.className !== t) {
  9555. var i = e.className.split(/ +/);
  9556. -1 == i.indexOf(t) && (i.push(t),
  9557. e.className = i.join(" ").replace(/^\s+/, "").replace(/\s+$/, ""))
  9558. }
  9559. return r
  9560. },
  9561. removeClass: function(e, t) {
  9562. if (t)
  9563. if (void 0 === e.className)
  9564. ;
  9565. else if (e.className === t)
  9566. e.removeAttribute("class");
  9567. else {
  9568. var i = e.className.split(/ +/)
  9569. , n = i.indexOf(t);
  9570. -1 != n && (i.splice(n, 1),
  9571. e.className = i.join(" "))
  9572. }
  9573. else
  9574. e.className = void 0;
  9575. return r
  9576. },
  9577. hasClass: function(e, t) {
  9578. return new RegExp("(?:^|\\s+)" + t + "(?:\\s+|$)").test(e.className) || !1
  9579. },
  9580. getWidth: function(e) {
  9581. var t = getComputedStyle(e);
  9582. return i(t["border-left-width"]) + i(t["border-right-width"]) + i(t["padding-left"]) + i(t["padding-right"]) + i(t.width)
  9583. },
  9584. getHeight: function(e) {
  9585. var t = getComputedStyle(e);
  9586. return i(t["border-top-width"]) + i(t["border-bottom-width"]) + i(t["padding-top"]) + i(t["padding-bottom"]) + i(t.height)
  9587. },
  9588. getOffset: function(e) {
  9589. var t = {
  9590. left: 0,
  9591. top: 0
  9592. };
  9593. if (e.offsetParent)
  9594. for (; t.left += e.offsetLeft,
  9595. t.top += e.offsetTop,
  9596. e = e.offsetParent; )
  9597. ;
  9598. return t
  9599. },
  9600. isActive: function(e) {
  9601. return e === document.activeElement && (e.type || e.href)
  9602. }
  9603. };
  9604. return r
  9605. }(ee.utils.common),
  9606. ee.controllers.OptionController = (q = ee.controllers.Controller,
  9607. X = ee.dom.dom,
  9608. Z = ee.utils.common,
  9609. (K = function(e, t, i) {
  9610. K.superclass.call(this, e, t);
  9611. var n = this;
  9612. if (this.__select = document.createElement("select"),
  9613. Z.isArray(i)) {
  9614. var r = {};
  9615. Z.each(i, function(e) {
  9616. r[e] = e
  9617. }),
  9618. i = r
  9619. }
  9620. Z.each(i, function(e, t) {
  9621. var i = document.createElement("option");
  9622. i.innerHTML = t,
  9623. i.setAttribute("value", e),
  9624. n.__select.appendChild(i)
  9625. }),
  9626. this.updateDisplay(),
  9627. X.bind(this.__select, "change", function() {
  9628. var e = this.options[this.selectedIndex].value;
  9629. n.setValue(e)
  9630. }),
  9631. this.domElement.appendChild(this.__select)
  9632. }
  9633. ).superclass = q,
  9634. Z.extend(K.prototype, q.prototype, {
  9635. setValue: function(e) {
  9636. var t = K.superclass.prototype.setValue.call(this, e);
  9637. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  9638. t
  9639. },
  9640. updateDisplay: function() {
  9641. return this.__select.value = this.getValue(),
  9642. K.superclass.prototype.updateDisplay.call(this)
  9643. }
  9644. }),
  9645. K),
  9646. ee.controllers.NumberController = (W = ee.controllers.Controller,
  9647. j = ee.utils.common,
  9648. (Y = function(e, t, i) {
  9649. Y.superclass.call(this, e, t),
  9650. i = i || {},
  9651. this.__min = i.min,
  9652. this.__max = i.max,
  9653. this.__step = i.step,
  9654. 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,
  9655. this.__precision = se(this.__impliedStep)
  9656. }
  9657. ).superclass = W,
  9658. j.extend(Y.prototype, W.prototype, {
  9659. setValue: function(e) {
  9660. return void 0 !== this.__min && e < this.__min ? e = this.__min : void 0 !== this.__max && e > this.__max && (e = this.__max),
  9661. void 0 !== this.__step && e % this.__step != 0 && (e = Math.round(e / this.__step) * this.__step),
  9662. Y.superclass.prototype.setValue.call(this, e)
  9663. },
  9664. min: function(e) {
  9665. return this.__min = e,
  9666. this
  9667. },
  9668. max: function(e) {
  9669. return this.__max = e,
  9670. this
  9671. },
  9672. step: function(e) {
  9673. return this.__step = e,
  9674. this.__impliedStep = e,
  9675. this.__precision = se(e),
  9676. this
  9677. }
  9678. }),
  9679. Y),
  9680. ee.controllers.NumberControllerBox = (U = ee.controllers.NumberController,
  9681. H = ee.dom.dom,
  9682. z = ee.utils.common,
  9683. (G = function(e, t, i) {
  9684. function n() {
  9685. var e = parseFloat(s.__input.value);
  9686. z.isNaN(e) || s.setValue(e)
  9687. }
  9688. function r(e) {
  9689. var t = a - e.clientY;
  9690. s.setValue(s.getValue() + t * s.__impliedStep),
  9691. a = e.clientY
  9692. }
  9693. function o() {
  9694. H.unbind(window, "mousemove", r),
  9695. H.unbind(window, "mouseup", o)
  9696. }
  9697. this.__truncationSuspended = !1,
  9698. G.superclass.call(this, e, t, i);
  9699. var a, s = this;
  9700. this.__input = document.createElement("input"),
  9701. this.__input.setAttribute("type", "text"),
  9702. H.bind(this.__input, "change", n),
  9703. H.bind(this.__input, "blur", function() {
  9704. n(),
  9705. s.__onFinishChange && s.__onFinishChange.call(s, s.getValue())
  9706. }),
  9707. H.bind(this.__input, "mousedown", function(e) {
  9708. H.bind(window, "mousemove", r),
  9709. H.bind(window, "mouseup", o),
  9710. a = e.clientY
  9711. }),
  9712. H.bind(this.__input, "keydown", function(e) {
  9713. 13 === e.keyCode && (s.__truncationSuspended = !0,
  9714. this.blur(),
  9715. s.__truncationSuspended = !1)
  9716. }),
  9717. this.updateDisplay(),
  9718. this.domElement.appendChild(this.__input)
  9719. }
  9720. ).superclass = U,
  9721. z.extend(G.prototype, U.prototype, {
  9722. updateDisplay: function() {
  9723. return this.__input.value = this.__truncationSuspended ? this.getValue() : function(e, t) {
  9724. var i = Math.pow(10, t);
  9725. return Math.round(e * i) / i
  9726. }(this.getValue(), this.__precision),
  9727. G.superclass.prototype.updateDisplay.call(this)
  9728. }
  9729. }),
  9730. G),
  9731. ee.controllers.NumberControllerSlider = (N = ee.controllers.NumberController,
  9732. F = ee.dom.dom,
  9733. B = ee.utils.css,
  9734. V = ee.utils.common,
  9735. (k = function(e, t, i, n, r) {
  9736. function o(e) {
  9737. e.preventDefault();
  9738. var t = F.getOffset(s.__background)
  9739. , i = F.getWidth(s.__background);
  9740. return s.setValue(function(e, t, i, n, r) {
  9741. return n + (e - t) / (i - t) * (r - n)
  9742. }(e.clientX, t.left, t.left + i, s.__min, s.__max)),
  9743. !1
  9744. }
  9745. function a() {
  9746. F.unbind(window, "mousemove", o),
  9747. F.unbind(window, "mouseup", a),
  9748. s.__onFinishChange && s.__onFinishChange.call(s, s.getValue())
  9749. }
  9750. k.superclass.call(this, e, t, {
  9751. min: i,
  9752. max: n,
  9753. step: r
  9754. });
  9755. var s = this;
  9756. this.__background = document.createElement("div"),
  9757. this.__foreground = document.createElement("div"),
  9758. F.bind(this.__background, "mousedown", function(e) {
  9759. F.bind(window, "mousemove", o),
  9760. F.bind(window, "mouseup", a),
  9761. o(e)
  9762. }),
  9763. F.addClass(this.__background, "slider"),
  9764. F.addClass(this.__foreground, "slider-fg"),
  9765. this.updateDisplay(),
  9766. this.__background.appendChild(this.__foreground),
  9767. this.domElement.appendChild(this.__background)
  9768. }
  9769. ).superclass = N,
  9770. k.useDefaultStyles = function() {
  9771. 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}")
  9772. }
  9773. ,
  9774. V.extend(k.prototype, N.prototype, {
  9775. updateDisplay: function() {
  9776. var e = (this.getValue() - this.__min) / (this.__max - this.__min);
  9777. return this.__foreground.style.width = 100 * e + "%",
  9778. k.superclass.prototype.updateDisplay.call(this)
  9779. }
  9780. }),
  9781. k),
  9782. ee.controllers.FunctionController = (P = ee.controllers.Controller,
  9783. O = ee.dom.dom,
  9784. L = ee.utils.common,
  9785. (D = function(e, t, i) {
  9786. D.superclass.call(this, e, t);
  9787. var n = this;
  9788. this.__button = document.createElement("div"),
  9789. this.__button.innerHTML = void 0 === i ? "Fire" : i,
  9790. O.bind(this.__button, "click", function(e) {
  9791. return e.preventDefault(),
  9792. n.fire(),
  9793. !1
  9794. }),
  9795. O.addClass(this.__button, "button"),
  9796. this.domElement.appendChild(this.__button)
  9797. }
  9798. ).superclass = P,
  9799. L.extend(D.prototype, P.prototype, {
  9800. fire: function() {
  9801. this.__onChange && this.__onChange.call(this),
  9802. this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  9803. this.getValue().call(this.object)
  9804. }
  9805. }),
  9806. D),
  9807. ee.controllers.BooleanController = (x = ee.controllers.Controller,
  9808. S = ee.dom.dom,
  9809. M = ee.utils.common,
  9810. (R = function(e, t) {
  9811. R.superclass.call(this, e, t);
  9812. var i = this;
  9813. this.__prev = this.getValue(),
  9814. this.__checkbox = document.createElement("input"),
  9815. this.__checkbox.setAttribute("type", "checkbox"),
  9816. S.bind(this.__checkbox, "change", function() {
  9817. i.setValue(!i.__prev)
  9818. }, !1),
  9819. this.domElement.appendChild(this.__checkbox),
  9820. this.updateDisplay()
  9821. }
  9822. ).superclass = x,
  9823. M.extend(R.prototype, x.prototype, {
  9824. setValue: function(e) {
  9825. var t = R.superclass.prototype.setValue.call(this, e);
  9826. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  9827. this.__prev = this.getValue(),
  9828. t
  9829. },
  9830. updateDisplay: function() {
  9831. return !0 === this.getValue() ? (this.__checkbox.setAttribute("checked", "checked"),
  9832. this.__checkbox.checked = !0) : this.__checkbox.checked = !1,
  9833. R.superclass.prototype.updateDisplay.call(this)
  9834. }
  9835. }),
  9836. R),
  9837. ee.color.toString = (T = ee.utils.common,
  9838. function(e) {
  9839. if (1 == e.a || T.isUndefined(e.a)) {
  9840. for (var t = e.hex.toString(16); t.length < 6; )
  9841. t = "0" + t;
  9842. return "#" + t
  9843. }
  9844. return "rgba(" + Math.round(e.r) + "," + Math.round(e.g) + "," + Math.round(e.b) + "," + e.a + ")"
  9845. }
  9846. ),
  9847. ee.color.interpret = (I = ee.color.toString,
  9848. E = ee.utils.common,
  9849. w = [{
  9850. litmus: E.isString,
  9851. conversions: {
  9852. THREE_CHAR_HEX: {
  9853. read: function(e) {
  9854. var t = e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);
  9855. return null !== t && {
  9856. space: "HEX",
  9857. hex: parseInt("0x" + t[1].toString() + t[1].toString() + t[2].toString() + t[2].toString() + t[3].toString() + t[3].toString())
  9858. }
  9859. },
  9860. write: I
  9861. },
  9862. SIX_CHAR_HEX: {
  9863. read: function(e) {
  9864. var t = e.match(/^#([A-F0-9]{6})$/i);
  9865. return null !== t && {
  9866. space: "HEX",
  9867. hex: parseInt("0x" + t[1].toString())
  9868. }
  9869. },
  9870. write: I
  9871. },
  9872. CSS_RGB: {
  9873. read: function(e) {
  9874. var t = e.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);
  9875. return null !== t && {
  9876. space: "RGB",
  9877. r: parseFloat(t[1]),
  9878. g: parseFloat(t[2]),
  9879. b: parseFloat(t[3])
  9880. }
  9881. },
  9882. write: I
  9883. },
  9884. CSS_RGBA: {
  9885. read: function(e) {
  9886. var t = e.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/);
  9887. return null !== t && {
  9888. space: "RGB",
  9889. r: parseFloat(t[1]),
  9890. g: parseFloat(t[2]),
  9891. b: parseFloat(t[3]),
  9892. a: parseFloat(t[4])
  9893. }
  9894. },
  9895. write: I
  9896. }
  9897. }
  9898. }, {
  9899. litmus: E.isNumber,
  9900. conversions: {
  9901. HEX: {
  9902. read: function(e) {
  9903. return {
  9904. space: "HEX",
  9905. hex: e,
  9906. conversionName: "HEX"
  9907. }
  9908. },
  9909. write: function(e) {
  9910. return e.hex
  9911. }
  9912. }
  9913. }
  9914. }, {
  9915. litmus: E.isArray,
  9916. conversions: {
  9917. RGB_ARRAY: {
  9918. read: function(e) {
  9919. return 3 == e.length && {
  9920. space: "RGB",
  9921. r: e[0],
  9922. g: e[1],
  9923. b: e[2]
  9924. }
  9925. },
  9926. write: function(e) {
  9927. return [e.r, e.g, e.b]
  9928. }
  9929. },
  9930. RGBA_ARRAY: {
  9931. read: function(e) {
  9932. return 4 == e.length && {
  9933. space: "RGB",
  9934. r: e[0],
  9935. g: e[1],
  9936. b: e[2],
  9937. a: e[3]
  9938. }
  9939. },
  9940. write: function(e) {
  9941. return [e.r, e.g, e.b, e.a]
  9942. }
  9943. }
  9944. }
  9945. }, {
  9946. litmus: E.isObject,
  9947. conversions: {
  9948. RGBA_OBJ: {
  9949. read: function(e) {
  9950. return !!(E.isNumber(e.r) && E.isNumber(e.g) && E.isNumber(e.b) && E.isNumber(e.a)) && {
  9951. space: "RGB",
  9952. r: e.r,
  9953. g: e.g,
  9954. b: e.b,
  9955. a: e.a
  9956. }
  9957. },
  9958. write: function(e) {
  9959. return {
  9960. r: e.r,
  9961. g: e.g,
  9962. b: e.b,
  9963. a: e.a
  9964. }
  9965. }
  9966. },
  9967. RGB_OBJ: {
  9968. read: function(e) {
  9969. return !!(E.isNumber(e.r) && E.isNumber(e.g) && E.isNumber(e.b)) && {
  9970. space: "RGB",
  9971. r: e.r,
  9972. g: e.g,
  9973. b: e.b
  9974. }
  9975. },
  9976. write: function(e) {
  9977. return {
  9978. r: e.r,
  9979. g: e.g,
  9980. b: e.b
  9981. }
  9982. }
  9983. },
  9984. HSVA_OBJ: {
  9985. read: function(e) {
  9986. return !!(E.isNumber(e.h) && E.isNumber(e.s) && E.isNumber(e.v) && E.isNumber(e.a)) && {
  9987. space: "HSV",
  9988. h: e.h,
  9989. s: e.s,
  9990. v: e.v,
  9991. a: e.a
  9992. }
  9993. },
  9994. write: function(e) {
  9995. return {
  9996. h: e.h,
  9997. s: e.s,
  9998. v: e.v,
  9999. a: e.a
  10000. }
  10001. }
  10002. },
  10003. HSV_OBJ: {
  10004. read: function(e) {
  10005. return !!(E.isNumber(e.h) && E.isNumber(e.s) && E.isNumber(e.v)) && {
  10006. space: "HSV",
  10007. h: e.h,
  10008. s: e.s,
  10009. v: e.v
  10010. }
  10011. },
  10012. write: function(e) {
  10013. return {
  10014. h: e.h,
  10015. s: e.s,
  10016. v: e.v
  10017. }
  10018. }
  10019. }
  10020. }
  10021. }],
  10022. function() {
  10023. b = !1;
  10024. var i = 1 < arguments.length ? E.toArray(arguments) : arguments[0];
  10025. return E.each(w, function(e) {
  10026. if (e.litmus(i))
  10027. return E.each(e.conversions, function(e, t) {
  10028. if (_ = e.read(i),
  10029. !1 === b && !1 !== _)
  10030. return (b = _).conversionName = t,
  10031. _.conversion = e,
  10032. E.BREAK
  10033. }),
  10034. E.BREAK
  10035. }),
  10036. b
  10037. }
  10038. ),
  10039. ee.GUI = ee.gui.GUI = function(e, t, i, c, h, u, d, p, f, n, g, r, o, m, v) {
  10040. function y(e, t, i, n) {
  10041. if (void 0 === t[i])
  10042. throw new Error("Object " + t + ' has no property "' + i + '"');
  10043. var r;
  10044. if (n.color)
  10045. r = new g(t,i);
  10046. else {
  10047. var o = [t, i].concat(n.factoryArgs);
  10048. r = c.apply(e, o)
  10049. }
  10050. n.before instanceof h && (n.before = n.before.__li),
  10051. C(e, r),
  10052. m.addClass(r.domElement, "c");
  10053. var a = document.createElement("span");
  10054. m.addClass(a, "property-name"),
  10055. a.innerHTML = r.property;
  10056. var s = document.createElement("div");
  10057. s.appendChild(a),
  10058. s.appendChild(r.domElement);
  10059. var l = A(e, s, n.before);
  10060. return m.addClass(l, R.CLASS_CONTROLLER_ROW),
  10061. m.addClass(l, typeof r.getValue()),
  10062. function(t, i, n) {
  10063. if (n.__li = i,
  10064. n.__gui = t,
  10065. v.extend(n, {
  10066. options: function(e) {
  10067. return 1 < arguments.length ? (n.remove(),
  10068. y(t, n.object, n.property, {
  10069. before: n.__li.nextElementSibling,
  10070. factoryArgs: [v.toArray(arguments)]
  10071. })) : v.isArray(e) || v.isObject(e) ? (n.remove(),
  10072. y(t, n.object, n.property, {
  10073. before: n.__li.nextElementSibling,
  10074. factoryArgs: [e]
  10075. })) : void 0
  10076. },
  10077. name: function(e) {
  10078. return n.__li.firstElementChild.firstElementChild.innerHTML = e,
  10079. n
  10080. },
  10081. listen: function() {
  10082. return n.__gui.listen(n),
  10083. n
  10084. },
  10085. remove: function() {
  10086. return n.__gui.remove(n),
  10087. n
  10088. }
  10089. }),
  10090. n instanceof f) {
  10091. var r = new p(n.object,n.property,{
  10092. min: n.__min,
  10093. max: n.__max,
  10094. step: n.__step
  10095. });
  10096. v.each(["updateDisplay", "onChange", "onFinishChange"], function(e) {
  10097. var t = n[e]
  10098. , i = r[e];
  10099. n[e] = r[e] = function() {
  10100. var e = Array.prototype.slice.call(arguments);
  10101. return t.apply(n, e),
  10102. i.apply(r, e)
  10103. }
  10104. }),
  10105. m.addClass(i, "has-slider"),
  10106. n.domElement.insertBefore(r.domElement, n.domElement.firstElementChild)
  10107. } else if (n instanceof p) {
  10108. var e = function(e) {
  10109. return v.isNumber(n.__min) && v.isNumber(n.__max) ? (n.remove(),
  10110. y(t, n.object, n.property, {
  10111. before: n.__li.nextElementSibling,
  10112. factoryArgs: [n.__min, n.__max, n.__step]
  10113. })) : e
  10114. };
  10115. n.min = v.compose(e, n.min),
  10116. n.max = v.compose(e, n.max)
  10117. } else
  10118. n instanceof u ? (m.bind(i, "click", function() {
  10119. m.fakeEvent(n.__checkbox, "click")
  10120. }),
  10121. m.bind(n.__checkbox, "click", function(e) {
  10122. e.stopPropagation()
  10123. })) : n instanceof d ? (m.bind(i, "click", function() {
  10124. m.fakeEvent(n.__button, "click")
  10125. }),
  10126. m.bind(i, "mouseover", function() {
  10127. m.addClass(n.__button, "hover")
  10128. }),
  10129. m.bind(i, "mouseout", function() {
  10130. m.removeClass(n.__button, "hover")
  10131. })) : n instanceof g && (m.addClass(i, "color"),
  10132. n.updateDisplay = v.compose(function(e) {
  10133. return i.style.borderLeftColor = n.__color.toString(),
  10134. e
  10135. }, n.updateDisplay),
  10136. n.updateDisplay());
  10137. n.setValue = v.compose(function(e) {
  10138. return t.getRoot().__preset_select && n.isModified() && _(t.getRoot(), !0),
  10139. e
  10140. }, n.setValue)
  10141. }(e, l, r),
  10142. e.__controllers.push(r),
  10143. r
  10144. }
  10145. function A(e, t, i) {
  10146. var n = document.createElement("li");
  10147. return t && n.appendChild(t),
  10148. i ? e.__ul.insertBefore(n, params.before) : e.__ul.appendChild(n),
  10149. e.onResize(),
  10150. n
  10151. }
  10152. function C(e, t) {
  10153. var i = e.getRoot()
  10154. , n = i.__rememberedObjects.indexOf(t.object);
  10155. if (-1 != n) {
  10156. var r = i.__rememberedObjectIndecesToControllers[n];
  10157. if (void 0 === r && (r = {},
  10158. i.__rememberedObjectIndecesToControllers[n] = r),
  10159. r[t.property] = t,
  10160. i.load && i.load.remembered) {
  10161. var o, a = i.load.remembered;
  10162. if (a[e.preset])
  10163. o = a[e.preset];
  10164. else {
  10165. if (!a[T])
  10166. return;
  10167. o = a[T]
  10168. }
  10169. if (o[n] && void 0 !== o[n][t.property]) {
  10170. var s = o[n][t.property];
  10171. t.initialValue = s,
  10172. t.setValue(s)
  10173. }
  10174. }
  10175. }
  10176. }
  10177. function I(e, t) {
  10178. return document.location.href + "." + t
  10179. }
  10180. function l(e, t) {
  10181. e.domElement.style.width = t + "px",
  10182. e.__save_row && e.autoPlace && (e.__save_row.style.width = t + "px"),
  10183. e.__closeButton && (e.__closeButton.style.width = t + "px")
  10184. }
  10185. function a(r, o) {
  10186. var a = {};
  10187. return v.each(r.__rememberedObjects, function(e, t) {
  10188. var i = {}
  10189. , n = r.__rememberedObjectIndecesToControllers[t];
  10190. v.each(n, function(e, t) {
  10191. i[t] = o ? e.initialValue : e.getValue()
  10192. }),
  10193. a[t] = i
  10194. }),
  10195. a
  10196. }
  10197. function E(e, t, i) {
  10198. var n = document.createElement("option");
  10199. n.innerHTML = t,
  10200. n.value = t,
  10201. e.__preset_select.appendChild(n),
  10202. i && (e.__preset_select.selectedIndex = e.__preset_select.length - 1)
  10203. }
  10204. function _(e, t) {
  10205. var i = e.__preset_select[e.__preset_select.selectedIndex];
  10206. i.innerHTML = t ? i.value + "*" : i.value
  10207. }
  10208. 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");
  10209. var b, w, T = "Default", x = function() {
  10210. try {
  10211. return "localStorage"in window && null !== window.localStorage
  10212. } catch (e) {
  10213. return !1
  10214. }
  10215. }(), S = !0, s = !1, M = [], R = function(t) {
  10216. var i = this;
  10217. this.domElement = document.createElement("div"),
  10218. this.__ul = document.createElement("ul"),
  10219. this.domElement.appendChild(this.__ul),
  10220. m.addClass(this.domElement, "dg"),
  10221. this.__folders = {},
  10222. this.__controllers = [],
  10223. this.__rememberedObjects = [],
  10224. this.__rememberedObjectIndecesToControllers = [],
  10225. this.__listening = [],
  10226. t = t || {},
  10227. t = v.defaults(t, {
  10228. autoPlace: !0,
  10229. width: R.DEFAULT_WIDTH
  10230. }),
  10231. t = v.defaults(t, {
  10232. resizable: t.autoPlace,
  10233. hideable: t.autoPlace
  10234. }),
  10235. v.isUndefined(t.load) ? t.load = {
  10236. preset: T
  10237. } : t.preset && (t.load.preset = t.preset),
  10238. v.isUndefined(t.parent) && t.hideable && M.push(this),
  10239. t.resizable = v.isUndefined(t.parent) && t.resizable,
  10240. t.autoPlace && v.isUndefined(t.scrollable) && (t.scrollable = !0);
  10241. var n, e, r = x && "true" === localStorage.getItem(I(0, "isLocal"));
  10242. if (Object.defineProperties(this, {
  10243. parent: {
  10244. get: function() {
  10245. return t.parent
  10246. }
  10247. },
  10248. scrollable: {
  10249. get: function() {
  10250. return t.scrollable
  10251. }
  10252. },
  10253. autoPlace: {
  10254. get: function() {
  10255. return t.autoPlace
  10256. }
  10257. },
  10258. preset: {
  10259. get: function() {
  10260. return i.parent ? i.getRoot().preset : t.load.preset
  10261. },
  10262. set: function(e) {
  10263. i.parent ? i.getRoot().preset = e : t.load.preset = e,
  10264. function(e) {
  10265. for (var t = 0; t < e.__preset_select.length; t++)
  10266. e.__preset_select[t].value == e.preset && (e.__preset_select.selectedIndex = t)
  10267. }(this),
  10268. i.revert()
  10269. }
  10270. },
  10271. width: {
  10272. get: function() {
  10273. return t.width
  10274. },
  10275. set: function(e) {
  10276. t.width = e,
  10277. l(i, e)
  10278. }
  10279. },
  10280. name: {
  10281. get: function() {
  10282. return t.name
  10283. },
  10284. set: function(e) {
  10285. t.name = e,
  10286. a && (a.innerHTML = t.name)
  10287. }
  10288. },
  10289. closed: {
  10290. get: function() {
  10291. return t.closed
  10292. },
  10293. set: function(e) {
  10294. t.closed = e,
  10295. t.closed ? m.addClass(i.__ul, R.CLASS_CLOSED) : m.removeClass(i.__ul, R.CLASS_CLOSED),
  10296. this.onResize(),
  10297. i.__closeButton && (i.__closeButton.innerHTML = e ? R.TEXT_OPEN : R.TEXT_CLOSED)
  10298. }
  10299. },
  10300. load: {
  10301. get: function() {
  10302. return t.load
  10303. }
  10304. },
  10305. useLocalStorage: {
  10306. get: function() {
  10307. return r
  10308. },
  10309. set: function(e) {
  10310. x && ((r = e) ? m.bind(window, "unload", n) : m.unbind(window, "unload", n),
  10311. localStorage.setItem(I(0, "isLocal"), e))
  10312. }
  10313. }
  10314. }),
  10315. v.isUndefined(t.parent)) {
  10316. if (t.closed = !1,
  10317. m.addClass(this.domElement, R.CLASS_MAIN),
  10318. m.makeSelectable(this.domElement, !1),
  10319. x && r) {
  10320. i.useLocalStorage = !0;
  10321. var o = localStorage.getItem(I(0, "gui"));
  10322. o && (t.load = JSON.parse(o))
  10323. }
  10324. this.__closeButton = document.createElement("div"),
  10325. this.__closeButton.innerHTML = R.TEXT_CLOSED,
  10326. m.addClass(this.__closeButton, R.CLASS_CLOSE_BUTTON),
  10327. this.domElement.appendChild(this.__closeButton),
  10328. m.bind(this.__closeButton, "click", function() {
  10329. i.closed = !i.closed
  10330. })
  10331. } else {
  10332. void 0 === t.closed && (t.closed = !0);
  10333. var a = document.createTextNode(t.name);
  10334. m.addClass(a, "controller-name");
  10335. var s = A(i, a);
  10336. m.addClass(this.__ul, R.CLASS_CLOSED),
  10337. m.addClass(s, "title"),
  10338. m.bind(s, "click", function(e) {
  10339. return e.preventDefault(),
  10340. i.closed = !i.closed,
  10341. !1
  10342. }),
  10343. t.closed || (this.closed = !1)
  10344. }
  10345. t.autoPlace && (v.isUndefined(t.parent) && (S && (w = document.createElement("div"),
  10346. m.addClass(w, "dg"),
  10347. m.addClass(w, R.CLASS_AUTO_PLACE_CONTAINER),
  10348. document.body.appendChild(w),
  10349. S = !1),
  10350. w.appendChild(this.domElement),
  10351. m.addClass(this.domElement, R.CLASS_AUTO_PLACE)),
  10352. this.parent || l(i, t.width)),
  10353. m.bind(window, "resize", function() {
  10354. i.onResize()
  10355. }),
  10356. m.bind(this.__ul, "webkitTransitionEnd", function() {
  10357. i.onResize()
  10358. }),
  10359. m.bind(this.__ul, "transitionend", function() {
  10360. i.onResize()
  10361. }),
  10362. m.bind(this.__ul, "oTransitionEnd", function() {
  10363. i.onResize()
  10364. }),
  10365. this.onResize(),
  10366. t.resizable && function(t) {
  10367. function e(e) {
  10368. return e.preventDefault(),
  10369. r = e.clientX,
  10370. m.addClass(t.__closeButton, R.CLASS_DRAG),
  10371. m.bind(window, "mousemove", i),
  10372. m.bind(window, "mouseup", n),
  10373. !1
  10374. }
  10375. function i(e) {
  10376. return e.preventDefault(),
  10377. t.width += r - e.clientX,
  10378. t.onResize(),
  10379. r = e.clientX,
  10380. !1
  10381. }
  10382. function n() {
  10383. m.removeClass(t.__closeButton, R.CLASS_DRAG),
  10384. m.unbind(window, "mousemove", i),
  10385. m.unbind(window, "mouseup", n)
  10386. }
  10387. var r;
  10388. t.__resize_handle = document.createElement("div"),
  10389. v.extend(t.__resize_handle.style, {
  10390. width: "6px",
  10391. marginLeft: "-3px",
  10392. height: "200px",
  10393. cursor: "ew-resize",
  10394. position: "absolute"
  10395. }),
  10396. m.bind(t.__resize_handle, "mousedown", e),
  10397. m.bind(t.__closeButton, "mousedown", e),
  10398. t.domElement.insertBefore(t.__resize_handle, t.domElement.firstElementChild)
  10399. }(this),
  10400. n = function() {
  10401. x && "true" === localStorage.getItem(I(0, "isLocal")) && localStorage.setItem(I(0, "gui"), JSON.stringify(i.getSaveObject()))
  10402. }
  10403. ,
  10404. this.saveToLocalStorageIfPossible = n,
  10405. i.getRoot(),
  10406. t.parent || ((e = i.getRoot()).width += 1,
  10407. v.defer(function() {
  10408. e.width -= 1
  10409. }))
  10410. };
  10411. return R.toggleHide = function() {
  10412. s = !s,
  10413. v.each(M, function(e) {
  10414. e.domElement.style.zIndex = s ? -999 : 999,
  10415. e.domElement.style.opacity = s ? 0 : 1
  10416. })
  10417. }
  10418. ,
  10419. R.CLASS_AUTO_PLACE = "a",
  10420. R.CLASS_AUTO_PLACE_CONTAINER = "ac",
  10421. R.CLASS_MAIN = "main",
  10422. R.CLASS_CONTROLLER_ROW = "cr",
  10423. R.CLASS_TOO_TALL = "taller-than-window",
  10424. R.CLASS_CLOSED = "closed",
  10425. R.CLASS_CLOSE_BUTTON = "close-button",
  10426. R.CLASS_DRAG = "drag",
  10427. R.DEFAULT_WIDTH = 245,
  10428. R.TEXT_CLOSED = "Close Controls",
  10429. R.TEXT_OPEN = "Open Controls",
  10430. m.bind(window, "keydown", function(e) {
  10431. "text" === document.activeElement.type || 72 !== e.which && 72 != e.keyCode || R.toggleHide()
  10432. }, !1),
  10433. v.extend(R.prototype, {
  10434. add: function(e, t) {
  10435. return y(this, e, t, {
  10436. factoryArgs: Array.prototype.slice.call(arguments, 2)
  10437. })
  10438. },
  10439. addColor: function(e, t) {
  10440. return y(this, e, t, {
  10441. color: !0
  10442. })
  10443. },
  10444. remove: function(e) {
  10445. this.__ul.removeChild(e.__li),
  10446. this.__controllers.slice(this.__controllers.indexOf(e), 1);
  10447. var t = this;
  10448. v.defer(function() {
  10449. t.onResize()
  10450. })
  10451. },
  10452. destroy: function() {
  10453. this.autoPlace && w.removeChild(this.domElement)
  10454. },
  10455. addFolder: function(e) {
  10456. if (void 0 !== this.__folders[e])
  10457. throw new Error('You already have a folder in this GUI by the name "' + e + '"');
  10458. var t = {
  10459. name: e,
  10460. parent: this
  10461. };
  10462. t.autoPlace = this.autoPlace,
  10463. this.load && this.load.folders && this.load.folders[e] && (t.closed = this.load.folders[e].closed,
  10464. t.load = this.load.folders[e]);
  10465. var i = new R(t);
  10466. this.__folders[e] = i;
  10467. var n = A(this, i.domElement);
  10468. return m.addClass(n, "folder"),
  10469. i
  10470. },
  10471. open: function() {
  10472. this.closed = !1
  10473. },
  10474. close: function() {
  10475. this.closed = !0
  10476. },
  10477. onResize: function() {
  10478. var t = this.getRoot();
  10479. if (t.scrollable) {
  10480. var e = m.getOffset(t.__ul).top
  10481. , i = 0;
  10482. v.each(t.__ul.childNodes, function(e) {
  10483. t.autoPlace && e === t.__save_row || (i += m.getHeight(e))
  10484. }),
  10485. $("#player").height() - e - 20 < i ? (m.addClass(t.domElement, R.CLASS_TOO_TALL),
  10486. t.__ul.style.height = $("#player").height() - e - 20 + "px") : (m.removeClass(t.domElement, R.CLASS_TOO_TALL),
  10487. t.__ul.style.height = "auto")
  10488. }
  10489. t.__resize_handle && v.defer(function() {
  10490. t.__resize_handle.style.height = t.__ul.offsetHeight + "px"
  10491. }),
  10492. t.__closeButton && (t.__closeButton.style.width = t.width + "px")
  10493. },
  10494. remember: function() {
  10495. 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>'),
  10496. this.parent)
  10497. throw new Error("You can only call remember on a top level GUI.");
  10498. var t = this;
  10499. v.each(Array.prototype.slice.call(arguments), function(e) {
  10500. 0 == t.__rememberedObjects.length && function(i) {
  10501. var e = i.__save_row = document.createElement("li");
  10502. m.addClass(i.domElement, "has-save"),
  10503. i.__ul.insertBefore(e, i.__ul.firstChild),
  10504. m.addClass(e, "save-row");
  10505. var t = document.createElement("span");
  10506. t.innerHTML = "&nbsp;",
  10507. m.addClass(t, "button gears");
  10508. var n = document.createElement("span");
  10509. n.innerHTML = "Save",
  10510. m.addClass(n, "button"),
  10511. m.addClass(n, "save");
  10512. var r = document.createElement("span");
  10513. r.innerHTML = "New",
  10514. m.addClass(r, "button"),
  10515. m.addClass(r, "save-as");
  10516. var o = document.createElement("span");
  10517. o.innerHTML = "Revert",
  10518. m.addClass(o, "button"),
  10519. m.addClass(o, "revert");
  10520. var a = i.__preset_select = document.createElement("select");
  10521. if (i.load && i.load.remembered ? v.each(i.load.remembered, function(e, t) {
  10522. E(i, t, t == i.preset)
  10523. }) : E(i, T, !1),
  10524. m.bind(a, "change", function() {
  10525. for (var e = 0; e < i.__preset_select.length; e++)
  10526. i.__preset_select[e].innerHTML = i.__preset_select[e].value;
  10527. i.preset = this.value
  10528. }),
  10529. e.appendChild(a),
  10530. e.appendChild(t),
  10531. e.appendChild(n),
  10532. e.appendChild(r),
  10533. e.appendChild(o),
  10534. x) {
  10535. var s = document.getElementById("dg-save-locally")
  10536. , l = document.getElementById("dg-local-explain");
  10537. s.style.display = "block";
  10538. var c = document.getElementById("dg-local-storage");
  10539. "true" === localStorage.getItem(I(0, "isLocal")) && c.setAttribute("checked", "checked");
  10540. var h = function() {
  10541. l.style.display = i.useLocalStorage ? "block" : "none"
  10542. };
  10543. h(),
  10544. m.bind(c, "change", function() {
  10545. i.useLocalStorage = !i.useLocalStorage,
  10546. h()
  10547. })
  10548. }
  10549. var u = document.getElementById("dg-new-constructor");
  10550. m.bind(u, "keydown", function(e) {
  10551. !e.metaKey || 67 !== e.which && 67 != e.keyCode || b.hide()
  10552. }),
  10553. m.bind(t, "click", function() {
  10554. u.innerHTML = JSON.stringify(i.getSaveObject(), void 0, 2),
  10555. b.show(),
  10556. u.focus(),
  10557. u.select()
  10558. }),
  10559. m.bind(n, "click", function() {
  10560. i.save()
  10561. }),
  10562. m.bind(r, "click", function() {
  10563. var e = prompt("Enter a new preset name.");
  10564. e && i.saveAs(e)
  10565. }),
  10566. m.bind(o, "click", function() {
  10567. i.revert()
  10568. })
  10569. }(t),
  10570. -1 == t.__rememberedObjects.indexOf(e) && t.__rememberedObjects.push(e)
  10571. }),
  10572. this.autoPlace && l(this, this.width)
  10573. },
  10574. getRoot: function() {
  10575. for (var e = this; e.parent; )
  10576. e = e.parent;
  10577. return e
  10578. },
  10579. getSaveObject: function() {
  10580. var i = this.load;
  10581. return i.closed = this.closed,
  10582. 0 < this.__rememberedObjects.length && (i.preset = this.preset,
  10583. i.remembered || (i.remembered = {}),
  10584. i.remembered[this.preset] = a(this)),
  10585. i.folders = {},
  10586. v.each(this.__folders, function(e, t) {
  10587. i.folders[t] = e.getSaveObject()
  10588. }),
  10589. i
  10590. },
  10591. save: function() {
  10592. this.load.remembered || (this.load.remembered = {}),
  10593. this.load.remembered[this.preset] = a(this),
  10594. _(this, !1),
  10595. this.saveToLocalStorageIfPossible()
  10596. },
  10597. saveAs: function(e) {
  10598. this.load.remembered || (this.load.remembered = {},
  10599. this.load.remembered[T] = a(this, !0)),
  10600. this.load.remembered[e] = a(this),
  10601. this.preset = e,
  10602. E(this, e, !0),
  10603. this.saveToLocalStorageIfPossible()
  10604. },
  10605. revert: function(t) {
  10606. v.each(this.__controllers, function(e) {
  10607. this.getRoot().load.remembered ? C(t || this.getRoot(), e) : e.setValue(e.initialValue)
  10608. }, this),
  10609. v.each(this.__folders, function(e) {
  10610. e.revert(e)
  10611. }),
  10612. t || _(this.getRoot(), !1)
  10613. },
  10614. listen: function(e) {
  10615. var t = 0 == this.__listening.length;
  10616. this.__listening.push(e),
  10617. t && function e(t) {
  10618. 0 != t.length && r(function() {
  10619. e(t)
  10620. }),
  10621. v.each(t, function(e) {
  10622. e.updateDisplay()
  10623. })
  10624. }(this.__listening)
  10625. }
  10626. }),
  10627. R
  10628. }(ee.utils.css, 0, 0, ee.controllers.factory = (h = ee.controllers.OptionController,
  10629. u = ee.controllers.NumberControllerBox,
  10630. d = ee.controllers.NumberControllerSlider,
  10631. p = ee.controllers.StringController = (v = ee.controllers.Controller,
  10632. y = ee.dom.dom,
  10633. A = ee.utils.common,
  10634. (C = function(e, t) {
  10635. function i() {
  10636. n.setValue(n.__input.value)
  10637. }
  10638. C.superclass.call(this, e, t);
  10639. var n = this;
  10640. this.__input = document.createElement("input"),
  10641. this.__input.setAttribute("type", "text"),
  10642. y.bind(this.__input, "keyup", i),
  10643. y.bind(this.__input, "change", i),
  10644. y.bind(this.__input, "blur", function() {
  10645. n.__onFinishChange && n.__onFinishChange.call(n, n.getValue())
  10646. }),
  10647. y.bind(this.__input, "keydown", function(e) {
  10648. 13 === e.keyCode && this.blur()
  10649. }),
  10650. this.updateDisplay(),
  10651. this.domElement.appendChild(this.__input)
  10652. }
  10653. ).superclass = v,
  10654. A.extend(C.prototype, v.prototype, {
  10655. updateDisplay: function() {
  10656. return y.isActive(this.__input) || (this.__input.value = this.getValue()),
  10657. C.superclass.prototype.updateDisplay.call(this)
  10658. }
  10659. }),
  10660. C),
  10661. f = ee.controllers.FunctionController,
  10662. g = ee.controllers.BooleanController,
  10663. m = ee.utils.common,
  10664. function(e, t) {
  10665. var i = e[t];
  10666. 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,{
  10667. min: arguments[2],
  10668. max: arguments[3]
  10669. }) : m.isString(i) ? new p(e,t) : m.isFunction(i) ? new f(e,t,"") : m.isBoolean(i) ? new g(e,t) : void 0
  10670. }
  10671. ), 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) {
  10672. function f(t, i, n, r) {
  10673. t.style.background = "",
  10674. p.each(o, function(e) {
  10675. t.style.cssText += "background: " + e + "linear-gradient(" + i + ", " + n + " 0%, " + r + " 100%); "
  10676. })
  10677. }
  10678. var g = function(e, t) {
  10679. function i(e) {
  10680. a(e),
  10681. h.bind(window, "mousemove", a),
  10682. h.bind(window, "mouseup", n)
  10683. }
  10684. function n() {
  10685. h.unbind(window, "mousemove", a),
  10686. h.unbind(window, "mouseup", n)
  10687. }
  10688. function r() {
  10689. var e = d(this.value);
  10690. !1 !== e ? (l.__color.__state = e,
  10691. l.setValue(l.__color.toOriginal())) : this.value = l.__color.toString()
  10692. }
  10693. function o() {
  10694. h.unbind(window, "mousemove", s),
  10695. h.unbind(window, "mouseup", o)
  10696. }
  10697. function a(e) {
  10698. e.preventDefault();
  10699. var t = h.getWidth(l.__saturation_field)
  10700. , i = h.getOffset(l.__saturation_field)
  10701. , n = (e.clientX - i.left + document.body.scrollLeft) / t
  10702. , r = 1 - (e.clientY - i.top + document.body.scrollTop) / t;
  10703. return 1 < r ? r = 1 : r < 0 && (r = 0),
  10704. 1 < n ? n = 1 : n < 0 && (n = 0),
  10705. l.__color.v = r,
  10706. l.__color.s = n,
  10707. l.setValue(l.__color.toOriginal()),
  10708. !1
  10709. }
  10710. function s(e) {
  10711. e.preventDefault();
  10712. var t = h.getHeight(l.__hue_field)
  10713. , i = h.getOffset(l.__hue_field)
  10714. , n = 1 - (e.clientY - i.top + document.body.scrollTop) / t;
  10715. return 1 < n ? n = 1 : n < 0 && (n = 0),
  10716. l.__color.h = 360 * n,
  10717. l.setValue(l.__color.toOriginal()),
  10718. !1
  10719. }
  10720. g.superclass.call(this, e, t),
  10721. this.__color = new u(this.getValue()),
  10722. this.__temp = new u(0);
  10723. var l = this;
  10724. this.domElement = document.createElement("div"),
  10725. h.makeSelectable(this.domElement, !1),
  10726. this.__selector = document.createElement("div"),
  10727. this.__selector.className = "selector",
  10728. this.__saturation_field = document.createElement("div"),
  10729. this.__saturation_field.className = "saturation-field",
  10730. this.__field_knob = document.createElement("div"),
  10731. this.__field_knob.className = "field-knob",
  10732. this.__field_knob_border = "2px solid ",
  10733. this.__hue_knob = document.createElement("div"),
  10734. this.__hue_knob.className = "hue-knob",
  10735. this.__hue_field = document.createElement("div"),
  10736. this.__hue_field.className = "hue-field",
  10737. this.__input = document.createElement("input"),
  10738. this.__input.type = "text",
  10739. this.__input_textShadow = "0 1px 1px ",
  10740. h.bind(this.__input, "keydown", function(e) {
  10741. 13 === e.keyCode && r.call(this)
  10742. }),
  10743. h.bind(this.__input, "blur", r),
  10744. h.bind(this.__selector, "mousedown", function(e) {
  10745. h.addClass(this, "drag").bind(window, "mouseup", function(e) {
  10746. h.removeClass(l.__selector, "drag")
  10747. })
  10748. });
  10749. var c = document.createElement("div");
  10750. p.extend(this.__selector.style, {
  10751. width: "122px",
  10752. height: "102px",
  10753. padding: "3px",
  10754. backgroundColor: "#222",
  10755. boxShadow: "0px 1px 3px rgba(0,0,0,0.3)"
  10756. }),
  10757. p.extend(this.__field_knob.style, {
  10758. position: "absolute",
  10759. width: "12px",
  10760. height: "12px",
  10761. border: this.__field_knob_border + (this.__color.v < .5 ? "#fff" : "#000"),
  10762. boxShadow: "0px 1px 3px rgba(0,0,0,0.5)",
  10763. borderRadius: "12px",
  10764. zIndex: 1
  10765. }),
  10766. p.extend(this.__hue_knob.style, {
  10767. position: "absolute",
  10768. width: "15px",
  10769. height: "2px",
  10770. borderRight: "4px solid #fff",
  10771. zIndex: 1
  10772. }),
  10773. p.extend(this.__saturation_field.style, {
  10774. width: "100px",
  10775. height: "100px",
  10776. border: "1px solid #555",
  10777. marginRight: "3px",
  10778. display: "inline-block",
  10779. cursor: "pointer"
  10780. }),
  10781. p.extend(c.style, {
  10782. width: "100%",
  10783. height: "100%",
  10784. background: "none"
  10785. }),
  10786. f(c, "top", "rgba(0,0,0,0)", "#000"),
  10787. p.extend(this.__hue_field.style, {
  10788. width: "15px",
  10789. height: "100px",
  10790. display: "inline-block",
  10791. border: "1px solid #555",
  10792. cursor: "ns-resize"
  10793. }),
  10794. function(e) {
  10795. e.style.background = "",
  10796. e.style.cssText += "background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",
  10797. e.style.cssText += "background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  10798. e.style.cssText += "background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  10799. e.style.cssText += "background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  10800. e.style.cssText += "background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"
  10801. }(this.__hue_field),
  10802. p.extend(this.__input.style, {
  10803. outline: "none",
  10804. textAlign: "center",
  10805. color: "#fff",
  10806. border: 0,
  10807. fontWeight: "bold",
  10808. textShadow: this.__input_textShadow + "rgba(0,0,0,0.7)"
  10809. }),
  10810. h.bind(this.__saturation_field, "mousedown", i),
  10811. h.bind(this.__field_knob, "mousedown", i),
  10812. h.bind(this.__hue_field, "mousedown", function(e) {
  10813. s(e),
  10814. h.bind(window, "mousemove", s),
  10815. h.bind(window, "mouseup", o)
  10816. }),
  10817. this.__saturation_field.appendChild(c),
  10818. this.__selector.appendChild(this.__field_knob),
  10819. this.__selector.appendChild(this.__saturation_field),
  10820. this.__selector.appendChild(this.__hue_field),
  10821. this.__hue_field.appendChild(this.__hue_knob),
  10822. this.domElement.appendChild(this.__input),
  10823. this.domElement.appendChild(this.__selector),
  10824. this.updateDisplay()
  10825. };
  10826. g.superclass = e,
  10827. p.extend(g.prototype, e.prototype, {
  10828. updateDisplay: function() {
  10829. var t = d(this.getValue());
  10830. if (!1 !== t) {
  10831. var i = !1;
  10832. p.each(u.COMPONENTS, function(e) {
  10833. if (!p.isUndefined(t[e]) && !p.isUndefined(this.__color.__state[e]) && t[e] !== this.__color.__state[e])
  10834. return i = !0,
  10835. {}
  10836. }, this),
  10837. i && p.extend(this.__color.__state, t)
  10838. }
  10839. p.extend(this.__temp.__state, this.__color.__state),
  10840. this.__temp.a = 1;
  10841. var e = this.__color.v < .5 || .5 < this.__color.s ? 255 : 0
  10842. , n = 255 - e;
  10843. p.extend(this.__field_knob.style, {
  10844. marginLeft: 100 * this.__color.s - 7 + "px",
  10845. marginTop: 100 * (1 - this.__color.v) - 7 + "px",
  10846. backgroundColor: this.__temp.toString(),
  10847. border: this.__field_knob_border + "rgb(" + e + "," + e + "," + e + ")"
  10848. }),
  10849. this.__hue_knob.style.marginTop = 100 * (1 - this.__color.h / 360) + "px",
  10850. this.__temp.s = 1,
  10851. this.__temp.v = 1,
  10852. f(this.__saturation_field, "left", "#fff", this.__temp.toString()),
  10853. p.extend(this.__input.style, {
  10854. backgroundColor: this.__input.value = this.__color.toString(),
  10855. color: "rgb(" + e + "," + e + "," + e + ")",
  10856. textShadow: this.__input_textShadow + "rgba(" + n + "," + n + "," + n + ",.7)"
  10857. })
  10858. }
  10859. });
  10860. var o = ["-moz-", "-o-", "-webkit-", "-ms-", ""];
  10861. return g
  10862. }(ee.controllers.Controller, ee.dom.dom, ee.color.Color = (o = ee.color.interpret,
  10863. a = ee.color.math = {
  10864. hsv_to_rgb: function(e, t, i) {
  10865. var n = Math.floor(e / 60) % 6
  10866. , r = e / 60 - Math.floor(e / 60)
  10867. , o = i * (1 - t)
  10868. , a = i * (1 - r * t)
  10869. , s = i * (1 - (1 - r) * t)
  10870. , l = [[i, s, o], [a, i, o], [o, i, s], [o, a, i], [s, o, i], [i, o, a]][n];
  10871. return {
  10872. r: 255 * l[0],
  10873. g: 255 * l[1],
  10874. b: 255 * l[2]
  10875. }
  10876. },
  10877. rgb_to_hsv: function(e, t, i) {
  10878. var n, r = Math.min(e, t, i), o = Math.max(e, t, i), a = o - r;
  10879. return 0 == o ? {
  10880. h: NaN,
  10881. s: 0,
  10882. v: 0
  10883. } : (n = e == o ? (t - i) / a : t == o ? 2 + (i - e) / a : 4 + (e - t) / a,
  10884. (n /= 6) < 0 && (n += 1),
  10885. {
  10886. h: 360 * n,
  10887. s: a / o,
  10888. v: o / 255
  10889. })
  10890. },
  10891. rgb_to_hex: function(e, t, i) {
  10892. var n = this.hex_with_component(0, 2, e);
  10893. return n = this.hex_with_component(n, 1, t),
  10894. this.hex_with_component(n, 0, i)
  10895. },
  10896. component_from_hex: function(e, t) {
  10897. return e >> 8 * t & 255
  10898. },
  10899. hex_with_component: function(e, t, i) {
  10900. return i << (c = 8 * t) | e & ~(255 << c)
  10901. }
  10902. },
  10903. s = ee.color.toString,
  10904. l = ee.utils.common,
  10905. ae.COMPONENTS = ["r", "g", "b", "h", "s", "v", "hex", "a"],
  10906. l.extend(ae.prototype, {
  10907. toString: function() {
  10908. return s(this)
  10909. },
  10910. toOriginal: function() {
  10911. return this.__state.conversion.write(this)
  10912. }
  10913. }),
  10914. ie(ae.prototype, "r", 2),
  10915. ie(ae.prototype, "g", 1),
  10916. ie(ae.prototype, "b", 0),
  10917. ne(ae.prototype, "h"),
  10918. ne(ae.prototype, "s"),
  10919. ne(ae.prototype, "v"),
  10920. Object.defineProperty(ae.prototype, "a", {
  10921. get: function() {
  10922. return this.__state.a
  10923. },
  10924. set: function(e) {
  10925. this.__state.a = e
  10926. }
  10927. }),
  10928. Object.defineProperty(ae.prototype, "hex", {
  10929. get: function() {
  10930. return "HEX" !== !this.__state.space && (this.__state.hex = a.rgb_to_hex(this.r, this.g, this.b)),
  10931. this.__state.hex
  10932. },
  10933. set: function(e) {
  10934. this.__state.space = "HEX",
  10935. this.__state.hex = e
  10936. }
  10937. }),
  10938. ae), ee.color.interpret, ee.utils.common), ee.utils.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(e, t) {
  10939. window.setTimeout(e, 1e3 / 60)
  10940. }
  10941. , ee.dom.CenteredDiv = (n = ee.dom.dom,
  10942. r = ee.utils.common,
  10943. te.prototype.show = function() {
  10944. var e = this;
  10945. this.backgroundElement.style.display = "block",
  10946. this.domElement.style.display = "block",
  10947. this.domElement.style.opacity = 0,
  10948. this.domElement.style.webkitTransform = "scale(1.1)",
  10949. this.layout(),
  10950. r.defer(function() {
  10951. e.backgroundElement.style.opacity = 1,
  10952. e.domElement.style.opacity = 1,
  10953. e.domElement.style.webkitTransform = "scale(1)"
  10954. })
  10955. }
  10956. ,
  10957. te.prototype.hide = function() {
  10958. var e = this
  10959. , t = function() {
  10960. e.domElement.style.display = "none",
  10961. e.backgroundElement.style.display = "none",
  10962. n.unbind(e.domElement, "webkitTransitionEnd", t),
  10963. n.unbind(e.domElement, "transitionend", t),
  10964. n.unbind(e.domElement, "oTransitionEnd", t)
  10965. };
  10966. n.bind(this.domElement, "webkitTransitionEnd", t),
  10967. n.bind(this.domElement, "transitionend", t),
  10968. n.bind(this.domElement, "oTransitionEnd", t),
  10969. this.backgroundElement.style.opacity = 0,
  10970. this.domElement.style.opacity = 0,
  10971. this.domElement.style.webkitTransform = "scale(1.1)"
  10972. }
  10973. ,
  10974. te.prototype.layout = function() {
  10975. this.domElement.style.left = $("#player").width() / 2 - n.getWidth(this.domElement) / 2 + "px",
  10976. this.domElement.style.top = $("#player").height() / 2 - n.getHeight(this.domElement) / 2 + "px"
  10977. }
  10978. ,
  10979. te), ee.dom.dom, ee.utils.common)
  10980. }
  10981. , {}],
  10982. 94: [function(e, t, i) {
  10983. (function(J) {
  10984. "use strict";
  10985. function i(e) {
  10986. function t(e, t) {
  10987. for (var i = 0, n = 0, r = new Array, o = 1; o <= 16; o++) {
  10988. for (var a = 1; a <= e[o]; a++)
  10989. r[t[n]] = [],
  10990. r[t[n]][0] = i,
  10991. r[t[n]][1] = o,
  10992. n++,
  10993. i++;
  10994. i *= 2
  10995. }
  10996. return r
  10997. }
  10998. function _(e) {
  10999. for (var t = e[0], i = e[1] - 1; 0 <= i; )
  11000. t & 1 << i && (B |= 1 << V),
  11001. i--,
  11002. --V < 0 && (255 == B ? (b(255),
  11003. b(0)) : b(B),
  11004. V = 7,
  11005. B = 0)
  11006. }
  11007. function b(e) {
  11008. F.push(e)
  11009. }
  11010. function w(e) {
  11011. b(e >> 8 & 255),
  11012. b(255 & e)
  11013. }
  11014. function T(e, t, i, n, r) {
  11015. for (var o, a = r[0], s = r[240], l = function(e, t) {
  11016. var i, n, r, o, a, s, l, c, h, u, d = 0;
  11017. for (h = 0; h < 8; ++h) {
  11018. i = e[d],
  11019. n = e[d + 1],
  11020. r = e[d + 2],
  11021. o = e[d + 3],
  11022. a = e[d + 4],
  11023. s = e[d + 5],
  11024. l = e[d + 6];
  11025. var p = i + (c = e[d + 7])
  11026. , f = i - c
  11027. , g = n + l
  11028. , m = n - l
  11029. , v = r + s
  11030. , y = r - s
  11031. , A = o + a
  11032. , C = o - a
  11033. , I = p + A
  11034. , E = p - A
  11035. , _ = g + v
  11036. , b = g - v;
  11037. e[d] = I + _,
  11038. e[d + 4] = I - _;
  11039. var w = .707106781 * (b + E);
  11040. e[d + 2] = E + w,
  11041. e[d + 6] = E - w;
  11042. var T = .382683433 * ((I = C + y) - (b = m + f))
  11043. , x = .5411961 * I + T
  11044. , S = 1.306562965 * b + T
  11045. , M = .707106781 * (_ = y + m)
  11046. , R = f + M
  11047. , P = f - M;
  11048. e[d + 5] = P + x,
  11049. e[d + 3] = P - x,
  11050. e[d + 1] = R + S,
  11051. e[d + 7] = R - S,
  11052. d += 8
  11053. }
  11054. for (h = d = 0; h < 8; ++h) {
  11055. i = e[d],
  11056. n = e[d + 8],
  11057. r = e[d + 16],
  11058. o = e[d + 24],
  11059. a = e[d + 32],
  11060. s = e[d + 40],
  11061. l = e[d + 48];
  11062. var O = i + (c = e[d + 56])
  11063. , L = i - c
  11064. , D = n + l
  11065. , N = n - l
  11066. , F = r + s
  11067. , B = r - s
  11068. , V = o + a
  11069. , k = o - a
  11070. , U = O + V
  11071. , H = O - V
  11072. , z = D + F
  11073. , G = D - F;
  11074. e[d] = U + z,
  11075. e[d + 32] = U - z;
  11076. var W = .707106781 * (G + H);
  11077. e[d + 16] = H + W,
  11078. e[d + 48] = H - W;
  11079. var j = .382683433 * ((U = k + B) - (G = N + L))
  11080. , Y = .5411961 * U + j
  11081. , q = 1.306562965 * G + j
  11082. , X = .707106781 * (z = B + N)
  11083. , Z = L + X
  11084. , K = L - X;
  11085. e[d + 40] = K + Y,
  11086. e[d + 24] = K - Y,
  11087. e[d + 8] = Z + q,
  11088. e[d + 56] = Z - q,
  11089. d++
  11090. }
  11091. for (h = 0; h < 64; ++h)
  11092. u = e[h] * t[h],
  11093. Q[h] = 0 < u ? .5 + u | 0 : u - .5 | 0;
  11094. return Q
  11095. }(e, t), c = 0; c < 64; ++c)
  11096. A[C[c]] = l[c];
  11097. var h = A[0] - i;
  11098. i = A[0],
  11099. 0 == h ? _(n[0]) : (_(n[y[o = 32767 + h]]),
  11100. _(v[o]));
  11101. for (var u = 63; 0 < u && 0 == A[u]; u--)
  11102. ;
  11103. if (0 == u)
  11104. return _(a),
  11105. i;
  11106. for (var d, p = 1; p <= u; ) {
  11107. for (var f = p; 0 == A[p] && p <= u; ++p)
  11108. ;
  11109. var g = p - f;
  11110. if (16 <= g) {
  11111. d = g >> 4;
  11112. for (var m = 1; m <= d; ++m)
  11113. _(s);
  11114. g &= 15
  11115. }
  11116. o = 32767 + A[p],
  11117. _(r[(g << 4) + y[o]]),
  11118. _(v[o]),
  11119. p++
  11120. }
  11121. return 63 != u && _(a),
  11122. i
  11123. }
  11124. function x(e) {
  11125. if (e <= 0 && (e = 1),
  11126. 100 < e && (e = 100),
  11127. i != e) {
  11128. (function(e) {
  11129. 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++) {
  11130. var n = u((t[i] * e + 50) / 100);
  11131. n < 1 ? n = 1 : 255 < n && (n = 255),
  11132. O[C[i]] = n
  11133. }
  11134. 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++) {
  11135. var a = u((r[o] * e + 50) / 100);
  11136. a < 1 ? a = 1 : 255 < a && (a = 255),
  11137. L[C[o]] = a
  11138. }
  11139. for (var s = [1, 1.387039845, 1.306562965, 1.175875602, 1, .785694958, .5411961, .275899379], l = 0, c = 0; c < 8; c++)
  11140. for (var h = 0; h < 8; h++)
  11141. D[l] = 1 / (O[C[l]] * s[c] * s[h] * 8),
  11142. N[l] = 1 / (L[C[l]] * s[c] * s[h] * 8),
  11143. l++
  11144. }
  11145. )(e < 50 ? Math.floor(5e3 / e) : Math.floor(200 - 2 * e)),
  11146. i = e
  11147. }
  11148. }
  11149. var S, M, R, P, i, u = (Math.round,
  11150. 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];
  11151. this.encode = function(e, t) {
  11152. var i = ((new Date).getTime(),
  11153. t.quality);
  11154. i && x(i),
  11155. F = new Array,
  11156. B = 0,
  11157. V = 7,
  11158. w(65496),
  11159. w(65504),
  11160. w(16),
  11161. b(74),
  11162. b(70),
  11163. b(73),
  11164. b(70),
  11165. b(0),
  11166. b(1),
  11167. b(1),
  11168. b(0),
  11169. w(1),
  11170. w(1),
  11171. b(0),
  11172. b(0),
  11173. function() {
  11174. w(65499),
  11175. w(132),
  11176. b(0);
  11177. for (var e = 0; e < 64; e++)
  11178. b(O[e]);
  11179. b(1);
  11180. for (var t = 0; t < 64; t++)
  11181. b(L[t])
  11182. }(),
  11183. function(e, t) {
  11184. w(65472),
  11185. w(17),
  11186. b(8),
  11187. w(t),
  11188. w(e),
  11189. b(3),
  11190. b(1),
  11191. b(17),
  11192. b(0),
  11193. b(2),
  11194. b(17),
  11195. b(1),
  11196. b(3),
  11197. b(17),
  11198. b(1)
  11199. }(e.width, e.height),
  11200. function() {
  11201. w(65476),
  11202. w(418),
  11203. b(0);
  11204. for (var e = 0; e < 16; e++)
  11205. b(G[e + 1]);
  11206. for (var t = 0; t <= 11; t++)
  11207. b(W[t]);
  11208. b(16);
  11209. for (var i = 0; i < 16; i++)
  11210. b(j[i + 1]);
  11211. for (var n = 0; n <= 161; n++)
  11212. b(Y[n]);
  11213. b(1);
  11214. for (var r = 0; r < 16; r++)
  11215. b(q[r + 1]);
  11216. for (var o = 0; o <= 11; o++)
  11217. b(X[o]);
  11218. b(17);
  11219. for (var a = 0; a < 16; a++)
  11220. b(Z[a + 1]);
  11221. for (var s = 0; s <= 161; s++)
  11222. b(K[s])
  11223. }(),
  11224. w(65498),
  11225. w(12),
  11226. b(3),
  11227. b(1),
  11228. b(0),
  11229. b(2),
  11230. b(17),
  11231. b(3),
  11232. b(17),
  11233. b(0),
  11234. b(63),
  11235. b(0);
  11236. var n = 0
  11237. , r = 0
  11238. , o = 0;
  11239. B = 0,
  11240. V = 7,
  11241. this.encode.displayName = "_encode_";
  11242. 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; ) {
  11243. for (a = 0; a < A; ) {
  11244. for (u = h = A * C + a,
  11245. d = -1,
  11246. f = p = 0; f < 64; f++)
  11247. u = h + (p = (y ? 63 - f : f) >> 3) * A + (d = 4 * (7 & f)),
  11248. v <= C + p && (u -= A * (C + 1 + p - v)),
  11249. A <= a + d && (u -= a + d - A + 4),
  11250. s = g[u++],
  11251. l = g[u++],
  11252. c = g[u++],
  11253. k[f] = (z[s] + z[l + 256 >> 0] + z[c + 512 >> 0] >> 16) - 128,
  11254. U[f] = (z[s + 768 >> 0] + z[l + 1024 >> 0] + z[c + 1280 >> 0] >> 16) - 128,
  11255. H[f] = (z[s + 1280 >> 0] + z[l + 1536 >> 0] + z[c + 1792 >> 0] >> 16) - 128;
  11256. n = T(k, D, n, S, R),
  11257. r = T(U, N, r, M, P),
  11258. o = T(H, N, o, M, P),
  11259. a += 32
  11260. }
  11261. C += I
  11262. }
  11263. if (0 <= V) {
  11264. var E = [];
  11265. E[1] = V + 1,
  11266. E[0] = (1 << V + 1) - 1,
  11267. _(E)
  11268. }
  11269. return w(65497),
  11270. new J(F)
  11271. }
  11272. ,
  11273. (new Date).getTime(),
  11274. e = e || 50,
  11275. function() {
  11276. for (var e = String.fromCharCode, t = 0; t < 256; t++)
  11277. n[t] = e(t)
  11278. }(),
  11279. S = t(G, W),
  11280. M = t(q, X),
  11281. R = t(j, Y),
  11282. P = t(Z, K),
  11283. function() {
  11284. for (var e = 1, t = 2, i = 1; i <= 15; i++) {
  11285. for (var n = e; n < t; n++)
  11286. y[32767 + n] = i,
  11287. v[32767 + n] = [],
  11288. v[32767 + n][1] = i,
  11289. v[32767 + n][0] = n;
  11290. for (var r = -(t - 1); r <= -e; r++)
  11291. y[32767 + r] = i,
  11292. v[32767 + r] = [],
  11293. v[32767 + r][1] = i,
  11294. v[32767 + r][0] = t - 1 + r;
  11295. e <<= 1,
  11296. t <<= 1
  11297. }
  11298. }(),
  11299. function() {
  11300. for (var e = 0; e < 256; e++)
  11301. z[e] = 19595 * e,
  11302. z[e + 256 >> 0] = 38470 * e,
  11303. z[e + 512 >> 0] = 7471 * e + 32768,
  11304. z[e + 768 >> 0] = -11059 * e,
  11305. z[e + 1024 >> 0] = -21709 * e,
  11306. z[e + 1280 >> 0] = 32768 * e + 8421375,
  11307. z[e + 1536 >> 0] = -27439 * e,
  11308. z[e + 1792 >> 0] = -5329 * e
  11309. }(),
  11310. x(e),
  11311. (new Date).getTime()
  11312. }
  11313. t.exports.encode = function(e, t) {
  11314. return (t = t || {}).quality = t.quality || 50,
  11315. {
  11316. data: new i(t.quality).encode(e, t),
  11317. width: e.width,
  11318. height: e.height
  11319. }
  11320. }
  11321. }
  11322. ).call(this, e("buffer").Buffer)
  11323. }
  11324. , {
  11325. buffer: 198
  11326. }],
  11327. 95: [function(e, t, i) {
  11328. "use strict";
  11329. !function() {
  11330. if ("performance"in window == 0 && (window.performance = {}),
  11331. Date.now = Date.now || function() {
  11332. return (new Date).getTime()
  11333. }
  11334. ,
  11335. "now"in window.performance == 0) {
  11336. var e = Date.now();
  11337. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  11338. window.performance.now = function() {
  11339. return Date.now() - e
  11340. }
  11341. }
  11342. }()
  11343. }
  11344. , {}],
  11345. 96: [function(e, t, i) {
  11346. "use strict";
  11347. var a = e("three");
  11348. a.EffectComposer = function(e, t) {
  11349. if (this.renderer = e,
  11350. void 0 === t) {
  11351. var i = {
  11352. minFilter: a.LinearFilter,
  11353. magFilter: a.LinearFilter,
  11354. format: a.RGBAFormat,
  11355. stencilBuffer: !1
  11356. }
  11357. , n = e.getSize();
  11358. t = new a.WebGLRenderTarget(n.width,n.height,i)
  11359. }
  11360. this.renderTarget1 = t,
  11361. this.renderTarget2 = t.clone(),
  11362. this.writeBuffer = this.renderTarget1,
  11363. this.readBuffer = this.renderTarget2,
  11364. this.passes = [],
  11365. void 0 === a.CopyShader && console.error("THREE.EffectComposer relies on THREE.CopyShader"),
  11366. this.copyPass = new a.ShaderPass(a.CopyShader)
  11367. }
  11368. ,
  11369. a.EffectComposer.prototype = {
  11370. swapBuffers: function() {
  11371. var e = this.readBuffer;
  11372. this.readBuffer = this.writeBuffer,
  11373. this.writeBuffer = e
  11374. },
  11375. addPass: function(e) {
  11376. this.passes.push(e)
  11377. },
  11378. insertPass: function(e, t) {
  11379. this.passes.splice(t, 0, e)
  11380. },
  11381. render: function(e) {
  11382. this.writeBuffer = this.renderTarget1,
  11383. this.readBuffer = this.renderTarget2;
  11384. var t, i, n = !1, r = this.passes.length;
  11385. for (i = 0; i < r; i++)
  11386. if ((t = this.passes[i]).enabled) {
  11387. if (t.render(this.renderer, this.writeBuffer, this.readBuffer, e, n),
  11388. t.needsSwap) {
  11389. if (n) {
  11390. var o = this.renderer.context;
  11391. o.stencilFunc(o.NOTEQUAL, 1, 4294967295),
  11392. this.copyPass.render(this.renderer, this.writeBuffer, this.readBuffer, e),
  11393. o.stencilFunc(o.EQUAL, 1, 4294967295)
  11394. }
  11395. this.swapBuffers()
  11396. }
  11397. t instanceof a.MaskPass ? n = !0 : t instanceof a.ClearMaskPass && (n = !1)
  11398. }
  11399. },
  11400. reset: function(e) {
  11401. if (void 0 === e) {
  11402. var t = this.renderer.getSize();
  11403. (e = this.renderTarget1.clone()).setSize(t.width, t.height)
  11404. }
  11405. this.renderTarget1.dispose(),
  11406. this.renderTarget2.dispose(),
  11407. this.renderTarget1 = e,
  11408. this.renderTarget2 = e.clone(),
  11409. this.writeBuffer = this.renderTarget1,
  11410. this.readBuffer = this.renderTarget2
  11411. },
  11412. setSize: function(e, t) {
  11413. this.renderTarget1.setSize(e, t),
  11414. this.renderTarget2.setSize(e, t)
  11415. }
  11416. }
  11417. }
  11418. , {
  11419. three: 217
  11420. }],
  11421. 97: [function(e, t, i) {
  11422. "use strict";
  11423. var n = e("three");
  11424. n.MaskPass = function(e, t) {
  11425. this.scene = e,
  11426. this.camera = t,
  11427. this.enabled = !0,
  11428. this.clear = !0,
  11429. this.needsSwap = !1,
  11430. this.inverse = !1
  11431. }
  11432. ,
  11433. n.MaskPass.prototype = {
  11434. render: function(e, t, i, n) {
  11435. var r, o, a = e.context;
  11436. a.colorMask(!1, !1, !1, !1),
  11437. a.depthMask(!1),
  11438. o = this.inverse ? (r = 0,
  11439. 1) : (r = 1,
  11440. 0),
  11441. a.enable(a.STENCIL_TEST),
  11442. a.stencilOp(a.REPLACE, a.REPLACE, a.REPLACE),
  11443. a.stencilFunc(a.ALWAYS, r, 4294967295),
  11444. a.clearStencil(o),
  11445. e.render(this.scene, this.camera, i, this.clear),
  11446. e.render(this.scene, this.camera, t, this.clear),
  11447. a.colorMask(!0, !0, !0, !0),
  11448. a.depthMask(!0),
  11449. a.stencilFunc(a.EQUAL, 1, 4294967295),
  11450. a.stencilOp(a.KEEP, a.KEEP, a.KEEP)
  11451. }
  11452. },
  11453. n.ClearMaskPass = function() {
  11454. this.enabled = !0
  11455. }
  11456. ,
  11457. n.ClearMaskPass.prototype = {
  11458. render: function(e, t, i, n) {
  11459. var r = e.context;
  11460. r.disable(r.STENCIL_TEST)
  11461. }
  11462. }
  11463. }
  11464. , {
  11465. three: 217
  11466. }],
  11467. 98: [function(e, t, i) {
  11468. "use strict";
  11469. var o = e("three");
  11470. o.RenderPass = function(e, t, i, n, r) {
  11471. this.scene = e,
  11472. this.camera = t,
  11473. this.overrideMaterial = i,
  11474. this.clearColor = n,
  11475. this.clearAlpha = void 0 !== r ? r : 1,
  11476. this.oldClearColor = new o.Color,
  11477. this.oldClearAlpha = 1,
  11478. this.enabled = !0,
  11479. this.clear = !0,
  11480. this.needsSwap = !1
  11481. }
  11482. ,
  11483. o.RenderPass.prototype = {
  11484. render: function(e, t, i, n) {
  11485. this.scene.overrideMaterial = this.overrideMaterial,
  11486. this.clearColor && (this.oldClearColor.copy(e.getClearColor()),
  11487. this.oldClearAlpha = e.getClearAlpha(),
  11488. e.setClearColor(this.clearColor, this.clearAlpha)),
  11489. e.render(this.scene, this.camera, i, this.clear),
  11490. this.clearColor && e.setClearColor(this.oldClearColor, this.oldClearAlpha),
  11491. this.scene.overrideMaterial = null
  11492. }
  11493. }
  11494. }
  11495. , {
  11496. three: 217
  11497. }],
  11498. 99: [function(e, t, i) {
  11499. "use strict";
  11500. var n = e("three");
  11501. n.ShaderPass = function(e, t) {
  11502. this.textureID = void 0 !== t ? t : "tDiffuse",
  11503. e instanceof n.ShaderMaterial ? (this.uniforms = e.uniforms,
  11504. this.material = e) : e && (this.uniforms = n.UniformsUtils.clone(e.uniforms),
  11505. this.material = new n.ShaderMaterial({
  11506. defines: e.defines || {},
  11507. uniforms: this.uniforms,
  11508. vertexShader: e.vertexShader,
  11509. fragmentShader: e.fragmentShader
  11510. })),
  11511. this.renderToScreen = !1,
  11512. this.enabled = !0,
  11513. this.needsSwap = !0,
  11514. this.clear = !1,
  11515. this.camera = new n.OrthographicCamera(-1,1,1,-1,0,1),
  11516. this.scene = new n.Scene,
  11517. this.quad = new n.Mesh(new n.PlaneBufferGeometry(2,2),null),
  11518. this.scene.add(this.quad)
  11519. }
  11520. ,
  11521. n.ShaderPass.prototype = {
  11522. render: function(e, t, i, n) {
  11523. this.uniforms[this.textureID] && (this.uniforms[this.textureID].value = i),
  11524. this.quad.material = this.material,
  11525. this.renderToScreen ? e.render(this.scene, this.camera) : e.render(this.scene, this.camera, t, this.clear)
  11526. }
  11527. }
  11528. }
  11529. , {
  11530. three: 217
  11531. }],
  11532. 100: [function(e, t, i) {
  11533. "use strict";
  11534. e("three").CopyShader = {
  11535. uniforms: {
  11536. tDiffuse: {
  11537. type: "t",
  11538. value: null
  11539. },
  11540. opacity: {
  11541. type: "f",
  11542. value: 1
  11543. }
  11544. },
  11545. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11546. fragmentShader: ["uniform float opacity;", "uniform sampler2D tDiffuse;", "varying vec2 vUv;", "void main() {", "vec4 texel = texture2D( tDiffuse, vUv );", "gl_FragColor = opacity * texel;", "}"].join("\n")
  11547. }
  11548. }
  11549. , {
  11550. three: 217
  11551. }],
  11552. 101: [function(e, t, i) {
  11553. "use strict";
  11554. e("three").HorizontalBlurShader = {
  11555. uniforms: {
  11556. tDiffuse: {
  11557. type: "t",
  11558. value: null
  11559. },
  11560. h: {
  11561. type: "f",
  11562. value: 1 / 512
  11563. }
  11564. },
  11565. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11566. 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")
  11567. }
  11568. }
  11569. , {
  11570. three: 217
  11571. }],
  11572. 102: [function(e, t, i) {
  11573. "use strict";
  11574. e("three").VerticalBlurShader = {
  11575. uniforms: {
  11576. tDiffuse: {
  11577. type: "t",
  11578. value: null
  11579. },
  11580. v: {
  11581. type: "f",
  11582. value: 1 / 512
  11583. }
  11584. },
  11585. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11586. 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")
  11587. }
  11588. }
  11589. , {
  11590. three: 217
  11591. }],
  11592. 103: [function(e, t, i) {
  11593. "use strict";
  11594. var z = e("three");
  11595. !function() {
  11596. if ("performance"in window == 0 && (window.performance = {}),
  11597. "now"in window.performance == 0) {
  11598. var e = Date.now();
  11599. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  11600. window.performance.now = function() {
  11601. return Date.now() - e
  11602. }
  11603. }
  11604. }(),
  11605. z.WebGLRenderer.prototype.paramThreeToGL = function(e) {
  11606. var t, i = this.extensions, n = this.context;
  11607. if (e === z.RepeatWrapping)
  11608. return n.REPEAT;
  11609. if (e === z.ClampToEdgeWrapping)
  11610. return n.CLAMP_TO_EDGE;
  11611. if (e === z.MirroredRepeatWrapping)
  11612. return n.MIRRORED_REPEAT;
  11613. if (e === z.NearestFilter)
  11614. return n.NEAREST;
  11615. if (e === z.NearestMipMapNearestFilter)
  11616. return n.NEAREST_MIPMAP_NEAREST;
  11617. if (e === z.NearestMipMapLinearFilter)
  11618. return n.NEAREST_MIPMAP_LINEAR;
  11619. if (e === z.LinearFilter)
  11620. return n.LINEAR;
  11621. if (e === z.LinearMipMapNearestFilter)
  11622. return n.LINEAR_MIPMAP_NEAREST;
  11623. if (e === z.LinearMipMapLinearFilter)
  11624. return n.LINEAR_MIPMAP_LINEAR;
  11625. if (e === z.UnsignedByteType)
  11626. return n.UNSIGNED_BYTE;
  11627. if (e === z.UnsignedShort4444Type)
  11628. return n.UNSIGNED_SHORT_4_4_4_4;
  11629. if (e === z.UnsignedShort5551Type)
  11630. return n.UNSIGNED_SHORT_5_5_5_1;
  11631. if (e === z.UnsignedShort565Type)
  11632. return n.UNSIGNED_SHORT_5_6_5;
  11633. if (e === z.ByteType)
  11634. return n.BYTE;
  11635. if (e === z.ShortType)
  11636. return n.SHORT;
  11637. if (e === z.UnsignedShortType)
  11638. return n.UNSIGNED_SHORT;
  11639. if (e === z.IntType)
  11640. return n.INT;
  11641. if (e === z.UnsignedIntType)
  11642. return n.UNSIGNED_INT;
  11643. if (e === z.FloatType)
  11644. return n.FLOAT;
  11645. if (null !== (t = i.get("OES_texture_half_float")) && e === z.HalfFloatType)
  11646. return t.HALF_FLOAT_OES;
  11647. if (e === z.AlphaFormat)
  11648. return n.ALPHA;
  11649. if (e === z.RGBFormat)
  11650. return n.RGB;
  11651. if (e === z.RGBAFormat)
  11652. return n.RGBA;
  11653. if (e === z.LuminanceFormat)
  11654. return n.LUMINANCE;
  11655. if (e === z.LuminanceAlphaFormat)
  11656. return n.LUMINANCE_ALPHA;
  11657. if (e === z.AddEquation)
  11658. return n.FUNC_ADD;
  11659. if (e === z.SubtractEquation)
  11660. return n.FUNC_SUBTRACT;
  11661. if (e === z.ReverseSubtractEquation)
  11662. return n.FUNC_REVERSE_SUBTRACT;
  11663. if (e === z.ZeroFactor)
  11664. return n.ZERO;
  11665. if (e === z.OneFactor)
  11666. return n.ONE;
  11667. if (e === z.SrcColorFactor)
  11668. return n.SRC_COLOR;
  11669. if (e === z.OneMinusSrcColorFactor)
  11670. return n.ONE_MINUS_SRC_COLOR;
  11671. if (e === z.SrcAlphaFactor)
  11672. return n.SRC_ALPHA;
  11673. if (e === z.OneMinusSrcAlphaFactor)
  11674. return n.ONE_MINUS_SRC_ALPHA;
  11675. if (e === z.DstAlphaFactor)
  11676. return n.DST_ALPHA;
  11677. if (e === z.OneMinusDstAlphaFactor)
  11678. return n.ONE_MINUS_DST_ALPHA;
  11679. if (e === z.DstColorFactor)
  11680. return n.DST_COLOR;
  11681. if (e === z.OneMinusDstColorFactor)
  11682. return n.ONE_MINUS_DST_COLOR;
  11683. if (e === z.SrcAlphaSaturateFactor)
  11684. return n.SRC_ALPHA_SATURATE;
  11685. if (null !== (t = i.get("WEBGL_compressed_texture_s3tc"))) {
  11686. if (e === z.RGB_S3TC_DXT1_Format)
  11687. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  11688. if (e === z.RGBA_S3TC_DXT1_Format)
  11689. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  11690. if (e === z.RGBA_S3TC_DXT3_Format)
  11691. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  11692. if (e === z.RGBA_S3TC_DXT5_Format)
  11693. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  11694. }
  11695. if (null !== (t = i.get("WEBGL_compressed_texture_pvrtc"))) {
  11696. if (e === z.RGB_PVRTC_4BPPV1_Format)
  11697. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  11698. if (e === z.RGB_PVRTC_2BPPV1_Format)
  11699. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  11700. if (e === z.RGBA_PVRTC_4BPPV1_Format)
  11701. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  11702. if (e === z.RGBA_PVRTC_2BPPV1_Format)
  11703. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  11704. }
  11705. if (null !== (t = i.get("WEBGL_compressed_texture_etc1")) && e === z.RGB_ETC1_Format)
  11706. return t.COMPRESSED_RGB_ETC1_WEBGL;
  11707. if (null !== (t = i.get("EXT_blend_minmax"))) {
  11708. if (e === z.MinEquation)
  11709. return t.MIN_EXT;
  11710. if (e === z.MaxEquation)
  11711. return t.MAX_EXT
  11712. }
  11713. return 0
  11714. }
  11715. ,
  11716. z.WebGLState = function(l, i, c) {
  11717. var n = this
  11718. , r = new z.Vector4
  11719. , e = l.getParameter(l.MAX_VERTEX_ATTRIBS)
  11720. , o = new Uint8Array(e)
  11721. , a = new Uint8Array(e)
  11722. , s = new Uint8Array(e)
  11723. , t = {}
  11724. , h = null
  11725. , u = null
  11726. , d = null
  11727. , p = null
  11728. , f = null
  11729. , g = null
  11730. , m = null
  11731. , v = null
  11732. , y = !1
  11733. , A = null
  11734. , C = null
  11735. , I = null
  11736. , E = null
  11737. , _ = null
  11738. , b = null
  11739. , w = null
  11740. , T = null
  11741. , x = null
  11742. , S = null
  11743. , M = null
  11744. , R = null
  11745. , P = null
  11746. , O = null
  11747. , L = null
  11748. , D = l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS)
  11749. , N = void 0
  11750. , F = {}
  11751. , B = new z.Vector4
  11752. , V = null
  11753. , k = null
  11754. , U = new z.Vector4
  11755. , H = new z.Vector4;
  11756. this.init = function() {
  11757. this.clearColor(0, 0, 0, 1),
  11758. this.clearDepth(1),
  11759. this.clearStencil(0),
  11760. this.enable(l.DEPTH_TEST),
  11761. l.depthFunc(l.LEQUAL),
  11762. l.frontFace(l.CCW),
  11763. l.cullFace(l.BACK),
  11764. this.enable(l.CULL_FACE),
  11765. this.enable(l.BLEND),
  11766. l.blendEquation(l.FUNC_ADD),
  11767. l.blendFunc(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA)
  11768. }
  11769. ,
  11770. this.initAttributes = function() {
  11771. for (var e = 0, t = o.length; e < t; e++)
  11772. o[e] = 0
  11773. }
  11774. ,
  11775. this.enableAttribute = function(e) {
  11776. o[e] = 1,
  11777. 0 === a[e] && (l.enableVertexAttribArray(e),
  11778. a[e] = 1),
  11779. 0 !== s[e] && (i.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(e, 0),
  11780. s[e] = 0)
  11781. }
  11782. ,
  11783. this.enableAttributeAndDivisor = function(e, t, i) {
  11784. o[e] = 1,
  11785. 0 === a[e] && (l.enableVertexAttribArray(e),
  11786. a[e] = 1),
  11787. s[e] !== t && (i.vertexAttribDivisorANGLE(e, t),
  11788. s[e] = t)
  11789. }
  11790. ,
  11791. this.disableUnusedAttributes = function() {
  11792. for (var e = 0, t = a.length; e < t; e++)
  11793. a[e] !== o[e] && (l.disableVertexAttribArray(e),
  11794. a[e] = 0)
  11795. }
  11796. ,
  11797. this.enable = function(e) {
  11798. !0 !== t[e] && (l.enable(e),
  11799. t[e] = !0)
  11800. }
  11801. ,
  11802. this.disable = function(e) {
  11803. !1 !== t[e] && (l.disable(e),
  11804. t[e] = !1)
  11805. }
  11806. ,
  11807. this.getCompressedTextureFormats = function() {
  11808. if (null === h && (h = [],
  11809. i.get("WEBGL_compressed_texture_pvrtc") || i.get("WEBGL_compressed_texture_s3tc") || i.get("WEBGL_compressed_texture_etc1")))
  11810. for (var e = l.getParameter(l.COMPRESSED_TEXTURE_FORMATS), t = 0; t < e.length; t++)
  11811. h.push(e[t]);
  11812. return h
  11813. }
  11814. ,
  11815. this.setBlending = function(e, t, i, n, r, o, a, s) {
  11816. e === z.NoBlending ? this.disable(l.BLEND) : this.enable(l.BLEND),
  11817. e === u && s === y || (e === z.AdditiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  11818. l.blendFuncSeparate(l.ONE, l.ONE, l.ONE, l.ONE)) : (l.blendEquation(l.FUNC_ADD),
  11819. l.blendFunc(l.SRC_ALPHA, l.ONE)) : e === z.SubtractiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  11820. l.blendFuncSeparate(l.ZERO, l.ZERO, l.ONE_MINUS_SRC_COLOR, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  11821. l.blendFunc(l.ZERO, l.ONE_MINUS_SRC_COLOR)) : e === z.MultiplyBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  11822. l.blendFuncSeparate(l.ZERO, l.ZERO, l.SRC_COLOR, l.SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  11823. l.blendFunc(l.ZERO, l.SRC_COLOR)) : s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  11824. l.blendFuncSeparate(l.ONE, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  11825. l.blendFuncSeparate(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)),
  11826. u = e,
  11827. y = s),
  11828. e === z.CustomBlending ? (r = r || t,
  11829. o = o || i,
  11830. a = a || n,
  11831. t === d && r === g || (l.blendEquationSeparate(c(t), c(r)),
  11832. d = t,
  11833. g = r),
  11834. i === p && n === f && o === m && a === v || (l.blendFuncSeparate(c(i), c(n), c(o), c(a)),
  11835. p = i,
  11836. f = n,
  11837. m = o,
  11838. v = a)) : v = m = g = f = p = d = null
  11839. }
  11840. ,
  11841. this.setDepthFunc = function(e) {
  11842. if (A !== e) {
  11843. if (e)
  11844. switch (e) {
  11845. case z.NeverDepth:
  11846. l.depthFunc(l.NEVER);
  11847. break;
  11848. case z.AlwaysDepth:
  11849. l.depthFunc(l.ALWAYS);
  11850. break;
  11851. case z.LessDepth:
  11852. l.depthFunc(l.LESS);
  11853. break;
  11854. case z.LessEqualDepth:
  11855. l.depthFunc(l.LEQUAL);
  11856. break;
  11857. case z.EqualDepth:
  11858. l.depthFunc(l.EQUAL);
  11859. break;
  11860. case z.GreaterEqualDepth:
  11861. l.depthFunc(l.GEQUAL);
  11862. break;
  11863. case z.GreaterDepth:
  11864. l.depthFunc(l.GREATER);
  11865. break;
  11866. case z.NotEqualDepth:
  11867. l.depthFunc(l.NOTEQUAL);
  11868. break;
  11869. default:
  11870. l.depthFunc(l.LEQUAL)
  11871. }
  11872. else
  11873. l.depthFunc(l.LEQUAL);
  11874. A = e
  11875. }
  11876. }
  11877. ,
  11878. this.setDepthTest = function(e) {
  11879. e ? this.enable(l.DEPTH_TEST) : this.disable(l.DEPTH_TEST)
  11880. }
  11881. ,
  11882. this.setDepthWrite = function(e) {
  11883. C !== e && (l.depthMask(e),
  11884. C = e)
  11885. }
  11886. ,
  11887. this.setColorWrite = function(e) {
  11888. I !== e && (l.colorMask(e, e, e, e),
  11889. I = e)
  11890. }
  11891. ,
  11892. this.setStencilFunc = function(e, t, i) {
  11893. _ === e && b === t && w === i || (l.stencilFunc(e, t, i),
  11894. _ = e,
  11895. b = t,
  11896. w = i)
  11897. }
  11898. ,
  11899. this.setStencilOp = function(e, t, i) {
  11900. T === e && x === t && S === i || (l.stencilOp(e, t, i),
  11901. T = e,
  11902. x = t,
  11903. S = i)
  11904. }
  11905. ,
  11906. this.setStencilTest = function(e) {
  11907. e ? this.enable(l.STENCIL_TEST) : this.disable(l.STENCIL_TEST)
  11908. }
  11909. ,
  11910. this.setStencilWrite = function(e) {
  11911. E !== e && (l.stencilMask(e),
  11912. E = e)
  11913. }
  11914. ,
  11915. this.setFlipSided = function(e) {
  11916. M !== e && (e ? l.frontFace(l.CW) : l.frontFace(l.CCW),
  11917. M = e)
  11918. }
  11919. ,
  11920. this.setLineWidth = function(e) {
  11921. e !== R && (l.lineWidth(e),
  11922. R = e)
  11923. }
  11924. ,
  11925. this.setPolygonOffset = function(e, t, i) {
  11926. e ? this.enable(l.POLYGON_OFFSET_FILL) : this.disable(l.POLYGON_OFFSET_FILL),
  11927. !e || P === t && O === i || (l.polygonOffset(t, i),
  11928. P = t,
  11929. O = i)
  11930. }
  11931. ,
  11932. this.getScissorTest = function() {
  11933. return L
  11934. }
  11935. ,
  11936. this.setScissorTest = function(e) {
  11937. (L = e) ? this.enable(l.SCISSOR_TEST) : this.disable(l.SCISSOR_TEST)
  11938. }
  11939. ,
  11940. this.activeTexture = function(e) {
  11941. void 0 === e && (e = l.TEXTURE0 + D - 1),
  11942. N !== e && (l.activeTexture(e),
  11943. N = e)
  11944. }
  11945. ,
  11946. this.bindTexture = function(e, t) {
  11947. void 0 === N && n.activeTexture();
  11948. var i = F[N];
  11949. void 0 === i && (i = {
  11950. type: void 0,
  11951. texture: void 0
  11952. },
  11953. F[N] = i),
  11954. i.type === e && i.texture === t || (l.bindTexture(e, t),
  11955. i.type = e,
  11956. i.texture = t)
  11957. }
  11958. ,
  11959. this.compressedTexImage2D = function() {
  11960. try {
  11961. l.compressedTexImage2D.apply(l, arguments)
  11962. } catch (e) {
  11963. console.error(e)
  11964. }
  11965. }
  11966. ,
  11967. this.texImage2D = function() {
  11968. try {
  11969. l.texImage2D.apply(l, arguments)
  11970. } catch (e) {
  11971. console.error(e)
  11972. }
  11973. }
  11974. ,
  11975. this.clearColor = function(e, t, i, n) {
  11976. r.set(e, t, i, n),
  11977. !1 === B.equals(r) && (l.clearColor(e, t, i, n),
  11978. B.copy(r))
  11979. }
  11980. ,
  11981. this.clearDepth = function(e) {
  11982. V !== e && (l.clearDepth(e),
  11983. V = e)
  11984. }
  11985. ,
  11986. this.clearStencil = function(e) {
  11987. k !== e && (l.clearStencil(e),
  11988. k = e)
  11989. }
  11990. ,
  11991. this.scissor = function(e) {
  11992. !1 === U.equals(e) && (l.scissor(e.x, e.y, e.z, e.w),
  11993. U.copy(e))
  11994. }
  11995. ,
  11996. this.viewport = function(e) {
  11997. !1 === H.equals(e) && (l.viewport(e.x, e.y, e.z, e.w),
  11998. H.copy(e))
  11999. }
  12000. ,
  12001. this.reset = function() {
  12002. for (var e = 0; e < a.length; e++)
  12003. 1 === a[e] && (l.disableVertexAttribArray(e),
  12004. a[e] = 0);
  12005. t = {},
  12006. N = void 0,
  12007. F = {},
  12008. M = E = C = I = u = h = null
  12009. }
  12010. }
  12011. }
  12012. , {
  12013. three: 217
  12014. }],
  12015. 104: [function(a, h, e) {
  12016. (function(i, e) {
  12017. "use strict";
  12018. function t(e) {
  12019. this.urls = e;
  12020. var t = i("bWVzc2FnZSBiaW5hcnlfbWVzaCB7CglyZXBlYXRlZCBjaHVua19zaW1wbGUgY2h1bmsgPSAxOwoJcmVwZWF0ZWQgY2h1bmtfcXVhbnRpemVkIHF1YW50aXplZF9jaHVuayA9IDI7Cn0KCi8vIERlZmluaXRpb24gb2YgdmVydGljZXM6IDNEIGNvb3JkaW5hdGVzLCBhbmQgMkQgdGV4dHVyZSBjb29yZGluYXRlcy4KbWVzc2FnZSB2ZXJ0aWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgZmxvYXQgeHl6ID0gMSBbcGFja2VkPXRydWVdOyAgLy8geF8wLHlfMCx6XzAsIHhfMSx5XzEsel8xLCAuLi4KCXJlcGVhdGVkIGZsb2F0IHV2ID0gMiBbcGFja2VkPXRydWVdOyAgLy8gdV8wLHZfMCwgdV8xLHZfMSwgLi4uCn0KCi8vIEluZGV4ZXMgb2YgdmVydGljZXMgb2YgZmFjZXMKbWVzc2FnZSBmYWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgdWludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgovLyBBIHNpbXBseSBlbmNvZGVkIGNodW5rLgovLyBUT0RPOiBhZGQgY2h1bmsgcHJvcGVyaXRlcyAoc3VjaCBhcyAicmVmbGVjdGl2ZSIpCm1lc3NhZ2UgY2h1bmtfc2ltcGxlIHsKCW9wdGlvbmFsIHZlcnRpY2VzX3NpbXBsZSB2ZXJ0aWNlcyA9IDE7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSAyOwoJb3B0aW9uYWwgc3RyaW5nIGNodW5rX25hbWUgPSAzOwoJb3B0aW9uYWwgc3RyaW5nIG1hdGVyaWFsX25hbWUgPSA0Owp9CgovLyBRdWFudGl6ZWQgdmVyc2lvbnMgZm9sbG93OgptZXNzYWdlIHZlcnRpY2VzX3F1YW50aXplZCB7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAxOwoJcmVwZWF0ZWQgZmxvYXQgdHJhbnNsYXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHggPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgeSA9IDQgW3BhY2tlZD10cnVlXTsKCXJlcGVhdGVkIHNpbnQzMiB6ID0gNSBbcGFja2VkPXRydWVdOwp9CgptZXNzYWdlIHV2X3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgbmFtZSA9IDE7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHUgPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgdiA9IDQgW3BhY2tlZD10cnVlXTsKfQoKLy8gSW5kZXhlcyBvZiB2ZXJ0aWNlcyBvZiBmYWNlcwptZXNzYWdlIGZhY2VzX2NvbXByZXNzZWQgewoJcmVwZWF0ZWQgc2ludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgptZXNzYWdlIGNodW5rX3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgY2h1bmtfbmFtZSA9IDE7CglvcHRpb25hbCBzdHJpbmcgbWF0ZXJpYWxfbmFtZSA9IDI7CglvcHRpb25hbCB2ZXJ0aWNlc19xdWFudGl6ZWQgdmVydGljZXMgPSAzOwoJcmVwZWF0ZWQgdXZfcXVhbnRpemVkIHV2cyA9IDQ7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSA1Owp9Cg==", "base64");
  12021. this.builder = n.loadProto(t),
  12022. this.decoder = this.builder.build("binary_mesh")
  12023. }
  12024. var s = a("three")
  12025. , n = a("protobufjs")
  12026. , r = a("../util/logger")
  12027. , o = (a("../util/common"),
  12028. a("../util/ajax"))
  12029. , l = a("../objects/Chunk")
  12030. , c = new r(e);
  12031. t.prototype = {
  12032. constructor: t,
  12033. load: function(t, i, n, r) {
  12034. return c.time("download"),
  12035. o.get(t, {
  12036. responseType: "arraybuffer"
  12037. }).done(function(e) {
  12038. c.timeEnd("download"),
  12039. this.parse(e, t, i, n, r)
  12040. }
  12041. .bind(this)).fail(r)
  12042. },
  12043. parse: function(e, t, i, n, r) {
  12044. var o = this.readProtobuf(e);
  12045. if (!o)
  12046. return r();
  12047. try {
  12048. c.time("convert to webgl"),
  12049. this.convertProtobufToSceneObject(o, t, i, n, r),
  12050. c.timeEnd("convert to webgl")
  12051. } catch (e) {
  12052. return c.error("failed parsing .dam"),
  12053. c.error(e.message),
  12054. r()
  12055. }
  12056. },
  12057. readProtobuf: function(e) {
  12058. var t;
  12059. try {
  12060. c.time("parse proto"),
  12061. t = this.decoder.decode(e),
  12062. c.timeEnd("parse proto")
  12063. } catch (e) {
  12064. return c.error("failed parsing proto for .dam"),
  12065. c.error(e.message),
  12066. null
  12067. }
  12068. return t
  12069. },
  12070. convertProtobufToSceneObject: function(e, i, t, n, r) {
  12071. if (0 === e.chunk.length)
  12072. return c.warn("No chunks in damfile..."),
  12073. t([]);
  12074. var o = new s.Matrix4;
  12075. o.set(1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1);
  12076. var a = e.chunk.map(function(e) {
  12077. var t = new s.BufferGeometry;
  12078. return t.addAttribute("position", new s.BufferAttribute(new Float32Array(e.vertices.xyz,0,3),3)),
  12079. 0 < e.vertices.uv.length && t.addAttribute("uv", new s.BufferAttribute(new Float32Array(e.vertices.uv,0,2),2)),
  12080. t.setIndex(new s.BufferAttribute(new Uint32Array(e.faces.faces,0,1),1)),
  12081. t.applyMatrix(o),
  12082. t.computeBoundingBox(),
  12083. new l({
  12084. geometry: t,
  12085. textureName: e.material_name,
  12086. name: e.chunk_name,
  12087. meshUrl: i
  12088. })
  12089. });
  12090. return a ? t(a) : (c.error(".dam protobuf came out with no chunks..."),
  12091. r())
  12092. }
  12093. },
  12094. h.exports = t
  12095. }
  12096. ).call(this, a("buffer").Buffer, "/js/loaders/DamLoader.js")
  12097. }
  12098. , {
  12099. "../objects/Chunk": 144,
  12100. "../util/ajax": 181,
  12101. "../util/common": 185,
  12102. "../util/logger": 189,
  12103. buffer: 198,
  12104. protobufjs: 214,
  12105. three: 217
  12106. }],
  12107. 105: [function(n, r, e) {
  12108. (function(e) {
  12109. "use strict";
  12110. var t = (n("three"),
  12111. n("../settings"),
  12112. n("../util/browser"),
  12113. n("./DamLoader"))
  12114. , i = n("../util/logger")
  12115. , u = (n("../ab"),
  12116. new i(e));
  12117. r.exports = {
  12118. getLoaders: function() {
  12119. return [["_50k", ".dam", t], ["", ".dam", t]]
  12120. },
  12121. load: function(e, t, i, n, r, o) {
  12122. var a = this.getLoaders()[o = o || 0];
  12123. if (a) {
  12124. var s = a[0]
  12125. , l = a[1]
  12126. , c = new a[2](t)
  12127. , h = t.get(e + s + l);
  12128. h ? (u.debug("Trying " + s + l),
  12129. c.load(h, i, n, function() {
  12130. this.load(e, t, i, n, r, ++o)
  12131. }
  12132. .bind(this))) : (u.debug("Skipping " + l + ", not available"),
  12133. this.load(e, t, i, n, r, ++o))
  12134. } else
  12135. r && r("No suitable model file found...")
  12136. }
  12137. }
  12138. }
  12139. ).call(this, "/js/loaders/ModelLoader.js")
  12140. }
  12141. , {
  12142. "../ab": 3,
  12143. "../settings": 166,
  12144. "../util/browser": 182,
  12145. "../util/logger": 189,
  12146. "./DamLoader": 104,
  12147. three: 217
  12148. }],
  12149. 106: [function(i, n, e) {
  12150. (function(e) {
  12151. "use strict";
  12152. var l = i("../util/common")
  12153. , c = i("../util/texture")
  12154. , h = i("../util/browser")
  12155. , t = i("../util/logger")
  12156. , u = i("../settings")
  12157. , d = new t(e);
  12158. n.exports = {
  12159. load: function(i, n) {
  12160. if (!i.chunks[0] || !i.chunks[0].meshUrl)
  12161. return $.when();
  12162. var r = l.countUnique(i.chunks.map(function(e) {
  12163. return e.textureName
  12164. }))
  12165. , e = -1 !== i.chunks[0].meshUrl.indexOf("_50k") ? "_50k" : ""
  12166. , t = "_50k" == e ? "high" : "low";
  12167. u.minimalMemoryMode && "high" === t && (h.detectSamsungS6() ? (d.warn("Galaxy S6 cannot handle large textures, turning down quality."),
  12168. t = "low") : r > u.maxMobileTextures && (d.warn("Model probably too large for mobile, turning down quality."),
  12169. t = "low"));
  12170. var o = i.data.job.uuid + e + "_texture_jpg_" + t + "/"
  12171. , a = $.Deferred()
  12172. , s = 0;
  12173. return i.chunks.forEach(function(e) {
  12174. if (!e.material.map && e.textureName) {
  12175. var t = i.urls.get(o + e.textureName);
  12176. e.setTextureMap(c.load(t, function(e, t) {
  12177. e || (n.push(t),
  12178. s++,
  12179. a.notify(s, r),
  12180. s === r && a.resolve())
  12181. }
  12182. .bind(this, c.isLoaded(t))))
  12183. }
  12184. }),
  12185. a.promise()
  12186. }
  12187. }
  12188. }
  12189. ).call(this, "/js/loaders/ModelTextureLoader.js")
  12190. }
  12191. , {
  12192. "../settings": 166,
  12193. "../util/browser": 182,
  12194. "../util/common": 185,
  12195. "../util/logger": 189,
  12196. "../util/texture": 194
  12197. }],
  12198. 107: [function(s, l, e) {
  12199. (function(n, e) {
  12200. "use strict";
  12201. function t(e) {
  12202. this.model = e,
  12203. this.modelDataPath = this.model.urls.get("vision.modeldata")+"?m="+new Date().getTime(),
  12204. this.sweepLocationsPath = this.model.urls.get("sweep_locations.csv");
  12205. var t = n("Ly8gUHJvdG9jb2wgQnVmZmVyIGZvciBwdWNrIHZpc2liaWxpdHkgYW5kIHJlbGF0ZWQgZGF0YQovLwovLyBUbyBkdW1wIG91dCBhIGJpbnJheSBtYW5pZmVzdCBpbiB0ZXh0IGZvcm1hdCwgeW91IGNhbiB1c2UgcHJvdG9jIGRpcmVjdGx5OgovLyAgIHByb3RvYyAtLXByb3RvX3BhdGggfi9kZXYvbXBfdmlzaW9uLyAgLS1kZWNvZGU9ZW9zLnN0b3JhZ2UuVmlzaW9uTW9kZWxkYXRhIH4vZGV2L21wX3Zpc2lvbi9lb3Mvc3RvcmFnZS92aXNpb25fbW9kZWxkYXRhLnByb3RvIDwgdmlzaW9uLm1vZGVsZGF0YQoKLy8gcGFja2FnZSBlb3Muc3RvcmFnZTsKCi8vIGltcG9ydCAiZW9zL2luZnJhL2NvbW1vbi5wcm90byI7Ci8vIFRoZSBmb2xsb3dpbmcgd2VyZSBtYW51YWxseSBleHRyYWN0ZWQgaGVyZSwgSlMgZG9lcyBub3QgbGlrZSBwcm90b2J1ZiBpbXBvcnRzCgptZXNzYWdlIEFmZmluZTNmIHsKCW9wdGlvbmFsIFF1YXRlcm5pb25mIHJvdGF0aW9uID0gMTsKCW9wdGlvbmFsIFZlY3RvcjNmIHRyYW5zbGF0aW9uID0gMjsKfQoKbWVzc2FnZSBRdWF0ZXJuaW9uZiB7CglvcHRpb25hbCBmbG9hdCB3ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHggPSAyOwoJb3B0aW9uYWwgZmxvYXQgeSA9IDM7CglvcHRpb25hbCBmbG9hdCB6ID0gNDsKfQoKbWVzc2FnZSBWZWN0b3IzZiB7CglvcHRpb25hbCBmbG9hdCB4ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHkgPSAyOwoJb3B0aW9uYWwgZmxvYXQgeiA9IDM7Cn0KCi8vCi8vIE9uZSBzd2VlcCAvIHBhbm8KLy8KbWVzc2FnZSBTd2VlcExvY2F0aW9uIHsKCW9wdGlvbmFsIGJ5dGVzIHV1aWQgPSAxOyAgLyogdXVpZCAqLwoJb3B0aW9uYWwgQWZmaW5lM2YgcG9zZSA9IDI7ICAvKiBjYW1lcmEgcG9zZSAoeCwgeSx6KSBpbiBtZXRlciBhbmQgYSBxdWF0ZXJuaW9uKi8KCW9wdGlvbmFsIFZlY3RvcjNmIHB1Y2sgPSAzOyAgLyogcHVjayBsb2NhdGlvbiAtIHggYW55IGlzIGdlbmVyYWxseSB0aGUgc2FtZSBhcyBwb3NlLCB6IGlzIHRoZSBoZWlnaHQgb2YgdGhlIGNsb3Nlc3QgZmxvb3IgdW5kZXIgdGhlIGNhbWVyYSAqLwoJb3B0aW9uYWwgaW50MzIgZ3JvdXAgPSA0OyAgLyogZmxvb3IgaW5kZXggKi8KCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gNTsgIC8qIHJvb20gaW5kZXggKi8KCXJlcGVhdGVkIGludDMyIHZpc2libGVzID0gNjsgIC8qIGxpc3Qgb2YgaW5kaWNlcyB0byBhbGwgcHVja3MgdmlzaWJsZSBmcm9tIHRoaXMgcHVjayAqLwoJcmVwZWF0ZWQgZmxvYXQgc2NvcmVzID0gNzsgLyogdXNlZCBhcyBwYXJ0IG9mIHNjb3JpbmcgZnVuY3Rpb24gZm9yIGRldGVybWluaW5nIHdoaWNoIHB1Y2sgdG8gZ28gdG8gbmV4dCAqLwogIG9wdGlvbmFsIHN0cmluZyBzd2VlcF9uYW1lID0gODsKCiAgLy8gV2l0aCBvdXRkb29yIHBhbm9zLCB3ZSBoYXZlIGEgY291cGxlIG9mIGRpZmZlcmVudCBzaXR1YXRpb25zIGZvciBhbGlnbm1lbnQuIFRoZSBjb21tb24KICAvLyBjYXNlIGlzIHRoYXQgdGhlIHBhbm8gYWxpZ25lZCBub3JtYWxseS4gSXQgY291bGQgYWxzbyBoYXZlIGJlZW4gcGxhY2VkIG1hbnVhbGx5IGluCiAgLy8gQ2FwdHVyZUFwcCBvciBXb3Jrc2hvcCwgb3IgbGVmdCB1bmFsaWduZWQgZm9yIGhpZ2hsaWdodC1yZWVsIHZpZXdpbmcuCiAgZW51bSBBbGlnbm1lbnRUeXBlCiAgewogICAgICBVTktOT1dOID0gMDsKICAgICAgQUxJR05FRCA9IDE7CiAgICAgIFVOQUxJR05FRCA9IDI7CiAgICAgIE1BTlVBTExZX1BMQUNFRCA9IDM7CiAgfQogIG9wdGlvbmFsIEFsaWdubWVudFR5cGUgYWxpZ25tZW50X3R5cGUgPSA5IFtkZWZhdWx0ID0gQUxJR05FRF07Cn0KCm1lc3NhZ2UgU3ViZ3JvdXBJbmZvIHsKCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gMTsKCW9wdGlvbmFsIGZsb2F0IGFyZWEgPSAyOyAvKiBmbG9vciBhcmVhIGluIG1eMiAoc3F1YXJlIG1ldGVyYWdlKSAqLwp9CgovKiBBbGwgcHVja3MgaW4gYSBtb2RlbC4gUHVja3MgYXJlIHN0b3JlZCBpbiBzY2FubmluZyBvcmRlci4gKi8KbWVzc2FnZSBWaXNpb25Nb2RlbGRhdGEgewoJcmVwZWF0ZWQgU3dlZXBMb2NhdGlvbiBzd2VlcExvY2F0aW9ucyA9IDE7CglyZXBlYXRlZCBTdWJncm91cEluZm8gc3ViZ3JvdXBJbmZvcyA9IDI7Cn0K", "base64")
  12206. , i = r.loadProto(t);
  12207. this.decoder = i.build("VisionModeldata")
  12208. }
  12209. var r = s("protobufjs")
  12210. , i = s("../util/ajax")
  12211. , o = (s("../util/common"),
  12212. s("../util/math"))
  12213. , a = new (s("../util/logger"))(e);
  12214. t.prototype.load = function() {
  12215. return this.modelDataPath ? (a.info("Using vision.modeldata"),
  12216. this.loadVisionModelData()) : this.sweepLocationsPath ? (a.warn("Using sweep_locations.csv"),
  12217. this.loadSweepLocationsCSV()) : (a.warn("No sweep file found"),
  12218. $.when([]))
  12219. }
  12220. ,
  12221. t.prototype.loadVisionModelData = function() {
  12222. return i.get(this.modelDataPath, {
  12223. responseType: "arraybuffer"
  12224. }).then(function(e) {
  12225. var t;
  12226. try {
  12227. t = this.decoder.decode(e)
  12228. } catch (e) {
  12229. return a.warn("Could not decode vision.modeldata, trying sweep_locations.csv"),
  12230. this.loadSweepLocationsCSV()
  12231. }
  12232. var i = t.sweepLocations.map(function(e) {
  12233. return {
  12234. uuid: e.uuid.toUTF8().replace(/-/g, ""),
  12235. position: {
  12236. x: e.pose.translation.x,
  12237. y: e.pose.translation.y,
  12238. z: e.pose.translation.z
  12239. },
  12240. quaternion: {
  12241. x: e.pose.rotation.x,
  12242. y: e.pose.rotation.y,
  12243. z: e.pose.rotation.z,
  12244. w: e.pose.rotation.w
  12245. },
  12246. puck: {
  12247. x: e.puck.x,
  12248. y: e.puck.y,
  12249. z: e.puck.z
  12250. },
  12251. floor: e.group,
  12252. neighbours: e.visibles,
  12253. alignmentType: e.alignment_type
  12254. }
  12255. }).map(function(e) {
  12256. return e.position = o.convertVisionVector(e.position),
  12257. e.quaternion = o.convertVisionQuaternion(e.quaternion),
  12258. e.puck = o.convertVisionVector(e.puck),
  12259. e
  12260. });
  12261. return i.forEach(function(e) {
  12262. e.neighbours = e.neighbours.map(function(e) {
  12263. return i[e].uuid
  12264. })
  12265. }),
  12266. i
  12267. }
  12268. .bind(this), function() {
  12269. return a.warn("Could not load vision.modeldata, trying sweep_locations.csv"),
  12270. this.loadSweepLocationsCSV()
  12271. }
  12272. .bind(this))
  12273. }
  12274. ,
  12275. t.prototype.loadSweepLocationsCSV = function() {
  12276. return i.get(this.sweepLocationsPath).then(function(e) {
  12277. return e.split("\n").map(function(e) {
  12278. return e.split(", ")
  12279. }).filter(function(e) {
  12280. return 1 < e.length
  12281. }).map(function(e) {
  12282. return {
  12283. uuid: e[0],
  12284. position: {
  12285. x: parseFloat(e[1]),
  12286. y: parseFloat(e[2]),
  12287. z: parseFloat(e[3])
  12288. },
  12289. quaternion: {
  12290. x: parseFloat(e[4]),
  12291. y: parseFloat(e[5]),
  12292. z: parseFloat(e[6]),
  12293. w: parseFloat(e[7])
  12294. }
  12295. }
  12296. }).map(function(e) {
  12297. return e.position = o.convertVisionVector(e.position),
  12298. e.quaternion = o.convertVisionQuaternion(e.quaternion),
  12299. e
  12300. })
  12301. }).fail(function() {
  12302. a.warn("Could not load sweep_locations.csv, no sweeps loaded.")
  12303. })
  12304. }
  12305. ,
  12306. l.exports = t
  12307. }
  12308. ).call(this, s("buffer").Buffer, "/js/loaders/SweepDataLoader.js")
  12309. }
  12310. , {
  12311. "../util/ajax": 181,
  12312. "../util/common": 185,
  12313. "../util/logger": 189,
  12314. "../util/math": 190,
  12315. buffer: 198,
  12316. protobufjs: 214
  12317. }],
  12318. 108: [function(s, l, e) {
  12319. (function(e) {
  12320. "use strict";
  12321. function t() {
  12322. this.locale = null
  12323. }
  12324. var i = s("../settings")
  12325. , n = s("../util/common")
  12326. , r = s("../util/logger")
  12327. , o = s("../enum/Locale")
  12328. , a = new r(e);
  12329. t.prototype.init = function() {
  12330. var e;
  12331. switch (i.languageTag) {
  12332. case null:
  12333. case "en":
  12334. case o.EN_US:
  12335. this.locale = o.EN_US,
  12336. e = s("./strings-en-US");
  12337. break;
  12338. case "es":
  12339. case o.ES_MX:
  12340. this.locale = o.ES_MX,
  12341. e = s("./strings-es-MX");
  12342. break;
  12343. case "fr":
  12344. case o.FR_FR:
  12345. this.locale = o.FR_FR,
  12346. e = s("./strings-fr-FR");
  12347. break;
  12348. case "de":
  12349. case o.DE_DE:
  12350. this.locale = o.DE_DE,
  12351. e = s("./strings-de-DE");
  12352. break;
  12353. case "ru":
  12354. case o.RU_RU:
  12355. this.locale = o.RU_RU,
  12356. e = s("./strings-ru-RU");
  12357. break;
  12358. case "cn":
  12359. case o.CN_CN:
  12360. this.locale = o.CN_CN,
  12361. e = s("./strings-cn-CN");
  12362. break;
  12363. case "jp":
  12364. case o.JP_JP:
  12365. this.locale = o.JP_JP,
  12366. e = s("./strings-jp-JP");
  12367. break;
  12368. default:
  12369. a.info("Unsupported language tag, defaulting to 'en-US'"),
  12370. this.locale = o.EN_US,
  12371. e = s("./strings-en-US")
  12372. }
  12373. a.info("Using locale '" + this.locale + "'"),
  12374. n.extendObject(this, e)
  12375. }
  12376. ,
  12377. t.prototype.localizeGUI = function() {
  12378. var e = document.querySelector("#gui-parent");
  12379. this.localizeTree(e),
  12380. this.localizeLoadingText()
  12381. }
  12382. ,
  12383. t.prototype.localizeLoadingText = function() {
  12384. document.querySelector("#help-dialog").classList.add(this.locale),
  12385. document.querySelector("#interaction-modal").classList.add(this.locale),
  12386. document.querySelector("#gui").classList.add(this.locale)
  12387. }
  12388. ,
  12389. t.prototype.localizeTree = function(e) {
  12390. var t, i, n = /{\[{ ?(\w+) ?}\]}/;
  12391. if (e.nodeType === Node.TEXT_NODE)
  12392. (t = e.data.match(n)) && (i = t[1],
  12393. e.data = this.localizeText(i) || i);
  12394. else if (e.nodeType === Node.ELEMENT_NODE) {
  12395. var r = e.getAttribute("title");
  12396. r && ((t = r.match(n)) && (i = t[1],
  12397. e.setAttribute("title", this.localizeText(i) || i)))
  12398. }
  12399. for (e = e.firstChild; e; )
  12400. this.localizeTree(e),
  12401. e = e.nextSibling
  12402. }
  12403. ,
  12404. t.prototype.localizeText = function(e) {
  12405. var t = this[e];
  12406. return t || this.locale === o.EN_US || (a.warn("Localization key '" + e + "' not available for locale '" + this.locale + "', defaulting to English."),
  12407. t = s("./strings-en-US")[e]),
  12408. t || a.warn("Localization key '" + e + "' not available for locale 'en-US'"),
  12409. t
  12410. }
  12411. ,
  12412. l.exports = new t
  12413. }
  12414. ).call(this, "/js/localization/localize.js")
  12415. }
  12416. , {
  12417. "../enum/Locale": 31,
  12418. "../settings": 166,
  12419. "../util/common": 185,
  12420. "../util/logger": 189,
  12421. "./strings-cn-CN": 109,
  12422. "./strings-de-DE": 110,
  12423. "./strings-en-US": 111,
  12424. "./strings-es-MX": 112,
  12425. "./strings-fr-FR": 113,
  12426. "./strings-jp-JP": 114,
  12427. "./strings-ru-RU": 115
  12428. }],
  12429. 109: [function(e, t, i) {
  12430. "use strict";
  12431. t.exports = {
  12432. PAGE_TITLE: "",
  12433. LOADING: "正在加载",
  12434. PRESENTED_BY_CAPS: "呈现者:",
  12435. POWERED_BY: "技术支持:",
  12436. POWERED_BY_CAPS: "技术支持:",
  12437. DESKTOP_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  12438. MOBILE_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  12439. PRESENTED_BY: "呈现者:",
  12440. MORE: "更多 ",
  12441. LESS: "更少 ",
  12442. TAG_CONTENT: "tag™ 内容",
  12443. SHOW: "显示",
  12444. HIDE: "隐藏",
  12445. DOLLHOUSE: "场景屋",
  12446. FLOOR_PLAN: "楼层平面图",
  12447. OPEN_HIGHLIGHTS: "打开精彩片段",
  12448. CLOSE_HIGHLIGHTS: "关闭",
  12449. PREVIOUS: "上一个",
  12450. PLAY: "播放",
  12451. PAUSE: "暂停",
  12452. NEXT: "下一个",
  12453. EXPLORE_3D_SPACE: "探索 3D 空间",
  12454. VIEW_DOLLHOUSE: "观看场景屋",
  12455. SOCIAL_SHARING: "分享这个空间",
  12456. VIEW_IN_VR: "以 VR 观看",
  12457. VIEW_FULLSCREEN: "全屏观看",
  12458. EXIT_FULLSCREEN: " 退出全屏",
  12459. ZOOM_IN: "放大",
  12460. ZOOM_OUT: "缩小",
  12461. FLOOR_NAME: "楼层",
  12462. FLOOR_ALL: "ALL",
  12463. FLOOR_Lang: ["Floor", ""],
  12464. TERMS: "条款",
  12465. PORT_TERMS: "port 条款",
  12466. TERMS_OF_USE: "使用条款",
  12467. CLOSE_TERMS: "关闭",
  12468. TERMS_TEXT_FILE: "terms-cn-CN.html",
  12469. TERMS_FAIL: "无法获取条款。请确保您有互联网连接以查看使用条款。",
  12470. WEBVR_FOR_DAYDREAM: "用于 Daydream 视图",
  12471. WEBVR_ENTER_WEBVR: "进入 VR",
  12472. WEBVR_DIFFERENT_HEADSET: "有其他耳机吗?",
  12473. WEBVR_LEARN_MORE: "了解更多",
  12474. WEBVR_VIEW_SPACE: "在 VR 中观看空间",
  12475. WEBVR_DAYDREAM_VIEW: "Daydream 视图",
  12476. WEBVR_DAYDREAM_PHONE: "支持 Daydream 的手机",
  12477. WEBVR_FOR_CARDBOARD: "用于 Google Cardboard",
  12478. WEBVR_VIEW_CARDBOARD: "或在 Google Cardboard 上观看",
  12479. VR_VIEW_SPACE: "在虚拟现实中观看空间",
  12480. VR_LEARN_MORE_CAPS: "了解更多",
  12481. VR_PREVIOUS_CAPS: "上一个’,",
  12482. VR_NEXT_CAPS: "下一个",
  12483. VR_GOT_IT_CAPS: "明白了",
  12484. VR_SHOW_SUPPORTED: "点击以使用 VR 观看空间",
  12485. VR_SHOW_UNSUPPORTED: "很遗憾,您的设备不符合在 VR 中观看空间的最低要求。",
  12486. VR_SHOW_IOS_1: "点击以使用 VR 观看空间",
  12487. VR_SHOW_IOS_2: "需要有 port VR 应用程序和兼容的 iPhone 才能观看",
  12488. VR_WHAT_YOU_NEED: "关于...您需要什么",
  12489. VR_NEED_CARDBOARD: "您使用 Google Cardboard 时需要什么",
  12490. VR_NEED_SAMSUNG: "您使用 Samsung Gear VR 时需要什么",
  12491. VR_NEED_DAYDREAM: "需要事先与 DAYDREAM VIEW 配对",
  12492. VR_NEED_DAYDREAM_PHONE: "支持 Daydream 的手机",
  12493. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  12494. VR_GOOGLE_DAYDREAM: "Google Daydream",
  12495. VR_APP: "port VR 应用程序",
  12496. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  12497. VR_COMPATIBLE_IPHONES_1: "iPhones",
  12498. VR_COMPATIBLE_IPHONES_2: "iPhone 5s 和更高版本,运行 iOS 9.1 和更高版本",
  12499. VR_COMPATIBLE_IPHONES_3: "兼容的 iPhone",
  12500. VR_COMPATIBLE_ANDROID: "兼容的 Android 设备",
  12501. VR_COMPATIBLE_ANDROID_LONG: "4.5-5.5 英寸、运行 Android OS 4.4.4 和更高版本的兼容型 Android 设备显示屏",
  12502. VR_ANDROID_DETAIL: "4.5 至 5.5 英寸、运行 Android OS 4.4.4 和更高版本的显示屏",
  12503. VR_ANDROID_DVICES: "Android 设备",
  12504. VR_COMPATIBLE_SAMSUNG: "兼容的 Samsung 设备",
  12505. VR_SAMSUNG_DETAIL: "Galaxy S6 和更高版本",
  12506. VR_APP_FOR_CARDBOARD: "用于 Google Cardboard 的 port VR 应用程序",
  12507. VR_APP_FOR_SAMSUNG: "用于 Gear VR 的 port VR 应用程序",
  12508. VR_APP_FOR_ANDROID: "用于 Android 手机的 port VR 应用程序",
  12509. VR_APP_OPEN: "请使用 port VR 应用程序打开",
  12510. VR_DOWNLOAD_HERE: "在此下载",
  12511. VR_REQUIRE_HEADSET: "需要一副 VR 耳机并安装用于 Android 的 port VR 应用程序",
  12512. VR_REDIRECT_TO_STORE: "如果未安装应用程序,您将跳转到应用程序商店。",
  12513. VR_IMPROPER_EMBED: "port 空间未正确嵌入,无法在您的 Web 浏览器支持 VR。",
  12514. VR_OPEN_ANDROID_LINK: "在您的手机上打开链接",
  12515. VR_ANDROID_OPTIONS: "可用的 VR 耳机选项",
  12516. SHARE_TO: "分享到",
  12517. SHARE_LINK: "直接链接",
  12518. SHARE_EXPLORE: "探索",
  12519. SHARE_AT: "在",
  12520. SHARE_WITH: "使用",
  12521. SHARE_3D: "以 3D",
  12522. SHARE_COPIED: "已复制!",
  12523. ERROR_BROWSER_SOLUTION: "安装更新的浏览器以探索 3D。",
  12524. ERROR_BROWSER_EXPLANATION: "WebGL 需要现代的浏览器。",
  12525. ERROR_GENERIC_PROBLEM: "糟糕,出现问题。",
  12526. ERROR_GENERIC_SOLUTION: "重新启动您的浏览器。",
  12527. ERROR_GENERIC_ACTIONS_1: "如果问题仍然存在,",
  12528. ERROR_GENERIC_ACTIONS_2: "请安装支持的浏览器",
  12529. ERROR_GENERIC_ACTIONS_3: " 或",
  12530. ERROR_GENERIC_ACTIONS_4: "查看我们的故障排除指南",
  12531. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "浏览器不受支持。",
  12532. ERROR_WEBGL_IOS_PROBLEM: "iOS 版本不受支持。",
  12533. ERROR_WEBGL_IOS_SOLUTION: "升级到 iOS 8 或更高版本以在 3D 中探索。",
  12534. ERROR_WEBGL_IOS_ACTIONS_1: "点击 ",
  12535. ERROR_WEBGL_IOS_ACTIONS_2: "设置 > 通用 > 软件更新",
  12536. ERROR_WEBGL_SAFARI_PROBLEM: "启用 WebGL 以在 3D 中探索。",
  12537. ERROR_WEBGL_SAFARI_ACTIONS_1: "单击",
  12538. ERROR_WEBGL_SAFARI_ACTIONS_2: "菜单栏中的首选项 > 高级 > 显示开发菜单",
  12539. ERROR_WEBGL_SAFARI_ACTIONS_3: "然后单击",
  12540. ERROR_WEBGL_SAFARI_ACTIONS_4: "开发 > 启用 WebGL",
  12541. ERROR_MISSING_URLS_PROBLEM: "糟糕,没有此模型的全景。",
  12542. ERROR_MISSING_URLS_EXPLANATION: "这是较早的模型。网站所有者可能正在开发一种新模型。",
  12543. ERROR_LOADING_FAILED_PROBLEM: "糟糕,模式不可用。",
  12544. ERROR_LOADING_FAILED_ACTIONS_1: "如果问题仍然存在,",
  12545. ERROR_LOADING_FAILED_ACTIONS_2: "查看我们的故障排除指南",
  12546. ERROR_MAINTENANCE_PROBLEM: "正在进行维护",
  12547. ERROR_MAINTENANCE_SOLUTION: "请过几分钟再来。",
  12548. LINK_TO_LOCATION: "地点链接",
  12549. MENU_COPY: "复制",
  12550. LINK_ALERT_COPY: "请使用 CTRL/CMD + C 复制。",
  12551. ROTATE: "旋转",
  12552. MOVE: "移动",
  12553. INSIDE: "内部",
  12554. ZOOM: "缩放",
  12555. HELP: "小帮手",
  12556. HELP_NAVIGATION_TAB: "导航",
  12557. HELP_MORE_HELP_TAB: "更多帮助",
  12558. HELP_DESKTOP_PANORAMA_1A: "单击并拖动以环顾空间。",
  12559. HELP_DESKTOP_PANORAMA_2A: "单击整个空间内的圆环以四处移动。",
  12560. HELP_DESKTOP_PANORAMA_3A: "使用鼠标滚轮来放大和缩小。",
  12561. HELP_DESKTOP_PANORAMA_1B: "或者,使用箭头键向左向右转。",
  12562. HELP_DESKTOP_PANORAMA_2B: "或者,使用箭头键向前移动和向后移动。",
  12563. HELP_DESKTOP_PANORAMA_3B: "或者,使用加号和减号键来放大和缩小。",
  12564. HELP_DESKTOP_360_2A: "单击内部视图图标以进入空间。",
  12565. HELP_DESKTOP_360_2B: "或者,按 1 号键进入内部视图。 ",
  12566. HELP_DESKTOP_DOLLHOUSE_1A: "左键单击并向左、向右、向上和向下拖动以旋转场景屋。",
  12567. HELP_DESKTOP_DOLLHOUSE_2A: "右键单击并向左、向右、向上和向下拖动以改变场景屋在屏幕上的位置。",
  12568. HELP_DESKTOP_DOLLHOUSE_3A: "使用鼠标滚轮来放大和缩小。",
  12569. HELP_DESKTOP_DOLLHOUSE_1B: "或者,使用箭头键来旋转场景屋。",
  12570. HELP_DESKTOP_FLOORPLAN_1A: "左键单击并向左、向右、向上和向下拖动以改变楼层平面图在屏幕上的位置。",
  12571. HELP_DESKTOP_FLOORPLAN_2A: "右键单击并向左或向右拖动以旋转楼层平面图。",
  12572. HELP_DESKTOP_FLOORPLAN_3A: "使用鼠标滚轮来放大和缩小。",
  12573. HELP_DESKTOP_FLOORPLAN_2B: "或者,使用箭头键以向左或向右旋转。",
  12574. HELP_DESKTOP_FLOORPLAN_3B: "或者,使用箭头键来放大和缩小。",
  12575. HELP_MOBILE_PANORAMA_1: "触摸并拖动以环顾空间。",
  12576. HELP_MOBILE_PANORAMA_2: "点击整个空间内的圆环以四处移动。",
  12577. HELP_MOBILE_3: "使用捏合手势来放大和缩小。",
  12578. HELP_MOBILE_360_2: "点击内部视图图标以进入空间。",
  12579. HELP_MOBILE_DOLLHOUSE_1: "触摸并向上、向下、向左和向右拖动以旋转场景屋。",
  12580. HELP_MOBILE_DOLLHOUSE_2: "用两指触摸并拖动以定位场景屋。",
  12581. HELP_MOBILE_FLOORPLAN_1: "触摸并拖动以定位楼层平面图。",
  12582. HELP_MOBILE_FLOORPLAN_2: "用两指触摸并拖动以旋转楼层平面图。",
  12583. HELP_MORE_HLR_A: "精彩片段集锦",
  12584. HELP_DESKTOP_MORE_HLR_B: "打开以使用缩略图图像在空间中流览。",
  12585. HELP_MORE_DOLLHOUSE_A: "场景屋",
  12586. HELP_DESKTOP_MORE_DOLLHOUSE_B: "单击以查看和旋转 3D 内整个空间的俯视图。",
  12587. HELP_MOBILE_MORE_DOLLHOUSE_B: "点击以查看和旋转 3D 内整个空间的俯视图。",
  12588. HELP_MORE_FLOORS_A: "楼层选择器",
  12589. HELP_DESKTOP_MORE_FLOORS_B: "在空间中的楼层之间切换。",
  12590. HELP_MORE_TAG_A: "tag™ 贴文",
  12591. HELP_DESKTOP_MORE_TAG_B: "单击或悬停鼠标以查看空间中的功能信息。",
  12592. HELP_MOBILE_MORE_TAG_B: "点击以查看空间中的功能信息。",
  12593. HELP_MORE_ZOOM_A: "缩放控件",
  12594. HELP_DESKTOP_MORE_ZOOM_B: "使用这些控件来放大和缩小或使用滚轮。",
  12595. HELP_MORE_TOUR_A: "导览控件",
  12596. HELP_DESKTOP_MORE_TOUR_B: "通过导览播放、暂停以及向前和向后流览。",
  12597. HELP_MORE_INSIDE_A: "内部视图",
  12598. HELP_DESKTOP_MORE_INSIDE_B: "单击以探索空间内部。",
  12599. HELP_MOBILE_MORE_INSIDE_B: "点击以探索空间内部。",
  12600. HELP_MORE_VR_A: "VR 模式",
  12601. HELP_DESKTOP_MORE_VR_B: "单击以在虚拟现实中启动空间。",
  12602. HELP_MOBILE_MORE_VR_B: "点击以在虚拟现实中启动空间。",
  12603. HELP_MORE_360_A: "360° 视图",
  12604. HELP_DESKTOP_MORE_360_B: "单击精彩片段集锦中的 360 视图中以观看室外场景。",
  12605. HELP_MOBILE_MORE_360_B: "点击精彩片段集锦中的 360 视图中以观看室外场景。",
  12606. HELP_MORE_FULLSCREEN_A: "全屏",
  12607. HELP_DESKTOP_MORE_FULLSCREEN_B: "将 3D Showcase 扩展到全屏。",
  12608. CLOSE: "关闭"
  12609. }
  12610. }
  12611. , {}],
  12612. 110: [function(e, t, i) {
  12613. "use strict";
  12614. t.exports = {
  12615. PAGE_TITLE: "",
  12616. LOADING: "Lädt",
  12617. PRESENTED_BY_CAPS: "PRÄSENTIERT VON",
  12618. POWERED_BY: "Angetrieben von",
  12619. POWERED_BY_CAPS: "ANGETRIEBEN VON",
  12620. DESKTOP_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  12621. MOBILE_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  12622. PRESENTED_BY: "Präsentiert von ",
  12623. MORE: "Mehr ",
  12624. LESS: "Weniger ",
  12625. TAG_CONTENT: "tag™ Inhalt",
  12626. SHOW: "Anzeigen",
  12627. HIDE: "Verbergen",
  12628. DOLLHOUSE: "Puppenhaus",
  12629. FLOOR_PLAN: "Grundriss",
  12630. OPEN_HIGHLIGHTS: "Highlights anzeigen",
  12631. CLOSE_HIGHLIGHTS: "Schließen",
  12632. PREVIOUS: "Vorheriges",
  12633. PLAY: "Abspielen",
  12634. PAUSE: "Pausieren",
  12635. NEXT: "Nächstes",
  12636. EXPLORE_3D_SPACE: "Innenraum betreten",
  12637. VIEW_DOLLHOUSE: "Puppenhaus ansehen",
  12638. SOCIAL_SHARING: "Teilen Sie diesen Raum",
  12639. VIEW_IN_VR: "In VR ansehen",
  12640. VIEW_FULLSCREEN: "Ansicht im Vollbildmodus",
  12641. EXIT_FULLSCREEN: "Beenden des Vollbildmodus",
  12642. ZOOM_IN: "Vergrößern",
  12643. ZOOM_OUT: "Verkleinern",
  12644. FLOOR_NAME: "Etage ",
  12645. FLOOR_ALL: "Alle",
  12646. TERMS: "Bedingungen",
  12647. PORT_TERMS: "port Bedingungen",
  12648. TERMS_OF_USE: "Nutzungsbedingungen",
  12649. TERMS_TEXT_FILE: "terms-de-DE.html",
  12650. CLOSE_TERMS: "Schließen",
  12651. TERMS_FAIL: "Konnte die Nutzungsbedingungen nicht abrufen. Bitte stellen Sie sicher, dass Sie zum Internet verbunden sind.",
  12652. HELP: "Hilfe",
  12653. HELP_NAVIGATION_TAB: "Navigation",
  12654. HELP_MORE_HELP_TAB: "Hilfe-Details",
  12655. CLOSE: "Schließen",
  12656. HELP_DESKTOP_PANORAMA_1A: "Klicken und ziehen Sie um sich im Raum umzusehen.",
  12657. HELP_DESKTOP_PANORAMA_2A: "Klicken Sie auf die Ringe im Raum um sich zu bewegen.",
  12658. HELP_DESKTOP_PANORAMA_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12659. HELP_DESKTOP_PANORAMA_1B: "Oder verwenden Sie die Pfeiltasten um sich nach links und rechts zu bewegen.",
  12660. HELP_DESKTOP_PANORAMA_2B: "Oder verwenden Sie die Pfeiltasten um sich vorwärts und rückwärts zubewegen.",
  12661. HELP_DESKTOP_PANORAMA_3B: "Oder verwenden Sie die Plus- und Minus-Tasten zum Vergrößern und Verkleinern.",
  12662. HELP_DESKTOP_360_2A: "Klicken Sie die Innenansicht ikone, um diesen Raum zu starten .",
  12663. HELP_DESKTOP_360_2B: "Oder, drücken Sie die 1-Taste um die Innenraumansicht zu starten.",
  12664. HELP_DESKTOP_DOLLHOUSE_1A: "Klicken Sie mit der linken Maustaste und ziehen Sie nach links, rechts, oben und unten um das Puppenhaus zu drehen.",
  12665. 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.",
  12666. HELP_DESKTOP_DOLLHOUSE_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12667. HELP_DESKTOP_DOLLHOUSE_1B: "Oder verwenden Sie die Pfeiltasten um das Puppenhaus zu drehen.",
  12668. 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.",
  12669. HELP_DESKTOP_FLOORPLAN_2A: "Klicken Sie mit der rechten Maustaste und ziehen Sie nach links oder rechts um den Grundriss zu drehen.",
  12670. HELP_DESKTOP_FLOORPLAN_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12671. HELP_DESKTOP_FLOORPLAN_2B: "Oder verwenden Sie die Pfeiltasten um das Modell nach links oder rechts zu drehen.",
  12672. HELP_DESKTOP_FLOORPLAN_3B: "Oder verwenden Sie die Pfeiltasten zum Vergrößern und Verkleinern.",
  12673. HELP_MOBILE_PANORAMA_1: "Berühren und ziehen an dem Raum um sich umzusehen.",
  12674. HELP_MOBILE_PANORAMA_2: "Klicken Sie auf die Ringe im Raum, um sich zu bewegen.",
  12675. HELP_MOBILE_3: "Benutzen Sie die Zoom-Gäste zum Vergrößern und Verkleinern.",
  12676. HELP_MOBILE_360_2: "Tippen Sie die Innenansicht ikone, um diesen Raum zu starten.",
  12677. HELP_MOBILE_DOLLHOUSE_1: "Berühren und nach oben, unten, links und rechts ziehen um das Puppenhaus zu drehen.",
  12678. HELP_MOBILE_DOLLHOUSE_2: "Berühren und mit zwei Fingern ziehen um das Puppenhaus zu positionieren.",
  12679. HELP_MOBILE_FLOORPLAN_1: "Berühren und ziehen, um den Grundriss zu positionieren.",
  12680. HELP_MOBILE_FLOORPLAN_2: "Berühren und ziehen mit zwei Fingern, um den Grundriss zu drehen.",
  12681. HELP_MORE_HLR_A: "Liste das Highlight",
  12682. HELP_DESKTOP_MORE_HLR_B: "Öffnen um durch den Raum mit Vorschau-Bildern zu navigieren.",
  12683. HELP_MORE_DOLLHOUSE_A: "Puppenhaus Ansicht",
  12684. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Klicken Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  12685. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tippen Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  12686. HELP_MORE_FLOORS_A: "Etage auswählen",
  12687. HELP_DESKTOP_MORE_FLOORS_B: "Zwischen den Etagen im Raum wechseln.",
  12688. HELP_MORE_TAG_A: "tag™ Posts",
  12689. HELP_DESKTOP_MORE_TAG_B: "Klicken Sie auf oder bewegen Sie Ihren Mauszeiger über die Informationen über die Funktionen im Raum.",
  12690. HELP_MOBILE_MORE_TAG_B: "Tippen Sie für Informationen über die Funktionen im Raum.",
  12691. HELP_MORE_ZOOM_A: "Zoom Steuerung",
  12692. HELP_DESKTOP_MORE_ZOOM_B: "Verwenden Sie diese Steuerung oder das Scrollrad zum Vergrößern und Verkleinern.",
  12693. HELP_MORE_TOUR_A: "Tour Steuerung",
  12694. HELP_DESKTOP_MORE_TOUR_B: "Abspielen, pausieren und vorwärts und rückwärts durch eine geführte Tour navigieren.",
  12695. HELP_MORE_INSIDE_A: "Innenansicht",
  12696. HELP_DESKTOP_MORE_INSIDE_B: "Klicken Sie hier um sich im Raum umzusehen.",
  12697. HELP_MOBILE_MORE_INSIDE_B: "Sehen Sie sich in diesen 3D Raum um.",
  12698. HELP_MORE_VR_A: "VR Modus",
  12699. HELP_DESKTOP_MORE_VR_B: "Klicken Sie hier, um den Raum in der virtuellen Realität zu starten.",
  12700. HELP_MOBILE_MORE_VR_B: "Tippen Sie um den Raum in der virtuellen Realität zu starten.",
  12701. HELP_MORE_360_A: "360° Views Ansicht ",
  12702. HELP_DESKTOP_MORE_360_B: "Klicken Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  12703. HELP_MOBILE_MORE_360_B: "Tippen Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  12704. HELP_MORE_FULLSCREEN_A: "Vollbild",
  12705. HELP_DESKTOP_MORE_FULLSCREEN_B: "Erweitern Sie 3D Showcase im Vollbildmodus.",
  12706. WEBVR_FOR_CARDBOARD: "Für Google Cardboard",
  12707. WEBVR_FOR_DAYDREAM: "Für Daydream View",
  12708. WEBVR_ENTER_WEBVR: "Starten Sie VR",
  12709. WEBVR_DIFFERENT_HEADSET: "Haben Sie anderes Headset?",
  12710. WEBVR_LEARN_MORE: "Mehr Infos",
  12711. WEBVR_VIEW_SPACE: "Ansicht des Raumes in VR",
  12712. WEBVR_DAYDREAM_VIEW: "Daydream View",
  12713. WEBVR_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  12714. WEBVR_VIEW_CARDBOARD: "Oder mit Google Cardboard ansehen",
  12715. VR_WHAT_YOU_NEED: "Was Sie dafür brauchen...",
  12716. VR_NEED_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  12717. VR_GOOGLE_DAYDREAM: "Google Daydream",
  12718. VR_APP: "port VR App",
  12719. VR_APP_OPEN: "Oder öffnen Sie die port VR App",
  12720. 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",
  12721. VR_SAMSUNG_DETAIL: "Galaxy S6 und neuer",
  12722. VR_APP_FOR_ANDROID: "port VR app für Android",
  12723. VR_NEED_DAYDREAM: "ERFORDERT VOR DER 'PAIRING' MIT DAYDREAM VIEW",
  12724. VR_VIEW_SPACE: "Ansicht des Raumes in VR",
  12725. VR_LEARN_MORE_CAPS: "MEHR INFOS",
  12726. VR_PREVIOUS_CAPS: "ZURÜCK",
  12727. VR_NEXT_CAPS: "WEITER",
  12728. VR_GOT_IT_CAPS: "VERSTANDEN",
  12729. VR_SHOW_SUPPORTED: "Tippen Sie um den Raum in VR zu sehen",
  12730. VR_SHOW_UNSUPPORTED: "Schade, aber Ihr Gerät erfüllt nicht die Mindestanforderungen um den Raum in VR zu sehen.",
  12731. VR_SHOW_IOS_1: "Tippen Sie um den Raum in VR zu sehen",
  12732. VR_SHOW_IOS_2: "port VR App sowie kompatibles iPhone sind von nöten um diesen Raum zu sehen",
  12733. VR_NEED_CARDBOARD: "Was Sie dafür brauchen ist Google Cardboard",
  12734. VR_NEED_SAMSUNG: "Was Sie dafür brauchen ist Samsung Gear VR",
  12735. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  12736. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  12737. VR_COMPATIBLE_IPHONES_1: "iPhones",
  12738. VR_COMPATIBLE_IPHONES_2: "iPhone 5s oder neuer, mit iOS 9.1 und später",
  12739. VR_COMPATIBLE_IPHONES_3: "Kompatibles iPhones",
  12740. VR_COMPATIBLE_ANDROID: "Kompatibles Android Gerät",
  12741. VR_ANDROID_DETAIL: "Bildschirmdiagonale von 11,5 bis 14 cm (4,5 - 5,5 Zoll) und Android 4.4.4 und neuer",
  12742. VR_ANDROID_DVICES: "Android Geräte",
  12743. VR_COMPATIBLE_SAMSUNG: "Kompatible Samsung Geräte",
  12744. VR_APP_FOR_CARDBOARD: "port VR App für Google Cardboard",
  12745. VR_APP_FOR_SAMSUNG: "port VR App für Gear VR",
  12746. VR_DOWNLOAD_HERE: "Hier runterladen",
  12747. VR_REQUIRE_HEADSET: "Benötigt das ein VR-Headset und port VR App für Android installiert wird",
  12748. VR_REDIRECT_TO_STORE: "Wenn App nicht installiert ist, werden Sie zum App Store umgeleitet.",
  12749. VR_IMPROPER_EMBED: "Der port Raum ist nicht richtig eingebettet um VR in Ihrem Webbrowser zu unterstützen.",
  12750. VR_OPEN_ANDROID_LINK: "Öffnen Sie den Link auf Ihrem Handy",
  12751. VR_ANDROID_OPTIONS: "VR Headset Optionen",
  12752. SHARE_TO: "Teilen auf",
  12753. SHARE_LINK: "Direkter Link",
  12754. SHARE_EXPLORE: "Umsehen",
  12755. SHARE_AT: "auf",
  12756. SHARE_WITH: "mit",
  12757. SHARE_3D: "in 3D",
  12758. SHARE_COPIED: "Kopiert!",
  12759. ERROR_BROWSER_SOLUTION: "Installieren Sie einen neueren Browser um sich in 3D umzusehen.",
  12760. ERROR_BROWSER_EXPLANATION: "WebGL benötigt einen modernen Browser.",
  12761. ERROR_GENERIC_PROBLEM: "Huch, etwas ist schief gelaufen.",
  12762. ERROR_GENERIC_SOLUTION: "Starten Sie Ihren Browser neu.",
  12763. ERROR_GENERIC_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  12764. ERROR_GENERIC_ACTIONS_2: "Installieren Sie einen unterstützten Browser",
  12765. ERROR_GENERIC_ACTIONS_3: " oder ",
  12766. ERROR_GENERIC_ACTIONS_4: "Sehen Sie unseren Leitfaden zur Fehlerbehebung",
  12767. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser wird nicht unterstützt.",
  12768. ERROR_WEBGL_IOS_PROBLEM: "iOS-Version wird nicht unterstützt.",
  12769. ERROR_WEBGL_IOS_SOLUTION: "Aktualisieren Sie auf iOS 8 oder neuer um sich in 3D umzusehen.",
  12770. ERROR_WEBGL_IOS_ACTIONS_1: "Tippen ",
  12771. ERROR_WEBGL_IOS_ACTIONS_2: "Einstellungen > Allgemein > Softwareaktualisierung",
  12772. ERROR_WEBGL_SAFARI_PROBLEM: "Aktivieren Sie WebVR um sich in 3D umzusehen.",
  12773. ERROR_WEBGL_SAFARI_ACTIONS_1: "Klicken ",
  12774. ERROR_WEBGL_SAFARI_ACTIONS_2: "Präferenzen > Fortgeschrittene > Entwickler-Menü anzeigen",
  12775. ERROR_WEBGL_SAFARI_ACTIONS_3: "Klicken Sie dann ",
  12776. ERROR_WEBGL_SAFARI_ACTIONS_4: "Entwickler > WebGL Aktivieren",
  12777. ERROR_MISSING_URLS_PROBLEM: "Huch, es gibt keine Panoramen für dieses Modell .",
  12778. ERROR_MISSING_URLS_EXPLANATION: "Dies ist ein älteres Modell. Der Website-Besitzer hat eventuell ein neues Modell in Arbeit.",
  12779. ERROR_LOADING_FAILED_PROBLEM: "Huch, das Modell ist nicht verfügbar.",
  12780. ERROR_LOADING_FAILED_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  12781. ERROR_LOADING_FAILED_ACTIONS_2: "sehen Sie unseren Leitfaden zur Fehlerbehebung",
  12782. ERROR_MAINTENANCE_PROBLEM: "Wartung im Gange.",
  12783. ERROR_MAINTENANCE_SOLUTION: "Bitte versuchen Sie es in ein paar Minuten nochmal.",
  12784. LINK_TO_LOCATION: "Link zu",
  12785. MENU_COPY: "Kopieren",
  12786. LINK_ALERT_COPY: "Bitte benutzen Sie CTRL/CMD + C zum kopieren.",
  12787. ROTATE: "Drehen",
  12788. INSIDE: "Drinnen",
  12789. MOVE: "Bewegen",
  12790. ZOOM: "Vergrößern"
  12791. }
  12792. }
  12793. , {}],
  12794. 111: [function(e, t, i) {
  12795. "use strict";
  12796. t.exports = {
  12797. PAGE_TITLE: "",
  12798. LOADING: "Loading",
  12799. PRESENTED_BY_CAPS: "PRESENTED BY",
  12800. POWERED_BY: "powered by ",
  12801. POWERED_BY_CAPS: "POWERED BY",
  12802. DESKTOP_SHORT_CTA: "Click to explore this 3D space.",
  12803. MOBILE_SHORT_CTA: "Tap to explore this 3D space.",
  12804. PRESENTED_BY: "Presented by ",
  12805. MORE: "More ",
  12806. LESS: "Less ",
  12807. TAG_CONTENT: "tag™ Content",
  12808. SHOW: "Show",
  12809. HIDE: "Hide",
  12810. DOLLHOUSE: "Dollhouse",
  12811. FLOOR_PLAN: "Floor plan",
  12812. OPEN_HIGHLIGHTS: "Open Highlights",
  12813. CLOSE_HIGHLIGHTS: "Close",
  12814. PREVIOUS: "Previous",
  12815. PLAY: "Play",
  12816. PAUSE: "Pause",
  12817. NEXT: "Next",
  12818. EXPLORE_3D_SPACE: "Explore 3D Space",
  12819. VIEW_DOLLHOUSE: "View dollhouse",
  12820. SOCIAL_SHARING: "Share this Space",
  12821. VIEW_IN_VR: "View in VR",
  12822. VIEW_FULLSCREEN: "全屏",
  12823. EXIT_FULLSCREEN: "退出全屏",
  12824. ZOOM_IN: "Zoom in",
  12825. ZOOM_OUT: "Zoom out",
  12826. FLOOR_NAME: "Floor ",
  12827. FLOOR_ALL: "全部",
  12828. TERMS: "Terms",
  12829. PORT_TERMS: "port terms",
  12830. TERMS_OF_USE: "Terms of Use",
  12831. TERMS_TEXT_FILE: "terms-en-US.html",
  12832. CLOSE_TERMS: "Close",
  12833. TERMS_FAIL: "Could not fetch terms. Please make sure you have an internet connection to view the terms of use.",
  12834. HELP: "Help",
  12835. HELP_NAVIGATION_TAB: "Navigation",
  12836. HELP_MORE_HELP_TAB: "More Help",
  12837. CLOSE: "Close",
  12838. HELP_DESKTOP_PANORAMA_1A: "Click and Drag to look around the Space.",
  12839. HELP_DESKTOP_PANORAMA_2A: "Click on the rings throughout the space to move around.",
  12840. HELP_DESKTOP_PANORAMA_3A: "Use the scroll wheel to zoom in and out.",
  12841. HELP_DESKTOP_PANORAMA_1B: "Or, use the arrow keys to turn left and right.",
  12842. HELP_DESKTOP_PANORAMA_2B: "Or, use the arrow keys to move forward and back.",
  12843. HELP_DESKTOP_PANORAMA_3B: "Or, use the plus and minus keys to zoom in and out.",
  12844. HELP_DESKTOP_360_2A: "Click the Inside View icon to enter the Space.",
  12845. HELP_DESKTOP_360_2B: "Or, press the number 1 key to enter Inside View.",
  12846. HELP_DESKTOP_DOLLHOUSE_1A: "Left click and drag left, right, up, and down to rotate the Dollhouse.",
  12847. HELP_DESKTOP_DOLLHOUSE_2A: "Right click and drag left, right, up, and down to change the Dollhouse position on screen.",
  12848. HELP_DESKTOP_DOLLHOUSE_3A: "Use the scroll wheel to zoom in and out.",
  12849. HELP_DESKTOP_DOLLHOUSE_1B: "Or, use the arrow keys to rotate the Dollhouse.",
  12850. HELP_DESKTOP_FLOORPLAN_1A: "Left click and drag left, right, up, and down to change the Floorplan position on screen.",
  12851. HELP_DESKTOP_FLOORPLAN_2A: "Right click and drag left or right to rotate the Floorplan.",
  12852. HELP_DESKTOP_FLOORPLAN_3A: "Use the scroll wheel to zoom in and out.",
  12853. HELP_DESKTOP_FLOORPLAN_2B: "Or, use the arrow keys to rotate left or right.",
  12854. HELP_DESKTOP_FLOORPLAN_3B: "Or, use the arrow keys to zoom in and out.",
  12855. HELP_MOBILE_PANORAMA_1: "Touch and Drag to look around the Space.",
  12856. HELP_MOBILE_PANORAMA_2: "Tap on the rings throughout the Space to move around.",
  12857. HELP_MOBILE_3: "Use a pinch gesture to zoom in and out.",
  12858. HELP_MOBILE_360_2: "Tap the Inside View icon to enter the Space.",
  12859. HELP_MOBILE_DOLLHOUSE_1: "Touch and drag up, down, left, and right to rotate the Dollhouse.",
  12860. HELP_MOBILE_DOLLHOUSE_2: "Touch and drag with two fingers to position the Dollhouse.",
  12861. HELP_MOBILE_FLOORPLAN_1: "Touch and drag to position the Floorplan.",
  12862. HELP_MOBILE_FLOORPLAN_2: "Touch and drag with two fingers to rotate the Floorplan.",
  12863. HELP_MORE_HLR_A: "Highlight Reel",
  12864. HELP_DESKTOP_MORE_HLR_B: "Open to navigate through the Space using thumbnail images.",
  12865. HELP_MORE_DOLLHOUSE_A: "Dollhouse View",
  12866. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Click to view and rotate a top-down view of the entire Space in 3D.",
  12867. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tap to view and rotate a top-down view of the entire Space in 3D.",
  12868. HELP_MORE_FLOORS_A: "Floor Selector",
  12869. HELP_DESKTOP_MORE_FLOORS_B: "Switch between floors in the Space.",
  12870. HELP_MORE_TAG_A: "tag™ Posts",
  12871. HELP_DESKTOP_MORE_TAG_B: "Click or hover over for information about features in the Space.",
  12872. HELP_MOBILE_MORE_TAG_B: "Tap for information about features in the Space.",
  12873. HELP_MORE_ZOOM_A: "Zoom Controls",
  12874. HELP_DESKTOP_MORE_ZOOM_B: "Use these controls to zoom in and out or use the scroll wheel.",
  12875. HELP_MORE_TOUR_A: "Tour Controls",
  12876. HELP_DESKTOP_MORE_TOUR_B: "Play, pause, and navigate forward and backward through a Guided Tour.",
  12877. HELP_MORE_INSIDE_A: "Inside View",
  12878. HELP_DESKTOP_MORE_INSIDE_B: "Click to explore inside the Space.",
  12879. HELP_MOBILE_MORE_INSIDE_B: "Tap to explore inside the Space.",
  12880. HELP_MORE_VR_A: "VR Mode",
  12881. HELP_DESKTOP_MORE_VR_B: "Click to launch the Space in virtual reality.",
  12882. HELP_MOBILE_MORE_VR_B: "Tap to launch the Space in virtual reality.",
  12883. HELP_MORE_360_A: "360° Views",
  12884. HELP_DESKTOP_MORE_360_B: "Click 360 Views in the Highlight Reel to view outdoor scenes.",
  12885. HELP_MOBILE_MORE_360_B: "Tap 360 Views in the Highlight Reel to view outdoor scenes.",
  12886. HELP_MORE_FULLSCREEN_A: "Full screen",
  12887. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expand 3D Showcase to full screen.",
  12888. WEBVR_FOR_CARDBOARD: "For Google Cardboard",
  12889. WEBVR_VIEW_CARDBOARD: "Or View on Google Cardboard",
  12890. WEBVR_FOR_DAYDREAM: "For Daydream View",
  12891. WEBVR_ENTER_WEBVR: "ENTER VR",
  12892. WEBVR_DIFFERENT_HEADSET: "Have a different headset?",
  12893. WEBVR_LEARN_MORE: "Learn more",
  12894. WEBVR_VIEW_SPACE: "View Space in VR",
  12895. WEBVR_DAYDREAM_VIEW: "Daydream View",
  12896. WEBVR_DAYDREAM_PHONE: "Daydream-ready phone",
  12897. VR_VIEW_SPACE: "View Space in Virtual Reality",
  12898. VR_LEARN_MORE_CAPS: "LEARN MORE",
  12899. VR_PREVIOUS_CAPS: "PREVIOUS",
  12900. VR_NEXT_CAPS: "NEXT",
  12901. VR_GOT_IT_CAPS: "GOT IT",
  12902. VR_SHOW_SUPPORTED: "Tap to view the Space in VR with",
  12903. VR_SHOW_UNSUPPORTED: "Sorry, but your device doesn't meet the minimum requirements to view a space in VR.",
  12904. VR_SHOW_IOS_1: "Tap to view the space in VR",
  12905. VR_SHOW_IOS_2: "Requires port VR app and compatible iPhone to view",
  12906. VR_WHAT_YOU_NEED: "What You'll Need For...",
  12907. VR_NEED_CARDBOARD: "What you'll need with Google Cardboard",
  12908. VR_NEED_SAMSUNG: "What you'll need with Samsung Gear VR",
  12909. VR_NEED_DAYDREAM: "NEEDS PRIOR PAIRING WITH DAYDREAM VIEW",
  12910. VR_NEED_DAYDREAM_PHONE: "Daydream-ready phone",
  12911. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  12912. VR_GOOGLE_DAYDREAM: "Google Daydream",
  12913. VR_APP: "port VR App",
  12914. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  12915. VR_COMPATIBLE_IPHONES_1: "iPhones",
  12916. VR_COMPATIBLE_IPHONES_2: "iPhone 5s and newer, running iOS 9.1 and higher",
  12917. VR_COMPATIBLE_IPHONES_3: "Compatible iPhones",
  12918. VR_COMPATIBLE_ANDROID: "Compatible Android Devices",
  12919. VR_COMPATIBLE_ANDROID_LONG: 'Compatible Android Devices Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  12920. VR_ANDROID_DETAIL: 'Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  12921. VR_ANDROID_DVICES: "Android Devices",
  12922. VR_COMPATIBLE_SAMSUNG: "Compatible Samsung Devices",
  12923. VR_SAMSUNG_DETAIL: "Galaxy S6 and Above",
  12924. VR_APP_FOR_CARDBOARD: "port VR app for Google Cardboard",
  12925. VR_APP_FOR_SAMSUNG: "port VR app for Gear VR",
  12926. VR_APP_FOR_ANDROID: "port VR app for Android Phones",
  12927. VR_APP_OPEN: "Open with the port VR app instead",
  12928. VR_DOWNLOAD_HERE: "Download here",
  12929. VR_REQUIRE_HEADSET: "Requires a VR headset and port VR app for Android to be installed",
  12930. VR_REDIRECT_TO_STORE: "If app is not installed, you will be redirected to the app store.",
  12931. VR_IMPROPER_EMBED: "The port Space is not embedded properly to support VR in your web browser.",
  12932. VR_OPEN_ANDROID_LINK: "Open the Link on Your Mobile Phone",
  12933. VR_ANDROID_OPTIONS: "Available VR Headset Options",
  12934. SHARE_TO: "Share to",
  12935. SHARE_LINK: "Direct Link",
  12936. SHARE_EXPLORE: "Explore ",
  12937. SHARE_AT: "at",
  12938. SHARE_WITH: "with",
  12939. SHARE_3D: " in 3D",
  12940. SHARE_COPIED: "Copied!",
  12941. ERROR_BROWSER_SOLUTION: "Install a new browser to explore in 3D.",
  12942. ERROR_BROWSER_EXPLANATION: "WebGL requires a modern browser.",
  12943. ERROR_GENERIC_PROBLEM: "Oops, something went wrong.",
  12944. ERROR_GENERIC_SOLUTION: "Restart your browser.",
  12945. ERROR_GENERIC_ACTIONS_1: "If the problem persists, ",
  12946. ERROR_GENERIC_ACTIONS_2: "install a supported browser",
  12947. ERROR_GENERIC_ACTIONS_3: " or ",
  12948. ERROR_GENERIC_ACTIONS_4: "see our troubleshooting guide",
  12949. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser not supported.",
  12950. ERROR_WEBGL_IOS_PROBLEM: "iOS version not supported.",
  12951. ERROR_WEBGL_IOS_SOLUTION: "Upgrade to iOS 8 or higher to explore in 3D.",
  12952. ERROR_WEBGL_IOS_ACTIONS_1: "Tap ",
  12953. ERROR_WEBGL_IOS_ACTIONS_2: "Settings > General > Software Update",
  12954. ERROR_WEBGL_SAFARI_PROBLEM: "Enable WebGL to explore in 3D.",
  12955. ERROR_WEBGL_SAFARI_ACTIONS_1: "Click ",
  12956. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferences > Advanced > Show Develop menu",
  12957. ERROR_WEBGL_SAFARI_ACTIONS_3: "Then click ",
  12958. ERROR_WEBGL_SAFARI_ACTIONS_4: "Develop > Enable WebGL",
  12959. ERROR_MISSING_URLS_PROBLEM: "Oops, there are no panoramas for this model.",
  12960. ERROR_MISSING_URLS_EXPLANATION: "This is an older model. The website owner may have a new model on the way.",
  12961. ERROR_LOADING_FAILED_PROBLEM: "模型不可用.",
  12962. ERROR_LOADING_FAILED_ACTIONS_1: "If the problem persists, ",
  12963. ERROR_LOADING_FAILED_ACTIONS_2: "see our troubleshooting guide",
  12964. ERROR_MAINTENANCE_PROBLEM: "Maintenance in progress.",
  12965. ERROR_MAINTENANCE_SOLUTION: "Please come back in a few minutes.",
  12966. LINK_TO_LOCATION: "Link to location",
  12967. MENU_COPY: "Copy",
  12968. LINK_ALERT_COPY: "Please use CTRL/CMD + C to copy.",
  12969. ROTATE: "Rotate",
  12970. INSIDE: "Inside",
  12971. MOVE: "Move",
  12972. ZOOM: "Zoom"
  12973. }
  12974. }
  12975. , {}],
  12976. 112: [function(e, t, i) {
  12977. "use strict";
  12978. t.exports = {
  12979. PAGE_TITLE: "",
  12980. LOADING: "Cargando",
  12981. PRESENTED_BY_CAPS: "PRESENTADO POR",
  12982. POWERED_BY: "potenciando por ",
  12983. POWERED_BY_CAPS: "POTENCIADO POR ",
  12984. DESKTOP_SHORT_CTA: "Haga clic para explorar este Espacio 3D.",
  12985. MOBILE_SHORT_CTA: "Pulse para explorar este Espacio 3D.",
  12986. PRESENTED_BY: "Presentado por ",
  12987. MORE: "Más ",
  12988. LESS: "Menos ",
  12989. TAG_CONTENT: "Contenido de tag™",
  12990. SHOW: "Mostrar",
  12991. HIDE: "Ocultar",
  12992. DOLLHOUSE: "Dollhouse",
  12993. FLOOR_PLAN: "Planos",
  12994. OPEN_HIGHLIGHTS: "Aspectos Destacados",
  12995. CLOSE_HIGHLIGHTS: "Cerrar",
  12996. PREVIOUS: "Anterior",
  12997. PLAY: "Play",
  12998. PAUSE: "Pausa",
  12999. NEXT: "Siguiente",
  13000. EXPLORE_3D_SPACE: "Explorar el Espacio 3D",
  13001. VIEW_DOLLHOUSE: "Ver dollhouse",
  13002. SOCIAL_SHARING: "Compartir este espacio",
  13003. VIEW_IN_VR: "Ver en realidad virtual",
  13004. VIEW_FULLSCREEN: "Ver en pantalla completa",
  13005. EXIT_FULLSCREEN: "Salir de pantalla completa",
  13006. ZOOM_IN: "Acercar",
  13007. ZOOM_OUT: "Alejar",
  13008. FLOOR_NAME: "Piso ",
  13009. FLOOR_ALL: "Todas",
  13010. TERMS: "Condiciones",
  13011. PORT_TERMS: "port términos de uso",
  13012. TERMS_OF_USE: "Términos de uso",
  13013. TERMS_TEXT_FILE: "terms-es-MX.html",
  13014. CLOSE_TERMS: "Cerrar",
  13015. 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.",
  13016. HELP: "Ayuda",
  13017. HELP_NAVIGATION_TAB: "Navegación",
  13018. HELP_MORE_HELP_TAB: "Más Ayuda",
  13019. CLOSE: "Cerrar",
  13020. HELP_DESKTOP_PANORAMA_1A: "Haga clic y arrastre para mirar alrededor del espacio.",
  13021. HELP_DESKTOP_PANORAMA_2A: "Haga clic en los aros a lo largo del espacio para moverse.",
  13022. HELP_DESKTOP_PANORAMA_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13023. HELP_DESKTOP_PANORAMA_1B: "O use las teclas de flecha para girar a la izquierda y a la derecha.",
  13024. HELP_DESKTOP_PANORAMA_2B: "O use las teclas de dirección para adelantar o retroceder.",
  13025. HELP_DESKTOP_PANORAMA_3B: "O use la tecla más para acercar y la tecla menos para alejar.",
  13026. HELP_DESKTOP_360_2A: "Haga clic en el icono Vista Interior para ingresar al Espacio.",
  13027. HELP_DESKTOP_360_2B: "O bien, presione la tecla numero 1 para entrar en la Vista Interior.",
  13028. HELP_DESKTOP_DOLLHOUSE_1A: "Haga clic izquierdo y arrastre hacia la izquierda, derecha, arriba o abajo para girar la Dollhouse.",
  13029. HELP_DESKTOP_DOLLHOUSE_2A: "Haga clic derecho y arrastre hacia la izquierda, derecha, arriba o abajo para cambiar la posición della dollhouse.",
  13030. HELP_DESKTOP_DOLLHOUSE_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13031. HELP_DESKTOP_DOLLHOUSE_1B: "O use las teclas de dirección para girar la Dollhouse.",
  13032. 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.",
  13033. HELP_DESKTOP_FLOORPLAN_2A: "Haga clic derecho y arrastre hacia la izquierda o derecha para girar la planta.",
  13034. HELP_DESKTOP_FLOORPLAN_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13035. HELP_DESKTOP_FLOORPLAN_2B: "O use las teclas para girar hacia la izquierda o derecha.",
  13036. HELP_DESKTOP_FLOORPLAN_3B: "O use las teclas de dirección para acercar o alejar.",
  13037. HELP_MOBILE_PANORAMA_1: "Toque y arrastre para mirar alrededor del espacio.",
  13038. HELP_MOBILE_PANORAMA_2: "Toque en los aros a lo largo del espacio para moverse.",
  13039. HELP_MOBILE_3: "Use el gesto de pellizcar para acercar o alejar.",
  13040. HELP_MOBILE_360_2: "Toque el ícono Vista Interior para entrar en el Espacio.",
  13041. HELP_MOBILE_DOLLHOUSE_1: "Toque y arrastre con dos dedos para cambiar la posición della dollhouse.",
  13042. HELP_MOBILE_DOLLHOUSE_2: "Toque y arrastre con dos dedos para cambiar la posición de la vista aérea.",
  13043. HELP_MOBILE_FLOORPLAN_1: "Toque y arrastre para cambiar la posición de la planta.",
  13044. HELP_MOBILE_FLOORPLAN_2: "Toque y arrastre con dos dedos para girar la planta.",
  13045. HELP_MORE_HLR_A: "Galería destacada",
  13046. HELP_DESKTOP_MORE_HLR_B: "Abra para navegar a través del espacio utilizando imágenes en miniatura.",
  13047. HELP_MORE_DOLLHOUSE_A: "Vista aérea por pisos",
  13048. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Haga clic para ver y girar la Dollhouse del espacio completo en 3D.",
  13049. HELP_MOBILE_MORE_DOLLHOUSE_B: "Toque para ver y girar la vista Dollhouse del espacio completo en 3D.",
  13050. HELP_MORE_FLOORS_A: "Seleccionador de plantas",
  13051. HELP_DESKTOP_MORE_FLOORS_B: "Cambie de una planta a otra en el espacio.",
  13052. HELP_MORE_TAG_A: "tag™ Posts",
  13053. HELP_DESKTOP_MORE_TAG_B: "Haga clic o coloque el cursor para obtener más información acerca de las características del espacio.",
  13054. HELP_MOBILE_MORE_TAG_B: "Toque para obtener más información acerca de las características del espacio.",
  13055. HELP_MORE_ZOOM_A: "Controles de zoom",
  13056. HELP_DESKTOP_MORE_ZOOM_B: "Use estos controles o la rueda de desplazamiento para acercar o alejar.",
  13057. HELP_MORE_TOUR_A: "Controles de recorrido",
  13058. HELP_DESKTOP_MORE_TOUR_B: "Reproduzca, pause, adelante o retroceda a través de un recorrido guiado.",
  13059. HELP_MORE_INSIDE_A: "Vista interior",
  13060. HELP_DESKTOP_MORE_INSIDE_B: "Haga clic para explorar el interior del espacio.",
  13061. HELP_MOBILE_MORE_INSIDE_B: "Toque para explorar el interior del espacio.",
  13062. HELP_MORE_VR_A: "Modo de realidad virtual",
  13063. HELP_DESKTOP_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13064. HELP_MOBILE_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13065. HELP_MORE_360_A: "360° Views",
  13066. HELP_DESKTOP_MORE_360_B: "Una vez que se encuentre en galería destacada, haga clic en vistas de 360º para ver el exterior.",
  13067. HELP_MOBILE_MORE_360_B: "Una vez que se encuentre en galería destacada, toque en vistas de 360º para ver el exterior.",
  13068. HELP_MORE_FULLSCREEN_A: "Pantalla completa",
  13069. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expanda el escenario 3D para verlo en pantalla completa.",
  13070. WEBVR_FOR_CARDBOARD: "Para Google Cardboard",
  13071. WEBVR_FOR_DAYDREAM: "Para Daydream View",
  13072. WEBVR_ENTER_WEBVR: "ENTRAR VR",
  13073. WEBVR_DIFFERENT_HEADSET: "¿Tiene un auricular diferente?",
  13074. WEBVR_LEARN_MORE: "Más información",
  13075. WEBVR_VIEW_SPACE: "Ver Espacio en VR",
  13076. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13077. WEBVR_DAYDREAM_PHONE: "Daydream Teléfono listos",
  13078. WEBVR_VIEW_CARDBOARD: "O Ver en Google Cardboard",
  13079. VR_NEED_DAYDREAM: "Necesidades antes de acoplarse con Daydream View",
  13080. VR_NEED_DAYDREAM_PHONE: "Teléfono listo para Daydream",
  13081. VR_GOOGLE_DAYDREAM: "Daydream de Google",
  13082. VR_APP: "port VR App",
  13083. VR_COMPATIBLE_ANDROID_LONG: 'Compatible con los Dispositivos Android con Pantallas de 4.5"-5.5" operando Android OS 4.4.4 y posteriores',
  13084. VR_APP_FOR_ANDROID: "Aplicación port VR para Teléfonos Android",
  13085. VR_APP_OPEN: "Abrir con la aplicación port VR en su lugar",
  13086. VR_VIEW_SPACE: "Ver Espacio en realidad virtual",
  13087. VR_LEARN_MORE_CAPS: "SABER MÁS",
  13088. VR_PREVIOUS_CAPS: "ANTERIOR",
  13089. VR_NEXT_CAPS: "SIGUIENTE",
  13090. VR_GOT_IT_CAPS: "COMPRENDIDO",
  13091. VR_SHOW_SUPPORTED: "Pulse para ver el Espacio en realidad virtual con",
  13092. VR_SHOW_UNSUPPORTED: "Lo sentimos, pero su dispositivo no cumple los requisitos mínimos para ver un Espacio en realidad virtual.",
  13093. VR_SHOW_IOS_1: "Pulse para ver el Espacio en realidad virtual",
  13094. VR_SHOW_IOS_2: "Necesita la aplicación port VR y un iPhone compatible para ver",
  13095. VR_WHAT_YOU_NEED: "Lo que necesitaras...",
  13096. VR_NEED_CARDBOARD: "Lo que necesitaras con Google Cardboard",
  13097. VR_NEED_SAMSUNG: "Lo que necesitaras con el Samsung Gear VR",
  13098. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13099. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13100. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13101. VR_COMPATIBLE_IPHONES_2: "Compatible con iPhone 6S o superior y con iOS 9.1 en adelante",
  13102. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13103. VR_COMPATIBLE_ANDROID: "Dispositivos Android compatibles",
  13104. VR_ANDROID_DETAIL: "Pantallas de 11.43 cm a 13.97 cm con OS de Android 4.4.4 en adelante",
  13105. VR_ANDROID_DVICES: "Dispositivos Android",
  13106. VR_COMPATIBLE_SAMSUNG: "Dispositivos compatibles del Samsung",
  13107. VR_SAMSUNG_DETAIL: "Galaxy S5 en adelante",
  13108. VR_APP_FOR_CARDBOARD: "Aplicación port VR para Google Cardboard",
  13109. VR_APP_FOR_SAMSUNG: "Aplicación port VR para Gear VR",
  13110. VR_DOWNLOAD_HERE: "Descargar aquí",
  13111. VR_REQUIRE_HEADSET: "Necesita un casco de realidad virtual y que se instale la aplicación port VR para Android",
  13112. VR_REDIRECT_TO_STORE: "Si la aplicación no está instalada, se le redirigirá a la tienda de aplicaciones.",
  13113. VR_IMPROPER_EMBED: "El espacio de port no está incorporado correctamente para apoyar VR en su navegador web.",
  13114. VR_OPEN_ANDROID_LINK: "Abre el enlace en tu teléfono móvil",
  13115. VR_ANDROID_OPTIONS: "Opciones de auriculares en RV disponibles",
  13116. SHARE_TO: "Compartir en",
  13117. SHARE_LINK: "Enlace directo",
  13118. SHARE_EXPLORE: "Explorar ",
  13119. SHARE_AT: "en",
  13120. SHARE_WITH: "con",
  13121. SHARE_3D: " en 3D",
  13122. SHARE_COPIED: "¡Copiado!",
  13123. ERROR_BROWSER_SOLUTION: "Instale un nuevo navegador para explorar en 3D.",
  13124. ERROR_BROWSER_EXPLANATION: "WebGL requiere un navegador moderno.",
  13125. ERROR_GENERIC_PROBLEM: "Vaya, algo ha ido mal.",
  13126. ERROR_GENERIC_SOLUTION: "Reinicie su navegador.",
  13127. ERROR_GENERIC_ACTIONS_1: "Si el problema persiste, ",
  13128. ERROR_GENERIC_ACTIONS_2: "instale un navegador compatible",
  13129. ERROR_GENERIC_ACTIONS_3: " o ",
  13130. ERROR_GENERIC_ACTIONS_4: "consulte nuestra guía de solución de problemas",
  13131. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navegador no compatible.",
  13132. ERROR_WEBGL_IOS_PROBLEM: "Versión de iOS no compatible.",
  13133. ERROR_WEBGL_IOS_SOLUTION: "Actualice a iOS 8 o superior para explorar en 3D.",
  13134. ERROR_WEBGL_IOS_ACTIONS_1: "Pulse ",
  13135. ERROR_WEBGL_IOS_ACTIONS_2: "Ajustes > General > Actualización de software",
  13136. ERROR_WEBGL_SAFARI_PROBLEM: "Habilite WebGL para explorar en 3D.",
  13137. ERROR_WEBGL_SAFARI_ACTIONS_1: "Haga clic en ",
  13138. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferencias > Avanzado > Mostrar el menú Desarrollar",
  13139. ERROR_WEBGL_SAFARI_ACTIONS_3: "Después, haga clic en ",
  13140. ERROR_WEBGL_SAFARI_ACTIONS_4: "Desarrollar > Habilitar WebGL",
  13141. ERROR_MISSING_URLS_PROBLEM: "Vaya, no hay panoramas para este modelo.",
  13142. ERROR_MISSING_URLS_EXPLANATION: "Este es un modelo antiguo. El propietario del sitio web puede tener un nuevo modelo en mente.",
  13143. ERROR_LOADING_FAILED_PROBLEM: "Vaya, modelo no disponible.",
  13144. ERROR_LOADING_FAILED_ACTIONS_1: "Si el problema persiste, ",
  13145. ERROR_LOADING_FAILED_ACTIONS_2: "consulte nuestra guía de solución de problemas",
  13146. ERROR_MAINTENANCE_PROBLEM: "Mantenimiento en progreso.",
  13147. ERROR_MAINTENANCE_SOLUTION: "Regrese en unos minutos.",
  13148. LINK_TO_LOCATION: "Enlace a la ubicación",
  13149. MENU_COPY: "Copiar",
  13150. LINK_ALERT_COPY: "Utilice CTRL/CMD + C para copiar.",
  13151. ROTATE: "Girar",
  13152. INSIDE: "Interior",
  13153. MOVE: "Moverse",
  13154. ZOOM: "Acercar o alejar"
  13155. }
  13156. }
  13157. , {}],
  13158. 113: [function(e, t, i) {
  13159. "use strict";
  13160. t.exports = {
  13161. PAGE_TITLE: "",
  13162. LOADING: "Chargement",
  13163. PRESENTED_BY_CAPS: "PRÉSENTÉ PAR",
  13164. POWERED_BY: "alimenté par ",
  13165. POWERED_BY_CAPS: "ALIMENTÉ PAR",
  13166. DESKTOP_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13167. MOBILE_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13168. PRESENTED_BY: "Présenté par ",
  13169. MORE: "Plus ",
  13170. LESS: "Moins ",
  13171. TAG_CONTENT: "Contenu tag™",
  13172. SHOW: "Montrer",
  13173. HIDE: "Cacher",
  13174. DOLLHOUSE: "Dollhouse",
  13175. FLOOR_PLAN: "Plan de sol",
  13176. OPEN_HIGHLIGHTS: "Ouvrir les faits saillants",
  13177. CLOSE_HIGHLIGHTS: "Fermer",
  13178. PREVIOUS: "Précédent",
  13179. PLAY: "Lecture",
  13180. PAUSE: "Pause",
  13181. NEXT: "Suivant",
  13182. EXPLORE_3D_SPACE: "Explorer l'Espace en 3D",
  13183. VIEW_DOLLHOUSE: "Voir dollhouse",
  13184. SOCIAL_SHARING: "Partager cet espace",
  13185. VIEW_IN_VR: "Voir en VR",
  13186. VIEW_FULLSCREEN: "Plein écran",
  13187. EXIT_FULLSCREEN: "Fermer plein écran",
  13188. ZOOM_IN: "Zoom avant",
  13189. ZOOM_OUT: "Zoom arrière",
  13190. FLOOR_NAME: "Étage ",
  13191. FLOOR_ALL: "Tous",
  13192. TERMS: "Mentions légales",
  13193. PORT_TERMS: "port mentions légales",
  13194. TERMS_OF_USE: "Conditions d'utilisation",
  13195. TERMS_TEXT_FILE: "terms-fr-FR.html",
  13196. CLOSE_TERMS: "Fermer",
  13197. TERMS_FAIL: "Impossible d'accéder aux mentions légales. Vérifiez que vous avez une connexion Internet pour afficher les conditions d'utilisation.",
  13198. HELP: "Aide",
  13199. HELP_NAVIGATION_TAB: "Navigation",
  13200. HELP_MORE_HELP_TAB: "Aide",
  13201. CLOSE: "Fermer",
  13202. HELP_DESKTOP_PANORAMA_1A: "Cliquez et faites glisser pour regarder autour de l’espace.",
  13203. HELP_DESKTOP_PANORAMA_2A: "Cliquez sur les anneaux pour vous déplacer.",
  13204. HELP_DESKTOP_PANORAMA_3A: "Utilisez la molette de votre souris pour zoomer.",
  13205. HELP_DESKTOP_PANORAMA_1B: "Ou utilisez les touches pour tourner.",
  13206. HELP_DESKTOP_PANORAMA_2B: "Ou utilisez les touches pour avancer et reculer.",
  13207. HELP_DESKTOP_PANORAMA_3B: "Ou utilisez les touches plus et moins pour zoomer.",
  13208. HELP_DESKTOP_360_2A: "Cliquez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13209. HELP_DESKTOP_360_2B: "Ou, appuyez sur la touche numéro 1 pour entrer dans la Vue Intérieure.",
  13210. HELP_DESKTOP_DOLLHOUSE_1A: "Faites un clic gauche et bougez votre souris pour faire pivoter la vue Dollhouse.",
  13211. HELP_DESKTOP_DOLLHOUSE_2A: "Faites un clic droit et bougez votre souris pour changer la position de la vue Dollhouse.",
  13212. HELP_DESKTOP_DOLLHOUSE_3A: "Utilisez la molette de votre souris pour zoomer.",
  13213. HELP_DESKTOP_DOLLHOUSE_1B: "Ou utilisez les touches pour faire pivoter la vue Dollhouse.",
  13214. HELP_DESKTOP_FLOORPLAN_1A: "Faites un clic droit pour changer la position du plan sur l’écran.",
  13215. HELP_DESKTOP_FLOORPLAN_2A: "Faites un clic droit et faites glisser à gauche ou à droite pour faire pivoter le plan.",
  13216. HELP_DESKTOP_FLOORPLAN_3A: "Utilisez la molette de votre souris pour zoomer.",
  13217. HELP_DESKTOP_FLOORPLAN_2B: "Ou utilisez les touches pour faire pivoter à gauche ou à droite.",
  13218. HELP_DESKTOP_FLOORPLAN_3B: "Ou utilisez les touches pour effectuer un zoom avant ou arrière.",
  13219. HELP_MOBILE_PANORAMA_1: "Touchez et faites glisser pour regarder autour de l’espace.",
  13220. HELP_MOBILE_PANORAMA_2: "Tapez sur les anneaux dans tout l’espace pour vous déplacer.",
  13221. HELP_MOBILE_3: "Utilisez un geste de pincement pour zoomer avant/arrière.",
  13222. HELP_MOBILE_360_2: "Tapez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13223. HELP_MOBILE_DOLLHOUSE_1: "Touchez et faites glisser vers le haut/bas/gauche/droite pour faire pivoter la vue Dollhouse.",
  13224. HELP_MOBILE_DOLLHOUSE_2: "Touchez et faites glisser avec deux doigts pour positionner vue en coupe.",
  13225. HELP_MOBILE_FLOORPLAN_1: "Touchez et faites glisser pour positionner le plan.",
  13226. HELP_MOBILE_FLOORPLAN_2: "Touchez et faites glisser avec deux doigts pour faire pivoter le plan.",
  13227. HELP_MORE_HLR_A: "Carrousel",
  13228. HELP_DESKTOP_MORE_HLR_B: "Ouvrez pour naviguer dans l’espace en utilisant les vignettes.",
  13229. HELP_MORE_DOLLHOUSE_A: "Vue en coupe",
  13230. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Cliquez pour afficher et faire pivoter l’espace entier en 3D.",
  13231. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tapez pour afficher et faire pivoter l’espace entier en 3D.",
  13232. HELP_MORE_FLOORS_A: "Sélecteur d’étage",
  13233. HELP_DESKTOP_MORE_FLOORS_B: "Basculer entre les étages dans l’espace.",
  13234. HELP_MORE_TAG_A: "tag™ Posts",
  13235. HELP_DESKTOP_MORE_TAG_B: "Cliquez ou survolez pour obtenir des informations sur l’espace.",
  13236. HELP_MOBILE_MORE_TAG_B: "Tapez pour obtenir des informations sur l’espace.",
  13237. HELP_MORE_ZOOM_A: "Commandes de zoom",
  13238. HELP_DESKTOP_MORE_ZOOM_B: "Utilisez votre clavier ou la molette de votre souris pour zoomer.",
  13239. HELP_MORE_TOUR_A: "Commandes de la visite",
  13240. HELP_DESKTOP_MORE_TOUR_B: "Mettez en marche ou en pause, avancez et reculez lors d'une visite guidée.",
  13241. HELP_MORE_INSIDE_A: "Vue intérieure",
  13242. HELP_DESKTOP_MORE_INSIDE_B: "Cliquez pour explorer l’intérieur de l’espace.",
  13243. HELP_MOBILE_MORE_INSIDE_B: "Tapez pour explorer l’intérieur de l’espace.",
  13244. HELP_MORE_VR_A: "Mode RV",
  13245. HELP_DESKTOP_MORE_VR_B: "Cliquez pour lancer l’espace en réalité virtuelle.",
  13246. HELP_MOBILE_MORE_VR_B: "Tapez pour lancer l’espace en réalité virtuelle.",
  13247. HELP_MORE_360_A: "Vues 360°",
  13248. HELP_DESKTOP_MORE_360_B: "Cliquez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13249. HELP_MOBILE_MORE_360_B: "Tapez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13250. HELP_MORE_FULLSCREEN_A: "Plein écran",
  13251. HELP_DESKTOP_MORE_FULLSCREEN_B: "Voir 3D Showcase en plein écran.",
  13252. WEBVR_FOR_CARDBOARD: "Pour Google Cardboard",
  13253. WEBVR_FOR_DAYDREAM: "Pour Daydream View",
  13254. WEBVR_ENTER_WEBVR: "ENTRER VR",
  13255. WEBVR_DIFFERENT_HEADSET: "Avez-vous un casque différent?",
  13256. WEBVR_LEARN_MORE: "En savoir plus",
  13257. WEBVR_VIEW_SPACE: "Voir Espace en VR",
  13258. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13259. WEBVR_DAYDREAM_PHONE: "Téléphone compatibles Daydream",
  13260. WEBVR_VIEW_CARDBOARD: "Ou Afficher sur Google Cardboard",
  13261. VR_VIEW_SPACE: "Voir l'Espace en Réalité Virtuelle",
  13262. VR_LEARN_MORE_CAPS: "EN SAVOIR PLUS",
  13263. VR_PREVIOUS_CAPS: "PRÉCÉDENT",
  13264. VR_NEXT_CAPS: "SUIVANT",
  13265. VR_GOT_IT_CAPS: "BIEN COMPRIS",
  13266. VR_SHOW_SUPPORTED: "Taper pour voir l'Espace en VR avec",
  13267. VR_SHOW_UNSUPPORTED: "Désolé mais votre appareil ne répond pas aux critères minimaux pour voir cet Espace en mode VR.",
  13268. VR_SHOW_IOS_1: "Taper pour voir l’Espace en Realité Virtuelle",
  13269. VR_SHOW_IOS_2: "Nécessite l’application port VR et un iPhone compatible pour voir",
  13270. VR_WHAT_YOU_NEED: "Ce dont vous aurez besoin pour...",
  13271. VR_NEED_CARDBOARD: "Ce dont vous aurez besoin avec Google Cardboard",
  13272. VR_NEED_SAMSUNG: "Ce dont vous aurez besoin avec Samsung Gear VR",
  13273. VR_NEED_DAYDREAM: "BESOINS AVANT APPARIEMENT AVEC DAYDREAM VIEW",
  13274. VR_NEED_DAYDREAM_PHONE: "Téléphone compatible avec Daydream",
  13275. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13276. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13277. VR_APP: "port VR App",
  13278. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13279. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13280. VR_COMPATIBLE_IPHONES_2: "iPhone 5s et plus récent, avec iOS 9.1 et plus récent",
  13281. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13282. VR_COMPATIBLE_ANDROID: "Appareils Android compatibles",
  13283. 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",
  13284. VR_ANDROID_DETAIL: 'Écrans 4.5" à 5.5" avec Android 4.4.4 ou plus récent',
  13285. VR_ANDROID_DVICES: "Appareils Android",
  13286. VR_COMPATIBLE_SAMSUNG: "Appareils Samsung Compatibles",
  13287. VR_SAMSUNG_DETAIL: "Galaxy S6 et plus récents",
  13288. VR_APP_FOR_CARDBOARD: "Application port VR pour Google Cardboard",
  13289. VR_APP_FOR_SAMSUNG: "Application port VR pour Gear VR",
  13290. VR_APP_FOR_ANDROID: "Application port VR pour téléphones Android",
  13291. VR_APP_OPEN: "Ouvrir plutôt avec l’application port VR",
  13292. VR_DOWNLOAD_HERE: "Télécharger ici",
  13293. VR_REQUIRE_HEADSET: "Nécessite un casque VR et l'application port VR pour Android afin d'être installé",
  13294. VR_REDIRECT_TO_STORE: "Si l'application n'est pas installée, vous serez rediriger vers l'App store.",
  13295. VR_IMPROPER_EMBED: "L'Espace port n'est pas correctement intégré pour supporter VR dans votre navigateur Web.",
  13296. VR_OPEN_ANDROID_LINK: "Ouvrez ce lien avec votre appareil mobile",
  13297. VR_ANDROID_OPTIONS: "Options disponibles pour casque VR sous",
  13298. SHARE_TO: "Partager sur",
  13299. SHARE_LINK: "Lien direct",
  13300. SHARE_EXPLORE: "Explorer ",
  13301. SHARE_AT: "à",
  13302. SHARE_WITH: "avec",
  13303. SHARE_3D: " en 3D",
  13304. SHARE_COPIED: "Copié!",
  13305. ERROR_BROWSER_SOLUTION: "Installer un nouveau navigateur pour explorer en 3D.",
  13306. ERROR_BROWSER_EXPLANATION: "WebGL a besoin d'un navigateur récent.",
  13307. ERROR_GENERIC_PROBLEM: "Il y eu un problème.",
  13308. ERROR_GENERIC_SOLUTION: "Redémarrer votre navigateur.",
  13309. ERROR_GENERIC_ACTIONS_1: "Si le problème persiste, ",
  13310. ERROR_GENERIC_ACTIONS_2: "installez un navigateur plus récent",
  13311. ERROR_GENERIC_ACTIONS_3: " ou ",
  13312. ERROR_GENERIC_ACTIONS_4: "voir notre guide de dépannage",
  13313. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navigateur non-supporté.",
  13314. ERROR_WEBGL_IOS_PROBLEM: "Version iOS non-supportée.",
  13315. ERROR_WEBGL_IOS_SOLUTION: "Mettre à jour avec iOS8 au minimum pour voir l'Espace en 3D.",
  13316. ERROR_WEBGL_IOS_ACTIONS_1: "Tapez ",
  13317. ERROR_WEBGL_IOS_ACTIONS_2: "Paramètres > Général > Mise à jour Software",
  13318. ERROR_WEBGL_SAFARI_PROBLEM: "Activez WegGL pour explorer en 3D.",
  13319. ERROR_WEBGL_SAFARI_ACTIONS_1: "Cliquez ",
  13320. ERROR_WEBGL_SAFARI_ACTIONS_2: "Préferences > Avancés > Voir menu développeur",
  13321. ERROR_WEBGL_SAFARI_ACTIONS_3: "Puis cliquez ",
  13322. ERROR_WEBGL_SAFARI_ACTIONS_4: "Développe > Activé WebGL",
  13323. ERROR_MISSING_URLS_PROBLEM: "Il n'y a pas de panoromas pour ce modèle.",
  13324. ERROR_MISSING_URLS_EXPLANATION: "Ceci est un ancien modèle. Le propriétaire du site a peut-être un nouveau modèle en cours.",
  13325. ERROR_LOADING_FAILED_PROBLEM: "Ce modèle n'est pas disponible.",
  13326. ERROR_LOADING_FAILED_ACTIONS_1: "Si le problème persiste, ",
  13327. ERROR_LOADING_FAILED_ACTIONS_2: "voir notre guide de dépannage",
  13328. ERROR_MAINTENANCE_PROBLEM: "Maintenance en cours.",
  13329. ERROR_MAINTENANCE_SOLUTION: "Revenez dans quelques instants.",
  13330. LINK_TO_LOCATION: "Lien vers l'emplacement",
  13331. MENU_COPY: "Copie",
  13332. LINK_ALERT_COPY: "Utiliser CTRL+CMD C pour copier.",
  13333. ROTATE: "Faire pivoter",
  13334. INSIDE: "Intérieure",
  13335. MOVE: "Se déplacer",
  13336. ZOOM: "Zoom"
  13337. }
  13338. }
  13339. , {}],
  13340. 114: [function(e, t, i) {
  13341. "use strict";
  13342. t.exports = {
  13343. PAGE_TITLE: "",
  13344. LOADING: "読み込み中",
  13345. PRESENTED_BY_CAPS: "PRESENTED BY",
  13346. POWERED_BY: "powered by",
  13347. POWERED_BY_CAPS: "POWERED BY",
  13348. DESKTOP_SHORT_CTA: "クリックしてこの3D Spaceを探索",
  13349. MOBILE_SHORT_CTA: "タップしてこの3D Spaceを探索",
  13350. PRESENTED_BY: "Presented by ",
  13351. MORE: "全て表示 ",
  13352. LESS: "閉じる ",
  13353. TAG_CONTENT: "tag™コンテンツ ",
  13354. SHOW: "表示",
  13355. HIDE: "非表示",
  13356. DOLLHOUSE: "ドールハウス",
  13357. FLOOR_PLAN: "フロアプラン",
  13358. OPEN_HIGHLIGHTS: "ハイライトを開く",
  13359. CLOSE_HIGHLIGHTS: "閉じる",
  13360. PREVIOUS: "前へ",
  13361. PLAY: "再生",
  13362. PAUSE: "一時停止",
  13363. NEXT: "次へ",
  13364. EXPLORE_3D_SPACE: "3DSpaceの探索",
  13365. VIEW_DOLLHOUSE: "ドールハウスの表示",
  13366. SOCIAL_SHARING: "このSpaceを共有する",
  13367. VIEW_IN_VR: "VRで表示",
  13368. VIEW_FULLSCREEN: "フルスクリーン表示",
  13369. EXIT_FULLSCREEN: "フルスクリーン表示を終了",
  13370. ZOOM_IN: "ズームイン",
  13371. ZOOM_OUT: "ズームアウト",
  13372. FLOOR_NAME: "フロア ",
  13373. FLOOR_ALL: "すべて",
  13374. TERMS: "規約",
  13375. PORT_TERMS: "port規約",
  13376. TERMS_OF_USE: "利用規約",
  13377. CLOSE_TERMS: "閉じる",
  13378. TERMS_TEXT_FILE: "terms-jp-JP.html",
  13379. TERMS_FAIL: "規約を取得できませんでした。利用規約を表示するためにインターネットに接続されていることを確認してください。",
  13380. WEBVR_FOR_DAYDREAM: "Daydream View用",
  13381. WEBVR_ENTER_WEBVR: "VRに入る",
  13382. WEBVR_DIFFERENT_HEADSET: "別のヘッドセットをお持ちですか?",
  13383. WEBVR_LEARN_MORE: "もっと詳しく",
  13384. WEBVR_VIEW_SPACE: "VRでSpaceを表示",
  13385. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13386. WEBVR_DAYDREAM_PHONE: "Daydream対応スマホ",
  13387. WEBVR_FOR_CARDBOARD: "Google Cardboard用",
  13388. WEBVR_VIEW_CARDBOARD: "またはGoogle Cardboardで表示",
  13389. VR_VIEW_SPACE: "バーチャルリアリティでSpaceを表示",
  13390. VR_LEARN_MORE_CAPS: "もっと詳しく",
  13391. VR_PREVIOUS_CAPS: "前へ",
  13392. VR_NEXT_CAPS: "次へ",
  13393. VR_GOT_IT_CAPS: "了解",
  13394. VR_SHOW_SUPPORTED: "タップして次を使用してVRでSpaceを表示: ",
  13395. VR_SHOW_UNSUPPORTED: "お使いのデバイスはVRでSpaceを表示する最低要件を満たしていません",
  13396. VR_SHOW_IOS_1: "タップしてVRでSpaceを表示",
  13397. VR_SHOW_IOS_2: "表示するにはport VRアプリと互換性のあるiPhoneが必要です",
  13398. VR_WHAT_YOU_NEED: "必要なもの",
  13399. VR_NEED_CARDBOARD: "Google Cardboardに必要なもの",
  13400. VR_NEED_SAMSUNG: "Samsung Gear VRに必要なもの",
  13401. VR_NEED_DAYDREAM: "事前にDaydream Viewとのペアリングが必要です",
  13402. VR_NEED_DAYDREAM_PHONE: "Daydream対応スマホ",
  13403. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13404. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13405. VR_APP: "port VRアプリ",
  13406. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13407. VR_COMPATIBLE_IPHONES_1: "iPhone",
  13408. VR_COMPATIBLE_IPHONES_2: "iOS 9.1以降で動作するiPhone 5s以降のモデル",
  13409. VR_COMPATIBLE_IPHONES_3: "互換性のあるiPhone",
  13410. VR_COMPATIBLE_ANDROID: "互換性のあるAndroidデバイス",
  13411. VR_COMPATIBLE_ANDROID_LONG: "Android OS 4.4.4以降で動作する互換性のあるAndroidデバイスの4.5~5.5インチディスプレイ",
  13412. VR_ANDROID_DETAIL: "Android OS 4.4.4以降で動作する4.5~5.5インチディスプレイ",
  13413. VR_ANDROID_DVICES: "Androidデバイス",
  13414. VR_COMPATIBLE_SAMSUNG: "互換性のあるSamsungデバイス",
  13415. VR_SAMSUNG_DETAIL: "Galaxy S5以降のモデル",
  13416. VR_APP_FOR_CARDBOARD: "Google Cardboard用のport VRアプリ",
  13417. VR_APP_FOR_SAMSUNG: "Gear VR 用のport VRアプリ",
  13418. VR_APP_FOR_ANDROID: "Androidフォン用のport VRアプリ",
  13419. VR_APP_OPEN: "port VRアプリで開く",
  13420. VR_DOWNLOAD_HERE: "ここからダウンロード",
  13421. VR_REQUIRE_HEADSET: "Android 用のVRヘッドセットとport VRアプリ をインストールする必要があります",
  13422. VR_REDIRECT_TO_STORE: "アプリがインストールされていない場合、App Storeにリダイレクトされます",
  13423. VR_IMPROPER_EMBED: "お使いのウェブブラウザでVRがサポートされるようport Spaceが適切に埋め込まれていません。",
  13424. VR_OPEN_ANDROID_LINK: "お使いの携帯電話でリンクを開いてください",
  13425. VR_ANDROID_OPTIONS: "利用可能なVRヘッドセットオプション",
  13426. SHARE_TO: "共有先",
  13427. SHARE_LINK: "ダイレクトリンク",
  13428. SHARE_EXPLORE: "探索",
  13429. SHARE_AT: "場所",
  13430. SHARE_WITH: "使用アプリ",
  13431. SHARE_3D: "3Dで",
  13432. SHARE_COPIED: "コピーされました!",
  13433. ERROR_BROWSER_SOLUTION: "3D探索するには、新しいバージョンのブラウザをインストールしてください",
  13434. ERROR_BROWSER_EXPLANATION: "WebGLにはモダンブラウザが必要です。",
  13435. ERROR_GENERIC_PROBLEM: "問題が発生しました。",
  13436. ERROR_GENERIC_SOLUTION: "ブラウザを再起動してください。",
  13437. ERROR_GENERIC_ACTIONS_1: "問題が解決しない場合は、",
  13438. ERROR_GENERIC_ACTIONS_2: "サポートされているブラウザをインストールしてください",
  13439. ERROR_GENERIC_ACTIONS_3: "または",
  13440. ERROR_GENERIC_ACTIONS_4: "トラブルシューティングガイドを参照してください",
  13441. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "ブラウザがサポートされていません。",
  13442. ERROR_WEBGL_IOS_PROBLEM: "サポートされていないiOSバージョンです。",
  13443. ERROR_WEBGL_IOS_SOLUTION: "3D探索するには、iOS 8以降にアップグレードしてください。",
  13444. ERROR_WEBGL_IOS_ACTIONS_1: "以下の順にタップします:",
  13445. ERROR_WEBGL_IOS_ACTIONS_2: "設定 > 全般 > ソフトウェアの更新",
  13446. ERROR_WEBGL_SAFARI_PROBLEM: "WebGLを有効にして3Dで探索します。",
  13447. ERROR_WEBGL_SAFARI_ACTIONS_1: "以下の順にクリックします:",
  13448. ERROR_WEBGL_SAFARI_ACTIONS_2: "環境設定 > 詳細 > メニューバーに開発メニューを表示",
  13449. ERROR_WEBGL_SAFARI_ACTIONS_3: "その後、以下の順にクリックします:",
  13450. ERROR_WEBGL_SAFARI_ACTIONS_4: "開発 > WebGLを有効にする",
  13451. ERROR_MISSING_URLS_PROBLEM: "このモデルではパノラマを使用できません。",
  13452. ERROR_MISSING_URLS_EXPLANATION: "これは古いモデルです。ウェブサイト所有者が新しいモデルを開発中かもしれません。",
  13453. ERROR_LOADING_FAILED_PROBLEM: "モデルは利用できません。",
  13454. ERROR_LOADING_FAILED_ACTIONS_1: "問題が解決しない場合は、",
  13455. ERROR_LOADING_FAILED_ACTIONS_2: "トラブルシューティングガイドを参照してください",
  13456. ERROR_MAINTENANCE_PROBLEM: "メンテナンスは進行中です。",
  13457. ERROR_MAINTENANCE_SOLUTION: "しばらくしてからやり直し てください。",
  13458. LINK_TO_LOCATION: "ロケーションへのリンク",
  13459. MENU_COPY: "コピー",
  13460. LINK_ALERT_COPY: "コピーするにはCTRL/CMD + Cを使用してください。",
  13461. ROTATE: "回転",
  13462. MOVE: "移動",
  13463. INSIDE: "内側",
  13464. ZOOM: "ズーム",
  13465. HELP: "ヘルプ",
  13466. HELP_NAVIGATION_TAB: "ナビゲーション",
  13467. HELP_MORE_HELP_TAB: "その他のヘルプ",
  13468. HELP_DESKTOP_PANORAMA_1A: "Spaceを見回すには、クリックしてドラッグします。",
  13469. HELP_DESKTOP_PANORAMA_2A: "移動するには、Space全体にあるリングをクリックします。",
  13470. HELP_DESKTOP_PANORAMA_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13471. HELP_DESKTOP_PANORAMA_1B: "または、矢印キーを使用して左右に向きを変えます。",
  13472. HELP_DESKTOP_PANORAMA_2B: "または、矢印キーを使用して前後に向きを変えます。",
  13473. HELP_DESKTOP_PANORAMA_3B: "あるいは、プラス(+)キーまたはマイナス(-)キーを使用して、ズームイン、ズームアウトします。",
  13474. HELP_DESKTOP_360_2A: "内側ビューアイコンをクリックしてSpaceに入ります。",
  13475. HELP_DESKTOP_360_2B: "または、数字キー1を押して内側ビューに入ります。",
  13476. HELP_DESKTOP_DOLLHOUSE_1A: "左クリックと左右、上下のドラッグでドールハウスを回転します。",
  13477. HELP_DESKTOP_DOLLHOUSE_2A: "右クリックと左右、上下のドラッグでドールハウスの画面上の位置を変更します。",
  13478. HELP_DESKTOP_DOLLHOUSE_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13479. HELP_DESKTOP_DOLLHOUSE_1B: "または、矢印キーを使用してドールハウスを回転します。",
  13480. HELP_DESKTOP_FLOORPLAN_1A: "左ボタンを押しながら、上下左右にドラッグしてフロアプランの画面上の位置を変更します。",
  13481. HELP_DESKTOP_FLOORPLAN_2A: "右ボタンを押しながら左右にドラッグして、フロアプランを回転します。",
  13482. HELP_DESKTOP_FLOORPLAN_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13483. HELP_DESKTOP_FLOORPLAN_2B: "または、矢印キーを使用して左右に回転します。",
  13484. HELP_DESKTOP_FLOORPLAN_3B: "または、矢印キーを使用して、ズームイン、ズームアウトします。",
  13485. HELP_MOBILE_PANORAMA_1: "Spaceを見回すには、タッチしてドラッグします。",
  13486. HELP_MOBILE_PANORAMA_2: "移動するには、Space全体にあるリングをタップします。",
  13487. HELP_MOBILE_3: "ピンチジェスチャーを使用してズームイン、ズームアウトします。",
  13488. HELP_MOBILE_360_2: "内側ビューアイコンをタップしてSpaceに入ります。",
  13489. HELP_MOBILE_DOLLHOUSE_1: "タッチして上下左右にドラッグしてドールハウスを回転します。",
  13490. HELP_MOBILE_DOLLHOUSE_2: "タッチして、2本指でドラッグしてドールハウスを配置します。",
  13491. HELP_MOBILE_FLOORPLAN_1: "タッチ&ドラッグしてフロアプランを配置します。",
  13492. HELP_MOBILE_FLOORPLAN_2: "タッチして、2本指でドラッグしてフロアプランを回転します。",
  13493. HELP_MORE_HLR_A: "ハイライト",
  13494. HELP_DESKTOP_MORE_HLR_B: "サムネイル画像を使用してSpaceを移動するために開きます。",
  13495. HELP_MORE_DOLLHOUSE_A: "ドールハウス",
  13496. HELP_DESKTOP_MORE_DOLLHOUSE_B: "クリックして3DでSpace全体のトップダウンビューを表示して回転します。",
  13497. HELP_MOBILE_MORE_DOLLHOUSE_B: "タップして3DでSpace全体のトップダウンビューを表示して回転します。",
  13498. HELP_MORE_FLOORS_A: "フロアセレクター",
  13499. HELP_DESKTOP_MORE_FLOORS_B: "Space内のフロアを切り替えます。",
  13500. HELP_MORE_TAG_A: "tag™ Posts",
  13501. HELP_DESKTOP_MORE_TAG_B: "クリックするか、カーソルを置くとSpace内の機能についての説明が表示されます。",
  13502. HELP_MOBILE_MORE_TAG_B: "タップするとSpace内の機能についての説明が表示されます。",
  13503. HELP_MORE_ZOOM_A: "ズームコントロール",
  13504. HELP_DESKTOP_MORE_ZOOM_B: "これらのコントロールまたはスクロールホイールを使用して、ズームイン、ズームアウトします。",
  13505. HELP_MORE_TOUR_A: "ツアーコントロール",
  13506. HELP_DESKTOP_MORE_TOUR_B: "ガイド付きツアー中に再生、一時停止、前方・後方に移動します。",
  13507. HELP_MORE_INSIDE_A: "内側ビュー",
  13508. HELP_DESKTOP_MORE_INSIDE_B: "クリックしてSpace内を探索します。",
  13509. HELP_MOBILE_MORE_INSIDE_B: "タップしてSpace内を探索します。",
  13510. HELP_MORE_VR_A: "VRモード",
  13511. HELP_DESKTOP_MORE_VR_B: "クリックしてバーチャルリアリティでSpaceを起動します。",
  13512. HELP_MOBILE_MORE_VR_B: "タップしてバーチャルリアリティでSpaceを起動します。",
  13513. HELP_MORE_360_A: "360° Views",
  13514. HELP_DESKTOP_MORE_360_B: "Highlight Reelの360° Viewsをクリックして屋外シーンを表示します。",
  13515. HELP_MOBILE_MORE_360_B: "Highlight Reelの360° Viewsをタップして屋外シーンを表示します。",
  13516. HELP_MORE_FULLSCREEN_A: "フルスクリーン",
  13517. HELP_DESKTOP_MORE_FULLSCREEN_B: "3D Showcaseをフルスクリーン表示にします。",
  13518. CLOSE: "閉じる"
  13519. }
  13520. }
  13521. , {}],
  13522. 115: [function(e, t, i) {
  13523. "use strict";
  13524. t.exports = {
  13525. PAGE_TITLE: "",
  13526. LOADING: "Загрузка",
  13527. PRESENTED_BY_CAPS: "ПРЕДСТАВЛЕНО",
  13528. POWERED_BY: "разработано на платформе ",
  13529. POWERED_BY_CAPS: "РАЗРАБОТАНО НА ПЛАТФОРМЕ",
  13530. DESKTOP_SHORT_CTA: "Нажмите для просмотра.",
  13531. MOBILE_SHORT_CTA: "Нажмите для просмотра.",
  13532. PRESENTED_BY: "Представлено ",
  13533. MORE: "Больше ",
  13534. LESS: "Меньше ",
  13535. TAG_CONTENT: "tag™ Контент",
  13536. SHOW: "Показать",
  13537. HIDE: "Скрыть",
  13538. DOLLHOUSE: "Dollhouse",
  13539. FLOOR_PLAN: "Планировка",
  13540. OPEN_HIGHLIGHTS: "Открыть Фотоколлаж",
  13541. CLOSE_HIGHLIGHTS: "Закрыть",
  13542. PREVIOUS: "Предыдущий",
  13543. PLAY: "Воспроизвести",
  13544. PAUSE: "Пауза",
  13545. NEXT: "Следующий",
  13546. EXPLORE_3D_SPACE: "Просмотреть 3D модель",
  13547. VIEW_DOLLHOUSE: "Посмотреть Dollhouse",
  13548. SOCIAL_SHARING: "Поделиться этой моделью",
  13549. VIEW_IN_VR: "Посмотреть в VR",
  13550. VIEW_FULLSCREEN: "Полный экран",
  13551. EXIT_FULLSCREEN: "Выйти из полноэкранного режима",
  13552. ZOOM_IN: "Увеличить",
  13553. ZOOM_OUT: "Уменьшить",
  13554. FLOOR_NAME: "Этаж ",
  13555. FLOOR_ALL: "Все",
  13556. TERMS: "Условия",
  13557. PORT_TERMS: "Правила пользования",
  13558. TERMS_OF_USE: "Условия использования",
  13559. TERMS_TEXT_FILE: "terms-ru-RU.html",
  13560. CLOSE_TERMS: "Закрыть",
  13561. TERMS_FAIL: "Не удалось загрузить условия использования. Для просмотра условий использования, пожалуйста, убедитесь, что у Вас есть подключение к Интернету.",
  13562. HELP: "Помощь",
  13563. HELP_NAVIGATION_TAB: "Навигация",
  13564. HELP_MORE_HELP_TAB: "Доп. Помощь",
  13565. CLOSE: "Закрыть",
  13566. HELP_DESKTOP_PANORAMA_1A: "Нажмите и перетащите, чтобы осмотреть пространство вокруг.",
  13567. HELP_DESKTOP_PANORAMA_2A: "Для передвижения по модели нажимайте на круги .",
  13568. HELP_DESKTOP_PANORAMA_3A: "Используйте колесо прокрутки для увеличения и уменьшения.",
  13569. HELP_DESKTOP_PANORAMA_1B: "Или используйте клавиши со стрелками для поворота влево и вправо.",
  13570. HELP_DESKTOP_PANORAMA_2B: "Или используйте стрелки для перемещения вперед и назад.",
  13571. HELP_DESKTOP_PANORAMA_3B: "Или используйте клавиши ‘плюс’ и ‘минус’ для увеличения и уменьшения изображения.",
  13572. HELP_DESKTOP_360_2A: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  13573. HELP_DESKTOP_360_2B: "или нажмите 1 на клавиатуре, чтобы увидеть внутреннюю панораму.",
  13574. HELP_DESKTOP_DOLLHOUSE_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы повернуть Dollhouse.",
  13575. HELP_DESKTOP_DOLLHOUSE_2A: "Нажмите правую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить позицию Dollhouse на экране.",
  13576. HELP_DESKTOP_DOLLHOUSE_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  13577. HELP_DESKTOP_DOLLHOUSE_1B: "Или используйте клавиши со стрелками, чтобы повернуть Dollhouse.",
  13578. HELP_DESKTOP_FLOORPLAN_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить положение Планировки на экране.",
  13579. HELP_DESKTOP_FLOORPLAN_2A: "Нажмите правую кнопку мыши и перетащите влево или вправо, чтобы повернуть Планировку.",
  13580. HELP_DESKTOP_FLOORPLAN_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  13581. HELP_DESKTOP_FLOORPLAN_2B: "Или используйте клавиши со стрелками для поворота влево или вправо.",
  13582. HELP_DESKTOP_FLOORPLAN_3B: "Или используйте стрелки для увеличения и уменьшения.",
  13583. HELP_MOBILE_PANORAMA_1: "Нажмите и перетащите, чтобы осмотреть модель.",
  13584. HELP_MOBILE_PANORAMA_2: "Для передвижения по модели нажимайте на круги.",
  13585. HELP_MOBILE_3: "Используйте движение двумя пальцами в разные стороны, чтобы увеличить и уменьшить.",
  13586. HELP_MOBILE_360_2: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  13587. HELP_MOBILE_DOLLHOUSE_1: "Нажмите и перетащите вверх, вниз, влево и вправо, чтобы повернуть Dollhouse.",
  13588. HELP_MOBILE_DOLLHOUSE_2: "Нажмите и перетащите, чтобы расположить Dollhouse.",
  13589. HELP_MOBILE_FLOORPLAN_1: "Нажмите и перетащите, чтобы расположить план здания.",
  13590. HELP_MOBILE_FLOORPLAN_2: "Коснитесь и перетащите двумя пальцами, чтобы повернуть план здания.",
  13591. HELP_MORE_HLR_A: "Фотоколлаж",
  13592. HELP_DESKTOP_MORE_HLR_B: "Откройте для перемещения по модели, используя иконки изображений.",
  13593. HELP_MORE_DOLLHOUSE_A: "Dollhouse",
  13594. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  13595. HELP_MOBILE_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  13596. HELP_MORE_FLOORS_A: "Выбор Этажа",
  13597. HELP_DESKTOP_MORE_FLOORS_B: "Переключение между этажами.",
  13598. HELP_MORE_TAG_A: "tag™ Posts",
  13599. HELP_DESKTOP_MORE_TAG_B: "Нажмите или наведите курсор мыши для получения информации о функциях в Пространстве.",
  13600. HELP_MOBILE_MORE_TAG_B: "Нажмите для получения информации о функциях.",
  13601. HELP_MORE_ZOOM_A: "Масштаб",
  13602. HELP_DESKTOP_MORE_ZOOM_B: "Используйте эти кнопки для увеличения и уменьшения изображения или используйте колесо прокрутки.",
  13603. HELP_MORE_TOUR_A: "Управление Туром",
  13604. HELP_DESKTOP_MORE_TOUR_B: "Используйте кнопки Воспроизвести, Пауза, Вперед и Назад для управления фотоколлажем.",
  13605. HELP_MORE_INSIDE_A: "Вид Изнутри",
  13606. HELP_DESKTOP_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  13607. HELP_MOBILE_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  13608. HELP_MORE_VR_A: "Режим VR",
  13609. HELP_DESKTOP_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  13610. HELP_MOBILE_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  13611. HELP_MORE_360_A: "360° Views",
  13612. HELP_DESKTOP_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  13613. HELP_MOBILE_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  13614. HELP_MORE_FULLSCREEN_A: "Полный экран",
  13615. HELP_DESKTOP_MORE_FULLSCREEN_B: "Развернуть 3D Showcase во весь экран.",
  13616. WEBVR_FOR_CARDBOARD: "Для Google Cardboard",
  13617. WEBVR_FOR_DAYDREAM: "Для просмотра в Daydream",
  13618. WEBVR_ENTER_WEBVR: "ВОЙТИ В VR ",
  13619. WEBVR_DIFFERENT_HEADSET: "Есть другой VR-шлем?",
  13620. WEBVR_LEARN_MORE: "Узнать больше",
  13621. WEBVR_VIEW_SPACE: "Запустить модель в VR",
  13622. WEBVR_DAYDREAM_VIEW: "Посмотреть в Daydream",
  13623. WEBVR_DAYDREAM_PHONE: "Daydream-готовый телефон",
  13624. WEBVR_VIEW_CARDBOARD: "Или просмотреть в Google Cardboard",
  13625. VR_WHAT_YOU_NEED: "Что Вам потребуется...",
  13626. VR_NEED_DAYDREAM_PHONE: "Daydream-готовый телефон",
  13627. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13628. VR_APP: "port VR App",
  13629. VR_APP_OPEN: "Или открыть через приложение port VR",
  13630. VR_COMPATIBLE_ANDROID_LONG: 'Совместимые Android устройства с диагональю экрана 4.5"-5.5" дюймов и Android версией 4.4.4, и выше',
  13631. VR_SAMSUNG_DETAIL: "Galaxy S6 и выше",
  13632. VR_APP_FOR_ANDROID: "Приложение port VR для Android",
  13633. VR_NEED_DAYDREAM: "Необходимо для соединением с Daydream",
  13634. VR_VIEW_SPACE: "Запустить модель в VR",
  13635. VR_LEARN_MORE_CAPS: "УЗНАТЬ БОЛЬШЕ",
  13636. VR_PREVIOUS_CAPS: "ПРЕДЫДУЩИЙ",
  13637. VR_NEXT_CAPS: "СЛЕДУЮЩИЙ",
  13638. VR_GOT_IT_CAPS: "ЯСНО",
  13639. VR_SHOW_SUPPORTED: "Нажмите, чтобы просмотреть модель в VR с помощью",
  13640. VR_SHOW_UNSUPPORTED: "Извините, но Ваше устройство не соответствует минимальным требованиям для просмотра модели в VR.",
  13641. VR_SHOW_IOS_1: "Нажмите, чтобы просмотреть модель в VR",
  13642. VR_SHOW_IOS_2: "Для просмотра требуется приложение port VR и совместимый iPhone",
  13643. VR_NEED_CARDBOARD: "Что Вам потребуется для Google Cardboard",
  13644. VR_NEED_SAMSUNG: "Что Вам потребуется для Samsung Gear VR",
  13645. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13646. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13647. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13648. VR_COMPATIBLE_IPHONES_2: "iPhone 5s или новее с iOS 9.1 и выше",
  13649. VR_COMPATIBLE_IPHONES_3: "Совместимые модели iPhone",
  13650. VR_COMPATIBLE_ANDROID: "Совместимые Android устройства",
  13651. VR_ANDROID_DETAIL: 'Экран от 4.5" до 5.5" и Android 4.4.4, и выше',
  13652. VR_ANDROID_DVICES: "Android устройства",
  13653. VR_COMPATIBLE_SAMSUNG: "Совместимые Samsung устройства",
  13654. VR_APP_FOR_CARDBOARD: "Приложение port VR для Google Cardboard",
  13655. VR_APP_FOR_SAMSUNG: "Приложение port VR для Gear VR",
  13656. VR_DOWNLOAD_HERE: "Скачать здесь",
  13657. VR_REQUIRE_HEADSET: "Требуется VR-шлем и установленное приложение port VR для Android",
  13658. VR_REDIRECT_TO_STORE: "Если приложение не установлено, Вы будете перенаправлены на страницу магазина приложений.",
  13659. VR_IMPROPER_EMBED: "port модель не встроена должным образом для поддержки VR в вашем веб-браузере.",
  13660. VR_OPEN_ANDROID_LINK: "Откройте ссылку на Вашем мобильном телефоне",
  13661. VR_ANDROID_OPTIONS: "Доступные опции VR-шлемов",
  13662. SHARE_TO: "Поделиться",
  13663. SHARE_LINK: "Прямая ссылка",
  13664. SHARE_EXPLORE: "просмотреть",
  13665. SHARE_AT: "на",
  13666. SHARE_WITH: "с",
  13667. SHARE_3D: "в 3D",
  13668. SHARE_COPIED: "Скопировано!",
  13669. ERROR_BROWSER_SOLUTION: "установите новый браузер, чтобы просмотреть 3D пространство.",
  13670. ERROR_BROWSER_EXPLANATION: "WebGL требует современный браузер.",
  13671. ERROR_GENERIC_PROBLEM: "Ой, что-то пошло не так.",
  13672. ERROR_GENERIC_SOLUTION: "Перезапустите браузер.",
  13673. ERROR_GENERIC_ACTIONS_1: "Если проблема не устранена, ",
  13674. ERROR_GENERIC_ACTIONS_2: "установите поддерживаемый браузер",
  13675. ERROR_GENERIC_ACTIONS_3: " или ",
  13676. ERROR_GENERIC_ACTIONS_4: "смотрите наше руководство по устранению неполадок",
  13677. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Браузер не поддерживается.",
  13678. ERROR_WEBGL_IOS_PROBLEM: "iOS-версия не поддерживается.",
  13679. ERROR_WEBGL_IOS_SOLUTION: "Обновите до iOS 8 или выше, чтобы просмотреть пространство в 3D.",
  13680. ERROR_WEBGL_IOS_ACTIONS_1: "Нажмите ",
  13681. ERROR_WEBGL_IOS_ACTIONS_2: "Настройки > Общие > Обновление ПО",
  13682. ERROR_WEBGL_SAFARI_PROBLEM: "Включите WebGL для 3D-просмотра.",
  13683. ERROR_WEBGL_SAFARI_ACTIONS_1: "Нажмите ",
  13684. ERROR_WEBGL_SAFARI_ACTIONS_2: "Настойки > Дополнения > Показывать меню “Разработка” в строке меню",
  13685. ERROR_WEBGL_SAFARI_ACTIONS_3: "Затем нажмите ",
  13686. ERROR_WEBGL_SAFARI_ACTIONS_4: "Разработка > Разрешить WebGL",
  13687. ERROR_MISSING_URLS_PROBLEM: "Ой, для этой модели нет панорамы.",
  13688. ERROR_MISSING_URLS_EXPLANATION: "Эта модель устарела. У владельца веб-сайта может быть новая модель.",
  13689. ERROR_LOADING_FAILED_PROBLEM: "Ой, модель недоступна.",
  13690. ERROR_LOADING_FAILED_ACTIONS_1: "Если проблема не устранена, ",
  13691. ERROR_LOADING_FAILED_ACTIONS_2: "посмотрите наше руководство по устранению неполадок",
  13692. ERROR_MAINTENANCE_PROBLEM: "Выполняется техническое обслуживание.",
  13693. ERROR_MAINTENANCE_SOLUTION: "Пожалуйста, попробуйте снова через несколько минут.",
  13694. LINK_TO_LOCATION: "Ссылка на местоположение",
  13695. MENU_COPY: "Копировать",
  13696. LINK_ALERT_COPY: "Для того, чтобы скопировать, пожалуйста, используйте CTRL/CMD + C.",
  13697. ROTATE: "Вращать",
  13698. MOVE: "Передвигаться",
  13699. INSIDE: "Вид изнутри",
  13700. ZOOM: "Масштаб"
  13701. }
  13702. }
  13703. , {}],
  13704. 116: [function(r, e, t) {
  13705. (function(i) {
  13706. "use strict";
  13707. function re(e) {
  13708. console.log("e1:" + e),
  13709. e = Math.round(.4 * e * 100),
  13710. console.log("e2:" + e);
  13711. var t = $(".progressbar");
  13712. t.find(".bar").css("width", e + "%"),
  13713. t.find(".label").css("left", t.width() * e / 100 - 15 + "px"),
  13714. t.find(".perc").text(e + "%")
  13715. }
  13716. $("#gui-loading").fadeIn(200),
  13717. re(.1);
  13718. var e = g_version ? "modeldata.js" : "someData.json";
  13719. $.ajax(g_Prefix + "data/" + window.number + "/" + e + "?" + randomTime().getTime(), {
  13720. dataType: "json"
  13721. }).done(function(e) {
  13722. var t = matcher(e);
  13723. t.files.templates[0] = g_Prefix + e.files.templates[0].replace("{{number}}", window.number),
  13724. t.user = {
  13725. is_authenticated: !1,
  13726. 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"]
  13727. }
  13728. try{//处理一下导览数据,旧的曾有导览数据是错误的,将它删除
  13729. var newImages = [];
  13730. t.model.images.forEach((tourImg)=>{tourImg.thumbnail_signed_src && newImages.push(tourImg)})
  13731. t.model.images = newImages
  13732. }catch(e){console.log(e) }
  13733. window.MP_PREFETCHED_MODELDATA = t
  13734. t.model.summary = t.summary
  13735. t.model.name = t.name
  13736. for(let i in t){
  13737. t[i] == "false" && (t[i] = false)
  13738. }
  13739. re(.7),
  13740. function() {
  13741. function y(e) {
  13742. t.update(e)
  13743. }
  13744. function A(e, t) {
  13745. ne.error(t),
  13746. n.error(t),
  13747. N.report(e, "error-" + t)
  13748. }
  13749. function C(e, t, i) {
  13750. try {
  13751. e.start(t)
  13752. } catch (e) {
  13753. throw ne.warn(e.message),
  13754. function(e) {
  13755. var t = O.details();
  13756. t && "Safari" === t.name && 500 < t.version && t.version < 600 ? (n.error("webgl-safari"),
  13757. N.report(e, "error-webgl-safari")) : (n.error("webgl-generic"),
  13758. N.report(e, "error-webgl-generic"))
  13759. }(i.sid),
  13760. e
  13761. }
  13762. }
  13763. function I(e) {
  13764. e.stopPropagation(),
  13765. e.preventDefault()
  13766. }
  13767. window.MP_PREFETCHED_MODELDATA.hoticon && (g_HotImage = {
  13768. point: window.MP_PREFETCHED_MODELDATA.hoticon.default || "https://super.4dage.com/images/4dagePoint2.png",
  13769. point2: window.MP_PREFETCHED_MODELDATA.hoticon.higt || "https://super.4dage.com/images/4dagePoint.png"
  13770. });
  13771. /* window.MP_PREFETCHED_MODELDATA.backgroundMusic ? (g_bgAudio.src = window.MP_PREFETCHED_MODELDATA.backgroundMusic,
  13772. $("#volume").show()) : "one" === g_version && (g_bgAudio.src = g_Prefix + "/audio/audio" + window.number + "/background.mp3");
  13773. */
  13774. if (window.MP_PREFETCHED_MODELDATA.backgroundMusic) {
  13775. if(window.isLocal) g_bgAudio.src = manage.dealURL(window.MP_PREFETCHED_MODELDATA.backgroundMusic) ;
  13776. else g_bgAudio.src = window.MP_PREFETCHED_MODELDATA.backgroundMusic.substr(0,4)=="http" ? window.MP_PREFETCHED_MODELDATA.backgroundMusic : "//" + window.MP_PREFETCHED_MODELDATA.backgroundMusic;
  13777. $("#volume").show();
  13778. }else if (g_version === "one"){
  13779. g_bgAudio.src = g_Prefix+"/audio/"+"audio"+window.number + "/background.mp3";
  13780. //g_bgAudio.src = manage.dealURL(src) ;
  13781. }
  13782. //隐藏公司logo
  13783. window.MP_PREFETCHED_MODELDATA.loadlogo && showLogo();
  13784. r("./lib/three75-shim"),
  13785. r("./lib/array-polyfill"),
  13786. r("./lib/performance-polyfill"),
  13787. r("./lib/shaders/CopyShader.js"),
  13788. r("./lib/shaders/HorizontalBlurShader.js"),
  13789. r("./lib/shaders/VerticalBlurShader.js"),
  13790. r("./lib/postprocessing/EffectComposer.js"),
  13791. r("./lib/postprocessing/RenderPass.js"),
  13792. r("./lib/postprocessing/MaskPass.js"),
  13793. r("./lib/postprocessing/ShaderPass.js"),
  13794. window.Promise || (window.Promise = r("promise-polyfill"));
  13795. var E = r("three")
  13796. , _ = r("three")
  13797. , b = (r("./util/sentry"),
  13798. r("./player"))
  13799. , w = r("./director")
  13800. , T = r("./controls/CameraControls")
  13801. , x = r("./model/ModelManager")
  13802. , S = r("./DisplayController")
  13803. , M = r("./label/LabelDisplayController")
  13804. , R = r("./enum/Viewmode")
  13805. , e = r("./util/logger")
  13806. , P = r("./showcase")
  13807. , O = r("./util/browser")
  13808. , L = r("./settings")
  13809. , D = r("./gui/gui")
  13810. , n = r("./gui/error")
  13811. , N = r("./analytics")
  13812. , F = r("./util/transitions")
  13813. , B = r("./effects")
  13814. , V = r("./objects/Skybox")
  13815. , k = (r("./util/common"),
  13816. r("./util/PanoramaCollection"),
  13817. r("./util/math"),
  13818. r("./util/showcase"))
  13819. , U = r("./util/camera")
  13820. , H = (r("./objects/Panorama"),
  13821. r("./cameras/PanoramaCamera"),
  13822. r("./preloaders"))
  13823. , z = r("events").EventEmitter
  13824. , G = r("./featureflags")
  13825. , W = (r("./util/lerp"),
  13826. r("./util/ajax"),
  13827. r("./ab"))
  13828. , j = r("./sdk/automation.js")
  13829. , Y = r("./scene/SceneRenderer")
  13830. , q = r("./scene/QuickstartManager")
  13831. , X = r("./tile/QualityManager.js")
  13832. , Z = r("./localization/localize")
  13833. , K = r("./tag/tagManager")
  13834. , Q = r("./tile/TileDownloader")
  13835. , J = r("./tile/PanoRenderer")
  13836. , ee = (r("./enum/PanoSizeClass"),
  13837. r("./enum/PanoramaEvents"),
  13838. r("./enum/SceneRendererEvents"))
  13839. , t = r("./gui/memoryUsage")
  13840. , te = r("./enum/RenderLayers")
  13841. , ie = r("./TimingData")
  13842. , ne = new e(i);
  13843. e.level = L.logLevel,
  13844. e.consoleEnabled = L.console,
  13845. function() {
  13846. var e = k.getModelIDFromQueryString();
  13847. if (!e)
  13848. return A(null, "loading-failed");
  13849. var t = k.parseSidUrl(e)
  13850. , i = O.valueFromHash("play", !1) ? "autoplay" : O.inIframe() ? "click" : "fullpage"
  13851. , n = {
  13852. panoElementsToLoad: 6,
  13853. modelElementsToLoad: 0,
  13854. totalElementsLoaded: 0,
  13855. totalElementsToLoad: 0,
  13856. totalPercentageLoaded: 0,
  13857. progressCallback: null
  13858. }
  13859. , r = document.getElementById("player")
  13860. , o = L.quickstart.enabled
  13861. , a = null
  13862. , s = null
  13863. , l = null
  13864. , c = null
  13865. , h = null
  13866. , u = null
  13867. , d = null
  13868. , p = null
  13869. , f = null
  13870. , g = null
  13871. , m = null
  13872. , v = new ie;
  13873. !function(e) {
  13874. ne.info("Version", "2.25.6-0-gd87e5b1"),
  13875. z.defaultMaxListeners = 1e3,
  13876. function(e) {
  13877. e.addEventListener("dragenter", I, !1),
  13878. e.addEventListener("dragover", I, !1)
  13879. }(e),
  13880. O.valueFromHash("title", !0) || $(document).ready(function() {
  13881. $(".model-title").hide()
  13882. })
  13883. }(r),
  13884. function(e) {
  13885. return G.loadFeatureFlags(e).done(function(e) {
  13886. G.updateDependentSettings(e, L)
  13887. })
  13888. }({
  13889. urlBase: t.urlBase
  13890. }).then(function() {
  13891. return Z.init(),
  13892. function(e, t) {
  13893. var i = P.getModel({
  13894. url: t,
  13895. floors: O.valueFromHash("f", !0),
  13896. autoload: !1
  13897. });
  13898. return $.when(i, y).then(null, function(e) {
  13899. return this
  13900. })
  13901. }(0, e)
  13902. }).then(function(e) {
  13903. return re(.9),
  13904. function(e, t, i, n, r) {
  13905. ne.info("Model data loaded"),
  13906. ne.debug("UUID: " + e.data.job.uuid),
  13907. W.init(G.getFlags()),
  13908. i && N.initKeen({
  13909. token: i,
  13910. appId: n
  13911. }),
  13912. N.initSegment({
  13913. model: e.sid,
  13914. version: "2.25.6-0-gd87e5b1",
  13915. startSource: r.startSource,
  13916. token: t,
  13917. autoplay: r.autoplay,
  13918. quickstart: r.quickstart
  13919. })
  13920. }(g = e, L.appConfig.segment_key, L.appConfig.keen_write_key, L.appConfig.keen_project_id, {
  13921. startSource: i,
  13922. autoplay: L.autoplay,
  13923. quickstart: o
  13924. }),
  13925. g.urls.init()
  13926. }).then(function() {
  13927. return g.loadPanos()
  13928. }).then(function() {
  13929. s = U.getStartCameraOptions(g, g.panos);
  13930. //初始画面
  13931. window.MP_PREFETCHED_MODELDATA.camera_start && window.MP_PREFETCHED_MODELDATA.camera_start.thumbImg && function(e) {
  13932. $("<img/>").attr("src", e).on("load", function() {
  13933. $("#gui-thumb").css("backgroundImage", "url(" + e + ")").fadeIn(500),
  13934. $(this).remove()
  13935. $(".shotImg.innerBtn").removeClass('blank').css("background-image", "url(" + e + ")")
  13936. })
  13937. }(window.MP_PREFETCHED_MODELDATA.camera_start.thumbImg);
  13938. d = function(e) {
  13939. var t = new E.PerspectiveCamera;
  13940. t.layers.enable(te.PANOMARKERS),
  13941. t.layers.enable(te.RETICULE),
  13942. t.layers.enable(te.TAG);
  13943. var o = new E.Scene
  13944. , i = new E.AmbientLight(16777215);
  13945. return o.add(i),
  13946. o.skybox = new V,
  13947. o.add(o.skybox),
  13948. o.plane = new E.Mesh(new E.PlaneBufferGeometry(1e5,1e5),new E.RawShaderMaterial({
  13949. side: E.DoubleSide
  13950. })),
  13951. o.plane.position.y = 0,
  13952. o.plane.rotateX(-Math.PI / 2),
  13953. o.plane.material.visible = !1,
  13954. o.add(o.plane),
  13955. o.updateMatrixWorld(),
  13956. L.showScreenshotLocations && e.data.images.forEach(function(e) {
  13957. if (e.metadata && e.metadata.camera_position) {
  13958. var t = e.metadata.camera_position
  13959. , i = new E.Mesh(new E.BoxGeometry(.3,.3,.3));
  13960. i.position = t.clone(),
  13961. o.add(i);
  13962. var n = e.metadata.camera_quaternion
  13963. , r = new E.Vector3(0,0,-1).applyQuaternion(n);
  13964. o.add(new E.ArrowHelper(r,t.clone(),1,16711680))
  13965. }
  13966. }),
  13967. L.showAxis && (o.add(new E.ArrowHelper(new E.Vector3(0,1,0),new E.Vector3(0,0,0),1,255)),
  13968. o.add(new E.ArrowHelper(new E.Vector3(0,0,1),new E.Vector3(0,0,0),1,16711680)),
  13969. o.add(new E.ArrowHelper(new E.Vector3(1,0,0),new E.Vector3(0,0,0),1,65280))),
  13970. new Y(o,t,B)
  13971. }(g),
  13972. m = function(e, t) {
  13973. var i = e ? 1 : 1e3
  13974. , n = W.tilegen || W.imgopt ? 6 : 2;
  13975. n = O.valueFromHash("tileconc", n);
  13976. var r = new X
  13977. , o = new Q({
  13978. concurrentDownloads: n
  13979. })
  13980. , a = new J
  13981. , s = new x
  13982. , l = new w
  13983. , c = new b(t)
  13984. , h = new T
  13985. , u = new S(i)
  13986. , d = new M
  13987. , p = new K;
  13988. return {
  13989. qualityManager: r,
  13990. panoRenderer: a,
  13991. tileDownloader: o,
  13992. player: c,
  13993. director: l,
  13994. modelManager: s,
  13995. tagManager: p,
  13996. displayController: u,
  13997. labelDisplayController: d,
  13998. controls: h
  13999. }
  14000. }(o, s.mode),
  14001. l = m.controls,
  14002. c = m.player,
  14003. h = m.director,
  14004. u = m.tagManager,
  14005. p = m.tileDownloader,
  14006. f = m.qualityManager,
  14007. m.panoRenderer,
  14008. function(e, t, i, n) {
  14009. var r = i.controls
  14010. , o = i.qualityManager
  14011. , a = i.panoRenderer
  14012. , s = i.tileDownloader
  14013. , l = i.modelManager;
  14014. r.init(n, l),
  14015. j.init(i.director, r, i.player, l, t),
  14016. o.init(l),
  14017. s.init(o),
  14018. a.init(t, s, o),
  14019. l.init(s, a, o),
  14020. l.addModel(e),
  14021. t.addComponent(F)
  14022. }(g, d, m, r),
  14023. c.director = h,
  14024. g.supportsTiles && p.start(),
  14025. !o || s.mode === R.PANORAMA && s.pano || (ne.warn("Tried to quickstart, but failed as we are not starting in inside mode."),
  14026. o = !1);
  14027. var e = null;
  14028. if (o) {
  14029. ne.warn("Quickstart engaged. Hold on to your knickers.");
  14030. var t = l.controls[R.PANORAMA];
  14031. a = new q(f,d.scene,d.camera,t,r),
  14032. C(d, r, g),
  14033. e = a.load(s).then(function() {
  14034. d.addComponent(a),
  14035. d.once(ee.AfterRender, function() {
  14036. ne.warn("First render after quickstart load finished.")
  14037. })
  14038. })
  14039. }
  14040. return window.flyToFirst = function() {
  14041. var e = c.model.panos.get("8d778e19657f433fb9cf8947d823bb70")
  14042. , t = new _.Quaternion(.7099827027821568,-.07708150183830938,.6958985789714591,.07555241737970636)
  14043. , i = new _.Vector3(0,0,-1).applyQuaternion(t).add(e.position);
  14044. c.flyToPano({
  14045. pano: e,
  14046. lookAtPoint: i
  14047. })
  14048. }
  14049. ,
  14050. $.when(e, D.startLoading(g, c, h, L.autoplay, o, v))
  14051. }).then(function() {
  14052. return function(e, t, i, n, r) {
  14053. return r.progressCallback = t,
  14054. N.sessionStart(),
  14055. e.load(n).progress(function(e, t) {
  14056. e.modelElementsToLoad = t[1],
  14057. function(e) {
  14058. e.totalElementsToLoad = e.modelElementsToLoad + e.panoElementsToLoad
  14059. }(e),
  14060. function(e) {
  14061. e.totalElementsLoaded++,
  14062. e.totalPercentageLoaded = e.totalElementsLoaded / e.totalElementsToLoad,
  14063. isNaN(e.totalPercentageLoaded) && (e.totalPercentageLoaded = 0),
  14064. e.totalPercentageLoaded = .4 + .6 * e.totalPercentageLoaded,
  14065. console.log("pro:" + e.totalPercentageLoaded),
  14066. e.progressCallback && e.progressCallback(100 * e.totalPercentageLoaded)
  14067. }(e)
  14068. }
  14069. .bind(this, r))
  14070. }(g, D.onProgress, 0, !o, n)
  14071. }).then(function() {
  14072. s.quickstart = o,
  14073. function(e, t, i, n) {
  14074. var r = i.qualityManager
  14075. , o = i.panoRenderer
  14076. , a = i.tileDownloader
  14077. , s = i.modelManager
  14078. , l = i.player
  14079. , c = i.director
  14080. , h = i.tagManager
  14081. , u = i.displayController
  14082. , d = i.labelDisplayController
  14083. , p = i.controls;
  14084. t.scene.add(e),
  14085. t.qualityManager = r;
  14086. var f = {
  14087. camera: t.camera,
  14088. director: c,
  14089. modelManager: s,
  14090. tileDownloader: a,
  14091. panoRenderer: o,
  14092. qualityManager: r,
  14093. tagManager: h,
  14094. container: n,
  14095. controls: p
  14096. };
  14097. l.init(f),
  14098. l.setScene(t.scene),
  14099. h.init(s, l),
  14100. c.init(l, s),
  14101. u.init(c, l, s, h, n),
  14102. d.init(l, s, n),
  14103. B.bindEvents(l),
  14104. t.addComponent(h),
  14105. t.addComponent(l),
  14106. t.addComponent(o),
  14107. l.sceneRenderer = t
  14108. }(g, d, m, r),
  14109. d.started || C(d, r, g),
  14110. N.modelLoaded(g, c, l, L.autoplay),
  14111. function(e, t, i, n) {
  14112. return ne.info("Starting player in " + i.mode),
  14113. N.report(t.sid, "started-playing", n, i.quickstart),
  14114. e.start(i)
  14115. }(c, g, s, L.autoplay).done(function() {
  14116. h.autoTour()
  14117. }),
  14118. g.supportsTiles || new H(g,c).start();
  14119. o && (d.removeComponent(a),
  14120. a.destroy(),
  14121. s.pano.enter()),
  14122. D.init(g, h, c, l, d, s, N.getSessionId()),
  14123. D.endLoading(g, h, u),
  14124. d.once(ee.AfterRender, function() {
  14125. v.setAppReadyTime();
  14126. var e = v.calcFullLoadingTime();
  14127. ne.warn("Total load time: " + e / 1e3),
  14128. N.loadComplete(e),
  14129. ne.warn("First render after model load finished.")
  14130. }),
  14131. d.on(ee.MemoryUsageUpdated, y)
  14132. }).fail(A.bind(this, e))
  14133. }()
  14134. }()
  14135. })
  14136. }
  14137. ).call(this, "/js/main.js")
  14138. }
  14139. , {
  14140. "./DisplayController": 1,
  14141. "./TimingData": 2,
  14142. "./ab": 3,
  14143. "./analytics": 4,
  14144. "./cameras/PanoramaCamera": 7,
  14145. "./controls/CameraControls": 9,
  14146. "./director": 15,
  14147. "./effects": 16,
  14148. "./enum/PanoSizeClass": 36,
  14149. "./enum/PanoramaEvents": 37,
  14150. "./enum/RenderLayers": 41,
  14151. "./enum/SceneRendererEvents": 43,
  14152. "./enum/Viewmode": 51,
  14153. "./featureflags": 59,
  14154. "./gui/error": 64,
  14155. "./gui/gui": 65,
  14156. "./gui/memoryUsage": 73,
  14157. "./label/LabelDisplayController": 91,
  14158. "./lib/array-polyfill": 92,
  14159. "./lib/performance-polyfill": 95,
  14160. "./lib/postprocessing/EffectComposer.js": 96,
  14161. "./lib/postprocessing/MaskPass.js": 97,
  14162. "./lib/postprocessing/RenderPass.js": 98,
  14163. "./lib/postprocessing/ShaderPass.js": 99,
  14164. "./lib/shaders/CopyShader.js": 100,
  14165. "./lib/shaders/HorizontalBlurShader.js": 101,
  14166. "./lib/shaders/VerticalBlurShader.js": 102,
  14167. "./lib/three75-shim": 103,
  14168. "./localization/localize": 108,
  14169. "./tag/tagManager": 124,
  14170. "./model/ModelManager": 140,
  14171. "./objects/Panorama": 148,
  14172. "./objects/Skybox": 152,
  14173. "./player": 155,
  14174. "./preloaders": 156,
  14175. "./scene/QuickstartManager": 157,
  14176. "./scene/SceneRenderer": 158,
  14177. "./sdk/automation.js": 164,
  14178. "./settings": 166,
  14179. "./showcase": 168,
  14180. "./tile/PanoRenderer": 169,
  14181. "./tile/QualityManager.js": 170,
  14182. "./tile/TileDownloader": 171,
  14183. "./util/PanoramaCollection": 178,
  14184. "./util/ajax": 181,
  14185. "./util/browser": 182,
  14186. "./util/camera": 183,
  14187. "./util/common": 185,
  14188. "./util/lerp": 188,
  14189. "./util/logger": 189,
  14190. "./util/math": 190,
  14191. "./util/sentry": 192,
  14192. "./util/showcase": 193,
  14193. "./util/transitions": 195,
  14194. events: 202,
  14195. "promise-polyfill": 213,
  14196. three: 217
  14197. }],
  14198. 117: [function(e, t, i) {
  14199. "use strict";
  14200. function n(e) {
  14201. e = e || {},
  14202. r.RawShaderMaterial.call(this, a.extendObject({
  14203. fragmentShader: o.cube.fragmentShader,
  14204. vertexShader: o.cube.vertexShader,
  14205. uniforms: r.UniformsUtils.clone(o.cube.uniforms),
  14206. name: "CubemapMaterial"
  14207. }, e))
  14208. }
  14209. var r = e("three")
  14210. , o = e("../shaders")
  14211. , a = e("../util/common");
  14212. (n.prototype = Object.create(r.RawShaderMaterial.prototype)).constructor = n,
  14213. t.exports = n
  14214. }
  14215. , {
  14216. "../shaders": 167,
  14217. "../util/common": 185,
  14218. three: 217
  14219. }],
  14220. 118: [function(e, t, i) {
  14221. "use strict";
  14222. function n(e) {
  14223. e = e || {},
  14224. r.RawShaderMaterial.call(this, a.extendObject({
  14225. fragmentShader: o.model.fragmentShader,
  14226. vertexShader: o.model.vertexShader,
  14227. uniforms: r.UniformsUtils.clone(o.model.uniforms),
  14228. name: "ModelTextureMaterial"
  14229. }, e))
  14230. }
  14231. var r = e("three")
  14232. , o = e("../shaders")
  14233. , a = e("../util/common");
  14234. ((n.prototype = Object.create(r.RawShaderMaterial.prototype)).constructor = n).prototype.setProjectedPanos = function(e, t, i) {
  14235. i && (this.uniforms.progress.value = 0),
  14236. e.ensureSkyboxReadyForRender(),
  14237. this.uniforms.pano0Map.value = e.getSkyboxTexture(),
  14238. this.uniforms.pano0Position.value.copy(e.position),
  14239. this.uniforms.pano0Matrix.value.copy(e.skyboxMesh.matrixWorld),
  14240. t.ensureSkyboxReadyForRender(),
  14241. this.uniforms.pano1Map.value = t.getSkyboxTexture(),
  14242. this.uniforms.pano1Position.value.copy(t.position),
  14243. this.uniforms.pano1Matrix.value.copy(t.skyboxMesh.matrixWorld)
  14244. }
  14245. ,
  14246. t.exports = n
  14247. }
  14248. , {
  14249. "../shaders": 167,
  14250. "../util/common": 185,
  14251. three: 217
  14252. }],
  14253. 119: [function(m, v, e) {
  14254. (function(e) {
  14255. "use strict";
  14256. function t(e, t, i, n) {
  14257. this.div = null,
  14258. this.body = null,
  14259. this.label = e,
  14260. this.description = t,
  14261. this.parsedDescription = [],
  14262. this.media = i || {
  14263. type: null
  14264. },
  14265. this.loadingSpinner = null,
  14266. this.parser = new r({
  14267. supportLinks: !c.valueFromHash("mls"),
  14268. keepLinkLabels: !0
  14269. }),
  14270. this.state = g.CLOSED,
  14271. this.orientation = "",
  14272. this.initialTransform = "",
  14273. this.hovering = !1,
  14274. this.openTransition = null,
  14275. this.closeTransition = null,
  14276. this.openPromise = null,
  14277. this.closePromise = null,
  14278. this.animationTransition = null,
  14279. this.animationScale = 0
  14280. }
  14281. var r = m("../Parser/DescriptionParser")
  14282. , i = m("../Media/Link")
  14283. , n = m("../Media/Image")
  14284. , o = m("../Media/EmbedlyPlayer")
  14285. , a = m("../Media/EmbedlyEmbed")
  14286. , s = m("../../util/transitions")
  14287. , l = m("../../util/lerp")
  14288. , c = m("../../util/browser")
  14289. , b = m("./BillboardEvent")
  14290. , w = m("../Media/MediaEvent")
  14291. , h = m("../Parser/DescriptionChunkType")
  14292. , u = m("events").EventEmitter
  14293. , d = m("./billboardSettings")
  14294. , T = m("./overlaySettings")
  14295. , p = new (m("../../util/logger"))(e)
  14296. , f = document.getElementById("tag-billboards");
  14297. f.addEventListener("touchend", function(e) {
  14298. f.style.pointerEvents = "none"
  14299. }),
  14300. f.addEventListener("touchcancel", function(e) {
  14301. f.style.pointerEvents = "none"
  14302. });
  14303. var g = {
  14304. CLOSED: "closed",
  14305. OPENING: "opening",
  14306. OPEN: "open",
  14307. CLOSING: "closing",
  14308. ACTIVE: "active"
  14309. };
  14310. (t.prototype = Object.create(u.prototype)).build = function(e) {
  14311. this.parsedDescription = this.parser.parse(this.description);
  14312. var t = document.createElement("div");
  14313. t.className = "tag-container has-hotzone",
  14314. this.div = t,
  14315. this.body = document.createElement("div"),
  14316. this.body.className = "tag-body";
  14317. var i = document.createElement("div");
  14318. i.classList.add("tag-content");
  14319. var n = document.createElement("div");
  14320. n.classList.add("tag-text-content");
  14321. var r = document.createElement("div");
  14322. r.className = "tag-label",
  14323. r.textContent = this.label,
  14324. n.appendChild(r);
  14325. var o = document.createElement("div");
  14326. o.className = "tag-desc",
  14327. n.appendChild(o),
  14328. i.appendChild(n),
  14329. this.body.appendChild(i),
  14330. this.appendDescriptionElements(this.parsedDescription, o),
  14331. this.appendMedia(),
  14332. t.appendChild(this.body),
  14333. f.appendChild(t),
  14334. this.bindEvents(t, this.body)
  14335. }
  14336. ,
  14337. t.prototype.bindEvents = function(i, e) {
  14338. function t(n) {
  14339. return function(e) {
  14340. if (!this.div.classList.contains("overlay")) {
  14341. var t, i = document.getElementById("player");
  14342. try {
  14343. t = new MouseEvent(n,e)
  14344. } catch (i) {
  14345. (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)
  14346. }
  14347. i.dispatchEvent(t)
  14348. }
  14349. }
  14350. }
  14351. e.addEventListener("mousedown", function(e) {
  14352. e.stopPropagation()
  14353. }),
  14354. e.addEventListener("mouseup", function(e) {
  14355. e.stopPropagation()
  14356. }),
  14357. i.addEventListener("touchstart", function(e) {
  14358. f.style.pointerEvents = "auto"
  14359. }),
  14360. i.addEventListener("mousedown", t("mousedown").bind(this)),
  14361. i.addEventListener("mouseup", t("mouseup").bind(this)),
  14362. e.addEventListener("mouseover", function(e) {
  14363. this.state === g.OPEN && i.classList.remove("has-hotzone")
  14364. }
  14365. .bind(this)),
  14366. i.addEventListener("mouseenter", function(e) {
  14367. this.state !== g.CLOSING && (this.hovering = !0,
  14368. this.emit(b.ENTER))
  14369. }
  14370. .bind(this)),
  14371. i.addEventListener("mouseleave", function(e) {
  14372. this.hovering = !1,
  14373. this.emit(b.LEAVE)
  14374. }
  14375. .bind(this)),
  14376. i.addEventListener("gesturestart", function(e) {
  14377. e.preventDefault()
  14378. });
  14379. var n = i.querySelector(".tag-text-content")
  14380. , r = 0;
  14381. n.addEventListener("touchstart", function(e) {
  14382. r = e.changedTouches[0].clientY
  14383. }),
  14384. n.addEventListener("touchmove", function(t) {
  14385. function e(e) {
  14386. e && (0 === e.scrollTop && t.changedTouches[0].clientY > r || e.scrollTop + e.clientHeight - e.scrollHeight == 0 && t.changedTouches[0].clientY < r) && t.preventDefault()
  14387. }
  14388. return i.classList.contains("overlay") ? e(this.querySelector(".tag-desc")) : void e(this)
  14389. }),
  14390. i.addEventListener("touchmove", function(e) {
  14391. 0 == (n.compareDocumentPosition(e.target) & Node.DOCUMENT_POSITION_CONTAINED_BY) && e.preventDefault()
  14392. })
  14393. }
  14394. ,
  14395. t.prototype.appendDescriptionElements = function(e, i) {
  14396. 0 < e.length && this.div.classList.add("has-text"),
  14397. e.forEach(function(e, t) {
  14398. switch (e.type) {
  14399. case h.TEXT:
  14400. i.appendChild(this.createTextElement(e.text));
  14401. break;
  14402. case h.LINK:
  14403. i.appendChild(this.createLinkElement(e.link))
  14404. }
  14405. }
  14406. .bind(this))
  14407. }
  14408. ,
  14409. t.prototype.appendLoadingSpinner = function() {
  14410. this.loadingSpinner = document.createElement("div"),
  14411. this.loadingSpinner.classList.add("loading-spinner");
  14412. var e = document.createElement("div");
  14413. e.classList.add("gui-spinner-icon"),
  14414. this.loadingSpinner.appendChild(e),
  14415. this.body.appendChild(this.loadingSpinner)
  14416. }
  14417. ,
  14418. t.prototype.onMediaLoadFinished = function() {
  14419. this.loadingSpinner && (this.loadingSpinner.parentNode.removeChild(this.loadingSpinner),
  14420. this.applyOrientation(this.orientation),
  14421. this.loadingSpinner = null)
  14422. }
  14423. ,
  14424. t.prototype.appendMedia = function() {
  14425. if (this.media && this.media.type && "error" !== this.media.type && (!c.valueFromHash("mls", 0) || this.media.type === h.IMAGE)) {
  14426. this.appendLoadingSpinner();
  14427. var e = document.createElement("div");
  14428. e.classList.add("tag-media-content");
  14429. var t = document.createElement("i");
  14430. switch (["icon", "icon-close-thin", "close"].forEach(function(e) {
  14431. t.classList.add(e)
  14432. }),
  14433. this.body.appendChild(t),
  14434. this.body.appendChild(e),
  14435. this.media.type) {
  14436. case h.IMAGE:
  14437. e.appendChild(this.createImageElement(this.media, this.body));
  14438. break;
  14439. case h.VIDEO:
  14440. e.appendChild(this.createVideoElement(this.media, this.body));
  14441. break;
  14442. case h.RICH:
  14443. e.appendChild(this.createEmbedElement(this.media, this.body))
  14444. }
  14445. }
  14446. }
  14447. ,
  14448. t.prototype.createTextElement = function(e) {
  14449. var t = document.createElement("span");
  14450. return t.textContent = e,
  14451. t
  14452. }
  14453. ,
  14454. t.prototype.createLinkElement = function(e) {
  14455. var t = new i(e);
  14456. return t.on(w.LINK_CLICK, this.emit.bind(this, w.LINK_CLICK)),
  14457. t.createDomElement()
  14458. }
  14459. ,
  14460. t.prototype.createImageElement = function(t, C) {
  14461. function e() {
  14462. function e() {
  14463. p || (E.classList.remove("view-image"),
  14464. a.classList.add("overlay"),
  14465. t(),
  14466. window.addEventListener("resize", A),
  14467. a.addEventListener("click", i),
  14468. c.addEventListener("click", r),
  14469. o.addEventListener("click", n),
  14470. p = !0,
  14471. _.emit(w.IMAGE_OPENED))
  14472. }
  14473. function t() {
  14474. C.classList.add("show-info"),
  14475. s.classList.remove("collapsible"),
  14476. s.style.height = "";
  14477. var e = parseFloat(getComputedStyle(v).lineHeight)
  14478. , t = g + e
  14479. , i = a.clientWidth - 2 * T.boundaryWidth - m
  14480. , n = a.clientHeight - 2 * T.boundaryHeight - m - t
  14481. , r = n
  14482. , o = r * I.aspect;
  14483. i < o && (r = (o = i) / I.aspect),
  14484. n < r && (o = (r = n) * I.aspect),
  14485. o += m,
  14486. r += m + t,
  14487. C.style.width = o + "px",
  14488. C.style.height = r + "px",
  14489. l.style.paddingTop = e + m + "px",
  14490. 0 < _.description.length && (s.classList.add("collapsible"),
  14491. s.style.height = s.clientHeight + 12 + "px",
  14492. y.style.height = "calc(100% - " + v.clientHeight + "px)")
  14493. }
  14494. function i(e) {
  14495. e.target === a && n()
  14496. }
  14497. function n() {
  14498. p && (p = !1,
  14499. E.classList.add("view-image"),
  14500. a.classList.remove("overlay"),
  14501. s.style.height = "",
  14502. l.style.paddingTop = "",
  14503. C.style.width = "",
  14504. C.style.height = "",
  14505. window.removeEventListener("resize", A),
  14506. a.removeEventListener("click", i),
  14507. c.removeEventListener("click", r),
  14508. o.removeEventListener("click", n),
  14509. _.emit(w.IMAGE_CLOSED),
  14510. _.close(!0))
  14511. }
  14512. function r(e) {
  14513. C.classList.toggle("show-info")
  14514. }
  14515. var a = _.div
  14516. , s = a.getElementsByClassName("tag-content")[0]
  14517. , l = a.getElementsByClassName("tag-media-content")[0]
  14518. , o = C.getElementsByClassName("close")[0]
  14519. , c = s.getElementsByClassName("tag-label")[0];
  14520. a.classList.add("has-image"),
  14521. E.classList.add("view-image"),
  14522. a.classList.add(1 <= I.aspect ? "image-landscape" : "image-portrait"),
  14523. _.applyOrientation(_.orientation);
  14524. 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,
  14525. function() {
  14526. clearInterval(h),
  14527. clearTimeout(u),
  14528. h = setInterval(function() {
  14529. var e = a.clientHeight;
  14530. d !== e && (t(),
  14531. d = e)
  14532. }, 100),
  14533. u = setTimeout(clearInterval.bind(this, h), 1e3)
  14534. }
  14535. );
  14536. I.on(w.IMAGE_OPENING, e),
  14537. _.on(b.ACTIVATE, e),
  14538. _.on(w.IMAGE_CLOSED, I.onClosed.bind(I)),
  14539. _.on(b.CLOSING, n)
  14540. }
  14541. var I = new n
  14542. , E = I.createDomElement();
  14543. this.once(b.OPENED, function() {
  14544. I.load(t.src).then(e).catch(function(e) {
  14545. p.warn("Failed to load image:", t.src),
  14546. p.warn("with error:", e)
  14547. }).then(this.onMediaLoadFinished.bind(this))
  14548. });
  14549. var _ = this;
  14550. return E
  14551. }
  14552. ,
  14553. t.prototype.createVideoElement = function(t, e) {
  14554. var i = new o({
  14555. autoPlay: !0,
  14556. autoResume: !0,
  14557. startMuted: !1,
  14558. loop: !1
  14559. })
  14560. , n = i.createDomElement();
  14561. return this.once(b.OPENED, function() {
  14562. i.load(t.src).then(function() {
  14563. this.div.classList.add("has-video"),
  14564. this.state !== g.OPEN && this.state !== g.ACTIVE || (i.show(),
  14565. i.play()),
  14566. this.on(b.OPENING, i.show.bind(i)),
  14567. this.on(b.OPENED, i.play.bind(i)),
  14568. this.on(b.CLOSING, i.pause.bind(i)),
  14569. this.on(b.CLOSED, i.hide.bind(i))
  14570. }
  14571. .bind(this)).catch(function(e) {
  14572. p.warn("Failed to embed video:", t.src),
  14573. p.warn("with error:", e)
  14574. }).then(this.onMediaLoadFinished.bind(this))
  14575. }
  14576. .bind(this)),
  14577. n
  14578. }
  14579. ,
  14580. t.prototype.createEmbedElement = function(t, e) {
  14581. var i = new a
  14582. , n = i.createDomElement();
  14583. return this.once(b.OPENED, function() {
  14584. i.load(t.src).then(function() {
  14585. this.div.classList.add("has-embed"),
  14586. this.state !== g.OPEN && this.state !== g.ACTIVE || i.show(),
  14587. this.applyOrientation(this.orientation),
  14588. this.on(b.OPENING, i.show.bind(i)),
  14589. this.on(b.CLOSED, i.hide.bind(i))
  14590. }
  14591. .bind(this)).catch(function(e) {
  14592. p.warn("Failed to embed:", t.src),
  14593. p.warn("with error:", e)
  14594. }).then(this.onMediaLoadFinished.bind(this))
  14595. }
  14596. .bind(this)),
  14597. n
  14598. }
  14599. ,
  14600. t.prototype.open = function(e) {
  14601. return this.openPromise = $.Deferred(),
  14602. this.state === g.ACTIVE ? this.openPromise.resolve().promise() : (this.hovering || this.div.classList.add("has-hotzone"),
  14603. this.openTransition ? e && this.setActiveState() : this.openTransition = s.setTimeout(function() {
  14604. this.state !== g.OPEN && (this.emit(b.OPENING),
  14605. e && this.emit(b.ACTIVATING),
  14606. this.state = g.OPENING,
  14607. this.animateOpen(function() {
  14608. e && this.setActiveState(),
  14609. this.openPromise.resolve()
  14610. }
  14611. .bind(this)))
  14612. }
  14613. .bind(this), d.animation.openDelay),
  14614. s.cancel(this.closeTransition),
  14615. this.closePromise && this.closePromise.reject(),
  14616. this.closeTransition = void 0,
  14617. this.openPromise.promise())
  14618. }
  14619. ,
  14620. t.prototype.close = function(e) {
  14621. return this.closePromise = $.Deferred(),
  14622. !e && this.hovering ? this.closePromise.reject().promise() : (this.closeTransition || (this.closeTransition = s.setTimeout(function() {
  14623. this.state !== g.CLOSED && (this.emit(b.CLOSING),
  14624. this.state = g.CLOSING,
  14625. this.animateClose())
  14626. }
  14627. .bind(this), d.animation.closeDelay)),
  14628. s.cancel(this.openTransition),
  14629. this.openPromise && this.openPromise.reject(),
  14630. this.openTransition = void 0,
  14631. this.closePromise.resolve(),
  14632. this.closePromise.promise())
  14633. }
  14634. ,
  14635. t.prototype.setActiveState = function() {
  14636. this.state !== g.CLOSED && (this.state = g.ACTIVE,
  14637. this.emit(b.ACTIVATE),
  14638. this.div.classList.remove("has-hotzone"))
  14639. }
  14640. ,
  14641. t.prototype.animateOpen = function(e) {
  14642. if (this.state === g.OPENING) {
  14643. if (s.cancel(this.animationTransition),
  14644. c.detectSamsungNative())
  14645. return this.boardOrientation = null,
  14646. this.div.style.visibility = "visible",
  14647. this.emit(b.OPENED),
  14648. this.state = g.OPEN,
  14649. void (e && e());
  14650. this.div.style.webkitTransform = "scale(0)",
  14651. this.div.style.transform = "scale(0)",
  14652. this.div.style.visibility = "visible",
  14653. this.animationTransition = s.start(l.property(this, "animationScale", 1), d.animation.openDuration, function() {
  14654. this.emit(b.OPENED),
  14655. this.state = g.OPEN,
  14656. e && e()
  14657. }
  14658. .bind(this))
  14659. }
  14660. }
  14661. ,
  14662. t.prototype.animateClose = function(e) {
  14663. this.state === g.CLOSING && (s.cancel(this.animationTransition),
  14664. this.animationTransition = s.start(l.property(this, "animationScale", 0), d.animation.closeDuration, function() {
  14665. this.emit(b.CLOSED),
  14666. this.state = g.CLOSED,
  14667. this.div.style.visibility = "hidden",
  14668. this.div.classList.contains("has-hotzone") || this.div.classList.add("has-hotzone"),
  14669. e && e()
  14670. }
  14671. .bind(this)))
  14672. }
  14673. ,
  14674. t.prototype.needsUpdate = function() {
  14675. return this.state !== g.CLOSED
  14676. }
  14677. ,
  14678. t.prototype.update = function(e, t) {
  14679. if (this.needsUpdate()) {
  14680. var i = (this.updateOrientation(e),
  14681. this.calcScale(t))
  14682. , n = {
  14683. x: (e.x + 1) * $("#player").width() / 2,
  14684. y: (e.y + 1) * $("#player").height() / 2
  14685. };
  14686. this.div.screenTransform = this.initialTransform + " translate(" + n.x + "px, " + n.y + "px) scale(" + i * this.animationScale + ")",
  14687. this.div.style.webkitTransform = this.div.screenTransform,
  14688. this.div.style.transform = this.div.screenTransform
  14689. }
  14690. }
  14691. ,
  14692. t.prototype.getDimensions = function() {
  14693. return this.div.getBoundingClientRect()
  14694. }
  14695. ,
  14696. t.prototype.calcScale = function(e) {
  14697. return Math.sqrt(e / 40) * d.boardToDiscRatio
  14698. }
  14699. ,
  14700. t.prototype.updateOrientation = function(e) {
  14701. if (this.state !== g.ACTIVE) {
  14702. var t = e.y < -1 / 3 ? 0 : e.y < 1 / 3 ? 1 : 2
  14703. , i = e.x < -1 / 3 ? 0 : e.x < 1 / 3 ? 1 : 2
  14704. , n = "";
  14705. n += 0 == i ? "right" : 2 == i ? "left" : "",
  14706. n += 0 == t ? "-down" : 2 == t ? "-up" : "",
  14707. 1 == i && (n = 0 == t ? "bottom" : 2 == t ? "top" : "",
  14708. 1 == t && (n = $("#player").width() > $("#player").height() ? e.x < 0 ? "right" : "left" : e.y < 0 ? "bottom" : "top")),
  14709. 1 == i && 1 == t && n === this.orientation || this.applyOrientation(n)
  14710. }
  14711. }
  14712. ,
  14713. t.prototype.applyOrientation = function(e) {
  14714. this.div.style.transform = this.div.style.webkitTransform = "",
  14715. this.div.classList.remove("tag-container-" + this.orientation),
  14716. this.div.classList.add("tag-container-" + e);
  14717. var t = window.getComputedStyle(this.div);
  14718. this.initialTransform = t.transform || t.webkitTransform,
  14719. "none" === this.initialTransform && (this.initialTransform = "");
  14720. var i = t.transform.slice(7, -1).split(",")
  14721. , n = -i[4]
  14722. , r = -i[5];
  14723. this.div.style.webkitTransformOrigin = n + "px " + r + "px",
  14724. this.div.style.transformOrigin = n + "px " + r + "px",
  14725. this.orientation = e
  14726. }
  14727. ,
  14728. v.exports = t
  14729. }
  14730. ).call(this, "/js/tag/Billboard/Billboard.js")
  14731. }
  14732. , {
  14733. "../../util/browser": 182,
  14734. "../../util/lerp": 188,
  14735. "../../util/logger": 189,
  14736. "../../util/transitions": 195,
  14737. "../Media/EmbedlyEmbed": 125,
  14738. "../Media/EmbedlyPlayer": 126,
  14739. "../Media/Image": 128,
  14740. "../Media/Link": 129,
  14741. "../Media/MediaEvent": 131,
  14742. "../Parser/DescriptionChunkType": 133,
  14743. "../Parser/DescriptionParser": 134,
  14744. "./BillboardEvent": 120,
  14745. "./billboardSettings": 121,
  14746. "./overlaySettings": 122,
  14747. events: 202
  14748. }],
  14749. 120: [function(e, t, i) {
  14750. "use strict";
  14751. t.exports = Object.freeze({
  14752. ENTER: "billboard.enter",
  14753. LEAVE: "billboard.leave",
  14754. OPENING: "billboard.opening",
  14755. OPENED: "billboard.open",
  14756. CLOSING: "billboard.closing",
  14757. CLOSED: "billboard.closed",
  14758. ACTIVATING: "billboard.activating",
  14759. ACTIVATE: "billboard.activate"
  14760. })
  14761. }
  14762. , {}],
  14763. 121: [function(e, t, i) {
  14764. "use strict";
  14765. t.exports = Object.freeze({
  14766. animation: Object.freeze({
  14767. hoverOnClosing: !1,
  14768. openDelay: 100,
  14769. closeDelay: 50,
  14770. openDuration: 200,
  14771. closeDuration: 100
  14772. }),
  14773. boardToDiscRatio: 1.2
  14774. })
  14775. }
  14776. , {}],
  14777. 122: [function(e, t, i) {
  14778. "use strict";
  14779. t.exports = Object.freeze({
  14780. boundaryWidth: 30,
  14781. boundaryHeight: 0
  14782. })
  14783. }
  14784. , {}],
  14785. hot: [function(e, t, i) {
  14786. "use strict";
  14787. function n(e, t, i) {
  14788. this.sid = e,
  14789. this.position = this.convertValue(t.position, g.Vector3)
  14790. if(t.quaternion){
  14791. this.quaternion = this.convertValue(t.quaternion, g.Quaternion)
  14792. }else{
  14793. this.rotation = new g.Euler().setFromVector3(this.convertValue(t.rotation, g.Vector3 ))
  14794. }
  14795. this.quaternion || (this.quaternion = new THREE.Quaternion().setFromEuler(this.rotation))
  14796. this.isSprite = t.isSprite
  14797. this.noAction = t.noAction
  14798. this.linkType = t.linkType || "common"
  14799. this.link = t.link,
  14800. this.model = i,
  14801. this.size = t.size;
  14802. this.styleTex = [] // 存储热点icon的图片 [{src:...}, {src:...} ] 最多两个,里面是带有src的object, 可以是img
  14803. this.build()
  14804. t.infoAttribute && t.infoAttribute.title && this.createTitleElem(t.infoAttribute.title)
  14805. this.changeTex()
  14806. this.setVisiblePanos(t.visiblePanos);
  14807. this.infoAttribute = t.infoAttribute;
  14808. }
  14809. var g = e("three")
  14810. , r = e("../shaders")
  14811. , m = e("../settings")
  14812. , v = e("../enum/Viewmode")
  14813. , d = e("../objects/Panorama")
  14814. , o = e("../util/texture")
  14815. , math = e("../util/math")
  14816. , p = new g.Raycaster
  14817. , a = new g.PlaneBufferGeometry(g_HotMeshSize.g_HotMeshWidth,g_HotMeshSize.g_HotMeshHeight,1,1)
  14818. var defaultTex1 = o.load(g_HotImage.point);
  14819. var defaultTex2 = o.load(g_HotImage.point2)
  14820. n.prototype.changeTex = function(){
  14821. var u = this.mesh.material.uniforms
  14822. if(this.styleTex.length){
  14823. u.texture1.value = o.load(this.styleTex[0].src);
  14824. u.texture2.value = o.load(this.styleTex[1]&&this.styleTex[1].src || this.styleTex[0].src);
  14825. }else{
  14826. u.texture1.value = defaultTex1;
  14827. u.texture2.value = defaultTex2;
  14828. }
  14829. }
  14830. n.prototype.initStyleImg = function(t){
  14831. this.styleTex = []
  14832. t.styleImg = t.styleImg || [];
  14833. t.styleImg.forEach((src)=>{
  14834. this.styleTex.push({src:manage.dealURL(src)})
  14835. })
  14836. this.changeTex()
  14837. }
  14838. n.prototype.update = function(camera) {
  14839. if(this.isSprite){
  14840. this.mesh.quaternion.copy(camera.quaternion)
  14841. }
  14842. if(window.hotNeedUpdatePannel == this){
  14843. this.updatePannel()
  14844. }
  14845. }
  14846. n.prototype.setVisiblePanos = function(visibleData){
  14847. if(visibleData == "get"){
  14848. this.visiblePanos = player.model.panos.list.map((pano)=>{return pano.id})
  14849. }else if(visibleData){
  14850. this.visiblePanos = visibleData;
  14851. }
  14852. }
  14853. n.prototype.build = function() {
  14854. var t = g.UniformsUtils.clone(r.hot.uniforms);
  14855. var e = new g.Mesh(a, new g.ShaderMaterial({
  14856. uniforms: t,
  14857. vertexShader: r.hot.vertexShader,
  14858. fragmentShader: r.hot.fragmentShader,
  14859. transparent: !0
  14860. }))
  14861. , t = parseFloat(window.MP_PREFETCHED_MODELDATA.hotIconScale);
  14862. e.dynamic = !0,
  14863. e.position.copy(this.position);
  14864. e.quaternion.copy(this.quaternion)
  14865. t && e.scale.set(t, t, t),
  14866. e.name = this.sid,
  14867. e.type = "hotSprite",
  14868. (e.belongHot = this).link && (e.hotLink = this.link),
  14869. this.mesh = e,
  14870. this.model.add(e),
  14871. g_HotMeshes.push(e);
  14872. }
  14873. n.prototype.showPannel = function(){
  14874. var hardware = this.hardwareTemp || this.infoAttribute.hardware //hardwareTemp为编辑时绝对有的,如果是{}代表没有
  14875. if(hardware && hardware.id!=void 0){
  14876. $("#hotPannel>div").css("display","block");
  14877. $("#hotPannel .title").text(hardware.name);
  14878. this.updatePannel()
  14879. window.hotNeedUpdatePannel = this
  14880. return true
  14881. }else{
  14882. $("#hotPannel>div").css("display","");
  14883. window.hotNeedUpdatePannel = null
  14884. }
  14885. }
  14886. n.prototype.updatePannel = function(){
  14887. var pos = math.getPos2d(this.position, player.camera, $("#player")[0]);
  14888. if(pos.trueSide){
  14889. $("#hotPannel>div").css( {display:'block', "left" : `${pos.pos.x}px`, "top": `${pos.pos.y}px ` });
  14890. }else{
  14891. $("#hotPannel>div").css({display:'none'})
  14892. }
  14893. }
  14894. n.prototype.createTitleElem = function(title){
  14895. var root = $("#hot");
  14896. var elem = $(`<div> ${title}</div>`)
  14897. root.append(elem);
  14898. this.titleElem = elem;
  14899. }
  14900. n.prototype.showTitle = function(){
  14901. if(!this.titleElem)return;
  14902. var pos = math.getPos2d(this.position, player.camera, $("#player")[0])
  14903. this.titleElem.css( { "left" : `${pos.pos.x}px`, "top": `${pos.pos.y}px ` });
  14904. this.titleElem.css("display","block");
  14905. }
  14906. n.prototype.hideTitle = function(){
  14907. if(!this.titleElem)return;
  14908. this.titleElem.css("display","none");
  14909. }
  14910. ,
  14911. n.prototype.closestPanoTowardTag = function(e, t) {
  14912. var i = []
  14913. , n = []
  14914. , r = this.mesh.position;
  14915. if (e === v.PANORAMA) {
  14916. var o = t.position.clone().sub(r).normalize();
  14917. n.push(d.scoreFunctions.direction(r, o))
  14918. }
  14919. var a = new g.Vector3;
  14920. i.push(function(e) {
  14921. return Math.abs(e.position.x - r.x) > m.tags.visibility.cameraClearance || Math.abs(e.position.z - r.z) > m.tags.visibility.cameraClearance
  14922. }, function(e) {
  14923. a.copy(r).sub(e.position);
  14924. var t = -g.Math.radToDeg(Math.atan(a.y / Math.sqrt(a.x * a.x + a.z * a.z)))
  14925. , i = m.tags.navigate.tiltTolerance;
  14926. return m.insideLookLimitDown - i < t && t < m.insideLookLimitUp + i
  14927. },
  14928. (pano)=>{ // add
  14929. player.checkHasNeighbor(pano)
  14930. }
  14931. ),
  14932. n.push(d.scoreFunctions.distanceSquared(this.mesh, -2));
  14933. var s = t.model.panos.sortByScore(i, n);
  14934. if (s && m.tags.navigate.lineOfSight) {
  14935. for (var l = 0; l < s.length; l++) {
  14936. var c = s[l].pano
  14937. , h = c.position.distanceTo(r);
  14938. p.set(c.position, r.clone().sub(c.position).normalize());
  14939. var u = p.intersectObjects(t.model.colliders);
  14940. if (0 === u.length || u[0].distance > h)
  14941. return console.log(l),
  14942. c
  14943. }
  14944. return null
  14945. }
  14946. return s && 0 < s.length && s[0].pano
  14947. }
  14948. var getLink = function(link){
  14949. var src = '';
  14950. var r = link.substring(link.indexOf("html") + 4)
  14951. , o = "en" == manage.number("lang") ? "&lang=" + manage.number("lang") : "";
  14952. -1 == r.indexOf("?") ? src = link + "?time=" + randomTime().getTime() + "&id=" + window.number + o : src = link + "&time=" + randomTime().getTime() + "&id=" + window.number + o
  14953. return src
  14954. }
  14955. n.prototype.examine = function(e, options) {
  14956. options = options || {}
  14957. var hotPop = document.getElementById('popup');
  14958. var hasHardware
  14959. if(window.MP_PREFETCHED_MODELDATA.flyInOnlyBySwitch){
  14960. hasHardware = this.showPannel();
  14961. if(player.mode != 'panorama' || !player.currentPano)return;
  14962. }else{
  14963. if(this.linkType!="common" && this.infoAttribute.iframe && this.infoAttribute.iframe[0] && !options.dontOpen){
  14964. var src = getLink(this.infoAttribute.iframe[0]);
  14965. if(this.linkType=="jumpLink"){
  14966. var newPage = window.open(src, "_blank" );
  14967. newPage.focus();
  14968. }else if(this.linkType=="iframeDiv"){
  14969. var div = document.createElement("div");
  14970. $("body").append(div);
  14971. div.style.position = 'fixed';
  14972. div.style.width = div.style.height = "100%";
  14973. div.style.left = div.style.top = '0';
  14974. div.style["z-index"] = "999"
  14975. var exit = document.createElement("div");
  14976. exit.style["background-image"] = "url(images/vrOffImg.png)";
  14977. exit.style.position = 'absolute';
  14978. exit.style.width = exit.style.height = "50px";
  14979. exit.style.left = '17px'; exit.style.top = "20px"
  14980. exit.style.cursor = "pointer";
  14981. exit.style["background-repeat"] = "no-repeat";
  14982. exit.style["background-size"] = "25%";
  14983. exit.style["background-position"] = "center center";
  14984. exit.style["background-color"] = "rgba(0, 0, 0, 0.2)";
  14985. exit.style["border-radius"] = "50%";
  14986. exit.style["z-index"] = "3"
  14987. exit.onclick = ()=>{
  14988. $(div).remove()
  14989. if(g_bgAudio && g_bgAudio.pauseByHot){
  14990. manage.switchBgmState(true)
  14991. }
  14992. }
  14993. var myElement = document.createElement("iframe");
  14994. myElement.style.position = 'absolute';
  14995. myElement.style.width = myElement.style.height = "100%";
  14996. myElement.style.left = myElement.style.top = '0';
  14997. myElement.src = src
  14998. div.appendChild(exit);
  14999. div.appendChild(myElement)
  15000. if(g_bgAudio && !g_bgAudio.paused){
  15001. manage.switchBgmState(false);
  15002. g_bgAudio.pauseByHot = true
  15003. }
  15004. if(g_tourAudio)g_tourAudio.pause()
  15005. }
  15006. return;
  15007. }
  15008. }
  15009. if(!player.currentPano)return;
  15010. var i = document.getElementById("popup");
  15011. if (this.link && !options.dontOpen && !hasHardware) {
  15012. g_currentHot = this,
  15013. i.style.display = "block",
  15014. i.classList.add("wait");
  15015. var n = document.createElement("iframe");
  15016. if(g_bgAudio && !g_bgAudio.paused){
  15017. manage.switchBgmState(false);
  15018. g_bgAudio.pauseByHot = true
  15019. }
  15020. if(g_tourAudio)g_tourAudio.pause()
  15021. var src = getLink(this.link )
  15022. n.src = src;
  15023. n.id = "id1",
  15024. n.allowTransparency = "true";
  15025. var a = document.getElementById("id1");
  15026. if (void 0 === a || null == a) {
  15027. document.querySelector(".popup-content").appendChild(n);
  15028. var s = !1;
  15029. window.loaddingSuccess = function() {
  15030. s = !0
  15031. }
  15032. ,
  15033. setTimeout(function e() {
  15034. if (s) {
  15035. var t = document.querySelector("#id1").contentWindow.document;
  15036. t.querySelector("video") && (t.querySelector("video").play(),
  15037. !t.querySelector("video").paused && t.querySelector(".playPause") && t.querySelector(".playPause").classList.add("fa-pause")),
  15038. t.querySelector("audio") && t.querySelector("audio").play()
  15039. } else
  15040. setTimeout(e, 300)
  15041. }, 800)
  15042. }
  15043. }
  15044. var l = e.mode
  15045. , c = m.tags.navigate.nearestPano && this.closestPanoTowardTag(l, e.currentPano) || e.currentPano
  15046. , h = this.mesh.position;
  15047. e.flyingToTag = !0;
  15048. var u = function() {
  15049. e.flyingToTag = !1;
  15050. options.dontOpen || this.link && i.classList.remove("wait")
  15051. }
  15052. .bind(this);
  15053. if (l === v.PANORAMA) {
  15054. var d = {
  15055. pano: c,
  15056. lookAtPoint: h,
  15057. duration: null,
  15058. maxDistanceOverride: null,
  15059. skipWarpingCheck: !1
  15060. };
  15061. e.flyToPano(d, u)
  15062. } else {
  15063. var p = {
  15064. pano: c
  15065. };
  15066. if (h) {
  15067. var f = (new g.Matrix4).lookAt(c.position, h, new g.Vector3(0,1,0));
  15068. p.quaternion = (new g.Quaternion).setFromRotationMatrix(f)
  15069. }
  15070. p.callback = u,
  15071. p.duration = 1500,
  15072. p.mode = v.PANORAMA,
  15073. e.flyToNewMode(p)
  15074. }
  15075. }
  15076. ,
  15077. n.prototype.dispose = function(){
  15078. this.mesh.parent.remove(this.mesh);
  15079. var index = g_HotMeshes.indexOf(this.mesh);
  15080. g_HotMeshes.splice(index,1)
  15081. }
  15082. /* n.prototype.conversionArray = function(e) {
  15083. if ("[object Array]" == Object.prototype.toString.call(e))
  15084. return e;
  15085. var t = [];
  15086. for (var i in e)
  15087. t.push(parseFloat(e[i]));
  15088. return t
  15089. } */
  15090. n.prototype.convertValue = function(v ,Type){
  15091. var value;
  15092. if(v instanceof Array){
  15093. v.forEach((v1)=>{v1 = parseFloat(v1)})
  15094. value = new Type().fromArray(v);
  15095. }else{
  15096. for(let i in v){v[i] = parseFloat(v[i])}
  15097. value = new Type().copy(v);
  15098. }
  15099. return value
  15100. }
  15101. ,
  15102. t.exports = n
  15103. }
  15104. , {
  15105. three: 217,
  15106. "../shaders": 167,
  15107. "../enum/Viewmode": 51,
  15108. "../objects/Panorama": 148,
  15109. "../util/texture": 194,
  15110. "../settings": 166,
  15111. "../util/math": 190,
  15112. }],
  15113. 123: [function(M, R, e) {
  15114. (function(e) {
  15115. "use strict";
  15116. function d(e, t, i) {
  15117. var n = i.version || "0";
  15118. "0" !== n && w.info("tag defined using version " + n),
  15119. this.model = e,
  15120. this.sid = t,
  15121. this.color = (new f.Color).set(i.color || o.tagDefault),
  15122. this.hoverColor = o._darken(this.color, .2),
  15123. this.floor = null,
  15124. this.floorIndex = i.floor,
  15125. this.mode = m.PANORAMA,
  15126. i.preferred_camera && i.preferred_camera.mode && (this.mode = i.preferred_camera.mode),
  15127. this.obj3d = null,
  15128. this.disc = null,
  15129. this.materials = {
  15130. disc: null,
  15131. pole: null
  15132. },
  15133. this.position = (new f.Vector3).copy(i.position),
  15134. this.discPosition = (new f.Vector3).copy(i.stem.direction),
  15135. this.discWorldPosition = null,
  15136. this.discScale = .05,
  15137. this.poleEnabled = i.stem.enabled,
  15138. this.billboard = new r(i.label,i.description,i.media,this),
  15139. this.visibleTransition = null,
  15140. this.hoveringDisc = !1
  15141. }
  15142. 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"),
  15143. 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);
  15144. d.prototype = Object.create(b.prototype),
  15145. d.raycaster = new f.Raycaster,
  15146. d.prototype.bindEvents = function() {
  15147. this.billboard.on(_.ENTER, this.setHoverState.bind(this)),
  15148. this.billboard.on(_.LEAVE, this.setFreeState.bind(this))
  15149. }
  15150. ,
  15151. d.prototype.build = function() {
  15152. return this.floor = this.model.floors.get(this.floorIndex) || this.model.floors.first(),
  15153. this.floor && (this.billboard.build(this.model.sid),
  15154. this.obj3d = this.buildObject3D(),
  15155. this.floor.add(this.obj3d)),
  15156. this
  15157. }
  15158. ,
  15159. d.prototype.buildObject3D = function() {
  15160. var e = new f.Object3D;
  15161. e.position.copy(this.position);
  15162. var t = f.UniformsUtils.clone(A.tagDisc.uniforms);
  15163. t.bg.value = x,
  15164. t.mask.value = T,
  15165. t.color.value.copy(this.color),
  15166. this.materials.disc = new f.RawShaderMaterial({
  15167. transparent: !0,
  15168. vertexShader: A.tagDisc.vertexShader,
  15169. fragmentShader: A.tagDisc.fragmentShader,
  15170. uniforms: t
  15171. }),
  15172. this.disc = new f.Mesh(S,this.materials.disc),
  15173. this.disc.layers.set(a.TAG),
  15174. this.disc.position.copy(this.discPosition),
  15175. this.disc.renderOrder = s.tagDisc;
  15176. var i = (this.disc.tag = this).buildPole();
  15177. return i.layers.set(a.TAG),
  15178. i.renderOrder = s.tagStem,
  15179. e.add(i),
  15180. e.layers.set(a.TAG),
  15181. e.add(this.disc)
  15182. }
  15183. ,
  15184. d.prototype.buildPole = function() {
  15185. var e = new f.BufferGeometry
  15186. , t = new Float32Array(6);
  15187. return t[0] = t[1] = t[2] = 0,
  15188. t[3] = this.discPosition.x,
  15189. t[4] = this.discPosition.y,
  15190. t[5] = this.discPosition.z,
  15191. e.addAttribute("position", new f.BufferAttribute(t,3)),
  15192. this.materials.pole = new f.LineBasicMaterial({
  15193. linewidth: g.tags.pole.width,
  15194. color: g.tags.pole.color,
  15195. opacity: 0,
  15196. visible: this.poleEnabled,
  15197. transparent: !0,
  15198. depthWrite: !1
  15199. }),
  15200. new f.Line(e,this.materials.pole)
  15201. }
  15202. ,
  15203. d.prototype.setFreeState = function(e) {
  15204. !e && this.hoveringDisc || this.billboard.close(e).then(function() {
  15205. this.materials.disc.uniforms.color.value = this.color
  15206. }
  15207. .bind(this))
  15208. }
  15209. ,
  15210. d.prototype.setHoverState = function(e) {
  15211. this.billboard.open(e),
  15212. this.materials.disc.uniforms.color.value = this.hoverColor
  15213. }
  15214. ,
  15215. d.prototype.hide = function(e, t) {
  15216. var i = $.Deferred();
  15217. if (0 === this.materials.disc.uniforms.opacity.value && !C.isRunning(this.visibleTransition))
  15218. return i.resolve().promise();
  15219. e = e || 0,
  15220. t = t || 0,
  15221. C.cancel(this.visibleTransition);
  15222. var n, r, o, a = this.materials.disc.uniforms.opacity.value / g.tags.disc.opacity, s = t + e, l = t / s;
  15223. return this.visibleTransition = C.start((n = this,
  15224. r = I.property(n.materials.disc.uniforms.opacity, "value", 0),
  15225. o = I.property(n.materials.pole, "opacity", 0),
  15226. function(e) {
  15227. r(e),
  15228. n.materials.pole && o(e)
  15229. }
  15230. ), s * a, function() {
  15231. i.resolve()
  15232. }, l, E[g.warp.blendEasing]),
  15233. i.promise()
  15234. }
  15235. ,
  15236. d.prototype.show = function(e, t) {
  15237. var i = $.Deferred();
  15238. if (this.materials.disc.uniforms.opacity.value === g.tags.disc.opacity && !C.isRunning(this.visibleTransition))
  15239. return i.resolve().promise();
  15240. e = e || 0,
  15241. t = t || 0,
  15242. C.cancel(this.visibleTransition);
  15243. 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;
  15244. return this.visibleTransition = C.start((n = this,
  15245. r = I.property(n.materials.disc.uniforms.opacity, "value", g.tags.disc.opacity),
  15246. o = I.property(n.materials.pole, "opacity", g.tags.pole.opacity),
  15247. function(e) {
  15248. r(e),
  15249. n.materials.pole && o(e)
  15250. }
  15251. ), s * a, function() {
  15252. i.resolve()
  15253. }, l, E[g.warp.blendEasing]),
  15254. i.promise()
  15255. }
  15256. ,
  15257. d.prototype.closestPanoTowardTag = function(e, t) {
  15258. var i = []
  15259. , n = []
  15260. , r = this.disc.getWorldPosition();
  15261. if (e === m.PANORAMA) {
  15262. var o = t.position.clone().sub(r).normalize();
  15263. i.push(y.filters.isPanoAligned()),
  15264. i.push(y.filters.inPanoDirection(r, o, .5)),
  15265. i.push(y.filters.isNeighbourPanoTo(t)),
  15266. n.push(y.scoreFunctions.direction(r, o))
  15267. }
  15268. var a = new f.Vector3;
  15269. i.push(function(e) {
  15270. return Math.abs(e.position.x - r.x) > g.tags.visibility.cameraClearance || Math.abs(e.position.z - r.z) > g.tags.visibility.cameraClearance
  15271. }, function(e) {
  15272. a.copy(r).sub(e.position);
  15273. var t = -f.Math.radToDeg(Math.atan(a.y / Math.sqrt(a.x * a.x + a.z * a.z)))
  15274. , i = g.tags.navigate.tiltTolerance;
  15275. return g.insideLookLimitDown - i < t && t < g.insideLookLimitUp + i
  15276. }),
  15277. n.push(y.scoreFunctions.distanceSquared(this, -2));
  15278. var s = this.model.panos.sortByScore(i, n);
  15279. if (g.tags.navigate.lineOfSight) {
  15280. for (var l = 0; l < s.length; l++) {
  15281. var c = s[l].pano
  15282. , h = c.position.distanceTo(r);
  15283. if (!g.tags.visibility.anyDistance && h > g.tags.visibility.visibleDistance)
  15284. return null;
  15285. d.raycaster.set(c.position, r.clone().sub(c.position).normalize());
  15286. var u = d.raycaster.intersectObjects(this.model.colliders);
  15287. if (0 === u.length || u[0].distance > h)
  15288. return c
  15289. }
  15290. return null
  15291. }
  15292. return 0 < s.length && s[0].pano
  15293. }
  15294. ,
  15295. d.prototype.examine = function(i) {
  15296. if(!player.currentPano)return;
  15297. var e = i.mode
  15298. , n = g.tags.navigate.nearestPano && this.closestPanoTowardTag(e, i.currentPano) || i.currentPano
  15299. , t = this.disc.getWorldPosition();
  15300. this.billboard.setActiveState();
  15301. var r = function() {
  15302. var e = this.billboard.getDimensions()
  15303. , t = new f.Vector3;
  15304. v.convertScreenPositionToNDC(e.left + e.width / 2, e.top + e.height / 2, t),
  15305. t.unproject(i.camera),
  15306. i.flyToPano({
  15307. pano: n,
  15308. lookAtPoint: t
  15309. })
  15310. }
  15311. .bind(this);
  15312. if (e === m.PANORAMA)
  15313. if (n !== i.currentPano) {
  15314. var o = {
  15315. pano: n,
  15316. lookAtPoint: t,
  15317. duration: null,
  15318. maxDistanceOverride: null,
  15319. skipWarpingCheck: !1
  15320. };
  15321. i.flyToPano(o, r)
  15322. } else
  15323. setTimeout(function() {
  15324. this.billboard.open().then(function() {
  15325. r()
  15326. })
  15327. }
  15328. .bind(this), 0);
  15329. else {
  15330. var a = {
  15331. pano: n
  15332. };
  15333. if (t) {
  15334. var s = (new f.Matrix4).lookAt(n.position, t, new f.Vector3(0,1,0));
  15335. a.quaternion = (new f.Quaternion).setFromRotationMatrix(s)
  15336. }
  15337. a.callback = r,
  15338. a.duration = 1500,
  15339. a.mode = m.PANORAMA,
  15340. i.flyToNewMode(a)
  15341. }
  15342. }
  15343. ,
  15344. d.prototype.update = (n = new f.Vector3,
  15345. function(e, t) {
  15346. this.discWorldPosition = this.disc.getWorldPosition(),
  15347. this.updateDisc(e, t),
  15348. this.billboard.needsUpdate() && (n.copy(this.discWorldPosition).project(t),
  15349. n.z < 1 && (n.y *= -1,
  15350. this.billboard.update(n, this.getDiscRadius(n, t))))
  15351. }
  15352. ),
  15353. d.prototype.updateDisc = (l = new f.Vector3,
  15354. c = new f.Vector3,
  15355. h = new f.Vector3,
  15356. u = new f.Vector3,
  15357. p = new f.Vector3,
  15358. function(e, t) {
  15359. var i = g.tags.visibility
  15360. , n = g.tags.disc.scale
  15361. , r = e === m.DOLLHOUSE || e === m.FLOORPLAN ? g.tags.visibility.visibleDistance : t.position.distanceTo(this.discWorldPosition);
  15362. 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)),
  15363. this.obj3d.visible) {
  15364. this.disc.quaternion.copy(t.quaternion);
  15365. var o = n.maxSize - (n.maxSize - n.minSize) * f.Math.smoothstep(r, n.nearBound, n.farBound);
  15366. l.copy(this.discWorldPosition).project(t),
  15367. c.set($("#player").width() / 2, $("#player").height() / 2, 1).multiply(l),
  15368. h.set(o / 2, 0, 0).add(c),
  15369. u.set(2 / $("#player").width(), 2 / $("#player").height(), 1).multiply(h),
  15370. p.copy(u).unproject(t);
  15371. var a = p.distanceTo(this.discWorldPosition)
  15372. , s = 1 + g.tags.disc.scale.responsiveness / 100 * (d.viewportScale() - 1);
  15373. this.discScale = a * s,
  15374. this.disc.scale.set(this.discScale, this.discScale, this.discScale)
  15375. }
  15376. }
  15377. ),
  15378. d.prototype.getDiscRadius = (i = new f.Vector3,
  15379. function(e, t) {
  15380. return i.set(-this.discScale / 2, 0, 0).applyQuaternion(t.quaternion).add(this.discWorldPosition).project(t),
  15381. Math.abs(e.x - i.x) * $("#player").width()
  15382. }
  15383. ),
  15384. d.prototype.tagVisibleOnCurrentFloor = function(e) {
  15385. return !(e === m.DOLLHOUSE || e === m.FLOORPLAN) || this.model.allFloorsVisible || !this.floor.hidden
  15386. }
  15387. ,
  15388. d.prototype.offScreen = function(e, t) {
  15389. var i = e.getWorldPosition().project(t);
  15390. return !(-1 < i.x && i.x < 1 && -1 < i.y && i.y < 1)
  15391. }
  15392. ,
  15393. d.viewportScale = function() {
  15394. return d.viewportWidth === $("#player").width() && d.viewportHeight === $("#player").height() || (d.viewportWidth = $("#player").width(),
  15395. d.viewportHeight = $("#player").height(),
  15396. d.currentViewportScale = Math.sqrt(Math.min(d.viewportWidth, d.viewportHeight) / g.tags.disc.scale.baseViewportSize)),
  15397. d.currentViewportScale
  15398. }
  15399. ,
  15400. R.exports = d
  15401. }
  15402. ).call(this, "/js/tag/tag.js")
  15403. }
  15404. , {
  15405. "../enum/Colors": 19,
  15406. "../enum/RenderLayers": 41,
  15407. "../enum/RenderOrder": 42,
  15408. "../enum/Viewmode": 51,
  15409. "../objects/Panorama": 148,
  15410. "../settings": 166,
  15411. "../shaders": 167,
  15412. "../util/common": 185,
  15413. "../util/easing": 186,
  15414. "../util/lerp": 188,
  15415. "../util/logger": 189,
  15416. "../util/math": 190,
  15417. "../util/texture": 194,
  15418. "../util/transitions": 195,
  15419. "./Billboard/Billboard": 119,
  15420. "./Billboard/BillboardEvent": 120,
  15421. events: 202,
  15422. three: 217
  15423. }],
  15424. 124: [function(M, R, e) {
  15425. (function(e) {
  15426. "use strict";
  15427. function t() {
  15428. this.tagState = T.IDLE,
  15429. this.intersectTag = null,
  15430. this.hoveredTag = null,
  15431. this.activeTag = null,
  15432. this.tagDiscs = [],
  15433. this.raycaster = new i.Raycaster,
  15434. this.modelManager = null,
  15435. this.player = null,
  15436. this.totaltags = 0,
  15437. this.navigatingViaTag = !1,
  15438. this.enabled = !1
  15439. }
  15440. 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"),
  15441. M("../enum/TagStates")), x = M("events").EventEmitter, S = new n(e);
  15442. r.extend(t, x),
  15443. t.prototype.init = function(e, t) {
  15444. this.modelManager = e,
  15445. this.player = t,
  15446. this.updateModel(),
  15447. this.bindEvents()
  15448. }
  15449. ,
  15450. t.prototype.update = function(e) {
  15451. this.updateTags(this.player.mode, this.player.camera, this.player.currentPano, this.player.flying)
  15452. }
  15453. ,
  15454. t.prototype.updateTags = function(e, t, i, n) {
  15455. for (var r in this.model.tags)
  15456. this.model.tags[r].update(e, t, i, n)
  15457. }
  15458. ,
  15459. t.prototype.updateModel = function() {
  15460. this.model = this.modelManager.getActiveModel(),
  15461. this.gettagsFromModel(),
  15462. this.totaltags = Object.keys(this.model.tags).length
  15463. }
  15464. ,
  15465. t.prototype.gettagsFromModel = function() {
  15466. for (var e in this.tagDiscs = [],
  15467. this.model.tags) {
  15468. var t = this.model.tags[e].disc;
  15469. t && this.tagDiscs.push(t)
  15470. }
  15471. }
  15472. ,
  15473. t.prototype.bindEvents = function() {
  15474. function e() {
  15475. Object.keys(this.model.tags).forEach(function(e) {
  15476. var t = this.model.tags[e];
  15477. t.bindEvents(),
  15478. t.billboard.on(y.LINK_CLICK, function(e) {
  15479. e.type === A.NAVIGATION && this.navigateViaLink(e.url)
  15480. }
  15481. .bind(this)),
  15482. t.billboard.on(y.IMAGE_OPENED, function() {
  15483. this.tagState = T.EXAMINE,
  15484. this.emit(y.IMAGE_OPENED)
  15485. }
  15486. .bind(this)),
  15487. t.billboard.on(v.CLOSING, this.dismissExaminedTag.bind(this))
  15488. }
  15489. .bind(this))
  15490. }
  15491. this.modelManager.on(_.ActiveModelChanged, this.updateModel.bind(this)),
  15492. this.modelManager.on(_.ActiveModelChanged, e.bind(this)),
  15493. this.player.on(w.ModeChanging, this.onPlayerModeChanging.bind(this)),
  15494. this.player.on(w.PanoChosen, this.onPanoChange.bind(this)),
  15495. this.player.on(w.Ready, this.onPlayerReady.bind(this)),
  15496. this.player.on(w.FlyingEnded, this.onPlayerFlyingEnded.bind(this)),
  15497. this.player.on(w.WarpStarted, this.handleWarpStart.bind(this)),
  15498. this.player.on(w.WarpInterrupted, this.handleWarpInterruption.bind(this)),
  15499. e.call(this)
  15500. }
  15501. ,
  15502. t.prototype.navigateViaLink = function(e) {
  15503. var t = a.deserialize(e);
  15504. if (t)
  15505. if (t.mode === C.PANORAMA) {
  15506. try {
  15507. this.player.model.panos.get(t.panoId)
  15508. } catch (e) {
  15509. return void S.warn("Unable to find panorama location", t.panoId)
  15510. }
  15511. this.player.warpToPanoById(t.panoId, t.quaternion, null, null, I.BLACK)
  15512. } else {
  15513. var i = {
  15514. cameraMode: t.mode,
  15515. position: t.position,
  15516. quaternion: t.quaternion,
  15517. scanId: t.panoId,
  15518. orthoZoom: t.zoom,
  15519. floorVisibility: t.floorVisibility,
  15520. thumbUrl: null,
  15521. name: null
  15522. };
  15523. this.player.flyToNewMode({
  15524. mode: t.mode,
  15525. duration: m.warp.outsideTime,
  15526. warpDest: new g(i),
  15527. force: !0
  15528. })
  15529. }
  15530. }
  15531. ,
  15532. t.prototype.handleWarpStart = function(e, t, i, n) {
  15533. this.dismissExaminedTag(),
  15534. t === I.BLACK && (null != n || (n = m.warp.teleportTime),
  15535. e && (i = E.END),
  15536. this.hideShowTagsForBlackoutStyle(i, n))
  15537. }
  15538. ,
  15539. t.prototype.handleWarpInterruption = function(e, t, i) {
  15540. null != i || (i = m.warp.teleportTime),
  15541. this.hideShowTagsForBlackoutStyle(t, i)
  15542. }
  15543. ,
  15544. t.prototype.hideShowTagsForBlackoutStyle = function(e, t) {
  15545. var i = 0
  15546. , n = 0
  15547. , r = t / 2;
  15548. switch (null != e || (e = E.MIDDLE),
  15549. e) {
  15550. case E.END:
  15551. this.hideAlltags(r);
  15552. break;
  15553. case E.BEGINNING:
  15554. this.hideAlltags().done(this.showAlltags.bind(this, r));
  15555. break;
  15556. case E.NONE:
  15557. break;
  15558. case E.MIDDLE:
  15559. n = i = r,
  15560. this.hideAlltags(n),
  15561. setTimeout(function() {
  15562. this.showAlltags(i)
  15563. }
  15564. .bind(this), n);
  15565. break;
  15566. case E.FADEIN:
  15567. setTimeout(function() {
  15568. this.showAlltags(r)
  15569. }
  15570. .bind(this), r)
  15571. }
  15572. }
  15573. ,
  15574. t.prototype.onPlayerModeChanging = function(e, t) {
  15575. t !== C.PANORAMA && this.dismissExaminedTag(),
  15576. t === C.PANORAMA && player.currentPano && !player.currentPano.isAligned() && (t = C.OUTDOOR);
  15577. var i = t !== C.OUTDOOR;
  15578. i !== this.model.tagsShown && (i ? this.showAlltags(m.tags.startup.fadeInDuration) : this.hideAlltags(m.tags.startup.fadeInDuration))
  15579. }
  15580. ,
  15581. t.prototype.onPanoChange = function(e, t) {
  15582. var i = this.navigatingViaTag;
  15583. if (this.navigatingViaTag = !1,
  15584. !i) {
  15585. this.dismissExaminedTag();
  15586. var n = e && !e.isAligned() ? C.OUTDOOR : C.PANORAMA
  15587. , r = t && !t.isAligned() ? C.OUTDOOR : C.PANORAMA;
  15588. n !== r && (r === C.PANORAMA ? this.showAlltags(m.tags.startup.fadeInDuration, null, !0) : this.hideAlltags(m.tags.startup.fadeInDuration))
  15589. }
  15590. }
  15591. ,
  15592. t.prototype.onPlayerReady = function(e, t, i) {
  15593. this.startAlltags(e, t ? i : null)
  15594. }
  15595. ,
  15596. t.prototype.onPlayerFlyingEnded = function(e, t) {
  15597. this.updateClosestTags(e)
  15598. }
  15599. ,
  15600. t.prototype.dismissExaminedTag = function() {
  15601. this.activeTag && this.tagState === T.EXAMINE && this.dismissActiveTag(),
  15602. this.hoveredTag && (this.hoveredTag.setFreeState(!0),
  15603. this.hoveredTag = null)
  15604. }
  15605. ,
  15606. t.prototype.startAlltags = function(e, t) {
  15607. this.model.shouldShowtags = m.tags.enabled,
  15608. this.enabled = !0,
  15609. e || (this.showAlltags(m.tags.startup.fadeInDuration, m.tags.startup.fadeInDelay),
  15610. t && setTimeout(function() {
  15611. this.activateTag(this.model.getTagBySid(t))
  15612. }
  15613. .bind(this), m.tags.startup.fadeInDuration / 2))
  15614. }
  15615. ,
  15616. t.prototype.showAlltags = function(e, t, i) {
  15617. function n() {
  15618. ++o === this.totaltags && (this.model.tagsShown = !0,
  15619. r.resolve())
  15620. }
  15621. var r = $.Deferred();
  15622. if (!i && this.player.mode === C.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || !this.model.shouldShowtags)
  15623. return r.resolve().promise();
  15624. var o = 0;
  15625. for (var a in this.model.tags) {
  15626. this.model.tags[a].show(e, t).done(n.bind(this))
  15627. }
  15628. return r.promise()
  15629. }
  15630. ,
  15631. t.prototype.hideAlltags = function(e, t) {
  15632. function i() {
  15633. ++r === this.totaltags && (this.model.tagsShown = !1,
  15634. n.resolve())
  15635. }
  15636. var n = $.Deferred()
  15637. , r = 0;
  15638. for (var o in this.model.tags) {
  15639. var a = this.model.tags[o];
  15640. a.hide(e, t).done(i.bind(this)),
  15641. a === this.activeTag && this.dismissActiveTag()
  15642. }
  15643. return n.promise()
  15644. }
  15645. ,
  15646. t.prototype.enableHovering = function() {
  15647. this.enabled = !0
  15648. }
  15649. ,
  15650. t.prototype.disableHovering = function() {
  15651. this.enabled = !1
  15652. }
  15653. ,
  15654. t.prototype.activateTag = function(e, t) {
  15655. t = t || T.EXAMINE,
  15656. this.activeTag = e,
  15657. this.activeTag.hoveringDisc = !0,
  15658. this.activeTag.setHoverState(t === T.EXAMINE),
  15659. this.tagState = t,
  15660. this.emit(b.TagActivated, e)
  15661. }
  15662. ,
  15663. t.prototype.dismissActiveTag = function() {
  15664. this.activeTag.hoveringDisc = !1,
  15665. this.activeTag.setFreeState(!0);
  15666. var e = this.activeTag;
  15667. this.activeTag = null,
  15668. this.tagState = T.IDLE,
  15669. this.emit(b.TagDismissed, e)
  15670. }
  15671. ,
  15672. t.prototype.clickedOnTag = function(e) {
  15673. var t = function() {
  15674. this.navigatingViaTag = !0,
  15675. this.activeTag.examine(this.player),
  15676. this.emit(b.TagNavigation, this.activeTag)
  15677. }
  15678. .bind(this);
  15679. return this.tagState !== T.EXAMINE ? (this.activateTag(this.intersectTag, T.EXAMINE),
  15680. this.activeTag = this.intersectTag,
  15681. t(),
  15682. !0) : (this.dismissActiveTag(),
  15683. !1)
  15684. }
  15685. ,
  15686. t.prototype.intersecttag = (s = new i.Vector3,
  15687. l = new i.Vector3,
  15688. c = new i.Vector3,
  15689. function(e, t, i) {
  15690. if (!this.enabled)
  15691. return null;
  15692. var n = null
  15693. , r = this.tagDiscs.filter(function(e) {
  15694. return e.parent.visible
  15695. });
  15696. if (0 < r.length) {
  15697. var o = this.model.floors.reduce(function(e, t) {
  15698. return t.hidden ? e : e.concat(t.collider.children)
  15699. }, r);
  15700. s.set(e.x, e.y, -1).unproject(i),
  15701. l.set(e.x, e.y, 1).unproject(i),
  15702. c.copy(l).sub(s).normalize(),
  15703. this.raycaster.set(s, c);
  15704. var a = this.raycaster.intersectObjects(o);
  15705. 0 < a.length && -1 !== r.indexOf(a[0].object) && (n = a[0].object.tag)
  15706. }
  15707. return this.intersectTag = n,
  15708. t && (this.activeTag && n !== this.activeTag && (this.tagState === T.BROWSE || this.tagState === T.EXAMINE && n) && this.dismissActiveTag(),
  15709. n && n !== this.activeTag && (n.listeners(v.ENTER).length < 1 && (n.billboard.on(v.ENTER, function() {
  15710. this.hoveredTag = n
  15711. }
  15712. .bind(this)),
  15713. n.billboard.on(v.LEAVE, function() {
  15714. this.hoveredTag = null
  15715. }
  15716. .bind(this))),
  15717. this.activateTag(n, T.BROWSE))),
  15718. n
  15719. }
  15720. ),
  15721. t.prototype.rankedtagInDirection = (h = [],
  15722. u = [],
  15723. d = new i.Vector3,
  15724. p = new i.Vector3,
  15725. f = new i.Vector3,
  15726. function(e, t, i, n) {
  15727. for (var r = 0, o = u.length = 0; o < this.closesttags.length; o++) {
  15728. var a = this.closesttags[o];
  15729. p.copy(a.position),
  15730. p.add(a.discPosition),
  15731. d.copy(t),
  15732. d.sub(p).negate(),
  15733. d.normalize();
  15734. var s = d.dot(n);
  15735. if (0 <= s && (f.copy(p),
  15736. f.project(i),
  15737. this.intersecttag(f, !1, i))) {
  15738. if (r >= h.length)
  15739. for (var l = 0; l < 64; l++)
  15740. h.push({
  15741. tag: a,
  15742. dot: s
  15743. });
  15744. var c = h[r];
  15745. c.tag = a,
  15746. c.dot = s,
  15747. c.position = math.projectPositionToCanvas(p, i),
  15748. u.push(c),
  15749. r++
  15750. }
  15751. }
  15752. return u.sort(function(e, t) {
  15753. return e.dot > t.dot ? -1 : e.dot < t.dot ? 1 : 0
  15754. }),
  15755. e < u.length ? u[e].tag : null
  15756. }
  15757. ),
  15758. t.prototype.updateClosestTags = (o = new i.Vector3,
  15759. function(e) {
  15760. this.closesttags || (this.closesttags = []),
  15761. this.closesttags.length = 0;
  15762. var t = this.model.tags;
  15763. if (t)
  15764. for (var i in t)
  15765. if (t.hasOwnProperty(i)) {
  15766. var n = t[i]
  15767. , r = n.position;
  15768. o.copy(e),
  15769. o.sub(r).negate(),
  15770. o.lengthSq() < 30 && this.closesttags.push(n)
  15771. }
  15772. }
  15773. ),
  15774. R.exports = t
  15775. }
  15776. ).call(this, "/js/tag/tagManager.js")
  15777. }
  15778. , {
  15779. "../controls/serializer": 14,
  15780. "../enum/BlackoutStyle": 18,
  15781. "../enum/tagEvents": 32,
  15782. "../enum/ModelManagerEvents": 33,
  15783. "../enum/PlayerEvents": 40,
  15784. "../enum/TagStates": 44,
  15785. "../enum/Viewmode": 51,
  15786. "../enum/WarpStyle": 52,
  15787. "../objects/Snapshot": 153,
  15788. "../settings": 166,
  15789. "../util/common": 185,
  15790. "../util/lerp": 188,
  15791. "../util/logger": 189,
  15792. "./Billboard/BillboardEvent": 120,
  15793. "./Media/LinkType": 130,
  15794. "./Media/MediaEvent": 131,
  15795. events: 202,
  15796. three: 217
  15797. }],
  15798. 125: [function(r, o, e) {
  15799. (function(e) {
  15800. "use strict";
  15801. function t() {
  15802. this.embedWrapper = null,
  15803. this.embedElement = null
  15804. }
  15805. var i = r("../../util/ajax")
  15806. , a = r("./mediaSettings")
  15807. , n = r("../../settings")
  15808. , s = new (r("../../util/logger"))(e);
  15809. t.prototype.createDomElement = function() {
  15810. return this.embedWrapper = document.createElement("div"),
  15811. this.embedWrapper.classList.add("tag-embed"),
  15812. this.embedWrapper.classList.add("hidden"),
  15813. this.embedWrapper
  15814. }
  15815. ,
  15816. t.prototype.load = function(e) {
  15817. var t = "https://api.embedly.com/1/oembed?key=" + n.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&maxwidth=" + a.maxEmbedWidth;
  15818. return new Promise(function(r, o) {
  15819. i.get(t).then(function(e) {
  15820. if ((e = JSON.parse(e)).html && -1 === e.html.indexOf("<script")) {
  15821. this.embedWrapper.innerHTML = e.html;
  15822. var t = Math.min(e.width, a.maxEmbedWidth) || a.maxEmbedWidth;
  15823. if (this.embedWrapper.style.width = t + "px",
  15824. e.height) {
  15825. var i = e.height / e.width;
  15826. this.embedWrapper.style.height = t * i + "px"
  15827. }
  15828. this.embedElement = this.embedWrapper.firstChild;
  15829. var n = [];
  15830. try {
  15831. n = [].slice.call(this.embedElement.querySelectorAll("a"))
  15832. } catch (e) {
  15833. s.debug("Error getting `a` elements for embed; was it an iframe?")
  15834. }
  15835. n.forEach(function(e) {
  15836. e.setAttribute("target", "_blank")
  15837. }),
  15838. this.embedElement.classList.add("hidden"),
  15839. this.embedWrapper.classList.remove("hidden"),
  15840. r()
  15841. } else
  15842. o("Not a valid embed")
  15843. }
  15844. .bind(this), function(e) {
  15845. o(e.response)
  15846. })
  15847. }
  15848. .bind(this))
  15849. }
  15850. ,
  15851. t.prototype.show = function() {
  15852. this.embedElement && this.embedElement.classList.remove("hidden")
  15853. }
  15854. ,
  15855. t.prototype.hide = function() {
  15856. this.embedElement && this.embedElement.classList.add("hidden")
  15857. }
  15858. ,
  15859. o.exports = t
  15860. }
  15861. ).call(this, "/js/tag/Media/EmbedlyEmbed.js")
  15862. }
  15863. , {
  15864. "../../settings": 166,
  15865. "../../util/ajax": 181,
  15866. "../../util/logger": 189,
  15867. "./mediaSettings": 132
  15868. }],
  15869. 126: [function(a, s, e) {
  15870. (function(e) {
  15871. "use strict";
  15872. function t(e) {
  15873. r.call(this),
  15874. this.options = e,
  15875. this.playerControls = null,
  15876. this.state = o.NOT_READY
  15877. }
  15878. var i, n = a("../../util/browser"), r = a("./EmbedlyEmbed"), o = (new (a("../../util/logger"))(e),
  15879. Object.freeze({
  15880. NOT_READY: "player.not.ready",
  15881. CUED: "player.cued",
  15882. PLAYING: "player.playing",
  15883. PAUSED: "player.paused"
  15884. }));
  15885. (t.prototype = Object.create(r.prototype)).createDomElement = function() {
  15886. return this.embedWrapper = document.createElement("div"),
  15887. this.embedWrapper.classList.add("tag-video"),
  15888. this.embedWrapper.classList.add("hidden"),
  15889. this.embedWrapper
  15890. }
  15891. ,
  15892. t.prototype.load = function(e) {
  15893. var t = function() {
  15894. function e(e) {
  15895. this.playerState = e
  15896. }
  15897. this.playerControls = new playerjs.Player(this.embedElement),
  15898. this.playerControls.on("ready", function(e) {
  15899. this.playerState = o.CUED,
  15900. this.options.startMuted && this.playerControls.mute()
  15901. }
  15902. .bind(this)),
  15903. this.playerControls.on("play", e.bind(this, o.PLAYING)),
  15904. this.playerControls.on("pause", e.bind(this, o.PAUSED)),
  15905. this.playerControls.on("ended", function(e) {
  15906. this.playerControls.setCurrentTime(0),
  15907. this.options.loop ? this.playerControls.play() : this.playerControls.pause()
  15908. }
  15909. .bind(this))
  15910. }
  15911. .bind(this);
  15912. return r.prototype.load.call(this, e).then(t.bind(this))
  15913. }
  15914. ,
  15915. t.prototype.play = (i = n.isMobile(),
  15916. function() {
  15917. this.playerState !== o.NOT_READY && this.playerControls && !i && (this.state === o.CUED && this.options.autoPlay || this.options.autoResume) && this.playerControls.play()
  15918. }
  15919. ),
  15920. t.prototype.pause = function() {
  15921. this.playerState !== o.NOT_READY && this.playerControls && this.playerControls.pause()
  15922. }
  15923. ,
  15924. s.exports = t
  15925. }
  15926. ).call(this, "/js/tag/Media/EmbedlyPlayer.js")
  15927. }
  15928. , {
  15929. "../../util/browser": 182,
  15930. "../../util/logger": 189,
  15931. "./EmbedlyEmbed": 125
  15932. }],
  15933. 127: [function(t, i, e) {
  15934. (function(e) {
  15935. "use strict";
  15936. var r = t("../../util/ajax")
  15937. , o = new (t("./mediaSettings"),
  15938. t("../../util/logger"))(e)
  15939. , a = Promise.resolve();
  15940. i.exports.enqueue = function(i) {
  15941. function n() {}
  15942. return a = new Promise(function(e, t) {
  15943. a.catch(n).then(function() {
  15944. (o.debug("requesting file from embedly:", i.href),
  15945. r.get(i.href, {
  15946. responseType: i.responseType
  15947. }).then(function(e) {
  15948. return o.debug("requesting file finished:", i.href),
  15949. e
  15950. })).then(e, t)
  15951. })
  15952. }
  15953. )
  15954. }
  15955. }
  15956. ).call(this, "/js/tag/Media/EmbedlyQueue.js")
  15957. }
  15958. , {
  15959. "../../util/ajax": 181,
  15960. "../../util/logger": 189,
  15961. "./mediaSettings": 132
  15962. }],
  15963. 128: [function(s, l, e) {
  15964. (function(e) {
  15965. "use strict";
  15966. function t() {
  15967. this.imageWrapper = null,
  15968. this.width = 0,
  15969. this.height = 0,
  15970. this.aspect = 1
  15971. }
  15972. var i = s("./MediaEvent")
  15973. , n = s("./EmbedlyQueue")
  15974. , r = s("events").EventEmitter
  15975. , o = s("../../util/logger")
  15976. , a = s("../../settings");
  15977. new o(e),
  15978. (t.prototype = Object.create(r.prototype)).createDomElement = function() {
  15979. return this.imageWrapper = document.createElement("div"),
  15980. this.imageWrapper.classList.add("tag-image"),
  15981. this.imageWrapper.classList.add("hidden"),
  15982. this.imageWrapper.addEventListener("click", function(e) {
  15983. e.stopPropagation(),
  15984. this.emit(i.IMAGE_OPENING),
  15985. this.imageWrapper.style.pointerEvents = "none"
  15986. }
  15987. .bind(this)),
  15988. this.imageWrapper
  15989. }
  15990. ,
  15991. t.prototype.onClosed = function() {
  15992. this.imageWrapper.style.pointerEvents = "auto"
  15993. }
  15994. ,
  15995. t.prototype.load = function(e) {
  15996. var t = Math.max(window.screen.height, window.screen.width)
  15997. , i = "https://i.embed.ly/1/display/resize?key=" + a.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&width=" + t + "&height=" + t;
  15998. return new Promise(function(o, e) {
  15999. n.enqueue({
  16000. href: i,
  16001. responseType: "arraybuffer"
  16002. }).then(function(e) {
  16003. var t = new Uint8Array(e)
  16004. , i = new Blob([t])
  16005. , n = new window.Image;
  16006. n.addEventListener("load", function(e) {
  16007. var t = e.target;
  16008. this.width = t.naturalWidth,
  16009. this.height = t.naturalHeight,
  16010. this.aspect = this.width / this.height;
  16011. var i = e.target.src;
  16012. this.imageWrapper.style.backgroundImage = 'url("' + i + '")',
  16013. this.imageWrapper.style.width = this.width + "px",
  16014. this.imageWrapper.style.height = this.height + "px",
  16015. this.imageWrapper.classList.remove("hidden"),
  16016. o()
  16017. }
  16018. .bind(this));
  16019. var r = URL.createObjectURL(i);
  16020. n.src = r
  16021. }
  16022. .bind(this), e)
  16023. }
  16024. .bind(this))
  16025. }
  16026. ,
  16027. l.exports = t
  16028. }
  16029. ).call(this, "/js/tag/Media/Image.js")
  16030. }
  16031. , {
  16032. "../../settings": 166,
  16033. "../../util/logger": 189,
  16034. "./EmbedlyQueue": 127,
  16035. "./MediaEvent": 131,
  16036. events: 202
  16037. }],
  16038. 129: [function(e, t, i) {
  16039. "use strict";
  16040. function n(e) {
  16041. this.label = e.label,
  16042. this.href = e.url,
  16043. this.type = this.updateLinkForType(),
  16044. this.domElement = null,
  16045. this.id = c++
  16046. }
  16047. var r = e("./LinkType")
  16048. , o = e("./MediaEvent")
  16049. , a = e("../../util/browser")
  16050. , s = e("../../analytics")
  16051. , l = e("events").EventEmitter
  16052. , c = 0;
  16053. (n.prototype = Object.create(l.prototype)).updateLinkForType = function() {
  16054. var e, t = a.valueFromHash("m") || a.valueFromHash("model");
  16055. 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,
  16056. new RegExp("[#&?]start=([^#&?]*)").exec(e)[1]),
  16057. r.NAVIGATION) : (this.href = this.href + "&play=1",
  16058. r.MODEL) : r.EXT_LINK
  16059. }
  16060. ;
  16061. var h = {};
  16062. n.prototype.createDomElement = function() {
  16063. if (this.domElement = document.createElement("a"),
  16064. this.domElement.classList.add("tag-link"),
  16065. this.domElement.textContent = this.label,
  16066. this.type === r.EXT_LINK) {
  16067. this.domElement.textContent += " ";
  16068. var e = document.createElement("i");
  16069. e.classList.add("icon-ext-link"),
  16070. e.title = "Link to external web site",
  16071. this.domElement.appendChild(e)
  16072. }
  16073. return this.domElement.addEventListener("click", function(e) {
  16074. switch (e.stopPropagation(),
  16075. h[this.id] = !0,
  16076. s.trackAlways("click_tag_link", {
  16077. link_type: this.type,
  16078. link_count: c,
  16079. links_clicked: Object.keys(h).length
  16080. }),
  16081. this.type) {
  16082. case r.MODEL:
  16083. window.location.replace(this.href);
  16084. break;
  16085. case r.EXT_LINK:
  16086. window.open(this.href, "_blank")
  16087. }
  16088. this.emit(o.LINK_CLICK, {
  16089. type: this.type,
  16090. url: this.href
  16091. })
  16092. }
  16093. .bind(this)),
  16094. this.domElement
  16095. }
  16096. ,
  16097. t.exports = n
  16098. }
  16099. , {
  16100. "../../analytics": 4,
  16101. "../../util/browser": 182,
  16102. "./LinkType": 130,
  16103. "./MediaEvent": 131,
  16104. events: 202
  16105. }],
  16106. 130: [function(e, t, i) {
  16107. "use strict";
  16108. t.exports = {
  16109. NAVIGATION: "navigation",
  16110. MODEL: "model",
  16111. EXT_LINK: "ext-link"
  16112. }
  16113. }
  16114. , {}],
  16115. 131: [function(e, t, i) {
  16116. "use strict";
  16117. t.exports = Object.freeze({
  16118. LINK_CLICK: "mtmedia.link",
  16119. IMAGE_LOADED: "mtmedia.image.loaded",
  16120. IMAGE_OPENING: "mtmedia.image.opening",
  16121. IMAGE_OPENED: "mtmedia.image.opened",
  16122. IMAGE_CLOSING: "mtmedia.image.closing",
  16123. IMAGE_CLOSED: "mtmedia.image.closed",
  16124. VIDEO_START: "mtmedia.video.start",
  16125. VIDEO_PAUSE: "mtmedia.video.pause",
  16126. VIDEO_ENDED: "mtmedia.video.end"
  16127. })
  16128. }
  16129. , {}],
  16130. 132: [function(e, t, i) {
  16131. "use strict";
  16132. t.exports = Object.freeze({
  16133. maxEmbedWidth: 350,
  16134. defaultAspectRatio: .75
  16135. })
  16136. }
  16137. , {}],
  16138. 133: [function(e, t, i) {
  16139. "use strict";
  16140. t.exports = Object.freeze({
  16141. TEXT: "text",
  16142. LINK: "link",
  16143. IMAGE: "photo",
  16144. VIDEO: "video",
  16145. RICH: "rich"
  16146. })
  16147. }
  16148. , {}],
  16149. 134: [function(e, t, i) {
  16150. "use strict";
  16151. function n(e) {
  16152. this.capabilities = {
  16153. links: {
  16154. enable: e.supportLinks,
  16155. keepLabels: e.keepLinkLabels
  16156. }
  16157. }
  16158. }
  16159. var r = e("./DescriptionChunkType");
  16160. n.prototype.parse = function(e, i) {
  16161. var n = [];
  16162. return e.split("[").map(function(e, t) {
  16163. return 0 === t ? e : "[" + e
  16164. }).forEach(function(e) {
  16165. var t = this.findMarkdown(e);
  16166. if (t) {
  16167. if (-1 !== t.url.indexOf("javascript:"))
  16168. return;
  16169. this.addLinkChunk(n, t, i),
  16170. this.addTextChunk(n, e.slice(t.markdown.length))
  16171. } else
  16172. this.addTextChunk(n, e)
  16173. }
  16174. .bind(this)),
  16175. n
  16176. }
  16177. ,
  16178. n.prototype.findMarkdown = function(e) {
  16179. var t = e.match(/\[([^\]]*)\]\((.*)\)/);
  16180. if (t) {
  16181. for (var i = t[2], n = 1, r = 0; r < i.length && ("(" === i[r] ? n++ : ")" === i[r] && n--,
  16182. 0 !== n); )
  16183. r++;
  16184. var o = i.length - r;
  16185. return {
  16186. markdown: t[0].substring(0, t[0].length - o),
  16187. label: t[1],
  16188. url: t[2].substring(0, r)
  16189. }
  16190. }
  16191. }
  16192. ,
  16193. n.prototype.addTextChunk = function(e, t) {
  16194. 0 !== t.length && e.push({
  16195. type: r.TEXT,
  16196. text: t
  16197. })
  16198. }
  16199. ,
  16200. n.prototype.addLinkChunk = function(e, t) {
  16201. if (this.capabilities.links.enable) {
  16202. var i = {
  16203. label: t.label,
  16204. url: t.url
  16205. };
  16206. -1 === i.url.indexOf("://") && (i.url = "http://" + i.url),
  16207. e.push({
  16208. type: r.LINK,
  16209. link: i
  16210. })
  16211. } else
  16212. this.capabilities.links.keepLabels && this.addTextChunk(e, t.label)
  16213. }
  16214. ,
  16215. t.exports = n
  16216. }
  16217. , {
  16218. "./DescriptionChunkType": 133
  16219. }],
  16220. 135: [function(t, r, e) {
  16221. (function(e) {
  16222. "use strict";
  16223. var i = new (t("../util/logger"))(e)
  16224. , n = {
  16225. parseIdsFromChunkName: function(e, t) {
  16226. t.floorId = n.parseFloor(e),
  16227. t.roomId = n.parseRoom(e)
  16228. },
  16229. parseFloor: function(e) {
  16230. var t = e.match(/_group([0-9]+)/);
  16231. if (!t)
  16232. return 0;
  16233. try {
  16234. return parseInt(t[1], 10)
  16235. } catch (e) {
  16236. return i.warn('Non-int value "' + t[1] + '" for mesh group, defaulting to floor 0'),
  16237. 0
  16238. }
  16239. },
  16240. parseRoom: function(e) {
  16241. var t = e.match(/_sub([0-9]+)/);
  16242. if (!t)
  16243. return -1;
  16244. try {
  16245. return parseInt(t[1], 10)
  16246. } catch (e) {
  16247. return i.warn('Non-int value "' + t[1] + '" for mesh subgroup, defaulting to subgroup 0'),
  16248. 0
  16249. }
  16250. }
  16251. };
  16252. r.exports = n
  16253. }
  16254. ).call(this, "/js/model/Chunks.js")
  16255. }
  16256. , {
  16257. "../util/logger": 189
  16258. }],
  16259. 136: [function(a, c, e) {
  16260. (function(e) {
  16261. "use strict";
  16262. function t(e) {
  16263. r.call(this),
  16264. this.model = e,
  16265. this.exploded = !1
  16266. }
  16267. var i = a("../objects/Floor")
  16268. , n = (a("../settings"),
  16269. a("../util/logger"))
  16270. , s = a("../util/transitions")
  16271. , r = a("../util/IndexedCollection")
  16272. , o = a("../util/common")
  16273. , l = a("../util/easing");
  16274. new n(e),
  16275. o.inherit(t, r),
  16276. t.prototype.add = function(e) {
  16277. r.prototype.add.call(this, e),
  16278. this.model.add(e)
  16279. }
  16280. ,
  16281. t.prototype.getIndex = function(e) {
  16282. return e.floorIndex
  16283. }
  16284. ,
  16285. t.prototype.build = function() {
  16286. this.list.forEach(function(e) {
  16287. e.build()
  16288. })
  16289. }
  16290. ,
  16291. t.prototype.size = function() {
  16292. return this.length
  16293. }
  16294. ,
  16295. t.prototype.sort = function() {
  16296. r.prototype.sort.call(this, function(e, t) {
  16297. return e.floorIndex - t.floorIndex
  16298. })
  16299. }
  16300. ,
  16301. t.prototype.nextFloor = function(e, t) {
  16302. return this.index[e.floorIndex + t] || null
  16303. }
  16304. ,
  16305. t.prototype.getFloorAtPoint = function(e) {
  16306. for (var t = null, i = 1 / 0, n = 0; n < this.list.length; n++) {
  16307. var r = this.list[n]
  16308. , o = r.distanceToPoint(e);
  16309. (!t || o < i) && (i = o,
  16310. t = r)
  16311. }
  16312. return t
  16313. }
  16314. ,
  16315. t.prototype.getOrMakeFloor = function(e) {
  16316. var t = this.index[e];
  16317. return t || (t = new i(this.model,e),
  16318. this.add(t)),
  16319. t
  16320. }
  16321. ,
  16322. t.prototype.hide = function() {
  16323. this.list.forEach(function(e) {
  16324. e.hide()
  16325. })
  16326. }
  16327. ,
  16328. t.prototype.show = function() {
  16329. this.list.forEach(function(e) {
  16330. e.show()
  16331. })
  16332. }
  16333. ,
  16334. t.prototype.names = function() {
  16335. return this.list.reduce(function(e, t) {
  16336. return e.concat(t.name)
  16337. }, [])
  16338. }
  16339. ,
  16340. t.prototype.toggleExplodeHorizontal = function() {
  16341. function i(e, t) {
  16342. a.copy(e.position),
  16343. e.position.x = r[e.floorIndex] * t,
  16344. e.position.y = 1 * e.floorIndex * t,
  16345. a.sub(e.position).multiplyScalar(-1),
  16346. e.panos.forEach(function(e) {
  16347. e.translate(a)
  16348. })
  16349. }
  16350. var n, r = [], o = 0;
  16351. this.list.forEach(function(e, t, i) {
  16352. n = 0 < t ? Math.max(i[t - 1].boundingBox.max.x - e.boundingBox.min.x, e.boundingBox.size().x / 2) : 0,
  16353. o += n,
  16354. r[t] = o
  16355. }),
  16356. r = r.map(function(e) {
  16357. return e - o / 2
  16358. });
  16359. var a = this.list[0].position.clone();
  16360. this.exploded ? this.list.forEach(function(t) {
  16361. s.start(function(e) {
  16362. i(t, 1 - e)
  16363. }, 1500, null, 0, l.easeOutExpo)
  16364. }) : this.list.forEach(function(t) {
  16365. s.start(function(e) {
  16366. i(t, e)
  16367. }, 1500, null, 0, l.easeOutExpo)
  16368. }),
  16369. this.exploded = !this.exploded
  16370. }
  16371. ,
  16372. t.prototype.toggleExplodeVertical = function() {
  16373. function i(e, t) {
  16374. var i = i.copy(e.position);
  16375. e.position.y = (5 * e.floorIndex - n.y / 2) * t,
  16376. i.sub(e.position).multiplyScalar(-1),
  16377. e.panos.forEach(function(e) {
  16378. e.translate(i)
  16379. })
  16380. }
  16381. var n = this.model.size;
  16382. this.list[0].position.clone(),
  16383. this.exploded ? this.list.forEach(function(t) {
  16384. s.start(function(e) {
  16385. i(t, 1 - e)
  16386. }, 1500, null, 0, l.easeOutExpo)
  16387. }) : this.list.forEach(function(t) {
  16388. s.start(function(e) {
  16389. i(t, e)
  16390. }, 1500, null, 0, l.easeOutExpo)
  16391. }),
  16392. this.exploded = !this.exploded
  16393. }
  16394. ,
  16395. c.exports = t
  16396. }
  16397. ).call(this, "/js/model/FloorCollection.js")
  16398. }
  16399. , {
  16400. "../objects/Floor": 146,
  16401. "../settings": 166,
  16402. "../util/IndexedCollection": 175,
  16403. "../util/common": 185,
  16404. "../util/easing": 186,
  16405. "../util/logger": 189,
  16406. "../util/transitions": 195
  16407. }],
  16408. 137: [function(r, o, e) {
  16409. (function(e) {
  16410. "use strict";
  16411. function h() {
  16412. n.call(this)
  16413. }
  16414. var u = r("../settings")
  16415. , t = r("../util/logger")
  16416. , d = r("../enum/Viewmode")
  16417. , p = r("../objects/Snapshot")
  16418. , i = (r("../util/math"),
  16419. r("../util/common"))
  16420. , n = r("../util/IndexedCollection")
  16421. , l = new t(e);
  16422. i.inherit(h, n),
  16423. h.prototype.getImage = function(e) {
  16424. return e && this.index.hasOwnProperty(e) ? this.index[e] : null
  16425. }
  16426. ,
  16427. h.prototype.filterByModesAndReel = function(e, t) {
  16428. for (var i = [], n = 0; n < t.length; n += 1) {
  16429. var r = t[n]
  16430. , o = this.index[r.sid];
  16431. o && i.push(o)
  16432. }
  16433. var a = e[d.DOLLHOUSE]
  16434. , s = e[d.FLOORPLAN];
  16435. (i = i.filter(function(e) {
  16436. if (!e.metadata || void 0 === e.metadata.camera_mode)
  16437. return !0;
  16438. var t;
  16439. try {
  16440. t = d.convertWorkshopModeInt(e.metadata.camera_mode)
  16441. } catch (e) {
  16442. return l.debug(e.message),
  16443. !1
  16444. }
  16445. return t === d.PANORAMA || t === d.FLOORPLAN && s || t === d.DOLLHOUSE && a
  16446. })).length !== this.list.length && l.info("Disallowed " + (this.list.length - i.length) + " highlight images"),
  16447. this.list = i,
  16448. this.reIndex()
  16449. }
  16450. ,
  16451. h.prototype.getHeroLocations = function(e) {
  16452. if (0 === this.list.length)
  16453. return [];
  16454. for (var t = [], i = 0; i < this.list.length; ++i) {
  16455. var n = this.list[i]
  16456. , r = n.thumbnail_signed_src
  16457. , o = n.name || "";
  16458. if (n.metadata && void 0 !== n.metadata.camera_quaternion) {
  16459. if (!u.show360Views.enabled && n.metadata.scan_id) {
  16460. var a = e.get(n.metadata.scan_id);
  16461. if (a && !a.isAligned())
  16462. continue
  16463. }
  16464. var s = d.convertWorkshopModeInt(n.metadata.camera_mode);
  16465. if (s === d.MESH)
  16466. continue;
  16467. if(window.isLocal)var src = manage.dealURL(r)
  16468. else var src = "one" === g_version ? g_Prefix + r + "?" + randomTime().getTime() : r + "?" + randomTime().getTime()
  16469. var l = {
  16470. cameraMode: s,
  16471. position: n.metadata.camera_position,
  16472. quaternion: n.metadata.camera_quaternion,
  16473. zoom: n.metadata.zoom,
  16474. panoId: n.metadata.scan_id,
  16475. orthoZoom: n.metadata.ortho_zoom,
  16476. floorVisibility: void 0 !== n.metadata.floor_visibility ? n.metadata.floor_visibility.slice(0) : [],
  16477. thumbUrl: src,
  16478. name: h.filterImageName(o),
  16479. sid: n.sid
  16480. }
  16481. , c = new p(l);
  16482. t.push(c)
  16483. }
  16484. }
  16485. return t
  16486. }
  16487. ,
  16488. h.prototype.getIndex = function(e) {
  16489. return e.sid
  16490. }
  16491. ,
  16492. h.filterImageName = function(e) {
  16493. return "" === e || e.match(/^[0-9.]+_[0-9.]+$/) ? null : e
  16494. }
  16495. ,
  16496. o.exports = h
  16497. }
  16498. ).call(this, "/js/model/ImageCollection.js")
  16499. }
  16500. , {
  16501. "../enum/Viewmode": 51,
  16502. "../objects/Snapshot": 153,
  16503. "../settings": 166,
  16504. "../util/IndexedCollection": 175,
  16505. "../util/common": 185,
  16506. "../util/logger": 189,
  16507. "../util/math": 190
  16508. }],
  16509. 138: [function(h, u, e) {
  16510. (function(e) {
  16511. "use strict";
  16512. function n() {
  16513. c.call(this)
  16514. }
  16515. var r = h("../label/Label")
  16516. , i = h("../settings")
  16517. , t = h("../util/logger")
  16518. , o = h("../util/math")
  16519. , a = h("../util/ajax")
  16520. , s = h("./RoomCollection")
  16521. , l = h("../util/common")
  16522. , c = h("../util/IndexedCollection");
  16523. new t(e),
  16524. l.inherit(n, c),
  16525. n.prototype.getIndex = function(e) {
  16526. return e.labelId
  16527. }
  16528. ,
  16529. n.prototype.associateWithRooms = function(e) {
  16530. this.forEach(function(t) {
  16531. e.forEach(function(e) {
  16532. e.roomId === t.roomId && (t.room = e)
  16533. })
  16534. })
  16535. }
  16536. ,
  16537. n.prototype.createFromLabelData = function(e) {
  16538. e.forEach(function(e) {
  16539. var t = n.parseRoomIndexFromWorkshopRoomId(e.roomId);
  16540. t = s.generateRoomId(e.floorId, t);
  16541. var i = new r(e.sid,e.position || e.positions[0],e.text,e.floorId,t);
  16542. i.position = o.convertWorkshopVector(i.position),
  16543. this.add(i),
  16544. i.build()
  16545. }
  16546. .bind(this))
  16547. }
  16548. ,
  16549. n.prototype.load = function(e, t) {
  16550. return a.get(e, {
  16551. responseType: "json",
  16552. auth: t ? i.authorizationHeader : null
  16553. }).done(function(e) {
  16554. var t = [];
  16555. for (var i in e) {
  16556. var n = e[i];
  16557. t.push(n)
  16558. }
  16559. this.createFromLabelData(t)
  16560. }
  16561. .bind(this))
  16562. }
  16563. ,
  16564. n.parseRoomIndexFromWorkshopRoomId = function(e) {
  16565. var t = -1;
  16566. if (e) {
  16567. var i = e.split("_");
  16568. t = parseInt(i[0])
  16569. }
  16570. return t
  16571. }
  16572. ,
  16573. u.exports = n
  16574. }
  16575. ).call(this, "/js/model/LabelCollection.js")
  16576. }
  16577. , {
  16578. "../label/Label": 90,
  16579. "../settings": 166,
  16580. "../util/IndexedCollection": 175,
  16581. "../util/ajax": 181,
  16582. "../util/common": 185,
  16583. "../util/logger": 189,
  16584. "../util/math": 190,
  16585. "./RoomCollection": 141
  16586. }],
  16587. 139: [function(P, O, e) {
  16588. (function(e) {
  16589. "use strict";
  16590. function t(e, t) {
  16591. o.Object3D.call(this),
  16592. this.sid = window.number;//t.sid,
  16593. this.data = t,
  16594. this.options = e,
  16595. this.urls = new i(e.urlFiles),
  16596. this.isPublic = void 0 !== t.is_public && t.is_public,
  16597. this.images = new E(this),
  16598. this.images.extend(t.images),
  16599. this.heroImage = this.images.getImage(t.icon),
  16600. this.heroLocations = [],
  16601. this.outdoorPanoLocations = [],
  16602. this.floors = new c(this),
  16603. this.floorsEnabled = void 0 === e.floors || e.floors,
  16604. this.changingFloor = !1,
  16605. this.chunks = [],
  16606. this.panos = new g,
  16607. this.colliders = [],
  16608. this.loadPanosPromise = null,
  16609. this.loadMeshTexturesPromise = null,
  16610. this.auxDataPromise = null,
  16611. this.meshTexturesLoaded = !1,
  16612. this.meshTextures = [],
  16613. this.tags = {},
  16614. this.tagsShown = !1,
  16615. this.shouldShowtags = !1,
  16616. this.has360Views = !1,
  16617. this.showingLabels = u.labels.enabled && t.player_options.labels,
  16618. this.supportedModes = {},
  16619. this.supportedModes[s.PANORAMA] = !0,
  16620. this.supportedModes[s.DOLLHOUSE] = !t.player_options || t.player_options.dollhouse && I.valueFromHash("dh", 1),
  16621. this.supportedModes[s.FLOORPLAN] = !t.player_options || t.player_options.floor_plan && I.valueFromHash("dh", 1),
  16622. this.supportedModes[s.TRANSITIONING] = !0,
  16623. this.supportsTiles = this.configureTiling(),
  16624. this.supportsVR = window.MP_PREFETCHED_MODELDATA.supportsVR || false//!0,
  16625. this.mode = s.DOLLHOUSE,
  16626. this.size = null,
  16627. this.center = null,
  16628. this.boundingBox = new o.Box3,
  16629. this.currentFloor = null,
  16630. this.allFloorsVisible = !0,
  16631. this.projectedPano0 = null,
  16632. this.projectedPano1 = null,
  16633. this.floorsEnabled && t.floors && -1 !== t.floors.indexOf(",") && t.floors.split(",").forEach(function(e, t) {
  16634. this.addFloor(new r(this,t,e.trim()))
  16635. }
  16636. .bind(this)),
  16637. this.waitQueue = [],
  16638. this.on("load", function(e) {
  16639. 0 !== this.waitQueue.length && (this.waitQueue = this.waitQueue.filter(function(e) {
  16640. return !e.isLoadedCallback()
  16641. }),
  16642. 0 === this.waitQueue.length && this.emit("waiting-done"))
  16643. }
  16644. .bind(this)),
  16645. this.setupCustomProperties(),
  16646. this.hots = {}
  16647. }
  16648. var o = P("three")
  16649. , a = P("../util/ajax")
  16650. , i = P("../util/ModelUrls")
  16651. , n = P("../objects/BoundingTextureSkybox")
  16652. , s = P("../enum/Viewmode")
  16653. , l = P("../enum/RenderOrder")
  16654. , r = (P("../enum/AlignmentType"),
  16655. P("../objects/Floor"))
  16656. , c = P("./FloorCollection")
  16657. , h = P("../objects/Chunk")
  16658. , u = (P("../objects/Room"),
  16659. P("../objects/Snapshot"),
  16660. P("../label/Label"),
  16661. P("../util/math"),
  16662. P("../settings"))
  16663. , d = P("../shaders")
  16664. , p = P("../util/logger")
  16665. , f = (P("../tag/tag"),
  16666. P("../tag/tagManager"),
  16667. P("../objects/Panorama"))
  16668. , g = P("../util/PanoramaCollection")
  16669. , m = P("../loaders/ModelLoader")
  16670. , v = P("../loaders/ModelTextureLoader")
  16671. , y = P("../loaders/SweepDataLoader")
  16672. , A = P("../util/transitions")
  16673. , C = (P("../util/easing"),
  16674. P("../util/lerp"),
  16675. P("../util/common"))
  16676. , I = (P("../util/texture"),
  16677. P("./../util/browser"))
  16678. , E = P("./ImageCollection")
  16679. , _ = P("./RoomCollection")
  16680. , b = P("./LabelCollection")
  16681. , w = P("./Chunks")
  16682. , T = P("./../util/showcase")
  16683. , x = P("../exception/BasicException")
  16684. , S = (P("../constants"),
  16685. P("events").EventEmitter)
  16686. , M = P("hot")
  16687. , R = new p(e);
  16688. t.prototype = Object.create(o.Object3D.prototype),
  16689. C.extend(t, S),
  16690. t.prototype.setupCustomProperties = function() {
  16691. var t = u.modelAlpha;
  16692. Object.defineProperty(this, "alpha", {
  16693. get: function() {
  16694. return t
  16695. },
  16696. set: function(e) {
  16697. t = e,
  16698. this.chunks.forEach(function(e) {
  16699. e.material && e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = t)
  16700. })
  16701. }
  16702. })
  16703. }
  16704. ,
  16705. t.prototype.configureTiling = function() {
  16706. var e = function() {
  16707. try {
  16708. var e = document.createElement("canvas")
  16709. , t = e.getContext("webgl");
  16710. return (t = t || e.getContext("experimental-webgl")).getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE)
  16711. } catch (e) {
  16712. return 0
  16713. }
  16714. }();
  16715. if (e < 2048)
  16716. return !1;
  16717. R.warn("Max cube texture size: " + e);
  16718. for (var t = 0; t < u.tiling.tilingFlagNames.length; t++) {
  16719. var i = u.tiling.tilingFlagNames[t];
  16720. if ("1" === I.valueFromHash(i, null))
  16721. return !0;
  16722. if ("0" === I.valueFromHash(i, null))
  16723. return !1
  16724. }
  16725. return !!T.modelDataPromisesTiles(this.data)
  16726. }
  16727. ,
  16728. t.prototype.toggleAlpha = function() {
  16729. this.alpha < 1 ? this.alpha = 1 : this.alpha = 0
  16730. }
  16731. ,
  16732. t.prototype.load = function(e) {
  16733. var t = this.urls.init().then(function() {
  16734. return $.when(this.loadPanos(), this.loadMesh())
  16735. }
  16736. .bind(this));
  16737. return e ? t = t.then(this.loadMeshTextures.bind(this)) : t.then(this.loadMeshTextures.bind(this)),
  16738. this.auxDataPromise = $.when(this.loadhots(), this.loadLabels()),
  16739. $.when(t, this.auxDataPromise).done(this.build.bind(this))
  16740. }
  16741. ,
  16742. t.prototype.loadMesh = function() {
  16743. var n = $.Deferred()
  16744. , r = this;
  16745. return m.load(r.data.job.uuid, r.urls, function(e, t) {
  16746. if (0 === e.length) {
  16747. R.warn("No geometry found for model, loading faux geometry, disabling outside mode"),
  16748. r.supportedModes[s.DOLLHOUSE] = !1,
  16749. r.supportedModes[s.FLOORPLAN] = !1;
  16750. var i = new h({
  16751. geometry: new o.PlaneBufferGeometry(5,5,1,1)
  16752. });
  16753. i.material.visible = !1,
  16754. i.rotateX(-Math.PI / 2),
  16755. i.geometry.computeBoundingBox(),
  16756. e = [i]
  16757. }
  16758. e.forEach(function(e) {
  16759. var t = r.floorsEnabled ? w.parseFloor(e.name) : 0;
  16760. r.addChunk(t, e)
  16761. }),
  16762. r.floors.sort(),
  16763. n.resolve(r)
  16764. }, function(e, t) {
  16765. n.notify(e, t)
  16766. }, function(e) {
  16767. R.error(e),
  16768. n.reject("loading-failed")
  16769. }),
  16770. n.promise()
  16771. }
  16772. ,
  16773. t.prototype.loadMeshTextures = function() {
  16774. return this.loadTexturesPromise || (this.loadTexturesPromise = v.load(this, this.meshTextures).then(function() {
  16775. this.meshTexturesLoaded = !0
  16776. }
  16777. .bind(this))),
  16778. this.loadTexturesPromise
  16779. }
  16780. ,
  16781. t.prototype.shineHots = function() {
  16782. A.trigger({
  16783. func: function(e) {
  16784. var opa = e <= .5 ? 2 * e : -2 * e + 2
  16785. for(var i in this.hots){
  16786. this.hots[i].mesh.material.uniforms.opac.value = opa;
  16787. }
  16788. }
  16789. .bind(this),
  16790. cycling: !0,
  16791. duration: 3e3,
  16792. name: "hotShine"
  16793. })
  16794. }
  16795. ,
  16796. t.prototype.createHotItem = function(e, t) {
  16797. for (var i = document.createDocumentFragment(), n = Object.keys(e), r = 0; r < n.length; r++) {
  16798. var o = document.createElement("li")
  16799. , a = document.createElement("span");
  16800. a.innerHTML = e[n[r]].title || e[n[r]].infoAttribute.title || "热点",
  16801. o.hot = t[n[r]],
  16802. o.appendChild(a),
  16803. i.appendChild(o)
  16804. }
  16805. document.querySelector("#hotListContent ul").appendChild(i),
  16806. console.log(i)
  16807. }
  16808. ,
  16809. t.prototype.loadOverlays = function(overlays){
  16810. var overlays = window.data2 && window.data2.overlays /* ||
  16811. [
  16812. { depth: 0.02,
  16813. file: "https://super.4dage.com/data/TEST/overlay/b6fe7cb6bd2b6.mp4",
  16814. hasBox: 0,
  16815. height: 0.8165,
  16816. media: ["video"],
  16817. pos: [-4.3132, 0.6788, -13.5162],
  16818. qua: [0, 0.9396, 0, 0.3421],
  16819. sid: "1591079418827",
  16820. width: 0.6124
  16821. }] */
  16822. overlays && overlays.forEach((info)=>{
  16823. new Overlay(info)
  16824. })
  16825. }
  16826. ,
  16827. t.prototype.loadhots = function() {
  16828. var r = $.Deferred()
  16829. , e = g_Prefix + "data/" + this.sid + "/data2.js?" + randomTime().getTime();
  16830. return a.get(e, {
  16831. responseType: "json",
  16832. auth: this.isPublic ? null : u.authorizationHeader
  16833. }).done(function(e) {
  16834. window.data2 = e;
  16835. if(!e){
  16836. console.error("data2 is null")
  16837. }else{
  16838. g_data2 = hotMatcher(e)
  16839. this.hotsCount = 0;
  16840. //因为热点保存后在hots里的顺序会被修改,所以使用order来记录顺序,这里要重排序:
  16841. window.hotData = {}
  16842. if(e.hots){
  16843. var sids = Object.keys(e.hots).sort((a,b)=>{return e.hots[a].order - e.hots[b].order});
  16844. sids.forEach((sid)=>{
  16845. this.hotsCount++,
  16846. this.hots[sid] = new M(sid,e.hots[sid] ,this);
  16847. e.hots[sid].infoAttribute || (e.hots[sid].infoAttribute = {})
  16848. this.hots[sid].initStyleImg(e.hots[sid].infoAttribute);
  16849. window.hotData[sid] = e.hots[sid];
  16850. })
  16851. }
  16852. this.createHotItem(window.hotData, this.hots);
  16853. g_index = I.valueFromHash("m"),
  16854. e.tourAudio && (g_tourAudio = new Audio,
  16855. g_tourAudio.loop = !1,
  16856. g_tourAudio.addEventListener("ended", function() {
  16857. var e = document.createEvent("MouseEvent");
  16858. e.initEvent("tourAudioEnded", !0, !0),
  16859. window.dispatchEvent(e)
  16860. }));
  16861. e.weixinDesc && (g_weixinObj.desc = e.weixinDesc)
  16862. //window.wx && manage.weixinShare(),
  16863. }
  16864. /* var i = $.Deferred()
  16865. , n = g_Prefix + "data/" + this.sid + "/hot/js/data.js?" + randomTime().getTime();
  16866. a.get(n, {
  16867. responseType: "json",
  16868. auth: this.isPublic ? null : u.authorizationHeader
  16869. }).done(function(e) {
  16870. window.hotData = e,
  16871. this.createHotItem(e, this.hots);
  16872. for(let i in this.hots){
  16873. e[i] && this.hots[i].initStyleImg(e[i]);
  16874. }
  16875. i.resolve()
  16876. }
  16877. .bind(this)).fail(function() {
  16878. console.log("Data.js is empty");
  16879. i.resolve()
  16880. }),
  16881. */
  16882. r.resolve()
  16883. }
  16884. .bind(this)).fail(function() {
  16885. console.log("没有热点"),
  16886. //window.wx && manage.weixinShare(),
  16887. r.resolve()
  16888. }),
  16889. r
  16890. }
  16891. ,
  16892. t.prototype.loadPanos = function() {
  16893. if (this.loadPanosPromise)
  16894. return this.loadPanosPromise;
  16895. var e = new y(this);
  16896. return this.loadPanosPromise = e.load().then(function(e) {
  16897. return this.data.sweeps && 0 < Object.keys(this.data.sweeps).length && (e = e.filter(function(e) {
  16898. if(this.data.sweeps[e.uuid])return this.data.sweeps[e.uuid].enabled
  16899. else console.log(e.uuid)
  16900. //return this.data.sototype.loadOverlaysweeps[e.uuid].enabled
  16901. }
  16902. .bind(this))),
  16903. this.panos.extend(e.map(function(e) {
  16904. return new f(this,e.uuid,e,this.supportsTiles)
  16905. }
  16906. .bind(this))),
  16907. this.panos.forEach(function(i) {
  16908. i.neighbourUUIDs && (i.neighbourUUIDs.forEach(function(e) {
  16909. var t = this.panos.get(e);
  16910. t && this.panos.setNeighbour(i, t, !0)
  16911. }
  16912. .bind(this)),
  16913. i.neighbourPanos = this.panos.getNeighbours(i) || this.panos.setNeighbour(i, i, !0))
  16914. }
  16915. .bind(this)),
  16916. 0 === this.panos.length && (R.warn("Model has no panos, turning off inside mode"),
  16917. this.supportedModes[s.PANORAMA] = !1),
  16918. $.when(this)
  16919. }
  16920. .bind(this)),
  16921. this.loadPanosPromise
  16922. }
  16923. ,
  16924. t.prototype.loadHighlightReel = function() {
  16925. var t = $.Deferred()
  16926. , e = this.options.urlBase + "data/" + this.sid + "/active_reel.json";
  16927. return a.get(e, {
  16928. responseType: "json",
  16929. auth: this.isPublic ? null : u.authorizationHeader
  16930. }).done(function(e) {
  16931. e.reel ? (R.info("Got highlight reel with " + e.reel.length + " items"),
  16932. this.images.filterByModesAndReel(this.supportedModes, e.reel)) : R.info("No highlight reel found"),
  16933. t.resolve()
  16934. }
  16935. .bind(this)).fail(function() {
  16936. R.warn("Getting highlight reel failed, no highlights available"),
  16937. t.resolve()
  16938. }),
  16939. t
  16940. }
  16941. ,
  16942. t.prototype.waitForLoad = function(e, t) {
  16943. t() || (this.waitQueue.push({
  16944. object: e,
  16945. isLoadedCallback: t
  16946. }),
  16947. 1 === this.waitQueue.length && this.emit("waiting"))
  16948. }
  16949. ,
  16950. t.prototype.hide = function() {
  16951. this.floors.hide()
  16952. }
  16953. ,
  16954. t.prototype.show = function() {
  16955. this.floors.show()
  16956. }
  16957. ,
  16958. t.prototype.floorNames = function() {
  16959. return this.floors.names()
  16960. }
  16961. ,
  16962. t.prototype.warpDestFloors = function(e, t) {
  16963. if (e && this.floors.length === e.length) {
  16964. var i = e.findIndex(function(e) {
  16965. return e
  16966. }
  16967. .bind(this));
  16968. -1 !== i && this.setFloor(this.floors.list[i], null, t)
  16969. } else
  16970. this.toggleAllFloors(!0)
  16971. }
  16972. ,
  16973. t.prototype.setFloor = function(e, t, i) {
  16974. this.allFloorsVisible && this.emit("allfloors.toggled", !1, this.currentFloor),
  16975. this.allFloorsVisible = !1,
  16976. this._setFloor(e, t, i)
  16977. }
  16978. ,
  16979. t.prototype.toggleAllFloors = function(e) {
  16980. this.allFloorsVisible = void 0 !== e ? e : !this.allFloorsVisible,
  16981. this.emit("allfloors.toggled", this.allFloorsVisible, this.currentFloor),
  16982. this._setFloor(this.currentFloor)
  16983. }
  16984. ,
  16985. t.prototype._setFloor = function(e, t, i) {
  16986. var n;
  16987. if (t = t || this.mode,
  16988. this.emit("floor.changed", e, t, this.currentFloor),
  16989. this.currentFloor = e,
  16990. t === s.PANORAMA) {
  16991. if (this.show(),
  16992. this.shouldShowtags && this.tagsShown)
  16993. for (n in this.tags)
  16994. this.tags[n].show(u.showFloorDuration)
  16995. } else if ((t === s.FLOORPLAN || t === s.DOLLHOUSE) && (this.floors.list.forEach(function(e, t) {
  16996. e.toggle(e === this.currentFloor || this.allFloorsVisible, i || this.allFloorsVisible)
  16997. }
  16998. .bind(this)),
  16999. this.shouldShowtags && this.tagsShown))
  17000. for (n in this.tags) {
  17001. var r = this.tags[n];
  17002. this.allFloorsVisible ? r.show(u.showFloorDuration) : r.floor === this.currentFloor ? r.show(u.showFloorDuration, u.showFloorDelay) : r.hide(u.hideFloorDuration, u.hideFloorDelay)
  17003. }
  17004. var o = this
  17005. , a = e;
  17006. A.start(function() {}, u.showFloorDelay, function() {
  17007. o.floors.forEach(function(t) {
  17008. t.chunks.forEach(function(e) {
  17009. e.renderOrder = t === a ? l.visibleFloor : l.ghostFloor
  17010. })
  17011. })
  17012. }
  17013. .bind(this))
  17014. }
  17015. ,
  17016. t.prototype.toggleExplode = function() {
  17017. this.floors.toggleExplodeHorizontal()
  17018. }
  17019. ,
  17020. t.prototype.toggleExplodeUp = function() {
  17021. this.floors.toggleExplodeVertical()
  17022. }
  17023. ,
  17024. t.prototype.nextFloor = function(e) {
  17025. return this.floors.nextFloor(this.currentFloor, e)
  17026. }
  17027. ,
  17028. t.prototype.addFloor = function(e) {
  17029. this.floors.add(e)
  17030. }
  17031. ,
  17032. t.prototype.getFloorAtPoint = function(e) {
  17033. return this.floors.getFloorAtPoint(e)
  17034. }
  17035. ,
  17036. t.prototype.getTagBySid = function(e) {
  17037. return this.tags[e]
  17038. }
  17039. ,
  17040. t.prototype.addChunk = function(e, t) {
  17041. this.floors.getOrMakeFloor(e).addChunk(t),
  17042. this.chunks.push(t)
  17043. }
  17044. ,
  17045. t.prototype.setMode = function(t) {
  17046. if (!this.supportedModes[t])
  17047. throw new x("Mode not supported for this model: " + t);
  17048. this.mode = t
  17049. this.skybox.material.transparent = t == "panorama" ? false : true //xzw add // 如果skybox透明,会让其中其他mesh 如热点的透明出问题
  17050. this.chunks.forEach(function(e) {
  17051. e.setMode(t)
  17052. })
  17053. }
  17054. ,
  17055. t.prototype.build = function() {
  17056. this.heroLocations = this.images.getHeroLocations(this.panos);
  17057. var e = function() {
  17058. 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()
  17059. }
  17060. .bind(this)();
  17061. for (var t in this.has360Views = u.show360Views.enabled && this.heroLocations.some(function(e) {
  17062. return e.cameraMode === s.PANORAMA && this.panos.get(e.panoId) && !this.panos.get(e.panoId).isAligned()
  17063. }
  17064. .bind(this)) || e,
  17065. null === this.heroImage && R.warn("No hero image defined."),
  17066. this.currentFloor = this.floors.last(),
  17067. this.floors.build(),
  17068. this.colliders = this.floors.reduce(function(e, t) {
  17069. return e.concat(t.collider.children)
  17070. }, []),
  17071. this.panos.forEach(function(e) {
  17072. e.build1(),
  17073. e.on("enter", function() {
  17074. e.floor !== this.currentFloor && this.setFloor(e.floor)
  17075. }
  17076. .bind(this))
  17077. }
  17078. .bind(this)),
  17079. this.panos.forEach(function(e) {
  17080. e.build2()
  17081. }),
  17082. this.floors.forEach(function(e) {
  17083. this.boundingBox.union(e.boundingBox)
  17084. }
  17085. .bind(this)),
  17086. this.size = this.boundingBox.size(),
  17087. this.center = this.boundingBox.center(),
  17088. this.floors.forEach(function(e) {
  17089. R.info("Floor " + e + ": " + e.children.length + " chunks, " + e.panos.length + " panos.")
  17090. }
  17091. .bind(this)),
  17092. this.panos.populate_path_graph(),
  17093. this.skybox = new n(this.boundingBox),
  17094. this.skybox.matrixWorldNeedsUpdate = !0,
  17095. this.add(this.skybox),
  17096. setTimeout(function() {
  17097. this.hotsCount && this.shineHots()
  17098. }
  17099. .bind(this), 1300),
  17100. this.tags)
  17101. this.tags[t].build();
  17102. return R.debug("Done building model"),
  17103. 0 < f.raycastsDone && (R.warn("raycasts: " + f.raycastsDone),
  17104. R.warn("raycasts skipped: " + f.raycastsSkipped)),
  17105. this.buildRooms(),
  17106. this.labels.associateWithRooms(this.rooms),
  17107. $.when(this)
  17108. }
  17109. ,
  17110. t.prototype.loadLabels = function() {
  17111. this.labels = new b(this);
  17112. var e = $.Deferred();
  17113. /* if (window.MP_PREFETCHED_MODELDATA.model.player_options.labels && (this.showingLabels = !0),
  17114. !this.showingLabels) */
  17115. return e.resolve();
  17116. var t = g_Prefix + "data/" + this.sid + "/labels.json";
  17117. return this.labels.load(t, !this.isPublic).done(e.resolve.bind(e)).fail(function() {
  17118. R.warn("Getting labels failed, not displaying labels."),
  17119. e.resolve()
  17120. }),
  17121. e
  17122. }
  17123. ,
  17124. t.prototype.buildRooms = function() {
  17125. this.rooms = new _(this),
  17126. this.rooms.createFromChunks(this.chunks),
  17127. this.rooms.calcRoomBoundaries()
  17128. }
  17129. ,
  17130. t.prototype.updateProjectedPanos = function() {
  17131. this.projectedPano0 && this.projectedPano1 && this.setProjectedPanos(this.projectedPano0, this.projectedPano1, !1)
  17132. }
  17133. ,
  17134. t.prototype.setProjectedPanos = function(t, i, n) {
  17135. null != n || (n = !0),
  17136. n = !!n,
  17137. this.projectedPano0 = t,
  17138. this.projectedPano1 = i,
  17139. this.skybox.material.setProjectedPanos(t, i, n),
  17140. this.chunks.forEach(function(e) {
  17141. e.materialInside.setProjectedPanos(t, i, n)
  17142. })
  17143. }
  17144. ,
  17145. t.prototype.setSide = function(t) {
  17146. this.floors.forEach(function(e) {
  17147. e.collider.material.side = t
  17148. })
  17149. }
  17150. ,
  17151. t.prototype.heroCount = function() {
  17152. return this.heroLocations ? this.heroLocations.length : 0
  17153. }
  17154. ,
  17155. t.prototype.getHeroDescriptorByIndex = function(e) {
  17156. if (e < 0)
  17157. return R.warn("Model.getHeroDescriptorByHeroIndex() -> heroIndex is less than 0."),
  17158. null;
  17159. if (this.heroCount() < 1)
  17160. return R.warn("Model.getHeroDescriptorByIndex() -> No hero locations in this model"),
  17161. null;
  17162. var t = this.heroLocations[e];
  17163. return void 0 === t ? (R.warn("Model.getHeroDescriptorByIndex() -> Index " + e + " is not a validindex"),
  17164. null) : t
  17165. }
  17166. ,
  17167. t.prototype.findPanoramicHero = function() {
  17168. for (var e in this.heroLocations)
  17169. if (this.heroLocations[e].cameraMode === s.PANORAMA)
  17170. return this.heroLocations[e];
  17171. return null
  17172. }
  17173. ,
  17174. t.prototype.listImagePanos = function() {
  17175. var i = []
  17176. , n = this;
  17177. return this.images.forEach(function(e) {
  17178. if (e.metadata && e.metadata.scan_id) {
  17179. var t = n.panos.get(e.metadata.scan_id);
  17180. t && (n.supportsTiles || t.isLoaded("high") || i.push(t))
  17181. }
  17182. }),
  17183. i
  17184. }
  17185. ,
  17186. t.prototype.fadePanoMarkers = function(e, t) {
  17187. this.panos.fadeMarkerOpacity(e, t)
  17188. }
  17189. ,
  17190. t.prototype.setSweepVisibility = function(t) {
  17191. this.panos.forEach(function(e) {
  17192. e.marker && (e.marker.visible = t)
  17193. })
  17194. }
  17195. ,
  17196. t.prototype.outsideAllowed = function() {
  17197. return this.supportedModes[s.DOLLHOUSE] && this.supportedModes[s.FLOORPLAN]
  17198. }
  17199. ,
  17200. O.exports = t
  17201. }
  17202. ).call(this, "/js/model/Model.js")
  17203. }
  17204. , {
  17205. "../constants": 8,
  17206. "../enum/AlignmentType": 17,
  17207. "../enum/RenderOrder": 42,
  17208. "../enum/Viewmode": 51,
  17209. "../exception/BasicException": 55,
  17210. "../label/Label": 90,
  17211. "../loaders/ModelLoader": 105,
  17212. "../loaders/ModelTextureLoader": 106,
  17213. "../loaders/SweepDataLoader": 107,
  17214. "../tag/tag": 123,
  17215. "../tag/tagManager": 124,
  17216. "../objects/BoundingTextureSkybox": 143,
  17217. "../objects/Chunk": 144,
  17218. "../objects/Floor": 146,
  17219. "../objects/Panorama": 148,
  17220. "../objects/Room": 150,
  17221. "../objects/Snapshot": 153,
  17222. "../settings": 166,
  17223. "../shaders": 167,
  17224. "../util/ModelUrls": 177,
  17225. "../util/PanoramaCollection": 178,
  17226. "../util/ajax": 181,
  17227. "../util/common": 185,
  17228. "../util/easing": 186,
  17229. "../util/lerp": 188,
  17230. "../util/logger": 189,
  17231. "../util/math": 190,
  17232. "../util/texture": 194,
  17233. "../util/transitions": 195,
  17234. "./../util/browser": 182,
  17235. "./../util/showcase": 193,
  17236. "./Chunks": 135,
  17237. "./FloorCollection": 136,
  17238. "./ImageCollection": 137,
  17239. "./LabelCollection": 138,
  17240. "./RoomCollection": 141,
  17241. events: 202,
  17242. three: 217,
  17243. hot: "hot"
  17244. }],
  17245. 140: [function(e, t, i) {
  17246. "use strict";
  17247. function n() {
  17248. this.modelMap = {},
  17249. this.activeModel = null,
  17250. this.modelCount = 0,
  17251. this.tileDownloader = null,
  17252. this.panoRenderer = null
  17253. }
  17254. var r = (e("three"),
  17255. e("../util/common"))
  17256. , o = e("../exception/BasicException")
  17257. , a = e("../enum/ModelManagerEvents")
  17258. , s = e("../enum/PanoRendererEvents")
  17259. , l = e("events").EventEmitter;
  17260. n.prototype.init = function(e, t, i) {
  17261. this.tileDownloader = e,
  17262. this.panoRenderer = t,
  17263. this.qualityManager = i,
  17264. this.bindEvents()
  17265. }
  17266. ,
  17267. n.prototype.bindEvents = function() {
  17268. this.panoRenderer.on(s.TileRenderSuccess, this.onTileRendered.bind(this))
  17269. }
  17270. ,
  17271. n.prototype.onTileRendered = function(e, t, i, n) {}
  17272. ,
  17273. n.prototype.addModel = function(e) {
  17274. this.modelMap[e.sid] = e,
  17275. 0 === this.modelCount && this.activateModel(e.sid),
  17276. this.modelCount++,
  17277. this.emit(a.ModelAdded)
  17278. }
  17279. ,
  17280. n.prototype.getModel = function(e) {
  17281. return this.modelMap[e]
  17282. }
  17283. ,
  17284. n.prototype.activateModel = function(e) {
  17285. var t = this.modelMap[e];
  17286. if (!t)
  17287. throw new o("Tried to activate invalid model!");
  17288. var i = this.activeModel;
  17289. this.activeModel = t,
  17290. this.tileDownloader.setPanoData(t.panos, t.listImagePanos(), t.sid),
  17291. this.tileDownloader.setUrls(t.urls),
  17292. t.panos.forEach(function(e) {
  17293. e.attachToPanoRenderer(this.panoRenderer),
  17294. e.tileDownloader = this.tileDownloader,
  17295. e.qualityManager = this.qualityManager
  17296. }
  17297. .bind(this)),
  17298. this.emit(a.ActiveModelChanged, {
  17299. oldModel: i,
  17300. model: t
  17301. })
  17302. }
  17303. ,
  17304. n.prototype.getActiveModel = function() {
  17305. return this.activeModel
  17306. }
  17307. ,
  17308. r.extend(n, l),
  17309. t.exports = n
  17310. }
  17311. , {
  17312. "../enum/ModelManagerEvents": 33,
  17313. "../enum/PanoRendererEvents": 35,
  17314. "../exception/BasicException": 55,
  17315. "../util/common": 185,
  17316. events: 202,
  17317. three: 217
  17318. }],
  17319. 141: [function(r, l, e) {
  17320. (function(e) {
  17321. "use strict";
  17322. function o() {
  17323. n.call(this)
  17324. }
  17325. var a = r("../objects/Room")
  17326. , t = (r("../settings"),
  17327. r("../util/logger"))
  17328. , i = (r("../util/transitions"),
  17329. r("../util/easing"),
  17330. r("../util/common"))
  17331. , n = r("../util/IndexedCollection")
  17332. , s = r("./Chunks");
  17333. new t(e),
  17334. i.inherit(o, n),
  17335. o.prototype.getIndex = function(e) {
  17336. return e.roomId
  17337. }
  17338. ,
  17339. o.prototype.calcRoomBoundaries = function() {
  17340. this.forEach(function(e) {
  17341. e.calcBoundaries()
  17342. })
  17343. }
  17344. ,
  17345. o.prototype.createFromChunks = function(e) {
  17346. var n = {
  17347. floorId: -1,
  17348. roomId: -1
  17349. }
  17350. , r = {};
  17351. e.forEach(function(e) {
  17352. s.parseIdsFromChunkName(e.name, n);
  17353. var t = r[n.roomId];
  17354. if (!t) {
  17355. var i = o.generateRoomId(n.floorId, n.roomId);
  17356. t = new a(n.floorId,i),
  17357. this.add(t),
  17358. r[n.roomId] = t
  17359. }
  17360. t.addChunk(e)
  17361. }
  17362. .bind(this)),
  17363. this.calcRoomBoundaries()
  17364. }
  17365. ,
  17366. o.generateRoomId = function(e, t) {
  17367. return e + "_" + t
  17368. }
  17369. ,
  17370. l.exports = o
  17371. }
  17372. ).call(this, "/js/model/RoomCollection.js")
  17373. }
  17374. , {
  17375. "../objects/Room": 150,
  17376. "../settings": 166,
  17377. "../util/IndexedCollection": 175,
  17378. "../util/common": 185,
  17379. "../util/easing": 186,
  17380. "../util/logger": 189,
  17381. "../util/transitions": 195,
  17382. "./Chunks": 135
  17383. }],
  17384. 142: [function(e, t, i) {
  17385. "use strict";
  17386. function n(e, t, i) {
  17387. var n = (e = e.clone().expandByScalar(0.01)).size()
  17388. , r = new o.BoxGeometry(n.x,n.y,n.z);
  17389. r.boundingBox = e,
  17390. o.Mesh.call(this, r, t),
  17391. this.position.copy(e.center()),
  17392. this.frustumCulled = !1,
  17393. i && this.add(new o.WireframeHelper(this))
  17394. }
  17395. var o = e("three");
  17396. (n.prototype = Object.create(o.Mesh.prototype)).constructor = n,
  17397. t.exports = n
  17398. }
  17399. , {
  17400. three: 217
  17401. }],
  17402. 143: [function(l, c, e) {
  17403. (function(e) {
  17404. "use strict";
  17405. function t(e) {
  17406. s.time("Computing a nice bounding cubemap");
  17407. var t = new r({
  17408. side: i.BackSide,
  17409. transparent: !0
  17410. });
  17411. t.uniforms.modelAlpha.value = 0,
  17412. t.uniforms.opacity.value = 1 - o.modelAlpha,
  17413. this.renderOrder = a.boundingSkybox,
  17414. n.call(this, e, t),
  17415. s.timeEnd("Computing a nice bounding cubemap")
  17416. }
  17417. var i = l("three")
  17418. , n = (l("../enum/Viewmode"),
  17419. l("../shaders"),
  17420. l("./BoundingMesh"))
  17421. , r = l("../materials/ModelTextureMaterial")
  17422. , o = l("../settings")
  17423. , a = l("../enum/RenderOrder")
  17424. , s = new (l("../util/logger"))(e);
  17425. (t.prototype = Object.create(n.prototype)).constructor = t,
  17426. c.exports = t
  17427. }
  17428. ).call(this, "/js/objects/BoundingTextureSkybox.js")
  17429. }
  17430. , {
  17431. "../enum/RenderOrder": 42,
  17432. "../enum/Viewmode": 51,
  17433. "../materials/ModelTextureMaterial": 118,
  17434. "../settings": 166,
  17435. "../shaders": 167,
  17436. "../util/logger": 189,
  17437. "./BoundingMesh": 142,
  17438. three: 217
  17439. }],
  17440. 144: [function(e, t, i) {
  17441. "use strict";
  17442. function n(e) {
  17443. this.materialInside = new s({
  17444. side: r.DoubleSide
  17445. });
  17446. var t = r.UniformsUtils.clone(o.modelOutside.uniforms);
  17447. this.materialOutside = new r.RawShaderMaterial({
  17448. fragmentShader: o.modelOutside.fragmentShader,
  17449. vertexShader: o.modelOutside.vertexShader,
  17450. uniforms: t,
  17451. side: r.FrontSide,
  17452. name: "chunkOut"
  17453. }),
  17454. r.Mesh.call(this, e.geometry, this.materialInside),
  17455. this.name = e.name || "",
  17456. this.textureName = e.textureName,
  17457. this.meshUrl = e.meshUrl
  17458. }
  17459. var r = e("three")
  17460. , o = e("../shaders")
  17461. , a = e("../enum/Viewmode")
  17462. , s = e("../materials/ModelTextureMaterial");
  17463. (n.prototype = Object.create(r.Mesh.prototype)).setTextureMap = function(e) {
  17464. this.materialInside.uniforms.map.value = e,
  17465. this.materialOutside.uniforms.map.value = e
  17466. }
  17467. ,
  17468. n.prototype.setMode = function(e) {
  17469. var t = e === a.DOLLHOUSE || e === a.FLOORPLAN ? this.materialOutside : this.materialInside;
  17470. t.side = e === a.PANORAMA ? r.DoubleSide : r.FrontSide,
  17471. t.transparent = this.material.transparent,
  17472. t.uniforms.opacity.value = this.material.uniforms.opacity.value;
  17473. this.material = t
  17474. }
  17475. ,
  17476. t.exports = n
  17477. }
  17478. , {
  17479. "../enum/Viewmode": 51,
  17480. "../materials/ModelTextureMaterial": 118,
  17481. "../shaders": 167,
  17482. three: 217
  17483. }],
  17484. 145: [function(e, t, i) {
  17485. "use strict";
  17486. function n(e) {
  17487. this.chunksize = e || 10,
  17488. this.chunks = {},
  17489. this.boundingBoxes = {},
  17490. this.children = [],
  17491. this.offset = new m.Vector3(0,.5,0),
  17492. this.material = new m.MeshBasicMaterial({
  17493. color: 16777215 * Math.random(),
  17494. side: m.DoubleSide
  17495. })
  17496. }
  17497. var m = e("three");
  17498. e("../enum/Viewmode"),
  17499. n.prototype.add = function(e) {
  17500. var t, i, n, r, o, a, s, l, c, h, u = e.attributes;
  17501. u ? (t = u.position.array,
  17502. i = void 0 !== e.index ? e.index.array : void 0) : (t = e.vertices,
  17503. e.faces);
  17504. var d = new m.Vector3;
  17505. if (i)
  17506. for (n = 0,
  17507. r = i.length; n < r; n += 3) {
  17508. var p = 3 * i[n]
  17509. , f = 3 * i[n + 1]
  17510. , g = 3 * i[n + 2];
  17511. o = (t[p] + t[f] + t[g]) / 3,
  17512. a = (t[1 + p] + t[1 + f] + t[1 + g]) / 3,
  17513. s = (t[2 + p] + t[2 + f] + t[2 + g]) / 3,
  17514. c = (l = Math.floor(o / this.chunksize) + "." + Math.floor(a / this.chunksize) + "." + Math.floor(s / this.chunksize))in this.chunks ? (h = this.chunks[l],
  17515. this.boundingBoxes[l]) : (h = this.chunks[l] = [],
  17516. this.boundingBoxes[l] = new m.Box3),
  17517. 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]),
  17518. c.expandByPoint(d.set(t[p], t[1 + p], t[2 + p])),
  17519. c.expandByPoint(d.set(t[f], t[1 + f], t[2 + f])),
  17520. c.expandByPoint(d.set(t[g], t[1 + g], t[2 + g]))
  17521. }
  17522. else
  17523. for (n = 0,
  17524. r = t.length; n < r; n += 9)
  17525. o = (t[n] + t[n + 3] + t[n + 6]) / 3,
  17526. a = (t[n + 1] + t[n + 4] + t[n + 7]) / 3,
  17527. s = (t[n + 2] + t[n + 5] + t[n + 8]) / 3,
  17528. c = (l = Math.floor(o / this.chunksize) + "." + Math.floor(a / this.chunksize) + "." + Math.floor(s / this.chunksize))in this.chunks ? (h = this.chunks[l],
  17529. this.boundingBoxes[l]) : (h = this.chunks[l] = [],
  17530. this.boundingBoxes[l] = new m.Box3),
  17531. 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]),
  17532. c.expandByPoint(d.set(t[n], t[n + 1], t[n + 2])),
  17533. c.expandByPoint(d.set(t[n + 3], t[n + 4], t[n + 5])),
  17534. c.expandByPoint(d.set(t[n + 6], t[n + 7], t[n + 8]))
  17535. }
  17536. ,
  17537. n.prototype.build = function() {
  17538. var e = new m.Object3D;
  17539. for (var t in e.material = this.material,
  17540. this.chunks) {
  17541. var i = this.chunks[t]
  17542. , n = new m.BufferGeometry;
  17543. n.addAttribute("position", new m.BufferAttribute(new Float32Array(i),3)),
  17544. n.boundingBox = this.boundingBoxes[t];
  17545. var r = new m.Mesh(n,this.material);
  17546. r.material.visible = !1,
  17547. e.add(r),
  17548. this.chunks[t] = []
  17549. }
  17550. return e
  17551. }
  17552. ,
  17553. t.exports = n
  17554. }
  17555. , {
  17556. "../enum/Viewmode": 51,
  17557. three: 217
  17558. }],
  17559. 146: [function(e, t, i) {
  17560. "use strict";
  17561. var n = e("three")
  17562. , r = e("../settings")
  17563. , o = e("../util/common")
  17564. , a = e("../util/lerp")
  17565. , s = e("./ChunkedCollider")
  17566. , l = e("../util/transitions")
  17567. , c = e("../util/easing")
  17568. , h = (e("../objects/Panorama"),
  17569. e("../enum/RenderOrder"));
  17570. e("../localization/localize");
  17571. function u(e, t, i) {
  17572. n.Object3D.call(this),
  17573. this.model = e,
  17574. this.floorIndex = t,
  17575. this.lang = r.languageTag,
  17576. this.name = i || "cn" === r.languageTag ? "Floor " + (t + 1) : "第" + (t + 1) + "层",
  17577. this.panos = [],
  17578. this.chunks = [],
  17579. this.colliderBuilder = new s(3),
  17580. this.collider = null,
  17581. this.center = null,
  17582. this.boundingBox = new n.Box3,
  17583. this.size = null,
  17584. this.hidden = !1,
  17585. this.conservativeBoundingBox = new n.Box3,
  17586. this.debugColor = 16777215 * Math.random(),
  17587. this.transition = null
  17588. }
  17589. (u.prototype = Object.create(n.Object3D.prototype)).enter = function(e) {
  17590. this.model.setFloor(this, e)
  17591. }
  17592. ,
  17593. u.prototype.hide = function(e) {
  17594. if (!this.hidden || this.transition) {
  17595. this.chunks.forEach(function(e) {
  17596. e.material.transparent = !0
  17597. }),
  17598. l.cancel(this.transition);
  17599. var t = e ? 0 : r.hideFloorDuration + r.hideFloorDelay
  17600. , i = e ? 0 : r.hideFloorDelay / t;
  17601. this.transition = l.start(a.allUniforms(this.chunks, "opacity", .08), t, function() {
  17602. this.hidden = !0
  17603. }
  17604. .bind(this), i, c.easeInOutQuad)
  17605. }
  17606. }
  17607. ,
  17608. u.prototype.show = function(e) {
  17609. if (this.hidden || this.transition) {
  17610. this.hidden = !1,
  17611. l.cancel(this.transition);
  17612. var t = e ? r.showFloorDuration : r.showFloorDuration + r.showFloorDelay
  17613. , i = e ? 0 : r.showFloorDelay / t;
  17614. this.transition = l.start(a.allUniforms(this.chunks, "opacity", 1), t, function() {
  17615. this.hidden || this.chunks.forEach(function(e) {
  17616. e.material.transparent = !1
  17617. })
  17618. }
  17619. .bind(this), i, c.easeInOutQuad)
  17620. }
  17621. }
  17622. ,
  17623. u.prototype.toggle = function(e, t) {
  17624. (e = void 0 === e ? this.hidden : e) ? this.show(t) : this.hide(t)
  17625. }
  17626. ,
  17627. u.prototype.containsPoint = function(t) {
  17628. return this.collider.children.some(function(e) {
  17629. return e.geometry.boundingBox || e.geometry.computeBoundingBox(),
  17630. e.geometry.boundingBox.containsPoint(t)
  17631. })
  17632. }
  17633. ,
  17634. u.prototype.distanceToPoint = function(i) {
  17635. var n = null
  17636. , r = 1 / 0;
  17637. return this.collider.children.forEach(function(e) {
  17638. e.geometry.boundingBox || e.geometry.computeBoundingBox();
  17639. var t = e.geometry.boundingBox.distanceToPoint(i);
  17640. (!n || t < r) && (r = t,
  17641. n = e)
  17642. }),
  17643. r
  17644. }
  17645. ,
  17646. u.prototype.addChunk = function(e) {
  17647. e.renderOrder = h.ghostFloor,
  17648. this.add(e),
  17649. this.chunks.push(e),
  17650. this.boundingBox.union(e.geometry.boundingBox),
  17651. this.size = this.boundingBox.size(),
  17652. this.colliderBuilder.add(e.geometry)
  17653. }
  17654. ,
  17655. u.prototype.addPano = function(e) {
  17656. this.panos.push(e),
  17657. this.add(e.skyboxMesh),
  17658. e.marker && this.add(e.marker);
  17659. var t = new n.Vector3(1,1,1)
  17660. , i = (new n.Box3).setFromCenterAndSize(e.position, t);
  17661. this.boundingBox.union(i)
  17662. }
  17663. ,
  17664. u.prototype.build = function() {
  17665. this.collider = this.colliderBuilder.build(!0),
  17666. this.add(this.collider),
  17667. this.center = this.boundingBox.center(),
  17668. this.conservativeBoundingBox.copy(this.boundingBox),
  17669. this.conservativeBoundingBox.min.y = o.lowerMedian(this.collider.children.map(function(e) {
  17670. return e.geometry.boundingBox.min.y
  17671. }), 5),
  17672. this.conservativeBoundingBox.max.y = o.lowerMedian(this.collider.children.map(function(e) {
  17673. return e.geometry.boundingBox.max.y
  17674. }), 5),
  17675. this.colliderBuilder = null
  17676. }
  17677. ,
  17678. u.prototype.toShortString = function() {
  17679. return o.nth(this.floorIndex + 1)
  17680. }
  17681. ,
  17682. u.prototype.toString = function() {
  17683. return this.name
  17684. }
  17685. ,
  17686. t.exports = u
  17687. }
  17688. , {
  17689. "../enum/RenderOrder": 42,
  17690. "../localization/localize": 108,
  17691. "./strings-cn-CN": 109,
  17692. "../objects/Panorama": 148,
  17693. "../settings": 166,
  17694. "../util/common": 185,
  17695. "../util/easing": 186,
  17696. "../util/lerp": 188,
  17697. "../util/transitions": 195,
  17698. "./ChunkedCollider": 145,
  17699. three: 217
  17700. }],
  17701. 147: [function(e, t, i) {
  17702. "use strict";
  17703. function n(e) {
  17704. this.player = e,
  17705. this.obj3d = null,
  17706. this.UP = new u.Vector3(0,1,0)
  17707. }
  17708. var u = e("three")
  17709. , d = e("../settings");
  17710. n.prototype.prefs = {
  17711. linewidth: 3,
  17712. height: .07,
  17713. opacity: .45,
  17714. endScale: .05
  17715. },
  17716. n.prototype.discard = function() {
  17717. if (this.obj3d) {
  17718. var e = this.obj3d.parent;
  17719. e && e.remove(this.obj3d)
  17720. }
  17721. this.obj3d = null
  17722. }
  17723. ,
  17724. n.prototype.draw = function() {
  17725. if (this.discard(),
  17726. d.showNeighbors) {
  17727. var e = this.player.currentPano.floor;
  17728. this.obj3d = new u.Object3D;
  17729. var t = this.player.model.panos.getNeighbours(this.player.currentPano)
  17730. , i = this.player.currentPano.floorPosition.clone().sub(this.player.model.position);
  17731. i.y += this.prefs.height;
  17732. var n = .1525
  17733. , r = new u.Matrix4;
  17734. for (var o in t)
  17735. if (t[o]) {
  17736. var a = this.player.model.panos.get(o)
  17737. , s = (a.position.clone().sub(this.player.model.position),
  17738. a.position.clone().sub(a.floorPosition))
  17739. , l = a.floorPosition.clone().sub(this.player.model.position);
  17740. l.y += this.prefs.height;
  17741. var c = new u.Geometry;
  17742. 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)),
  17743. 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)),
  17744. r.identity().setPosition(s),
  17745. c.applyMatrix(r),
  17746. c.vertices.push(new u.Vector3(0,-this.prefs.endScale,0)),
  17747. 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)),
  17748. r.lookAt(l, i, this.UP).setPosition(l),
  17749. c.applyMatrix(r),
  17750. c.vertices.push(l, i);
  17751. var h = new u.Line(c,new u.LineBasicMaterial({
  17752. color: a.debugColor.getHex(),
  17753. transparent: !0,
  17754. opacity: this.prefs.opacity,
  17755. depthWrite: !1,
  17756. name: "sLine" + o,
  17757. linewidth: this.prefs.linewidth
  17758. }));
  17759. this.obj3d.add(h)
  17760. }
  17761. e.add(this.obj3d)
  17762. }
  17763. }
  17764. ,
  17765. n.prototype.update = function() {
  17766. d.showNeighbors && this.obj3d && this.obj3d.updateMatrixWorld()
  17767. }
  17768. ,
  17769. t.exports = n
  17770. }
  17771. , {
  17772. "../settings": 166,
  17773. three: 217
  17774. }],
  17775. 148: [function(S, M, e) {
  17776. (function(e) {
  17777. "use strict";
  17778. function r(e, t, i, n) {
  17779. this.model = e,
  17780. this.id = t,
  17781. this.alignmentType = i.alignmentType || c.ALIGNED,
  17782. this.neighbourUUIDs = i.neighbours || null,
  17783. this.neighbourPanos = null,
  17784. this.floor = null,
  17785. this.floorIndex = i.floor,
  17786. this.failedLoadingAt = 0,
  17787. this.maxLoadRetries = 4,
  17788. this.origin = i.position.clone(),
  17789. this.position = this.alignmentType === c.UNALIGNED ? new s.Vector3(0,-5,0) : i.position.clone(),
  17790. this.quaternion = i.quaternion.clone(),
  17791. this.skyboxMesh = new s.Mesh(E),
  17792. this.skyboxMesh.position.copy(this.position),
  17793. this.skyboxMesh.quaternion.copy(this.quaternion),
  17794. this.skyboxMesh.name = "skybox",
  17795. this.skyboxMesh.visible = !1,
  17796. this.skyboxMesh.updateMatrix(),
  17797. this.skyboxMesh.updateMatrixWorld(),
  17798. this.marker = null,
  17799. this.showFloorMarker = this.showFloorMarker = !window.MP_PREFETCHED_MODELDATA.hideFloorMarker,
  17800. this.isAligned() && (this.marker = new s.Mesh(_,new s.MeshBasicMaterial({
  17801. map: b,
  17802. side: s.DoubleSide,
  17803. opacity: 0,
  17804. transparent: !0,
  17805. depthWrite: !1
  17806. })),
  17807. this.marker.visible = this.showFloorMarker,
  17808. this.marker.renderOrder = l.panoMarker,
  17809. this.marker.name = "marker",
  17810. (this.marker.pano = this).marker.layers.set(v.PANOMARKERS),
  17811. this.marker.updateMatrixWorld(),
  17812. a.colorMarkerOnLoad && this.on("load", function() {
  17813. this.marker.material.color.set(65280)
  17814. })),
  17815. this.debugColor = (new s.Color).setHSL(.06 + .53 * Math.random(), .8 + .2 * Math.random(), .5 + .2 * Math.random()),
  17816. this.floorPosition = i.puck ? i.puck.clone() : null,
  17817. this.tiled = n,
  17818. this.tiled ? this.solidSkybox = null : (this.solidSkybox = new s.Texture([null, null, null, null, null, null]),
  17819. this.solidSkybox.flipY = !1,
  17820. a.minimalMemoryMode && (this.solidSkybox.minFilter = s.LinearFilter,
  17821. this.solidSkybox.magFilter = s.LinearFilter,
  17822. this.solidSkybox.generateMipmaps = !1)),
  17823. this.zoomed = !1,
  17824. this.panoRenderer = null,
  17825. this.qualityManager = null,
  17826. this.tileDownloader = null,
  17827. this.tiledPanoRenderTarget = null,
  17828. this.minimumTiledPanoLoaded = !1,
  17829. this.highestPartialTileRenderOpCompleted = 0,
  17830. this.highestFullTileRenderOpCompleted = 0,
  17831. this.shouldRedrawOnBaseLoaded = !1,
  17832. this.lockUntilRenderingComplete = !1,
  17833. a.colorMarkerOnLoad && this.on("load", function() {
  17834. this.marker.material.color.set(65280)
  17835. }),
  17836. (e = new s.TextureLoader).setCrossOrigin(!0);
  17837. var r = e.load("images/texture.jpg");
  17838. if (this.vrMarker = new s.Mesh(new s.OctahedronGeometry(.1,0),new s.MeshLambertMaterial({
  17839. color: 16777215,
  17840. transparent: !0,
  17841. opacity: .75,
  17842. map: r
  17843. })),
  17844. this.vrMarker.boluoType = "vr",
  17845. this.vrMarker.position.z = 1,
  17846. this.vrMarker.enabled = !0,
  17847. this.vrMarker.visible = !1,
  17848. window.vrMarkers = window.vrMarkers || [],
  17849. window.vrMarkers.push(this.vrMarker),
  17850. this.marker && this.marker.add(this.vrMarker),
  17851. a.showAxis && (this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(0,1,0),new s.Vector3(0,0,0),1,255)),
  17852. this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(0,0,1),new s.Vector3(0,0,0),1,16711680)),
  17853. this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(1,0,0),new s.Vector3(0,0,0),1,65280))),
  17854. this.adjustAngleEnable) {
  17855. (i = new s.Quaternion).setFromAxisAngle(new s.Vector3(1,0,0), this.adjustAngleX),
  17856. this.skyboxMesh.quaternion.multiply(i);
  17857. var o = new s.Quaternion;
  17858. o.setFromAxisAngle(new s.Vector3(0,1,0), this.adjustAngleY),
  17859. this.skyboxMesh.quaternion.multiply(o),
  17860. (n = new s.Quaternion).setFromAxisAngle(new s.Vector3(0,0,1), this.adjustAngleZ),
  17861. this.skyboxMesh.quaternion.multiply(n),
  17862. this.skyboxMesh.updateMatrix(),
  17863. this.skyboxMesh.updateMatrixWorld(),
  17864. this.model.updateProjectedPanos()
  17865. }
  17866. }
  17867. var i, t, s = S("three"), n = S("../util/logger"), a = S("../settings"), l = (S("../enum/Viewmode"),
  17868. S("../enum/RenderOrder")), c = S("../enum/AlignmentType"), o = (S("../util/common"),
  17869. S("../util/transitions")), h = S("../util/lerp"), u = S("../util/ajax"), d = S("../util/texture"), p = S("../util/panorama"), f = (S("../enum/TileDownloaderEvents"),
  17870. S("../enum/PanoramaEvents")), g = S("../enum/PanoRendererEvents"), m = S("../enum/PanoSizeClass"), v = S("../enum/RenderLayers"), y = (S("../scene/SceneRenderer"),
  17871. S("../enum/GLCubeFaces"),
  17872. 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");
  17873. (r.prototype = Object.create(C.prototype)).enter = (t = null,
  17874. function() {
  17875. this.setZoomed(!1),
  17876. this.emit("enter", {
  17877. oldPano: t,
  17878. newPano: this
  17879. }),
  17880. t = this
  17881. }
  17882. ),
  17883. r.prototype.exit = function() {
  17884. this.tiled ? (this.clearWaitDeferreds(),
  17885. this.minimumTiledPanoLoaded = !1,
  17886. this.tiledPanoRenderTarget = null,
  17887. this.setZoomed(!1),
  17888. this.panoRenderer.deactivateTiledPano(this),
  17889. this.highestPartialTileRenderOpCompleted = 0,
  17890. this.highestFullTileRenderOpCompleted = 0) : (this.solidSkybox.dispose(),
  17891. this.solidSkybox.loaded = !1,
  17892. this.solidSkybox.version = 0),
  17893. this.emit("exit")
  17894. }
  17895. ,
  17896. r.prototype.hoverOn = function(e) {
  17897. this.marker && (o.start(h.property(this.marker.material, "opacity", a[e].markerOpacityOnHover), 250),
  17898. a.navigation.panoScores & a.navigation.mouseDirection && this.addTextSprite("HIT", 12525854))
  17899. }
  17900. ,
  17901. r.prototype.hoverOff = function(e) {
  17902. this.marker && o.start(h.property(this.marker.material, "opacity", a[e].markerOpacity), 250)
  17903. }
  17904. ,
  17905. r.prototype.build1 = function() {
  17906. this.floor = this.floor || this.model.floors.get(this.floorIndex) || this.raycastToFindFloor() || this.model.getFloorAtPoint(this.position),
  17907. this.floor.addPano(this),
  17908. this.floorPosition = this.floorPosition || this.raycastFloorPosition(),
  17909. this.neighbourPanos = this.neighbourPanos || this.findNeighourPanos(),
  17910. a.colorMarkerByFloor && this.marker && this.marker.material.color.set(this.floor.debugColor)
  17911. }
  17912. ,
  17913. r.prototype.build2 = function() {
  17914. this.floorPosition = this.floorPosition || this.interpolateFloorPosition(),
  17915. this.height = this.position.distanceTo(this.floorPosition),
  17916. this.placeMarker()
  17917. }
  17918. ,
  17919. r.prototype.interpolateFloorPosition = function() {
  17920. var e = this.model.panos.filter(r.filters.isNeighbourPanoTo(this)).filter(function(e) {
  17921. return !!e.floorPosition
  17922. }).sort(function(e, t) {
  17923. return e.position.distanceTo(this.position) - t.position.distanceTo(this.position)
  17924. }
  17925. .bind(this))
  17926. , t = this.position.clone();
  17927. return 2 <= e.length ? t.y = (e[0].floorPosition.y + e[1].floorPosition.y) / 2 : t.add(a.noMeshFloorPositionOffset),
  17928. t
  17929. }
  17930. ,
  17931. r.prototype.raycastFloorPosition = function() {
  17932. I.warn("Performance warning: Raycasting to find floor position");
  17933. var e = new s.Raycaster(this.position,new s.Vector3(0,-1,0)).intersectObjects(this.model.colliders);
  17934. return e.length ? e[0].point : null
  17935. }
  17936. ,
  17937. 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)],
  17938. function() {
  17939. I.warn("Performance warning: Raycasting to find floor index");
  17940. for (var e = 0; e < i.length; e++) {
  17941. var t = new s.Raycaster(this.position.clone(),i[e].clone()).intersectObjects(this.model.colliders);
  17942. if (t.length)
  17943. return t[0].object.parent.parent
  17944. }
  17945. return null
  17946. }
  17947. ),
  17948. r.prototype.placeMarker = function() {
  17949. this.marker && (this.marker.position.copy(this.floorPosition),
  17950. this.marker.position.y += .05,
  17951. this.marker.lookAt(new s.Vector3(0,1,0).add(this.marker.position)))
  17952. }
  17953. ,
  17954. r.prototype.translate = function(e) {
  17955. this.position.add(e),
  17956. this.floorPosition.add(e)
  17957. }
  17958. ,
  17959. r.prototype.findClosestMidtpointPanoTo = function(e) {
  17960. return (new s.Vector3).addVectors(this.position, e.position).divideScalar(2),
  17961. this.model.panos.find([r.filters.notIn([this, e])], [r.sortFunctions.distanceToPoint(point)])
  17962. }
  17963. ,
  17964. r.prototype.attachToPanoRenderer = function(e) {
  17965. this.panoRenderer = e,
  17966. this.panoRenderer.on(g.TileRenderSuccess, this.onTileRendered.bind(this)),
  17967. this.panoRenderer.on(g.PanoRenderComplete, this.onPanoRendered.bind(this)),
  17968. this.panoRenderer.on(g.TileRenderFailure, this.onTileRenderFail.bind(this)),
  17969. this.panoRenderer.on(g.UploadAttemptedForAllTiles, this.onUploadAttemptedForAllTiles.bind(this))
  17970. }
  17971. ;
  17972. var w, T, x = {};
  17973. r.prototype.getWaitDeferred = function(e) {
  17974. var t = x[this.id];
  17975. t || (t = {},
  17976. x[this.id] = t);
  17977. var i = t[e];
  17978. return i || (i = {
  17979. deferred: $.Deferred(),
  17980. active: !1
  17981. },
  17982. t[e] = i),
  17983. i
  17984. }
  17985. ,
  17986. r.prototype.resetWaitDeferred = function(e) {
  17987. var t = this.getWaitDeferred(e);
  17988. t.active = !1,
  17989. t.deferred = $.Deferred()
  17990. }
  17991. ,
  17992. r.prototype.clearWaitDeferreds = function() {
  17993. var e = x[this.id];
  17994. for (var t in e || (e = {},
  17995. x[this.id] = e),
  17996. e)
  17997. if (e.hasOwnProperty(t)) {
  17998. var i = e[t];
  17999. i.active = !1,
  18000. i.deferred = $.Deferred()
  18001. }
  18002. }
  18003. ,
  18004. r.prototype.loadTiledPano = (new s.Vector3,
  18005. w = [],
  18006. T = [],
  18007. function(e, t, i, n, r, o) {
  18008. null != n || (n = !0),
  18009. null != r || (r = !0);
  18010. var a = this.getWaitDeferred(e)
  18011. , s = a.deferred
  18012. , l = null
  18013. , c = null;
  18014. if (i && ("number" == typeof i ? l = i : (l = i.hFov,
  18015. c = i.vFov)),
  18016. !this.isLoaded(e)) {
  18017. if (!a.active) {
  18018. if (a.active = !0,
  18019. i) {
  18020. var h = A.matchingTilesInDirection(this, e, t, l, c);
  18021. w[this.id + ":" + e] = {
  18022. tileCount: 0,
  18023. targetTileCount: h
  18024. },
  18025. I.info("Loading partial pano: " + this.id + " with " + h + " tiles")
  18026. }
  18027. T[this.id] || (T[this.id] = !0,
  18028. this.on(f.LoadComplete, function(e, t) {
  18029. var i = this.getWaitDeferred(e).deferred;
  18030. i && "pending" === i.state() && this.highestPartialTileRenderOpCompleted >= e && (i.resolve(e, t),
  18031. this.resetWaitDeferred(e))
  18032. }
  18033. .bind(this)),
  18034. this.on(f.LoadFailed, function(e) {
  18035. var t = this.getWaitDeferred(e).deferred;
  18036. t && "pending" === t.state() && this.highestPartialTileRenderOpCompleted >= e && (t.reject(e),
  18037. this.resetWaitDeferred(e))
  18038. }
  18039. .bind(this)),
  18040. this.on(f.TileLoaded, function(e, t, i) {
  18041. var n = this.getWaitDeferred(e).deferred;
  18042. if (n && "pending" === n.state()) {
  18043. n.notify(e, t, i);
  18044. var r = w[this.id + ":" + e];
  18045. r && (r.tileCount++,
  18046. r.tileCount === r.targetTileCount && (this.onPanoRendered(this.id, e, i, !0),
  18047. n.resolve(e, i),
  18048. this.resetWaitDeferred(e)))
  18049. }
  18050. }
  18051. .bind(this)))
  18052. }
  18053. this.tileDownloader.clearForceQueue(),
  18054. this.tileDownloader.forceQueueTilesForPano(this, e, t, l, c, o),
  18055. this.tiledPanoRenderTarget = this.panoRenderer.activateTiledPano(this, this.qualityManager.getMaxNavPanoSize(), n),
  18056. this.panoRenderer.renderPanoTiles(this.id, t, r)
  18057. }
  18058. return s.promise()
  18059. }
  18060. ),
  18061. r.prototype.onUploadAttemptedForAllTiles = function(e, t, i) {
  18062. e === this.id && t === this.qualityManager.getPanoSize(m.BASE) && this.shouldRedrawOnBaseLoaded && (this.shouldRedrawOnBaseLoaded = !1,
  18063. this.panoRenderer.resetRenderStatus(this.id, !0, !1),
  18064. this.panoRenderer.renderPanoTiles(this.id, null, !0, !0))
  18065. }
  18066. ,
  18067. r.prototype.onTileRendered = function(e, t, i, n) {
  18068. e === this.id && this.emit(f.TileLoaded, t, i, n)
  18069. }
  18070. ,
  18071. r.prototype.onPanoRendered = function(e, t, i, n) {
  18072. e === this.id && (this.minimumTiledPanoLoaded = !0,
  18073. this.updateSkyboxForZoomLevel(),
  18074. t > this.highestPartialTileRenderOpCompleted && (this.highestPartialTileRenderOpCompleted = t),
  18075. !n && t > this.highestFullTileRenderOpCompleted && (this.highestFullTileRenderOpCompleted = t),
  18076. this.emit("load", t),
  18077. this.model.emit("load", this),
  18078. this.emit(f.LoadComplete, t, i))
  18079. }
  18080. ,
  18081. r.prototype.setZoomed = function(e) {
  18082. this.zoomed = e,
  18083. this.updateSkyboxForZoomLevel()
  18084. }
  18085. ,
  18086. r.prototype.ensureSkyboxReadyForRender = function() {
  18087. this.tiled || (this.solidSkybox.loaded || (this.solidSkybox.needsUpdate = !0),
  18088. this.solidSkybox.loaded = !0)
  18089. }
  18090. ,
  18091. r.prototype.updateSkyboxForZoomLevel = function() {
  18092. this.minimumTiledPanoLoaded && this.model.updateProjectedPanos()
  18093. }
  18094. ,
  18095. r.prototype.getSkyboxTexture = function() {
  18096. return this.tiled ? this.minimumTiledPanoLoaded ? this.zoomed ? this.panoRenderer.zoomRenderTarget.texture : this.tiledPanoRenderTarget.texture : null : this.solidSkybox
  18097. }
  18098. ,
  18099. r.prototype.onTileRenderFail = function(e, t, i) {
  18100. e === this.id && this.emit(f.LoadFailed, t)
  18101. }
  18102. ,
  18103. r.prototype.isLoaded = function(e) {
  18104. if (this.tiled) {
  18105. if (e && "string" == typeof e)
  18106. throw new y("Wrong panoSize given to Panorama.isLoaded(); a tiled pano uses PanoSizeClass");
  18107. return !!this.minimumTiledPanoLoaded && (!e || this.highestPartialTileRenderOpCompleted >= e)
  18108. }
  18109. if (e && "number" == typeof e)
  18110. throw new y("Wrong panoSize given to Panorama.isLoaded(); a non-tiled pano uses high/low.");
  18111. return !!this.solidSkybox.high || e in this.solidSkybox
  18112. }
  18113. ,
  18114. r.prototype.loadCube = function(a) {
  18115. if (this.isLoaded(a))
  18116. return I.info("Skipping load of pano, already loaded"),
  18117. $.when();
  18118. this.emit("loading", a),
  18119. this.model.emit("loading", this);
  18120. var n = p.getCubemapUrls(this.model.urls, this.id, a)
  18121. , e = n.filter(function(e) {
  18122. return !e
  18123. });
  18124. "low" === a && 0 < e.length && (I.info("Pano", this.id, "not available in low res, loading high res right away"),
  18125. a = "high",
  18126. n = p.getCubemapUrls(this.model.urls, this.id, a));
  18127. var t = 0
  18128. , i = [0, 1, 2, 3, 4, 5].map(function(e, t, i) {
  18129. return u.getImage(n[t])
  18130. }
  18131. .bind(this));
  18132. return $.when(i[0], i[1], i[2], i[3], i[4], i[5]).then(function(e, t, i, n, r, o) {
  18133. return this.solidSkybox[a] = [e, t, i, n, r, o],
  18134. "high" !== a && this.solidSkybox.high || (this.solidSkybox.image = this.solidSkybox[a],
  18135. this.solidSkybox.low = null),
  18136. this.solidSkybox.needsUpdate = !0,
  18137. this.emit("load", a),
  18138. this.model.emit("load", this),
  18139. this
  18140. }
  18141. .bind(this), function() {
  18142. I.error("Downloading cubemap for pano", this.id, "failed"),
  18143. this.failedLoadingAt = Date.now()
  18144. }
  18145. .bind(this), function() {
  18146. return $.when(++t, 6)
  18147. })
  18148. }
  18149. ,
  18150. r.raycastsSkipped = 0,
  18151. r.raycastsDone = 0,
  18152. r.prototype.findNeighourPanos = function() {
  18153. return this.model.panos.setNeighbour(this.id, this.id, !1),
  18154. this.model.panos.forEach(function(e) {
  18155. if (e !== this && (!this.model.panos.neighbourMap[this.id] || void 0 === this.model.panos.neighbourMap[this.id][e.id])) {
  18156. var t = this.position.distanceTo(e.position);
  18157. if (t > a.panoramaNeighbourMaxDistance)
  18158. return this.model.panos.setNeighbour(this, e, !1),
  18159. void r.raycastsSkipped++;
  18160. var i = e.position.clone().sub(this.position).normalize()
  18161. , n = new s.Raycaster(this.position,i.clone(),0,t).intersectObjects(this.model.colliders);
  18162. r.raycastsDone++,
  18163. this.model.panos.setNeighbour(this, e, 0 === n.length),
  18164. 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)))
  18165. }
  18166. }
  18167. .bind(this)),
  18168. this.model.panos.neighbourMap[this.id]
  18169. }
  18170. ,
  18171. r.prototype.worldPosition = function() {
  18172. return this.position
  18173. }
  18174. ,
  18175. r.prototype.addTextSprite = function(e, t) {
  18176. this.removeTextSprite();
  18177. var i = document.createElement("canvas")
  18178. , n = i.getContext("2d");
  18179. i.width = 256,
  18180. i.height = 256;
  18181. n.font = "bold 60px Arial",
  18182. n.fillStyle = "white";
  18183. var r = n.measureText(e).width;
  18184. n.fillText(e, (i.width - r) / 2, (i.height + 60) / 2);
  18185. var o = new s.Texture(i);
  18186. o.needsUpdate = !0;
  18187. var a = new s.SpriteMaterial({
  18188. map: o,
  18189. color: t || 16428055
  18190. });
  18191. this.text3d = new s.Sprite(a),
  18192. this.text3d.position.copy(this.skyboxMesh.position),
  18193. this.floor.add(this.text3d)
  18194. }
  18195. ,
  18196. r.prototype.removeTextSprite = function() {
  18197. this.text3d && (this.floor.remove(this.text3d),
  18198. this.text3d = null)
  18199. }
  18200. ,
  18201. r.prototype.isAligned = function() {
  18202. return this.alignmentType === c.ALIGNED
  18203. }
  18204. ,
  18205. r.filters = {
  18206. inDirection: function(t, i, n) {
  18207. return function(e) {
  18208. return e.position.clone().sub(t).normalize().dot(i) > n
  18209. }
  18210. },
  18211. inFloorDirection: function(t, i, n) {
  18212. return function(e) {
  18213. return e.floorPosition.clone().sub(t).normalize().dot(i) > n
  18214. }
  18215. },
  18216. inPanoDirection: function(n, r, o) {
  18217. return o = a.navigation.panoScores ? a.navigation.filterStrictness : o,
  18218. function(e) {
  18219. var t = e.floorPosition.clone().sub(n).normalize()
  18220. , i = e.position.clone().sub(n).normalize();
  18221. return t.dot(r) > o || i.dot(r) > o
  18222. }
  18223. },
  18224. atFloor: function(t) {
  18225. return function(e) {
  18226. return !t || e.floor === t
  18227. }
  18228. },
  18229. not: function(t) {
  18230. return function(e) {
  18231. return e !== t
  18232. }
  18233. },
  18234. notIn: function(t) {
  18235. return function(e) {
  18236. return -1 === t.indexOf(e)
  18237. }
  18238. },
  18239. isLoaded: function() {
  18240. return function(e) {
  18241. return e.isLoaded()
  18242. }
  18243. },
  18244. isNotLoaded: function() {
  18245. return function(e) {
  18246. return !e.isLoaded()
  18247. }
  18248. },
  18249. isCloseEnoughTo: function(t, i) {
  18250. return function(e) {
  18251. return t.distanceTo(e.floorPosition) < i
  18252. }
  18253. },
  18254. hasMinimumHeightDifferenceTo: function(t, i) {
  18255. return function(e) {
  18256. return Math.abs(e.position.y - t.y) > i
  18257. }
  18258. },
  18259. isNotBehindNormal: function(t, i) {
  18260. var n = new s.Vector3;
  18261. return i = i.clone(),
  18262. function(e) {
  18263. return 0 < n.copy(e.position).sub(t).normalize().dot(i)
  18264. }
  18265. },
  18266. isNeighbourPanoTo: function(t) {
  18267. return function(e) {
  18268. return !t || !t.neighbourPanos || !!t.neighbourPanos[e.id]
  18269. }
  18270. },
  18271. isNeighbourOfNeighbourTo: function(n) {
  18272. return function(i) {
  18273. return !!n.neighbourPanos[i.id] || n.neighbourUUIDs.some(function(e) {
  18274. var t = n.model.panos.get(e);
  18275. return !!t && t.neighbourPanos[i.id]
  18276. })
  18277. }
  18278. },
  18279. isNotRecentlyFailed: function(t) {
  18280. return function(e) {
  18281. return Date.now() - e.failedLoadingAt > t
  18282. }
  18283. },
  18284. isOnVisibleFloor: function() {
  18285. return function(e) {
  18286. return !e.floor.hidden
  18287. }
  18288. },
  18289. isPanoAligned: function() {
  18290. return function(e) {
  18291. return e.isAligned()
  18292. }
  18293. }
  18294. },
  18295. r.sortFunctions = {
  18296. distanceToPoint: function(i) {
  18297. return function(e, t) {
  18298. return e.position.distanceTo(i) - t.position.distanceTo(i)
  18299. }
  18300. },
  18301. floorDistanceToPoint: function(i) {
  18302. return function(e, t) {
  18303. return e.floorPosition.distanceTo(i) - t.floorPosition.distanceTo(i)
  18304. }
  18305. },
  18306. choose: function(i) {
  18307. return function(e, t) {
  18308. return i.id === e.id ? -1 : i.id === t.id ? 1 : 0
  18309. }
  18310. }
  18311. },
  18312. r.scoreFunctions = {
  18313. distance: function(t, i) {
  18314. return i = i || a.navigation.distanceFactor,
  18315. function(e) {
  18316. return t ? t.position.distanceTo(e.position) * i : 0
  18317. }
  18318. },
  18319. distanceSquared: function(t, i) {
  18320. return i = i || a.navigation.distanceFactor,
  18321. function(e) {
  18322. return t ? t.position.distanceToSquared(e.position) * i : 0
  18323. }
  18324. },
  18325. direction: function(t, i) {
  18326. return function(e) {
  18327. return e.position.clone().sub(t).normalize().dot(i) * a.navigation.directionFactor
  18328. }
  18329. },
  18330. angle: function(t, i) {
  18331. return function(e) {
  18332. return e.position.clone().sub(t).normalize().angleTo(i) * a.navigation.angleFactor
  18333. }
  18334. },
  18335. inFieldOfView: function(t, i) {
  18336. return function(e) {
  18337. return .75 < e.position.clone().sub(t).normalize().dot(i) ? 10 : -1
  18338. }
  18339. },
  18340. optionality: function(t) {
  18341. return function(e) {
  18342. return e.neighbourUUIDs.filter(function(e) {
  18343. return !(e in t.neighbourUUIDs) && e !== t.id
  18344. }).length * a.navigation.optionalityFactor
  18345. }
  18346. },
  18347. penalizeHeightDifferenceUnder: function(t, i) {
  18348. return function(e) {
  18349. return t.y - e.position.y < i ? -20 : 0
  18350. }
  18351. }
  18352. },
  18353. M.exports = r
  18354. }
  18355. ).call(this, "/js/objects/Panorama.js")
  18356. }
  18357. , {
  18358. "../enum/AlignmentType": 17,
  18359. "../enum/GLCubeFaces": 25,
  18360. "../enum/PanoRendererEvents": 35,
  18361. "../enum/PanoSizeClass": 36,
  18362. "../enum/PanoramaEvents": 37,
  18363. "../enum/RenderLayers": 41,
  18364. "../enum/RenderOrder": 42,
  18365. "../enum/TileDownloaderEvents": 45,
  18366. "../enum/Viewmode": 51,
  18367. "../exception/BasicException": 55,
  18368. "../scene/SceneRenderer": 158,
  18369. "../settings": 166,
  18370. "../tile/TileUtils": 174,
  18371. "../util/ajax": 181,
  18372. "../util/common": 185,
  18373. "../util/lerp": 188,
  18374. "../util/logger": 189,
  18375. "../util/panorama": 191,
  18376. "../util/texture": 194,
  18377. "../util/transitions": 195,
  18378. events: 202,
  18379. three: 217
  18380. }],
  18381. 149: [function(e, t, i) {
  18382. "use strict";
  18383. function n(e) {
  18384. var t = r.UniformsUtils.clone(c.waypoint.uniforms);
  18385. t.map.value = d,
  18386. t.opacity.value = 0,
  18387. t.color.value.set(o.reticuleColor),
  18388. t.showMouseMarker = !window.MP_PREFETCHED_MODELDATA.hideMouseMarker;
  18389. r.Mesh.call(this, new r.PlaneBufferGeometry(.4,.4,1,1), new r.RawShaderMaterial({
  18390. side: r.DoubleSide,
  18391. depthWrite: !1,
  18392. depthTest: !1,
  18393. transparent: !0,
  18394. vertexShader: c.waypoint.vertexShader,
  18395. fragmentShader: c.waypoint.fragmentShader,
  18396. uniforms: t,
  18397. name: "waypoint",
  18398. opacity: 0,
  18399. visible: t.showMouseMarker
  18400. })),
  18401. this.layers.set(h.RETICULE),
  18402. this.renderOrder = u.reticule,
  18403. this.player = e,
  18404. this.direction = new r.Vector3,
  18405. this.hidden = !0,
  18406. this.mouseLastMoveTime = Date.now()
  18407. }
  18408. var r = e("three")
  18409. , o = e("../settings")
  18410. , a = e("../util/transitions")
  18411. , s = e("../util/texture")
  18412. , l = e("../util/lerp")
  18413. , c = e("../shaders")
  18414. , h = e("../enum/RenderLayers")
  18415. , u = e("../enum/RenderOrder")
  18416. , d = s.load("images/reticule-256x256.png");
  18417. (n.prototype = Object.create(r.Mesh.prototype)).move = function(e, t, i) {
  18418. this.hidden = i,
  18419. this.mouseLastMoveTime = Date.now()
  18420. }
  18421. ,
  18422. n.prototype.hide = function() {
  18423. this.hidden || (this.hidden = !0,
  18424. a.start(l.property(this.material.uniforms.opacity, "value", 0), o.reticuleOpacityTransitionTime))
  18425. }
  18426. ,
  18427. n.prototype.show = function() {
  18428. this.hidden = !1,
  18429. this.material.opacity <= 0 && a.start(l.property(this.material.uniforms.opacity, "value", o[this.player.mode].reticuleOpacity), o.reticuleOpacityTransitionTime)
  18430. }
  18431. ,
  18432. n.prototype.update = function() {
  18433. Date.now() - this.mouseLastMoveTime > o.hideReticuleTimeout && !this.hidden && this.hide()
  18434. }
  18435. ,
  18436. n.prototype.updatePosition = function(e, t) {
  18437. if (!this.hidden) {
  18438. if (!t)
  18439. return this.hide();
  18440. var i = t.point
  18441. , n = e.distanceTo(i)
  18442. , r = 1 + .01 * n;
  18443. n < 1 && (r -= 1 - n),
  18444. this.show(),
  18445. this.scale.set(r, r, r),
  18446. this.direction = this.direction.multiplyScalar(.8),
  18447. this.direction.add(t.face.normal.clone().multiplyScalar(.2)),
  18448. this.position.copy(i).add(t.face.normal.clone().multiplyScalar(.01)),
  18449. this.lookAt(this.position.clone().add(this.direction))
  18450. }
  18451. }
  18452. ,
  18453. n.prototype.writeAstag = function() {
  18454. var e = Math.floor(4294967296 * (1 + Math.random())).toString(16) + Math.floor(16 * (1 + Math.random())).toString(16)
  18455. , t = new Date;
  18456. this.tagCount = void 0 === this.tagCount ? 1 : this.tagCount + 1;
  18457. var i = {
  18458. enabled: !0,
  18459. version: "0",
  18460. created: t.toISOString(),
  18461. created_by: "APITest",
  18462. position: this.position.clone(),
  18463. stem: {
  18464. enabled: o.tags.pole.enabled,
  18465. direction: this.direction.multiplyScalar(o.tags.pole.height)
  18466. },
  18467. label: "tag " + this.tagCount,
  18468. description: "Description " + e,
  18469. floor: function(e) {
  18470. if (e.currentFloor) {
  18471. var t = e.floors.indexOf(e.currentFloor);
  18472. return -1 < t ? t : void 0
  18473. }
  18474. }(this.player.model),
  18475. type: "info",
  18476. metadata: {
  18477. preferred_camera: {
  18478. mode: this.player.mode
  18479. }
  18480. }
  18481. };
  18482. console.log("--------------------------"),
  18483. console.log(JSON.stringify(i));
  18484. var n = this.player.model.addtag(e, i).build();
  18485. n && (n.disc && this.player.tagDiscs.push(n.disc),
  18486. n.visible || n.show(o.tags.startup.fadeInDuration))
  18487. }
  18488. ,
  18489. t.exports = n
  18490. }
  18491. , {
  18492. "../enum/RenderLayers": 41,
  18493. "../enum/RenderOrder": 42,
  18494. "../settings": 166,
  18495. "../shaders": 167,
  18496. "../util/lerp": 188,
  18497. "../util/texture": 194,
  18498. "../util/transitions": 195,
  18499. three: 217
  18500. }],
  18501. 150: [function(e, t, i) {
  18502. "use strict";
  18503. function n(e, t) {
  18504. this.chunks = [],
  18505. this.floorId = e,
  18506. this.roomId = t,
  18507. this.position = new l.Vector3
  18508. }
  18509. var l = e("three");
  18510. n.prototype.addChunk = function(e) {
  18511. this.chunks.push(e)
  18512. }
  18513. ,
  18514. n.prototype.calcBoundaries = function() {
  18515. 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++) {
  18516. var a = this.chunks[o].geometry.attributes.position;
  18517. if (a)
  18518. for (var s = 0; s < a.array.length; s += 3)
  18519. e.set(a.array[s], a.array[s + 1], a.array[s + 2]),
  18520. t.add(e),
  18521. 0 === s ? (i.copy(e),
  18522. n.copy(e)) : (i.max(e),
  18523. n.min(e)),
  18524. r++
  18525. }
  18526. 0 < r ? (t.multiplyScalar(1 / r),
  18527. this.average = t) : this.average = null,
  18528. this.boundsMax = i,
  18529. this.boundsMin = n,
  18530. this.center = new l.Vector3,
  18531. this.center.copy(i).sub(n).multiplyScalar(.5).add(n)
  18532. }
  18533. ,
  18534. t.exports = n
  18535. }
  18536. , {
  18537. three: 217
  18538. }],
  18539. 151: [function(o, v, e) {
  18540. (function(e) {
  18541. "use strict";
  18542. function t(e, t, i) {
  18543. this.obj3d = null,
  18544. this.nodes = [],
  18545. this.colorHull = [],
  18546. this.shortPaths = {},
  18547. this.floorHull = null,
  18548. this.cameraHull = null,
  18549. this.floorPathDistance = 0,
  18550. this.floorCurvePoints = null,
  18551. this.floorCurveColors = null,
  18552. this.camCurvePoints = null,
  18553. this.warpDestHeroLoc = null,
  18554. this.warpDestPano = null,
  18555. this.warpPathPoints = null,
  18556. this.warpPathLengths = [0],
  18557. this.warpLength = 0,
  18558. this.closeWarpDistance = 4,
  18559. this.UP = U.UP.clone(),
  18560. this.longestStep = 0,
  18561. this.upcomingTransType = null,
  18562. this.burnsDir = 1,
  18563. this.prevNextDist = 0,
  18564. this.nextI = 0,
  18565. this.activeTransType = null,
  18566. this.lastTransType = null,
  18567. this.bunnyObj = null,
  18568. this.director = e,
  18569. this.player = t,
  18570. this.playerControls = i,
  18571. this.modelManager = t.modelManager,
  18572. this.updateModel(),
  18573. this.updateDefaultsFromModelData(),
  18574. this.bindEvents(),
  18575. this.warping = !1,
  18576. this.waitingToWarp = !1,
  18577. this.warpInterrupted = !1,
  18578. this.warpInterruptionBlackoutStyle = null,
  18579. this.warpInterruptionTravelTime = null
  18580. }
  18581. 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"),
  18582. o("../util/texture")), U = o("../enum/Vectors"), H = (o("../model/ModelManager"),
  18583. new i(e)), g = o("../enum/PlayerEvents"), z = o("../enum/BlackoutStyle"), r = o("../enum/ModelManagerEvents"), m = o("../constants"), I = {
  18584. 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"),
  18585. pathEnd: n.load("images/End.png"),
  18586. 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==")
  18587. };
  18588. t.prototype.setScene = function(e) {
  18589. this.createCpm(e),
  18590. this.createBunnyObj(e)
  18591. }
  18592. ,
  18593. t.prototype.updateModel = function() {
  18594. this.model = this.modelManager.getActiveModel()
  18595. }
  18596. ,
  18597. t.prototype.bindEvents = function() {
  18598. this.modelManager.on(r.ActiveModelChanged, this.updateModel.bind(this))
  18599. }
  18600. ,
  18601. t.prototype.updateDefaultsFromModelData = function() {
  18602. this.model.data
  18603. }
  18604. ,
  18605. t.prototype.pointPathDistance = function(e) {
  18606. for (var t = 0, i = 1; i < e.length; i += 1)
  18607. t += e[i - 1].distanceTo(e[i]);
  18608. return t
  18609. }
  18610. ,
  18611. t.prototype.pointPathLengths = function(e) {
  18612. for (var t = [0], i = 1; i < e.length; i += 1)
  18613. t.push(t[i - 1] + e[i - 1].distanceTo(e[i]));
  18614. return t
  18615. }
  18616. ,
  18617. t.prototype.interpAlongPath = function(e, t, i) {
  18618. var n, r = new P.Vector3, o = t[t.length - 1];
  18619. if (i < 1) {
  18620. n = i * o;
  18621. for (var a = 1; a < t.length; a += 1)
  18622. if (t[a] > n) {
  18623. var s = (n - t[a - 1]) / (t[a] - t[a - 1]);
  18624. return r.copy(e[a]),
  18625. r.sub(e[a - 1]),
  18626. r.multiplyScalar(s),
  18627. r.add(e[a - 1]),
  18628. r
  18629. }
  18630. } else
  18631. r.copy(e[e.length - 1]);
  18632. return r
  18633. }
  18634. ,
  18635. t.prototype.pathHeight = function() {
  18636. return this.player.mode !== O.FLOORPLAN ? D.path.height : D.path.outsideHeight
  18637. }
  18638. ,
  18639. t.prototype.createBunnyObj = function(e) {
  18640. this.bunnyObj || (this.bunnyObj = new P.AxisHelper(.1),
  18641. this.bunnyObj.visible = D.warp.showBunny),
  18642. this.bunnyObj.parent && this.bunnyObj.parent.remove(bunnyObj),
  18643. e.add(this.bunnyObj)
  18644. }
  18645. ,
  18646. t.prototype.createCpm = function(e) {
  18647. if (!this.currentPanoMarker) {
  18648. var t = this.makeWaypointObj(I.pathEnd, "Current");
  18649. t.material.uniforms.opacity.value = 0,
  18650. this.currentPanoMarker = {
  18651. mesh: t,
  18652. placed: !1
  18653. }
  18654. }
  18655. this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  18656. this.placeCpm(),
  18657. this.currentPanoMarker.mesh.parent || e.add(this.currentPanoMarker.mesh)
  18658. }
  18659. ,
  18660. t.prototype.placeCpm = function() {
  18661. if (D.path.mapGuides && this.player.currentPano && this.player.currentPano.isAligned()) {
  18662. var e = this.player.currentPano.floor;
  18663. this.currentPanoMarker.mesh.parent !== this.player.currentPano.floor && (this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  18664. e.add(this.currentPanoMarker.mesh)),
  18665. this.currentPanoMarker.mesh.position.copy(this.player.currentPano.floorPosition).sub(e.position),
  18666. this.currentPanoMarker.mesh.position.y += this.pathHeight(),
  18667. this.currentPanoMarker.placed = !0
  18668. } else
  18669. this.popOutCpm()
  18670. }
  18671. ,
  18672. t.prototype.fadeInCpm = function(e) {
  18673. 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)
  18674. }
  18675. ,
  18676. t.prototype.fadeOutCpm = function(e) {
  18677. V.start(F.property(this.currentPanoMarker.mesh.material.uniforms.opacity, "value", 0), e)
  18678. }
  18679. ,
  18680. t.prototype.popInCpm = function() {
  18681. D.path.mapGuides && this.currentPanoMarker.placed && this.fadeInCpm(2)
  18682. }
  18683. ,
  18684. t.prototype.popOutCpm = function() {
  18685. this.fadeOutCpm(2)
  18686. }
  18687. ,
  18688. t.prototype.brushPrefs = {
  18689. linewidth: 7,
  18690. strokeWidth: 15,
  18691. cvSegments: 48,
  18692. paveStep: .1,
  18693. paveWidth: .2,
  18694. lookBlendDist: 3,
  18695. maxTurn: P.Math.degToRad(2)
  18696. },
  18697. t.prototype.panoPathDistance = function(e) {
  18698. var t = this.model.panos;
  18699. if (!e || e.length < 2)
  18700. return 0;
  18701. for (var i = [], n = 0; n < e.length; n += 1)
  18702. i.push(t.get(e[n]).floorPosition);
  18703. return this.pointPathDistance(i)
  18704. }
  18705. ,
  18706. t.prototype.loadTileTexture = function(t) {
  18707. var e = n.load(t, function(e) {
  18708. e.wrapS = P.RepeatWrapping,
  18709. e.wrapT = P.RepeatWrapping,
  18710. e.needsUpdate = !0,
  18711. H.debug('path texture "' + t + '" is ready')
  18712. }, function() {
  18713. H.error('path texture "' + t + '" failed')
  18714. });
  18715. return e.mapping = P.UVMapping,
  18716. e
  18717. }
  18718. ,
  18719. t.prototype.buildWarpDestinationDescriptor = function(e, t, i, n, r, o) {
  18720. return new l({
  18721. cameraMode: n,
  18722. position: e,
  18723. quaternion: t,
  18724. panoId: i,
  18725. orthoZoom: o,
  18726. floorVisibility: r,
  18727. thumbUrl: null,
  18728. name: null
  18729. })
  18730. }
  18731. ,
  18732. t.prototype.buildWarpDestinationDescriptorFromHero = function(e) {
  18733. return this.buildWarpDestinationDescriptor(e.position, e.quaternion, this.getHeroId(e), e.cameraMode, e.floorVisibility, e.orthoZoom)
  18734. }
  18735. ,
  18736. t.prototype.setWarpDestination = function(e) {
  18737. this.warpDestHeroLoc = e
  18738. }
  18739. ,
  18740. t.prototype.setWarpDestinationByHeroIndex = function(e) {
  18741. var t = this.getHeroDescriptorByHeroIndex(e);
  18742. return null !== t && (this.setWarpDestination(t),
  18743. !0)
  18744. }
  18745. ,
  18746. t.prototype.setWarpDestinationByPano = function(e, t) {
  18747. return !!this.model.panos.get(e.id) && this.setWarpDestinationByPanoId(e.id, t)
  18748. }
  18749. ,
  18750. t.prototype.setWarpDestinationByPanoId = function(e, t) {
  18751. var i = this.model.panos.get(e);
  18752. if (i) {
  18753. t = t || new P.Quaternion;
  18754. var n = this.buildWarpDestinationDescriptor(i.position, t, i.id, "panorama", [], -1);
  18755. return this.setWarpDestination(n),
  18756. !0
  18757. }
  18758. return !1
  18759. }
  18760. ,
  18761. t.prototype.getHeroDescriptorByHeroIndex = function(e) {
  18762. var t = this.model.heroCount();
  18763. if (null !== this.warpDestHeroLoc && t < 2)
  18764. return H.info("ShowPath.getHeroDescriptorByHeroIndex() -> Only one hero location is available."),
  18765. this.model.getHeroDescriptorByIndex(0);
  18766. var i = this.model.getHeroDescriptorByIndex(e);
  18767. if (i) {
  18768. var n = i.isPano() ? i.panoId : i.cameraMode;
  18769. H.debug('ShowPath.getHeroDescriptorByHeroIndex() -> New brush/warp destination: "' + n + '" out of ' + t + " choices.")
  18770. }
  18771. return i
  18772. }
  18773. ,
  18774. t.prototype.getHeroDescriptorByPano = function(e) {
  18775. return this.model.panos.get(e.id) ? this.getHeroDescriptorByPanoId(e.id) : null
  18776. }
  18777. ,
  18778. t.prototype.getHeroDescriptorByPanoId = function(e) {
  18779. var t = this.getHeroIndexFromPanoId(e);
  18780. return this.getHeroDescriptorByHeroIndex(t)
  18781. }
  18782. ,
  18783. t.prototype.getHeroIndexFromPanoId = function(e) {
  18784. for (var t = 0; t < this.model.heroLocations.length; t++) {
  18785. var i = this.model.heroLocations[t]
  18786. , n = this.getHeroId(i);
  18787. if (n && n === e)
  18788. return t
  18789. }
  18790. return -1
  18791. }
  18792. ,
  18793. t.prototype.getHeroPano = function(e) {
  18794. if (null === e)
  18795. return H.warn("getHeroPano(): no destination"),
  18796. null;
  18797. var t = this.getHeroId(e)
  18798. , i = this.model.panos.get(t);
  18799. return void 0 === i && (i = null,
  18800. "" !== t && H.debug('unable to find pano "' + t + '"')),
  18801. i
  18802. }
  18803. ,
  18804. t.prototype.getHeroId = function(e) {
  18805. return e.panoId
  18806. }
  18807. ,
  18808. t.prototype.setWarpDestPano = function() {
  18809. return this.warpDestPano = this.getHeroPano(this.warpDestHeroLoc),
  18810. this.warpDestPano
  18811. }
  18812. ,
  18813. t.prototype.brushToWarpPano = function(e, t) {
  18814. if (this.discardPathObject(),
  18815. !this.setWarpDestPano())
  18816. return !1;
  18817. if (this.warpDestHeroLoc.cameraMode !== O.PANORAMA && H.warn("Can only brush from pano to pano"),
  18818. !this.warpDestPano)
  18819. return H.info("No brush"),
  18820. !1;
  18821. if (!this.player.currentPano)
  18822. return H.debug("No current pano, visibility undefined"),
  18823. !1;
  18824. if (!this.warpDestPano)
  18825. return H.info("No wPano, visibility undefined"),
  18826. !1;
  18827. if (!this.warpDestPano.isAligned())
  18828. return H.debug("Cannot brush to unaligned pano"),
  18829. !1;
  18830. var i = (e === L.STD || e === L.WALK) && D.path.mapGuides
  18831. , n = !0;
  18832. if (this.player.currentPano.id === this.warpDestPano.id)
  18833. H.debug("Already at destination pano");
  18834. else {
  18835. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  18836. n = void 0 === this.nodes || null === this.nodes || this.nodes.length < 1,
  18837. this.obj3d = new P.Object3D,
  18838. H.debug('Brushing from "' + this.player.currentPano.id + '" to "' + this.warpDestPano.id + '" (' + (this.nodes ? this.nodes.length : 0) + ")"),
  18839. n ? (H.info('No "walkable" route, using fall-back warp style transition'),
  18840. e = t) : (this.setPathHulls(this.nodes),
  18841. this.setFloorCurves(),
  18842. 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)))),
  18843. this.player.currentPano.floor.add(this.obj3d);
  18844. var r = this.player.mode === O.DOLLHOUSE || this.player.mode === O.FLOORPLAN
  18845. , o = e === L.STD;
  18846. if (!n && (i || o)) {
  18847. if (r) {
  18848. var a = this.makeStartMarker(this.floorHull[0], this.floorCurvePoints);
  18849. this.obj3d.add(a)
  18850. }
  18851. var s = this.makeEndMarker(this.floorHull[this.floorHull.length - 1]);
  18852. this.obj3d.add(s)
  18853. }
  18854. this.appearSlow()
  18855. }
  18856. return this.upcomingTransType = e,
  18857. !n
  18858. }
  18859. ,
  18860. t.prototype.findShortestPath = function(e, t) {
  18861. if (!e || !t)
  18862. return null;
  18863. var i = D.warp.walkExtraPanosDistance
  18864. , n = e.id + ":" + t.id + ":" + i;
  18865. if (this.shortPaths.hasOwnProperty(n))
  18866. return this.shortPaths[n] ? this.shortPaths[n].slice() : null;
  18867. var r = t.id + ":" + e.id + ":" + i;
  18868. if (this.shortPaths.hasOwnProperty(r))
  18869. return this.shortPaths[r] ? this.shortPaths[r].slice().reverse() : null;
  18870. var o = this.model.panos.aStarSearch(e, t);
  18871. return this.model.panos.includeNodesNearPath(o, i),
  18872. this.shortPaths[n] = o ? o.slice() : null,
  18873. o
  18874. }
  18875. ,
  18876. t.prototype.makePathHulls = function(e) {
  18877. var t, i, n, r, o, a = 0, s = [], l = [], c = [], h = this.model.panos;
  18878. r = (t = h.get(e[0])).floor.floorIndex;
  18879. for (var u = 0; u < e.length; u += 1)
  18880. (i = (t = h.get(e[u])).floorPosition.clone().sub(this.model.position)).y += this.pathHeight(),
  18881. s.push(i),
  18882. l.push(t.position.clone()),
  18883. n = t.floor.floorIndex,
  18884. c.push(r < n ? D.path.colorUp : n < r ? D.path.colorDown : D.path.color),
  18885. 0 < u && (a < (o = l[u].distanceTo(l[u - 1])) && (a = o));
  18886. return a > this.longestStep && (this.longestStep = a,
  18887. H.debug("path contains " + a + " meter segment")),
  18888. {
  18889. floor: s,
  18890. camera: l,
  18891. color: c
  18892. }
  18893. }
  18894. ,
  18895. t.prototype.makeFloorCurves = function(e, t, i) {
  18896. var n = this.player.mode === O.PANORAMA ? D.path.waypointIndoorRadius : D.path.waypointRadius
  18897. , r = this.pointPathDistance(e) - 2 * n
  18898. , o = e.slice(0)
  18899. , a = o[1].clone().sub(o[0]);
  18900. a.y = 0,
  18901. a.normalize().multiplyScalar(n),
  18902. o[0] = (new P.Vector3).copy(o[0]).add(a),
  18903. (a = o[o.length - 2].clone().sub(o[o.length - 1])).y = 0,
  18904. a.normalize().multiplyScalar(n),
  18905. o[o.length - 1] = (new P.Vector3).copy(o[o.length - 1]).add(a);
  18906. var s = new P.CatmullRomCurve3(o)
  18907. , l = Math.floor(r / i);
  18908. l = 4 * Math.floor(l / 4),
  18909. l = Math.max(4, l);
  18910. for (var c, h, u = s.getSpacedPoints(l), d = [], p = new P.Vector3, f = 0; f < u.length; f += 1) {
  18911. h = 0,
  18912. c = u[f].distanceTo(e[0]);
  18913. for (var g = 1; g < e.length; g += 1)
  18914. p.copy(u[f]).sub(e[g]),
  18915. p.y *= 4,
  18916. p.length() < c && (h = g);
  18917. d.push(t[h])
  18918. }
  18919. return {
  18920. distance: r,
  18921. points: u,
  18922. colors: d
  18923. }
  18924. }
  18925. ,
  18926. t.prototype.makeCameraCurvePoints = function(e, t) {
  18927. var i = this.pointPathDistance(e);
  18928. return new P.CatmullRomCurve3(e).getSpacedPoints(Math.max(2, Math.floor(i / t)))
  18929. }
  18930. ,
  18931. t.prototype.makeCameraCurveTangents = function(e, t) {
  18932. var i = this.pointPathDistance(e)
  18933. , n = new P.CatmullRomCurve3(e)
  18934. , r = Math.max(2, Math.floor(i / t));
  18935. r = r || 5;
  18936. for (var o = [], a = 0; a <= r; a++)
  18937. o.push(n.getTangentAt(a / r));
  18938. return o
  18939. }
  18940. ,
  18941. t.prototype.setPathHulls = function(e) {
  18942. var t = this.makePathHulls(e);
  18943. this.floorHull = t.floor,
  18944. this.cameraHull = t.camera,
  18945. this.colorHull = t.color
  18946. }
  18947. ,
  18948. t.prototype.setFloorCurves = function() {
  18949. var e = this.makeFloorCurves(this.floorHull, this.colorHull, this.brushPrefs.paveStep);
  18950. this.floorPathDistance = e.distance,
  18951. this.floorCurvePoints = e.points,
  18952. this.floorCurveColors = e.colors
  18953. }
  18954. ,
  18955. t.prototype.setCameraCurvePoints = function() {
  18956. this.camCurvePoints = this.makeCameraCurvePoints(this.cameraHull, D.warp.stepFactor * this.brushPrefs.paveStep)
  18957. }
  18958. ,
  18959. t.prototype.chooseWarpPath = function(e) {
  18960. var t, i, n, r = this.playerControls.cameras[O.PANORAMA];
  18961. if (this.player.currentPano === this.warpDestPano || !e)
  18962. return this.warpPathPoints = null,
  18963. this.warpLength = 0,
  18964. !1;
  18965. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  18966. void 0 === this.nodes || null === this.nodes || this.nodes.length < 1 ? (H.debug("warp path to unreachable node"),
  18967. i = (t = this.warpDestPano.position.clone().sub(r.position)).clone().negate(),
  18968. t.multiplyScalar(.15).add(r.position),
  18969. i.multiplyScalar(.15).add(this.warpDestPano.position),
  18970. t.y = r.position.y,
  18971. i.y = this.warpDestPano.position.y,
  18972. n = new P.CubicBezierCurve3(r.position.clone(),t,i,this.warpDestPano.position.clone()),
  18973. this.warpPathPoints = n.getSpacedPoints(this.brushPrefs.cvSegments)) : (H.debug("follow warp path (path distance was " + this.nodes.length + " nodes, " + this.floorPathDistance + ")"),
  18974. this.setCameraCurvePoints(),
  18975. this.warpPathPoints = this.camCurvePoints.slice(0)),
  18976. this.warpLength = 0,
  18977. this.warpPathLengths = [0];
  18978. 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) {
  18979. o.copy(this.warpPathPoints[c - 1]).sub(this.warpPathPoints[c]);
  18980. var h = o.length();
  18981. o.y *= D.warp.climbEffort;
  18982. var u = o.length() / h;
  18983. if (1 < c) {
  18984. o.setY(0).normalize(),
  18985. a.copy(this.warpPathPoints[c - 2]).sub(this.warpPathPoints[c - 1]).setY(0).normalize();
  18986. var d = Math.min(1, o.dot(a))
  18987. , p = 1 + (D.warp.brakeStrength - 1) * (1 - P.Math.smoothstep(d, l, s));
  18988. u = Math.max(p, u)
  18989. }
  18990. this.warpLength += h * u,
  18991. this.warpPathLengths[c] = this.warpLength
  18992. }
  18993. return !0
  18994. }
  18995. ,
  18996. t.prototype.drawPathRibbon = function(e, t) {
  18997. this.bunnyObj.visible = D.warp.showBunny;
  18998. 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) {
  18999. a.copy(e[s]),
  19000. 0 === s ? a.sub(e[s + 1]) : a.sub(e[s - 1]).negate(),
  19001. a.normalize(),
  19002. n.crossVectors(a, U.UP),
  19003. n.multiplyScalar(i);
  19004. var l = (new P.Vector3).copy(e[s]).add(r);
  19005. l.sub(n),
  19006. o.vertices.push(l),
  19007. (l = (new P.Vector3).copy(e[s]).add(r)).add(n),
  19008. o.vertices.push(l)
  19009. }
  19010. var c, h, u, d = 0;
  19011. for (s = 0; s < e.length - 1; s += 1) {
  19012. var p = 2 * s
  19013. , f = d
  19014. , g = d += e[s + 1].distanceTo(e[s])
  19015. , m = t[s]
  19016. , v = t[s + 1];
  19017. (c = new P.Face3(p,1 + p,2 + p)).vertexColors = [new P.Color(m), new P.Color(m), new P.Color(v)],
  19018. o.faces.push(c),
  19019. o.faceVertexUvs[0].push([new P.Vector2(0,f), new P.Vector2(1,f), new P.Vector2(0,g)]),
  19020. (c = new P.Face3(2 + p,1 + p,3 + p)).vertexColors = [new P.Color(v), new P.Color(m), new P.Color(v)],
  19021. o.faces.push(c),
  19022. o.faceVertexUvs[0].push([new P.Vector2(0,g), new P.Vector2(1,f), new P.Vector2(1,g)])
  19023. }
  19024. o.computeFaceNormals(),
  19025. o.computeVertexNormals(),
  19026. h = this.player.mode === O.PANORAMA ? ((u = P.UniformsUtils.clone(C.ribbon.uniforms)).map.value = I.path,
  19027. u.opacity.value = 0,
  19028. u.color.value.set(D.path.color),
  19029. new P.RawShaderMaterial({
  19030. side: P.DoubleSide,
  19031. depthWrite: !1,
  19032. transparent: !0,
  19033. vertexShader: C.ribbon.vertexShader,
  19034. fragmentShader: C.ribbon.fragmentShader,
  19035. uniforms: u,
  19036. name: "ribbonT",
  19037. opacity: 0
  19038. })) : new P.MeshBasicMaterial({
  19039. color: 16777215,
  19040. side: P.DoubleSide,
  19041. name: "ribbonOut",
  19042. vertexColors: P.VertexColors
  19043. });
  19044. var y = new P.Mesh(o,h);
  19045. return y.name = "ribbon",
  19046. this.player.mode === O.PANORAMA && (y.renderOrder = A.ribbon),
  19047. y
  19048. }
  19049. ,
  19050. t.prototype.drawPathPavement = function(e) {
  19051. for (var t, i = new P.Vector3, n = new P.Geometry, r = new P.Vector3, o = 0; o < e.length; o += 1)
  19052. r.copy(e[o]),
  19053. 0 === o ? r.sub(e[o + 1]).negate() : r.sub(e[o - 1]),
  19054. r.normalize(),
  19055. i.crossVectors(r, U.UP),
  19056. i.multiplyScalar(this.brushPrefs.paveWidth),
  19057. (t = (new P.Vector3).copy(e[o])).sub(i),
  19058. n.vertices.push(t),
  19059. n.vertices.push((new P.Vector3).copy(e[o])),
  19060. (t = (new P.Vector3).copy(e[o])).add(i),
  19061. n.vertices.push(t);
  19062. var a, s, l;
  19063. for (o = 0; o < e.length - 1; o += 1)
  19064. a = 3 * o + 1,
  19065. l = .25 + (s = .25 * o),
  19066. n.faces.push(new P.Face3(a - 1,a,3 + a)),
  19067. n.faceVertexUvs[0].push([new P.Vector2(0,s), new P.Vector2(.5,s), new P.Vector2(.5,l)]),
  19068. n.faces.push(new P.Face3(3 + a,2 + a,a - 1)),
  19069. n.faceVertexUvs[0].push([new P.Vector2(.5,l), new P.Vector2(0,l), new P.Vector2(0,s)]),
  19070. n.faces.push(new P.Face3(3 + a,a,1 + a)),
  19071. n.faceVertexUvs[0].push([new P.Vector2(.5,l), new P.Vector2(.5,s), new P.Vector2(1,s)]),
  19072. n.faces.push(new P.Face3(3 + a,1 + a,4 + a)),
  19073. n.faceVertexUvs[0].push([new P.Vector2(.5,l), new P.Vector2(1,s), new P.Vector2(1,l)]);
  19074. var c = this.player.mode === O.PANORAMA ? new P.MeshBasicMaterial({
  19075. color: D.path.color,
  19076. side: P.DoubleSide,
  19077. transparent: !0,
  19078. depthWrite: !1,
  19079. opacity: 0,
  19080. name: "paveT",
  19081. map: I.path
  19082. }) : new P.MeshBasicMaterial({
  19083. color: D.path.color,
  19084. side: P.DoubleSide,
  19085. transparent: !0,
  19086. depthWrite: !1,
  19087. opacity: 1,
  19088. name: "paveO",
  19089. map: I.path
  19090. });
  19091. return new P.Mesh(n,c)
  19092. }
  19093. ,
  19094. t.prototype.hintPrefs = {
  19095. rad: .18,
  19096. width: .0125,
  19097. depth: .0625,
  19098. setBack: -.04,
  19099. markRad: .25,
  19100. markInnerRad: .16
  19101. },
  19102. t.prototype.makeWaypointObj = function(e, t) {
  19103. var i = new P.Geometry
  19104. , n = this.player.mode === O.PANORAMA ? D.path.waypointIndoorRadius : D.path.waypointRadius
  19105. , r = this.pathHeight();
  19106. 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)),
  19107. i.faces.push(new P.Face3(0,1,2), new P.Face3(2,3,0)),
  19108. i.faceVertexUvs[0].push([new P.Vector2(0,0), new P.Vector2(1,0), new P.Vector2(1,1)]),
  19109. i.faceVertexUvs[0].push([new P.Vector2(1,1), new P.Vector2(0,1), new P.Vector2(0,0)]);
  19110. var o = P.UniformsUtils.clone(C.waypoint.uniforms);
  19111. o.map.value = e,
  19112. o.opacity.value = 0,
  19113. o.color.value.set(D.path.color);
  19114. var a = {
  19115. side: P.DoubleSide,
  19116. depthWrite: !1,
  19117. transparent: !0,
  19118. vertexShader: C.waypoint.vertexShader,
  19119. fragmentShader: C.waypoint.fragmentShader,
  19120. uniforms: o,
  19121. name: "waypoint",
  19122. opacity: 0
  19123. };
  19124. this.player.mode !== O.PANORAMA && (a.depthTest = !1,
  19125. a.name = "wayPtOut");
  19126. var s = new P.RawShaderMaterial(a)
  19127. , l = new P.Mesh(i,s);
  19128. return l.name = t,
  19129. l
  19130. }
  19131. ,
  19132. t.prototype.makeStartMarker = function(e, t) {
  19133. var i = (new P.Vector3).copy(t[1]).sub(t[0]);
  19134. i.y = 0,
  19135. i.normalize();
  19136. var n = Math.acos(i.x)
  19137. , r = this.makeWaypointObj(I.pathStart, "Start");
  19138. return r.rotateOnAxis(new P.Vector3(0,1,0), n),
  19139. r.position.copy(e),
  19140. r
  19141. }
  19142. ,
  19143. t.prototype.makeEndMarker = function(e) {
  19144. var t = this.makeWaypointObj(I.pathEnd, "End")
  19145. , i = this.model.panos.get(this.nodes[0]).floor.floorIndex
  19146. , n = this.model.panos.get(this.nodes[this.nodes.length - 1]).floor.floorIndex;
  19147. return i < n ? t.material.uniforms.color.value.set(D.path.colorUp) : n < i && t.material.uniforms.color.value.set(D.path.colorDown),
  19148. t.position.copy(e),
  19149. t
  19150. }
  19151. ,
  19152. t.prototype.pathClean = function(e) {
  19153. if (e) {
  19154. for (var t in e.children)
  19155. this.pathClean(e.children[t]);
  19156. e.geometry && e.geometry.dispose(),
  19157. e.material && e.material.dispose()
  19158. }
  19159. }
  19160. ,
  19161. t.prototype.discardPathObject = function() {
  19162. if (this.obj3d) {
  19163. var e = this.obj3d.parent;
  19164. e && e.remove(this.obj3d),
  19165. this.pathClean(this.obj3d)
  19166. }
  19167. this.obj3d = null,
  19168. this.popInCpm()
  19169. }
  19170. ,
  19171. t.prototype.discardSlow = function() {
  19172. if (this.obj3d) {
  19173. if (this.player.mode !== O.PANORAMA)
  19174. return void this.discardPathObject();
  19175. for (var e, t = 0, i = function() {
  19176. this.discardPathObject()
  19177. }
  19178. .bind(this), n = 0; n < this.obj3d.children.length; n += 1)
  19179. 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]),
  19180. t += 1,
  19181. i = null);
  19182. 0 === t && this.discardPathObject(),
  19183. this.player.mode !== O.PANORAMA && this.fadeInCpm(D.path.fadeInTime - 3)
  19184. }
  19185. }
  19186. ,
  19187. t.prototype.appearSlow = function() {
  19188. var e;
  19189. this.fadeOutCpm(D.path.fadeInTime);
  19190. for (var t = this.player.mode === O.PANORAMA ? D.path.opacity : 1, i = 0; i < this.obj3d.children.length; i += 1)
  19191. 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]))
  19192. }
  19193. ,
  19194. t.prototype.update = function() {
  19195. this.obj3d && this.obj3d.updateMatrixWorld()
  19196. }
  19197. ,
  19198. t.prototype.calcBurnsAmount = function(e) {
  19199. var n = P.Math.degToRad(D.warp.burnsAngle);
  19200. if (this.player.mode !== O.PANORAMA)
  19201. return this.player.mode === O.DOLLHOUSE ? .02 * this.burnsDir : this.burnsDir;
  19202. var t = this.burnsDir * n;
  19203. if (this.upcomingTransType === L.BLACK)
  19204. return t;
  19205. var i = e;
  19206. if (null === i)
  19207. return H.warn("Transition request for non-highlight"),
  19208. t;
  19209. var r = this.getHeroDescriptorByHeroIndex(i);
  19210. if (null === r)
  19211. return t;
  19212. if (!r.isPano())
  19213. return t;
  19214. function o(e) {
  19215. var t = Math.acos(Math.min(1, e.dot(l)))
  19216. , i = (new P.Vector3).crossVectors(l, e);
  19217. return Math.max(c, Math.min(Math.abs(t), n)) * Math.sign(i.y)
  19218. }
  19219. var a = this.getHeroPano(r)
  19220. , s = this.playerControls.cameras[O.PANORAMA]
  19221. , l = U.FORWARD.clone().applyQuaternion(s.quaternion).setY(0).normalize()
  19222. , c = Math.min(P.Math.degToRad(D.warp.minBurnsAngle), n);
  19223. if (a === this.player.currentPano)
  19224. return o(U.FORWARD.clone().applyQuaternion(r.quaternion).setY(0).normalize());
  19225. var h = this.findShortestPath(this.player.currentPano, a);
  19226. if (null == h || h.length < 1)
  19227. return H.debug("Empty path ahead..."),
  19228. t;
  19229. var u = this.makePathHulls(h)
  19230. , d = new P.CatmullRomCurve3(u.camera)
  19231. , p = Math.min(.1, D.warp.lookAheadDist / d.getLength());
  19232. return o(d.getPointAt(p).clone().sub(s.position).setY(0).normalize())
  19233. }
  19234. ,
  19235. t.prototype.waitNextStep = function(e, t, i) {
  19236. var o = null == i ? D.warp.tourStepDelay : i;
  19237. o = o || (this.lastTransType === L.BLACK ? m.tourStepDelaySlideShow : m.tourStepDelayDefault);
  19238. var a = new P.Euler
  19239. , s = new P.Vector3;
  19240. H.debug("Starting wait: " + (void 0 !== t));
  19241. var l = this.calcBurnsAmount(e)
  19242. , c = function() {
  19243. this.endWarpState(),
  19244. this.player.mode === O.DOLLHOUSE && (this.playerControls.cameras[O.DOLLHOUSE].controls.rotationAcceleration.x = 0),
  19245. t && t()
  19246. }
  19247. .bind(this)
  19248. , n = function(e, t) {
  19249. if (this.warpInterrupted)
  19250. return c(),
  19251. !0;
  19252. var i = t || 1e3 / 60;
  19253. if (D.warp.doBurns)
  19254. if (this.player.mode === O.PANORAMA) {
  19255. var n = this.playerControls.cameras[O.PANORAMA];
  19256. a.setFromQuaternion(n.quaternion, D.warp.eOrder);
  19257. var r = i * l / o;
  19258. a.y += r,
  19259. s.set(0, 0, -1),
  19260. s.applyEuler(a),
  19261. s.add(n.position),
  19262. n.controls.lookAt(s),
  19263. n.controls.lookVector.copy(s),
  19264. n.lookAt(s)
  19265. } else
  19266. this.player.mode === O.DOLLHOUSE ? this.playerControls.controls[O.DOLLHOUSE].rotationAcceleration.x = l : this.playerControls.controls[O.FLOORPLAN].absoluteScale *= .9996
  19267. }
  19268. .bind(this);
  19269. this.startWarpState(),
  19270. V.start(n, o, c, 0, B.easeInOutQuad, "wait");
  19271. /* var r = player.model.heroLocations[app.director.currentItem];
  19272. this.player.zoomEnabled = !0;
  19273. var h = function(e, t) {
  19274. //console.log(e),
  19275. this.player.zoomTo(e * r.zoom.toFixed(2), !0)
  19276. }
  19277. .bind(this);
  19278. V.start(h, 2e3, null, 0, B.easeOutQuad, "zoom") */
  19279. }
  19280. ,
  19281. t.prototype.warpToNonPano = function(e) {
  19282. if (this.discardPathObject(),
  19283. this.warpDestHeroLoc.cameraMode === O.DOLLHOUSE || this.warpDestHeroLoc.cameraMode === O.FLOORPLAN) {
  19284. var t = function() {
  19285. e && e()
  19286. }
  19287. .bind(this);
  19288. this.player.flyToNewMode({
  19289. mode: this.warpDestHeroLoc.cameraMode,
  19290. duration: D.warp.outsideTime,
  19291. warpDest: this.warpDestHeroLoc,
  19292. callback: t,
  19293. force: !0
  19294. })
  19295. } else
  19296. H.warn("no warp destination!!!"),
  19297. e && e()
  19298. }
  19299. ,
  19300. t.prototype._resetWarpShaderParams = function(e) {
  19301. this.player.mode === O.PANORAMA && (void 0 !== e.material.uniforms.blackout && (e.material.uniforms.blackout.value = 0),
  19302. void 0 !== e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = 0))
  19303. }
  19304. ,
  19305. t.prototype._clearWarpShading = function() {
  19306. for (var e = this.model.chunks, t = 0; t < e.length; t += 1)
  19307. this._resetWarpShaderParams(e[t]),
  19308. e[t].visible = !0;
  19309. this._resetWarpShaderParams(this.model.skybox)
  19310. }
  19311. ,
  19312. t.prototype._warpStopFlying = function() {
  19313. this.activeTransType = null,
  19314. this.placeCpm()
  19315. }
  19316. ,
  19317. t.prototype._wrapupTravelOnlyBits = function() {
  19318. this._warpStopFlying(),
  19319. this.warpPathPoints && (this.player.currentPano.exit(),
  19320. this.warpDestPano.enter(),
  19321. this.player.currentPano = this.warpDestPano),
  19322. this.player.spider.draw(),
  19323. this.placeCpm()
  19324. }
  19325. ,
  19326. t.prototype._wrapupTravel = function(e) {
  19327. this._wrapupTravelOnlyBits(),
  19328. this.warpCameraAim(e)
  19329. }
  19330. ,
  19331. t.prototype._wrapupWarpShading = function(e) {
  19332. this._clearWarpShading(),
  19333. this._wrapupTravel(e)
  19334. }
  19335. ,
  19336. t.prototype.wrapupWarpShadingOnly = function(e, t) {
  19337. t !== z.END && this._clearWarpShading(),
  19338. this._wrapupTravelOnlyBits(),
  19339. this.upcomingTransType = null,
  19340. e && e()
  19341. }
  19342. ,
  19343. t.prototype._warpCameraAim = function(e, t) {
  19344. var i = this.warpDestHeroLoc.quaternion
  19345. , n = this.playerControls.cameras[O.PANORAMA]
  19346. , r = new P.Vector3(0,0,1).applyQuaternion(i).normalize()
  19347. , o = new P.Vector3(0,0,1).applyQuaternion(n.quaternion).normalize().dot(r)
  19348. , a = P.Math.radToDeg(Math.acos(o))
  19349. , s = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(i, D.warp.eOrder)
  19350. , l = (new P.Euler).setFromQuaternion(n.quaternion, D.warp.eOrder)
  19351. , c = new P.Euler(s.x - l.x,s.y - l.y,s.z - l.z,D.warp.eOrder);
  19352. c.y = N.constrainedTurn(c.y),
  19353. this.burnsDir = Math.sign(c.y);
  19354. var h = new P.Euler(0,0,0,D.warp.eOrder)
  19355. , u = new P.Vector3
  19356. , d = function(e, t) {
  19357. return !!this.warpInterrupted || (h.x = l.x + e * c.x,
  19358. h.y = l.y + e * c.y,
  19359. h.z = l.z + e * c.z,
  19360. u.set(0, 0, -1),
  19361. u.applyEuler(h),
  19362. u.add(n.position),
  19363. n.controls.lookAt(u),
  19364. n.controls.lookVector.copy(u),
  19365. void n.lookAt(u))
  19366. }
  19367. .bind(this);
  19368. 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"),
  19369. void (t && t()))
  19370. }
  19371. ,
  19372. t.prototype._warpBendAim = function(e, t, i, n) {
  19373. var r = n || 0
  19374. , o = this.playerControls.cameras[O.PANORAMA]
  19375. , a = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19376. , s = (new P.Euler).setFromQuaternion(o.quaternion, D.warp.eOrder)
  19377. , l = new P.Euler(a.x - s.x,a.y - s.y,a.z - s.z,D.warp.eOrder);
  19378. l.y = N.constrainedTurn(l.y);
  19379. var c = Math.min(P.Math.degToRad(D.warp.softBendTilt), Math.abs(l.x));
  19380. l.x = c * Math.sign(l.x),
  19381. c = Math.min(P.Math.degToRad(Math.max(0, D.warp.softBendAngle)), c),
  19382. this.burnsDir = Math.sign(l.y),
  19383. c *= Math.sign(l.y),
  19384. l.y = c;
  19385. var h = new P.Euler(0,0,0,D.warp.eOrder)
  19386. , u = new P.Vector3
  19387. , d = function(e, t) {
  19388. if (e < .5)
  19389. h.x = s.x + e * l.x,
  19390. h.y = s.y + e * l.y,
  19391. h.z = s.z + e * l.z;
  19392. else {
  19393. var i = (1 - e) * D.warp.softBendEnd;
  19394. h.x = a.x - i * l.x,
  19395. h.y = a.y - i * l.y,
  19396. h.z = a.z - i * l.z
  19397. }
  19398. u.set(0, 0, -1),
  19399. u.applyEuler(h),
  19400. u.add(o.position),
  19401. o.controls.lookAt(u),
  19402. o.controls.lookVector.copy(u),
  19403. o.lookAt(u)
  19404. }
  19405. .bind(this);
  19406. return V.start(d, t, i, r, B[D.warp.movementEasing])
  19407. }
  19408. ,
  19409. t.prototype._warpStepCameraAim = function(e, t, i) {
  19410. var n = this.playerControls.cameras[O.PANORAMA]
  19411. , r = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19412. , o = (new P.Euler).setFromQuaternion(n.quaternion, D.warp.eOrder)
  19413. , a = new P.Euler(r.x - o.x,r.y - o.y,r.z - o.z,D.warp.eOrder);
  19414. a.y = N.constrainedTurn(a.y),
  19415. this.burnsDir = Math.sign(a.y);
  19416. var s = new P.Euler(0,0,0,D.warp.eOrder)
  19417. , l = new P.Vector3
  19418. , c = function(e, t) {
  19419. e < .5 ? s.copy(o) : s.copy(r),
  19420. l.set(0, 0, -1),
  19421. l.applyEuler(s),
  19422. l.add(n.position),
  19423. n.controls.lookAt(l),
  19424. n.controls.lookVector.copy(l),
  19425. n.lookAt(l)
  19426. }
  19427. .bind(this);
  19428. return V.start(c, t, i, 0, B[D.warp.movementEasing])
  19429. }
  19430. ,
  19431. t.prototype.setBurnsDir = function() {
  19432. var e = this.playerControls.cameras[O.PANORAMA]
  19433. , t = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19434. , i = (new P.Euler).setFromQuaternion(e.quaternion, D.warp.eOrder)
  19435. , n = new P.Euler(t.x - i.x,t.y - i.y,t.z - i.z,D.warp.eOrder);
  19436. n.y = N.constrainedTurn(n.y),
  19437. this.burnsDir = Math.sign(n.y)
  19438. }
  19439. ,
  19440. t.prototype.stepWarpPath = function(e, t) {
  19441. var i = this.playerControls.cameras[O.PANORAMA];
  19442. if (!this.warpPathPoints)
  19443. return i.position.copy(this.warpDestPano.position),
  19444. !0;
  19445. var n = this.warpPathPoints[0]
  19446. , r = this.warpDestPano.position;
  19447. if (null !== this.nodes && 1 < this.cameraHull.length) {
  19448. var o = new P.Vector3;
  19449. 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),
  19450. i.position.copy(o)
  19451. } else
  19452. e < .5 ? i.position.copy(n) : i.position.copy(r)
  19453. }
  19454. ,
  19455. t.prototype.interruptAndFastForward = function(e, t) {
  19456. this.warping && (this.warpInterrupted = !0,
  19457. this.warpInterruptionBlackoutStyle = e,
  19458. this.warpInterruptionTravelTime = t,
  19459. null !== this.warpInterruptionBlackoutStyle && void 0 !== this.warpInterruptionBlackoutStyle || (this.warpInterruptionBlackoutStyle = z.MIDDLE),
  19460. null !== this.warpInterruptionTravelTime && void 0 !== this.warpInterruptionTravelTime || (this.warpInterruptionTravelTime = D.minWarpTime))
  19461. }
  19462. ,
  19463. t.prototype.warpCameraAim = function(e) {
  19464. var t = D.warp.minWarpTime;
  19465. if (this.upcomingTransType === L.BLACK)
  19466. t = D.warp.teleportTime;
  19467. else {
  19468. var i = this.playerControls.cameras[O.PANORAMA]
  19469. , n = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19470. , r = (new P.Euler).setFromQuaternion(i.quaternion, D.warp.eOrder)
  19471. , o = new P.Euler(n.x - r.x,n.y - r.y,n.z - r.z,D.warp.eOrder);
  19472. o.y = N.constrainedTurn(o.y);
  19473. var a = 1e3 * Math.abs(o.y) / P.Math.degToRad(D.warp.maxAimPerSec);
  19474. t = Math.max(t, a)
  19475. }
  19476. var s = function() {
  19477. this._warpStopFlying(),
  19478. this.discardSlow(),
  19479. e && e()
  19480. }
  19481. .bind(this);
  19482. this._warpCameraAim(t, s)
  19483. }
  19484. ,
  19485. t.prototype.warpCommonParameters = function(e, t, i, n) {
  19486. this.model.skybox.material.uniforms.blackout.value = n;
  19487. var r = F.uniform(this.model.skybox, "progress", 1)
  19488. , o = F.allUniforms(this.model.chunks, "progress", 1)
  19489. , a = !1
  19490. , s = function() {
  19491. if (this.warpInterrupted)
  19492. return a = !0
  19493. }
  19494. .bind(this)
  19495. , l = function(e, t) {
  19496. return i && a ? !(this.model.skybox.material.uniforms.progress.value = 0) : void r(e, t)
  19497. }
  19498. .bind(this)
  19499. , c = function(e, t) {
  19500. return i && a ? (o(0),
  19501. !0) : void o(e, t)
  19502. }
  19503. .bind(this);
  19504. V.start(s, e, null, t, null, "safeHaltWatch"),
  19505. V.start(l, e, null, t, B[D.warp.blendEasing], "skyboxProgress"),
  19506. V.start(c, e, null, t, B[D.warp.blendEasing], "chunkProgress")
  19507. }
  19508. ,
  19509. t.prototype.warpTravel_STD = function(e) {
  19510. 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),
  19511. 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;
  19512. t += this.warpLength * D.warp.timePerMeter,
  19513. .01 < D.warp.flySpeed && (t = 1e3 * this.warpLength / D.warp.flySpeed);
  19514. function n(e) {
  19515. var t = i;
  19516. return P.Math.smoothstep(e, 0, t) * (1 - P.Math.smoothstep(e, 1 - t, 1))
  19517. }
  19518. var y = !1
  19519. , r = this.warpDestHeroLoc.quaternion
  19520. , o = new P.Vector3(0,0,-1).applyQuaternion(r).normalize()
  19521. , A = this.warpPathPoints[this.warpPathPoints.length - 1].clone().sub(this.warpPathPoints[this.warpPathPoints.length - 2]).normalize()
  19522. , a = A.dot(o)
  19523. , C = P.Math.radToDeg(Math.acos(a))
  19524. , s = function() {
  19525. return m.lookAt(g, l, U.UP),
  19526. u.setFromRotationMatrix(m, D.warp.eOrder),
  19527. p.setFromQuaternion(h.quaternion, D.warp.eOrder),
  19528. v.set(u.x - p.x, u.y - p.y, u.z - p.z, D.warp.eOrder),
  19529. N.constrainedTurn(v.y)
  19530. }
  19531. .bind(this)
  19532. , I = function(e, t) {
  19533. if (this.warpInterrupted)
  19534. return y = !0
  19535. }
  19536. .bind(this)
  19537. , E = function(e, t) {
  19538. return y || !this.warpPathPoints ? (k.blur(0),
  19539. !0) : void k.blur(e)
  19540. }
  19541. .bind(this)
  19542. , _ = F.allUniforms(this.model.chunks, "modelAlpha", 1)
  19543. , b = function(e, t) {
  19544. return y || !this.warpPathPoints ? (_(0),
  19545. !0) : void _(e, t)
  19546. }
  19547. .bind(this)
  19548. , w = function(e, t) {
  19549. if (!this.warpPathPoints)
  19550. return h.position.copy(this.warpDestPano.position),
  19551. !0;
  19552. if (y)
  19553. return !0;
  19554. var i = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, e);
  19555. h.position.copy(i),
  19556. g = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, .99 * e)
  19557. }
  19558. .bind(this)
  19559. , T = function(e, t) {
  19560. return this.warpPathPoints ? !!y || void (l = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, Math.min(e + c, 1))) : (H.debug("Lost bunny."),
  19561. !0)
  19562. }
  19563. .bind(this)
  19564. , x = function(e, t) {
  19565. if (y)
  19566. return H.debug(">>>> Walkthrough interupted at t=" + e),
  19567. !0;
  19568. if (!this.warpPathPoints)
  19569. return !0;
  19570. var i = this.warpLength * e
  19571. , n = P.Math.smoothstep(i, 0, this.brushPrefs.lookBlendDist)
  19572. , r = P.Math.smoothstep(i, this.warpLength - this.brushPrefs.lookBlendDist, this.warpLength);
  19573. D.warp.matchCam && (n *= 1 - r),
  19574. m.lookAt(g, l, U.UP),
  19575. u.setFromRotationMatrix(m, D.warp.eOrder),
  19576. p.setFromQuaternion(h.quaternion, D.warp.eOrder),
  19577. v.set(u.x - p.x, u.y - p.y, u.z - p.z, D.warp.eOrder),
  19578. v.y = N.constrainedTurn(v.y),
  19579. u.x = p.x + n * v.x,
  19580. u.y = p.y + n * v.y,
  19581. u.z = p.z + n * v.z,
  19582. v.set(u.x - f.x, u.y - f.y, u.z - f.z, D.warp.eOrder),
  19583. v.y = N.constrainedTurn(v.y);
  19584. var o = P.Math.degToRad(D.warp.maxTurnPerSec) * t / 1e3;
  19585. v.y = Math.sign(v.y) * Math.min(o, Math.abs(v.y)),
  19586. f.x = f.x + v.x * D.warp.turnFriction,
  19587. f.y = f.y + v.y * D.warp.turnFriction,
  19588. f.z = f.z + v.z * D.warp.turnFriction,
  19589. f.x = Math.max(P.Math.degToRad(D.warp.minDownAngle), f.x);
  19590. var a = l.clone().sub(g).normalize();
  19591. if (C < D.warp.maxAimRotation && 0 < r) {
  19592. var s = 1 - r;
  19593. a.x = a.x * s + r * A.x,
  19594. a.y = a.y * s + r * A.y,
  19595. a.z = a.z * s + r * A.z,
  19596. a.normalize()
  19597. }
  19598. this.bunnyObj.position.copy(h.position).add(a),
  19599. d.set(0, 0, -1).applyEuler(f).normalize(),
  19600. d.multiplyScalar(8),
  19601. d.add(h.position),
  19602. 1 - c < e && D.warp.matchCam || (h.controls.lookAt(d),
  19603. h.controls.lookVector.copy(d),
  19604. h.lookAt(d))
  19605. }
  19606. .bind(this)
  19607. , S = function() {
  19608. y ? (this.discardSlow(),
  19609. this.upcomingTransType = L.BLACK,
  19610. this.warpTravel_BLACK(-.5, this.warpInterruptionTravelTime, z.BEGINNING, e)) : this._wrapupWarpShading(e)
  19611. }
  19612. .bind(this);
  19613. T(0);
  19614. var M = D.warp.motionLeadTime + 1e3 * Math.abs(s()) / P.Math.degToRad(D.warp.maxTurnPerSec)
  19615. , R = M / (t += M);
  19616. this.warpCommonParameters(t, R, !0, z.NONE),
  19617. V.start(I, t, null, 0, null, "_haltWatcher"),
  19618. 0 < D.warp.blur && (k.blurStrength = D.warp.blur,
  19619. V.start(E, t, null, R, n, "blurring")),
  19620. V.start(b, t, null, R, n, "modelAlpha"),
  19621. V.start(w, t, null, R, B[D.warp.blendEasing], "followPath"),
  19622. V.start(T, t, null, R, B[D.warp.blendEasing], "goBunny"),
  19623. V.start(x, t, S, 0, B[D.warp.blendEasing], "lookAtBunny")
  19624. }
  19625. ,
  19626. t.prototype.warpTravel_BLACK = function(e, t, i, n) {
  19627. var r = e || 0;
  19628. null != t || (t = D.warp.teleportTime),
  19629. this.warpCommonParameters(t, r, !1, i),
  19630. this.model.chunks.forEach(function(e) {
  19631. e.material.uniforms.blackout.value = i
  19632. }),
  19633. this._warpBendAim(null, t, null, r);
  19634. var o = function() {
  19635. this.wrapupWarpShadingOnly(n, i)
  19636. }
  19637. .bind(this);
  19638. V.start(this.stepWarpPath.bind(this), t, o, r, B[D.warp.blendEasing], "stepMotion")
  19639. }
  19640. ,
  19641. t.prototype.flightStepWalk = (a = new P.Vector3,
  19642. s = new P.Vector3,
  19643. function(e, t, i) {
  19644. if (this.warpInterrupted)
  19645. i && i();
  19646. else if (this.activeTransType !== L.WALK)
  19647. this._clearWarpShading(),
  19648. this._warpStopFlying(),
  19649. this.player.spider.draw(),
  19650. this.placeCpm(),
  19651. i && i();
  19652. else if (this.player.currentPano !== e) {
  19653. var n = {
  19654. pano: e,
  19655. lookAtPoint: t,
  19656. duration: null,
  19657. maxDistanceOverride: D.warp.walkMaxDist,
  19658. skipWarpingCheck: !1,
  19659. constantMoveSpeed: !0
  19660. };
  19661. n.duration = function(e, t) {
  19662. var i = Math.min(this.player.position.distanceTo(e.position), D.transition.flytimeMaxDistanceThreshold) * D.transition.flytimeDistanceMultiplier + D.transition.flyTime;
  19663. s.copy(U.FORWARD),
  19664. this.player.getDirection(s),
  19665. a.copy(t).sub(e.position).normalize();
  19666. var n = a.dot(s)
  19667. , r = Math.acos(n)
  19668. , o = r / i;
  19669. return .001 < o && (i *= o / .001,
  19670. r < 1 && (i *= 1.2)),
  19671. i
  19672. }
  19673. .call(this, e, t),
  19674. this.player.nonInterruptingFlyToPano(n, i)
  19675. } else
  19676. i && i()
  19677. }
  19678. ),
  19679. t.prototype.makeWalkFlightFunc = function(e, t, i) {
  19680. return this.flightStepWalk.bind(this, e, t, i)
  19681. }
  19682. ,
  19683. t.prototype.warpTravel_WALK = (f = [],
  19684. function(e) {
  19685. for (var t = this.player.model.panos, i = null, n = !1, r = f.length = 0; r < this.nodes.length; r++) {
  19686. var o = this.nodes[r]
  19687. , a = t.get(o);
  19688. this.nodes.length,
  19689. n = i && a.position.distanceTo(i.position) < D.warp.walkMinDist,
  19690. i && n || (f.push(o),
  19691. i = a)
  19692. }
  19693. n && 1 < this.nodes.length && (f[f.length - 1] = this.nodes[this.nodes.length - 1]);
  19694. var s = f.length
  19695. , l = t.get(f[s - 1])
  19696. , c = new Array(s + 1);
  19697. c[c.length - 1] = function() {
  19698. e && e()
  19699. }
  19700. .bind(this);
  19701. for (var h = s - 1, u = c.length - 1; 0 < u; u -= 1) {
  19702. var d = f[h];
  19703. l = t.get(d);
  19704. var p = new P.Vector3;
  19705. this.getLookAtForWalkingTourNode(f, h, p),
  19706. c[u - 1] = this.makeWalkFlightFunc(l, p, c[u]),
  19707. h--
  19708. }
  19709. c[0]()
  19710. }
  19711. ),
  19712. t.prototype.getLookAtForWalkingTourNode = (c = new P.Vector3,
  19713. h = new P.Vector3,
  19714. u = new P.Vector3,
  19715. d = new P.Vector3,
  19716. p = new P.Vector3,
  19717. function(e, t, i) {
  19718. var n = e.length;
  19719. if (n <= t)
  19720. return !1;
  19721. var r = 1
  19722. , o = 1;
  19723. h.set(0, 0, 0),
  19724. p.set(0, 0, 0);
  19725. for (var a = null, s = t; s < t + 3 && !(n <= s); s++) {
  19726. if (a = this.player.model.panos.get(e[s]),
  19727. this.getOrientationForWalkingTourNode(e, s, u),
  19728. s === t && c.copy(u),
  19729. d.copy(u),
  19730. t < s) {
  19731. var l = d.dot(c) < .65;
  19732. r *= l ? .2 : .75,
  19733. o *= l ? .2 : .4
  19734. }
  19735. u.multiplyScalar(r),
  19736. h.add(u),
  19737. p.lerp(a.position, o)
  19738. }
  19739. return h.normalize(),
  19740. i.copy(p),
  19741. i.add(h),
  19742. !0
  19743. }
  19744. ),
  19745. t.prototype.getOrientationForWalkingTourNode = function(e, t, i) {
  19746. var n = e.length;
  19747. if (n <= t)
  19748. return !1;
  19749. if (t === n - 1)
  19750. i.copy(U.FORWARD).applyQuaternion(this.warpDestHeroLoc.quaternion);
  19751. else {
  19752. var r = this.player.model.panos.get(e[t])
  19753. , o = this.player.model.panos.get(e[t + 1]);
  19754. i.copy(o.position).sub(r.position)
  19755. }
  19756. return i.normalize(),
  19757. !0
  19758. }
  19759. ,
  19760. t.prototype.warpCameraTravel = function(e, t, i, n) {
  19761. if (this.activeTransType = this.upcomingTransType,
  19762. this.lastTransType = this.activeTransType,
  19763. this.upcomingTransType = null,
  19764. e)
  19765. this.activeTransType === L.BLACK ? this.warpTravel_BLACK(null, i, t, n) : this.activeTransType === L.WALK ? this.warpTravel_WALK(function() {
  19766. this._clearWarpShading(),
  19767. this._warpStopFlying(),
  19768. this.player.spider.draw(),
  19769. this.placeCpm(),
  19770. n && n()
  19771. }
  19772. .bind(this)) : this.warpTravel_STD(n);
  19773. else {
  19774. var r = function() {
  19775. this._wrapupTravel(n)
  19776. }
  19777. .bind(this)
  19778. , o = {
  19779. pano: this.warpDestPano,
  19780. lookAtPoint: null,
  19781. duration: null,
  19782. maxDistanceOverride: null,
  19783. skipWarpingCheck: !1
  19784. };
  19785. this.player.flyToPano(o, r)
  19786. }
  19787. }
  19788. ,
  19789. t.prototype.startWarpState = function() {
  19790. this.warping = !0,
  19791. this.warpInterrupted = !1,
  19792. this.warpInterruptionBlackoutStyle = null,
  19793. this.warpInterruptionTravelTime = null
  19794. }
  19795. ,
  19796. t.prototype.endWarpState = function() {
  19797. this.warping = !1
  19798. }
  19799. ,
  19800. t.prototype.warpToPano = function(e, t, i, n) {
  19801. if (this.warping)
  19802. H.warn("Cannot warp when already warping");
  19803. else {
  19804. if (this.upcomingTransType = e,
  19805. this.activeTransType = null,
  19806. !this.setWarpDestPano())
  19807. return this.upcomingTransType = null,
  19808. void this.warpToNonPano(n);
  19809. if (this.player.mode !== O.PANORAMA)
  19810. return this.upcomingTransType = null,
  19811. this.discardSlow(),
  19812. void this.player.flyToNewMode({
  19813. mode: O.PANORAMA,
  19814. pano: this.warpDestPano,
  19815. duration: D.warp.outsideTime,
  19816. warpDest: this.warpDestHeroLoc,
  19817. callback: n,
  19818. force: !0
  19819. });
  19820. if (!this.warpDestPano)
  19821. return H.warn("no warp destination, callback dropped"),
  19822. void (this.upcomingTransType = null);
  19823. 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)
  19824. , o = this.chooseWarpPath(r);
  19825. if (o && this.upcomingTransType !== L.WALK) {
  19826. var a = function() {
  19827. this.waitingToWarp = !1,
  19828. this.warpToPano(e, t, i, n)
  19829. }
  19830. .bind(this);
  19831. if (this.player.checkAndWaitForPanoLoad(this.warpDestPano, "high", "low", this.player.basePanoSize, a))
  19832. return void (this.waitingToWarp = !0)
  19833. }
  19834. this.player.currentPano || (H.warn("Arrived at a very strange spot!"),
  19835. this.player.currentPano = this.warpDestPano,
  19836. this.placeCpm(),
  19837. this.fadeOutCpm(D.path.fadeOutTime),
  19838. this.player.spider.draw()),
  19839. H.debug("Warping to pano ", this.warpDestPano.position),
  19840. this.upcomingTransType !== L.WALK && this.player.emit(g.PanoChosen, this.player.currentPano, this.warpDestPano),
  19841. this.startWarpState();
  19842. var s = function() {
  19843. this.endWarpState(),
  19844. n && n()
  19845. }
  19846. .bind(this);
  19847. o ? this.warpCameraTravel(r, t, i, s) : this.warpCameraAim(s)
  19848. }
  19849. }
  19850. ,
  19851. v.exports = t
  19852. }
  19853. ).call(this, "/js/objects/ShowPath.js")
  19854. }
  19855. , {
  19856. "../constants": 8,
  19857. "../effects": 16,
  19858. "../enum/BlackoutStyle": 18,
  19859. "../enum/ModelManagerEvents": 33,
  19860. "../enum/PlayerEvents": 40,
  19861. "../enum/RenderOrder": 42,
  19862. "../enum/Vectors": 50,
  19863. "../enum/Viewmode": 51,
  19864. "../enum/WarpStyle": 52,
  19865. "../gui/gui": 65,
  19866. "../model/ModelManager": 140,
  19867. "../objects/Snapshot": 153,
  19868. "../settings": 166,
  19869. "../shaders": 167,
  19870. "../util/easing": 186,
  19871. "../util/lerp": 188,
  19872. "../util/logger": 189,
  19873. "../util/math": 190,
  19874. "../util/texture": 194,
  19875. "../util/transitions": 195,
  19876. three: 217
  19877. }],
  19878. 152: [function(e, t, i) {
  19879. "use strict";
  19880. function n() {
  19881. var e = new r.SphereBufferGeometry(a.skyboxRadius,20,5)
  19882. , t = new r.RawShaderMaterial({
  19883. fragmentShader: o.skysphere.fragmentShader,
  19884. vertexShader: o.skysphere.vertexShader,
  19885. uniforms: r.UniformsUtils.clone(o.skysphere.uniforms),
  19886. side: r.BackSide,
  19887. name: "skysphere"
  19888. });
  19889. t.uniforms.radius.value = e.parameters.radius,
  19890. r.Mesh.call(this, e, t)
  19891. }
  19892. var r = e("three")
  19893. , o = e("../shaders")
  19894. , a = e("../settings");
  19895. (n.prototype = Object.create(r.Mesh.prototype)).constructor = n,
  19896. t.exports = n
  19897. }
  19898. , {
  19899. "../settings": 166,
  19900. "../shaders": 167,
  19901. three: 217
  19902. }],
  19903. 153: [function(r, o, e) {
  19904. (function(e) {
  19905. "use strict";
  19906. function t(e) {
  19907. n.call(this, e),
  19908. this.sid = e.sid,
  19909. this.panoId = e.panoId,
  19910. this.orthoZoom = e.orthoZoom,
  19911. this.floorVisibility = e.floorVisibility,
  19912. this.thumbUrl = e.thumbUrl,
  19913. this.name = e.name,
  19914. this.zoom = e.zoom
  19915. }
  19916. var i = (r("three"),
  19917. r("../util/logger"))
  19918. , n = (r("../settings"),
  19919. r("../enum/Viewmode"),
  19920. r("../util/common"),
  19921. r("../util/transitions"),
  19922. r("../util/lerp"),
  19923. r("../util/ajax"),
  19924. r("../util/texture"),
  19925. r("./View"));
  19926. r("events").EventEmitter,
  19927. new i(e),
  19928. (t.prototype = Object.create(n.prototype)).isPano = function() {
  19929. return this.panoId && "" !== this.panoId && this.panoId != "outside"
  19930. }
  19931. ,
  19932. o.exports = t
  19933. }
  19934. ).call(this, "/js/objects/Snapshot.js")
  19935. }
  19936. , {
  19937. "../enum/Viewmode": 51,
  19938. "../settings": 166,
  19939. "../util/ajax": 181,
  19940. "../util/common": 185,
  19941. "../util/lerp": 188,
  19942. "../util/logger": 189,
  19943. "../util/texture": 194,
  19944. "../util/transitions": 195,
  19945. "./View": 154,
  19946. events: 202,
  19947. three: 217
  19948. }],
  19949. 154: [function(o, a, e) {
  19950. (function(e) {
  19951. "use strict";
  19952. function t(e) {
  19953. e = e || {},
  19954. this.position = new i.Vector3,
  19955. this.quaternion = new i.Quaternion,
  19956. this.update(e)
  19957. }
  19958. var i = o("three")
  19959. , n = o("../util/logger")
  19960. , r = (o("../settings"),
  19961. o("../enum/Viewmode"),
  19962. o("../util/common"),
  19963. o("../util/transitions"),
  19964. o("../util/lerp"),
  19965. o("../util/ajax"),
  19966. o("../util/texture"),
  19967. o("events").EventEmitter);
  19968. new n(e),
  19969. (t.prototype = Object.create(r.prototype)).isValid = function() {
  19970. return !!this.cameraMode
  19971. }
  19972. ,
  19973. t.prototype.update = function(e) {
  19974. return this.cameraMode = e.cameraMode || this.cameraMode,
  19975. this.pano = e.pano || this.pano,
  19976. e.position && this.position.copy(e.position),
  19977. e.quaternion && this.quaternion.copy(e.quaternion),
  19978. this
  19979. }
  19980. ,
  19981. a.exports = t
  19982. }
  19983. ).call(this, "/js/objects/View.js")
  19984. }
  19985. , {
  19986. "../enum/Viewmode": 51,
  19987. "../settings": 166,
  19988. "../util/ajax": 181,
  19989. "../util/common": 185,
  19990. "../util/lerp": 188,
  19991. "../util/logger": 189,
  19992. "../util/texture": 194,
  19993. "../util/transitions": 195,
  19994. events: 202,
  19995. three: 217
  19996. }],
  19997. 155: [function(J, ee, e) {
  19998. (function(e) {
  19999. "use strict";
  20000. function t(e) {
  20001. this.currentPano = null,
  20002. this.nextPano = null,
  20003. this.camera = null,
  20004. this.paused = !1,
  20005. this.flying = !1,
  20006. this.sceneIntersectionPlane = null,
  20007. this.target = new B.Vector3,
  20008. this.mouse = new B.Vector3(1.1,1.1,.5),
  20009. this.mouseAtMouseDown = new B.Vector2,
  20010. this.mouseCouldBeClickToMove = !1,
  20011. this.mouseLastMoveTime = Date.now(),
  20012. this.mouseDown = !1,
  20013. this.mouseDownTimer = null,
  20014. this.couldBeLongTap = !1,
  20015. this.containsMouse = !0,
  20016. this.isTouchEvent = !1,
  20017. this.isPanoHover = !1,
  20018. this.reticule = new n(this),
  20019. this.panoMarkers = [],
  20020. this.spider = new s(this),
  20021. this.quaternion = new B.Quaternion,
  20022. this.position = new B.Vector3(15,10,15),
  20023. this.previousState = null,
  20024. this.lastInsideView = new o,
  20025. this.last360View = new o,
  20026. this.raycaster = new B.Raycaster,
  20027. this.intersect = null,
  20028. this.lastChangeTime = Date.now(),
  20029. this.history = new h,
  20030. this.cameraControls = null,
  20031. this.path = null,
  20032. this.model = null,
  20033. this.domElement = null,
  20034. this.cachedPanoCandidates = null,
  20035. this.basePanoSize = 0,
  20036. this.standardPanoSize = 0,
  20037. this.highPanoSize = 0,
  20038. this.ultraHighPanoSize = 0,
  20039. this.zoomLevel = 1,
  20040. this.zooming = 0,
  20041. this.zoomSpeed = .5,
  20042. this.scrollZoomSpeed = .06,
  20043. this.zoomSpeedAdjust = .05,
  20044. this.defaultZoomIncrement = .2,
  20045. this.baseFov = k.insideFOV,
  20046. this.zoomFov = this.baseFov,
  20047. this.zoomEnabled = !0,
  20048. this.preRenderingEnabled = !1,
  20049. this.setupCustomProperties(e),
  20050. this.zoomStats = new v,
  20051. this.modeTran = ''
  20052. this.currentCursor = '';
  20053. }
  20054. var B = J("three")
  20055. , i = J("./util/logger")
  20056. , n = J("./objects/Reticule")
  20057. , a = J("./objects/Panorama")
  20058. , r = J("./objects/ShowPath")
  20059. , o = J("./objects/View")
  20060. , s = (J("./objects/Snapshot"),
  20061. J("./objects/NSpider"))
  20062. , V = J("./enum/Viewmode")
  20063. , T = (J("./enum/TagStates"),
  20064. J("./enum/Vectors"))
  20065. , l = J("./enum/Keys")
  20066. , k = (J("./enum/AlignmentType"),
  20067. J("./settings"))
  20068. , x = J("./util/common")
  20069. , U = (J("./util/browser"),
  20070. J("./util/math"))
  20071. , H = J("./util/lerp")
  20072. , z = J("./util/easing")
  20073. , G = J("./util/transitions")
  20074. , c = J("events").EventEmitter
  20075. , h = (J("./shaders"),
  20076. J("./util/history"))
  20077. , S = (J("./util/camera"),
  20078. J("./model/ModelManager"),
  20079. J("./enum/PathDiscardMode"))
  20080. , M = J("./enum/PathDisplayMode")
  20081. , W = J("./enum/PlayerEvents")
  20082. , u = J("./enum/ControlEvents")
  20083. , d = J("./enum/ModelManagerEvents")
  20084. , R = J("./enum/WarpStyle")
  20085. , P = J("./enum/BlackoutStyle")
  20086. , p = J("./exception/BasicException")
  20087. , f = J("./enum/PanoSizeClass")
  20088. , g = (J("./tile/TileDownloader"),
  20089. J("./tile/TilePrioritizer"))
  20090. , m = (J("./enum/PanoramaEvents"),
  20091. J("./enum/ZoomEvents"))
  20092. , v = J("./util/ZoomStats")
  20093. , y = J("./constants")
  20094. , j = J("./util/common")
  20095. , A = J("./util/cameraLight")
  20096. , C = J("hot")
  20097. , Y = new i(e)
  20098. , q = Object.freeze({
  20099. FlyToPano: G.getUniqueId(),
  20100. FlyToNewMode: G.getUniqueId(),
  20101. FlyToSameMode: G.getUniqueId(),
  20102. FlyToViewFloor: G.getUniqueId(),
  20103. LookTransition: G.getUniqueId(),
  20104. ZoomTransition: G.getUniqueId()
  20105. });
  20106. function I(e) {
  20107. for (var t = e.split(","), i = t[0].match(/:(.*?);/)[1], n = atob(t[1]), r = n.length, o = new Uint8Array(r); r--; )
  20108. o[r] = n.charCodeAt(r);
  20109. return new Blob([o],{
  20110. type: i
  20111. })
  20112. }
  20113. (t.prototype = Object.create(c.prototype)).init = function(e) {
  20114. (window.player = this).modelManager = e.modelManager,
  20115. this.tileDownloader = e.tileDownloader,
  20116. this.panoRenderer = e.panoRenderer,
  20117. this.qualityManager = e.qualityManager,
  20118. this.domElement = e.container,
  20119. this.camera = e.camera,
  20120. this.tagManager = e.tagManager,
  20121. this.cameraControls = e.controls,
  20122. this.path = new r(e.director,this,e.controls),
  20123. this.basePanoSize = this.qualityManager.getPanoSize(f.BASE),
  20124. this.standardPanoSize = this.qualityManager.getPanoSize(f.STANDARD),
  20125. this.highPanoSize = this.qualityManager.getPanoSize(f.HIGH),
  20126. this.ultraHighPanoSize = this.qualityManager.getPanoSize(f.ULTRAHIGH),
  20127. this.tileDownloader.processPriorityQueue = !1,
  20128. this.tileDownloader.tilePrioritizer = new g(this.qualityManager,this.basePanoSize,this.standardPanoSize,this.highPanoSize,this.ultraHighPanoSize),
  20129. this.bindEvents(e.container),
  20130. this.updateModel()
  20131. }
  20132. ,
  20133. t.prototype.screenShot = function(i) {
  20134. if (!this.flying && !this.flyingToTag) {
  20135. var n = this.sceneRenderer;
  20136. for (var e in n.updateScreenSize(i),
  20137. this.model.panos.index)
  20138. this.model.panos.index[e].marker && (this.model.panos.index[e].marker.forceHide = this.model.panos.index[e].marker.visible,
  20139. this.model.panos.index[e].marker.visible = !1);
  20140. for (var e in this.model.hots)
  20141. this.model.hots[e].mesh.visible = !1;
  20142. this.reticule.visible = !1,
  20143. this.reticule.forceUnvisible = !0,
  20144. this.path.currentPanoMarker.mesh.visible = !1,
  20145. setTimeout(function() {
  20146. n.renderer.clear(!0, !0, !0),
  20147. n.renderer.render(n.scene, n.camera);
  20148. var e = n.renderer.domElement.toDataURL(i.type, .9);
  20149. for (var t in i.f && i.f(e),
  20150. n.updateScreenSize({
  20151. resize: !0
  20152. }),
  20153. this.reticule.visible = !0,
  20154. this.model.hots)
  20155. this.model.hots[t].mesh.visible = !0;
  20156. for (var t in this.model.panos.index)
  20157. this.model.panos.index[t].marker.visible = this.model.panos.index[t].marker.forceHide;
  20158. this.path.currentPanoMarker.mesh.visible = !0,
  20159. n.renderer.render(n.scene, n.camera)
  20160. }
  20161. .bind(this), 30)
  20162. }
  20163. }
  20164. ;
  20165. var E, _, b, w, O, L, D, N, F, X, Z, K, Q = J("scaleImg");
  20166. t.prototype.getWrapShot = function() {
  20167. var i = this.getSnapAngleInfo()
  20168. , n = ",{\r\t" + i
  20169. , r = arguments[0];
  20170. this.screenShot({
  20171. width: g_snapShotWidth,
  20172. height: g_snapShotHeight,
  20173. type: "image/jpeg",
  20174. f: function(e) {
  20175. if (r && r.__callback)
  20176. return r.__callback(e, i);
  20177. var t = new Image;
  20178. t.src = e,
  20179. t.onload = function() {
  20180. var e = function(r, i) {
  20181. function n(e, t) {
  20182. var i = o || r
  20183. , n = document.createElement("canvas");
  20184. n.width = i.width,
  20185. n.height = i.height,
  20186. n.getContext("2d").drawImage(i, 0, 0, i.width, i.height),
  20187. o = Q(e, n, t)
  20188. }
  20189. function e() {
  20190. var e = o || r
  20191. , t = I(e.src);
  20192. i.maxWeight && t.size > i.maxWeight && (n(i.maxWeight / t.size, "jpeg"),
  20193. t = I(e.src)),
  20194. (o = o || new Image).base64Src = e.src,
  20195. o.src = window.URL.createObjectURL(t)
  20196. }
  20197. var o, t = Math.max(r.width, r.height);
  20198. return "png" != i.toType && ("jpeg" == i.oldType ? (t > i.maxSize && n(i.maxSize / t, "jpeg"),
  20199. e()) : "png" == i.oldType && i.maxWeight && i.weight > i.maxWeight && (n(t > i.maxSize ? i.maxSize / t : 1, "jpeg"),
  20200. e())),
  20201. o || r
  20202. }(this, {
  20203. maxSize: g_snapShotWidth,
  20204. oldType: "jpeg"
  20205. });
  20206. e.src.replace(function(e) {
  20207. return "image/" + (e = e.toLowerCase().replace(/jpg/i, "jpeg")).match(/png|jpeg|bmp|gif/)[0]
  20208. }("image/jpeg"), "image/octet-stream");
  20209. var t = "snap" + (new Date).getTime();
  20210. !function(e, t) {
  20211. var i = document.createElementNS("http://www.w3.org/1999/xhtml", "a");
  20212. i.href = e,
  20213. i.download = t;
  20214. var n = document.createEvent("MouseEvents");
  20215. n.initMouseEvent("click", !0, !1, window, 0, 0, 0, 0, 0, !1, !1, !1, !1, 0, null),
  20216. i.dispatchEvent(n)
  20217. }(e.src, t + ".jpg"),
  20218. n += ',\r\t"thumbnail_signed_src":"' + t + '.jpg",',
  20219. n += '\r\t"sid":"' + t + '",',
  20220. n += '\r\t"name":"' + t + '"\r}',
  20221. logData(n)
  20222. }
  20223. }
  20224. })
  20225. }
  20226. /* ,
  20227. t.prototype.getSnapAngleInfo = function() {
  20228. var e = {}
  20229. , t = '"metadata":{'
  20230. , i = this.camera.quaternion.clone();
  20231. switch (this.mode) {
  20232. case "panorama":
  20233. e.scan_id = this.currentPano.id,
  20234. t += '"scan_id":"' + this.currentPano.id + '",';
  20235. break;
  20236. case "floorplan":
  20237. e.camera_mode = 1,
  20238. (i = (new B.Quaternion).setFromAxisAngle(new B.Vector3(0,1,0), B.Math.degToRad(90))).multiply(this.camera.quaternion),
  20239. t += '"camera_mode":1,',
  20240. t += '"ortho_zoom":' + U.toPrecision(this.cameraControls.activeControl.currentScale, 4) + ",";
  20241. break;
  20242. case "dollhouse":
  20243. e.camera_mode = 2,
  20244. t += '"camera_mode":2,'
  20245. }
  20246. var n = new B.Quaternion(i.x,i.y,i.z,i.w);
  20247. return n.multiply(new B.Quaternion(Math.sqrt(2) / 2,Math.sqrt(2) / 2,0,0).conjugate()),
  20248. n.x *= -1,
  20249. n.w *= -1,
  20250. e.camera_position = U.toPrecision(this.camera.position.toArray(), 4),
  20251. e.camera_quaternion = U.toPrecision(n.toArray(), 4),
  20252. e.zoom = this.zoomLevel,
  20253. t += '"camera_position":[' + e.camera_position + '],"camera_quaternion":[' + e.camera_quaternion + '], "zoom":' + e.zoom + "}"
  20254. }
  20255. , */
  20256. t.prototype.getSnapAngleInfo = function(){
  20257. var info = {};
  20258. var str = '"metadata":{';
  20259. var q = this.camera.quaternion.clone();
  20260. switch (this.mode) {
  20261. case "panorama":
  20262. info.scan_id = this.currentPano.id;
  20263. str += ('"scan_id":"'+this.currentPano.id+'",');
  20264. break;
  20265. case "floorplan":
  20266. info.camera_mode = 1;
  20267. q = (new B.Quaternion).setFromAxisAngle(new B.Vector3(0,1,0), B.Math.degToRad(90))
  20268. q.multiply(this.camera.quaternion);
  20269. str += ('"camera_mode":1,');
  20270. //str += ('"ortho_zoom":'+m.toPrecision(this.cameraControls.activeControl.currentScale * $("#player").height() / $("#player").width() * D.workshopApsect * 16, 4)+",");
  20271. str += ('"ortho_zoom":'+ U.toPrecision(this.cameraControls.activeControl.currentScale, 4 )+",");
  20272. break;
  20273. case "dollhouse":
  20274. info.camera_mode = 2;
  20275. str += ('"camera_mode":2,');
  20276. break;
  20277. }
  20278. info.camera_position = U.toPrecision(this.camera.position.toArray(),4);
  20279. //console.log(info.camera_position)
  20280. info.camera_quaternion = U.toPrecision(q.toArray(),4);
  20281. /* if(window.screenSta === 'tour'){ // fyz 导览截屏需要做额外的 fyz 对相机截屏的角度进行校对
  20282. var out = new B.Quaternion(q.x, q.y, q.z, q.w)
  20283. out.multiply(new B.Quaternion(Math.sqrt(2) / 2, Math.sqrt(2) / 2, 0, 0).conjugate())
  20284. out.x *= -1;
  20285. out.w *= -1;
  20286. info.camera_quaternion = U.toPrecision(out.toArray(),4);
  20287. }else{
  20288. info.camera_quaternion = U.toPrecision(q.toArray(),4);;
  20289. } */
  20290. info.zoom = this.zoomLevel;
  20291. //console.log(info.camera_quaternion)
  20292. // str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+"]}");
  20293. // fyz 扩展编辑页面, 加上导览点缩放值
  20294. str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+'], "zoom":' + info.zoom + '}');
  20295. console.log(str)
  20296. return str;
  20297. }
  20298. //------end
  20299. t.prototype.closePopup = function() {
  20300. if (g_currentHot) {
  20301. g_currentHot = null,
  20302. document.getElementById("popup").style.display = "none",
  20303. document.querySelector(".popup-content").removeChild(document.getElementById("id1")),
  20304. $("#popup iframe:last").remove();
  20305. document.getElementById("bgaudio");
  20306. if(g_bgAudio && g_bgAudio.pauseByHot){
  20307. manage.switchBgmState(true)
  20308. }
  20309. return false
  20310. }
  20311. }
  20312. ,
  20313. t.prototype.setupCustomProperties = function(e) {
  20314. var i = e || V.PANORAMA;
  20315. Object.defineProperty(this, "mode", {
  20316. get: function() {
  20317. return i
  20318. },
  20319. set: function(e) {
  20320. var t = i;
  20321. i = e,
  20322. this.onModeUpdated(t, i)
  20323. }
  20324. })
  20325. }
  20326. ,
  20327. t.prototype.isInMode = function() {
  20328. for (var e = 0; e < arguments.length; e++)
  20329. if (this.mode === arguments[e])
  20330. return !0;
  20331. return !1
  20332. }
  20333. ,
  20334. t.prototype.isOutsideMode = function(e) {
  20335. return (e = e || this.mode) === V.DOLLHOUSE || e === V.FLOORPLAN
  20336. }
  20337. ,
  20338. t.prototype.is360View = function(e, t) {
  20339. return e === V.PANORAMA && t && !t.isAligned()
  20340. }
  20341. ,
  20342. t.prototype.setScene = function(e) {
  20343. this.sceneIntersectionPlane = e.plane,
  20344. this.path.setScene(e),
  20345. this.moveReticuleToScene(e)
  20346. }
  20347. ,
  20348. t.prototype.moveReticuleToScene = function(e) {
  20349. this.reticule.parent && this.reticule.parent.remove(this.reticule),
  20350. e.add(this.reticule)
  20351. }
  20352. ,
  20353. t.prototype.updateModel = function() {
  20354. function n(e) {
  20355. var t = this.cameraControls.cameras[V.DOLLHOUSE]
  20356. , i = this.cameraControls.controls[V.DOLLHOUSE]
  20357. , n = t.position.y + (e - i.target.y)
  20358. , r = k.showFloorDuration + k.showFloorDelay;
  20359. G.start(H.property(i.target, "y", e), r, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToViewFloor),
  20360. G.start(H.property(t.position, "y", n), r, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToViewFloor)
  20361. }
  20362. this.model = this.modelManager.getActiveModel(),
  20363. this.model.on("floor.changed", function(e, t, i) {
  20364. this.mode === V.DOLLHOUSE && e !== i && n.call(this, e.center.y)
  20365. }
  20366. .bind(this)),
  20367. this.model.on("allfloors.toggled", function(e, t) {
  20368. if (this.mode === V.DOLLHOUSE) {
  20369. var i = e ? this.model.center.y : i = t.center.y;
  20370. n.call(this, i)
  20371. }
  20372. }
  20373. .bind(this)),
  20374. this.on(W.PanoChosen, this.model.setProjectedPanos.bind(this.model));
  20375. var t = this;
  20376. this.model.panos.list.forEach(function(e) {
  20377. e.vrMarker.addEventListener("click", function() {
  20378. t.flyToPano({
  20379. pano: e
  20380. })
  20381. })
  20382. })
  20383. }
  20384. ,
  20385. t.prototype.updateModelDependentData = function() {
  20386. this.cameraControls.setModelForControls(this.model),
  20387. this.getPanoMarkersFromModel(this.model)
  20388. }
  20389. ,
  20390. t.prototype.onModelChanged = function() {
  20391. this.updateModel(),
  20392. this.updateModelDependentData()
  20393. }
  20394. ,
  20395. t.prototype.getPanoMarkersFromModel = function(e) {
  20396. this.panoMarkers = e.panos.list.reduce(function(e, t) {
  20397. return t.marker ? e.concat(t.marker) : e
  20398. }, [])
  20399. }
  20400. ,
  20401. t.prototype.handleControlMove = function(e) {
  20402. this.emit(W.Move, e)
  20403. }
  20404. ,
  20405. t.prototype.handleControlInputStart = function(e) {
  20406. this.emit(W.InputStart, e)
  20407. }
  20408. ,
  20409. t.prototype.onModeUpdated = function(e, t) {
  20410. this.cameraControls.activateControls(t),
  20411. this.emit(W.ModeChanged, e, t)
  20412. }
  20413. ,
  20414. t.prototype.isWarping = function() {
  20415. return this.path.warping
  20416. }
  20417. ,
  20418. t.prototype.isWaitingToWarp = function() {
  20419. return this.path.waitingToWarp
  20420. }
  20421. ,
  20422. t.prototype.getLabelScaleFactor = function() {
  20423. if (this.isOutsideMode()) {
  20424. return Math.sqrt(this.cameraControls.controls[V.FLOORPLAN].currentScale / 10)
  20425. }
  20426. return .5
  20427. }
  20428. ,
  20429. t.prototype.changeMusic = function() {
  20430. if(!this.director.tourIsPlaying) this.director.bgmReplay()
  20431. }
  20432. ,
  20433. t.prototype.bindEvents = function(e) {
  20434. e !== document && e.setAttribute("tabindex", -1),
  20435. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  20436. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  20437. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  20438. e.addEventListener("mouseout", this.onMouseOut.bind(this)),
  20439. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  20440. this.modelManager.on(d.ActiveModelChanged, this.onModelChanged.bind(this)),
  20441. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  20442. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  20443. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  20444. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  20445. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  20446. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  20447. document.addEventListener("pointerup", ()=>{//add
  20448. window.transformControls && transformControls.onPointerUp()
  20449. }),
  20450. e.addEventListener("pointerout", this.onPointerOut.bind(this)),
  20451. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  20452. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  20453. this.cameraControls.on(u.Move, this.handleControlMove.bind(this)),
  20454. this.cameraControls.on(u.InputStart, this.handleControlInputStart.bind(this)),
  20455. this.cameraControls.on(u.Pinch, this.handleControlPinch.bind(this)),
  20456. this.cameraControls.on(u.Scroll, this.handleControlScroll.bind(this)),
  20457. window.addEventListener("snapshotBegin", this.getWrapShot.bind(this)),
  20458. window.addEventListener("tourAudioEnded", this.changeMusic.bind(this)),
  20459. window.getSeft && getSeft(this),
  20460. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? $("#closepop").on("touchstart", this.closePopup.bind(this)) : $("#closepop").on("click", this.closePopup.bind(this))
  20461. }
  20462. ,
  20463. t.prototype.onMouseDown = function(e) {
  20464. e.currentTarget !== document && e.currentTarget.focus(),
  20465. 0 === e.button && (this.handleInputStart.call(this, e.clientX, e.clientY, !1),
  20466. this.updateIntersect())
  20467. }
  20468. ,
  20469. t.prototype.onMouseMove = function(e) {
  20470. this.isTouchEvent = !1,
  20471. this.handleInputMove.call(this, e.clientX, e.clientY, !1)
  20472. }
  20473. ,
  20474. t.prototype.onMouseOver = function(e) {
  20475. this.containsMouse = !0,
  20476. !this.mouseDown || 0 !== e.which && 0 !== e.buttons || (this.mouseDown = !1)
  20477. }
  20478. ,
  20479. t.prototype.onMouseOut = function(e) {
  20480. this.containsMouse = !1
  20481. }
  20482. ,
  20483. t.prototype.onMouseUp = function(e) {
  20484. this.handleInputEnd.call(this, e.clientX, e.clientY, !1)
  20485. }
  20486. ,
  20487. t.prototype.onTouchStart = function(e) {
  20488. if (e.currentTarget !== document && e.currentTarget.focus(),
  20489. !this.mouseDown) {
  20490. this.couldBeLongTap = !0;
  20491. var t = x.average(e.changedTouches, "clientX")
  20492. , i = x.average(e.changedTouches, "clientY");
  20493. this.handleInputStart.call(this, t, i, !0),
  20494. this.mouseDownTimer = setTimeout(function() {
  20495. this.updateIntersect(),
  20496. this.handleInputEnd.call(this, t, i, !0)
  20497. }
  20498. .bind(this), k.input.longTapThreshold)
  20499. }
  20500. }
  20501. ,
  20502. t.prototype.onTouchMove = function(e) {
  20503. var t = x.average(e.changedTouches, "clientX")
  20504. , i = x.average(e.changedTouches, "clientY");
  20505. this.handleInputMove.call(this, t, i, !0)
  20506. }
  20507. ,
  20508. t.prototype.onTouchEnd = function(e) {
  20509. if (clearTimeout(this.mouseDownTimer),
  20510. this.mouseDown) {
  20511. this.couldBeLongTap = !1,
  20512. this.updateIntersect();
  20513. var t = x.average(e.changedTouches, "clientX")
  20514. , i = x.average(e.changedTouches, "clientY");
  20515. this.handleInputEnd.call(this, t, i, !0)
  20516. }
  20517. }
  20518. ,
  20519. t.prototype.onPointerDown = function(e) {
  20520. return e.currentTarget !== document && e.currentTarget.focus(),
  20521. this.mouseDown || "mouse" === e.pointerType ? this.onMouseDown(e) : (this.couldBeLongTap = !0,
  20522. this.handleInputStart.call(this, e.clientX, e.clientY, !0),
  20523. void (this.mouseDownTimer = setTimeout(function() {
  20524. this.updateIntersect(),
  20525. this.handleInputEnd.call(this, e.clientX, e.clientY, !0)
  20526. }
  20527. .bind(this), k.input.longTapThreshold)))
  20528. }
  20529. ,
  20530. t.prototype.onPointerMove = function(e) {
  20531. "mouse" !== e.pointerType ? this.handleInputMove.call(this, e.clientX, e.clientY, !0) : this.onMouseMove(e)
  20532. }
  20533. ,
  20534. t.prototype.onPointerUp = function(e) {
  20535. return this.mouseDown && "mouse" !== e.pointerType ? (clearTimeout(this.mouseDownTimer),
  20536. this.couldBeLongTap = !1,
  20537. this.updateIntersect(),
  20538. void this.handleInputEnd.call(this, e.clientX, e.clientY, !0)) : this.onMouseUp(e)
  20539. }
  20540. ,
  20541. t.prototype.onPointerOut = function(e) {
  20542. this.mouseDown = !1
  20543. }
  20544. ,
  20545. t.prototype.onPointerCancel = function(e) {
  20546. this.mouseDown = !1
  20547. }
  20548. ,
  20549. t.prototype.onKeyDown = function(e) {
  20550. var t = function() {
  20551. this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.Move, "key")
  20552. }
  20553. .bind(this)
  20554. , i = e.which;
  20555. switch (i) {
  20556. case l.F:
  20557. t(),
  20558. this.changeFloor(-1);
  20559. break;
  20560. case l.R:
  20561. t(),
  20562. this.changeFloor(1)
  20563. }
  20564. if (this.mode === V.PANORAMA)
  20565. switch (i) {
  20566. case l.UPARROW:
  20567. case l.W:
  20568. this.flyLocalDirection(T.FORWARD.clone());
  20569. break;
  20570. case l.DOWNARROW:
  20571. case l.S:
  20572. this.flyLocalDirection(T.BACK.clone());
  20573. break;
  20574. case l.A:
  20575. this.flyLocalDirection(T.LEFT.clone());
  20576. break;
  20577. case l.D:
  20578. this.flyLocalDirection(T.RIGHT.clone())
  20579. }
  20580. }
  20581. ,
  20582. t.prototype.handleScrollPinchZoom = function(e) {
  20583. var t = e
  20584. , i = this.zoomLevel;
  20585. this.zoomBy(t),
  20586. this.currentPano && this.zoomStats.addZoomAction(i, this.zoomLevel, this.currentPano.id)
  20587. }
  20588. ,
  20589. t.prototype.handleControlPinch = function(e) {
  20590. k.zoom.enabled ? this.handleScrollPinchZoom(1 - e) : this.flyLocalDirection(new B.Vector3(0,0,e).normalize())
  20591. }
  20592. ,
  20593. t.prototype.handleControlScroll = function(e) {
  20594. k.zoom.enabled ? (0 < e ? e = 1 + this.scrollZoomSpeed : e < 0 && (e = 1 - this.scrollZoomSpeed),
  20595. 0 !== e && this.handleScrollPinchZoom(e)) : this.flyLocalDirection(new B.Vector3(0,0,-e).normalize())
  20596. }
  20597. ,
  20598. t.prototype.handleInputStart = function(e, t, i) {
  20599. var n = this.handelPadding(e, t);
  20600. e = n.x,
  20601. t = n.y,
  20602. this.isTouchEvent = i,
  20603. U.convertScreenPositionToNDC(e, t, this.mouse),
  20604. U.convertScreenPositionToNDC(e, t, this.mouseAtMouseDown),
  20605. this.mouseCouldBeClickToMove = !0,
  20606. this.mouseDown = !0,
  20607. this.mouseCouldBeClickToMove && window.Hotpoint && (new Hotpoint).state(this, C)
  20608. window.transformControls && transformControls.onPointerDown()
  20609. if(!this.overlayInitedPlay && this.overlayGroup.children.length){
  20610. try{
  20611. this.overlayGroup.children.forEach((overlay)=>{
  20612. overlay.overlayType == "video" && overlay.plane.material.map.image.play()
  20613. })
  20614. }catch(e){}
  20615. this.overlayInitedPlay = true
  20616. }
  20617. }
  20618. ,
  20619. t.prototype.handelPadding = function(e, t) {
  20620. return this.pad || (this.pad = {
  20621. x: dom.getOffset("left", $("#player")[0]),
  20622. y: dom.getOffset("top", $("#player")[0])
  20623. }),
  20624. {
  20625. x: e - this.pad.x,
  20626. y: t - this.pad.y
  20627. }
  20628. }
  20629. ,
  20630. t.prototype.handleInputMove = function(e, t, i) {
  20631. var n = this.handelPadding(e, t);
  20632. e = n.x,
  20633. t = n.y,
  20634. this.isTouchEvent = i,
  20635. U.convertScreenPositionToNDC(e, t, this.mouse);
  20636. var moveToleranceNDC = (window.transformControls && transformControls.visible) ? 0.0000001 : k.input.moveToleranceNDC
  20637. this.mouseAtMouseDown.distanceTo(this.mouse) > moveToleranceNDC && (this.mouseCouldBeClickToMove = !1,
  20638. this.couldBeLongTap = !1,
  20639. clearTimeout(this.mouseDownTimer)),
  20640. this.mouseLastMoveTime = Date.now(),
  20641. this.reticule.move(e, t, i)
  20642. window.transformControls && transformControls.onPointerMove()
  20643. }
  20644. ,
  20645. t.prototype.handleInputEnd = function(e, t, i) {
  20646. if (this.isTouchEvent = i,
  20647. this.mouseDown = !1,
  20648. this.cameraControls.controls[V.PANORAMA].emit("interaction.direct"),
  20649. !i && this.couldBeLongTap)
  20650. return !0;
  20651. if (this.handleLongTap())
  20652. return !0;
  20653. window.transformControls && transformControls.onPointerUp()
  20654. if (this.mouseCouldBeClickToMove) {
  20655. if (this.flying)
  20656. return this.path.activeTransType === R.WALK && this.emit(W.WarpInterruptedWithFlyTo, this.path.activeTransType),
  20657. !0;
  20658. //add----
  20659. if (this.checkHotClick())
  20660. return !0;
  20661. if (window.VisiSet && VisiSet.setPanoVisible) {//正在设置漫游可行
  20662. this.intersect && this.intersect.object.visible && VisiSet.dealPanoVisible(this.intersect.object.name);
  20663. return;
  20664. }
  20665. if (window.VisiSet && VisiSet.setTagVisible ) {
  20666. VisiSet.tagVsetting && this.intersect && this.intersect.object.visible && VisiSet.dealTagVisible(VisiSet.tagVsetting, this.intersect.object.name);
  20667. return;
  20668. }
  20669. if(this.hoveringPlane){
  20670. this.clickOverlay(this.hoveringPlane)
  20671. return;
  20672. }
  20673. if(window.EditOverlay && EditOverlay.objCursorType == "overlay"){
  20674. return EditOverlay.addPlane({intersect:this.intersect});
  20675. }
  20676. /* if(objects.mainDesign && objects.mainDesign.editing && objects.mainDesign.handleClickEnd(this)){//许钟文加
  20677. if(objects.mainDesign.editType == "wallDesign" && this.mode == "panorama") return !0;
  20678. else if(objects.mainDesign.editType == "addOverlay")return !0;
  20679. } */
  20680. //----------
  20681. if (this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.Move, this.isTouchEvent ? "touch" : "mouse"),
  20682. this.history.invalidate(),
  20683. this.intersect)
  20684. return this.flyToPanoClosestToMouse();
  20685. if (this.mode === V.PANORAMA) {
  20686. var n = this.closestPanoInDirection(this.getMouseDirection());
  20687. return n ? this.flyToPano({
  20688. pano: n
  20689. }) : this.bump(this.getMouseDirection())
  20690. }
  20691. }
  20692. this.intersect && this.closestPano && this.closestPano.hoverOff(this.mode)
  20693. }
  20694. ,
  20695. t.prototype.handleLongTap = function() {
  20696. if (this.couldBeLongTap && (!this.isPanoHover || this.mode !== V.PANORAMA))
  20697. return this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.LongTap, "touch"),
  20698. !0
  20699. }
  20700. ,
  20701. t.prototype.checktagClick = function() {
  20702. if (this.tagManager.intersectTag) {
  20703. var e = this.isTouchEvent
  20704. , t = this.tagManager.clickedOnTag(e, this);
  20705. return e || t || G.cancelById(q.LookTransition),
  20706. !0
  20707. }
  20708. if (this.tagManager.activeTag)
  20709. return this.tagManager.dismissActiveTag(),
  20710. !1
  20711. }
  20712. ,
  20713. t.prototype.rankedtagInDirection = function(e, t) {
  20714. return this.tagManager.rankedtagInDirection(e, this.position, this.camera, t)
  20715. }
  20716. ,
  20717. t.prototype.start = function(e) {
  20718. $(".toolLeft").removeClass("unable");
  20719. $(".toolTop").removeClass("unable");
  20720. //-------------------
  20721. window.initTransformCtl(B)
  20722. window.initOverlay(B)
  20723. this.model.loadOverlays()
  20724. window.EditOverlay && window.EditOverlay.init(B);
  20725. window.VisiSet && VisiSet.init()
  20726. //-------------------
  20727. var t = e.mode
  20728. , i = e.pano
  20729. , n = e.position
  20730. , r = e.quaternion
  20731. , o = e.tag
  20732. , a = e.quickstart
  20733. , s = $.Deferred();
  20734. this.updateModelDependentData(),
  20735. this.updateFromControls(),
  20736. this.findDefaultViews();
  20737. var l = this.is360View(t, i);
  20738. return !this.model.outsideAllowed() || l || a ? this.startInside(i, n, r, o, s) : this.startOutside(e, s),
  20739. s.done(function(e) {
  20740. this.emit(W.Ready, l, e, o)
  20741. }
  20742. .bind(this)),
  20743. s.promise()
  20744. }
  20745. ,
  20746. t.prototype.startOutside = function(e, t) {
  20747. var i = e.mode
  20748. , n = e.pano
  20749. , r = e.position
  20750. , o = e.quaternion
  20751. , a = e.zoom
  20752. , s = e.floorVisibility
  20753. , l = e.tag;
  20754. this.emit(W.StartOutside, k[i].transitionTime),
  20755. this.isOutsideMode(i) ? (this.model.warpDestFloors(s, !0),
  20756. G.cancelById(q.FlyToViewFloor),
  20757. i === V.FLOORPLAN ? this.floorplanMode(r, o, a) : this.dollhouseMode(r, o),
  20758. t.resolve(!1)) : this.startInsideWithFlyin(n, r, o, l, t)
  20759. }
  20760. ,
  20761. t.prototype.startInside = function(e, t, i, n, r) {
  20762. r = r || $.Deferred();
  20763. var o = (this.currentPano = e) && !e.isAligned();
  20764. if (t = o ? e.position : t || e.position,
  20765. i = i || e.quaternion,
  20766. e) {
  20767. var a = this.startInside.bind(this, e, t, i, n, r);
  20768. if (this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, a))
  20769. return
  20770. }
  20771. //add
  20772. this.transitionPos({type:"beforeFlytopano", pano:this.currentPano, dur:0})
  20773. return this.mode = V.PANORAMA,
  20774. e.floor.enter(this.mode),
  20775. this.emit(W.PanoChosen, this.currentPano, this.currentPano),
  20776. this.switchCameraMode(this.mode, i),
  20777. this.emit(W.StartInside, o),
  20778. r.resolve(!0),
  20779. r
  20780. }
  20781. ,
  20782. t.prototype.startInsideWithFlyin = function(i, e, n, t, r) {
  20783. if (r = r || $.Deferred(),
  20784. this.dollhouseMode(),
  20785. !i)
  20786. return Y.warn("Player.startInsideWithFlyin() -> targetPano is invalid."),
  20787. r.resolve(!1),
  20788. r;
  20789. e = e || i.position;
  20790. var o = n || this.cameraControls.activeControl.camera.quaternion
  20791. , a = i.position;
  20792. return this.fitDollhouse(a, e, o),
  20793. setTimeout(function(e) {
  20794. this.cameraControls.activeControl && (this.cameraControls.activeControl.maxDistance = e);
  20795. var t = {
  20796. mode: V.PANORAMA,
  20797. pano: i,
  20798. quaternion: n,
  20799. callback: function() {
  20800. this.emit(W.FlyinFinished),
  20801. r.resolve(!0)
  20802. }
  20803. .bind(this)
  20804. };
  20805. this.flyToNewMode(t)
  20806. }
  20807. .bind(this, this.cameraControls.activeControl.maxDistance), k.startupFlyinDelay),
  20808. r
  20809. }
  20810. ,
  20811. t.prototype.checkAndWaitForPanoLoad = (Z = {},
  20812. K = {},
  20813. function(t, e, i, n, r, o, a, s, l, c) {
  20814. if (function() {
  20815. for (var e in Z)
  20816. if (Z.hasOwnProperty(e) && Z[e] && performance.now() - K[e] < 5e3)
  20817. return !0;
  20818. return !1
  20819. }())
  20820. return !0;
  20821. var h = function(e, t, i) {
  20822. j.delayOneFrame(function() {
  20823. Z[e] = !1,
  20824. r && r(t, i)
  20825. }
  20826. .bind(this))
  20827. }
  20828. .bind(this, t.id)
  20829. , u = function(e, t) {
  20830. j.delayOneFrame(function() {
  20831. Z[e] = !1,
  20832. o && o(t)
  20833. }
  20834. .bind(this))
  20835. }
  20836. .bind(this, t.id);
  20837. try {
  20838. return null != s || (s = !0),
  20839. 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),
  20840. Z[t.id] && (K[t.id] = performance.now()),
  20841. Z[t.id]
  20842. } catch (e) {
  20843. throw Z[t.id] = !1,
  20844. K[t.id] = performance.now() - 5e3,
  20845. e
  20846. }
  20847. }
  20848. ),
  20849. t.prototype.checkAndWaitForWholePanoLoad = function(e, t, i, n, r) {
  20850. if (!e)
  20851. throw new p("Player.checkAndWaitForWholePanoLoad() -> Cannot load texture for null pano.");
  20852. return r && this.model.waitForLoad(e, function() {
  20853. return e.isLoaded(i)
  20854. }),
  20855. !e.isLoaded(t) && (e.loadCube(t).done(n),
  20856. !0)
  20857. }
  20858. ,
  20859. t.prototype.checkAndWaitForTiledPanoLoad = (X = new B.Vector3,
  20860. function(e, t, i, n, r, o, a, s) {
  20861. if (!e)
  20862. throw new p("Player.checkAndWaitForTiledPanoLoad() -> Cannot load texture for null pano.");
  20863. return X.copy(T.FORWARD),
  20864. this.getDirection(X),
  20865. !e.isLoaded(t) && (o && this.model.waitForLoad(e, function() {
  20866. return e.isLoaded(t)
  20867. }),
  20868. e.loadTiledPano(t, X, null, a, s).done(function(e, t) {
  20869. i && i(e, t)
  20870. }
  20871. .bind(this)).fail(function(e) {
  20872. n && n(e)
  20873. }
  20874. .bind(this)).progress(function(e, t, i) {
  20875. r && r(e, t, i)
  20876. }
  20877. .bind(this)),
  20878. !0)
  20879. }
  20880. ),
  20881. t.prototype.switchCameraMode = function(e, t) {
  20882. var i = this.cameraControls.controls[e]
  20883. , n = i.camera;
  20884. switch (e) {
  20885. case V.PANORAMA:
  20886. n.position.copy(this.currentPano.position);
  20887. var r = t ? T.FORWARD.clone().applyQuaternion(t) : this.getDirection().setY(0).normalize();
  20888. i.lookAt(r.add(n.position));
  20889. break;
  20890. case V.DOLLHOUSE:
  20891. /* var o = this.position.clone();
  20892. 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),
  20893. n.position.copy(o),
  20894. i.target.copy(this.target.clone().setY(this.model.center.y));
  20895. break; */
  20896. //for多楼层 且 让模型刚好适应屏幕
  20897. var box = this.model.boundingBox.clone();
  20898. box.applyMatrix4(this.camera.matrixWorld);//将 boundingbox、也就是模型, 转换到当前相机朝向
  20899. var boxSize = box.size() //其中boxSize.x是模型在当前相机视角下的横向宽度,当飞出后,该宽度要刚好占满窗口宽度
  20900. var fov = A.getHFOVFromVFOV(k.insideFOV, n.aspect, 1); //获得在当前窗口的横向的fov
  20901. var distance = Math.abs(boxSize.x) / 2 / Math.tan(THREE.Math.degToRad(fov / 2))//根据上面获得的参数得到target到相机的距离
  20902. console.log(boxSize.x,distance, boxSize.length() / 2)
  20903. distance += boxSize.length() / 2 //由于此时模型从中心向相机的部分由于近大远小仍超出屏幕,所以将target放在靠近模型靠近相机的这一端,故而再加上box的对角线长度的一半, 虽然本该加上Math.sqrt(boxSize.z*boxSize.z +boxSize.y+boxSize.y)/2,但是这样模型显得比较满
  20904. if(this.mode === V.PANORAMA){
  20905. i.target.copy(this.model.center);
  20906. var vec = this.getDirection().negate().setY(1).normalize()//获得朝向
  20907. }else{
  20908. i.target.copy(this.target.clone().setY(this.model.center.y))
  20909. var vec = T.DOWN.clone().applyQuaternion(this.quaternion).setY(1).normalize()
  20910. }
  20911. vec.multiplyScalar(distance )
  20912. n.position.copy(i.target.clone().add(vec))
  20913. break
  20914. case V.FLOORPLAN:
  20915. n.position.copy(this.model.center).setY(k.floorplan.cameraHeight),
  20916. i.target.copy(this.model.center).setY(0),
  20917. i.zoomToContain(this.model.size),
  20918. i.rotateToView(this.model.size, this.getDirection())
  20919. }
  20920. i.update(0)
  20921. }
  20922. ,
  20923. t.prototype.update = (new B.Vector3,
  20924. N = {},
  20925. F = [],
  20926. function(e) {
  20927. this.updatePersistentZooming(e),
  20928. this.updateFromControls(e),
  20929. this.getCurrentNodePanos(F)
  20930. if(this.hasChanged(N)){
  20931. this.lastChangeTime = Date.now(),
  20932. !this.mouseDown && this.containsMouse && this.updateIntersect()
  20933. this.emit(W.ViewChanged)
  20934. //add:
  20935. if (window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setTagVisible)) VisiSet.updateFootIconSize();
  20936. this.intersectHot && this.intersectHot.showTitle()
  20937. for(var i in this.model.hots){
  20938. this.model.hots[i].update(this.camera)
  20939. }
  20940. }
  20941. this.mode == "panorama" && window.cad && cad.setSign({ x: this.position.x, y: this.position.z },this.cameraControls.controls.panorama.lon);
  20942. this.model.supportsTiles && (this.updateTileDownloader(F),
  20943. this.updatePanoRenderer(F)),
  20944. this.updatePreRendering(F),
  20945. this.reticule.update(),
  20946. this.path.update(),
  20947. this.spider.update(),
  20948. this.cachedPanoCandidates && k.navigation.panoScores && this.model.panos.showPanoScores(this.cachedPanoCandidates),
  20949. this.updateControlLocks(),
  20950. this.model.supportsTiles && this.updateZoomPano()
  20951. }
  20952. ),
  20953. t.prototype.updatePersistentZooming = function(e) {
  20954. 1 === this.zooming ? this.zoomBy(1 + this.zoomSpeed * e) : -1 === this.zooming && this.zoomBy(1 - this.zoomSpeed * e)
  20955. }
  20956. ,
  20957. t.prototype.updateControlLocks = function() {
  20958. this.currentPano && this.model.supportsTiles && (this.cameraControls.controls[V.PANORAMA].locked = !this.currentPano.highestFullTileRenderOpCompleted && this.currentPano.lockUntilRenderingComplete)
  20959. }
  20960. ,
  20961. t.prototype.updatePanoRenderer = (D = new B.Vector3,
  20962. function(e) {
  20963. var t = this.nextPano || this.currentPano;
  20964. this.panoRenderer.hasQueuedTiles() && t && (D.copy(T.FORWARD),
  20965. this.getDirection(D),
  20966. this.panoRenderer.updateDirection(D))
  20967. }
  20968. ),
  20969. t.prototype.cleanupInactivePanos = (O = [],
  20970. L = [],
  20971. function() {
  20972. O.length = 0,
  20973. O.push(this.currentPano),
  20974. this.nextPano && O.push(this.nextPano);
  20975. for (var e = L.length = 0; e < this.panoRenderer.activePanos.length; e++)
  20976. L.push(this.panoRenderer.activePanos[e]);
  20977. for (var t = 0; t < L.length; t++) {
  20978. for (var i = L[t], n = !0, r = 0; r < O.length; r++)
  20979. i.id === O[r].id && (n = !1);
  20980. n && i.exit()
  20981. }
  20982. }
  20983. ),
  20984. t.prototype.updatePreRendering = (w = {},
  20985. function(e) {
  20986. if (1 === k.tiling.preRenderTourPanos && this.preRenderingEnabled) {
  20987. var t = this.nextPano || this.currentPano;
  20988. if (t && e && 1 < e.length) {
  20989. var i = e.findIndex(function(e) {
  20990. if (e.id === t.id)
  20991. return !0
  20992. });
  20993. if (0 <= i && i + 1 < e.length) {
  20994. var n = e[i + 1];
  20995. n.isLoaded(this.basePanoSize) || w[n.id] || (window.setTimeout(function(e) {
  20996. this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, null, null, null, !1, !1, !1),
  20997. window.setTimeout(function(e) {
  20998. w[e.id] = !1
  20999. }
  21000. .bind(this, e), k.tiling.panoPreRenderRepeatDelay)
  21001. }
  21002. .bind(this, n), k.tiling.panoPreRenderDelay),
  21003. w[n.id] = !0)
  21004. }
  21005. }
  21006. }
  21007. }
  21008. ),
  21009. t.prototype.enablePreRendering = function() {
  21010. this.preRenderingEnabled = !0
  21011. }
  21012. ,
  21013. t.prototype.disablePreRendering = function() {
  21014. this.preRenderingEnabled = !1,
  21015. this.cleanupInactivePanos()
  21016. }
  21017. ,
  21018. t.prototype.updateTileDownloader = (b = new B.Vector3,
  21019. function(e) {
  21020. var t = this.nextPano || this.currentPano;
  21021. t && (b.copy(T.FORWARD),
  21022. this.getDirection(b),
  21023. this.tileDownloader.tilePrioritizer.updateCriteria(t, this.position, b, 0 < e.length ? e : null),
  21024. this.tileDownloader.processPriorityQueue = !0)
  21025. }
  21026. ),
  21027. t.prototype.updateFromControls = function(e) {
  21028. null != e || (e = 0),
  21029. this.cameraControls.activeControl && (this.cameraControls.activeControl.update(e),
  21030. this.quaternion.copy(this.cameraControls.activeControl.camera.quaternion),
  21031. this.position.copy(this.cameraControls.activeControl.camera.position),
  21032. this.target.copy(this.cameraControls.activeControl.target),
  21033. this.cameraControls.activeControl.camera.updateProjectionMatrix(),
  21034. this.camera.projectionMatrix.copy(this.cameraControls.activeControl.camera.projectionMatrix)),
  21035. this.camera.position.copy(this.position),
  21036. this.camera.quaternion.copy(this.quaternion),
  21037. this.camera.updateMatrix(),
  21038. this.camera.updateMatrixWorld()
  21039. }
  21040. ,
  21041. t.prototype.hasChanged = function(e) {
  21042. if (!this.previousState)
  21043. return this.previousState = {
  21044. allFloorsVisible: this.model.allFloorsVisible,
  21045. position: this.position.clone(),
  21046. quaternion: this.quaternion.clone(),
  21047. mouse: this.mouse.clone(),
  21048. labelScaleFactor: this.getLabelScaleFactor(),
  21049. currentFloor: this.model.currentFloor,
  21050. projectionMatrix: this.camera.projectionMatrix.clone(),
  21051. worldMatrix: this.camera.matrixWorld.clone(),
  21052. mode: this.mode,
  21053. modelPosition: this.model.position.clone(),
  21054. modelCenter: this.model.center.clone(),
  21055. zoomLevel: this.zoomLevel
  21056. },
  21057. !0;
  21058. 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;
  21059. return e.allFloorsVisible = this.model.allFloorsVisible !== this.previousState.allFloorsVisible,
  21060. e.moved = !this.position.equals(this.previousState.position),
  21061. e.rotated = !this.quaternion.equals(this.previousState.quaternion),
  21062. e.mouseMoved = !this.mouse.equals(this.previousState.mouse),
  21063. e.labelScaleFactor = this.getLabelScaleFactor() !== this.previousState.labelScaleFactor,
  21064. e.floorChanged = this.model.currentFloor !== this.previousState.currentFloor,
  21065. e.cameraProjectionChanged = !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix),
  21066. e.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(this.previousState.worldMatrix),
  21067. e.modeChanged = this.mode !== this.previousState.mode,
  21068. e.modelPositionChanged = !this.model.position.equals(this.previousState.modelPosition),
  21069. e.modelCenterChanged = !this.model.center.equals(this.previousState.modelCenter),
  21070. e.nextPanoActive = null !== this.nextPano,
  21071. e.zoomLevel = this.zoomLevel !== this.previousState.zoomLevel,
  21072. this.previousState.allFloorsVisible = this.model.allFloorsVisible,
  21073. this.previousState.position.copy(this.position),
  21074. this.previousState.quaternion.copy(this.quaternion),
  21075. this.previousState.mouse.copy(this.mouse),
  21076. this.previousState.labelScaleFactor = this.getLabelScaleFactor(),
  21077. this.previousState.currentFloor = this.model.currentFloor,
  21078. this.previousState.projectionMatrix.copy(this.camera.projectionMatrix),
  21079. this.previousState.worldMatrix.copy(this.camera.matrixWorld),
  21080. this.previousState.mode = this.mode,
  21081. this.previousState.modelPosition.copy(this.model.position),
  21082. this.previousState.modelCenter.copy(this.model.center),
  21083. this.previousState.zoomLevel = this.zoomLevel,
  21084. !t
  21085. }
  21086. ,
  21087. t.prototype.updateIntersect = function() {
  21088. var e = this.flying || this.isWarping()
  21089. , t = this.isOutsideMode() && this.cameraControls.controls[this.mode].isEngaged()
  21090. , i = G.getById(q.LookTransition);
  21091. e || t || this.isTouchEvent || i.length && i[0].running;
  21092. if (window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setTagVisible)) {
  21093. this.intersect = this.getMouseIntersect(null, VisiSet.footIcons);
  21094. if (this.intersect && this.intersect.object.visible )
  21095. $("#player").css("cursor", "pointer");
  21096. else
  21097. $("#player").css("cursor", "")
  21098. return;
  21099. }
  21100. this.intersect = this.getMouseIntersect(),
  21101. this.intersect && this.updateClosestPano(this.intersect),
  21102. this.closestPano || this.closestPanoInDirection(this.getMouseDirection()) ? (this.reticule.updatePosition(this.position, this.intersect),
  21103. k.navigation.panoScores && !k.navigation.mouseDirection && this.closestPanoInDirection(this.getDirection())) : this.reticule.hide()
  21104. }
  21105. ,
  21106. t.prototype.checkHotClick = function() {
  21107. if (this.intersectHot){
  21108. if (window.VisiSet && VisiSet.setTagVisible ) {
  21109. VisiSet.SetOneTagVisible(this.intersectHot); //设置这个热点的可见性
  21110. return;
  21111. }
  21112. this.intersectHot.noAction || this.intersectHot.examine(this)
  21113. return !0
  21114. }
  21115. }
  21116. ,
  21117. t.prototype.getMouseDirection = function(e) {
  21118. e = e || this.mouse;
  21119. var t = new B.Vector3(e.x,e.y,-1).unproject(this.camera);
  21120. return new B.Vector3(e.x,e.y,1).unproject(this.camera).sub(t).normalize()
  21121. }
  21122. ,
  21123. t.prototype.hoverOverlay = function(mesh){
  21124. if(!mesh){
  21125. this.hoveringPlane = null;
  21126. $("#player").css("cursor",this.currentCursor || "" );
  21127. }else{
  21128. var overlay = mesh.parent;
  21129. $("#player").css("cursor","pointer");
  21130. this.hoveringPlane = overlay;
  21131. return true;
  21132. }
  21133. },
  21134. t.prototype.clickOverlay = function(overlay){
  21135. if(this.openOverlay && !overlay)return;
  21136. var plane = overlay.plane;
  21137. if(overlay.overlayType == "video"){
  21138. if(plane.material.map.image.paused)plane.material.map.image.play()
  21139. else plane.material.map.image.pause();
  21140. }
  21141. if(window.EditOverlay &&EditOverlay.editing){
  21142. if(EditOverlay.editPlane && overlay != EditOverlay.editPlane) EditOverlay.closeOverlayPanel('cancel')
  21143. $('#overlayProp').removeClass('atRight').removeClass('hide')
  21144. EditOverlay.endAddPlane();
  21145. EditOverlay.updateOverlayPanel(overlay)
  21146. transformControls.attach(overlay)
  21147. return;
  21148. }
  21149. },
  21150. t.prototype.getMouseIntersect = function(e, t) {
  21151. e = e || this.mouse.clone(),
  21152. t = t || this.model.floors.reduce(function(e, t) {
  21153. return t.hidden ? e : e.concat(t.collider.children)
  21154. }, this.mode === V.PANORAMA ? this.panoMarkers : []),
  21155. t = t.slice(0)
  21156. for (var i in this.model.hots) t.push(this.model.hots[i].mesh);
  21157. this.overlayGroup && (t = t.concat(this.overlayGroup.children));
  21158. i = new B.Vector3(e.x,e.y,-1).unproject(this.camera);
  21159. this.raycaster.set(i, this.getMouseDirection(e));
  21160. var n = this.raycaster.intersectObjects(t, true);//add true
  21161. if ("add" == g_HotStatus) {
  21162. var r = this.raycaster.intersectObjects(window.player.model.chunks);
  21163. //console.log(r[0]),
  21164. 1 <= r.length ? ($("#player").css("cursor", "cell"),
  21165. window.hotIntersect = r[0]) : ($("#player").css("cursor", "not-allowed"),
  21166. window.hotIntersect = !1)
  21167. return;
  21168. }
  21169. this.intersectHot && this.intersectHot.hideTitle()
  21170. if (0 === n.length)
  21171. return this.intersectHot = null,
  21172. "add" != g_HotStatus && $("#player").css("cursor", ""),
  21173. null;
  21174. var o = n[0];
  21175. if ("hotSprite" == o.object.type){
  21176. this.intersectHot = o.object.belongHot
  21177. this.intersectHot.showTitle()
  21178. $(`.toolRight .spotList ul li[data-spid=${this.intersectHot.sid}]`).addClass("active")
  21179. this.intersectHot.noAction || $("#player").css("cursor", "pointer");
  21180. return;
  21181. }
  21182. $(".toolRight .spotList ul li").removeClass("active")
  21183. this.intersectHot = null;
  21184. /* if(window.EditOverlay && n && n.length){
  21185. if(n[0].object.parent.parent == this.overlayGroup){
  21186. this.hoverOverlay(n[0].object);
  21187. }else()
  21188. } */
  21189. var intersect = this.hoverOverlay(this.overlayGroup && o && o.object.parent.parent == this.overlayGroup && o.object)
  21190. intersect || "add" != g_HotStatus && $("#player").css("cursor", this.currentCursor),
  21191. o.face && (o.normal = o.face.normal.applyQuaternion(o.object.quaternion),
  21192. this.position.clone().sub(o.point).dot(o.normal) < 0 && o.normal.negate(),
  21193. this.currentPano ? o.onFloor = o.point.y < this.position.y - .5 * this.currentPano.height : o.onFloor = o.point.y < this.position.y - .5,
  21194. o.horizontal = .8 < o.normal.y);
  21195. return o
  21196. }
  21197. ,
  21198. t.prototype.updateClosestPano = function(e) {
  21199. var t = [a.filters.isPanoAligned()];
  21200. if (this.mode === V.PANORAMA) {
  21201. if (!this.currentPano)
  21202. return;
  21203. t.push(a.filters.not(this.currentPano)),
  21204. t.push(a.filters.inFloorDirection(this.currentPano.floorPosition, this.getDirection(), .25)),
  21205. t.push(a.filters.isNeighbourPanoTo(this.currentPano)),
  21206. t.push(a.filters.isCloseEnoughTo(e.point, k.panoFloorClickRadius)),
  21207. t.push(a.filters.isNotBehindNormal(e.point, e.normal))
  21208. } else{
  21209. t.push((pano)=>{ // add
  21210. return this.checkHasNeighbor(pano)
  21211. })
  21212. t.push(a.filters.isOnVisibleFloor()),
  21213. this.mode !== V.FLOORPLAN && t.push(a.filters.inDirection(this.position, this.getDirection(), .25));
  21214. }
  21215. var i = this.model.panos.find(t, [a.sortFunctions.floorDistanceToPoint(e.point)]);
  21216. i !== this.closestPano ? (i && (this.isPanoHover = !0),
  21217. this.emit(W.ClosestPanoChanging, this.closestPano, i, this.mode),
  21218. this.closestPano = i) : this.isPanoHover = !1
  21219. }
  21220. ,
  21221. t.prototype.dollhouseMode = function(e, t) {
  21222. this.emit(W.ModeChanging, this.mode, V.DOLLHOUSE),
  21223. this.mode = V.DOLLHOUSE,
  21224. this.cameraControls.controls[V.DOLLHOUSE].reset();
  21225. var i = new B.Vector3(this.model.center.x,0,this.model.center.z)
  21226. , n = new B.Vector3(15,10,15);
  21227. if (e && t) {
  21228. var r = T.FORWARD.clone().applyQuaternion(t)
  21229. , o = this.model.center.clone().sub(e).dot(r);
  21230. 0 < o ? (i = r.clone().multiplyScalar(o).add(e),
  21231. n.copy(e)) : Y.warn("Tried to initiate dollhouse mode that wasn't looking at the model", e, t)
  21232. }
  21233. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(0, !0),
  21234. this.cameraControls.controls[V.DOLLHOUSE].target.copy(i),
  21235. this.cameraControls.cameras[V.DOLLHOUSE].position.copy(n),
  21236. this.updateFromControls(),
  21237. this.model.alpha = 1,
  21238. this.model.skybox.material.uniforms.opacity.value = 0
  21239. }
  21240. ,
  21241. t.prototype.insideMode = function(e, t) {
  21242. var i = $.Deferred()
  21243. , n = t || null;
  21244. if (this.mode !== V.PANORAMA && this.mode !== V.TRANSITIONING) {
  21245. var r = [a.filters.isPanoAligned()];
  21246. this.model.currentFloor && r.push(a.filters.atFloor(this.model.currentFloor)),
  21247. e = e || this.currentPano || this.model.panos.find(r, [a.sortFunctions.distanceToPoint(this.cameraControls.activeControl.target)]),
  21248. this.flyToNewMode({
  21249. mode: V.PANORAMA,
  21250. pano: e,
  21251. callback: n
  21252. }).done(i.resolve.bind(i)).fail(i.reject.bind(i))
  21253. } else {
  21254. var o = this.mode === V.PANORAMA ? "Already in panorama mode" : "Cannot change mode during mode transition";
  21255. i.reject(o)
  21256. }
  21257. return i.promise()
  21258. }
  21259. ,
  21260. t.prototype.fitDollhouse = function(e, t, i) {
  21261. var maxY = this.model.boundingBox.max.y;//add
  21262. var n = T.FORWARD.clone().applyQuaternion(i);
  21263. i = n.clone().add(e);
  21264. this.cameraControls.activeControl.target.copy(i),
  21265. this.cameraControls.activeControl.camera.position.set(0, maxY * 2.4, 0).add(e).add(n.multiplyScalar(-10))
  21266. }
  21267. ,
  21268. t.prototype.floorplanMode = function(e, t, i) {
  21269. this.mode = V.FLOORPLAN;
  21270. var n = this.cameraControls.controls[V.FLOORPLAN];
  21271. n.reset();
  21272. var r = e || this.model.center;
  21273. if (n.target.copy(r).setY(0),
  21274. n.camera.position.copy(r).setY(k.floorplan.cameraHeight),
  21275. i ? (n.currentScale = i / ($("#player").width() / $("#player").height()),
  21276. n.absoluteScale = n.currentScale) : n.zoomToContain(this.model.size),
  21277. t) {
  21278. var o = T.LEFT.clone().applyQuaternion(t);
  21279. n.rotateLeft(-Math.atan2(o.x, o.z))
  21280. } else
  21281. n.rotateToView(this.model.size, this.getDirection());
  21282. n.update(0)
  21283. }
  21284. ,
  21285. t.prototype.nonInterruptingFlyToPano = function(e, t) {
  21286. return e.skipWarpingCheck = !0,
  21287. this.flyToPano(e, t)
  21288. }
  21289. ,
  21290. t.prototype.updateMarkerVisi = function() {//加
  21291. if(this.mode != "panorama")return;
  21292. this.model.panos.list.forEach((pano)=>{
  21293. if(!pano.marker)return;
  21294. pano.marker.material.visible = !!pano.neighbourPanos[this.currentPano.id];
  21295. })
  21296. }
  21297. ,
  21298. t.prototype.updateHotVisible = function(pano){
  21299. var hots = this.model.hots;
  21300. pano = pano || this.currentPano;
  21301. for (var index in hots){
  21302. var visible;
  21303. if(this.mode != "panorama"){
  21304. visible = true;
  21305. }else{
  21306. //hots[index].mesh.material.depthTest = false;
  21307. visible = !hots[index].visiblePanos || hots[index].visiblePanos.indexOf(pano.id) > -1
  21308. }
  21309. hots[index].mesh.visible = visible;
  21310. }
  21311. },
  21312. t.prototype.flyToPano = function(e, t) {
  21313. 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;
  21314. if (window.specialScene && specialScene.special().specifySpot && specialScene.special().specifySpot(n),
  21315. this.isWarping() && !l && (this.path.activeTransType === R.BLACK || this.path.activeTransType === R.STD))
  21316. return Y.warn("Player.flyToPano() -> Cannot fly when warping"),
  21317. t && t(),
  21318. !1;
  21319. if (this.updateLastView(),
  21320. this.mode !== V.PANORAMA)
  21321. return r && (i = (new B.Quaternion).setFromUnitVectors(T.FORWARD, r.sub(n.position).normalize())),
  21322. void this.flyToNewMode({
  21323. mode: V.PANORAMA,
  21324. pano: n,
  21325. duration: o,
  21326. quaternion: i,
  21327. callback: t
  21328. });
  21329. if (!n || (h = x.deepExtend(e),
  21330. u = function() {
  21331. j.delayOneFrame(function() {
  21332. this.flyToPano(h, t)
  21333. }
  21334. .bind(this))
  21335. }
  21336. .bind(this),
  21337. !this.checkAndWaitForPanoLoad(n, "high", "low", this.basePanoSize, u))) {
  21338. var d = function(e) {
  21339. t && t(e)
  21340. }
  21341. .bind(this);
  21342. this.currentPano || (this.currentPano = n,
  21343. this.path.placeCpm(),
  21344. this.path.fadeOutCpm(k.path.fadeOutTime),
  21345. this.spider.draw());
  21346. var p = o;
  21347. if ("number" != typeof o) {
  21348. var f = s || k.transition.flytimeMaxDistanceThreshold;
  21349. p = Math.min(this.currentPano.position.distanceTo(n.position), f) * k.transition.flytimeDistanceMultiplier + k.transition.flyTime
  21350. }
  21351. if (.01 < k.transition.flySpeed && (p = 1e3 * this.currentPano.position.distanceTo(n.position) / k.transition.flySpeed),
  21352. 1 !== this.zoomLevel)
  21353. switch (k.zoom.transitionStyle) {
  21354. case 1:
  21355. this.smoothZoomToDefault(p / 2);
  21356. break;
  21357. case 2:
  21358. return h = x.deepExtend(e),
  21359. u = this.flyToPano.bind(this, h, t),
  21360. void this.smoothZoomToDefault(k.zoom.restoreTime * (this.zoomLevel - 1), u)
  21361. }
  21362. if (r) {
  21363. G.cancelById(q.LookTransition),
  21364. p *= k.transition.aimSlowFactor;
  21365. var g = this.cameraControls.activeControl.camera.quaternion.clone()
  21366. , m = (new B.Matrix4).lookAt(n.position, r, T.UP)
  21367. , v = (new B.Quaternion).setFromRotationMatrix(m)
  21368. , y = g.clone()
  21369. , A = new B.Vector3;
  21370. if (n === this.currentPano) {
  21371. var C = T.FORWARD.clone().applyQuaternion(g)
  21372. , I = T.FORWARD.clone().applyQuaternion(v)
  21373. , E = C.angleTo(I);
  21374. return null != a || (a = 1 * Math.sqrt(E) / k.tags.navigate.rotateSpeedFactor * 1e3),
  21375. void G.start(function(e) {
  21376. y.copy(g),
  21377. H.quaternion(y, v)(e),
  21378. A.copy(T.FORWARD).applyQuaternion(y).add(this.cameraControls.activeControl.camera.position),
  21379. this.cameraControls.activeControl.lookAt(A)
  21380. }
  21381. .bind(this), a, d, 0, z[k.transition.movementEasing], null, q.LookTransition)
  21382. }
  21383. }
  21384. if (n === this.currentPano || this.flying)
  21385. return void d();
  21386. this.flying = !0;
  21387. var _ = this.position.clone()
  21388. , b = this.currentPano;
  21389. Y.debug("Flying to pano ", n.position);
  21390. this.emit(W.PanoChosen, this.currentPano, n);
  21391. this.emit(W.FlyingStarted, n.position, _, n, b);
  21392. this.updateHotVisible(n); //更新热点显示
  21393. this.transitionPos({type:"beforeFlytopano", pano:n, dur:p})//add
  21394. r && G.start(function(e) {
  21395. y.copy(g),
  21396. H.quaternion(y, v)(e),
  21397. A.copy(T.FORWARD).applyQuaternion(y).add(this.cameraControls.activeControl.camera.position),
  21398. this.cameraControls.activeControl.lookAt(A)
  21399. }
  21400. .bind(this), p, null, 0, z[k.transition.movementEasing], null, q.LookTransition);
  21401. var w = c ? null : z[k.transition.movementEasing];
  21402. this.nextPano = n;
  21403. G.start(H.uniform(this.model.skybox, "progress", 1), p, null, 0, z[k.transition.blendEasing], "skyFly", q.FlyToPano),
  21404. G.start(H.allUniforms(this.model.chunks, "progress", 1), p, null, 0, z[k.transition.blendEasing], "chunkFly", q.FlyToPano),
  21405. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, n.position), p, function(e) {
  21406. this.flying = !1,
  21407. this.currentPano !== n && this.currentPano.exit(),
  21408. n.enter(),
  21409. this.currentPano = n,
  21410. this.nextPano = null,
  21411. this.path.placeCpm(),
  21412. this.path.fadeOutCpm(k.path.fadeOutTime),
  21413. this.spider.draw(),
  21414. this.emit(W.FlyingEnded, n.position, _, n, b),
  21415. this.updateMarkerVisi();//add
  21416. d(e)
  21417. if(this.mode == "panorama" && EditOverlay.editing){
  21418. EditOverlay.updatePano(this.currentPano)
  21419. }
  21420. }
  21421. .bind(this), 0, w, "camFly", q.FlyToPano)
  21422. }
  21423. }
  21424. ,
  21425. window._transitionPosId = 9999
  21426. t.prototype.transitionPos = function(o={}) {//渐变overlay和热点的位置
  21427. G.cancelById(_transitionPosId)
  21428. var begin = function(object, pos, qua, scale){
  21429. if(pos){
  21430. if(!same(object.position, pos, 0.01)){
  21431. G.start(H.vector(object.position, pos), o.dur, (e)=>{
  21432. },0, z[k.transition.movementEasing], "transitionPos", _transitionPosId)
  21433. }
  21434. if(!same(object.quaternion, qua, 1e-6)){
  21435. G.start(H.quaternion(object.quaternion, qua), o.dur, (e)=>{
  21436. },0, z[k.transition.movementEasing], "transitionPos", _transitionPosId)
  21437. }
  21438. if(!same(object.scale, scale, 0.001)){
  21439. G.start(H.vector(object.scale, scale), o.dur, (e)=>{
  21440. },0, z[k.transition.movementEasing], "transitionPos", _transitionPosId)
  21441. }
  21442. }
  21443. }
  21444. var same = function(vec1, vec2, diff){
  21445. var s = Math.abs(vec1.x-vec2.x) < diff && Math.abs(vec1.y-vec2.y) < diff && Math.abs(vec1.z-vec2.z) < diff
  21446. if(s && vec1.w) s = Math.abs(vec1.w-vec2.w) < diff
  21447. return s
  21448. }
  21449. this.overlayGroup.children.forEach(overlay=>{
  21450. var panoData = o.pano != void 0 && overlay.transformAtPanos[o.pano.id]
  21451. var useCustom = o.type == "beforeFlyOut" || !panoData
  21452. var pos = useCustom ? overlay.posCustom : panoData.pos;
  21453. var qua = useCustom ? overlay.quaCustom : panoData.qua;
  21454. var scale = useCustom ? overlay.getScaleBySize(overlay.widthCustom, overlay.heightCustom) :
  21455. overlay.getScaleBySize(panoData.width , panoData.height)
  21456. scale = new THREE.Vector3(scale.x, scale.y, overlay.scale.z)
  21457. begin(overlay, pos, qua, scale )
  21458. })
  21459. }
  21460. t.prototype.fastForwardActivePanoFlight = function(e) {
  21461. e = e || k.transition.fastForwardFactor / 10 * 4 + 1,
  21462. G.adjustSpeed(q.FlyToPano, e),
  21463. G.adjustSpeed(q.LookTransition, e)
  21464. }
  21465. ,
  21466. t.prototype.flyToPanoClosestToMouse = function() {
  21467. if (50 < Date.now() - this.mouseLastMoveTime && (this.intersect = this.getMouseIntersect(),
  21468. this.intersect && this.updateClosestPano(this.intersect)),
  21469. this.closestPano)
  21470. return this.flyToPano({
  21471. pano: this.closestPano
  21472. });
  21473. var e = this.getMouseDirection();
  21474. this.flyDirection(e) || this.flyToPano({
  21475. pano: this.currentPano
  21476. })
  21477. }
  21478. ,
  21479. t.prototype.flyLocalDirection = function(e) {
  21480. var t = this.getDirection(e)
  21481. , i = 1 === e.z ? .4 : .75
  21482. , n = 1 === Math.abs(e.x);
  21483. return this.flyDirection(t, i, n)
  21484. }
  21485. ,
  21486. t.prototype.flyDirection = function(e, t, i) {
  21487. this.closePopup();
  21488. var n = $.Deferred();
  21489. this.history.invalidate();
  21490. var r = this.closestPanoInDirection(e, t, i);
  21491. return r ? this.flyToPano({
  21492. pano: r
  21493. }, n.resolve.bind(n, !0)) : (this.bump(e),
  21494. n.resolve(!1)),
  21495. n.promise()
  21496. }
  21497. ,
  21498. t.prototype.closestPanoInDirection = function(e, t, i) {
  21499. return this.rankedPanoInDirection(0, e, t, i)
  21500. }
  21501. ,
  21502. t.prototype.rankedPanoInDirection = (_ = {
  21503. pano: null,
  21504. candidates: []
  21505. },
  21506. function(e, t, i, n) {
  21507. e = e || 0,
  21508. i = void 0 !== i ? i : .75;
  21509. var r = n ? "angle" : "direction";
  21510. 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)], _),
  21511. this.cachedPanoCandidates = _.candidates,
  21512. _.pano
  21513. }
  21514. ),
  21515. t.prototype.bump = function(e) {
  21516. if (this.mode === V.PANORAMA && !this.flying && !this.isWarping()) {
  21517. var t, i, n, r = k.transition, o = (r.flytimeMaxDistanceThreshold * r.flytimeDistanceMultiplier + r.flyTime) / 8, a = this.camera.getWorldDirection().dot(e);
  21518. if (.5 < Math.abs(a))
  21519. t = function() {
  21520. G.start(H.property(this.cameraControls.cameras[V.PANORAMA], "zoom", 0 < a ? 1.04 : .96), o, i, 0, z.easeInOutSine, "bumpZStart")
  21521. }
  21522. .bind(this),
  21523. i = function() {
  21524. G.start(H.property(this.cameraControls.cameras[V.PANORAMA], "zoom", 1), 5 * o, n, 0, z.easeInOutSine, "bumpZRelax")
  21525. }
  21526. .bind(this);
  21527. else {
  21528. var s = this.camera.position.clone()
  21529. , l = e.clone();
  21530. this.raycaster.set(s, l);
  21531. var c = this.model.floors.reduce(function(e, t) {
  21532. return e.concat(t.collider.children)
  21533. }, [])
  21534. , h = this.raycaster.intersectObjects(c)
  21535. , u = 0 < h.length ? h[0].distance / 25 : .04
  21536. , d = s.clone().add(l.multiplyScalar(u));
  21537. t = function() {
  21538. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, d), o, i, 0, z.easeInOutSine, "bumpTStart")
  21539. }
  21540. .bind(this),
  21541. i = function() {
  21542. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, s), 5 * o, n, 0, z.easeInOutSine, "bumpTRelax")
  21543. }
  21544. .bind(this)
  21545. }
  21546. n = function() {
  21547. this.flying = !1
  21548. }
  21549. .bind(this),
  21550. this.flying = !0,
  21551. t()
  21552. }
  21553. }
  21554. ,
  21555. t.prototype.changeFloor = function(e) {
  21556. if (!this.is360View(this.mode, this.currentPano))
  21557. if (this.mode === V.PANORAMA) {
  21558. var t = this.history.reversePano(e);
  21559. t && t.isAligned() ? this.flyToPano({
  21560. pano: t
  21561. }) : this.changeFloorByScore(e)
  21562. } else
  21563. this.model.setFloor(this.model.nextFloor(e) || this.model.currentFloor)
  21564. }
  21565. ,
  21566. t.prototype.changeFloorByScore = (E = {
  21567. pano: null,
  21568. candidates: []
  21569. },
  21570. function(e) {
  21571. var t = this.model.nextFloor(e);
  21572. 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),
  21573. void (E.pano ? (this.cachedPanoCandidates = E.candidates,
  21574. this.history.push(e, this.currentPano),
  21575. this.flyToPano({
  21576. pano: E.pano
  21577. })) : Y.warn("No pano found on selected floor, not moving there."))) : void Y.debug("player.changeFloor(" + e + "): no such floor")
  21578. }
  21579. ),
  21580. t.prototype.gotoFloor = function(e) {
  21581. var t = e - this.model.currentFloor.floorIndex;
  21582. this.changeFloor(t)
  21583. }
  21584. ,
  21585. t.prototype.getDirection = function(e) {
  21586. return (e = e || (new B.Vector3).copy(T.FORWARD)).applyQuaternion(this.camera.quaternion)
  21587. }
  21588. ,
  21589. t.prototype.flyToSameMode = function(e, t, i, n, r) {
  21590. if (r = r || $.Deferred(),
  21591. this.mode === V.TRANSITIONING)
  21592. return Y.warn("should not be transitioning here"),
  21593. n && n(!1),
  21594. r.reject().promise();
  21595. var o = i || !1
  21596. , a = i ? i.position : this.position
  21597. , s = this.position.clone()
  21598. , l = this.currentPano;
  21599. if (Y.debug("New pose in mode " + this.mode),
  21600. !e || (retryCallback = function() {
  21601. j.delayOneFrame(function() {
  21602. this.flyToSameMode(e, t, i, n, r)
  21603. }
  21604. .bind(this))
  21605. }
  21606. .bind(this),
  21607. !this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, retryCallback))) {
  21608. var c = function() {
  21609. this.emit(W.FlyingEnded, a, s, e, l),
  21610. n && n(!0)
  21611. }
  21612. .bind(this)
  21613. , h = k[this.mode]
  21614. , u = void 0 !== t ? t : h.transitionTime
  21615. , d = new B.Vector3
  21616. , p = new B.Vector3;
  21617. if (this.emit(W.FlyingStarted, a, s, e, l),
  21618. this.mode === V.PANORAMA)
  21619. Y.warn("we should not be here for panorama views");
  21620. else if (this.mode === V.DOLLHOUSE)
  21621. if (o) {
  21622. var f = new B.Vector3(0,1,0);
  21623. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(1, !0),
  21624. this.model.warpDestFloors(i.floorVisibility),
  21625. p.copy(i.position);
  21626. var g = new B.Vector3(0,0,-1).applyQuaternion(i.quaternion)
  21627. , m = new B.Raycaster(p.clone(),g.clone(),0,1 / 0).intersectObjects(this.model.colliders)
  21628. , v = 3;
  21629. m.length ? (d.copy(m[0].point),
  21630. v = .75 * p.distanceTo(d)) : (d.copy(g).multiplyScalar(3).add(p),
  21631. Y.debug("Tried to restore dollhouse mode that did not intersect...", i.position, i.quaternion));
  21632. var y = (new B.Matrix4).lookAt(p, d, f)
  21633. , A = (new B.Euler).setFromRotationMatrix(y, k.warp.eOrder)
  21634. , C = d.distanceTo(p)
  21635. , I = (new B.Matrix4).lookAt(this.cameraControls.cameras[V.DOLLHOUSE].position, this.cameraControls.controls[V.DOLLHOUSE].target, f)
  21636. , E = (new B.Euler).setFromRotationMatrix(I, k.warp.eOrder)
  21637. , _ = this.cameraControls.cameras[V.DOLLHOUSE].position.distanceTo(this.cameraControls.controls[V.DOLLHOUSE].target);
  21638. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(Math.min(_, v), !0);
  21639. var b = new B.Euler(A.x - E.x,A.y - E.y,A.z - E.z,k.warp.eOrder);
  21640. b.y = b.y > Math.PI ? b.y -= 2 * Math.PI : b.y < -Math.PI ? b.y += 2 * Math.PI : b.y,
  21641. this.path.burnsDir = Math.sign(b.y);
  21642. var w = new B.Euler(0,0,0,k.warp.eOrder)
  21643. , T = new B.Vector3;
  21644. G.start(H.vector(this.cameraControls.controls[V.DOLLHOUSE].target, d), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode),
  21645. G.start(function(e, t) {
  21646. w.x = E.x + e * b.x,
  21647. w.y = E.y + e * b.y,
  21648. w.z = E.z + e * b.z;
  21649. var i = _ + e * (C - _);
  21650. T.set(0, 0, i).applyEuler(w).add(this.cameraControls.controls[V.DOLLHOUSE].target),
  21651. this.cameraControls.cameras[V.DOLLHOUSE].position.copy(T).add(this.model.position)
  21652. }
  21653. .bind(this), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode),
  21654. G.start(function(e, t) {
  21655. this.cameraControls.controls[V.DOLLHOUSE].update(),
  21656. this.quaternion.copy(this.cameraControls.cameras[V.DOLLHOUSE].quaternion),
  21657. this.position.copy(this.cameraControls.cameras[V.DOLLHOUSE].position)
  21658. }
  21659. .bind(this), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode)
  21660. } else
  21661. Y.warn("invalid warp destination in flyToSameMode()? ignore it then");
  21662. else if (this.path.placeCpm(),
  21663. this.path.fadeInCpm(k.path.fadeInTime),
  21664. i) {
  21665. this.model.warpDestFloors(i.floorVisibility);
  21666. var x = this.cameraControls.cameras[V.FLOORPLAN]
  21667. , S = this.cameraControls.controls[V.FLOORPLAN]
  21668. , M = S.target.clone()
  21669. , R = i.position.clone().sub(M)
  21670. , P = x.position.clone().sub(S.target).length()
  21671. , O = new B.Vector3(-1,0,0).applyQuaternion(i.quaternion).normalize()
  21672. , L = Math.atan2(S.offset.x, S.offset.z)
  21673. , D = Math.atan2(O.x, O.z)
  21674. , N = S.absoluteScale
  21675. , F = U.convertWorkshopOrthoZoom(i.orthoZoom);
  21676. G.start(function(e, t) {
  21677. S.target.copy(R).multiplyScalar(e).add(M);
  21678. var i = L + (D - L) * e;
  21679. S.offset.x = P * Math.sin(i),
  21680. S.offset.z = P * Math.cos(i),
  21681. x.position.copy(S.target).add(S.offset),
  21682. S.absoluteScale = N + e * (F - N),
  21683. S.update(),
  21684. this.quaternion.copy(x.quaternion),
  21685. this.position.copy(x.position),
  21686. this.target.copy(S.target),
  21687. this.camera.projectionMatrix.copy(x.projectionMatrix)
  21688. }
  21689. .bind(this), u, null, 0, z[k.flydown.movementEasing], null, q.FlyToSameMode)
  21690. } else
  21691. Y.info("flyToSameMode() funny floorplan view? skipping");
  21692. return G.setTimeout(function(e) {
  21693. this.mode = e,
  21694. c(),
  21695. r.resolve(!0)
  21696. }
  21697. .bind(this, this.mode), u, q.FlyToSameMode),
  21698. this.mode = V.TRANSITIONING,
  21699. r.promise()
  21700. }
  21701. }
  21702. ,
  21703. t.prototype.flyToNewMode = function(e, t) {
  21704. var i = (e = e || {}).mode
  21705. , n = e.pano
  21706. , r = e.duration
  21707. , o = e.warpDest
  21708. , a = e.callback
  21709. , s = e.force
  21710. , l = e.quaternion;
  21711. if (t = t || $.Deferred(),
  21712. this.isWarping())
  21713. return Y.warn("Player.flyToNewMode() -> Cannot fly when warping"),
  21714. a && a(!1),
  21715. t.reject("Cannot change mode during tour transition").promise();
  21716. if (this.mode === V.TRANSITIONING)
  21717. return a && a(!1),
  21718. t.reject("Cannot change mode during mode transition").promise();
  21719. if (i === this.mode)
  21720. return s ? (this.flyToSameMode(n, r, o, a).done(t.resolve.bind(t)).fail(t.reject.bind(t)),
  21721. t.promise()) : (a && a(!1),
  21722. t.reject("Already in " + i + " mode").promise());
  21723. var c = o || !1;
  21724. Y.debug("Switching mode to " + i);
  21725. var h = function() {
  21726. j.delayOneFrame(function() {
  21727. this.flyToNewMode(e, t)
  21728. }
  21729. .bind(this))
  21730. }
  21731. .bind(this);
  21732. if (n && this.checkAndWaitForPanoLoad(n, "low", "low", this.basePanoSize, h))
  21733. return t.promise();
  21734. if (!this.model.meshTexturesLoaded && this.isOutsideMode(i))
  21735. return Y.info("Waiting for model textures to be loaded before going out to dollhouse"),
  21736. this.model.waitForLoad(this.model, function() {
  21737. return this.model.meshTexturesLoaded
  21738. }
  21739. .bind(this)),
  21740. this.model.loadMeshTextures().done(h),
  21741. t.promise();
  21742. this.history.invalidate(),
  21743. this.updateLastView();
  21744. var u = this.mode
  21745. , d = this.cameraControls.cameras[i];
  21746. e = x.deepExtend({}, k[i], k[u + "-" + i]);
  21747. var p = void 0 !== r ? r : e.transitionTime;
  21748. this.emit(W.ModeChanging, u, i, n),
  21749. n && (this.currentPano = n),
  21750. this.switchCameraMode(i, l),
  21751. G.cancelById(q.LookTransition);
  21752. var f = (new B.Vector3).copy(this.position);
  21753. this.modeTran = this.mode + "-" + i;
  21754. if(this.mode == "floorplan" && window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setTagVisible)){
  21755. VisiSet.finishSetPanoVisible()
  21756. VisiSet.finishSetTagVisible()
  21757. }
  21758. if(editTool.atPanel == "screen"){
  21759. if(this.mode == "panorama") $(".confirmSnap").addClass("unable")
  21760. else if(i == "panorama") $(".confirmSnap").removeClass("unable")
  21761. }
  21762. if(i == "panorama"){
  21763. this.transitionPos({type:"beforeFlyIn", pano:n, dur:p})//add
  21764. }else{
  21765. this.transitionPos({type:"beforeFlyOut", dur:p/2})//add
  21766. }
  21767. if (i === V.PANORAMA)
  21768. this.emit(W.PanoChosen, n, n),
  21769. setTimeout(function() {
  21770. n.floor.enter(i)
  21771. }
  21772. .bind(this), p / 2),
  21773. this.path.fadeOutCpm(k.path.fadeOutTime);
  21774. else if (i === V.DOLLHOUSE) {
  21775. if (c && (this.model.stayPut = !0),
  21776. o ? (this.cameraControls.controls[V.DOLLHOUSE].resetRanges(1, !0),
  21777. this.model.warpDestFloors(o.floorVisibility)) : this.model.toggleAllFloors(!0),
  21778. this.path.placeCpm(),
  21779. this.path.fadeInCpm(k.path.fadeInTime),
  21780. c) {
  21781. var g = new B.Vector3(this.model.center.x,0,this.model.center.z);
  21782. f.set(15, 10, 15);
  21783. var m = new B.Vector3(0,0,-1).applyQuaternion(o.quaternion)
  21784. , v = new B.Raycaster(o.position.clone(),m.clone(),0,1 / 0).intersectObjects([this.sceneIntersectionPlane]);
  21785. v.length ? (g.copy(v[0].point),
  21786. f.copy(o.position),
  21787. 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),
  21788. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(3, !0)),
  21789. this.cameraControls.controls[V.DOLLHOUSE].target.copy(g),
  21790. f.add(this.model.position),
  21791. d.position.copy(f),
  21792. this.cameraControls.controls[V.DOLLHOUSE].update()
  21793. }
  21794. } else if (this.path.placeCpm(),
  21795. this.path.fadeInCpm(k.path.fadeInTime),
  21796. o) {
  21797. this.model.warpDestFloors(o.floorVisibility);
  21798. var y = this.cameraControls.cameras[V.FLOORPLAN]
  21799. , A = this.cameraControls.controls[V.FLOORPLAN]
  21800. , C = y.position.clone().sub(A.target)
  21801. , I = new B.Vector3(-1,0,0).applyQuaternion(o.quaternion).normalize()
  21802. , E = Math.atan2(I.x, I.z);
  21803. A.target.copy(o.position);
  21804. var _ = C.length();
  21805. A.offset.x = _ * Math.sin(E),
  21806. A.offset.y = 0,
  21807. A.offset.z = _ * Math.cos(E),
  21808. y.position.copy(A.target).add(A.offset),
  21809. A.target.clone().sub(d.position),
  21810. d.quaternion.copy(o.quaternion),
  21811. A.currentScale = U.convertWorkshopOrthoZoom(o.orthoZoom),
  21812. A.absoluteScale = A.currentScale,
  21813. A.update()
  21814. } else
  21815. this.model.currentFloor.enter(i);
  21816. var b = this.currentPano
  21817. , w = this.position.clone();
  21818. return this.emit(W.FlyingStarted, f, w, n, this.currentPano),
  21819. this.flying = !0,
  21820. this.isOutsideMode(i) && this.is360View(u, b) ? (c || i !== V.DOLLHOUSE || (d.position.set(15, 10, 15),
  21821. d.controls.target.set(this.model.center.x, 0, this.model.center.z),
  21822. d.controls.update()),
  21823. e.blackoutStyle = P.FADEIN,
  21824. p = k.show360Views.transitionTime,
  21825. this.fade360View(p, d, e)) : this.isOutsideMode(u) && this.is360View(i, n) ? (c && this.switchCameraMode(i, c.quaternion),
  21826. this.mode = i,
  21827. this.path && this.path.popOutCpm(),
  21828. e.blackoutStyle = P.END,
  21829. p = k.show360Views.transitionTime,
  21830. this.fade360View(p, d, e)) : (G.start(H.property(this.model, "alpha", e.modelAlpha, null), p * e.modelAlphaLength, null, e.modelAlphaDelay, null, q.FlyToNewMode),
  21831. G.start(H.vector(this.position, d.position), p, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToNewMode),
  21832. G.start(H.quaternion(this.quaternion, d.quaternion), p * e.rotationDuration, null, e.rotationDelay, z[k.flydown.rotationEasing], null, q.FlyToNewMode),
  21833. G.start(H.matrix4(this.camera.projectionMatrix, d.projectionMatrix), p * e.cameraMatrixDuration, null, e.cameraMatrixDelay, e.cameraMatrixEase, null, q.FlyToNewMode),
  21834. G.start(H.uniform(this.model.skybox, "opacity", e.skyboxOpacity), p * e.skyboxOpacityLength, null, e.skyboxOpacityDelay, null, q.FlyToNewMode),
  21835. G.start(H.property(this.reticule.material.uniforms.opacity, "value", 0), p, null, q.FlyToNewMode)),
  21836. G.setTimeout(function() {
  21837. this.flying = !1,
  21838. u === V.PANORAMA && i !== V.PANORAMA ? this.currentPano.exit() : u !== V.PANORAMA && i === V.PANORAMA && (this.currentPano !== b && b.exit(),
  21839. this.currentPano.enter(),
  21840. this.path.placeCpm(),
  21841. this.path.fadeOutCpm(k.path.fadeOutTime),
  21842. this.spider.draw()),
  21843. u === V.DOLLHOUSE && this.cameraControls.controls[V.DOLLHOUSE].resetRanges(),
  21844. this.mode = i,
  21845. this.emit(W.FlyingEnded, f, w, this.currentPano, b)
  21846. if (this.afterCModeFuc) {
  21847. //手动加的函数
  21848. var cf = this.afterCModeFuc;
  21849. this.afterCModeFuc = null;//因为可能在执行afterCModeFuc时需要再添加afterCModeFuc所以要置空的话提前
  21850. cf();
  21851. }
  21852. this.updateMarkerVisi();//add
  21853. (u === V.PANORAMA || i == V.PANORAMA) && this.updateHotVisible()//add
  21854. if(this.mode == "panorama" && EditOverlay.editing){
  21855. EditOverlay.updatePano(this.currentPano)
  21856. }
  21857. //this.mode == u.PANORAMA && this.transitionPos({type:"flyDone", this.currentPano})//add
  21858. c && u !== V.PANORAMA && i === V.PANORAMA ? this.startWarp(M.Retain, S.Retain, R.BLACK, null, null, a) : (a && a(),
  21859. t.resolve())
  21860. }
  21861. .bind(this), p, q.FlyToNewMode),
  21862. this.mode = V.TRANSITIONING,
  21863. t.promise()
  21864. }
  21865. ,
  21866. t.prototype.fade360View = function(e, t, i) {
  21867. this.tagManager.hideShowTagsForBlackoutStyle(i.blackoutStyle, e),
  21868. $(this.domElement).fadeOut(.5 * e, function() {
  21869. this.model.skybox.material.uniforms.opacity.value = i.skyboxOpacity,
  21870. this.model.alpha = i.modelAlpha,
  21871. this.position.copy(t.position),
  21872. this.quaternion.copy(t.quaternion),
  21873. this.camera.projectionMatrix.copy(t.projectionMatrix),
  21874. $(this.domElement).fadeIn(.5 * e)
  21875. }
  21876. .bind(this))
  21877. }
  21878. ,
  21879. t.prototype.findDefaultViews = function() {
  21880. this.findDefaultView(this.lastInsideView, !0),
  21881. this.findDefaultView(this.last360View, !1)
  21882. }
  21883. ,
  21884. t.prototype.findDefaultView = function(e, i) {
  21885. var t, n = this.model.heroLocations, r = this.model.panos, o = n.findIndex(function(e) {
  21886. if (e.cameraMode !== V.PANORAMA)
  21887. return !1;
  21888. var t = r.get(e.panoId);
  21889. return t && t.isAligned() === i
  21890. });
  21891. 0 <= o ? (t = r.get(n[o].panoId),
  21892. e.update({
  21893. cameraMode: V.PANORAMA,
  21894. pano: t,
  21895. position: n[o].position,
  21896. quaternion: n[o].quaternion
  21897. })) : 0 <= (o = r.list.findIndex(function(e) {
  21898. return e.isAligned() === i
  21899. })) ? (t = r.list[o],
  21900. e.update({
  21901. cameraMode: V.PANORAMA,
  21902. pano: t,
  21903. position: t.position
  21904. })) : Y.warn("There are no", i ? "inside" : "360º", "views in this model")
  21905. }
  21906. ,
  21907. t.prototype.updateLastView = function() {
  21908. this.mode === V.PANORAMA && (this.currentPano.isAligned() ? this.lastInsideView : this.last360View).update({
  21909. pano: this.currentPano,
  21910. position: this.position,
  21911. quaternion: this.quaternion
  21912. })
  21913. }
  21914. ,
  21915. t.prototype.goToLastView = function(e, t) {
  21916. var i = $.Deferred()
  21917. , n = i.resolve.bind(i)
  21918. , r = i.reject.bind(i)
  21919. , o = e ? this.lastInsideView : this.last360View;
  21920. return this.isInMode(V.PANORAMA) && this.currentPano.isAligned() !== e && this.updateLastView(),
  21921. this.isInMode(V.PANORAMA) ? (this.path && this.path.popOutCpm(),
  21922. this.fadeToView(e, o, k.show360Views.transitionTime, t).done(n).fail(r)) : this.isOutsideMode() && this.flyToNewMode({
  21923. mode: o.cameraMode,
  21924. pano: o.pano,
  21925. quaternion: o.quaternion,
  21926. callback: t
  21927. }).done(n).fail(r),
  21928. i.promise()
  21929. }
  21930. ,
  21931. t.prototype.fadeToView = function(e, t, i, n) {
  21932. var r = $.Deferred()
  21933. , o = r.resolve.bind(r)
  21934. , a = r.reject.bind(r);
  21935. if (!t.isValid() || t.cameraMode === V.PANORAMA && !t.pano)
  21936. return Y.warn("Tried to fade to an illegal view", t.cameraMode),
  21937. a("Cannot go to illegal view"),
  21938. r.promise();
  21939. var s = (k[t.cameraMode],
  21940. function() {
  21941. $(this.domElement).fadeIn(.5 * i),
  21942. n && n(),
  21943. o()
  21944. }
  21945. .bind(this))
  21946. , l = e ? P.FADEIN : P.END;
  21947. return this.tagManager.hideShowTagsForBlackoutStyle(l, i),
  21948. $(this.domElement).fadeOut(.5 * i, function() {
  21949. this.model.fadePanoMarkers(e ? k.panorama.markerOpacity : 0),
  21950. t.cameraMode === V.PANORAMA ? this.flyToPano({
  21951. pano: t.pano,
  21952. lookAtPoint: T.FORWARD.clone().applyQuaternion(t.quaternion).add(t.pano.position),
  21953. duration: 0
  21954. }, s) : this.flyToNewMode({
  21955. mode: t.cameraMode,
  21956. quaternion: t.quaternion,
  21957. duration: 0,
  21958. callback: s
  21959. })
  21960. }
  21961. .bind(this)),
  21962. r.promise()
  21963. }
  21964. ,
  21965. t.prototype.startWarp = function(e, t, i, n, r, o) {
  21966. if (this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !1),
  21967. this.flying)
  21968. return Y.warn("Player.startWarp() -> Cannot warp when flying"),
  21969. o && o(),
  21970. !1;
  21971. null != e || (e = M.Show),
  21972. this.history.invalidate(),
  21973. e !== M.Retain ? this.path.brushToWarpPano(i, R.BLACK) || (i = R.BLACK) : i = this.path.upcomingTransType;
  21974. var a = this.path.warpDestPano && !this.path.warpDestPano.isAligned();
  21975. return this.emit(W.WarpStarted, a, i, n, r),
  21976. n = n || P.MIDDLE,
  21977. this.path.warpToPano(i, n, r, function() {
  21978. t === S.Slow ? this.path.discardSlow() : t === S.Standard && this.path.discardPathObject(),
  21979. this.emit(W.WarpEnded, i),
  21980. this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !0),
  21981. o && o()
  21982. }
  21983. .bind(this)),
  21984. e === M.Hide && this.path.discardPathObject(),
  21985. !0
  21986. }
  21987. ,
  21988. t.prototype.warpToPanoById = function(e, t, i, n, r, o, a, s) {
  21989. return this.path.setWarpDestinationByPanoId(e, t) ? this.startWarp(i, n, r, o, a, s) : (Y.warn("Player.warpToPanoById() -> Could not setWarpDestinationByPanoId()"),
  21990. s && s(),
  21991. !1)
  21992. }
  21993. ,
  21994. t.prototype.warpToPanoByHeroIndex = function(e, t, i, n, r, o, a) {
  21995. return this.path.setWarpDestinationByHeroIndex(e) ? this.startWarp(t, i, n, r, o, a) : (Y.warn("Player.warpToPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  21996. a && a(),
  21997. !1)
  21998. }
  21999. ,
  22000. t.prototype.warpToPano = function(e, t, i, n, r, o, a, s) {
  22001. return this.warpToPanoById(e.id, t, i, n, r, o, a, s)
  22002. }
  22003. ,
  22004. t.prototype.warpToNonPanoByHeroIndex = function(e, t) {
  22005. return this.path.setWarpDestinationByHeroIndex(e) ? (this.path.warpToNonPano(t),
  22006. !0) : (Y.warn("Player.warpToNonPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  22007. t && t(),
  22008. !1)
  22009. }
  22010. ,
  22011. t.prototype.aimTourCamera = function(e, t, i, n) {
  22012. return Y.debug("player.aimTourCamera(" + e + ") calling warpToPanoByHeroIndex(" + e + ")"),
  22013. this.warpToPanoByHeroIndex(e, t, i, null, null, null, n)
  22014. }
  22015. ,
  22016. t.prototype.showPathToHeroLocation = function(e) {
  22017. this.path.setWarpDestinationByHeroIndex(e) && this.path.brushToWarpPano(R.STD, R.BLACK)
  22018. }
  22019. ,
  22020. t.prototype.tourInterlude = function(e, t) {
  22021. this.history.invalidate(),
  22022. this.path.discardSlow();
  22023. var i = g_data2.tourAudio && g_data2.tourAudio[this.model.heroLocations[this.director.currentItem].sid]
  22024. , n = g_tourAudio ? 1e3 * g_tourAudio.currentTime : 0
  22025. , r = i && i.music ? i.time - n : 2e3;
  22026. this.path.waitNextStep(e, function() {
  22027. t && t()
  22028. }
  22029. .bind(this), r)
  22030. }
  22031. ,
  22032. t.prototype.stopInterlude = function() {
  22033. this.interruptAndFastForward(null, 0)
  22034. }
  22035. ,
  22036. t.prototype.interruptAndFastForward = function(e, t) {
  22037. this.isWarping() && this.emit(W.WarpInterrupted, this.path.activeTransType, e, t),
  22038. this.flying && this.emit(W.FlyingInterrupted),
  22039. this.path.interruptAndFastForward(e, t)
  22040. }
  22041. ,
  22042. t.prototype.setSize = function(e, t) {
  22043. var i = e / t;
  22044. this.baseFov = A.clampVFOV(k.insideFOV, k.insideFOVMax, e, t);
  22045. var n = A.getHFOVFromVFOV(k.insideFOV, e, t);
  22046. for (var r in n > k.insideFOVMax ? this.baseFov = A.getVFOVFromHFOV(k.insideFOVMax, e, t) : this.baseFov = k.insideFOV,
  22047. this.cameraControls.cameras) {
  22048. var o = this.cameraControls.cameras[r];
  22049. o.fov = this.baseFov * (1 / this.zoomLevel),
  22050. o.updateAspect(i)
  22051. }
  22052. }
  22053. ,
  22054. t.prototype.toJSON = function() {
  22055. var e = {};
  22056. return this.cameraControls.activeControl && ((e = this.cameraControls.activeControl.toJSON()).camera_mode = V.toInt(this.mode),
  22057. this.isOutsideMode() ? this.model.allFloorsVisible ? e.floor_visibility = [] : e.floor_visibility = this.model.floors.list.map(function(e) {
  22058. return e.hidden ? 0 : 1
  22059. }) : V.PANORAMA && (e.scan_id = this.currentPano.id)),
  22060. e
  22061. }
  22062. ,
  22063. t.prototype.getCurrentNodePanos = function(e) {
  22064. if (this.model.panos.map,
  22065. e.length = 0,
  22066. this.path.nodes)
  22067. for (var t = 0; t < this.path.nodes.length; t++) {
  22068. var i = this.path.nodes[t];
  22069. e.push(this.model.panos.get(i))
  22070. }
  22071. }
  22072. ,
  22073. t.prototype.zoomIncrementally = function(e) {
  22074. var t = this.zoomLevel;
  22075. this.zoomTo(this.zoomLevel + e),
  22076. t !== this.zoomLevel && this.currentPano && this.zoomStats.addZoomAction(t, this.zoomLevel, this.currentPano.id)
  22077. }
  22078. ,
  22079. t.prototype.zoomInIncrementally = function(e) {
  22080. e = e || this.defaultZoomIncrement,
  22081. this.zoomIncrementally(e)
  22082. }
  22083. ,
  22084. t.prototype.zoomOutIncrementally = function(e) {
  22085. e = e || -this.defaultZoomIncrement,
  22086. this.zoomIncrementally(e)
  22087. }
  22088. ,
  22089. t.prototype.zoomBy = function(e) {
  22090. this.zoomTo(this.zoomLevel * e)
  22091. }
  22092. ,
  22093. t.prototype.zoomIn = function() {
  22094. this.zoomBy(1 + this.zoomSpeed)
  22095. }
  22096. ,
  22097. t.prototype.zoomOut = function() {
  22098. this.zoomBy(1 - this.zoomSpeed)
  22099. }
  22100. ,
  22101. t.prototype.zoomTo = function(e, t) {
  22102. if ((t || k.zoom.enabled && this.mode === V.PANORAMA && this.zoomEnabled) && (e < k.zoom.min && (e = k.zoom.min),
  22103. e > k.zoom.max && (e = k.zoom.max),
  22104. e > this.zoomLevel ? (this.emit(m.ZoomIn),
  22105. e === k.zoom.max && this.emit(m.ZoomMax)) : e < this.zoomLevel && (this.emit(m.ZoomOut),
  22106. e === k.zoom.min && this.emit(m.ZoomMin)),
  22107. this.cameraControls.activeControl)) {
  22108. var i = this.cameraControls.activeControl.camera;
  22109. this.zoomLevel = e,
  22110. i.fov = this.baseFov * (1 / this.zoomLevel),
  22111. i.updateProjectionMatrix(),
  22112. this.zoomFov = i.fov
  22113. }
  22114. }
  22115. ,
  22116. t.prototype.increaseZoomSpeed = function() {
  22117. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed + this.zoomSpeedAdjust)
  22118. }
  22119. ,
  22120. t.prototype.decreaseZoomSpeed = function() {
  22121. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed - this.zoomSpeedAdjust)
  22122. }
  22123. ,
  22124. t.prototype.clampZoomSpeed = function(e) {
  22125. return e < 0 ? 0 : e
  22126. }
  22127. ,
  22128. t.prototype.activatePersistentZooming = function(e) {
  22129. this.zooming = e ? 1 : -1
  22130. }
  22131. ,
  22132. t.prototype.deactivatePersistentZooming = function() {
  22133. this.zooming = 0
  22134. }
  22135. ,
  22136. t.prototype.zoomDefault = function() {
  22137. this.zoomTo(1, !0)
  22138. }
  22139. ,
  22140. t.prototype.smoothZoomToDefault = function(e, t) {
  22141. var i, n = this.zoomLevel, r = function(e) {
  22142. 1 < e && (e = 1),
  22143. i = n * (1 - e) + e,
  22144. this.zoomTo(i, !0)
  22145. }
  22146. .bind(this), o = function() {
  22147. this.zoomDefault(),
  22148. t && window.setTimeout(t, 50)
  22149. }
  22150. .bind(this);
  22151. G.start(r, e, o, null, 0, z[k.transition.blendEasing])
  22152. }
  22153. ,
  22154. t.prototype.updateZoomPano = function() {
  22155. if (!this.panoRenderer.zoomPanoRenderingDisabled && this.mode === V.PANORAMA) {
  22156. var e = this.currentPano;
  22157. if (e) {
  22158. var t = this.zoomLevel > k.zoom.activationThreshold
  22159. , i = (this.flying && this.nextPano && this.nextPano !== this.currentPano || this.isWarping(),
  22160. t);
  22161. this.tileDownloader.tilePrioritizer.setZoomingActive(i),
  22162. this.panoRenderer.setZoomingActive(i, e, !0);
  22163. var n = function(e, t) {
  22164. this.panoRenderer.resetRenderStatus(e.id, !1, !0, this.qualityManager.getMaxNavPanoSize()),
  22165. this.panoRenderer.clearAllQueuedUploadsForPano(e.id),
  22166. this.panoRenderer.renderPanoTiles(e.id, null, !1, !1),
  22167. e.setZoomed(t)
  22168. }
  22169. .bind(this);
  22170. i && !e.zoomed ? (n(e, !0),
  22171. this.panoRenderer.enableUltraHighQualityMode(function() {
  22172. this.qualityManager.useUltraHighResolutionPanos && !k.zoom.overridemax && (k.zoom.max = y.ultraHighQualityMaxZoom),
  22173. i && n(e, !0)
  22174. }
  22175. .bind(this))) : !t && e.zoomed && n(e, !1)
  22176. }
  22177. }
  22178. },
  22179. //--------
  22180. t.prototype.flyToMode = function(mode, f1){ //飞到某个模式后再执行f1函数
  22181. var f2;
  22182. if (this.mode == mode) {
  22183. f1 && f1()
  22184. } else {
  22185. f2 = f1;
  22186. if (this.mode == "transitioning" && this.modeTran.split('-')[1] != mode) {//正飞向其他模式,就要先飞完再飞进来然后执行
  22187. this.afterCModeFuc = function() {
  22188. this.afterCModeFuc = f2
  22189. this.flyToNewMode({mode:mode, pano: mode == "panorama" && this.currentPano });
  22190. }.bind(this)
  22191. } else {
  22192. this.afterCModeFuc = f2;//飞入后执行
  22193. try{ //在场景刚开始加载 control还没建好时这句可能会报错所以用try。 不用callback而用 afterCModeFuc也是这个原因,因为会有别的函数可以飞入然后执行它
  22194. this.flyToNewMode({mode:mode, pano: mode == "panorama" && this.currentPano});
  22195. }catch(e){}
  22196. }
  22197. }
  22198. }
  22199. ,
  22200. t.prototype.checkHasNeighbor = function(pano){//add
  22201. for(var i in pano.neighbourPanos ){
  22202. if(i == pano.id)continue;
  22203. if(pano.neighbourPanos[i]){
  22204. return true;
  22205. }
  22206. }
  22207. }
  22208. ,
  22209. ee.exports = t
  22210. }
  22211. ).call(this, "/js/player.js")
  22212. }
  22213. , {
  22214. "./constants": 8,
  22215. "./enum/AlignmentType": 17,
  22216. "./enum/BlackoutStyle": 18,
  22217. "./enum/ControlEvents": 21,
  22218. "./enum/Keys": 30,
  22219. "./enum/ModelManagerEvents": 33,
  22220. "./enum/PanoSizeClass": 36,
  22221. "./enum/PanoramaEvents": 37,
  22222. "./enum/PathDiscardMode": 38,
  22223. "./enum/PathDisplayMode": 39,
  22224. "./enum/PlayerEvents": 40,
  22225. "./enum/TagStates": 44,
  22226. "./enum/Vectors": 50,
  22227. "./enum/Viewmode": 51,
  22228. "./enum/WarpStyle": 52,
  22229. "./enum/ZoomEvents": 53,
  22230. "./exception/BasicException": 55,
  22231. "./model/ModelManager": 140,
  22232. "./objects/NSpider": 147,
  22233. "./objects/Panorama": 148,
  22234. "./objects/Reticule": 149,
  22235. "./objects/ShowPath": 151,
  22236. "./objects/Snapshot": 153,
  22237. "./objects/View": 154,
  22238. "./settings": 166,
  22239. "./shaders": 167,
  22240. "./tile/TileDownloader": 171,
  22241. "./tile/TilePrioritizer": 172,
  22242. "./util/ZoomStats": 179,
  22243. "./util/browser": 182,
  22244. "./util/camera": 183,
  22245. "./util/cameraLight": 184,
  22246. "./util/common": 185,
  22247. "./util/easing": 186,
  22248. "./util/history": 187,
  22249. "./util/lerp": 188,
  22250. "./util/logger": 189,
  22251. "./util/math": 190,
  22252. "./util/transitions": 195,
  22253. hot: "hot",
  22254. scaleImg: "scaleImg",
  22255. events: 202,
  22256. three: 217
  22257. }],
  22258. scaleImg: [function(e, t) {
  22259. var i = t;
  22260. (function() {
  22261. function e(e, t, i, n) {
  22262. function r() {
  22263. (U = "object" == typeof i ? i : t.src || n ? s : document.createElement("canvas")).width = d,
  22264. U.height = p,
  22265. H = U.getContext("2d")
  22266. }
  22267. function o(e) {
  22268. if (e) {
  22269. var t, i = H.getImageData(0, 0, d, p), n = i.data;
  22270. for (t = 0; t < ie; t += 4)
  22271. n[t] = e[t] * ne | 0,
  22272. n[t + 1] = e[t + 1] * ne | 0,
  22273. n[t + 2] = e[t + 2] * ne | 0,
  22274. n[t + 3] = e[t + 3] * ne | 0;
  22275. return delete e,
  22276. i
  22277. }
  22278. return H.getImageData(0, 0, d, p)
  22279. }
  22280. function a(e, t, i, n, r) {
  22281. return .5 * (n - t + (2 * t - 5 * i + 4 * n - r + (3 * (i - n) + r - t) * e) * e) * e + i
  22282. }
  22283. var s, l;
  22284. if (t || (t = e.input,
  22285. i = e.output,
  22286. n = e.inputRemovable,
  22287. e.scale && (e = e.scale)),
  22288. t.src)
  22289. if (s = document.createElement("canvas"),
  22290. null != t.naturalWidth)
  22291. s.width = t.naturalWidth,
  22292. s.height = t.naturalHeight;
  22293. else if (null != t.runtimeStyle) {
  22294. var c = t.runtimeStyle
  22295. , h = c.width
  22296. , u = c.height;
  22297. c.width = "auto",
  22298. c.height = "auto",
  22299. s.width = t.width,
  22300. s.height = t.height,
  22301. c.width = h,
  22302. c.height = u
  22303. } else {
  22304. h = t.width,
  22305. u = t.height;
  22306. t.removeAttribute && (t.removeAttribute("width"),
  22307. t.removeAttribute("height")),
  22308. s.width = t.width,
  22309. s.height = t.height,
  22310. t.width = h,
  22311. t.height = u
  22312. }
  22313. else
  22314. s = t;
  22315. l = s.getContext("2d"),
  22316. t.src && l.drawImage(t, 0, 0);
  22317. var d, p, f = s.width, g = s.height, m = l.getImageData(0, 0, f, g).data;
  22318. if (!f || !g)
  22319. return !1;
  22320. (t.src || n) && s.clearRect(0, 0, f, g),
  22321. p = "object" == typeof e ? e.width ? (d = e.width + .5 | 0,
  22322. e.height + .5 | 0) : (d = f * e.scaleX + .5 | 0,
  22323. g * e.scaleY + .5 | 0) : (d = e * f + .5 | 0,
  22324. e * g + .5 | 0);
  22325. 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;
  22326. if (1 < re || 1 < oe)
  22327. for (r(),
  22328. G = (z = o()).data,
  22329. C = 0; C < p; C++)
  22330. for (V = (y = C / oe) - (w = 0 | y),
  22331. j = w * $,
  22332. W = w < 1 ? j : j - $,
  22333. w < g - 2 ? (Y = j + $,
  22334. q = (2 + w) * $) : Y = q = g - 2 < w ? j : j + $,
  22335. A = 0; A < d; A++,
  22336. te += 4)
  22337. Z = (b = 0 | (v = A / re)) << 2,
  22338. b < f - 2 ? (K = Z + 4,
  22339. Q = Z + 8) : K = Q = f - 2 < b ? Z : Z + 4,
  22340. 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,
  22341. ++Z,
  22342. ++K,
  22343. ++Q,
  22344. 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,
  22345. ++Z,
  22346. ++K,
  22347. ++Q,
  22348. 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,
  22349. ++Z,
  22350. ++K,
  22351. ++Q,
  22352. 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,
  22353. G[te] = 0 <= D ? D < 256 ? D : 255 : 0,
  22354. G[te + 1] = 0 <= F ? F < 256 ? F : 255 : 0,
  22355. G[te + 2] = 0 <= B ? B < 256 ? B : 255 : 0,
  22356. G[te + 3] = 0 <= N ? N < 256 ? N : 255 : 0;
  22357. else {
  22358. if (le.Float32Array)
  22359. L = new Float32Array(ie);
  22360. else
  22361. for (L = [],
  22362. te = 0; te < ie; ++te)
  22363. L[te] = 0;
  22364. for (y = 0; y < g; y++)
  22365. for (I = (_ = 0 | (C = y * oe)) * J,
  22366. (O = !!((_ - (C + oe | 0)) * (g - 1 - y)) << 1) && (M = 1 + _ - C,
  22367. R = C + oe - _ - 1),
  22368. v = 0; v < f; v++,
  22369. ee += 4)
  22370. switch (A = v * re,
  22371. E = 0 | A,
  22372. te = I + (E << 2),
  22373. P = !!((E - (A + re | 0)) * (f - 1 - v)),
  22374. P && (x = 1 + E - A,
  22375. S = A + re - E - 1),
  22376. D = m[ee],
  22377. F = m[ee + 1],
  22378. B = m[ee + 2],
  22379. N = m[ee + 3],
  22380. P + O) {
  22381. case 0:
  22382. L[te] += D * ae,
  22383. L[te + 1] += F * ae,
  22384. L[te + 2] += B * ae,
  22385. L[te + 3] += N * ae;
  22386. break;
  22387. case 1:
  22388. T = x * oe,
  22389. L[te] += D * T,
  22390. L[te + 1] += F * T,
  22391. L[te + 2] += B * T,
  22392. L[te + 3] += N * T,
  22393. T = S * oe,
  22394. L[te + 4] += D * T,
  22395. L[te + 5] += F * T,
  22396. L[te + 6] += B * T,
  22397. L[te + 7] += N * T;
  22398. break;
  22399. case 2:
  22400. T = re * M,
  22401. L[te] += D * T,
  22402. L[te + 1] += F * T,
  22403. L[te + 2] += B * T,
  22404. L[te + 3] += N * T,
  22405. T = re * R,
  22406. L[te += J] += D * T,
  22407. L[te + 1] += F * T,
  22408. L[te + 2] += B * T,
  22409. L[te + 3] += N * T;
  22410. break;
  22411. default:
  22412. T = x * M,
  22413. L[te] += D * T,
  22414. L[te + 1] += F * T,
  22415. L[te + 2] += B * T,
  22416. L[te + 3] += N * T,
  22417. T = S * M,
  22418. L[te + 4] += D * T,
  22419. L[te + 5] += F * T,
  22420. L[te + 6] += B * T,
  22421. L[te + 7] += N * T,
  22422. T = x * R,
  22423. L[te += J] += D * T,
  22424. L[te + 1] += F * T,
  22425. L[te + 2] += B * T,
  22426. L[te + 3] += N * T,
  22427. T = S * R,
  22428. L[te + 4] += D * T,
  22429. L[te + 5] += F * T,
  22430. L[te + 6] += B * T,
  22431. L[te + 7] += N * T
  22432. }
  22433. delete m,
  22434. r(),
  22435. z = o(L)
  22436. }
  22437. if (H.putImageData(z, 0, 0),
  22438. "string" == typeof i) {
  22439. var se;
  22440. if ("png" === i || "jpeg" === i)
  22441. return (se = n && t.src ? t : new Image).width = d,
  22442. se.height = p,
  22443. se.src = U.toDataURL("image/" + i, .85),
  22444. se;
  22445. if ("png-src" === i || "jpeg-src" === i)
  22446. return U.toDataURL("image/" + i.split("-")[0], .85)
  22447. }
  22448. return U
  22449. }
  22450. var le = this;
  22451. "undefined" != typeof exports ? ("undefined" != typeof module && module.exports && (exports = module.exports = e),
  22452. exports.scale = e) : c = e
  22453. }
  22454. ).call(this),
  22455. i.exports = c
  22456. }
  22457. , {}],
  22458. 156: [function(i, n, e) {
  22459. (function(e) {
  22460. "use strict";
  22461. function t(e, t) {
  22462. this.model = e,
  22463. this.panos = e.panos,
  22464. this.player = t,
  22465. this.imagePanos = this.listImagePanos(),
  22466. this.retryMinimumTime = 1e4
  22467. }
  22468. var r = (i("three"),
  22469. i("./enum/Viewmode"))
  22470. , o = (i("./settings"),
  22471. i("./objects/Panorama"))
  22472. , a = new (i("./util/logger"))(e);
  22473. t.prototype.start = function() {
  22474. this.loadNextPano(function(e) {
  22475. e ? this.start() : (a.debug("No suitable pano loaded, waiting a little while before looking again"),
  22476. setTimeout(function() {
  22477. this.start()
  22478. }
  22479. .bind(this), 1e3))
  22480. }
  22481. .bind(this))
  22482. }
  22483. ,
  22484. t.prototype.validLoadTarget = function(e) {
  22485. return e && !e.isLoaded("high") && Date.now() - e.failedLoadingAt > this.retryMinimumTime
  22486. }
  22487. ,
  22488. t.prototype.listImagePanos = function() {
  22489. var i = []
  22490. , n = this;
  22491. return this.model.images.forEach(function(e) {
  22492. if (e.metadata && e.metadata.scan_id) {
  22493. var t = n.model.panos.get(e.metadata.scan_id);
  22494. t && !t.isLoaded("high") && i.push(t)
  22495. }
  22496. }),
  22497. i
  22498. }
  22499. ,
  22500. t.prototype.nextNotLoadedImage = function() {
  22501. for (; 0 < this.imagePanos.length; ) {
  22502. var e = this.imagePanos[0];
  22503. if (!e.isLoaded("high"))
  22504. return e;
  22505. this.imagePanos.shift()
  22506. }
  22507. return null
  22508. }
  22509. ,
  22510. t.prototype.loadNextPano = function(e) {
  22511. var t, i, n = this.model.waitQueue.filter(function(e) {
  22512. return e.object instanceof o
  22513. });
  22514. 0 < n.length ? (t = n[0].object,
  22515. a.debug("Overrode pano selection: Flying to an unloaded pano " + t.id)) : this.validLoadTarget(this.player.currentPano) ? (t = this.player.currentPano,
  22516. a.debug("Overrode pano selection: Currently at an unloaded pano " + t.id)) : this.validLoadTarget(this.player.closestPano) ? (t = this.player.closestPano,
  22517. a.debug("Overrode pano selection: Hovering over an unloaded pano " + t.id)) : this.validLoadTarget(this.nextNotLoadedImage()) ? (i = "high",
  22518. t = this.imagePanos[0],
  22519. 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),
  22520. t ? (i = i || t.isLoaded("low") ? "high" : "low",
  22521. a.debug("Preloading " + i + "-res pano " + t.id),
  22522. t.loadCube(i).done(e).fail(function() {
  22523. a.warn("Failed preloading pano", t.id, ", marking it as failed and forgetting it for a while"),
  22524. e()
  22525. })) : e && e(null)
  22526. }
  22527. ,
  22528. n.exports = t
  22529. }
  22530. ).call(this, "/js/preloaders.js")
  22531. }
  22532. , {
  22533. "./enum/Viewmode": 51,
  22534. "./objects/Panorama": 148,
  22535. "./settings": 166,
  22536. "./util/logger": 189,
  22537. three: 217
  22538. }],
  22539. 157: [function(a, s, e) {
  22540. (function(e) {
  22541. "use strict";
  22542. function t(e, t, i, n, r) {
  22543. this.qualityManager = e,
  22544. this.scene = t,
  22545. this.camera = i,
  22546. this.container = r,
  22547. this.controls = n,
  22548. this.controls.enabled = !0,
  22549. this.controls.locked = !0,
  22550. this.quickstartCamera = n.camera,
  22551. this.quickstartCamera.fov = d.clampVFOV(o.insideFOV, o.insideFOVMax, $("#player").width(), $("#player").height()),
  22552. this.skybox = null
  22553. }
  22554. var i = a("three")
  22555. , n = a("../util/logger")
  22556. , o = a("../constants")
  22557. , h = (a("../util/transitions"),
  22558. a("../util/lerp"),
  22559. a("../util/easing"),
  22560. a("../enum/Vectors"))
  22561. , u = a("../enum/PanoSizeClass")
  22562. , r = (a("../materials/ModelTextureMaterial"),
  22563. a("../materials/CubemapMaterial"))
  22564. , d = (a("../cameras/PanoramaCamera"),
  22565. a("../controls/PanoramaControls"),
  22566. a("../tile/TileUtils"),
  22567. a("../util/camera"),
  22568. a("../util/cameraLight"))
  22569. , p = (a("../util/browser"),
  22570. a("../settings"),
  22571. a("../gui/helpManager"),
  22572. new n(e));
  22573. t.prototype.load = function(e) {
  22574. e.pano.shouldRedrawOnBaseLoaded = !0;
  22575. var t, i, n = this, r = h.FORWARD.clone().applyQuaternion(e.quaternion), o = r.clone().negate();
  22576. this.controls.lookAt(r.add(this.quickstartCamera.position));
  22577. var a = this.qualityManager.getPanoSize(u.BASE)
  22578. , s = this.qualityManager.getPanoSize(u.STANDARD);
  22579. if (e.pano.tiled) {
  22580. p.warn("Loading startPano, TILED", e.pano.id);
  22581. var l = d.getHFOVForCamera(this.quickstartCamera, $("#player").width(), $("#player").height())
  22582. , c = this.quickstartCamera.fov;
  22583. p.warn("Quickstart loading tiles in frustum: [horizontal FOV: " + l + ", vertical FOV: " + c + "]"),
  22584. t = e.pano.loadTiledPano(s, r, {
  22585. hFov: l,
  22586. vFov: c
  22587. }, !1, !1, !0),
  22588. i = e.pano.loadTiledPano(a, o, null, !1, !1, !0)
  22589. } else
  22590. p.warn("Loading startPano", e.pano.id),
  22591. t = e.pano.loadCube("high");
  22592. return $.when(t).then(function() {
  22593. n.init(e.pano, e.quaternion),
  22594. e.pano.tiled ? i.done(function() {
  22595. e.pano.lockUntilRenderingComplete = !1,
  22596. this.controls.locked = !1
  22597. }
  22598. .bind(this)) : this.controls.locked = !1
  22599. }
  22600. .bind(this))
  22601. }
  22602. ,
  22603. t.prototype.init = function(e, t) {
  22604. p.info("Quickstart done loading, adding scene objects"),
  22605. e.lockUntilRenderingComplete = !0,
  22606. this.skybox = new i.Mesh(new i.CubeGeometry(1,1,1),new r({
  22607. side: i.BackSide
  22608. })),
  22609. this.skybox.material.uniforms.map.value = e.getSkyboxTexture(),
  22610. this.skybox.quaternion.copy(e.quaternion),
  22611. this.scene.add(this.skybox),
  22612. $(this.container).show()
  22613. }
  22614. ,
  22615. t.prototype.update = function(e) {
  22616. this.controls.update(e),
  22617. this.camera.copy(this.quickstartCamera)
  22618. }
  22619. ,
  22620. t.prototype.setSize = function(e, t) {
  22621. this.quickstartCamera.updateAspect(e / t)
  22622. }
  22623. ,
  22624. t.prototype.destroy = function() {
  22625. this.scene.remove(this.skybox)
  22626. }
  22627. ,
  22628. s.exports = t
  22629. }
  22630. ).call(this, "/js/scene/QuickstartManager.js")
  22631. }
  22632. , {
  22633. "../cameras/PanoramaCamera": 7,
  22634. "../constants": 8,
  22635. "../controls/PanoramaControls": 13,
  22636. "../enum/PanoSizeClass": 36,
  22637. "../enum/Vectors": 50,
  22638. "../gui/helpManager": 68,
  22639. "../materials/CubemapMaterial": 117,
  22640. "../materials/ModelTextureMaterial": 118,
  22641. "../settings": 166,
  22642. "../tile/TileUtils": 174,
  22643. "../util/browser": 182,
  22644. "../util/camera": 183,
  22645. "../util/cameraLight": 184,
  22646. "../util/easing": 186,
  22647. "../util/lerp": 188,
  22648. "../util/logger": 189,
  22649. "../util/transitions": 195,
  22650. three: 217
  22651. }],
  22652. 158: [function(e, t, i) {
  22653. "use strict";
  22654. function h(e, t, i) {
  22655. this.scene = e,
  22656. this.camera = t,
  22657. this.renderer = null,
  22658. this.effects = i,
  22659. this.animateCallback = null,
  22660. this.composer = null,
  22661. this.qualityManager = null,
  22662. e.renderWidth = 0,
  22663. e.renderHeight = 0,
  22664. this.updateClock = new M.Clock,
  22665. this.components = [],
  22666. this.updateListeners = [],
  22667. this.resizeListeners = [],
  22668. this.forceUpdateSize = !1,
  22669. this.started = !1,
  22670. this.textures = {},
  22671. this.suspendedObjects = []
  22672. }
  22673. 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;
  22674. window.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame,
  22675. (h.prototype = Object.create(p.prototype)).addComponent = function(e) {
  22676. this.components.push(e),
  22677. e.update && this.updateListeners.push(e),
  22678. e.setSize && (this.resizeListeners.push(e),
  22679. this.forceUpdateSize = !0)
  22680. }
  22681. ,
  22682. h.prototype.removeComponent = function(t) {
  22683. function e(e) {
  22684. return e !== t
  22685. }
  22686. this.components = this.components.filter(e),
  22687. this.updateListeners = this.updateListeners.filter(e),
  22688. this.resizeListeners = this.resizeListeners.filter(e)
  22689. }
  22690. ,
  22691. h.prototype.start = function(e) {
  22692. if (this.started)
  22693. throw new l("Can't start SceneRenderer, already started");
  22694. this.createContext(e),
  22695. //u.isMobile() && this.boluoVrInit(),
  22696. this.initComposer(),
  22697. this.started = !0,
  22698. (b = b.bind(this))()
  22699. }
  22700. ,
  22701. h.prototype.createContext = function(e) {
  22702. try {
  22703. this.renderer = new M.WebGLRenderer({antialias: !u.isMobile()}),
  22704. this.renderer.autoClear = !0,
  22705. this.renderer.setPixelRatio(window.devicePixelRatio ? window.devicePixelRatio : 1),
  22706. this.renderer.setSize($("#player").width(), $("#player").height(), !1),
  22707. this.emit(r.ContextCreated)
  22708. } catch (e) {
  22709. throw new c("Unable to create a WebGL rendering context")
  22710. }
  22711. d.profiling.enabled && this.overrideTextures(),
  22712. e.appendChild(this.renderer.domElement)
  22713. }
  22714. ,
  22715. h.prototype.overrideTextures = function() {
  22716. var d = this.renderer.context
  22717. , t = 0
  22718. , i = d.createTexture;
  22719. d.createTexture = function() {
  22720. var e = i.call(d);
  22721. return e.id = t++,
  22722. this.textures[e.id] = e
  22723. }
  22724. .bind(this);
  22725. var p = d.texImage2D;
  22726. d.texImage2D = function(e, t, i, n, r, o, a, s, l) {
  22727. var c, h = this.getTextureTypeFromTarget(d, e);
  22728. c = h === f.TextureCube ? d.getParameter(d.TEXTURE_BINDING_CUBE_MAP) : d.getParameter(d.TEXTURE_BINDING_2D),
  22729. void 0 !== a ? p.call(d, e, t, i, n, r, o, a, s, l) : (a = n,
  22730. s = r,
  22731. n = (l = o).naturalWidth,
  22732. r = l.naturalHeight,
  22733. p.call(d, e, t, i, a, s, l));
  22734. var u = this.textures[c.id];
  22735. u.width = h === f.TextureCube ? 6 * n : n,
  22736. u.height = r
  22737. }
  22738. .bind(this);
  22739. var n = d.deleteTexture;
  22740. d.deleteTexture = function(e) {
  22741. delete this.textures[e.id],
  22742. n.call(d, e)
  22743. }
  22744. .bind(this)
  22745. }
  22746. ,
  22747. h.prototype.updateTextureMemory = (n = null,
  22748. function() {
  22749. var e = 0;
  22750. for (var t in this.textures) {
  22751. var i = this.textures[t];
  22752. i.width && i.height && (e += i.width * i.height * 4)
  22753. }
  22754. e !== n && this.emit(r.MemoryUsageUpdated, e),
  22755. n = e
  22756. }
  22757. ),
  22758. h.prototype.getTextureTypeFromTarget = function(e, t) {
  22759. switch (t) {
  22760. case e.TEXTURE_CUBE_MAP_POSITIVE_X:
  22761. case e.TEXTURE_CUBE_MAP_NEGATIVE_X:
  22762. case e.TEXTURE_CUBE_MAP_POSITIVE_Y:
  22763. case e.TEXTURE_CUBE_MAP_NEGATIVE_Y:
  22764. case e.TEXTURE_CUBE_MAP_POSITIVE_Z:
  22765. case e.TEXTURE_CUBE_MAP_NEGATIVE_Z:
  22766. return f.TextureCube;
  22767. case e.TEXTURE_2D:
  22768. return f.Texture2D;
  22769. default:
  22770. return null
  22771. }
  22772. }
  22773. ,
  22774. h.prototype.initComposer = function() {
  22775. this.composer = new M.EffectComposer(this.renderer),
  22776. this.composer.addPass(new M.RenderPass(this.scene,this.camera)),
  22777. this.composer.addPass(this.effects.hblurPass),
  22778. this.composer.addPass(this.effects.vblurPass)
  22779. }
  22780. ,
  22781. h.prototype.setSize = function(e, t, i) {
  22782. this.renderWidth = e,
  22783. this.renderHeight = t,
  22784. this.effects.aspect = e / t,
  22785. this.renderer.setSize(e, t, !1, i),
  22786. this.composer.setSize(e, t);
  22787. for (var n = 0; n < this.resizeListeners.length; n++)
  22788. this.resizeListeners[n].setSize(e, t)
  22789. }
  22790. ,
  22791. h.prototype.render = function() {
  22792. 0 < this.effects.currentBlur ? this.composer.render() : this.renderer.render(this.scene, this.camera)
  22793. }
  22794. ,
  22795. h.prototype.boluoVrInit = function() {
  22796. console.log("boluoVrInit"),
  22797. this.isHuawei5X = u.detectHUAWEI5X(),
  22798. this.oldRenderer = this.renderer,
  22799. this.newRenderer = new this.vrRenderer(this.renderer,this,this.camera),
  22800. window.panoCamera = this.camera;
  22801. var i = this;
  22802. window._vrEnabled = !1,
  22803. Object.defineProperty(window, "vrEnabled", {
  22804. get: function() {
  22805. return window._vrEnabled
  22806. },
  22807. set: function(e) {
  22808. (e = !!e) ? (i.renderer = i.newRenderer,
  22809. window.vrMarkers.forEach(function(e) {
  22810. e.visible = !0
  22811. })) : (i.renderer = i.oldRenderer,
  22812. window.vrMarkers.forEach(function(e) {
  22813. e.visible = !1
  22814. })),
  22815. i.cursor.visible = e,
  22816. i.setSize(window.innerWidth, window.innerHeight),
  22817. window._vrEnabled = e,
  22818. setTimeout(function() {
  22819. console.log(player.cameraControls.activeControl.camera.fov)
  22820. }, 500)
  22821. }
  22822. }),
  22823. this.createCursor(.5, !1, 1, 16777215, 0);
  22824. var e = {
  22825. setSize: function(e, t) {
  22826. i.camera.aspect = e / t
  22827. }
  22828. };
  22829. this.resizeListeners.push(e),
  22830. this.vrLoadingInit()
  22831. }
  22832. ,
  22833. h.prototype.vrLoadingInit = function() {
  22834. var e = new (e = function(camera) {
  22835. var t = this
  22836. , e = new M.RingGeometry(1.3,1.5,32,32,0,1.2 * Math.PI)
  22837. , i = new M.MeshBasicMaterial({
  22838. color: 4967932,
  22839. side: M.DoubleSide
  22840. })
  22841. , n = new M.Mesh(e,i);
  22842. (this.mesh = n).position.z = -2,
  22843. n.scale.set(.08, .08, .08),
  22844. n.visible = !1,
  22845. //window.player.camera.add(n),
  22846. camera.add(n),
  22847. t.enabled = !1,
  22848. this.update = function(e) {
  22849. 1 == t.enabled && (n.rotation.z += 15 * e)
  22850. }
  22851. }
  22852. )(this.camera);
  22853. window.Loading = e,
  22854. this.updateListeners.push(e)
  22855. }
  22856. ,
  22857. h.prototype.createCursor = function(e, t, i, n, r) {
  22858. var o, a = new M.SpriteMaterial({
  22859. opacity: i,
  22860. color: n,
  22861. transparent: t,
  22862. map: this.boluoGetTexture("images/cursor.png"),
  22863. needsUpdate: !0,
  22864. side: M.DoubleSide
  22865. });
  22866. a.map.offset = new M.Vector2(1 / 17 * r,0),
  22867. a.map.repeat = new M.Vector2(1 / 17,1),
  22868. a.depthTest = !1,
  22869. a.blending = M.AdditiveBlending,
  22870. (o = new M.Sprite(a)).scale.set(.3, .3, .3),
  22871. o.position.z = -2,
  22872. o.visible = !1,
  22873. o.name = "cursor",
  22874. this.camera.add(o),
  22875. this.scene.add(this.camera),
  22876. this.cursor = o;
  22877. var s = new this.CursorAnimation(this.scene,o,this.camera);
  22878. this.cursor.triggerTargetEvent = s.triggerTargetEvent,
  22879. this.updateListeners.push(s)
  22880. }
  22881. ,
  22882. h.prototype.CursorAnimation = function(e, t, o) {
  22883. this.cursor = t,
  22884. this.raycaster = new M.Raycaster,
  22885. this.targetEventObj = {},
  22886. this.type = 1,
  22887. this.tweenFlag = !0;
  22888. var s = this;
  22889. this.target = o,
  22890. console.log(o.uuid),
  22891. this.euler = new M.Euler,
  22892. this.q0 = new M.Quaternion,
  22893. this.q1 = new M.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5)),
  22894. this.zee = new M.Vector3(0,0,1),
  22895. this.alpha = -1e3,
  22896. this.beta = -1e3,
  22897. this.gamma = -1e3,
  22898. this.orient = M.Math.degToRad(window.orientation || 0),
  22899. window.addEventListener("orientationchange", function() {
  22900. s.orient = M.Math.degToRad(window.orientation || 0)
  22901. }),
  22902. window.addEventListener("deviceorientation", function(e) {
  22903. var t = M.Math.degToRad(e.alpha)
  22904. , i = M.Math.degToRad(e.beta)
  22905. , n = M.Math.degToRad(e.gamma);
  22906. if (this.isHuawei5X ? (-1e3 === s.alpha && (s.alpha = t),
  22907. -1e3 === s.beta && (s.beta = i),
  22908. -1e3 === s.gamma && (s.gamma = n),
  22909. .06 < Math.abs(t - s.alpha) && (s.alpha = t),
  22910. .006 < Math.abs(i - s.beta) && (s.beta = i),
  22911. .006 < Math.abs(n - s.gamma) && (s.gamma = n)) : (s.alpha = t,
  22912. s.beta = i,
  22913. s.gamma = n),
  22914. h.vrDebug) {
  22915. $("#info-device-orientation").css("display", "block");
  22916. var r = "";
  22917. r += "alpha=(" + s.alpha + ")<BR/>",
  22918. r += "beta=(" + s.beta + ")<BR/>",
  22919. r += "gamma=" + s.gamma + "<BR/>",
  22920. document.getElementById("info-device-orientation").innerHTML = r
  22921. }
  22922. }),
  22923. this.setObjectQuaternion = function(e, t, i, n, r) {
  22924. s.euler.set(i, t, -n, "YXZ"),
  22925. e.setFromEuler(s.euler),
  22926. e.multiply(s.q1),
  22927. e.multiply(s.q0.setFromAxisAngle(s.zee, -r)),
  22928. o.updateMatrixWorld()
  22929. }
  22930. ,
  22931. parent !== window && window.addEventListener("message", function(e) {
  22932. var t, i, n, r, o = JSON.parse(e.data), a = -1 !== window.navigator.userAgent.indexOf("KIW-TL00H");
  22933. o && o.alpha && o.beta && o.gamma && (t = a,
  22934. i = M.Math.degToRad(o.alpha),
  22935. n = M.Math.degToRad(o.beta),
  22936. r = M.Math.degToRad(o.gamma),
  22937. t ? (-1e3 === s.alpha && (s.alpha = i),
  22938. -1e3 === s.beta && (s.beta = n),
  22939. -1e3 === s.gamma && (s.gamma = r),
  22940. .06 < Math.abs(i - s.alpha) && (s.alpha = i),
  22941. .006 < Math.abs(n - s.beta) && (s.beta = n),
  22942. .006 < Math.abs(r - s.gamma) && (s.gamma = r)) : (s.alpha = i,
  22943. s.beta = n,
  22944. s.gamma = r))
  22945. }),
  22946. this.update = function(e) {
  22947. TWEEN.update(),
  22948. window.vrEnabled && (this.setObjectQuaternion(this.target.quaternion, this.alpha, this.beta, this.gamma, this.orient),
  22949. this.triggerTargetEvent())
  22950. }
  22951. ,
  22952. this.triggerTargetEvent = function() {
  22953. var e = this.choseObj()
  22954. , t = e ? e.object : void 0;
  22955. (this.targetEventObj.currentObj = t) !== this.targetEventObj.lastObj && (t && this.autoCursorPosition(e),
  22956. 1 === this.type ? (this.cursorAnimate && this.cursorAnimate.stop(),
  22957. t && t.enabled && this.startAnimate(function() {
  22958. this.clickCallback(t)
  22959. }
  22960. .bind(this))) : this.type,
  22961. this.targetEventObj.lastObj = t)
  22962. }
  22963. ,
  22964. this.choseObj = function() {
  22965. this.raycaster.setFromCamera({
  22966. x: 0,
  22967. y: 0
  22968. }, o);
  22969. var e = (this.raycaster.ray,
  22970. window.vrMarkers)
  22971. , t = this.raycaster.intersectObjects(e);
  22972. if (0 < t.length)
  22973. return t[0]
  22974. }
  22975. ,
  22976. this.clickCallback = function(e) {
  22977. this.runTHREEAction(e, "onclick")
  22978. }
  22979. ,
  22980. this.runTHREEAction = function(e, t) {
  22981. switch (t) {
  22982. case "onclick":
  22983. e._listeners && e._listeners.click && e._listeners.click.forEach(function(e) {
  22984. e()
  22985. });
  22986. break;
  22987. case "onhover":
  22988. e._listeners && e._listeners.hover && e._listeners.hover.forEach(function(e) {
  22989. e()
  22990. });
  22991. break;
  22992. case "onout":
  22993. e._listeners && e._listeners.out && e._listeners.out.forEach(function(e) {
  22994. e()
  22995. })
  22996. }
  22997. }
  22998. ,
  22999. this.startAnimate = function(e) {
  23000. this.tweenFlag && this.initAnimation(e)
  23001. }
  23002. ,
  23003. this.initAnimation = function(e) {
  23004. var t = this
  23005. , i = this.cursor.material.map.offset;
  23006. t.tweenFlag = !1,
  23007. this.cursorAnimate = new TWEEN.Tween(i).to({
  23008. x: 1
  23009. }, 1e3).onStart(function() {
  23010. t.tweenFlag = !1
  23011. }).onStop(function() {
  23012. t.tweenFlag = !0,
  23013. this.x = 0,
  23014. i.x = 0
  23015. }).onUpdate(function() {}).onComplete(function() {
  23016. e(),
  23017. i.x = 0,
  23018. setTimeout(function() {
  23019. t.tweenFlag = !0
  23020. }, 1500)
  23021. }),
  23022. this.cursorAnimate.easing(function(e) {
  23023. return Math.floor(17 * e) / 17
  23024. }),
  23025. this.cursorAnimate.start()
  23026. }
  23027. ,
  23028. this.autoCursorPosition = function(e) {
  23029. this.cursor.scale.set(.3, .3, .3)
  23030. }
  23031. }
  23032. ,
  23033. h.prototype.vrRenderer = function(a, i, e) {
  23034. var s = new i.vrCamera(e);
  23035. s.bananaAspect = .8,
  23036. this.width,
  23037. this.height;
  23038. i = this;
  23039. this.setSize = function(e, t) {
  23040. a.setSize.call(this, e, t),
  23041. i.width = e,
  23042. i.height = t
  23043. }
  23044. ,
  23045. this.render = function(e, t, i, n) {
  23046. var r, o;
  23047. if (window.cameraQua = t.quaternion.clone(),
  23048. t.__RESS__SKIP__STEREO__)
  23049. return a.render(e, t, i, n);
  23050. if ("PerspectiveCamera" === t.type)
  23051. r = s.cameraL,
  23052. o = s.cameraR,
  23053. e.updateMatrixWorld(),
  23054. null === t.parent && t.updateMatrixWorld(),
  23055. s.vrCameraUpdate(t);
  23056. else {
  23057. if ("OrthographicCamera" !== t.type)
  23058. return DEBUG && console.error("Unsupported renderer: ", t.type);
  23059. r = o = t
  23060. }
  23061. a.setScissorTest(!0),
  23062. a.setScissor(0, 0, this.width / 2, this.height),
  23063. a.setViewport(0, 0, this.width / 2, this.height),
  23064. a.render.call(this, e, r, i, n),
  23065. a.setScissor(this.width / 2, 0, this.width / 2, this.height),
  23066. a.setViewport(this.width / 2, 0, this.width / 2, this.height),
  23067. a.render.call(this, e, o, i, n),
  23068. a.setScissorTest(!1)
  23069. }
  23070. ,
  23071. this.__proto__ = {
  23072. __proto__: a
  23073. }
  23074. }
  23075. ,
  23076. h.prototype.vrCamera = function(e) {
  23077. this.type = "StereoCamera",
  23078. this._aspect = 1,
  23079. this._overlap = .064,
  23080. this.cameraL = new M.PerspectiveCamera,
  23081. this.cameraL.layers.enable(1),
  23082. this.cameraL.matrixAutoUpdate = !1,
  23083. this.cameraR = new M.PerspectiveCamera,
  23084. this.cameraR.layers.enable(2),
  23085. this.cameraR.matrixAutoUpdate = !1,
  23086. this.eyeRight = new M.Matrix4,
  23087. this.eyeLeft = new M.Matrix4,
  23088. this.vrCameraNeedsUpdate = !0,
  23089. window.vrCameraL = this.cameraL,
  23090. Object.defineProperty(this, "bananaAspect", {
  23091. get: function() {
  23092. return this._aspect
  23093. },
  23094. set: function(e) {
  23095. this._aspect !== e && (this.vrCameraNeedsUpdate = !0),
  23096. this._aspect = e
  23097. }
  23098. }),
  23099. Object.defineProperty(this, "overlap", {
  23100. get: function() {
  23101. return this._overlap
  23102. },
  23103. set: function(e) {
  23104. this._overlap !== e && (this.vrCameraNeedsUpdate = !0),
  23105. this._overlap = e
  23106. }
  23107. }),
  23108. this.vrCameraUpdate = function(e) {
  23109. if (this.vrCameraNeedsUpdate = !0,
  23110. this.vrCameraNeedsUpdate = this.vrCameraNeedsUpdate || this.bananaFov !== e.fov || this.bananaReal_aspect !== e.aspect * this.bananaAspect || this.bananaNear !== e.near || this.bananaFar !== e.far,
  23111. this.vrCameraNeedsUpdate) {
  23112. this.vrCameraNeedsUpdate = !1,
  23113. console.debug("vrCameraUpdate"),
  23114. this.bananaFocus = e.focus,
  23115. this.bananaFov = e.fov,
  23116. this.bananaReal_aspect = e.aspect * this.bananaAspect,
  23117. this.bananaNear = e.near,
  23118. this.bananaFar = e.far,
  23119. console.debug(e.aspect),
  23120. this.bananaFocus = 10;
  23121. 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);
  23122. this.eyeLeft.elements[12] = -r,
  23123. this.eyeRight.elements[12] = r,
  23124. t = -a * this.bananaReal_aspect + o,
  23125. i = a * this.bananaReal_aspect + o,
  23126. n.elements[0] = 2 * this.bananaNear / (i - t),
  23127. n.elements[8] = (i + t) / (i - t),
  23128. this.cameraL.projectionMatrix.copy(n),
  23129. t = -a * this.bananaReal_aspect - o,
  23130. i = a * this.bananaReal_aspect - o,
  23131. n.elements[0] = 2 * this.bananaNear / (i - t),
  23132. n.elements[8] = (i + t) / (i - t),
  23133. this.cameraR.projectionMatrix.copy(n)
  23134. }
  23135. this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(this.eyeLeft),
  23136. this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(this.eyeRight)
  23137. }
  23138. }
  23139. ,
  23140. h.prototype.boluoGetTexture = function(e) {
  23141. var t = new M.TextureLoader;
  23142. return t.crossOrigin = "anonymous",
  23143. t.load(e)
  23144. }
  23145. ,
  23146. h.prototype.updateScreenSize = function(e) {
  23147. var t, i, n, r = !1;
  23148. e && !e.resize && null != e.width && null != e.height ? (i = e.width,
  23149. n = e.height,
  23150. r = !0,
  23151. t = 1) : (i = $("#player").width(),
  23152. n = $("#player").height(),
  23153. e && e.resize && (o = this.renderWidth,
  23154. a = this.renderHeight),
  23155. i === o && n === a && !this.forceUpdateSize || (o = i,
  23156. a = n,
  23157. r = !0,
  23158. t = window.devicePixelRatio)),
  23159. r && (this.setSize(i, n, t),
  23160. this.forceUpdateSize = !1)
  23161. }
  23162. ,
  23163. h.prototype.updateComponents = function() {
  23164. for (var e = Math.min(1, this.updateClock.getDelta()), t = 0; t < this.updateListeners.length; t++)
  23165. this.updateListeners[t].update(e)
  23166. }
  23167. ,
  23168. h.prototype.suspend = function() {
  23169. this.started = !1,
  23170. this.suspendedObjects = this.scene.children.map(function(e) {
  23171. return this.scene.remove(e),
  23172. e
  23173. }
  23174. .bind(this)),
  23175. this.render()
  23176. }
  23177. ,
  23178. h.prototype.resume = function() {
  23179. this.suspendedObjects.forEach(function(e) {
  23180. this.scene.add(e)
  23181. }
  23182. .bind(this)),
  23183. this.suspendedObjects = [],
  23184. this.started = !0,
  23185. b()
  23186. }
  23187. ;
  23188. var g, m, v, y, A, C, I, P, O, L, D, N, F, E, _, b = function() {
  23189. this.started && (window.requestAnimationFrame(b),
  23190. this.updateScreenSize(),
  23191. this.updateComponents(),
  23192. this.updateTextureMemory(),
  23193. this.render(),
  23194. this.emit(r.AfterRender))
  23195. };
  23196. h.prototype.getImageData = (E = document.createElement("canvas"),
  23197. _ = E.getContext("2d"),
  23198. function(e, t, i) {
  23199. return E.width === t && E.height === i || (E.width = t,
  23200. E.height = i),
  23201. _.drawImage(e, 0, 0, t, i),
  23202. _.getImageData(0, 0, t, i)
  23203. }
  23204. ),
  23205. h.prototype.initSizedTexture2D = function(e, t, i) {
  23206. var n = this.renderer
  23207. , r = n.context
  23208. , o = n.state
  23209. , a = new M.Texture(null);
  23210. !(a.flipY = !1) !== i && (i = !1),
  23211. a.generateMipmaps = i;
  23212. var s = n.paramThreeToGL(a.format)
  23213. , l = n.paramThreeToGL(a.type)
  23214. , c = n.properties.get(a)
  23215. , h = r.createTexture();
  23216. o.bindTexture(r.TEXTURE_2D, h),
  23217. r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL, a.flipY),
  23218. r.texImage2D(r.TEXTURE_2D, 0, s, e, e, 0, s, l, null),
  23219. a.wrapS = t,
  23220. a.wrapT = t;
  23221. var u = n.paramThreeToGL(t);
  23222. return r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_S, u),
  23223. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_T, u),
  23224. i ? (a.magFilter = M.LinearFilter,
  23225. a.minFilter = M.LinearMipMapLinearFilter,
  23226. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MAG_FILTER, r.LINEAR),
  23227. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, r.LINEAR_MIPMAP_NEAREST),
  23228. r.generateMipmap(r.TEXTURE_2D)) : (a.magFilter = M.LinearFilter,
  23229. a.minFilter = M.LinearFilter,
  23230. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MAG_FILTER, r.LINEAR),
  23231. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, r.LINEAR)),
  23232. o.bindTexture(r.TEXTURE_2D, null),
  23233. c.__webglTexture = h,
  23234. a
  23235. }
  23236. ,
  23237. h.prototype.initSizedCubeMap = function(e, t) {
  23238. var i = this.renderer
  23239. , n = i.context
  23240. , r = i.state
  23241. , o = new M.CubeTexture([null, null, null, null, null, null]);
  23242. o.flipY = !1,
  23243. o.generateMipmaps = t;
  23244. var a = i.paramThreeToGL(o.format)
  23245. , s = i.paramThreeToGL(o.type)
  23246. , l = i.properties.get(o)
  23247. , c = n.createTexture();
  23248. r.bindTexture(n.TEXTURE_CUBE_MAP, c),
  23249. n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL, o.flipY);
  23250. for (var h = 0; h < 6; h++)
  23251. n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + h, 0, a, e, e, 0, a, s, null);
  23252. return t ? (o.magFilter = M.LinearFilter,
  23253. o.minFilter = M.LinearMipMapLinearFilter,
  23254. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  23255. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR_MIPMAP_LINEAR),
  23256. n.texParameteri(n.TEXTURE_CUBE_MAP, n.GENERATE_MIPMAP, n.TRUE),
  23257. n.generateMipmap(n.TEXTURE_CUBE_MAP)) : (o.magFilter = M.LinearFilter,
  23258. o.minFilter = M.LinearFilter,
  23259. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  23260. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR)),
  23261. r.bindTexture(n.TEXTURE_CUBE_MAP, null),
  23262. l.__image__webglTextureCube = c,
  23263. o
  23264. }
  23265. ,
  23266. h.prototype.deallocateCubeTexture = function(e) {
  23267. var t = this.renderer
  23268. , i = t.context
  23269. , n = t.properties.get(e);
  23270. i.deleteTexture(n.__image__webglTextureCube)
  23271. }
  23272. ,
  23273. h.prototype.uploadTexture2D = function(e, t, i, n, r, o) {
  23274. var a = this.renderer
  23275. , s = a.context
  23276. , l = a.state
  23277. , c = a.properties.get(t);
  23278. l.bindTexture(s.TEXTURE_2D, c.__webglTexture),
  23279. s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, t.flipY),
  23280. s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  23281. s.pixelStorei(s.UNPACK_ALIGNMENT, t.unpackAlignment),
  23282. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_S, a.paramThreeToGL(t.wrapS)),
  23283. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_T, a.paramThreeToGL(t.wrapT)),
  23284. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MAG_FILTER, a.paramThreeToGL(t.magFilter)),
  23285. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MIN_FILTER, a.paramThreeToGL(t.minFilter)),
  23286. s.texSubImage2D(s.TEXTURE_2D, 0, i, n, s.RGBA, s.UNSIGNED_BYTE, e),
  23287. t.generateMipmaps && s.generateMipmap(s.TEXTURE_2D),
  23288. l.bindTexture(s.TEXTURE_2D, null)
  23289. }
  23290. ,
  23291. h.prototype.uploadTexture3D = function(e, t, i, n, r, o, a) {
  23292. var s = this.renderer
  23293. , l = s.context
  23294. , c = s.state
  23295. , h = s.properties.get(t);
  23296. c.bindTexture(l.TEXTURE_CUBE_MAP, h.__image__webglTextureCube),
  23297. l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL, t.flipY),
  23298. l.texSubImage2D(r, 0, i, n, l.RGBA, l.UNSIGNED_BYTE, e),
  23299. t.generateMipmaps && l.generateMipmap(l.TEXTURE_CUBE_MAP),
  23300. c.bindTexture(l.TEXTURE_CUBE_MAP, null)
  23301. }
  23302. ,
  23303. h.prototype.rebuildMipMaps2D = function(e) {
  23304. var t = this.renderer
  23305. , i = t.context
  23306. , n = t.state;
  23307. t.properties.get(e),
  23308. i.generateMipmap(i.TEXTURE_2D),
  23309. n.bindTexture(i.TEXTURE_2D, null)
  23310. }
  23311. ,
  23312. h.prototype.rebuildMipMaps3D = function(e) {
  23313. var t = this.renderer
  23314. , i = t.context
  23315. , n = t.state
  23316. , r = t.properties.get(e);
  23317. n.bindTexture(i.TEXTURE_CUBE_MAP, r.__image__webglTextureCube),
  23318. i.generateMipmap(i.TEXTURE_CUBE_MAP),
  23319. n.bindTexture(i.TEXTURE_CUBE_MAP, null)
  23320. }
  23321. ,
  23322. h.prototype.renderToCubeMap = (P = !1,
  23323. F = N = D = L = O = null,
  23324. function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  23325. this.renderer.context,
  23326. P || ((L = new M.OrthographicCamera(-.5,.5,.5,-.5,-200,200)).position.z = 150,
  23327. (O = new M.Scene).add(L),
  23328. D = new M.ShaderMaterial({
  23329. uniforms: {
  23330. tDiffuse: {
  23331. type: "t",
  23332. value: null
  23333. },
  23334. alpha: {
  23335. type: "f",
  23336. value: 1
  23337. }
  23338. },
  23339. vertexShader: R.basicTextured.vertexShader,
  23340. fragmentShader: R.basicTextured.fragmentShader,
  23341. depthWrite: !1,
  23342. depthTest: !1,
  23343. side: M.DoubleSide
  23344. }),
  23345. N = new M.PlaneBufferGeometry(1,1),
  23346. (F = new M.Mesh(N,D)).position.z = 0,
  23347. O.add(F),
  23348. P = !0);
  23349. var m = N.getAttribute("uv");
  23350. m.setDynamic(!0),
  23351. m.needsUpdate = !0;
  23352. var v = m.array
  23353. , y = r / i
  23354. , A = o / n
  23355. , C = a / i
  23356. , I = s / n;
  23357. v[0] = y,
  23358. v[1] = A + I,
  23359. v[2] = y + C,
  23360. v[3] = A + I,
  23361. v[4] = y,
  23362. v[5] = A,
  23363. v[6] = y + C,
  23364. v[7] = A;
  23365. var E = N.getAttribute("position");
  23366. E.setDynamic(!0),
  23367. E.needsUpdate = !0;
  23368. var _ = E.array
  23369. , b = l / t.width - .5
  23370. , w = c / t.height - .5
  23371. , T = h / t.width
  23372. , x = u / t.height;
  23373. _[0] = b,
  23374. _[1] = w + x,
  23375. _[3] = b + T,
  23376. _[4] = w + x,
  23377. _[6] = b,
  23378. _[7] = w,
  23379. _[9] = b + T,
  23380. _[10] = w,
  23381. this.renderer.properties.get(e),
  23382. D.uniforms.tDiffuse.value = e,
  23383. D.blending = p || M.NoBlending,
  23384. D.transparent = !!f,
  23385. null != g || (g = 1),
  23386. D.uniforms.alpha.value = g,
  23387. D.needUpdate = !0,
  23388. t.activeCubeFace = d,
  23389. t.viewport.set(0, 0, t.width, t.height);
  23390. var S = this.renderer.autoClear;
  23391. this.renderer.autoClear = !1,
  23392. this.renderer.render(O, L, t, !1),
  23393. this.renderer.autoClear = S
  23394. }
  23395. ),
  23396. h.prototype.copyCubeMap = (g = !1,
  23397. C = A = y = v = m = null,
  23398. I = new M.Euler,
  23399. new M.Vector3,
  23400. function(e, t, i, n, r, o, a, s, l) {
  23401. this.renderer,
  23402. g || ((v = new M.OrthographicCamera(-1,1,1,-1,0,200)).position.set(0, 0, 0),
  23403. (m = new M.Scene).add(v),
  23404. y = new M.ShaderMaterial({
  23405. uniforms: {
  23406. tDiffuse: {
  23407. type: "t",
  23408. value: null
  23409. },
  23410. alpha: {
  23411. type: "f",
  23412. value: 1
  23413. }
  23414. },
  23415. vertexShader: R.copyCubeMap.vertexShader,
  23416. fragmentShader: R.copyCubeMap.fragmentShader,
  23417. depthWrite: !1,
  23418. depthTest: !1,
  23419. side: M.DoubleSide
  23420. }),
  23421. A = new M.BoxGeometry(2,2,2),
  23422. C = new M.Mesh(A,y),
  23423. m.add(C),
  23424. g = !0);
  23425. for (var c = 0; c < 6; c++)
  23426. h.getCubeOrientationForCubeFace(c, I),
  23427. C.rotation.copy(I),
  23428. C.matrixWorldNeedsUpdate = !0,
  23429. C.updateMatrixWorld(),
  23430. y.uniforms.tDiffuse.value = e,
  23431. y.blending = a || M.NoBlending,
  23432. y.transparent = !!s,
  23433. null != l || (l = 1),
  23434. y.uniforms.alpha.value = l,
  23435. y.needUpdate = !0,
  23436. t.activeCubeFace = c,
  23437. t.viewport.set(0, 0, r, o),
  23438. this.renderer.render(m, v, t, !1)
  23439. }
  23440. ),
  23441. h.getLookAtForCubeFace = function(e, t) {
  23442. switch (e) {
  23443. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  23444. t.set(1, 0, 0);
  23445. break;
  23446. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  23447. t.set(-1, 0, 0);
  23448. break;
  23449. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  23450. t.set(0, 1, 0);
  23451. break;
  23452. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  23453. t.set(0, -1, 0);
  23454. break;
  23455. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  23456. t.set(0, 0, 1);
  23457. break;
  23458. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  23459. t.set(0, 0, -1)
  23460. }
  23461. }
  23462. ,
  23463. h.getCubeOrientationForCubeFace = function(e, t) {
  23464. switch (e) {
  23465. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  23466. t.set(0, -Math.PI / 2, 0);
  23467. break;
  23468. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  23469. t.set(0, Math.PI / 2, 0);
  23470. break;
  23471. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  23472. t.set(Math.PI / 2, Math.PI, 0);
  23473. break;
  23474. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  23475. t.set(-Math.PI / 2, Math.PI, 0);
  23476. break;
  23477. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  23478. t.set(0, -Math.PI, 0);
  23479. break;
  23480. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  23481. t.set(0, 0, 0)
  23482. }
  23483. }
  23484. ,
  23485. t.exports = h
  23486. }
  23487. , {
  23488. "../enum/GLCubeFaces": 25,
  23489. "../enum/GLTextureType": 26,
  23490. "../enum/SceneRendererEvents": 43,
  23491. "../exception/BasicException": 55,
  23492. "../exception/RendererCreationException": 57,
  23493. "../settings": 166,
  23494. "../shaders": 167,
  23495. "../util/browser": 182,
  23496. events: 202,
  23497. three: 217
  23498. }],
  23499. 159: [function(e, t, i) {
  23500. "use strict";
  23501. function n(e) {
  23502. this.messenger = new a(e),
  23503. this.clientKey = null
  23504. }
  23505. var o = e("../util/ajax")
  23506. , r = e("./PostMessageType")
  23507. , a = e("./postmessage")
  23508. , s = e("./VersionInfo")
  23509. , l = e("events").EventEmitter
  23510. , c = window.location.origin + "/api/v1/user/";
  23511. (n.prototype = Object.create(l.prototype)).bindEvents = function() {
  23512. this.messenger.on(r.ACTION, this.onMessageReceived.bind(this))
  23513. }
  23514. ,
  23515. n.prototype.waitForConnection = function() {
  23516. return new Promise(function(t, i) {
  23517. this.messenger.on(r.CONNECT, function(e) {
  23518. this.onConnectionReceived(e).then(t.bind(this, e.sdkVersion), i.bind())
  23519. }
  23520. .bind(this))
  23521. }
  23522. .bind(this))
  23523. }
  23524. ,
  23525. n.prototype.onConnectionReceived = function(i) {
  23526. return this.messenger.setTarget(i.source, i.origin),
  23527. this.verifyConnection(i).then(function(e, t) {
  23528. this.messenger.send({
  23529. type: r.ACCEPT,
  23530. toId: i.fromId,
  23531. warning: t
  23532. }),
  23533. this.clientKey = e,
  23534. this.messenger.removeAllListeners(r.CONNECT),
  23535. this.bindEvents()
  23536. }
  23537. .bind(this), function(e) {
  23538. this.messenger.send({
  23539. type: r.REJECT,
  23540. toId: i.fromId,
  23541. reason: e
  23542. }),
  23543. this.messenger.setTarget()
  23544. }
  23545. .bind(this))
  23546. }
  23547. ,
  23548. n.prototype.verifyConnection = function(r) {
  23549. return new Promise(function(e, t) {
  23550. var i;
  23551. if (s.isDeprecated(r.sdkVersion))
  23552. i = "这个版本正在被弃用";
  23553. else if (!s.isSupported(r.sdkVersion))
  23554. return t("不支持此版本的SDK");
  23555. var n = {
  23556. cache: !1,
  23557. headers: {
  23558. "X-port-Application-Key": r.applicationKey,
  23559. "X-port-Referrer": r.origin
  23560. }
  23561. };
  23562. o.get(c, n).done(e.bind(this, r.applicationKey, i)).fail(t.bind(this, "key/referrer mismatch"))
  23563. }
  23564. )
  23565. }
  23566. ,
  23567. n.prototype.onMessageReceived = function(t) {
  23568. if (this.validateClientApplicationKey(t.applicationKey)) {
  23569. var i = this;
  23570. t.onDone = function(e) {
  23571. e.toId = t.fromId,
  23572. e.uid = t.uid,
  23573. e.type = r.RESPONSE,
  23574. i.messenger.send(e)
  23575. }
  23576. ,
  23577. this.emit(r.ACTION, t)
  23578. }
  23579. }
  23580. ,
  23581. n.prototype.validateClientApplicationKey = function(e) {
  23582. return this.clientKey === e
  23583. }
  23584. ,
  23585. n.prototype.sendEvent = function(e, t) {
  23586. this.messenger.send({
  23587. type: r.EVENT,
  23588. eventType: e,
  23589. eventData: t
  23590. })
  23591. }
  23592. ,
  23593. t.exports = n
  23594. }
  23595. , {
  23596. "../util/ajax": 181,
  23597. "./PostMessageType": 160,
  23598. "./VersionInfo": 163,
  23599. "./postmessage": 165,
  23600. events: 202
  23601. }],
  23602. 160: [function(e, t, i) {
  23603. "use strict";
  23604. t.exports = Object.freeze({
  23605. CONNECT: "postmessage.connect",
  23606. ACCEPT: "postmessage.accept",
  23607. REJECT: "postmessage.reject",
  23608. ACTION: "postmessage.action",
  23609. RESPONSE: "postmessage.response",
  23610. EVENT: "postmessage.event"
  23611. })
  23612. }
  23613. , {}],
  23614. 161: [function(e, t, i) {
  23615. "use strict";
  23616. t.exports = Object.freeze({
  23617. MOVE: "sdk.move",
  23618. ENTER_PANO: "sdk.enterpano",
  23619. MODEL_LOADED: "sdk.modelloaded"
  23620. })
  23621. }
  23622. , {}],
  23623. 162: [function(e, t, i) {
  23624. "use strict";
  23625. t.exports = Object.freeze({
  23626. FLY: "transition.fly",
  23627. FADEOUT: "transition.fade",
  23628. INSTANT: "transition.instant"
  23629. })
  23630. }
  23631. , {}],
  23632. 163: [function(e, t, i) {
  23633. "use strict";
  23634. t.exports = {
  23635. current: "1.0",
  23636. supported: ["1.0"],
  23637. deprecated: [],
  23638. isSupported: function(e) {
  23639. return -1 !== this.supported.indexOf(e)
  23640. },
  23641. isDeprecated: function(e) {
  23642. return -1 !== this.deprecated.indexOf(e)
  23643. },
  23644. isValid: function(e) {
  23645. return this.isSupported(e) || this.isDeprecated(e)
  23646. }
  23647. }
  23648. }
  23649. , {}],
  23650. 164: [function(q, X, e) {
  23651. (function(e) {
  23652. "use strict";
  23653. function r(e, t, i) {
  23654. e = e && e.toLowerCase().trim();
  23655. var n = new C.UP.clone
  23656. , r = Math.PI / 3
  23657. , o = Math.PI / 2;
  23658. switch (e) {
  23659. case "left":
  23660. i.copy(t),
  23661. i.applyAxisAngle(n, o);
  23662. break;
  23663. case "right":
  23664. i.copy(t),
  23665. i.applyAxisAngle(n, -o);
  23666. break;
  23667. case "forwardleft":
  23668. i.copy(t),
  23669. i.applyAxisAngle(n, r);
  23670. break;
  23671. case "forwardright":
  23672. i.copy(t),
  23673. i.applyAxisAngle(n, -r);
  23674. break;
  23675. case "forward":
  23676. default:
  23677. i.copy(t)
  23678. }
  23679. return i
  23680. }
  23681. function o(e, t) {
  23682. if (e) {
  23683. var i = {
  23684. pano: e,
  23685. lookAtPoint: null,
  23686. duration: null,
  23687. maxDistanceOverride: null,
  23688. skipWarpingCheck: !1
  23689. };
  23690. this.player.flyToPano(i, function() {
  23691. t && t({
  23692. success: !0,
  23693. message: "Transition complete."
  23694. })
  23695. })
  23696. } else
  23697. M.warn("Showcase -> clickPanoObject: Unable to find pano."),
  23698. t && t({
  23699. success: !1,
  23700. error: "Unable to find pano."
  23701. })
  23702. }
  23703. function a(e, t) {
  23704. t.copy(C.FORWARD),
  23705. e.getDirection(t)
  23706. }
  23707. function c(i) {
  23708. return {
  23709. panos: i.panos.list.map(function(e) {
  23710. var t = y.getCubemapUrls(i.urls, e.id, "high")[A.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z];
  23711. return {
  23712. uuid: e.id,
  23713. aligned: e.alignmentType === g.ALIGNED,
  23714. neighbourUUIDs: e.neighbourUUIDs.slice(),
  23715. position: function(e) {
  23716. return e.alignmentType !== g.ALIGNED ? null : {
  23717. x: e.position.x,
  23718. y: e.position.y,
  23719. z: e.position.z
  23720. }
  23721. }(e),
  23722. rotation: function(e) {
  23723. var t = (new h.Euler).setFromQuaternion(e.quaternion, "YXZ");
  23724. return {
  23725. x: h.Math.radToDeg(t._x),
  23726. y: h.Math.radToDeg(t._y),
  23727. z: h.Math.radToDeg(t._z)
  23728. }
  23729. }(e),
  23730. thumbnail: t
  23731. }
  23732. })
  23733. }
  23734. }
  23735. 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"),
  23736. q("../enum/PlayerEvents")), b = q("../sdk/SdkEvents"), w = (C = q("../enum/Vectors"),
  23737. q("../enum/ControlEvents")), T = q("../enum/RenderLayers"), x = (q("../constants"),
  23738. q("../settings")), S = q("../lib/jpeg_encoder"), M = new n(e), R = (N.active = !1,
  23739. N.angle = 0,
  23740. N.angleTravelled = 0,
  23741. N.playerDirection = new h.Vector3,
  23742. N.lastFacingDirection = new h.Vector3,
  23743. N.onDone = null,
  23744. N.player = null,
  23745. N.start = function(e, t, i, n) {
  23746. N.active = !0,
  23747. e && t && (t = 0),
  23748. N.angle = e || t,
  23749. N.xAngle = e,
  23750. N.yAngle = t,
  23751. N.angleTravelled = 0,
  23752. N.playerDirection.copy(i.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  23753. i.getDirection(N.playerDirection),
  23754. N.lastFacingDirection.copy(N.playerDirection),
  23755. N.projectVectors(),
  23756. N.onDone = n,
  23757. N.player = i,
  23758. N()
  23759. }
  23760. ,
  23761. N.projectVectors = function() {
  23762. N.xAngle && (N.playerDirection.projectOnPlane(C.UP),
  23763. N.lastFacingDirection.projectOnPlane(C.UP))
  23764. }
  23765. ,
  23766. N), P = (i = new h.Vector3,
  23767. function(e) {
  23768. e ? (i.copy(e.position),
  23769. i.add(e.discPosition),
  23770. s.projectPositionToCanvas(i, this.player.camera, i),
  23771. this.click(i.x, i.y)) : M.warn("Showcase -> clicktagObject: Unable to find tag.")
  23772. }
  23773. ), O = (l = new h.Vector3,
  23774. function(e) {
  23775. var t = this.player.getDirection();
  23776. l.copy(t);
  23777. var i = l.y;
  23778. l.y = 0,
  23779. l.normalize();
  23780. var n = h.Math.radToDeg(l.angleTo(t)) * (i < 0 ? -1 : 1);
  23781. if (this.player.mode !== I.DOLLHOUSE && this.player.mode !== I.PANORAMA)
  23782. return 0 !== e && M.warn("Cannot rotate in y direction when in " + this.player.mode + " mode"),
  23783. 0;
  23784. this.player.mode === I.DOLLHOUSE && (n = -n);
  23785. var r = function() {
  23786. return this.player.mode === I.PANORAMA ? x.insideLookLimitUp : this.player.mode === I.DOLLHOUSE ? 90 - h.Math.radToDeg(x.dollhouseDefault.minPolarAngle) : null
  23787. }
  23788. .call(this) - .1
  23789. , o = function() {
  23790. return this.player.mode === I.PANORAMA ? x.insideLookLimitDown : this.player.mode === I.DOLLHOUSE ? 90 - h.Math.radToDeg(x.dollhouseDefault.maxPolarAngle) : null
  23791. }
  23792. .call(this) + .1
  23793. , a = n + e;
  23794. r < a ? a = r : a < o && (a = o);
  23795. var s = a - n;
  23796. return 0 < e && s < .01 && (s = 0),
  23797. e < 0 && -.01 < s && (s = 0),
  23798. s
  23799. }
  23800. ), L = (t = new h.Euler,
  23801. function(e) {
  23802. return t.setFromQuaternion(e.quaternion, "YXZ"),
  23803. {
  23804. position: {
  23805. x: e.position.x,
  23806. y: e.position.y,
  23807. z: e.position.z
  23808. },
  23809. rotation: {
  23810. x: h.Math.radToDeg(t.x),
  23811. y: h.Math.radToDeg(t.y),
  23812. z: 0
  23813. },
  23814. pano: e.currentPano ? e.currentPano.id : null,
  23815. mode: e.mode
  23816. }
  23817. }
  23818. ), D = null;
  23819. function N() {
  23820. N.playerDirection.copy(N.player.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  23821. N.player.getDirection(N.playerDirection),
  23822. N.projectVectors();
  23823. var e = N.playerDirection.angleTo(N.lastFacingDirection);
  23824. (N.angleTravelled += Math.abs(e)) >= Math.abs(N.angle) ? (N.active = !1,
  23825. N.onDone && (0,
  23826. N.onDone)()) : (N.lastFacingDirection.copy(N.playerDirection),
  23827. window.setTimeout(N, 4))
  23828. }
  23829. X.exports = {
  23830. init: function(e, t, i, n, r) {
  23831. Y.init(e, t, i, r),
  23832. D = new Promise(function(e, t) {
  23833. i.on(_.Ready, function() {
  23834. e()
  23835. })
  23836. }
  23837. .bind(this));
  23838. var o = new u(window)
  23839. , a = o.waitForConnection();
  23840. a.then(function(e) {
  23841. o.on(f.ACTION, Y.onMessageReceive.bind(Y))
  23842. });
  23843. var s, l = (s = Date.now(),
  23844. function() {
  23845. if (!(Date.now() - s < 100)) {
  23846. var e = L(i);
  23847. o.sendEvent(b.MOVE, {
  23848. state: e
  23849. }),
  23850. s = Date.now()
  23851. }
  23852. }
  23853. );
  23854. i.on(_.Move, l),
  23855. i.on(_.ViewChanged, l),
  23856. n.on(p.ActiveModelChanged, function(e) {
  23857. function t(e) {
  23858. var t, i = e.newPano.id;
  23859. e.oldPano && (t = e.oldPano.id),
  23860. i !== t && o.sendEvent(b.ENTER_PANO, {
  23861. oldPano: t,
  23862. newPano: i
  23863. })
  23864. }
  23865. var i = e.model
  23866. , n = e.oldModel;
  23867. Y.model = i,
  23868. a.then(function() {
  23869. o.sendEvent(b.MODEL_LOADED, {
  23870. metadata: c(i)
  23871. })
  23872. }),
  23873. n && n.panos.forEach(function(e) {
  23874. e.removeEventListener("enter", t)
  23875. }),
  23876. i.panos.forEach(function(e) {
  23877. e.on("enter", t)
  23878. })
  23879. })
  23880. }
  23881. };
  23882. var F, B, V, k, U, H, z, G, W, j, Y = {
  23883. director: null,
  23884. player: null,
  23885. controls: null,
  23886. sceneRenderer: null,
  23887. model: null,
  23888. init: function(e, t, i, n) {
  23889. this.director = e,
  23890. this.player = i,
  23891. this.controls = t,
  23892. this.sceneRenderer = n
  23893. },
  23894. handleToObject: {},
  23895. objectToHandle: {},
  23896. handleCount: 0,
  23897. onMessageReceive: function(e) {
  23898. if (e) {
  23899. var t = e.targetFunction
  23900. , i = e.params
  23901. , n = e.onDone;
  23902. t && this[t] && this[t](i, n)
  23903. }
  23904. },
  23905. waitForInit: function(e, t) {
  23906. D.then(t.bind({
  23907. success: !0,
  23908. message: "Init complete."
  23909. }))
  23910. },
  23911. moveToPano: (W = new h.Euler(0,0,0,"YXZ"),
  23912. j = new h.Quaternion,
  23913. function(e, t) {
  23914. var i = e.pano
  23915. , n = e.rotation
  23916. , r = e.transition;
  23917. if (!this.model)
  23918. return t({
  23919. success: !1,
  23920. error: "The model has not been loaded yet"
  23921. });
  23922. var o = this.model.panos.get(i);
  23923. if (!o)
  23924. return t({
  23925. success: !1,
  23926. error: i + " does not exist in this model"
  23927. });
  23928. if (!n)
  23929. return t({
  23930. sucess: !1,
  23931. erorr: n + " is not a valid rotation"
  23932. });
  23933. W.set(h.Math.degToRad(n.x || 0), h.Math.degToRad(n.y || 0), h.Math.degToRad(n.z || 0), "YXZ"),
  23934. console.log(n.z);
  23935. var a = {
  23936. success: !0,
  23937. message: i
  23938. };
  23939. if (r === v.FADEOUT)
  23940. j.setFromEuler(W),
  23941. this.player.warpToPano(o, j, null, null, E.BLACK, null, null, t.bind(this, a));
  23942. else {
  23943. var s, l;
  23944. r === v.INSTANT && (l = s = 0);
  23945. var c = C.FORWARD.clone().applyEuler(W).add(o.position);
  23946. this.player.flyToPano({
  23947. pano: o,
  23948. lookAtPoint: c,
  23949. duration: s,
  23950. aimDuration: l
  23951. }, t.bind(this, a))
  23952. }
  23953. }
  23954. ),
  23955. moveInDirection: function(e, t) {
  23956. var i = e.direction;
  23957. return void 0 === m[i] ? (M.warn("Showcase -> moveInDirection: Cannot move in invalid direction."),
  23958. void (t && t({
  23959. success: !1,
  23960. error: "Invalid direction."
  23961. }))) : void this.player.flyLocalDirection(C[i].clone()).then(function(e) {
  23962. t(e ? {
  23963. success: !0,
  23964. message: "moved " + i
  23965. } : {
  23966. success: !1,
  23967. error: "Cannot move in direction: " + i
  23968. })
  23969. })
  23970. },
  23971. getPose: function(e, t) {
  23972. return this.player.camera.position,
  23973. (new h.Euler).setFromQuaternion(this.player.camera.quaternion, "YXZ"),
  23974. t({
  23975. success: !0,
  23976. message: L(this.player)
  23977. })
  23978. },
  23979. takeScreenShot: (z = new h.PerspectiveCamera,
  23980. G = new h.WebGLRenderTarget,
  23981. function(e, t) {
  23982. if (!e.resolution)
  23983. return t({
  23984. success: !1,
  23985. error: "An invalid resolution was specified"
  23986. });
  23987. if (-1 === e.resolution.width || -1 === e.resolution.height) {
  23988. var i = this.sceneRenderer.renderer.getSize();
  23989. e.resolution.width = i.width,
  23990. e.resolution.height = i.height
  23991. }
  23992. z.layers.set(T.DEFAULT),
  23993. e.visibleObjects && (e.visibleObjects.showtags && z.layers.enable(T.TAG),
  23994. e.visibleObjects.showPucks && z.layers.enable(T.PANOMARKERS),
  23995. e.visibleObjects.showReticule && z.layers.enable(T.RETICULE));
  23996. var n = e.resolution.width
  23997. , r = e.resolution.height
  23998. , o = n / r;
  23999. z.position.copy(this.sceneRenderer.camera.position),
  24000. z.quaternion.copy(this.sceneRenderer.camera.quaternion),
  24001. z.projectionMatrix.copy(this.player.camera.projectionMatrix),
  24002. z.projectionMatrix.elements[0] = this.player.camera.projectionMatrix.elements[5] / o,
  24003. G.setSize(n, r),
  24004. this.sceneRenderer.renderer.render(this.sceneRenderer.scene, z, G);
  24005. var a = new Uint8Array(n * r * 4);
  24006. this.sceneRenderer.renderer.readRenderTargetPixels(G, 0, 0, n, r, a);
  24007. var s = S.encode({
  24008. data: a,
  24009. width: n,
  24010. height: r,
  24011. heading: 180,
  24012. pitch: 0
  24013. }, {
  24014. quality: 75,
  24015. flipY: !0
  24016. });
  24017. t({
  24018. success: !0,
  24019. message: "data:image/jpg;base64," + d.uint8ToBase64(s.data)
  24020. })
  24021. }
  24022. ),
  24023. findRankedPano: (U = new h.Vector3,
  24024. H = new h.Vector3,
  24025. function(e, t) {
  24026. a(this.player, H),
  24027. r(t, H, U);
  24028. var i = this.player.rankedPanoInDirection(e, U);
  24029. if (i) {
  24030. var n = this.objectToHandle[i.id];
  24031. return n || (this.objectToHandle[i.id] = n = this.handleCount++,
  24032. this.handleToObject[n] = i),
  24033. n
  24034. }
  24035. return M.warn("Showcase -> findRankedPano: Unable to find nearby pano."),
  24036. -1
  24037. }
  24038. ),
  24039. findRankedtag: (V = new h.Vector3,
  24040. k = new h.Vector3,
  24041. function(e, t) {
  24042. a(this.player, k),
  24043. r(t, k, V);
  24044. var i = this.player.rankedtagInDirection(e, V);
  24045. if (i) {
  24046. var n = this.objectToHandle[i.sid];
  24047. return n || (this.objectToHandle[i.sid] = n = this.handleCount++,
  24048. this.handleToObject[n] = i),
  24049. n
  24050. }
  24051. return M.warn("Showcase -> findRankedtag: Unable to find nearby tag."),
  24052. -1
  24053. }
  24054. ),
  24055. clickNearesttag: function(e) {
  24056. this.clickRankedtag(0, e)
  24057. },
  24058. clickRankedtag: function(e, t) {
  24059. var i = function(e, t) {
  24060. var i = this.findRankedtag(e, t);
  24061. return 0 <= i ? this.handleToObject[i] : (M.warn("Showcase -> findRankedtagObject: Unable to find nearby tag."),
  24062. null)
  24063. }
  24064. .call(this, e, t);
  24065. i && P.call(this, i)
  24066. },
  24067. clickNearestPano: function(e, t) {
  24068. this.clickRankedPano(0, e, t)
  24069. },
  24070. clickRankedPano: function(e, t, i) {
  24071. var n = function(e, t) {
  24072. var i = this.findRankedPano(e, t);
  24073. return 0 <= i ? this.handleToObject[i] : (M.warn("Showcase -> findRankedPanoObject: Unable to find nearby pano."),
  24074. null)
  24075. }
  24076. .call(this, e, t);
  24077. n ? o.call(this, n, i) : i(null)
  24078. },
  24079. clickPano: function(e, t) {
  24080. var i = this.handleTable[e];
  24081. i ? o.call(this, i, t) : t(null)
  24082. },
  24083. rotateDirection: function(e, t) {
  24084. var i = e.direction
  24085. , n = e.angle;
  24086. if (!R.active) {
  24087. var r = 0
  24088. , o = 0
  24089. , a = 0
  24090. , s = 0;
  24091. if (!n || isNaN(n))
  24092. return M.warn("Showcase -> rotateDirection: Invalid rotation angle."),
  24093. void (t && t({
  24094. success: !1,
  24095. error: "Invalid rotation angle."
  24096. }));
  24097. if (this.player.mode === I.TRANSITIONING)
  24098. return M.warn("Automation -> rotateDirection: Cannot rotate while transitioning"),
  24099. void (t && t({
  24100. success: !1,
  24101. error: "Cannot rotate while transitioning"
  24102. }));
  24103. if (i === m.RIGHT || i === m.LEFT)
  24104. i === m.RIGHT && (n = -n),
  24105. r = 0 < n ? -1 : 1,
  24106. a = n;
  24107. else {
  24108. if (i !== m.UP && i !== m.DOWN)
  24109. return M.warn("Showcase -> rotateDirection: Invalid direction for rotation: " + i),
  24110. void (t && t({
  24111. success: !1,
  24112. error: "Invalid direction for rotation."
  24113. }));
  24114. if (this.player.mode === I.FLOORPLAN)
  24115. return M.warn("Showcase -> rotateDirection: Cannot rotate " + i + " in floorplan mode"),
  24116. void (t && t({
  24117. success: !1,
  24118. error: "Cannot rotate " + i + " in floorplan mode"
  24119. }));
  24120. if (i === m.DOWN && (n = -n),
  24121. 0 === (n = O.call(this, n)))
  24122. return M.warn("Showcase -> rotateDirection: Already at maximum rotation in direction: " + i),
  24123. void (t && t({
  24124. success: !1,
  24125. error: "Already at maximum rotation in direction: " + i
  24126. }));
  24127. o = 0 < n ? 1 : -1,
  24128. s = n
  24129. }
  24130. var l = n;
  24131. n = h.Math.degToRad(n),
  24132. a = h.Math.degToRad(a),
  24133. s = h.Math.degToRad(s);
  24134. var c = this.controls.activeControl;
  24135. c.startRotating(r, o),
  24136. R.start(a, s, this.player, function() {
  24137. c.stopRotating(!0),
  24138. t && t({
  24139. success: !0,
  24140. message: "Rotated " + l.toFixed(2) + "° in direction: " + e.direction
  24141. })
  24142. })
  24143. }
  24144. },
  24145. rotate: (F = new h.Vector3,
  24146. B = new h.Vector3,
  24147. function(e, t) {
  24148. var i = e.xAngle
  24149. , n = e.yAngle;
  24150. if (!R.active) {
  24151. if (i = i || 0,
  24152. n = n || 0,
  24153. isNaN(i) || isNaN(n))
  24154. return M.warn("Showcase -> rotate: Invalid rotation angle."),
  24155. void (t && t({
  24156. success: !1,
  24157. error: "Invalid rotation angle."
  24158. }));
  24159. if (this.player.mode === I.TRANSITIONING)
  24160. return M.warn("Automation -> rotate: Cannot rotate while transitioning"),
  24161. void (t && t({
  24162. success: !1,
  24163. error: "Cannot rotate while transitioning"
  24164. }));
  24165. Math.abs(i) < .01 && (i = 0),
  24166. Math.abs(n) < .01 && (n = 0);
  24167. var r = n;
  24168. n = O.call(this, n);
  24169. var o = 0 < r ? "UP" : "DOWN";
  24170. if (!(i = -i) && r && !n)
  24171. return M.warn("Showcase -> rotate: Already at maximum rotation in direction: " + o),
  24172. void (t && t({
  24173. success: !1,
  24174. error: "Already at maximum rotation in direction: " + o
  24175. }));
  24176. n < r && M.warn("Showcase -> rotate: Reached maximum rotation in direction: " + o);
  24177. var a = n;
  24178. n = h.Math.degToRad(n),
  24179. i = h.Math.degToRad(i),
  24180. F.copy(this.player.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  24181. this.player.getDirection(F),
  24182. B.copy(F).applyAxisAngle(C.UP, i),
  24183. B.applyAxisAngle(C.RIGHT, n);
  24184. var s = (F.angleTo(B),
  24185. 0 < i ? -1 : i < 0 ? 1 : 0)
  24186. , l = 0 < n ? 1 : n < 0 ? -1 : 0;
  24187. Math.abs(i) > Math.abs(n) ? l *= Math.abs(n / i) : Math.abs(n) > Math.abs(i) && (s *= Math.abs(i / n));
  24188. var c = this.controls.activeControl;
  24189. c.startRotating(s, l),
  24190. R.start(i, n, this.player, function() {
  24191. c.stopRotating(!0),
  24192. t && t({
  24193. success: !0,
  24194. message: "Rotated " + e.xAngle.toFixed(2) + "° horizontally, " + a.toFixed(2) + "° vertically"
  24195. })
  24196. })
  24197. }
  24198. }
  24199. ),
  24200. panCamera: function(e, i) {
  24201. function t(e) {
  24202. switch (r.removeAllListeners(w.AutoPanComplete),
  24203. r.removeAllListeners(w.AutoPanInterrupt),
  24204. r.removeAllListeners(w.AutoPanClamped),
  24205. e) {
  24206. case w.AutoPanInterrupt:
  24207. i({
  24208. success: !0,
  24209. message: "Camera panning interrupted."
  24210. });
  24211. break;
  24212. case w.AutoPanClamped:
  24213. if (r.autoPanPosition.x !== n.x || r.autoPanPosition.z !== n.z) {
  24214. if (Math.abs(this.player.position.x - r.autoPanPosition.x) < .01 && Math.abs(this.player.position.z - r.autoPanPosition.z) < .01)
  24215. return void i({
  24216. success: !1,
  24217. error: "Already at edge of current model bounds."
  24218. });
  24219. var t = "The view point is outside the bounds for the current model. ";
  24220. t += "The view point was clamped to " + o(r.target.x, r.target.z),
  24221. console.warn(t)
  24222. }
  24223. case w.AutoPanComplete:
  24224. i({
  24225. success: !0,
  24226. message: "Panned camera to position " + o(r.autoPanPosition.x, r.autoPanPosition.z)
  24227. })
  24228. }
  24229. }
  24230. if (this.player.mode !== I.DOLLHOUSE && this.player.mode !== I.FLOORPLAN)
  24231. return i({
  24232. success: !1,
  24233. error: "Camera panning is not available in the current mode: " + this.player.mode
  24234. });
  24235. var n = e.position
  24236. , r = this.player.control;
  24237. r.setAutoPanPosition(n.x, n.z),
  24238. r.autoPan = !0;
  24239. var o = function(e, t) {
  24240. return "(" + e.toFixed(2) + ", " + t.toFixed(2) + ")"
  24241. };
  24242. r.on(w.AutoPanComplete, t.bind(this, w.AutoPanComplete)),
  24243. r.on(w.AutoPanInterrupt, t.bind(this, w.AutoPanInterrupt)),
  24244. r.on(w.AutoPanClamped, t.bind(this, w.AutoPanClamped))
  24245. },
  24246. click: function(e, t) {
  24247. var i = e.x
  24248. , n = e.y;
  24249. !0 === e.percentage && (i = i / 100 * $("#player").width(),
  24250. n = n / 100 * $("#player").height()),
  24251. this.player.handleInputStart(i, n),
  24252. this.player.updateIntersect(),
  24253. this.player.handleInputEnd(i, n)
  24254. },
  24255. mouseOver: function(e, t) {
  24256. var i = e.x
  24257. , n = e.y;
  24258. !0 === e.percentage && (i = i / 100 * $("#player").width(),
  24259. n = n / 100 * $("#player").height()),
  24260. this.player.handleInputMove(i, n),
  24261. this.player.updateIntersect()
  24262. },
  24263. moveToMode: function(e, t) {
  24264. function i(e) {
  24265. t(e ? {
  24266. success: !1,
  24267. error: "Failed to load new mode: " + e
  24268. } : {
  24269. success: !0,
  24270. message: "Moved to new mode: " + n
  24271. })
  24272. }
  24273. var n = e.mode;
  24274. n === I.PANORAMA || n === I.DOLLHOUSE || n === I.FLOORPLAN ? this.director.changeMode(n).then(function() {
  24275. i()
  24276. }, function(e) {
  24277. i(e)
  24278. }) : t({
  24279. success: !1,
  24280. error: "Invalid mode selection"
  24281. })
  24282. }
  24283. }
  24284. }
  24285. ).call(this, "/js/sdk/automation.js")
  24286. }
  24287. , {
  24288. "../constants": 8,
  24289. "../enum/AlignmentType": 17,
  24290. "../enum/ControlEvents": 21,
  24291. "../enum/Direction": 22,
  24292. "../enum/GLCubeFaces": 25,
  24293. "../enum/Keys": 30,
  24294. "../enum/ModelManagerEvents": 33,
  24295. "../enum/PlayerEvents": 40,
  24296. "../enum/RenderLayers": 41,
  24297. "../enum/Vectors": 50,
  24298. "../enum/Viewmode": 51,
  24299. "../enum/WarpStyle": 52,
  24300. "../lib/jpeg_encoder": 94,
  24301. "../sdk/SdkEvents": 161,
  24302. "../settings": 166,
  24303. "../util/common": 185,
  24304. "../util/logger": 189,
  24305. "../util/math": 190,
  24306. "../util/panorama": 191,
  24307. "./ApiHost": 159,
  24308. "./PostMessageType": 160,
  24309. "./TransitionStyles": 162,
  24310. three: 217
  24311. }],
  24312. 165: [function(e, t, i) {
  24313. "use strict";
  24314. function n(e) {
  24315. this.sourceWindow = e,
  24316. this.targetWindow = null,
  24317. this.targetOrigin = null,
  24318. this.id = Math.floor(1e5 * Math.random()),
  24319. this.bindEvents()
  24320. }
  24321. var r = e("./PostMessageType")
  24322. , o = e("events").EventEmitter;
  24323. (n.prototype = Object.create(o.prototype)).bindEvents = function() {
  24324. this.sourceWindow.addEventListener("message", this.onPostmessageReceived.bind(this))
  24325. }
  24326. ,
  24327. n.prototype.setTarget = function(e, t) {
  24328. this.targetWindow = e,
  24329. this.targetOrigin = t
  24330. }
  24331. ,
  24332. n.prototype.onPostmessageReceived = function(e) {
  24333. var t = e.origin || e.originalEvent.origin
  24334. , i = e.source;
  24335. switch (e.data.type) {
  24336. case r.CONNECT:
  24337. break;
  24338. case r.RESPONSE:
  24339. if (this.id !== e.data.toId)
  24340. return;
  24341. default:
  24342. if (!this.validateMessageOrigin(t))
  24343. return
  24344. }
  24345. var n = e.data;
  24346. n.source = i,
  24347. n.origin = t,
  24348. n.timestamp = Date.now(),
  24349. this.emit(e.data.type, n)
  24350. }
  24351. ,
  24352. n.prototype.validateMessageOrigin = function(e) {
  24353. return "*" === this.targetOrigin || e === this.targetOrigin
  24354. }
  24355. ,
  24356. n.prototype.send = function(e) {
  24357. this.targetWindow && this.targetOrigin && (e.fromId = this.id,
  24358. this.targetWindow.postMessage(e, this.targetOrigin))
  24359. }
  24360. ,
  24361. t.exports = n
  24362. }
  24363. , {
  24364. "./PostMessageType": 160,
  24365. events: 202
  24366. }],
  24367. 166: [function(e, t, i) {
  24368. "use strict";
  24369. var n = e("three")
  24370. , r = e("./util/browser")
  24371. , o = e("./enum/Viewmode")
  24372. , a = e("./enum/VROption")
  24373. , s = e("./enum/Colors")
  24374. , l = e("./enum/WarpStyle")
  24375. , c = e("./util/easing")
  24376. , h = e("./util/common")
  24377. , u = e("./util/showcase")
  24378. , d = e("./constants")
  24379. , p = {
  24380. debug: !1,
  24381. version: "2.25.6-0-gd87e5b1",
  24382. languageTag: r.valueFromHash("lang", null),
  24383. pageTitle: "四维虚拟漫游",
  24384. authorizationHeader: u.getAuthorizationHeader(),
  24385. autoplay: r.valueFromHash("play", !1) || !r.inIframe(),
  24386. logLevel: r.valueFromHash("log", 2),
  24387. skyboxRadius: 2500,
  24388. modelBoundsPadding: 5,
  24389. showNeighbors: !1,
  24390. brand: r.valueFromHash("brand", !0),
  24391. showHighlights: r.valueFromHash("hhl", !0) && r.valueFromHash("hr", 1),
  24392. startHighlights: r.valueFromHash("hl", -1),
  24393. specialEdition: r.valueFromHash("bn", 0),
  24394. useWheel: r.valueFromHash("wh", !0),
  24395. crossOrigin: "anonymous",
  24396. fancierTransition: !1,
  24397. wireframe: !1,
  24398. skyboxWireframe: !1,
  24399. modelAlpha: 1,
  24400. highlightPanoSelection: !1,
  24401. showSweeps: !0,
  24402. showSkyboxes: !1,
  24403. showMesh: !0,
  24404. showFloors: !1,
  24405. showFloorDuration: 300,
  24406. showFloorDelay: 300,
  24407. hideFloorDuration: 300,
  24408. hideFloorDelay: 0,
  24409. reticuleOpacityTransitionTime: 250,
  24410. reticuleColor: window.MP_PREFETCHED_MODELDATA.mouseMarkerColor || s.newBlue,
  24411. markerOpacityTransitionTime: 500,
  24412. guiAnimationSpeed: 250,
  24413. highlightAnimationDuration: 500,
  24414. modelComponentLoadSpinnerDelay: 150,
  24415. captureErrors: !1,
  24416. maxMobileTextures: 6,
  24417. minimalMemoryMode: r.valueFromHash("m3", r.isMobile()),
  24418. startupFlyinDelay: 3e3,
  24419. dollhouseDefault: {
  24420. minDistance: 1,//15, //编辑页面给近一些
  24421. maxDistance: 50,
  24422. minPolarAngle: n.Math.degToRad(10),
  24423. maxPolarAngle: n.Math.degToRad(90)
  24424. },
  24425. hideReticuleTimeout: 1e3,
  24426. analytics: {
  24427. inactivityThreshold: 30,
  24428. sessionTrackingRate: .15,
  24429. maxTrackedErrors: 20,
  24430. sessionDurationPingFrequency: 10,
  24431. sessionDurationTimeout: 15
  24432. },
  24433. flydown: {
  24434. movementEasing: "easeInOutQuad",
  24435. movementDelay: .001,
  24436. rotationEasing: "easeInOutQuad",
  24437. rotationDelay: .5,
  24438. modelTextureDelay: .75,
  24439. skyboxDelay: .75
  24440. },
  24441. transition: {
  24442. flySpeed: .001,
  24443. flyTime: 750,
  24444. flytimeMaxDistanceThreshold: 5,
  24445. flytimeDistanceMultiplier: 150,
  24446. aimTime: 1500,
  24447. aimSlowFactor: 1.5,
  24448. blur: .8,
  24449. movementEasing: "easeInOutQuad",
  24450. blendEasing: "easeInOutQuad",
  24451. fastForwardFactor: 3
  24452. },
  24453. show360Views: {
  24454. enabled: !0,
  24455. transitionTime: 1e3
  24456. },
  24457. quickstart: {
  24458. enabled: 1 === r.valueFromHash("qust", 0) || 1 === r.valueFromHash("qs", 0),
  24459. animation: 1400,
  24460. showTextDelay: 500,
  24461. fadeOutDelay: 3e3,
  24462. fovChange: 10
  24463. },
  24464. appConfig: {
  24465. webvr_version: null,
  24466. segment_key: null,
  24467. embedly_key: null,
  24468. branch_key: null,
  24469. keen_write_key: null,
  24470. keen_project_id: null
  24471. },
  24472. vr: {
  24473. enabled: !0,
  24474. allowWebVR: !1,
  24475. option: r.valueFromHash("vr", a.CONTEXTUAL)
  24476. },
  24477. share: {
  24478. enabled: !r.valueFromHash("mls", 0) && r.valueFromHash("brand", !0)
  24479. },
  24480. input: {
  24481. longTapThreshold: 200,
  24482. moveToleranceNDC: .08,
  24483. touchMoveThreshold: 25
  24484. },
  24485. help: {
  24486. modalStayDuration: 600
  24487. },
  24488. immersive: {
  24489. timeToShowAgain: 1250,
  24490. uiStayDuration: 600
  24491. },
  24492. tourInteraction: {
  24493. disabled: "0" === r.valueFromHash("tourcta", null),
  24494. showPauseButton: 1e3,
  24495. showModal: 1500,
  24496. allowNextClick: 200,
  24497. largeModal: "1" === r.valueFromHash("tourcta", null),
  24498. smallModal: "2" === r.valueFromHash("tourcta", null)
  24499. },
  24500. labels: {
  24501. enabled: !1,
  24502. hideUntilStart: !0,
  24503. fadeInDuration: 250,
  24504. fadeInDelay: 250,
  24505. fadeOutDuration: 250,
  24506. fadeOutDelay: 0,
  24507. zoomHideThreshhold: {
  24508. mobile: r.isSmallScreen() ? .45 : .6,
  24509. desktop: 2
  24510. },
  24511. zoomTruncateThreshhold: {
  24512. mobile: r.isSmallScreen() ? .35 : .45,
  24513. desktop: .85
  24514. },
  24515. minLengthForTruncate: 16,
  24516. truncateLength: 12,
  24517. truncateSuffix: "..."
  24518. },
  24519. tags: {
  24520. enabled: r.valueFromHash("mt", 1),
  24521. startup: {
  24522. hideUntilStart: !0,
  24523. fadeInDuration: 500,
  24524. fadeInDelay: 100
  24525. },
  24526. visibility: {
  24527. anyDistance: !0,
  24528. visibleDistance: 8,
  24529. cameraClearance: .1,
  24530. alphaTestLevel: .05,
  24531. hideViaFloor: !0,
  24532. hideOffScreenDisc: !1,
  24533. hideOffScreenObject: !1
  24534. },
  24535. disc: {
  24536. opacity: 1,
  24537. disabledOpacity: .5,
  24538. scale: {
  24539. nearBound: 1.5,
  24540. farBound: 4.8,
  24541. linkFarBound: !1,
  24542. linkPercent: 40,
  24543. maxSize: 80,
  24544. minSize: 40,
  24545. baseViewportSize: 800,
  24546. responsiveness: 100
  24547. }
  24548. },
  24549. pole: {
  24550. enabled: !0,
  24551. height: .5,
  24552. width: 2,
  24553. opacity: .5,
  24554. color: "white"
  24555. },
  24556. navigate: {
  24557. nearestPano: !0,
  24558. lineOfSight: !0,
  24559. reactivate: !0,
  24560. aimAt: "disc",
  24561. tiltTolerance: 25,
  24562. rotateSpeedFactor: .6
  24563. }
  24564. },
  24565. path: {
  24566. color: window.MP_PREFETCHED_MODELDATA.floorMarkerColor || s.newBlue,
  24567. colorUp: s._desat(s.newBlue, .5),
  24568. colorDown: s._darken(s.newBlue, .35),
  24569. opacity: .5,
  24570. style: "ribbon",
  24571. height: .025,
  24572. ribbonWidth: .24,
  24573. outsideHeight: .5,
  24574. waypointRadius: .5,
  24575. waypointIndoorRadius: .24,
  24576. waypointPulse: 1e3,
  24577. typ: l.BLACK,
  24578. meshFree: r.valueFromHash("mf", 1),
  24579. mapGuides: r.valueFromHash("guides", !0),
  24580. fadeInTime: 400,
  24581. fadeOutTime: 300
  24582. },
  24583. warp: {
  24584. nearPanoDist: .1,
  24585. matchCam: !1,
  24586. blur: .33,
  24587. fastTime: 1500,
  24588. teleportTime: 1500,
  24589. outsideTime: 2e3,
  24590. lookAheadMax: .3,
  24591. lookAheadDist: 2.5,
  24592. softPushDist: .37,
  24593. softPushEnd: .3,
  24594. softBendAngle: 8,
  24595. softBendTilt: 4,
  24596. softBendEnd: .3,
  24597. doBurns: !0,
  24598. burnsAngle: 8,
  24599. minBurnsAngle: 35,
  24600. minDownAngle: -35,
  24601. maxTurnPerSec: 280,
  24602. maxAimPerSec: 35,
  24603. minRotation: 12,
  24604. maxAimRotation: 33.2,
  24605. turnFriction: .2,
  24606. flySpeed: .01,
  24607. minWarpTime: 1200,
  24608. warpInterruptionRedirectTime: 500,
  24609. tourStepDelay: r.valueFromHash("st", 0),
  24610. walkDelay: 0,
  24611. walkMaxDist: 50,
  24612. walkMinDist: .8,
  24613. walkSlideShowThreshhold: 3e3,
  24614. walkExtraPanosDistance: .4,
  24615. timePerMeter: 1200,
  24616. motionLeadTime: 5e3,
  24617. movementEasing: "easeInOutQuad",
  24618. blendEasing: "easeInOutQuad",
  24619. showBunny: !1,
  24620. loop: r.valueFromHash("lp", !1),
  24621. auto: r.valueFromHash("ts", -1),
  24622. eOrder: "YXZ",
  24623. stepFactor: .25,
  24624. brakeStrength: 2,
  24625. minBrakeAngle: .1,
  24626. maxBrakeAngle: 1.8,
  24627. climbEffort: 4
  24628. },
  24629. rotationFriction: .05,
  24630. rotationAccelerationInside: 4.5,
  24631. rotationAccelerationOutside: .15,
  24632. rotationAfterMoveMultiplier: 40,
  24633. rotationAfterMoveHistoryCount: 5,
  24634. panFriction: .09,
  24635. panAccelerationOutside: 60,
  24636. onload: r.valueFromHash("onload", o.PANORAMA),
  24637. zoomNearLimit: .1,
  24638. zoomFarLimit: 10,
  24639. navigation: {
  24640. panoScores: !1,
  24641. mouseDirection: !0,
  24642. filterStrictness: .75,
  24643. angleFactor: -30,
  24644. directionFactor: 10,
  24645. distanceFactor: -1,
  24646. optionalityFactor: 3
  24647. },
  24648. sdkInit: !1,
  24649. secretPanelWord: [38, 38, 40, 40, 37, 39, 37, 39, 66, 65],
  24650. console: r.valueFromHash("console", !1),
  24651. noMeshFloorPositionOffset: new n.Vector3(0,-1.2,0),
  24652. panoramaNeighbourMaxDistance: 5,
  24653. panoFloorClickRadius: .35,
  24654. showScreenshotLocations: !1,
  24655. showAxis: !1,
  24656. showNeighbourRaycasts: !1,
  24657. colorMarkerOnLoad: !1,
  24658. colorMarkerByFloor: !1,
  24659. tiling: {
  24660. panoPreRenderRepeatDelay: 2500,
  24661. panoPreRenderDelay: 500,
  24662. preRenderTourPanos: r.valueFromHash("tileprerender", 0),
  24663. tilingFlagNames: ["usetiles", "tiles"],
  24664. maxNavPanoQuality: r.valueFromHash("maxtileq", null),
  24665. maxZoomPanoQuality: r.valueFromHash("maxztileq", null),
  24666. overlayStyle: r.valueFromHash("tileoverlay", 0),
  24667. uploadIntervalDelay: r.valueFromHash("tileupdelay", 10),
  24668. initialIntervalDelay: r.valueFromHash("itiledelay", 0),
  24669. maxNonBaseUploadsPerFrame: r.valueFromHash("maxnbtpf", 2),
  24670. maxBaseUploadsPerFrame: r.valueFromHash("maxbtpf", 6),
  24671. customCompression: r.valueFromHash("tilecustcomp", 0),
  24672. mobileHighQualityOverride: 1,
  24673. allowUltraHighResolution: !0
  24674. },
  24675. zoom: {
  24676. enabled: !0,
  24677. forceOff: r.valueFromHash("nozoom", 0),
  24678. overridemax: r.valueFromHash("maxzoom", null),
  24679. overridemin: r.valueFromHash("minzoom", null),
  24680. max: d.highQualityMaxZoom,
  24681. min: 1,
  24682. transitionStyle: r.valueFromHash("zoomtrans", 1),
  24683. activationThreshold: 1.1,
  24684. restoreTime: 500
  24685. },
  24686. profiling: {
  24687. enabled: r.valueFromHash("mem", !1)
  24688. }
  24689. };
  24690. (p = h.deepExtend(p, d, {
  24691. insideFOV: r.valueFromHash("fov", d.insideFOV),
  24692. insideFOVMax: r.valueFromHash("fovmax", d.insideFOVMax),
  24693. panorama: {
  24694. transitionTime: 1e3,
  24695. modelAlpha: 0,
  24696. modelAlphaDelay: p.flydown.modelTextureDelay,
  24697. modelAlphaLength: 1,
  24698. skyboxOpacity: 1,
  24699. skyboxOpacityDelay: p.flydown.skyboxDelay,
  24700. skyboxOpacityLength: .9,
  24701. fovLength: 1,
  24702. fovDelay: 0,
  24703. cameraMatrixDuration: .8,
  24704. cameraMatrixDelay: 0,
  24705. cameraMatrixEase: c.easeInCubic,
  24706. reticuleOpacity: 1,
  24707. markerOpacity: .3,
  24708. markerOpacityOnHover: 1
  24709. },
  24710. dollhouse: {
  24711. transitionTime: 1e3,
  24712. modelAlpha: 1,
  24713. modelAlphaDelay: 0,
  24714. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  24715. skyboxOpacity: 0,
  24716. skyboxOpacityDelay: 0,
  24717. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  24718. fovLength: 1,
  24719. fovDelay: 0,
  24720. cameraMatrixDuration: .8,
  24721. cameraMatrixDelay: .3,
  24722. cameraMatrixEase: c.easeInCubic,
  24723. reticuleOpacity: 1,
  24724. markerOpacity: 0,
  24725. markerOpacityOnHover: 0
  24726. },
  24727. floorplan: {
  24728. transitionTime: 1e3,
  24729. modelAlpha: 1,
  24730. modelAlphaDelay: 0,
  24731. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  24732. skyboxOpacity: 0,
  24733. skyboxOpacityDelay: 0,
  24734. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  24735. fovLength: 1,
  24736. fovDelay: 0,
  24737. cameraMatrixDuration: .5,
  24738. cameraMatrixDelay: 0,
  24739. cameraMatrixEase: c.easeOutCubic,
  24740. reticuleOpacity: 1,
  24741. markerOpacity: 0,
  24742. markerOpacityOnHover: 0,
  24743. cameraHeight: 50
  24744. },
  24745. transitioning: {
  24746. reticuleOpacity: 0,
  24747. markerOpacity: .3,
  24748. markerOpacityOnHover: 1
  24749. },
  24750. "floorplan-dollhouse": {
  24751. rotationDelay: 0,
  24752. rotationDuration: 1
  24753. },
  24754. "floorplan-panorama": {
  24755. rotationDelay: .5,
  24756. rotationDuration: 1
  24757. },
  24758. "dollhouse-panorama": {
  24759. rotationDelay: .5,
  24760. rotationDuration: 1
  24761. },
  24762. "dollhouse-floorplan": {
  24763. rotationDelay: 0,
  24764. rotationDuration: 1,
  24765. cameraMatrixDuration: 1.05,
  24766. cameraMatrixDelay: .5
  24767. },
  24768. "panorama-dollhouse": {
  24769. rotationDelay: 0,
  24770. rotationDuration: .5
  24771. },
  24772. "panorama-floorplan": {
  24773. transitionTime: 1500,
  24774. rotationDelay: 0,
  24775. rotationDuration: .5
  24776. }
  24777. })).path.meshFree && (p.path.typ = l.WALK),
  24778. p.zoom.max = p.zoom.overridemax || p.zoom.max,
  24779. p.zoom.min = p.zoom.overridemin || p.zoom.min,
  24780. t.exports = p
  24781. }
  24782. , {
  24783. "./constants": 8,
  24784. "./enum/Colors": 19,
  24785. "./enum/VROption": 47,
  24786. "./enum/Viewmode": 51,
  24787. "./enum/WarpStyle": 52,
  24788. "./util/browser": 182,
  24789. "./util/common": 185,
  24790. "./util/easing": 186,
  24791. "./util/showcase": 193,
  24792. three: 217
  24793. }],
  24794. 167: [function(e, t, i) {
  24795. "use strict";
  24796. var n = e("three")
  24797. , r = e("./settings")
  24798. , 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"
  24799. , a = "precision highp float;\nprecision highp int;\n\nuniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n";
  24800. t.exports = {
  24801. basicTextured: {
  24802. uniforms: {
  24803. tDiffuse: {
  24804. type: "t",
  24805. value: null
  24806. },
  24807. alpha: {
  24808. type: "f",
  24809. value: 1
  24810. }
  24811. },
  24812. vertexShader: "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  24813. 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}"
  24814. },
  24815. copyCubeMap: {
  24816. uniforms: {
  24817. tDiffuse: {
  24818. type: "t",
  24819. value: null
  24820. },
  24821. alpha: {
  24822. type: "f",
  24823. value: 1
  24824. }
  24825. },
  24826. 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}",
  24827. 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}"
  24828. },
  24829. cube: {
  24830. uniforms: {
  24831. map: {
  24832. type: "t",
  24833. value: null
  24834. },
  24835. opacity: {
  24836. type: "f",
  24837. value: 1
  24838. }
  24839. },
  24840. vertexShader: o + "varying vec3 vWorldPosition;\n\nvoid main() {\n vWorldPosition = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n",
  24841. 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"
  24842. },
  24843. model: {
  24844. uniforms: {
  24845. map: {
  24846. type: "t",
  24847. value: null
  24848. },
  24849. modelAlpha: {
  24850. type: "f",
  24851. value: r.modelAlpha
  24852. },
  24853. opacity: {
  24854. type: "f",
  24855. value: 1
  24856. },
  24857. progress: {
  24858. type: "f",
  24859. value: 0
  24860. },
  24861. blackout: {
  24862. type: "i",
  24863. value: 0
  24864. },
  24865. pano0Map: {
  24866. type: "t",
  24867. value: null
  24868. },
  24869. pano0Position: {
  24870. type: "v3",
  24871. value: new n.Vector3
  24872. },
  24873. pano0Matrix: {
  24874. type: "m4",
  24875. value: new n.Matrix4
  24876. },
  24877. pano1Map: {
  24878. type: "t",
  24879. value: null
  24880. },
  24881. pano1Position: {
  24882. type: "v3",
  24883. value: new n.Vector3
  24884. },
  24885. pano1Matrix: {
  24886. type: "m4",
  24887. value: new n.Matrix4
  24888. }
  24889. },
  24890. 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",
  24891. 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"
  24892. },
  24893. hot: {
  24894. uniforms: {
  24895. color: {
  24896. type: "c",
  24897. value: new n.Color(16720384)
  24898. },
  24899. opac: {
  24900. type: "f",
  24901. value: 0
  24902. },
  24903. texture1: {
  24904. type: "t",
  24905. value: null
  24906. },
  24907. texture2: {
  24908. type: "t",
  24909. value: null
  24910. }
  24911. },
  24912. vertexShader: "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv ;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  24913. 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"
  24914. },
  24915. modelOutside: {
  24916. uniforms: {
  24917. map: {
  24918. type: "t",
  24919. value: null
  24920. },
  24921. opacity: {
  24922. type: "f",
  24923. value: 1
  24924. }
  24925. },
  24926. vertexShader: o + "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  24927. 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"
  24928. },
  24929. ribbon: {
  24930. uniforms: {
  24931. map: {
  24932. type: "t",
  24933. value: null
  24934. },
  24935. opacity: {
  24936. type: "f",
  24937. value: 1
  24938. },
  24939. color: {
  24940. type: "c",
  24941. value: new n.Color(r.path.color)
  24942. }
  24943. },
  24944. 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",
  24945. 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"
  24946. },
  24947. waypoint: {
  24948. uniforms: {
  24949. map: {
  24950. type: "t",
  24951. value: null
  24952. },
  24953. opacity: {
  24954. type: "f",
  24955. value: 1
  24956. },
  24957. pulse: {
  24958. type: "f",
  24959. value: 1
  24960. },
  24961. nearFade: {
  24962. type: "v2",
  24963. value: new n.Vector2(2 * r.insideNear,2 * r.path.waypointIndoorRadius)
  24964. },
  24965. color: {
  24966. type: "c",
  24967. value: new n.Color(r.reticuleColor)
  24968. }
  24969. },
  24970. 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",
  24971. 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"
  24972. },
  24973. modelDebug: {
  24974. uniforms: {
  24975. map: {
  24976. type: "t",
  24977. value: null
  24978. },
  24979. modelAlpha: {
  24980. type: "f",
  24981. value: r.modelAlpha
  24982. },
  24983. depthmapRatio: {
  24984. type: "f",
  24985. value: 0
  24986. },
  24987. opacity: {
  24988. type: "f",
  24989. value: 1
  24990. },
  24991. progress: {
  24992. type: "f",
  24993. value: 0
  24994. },
  24995. considerOcclusion: {
  24996. type: "i",
  24997. value: r.fancierTransition
  24998. },
  24999. highlightPanoSelection: {
  25000. type: "i",
  25001. value: 0
  25002. },
  25003. useThirdPano: {
  25004. type: "i",
  25005. value: r.useThirdPano
  25006. },
  25007. pano0Map: {
  25008. type: "t",
  25009. value: null
  25010. },
  25011. pano0Depth: {
  25012. type: "t",
  25013. value: null
  25014. },
  25015. pano0Position: {
  25016. type: "v3",
  25017. value: new n.Vector3
  25018. },
  25019. pano0Matrix: {
  25020. type: "m4",
  25021. value: new n.Matrix4
  25022. },
  25023. pano0Weight: {
  25024. type: "f",
  25025. value: r.transition.pano0Weight
  25026. },
  25027. pano1Map: {
  25028. type: "t",
  25029. value: null
  25030. },
  25031. pano1Depth: {
  25032. type: "t",
  25033. value: null
  25034. },
  25035. pano1Position: {
  25036. type: "v3",
  25037. value: new n.Vector3
  25038. },
  25039. pano1Matrix: {
  25040. type: "m4",
  25041. value: new n.Matrix4
  25042. },
  25043. pano1Weight: {
  25044. type: "f",
  25045. value: r.transition.pano1Weight
  25046. },
  25047. pano2Map: {
  25048. type: "t",
  25049. value: null
  25050. },
  25051. pano2Depth: {
  25052. type: "t",
  25053. value: null
  25054. },
  25055. pano2Position: {
  25056. type: "v3",
  25057. value: new n.Vector3
  25058. },
  25059. pano2Matrix: {
  25060. type: "m4",
  25061. value: new n.Matrix4
  25062. },
  25063. pano2Weight: {
  25064. type: "f",
  25065. value: r.transition.pano2Weight
  25066. }
  25067. },
  25068. 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",
  25069. 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"
  25070. },
  25071. customDepth: {
  25072. uniforms: {
  25073. panoPosition: {
  25074. type: "v3",
  25075. value: new n.Vector3
  25076. }
  25077. },
  25078. 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",
  25079. 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"
  25080. },
  25081. skysphere: {
  25082. uniforms: {
  25083. radius: {
  25084. type: "f",
  25085. value: 0
  25086. }
  25087. },
  25088. 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",
  25089. 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"
  25090. },
  25091. tagDisc: {
  25092. uniforms: {
  25093. opacity: {
  25094. type: "f",
  25095. value: 0
  25096. },
  25097. color: {
  25098. type: "c",
  25099. value: new n.Color
  25100. },
  25101. bg: {
  25102. type: "t",
  25103. value: null
  25104. },
  25105. mask: {
  25106. type: "t",
  25107. value: null
  25108. }
  25109. },
  25110. vertexShader: o + "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  25111. 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"
  25112. }
  25113. }
  25114. window.shaders = t.exports;
  25115. }
  25116. , {
  25117. "./settings": 166,
  25118. three: 217
  25119. }],
  25120. 168: [function(E, _, e) {
  25121. (function(e) {
  25122. "use strict";
  25123. var t = E("three")
  25124. , i = (E("url"),
  25125. E("./util/ajax"))
  25126. , n = E("./settings")
  25127. , r = E("./util/logger")
  25128. , o = E("./util/math")
  25129. , a = E("./util/showcase")
  25130. , s = E("./objects/Panorama")
  25131. , l = new r(e)
  25132. , c = E("./model/Model")
  25133. , h = E("./shaders")
  25134. , u = E("./util/transitions")
  25135. , d = E("./objects/Chunk")
  25136. , p = E("./objects/Reticule")
  25137. , f = E("./objects/Skybox")
  25138. , g = E("./objects/Floor")
  25139. , m = E("./cameras/DollhouseCamera")
  25140. , v = E("./cameras/FloorplanCamera")
  25141. , y = E("./cameras/PanoramaCamera")
  25142. , A = E("./controls/DollhouseControls")
  25143. , C = E("./controls/FloorplanControls")
  25144. , I = E("./controls/PanoramaControls");
  25145. t.ImageUtils.crossOrigin = n.crossOrigin,
  25146. _.exports = {
  25147. shaders: h,
  25148. transitions: u,
  25149. Model: c,
  25150. Chunk: d,
  25151. Floor: g,
  25152. Skybox: f,
  25153. Reticule: p,
  25154. Panorama: s,
  25155. DollhouseCamera: m,
  25156. FloorplanCamera: v,
  25157. PanoramaCamera: y,
  25158. DollhouseControls: A,
  25159. FloorplanControls: C,
  25160. PanoramaControls: I,
  25161. getModel: function(e) {
  25162. if (!e.url)
  25163. throw 'getModel(): missing parameter "url"';
  25164. e.autoload = void 0 === e.autoload || e.autoload;
  25165. var t = a.parseSidUrl(e.url);
  25166. e.urlBase = t.urlBase,
  25167. e.urlModel = t.urlModel,
  25168. e.urlFiles = t.urlFiles;
  25169. var i = this._getPlatformError();
  25170. return i ? $.Deferred().reject(i).promise() : (this.options = e,
  25171. this._loadModel().then(this._buildModel.bind(this)))
  25172. },
  25173. _getPlatformError: function() {
  25174. 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"
  25175. },
  25176. _loadModel: function() {
  25177. return i.get(this.options.urlModel, {
  25178. responseType: "json",
  25179. prefetchFrom: "model",
  25180. auth: a.getAuthorizationHeader()
  25181. }).then(null, function() {
  25182. return l.warn("Model loading failed at initial metadata load"),
  25183. "loading-failed"
  25184. })
  25185. },
  25186. _buildModel: function(e) {
  25187. e = a.normalizeModeldata(e, o);
  25188. var t = new c(this.options,e);
  25189. return this.options.autoload ? t.load(!0) : $.when(t)
  25190. }
  25191. }
  25192. }
  25193. ).call(this, "/js/showcase.js")
  25194. }
  25195. , {
  25196. "./cameras/DollhouseCamera": 5,
  25197. "./cameras/FloorplanCamera": 6,
  25198. "./cameras/PanoramaCamera": 7,
  25199. "./controls/DollhouseControls": 10,
  25200. "./controls/FloorplanControls": 11,
  25201. "./controls/PanoramaControls": 13,
  25202. "./model/Model": 139,
  25203. "./objects/Chunk": 144,
  25204. "./objects/Floor": 146,
  25205. "./objects/Panorama": 148,
  25206. "./objects/Reticule": 149,
  25207. "./objects/Skybox": 152,
  25208. "./settings": 166,
  25209. "./shaders": 167,
  25210. "./util/ajax": 181,
  25211. "./util/logger": 189,
  25212. "./util/math": 190,
  25213. "./util/showcase": 193,
  25214. "./util/transitions": 195,
  25215. three: 217,
  25216. url: 208
  25217. }],
  25218. 169: [function(e, t, i) {
  25219. "use strict";
  25220. function l(e) {
  25221. var t = {
  25222. renderTarget: null,
  25223. inUse: !1,
  25224. size: -1,
  25225. pano: null
  25226. };
  25227. return t.inUse = !0,
  25228. t.size = e,
  25229. function(e) {
  25230. O.push(e)
  25231. }(t),
  25232. t
  25233. }
  25234. function c(e) {
  25235. for (var t = 0; t < O.length; t++) {
  25236. var i = O[t];
  25237. if (i.renderTarget === e)
  25238. return !(i.inUse = !1)
  25239. }
  25240. return !1
  25241. }
  25242. function n() {
  25243. this.tileDirectory = {},
  25244. this.activeRenderTargetDescriptors = {},
  25245. this.activePanos = [],
  25246. this.panoLODDescriptors = {},
  25247. this.panoDescriptors = {},
  25248. this.tileTrees = {},
  25249. this.sceneRenderer = null,
  25250. this.tileDownloader = null,
  25251. this.forceQueue = [],
  25252. this.uploadQueues = {},
  25253. this.uploadInterval = null,
  25254. this.uploadIntervalCancelled = !1,
  25255. this.usingTileOverlay = !1,
  25256. this.overlayTilesLoaded = !1,
  25257. this.overlayTileBase = null,
  25258. this.overlayTilesBasic = {},
  25259. this.overlayTilesEnhanced = {},
  25260. this.zoomRenderTarget = null,
  25261. this.zoomPano = null,
  25262. this.zoomingActive = !1,
  25263. this.zoomPanoId = null,
  25264. this.zoomPanoRenderingDisabled = !1,
  25265. this.direction = new _.Vector3,
  25266. this.initTime = -1,
  25267. this.maxBaseUploadsPerFrame = R,
  25268. this.maxNonBaseUploadsPerFrame = M
  25269. }
  25270. 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"),
  25271. e("../enum/PanoRendererEvents")), f = e("../enum/SceneRendererEvents"), g = e("../enum/TileDownloaderEvents"), m = e("../enum/Vectors"), v = (e("../enum/GLCubeFaces"),
  25272. e("../objects/Panorama"),
  25273. e("./TileTree")), y = (e("./TileDownloader"),
  25274. e("./TilePrioritizer")), A = e("./TileUtils"), C = (p = e("../enum/PanoSizeClass"),
  25275. e("../util/browser"),
  25276. 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 = {
  25277. Base: 0,
  25278. Remaining: 1
  25279. }, O = [];
  25280. function L(e) {
  25281. var t = e.shift();
  25282. return t.uploadQueued = !1,
  25283. t
  25284. }
  25285. (n.prototype = Object.create(w.prototype)).init = function(e, t, i) {
  25286. this.sceneRenderer = e,
  25287. this.tileDownloader = t,
  25288. this.qualityManager = i,
  25289. this.bindEvents(),
  25290. this.sceneRenderer.on(f.ContextCreated, this.loadOverlayTiles.bind(this)),
  25291. this.initTime = performance.now()
  25292. }
  25293. ,
  25294. n.prototype.getActivePanoTextures = function(e) {
  25295. e = e || [];
  25296. for (var t = 0; t < O.length; t++) {
  25297. var i = O[t];
  25298. i.renderTarget && i.renderTarget.texture && e.push(i.renderTarget.texture)
  25299. }
  25300. }
  25301. ,
  25302. n.prototype.hasQueuedTiles = function() {
  25303. var e = this.peekNextFromUploadQueue();
  25304. return null != e
  25305. }
  25306. ,
  25307. n.prototype.getActiveRenderTargetDescriptor = function(e) {
  25308. return this.activeRenderTargetDescriptors[e]
  25309. }
  25310. ,
  25311. n.prototype.setActiveRenderTargetDescriptor = function(e, t) {
  25312. this.activeRenderTargetDescriptors[e] = t
  25313. }
  25314. ,
  25315. n.prototype.loadOverlayTiles = function() {
  25316. if (0 !== d.tiling.overlayStyle) {
  25317. var n = 0
  25318. , e = function(e, t, i) {
  25319. e = t ? e[t] = this.sceneRenderer.initSizedTexture2D(A.TILE_SIZE, _.ClampToEdgeWrapping) : this.overlayTileBase = this.sceneRenderer.initSizedTexture2D(A.TILE_SIZE, _.ClampToEdgeWrapping),
  25320. this.sceneRenderer.uploadTexture2D(i, e, 0, 0, A.TILE_SIZE, A.TILE_SIZE),
  25321. ++n === r.length && (this.overlayTilesLoaded = !0)
  25322. }
  25323. .bind(this)
  25324. , 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)]];
  25325. r.forEach(function(e) {
  25326. this.tileDownloader.loadImage(e[0], 0, e[1])
  25327. }
  25328. .bind(this)),
  25329. this.usingTileOverlay = !0
  25330. } else
  25331. this.usingTileOverlay = !1
  25332. }
  25333. ,
  25334. n.prototype.bindEvents = function() {
  25335. this.tileDownloader.on(g.TileDownloadSuccess, this.onTileDownloaded.bind(this))
  25336. }
  25337. ,
  25338. n.prototype.setupZoomRenderTarget = function() {
  25339. if (this.qualityManager.getMaxZoomPanoSize() >= this.qualityManager.getMaxNavPanoSize()) {
  25340. if (this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize())
  25341. return;
  25342. var e = this.zoomRenderTarget;
  25343. if (this.zoomRenderTarget = this.initTiledPano(this.qualityManager.getMaxZoomPanoSize(), !1),
  25344. e) {
  25345. var t = e.width
  25346. , i = this.zoomRenderTarget.width;
  25347. this.sceneRenderer.copyCubeMap(e.texture, this.zoomRenderTarget, t, t, i, i),
  25348. e.texture.dispose(),
  25349. e.texture.loaded = !1,
  25350. e.texture.version = 0,
  25351. this.sceneRenderer.deallocateCubeTexture(e.texture),
  25352. e.texture = null
  25353. }
  25354. this.zoomPanoRenderingDisabled = !1
  25355. } else
  25356. this.zoomPanoRenderingDisabled = !0
  25357. }
  25358. ,
  25359. n.prototype.enableUltraHighQualityMode = function(t) {
  25360. if (!this.qualityManager.ultraHighQualityModeEnabled()) {
  25361. var e = this.qualityManager.getPanoSize(p.ULTRAHIGH);
  25362. this.tileDownloader.testDownload(e, A.TILE_SIZE, function(e) {
  25363. e && (this.qualityManager.enableUltraHighQualityMode(),
  25364. this.setupZoomRenderTarget(),
  25365. t())
  25366. }
  25367. .bind(this))
  25368. }
  25369. }
  25370. ,
  25371. n.prototype.activateTiledPano = function(e, t, i) {
  25372. i && this.clearAllQueuedUploads();
  25373. for (var n = 0; n < A.FACES_PER_PANO; n++)
  25374. this.initTileTree(e.id, n, this.qualityManager.getMaxPossiblePanoSize());
  25375. this.linkAllTilesAndNodes(e);
  25376. var r = this.getActiveRenderTargetDescriptor(e.id)
  25377. , o = t;
  25378. if (o > this.qualityManager.getMaxNavPanoSize() && (o = this.qualityManager.getMaxNavPanoSize()),
  25379. !r || o !== r.size) {
  25380. if (r && c(r.renderTarget),
  25381. !(r = function(e) {
  25382. for (var t = 0; t < O.length; t++) {
  25383. var i = O[t];
  25384. if (!i.inUse && i.size === e)
  25385. return i.inUse = !0,
  25386. i
  25387. }
  25388. return null
  25389. }(o))) {
  25390. var a = this.initTiledPano(o, !1);
  25391. (r = l(a.width)).renderTarget = a
  25392. }
  25393. r.pano = e,
  25394. this.resetPanoDescriptor(e.id),
  25395. this.resetPanoLODDescriptors(e.id),
  25396. this.resetRenderStatus(e.id, !0, !0)
  25397. }
  25398. this.setActiveRenderTargetDescriptor(e.id, r);
  25399. var s = i ? 0 : 1;
  25400. return this.updateActivePanos(e, s),
  25401. r.renderTarget
  25402. }
  25403. ,
  25404. n.prototype.deactivateTiledPano = function(e) {
  25405. var t = this.getActiveRenderTargetDescriptor(e.id);
  25406. this.isRenderTargetDescriptorValid(t) && c(t.renderTarget),
  25407. this.setActiveRenderTargetDescriptor(e.id, null);
  25408. var i = this.getUploadQueueForPano(e.id);
  25409. this.clearUploadQueue(i),
  25410. this.updateActivePanos()
  25411. }
  25412. ,
  25413. n.prototype.updateActivePanos = (s = [],
  25414. function(e, t) {
  25415. for (var i = s.length = 0; i < this.activePanos.length; i++) {
  25416. e && s.length === t && s.push(e);
  25417. var n = this.activePanos[i]
  25418. , r = this.getActiveRenderTargetDescriptor(n.id);
  25419. e && n.id === e.id || !this.isRenderTargetDescriptorValid(r) || s.push(n)
  25420. }
  25421. e && t >= s.length && s.push(e),
  25422. this.activePanos.length = 0,
  25423. this.activePanos.push.apply(this.activePanos, s)
  25424. }
  25425. ),
  25426. n.prototype.getActivePanoCount = function() {
  25427. return this.activePanos.length
  25428. }
  25429. ,
  25430. n.prototype.resetRenderStatus = function(e, r, o, t) {
  25431. var i = null;
  25432. t && (i = v.getLevelCountForSize(A.TILE_SIZE, t) + 1);
  25433. for (var n = function(e, t, i, n) {
  25434. o && (t.tile.zoomUploaded = !1),
  25435. r && (t.tile.uploaded = !1)
  25436. }, a = 0; a < A.FACES_PER_PANO; a++) {
  25437. this.getTileTree(e, a).breadthFirst({
  25438. callback: n.bind(this, a),
  25439. minLevel: i
  25440. })
  25441. }
  25442. }
  25443. ,
  25444. n.prototype.copyBaseRenderStatusToZoomed = function(e) {
  25445. for (var t = v.getLevelCountForSize(A.TILE_SIZE, this.qualityManager.getMaxNavPanoSize()), i = function(e, t, i, n) {
  25446. t.tile.zoomUploaded = t.tile.uploaded,
  25447. t.zoomCovered = t.covered
  25448. }, n = 0; n < A.FACES_PER_PANO; n++) {
  25449. this.getTileTree(e, n).breadthFirst({
  25450. callback: i.bind(this, n),
  25451. maxLevel: t
  25452. })
  25453. }
  25454. }
  25455. ,
  25456. n.prototype.renderPanoTiles = (h = [],
  25457. function(e, t, i, n) {
  25458. this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize() || this.zoomPanoRenderingDisabled || this.setupZoomRenderTarget(),
  25459. t = t || this.direction || m.FORWARD;
  25460. var r = this.getActiveRenderTargetDescriptor(e);
  25461. if (!this.isRenderTargetDescriptorValid(r))
  25462. throw new u("PanoRenderer.renderPanoTiles() -> Cannot render to a pano that is not activated.");
  25463. for (var o = 0; o < A.FACES_PER_PANO; o++) {
  25464. var a = this.getTileTree(e, o);
  25465. h.length = 0,
  25466. a.breadthFirst({
  25467. saveVisited: h
  25468. });
  25469. for (var s = 0; s < h.length; s++) {
  25470. var l = h[s];
  25471. this.queueTileUpload(l.tile, !1, n || 0 === s && i)
  25472. }
  25473. }
  25474. this.updateDirection(t)
  25475. }
  25476. ),
  25477. n.prototype.isRenderTargetDescriptorValid = function(e) {
  25478. return e && e.renderTarget
  25479. }
  25480. ,
  25481. n.prototype.isPanoActive = function(e) {
  25482. var t = this.getActiveRenderTargetDescriptor(e);
  25483. return this.isRenderTargetDescriptorValid(t)
  25484. }
  25485. ,
  25486. n.prototype.isPanoZoomed = function(e) {
  25487. return this.zoomingActive && this.zoomPanoId === e
  25488. }
  25489. ,
  25490. n.prototype.initTileTree = function(e, t, i) {
  25491. var n = this.tileTrees[e];
  25492. n || (n = [],
  25493. this.tileTrees[e] = n);
  25494. var r = n[t];
  25495. if (!r) {
  25496. var o = v.getLevelCountForSize(A.TILE_SIZE, i);
  25497. r = new v(A.TILE_SIZE,o),
  25498. n[t] = r
  25499. }
  25500. }
  25501. ,
  25502. n.prototype.getTileTree = function(e, t) {
  25503. var i = this.tileTrees[e];
  25504. if (!i)
  25505. throw new u("PanoRenderer.getTileTree() -> Tree array not yet initialized!");
  25506. var n = i[t];
  25507. if (!n)
  25508. throw new u("PanoRenderer.getTileTree() -> Tree not yet initialized!");
  25509. return n
  25510. }
  25511. ,
  25512. n.prototype.initTiledPano = function(e, t) {
  25513. var i = this.sceneRenderer.renderer
  25514. , n = (i.context,
  25515. new _.WebGLRenderTargetCube(e,e,{
  25516. stencilBuffer: !1
  25517. }))
  25518. , r = new _.CubeTexture([]);
  25519. (n.texture = r).image = [null, null, null, null, null, null],
  25520. r.flipY = !0,
  25521. t ? (r.generateMipmaps = !0,
  25522. r.magFilter = _.LinearFilter,
  25523. r.minFilter = _.LinearMipMapLinearFilter) : (r.generateMipmaps = !1,
  25524. r.magFilter = _.LinearFilter,
  25525. r.minFilter = _.LinearFilter),
  25526. r.format = _.RGBAFormat,
  25527. i.setRenderTarget(n),
  25528. i.setRenderTarget(null);
  25529. var o = i.properties.get(r);
  25530. return o.__image__webglTextureCube = o.__webglTexture,
  25531. n
  25532. }
  25533. ,
  25534. n.prototype.getUploadQueueForPano = function(e) {
  25535. var t = this.uploadQueues[e];
  25536. return t || (t = [],
  25537. this.uploadQueues[e] = t),
  25538. t
  25539. }
  25540. ,
  25541. n.prototype.isTileUploaded = function(e) {
  25542. return this.isPanoZoomed(e.panoId) ? e.zoomUploaded : e.uploaded
  25543. }
  25544. ,
  25545. n.prototype.setUploaded = function(e, t) {
  25546. this.isPanoZoomed(e.panoId) ? e.zoomUploaded = t : e.uploaded = t
  25547. }
  25548. ,
  25549. n.prototype.queueTileUpload = function(e, t, i) {
  25550. var n = this.getActiveRenderTargetDescriptor(e.panoId);
  25551. if (this.isRenderTargetDescriptorValid(n) && e.downloaded && !this.isTileUploaded(e) && (!e.uploadQueued || i) && (!(e.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive)) {
  25552. var r = this.getUploadQueueForPano(e.panoId);
  25553. 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),
  25554. e.uploadQueued = !0,
  25555. this.uploadInterval || this.uploadIntervalCancelled || this.refreshUploadInterval(0))
  25556. }
  25557. }
  25558. ,
  25559. n.prototype.shoulPushToFrontOfQueue = function(e) {
  25560. return 0 === v.getLevelCountForSize(A.TILE_SIZE, e.panoSize)
  25561. }
  25562. ,
  25563. n.prototype.getTopUploadQueue = function() {
  25564. for (var e = null, t = null, i = P.Base; i <= P.Remaining; i++)
  25565. for (var n = 0; n < this.activePanos.length; n++)
  25566. if (e = this.activePanos[n],
  25567. 0 < (t = this.getUploadQueueForPano(e.id)).length)
  25568. switch (i) {
  25569. case P.Base:
  25570. if (0 === t[0].level)
  25571. return t;
  25572. break;
  25573. case P.Remaining:
  25574. return t
  25575. }
  25576. return null
  25577. }
  25578. ,
  25579. n.prototype.getNextFromUploadQueue = function() {
  25580. if (0 < this.forceQueue.length)
  25581. return L(this.forceQueue);
  25582. var e = this.getTopUploadQueue();
  25583. return e && 0 < e.length ? L(e) : null
  25584. }
  25585. ,
  25586. n.prototype.peekNextFromUploadQueue = function() {
  25587. if (0 < this.forceQueue.length)
  25588. return this.forceQueue[0];
  25589. var e = this.getTopUploadQueue();
  25590. return e && 0 < e.length ? e[0] : null
  25591. }
  25592. ,
  25593. n.prototype.clearAllQueuedUploads = function() {
  25594. this.clearAllUploadQueues(null, 0)
  25595. }
  25596. ,
  25597. n.prototype.clearAllQueuedUploadsForPano = function(e) {
  25598. this.clearAllUploadQueues(e, 0)
  25599. }
  25600. ,
  25601. n.prototype.clearAllUploadQueues = function(e, t) {
  25602. if (e)
  25603. this.clearUploadQueue(this.getUploadQueueForPano(e), t),
  25604. this.clearUploadQueue(this.forceQueue, t, e);
  25605. else {
  25606. for (var i = 0; i < this.activePanos.length; i++) {
  25607. var n = this.activePanos[i];
  25608. this.clearUploadQueue(this.getUploadQueueForPano(n.id), t)
  25609. }
  25610. this.clearUploadQueue(this.forceQueue, t)
  25611. }
  25612. }
  25613. ,
  25614. n.prototype.clearUploadQueue = function(e, t, i) {
  25615. null != t || (t = 0);
  25616. for (var n = 0; n < e.length; ) {
  25617. var r = e[n];
  25618. (!i || i && i === r.tile.panoId) && r.level >= t ? (r.uploadQueued = !1,
  25619. e.splice(n, 1)) : n++
  25620. }
  25621. }
  25622. ,
  25623. n.prototype.refreshUploadInterval = (a = null,
  25624. function(e) {
  25625. this.uploadIntervalCancelled || (a = a || function() {
  25626. this.uploadIntervalCancelled || (this.overlayTilesLoaded || !this.usingTileOverlay ? (T = !0,
  25627. this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  25628. this.peekNextFromUploadQueue() ? this.refreshUploadInterval(x) : this.uploadInterval = null) : this.refreshUploadInterval(this.uploadIntervalDelay))
  25629. }
  25630. .bind(this),
  25631. null != e || (e = x),
  25632. T || (e = S),
  25633. this.uploadInterval = window.setTimeout(a, e),
  25634. this.uploadIntervalDelay = e)
  25635. }
  25636. ),
  25637. n.prototype.update = (r = performance.now(),
  25638. o = 0,
  25639. function() {
  25640. this.uploadIntervalCancelled = !0,
  25641. window.clearTimeout(this.uploadInterval),
  25642. this.uploadInterval = null;
  25643. var e = performance.now() - r;
  25644. !(x < e || 0 === o) || !this.overlayTilesLoaded && this.usingTileOverlay || (this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  25645. r = performance.now()),
  25646. o++
  25647. }
  25648. ),
  25649. n.prototype.updateUploadQueue = function(e, t) {
  25650. e = e || 1;
  25651. for (var i = 0, n = 0; !(t <= n || e <= i); ) {
  25652. var r = this.getNextFromUploadQueue();
  25653. if (!r)
  25654. break;
  25655. if (0 !== r.level ? i++ : n++,
  25656. !(r.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive) {
  25657. var o = this.getActiveRenderTargetDescriptor(r.panoId);
  25658. this.isRenderTargetDescriptorValid(o) && this.uploadTile(r, r.forceUpload)
  25659. }
  25660. }
  25661. }
  25662. ,
  25663. n.prototype.updateDirection = function(e) {
  25664. if (e = e || this.direction) {
  25665. this.direction = e;
  25666. for (var t = 0; t < this.activePanos.length; t++) {
  25667. var i = this.activePanos[t]
  25668. , n = this.getUploadQueueForPano(i.id);
  25669. y.sortPanoTiles(n, i, this.direction)
  25670. }
  25671. }
  25672. }
  25673. ,
  25674. n.prototype.uploadTile = (I = {},
  25675. new _.Vector4,
  25676. E = d.tiling.overlayStyle,
  25677. function(e, t) {
  25678. var i = e.panoId
  25679. , n = e.image
  25680. , r = e.tileSize
  25681. , o = e.panoSize
  25682. , a = e.tileIndex
  25683. , s = (e.faceTileIndex,
  25684. e.totalTiles)
  25685. , l = (e.face,
  25686. e.tileX)
  25687. , c = e.tileY
  25688. , h = !0
  25689. , u = !1
  25690. , d = (this.getPanoDescriptor(i),
  25691. this.getPanoLODDescriptor(i, o))
  25692. , p = this.getActiveRenderTargetDescriptor(i)
  25693. , f = p.renderTarget
  25694. , g = p.size;
  25695. if (this.isPanoZoomed(i) && (f = this.zoomRenderTarget,
  25696. g = this.qualityManager.getMaxZoomPanoSize()),
  25697. this.isRenderTargetDescriptorValid(p) || (u = h = !1),
  25698. t || (this.anyUploaded(e.node) && (u = !(h = !1)),
  25699. this.isTileUploaded(e) && (u = h = !1)),
  25700. h) {
  25701. var m = r / o * g
  25702. , v = l * r / o * g
  25703. , y = c * r / o * g;
  25704. I[r] || (I[r] = this.sceneRenderer.initSizedTexture2D(r, _.ClampToEdgeWrapping));
  25705. var A = I[r];
  25706. if (this.sceneRenderer.uploadTexture2D(n, A, 0, 0, r, r),
  25707. 1 === E || 2 === E) {
  25708. var C = 1 === E ? this.overlayTilesBasic : this.overlayTilesEnhanced;
  25709. this.sceneRenderer.renderToCubeMap(A, f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace),
  25710. this.sceneRenderer.renderToCubeMap(C[o], f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace, _.NormalBlending, !0, .5)
  25711. } else
  25712. this.sceneRenderer.renderToCubeMap(A, f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace);
  25713. d.uploadCount++,
  25714. this.emit(b.TileRenderSuccess, i, o, a, s),
  25715. d.uploadCount === s && this.emit(b.PanoRenderComplete, i, o, s),
  25716. this.setUploaded(e, !0),
  25717. this.addCoverageForNode(e.node)
  25718. } else
  25719. this.setUploaded(e, !1);
  25720. return e.uploadAttempted || (d.uploadAttempts++,
  25721. this.emit(b.TileUploadAttempted, i, o, a, s)),
  25722. e.uploadAttempted = !0,
  25723. d.uploadAttempts === s && this.emit(b.UploadAttemptedForAllTiles, i, o, s),
  25724. u
  25725. }
  25726. ),
  25727. n.prototype.linkTileAndNode = function(e, t) {
  25728. (t.tile = e).node = t
  25729. }
  25730. ,
  25731. n.prototype.linkAllTilesAndNodes = function(a) {
  25732. for (var e = function(e, t, i, n, r) {
  25733. var o = this.getTileDirectoryEntry(a.id, t, n, r);
  25734. this.linkTileAndNode(o, i)
  25735. }, t = 0; t < A.FACES_PER_PANO; t++) {
  25736. var i = this.getTileTree(a.id, t);
  25737. i.breadthFirst({
  25738. callback: e.bind(this, i, t)
  25739. })
  25740. }
  25741. }
  25742. ,
  25743. n.prototype.anyUploaded = function(e) {
  25744. if (!e)
  25745. return !1;
  25746. if (e.tile && this.isTileUploaded(e.tile))
  25747. return !0;
  25748. if (e.children)
  25749. for (var t = 0; t < e.children.length; t++) {
  25750. var i = e.children[t];
  25751. if (this.anyUploaded(i))
  25752. return !0
  25753. }
  25754. return !1
  25755. }
  25756. ,
  25757. n.prototype.setNodeCovered = function(e, t) {
  25758. this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered = t : e.covered = t
  25759. }
  25760. ,
  25761. n.prototype.isNodeCovered = function(e) {
  25762. return !!e && (this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered : e.covered)
  25763. }
  25764. ,
  25765. n.prototype.addCoverageForNode = function(e) {
  25766. if (this.setNodeCovered(e, !0),
  25767. e.parent && e.covered) {
  25768. var t = e.parent;
  25769. this.nodeSubcovered(t) && this.addCoverageForNode(t, !0)
  25770. }
  25771. }
  25772. ,
  25773. n.prototype.calcFullCoverage = function(e) {
  25774. var t = !1;
  25775. if (e.children)
  25776. for (var i = 0; i < e.children.length; i++) {
  25777. var n = e.children[i];
  25778. t = t || this.calcFullCoverage(n)
  25779. }
  25780. e.covered = e.tile.uploaded || t
  25781. }
  25782. ,
  25783. n.prototype.nodeSubcovered = function(e) {
  25784. if (!e.children)
  25785. return !1;
  25786. for (var t = 0; t < e.children.length; t++)
  25787. if (!e.children[t] || !this.isNodeCovered(e.children[t]))
  25788. return !1;
  25789. return !0
  25790. }
  25791. ,
  25792. n.prototype.resetPanoDescriptor = function(e) {
  25793. this.getPanoDescriptor(e)
  25794. }
  25795. ,
  25796. n.prototype.getPanoDescriptor = function(e) {
  25797. var t = this.panoDescriptors[e];
  25798. return t || (t = {},
  25799. this.panoDescriptors[e] = t),
  25800. t
  25801. }
  25802. ,
  25803. n.prototype.resetPanoLODDescriptors = function(e) {
  25804. var t = this.getPanoLODDescriptors(e);
  25805. for (var i in t)
  25806. if (t.hasOwnProperty(i)) {
  25807. var n = t[i];
  25808. n.uploadCount = 0,
  25809. n.uploadAttempts = 0
  25810. }
  25811. }
  25812. ,
  25813. n.prototype.getPanoLODDescriptor = function(e, t) {
  25814. var i = this.getPanoLODDescriptors(e)
  25815. , n = i[t];
  25816. return n || (n = {
  25817. uploadCount: 0,
  25818. uploadAttempts: 0
  25819. },
  25820. i[t] = n),
  25821. n
  25822. }
  25823. ,
  25824. n.prototype.getPanoLODDescriptors = function(e) {
  25825. var t = this.panoLODDescriptors[e];
  25826. return t || (t = {},
  25827. this.panoLODDescriptors[e] = t),
  25828. t
  25829. }
  25830. ,
  25831. n.prototype.onTileDownloaded = function(e) {
  25832. var t = v.getLevelCountForSize(A.TILE_SIZE, e.panoSize)
  25833. , i = this.getTileDirectoryEntry(e.panoId, e.face, t, e.faceTileIndex);
  25834. if (i.downloaded = !0,
  25835. i.image = e.image,
  25836. i.panoSize = e.panoSize,
  25837. i.tileX = e.tileX,
  25838. i.tileY = e.tileY,
  25839. i.totalTiles = e.totalTiles,
  25840. i.tileIndex = e.tileIndex,
  25841. i.faceTileIndex = e.faceTileIndex,
  25842. i.face = e.face,
  25843. i.cubeFace = C.mapFaceToCubemapFace(e.face),
  25844. i.panoId = e.panoId,
  25845. i.tileSize = e.tileSize,
  25846. i.direction = (new _.Vector3).copy(e.direction),
  25847. i.node = null,
  25848. i.level = v.getLevelCountForSize(A.TILE_SIZE, i.panoSize),
  25849. this.isPanoActive(i.panoId)) {
  25850. var n = this.getTileTree(i.panoId, i.face).getSubNode(i.panoSize, i.tileX, i.tileY);
  25851. this.linkTileAndNode(i, n),
  25852. this.queueTileUpload(i, !0)
  25853. }
  25854. }
  25855. ,
  25856. n.prototype.getTileDirectoryEntry = function(e, t, i, n) {
  25857. var r = this.tileDirectory[e];
  25858. r || (r = {},
  25859. this.tileDirectory[e] = r);
  25860. var o = 16384 * t + 1024 * i + n
  25861. , a = r[o];
  25862. return a || (a = {
  25863. downloaded: !1,
  25864. uploaded: !1,
  25865. zoomUploaded: !1
  25866. },
  25867. r[o] = a),
  25868. a._key = e + ":" + t + ":" + i + ":" + n,
  25869. a._tileKey = o,
  25870. a
  25871. }
  25872. ,
  25873. n.prototype.setZoomingActive = function(e, t, i) {
  25874. this.zoomPanoRenderingDisabled || e === this.zoomingActive && this.zoomPanoId === t.id || (this.zoomingActive = e,
  25875. this.zoomPanoId = t.id,
  25876. this.zoomingActive && (this.zoomPanoId !== t.id || i) && this.updateZoomedPanoFromBase(t))
  25877. }
  25878. ,
  25879. n.prototype.updateZoomedPanoFromBase = function(e) {
  25880. if (!this.zoomPanoRenderingDisabled) {
  25881. var t = this.getActiveRenderTargetDescriptor(e.id);
  25882. if (t && t.renderTarget) {
  25883. var i = this.qualityManager.getMaxZoomPanoSize()
  25884. , n = t.renderTarget
  25885. , r = t.size;
  25886. this.sceneRenderer.copyCubeMap(n.texture, this.zoomRenderTarget, r, r, i, i),
  25887. this.copyBaseRenderStatusToZoomed(e.id)
  25888. }
  25889. }
  25890. }
  25891. ,
  25892. t.exports = n
  25893. }
  25894. , {
  25895. "../enum/GLCubeFaces": 25,
  25896. "../enum/PanoRendererEvents": 35,
  25897. "../enum/PanoSizeClass": 36,
  25898. "../enum/SceneRendererEvents": 43,
  25899. "../enum/TileDownloaderEvents": 45,
  25900. "../enum/Vectors": 50,
  25901. "../exception/BasicException": 55,
  25902. "../objects/Panorama": 148,
  25903. "../settings": 166,
  25904. "../util/browser": 182,
  25905. "../util/panorama": 191,
  25906. "./TileDownloader": 171,
  25907. "./TilePrioritizer": 172,
  25908. "./TileTree": 173,
  25909. "./TileUtils": 174,
  25910. events: 202,
  25911. three: 217
  25912. }],
  25913. 170: [function(e, t, i) {
  25914. "use strict";
  25915. function n(e, t, i) {
  25916. this.maxNavPanoSize = -1,
  25917. this.maxZoomPanoSize = -1,
  25918. this.devicePixelDensity = e,
  25919. this.deviceScreenSize = t,
  25920. this.clientBandwidth = i,
  25921. this.panoSizeClassMap = {},
  25922. this.useHighResolutionPanos = !0,
  25923. this.useUltraHighResolutionPanos = !1,
  25924. this.modelHasUltraHighPanos = !1
  25925. }
  25926. var r = e("../enum/PanoSizeClass")
  25927. , o = e("../settings")
  25928. , a = e("../util/browser")
  25929. , s = e("../constants")
  25930. , l = e("../util/showcase")
  25931. , c = e("../enum/ModelManagerEvents");
  25932. n.prototype.init = function(e) {
  25933. this.buildPanoSizeClassMap(this.devicePixelDensity, this.deviceScreenSize, this.clientBandwidth),
  25934. this.ultraHighSize = this.getPanoSize(r.ULTRAHIGH),
  25935. this.highSize = this.getPanoSize(r.HIGH),
  25936. this.standardSize = this.getPanoSize(r.STANDARD),
  25937. this.baseSize = this.getPanoSize(r.BASE),
  25938. o.tiling.maxZoomPanoQuality && this.ultraHighSize <= o.tiling.maxZoomPanoQuality && (o.tiling.allowUltraHighResolution = !0),
  25939. this.highQualityThreshold = a.valueFromHash("threshold2k", s.windowHeightHighQualityThreshold),
  25940. this.updateMaximums(),
  25941. e.on(c.ActiveModelChanged, this.onModelChanged.bind(this))
  25942. }
  25943. ,
  25944. n.prototype.updateFromModel = function(e) {
  25945. this.updateHighResolutionSettings(e),
  25946. this.updateUltraHighResolutionSettings(e)
  25947. }
  25948. ,
  25949. n.prototype.updateHighResolutionSettings = function(e) {
  25950. l.modelDataPromisesTiles(e.data) ? this.useHighResolutionPanos = !0 : this.useHighResolutionPanos = !1,
  25951. this.updateMaximums()
  25952. }
  25953. ,
  25954. n.prototype.updateUltraHighResolutionSettings = function(e) {
  25955. o.tiling.allowUltraHighResolution && this.modelHasUltraHighPanos ? this.useUltraHighResolutionPanos = !0 : this.useUltraHighResolutionPanos = !1,
  25956. this.updateMaximums()
  25957. }
  25958. ,
  25959. n.prototype.enableUltraHighQualityMode = function() {
  25960. this.modelHasUltraHighPanos = !0,
  25961. this.updateUltraHighResolutionSettings(null)
  25962. }
  25963. ,
  25964. n.prototype.ultraHighQualityModeEnabled = function() {
  25965. return this.modelHasUltraHighPanos
  25966. }
  25967. ,
  25968. n.prototype.onModelChanged = function(e) {
  25969. this.updateFromModel(e.model),
  25970. this.updateMaximums()
  25971. }
  25972. ,
  25973. n.prototype.updateMaximums = function() {
  25974. this.maxNavPanoSize = o.tiling.maxNavPanoQuality || this.detectMaxNavPanoSize(),
  25975. this.maxZoomPanoSize = o.tiling.maxZoomPanoQuality || this.detectMaxZoomPanoSize(),
  25976. this.maxZoomPanoSize < this.maxNavPanoSize && (this.maxNavPanoSize = this.maxZoomPanoSize)
  25977. }
  25978. ,
  25979. n.prototype.buildPanoSizeClassMap = function() {
  25980. this.panoSizeClassMap[r.BASE] = 512,
  25981. this.panoSizeClassMap[r.STANDARD] = 1024,
  25982. this.panoSizeClassMap[r.HIGH] = 2048,
  25983. this.panoSizeClassMap[r.ULTRAHIGH] = 4096
  25984. }
  25985. ,
  25986. n.prototype.getPanoSize = function(e) {
  25987. return this.panoSizeClassMap[e]
  25988. }
  25989. ,
  25990. n.prototype.getMaxPossiblePanoSize = function() {
  25991. return this.getPanoSize(r.ULTRAHIGH)
  25992. }
  25993. ,
  25994. n.prototype.getMaxPanoSize = function() {
  25995. return this.maxZoomPanoSize
  25996. }
  25997. ,
  25998. n.prototype.getMaxNavPanoSize = function() {
  25999. return this.maxNavPanoSize
  26000. }
  26001. ,
  26002. n.prototype.getMaxZoomPanoSize = function() {
  26003. return this.maxZoomPanoSize
  26004. }
  26005. ,
  26006. n.prototype.detectMaxNavPanoSizeClass = function() {
  26007. return this.useHighResolutionPanos ? a.isMobile() ? r.STANDARD : $("#player").height() < this.highQualityThreshold ? r.STANDARD : r.HIGH : r.STANDARD
  26008. }
  26009. ,
  26010. n.prototype.detectMaxNavPanoSize = function() {
  26011. var e = this.detectMaxNavPanoSizeClass();
  26012. return this.getPanoSize(e)
  26013. }
  26014. ,
  26015. n.prototype.detectMaxZoomPanoSize = function() {
  26016. 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)
  26017. }
  26018. ,
  26019. t.exports = n
  26020. }
  26021. , {
  26022. "../constants": 8,
  26023. "../enum/ModelManagerEvents": 33,
  26024. "../enum/PanoSizeClass": 36,
  26025. "../settings": 166,
  26026. "../util/browser": 182,
  26027. "../util/showcase": 193
  26028. }],
  26029. 171: [function(A, C, e) {
  26030. (function(e) {
  26031. "use strict";
  26032. function i(e) {
  26033. this.panos = null,
  26034. this.retryMinimumTime = 1e4,
  26035. this.urls = null,
  26036. this.panoLoadCallbacks = {},
  26037. this.downloadDescriptors = {},
  26038. this.priorityQueue = [],
  26039. this.forceQueue = [],
  26040. this.activeDownloads = [],
  26041. this.qualityManager = null,
  26042. this.tilePrioritizer = null,
  26043. this.refreshInterval = null,
  26044. this.processPriorityQueue = !1,
  26045. this.concurrentDownloads = e.concurrentDownloads || 1,
  26046. this.downloadTestResults = {}
  26047. }
  26048. var c, h, n, p, f, t = A("three"), u = (A("../enum/Viewmode"),
  26049. A("../settings")), r = (A("../objects/Panorama"),
  26050. A("../util/logger")), o = (A("../enum/Vectors"),
  26051. A("../enum/PanoSizeClass"),
  26052. A("../enum/TileDownloaderEvents")), g = A("./TilePrioritizer"), m = A("./TileUtils"), v = (A("../enum/GLCubeFaces"),
  26053. A("../enum/DownloadStatus")), a = A("../util/panorama"), s = A("../util/ajax"), d = A("../ab"), l = A("events").EventEmitter, y = (new r(e),
  26054. Object.freeze({
  26055. Testing: 1,
  26056. Success: 2,
  26057. Fail: 3
  26058. }));
  26059. i.prototype = Object.create(l.prototype),
  26060. i.IDLE_REFRESH_DELAY = 500,
  26061. i.ACTIVE_REFRESH_DELAY = 16,
  26062. i.DOWNLOAD_RETRIES = 4,
  26063. i.prototype.init = function(e) {
  26064. this.qualityManager = e
  26065. }
  26066. ,
  26067. i.prototype.setUrls = function(e) {
  26068. this.urls = e
  26069. }
  26070. ,
  26071. i.prototype.setPanoData = function(e, t, i) {
  26072. this.panos = e,
  26073. this.imagePanos = t,
  26074. this.panoGroupId = i
  26075. }
  26076. ,
  26077. i.prototype.start = function() {
  26078. this.refreshUpdateInterval(0)
  26079. }
  26080. ,
  26081. i.prototype.stop = function() {
  26082. window.cancel(this.refreshInterval)
  26083. }
  26084. ,
  26085. i.prototype.refreshUpdateInterval = function(e) {
  26086. e = e || 0,
  26087. this.refreshInterval = window.setTimeout(function() {
  26088. this.update() ? this.refreshUpdateInterval(i.ACTIVE_REFRESH_DELAY) : this.refreshUpdateInterval(i.IDLE_REFRESH_DELAY)
  26089. }
  26090. .bind(this), e)
  26091. }
  26092. ,
  26093. i.prototype.update = function() {
  26094. var e = 0 < this.forceQueue.length;
  26095. return this.processQueueForDownloading(this.forceQueue),
  26096. this.processPriorityQueue && (this.queuePrioritizedTilesForPanos(this.panos),
  26097. 0 < this.priorityQueue.length && (e = !0),
  26098. this.processQueueForDownloading(this.priorityQueue)),
  26099. e
  26100. }
  26101. ,
  26102. i.prototype.forceQueueTilesForPano = (p = [],
  26103. f = [],
  26104. function(e, t, i, n, r, o) {
  26105. p.length = 0;
  26106. for (var a = this.getTileDownloadDescriptors(e, t), s = 0; s < a.length; s++) {
  26107. var l = a[s];
  26108. l.status !== v.None && l.status !== v.Queued || p.push(l)
  26109. }
  26110. if (i && 0 < p.length) {
  26111. g.sortPanoTiles(p, e, i),
  26112. f.length = 0,
  26113. m.matchingTilesInDirection(e, t, i, n, r, f);
  26114. for (var c = 0, h = function(e) {
  26115. return e.face === u.face && e.faceTileIndex === u.faceTileIndex
  26116. }; c < p.length; ) {
  26117. var u = p[c];
  26118. f.findIndex(h) < 0 ? p.splice(c, 1) : c++
  26119. }
  26120. }
  26121. for (var d = 0; d < p.length; d++)
  26122. this.forceQueue.push(p[d]);
  26123. this.setStatusForAllDescriptors(this.forceQueue, v.ForceQueued),
  26124. this.clearFromQueue(this.priorityQueue, v.ForceQueued, !1),
  26125. o && this.processQueueForDownloading(this.forceQueue, !0)
  26126. }
  26127. ),
  26128. i.prototype.clearForceQueue = function() {
  26129. this.clearQueue(this.forceQueue)
  26130. }
  26131. ,
  26132. i.prototype.queuePrioritizedTilesForPanos = function(e) {
  26133. this.tilePrioritizer && (this.clearQueue(this.priorityQueue),
  26134. this.tilePrioritizer.filterAndPrioritize(this.priorityQueue, e, this),
  26135. this.clearFromQueue(this.priorityQueue, v.None, !0),
  26136. this.setStatusOrRemoveForAllDescriptors(this.priorityQueue, v.Queued))
  26137. }
  26138. ,
  26139. i.prototype.clearQueue = function(e) {
  26140. this.setStatusForAllDescriptors(e, v.None),
  26141. e.length = 0
  26142. }
  26143. ,
  26144. i.prototype.clearFromQueue = function(e, t, i) {
  26145. for (var n = 0; n < e.length; n++) {
  26146. var r = e[n];
  26147. r && (t === r.status && !i || t !== r.status && i) && (e[n] = null)
  26148. }
  26149. }
  26150. ,
  26151. i.prototype.setStatusForAllDescriptors = function(e, t) {
  26152. for (var i = 0; i < e.length; i++) {
  26153. var n = e[i];
  26154. n && (n.status = t)
  26155. }
  26156. }
  26157. ,
  26158. i.prototype.setStatusOrRemoveForAllDescriptors = function(e, t) {
  26159. for (var i = 0; i < e.length; i++) {
  26160. var n = e[i];
  26161. n && (n.status !== t ? n.status = t : e[i] = null)
  26162. }
  26163. }
  26164. ,
  26165. i.prototype.getTileDownloadDescriptors = function(e, t) {
  26166. var i = this.getAllTileDownloadDescriptorsForPano(e)
  26167. , n = i[t];
  26168. return n || (n = this.buildDownloadDescriptorArray(t),
  26169. i[t] = n,
  26170. this.initTileDownloadDescriptors(n, e, t)),
  26171. n
  26172. }
  26173. ,
  26174. i.prototype.getAllTileDownloadDescriptorsForPano = function(e) {
  26175. var t = this.downloadDescriptors[e.id];
  26176. return t || (t = {},
  26177. this.downloadDescriptors[e.id] = t),
  26178. t
  26179. }
  26180. ,
  26181. i.prototype.processQueueForDownloading = function(e, t) {
  26182. if (this.cleanupActiveDownloads(),
  26183. this.activeDownloads.length < this.concurrentDownloads || t)
  26184. for (var i = t ? e.length : this.concurrentDownloads - this.activeDownloads.length, n = 0; n < i && 0 < e.length; 0) {
  26185. var r = e.shift();
  26186. r && (this.startDownload(r),
  26187. n++)
  26188. }
  26189. }
  26190. ,
  26191. i.prototype.testDownload = function(t, e, i) {
  26192. var n = this.downloadTestResults[t];
  26193. if (n)
  26194. n === y.Success ? i(!0) : n === y.Fail && i(!1);
  26195. else {
  26196. this.downloadTestResults[t] = y.Testing;
  26197. var r = this.panos.list[0]
  26198. , o = this.getTileUrl(r.id, t, e, 0)
  26199. , a = function(e) {
  26200. this.downloadTestResults[t] = y.Success,
  26201. i(!0)
  26202. }
  26203. .bind(this)
  26204. , s = function() {
  26205. this.downloadTestResults[t] = y.Fail,
  26206. i(!1)
  26207. }
  26208. .bind(this);
  26209. this.loadImage(o, 0, a, s)
  26210. }
  26211. }
  26212. ,
  26213. i.prototype.startDownload = function(e) {
  26214. e.status = v.Downloading;
  26215. var t = this.getTileUrl(e.pano.id, e.panoSize, e.tileSize, e.tileIndex);
  26216. this.activeDownloads.push(e),
  26217. this.loadImage(t, i.DOWNLOAD_RETRIES, this.downloadComplete.bind(this, e), this.downloadFailed.bind(this, e))
  26218. }
  26219. ,
  26220. i.prototype.downloadFailed = function(e, t) {}
  26221. ,
  26222. i.prototype.downloadComplete = function(e, t) {
  26223. if (e.panoGroupId === this.panoGroupId) {
  26224. var i = this.getPanoLoadCallbacks(e.pano, e.panoSize);
  26225. e.status = v.Downloaded,
  26226. i && i.onProgress && i.onProgress(e.pano, e.panoSize);
  26227. var n = {
  26228. panoId: e.pano.id,
  26229. image: t,
  26230. tileSize: e.tileSize,
  26231. panoSize: e.panoSize,
  26232. tileIndex: e.tileIndex,
  26233. faceTileIndex: e.faceTileIndex,
  26234. totalTiles: e.totalTiles,
  26235. face: e.face,
  26236. tileX: e.tileX,
  26237. tileY: e.tileY,
  26238. direction: e.direction
  26239. };
  26240. e.image = t,
  26241. this.emit(o.TileDownloadSuccess, n),
  26242. this.isPanoDownloaded(e.pano, e.panoSize) && (n = {
  26243. panoId: e.pano.id,
  26244. tileSize: e.tileSize,
  26245. panoSize: e.panoSize
  26246. },
  26247. this.emit(o.PanoDownloadComplete, n),
  26248. i && i.onLoad && i.onLoad(e.pano, e.panoSize))
  26249. }
  26250. }
  26251. ,
  26252. i.prototype.cleanupActiveDownloads = (n = [],
  26253. function() {
  26254. for (var e = n.length = 0; e < this.activeDownloads.length; e++) {
  26255. var t = this.activeDownloads[e];
  26256. t.status !== v.Downloaded && t.status !== v.Failed && n.push(t)
  26257. }
  26258. this.activeDownloads.length = 0,
  26259. this.activeDownloads.push.apply(this.activeDownloads, n)
  26260. }
  26261. ),
  26262. i.prototype.isPanoDownloaded = function(e, t) {
  26263. var i = this.getTileDownloadDescriptors(e, t);
  26264. if (i.length <= 0)
  26265. return !1;
  26266. for (var n = 0; n < i.length; n++) {
  26267. if (i[n].status !== v.Downloaded)
  26268. return !1
  26269. }
  26270. return !0
  26271. }
  26272. ,
  26273. i.prototype.setPanoLoadCallbacks = function(e, t, i, n, r) {
  26274. var o = e.id + ":" + this.qualityManager.getPanoSize(t);
  26275. this.panoLoadCallbacks[o] = {
  26276. onLoad: i,
  26277. onFail: n,
  26278. onProgress: r
  26279. }
  26280. }
  26281. ,
  26282. i.prototype.getPanoLoadCallbacks = function(e, t) {
  26283. var i = e.id + ":" + t;
  26284. return this.panoLoadCallbacks[i]
  26285. }
  26286. ,
  26287. i.prototype.buildDownloadDescriptorArray = function(e) {
  26288. for (var t = m.getTileCountForSize(e), i = [], n = 0; n < t; n++) {
  26289. var r = this.buildDownloadDescriptor();
  26290. i.push(r)
  26291. }
  26292. return i
  26293. }
  26294. ,
  26295. i.prototype.buildDownloadDescriptor = function() {
  26296. return {
  26297. panoGroupId: null,
  26298. pano: null,
  26299. panoSize: -1,
  26300. tileSize: -1,
  26301. tileIndex: -1,
  26302. totalTiles: -1,
  26303. faceTileIndex: -1,
  26304. status: v.None,
  26305. url: null,
  26306. image: null,
  26307. direction: new t.Vector3,
  26308. face: -1,
  26309. cubeFace: -1,
  26310. tileX: -1,
  26311. tileY: -1
  26312. }
  26313. }
  26314. ,
  26315. i.prototype.initTileDownloadDescriptors = function(e, t, i) {
  26316. for (var n = 0; n < e.length; n++) {
  26317. var r = e[n];
  26318. this.initTileDownloadDescriptor(r, t, i, n)
  26319. }
  26320. }
  26321. ,
  26322. i.prototype.initTileDownloadDescriptor = function(e, t, i, n) {
  26323. var r = i >= m.TILE_SIZE ? m.TILE_SIZE : i;
  26324. e.face = m.getFaceForTile(i, n),
  26325. e.cubeFace = a.mapFaceToCubemapFace(e.face),
  26326. e.panoGroupId = this.panoGroupId,
  26327. e.pano = t,
  26328. e.panoSize = i,
  26329. e.tileSize = r,
  26330. e.tileIndex = n,
  26331. e.totalTiles = m.getTileCountForSize(i),
  26332. e.status = v.None,
  26333. e.image = null,
  26334. m.getTileLocation(e.panoSize, e.tileIndex, e),
  26335. m.getTileVector(e.panoSize, e.tileSize, e.cubeFace, e.tileX, e.tileY, m.LocationOnTile.Center, 0, e.direction)
  26336. }
  26337. ,
  26338. i.prototype.getTileUrl = (c = {
  26339. 256: "256",
  26340. 512: "512",
  26341. 1024: "1k",
  26342. 2048: "2k",
  26343. 4096: "4k"
  26344. },
  26345. h = {
  26346. face: -1,
  26347. faceTileIndex: -1,
  26348. tileX: -1,
  26349. tileY: -1
  26350. },
  26351. function(e, t, i, n) {
  26352. m.getTileLocation(t, n, h);
  26353. var r = Math.floor(t / i)
  26354. , o = r * r
  26355. , a = Math.floor(n / o)
  26356. , s = "";
  26357. 1 === u.tiling.customCompression && (s = "_" + u.tiling["q" + c[t]]);
  26358. var l = this.urls.get("tiles/" + e + "/" + c[t] + s + "_face" + a + "_" + h.tileX + "_" + h.tileY + ".jpg");
  26359. return d.changeIfTileGenerating(l)
  26360. }
  26361. ),
  26362. i.prototype.loadImage = function(e, t, i, n) {
  26363. s.getImage(e, t).then(function(e) {
  26364. i(e)
  26365. }).fail(n)
  26366. }
  26367. ,
  26368. C.exports = i
  26369. }
  26370. ).call(this, "/js/tile/TileDownloader.js")
  26371. }
  26372. , {
  26373. "../ab": 3,
  26374. "../enum/DownloadStatus": 24,
  26375. "../enum/GLCubeFaces": 25,
  26376. "../enum/PanoSizeClass": 36,
  26377. "../enum/TileDownloaderEvents": 45,
  26378. "../enum/Vectors": 50,
  26379. "../enum/Viewmode": 51,
  26380. "../objects/Panorama": 148,
  26381. "../settings": 166,
  26382. "../util/ajax": 181,
  26383. "../util/logger": 189,
  26384. "../util/panorama": 191,
  26385. "./TilePrioritizer": 172,
  26386. "./TileUtils": 174,
  26387. events: 202,
  26388. three: 217
  26389. }],
  26390. 172: [function(n, C, e) {
  26391. (function(e) {
  26392. "use strict";
  26393. function h(e, t, i, n, r) {
  26394. this.qualityManager = e,
  26395. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  26396. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize(),
  26397. this.baseSize = t,
  26398. this.standardSize = i,
  26399. this.highSize = n,
  26400. this.ultraHighSize = r,
  26401. this.priorityCriteria = new h.PriorityCriteria(null,new o.Vector3(0,0,0),new o.Vector3(0,0,-1),new o.Vector3(0,0,-1))
  26402. }
  26403. var c, s, l, d, r, u, p, f, o = n("three"), g = (n("../enum/Viewmode"),
  26404. n("../settings"),
  26405. n("../settings"),
  26406. n("../objects/Panorama")), t = n("../util/logger"), i = (n("../enum/Vectors"),
  26407. n("../enum/PanoSizeClass"),
  26408. n("../enum/ModelManagerEvents"),
  26409. n("../enum/GLCubeFaces"),
  26410. n("../enum/DownloadStatus")), m = (n("../util/browser"),
  26411. n("./TileUtils")), v = n("../util/math"), a = (n("events").EventEmitter,
  26412. new t(e),
  26413. Object.freeze({
  26414. None: 0,
  26415. DirectionalFOV: 1
  26416. }));
  26417. h.PriorityCriteria = function(e, t, i, n, r) {
  26418. this.pano = e,
  26419. this.cameraPosition = (new o.Vector3).copy(t),
  26420. this.cameraDir = (new o.Vector3).copy(i),
  26421. this.panoSpaceDir = (new o.Vector3).copy(n),
  26422. this.upcomingPanos = r,
  26423. this.copy = function(e) {
  26424. this.pano = e.pano,
  26425. this.cameraPosition.copy(e.cameraPosition),
  26426. this.cameraDir.copy(e.cameraDir),
  26427. this.panoSpaceDir.copy(e.panoSpaceDir),
  26428. this.upcomingPanos = r
  26429. }
  26430. ,
  26431. this.zoomingActive = !1
  26432. }
  26433. ,
  26434. h.DIRECTIONAL_FOV = 180,
  26435. h.DIRECTIONAL_FOV_NARROW = 120,
  26436. h.MAX_SCORED_PANOS_TOCONSIDER = 6,
  26437. h.MAX_SCORED_PANOS_TOADD = 2,
  26438. h.MAX_UPCOMING_PANOS_TOADD = 3,
  26439. h.DIRECTION_SCORE_STRICTNESS = .75,
  26440. h.appendQueue = function(e, t) {
  26441. if (e && t)
  26442. for (var i = 0; i < t.length; i++)
  26443. e.push(t[i])
  26444. }
  26445. ,
  26446. h.prototype.updateCriteria = function(e, t, i, n) {
  26447. this.priorityCriteria.pano = e,
  26448. this.priorityCriteria.cameraPosition.copy(t),
  26449. this.priorityCriteria.cameraDir.copy(i),
  26450. this.priorityCriteria.upcomingPanos = n,
  26451. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  26452. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize()
  26453. }
  26454. ,
  26455. h.prototype.filterAndPrioritize = (u = [],
  26456. p = [],
  26457. f = [],
  26458. function(e, t, i) {
  26459. this.populateNeighborPanos(this.priorityCriteria.pano, t, u),
  26460. this.populateScoredPanos(this.priorityCriteria.pano, t, p, this.priorityCriteria.cameraDir, h.MAX_SCORED_PANOS_TOCONSIDER);
  26461. var n = this.baseSize
  26462. , r = this.standardSize
  26463. , o = this.highSize
  26464. , a = this.ultraHighSize;
  26465. this.queueTilesForPano(e, i, this.priorityCriteria.pano, n),
  26466. this.priorityCriteria.upcomingPanos && this.queueTilesForPanos(e, this.priorityCriteria.upcomingPanos, i, n, h.MAX_UPCOMING_PANOS_TOADD),
  26467. f.length = 0,
  26468. this.canDownloadSize(r) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, r, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  26469. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26470. h.appendQueue(e, f),
  26471. this.queueTilesForPanos(e, p, i, n, h.MAX_SCORED_PANOS_TOADD),
  26472. f.length = 0,
  26473. this.canDownloadSize(o) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, o, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  26474. this.canDownloadSize(a) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, a, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  26475. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26476. h.appendQueue(e, f),
  26477. f.length = 0,
  26478. this.canDownloadSize(r) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, r, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  26479. this.canDownloadSize(o) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, o, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  26480. this.canDownloadSize(a) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, a, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  26481. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26482. h.appendQueue(e, f),
  26483. this.queueTilesForPanos(e, u, i, n)
  26484. }
  26485. ),
  26486. h.prototype.canDownloadSize = function(e) {
  26487. return this.maxNavQuality >= e || this.maxZoomQuality >= e && this.zoomingActive
  26488. }
  26489. ,
  26490. h.prototype.populateNeighborPanos = function(e, t, i) {
  26491. (i = i || []).length = 0;
  26492. var n = t.getNeighbours(e);
  26493. for (var r in n)
  26494. if (n.hasOwnProperty(r)) {
  26495. var o = t.get(r);
  26496. i.push(o)
  26497. }
  26498. return i
  26499. }
  26500. ,
  26501. h.prototype.populateScoredPanos = function(e, t, i, n, r) {
  26502. (i = i || []).length = 0;
  26503. var o = [g.filters.inPanoDirection(e.position, n, h.DIRECTION_SCORE_STRICTNESS), g.filters.not(e)]
  26504. , a = [g.scoreFunctions.distanceSquared(e), g.scoreFunctions.direction(e.position, n)]
  26505. , s = t.sortByScore(o, a);
  26506. if (s)
  26507. for (var l = 0; l < s.length && l < r; l++) {
  26508. var c = s[l].pano;
  26509. i.push(c)
  26510. }
  26511. return i
  26512. }
  26513. ,
  26514. h.prototype.queueTilesForPanos = function(e, t, i, n, r) {
  26515. for (var o = 0, a = 0; a < t.length; a++) {
  26516. var s = t[a];
  26517. if (o += 0 < this.queueTilesForPano(e, i, s, n) ? 1 : 0,
  26518. r && r <= o)
  26519. break
  26520. }
  26521. return o
  26522. }
  26523. ,
  26524. h.prototype.queueTilesForPano = (r = {
  26525. filter: a.None
  26526. },
  26527. function(e, t, i, n) {
  26528. return this.filterAndQueueTileDownloadDescriptors(e, t, i, n, r)
  26529. }
  26530. ),
  26531. h.prototype.queueTilesForPanosInDirection = (d = new o.Vector3,
  26532. function(e, t, i, n, r, o, a, s) {
  26533. for (var l = 0, c = 0; c < i.length; c++) {
  26534. var h = i[c];
  26535. d.copy(h.position),
  26536. d.sub(r),
  26537. d.normalize();
  26538. var u = Math.max(Math.min(o.dot(d), 1), -1);
  26539. if (v.getFOVDotThreshold(a) <= u && (l += 0 < this.queueTilesInDirectionForPano(e, t, h, n, r, o, a) ? 1 : 0,
  26540. s && s <= l))
  26541. break
  26542. }
  26543. return l
  26544. }
  26545. ),
  26546. h.prototype.queueTilesInDirectionForPanos = function(e, t, i, n, r, o, a, s) {
  26547. for (var l = 0, c = 0; c < i.length; c++) {
  26548. var h = i[c];
  26549. if (l += 0 < this.queueTilesInDirectionForPano(e, t, h, n, o, a) ? 1 : 0,
  26550. s && s <= l)
  26551. break
  26552. }
  26553. return l
  26554. }
  26555. ,
  26556. h.prototype.queueTilesInDirectionForPano = (s = {
  26557. filter: a.DirectionalFOV,
  26558. direction: new o.Vector3,
  26559. fov: 60
  26560. },
  26561. l = new o.Vector3,
  26562. function(e, t, i, n, r, o, a) {
  26563. return l.copy(o),
  26564. m.getRelativeDirection(i.quaternion, l),
  26565. s.direction.copy(l),
  26566. s.fov = a,
  26567. this.filterAndQueueTileDownloadDescriptors(e, t, i, n, s)
  26568. }
  26569. ),
  26570. h.prototype.filterAndQueueTileDownloadDescriptors = (c = [],
  26571. function(e, t, i, n, r) {
  26572. var o = t.getTileDownloadDescriptors(i, n);
  26573. c.length = 0,
  26574. this.filterTileDownloadDescriptors(i, o, c, r);
  26575. for (var a = 0, s = 0; s < c.length; s++) {
  26576. var l = c[s];
  26577. l && (e.push(l),
  26578. a++)
  26579. }
  26580. return a
  26581. }
  26582. ),
  26583. h.prototype.filterTileDownloadDescriptors = (new o.Vector3,
  26584. function(e, t, i, n) {
  26585. var r, o;
  26586. switch (n.filter) {
  26587. case a.DirectionalFOV:
  26588. for (r = 0; r < t.length; r++)
  26589. o = t[r],
  26590. m.isTileWithinFOV(o.panoSize, o.tileSize, o.face, o.tileX, o.tileY, n.direction, n.fov) && i.push(o);
  26591. break;
  26592. default:
  26593. for (r = 0; r < t.length; r++)
  26594. o = t[r],
  26595. i.push(o)
  26596. }
  26597. for (r = 0; r < i.length; r++)
  26598. o = i[r],
  26599. this.canIncludeDescriptor(o) || (i[r] = null)
  26600. }
  26601. ),
  26602. h.prototype.canIncludeDescriptor = function(e) {
  26603. return e.status !== i.Downloading && e.status !== i.Downloaded
  26604. }
  26605. ,
  26606. h.prototype.canIncludePano = function(e, t) {
  26607. return !e.isLoaded(t)
  26608. }
  26609. ,
  26610. h.getFOVDotThreshold = function(e) {
  26611. return Math.cos(o.Math.degToRad(e / 2))
  26612. }
  26613. ;
  26614. var y = (A._panoSpaceDir = new o.Vector3,
  26615. A._fovThreshold = -1,
  26616. A._fovThresholdNarrow = -1,
  26617. A);
  26618. function A(e, t) {
  26619. var i = A._panoSpaceDir
  26620. , n = A._fovThreshold
  26621. , r = A._fovThresholdNarrow
  26622. , o = Math.max(Math.min(i.dot(e.direction), 1), -1)
  26623. , a = Math.max(Math.min(i.dot(t.direction), 1), -1);
  26624. return e._dot = o,
  26625. t._dot = a,
  26626. 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)
  26627. }
  26628. h.sortPanoTiles = function(e, t, i) {
  26629. y._panoSpaceDir.copy(i),
  26630. m.getRelativeDirection(t.quaternion, y._panoSpaceDir),
  26631. y._fovThresholdNarrow = v.getFOVDotThreshold(h.DIRECTIONAL_FOV_NARROW),
  26632. y._fovThreshold = v.getFOVDotThreshold(h.DIRECTIONAL_FOV),
  26633. e.sort(y)
  26634. }
  26635. ,
  26636. h.insertSortedPanoTile = function(e, t, i, n) {
  26637. y._panoSpaceDir.copy(n),
  26638. m.getRelativeDirection(i.quaternion, y._panoSpaceDir),
  26639. y._fovThresholdNarrow = v.getFOVDotThreshold(h.DIRECTIONAL_FOV_NARROW),
  26640. y._fovThreshold = v.getFOVDotThreshold(h.DIRECTIONAL_FOV);
  26641. for (var r = -1, o = 0; o < e.length; o++) {
  26642. if (y(t, e[o]) <= 0) {
  26643. r = o;
  26644. break
  26645. }
  26646. }
  26647. if (-1 === r)
  26648. e[e.length] = t;
  26649. else {
  26650. for (var a = e.length; r < a; a--)
  26651. e[a] = e[a - 1];
  26652. e[r] = t
  26653. }
  26654. }
  26655. ,
  26656. h.prototype.setZoomingActive = function(e) {
  26657. e !== this.zoomingActive && (this.zoomingActive = e)
  26658. }
  26659. ,
  26660. C.exports = h
  26661. }
  26662. ).call(this, "/js/tile/TilePrioritizer.js")
  26663. }
  26664. , {
  26665. "../enum/DownloadStatus": 24,
  26666. "../enum/GLCubeFaces": 25,
  26667. "../enum/ModelManagerEvents": 33,
  26668. "../enum/PanoSizeClass": 36,
  26669. "../enum/Vectors": 50,
  26670. "../enum/Viewmode": 51,
  26671. "../objects/Panorama": 148,
  26672. "../settings": 166,
  26673. "../util/browser": 182,
  26674. "../util/logger": 189,
  26675. "../util/math": 190,
  26676. "./TileUtils": 174,
  26677. events: 202,
  26678. three: 217
  26679. }],
  26680. 173: [function(e, t, i) {
  26681. "use strict";
  26682. function f(e, t) {
  26683. this.levels = t,
  26684. this.tileSize = e,
  26685. this.root = null,
  26686. this.allNodes = [],
  26687. function(e) {
  26688. e.root = function e(t, i, n) {
  26689. if (n > t.levels)
  26690. return null;
  26691. var r = new a(t,i);
  26692. t.allNodes.push(r);
  26693. for (var o = 0; o < s; o++)
  26694. r.children[o] = e(t, r, n + 1);
  26695. return r
  26696. }(e, null, 0)
  26697. }(this)
  26698. }
  26699. function a(e, t) {
  26700. this.tree = e,
  26701. this.parent = t,
  26702. this.children = [],
  26703. this.id = ++n
  26704. }
  26705. var g = (e("three"),
  26706. e("./TileUtils"),
  26707. e("../objects/Panorama"),
  26708. e("../util/panorama"),
  26709. e("events").EventEmitter,
  26710. 2)
  26711. , s = g * g;
  26712. f.TraversalType = Object.freeze({
  26713. PreOrder: 0,
  26714. PostOrder: 1
  26715. });
  26716. var n = 0;
  26717. f.getLevelCountForSize = function(e, t) {
  26718. var i = 0;
  26719. for (t < e && (t = e); !((t /= g) < e); )
  26720. i++;
  26721. return i
  26722. }
  26723. ,
  26724. f.getSizeForLevel = function(e, t) {
  26725. return Math.pow(g, t) * e
  26726. }
  26727. ,
  26728. f.prototype.getSubNode = function(e, t, i) {
  26729. (!t || e < this.tileSize) && (t = 0),
  26730. (!i || e < this.tileSize) && (i = 0),
  26731. e < this.tileSize && (e = this.tileSize);
  26732. var n = f.getLevelCountForSize(this.tileSize, e);
  26733. return function e(t, i, n, r, o) {
  26734. if (!t)
  26735. return null;
  26736. if (0 === n)
  26737. return t;
  26738. if (!t.children || 0 === t.children.length)
  26739. return null;
  26740. var a = Math.pow(g, n) / g
  26741. , s = r % a
  26742. , l = o % a
  26743. , c = Math.floor(o / a)
  26744. , h = Math.floor(r / a)
  26745. , u = c * g + h;
  26746. return e(t.children[u], i + 1, n - 1, s, l)
  26747. }(this.root, 0, n, t, i)
  26748. }
  26749. ,
  26750. f.prototype.breadthFirst = function(e) {
  26751. var t = !!(e = e || {}).nullLevelEnd
  26752. , i = e.maxLevel
  26753. , n = e.minLevel
  26754. , r = e.callback
  26755. , o = e.saveVisited
  26756. , a = []
  26757. , s = {}
  26758. , l = 0;
  26759. for (a.push(this.root),
  26760. a.push(s); 0 < a.length && !(i && i < l); ) {
  26761. var c = a.shift();
  26762. if (c === s)
  26763. (!n || n <= l) && (r && t && r(null),
  26764. o && t && o.push(null)),
  26765. 0 < a.length && a.push(s),
  26766. l++,
  26767. 0;
  26768. else {
  26769. if (c.children)
  26770. for (var h = 0; h < c.children.length; h++) {
  26771. c.children[h] && a.push(c.children[h])
  26772. }
  26773. var u = this.getFaceIndexFromNode(c);
  26774. (!n || n <= l) && (r && r(c, l, u),
  26775. o && o.push(c)),
  26776. 0
  26777. }
  26778. }
  26779. }
  26780. ,
  26781. f.prototype.getFaceIndexFromNode = function(e) {
  26782. if (!e)
  26783. return -1;
  26784. for (var t = 1, i = e, n = 0, r = 0; ; ) {
  26785. var o = i.parent;
  26786. if (!o)
  26787. break;
  26788. for (var a = -1, s = 0; s < o.children.length; s++)
  26789. o.children[s] === i && (a = s);
  26790. n = a % g * t + n,
  26791. r = Math.floor(a / g) * t + r,
  26792. t *= g,
  26793. i = o
  26794. }
  26795. return r * t + n
  26796. }
  26797. ,
  26798. f.prototype.depthFirst = function(e, t, i) {
  26799. !function e(t, i, n, r, o, a, s, l) {
  26800. if (t) {
  26801. s = s || f.TraversalType.PreOrder;
  26802. var c = r * g + n;
  26803. if (s === f.TraversalType.PreOrder && (o && o(t, i, c, n, r),
  26804. a && a.push(t)),
  26805. t.children && 0 !== t.children.length) {
  26806. for (var h = r * g, u = n * g, d = 0; d < g; d++)
  26807. for (var p = 0; p < g; p++)
  26808. e(t.children[p * g + d], i + 1, u + d, h + p, o, a, s, l);
  26809. s === f.TraversalType.PostOrder && (o && o(t, i, c, n, r),
  26810. a && a.push(t))
  26811. }
  26812. }
  26813. }(this.root, 0, 0, 0, e, t, i, this.tileSize)
  26814. }
  26815. ,
  26816. t.exports = f
  26817. }
  26818. , {
  26819. "../objects/Panorama": 148,
  26820. "../util/panorama": 191,
  26821. "./TileUtils": 174,
  26822. events: 202,
  26823. three: 217
  26824. }],
  26825. 174: [function(e, t, i) {
  26826. "use strict";
  26827. var n, a, s, p, f, g, E, l, c, h, u, d, r, o, m = e("../enum/GLCubeFaces"), _ = e("../util/MathLight"), b = {};
  26828. b.TILE_SIZE = 512,
  26829. b.FACES_PER_PANO = 6,
  26830. b.LocationOnTile = {
  26831. Center: 0,
  26832. UpperLeft: 1,
  26833. UpperRight: 2,
  26834. LowerRight: 3,
  26835. LowerLeft: 4
  26836. },
  26837. b.getTileVector = function(e, t, i, n, r, o, a, s) {
  26838. var l = e / t
  26839. , c = t / e * 2
  26840. , h = c / 2
  26841. , u = n / l * 2 - 1 + h
  26842. , d = (r = l - 1 - r) / l * 2 - 1 + h;
  26843. switch (o = o || b.LocationOnTile.Center) {
  26844. case b.LocationOnTile.UpperLeft:
  26845. u -= h,
  26846. d += h,
  26847. u += a * c;
  26848. break;
  26849. case b.LocationOnTile.UpperRight:
  26850. u += h,
  26851. d += h,
  26852. d -= a * c;
  26853. break;
  26854. case b.LocationOnTile.LowerRight:
  26855. u += h,
  26856. d -= h,
  26857. u -= a * c;
  26858. break;
  26859. case b.LocationOnTile.LowerLeft:
  26860. u -= h,
  26861. d -= h,
  26862. d += a * c;
  26863. break;
  26864. case b.LocationOnTile.Center:
  26865. }
  26866. switch (i) {
  26867. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  26868. _.setVector(s, -1, d, -u);
  26869. break;
  26870. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  26871. _.setVector(s, 1, d, u);
  26872. break;
  26873. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  26874. _.setVector(s, -u, 1, -d);
  26875. break;
  26876. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  26877. _.setVector(s, -u, -1, d);
  26878. break;
  26879. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  26880. _.setVector(s, -u, d, 1);
  26881. break;
  26882. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  26883. _.setVector(s, u, d, -1)
  26884. }
  26885. _.normalize(s)
  26886. }
  26887. ,
  26888. b.getFaceForTile = function(e, t) {
  26889. var i = b.TILE_SIZE;
  26890. e < b.TILE_SIZE && (i = e);
  26891. var n = Math.floor(e / i)
  26892. , r = n * n;
  26893. return Math.floor(t / r)
  26894. }
  26895. ,
  26896. b.getTileLocation = function(e, t, i) {
  26897. var n = b.TILE_SIZE;
  26898. e < b.TILE_SIZE && (n = e);
  26899. var r = b.getFaceForTile(e, t)
  26900. , o = Math.floor(e / n)
  26901. , a = t - r * (o * o);
  26902. i.tileX = a % o,
  26903. i.tileY = Math.floor(a / o),
  26904. i.face = r,
  26905. i.faceTileIndex = a
  26906. }
  26907. ,
  26908. b.getTileCountForSize = function(e) {
  26909. if (e <= b.TILE_SIZE)
  26910. return b.FACES_PER_PANO;
  26911. var t = Math.floor(e / b.TILE_SIZE);
  26912. return t * t * b.FACES_PER_PANO
  26913. }
  26914. ,
  26915. b.getRelativeDirection = (r = new _.Matrix4,
  26916. o = new _.Quaternion,
  26917. function(e, t) {
  26918. o.copy(e),
  26919. o.inverse(),
  26920. r.makeRotationFromQuaternion(o),
  26921. r.applyToVector3(t),
  26922. _.normalize(t)
  26923. }
  26924. ),
  26925. b.matchingTilesInDirection = (c = new _.Vector3,
  26926. h = new _.Vector3(0,0,-1),
  26927. u = new _.Quaternion,
  26928. l = {
  26929. face: -1,
  26930. faceTileIndex: -1,
  26931. tileX: -1,
  26932. tileY: -1
  26933. },
  26934. d = function(e, t, i) {
  26935. for (var n = b.getTileCountForSize(e), r = 0, o = 0; o < n; o++)
  26936. b.getTileLocation(e, o, l),
  26937. t && !t(l) || (r++,
  26938. i && (a = l,
  26939. i.push({
  26940. face: a.face,
  26941. faceTileIndex: a.faceTileIndex,
  26942. tileX: a.tileX,
  26943. tileY: a.tileY
  26944. })));
  26945. var a;
  26946. return r
  26947. }
  26948. ,
  26949. function(e, t, i, n, r, o) {
  26950. var a = t < b.TILE_SIZE ? t : b.TILE_SIZE;
  26951. if (b.getTileCountForSize(t),
  26952. !n && !r)
  26953. return d(t, null, o);
  26954. var s = !!r;
  26955. return r = r || n,
  26956. r = Math.max(0, Math.min(r, 360)),
  26957. n = Math.max(0, Math.min(n, 360)),
  26958. _.copyVector(i, c),
  26959. b.getRelativeDirection(e.quaternion, c),
  26960. s ? (u.setFromUnitVectors(c, h),
  26961. d(t, function(e) {
  26962. return b.isTileWithinFrustum(t, a, e.face, e.tileX, e.tileY, u, n, r)
  26963. }, o)) : d(t, function(e) {
  26964. return b.isTileWithinFOV(t, a, e.face, e.tileX, e.tileY, c, n)
  26965. }, o)
  26966. }
  26967. ),
  26968. b.isTileWithinFrustum = (E = new _.Vector3,
  26969. function(e, t, i, n, r, o, a, s) {
  26970. 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++)
  26971. if (b.getTileVector(e, t, d, n, r, y, 0, E),
  26972. _.applyQuaternionToVector(o, E),
  26973. -1e-5 <= E.z)
  26974. ;
  26975. else {
  26976. var A = -1 / E.z
  26977. , C = E.x * A
  26978. , I = E.y * A;
  26979. l < I ? p++ : I < c && f++,
  26980. h < C ? g++ : C < u && m++,
  26981. v++
  26982. }
  26983. return f !== v && p !== v && g !== v && m !== v
  26984. }
  26985. ),
  26986. b.isTileWithinFOV = (p = new _.Vector3,
  26987. f = new _.Vector3(0,1,0),
  26988. g = new _.Vector3(1,0,0),
  26989. function(e, t, i, n, r, o, a) {
  26990. var s = b.mapFaceToCubemapFace(i);
  26991. if (_.cross(o, f, g),
  26992. b.getTileVector(e, t, s, n, r, b.LocationOnTile.Center, 0, p),
  26993. b.isWithinFOV(p, o, a, null))
  26994. return !0;
  26995. for (var l = a / 360, c = Math.floor(1 / l), h = 0, u = 0; u < c; u++) {
  26996. for (var d = b.LocationOnTile.UpperLeft; d <= b.LocationOnTile.LowerLeft; d++)
  26997. if (b.getTileVector(e, t, s, n, r, d, h, p),
  26998. b.isWithinFOV(p, o, a, null))
  26999. return !0;
  27000. h += l
  27001. }
  27002. return !1
  27003. }
  27004. ),
  27005. b.isWithinFOV = (a = new _.Vector3,
  27006. s = new _.Vector3,
  27007. function(e, t, i, n) {
  27008. if (_.copyVector(e, s),
  27009. n) {
  27010. _.copyVector(n, a),
  27011. _.normalize(a);
  27012. var r = _.dot(a, e);
  27013. a.x *= r,
  27014. a.y *= r,
  27015. a.z *= r,
  27016. _.subVector(s, a)
  27017. }
  27018. var o = i / 2 * _.RADIANS_PER_DEGREE;
  27019. return Math.cos(o) <= _.dot(s, t)
  27020. }
  27021. ),
  27022. b.mapFaceToCubemapFace = (n = {
  27023. 0: m.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  27024. 1: m.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  27025. 2: m.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  27026. 3: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  27027. 4: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  27028. 5: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  27029. },
  27030. function(e) {
  27031. return n[e]
  27032. }
  27033. ),
  27034. t.exports = b
  27035. }
  27036. , {
  27037. "../enum/GLCubeFaces": 25,
  27038. "../util/MathLight": 176
  27039. }],
  27040. 175: [function(i, n, e) {
  27041. (function(e) {
  27042. "use strict";
  27043. function t() {
  27044. this.list = [],
  27045. this.index = {},
  27046. Object.defineProperty(this, "length", {
  27047. get: function() {
  27048. return this.list.length
  27049. }
  27050. })
  27051. }
  27052. new (i("./common"),
  27053. i("./logger"))(e),
  27054. t.prototype.forEach = function(e) {
  27055. this.list.forEach(e)
  27056. }
  27057. ,
  27058. t.prototype.add = function(e) {
  27059. this.list.push(e),
  27060. this.index[this.getIndex(e)] = e
  27061. }
  27062. ,
  27063. t.prototype.getIndex = function(e) {
  27064. throw new Error("IndexedCollection.getIndex not implemented in subclass.")
  27065. }
  27066. ,
  27067. t.prototype.extend = function(e) {
  27068. for (var t = 0; t < e.length; t++)
  27069. this.add(e[t])
  27070. }
  27071. ,
  27072. t.prototype.get = function(e) {
  27073. return this.index[e]
  27074. }
  27075. ,
  27076. t.prototype.first = function() {
  27077. return this.list[0]
  27078. }
  27079. ,
  27080. t.prototype.last = function() {
  27081. return this.list[this.list.length - 1]
  27082. }
  27083. ,
  27084. t.prototype.reIndex = function() {
  27085. this.index = {};
  27086. var t = this;
  27087. this.forEach(function(e) {
  27088. t.index[t.getIndex(e)] = e
  27089. })
  27090. }
  27091. ,
  27092. t.prototype.filter = function(e) {
  27093. var t = this.list.filter(e);
  27094. return this.reIndex(),
  27095. t
  27096. }
  27097. ,
  27098. t.prototype.reduce = function(e, t) {
  27099. return this.list.reduce(e, t)
  27100. }
  27101. ,
  27102. t.prototype.sort = function(e) {
  27103. return this.list.sort(e)
  27104. }
  27105. ,
  27106. t.prototype.indexOf = function(e) {
  27107. for (var t = 0; t < this.list.length; ++t)
  27108. if (this.list[t] === e)
  27109. return t;
  27110. return -1
  27111. }
  27112. ,
  27113. n.exports = t
  27114. }
  27115. ).call(this, "/js/util/IndexedCollection.js")
  27116. }
  27117. , {
  27118. "./common": 185,
  27119. "./logger": 189
  27120. }],
  27121. 176: [function(e, t, i) {
  27122. "use strict";
  27123. e("../constants");
  27124. var n, r, o = {};
  27125. o.RADIANS_PER_DEGREE = Math.PI / 180,
  27126. o.DEGREES_PER_RADIAN = 180 / Math.PI,
  27127. o.Vector3 = function(e, t, i) {
  27128. this.x = e || 0,
  27129. this.y = t || 0,
  27130. this.z = i || 0
  27131. }
  27132. ,
  27133. o.Matrix4 = function() {
  27134. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  27135. 0 < arguments.length && console.error("MathLight.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  27136. }
  27137. ,
  27138. o.Matrix4.prototype = {
  27139. identity: function() {
  27140. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  27141. this
  27142. },
  27143. copy: function(e) {
  27144. return this.elements.set(e.elements),
  27145. this
  27146. },
  27147. applyToVector3: function(e) {
  27148. var t = e.x
  27149. , i = e.y
  27150. , n = e.z
  27151. , r = this.elements;
  27152. return e.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  27153. e.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  27154. e.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  27155. this
  27156. },
  27157. getInverse: function(e, t) {
  27158. var i = this.elements
  27159. , n = e.elements
  27160. , r = n[0]
  27161. , o = n[1]
  27162. , a = n[2]
  27163. , s = n[3]
  27164. , l = n[4]
  27165. , c = n[5]
  27166. , h = n[6]
  27167. , u = n[7]
  27168. , d = n[8]
  27169. , p = n[9]
  27170. , f = n[10]
  27171. , g = n[11]
  27172. , m = n[12]
  27173. , v = n[13]
  27174. , y = n[14]
  27175. , A = n[15]
  27176. , C = p * y * u - v * f * u + v * h * g - c * y * g - p * h * A + c * f * A
  27177. , I = m * f * u - d * y * u - m * h * g + l * y * g + d * h * A - l * f * A
  27178. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * A + l * p * A
  27179. , _ = m * p * h - d * v * h - m * c * f + l * v * f + d * c * y - l * p * y
  27180. , b = r * C + o * I + a * E + s * _;
  27181. if (0 == b) {
  27182. var w = "MathLight.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  27183. if (t)
  27184. throw new Error(w);
  27185. return console.warn(w),
  27186. this.identity()
  27187. }
  27188. var T = 1 / b;
  27189. return i[0] = C * T,
  27190. i[1] = (v * f * s - p * y * s - v * a * g + o * y * g + p * a * A - o * f * A) * T,
  27191. i[2] = (c * y * s - v * h * s + v * a * u - o * y * u - c * a * A + o * h * A) * T,
  27192. i[3] = (p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g) * T,
  27193. i[4] = I * T,
  27194. i[5] = (d * y * s - m * f * s + m * a * g - r * y * g - d * a * A + r * f * A) * T,
  27195. i[6] = (m * h * s - l * y * s - m * a * u + r * y * u + l * a * A - r * h * A) * T,
  27196. i[7] = (l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g) * T,
  27197. i[8] = E * T,
  27198. i[9] = (m * p * s - d * v * s - m * o * g + r * v * g + d * o * A - r * p * A) * T,
  27199. i[10] = (l * v * s - m * c * s + m * o * u - r * v * u - l * o * A + r * c * A) * T,
  27200. i[11] = (d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g) * T,
  27201. i[12] = _ * T,
  27202. i[13] = (d * v * a - m * p * a + m * o * f - r * v * f - d * o * y + r * p * y) * T,
  27203. i[14] = (m * c * a - l * v * a - m * o * h + r * v * h + l * o * y - r * c * y) * T,
  27204. i[15] = (l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f) * T,
  27205. this
  27206. },
  27207. makeRotationFromQuaternion: function(e) {
  27208. var t = this.elements
  27209. , i = e.x
  27210. , n = e.y
  27211. , r = e.z
  27212. , o = e.w
  27213. , a = i + i
  27214. , s = n + n
  27215. , l = r + r
  27216. , c = i * a
  27217. , h = i * s
  27218. , u = i * l
  27219. , d = n * s
  27220. , p = n * l
  27221. , f = r * l
  27222. , g = o * a
  27223. , m = o * s
  27224. , v = o * l;
  27225. return t[0] = 1 - (d + f),
  27226. t[4] = h - v,
  27227. t[8] = u + m,
  27228. t[1] = h + v,
  27229. t[5] = 1 - (c + f),
  27230. t[9] = p - g,
  27231. t[2] = u - m,
  27232. t[6] = p + g,
  27233. t[10] = 1 - (c + d),
  27234. t[3] = 0,
  27235. t[7] = 0,
  27236. t[11] = 0,
  27237. t[12] = 0,
  27238. t[13] = 0,
  27239. t[14] = 0,
  27240. t[15] = 1,
  27241. this
  27242. }
  27243. },
  27244. o.Quaternion = function(e, t, i, n) {
  27245. this._x = e || 0,
  27246. this._y = t || 0,
  27247. this._z = i || 0,
  27248. this._w = void 0 !== n ? n : 1
  27249. }
  27250. ,
  27251. o.Quaternion.prototype = {
  27252. get x() {
  27253. return this._x
  27254. },
  27255. set x(e) {
  27256. this._x = e
  27257. },
  27258. get y() {
  27259. return this._y
  27260. },
  27261. set y(e) {
  27262. this._y = e
  27263. },
  27264. get z() {
  27265. return this._z
  27266. },
  27267. set z(e) {
  27268. this._z = e
  27269. },
  27270. get w() {
  27271. return this._w
  27272. },
  27273. set w(e) {
  27274. this._w = e
  27275. },
  27276. copy: function(e) {
  27277. this._x = e.x,
  27278. this._y = e.y,
  27279. this._z = e.z,
  27280. this._w = e.w
  27281. },
  27282. inverse: function() {
  27283. return this.conjugate().normalize()
  27284. },
  27285. conjugate: function() {
  27286. return this._x *= -1,
  27287. this._y *= -1,
  27288. this._z *= -1,
  27289. this
  27290. },
  27291. length: function() {
  27292. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  27293. },
  27294. normalize: function() {
  27295. var e = this.length();
  27296. return 0 === e ? (this._x = 0,
  27297. this._y = 0,
  27298. this._z = 0,
  27299. this._w = 1) : (e = 1 / e,
  27300. this._x = this._x * e,
  27301. this._y = this._y * e,
  27302. this._z = this._z * e,
  27303. this._w = this._w * e),
  27304. this
  27305. },
  27306. setFromAxisAngle: function(e, t) {
  27307. var i = t / 2
  27308. , n = Math.sin(i);
  27309. return this._x = e.x * n,
  27310. this._y = e.y * n,
  27311. this._z = e.z * n,
  27312. this._w = Math.cos(i),
  27313. this
  27314. },
  27315. setFromUnitVectors: function(e, t) {
  27316. return void 0 === n && (n = new o.Vector3),
  27317. (r = o.dot(e, t) + 1) < 1e-6 ? (r = 0,
  27318. 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),
  27319. this._x = n.x,
  27320. this._y = n.y,
  27321. this._z = n.z,
  27322. this._w = r,
  27323. this.normalize()
  27324. },
  27325. multiply: function(e) {
  27326. return this.multiplyQuaternions(this, e)
  27327. },
  27328. premultiply: function(e) {
  27329. return this.multiplyQuaternions(e, this)
  27330. },
  27331. multiplyQuaternions: function(e, t) {
  27332. var i = e._x
  27333. , n = e._y
  27334. , r = e._z
  27335. , o = e._w
  27336. , a = t._x
  27337. , s = t._y
  27338. , l = t._z
  27339. , c = t._w;
  27340. return this._x = i * c + o * a + n * l - r * s,
  27341. this._y = n * c + o * s + r * a - i * l,
  27342. this._z = r * c + o * l + i * s - n * a,
  27343. this._w = o * c - i * a - n * s - r * l,
  27344. this
  27345. }
  27346. },
  27347. o.convertWorkshopVector = function(e) {
  27348. return new o.Vector3(-e.x,e.y,e.z)
  27349. }
  27350. ,
  27351. o.convertWorkshopQuaternion = function(e) {
  27352. 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))
  27353. }
  27354. ,
  27355. o.convertWorkshopOrthoZoom = function(e) {
  27356. return -1 === e ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight
  27357. }
  27358. ,
  27359. o.convertWorkshopPanoramaQuaternion = function(e) {
  27360. 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))
  27361. }
  27362. ,
  27363. o.normalize = function(e) {
  27364. var t = e.x * e.x + e.y * e.y + e.z * e.z
  27365. , i = Math.sqrt(t);
  27366. e.x /= i,
  27367. e.y /= i,
  27368. e.z /= i
  27369. }
  27370. ,
  27371. o.dot = function(e, t) {
  27372. return e.x * t.x + e.y * t.y + e.z * t.z
  27373. }
  27374. ,
  27375. o.cross = function(e, t, i) {
  27376. var n = e.x
  27377. , r = e.y
  27378. , o = e.z;
  27379. i.x = r * t.z - o * t.y,
  27380. i.y = o * t.x - n * t.z,
  27381. i.z = n * t.y - r * t.x
  27382. }
  27383. ,
  27384. o.setVector = function(e, t, i, n) {
  27385. e.x = t,
  27386. e.y = i,
  27387. e.z = n
  27388. }
  27389. ,
  27390. o.copyVector = function(e, t) {
  27391. t.x = e.x,
  27392. t.y = e.y,
  27393. t.z = e.z
  27394. }
  27395. ,
  27396. o.addVector = function(e, t) {
  27397. e.x += t.x,
  27398. e.y += t.y,
  27399. e.z += t.z
  27400. }
  27401. ,
  27402. o.subVector = function(e, t) {
  27403. e.x -= t.x,
  27404. e.y -= t.y,
  27405. e.z -= t.z
  27406. }
  27407. ,
  27408. o.applyQuaternionToVector = function(e, t) {
  27409. var i = t.x
  27410. , n = t.y
  27411. , r = t.z
  27412. , o = e.x
  27413. , a = e.y
  27414. , s = e.z
  27415. , l = e.w
  27416. , c = l * i + a * r - s * n
  27417. , h = l * n + s * i - o * r
  27418. , u = l * r + o * n - a * i
  27419. , d = -o * i - a * n - s * r;
  27420. t.x = c * l + d * -o + h * -s - u * -a,
  27421. t.y = h * l + d * -a + u * -o - c * -s,
  27422. t.z = u * l + d * -s + c * -a - h * -o
  27423. }
  27424. ,
  27425. o.angleBetweenVectors = function(e, t) {
  27426. return Math.acos(o.dot(e, t))
  27427. }
  27428. ,
  27429. t.exports = o
  27430. }
  27431. , {
  27432. "../constants": 8
  27433. }],
  27434. 177: [function(c, h, e) {
  27435. (function(e) {
  27436. "use strict";
  27437. function t(e) {
  27438. this.cache = null,
  27439. this.expires = 0
  27440. }
  27441. function i() {
  27442. this.baseUrl = null,
  27443. this.cache = null,
  27444. this.expires = 0
  27445. }
  27446. function n() {
  27447. this.baseUrl = null,
  27448. this.expires = 0
  27449. }
  27450. function r(e) {
  27451. this.initialLoadingPromise = null,
  27452. this.endpoint = e + "?type=3",
  27453. this.urlContainer = null,
  27454. this.authorizationHeader = s.getAuthorizationHeader(),
  27455. this.containerClasses = [n, i, t]
  27456. }
  27457. c("./ajax");
  27458. var o = c("./logger")
  27459. , a = c("../constants")
  27460. , s = c("./showcase")
  27461. , l = (c("../ab"),
  27462. new o(e));
  27463. t.prototype = {
  27464. version: 1,
  27465. validate: function(e) {
  27466. return "catalog.json"in e && 0 < Object.keys(e).length
  27467. },
  27468. update: function(e) {
  27469. return this.cache = e,
  27470. this.expires = Date.now() + a.signedUrlDefaultExpireTime,
  27471. $.when()
  27472. },
  27473. get: function(e) {
  27474. return this.cache[e]
  27475. }
  27476. },
  27477. i.prototype = {
  27478. version: 2,
  27479. validate: function(e) {
  27480. return "catalog.json"in e && "base.url"in e && 1 < Object.keys(e).length
  27481. },
  27482. update: function(e) {
  27483. return this.baseUrl = e["base.url"],
  27484. this.cache = e,
  27485. this.expires = Date.now() + a.signedUrlDefaultExpireTime,
  27486. $.when()
  27487. },
  27488. get: function(e) {
  27489. var t = this.cache[e];
  27490. return t ? this.baseUrl.replace("{{filename}}", e) + t : null
  27491. }
  27492. },
  27493. n.prototype = {
  27494. version: 3,
  27495. validate: function(e) {
  27496. return e.templates && e.catalog_file && (!e.expires || 1e3 * e.expires > Date.now())
  27497. },
  27498. update: function(e) {
  27499. return this.baseUrl = e.templates[0],
  27500. e.expires ? this.expires = 1e3 * e.expires : this.expires = Date.now() + a.signedUrlDefaultExpireTime,
  27501. $.when()
  27502. },
  27503. get: function(e) {
  27504. return this.baseUrl.replace("{{filename}}", e)
  27505. }
  27506. },
  27507. r.prototype = {
  27508. init: function() {
  27509. return this.initialLoadingPromise || (setInterval(function() {
  27510. var e = this.urlContainer ? this.urlContainer.expires : Date.now();
  27511. Date.now() + a.signedUrlRefreshBuffer > e && (l.debug("Refreshing urls..."),
  27512. this.refresh().done(function() {
  27513. l.debug("Refreshed")
  27514. }).fail(function() {
  27515. l.error("Failed url refresh, urls might go stale soon")
  27516. }))
  27517. }
  27518. .bind(this), a.signedUrlCheckInterval),
  27519. this.initialLoadingPromise = this.refresh()),
  27520. this.initialLoadingPromise
  27521. },
  27522. refresh: function(e) {
  27523. return {},
  27524. $.Deferred().resolve()
  27525. },
  27526. get: function(e) {
  27527. return window.MP_PREFETCHED_MODELDATA.files.templates[0].replace("{{filename}}", e)
  27528. }
  27529. },
  27530. h.exports = r
  27531. }
  27532. ).call(this, "/js/util/ModelUrls.js")
  27533. }
  27534. , {
  27535. "../ab": 3,
  27536. "../constants": 8,
  27537. "./ajax": 181,
  27538. "./logger": 189,
  27539. "./showcase": 193
  27540. }],
  27541. 178: [function(l, c, e) {
  27542. (function(e) {
  27543. "use strict";
  27544. function t() {
  27545. i.call(this),
  27546. this.neighbourMap = {},
  27547. this.map = null
  27548. }
  27549. 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"),
  27550. l("./aStar")), T = new (l("./logger"))(e), i = l("./IndexedCollection"), s = l("./transitions");
  27551. n.inherit(t, i),
  27552. t.prototype.getIndex = function(e) {
  27553. return e.id
  27554. }
  27555. ,
  27556. t.prototype.find = function(e, t) {
  27557. var i = n.filterAll(this.list, e);
  27558. return 0 === i.length ? null : (t && t.forEach(function(e) {
  27559. i = n.stableSort(i, e)
  27560. }),
  27561. i[0])
  27562. }
  27563. ,
  27564. t.prototype.sortByScore = function(e, t) {
  27565. var i = n.filterAll(this.list, e);
  27566. return 0 === i.length ? null : i = i.map(function(i) {
  27567. return {
  27568. pano: i,
  27569. score: t.reduce(function(e, t) {
  27570. return e + t(i)
  27571. }, 0)
  27572. }
  27573. }).sort(function(e, t) {
  27574. return t.score - e.score
  27575. })
  27576. }
  27577. ,
  27578. t.prototype.lowestByScore = function(e, t, i) {
  27579. return this.findRankedByScore(0, e, t, i)
  27580. }
  27581. ,
  27582. t.prototype.findRankedByScore = function(e, t, i, n) {
  27583. n && (n.candidates = null,
  27584. n.pano = null),
  27585. e = e || 0;
  27586. var r = this.sortByScore(t, i);
  27587. return !r || 0 === r.length || e >= r.length ? null : (n && (n.candidates = r,
  27588. n.pano = r[e].pano),
  27589. r[e].pano)
  27590. }
  27591. ,
  27592. t.prototype.showPanoScores = function(e) {
  27593. this.list.forEach(function(e) {
  27594. e.removeTextSprite()
  27595. });
  27596. var t = 6344768;
  27597. e.forEach(function(e) {
  27598. e.pano.addTextSprite(e.score.toFixed(2), t),
  27599. t = 16428055
  27600. })
  27601. }
  27602. ,
  27603. t.prototype.isNeighbour = function(e, t) {
  27604. return this.neighbourMap[e.id][t.id]
  27605. }
  27606. ,
  27607. t.prototype.getNeighbours = function(e) {
  27608. return this.neighbourMap[e.id]
  27609. }
  27610. ,
  27611. t.prototype.setNeighbour = function(e, t, i) {
  27612. return this.neighbourMap[e.id] || (this.neighbourMap[e.id] = {}),
  27613. this.neighbourMap[t.id] || (this.neighbourMap[t.id] = {}),
  27614. this.neighbourMap[e.id][e.id] = !0,
  27615. this.neighbourMap[t.id][t.id] = !0,
  27616. this.neighbourMap[e.id][t.id] = i,
  27617. this.neighbourMap[t.id][e.id] = i,
  27618. this.neighbourMap[e.id]
  27619. }
  27620. ,
  27621. t.prototype.findClosest = function(e, t) {
  27622. var i = [r.filters.isPanoAligned()];
  27623. return t && i.push(r.filters.inDirection(e, t, .75)),
  27624. this.find(i, [r.sortFunctions.distanceToPoint(e)])
  27625. }
  27626. ,
  27627. t.prototype.dualNeighbors = function(e, t) {
  27628. var i, n = [];
  27629. for (i in this.neighbourMap[e.id])
  27630. this.neighbourMap[t.id][i] && n.push(i);
  27631. return n
  27632. }
  27633. ,
  27634. t.prototype.populate_path_graph = function() {
  27635. var e, t, i, n, r, o, a, s, l = Date.now(), c = {}, h = 0, u = new w.Vector3(0,0,0);
  27636. for (e = 0; e < this.list.length; e += 1) {
  27637. for (t in s = !(a = {}),
  27638. i = (r = this.list[e]).neighbourPanos || r.findNeighourPanos())
  27639. if (i[t]) {
  27640. o = this.index[t],
  27641. u.copy(r.floorPosition),
  27642. u.sub(o.floorPosition);
  27643. var d = Math.sqrt(u.x * u.x + u.z * u.z)
  27644. , p = (Math.abs(u.y),
  27645. Math.max(d, .01),
  27646. Math.max(0, Math.abs(u.y) - .2));
  27647. n = 0 < p ? (1,
  27648. p = Math.pow(4 * p, 2),
  27649. d = Math.pow(d, 2),
  27650. Math.sqrt(p * p + d * d)) : (1,
  27651. u.length()),
  27652. a[o.id] = n,
  27653. s = !0
  27654. }
  27655. s ? c[r.id] = a : h += 1
  27656. }
  27657. this.map = c,
  27658. T.info("graph ready in " + (Date.now() - l) + "ms, " + h + " had no neighbors")
  27659. }
  27660. ,
  27661. t.prototype.aStarSearch = function(e, t) {
  27662. var i = Date.now()
  27663. , n = new o({
  27664. start: e,
  27665. isEnd: function(e) {
  27666. return e === t
  27667. },
  27668. neighbor: function(e) {
  27669. var t = e.neighbourPanos || e.findNeighourPanos()
  27670. , i = [];
  27671. for (var n in t)
  27672. i.push(this.index[n]);
  27673. return i
  27674. }
  27675. .bind(this),
  27676. distance: function(e, t) {
  27677. return this.map[e.id][t.id]
  27678. }
  27679. .bind(this),
  27680. heuristic: function(e, t) {
  27681. return 1
  27682. }
  27683. .bind(this),
  27684. hash: function(e) {
  27685. return e.id
  27686. },
  27687. timeout: 5e3
  27688. });
  27689. if (T.debug("A* search in " + (Date.now() - i) + "ms"),
  27690. "success" !== n.status)
  27691. return T.debug("Did not find A* path from " + e + " to " + t),
  27692. null;
  27693. T.debug("Total cost " + n.cost.toPrecision(3) + ", " + n.path.length + " steps");
  27694. var r = [];
  27695. return n.path.forEach(function(e) {
  27696. r.push(e.id)
  27697. }),
  27698. r
  27699. }
  27700. ,
  27701. t.prototype.includeNodesNearPath = (f = new w.Vector3,
  27702. g = new w.Vector3,
  27703. m = new w.Vector3,
  27704. v = new w.Vector3,
  27705. y = new w.Vector3,
  27706. A = new w.Vector3,
  27707. C = new w.Vector3,
  27708. I = new w.Vector3,
  27709. E = [],
  27710. _ = new w.Vector3,
  27711. b = new w.Vector3,
  27712. function(e, t) {
  27713. if (e)
  27714. for (var i = function(e, t, i) {
  27715. return y.copy(t).sub(e),
  27716. y.dot(i)
  27717. }, n = function(e, t) {
  27718. return i(_, e.position, m) - i(_, t.position, m)
  27719. }, r = 0; r < e.length - 1; ) {
  27720. var o = e[r]
  27721. , a = e[r + 1]
  27722. , s = this.index[o]
  27723. , l = this.index[a];
  27724. _.copy(s.position),
  27725. b.copy(l.position),
  27726. E.length = 0,
  27727. f.copy(b).sub(_),
  27728. m.copy(f).normalize();
  27729. for (var c = 0; c < this.list.length; c++) {
  27730. var h = this.list[c];
  27731. y.copy(h.position).sub(_);
  27732. var u = y.dot(m);
  27733. 0 < u && (C.copy(m),
  27734. C.multiplyScalar(u),
  27735. A.copy(y),
  27736. A.sub(C),
  27737. A.length() < t && (g.copy(f).negate(),
  27738. v.copy(g).normalize(),
  27739. I.copy(h.position).sub(b),
  27740. 0 < I.dot(v) && E.push(h)))
  27741. }
  27742. if (0 < E.length) {
  27743. E.sort(n);
  27744. for (var d = e.length + E.length - 1; d >= r + E.length; d--)
  27745. e[d] = e[d - E.length];
  27746. for (var p = 0; p < E.length; p++)
  27747. e[p + r + 1] = E[p].id
  27748. }
  27749. r += E.length + 1
  27750. }
  27751. }
  27752. ),
  27753. t.prototype.fadeMarkerOpacity = function(e, t) {
  27754. var i = void 0 === e ? a.panorama.markerOpacity : e
  27755. , n = this.list.findIndex(function(e) {
  27756. return e.marker
  27757. });
  27758. if (!(n < 0)) {
  27759. var r = this.list[n].marker.material.opacity;
  27760. if (r !== e) {
  27761. var o = i - r;
  27762. s.trigger({
  27763. func: function(e, t) {
  27764. var i = r + e * o;
  27765. this.forEach(function(e) {
  27766. e.marker && (e.marker.material.opacity = i)
  27767. })
  27768. }
  27769. .bind(this),
  27770. duration: void 0 === t ? a.markerOpacityTransitionTime : t,
  27771. name: "_fpm"
  27772. })
  27773. }
  27774. }
  27775. }
  27776. ,
  27777. c.exports = t
  27778. }
  27779. ).call(this, "/js/util/PanoramaCollection.js")
  27780. }
  27781. , {
  27782. "../objects/Panorama": 148,
  27783. "../settings": 166,
  27784. "./IndexedCollection": 175,
  27785. "./aStar": 180,
  27786. "./common": 185,
  27787. "./logger": 189,
  27788. "./transitions": 195,
  27789. three: 217
  27790. }],
  27791. 179: [function(e, t, i) {
  27792. "use strict";
  27793. function n() {
  27794. this.actionSequence = [],
  27795. this.actionSequenceInProgress = !1
  27796. }
  27797. function r(e, t, i, n) {
  27798. c.trackAlways("zoom_" + e, {
  27799. from: t,
  27800. to: i,
  27801. pano: n
  27802. })
  27803. }
  27804. var o, a, s, l, c = e("../analytics");
  27805. n.prototype.reset = function(e) {
  27806. this.actionSequenceInProgress = !1,
  27807. this.actionSequence.length = 0
  27808. }
  27809. ,
  27810. n.prototype.addZoomAction = (a = o = null,
  27811. s = !1,
  27812. l = function() {
  27813. if (o = null,
  27814. 0 < this.actionSequence.length) {
  27815. var e = this.actionSequence[0].start
  27816. , t = this.actionSequence[this.actionSequence.length - 1].end;
  27817. 1 === e ? function(e, t) {
  27818. r("initial", 1, e, t)
  27819. }(t, a) : function(e, t, i) {
  27820. r("followup", e, t, i)
  27821. }(e, t, a)
  27822. }
  27823. this.reset()
  27824. }
  27825. ,
  27826. function(e, t, i) {
  27827. if (e !== t) {
  27828. s || (l = l.bind(this),
  27829. s = !0),
  27830. o && (window.clearTimeout(o),
  27831. o = null),
  27832. i === a && this.actionSequenceInProgress || (this.reset(),
  27833. a = i),
  27834. this.actionSequenceInProgress = !0;
  27835. var n = {
  27836. start: e,
  27837. end: t
  27838. };
  27839. this.actionSequence.push(n),
  27840. o = window.setTimeout(l, 150)
  27841. }
  27842. }
  27843. ),
  27844. t.exports = n
  27845. }
  27846. , {
  27847. "../analytics": 4
  27848. }],
  27849. 180: [function(e, t, i) {
  27850. "use strict";
  27851. function g(e) {
  27852. if (void 0 === e.parent)
  27853. return [e.data];
  27854. var t = g(e.parent);
  27855. return t.push(e.data),
  27856. t
  27857. }
  27858. function m(e) {
  27859. return e.toString()
  27860. }
  27861. function v(e, t) {
  27862. return e.f - t.f
  27863. }
  27864. var y = e("Set")
  27865. , A = e("heap")
  27866. , C = e("dict");
  27867. t.exports = function(e) {
  27868. void 0 === e.timeout && (e.timeout = 1 / 0);
  27869. var t = e.hash || m
  27870. , i = {
  27871. data: e.start,
  27872. g: 0,
  27873. h: e.heuristic(e.start)
  27874. }
  27875. , n = i;
  27876. i.f = i.h;
  27877. var r = new y
  27878. , o = new A(v)
  27879. , a = C();
  27880. o.push(i),
  27881. a.set(t(i.data), i);
  27882. for (var s = new Date; o.size(); ) {
  27883. if (new Date - s > e.timeout)
  27884. return {
  27885. status: "timeout",
  27886. cost: n.g,
  27887. path: g(n)
  27888. };
  27889. var l = o.pop();
  27890. if (a.delete(t(l.data)),
  27891. e.isEnd(l.data))
  27892. return {
  27893. status: "success",
  27894. cost: l.g,
  27895. path: g(l)
  27896. };
  27897. r.add(t(l.data));
  27898. for (var c = e.neighbor(l.data), h = 0; h < c.length; h++) {
  27899. var u = c[h];
  27900. if (!r.contains(t(u))) {
  27901. var d = l.g + e.distance(l.data, u)
  27902. , p = a.get(t(u))
  27903. , f = !1;
  27904. if (void 0 === p)
  27905. p = {
  27906. data: u
  27907. },
  27908. a.set(t(u), p);
  27909. else {
  27910. if (p.g < d)
  27911. continue;
  27912. f = !0
  27913. }
  27914. p.parent = l,
  27915. p.g = d,
  27916. p.h = e.heuristic(u),
  27917. p.f = d + p.h,
  27918. p.h < n.h && (n = p),
  27919. f ? o.heapify() : o.push(p)
  27920. }
  27921. }
  27922. }
  27923. return {
  27924. status: "noPath",
  27925. cost: n.g,
  27926. path: g(n)
  27927. }
  27928. }
  27929. }
  27930. , {
  27931. Set: 196,
  27932. dict: 210,
  27933. heap: 211
  27934. }],
  27935. 181: [function(i, n, e) {
  27936. (function(e) {
  27937. "use strict";
  27938. function s(e, t, i) {
  27939. function n() {
  27940. l.warn("Retrying ", t),
  27941. s(e, t, i).done(a.resolve.bind(a)).progress(a.notify.bind(a)).fail(a.reject.bind(a))
  27942. }
  27943. var r = function(e, t, i) {
  27944. var n = new XMLHttpRequest;
  27945. if (i && "withCredentials"in n)
  27946. n.open(e, t, i);
  27947. else if ("undefined" != typeof XDomainRequest)
  27948. (n = new XDomainRequest).open(e, t);
  27949. else {
  27950. if (i)
  27951. throw "Browser does not support CORS!";
  27952. n.open(e, t)
  27953. }
  27954. return n
  27955. }(e, t, !1);
  27956. if ((i = i || {}).retries = void 0 !== i.retries ? i.retries : 0,
  27957. i.retry = void 0 !== i.retry ? i.retry : "get" === e.toLowerCase(),
  27958. i.responseType)
  27959. if (-1 < ["arraybuffer", "text", "json"].indexOf(i.responseType))
  27960. r.responseType = i.responseType;
  27961. else {
  27962. if ("image/jpeg" !== i.responseType)
  27963. throw new Error('reponseType can only be one of "arraybuffer", "text" or "json", "image/jpeg"');
  27964. r.responseType = "arraybuffer"
  27965. }
  27966. if ("json" === i.responseType && r.setRequestHeader("Accept", "application/json"),
  27967. i.auth && r.setRequestHeader("Authorization", i.auth),
  27968. "object" == typeof i.data && (i.data = JSON.stringify(i.data),
  27969. r.setRequestHeader("Content-Type", "application/json")),
  27970. "object" == typeof i.headers)
  27971. for (var o in i.headers)
  27972. r.setRequestHeader(o, i.headers[o]);
  27973. var a = $.Deferred();
  27974. return r.onreadystatechange = function(e) {
  27975. if (4 === this.readyState)
  27976. if (500 <= this.status && this.status <= 600 && i.retry && i.retries < 3)
  27977. i.retries++,
  27978. setTimeout(n, 1e3);
  27979. else if (200 === this.status) {
  27980. var t = function(e, t) {
  27981. var i = e.response;
  27982. if ("json" === t && "object" != typeof i)
  27983. try {
  27984. i = JSON.parse(e.responseText)
  27985. } catch (e) {
  27986. return void a.reject({
  27987. error: "Failed parsing JSON"
  27988. })
  27989. }
  27990. else if ("image/jpeg" === t) {
  27991. var n = new Uint8Array(e.response)
  27992. , r = new Blob([n],{
  27993. type: "image/jpeg"
  27994. })
  27995. , o = URL.createObjectURL(r);
  27996. (i = new Image).src = o,
  27997. i.crossOrigin = "Anonymous",
  27998. i.onload = function() {
  27999. URL.revokeObjectURL(o)
  28000. }
  28001. }
  28002. return i
  28003. }(this, i.responseType);
  28004. a.resolve(t)
  28005. } else
  28006. a.reject(this)
  28007. }
  28008. ,
  28009. r.onprogress = function(e) {
  28010. a.notify(e)
  28011. }
  28012. ,
  28013. r.send(i.data),
  28014. a.promise()
  28015. }
  28016. function o(e, t) {
  28017. var i = e + "__" + (t.responseType || null) + "__" + (t.auth || null) + "__" + (t.prefetchFrom || null);
  28018. return t.headers && function(t) {
  28019. return Object.keys(t).sort().map(function(e) {
  28020. return {
  28021. key: e,
  28022. value: t[e]
  28023. }
  28024. })
  28025. }(t.headers).forEach(function(e) {
  28026. i += "__" + e.key + ":" + e.value
  28027. }),
  28028. i
  28029. }
  28030. var t = i("./logger")
  28031. , a = i("../ab")
  28032. , l = new t(e);
  28033. window.URL = window.URL || window.webkitURL,
  28034. window.MP_REQUEST_CACHE = window.MP_REQUEST_CACHE || {},
  28035. window.MP_PREFETCHED_MODELDATA = window.MP_PREFETCHED_MODELDATA || {},
  28036. n.exports = {
  28037. get: function(e, t) {
  28038. var i, n = void 0 === (t = t || {}).cache || t.cache;
  28039. if (n) {
  28040. var r = function(e, t) {
  28041. return window.MP_REQUEST_CACHE ? window.MP_REQUEST_CACHE[o(e, t)] : null
  28042. }(e, t);
  28043. if (r)
  28044. return r
  28045. }
  28046. return i = t.prefetchFrom && window.MP_PREFETCHED_MODELDATA[t.prefetchFrom] ? $.when(window.MP_PREFETCHED_MODELDATA[t.prefetchFrom]) : s("GET", e, t),
  28047. n && function(e, t, i) {
  28048. window.MP_REQUEST_CACHE && (window.MP_REQUEST_CACHE[o(e, t)] = i)
  28049. }(e, t, i),
  28050. i
  28051. },
  28052. post: function(e, t) {
  28053. return s("POST", e, t)
  28054. },
  28055. patch: function(e, t) {
  28056. return s("PATCH", e, t)
  28057. },
  28058. getImage: function(e, t) {
  28059. function i() {
  28060. l.warn("Retrying ", e),
  28061. o.getImage(e, t - 1).done(n.resolve.bind(n)).progress(n.notify.bind(n)).fail(n.reject.bind(n))
  28062. }
  28063. var n = $.Deferred()
  28064. , r = new Image
  28065. , o = this;
  28066. return e = a.changeIfImageOptimzing(e),
  28067. null != t || (t = 3),
  28068. r.onerror = function() {
  28069. 0 < t ? setTimeout(i, 1e3) : n.reject()
  28070. }
  28071. ,
  28072. r.onload = function() {
  28073. n.resolve(r)
  28074. }
  28075. ,
  28076. r.crossOrigin = "anonymous",
  28077. r.src = e,
  28078. n
  28079. }
  28080. }
  28081. }
  28082. ).call(this, "/js/util/ajax.js")
  28083. }
  28084. , {
  28085. "../ab": 3,
  28086. "./logger": 189
  28087. }],
  28088. 182: [function(e, t, i) {
  28089. "use strict";
  28090. function n(e, t) {
  28091. var i = window.navigator.userAgent.match(e);
  28092. return i = i ? i[1].split(t) : [],
  28093. {
  28094. major: parseInt(i[0]) || 0,
  28095. minor: parseInt(i[1]) || 0,
  28096. patch: parseInt(i[2]) || 0
  28097. }
  28098. }
  28099. var r = e("../exception/DeviceMismatchException");
  28100. t.exports = {
  28101. isFullscreen: function() {
  28102. return document.fullscreenElement || document.mozFullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement
  28103. },
  28104. supportsFullscreen: function() {
  28105. return document.fullscreenEnabled || document.mozFullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled || document.msFullscreenEnabled
  28106. },
  28107. isPointerLocked: function() {
  28108. return document.pointerLockElement || document.mozPointerLockElement || document.webkitPointerLockElement
  28109. },
  28110. requestFullscreen: function(e, t) {
  28111. e.requestFullscreen ? e.requestFullscreen() : e.mozRequestFullScreen ? e.mozRequestFullScreen() : e.webkitRequestFullscreen ? e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT) : e.msRequestFullscreen && e.msRequestFullscreen(),
  28112. t && $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", browser.requestPointerLock)
  28113. },
  28114. requestPointerLock: function() {
  28115. var e;
  28116. if (document.fullscreenElement)
  28117. e = document.fullscreenElement();
  28118. else if (document.mozFullscreenElement)
  28119. e = document.mozFullscreenElement();
  28120. else if (document.mozFullScreenElement)
  28121. e = document.mozFullScreenElement();
  28122. else {
  28123. if (!document.webkitFullscreenElement)
  28124. return;
  28125. e = document.webkitFullscreenElement()
  28126. }
  28127. e.requestPointerLock = e.requestPointerLock || e.mozRequestPointerLock || e.webkitRequestPointerLock,
  28128. e.requestPointerLock(),
  28129. $(document).off("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", this)
  28130. },
  28131. exitPointerLock: function() {
  28132. document.exitPointerLock = document.exitPointerLock || document.mozExitPointerLock || document.webkitExitPointerLock,
  28133. document.exitPointerLock()
  28134. },
  28135. exitFullscreen: function() {
  28136. document.exitFullscreen ? document.exitFullscreen() : document.msExitFullscreen ? document.msExitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.webkitExitFullscreen && document.webkitExitFullscreen()
  28137. },
  28138. details: function() {
  28139. var e = navigator.userAgent.match("(Firefox|Chrome|Safari)/([\\d]+)");
  28140. return e ? {
  28141. name: e[1],
  28142. version: parseInt(e[2]),
  28143. platform: navigator.platform
  28144. } : {}
  28145. },
  28146. is: function(e) {
  28147. return this.details() && this.details().name === e
  28148. },
  28149. inIframe: function() {
  28150. return window.parent !== window
  28151. },
  28152. aspectRatio: function() {
  28153. var e = $("#player").width() / $("#player").height();
  28154. return isFinite(e) ? e : 0
  28155. },
  28156. userAgent: function() {
  28157. return window.navigator.userAgent
  28158. },
  28159. isMobile: function() {
  28160. var e = navigator.userAgent || navigator.vendor || window.opera;
  28161. 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))
  28162. },
  28163. isLandscape: function() {
  28164. return this.isMobile && 1 < this.aspectRatio()
  28165. },
  28166. isSmallScreen: function() {
  28167. return screen.width / window.devicePixelRatio < 240
  28168. },
  28169. detectIE: function() {
  28170. return -1 !== window.navigator.userAgent.indexOf("MSIE ") || !!navigator.userAgent.match(/Trident.*rv\:11\./)
  28171. },
  28172. detectSafari: function() {
  28173. return -1 !== window.navigator.userAgent.indexOf("Safari") && !this.detectChrome()
  28174. },
  28175. detectFirefox: function() {
  28176. return -1 !== window.navigator.userAgent.indexOf("Firefox")
  28177. },
  28178. detectChrome: function() {
  28179. return -1 !== window.navigator.userAgent.indexOf("Chrome") && !this.detectOpera()
  28180. },
  28181. detectOpera: function() {
  28182. return -1 !== window.navigator.userAgent.indexOf("OPR")
  28183. },
  28184. detectIOS: function() {
  28185. return this.detectIPhone() || this.detectIPad() || this.detectIPod()
  28186. },
  28187. detectIPad: function() {
  28188. var e = window.navigator.userAgent;
  28189. return /iPad/.test(e)
  28190. },
  28191. detectIPod: function() {
  28192. var e = window.navigator.userAgent;
  28193. return /iPod/.test(e)
  28194. },
  28195. detectIPhone: function() {
  28196. var e = window.navigator.userAgent;
  28197. return /iPhone/.test(e)
  28198. },
  28199. detectAndroid: function() {
  28200. return -1 !== window.navigator.userAgent.indexOf("Android")
  28201. },
  28202. detectAndroidMobile: function() {
  28203. var e = window.navigator.userAgent;
  28204. return this.detectAndroid() && -1 !== e.indexOf("Mobile")
  28205. },
  28206. detectSamsungNative: function() {
  28207. var e = window.navigator.userAgent;
  28208. return -1 !== e.indexOf("SM-G900H") || -1 !== e.indexOf("GT-I9500") || -1 !== e.indexOf("SM-N900")
  28209. },
  28210. detectSamsungS6: function() {
  28211. return -1 !== window.navigator.userAgent.indexOf("SM-G92")
  28212. },
  28213. detectHUAWEI5X: function() {
  28214. return -1 !== window.navigator.userAgent.indexOf("KIW-TL00H")
  28215. },
  28216. detectWebVR: function() {
  28217. return !(!window.navigator.getVRDisplays || !window.VRDisplay)
  28218. },
  28219. getVRDisplay: function() {
  28220. var t = $.Deferred();
  28221. return this.detectWebVR() ? (navigator.getVRDisplays().then(function(e) {
  28222. 1 <= e.length && t.resolve(e[0]),
  28223. t.reject(null)
  28224. }),
  28225. t) : t.reject(null)
  28226. },
  28227. iosVersion: function() {
  28228. if (!this.detectIOS())
  28229. throw new r("Did not detect an iDevice");
  28230. return n(/((?:\d+\_?){1,3}) like Mac OS/, "_")
  28231. },
  28232. androidVersion: function() {
  28233. if (!this.detectAndroid())
  28234. throw new r("Did not detect an Android based device");
  28235. return n(/Android ((?:\d+\.?){1,3})/, ".")
  28236. },
  28237. valueFromCookie: function(e, t) {
  28238. var i = new RegExp(e + "=([0-9a-f]+)(; ?|$)").exec(document.cookie);
  28239. if (!i)
  28240. return t;
  28241. var n = i[1];
  28242. return "boolean" == typeof t ? "true" === n || "1" === n : "number" == typeof t ? parseFloat(n) : n
  28243. },
  28244. valueFromHash: function(e, t) {
  28245. var i = new RegExp("[#&?]" + e + "=([^#&?]*)").exec(window.location.href);
  28246. if (!i)
  28247. return t;
  28248. var n = i[1];
  28249. return "boolean" == typeof t ? "true" === n || "1" === n : "number" == typeof t ? parseFloat(n) : window.decodeURIComponent(n)
  28250. }
  28251. }
  28252. }
  28253. , {
  28254. "../exception/DeviceMismatchException": 56
  28255. }],
  28256. 183: [function(i, n, e) {
  28257. (function(e) {
  28258. "use strict";
  28259. var o = i("../controls/serializer")
  28260. , a = i("../util/math")
  28261. , s = i("./browser")
  28262. , l = i("../enum/Viewmode")
  28263. , t = i("../util/logger")
  28264. , c = i("three")
  28265. , h = new t(e);
  28266. n.exports = {
  28267. getStartCameraOptions: function(e, t) {
  28268. var i = function(e) {
  28269. var t = s.valueFromHash("start", "")
  28270. , i = {};
  28271. if ("" !== t) {
  28272. h.debug("Start override found in parameters, trying to parse..."),
  28273. i = function(e) {
  28274. return o.deserialize(e)
  28275. }(t) || {};
  28276. var n = s.valueFromHash("tag", null);
  28277. n && (i.tag = n),
  28278. i.panoId && (i.pano = e.get(i.panoId))
  28279. }
  28280. return i
  28281. }(t);
  28282. if (0 < Object.keys(i).length)
  28283. return i;
  28284. if (e.heroImage)
  28285. i = function(e, t) {
  28286. if (!e.heroImage || !e.heroImage.metadata.camera_position)
  28287. return {};
  28288. var i = {}
  28289. , n = e.heroImage.metadata;
  28290. h.debug("Using start position from thumbnail image"),
  28291. i.position = n.camera_position,
  28292. i.quaternion = n.camera_quaternion;
  28293. try {
  28294. i.mode = l.convertWorkshopModeInt(n.camera_mode),
  28295. i.mode === l.PANORAMA ? i.pano = t.get(n.scan_id) : i.floorVisibility = n.floor_visibility
  28296. } catch (e) {
  28297. h.debug(e.message)
  28298. }
  28299. return i
  28300. }(e, t);
  28301. else if (window.MP_PREFETCHED_MODELDATA.camera_start) {
  28302. var n = window.MP_PREFETCHED_MODELDATA.camera_start;
  28303. try {
  28304. 0 < Object.keys(n).length && !a.isEmptyQuaternion(n.camera.quaternion) && (i.mode = l.convertWorkshopModeInt(n.mode),
  28305. i.position = (new c.Vector3).fromArray(n.camera.position),
  28306. i.quaternion = (new c.Quaternion).fromArray(n.camera.quaternion),
  28307. i.zoom = a.convertWorkshopOrthoZoom(n.camera.zoom),
  28308. n.pano && (i.pano = t.get(n.pano.uuid) || t.findClosest(i.position),
  28309. h.debug("Using camera_start"),
  28310. h.debug("Modeldata pano: ", i.pano.quaternion),
  28311. h.debug("Camera start pano: ", n.pano.quaternion)),
  28312. i.mode !== l.PANORAMA && (i.floorVisibility = e.heroImage.metadata.floor_visibility));
  28313. } catch (e) {
  28314. h.warn(e.message)
  28315. if(i.mode == "panorama" && !i.pano){
  28316. i.pano = t.list[0]
  28317. }
  28318. }
  28319. }
  28320. if (e.outsideAllowed() || i.mode === l.PANORAMA || (i = {}),
  28321. i.mode === l.MESH && i.position && (i.mode = l.PANORAMA,
  28322. i.pano = t.findClosest(i.position) ,
  28323. i.quaternion = i.pano.quaternion),
  28324. 0 === Object.keys(i).length) {
  28325. var r = t.list[0];
  28326. r && (i.mode = l.PANORAMA,
  28327. i.pano = r,
  28328. i.position = r.position,
  28329. i.quaternion = r.quaternion,
  28330. h.info("Starting at 1st pano " + r.id))
  28331. }
  28332. return i.mode = i.mode || l.DOLLHOUSE,
  28333. i
  28334. }
  28335. }
  28336. }
  28337. ).call(this, "/js/util/camera.js")
  28338. }
  28339. , {
  28340. "../controls/serializer": 14,
  28341. "../enum/Viewmode": 51,
  28342. "../util/logger": 189,
  28343. "../util/math": 190,
  28344. "./browser": 182,
  28345. three: 217
  28346. }],
  28347. 184: [function(e, t, i) {
  28348. "use strict";
  28349. function r(e, t, i) {
  28350. var n = t
  28351. , r = i;
  28352. return 2 * Math.atan(Math.tan(e * a.RADIANS_PER_DEGREE / 2) * (n / r)) * a.DEGREES_PER_RADIAN
  28353. }
  28354. function o(e, t, i) {
  28355. var n = t
  28356. , r = i;
  28357. return 2 * Math.atan(Math.tan(e * a.RADIANS_PER_DEGREE / 2) * (r / n)) * a.DEGREES_PER_RADIAN
  28358. }
  28359. var a = e("./MathLight");
  28360. t.exports = {
  28361. clampVFOV: function(e, t, i, n) {
  28362. return t < r(e, i, n) ? o(t, i, n) : e
  28363. },
  28364. getHFOVForCamera: function(e, t, i) {
  28365. return r(e.fov, t, i)
  28366. },
  28367. getHFOVFromVFOV: r,
  28368. getVFOVFromHFOV: o
  28369. }
  28370. }
  28371. , {
  28372. "./MathLight": 176
  28373. }],
  28374. 185: [function(e, t, i) {
  28375. "use strict";
  28376. var a = e("three");
  28377. t.exports = {
  28378. delayOneFrame: function(e) {
  28379. window.setTimeout(e, 1)
  28380. },
  28381. normalizeUrl: function(e) {
  28382. return e.replace("https://", "http://")
  28383. },
  28384. domainFromUrl: function(e) {
  28385. var t = /^([^:]*:\/\/)?(www\.)?([^\/]+)/.exec(e);
  28386. return t ? t[3] : e
  28387. },
  28388. average: function(e, t) {
  28389. if (0 === e.length)
  28390. return null;
  28391. for (var i = 0, n = 0, r = 0; r < e.length; r++) {
  28392. i += t ? e[r][t] : e[r],
  28393. n++
  28394. }
  28395. return i / n
  28396. },
  28397. countUnique: function(e) {
  28398. for (var t = {}, i = 0; i < e.length; i++)
  28399. t[e[i]] = 1 + (t[e[i]] || 0);
  28400. return Object.keys(t).length
  28401. },
  28402. averageVectors: function(e, t) {
  28403. var i = new a.Vector3;
  28404. if (0 === e.length)
  28405. return i;
  28406. for (var n = 0, r = 0; r < e.length; r++) {
  28407. var o = t ? e[r][t] : e[r];
  28408. i.add(o),
  28409. n++
  28410. }
  28411. return i.divideScalar(n)
  28412. },
  28413. equalLists: function(e, t) {
  28414. if (e.length !== t.length)
  28415. return !1;
  28416. for (var i = 0; i < e.length; i++)
  28417. if (e[i] !== t[i])
  28418. return !1;
  28419. return !0
  28420. },
  28421. lowerMedian: function(e, t) {
  28422. return 0 === e.length ? null : (t = t || 2,
  28423. e.sort(function(e, t) {
  28424. return e - t
  28425. }),
  28426. e[Math.floor(e.length / t)])
  28427. },
  28428. stableSort: function(e, n) {
  28429. return e.map(function(e, t) {
  28430. return {
  28431. value: e,
  28432. index: t
  28433. }
  28434. }).sort(function(e, t) {
  28435. var i = n(e.value, t.value);
  28436. return 0 !== i ? i : e.index - t.index
  28437. }).map(function(e) {
  28438. return e.value
  28439. })
  28440. },
  28441. filterAll: function(e, i) {
  28442. return e.filter(function(t) {
  28443. return i.every(function(e) {
  28444. return e(t)
  28445. })
  28446. })
  28447. },
  28448. formatDate: function(e) {
  28449. return [e.getFullYear(), e.getMonth() + 1, e.getDate()].join("-")
  28450. },
  28451. formatDatetime: function(e) {
  28452. return [e.getFullYear(), e.getMonth() + 1, e.getDate(), e.getHours(), e.getMinutes()].join("-")
  28453. },
  28454. randomString: function(e) {
  28455. for (var t = "", i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", n = 0; n < e; n++)
  28456. t += i.charAt(Math.floor(Math.random() * i.length));
  28457. return t
  28458. },
  28459. uint8ToBase64: function(e, t) {
  28460. t && "number" == typeof t || (t = 8192);
  28461. for (var i = [], n = 0; n < e.length; n += t)
  28462. i.push(String.fromCharCode.apply(null, e.subarray(n, n + t)));
  28463. return btoa(i.join(""))
  28464. },
  28465. uuid4: function e(t) {
  28466. return t ? (t ^ 16 * Math.random() >> t / 4).toString(16) : ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, e)
  28467. },
  28468. nth: function(e) {
  28469. return 1 === (e %= 10) ? e + "st" : 2 === e ? e + "nd" : 3 === e ? e + "rd" : e + "th"
  28470. },
  28471. extendObject: function(t, i) {
  28472. return Object.keys(i).forEach(function(e) {
  28473. t[e] = i[e]
  28474. }),
  28475. t
  28476. },
  28477. deepExtend: function e(t) {
  28478. t = t || {};
  28479. for (var i = 1; i < arguments.length; i++) {
  28480. var n = arguments[i];
  28481. if (n)
  28482. for (var r in n)
  28483. n.hasOwnProperty(r) && ("object" == typeof n[r] ? t[r] = e(t[r], n[r]) : t[r] = n[r])
  28484. }
  28485. return t
  28486. },
  28487. inherit: function(e, t) {
  28488. e.prototype = Object.create(t.prototype),
  28489. e.prototype.constructor = e
  28490. },
  28491. extend: function(e, t) {
  28492. for (var i in t.prototype)
  28493. e.prototype[i] = t.prototype[i]
  28494. }
  28495. },
  28496. Math.sign = function(e) {
  28497. return e < 0 ? -1 : 1
  28498. }
  28499. }
  28500. , {
  28501. three: 217
  28502. }],
  28503. 186: [function(e, t, i) {
  28504. "use strict";
  28505. var r = {
  28506. linearTween: function(e, t, i, n) {
  28507. return i * e / n + t
  28508. },
  28509. easeInQuad: function(e, t, i, n) {
  28510. return i * (e /= n) * e + t
  28511. },
  28512. easeOutQuad: function(e, t, i, n) {
  28513. return -i * (e /= n) * (e - 2) + t
  28514. },
  28515. easeInOutQuad: function(e, t, i, n) {
  28516. return (e /= n / 2) < 1 ? i / 2 * e * e + t : -i / 2 * (--e * (e - 2) - 1) + t
  28517. },
  28518. easeInCubic: function(e, t, i, n) {
  28519. return i * (e /= n) * e * e + t
  28520. },
  28521. easeOutCubic: function(e, t, i, n) {
  28522. return e /= n,
  28523. i * (--e * e * e + 1) + t
  28524. },
  28525. easeInOutCubic: function(e, t, i, n) {
  28526. return (e /= n / 2) < 1 ? i / 2 * e * e * e + t : i / 2 * ((e -= 2) * e * e + 2) + t
  28527. },
  28528. easeInQuart: function(e, t, i, n) {
  28529. return i * (e /= n) * e * e * e + t
  28530. },
  28531. easeOutQuart: function(e, t, i, n) {
  28532. return e /= n,
  28533. -i * (--e * e * e * e - 1) + t
  28534. },
  28535. easeInOutQuart: function(e, t, i, n) {
  28536. return (e /= n / 2) < 1 ? i / 2 * e * e * e * e + t : -i / 2 * ((e -= 2) * e * e * e - 2) + t
  28537. },
  28538. easeInQuint: function(e, t, i, n) {
  28539. return i * (e /= n) * e * e * e * e + t
  28540. },
  28541. easeOutQuint: function(e, t, i, n) {
  28542. return e /= n,
  28543. i * (--e * e * e * e * e + 1) + t
  28544. },
  28545. easeInOutQuint: function(e, t, i, n) {
  28546. return (e /= n / 2) < 1 ? i / 2 * e * e * e * e * e + t : i / 2 * ((e -= 2) * e * e * e * e + 2) + t
  28547. },
  28548. easeInSine: function(e, t, i, n) {
  28549. return -i * Math.cos(e / n * (Math.PI / 2)) + i + t
  28550. },
  28551. easeOutSine: function(e, t, i, n) {
  28552. return i * Math.sin(e / n * (Math.PI / 2)) + t
  28553. },
  28554. easeInOutSine: function(e, t, i, n) {
  28555. return -i / 2 * (Math.cos(Math.PI * e / n) - 1) + t
  28556. },
  28557. easeInExpo: function(e, t, i, n) {
  28558. return i * Math.pow(2, 10 * (e / n - 1)) + t
  28559. },
  28560. easeOutExpo: function(e, t, i, n) {
  28561. return i * (1 - Math.pow(2, -10 * e / n)) + t
  28562. },
  28563. easeInOutExpo: function(e, t, i, n) {
  28564. return (e /= n / 2) < 1 ? i / 2 * Math.pow(2, 10 * (e - 1)) + t : (e--,
  28565. i / 2 * (2 - Math.pow(2, -10 * e)) + t)
  28566. },
  28567. easeInCirc: function(e, t, i, n) {
  28568. return e /= n,
  28569. -i * (Math.sqrt(1 - e * e) - 1) + t
  28570. },
  28571. easeOutCirc: function(e, t, i, n) {
  28572. return e /= n,
  28573. e--,
  28574. i * Math.sqrt(1 - e * e) + t
  28575. },
  28576. easeInOutCirc: function(e, t, i, n) {
  28577. return (e /= n / 2) < 1 ? -i / 2 * (Math.sqrt(1 - e * e) - 1) + t : (e -= 2,
  28578. i / 2 * (Math.sqrt(1 - e * e) + 1) + t)
  28579. },
  28580. easeInElastic: function(e, t, i, n) {
  28581. var r = 1.70158
  28582. , o = 0
  28583. , a = i;
  28584. return 0 === e ? t : 1 == (e /= n) ? t + i : (o = o || .3 * n,
  28585. r = a < Math.abs(i) ? (a = i,
  28586. o / 4) : o / (2 * Math.PI) * Math.asin(i / a),
  28587. -a * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o) + t)
  28588. },
  28589. easeOutElastic: function(e, t, i, n) {
  28590. var r = 1.70158
  28591. , o = 0
  28592. , a = i;
  28593. return 0 === e ? t : 1 == (e /= n) ? t + i : (o = o || .3 * n,
  28594. r = a < Math.abs(i) ? (a = i,
  28595. o / 4) : o / (2 * Math.PI) * Math.asin(i / a),
  28596. a * Math.pow(2, -10 * e) * Math.sin((e * n - r) * (2 * Math.PI) / o) + i + t)
  28597. },
  28598. easeInOutElastic: function(e, t, i, n) {
  28599. var r = 1.70158
  28600. , o = 0
  28601. , a = i;
  28602. return 0 === e ? t : 2 == (e /= n / 2) ? t + i : (o = o || n * (.3 * 1.5),
  28603. r = a < Math.abs(i) ? (a = i,
  28604. o / 4) : o / (2 * Math.PI) * Math.asin(i / a),
  28605. 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)
  28606. },
  28607. easeInBack: function(e, t, i, n, r) {
  28608. return void 0 === r && (r = 1.70158),
  28609. i * (e /= n) * e * ((r + 1) * e - r) + t
  28610. },
  28611. easeOutBack: function(e, t, i, n, r) {
  28612. return void 0 === r && (r = 1.70158),
  28613. i * ((e = e / n - 1) * e * ((r + 1) * e + r) + 1) + t
  28614. },
  28615. easeInOutBack: function(e, t, i, n, r) {
  28616. return void 0 === r && (r = 1.70158),
  28617. (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
  28618. },
  28619. easeOutBounce: function(e, t, i, n) {
  28620. 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
  28621. },
  28622. easeInBounce: function(e, t, i, n) {
  28623. return i - r.easeOutBounce(n - e, 0, i, n) + t
  28624. },
  28625. easeInOutBounce: function(e, t, i, n) {
  28626. 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
  28627. }
  28628. };
  28629. t.exports = r
  28630. }
  28631. , {}],
  28632. 187: [function(e, t, i) {
  28633. "use strict";
  28634. function n() {
  28635. this.events = [],
  28636. this.valid = !1
  28637. }
  28638. var r = e("../enum/Joystick");
  28639. n.prototype.push = function(e, t) {
  28640. this.events.push({
  28641. direction: e,
  28642. pano: t
  28643. }),
  28644. this.valid = !0
  28645. }
  28646. ,
  28647. n.prototype.pop = function(e) {
  28648. var t = this.events.pop();
  28649. return this.events.length < 1 && (this.valid = !1),
  28650. t
  28651. }
  28652. ,
  28653. n.prototype.peek = function() {
  28654. return this.events.length ? this.events[this.events.length - 1] : {
  28655. direction: null,
  28656. pano: null
  28657. }
  28658. }
  28659. ,
  28660. n.prototype.invalidate = function() {
  28661. this.events = [],
  28662. this.valid = !1
  28663. }
  28664. ,
  28665. n.prototype.reversePano = function(e) {
  28666. if (!this.valid)
  28667. return null;
  28668. var t = this.peek();
  28669. return r.opposite(e) === t.direction ? (this.pop(),
  28670. t.pano) : null
  28671. }
  28672. ,
  28673. t.exports = n
  28674. }
  28675. , {
  28676. "../enum/Joystick": 29
  28677. }],
  28678. 188: [function(e, t, i) {
  28679. "use strict";
  28680. t.exports = {
  28681. vector: function(t, i) {
  28682. var n = t.clone();
  28683. return i = i.clone(),
  28684. function(e) {
  28685. t.set(n.x * (1 - e) + i.x * e, n.y * (1 - e) + i.y * e, n.z * (1 - e) + i.z * e)
  28686. }
  28687. },
  28688. quaternion: function(t, i) {
  28689. var n = t.clone();
  28690. return function(e) {
  28691. t.copy(n).slerp(i, e)
  28692. }
  28693. },
  28694. property: function(t, i, n, r) {
  28695. var o = t[i];
  28696. return function(e) {
  28697. t[i] = o * (1 - e) + n * e,
  28698. r && r(t[i])
  28699. }
  28700. },
  28701. uniform: function(t, i, n) {
  28702. var r = t.material.uniforms[i].value;
  28703. return function(e) {
  28704. t.material.uniforms[i] && (t.material.uniforms[i].value = r * (1 - e) + n * e)
  28705. }
  28706. },
  28707. matrix4: function(o, a) {
  28708. var s = o.clone();
  28709. return function(e) {
  28710. for (var t = o.elements, i = s.elements, n = a.elements, r = 0; r < 16; r++)
  28711. t[r] = i[r] * (1 - e) + n[r] * e
  28712. }
  28713. },
  28714. allUniforms: function(e, t, i) {
  28715. var n = e.map(function(e) {
  28716. return this.uniform(e, t, i)
  28717. }
  28718. .bind(this));
  28719. return function(t) {
  28720. n.forEach(function(e) {
  28721. e(t)
  28722. })
  28723. }
  28724. }
  28725. }
  28726. }
  28727. , {}],
  28728. 189: [function(e, t, i) {
  28729. "use strict";
  28730. function h(n) {
  28731. var e, t, i, r, o = n.split("/"), a = "[" + o[o.length - 1].replace(".js", "") + "]", s = {};
  28732. if (h.consoleEnabled) {
  28733. var l = function(e) {
  28734. $("#debug-console").append("<p>" + e + "</p>"),
  28735. $("#debug-console")[0].scrollTop = $("#debug-console")[0].scrollHeight
  28736. };
  28737. e = function(e) {
  28738. l(Array.prototype.slice.call(arguments).join(" "))
  28739. }
  28740. ,
  28741. t = function(e) {
  28742. l(Array.prototype.slice.call(arguments).join(" "))
  28743. }
  28744. ,
  28745. i = function(e) {
  28746. l("WARN: " + Array.prototype.slice.call(arguments).join(" "))
  28747. }
  28748. ,
  28749. r = function(e) {
  28750. l("ERROR: " + Array.prototype.slice.call(arguments).join(" "))
  28751. }
  28752. } else
  28753. console.log ? (e = console.log,
  28754. t = console.info ? console.info : console.log,
  28755. i = console.warn ? console.warn : console.log,
  28756. r = console.error ? console.error : console.log) : e = t = i = r = function() {}
  28757. ;
  28758. function c(e) {
  28759. return [a, h.timestamp()].concat(Array.prototype.slice.call(e))
  28760. }
  28761. return {
  28762. debug: function() {
  28763. h.level >= h.levels.debug && e.apply(console, c(arguments))
  28764. },
  28765. info: function() {
  28766. h.level >= h.levels.info && t.apply(console, c(arguments))
  28767. },
  28768. warn: function() {
  28769. (function(e, t) {
  28770. if (u) {
  28771. var i = Array.prototype.slice.call(e).join(" ");
  28772. u.captureMessage(i, {
  28773. level: t,
  28774. path: n,
  28775. timestamp: h.timestamp()
  28776. })
  28777. }
  28778. }
  28779. )(arguments, "warn"),
  28780. h.level >= h.levels.warn && i.apply(console, c(arguments))
  28781. },
  28782. error: function() {
  28783. (function(e, t) {
  28784. if (u) {
  28785. var i = Array.prototype.slice.call(e).join(" ");
  28786. u.captureException(new Error(i), {
  28787. level: t,
  28788. path: n,
  28789. timestamp: h.timestamp()
  28790. })
  28791. }
  28792. }
  28793. )(arguments, "error"),
  28794. h.level >= h.levels.error && r.apply(console, c(arguments))
  28795. },
  28796. v3str: function(e, t) {
  28797. var i = void 0 === t ? 2 : t;
  28798. return "(" + e.x.toPrecision(i) + ", " + e.y.toPrecision(i) + ", " + e.z.toPrecision(i) + ")"
  28799. },
  28800. eulstr: function(e, t) {
  28801. var i = void 0 === t ? 2 : t;
  28802. return "(" + THREE.Math.radToDeg(e.x).toPrecision(i) + ", " + THREE.Math.radToDeg(e.y).toPrecision(i) + ", " + THREE.Math.radToDeg(e.z).toPrecision(i) + ' "' + e.order + '")'
  28803. },
  28804. time: function(e) {
  28805. h.level >= h.levels.debug && (s[e] = Date.now())
  28806. },
  28807. timeEnd: function(e) {
  28808. if (h.level >= h.levels.debug) {
  28809. var t = s[e];
  28810. if (!t)
  28811. return;
  28812. var i = (Date.now() - t) / 1e3;
  28813. this.debug(e, i + "s")
  28814. }
  28815. }
  28816. }
  28817. }
  28818. var u = window.Raven;
  28819. h.timestamp = function() {
  28820. return (Date.now() - window.navigationStart) / 1e3 + "s"
  28821. }
  28822. ,
  28823. h.level = (h.levels = {
  28824. debug: 3,
  28825. info: 2,
  28826. warn: 1,
  28827. error: 0
  28828. }).info,
  28829. t.exports = h
  28830. }
  28831. , {}],
  28832. 190: [function(e, t, i) {
  28833. "use strict";
  28834. var o = e("three")
  28835. , r = e("../enum/GLCubeFaces");
  28836. e("../constants");
  28837. t.exports = {
  28838. convertVisionVector: function(e) {
  28839. return new o.Vector3(e.x,e.z,-e.y)
  28840. },
  28841. convertVisionQuaternion: function(e) {
  28842. 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)))
  28843. },
  28844. convertWorkshopVector: function(e) {
  28845. return new o.Vector3(-e.x,e.y,e.z)
  28846. },
  28847. convertWorkshopQuaternion: function(e) {
  28848. 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))
  28849. },
  28850. convertWorkshopPanoramaQuaternion: function(e) {
  28851. 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)))
  28852. },
  28853. convertWorkshopOrthoZoom: function(e) {
  28854. return -1 === e ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight
  28855. },
  28856. toPrecision: function(e, t) {
  28857. function i(e, t) {
  28858. var i = Math.pow(10, t);
  28859. return Math.round(e * i) / i
  28860. }
  28861. if (e instanceof Array) {
  28862. for (var n = 0; n < e.length; n++)
  28863. e[n] = i(e[n], t);
  28864. return e
  28865. }
  28866. return i(e, t)
  28867. },
  28868. isEmptyQuaternion: function(e) {
  28869. return 0 === Math.abs(e.x) && 0 === Math.abs(e.y) && 0 === Math.abs(e.z) && 0 === Math.abs(e.w)
  28870. },
  28871. projectPositionToCanvas: function(e, t, i) {
  28872. (i = i || new o.Vector3).copy(e);
  28873. var n = .5 * $("#player").width()
  28874. , r = .5 * $("#player").height();
  28875. return i.project(t),
  28876. i.x = i.x * n + n,
  28877. i.y = -i.y * r + r,
  28878. i
  28879. },
  28880. convertScreenPositionToNDC: function(e, t, i) {
  28881. return (i = i || new o.Vector2).x = e / $("#player").width() * 2 - 1,
  28882. i.y = -t / $("#player").height() * 2 + 1,
  28883. i
  28884. },
  28885. constrainedTurn: function(e) {
  28886. var t = e % (2 * Math.PI);
  28887. return t > Math.PI ? t -= 2 * Math.PI : t < -Math.PI ? t += 2 * Math.PI : t
  28888. },
  28889. getFOVDotThreshold: function(e) {
  28890. return Math.cos(o.Math.degToRad(e / 2))
  28891. },
  28892. transform2DForwardVectorByCubeFace: function(e, t, i, n) {
  28893. switch (e) {
  28894. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  28895. i.set(1, t.y, t.x);
  28896. break;
  28897. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  28898. i.set(-1, t.y, -t.x);
  28899. break;
  28900. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  28901. i.set(-t.x, 1, -t.y);
  28902. break;
  28903. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  28904. i.set(-t.x, -1, t.y);
  28905. break;
  28906. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  28907. i.set(-t.x, t.y, 1);
  28908. break;
  28909. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  28910. i.set(t.x, t.y, -1)
  28911. }
  28912. n && i.normalize()
  28913. },
  28914. //add:
  28915. getPos2d : function(point, camera, dom){
  28916. var camera = camera ;
  28917. var dom = dom;
  28918. 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);
  28919. var x,y;
  28920. x = (pos.x + 1) / 2 * dom.clientWidth;
  28921. y = (1 - (pos.y + 1) / 2) * dom.clientHeight;
  28922. var inSight = x <= dom.clientWidth && x >= 0
  28923. && y <= dom.clientHeight && y >= 0
  28924. return {
  28925. pos: new THREE.Vector2(x,y),
  28926. vector: pos,
  28927. trueSide : pos.z<1, //trueSide为false时,即使在屏幕范围内可见,也是反方向的另一个不可以被渲染的点 参见Tag.update
  28928. inSight : inSight //在屏幕范围内可见
  28929. };
  28930. },
  28931. }
  28932. }
  28933. , {
  28934. "../constants": 8,
  28935. "../enum/GLCubeFaces": 25,
  28936. three: 217
  28937. }],
  28938. 191: [function(e, t, i) {
  28939. "use strict";
  28940. function o(e) {
  28941. return r[e]
  28942. }
  28943. var n = e("../enum/GLCubeFaces")
  28944. , a = [0, 1, 2, 3, 4, 5]
  28945. , r = {
  28946. 0: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  28947. 1: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  28948. 2: n.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  28949. 3: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  28950. 4: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  28951. 5: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  28952. };
  28953. t.exports = {
  28954. mapFaceToCubemapFace: o,
  28955. getCubemapUrls: function(i, n, r) {
  28956. return a.map(function(e, t) {
  28957. return i.get("pan/" + r + "/" + n + "_skybox" + o(e) + ".jpg")
  28958. }
  28959. .bind(this))
  28960. }
  28961. }
  28962. }
  28963. , {
  28964. "../enum/GLCubeFaces": 25
  28965. }],
  28966. 192: [function(e, t, i) {
  28967. "use strict";
  28968. t.exports = {
  28969. captureErrors: function(e, t, i) {
  28970. if ("Raven"in window) {
  28971. Raven.config(e, t).install(),
  28972. i && Raven.setTagsContext(i);
  28973. var n = console.warn
  28974. , r = console.error;
  28975. console.warn = function() {
  28976. var e = Array.prototype.slice.call(arguments);
  28977. Raven.captureMessage(e.join(" "), {
  28978. level: "warning"
  28979. }),
  28980. n.apply(console, e)
  28981. }
  28982. ,
  28983. console.error = function() {
  28984. var e = Array.prototype.slice.call(arguments);
  28985. Raven.captureException(new Error(e.join(" ")), {
  28986. level: "error"
  28987. }),
  28988. r.apply(console, e)
  28989. }
  28990. } else
  28991. console.error("Raven not found, not capturing errors.")
  28992. }
  28993. }
  28994. }
  28995. , {}],
  28996. 193: [function(c, h, e) {
  28997. (function(e) {
  28998. "use strict";
  28999. var i, n = c("./browser"), r = c("../constants"), o = c("url"), t = c("./logger"), a = c("three"), s = new t(e), l = {
  29000. getAuthorizationHeader: function() {
  29001. var e = n.valueFromHash("auth");
  29002. if (e)
  29003. return e.replace(",", " ");
  29004. var t = n.valueFromCookie("token");
  29005. return t ? "Token " + t : null
  29006. },
  29007. parseSidUrl: function(e) {
  29008. var t, i;
  29009. if (t = g_Prefix,
  29010. (e = e || "").match(/^https?/)) {
  29011. o.parse(e);
  29012. t = g_Prefix,
  29013. i = e
  29014. } else
  29015. i = (t = g_Prefix) + "data/" + e;
  29016. return {
  29017. urlBase: t,
  29018. urlModel: i,
  29019. urlFiles: i + (i.match(/\/$/) ? "files" : "/files"),
  29020. urlThumb: i + (i.match(/\/$/) ? "thumb" : "/thumb")
  29021. }
  29022. },
  29023. getModelIDFromQueryString: function() {
  29024. return n.valueFromHash("model") || n.valueFromHash("m")
  29025. },
  29026. /* normalizeModeldata: function(e, i) {
  29027. e = JSON.parse(JSON.stringify(e));
  29028. var n = null;
  29029. if (e.images.forEach(function(t) {
  29030. if (t.metadata) {
  29031. if ("string" == typeof t.metadata)
  29032. try {
  29033. t.metadata = JSON.parse(t.metadata)
  29034. } catch (e) {
  29035. s.warn("Unable to parse image metadata"),
  29036. t.metadata = null
  29037. }
  29038. else
  29039. "object" == typeof t.metadata && s.debug("image.metadata already a JSON object");
  29040. t.metadata.camera_position instanceof Array ? (t.metadata.camera_position = (new a.Vector3).fromArray(t.metadata.camera_position),
  29041. 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)),
  29042. t.metadata.camera_position && (t.metadata.camera_position = i.convertWorkshopVector(t.metadata.camera_position)),
  29043. t.metadata.zoom = t.metadata.zoom || 1),
  29044. !n && e.icon && e.icon === t.sid && (n = t.metadata)
  29045. }
  29046. }),
  29047. n && n.camera_quaternion && n.camera_position && n.scan_position && n.scan_quaternion) {
  29048. var t = {};
  29049. t.pano = {
  29050. quaternion: i.convertWorkshopPanoramaQuaternion(n.scan_quaternion),
  29051. position: i.convertWorkshopVector(n.scan_position),
  29052. uuid: n.scan_id
  29053. },
  29054. t.camera = {
  29055. quaternion: n.camera_quaternion,
  29056. position: n.camera_position
  29057. },
  29058. e.startPano = t
  29059. }
  29060. return e
  29061. }, */
  29062. normalizeModeldata: function(e, t) {//xzw 修改导览images数据
  29063. e = JSON.parse(JSON.stringify(e));
  29064. var i = null;
  29065. if (e.images.forEach(function(n) {
  29066. if(!n.metadata) return;
  29067. if ("string" == typeof n.metadata)
  29068. try {
  29069. n.metadata = JSON.parse(n.metadata)
  29070. } catch (e) {
  29071. s.warn("Unable to parse image metadata"),
  29072. n.metadata = null
  29073. }
  29074. else{
  29075. "object" == typeof n.metadata && s.debug("image.metadata already a JSON object");
  29076. }
  29077. if(n.metadata.camera_position instanceof Array){//xzw 改的格式
  29078. n.metadata.camera_position = new a.Vector3().fromArray(n.metadata.camera_position);
  29079. n.metadata.camera_quaternion = new a.Quaternion().fromArray(n.metadata.camera_quaternion);
  29080. }else{
  29081. n.metadata.camera_position = new a.Vector3().copy(n.metadata.camera_position)
  29082. n.metadata.camera_quaternion = new a.Quaternion().copy(n.metadata.camera_quaternion)
  29083. /* n.metadata.camera_quaternion && (n.metadata.camera_quaternion = i.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  29084. n.metadata.camera_position && (n.metadata.camera_position = i.convertWorkshopVector(n.metadata.camera_position)) */
  29085. }
  29086. !i && e.icon && e.icon === n.sid && (i = n.metadata)
  29087. }),
  29088. //icon初始视角的:
  29089. i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
  29090. var n = {};
  29091. n.pano = {
  29092. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  29093. position: t.convertWorkshopVector(i.scan_position),
  29094. uuid: i.scan_id
  29095. },
  29096. n.camera = {
  29097. quaternion: i.camera_quaternion,
  29098. position: i.camera_position
  29099. },
  29100. e.startPano = n
  29101. }
  29102. return e
  29103. },
  29104. visionVersionToInt: (i = new RegExp(["(?:[0-9.]+\\.){1,4}", "([0-9]+)", "[^\\.]*$"].join("")),
  29105. function(e) {
  29106. if (!e)
  29107. throw new Error("Vision version is required");
  29108. var t = i.exec(e);
  29109. if (null === t)
  29110. throw new Error("String is not a vision version: " + e);
  29111. return parseInt(t[1])
  29112. }
  29113. ),
  29114. modelDataPromisesTiles: function(e) {
  29115. var t = e.vision_version || window.MP_PREFETCHED_MODELDATA.vision_version;
  29116. if (t)
  29117. try {
  29118. return l.visionVersionToInt(t) >= l.visionVersionToInt(r.visionTilingStartVersion)
  29119. } catch (e) {
  29120. s.warn("Invalid vision version: " + t)
  29121. }
  29122. return !1
  29123. }
  29124. };
  29125. h.exports = l
  29126. }
  29127. ).call(this, "/js/util/showcase.js")
  29128. }
  29129. , {
  29130. "../constants": 8,
  29131. "./browser": 182,
  29132. "./logger": 189,
  29133. three: 217,
  29134. url: 208
  29135. }],
  29136. 194: [function(e, t, i) {
  29137. "use strict";
  29138. var r = e("../util/ajax")
  29139. , o = e("three")
  29140. , a = e("../settings")
  29141. , s = {};
  29142. t.exports = {
  29143. load: function(e, t, i) {
  29144. var n = s[e];
  29145. return n ? t && setTimeout(function() {
  29146. t(n)
  29147. }, 1) : (n = new o.Texture,
  29148. a.minimalMemoryMode && (n.minFilter = o.LinearFilter,
  29149. n.magFilter = o.LinearFilter,
  29150. n.generateMipmaps = !1),
  29151. n.sourceFile = e,
  29152. s[e] = n,
  29153. r.getImage(e).then(function(e) {
  29154. n.image = e,
  29155. n.needsUpdate = !0,
  29156. t && t(n)
  29157. }).fail(i)),
  29158. n
  29159. },
  29160. loadBase64: function(e, t) {
  29161. t = t || "png";
  29162. var i = new o.Texture;
  29163. return i.image = document.createElement("img"),
  29164. i.image.setAttribute("src", "data:image/" + t + ";base64," + e),
  29165. a.minimalMemoryMode && (i.minFilter = o.LinearFilter,
  29166. i.magFilter = o.LinearFilter,
  29167. i.generateMipmaps = !1),
  29168. i.needsUpdate = !0,
  29169. i
  29170. },
  29171. isLoaded: function(e) {
  29172. return !!s[e]
  29173. }
  29174. }
  29175. window.Texture = t.exports
  29176. }
  29177. , {
  29178. "../settings": 166,
  29179. "../util/ajax": 181,
  29180. three: 217
  29181. }],
  29182. 195: [function(e, t, i) {
  29183. "use strict";
  29184. var l = e("./easing");
  29185. t.exports = {
  29186. globalDone: null,
  29187. funcs: [],
  29188. counter: 0,
  29189. uniqueID: 0,
  29190. start: function(e, t, i, n, r, o, a) {
  29191. return n = n || 0,
  29192. this.funcs.push({
  29193. func: e,
  29194. current: -n * Math.abs(t),
  29195. duration: (1 - Math.max(n, 0)) * Math.abs(t),
  29196. done: i,
  29197. easing: r || l.linearTween,
  29198. cycling: t < 0,
  29199. running: !0,
  29200. debug: n < 0,
  29201. name: o || "T" + this.counter,
  29202. id: void 0 === a ? this.counter : a,
  29203. paused: !1
  29204. }),
  29205. e(0, 16),
  29206. this.counter += 1,
  29207. e
  29208. },
  29209. trigger: function(e) {
  29210. var t = void 0 === e.delayRatio ? 0 : e.delayRatio
  29211. , i = e.func || function() {}
  29212. , n = void 0 === e.duration ? 0 : e.duration;
  29213. void 0 !== e.cycling && e.cycling && (n = -Math.abs(n));
  29214. var r = e.done || null
  29215. , o = e.easing || l.linearTween
  29216. , a = e.name || "R" + this.counter
  29217. , s = void 0 === e.id ? this.counter : e.id;
  29218. return this.start(i, n, r, t, o, a, s)
  29219. },
  29220. setTimeout: function(e, t, i) {
  29221. var n = void 0 === i ? this.counter : i;
  29222. return this.trigger({
  29223. done: e,
  29224. duration: void 0 === t ? 0 : t,
  29225. name: "O" + this.counter,
  29226. id: n
  29227. })
  29228. },
  29229. pause: function() {
  29230. this.paused = !0
  29231. },
  29232. resume: function() {
  29233. this.paused = !1
  29234. },
  29235. update: function(n) {
  29236. this.funcs.forEach(function(e) {
  29237. if (!(e.paused || (e.current += 1e3 * n,
  29238. e.current < 0)))
  29239. if (e.current >= e.duration && !e.cycling) {
  29240. var t = e.easing(1, 0, 1, 1);
  29241. e.func(t, 1e3 * n),
  29242. e.done && e.done(),
  29243. e.running = !1
  29244. } else {
  29245. var i = e.easing(e.current % e.duration / e.duration, 0, 1, 1);
  29246. (e.func(i, 1e3 * n) || !1) && (e.done && e.done(),
  29247. e.running = !1)
  29248. }
  29249. });
  29250. var e = this.funcs.length;
  29251. this.funcs = this.funcs.filter(function(e) {
  29252. return e.running
  29253. });
  29254. var t = this.funcs.length;
  29255. if (0 < e && 0 === t && this.globalDone) {
  29256. var i = this.globalDone;
  29257. this.globalDone = null,
  29258. i()
  29259. }
  29260. },
  29261. adjustSpeed: function(e, t) {
  29262. for (var i = this.getById(e), n = 0; n < i.length; n++) {
  29263. var r = i[n];
  29264. r.duration /= t,
  29265. r.current /= t
  29266. }
  29267. },
  29268. getById: function(t) {
  29269. return this.funcs.filter(function(e) {
  29270. return t === e.id
  29271. })
  29272. },
  29273. get: function(e) {
  29274. for (var t = 0; t < this.funcs.length; t += 1)
  29275. if (this.funcs[t].func === e)
  29276. return this.funcs[t];
  29277. return null
  29278. },
  29279. isRunning: function(e) {
  29280. var t = this.get(e);
  29281. return null !== t && t.running
  29282. },
  29283. countActive: function() {
  29284. for (var e = 0, t = 0; t < this.funcs.length; t += 1)
  29285. e += this.funcs[t].running;
  29286. return e
  29287. },
  29288. listActive: function() {
  29289. for (var e = [], t = 0; t < this.funcs.length; t += 1)
  29290. this.funcs[t].running && e.push(this.funcs[t].name);
  29291. return e
  29292. },
  29293. done: function(e) {
  29294. this.globalDone = e
  29295. },
  29296. cancelById: function(e) {
  29297. var t = void 0 === e ? 0 : e;
  29298. this.funcs = this.funcs.filter(function(e) {
  29299. return e.id !== t
  29300. })
  29301. },
  29302. cancel: function(t) {
  29303. this.funcs = this.funcs.filter(function(e) {
  29304. return e.func !== t
  29305. })
  29306. },
  29307. getUniqueId: function() {
  29308. return this.uniqueID -= 1,
  29309. this.uniqueID
  29310. }
  29311. }
  29312. }
  29313. , {
  29314. "./easing": 186
  29315. }],
  29316. 196: [function(e, t, i) {
  29317. function n(e) {
  29318. if (this.set = {},
  29319. this.infContains = function() {
  29320. return !0
  29321. }
  29322. ,
  29323. "object" == typeof e)
  29324. if (e instanceof Array)
  29325. for (var t = 0; t < e.length; t++)
  29326. this.set[e[t]] = !0;
  29327. else
  29328. this.set = e;
  29329. else if ("function" == typeof e)
  29330. this.infContains = e;
  29331. else if (void 0 !== e)
  29332. throw new Error("set must be either an array or an object.")
  29333. }
  29334. (t.exports = n).prototype.has = n.prototype.contains = function(e) {
  29335. return !!this.set[e]
  29336. }
  29337. ,
  29338. n.prototype.add = function(e) {
  29339. if (1 == arguments.length)
  29340. this.set[e] = !0;
  29341. else
  29342. for (var t = 0; t < arguments.length; t++)
  29343. this.set[arguments[t]] = !0
  29344. }
  29345. ,
  29346. n.prototype.addAll = function(e) {
  29347. if ("object" != typeof e && !(e instanceof Array))
  29348. throw new Error("arr must be an array.");
  29349. for (var t = 0; t < e.length; t++)
  29350. this.add(e[t])
  29351. }
  29352. ,
  29353. n.prototype.delete = n.prototype.remove = function(e) {
  29354. if (1 == arguments.length)
  29355. delete this.set[e];
  29356. else
  29357. for (var t = 0; t < arguments.length; t++)
  29358. delete this.set[arguments[t]]
  29359. }
  29360. ,
  29361. n.prototype.clear = function() {
  29362. this.set = {}
  29363. }
  29364. ,
  29365. n.prototype.size = function() {
  29366. return Object.keys(this.set).length
  29367. }
  29368. ,
  29369. n.prototype.toString = function() {
  29370. return "{" + Object.keys(this.set).toString() + "}"
  29371. }
  29372. ,
  29373. n.prototype["*values"] = n.prototype.toArray = function() {
  29374. return void 0 === this.set ? [] : Object.keys(this.set)
  29375. }
  29376. }
  29377. , {}],
  29378. 197: [function(e, t, i) {}
  29379. , {}],
  29380. 198: [function(N, e, F) {
  29381. (function(e) {
  29382. "use strict";
  29383. function i() {
  29384. return u.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823
  29385. }
  29386. function o(e, t) {
  29387. if (i() < t)
  29388. throw new RangeError("Invalid typed array length");
  29389. return u.TYPED_ARRAY_SUPPORT ? (e = new Uint8Array(t)).__proto__ = u.prototype : (null === e && (e = new u(t)),
  29390. e.length = t),
  29391. e
  29392. }
  29393. function u(e, t, i) {
  29394. if (!(u.TYPED_ARRAY_SUPPORT || this instanceof u))
  29395. return new u(e,t,i);
  29396. if ("number" != typeof e)
  29397. return n(this, e, t, i);
  29398. if ("string" == typeof t)
  29399. throw new Error("If encoding is specified then the first argument must be a string");
  29400. return a(this, e)
  29401. }
  29402. function n(e, t, i, n) {
  29403. if ("number" == typeof t)
  29404. throw new TypeError('"value" argument must not be a number');
  29405. return "undefined" != typeof ArrayBuffer && t instanceof ArrayBuffer ? function(e, t, i, n) {
  29406. if (t.byteLength,
  29407. i < 0 || t.byteLength < i)
  29408. throw new RangeError("'offset' is out of bounds");
  29409. if (t.byteLength < i + (n || 0))
  29410. throw new RangeError("'length' is out of bounds");
  29411. return t = void 0 === i && void 0 === n ? new Uint8Array(t) : void 0 === n ? new Uint8Array(t,i) : new Uint8Array(t,i,n),
  29412. u.TYPED_ARRAY_SUPPORT ? (e = t).__proto__ = u.prototype : e = s(e, t),
  29413. e
  29414. }(e, t, i, n) : "string" == typeof t ? function(e, t, i) {
  29415. if ("string" == typeof i && "" !== i || (i = "utf8"),
  29416. !u.isEncoding(i))
  29417. throw new TypeError('"encoding" must be a valid string encoding');
  29418. var n = 0 | c(t, i)
  29419. , r = (e = o(e, n)).write(t, i);
  29420. return r !== n && (e = e.slice(0, r)),
  29421. e
  29422. }(e, t, i) : function(e, t) {
  29423. if (u.isBuffer(t)) {
  29424. var i = 0 | l(t.length);
  29425. return 0 === (e = o(e, i)).length || t.copy(e, 0, 0, i),
  29426. e
  29427. }
  29428. if (t) {
  29429. if ("undefined" != typeof ArrayBuffer && t.buffer instanceof ArrayBuffer || "length"in t)
  29430. return "number" != typeof t.length || function(e) {
  29431. return e != e
  29432. }(t.length) ? o(e, 0) : s(e, t);
  29433. if ("Buffer" === t.type && L(t.data))
  29434. return s(e, t.data)
  29435. }
  29436. throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")
  29437. }(e, t)
  29438. }
  29439. function r(e) {
  29440. if ("number" != typeof e)
  29441. throw new TypeError('"size" argument must be a number');
  29442. if (e < 0)
  29443. throw new RangeError('"size" argument must not be negative')
  29444. }
  29445. function a(e, t) {
  29446. if (r(t),
  29447. e = o(e, t < 0 ? 0 : 0 | l(t)),
  29448. !u.TYPED_ARRAY_SUPPORT)
  29449. for (var i = 0; i < t; ++i)
  29450. e[i] = 0;
  29451. return e
  29452. }
  29453. function s(e, t) {
  29454. var i = t.length < 0 ? 0 : 0 | l(t.length);
  29455. e = o(e, i);
  29456. for (var n = 0; n < i; n += 1)
  29457. e[n] = 255 & t[n];
  29458. return e
  29459. }
  29460. function l(e) {
  29461. if (e >= i())
  29462. throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + i().toString(16) + " bytes");
  29463. return 0 | e
  29464. }
  29465. function c(e, t) {
  29466. if (u.isBuffer(e))
  29467. return e.length;
  29468. if ("undefined" != typeof ArrayBuffer && "function" == typeof ArrayBuffer.isView && (ArrayBuffer.isView(e) || e instanceof ArrayBuffer))
  29469. return e.byteLength;
  29470. "string" != typeof e && (e = "" + e);
  29471. var i = e.length;
  29472. if (0 === i)
  29473. return 0;
  29474. for (var n = !1; ; )
  29475. switch (t) {
  29476. case "ascii":
  29477. case "latin1":
  29478. case "binary":
  29479. return i;
  29480. case "utf8":
  29481. case "utf-8":
  29482. case void 0:
  29483. return S(e).length;
  29484. case "ucs2":
  29485. case "ucs-2":
  29486. case "utf16le":
  29487. case "utf-16le":
  29488. return 2 * i;
  29489. case "hex":
  29490. return i >>> 1;
  29491. case "base64":
  29492. return M(e).length;
  29493. default:
  29494. if (n)
  29495. return S(e).length;
  29496. t = ("" + t).toLowerCase(),
  29497. n = !0
  29498. }
  29499. }
  29500. function h(e, t, i) {
  29501. var n = e[t];
  29502. e[t] = e[i],
  29503. e[i] = n
  29504. }
  29505. function d(e, t, i, n, r) {
  29506. if (0 === e.length)
  29507. return -1;
  29508. if ("string" == typeof i ? (n = i,
  29509. i = 0) : 2147483647 < i ? i = 2147483647 : i < -2147483648 && (i = -2147483648),
  29510. i = +i,
  29511. isNaN(i) && (i = r ? 0 : e.length - 1),
  29512. i < 0 && (i = e.length + i),
  29513. i >= e.length) {
  29514. if (r)
  29515. return -1;
  29516. i = e.length - 1
  29517. } else if (i < 0) {
  29518. if (!r)
  29519. return -1;
  29520. i = 0
  29521. }
  29522. if ("string" == typeof t && (t = u.from(t, n)),
  29523. u.isBuffer(t))
  29524. return 0 === t.length ? -1 : p(e, t, i, n, r);
  29525. if ("number" == typeof t)
  29526. return t &= 255,
  29527. 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);
  29528. throw new TypeError("val must be string, number or Buffer")
  29529. }
  29530. function p(e, t, i, n, r) {
  29531. function o(e, t) {
  29532. return 1 === s ? e[t] : e.readUInt16BE(t * s)
  29533. }
  29534. var a, s = 1, l = e.length, c = t.length;
  29535. if (void 0 !== n && ("ucs2" === (n = String(n).toLowerCase()) || "ucs-2" === n || "utf16le" === n || "utf-16le" === n)) {
  29536. if (e.length < 2 || t.length < 2)
  29537. return -1;
  29538. l /= s = 2,
  29539. c /= 2,
  29540. i /= 2
  29541. }
  29542. if (r) {
  29543. var h = -1;
  29544. for (a = i; a < l; a++)
  29545. if (o(e, a) === o(t, -1 === h ? 0 : a - h)) {
  29546. if (-1 === h && (h = a),
  29547. a - h + 1 === c)
  29548. return h * s
  29549. } else
  29550. -1 !== h && (a -= a - h),
  29551. h = -1
  29552. } else
  29553. for (l < i + c && (i = l - c),
  29554. a = i; 0 <= a; a--) {
  29555. for (var u = !0, d = 0; d < c; d++)
  29556. if (o(e, a + d) !== o(t, d)) {
  29557. u = !1;
  29558. break
  29559. }
  29560. if (u)
  29561. return a
  29562. }
  29563. return -1
  29564. }
  29565. function g(e, t, i, n) {
  29566. i = Number(i) || 0;
  29567. var r = e.length - i;
  29568. n ? r < (n = Number(n)) && (n = r) : n = r;
  29569. var o = t.length;
  29570. if (o % 2 != 0)
  29571. throw new TypeError("Invalid hex string");
  29572. o / 2 < n && (n = o / 2);
  29573. for (var a = 0; a < n; ++a) {
  29574. var s = parseInt(t.substr(2 * a, 2), 16);
  29575. if (isNaN(s))
  29576. return a;
  29577. e[i + a] = s
  29578. }
  29579. return a
  29580. }
  29581. function m(e, t, i, n) {
  29582. return R(function(e) {
  29583. for (var t = [], i = 0; i < e.length; ++i)
  29584. t.push(255 & e.charCodeAt(i));
  29585. return t
  29586. }(t), e, i, n)
  29587. }
  29588. function f(e, t, i) {
  29589. i = Math.min(e.length, i);
  29590. for (var n = [], r = t; r < i; ) {
  29591. var o, a, s, l, c = e[r], h = null, u = 239 < c ? 4 : 223 < c ? 3 : 191 < c ? 2 : 1;
  29592. if (r + u <= i)
  29593. switch (u) {
  29594. case 1:
  29595. c < 128 && (h = c);
  29596. break;
  29597. case 2:
  29598. 128 == (192 & (o = e[r + 1])) && (127 < (l = (31 & c) << 6 | 63 & o) && (h = l));
  29599. break;
  29600. case 3:
  29601. o = e[r + 1],
  29602. a = e[r + 2],
  29603. 128 == (192 & o) && 128 == (192 & a) && (2047 < (l = (15 & c) << 12 | (63 & o) << 6 | 63 & a) && (l < 55296 || 57343 < l) && (h = l));
  29604. break;
  29605. case 4:
  29606. o = e[r + 1],
  29607. a = e[r + 2],
  29608. s = e[r + 3],
  29609. 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))
  29610. }
  29611. null === h ? (h = 65533,
  29612. u = 1) : 65535 < h && (h -= 65536,
  29613. n.push(h >>> 10 & 1023 | 55296),
  29614. h = 56320 | 1023 & h),
  29615. n.push(h),
  29616. r += u
  29617. }
  29618. return function(e) {
  29619. var t = e.length;
  29620. if (t <= D)
  29621. return String.fromCharCode.apply(String, e);
  29622. for (var i = "", n = 0; n < t; )
  29623. i += String.fromCharCode.apply(String, e.slice(n, n += D));
  29624. return i
  29625. }(n)
  29626. }
  29627. function v(e, t, i) {
  29628. var n = "";
  29629. i = Math.min(e.length, i);
  29630. for (var r = t; r < i; ++r)
  29631. n += String.fromCharCode(127 & e[r]);
  29632. return n
  29633. }
  29634. function y(e, t, i) {
  29635. var n = "";
  29636. i = Math.min(e.length, i);
  29637. for (var r = t; r < i; ++r)
  29638. n += String.fromCharCode(e[r]);
  29639. return n
  29640. }
  29641. function A(e, t, i) {
  29642. var n, r = e.length;
  29643. (!t || t < 0) && (t = 0),
  29644. (!i || i < 0 || r < i) && (i = r);
  29645. for (var o = "", a = t; a < i; ++a)
  29646. o += (n = e[a]) < 16 ? "0" + n.toString(16) : n.toString(16);
  29647. return o
  29648. }
  29649. function C(e, t, i) {
  29650. for (var n = e.slice(t, i), r = "", o = 0; o < n.length; o += 2)
  29651. r += String.fromCharCode(n[o] + 256 * n[o + 1]);
  29652. return r
  29653. }
  29654. function I(e, t, i) {
  29655. if (e % 1 != 0 || e < 0)
  29656. throw new RangeError("offset is not uint");
  29657. if (i < e + t)
  29658. throw new RangeError("Trying to access beyond buffer length")
  29659. }
  29660. function E(e, t, i, n, r, o) {
  29661. if (!u.isBuffer(e))
  29662. throw new TypeError('"buffer" argument must be a Buffer instance');
  29663. if (r < t || t < o)
  29664. throw new RangeError('"value" argument is out of bounds');
  29665. if (i + n > e.length)
  29666. throw new RangeError("Index out of range")
  29667. }
  29668. function _(e, t, i, n) {
  29669. t < 0 && (t = 65535 + t + 1);
  29670. for (var r = 0, o = Math.min(e.length - i, 2); r < o; ++r)
  29671. e[i + r] = (t & 255 << 8 * (n ? r : 1 - r)) >>> 8 * (n ? r : 1 - r)
  29672. }
  29673. function b(e, t, i, n) {
  29674. t < 0 && (t = 4294967295 + t + 1);
  29675. for (var r = 0, o = Math.min(e.length - i, 4); r < o; ++r)
  29676. e[i + r] = t >>> 8 * (n ? r : 3 - r) & 255
  29677. }
  29678. function w(e, t, i, n) {
  29679. if (i + n > e.length)
  29680. throw new RangeError("Index out of range");
  29681. if (i < 0)
  29682. throw new RangeError("Index out of range")
  29683. }
  29684. function T(e, t, i, n, r) {
  29685. return r || w(e, 0, i, 4),
  29686. O.write(e, t, i, n, 23, 4),
  29687. i + 4
  29688. }
  29689. function x(e, t, i, n, r) {
  29690. return r || w(e, 0, i, 8),
  29691. O.write(e, t, i, n, 52, 8),
  29692. i + 8
  29693. }
  29694. function S(e, t) {
  29695. t = t || 1 / 0;
  29696. for (var i, n = e.length, r = null, o = [], a = 0; a < n; ++a) {
  29697. if (55295 < (i = e.charCodeAt(a)) && i < 57344) {
  29698. if (!r) {
  29699. if (56319 < i) {
  29700. -1 < (t -= 3) && o.push(239, 191, 189);
  29701. continue
  29702. }
  29703. if (a + 1 === n) {
  29704. -1 < (t -= 3) && o.push(239, 191, 189);
  29705. continue
  29706. }
  29707. r = i;
  29708. continue
  29709. }
  29710. if (i < 56320) {
  29711. -1 < (t -= 3) && o.push(239, 191, 189),
  29712. r = i;
  29713. continue
  29714. }
  29715. i = 65536 + (r - 55296 << 10 | i - 56320)
  29716. } else
  29717. r && -1 < (t -= 3) && o.push(239, 191, 189);
  29718. if (r = null,
  29719. i < 128) {
  29720. if ((t -= 1) < 0)
  29721. break;
  29722. o.push(i)
  29723. } else if (i < 2048) {
  29724. if ((t -= 2) < 0)
  29725. break;
  29726. o.push(i >> 6 | 192, 63 & i | 128)
  29727. } else if (i < 65536) {
  29728. if ((t -= 3) < 0)
  29729. break;
  29730. o.push(i >> 12 | 224, i >> 6 & 63 | 128, 63 & i | 128)
  29731. } else {
  29732. if (!(i < 1114112))
  29733. throw new Error("Invalid code point");
  29734. if ((t -= 4) < 0)
  29735. break;
  29736. o.push(i >> 18 | 240, i >> 12 & 63 | 128, i >> 6 & 63 | 128, 63 & i | 128)
  29737. }
  29738. }
  29739. return o
  29740. }
  29741. function M(e) {
  29742. return P.toByteArray(function(e) {
  29743. if ((e = function(e) {
  29744. return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, "")
  29745. }(e).replace(t, "")).length < 2)
  29746. return "";
  29747. for (; e.length % 4 != 0; )
  29748. e += "=";
  29749. return e
  29750. }(e))
  29751. }
  29752. function R(e, t, i, n) {
  29753. for (var r = 0; r < n && !(r + i >= t.length || r >= e.length); ++r)
  29754. t[r + i] = e[r];
  29755. return r
  29756. }
  29757. var P = N("base64-js")
  29758. , O = N("ieee754")
  29759. , L = N("isarray");
  29760. F.Buffer = u,
  29761. F.SlowBuffer = function(e) {
  29762. return +e != e && (e = 0),
  29763. u.alloc(+e)
  29764. }
  29765. ,
  29766. F.INSPECT_MAX_BYTES = 50,
  29767. u.TYPED_ARRAY_SUPPORT = void 0 !== e.TYPED_ARRAY_SUPPORT ? e.TYPED_ARRAY_SUPPORT : function() {
  29768. try {
  29769. var e = new Uint8Array(1);
  29770. return e.__proto__ = {
  29771. __proto__: Uint8Array.prototype,
  29772. foo: function() {
  29773. return 42
  29774. }
  29775. },
  29776. 42 === e.foo() && "function" == typeof e.subarray && 0 === e.subarray(1, 1).byteLength
  29777. } catch (e) {
  29778. return !1
  29779. }
  29780. }(),
  29781. F.kMaxLength = i(),
  29782. u.poolSize = 8192,
  29783. u._augment = function(e) {
  29784. return e.__proto__ = u.prototype,
  29785. e
  29786. }
  29787. ,
  29788. u.from = function(e, t, i) {
  29789. return n(null, e, t, i)
  29790. }
  29791. ,
  29792. u.TYPED_ARRAY_SUPPORT && (u.prototype.__proto__ = Uint8Array.prototype,
  29793. u.__proto__ = Uint8Array,
  29794. "undefined" != typeof Symbol && Symbol.species && u[Symbol.species] === u && Object.defineProperty(u, Symbol.species, {
  29795. value: null,
  29796. configurable: !0
  29797. })),
  29798. u.alloc = function(e, t, i) {
  29799. return function(e, t, i, n) {
  29800. return r(t),
  29801. 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)
  29802. }(null, e, t, i)
  29803. }
  29804. ,
  29805. u.allocUnsafe = function(e) {
  29806. return a(null, e)
  29807. }
  29808. ,
  29809. u.allocUnsafeSlow = function(e) {
  29810. return a(null, e)
  29811. }
  29812. ,
  29813. u.isBuffer = function(e) {
  29814. return !(null == e || !e._isBuffer)
  29815. }
  29816. ,
  29817. u.compare = function(e, t) {
  29818. if (!u.isBuffer(e) || !u.isBuffer(t))
  29819. throw new TypeError("Arguments must be Buffers");
  29820. if (e === t)
  29821. return 0;
  29822. for (var i = e.length, n = t.length, r = 0, o = Math.min(i, n); r < o; ++r)
  29823. if (e[r] !== t[r]) {
  29824. i = e[r],
  29825. n = t[r];
  29826. break
  29827. }
  29828. return i < n ? -1 : n < i ? 1 : 0
  29829. }
  29830. ,
  29831. u.isEncoding = function(e) {
  29832. switch (String(e).toLowerCase()) {
  29833. case "hex":
  29834. case "utf8":
  29835. case "utf-8":
  29836. case "ascii":
  29837. case "latin1":
  29838. case "binary":
  29839. case "base64":
  29840. case "ucs2":
  29841. case "ucs-2":
  29842. case "utf16le":
  29843. case "utf-16le":
  29844. return !0;
  29845. default:
  29846. return !1
  29847. }
  29848. }
  29849. ,
  29850. u.concat = function(e, t) {
  29851. if (!L(e))
  29852. throw new TypeError('"list" argument must be an Array of Buffers');
  29853. if (0 === e.length)
  29854. return u.alloc(0);
  29855. var i;
  29856. if (void 0 === t)
  29857. for (i = t = 0; i < e.length; ++i)
  29858. t += e[i].length;
  29859. var n = u.allocUnsafe(t)
  29860. , r = 0;
  29861. for (i = 0; i < e.length; ++i) {
  29862. var o = e[i];
  29863. if (!u.isBuffer(o))
  29864. throw new TypeError('"list" argument must be an Array of Buffers');
  29865. o.copy(n, r),
  29866. r += o.length
  29867. }
  29868. return n
  29869. }
  29870. ,
  29871. u.byteLength = c,
  29872. u.prototype._isBuffer = !0,
  29873. u.prototype.swap16 = function() {
  29874. var e = this.length;
  29875. if (e % 2 != 0)
  29876. throw new RangeError("Buffer size must be a multiple of 16-bits");
  29877. for (var t = 0; t < e; t += 2)
  29878. h(this, t, t + 1);
  29879. return this
  29880. }
  29881. ,
  29882. u.prototype.swap32 = function() {
  29883. var e = this.length;
  29884. if (e % 4 != 0)
  29885. throw new RangeError("Buffer size must be a multiple of 32-bits");
  29886. for (var t = 0; t < e; t += 4)
  29887. h(this, t, t + 3),
  29888. h(this, t + 1, t + 2);
  29889. return this
  29890. }
  29891. ,
  29892. u.prototype.swap64 = function() {
  29893. var e = this.length;
  29894. if (e % 8 != 0)
  29895. throw new RangeError("Buffer size must be a multiple of 64-bits");
  29896. for (var t = 0; t < e; t += 8)
  29897. h(this, t, t + 7),
  29898. h(this, t + 1, t + 6),
  29899. h(this, t + 2, t + 5),
  29900. h(this, t + 3, t + 4);
  29901. return this
  29902. }
  29903. ,
  29904. u.prototype.toString = function() {
  29905. var e = 0 | this.length;
  29906. return 0 == e ? "" : 0 === arguments.length ? f(this, 0, e) : function(e, t, i) {
  29907. var n, r, o, a = !1;
  29908. if ((void 0 === t || t < 0) && (t = 0),
  29909. t > this.length)
  29910. return "";
  29911. if ((void 0 === i || i > this.length) && (i = this.length),
  29912. i <= 0)
  29913. return "";
  29914. if ((i >>>= 0) <= (t >>>= 0))
  29915. return "";
  29916. for (e = e || "utf8"; ; )
  29917. switch (e) {
  29918. case "hex":
  29919. return A(this, t, i);
  29920. case "utf8":
  29921. case "utf-8":
  29922. return f(this, t, i);
  29923. case "ascii":
  29924. return v(this, t, i);
  29925. case "latin1":
  29926. case "binary":
  29927. return y(this, t, i);
  29928. case "base64":
  29929. return n = this,
  29930. o = i,
  29931. 0 === (r = t) && o === n.length ? P.fromByteArray(n) : P.fromByteArray(n.slice(r, o));
  29932. case "ucs2":
  29933. case "ucs-2":
  29934. case "utf16le":
  29935. case "utf-16le":
  29936. return C(this, t, i);
  29937. default:
  29938. if (a)
  29939. throw new TypeError("Unknown encoding: " + e);
  29940. e = (e + "").toLowerCase(),
  29941. a = !0
  29942. }
  29943. }
  29944. .apply(this, arguments)
  29945. }
  29946. ,
  29947. u.prototype.equals = function(e) {
  29948. if (!u.isBuffer(e))
  29949. throw new TypeError("Argument must be a Buffer");
  29950. return this === e || 0 === u.compare(this, e)
  29951. }
  29952. ,
  29953. u.prototype.inspect = function() {
  29954. var e = ""
  29955. , t = F.INSPECT_MAX_BYTES;
  29956. return 0 < this.length && (e = this.toString("hex", 0, t).match(/.{2}/g).join(" "),
  29957. this.length > t && (e += " ... ")),
  29958. "<Buffer " + e + ">"
  29959. }
  29960. ,
  29961. u.prototype.compare = function(e, t, i, n, r) {
  29962. if (!u.isBuffer(e))
  29963. throw new TypeError("Argument must be a Buffer");
  29964. if (void 0 === t && (t = 0),
  29965. void 0 === i && (i = e ? e.length : 0),
  29966. void 0 === n && (n = 0),
  29967. void 0 === r && (r = this.length),
  29968. t < 0 || i > e.length || n < 0 || r > this.length)
  29969. throw new RangeError("out of range index");
  29970. if (r <= n && i <= t)
  29971. return 0;
  29972. if (r <= n)
  29973. return -1;
  29974. if (i <= t)
  29975. return 1;
  29976. if (this === e)
  29977. return 0;
  29978. 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)
  29979. if (l[h] !== c[h]) {
  29980. o = l[h],
  29981. a = c[h];
  29982. break
  29983. }
  29984. return o < a ? -1 : a < o ? 1 : 0
  29985. }
  29986. ,
  29987. u.prototype.includes = function(e, t, i) {
  29988. return -1 !== this.indexOf(e, t, i)
  29989. }
  29990. ,
  29991. u.prototype.indexOf = function(e, t, i) {
  29992. return d(this, e, t, i, !0)
  29993. }
  29994. ,
  29995. u.prototype.lastIndexOf = function(e, t, i) {
  29996. return d(this, e, t, i, !1)
  29997. }
  29998. ,
  29999. u.prototype.write = function(e, t, i, n) {
  30000. if (void 0 === t)
  30001. n = "utf8",
  30002. i = this.length,
  30003. t = 0;
  30004. else if (void 0 === i && "string" == typeof t)
  30005. n = t,
  30006. i = this.length,
  30007. t = 0;
  30008. else {
  30009. if (!isFinite(t))
  30010. throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
  30011. t |= 0,
  30012. isFinite(i) ? (i |= 0,
  30013. void 0 === n && (n = "utf8")) : (n = i,
  30014. i = void 0)
  30015. }
  30016. var r, o, a, s, l, c, h, u, d, p = this.length - t;
  30017. if ((void 0 === i || p < i) && (i = p),
  30018. 0 < e.length && (i < 0 || t < 0) || t > this.length)
  30019. throw new RangeError("Attempt to write outside buffer bounds");
  30020. n = n || "utf8";
  30021. for (var f = !1; ; )
  30022. switch (n) {
  30023. case "hex":
  30024. return g(this, e, t, i);
  30025. case "utf8":
  30026. case "utf-8":
  30027. return u = t,
  30028. d = i,
  30029. R(S(e, (h = this).length - u), h, u, d);
  30030. case "ascii":
  30031. return m(this, e, t, i);
  30032. case "latin1":
  30033. case "binary":
  30034. return m(this, e, t, i);
  30035. case "base64":
  30036. return s = this,
  30037. l = t,
  30038. c = i,
  30039. R(M(e), s, l, c);
  30040. case "ucs2":
  30041. case "ucs-2":
  30042. case "utf16le":
  30043. case "utf-16le":
  30044. return o = t,
  30045. a = i,
  30046. R(function(e, t) {
  30047. for (var i, n, r, o = [], a = 0; a < e.length && !((t -= 2) < 0); ++a)
  30048. i = e.charCodeAt(a),
  30049. n = i >> 8,
  30050. r = i % 256,
  30051. o.push(r),
  30052. o.push(n);
  30053. return o
  30054. }(e, (r = this).length - o), r, o, a);
  30055. default:
  30056. if (f)
  30057. throw new TypeError("Unknown encoding: " + n);
  30058. n = ("" + n).toLowerCase(),
  30059. f = !0
  30060. }
  30061. }
  30062. ,
  30063. u.prototype.toJSON = function() {
  30064. return {
  30065. type: "Buffer",
  30066. data: Array.prototype.slice.call(this._arr || this, 0)
  30067. }
  30068. }
  30069. ;
  30070. var D = 4096;
  30071. u.prototype.slice = function(e, t) {
  30072. var i, n = this.length;
  30073. if ((e = ~~e) < 0 ? (e += n) < 0 && (e = 0) : n < e && (e = n),
  30074. (t = void 0 === t ? n : ~~t) < 0 ? (t += n) < 0 && (t = 0) : n < t && (t = n),
  30075. t < e && (t = e),
  30076. u.TYPED_ARRAY_SUPPORT)
  30077. (i = this.subarray(e, t)).__proto__ = u.prototype;
  30078. else {
  30079. var r = t - e;
  30080. i = new u(r,void 0);
  30081. for (var o = 0; o < r; ++o)
  30082. i[o] = this[o + e]
  30083. }
  30084. return i
  30085. }
  30086. ,
  30087. u.prototype.readUIntLE = function(e, t, i) {
  30088. e |= 0,
  30089. t |= 0,
  30090. i || I(e, t, this.length);
  30091. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  30092. n += this[e + o] * r;
  30093. return n
  30094. }
  30095. ,
  30096. u.prototype.readUIntBE = function(e, t, i) {
  30097. e |= 0,
  30098. t |= 0,
  30099. i || I(e, t, this.length);
  30100. for (var n = this[e + --t], r = 1; 0 < t && (r *= 256); )
  30101. n += this[e + --t] * r;
  30102. return n
  30103. }
  30104. ,
  30105. u.prototype.readUInt8 = function(e, t) {
  30106. return t || I(e, 1, this.length),
  30107. this[e]
  30108. }
  30109. ,
  30110. u.prototype.readUInt16LE = function(e, t) {
  30111. return t || I(e, 2, this.length),
  30112. this[e] | this[e + 1] << 8
  30113. }
  30114. ,
  30115. u.prototype.readUInt16BE = function(e, t) {
  30116. return t || I(e, 2, this.length),
  30117. this[e] << 8 | this[e + 1]
  30118. }
  30119. ,
  30120. u.prototype.readUInt32LE = function(e, t) {
  30121. return t || I(e, 4, this.length),
  30122. (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + 16777216 * this[e + 3]
  30123. }
  30124. ,
  30125. u.prototype.readUInt32BE = function(e, t) {
  30126. return t || I(e, 4, this.length),
  30127. 16777216 * this[e] + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3])
  30128. }
  30129. ,
  30130. u.prototype.readIntLE = function(e, t, i) {
  30131. e |= 0,
  30132. t |= 0,
  30133. i || I(e, t, this.length);
  30134. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  30135. n += this[e + o] * r;
  30136. return (r *= 128) <= n && (n -= Math.pow(2, 8 * t)),
  30137. n
  30138. }
  30139. ,
  30140. u.prototype.readIntBE = function(e, t, i) {
  30141. e |= 0,
  30142. t |= 0,
  30143. i || I(e, t, this.length);
  30144. for (var n = t, r = 1, o = this[e + --n]; 0 < n && (r *= 256); )
  30145. o += this[e + --n] * r;
  30146. return (r *= 128) <= o && (o -= Math.pow(2, 8 * t)),
  30147. o
  30148. }
  30149. ,
  30150. u.prototype.readInt8 = function(e, t) {
  30151. return t || I(e, 1, this.length),
  30152. 128 & this[e] ? -1 * (255 - this[e] + 1) : this[e]
  30153. }
  30154. ,
  30155. u.prototype.readInt16LE = function(e, t) {
  30156. t || I(e, 2, this.length);
  30157. var i = this[e] | this[e + 1] << 8;
  30158. return 32768 & i ? 4294901760 | i : i
  30159. }
  30160. ,
  30161. u.prototype.readInt16BE = function(e, t) {
  30162. t || I(e, 2, this.length);
  30163. var i = this[e + 1] | this[e] << 8;
  30164. return 32768 & i ? 4294901760 | i : i
  30165. }
  30166. ,
  30167. u.prototype.readInt32LE = function(e, t) {
  30168. return t || I(e, 4, this.length),
  30169. this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24
  30170. }
  30171. ,
  30172. u.prototype.readInt32BE = function(e, t) {
  30173. return t || I(e, 4, this.length),
  30174. this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]
  30175. }
  30176. ,
  30177. u.prototype.readFloatLE = function(e, t) {
  30178. return t || I(e, 4, this.length),
  30179. O.read(this, e, !0, 23, 4)
  30180. }
  30181. ,
  30182. u.prototype.readFloatBE = function(e, t) {
  30183. return t || I(e, 4, this.length),
  30184. O.read(this, e, !1, 23, 4)
  30185. }
  30186. ,
  30187. u.prototype.readDoubleLE = function(e, t) {
  30188. return t || I(e, 8, this.length),
  30189. O.read(this, e, !0, 52, 8)
  30190. }
  30191. ,
  30192. u.prototype.readDoubleBE = function(e, t) {
  30193. return t || I(e, 8, this.length),
  30194. O.read(this, e, !1, 52, 8)
  30195. }
  30196. ,
  30197. u.prototype.writeUIntLE = function(e, t, i, n) {
  30198. e = +e,
  30199. t |= 0,
  30200. i |= 0,
  30201. n || E(this, e, t, i, Math.pow(2, 8 * i) - 1, 0);
  30202. var r = 1
  30203. , o = 0;
  30204. for (this[t] = 255 & e; ++o < i && (r *= 256); )
  30205. this[t + o] = e / r & 255;
  30206. return t + i
  30207. }
  30208. ,
  30209. u.prototype.writeUIntBE = function(e, t, i, n) {
  30210. e = +e,
  30211. t |= 0,
  30212. i |= 0,
  30213. n || E(this, e, t, i, Math.pow(2, 8 * i) - 1, 0);
  30214. var r = i - 1
  30215. , o = 1;
  30216. for (this[t + r] = 255 & e; 0 <= --r && (o *= 256); )
  30217. this[t + r] = e / o & 255;
  30218. return t + i
  30219. }
  30220. ,
  30221. u.prototype.writeUInt8 = function(e, t, i) {
  30222. return e = +e,
  30223. t |= 0,
  30224. i || E(this, e, t, 1, 255, 0),
  30225. u.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  30226. this[t] = 255 & e,
  30227. t + 1
  30228. }
  30229. ,
  30230. u.prototype.writeUInt16LE = function(e, t, i) {
  30231. return e = +e,
  30232. t |= 0,
  30233. i || E(this, e, t, 2, 65535, 0),
  30234. u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30235. this[t + 1] = e >>> 8) : _(this, e, t, !0),
  30236. t + 2
  30237. }
  30238. ,
  30239. u.prototype.writeUInt16BE = function(e, t, i) {
  30240. return e = +e,
  30241. t |= 0,
  30242. i || E(this, e, t, 2, 65535, 0),
  30243. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  30244. this[t + 1] = 255 & e) : _(this, e, t, !1),
  30245. t + 2
  30246. }
  30247. ,
  30248. u.prototype.writeUInt32LE = function(e, t, i) {
  30249. return e = +e,
  30250. t |= 0,
  30251. i || E(this, e, t, 4, 4294967295, 0),
  30252. u.TYPED_ARRAY_SUPPORT ? (this[t + 3] = e >>> 24,
  30253. this[t + 2] = e >>> 16,
  30254. this[t + 1] = e >>> 8,
  30255. this[t] = 255 & e) : b(this, e, t, !0),
  30256. t + 4
  30257. }
  30258. ,
  30259. u.prototype.writeUInt32BE = function(e, t, i) {
  30260. return e = +e,
  30261. t |= 0,
  30262. i || E(this, e, t, 4, 4294967295, 0),
  30263. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  30264. this[t + 1] = e >>> 16,
  30265. this[t + 2] = e >>> 8,
  30266. this[t + 3] = 255 & e) : b(this, e, t, !1),
  30267. t + 4
  30268. }
  30269. ,
  30270. u.prototype.writeIntLE = function(e, t, i, n) {
  30271. if (e = +e,
  30272. t |= 0,
  30273. !n) {
  30274. var r = Math.pow(2, 8 * i - 1);
  30275. E(this, e, t, i, r - 1, -r)
  30276. }
  30277. var o = 0
  30278. , a = 1
  30279. , s = 0;
  30280. for (this[t] = 255 & e; ++o < i && (a *= 256); )
  30281. e < 0 && 0 === s && 0 !== this[t + o - 1] && (s = 1),
  30282. this[t + o] = (e / a >> 0) - s & 255;
  30283. return t + i
  30284. }
  30285. ,
  30286. u.prototype.writeIntBE = function(e, t, i, n) {
  30287. if (e = +e,
  30288. t |= 0,
  30289. !n) {
  30290. var r = Math.pow(2, 8 * i - 1);
  30291. E(this, e, t, i, r - 1, -r)
  30292. }
  30293. var o = i - 1
  30294. , a = 1
  30295. , s = 0;
  30296. for (this[t + o] = 255 & e; 0 <= --o && (a *= 256); )
  30297. e < 0 && 0 === s && 0 !== this[t + o + 1] && (s = 1),
  30298. this[t + o] = (e / a >> 0) - s & 255;
  30299. return t + i
  30300. }
  30301. ,
  30302. u.prototype.writeInt8 = function(e, t, i) {
  30303. return e = +e,
  30304. t |= 0,
  30305. i || E(this, e, t, 1, 127, -128),
  30306. u.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  30307. e < 0 && (e = 255 + e + 1),
  30308. this[t] = 255 & e,
  30309. t + 1
  30310. }
  30311. ,
  30312. u.prototype.writeInt16LE = function(e, t, i) {
  30313. return e = +e,
  30314. t |= 0,
  30315. i || E(this, e, t, 2, 32767, -32768),
  30316. u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30317. this[t + 1] = e >>> 8) : _(this, e, t, !0),
  30318. t + 2
  30319. }
  30320. ,
  30321. u.prototype.writeInt16BE = function(e, t, i) {
  30322. return e = +e,
  30323. t |= 0,
  30324. i || E(this, e, t, 2, 32767, -32768),
  30325. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  30326. this[t + 1] = 255 & e) : _(this, e, t, !1),
  30327. t + 2
  30328. }
  30329. ,
  30330. u.prototype.writeInt32LE = function(e, t, i) {
  30331. return e = +e,
  30332. t |= 0,
  30333. i || E(this, e, t, 4, 2147483647, -2147483648),
  30334. u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30335. this[t + 1] = e >>> 8,
  30336. this[t + 2] = e >>> 16,
  30337. this[t + 3] = e >>> 24) : b(this, e, t, !0),
  30338. t + 4
  30339. }
  30340. ,
  30341. u.prototype.writeInt32BE = function(e, t, i) {
  30342. return e = +e,
  30343. t |= 0,
  30344. i || E(this, e, t, 4, 2147483647, -2147483648),
  30345. e < 0 && (e = 4294967295 + e + 1),
  30346. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  30347. this[t + 1] = e >>> 16,
  30348. this[t + 2] = e >>> 8,
  30349. this[t + 3] = 255 & e) : b(this, e, t, !1),
  30350. t + 4
  30351. }
  30352. ,
  30353. u.prototype.writeFloatLE = function(e, t, i) {
  30354. return T(this, e, t, !0, i)
  30355. }
  30356. ,
  30357. u.prototype.writeFloatBE = function(e, t, i) {
  30358. return T(this, e, t, !1, i)
  30359. }
  30360. ,
  30361. u.prototype.writeDoubleLE = function(e, t, i) {
  30362. return x(this, e, t, !0, i)
  30363. }
  30364. ,
  30365. u.prototype.writeDoubleBE = function(e, t, i) {
  30366. return x(this, e, t, !1, i)
  30367. }
  30368. ,
  30369. u.prototype.copy = function(e, t, i, n) {
  30370. if (i = i || 0,
  30371. n || 0 === n || (n = this.length),
  30372. t >= e.length && (t = e.length),
  30373. t = t || 0,
  30374. 0 < n && n < i && (n = i),
  30375. n === i)
  30376. return 0;
  30377. if (0 === e.length || 0 === this.length)
  30378. return 0;
  30379. if (t < 0)
  30380. throw new RangeError("targetStart out of bounds");
  30381. if (i < 0 || i >= this.length)
  30382. throw new RangeError("sourceStart out of bounds");
  30383. if (n < 0)
  30384. throw new RangeError("sourceEnd out of bounds");
  30385. n > this.length && (n = this.length),
  30386. e.length - t < n - i && (n = e.length - t + i);
  30387. var r, o = n - i;
  30388. if (this === e && i < t && t < n)
  30389. for (r = o - 1; 0 <= r; --r)
  30390. e[r + t] = this[r + i];
  30391. else if (o < 1e3 || !u.TYPED_ARRAY_SUPPORT)
  30392. for (r = 0; r < o; ++r)
  30393. e[r + t] = this[r + i];
  30394. else
  30395. Uint8Array.prototype.set.call(e, this.subarray(i, i + o), t);
  30396. return o
  30397. }
  30398. ,
  30399. u.prototype.fill = function(e, t, i, n) {
  30400. if ("string" == typeof e) {
  30401. if ("string" == typeof t ? (n = t,
  30402. t = 0,
  30403. i = this.length) : "string" == typeof i && (n = i,
  30404. i = this.length),
  30405. 1 === e.length) {
  30406. var r = e.charCodeAt(0);
  30407. r < 256 && (e = r)
  30408. }
  30409. if (void 0 !== n && "string" != typeof n)
  30410. throw new TypeError("encoding must be a string");
  30411. if ("string" == typeof n && !u.isEncoding(n))
  30412. throw new TypeError("Unknown encoding: " + n)
  30413. } else
  30414. "number" == typeof e && (e &= 255);
  30415. if (t < 0 || this.length < t || this.length < i)
  30416. throw new RangeError("Out of range index");
  30417. if (i <= t)
  30418. return this;
  30419. var o;
  30420. if (t >>>= 0,
  30421. i = void 0 === i ? this.length : i >>> 0,
  30422. "number" == typeof (e = e || 0))
  30423. for (o = t; o < i; ++o)
  30424. this[o] = e;
  30425. else {
  30426. var a = u.isBuffer(e) ? e : S(new u(e,n).toString())
  30427. , s = a.length;
  30428. for (o = 0; o < i - t; ++o)
  30429. this[o + t] = a[o % s]
  30430. }
  30431. return this
  30432. }
  30433. ;
  30434. var t = /[^+\/0-9A-Za-z-_]/g
  30435. }
  30436. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  30437. }
  30438. , {
  30439. "base64-js": 199,
  30440. ieee754: 200,
  30441. isarray: 201
  30442. }],
  30443. 199: [function(e, t, i) {
  30444. "use strict";
  30445. function l(e) {
  30446. var t = e.length;
  30447. if (0 < t % 4)
  30448. throw new Error("Invalid string. Length must be a multiple of 4");
  30449. return "=" === e[t - 2] ? 2 : "=" === e[t - 1] ? 1 : 0
  30450. }
  30451. function c(e, t, i) {
  30452. for (var n, r = [], o = t; o < i; o += 3)
  30453. n = (e[o] << 16) + (e[o + 1] << 8) + e[o + 2],
  30454. r.push(h[(a = n) >> 18 & 63] + h[a >> 12 & 63] + h[a >> 6 & 63] + h[63 & a]);
  30455. var a;
  30456. return r.join("")
  30457. }
  30458. i.byteLength = function(e) {
  30459. return 3 * e.length / 4 - l(e)
  30460. }
  30461. ,
  30462. i.toByteArray = function(e) {
  30463. var t, i, n, r, o, a = e.length;
  30464. r = l(e),
  30465. o = new d(3 * a / 4 - r),
  30466. i = 0 < r ? a - 4 : a;
  30467. var s = 0;
  30468. for (t = 0; t < i; t += 4,
  30469. 3)
  30470. n = u[e.charCodeAt(t)] << 18 | u[e.charCodeAt(t + 1)] << 12 | u[e.charCodeAt(t + 2)] << 6 | u[e.charCodeAt(t + 3)],
  30471. o[s++] = n >> 16 & 255,
  30472. o[s++] = n >> 8 & 255,
  30473. o[s++] = 255 & n;
  30474. return 2 === r ? (n = u[e.charCodeAt(t)] << 2 | u[e.charCodeAt(t + 1)] >> 4,
  30475. o[s++] = 255 & n) : 1 === r && (n = u[e.charCodeAt(t)] << 10 | u[e.charCodeAt(t + 1)] << 4 | u[e.charCodeAt(t + 2)] >> 2,
  30476. o[s++] = n >> 8 & 255,
  30477. o[s++] = 255 & n),
  30478. o
  30479. }
  30480. ,
  30481. i.fromByteArray = function(e) {
  30482. for (var t, i = e.length, n = i % 3, r = "", o = [], a = 0, s = i - n; a < s; a += 16383)
  30483. o.push(c(e, a, s < a + 16383 ? s : a + 16383));
  30484. return 1 == n ? (t = e[i - 1],
  30485. r += h[t >> 2],
  30486. r += h[t << 4 & 63],
  30487. r += "==") : 2 == n && (t = (e[i - 2] << 8) + e[i - 1],
  30488. r += h[t >> 10],
  30489. r += h[t >> 4 & 63],
  30490. r += h[t << 2 & 63],
  30491. r += "="),
  30492. o.push(r),
  30493. o.join("")
  30494. }
  30495. ;
  30496. for (var h = [], u = [], d = "undefined" != typeof Uint8Array ? Uint8Array : Array, n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", r = 0, o = n.length; r < o; ++r)
  30497. h[r] = n[r],
  30498. u[n.charCodeAt(r)] = r;
  30499. u["-".charCodeAt(0)] = 62,
  30500. u["_".charCodeAt(0)] = 63
  30501. }
  30502. , {}],
  30503. 200: [function(e, t, i) {
  30504. i.read = function(e, t, i, n, r) {
  30505. var o, a, s = 8 * r - n - 1, l = (1 << s) - 1, c = l >> 1, h = -7, u = i ? r - 1 : 0, d = i ? -1 : 1, p = e[t + u];
  30506. for (u += d,
  30507. o = p & (1 << -h) - 1,
  30508. p >>= -h,
  30509. h += s; 0 < h; o = 256 * o + e[t + u],
  30510. u += d,
  30511. h -= 8)
  30512. ;
  30513. for (a = o & (1 << -h) - 1,
  30514. o >>= -h,
  30515. h += n; 0 < h; a = 256 * a + e[t + u],
  30516. u += d,
  30517. h -= 8)
  30518. ;
  30519. if (0 === o)
  30520. o = 1 - c;
  30521. else {
  30522. if (o === l)
  30523. return a ? NaN : 1 / 0 * (p ? -1 : 1);
  30524. a += Math.pow(2, n),
  30525. o -= c
  30526. }
  30527. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  30528. }
  30529. ,
  30530. i.write = function(e, t, i, n, r, o) {
  30531. var a, s, l, c = 8 * o - r - 1, h = (1 << c) - 1, u = h >> 1, d = 23 === r ? Math.pow(2, -24) - Math.pow(2, -77) : 0, p = n ? 0 : o - 1, f = n ? 1 : -1, g = t < 0 || 0 === t && 1 / t < 0 ? 1 : 0;
  30532. for (t = Math.abs(t),
  30533. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  30534. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  30535. t * (l = Math.pow(2, -a)) < 1 && (a--,
  30536. l *= 2),
  30537. 2 <= (t += 1 <= a + u ? d / l : d * Math.pow(2, 1 - u)) * l && (a++,
  30538. l /= 2),
  30539. h <= a + u ? (s = 0,
  30540. a = h) : 1 <= a + u ? (s = (t * l - 1) * Math.pow(2, r),
  30541. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  30542. a = 0)); 8 <= r; e[i + p] = 255 & s,
  30543. p += f,
  30544. s /= 256,
  30545. r -= 8)
  30546. ;
  30547. for (a = a << r | s,
  30548. c += r; 0 < c; e[i + p] = 255 & a,
  30549. p += f,
  30550. a /= 256,
  30551. c -= 8)
  30552. ;
  30553. e[i + p - f] |= 128 * g
  30554. }
  30555. }
  30556. , {}],
  30557. 201: [function(e, t, i) {
  30558. var n = {}.toString;
  30559. t.exports = Array.isArray || function(e) {
  30560. return "[object Array]" == n.call(e)
  30561. }
  30562. }
  30563. , {}],
  30564. 202: [function(e, t, i) {
  30565. function n() {
  30566. this._events = this._events || {},
  30567. this._maxListeners = this._maxListeners || void 0
  30568. }
  30569. function l(e) {
  30570. return "function" == typeof e
  30571. }
  30572. function c(e) {
  30573. return "object" == typeof e && null !== e
  30574. }
  30575. function h(e) {
  30576. return void 0 === e
  30577. }
  30578. ((t.exports = n).EventEmitter = n).prototype._events = void 0,
  30579. n.prototype._maxListeners = void 0,
  30580. n.defaultMaxListeners = 10,
  30581. n.prototype.setMaxListeners = function(e) {
  30582. if (!function(e) {
  30583. return "number" == typeof e
  30584. }(e) || e < 0 || isNaN(e))
  30585. throw TypeError("n must be a positive number");
  30586. return this._maxListeners = e,
  30587. this
  30588. }
  30589. ,
  30590. n.prototype.emit = function(e) {
  30591. var t, i, n, r, o, a;
  30592. if (this._events || (this._events = {}),
  30593. "error" === e && (!this._events.error || c(this._events.error) && !this._events.error.length)) {
  30594. if ((t = arguments[1])instanceof Error)
  30595. throw t;
  30596. var s = new Error('Uncaught, unspecified "error" event. (' + t + ")");
  30597. throw s.context = t,
  30598. s
  30599. }
  30600. if (h(i = this._events[e]))
  30601. return !1;
  30602. if (l(i))
  30603. switch (arguments.length) {
  30604. case 1:
  30605. i.call(this);
  30606. break;
  30607. case 2:
  30608. i.call(this, arguments[1]);
  30609. break;
  30610. case 3:
  30611. i.call(this, arguments[1], arguments[2]);
  30612. break;
  30613. default:
  30614. r = Array.prototype.slice.call(arguments, 1),
  30615. i.apply(this, r)
  30616. }
  30617. else if (c(i))
  30618. for (r = Array.prototype.slice.call(arguments, 1),
  30619. n = (a = i.slice()).length,
  30620. o = 0; o < n; o++)
  30621. a[o].apply(this, r);
  30622. return !0
  30623. }
  30624. ,
  30625. n.prototype.on = n.prototype.addListener = function(e, t) {
  30626. var i;
  30627. if (!l(t))
  30628. throw TypeError("listener must be a function");
  30629. return this._events || (this._events = {}),
  30630. this._events.newListener && this.emit("newListener", e, l(t.listener) ? t.listener : t),
  30631. this._events[e] ? c(this._events[e]) ? this._events[e].push(t) : this._events[e] = [this._events[e], t] : this._events[e] = t,
  30632. 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,
  30633. console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.", this._events[e].length),
  30634. "function" == typeof console.trace && console.trace())),
  30635. this
  30636. }
  30637. ,
  30638. n.prototype.once = function(e, t) {
  30639. function i() {
  30640. this.removeListener(e, i),
  30641. n || (n = !0,
  30642. t.apply(this, arguments))
  30643. }
  30644. if (!l(t))
  30645. throw TypeError("listener must be a function");
  30646. var n = !1;
  30647. return i.listener = t,
  30648. this.on(e, i),
  30649. this
  30650. }
  30651. ,
  30652. n.prototype.removeListener = function(e, t) {
  30653. var i, n, r, o;
  30654. if (!l(t))
  30655. throw TypeError("listener must be a function");
  30656. if (!this._events || !this._events[e])
  30657. return this;
  30658. if (r = (i = this._events[e]).length,
  30659. n = -1,
  30660. i === t || l(i.listener) && i.listener === t)
  30661. delete this._events[e],
  30662. this._events.removeListener && this.emit("removeListener", e, t);
  30663. else if (c(i)) {
  30664. for (o = r; 0 < o--; )
  30665. if (i[o] === t || i[o].listener && i[o].listener === t) {
  30666. n = o;
  30667. break
  30668. }
  30669. if (n < 0)
  30670. return this;
  30671. 1 === i.length ? (i.length = 0,
  30672. delete this._events[e]) : i.splice(n, 1),
  30673. this._events.removeListener && this.emit("removeListener", e, t)
  30674. }
  30675. return this
  30676. }
  30677. ,
  30678. n.prototype.removeAllListeners = function(e) {
  30679. var t, i;
  30680. if (!this._events)
  30681. return this;
  30682. if (!this._events.removeListener)
  30683. return 0 === arguments.length ? this._events = {} : this._events[e] && delete this._events[e],
  30684. this;
  30685. if (0 === arguments.length) {
  30686. for (t in this._events)
  30687. "removeListener" !== t && this.removeAllListeners(t);
  30688. return this.removeAllListeners("removeListener"),
  30689. this._events = {},
  30690. this
  30691. }
  30692. if (l(i = this._events[e]))
  30693. this.removeListener(e, i);
  30694. else if (i)
  30695. for (; i.length; )
  30696. this.removeListener(e, i[i.length - 1]);
  30697. return delete this._events[e],
  30698. this
  30699. }
  30700. ,
  30701. n.prototype.listeners = function(e) {
  30702. return this._events && this._events[e] ? l(this._events[e]) ? [this._events[e]] : this._events[e].slice() : []
  30703. }
  30704. ,
  30705. n.prototype.listenerCount = function(e) {
  30706. if (this._events) {
  30707. var t = this._events[e];
  30708. if (l(t))
  30709. return 1;
  30710. if (t)
  30711. return t.length
  30712. }
  30713. return 0
  30714. }
  30715. ,
  30716. n.listenerCount = function(e, t) {
  30717. return e.listenerCount(t)
  30718. }
  30719. }
  30720. , {}],
  30721. 203: [function(e, t, i) {
  30722. function n() {
  30723. throw new Error("setTimeout has not been defined")
  30724. }
  30725. function r() {
  30726. throw new Error("clearTimeout has not been defined")
  30727. }
  30728. function o(t) {
  30729. if (h === setTimeout)
  30730. return setTimeout(t, 0);
  30731. if ((h === n || !h) && setTimeout)
  30732. return h = setTimeout,
  30733. setTimeout(t, 0);
  30734. try {
  30735. return h(t, 0)
  30736. } catch (e) {
  30737. try {
  30738. return h.call(null, t, 0)
  30739. } catch (e) {
  30740. return h.call(this, t, 0)
  30741. }
  30742. }
  30743. }
  30744. function a() {
  30745. g && p && (g = !1,
  30746. p.length ? f = p.concat(f) : m = -1,
  30747. f.length && s())
  30748. }
  30749. function s() {
  30750. if (!g) {
  30751. var e = o(a);
  30752. g = !0;
  30753. for (var t = f.length; t; ) {
  30754. for (p = f,
  30755. f = []; ++m < t; )
  30756. p && p[m].run();
  30757. m = -1,
  30758. t = f.length
  30759. }
  30760. p = null,
  30761. g = !1,
  30762. function(t) {
  30763. if (u === clearTimeout)
  30764. return clearTimeout(t);
  30765. if ((u === r || !u) && clearTimeout)
  30766. return u = clearTimeout,
  30767. clearTimeout(t);
  30768. try {
  30769. u(t)
  30770. } catch (e) {
  30771. try {
  30772. return u.call(null, t)
  30773. } catch (e) {
  30774. return u.call(this, t)
  30775. }
  30776. }
  30777. }(e)
  30778. }
  30779. }
  30780. function l(e, t) {
  30781. this.fun = e,
  30782. this.array = t
  30783. }
  30784. function c() {}
  30785. var h, u, d = t.exports = {};
  30786. !function() {
  30787. try {
  30788. h = "function" == typeof setTimeout ? setTimeout : n
  30789. } catch (e) {
  30790. h = n
  30791. }
  30792. try {
  30793. u = "function" == typeof clearTimeout ? clearTimeout : r
  30794. } catch (e) {
  30795. u = r
  30796. }
  30797. }();
  30798. var p, f = [], g = !1, m = -1;
  30799. d.nextTick = function(e) {
  30800. var t = new Array(arguments.length - 1);
  30801. if (1 < arguments.length)
  30802. for (var i = 1; i < arguments.length; i++)
  30803. t[i - 1] = arguments[i];
  30804. f.push(new l(e,t)),
  30805. 1 !== f.length || g || o(s)
  30806. }
  30807. ,
  30808. l.prototype.run = function() {
  30809. this.fun.apply(null, this.array)
  30810. }
  30811. ,
  30812. d.title = "browser",
  30813. d.browser = !0,
  30814. d.env = {},
  30815. d.argv = [],
  30816. d.version = "",
  30817. d.versions = {},
  30818. d.on = c,
  30819. d.addListener = c,
  30820. d.once = c,
  30821. d.off = c,
  30822. d.removeListener = c,
  30823. d.removeAllListeners = c,
  30824. d.emit = c,
  30825. d.binding = function(e) {
  30826. throw new Error("process.binding is not supported")
  30827. }
  30828. ,
  30829. d.cwd = function() {
  30830. return "/"
  30831. }
  30832. ,
  30833. d.chdir = function(e) {
  30834. throw new Error("process.chdir is not supported")
  30835. }
  30836. ,
  30837. d.umask = function() {
  30838. return 0
  30839. }
  30840. }
  30841. , {}],
  30842. 204: [function(e, O, L) {
  30843. (function(P) {
  30844. !function(e) {
  30845. function v(e) {
  30846. throw new RangeError(g[e])
  30847. }
  30848. function r(e, t) {
  30849. for (var i = e.length, n = []; i--; )
  30850. n[i] = t(e[i]);
  30851. return n
  30852. }
  30853. function t(e, t) {
  30854. var i = e.split("@")
  30855. , n = "";
  30856. return 1 < i.length && (n = i[0] + "@",
  30857. e = i[1]),
  30858. n + r((e = e.replace(f, ".")).split("."), t).join(".")
  30859. }
  30860. function y(e) {
  30861. for (var t, i, n = [], r = 0, o = e.length; r < o; )
  30862. 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),
  30863. r--) : n.push(t);
  30864. return n
  30865. }
  30866. function A(e) {
  30867. return r(e, function(e) {
  30868. var t = "";
  30869. return 65535 < e && (t += R((e -= 65536) >>> 10 & 1023 | 55296),
  30870. e = 56320 | 1023 & e),
  30871. t + R(e)
  30872. }).join("")
  30873. }
  30874. function C(e, t) {
  30875. return e + 22 + 75 * (e < 26) - ((0 != t) << 5)
  30876. }
  30877. function I(e, t, i) {
  30878. var n = 0;
  30879. for (e = i ? M(e / u) : e >> 1,
  30880. e += M(e / t); m * w >> 1 < e; n += _)
  30881. e = M(e / m);
  30882. return M(n + (m + 1) * e / (e + h))
  30883. }
  30884. function i(e) {
  30885. var t, i, n, r, o, a, s, l, c, h, u, d = [], p = e.length, f = 0, g = x, m = T;
  30886. for ((i = e.lastIndexOf(S)) < 0 && (i = 0),
  30887. n = 0; n < i; ++n)
  30888. 128 <= e.charCodeAt(n) && v("not-basic"),
  30889. d.push(e.charCodeAt(n));
  30890. for (r = 0 < i ? i + 1 : 0; r < p; ) {
  30891. for (o = f,
  30892. a = 1,
  30893. s = _; p <= r && v("invalid-input"),
  30894. u = e.charCodeAt(r++),
  30895. (_ <= (l = u - 48 < 10 ? u - 22 : u - 65 < 26 ? u - 65 : u - 97 < 26 ? u - 97 : _) || l > M((E - f) / a)) && v("overflow"),
  30896. f += l * a,
  30897. !(l < (c = s <= m ? b : m + w <= s ? w : s - m)); s += _)
  30898. a > M(E / (h = _ - c)) && v("overflow"),
  30899. a *= h;
  30900. m = I(f - o, t = d.length + 1, 0 == o),
  30901. M(f / t) > E - g && v("overflow"),
  30902. g += M(f / t),
  30903. f %= t,
  30904. d.splice(f++, 0, g)
  30905. }
  30906. return A(d)
  30907. }
  30908. function n(e) {
  30909. var t, i, n, r, o, a, s, l, c, h, u, d, p, f, g, m = [];
  30910. for (d = (e = y(e)).length,
  30911. t = x,
  30912. o = T,
  30913. a = i = 0; a < d; ++a)
  30914. (u = e[a]) < 128 && m.push(R(u));
  30915. for (n = r = m.length,
  30916. r && m.push(S); n < d; ) {
  30917. for (s = E,
  30918. a = 0; a < d; ++a)
  30919. t <= (u = e[a]) && u < s && (s = u);
  30920. for (s - t > M((E - i) / (p = n + 1)) && v("overflow"),
  30921. i += (s - t) * p,
  30922. t = s,
  30923. a = 0; a < d; ++a)
  30924. if ((u = e[a]) < t && ++i > E && v("overflow"),
  30925. u == t) {
  30926. for (l = i,
  30927. c = _; !(l < (h = c <= o ? b : o + w <= c ? w : c - o)); c += _)
  30928. g = l - h,
  30929. f = _ - h,
  30930. m.push(R(C(h + g % f, 0))),
  30931. l = M(g / f);
  30932. m.push(R(C(l, 0))),
  30933. o = I(i, p, n == r),
  30934. i = 0,
  30935. ++n
  30936. }
  30937. ++i,
  30938. ++t
  30939. }
  30940. return m.join("")
  30941. }
  30942. var o = "object" == typeof L && L && !L.nodeType && L
  30943. , a = "object" == typeof O && O && !O.nodeType && O
  30944. , s = "object" == typeof P && P;
  30945. s.global !== s && s.window !== s && s.self !== s || (e = s);
  30946. 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 = {
  30947. overflow: "Overflow: input needs wider integers to process",
  30948. "not-basic": "Illegal input >= 0x80 (not a basic code point)",
  30949. "invalid-input": "Invalid input"
  30950. }, m = _ - b, M = Math.floor, R = String.fromCharCode;
  30951. if (l = {
  30952. version: "1.4.1",
  30953. ucs2: {
  30954. decode: y,
  30955. encode: A
  30956. },
  30957. decode: i,
  30958. encode: n,
  30959. toASCII: function(e) {
  30960. return t(e, function(e) {
  30961. return p.test(e) ? "xn--" + n(e) : e
  30962. })
  30963. },
  30964. toUnicode: function(e) {
  30965. return t(e, function(e) {
  30966. return d.test(e) ? i(e.slice(4).toLowerCase()) : e
  30967. })
  30968. }
  30969. },
  30970. "function" == typeof define && "object" == typeof define.amd && define.amd)
  30971. define("punycode", function() {
  30972. return l
  30973. });
  30974. else if (o && a)
  30975. if (O.exports == o)
  30976. a.exports = l;
  30977. else
  30978. for (c in l)
  30979. l.hasOwnProperty(c) && (o[c] = l[c]);
  30980. else
  30981. e.punycode = l
  30982. }(this)
  30983. }
  30984. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  30985. }
  30986. , {}],
  30987. 205: [function(e, t, i) {
  30988. "use strict";
  30989. t.exports = function(e, t, i, n) {
  30990. t = t || "&",
  30991. i = i || "=";
  30992. var r = {};
  30993. if ("string" != typeof e || 0 === e.length)
  30994. return r;
  30995. var o = /\+/g;
  30996. e = e.split(t);
  30997. var a = 1e3;
  30998. n && "number" == typeof n.maxKeys && (a = n.maxKeys);
  30999. var s, l, c = e.length;
  31000. 0 < a && a < c && (c = a);
  31001. for (var h = 0; h < c; ++h) {
  31002. var u, d, p, f, g = e[h].replace(o, "%20"), m = g.indexOf(i);
  31003. d = 0 <= m ? (u = g.substr(0, m),
  31004. g.substr(m + 1)) : (u = g,
  31005. ""),
  31006. p = decodeURIComponent(u),
  31007. f = decodeURIComponent(d),
  31008. s = r,
  31009. l = p,
  31010. Object.prototype.hasOwnProperty.call(s, l) ? v(r[p]) ? r[p].push(f) : r[p] = [r[p], f] : r[p] = f
  31011. }
  31012. return r
  31013. }
  31014. ;
  31015. var v = Array.isArray || function(e) {
  31016. return "[object Array]" === Object.prototype.toString.call(e)
  31017. }
  31018. }
  31019. , {}],
  31020. 206: [function(e, t, i) {
  31021. "use strict";
  31022. function o(e, t) {
  31023. if (e.map)
  31024. return e.map(t);
  31025. for (var i = [], n = 0; n < e.length; n++)
  31026. i.push(t(e[n], n));
  31027. return i
  31028. }
  31029. function a(e) {
  31030. switch (typeof e) {
  31031. case "string":
  31032. return e;
  31033. case "boolean":
  31034. return e ? "true" : "false";
  31035. case "number":
  31036. return isFinite(e) ? e : "";
  31037. default:
  31038. return ""
  31039. }
  31040. }
  31041. t.exports = function(i, n, r, e) {
  31042. return n = n || "&",
  31043. r = r || "=",
  31044. null === i && (i = void 0),
  31045. "object" == typeof i ? o(l(i), function(e) {
  31046. var t = encodeURIComponent(a(e)) + r;
  31047. return s(i[e]) ? o(i[e], function(e) {
  31048. return t + encodeURIComponent(a(e))
  31049. }).join(n) : t + encodeURIComponent(a(i[e]))
  31050. }).join(n) : e ? encodeURIComponent(a(e)) + r + encodeURIComponent(a(i)) : ""
  31051. }
  31052. ;
  31053. var s = Array.isArray || function(e) {
  31054. return "[object Array]" === Object.prototype.toString.call(e)
  31055. }
  31056. , l = Object.keys || function(e) {
  31057. var t = [];
  31058. for (var i in e)
  31059. Object.prototype.hasOwnProperty.call(e, i) && t.push(i);
  31060. return t
  31061. }
  31062. }
  31063. , {}],
  31064. 207: [function(e, t, i) {
  31065. "use strict";
  31066. i.decode = i.parse = e("./decode"),
  31067. i.encode = i.stringify = e("./encode")
  31068. }
  31069. , {
  31070. "./decode": 205,
  31071. "./encode": 206
  31072. }],
  31073. 208: [function(e, t, i) {
  31074. "use strict";
  31075. function x() {
  31076. this.protocol = null,
  31077. this.slashes = null,
  31078. this.auth = null,
  31079. this.host = null,
  31080. this.port = null,
  31081. this.hostname = null,
  31082. this.hash = null,
  31083. this.search = null,
  31084. this.query = null,
  31085. this.pathname = null,
  31086. this.path = null,
  31087. this.href = null
  31088. }
  31089. function n(e, t, i) {
  31090. if (e && D.isObject(e) && e instanceof x)
  31091. return e;
  31092. var n = new x;
  31093. return n.parse(e, t, i),
  31094. n
  31095. }
  31096. var L = e("punycode")
  31097. , D = e("./util");
  31098. i.parse = n,
  31099. i.resolve = function(e, t) {
  31100. return n(e, !1, !0).resolve(t)
  31101. }
  31102. ,
  31103. i.resolveObject = function(e, t) {
  31104. return e ? n(e, !1, !0).resolveObject(t) : t
  31105. }
  31106. ,
  31107. i.format = function(e) {
  31108. return D.isString(e) && (e = n(e)),
  31109. e instanceof x ? e.format() : x.prototype.format.call(e)
  31110. }
  31111. ,
  31112. i.Url = x;
  31113. var N = /^([a-z0-9.+-]+:)/i
  31114. , r = /:[0-9]*$/
  31115. , F = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/
  31116. , o = ["{", "}", "|", "\\", "^", "`"].concat(["<", ">", '"', "`", " ", "\r", "\n", "\t"])
  31117. , B = ["'"].concat(o)
  31118. , V = ["%", "/", "?", ";", "#"].concat(B)
  31119. , k = ["/", "?", "#"]
  31120. , U = /^[+a-z0-9A-Z_-]{0,63}$/
  31121. , H = /^([+a-z0-9A-Z_-]{0,63})(.*)$/
  31122. , z = {
  31123. javascript: !0,
  31124. "javascript:": !0
  31125. }
  31126. , G = {
  31127. javascript: !0,
  31128. "javascript:": !0
  31129. }
  31130. , W = {
  31131. http: !0,
  31132. https: !0,
  31133. ftp: !0,
  31134. gopher: !0,
  31135. file: !0,
  31136. "http:": !0,
  31137. "https:": !0,
  31138. "ftp:": !0,
  31139. "gopher:": !0,
  31140. "file:": !0
  31141. }
  31142. , j = e("querystring");
  31143. x.prototype.parse = function(e, t, i) {
  31144. if (!D.isString(e))
  31145. throw new TypeError("Parameter 'url' must be a string, not " + typeof e);
  31146. var n = e.indexOf("?")
  31147. , r = -1 !== n && n < e.indexOf("#") ? "?" : "#"
  31148. , o = e.split(r);
  31149. o[0] = o[0].replace(/\\/g, "/");
  31150. var a = e = o.join(r);
  31151. if (a = a.trim(),
  31152. !i && 1 === e.split("#").length) {
  31153. var s = F.exec(a);
  31154. if (s)
  31155. return this.path = a,
  31156. this.href = a,
  31157. this.pathname = s[1],
  31158. s[2] ? (this.search = s[2],
  31159. this.query = t ? j.parse(this.search.substr(1)) : this.search.substr(1)) : t && (this.search = "",
  31160. this.query = {}),
  31161. this
  31162. }
  31163. var l = N.exec(a);
  31164. if (l) {
  31165. var c = (l = l[0]).toLowerCase();
  31166. this.protocol = c,
  31167. a = a.substr(l.length)
  31168. }
  31169. if (i || l || a.match(/^\/\/[^@\/]+@[^@\/]+/)) {
  31170. var h = "//" === a.substr(0, 2);
  31171. !h || l && G[l] || (a = a.substr(2),
  31172. this.slashes = !0)
  31173. }
  31174. if (!G[l] && (h || l && !W[l])) {
  31175. for (var u = -1, d = 0; d < k.length; d++) {
  31176. -1 !== (g = a.indexOf(k[d])) && (-1 === u || g < u) && (u = g)
  31177. }
  31178. var p, f;
  31179. -1 !== (f = -1 === u ? a.lastIndexOf("@") : a.lastIndexOf("@", u)) && (p = a.slice(0, f),
  31180. a = a.slice(f + 1),
  31181. this.auth = decodeURIComponent(p)),
  31182. u = -1;
  31183. for (d = 0; d < V.length; d++) {
  31184. var g;
  31185. -1 !== (g = a.indexOf(V[d])) && (-1 === u || g < u) && (u = g)
  31186. }
  31187. -1 === u && (u = a.length),
  31188. this.host = a.slice(0, u),
  31189. a = a.slice(u),
  31190. this.parseHost(),
  31191. this.hostname = this.hostname || "";
  31192. var m = "[" === this.hostname[0] && "]" === this.hostname[this.hostname.length - 1];
  31193. if (!m)
  31194. for (var v = this.hostname.split(/\./), y = (d = 0,
  31195. v.length); d < y; d++) {
  31196. var A = v[d];
  31197. if (A && !A.match(U)) {
  31198. for (var C = "", I = 0, E = A.length; I < E; I++)
  31199. C += 127 < A.charCodeAt(I) ? "x" : A[I];
  31200. if (!C.match(U)) {
  31201. var _ = v.slice(0, d)
  31202. , b = v.slice(d + 1)
  31203. , w = A.match(H);
  31204. w && (_.push(w[1]),
  31205. b.unshift(w[2])),
  31206. b.length && (a = "/" + b.join(".") + a),
  31207. this.hostname = _.join(".");
  31208. break
  31209. }
  31210. }
  31211. }
  31212. 255 < this.hostname.length ? this.hostname = "" : this.hostname = this.hostname.toLowerCase(),
  31213. m || (this.hostname = L.toASCII(this.hostname));
  31214. var T = this.port ? ":" + this.port : ""
  31215. , x = this.hostname || "";
  31216. this.host = x + T,
  31217. this.href += this.host,
  31218. m && (this.hostname = this.hostname.substr(1, this.hostname.length - 2),
  31219. "/" !== a[0] && (a = "/" + a))
  31220. }
  31221. if (!z[c])
  31222. for (d = 0,
  31223. y = B.length; d < y; d++) {
  31224. var S = B[d];
  31225. if (-1 !== a.indexOf(S)) {
  31226. var M = encodeURIComponent(S);
  31227. M === S && (M = escape(S)),
  31228. a = a.split(S).join(M)
  31229. }
  31230. }
  31231. var R = a.indexOf("#");
  31232. -1 !== R && (this.hash = a.substr(R),
  31233. a = a.slice(0, R));
  31234. var P = a.indexOf("?");
  31235. if (-1 !== P ? (this.search = a.substr(P),
  31236. this.query = a.substr(P + 1),
  31237. t && (this.query = j.parse(this.query)),
  31238. a = a.slice(0, P)) : t && (this.search = "",
  31239. this.query = {}),
  31240. a && (this.pathname = a),
  31241. W[c] && this.hostname && !this.pathname && (this.pathname = "/"),
  31242. this.pathname || this.search) {
  31243. T = this.pathname || "";
  31244. var O = this.search || "";
  31245. this.path = T + O
  31246. }
  31247. return this.href = this.format(),
  31248. this
  31249. }
  31250. ,
  31251. x.prototype.format = function() {
  31252. var e = this.auth || "";
  31253. e && (e = (e = encodeURIComponent(e)).replace(/%3A/i, ":"),
  31254. e += "@");
  31255. var t = this.protocol || ""
  31256. , i = this.pathname || ""
  31257. , n = this.hash || ""
  31258. , r = !1
  31259. , o = "";
  31260. this.host ? r = e + this.host : this.hostname && (r = e + (-1 === this.hostname.indexOf(":") ? this.hostname : "[" + this.hostname + "]"),
  31261. this.port && (r += ":" + this.port)),
  31262. this.query && D.isObject(this.query) && Object.keys(this.query).length && (o = j.stringify(this.query));
  31263. var a = this.search || o && "?" + o || "";
  31264. return t && ":" !== t.substr(-1) && (t += ":"),
  31265. this.slashes || (!t || W[t]) && !1 !== r ? (r = "//" + (r || ""),
  31266. i && "/" !== i.charAt(0) && (i = "/" + i)) : r = r || "",
  31267. n && "#" !== n.charAt(0) && (n = "#" + n),
  31268. a && "?" !== a.charAt(0) && (a = "?" + a),
  31269. t + r + (i = i.replace(/[?#]/g, function(e) {
  31270. return encodeURIComponent(e)
  31271. })) + (a = a.replace("#", "%23")) + n
  31272. }
  31273. ,
  31274. x.prototype.resolve = function(e) {
  31275. return this.resolveObject(n(e, !1, !0)).format()
  31276. }
  31277. ,
  31278. x.prototype.resolveObject = function(e) {
  31279. if (D.isString(e)) {
  31280. var t = new x;
  31281. t.parse(e, !1, !0),
  31282. e = t
  31283. }
  31284. for (var i = new x, n = Object.keys(this), r = 0; r < n.length; r++) {
  31285. var o = n[r];
  31286. i[o] = this[o]
  31287. }
  31288. if (i.hash = e.hash,
  31289. "" === e.href)
  31290. return i.href = i.format(),
  31291. i;
  31292. if (e.slashes && !e.protocol) {
  31293. for (var a = Object.keys(e), s = 0; s < a.length; s++) {
  31294. var l = a[s];
  31295. "protocol" !== l && (i[l] = e[l])
  31296. }
  31297. return W[i.protocol] && i.hostname && !i.pathname && (i.path = i.pathname = "/"),
  31298. i.href = i.format(),
  31299. i
  31300. }
  31301. if (e.protocol && e.protocol !== i.protocol) {
  31302. if (!W[e.protocol]) {
  31303. for (var c = Object.keys(e), h = 0; h < c.length; h++) {
  31304. var u = c[h];
  31305. i[u] = e[u]
  31306. }
  31307. return i.href = i.format(),
  31308. i
  31309. }
  31310. if (i.protocol = e.protocol,
  31311. e.host || G[e.protocol])
  31312. i.pathname = e.pathname;
  31313. else {
  31314. for (var d = (e.pathname || "").split("/"); d.length && !(e.host = d.shift()); )
  31315. ;
  31316. e.host || (e.host = ""),
  31317. e.hostname || (e.hostname = ""),
  31318. "" !== d[0] && d.unshift(""),
  31319. d.length < 2 && d.unshift(""),
  31320. i.pathname = d.join("/")
  31321. }
  31322. if (i.search = e.search,
  31323. i.query = e.query,
  31324. i.host = e.host || "",
  31325. i.auth = e.auth,
  31326. i.hostname = e.hostname || e.host,
  31327. i.port = e.port,
  31328. i.pathname || i.search) {
  31329. var p = i.pathname || ""
  31330. , f = i.search || "";
  31331. i.path = p + f
  31332. }
  31333. return i.slashes = i.slashes || e.slashes,
  31334. i.href = i.format(),
  31335. i
  31336. }
  31337. var g = i.pathname && "/" === i.pathname.charAt(0)
  31338. , m = e.host || e.pathname && "/" === e.pathname.charAt(0)
  31339. , v = m || g || i.host && e.pathname
  31340. , y = v
  31341. , A = i.pathname && i.pathname.split("/") || []
  31342. , C = (d = e.pathname && e.pathname.split("/") || [],
  31343. i.protocol && !W[i.protocol]);
  31344. if (C && (i.hostname = "",
  31345. i.port = null,
  31346. i.host && ("" === A[0] ? A[0] = i.host : A.unshift(i.host)),
  31347. i.host = "",
  31348. e.protocol && (e.hostname = null,
  31349. e.port = null,
  31350. e.host && ("" === d[0] ? d[0] = e.host : d.unshift(e.host)),
  31351. e.host = null),
  31352. v = v && ("" === d[0] || "" === A[0])),
  31353. m)
  31354. i.host = e.host || "" === e.host ? e.host : i.host,
  31355. i.hostname = e.hostname || "" === e.hostname ? e.hostname : i.hostname,
  31356. i.search = e.search,
  31357. i.query = e.query,
  31358. A = d;
  31359. else if (d.length)
  31360. (A = A || []).pop(),
  31361. A = A.concat(d),
  31362. i.search = e.search,
  31363. i.query = e.query;
  31364. else if (!D.isNullOrUndefined(e.search)) {
  31365. if (C)
  31366. i.hostname = i.host = A.shift(),
  31367. (w = !!(i.host && 0 < i.host.indexOf("@")) && i.host.split("@")) && (i.auth = w.shift(),
  31368. i.host = i.hostname = w.shift());
  31369. return i.search = e.search,
  31370. i.query = e.query,
  31371. D.isNull(i.pathname) && D.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  31372. i.href = i.format(),
  31373. i
  31374. }
  31375. if (!A.length)
  31376. return i.pathname = null,
  31377. i.search ? i.path = "/" + i.search : i.path = null,
  31378. i.href = i.format(),
  31379. i;
  31380. 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--)
  31381. "." === (I = A[b]) ? A.splice(b, 1) : ".." === I ? (A.splice(b, 1),
  31382. _++) : _ && (A.splice(b, 1),
  31383. _--);
  31384. if (!v && !y)
  31385. for (; _--; )
  31386. A.unshift("..");
  31387. !v || "" === A[0] || A[0] && "/" === A[0].charAt(0) || A.unshift(""),
  31388. E && "/" !== A.join("/").substr(-1) && A.push("");
  31389. var w, T = "" === A[0] || A[0] && "/" === A[0].charAt(0);
  31390. C && (i.hostname = i.host = T ? "" : A.length ? A.shift() : "",
  31391. (w = !!(i.host && 0 < i.host.indexOf("@")) && i.host.split("@")) && (i.auth = w.shift(),
  31392. i.host = i.hostname = w.shift()));
  31393. return (v = v || i.host && A.length) && !T && A.unshift(""),
  31394. A.length ? i.pathname = A.join("/") : (i.pathname = null,
  31395. i.path = null),
  31396. D.isNull(i.pathname) && D.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  31397. i.auth = e.auth || i.auth,
  31398. i.slashes = i.slashes || e.slashes,
  31399. i.href = i.format(),
  31400. i
  31401. }
  31402. ,
  31403. x.prototype.parseHost = function() {
  31404. var e = this.host
  31405. , t = r.exec(e);
  31406. t && (":" !== (t = t[0]) && (this.port = t.substr(1)),
  31407. e = e.substr(0, e.length - t.length)),
  31408. e && (this.hostname = e)
  31409. }
  31410. }
  31411. , {
  31412. "./util": 209,
  31413. punycode: 204,
  31414. querystring: 207
  31415. }],
  31416. 209: [function(e, t, i) {
  31417. "use strict";
  31418. t.exports = {
  31419. isString: function(e) {
  31420. return "string" == typeof e
  31421. },
  31422. isObject: function(e) {
  31423. return "object" == typeof e && null !== e
  31424. },
  31425. isNull: function(e) {
  31426. return null === e
  31427. },
  31428. isNullOrUndefined: function(e) {
  31429. return null == e
  31430. }
  31431. }
  31432. }
  31433. , {}],
  31434. 210: [function(e, t, i) {
  31435. "use strict";
  31436. function r(e) {
  31437. return c + e
  31438. }
  31439. function s(e) {
  31440. if ("string" != typeof e)
  31441. throw new TypeError("key must be a string.")
  31442. }
  31443. var l = Object.prototype.hasOwnProperty
  31444. , c = "~";
  31445. t.exports = function(t) {
  31446. var o = Object.create(null)
  31447. , n = 0
  31448. , a = {};
  31449. return function(e, t) {
  31450. for (var i in t)
  31451. Object.defineProperty(e, i, {
  31452. value: t[i],
  31453. configurable: !0,
  31454. writable: !0
  31455. })
  31456. }(a, {
  31457. get: function(e, t) {
  31458. s(e);
  31459. var i = r(e);
  31460. return i in o ? o[i] : t
  31461. },
  31462. set: function(e, t) {
  31463. s(e);
  31464. var i = r(e);
  31465. return i in o || ++n,
  31466. o[i] = t
  31467. },
  31468. has: function(e) {
  31469. return s(e),
  31470. r(e)in o
  31471. },
  31472. delete: function(e) {
  31473. s(e);
  31474. var t = r(e);
  31475. return t in o && (--n,
  31476. delete o[t],
  31477. !0)
  31478. },
  31479. clear: function() {
  31480. o = Object.create(null),
  31481. n = 0
  31482. },
  31483. forEach: function(e, t) {
  31484. if ("function" != typeof e)
  31485. throw new TypeError("`callback` must be a function");
  31486. for (var i in o)
  31487. if (l.call(o, i)) {
  31488. var n = i.substring(c.length)
  31489. , r = o[i];
  31490. e.call(t, r, n, a)
  31491. }
  31492. }
  31493. }),
  31494. Object.defineProperty(a, "size", {
  31495. get: function() {
  31496. return n
  31497. },
  31498. configurable: !0
  31499. }),
  31500. "object" == typeof t && null !== t && Object.keys(t).forEach(function(e) {
  31501. a.set(e, t[e])
  31502. }),
  31503. a
  31504. }
  31505. }
  31506. , {}],
  31507. 211: [function(e, t, i) {
  31508. t.exports = e("./lib/heap")
  31509. }
  31510. , {
  31511. "./lib/heap": 212
  31512. }],
  31513. 212: [function(e, y, A) {
  31514. (function() {
  31515. var e, d, l, p, f, t, c, i, g, m, n, r, o, h, u, a, s;
  31516. function v(e) {
  31517. this.cmp = null != e ? e : d,
  31518. this.nodes = []
  31519. }
  31520. l = Math.floor,
  31521. m = Math.min,
  31522. d = function(e, t) {
  31523. return e < t ? -1 : t < e ? 1 : 0
  31524. }
  31525. ,
  31526. g = function(e, t, i, n, r) {
  31527. var o;
  31528. if (null == i && (i = 0),
  31529. null == r && (r = d),
  31530. i < 0)
  31531. throw new Error("lo must be non-negative");
  31532. for (null == n && (n = e.length); i < n; )
  31533. r(t, e[o = l((i + n) / 2)]) < 0 ? n = o : i = o + 1;
  31534. return [].splice.apply(e, [i, i - i].concat(t)),
  31535. t
  31536. }
  31537. ,
  31538. t = function(e, t, i) {
  31539. return null == i && (i = d),
  31540. e.push(t),
  31541. h(e, 0, e.length - 1, i)
  31542. }
  31543. ,
  31544. f = function(e, t) {
  31545. var i, n;
  31546. return null == t && (t = d),
  31547. i = e.pop(),
  31548. e.length ? (n = e[0],
  31549. e[0] = i,
  31550. u(e, 0, t)) : n = i,
  31551. n
  31552. }
  31553. ,
  31554. i = function(e, t, i) {
  31555. var n;
  31556. return null == i && (i = d),
  31557. n = e[0],
  31558. e[0] = t,
  31559. u(e, 0, i),
  31560. n
  31561. }
  31562. ,
  31563. c = function(e, t, i) {
  31564. var n;
  31565. return null == i && (i = d),
  31566. e.length && i(e[0], t) < 0 && (t = (n = [e[0], t])[0],
  31567. e[0] = n[1],
  31568. u(e, 0, i)),
  31569. t
  31570. }
  31571. ,
  31572. p = function(i, e) {
  31573. var t, n, r, o, a, s;
  31574. for (null == e && (e = d),
  31575. a = [],
  31576. n = 0,
  31577. r = (o = function() {
  31578. s = [];
  31579. for (var e = 0, t = l(i.length / 2); 0 <= t ? e < t : t < e; 0 <= t ? e++ : e--)
  31580. s.push(e);
  31581. return s
  31582. }
  31583. .apply(this).reverse()).length; n < r; n++)
  31584. t = o[n],
  31585. a.push(u(i, t, e));
  31586. return a
  31587. }
  31588. ,
  31589. o = function(e, t, i) {
  31590. var n;
  31591. if (null == i && (i = d),
  31592. -1 !== (n = e.indexOf(t)))
  31593. return h(e, 0, n, i),
  31594. u(e, n, i)
  31595. }
  31596. ,
  31597. n = function(e, t, i) {
  31598. var n, r, o, a, s;
  31599. if (null == i && (i = d),
  31600. !(r = e.slice(0, t)).length)
  31601. return r;
  31602. for (p(r, i),
  31603. o = 0,
  31604. a = (s = e.slice(t)).length; o < a; o++)
  31605. n = s[o],
  31606. c(r, n, i);
  31607. return r.sort(i).reverse()
  31608. }
  31609. ,
  31610. r = function(e, t, i) {
  31611. var n, r, o, a, s, l, c, h, u;
  31612. if (null == i && (i = d),
  31613. 10 * t <= e.length) {
  31614. if (!(o = e.slice(0, t).sort(i)).length)
  31615. return o;
  31616. for (r = o[o.length - 1],
  31617. a = 0,
  31618. l = (c = e.slice(t)).length; a < l; a++)
  31619. i(n = c[a], r) < 0 && (g(o, n, 0, null, i),
  31620. o.pop(),
  31621. r = o[o.length - 1]);
  31622. return o
  31623. }
  31624. for (p(e, i),
  31625. u = [],
  31626. s = 0,
  31627. h = m(t, e.length); 0 <= h ? s < h : h < s; 0 <= h ? ++s : --s)
  31628. u.push(f(e, i));
  31629. return u
  31630. }
  31631. ,
  31632. h = function(e, t, i, n) {
  31633. var r, o, a;
  31634. for (null == n && (n = d),
  31635. r = e[i]; t < i && n(r, o = e[a = i - 1 >> 1]) < 0; )
  31636. e[i] = o,
  31637. i = a;
  31638. return e[i] = r
  31639. }
  31640. ,
  31641. u = function(e, t, i) {
  31642. var n, r, o, a, s;
  31643. for (null == i && (i = d),
  31644. r = e.length,
  31645. o = e[s = t],
  31646. n = 2 * t + 1; n < r; )
  31647. (a = n + 1) < r && !(i(e[n], e[a]) < 0) && (n = a),
  31648. e[t] = e[n],
  31649. n = 2 * (t = n) + 1;
  31650. return e[t] = o,
  31651. h(e, s, t, i)
  31652. }
  31653. ,
  31654. v.push = t,
  31655. v.pop = f,
  31656. v.replace = i,
  31657. v.pushpop = c,
  31658. v.heapify = p,
  31659. v.updateItem = o,
  31660. v.nlargest = n,
  31661. v.nsmallest = r,
  31662. v.prototype.push = function(e) {
  31663. return t(this.nodes, e, this.cmp)
  31664. }
  31665. ,
  31666. v.prototype.pop = function() {
  31667. return f(this.nodes, this.cmp)
  31668. }
  31669. ,
  31670. v.prototype.peek = function() {
  31671. return this.nodes[0]
  31672. }
  31673. ,
  31674. v.prototype.contains = function(e) {
  31675. return -1 !== this.nodes.indexOf(e)
  31676. }
  31677. ,
  31678. v.prototype.replace = function(e) {
  31679. return i(this.nodes, e, this.cmp)
  31680. }
  31681. ,
  31682. v.prototype.pushpop = function(e) {
  31683. return c(this.nodes, e, this.cmp)
  31684. }
  31685. ,
  31686. v.prototype.heapify = function() {
  31687. return p(this.nodes, this.cmp)
  31688. }
  31689. ,
  31690. v.prototype.updateItem = function(e) {
  31691. return o(this.nodes, e, this.cmp)
  31692. }
  31693. ,
  31694. v.prototype.clear = function() {
  31695. return this.nodes = []
  31696. }
  31697. ,
  31698. v.prototype.empty = function() {
  31699. return 0 === this.nodes.length
  31700. }
  31701. ,
  31702. v.prototype.size = function() {
  31703. return this.nodes.length
  31704. }
  31705. ,
  31706. v.prototype.clone = function() {
  31707. var e;
  31708. return (e = new v).nodes = this.nodes.slice(0),
  31709. e
  31710. }
  31711. ,
  31712. v.prototype.toArray = function() {
  31713. return this.nodes.slice(0)
  31714. }
  31715. ,
  31716. v.prototype.insert = v.prototype.push,
  31717. v.prototype.top = v.prototype.peek,
  31718. v.prototype.front = v.prototype.peek,
  31719. v.prototype.has = v.prototype.contains,
  31720. v.prototype.copy = v.prototype.clone,
  31721. e = v,
  31722. a = this,
  31723. s = function() {
  31724. return e
  31725. }
  31726. ,
  31727. "function" == typeof define && define.amd ? define([], s) : "object" == typeof A ? y.exports = s() : a.Heap = s()
  31728. }
  31729. ).call(this)
  31730. }
  31731. , {}],
  31732. 213: [function(e, t, i) {
  31733. function n() {}
  31734. function o(e) {
  31735. if ("object" != typeof this)
  31736. throw new TypeError("Promises must be constructed via new");
  31737. if ("function" != typeof e)
  31738. throw new TypeError("not a function");
  31739. this._state = 0,
  31740. this._handled = !1,
  31741. this._value = void 0,
  31742. this._deferreds = [],
  31743. h(e, this)
  31744. }
  31745. function r(i, n) {
  31746. for (; 3 === i._state; )
  31747. i = i._value;
  31748. return 0 === i._state ? void i._deferreds.push(n) : (i._handled = !0,
  31749. void o._immediateFn(function() {
  31750. var e = 1 === i._state ? n.onFulfilled : n.onRejected;
  31751. if (null !== e) {
  31752. var t;
  31753. try {
  31754. t = e(i._value)
  31755. } catch (e) {
  31756. return void s(n.promise, e)
  31757. }
  31758. a(n.promise, t)
  31759. } else
  31760. (1 === i._state ? a : s)(n.promise, i._value)
  31761. }))
  31762. }
  31763. function a(e, t) {
  31764. try {
  31765. if (t === e)
  31766. throw new TypeError("A promise cannot be resolved with itself.");
  31767. if (t && ("object" == typeof t || "function" == typeof t)) {
  31768. var i = t.then;
  31769. if (t instanceof o)
  31770. return e._state = 3,
  31771. e._value = t,
  31772. void l(e);
  31773. if ("function" == typeof i)
  31774. return void h(function(e, t) {
  31775. return function() {
  31776. e.apply(t, arguments)
  31777. }
  31778. }(i, t), e)
  31779. }
  31780. e._state = 1,
  31781. e._value = t,
  31782. l(e)
  31783. } catch (t) {
  31784. s(e, t)
  31785. }
  31786. }
  31787. function s(e, t) {
  31788. e._state = 2,
  31789. e._value = t,
  31790. l(e)
  31791. }
  31792. function l(e) {
  31793. 2 === e._state && 0 === e._deferreds.length && o._immediateFn(function() {
  31794. e._handled || o._unhandledRejectionFn(e._value)
  31795. });
  31796. for (var t = 0, i = e._deferreds.length; t < i; t++)
  31797. r(e, e._deferreds[t]);
  31798. e._deferreds = null
  31799. }
  31800. function c(e, t, i) {
  31801. this.onFulfilled = "function" == typeof e ? e : null,
  31802. this.onRejected = "function" == typeof t ? t : null,
  31803. this.promise = i
  31804. }
  31805. function h(e, t) {
  31806. var i = !1;
  31807. try {
  31808. e(function(e) {
  31809. i || (i = !0,
  31810. a(t, e))
  31811. }, function(e) {
  31812. i || (i = !0,
  31813. s(t, e))
  31814. })
  31815. } catch (e) {
  31816. if (i)
  31817. return;
  31818. i = !0,
  31819. s(t, e)
  31820. }
  31821. }
  31822. var u, d;
  31823. u = this,
  31824. d = setTimeout,
  31825. o.prototype.catch = function(e) {
  31826. return this.then(null, e)
  31827. }
  31828. ,
  31829. o.prototype.then = function(e, t) {
  31830. var i = new this.constructor(n);
  31831. return r(this, new c(e,t,i)),
  31832. i
  31833. }
  31834. ,
  31835. o.all = function(e) {
  31836. var s = Array.prototype.slice.call(e);
  31837. return new o(function(n, r) {
  31838. function o(t, e) {
  31839. try {
  31840. if (e && ("object" == typeof e || "function" == typeof e)) {
  31841. var i = e.then;
  31842. if ("function" == typeof i)
  31843. return void i.call(e, function(e) {
  31844. o(t, e)
  31845. }, r)
  31846. }
  31847. s[t] = e,
  31848. 0 == --a && n(s)
  31849. } catch (e) {
  31850. r(e)
  31851. }
  31852. }
  31853. if (0 === s.length)
  31854. return n([]);
  31855. for (var a = s.length, e = 0; e < s.length; e++)
  31856. o(e, s[e])
  31857. }
  31858. )
  31859. }
  31860. ,
  31861. o.resolve = function(t) {
  31862. return t && "object" == typeof t && t.constructor === o ? t : new o(function(e) {
  31863. e(t)
  31864. }
  31865. )
  31866. }
  31867. ,
  31868. o.reject = function(i) {
  31869. return new o(function(e, t) {
  31870. t(i)
  31871. }
  31872. )
  31873. }
  31874. ,
  31875. o.race = function(r) {
  31876. return new o(function(e, t) {
  31877. for (var i = 0, n = r.length; i < n; i++)
  31878. r[i].then(e, t)
  31879. }
  31880. )
  31881. }
  31882. ,
  31883. o._immediateFn = "function" == typeof setImmediate && function(e) {
  31884. setImmediate(e)
  31885. }
  31886. || function(e) {
  31887. d(e, 0)
  31888. }
  31889. ,
  31890. o._unhandledRejectionFn = function(e) {
  31891. "undefined" != typeof console && console && console.warn("Possible Unhandled Promise Rejection:", e)
  31892. }
  31893. ,
  31894. o._setImmediateFn = function(e) {
  31895. o._immediateFn = e
  31896. }
  31897. ,
  31898. o._setUnhandledRejectionFn = function(e) {
  31899. o._unhandledRejectionFn = e
  31900. }
  31901. ,
  31902. void 0 !== t && t.exports ? t.exports = o : u.Promise || (u.Promise = o)
  31903. }
  31904. , {}],
  31905. 214: [function(p, i, e) {
  31906. (function(d) {
  31907. var e, t;
  31908. e = this,
  31909. t = function(I, e) {
  31910. "use strict";
  31911. var a, t, u, i, s, n, r, o = {};
  31912. return o.ByteBuffer = I,
  31913. o.Long = I.Long || null,
  31914. o.VERSION = "5.0.1",
  31915. o.WIRE_TYPES = {},
  31916. o.WIRE_TYPES.VARINT = 0,
  31917. o.WIRE_TYPES.BITS64 = 1,
  31918. o.WIRE_TYPES.LDELIM = 2,
  31919. o.WIRE_TYPES.STARTGROUP = 3,
  31920. o.WIRE_TYPES.ENDGROUP = 4,
  31921. o.WIRE_TYPES.BITS32 = 5,
  31922. o.PACKABLE_WIRE_TYPES = [o.WIRE_TYPES.VARINT, o.WIRE_TYPES.BITS64, o.WIRE_TYPES.BITS32],
  31923. o.TYPES = {
  31924. int32: {
  31925. name: "int32",
  31926. wireType: o.WIRE_TYPES.VARINT,
  31927. defaultValue: 0
  31928. },
  31929. uint32: {
  31930. name: "uint32",
  31931. wireType: o.WIRE_TYPES.VARINT,
  31932. defaultValue: 0
  31933. },
  31934. sint32: {
  31935. name: "sint32",
  31936. wireType: o.WIRE_TYPES.VARINT,
  31937. defaultValue: 0
  31938. },
  31939. int64: {
  31940. name: "int64",
  31941. wireType: o.WIRE_TYPES.VARINT,
  31942. defaultValue: o.Long ? o.Long.ZERO : void 0
  31943. },
  31944. uint64: {
  31945. name: "uint64",
  31946. wireType: o.WIRE_TYPES.VARINT,
  31947. defaultValue: o.Long ? o.Long.UZERO : void 0
  31948. },
  31949. sint64: {
  31950. name: "sint64",
  31951. wireType: o.WIRE_TYPES.VARINT,
  31952. defaultValue: o.Long ? o.Long.ZERO : void 0
  31953. },
  31954. bool: {
  31955. name: "bool",
  31956. wireType: o.WIRE_TYPES.VARINT,
  31957. defaultValue: !1
  31958. },
  31959. double: {
  31960. name: "double",
  31961. wireType: o.WIRE_TYPES.BITS64,
  31962. defaultValue: 0
  31963. },
  31964. string: {
  31965. name: "string",
  31966. wireType: o.WIRE_TYPES.LDELIM,
  31967. defaultValue: ""
  31968. },
  31969. bytes: {
  31970. name: "bytes",
  31971. wireType: o.WIRE_TYPES.LDELIM,
  31972. defaultValue: null
  31973. },
  31974. fixed32: {
  31975. name: "fixed32",
  31976. wireType: o.WIRE_TYPES.BITS32,
  31977. defaultValue: 0
  31978. },
  31979. sfixed32: {
  31980. name: "sfixed32",
  31981. wireType: o.WIRE_TYPES.BITS32,
  31982. defaultValue: 0
  31983. },
  31984. fixed64: {
  31985. name: "fixed64",
  31986. wireType: o.WIRE_TYPES.BITS64,
  31987. defaultValue: o.Long ? o.Long.UZERO : void 0
  31988. },
  31989. sfixed64: {
  31990. name: "sfixed64",
  31991. wireType: o.WIRE_TYPES.BITS64,
  31992. defaultValue: o.Long ? o.Long.ZERO : void 0
  31993. },
  31994. float: {
  31995. name: "float",
  31996. wireType: o.WIRE_TYPES.BITS32,
  31997. defaultValue: 0
  31998. },
  31999. enum: {
  32000. name: "enum",
  32001. wireType: o.WIRE_TYPES.VARINT,
  32002. defaultValue: 0
  32003. },
  32004. message: {
  32005. name: "message",
  32006. wireType: o.WIRE_TYPES.LDELIM,
  32007. defaultValue: null
  32008. },
  32009. group: {
  32010. name: "group",
  32011. wireType: o.WIRE_TYPES.STARTGROUP,
  32012. defaultValue: null
  32013. }
  32014. },
  32015. 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],
  32016. o.ID_MIN = 1,
  32017. o.ID_MAX = 536870911,
  32018. o.convertFieldsToCamelCase = !1,
  32019. o.populateAccessors = !0,
  32020. o.populateDefaults = !0,
  32021. o.Util = ((r = {}).IS_NODE = !("object" != typeof d || d + "" != "[object process]" || d.browser),
  32022. r.XHR = function() {
  32023. for (var e = [function() {
  32024. return new XMLHttpRequest
  32025. }
  32026. , function() {
  32027. return new ActiveXObject("Msxml2.XMLHTTP")
  32028. }
  32029. , function() {
  32030. return new ActiveXObject("Msxml3.XMLHTTP")
  32031. }
  32032. , function() {
  32033. return new ActiveXObject("Microsoft.XMLHTTP")
  32034. }
  32035. ], t = null, i = 0; i < e.length; i++) {
  32036. try {
  32037. t = e[i]()
  32038. } catch (e) {
  32039. continue
  32040. }
  32041. break
  32042. }
  32043. if (!t)
  32044. throw Error("XMLHttpRequest is not supported");
  32045. return t
  32046. }
  32047. ,
  32048. r.fetch = function(e, i) {
  32049. if (i && "function" != typeof i && (i = null),
  32050. r.IS_NODE) {
  32051. var t = p("fs");
  32052. if (i)
  32053. t.readFile(e, function(e, t) {
  32054. i(e ? null : "" + t)
  32055. });
  32056. else
  32057. try {
  32058. return t.readFileSync(e)
  32059. } catch (e) {
  32060. return null
  32061. }
  32062. } else {
  32063. var n = r.XHR();
  32064. if (n.open("GET", e, !!i),
  32065. n.setRequestHeader("Accept", "text/plain"),
  32066. "function" == typeof n.overrideMimeType && n.overrideMimeType("text/plain"),
  32067. !i)
  32068. return n.send(null),
  32069. 200 == n.status || 0 == n.status && "string" == typeof n.responseText ? n.responseText : null;
  32070. if (n.onreadystatechange = function() {
  32071. 4 == n.readyState && i(200 == n.status || 0 == n.status && "string" == typeof n.responseText ? n.responseText : null)
  32072. }
  32073. ,
  32074. 4 == n.readyState)
  32075. return;
  32076. n.send(null)
  32077. }
  32078. }
  32079. ,
  32080. r.toCamelCase = function(e) {
  32081. return e.replace(/_([a-zA-Z])/g, function(e, t) {
  32082. return t.toUpperCase()
  32083. })
  32084. }
  32085. ,
  32086. r),
  32087. o.Lang = {
  32088. DELIM: /[\s\{\}=;:\[\],'"\(\)<>]/g,
  32089. RULE: /^(?:required|optional|repeated|map)$/,
  32090. TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,
  32091. NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,
  32092. TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,
  32093. TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,
  32094. FQTYPEREF: /^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,
  32095. NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,
  32096. NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,
  32097. NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/,
  32098. NUMBER_OCT: /^0[0-7]+$/,
  32099. NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,
  32100. BOOL: /^(?:true|false)$/i,
  32101. ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  32102. NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  32103. WHITESPACE: /\s/,
  32104. STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,
  32105. STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,
  32106. STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g
  32107. },
  32108. o.DotProto = function(r, a) {
  32109. function s(e, t) {
  32110. var i = -1
  32111. , n = 1;
  32112. if ("-" == e.charAt(0) && (n = -1,
  32113. e = e.substring(1)),
  32114. a.NUMBER_DEC.test(e))
  32115. i = parseInt(e);
  32116. else if (a.NUMBER_HEX.test(e))
  32117. i = parseInt(e.substring(2), 16);
  32118. else {
  32119. if (!a.NUMBER_OCT.test(e))
  32120. throw Error("illegal id value: " + (n < 0 ? "-" : "") + e);
  32121. i = parseInt(e.substring(1), 8)
  32122. }
  32123. if (i = n * i | 0,
  32124. !t && i < 0)
  32125. throw Error("illegal id value: " + (n < 0 ? "-" : "") + e);
  32126. return i
  32127. }
  32128. function o(e) {
  32129. var t = 1;
  32130. if ("-" == e.charAt(0) && (t = -1,
  32131. e = e.substring(1)),
  32132. a.NUMBER_DEC.test(e))
  32133. return t * parseInt(e, 10);
  32134. if (a.NUMBER_HEX.test(e))
  32135. return t * parseInt(e.substring(2), 16);
  32136. if (a.NUMBER_OCT.test(e))
  32137. return t * parseInt(e.substring(1), 8);
  32138. if ("inf" === e)
  32139. return t * (1 / 0);
  32140. if ("nan" === e)
  32141. return NaN;
  32142. if (a.NUMBER_FLT.test(e))
  32143. return t * parseFloat(e);
  32144. throw Error("illegal number value: " + (t < 0 ? "-" : "") + e)
  32145. }
  32146. function n(e, t, i) {
  32147. void 0 === e[t] ? e[t] = i : (Array.isArray(e[t]) || (e[t] = [e[t]]),
  32148. e[t].push(i))
  32149. }
  32150. function t(e) {
  32151. this.source = e + "",
  32152. this.index = 0,
  32153. this.line = 1,
  32154. this.stack = [],
  32155. this._stringOpen = null
  32156. }
  32157. var e = {}
  32158. , i = t.prototype;
  32159. i._readString = function() {
  32160. var e = '"' === this._stringOpen ? a.STRING_DQ : a.STRING_SQ;
  32161. e.lastIndex = this.index - 1;
  32162. var t = e.exec(this.source);
  32163. if (!t)
  32164. throw Error("unterminated string");
  32165. return this.index = e.lastIndex,
  32166. this.stack.push(this._stringOpen),
  32167. this._stringOpen = null,
  32168. t[1]
  32169. }
  32170. ,
  32171. i.next = function() {
  32172. if (0 < this.stack.length)
  32173. return this.stack.shift();
  32174. if (this.index >= this.source.length)
  32175. return null;
  32176. if (null !== this._stringOpen)
  32177. return this._readString();
  32178. var e, t, i;
  32179. do {
  32180. for (e = !1; a.WHITESPACE.test(i = this.source.charAt(this.index)); )
  32181. if ("\n" === i && ++this.line,
  32182. ++this.index === this.source.length)
  32183. return null;
  32184. if ("/" === this.source.charAt(this.index))
  32185. if (++this.index,
  32186. "/" === this.source.charAt(this.index)) {
  32187. for (; "\n" !== this.source.charAt(++this.index); )
  32188. if (this.index == this.source.length)
  32189. return null;
  32190. ++this.index,
  32191. ++this.line,
  32192. e = !0
  32193. } else {
  32194. if ("*" !== (i = this.source.charAt(this.index)))
  32195. return "/";
  32196. do {
  32197. if ("\n" === i && ++this.line,
  32198. ++this.index === this.source.length)
  32199. return null;
  32200. t = i,
  32201. i = this.source.charAt(this.index)
  32202. } while ("*" !== t || "/" !== i);++this.index,
  32203. e = !0
  32204. }
  32205. } while (e);if (this.index === this.source.length)
  32206. return null;
  32207. var n = this.index;
  32208. if (a.DELIM.lastIndex = 0,
  32209. !a.DELIM.test(this.source.charAt(n++)))
  32210. for (; n < this.source.length && !a.DELIM.test(this.source.charAt(n)); )
  32211. ++n;
  32212. var r = this.source.substring(this.index, this.index = n);
  32213. return '"' !== r && "'" !== r || (this._stringOpen = r),
  32214. r
  32215. }
  32216. ,
  32217. i.peek = function() {
  32218. if (0 === this.stack.length) {
  32219. var e = this.next();
  32220. if (null === e)
  32221. return null;
  32222. this.stack.push(e)
  32223. }
  32224. return this.stack[0]
  32225. }
  32226. ,
  32227. i.skip = function(e) {
  32228. var t = this.next();
  32229. if (t !== e)
  32230. throw Error("illegal '" + t + "', '" + e + "' expected")
  32231. }
  32232. ,
  32233. i.omit = function(e) {
  32234. return this.peek() === e && (this.next(),
  32235. !0)
  32236. }
  32237. ,
  32238. i.toString = function() {
  32239. return "Tokenizer (" + this.index + "/" + this.source.length + " at line " + this.line + ")"
  32240. }
  32241. ,
  32242. e.Tokenizer = t;
  32243. function l(e) {
  32244. this.tn = new t(e),
  32245. this.proto3 = !1
  32246. }
  32247. var c = l.prototype;
  32248. return c.parse = function() {
  32249. var e, t, i = {
  32250. name: "[ROOT]",
  32251. package: null,
  32252. messages: [],
  32253. enums: [],
  32254. imports: [],
  32255. options: {},
  32256. services: []
  32257. }, n = !0;
  32258. try {
  32259. for (; e = this.tn.next(); )
  32260. switch (e) {
  32261. case "package":
  32262. if (!n || null !== i.package)
  32263. throw Error("unexpected 'package'");
  32264. if (e = this.tn.next(),
  32265. !a.TYPEREF.test(e))
  32266. throw Error("illegal package name: " + e);
  32267. this.tn.skip(";"),
  32268. i.package = e;
  32269. break;
  32270. case "import":
  32271. if (!n)
  32272. throw Error("unexpected 'import'");
  32273. "public" !== (e = this.tn.peek()) && !(t = "weak" === e) || this.tn.next(),
  32274. e = this._readString(),
  32275. this.tn.skip(";"),
  32276. t || i.imports.push(e);
  32277. break;
  32278. case "syntax":
  32279. if (!n)
  32280. throw Error("unexpected 'syntax'");
  32281. this.tn.skip("="),
  32282. "proto3" === (i.syntax = this._readString()) && (this.proto3 = !0),
  32283. this.tn.skip(";");
  32284. break;
  32285. case "message":
  32286. this._parseMessage(i, null),
  32287. n = !1;
  32288. break;
  32289. case "enum":
  32290. this._parseEnum(i),
  32291. n = !1;
  32292. break;
  32293. case "option":
  32294. this._parseOption(i);
  32295. break;
  32296. case "service":
  32297. this._parseService(i);
  32298. break;
  32299. case "extend":
  32300. this._parseExtend(i);
  32301. break;
  32302. default:
  32303. throw Error("unexpected '" + e + "'")
  32304. }
  32305. } catch (e) {
  32306. throw e.message = "Parse error at line " + this.tn.line + ": " + e.message,
  32307. e
  32308. }
  32309. return delete i.name,
  32310. i
  32311. }
  32312. ,
  32313. l.parse = function(e) {
  32314. return new l(e).parse()
  32315. }
  32316. ,
  32317. c._readString = function() {
  32318. var e, t, i = "";
  32319. do {
  32320. if ("'" !== (t = this.tn.next()) && '"' !== t)
  32321. throw Error("illegal string delimiter: " + t);
  32322. i += this.tn.next(),
  32323. this.tn.skip(t),
  32324. e = this.tn.peek()
  32325. } while ('"' === e || '"' === e);return i
  32326. }
  32327. ,
  32328. c._readValue = function(e) {
  32329. var t = this.tn.peek();
  32330. if ('"' === t || "'" === t)
  32331. return this._readString();
  32332. if (this.tn.next(),
  32333. a.NUMBER.test(t))
  32334. return o(t);
  32335. if (a.BOOL.test(t))
  32336. return "true" === t.toLowerCase();
  32337. if (e && a.TYPEREF.test(t))
  32338. return t;
  32339. throw Error("illegal value: " + t)
  32340. }
  32341. ,
  32342. c._parseOption = function(e, t) {
  32343. var i = this.tn.next()
  32344. , n = !1;
  32345. if ("(" === i && (n = !0,
  32346. i = this.tn.next()),
  32347. !a.TYPEREF.test(i))
  32348. throw Error("illegal option name: " + i);
  32349. var r = i;
  32350. n && (this.tn.skip(")"),
  32351. r = "(" + r + ")",
  32352. i = this.tn.peek(),
  32353. a.FQTYPEREF.test(i) && (r += i,
  32354. this.tn.next())),
  32355. this.tn.skip("="),
  32356. this._parseOptionValue(e, r),
  32357. t || this.tn.skip(";")
  32358. }
  32359. ,
  32360. c._parseOptionValue = function(e, t) {
  32361. var i = this.tn.peek();
  32362. if ("{" !== i)
  32363. n(e.options, t, this._readValue(!0));
  32364. else
  32365. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); ) {
  32366. if (!a.NAME.test(i))
  32367. throw Error("illegal option name: " + t + "." + i);
  32368. this.tn.omit(":") ? n(e.options, t + "." + i, this._readValue(!0)) : this._parseOptionValue(e, t + "." + i)
  32369. }
  32370. }
  32371. ,
  32372. c._parseService = function(e) {
  32373. var t = this.tn.next();
  32374. if (!a.NAME.test(t))
  32375. throw Error("illegal service name at line " + this.tn.line + ": " + t);
  32376. var i = {
  32377. name: t,
  32378. rpc: {},
  32379. options: {}
  32380. };
  32381. for (this.tn.skip("{"); "}" !== (t = this.tn.next()); )
  32382. if ("option" === t)
  32383. this._parseOption(i);
  32384. else {
  32385. if ("rpc" !== t)
  32386. throw Error("illegal service token: " + t);
  32387. this._parseServiceRPC(i)
  32388. }
  32389. this.tn.omit(";"),
  32390. e.services.push(i)
  32391. }
  32392. ,
  32393. c._parseServiceRPC = function(e) {
  32394. var t = this.tn.next();
  32395. if (!a.NAME.test(t))
  32396. throw Error("illegal rpc service method name: " + t);
  32397. var i = t
  32398. , n = {
  32399. request: null,
  32400. response: null,
  32401. request_stream: !1,
  32402. response_stream: !1,
  32403. options: {}
  32404. };
  32405. if (this.tn.skip("("),
  32406. "stream" === (t = this.tn.next()).toLowerCase() && (n.request_stream = !0,
  32407. t = this.tn.next()),
  32408. !a.TYPEREF.test(t))
  32409. throw Error("illegal rpc service request type: " + t);
  32410. if (n.request = t,
  32411. this.tn.skip(")"),
  32412. "returns" !== (t = this.tn.next()).toLowerCase())
  32413. throw Error("illegal rpc service request type delimiter: " + t);
  32414. if (this.tn.skip("("),
  32415. "stream" === (t = this.tn.next()).toLowerCase() && (n.response_stream = !0,
  32416. t = this.tn.next()),
  32417. n.response = t,
  32418. this.tn.skip(")"),
  32419. "{" === (t = this.tn.peek())) {
  32420. for (this.tn.next(); "}" !== (t = this.tn.next()); ) {
  32421. if ("option" !== t)
  32422. throw Error("illegal rpc service token: " + t);
  32423. this._parseOption(n)
  32424. }
  32425. this.tn.omit(";")
  32426. } else
  32427. this.tn.skip(";");
  32428. void 0 === e.rpc && (e.rpc = {}),
  32429. e.rpc[i] = n
  32430. }
  32431. ,
  32432. c._parseMessage = function(e, t) {
  32433. var i = !!t
  32434. , n = this.tn.next()
  32435. , r = {
  32436. name: "",
  32437. fields: [],
  32438. enums: [],
  32439. messages: [],
  32440. options: {},
  32441. services: [],
  32442. oneofs: {}
  32443. };
  32444. if (!a.NAME.test(n))
  32445. throw Error("illegal " + (i ? "group" : "message") + " name: " + n);
  32446. for (r.name = n,
  32447. i && (this.tn.skip("="),
  32448. t.id = s(this.tn.next()),
  32449. r.isGroup = !0),
  32450. "[" === (n = this.tn.peek()) && t && this._parseFieldOptions(t),
  32451. this.tn.skip("{"); "}" !== (n = this.tn.next()); )
  32452. if (a.RULE.test(n))
  32453. this._parseMessageField(r, n);
  32454. else if ("oneof" === n)
  32455. this._parseMessageOneOf(r);
  32456. else if ("enum" === n)
  32457. this._parseEnum(r);
  32458. else if ("message" === n)
  32459. this._parseMessage(r);
  32460. else if ("option" === n)
  32461. this._parseOption(r);
  32462. else if ("service" === n)
  32463. this._parseService(r);
  32464. else if ("extensions" === n)
  32465. r.extensions = this._parseExtensionRanges();
  32466. else if ("reserved" === n)
  32467. this._parseIgnored();
  32468. else if ("extend" === n)
  32469. this._parseExtend(r);
  32470. else {
  32471. if (!a.TYPEREF.test(n))
  32472. throw Error("illegal message token: " + n);
  32473. if (!this.proto3)
  32474. throw Error("illegal field rule: " + n);
  32475. this._parseMessageField(r, "optional", n)
  32476. }
  32477. return this.tn.omit(";"),
  32478. e.messages.push(r),
  32479. r
  32480. }
  32481. ,
  32482. c._parseIgnored = function() {
  32483. for (; ";" !== this.tn.peek(); )
  32484. this.tn.next();
  32485. this.tn.skip(";")
  32486. }
  32487. ,
  32488. c._parseMessageField = function(e, t, i) {
  32489. if (!a.RULE.test(t))
  32490. throw Error("illegal message field rule: " + t);
  32491. var n, r = {
  32492. rule: t,
  32493. type: "",
  32494. name: "",
  32495. options: {},
  32496. id: 0
  32497. };
  32498. if ("map" === t) {
  32499. if (i)
  32500. throw Error("illegal type: " + i);
  32501. if (this.tn.skip("<"),
  32502. n = this.tn.next(),
  32503. !a.TYPE.test(n) && !a.TYPEREF.test(n))
  32504. throw Error("illegal message field type: " + n);
  32505. if (r.keytype = n,
  32506. this.tn.skip(","),
  32507. n = this.tn.next(),
  32508. !a.TYPE.test(n) && !a.TYPEREF.test(n))
  32509. throw Error("illegal message field: " + n);
  32510. if (r.type = n,
  32511. this.tn.skip(">"),
  32512. n = this.tn.next(),
  32513. !a.NAME.test(n))
  32514. throw Error("illegal message field name: " + n);
  32515. r.name = n,
  32516. this.tn.skip("="),
  32517. r.id = s(this.tn.next()),
  32518. "[" === (n = this.tn.peek()) && this._parseFieldOptions(r),
  32519. this.tn.skip(";")
  32520. } else if ("group" === (i = void 0 !== i ? i : this.tn.next())) {
  32521. var o = this._parseMessage(e, r);
  32522. if (!/^[A-Z]/.test(o.name))
  32523. throw Error("illegal group name: " + o.name);
  32524. r.type = o.name,
  32525. r.name = o.name.toLowerCase(),
  32526. this.tn.omit(";")
  32527. } else {
  32528. if (!a.TYPE.test(i) && !a.TYPEREF.test(i))
  32529. throw Error("illegal message field type: " + i);
  32530. if (r.type = i,
  32531. n = this.tn.next(),
  32532. !a.NAME.test(n))
  32533. throw Error("illegal message field name: " + n);
  32534. r.name = n,
  32535. this.tn.skip("="),
  32536. r.id = s(this.tn.next()),
  32537. "[" === (n = this.tn.peek()) && this._parseFieldOptions(r),
  32538. this.tn.skip(";")
  32539. }
  32540. return e.fields.push(r),
  32541. r
  32542. }
  32543. ,
  32544. c._parseMessageOneOf = function(e) {
  32545. var t = this.tn.next();
  32546. if (!a.NAME.test(t))
  32547. throw Error("illegal oneof name: " + t);
  32548. var i, n = t, r = [];
  32549. for (this.tn.skip("{"); "}" !== (t = this.tn.next()); )
  32550. (i = this._parseMessageField(e, "optional", t)).oneof = n,
  32551. r.push(i.id);
  32552. this.tn.omit(";"),
  32553. e.oneofs[n] = r
  32554. }
  32555. ,
  32556. c._parseFieldOptions = function(e) {
  32557. this.tn.skip("[");
  32558. for (var t = !0; "]" !== this.tn.peek(); )
  32559. t || this.tn.skip(","),
  32560. this._parseOption(e, !0),
  32561. t = !1;
  32562. this.tn.next()
  32563. }
  32564. ,
  32565. c._parseEnum = function(e) {
  32566. var t = {
  32567. name: "",
  32568. values: [],
  32569. options: {}
  32570. }
  32571. , i = this.tn.next();
  32572. if (!a.NAME.test(i))
  32573. throw Error("illegal name: " + i);
  32574. for (t.name = i,
  32575. this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  32576. if ("option" === i)
  32577. this._parseOption(t);
  32578. else {
  32579. if (!a.NAME.test(i))
  32580. throw Error("illegal name: " + i);
  32581. this.tn.skip("=");
  32582. var n = {
  32583. name: i,
  32584. id: s(this.tn.next(), !0)
  32585. };
  32586. "[" === (i = this.tn.peek()) && this._parseFieldOptions({
  32587. options: {}
  32588. }),
  32589. this.tn.skip(";"),
  32590. t.values.push(n)
  32591. }
  32592. this.tn.omit(";"),
  32593. e.enums.push(t)
  32594. }
  32595. ,
  32596. c._parseExtensionRanges = function() {
  32597. var e, t, i, n = [];
  32598. do {
  32599. for (t = []; ; ) {
  32600. switch (e = this.tn.next()) {
  32601. case "min":
  32602. i = r.ID_MIN;
  32603. break;
  32604. case "max":
  32605. i = r.ID_MAX;
  32606. break;
  32607. default:
  32608. i = o(e)
  32609. }
  32610. if (t.push(i),
  32611. 2 === t.length)
  32612. break;
  32613. if ("to" !== this.tn.peek()) {
  32614. t.push(i);
  32615. break
  32616. }
  32617. this.tn.next()
  32618. }
  32619. n.push(t)
  32620. } while (this.tn.omit(","));return this.tn.skip(";"),
  32621. n
  32622. }
  32623. ,
  32624. c._parseExtend = function(e) {
  32625. var t = this.tn.next();
  32626. if (!a.TYPEREF.test(t))
  32627. throw Error("illegal extend reference: " + t);
  32628. var i = {
  32629. ref: t,
  32630. fields: []
  32631. };
  32632. for (this.tn.skip("{"); "}" !== (t = this.tn.next()); )
  32633. if (a.RULE.test(t))
  32634. this._parseMessageField(i, t);
  32635. else {
  32636. if (!a.TYPEREF.test(t))
  32637. throw Error("illegal extend token: " + t);
  32638. if (!this.proto3)
  32639. throw Error("illegal field rule: " + t);
  32640. this._parseMessageField(i, "optional", t)
  32641. }
  32642. return this.tn.omit(";"),
  32643. e.messages.push(i),
  32644. i
  32645. }
  32646. ,
  32647. c.toString = function() {
  32648. return "Parser at line " + this.tn.line
  32649. }
  32650. ,
  32651. e.Parser = l,
  32652. e
  32653. }(o, o.Lang),
  32654. o.Reflect = function(g) {
  32655. function a(e, t) {
  32656. if (e && "number" == typeof e.low && "number" == typeof e.high && "boolean" == typeof e.unsigned && e.low == e.low && e.high == e.high)
  32657. return new g.Long(e.low,e.high,void 0 === t ? e.unsigned : t);
  32658. if ("string" == typeof e)
  32659. return g.Long.fromString(e, t || !1, 10);
  32660. if ("number" == typeof e)
  32661. return g.Long.fromNumber(e, t || !1);
  32662. throw Error("not convertible to Long")
  32663. }
  32664. function m(e, t) {
  32665. var i = t.readVarint32()
  32666. , n = 7 & i
  32667. , r = i >>> 3;
  32668. switch (n) {
  32669. case g.WIRE_TYPES.VARINT:
  32670. for (; 128 == (128 & (i = t.readUint8())); )
  32671. ;
  32672. break;
  32673. case g.WIRE_TYPES.BITS64:
  32674. t.offset += 8;
  32675. break;
  32676. case g.WIRE_TYPES.LDELIM:
  32677. i = t.readVarint32(),
  32678. t.offset += i;
  32679. break;
  32680. case g.WIRE_TYPES.STARTGROUP:
  32681. m(r, t);
  32682. break;
  32683. case g.WIRE_TYPES.ENDGROUP:
  32684. if (r === e)
  32685. return !1;
  32686. throw Error("Illegal GROUPEND after unknown group: " + r + " (" + e + " expected)");
  32687. case g.WIRE_TYPES.BITS32:
  32688. t.offset += 4;
  32689. break;
  32690. default:
  32691. throw Error("Illegal wire type in unknown group " + e + ": " + n)
  32692. }
  32693. return !0
  32694. }
  32695. function h(e, t, i) {
  32696. this.builder = e,
  32697. this.parent = t,
  32698. this.name = i,
  32699. this.className
  32700. }
  32701. var s = {}
  32702. , e = h.prototype;
  32703. e.fqn = function() {
  32704. for (var e = this.name, t = this; null != (t = t.parent); )
  32705. e = t.name + "." + e;
  32706. return e
  32707. }
  32708. ,
  32709. e.toString = function(e) {
  32710. return (e ? this.className + " " : "") + this.fqn()
  32711. }
  32712. ,
  32713. e.build = function() {
  32714. throw Error(this.toString(!0) + " cannot be built directly")
  32715. }
  32716. ,
  32717. s.T = h;
  32718. function l(e, t, i, n, r) {
  32719. h.call(this, e, t, i),
  32720. this.className = "Namespace",
  32721. this.children = [],
  32722. this.options = n || {},
  32723. this.syntax = r || "proto2"
  32724. }
  32725. var t = l.prototype = Object.create(h.prototype);
  32726. t.getChildren = function(e) {
  32727. if (null == (e = e || null))
  32728. return this.children.slice();
  32729. for (var t = [], i = 0, n = this.children.length; i < n; ++i)
  32730. this.children[i]instanceof e && t.push(this.children[i]);
  32731. return t
  32732. }
  32733. ,
  32734. t.addChild = function(e) {
  32735. var t;
  32736. if (t = this.getChild(e.name))
  32737. if (t instanceof d.Field && t.name !== t.originalName && null === this.getChild(t.originalName))
  32738. t.name = t.originalName;
  32739. else {
  32740. if (!(e instanceof d.Field && e.name !== e.originalName && null === this.getChild(e.originalName)))
  32741. throw Error("Duplicate name in namespace " + this.toString(!0) + ": " + e.name);
  32742. e.name = e.originalName
  32743. }
  32744. this.children.push(e)
  32745. }
  32746. ,
  32747. t.getChild = function(e) {
  32748. for (var t = "number" == typeof e ? "id" : "name", i = 0, n = this.children.length; i < n; ++i)
  32749. if (this.children[i][t] === e)
  32750. return this.children[i];
  32751. return null
  32752. }
  32753. ,
  32754. t.resolve = function(e, t) {
  32755. var i, n = "string" == typeof e ? e.split(".") : e, r = this, o = 0;
  32756. if ("" === n[o]) {
  32757. for (; null !== r.parent; )
  32758. r = r.parent;
  32759. o++
  32760. }
  32761. do {
  32762. do {
  32763. if (!(r instanceof s.Namespace)) {
  32764. r = null;
  32765. break
  32766. }
  32767. if (!(i = r.getChild(n[o])) || !(i instanceof s.T) || t && !(i instanceof s.Namespace)) {
  32768. r = null;
  32769. break
  32770. }
  32771. r = i,
  32772. o++
  32773. } while (o < n.length);if (null != r)
  32774. break;
  32775. if (null !== this.parent)
  32776. return this.parent.resolve(e, t)
  32777. } while (null != r);return r
  32778. }
  32779. ,
  32780. t.qn = function(e) {
  32781. for (var t = [], i = e; t.unshift(i.name),
  32782. null !== (i = i.parent); )
  32783. ;
  32784. for (var n = 1; n <= t.length; n++) {
  32785. var r = t.slice(t.length - n);
  32786. if (e === this.resolve(r, e instanceof s.Namespace))
  32787. return r.join(".")
  32788. }
  32789. return e.fqn()
  32790. }
  32791. ,
  32792. t.build = function() {
  32793. for (var e, t = {}, i = this.children, n = 0, r = i.length; n < r; ++n)
  32794. (e = i[n])instanceof l && (t[e.name] = e.build());
  32795. return Object.defineProperty && Object.defineProperty(t, "$options", {
  32796. value: this.buildOpt()
  32797. }),
  32798. t
  32799. }
  32800. ,
  32801. t.buildOpt = function() {
  32802. for (var e = {}, t = Object.keys(this.options), i = 0, n = t.length; i < n; ++i) {
  32803. var r = t[i]
  32804. , o = this.options[t[i]];
  32805. e[r] = o
  32806. }
  32807. return e
  32808. }
  32809. ,
  32810. t.getOption = function(e) {
  32811. return void 0 === e ? this.options : void 0 !== this.options[e] ? this.options[e] : null
  32812. }
  32813. ,
  32814. s.Namespace = l;
  32815. function u(e, t, i, n) {
  32816. if (this.type = e,
  32817. this.resolvedType = t,
  32818. this.isMapKey = i,
  32819. this.syntax = n,
  32820. i && g.MAP_KEY_TYPES.indexOf(e) < 0)
  32821. throw Error("Invalid map key type: " + e.name)
  32822. }
  32823. var i = u.prototype;
  32824. u.defaultFieldValue = function(e) {
  32825. if ("string" == typeof e && (e = g.TYPES[e]),
  32826. void 0 === e.defaultValue)
  32827. throw Error("default value for type " + e.name + " is not supported");
  32828. return e == g.TYPES.bytes ? new I(0) : e.defaultValue
  32829. }
  32830. ,
  32831. i.verifyValue = function(t) {
  32832. function i(e, t) {
  32833. throw Error("Illegal value for " + n.toString(!0) + " of type " + n.type.name + ": " + e + " (" + t + ")")
  32834. }
  32835. var n = this;
  32836. switch (this.type) {
  32837. case g.TYPES.int32:
  32838. case g.TYPES.sint32:
  32839. case g.TYPES.sfixed32:
  32840. return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"),
  32841. 4294967295 < t ? 0 | t : t;
  32842. case g.TYPES.uint32:
  32843. case g.TYPES.fixed32:
  32844. return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"),
  32845. t < 0 ? t >>> 0 : t;
  32846. case g.TYPES.int64:
  32847. case g.TYPES.sint64:
  32848. case g.TYPES.sfixed64:
  32849. if (g.Long)
  32850. try {
  32851. return a(t, !1)
  32852. } catch (e) {
  32853. i(typeof t, e.message)
  32854. }
  32855. else
  32856. i(typeof t, "requires Long.js");
  32857. case g.TYPES.uint64:
  32858. case g.TYPES.fixed64:
  32859. if (g.Long)
  32860. try {
  32861. return a(t, !0)
  32862. } catch (e) {
  32863. i(typeof t, e.message)
  32864. }
  32865. else
  32866. i(typeof t, "requires Long.js");
  32867. case g.TYPES.bool:
  32868. return "boolean" != typeof t && i(typeof t, "not a boolean"),
  32869. t;
  32870. case g.TYPES.float:
  32871. case g.TYPES.double:
  32872. return "number" != typeof t && i(typeof t, "not a number"),
  32873. t;
  32874. case g.TYPES.string:
  32875. return "string" == typeof t || t && t instanceof String || i(typeof t, "not a string"),
  32876. "" + t;
  32877. case g.TYPES.bytes:
  32878. return I.isByteBuffer(t) ? t : I.wrap(t, "base64");
  32879. case g.TYPES.enum:
  32880. var e = this.resolvedType.getChildren(g.Reflect.Enum.Value);
  32881. for (o = 0; o < e.length; o++) {
  32882. if (e[o].name == t)
  32883. return e[o].id;
  32884. if (e[o].id == t)
  32885. return e[o].id
  32886. }
  32887. if ("proto3" === this.syntax)
  32888. return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"),
  32889. (4294967295 < t || t < 0) && i(typeof t, "not in range for uint32"),
  32890. t;
  32891. i(t, "not a valid enum value");
  32892. case g.TYPES.group:
  32893. case g.TYPES.message:
  32894. if (t && "object" == typeof t || i(typeof t, "object expected"),
  32895. t instanceof this.resolvedType.clazz)
  32896. return t;
  32897. if (t instanceof g.Builder.Message) {
  32898. var r = {};
  32899. for (var o in t)
  32900. t.hasOwnProperty(o) && (r[o] = t[o]);
  32901. t = r
  32902. }
  32903. return new this.resolvedType.clazz(t)
  32904. }
  32905. throw Error("[INTERNAL] Illegal value for " + this.toString(!0) + ": " + t + " (undefined type " + this.type + ")")
  32906. }
  32907. ,
  32908. i.calculateLength = function(e, t) {
  32909. if (null === t)
  32910. return 0;
  32911. var i;
  32912. switch (this.type) {
  32913. case g.TYPES.int32:
  32914. return t < 0 ? I.calculateVarint64(t) : I.calculateVarint32(t);
  32915. case g.TYPES.uint32:
  32916. return I.calculateVarint32(t);
  32917. case g.TYPES.sint32:
  32918. return I.calculateVarint32(I.zigZagEncode32(t));
  32919. case g.TYPES.fixed32:
  32920. case g.TYPES.sfixed32:
  32921. case g.TYPES.float:
  32922. return 4;
  32923. case g.TYPES.int64:
  32924. case g.TYPES.uint64:
  32925. return I.calculateVarint64(t);
  32926. case g.TYPES.sint64:
  32927. return I.calculateVarint64(I.zigZagEncode64(t));
  32928. case g.TYPES.fixed64:
  32929. case g.TYPES.sfixed64:
  32930. return 8;
  32931. case g.TYPES.bool:
  32932. return 1;
  32933. case g.TYPES.enum:
  32934. return I.calculateVarint32(t);
  32935. case g.TYPES.double:
  32936. return 8;
  32937. case g.TYPES.string:
  32938. return i = I.calculateUTF8Bytes(t),
  32939. I.calculateVarint32(i) + i;
  32940. case g.TYPES.bytes:
  32941. if (t.remaining() < 0)
  32942. throw Error("Illegal value for " + this.toString(!0) + ": " + t.remaining() + " bytes remaining");
  32943. return I.calculateVarint32(t.remaining()) + t.remaining();
  32944. case g.TYPES.message:
  32945. return i = this.resolvedType.calculate(t),
  32946. I.calculateVarint32(i) + i;
  32947. case g.TYPES.group:
  32948. return (i = this.resolvedType.calculate(t)) + I.calculateVarint32(e << 3 | g.WIRE_TYPES.ENDGROUP)
  32949. }
  32950. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + t + " (unknown type)")
  32951. }
  32952. ,
  32953. i.encodeValue = function(e, t, i) {
  32954. if (null === t)
  32955. return i;
  32956. switch (this.type) {
  32957. case g.TYPES.int32:
  32958. t < 0 ? i.writeVarint64(t) : i.writeVarint32(t);
  32959. break;
  32960. case g.TYPES.uint32:
  32961. i.writeVarint32(t);
  32962. break;
  32963. case g.TYPES.sint32:
  32964. i.writeVarint32ZigZag(t);
  32965. break;
  32966. case g.TYPES.fixed32:
  32967. i.writeUint32(t);
  32968. break;
  32969. case g.TYPES.sfixed32:
  32970. i.writeInt32(t);
  32971. break;
  32972. case g.TYPES.int64:
  32973. case g.TYPES.uint64:
  32974. i.writeVarint64(t);
  32975. break;
  32976. case g.TYPES.sint64:
  32977. i.writeVarint64ZigZag(t);
  32978. break;
  32979. case g.TYPES.fixed64:
  32980. i.writeUint64(t);
  32981. break;
  32982. case g.TYPES.sfixed64:
  32983. i.writeInt64(t);
  32984. break;
  32985. case g.TYPES.bool:
  32986. "string" == typeof t ? i.writeVarint32("false" === t.toLowerCase() ? 0 : !!t) : i.writeVarint32(t ? 1 : 0);
  32987. break;
  32988. case g.TYPES.enum:
  32989. i.writeVarint32(t);
  32990. break;
  32991. case g.TYPES.float:
  32992. i.writeFloat32(t);
  32993. break;
  32994. case g.TYPES.double:
  32995. i.writeFloat64(t);
  32996. break;
  32997. case g.TYPES.string:
  32998. i.writeVString(t);
  32999. break;
  33000. case g.TYPES.bytes:
  33001. if (t.remaining() < 0)
  33002. throw Error("Illegal value for " + this.toString(!0) + ": " + t.remaining() + " bytes remaining");
  33003. var n = t.offset;
  33004. i.writeVarint32(t.remaining()),
  33005. i.append(t),
  33006. t.offset = n;
  33007. break;
  33008. case g.TYPES.message:
  33009. var r = (new I).LE();
  33010. this.resolvedType.encode(t, r),
  33011. i.writeVarint32(r.offset),
  33012. i.append(r.flip());
  33013. break;
  33014. case g.TYPES.group:
  33015. this.resolvedType.encode(t, i),
  33016. i.writeVarint32(e << 3 | g.WIRE_TYPES.ENDGROUP);
  33017. break;
  33018. default:
  33019. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + t + " (unknown type)")
  33020. }
  33021. return i
  33022. }
  33023. ,
  33024. i.decode = function(e, t, i) {
  33025. if (t != this.type.wireType)
  33026. throw Error("Unexpected wire type for element");
  33027. var n, r;
  33028. switch (this.type) {
  33029. case g.TYPES.int32:
  33030. return 0 | e.readVarint32();
  33031. case g.TYPES.uint32:
  33032. return e.readVarint32() >>> 0;
  33033. case g.TYPES.sint32:
  33034. return 0 | e.readVarint32ZigZag();
  33035. case g.TYPES.fixed32:
  33036. return e.readUint32() >>> 0;
  33037. case g.TYPES.sfixed32:
  33038. return 0 | e.readInt32();
  33039. case g.TYPES.int64:
  33040. return e.readVarint64();
  33041. case g.TYPES.uint64:
  33042. return e.readVarint64().toUnsigned();
  33043. case g.TYPES.sint64:
  33044. return e.readVarint64ZigZag();
  33045. case g.TYPES.fixed64:
  33046. return e.readUint64();
  33047. case g.TYPES.sfixed64:
  33048. return e.readInt64();
  33049. case g.TYPES.bool:
  33050. return !!e.readVarint32();
  33051. case g.TYPES.enum:
  33052. return e.readVarint32();
  33053. case g.TYPES.float:
  33054. return e.readFloat();
  33055. case g.TYPES.double:
  33056. return e.readDouble();
  33057. case g.TYPES.string:
  33058. return e.readVString();
  33059. case g.TYPES.bytes:
  33060. if (r = e.readVarint32(),
  33061. e.remaining() < r)
  33062. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + r + " required but got only " + e.remaining());
  33063. return (n = e.clone()).limit = n.offset + r,
  33064. e.offset += r,
  33065. n;
  33066. case g.TYPES.message:
  33067. return r = e.readVarint32(),
  33068. this.resolvedType.decode(e, r);
  33069. case g.TYPES.group:
  33070. return this.resolvedType.decode(e, -1, i)
  33071. }
  33072. throw Error("[INTERNAL] Illegal decode type")
  33073. }
  33074. ,
  33075. i.valueFromString = function(e) {
  33076. if (!this.isMapKey)
  33077. throw Error("valueFromString() called on non-map-key element");
  33078. switch (this.type) {
  33079. case g.TYPES.int32:
  33080. case g.TYPES.sint32:
  33081. case g.TYPES.sfixed32:
  33082. case g.TYPES.uint32:
  33083. case g.TYPES.fixed32:
  33084. return this.verifyValue(parseInt(e));
  33085. case g.TYPES.int64:
  33086. case g.TYPES.sint64:
  33087. case g.TYPES.sfixed64:
  33088. case g.TYPES.uint64:
  33089. case g.TYPES.fixed64:
  33090. return this.verifyValue(e);
  33091. case g.TYPES.bool:
  33092. return "true" === e;
  33093. case g.TYPES.string:
  33094. return this.verifyValue(e);
  33095. case g.TYPES.bytes:
  33096. return I.fromBinary(e)
  33097. }
  33098. }
  33099. ,
  33100. i.valueToString = function(e) {
  33101. if (!this.isMapKey)
  33102. throw Error("valueToString() called on non-map-key element");
  33103. return this.type === g.TYPES.bytes ? e.toString("binary") : e.toString()
  33104. }
  33105. ,
  33106. s.Element = u;
  33107. var d = function(e, t, i, n, r, o) {
  33108. l.call(this, e, t, i, n, o),
  33109. this.className = "Message",
  33110. this.extensions = void 0,
  33111. this.clazz = null,
  33112. this.isGroup = !!r,
  33113. this._fields = null,
  33114. this._fieldsById = null,
  33115. this._fieldsByName = null
  33116. }
  33117. , n = d.prototype = Object.create(l.prototype);
  33118. n.build = function(e) {
  33119. if (this.clazz && !e)
  33120. return this.clazz;
  33121. var t = function(u, a) {
  33122. function d(e, i, n, r) {
  33123. if (null === e || "object" != typeof e) {
  33124. if (r && r instanceof u.Reflect.Enum) {
  33125. var t = u.Reflect.Enum.getName(r.object, e);
  33126. if (null !== t)
  33127. return t
  33128. }
  33129. return e
  33130. }
  33131. if (I.isByteBuffer(e))
  33132. return i ? e.toBase64() : e.toBuffer();
  33133. if (u.Long.isLong(e))
  33134. return n ? e.toString() : u.Long.fromValue(e);
  33135. var o;
  33136. if (Array.isArray(e))
  33137. return o = [],
  33138. e.forEach(function(e, t) {
  33139. o[t] = d(e, i, n, r)
  33140. }),
  33141. o;
  33142. if (o = {},
  33143. e instanceof u.Map) {
  33144. for (var a = e.entries(), s = a.next(); !s.done; s = a.next())
  33145. o[e.keyElem.valueToString(s.value[0])] = d(s.value[1], i, n, e.valueElem.resolvedType);
  33146. return o
  33147. }
  33148. var l = e.$type
  33149. , c = void 0;
  33150. for (var h in e)
  33151. e.hasOwnProperty(h) && (l && (c = l.getChild(h)) ? o[h] = d(e[h], i, n, c.resolvedType) : o[h] = d(e[h], i, n));
  33152. return o
  33153. }
  33154. var s = a.getChildren(u.Reflect.Message.Field)
  33155. , l = a.getChildren(u.Reflect.Message.OneOf)
  33156. , c = function(e, t) {
  33157. u.Builder.Message.call(this);
  33158. for (var i = 0, n = l.length; i < n; ++i)
  33159. this[l[i].name] = null;
  33160. for (i = 0,
  33161. n = s.length; i < n; ++i) {
  33162. var r = s[i];
  33163. this[r.name] = r.repeated ? [] : r.map ? new u.Map(r) : null,
  33164. !r.required && "proto3" !== a.syntax || null === r.defaultValue || (this[r.name] = r.defaultValue)
  33165. }
  33166. var o;
  33167. if (0 < arguments.length)
  33168. 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)
  33169. for (i = 0,
  33170. n = arguments.length; i < n; ++i)
  33171. void 0 !== (o = arguments[i]) && this.$set(s[i].name, o);
  33172. else
  33173. this.$set(e)
  33174. }
  33175. , o = c.prototype = Object.create(u.Builder.Message.prototype);
  33176. o.add = function(e, t, i) {
  33177. var n = a._fieldsByName[e];
  33178. if (!i) {
  33179. if (!n)
  33180. throw Error(this + "#" + e + " is undefined");
  33181. if (!(n instanceof u.Reflect.Message.Field))
  33182. throw Error(this + "#" + e + " is not a field: " + n.toString(!0));
  33183. if (!n.repeated)
  33184. throw Error(this + "#" + e + " is not a repeated field");
  33185. t = n.verifyValue(t, !0)
  33186. }
  33187. return null === this[e] && (this[e] = []),
  33188. this[e].push(t),
  33189. this
  33190. }
  33191. ,
  33192. o.$add = o.add,
  33193. o.set = function(e, t, i) {
  33194. if (e && "object" == typeof e) {
  33195. for (var n in i = t,
  33196. e)
  33197. e.hasOwnProperty(n) && void 0 !== (t = e[n]) && this.$set(n, t, i);
  33198. return this
  33199. }
  33200. var r = a._fieldsByName[e];
  33201. if (i)
  33202. this[e] = t;
  33203. else {
  33204. if (!r)
  33205. throw Error(this + "#" + e + " is not a field: undefined");
  33206. if (!(r instanceof u.Reflect.Message.Field))
  33207. throw Error(this + "#" + e + " is not a field: " + r.toString(!0));
  33208. this[r.name] = t = r.verifyValue(t)
  33209. }
  33210. if (r && r.oneof) {
  33211. var o = this[r.oneof.name];
  33212. null !== t ? (null !== o && o !== r.name && (this[o] = null),
  33213. this[r.oneof.name] = r.name) : o === e && (this[r.oneof.name] = null)
  33214. }
  33215. return this
  33216. }
  33217. ,
  33218. o.$set = o.set,
  33219. o.get = function(e, t) {
  33220. if (t)
  33221. return this[e];
  33222. var i = a._fieldsByName[e];
  33223. if (!(i && i instanceof u.Reflect.Message.Field))
  33224. throw Error(this + "#" + e + " is not a field: undefined");
  33225. if (!(i instanceof u.Reflect.Message.Field))
  33226. throw Error(this + "#" + e + " is not a field: " + i.toString(!0));
  33227. return this[i.name]
  33228. }
  33229. ,
  33230. o.$get = o.get;
  33231. for (var e = 0; e < s.length; e++) {
  33232. var t = s[e];
  33233. t instanceof u.Reflect.Message.ExtensionField || a.builder.options.populateAccessors && function(i) {
  33234. var e = i.originalName.replace(/(_[a-zA-Z])/g, function(e) {
  33235. return e.toUpperCase().replace("_", "")
  33236. });
  33237. e = e.substring(0, 1).toUpperCase() + e.substring(1);
  33238. function t(e, t) {
  33239. return this[i.name] = t ? e : i.verifyValue(e),
  33240. this
  33241. }
  33242. function n() {
  33243. return this[i.name]
  33244. }
  33245. var r = i.originalName.replace(/([A-Z])/g, function(e) {
  33246. return "_" + e
  33247. });
  33248. null === a.getChild("set" + e) && (o["set" + e] = t),
  33249. null === a.getChild("set_" + r) && (o["set_" + r] = t),
  33250. null === a.getChild("get" + e) && (o["get" + e] = n),
  33251. null === a.getChild("get_" + r) && (o["get_" + r] = n)
  33252. }(t)
  33253. }
  33254. return o.encode = function(t, e) {
  33255. "boolean" == typeof t && (e = t,
  33256. t = void 0);
  33257. var i = !1;
  33258. t || (t = new I,
  33259. i = !0);
  33260. var n = t.littleEndian;
  33261. try {
  33262. return a.encode(this, t.LE(), e),
  33263. (i ? t.flip() : t).LE(n)
  33264. } catch (e) {
  33265. throw t.LE(n),
  33266. e
  33267. }
  33268. }
  33269. ,
  33270. c.encode = function(e, t, i) {
  33271. return new c(e).encode(t, i)
  33272. }
  33273. ,
  33274. o.calculate = function() {
  33275. return a.calculate(this)
  33276. }
  33277. ,
  33278. o.encodeDelimited = function(e, t) {
  33279. var i = !1;
  33280. e || (e = new I,
  33281. i = !0);
  33282. var n = (new I).LE();
  33283. return a.encode(this, n, t).flip(),
  33284. e.writeVarint32(n.remaining()),
  33285. e.append(n),
  33286. i ? e.flip() : e
  33287. }
  33288. ,
  33289. o.encodeAB = function() {
  33290. try {
  33291. return this.encode().toArrayBuffer()
  33292. } catch (e) {
  33293. throw e.encoded && (e.encoded = e.encoded.toArrayBuffer()),
  33294. e
  33295. }
  33296. }
  33297. ,
  33298. o.toArrayBuffer = o.encodeAB,
  33299. o.encodeNB = function() {
  33300. try {
  33301. return this.encode().toBuffer()
  33302. } catch (e) {
  33303. throw e.encoded && (e.encoded = e.encoded.toBuffer()),
  33304. e
  33305. }
  33306. }
  33307. ,
  33308. o.toBuffer = o.encodeNB,
  33309. o.encode64 = function() {
  33310. try {
  33311. return this.encode().toBase64()
  33312. } catch (e) {
  33313. throw e.encoded && (e.encoded = e.encoded.toBase64()),
  33314. e
  33315. }
  33316. }
  33317. ,
  33318. o.toBase64 = o.encode64,
  33319. o.encodeHex = function() {
  33320. try {
  33321. return this.encode().toHex()
  33322. } catch (e) {
  33323. throw e.encoded && (e.encoded = e.encoded.toHex()),
  33324. e
  33325. }
  33326. }
  33327. ,
  33328. o.toHex = o.encodeHex,
  33329. o.toRaw = function(e, t) {
  33330. return d(this, !!e, !!t, this.$type)
  33331. }
  33332. ,
  33333. o.encodeJSON = function() {
  33334. return JSON.stringify(d(this, !0, !0, this.$type))
  33335. }
  33336. ,
  33337. c.decode = function(t, e, i) {
  33338. "string" == typeof e && (i = e,
  33339. e = -1),
  33340. "string" == typeof t && (t = I.wrap(t, i || "base64"));
  33341. var n = (t = I.isByteBuffer(t) ? t : I.wrap(t)).littleEndian;
  33342. try {
  33343. var r = a.decode(t.LE());
  33344. return t.LE(n),
  33345. r
  33346. } catch (e) {
  33347. throw t.LE(n),
  33348. e
  33349. }
  33350. }
  33351. ,
  33352. c.decodeDelimited = function(t, e) {
  33353. if ("string" == typeof t && (t = I.wrap(t, e || "base64")),
  33354. (t = I.isByteBuffer(t) ? t : I.wrap(t)).remaining() < 1)
  33355. return null;
  33356. var i = t.offset
  33357. , n = t.readVarint32();
  33358. if (t.remaining() < n)
  33359. return t.offset = i,
  33360. null;
  33361. try {
  33362. var r = a.decode(t.slice(t.offset, t.offset + n).LE());
  33363. return t.offset += n,
  33364. r
  33365. } catch (e) {
  33366. throw t.offset += n,
  33367. e
  33368. }
  33369. }
  33370. ,
  33371. c.decode64 = function(e) {
  33372. return c.decode(e, "base64")
  33373. }
  33374. ,
  33375. c.decodeHex = function(e) {
  33376. return c.decode(e, "hex")
  33377. }
  33378. ,
  33379. c.decodeJSON = function(e) {
  33380. return new c(JSON.parse(e))
  33381. }
  33382. ,
  33383. o.toString = function() {
  33384. return a.toString()
  33385. }
  33386. ,
  33387. Object.defineProperty && (Object.defineProperty(c, "$options", {
  33388. value: a.buildOpt()
  33389. }),
  33390. Object.defineProperty(o, "$options", {
  33391. value: c.$options
  33392. }),
  33393. Object.defineProperty(c, "$type", {
  33394. value: a
  33395. }),
  33396. Object.defineProperty(o, "$type", {
  33397. value: a
  33398. })),
  33399. c
  33400. }(g, this);
  33401. this._fields = [],
  33402. this._fieldsById = {},
  33403. this._fieldsByName = {};
  33404. for (var i, n = 0, r = this.children.length; n < r; n++)
  33405. if ((i = this.children[n])instanceof p || i instanceof d || i instanceof y) {
  33406. if (t.hasOwnProperty(i.name))
  33407. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + i.toString(!0) + " cannot override static property '" + i.name + "'");
  33408. t[i.name] = i.build()
  33409. } else if (i instanceof d.Field)
  33410. i.build(),
  33411. this._fields.push(i),
  33412. this._fieldsById[i.id] = i,
  33413. this._fieldsByName[i.name] = i;
  33414. else if (!(i instanceof d.OneOf || i instanceof v))
  33415. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + this.children[n].toString(!0));
  33416. return this.clazz = t
  33417. }
  33418. ,
  33419. n.encode = function(e, t, i) {
  33420. for (var n, r, o = null, a = 0, s = this._fields.length; a < s; ++a)
  33421. r = e[(n = this._fields[a]).name],
  33422. n.required && null === r ? null === o && (o = n) : n.encode(i ? r : n.verifyValue(r), t, e);
  33423. if (null === o)
  33424. return t;
  33425. var l = Error("Missing at least one required field for " + this.toString(!0) + ": " + o);
  33426. throw l.encoded = t,
  33427. l
  33428. }
  33429. ,
  33430. n.calculate = function(e) {
  33431. for (var t, i, n = 0, r = 0, o = this._fields.length; r < o; ++r) {
  33432. if (i = e[(t = this._fields[r]).name],
  33433. t.required && null === i)
  33434. throw Error("Missing at least one required field for " + this.toString(!0) + ": " + t);
  33435. n += t.calculate(i, e)
  33436. }
  33437. return n
  33438. }
  33439. ,
  33440. n.decode = function(e, t, i) {
  33441. t = "number" == typeof t ? t : -1;
  33442. for (var n, r, o, a, s = e.offset, l = new this.clazz; e.offset < s + t || -1 === t && 0 < e.remaining(); ) {
  33443. if (o = (n = e.readVarint32()) >>> 3,
  33444. (r = 7 & n) === g.WIRE_TYPES.ENDGROUP) {
  33445. if (o !== i)
  33446. throw Error("Illegal group end indicator for " + this.toString(!0) + ": " + o + " (" + (i ? i + " expected" : "not a group") + ")");
  33447. break
  33448. }
  33449. if (a = this._fieldsById[o]) {
  33450. if (a.repeated && !a.options.packed)
  33451. l[a.name].push(a.decode(r, e));
  33452. else if (a.map) {
  33453. var c = a.decode(r, e);
  33454. l[a.name].set(c[0], c[1])
  33455. } else if (l[a.name] = a.decode(r, e),
  33456. a.oneof) {
  33457. var h = l[a.oneof.name];
  33458. null !== h && h !== a.name && (l[h] = null),
  33459. l[a.oneof.name] = a.name
  33460. }
  33461. } else
  33462. switch (r) {
  33463. case g.WIRE_TYPES.VARINT:
  33464. e.readVarint32();
  33465. break;
  33466. case g.WIRE_TYPES.BITS32:
  33467. e.offset += 4;
  33468. break;
  33469. case g.WIRE_TYPES.BITS64:
  33470. e.offset += 8;
  33471. break;
  33472. case g.WIRE_TYPES.LDELIM:
  33473. var u = e.readVarint32();
  33474. e.offset += u;
  33475. break;
  33476. case g.WIRE_TYPES.STARTGROUP:
  33477. for (; m(o, e); )
  33478. ;
  33479. break;
  33480. default:
  33481. throw Error("Illegal wire type for unknown field " + o + " in " + this.toString(!0) + "#decode: " + r)
  33482. }
  33483. }
  33484. for (var d = 0, p = this._fields.length; d < p; ++d)
  33485. if (null === l[(a = this._fields[d]).name])
  33486. if ("proto3" === this.syntax)
  33487. l[a.name] = a.defaultValue;
  33488. else {
  33489. if (a.required) {
  33490. var f = Error("Missing at least one required field for " + this.toString(!0) + ": " + a.name);
  33491. throw f.decoded = l,
  33492. f
  33493. }
  33494. g.populateDefaults && null !== a.defaultValue && (l[a.name] = a.defaultValue)
  33495. }
  33496. return l
  33497. }
  33498. ,
  33499. s.Message = d;
  33500. function c(e, t, i, n, r, o, a, s, l, c) {
  33501. h.call(this, e, t, o),
  33502. this.className = "Message.Field",
  33503. this.required = "required" === i,
  33504. this.repeated = "repeated" === i,
  33505. this.map = "map" === i,
  33506. this.keyType = n || null,
  33507. this.type = r,
  33508. this.resolvedType = null,
  33509. this.id = a,
  33510. this.options = s || {},
  33511. this.defaultValue = null,
  33512. this.oneof = l || null,
  33513. this.syntax = c || "proto2",
  33514. this.originalName = this.name,
  33515. this.element = null,
  33516. this.keyElement = null,
  33517. !this.builder.options.convertFieldsToCamelCase || this instanceof d.ExtensionField || (this.name = g.Util.toCamelCase(this.name))
  33518. }
  33519. var r = c.prototype = Object.create(h.prototype);
  33520. r.build = function() {
  33521. this.element = new u(this.type,this.resolvedType,!1,this.syntax),
  33522. this.map && (this.keyElement = new u(this.keyType,void 0,!0,this.syntax)),
  33523. "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)
  33524. }
  33525. ,
  33526. r.verifyValue = function(e, t) {
  33527. function i(e, t) {
  33528. throw Error("Illegal value for " + r.toString(!0) + " of type " + r.type.name + ": " + e + " (" + t + ")")
  33529. }
  33530. t = t || !1;
  33531. var n, r = this;
  33532. if (null === e)
  33533. return this.required && i(typeof e, "required"),
  33534. "proto3" === this.syntax && this.type !== g.TYPES.message && i(typeof e, "proto3 field without field presence cannot be null"),
  33535. null;
  33536. if (!this.repeated || t)
  33537. return this.map && !t ? e instanceof g.Map ? e : (e instanceof Object || i(typeof e, "expected ProtoBuf.Map or raw object for map field"),
  33538. new g.Map(this,e)) : (!this.repeated && Array.isArray(e) && i(typeof e, "no array expected"),
  33539. this.element.verifyValue(e));
  33540. Array.isArray(e) || (e = [e]);
  33541. var o = [];
  33542. for (n = 0; n < e.length; n++)
  33543. o.push(this.element.verifyValue(e[n]));
  33544. return o
  33545. }
  33546. ,
  33547. r.hasWirePresence = function(e, t) {
  33548. if ("proto3" !== this.syntax)
  33549. return null !== e;
  33550. if (this.oneof && t[this.oneof.name] === this.name)
  33551. return !0;
  33552. switch (this.type) {
  33553. case g.TYPES.int32:
  33554. case g.TYPES.sint32:
  33555. case g.TYPES.sfixed32:
  33556. case g.TYPES.uint32:
  33557. case g.TYPES.fixed32:
  33558. return 0 !== e;
  33559. case g.TYPES.int64:
  33560. case g.TYPES.sint64:
  33561. case g.TYPES.sfixed64:
  33562. case g.TYPES.uint64:
  33563. case g.TYPES.fixed64:
  33564. return 0 !== e.low || 0 !== e.high;
  33565. case g.TYPES.bool:
  33566. return e;
  33567. case g.TYPES.float:
  33568. case g.TYPES.double:
  33569. return 0 !== e;
  33570. case g.TYPES.string:
  33571. return 0 < e.length;
  33572. case g.TYPES.bytes:
  33573. return 0 < e.remaining();
  33574. case g.TYPES.enum:
  33575. return 0 !== e;
  33576. case g.TYPES.message:
  33577. return null !== e;
  33578. default:
  33579. return !0
  33580. }
  33581. }
  33582. ,
  33583. r.encode = function(t, r, e) {
  33584. if (null === this.type || "object" != typeof this.type)
  33585. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  33586. if (null === t || this.repeated && 0 == t.length)
  33587. return r;
  33588. try {
  33589. var i;
  33590. if (this.repeated)
  33591. if (this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)) {
  33592. r.writeVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  33593. r.ensureCapacity(r.offset += 1);
  33594. var n = r.offset;
  33595. for (i = 0; i < t.length; i++)
  33596. this.element.encodeValue(this.id, t[i], r);
  33597. var o = r.offset - n
  33598. , a = I.calculateVarint32(o);
  33599. if (1 < a) {
  33600. var s = r.slice(n, r.offset);
  33601. n += a - 1,
  33602. r.offset = n,
  33603. r.append(s)
  33604. }
  33605. r.writeVarint32(o, n - a)
  33606. } else
  33607. for (i = 0; i < t.length; i++)
  33608. r.writeVarint32(this.id << 3 | this.type.wireType),
  33609. this.element.encodeValue(this.id, t[i], r);
  33610. else
  33611. this.map ? t.forEach(function(e, t, i) {
  33612. var n = I.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, t) + I.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, e);
  33613. r.writeVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  33614. r.writeVarint32(n),
  33615. r.writeVarint32(8 | this.keyType.wireType),
  33616. this.keyElement.encodeValue(1, t, r),
  33617. r.writeVarint32(16 | this.type.wireType),
  33618. this.element.encodeValue(2, e, r)
  33619. }, this) : this.hasWirePresence(t, e) && (r.writeVarint32(this.id << 3 | this.type.wireType),
  33620. this.element.encodeValue(this.id, t, r))
  33621. } catch (e) {
  33622. throw Error("Illegal value for " + this.toString(!0) + ": " + t + " (" + e + ")")
  33623. }
  33624. return r
  33625. }
  33626. ,
  33627. r.calculate = function(t, e) {
  33628. if (t = this.verifyValue(t),
  33629. null === this.type || "object" != typeof this.type)
  33630. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  33631. if (null === t || this.repeated && 0 == t.length)
  33632. return 0;
  33633. var r = 0;
  33634. try {
  33635. var i, n;
  33636. if (this.repeated)
  33637. if (this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)) {
  33638. for (r += I.calculateVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  33639. i = n = 0; i < t.length; i++)
  33640. n += this.element.calculateLength(this.id, t[i]);
  33641. r += I.calculateVarint32(n),
  33642. r += n
  33643. } else
  33644. for (i = 0; i < t.length; i++)
  33645. r += I.calculateVarint32(this.id << 3 | this.type.wireType),
  33646. r += this.element.calculateLength(this.id, t[i]);
  33647. else
  33648. this.map ? t.forEach(function(e, t, i) {
  33649. var n = I.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, t) + I.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, e);
  33650. r += I.calculateVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  33651. r += I.calculateVarint32(n),
  33652. r += n
  33653. }, this) : this.hasWirePresence(t, e) && (r += I.calculateVarint32(this.id << 3 | this.type.wireType),
  33654. r += this.element.calculateLength(this.id, t))
  33655. } catch (e) {
  33656. throw Error("Illegal value for " + this.toString(!0) + ": " + t + " (" + e + ")")
  33657. }
  33658. return r
  33659. }
  33660. ,
  33661. r.decode = function(e, t, i) {
  33662. var n, r;
  33663. 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))
  33664. throw Error("Illegal wire type for field " + this.toString(!0) + ": " + e + " (" + this.type.wireType + " expected)");
  33665. if (e == g.WIRE_TYPES.LDELIM && this.repeated && this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) && !i) {
  33666. r = t.readVarint32(),
  33667. r = t.offset + r;
  33668. for (var o = []; t.offset < r; )
  33669. o.push(this.decode(this.type.wireType, t, !0));
  33670. return o
  33671. }
  33672. if (this.map) {
  33673. var a = u.defaultFieldValue(this.keyType);
  33674. if (n = u.defaultFieldValue(this.type),
  33675. r = t.readVarint32(),
  33676. t.remaining() < r)
  33677. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + r + " required but got only " + t.remaining());
  33678. var s = t.clone();
  33679. for (s.limit = s.offset + r,
  33680. t.offset += r; 0 < s.remaining(); ) {
  33681. var l = s.readVarint32();
  33682. e = 7 & l;
  33683. var c = l >>> 3;
  33684. if (1 == c)
  33685. a = this.keyElement.decode(s, e, c);
  33686. else {
  33687. if (2 != c)
  33688. throw Error("Unexpected tag in map field key/value submessage");
  33689. n = this.element.decode(s, e, c)
  33690. }
  33691. }
  33692. return [a, n]
  33693. }
  33694. return this.element.decode(t, e, this.id)
  33695. }
  33696. ,
  33697. s.Message.Field = c;
  33698. function o(e, t, i, n, r, o, a) {
  33699. c.call(this, e, t, i, null, n, r, o, a),
  33700. this.extension
  33701. }
  33702. o.prototype = Object.create(c.prototype),
  33703. s.Message.ExtensionField = o;
  33704. s.Message.OneOf = function(e, t, i) {
  33705. h.call(this, e, t, i),
  33706. this.fields = []
  33707. }
  33708. ;
  33709. var p = function(e, t, i, n, r) {
  33710. l.call(this, e, t, i, n, r),
  33711. this.className = "Enum",
  33712. this.object = null
  33713. };
  33714. p.getName = function(e, t) {
  33715. for (var i, n = Object.keys(e), r = 0; r < n.length; ++r)
  33716. if (e[i = n[r]] === t)
  33717. return i;
  33718. return null
  33719. }
  33720. ,
  33721. (p.prototype = Object.create(l.prototype)).build = function(e) {
  33722. if (this.object && !e)
  33723. return this.object;
  33724. for (var t = new g.Builder.Enum, i = this.getChildren(p.Value), n = 0, r = i.length; n < r; ++n)
  33725. t[i[n].name] = i[n].id;
  33726. return Object.defineProperty && Object.defineProperty(t, "$options", {
  33727. value: this.buildOpt(),
  33728. enumerable: !1
  33729. }),
  33730. this.object = t
  33731. }
  33732. ,
  33733. s.Enum = p;
  33734. function f(e, t, i, n) {
  33735. h.call(this, e, t, i),
  33736. this.className = "Enum.Value",
  33737. this.id = n
  33738. }
  33739. f.prototype = Object.create(h.prototype),
  33740. s.Enum.Value = f;
  33741. var v = function(e, t, i, n) {
  33742. h.call(this, e, t, i),
  33743. this.field = n
  33744. };
  33745. v.prototype = Object.create(h.prototype),
  33746. s.Extension = v;
  33747. var y = function(e, t, i, n) {
  33748. l.call(this, e, t, i, n),
  33749. this.className = "Service",
  33750. this.clazz = null
  33751. };
  33752. (y.prototype = Object.create(l.prototype)).build = function(e) {
  33753. return this.clazz && !e ? this.clazz : this.clazz = function(t, r) {
  33754. for (var o = function(e) {
  33755. t.Builder.Service.call(this),
  33756. this.rpcImpl = e || function(e, t, i) {
  33757. setTimeout(i.bind(this, Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")), 0)
  33758. }
  33759. }, e = o.prototype = Object.create(t.Builder.Service.prototype), i = r.getChildren(t.Reflect.Service.RPCMethod), n = 0; n < i.length; n++)
  33760. !function(n) {
  33761. e[n.name] = function(e, i) {
  33762. try {
  33763. try {
  33764. e = n.resolvedRequestType.clazz.decode(I.wrap(e))
  33765. } catch (e) {
  33766. if (!(e instanceof TypeError))
  33767. throw e
  33768. }
  33769. if (null === e || "object" != typeof e)
  33770. throw Error("Illegal arguments");
  33771. e instanceof n.resolvedRequestType.clazz || (e = new n.resolvedRequestType.clazz(e)),
  33772. this.rpcImpl(n.fqn(), e, function(e, t) {
  33773. if (!e) {
  33774. null === t && (t = "");
  33775. try {
  33776. t = n.resolvedResponseType.clazz.decode(t)
  33777. } catch (e) {}
  33778. 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))
  33779. }
  33780. i(e)
  33781. })
  33782. } catch (e) {
  33783. setTimeout(i.bind(this, e), 0)
  33784. }
  33785. }
  33786. ,
  33787. o[n.name] = function(e, t, i) {
  33788. new o(e)[n.name](t, i)
  33789. }
  33790. ,
  33791. Object.defineProperty && (Object.defineProperty(o[n.name], "$options", {
  33792. value: n.buildOpt()
  33793. }),
  33794. Object.defineProperty(e[n.name], "$options", {
  33795. value: o[n.name].$options
  33796. }))
  33797. }(i[n]);
  33798. return Object.defineProperty && (Object.defineProperty(o, "$options", {
  33799. value: r.buildOpt()
  33800. }),
  33801. Object.defineProperty(e, "$options", {
  33802. value: o.$options
  33803. }),
  33804. Object.defineProperty(o, "$type", {
  33805. value: r
  33806. }),
  33807. Object.defineProperty(e, "$type", {
  33808. value: r
  33809. })),
  33810. o
  33811. }(g, this)
  33812. }
  33813. ,
  33814. s.Service = y;
  33815. function A(e, t, i, n) {
  33816. h.call(this, e, t, i),
  33817. this.className = "Service.Method",
  33818. this.options = n || {}
  33819. }
  33820. (A.prototype = Object.create(h.prototype)).buildOpt = t.buildOpt,
  33821. s.Service.Method = A;
  33822. function C(e, t, i, n, r, o, a, s) {
  33823. A.call(this, e, t, i, s),
  33824. this.className = "Service.RPCMethod",
  33825. this.requestName = n,
  33826. this.responseName = r,
  33827. this.requestStream = o,
  33828. this.responseStream = a,
  33829. this.resolvedRequestType = null,
  33830. this.resolvedResponseType = null
  33831. }
  33832. return C.prototype = Object.create(A.prototype),
  33833. s.Service.RPCMethod = C,
  33834. s
  33835. }(o),
  33836. o.Builder = (i = (u = o).Lang,
  33837. s = o.Reflect,
  33838. n = h.prototype,
  33839. h.isMessage = function(e) {
  33840. return "string" == typeof e.name && void 0 === e.values && void 0 === e.rpc
  33841. }
  33842. ,
  33843. h.isMessageField = function(e) {
  33844. return "string" == typeof e.rule && "string" == typeof e.name && "string" == typeof e.type && void 0 !== e.id
  33845. }
  33846. ,
  33847. h.isEnum = function(e) {
  33848. return "string" == typeof e.name && !(void 0 === e.values || !Array.isArray(e.values) || 0 === e.values.length)
  33849. }
  33850. ,
  33851. h.isService = function(e) {
  33852. return !("string" != typeof e.name || "object" != typeof e.rpc || !e.rpc)
  33853. }
  33854. ,
  33855. h.isExtend = function(e) {
  33856. return "string" == typeof e.ref
  33857. }
  33858. ,
  33859. n.reset = function() {
  33860. return this.ptr = this.ns,
  33861. this
  33862. }
  33863. ,
  33864. n.define = function(e) {
  33865. if ("string" != typeof e || !i.TYPEREF.test(e))
  33866. throw Error("illegal namespace: " + e);
  33867. return e.split(".").forEach(function(e) {
  33868. var t = this.ptr.getChild(e);
  33869. null === t && this.ptr.addChild(t = new s.Namespace(this,this.ptr,e)),
  33870. this.ptr = t
  33871. }, this),
  33872. this
  33873. }
  33874. ,
  33875. n.create = function(e) {
  33876. if (!e)
  33877. return this;
  33878. if (Array.isArray(e)) {
  33879. if (0 === e.length)
  33880. return this;
  33881. e = e.slice()
  33882. } else
  33883. e = [e];
  33884. for (var t = [e]; 0 < t.length; ) {
  33885. if (e = t.pop(),
  33886. !Array.isArray(e))
  33887. throw Error("not a valid namespace: " + JSON.stringify(e));
  33888. for (; 0 < e.length; ) {
  33889. var i = e.shift();
  33890. if (h.isMessage(i)) {
  33891. var o = new s.Message(this,this.ptr,i.name,i.options,i.isGroup,i.syntax)
  33892. , n = {};
  33893. i.oneofs && Object.keys(i.oneofs).forEach(function(e) {
  33894. o.addChild(n[e] = new s.Message.OneOf(this,o,e))
  33895. }, this),
  33896. i.fields && i.fields.forEach(function(e) {
  33897. if (null !== o.getChild(0 | e.id))
  33898. throw Error("duplicate or invalid field id in " + o.name + ": " + e.id);
  33899. if (e.options && "object" != typeof e.options)
  33900. throw Error("illegal field options in " + o.name + "#" + e.name);
  33901. var t = null;
  33902. if ("string" == typeof e.oneof && !(t = n[e.oneof]))
  33903. throw Error("illegal oneof in " + o.name + "#" + e.name + ": " + e.oneof);
  33904. e = new s.Message.Field(this,o,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,i.syntax),
  33905. t && t.fields.push(e),
  33906. o.addChild(e)
  33907. }, this);
  33908. var r = [];
  33909. if (i.enums && i.enums.forEach(function(e) {
  33910. r.push(e)
  33911. }),
  33912. i.messages && i.messages.forEach(function(e) {
  33913. r.push(e)
  33914. }),
  33915. i.services && i.services.forEach(function(e) {
  33916. r.push(e)
  33917. }),
  33918. i.extensions && ("number" == typeof i.extensions[0] ? o.extensions = [i.extensions] : o.extensions = i.extensions),
  33919. this.ptr.addChild(o),
  33920. 0 < r.length) {
  33921. t.push(e),
  33922. e = r,
  33923. r = null,
  33924. this.ptr = o,
  33925. o = null;
  33926. continue
  33927. }
  33928. r = null
  33929. } else if (h.isEnum(i))
  33930. o = new s.Enum(this,this.ptr,i.name,i.options,i.syntax),
  33931. i.values.forEach(function(e) {
  33932. o.addChild(new s.Enum.Value(this,o,e.name,e.id))
  33933. }, this),
  33934. this.ptr.addChild(o);
  33935. else if (h.isService(i))
  33936. o = new s.Service(this,this.ptr,i.name,i.options),
  33937. Object.keys(i.rpc).forEach(function(e) {
  33938. var t = i.rpc[e];
  33939. o.addChild(new s.Service.RPCMethod(this,o,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))
  33940. }, this),
  33941. this.ptr.addChild(o);
  33942. else {
  33943. if (!h.isExtend(i))
  33944. throw Error("not a valid definition: " + JSON.stringify(i));
  33945. if (o = this.ptr.resolve(i.ref, !0))
  33946. i.fields.forEach(function(t) {
  33947. if (null !== o.getChild(0 | t.id))
  33948. throw Error("duplicate extended field id in " + o.name + ": " + t.id);
  33949. if (o.extensions) {
  33950. var i = !1;
  33951. if (o.extensions.forEach(function(e) {
  33952. t.id >= e[0] && t.id <= e[1] && (i = !0)
  33953. }),
  33954. !i)
  33955. throw Error("illegal extended field id in " + o.name + ": " + t.id + " (not within valid ranges)")
  33956. }
  33957. var e = t.name;
  33958. this.options.convertFieldsToCamelCase && (e = u.Util.toCamelCase(e));
  33959. var n = new s.Message.ExtensionField(this,o,t.rule,t.type,this.ptr.fqn() + "." + e,t.id,t.options)
  33960. , r = new s.Extension(this,this.ptr,t.name,n);
  33961. n.extension = r,
  33962. this.ptr.addChild(r),
  33963. o.addChild(n)
  33964. }, this);
  33965. else if (!/\.?google\.protobuf\./.test(i.ref))
  33966. throw Error("extended message " + i.ref + " is not defined")
  33967. }
  33968. o = i = null
  33969. }
  33970. e = null,
  33971. this.ptr = this.ptr.parent
  33972. }
  33973. return this.resolved = !1,
  33974. this.result = null,
  33975. this
  33976. }
  33977. ,
  33978. n.import = function(t, e) {
  33979. var i = "/";
  33980. if ("string" == typeof e) {
  33981. if (u.Util.IS_NODE && (e = p("path").resolve(e)),
  33982. !0 === this.files[e])
  33983. return this.reset();
  33984. this.files[e] = !0
  33985. } else if ("object" == typeof e) {
  33986. var n = e.root;
  33987. u.Util.IS_NODE && (n = p("path").resolve(n)),
  33988. (0 <= n.indexOf("\\") || 0 <= e.file.indexOf("\\")) && (i = "\\");
  33989. var r = n + i + e.file;
  33990. if (!0 === this.files[r])
  33991. return this.reset();
  33992. this.files[r] = !0
  33993. }
  33994. if (t.imports && 0 < t.imports.length) {
  33995. var o, a = !1;
  33996. "object" == typeof e ? (this.importRoot = e.root,
  33997. a = !0,
  33998. o = this.importRoot,
  33999. e = e.file,
  34000. (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(/\\[^\\]*$/, ""),
  34001. i = "\\") : o = "." : o = null;
  34002. for (var s = 0; s < t.imports.length; s++)
  34003. if ("string" == typeof t.imports[s]) {
  34004. if (!o)
  34005. throw Error("cannot determine import root");
  34006. var l = t.imports[s];
  34007. if ("google/protobuf/descriptor.proto" === l)
  34008. continue;
  34009. if (l = o + i + l,
  34010. !0 === this.files[l])
  34011. continue;
  34012. /\.proto$/i.test(l) && !u.DotProto && (l = l.replace(/\.proto$/, ".json"));
  34013. var c = u.Util.fetch(l);
  34014. if (null === c)
  34015. throw Error("failed to import '" + l + "' in '" + e + "': file not found");
  34016. /\.json$/i.test(l) ? this.import(JSON.parse(c + ""), l) : this.import(u.DotProto.Parser.parse(c), l)
  34017. } else
  34018. e ? /\.(\w+)$/.test(e) ? this.import(t.imports[s], e.replace(/^(.+)\.(\w+)$/, function(e, t, i) {
  34019. return t + "_import" + s + "." + i
  34020. })) : this.import(t.imports[s], e + "_import" + s) : this.import(t.imports[s]);
  34021. a && (this.importRoot = null)
  34022. }
  34023. t.package && this.define(t.package),
  34024. t.syntax && function t(i) {
  34025. i.messages && i.messages.forEach(function(e) {
  34026. e.syntax = i.syntax,
  34027. t(e)
  34028. }),
  34029. i.enums && i.enums.forEach(function(e) {
  34030. e.syntax = i.syntax
  34031. })
  34032. }(t);
  34033. var h = this.ptr;
  34034. return t.options && Object.keys(t.options).forEach(function(e) {
  34035. h.options[e] = t.options[e]
  34036. }),
  34037. t.messages && (this.create(t.messages),
  34038. this.ptr = h),
  34039. t.enums && (this.create(t.enums),
  34040. this.ptr = h),
  34041. t.services && (this.create(t.services),
  34042. this.ptr = h),
  34043. t.extends && this.create(t.extends),
  34044. this.reset()
  34045. }
  34046. ,
  34047. n.resolveAll = function() {
  34048. var e;
  34049. if (null == this.ptr || "object" == typeof this.ptr.type)
  34050. return this;
  34051. if (this.ptr instanceof s.Namespace)
  34052. this.ptr.children.forEach(function(e) {
  34053. this.ptr = e,
  34054. this.resolveAll()
  34055. }, this);
  34056. else if (this.ptr instanceof s.Message.Field) {
  34057. if (i.TYPE.test(this.ptr.type))
  34058. this.ptr.type = u.TYPES[this.ptr.type];
  34059. else {
  34060. if (!i.TYPEREF.test(this.ptr.type))
  34061. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  34062. if (!(e = (this.ptr instanceof s.Message.ExtensionField ? this.ptr.extension.parent : this.ptr.parent).resolve(this.ptr.type, !0)))
  34063. throw Error("unresolvable type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  34064. if ((this.ptr.resolvedType = e)instanceof s.Enum) {
  34065. if (this.ptr.type = u.TYPES.enum,
  34066. "proto3" === this.ptr.syntax && "proto3" !== e.syntax)
  34067. throw Error("proto3 message cannot reference proto2 enum")
  34068. } else {
  34069. if (!(e instanceof s.Message))
  34070. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  34071. this.ptr.type = e.isGroup ? u.TYPES.group : u.TYPES.message
  34072. }
  34073. }
  34074. if (this.ptr.map) {
  34075. if (!i.TYPE.test(this.ptr.keyType))
  34076. throw Error("illegal key type for map field in " + this.ptr.toString(!0) + ": " + this.ptr.keyType);
  34077. this.ptr.keyType = u.TYPES[this.ptr.keyType]
  34078. }
  34079. } else if (this.ptr instanceof u.Reflect.Service.Method) {
  34080. if (!(this.ptr instanceof u.Reflect.Service.RPCMethod))
  34081. throw Error("illegal service type in " + this.ptr.toString(!0));
  34082. if (!((e = this.ptr.parent.resolve(this.ptr.requestName, !0)) && e instanceof u.Reflect.Message))
  34083. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.requestName);
  34084. if (this.ptr.resolvedRequestType = e,
  34085. !((e = this.ptr.parent.resolve(this.ptr.responseName, !0)) && e instanceof u.Reflect.Message))
  34086. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.responseName);
  34087. this.ptr.resolvedResponseType = e
  34088. } else if (!(this.ptr instanceof u.Reflect.Message.OneOf || this.ptr instanceof u.Reflect.Extension || this.ptr instanceof u.Reflect.Enum.Value))
  34089. throw Error("illegal object in namespace: " + typeof this.ptr + ": " + this.ptr);
  34090. return this.reset()
  34091. }
  34092. ,
  34093. n.build = function(e) {
  34094. if (this.reset(),
  34095. this.resolved || (this.resolveAll(),
  34096. this.resolved = !0,
  34097. this.result = null),
  34098. null === this.result && (this.result = this.ns.build()),
  34099. !e)
  34100. return this.result;
  34101. for (var t = "string" == typeof e ? e.split(".") : e, i = this.result, n = 0; n < t.length; n++) {
  34102. if (!i[t[n]]) {
  34103. i = null;
  34104. break
  34105. }
  34106. i = i[t[n]]
  34107. }
  34108. return i
  34109. }
  34110. ,
  34111. n.lookup = function(e, t) {
  34112. return e ? this.ns.resolve(e, t) : this.ns
  34113. }
  34114. ,
  34115. n.toString = function() {
  34116. return "Builder"
  34117. }
  34118. ,
  34119. h.Message = function() {}
  34120. ,
  34121. h.Enum = function() {}
  34122. ,
  34123. h.Service = function() {}
  34124. ,
  34125. h),
  34126. o.Map = (a = o.Reflect,
  34127. (t = c.prototype).clear = function() {
  34128. this.map = {}
  34129. }
  34130. ,
  34131. t.delete = function(e) {
  34132. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e))
  34133. , i = t in this.map;
  34134. return delete this.map[t],
  34135. i
  34136. }
  34137. ,
  34138. t.entries = function() {
  34139. for (var e, t = [], i = Object.keys(this.map), n = 0; n < i.length; n++)
  34140. t.push([(e = this.map[i[n]]).key, e.value]);
  34141. return l(t)
  34142. }
  34143. ,
  34144. t.keys = function() {
  34145. for (var e = [], t = Object.keys(this.map), i = 0; i < t.length; i++)
  34146. e.push(this.map[t[i]].key);
  34147. return l(e)
  34148. }
  34149. ,
  34150. t.values = function() {
  34151. for (var e = [], t = Object.keys(this.map), i = 0; i < t.length; i++)
  34152. e.push(this.map[t[i]].value);
  34153. return l(e)
  34154. }
  34155. ,
  34156. t.forEach = function(e, t) {
  34157. for (var i, n = Object.keys(this.map), r = 0; r < n.length; r++)
  34158. e.call(t, (i = this.map[n[r]]).value, i.key, this)
  34159. }
  34160. ,
  34161. t.set = function(e, t) {
  34162. var i = this.keyElem.verifyValue(e)
  34163. , n = this.valueElem.verifyValue(t);
  34164. return this.map[this.keyElem.valueToString(i)] = {
  34165. key: i,
  34166. value: n
  34167. },
  34168. this
  34169. }
  34170. ,
  34171. t.get = function(e) {
  34172. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  34173. if (t in this.map)
  34174. return this.map[t].value
  34175. }
  34176. ,
  34177. t.has = function(e) {
  34178. return this.keyElem.valueToString(this.keyElem.verifyValue(e))in this.map
  34179. }
  34180. ,
  34181. c),
  34182. o.loadProto = function(e, t, i) {
  34183. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  34184. t = void 0),
  34185. o.loadJson(o.DotProto.Parser.parse(e), t, i)
  34186. }
  34187. ,
  34188. o.protoFromString = o.loadProto,
  34189. o.loadProtoFile = function(t, i, n) {
  34190. if (i && "object" == typeof i ? (n = i,
  34191. i = null) : i && "function" == typeof i || (i = null),
  34192. i)
  34193. return o.Util.fetch("string" == typeof t ? t : t.root + "/" + t.file, function(e) {
  34194. if (null !== e)
  34195. try {
  34196. i(null, o.loadProto(e, n, t))
  34197. } catch (e) {
  34198. i(e)
  34199. }
  34200. else
  34201. i(Error("Failed to fetch file"))
  34202. });
  34203. var e = o.Util.fetch("object" == typeof t ? t.root + "/" + t.file : t);
  34204. return null === e ? null : o.loadProto(e, n, t)
  34205. }
  34206. ,
  34207. o.protoFromFile = o.loadProtoFile,
  34208. o.newBuilder = function(e) {
  34209. return void 0 === (e = e || {}).convertFieldsToCamelCase && (e.convertFieldsToCamelCase = o.convertFieldsToCamelCase),
  34210. void 0 === e.populateAccessors && (e.populateAccessors = o.populateAccessors),
  34211. new o.Builder(e)
  34212. }
  34213. ,
  34214. o.loadJson = function(e, t, i) {
  34215. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  34216. t = null),
  34217. t && "object" == typeof t || (t = o.newBuilder()),
  34218. "string" == typeof e && (e = JSON.parse(e)),
  34219. t.import(e, i),
  34220. t.resolveAll(),
  34221. t
  34222. }
  34223. ,
  34224. o.loadJsonFile = function(t, i, n) {
  34225. if (i && "object" == typeof i ? (n = i,
  34226. i = null) : i && "function" == typeof i || (i = null),
  34227. i)
  34228. return o.Util.fetch("string" == typeof t ? t : t.root + "/" + t.file, function(e) {
  34229. if (null !== e)
  34230. try {
  34231. i(null, o.loadJson(JSON.parse(e), n, t))
  34232. } catch (e) {
  34233. i(e)
  34234. }
  34235. else
  34236. i(Error("Failed to fetch file"))
  34237. });
  34238. var e = o.Util.fetch("object" == typeof t ? t.root + "/" + t.file : t);
  34239. return null === e ? null : o.loadJson(JSON.parse(e), n, t)
  34240. }
  34241. ,
  34242. o;
  34243. function l(e) {
  34244. var t = 0;
  34245. return {
  34246. next: function() {
  34247. return t < e.length ? {
  34248. done: !1,
  34249. value: e[t++]
  34250. } : {
  34251. done: !0
  34252. }
  34253. }
  34254. }
  34255. }
  34256. function c(e, t) {
  34257. if (!e.map)
  34258. throw Error("field is not a map");
  34259. if (this.field = e,
  34260. this.keyElem = new a.Element(e.keyType,null,!0,e.syntax),
  34261. this.valueElem = new a.Element(e.type,e.resolvedType,!1,e.syntax),
  34262. this.map = {},
  34263. Object.defineProperty(this, "size", {
  34264. get: function() {
  34265. return Object.keys(this.map).length
  34266. }
  34267. }),
  34268. t)
  34269. for (var i = Object.keys(t), n = 0; n < i.length; n++) {
  34270. var r = this.keyElem.valueFromString(i[n])
  34271. , o = this.valueElem.verifyValue(t[i[n]]);
  34272. this.map[this.keyElem.valueToString(r)] = {
  34273. key: r,
  34274. value: o
  34275. }
  34276. }
  34277. }
  34278. function h(e) {
  34279. this.ns = new s.Namespace(this,null,""),
  34280. this.ptr = this.ns,
  34281. this.resolved = !1,
  34282. this.result = null,
  34283. this.files = {},
  34284. this.importRoot = null,
  34285. this.options = e || {}
  34286. }
  34287. }
  34288. ,
  34289. "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)
  34290. }
  34291. ).call(this, p("_process"))
  34292. }
  34293. , {
  34294. _process: 203,
  34295. bytebuffer: 215,
  34296. fs: 197,
  34297. path: 197
  34298. }],
  34299. 215: [function(t, e, i) {
  34300. var n, r;
  34301. n = this,
  34302. r = function(l) {
  34303. "use strict";
  34304. function s(e) {
  34305. var t = 0;
  34306. return function() {
  34307. return t < e.length ? e.charCodeAt(t++) : null
  34308. }
  34309. }
  34310. function c() {
  34311. var e = []
  34312. , t = [];
  34313. return function() {
  34314. return 0 === arguments.length ? t.join("") + i.apply(String, e) : (1024 < e.length + arguments.length && (t.push(i.apply(String, e)),
  34315. e.length = 0),
  34316. void Array.prototype.push.apply(e, arguments))
  34317. }
  34318. }
  34319. function n(e, t, i, n, r) {
  34320. 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];
  34321. for (u += d,
  34322. o = p & (1 << -h) - 1,
  34323. p >>= -h,
  34324. h += s; 0 < h; o = 256 * o + e[t + u],
  34325. u += d,
  34326. h -= 8)
  34327. ;
  34328. for (a = o & (1 << -h) - 1,
  34329. o >>= -h,
  34330. h += n; 0 < h; a = 256 * a + e[t + u],
  34331. u += d,
  34332. h -= 8)
  34333. ;
  34334. if (0 === o)
  34335. o = 1 - c;
  34336. else {
  34337. if (o === l)
  34338. return a ? NaN : 1 / 0 * (p ? -1 : 1);
  34339. a += Math.pow(2, n),
  34340. o -= c
  34341. }
  34342. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  34343. }
  34344. function r(e, t, i, n, r, o) {
  34345. 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;
  34346. for (t = Math.abs(t),
  34347. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  34348. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  34349. t * (l = Math.pow(2, -a)) < 1 && (a--,
  34350. l *= 2),
  34351. 2 <= (t += 1 <= a + u ? d / l : d * Math.pow(2, 1 - u)) * l && (a++,
  34352. l /= 2),
  34353. h <= a + u ? (s = 0,
  34354. a = h) : 1 <= a + u ? (s = (t * l - 1) * Math.pow(2, r),
  34355. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  34356. a = 0)); 8 <= r; e[i + p] = 255 & s,
  34357. p += f,
  34358. s /= 256,
  34359. r -= 8)
  34360. ;
  34361. for (a = a << r | s,
  34362. c += r; 0 < c; e[i + p] = 255 & a,
  34363. p += f,
  34364. a /= 256,
  34365. c -= 8)
  34366. ;
  34367. e[i + p - f] |= 128 * g
  34368. }
  34369. var f = function(e, t, i) {
  34370. if (void 0 === e && (e = f.DEFAULT_CAPACITY),
  34371. void 0 === t && (t = f.DEFAULT_ENDIAN),
  34372. void 0 === i && (i = f.DEFAULT_NOASSERT),
  34373. !i) {
  34374. if ((e |= 0) < 0)
  34375. throw RangeError("Illegal capacity");
  34376. t = !!t,
  34377. i = !!i
  34378. }
  34379. this.buffer = 0 === e ? o : new ArrayBuffer(e),
  34380. this.view = 0 === e ? null : new Uint8Array(this.buffer),
  34381. this.offset = 0,
  34382. this.markedOffset = -1,
  34383. this.limit = e,
  34384. this.littleEndian = t,
  34385. this.noAssert = i
  34386. };
  34387. f.VERSION = "5.0.1",
  34388. f.LITTLE_ENDIAN = !0,
  34389. f.BIG_ENDIAN = !1,
  34390. f.DEFAULT_CAPACITY = 16,
  34391. f.DEFAULT_ENDIAN = f.BIG_ENDIAN,
  34392. f.DEFAULT_NOASSERT = !1,
  34393. f.Long = l || null;
  34394. var a = f.prototype;
  34395. a.__isByteBuffer__,
  34396. Object.defineProperty(a, "__isByteBuffer__", {
  34397. value: !0,
  34398. enumerable: !1,
  34399. configurable: !1
  34400. });
  34401. var o = new ArrayBuffer(0)
  34402. , i = String.fromCharCode;
  34403. f.accessor = function() {
  34404. return Uint8Array
  34405. }
  34406. ,
  34407. f.allocate = function(e, t, i) {
  34408. return new f(e,t,i)
  34409. }
  34410. ,
  34411. f.concat = function(e, t, i, n) {
  34412. "boolean" != typeof t && "string" == typeof t || (n = i,
  34413. i = t,
  34414. t = void 0);
  34415. for (var r, o = 0, a = 0, s = e.length; a < s; ++a)
  34416. f.isByteBuffer(e[a]) || (e[a] = f.wrap(e[a], t)),
  34417. 0 < (r = e[a].limit - e[a].offset) && (o += r);
  34418. if (0 === o)
  34419. return new f(0,i,n);
  34420. var l, c = new f(o,i,n);
  34421. for (a = 0; a < s; )
  34422. (r = (l = e[a++]).limit - l.offset) <= 0 || (c.view.set(l.view.subarray(l.offset, l.limit), c.offset),
  34423. c.offset += r);
  34424. return c.limit = c.offset,
  34425. c.offset = 0,
  34426. c
  34427. }
  34428. ,
  34429. f.isByteBuffer = function(e) {
  34430. return !0 === (e && e.__isByteBuffer__)
  34431. }
  34432. ,
  34433. f.type = function() {
  34434. return ArrayBuffer
  34435. }
  34436. ,
  34437. f.wrap = function(e, t, i, n) {
  34438. if ("string" != typeof t && (n = i,
  34439. i = t,
  34440. t = void 0),
  34441. "string" == typeof e)
  34442. switch (void 0 === t && (t = "utf8"),
  34443. t) {
  34444. case "base64":
  34445. return f.fromBase64(e, i);
  34446. case "hex":
  34447. return f.fromHex(e, i);
  34448. case "binary":
  34449. return f.fromBinary(e, i);
  34450. case "utf8":
  34451. return f.fromUTF8(e, i);
  34452. case "debug":
  34453. return f.fromDebug(e, i);
  34454. default:
  34455. throw Error("Unsupported encoding: " + t)
  34456. }
  34457. if (null === e || "object" != typeof e)
  34458. throw TypeError("Illegal buffer");
  34459. var r;
  34460. if (f.isByteBuffer(e))
  34461. return (r = a.clone.call(e)).markedOffset = -1,
  34462. r;
  34463. if (e instanceof Uint8Array)
  34464. r = new f(0,i,n),
  34465. 0 < e.length && (r.buffer = e.buffer,
  34466. r.offset = e.byteOffset,
  34467. r.limit = e.byteOffset + e.byteLength,
  34468. r.view = new Uint8Array(e.buffer));
  34469. else if (e instanceof ArrayBuffer)
  34470. r = new f(0,i,n),
  34471. 0 < e.byteLength && (r.buffer = e,
  34472. r.offset = 0,
  34473. r.limit = e.byteLength,
  34474. r.view = 0 < e.byteLength ? new Uint8Array(e) : null);
  34475. else {
  34476. if ("[object Array]" !== Object.prototype.toString.call(e))
  34477. throw TypeError("Illegal buffer");
  34478. (r = new f(e.length,i,n)).limit = e.length;
  34479. for (var o = 0; o < e.length; ++o)
  34480. r.view[o] = e[o]
  34481. }
  34482. return r
  34483. }
  34484. ,
  34485. a.writeBitSet = function(e, t) {
  34486. var i = void 0 === t;
  34487. if (i && (t = this.offset),
  34488. !this.noAssert) {
  34489. if (!(e instanceof Array))
  34490. throw TypeError("Illegal BitSet: Not an array");
  34491. if ("number" != typeof t || t % 1 != 0)
  34492. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34493. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34494. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34495. }
  34496. var n, r = t, o = e.length, a = o >> 3, s = 0;
  34497. for (t += this.writeVarint32(o, t); a--; )
  34498. 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,
  34499. this.writeByte(n, t++);
  34500. if (s < o) {
  34501. var l = 0;
  34502. for (n = 0; s < o; )
  34503. n |= (1 & !!e[s++]) << l++;
  34504. this.writeByte(n, t++)
  34505. }
  34506. return i ? (this.offset = t,
  34507. this) : t - r
  34508. }
  34509. ,
  34510. a.readBitSet = function(e) {
  34511. var t = void 0 === e;
  34512. t && (e = this.offset);
  34513. var i, n = this.readVarint32(e), r = n.value, o = r >> 3, a = 0, s = [];
  34514. for (e += n.length; o--; )
  34515. i = this.readByte(e++),
  34516. s[a++] = !!(1 & i),
  34517. s[a++] = !!(2 & i),
  34518. s[a++] = !!(4 & i),
  34519. s[a++] = !!(8 & i),
  34520. s[a++] = !!(16 & i),
  34521. s[a++] = !!(32 & i),
  34522. s[a++] = !!(64 & i),
  34523. s[a++] = !!(128 & i);
  34524. if (a < r) {
  34525. var l = 0;
  34526. for (i = this.readByte(e++); a < r; )
  34527. s[a++] = !!(i >> l++ & 1)
  34528. }
  34529. return t && (this.offset = e),
  34530. s
  34531. }
  34532. ,
  34533. a.readBytes = function(e, t) {
  34534. var i = void 0 === t;
  34535. if (i && (t = this.offset),
  34536. !this.noAssert) {
  34537. if ("number" != typeof t || t % 1 != 0)
  34538. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34539. if ((t >>>= 0) < 0 || t + e > this.buffer.byteLength)
  34540. throw RangeError("Illegal offset: 0 <= " + t + " (+" + e + ") <= " + this.buffer.byteLength)
  34541. }
  34542. var n = this.slice(t, t + e);
  34543. return i && (this.offset += e),
  34544. n
  34545. }
  34546. ,
  34547. a.writeBytes = a.append,
  34548. a.writeInt8 = function(e, t) {
  34549. var i = void 0 === t;
  34550. if (i && (t = this.offset),
  34551. !this.noAssert) {
  34552. if ("number" != typeof e || e % 1 != 0)
  34553. throw TypeError("Illegal value: " + e + " (not an integer)");
  34554. if (e |= 0,
  34555. "number" != typeof t || t % 1 != 0)
  34556. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34557. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34558. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34559. }
  34560. t += 1;
  34561. var n = this.buffer.byteLength;
  34562. return n < t && this.resize((n *= 2) > t ? n : t),
  34563. t -= 1,
  34564. this.view[t] = e,
  34565. i && (this.offset += 1),
  34566. this
  34567. }
  34568. ,
  34569. a.writeByte = a.writeInt8,
  34570. a.readInt8 = function(e) {
  34571. var t = void 0 === e;
  34572. if (t && (e = this.offset),
  34573. !this.noAssert) {
  34574. if ("number" != typeof e || e % 1 != 0)
  34575. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34576. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  34577. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  34578. }
  34579. var i = this.view[e];
  34580. return 128 == (128 & i) && (i = -(255 - i + 1)),
  34581. t && (this.offset += 1),
  34582. i
  34583. }
  34584. ,
  34585. a.readByte = a.readInt8,
  34586. a.writeUint8 = function(e, t) {
  34587. var i = void 0 === t;
  34588. if (i && (t = this.offset),
  34589. !this.noAssert) {
  34590. if ("number" != typeof e || e % 1 != 0)
  34591. throw TypeError("Illegal value: " + e + " (not an integer)");
  34592. if (e >>>= 0,
  34593. "number" != typeof t || t % 1 != 0)
  34594. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34595. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34596. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34597. }
  34598. t += 1;
  34599. var n = this.buffer.byteLength;
  34600. return n < t && this.resize((n *= 2) > t ? n : t),
  34601. t -= 1,
  34602. this.view[t] = e,
  34603. i && (this.offset += 1),
  34604. this
  34605. }
  34606. ,
  34607. a.writeUInt8 = a.writeUint8,
  34608. a.readUint8 = function(e) {
  34609. var t = void 0 === e;
  34610. if (t && (e = this.offset),
  34611. !this.noAssert) {
  34612. if ("number" != typeof e || e % 1 != 0)
  34613. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34614. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  34615. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  34616. }
  34617. var i = this.view[e];
  34618. return t && (this.offset += 1),
  34619. i
  34620. }
  34621. ,
  34622. a.readUInt8 = a.readUint8,
  34623. a.writeInt16 = function(e, t) {
  34624. var i = void 0 === t;
  34625. if (i && (t = this.offset),
  34626. !this.noAssert) {
  34627. if ("number" != typeof e || e % 1 != 0)
  34628. throw TypeError("Illegal value: " + e + " (not an integer)");
  34629. if (e |= 0,
  34630. "number" != typeof t || t % 1 != 0)
  34631. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34632. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34633. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34634. }
  34635. t += 2;
  34636. var n = this.buffer.byteLength;
  34637. return n < t && this.resize((n *= 2) > t ? n : t),
  34638. t -= 2,
  34639. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  34640. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  34641. this.view[t + 1] = 255 & e),
  34642. i && (this.offset += 2),
  34643. this
  34644. }
  34645. ,
  34646. a.writeShort = a.writeInt16,
  34647. a.readInt16 = function(e) {
  34648. var t = void 0 === e;
  34649. if (t && (e = this.offset),
  34650. !this.noAssert) {
  34651. if ("number" != typeof e || e % 1 != 0)
  34652. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34653. if ((e >>>= 0) < 0 || e + 2 > this.buffer.byteLength)
  34654. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  34655. }
  34656. var i = 0;
  34657. return this.littleEndian ? (i = this.view[e],
  34658. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  34659. i |= this.view[e + 1]),
  34660. 32768 == (32768 & i) && (i = -(65535 - i + 1)),
  34661. t && (this.offset += 2),
  34662. i
  34663. }
  34664. ,
  34665. a.readShort = a.readInt16,
  34666. a.writeUint16 = function(e, t) {
  34667. var i = void 0 === t;
  34668. if (i && (t = this.offset),
  34669. !this.noAssert) {
  34670. if ("number" != typeof e || e % 1 != 0)
  34671. throw TypeError("Illegal value: " + e + " (not an integer)");
  34672. if (e >>>= 0,
  34673. "number" != typeof t || t % 1 != 0)
  34674. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34675. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34676. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34677. }
  34678. t += 2;
  34679. var n = this.buffer.byteLength;
  34680. return n < t && this.resize((n *= 2) > t ? n : t),
  34681. t -= 2,
  34682. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  34683. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  34684. this.view[t + 1] = 255 & e),
  34685. i && (this.offset += 2),
  34686. this
  34687. }
  34688. ,
  34689. a.writeUInt16 = a.writeUint16,
  34690. a.readUint16 = function(e) {
  34691. var t = void 0 === e;
  34692. if (t && (e = this.offset),
  34693. !this.noAssert) {
  34694. if ("number" != typeof e || e % 1 != 0)
  34695. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34696. if ((e >>>= 0) < 0 || e + 2 > this.buffer.byteLength)
  34697. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  34698. }
  34699. var i = 0;
  34700. return this.littleEndian ? (i = this.view[e],
  34701. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  34702. i |= this.view[e + 1]),
  34703. t && (this.offset += 2),
  34704. i
  34705. }
  34706. ,
  34707. a.readUInt16 = a.readUint16,
  34708. a.writeInt32 = function(e, t) {
  34709. var i = void 0 === t;
  34710. if (i && (t = this.offset),
  34711. !this.noAssert) {
  34712. if ("number" != typeof e || e % 1 != 0)
  34713. throw TypeError("Illegal value: " + e + " (not an integer)");
  34714. if (e |= 0,
  34715. "number" != typeof t || t % 1 != 0)
  34716. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34717. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34718. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34719. }
  34720. t += 4;
  34721. var n = this.buffer.byteLength;
  34722. return n < t && this.resize((n *= 2) > t ? n : t),
  34723. t -= 4,
  34724. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  34725. this.view[t + 2] = e >>> 16 & 255,
  34726. this.view[t + 1] = e >>> 8 & 255,
  34727. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  34728. this.view[t + 1] = e >>> 16 & 255,
  34729. this.view[t + 2] = e >>> 8 & 255,
  34730. this.view[t + 3] = 255 & e),
  34731. i && (this.offset += 4),
  34732. this
  34733. }
  34734. ,
  34735. a.writeInt = a.writeInt32,
  34736. a.readInt32 = function(e) {
  34737. var t = void 0 === e;
  34738. if (t && (e = this.offset),
  34739. !this.noAssert) {
  34740. if ("number" != typeof e || e % 1 != 0)
  34741. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34742. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  34743. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  34744. }
  34745. var i = 0;
  34746. return this.littleEndian ? (i = this.view[e + 2] << 16,
  34747. i |= this.view[e + 1] << 8,
  34748. i |= this.view[e],
  34749. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  34750. i |= this.view[e + 2] << 8,
  34751. i |= this.view[e + 3],
  34752. i += this.view[e] << 24 >>> 0),
  34753. i |= 0,
  34754. t && (this.offset += 4),
  34755. i
  34756. }
  34757. ,
  34758. a.readInt = a.readInt32,
  34759. a.writeUint32 = function(e, t) {
  34760. var i = void 0 === t;
  34761. if (i && (t = this.offset),
  34762. !this.noAssert) {
  34763. if ("number" != typeof e || e % 1 != 0)
  34764. throw TypeError("Illegal value: " + e + " (not an integer)");
  34765. if (e >>>= 0,
  34766. "number" != typeof t || t % 1 != 0)
  34767. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34768. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34769. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34770. }
  34771. t += 4;
  34772. var n = this.buffer.byteLength;
  34773. return n < t && this.resize((n *= 2) > t ? n : t),
  34774. t -= 4,
  34775. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  34776. this.view[t + 2] = e >>> 16 & 255,
  34777. this.view[t + 1] = e >>> 8 & 255,
  34778. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  34779. this.view[t + 1] = e >>> 16 & 255,
  34780. this.view[t + 2] = e >>> 8 & 255,
  34781. this.view[t + 3] = 255 & e),
  34782. i && (this.offset += 4),
  34783. this
  34784. }
  34785. ,
  34786. a.writeUInt32 = a.writeUint32,
  34787. a.readUint32 = function(e) {
  34788. var t = void 0 === e;
  34789. if (t && (e = this.offset),
  34790. !this.noAssert) {
  34791. if ("number" != typeof e || e % 1 != 0)
  34792. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34793. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  34794. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  34795. }
  34796. var i = 0;
  34797. return this.littleEndian ? (i = this.view[e + 2] << 16,
  34798. i |= this.view[e + 1] << 8,
  34799. i |= this.view[e],
  34800. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  34801. i |= this.view[e + 2] << 8,
  34802. i |= this.view[e + 3],
  34803. i += this.view[e] << 24 >>> 0),
  34804. t && (this.offset += 4),
  34805. i
  34806. }
  34807. ,
  34808. a.readUInt32 = a.readUint32,
  34809. l && (a.writeInt64 = function(e, t) {
  34810. var i = void 0 === t;
  34811. if (i && (t = this.offset),
  34812. !this.noAssert) {
  34813. if ("number" == typeof e)
  34814. e = l.fromNumber(e);
  34815. else if ("string" == typeof e)
  34816. e = l.fromString(e);
  34817. else if (!(e && e instanceof l))
  34818. throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  34819. if ("number" != typeof t || t % 1 != 0)
  34820. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34821. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34822. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34823. }
  34824. "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e)),
  34825. t += 8;
  34826. var n = this.buffer.byteLength;
  34827. n < t && this.resize((n *= 2) > t ? n : t),
  34828. t -= 8;
  34829. var r = e.low
  34830. , o = e.high;
  34831. return this.littleEndian ? (this.view[t + 3] = r >>> 24 & 255,
  34832. this.view[t + 2] = r >>> 16 & 255,
  34833. this.view[t + 1] = r >>> 8 & 255,
  34834. this.view[t] = 255 & r,
  34835. t += 4,
  34836. this.view[t + 3] = o >>> 24 & 255,
  34837. this.view[t + 2] = o >>> 16 & 255,
  34838. this.view[t + 1] = o >>> 8 & 255,
  34839. this.view[t] = 255 & o) : (this.view[t] = o >>> 24 & 255,
  34840. this.view[t + 1] = o >>> 16 & 255,
  34841. this.view[t + 2] = o >>> 8 & 255,
  34842. this.view[t + 3] = 255 & o,
  34843. t += 4,
  34844. this.view[t] = r >>> 24 & 255,
  34845. this.view[t + 1] = r >>> 16 & 255,
  34846. this.view[t + 2] = r >>> 8 & 255,
  34847. this.view[t + 3] = 255 & r),
  34848. i && (this.offset += 8),
  34849. this
  34850. }
  34851. ,
  34852. a.writeLong = a.writeInt64,
  34853. a.readInt64 = function(e) {
  34854. var t = void 0 === e;
  34855. if (t && (e = this.offset),
  34856. !this.noAssert) {
  34857. if ("number" != typeof e || e % 1 != 0)
  34858. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34859. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength)
  34860. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  34861. }
  34862. var i = 0
  34863. , n = 0;
  34864. this.littleEndian ? (i = this.view[e + 2] << 16,
  34865. i |= this.view[e + 1] << 8,
  34866. i |= this.view[e],
  34867. i += this.view[e + 3] << 24 >>> 0,
  34868. e += 4,
  34869. n = this.view[e + 2] << 16,
  34870. n |= this.view[e + 1] << 8,
  34871. n |= this.view[e],
  34872. n += this.view[e + 3] << 24 >>> 0) : (n = this.view[e + 1] << 16,
  34873. n |= this.view[e + 2] << 8,
  34874. n |= this.view[e + 3],
  34875. n += this.view[e] << 24 >>> 0,
  34876. e += 4,
  34877. i = this.view[e + 1] << 16,
  34878. i |= this.view[e + 2] << 8,
  34879. i |= this.view[e + 3],
  34880. i += this.view[e] << 24 >>> 0);
  34881. var r = new l(i,n,!1);
  34882. return t && (this.offset += 8),
  34883. r
  34884. }
  34885. ,
  34886. a.readLong = a.readInt64,
  34887. a.writeUint64 = function(e, t) {
  34888. var i = void 0 === t;
  34889. if (i && (t = this.offset),
  34890. !this.noAssert) {
  34891. if ("number" == typeof e)
  34892. e = l.fromNumber(e);
  34893. else if ("string" == typeof e)
  34894. e = l.fromString(e);
  34895. else if (!(e && e instanceof l))
  34896. throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  34897. if ("number" != typeof t || t % 1 != 0)
  34898. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34899. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34900. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34901. }
  34902. "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e)),
  34903. t += 8;
  34904. var n = this.buffer.byteLength;
  34905. n < t && this.resize((n *= 2) > t ? n : t),
  34906. t -= 8;
  34907. var r = e.low
  34908. , o = e.high;
  34909. return this.littleEndian ? (this.view[t + 3] = r >>> 24 & 255,
  34910. this.view[t + 2] = r >>> 16 & 255,
  34911. this.view[t + 1] = r >>> 8 & 255,
  34912. this.view[t] = 255 & r,
  34913. t += 4,
  34914. this.view[t + 3] = o >>> 24 & 255,
  34915. this.view[t + 2] = o >>> 16 & 255,
  34916. this.view[t + 1] = o >>> 8 & 255,
  34917. this.view[t] = 255 & o) : (this.view[t] = o >>> 24 & 255,
  34918. this.view[t + 1] = o >>> 16 & 255,
  34919. this.view[t + 2] = o >>> 8 & 255,
  34920. this.view[t + 3] = 255 & o,
  34921. t += 4,
  34922. this.view[t] = r >>> 24 & 255,
  34923. this.view[t + 1] = r >>> 16 & 255,
  34924. this.view[t + 2] = r >>> 8 & 255,
  34925. this.view[t + 3] = 255 & r),
  34926. i && (this.offset += 8),
  34927. this
  34928. }
  34929. ,
  34930. a.writeUInt64 = a.writeUint64,
  34931. a.readUint64 = function(e) {
  34932. var t = void 0 === e;
  34933. if (t && (e = this.offset),
  34934. !this.noAssert) {
  34935. if ("number" != typeof e || e % 1 != 0)
  34936. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34937. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength)
  34938. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  34939. }
  34940. var i = 0
  34941. , n = 0;
  34942. this.littleEndian ? (i = this.view[e + 2] << 16,
  34943. i |= this.view[e + 1] << 8,
  34944. i |= this.view[e],
  34945. i += this.view[e + 3] << 24 >>> 0,
  34946. e += 4,
  34947. n = this.view[e + 2] << 16,
  34948. n |= this.view[e + 1] << 8,
  34949. n |= this.view[e],
  34950. n += this.view[e + 3] << 24 >>> 0) : (n = this.view[e + 1] << 16,
  34951. n |= this.view[e + 2] << 8,
  34952. n |= this.view[e + 3],
  34953. n += this.view[e] << 24 >>> 0,
  34954. e += 4,
  34955. i = this.view[e + 1] << 16,
  34956. i |= this.view[e + 2] << 8,
  34957. i |= this.view[e + 3],
  34958. i += this.view[e] << 24 >>> 0);
  34959. var r = new l(i,n,!0);
  34960. return t && (this.offset += 8),
  34961. r
  34962. }
  34963. ,
  34964. a.readUInt64 = a.readUint64),
  34965. a.writeFloat32 = function(e, t) {
  34966. var i = void 0 === t;
  34967. if (i && (t = this.offset),
  34968. !this.noAssert) {
  34969. if ("number" != typeof e)
  34970. throw TypeError("Illegal value: " + e + " (not a number)");
  34971. if ("number" != typeof t || t % 1 != 0)
  34972. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34973. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34974. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34975. }
  34976. t += 4;
  34977. var n = this.buffer.byteLength;
  34978. return n < t && this.resize((n *= 2) > t ? n : t),
  34979. t -= 4,
  34980. r(this.view, e, t, this.littleEndian, 23, 4),
  34981. i && (this.offset += 4),
  34982. this
  34983. }
  34984. ,
  34985. a.writeFloat = a.writeFloat32,
  34986. a.readFloat32 = function(e) {
  34987. var t = void 0 === e;
  34988. if (t && (e = this.offset),
  34989. !this.noAssert) {
  34990. if ("number" != typeof e || e % 1 != 0)
  34991. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34992. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  34993. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  34994. }
  34995. var i = n(this.view, e, this.littleEndian, 23, 4);
  34996. return t && (this.offset += 4),
  34997. i
  34998. }
  34999. ,
  35000. a.readFloat = a.readFloat32,
  35001. a.writeFloat64 = function(e, t) {
  35002. var i = void 0 === t;
  35003. if (i && (t = this.offset),
  35004. !this.noAssert) {
  35005. if ("number" != typeof e)
  35006. throw TypeError("Illegal value: " + e + " (not a number)");
  35007. if ("number" != typeof t || t % 1 != 0)
  35008. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35009. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35010. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35011. }
  35012. t += 8;
  35013. var n = this.buffer.byteLength;
  35014. return n < t && this.resize((n *= 2) > t ? n : t),
  35015. t -= 8,
  35016. r(this.view, e, t, this.littleEndian, 52, 8),
  35017. i && (this.offset += 8),
  35018. this
  35019. }
  35020. ,
  35021. a.writeDouble = a.writeFloat64,
  35022. a.readFloat64 = function(e) {
  35023. var t = void 0 === e;
  35024. if (t && (e = this.offset),
  35025. !this.noAssert) {
  35026. if ("number" != typeof e || e % 1 != 0)
  35027. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35028. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength)
  35029. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  35030. }
  35031. var i = n(this.view, e, this.littleEndian, 52, 8);
  35032. return t && (this.offset += 8),
  35033. i
  35034. }
  35035. ,
  35036. a.readDouble = a.readFloat64,
  35037. f.MAX_VARINT32_BYTES = 5,
  35038. f.calculateVarint32 = function(e) {
  35039. return (e >>>= 0) < 128 ? 1 : e < 16384 ? 2 : e < 1 << 21 ? 3 : e < 1 << 28 ? 4 : 5
  35040. }
  35041. ,
  35042. f.zigZagEncode32 = function(e) {
  35043. return ((e |= 0) << 1 ^ e >> 31) >>> 0
  35044. }
  35045. ,
  35046. f.zigZagDecode32 = function(e) {
  35047. return e >>> 1 ^ -(1 & e) | 0
  35048. }
  35049. ,
  35050. a.writeVarint32 = function(e, t) {
  35051. var i = void 0 === t;
  35052. if (i && (t = this.offset),
  35053. !this.noAssert) {
  35054. if ("number" != typeof e || e % 1 != 0)
  35055. throw TypeError("Illegal value: " + e + " (not an integer)");
  35056. if (e |= 0,
  35057. "number" != typeof t || t % 1 != 0)
  35058. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35059. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35060. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35061. }
  35062. var n, r = f.calculateVarint32(e);
  35063. t += r;
  35064. var o = this.buffer.byteLength;
  35065. for (o < t && this.resize((o *= 2) > t ? o : t),
  35066. t -= r,
  35067. e >>>= 0; 128 <= e; )
  35068. n = 127 & e | 128,
  35069. this.view[t++] = n,
  35070. e >>>= 7;
  35071. return this.view[t++] = e,
  35072. i ? (this.offset = t,
  35073. this) : r
  35074. }
  35075. ,
  35076. a.writeVarint32ZigZag = function(e, t) {
  35077. return this.writeVarint32(f.zigZagEncode32(e), t)
  35078. }
  35079. ,
  35080. a.readVarint32 = function(e) {
  35081. var t = void 0 === e;
  35082. if (t && (e = this.offset),
  35083. !this.noAssert) {
  35084. if ("number" != typeof e || e % 1 != 0)
  35085. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35086. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35087. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35088. }
  35089. var i, n = 0, r = 0;
  35090. do {
  35091. if (!this.noAssert && e > this.limit) {
  35092. var o = Error("Truncated");
  35093. throw o.truncated = !0,
  35094. o
  35095. }
  35096. i = this.view[e++],
  35097. n < 5 && (r |= (127 & i) << 7 * n),
  35098. ++n
  35099. } while (0 != (128 & i));return r |= 0,
  35100. t ? (this.offset = e,
  35101. r) : {
  35102. value: r,
  35103. length: n
  35104. }
  35105. }
  35106. ,
  35107. a.readVarint32ZigZag = function(e) {
  35108. var t = this.readVarint32(e);
  35109. return "object" == typeof t ? t.value = f.zigZagDecode32(t.value) : t = f.zigZagDecode32(t),
  35110. t
  35111. }
  35112. ,
  35113. l && (f.MAX_VARINT64_BYTES = 10,
  35114. f.calculateVarint64 = function(e) {
  35115. "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e));
  35116. var t = e.toInt() >>> 0
  35117. , i = e.shiftRightUnsigned(28).toInt() >>> 0
  35118. , n = e.shiftRightUnsigned(56).toInt() >>> 0;
  35119. 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
  35120. }
  35121. ,
  35122. f.zigZagEncode64 = function(e) {
  35123. return "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned()),
  35124. e.shiftLeft(1).xor(e.shiftRight(63)).toUnsigned()
  35125. }
  35126. ,
  35127. f.zigZagDecode64 = function(e) {
  35128. return "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned()),
  35129. e.shiftRightUnsigned(1).xor(e.and(l.ONE).toSigned().negate()).toSigned()
  35130. }
  35131. ,
  35132. a.writeVarint64 = function(e, t) {
  35133. var i = void 0 === t;
  35134. if (i && (t = this.offset),
  35135. !this.noAssert) {
  35136. if ("number" == typeof e)
  35137. e = l.fromNumber(e);
  35138. else if ("string" == typeof e)
  35139. e = l.fromString(e);
  35140. else if (!(e && e instanceof l))
  35141. throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  35142. if ("number" != typeof t || t % 1 != 0)
  35143. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35144. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35145. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35146. }
  35147. "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned());
  35148. var n = f.calculateVarint64(e)
  35149. , r = e.toInt() >>> 0
  35150. , o = e.shiftRightUnsigned(28).toInt() >>> 0
  35151. , a = e.shiftRightUnsigned(56).toInt() >>> 0;
  35152. t += n;
  35153. var s = this.buffer.byteLength;
  35154. switch (s < t && this.resize((s *= 2) > t ? s : t),
  35155. t -= n,
  35156. n) {
  35157. case 10:
  35158. this.view[t + 9] = a >>> 7 & 1;
  35159. case 9:
  35160. this.view[t + 8] = 9 !== n ? 128 | a : 127 & a;
  35161. case 8:
  35162. this.view[t + 7] = 8 !== n ? o >>> 21 | 128 : o >>> 21 & 127;
  35163. case 7:
  35164. this.view[t + 6] = 7 !== n ? o >>> 14 | 128 : o >>> 14 & 127;
  35165. case 6:
  35166. this.view[t + 5] = 6 !== n ? o >>> 7 | 128 : o >>> 7 & 127;
  35167. case 5:
  35168. this.view[t + 4] = 5 !== n ? 128 | o : 127 & o;
  35169. case 4:
  35170. this.view[t + 3] = 4 !== n ? r >>> 21 | 128 : r >>> 21 & 127;
  35171. case 3:
  35172. this.view[t + 2] = 3 !== n ? r >>> 14 | 128 : r >>> 14 & 127;
  35173. case 2:
  35174. this.view[t + 1] = 2 !== n ? r >>> 7 | 128 : r >>> 7 & 127;
  35175. case 1:
  35176. this.view[t] = 1 !== n ? 128 | r : 127 & r
  35177. }
  35178. return i ? (this.offset += n,
  35179. this) : n
  35180. }
  35181. ,
  35182. a.writeVarint64ZigZag = function(e, t) {
  35183. return this.writeVarint64(f.zigZagEncode64(e), t)
  35184. }
  35185. ,
  35186. a.readVarint64 = function(e) {
  35187. var t = void 0 === e;
  35188. if (t && (e = this.offset),
  35189. !this.noAssert) {
  35190. if ("number" != typeof e || e % 1 != 0)
  35191. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35192. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35193. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35194. }
  35195. var i = e
  35196. , n = 0
  35197. , r = 0
  35198. , o = 0
  35199. , a = 0;
  35200. if (n = 127 & (a = this.view[e++]),
  35201. 128 & a && (n |= (127 & (a = this.view[e++])) << 7,
  35202. (128 & a || this.noAssert && void 0 === a) && (n |= (127 & (a = this.view[e++])) << 14,
  35203. (128 & a || this.noAssert && void 0 === a) && (n |= (127 & (a = this.view[e++])) << 21,
  35204. (128 & a || this.noAssert && void 0 === a) && (r = 127 & (a = this.view[e++]),
  35205. (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 7,
  35206. (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 14,
  35207. (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 21,
  35208. (128 & a || this.noAssert && void 0 === a) && (o = 127 & (a = this.view[e++]),
  35209. (128 & a || this.noAssert && void 0 === a) && (o |= (127 & (a = this.view[e++])) << 7,
  35210. 128 & a || this.noAssert && void 0 === a))))))))))
  35211. throw Error("Buffer overrun");
  35212. var s = l.fromBits(n | r << 28, r >>> 4 | o << 24, !1);
  35213. return t ? (this.offset = e,
  35214. s) : {
  35215. value: s,
  35216. length: e - i
  35217. }
  35218. }
  35219. ,
  35220. a.readVarint64ZigZag = function(e) {
  35221. var t = this.readVarint64(e);
  35222. return t && t.value instanceof l ? t.value = f.zigZagDecode64(t.value) : t = f.zigZagDecode64(t),
  35223. t
  35224. }
  35225. ),
  35226. a.writeCString = function(e, t) {
  35227. var i = void 0 === t;
  35228. i && (t = this.offset);
  35229. var n, r = e.length;
  35230. if (!this.noAssert) {
  35231. if ("string" != typeof e)
  35232. throw TypeError("Illegal str: Not a string");
  35233. for (n = 0; n < r; ++n)
  35234. if (0 === e.charCodeAt(n))
  35235. throw RangeError("Illegal str: Contains NULL-characters");
  35236. if ("number" != typeof t || t % 1 != 0)
  35237. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35238. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35239. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35240. }
  35241. r = d.calculateUTF16asUTF8(s(e))[1],
  35242. t += r + 1;
  35243. var o = this.buffer.byteLength;
  35244. return o < t && this.resize((o *= 2) > t ? o : t),
  35245. t -= r + 1,
  35246. d.encodeUTF16toUTF8(s(e), function(e) {
  35247. this.view[t++] = e
  35248. }
  35249. .bind(this)),
  35250. this.view[t++] = 0,
  35251. i ? (this.offset = t,
  35252. this) : r
  35253. }
  35254. ,
  35255. a.readCString = function(e) {
  35256. var t = void 0 === e;
  35257. if (t && (e = this.offset),
  35258. !this.noAssert) {
  35259. if ("number" != typeof e || e % 1 != 0)
  35260. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35261. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35262. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35263. }
  35264. var i, n = e, r = -1;
  35265. return d.decodeUTF8toUTF16(function() {
  35266. if (0 === r)
  35267. return null;
  35268. if (e >= this.limit)
  35269. throw RangeError("Illegal range: Truncated data, " + e + " < " + this.limit);
  35270. return 0 === (r = this.view[e++]) ? null : r
  35271. }
  35272. .bind(this), i = c(), !0),
  35273. t ? (this.offset = e,
  35274. i()) : {
  35275. string: i(),
  35276. length: e - n
  35277. }
  35278. }
  35279. ,
  35280. a.writeIString = function(e, t) {
  35281. var i = void 0 === t;
  35282. if (i && (t = this.offset),
  35283. !this.noAssert) {
  35284. if ("string" != typeof e)
  35285. throw TypeError("Illegal str: Not a string");
  35286. if ("number" != typeof t || t % 1 != 0)
  35287. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35288. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35289. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35290. }
  35291. var n, r = t;
  35292. n = d.calculateUTF16asUTF8(s(e), this.noAssert)[1],
  35293. t += 4 + n;
  35294. var o = this.buffer.byteLength;
  35295. if (o < t && this.resize((o *= 2) > t ? o : t),
  35296. t -= 4 + n,
  35297. this.littleEndian ? (this.view[t + 3] = n >>> 24 & 255,
  35298. this.view[t + 2] = n >>> 16 & 255,
  35299. this.view[t + 1] = n >>> 8 & 255,
  35300. this.view[t] = 255 & n) : (this.view[t] = n >>> 24 & 255,
  35301. this.view[t + 1] = n >>> 16 & 255,
  35302. this.view[t + 2] = n >>> 8 & 255,
  35303. this.view[t + 3] = 255 & n),
  35304. t += 4,
  35305. d.encodeUTF16toUTF8(s(e), function(e) {
  35306. this.view[t++] = e
  35307. }
  35308. .bind(this)),
  35309. t !== r + 4 + n)
  35310. throw RangeError("Illegal range: Truncated data, " + t + " == " + (t + 4 + n));
  35311. return i ? (this.offset = t,
  35312. this) : t - r
  35313. }
  35314. ,
  35315. a.readIString = function(e) {
  35316. var t = void 0 === e;
  35317. if (t && (e = this.offset),
  35318. !this.noAssert) {
  35319. if ("number" != typeof e || e % 1 != 0)
  35320. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35321. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  35322. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35323. }
  35324. var i = e
  35325. , n = this.readUint32(e)
  35326. , r = this.readUTF8String(n, f.METRICS_BYTES, e += 4);
  35327. return e += r.length,
  35328. t ? (this.offset = e,
  35329. r.string) : {
  35330. string: r.string,
  35331. length: e - i
  35332. }
  35333. }
  35334. ,
  35335. f.METRICS_CHARS = "c",
  35336. f.METRICS_BYTES = "b",
  35337. a.writeUTF8String = function(e, t) {
  35338. var i = void 0 === t;
  35339. if (i && (t = this.offset),
  35340. !this.noAssert) {
  35341. if ("number" != typeof t || t % 1 != 0)
  35342. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35343. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35344. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35345. }
  35346. var n, r = t;
  35347. n = d.calculateUTF16asUTF8(s(e))[1],
  35348. t += n;
  35349. var o = this.buffer.byteLength;
  35350. return o < t && this.resize((o *= 2) > t ? o : t),
  35351. t -= n,
  35352. d.encodeUTF16toUTF8(s(e), function(e) {
  35353. this.view[t++] = e
  35354. }
  35355. .bind(this)),
  35356. i ? (this.offset = t,
  35357. this) : t - r
  35358. }
  35359. ,
  35360. a.writeString = a.writeUTF8String,
  35361. f.calculateUTF8Chars = function(e) {
  35362. return d.calculateUTF16asUTF8(s(e))[0]
  35363. }
  35364. ,
  35365. f.calculateUTF8Bytes = function(e) {
  35366. return d.calculateUTF16asUTF8(s(e))[1]
  35367. }
  35368. ,
  35369. f.calculateString = f.calculateUTF8Bytes,
  35370. a.readUTF8String = function(e, t, i) {
  35371. "number" == typeof t && (i = t,
  35372. t = void 0);
  35373. var n = void 0 === i;
  35374. if (n && (i = this.offset),
  35375. void 0 === t && (t = f.METRICS_CHARS),
  35376. !this.noAssert) {
  35377. if ("number" != typeof e || e % 1 != 0)
  35378. throw TypeError("Illegal length: " + e + " (not an integer)");
  35379. if (e |= 0,
  35380. "number" != typeof i || i % 1 != 0)
  35381. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35382. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength)
  35383. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35384. }
  35385. var r, o = 0, a = i;
  35386. if (t === f.METRICS_CHARS) {
  35387. if (r = c(),
  35388. d.decodeUTF8(function() {
  35389. return o < e && i < this.limit ? this.view[i++] : null
  35390. }
  35391. .bind(this), function(e) {
  35392. ++o,
  35393. d.UTF8toUTF16(e, r)
  35394. }),
  35395. o !== e)
  35396. throw RangeError("Illegal range: Truncated data, " + o + " == " + e);
  35397. return n ? (this.offset = i,
  35398. r()) : {
  35399. string: r(),
  35400. length: i - a
  35401. }
  35402. }
  35403. if (t !== f.METRICS_BYTES)
  35404. throw TypeError("Unsupported metrics: " + t);
  35405. if (!this.noAssert) {
  35406. if ("number" != typeof i || i % 1 != 0)
  35407. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35408. if ((i >>>= 0) < 0 || i + e > this.buffer.byteLength)
  35409. throw RangeError("Illegal offset: 0 <= " + i + " (+" + e + ") <= " + this.buffer.byteLength)
  35410. }
  35411. var s = i + e;
  35412. if (d.decodeUTF8toUTF16(function() {
  35413. return i < s ? this.view[i++] : null
  35414. }
  35415. .bind(this), r = c(), this.noAssert),
  35416. i !== s)
  35417. throw RangeError("Illegal range: Truncated data, " + i + " == " + s);
  35418. return n ? (this.offset = i,
  35419. r()) : {
  35420. string: r(),
  35421. length: i - a
  35422. }
  35423. }
  35424. ,
  35425. a.readString = a.readUTF8String,
  35426. a.writeVString = function(e, t) {
  35427. var i = void 0 === t;
  35428. if (i && (t = this.offset),
  35429. !this.noAssert) {
  35430. if ("string" != typeof e)
  35431. throw TypeError("Illegal str: Not a string");
  35432. if ("number" != typeof t || t % 1 != 0)
  35433. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35434. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35435. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35436. }
  35437. var n, r, o = t;
  35438. n = d.calculateUTF16asUTF8(s(e), this.noAssert)[1],
  35439. r = f.calculateVarint32(n),
  35440. t += r + n;
  35441. var a = this.buffer.byteLength;
  35442. if (a < t && this.resize((a *= 2) > t ? a : t),
  35443. t -= r + n,
  35444. t += this.writeVarint32(n, t),
  35445. d.encodeUTF16toUTF8(s(e), function(e) {
  35446. this.view[t++] = e
  35447. }
  35448. .bind(this)),
  35449. t !== o + n + r)
  35450. throw RangeError("Illegal range: Truncated data, " + t + " == " + (t + n + r));
  35451. return i ? (this.offset = t,
  35452. this) : t - o
  35453. }
  35454. ,
  35455. a.readVString = function(e) {
  35456. var t = void 0 === e;
  35457. if (t && (e = this.offset),
  35458. !this.noAssert) {
  35459. if ("number" != typeof e || e % 1 != 0)
  35460. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35461. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35462. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35463. }
  35464. var i = e
  35465. , n = this.readVarint32(e)
  35466. , r = this.readUTF8String(n.value, f.METRICS_BYTES, e += n.length);
  35467. return e += r.length,
  35468. t ? (this.offset = e,
  35469. r.string) : {
  35470. string: r.string,
  35471. length: e - i
  35472. }
  35473. }
  35474. ,
  35475. a.append = function(e, t, i) {
  35476. "number" != typeof t && "string" == typeof t || (i = t,
  35477. t = void 0);
  35478. var n = void 0 === i;
  35479. if (n && (i = this.offset),
  35480. !this.noAssert) {
  35481. if ("number" != typeof i || i % 1 != 0)
  35482. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35483. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength)
  35484. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35485. }
  35486. e instanceof f || (e = f.wrap(e, t));
  35487. var r = e.limit - e.offset;
  35488. if (r <= 0)
  35489. return this;
  35490. i += r;
  35491. var o = this.buffer.byteLength;
  35492. return o < i && this.resize((o *= 2) > i ? o : i),
  35493. i -= r,
  35494. this.view.set(e.view.subarray(e.offset, e.limit), i),
  35495. e.offset += r,
  35496. n && (this.offset += r),
  35497. this
  35498. }
  35499. ,
  35500. a.appendTo = function(e, t) {
  35501. return e.append(this, t),
  35502. this
  35503. }
  35504. ,
  35505. a.assert = function(e) {
  35506. return this.noAssert = !e,
  35507. this
  35508. }
  35509. ,
  35510. a.capacity = function() {
  35511. return this.buffer.byteLength
  35512. }
  35513. ,
  35514. a.clear = function() {
  35515. return this.offset = 0,
  35516. this.limit = this.buffer.byteLength,
  35517. this.markedOffset = -1,
  35518. this
  35519. }
  35520. ,
  35521. a.clone = function(e) {
  35522. var t = new f(0,this.littleEndian,this.noAssert);
  35523. return e ? (t.buffer = new ArrayBuffer(this.buffer.byteLength),
  35524. t.view = new Uint8Array(t.buffer)) : (t.buffer = this.buffer,
  35525. t.view = this.view),
  35526. t.offset = this.offset,
  35527. t.markedOffset = this.markedOffset,
  35528. t.limit = this.limit,
  35529. t
  35530. }
  35531. ,
  35532. a.compact = function(e, t) {
  35533. if (void 0 === e && (e = this.offset),
  35534. void 0 === t && (t = this.limit),
  35535. !this.noAssert) {
  35536. if ("number" != typeof e || e % 1 != 0)
  35537. throw TypeError("Illegal begin: Not an integer");
  35538. if (e >>>= 0,
  35539. "number" != typeof t || t % 1 != 0)
  35540. throw TypeError("Illegal end: Not an integer");
  35541. if (t >>>= 0,
  35542. e < 0 || t < e || t > this.buffer.byteLength)
  35543. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35544. }
  35545. if (0 === e && t === this.buffer.byteLength)
  35546. return this;
  35547. var i = t - e;
  35548. if (0 == i)
  35549. return this.buffer = o,
  35550. this.view = null,
  35551. 0 <= this.markedOffset && (this.markedOffset -= e),
  35552. this.offset = 0,
  35553. this.limit = 0,
  35554. this;
  35555. var n = new ArrayBuffer(i)
  35556. , r = new Uint8Array(n);
  35557. return r.set(this.view.subarray(e, t)),
  35558. this.buffer = n,
  35559. this.view = r,
  35560. 0 <= this.markedOffset && (this.markedOffset -= e),
  35561. this.offset = 0,
  35562. this.limit = i,
  35563. this
  35564. }
  35565. ,
  35566. a.copy = function(e, t) {
  35567. if (void 0 === e && (e = this.offset),
  35568. void 0 === t && (t = this.limit),
  35569. !this.noAssert) {
  35570. if ("number" != typeof e || e % 1 != 0)
  35571. throw TypeError("Illegal begin: Not an integer");
  35572. if (e >>>= 0,
  35573. "number" != typeof t || t % 1 != 0)
  35574. throw TypeError("Illegal end: Not an integer");
  35575. if (t >>>= 0,
  35576. e < 0 || t < e || t > this.buffer.byteLength)
  35577. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35578. }
  35579. if (e === t)
  35580. return new f(0,this.littleEndian,this.noAssert);
  35581. var i = t - e
  35582. , n = new f(i,this.littleEndian,this.noAssert);
  35583. return n.offset = 0,
  35584. n.limit = i,
  35585. 0 <= n.markedOffset && (n.markedOffset -= e),
  35586. this.copyTo(n, 0, e, t),
  35587. n
  35588. }
  35589. ,
  35590. a.copyTo = function(e, t, i, n) {
  35591. var r, o;
  35592. if (!this.noAssert && !f.isByteBuffer(e))
  35593. throw TypeError("Illegal target: Not a ByteBuffer");
  35594. if (t = (o = void 0 === t) ? e.offset : 0 | t,
  35595. i = (r = void 0 === i) ? this.offset : 0 | i,
  35596. n = void 0 === n ? this.limit : 0 | n,
  35597. t < 0 || t > e.buffer.byteLength)
  35598. throw RangeError("Illegal target range: 0 <= " + t + " <= " + e.buffer.byteLength);
  35599. if (i < 0 || n > this.buffer.byteLength)
  35600. throw RangeError("Illegal source range: 0 <= " + i + " <= " + this.buffer.byteLength);
  35601. var a = n - i;
  35602. return 0 == a ? e : (e.ensureCapacity(t + a),
  35603. e.view.set(this.view.subarray(i, n), t),
  35604. r && (this.offset += a),
  35605. o && (e.offset += a),
  35606. this)
  35607. }
  35608. ,
  35609. a.ensureCapacity = function(e) {
  35610. var t = this.buffer.byteLength;
  35611. return t < e ? this.resize((t *= 2) > e ? t : e) : this
  35612. }
  35613. ,
  35614. a.fill = function(e, t, i) {
  35615. var n = void 0 === t;
  35616. if (n && (t = this.offset),
  35617. "string" == typeof e && 0 < e.length && (e = e.charCodeAt(0)),
  35618. void 0 === t && (t = this.offset),
  35619. void 0 === i && (i = this.limit),
  35620. !this.noAssert) {
  35621. if ("number" != typeof e || e % 1 != 0)
  35622. throw TypeError("Illegal value: " + e + " (not an integer)");
  35623. if (e |= 0,
  35624. "number" != typeof t || t % 1 != 0)
  35625. throw TypeError("Illegal begin: Not an integer");
  35626. if (t >>>= 0,
  35627. "number" != typeof i || i % 1 != 0)
  35628. throw TypeError("Illegal end: Not an integer");
  35629. if (i >>>= 0,
  35630. t < 0 || i < t || i > this.buffer.byteLength)
  35631. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  35632. }
  35633. if (i <= t)
  35634. return this;
  35635. for (; t < i; )
  35636. this.view[t++] = e;
  35637. return n && (this.offset = t),
  35638. this
  35639. }
  35640. ,
  35641. a.flip = function() {
  35642. return this.limit = this.offset,
  35643. this.offset = 0,
  35644. this
  35645. }
  35646. ,
  35647. a.mark = function(e) {
  35648. if (e = void 0 === e ? this.offset : e,
  35649. !this.noAssert) {
  35650. if ("number" != typeof e || e % 1 != 0)
  35651. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35652. if ((e >>>= 0) < 0 || e + 0 > this.buffer.byteLength)
  35653. throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
  35654. }
  35655. return this.markedOffset = e,
  35656. this
  35657. }
  35658. ,
  35659. a.order = function(e) {
  35660. if (!this.noAssert && "boolean" != typeof e)
  35661. throw TypeError("Illegal littleEndian: Not a boolean");
  35662. return this.littleEndian = !!e,
  35663. this
  35664. }
  35665. ,
  35666. a.LE = function(e) {
  35667. return this.littleEndian = void 0 === e || !!e,
  35668. this
  35669. }
  35670. ,
  35671. a.BE = function(e) {
  35672. return this.littleEndian = void 0 !== e && !e,
  35673. this
  35674. }
  35675. ,
  35676. a.prepend = function(e, t, i) {
  35677. "number" != typeof t && "string" == typeof t || (i = t,
  35678. t = void 0);
  35679. var n = void 0 === i;
  35680. if (n && (i = this.offset),
  35681. !this.noAssert) {
  35682. if ("number" != typeof i || i % 1 != 0)
  35683. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35684. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength)
  35685. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35686. }
  35687. e instanceof f || (e = f.wrap(e, t));
  35688. var r = e.limit - e.offset;
  35689. if (r <= 0)
  35690. return this;
  35691. var o = r - i;
  35692. if (0 < o) {
  35693. var a = new ArrayBuffer(this.buffer.byteLength + o)
  35694. , s = new Uint8Array(a);
  35695. s.set(this.view.subarray(i, this.buffer.byteLength), r),
  35696. this.buffer = a,
  35697. this.view = s,
  35698. this.offset += o,
  35699. 0 <= this.markedOffset && (this.markedOffset += o),
  35700. this.limit += o,
  35701. i += o
  35702. } else
  35703. new Uint8Array(this.buffer);
  35704. return this.view.set(e.view.subarray(e.offset, e.limit), i - r),
  35705. e.offset = e.limit,
  35706. n && (this.offset -= r),
  35707. this
  35708. }
  35709. ,
  35710. a.prependTo = function(e, t) {
  35711. return e.prepend(this, t),
  35712. this
  35713. }
  35714. ,
  35715. a.printDebug = function(e) {
  35716. "function" != typeof e && (e = console.log.bind(console)),
  35717. e(this.toString() + "\n-------------------------------------------------------------------\n" + this.toDebug(!0))
  35718. }
  35719. ,
  35720. a.remaining = function() {
  35721. return this.limit - this.offset
  35722. }
  35723. ,
  35724. a.reset = function() {
  35725. return 0 <= this.markedOffset ? (this.offset = this.markedOffset,
  35726. this.markedOffset = -1) : this.offset = 0,
  35727. this
  35728. }
  35729. ,
  35730. a.resize = function(e) {
  35731. if (!this.noAssert) {
  35732. if ("number" != typeof e || e % 1 != 0)
  35733. throw TypeError("Illegal capacity: " + e + " (not an integer)");
  35734. if ((e |= 0) < 0)
  35735. throw RangeError("Illegal capacity: 0 <= " + e)
  35736. }
  35737. if (this.buffer.byteLength < e) {
  35738. var t = new ArrayBuffer(e)
  35739. , i = new Uint8Array(t);
  35740. i.set(this.view),
  35741. this.buffer = t,
  35742. this.view = i
  35743. }
  35744. return this
  35745. }
  35746. ,
  35747. a.reverse = function(e, t) {
  35748. if (void 0 === e && (e = this.offset),
  35749. void 0 === t && (t = this.limit),
  35750. !this.noAssert) {
  35751. if ("number" != typeof e || e % 1 != 0)
  35752. throw TypeError("Illegal begin: Not an integer");
  35753. if (e >>>= 0,
  35754. "number" != typeof t || t % 1 != 0)
  35755. throw TypeError("Illegal end: Not an integer");
  35756. if (t >>>= 0,
  35757. e < 0 || t < e || t > this.buffer.byteLength)
  35758. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35759. }
  35760. return e === t || Array.prototype.reverse.call(this.view.subarray(e, t)),
  35761. this
  35762. }
  35763. ,
  35764. a.skip = function(e) {
  35765. if (!this.noAssert) {
  35766. if ("number" != typeof e || e % 1 != 0)
  35767. throw TypeError("Illegal length: " + e + " (not an integer)");
  35768. e |= 0
  35769. }
  35770. var t = this.offset + e;
  35771. if (!this.noAssert && (t < 0 || t > this.buffer.byteLength))
  35772. throw RangeError("Illegal length: 0 <= " + this.offset + " + " + e + " <= " + this.buffer.byteLength);
  35773. return this.offset = t,
  35774. this
  35775. }
  35776. ,
  35777. a.slice = function(e, t) {
  35778. if (void 0 === e && (e = this.offset),
  35779. void 0 === t && (t = this.limit),
  35780. !this.noAssert) {
  35781. if ("number" != typeof e || e % 1 != 0)
  35782. throw TypeError("Illegal begin: Not an integer");
  35783. if (e >>>= 0,
  35784. "number" != typeof t || t % 1 != 0)
  35785. throw TypeError("Illegal end: Not an integer");
  35786. if (t >>>= 0,
  35787. e < 0 || t < e || t > this.buffer.byteLength)
  35788. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35789. }
  35790. var i = this.clone();
  35791. return i.offset = e,
  35792. i.limit = t,
  35793. i
  35794. }
  35795. ,
  35796. a.toBuffer = function(e) {
  35797. var t = this.offset
  35798. , i = this.limit;
  35799. if (!this.noAssert) {
  35800. if ("number" != typeof t || t % 1 != 0)
  35801. throw TypeError("Illegal offset: Not an integer");
  35802. if (t >>>= 0,
  35803. "number" != typeof i || i % 1 != 0)
  35804. throw TypeError("Illegal limit: Not an integer");
  35805. if (i >>>= 0,
  35806. t < 0 || i < t || i > this.buffer.byteLength)
  35807. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  35808. }
  35809. if (!e && 0 === t && i === this.buffer.byteLength)
  35810. return this.buffer;
  35811. if (t === i)
  35812. return o;
  35813. var n = new ArrayBuffer(i - t);
  35814. return new Uint8Array(n).set(new Uint8Array(this.buffer).subarray(t, i), 0),
  35815. n
  35816. }
  35817. ,
  35818. a.toArrayBuffer = a.toBuffer,
  35819. a.toString = function(e, t, i) {
  35820. if (void 0 === e)
  35821. return "ByteBufferAB(offset=" + this.offset + ",markedOffset=" + this.markedOffset + ",limit=" + this.limit + ",capacity=" + this.capacity() + ")";
  35822. switch ("number" == typeof e && (i = t = e = "utf8"),
  35823. e) {
  35824. case "utf8":
  35825. return this.toUTF8(t, i);
  35826. case "base64":
  35827. return this.toBase64(t, i);
  35828. case "hex":
  35829. return this.toHex(t, i);
  35830. case "binary":
  35831. return this.toBinary(t, i);
  35832. case "debug":
  35833. return this.toDebug();
  35834. case "columns":
  35835. return this.toColumns();
  35836. default:
  35837. throw Error("Unsupported encoding: " + e)
  35838. }
  35839. }
  35840. ;
  35841. var h = function() {
  35842. 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)
  35843. a[r[t]] = t;
  35844. return e.encode = function(e, t) {
  35845. for (var i, n; null !== (i = e()); )
  35846. t(r[i >> 2 & 63]),
  35847. n = (3 & i) << 4,
  35848. null !== (i = e()) ? (t(r[63 & ((n |= i >> 4 & 15) | i >> 4 & 15)]),
  35849. n = (15 & i) << 2,
  35850. null !== (i = e()) ? (t(r[63 & (n | i >> 6 & 3)]),
  35851. t(r[63 & i])) : (t(r[63 & n]),
  35852. t(61))) : (t(r[63 & n]),
  35853. t(61),
  35854. t(61))
  35855. }
  35856. ,
  35857. e.decode = function(e, t) {
  35858. function i(e) {
  35859. throw Error("Illegal character code: " + e)
  35860. }
  35861. for (var n, r, o; null !== (n = e()); )
  35862. if (void 0 === (r = a[n]) && i(n),
  35863. null !== (n = e()) && (void 0 === (o = a[n]) && i(n),
  35864. t(r << 2 >>> 0 | (48 & o) >> 4),
  35865. null !== (n = e()))) {
  35866. if (void 0 === (r = a[n])) {
  35867. if (61 === n)
  35868. break;
  35869. i(n)
  35870. }
  35871. if (t((15 & o) << 4 >>> 0 | (60 & r) >> 2),
  35872. null !== (n = e())) {
  35873. if (void 0 === (o = a[n])) {
  35874. if (61 === n)
  35875. break;
  35876. i(n)
  35877. }
  35878. t((3 & r) << 6 >>> 0 | o)
  35879. }
  35880. }
  35881. }
  35882. ,
  35883. e.test = function(e) {
  35884. return /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)
  35885. }
  35886. ,
  35887. e
  35888. }();
  35889. a.toBase64 = function(e, t) {
  35890. if (void 0 === e && (e = this.offset),
  35891. void 0 === t && (t = this.limit),
  35892. t |= 0,
  35893. (e |= 0) < 0 || t > this.capacity || t < e)
  35894. throw RangeError("begin, end");
  35895. var i;
  35896. return h.encode(function() {
  35897. return e < t ? this.view[e++] : null
  35898. }
  35899. .bind(this), i = c()),
  35900. i()
  35901. }
  35902. ,
  35903. f.fromBase64 = function(e, t) {
  35904. if ("string" != typeof e)
  35905. throw TypeError("str");
  35906. var i = new f(e.length / 4 * 3,t)
  35907. , n = 0;
  35908. return h.decode(s(e), function(e) {
  35909. i.view[n++] = e
  35910. }),
  35911. i.limit = n,
  35912. i
  35913. }
  35914. ,
  35915. f.btoa = function(e) {
  35916. return f.fromBinary(e).toBase64()
  35917. }
  35918. ,
  35919. f.atob = function(e) {
  35920. return f.fromBase64(e).toBinary()
  35921. }
  35922. ,
  35923. a.toBinary = function(e, t) {
  35924. if (void 0 === e && (e = this.offset),
  35925. void 0 === t && (t = this.limit),
  35926. t |= 0,
  35927. (e |= 0) < 0 || t > this.capacity() || t < e)
  35928. throw RangeError("begin, end");
  35929. if (e === t)
  35930. return "";
  35931. for (var i = [], n = []; e < t; )
  35932. i.push(this.view[e++]),
  35933. 1024 <= i.length && (n.push(String.fromCharCode.apply(String, i)),
  35934. i = []);
  35935. return n.join("") + String.fromCharCode.apply(String, i)
  35936. }
  35937. ,
  35938. f.fromBinary = function(e, t) {
  35939. if ("string" != typeof e)
  35940. throw TypeError("str");
  35941. for (var i, n = 0, r = e.length, o = new f(r,t); n < r; ) {
  35942. if (255 < (i = e.charCodeAt(n)))
  35943. throw RangeError("illegal char code: " + i);
  35944. o.view[n++] = i
  35945. }
  35946. return o.limit = r,
  35947. o
  35948. }
  35949. ,
  35950. a.toDebug = function(e) {
  35951. for (var t, i = -1, n = this.buffer.byteLength, r = "", o = "", a = ""; i < n; ) {
  35952. if (-1 !== i && (r += (t = this.view[i]) < 16 ? "0" + t.toString(16).toUpperCase() : t.toString(16).toUpperCase(),
  35953. e && (o += 32 < t && t < 127 ? String.fromCharCode(t) : ".")),
  35954. ++i,
  35955. e && 0 < i && i % 16 == 0 && i !== n) {
  35956. for (; r.length < 51; )
  35957. r += " ";
  35958. a += r + o + "\n",
  35959. r = o = ""
  35960. }
  35961. 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 ? " " : ""
  35962. }
  35963. if (e && " " !== r) {
  35964. for (; r.length < 51; )
  35965. r += " ";
  35966. a += r + o + "\n"
  35967. }
  35968. return e ? a : r
  35969. }
  35970. ,
  35971. f.fromDebug = function(e, t, i) {
  35972. 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; ) {
  35973. switch (n = e.charAt(s++)) {
  35974. case "!":
  35975. if (!i) {
  35976. if (h || u || d) {
  35977. p = !0;
  35978. break
  35979. }
  35980. h = u = d = !0
  35981. }
  35982. a.offset = a.markedOffset = a.limit = l,
  35983. c = !1;
  35984. break;
  35985. case "|":
  35986. if (!i) {
  35987. if (h || d) {
  35988. p = !0;
  35989. break
  35990. }
  35991. h = d = !0
  35992. }
  35993. a.offset = a.limit = l,
  35994. c = !1;
  35995. break;
  35996. case "[":
  35997. if (!i) {
  35998. if (h || u) {
  35999. p = !0;
  36000. break
  36001. }
  36002. h = u = !0
  36003. }
  36004. a.offset = a.markedOffset = l,
  36005. c = !1;
  36006. break;
  36007. case "<":
  36008. if (!i) {
  36009. if (h) {
  36010. p = !0;
  36011. break
  36012. }
  36013. h = !0
  36014. }
  36015. a.offset = l,
  36016. c = !1;
  36017. break;
  36018. case "]":
  36019. if (!i) {
  36020. if (d || u) {
  36021. p = !0;
  36022. break
  36023. }
  36024. d = u = !0
  36025. }
  36026. a.limit = a.markedOffset = l,
  36027. c = !1;
  36028. break;
  36029. case ">":
  36030. if (!i) {
  36031. if (d) {
  36032. p = !0;
  36033. break
  36034. }
  36035. d = !0
  36036. }
  36037. a.limit = l,
  36038. c = !1;
  36039. break;
  36040. case "'":
  36041. if (!i) {
  36042. if (u) {
  36043. p = !0;
  36044. break
  36045. }
  36046. u = !0
  36047. }
  36048. a.markedOffset = l,
  36049. c = !1;
  36050. break;
  36051. case " ":
  36052. c = !1;
  36053. break;
  36054. default:
  36055. if (!i && c) {
  36056. p = !0;
  36057. break
  36058. }
  36059. if (r = parseInt(n + e.charAt(s++), 16),
  36060. !i && (isNaN(r) || r < 0 || 255 < r))
  36061. throw TypeError("Illegal str: Not a debug encoded string");
  36062. a.view[l++] = r,
  36063. c = !0
  36064. }
  36065. if (p)
  36066. throw TypeError("Illegal str: Invalid symbol at " + s)
  36067. }
  36068. if (!i) {
  36069. if (!h || !d)
  36070. throw TypeError("Illegal str: Missing offset or limit");
  36071. if (l < a.buffer.byteLength)
  36072. throw TypeError("Illegal str: Not a debug encoded string (is it hex?) " + l + " < " + o)
  36073. }
  36074. return a
  36075. }
  36076. ,
  36077. a.toHex = function(e, t) {
  36078. if (e = void 0 === e ? this.offset : e,
  36079. t = void 0 === t ? this.limit : t,
  36080. !this.noAssert) {
  36081. if ("number" != typeof e || e % 1 != 0)
  36082. throw TypeError("Illegal begin: Not an integer");
  36083. if (e >>>= 0,
  36084. "number" != typeof t || t % 1 != 0)
  36085. throw TypeError("Illegal end: Not an integer");
  36086. if (t >>>= 0,
  36087. e < 0 || t < e || t > this.buffer.byteLength)
  36088. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  36089. }
  36090. for (var i, n = new Array(t - e); e < t; )
  36091. (i = this.view[e++]) < 16 ? n.push("0", i.toString(16)) : n.push(i.toString(16));
  36092. return n.join("")
  36093. }
  36094. ,
  36095. f.fromHex = function(e, t, i) {
  36096. if (!i) {
  36097. if ("string" != typeof e)
  36098. throw TypeError("Illegal str: Not a string");
  36099. if (e.length % 2 != 0)
  36100. throw TypeError("Illegal str: Length not a multiple of 2")
  36101. }
  36102. for (var n, r = e.length, o = new f(r / 2 | 0,t), a = 0, s = 0; a < r; a += 2) {
  36103. if (n = parseInt(e.substring(a, a + 2), 16),
  36104. !i && (!isFinite(n) || n < 0 || 255 < n))
  36105. throw TypeError("Illegal str: Contains non-hex characters");
  36106. o.view[s++] = n
  36107. }
  36108. return o.limit = s,
  36109. o
  36110. }
  36111. ;
  36112. var u, d = u = {
  36113. MAX_CODEPOINT: 1114111,
  36114. encodeUTF8: function(e, t) {
  36115. var i = null;
  36116. for ("number" == typeof e && (i = e,
  36117. e = function() {
  36118. return null
  36119. }
  36120. ); null !== i || null !== (i = e()); )
  36121. i < 128 ? t(127 & i) : (i < 2048 ? t(i >> 6 & 31 | 192) : (i < 65536 ? t(i >> 12 & 15 | 224) : (t(i >> 18 & 7 | 240),
  36122. t(i >> 12 & 63 | 128)),
  36123. t(i >> 6 & 63 | 128)),
  36124. t(63 & i | 128)),
  36125. i = null
  36126. },
  36127. decodeUTF8: function(e, t) {
  36128. for (var i, n, r, o, a = function(e) {
  36129. e = e.slice(0, e.indexOf(null));
  36130. var t = Error(e.toString());
  36131. throw t.name = "TruncatedError",
  36132. t.bytes = e,
  36133. t
  36134. }; null !== (i = e()); )
  36135. if (0 == (128 & i))
  36136. t(i);
  36137. else if (192 == (224 & i))
  36138. null === (n = e()) && a([i, n]),
  36139. t((31 & i) << 6 | 63 & n);
  36140. else if (224 == (240 & i))
  36141. null !== (n = e()) && null !== (r = e()) || a([i, n, r]),
  36142. t((15 & i) << 12 | (63 & n) << 6 | 63 & r);
  36143. else {
  36144. if (240 != (248 & i))
  36145. throw RangeError("Illegal starting byte: " + i);
  36146. null !== (n = e()) && null !== (r = e()) && null !== (o = e()) || a([i, n, r, o]),
  36147. t((7 & i) << 18 | (63 & n) << 12 | (63 & r) << 6 | 63 & o)
  36148. }
  36149. },
  36150. UTF16toUTF8: function(e, t) {
  36151. for (var i, n = null; null !== (i = null !== n ? n : e()); )
  36152. 55296 <= i && i <= 57343 && null !== (n = e()) && 56320 <= n && n <= 57343 ? (t(1024 * (i - 55296) + n - 56320 + 65536),
  36153. n = null) : t(i);
  36154. null !== n && t(n)
  36155. },
  36156. UTF8toUTF16: function(e, t) {
  36157. var i = null;
  36158. for ("number" == typeof e && (i = e,
  36159. e = function() {
  36160. return null
  36161. }
  36162. ); null !== i || null !== (i = e()); )
  36163. i <= 65535 ? t(i) : (t(55296 + ((i -= 65536) >> 10)),
  36164. t(i % 1024 + 56320)),
  36165. i = null
  36166. },
  36167. encodeUTF16toUTF8: function(e, t) {
  36168. u.UTF16toUTF8(e, function(e) {
  36169. u.encodeUTF8(e, t)
  36170. })
  36171. },
  36172. decodeUTF8toUTF16: function(e, t) {
  36173. u.decodeUTF8(e, function(e) {
  36174. u.UTF8toUTF16(e, t)
  36175. })
  36176. },
  36177. calculateCodePoint: function(e) {
  36178. return e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  36179. },
  36180. calculateUTF8: function(e) {
  36181. for (var t, i = 0; null !== (t = e()); )
  36182. i += t < 128 ? 1 : t < 2048 ? 2 : t < 65536 ? 3 : 4;
  36183. return i
  36184. },
  36185. calculateUTF16asUTF8: function(e) {
  36186. var t = 0
  36187. , i = 0;
  36188. return u.UTF16toUTF8(e, function(e) {
  36189. ++t,
  36190. i += e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  36191. }),
  36192. [t, i]
  36193. }
  36194. };
  36195. return a.toUTF8 = function(t, i) {
  36196. if (void 0 === t && (t = this.offset),
  36197. void 0 === i && (i = this.limit),
  36198. !this.noAssert) {
  36199. if ("number" != typeof t || t % 1 != 0)
  36200. throw TypeError("Illegal begin: Not an integer");
  36201. if (t >>>= 0,
  36202. "number" != typeof i || i % 1 != 0)
  36203. throw TypeError("Illegal end: Not an integer");
  36204. if (i >>>= 0,
  36205. t < 0 || i < t || i > this.buffer.byteLength)
  36206. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  36207. }
  36208. var e;
  36209. try {
  36210. d.decodeUTF8toUTF16(function() {
  36211. return t < i ? this.view[t++] : null
  36212. }
  36213. .bind(this), e = c())
  36214. } catch (e) {
  36215. if (t !== i)
  36216. throw RangeError("Illegal range: Truncated data, " + t + " != " + i)
  36217. }
  36218. return e()
  36219. }
  36220. ,
  36221. f.fromUTF8 = function(e, t, i) {
  36222. if (!i && "string" != typeof e)
  36223. throw TypeError("Illegal str: Not a string");
  36224. var n = new f(d.calculateUTF16asUTF8(s(e), !0)[1],t,i)
  36225. , r = 0;
  36226. return d.encodeUTF16toUTF8(s(e), function(e) {
  36227. n.view[r++] = e
  36228. }),
  36229. n.limit = r,
  36230. n
  36231. }
  36232. ,
  36233. f
  36234. }
  36235. ,
  36236. "function" == typeof define && define.amd ? define(["long"], r) : "function" == typeof t && "object" == typeof e && e && e.exports ? e.exports = function() {
  36237. var e;
  36238. try {
  36239. e = t("long")
  36240. } catch (e) {}
  36241. return r(e)
  36242. }() : (n.dcodeIO = n.dcodeIO || {}).ByteBuffer = r(n.dcodeIO.Long)
  36243. }
  36244. , {
  36245. long: 216
  36246. }],
  36247. 216: [function(e, t, i) {
  36248. var n, r;
  36249. n = this,
  36250. r = function() {
  36251. "use strict";
  36252. function n(e, t, i) {
  36253. this.low = 0 | e,
  36254. this.high = 0 | t,
  36255. this.unsigned = !!i
  36256. }
  36257. function p(e) {
  36258. return !0 === (e && e.__isLong__)
  36259. }
  36260. function e(e, t) {
  36261. var i, n, r;
  36262. return t ? (r = 0 <= (e >>>= 0) && e < 256) && (n = a[e]) ? n : (i = g(e, (0 | e) < 0 ? -1 : 0, !0),
  36263. r && (a[e] = i),
  36264. i) : (r = -128 <= (e |= 0) && e < 128) && (n = o[e]) ? n : (i = g(e, e < 0 ? -1 : 0, !1),
  36265. r && (o[e] = i),
  36266. i)
  36267. }
  36268. function f(e, t) {
  36269. if (isNaN(e) || !isFinite(e))
  36270. return t ? l : y;
  36271. if (t) {
  36272. if (e < 0)
  36273. return l;
  36274. if (r <= e)
  36275. return I
  36276. } else {
  36277. if (e <= -s)
  36278. return E;
  36279. if (s <= e + 1)
  36280. return C
  36281. }
  36282. return e < 0 ? f(-e, t).neg() : g(e % i | 0, e / i | 0, t)
  36283. }
  36284. function g(e, t, i) {
  36285. return new n(e,t,i)
  36286. }
  36287. function h(e, t, i) {
  36288. if (0 === e.length)
  36289. throw Error("empty string");
  36290. if ("NaN" === e || "Infinity" === e || "+Infinity" === e || "-Infinity" === e)
  36291. return y;
  36292. if (t = "number" == typeof t ? (i = t,
  36293. !1) : !!t,
  36294. (i = i || 10) < 2 || 36 < i)
  36295. throw RangeError("radix");
  36296. var n;
  36297. if (0 < (n = e.indexOf("-")))
  36298. throw Error("interior hyphen");
  36299. if (0 === n)
  36300. return h(e.substring(1), t, i).neg();
  36301. for (var r = f(u(i, 8)), o = y, a = 0; a < e.length; a += 8) {
  36302. var s = Math.min(8, e.length - a)
  36303. , l = parseInt(e.substring(a, a + s), i);
  36304. if (s < 8) {
  36305. var c = f(u(i, s));
  36306. o = o.mul(c).add(f(l))
  36307. } else
  36308. o = (o = o.mul(r)).add(f(l))
  36309. }
  36310. return o.unsigned = t,
  36311. o
  36312. }
  36313. function m(e) {
  36314. return e instanceof n ? e : "number" == typeof e ? f(e) : "string" == typeof e ? h(e) : g(e.low, e.high, e.unsigned)
  36315. }
  36316. Object.defineProperty(n.prototype, "__isLong__", {
  36317. value: !0,
  36318. enumerable: !1,
  36319. configurable: !1
  36320. }),
  36321. n.isLong = p;
  36322. var o = {}
  36323. , a = {};
  36324. n.fromInt = e,
  36325. n.fromNumber = f,
  36326. n.fromBits = g;
  36327. var u = Math.pow;
  36328. n.fromString = h,
  36329. n.fromValue = m;
  36330. var i = 4294967296
  36331. , r = 0x10000000000000000
  36332. , s = r / 2
  36333. , v = e(1 << 24)
  36334. , y = e(0);
  36335. n.ZERO = y;
  36336. var l = e(0, !0);
  36337. n.UZERO = l;
  36338. var c = e(1);
  36339. n.ONE = c;
  36340. var d = e(1, !0);
  36341. n.UONE = d;
  36342. var A = e(-1);
  36343. n.NEG_ONE = A;
  36344. var C = g(-1, 2147483647, !1);
  36345. n.MAX_VALUE = C;
  36346. var I = g(-1, -1, !0);
  36347. n.MAX_UNSIGNED_VALUE = I;
  36348. var E = g(0, -2147483648, !1);
  36349. n.MIN_VALUE = E;
  36350. var t = n.prototype;
  36351. return t.toInt = function() {
  36352. return this.unsigned ? this.low >>> 0 : this.low
  36353. }
  36354. ,
  36355. t.toNumber = function() {
  36356. return this.unsigned ? (this.high >>> 0) * i + (this.low >>> 0) : this.high * i + (this.low >>> 0)
  36357. }
  36358. ,
  36359. t.toString = function(e) {
  36360. if ((e = e || 10) < 2 || 36 < e)
  36361. throw RangeError("radix");
  36362. if (this.isZero())
  36363. return "0";
  36364. if (this.isNegative()) {
  36365. if (this.eq(E)) {
  36366. var t = f(e)
  36367. , i = this.div(t)
  36368. , n = i.mul(t).sub(this);
  36369. return i.toString(e) + n.toInt().toString(e)
  36370. }
  36371. return "-" + this.neg().toString(e)
  36372. }
  36373. for (var r = f(u(e, 6), this.unsigned), o = this, a = ""; ; ) {
  36374. var s = o.div(r)
  36375. , l = (o.sub(s.mul(r)).toInt() >>> 0).toString(e);
  36376. if ((o = s).isZero())
  36377. return l + a;
  36378. for (; l.length < 6; )
  36379. l = "0" + l;
  36380. a = "" + l + a
  36381. }
  36382. }
  36383. ,
  36384. t.getHighBits = function() {
  36385. return this.high
  36386. }
  36387. ,
  36388. t.getHighBitsUnsigned = function() {
  36389. return this.high >>> 0
  36390. }
  36391. ,
  36392. t.getLowBits = function() {
  36393. return this.low
  36394. }
  36395. ,
  36396. t.getLowBitsUnsigned = function() {
  36397. return this.low >>> 0
  36398. }
  36399. ,
  36400. t.getNumBitsAbs = function() {
  36401. if (this.isNegative())
  36402. return this.eq(E) ? 64 : this.neg().getNumBitsAbs();
  36403. for (var e = 0 != this.high ? this.high : this.low, t = 31; 0 < t && 0 == (e & 1 << t); t--)
  36404. ;
  36405. return 0 != this.high ? t + 33 : t + 1
  36406. }
  36407. ,
  36408. t.isZero = function() {
  36409. return 0 === this.high && 0 === this.low
  36410. }
  36411. ,
  36412. t.isNegative = function() {
  36413. return !this.unsigned && this.high < 0
  36414. }
  36415. ,
  36416. t.isPositive = function() {
  36417. return this.unsigned || 0 <= this.high
  36418. }
  36419. ,
  36420. t.isOdd = function() {
  36421. return 1 == (1 & this.low)
  36422. }
  36423. ,
  36424. t.isEven = function() {
  36425. return 0 == (1 & this.low)
  36426. }
  36427. ,
  36428. t.equals = function(e) {
  36429. return p(e) || (e = m(e)),
  36430. (this.unsigned === e.unsigned || this.high >>> 31 != 1 || e.high >>> 31 != 1) && this.high === e.high && this.low === e.low
  36431. }
  36432. ,
  36433. t.eq = t.equals,
  36434. t.notEquals = function(e) {
  36435. return !this.eq(e)
  36436. }
  36437. ,
  36438. t.neq = t.notEquals,
  36439. t.lessThan = function(e) {
  36440. return this.comp(e) < 0
  36441. }
  36442. ,
  36443. t.lt = t.lessThan,
  36444. t.lessThanOrEqual = function(e) {
  36445. return this.comp(e) <= 0
  36446. }
  36447. ,
  36448. t.lte = t.lessThanOrEqual,
  36449. t.greaterThan = function(e) {
  36450. return 0 < this.comp(e)
  36451. }
  36452. ,
  36453. t.gt = t.greaterThan,
  36454. t.greaterThanOrEqual = function(e) {
  36455. return 0 <= this.comp(e)
  36456. }
  36457. ,
  36458. t.gte = t.greaterThanOrEqual,
  36459. t.compare = function(e) {
  36460. if (p(e) || (e = m(e)),
  36461. this.eq(e))
  36462. return 0;
  36463. var t = this.isNegative()
  36464. , i = e.isNegative();
  36465. 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
  36466. }
  36467. ,
  36468. t.comp = t.compare,
  36469. t.negate = function() {
  36470. return !this.unsigned && this.eq(E) ? E : this.not().add(c)
  36471. }
  36472. ,
  36473. t.neg = t.negate,
  36474. t.add = function(e) {
  36475. p(e) || (e = m(e));
  36476. var t = this.high >>> 16
  36477. , i = 65535 & this.high
  36478. , n = this.low >>> 16
  36479. , r = 65535 & this.low
  36480. , o = e.high >>> 16
  36481. , a = 65535 & e.high
  36482. , s = e.low >>> 16
  36483. , l = 0
  36484. , c = 0
  36485. , h = 0
  36486. , u = 0;
  36487. return h += (u += r + (65535 & e.low)) >>> 16,
  36488. c += (h += n + s) >>> 16,
  36489. l += (c += i + a) >>> 16,
  36490. l += t + o,
  36491. g((h &= 65535) << 16 | (u &= 65535), (l &= 65535) << 16 | (c &= 65535), this.unsigned)
  36492. }
  36493. ,
  36494. t.subtract = function(e) {
  36495. return p(e) || (e = m(e)),
  36496. this.add(e.neg())
  36497. }
  36498. ,
  36499. t.sub = t.subtract,
  36500. t.multiply = function(e) {
  36501. if (this.isZero())
  36502. return y;
  36503. if (p(e) || (e = m(e)),
  36504. e.isZero())
  36505. return y;
  36506. if (this.eq(E))
  36507. return e.isOdd() ? E : y;
  36508. if (e.eq(E))
  36509. return this.isOdd() ? E : y;
  36510. if (this.isNegative())
  36511. return e.isNegative() ? this.neg().mul(e.neg()) : this.neg().mul(e).neg();
  36512. if (e.isNegative())
  36513. return this.mul(e.neg()).neg();
  36514. if (this.lt(v) && e.lt(v))
  36515. return f(this.toNumber() * e.toNumber(), this.unsigned);
  36516. var t = this.high >>> 16
  36517. , i = 65535 & this.high
  36518. , n = this.low >>> 16
  36519. , r = 65535 & this.low
  36520. , o = e.high >>> 16
  36521. , a = 65535 & e.high
  36522. , s = e.low >>> 16
  36523. , l = 65535 & e.low
  36524. , c = 0
  36525. , h = 0
  36526. , u = 0
  36527. , d = 0;
  36528. return u += (d += r * l) >>> 16,
  36529. h += (u += n * l) >>> 16,
  36530. u &= 65535,
  36531. h += (u += r * s) >>> 16,
  36532. c += (h += i * l) >>> 16,
  36533. h &= 65535,
  36534. c += (h += n * s) >>> 16,
  36535. h &= 65535,
  36536. c += (h += r * a) >>> 16,
  36537. c += t * l + i * s + n * a + r * o,
  36538. g((u &= 65535) << 16 | (d &= 65535), (c &= 65535) << 16 | (h &= 65535), this.unsigned)
  36539. }
  36540. ,
  36541. t.mul = t.multiply,
  36542. t.divide = function(e) {
  36543. if (p(e) || (e = m(e)),
  36544. e.isZero())
  36545. throw Error("division by zero");
  36546. if (this.isZero())
  36547. return this.unsigned ? l : y;
  36548. var t, i, n;
  36549. if (this.unsigned) {
  36550. if (e.unsigned || (e = e.toUnsigned()),
  36551. e.gt(this))
  36552. return l;
  36553. if (e.gt(this.shru(1)))
  36554. return d;
  36555. n = l
  36556. } else {
  36557. if (this.eq(E))
  36558. 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)),
  36559. n = t.add(i.div(e)));
  36560. if (e.eq(E))
  36561. return this.unsigned ? l : y;
  36562. if (this.isNegative())
  36563. return e.isNegative() ? this.neg().div(e.neg()) : this.neg().div(e).neg();
  36564. if (e.isNegative())
  36565. return this.div(e.neg()).neg();
  36566. n = y
  36567. }
  36568. for (i = this; i.gte(e); ) {
  36569. t = Math.max(1, Math.floor(i.toNumber() / e.toNumber()));
  36570. 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); )
  36571. s = (a = f(t -= o, this.unsigned)).mul(e);
  36572. a.isZero() && (a = c),
  36573. n = n.add(a),
  36574. i = i.sub(s)
  36575. }
  36576. return n
  36577. }
  36578. ,
  36579. t.div = t.divide,
  36580. t.modulo = function(e) {
  36581. return p(e) || (e = m(e)),
  36582. this.sub(this.div(e).mul(e))
  36583. }
  36584. ,
  36585. t.mod = t.modulo,
  36586. t.not = function() {
  36587. return g(~this.low, ~this.high, this.unsigned)
  36588. }
  36589. ,
  36590. t.and = function(e) {
  36591. return p(e) || (e = m(e)),
  36592. g(this.low & e.low, this.high & e.high, this.unsigned)
  36593. }
  36594. ,
  36595. t.or = function(e) {
  36596. return p(e) || (e = m(e)),
  36597. g(this.low | e.low, this.high | e.high, this.unsigned)
  36598. }
  36599. ,
  36600. t.xor = function(e) {
  36601. return p(e) || (e = m(e)),
  36602. g(this.low ^ e.low, this.high ^ e.high, this.unsigned)
  36603. }
  36604. ,
  36605. t.shiftLeft = function(e) {
  36606. return p(e) && (e = e.toInt()),
  36607. 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)
  36608. }
  36609. ,
  36610. t.shl = t.shiftLeft,
  36611. t.shiftRight = function(e) {
  36612. return p(e) && (e = e.toInt()),
  36613. 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)
  36614. }
  36615. ,
  36616. t.shr = t.shiftRight,
  36617. t.shiftRightUnsigned = function(e) {
  36618. if (p(e) && (e = e.toInt()),
  36619. 0 === (e &= 63))
  36620. return this;
  36621. var t = this.high;
  36622. return e < 32 ? g(this.low >>> e | t << 32 - e, t >>> e, this.unsigned) : g(32 === e ? t : t >>> e - 32, 0, this.unsigned)
  36623. }
  36624. ,
  36625. t.shru = t.shiftRightUnsigned,
  36626. t.toSigned = function() {
  36627. return this.unsigned ? g(this.low, this.high, !1) : this
  36628. }
  36629. ,
  36630. t.toUnsigned = function() {
  36631. return this.unsigned ? this : g(this.low, this.high, !0)
  36632. }
  36633. ,
  36634. t.toBytes = function(e) {
  36635. return e ? this.toBytesLE() : this.toBytesBE()
  36636. }
  36637. ,
  36638. t.toBytesLE = function() {
  36639. var e = this.high
  36640. , t = this.low;
  36641. return [255 & t, t >>> 8 & 255, t >>> 16 & 255, t >>> 24 & 255, 255 & e, e >>> 8 & 255, e >>> 16 & 255, e >>> 24 & 255]
  36642. }
  36643. ,
  36644. t.toBytesBE = function() {
  36645. var e = this.high
  36646. , t = this.low;
  36647. return [e >>> 24 & 255, e >>> 16 & 255, e >>> 8 & 255, 255 & e, t >>> 24 & 255, t >>> 16 & 255, t >>> 8 & 255, 255 & t]
  36648. }
  36649. ,
  36650. n
  36651. }
  36652. ,
  36653. "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()
  36654. }
  36655. , {}],
  36656. 217: [function(e, t, i) {
  36657. 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 = {
  36658. REVISION: "75"
  36659. };
  36660. function Ii(e, t) {
  36661. return e.distance - t.distance
  36662. }
  36663. function Ei(e, t, i, n) {
  36664. if (!1 !== e.visible && (e.raycast(t, i),
  36665. !0 === n))
  36666. for (var r = e.children, o = 0, a = r.length; o < a; o++)
  36667. Ei(r[o], t, i, !0)
  36668. }
  36669. function _i(e, t, i) {
  36670. return i < 0 && (i += 1),
  36671. 1 < i && (i -= 1),
  36672. i < 1 / 6 ? e + 6 * (t - e) * i : i < .5 ? t : i < 2 / 3 ? e + 6 * (t - e) * (2 / 3 - i) : e
  36673. }
  36674. function bi(e, t, i, n, r, o, a) {
  36675. return Ci.Triangle.barycoordFromPoint(e, t, i, n, Vt),
  36676. r.multiplyScalar(Vt.x),
  36677. o.multiplyScalar(Vt.y),
  36678. a.multiplyScalar(Vt.z),
  36679. r.add(o).add(a),
  36680. r.clone()
  36681. }
  36682. function wi(e, t, i, n, r, o, a) {
  36683. var s = e.material;
  36684. if (null === (s.side === Ci.BackSide ? i.intersectTriangle(o, r, n, !0, a) : i.intersectTriangle(n, r, o, s.side !== Ci.DoubleSide, a)))
  36685. return null;
  36686. Ut.copy(a),
  36687. Ut.applyMatrix4(e.matrixWorld);
  36688. var l = t.ray.origin.distanceTo(Ut);
  36689. return l < t.near || l > t.far ? null : {
  36690. distance: l,
  36691. point: Ut.clone(),
  36692. object: e
  36693. }
  36694. }
  36695. function Ti(e, t, i, n, r, o, a, s) {
  36696. Mt.fromArray(n, 3 * o),
  36697. Rt.fromArray(n, 3 * a),
  36698. Pt.fromArray(n, 3 * s);
  36699. var l = wi(e, t, i, Mt, Rt, Pt, kt);
  36700. return l && (r && (Nt.fromArray(r, 2 * o),
  36701. Ft.fromArray(r, 2 * a),
  36702. Bt.fromArray(r, 2 * s),
  36703. l.uv = bi(kt, Mt, Rt, Pt, Nt, Ft, Bt)),
  36704. l.face = new Ci.Face3(o,a,s,Ci.Triangle.normal(Mt, Rt, Pt)),
  36705. l.faceIndex = o),
  36706. l
  36707. }
  36708. function xi() {}
  36709. function Si(e, t, i, n, r, o) {
  36710. var a, s, l, c, h, u, d, p, f, g, m, v, y, A, C, I, E;
  36711. if (s = e[o[t]].x,
  36712. l = e[o[t]].y,
  36713. c = e[o[i]].x,
  36714. h = e[o[i]].y,
  36715. u = e[o[n]].x,
  36716. d = e[o[n]].y,
  36717. Number.EPSILON > (c - s) * (d - l) - (h - l) * (u - s))
  36718. return !1;
  36719. for (g = u - c,
  36720. m = d - h,
  36721. v = s - u,
  36722. y = l - d,
  36723. A = c - s,
  36724. C = h - l,
  36725. a = 0; a < r; a++)
  36726. if (p = e[o[a]].x,
  36727. f = e[o[a]].y,
  36728. !(p === s && f === l || p === c && f === h || p === u && f === d) && (I = A * (f - l) - C * (p - s),
  36729. E = v * (f - d) - y * (p - u),
  36730. g * (f - h) - m * (p - c) >= -Number.EPSILON && E >= -Number.EPSILON && I >= -Number.EPSILON))
  36731. return !1;
  36732. return !0
  36733. }
  36734. function Mi(e) {
  36735. switch (e) {
  36736. case Ci.LinearEncoding:
  36737. return ["Linear", "( value )"];
  36738. case Ci.sRGBEncoding:
  36739. return ["sRGB", "( value )"];
  36740. case Ci.RGBEEncoding:
  36741. return ["RGBE", "( value )"];
  36742. case Ci.RGBM7Encoding:
  36743. return ["RGBM", "( value, 7.0 )"];
  36744. case Ci.RGBM16Encoding:
  36745. return ["RGBM", "( value, 16.0 )"];
  36746. case Ci.RGBDEncoding:
  36747. return ["RGBD", "( value, 256.0 )"];
  36748. case Ci.GammaEncoding:
  36749. return ["Gamma", "( value, float( GAMMA_FACTOR ) )"];
  36750. default:
  36751. throw new Error("unsupported encoding: " + e)
  36752. }
  36753. }
  36754. function Ri(e, t) {
  36755. var i = Mi(t);
  36756. return "vec4 " + e + "( vec4 value ) { return " + i[0] + "ToLinear" + i[1] + "; }"
  36757. }
  36758. function Pi(e) {
  36759. return "" !== e
  36760. }
  36761. function Oi(e, t) {
  36762. 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)
  36763. }
  36764. function Li(e) {
  36765. return e.replace(/#include +<([\w\d.]+)>/g, function(e, t) {
  36766. var i = Ci.ShaderChunk[t];
  36767. if (void 0 === i)
  36768. throw new Error("Can not resolve #include <" + t + ">");
  36769. return Li(i)
  36770. })
  36771. }
  36772. function Di(e) {
  36773. return e.replace(/for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g, function(e, t, i, n) {
  36774. for (var r = "", o = parseInt(t); o < parseInt(i); o++)
  36775. r += n.replace(/\[ i \]/g, "[ " + o + " ]");
  36776. return r
  36777. })
  36778. }
  36779. function Ni(e, t, i, n) {
  36780. gi.set(t, i, n).unproject(mi);
  36781. var r = fi[e];
  36782. if (void 0 !== r)
  36783. for (var o = 0, a = r.length; o < a; o++)
  36784. pi.vertices[r[o]].copy(gi)
  36785. }
  36786. "function" == typeof define && define.amd ? define("three", Ci) : void 0 !== i && void 0 !== t && (t.exports = Ci),
  36787. void 0 === Number.EPSILON && (Number.EPSILON = Math.pow(2, -52)),
  36788. void 0 === Math.sign && (Math.sign = function(e) {
  36789. return e < 0 ? -1 : 0 < e ? 1 : +e
  36790. }
  36791. ),
  36792. void 0 === Function.prototype.name && void 0 !== Object.defineProperty && Object.defineProperty(Function.prototype, "name", {
  36793. get: function() {
  36794. return this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]
  36795. }
  36796. }),
  36797. void 0 === Object.assign && Object.defineProperty(Object, "assign", {
  36798. writable: !0,
  36799. configurable: !0,
  36800. value: function(e) {
  36801. "use strict";
  36802. if (null == e)
  36803. throw new TypeError("Cannot convert first argument to object");
  36804. for (var t = Object(e), i = 1, n = arguments.length; i !== n; ++i) {
  36805. var r = arguments[i];
  36806. if (null != r) {
  36807. r = Object(r);
  36808. for (var o = Object.keys(r), a = 0, s = o.length; a !== s; ++a) {
  36809. var l = o[a]
  36810. , c = Object.getOwnPropertyDescriptor(r, l);
  36811. void 0 !== c && c.enumerable && (t[l] = r[l])
  36812. }
  36813. }
  36814. }
  36815. return t
  36816. }
  36817. }),
  36818. Ci.MOUSE = {
  36819. LEFT: 0,
  36820. MIDDLE: 1,
  36821. RIGHT: 2
  36822. },
  36823. Ci.CullFaceNone = 0,
  36824. Ci.CullFaceBack = 1,
  36825. Ci.CullFaceFront = 2,
  36826. Ci.CullFaceFrontBack = 3,
  36827. Ci.FrontFaceDirectionCW = 0,
  36828. Ci.FrontFaceDirectionCCW = 1,
  36829. Ci.BasicShadowMap = 0,
  36830. Ci.PCFShadowMap = 1,
  36831. Ci.PCFSoftShadowMap = 2,
  36832. Ci.FrontSide = 0,
  36833. Ci.BackSide = 1,
  36834. Ci.DoubleSide = 2,
  36835. Ci.FlatShading = 1,
  36836. Ci.SmoothShading = 2,
  36837. Ci.NoColors = 0,
  36838. Ci.FaceColors = 1,
  36839. Ci.VertexColors = 2,
  36840. Ci.NoBlending = 0,
  36841. Ci.NormalBlending = 1,
  36842. Ci.AdditiveBlending = 2,
  36843. Ci.SubtractiveBlending = 3,
  36844. Ci.MultiplyBlending = 4,
  36845. Ci.CustomBlending = 5,
  36846. Ci.AddEquation = 100,
  36847. Ci.SubtractEquation = 101,
  36848. Ci.ReverseSubtractEquation = 102,
  36849. Ci.MinEquation = 103,
  36850. Ci.MaxEquation = 104,
  36851. Ci.ZeroFactor = 200,
  36852. Ci.OneFactor = 201,
  36853. Ci.SrcColorFactor = 202,
  36854. Ci.OneMinusSrcColorFactor = 203,
  36855. Ci.SrcAlphaFactor = 204,
  36856. Ci.OneMinusSrcAlphaFactor = 205,
  36857. Ci.DstAlphaFactor = 206,
  36858. Ci.OneMinusDstAlphaFactor = 207,
  36859. Ci.DstColorFactor = 208,
  36860. Ci.OneMinusDstColorFactor = 209,
  36861. Ci.SrcAlphaSaturateFactor = 210,
  36862. Ci.NeverDepth = 0,
  36863. Ci.AlwaysDepth = 1,
  36864. Ci.LessDepth = 2,
  36865. Ci.LessEqualDepth = 3,
  36866. Ci.EqualDepth = 4,
  36867. Ci.GreaterEqualDepth = 5,
  36868. Ci.GreaterDepth = 6,
  36869. Ci.NotEqualDepth = 7,
  36870. Ci.MultiplyOperation = 0,
  36871. Ci.MixOperation = 1,
  36872. Ci.AddOperation = 2,
  36873. Ci.NoToneMapping = 0,
  36874. Ci.LinearToneMapping = 1,
  36875. Ci.ReinhardToneMapping = 2,
  36876. Ci.Uncharted2ToneMapping = 3,
  36877. Ci.CineonToneMapping = 4,
  36878. Ci.UVMapping = 300,
  36879. Ci.CubeReflectionMapping = 301,
  36880. Ci.CubeRefractionMapping = 302,
  36881. Ci.EquirectangularReflectionMapping = 303,
  36882. Ci.EquirectangularRefractionMapping = 304,
  36883. Ci.SphericalReflectionMapping = 305,
  36884. Ci.CubeUVReflectionMapping = 306,
  36885. Ci.CubeUVRefractionMapping = 307,
  36886. Ci.RepeatWrapping = 1e3,
  36887. Ci.ClampToEdgeWrapping = 1001,
  36888. Ci.MirroredRepeatWrapping = 1002,
  36889. Ci.NearestFilter = 1003,
  36890. Ci.NearestMipMapNearestFilter = 1004,
  36891. Ci.NearestMipMapLinearFilter = 1005,
  36892. Ci.LinearFilter = 1006,
  36893. Ci.LinearMipMapNearestFilter = 1007,
  36894. Ci.LinearMipMapLinearFilter = 1008,
  36895. Ci.UnsignedByteType = 1009,
  36896. Ci.ByteType = 1010,
  36897. Ci.ShortType = 1011,
  36898. Ci.UnsignedShortType = 1012,
  36899. Ci.IntType = 1013,
  36900. Ci.UnsignedIntType = 1014,
  36901. Ci.FloatType = 1015,
  36902. Ci.HalfFloatType = 1025,
  36903. Ci.UnsignedShort4444Type = 1016,
  36904. Ci.UnsignedShort5551Type = 1017,
  36905. Ci.UnsignedShort565Type = 1018,
  36906. Ci.AlphaFormat = 1019,
  36907. Ci.RGBFormat = 1020,
  36908. Ci.RGBAFormat = 1021,
  36909. Ci.LuminanceFormat = 1022,
  36910. Ci.LuminanceAlphaFormat = 1023,
  36911. Ci.RGBEFormat = Ci.RGBAFormat,
  36912. Ci.RGB_S3TC_DXT1_Format = 2001,
  36913. Ci.RGBA_S3TC_DXT1_Format = 2002,
  36914. Ci.RGBA_S3TC_DXT3_Format = 2003,
  36915. Ci.RGBA_S3TC_DXT5_Format = 2004,
  36916. Ci.RGB_PVRTC_4BPPV1_Format = 2100,
  36917. Ci.RGB_PVRTC_2BPPV1_Format = 2101,
  36918. Ci.RGBA_PVRTC_4BPPV1_Format = 2102,
  36919. Ci.RGBA_PVRTC_2BPPV1_Format = 2103,
  36920. Ci.RGB_ETC1_Format = 2151,
  36921. Ci.LoopOnce = 2200,
  36922. Ci.LoopRepeat = 2201,
  36923. Ci.LoopPingPong = 2202,
  36924. Ci.InterpolateDiscrete = 2300,
  36925. Ci.InterpolateLinear = 2301,
  36926. Ci.InterpolateSmooth = 2302,
  36927. Ci.ZeroCurvatureEnding = 2400,
  36928. Ci.ZeroSlopeEnding = 2401,
  36929. Ci.WrapAroundEnding = 2402,
  36930. Ci.TrianglesDrawMode = 0,
  36931. Ci.TriangleStripDrawMode = 1,
  36932. Ci.TriangleFanDrawMode = 2,
  36933. Ci.LinearEncoding = 3e3,
  36934. Ci.sRGBEncoding = 3001,
  36935. Ci.GammaEncoding = 3007,
  36936. Ci.RGBEEncoding = 3002,
  36937. Ci.LogLuvEncoding = 3003,
  36938. Ci.RGBM7Encoding = 3004,
  36939. Ci.RGBM16Encoding = 3005,
  36940. Ci.RGBDEncoding = 3006,
  36941. Ci.Color = function(e) {
  36942. return 3 === arguments.length ? this.fromArray(arguments) : this.set(e)
  36943. }
  36944. ,
  36945. Ci.Color.prototype = {
  36946. constructor: Ci.Color,
  36947. r: 1,
  36948. g: 1,
  36949. b: 1,
  36950. set: function(e) {
  36951. return e instanceof Ci.Color ? this.copy(e) : "number" == typeof e ? this.setHex(e) : "string" == typeof e && this.setStyle(e),
  36952. this
  36953. },
  36954. setScalar: function(e) {
  36955. this.r = e,
  36956. this.g = e,
  36957. this.b = e
  36958. },
  36959. setHex: function(e) {
  36960. return e = Math.floor(e),
  36961. this.r = (e >> 16 & 255) / 255,
  36962. this.g = (e >> 8 & 255) / 255,
  36963. this.b = (255 & e) / 255,
  36964. this
  36965. },
  36966. setRGB: function(e, t, i) {
  36967. return this.r = e,
  36968. this.g = t,
  36969. this.b = i,
  36970. this
  36971. },
  36972. setHSL: function(e, t, i) {
  36973. if (e = Ci.Math.euclideanModulo(e, 1),
  36974. t = Ci.Math.clamp(t, 0, 1),
  36975. i = Ci.Math.clamp(i, 0, 1),
  36976. 0 === t)
  36977. this.r = this.g = this.b = i;
  36978. else {
  36979. var n = i <= .5 ? i * (1 + t) : i + t - i * t
  36980. , r = 2 * i - n;
  36981. this.r = _i(r, n, e + 1 / 3),
  36982. this.g = _i(r, n, e),
  36983. this.b = _i(r, n, e - 1 / 3)
  36984. }
  36985. return this
  36986. },
  36987. setStyle: function(t) {
  36988. function e(e) {
  36989. void 0 !== e && parseFloat(e) < 1 && console.warn("THREE.Color: Alpha component of " + t + " will be ignored.")
  36990. }
  36991. var i;
  36992. if (i = /^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(t)) {
  36993. var n, r = i[1], o = i[2];
  36994. switch (r) {
  36995. case "rgb":
  36996. case "rgba":
  36997. if (n = /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))
  36998. return this.r = Math.min(255, parseInt(n[1], 10)) / 255,
  36999. this.g = Math.min(255, parseInt(n[2], 10)) / 255,
  37000. this.b = Math.min(255, parseInt(n[3], 10)) / 255,
  37001. e(n[5]),
  37002. this;
  37003. if (n = /^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))
  37004. return this.r = Math.min(100, parseInt(n[1], 10)) / 100,
  37005. this.g = Math.min(100, parseInt(n[2], 10)) / 100,
  37006. this.b = Math.min(100, parseInt(n[3], 10)) / 100,
  37007. e(n[5]),
  37008. this;
  37009. break;
  37010. case "hsl":
  37011. case "hsla":
  37012. if (n = /^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o)) {
  37013. var a = parseFloat(n[1]) / 360
  37014. , s = parseInt(n[2], 10) / 100
  37015. , l = parseInt(n[3], 10) / 100;
  37016. return e(n[5]),
  37017. this.setHSL(a, s, l)
  37018. }
  37019. }
  37020. } else if (i = /^\#([A-Fa-f0-9]+)$/.exec(t)) {
  37021. var c, h = (c = i[1]).length;
  37022. if (3 === h)
  37023. return this.r = parseInt(c.charAt(0) + c.charAt(0), 16) / 255,
  37024. this.g = parseInt(c.charAt(1) + c.charAt(1), 16) / 255,
  37025. this.b = parseInt(c.charAt(2) + c.charAt(2), 16) / 255,
  37026. this;
  37027. if (6 === h)
  37028. return this.r = parseInt(c.charAt(0) + c.charAt(1), 16) / 255,
  37029. this.g = parseInt(c.charAt(2) + c.charAt(3), 16) / 255,
  37030. this.b = parseInt(c.charAt(4) + c.charAt(5), 16) / 255,
  37031. this
  37032. }
  37033. t && 0 < t.length && (void 0 !== (c = Ci.ColorKeywords[t]) ? this.setHex(c) : console.warn("THREE.Color: Unknown color " + t));
  37034. return this
  37035. },
  37036. clone: function() {
  37037. return new this.constructor(this.r,this.g,this.b)
  37038. },
  37039. copy: function(e) {
  37040. return this.r = e.r,
  37041. this.g = e.g,
  37042. this.b = e.b,
  37043. this
  37044. },
  37045. copyGammaToLinear: function(e, t) {
  37046. return void 0 === t && (t = 2),
  37047. this.r = Math.pow(e.r, t),
  37048. this.g = Math.pow(e.g, t),
  37049. this.b = Math.pow(e.b, t),
  37050. this
  37051. },
  37052. copyLinearToGamma: function(e, t) {
  37053. void 0 === t && (t = 2);
  37054. var i = 0 < t ? 1 / t : 1;
  37055. return this.r = Math.pow(e.r, i),
  37056. this.g = Math.pow(e.g, i),
  37057. this.b = Math.pow(e.b, i),
  37058. this
  37059. },
  37060. convertGammaToLinear: function() {
  37061. var e = this.r
  37062. , t = this.g
  37063. , i = this.b;
  37064. return this.r = e * e,
  37065. this.g = t * t,
  37066. this.b = i * i,
  37067. this
  37068. },
  37069. convertLinearToGamma: function() {
  37070. return this.r = Math.sqrt(this.r),
  37071. this.g = Math.sqrt(this.g),
  37072. this.b = Math.sqrt(this.b),
  37073. this
  37074. },
  37075. getHex: function() {
  37076. return 255 * this.r << 16 ^ 255 * this.g << 8 ^ 255 * this.b << 0
  37077. },
  37078. getHexString: function() {
  37079. return ("000000" + this.getHex().toString(16)).slice(-6)
  37080. },
  37081. getHSL: function(e) {
  37082. var t, i, n = e || {
  37083. h: 0,
  37084. s: 0,
  37085. l: 0
  37086. }, 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;
  37087. if (l === s)
  37088. i = t = 0;
  37089. else {
  37090. var h = s - l;
  37091. switch (i = c <= .5 ? h / (s + l) : h / (2 - s - l),
  37092. s) {
  37093. case r:
  37094. t = (o - a) / h + (o < a ? 6 : 0);
  37095. break;
  37096. case o:
  37097. t = (a - r) / h + 2;
  37098. break;
  37099. case a:
  37100. t = (r - o) / h + 4
  37101. }
  37102. t /= 6
  37103. }
  37104. return n.h = t,
  37105. n.s = i,
  37106. n.l = c,
  37107. n
  37108. },
  37109. getStyle: function() {
  37110. return "rgb(" + (255 * this.r | 0) + "," + (255 * this.g | 0) + "," + (255 * this.b | 0) + ")"
  37111. },
  37112. offsetHSL: function(e, t, i) {
  37113. var n = this.getHSL();
  37114. return n.h += e,
  37115. n.s += t,
  37116. n.l += i,
  37117. this.setHSL(n.h, n.s, n.l),
  37118. this
  37119. },
  37120. add: function(e) {
  37121. return this.r += e.r,
  37122. this.g += e.g,
  37123. this.b += e.b,
  37124. this
  37125. },
  37126. addColors: function(e, t) {
  37127. return this.r = e.r + t.r,
  37128. this.g = e.g + t.g,
  37129. this.b = e.b + t.b,
  37130. this
  37131. },
  37132. addScalar: function(e) {
  37133. return this.r += e,
  37134. this.g += e,
  37135. this.b += e,
  37136. this
  37137. },
  37138. multiply: function(e) {
  37139. return this.r *= e.r,
  37140. this.g *= e.g,
  37141. this.b *= e.b,
  37142. this
  37143. },
  37144. multiplyScalar: function(e) {
  37145. return this.r *= e,
  37146. this.g *= e,
  37147. this.b *= e,
  37148. this
  37149. },
  37150. lerp: function(e, t) {
  37151. return this.r += (e.r - this.r) * t,
  37152. this.g += (e.g - this.g) * t,
  37153. this.b += (e.b - this.b) * t,
  37154. this
  37155. },
  37156. equals: function(e) {
  37157. return e.r === this.r && e.g === this.g && e.b === this.b
  37158. },
  37159. fromArray: function(e, t) {
  37160. return void 0 === t && (t = 0),
  37161. this.r = e[t],
  37162. this.g = e[t + 1],
  37163. this.b = e[t + 2],
  37164. this
  37165. },
  37166. toArray: function(e, t) {
  37167. return void 0 === e && (e = []),
  37168. void 0 === t && (t = 0),
  37169. e[t] = this.r,
  37170. e[t + 1] = this.g,
  37171. e[t + 2] = this.b,
  37172. e
  37173. }
  37174. },
  37175. Ci.ColorKeywords = {
  37176. aliceblue: 15792383,
  37177. antiquewhite: 16444375,
  37178. aqua: 65535,
  37179. aquamarine: 8388564,
  37180. azure: 15794175,
  37181. beige: 16119260,
  37182. bisque: 16770244,
  37183. black: 0,
  37184. blanchedalmond: 16772045,
  37185. blue: 255,
  37186. blueviolet: 9055202,
  37187. brown: 10824234,
  37188. burlywood: 14596231,
  37189. cadetblue: 6266528,
  37190. chartreuse: 8388352,
  37191. chocolate: 13789470,
  37192. coral: 16744272,
  37193. cornflowerblue: 6591981,
  37194. cornsilk: 16775388,
  37195. crimson: 14423100,
  37196. cyan: 65535,
  37197. darkblue: 139,
  37198. darkcyan: 35723,
  37199. darkgoldenrod: 12092939,
  37200. darkgray: 11119017,
  37201. darkgreen: 25600,
  37202. darkgrey: 11119017,
  37203. darkkhaki: 12433259,
  37204. darkmagenta: 9109643,
  37205. darkolivegreen: 5597999,
  37206. darkorange: 16747520,
  37207. darkorchid: 10040012,
  37208. darkred: 9109504,
  37209. darksalmon: 15308410,
  37210. darkseagreen: 9419919,
  37211. darkslateblue: 4734347,
  37212. darkslategray: 3100495,
  37213. darkslategrey: 3100495,
  37214. darkturquoise: 52945,
  37215. darkviolet: 9699539,
  37216. deeppink: 16716947,
  37217. deepskyblue: 49151,
  37218. dimgray: 6908265,
  37219. dimgrey: 6908265,
  37220. dodgerblue: 2003199,
  37221. firebrick: 11674146,
  37222. floralwhite: 16775920,
  37223. forestgreen: 2263842,
  37224. fuchsia: 16711935,
  37225. gainsboro: 14474460,
  37226. ghostwhite: 16316671,
  37227. gold: 16766720,
  37228. goldenrod: 14329120,
  37229. gray: 8421504,
  37230. green: 32768,
  37231. greenyellow: 11403055,
  37232. grey: 8421504,
  37233. honeydew: 15794160,
  37234. hotpink: 16738740,
  37235. indianred: 13458524,
  37236. indigo: 4915330,
  37237. ivory: 16777200,
  37238. khaki: 15787660,
  37239. lavender: 15132410,
  37240. lavenderblush: 16773365,
  37241. lawngreen: 8190976,
  37242. lemonchiffon: 16775885,
  37243. lightblue: 11393254,
  37244. lightcoral: 15761536,
  37245. lightcyan: 14745599,
  37246. lightgoldenrodyellow: 16448210,
  37247. lightgray: 13882323,
  37248. lightgreen: 9498256,
  37249. lightgrey: 13882323,
  37250. lightpink: 16758465,
  37251. lightsalmon: 16752762,
  37252. lightseagreen: 2142890,
  37253. lightskyblue: 8900346,
  37254. lightslategray: 7833753,
  37255. lightslategrey: 7833753,
  37256. lightsteelblue: 11584734,
  37257. lightyellow: 16777184,
  37258. lime: 65280,
  37259. limegreen: 3329330,
  37260. linen: 16445670,
  37261. magenta: 16711935,
  37262. maroon: 8388608,
  37263. mediumaquamarine: 6737322,
  37264. mediumblue: 205,
  37265. mediumorchid: 12211667,
  37266. mediumpurple: 9662683,
  37267. mediumseagreen: 3978097,
  37268. mediumslateblue: 8087790,
  37269. mediumspringgreen: 64154,
  37270. mediumturquoise: 4772300,
  37271. mediumvioletred: 13047173,
  37272. midnightblue: 1644912,
  37273. mintcream: 16121850,
  37274. mistyrose: 16770273,
  37275. moccasin: 16770229,
  37276. navajowhite: 16768685,
  37277. navy: 128,
  37278. oldlace: 16643558,
  37279. olive: 8421376,
  37280. olivedrab: 7048739,
  37281. orange: 16753920,
  37282. orangered: 16729344,
  37283. orchid: 14315734,
  37284. palegoldenrod: 15657130,
  37285. palegreen: 10025880,
  37286. paleturquoise: 11529966,
  37287. palevioletred: 14381203,
  37288. papayawhip: 16773077,
  37289. peachpuff: 16767673,
  37290. peru: 13468991,
  37291. pink: 16761035,
  37292. plum: 14524637,
  37293. powderblue: 11591910,
  37294. purple: 8388736,
  37295. red: 16711680,
  37296. rosybrown: 12357519,
  37297. royalblue: 4286945,
  37298. saddlebrown: 9127187,
  37299. salmon: 16416882,
  37300. sandybrown: 16032864,
  37301. seagreen: 3050327,
  37302. seashell: 16774638,
  37303. sienna: 10506797,
  37304. silver: 12632256,
  37305. skyblue: 8900331,
  37306. slateblue: 6970061,
  37307. slategray: 7372944,
  37308. slategrey: 7372944,
  37309. snow: 16775930,
  37310. springgreen: 65407,
  37311. steelblue: 4620980,
  37312. tan: 13808780,
  37313. teal: 32896,
  37314. thistle: 14204888,
  37315. tomato: 16737095,
  37316. turquoise: 4251856,
  37317. violet: 15631086,
  37318. wheat: 16113331,
  37319. white: 16777215,
  37320. whitesmoke: 16119285,
  37321. yellow: 16776960,
  37322. yellowgreen: 10145074
  37323. },
  37324. Ci.Quaternion = function(e, t, i, n) {
  37325. this._x = e || 0,
  37326. this._y = t || 0,
  37327. this._z = i || 0,
  37328. this._w = void 0 !== n ? n : 1
  37329. }
  37330. ,
  37331. Ci.Quaternion.prototype = {
  37332. constructor: Ci.Quaternion,
  37333. get x() {
  37334. return this._x
  37335. },
  37336. set x(e) {
  37337. this._x = e,
  37338. this.onChangeCallback()
  37339. },
  37340. get y() {
  37341. return this._y
  37342. },
  37343. set y(e) {
  37344. this._y = e,
  37345. this.onChangeCallback()
  37346. },
  37347. get z() {
  37348. return this._z
  37349. },
  37350. set z(e) {
  37351. this._z = e,
  37352. this.onChangeCallback()
  37353. },
  37354. get w() {
  37355. return this._w
  37356. },
  37357. set w(e) {
  37358. this._w = e,
  37359. this.onChangeCallback()
  37360. },
  37361. set: function(e, t, i, n) {
  37362. return this._x = e,
  37363. this._y = t,
  37364. this._z = i,
  37365. this._w = n,
  37366. this.onChangeCallback(),
  37367. this
  37368. },
  37369. clone: function() {
  37370. return new this.constructor(this._x,this._y,this._z,this._w)
  37371. },
  37372. toObject:function(){//add
  37373. return {x:this.x, y:this.y,z:this.z, w:this.w};
  37374. },
  37375. copy: function(e) {
  37376. return this._x = e.x,
  37377. this._y = e.y,
  37378. this._z = e.z,
  37379. this._w = e.w,
  37380. this.onChangeCallback(),
  37381. this
  37382. },
  37383. setFromEuler: function(e, t) {
  37384. if (e instanceof Ci.Euler == 0)
  37385. throw new Error("THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  37386. var i = Math.cos(e._x / 2)
  37387. , n = Math.cos(e._y / 2)
  37388. , r = Math.cos(e._z / 2)
  37389. , o = Math.sin(e._x / 2)
  37390. , a = Math.sin(e._y / 2)
  37391. , s = Math.sin(e._z / 2)
  37392. , l = e.order;
  37393. return "XYZ" === l ? (this._x = o * n * r + i * a * s,
  37394. this._y = i * a * r - o * n * s,
  37395. this._z = i * n * s + o * a * r,
  37396. this._w = i * n * r - o * a * s) : "YXZ" === l ? (this._x = o * n * r + i * a * s,
  37397. this._y = i * a * r - o * n * s,
  37398. this._z = i * n * s - o * a * r,
  37399. this._w = i * n * r + o * a * s) : "ZXY" === l ? (this._x = o * n * r - i * a * s,
  37400. this._y = i * a * r + o * n * s,
  37401. this._z = i * n * s + o * a * r,
  37402. this._w = i * n * r - o * a * s) : "ZYX" === l ? (this._x = o * n * r - i * a * s,
  37403. this._y = i * a * r + o * n * s,
  37404. this._z = i * n * s - o * a * r,
  37405. this._w = i * n * r + o * a * s) : "YZX" === l ? (this._x = o * n * r + i * a * s,
  37406. this._y = i * a * r + o * n * s,
  37407. this._z = i * n * s - o * a * r,
  37408. this._w = i * n * r - o * a * s) : "XZY" === l && (this._x = o * n * r - i * a * s,
  37409. this._y = i * a * r - o * n * s,
  37410. this._z = i * n * s + o * a * r,
  37411. this._w = i * n * r + o * a * s),
  37412. !1 !== t && this.onChangeCallback(),
  37413. this
  37414. },
  37415. setFromAxisAngle: function(e, t) {
  37416. var i = t / 2
  37417. , n = Math.sin(i);
  37418. return this._x = e.x * n,
  37419. this._y = e.y * n,
  37420. this._z = e.z * n,
  37421. this._w = Math.cos(i),
  37422. this.onChangeCallback(),
  37423. this
  37424. },
  37425. setFromRotationMatrix: function(e) {
  37426. 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;
  37427. return 0 < d ? (t = .5 / Math.sqrt(d + 1),
  37428. this._w = .25 / t,
  37429. this._x = (h - l) * t,
  37430. this._y = (o - c) * t,
  37431. this._z = (a - r) * t) : s < n && u < n ? (t = 2 * Math.sqrt(1 + n - s - u),
  37432. this._w = (h - l) / t,
  37433. this._x = .25 * t,
  37434. this._y = (r + a) / t,
  37435. this._z = (o + c) / t) : u < s ? (t = 2 * Math.sqrt(1 + s - n - u),
  37436. this._w = (o - c) / t,
  37437. this._x = (r + a) / t,
  37438. this._y = .25 * t,
  37439. this._z = (l + h) / t) : (t = 2 * Math.sqrt(1 + u - n - s),
  37440. this._w = (a - r) / t,
  37441. this._x = (o + c) / t,
  37442. this._y = (l + h) / t,
  37443. this._z = .25 * t),
  37444. this.onChangeCallback(),
  37445. this
  37446. },
  37447. setFromUnitVectors: function(e, t) {
  37448. return void 0 === Be && (Be = new Ci.Vector3),
  37449. (Ve = e.dot(t) + 1) < 1e-6 ? (Ve = 0,
  37450. 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),
  37451. this._x = Be.x,
  37452. this._y = Be.y,
  37453. this._z = Be.z,
  37454. this._w = Ve,
  37455. this.normalize(),
  37456. this
  37457. },
  37458. inverse: function() {
  37459. return this.conjugate().normalize(),
  37460. this
  37461. },
  37462. conjugate: function() {
  37463. return this._x *= -1,
  37464. this._y *= -1,
  37465. this._z *= -1,
  37466. this.onChangeCallback(),
  37467. this
  37468. },
  37469. dot: function(e) {
  37470. return this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w
  37471. },
  37472. lengthSq: function() {
  37473. return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w
  37474. },
  37475. length: function() {
  37476. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  37477. },
  37478. normalize: function() {
  37479. var e = this.length();
  37480. return 0 === e ? (this._x = 0,
  37481. this._y = 0,
  37482. this._z = 0,
  37483. this._w = 1) : (e = 1 / e,
  37484. this._x = this._x * e,
  37485. this._y = this._y * e,
  37486. this._z = this._z * e,
  37487. this._w = this._w * e),
  37488. this.onChangeCallback(),
  37489. this
  37490. },
  37491. multiply: function(e, t) {
  37492. return void 0 !== t ? (console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),
  37493. this.multiplyQuaternions(e, t)) : this.multiplyQuaternions(this, e)
  37494. },
  37495. multiplyQuaternions: function(e, t) {
  37496. var i = e._x
  37497. , n = e._y
  37498. , r = e._z
  37499. , o = e._w
  37500. , a = t._x
  37501. , s = t._y
  37502. , l = t._z
  37503. , c = t._w;
  37504. return this._x = i * c + o * a + n * l - r * s,
  37505. this._y = n * c + o * s + r * a - i * l,
  37506. this._z = r * c + o * l + i * s - n * a,
  37507. this._w = o * c - i * a - n * s - r * l,
  37508. this.onChangeCallback(),
  37509. this
  37510. },
  37511. slerp: function(e, t) {
  37512. if (0 === t)
  37513. return this;
  37514. if (1 === t)
  37515. return this.copy(e);
  37516. var i = this._x
  37517. , n = this._y
  37518. , r = this._z
  37519. , o = this._w
  37520. , a = o * e._w + i * e._x + n * e._y + r * e._z;
  37521. if (a < 0 ? (this._w = -e._w,
  37522. this._x = -e._x,
  37523. this._y = -e._y,
  37524. this._z = -e._z,
  37525. a = -a) : this.copy(e),
  37526. 1 <= a)
  37527. return this._w = o,
  37528. this._x = i,
  37529. this._y = n,
  37530. this._z = r,
  37531. this;
  37532. var s = Math.sqrt(1 - a * a);
  37533. if (Math.abs(s) < .001)
  37534. return this._w = .5 * (o + this._w),
  37535. this._x = .5 * (i + this._x),
  37536. this._y = .5 * (n + this._y),
  37537. this._z = .5 * (r + this._z),
  37538. this;
  37539. var l = Math.atan2(s, a)
  37540. , c = Math.sin((1 - t) * l) / s
  37541. , h = Math.sin(t * l) / s;
  37542. return this._w = o * c + this._w * h,
  37543. this._x = i * c + this._x * h,
  37544. this._y = n * c + this._y * h,
  37545. this._z = r * c + this._z * h,
  37546. this.onChangeCallback(),
  37547. this
  37548. },
  37549. equals: function(e) {
  37550. return e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w
  37551. },
  37552. fromArray: function(e, t) {
  37553. return void 0 === t && (t = 0),
  37554. this._x = e[t],
  37555. this._y = e[t + 1],
  37556. this._z = e[t + 2],
  37557. this._w = e[t + 3],
  37558. this.onChangeCallback(),
  37559. this
  37560. },
  37561. toArray: function(e, t) {
  37562. return void 0 === e && (e = []),
  37563. void 0 === t && (t = 0),
  37564. e[t] = this._x,
  37565. e[t + 1] = this._y,
  37566. e[t + 2] = this._z,
  37567. e[t + 3] = this._w,
  37568. e
  37569. },
  37570. onChange: function(e) {
  37571. return this.onChangeCallback = e,
  37572. this
  37573. },
  37574. onChangeCallback: function() {}
  37575. },
  37576. Object.assign(Ci.Quaternion, {
  37577. slerp: function(e, t, i, n) {
  37578. return i.copy(e).slerp(t, n)
  37579. },
  37580. slerpFlat: function(e, t, i, n, r, o, a) {
  37581. var s = i[n + 0]
  37582. , l = i[n + 1]
  37583. , c = i[n + 2]
  37584. , h = i[n + 3]
  37585. , u = r[o + 0]
  37586. , d = r[o + 1]
  37587. , p = r[o + 2]
  37588. , f = r[o + 3];
  37589. if (h !== f || s !== u || l !== d || c !== p) {
  37590. var g = 1 - a
  37591. , m = s * u + l * d + c * p + h * f
  37592. , v = 0 <= m ? 1 : -1
  37593. , y = 1 - m * m;
  37594. if (y > Number.EPSILON) {
  37595. var A = Math.sqrt(y)
  37596. , C = Math.atan2(A, m * v);
  37597. g = Math.sin(g * C) / A,
  37598. a = Math.sin(a * C) / A
  37599. }
  37600. var I = a * v;
  37601. if (s = s * g + u * I,
  37602. l = l * g + d * I,
  37603. c = c * g + p * I,
  37604. h = h * g + f * I,
  37605. g === 1 - a) {
  37606. var E = 1 / Math.sqrt(s * s + l * l + c * c + h * h);
  37607. s *= E,
  37608. l *= E,
  37609. c *= E,
  37610. h *= E
  37611. }
  37612. }
  37613. e[t] = s,
  37614. e[t + 1] = l,
  37615. e[t + 2] = c,
  37616. e[t + 3] = h
  37617. }
  37618. }),
  37619. Ci.Vector2 = function(e, t) {
  37620. this.x = e || 0,
  37621. this.y = t || 0
  37622. }
  37623. ,
  37624. Ci.Vector2.prototype = {
  37625. constructor: Ci.Vector2,
  37626. get width() {
  37627. return this.x
  37628. },
  37629. set width(e) {
  37630. this.x = e
  37631. },
  37632. get height() {
  37633. return this.y
  37634. },
  37635. set height(e) {
  37636. this.y = e
  37637. },
  37638. set: function(e, t) {
  37639. return this.x = e,
  37640. this.y = t,
  37641. this
  37642. },
  37643. setScalar: function(e) {
  37644. return this.x = e,
  37645. this.y = e,
  37646. this
  37647. },
  37648. setX: function(e) {
  37649. return this.x = e,
  37650. this
  37651. },
  37652. setY: function(e) {
  37653. return this.y = e,
  37654. this
  37655. },
  37656. setComponent: function(e, t) {
  37657. switch (e) {
  37658. case 0:
  37659. this.x = t;
  37660. break;
  37661. case 1:
  37662. this.y = t;
  37663. break;
  37664. default:
  37665. throw new Error("index is out of range: " + e)
  37666. }
  37667. },
  37668. getComponent: function(e) {
  37669. switch (e) {
  37670. case 0:
  37671. return this.x;
  37672. case 1:
  37673. return this.y;
  37674. default:
  37675. throw new Error("index is out of range: " + e)
  37676. }
  37677. },
  37678. clone: function() {
  37679. return new this.constructor(this.x,this.y)
  37680. },
  37681. copy: function(e) {
  37682. return this.x = e.x,
  37683. this.y = e.y,
  37684. this
  37685. },
  37686. add: function(e, t) {
  37687. return void 0 !== t ? (console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  37688. this.addVectors(e, t)) : (this.x += e.x,
  37689. this.y += e.y,
  37690. this)
  37691. },
  37692. addScalar: function(e) {
  37693. return this.x += e,
  37694. this.y += e,
  37695. this
  37696. },
  37697. addVectors: function(e, t) {
  37698. return this.x = e.x + t.x,
  37699. this.y = e.y + t.y,
  37700. this
  37701. },
  37702. addScaledVector: function(e, t) {
  37703. return this.x += e.x * t,
  37704. this.y += e.y * t,
  37705. this
  37706. },
  37707. sub: function(e, t) {
  37708. return void 0 !== t ? (console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  37709. this.subVectors(e, t)) : (this.x -= e.x,
  37710. this.y -= e.y,
  37711. this)
  37712. },
  37713. subScalar: function(e) {
  37714. return this.x -= e,
  37715. this.y -= e,
  37716. this
  37717. },
  37718. subVectors: function(e, t) {
  37719. return this.x = e.x - t.x,
  37720. this.y = e.y - t.y,
  37721. this
  37722. },
  37723. multiply: function(e) {
  37724. return this.x *= e.x,
  37725. this.y *= e.y,
  37726. this
  37727. },
  37728. multiplyScalar: function(e) {
  37729. return isFinite(e) ? (this.x *= e,
  37730. this.y *= e) : (this.x = 0,
  37731. this.y = 0),
  37732. this
  37733. },
  37734. divide: function(e) {
  37735. return this.x /= e.x,
  37736. this.y /= e.y,
  37737. this
  37738. },
  37739. divideScalar: function(e) {
  37740. return this.multiplyScalar(1 / e)
  37741. },
  37742. min: function(e) {
  37743. return this.x = Math.min(this.x, e.x),
  37744. this.y = Math.min(this.y, e.y),
  37745. this
  37746. },
  37747. max: function(e) {
  37748. return this.x = Math.max(this.x, e.x),
  37749. this.y = Math.max(this.y, e.y),
  37750. this
  37751. },
  37752. clamp: function(e, t) {
  37753. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  37754. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  37755. this
  37756. },
  37757. clampScalar: function(e, t) {
  37758. return void 0 === Ne && (Ne = new Ci.Vector2,
  37759. Fe = new Ci.Vector2),
  37760. Ne.set(e, e),
  37761. Fe.set(t, t),
  37762. this.clamp(Ne, Fe)
  37763. },
  37764. clampLength: function(e, t) {
  37765. var i = this.length();
  37766. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  37767. this
  37768. },
  37769. floor: function() {
  37770. return this.x = Math.floor(this.x),
  37771. this.y = Math.floor(this.y),
  37772. this
  37773. },
  37774. ceil: function() {
  37775. return this.x = Math.ceil(this.x),
  37776. this.y = Math.ceil(this.y),
  37777. this
  37778. },
  37779. round: function() {
  37780. return this.x = Math.round(this.x),
  37781. this.y = Math.round(this.y),
  37782. this
  37783. },
  37784. roundToZero: function() {
  37785. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  37786. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  37787. this
  37788. },
  37789. negate: function() {
  37790. return this.x = -this.x,
  37791. this.y = -this.y,
  37792. this
  37793. },
  37794. dot: function(e) {
  37795. return this.x * e.x + this.y * e.y
  37796. },
  37797. lengthSq: function() {
  37798. return this.x * this.x + this.y * this.y
  37799. },
  37800. length: function() {
  37801. return Math.sqrt(this.x * this.x + this.y * this.y)
  37802. },
  37803. lengthManhattan: function() {
  37804. return Math.abs(this.x) + Math.abs(this.y)
  37805. },
  37806. normalize: function() {
  37807. return this.divideScalar(this.length())
  37808. },
  37809. angle: function() {
  37810. var e = Math.atan2(this.y, this.x);
  37811. return e < 0 && (e += 2 * Math.PI),
  37812. e
  37813. },
  37814. distanceTo: function(e) {
  37815. return Math.sqrt(this.distanceToSquared(e))
  37816. },
  37817. distanceToSquared: function(e) {
  37818. var t = this.x - e.x
  37819. , i = this.y - e.y;
  37820. return t * t + i * i
  37821. },
  37822. setLength: function(e) {
  37823. return this.multiplyScalar(e / this.length())
  37824. },
  37825. lerp: function(e, t) {
  37826. return this.x += (e.x - this.x) * t,
  37827. this.y += (e.y - this.y) * t,
  37828. this
  37829. },
  37830. lerpVectors: function(e, t, i) {
  37831. return this.subVectors(t, e).multiplyScalar(i).add(e),
  37832. this
  37833. },
  37834. equals: function(e) {
  37835. return e.x === this.x && e.y === this.y
  37836. },
  37837. fromArray: function(e, t) {
  37838. return void 0 === t && (t = 0),
  37839. this.x = e[t],
  37840. this.y = e[t + 1],
  37841. this
  37842. },
  37843. toArray: function(e, t) {
  37844. return void 0 === e && (e = []),
  37845. void 0 === t && (t = 0),
  37846. e[t] = this.x,
  37847. e[t + 1] = this.y,
  37848. e
  37849. },
  37850. fromAttribute: function(e, t, i) {
  37851. return void 0 === i && (i = 0),
  37852. t = t * e.itemSize + i,
  37853. this.x = e.array[t],
  37854. this.y = e.array[t + 1],
  37855. this
  37856. },
  37857. rotateAround: function(e, t) {
  37858. var i = Math.cos(t)
  37859. , n = Math.sin(t)
  37860. , r = this.x - e.x
  37861. , o = this.y - e.y;
  37862. return this.x = r * i - o * n + e.x,
  37863. this.y = r * n + o * i + e.y,
  37864. this
  37865. }
  37866. },
  37867. Ci.Vector3 = function(e, t, i) {
  37868. this.x = e || 0,
  37869. this.y = t || 0,
  37870. this.z = i || 0
  37871. }
  37872. ,
  37873. Ci.Vector3.prototype = {
  37874. constructor: Ci.Vector3,
  37875. set: function(e, t, i) {
  37876. return this.x = e,
  37877. this.y = t,
  37878. this.z = i,
  37879. this
  37880. },
  37881. setScalar: function(e) {
  37882. return this.x = e,
  37883. this.y = e,
  37884. this.z = e,
  37885. this
  37886. },
  37887. setX: function(e) {
  37888. return this.x = e,
  37889. this
  37890. },
  37891. setY: function(e) {
  37892. return this.y = e,
  37893. this
  37894. },
  37895. setZ: function(e) {
  37896. return this.z = e,
  37897. this
  37898. },
  37899. setComponent: function(e, t) {
  37900. switch (e) {
  37901. case 0:
  37902. this.x = t;
  37903. break;
  37904. case 1:
  37905. this.y = t;
  37906. break;
  37907. case 2:
  37908. this.z = t;
  37909. break;
  37910. default:
  37911. throw new Error("index is out of range: " + e)
  37912. }
  37913. },
  37914. getComponent: function(e) {
  37915. switch (e) {
  37916. case 0:
  37917. return this.x;
  37918. case 1:
  37919. return this.y;
  37920. case 2:
  37921. return this.z;
  37922. default:
  37923. throw new Error("index is out of range: " + e)
  37924. }
  37925. },
  37926. clone: function() {
  37927. return new this.constructor(this.x,this.y,this.z)
  37928. },
  37929. copy: function(e) {
  37930. return this.x = e.x,
  37931. this.y = e.y,
  37932. this.z = e.z,
  37933. this
  37934. },
  37935. add: function(e, t) {
  37936. return void 0 !== t ? (console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  37937. this.addVectors(e, t)) : (this.x += e.x,
  37938. this.y += e.y,
  37939. this.z += e.z,
  37940. this)
  37941. },
  37942. addScalar: function(e) {
  37943. return this.x += e,
  37944. this.y += e,
  37945. this.z += e,
  37946. this
  37947. },
  37948. addVectors: function(e, t) {
  37949. return this.x = e.x + t.x,
  37950. this.y = e.y + t.y,
  37951. this.z = e.z + t.z,
  37952. this
  37953. },
  37954. addScaledVector: function(e, t) {
  37955. return this.x += e.x * t,
  37956. this.y += e.y * t,
  37957. this.z += e.z * t,
  37958. this
  37959. },
  37960. sub: function(e, t) {
  37961. return void 0 !== t ? (console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  37962. this.subVectors(e, t)) : (this.x -= e.x,
  37963. this.y -= e.y,
  37964. this.z -= e.z,
  37965. this)
  37966. },
  37967. subScalar: function(e) {
  37968. return this.x -= e,
  37969. this.y -= e,
  37970. this.z -= e,
  37971. this
  37972. },
  37973. subVectors: function(e, t) {
  37974. return this.x = e.x - t.x,
  37975. this.y = e.y - t.y,
  37976. this.z = e.z - t.z,
  37977. this
  37978. },
  37979. multiply: function(e, t) {
  37980. return void 0 !== t ? (console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),
  37981. this.multiplyVectors(e, t)) : (this.x *= e.x,
  37982. this.y *= e.y,
  37983. this.z *= e.z,
  37984. this)
  37985. },
  37986. multiplyScalar: function(e) {
  37987. return isFinite(e) ? (this.x *= e,
  37988. this.y *= e,
  37989. this.z *= e) : (this.x = 0,
  37990. this.y = 0,
  37991. this.z = 0),
  37992. this
  37993. },
  37994. multiplyVectors: function(e, t) {
  37995. return this.x = e.x * t.x,
  37996. this.y = e.y * t.y,
  37997. this.z = e.z * t.z,
  37998. this
  37999. },
  38000. applyEuler: function(e) {
  38001. return e instanceof Ci.Euler == 0 && console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),
  38002. void 0 === De && (De = new Ci.Quaternion),
  38003. this.applyQuaternion(De.setFromEuler(e)),
  38004. this
  38005. },
  38006. applyAxisAngle: function(e, t) {
  38007. return void 0 === Le && (Le = new Ci.Quaternion),
  38008. this.applyQuaternion(Le.setFromAxisAngle(e, t)),
  38009. this
  38010. },
  38011. applyMatrix3: function(e) {
  38012. var t = this.x
  38013. , i = this.y
  38014. , n = this.z
  38015. , r = e.elements;
  38016. return this.x = r[0] * t + r[3] * i + r[6] * n,
  38017. this.y = r[1] * t + r[4] * i + r[7] * n,
  38018. this.z = r[2] * t + r[5] * i + r[8] * n,
  38019. this
  38020. },
  38021. applyMatrix4: function(e) {
  38022. var t = this.x
  38023. , i = this.y
  38024. , n = this.z
  38025. , r = e.elements;
  38026. return this.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  38027. this.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  38028. this.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  38029. this
  38030. },
  38031. applyProjection: function(e) {
  38032. var t = this.x
  38033. , i = this.y
  38034. , n = this.z
  38035. , r = e.elements
  38036. , o = 1 / (r[3] * t + r[7] * i + r[11] * n + r[15]);
  38037. return this.x = (r[0] * t + r[4] * i + r[8] * n + r[12]) * o,
  38038. this.y = (r[1] * t + r[5] * i + r[9] * n + r[13]) * o,
  38039. this.z = (r[2] * t + r[6] * i + r[10] * n + r[14]) * o,
  38040. this
  38041. },
  38042. applyQuaternion: function(e) {
  38043. var t = this.x
  38044. , i = this.y
  38045. , n = this.z
  38046. , r = e.x
  38047. , o = e.y
  38048. , a = e.z
  38049. , s = e.w
  38050. , l = s * t + o * n - a * i
  38051. , c = s * i + a * t - r * n
  38052. , h = s * n + r * i - o * t
  38053. , u = -r * t - o * i - a * n;
  38054. return this.x = l * s + u * -r + c * -a - h * -o,
  38055. this.y = c * s + u * -o + h * -r - l * -a,
  38056. this.z = h * s + u * -a + l * -o - c * -r,
  38057. this
  38058. },
  38059. project: function(e) {
  38060. return void 0 === Oe && (Oe = new Ci.Matrix4),
  38061. Oe.multiplyMatrices(e.projectionMatrix, Oe.getInverse(e.matrixWorld)),
  38062. this.applyProjection(Oe)
  38063. },
  38064. unproject: function(e) {
  38065. return void 0 === Pe && (Pe = new Ci.Matrix4),
  38066. Pe.multiplyMatrices(e.matrixWorld, Pe.getInverse(e.projectionMatrix)),
  38067. this.applyProjection(Pe)
  38068. },
  38069. transformDirection: function(e) {
  38070. var t = this.x
  38071. , i = this.y
  38072. , n = this.z
  38073. , r = e.elements;
  38074. return this.x = r[0] * t + r[4] * i + r[8] * n,
  38075. this.y = r[1] * t + r[5] * i + r[9] * n,
  38076. this.z = r[2] * t + r[6] * i + r[10] * n,
  38077. this.normalize(),
  38078. this
  38079. },
  38080. divide: function(e) {
  38081. return this.x /= e.x,
  38082. this.y /= e.y,
  38083. this.z /= e.z,
  38084. this
  38085. },
  38086. divideScalar: function(e) {
  38087. return this.multiplyScalar(1 / e)
  38088. },
  38089. min: function(e) {
  38090. return this.x = Math.min(this.x, e.x),
  38091. this.y = Math.min(this.y, e.y),
  38092. this.z = Math.min(this.z, e.z),
  38093. this
  38094. },
  38095. max: function(e) {
  38096. return this.x = Math.max(this.x, e.x),
  38097. this.y = Math.max(this.y, e.y),
  38098. this.z = Math.max(this.z, e.z),
  38099. this
  38100. },
  38101. clamp: function(e, t) {
  38102. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  38103. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  38104. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  38105. this
  38106. },
  38107. clampScalar: function(e, t) {
  38108. return void 0 === Me && (Me = new Ci.Vector3,
  38109. Re = new Ci.Vector3),
  38110. Me.set(e, e, e),
  38111. Re.set(t, t, t),
  38112. this.clamp(Me, Re)
  38113. },
  38114. clampLength: function(e, t) {
  38115. var i = this.length();
  38116. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  38117. this
  38118. },
  38119. floor: function() {
  38120. return this.x = Math.floor(this.x),
  38121. this.y = Math.floor(this.y),
  38122. this.z = Math.floor(this.z),
  38123. this
  38124. },
  38125. ceil: function() {
  38126. return this.x = Math.ceil(this.x),
  38127. this.y = Math.ceil(this.y),
  38128. this.z = Math.ceil(this.z),
  38129. this
  38130. },
  38131. round: function() {
  38132. return this.x = Math.round(this.x),
  38133. this.y = Math.round(this.y),
  38134. this.z = Math.round(this.z),
  38135. this
  38136. },
  38137. roundToZero: function() {
  38138. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  38139. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  38140. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  38141. this
  38142. },
  38143. negate: function() {
  38144. return this.x = -this.x,
  38145. this.y = -this.y,
  38146. this.z = -this.z,
  38147. this
  38148. },
  38149. dot: function(e) {
  38150. return this.x * e.x + this.y * e.y + this.z * e.z
  38151. },
  38152. lengthSq: function() {
  38153. return this.x * this.x + this.y * this.y + this.z * this.z
  38154. },
  38155. length: function() {
  38156. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z)
  38157. },
  38158. lengthManhattan: function() {
  38159. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z)
  38160. },
  38161. normalize: function() {
  38162. return this.divideScalar(this.length())
  38163. },
  38164. setLength: function(e) {
  38165. return this.multiplyScalar(e / this.length())
  38166. },
  38167. lerp: function(e, t) {
  38168. return this.x += (e.x - this.x) * t,
  38169. this.y += (e.y - this.y) * t,
  38170. this.z += (e.z - this.z) * t,
  38171. this
  38172. },
  38173. lerpVectors: function(e, t, i) {
  38174. return this.subVectors(t, e).multiplyScalar(i).add(e),
  38175. this
  38176. },
  38177. cross: function(e, t) {
  38178. if (void 0 !== t)
  38179. return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),
  38180. this.crossVectors(e, t);
  38181. var i = this.x
  38182. , n = this.y
  38183. , r = this.z;
  38184. return this.x = n * e.z - r * e.y,
  38185. this.y = r * e.x - i * e.z,
  38186. this.z = i * e.y - n * e.x,
  38187. this
  38188. },
  38189. crossVectors: function(e, t) {
  38190. var i = e.x
  38191. , n = e.y
  38192. , r = e.z
  38193. , o = t.x
  38194. , a = t.y
  38195. , s = t.z;
  38196. return this.x = n * s - r * a,
  38197. this.y = r * o - i * s,
  38198. this.z = i * a - n * o,
  38199. this
  38200. },
  38201. projectOnVector: function(e) {
  38202. return void 0 === xe && (xe = new Ci.Vector3),
  38203. xe.copy(e).normalize(),
  38204. Se = this.dot(xe),
  38205. this.copy(xe).multiplyScalar(Se)
  38206. },
  38207. projectOnPlane: function(e) {
  38208. return void 0 === Te && (Te = new Ci.Vector3),
  38209. Te.copy(this).projectOnVector(e),
  38210. this.sub(Te)
  38211. },
  38212. reflect: function(e) {
  38213. return void 0 === we && (we = new Ci.Vector3),
  38214. this.sub(we.copy(e).multiplyScalar(2 * this.dot(e)))
  38215. },
  38216. angleTo: function(e) {
  38217. var t = this.dot(e) / Math.sqrt(this.lengthSq() * e.lengthSq());
  38218. return Math.acos(Ci.Math.clamp(t, -1, 1))
  38219. },
  38220. distanceTo: function(e) {
  38221. return Math.sqrt(this.distanceToSquared(e))
  38222. },
  38223. distanceToSquared: function(e) {
  38224. var t = this.x - e.x
  38225. , i = this.y - e.y
  38226. , n = this.z - e.z;
  38227. return t * t + i * i + n * n
  38228. },
  38229. setFromSpherical: function(e) {
  38230. var t = Math.sin(e.phi) * e.radius;
  38231. return this.x = t * Math.sin(e.theta),
  38232. this.y = Math.cos(e.phi) * e.radius,
  38233. this.z = t * Math.cos(e.theta),
  38234. this
  38235. },
  38236. setFromMatrixPosition: function(e) {
  38237. return this.setFromMatrixColumn(e, 3)
  38238. },
  38239. setFromMatrixScale: function(e) {
  38240. var t = this.setFromMatrixColumn(e, 0).length()
  38241. , i = this.setFromMatrixColumn(e, 1).length()
  38242. , n = this.setFromMatrixColumn(e, 2).length();
  38243. return this.x = t,
  38244. this.y = i,
  38245. this.z = n,
  38246. this
  38247. },
  38248. setFromMatrixColumn: function(e, t) {
  38249. return "number" == typeof e && (console.warn("THREE.Vector3: setFromMatrixColumn now expects ( matrix, index )."),
  38250. t = e = t),
  38251. this.fromArray(e.elements, 4 * t)
  38252. },
  38253. equals: function(e) {
  38254. return e.x === this.x && e.y === this.y && e.z === this.z
  38255. },
  38256. fromArray: function(e, t) {
  38257. return void 0 === t && (t = 0),
  38258. this.x = e[t],
  38259. this.y = e[t + 1],
  38260. this.z = e[t + 2],
  38261. this
  38262. },
  38263. toArray: function(e, t) {
  38264. return void 0 === e && (e = []),
  38265. void 0 === t && (t = 0),
  38266. e[t] = this.x,
  38267. e[t + 1] = this.y,
  38268. e[t + 2] = this.z,
  38269. e
  38270. },
  38271. fromAttribute: function(e, t, i) {
  38272. return void 0 === i && (i = 0),
  38273. t = t * e.itemSize + i,
  38274. this.x = e.array[t],
  38275. this.y = e.array[t + 1],
  38276. this.z = e.array[t + 2],
  38277. this
  38278. }
  38279. },
  38280. Ci.Vector4 = function(e, t, i, n) {
  38281. this.x = e || 0,
  38282. this.y = t || 0,
  38283. this.z = i || 0,
  38284. this.w = void 0 !== n ? n : 1
  38285. }
  38286. ,
  38287. Ci.Vector4.prototype = {
  38288. constructor: Ci.Vector4,
  38289. set: function(e, t, i, n) {
  38290. return this.x = e,
  38291. this.y = t,
  38292. this.z = i,
  38293. this.w = n,
  38294. this
  38295. },
  38296. setScalar: function(e) {
  38297. return this.x = e,
  38298. this.y = e,
  38299. this.z = e,
  38300. this.w = e,
  38301. this
  38302. },
  38303. setX: function(e) {
  38304. return this.x = e,
  38305. this
  38306. },
  38307. setY: function(e) {
  38308. return this.y = e,
  38309. this
  38310. },
  38311. setZ: function(e) {
  38312. return this.z = e,
  38313. this
  38314. },
  38315. setW: function(e) {
  38316. return this.w = e,
  38317. this
  38318. },
  38319. setComponent: function(e, t) {
  38320. switch (e) {
  38321. case 0:
  38322. this.x = t;
  38323. break;
  38324. case 1:
  38325. this.y = t;
  38326. break;
  38327. case 2:
  38328. this.z = t;
  38329. break;
  38330. case 3:
  38331. this.w = t;
  38332. break;
  38333. default:
  38334. throw new Error("index is out of range: " + e)
  38335. }
  38336. },
  38337. getComponent: function(e) {
  38338. switch (e) {
  38339. case 0:
  38340. return this.x;
  38341. case 1:
  38342. return this.y;
  38343. case 2:
  38344. return this.z;
  38345. case 3:
  38346. return this.w;
  38347. default:
  38348. throw new Error("index is out of range: " + e)
  38349. }
  38350. },
  38351. clone: function() {
  38352. return new this.constructor(this.x,this.y,this.z,this.w)
  38353. },
  38354. copy: function(e) {
  38355. return this.x = e.x,
  38356. this.y = e.y,
  38357. this.z = e.z,
  38358. this.w = void 0 !== e.w ? e.w : 1,
  38359. this
  38360. },
  38361. add: function(e, t) {
  38362. return void 0 !== t ? (console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  38363. this.addVectors(e, t)) : (this.x += e.x,
  38364. this.y += e.y,
  38365. this.z += e.z,
  38366. this.w += e.w,
  38367. this)
  38368. },
  38369. addScalar: function(e) {
  38370. return this.x += e,
  38371. this.y += e,
  38372. this.z += e,
  38373. this.w += e,
  38374. this
  38375. },
  38376. addVectors: function(e, t) {
  38377. return this.x = e.x + t.x,
  38378. this.y = e.y + t.y,
  38379. this.z = e.z + t.z,
  38380. this.w = e.w + t.w,
  38381. this
  38382. },
  38383. addScaledVector: function(e, t) {
  38384. return this.x += e.x * t,
  38385. this.y += e.y * t,
  38386. this.z += e.z * t,
  38387. this.w += e.w * t,
  38388. this
  38389. },
  38390. sub: function(e, t) {
  38391. return void 0 !== t ? (console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  38392. this.subVectors(e, t)) : (this.x -= e.x,
  38393. this.y -= e.y,
  38394. this.z -= e.z,
  38395. this.w -= e.w,
  38396. this)
  38397. },
  38398. subScalar: function(e) {
  38399. return this.x -= e,
  38400. this.y -= e,
  38401. this.z -= e,
  38402. this.w -= e,
  38403. this
  38404. },
  38405. subVectors: function(e, t) {
  38406. return this.x = e.x - t.x,
  38407. this.y = e.y - t.y,
  38408. this.z = e.z - t.z,
  38409. this.w = e.w - t.w,
  38410. this
  38411. },
  38412. multiplyScalar: function(e) {
  38413. return isFinite(e) ? (this.x *= e,
  38414. this.y *= e,
  38415. this.z *= e,
  38416. this.w *= e) : (this.x = 0,
  38417. this.y = 0,
  38418. this.z = 0,
  38419. this.w = 0),
  38420. this
  38421. },
  38422. applyMatrix4: function(e) {
  38423. var t = this.x
  38424. , i = this.y
  38425. , n = this.z
  38426. , r = this.w
  38427. , o = e.elements;
  38428. return this.x = o[0] * t + o[4] * i + o[8] * n + o[12] * r,
  38429. this.y = o[1] * t + o[5] * i + o[9] * n + o[13] * r,
  38430. this.z = o[2] * t + o[6] * i + o[10] * n + o[14] * r,
  38431. this.w = o[3] * t + o[7] * i + o[11] * n + o[15] * r,
  38432. this
  38433. },
  38434. divideScalar: function(e) {
  38435. return this.multiplyScalar(1 / e)
  38436. },
  38437. setAxisAngleFromQuaternion: function(e) {
  38438. this.w = 2 * Math.acos(e.w);
  38439. var t = Math.sqrt(1 - e.w * e.w);
  38440. return t < 1e-4 ? (this.x = 1,
  38441. this.y = 0,
  38442. this.z = 0) : (this.x = e.x / t,
  38443. this.y = e.y / t,
  38444. this.z = e.z / t),
  38445. this
  38446. },
  38447. setAxisAngleFromRotationMatrix: function(e) {
  38448. 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];
  38449. if (Math.abs(s - c) < .01 && Math.abs(l - d) < .01 && Math.abs(u - p) < .01) {
  38450. if (Math.abs(s + c) < .1 && Math.abs(l + d) < .1 && Math.abs(u + p) < .1 && Math.abs(a + h + f - 3) < .1)
  38451. return this.set(1, 0, 0, 0),
  38452. this;
  38453. t = Math.PI;
  38454. var g = (a + 1) / 2
  38455. , m = (h + 1) / 2
  38456. , v = (f + 1) / 2
  38457. , y = (s + c) / 4
  38458. , A = (l + d) / 4
  38459. , C = (u + p) / 4;
  38460. return m < g && v < g ? r = g < .01 ? (i = 0,
  38461. n = .707106781) : (n = y / (i = Math.sqrt(g)),
  38462. A / i) : v < m ? r = m < .01 ? (n = 0,
  38463. i = .707106781) : (i = y / (n = Math.sqrt(m)),
  38464. C / n) : v < .01 ? (n = i = .707106781,
  38465. r = 0) : (i = A / (r = Math.sqrt(v)),
  38466. n = C / r),
  38467. this.set(i, n, r, t),
  38468. this
  38469. }
  38470. var I = Math.sqrt((p - u) * (p - u) + (l - d) * (l - d) + (c - s) * (c - s));
  38471. return Math.abs(I) < .001 && (I = 1),
  38472. this.x = (p - u) / I,
  38473. this.y = (l - d) / I,
  38474. this.z = (c - s) / I,
  38475. this.w = Math.acos((a + h + f - 1) / 2),
  38476. this
  38477. },
  38478. min: function(e) {
  38479. return this.x = Math.min(this.x, e.x),
  38480. this.y = Math.min(this.y, e.y),
  38481. this.z = Math.min(this.z, e.z),
  38482. this.w = Math.min(this.w, e.w),
  38483. this
  38484. },
  38485. max: function(e) {
  38486. return this.x = Math.max(this.x, e.x),
  38487. this.y = Math.max(this.y, e.y),
  38488. this.z = Math.max(this.z, e.z),
  38489. this.w = Math.max(this.w, e.w),
  38490. this
  38491. },
  38492. clamp: function(e, t) {
  38493. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  38494. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  38495. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  38496. this.w = Math.max(e.w, Math.min(t.w, this.w)),
  38497. this
  38498. },
  38499. clampScalar: function(e, t) {
  38500. return void 0 === _e && (_e = new Ci.Vector4,
  38501. be = new Ci.Vector4),
  38502. _e.set(e, e, e, e),
  38503. be.set(t, t, t, t),
  38504. this.clamp(_e, be)
  38505. },
  38506. floor: function() {
  38507. return this.x = Math.floor(this.x),
  38508. this.y = Math.floor(this.y),
  38509. this.z = Math.floor(this.z),
  38510. this.w = Math.floor(this.w),
  38511. this
  38512. },
  38513. ceil: function() {
  38514. return this.x = Math.ceil(this.x),
  38515. this.y = Math.ceil(this.y),
  38516. this.z = Math.ceil(this.z),
  38517. this.w = Math.ceil(this.w),
  38518. this
  38519. },
  38520. round: function() {
  38521. return this.x = Math.round(this.x),
  38522. this.y = Math.round(this.y),
  38523. this.z = Math.round(this.z),
  38524. this.w = Math.round(this.w),
  38525. this
  38526. },
  38527. roundToZero: function() {
  38528. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  38529. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  38530. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  38531. this.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w),
  38532. this
  38533. },
  38534. negate: function() {
  38535. return this.x = -this.x,
  38536. this.y = -this.y,
  38537. this.z = -this.z,
  38538. this.w = -this.w,
  38539. this
  38540. },
  38541. dot: function(e) {
  38542. return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w
  38543. },
  38544. lengthSq: function() {
  38545. return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w
  38546. },
  38547. length: function() {
  38548. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w)
  38549. },
  38550. lengthManhattan: function() {
  38551. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w)
  38552. },
  38553. normalize: function() {
  38554. return this.divideScalar(this.length())
  38555. },
  38556. setLength: function(e) {
  38557. return this.multiplyScalar(e / this.length())
  38558. },
  38559. lerp: function(e, t) {
  38560. return this.x += (e.x - this.x) * t,
  38561. this.y += (e.y - this.y) * t,
  38562. this.z += (e.z - this.z) * t,
  38563. this.w += (e.w - this.w) * t,
  38564. this
  38565. },
  38566. lerpVectors: function(e, t, i) {
  38567. return this.subVectors(t, e).multiplyScalar(i).add(e),
  38568. this
  38569. },
  38570. equals: function(e) {
  38571. return e.x === this.x && e.y === this.y && e.z === this.z && e.w === this.w
  38572. },
  38573. fromArray: function(e, t) {
  38574. return void 0 === t && (t = 0),
  38575. this.x = e[t],
  38576. this.y = e[t + 1],
  38577. this.z = e[t + 2],
  38578. this.w = e[t + 3],
  38579. this
  38580. },
  38581. toArray: function(e, t) {
  38582. return void 0 === e && (e = []),
  38583. void 0 === t && (t = 0),
  38584. e[t] = this.x,
  38585. e[t + 1] = this.y,
  38586. e[t + 2] = this.z,
  38587. e[t + 3] = this.w,
  38588. e
  38589. },
  38590. fromAttribute: function(e, t, i) {
  38591. return void 0 === i && (i = 0),
  38592. t = t * e.itemSize + i,
  38593. this.x = e.array[t],
  38594. this.y = e.array[t + 1],
  38595. this.z = e.array[t + 2],
  38596. this.w = e.array[t + 3],
  38597. this
  38598. }
  38599. },
  38600. Ci.Euler = function(e, t, i, n) {
  38601. this._x = e || 0,
  38602. this._y = t || 0,
  38603. this._z = i || 0,
  38604. this._order = n || Ci.Euler.DefaultOrder
  38605. }
  38606. ,
  38607. Ci.Euler.RotationOrders = ["XYZ", "YZX", "ZXY", "XZY", "YXZ", "ZYX"],
  38608. Ci.Euler.DefaultOrder = "XYZ",
  38609. Ci.Euler.prototype = {
  38610. constructor: Ci.Euler,
  38611. get x() {
  38612. return this._x
  38613. },
  38614. set x(e) {
  38615. this._x = e,
  38616. this.onChangeCallback()
  38617. },
  38618. get y() {
  38619. return this._y
  38620. },
  38621. set y(e) {
  38622. this._y = e,
  38623. this.onChangeCallback()
  38624. },
  38625. get z() {
  38626. return this._z
  38627. },
  38628. set z(e) {
  38629. this._z = e,
  38630. this.onChangeCallback()
  38631. },
  38632. get order() {
  38633. return this._order
  38634. },
  38635. set order(e) {
  38636. this._order = e,
  38637. this.onChangeCallback()
  38638. },
  38639. set: function(e, t, i, n) {
  38640. return this._x = e,
  38641. this._y = t,
  38642. this._z = i,
  38643. this._order = n || this._order,
  38644. this.onChangeCallback(),
  38645. this
  38646. },
  38647. clone: function() {
  38648. return new this.constructor(this._x,this._y,this._z,this._order)
  38649. },
  38650. copy: function(e) {
  38651. return this._x = e._x,
  38652. this._y = e._y,
  38653. this._z = e._z,
  38654. this._order = e._order,
  38655. this.onChangeCallback(),
  38656. this
  38657. },
  38658. toObject: function() {//xzw
  38659. return {x:this.x,y:this.y,z:this.z}
  38660. },
  38661. setFromRotationMatrix: function(e, t, i) {
  38662. var n = Ci.Math.clamp
  38663. , r = e.elements
  38664. , o = r[0]
  38665. , a = r[4]
  38666. , s = r[8]
  38667. , l = r[1]
  38668. , c = r[5]
  38669. , h = r[9]
  38670. , u = r[2]
  38671. , d = r[6]
  38672. , p = r[10];
  38673. return "XYZ" === (t = t || this._order) ? (this._y = Math.asin(n(s, -1, 1)),
  38674. Math.abs(s) < .99999 ? (this._x = Math.atan2(-h, p),
  38675. this._z = Math.atan2(-a, o)) : (this._x = Math.atan2(d, c),
  38676. this._z = 0)) : "YXZ" === t ? (this._x = Math.asin(-n(h, -1, 1)),
  38677. Math.abs(h) < .99999 ? (this._y = Math.atan2(s, p),
  38678. this._z = Math.atan2(l, c)) : (this._y = Math.atan2(-u, o),
  38679. this._z = 0)) : "ZXY" === t ? (this._x = Math.asin(n(d, -1, 1)),
  38680. Math.abs(d) < .99999 ? (this._y = Math.atan2(-u, p),
  38681. this._z = Math.atan2(-a, c)) : (this._y = 0,
  38682. this._z = Math.atan2(l, o))) : "ZYX" === t ? (this._y = Math.asin(-n(u, -1, 1)),
  38683. Math.abs(u) < .99999 ? (this._x = Math.atan2(d, p),
  38684. this._z = Math.atan2(l, o)) : (this._x = 0,
  38685. this._z = Math.atan2(-a, c))) : "YZX" === t ? (this._z = Math.asin(n(l, -1, 1)),
  38686. Math.abs(l) < .99999 ? (this._x = Math.atan2(-h, c),
  38687. this._y = Math.atan2(-u, o)) : (this._x = 0,
  38688. this._y = Math.atan2(s, p))) : "XZY" === t ? (this._z = Math.asin(-n(a, -1, 1)),
  38689. Math.abs(a) < .99999 ? (this._x = Math.atan2(d, c),
  38690. this._y = Math.atan2(s, o)) : (this._x = Math.atan2(-h, p),
  38691. this._y = 0)) : console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: " + t),
  38692. this._order = t,
  38693. !1 !== i && this.onChangeCallback(),
  38694. this
  38695. },
  38696. setFromQuaternion: function(e, t, i) {
  38697. return void 0 === Ee && (Ee = new Ci.Matrix4),
  38698. Ee.makeRotationFromQuaternion(e),
  38699. this.setFromRotationMatrix(Ee, t, i),
  38700. this
  38701. },
  38702. setFromVector3: function(e, t) {
  38703. return this.set(e.x, e.y, e.z, t || this._order)
  38704. },
  38705. reorder: (Ie = new Ci.Quaternion,
  38706. function(e) {
  38707. Ie.setFromEuler(this),
  38708. this.setFromQuaternion(Ie, e)
  38709. }
  38710. ),
  38711. equals: function(e) {
  38712. return e._x === this._x && e._y === this._y && e._z === this._z && e._order === this._order
  38713. },
  38714. fromArray: function(e) {
  38715. return this._x = e[0],
  38716. this._y = e[1],
  38717. this._z = e[2],
  38718. void 0 !== e[3] && (this._order = e[3]),
  38719. this.onChangeCallback(),
  38720. this
  38721. },
  38722. toArray: function(e, t) {
  38723. return void 0 === e && (e = []),
  38724. void 0 === t && (t = 0),
  38725. e[t] = this._x,
  38726. e[t + 1] = this._y,
  38727. e[t + 2] = this._z,
  38728. e[t + 3] = this._order,
  38729. e
  38730. },
  38731. toVector3: function(e) {
  38732. return e ? e.set(this._x, this._y, this._z) : new Ci.Vector3(this._x,this._y,this._z)
  38733. },
  38734. onChange: function(e) {
  38735. return this.onChangeCallback = e,
  38736. this
  38737. },
  38738. onChangeCallback: function() {}
  38739. },
  38740. Ci.Line3 = function(e, t) {
  38741. this.start = void 0 !== e ? e : new Ci.Vector3,
  38742. this.end = void 0 !== t ? t : new Ci.Vector3
  38743. }
  38744. ,
  38745. Ci.Line3.prototype = {
  38746. constructor: Ci.Line3,
  38747. set: function(e, t) {
  38748. return this.start.copy(e),
  38749. this.end.copy(t),
  38750. this
  38751. },
  38752. clone: function() {
  38753. return (new this.constructor).copy(this)
  38754. },
  38755. copy: function(e) {
  38756. return this.start.copy(e.start),
  38757. this.end.copy(e.end),
  38758. this
  38759. },
  38760. center: function(e) {
  38761. return (e || new Ci.Vector3).addVectors(this.start, this.end).multiplyScalar(.5)
  38762. },
  38763. delta: function(e) {
  38764. return (e || new Ci.Vector3).subVectors(this.end, this.start)
  38765. },
  38766. distanceSq: function() {
  38767. return this.start.distanceToSquared(this.end)
  38768. },
  38769. distance: function() {
  38770. return this.start.distanceTo(this.end)
  38771. },
  38772. at: function(e, t) {
  38773. var i = t || new Ci.Vector3;
  38774. return this.delta(i).multiplyScalar(e).add(this.start)
  38775. },
  38776. closestPointToPointParameter: (Ae = new Ci.Vector3,
  38777. Ce = new Ci.Vector3,
  38778. function(e, t) {
  38779. Ae.subVectors(e, this.start),
  38780. Ce.subVectors(this.end, this.start);
  38781. var i = Ce.dot(Ce)
  38782. , n = Ce.dot(Ae) / i;
  38783. return t && (n = Ci.Math.clamp(n, 0, 1)),
  38784. n
  38785. }
  38786. ),
  38787. closestPointToPoint: function(e, t, i) {
  38788. var n = this.closestPointToPointParameter(e, t)
  38789. , r = i || new Ci.Vector3;
  38790. return this.delta(r).multiplyScalar(n).add(this.start)
  38791. },
  38792. applyMatrix4: function(e) {
  38793. return this.start.applyMatrix4(e),
  38794. this.end.applyMatrix4(e),
  38795. this
  38796. },
  38797. equals: function(e) {
  38798. return e.start.equals(this.start) && e.end.equals(this.end)
  38799. }
  38800. },
  38801. Ci.Box2 = function(e, t) {
  38802. this.min = void 0 !== e ? e : new Ci.Vector2(1 / 0,1 / 0),
  38803. this.max = void 0 !== t ? t : new Ci.Vector2(-1 / 0,-1 / 0)
  38804. }
  38805. ,
  38806. Ci.Box2.prototype = {
  38807. constructor: Ci.Box2,
  38808. set: function(e, t) {
  38809. return this.min.copy(e),
  38810. this.max.copy(t),
  38811. this
  38812. },
  38813. setFromPoints: function(e) {
  38814. this.makeEmpty();
  38815. for (var t = 0, i = e.length; t < i; t++)
  38816. this.expandByPoint(e[t]);
  38817. return this
  38818. },
  38819. setFromCenterAndSize: (ye = new Ci.Vector2,
  38820. function(e, t) {
  38821. var i = ye.copy(t).multiplyScalar(.5);
  38822. return this.min.copy(e).sub(i),
  38823. this.max.copy(e).add(i),
  38824. this
  38825. }
  38826. ),
  38827. clone: function() {
  38828. return (new this.constructor).copy(this)
  38829. },
  38830. copy: function(e) {
  38831. return this.min.copy(e.min),
  38832. this.max.copy(e.max),
  38833. this
  38834. },
  38835. makeEmpty: function() {
  38836. return this.min.x = this.min.y = 1 / 0,
  38837. this.max.x = this.max.y = -1 / 0,
  38838. this
  38839. },
  38840. isEmpty: function() {
  38841. return this.max.x < this.min.x || this.max.y < this.min.y
  38842. },
  38843. center: function(e) {
  38844. return (e || new Ci.Vector2).addVectors(this.min, this.max).multiplyScalar(.5)
  38845. },
  38846. size: function(e) {
  38847. return (e || new Ci.Vector2).subVectors(this.max, this.min)
  38848. },
  38849. expandByPoint: function(e) {
  38850. return this.min.min(e),
  38851. this.max.max(e),
  38852. this
  38853. },
  38854. expandByVector: function(e) {
  38855. return this.min.sub(e),
  38856. this.max.add(e),
  38857. this
  38858. },
  38859. expandByScalar: function(e) {
  38860. return this.min.addScalar(-e),
  38861. this.max.addScalar(e),
  38862. this
  38863. },
  38864. containsPoint: function(e) {
  38865. return !(e.x < this.min.x || e.x > this.max.x || e.y < this.min.y || e.y > this.max.y)
  38866. },
  38867. containsBox: function(e) {
  38868. 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
  38869. },
  38870. getParameter: function(e, t) {
  38871. 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))
  38872. },
  38873. intersectsBox: function(e) {
  38874. 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)
  38875. },
  38876. clampPoint: function(e, t) {
  38877. return (t || new Ci.Vector2).copy(e).clamp(this.min, this.max)
  38878. },
  38879. distanceToPoint: (ve = new Ci.Vector2,
  38880. function(e) {
  38881. return ve.copy(e).clamp(this.min, this.max).sub(e).length()
  38882. }
  38883. ),
  38884. intersect: function(e) {
  38885. return this.min.max(e.min),
  38886. this.max.min(e.max),
  38887. this
  38888. },
  38889. union: function(e) {
  38890. return this.min.min(e.min),
  38891. this.max.max(e.max),
  38892. this
  38893. },
  38894. translate: function(e) {
  38895. return this.min.add(e),
  38896. this.max.add(e),
  38897. this
  38898. },
  38899. equals: function(e) {
  38900. return e.min.equals(this.min) && e.max.equals(this.max)
  38901. }
  38902. },
  38903. Ci.Box3 = function(e, t) {
  38904. this.min = void 0 !== e ? e : new Ci.Vector3(1 / 0,1 / 0,1 / 0),
  38905. this.max = void 0 !== t ? t : new Ci.Vector3(-1 / 0,-1 / 0,-1 / 0)
  38906. }
  38907. ,
  38908. Ci.Box3.prototype = {
  38909. constructor: Ci.Box3,
  38910. set: function(e, t) {
  38911. return this.min.copy(e),
  38912. this.max.copy(t),
  38913. this
  38914. },
  38915. setFromArray: function(e) {
  38916. this.makeEmpty();
  38917. 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) {
  38918. var c = e[s]
  38919. , h = e[s + 1]
  38920. , u = e[s + 2];
  38921. c < t && (t = c),
  38922. h < i && (i = h),
  38923. u < n && (n = u),
  38924. r < c && (r = c),
  38925. o < h && (o = h),
  38926. a < u && (a = u)
  38927. }
  38928. this.min.set(t, i, n),
  38929. this.max.set(r, o, a)
  38930. },
  38931. setFromPoints: function(e) {
  38932. this.makeEmpty();
  38933. for (var t = 0, i = e.length; t < i; t++)
  38934. this.expandByPoint(e[t]);
  38935. return this
  38936. },
  38937. setFromCenterAndSize: (me = new Ci.Vector3,
  38938. function(e, t) {
  38939. var i = me.copy(t).multiplyScalar(.5);
  38940. return this.min.copy(e).sub(i),
  38941. this.max.copy(e).add(i),
  38942. this
  38943. }
  38944. ),
  38945. setFromObject: function(e) {
  38946. void 0 === ge && (ge = new Ci.Box3);
  38947. var i = this;
  38948. return this.makeEmpty(),
  38949. e.updateMatrixWorld(!0),
  38950. e.traverse(function(e) {
  38951. var t = e.geometry;
  38952. void 0 !== t && (null === t.boundingBox && t.computeBoundingBox(),
  38953. !1 === t.boundingBox.isEmpty() && (ge.copy(t.boundingBox),
  38954. ge.applyMatrix4(e.matrixWorld),
  38955. i.union(ge)))
  38956. }),
  38957. this
  38958. },
  38959. clone: function() {
  38960. return (new this.constructor).copy(this)
  38961. },
  38962. copy: function(e) {
  38963. return this.min.copy(e.min),
  38964. this.max.copy(e.max),
  38965. this
  38966. },
  38967. makeEmpty: function() {
  38968. return this.min.x = this.min.y = this.min.z = 1 / 0,
  38969. this.max.x = this.max.y = this.max.z = -1 / 0,
  38970. this
  38971. },
  38972. isEmpty: function() {
  38973. return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z
  38974. },
  38975. center: function(e) {
  38976. return (e || new Ci.Vector3).addVectors(this.min, this.max).multiplyScalar(.5)
  38977. },
  38978. size: function(e) {
  38979. return (e || new Ci.Vector3).subVectors(this.max, this.min)
  38980. },
  38981. expandByPoint: function(e) {
  38982. return this.min.min(e),
  38983. this.max.max(e),
  38984. this
  38985. },
  38986. expandByVector: function(e) {
  38987. return this.min.sub(e),
  38988. this.max.add(e),
  38989. this
  38990. },
  38991. expandByScalar: function(e) {
  38992. return this.min.addScalar(-e),
  38993. this.max.addScalar(e),
  38994. this
  38995. },
  38996. containsPoint: function(e) {
  38997. 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)
  38998. },
  38999. containsBox: function(e) {
  39000. 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
  39001. },
  39002. getParameter: function(e, t) {
  39003. 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))
  39004. },
  39005. intersectsBox: function(e) {
  39006. 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)
  39007. },
  39008. intersectsSphere: function(e) {
  39009. return void 0 === fe && (fe = new Ci.Vector3),
  39010. this.clampPoint(e.center, fe),
  39011. fe.distanceToSquared(e.center) <= e.radius * e.radius
  39012. },
  39013. intersectsPlane: function(e) {
  39014. var t, i;
  39015. return i = 0 < e.normal.x ? (t = e.normal.x * this.min.x,
  39016. e.normal.x * this.max.x) : (t = e.normal.x * this.max.x,
  39017. e.normal.x * this.min.x),
  39018. 0 < e.normal.y ? (t += e.normal.y * this.min.y,
  39019. i += e.normal.y * this.max.y) : (t += e.normal.y * this.max.y,
  39020. i += e.normal.y * this.min.y),
  39021. 0 < e.normal.z ? (t += e.normal.z * this.min.z,
  39022. i += e.normal.z * this.max.z) : (t += e.normal.z * this.max.z,
  39023. i += e.normal.z * this.min.z),
  39024. t <= e.constant && i >= e.constant
  39025. },
  39026. clampPoint: function(e, t) {
  39027. return (t || new Ci.Vector3).copy(e).clamp(this.min, this.max)
  39028. },
  39029. distanceToPoint: (pe = new Ci.Vector3,
  39030. function(e) {
  39031. return pe.copy(e).clamp(this.min, this.max).sub(e).length()
  39032. }
  39033. ),
  39034. getBoundingSphere: (de = new Ci.Vector3,
  39035. function(e) {
  39036. var t = e || new Ci.Sphere;
  39037. return t.center = this.center(),
  39038. t.radius = .5 * this.size(de).length(),
  39039. t
  39040. }
  39041. ),
  39042. intersect: function(e) {
  39043. return this.min.max(e.min),
  39044. this.max.min(e.max),
  39045. this
  39046. },
  39047. union: function(e) {
  39048. return this.min.min(e.min),
  39049. this.max.max(e.max),
  39050. this
  39051. },
  39052. 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],
  39053. function(e) {
  39054. return ue[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(e),
  39055. ue[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(e),
  39056. ue[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(e),
  39057. ue[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(e),
  39058. ue[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(e),
  39059. ue[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(e),
  39060. ue[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(e),
  39061. ue[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(e),
  39062. this.makeEmpty(),
  39063. this.setFromPoints(ue),
  39064. this
  39065. }
  39066. ),
  39067. translate: function(e) {
  39068. return this.min.add(e),
  39069. this.max.add(e),
  39070. this
  39071. },
  39072. equals: function(e) {
  39073. return e.min.equals(this.min) && e.max.equals(this.max)
  39074. }
  39075. },
  39076. Ci.Matrix3 = function() {
  39077. this.elements = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]),
  39078. 0 < arguments.length && console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")
  39079. }
  39080. ,
  39081. Ci.Matrix3.prototype = {
  39082. constructor: Ci.Matrix3,
  39083. set: function(e, t, i, n, r, o, a, s, l) {
  39084. var c = this.elements;
  39085. return c[0] = e,
  39086. c[1] = n,
  39087. c[2] = a,
  39088. c[3] = t,
  39089. c[4] = r,
  39090. c[5] = s,
  39091. c[6] = i,
  39092. c[7] = o,
  39093. c[8] = l,
  39094. this
  39095. },
  39096. identity: function() {
  39097. return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1),
  39098. this
  39099. },
  39100. clone: function() {
  39101. return (new this.constructor).fromArray(this.elements)
  39102. },
  39103. copy: function(e) {
  39104. var t = e.elements;
  39105. return this.set(t[0], t[3], t[6], t[1], t[4], t[7], t[2], t[5], t[8]),
  39106. this
  39107. },
  39108. setFromMatrix4: function(e) {
  39109. var t = e.elements;
  39110. return this.set(t[0], t[4], t[8], t[1], t[5], t[9], t[2], t[6], t[10]),
  39111. this
  39112. },
  39113. applyToVector3Array: function(e, t, i) {
  39114. void 0 === he && (he = new Ci.Vector3),
  39115. void 0 === t && (t = 0),
  39116. void 0 === i && (i = e.length);
  39117. for (var n = 0, r = t; n < i; n += 3,
  39118. r += 3)
  39119. he.fromArray(e, r),
  39120. he.applyMatrix3(this),
  39121. he.toArray(e, r);
  39122. return e
  39123. },
  39124. applyToBuffer: function(e, t, i) {
  39125. void 0 === ce && (ce = new Ci.Vector3),
  39126. void 0 === t && (t = 0),
  39127. void 0 === i && (i = e.length / e.itemSize);
  39128. for (var n = 0, r = t; n < i; n++,
  39129. r++)
  39130. ce.x = e.getX(r),
  39131. ce.y = e.getY(r),
  39132. ce.z = e.getZ(r),
  39133. ce.applyMatrix3(this),
  39134. e.setXYZ(ce.x, ce.y, ce.z);
  39135. return e
  39136. },
  39137. multiplyScalar: function(e) {
  39138. var t = this.elements;
  39139. return t[0] *= e,
  39140. t[3] *= e,
  39141. t[6] *= e,
  39142. t[1] *= e,
  39143. t[4] *= e,
  39144. t[7] *= e,
  39145. t[2] *= e,
  39146. t[5] *= e,
  39147. t[8] *= e,
  39148. this
  39149. },
  39150. determinant: function() {
  39151. var e = this.elements
  39152. , t = e[0]
  39153. , i = e[1]
  39154. , n = e[2]
  39155. , r = e[3]
  39156. , o = e[4]
  39157. , a = e[5]
  39158. , s = e[6]
  39159. , l = e[7]
  39160. , c = e[8];
  39161. return t * o * c - t * a * l - i * r * c + i * a * s + n * r * l - n * o * s
  39162. },
  39163. getInverse: function(e, t) {
  39164. e instanceof Ci.Matrix4 && console.warn("THREE.Matrix3.getInverse no longer takes a Matrix4 argument.");
  39165. var i = e.elements
  39166. , n = this.elements
  39167. , r = i[0]
  39168. , o = i[1]
  39169. , a = i[2]
  39170. , s = i[3]
  39171. , l = i[4]
  39172. , c = i[5]
  39173. , h = i[6]
  39174. , u = i[7]
  39175. , d = i[8]
  39176. , p = d * l - c * u
  39177. , f = c * h - d * s
  39178. , g = u * s - l * h
  39179. , m = r * p + o * f + a * g;
  39180. if (0 != m)
  39181. return n[0] = p,
  39182. n[1] = a * u - d * o,
  39183. n[2] = c * o - a * l,
  39184. n[3] = f,
  39185. n[4] = d * r - a * h,
  39186. n[5] = a * s - c * r,
  39187. n[6] = g,
  39188. n[7] = o * h - u * r,
  39189. n[8] = l * r - o * s,
  39190. this.multiplyScalar(1 / m);
  39191. var v = "THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0";
  39192. if (t)
  39193. throw new Error(v);
  39194. return console.warn(v),
  39195. this.identity()
  39196. },
  39197. transpose: function() {
  39198. var e, t = this.elements;
  39199. return e = t[1],
  39200. t[1] = t[3],
  39201. t[3] = e,
  39202. e = t[2],
  39203. t[2] = t[6],
  39204. t[6] = e,
  39205. e = t[5],
  39206. t[5] = t[7],
  39207. t[7] = e,
  39208. this
  39209. },
  39210. flattenToArrayOffset: function(e, t) {
  39211. var i = this.elements;
  39212. return e[t] = i[0],
  39213. e[t + 1] = i[1],
  39214. e[t + 2] = i[2],
  39215. e[t + 3] = i[3],
  39216. e[t + 4] = i[4],
  39217. e[t + 5] = i[5],
  39218. e[t + 6] = i[6],
  39219. e[t + 7] = i[7],
  39220. e[t + 8] = i[8],
  39221. e
  39222. },
  39223. getNormalMatrix: function(e) {
  39224. return this.setFromMatrix4(e).getInverse(this).transpose()
  39225. },
  39226. transposeIntoArray: function(e) {
  39227. var t = this.elements;
  39228. return e[0] = t[0],
  39229. e[1] = t[3],
  39230. e[2] = t[6],
  39231. e[3] = t[1],
  39232. e[4] = t[4],
  39233. e[5] = t[7],
  39234. e[6] = t[2],
  39235. e[7] = t[5],
  39236. e[8] = t[8],
  39237. this
  39238. },
  39239. fromArray: function(e) {
  39240. return this.elements.set(e),
  39241. this
  39242. },
  39243. toArray: function() {
  39244. var e = this.elements;
  39245. return [e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8]]
  39246. }
  39247. },
  39248. Ci.Matrix4 = function() {
  39249. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  39250. 0 < arguments.length && console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  39251. }
  39252. ,
  39253. Ci.Matrix4.prototype = {
  39254. constructor: Ci.Matrix4,
  39255. set: function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  39256. var m = this.elements;
  39257. return m[0] = e,
  39258. m[4] = t,
  39259. m[8] = i,
  39260. m[12] = n,
  39261. m[1] = r,
  39262. m[5] = o,
  39263. m[9] = a,
  39264. m[13] = s,
  39265. m[2] = l,
  39266. m[6] = c,
  39267. m[10] = h,
  39268. m[14] = u,
  39269. m[3] = d,
  39270. m[7] = p,
  39271. m[11] = f,
  39272. m[15] = g,
  39273. this
  39274. },
  39275. identity: function() {
  39276. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  39277. this
  39278. },
  39279. clone: function() {
  39280. return (new Ci.Matrix4).fromArray(this.elements)
  39281. },
  39282. copy: function(e) {
  39283. return this.elements.set(e.elements),
  39284. this
  39285. },
  39286. copyPosition: function(e) {
  39287. var t = this.elements
  39288. , i = e.elements;
  39289. return t[12] = i[12],
  39290. t[13] = i[13],
  39291. t[14] = i[14],
  39292. this
  39293. },
  39294. extractBasis: function(e, t, i) {
  39295. return e.setFromMatrixColumn(this, 0),
  39296. t.setFromMatrixColumn(this, 1),
  39297. i.setFromMatrixColumn(this, 2),
  39298. this
  39299. },
  39300. makeBasis: function(e, t, i) {
  39301. 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),
  39302. this
  39303. },
  39304. extractRotation: function(e) {
  39305. void 0 === le && (le = new Ci.Vector3);
  39306. var t = this.elements
  39307. , i = e.elements
  39308. , n = 1 / le.setFromMatrixColumn(e, 0).length()
  39309. , r = 1 / le.setFromMatrixColumn(e, 1).length()
  39310. , o = 1 / le.setFromMatrixColumn(e, 2).length();
  39311. return t[0] = i[0] * n,
  39312. t[1] = i[1] * n,
  39313. t[2] = i[2] * n,
  39314. t[4] = i[4] * r,
  39315. t[5] = i[5] * r,
  39316. t[6] = i[6] * r,
  39317. t[8] = i[8] * o,
  39318. t[9] = i[9] * o,
  39319. t[10] = i[10] * o,
  39320. this
  39321. },
  39322. makeRotationFromEuler: function(e) {
  39323. e instanceof Ci.Euler == 0 && console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  39324. var t = this.elements
  39325. , i = e.x
  39326. , n = e.y
  39327. , r = e.z
  39328. , o = Math.cos(i)
  39329. , a = Math.sin(i)
  39330. , s = Math.cos(n)
  39331. , l = Math.sin(n)
  39332. , c = Math.cos(r)
  39333. , h = Math.sin(r);
  39334. if ("XYZ" === e.order) {
  39335. var u = o * c
  39336. , d = o * h
  39337. , p = a * c
  39338. , f = a * h;
  39339. t[0] = s * c,
  39340. t[4] = -s * h,
  39341. t[8] = l,
  39342. t[1] = d + p * l,
  39343. t[5] = u - f * l,
  39344. t[9] = -a * s,
  39345. t[2] = f - u * l,
  39346. t[6] = p + d * l,
  39347. t[10] = o * s
  39348. } else if ("YXZ" === e.order) {
  39349. var g = s * c
  39350. , m = s * h
  39351. , v = l * c
  39352. , y = l * h;
  39353. t[0] = g + y * a,
  39354. t[4] = v * a - m,
  39355. t[8] = o * l,
  39356. t[1] = o * h,
  39357. t[5] = o * c,
  39358. t[9] = -a,
  39359. t[2] = m * a - v,
  39360. t[6] = y + g * a,
  39361. t[10] = o * s
  39362. } else if ("ZXY" === e.order) {
  39363. g = s * c,
  39364. m = s * h,
  39365. v = l * c,
  39366. y = l * h;
  39367. t[0] = g - y * a,
  39368. t[4] = -o * h,
  39369. t[8] = v + m * a,
  39370. t[1] = m + v * a,
  39371. t[5] = o * c,
  39372. t[9] = y - g * a,
  39373. t[2] = -o * l,
  39374. t[6] = a,
  39375. t[10] = o * s
  39376. } else if ("ZYX" === e.order) {
  39377. u = o * c,
  39378. d = o * h,
  39379. p = a * c,
  39380. f = a * h;
  39381. t[0] = s * c,
  39382. t[4] = p * l - d,
  39383. t[8] = u * l + f,
  39384. t[1] = s * h,
  39385. t[5] = f * l + u,
  39386. t[9] = d * l - p,
  39387. t[2] = -l,
  39388. t[6] = a * s,
  39389. t[10] = o * s
  39390. } else if ("YZX" === e.order) {
  39391. var A = o * s
  39392. , C = o * l
  39393. , I = a * s
  39394. , E = a * l;
  39395. t[0] = s * c,
  39396. t[4] = E - A * h,
  39397. t[8] = I * h + C,
  39398. t[1] = h,
  39399. t[5] = o * c,
  39400. t[9] = -a * c,
  39401. t[2] = -l * c,
  39402. t[6] = C * h + I,
  39403. t[10] = A - E * h
  39404. } else if ("XZY" === e.order) {
  39405. A = o * s,
  39406. C = o * l,
  39407. I = a * s,
  39408. E = a * l;
  39409. t[0] = s * c,
  39410. t[4] = -h,
  39411. t[8] = l * c,
  39412. t[1] = A * h + E,
  39413. t[5] = o * c,
  39414. t[9] = C * h - I,
  39415. t[2] = I * h - C,
  39416. t[6] = a * c,
  39417. t[10] = E * h + A
  39418. }
  39419. return t[3] = 0,
  39420. t[7] = 0,
  39421. t[11] = 0,
  39422. t[12] = 0,
  39423. t[13] = 0,
  39424. t[14] = 0,
  39425. t[15] = 1,
  39426. this
  39427. },
  39428. makeRotationFromQuaternion: function(e) {
  39429. var t = this.elements
  39430. , i = e.x
  39431. , n = e.y
  39432. , r = e.z
  39433. , o = e.w
  39434. , a = i + i
  39435. , s = n + n
  39436. , l = r + r
  39437. , c = i * a
  39438. , h = i * s
  39439. , u = i * l
  39440. , d = n * s
  39441. , p = n * l
  39442. , f = r * l
  39443. , g = o * a
  39444. , m = o * s
  39445. , v = o * l;
  39446. return t[0] = 1 - (d + f),
  39447. t[4] = h - v,
  39448. t[8] = u + m,
  39449. t[1] = h + v,
  39450. t[5] = 1 - (c + f),
  39451. t[9] = p - g,
  39452. t[2] = u - m,
  39453. t[6] = p + g,
  39454. t[10] = 1 - (c + d),
  39455. t[3] = 0,
  39456. t[7] = 0,
  39457. t[11] = 0,
  39458. t[12] = 0,
  39459. t[13] = 0,
  39460. t[14] = 0,
  39461. t[15] = 1,
  39462. this
  39463. },
  39464. lookAt: function(e, t, i) {
  39465. void 0 === oe && (oe = new Ci.Vector3),
  39466. void 0 === ae && (ae = new Ci.Vector3),
  39467. void 0 === se && (se = new Ci.Vector3);
  39468. var n = this.elements;
  39469. return se.subVectors(e, t).normalize(),
  39470. 0 === se.lengthSq() && (se.z = 1),
  39471. oe.crossVectors(i, se).normalize(),
  39472. 0 === oe.lengthSq() && (se.x += 1e-4,
  39473. oe.crossVectors(i, se).normalize()),
  39474. ae.crossVectors(se, oe),
  39475. n[0] = oe.x,
  39476. n[4] = ae.x,
  39477. n[8] = se.x,
  39478. n[1] = oe.y,
  39479. n[5] = ae.y,
  39480. n[9] = se.y,
  39481. n[2] = oe.z,
  39482. n[6] = ae.z,
  39483. n[10] = se.z,
  39484. this
  39485. },
  39486. multiply: function(e, t) {
  39487. return void 0 !== t ? (console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),
  39488. this.multiplyMatrices(e, t)) : this.multiplyMatrices(this, e)
  39489. },
  39490. multiplyMatrices: function(e, t) {
  39491. var i = e.elements
  39492. , n = t.elements
  39493. , r = this.elements
  39494. , o = i[0]
  39495. , a = i[4]
  39496. , s = i[8]
  39497. , l = i[12]
  39498. , c = i[1]
  39499. , h = i[5]
  39500. , u = i[9]
  39501. , d = i[13]
  39502. , p = i[2]
  39503. , f = i[6]
  39504. , g = i[10]
  39505. , m = i[14]
  39506. , v = i[3]
  39507. , y = i[7]
  39508. , A = i[11]
  39509. , C = i[15]
  39510. , I = n[0]
  39511. , E = n[4]
  39512. , _ = n[8]
  39513. , b = n[12]
  39514. , w = n[1]
  39515. , T = n[5]
  39516. , x = n[9]
  39517. , S = n[13]
  39518. , M = n[2]
  39519. , R = n[6]
  39520. , P = n[10]
  39521. , O = n[14]
  39522. , L = n[3]
  39523. , D = n[7]
  39524. , N = n[11]
  39525. , F = n[15];
  39526. return r[0] = o * I + a * w + s * M + l * L,
  39527. r[4] = o * E + a * T + s * R + l * D,
  39528. r[8] = o * _ + a * x + s * P + l * N,
  39529. r[12] = o * b + a * S + s * O + l * F,
  39530. r[1] = c * I + h * w + u * M + d * L,
  39531. r[5] = c * E + h * T + u * R + d * D,
  39532. r[9] = c * _ + h * x + u * P + d * N,
  39533. r[13] = c * b + h * S + u * O + d * F,
  39534. r[2] = p * I + f * w + g * M + m * L,
  39535. r[6] = p * E + f * T + g * R + m * D,
  39536. r[10] = p * _ + f * x + g * P + m * N,
  39537. r[14] = p * b + f * S + g * O + m * F,
  39538. r[3] = v * I + y * w + A * M + C * L,
  39539. r[7] = v * E + y * T + A * R + C * D,
  39540. r[11] = v * _ + y * x + A * P + C * N,
  39541. r[15] = v * b + y * S + A * O + C * F,
  39542. this
  39543. },
  39544. multiplyToArray: function(e, t, i) {
  39545. var n = this.elements;
  39546. return this.multiplyMatrices(e, t),
  39547. i[0] = n[0],
  39548. i[1] = n[1],
  39549. i[2] = n[2],
  39550. i[3] = n[3],
  39551. i[4] = n[4],
  39552. i[5] = n[5],
  39553. i[6] = n[6],
  39554. i[7] = n[7],
  39555. i[8] = n[8],
  39556. i[9] = n[9],
  39557. i[10] = n[10],
  39558. i[11] = n[11],
  39559. i[12] = n[12],
  39560. i[13] = n[13],
  39561. i[14] = n[14],
  39562. i[15] = n[15],
  39563. this
  39564. },
  39565. multiplyScalar: function(e) {
  39566. var t = this.elements;
  39567. return t[0] *= e,
  39568. t[4] *= e,
  39569. t[8] *= e,
  39570. t[12] *= e,
  39571. t[1] *= e,
  39572. t[5] *= e,
  39573. t[9] *= e,
  39574. t[13] *= e,
  39575. t[2] *= e,
  39576. t[6] *= e,
  39577. t[10] *= e,
  39578. t[14] *= e,
  39579. t[3] *= e,
  39580. t[7] *= e,
  39581. t[11] *= e,
  39582. t[15] *= e,
  39583. this
  39584. },
  39585. applyToVector3Array: function(e, t, i) {
  39586. void 0 === re && (re = new Ci.Vector3),
  39587. void 0 === t && (t = 0),
  39588. void 0 === i && (i = e.length);
  39589. for (var n = 0, r = t; n < i; n += 3,
  39590. r += 3)
  39591. re.fromArray(e, r),
  39592. re.applyMatrix4(this),
  39593. re.toArray(e, r);
  39594. return e
  39595. },
  39596. applyToBuffer: function(e, t, i) {
  39597. void 0 === ne && (ne = new Ci.Vector3),
  39598. void 0 === t && (t = 0),
  39599. void 0 === i && (i = e.length / e.itemSize);
  39600. for (var n = 0, r = t; n < i; n++,
  39601. r++)
  39602. ne.x = e.getX(r),
  39603. ne.y = e.getY(r),
  39604. ne.z = e.getZ(r),
  39605. ne.applyMatrix4(this),
  39606. e.setXYZ(ne.x, ne.y, ne.z);
  39607. return e
  39608. },
  39609. determinant: function() {
  39610. var e = this.elements
  39611. , t = e[0]
  39612. , i = e[4]
  39613. , n = e[8]
  39614. , r = e[12]
  39615. , o = e[1]
  39616. , a = e[5]
  39617. , s = e[9]
  39618. , l = e[13]
  39619. , c = e[2]
  39620. , h = e[6]
  39621. , u = e[10]
  39622. , d = e[14];
  39623. 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)
  39624. },
  39625. transpose: function() {
  39626. var e, t = this.elements;
  39627. return e = t[1],
  39628. t[1] = t[4],
  39629. t[4] = e,
  39630. e = t[2],
  39631. t[2] = t[8],
  39632. t[8] = e,
  39633. e = t[6],
  39634. t[6] = t[9],
  39635. t[9] = e,
  39636. e = t[3],
  39637. t[3] = t[12],
  39638. t[12] = e,
  39639. e = t[7],
  39640. t[7] = t[13],
  39641. t[13] = e,
  39642. e = t[11],
  39643. t[11] = t[14],
  39644. t[14] = e,
  39645. this
  39646. },
  39647. flattenToArrayOffset: function(e, t) {
  39648. var i = this.elements;
  39649. return e[t] = i[0],
  39650. e[t + 1] = i[1],
  39651. e[t + 2] = i[2],
  39652. e[t + 3] = i[3],
  39653. e[t + 4] = i[4],
  39654. e[t + 5] = i[5],
  39655. e[t + 6] = i[6],
  39656. e[t + 7] = i[7],
  39657. e[t + 8] = i[8],
  39658. e[t + 9] = i[9],
  39659. e[t + 10] = i[10],
  39660. e[t + 11] = i[11],
  39661. e[t + 12] = i[12],
  39662. e[t + 13] = i[13],
  39663. e[t + 14] = i[14],
  39664. e[t + 15] = i[15],
  39665. e
  39666. },
  39667. getPosition: function() {
  39668. return void 0 === ie && (ie = new Ci.Vector3),
  39669. console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),
  39670. ie.setFromMatrixColumn(this, 3)
  39671. },
  39672. setPosition: function(e) {
  39673. var t = this.elements;
  39674. return t[12] = e.x,
  39675. t[13] = e.y,
  39676. t[14] = e.z,
  39677. this
  39678. },
  39679. getInverse: function(e, t) {
  39680. var i = this.elements
  39681. , n = e.elements
  39682. , r = n[0]
  39683. , o = n[1]
  39684. , a = n[2]
  39685. , s = n[3]
  39686. , l = n[4]
  39687. , c = n[5]
  39688. , h = n[6]
  39689. , u = n[7]
  39690. , d = n[8]
  39691. , p = n[9]
  39692. , f = n[10]
  39693. , g = n[11]
  39694. , m = n[12]
  39695. , v = n[13]
  39696. , y = n[14]
  39697. , A = n[15]
  39698. , C = p * y * u - v * f * u + v * h * g - c * y * g - p * h * A + c * f * A
  39699. , I = m * f * u - d * y * u - m * h * g + l * y * g + d * h * A - l * f * A
  39700. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * A + l * p * A
  39701. , _ = m * p * h - d * v * h - m * c * f + l * v * f + d * c * y - l * p * y
  39702. , b = r * C + o * I + a * E + s * _;
  39703. if (0 != b)
  39704. return i[0] = C,
  39705. i[1] = v * f * s - p * y * s - v * a * g + o * y * g + p * a * A - o * f * A,
  39706. i[2] = c * y * s - v * h * s + v * a * u - o * y * u - c * a * A + o * h * A,
  39707. i[3] = p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g,
  39708. i[4] = I,
  39709. i[5] = d * y * s - m * f * s + m * a * g - r * y * g - d * a * A + r * f * A,
  39710. i[6] = m * h * s - l * y * s - m * a * u + r * y * u + l * a * A - r * h * A,
  39711. i[7] = l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g,
  39712. i[8] = E,
  39713. i[9] = m * p * s - d * v * s - m * o * g + r * v * g + d * o * A - r * p * A,
  39714. i[10] = l * v * s - m * c * s + m * o * u - r * v * u - l * o * A + r * c * A,
  39715. i[11] = d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g,
  39716. i[12] = _,
  39717. i[13] = d * v * a - m * p * a + m * o * f - r * v * f - d * o * y + r * p * y,
  39718. i[14] = m * c * a - l * v * a - m * o * h + r * v * h + l * o * y - r * c * y,
  39719. i[15] = l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f,
  39720. this.multiplyScalar(1 / b);
  39721. var w = "THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  39722. if (t)
  39723. throw new Error(w);
  39724. return console.warn(w),
  39725. this.identity()
  39726. },
  39727. scale: function(e) {
  39728. var t = this.elements
  39729. , i = e.x
  39730. , n = e.y
  39731. , r = e.z;
  39732. return t[0] *= i,
  39733. t[4] *= n,
  39734. t[8] *= r,
  39735. t[1] *= i,
  39736. t[5] *= n,
  39737. t[9] *= r,
  39738. t[2] *= i,
  39739. t[6] *= n,
  39740. t[10] *= r,
  39741. t[3] *= i,
  39742. t[7] *= n,
  39743. t[11] *= r,
  39744. this
  39745. },
  39746. getMaxScaleOnAxis: function() {
  39747. var e = this.elements
  39748. , t = e[0] * e[0] + e[1] * e[1] + e[2] * e[2]
  39749. , i = e[4] * e[4] + e[5] * e[5] + e[6] * e[6]
  39750. , n = e[8] * e[8] + e[9] * e[9] + e[10] * e[10];
  39751. return Math.sqrt(Math.max(t, i, n))
  39752. },
  39753. makeTranslation: function(e, t, i) {
  39754. return this.set(1, 0, 0, e, 0, 1, 0, t, 0, 0, 1, i, 0, 0, 0, 1),
  39755. this
  39756. },
  39757. makeRotationX: function(e) {
  39758. var t = Math.cos(e)
  39759. , i = Math.sin(e);
  39760. return this.set(1, 0, 0, 0, 0, t, -i, 0, 0, i, t, 0, 0, 0, 0, 1),
  39761. this
  39762. },
  39763. makeRotationY: function(e) {
  39764. var t = Math.cos(e)
  39765. , i = Math.sin(e);
  39766. return this.set(t, 0, i, 0, 0, 1, 0, 0, -i, 0, t, 0, 0, 0, 0, 1),
  39767. this
  39768. },
  39769. makeRotationZ: function(e) {
  39770. var t = Math.cos(e)
  39771. , i = Math.sin(e);
  39772. return this.set(t, -i, 0, 0, i, t, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  39773. this
  39774. },
  39775. makeRotationAxis: function(e, t) {
  39776. var i = Math.cos(t)
  39777. , n = Math.sin(t)
  39778. , r = 1 - i
  39779. , o = e.x
  39780. , a = e.y
  39781. , s = e.z
  39782. , l = r * o
  39783. , c = r * a;
  39784. 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),
  39785. this
  39786. },
  39787. makeScale: function(e, t, i) {
  39788. return this.set(e, 0, 0, 0, 0, t, 0, 0, 0, 0, i, 0, 0, 0, 0, 1),
  39789. this
  39790. },
  39791. compose: function(e, t, i) {
  39792. return this.makeRotationFromQuaternion(t),
  39793. this.scale(i),
  39794. this.setPosition(e),
  39795. this
  39796. },
  39797. decompose: function(e, t, i) {
  39798. void 0 === ee && (ee = new Ci.Vector3),
  39799. void 0 === te && (te = new Ci.Matrix4);
  39800. var n = this.elements
  39801. , r = ee.set(n[0], n[1], n[2]).length()
  39802. , o = ee.set(n[4], n[5], n[6]).length()
  39803. , a = ee.set(n[8], n[9], n[10]).length();
  39804. this.determinant() < 0 && (r = -r),
  39805. e.x = n[12],
  39806. e.y = n[13],
  39807. e.z = n[14],
  39808. te.elements.set(this.elements);
  39809. var s = 1 / r
  39810. , l = 1 / o
  39811. , c = 1 / a;
  39812. return te.elements[0] *= s,
  39813. te.elements[1] *= s,
  39814. te.elements[2] *= s,
  39815. te.elements[4] *= l,
  39816. te.elements[5] *= l,
  39817. te.elements[6] *= l,
  39818. te.elements[8] *= c,
  39819. te.elements[9] *= c,
  39820. te.elements[10] *= c,
  39821. t.setFromRotationMatrix(te),
  39822. i.x = r,
  39823. i.y = o,
  39824. i.z = a,
  39825. this
  39826. },
  39827. makeFrustum: function(e, t, i, n, r, o) {
  39828. var a = this.elements
  39829. , s = 2 * r / (t - e)
  39830. , l = 2 * r / (n - i)
  39831. , c = (t + e) / (t - e)
  39832. , h = (n + i) / (n - i)
  39833. , u = -(o + r) / (o - r)
  39834. , d = -2 * o * r / (o - r);
  39835. return a[0] = s,
  39836. a[4] = 0,
  39837. a[8] = c,
  39838. a[12] = 0,
  39839. a[1] = 0,
  39840. a[5] = l,
  39841. a[9] = h,
  39842. a[13] = 0,
  39843. a[2] = 0,
  39844. a[6] = 0,
  39845. a[10] = u,
  39846. a[14] = d,
  39847. a[3] = 0,
  39848. a[7] = 0,
  39849. a[11] = -1,
  39850. a[15] = 0,
  39851. this
  39852. },
  39853. makePerspective: function(e, t, i, n) {
  39854. var r = i * Math.tan(Ci.Math.degToRad(.5 * e))
  39855. , o = -r
  39856. , a = o * t
  39857. , s = r * t;
  39858. return this.makeFrustum(a, s, o, r, i, n)
  39859. },
  39860. makeOrthographic: function(e, t, i, n, r, o) {
  39861. var a = this.elements
  39862. , s = 1 / (t - e)
  39863. , l = 1 / (i - n)
  39864. , c = 1 / (o - r)
  39865. , h = (t + e) * s
  39866. , u = (i + n) * l
  39867. , d = (o + r) * c;
  39868. return a[0] = 2 * s,
  39869. a[4] = 0,
  39870. a[8] = 0,
  39871. a[12] = -h,
  39872. a[1] = 0,
  39873. a[5] = 2 * l,
  39874. a[9] = 0,
  39875. a[13] = -u,
  39876. a[2] = 0,
  39877. a[6] = 0,
  39878. a[10] = -2 * c,
  39879. a[14] = -d,
  39880. a[3] = 0,
  39881. a[7] = 0,
  39882. a[11] = 0,
  39883. a[15] = 1,
  39884. this
  39885. },
  39886. equals: function(e) {
  39887. for (var t = this.elements, i = e.elements, n = 0; n < 16; n++)
  39888. if (t[n] !== i[n])
  39889. return !1;
  39890. return !0
  39891. },
  39892. fromArray: function(e) {
  39893. return this.elements.set(e),
  39894. this
  39895. },
  39896. toArray: function() {
  39897. var e = this.elements;
  39898. 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]]
  39899. }
  39900. },
  39901. Ci.Ray = function(e, t) {
  39902. this.origin = void 0 !== e ? e : new Ci.Vector3,
  39903. this.direction = void 0 !== t ? t : new Ci.Vector3
  39904. }
  39905. ,
  39906. Ci.Ray.prototype = {
  39907. constructor: Ci.Ray,
  39908. set: function(e, t) {
  39909. return this.origin.copy(e),
  39910. this.direction.copy(t),
  39911. this
  39912. },
  39913. clone: function() {
  39914. return (new this.constructor).copy(this)
  39915. },
  39916. copy: function(e) {
  39917. return this.origin.copy(e.origin),
  39918. this.direction.copy(e.direction),
  39919. this
  39920. },
  39921. at: function(e, t) {
  39922. return (t || new Ci.Vector3).copy(this.direction).multiplyScalar(e).add(this.origin)
  39923. },
  39924. lookAt: function(e) {
  39925. this.direction.copy(e).sub(this.origin).normalize()
  39926. },
  39927. recast: ($ = new Ci.Vector3,
  39928. function(e) {
  39929. return this.origin.copy(this.at(e, $)),
  39930. this
  39931. }
  39932. ),
  39933. closestPointToPoint: function(e, t) {
  39934. var i = t || new Ci.Vector3;
  39935. i.subVectors(e, this.origin);
  39936. var n = i.dot(this.direction);
  39937. return n < 0 ? i.copy(this.origin) : i.copy(this.direction).multiplyScalar(n).add(this.origin)
  39938. },
  39939. distanceToPoint: function(e) {
  39940. return Math.sqrt(this.distanceSqToPoint(e))
  39941. },
  39942. distanceSqToPoint: (J = new Ci.Vector3,
  39943. function(e) {
  39944. var t = J.subVectors(e, this.origin).dot(this.direction);
  39945. return t < 0 ? this.origin.distanceToSquared(e) : (J.copy(this.direction).multiplyScalar(t).add(this.origin),
  39946. J.distanceToSquared(e))
  39947. }
  39948. ),
  39949. distanceSqToSegment: (Z = new Ci.Vector3,
  39950. K = new Ci.Vector3,
  39951. Q = new Ci.Vector3,
  39952. function(e, t, i, n) {
  39953. Z.copy(e).add(t).multiplyScalar(.5),
  39954. K.copy(t).sub(e).normalize(),
  39955. Q.copy(this.origin).sub(Z);
  39956. 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);
  39957. if (0 < p)
  39958. if (o = c * h - u,
  39959. s = l * p,
  39960. 0 <= (r = c * u - h))
  39961. if (-s <= o)
  39962. if (o <= s) {
  39963. var f = 1 / p;
  39964. a = (r *= f) * (r + c * (o *= f) + 2 * h) + o * (c * r + o + 2 * u) + d
  39965. } else
  39966. o = l,
  39967. a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
  39968. else
  39969. o = -l,
  39970. a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
  39971. else
  39972. 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,
  39973. (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;
  39974. else
  39975. o = 0 < c ? -l : l,
  39976. a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
  39977. return i && i.copy(this.direction).multiplyScalar(r).add(this.origin),
  39978. n && n.copy(K).multiplyScalar(o).add(Z),
  39979. a
  39980. }
  39981. ),
  39982. intersectSphere: (X = new Ci.Vector3,
  39983. function(e, t) {
  39984. X.subVectors(e.center, this.origin);
  39985. var i = X.dot(this.direction)
  39986. , n = X.dot(X) - i * i
  39987. , r = e.radius * e.radius;
  39988. if (r < n)
  39989. return null;
  39990. var o = Math.sqrt(r - n)
  39991. , a = i - o
  39992. , s = i + o;
  39993. return a < 0 && s < 0 ? null : a < 0 ? this.at(s, t) : this.at(a, t)
  39994. }
  39995. ),
  39996. intersectsSphere: function(e) {
  39997. return this.distanceToPoint(e.center) <= e.radius
  39998. },
  39999. distanceToPlane: function(e) {
  40000. var t = e.normal.dot(this.direction);
  40001. if (0 === t)
  40002. return 0 === e.distanceToPoint(this.origin) ? 0 : null;
  40003. var i = -(this.origin.dot(e.normal) + e.constant) / t;
  40004. return 0 <= i ? i : null
  40005. },
  40006. intersectPlane: function(e, t) {
  40007. var i = this.distanceToPlane(e);
  40008. return null === i ? null : this.at(i, t)
  40009. },
  40010. intersectsPlane: function(e) {
  40011. var t = e.distanceToPoint(this.origin);
  40012. return 0 === t || e.normal.dot(this.direction) * t < 0
  40013. },
  40014. intersectBox: function(e, t) {
  40015. 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;
  40016. return n = 0 <= l ? (i = (e.min.x - u.x) * l,
  40017. (e.max.x - u.x) * l) : (i = (e.max.x - u.x) * l,
  40018. (e.min.x - u.x) * l),
  40019. (o = 0 <= c ? (r = (e.min.y - u.y) * c,
  40020. (e.max.y - u.y) * c) : (r = (e.max.y - u.y) * c,
  40021. (e.min.y - u.y) * c)) < i || n < r ? null : ((i < r || i != i) && (i = r),
  40022. (o < n || n != n) && (n = o),
  40023. (s = 0 <= h ? (a = (e.min.z - u.z) * h,
  40024. (e.max.z - u.z) * h) : (a = (e.max.z - u.z) * h,
  40025. (e.min.z - u.z) * h)) < i || n < a ? null : ((i < a || i != i) && (i = a),
  40026. (s < n || n != n) && (n = s),
  40027. n < 0 ? null : this.at(0 <= i ? i : n, t)))
  40028. },
  40029. intersectsBox: (q = new Ci.Vector3,
  40030. function(e) {
  40031. return null !== this.intersectBox(e, q)
  40032. }
  40033. ),
  40034. intersectTriangle: (G = new Ci.Vector3,
  40035. W = new Ci.Vector3,
  40036. j = new Ci.Vector3,
  40037. Y = new Ci.Vector3,
  40038. function(e, t, i, n, r) {
  40039. W.subVectors(t, e),
  40040. j.subVectors(i, e),
  40041. Y.crossVectors(W, j);
  40042. var o, a = this.direction.dot(Y);
  40043. if (0 < a) {
  40044. if (n)
  40045. return null;
  40046. o = 1
  40047. } else {
  40048. if (!(a < 0))
  40049. return null;
  40050. o = -1,
  40051. a = -a
  40052. }
  40053. G.subVectors(this.origin, e);
  40054. var s = o * this.direction.dot(j.crossVectors(G, j));
  40055. if (s < 0)
  40056. return null;
  40057. var l = o * this.direction.dot(W.cross(G));
  40058. if (l < 0)
  40059. return null;
  40060. if (a < s + l)
  40061. return null;
  40062. var c = -o * G.dot(Y);
  40063. return c < 0 ? null : this.at(c / a, r)
  40064. }
  40065. ),
  40066. applyMatrix4: function(e) {
  40067. return this.direction.add(this.origin).applyMatrix4(e),
  40068. this.origin.applyMatrix4(e),
  40069. this.direction.sub(this.origin),
  40070. this.direction.normalize(),
  40071. this
  40072. },
  40073. equals: function(e) {
  40074. return e.origin.equals(this.origin) && e.direction.equals(this.direction)
  40075. }
  40076. },
  40077. Ci.Sphere = function(e, t) {
  40078. this.center = void 0 !== e ? e : new Ci.Vector3,
  40079. this.radius = void 0 !== t ? t : 0
  40080. }
  40081. ,
  40082. Ci.Sphere.prototype = {
  40083. constructor: Ci.Sphere,
  40084. set: function(e, t) {
  40085. return this.center.copy(e),
  40086. this.radius = t,
  40087. this
  40088. },
  40089. setFromPoints: (z = new Ci.Box3,
  40090. function(e, t) {
  40091. var i = this.center;
  40092. void 0 !== t ? i.copy(t) : z.setFromPoints(e).center(i);
  40093. for (var n = 0, r = 0, o = e.length; r < o; r++)
  40094. n = Math.max(n, i.distanceToSquared(e[r]));
  40095. return this.radius = Math.sqrt(n),
  40096. this
  40097. }
  40098. ),
  40099. clone: function() {
  40100. return (new this.constructor).copy(this)
  40101. },
  40102. copy: function(e) {
  40103. return this.center.copy(e.center),
  40104. this.radius = e.radius,
  40105. this
  40106. },
  40107. empty: function() {
  40108. return this.radius <= 0
  40109. },
  40110. containsPoint: function(e) {
  40111. return e.distanceToSquared(this.center) <= this.radius * this.radius
  40112. },
  40113. distanceToPoint: function(e) {
  40114. return e.distanceTo(this.center) - this.radius
  40115. },
  40116. intersectsSphere: function(e) {
  40117. var t = this.radius + e.radius;
  40118. return e.center.distanceToSquared(this.center) <= t * t
  40119. },
  40120. intersectsBox: function(e) {
  40121. return e.intersectsSphere(this)
  40122. },
  40123. intersectsPlane: function(e) {
  40124. return Math.abs(this.center.dot(e.normal) - e.constant) <= this.radius
  40125. },
  40126. clampPoint: function(e, t) {
  40127. var i = this.center.distanceToSquared(e)
  40128. , n = t || new Ci.Vector3;
  40129. return n.copy(e),
  40130. i > this.radius * this.radius && (n.sub(this.center).normalize(),
  40131. n.multiplyScalar(this.radius).add(this.center)),
  40132. n
  40133. },
  40134. getBoundingBox: function(e) {
  40135. var t = e || new Ci.Box3;
  40136. return t.set(this.center, this.center),
  40137. t.expandByScalar(this.radius),
  40138. t
  40139. },
  40140. applyMatrix4: function(e) {
  40141. return this.center.applyMatrix4(e),
  40142. this.radius = this.radius * e.getMaxScaleOnAxis(),
  40143. this
  40144. },
  40145. translate: function(e) {
  40146. return this.center.add(e),
  40147. this
  40148. },
  40149. equals: function(e) {
  40150. return e.center.equals(this.center) && e.radius === this.radius
  40151. }
  40152. },
  40153. Ci.Frustum = function(e, t, i, n, r, o) {
  40154. 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]
  40155. }
  40156. ,
  40157. Ci.Frustum.prototype = {
  40158. constructor: Ci.Frustum,
  40159. set: function(e, t, i, n, r, o) {
  40160. var a = this.planes;
  40161. return a[0].copy(e),
  40162. a[1].copy(t),
  40163. a[2].copy(i),
  40164. a[3].copy(n),
  40165. a[4].copy(r),
  40166. a[5].copy(o),
  40167. this
  40168. },
  40169. clone: function() {
  40170. return (new this.constructor).copy(this)
  40171. },
  40172. copy: function(e) {
  40173. for (var t = this.planes, i = 0; i < 6; i++)
  40174. t[i].copy(e.planes[i]);
  40175. return this
  40176. },
  40177. setFromMatrix: function(e) {
  40178. var t = this.planes
  40179. , i = e.elements
  40180. , n = i[0]
  40181. , r = i[1]
  40182. , o = i[2]
  40183. , a = i[3]
  40184. , s = i[4]
  40185. , l = i[5]
  40186. , c = i[6]
  40187. , h = i[7]
  40188. , u = i[8]
  40189. , d = i[9]
  40190. , p = i[10]
  40191. , f = i[11]
  40192. , g = i[12]
  40193. , m = i[13]
  40194. , v = i[14]
  40195. , y = i[15];
  40196. return t[0].setComponents(a - n, h - s, f - u, y - g).normalize(),
  40197. t[1].setComponents(a + n, h + s, f + u, y + g).normalize(),
  40198. t[2].setComponents(a + r, h + l, f + d, y + m).normalize(),
  40199. t[3].setComponents(a - r, h - l, f - d, y - m).normalize(),
  40200. t[4].setComponents(a - o, h - c, f - p, y - v).normalize(),
  40201. t[5].setComponents(a + o, h + c, f + p, y + v).normalize(),
  40202. this
  40203. },
  40204. intersectsObject: (H = new Ci.Sphere,
  40205. function(e) {
  40206. var t = e.geometry;
  40207. return null === t.boundingSphere && t.computeBoundingSphere(),
  40208. H.copy(t.boundingSphere),
  40209. H.applyMatrix4(e.matrixWorld),
  40210. this.intersectsSphere(H)
  40211. }
  40212. ),
  40213. intersectsSphere: function(e) {
  40214. for (var t = this.planes, i = e.center, n = -e.radius, r = 0; r < 6; r++) {
  40215. if (t[r].distanceToPoint(i) < n)
  40216. return !1
  40217. }
  40218. return !0
  40219. },
  40220. intersectsBox: (k = new Ci.Vector3,
  40221. U = new Ci.Vector3,
  40222. function(e) {
  40223. for (var t = this.planes, i = 0; i < 6; i++) {
  40224. var n = t[i];
  40225. k.x = 0 < n.normal.x ? e.min.x : e.max.x,
  40226. U.x = 0 < n.normal.x ? e.max.x : e.min.x,
  40227. k.y = 0 < n.normal.y ? e.min.y : e.max.y,
  40228. U.y = 0 < n.normal.y ? e.max.y : e.min.y,
  40229. k.z = 0 < n.normal.z ? e.min.z : e.max.z,
  40230. U.z = 0 < n.normal.z ? e.max.z : e.min.z;
  40231. var r = n.distanceToPoint(k)
  40232. , o = n.distanceToPoint(U);
  40233. if (r < 0 && o < 0)
  40234. return !1
  40235. }
  40236. return !0
  40237. }
  40238. ),
  40239. containsPoint: function(e) {
  40240. for (var t = this.planes, i = 0; i < 6; i++)
  40241. if (t[i].distanceToPoint(e) < 0)
  40242. return !1;
  40243. return !0
  40244. }
  40245. },
  40246. Ci.Plane = function(e, t) {
  40247. this.normal = void 0 !== e ? e : new Ci.Vector3(1,0,0),
  40248. this.constant = void 0 !== t ? t : 0
  40249. }
  40250. ,
  40251. Ci.Plane.prototype = {
  40252. constructor: Ci.Plane,
  40253. set: function(e, t) {
  40254. return this.normal.copy(e),
  40255. this.constant = t,
  40256. this
  40257. },
  40258. setComponents: function(e, t, i, n) {
  40259. return this.normal.set(e, t, i),
  40260. this.constant = n,
  40261. this
  40262. },
  40263. setFromNormalAndCoplanarPoint: function(e, t) {
  40264. return this.normal.copy(e),
  40265. this.constant = -t.dot(this.normal),
  40266. this
  40267. },
  40268. setFromCoplanarPoints: (B = new Ci.Vector3,
  40269. V = new Ci.Vector3,
  40270. function(e, t, i) {
  40271. var n = B.subVectors(i, t).cross(V.subVectors(e, t)).normalize();
  40272. return this.setFromNormalAndCoplanarPoint(n, e),
  40273. this
  40274. }
  40275. ),
  40276. clone: function() {
  40277. return (new this.constructor).copy(this)
  40278. },
  40279. copy: function(e) {
  40280. return this.normal.copy(e.normal),
  40281. this.constant = e.constant,
  40282. this
  40283. },
  40284. normalize: function() {
  40285. var e = 1 / this.normal.length();
  40286. return this.normal.multiplyScalar(e),
  40287. this.constant *= e,
  40288. this
  40289. },
  40290. negate: function() {
  40291. return this.constant *= -1,
  40292. this.normal.negate(),
  40293. this
  40294. },
  40295. distanceToPoint: function(e) {
  40296. return this.normal.dot(e) + this.constant
  40297. },
  40298. distanceToSphere: function(e) {
  40299. return this.distanceToPoint(e.center) - e.radius
  40300. },
  40301. projectPoint: function(e, t) {
  40302. return this.orthoPoint(e, t).sub(e).negate()
  40303. },
  40304. orthoPoint: function(e, t) {
  40305. var i = this.distanceToPoint(e);
  40306. return (t || new Ci.Vector3).copy(this.normal).multiplyScalar(i)
  40307. },
  40308. intersectLine: (F = new Ci.Vector3,
  40309. function(e, t) {
  40310. var i = t || new Ci.Vector3
  40311. , n = e.delta(F)
  40312. , r = this.normal.dot(n);
  40313. if (0 !== r) {
  40314. var o = -(e.start.dot(this.normal) + this.constant) / r;
  40315. if (!(o < 0 || 1 < o))
  40316. return i.copy(n).multiplyScalar(o).add(e.start)
  40317. } else if (0 === this.distanceToPoint(e.start))
  40318. return i.copy(e.start)
  40319. }
  40320. ),
  40321. intersectsLine: function(e) {
  40322. var t = this.distanceToPoint(e.start)
  40323. , i = this.distanceToPoint(e.end);
  40324. return t < 0 && 0 < i || i < 0 && 0 < t
  40325. },
  40326. intersectsBox: function(e) {
  40327. return e.intersectsPlane(this)
  40328. },
  40329. intersectsSphere: function(e) {
  40330. return e.intersectsPlane(this)
  40331. },
  40332. coplanarPoint: function(e) {
  40333. return (e || new Ci.Vector3).copy(this.normal).multiplyScalar(-this.constant)
  40334. },
  40335. applyMatrix4: (L = new Ci.Vector3,
  40336. D = new Ci.Vector3,
  40337. N = new Ci.Matrix3,
  40338. function(e, t) {
  40339. var i = t || N.getNormalMatrix(e)
  40340. , n = L.copy(this.normal).applyMatrix3(i)
  40341. , r = this.coplanarPoint(D);
  40342. return r.applyMatrix4(e),
  40343. this.setFromNormalAndCoplanarPoint(n, r),
  40344. this
  40345. }
  40346. ),
  40347. translate: function(e) {
  40348. return this.constant = this.constant - e.dot(this.normal),
  40349. this
  40350. },
  40351. equals: function(e) {
  40352. return e.normal.equals(this.normal) && e.constant === this.constant
  40353. }
  40354. },
  40355. Ci.Spherical = function(e, t, i) {
  40356. return this.radius = void 0 !== e ? e : 1,
  40357. this.phi = void 0 !== t ? t : 0,
  40358. this.theta = void 0 !== i ? i : 0,
  40359. this
  40360. }
  40361. ,
  40362. Ci.Spherical.prototype = {
  40363. constructor: Ci.Spherical,
  40364. set: function(e, t, i) {
  40365. this.radius = e,
  40366. this.phi = t,
  40367. this.theta = i
  40368. },
  40369. clone: function() {
  40370. return (new this.constructor).copy(this)
  40371. },
  40372. copy: function(e) {
  40373. return this.radius.copy(e.radius),
  40374. this.phi.copy(e.phi),
  40375. this.theta.copy(e.theta),
  40376. this
  40377. },
  40378. makeSafe: function() {
  40379. this.phi = Math.max(1e-6, Math.min(Math.PI - 1e-6, this.phi))
  40380. },
  40381. setFromVector3: function(e) {
  40382. return this.radius = e.length(),
  40383. 0 === this.radius ? (this.theta = 0,
  40384. this.phi = 0) : (this.theta = Math.atan2(e.x, e.z),
  40385. this.phi = Math.acos(Ci.Math.clamp(e.y / this.radius, -1, 1))),
  40386. this
  40387. }
  40388. },
  40389. Ci.Math = {
  40390. generateUUID: (R = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),
  40391. P = new Array(36),
  40392. O = 0,
  40393. function() {
  40394. for (var e = 0; e < 36; e++)
  40395. 8 === e || 13 === e || 18 === e || 23 === e ? P[e] = "-" : 14 === e ? P[e] = "4" : (O <= 2 && (O = 33554432 + 16777216 * Math.random() | 0),
  40396. M = 15 & O,
  40397. O >>= 4,
  40398. P[e] = R[19 === e ? 3 & M | 8 : M]);
  40399. return P.join("")
  40400. }
  40401. ),
  40402. clamp: function(e, t, i) {
  40403. return Math.max(t, Math.min(i, e))
  40404. },
  40405. euclideanModulo: function(e, t) {
  40406. return (e % t + t) % t
  40407. },
  40408. mapLinear: function(e, t, i, n, r) {
  40409. return n + (e - t) * (r - n) / (i - t)
  40410. },
  40411. smoothstep: function(e, t, i) {
  40412. return e <= t ? 0 : i <= e ? 1 : (e = (e - t) / (i - t)) * e * (3 - 2 * e)
  40413. },
  40414. smootherstep: function(e, t, i) {
  40415. return e <= t ? 0 : i <= e ? 1 : (e = (e - t) / (i - t)) * e * e * (e * (6 * e - 15) + 10)
  40416. },
  40417. random16: function() {
  40418. return console.warn("THREE.Math.random16() has been deprecated. Use Math.random() instead."),
  40419. Math.random()
  40420. },
  40421. randInt: function(e, t) {
  40422. return e + Math.floor(Math.random() * (t - e + 1))
  40423. },
  40424. randFloat: function(e, t) {
  40425. return e + Math.random() * (t - e)
  40426. },
  40427. randFloatSpread: function(e) {
  40428. return e * (.5 - Math.random())
  40429. },
  40430. degToRad: (S = Math.PI / 180,
  40431. function(e) {
  40432. return e * S
  40433. }
  40434. ),
  40435. radToDeg: (x = 180 / Math.PI,
  40436. function(e) {
  40437. return e * x
  40438. }
  40439. ),
  40440. isPowerOfTwo: function(e) {
  40441. return 0 == (e & e - 1) && 0 !== e
  40442. },
  40443. nearestPowerOfTwo: function(e) {
  40444. return Math.pow(2, Math.round(Math.log(e) / Math.LN2))
  40445. },
  40446. nextPowerOfTwo: function(e) {
  40447. return e--,
  40448. e |= e >> 1,
  40449. e |= e >> 2,
  40450. e |= e >> 4,
  40451. e |= e >> 8,
  40452. e |= e >> 16,
  40453. ++e
  40454. }
  40455. },
  40456. Ci.Spline = function(e) {
  40457. function t(e, t, i, n, r, o, a) {
  40458. var s = .5 * (i - e)
  40459. , l = .5 * (n - t);
  40460. return (2 * (t - i) + s + l) * a + (-3 * (t - i) - 2 * s - l) * o + s * r + t
  40461. }
  40462. this.points = e;
  40463. var i, n, r, o, a, s, l, c, h, u = [], d = {
  40464. x: 0,
  40465. y: 0,
  40466. z: 0
  40467. };
  40468. this.initFromArray = function(e) {
  40469. this.points = [];
  40470. for (var t = 0; t < e.length; t++)
  40471. this.points[t] = {
  40472. x: e[t][0],
  40473. y: e[t][1],
  40474. z: e[t][2]
  40475. }
  40476. }
  40477. ,
  40478. this.getPoint = function(e) {
  40479. return i = (this.points.length - 1) * e,
  40480. n = Math.floor(i),
  40481. r = i - n,
  40482. u[0] = 0 === n ? n : n - 1,
  40483. u[1] = n,
  40484. u[2] = n > this.points.length - 2 ? this.points.length - 1 : n + 1,
  40485. u[3] = n > this.points.length - 3 ? this.points.length - 1 : n + 2,
  40486. s = this.points[u[0]],
  40487. l = this.points[u[1]],
  40488. c = this.points[u[2]],
  40489. h = this.points[u[3]],
  40490. a = r * (o = r * r),
  40491. d.x = t(s.x, l.x, c.x, h.x, r, o, a),
  40492. d.y = t(s.y, l.y, c.y, h.y, r, o, a),
  40493. d.z = t(s.z, l.z, c.z, h.z, r, o, a),
  40494. d
  40495. }
  40496. ,
  40497. this.getControlPointsArray = function() {
  40498. var e, t, i = this.points.length, n = [];
  40499. for (e = 0; e < i; e++)
  40500. t = this.points[e],
  40501. n[e] = [t.x, t.y, t.z];
  40502. return n
  40503. }
  40504. ,
  40505. this.getLength = function(e) {
  40506. var t, i, n, r, o = 0, a = 0, s = 0, l = new Ci.Vector3, c = new Ci.Vector3, h = [], u = 0;
  40507. for (h[0] = 0,
  40508. e = e || 100,
  40509. n = this.points.length * e,
  40510. l.copy(this.points[0]),
  40511. t = 1; t < n; t++)
  40512. i = t / n,
  40513. r = this.getPoint(i),
  40514. c.copy(r),
  40515. u += c.distanceTo(l),
  40516. l.copy(r),
  40517. o = (this.points.length - 1) * i,
  40518. (a = Math.floor(o)) !== s && (h[a] = u,
  40519. s = a);
  40520. return h[h.length] = u,
  40521. {
  40522. chunks: h,
  40523. total: u
  40524. }
  40525. }
  40526. ,
  40527. this.reparametrizeByArcLength = function(e) {
  40528. var t, i, n, r, o, a, s, l, c = [], h = new Ci.Vector3, u = this.getLength();
  40529. for (c.push(h.copy(this.points[0]).clone()),
  40530. t = 1; t < this.points.length; t++) {
  40531. for (a = u.chunks[t] - u.chunks[t - 1],
  40532. s = Math.ceil(e * a / u.total),
  40533. r = (t - 1) / (this.points.length - 1),
  40534. o = t / (this.points.length - 1),
  40535. i = 1; i < s - 1; i++)
  40536. n = r + i * (1 / s) * (o - r),
  40537. l = this.getPoint(n),
  40538. c.push(h.copy(l).clone());
  40539. c.push(h.copy(this.points[t]).clone())
  40540. }
  40541. this.points = c
  40542. }
  40543. }
  40544. ,
  40545. Ci.Triangle = function(e, t, i) {
  40546. this.a = void 0 !== e ? e : new Ci.Vector3,
  40547. this.b = void 0 !== t ? t : new Ci.Vector3,
  40548. this.c = void 0 !== i ? i : new Ci.Vector3
  40549. }
  40550. ,
  40551. Ci.Triangle.normal = (T = new Ci.Vector3,
  40552. function(e, t, i, n) {
  40553. var r = n || new Ci.Vector3;
  40554. r.subVectors(i, t),
  40555. T.subVectors(e, t),
  40556. r.cross(T);
  40557. var o = r.lengthSq();
  40558. return 0 < o ? r.multiplyScalar(1 / Math.sqrt(o)) : r.set(0, 0, 0)
  40559. }
  40560. ),
  40561. Ci.Triangle.barycoordFromPoint = (_ = new Ci.Vector3,
  40562. b = new Ci.Vector3,
  40563. w = new Ci.Vector3,
  40564. function(e, t, i, n, r) {
  40565. _.subVectors(n, t),
  40566. b.subVectors(i, t),
  40567. w.subVectors(e, t);
  40568. var o = _.dot(_)
  40569. , a = _.dot(b)
  40570. , s = _.dot(w)
  40571. , l = b.dot(b)
  40572. , c = b.dot(w)
  40573. , h = o * l - a * a
  40574. , u = r || new Ci.Vector3;
  40575. if (0 == h)
  40576. return u.set(-2, -1, -1);
  40577. var d = 1 / h
  40578. , p = (l * s - a * c) * d
  40579. , f = (o * c - a * s) * d;
  40580. return u.set(1 - p - f, f, p)
  40581. }
  40582. ),
  40583. Ci.Triangle.containsPoint = (E = new Ci.Vector3,
  40584. function(e, t, i, n) {
  40585. var r = Ci.Triangle.barycoordFromPoint(e, t, i, n, E);
  40586. return 0 <= r.x && 0 <= r.y && r.x + r.y <= 1
  40587. }
  40588. ),
  40589. Ci.Triangle.prototype = {
  40590. constructor: Ci.Triangle,
  40591. set: function(e, t, i) {
  40592. return this.a.copy(e),
  40593. this.b.copy(t),
  40594. this.c.copy(i),
  40595. this
  40596. },
  40597. setFromPointsAndIndices: function(e, t, i, n) {
  40598. return this.a.copy(e[t]),
  40599. this.b.copy(e[i]),
  40600. this.c.copy(e[n]),
  40601. this
  40602. },
  40603. clone: function() {
  40604. return (new this.constructor).copy(this)
  40605. },
  40606. copy: function(e) {
  40607. return this.a.copy(e.a),
  40608. this.b.copy(e.b),
  40609. this.c.copy(e.c),
  40610. this
  40611. },
  40612. area: (C = new Ci.Vector3,
  40613. I = new Ci.Vector3,
  40614. function() {
  40615. return C.subVectors(this.c, this.b),
  40616. I.subVectors(this.a, this.b),
  40617. .5 * C.cross(I).length()
  40618. }
  40619. ),
  40620. midpoint: function(e) {
  40621. return (e || new Ci.Vector3).addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3)
  40622. },
  40623. normal: function(e) {
  40624. return Ci.Triangle.normal(this.a, this.b, this.c, e)
  40625. },
  40626. plane: function(e) {
  40627. return (e || new Ci.Plane).setFromCoplanarPoints(this.a, this.b, this.c)
  40628. },
  40629. barycoordFromPoint: function(e, t) {
  40630. return Ci.Triangle.barycoordFromPoint(e, this.a, this.b, this.c, t)
  40631. },
  40632. containsPoint: function(e) {
  40633. return Ci.Triangle.containsPoint(e, this.a, this.b, this.c)
  40634. },
  40635. equals: function(e) {
  40636. return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c)
  40637. }
  40638. },
  40639. Ci.Interpolant = function(e, t, i, n) {
  40640. this.parameterPositions = e,
  40641. this._cachedIndex = 0,
  40642. this.resultBuffer = void 0 !== n ? n : new t.constructor(i),
  40643. this.sampleValues = t,
  40644. this.valueSize = i
  40645. }
  40646. ,
  40647. Ci.Interpolant.prototype = {
  40648. constructor: Ci.Interpolant,
  40649. evaluate: function(e) {
  40650. var t = this.parameterPositions
  40651. , i = this._cachedIndex
  40652. , n = t[i]
  40653. , r = t[i - 1];
  40654. e: {
  40655. t: {
  40656. var o;
  40657. i: {
  40658. n: if (!(e < n)) {
  40659. for (var a = i + 2; ; ) {
  40660. if (void 0 === n) {
  40661. if (e < r)
  40662. break n;
  40663. return i = t.length,
  40664. this._cachedIndex = i,
  40665. this.afterEnd_(i - 1, e, r)
  40666. }
  40667. if (i === a)
  40668. break;
  40669. if (r = n,
  40670. e < (n = t[++i]))
  40671. break t
  40672. }
  40673. o = t.length;
  40674. break i
  40675. }
  40676. if (r <= e)
  40677. break e;
  40678. var s = t[1];
  40679. e < s && (i = 2,
  40680. r = s);
  40681. for (a = i - 2; ; ) {
  40682. if (void 0 === r)
  40683. return this._cachedIndex = 0,
  40684. this.beforeStart_(0, e, n);
  40685. if (i === a)
  40686. break;
  40687. if (n = r,
  40688. (r = t[--i - 1]) <= e)
  40689. break t
  40690. }
  40691. o = i,
  40692. i = 0
  40693. }
  40694. for (; i < o; ) {
  40695. var l = i + o >>> 1;
  40696. e < t[l] ? o = l : i = 1 + l
  40697. }
  40698. if (n = t[i],
  40699. void 0 === (r = t[i - 1]))
  40700. return this._cachedIndex = 0,
  40701. this.beforeStart_(0, e, n);
  40702. if (void 0 === n)
  40703. return i = t.length,
  40704. this._cachedIndex = i,
  40705. this.afterEnd_(i - 1, r, e)
  40706. }
  40707. this._cachedIndex = i,
  40708. this.intervalChanged_(i, r, n)
  40709. }
  40710. return this.interpolate_(i, r, e, n)
  40711. },
  40712. settings: null,
  40713. DefaultSettings_: {},
  40714. getSettings_: function() {
  40715. return this.settings || this.DefaultSettings_
  40716. },
  40717. copySampleValue_: function(e) {
  40718. for (var t = this.resultBuffer, i = this.sampleValues, n = this.valueSize, r = e * n, o = 0; o !== n; ++o)
  40719. t[o] = i[r + o];
  40720. return t
  40721. },
  40722. interpolate_: function(e, t, i, n) {
  40723. throw new Error("call to abstract method")
  40724. },
  40725. intervalChanged_: function(e, t, i) {}
  40726. },
  40727. Object.assign(Ci.Interpolant.prototype, {
  40728. beforeStart_: Ci.Interpolant.prototype.copySampleValue_,
  40729. afterEnd_: Ci.Interpolant.prototype.copySampleValue_
  40730. }),
  40731. Ci.CubicInterpolant = function(e, t, i, n) {
  40732. Ci.Interpolant.call(this, e, t, i, n),
  40733. this._weightPrev = -0,
  40734. this._offsetPrev = -0,
  40735. this._weightNext = -0,
  40736. this._offsetNext = -0
  40737. }
  40738. ,
  40739. Ci.CubicInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  40740. constructor: Ci.CubicInterpolant,
  40741. DefaultSettings_: {
  40742. endingStart: Ci.ZeroCurvatureEnding,
  40743. endingEnd: Ci.ZeroCurvatureEnding
  40744. },
  40745. intervalChanged_: function(e, t, i) {
  40746. var n = this.parameterPositions
  40747. , r = e - 2
  40748. , o = e + 1
  40749. , a = n[r]
  40750. , s = n[o];
  40751. if (void 0 === a)
  40752. switch (this.getSettings_().endingStart) {
  40753. case Ci.ZeroSlopeEnding:
  40754. r = e,
  40755. a = 2 * t - i;
  40756. break;
  40757. case Ci.WrapAroundEnding:
  40758. a = t + n[r = n.length - 2] - n[r + 1];
  40759. break;
  40760. default:
  40761. r = e,
  40762. a = i
  40763. }
  40764. if (void 0 === s)
  40765. switch (this.getSettings_().endingEnd) {
  40766. case Ci.ZeroSlopeEnding:
  40767. o = e,
  40768. s = 2 * i - t;
  40769. break;
  40770. case Ci.WrapAroundEnding:
  40771. s = i + n[o = 1] - n[0];
  40772. break;
  40773. default:
  40774. o = e - 1,
  40775. s = t
  40776. }
  40777. var l = .5 * (i - t)
  40778. , c = this.valueSize;
  40779. this._weightPrev = l / (t - a),
  40780. this._weightNext = l / (s - i),
  40781. this._offsetPrev = r * c,
  40782. this._offsetNext = o * c
  40783. },
  40784. interpolate_: function(e, t, i, n) {
  40785. 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)
  40786. r[C] = m * o[c + C] + v * o[l + C] + y * o[s + C] + A * o[h + C];
  40787. return r
  40788. }
  40789. }),
  40790. Ci.DiscreteInterpolant = function(e, t, i, n) {
  40791. Ci.Interpolant.call(this, e, t, i, n)
  40792. }
  40793. ,
  40794. Ci.DiscreteInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  40795. constructor: Ci.DiscreteInterpolant,
  40796. interpolate_: function(e, t, i, n) {
  40797. return this.copySampleValue_(e - 1)
  40798. }
  40799. }),
  40800. Ci.LinearInterpolant = function(e, t, i, n) {
  40801. Ci.Interpolant.call(this, e, t, i, n)
  40802. }
  40803. ,
  40804. Ci.LinearInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  40805. constructor: Ci.LinearInterpolant,
  40806. interpolate_: function(e, t, i, n) {
  40807. 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)
  40808. r[u] = o[l + u] * h + o[s + u] * c;
  40809. return r
  40810. }
  40811. }),
  40812. Ci.QuaternionLinearInterpolant = function(e, t, i, n) {
  40813. Ci.Interpolant.call(this, e, t, i, n)
  40814. }
  40815. ,
  40816. Ci.QuaternionLinearInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  40817. constructor: Ci.QuaternionLinearInterpolant,
  40818. interpolate_: function(e, t, i, n) {
  40819. 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)
  40820. Ci.Quaternion.slerpFlat(r, 0, o, s - a, o, s, l);
  40821. return r
  40822. }
  40823. }),
  40824. Ci.Clock = function(e) {
  40825. this.autoStart = void 0 === e || e,
  40826. this.startTime = 0,
  40827. this.oldTime = 0,
  40828. this.elapsedTime = 0,
  40829. this.running = !1
  40830. }
  40831. ,
  40832. Ci.Clock.prototype = {
  40833. constructor: Ci.Clock,
  40834. start: function() {
  40835. this.startTime = performance.now(),
  40836. this.oldTime = this.startTime,
  40837. this.running = !0
  40838. },
  40839. stop: function() {
  40840. this.getElapsedTime(),
  40841. this.running = !1
  40842. },
  40843. getElapsedTime: function() {
  40844. return this.getDelta(),
  40845. this.elapsedTime
  40846. },
  40847. getDelta: function() {
  40848. var e = 0;
  40849. if (this.autoStart && !this.running && this.start(),
  40850. this.running) {
  40851. var t = performance.now();
  40852. e = .001 * (t - this.oldTime),
  40853. this.oldTime = t,
  40854. this.elapsedTime += e
  40855. }
  40856. return e
  40857. }
  40858. },
  40859. Ci.EventDispatcher = function() {}
  40860. ,
  40861. Ci.EventDispatcher.prototype = {
  40862. constructor: Ci.EventDispatcher,
  40863. apply: function(e) {
  40864. e.addEventListener = Ci.EventDispatcher.prototype.addEventListener,
  40865. e.hasEventListener = Ci.EventDispatcher.prototype.hasEventListener,
  40866. e.removeEventListener = Ci.EventDispatcher.prototype.removeEventListener,
  40867. e.dispatchEvent = Ci.EventDispatcher.prototype.dispatchEvent
  40868. },
  40869. addEventListener: function(e, t) {
  40870. void 0 === this._listeners && (this._listeners = {});
  40871. var i = this._listeners;
  40872. void 0 === i[e] && (i[e] = []),
  40873. -1 === i[e].indexOf(t) && i[e].push(t)
  40874. },
  40875. hasEventListener: function(e, t) {
  40876. if (void 0 === this._listeners)
  40877. return !1;
  40878. var i = this._listeners;
  40879. return void 0 !== i[e] && -1 !== i[e].indexOf(t)
  40880. },
  40881. removeEventListener: function(e, t) {
  40882. if (void 0 !== this._listeners) {
  40883. var i = this._listeners[e];
  40884. if (void 0 !== i) {
  40885. var n = i.indexOf(t);
  40886. -1 !== n && i.splice(n, 1)
  40887. }
  40888. }
  40889. },
  40890. dispatchEvent: function(e) {
  40891. if (void 0 !== this._listeners) {
  40892. var t = this._listeners[e.type];
  40893. if (void 0 !== t) {
  40894. e.target = this;
  40895. for (var i = [], n = t.length, r = 0; r < n; r++)
  40896. i[r] = t[r];
  40897. for (r = 0; r < n; r++)
  40898. i[r].call(this, e)
  40899. }
  40900. }
  40901. }
  40902. },
  40903. Ci.Layers = function() {
  40904. this.mask = 1
  40905. }
  40906. ,
  40907. Ci.Layers.prototype = {
  40908. constructor: Ci.Layers,
  40909. set: function(e) {
  40910. this.mask = 1 << e
  40911. },
  40912. enable: function(e) {
  40913. this.mask |= 1 << e
  40914. },
  40915. toggle: function(e) {
  40916. this.mask ^= 1 << e
  40917. },
  40918. disable: function(e) {
  40919. this.mask &= ~(1 << e)
  40920. },
  40921. test: function(e) {
  40922. return 0 != (this.mask & e.mask)
  40923. }
  40924. },
  40925. (A = Ci).Raycaster = function(e, t, i, n) {
  40926. this.ray = new A.Ray(e,t),
  40927. this.near = i || 0,
  40928. this.far = n || 1 / 0,
  40929. this.params = {
  40930. Mesh: {},
  40931. Line: {},
  40932. LOD: {},
  40933. Points: {
  40934. threshold: 1
  40935. },
  40936. Sprite: {}
  40937. },
  40938. Object.defineProperties(this.params, {
  40939. PointCloud: {
  40940. get: function() {
  40941. return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),
  40942. this.Points
  40943. }
  40944. }
  40945. })
  40946. }
  40947. ,
  40948. A.Raycaster.prototype = {
  40949. constructor: A.Raycaster,
  40950. linePrecision: 1,
  40951. set: function(e, t) {
  40952. this.ray.set(e, t)
  40953. },
  40954. setFromCamera: function(e, t) {
  40955. t instanceof A.PerspectiveCamera ? (this.ray.origin.setFromMatrixPosition(t.matrixWorld),
  40956. 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),
  40957. this.ray.direction.set(0, 0, -1).transformDirection(t.matrixWorld)) : console.error("THREE.Raycaster: Unsupported camera type.")
  40958. },
  40959. intersectObject: function(e, t) {
  40960. var i = [];
  40961. return Ei(e, this, i, t),
  40962. i.sort(Ii),
  40963. i
  40964. },
  40965. intersectObjects: function(e, t) {
  40966. var i = [];
  40967. if (!1 === Array.isArray(e))
  40968. return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),
  40969. i;
  40970. for (var n = 0, r = e.length; n < r; n++)
  40971. Ei(e[n], this, i, t);
  40972. return i.sort(Ii),
  40973. i
  40974. }
  40975. },
  40976. Ci.Object3D = function() {
  40977. Object.defineProperty(this, "id", {
  40978. value: Ci.Object3DIdCount++
  40979. }),
  40980. this.uuid = Ci.Math.generateUUID(),
  40981. this.name = "",
  40982. this.type = "Object3D",
  40983. this.parent = null,
  40984. this.children = [],
  40985. this.up = Ci.Object3D.DefaultUp.clone();
  40986. var e = new Ci.Vector3
  40987. , t = new Ci.Euler
  40988. , i = new Ci.Quaternion
  40989. , n = new Ci.Vector3(1,1,1);
  40990. t.onChange(function() {
  40991. i.setFromEuler(t, !1)
  40992. }),
  40993. i.onChange(function() {
  40994. t.setFromQuaternion(i, void 0, !1)
  40995. }),
  40996. Object.defineProperties(this, {
  40997. position: {
  40998. enumerable: !0,
  40999. value: e
  41000. },
  41001. rotation: {
  41002. enumerable: !0,
  41003. value: t
  41004. },
  41005. quaternion: {
  41006. enumerable: !0,
  41007. value: i
  41008. },
  41009. scale: {
  41010. enumerable: !0,
  41011. value: n
  41012. },
  41013. modelViewMatrix: {
  41014. value: new Ci.Matrix4
  41015. },
  41016. normalMatrix: {
  41017. value: new Ci.Matrix3
  41018. }
  41019. }),
  41020. this.rotationAutoUpdate = !0,
  41021. this.matrix = new Ci.Matrix4,
  41022. this.matrixWorld = new Ci.Matrix4,
  41023. this.matrixAutoUpdate = Ci.Object3D.DefaultMatrixAutoUpdate,
  41024. this.matrixWorldNeedsUpdate = !1,
  41025. this.layers = new Ci.Layers,
  41026. this.visible = !0,
  41027. this.castShadow = !1,
  41028. this.receiveShadow = !1,
  41029. this.frustumCulled = !0,
  41030. this.renderOrder = 0,
  41031. this.userData = {}
  41032. }
  41033. ,
  41034. Ci.Object3D.DefaultUp = new Ci.Vector3(0,1,0),
  41035. Ci.Object3D.DefaultMatrixAutoUpdate = !0,
  41036. Ci.Object3D.prototype = {
  41037. constructor: Ci.Object3D,
  41038. applyMatrix: function(e) {
  41039. this.matrix.multiplyMatrices(e, this.matrix),
  41040. this.matrix.decompose(this.position, this.quaternion, this.scale)
  41041. },
  41042. setRotationFromAxisAngle: function(e, t) {
  41043. this.quaternion.setFromAxisAngle(e, t)
  41044. },
  41045. setRotationFromEuler: function(e) {
  41046. this.quaternion.setFromEuler(e, !0)
  41047. },
  41048. setRotationFromMatrix: function(e) {
  41049. this.quaternion.setFromRotationMatrix(e)
  41050. },
  41051. setRotationFromQuaternion: function(e) {
  41052. this.quaternion.copy(e)
  41053. },
  41054. rotateOnAxis: (y = new Ci.Quaternion,
  41055. function(e, t) {
  41056. return y.setFromAxisAngle(e, t),
  41057. this.quaternion.multiply(y),
  41058. this
  41059. }
  41060. ),
  41061. rotateX: (v = new Ci.Vector3(1,0,0),
  41062. function(e) {
  41063. return this.rotateOnAxis(v, e)
  41064. }
  41065. ),
  41066. rotateY: (m = new Ci.Vector3(0,1,0),
  41067. function(e) {
  41068. return this.rotateOnAxis(m, e)
  41069. }
  41070. ),
  41071. rotateZ: (g = new Ci.Vector3(0,0,1),
  41072. function(e) {
  41073. return this.rotateOnAxis(g, e)
  41074. }
  41075. ),
  41076. translateOnAxis: (f = new Ci.Vector3,
  41077. function(e, t) {
  41078. return f.copy(e).applyQuaternion(this.quaternion),
  41079. this.position.add(f.multiplyScalar(t)),
  41080. this
  41081. }
  41082. ),
  41083. translateX: (p = new Ci.Vector3(1,0,0),
  41084. function(e) {
  41085. return this.translateOnAxis(p, e)
  41086. }
  41087. ),
  41088. translateY: (d = new Ci.Vector3(0,1,0),
  41089. function(e) {
  41090. return this.translateOnAxis(d, e)
  41091. }
  41092. ),
  41093. translateZ: (u = new Ci.Vector3(0,0,1),
  41094. function(e) {
  41095. return this.translateOnAxis(u, e)
  41096. }
  41097. ),
  41098. localToWorld: function(e) {
  41099. return e.applyMatrix4(this.matrixWorld)
  41100. },
  41101. worldToLocal: (h = new Ci.Matrix4,
  41102. function(e) {
  41103. return e.applyMatrix4(h.getInverse(this.matrixWorld))
  41104. }
  41105. ),
  41106. lookAt: (c = new Ci.Matrix4,
  41107. function(e) {
  41108. c.lookAt(e, this.position, this.up),
  41109. this.quaternion.setFromRotationMatrix(c)
  41110. }
  41111. ),
  41112. add: function(e) {
  41113. if (1 < arguments.length) {
  41114. for (var t = 0; t < arguments.length; t++)
  41115. this.add(arguments[t]);
  41116. return this
  41117. }
  41118. 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),
  41119. e.parent = this,
  41120. e.dispatchEvent({
  41121. type: "added"
  41122. }),
  41123. this.children.push(e)) : console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.", e),
  41124. this
  41125. },
  41126. remove: function(e) {
  41127. if (1 < arguments.length)
  41128. for (var t = 0; t < arguments.length; t++)
  41129. this.remove(arguments[t]);
  41130. var i = this.children.indexOf(e);
  41131. -1 !== i && (e.parent = null,
  41132. e.dispatchEvent({
  41133. type: "removed"
  41134. }),
  41135. this.children.splice(i, 1))
  41136. },
  41137. getObjectById: function(e) {
  41138. return this.getObjectByProperty("id", e)
  41139. },
  41140. getObjectByName: function(e) {
  41141. return this.getObjectByProperty("name", e)
  41142. },
  41143. getObjectByProperty: function(e, t) {
  41144. if (this[e] === t)
  41145. return this;
  41146. for (var i = 0, n = this.children.length; i < n; i++) {
  41147. var r = this.children[i].getObjectByProperty(e, t);
  41148. if (void 0 !== r)
  41149. return r
  41150. }
  41151. },
  41152. getWorldPosition: function(e) {
  41153. var t = e || new Ci.Vector3;
  41154. return this.updateMatrixWorld(!0),
  41155. t.setFromMatrixPosition(this.matrixWorld)
  41156. },
  41157. getWorldQuaternion: (s = new Ci.Vector3,
  41158. l = new Ci.Vector3,
  41159. function(e) {
  41160. var t = e || new Ci.Quaternion;
  41161. return this.updateMatrixWorld(!0),
  41162. this.matrixWorld.decompose(s, t, l),
  41163. t
  41164. }
  41165. ),
  41166. getWorldRotation: (a = new Ci.Quaternion,
  41167. function(e) {
  41168. var t = e || new Ci.Euler;
  41169. return this.getWorldQuaternion(a),
  41170. t.setFromQuaternion(a, this.rotation.order, !1)
  41171. }
  41172. ),
  41173. getWorldScale: (r = new Ci.Vector3,
  41174. o = new Ci.Quaternion,
  41175. function(e) {
  41176. var t = e || new Ci.Vector3;
  41177. return this.updateMatrixWorld(!0),
  41178. this.matrixWorld.decompose(r, o, t),
  41179. t
  41180. }
  41181. ),
  41182. getWorldDirection: (n = new Ci.Quaternion,
  41183. function(e) {
  41184. var t = e || new Ci.Vector3;
  41185. return this.getWorldQuaternion(n),
  41186. t.set(0, 0, 1).applyQuaternion(n)
  41187. }
  41188. ),
  41189. raycast: function() {},
  41190. traverse: function(e) {
  41191. e(this);
  41192. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  41193. t[i].traverse(e)
  41194. },
  41195. traverseVisible: function(e) {
  41196. if (!1 !== this.visible) {
  41197. e(this);
  41198. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  41199. t[i].traverseVisible(e)
  41200. }
  41201. },
  41202. traverseAncestors: function(e) {
  41203. var t = this.parent;
  41204. null !== t && (e(t),
  41205. t.traverseAncestors(e))
  41206. },
  41207. updateMatrix: function() {
  41208. this.matrix.compose(this.position, this.quaternion, this.scale),
  41209. this.matrixWorldNeedsUpdate = !0
  41210. },
  41211. updateMatrixWorld: function(e) {
  41212. !0 === this.matrixAutoUpdate && this.updateMatrix(),
  41213. !0 !== this.matrixWorldNeedsUpdate && !0 !== e || (null === this.parent ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix),
  41214. e = !(this.matrixWorldNeedsUpdate = !1));
  41215. for (var t = 0, i = this.children.length; t < i; t++)
  41216. this.children[t].updateMatrixWorld(e)
  41217. },
  41218. toJSON: function(e) {
  41219. function t(e) {
  41220. var t = [];
  41221. for (var i in e) {
  41222. var n = e[i];
  41223. delete n.metadata,
  41224. t.push(n)
  41225. }
  41226. return t
  41227. }
  41228. var i = void 0 === e
  41229. , n = {};
  41230. i && (e = {
  41231. geometries: {},
  41232. materials: {},
  41233. textures: {},
  41234. images: {}
  41235. },
  41236. n.metadata = {
  41237. version: 4.4,
  41238. type: "Object",
  41239. generator: "Object3D.toJSON"
  41240. });
  41241. var r = {};
  41242. if (r.uuid = this.uuid,
  41243. r.type = this.type,
  41244. "" !== this.name && (r.name = this.name),
  41245. "{}" !== JSON.stringify(this.userData) && (r.userData = this.userData),
  41246. !0 === this.castShadow && (r.castShadow = !0),
  41247. !0 === this.receiveShadow && (r.receiveShadow = !0),
  41248. !1 === this.visible && (r.visible = !1),
  41249. r.matrix = this.matrix.toArray(),
  41250. void 0 !== this.geometry && (void 0 === e.geometries[this.geometry.uuid] && (e.geometries[this.geometry.uuid] = this.geometry.toJSON(e)),
  41251. r.geometry = this.geometry.uuid),
  41252. void 0 !== this.material && (void 0 === e.materials[this.material.uuid] && (e.materials[this.material.uuid] = this.material.toJSON(e)),
  41253. r.material = this.material.uuid),
  41254. 0 < this.children.length) {
  41255. r.children = [];
  41256. for (var o = 0; o < this.children.length; o++)
  41257. r.children.push(this.children[o].toJSON(e).object)
  41258. }
  41259. if (i) {
  41260. var a = t(e.geometries)
  41261. , s = t(e.materials)
  41262. , l = t(e.textures)
  41263. , c = t(e.images);
  41264. 0 < a.length && (n.geometries = a),
  41265. 0 < s.length && (n.materials = s),
  41266. 0 < l.length && (n.textures = l),
  41267. 0 < c.length && (n.images = c)
  41268. }
  41269. return n.object = r,
  41270. n
  41271. },
  41272. clone: function(e) {
  41273. return (new this.constructor).copy(this, e)
  41274. },
  41275. copy: function(e, t) {
  41276. if (void 0 === t && (t = !0),
  41277. this.name = e.name,
  41278. this.up.copy(e.up),
  41279. this.position.copy(e.position),
  41280. this.quaternion.copy(e.quaternion),
  41281. this.scale.copy(e.scale),
  41282. this.rotationAutoUpdate = e.rotationAutoUpdate,
  41283. this.matrix.copy(e.matrix),
  41284. this.matrixWorld.copy(e.matrixWorld),
  41285. this.matrixAutoUpdate = e.matrixAutoUpdate,
  41286. this.matrixWorldNeedsUpdate = e.matrixWorldNeedsUpdate,
  41287. this.visible = e.visible,
  41288. this.castShadow = e.castShadow,
  41289. this.receiveShadow = e.receiveShadow,
  41290. this.frustumCulled = e.frustumCulled,
  41291. this.renderOrder = e.renderOrder,
  41292. this.userData = JSON.parse(JSON.stringify(e.userData)),
  41293. !0 === t)
  41294. for (var i = 0; i < e.children.length; i++) {
  41295. var n = e.children[i];
  41296. this.add(n.clone())
  41297. }
  41298. return this
  41299. }
  41300. },
  41301. Ci.EventDispatcher.prototype.apply(Ci.Object3D.prototype),
  41302. Ci.Object3DIdCount = 0,
  41303. Ci.Face3 = function(e, t, i, n, r, o) {
  41304. this.a = e,
  41305. this.b = t,
  41306. this.c = i,
  41307. this.normal = n instanceof Ci.Vector3 ? n : new Ci.Vector3,
  41308. this.vertexNormals = Array.isArray(n) ? n : [],
  41309. this.color = r instanceof Ci.Color ? r : new Ci.Color,
  41310. this.vertexColors = Array.isArray(r) ? r : [],
  41311. this.materialIndex = void 0 !== o ? o : 0
  41312. }
  41313. ,
  41314. Ci.Face3.prototype = {
  41315. constructor: Ci.Face3,
  41316. clone: function() {
  41317. return (new this.constructor).copy(this)
  41318. },
  41319. copy: function(e) {
  41320. this.a = e.a,
  41321. this.b = e.b,
  41322. this.c = e.c,
  41323. this.normal.copy(e.normal),
  41324. this.color.copy(e.color),
  41325. this.materialIndex = e.materialIndex;
  41326. for (var t = 0, i = e.vertexNormals.length; t < i; t++)
  41327. this.vertexNormals[t] = e.vertexNormals[t].clone();
  41328. for (t = 0,
  41329. i = e.vertexColors.length; t < i; t++)
  41330. this.vertexColors[t] = e.vertexColors[t].clone();
  41331. return this
  41332. }
  41333. },
  41334. Ci.BufferAttribute = function(e, t) {
  41335. this.uuid = Ci.Math.generateUUID(),
  41336. this.array = e,
  41337. this.itemSize = t,
  41338. this.dynamic = !1,
  41339. this.updateRange = {
  41340. offset: 0,
  41341. count: -1
  41342. },
  41343. this.version = 0
  41344. }
  41345. ,
  41346. Ci.BufferAttribute.prototype = {
  41347. constructor: Ci.BufferAttribute,
  41348. get count() {
  41349. return this.array.length / this.itemSize
  41350. },
  41351. set needsUpdate(e) {
  41352. !0 === e && this.version++
  41353. },
  41354. setDynamic: function(e) {
  41355. return this.dynamic = e,
  41356. this
  41357. },
  41358. copy: function(e) {
  41359. return this.array = new e.array.constructor(e.array),
  41360. this.itemSize = e.itemSize,
  41361. this.dynamic = e.dynamic,
  41362. this
  41363. },
  41364. copyAt: function(e, t, i) {
  41365. e *= this.itemSize,
  41366. i *= t.itemSize;
  41367. for (var n = 0, r = this.itemSize; n < r; n++)
  41368. this.array[e + n] = t.array[i + n];
  41369. return this
  41370. },
  41371. copyArray: function(e) {
  41372. return this.array.set(e),
  41373. this
  41374. },
  41375. copyColorsArray: function(e) {
  41376. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41377. var o = e[n];
  41378. void 0 === o && (console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined", n),
  41379. o = new Ci.Color),
  41380. t[i++] = o.r,
  41381. t[i++] = o.g,
  41382. t[i++] = o.b
  41383. }
  41384. return this
  41385. },
  41386. copyIndicesArray: function(e) {
  41387. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41388. var o = e[n];
  41389. t[i++] = o.a,
  41390. t[i++] = o.b,
  41391. t[i++] = o.c
  41392. }
  41393. return this
  41394. },
  41395. copyVector2sArray: function(e) {
  41396. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41397. var o = e[n];
  41398. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined", n),
  41399. o = new Ci.Vector2),
  41400. t[i++] = o.x,
  41401. t[i++] = o.y
  41402. }
  41403. return this
  41404. },
  41405. copyVector3sArray: function(e) {
  41406. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41407. var o = e[n];
  41408. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined", n),
  41409. o = new Ci.Vector3),
  41410. t[i++] = o.x,
  41411. t[i++] = o.y,
  41412. t[i++] = o.z
  41413. }
  41414. return this
  41415. },
  41416. copyVector4sArray: function(e) {
  41417. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41418. var o = e[n];
  41419. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined", n),
  41420. o = new Ci.Vector4),
  41421. t[i++] = o.x,
  41422. t[i++] = o.y,
  41423. t[i++] = o.z,
  41424. t[i++] = o.w
  41425. }
  41426. return this
  41427. },
  41428. set: function(e, t) {
  41429. return void 0 === t && (t = 0),
  41430. this.array.set(e, t),
  41431. this
  41432. },
  41433. getX: function(e) {
  41434. return this.array[e * this.itemSize]
  41435. },
  41436. setX: function(e, t) {
  41437. return this.array[e * this.itemSize] = t,
  41438. this
  41439. },
  41440. getY: function(e) {
  41441. return this.array[e * this.itemSize + 1]
  41442. },
  41443. setY: function(e, t) {
  41444. return this.array[e * this.itemSize + 1] = t,
  41445. this
  41446. },
  41447. getZ: function(e) {
  41448. return this.array[e * this.itemSize + 2]
  41449. },
  41450. setZ: function(e, t) {
  41451. return this.array[e * this.itemSize + 2] = t,
  41452. this
  41453. },
  41454. getW: function(e) {
  41455. return this.array[e * this.itemSize + 3]
  41456. },
  41457. setW: function(e, t) {
  41458. return this.array[e * this.itemSize + 3] = t,
  41459. this
  41460. },
  41461. setXY: function(e, t, i) {
  41462. return e *= this.itemSize,
  41463. this.array[e + 0] = t,
  41464. this.array[e + 1] = i,
  41465. this
  41466. },
  41467. setXYZ: function(e, t, i, n) {
  41468. return e *= this.itemSize,
  41469. this.array[e + 0] = t,
  41470. this.array[e + 1] = i,
  41471. this.array[e + 2] = n,
  41472. this
  41473. },
  41474. setXYZW: function(e, t, i, n, r) {
  41475. return e *= this.itemSize,
  41476. this.array[e + 0] = t,
  41477. this.array[e + 1] = i,
  41478. this.array[e + 2] = n,
  41479. this.array[e + 3] = r,
  41480. this
  41481. },
  41482. clone: function() {
  41483. return (new this.constructor).copy(this)
  41484. }
  41485. },
  41486. Ci.Int8Attribute = function(e, t) {
  41487. return new Ci.BufferAttribute(new Int8Array(e),t)
  41488. }
  41489. ,
  41490. Ci.Uint8Attribute = function(e, t) {
  41491. return new Ci.BufferAttribute(new Uint8Array(e),t)
  41492. }
  41493. ,
  41494. Ci.Uint8ClampedAttribute = function(e, t) {
  41495. return new Ci.BufferAttribute(new Uint8ClampedArray(e),t)
  41496. }
  41497. ,
  41498. Ci.Int16Attribute = function(e, t) {
  41499. return new Ci.BufferAttribute(new Int16Array(e),t)
  41500. }
  41501. ,
  41502. Ci.Uint16Attribute = function(e, t) {
  41503. return new Ci.BufferAttribute(new Uint16Array(e),t)
  41504. }
  41505. ,
  41506. Ci.Int32Attribute = function(e, t) {
  41507. return new Ci.BufferAttribute(new Int32Array(e),t)
  41508. }
  41509. ,
  41510. Ci.Uint32Attribute = function(e, t) {
  41511. return new Ci.BufferAttribute(new Uint32Array(e),t)
  41512. }
  41513. ,
  41514. Ci.Float32Attribute = function(e, t) {
  41515. return new Ci.BufferAttribute(new Float32Array(e),t)
  41516. }
  41517. ,
  41518. Ci.Float64Attribute = function(e, t) {
  41519. return new Ci.BufferAttribute(new Float64Array(e),t)
  41520. }
  41521. ,
  41522. Ci.DynamicBufferAttribute = function(e, t) {
  41523. return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),
  41524. new Ci.BufferAttribute(e,t).setDynamic(!0)
  41525. }
  41526. ,
  41527. Ci.InstancedBufferAttribute = function(e, t, i) {
  41528. Ci.BufferAttribute.call(this, e, t),
  41529. this.meshPerAttribute = i || 1
  41530. }
  41531. ,
  41532. Ci.InstancedBufferAttribute.prototype = Object.create(Ci.BufferAttribute.prototype),
  41533. Ci.InstancedBufferAttribute.prototype.constructor = Ci.InstancedBufferAttribute,
  41534. Ci.InstancedBufferAttribute.prototype.copy = function(e) {
  41535. return Ci.BufferAttribute.prototype.copy.call(this, e),
  41536. this.meshPerAttribute = e.meshPerAttribute,
  41537. this
  41538. }
  41539. ,
  41540. Ci.InterleavedBuffer = function(e, t) {
  41541. this.uuid = Ci.Math.generateUUID(),
  41542. this.array = e,
  41543. this.stride = t,
  41544. this.dynamic = !1,
  41545. this.updateRange = {
  41546. offset: 0,
  41547. count: -1
  41548. },
  41549. this.version = 0
  41550. }
  41551. ,
  41552. Ci.InterleavedBuffer.prototype = {
  41553. constructor: Ci.InterleavedBuffer,
  41554. get length() {
  41555. return this.array.length
  41556. },
  41557. get count() {
  41558. return this.array.length / this.stride
  41559. },
  41560. set needsUpdate(e) {
  41561. !0 === e && this.version++
  41562. },
  41563. setDynamic: function(e) {
  41564. return this.dynamic = e,
  41565. this
  41566. },
  41567. copy: function(e) {
  41568. return this.array = new e.array.constructor(e.array),
  41569. this.stride = e.stride,
  41570. this.dynamic = e.dynamic,
  41571. this
  41572. },
  41573. copyAt: function(e, t, i) {
  41574. e *= this.stride,
  41575. i *= t.stride;
  41576. for (var n = 0, r = this.stride; n < r; n++)
  41577. this.array[e + n] = t.array[i + n];
  41578. return this
  41579. },
  41580. set: function(e, t) {
  41581. return void 0 === t && (t = 0),
  41582. this.array.set(e, t),
  41583. this
  41584. },
  41585. clone: function() {
  41586. return (new this.constructor).copy(this)
  41587. }
  41588. },
  41589. Ci.InstancedInterleavedBuffer = function(e, t, i) {
  41590. Ci.InterleavedBuffer.call(this, e, t),
  41591. this.meshPerAttribute = i || 1
  41592. }
  41593. ,
  41594. Ci.InstancedInterleavedBuffer.prototype = Object.create(Ci.InterleavedBuffer.prototype),
  41595. Ci.InstancedInterleavedBuffer.prototype.constructor = Ci.InstancedInterleavedBuffer,
  41596. Ci.InstancedInterleavedBuffer.prototype.copy = function(e) {
  41597. return Ci.InterleavedBuffer.prototype.copy.call(this, e),
  41598. this.meshPerAttribute = e.meshPerAttribute,
  41599. this
  41600. }
  41601. ,
  41602. Ci.InterleavedBufferAttribute = function(e, t, i) {
  41603. this.uuid = Ci.Math.generateUUID(),
  41604. this.data = e,
  41605. this.itemSize = t,
  41606. this.offset = i
  41607. }
  41608. ,
  41609. Ci.InterleavedBufferAttribute.prototype = {
  41610. constructor: Ci.InterleavedBufferAttribute,
  41611. get length() {
  41612. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  41613. this.array.length
  41614. },
  41615. get count() {
  41616. return this.data.count
  41617. },
  41618. setX: function(e, t) {
  41619. return this.data.array[e * this.data.stride + this.offset] = t,
  41620. this
  41621. },
  41622. setY: function(e, t) {
  41623. return this.data.array[e * this.data.stride + this.offset + 1] = t,
  41624. this
  41625. },
  41626. setZ: function(e, t) {
  41627. return this.data.array[e * this.data.stride + this.offset + 2] = t,
  41628. this
  41629. },
  41630. setW: function(e, t) {
  41631. return this.data.array[e * this.data.stride + this.offset + 3] = t,
  41632. this
  41633. },
  41634. getX: function(e) {
  41635. return this.data.array[e * this.data.stride + this.offset]
  41636. },
  41637. getY: function(e) {
  41638. return this.data.array[e * this.data.stride + this.offset + 1]
  41639. },
  41640. getZ: function(e) {
  41641. return this.data.array[e * this.data.stride + this.offset + 2]
  41642. },
  41643. getW: function(e) {
  41644. return this.data.array[e * this.data.stride + this.offset + 3]
  41645. },
  41646. setXY: function(e, t, i) {
  41647. return e = e * this.data.stride + this.offset,
  41648. this.data.array[e + 0] = t,
  41649. this.data.array[e + 1] = i,
  41650. this
  41651. },
  41652. setXYZ: function(e, t, i, n) {
  41653. return e = e * this.data.stride + this.offset,
  41654. this.data.array[e + 0] = t,
  41655. this.data.array[e + 1] = i,
  41656. this.data.array[e + 2] = n,
  41657. this
  41658. },
  41659. setXYZW: function(e, t, i, n, r) {
  41660. return e = e * this.data.stride + this.offset,
  41661. this.data.array[e + 0] = t,
  41662. this.data.array[e + 1] = i,
  41663. this.data.array[e + 2] = n,
  41664. this.data.array[e + 3] = r,
  41665. this
  41666. }
  41667. },
  41668. Ci.Geometry = function() {
  41669. Object.defineProperty(this, "id", {
  41670. value: Ci.GeometryIdCount++
  41671. }),
  41672. this.uuid = Ci.Math.generateUUID(),
  41673. this.name = "",
  41674. this.type = "Geometry",
  41675. this.vertices = [],
  41676. this.colors = [],
  41677. this.faces = [],
  41678. this.faceVertexUvs = [[]],
  41679. this.morphTargets = [],
  41680. this.morphNormals = [],
  41681. this.skinWeights = [],
  41682. this.skinIndices = [],
  41683. this.lineDistances = [],
  41684. this.boundingBox = null,
  41685. this.boundingSphere = null,
  41686. this.verticesNeedUpdate = !1,
  41687. this.elementsNeedUpdate = !1,
  41688. this.uvsNeedUpdate = !1,
  41689. this.normalsNeedUpdate = !1,
  41690. this.colorsNeedUpdate = !1,
  41691. this.lineDistancesNeedUpdate = !1,
  41692. this.groupsNeedUpdate = !1
  41693. }
  41694. ,
  41695. Ci.Geometry.prototype = {
  41696. constructor: Ci.Geometry,
  41697. applyMatrix: function(e) {
  41698. for (var t = (new Ci.Matrix3).getNormalMatrix(e), i = 0, n = this.vertices.length; i < n; i++) {
  41699. this.vertices[i].applyMatrix4(e)
  41700. }
  41701. for (i = 0,
  41702. n = this.faces.length; i < n; i++) {
  41703. var r = this.faces[i];
  41704. r.normal.applyMatrix3(t).normalize();
  41705. for (var o = 0, a = r.vertexNormals.length; o < a; o++)
  41706. r.vertexNormals[o].applyMatrix3(t).normalize()
  41707. }
  41708. return null !== this.boundingBox && this.computeBoundingBox(),
  41709. null !== this.boundingSphere && this.computeBoundingSphere(),
  41710. this.verticesNeedUpdate = !0,
  41711. this.normalsNeedUpdate = !0,
  41712. this
  41713. },
  41714. rotateX: function(e) {
  41715. return void 0 === mt && (mt = new Ci.Matrix4),
  41716. mt.makeRotationX(e),
  41717. this.applyMatrix(mt),
  41718. this
  41719. },
  41720. rotateY: function(e) {
  41721. return void 0 === gt && (gt = new Ci.Matrix4),
  41722. gt.makeRotationY(e),
  41723. this.applyMatrix(gt),
  41724. this
  41725. },
  41726. rotateZ: function(e) {
  41727. return void 0 === ft && (ft = new Ci.Matrix4),
  41728. ft.makeRotationZ(e),
  41729. this.applyMatrix(ft),
  41730. this
  41731. },
  41732. translate: function(e, t, i) {
  41733. return void 0 === pt && (pt = new Ci.Matrix4),
  41734. pt.makeTranslation(e, t, i),
  41735. this.applyMatrix(pt),
  41736. this
  41737. },
  41738. scale: function(e, t, i) {
  41739. return void 0 === dt && (dt = new Ci.Matrix4),
  41740. dt.makeScale(e, t, i),
  41741. this.applyMatrix(dt),
  41742. this
  41743. },
  41744. lookAt: function(e) {
  41745. void 0 === ut && (ut = new Ci.Object3D),
  41746. ut.lookAt(e),
  41747. ut.updateMatrix(),
  41748. this.applyMatrix(ut.matrix)
  41749. },
  41750. fromBufferGeometry: function(e) {
  41751. function t(e, t, i, n) {
  41752. var r = void 0 !== l ? [d[e].clone(), d[t].clone(), d[i].clone()] : []
  41753. , o = void 0 !== c ? [s.colors[e].clone(), s.colors[t].clone(), s.colors[i].clone()] : []
  41754. , a = new Ci.Face3(e,t,i,r,o,n);
  41755. s.faces.push(a),
  41756. void 0 !== h && s.faceVertexUvs[0].push([p[e].clone(), p[t].clone(), p[i].clone()]),
  41757. void 0 !== u && s.faceVertexUvs[1].push([f[e].clone(), f[t].clone(), f[i].clone()])
  41758. }
  41759. var s = this
  41760. , i = null !== e.index ? e.index.array : void 0
  41761. , n = e.attributes
  41762. , r = n.position.array
  41763. , l = void 0 !== n.normal ? n.normal.array : void 0
  41764. , c = void 0 !== n.color ? n.color.array : void 0
  41765. , h = void 0 !== n.uv ? n.uv.array : void 0
  41766. , u = void 0 !== n.uv2 ? n.uv2.array : void 0;
  41767. void 0 !== u && (this.faceVertexUvs[1] = []);
  41768. for (var d = [], p = [], f = [], o = 0, a = 0; o < r.length; o += 3,
  41769. a += 2)
  41770. s.vertices.push(new Ci.Vector3(r[o],r[o + 1],r[o + 2])),
  41771. void 0 !== l && d.push(new Ci.Vector3(l[o],l[o + 1],l[o + 2])),
  41772. void 0 !== c && s.colors.push(new Ci.Color(c[o],c[o + 1],c[o + 2])),
  41773. void 0 !== h && p.push(new Ci.Vector2(h[a],h[a + 1])),
  41774. void 0 !== u && f.push(new Ci.Vector2(u[a],u[a + 1]));
  41775. if (void 0 !== i) {
  41776. var g = e.groups;
  41777. if (0 < g.length)
  41778. for (o = 0; o < g.length; o++)
  41779. for (var m = g[o], v = m.start, y = (a = v,
  41780. v + m.count); a < y; a += 3)
  41781. t(i[a], i[a + 1], i[a + 2], m.materialIndex);
  41782. else
  41783. for (o = 0; o < i.length; o += 3)
  41784. t(i[o], i[o + 1], i[o + 2])
  41785. } else
  41786. for (o = 0; o < r.length / 3; o += 3)
  41787. t(o, o + 1, o + 2);
  41788. return this.computeFaceNormals(),
  41789. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  41790. null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  41791. this
  41792. },
  41793. center: function() {
  41794. this.computeBoundingBox();
  41795. var e = this.boundingBox.center().negate();
  41796. return this.translate(e.x, e.y, e.z),
  41797. e
  41798. },
  41799. normalize: function() {
  41800. this.computeBoundingSphere();
  41801. var e = this.boundingSphere.center
  41802. , t = this.boundingSphere.radius
  41803. , i = 0 === t ? 1 : 1 / t
  41804. , n = new Ci.Matrix4;
  41805. 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),
  41806. this.applyMatrix(n),
  41807. this
  41808. },
  41809. computeFaceNormals: function() {
  41810. for (var e = new Ci.Vector3, t = new Ci.Vector3, i = 0, n = this.faces.length; i < n; i++) {
  41811. var r = this.faces[i]
  41812. , o = this.vertices[r.a]
  41813. , a = this.vertices[r.b]
  41814. , s = this.vertices[r.c];
  41815. e.subVectors(s, a),
  41816. t.subVectors(o, a),
  41817. e.cross(t),
  41818. e.normalize(),
  41819. r.normal.copy(e)
  41820. }
  41821. },
  41822. computeVertexNormals: function(e) {
  41823. var t, i, n, r, o, a;
  41824. for (void 0 === e && (e = !0),
  41825. a = new Array(this.vertices.length),
  41826. t = 0,
  41827. i = this.vertices.length; t < i; t++)
  41828. a[t] = new Ci.Vector3;
  41829. if (e) {
  41830. var s, l, c, h = new Ci.Vector3, u = new Ci.Vector3;
  41831. for (n = 0,
  41832. r = this.faces.length; n < r; n++)
  41833. o = this.faces[n],
  41834. s = this.vertices[o.a],
  41835. l = this.vertices[o.b],
  41836. c = this.vertices[o.c],
  41837. h.subVectors(c, l),
  41838. u.subVectors(s, l),
  41839. h.cross(u),
  41840. a[o.a].add(h),
  41841. a[o.b].add(h),
  41842. a[o.c].add(h)
  41843. } else
  41844. for (n = 0,
  41845. r = this.faces.length; n < r; n++)
  41846. a[(o = this.faces[n]).a].add(o.normal),
  41847. a[o.b].add(o.normal),
  41848. a[o.c].add(o.normal);
  41849. for (t = 0,
  41850. i = this.vertices.length; t < i; t++)
  41851. a[t].normalize();
  41852. for (n = 0,
  41853. r = this.faces.length; n < r; n++) {
  41854. var d = (o = this.faces[n]).vertexNormals;
  41855. 3 === d.length ? (d[0].copy(a[o.a]),
  41856. d[1].copy(a[o.b]),
  41857. d[2].copy(a[o.c])) : (d[0] = a[o.a].clone(),
  41858. d[1] = a[o.b].clone(),
  41859. d[2] = a[o.c].clone())
  41860. }
  41861. 0 < this.faces.length && (this.normalsNeedUpdate = !0)
  41862. },
  41863. computeMorphNormals: function() {
  41864. var e, t, i, n, r;
  41865. for (i = 0,
  41866. n = this.faces.length; i < n; i++)
  41867. for ((r = this.faces[i]).__originalFaceNormal ? r.__originalFaceNormal.copy(r.normal) : r.__originalFaceNormal = r.normal.clone(),
  41868. r.__originalVertexNormals || (r.__originalVertexNormals = []),
  41869. e = 0,
  41870. t = r.vertexNormals.length; e < t; e++)
  41871. r.__originalVertexNormals[e] ? r.__originalVertexNormals[e].copy(r.vertexNormals[e]) : r.__originalVertexNormals[e] = r.vertexNormals[e].clone();
  41872. var o = new Ci.Geometry;
  41873. for (o.faces = this.faces,
  41874. e = 0,
  41875. t = this.morphTargets.length; e < t; e++) {
  41876. if (!this.morphNormals[e]) {
  41877. this.morphNormals[e] = {},
  41878. this.morphNormals[e].faceNormals = [],
  41879. this.morphNormals[e].vertexNormals = [];
  41880. var a = this.morphNormals[e].faceNormals
  41881. , s = this.morphNormals[e].vertexNormals;
  41882. for (i = 0,
  41883. n = this.faces.length; i < n; i++)
  41884. l = new Ci.Vector3,
  41885. c = {
  41886. a: new Ci.Vector3,
  41887. b: new Ci.Vector3,
  41888. c: new Ci.Vector3
  41889. },
  41890. a.push(l),
  41891. s.push(c)
  41892. }
  41893. var l, c, h = this.morphNormals[e];
  41894. for (o.vertices = this.morphTargets[e].vertices,
  41895. o.computeFaceNormals(),
  41896. o.computeVertexNormals(),
  41897. i = 0,
  41898. n = this.faces.length; i < n; i++)
  41899. r = this.faces[i],
  41900. l = h.faceNormals[i],
  41901. c = h.vertexNormals[i],
  41902. l.copy(r.normal),
  41903. c.a.copy(r.vertexNormals[0]),
  41904. c.b.copy(r.vertexNormals[1]),
  41905. c.c.copy(r.vertexNormals[2])
  41906. }
  41907. for (i = 0,
  41908. n = this.faces.length; i < n; i++)
  41909. (r = this.faces[i]).normal = r.__originalFaceNormal,
  41910. r.vertexNormals = r.__originalVertexNormals
  41911. },
  41912. computeTangents: function() {
  41913. console.warn("THREE.Geometry: .computeTangents() has been removed.")
  41914. },
  41915. computeLineDistances: function() {
  41916. for (var e = 0, t = this.vertices, i = 0, n = t.length; i < n; i++)
  41917. 0 < i && (e += t[i].distanceTo(t[i - 1])),
  41918. this.lineDistances[i] = e
  41919. },
  41920. computeBoundingBox: function() {
  41921. null === this.boundingBox && (this.boundingBox = new Ci.Box3),
  41922. this.boundingBox.setFromPoints(this.vertices)
  41923. },
  41924. computeBoundingSphere: function() {
  41925. null === this.boundingSphere && (this.boundingSphere = new Ci.Sphere),
  41926. this.boundingSphere.setFromPoints(this.vertices)
  41927. },
  41928. merge: function(e, t, i) {
  41929. if (e instanceof Ci.Geometry != 0) {
  41930. 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];
  41931. void 0 === i && (i = 0),
  41932. void 0 !== t && (n = (new Ci.Matrix3).getNormalMatrix(t));
  41933. for (var u = 0, d = a.length; u < d; u++) {
  41934. var p = a[u].clone();
  41935. void 0 !== t && p.applyMatrix4(t),
  41936. o.push(p)
  41937. }
  41938. for (u = 0,
  41939. d = l.length; u < d; u++) {
  41940. var f, g, m, v = l[u], y = v.vertexNormals, A = v.vertexColors;
  41941. (f = new Ci.Face3(v.a + r,v.b + r,v.c + r)).normal.copy(v.normal),
  41942. void 0 !== n && f.normal.applyMatrix3(n).normalize();
  41943. for (var C = 0, I = y.length; C < I; C++)
  41944. g = y[C].clone(),
  41945. void 0 !== n && g.applyMatrix3(n).normalize(),
  41946. f.vertexNormals.push(g);
  41947. f.color.copy(v.color);
  41948. for (C = 0,
  41949. I = A.length; C < I; C++)
  41950. m = A[C],
  41951. f.vertexColors.push(m.clone());
  41952. f.materialIndex = v.materialIndex + i,
  41953. s.push(f)
  41954. }
  41955. for (u = 0,
  41956. d = h.length; u < d; u++) {
  41957. var E = h[u]
  41958. , _ = [];
  41959. if (void 0 !== E) {
  41960. for (C = 0,
  41961. I = E.length; C < I; C++)
  41962. _.push(E[C].clone());
  41963. c.push(_)
  41964. }
  41965. }
  41966. } else
  41967. console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.", e)
  41968. },
  41969. mergeMesh: function(e) {
  41970. return e instanceof Ci.Mesh == 0 ? void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.", e) : (e.matrixAutoUpdate && e.updateMatrix(),
  41971. void this.merge(e.geometry, e.matrix))
  41972. },
  41973. mergeVertices: function() {
  41974. var e, t, i, n, r, o, a, s, l = {}, c = [], h = [], u = Math.pow(10, 4);
  41975. for (i = 0,
  41976. n = this.vertices.length; i < n; i++)
  41977. e = this.vertices[i],
  41978. void 0 === l[t = Math.round(e.x * u) + "_" + Math.round(e.y * u) + "_" + Math.round(e.z * u)] ? (l[t] = i,
  41979. c.push(this.vertices[i]),
  41980. h[i] = c.length - 1) : h[i] = h[l[t]];
  41981. var d = [];
  41982. for (i = 0,
  41983. n = this.faces.length; i < n; i++) {
  41984. (r = this.faces[i]).a = h[r.a],
  41985. r.b = h[r.b],
  41986. r.c = h[r.c],
  41987. o = [r.a, r.b, r.c];
  41988. for (var p = 0; p < 3; p++)
  41989. if (o[p] === o[(p + 1) % 3]) {
  41990. p,
  41991. d.push(i);
  41992. break
  41993. }
  41994. }
  41995. for (i = d.length - 1; 0 <= i; i--) {
  41996. var f = d[i];
  41997. for (this.faces.splice(f, 1),
  41998. a = 0,
  41999. s = this.faceVertexUvs.length; a < s; a++)
  42000. this.faceVertexUvs[a].splice(f, 1)
  42001. }
  42002. var g = this.vertices.length - c.length;
  42003. return this.vertices = c,
  42004. g
  42005. },
  42006. sortFacesByMaterialIndex: function() {
  42007. for (var e = this.faces, t = e.length, i = 0; i < t; i++)
  42008. e[i]._id = i;
  42009. e.sort(function(e, t) {
  42010. return e.materialIndex - t.materialIndex
  42011. });
  42012. var n, r, o = this.faceVertexUvs[0], a = this.faceVertexUvs[1];
  42013. o && o.length === t && (n = []),
  42014. a && a.length === t && (r = []);
  42015. for (i = 0; i < t; i++) {
  42016. var s = e[i]._id;
  42017. n && n.push(o[s]),
  42018. r && r.push(a[s])
  42019. }
  42020. n && (this.faceVertexUvs[0] = n),
  42021. r && (this.faceVertexUvs[1] = r)
  42022. },
  42023. toJSON: function() {
  42024. function e(e, t, i) {
  42025. return i ? e | 1 << t : e & ~(1 << t)
  42026. }
  42027. function t(e) {
  42028. var t = e.x.toString() + e.y.toString() + e.z.toString();
  42029. return void 0 !== d[t] || (d[t] = u.length / 3,
  42030. u.push(e.x, e.y, e.z)),
  42031. d[t]
  42032. }
  42033. function i(e) {
  42034. var t = e.r.toString() + e.g.toString() + e.b.toString();
  42035. return void 0 !== f[t] || (f[t] = p.length,
  42036. p.push(e.getHex())),
  42037. f[t]
  42038. }
  42039. function n(e) {
  42040. var t = e.x.toString() + e.y.toString();
  42041. return void 0 !== m[t] || (m[t] = g.length / 2,
  42042. g.push(e.x, e.y)),
  42043. m[t]
  42044. }
  42045. var r = {
  42046. metadata: {
  42047. version: 4.4,
  42048. type: "Geometry",
  42049. generator: "Geometry.toJSON"
  42050. }
  42051. };
  42052. if (r.uuid = this.uuid,
  42053. r.type = this.type,
  42054. "" !== this.name && (r.name = this.name),
  42055. void 0 !== this.parameters) {
  42056. var o = this.parameters;
  42057. for (var a in o)
  42058. void 0 !== o[a] && (r[a] = o[a]);
  42059. return r
  42060. }
  42061. for (var s = [], l = 0; l < this.vertices.length; l++) {
  42062. var c = this.vertices[l];
  42063. s.push(c.x, c.y, c.z)
  42064. }
  42065. var h = []
  42066. , u = []
  42067. , d = {}
  42068. , p = []
  42069. , f = {}
  42070. , g = []
  42071. , m = {};
  42072. for (l = 0; l < this.faces.length; l++) {
  42073. var v = this.faces[l]
  42074. , y = void 0 !== this.faceVertexUvs[0][l]
  42075. , A = 0 < v.normal.length()
  42076. , C = 0 < v.vertexNormals.length
  42077. , I = 1 !== v.color.r || 1 !== v.color.g || 1 !== v.color.b
  42078. , E = 0 < v.vertexColors.length
  42079. , _ = 0;
  42080. 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),
  42081. h.push(_),
  42082. h.push(v.a, v.b, v.c),
  42083. h.push(v.materialIndex),
  42084. y) {
  42085. var b = this.faceVertexUvs[0][l];
  42086. h.push(n(b[0]), n(b[1]), n(b[2]))
  42087. }
  42088. if (A && h.push(t(v.normal)),
  42089. C) {
  42090. var w = v.vertexNormals;
  42091. h.push(t(w[0]), t(w[1]), t(w[2]))
  42092. }
  42093. if (I && h.push(i(v.color)),
  42094. E) {
  42095. var T = v.vertexColors;
  42096. h.push(i(T[0]), i(T[1]), i(T[2]))
  42097. }
  42098. }
  42099. return r.data = {},
  42100. r.data.vertices = s,
  42101. r.data.normals = u,
  42102. 0 < p.length && (r.data.colors = p),
  42103. 0 < g.length && (r.data.uvs = [g]),
  42104. r.data.faces = h,
  42105. r
  42106. },
  42107. clone: function() {
  42108. return (new Ci.Geometry).copy(this)
  42109. },
  42110. copy: function(e) {
  42111. this.vertices = [],
  42112. this.faces = [],
  42113. this.faceVertexUvs = [[]];
  42114. for (var t = e.vertices, i = 0, n = t.length; i < n; i++)
  42115. this.vertices.push(t[i].clone());
  42116. var r = e.faces;
  42117. for (i = 0,
  42118. n = r.length; i < n; i++)
  42119. this.faces.push(r[i].clone());
  42120. for (i = 0,
  42121. n = e.faceVertexUvs.length; i < n; i++) {
  42122. var o = e.faceVertexUvs[i];
  42123. void 0 === this.faceVertexUvs[i] && (this.faceVertexUvs[i] = []);
  42124. for (var a = 0, s = o.length; a < s; a++) {
  42125. for (var l = o[a], c = [], h = 0, u = l.length; h < u; h++) {
  42126. var d = l[h];
  42127. c.push(d.clone())
  42128. }
  42129. this.faceVertexUvs[i].push(c)
  42130. }
  42131. }
  42132. return this
  42133. },
  42134. dispose: function() {
  42135. this.dispatchEvent({
  42136. type: "dispose"
  42137. })
  42138. }
  42139. },
  42140. Ci.EventDispatcher.prototype.apply(Ci.Geometry.prototype),
  42141. Ci.GeometryIdCount = 0,
  42142. Ci.DirectGeometry = function() {
  42143. Object.defineProperty(this, "id", {
  42144. value: Ci.GeometryIdCount++
  42145. }),
  42146. this.uuid = Ci.Math.generateUUID(),
  42147. this.name = "",
  42148. this.type = "DirectGeometry",
  42149. this.indices = [],
  42150. this.vertices = [],
  42151. this.normals = [],
  42152. this.colors = [],
  42153. this.uvs = [],
  42154. this.uvs2 = [],
  42155. this.groups = [],
  42156. this.morphTargets = {},
  42157. this.skinWeights = [],
  42158. this.skinIndices = [],
  42159. this.boundingBox = null,
  42160. this.boundingSphere = null,
  42161. this.verticesNeedUpdate = !1,
  42162. this.normalsNeedUpdate = !1,
  42163. this.colorsNeedUpdate = !1,
  42164. this.uvsNeedUpdate = !1,
  42165. this.groupsNeedUpdate = !1
  42166. }
  42167. ,
  42168. Ci.DirectGeometry.prototype = {
  42169. constructor: Ci.DirectGeometry,
  42170. computeBoundingBox: Ci.Geometry.prototype.computeBoundingBox,
  42171. computeBoundingSphere: Ci.Geometry.prototype.computeBoundingSphere,
  42172. computeFaceNormals: function() {
  42173. console.warn("THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.")
  42174. },
  42175. computeVertexNormals: function() {
  42176. console.warn("THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.")
  42177. },
  42178. computeGroups: function(e) {
  42179. for (var t, i, n = [], r = e.faces, o = 0; o < r.length; o++) {
  42180. var a = r[o];
  42181. a.materialIndex !== i && (i = a.materialIndex,
  42182. void 0 !== t && (t.count = 3 * o - t.start,
  42183. n.push(t)),
  42184. t = {
  42185. start: 3 * o,
  42186. materialIndex: i
  42187. })
  42188. }
  42189. void 0 !== t && (t.count = 3 * o - t.start,
  42190. n.push(t)),
  42191. this.groups = n
  42192. },
  42193. fromGeometry: function(e) {
  42194. 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;
  42195. if (0 < l) {
  42196. t = [];
  42197. for (var c = 0; c < l; c++)
  42198. t[c] = [];
  42199. this.morphTargets.position = t
  42200. }
  42201. var h, u = e.morphNormals, d = u.length;
  42202. if (0 < d) {
  42203. h = [];
  42204. for (c = 0; c < d; c++)
  42205. h[c] = [];
  42206. this.morphTargets.normal = h
  42207. }
  42208. var p = e.skinIndices
  42209. , f = e.skinWeights
  42210. , g = p.length === n.length
  42211. , m = f.length === n.length;
  42212. for (c = 0; c < i.length; c++) {
  42213. var v = i[c];
  42214. this.vertices.push(n[v.a], n[v.b], n[v.c]);
  42215. var y = v.vertexNormals;
  42216. if (3 === y.length)
  42217. this.normals.push(y[0], y[1], y[2]);
  42218. else {
  42219. var A = v.normal;
  42220. this.normals.push(A, A, A)
  42221. }
  42222. var C, I = v.vertexColors;
  42223. if (3 === I.length)
  42224. this.colors.push(I[0], I[1], I[2]);
  42225. else {
  42226. var E = v.color;
  42227. this.colors.push(E, E, E)
  42228. }
  42229. if (!0 === o)
  42230. void 0 !== (C = r[0][c]) ? this.uvs.push(C[0], C[1], C[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ", c),
  42231. this.uvs.push(new Ci.Vector2, new Ci.Vector2, new Ci.Vector2));
  42232. if (!0 === a)
  42233. void 0 !== (C = r[1][c]) ? this.uvs2.push(C[0], C[1], C[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ", c),
  42234. this.uvs2.push(new Ci.Vector2, new Ci.Vector2, new Ci.Vector2));
  42235. for (var _ = 0; _ < l; _++) {
  42236. var b = s[_].vertices;
  42237. t[_].push(b[v.a], b[v.b], b[v.c])
  42238. }
  42239. for (_ = 0; _ < d; _++) {
  42240. var w = u[_].vertexNormals[c];
  42241. h[_].push(w.a, w.b, w.c)
  42242. }
  42243. g && this.skinIndices.push(p[v.a], p[v.b], p[v.c]),
  42244. m && this.skinWeights.push(f[v.a], f[v.b], f[v.c])
  42245. }
  42246. return this.computeGroups(e),
  42247. this.verticesNeedUpdate = e.verticesNeedUpdate,
  42248. this.normalsNeedUpdate = e.normalsNeedUpdate,
  42249. this.colorsNeedUpdate = e.colorsNeedUpdate,
  42250. this.uvsNeedUpdate = e.uvsNeedUpdate,
  42251. this.groupsNeedUpdate = e.groupsNeedUpdate,
  42252. this
  42253. },
  42254. dispose: function() {
  42255. this.dispatchEvent({
  42256. type: "dispose"
  42257. })
  42258. }
  42259. },
  42260. Ci.EventDispatcher.prototype.apply(Ci.DirectGeometry.prototype),
  42261. Ci.BufferGeometry = function() {
  42262. Object.defineProperty(this, "id", {
  42263. value: Ci.GeometryIdCount++
  42264. }),
  42265. this.uuid = Ci.Math.generateUUID(),
  42266. this.name = "",
  42267. this.type = "BufferGeometry",
  42268. this.index = null,
  42269. this.attributes = {},
  42270. this.morphAttributes = {},
  42271. this.groups = [],
  42272. this.boundingBox = null,
  42273. this.boundingSphere = null,
  42274. this.drawRange = {
  42275. start: 0,
  42276. count: 1 / 0
  42277. }
  42278. }
  42279. ,
  42280. Ci.BufferGeometry.prototype = {
  42281. constructor: Ci.BufferGeometry,
  42282. getIndex: function() {
  42283. return this.index
  42284. },
  42285. setIndex: function(e) {
  42286. this.index = e
  42287. },
  42288. addAttribute: function(e, t) {
  42289. return t instanceof Ci.BufferAttribute == 0 && t instanceof Ci.InterleavedBufferAttribute == 0 ? (console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),
  42290. void this.addAttribute(e, new Ci.BufferAttribute(t,arguments[2]))) : "index" === e ? (console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),
  42291. void this.setIndex(t)) : (this.attributes[e] = t,
  42292. this)
  42293. },
  42294. getAttribute: function(e) {
  42295. return this.attributes[e]
  42296. },
  42297. removeAttribute: function(e) {
  42298. return delete this.attributes[e],
  42299. this
  42300. },
  42301. addGroup: function(e, t, i) {
  42302. this.groups.push({
  42303. start: e,
  42304. count: t,
  42305. materialIndex: void 0 !== i ? i : 0
  42306. })
  42307. },
  42308. clearGroups: function() {
  42309. this.groups = []
  42310. },
  42311. setDrawRange: function(e, t) {
  42312. this.drawRange.start = e,
  42313. this.drawRange.count = t
  42314. },
  42315. applyMatrix: function(e) {
  42316. var t = this.attributes.position;
  42317. void 0 !== t && (e.applyToVector3Array(t.array),
  42318. t.needsUpdate = !0);
  42319. var i = this.attributes.normal;
  42320. void 0 !== i && ((new Ci.Matrix3).getNormalMatrix(e).applyToVector3Array(i.array),
  42321. i.needsUpdate = !0);
  42322. return null !== this.boundingBox && this.computeBoundingBox(),
  42323. null !== this.boundingSphere && this.computeBoundingSphere(),
  42324. this
  42325. },
  42326. rotateX: function(e) {
  42327. return void 0 === ht && (ht = new Ci.Matrix4),
  42328. ht.makeRotationX(e),
  42329. this.applyMatrix(ht),
  42330. this
  42331. },
  42332. rotateY: function(e) {
  42333. return void 0 === ct && (ct = new Ci.Matrix4),
  42334. ct.makeRotationY(e),
  42335. this.applyMatrix(ct),
  42336. this
  42337. },
  42338. rotateZ: function(e) {
  42339. return void 0 === lt && (lt = new Ci.Matrix4),
  42340. lt.makeRotationZ(e),
  42341. this.applyMatrix(lt),
  42342. this
  42343. },
  42344. translate: function(e, t, i) {
  42345. return void 0 === st && (st = new Ci.Matrix4),
  42346. st.makeTranslation(e, t, i),
  42347. this.applyMatrix(st),
  42348. this
  42349. },
  42350. scale: function(e, t, i) {
  42351. return void 0 === at && (at = new Ci.Matrix4),
  42352. at.makeScale(e, t, i),
  42353. this.applyMatrix(at),
  42354. this
  42355. },
  42356. lookAt: function(e) {
  42357. void 0 === ot && (ot = new Ci.Object3D),
  42358. ot.lookAt(e),
  42359. ot.updateMatrix(),
  42360. this.applyMatrix(ot.matrix)
  42361. },
  42362. center: function() {
  42363. this.computeBoundingBox();
  42364. var e = this.boundingBox.center().negate();
  42365. return this.translate(e.x, e.y, e.z),
  42366. e
  42367. },
  42368. setFromObject: function(e) {
  42369. var t = e.geometry;
  42370. if (e instanceof Ci.Points || e instanceof Ci.Line) {
  42371. var i = new Ci.Float32Attribute(3 * t.vertices.length,3)
  42372. , n = new Ci.Float32Attribute(3 * t.colors.length,3);
  42373. if (this.addAttribute("position", i.copyVector3sArray(t.vertices)),
  42374. this.addAttribute("color", n.copyColorsArray(t.colors)),
  42375. t.lineDistances && t.lineDistances.length === t.vertices.length) {
  42376. var r = new Ci.Float32Attribute(t.lineDistances.length,1);
  42377. this.addAttribute("lineDistance", r.copyArray(t.lineDistances))
  42378. }
  42379. null !== t.boundingSphere && (this.boundingSphere = t.boundingSphere.clone()),
  42380. null !== t.boundingBox && (this.boundingBox = t.boundingBox.clone())
  42381. } else
  42382. e instanceof Ci.Mesh && t instanceof Ci.Geometry && this.fromGeometry(t);
  42383. return this
  42384. },
  42385. updateFromObject: function(e) {
  42386. var t, i = e.geometry;
  42387. if (e instanceof Ci.Mesh) {
  42388. var n = i.__directGeometry;
  42389. if (void 0 === n)
  42390. return this.fromGeometry(i);
  42391. n.verticesNeedUpdate = i.verticesNeedUpdate,
  42392. n.normalsNeedUpdate = i.normalsNeedUpdate,
  42393. n.colorsNeedUpdate = i.colorsNeedUpdate,
  42394. n.uvsNeedUpdate = i.uvsNeedUpdate,
  42395. n.groupsNeedUpdate = i.groupsNeedUpdate,
  42396. i.verticesNeedUpdate = !1,
  42397. i.normalsNeedUpdate = !1,
  42398. i.colorsNeedUpdate = !1,
  42399. i.uvsNeedUpdate = !1,
  42400. i.groupsNeedUpdate = !1,
  42401. i = n
  42402. }
  42403. !0 === i.verticesNeedUpdate && (void 0 !== (t = this.attributes.position) && (t.copyVector3sArray(i.vertices),
  42404. t.needsUpdate = !0),
  42405. i.verticesNeedUpdate = !1);
  42406. !0 === i.normalsNeedUpdate && (void 0 !== (t = this.attributes.normal) && (t.copyVector3sArray(i.normals),
  42407. t.needsUpdate = !0),
  42408. i.normalsNeedUpdate = !1);
  42409. !0 === i.colorsNeedUpdate && (void 0 !== (t = this.attributes.color) && (t.copyColorsArray(i.colors),
  42410. t.needsUpdate = !0),
  42411. i.colorsNeedUpdate = !1);
  42412. i.uvsNeedUpdate && (void 0 !== (t = this.attributes.uv) && (t.copyVector2sArray(i.uvs),
  42413. t.needsUpdate = !0),
  42414. i.uvsNeedUpdate = !1);
  42415. i.lineDistancesNeedUpdate && (void 0 !== (t = this.attributes.lineDistance) && (t.copyArray(i.lineDistances),
  42416. t.needsUpdate = !0),
  42417. i.lineDistancesNeedUpdate = !1);
  42418. return i.groupsNeedUpdate && (i.computeGroups(e.geometry),
  42419. this.groups = i.groups,
  42420. i.groupsNeedUpdate = !1),
  42421. this
  42422. },
  42423. fromGeometry: function(e) {
  42424. return e.__directGeometry = (new Ci.DirectGeometry).fromGeometry(e),
  42425. this.fromDirectGeometry(e.__directGeometry)
  42426. },
  42427. fromDirectGeometry: function(e) {
  42428. var t = new Float32Array(3 * e.vertices.length);
  42429. if (this.addAttribute("position", new Ci.BufferAttribute(t,3).copyVector3sArray(e.vertices)),
  42430. 0 < e.normals.length) {
  42431. var i = new Float32Array(3 * e.normals.length);
  42432. this.addAttribute("normal", new Ci.BufferAttribute(i,3).copyVector3sArray(e.normals))
  42433. }
  42434. if (0 < e.colors.length) {
  42435. var n = new Float32Array(3 * e.colors.length);
  42436. this.addAttribute("color", new Ci.BufferAttribute(n,3).copyColorsArray(e.colors))
  42437. }
  42438. if (0 < e.uvs.length) {
  42439. var r = new Float32Array(2 * e.uvs.length);
  42440. this.addAttribute("uv", new Ci.BufferAttribute(r,2).copyVector2sArray(e.uvs))
  42441. }
  42442. if (0 < e.uvs2.length) {
  42443. var o = new Float32Array(2 * e.uvs2.length);
  42444. this.addAttribute("uv2", new Ci.BufferAttribute(o,2).copyVector2sArray(e.uvs2))
  42445. }
  42446. if (0 < e.indices.length) {
  42447. var a = new (65535 < e.vertices.length ? Uint32Array : Uint16Array)(3 * e.indices.length);
  42448. this.setIndex(new Ci.BufferAttribute(a,1).copyIndicesArray(e.indices))
  42449. }
  42450. for (var s in this.groups = e.groups,
  42451. e.morphTargets) {
  42452. for (var l = [], c = e.morphTargets[s], h = 0, u = c.length; h < u; h++) {
  42453. var d = c[h]
  42454. , p = new Ci.Float32Attribute(3 * d.length,3);
  42455. l.push(p.copyVector3sArray(d))
  42456. }
  42457. this.morphAttributes[s] = l
  42458. }
  42459. if (0 < e.skinIndices.length) {
  42460. var f = new Ci.Float32Attribute(4 * e.skinIndices.length,4);
  42461. this.addAttribute("skinIndex", f.copyVector4sArray(e.skinIndices))
  42462. }
  42463. if (0 < e.skinWeights.length) {
  42464. var g = new Ci.Float32Attribute(4 * e.skinWeights.length,4);
  42465. this.addAttribute("skinWeight", g.copyVector4sArray(e.skinWeights))
  42466. }
  42467. return null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  42468. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  42469. this
  42470. },
  42471. computeBoundingBox: (new Ci.Vector3,
  42472. function() {
  42473. null === this.boundingBox && (this.boundingBox = new Ci.Box3);
  42474. var e = this.attributes.position.array;
  42475. e && this.boundingBox.setFromArray(e),
  42476. void 0 !== e && 0 !== e.length || (this.boundingBox.min.set(0, 0, 0),
  42477. this.boundingBox.max.set(0, 0, 0)),
  42478. (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)
  42479. }
  42480. ),
  42481. computeBoundingSphere: (nt = new Ci.Box3,
  42482. rt = new Ci.Vector3,
  42483. function() {
  42484. null === this.boundingSphere && (this.boundingSphere = new Ci.Sphere);
  42485. var e = this.attributes.position.array;
  42486. if (e) {
  42487. var t = this.boundingSphere.center;
  42488. nt.setFromArray(e),
  42489. nt.center(t);
  42490. for (var i = 0, n = 0, r = e.length; n < r; n += 3)
  42491. rt.fromArray(e, n),
  42492. i = Math.max(i, t.distanceToSquared(rt));
  42493. this.boundingSphere.radius = Math.sqrt(i),
  42494. isNaN(this.boundingSphere.radius) && console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this)
  42495. }
  42496. }
  42497. ),
  42498. computeFaceNormals: function() {},
  42499. computeVertexNormals: function() {
  42500. var e = this.index
  42501. , t = this.attributes
  42502. , i = this.groups;
  42503. if (t.position) {
  42504. var n = t.position.array;
  42505. if (void 0 === t.normal)
  42506. this.addAttribute("normal", new Ci.BufferAttribute(new Float32Array(n.length),3));
  42507. else
  42508. for (var r = t.normal.array, o = 0, a = r.length; o < a; o++)
  42509. r[o] = 0;
  42510. 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;
  42511. if (e) {
  42512. var m = e.array;
  42513. 0 === i.length && this.addGroup(0, m.length);
  42514. for (var v = 0, y = i.length; v < y; ++v) {
  42515. var A = i[v]
  42516. , C = A.start;
  42517. for (o = C,
  42518. a = C + A.count; o < a; o += 3)
  42519. s = 3 * m[o + 0],
  42520. l = 3 * m[o + 1],
  42521. c = 3 * m[o + 2],
  42522. u.fromArray(n, s),
  42523. d.fromArray(n, l),
  42524. p.fromArray(n, c),
  42525. f.subVectors(p, d),
  42526. g.subVectors(u, d),
  42527. f.cross(g),
  42528. h[s] += f.x,
  42529. h[1 + s] += f.y,
  42530. h[2 + s] += f.z,
  42531. h[l] += f.x,
  42532. h[1 + l] += f.y,
  42533. h[2 + l] += f.z,
  42534. h[c] += f.x,
  42535. h[1 + c] += f.y,
  42536. h[2 + c] += f.z
  42537. }
  42538. } else
  42539. for (o = 0,
  42540. a = n.length; o < a; o += 9)
  42541. u.fromArray(n, o),
  42542. d.fromArray(n, o + 3),
  42543. p.fromArray(n, o + 6),
  42544. f.subVectors(p, d),
  42545. g.subVectors(u, d),
  42546. f.cross(g),
  42547. h[o] = f.x,
  42548. h[o + 1] = f.y,
  42549. h[o + 2] = f.z,
  42550. h[o + 3] = f.x,
  42551. h[o + 4] = f.y,
  42552. h[o + 5] = f.z,
  42553. h[o + 6] = f.x,
  42554. h[o + 7] = f.y,
  42555. h[o + 8] = f.z;
  42556. this.normalizeNormals(),
  42557. t.normal.needsUpdate = !0
  42558. }
  42559. },
  42560. merge: function(e, t) {
  42561. if (e instanceof Ci.BufferGeometry != 0) {
  42562. void 0 === t && (t = 0);
  42563. var i = this.attributes;
  42564. for (var n in i)
  42565. if (void 0 !== e.attributes[n])
  42566. for (var r = i[n].array, o = e.attributes[n], a = o.array, s = 0, l = o.itemSize * t; s < a.length; s++,
  42567. l++)
  42568. r[l] = a[s];
  42569. return this
  42570. }
  42571. console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.", e)
  42572. },
  42573. normalizeNormals: function() {
  42574. for (var e, t, i, n, r = this.attributes.normal.array, o = 0, a = r.length; o < a; o += 3)
  42575. e = r[o],
  42576. t = r[o + 1],
  42577. i = r[o + 2],
  42578. n = 1 / Math.sqrt(e * e + t * t + i * i),
  42579. r[o] *= n,
  42580. r[o + 1] *= n,
  42581. r[o + 2] *= n
  42582. },
  42583. toNonIndexed: function() {
  42584. if (null === this.index)
  42585. return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),
  42586. this;
  42587. var e = new Ci.BufferGeometry
  42588. , t = this.index.array
  42589. , i = this.attributes;
  42590. for (var n in i) {
  42591. 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++) {
  42592. l = t[h] * a;
  42593. for (var d = 0; d < a; d++)
  42594. s[c++] = o[l++]
  42595. }
  42596. e.addAttribute(n, new Ci.BufferAttribute(s,a))
  42597. }
  42598. return e
  42599. },
  42600. toJSON: function() {
  42601. var e = {
  42602. metadata: {
  42603. version: 4.4,
  42604. type: "BufferGeometry",
  42605. generator: "BufferGeometry.toJSON"
  42606. }
  42607. };
  42608. if (e.uuid = this.uuid,
  42609. e.type = this.type,
  42610. "" !== this.name && (e.name = this.name),
  42611. void 0 !== this.parameters) {
  42612. var t = this.parameters;
  42613. for (var i in t)
  42614. void 0 !== t[i] && (e[i] = t[i]);
  42615. return e
  42616. }
  42617. e.data = {
  42618. attributes: {}
  42619. };
  42620. var n = this.index;
  42621. if (null !== n) {
  42622. var r = Array.prototype.slice.call(n.array);
  42623. e.data.index = {
  42624. type: n.array.constructor.name,
  42625. array: r
  42626. }
  42627. }
  42628. var o = this.attributes;
  42629. for (var i in o) {
  42630. var a = o[i];
  42631. r = Array.prototype.slice.call(a.array);
  42632. e.data.attributes[i] = {
  42633. itemSize: a.itemSize,
  42634. type: a.array.constructor.name,
  42635. array: r
  42636. }
  42637. }
  42638. var s = this.groups;
  42639. 0 < s.length && (e.data.groups = JSON.parse(JSON.stringify(s)));
  42640. var l = this.boundingSphere;
  42641. return null !== l && (e.data.boundingSphere = {
  42642. center: l.center.toArray(),
  42643. radius: l.radius
  42644. }),
  42645. e
  42646. },
  42647. clone: function() {
  42648. return (new Ci.BufferGeometry).copy(this)
  42649. },
  42650. copy: function(e) {
  42651. var t = e.index;
  42652. null !== t && this.setIndex(t.clone());
  42653. var i = e.attributes;
  42654. for (var n in i) {
  42655. var r = i[n];
  42656. this.addAttribute(n, r.clone())
  42657. }
  42658. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  42659. var l = o[a];
  42660. this.addGroup(l.start, l.count)
  42661. }
  42662. return this
  42663. },
  42664. dispose: function() {
  42665. this.dispatchEvent({
  42666. type: "dispose"
  42667. })
  42668. }
  42669. },
  42670. Ci.EventDispatcher.prototype.apply(Ci.BufferGeometry.prototype),
  42671. Ci.BufferGeometry.MaxIndex = 65535,
  42672. Ci.InstancedBufferGeometry = function() {
  42673. Ci.BufferGeometry.call(this),
  42674. this.type = "InstancedBufferGeometry",
  42675. this.maxInstancedCount = void 0
  42676. }
  42677. ,
  42678. Ci.InstancedBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  42679. Ci.InstancedBufferGeometry.prototype.constructor = Ci.InstancedBufferGeometry,
  42680. Ci.InstancedBufferGeometry.prototype.addGroup = function(e, t, i) {
  42681. this.groups.push({
  42682. start: e,
  42683. count: t,
  42684. instances: i
  42685. })
  42686. }
  42687. ,
  42688. Ci.InstancedBufferGeometry.prototype.copy = function(e) {
  42689. var t = e.index;
  42690. null !== t && this.setIndex(t.clone());
  42691. var i = e.attributes;
  42692. for (var n in i) {
  42693. var r = i[n];
  42694. this.addAttribute(n, r.clone())
  42695. }
  42696. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  42697. var l = o[a];
  42698. this.addGroup(l.start, l.count, l.instances)
  42699. }
  42700. return this
  42701. }
  42702. ,
  42703. Ci.EventDispatcher.prototype.apply(Ci.InstancedBufferGeometry.prototype),
  42704. Ci.Uniform = function(e, t) {
  42705. this.type = e,
  42706. this.value = t,
  42707. this.dynamic = !1
  42708. }
  42709. ,
  42710. Ci.Uniform.prototype = {
  42711. constructor: Ci.Uniform,
  42712. onUpdate: function(e) {
  42713. return this.dynamic = !0,
  42714. this.onUpdateCallback = e,
  42715. this
  42716. }
  42717. },
  42718. Ci.AnimationClip = function(e, t, i) {
  42719. this.name = e || Ci.Math.generateUUID(),
  42720. this.tracks = i,
  42721. this.duration = void 0 !== t ? t : -1,
  42722. this.duration < 0 && this.resetDuration(),
  42723. this.trim(),
  42724. this.optimize()
  42725. }
  42726. ,
  42727. Ci.AnimationClip.prototype = {
  42728. constructor: Ci.AnimationClip,
  42729. resetDuration: function() {
  42730. for (var e = 0, t = 0, i = this.tracks.length; t !== i; ++t) {
  42731. var n = this.tracks[t];
  42732. e = Math.max(e, n.times[n.times.length - 1])
  42733. }
  42734. this.duration = e
  42735. },
  42736. trim: function() {
  42737. for (var e = 0; e < this.tracks.length; e++)
  42738. this.tracks[e].trim(0, this.duration);
  42739. return this
  42740. },
  42741. optimize: function() {
  42742. for (var e = 0; e < this.tracks.length; e++)
  42743. this.tracks[e].optimize();
  42744. return this
  42745. }
  42746. },
  42747. Object.assign(Ci.AnimationClip, {
  42748. parse: function(e) {
  42749. for (var t = [], i = e.tracks, n = 1 / (e.fps || 1), r = 0, o = i.length; r !== o; ++r)
  42750. t.push(Ci.KeyframeTrack.parse(i[r]).scale(n));
  42751. return new Ci.AnimationClip(e.name,e.duration,t)
  42752. },
  42753. toJSON: function(e) {
  42754. for (var t = [], i = e.tracks, n = {
  42755. name: e.name,
  42756. duration: e.duration,
  42757. tracks: t
  42758. }, r = 0, o = i.length; r !== o; ++r)
  42759. t.push(Ci.KeyframeTrack.toJSON(i[r]));
  42760. return n
  42761. },
  42762. CreateFromMorphTargetSequence: function(e, t, i) {
  42763. for (var n = t.length, r = [], o = 0; o < n; o++) {
  42764. var a = []
  42765. , s = [];
  42766. a.push((o + n - 1) % n, o, (o + 1) % n),
  42767. s.push(0, 1, 0);
  42768. var l = Ci.AnimationUtils.getKeyframeOrder(a);
  42769. a = Ci.AnimationUtils.sortedArray(a, 1, l),
  42770. s = Ci.AnimationUtils.sortedArray(s, 1, l),
  42771. 0 === a[0] && (a.push(n),
  42772. s.push(s[0])),
  42773. r.push(new Ci.NumberKeyframeTrack(".morphTargetInfluences[" + t[o].name + "]",a,s).scale(1 / i))
  42774. }
  42775. return new Ci.AnimationClip(e,-1,r)
  42776. },
  42777. findByName: function(e, t) {
  42778. for (var i = 0; i < e.length; i++)
  42779. if (e[i].name === t)
  42780. return e[i];
  42781. return null
  42782. },
  42783. CreateClipsFromMorphTargetSequences: function(e, t) {
  42784. for (var i = {}, n = /^([\w-]*?)([\d]+)$/, r = 0, o = e.length; r < o; r++) {
  42785. var a = e[r]
  42786. , s = a.name.match(n);
  42787. if (s && 1 < s.length) {
  42788. var l = i[h = s[1]];
  42789. l || (i[h] = l = []),
  42790. l.push(a)
  42791. }
  42792. }
  42793. var c = [];
  42794. for (var h in i)
  42795. c.push(Ci.AnimationClip.CreateFromMorphTargetSequence(h, i[h], t));
  42796. return c
  42797. },
  42798. parseAnimation: function(e, t, i) {
  42799. if (!e)
  42800. return console.error(" no animation in JSONLoader data"),
  42801. null;
  42802. function n(e, t, i, n, r) {
  42803. if (0 !== i.length) {
  42804. var o = []
  42805. , a = [];
  42806. Ci.AnimationUtils.flattenJSON(i, o, a, n),
  42807. 0 !== o.length && r.push(new e(t,o,a))
  42808. }
  42809. }
  42810. for (var r = [], o = e.name || "default", a = e.length || -1, s = e.fps || 30, l = e.hierarchy || [], c = 0; c < l.length; c++) {
  42811. var h = l[c].keys;
  42812. if (h && 0 != h.length)
  42813. if (h[0].morphTargets) {
  42814. for (var u = {}, d = 0; d < h.length; d++)
  42815. if (h[d].morphTargets)
  42816. for (var p = 0; p < h[d].morphTargets.length; p++)
  42817. u[h[d].morphTargets[p]] = -1;
  42818. for (var f in u) {
  42819. var g = []
  42820. , m = [];
  42821. for (p = 0; p !== h[d].morphTargets.length; ++p) {
  42822. var v = h[d];
  42823. g.push(v.time),
  42824. m.push(v.morphTarget === f ? 1 : 0)
  42825. }
  42826. r.push(new Ci.NumberKeyframeTrack(".morphTargetInfluence[" + f + "]",g,m))
  42827. }
  42828. a = u.length * (s || 1)
  42829. } else {
  42830. var y = ".bones[" + t[c].name + "]";
  42831. n(Ci.VectorKeyframeTrack, y + ".position", h, "pos", r),
  42832. n(Ci.QuaternionKeyframeTrack, y + ".quaternion", h, "rot", r),
  42833. n(Ci.VectorKeyframeTrack, y + ".scale", h, "scl", r)
  42834. }
  42835. }
  42836. return 0 === r.length ? null : new Ci.AnimationClip(o,a,r)
  42837. }
  42838. }),
  42839. Ci.AnimationMixer = function(e) {
  42840. this._root = e,
  42841. this._initMemoryManager(),
  42842. this._accuIndex = 0,
  42843. this.time = 0,
  42844. this.timeScale = 1
  42845. }
  42846. ,
  42847. Ci.AnimationMixer.prototype = {
  42848. constructor: Ci.AnimationMixer,
  42849. clipAction: function(e, t) {
  42850. var i, n = (t || this._root).uuid, r = "string" == typeof e ? e : e.name, o = e !== r ? e : null, a = this._actionsByClip[r];
  42851. if (void 0 !== a) {
  42852. var s = a.actionByRoot[n];
  42853. if (void 0 !== s)
  42854. return s;
  42855. if (o = (i = a.knownActions[0])._clip,
  42856. e !== r && e !== o)
  42857. throw new Error("Different clips with the same name detected!")
  42858. }
  42859. if (null === o)
  42860. return null;
  42861. var l = new Ci.AnimationMixer._Action(this,o,t);
  42862. return this._bindAction(l, i),
  42863. this._addInactiveAction(l, r, n),
  42864. l
  42865. },
  42866. existingAction: function(e, t) {
  42867. var i = (t || this._root).uuid
  42868. , n = "string" == typeof e ? e : e.name
  42869. , r = this._actionsByClip[n];
  42870. return void 0 !== r && r.actionByRoot[i] || null
  42871. },
  42872. stopAllAction: function() {
  42873. var e = this._actions
  42874. , t = this._nActiveActions
  42875. , i = this._bindings
  42876. , n = this._nActiveBindings;
  42877. this._nActiveActions = 0;
  42878. for (var r = this._nActiveBindings = 0; r !== t; ++r)
  42879. e[r].reset();
  42880. for (r = 0; r !== n; ++r)
  42881. i[r].useCount = 0;
  42882. return this
  42883. },
  42884. update: function(e) {
  42885. e *= this.timeScale;
  42886. 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) {
  42887. var s = t[a];
  42888. s.enabled && s._update(n, e, r, o)
  42889. }
  42890. var l = this._bindings
  42891. , c = this._nActiveBindings;
  42892. for (a = 0; a !== c; ++a)
  42893. l[a].apply(o);
  42894. return this
  42895. },
  42896. getRoot: function() {
  42897. return this._root
  42898. },
  42899. uncacheClip: function(e) {
  42900. var t = this._actions
  42901. , i = e.name
  42902. , n = this._actionsByClip
  42903. , r = n[i];
  42904. if (void 0 !== r) {
  42905. for (var o = r.knownActions, a = 0, s = o.length; a !== s; ++a) {
  42906. var l = o[a];
  42907. this._deactivateAction(l);
  42908. var c = l._cacheIndex
  42909. , h = t[t.length - 1];
  42910. l._cacheIndex = null,
  42911. l._byClipCacheIndex = null,
  42912. t[h._cacheIndex = c] = h,
  42913. t.pop(),
  42914. this._removeInactiveBindingsForAction(l)
  42915. }
  42916. delete n[i]
  42917. }
  42918. },
  42919. uncacheRoot: function(e) {
  42920. var t = e.uuid
  42921. , i = this._actionsByClip;
  42922. for (var n in i) {
  42923. var r = i[n].actionByRoot[t];
  42924. void 0 !== r && (this._deactivateAction(r),
  42925. this._removeInactiveAction(r))
  42926. }
  42927. var o = this._bindingsByRootAndName[t];
  42928. if (void 0 !== o)
  42929. for (var a in o) {
  42930. var s = o[a];
  42931. s.restoreOriginalState(),
  42932. this._removeInactiveBinding(s)
  42933. }
  42934. },
  42935. uncacheAction: function(e, t) {
  42936. var i = this.existingAction(e, t);
  42937. null !== i && (this._deactivateAction(i),
  42938. this._removeInactiveAction(i))
  42939. }
  42940. },
  42941. Ci.EventDispatcher.prototype.apply(Ci.AnimationMixer.prototype),
  42942. Ci.AnimationMixer._Action = function(e, t, i) {
  42943. this._mixer = e,
  42944. this._clip = t,
  42945. this._localRoot = i || null;
  42946. for (var n = t.tracks, r = n.length, o = new Array(r), a = {
  42947. endingStart: Ci.ZeroCurvatureEnding,
  42948. endingEnd: Ci.ZeroCurvatureEnding
  42949. }, s = 0; s !== r; ++s) {
  42950. var l = n[s].createInterpolant(null);
  42951. (o[s] = l).settings = a
  42952. }
  42953. this._interpolantSettings = a,
  42954. this._interpolants = o,
  42955. this._propertyBindings = new Array(r),
  42956. this._cacheIndex = null,
  42957. this._byClipCacheIndex = null,
  42958. this._timeScaleInterpolant = null,
  42959. this._weightInterpolant = null,
  42960. this.loop = Ci.LoopRepeat,
  42961. this._loopCount = -1,
  42962. this._startTime = null,
  42963. this.time = 0,
  42964. this.timeScale = 1,
  42965. this._effectiveTimeScale = 1,
  42966. this.weight = 1,
  42967. this._effectiveWeight = 1,
  42968. this.repetitions = 1 / 0,
  42969. this.paused = !1,
  42970. this.enabled = !0,
  42971. this.clampWhenFinished = !1,
  42972. this.zeroSlopeAtStart = !0,
  42973. this.zeroSlopeAtEnd = !0
  42974. }
  42975. ,
  42976. Ci.AnimationMixer._Action.prototype = {
  42977. constructor: Ci.AnimationMixer._Action,
  42978. play: function() {
  42979. return this._mixer._activateAction(this),
  42980. this
  42981. },
  42982. stop: function() {
  42983. return this._mixer._deactivateAction(this),
  42984. this.reset()
  42985. },
  42986. reset: function() {
  42987. return this.paused = !1,
  42988. this.enabled = !0,
  42989. this.time = 0,
  42990. this._loopCount = -1,
  42991. this._startTime = null,
  42992. this.stopFading().stopWarping()
  42993. },
  42994. isRunning: function() {
  42995. return this._startTime,
  42996. this.enabled && !this.paused && 0 !== this.timeScale && null === this._startTime && this._mixer._isActiveAction(this)
  42997. },
  42998. isScheduled: function() {
  42999. return this._mixer._isActiveAction(this)
  43000. },
  43001. startAt: function(e) {
  43002. return this._startTime = e,
  43003. this
  43004. },
  43005. setLoop: function(e, t) {
  43006. return this.loop = e,
  43007. this.repetitions = t,
  43008. this
  43009. },
  43010. setEffectiveWeight: function(e) {
  43011. return this.weight = e,
  43012. this._effectiveWeight = this.enabled ? e : 0,
  43013. this.stopFading()
  43014. },
  43015. getEffectiveWeight: function() {
  43016. return this._effectiveWeight
  43017. },
  43018. fadeIn: function(e) {
  43019. return this._scheduleFading(e, 0, 1)
  43020. },
  43021. fadeOut: function(e) {
  43022. return this._scheduleFading(e, 1, 0)
  43023. },
  43024. crossFadeFrom: function(e, t, i) {
  43025. if (this._mixer,
  43026. e.fadeOut(t),
  43027. this.fadeIn(t),
  43028. i) {
  43029. var n = this._clip.duration
  43030. , r = e._clip.duration
  43031. , o = r / n
  43032. , a = n / r;
  43033. e.warp(1, o, t),
  43034. this.warp(a, 1, t)
  43035. }
  43036. return this
  43037. },
  43038. crossFadeTo: function(e, t, i) {
  43039. return e.crossFadeFrom(this, t, i)
  43040. },
  43041. stopFading: function() {
  43042. var e = this._weightInterpolant;
  43043. return null !== e && (this._weightInterpolant = null,
  43044. this._mixer._takeBackControlInterpolant(e)),
  43045. this
  43046. },
  43047. setEffectiveTimeScale: function(e) {
  43048. return this.timeScale = e,
  43049. this._effectiveTimeScale = this.paused ? 0 : e,
  43050. this.stopWarping()
  43051. },
  43052. getEffectiveTimeScale: function() {
  43053. return this._effectiveTimeScale
  43054. },
  43055. setDuration: function(e) {
  43056. return this.timeScale = this._clip.duration / e,
  43057. this.stopWarping()
  43058. },
  43059. syncWith: function(e) {
  43060. return this.time = e.time,
  43061. this.timeScale = e.timeScale,
  43062. this.stopWarping()
  43063. },
  43064. halt: function(e) {
  43065. return this.warp(this._currentTimeScale, 0, e)
  43066. },
  43067. warp: function(e, t, i) {
  43068. var n = this._mixer
  43069. , r = n.time
  43070. , o = this._timeScaleInterpolant
  43071. , a = this.timeScale;
  43072. null === o && (o = n._lendControlInterpolant(),
  43073. this._timeScaleInterpolant = o);
  43074. var s = o.parameterPositions
  43075. , l = o.sampleValues;
  43076. return s[0] = r,
  43077. s[1] = r + i,
  43078. l[0] = e / a,
  43079. l[1] = t / a,
  43080. this
  43081. },
  43082. stopWarping: function() {
  43083. var e = this._timeScaleInterpolant;
  43084. return null !== e && (this._timeScaleInterpolant = null,
  43085. this._mixer._takeBackControlInterpolant(e)),
  43086. this
  43087. },
  43088. getMixer: function() {
  43089. return this._mixer
  43090. },
  43091. getClip: function() {
  43092. return this._clip
  43093. },
  43094. getRoot: function() {
  43095. return this._localRoot || this._mixer._root
  43096. },
  43097. _update: function(e, t, i, n) {
  43098. var r = this._startTime;
  43099. if (null !== r) {
  43100. var o = (e - r) * i;
  43101. if (o < 0 || 0 === i)
  43102. return;
  43103. this._startTime = null,
  43104. t = i * o
  43105. }
  43106. t *= this._updateTimeScale(e);
  43107. var a = this._updateTime(t)
  43108. , s = this._updateWeight(e);
  43109. if (0 < s)
  43110. for (var l = this._interpolants, c = this._propertyBindings, h = 0, u = l.length; h !== u; ++h)
  43111. l[h].evaluate(a),
  43112. c[h].accumulate(n, s)
  43113. },
  43114. _updateWeight: function(e) {
  43115. var t = 0;
  43116. if (this.enabled) {
  43117. t = this.weight;
  43118. var i = this._weightInterpolant;
  43119. if (null !== i) {
  43120. var n = i.evaluate(e)[0];
  43121. t *= n,
  43122. e > i.parameterPositions[1] && (this.stopFading(),
  43123. 0 === n && (this.enabled = !1))
  43124. }
  43125. }
  43126. return this._effectiveWeight = t
  43127. },
  43128. _updateTimeScale: function(e) {
  43129. var t = 0;
  43130. if (!this.paused) {
  43131. t = this.timeScale;
  43132. var i = this._timeScaleInterpolant;
  43133. if (null !== i)
  43134. t *= i.evaluate(e)[0],
  43135. e > i.parameterPositions[1] && (this.stopWarping(),
  43136. 0 === t ? this.pause = !0 : this.timeScale = t)
  43137. }
  43138. return this._effectiveTimeScale = t
  43139. },
  43140. _updateTime: function(e) {
  43141. var t = this.time + e;
  43142. if (0 === e)
  43143. return t;
  43144. var i = this._clip.duration
  43145. , n = this.loop
  43146. , r = this._loopCount
  43147. , o = !1;
  43148. switch (n) {
  43149. case Ci.LoopOnce:
  43150. if (-1 === r && (this.loopCount = 0,
  43151. this._setEndings(!0, !0, !1)),
  43152. i <= t)
  43153. t = i;
  43154. else {
  43155. if (!(t < 0))
  43156. break;
  43157. t = 0
  43158. }
  43159. this.clampWhenFinished ? this.pause = !0 : this.enabled = !1,
  43160. this._mixer.dispatchEvent({
  43161. type: "finished",
  43162. action: this,
  43163. direction: e < 0 ? -1 : 1
  43164. });
  43165. break;
  43166. case Ci.LoopPingPong:
  43167. o = !0;
  43168. case Ci.LoopRepeat:
  43169. if (-1 === r && (0 < e ? (r = 0,
  43170. this._setEndings(!0, 0 === this.repetitions, o)) : this._setEndings(0 === this.repetitions, !0, o)),
  43171. i <= t || t < 0) {
  43172. var a = Math.floor(t / i);
  43173. t -= i * a,
  43174. r += Math.abs(a);
  43175. var s = this.repetitions - r;
  43176. if (s < 0) {
  43177. this.clampWhenFinished ? this.paused = !0 : this.enabled = !1,
  43178. t = 0 < e ? i : 0,
  43179. this._mixer.dispatchEvent({
  43180. type: "finished",
  43181. action: this,
  43182. direction: 0 < e ? 1 : -1
  43183. });
  43184. break
  43185. }
  43186. if (0 == s) {
  43187. var l = e < 0;
  43188. this._setEndings(l, !l, o)
  43189. } else
  43190. this._setEndings(!1, !1, o);
  43191. this._loopCount = r,
  43192. this._mixer.dispatchEvent({
  43193. type: "loop",
  43194. action: this,
  43195. loopDelta: a
  43196. })
  43197. }
  43198. if (n === Ci.LoopPingPong && 1 == (1 & r))
  43199. return i - (this.time = t)
  43200. }
  43201. return this.time = t
  43202. },
  43203. _setEndings: function(e, t, i) {
  43204. var n = this._interpolantSettings;
  43205. i ? (n.endingStart = Ci.ZeroSlopeEnding,
  43206. n.endingEnd = Ci.ZeroSlopeEnding) : (n.endingStart = e ? this.zeroSlopeAtStart ? Ci.ZeroSlopeEnding : Ci.ZeroCurvatureEnding : Ci.WrapAroundEnding,
  43207. n.endingEnd = t ? this.zeroSlopeAtEnd ? Ci.ZeroSlopeEnding : Ci.ZeroCurvatureEnding : Ci.WrapAroundEnding)
  43208. },
  43209. _scheduleFading: function(e, t, i) {
  43210. var n = this._mixer
  43211. , r = n.time
  43212. , o = this._weightInterpolant;
  43213. null === o && (o = n._lendControlInterpolant(),
  43214. this._weightInterpolant = o);
  43215. var a = o.parameterPositions
  43216. , s = o.sampleValues;
  43217. return a[0] = r,
  43218. s[0] = t,
  43219. a[1] = r + e,
  43220. s[1] = i,
  43221. this
  43222. }
  43223. },
  43224. Object.assign(Ci.AnimationMixer.prototype, {
  43225. _bindAction: function(e, t) {
  43226. var i = e._localRoot || this._root
  43227. , n = e._clip.tracks
  43228. , r = n.length
  43229. , o = e._propertyBindings
  43230. , a = e._interpolants
  43231. , s = i.uuid
  43232. , l = this._bindingsByRootAndName
  43233. , c = l[s];
  43234. void 0 === c && (c = {},
  43235. l[s] = c);
  43236. for (var h = 0; h !== r; ++h) {
  43237. var u = n[h]
  43238. , d = u.name
  43239. , p = c[d];
  43240. if (void 0 !== p)
  43241. o[h] = p;
  43242. else {
  43243. if (void 0 !== (p = o[h])) {
  43244. null === p._cacheIndex && (++p.referenceCount,
  43245. this._addInactiveBinding(p, s, d));
  43246. continue
  43247. }
  43248. var f = t && t._propertyBindings[h].binding.parsedPath;
  43249. ++(p = new Ci.PropertyMixer(Ci.PropertyBinding.create(i, d, f),u.ValueTypeName,u.getValueSize())).referenceCount,
  43250. this._addInactiveBinding(p, s, d),
  43251. o[h] = p
  43252. }
  43253. a[h].resultBuffer = p.buffer
  43254. }
  43255. },
  43256. _activateAction: function(e) {
  43257. if (!this._isActiveAction(e)) {
  43258. if (null === e._cacheIndex) {
  43259. var t = (e._localRoot || this._root).uuid
  43260. , i = e._clip.name
  43261. , n = this._actionsByClip[i];
  43262. this._bindAction(e, n && n.knownActions[0]),
  43263. this._addInactiveAction(e, i, t)
  43264. }
  43265. for (var r = e._propertyBindings, o = 0, a = r.length; o !== a; ++o) {
  43266. var s = r[o];
  43267. 0 == s.useCount++ && (this._lendBinding(s),
  43268. s.saveOriginalState())
  43269. }
  43270. this._lendAction(e)
  43271. }
  43272. },
  43273. _deactivateAction: function(e) {
  43274. if (this._isActiveAction(e)) {
  43275. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  43276. var r = t[i];
  43277. 0 == --r.useCount && (r.restoreOriginalState(),
  43278. this._takeBackBinding(r))
  43279. }
  43280. this._takeBackAction(e)
  43281. }
  43282. },
  43283. _initMemoryManager: function() {
  43284. this._actions = [],
  43285. this._nActiveActions = 0,
  43286. this._actionsByClip = {},
  43287. this._bindings = [],
  43288. this._nActiveBindings = 0,
  43289. this._bindingsByRootAndName = {},
  43290. this._controlInterpolants = [],
  43291. this._nActiveControlInterpolants = 0;
  43292. var e = this;
  43293. this.stats = {
  43294. actions: {
  43295. get total() {
  43296. return e._actions.length
  43297. },
  43298. get inUse() {
  43299. return e._nActiveActions
  43300. }
  43301. },
  43302. bindings: {
  43303. get total() {
  43304. return e._bindings.length
  43305. },
  43306. get inUse() {
  43307. return e._nActiveBindings
  43308. }
  43309. },
  43310. controlInterpolants: {
  43311. get total() {
  43312. return e._controlInterpolants.length
  43313. },
  43314. get inUse() {
  43315. return e._nActiveControlInterpolants
  43316. }
  43317. }
  43318. }
  43319. },
  43320. _isActiveAction: function(e) {
  43321. var t = e._cacheIndex;
  43322. return null !== t && t < this._nActiveActions
  43323. },
  43324. _addInactiveAction: function(e, t, i) {
  43325. var n = this._actions
  43326. , r = this._actionsByClip
  43327. , o = r[t];
  43328. if (void 0 === o)
  43329. o = {
  43330. knownActions: [e],
  43331. actionByRoot: {}
  43332. },
  43333. e._byClipCacheIndex = 0,
  43334. r[t] = o;
  43335. else {
  43336. var a = o.knownActions;
  43337. e._byClipCacheIndex = a.length,
  43338. a.push(e)
  43339. }
  43340. e._cacheIndex = n.length,
  43341. n.push(e),
  43342. o.actionByRoot[i] = e
  43343. },
  43344. _removeInactiveAction: function(e) {
  43345. var t = this._actions
  43346. , i = t[t.length - 1]
  43347. , n = e._cacheIndex;
  43348. t[i._cacheIndex = n] = i,
  43349. t.pop(),
  43350. e._cacheIndex = null;
  43351. var r = e._clip.name
  43352. , o = this._actionsByClip
  43353. , a = o[r]
  43354. , s = a.knownActions
  43355. , l = s[s.length - 1]
  43356. , c = e._byClipCacheIndex;
  43357. s[l._byClipCacheIndex = c] = l,
  43358. s.pop(),
  43359. e._byClipCacheIndex = null,
  43360. delete a.actionByRoot[(t._localRoot || this._root).uuid],
  43361. 0 === s.length && delete o[r],
  43362. this._removeInactiveBindingsForAction(e)
  43363. },
  43364. _removeInactiveBindingsForAction: function(e) {
  43365. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  43366. var r = t[i];
  43367. 0 == --r.referenceCount && this._removeInactiveBinding(r)
  43368. }
  43369. },
  43370. _lendAction: function(e) {
  43371. var t = this._actions
  43372. , i = e._cacheIndex
  43373. , n = this._nActiveActions++
  43374. , r = t[n];
  43375. t[e._cacheIndex = n] = e,
  43376. t[r._cacheIndex = i] = r
  43377. },
  43378. _takeBackAction: function(e) {
  43379. var t = this._actions
  43380. , i = e._cacheIndex
  43381. , n = --this._nActiveActions
  43382. , r = t[n];
  43383. t[e._cacheIndex = n] = e,
  43384. t[r._cacheIndex = i] = r
  43385. },
  43386. _addInactiveBinding: function(e, t, i) {
  43387. var n = this._bindingsByRootAndName
  43388. , r = n[t]
  43389. , o = this._bindings;
  43390. void 0 === r && (r = {},
  43391. n[t] = r),
  43392. (r[i] = e)._cacheIndex = o.length,
  43393. o.push(e)
  43394. },
  43395. _removeInactiveBinding: function(e) {
  43396. var t = this._bindings
  43397. , i = e.binding
  43398. , n = i.rootNode.uuid
  43399. , r = i.path
  43400. , o = this._bindingsByRootAndName
  43401. , a = o[n]
  43402. , s = t[t.length - 1]
  43403. , l = e._cacheIndex;
  43404. t[s._cacheIndex = l] = s,
  43405. t.pop(),
  43406. delete a[r];
  43407. e: {
  43408. for (var c in a)
  43409. break e;
  43410. delete o[n]
  43411. }
  43412. },
  43413. _lendBinding: function(e) {
  43414. var t = this._bindings
  43415. , i = e._cacheIndex
  43416. , n = this._nActiveBindings++
  43417. , r = t[n];
  43418. t[e._cacheIndex = n] = e,
  43419. t[r._cacheIndex = i] = r
  43420. },
  43421. _takeBackBinding: function(e) {
  43422. var t = this._bindings
  43423. , i = e._cacheIndex
  43424. , n = --this._nActiveBindings
  43425. , r = t[n];
  43426. t[e._cacheIndex = n] = e,
  43427. t[r._cacheIndex = i] = r
  43428. },
  43429. _lendControlInterpolant: function() {
  43430. var e = this._controlInterpolants
  43431. , t = this._nActiveControlInterpolants++
  43432. , i = e[t];
  43433. return void 0 === i && (e[(i = new Ci.LinearInterpolant(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer)).__cacheIndex = t] = i),
  43434. i
  43435. },
  43436. _takeBackControlInterpolant: function(e) {
  43437. var t = this._controlInterpolants
  43438. , i = e.__cacheIndex
  43439. , n = --this._nActiveControlInterpolants
  43440. , r = t[n];
  43441. t[e.__cacheIndex = n] = e,
  43442. t[r.__cacheIndex = i] = r
  43443. },
  43444. _controlInterpolantsResultBuffer: new Float32Array(1)
  43445. }),
  43446. Ci.AnimationObjectGroup = function(e) {
  43447. this.uuid = Ci.Math.generateUUID(),
  43448. this._objects = Array.prototype.slice.call(arguments),
  43449. this.nCachedObjects_ = 0;
  43450. var t = {};
  43451. this._indicesByUUID = t;
  43452. for (var i = 0, n = arguments.length; i !== n; ++i)
  43453. t[arguments[i].uuid] = i;
  43454. this._paths = [],
  43455. this._parsedPaths = [],
  43456. this._bindings = [],
  43457. this._bindingsIndicesByPath = {};
  43458. var r = this;
  43459. this.stats = {
  43460. objects: {
  43461. get total() {
  43462. return r._objects.length
  43463. },
  43464. get inUse() {
  43465. return this.total - r.nCachedObjects_
  43466. }
  43467. },
  43468. get bindingsPerObject() {
  43469. return r._bindings.length
  43470. }
  43471. }
  43472. }
  43473. ,
  43474. Ci.AnimationObjectGroup.prototype = {
  43475. constructor: Ci.AnimationObjectGroup,
  43476. add: function(e) {
  43477. 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) {
  43478. var u = arguments[c]
  43479. , d = u.uuid
  43480. , p = r[d];
  43481. if (void 0 === p) {
  43482. p = i++,
  43483. r[d] = p,
  43484. t.push(u);
  43485. for (var f = 0, g = l; f !== g; ++f)
  43486. s[f].push(new Ci.PropertyBinding(u,o[f],a[f]))
  43487. } else if (p < n) {
  43488. var m = t[p]
  43489. , v = --n
  43490. , y = t[v];
  43491. t[r[y.uuid] = p] = y,
  43492. t[r[d] = v] = u;
  43493. for (f = 0,
  43494. g = l; f !== g; ++f) {
  43495. var A = s[f]
  43496. , C = A[v]
  43497. , I = A[p];
  43498. A[p] = C,
  43499. void 0 === I && (I = new Ci.PropertyBinding(u,o[f],a[f])),
  43500. A[v] = I
  43501. }
  43502. } else
  43503. t[p] !== m && console.error("Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes...")
  43504. }
  43505. this.nCachedObjects_ = n
  43506. },
  43507. remove: function(e) {
  43508. for (var t = this._objects, i = (t.length,
  43509. this.nCachedObjects_), n = this._indicesByUUID, r = this._bindings, o = r.length, a = 0, s = arguments.length; a !== s; ++a) {
  43510. var l = arguments[a]
  43511. , c = l.uuid
  43512. , h = n[c];
  43513. if (void 0 !== h && i <= h) {
  43514. var u = i++
  43515. , d = t[u];
  43516. t[n[d.uuid] = h] = d,
  43517. t[n[c] = u] = l;
  43518. for (var p = 0, f = o; p !== f; ++p) {
  43519. var g = r[p]
  43520. , m = g[u]
  43521. , v = g[h];
  43522. g[h] = m,
  43523. g[u] = v
  43524. }
  43525. }
  43526. }
  43527. this.nCachedObjects_ = i
  43528. },
  43529. uncache: function(e) {
  43530. 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) {
  43531. var c = arguments[s].uuid
  43532. , h = r[c];
  43533. if (void 0 !== h)
  43534. if (delete r[c],
  43535. h < n) {
  43536. var u = --n
  43537. , d = t[u]
  43538. , p = t[y = --i];
  43539. t[r[d.uuid] = h] = d,
  43540. t[r[p.uuid] = u] = p,
  43541. t.pop();
  43542. for (var f = 0, g = a; f !== g; ++f) {
  43543. var m = (A = o[f])[u]
  43544. , v = A[y];
  43545. A[h] = m,
  43546. A[u] = v,
  43547. A.pop()
  43548. }
  43549. } else {
  43550. var y;
  43551. t[r[(p = t[y = --i]).uuid] = h] = p,
  43552. t.pop();
  43553. for (f = 0,
  43554. g = a; f !== g; ++f) {
  43555. var A;
  43556. (A = o[f])[h] = A[y],
  43557. A.pop()
  43558. }
  43559. }
  43560. }
  43561. this.nCachedObjects_ = n
  43562. },
  43563. subscribe_: function(e, t) {
  43564. var i = this._bindingsIndicesByPath
  43565. , n = i[e]
  43566. , r = this._bindings;
  43567. if (void 0 !== n)
  43568. return r[n];
  43569. var o = this._paths
  43570. , a = this._parsedPaths
  43571. , s = this._objects
  43572. , l = s.length
  43573. , c = this.nCachedObjects_
  43574. , h = new Array(l);
  43575. n = r.length,
  43576. i[e] = n,
  43577. o.push(e),
  43578. a.push(t),
  43579. r.push(h);
  43580. for (var u = c, d = s.length; u !== d; ++u) {
  43581. var p = s[u];
  43582. h[u] = new Ci.PropertyBinding(p,e,t)
  43583. }
  43584. return h
  43585. },
  43586. unsubscribe_: function(e) {
  43587. var t = this._bindingsIndicesByPath
  43588. , i = t[e];
  43589. if (void 0 !== i) {
  43590. var n = this._paths
  43591. , r = this._parsedPaths
  43592. , o = this._bindings
  43593. , a = o.length - 1
  43594. , s = o[a];
  43595. o[t[e[a]] = i] = s,
  43596. o.pop(),
  43597. r[i] = r[a],
  43598. r.pop(),
  43599. n[i] = n[a],
  43600. n.pop()
  43601. }
  43602. }
  43603. },
  43604. Ci.AnimationUtils = {
  43605. arraySlice: function(e, t, i) {
  43606. return Ci.AnimationUtils.isTypedArray(e) ? new e.constructor(e.subarray(t, i)) : e.slice(t, i)
  43607. },
  43608. convertArray: function(e, t, i) {
  43609. return !e || !i && e.constructor === t ? e : "number" == typeof t.BYTES_PER_ELEMENT ? new t(e) : Array.prototype.slice.call(e)
  43610. },
  43611. isTypedArray: function(e) {
  43612. return ArrayBuffer.isView(e) && !(e instanceof DataView)
  43613. },
  43614. getKeyframeOrder: function(i) {
  43615. for (var e = i.length, t = new Array(e), n = 0; n !== e; ++n)
  43616. t[n] = n;
  43617. return t.sort(function(e, t) {
  43618. return i[e] - i[t]
  43619. }),
  43620. t
  43621. },
  43622. sortedArray: function(e, t, i) {
  43623. for (var n = e.length, r = new e.constructor(n), o = 0, a = 0; a !== n; ++o)
  43624. for (var s = i[o] * t, l = 0; l !== t; ++l)
  43625. r[a++] = e[s + l];
  43626. return r
  43627. },
  43628. flattenJSON: function(e, t, i, n) {
  43629. for (var r = 1, o = e[0]; void 0 !== o && void 0 === o[n]; )
  43630. o = e[r++];
  43631. if (void 0 !== o) {
  43632. var a = o[n];
  43633. if (void 0 !== a)
  43634. if (Array.isArray(a))
  43635. for (; void 0 !== (a = o[n]) && (t.push(o.time),
  43636. i.push.apply(i, a)),
  43637. void 0 !== (o = e[r++]); )
  43638. ;
  43639. else if (void 0 !== a.toArray)
  43640. for (; void 0 !== (a = o[n]) && (t.push(o.time),
  43641. a.toArray(i, i.length)),
  43642. void 0 !== (o = e[r++]); )
  43643. ;
  43644. else
  43645. for (; void 0 !== (a = o[n]) && (t.push(o.time),
  43646. i.push(a)),
  43647. void 0 !== (o = e[r++]); )
  43648. ;
  43649. }
  43650. }
  43651. },
  43652. Ci.KeyframeTrack = function(e, t, i, n) {
  43653. if (void 0 === e)
  43654. throw new Error("track name is undefined");
  43655. if (void 0 === t || 0 === t.length)
  43656. throw new Error("no keyframes in track named " + e);
  43657. this.name = e,
  43658. this.times = Ci.AnimationUtils.convertArray(t, this.TimeBufferType),
  43659. this.values = Ci.AnimationUtils.convertArray(i, this.ValueBufferType),
  43660. this.setInterpolation(n || this.DefaultInterpolation),
  43661. this.validate(),
  43662. this.optimize()
  43663. }
  43664. ,
  43665. Ci.KeyframeTrack.prototype = {
  43666. constructor: Ci.KeyframeTrack,
  43667. TimeBufferType: Float32Array,
  43668. ValueBufferType: Float32Array,
  43669. DefaultInterpolation: Ci.InterpolateLinear,
  43670. InterpolantFactoryMethodDiscrete: function(e) {
  43671. return new Ci.DiscreteInterpolant(this.times,this.values,this.getValueSize(),e)
  43672. },
  43673. InterpolantFactoryMethodLinear: function(e) {
  43674. return new Ci.LinearInterpolant(this.times,this.values,this.getValueSize(),e)
  43675. },
  43676. InterpolantFactoryMethodSmooth: function(e) {
  43677. return new Ci.CubicInterpolant(this.times,this.values,this.getValueSize(),e)
  43678. },
  43679. setInterpolation: function(e) {
  43680. var t = void 0;
  43681. switch (e) {
  43682. case Ci.InterpolateDiscrete:
  43683. t = this.InterpolantFactoryMethodDiscrete;
  43684. break;
  43685. case Ci.InterpolateLinear:
  43686. t = this.InterpolantFactoryMethodLinear;
  43687. break;
  43688. case Ci.InterpolateSmooth:
  43689. t = this.InterpolantFactoryMethodSmooth
  43690. }
  43691. if (void 0 !== t)
  43692. this.createInterpolant = t;
  43693. else {
  43694. var i = "unsupported interpolation for " + this.ValueTypeName + " keyframe track named " + this.name;
  43695. if (void 0 === this.createInterpolant) {
  43696. if (e === this.DefaultInterpolation)
  43697. throw new Error(i);
  43698. this.setInterpolation(this.DefaultInterpolation)
  43699. }
  43700. console.warn(i)
  43701. }
  43702. },
  43703. getInterpolation: function() {
  43704. switch (this.createInterpolant) {
  43705. case this.InterpolantFactoryMethodDiscrete:
  43706. return Ci.InterpolateDiscrete;
  43707. case this.InterpolantFactoryMethodLinear:
  43708. return Ci.InterpolateLinear;
  43709. case this.InterpolantFactoryMethodSmooth:
  43710. return Ci.InterpolateSmooth
  43711. }
  43712. },
  43713. getValueSize: function() {
  43714. return this.values.length / this.times.length
  43715. },
  43716. shift: function(e) {
  43717. if (0 !== e)
  43718. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  43719. t[i] += e;
  43720. return this
  43721. },
  43722. scale: function(e) {
  43723. if (1 !== e)
  43724. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  43725. t[i] *= e;
  43726. return this
  43727. },
  43728. trim: function(e, t) {
  43729. for (var i = this.times, n = i.length, r = 0, o = n - 1; r !== n && i[r] < e; )
  43730. ++r;
  43731. for (; -1 !== o && i[o] > t; )
  43732. --o;
  43733. if (++o,
  43734. 0 !== r || o !== n) {
  43735. o <= r && (r = (o = Math.max(o, 1)) - 1);
  43736. var a = this.getValueSize();
  43737. this.times = Ci.AnimationUtils.arraySlice(i, r, o),
  43738. this.values = Ci.AnimationUtils.arraySlice(this.values, r * a, o * a)
  43739. }
  43740. return this
  43741. },
  43742. validate: function() {
  43743. var e = !0
  43744. , t = this.getValueSize();
  43745. t - Math.floor(t) != 0 && (console.error("invalid value size in track", this),
  43746. e = !1);
  43747. var i = this.times
  43748. , n = this.values
  43749. , r = i.length;
  43750. 0 === r && (console.error("track is empty", this),
  43751. e = !1);
  43752. for (var o = null, a = 0; a !== r; a++) {
  43753. var s = i[a];
  43754. if ("number" == typeof s && isNaN(s)) {
  43755. console.error("time is not a valid number", this, a, s),
  43756. e = !1;
  43757. break
  43758. }
  43759. if (null !== o && s < o) {
  43760. console.error("out of order keys", this, a, s, o),
  43761. e = !1;
  43762. break
  43763. }
  43764. o = s
  43765. }
  43766. if (void 0 !== n && Ci.AnimationUtils.isTypedArray(n)) {
  43767. a = 0;
  43768. for (var l = n.length; a !== l; ++a) {
  43769. var c = n[a];
  43770. if (isNaN(c)) {
  43771. console.error("value is not a valid number", this, a, c),
  43772. e = !1;
  43773. break
  43774. }
  43775. }
  43776. }
  43777. return e
  43778. },
  43779. optimize: function() {
  43780. for (var e = this.times, t = this.values, i = this.getValueSize(), n = 1, r = 1, o = e.length - 1; r <= o; ++r) {
  43781. var a = !1
  43782. , s = e[r];
  43783. if (s !== e[r + 1] && (1 !== r || s !== s[0]))
  43784. for (var l = r * i, c = l - i, h = l + i, u = 0; u !== i; ++u) {
  43785. var d = t[l + u];
  43786. if (d !== t[c + u] || d !== t[h + u]) {
  43787. a = !0;
  43788. break
  43789. }
  43790. }
  43791. if (a) {
  43792. if (r !== n) {
  43793. e[n] = e[r];
  43794. var p = r * i
  43795. , f = n * i;
  43796. for (u = 0; u !== i; ++u)
  43797. t[f + u] = t[p + u]
  43798. }
  43799. ++n
  43800. }
  43801. }
  43802. return n !== e.length && (this.times = Ci.AnimationUtils.arraySlice(e, 0, n),
  43803. this.values = Ci.AnimationUtils.arraySlice(t, 0, n * i)),
  43804. this
  43805. }
  43806. },
  43807. Object.assign(Ci.KeyframeTrack, {
  43808. parse: function(e) {
  43809. if (void 0 === e.type)
  43810. throw new Error("track type undefined, can not parse");
  43811. var t = Ci.KeyframeTrack._getTrackTypeForValueTypeName(e.type);
  43812. if (void 0 === e.times) {
  43813. console.warn("legacy JSON format detected, converting");
  43814. var i = []
  43815. , n = [];
  43816. Ci.AnimationUtils.flattenJSON(e.keys, i, n, "value"),
  43817. e.times = i,
  43818. e.values = n
  43819. }
  43820. return void 0 !== t.parse ? t.parse(e) : new t(e.name,e.times,e.values,e.interpolation)
  43821. },
  43822. toJSON: function(e) {
  43823. var t, i = e.constructor;
  43824. if (void 0 !== i.toJSON)
  43825. t = i.toJSON(e);
  43826. else {
  43827. t = {
  43828. name: e.name,
  43829. times: Ci.AnimationUtils.convertArray(e.times, Array),
  43830. values: Ci.AnimationUtils.convertArray(e.values, Array)
  43831. };
  43832. var n = e.getInterpolation();
  43833. n !== e.DefaultInterpolation && (t.interpolation = n)
  43834. }
  43835. return t.type = e.ValueTypeName,
  43836. t
  43837. },
  43838. _getTrackTypeForValueTypeName: function(e) {
  43839. switch (e.toLowerCase()) {
  43840. case "scalar":
  43841. case "double":
  43842. case "float":
  43843. case "number":
  43844. case "integer":
  43845. return Ci.NumberKeyframeTrack;
  43846. case "vector":
  43847. case "vector2":
  43848. case "vector3":
  43849. case "vector4":
  43850. return Ci.VectorKeyframeTrack;
  43851. case "color":
  43852. return Ci.ColorKeyframeTrack;
  43853. case "quaternion":
  43854. return Ci.QuaternionKeyframeTrack;
  43855. case "bool":
  43856. case "boolean":
  43857. return Ci.BooleanKeyframeTrack;
  43858. case "string":
  43859. return Ci.StringKeyframeTrack
  43860. }
  43861. throw new Error("Unsupported typeName: " + e)
  43862. }
  43863. }),
  43864. Ci.PropertyBinding = function(e, t, i) {
  43865. this.path = t,
  43866. this.parsedPath = i || Ci.PropertyBinding.parseTrackName(t),
  43867. this.node = Ci.PropertyBinding.findNode(e, this.parsedPath.nodeName) || e,
  43868. this.rootNode = e
  43869. }
  43870. ,
  43871. Ci.PropertyBinding.prototype = {
  43872. constructor: Ci.PropertyBinding,
  43873. getValue: function(e, t) {
  43874. this.bind(),
  43875. this.getValue(e, t)
  43876. },
  43877. setValue: function(e, t) {
  43878. this.bind(),
  43879. this.setValue(e, t)
  43880. },
  43881. bind: function() {
  43882. var e = this.node
  43883. , t = this.parsedPath
  43884. , i = t.objectName
  43885. , n = t.propertyName
  43886. , r = t.propertyIndex;
  43887. if (e || (e = Ci.PropertyBinding.findNode(this.rootNode, t.nodeName) || this.rootNode,
  43888. this.node = e),
  43889. this.getValue = this._getValue_unavailable,
  43890. this.setValue = this._setValue_unavailable,
  43891. e) {
  43892. if (i) {
  43893. var o = t.objectIndex;
  43894. switch (i) {
  43895. case "materials":
  43896. if (!e.material)
  43897. return void console.error(" can not bind to material as node does not have a material", this);
  43898. if (!e.material.materials)
  43899. return void console.error(" can not bind to material.materials as node.material does not have a materials array", this);
  43900. e = e.material.materials;
  43901. break;
  43902. case "bones":
  43903. if (!e.skeleton)
  43904. return void console.error(" can not bind to bones as node does not have a skeleton", this);
  43905. e = e.skeleton.bones;
  43906. for (var a = 0; a < e.length; a++)
  43907. if (e[a].name === o) {
  43908. o = a;
  43909. break
  43910. }
  43911. break;
  43912. default:
  43913. if (void 0 === e[i])
  43914. return void console.error(" can not bind to objectName of node, undefined", this);
  43915. e = e[i]
  43916. }
  43917. if (void 0 !== o) {
  43918. if (void 0 === e[o])
  43919. return void console.error(" trying to bind to objectIndex of objectName, but is undefined:", this, e);
  43920. e = e[o]
  43921. }
  43922. }
  43923. var s = e[n];
  43924. if (s) {
  43925. var l = this.Versioning.None;
  43926. void 0 !== e.needsUpdate ? (l = this.Versioning.NeedsUpdate,
  43927. this.targetObject = e) : void 0 !== e.matrixWorldNeedsUpdate && (l = this.Versioning.MatrixWorldNeedsUpdate,
  43928. this.targetObject = e);
  43929. var c = this.BindingType.Direct;
  43930. if (void 0 !== r) {
  43931. if ("morphTargetInfluences" === n) {
  43932. if (!e.geometry)
  43933. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry", this);
  43934. if (!e.geometry.morphTargets)
  43935. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets", this);
  43936. for (a = 0; a < this.node.geometry.morphTargets.length; a++)
  43937. if (e.geometry.morphTargets[a].name === r) {
  43938. r = a;
  43939. break
  43940. }
  43941. }
  43942. c = this.BindingType.ArrayElement,
  43943. this.resolvedProperty = s,
  43944. this.propertyIndex = r
  43945. } else
  43946. void 0 !== s.fromArray && void 0 !== s.toArray ? (c = this.BindingType.HasFromToArray,
  43947. this.resolvedProperty = s) : void 0 !== s.length ? (c = this.BindingType.EntireArray,
  43948. this.resolvedProperty = s) : this.propertyName = n;
  43949. this.getValue = this.GetterByBindingType[c],
  43950. this.setValue = this.SetterByBindingTypeAndVersioning[c][l]
  43951. } else {
  43952. var h = t.nodeName;
  43953. console.error(" trying to update property for track: " + h + "." + n + " but it wasn't found.", e)
  43954. }
  43955. } else
  43956. console.error(" trying to update node for track: " + this.path + " but it wasn't found.")
  43957. },
  43958. unbind: function() {
  43959. this.node = null,
  43960. this.getValue = this._getValue_unbound,
  43961. this.setValue = this._setValue_unbound
  43962. }
  43963. },
  43964. Object.assign(Ci.PropertyBinding.prototype, {
  43965. _getValue_unavailable: function() {},
  43966. _setValue_unavailable: function() {},
  43967. _getValue_unbound: Ci.PropertyBinding.prototype.getValue,
  43968. _setValue_unbound: Ci.PropertyBinding.prototype.setValue,
  43969. BindingType: {
  43970. Direct: 0,
  43971. EntireArray: 1,
  43972. ArrayElement: 2,
  43973. HasFromToArray: 3
  43974. },
  43975. Versioning: {
  43976. None: 0,
  43977. NeedsUpdate: 1,
  43978. MatrixWorldNeedsUpdate: 2
  43979. },
  43980. GetterByBindingType: [function(e, t) {
  43981. e[t] = this.node[this.propertyName]
  43982. }
  43983. , function(e, t) {
  43984. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  43985. e[t++] = i[n]
  43986. }
  43987. , function(e, t) {
  43988. e[t] = this.resolvedProperty[this.propertyIndex]
  43989. }
  43990. , function(e, t) {
  43991. this.resolvedProperty.toArray(e, t)
  43992. }
  43993. ],
  43994. SetterByBindingTypeAndVersioning: [[function(e, t) {
  43995. this.node[this.propertyName] = e[t]
  43996. }
  43997. , function(e, t) {
  43998. this.node[this.propertyName] = e[t],
  43999. this.targetObject.needsUpdate = !0
  44000. }
  44001. , function(e, t) {
  44002. this.node[this.propertyName] = e[t],
  44003. this.targetObject.matrixWorldNeedsUpdate = !0
  44004. }
  44005. ], [function(e, t) {
  44006. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44007. i[n] = e[t++]
  44008. }
  44009. , function(e, t) {
  44010. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44011. i[n] = e[t++];
  44012. this.targetObject.needsUpdate = !0
  44013. }
  44014. , function(e, t) {
  44015. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44016. i[n] = e[t++];
  44017. this.targetObject.matrixWorldNeedsUpdate = !0
  44018. }
  44019. ], [function(e, t) {
  44020. this.resolvedProperty[this.propertyIndex] = e[t]
  44021. }
  44022. , function(e, t) {
  44023. this.resolvedProperty[this.propertyIndex] = e[t],
  44024. this.targetObject.needsUpdate = !0
  44025. }
  44026. , function(e, t) {
  44027. this.resolvedProperty[this.propertyIndex] = e[t],
  44028. this.targetObject.matrixWorldNeedsUpdate = !0
  44029. }
  44030. ], [function(e, t) {
  44031. this.resolvedProperty.fromArray(e, t)
  44032. }
  44033. , function(e, t) {
  44034. this.resolvedProperty.fromArray(e, t),
  44035. this.targetObject.needsUpdate = !0
  44036. }
  44037. , function(e, t) {
  44038. this.resolvedProperty.fromArray(e, t),
  44039. this.targetObject.matrixWorldNeedsUpdate = !0
  44040. }
  44041. ]]
  44042. }),
  44043. Ci.PropertyBinding.Composite = function(e, t, i) {
  44044. var n = i || Ci.PropertyBinding.parseTrackName(t);
  44045. this._targetGroup = e,
  44046. this._bindings = e.subscribe_(t, n)
  44047. }
  44048. ,
  44049. Ci.PropertyBinding.Composite.prototype = {
  44050. constructor: Ci.PropertyBinding.Composite,
  44051. getValue: function(e, t) {
  44052. this.bind();
  44053. var i = this._targetGroup.nCachedObjects_
  44054. , n = this._bindings[i];
  44055. void 0 !== n && n.getValue(e, t)
  44056. },
  44057. setValue: function(e, t) {
  44058. for (var i = this._bindings, n = this._targetGroup.nCachedObjects_, r = i.length; n !== r; ++n)
  44059. i[n].setValue(e, t)
  44060. },
  44061. bind: function() {
  44062. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  44063. e[t].bind()
  44064. },
  44065. unbind: function() {
  44066. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  44067. e[t].unbind()
  44068. }
  44069. },
  44070. Ci.PropertyBinding.create = function(e, t, i) {
  44071. return e instanceof Ci.AnimationObjectGroup ? new Ci.PropertyBinding.Composite(e,t,i) : new Ci.PropertyBinding(e,t,i)
  44072. }
  44073. ,
  44074. Ci.PropertyBinding.parseTrackName = function(e) {
  44075. var t = /^(([\w]+\/)*)([\w-\d]+)?(\.([\w]+)(\[([\w\d\[\]\_.:\- ]+)\])?)?(\.([\w.]+)(\[([\w\d\[\]\_. ]+)\])?)$/
  44076. , i = t.exec(e);
  44077. if (!i)
  44078. throw new Error("cannot parse trackName at all: " + e);
  44079. i.index === t.lastIndex && t.lastIndex++;
  44080. var n = {
  44081. nodeName: i[3],
  44082. objectName: i[5],
  44083. objectIndex: i[7],
  44084. propertyName: i[9],
  44085. propertyIndex: i[11]
  44086. };
  44087. if (null === n.propertyName || 0 === n.propertyName.length)
  44088. throw new Error("can not parse propertyName from trackName: " + e);
  44089. return n
  44090. }
  44091. ,
  44092. Ci.PropertyBinding.findNode = function(e, r) {
  44093. if (!r || "" === r || "root" === r || "." === r || -1 === r || r === e.name || r === e.uuid)
  44094. return e;
  44095. if (e.skeleton) {
  44096. var t = function(e) {
  44097. for (var t = 0; t < e.bones.length; t++) {
  44098. var i = e.bones[t];
  44099. if (i.name === r)
  44100. return i
  44101. }
  44102. return null
  44103. }(e.skeleton);
  44104. if (t)
  44105. return t
  44106. }
  44107. if (e.children) {
  44108. var o = function(e) {
  44109. for (var t = 0; t < e.length; t++) {
  44110. var i = e[t];
  44111. if (i.name === r || i.uuid === r)
  44112. return i;
  44113. var n = o(i.children);
  44114. if (n)
  44115. return n
  44116. }
  44117. return null
  44118. }
  44119. , i = o(e.children);
  44120. if (i)
  44121. return i
  44122. }
  44123. return null
  44124. }
  44125. ,
  44126. Ci.PropertyMixer = function(e, t, i) {
  44127. this.binding = e,
  44128. this.valueSize = i;
  44129. var n, r = Float64Array;
  44130. switch (t) {
  44131. case "quaternion":
  44132. n = this._slerp;
  44133. break;
  44134. case "string":
  44135. case "bool":
  44136. r = Array,
  44137. n = this._select;
  44138. break;
  44139. default:
  44140. n = this._lerp
  44141. }
  44142. this.buffer = new r(4 * i),
  44143. this._mixBufferRegion = n,
  44144. this.cumulativeWeight = 0,
  44145. this.useCount = 0,
  44146. this.referenceCount = 0
  44147. }
  44148. ,
  44149. Ci.PropertyMixer.prototype = {
  44150. constructor: Ci.PropertyMixer,
  44151. accumulate: function(e, t) {
  44152. var i = this.buffer
  44153. , n = this.valueSize
  44154. , r = e * n + n
  44155. , o = this.cumulativeWeight;
  44156. if (0 === o) {
  44157. for (var a = 0; a !== n; ++a)
  44158. i[r + a] = i[a];
  44159. o = t
  44160. } else {
  44161. var s = t / (o += t);
  44162. this._mixBufferRegion(i, r, 0, s, n)
  44163. }
  44164. this.cumulativeWeight = o
  44165. },
  44166. apply: function(e) {
  44167. var t = this.valueSize
  44168. , i = this.buffer
  44169. , n = e * t + t
  44170. , r = this.cumulativeWeight
  44171. , o = this.binding;
  44172. if (this.cumulativeWeight = 0,
  44173. r < 1) {
  44174. var a = 3 * t;
  44175. this._mixBufferRegion(i, n, a, 1 - r, t)
  44176. }
  44177. for (var s = t, l = t + t; s !== l; ++s)
  44178. if (i[s] !== i[s + t]) {
  44179. o.setValue(i, n);
  44180. break
  44181. }
  44182. },
  44183. saveOriginalState: function() {
  44184. var e = this.binding
  44185. , t = this.buffer
  44186. , i = this.valueSize
  44187. , n = 3 * i;
  44188. e.getValue(t, n);
  44189. for (var r = i, o = n; r !== o; ++r)
  44190. t[r] = t[n + r % i];
  44191. this.cumulativeWeight = 0
  44192. },
  44193. restoreOriginalState: function() {
  44194. var e = 3 * this.valueSize;
  44195. this.binding.setValue(this.buffer, e)
  44196. },
  44197. _select: function(e, t, i, n, r) {
  44198. if (.5 <= n)
  44199. for (var o = 0; o !== r; ++o)
  44200. e[t + o] = e[i + o]
  44201. },
  44202. _slerp: function(e, t, i, n, r) {
  44203. Ci.Quaternion.slerpFlat(e, t, e, t, e, i, n)
  44204. },
  44205. _lerp: function(e, t, i, n, r) {
  44206. for (var o = 1 - n, a = 0; a !== r; ++a) {
  44207. var s = t + a;
  44208. e[s] = e[s] * o + e[i + a] * n
  44209. }
  44210. }
  44211. },
  44212. Ci.BooleanKeyframeTrack = function(e, t, i) {
  44213. Ci.KeyframeTrack.call(this, e, t, i)
  44214. }
  44215. ,
  44216. Ci.BooleanKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44217. constructor: Ci.BooleanKeyframeTrack,
  44218. ValueTypeName: "bool",
  44219. ValueBufferType: Array,
  44220. DefaultInterpolation: Ci.IntepolateDiscrete,
  44221. InterpolantFactoryMethodLinear: void 0,
  44222. InterpolantFactoryMethodSmooth: void 0
  44223. }),
  44224. Ci.NumberKeyframeTrack = function(e, t, i, n) {
  44225. Ci.KeyframeTrack.call(this, e, t, i, n)
  44226. }
  44227. ,
  44228. Ci.NumberKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44229. constructor: Ci.NumberKeyframeTrack,
  44230. ValueTypeName: "number"
  44231. }),
  44232. Ci.QuaternionKeyframeTrack = function(e, t, i, n) {
  44233. Ci.KeyframeTrack.call(this, e, t, i, n)
  44234. }
  44235. ,
  44236. Ci.QuaternionKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44237. constructor: Ci.QuaternionKeyframeTrack,
  44238. ValueTypeName: "quaternion",
  44239. DefaultInterpolation: Ci.InterpolateLinear,
  44240. InterpolantFactoryMethodLinear: function(e) {
  44241. return new Ci.QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),e)
  44242. },
  44243. InterpolantFactoryMethodSmooth: void 0
  44244. }),
  44245. Ci.StringKeyframeTrack = function(e, t, i, n) {
  44246. Ci.KeyframeTrack.call(this, e, t, i, n)
  44247. }
  44248. ,
  44249. Ci.StringKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44250. constructor: Ci.StringKeyframeTrack,
  44251. ValueTypeName: "string",
  44252. ValueBufferType: Array,
  44253. DefaultInterpolation: Ci.IntepolateDiscrete,
  44254. InterpolantFactoryMethodLinear: void 0,
  44255. InterpolantFactoryMethodSmooth: void 0
  44256. }),
  44257. Ci.VectorKeyframeTrack = function(e, t, i, n) {
  44258. Ci.KeyframeTrack.call(this, e, t, i, n)
  44259. }
  44260. ,
  44261. Ci.VectorKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44262. constructor: Ci.VectorKeyframeTrack,
  44263. ValueTypeName: "vector"
  44264. }),
  44265. Ci.Audio = function(e) {
  44266. Ci.Object3D.call(this),
  44267. this.type = "Audio",
  44268. this.context = e.context,
  44269. this.source = this.context.createBufferSource(),
  44270. this.source.onended = this.onEnded.bind(this),
  44271. this.gain = this.context.createGain(),
  44272. this.gain.connect(e.getInput()),
  44273. this.autoplay = !1,
  44274. this.startTime = 0,
  44275. this.playbackRate = 1,
  44276. this.isPlaying = !1,
  44277. this.hasPlaybackControl = !0,
  44278. this.sourceType = "empty",
  44279. this.filter = null
  44280. }
  44281. ,
  44282. Ci.Audio.prototype = Object.create(Ci.Object3D.prototype),
  44283. Ci.Audio.prototype.constructor = Ci.Audio,
  44284. Ci.Audio.prototype.getOutput = function() {
  44285. return this.gain
  44286. }
  44287. ,
  44288. Ci.Audio.prototype.load = function(e) {
  44289. var t = new Ci.AudioBuffer(this.context);
  44290. return t.load(e),
  44291. this.setBuffer(t),
  44292. this
  44293. }
  44294. ,
  44295. Ci.Audio.prototype.setNodeSource = function(e) {
  44296. return this.hasPlaybackControl = !1,
  44297. this.sourceType = "audioNode",
  44298. this.source = e,
  44299. this.connect(),
  44300. this
  44301. }
  44302. ,
  44303. Ci.Audio.prototype.setBuffer = function(e) {
  44304. var t = this;
  44305. return e.onReady(function(e) {
  44306. t.source.buffer = e,
  44307. t.sourceType = "buffer",
  44308. t.autoplay && t.play()
  44309. }),
  44310. this
  44311. }
  44312. ,
  44313. Ci.Audio.prototype.play = function() {
  44314. if (!0 !== this.isPlaying)
  44315. if (!1 !== this.hasPlaybackControl) {
  44316. var e = this.context.createBufferSource();
  44317. e.buffer = this.source.buffer,
  44318. e.loop = this.source.loop,
  44319. e.onended = this.source.onended,
  44320. e.start(0, this.startTime),
  44321. e.playbackRate.value = this.playbackRate,
  44322. this.isPlaying = !0,
  44323. this.source = e,
  44324. this.connect()
  44325. } else
  44326. console.warn("THREE.Audio: this Audio has no playback control.");
  44327. else
  44328. console.warn("THREE.Audio: Audio is already playing.")
  44329. }
  44330. ,
  44331. Ci.Audio.prototype.pause = function() {
  44332. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  44333. void (this.startTime = this.context.currentTime))
  44334. }
  44335. ,
  44336. Ci.Audio.prototype.stop = function() {
  44337. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  44338. void (this.startTime = 0))
  44339. }
  44340. ,
  44341. Ci.Audio.prototype.connect = function() {
  44342. null !== this.filter ? (this.source.connect(this.filter),
  44343. this.filter.connect(this.getOutput())) : this.source.connect(this.getOutput())
  44344. }
  44345. ,
  44346. Ci.Audio.prototype.disconnect = function() {
  44347. null !== this.filter ? (this.source.disconnect(this.filter),
  44348. this.filter.disconnect(this.getOutput())) : this.source.disconnect(this.getOutput())
  44349. }
  44350. ,
  44351. Ci.Audio.prototype.getFilter = function() {
  44352. return this.filter
  44353. }
  44354. ,
  44355. Ci.Audio.prototype.setFilter = function(e) {
  44356. void 0 === e && (e = null),
  44357. !0 === this.isPlaying ? (this.disconnect(),
  44358. this.filter = e,
  44359. this.connect()) : this.filter = e
  44360. }
  44361. ,
  44362. Ci.Audio.prototype.setPlaybackRate = function(e) {
  44363. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.playbackRate = e,
  44364. void (!0 === this.isPlaying && (this.source.playbackRate.value = this.playbackRate)))
  44365. }
  44366. ,
  44367. Ci.Audio.prototype.getPlaybackRate = function() {
  44368. return this.playbackRate
  44369. }
  44370. ,
  44371. Ci.Audio.prototype.onEnded = function() {
  44372. this.isPlaying = !1
  44373. }
  44374. ,
  44375. Ci.Audio.prototype.setLoop = function(e) {
  44376. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : void (this.source.loop = e)
  44377. }
  44378. ,
  44379. Ci.Audio.prototype.getLoop = function() {
  44380. return !1 === this.hasPlaybackControl ? (console.warn("THREE.Audio: this Audio has no playback control."),
  44381. !1) : this.source.loop
  44382. }
  44383. ,
  44384. Ci.Audio.prototype.setVolume = function(e) {
  44385. this.gain.gain.value = e
  44386. }
  44387. ,
  44388. Ci.Audio.prototype.getVolume = function() {
  44389. return this.gain.gain.value
  44390. }
  44391. ,
  44392. Ci.AudioAnalyser = function(e, t) {
  44393. this.analyser = e.context.createAnalyser(),
  44394. this.analyser.fftSize = void 0 !== t ? t : 2048,
  44395. this.data = new Uint8Array(this.analyser.frequencyBinCount),
  44396. e.getOutput().connect(this.analyser)
  44397. }
  44398. ,
  44399. Ci.AudioAnalyser.prototype = {
  44400. constructor: Ci.AudioAnalyser,
  44401. getData: function() {
  44402. return this.analyser.getByteFrequencyData(this.data),
  44403. this.data
  44404. }
  44405. },
  44406. Ci.AudioBuffer = function(e) {
  44407. this.context = e,
  44408. this.ready = !1,
  44409. this.readyCallbacks = []
  44410. }
  44411. ,
  44412. Ci.AudioBuffer.prototype.load = function(e) {
  44413. var i = this
  44414. , t = new XMLHttpRequest;
  44415. return t.open("GET", e, !0),
  44416. t.responseType = "arraybuffer",
  44417. t.onload = function(e) {
  44418. i.context.decodeAudioData(this.response, function(e) {
  44419. i.buffer = e,
  44420. i.ready = !0;
  44421. for (var t = 0; t < i.readyCallbacks.length; t++)
  44422. i.readyCallbacks[t](i.buffer);
  44423. i.readyCallbacks = []
  44424. })
  44425. }
  44426. ,
  44427. t.send(),
  44428. this
  44429. }
  44430. ,
  44431. Ci.AudioBuffer.prototype.onReady = function(e) {
  44432. this.ready ? e(this.buffer) : this.readyCallbacks.push(e)
  44433. }
  44434. ,
  44435. Ci.PositionalAudio = function(e) {
  44436. Ci.Audio.call(this, e),
  44437. this.panner = this.context.createPanner(),
  44438. this.panner.connect(this.gain)
  44439. }
  44440. ,
  44441. Ci.PositionalAudio.prototype = Object.create(Ci.Audio.prototype),
  44442. Ci.PositionalAudio.prototype.constructor = Ci.PositionalAudio,
  44443. Ci.PositionalAudio.prototype.getOutput = function() {
  44444. return this.panner
  44445. }
  44446. ,
  44447. Ci.PositionalAudio.prototype.setRefDistance = function(e) {
  44448. this.panner.refDistance = e
  44449. }
  44450. ,
  44451. Ci.PositionalAudio.prototype.getRefDistance = function() {
  44452. return this.panner.refDistance
  44453. }
  44454. ,
  44455. Ci.PositionalAudio.prototype.setRolloffFactor = function(e) {
  44456. this.panner.rolloffFactor = e
  44457. }
  44458. ,
  44459. Ci.PositionalAudio.prototype.getRolloffFactor = function() {
  44460. return this.panner.rolloffFactor
  44461. }
  44462. ,
  44463. Ci.PositionalAudio.prototype.setDistanceModel = function(e) {
  44464. this.panner.distanceModel = e
  44465. }
  44466. ,
  44467. Ci.PositionalAudio.prototype.getDistanceModel = function() {
  44468. return this.panner.distanceModel
  44469. }
  44470. ,
  44471. Ci.PositionalAudio.prototype.setMaxDistance = function(e) {
  44472. this.panner.maxDistance = e
  44473. }
  44474. ,
  44475. Ci.PositionalAudio.prototype.getMaxDistance = function() {
  44476. return this.panner.maxDistance
  44477. }
  44478. ,
  44479. Ci.PositionalAudio.prototype.updateMatrixWorld = (it = new Ci.Vector3,
  44480. function(e) {
  44481. Ci.Object3D.prototype.updateMatrixWorld.call(this, e),
  44482. it.setFromMatrixPosition(this.matrixWorld),
  44483. this.panner.setPosition(it.x, it.y, it.z)
  44484. }
  44485. ),
  44486. Ci.AudioListener = function() {
  44487. Ci.Object3D.call(this),
  44488. this.type = "AudioListener",
  44489. this.context = new (window.AudioContext || window.webkitAudioContext),
  44490. this.gain = this.context.createGain(),
  44491. this.gain.connect(this.context.destination),
  44492. this.filter = null
  44493. }
  44494. ,
  44495. Ci.AudioListener.prototype = Object.create(Ci.Object3D.prototype),
  44496. Ci.AudioListener.prototype.constructor = Ci.AudioListener,
  44497. Ci.AudioListener.prototype.getInput = function() {
  44498. return this.gain
  44499. }
  44500. ,
  44501. Ci.AudioListener.prototype.removeFilter = function() {
  44502. null !== this.filter && (this.gain.disconnect(this.filter),
  44503. this.filter.disconnect(this.context.destination),
  44504. this.gain.connect(this.context.destination),
  44505. this.filter = null)
  44506. }
  44507. ,
  44508. Ci.AudioListener.prototype.setFilter = function(e) {
  44509. null !== this.filter ? (this.gain.disconnect(this.filter),
  44510. this.filter.disconnect(this.context.destination)) : this.gain.disconnect(this.context.destination),
  44511. this.filter = e,
  44512. this.gain.connect(this.filter),
  44513. this.filter.connect(this.context.destination)
  44514. }
  44515. ,
  44516. Ci.AudioListener.prototype.getFilter = function() {
  44517. return this.filter
  44518. }
  44519. ,
  44520. Ci.AudioListener.prototype.setMasterVolume = function(e) {
  44521. this.gain.gain.value = e
  44522. }
  44523. ,
  44524. Ci.AudioListener.prototype.getMasterVolume = function() {
  44525. return this.gain.gain.value
  44526. }
  44527. ,
  44528. Ci.AudioListener.prototype.updateMatrixWorld = (Je = new Ci.Vector3,
  44529. $e = new Ci.Quaternion,
  44530. et = new Ci.Vector3,
  44531. tt = new Ci.Vector3,
  44532. function(e) {
  44533. Ci.Object3D.prototype.updateMatrixWorld.call(this, e);
  44534. var t = this.context.listener
  44535. , i = this.up;
  44536. this.matrixWorld.decompose(Je, $e, et),
  44537. tt.set(0, 0, -1).applyQuaternion($e),
  44538. t.setPosition(Je.x, Je.y, Je.z),
  44539. t.setOrientation(tt.x, tt.y, tt.z, i.x, i.y, i.z)
  44540. }
  44541. ),
  44542. Ci.Camera = function() {
  44543. Ci.Object3D.call(this),
  44544. this.type = "Camera",
  44545. this.matrixWorldInverse = new Ci.Matrix4,
  44546. this.projectionMatrix = new Ci.Matrix4
  44547. }
  44548. ,
  44549. Ci.Camera.prototype = Object.create(Ci.Object3D.prototype),
  44550. Ci.Camera.prototype.constructor = Ci.Camera,
  44551. Ci.Camera.prototype.getWorldDirection = (Qe = new Ci.Quaternion,
  44552. function(e) {
  44553. var t = e || new Ci.Vector3;
  44554. return this.getWorldQuaternion(Qe),
  44555. t.set(0, 0, -1).applyQuaternion(Qe)
  44556. }
  44557. ),
  44558. Ci.Camera.prototype.lookAt = (Ke = new Ci.Matrix4,
  44559. function(e) {
  44560. Ke.lookAt(this.position, e, this.up),
  44561. this.quaternion.setFromRotationMatrix(Ke)
  44562. }
  44563. ),
  44564. Ci.Camera.prototype.clone = function() {
  44565. return (new this.constructor).copy(this)
  44566. }
  44567. ,
  44568. Ci.Camera.prototype.copy = function(e) {
  44569. return Ci.Object3D.prototype.copy.call(this, e),
  44570. this.matrixWorldInverse.copy(e.matrixWorldInverse),
  44571. this.projectionMatrix.copy(e.projectionMatrix),
  44572. this
  44573. }
  44574. ,
  44575. Ci.CubeCamera = function(e, t, i) {
  44576. Ci.Object3D.call(this),
  44577. this.type = "CubeCamera";
  44578. var r = new Ci.PerspectiveCamera(90,1,e,t);
  44579. r.up.set(0, -1, 0),
  44580. r.lookAt(new Ci.Vector3(1,0,0)),
  44581. this.add(r);
  44582. var o = new Ci.PerspectiveCamera(90,1,e,t);
  44583. o.up.set(0, -1, 0),
  44584. o.lookAt(new Ci.Vector3(-1,0,0)),
  44585. this.add(o);
  44586. var a = new Ci.PerspectiveCamera(90,1,e,t);
  44587. a.up.set(0, 0, 1),
  44588. a.lookAt(new Ci.Vector3(0,1,0)),
  44589. this.add(a);
  44590. var s = new Ci.PerspectiveCamera(90,1,e,t);
  44591. s.up.set(0, 0, -1),
  44592. s.lookAt(new Ci.Vector3(0,-1,0)),
  44593. this.add(s);
  44594. var l = new Ci.PerspectiveCamera(90,1,e,t);
  44595. l.up.set(0, -1, 0),
  44596. l.lookAt(new Ci.Vector3(0,0,1)),
  44597. this.add(l);
  44598. var c = new Ci.PerspectiveCamera(90,1,e,t);
  44599. c.up.set(0, -1, 0),
  44600. c.lookAt(new Ci.Vector3(0,0,-1)),
  44601. this.add(c);
  44602. var n = {
  44603. format: Ci.RGBFormat,
  44604. magFilter: Ci.LinearFilter,
  44605. minFilter: Ci.LinearFilter
  44606. };
  44607. this.renderTarget = new Ci.WebGLRenderTargetCube(i,i,n),
  44608. this.updateCubeMap = function(e, t) {
  44609. null === this.parent && this.updateMatrixWorld();
  44610. var i = this.renderTarget
  44611. , n = i.texture.generateMipmaps;
  44612. i.texture.generateMipmaps = !1,
  44613. i.activeCubeFace = 0,
  44614. e.render(t, r, i),
  44615. i.activeCubeFace = 1,
  44616. e.render(t, o, i),
  44617. i.activeCubeFace = 2,
  44618. e.render(t, a, i),
  44619. i.activeCubeFace = 3,
  44620. e.render(t, s, i),
  44621. i.activeCubeFace = 4,
  44622. e.render(t, l, i),
  44623. i.texture.generateMipmaps = n,
  44624. i.activeCubeFace = 5,
  44625. e.render(t, c, i),
  44626. e.setRenderTarget(null)
  44627. }
  44628. }
  44629. ,
  44630. Ci.CubeCamera.prototype = Object.create(Ci.Object3D.prototype),
  44631. Ci.CubeCamera.prototype.constructor = Ci.CubeCamera,
  44632. Ci.OrthographicCamera = function(e, t, i, n, r, o) {
  44633. Ci.Camera.call(this),
  44634. this.type = "OrthographicCamera",
  44635. this.zoom = 1,
  44636. this.left = e,
  44637. this.right = t,
  44638. this.top = i,
  44639. this.bottom = n,
  44640. this.near = void 0 !== r ? r : .1,
  44641. this.far = void 0 !== o ? o : 2e3,
  44642. this.updateProjectionMatrix()
  44643. }
  44644. ,
  44645. Ci.OrthographicCamera.prototype = Object.create(Ci.Camera.prototype),
  44646. Ci.OrthographicCamera.prototype.constructor = Ci.OrthographicCamera,
  44647. Ci.OrthographicCamera.prototype.updateProjectionMatrix = function() {
  44648. var e = (this.right - this.left) / (2 * this.zoom)
  44649. , t = (this.top - this.bottom) / (2 * this.zoom)
  44650. , i = (this.right + this.left) / 2
  44651. , n = (this.top + this.bottom) / 2;
  44652. this.projectionMatrix.makeOrthographic(i - e, i + e, n + t, n - t, this.near, this.far)
  44653. }
  44654. ,
  44655. Ci.OrthographicCamera.prototype.copy = function(e) {
  44656. return Ci.Camera.prototype.copy.call(this, e),
  44657. this.left = e.left,
  44658. this.right = e.right,
  44659. this.top = e.top,
  44660. this.bottom = e.bottom,
  44661. this.near = e.near,
  44662. this.far = e.far,
  44663. this.zoom = e.zoom,
  44664. this
  44665. }
  44666. ,
  44667. Ci.OrthographicCamera.prototype.toJSON = function(e) {
  44668. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  44669. return t.object.zoom = this.zoom,
  44670. t.object.left = this.left,
  44671. t.object.right = this.right,
  44672. t.object.top = this.top,
  44673. t.object.bottom = this.bottom,
  44674. t.object.near = this.near,
  44675. t.object.far = this.far,
  44676. t
  44677. }
  44678. ,
  44679. Ci.PerspectiveCamera = function(e, t, i, n) {
  44680. Ci.Camera.call(this),
  44681. this.type = "PerspectiveCamera",
  44682. this.focalLength = 10,
  44683. this.zoom = 1,
  44684. this.fov = void 0 !== e ? e : 50,
  44685. this.aspect = void 0 !== t ? t : 1,
  44686. this.near = void 0 !== i ? i : .1,
  44687. this.far = void 0 !== n ? n : 2e3,
  44688. this.updateProjectionMatrix()
  44689. }
  44690. ,
  44691. Ci.PerspectiveCamera.prototype = Object.create(Ci.Camera.prototype),
  44692. Ci.PerspectiveCamera.prototype.constructor = Ci.PerspectiveCamera,
  44693. Ci.PerspectiveCamera.prototype.setLens = function(e, t) {
  44694. void 0 === t && (t = 24),
  44695. this.fov = 2 * Ci.Math.radToDeg(Math.atan(t / (2 * e))),
  44696. this.updateProjectionMatrix()
  44697. }
  44698. ,
  44699. Ci.PerspectiveCamera.prototype.setViewOffset = function(e, t, i, n, r, o) {
  44700. this.fullWidth = e,
  44701. this.fullHeight = t,
  44702. this.x = i,
  44703. this.y = n,
  44704. this.width = r,
  44705. this.height = o,
  44706. this.updateProjectionMatrix()
  44707. }
  44708. ,
  44709. Ci.PerspectiveCamera.prototype.updateProjectionMatrix = function() {
  44710. var e = Ci.Math.radToDeg(2 * Math.atan(Math.tan(.5 * Ci.Math.degToRad(this.fov)) / this.zoom));
  44711. if (this.fullWidth) {
  44712. var t = this.fullWidth / this.fullHeight
  44713. , i = Math.tan(Ci.Math.degToRad(.5 * e)) * this.near
  44714. , n = -i
  44715. , r = t * n
  44716. , o = t * i
  44717. , a = Math.abs(o - r)
  44718. , s = Math.abs(i - n);
  44719. 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)
  44720. } else
  44721. this.projectionMatrix.makePerspective(e, this.aspect, this.near, this.far)
  44722. }
  44723. ,
  44724. Ci.PerspectiveCamera.prototype.copy = function(e) {
  44725. return Ci.Camera.prototype.copy.call(this, e),
  44726. this.focalLength = e.focalLength,
  44727. this.zoom = e.zoom,
  44728. this.fov = e.fov,
  44729. this.aspect = e.aspect,
  44730. this.near = e.near,
  44731. this.far = e.far,
  44732. this
  44733. }
  44734. ,
  44735. Ci.PerspectiveCamera.prototype.toJSON = function(e) {
  44736. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  44737. return t.object.focalLength = this.focalLength,
  44738. t.object.zoom = this.zoom,
  44739. t.object.fov = this.fov,
  44740. t.object.aspect = this.aspect,
  44741. t.object.near = this.near,
  44742. t.object.far = this.far,
  44743. t
  44744. }
  44745. ,
  44746. Ci.StereoCamera = function() {
  44747. this.type = "StereoCamera",
  44748. this.aspect = 1,
  44749. this.cameraL = new Ci.PerspectiveCamera,
  44750. this.cameraL.layers.enable(1),
  44751. this.cameraL.matrixAutoUpdate = !1,
  44752. this.cameraR = new Ci.PerspectiveCamera,
  44753. this.cameraR.layers.enable(2),
  44754. this.cameraR.matrixAutoUpdate = !1
  44755. }
  44756. ,
  44757. Ci.StereoCamera.prototype = {
  44758. constructor: Ci.StereoCamera,
  44759. update: (Xe = new Ci.Matrix4,
  44760. Ze = new Ci.Matrix4,
  44761. function(e) {
  44762. if (Ge !== e.focalLength || We !== e.fov || je !== e.aspect * this.aspect || Ye !== e.near || qe !== e.far) {
  44763. Ge = e.focalLength,
  44764. We = e.fov,
  44765. je = e.aspect * this.aspect,
  44766. Ye = e.near,
  44767. qe = e.far;
  44768. var t, i, n = e.projectionMatrix.clone(), r = .032 * Ye / Ge, o = Ye * Math.tan(Ci.Math.degToRad(.5 * We));
  44769. Ze.elements[12] = -.032,
  44770. Xe.elements[12] = .032,
  44771. t = -o * je + r,
  44772. i = o * je + r,
  44773. n.elements[0] = 2 * Ye / (i - t),
  44774. n.elements[8] = (i + t) / (i - t),
  44775. this.cameraL.projectionMatrix.copy(n),
  44776. t = -o * je - r,
  44777. i = o * je - r,
  44778. n.elements[0] = 2 * Ye / (i - t),
  44779. n.elements[8] = (i + t) / (i - t),
  44780. this.cameraR.projectionMatrix.copy(n)
  44781. }
  44782. this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(Ze),
  44783. this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(Xe)
  44784. }
  44785. )
  44786. },
  44787. Ci.Light = function(e, t) {
  44788. Ci.Object3D.call(this),
  44789. this.type = "Light",
  44790. this.color = new Ci.Color(e),
  44791. this.intensity = void 0 !== t ? t : 1,
  44792. this.receiveShadow = void 0
  44793. }
  44794. ,
  44795. Ci.Light.prototype = Object.create(Ci.Object3D.prototype),
  44796. Ci.Light.prototype.constructor = Ci.Light,
  44797. Ci.Light.prototype.copy = function(e) {
  44798. return Ci.Object3D.prototype.copy.call(this, e),
  44799. this.color.copy(e.color),
  44800. this.intensity = e.intensity,
  44801. this
  44802. }
  44803. ,
  44804. Ci.Light.prototype.toJSON = function(e) {
  44805. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  44806. return t.object.color = this.color.getHex(),
  44807. t.object.intensity = this.intensity,
  44808. void 0 !== this.groundColor && (t.object.groundColor = this.groundColor.getHex()),
  44809. void 0 !== this.distance && (t.object.distance = this.distance),
  44810. void 0 !== this.angle && (t.object.angle = this.angle),
  44811. void 0 !== this.decay && (t.object.decay = this.decay),
  44812. void 0 !== this.penumbra && (t.object.penumbra = this.penumbra),
  44813. t
  44814. }
  44815. ,
  44816. Ci.LightShadow = function(e) {
  44817. this.camera = e,
  44818. this.bias = 0,
  44819. this.radius = 1,
  44820. this.mapSize = new Ci.Vector2(512,512),
  44821. this.map = null,
  44822. this.matrix = new Ci.Matrix4
  44823. }
  44824. ,
  44825. Ci.LightShadow.prototype = {
  44826. constructor: Ci.LightShadow,
  44827. copy: function(e) {
  44828. return this.camera = e.camera.clone(),
  44829. this.bias = e.bias,
  44830. this.radius = e.radius,
  44831. this.mapSize.copy(e.mapSize),
  44832. this
  44833. },
  44834. clone: function() {
  44835. return (new this.constructor).copy(this)
  44836. }
  44837. },
  44838. Ci.AmbientLight = function(e, t) {
  44839. Ci.Light.call(this, e, t),
  44840. this.type = "AmbientLight",
  44841. this.castShadow = void 0
  44842. }
  44843. ,
  44844. Ci.AmbientLight.prototype = Object.create(Ci.Light.prototype),
  44845. Ci.AmbientLight.prototype.constructor = Ci.AmbientLight,
  44846. Ci.DirectionalLight = function(e, t) {
  44847. Ci.Light.call(this, e, t),
  44848. this.type = "DirectionalLight",
  44849. this.position.set(0, 1, 0),
  44850. this.updateMatrix(),
  44851. this.target = new Ci.Object3D,
  44852. this.shadow = new Ci.LightShadow(new Ci.OrthographicCamera(-5,5,5,-5,.5,500))
  44853. }
  44854. ,
  44855. Ci.DirectionalLight.prototype = Object.create(Ci.Light.prototype),
  44856. Ci.DirectionalLight.prototype.constructor = Ci.DirectionalLight,
  44857. Ci.DirectionalLight.prototype.copy = function(e) {
  44858. return Ci.Light.prototype.copy.call(this, e),
  44859. this.target = e.target.clone(),
  44860. this.shadow = e.shadow.clone(),
  44861. this
  44862. }
  44863. ,
  44864. Ci.HemisphereLight = function(e, t, i) {
  44865. Ci.Light.call(this, e, i),
  44866. this.type = "HemisphereLight",
  44867. this.castShadow = void 0,
  44868. this.position.set(0, 1, 0),
  44869. this.updateMatrix(),
  44870. this.groundColor = new Ci.Color(t)
  44871. }
  44872. ,
  44873. Ci.HemisphereLight.prototype = Object.create(Ci.Light.prototype),
  44874. Ci.HemisphereLight.prototype.constructor = Ci.HemisphereLight,
  44875. Ci.HemisphereLight.prototype.copy = function(e) {
  44876. return Ci.Light.prototype.copy.call(this, e),
  44877. this.groundColor.copy(e.groundColor),
  44878. this
  44879. }
  44880. ,
  44881. Ci.PointLight = function(e, t, i, n) {
  44882. Ci.Light.call(this, e, t),
  44883. this.type = "PointLight",
  44884. this.distance = void 0 !== i ? i : 0,
  44885. this.decay = void 0 !== n ? n : 1,
  44886. this.shadow = new Ci.LightShadow(new Ci.PerspectiveCamera(90,1,.5,500))
  44887. }
  44888. ,
  44889. Ci.PointLight.prototype = Object.create(Ci.Light.prototype),
  44890. Ci.PointLight.prototype.constructor = Ci.PointLight,
  44891. Object.defineProperty(Ci.PointLight.prototype, "power", {
  44892. get: function() {
  44893. return 4 * this.intensity * Math.PI
  44894. },
  44895. set: function(e) {
  44896. this.intensity = e / (4 * Math.PI)
  44897. }
  44898. }),
  44899. Ci.PointLight.prototype.copy = function(e) {
  44900. return Ci.Light.prototype.copy.call(this, e),
  44901. this.distance = e.distance,
  44902. this.decay = e.decay,
  44903. this.shadow = e.shadow.clone(),
  44904. this
  44905. }
  44906. ,
  44907. Ci.SpotLight = function(e, t, i, n, r, o) {
  44908. Ci.Light.call(this, e, t),
  44909. this.type = "SpotLight",
  44910. this.position.set(0, 1, 0),
  44911. this.updateMatrix(),
  44912. this.target = new Ci.Object3D,
  44913. this.distance = void 0 !== i ? i : 0,
  44914. this.angle = void 0 !== n ? n : Math.PI / 3,
  44915. this.penumbra = void 0 !== r ? r : 0,
  44916. this.decay = void 0 !== o ? o : 1,
  44917. this.shadow = new Ci.LightShadow(new Ci.PerspectiveCamera(50,1,.5,500))
  44918. }
  44919. ,
  44920. Ci.SpotLight.prototype = Object.create(Ci.Light.prototype),
  44921. Ci.SpotLight.prototype.constructor = Ci.SpotLight,
  44922. Object.defineProperty(Ci.SpotLight.prototype, "power", {
  44923. get: function() {
  44924. return this.intensity * Math.PI
  44925. },
  44926. set: function(e) {
  44927. this.intensity = e / Math.PI
  44928. }
  44929. }),
  44930. Ci.SpotLight.prototype.copy = function(e) {
  44931. return Ci.Light.prototype.copy.call(this, e),
  44932. this.distance = e.distance,
  44933. this.angle = e.angle,
  44934. this.penumbra = e.penumbra,
  44935. this.decay = e.decay,
  44936. this.target = e.target.clone(),
  44937. this.shadow = e.shadow.clone(),
  44938. this
  44939. }
  44940. ,
  44941. Ci.Cache = {
  44942. enabled: !1,
  44943. files: {},
  44944. add: function(e, t) {
  44945. !1 !== this.enabled && (this.files[e] = t)
  44946. },
  44947. get: function(e) {
  44948. if (!1 !== this.enabled)
  44949. return this.files[e]
  44950. },
  44951. remove: function(e) {
  44952. delete this.files[e]
  44953. },
  44954. clear: function() {
  44955. this.files = {}
  44956. }
  44957. },
  44958. Ci.Loader = function() {
  44959. this.onLoadStart = function() {}
  44960. ,
  44961. this.onLoadProgress = function() {}
  44962. ,
  44963. this.onLoadComplete = function() {}
  44964. }
  44965. ,
  44966. Ci.Loader.prototype = {
  44967. constructor: Ci.Loader,
  44968. crossOrigin: void 0,
  44969. extractUrlBase: function(e) {
  44970. var t = e.split("/");
  44971. return 1 === t.length ? "./" : (t.pop(),
  44972. t.join("/") + "/")
  44973. },
  44974. initMaterials: function(e, t, i) {
  44975. for (var n = [], r = 0; r < e.length; ++r)
  44976. n[r] = this.createMaterial(e[r], t, i);
  44977. return n
  44978. },
  44979. createMaterial: function(e, c, h) {
  44980. function t(e, t, i, n, r) {
  44981. var o, a = c + e, s = Ci.Loader.Handlers.get(a);
  44982. o = null !== s ? s.load(a) : (He.setCrossOrigin(h),
  44983. He.load(a)),
  44984. void 0 !== t && (o.repeat.fromArray(t),
  44985. 1 !== t[0] && (o.wrapS = Ci.RepeatWrapping),
  44986. 1 !== t[1] && (o.wrapT = Ci.RepeatWrapping)),
  44987. void 0 !== i && o.offset.fromArray(i),
  44988. void 0 !== n && ("repeat" === n[0] && (o.wrapS = Ci.RepeatWrapping),
  44989. "mirror" === n[0] && (o.wrapS = Ci.MirroredRepeatWrapping),
  44990. "repeat" === n[1] && (o.wrapT = Ci.RepeatWrapping),
  44991. "mirror" === n[1] && (o.wrapT = Ci.MirroredRepeatWrapping)),
  44992. void 0 !== r && (o.anisotropy = r);
  44993. var l = Ci.Math.generateUUID();
  44994. return u[l] = o,
  44995. l
  44996. }
  44997. void 0 === Ue && (Ue = new Ci.Color),
  44998. void 0 === He && (He = new Ci.TextureLoader),
  44999. void 0 === ze && (ze = new Ci.MaterialLoader);
  45000. var u = {}
  45001. , i = {
  45002. uuid: Ci.Math.generateUUID(),
  45003. type: "MeshLambertMaterial"
  45004. };
  45005. for (var n in e) {
  45006. var r = e[n];
  45007. switch (n) {
  45008. case "DbgColor":
  45009. case "DbgIndex":
  45010. case "opticalDensity":
  45011. case "illumination":
  45012. break;
  45013. case "DbgName":
  45014. i.name = r;
  45015. break;
  45016. case "blending":
  45017. i.blending = Ci[r];
  45018. break;
  45019. case "colorAmbient":
  45020. case "mapAmbient":
  45021. console.warn("THREE.Loader.createMaterial:", n, "is no longer supported.");
  45022. break;
  45023. case "colorDiffuse":
  45024. i.color = Ue.fromArray(r).getHex();
  45025. break;
  45026. case "colorSpecular":
  45027. i.specular = Ue.fromArray(r).getHex();
  45028. break;
  45029. case "colorEmissive":
  45030. i.emissive = Ue.fromArray(r).getHex();
  45031. break;
  45032. case "specularCoef":
  45033. i.shininess = r;
  45034. break;
  45035. case "shading":
  45036. "basic" === r.toLowerCase() && (i.type = "MeshBasicMaterial"),
  45037. "phong" === r.toLowerCase() && (i.type = "MeshPhongMaterial");
  45038. break;
  45039. case "mapDiffuse":
  45040. i.map = t(r, e.mapDiffuseRepeat, e.mapDiffuseOffset, e.mapDiffuseWrap, e.mapDiffuseAnisotropy);
  45041. break;
  45042. case "mapDiffuseRepeat":
  45043. case "mapDiffuseOffset":
  45044. case "mapDiffuseWrap":
  45045. case "mapDiffuseAnisotropy":
  45046. break;
  45047. case "mapLight":
  45048. i.lightMap = t(r, e.mapLightRepeat, e.mapLightOffset, e.mapLightWrap, e.mapLightAnisotropy);
  45049. break;
  45050. case "mapLightRepeat":
  45051. case "mapLightOffset":
  45052. case "mapLightWrap":
  45053. case "mapLightAnisotropy":
  45054. break;
  45055. case "mapAO":
  45056. i.aoMap = t(r, e.mapAORepeat, e.mapAOOffset, e.mapAOWrap, e.mapAOAnisotropy);
  45057. break;
  45058. case "mapAORepeat":
  45059. case "mapAOOffset":
  45060. case "mapAOWrap":
  45061. case "mapAOAnisotropy":
  45062. break;
  45063. case "mapBump":
  45064. i.bumpMap = t(r, e.mapBumpRepeat, e.mapBumpOffset, e.mapBumpWrap, e.mapBumpAnisotropy);
  45065. break;
  45066. case "mapBumpScale":
  45067. i.bumpScale = r;
  45068. break;
  45069. case "mapBumpRepeat":
  45070. case "mapBumpOffset":
  45071. case "mapBumpWrap":
  45072. case "mapBumpAnisotropy":
  45073. break;
  45074. case "mapNormal":
  45075. i.normalMap = t(r, e.mapNormalRepeat, e.mapNormalOffset, e.mapNormalWrap, e.mapNormalAnisotropy);
  45076. break;
  45077. case "mapNormalFactor":
  45078. i.normalScale = [r, r];
  45079. break;
  45080. case "mapNormalRepeat":
  45081. case "mapNormalOffset":
  45082. case "mapNormalWrap":
  45083. case "mapNormalAnisotropy":
  45084. break;
  45085. case "mapSpecular":
  45086. i.specularMap = t(r, e.mapSpecularRepeat, e.mapSpecularOffset, e.mapSpecularWrap, e.mapSpecularAnisotropy);
  45087. break;
  45088. case "mapSpecularRepeat":
  45089. case "mapSpecularOffset":
  45090. case "mapSpecularWrap":
  45091. case "mapSpecularAnisotropy":
  45092. break;
  45093. case "mapAlpha":
  45094. i.alphaMap = t(r, e.mapAlphaRepeat, e.mapAlphaOffset, e.mapAlphaWrap, e.mapAlphaAnisotropy);
  45095. break;
  45096. case "mapAlphaRepeat":
  45097. case "mapAlphaOffset":
  45098. case "mapAlphaWrap":
  45099. case "mapAlphaAnisotropy":
  45100. break;
  45101. case "flipSided":
  45102. i.side = Ci.BackSide;
  45103. break;
  45104. case "doubleSided":
  45105. i.side = Ci.DoubleSide;
  45106. break;
  45107. case "transparency":
  45108. console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),
  45109. i.opacity = r;
  45110. break;
  45111. case "depthTest":
  45112. case "depthWrite":
  45113. case "colorWrite":
  45114. case "opacity":
  45115. case "reflectivity":
  45116. case "transparent":
  45117. case "visible":
  45118. case "wireframe":
  45119. i[n] = r;
  45120. break;
  45121. case "vertexColors":
  45122. !0 === r && (i.vertexColors = Ci.VertexColors),
  45123. "face" === r && (i.vertexColors = Ci.FaceColors);
  45124. break;
  45125. default:
  45126. console.error("THREE.Loader.createMaterial: Unsupported", n, r)
  45127. }
  45128. }
  45129. return "MeshBasicMaterial" === i.type && delete i.emissive,
  45130. "MeshPhongMaterial" !== i.type && delete i.specular,
  45131. i.opacity < 1 && (i.transparent = !0),
  45132. ze.setTextures(u),
  45133. ze.parse(i)
  45134. }
  45135. },
  45136. Ci.Loader.Handlers = {
  45137. handlers: [],
  45138. add: function(e, t) {
  45139. this.handlers.push(e, t)
  45140. },
  45141. get: function(e) {
  45142. for (var t = this.handlers, i = 0, n = t.length; i < n; i += 2) {
  45143. var r = t[i]
  45144. , o = t[i + 1];
  45145. if (r.test(e))
  45146. return o
  45147. }
  45148. return null
  45149. }
  45150. },
  45151. Ci.XHRLoader = function(e) {
  45152. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45153. }
  45154. ,
  45155. Ci.XHRLoader.prototype = {
  45156. constructor: Ci.XHRLoader,
  45157. load: function(i, n, t, r) {
  45158. void 0 !== this.path && (i = this.path + i);
  45159. var o = this
  45160. , e = Ci.Cache.get(i);
  45161. if (void 0 !== e)
  45162. return n && setTimeout(function() {
  45163. n(e)
  45164. }, 0),
  45165. e;
  45166. var a = new XMLHttpRequest;
  45167. return a.overrideMimeType("text/plain"),
  45168. a.open("GET", i, !0),
  45169. a.addEventListener("load", function(e) {
  45170. var t = e.target.response;
  45171. Ci.Cache.add(i, t),
  45172. 200 === this.status ? (n && n(t),
  45173. o.manager.itemEnd(i)) : 0 === this.status ? (console.warn("THREE.XHRLoader: HTTP Status 0 received."),
  45174. n && n(t),
  45175. o.manager.itemEnd(i)) : (r && r(e),
  45176. o.manager.itemError(i))
  45177. }, !1),
  45178. void 0 !== t && a.addEventListener("progress", function(e) {
  45179. t(e)
  45180. }, !1),
  45181. a.addEventListener("error", function(e) {
  45182. r && r(e),
  45183. o.manager.itemError(i)
  45184. }, !1),
  45185. void 0 !== this.responseType && (a.responseType = this.responseType),
  45186. void 0 !== this.withCredentials && (a.withCredentials = this.withCredentials),
  45187. a.send(null),
  45188. o.manager.itemStart(i),
  45189. a
  45190. },
  45191. setPath: function(e) {
  45192. this.path = e
  45193. },
  45194. setResponseType: function(e) {
  45195. this.responseType = e
  45196. },
  45197. setWithCredentials: function(e) {
  45198. this.withCredentials = e
  45199. }
  45200. },
  45201. Ci.FontLoader = function(e) {
  45202. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45203. }
  45204. ,
  45205. Ci.FontLoader.prototype = {
  45206. constructor: Ci.FontLoader,
  45207. load: function(e, t, i, n) {
  45208. new Ci.XHRLoader(this.manager).load(e, function(e) {
  45209. t(new Ci.Font(JSON.parse(e.substring(65, e.length - 2))))
  45210. }, i, n)
  45211. }
  45212. },
  45213. Ci.ImageLoader = function(e) {
  45214. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45215. }
  45216. ,
  45217. Ci.ImageLoader.prototype = {
  45218. constructor: Ci.ImageLoader,
  45219. load: function(t, i, n, r) {
  45220. void 0 !== this.path && (t = this.path + t);
  45221. var o = this
  45222. , e = Ci.Cache.get(t);
  45223. if (void 0 !== e)
  45224. return o.manager.itemStart(t),
  45225. i ? setTimeout(function() {
  45226. i(e),
  45227. o.manager.itemEnd(t)
  45228. }, 0) : o.manager.itemEnd(t),
  45229. e;
  45230. var a = document.createElement("img");
  45231. return a.addEventListener("load", function(e) {
  45232. Ci.Cache.add(t, this),
  45233. i && i(this),
  45234. o.manager.itemEnd(t)
  45235. }, !1),
  45236. void 0 !== n && a.addEventListener("progress", function(e) {
  45237. n(e)
  45238. }, !1),
  45239. a.addEventListener("error", function(e) {
  45240. r && r(e),
  45241. o.manager.itemError(t)
  45242. }, !1),
  45243. void 0 !== this.crossOrigin && (a.crossOrigin = this.crossOrigin),
  45244. o.manager.itemStart(t),
  45245. a.src = t,
  45246. a
  45247. },
  45248. setCrossOrigin: function(e) {
  45249. this.crossOrigin = e
  45250. },
  45251. setPath: function(e) {
  45252. this.path = e
  45253. }
  45254. },
  45255. Ci.JSONLoader = function(e) {
  45256. "boolean" == typeof e && (console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),
  45257. e = void 0),
  45258. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  45259. this.withCredentials = !1
  45260. }
  45261. ,
  45262. Ci.JSONLoader.prototype = {
  45263. constructor: Ci.JSONLoader,
  45264. get statusDomElement() {
  45265. return void 0 === this._statusDomElement && (this._statusDomElement = document.createElement("div")),
  45266. console.warn("THREE.JSONLoader: .statusDomElement has been removed."),
  45267. this._statusDomElement
  45268. },
  45269. load: function(o, a, e, t) {
  45270. var s = this
  45271. , l = this.texturePath && "string" == typeof this.texturePath ? this.texturePath : Ci.Loader.prototype.extractUrlBase(o)
  45272. , i = new Ci.XHRLoader(this.manager);
  45273. i.setWithCredentials(this.withCredentials),
  45274. i.load(o, function(e) {
  45275. var t = JSON.parse(e)
  45276. , i = t.metadata;
  45277. if (void 0 !== i) {
  45278. var n = i.type;
  45279. if (void 0 !== n) {
  45280. if ("object" === n.toLowerCase())
  45281. return void console.error("THREE.JSONLoader: " + o + " should be loaded with THREE.ObjectLoader instead.");
  45282. if ("scene" === n.toLowerCase())
  45283. return void console.error("THREE.JSONLoader: " + o + " should be loaded with THREE.SceneLoader instead.")
  45284. }
  45285. }
  45286. var r = s.parse(t, l);
  45287. a(r.geometry, r.materials)
  45288. }, e, t)
  45289. },
  45290. setTexturePath: function(e) {
  45291. this.texturePath = e
  45292. },
  45293. parse: function(D, e) {
  45294. var N = new Ci.Geometry
  45295. , t = void 0 !== D.scale ? 1 / D.scale : 1;
  45296. if (function(e) {
  45297. function t(e, t) {
  45298. return e & 1 << t
  45299. }
  45300. 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;
  45301. if (void 0 !== D.uvs) {
  45302. for (i = 0; i < D.uvs.length; i++)
  45303. D.uvs[i].length && L++;
  45304. for (i = 0; i < L; i++)
  45305. N.faceVertexUvs[i] = []
  45306. }
  45307. for (o = 0,
  45308. a = R.length; o < a; )
  45309. (A = new Ci.Vector3).x = R[o++] * e,
  45310. A.y = R[o++] * e,
  45311. A.z = R[o++] * e,
  45312. N.vertices.push(A);
  45313. for (o = 0,
  45314. a = M.length; o < a; )
  45315. if (d = t(u = M[o++], 0),
  45316. p = t(u, 1),
  45317. f = t(u, 3),
  45318. g = t(u, 4),
  45319. m = t(u, 5),
  45320. v = t(u, 6),
  45321. y = t(u, 7),
  45322. d) {
  45323. if ((I = new Ci.Face3).a = M[o],
  45324. I.b = M[o + 1],
  45325. I.c = M[o + 3],
  45326. (E = new Ci.Face3).a = M[o + 1],
  45327. E.b = M[o + 2],
  45328. E.c = M[o + 3],
  45329. o += 4,
  45330. p && (h = M[o++],
  45331. I.materialIndex = h,
  45332. E.materialIndex = h),
  45333. r = N.faces.length,
  45334. f)
  45335. for (i = 0; i < L; i++)
  45336. for (w = D.uvs[i],
  45337. N.faceVertexUvs[i][r] = [],
  45338. N.faceVertexUvs[i][r + 1] = [],
  45339. n = 0; n < 4; n++)
  45340. x = w[2 * (c = M[o++])],
  45341. S = w[2 * c + 1],
  45342. T = new Ci.Vector2(x,S),
  45343. 2 !== n && N.faceVertexUvs[i][r].push(T),
  45344. 0 !== n && N.faceVertexUvs[i][r + 1].push(T);
  45345. if (g && (l = 3 * M[o++],
  45346. I.normal.set(P[l++], P[l++], P[l]),
  45347. E.normal.copy(I.normal)),
  45348. m)
  45349. for (i = 0; i < 4; i++)
  45350. l = 3 * M[o++],
  45351. b = new Ci.Vector3(P[l++],P[l++],P[l]),
  45352. 2 !== i && I.vertexNormals.push(b),
  45353. 0 !== i && E.vertexNormals.push(b);
  45354. if (v && (_ = O[s = M[o++]],
  45355. I.color.setHex(_),
  45356. E.color.setHex(_)),
  45357. y)
  45358. for (i = 0; i < 4; i++)
  45359. _ = O[s = M[o++]],
  45360. 2 !== i && I.vertexColors.push(new Ci.Color(_)),
  45361. 0 !== i && E.vertexColors.push(new Ci.Color(_));
  45362. N.faces.push(I),
  45363. N.faces.push(E)
  45364. } else {
  45365. if ((C = new Ci.Face3).a = M[o++],
  45366. C.b = M[o++],
  45367. C.c = M[o++],
  45368. p && (h = M[o++],
  45369. C.materialIndex = h),
  45370. r = N.faces.length,
  45371. f)
  45372. for (i = 0; i < L; i++)
  45373. for (w = D.uvs[i],
  45374. N.faceVertexUvs[i][r] = [],
  45375. n = 0; n < 3; n++)
  45376. x = w[2 * (c = M[o++])],
  45377. S = w[2 * c + 1],
  45378. T = new Ci.Vector2(x,S),
  45379. N.faceVertexUvs[i][r].push(T);
  45380. if (g && (l = 3 * M[o++],
  45381. C.normal.set(P[l++], P[l++], P[l])),
  45382. m)
  45383. for (i = 0; i < 3; i++)
  45384. l = 3 * M[o++],
  45385. b = new Ci.Vector3(P[l++],P[l++],P[l]),
  45386. C.vertexNormals.push(b);
  45387. if (v && (s = M[o++],
  45388. C.color.setHex(O[s])),
  45389. y)
  45390. for (i = 0; i < 3; i++)
  45391. s = M[o++],
  45392. C.vertexColors.push(new Ci.Color(O[s]));
  45393. N.faces.push(C)
  45394. }
  45395. }(t),
  45396. function() {
  45397. var e = void 0 !== D.influencesPerVertex ? D.influencesPerVertex : 2;
  45398. if (D.skinWeights)
  45399. for (var t = 0, i = D.skinWeights.length; t < i; t += e) {
  45400. var n = D.skinWeights[t]
  45401. , r = 1 < e ? D.skinWeights[t + 1] : 0
  45402. , o = 2 < e ? D.skinWeights[t + 2] : 0
  45403. , a = 3 < e ? D.skinWeights[t + 3] : 0;
  45404. N.skinWeights.push(new Ci.Vector4(n,r,o,a))
  45405. }
  45406. if (D.skinIndices)
  45407. for (t = 0,
  45408. i = D.skinIndices.length; t < i; t += e) {
  45409. var s = D.skinIndices[t]
  45410. , l = 1 < e ? D.skinIndices[t + 1] : 0
  45411. , c = 2 < e ? D.skinIndices[t + 2] : 0
  45412. , h = 3 < e ? D.skinIndices[t + 3] : 0;
  45413. N.skinIndices.push(new Ci.Vector4(s,l,c,h))
  45414. }
  45415. N.bones = D.bones,
  45416. 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.")
  45417. }(),
  45418. function(e) {
  45419. if (void 0 !== D.morphTargets)
  45420. for (var t = 0, i = D.morphTargets.length; t < i; t++) {
  45421. N.morphTargets[t] = {},
  45422. N.morphTargets[t].name = D.morphTargets[t].name,
  45423. N.morphTargets[t].vertices = [];
  45424. for (var n = N.morphTargets[t].vertices, r = D.morphTargets[t].vertices, o = 0, a = r.length; o < a; o += 3) {
  45425. var s = new Ci.Vector3;
  45426. s.x = r[o] * e,
  45427. s.y = r[o + 1] * e,
  45428. s.z = r[o + 2] * e,
  45429. n.push(s)
  45430. }
  45431. }
  45432. if (void 0 !== D.morphColors && 0 < D.morphColors.length) {
  45433. console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');
  45434. var l = N.faces
  45435. , c = D.morphColors[0].colors;
  45436. for (t = 0,
  45437. i = l.length; t < i; t++)
  45438. l[t].color.fromArray(c, 3 * t)
  45439. }
  45440. }(t),
  45441. function() {
  45442. var e = []
  45443. , t = [];
  45444. void 0 !== D.animation && t.push(D.animation),
  45445. void 0 !== D.animations && (D.animations.length ? t = t.concat(D.animations) : t.push(D.animations));
  45446. for (var i = 0; i < t.length; i++) {
  45447. var n = Ci.AnimationClip.parseAnimation(t[i], N.bones);
  45448. n && e.push(n)
  45449. }
  45450. if (N.morphTargets) {
  45451. var r = Ci.AnimationClip.CreateClipsFromMorphTargetSequences(N.morphTargets, 10);
  45452. e = e.concat(r)
  45453. }
  45454. 0 < e.length && (N.animations = e)
  45455. }(),
  45456. N.computeFaceNormals(),
  45457. N.computeBoundingSphere(),
  45458. void 0 === D.materials || 0 === D.materials.length)
  45459. return {
  45460. geometry: N
  45461. };
  45462. var i = Ci.Loader.prototype.initMaterials(D.materials, e, this.crossOrigin);
  45463. return {
  45464. geometry: N,
  45465. materials: i
  45466. }
  45467. }
  45468. },
  45469. Ci.LoadingManager = function(e, t, i) {
  45470. var n = this
  45471. , r = !1
  45472. , o = 0
  45473. , a = 0;
  45474. this.onStart = void 0,
  45475. this.onLoad = e,
  45476. this.onProgress = t,
  45477. this.onError = i,
  45478. this.itemStart = function(e) {
  45479. a++,
  45480. !1 === r && void 0 !== n.onStart && n.onStart(e, o, a),
  45481. r = !0
  45482. }
  45483. ,
  45484. this.itemEnd = function(e) {
  45485. o++,
  45486. void 0 !== n.onProgress && n.onProgress(e, o, a),
  45487. o === a && (r = !1,
  45488. void 0 !== n.onLoad && n.onLoad())
  45489. }
  45490. ,
  45491. this.itemError = function(e) {
  45492. void 0 !== n.onError && n.onError(e)
  45493. }
  45494. }
  45495. ,
  45496. Ci.DefaultLoadingManager = new Ci.LoadingManager,
  45497. Ci.BufferGeometryLoader = function(e) {
  45498. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45499. }
  45500. ,
  45501. Ci.BufferGeometryLoader.prototype = {
  45502. constructor: Ci.BufferGeometryLoader,
  45503. load: function(e, t, i, n) {
  45504. var r = this;
  45505. new Ci.XHRLoader(r.manager).load(e, function(e) {
  45506. t(r.parse(JSON.parse(e)))
  45507. }, i, n)
  45508. },
  45509. parse: function(e) {
  45510. var t = new Ci.BufferGeometry
  45511. , i = e.data.index
  45512. , n = {
  45513. Int8Array: Int8Array,
  45514. Uint8Array: Uint8Array,
  45515. Uint8ClampedArray: Uint8ClampedArray,
  45516. Int16Array: Int16Array,
  45517. Uint16Array: Uint16Array,
  45518. Int32Array: Int32Array,
  45519. Uint32Array: Uint32Array,
  45520. Float32Array: Float32Array,
  45521. Float64Array: Float64Array
  45522. };
  45523. if (void 0 !== i) {
  45524. var r = new n[i.type](i.array);
  45525. t.setIndex(new Ci.BufferAttribute(r,1))
  45526. }
  45527. var o = e.data.attributes;
  45528. for (var a in o) {
  45529. var s = o[a];
  45530. r = new n[s.type](s.array);
  45531. t.addAttribute(a, new Ci.BufferAttribute(r,s.itemSize))
  45532. }
  45533. var l = e.data.groups || e.data.drawcalls || e.data.offsets;
  45534. if (void 0 !== l)
  45535. for (var c = 0, h = l.length; c !== h; ++c) {
  45536. var u = l[c];
  45537. t.addGroup(u.start, u.count, u.materialIndex)
  45538. }
  45539. var d = e.data.boundingSphere;
  45540. if (void 0 !== d) {
  45541. var p = new Ci.Vector3;
  45542. void 0 !== d.center && p.fromArray(d.center),
  45543. t.boundingSphere = new Ci.Sphere(p,d.radius)
  45544. }
  45545. return t
  45546. }
  45547. },
  45548. Ci.MaterialLoader = function(e) {
  45549. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  45550. this.textures = {}
  45551. }
  45552. ,
  45553. Ci.MaterialLoader.prototype = {
  45554. constructor: Ci.MaterialLoader,
  45555. load: function(e, t, i, n) {
  45556. var r = this;
  45557. new Ci.XHRLoader(r.manager).load(e, function(e) {
  45558. t(r.parse(JSON.parse(e)))
  45559. }, i, n)
  45560. },
  45561. setTextures: function(e) {
  45562. this.textures = e
  45563. },
  45564. getTexture: function(e) {
  45565. var t = this.textures;
  45566. return void 0 === t[e] && console.warn("THREE.MaterialLoader: Undefined texture", e),
  45567. t[e]
  45568. },
  45569. parse: function(e) {
  45570. var t = new Ci[e.type];
  45571. if (void 0 !== e.uuid && (t.uuid = e.uuid),
  45572. void 0 !== e.name && (t.name = e.name),
  45573. void 0 !== e.color && t.color.setHex(e.color),
  45574. void 0 !== e.roughness && (t.roughness = e.roughness),
  45575. void 0 !== e.metalness && (t.metalness = e.metalness),
  45576. void 0 !== e.emissive && t.emissive.setHex(e.emissive),
  45577. void 0 !== e.specular && t.specular.setHex(e.specular),
  45578. void 0 !== e.shininess && (t.shininess = e.shininess),
  45579. void 0 !== e.uniforms && (t.uniforms = e.uniforms),
  45580. void 0 !== e.vertexShader && (t.vertexShader = e.vertexShader),
  45581. void 0 !== e.fragmentShader && (t.fragmentShader = e.fragmentShader),
  45582. void 0 !== e.vertexColors && (t.vertexColors = e.vertexColors),
  45583. void 0 !== e.shading && (t.shading = e.shading),
  45584. void 0 !== e.blending && (t.blending = e.blending),
  45585. void 0 !== e.side && (t.side = e.side),
  45586. void 0 !== e.opacity && (t.opacity = e.opacity),
  45587. void 0 !== e.transparent && (t.transparent = e.transparent),
  45588. void 0 !== e.alphaTest && (t.alphaTest = e.alphaTest),
  45589. void 0 !== e.depthTest && (t.depthTest = e.depthTest),
  45590. void 0 !== e.depthWrite && (t.depthWrite = e.depthWrite),
  45591. void 0 !== e.colorWrite && (t.colorWrite = e.colorWrite),
  45592. void 0 !== e.wireframe && (t.wireframe = e.wireframe),
  45593. void 0 !== e.wireframeLinewidth && (t.wireframeLinewidth = e.wireframeLinewidth),
  45594. void 0 !== e.size && (t.size = e.size),
  45595. void 0 !== e.sizeAttenuation && (t.sizeAttenuation = e.sizeAttenuation),
  45596. void 0 !== e.map && (t.map = this.getTexture(e.map)),
  45597. void 0 !== e.alphaMap && (t.alphaMap = this.getTexture(e.alphaMap),
  45598. t.transparent = !0),
  45599. void 0 !== e.bumpMap && (t.bumpMap = this.getTexture(e.bumpMap)),
  45600. void 0 !== e.bumpScale && (t.bumpScale = e.bumpScale),
  45601. void 0 !== e.normalMap && (t.normalMap = this.getTexture(e.normalMap)),
  45602. void 0 !== e.normalScale) {
  45603. var i = e.normalScale;
  45604. !1 === Array.isArray(i) && (i = [i, i]),
  45605. t.normalScale = (new Ci.Vector2).fromArray(i)
  45606. }
  45607. if (void 0 !== e.displacementMap && (t.displacementMap = this.getTexture(e.displacementMap)),
  45608. void 0 !== e.displacementScale && (t.displacementScale = e.displacementScale),
  45609. void 0 !== e.displacementBias && (t.displacementBias = e.displacementBias),
  45610. void 0 !== e.roughnessMap && (t.roughnessMap = this.getTexture(e.roughnessMap)),
  45611. void 0 !== e.metalnessMap && (t.metalnessMap = this.getTexture(e.metalnessMap)),
  45612. void 0 !== e.emissiveMap && (t.emissiveMap = this.getTexture(e.emissiveMap)),
  45613. void 0 !== e.emissiveIntensity && (t.emissiveIntensity = e.emissiveIntensity),
  45614. void 0 !== e.specularMap && (t.specularMap = this.getTexture(e.specularMap)),
  45615. void 0 !== e.envMap && (t.envMap = this.getTexture(e.envMap),
  45616. t.combine = Ci.MultiplyOperation),
  45617. e.reflectivity && (t.reflectivity = e.reflectivity),
  45618. void 0 !== e.lightMap && (t.lightMap = this.getTexture(e.lightMap)),
  45619. void 0 !== e.lightMapIntensity && (t.lightMapIntensity = e.lightMapIntensity),
  45620. void 0 !== e.aoMap && (t.aoMap = this.getTexture(e.aoMap)),
  45621. void 0 !== e.aoMapIntensity && (t.aoMapIntensity = e.aoMapIntensity),
  45622. void 0 !== e.materials)
  45623. for (var n = 0, r = e.materials.length; n < r; n++)
  45624. t.materials.push(this.parse(e.materials[n]));
  45625. return t
  45626. }
  45627. },
  45628. Ci.ObjectLoader = function(e) {
  45629. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  45630. this.texturePath = ""
  45631. }
  45632. ,
  45633. Ci.ObjectLoader.prototype = {
  45634. constructor: Ci.ObjectLoader,
  45635. load: function(e, t, i, n) {
  45636. "" === this.texturePath && (this.texturePath = e.substring(0, e.lastIndexOf("/") + 1));
  45637. var r = this;
  45638. new Ci.XHRLoader(r.manager).load(e, function(e) {
  45639. r.parse(JSON.parse(e), t)
  45640. }, i, n)
  45641. },
  45642. setTexturePath: function(e) {
  45643. this.texturePath = e
  45644. },
  45645. setCrossOrigin: function(e) {
  45646. this.crossOrigin = e
  45647. },
  45648. parse: function(e, t) {
  45649. var i = this.parseGeometries(e.geometries)
  45650. , n = this.parseImages(e.images, function() {
  45651. void 0 !== t && t(a)
  45652. })
  45653. , r = this.parseTextures(e.textures, n)
  45654. , o = this.parseMaterials(e.materials, r)
  45655. , a = this.parseObject(e.object, i, o);
  45656. return e.animations && (a.animations = this.parseAnimations(e.animations)),
  45657. void 0 !== e.images && 0 !== e.images.length || void 0 !== t && t(a),
  45658. a
  45659. },
  45660. parseGeometries: function(e) {
  45661. var t = {};
  45662. if (void 0 !== e)
  45663. for (var i = new Ci.JSONLoader, n = new Ci.BufferGeometryLoader, r = 0, o = e.length; r < o; r++) {
  45664. var a, s = e[r];
  45665. switch (s.type) {
  45666. case "PlaneGeometry":
  45667. case "PlaneBufferGeometry":
  45668. a = new Ci[s.type](s.width,s.height,s.widthSegments,s.heightSegments);
  45669. break;
  45670. case "BoxGeometry":
  45671. case "BoxBufferGeometry":
  45672. case "CubeGeometry":
  45673. a = new Ci[s.type](s.width,s.height,s.depth,s.widthSegments,s.heightSegments,s.depthSegments);
  45674. break;
  45675. case "CircleGeometry":
  45676. case "CircleBufferGeometry":
  45677. a = new Ci[s.type](s.radius,s.segments,s.thetaStart,s.thetaLength);
  45678. break;
  45679. case "CylinderGeometry":
  45680. case "CylinderBufferGeometry":
  45681. a = new Ci[s.type](s.radiusTop,s.radiusBottom,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);
  45682. break;
  45683. case "SphereGeometry":
  45684. case "SphereBufferGeometry":
  45685. a = new Ci[s.type](s.radius,s.widthSegments,s.heightSegments,s.phiStart,s.phiLength,s.thetaStart,s.thetaLength);
  45686. break;
  45687. case "DodecahedronGeometry":
  45688. a = new Ci.DodecahedronGeometry(s.radius,s.detail);
  45689. break;
  45690. case "IcosahedronGeometry":
  45691. a = new Ci.IcosahedronGeometry(s.radius,s.detail);
  45692. break;
  45693. case "OctahedronGeometry":
  45694. a = new Ci.OctahedronGeometry(s.radius,s.detail);
  45695. break;
  45696. case "TetrahedronGeometry":
  45697. a = new Ci.TetrahedronGeometry(s.radius,s.detail);
  45698. break;
  45699. case "RingGeometry":
  45700. case "RingBufferGeometry":
  45701. a = new Ci[s.type](s.innerRadius,s.outerRadius,s.thetaSegments,s.phiSegments,s.thetaStart,s.thetaLength);
  45702. break;
  45703. case "TorusGeometry":
  45704. case "TorusBufferGeometry":
  45705. a = new Ci[s.type](s.radius,s.tube,s.radialSegments,s.tubularSegments,s.arc);
  45706. break;
  45707. case "TorusKnotGeometry":
  45708. case "TorusKnotBufferGeometry":
  45709. a = new Ci[s.type](s.radius,s.tube,s.tubularSegments,s.radialSegments,s.p,s.q);
  45710. break;
  45711. case "LatheGeometry":
  45712. a = new Ci.LatheGeometry(s.points,s.segments,s.phiStart,s.phiLength);
  45713. break;
  45714. case "BufferGeometry":
  45715. a = n.parse(s);
  45716. break;
  45717. case "Geometry":
  45718. a = i.parse(s.data, this.texturePath).geometry;
  45719. break;
  45720. default:
  45721. console.warn('THREE.ObjectLoader: Unsupported geometry type "' + s.type + '"');
  45722. continue
  45723. }
  45724. a.uuid = s.uuid,
  45725. void 0 !== s.name && (a.name = s.name),
  45726. t[s.uuid] = a
  45727. }
  45728. return t
  45729. },
  45730. parseMaterials: function(e, t) {
  45731. var i = {};
  45732. if (void 0 !== e) {
  45733. var n = new Ci.MaterialLoader;
  45734. n.setTextures(t);
  45735. for (var r = 0, o = e.length; r < o; r++) {
  45736. var a = n.parse(e[r]);
  45737. i[a.uuid] = a
  45738. }
  45739. }
  45740. return i
  45741. },
  45742. parseAnimations: function(e) {
  45743. for (var t = [], i = 0; i < e.length; i++) {
  45744. var n = Ci.AnimationClip.parse(e[i]);
  45745. t.push(n)
  45746. }
  45747. return t
  45748. },
  45749. parseImages: function(e, t) {
  45750. function i(e) {
  45751. return n.manager.itemStart(e),
  45752. a.load(e, function() {
  45753. n.manager.itemEnd(e)
  45754. })
  45755. }
  45756. var n = this
  45757. , r = {};
  45758. if (void 0 !== e && 0 < e.length) {
  45759. var o = new Ci.LoadingManager(t)
  45760. , a = new Ci.ImageLoader(o);
  45761. a.setCrossOrigin(this.crossOrigin);
  45762. for (var s = 0, l = e.length; s < l; s++) {
  45763. var c = e[s]
  45764. , h = /^(\/\/)|([a-z]+:(\/\/)?)/i.test(c.url) ? c.url : n.texturePath + c.url;
  45765. r[c.uuid] = i(h)
  45766. }
  45767. }
  45768. return r
  45769. },
  45770. parseTextures: function(e, t) {
  45771. function i(e) {
  45772. return "number" == typeof e ? e : (console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.", e),
  45773. Ci[e])
  45774. }
  45775. var n = {};
  45776. if (void 0 !== e)
  45777. for (var r = 0, o = e.length; r < o; r++) {
  45778. var a = e[r];
  45779. void 0 === a.image && console.warn('THREE.ObjectLoader: No "image" specified for', a.uuid),
  45780. void 0 === t[a.image] && console.warn("THREE.ObjectLoader: Undefined image", a.image);
  45781. var s = new Ci.Texture(t[a.image]);
  45782. s.needsUpdate = !0,
  45783. s.uuid = a.uuid,
  45784. void 0 !== a.name && (s.name = a.name),
  45785. void 0 !== a.mapping && (s.mapping = i(a.mapping)),
  45786. void 0 !== a.offset && (s.offset = new Ci.Vector2(a.offset[0],a.offset[1])),
  45787. void 0 !== a.repeat && (s.repeat = new Ci.Vector2(a.repeat[0],a.repeat[1])),
  45788. void 0 !== a.minFilter && (s.minFilter = i(a.minFilter)),
  45789. void 0 !== a.magFilter && (s.magFilter = i(a.magFilter)),
  45790. void 0 !== a.anisotropy && (s.anisotropy = a.anisotropy),
  45791. Array.isArray(a.wrap) && (s.wrapS = i(a.wrap[0]),
  45792. s.wrapT = i(a.wrap[1])),
  45793. n[a.uuid] = s
  45794. }
  45795. return n
  45796. },
  45797. parseObject: (ke = new Ci.Matrix4,
  45798. function(e, t, i) {
  45799. function n(e) {
  45800. return void 0 === t[e] && console.warn("THREE.ObjectLoader: Undefined geometry", e),
  45801. t[e]
  45802. }
  45803. function r(e) {
  45804. if (void 0 !== e)
  45805. return void 0 === i[e] && console.warn("THREE.ObjectLoader: Undefined material", e),
  45806. i[e]
  45807. }
  45808. var o;
  45809. switch (e.type) {
  45810. case "Scene":
  45811. o = new Ci.Scene;
  45812. break;
  45813. case "PerspectiveCamera":
  45814. o = new Ci.PerspectiveCamera(e.fov,e.aspect,e.near,e.far);
  45815. break;
  45816. case "OrthographicCamera":
  45817. o = new Ci.OrthographicCamera(e.left,e.right,e.top,e.bottom,e.near,e.far);
  45818. break;
  45819. case "AmbientLight":
  45820. o = new Ci.AmbientLight(e.color,e.intensity);
  45821. break;
  45822. case "DirectionalLight":
  45823. o = new Ci.DirectionalLight(e.color,e.intensity);
  45824. break;
  45825. case "PointLight":
  45826. o = new Ci.PointLight(e.color,e.intensity,e.distance,e.decay);
  45827. break;
  45828. case "SpotLight":
  45829. o = new Ci.SpotLight(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);
  45830. break;
  45831. case "HemisphereLight":
  45832. o = new Ci.HemisphereLight(e.color,e.groundColor,e.intensity);
  45833. break;
  45834. case "Mesh":
  45835. var a = n(e.geometry)
  45836. , s = r(e.material);
  45837. o = a.bones && 0 < a.bones.length ? new Ci.SkinnedMesh(a,s) : new Ci.Mesh(a,s);
  45838. break;
  45839. case "LOD":
  45840. o = new Ci.LOD;
  45841. break;
  45842. case "Line":
  45843. o = new Ci.Line(n(e.geometry),r(e.material),e.mode);
  45844. break;
  45845. case "PointCloud":
  45846. case "Points":
  45847. o = new Ci.Points(n(e.geometry),r(e.material));
  45848. break;
  45849. case "Sprite":
  45850. o = new Ci.Sprite(r(e.material));
  45851. break;
  45852. case "Group":
  45853. o = new Ci.Group;
  45854. break;
  45855. default:
  45856. o = new Ci.Object3D
  45857. }
  45858. if (o.uuid = e.uuid,
  45859. void 0 !== e.name && (o.name = e.name),
  45860. void 0 !== e.matrix ? (ke.fromArray(e.matrix),
  45861. ke.decompose(o.position, o.quaternion, o.scale)) : (void 0 !== e.position && o.position.fromArray(e.position),
  45862. void 0 !== e.rotation && o.rotation.fromArray(e.rotation),
  45863. void 0 !== e.scale && o.scale.fromArray(e.scale)),
  45864. void 0 !== e.castShadow && (o.castShadow = e.castShadow),
  45865. void 0 !== e.receiveShadow && (o.receiveShadow = e.receiveShadow),
  45866. void 0 !== e.visible && (o.visible = e.visible),
  45867. void 0 !== e.userData && (o.userData = e.userData),
  45868. void 0 !== e.children)
  45869. for (var l in e.children)
  45870. o.add(this.parseObject(e.children[l], t, i));
  45871. if ("LOD" === e.type)
  45872. for (var c = e.levels, h = 0; h < c.length; h++) {
  45873. var u = c[h];
  45874. void 0 !== (l = o.getObjectByProperty("uuid", u.object)) && o.addLevel(l, u.distance)
  45875. }
  45876. return o
  45877. }
  45878. )
  45879. },
  45880. Ci.TextureLoader = function(e) {
  45881. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45882. }
  45883. ,
  45884. Ci.TextureLoader.prototype = {
  45885. constructor: Ci.TextureLoader,
  45886. load: function(e, t, i, n) {
  45887. var r = new Ci.Texture
  45888. , o = new Ci.ImageLoader(this.manager);
  45889. return o.setCrossOrigin(this.crossOrigin),
  45890. o.setPath(this.path),
  45891. o.load(e, function(e) {
  45892. r.image = e,
  45893. r.needsUpdate = !0,
  45894. void 0 !== t && t(r)
  45895. }, i, n),
  45896. r
  45897. },
  45898. setCrossOrigin: function(e) {
  45899. this.crossOrigin = e
  45900. },
  45901. setPath: function(e) {
  45902. this.path = e
  45903. }
  45904. },
  45905. Ci.CubeTextureLoader = function(e) {
  45906. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45907. }
  45908. ,
  45909. Ci.CubeTextureLoader.prototype = {
  45910. constructor: Ci.CubeTextureLoader,
  45911. load: function(e, i, t, n) {
  45912. function r(t) {
  45913. a.load(e[t], function(e) {
  45914. o.images[t] = e,
  45915. 6 === ++s && (o.needsUpdate = !0,
  45916. i && i(o))
  45917. }, void 0, n)
  45918. }
  45919. var o = new Ci.CubeTexture
  45920. , a = new Ci.ImageLoader(this.manager);
  45921. a.setCrossOrigin(this.crossOrigin),
  45922. a.setPath(this.path);
  45923. for (var s = 0, l = 0; l < e.length; ++l)
  45924. r(l);
  45925. return o
  45926. },
  45927. setCrossOrigin: function(e) {
  45928. this.crossOrigin = e
  45929. },
  45930. setPath: function(e) {
  45931. this.path = e
  45932. }
  45933. },
  45934. Ci.DataTextureLoader = Ci.BinaryTextureLoader = function(e) {
  45935. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  45936. this._parser = null
  45937. }
  45938. ,
  45939. Ci.BinaryTextureLoader.prototype = {
  45940. constructor: Ci.BinaryTextureLoader,
  45941. load: function(e, i, t, n) {
  45942. var r = this
  45943. , o = new Ci.DataTexture
  45944. , a = new Ci.XHRLoader(this.manager);
  45945. return a.setResponseType("arraybuffer"),
  45946. a.load(e, function(e) {
  45947. var t = r._parser(e);
  45948. t && (void 0 !== t.image ? o.image = t.image : void 0 !== t.data && (o.image.width = t.width,
  45949. o.image.height = t.height,
  45950. o.image.data = t.data),
  45951. o.wrapS = void 0 !== t.wrapS ? t.wrapS : Ci.ClampToEdgeWrapping,
  45952. o.wrapT = void 0 !== t.wrapT ? t.wrapT : Ci.ClampToEdgeWrapping,
  45953. o.magFilter = void 0 !== t.magFilter ? t.magFilter : Ci.LinearFilter,
  45954. o.minFilter = void 0 !== t.minFilter ? t.minFilter : Ci.LinearMipMapLinearFilter,
  45955. o.anisotropy = void 0 !== t.anisotropy ? t.anisotropy : 1,
  45956. void 0 !== t.format && (o.format = t.format),
  45957. void 0 !== t.type && (o.type = t.type),
  45958. void 0 !== t.mipmaps && (o.mipmaps = t.mipmaps),
  45959. 1 === t.mipmapCount && (o.minFilter = Ci.LinearFilter),
  45960. o.needsUpdate = !0,
  45961. i && i(o, t))
  45962. }, t, n),
  45963. o
  45964. }
  45965. },
  45966. Ci.CompressedTextureLoader = function(e) {
  45967. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  45968. this._parser = null
  45969. }
  45970. ,
  45971. Ci.CompressedTextureLoader.prototype = {
  45972. constructor: Ci.CompressedTextureLoader,
  45973. load: function(e, o, t, n) {
  45974. function i(i) {
  45975. r.load(e[i], function(e) {
  45976. var t = a._parser(e, !0);
  45977. s[i] = {
  45978. width: t.width,
  45979. height: t.height,
  45980. format: t.format,
  45981. mipmaps: t.mipmaps
  45982. },
  45983. 6 === (c += 1) && (1 === t.mipmapCount && (l.minFilter = Ci.LinearFilter),
  45984. l.format = t.format,
  45985. l.needsUpdate = !0,
  45986. o && o(l))
  45987. }, t, n)
  45988. }
  45989. var a = this
  45990. , s = []
  45991. , l = new Ci.CompressedTexture;
  45992. l.image = s;
  45993. var r = new Ci.XHRLoader(this.manager);
  45994. if (r.setPath(this.path),
  45995. r.setResponseType("arraybuffer"),
  45996. Array.isArray(e))
  45997. for (var c = 0, h = 0, u = e.length; h < u; ++h)
  45998. i(h);
  45999. else
  46000. r.load(e, function(e) {
  46001. var t = a._parser(e, !0);
  46002. if (t.isCubemap)
  46003. for (var i = t.mipmaps.length / t.mipmapCount, n = 0; n < i; n++) {
  46004. s[n] = {
  46005. mipmaps: []
  46006. };
  46007. for (var r = 0; r < t.mipmapCount; r++)
  46008. s[n].mipmaps.push(t.mipmaps[n * t.mipmapCount + r]),
  46009. s[n].format = t.format,
  46010. s[n].width = t.width,
  46011. s[n].height = t.height
  46012. }
  46013. else
  46014. l.image.width = t.width,
  46015. l.image.height = t.height,
  46016. l.mipmaps = t.mipmaps;
  46017. 1 === t.mipmapCount && (l.minFilter = Ci.LinearFilter),
  46018. l.format = t.format,
  46019. l.needsUpdate = !0,
  46020. o && o(l)
  46021. }, t, n);
  46022. return l
  46023. },
  46024. setPath: function(e) {
  46025. this.path = e
  46026. }
  46027. },
  46028. Ci.Material = function() {
  46029. Object.defineProperty(this, "id", {
  46030. value: Ci.MaterialIdCount++
  46031. }),
  46032. this.uuid = Ci.Math.generateUUID(),
  46033. this.name = "",
  46034. this.type = "Material",
  46035. this.side = Ci.FrontSide,
  46036. this.opacity = 1,
  46037. this.transparent = !1,
  46038. this.blending = Ci.NormalBlending,
  46039. this.blendSrc = Ci.SrcAlphaFactor,
  46040. this.blendDst = Ci.OneMinusSrcAlphaFactor,
  46041. this.blendEquation = Ci.AddEquation,
  46042. this.blendSrcAlpha = null,
  46043. this.blendDstAlpha = null,
  46044. this.blendEquationAlpha = null,
  46045. this.depthFunc = Ci.LessEqualDepth,
  46046. this.depthTest = !0,
  46047. this.depthWrite = !0,
  46048. this.colorWrite = !0,
  46049. this.precision = null,
  46050. this.polygonOffset = !1,
  46051. this.polygonOffsetFactor = 0,
  46052. this.polygonOffsetUnits = 0,
  46053. this.alphaTest = 0,
  46054. this.premultipliedAlpha = !1,
  46055. this.overdraw = 0,
  46056. this.visible = !0,
  46057. this._needsUpdate = !0
  46058. }
  46059. ,
  46060. Ci.Material.prototype = {
  46061. constructor: Ci.Material,
  46062. get needsUpdate() {
  46063. return this._needsUpdate
  46064. },
  46065. set needsUpdate(e) {
  46066. !0 === e && this.update(),
  46067. this._needsUpdate = e
  46068. },
  46069. setValues: function(e) {
  46070. if (void 0 !== e)
  46071. for (var t in e) {
  46072. var i = e[t];
  46073. if (void 0 !== i) {
  46074. var n = this[t];
  46075. 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.")
  46076. } else
  46077. console.warn("THREE.Material: '" + t + "' parameter is undefined.")
  46078. }
  46079. },
  46080. toJSON: function(e) {
  46081. function t(e) {
  46082. var t = [];
  46083. for (var i in e) {
  46084. var n = e[i];
  46085. delete n.metadata,
  46086. t.push(n)
  46087. }
  46088. return t
  46089. }
  46090. var i = void 0 === e;
  46091. i && (e = {
  46092. textures: {},
  46093. images: {}
  46094. });
  46095. var n = {
  46096. metadata: {
  46097. version: 4.4,
  46098. type: "Material",
  46099. generator: "Material.toJSON"
  46100. }
  46101. };
  46102. if (n.uuid = this.uuid,
  46103. n.type = this.type,
  46104. "" !== this.name && (n.name = this.name),
  46105. this.color instanceof Ci.Color && (n.color = this.color.getHex()),
  46106. .5 !== this.roughness && (n.roughness = this.roughness),
  46107. .5 !== this.metalness && (n.metalness = this.metalness),
  46108. this.emissive instanceof Ci.Color && (n.emissive = this.emissive.getHex()),
  46109. this.specular instanceof Ci.Color && (n.specular = this.specular.getHex()),
  46110. void 0 !== this.shininess && (n.shininess = this.shininess),
  46111. this.map instanceof Ci.Texture && (n.map = this.map.toJSON(e).uuid),
  46112. this.alphaMap instanceof Ci.Texture && (n.alphaMap = this.alphaMap.toJSON(e).uuid),
  46113. this.lightMap instanceof Ci.Texture && (n.lightMap = this.lightMap.toJSON(e).uuid),
  46114. this.bumpMap instanceof Ci.Texture && (n.bumpMap = this.bumpMap.toJSON(e).uuid,
  46115. n.bumpScale = this.bumpScale),
  46116. this.normalMap instanceof Ci.Texture && (n.normalMap = this.normalMap.toJSON(e).uuid,
  46117. n.normalScale = this.normalScale.toArray()),
  46118. this.displacementMap instanceof Ci.Texture && (n.displacementMap = this.displacementMap.toJSON(e).uuid,
  46119. n.displacementScale = this.displacementScale,
  46120. n.displacementBias = this.displacementBias),
  46121. this.roughnessMap instanceof Ci.Texture && (n.roughnessMap = this.roughnessMap.toJSON(e).uuid),
  46122. this.metalnessMap instanceof Ci.Texture && (n.metalnessMap = this.metalnessMap.toJSON(e).uuid),
  46123. this.emissiveMap instanceof Ci.Texture && (n.emissiveMap = this.emissiveMap.toJSON(e).uuid),
  46124. this.specularMap instanceof Ci.Texture && (n.specularMap = this.specularMap.toJSON(e).uuid),
  46125. this.envMap instanceof Ci.Texture && (n.envMap = this.envMap.toJSON(e).uuid,
  46126. n.reflectivity = this.reflectivity),
  46127. void 0 !== this.size && (n.size = this.size),
  46128. void 0 !== this.sizeAttenuation && (n.sizeAttenuation = this.sizeAttenuation),
  46129. void 0 !== this.vertexColors && this.vertexColors !== Ci.NoColors && (n.vertexColors = this.vertexColors),
  46130. void 0 !== this.shading && this.shading !== Ci.SmoothShading && (n.shading = this.shading),
  46131. void 0 !== this.blending && this.blending !== Ci.NormalBlending && (n.blending = this.blending),
  46132. void 0 !== this.side && this.side !== Ci.FrontSide && (n.side = this.side),
  46133. this.opacity < 1 && (n.opacity = this.opacity),
  46134. !0 === this.transparent && (n.transparent = this.transparent),
  46135. 0 < this.alphaTest && (n.alphaTest = this.alphaTest),
  46136. !0 === this.premultipliedAlpha && (n.premultipliedAlpha = this.premultipliedAlpha),
  46137. !0 === this.wireframe && (n.wireframe = this.wireframe),
  46138. 1 < this.wireframeLinewidth && (n.wireframeLinewidth = this.wireframeLinewidth),
  46139. i) {
  46140. var r = t(e.textures)
  46141. , o = t(e.images);
  46142. 0 < r.length && (n.textures = r),
  46143. 0 < o.length && (n.images = o)
  46144. }
  46145. return n
  46146. },
  46147. clone: function() {
  46148. return (new this.constructor).copy(this)
  46149. },
  46150. copy: function(e) {
  46151. return this.name = e.name,
  46152. this.side = e.side,
  46153. this.opacity = e.opacity,
  46154. this.transparent = e.transparent,
  46155. this.blending = e.blending,
  46156. this.blendSrc = e.blendSrc,
  46157. this.blendDst = e.blendDst,
  46158. this.blendEquation = e.blendEquation,
  46159. this.blendSrcAlpha = e.blendSrcAlpha,
  46160. this.blendDstAlpha = e.blendDstAlpha,
  46161. this.blendEquationAlpha = e.blendEquationAlpha,
  46162. this.depthFunc = e.depthFunc,
  46163. this.depthTest = e.depthTest,
  46164. this.depthWrite = e.depthWrite,
  46165. this.colorWrite = e.colorWrite,
  46166. this.precision = e.precision,
  46167. this.polygonOffset = e.polygonOffset,
  46168. this.polygonOffsetFactor = e.polygonOffsetFactor,
  46169. this.polygonOffsetUnits = e.polygonOffsetUnits,
  46170. this.alphaTest = e.alphaTest,
  46171. this.premultipliedAlpha = e.premultipliedAlpha,
  46172. this.overdraw = e.overdraw,
  46173. this.visible = e.visible,
  46174. this
  46175. },
  46176. update: function() {
  46177. this.dispatchEvent({
  46178. type: "update"
  46179. })
  46180. },
  46181. dispose: function() {
  46182. this.dispatchEvent({
  46183. type: "dispose"
  46184. })
  46185. }
  46186. },
  46187. Ci.EventDispatcher.prototype.apply(Ci.Material.prototype),
  46188. Ci.MaterialIdCount = 0,
  46189. Ci.LineBasicMaterial = function(e) {
  46190. Ci.Material.call(this),
  46191. this.type = "LineBasicMaterial",
  46192. this.color = new Ci.Color(16777215),
  46193. this.linewidth = 1,
  46194. this.linecap = "round",
  46195. this.linejoin = "round",
  46196. this.blending = Ci.NormalBlending,
  46197. this.vertexColors = Ci.NoColors,
  46198. this.fog = !0,
  46199. this.setValues(e)
  46200. }
  46201. ,
  46202. Ci.LineBasicMaterial.prototype = Object.create(Ci.Material.prototype),
  46203. Ci.LineBasicMaterial.prototype.constructor = Ci.LineBasicMaterial,
  46204. Ci.LineBasicMaterial.prototype.copy = function(e) {
  46205. return Ci.Material.prototype.copy.call(this, e),
  46206. this.color.copy(e.color),
  46207. this.linewidth = e.linewidth,
  46208. this.linecap = e.linecap,
  46209. this.linejoin = e.linejoin,
  46210. this.vertexColors = e.vertexColors,
  46211. this.fog = e.fog,
  46212. this
  46213. }
  46214. ,
  46215. Ci.LineDashedMaterial = function(e) {
  46216. Ci.Material.call(this),
  46217. this.type = "LineDashedMaterial",
  46218. this.color = new Ci.Color(16777215),
  46219. this.linewidth = 1,
  46220. this.scale = 1,
  46221. this.dashSize = 3,
  46222. this.gapSize = 1,
  46223. this.blending = Ci.NormalBlending,
  46224. this.vertexColors = Ci.NoColors,
  46225. this.fog = !0,
  46226. this.setValues(e)
  46227. }
  46228. ,
  46229. Ci.LineDashedMaterial.prototype = Object.create(Ci.Material.prototype),
  46230. Ci.LineDashedMaterial.prototype.constructor = Ci.LineDashedMaterial,
  46231. Ci.LineDashedMaterial.prototype.copy = function(e) {
  46232. return Ci.Material.prototype.copy.call(this, e),
  46233. this.color.copy(e.color),
  46234. this.linewidth = e.linewidth,
  46235. this.scale = e.scale,
  46236. this.dashSize = e.dashSize,
  46237. this.gapSize = e.gapSize,
  46238. this.vertexColors = e.vertexColors,
  46239. this.fog = e.fog,
  46240. this
  46241. }
  46242. ,
  46243. Ci.MeshBasicMaterial = function(e) {
  46244. Ci.Material.call(this),
  46245. this.type = "MeshBasicMaterial",
  46246. this.color = new Ci.Color(16777215),
  46247. this.map = null,
  46248. this.aoMap = null,
  46249. this.aoMapIntensity = 1,
  46250. this.specularMap = null,
  46251. this.alphaMap = null,
  46252. this.envMap = null,
  46253. this.combine = Ci.MultiplyOperation,
  46254. this.reflectivity = 1,
  46255. this.refractionRatio = .98,
  46256. this.fog = !0,
  46257. this.shading = Ci.SmoothShading,
  46258. this.blending = Ci.NormalBlending,
  46259. this.wireframe = !1,
  46260. this.wireframeLinewidth = 1,
  46261. this.wireframeLinecap = "round",
  46262. this.wireframeLinejoin = "round",
  46263. this.vertexColors = Ci.NoColors,
  46264. this.skinning = !1,
  46265. this.morphTargets = !1,
  46266. this.setValues(e)
  46267. }
  46268. ,
  46269. Ci.MeshBasicMaterial.prototype = Object.create(Ci.Material.prototype),
  46270. Ci.MeshBasicMaterial.prototype.constructor = Ci.MeshBasicMaterial,
  46271. Ci.MeshBasicMaterial.prototype.copy = function(e) {
  46272. return Ci.Material.prototype.copy.call(this, e),
  46273. this.color.copy(e.color),
  46274. this.map = e.map,
  46275. this.aoMap = e.aoMap,
  46276. this.aoMapIntensity = e.aoMapIntensity,
  46277. this.specularMap = e.specularMap,
  46278. this.alphaMap = e.alphaMap,
  46279. this.envMap = e.envMap,
  46280. this.combine = e.combine,
  46281. this.reflectivity = e.reflectivity,
  46282. this.refractionRatio = e.refractionRatio,
  46283. this.fog = e.fog,
  46284. this.shading = e.shading,
  46285. this.wireframe = e.wireframe,
  46286. this.wireframeLinewidth = e.wireframeLinewidth,
  46287. this.wireframeLinecap = e.wireframeLinecap,
  46288. this.wireframeLinejoin = e.wireframeLinejoin,
  46289. this.vertexColors = e.vertexColors,
  46290. this.skinning = e.skinning,
  46291. this.morphTargets = e.morphTargets,
  46292. this
  46293. }
  46294. ,
  46295. Ci.MeshLambertMaterial = function(e) {
  46296. Ci.Material.call(this),
  46297. this.type = "MeshLambertMaterial",
  46298. this.color = new Ci.Color(16777215),
  46299. this.map = null,
  46300. this.lightMap = null,
  46301. this.lightMapIntensity = 1,
  46302. this.aoMap = null,
  46303. this.aoMapIntensity = 1,
  46304. this.emissive = new Ci.Color(0),
  46305. this.emissiveIntensity = 1,
  46306. this.emissiveMap = null,
  46307. this.specularMap = null,
  46308. this.alphaMap = null,
  46309. this.envMap = null,
  46310. this.combine = Ci.MultiplyOperation,
  46311. this.reflectivity = 1,
  46312. this.refractionRatio = .98,
  46313. this.fog = !0,
  46314. this.blending = Ci.NormalBlending,
  46315. this.wireframe = !1,
  46316. this.wireframeLinewidth = 1,
  46317. this.wireframeLinecap = "round",
  46318. this.wireframeLinejoin = "round",
  46319. this.vertexColors = Ci.NoColors,
  46320. this.skinning = !1,
  46321. this.morphTargets = !1,
  46322. this.morphNormals = !1,
  46323. this.setValues(e)
  46324. }
  46325. ,
  46326. Ci.MeshLambertMaterial.prototype = Object.create(Ci.Material.prototype),
  46327. Ci.MeshLambertMaterial.prototype.constructor = Ci.MeshLambertMaterial,
  46328. Ci.MeshLambertMaterial.prototype.copy = function(e) {
  46329. return Ci.Material.prototype.copy.call(this, e),
  46330. this.color.copy(e.color),
  46331. this.map = e.map,
  46332. this.lightMap = e.lightMap,
  46333. this.lightMapIntensity = e.lightMapIntensity,
  46334. this.aoMap = e.aoMap,
  46335. this.aoMapIntensity = e.aoMapIntensity,
  46336. this.emissive.copy(e.emissive),
  46337. this.emissiveMap = e.emissiveMap,
  46338. this.emissiveIntensity = e.emissiveIntensity,
  46339. this.specularMap = e.specularMap,
  46340. this.alphaMap = e.alphaMap,
  46341. this.envMap = e.envMap,
  46342. this.combine = e.combine,
  46343. this.reflectivity = e.reflectivity,
  46344. this.refractionRatio = e.refractionRatio,
  46345. this.fog = e.fog,
  46346. this.wireframe = e.wireframe,
  46347. this.wireframeLinewidth = e.wireframeLinewidth,
  46348. this.wireframeLinecap = e.wireframeLinecap,
  46349. this.wireframeLinejoin = e.wireframeLinejoin,
  46350. this.vertexColors = e.vertexColors,
  46351. this.skinning = e.skinning,
  46352. this.morphTargets = e.morphTargets,
  46353. this.morphNormals = e.morphNormals,
  46354. this
  46355. }
  46356. ,
  46357. Ci.MeshPhongMaterial = function(e) {
  46358. Ci.Material.call(this),
  46359. this.type = "MeshPhongMaterial",
  46360. this.color = new Ci.Color(16777215),
  46361. this.specular = new Ci.Color(1118481),
  46362. this.shininess = 30,
  46363. this.map = null,
  46364. this.lightMap = null,
  46365. this.lightMapIntensity = 1,
  46366. this.aoMap = null,
  46367. this.aoMapIntensity = 1,
  46368. this.emissive = new Ci.Color(0),
  46369. this.emissiveIntensity = 1,
  46370. this.emissiveMap = null,
  46371. this.bumpMap = null,
  46372. this.bumpScale = 1,
  46373. this.normalMap = null,
  46374. this.normalScale = new Ci.Vector2(1,1),
  46375. this.displacementMap = null,
  46376. this.displacementScale = 1,
  46377. this.displacementBias = 0,
  46378. this.specularMap = null,
  46379. this.alphaMap = null,
  46380. this.envMap = null,
  46381. this.combine = Ci.MultiplyOperation,
  46382. this.reflectivity = 1,
  46383. this.refractionRatio = .98,
  46384. this.fog = !0,
  46385. this.shading = Ci.SmoothShading,
  46386. this.blending = Ci.NormalBlending,
  46387. this.wireframe = !1,
  46388. this.wireframeLinewidth = 1,
  46389. this.wireframeLinecap = "round",
  46390. this.wireframeLinejoin = "round",
  46391. this.vertexColors = Ci.NoColors,
  46392. this.skinning = !1,
  46393. this.morphTargets = !1,
  46394. this.morphNormals = !1,
  46395. this.setValues(e)
  46396. }
  46397. ,
  46398. Ci.MeshPhongMaterial.prototype = Object.create(Ci.Material.prototype),
  46399. Ci.MeshPhongMaterial.prototype.constructor = Ci.MeshPhongMaterial,
  46400. Ci.MeshPhongMaterial.prototype.copy = function(e) {
  46401. return Ci.Material.prototype.copy.call(this, e),
  46402. this.color.copy(e.color),
  46403. this.specular.copy(e.specular),
  46404. this.shininess = e.shininess,
  46405. this.map = e.map,
  46406. this.lightMap = e.lightMap,
  46407. this.lightMapIntensity = e.lightMapIntensity,
  46408. this.aoMap = e.aoMap,
  46409. this.aoMapIntensity = e.aoMapIntensity,
  46410. this.emissive.copy(e.emissive),
  46411. this.emissiveMap = e.emissiveMap,
  46412. this.emissiveIntensity = e.emissiveIntensity,
  46413. this.bumpMap = e.bumpMap,
  46414. this.bumpScale = e.bumpScale,
  46415. this.normalMap = e.normalMap,
  46416. this.normalScale.copy(e.normalScale),
  46417. this.displacementMap = e.displacementMap,
  46418. this.displacementScale = e.displacementScale,
  46419. this.displacementBias = e.displacementBias,
  46420. this.specularMap = e.specularMap,
  46421. this.alphaMap = e.alphaMap,
  46422. this.envMap = e.envMap,
  46423. this.combine = e.combine,
  46424. this.reflectivity = e.reflectivity,
  46425. this.refractionRatio = e.refractionRatio,
  46426. this.fog = e.fog,
  46427. this.shading = e.shading,
  46428. this.wireframe = e.wireframe,
  46429. this.wireframeLinewidth = e.wireframeLinewidth,
  46430. this.wireframeLinecap = e.wireframeLinecap,
  46431. this.wireframeLinejoin = e.wireframeLinejoin,
  46432. this.vertexColors = e.vertexColors,
  46433. this.skinning = e.skinning,
  46434. this.morphTargets = e.morphTargets,
  46435. this.morphNormals = e.morphNormals,
  46436. this
  46437. }
  46438. ,
  46439. Ci.MeshStandardMaterial = function(e) {
  46440. Ci.Material.call(this),
  46441. this.type = "MeshStandardMaterial",
  46442. this.color = new Ci.Color(16777215),
  46443. this.roughness = .5,
  46444. this.metalness = .5,
  46445. this.map = null,
  46446. this.lightMap = null,
  46447. this.lightMapIntensity = 1,
  46448. this.aoMap = null,
  46449. this.aoMapIntensity = 1,
  46450. this.emissive = new Ci.Color(0),
  46451. this.emissiveIntensity = 1,
  46452. this.emissiveMap = null,
  46453. this.bumpMap = null,
  46454. this.bumpScale = 1,
  46455. this.normalMap = null,
  46456. this.normalScale = new Ci.Vector2(1,1),
  46457. this.displacementMap = null,
  46458. this.displacementScale = 1,
  46459. this.displacementBias = 0,
  46460. this.roughnessMap = null,
  46461. this.metalnessMap = null,
  46462. this.alphaMap = null,
  46463. this.envMap = null,
  46464. this.envMapIntensity = 1,
  46465. this.refractionRatio = .98,
  46466. this.fog = !0,
  46467. this.shading = Ci.SmoothShading,
  46468. this.blending = Ci.NormalBlending,
  46469. this.wireframe = !1,
  46470. this.wireframeLinewidth = 1,
  46471. this.wireframeLinecap = "round",
  46472. this.wireframeLinejoin = "round",
  46473. this.vertexColors = Ci.NoColors,
  46474. this.skinning = !1,
  46475. this.morphTargets = !1,
  46476. this.morphNormals = !1,
  46477. this.setValues(e)
  46478. }
  46479. ,
  46480. Ci.MeshStandardMaterial.prototype = Object.create(Ci.Material.prototype),
  46481. Ci.MeshStandardMaterial.prototype.constructor = Ci.MeshStandardMaterial,
  46482. Ci.MeshStandardMaterial.prototype.copy = function(e) {
  46483. return Ci.Material.prototype.copy.call(this, e),
  46484. this.color.copy(e.color),
  46485. this.roughness = e.roughness,
  46486. this.metalness = e.metalness,
  46487. this.map = e.map,
  46488. this.lightMap = e.lightMap,
  46489. this.lightMapIntensity = e.lightMapIntensity,
  46490. this.aoMap = e.aoMap,
  46491. this.aoMapIntensity = e.aoMapIntensity,
  46492. this.emissive.copy(e.emissive),
  46493. this.emissiveMap = e.emissiveMap,
  46494. this.emissiveIntensity = e.emissiveIntensity,
  46495. this.bumpMap = e.bumpMap,
  46496. this.bumpScale = e.bumpScale,
  46497. this.normalMap = e.normalMap,
  46498. this.normalScale.copy(e.normalScale),
  46499. this.displacementMap = e.displacementMap,
  46500. this.displacementScale = e.displacementScale,
  46501. this.displacementBias = e.displacementBias,
  46502. this.roughnessMap = e.roughnessMap,
  46503. this.metalnessMap = e.metalnessMap,
  46504. this.alphaMap = e.alphaMap,
  46505. this.envMap = e.envMap,
  46506. this.envMapIntensity = e.envMapIntensity,
  46507. this.refractionRatio = e.refractionRatio,
  46508. this.fog = e.fog,
  46509. this.shading = e.shading,
  46510. this.wireframe = e.wireframe,
  46511. this.wireframeLinewidth = e.wireframeLinewidth,
  46512. this.wireframeLinecap = e.wireframeLinecap,
  46513. this.wireframeLinejoin = e.wireframeLinejoin,
  46514. this.vertexColors = e.vertexColors,
  46515. this.skinning = e.skinning,
  46516. this.morphTargets = e.morphTargets,
  46517. this.morphNormals = e.morphNormals,
  46518. this
  46519. }
  46520. ,
  46521. Ci.MeshDepthMaterial = function(e) {
  46522. Ci.Material.call(this),
  46523. this.type = "MeshDepthMaterial",
  46524. this.morphTargets = !1,
  46525. this.wireframe = !1,
  46526. this.wireframeLinewidth = 1,
  46527. this.setValues(e)
  46528. }
  46529. ,
  46530. Ci.MeshDepthMaterial.prototype = Object.create(Ci.Material.prototype),
  46531. Ci.MeshDepthMaterial.prototype.constructor = Ci.MeshDepthMaterial,
  46532. Ci.MeshDepthMaterial.prototype.copy = function(e) {
  46533. return Ci.Material.prototype.copy.call(this, e),
  46534. this.wireframe = e.wireframe,
  46535. this.wireframeLinewidth = e.wireframeLinewidth,
  46536. this
  46537. }
  46538. ,
  46539. Ci.MeshNormalMaterial = function(e) {
  46540. Ci.Material.call(this, e),
  46541. this.type = "MeshNormalMaterial",
  46542. this.wireframe = !1,
  46543. this.wireframeLinewidth = 1,
  46544. this.morphTargets = !1,
  46545. this.setValues(e)
  46546. }
  46547. ,
  46548. Ci.MeshNormalMaterial.prototype = Object.create(Ci.Material.prototype),
  46549. Ci.MeshNormalMaterial.prototype.constructor = Ci.MeshNormalMaterial,
  46550. Ci.MeshNormalMaterial.prototype.copy = function(e) {
  46551. return Ci.Material.prototype.copy.call(this, e),
  46552. this.wireframe = e.wireframe,
  46553. this.wireframeLinewidth = e.wireframeLinewidth,
  46554. this
  46555. }
  46556. ,
  46557. Ci.MultiMaterial = function(e) {
  46558. this.uuid = Ci.Math.generateUUID(),
  46559. this.type = "MultiMaterial",
  46560. this.materials = e instanceof Array ? e : [],
  46561. this.visible = !0
  46562. }
  46563. ,
  46564. Ci.MultiMaterial.prototype = {
  46565. constructor: Ci.MultiMaterial,
  46566. toJSON: function(e) {
  46567. for (var t = {
  46568. metadata: {
  46569. version: 4.2,
  46570. type: "material",
  46571. generator: "MaterialExporter"
  46572. },
  46573. uuid: this.uuid,
  46574. type: this.type,
  46575. materials: []
  46576. }, i = this.materials, n = 0, r = i.length; n < r; n++) {
  46577. var o = i[n].toJSON(e);
  46578. delete o.metadata,
  46579. t.materials.push(o)
  46580. }
  46581. return t.visible = this.visible,
  46582. t
  46583. },
  46584. clone: function() {
  46585. for (var e = new this.constructor, t = 0; t < this.materials.length; t++)
  46586. e.materials.push(this.materials[t].clone());
  46587. return e.visible = this.visible,
  46588. e
  46589. }
  46590. },
  46591. Ci.PointsMaterial = function(e) {
  46592. Ci.Material.call(this),
  46593. this.type = "PointsMaterial",
  46594. this.color = new Ci.Color(16777215),
  46595. this.map = null,
  46596. this.size = 1,
  46597. this.sizeAttenuation = !0,
  46598. this.blending = Ci.NormalBlending,
  46599. this.vertexColors = Ci.NoColors,
  46600. this.fog = !0,
  46601. this.setValues(e)
  46602. }
  46603. ,
  46604. Ci.PointsMaterial.prototype = Object.create(Ci.Material.prototype),
  46605. Ci.PointsMaterial.prototype.constructor = Ci.PointsMaterial,
  46606. Ci.PointsMaterial.prototype.copy = function(e) {
  46607. return Ci.Material.prototype.copy.call(this, e),
  46608. this.color.copy(e.color),
  46609. this.map = e.map,
  46610. this.size = e.size,
  46611. this.sizeAttenuation = e.sizeAttenuation,
  46612. this.vertexColors = e.vertexColors,
  46613. this.fog = e.fog,
  46614. this
  46615. }
  46616. ,
  46617. Ci.ShaderMaterial = function(e) {
  46618. Ci.Material.call(this),
  46619. this.type = "ShaderMaterial",
  46620. this.defines = {},
  46621. this.uniforms = {},
  46622. this.vertexShader = "void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",
  46623. this.fragmentShader = "void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",
  46624. this.shading = Ci.SmoothShading,
  46625. this.linewidth = 1,
  46626. this.wireframe = !1,
  46627. this.wireframeLinewidth = 1,
  46628. this.fog = !1,
  46629. this.lights = !1,
  46630. this.vertexColors = Ci.NoColors,
  46631. this.skinning = !1,
  46632. this.morphTargets = !1,
  46633. this.morphNormals = !1,
  46634. this.extensions = {
  46635. derivatives: !1,
  46636. fragDepth: !1,
  46637. drawBuffers: !1,
  46638. shaderTextureLOD: !1
  46639. },
  46640. this.defaultAttributeValues = {
  46641. color: [1, 1, 1],
  46642. uv: [0, 0],
  46643. uv2: [0, 0]
  46644. },
  46645. (this.index0AttributeName = void 0) !== e && (void 0 !== e.attributes && console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),
  46646. this.setValues(e))
  46647. }
  46648. ,
  46649. Ci.ShaderMaterial.prototype = Object.create(Ci.Material.prototype),
  46650. Ci.ShaderMaterial.prototype.constructor = Ci.ShaderMaterial,
  46651. Ci.ShaderMaterial.prototype.copy = function(e) {
  46652. return Ci.Material.prototype.copy.call(this, e),
  46653. this.fragmentShader = e.fragmentShader,
  46654. this.vertexShader = e.vertexShader,
  46655. this.uniforms = Ci.UniformsUtils.clone(e.uniforms),
  46656. this.defines = e.defines,
  46657. this.shading = e.shading,
  46658. this.wireframe = e.wireframe,
  46659. this.wireframeLinewidth = e.wireframeLinewidth,
  46660. this.fog = e.fog,
  46661. this.lights = e.lights,
  46662. this.vertexColors = e.vertexColors,
  46663. this.skinning = e.skinning,
  46664. this.morphTargets = e.morphTargets,
  46665. this.morphNormals = e.morphNormals,
  46666. this.extensions = e.extensions,
  46667. this
  46668. }
  46669. ,
  46670. Ci.ShaderMaterial.prototype.toJSON = function(e) {
  46671. var t = Ci.Material.prototype.toJSON.call(this, e);
  46672. return t.uniforms = this.uniforms,
  46673. t.vertexShader = this.vertexShader,
  46674. t.fragmentShader = this.fragmentShader,
  46675. t
  46676. }
  46677. ,
  46678. Ci.RawShaderMaterial = function(e) {
  46679. Ci.ShaderMaterial.call(this, e),
  46680. this.type = "RawShaderMaterial"
  46681. }
  46682. ,
  46683. Ci.RawShaderMaterial.prototype = Object.create(Ci.ShaderMaterial.prototype),
  46684. Ci.RawShaderMaterial.prototype.constructor = Ci.RawShaderMaterial,
  46685. Ci.SpriteMaterial = function(e) {
  46686. Ci.Material.call(this),
  46687. this.type = "SpriteMaterial",
  46688. this.color = new Ci.Color(16777215),
  46689. this.map = null,
  46690. this.rotation = 0,
  46691. this.fog = !1,
  46692. this.setValues(e)
  46693. }
  46694. ,
  46695. Ci.SpriteMaterial.prototype = Object.create(Ci.Material.prototype),
  46696. Ci.SpriteMaterial.prototype.constructor = Ci.SpriteMaterial,
  46697. Ci.SpriteMaterial.prototype.copy = function(e) {
  46698. return Ci.Material.prototype.copy.call(this, e),
  46699. this.color.copy(e.color),
  46700. this.map = e.map,
  46701. this.rotation = e.rotation,
  46702. this.fog = e.fog,
  46703. this
  46704. }
  46705. ,
  46706. Ci.Texture = function(e, t, i, n, r, o, a, s, l) {
  46707. Object.defineProperty(this, "id", {
  46708. value: Ci.TextureIdCount++
  46709. }),
  46710. this.uuid = Ci.Math.generateUUID(),
  46711. this.name = "",
  46712. this.sourceFile = "",
  46713. this.image = void 0 !== e ? e : Ci.Texture.DEFAULT_IMAGE,
  46714. this.mipmaps = [],
  46715. this.mapping = void 0 !== t ? t : Ci.Texture.DEFAULT_MAPPING,
  46716. this.wrapS = void 0 !== i ? i : Ci.ClampToEdgeWrapping,
  46717. this.wrapT = void 0 !== n ? n : Ci.ClampToEdgeWrapping,
  46718. this.magFilter = void 0 !== r ? r : Ci.LinearFilter,
  46719. this.minFilter = void 0 !== o ? o : Ci.LinearMipMapLinearFilter,
  46720. this.anisotropy = void 0 !== l ? l : 1,
  46721. this.format = void 0 !== a ? a : Ci.RGBAFormat,
  46722. this.type = void 0 !== s ? s : Ci.UnsignedByteType,
  46723. this.offset = new Ci.Vector2(0,0),
  46724. this.repeat = new Ci.Vector2(1,1),
  46725. this.generateMipmaps = !0,
  46726. this.premultiplyAlpha = !1,
  46727. this.flipY = !0,
  46728. this.unpackAlignment = 4,
  46729. this.encoding = Ci.LinearEncoding,
  46730. this.version = 0,
  46731. this.onUpdate = null
  46732. }
  46733. ,
  46734. Ci.Texture.DEFAULT_IMAGE = void 0,
  46735. Ci.Texture.DEFAULT_MAPPING = Ci.UVMapping,
  46736. Ci.Texture.prototype = {
  46737. constructor: Ci.Texture,
  46738. set needsUpdate(e) {
  46739. !0 === e && this.version++
  46740. },
  46741. clone: function() {
  46742. return (new this.constructor).copy(this)
  46743. },
  46744. copy: function(e) {
  46745. return this.image = e.image,
  46746. this.mipmaps = e.mipmaps.slice(0),
  46747. this.mapping = e.mapping,
  46748. this.wrapS = e.wrapS,
  46749. this.wrapT = e.wrapT,
  46750. this.magFilter = e.magFilter,
  46751. this.minFilter = e.minFilter,
  46752. this.anisotropy = e.anisotropy,
  46753. this.format = e.format,
  46754. this.type = e.type,
  46755. this.offset.copy(e.offset),
  46756. this.repeat.copy(e.repeat),
  46757. this.generateMipmaps = e.generateMipmaps,
  46758. this.premultiplyAlpha = e.premultiplyAlpha,
  46759. this.flipY = e.flipY,
  46760. this.unpackAlignment = e.unpackAlignment,
  46761. this.encoding = e.encoding,
  46762. this
  46763. },
  46764. toJSON: function(e) {
  46765. if (void 0 !== e.textures[this.uuid])
  46766. return e.textures[this.uuid];
  46767. var t, i, n = {
  46768. metadata: {
  46769. version: 4.4,
  46770. type: "Texture",
  46771. generator: "Texture.toJSON"
  46772. },
  46773. uuid: this.uuid,
  46774. name: this.name,
  46775. mapping: this.mapping,
  46776. repeat: [this.repeat.x, this.repeat.y],
  46777. offset: [this.offset.x, this.offset.y],
  46778. wrap: [this.wrapS, this.wrapT],
  46779. minFilter: this.minFilter,
  46780. magFilter: this.magFilter,
  46781. anisotropy: this.anisotropy
  46782. };
  46783. if (void 0 !== this.image) {
  46784. var r = this.image;
  46785. void 0 === r.uuid && (r.uuid = Ci.Math.generateUUID()),
  46786. void 0 === e.images[r.uuid] && (e.images[r.uuid] = {
  46787. uuid: r.uuid,
  46788. url: (t = r,
  46789. void 0 !== t.toDataURL ? i = t : ((i = document.createElement("canvas")).width = t.width,
  46790. i.height = t.height,
  46791. i.getContext("2d").drawImage(t, 0, 0, t.width, t.height)),
  46792. 2048 < i.width || 2048 < i.height ? i.toDataURL("image/jpeg", .6) : i.toDataURL("image/png"))
  46793. }),
  46794. n.image = r.uuid
  46795. }
  46796. return e.textures[this.uuid] = n
  46797. },
  46798. dispose: function() {
  46799. this.dispatchEvent({
  46800. type: "dispose"
  46801. })
  46802. },
  46803. transformUv: function(e) {
  46804. if (this.mapping === Ci.UVMapping) {
  46805. if (e.multiply(this.repeat),
  46806. e.add(this.offset),
  46807. e.x < 0 || 1 < e.x)
  46808. switch (this.wrapS) {
  46809. case Ci.RepeatWrapping:
  46810. e.x = e.x - Math.floor(e.x);
  46811. break;
  46812. case Ci.ClampToEdgeWrapping:
  46813. e.x = e.x < 0 ? 0 : 1;
  46814. break;
  46815. case Ci.MirroredRepeatWrapping:
  46816. 1 === Math.abs(Math.floor(e.x) % 2) ? e.x = Math.ceil(e.x) - e.x : e.x = e.x - Math.floor(e.x)
  46817. }
  46818. if (e.y < 0 || 1 < e.y)
  46819. switch (this.wrapT) {
  46820. case Ci.RepeatWrapping:
  46821. e.y = e.y - Math.floor(e.y);
  46822. break;
  46823. case Ci.ClampToEdgeWrapping:
  46824. e.y = e.y < 0 ? 0 : 1;
  46825. break;
  46826. case Ci.MirroredRepeatWrapping:
  46827. 1 === Math.abs(Math.floor(e.y) % 2) ? e.y = Math.ceil(e.y) - e.y : e.y = e.y - Math.floor(e.y)
  46828. }
  46829. this.flipY && (e.y = 1 - e.y)
  46830. }
  46831. }
  46832. },
  46833. Ci.EventDispatcher.prototype.apply(Ci.Texture.prototype),
  46834. Ci.TextureIdCount = 0,
  46835. Ci.CanvasTexture = function(e, t, i, n, r, o, a, s, l) {
  46836. Ci.Texture.call(this, e, t, i, n, r, o, a, s, l),
  46837. this.needsUpdate = !0
  46838. }
  46839. ,
  46840. Ci.CanvasTexture.prototype = Object.create(Ci.Texture.prototype),
  46841. Ci.CanvasTexture.prototype.constructor = Ci.CanvasTexture,
  46842. Ci.CubeTexture = function(e, t, i, n, r, o, a, s, l) {
  46843. e = void 0 !== e ? e : [],
  46844. t = void 0 !== t ? t : Ci.CubeReflectionMapping,
  46845. Ci.Texture.call(this, e, t, i, n, r, o, a, s, l),
  46846. this.flipY = !1
  46847. }
  46848. ,
  46849. Ci.CubeTexture.prototype = Object.create(Ci.Texture.prototype),
  46850. Ci.CubeTexture.prototype.constructor = Ci.CubeTexture,
  46851. Object.defineProperty(Ci.CubeTexture.prototype, "images", {
  46852. get: function() {
  46853. return this.image
  46854. },
  46855. set: function(e) {
  46856. this.image = e
  46857. }
  46858. }),
  46859. Ci.CompressedTexture = function(e, t, i, n, r, o, a, s, l, c, h) {
  46860. Ci.Texture.call(this, null, o, a, s, l, c, n, r, h),
  46861. this.image = {
  46862. width: t,
  46863. height: i
  46864. },
  46865. this.mipmaps = e,
  46866. this.flipY = !1,
  46867. this.generateMipmaps = !1
  46868. }
  46869. ,
  46870. Ci.CompressedTexture.prototype = Object.create(Ci.Texture.prototype),
  46871. Ci.CompressedTexture.prototype.constructor = Ci.CompressedTexture,
  46872. Ci.DataTexture = function(e, t, i, n, r, o, a, s, l, c, h) {
  46873. Ci.Texture.call(this, null, o, a, s, l, c, n, r, h),
  46874. this.image = {
  46875. data: e,
  46876. width: t,
  46877. height: i
  46878. },
  46879. this.magFilter = void 0 !== l ? l : Ci.NearestFilter,
  46880. this.minFilter = void 0 !== c ? c : Ci.NearestFilter,
  46881. this.flipY = !1,
  46882. this.generateMipmaps = !1
  46883. }
  46884. ,
  46885. Ci.DataTexture.prototype = Object.create(Ci.Texture.prototype),
  46886. Ci.DataTexture.prototype.constructor = Ci.DataTexture,
  46887. Ci.VideoTexture = function(t, e, i, n, r, o, a, s, l) {
  46888. Ci.Texture.call(this, t, e, i, n, r, o, a, s, l),
  46889. this.generateMipmaps = !1;
  46890. var c = this;
  46891. !function e() {
  46892. requestAnimationFrame(e),
  46893. t.readyState === t.HAVE_ENOUGH_DATA && (c.needsUpdate = !0)
  46894. }()
  46895. }
  46896. ,
  46897. Ci.VideoTexture.prototype = Object.create(Ci.Texture.prototype),
  46898. Ci.VideoTexture.prototype.constructor = Ci.VideoTexture,
  46899. Ci.Group = function() {
  46900. Ci.Object3D.call(this),
  46901. this.type = "Group"
  46902. }
  46903. ,
  46904. Ci.Group.prototype = Object.create(Ci.Object3D.prototype),
  46905. Ci.Group.prototype.constructor = Ci.Group,
  46906. Ci.Points = function(e, t) {
  46907. Ci.Object3D.call(this),
  46908. this.type = "Points",
  46909. this.geometry = void 0 !== e ? e : new Ci.Geometry,
  46910. this.material = void 0 !== t ? t : new Ci.PointsMaterial({
  46911. color: 16777215 * Math.random()
  46912. })
  46913. }
  46914. ,
  46915. Ci.Points.prototype = Object.create(Ci.Object3D.prototype),
  46916. Ci.Points.prototype.constructor = Ci.Points,
  46917. Ci.Points.prototype.raycast = (Wt = new Ci.Matrix4,
  46918. jt = new Ci.Ray,
  46919. Yt = new Ci.Sphere,
  46920. function(o, a) {
  46921. function e(e, t) {
  46922. var i = jt.distanceSqToPoint(e);
  46923. if (i < c) {
  46924. var n = jt.closestPointToPoint(e);
  46925. n.applyMatrix4(l);
  46926. var r = o.ray.origin.distanceTo(n);
  46927. if (r < o.near || r > o.far)
  46928. return;
  46929. a.push({
  46930. distance: r,
  46931. distanceToRay: Math.sqrt(i),
  46932. point: n.clone(),
  46933. index: t,
  46934. face: null,
  46935. object: s
  46936. })
  46937. }
  46938. }
  46939. var s = this
  46940. , t = this.geometry
  46941. , l = this.matrixWorld
  46942. , i = o.params.Points.threshold;
  46943. if (null === t.boundingSphere && t.computeBoundingSphere(),
  46944. Yt.copy(t.boundingSphere),
  46945. Yt.applyMatrix4(l),
  46946. !1 !== o.ray.intersectsSphere(Yt)) {
  46947. Wt.getInverse(l),
  46948. jt.copy(o.ray).applyMatrix4(Wt);
  46949. var n = i / ((this.scale.x + this.scale.y + this.scale.z) / 3)
  46950. , c = n * n
  46951. , r = new Ci.Vector3;
  46952. if (t instanceof Ci.BufferGeometry) {
  46953. var h = t.index
  46954. , u = t.attributes.position.array;
  46955. if (null !== h)
  46956. for (var d = h.array, p = 0, f = d.length; p < f; p++) {
  46957. var g = d[p];
  46958. r.fromArray(u, 3 * g),
  46959. e(r, g)
  46960. }
  46961. else {
  46962. p = 0;
  46963. for (var m = u.length / 3; p < m; p++)
  46964. r.fromArray(u, 3 * p),
  46965. e(r, p)
  46966. }
  46967. } else {
  46968. var v = t.vertices;
  46969. for (p = 0,
  46970. m = v.length; p < m; p++)
  46971. e(v[p], p)
  46972. }
  46973. }
  46974. }
  46975. ),
  46976. Ci.Points.prototype.clone = function() {
  46977. return new this.constructor(this.geometry,this.material).copy(this)
  46978. }
  46979. ,
  46980. Ci.Line = function(e, t, i) {
  46981. return 1 === i ? (console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),
  46982. new Ci.LineSegments(e,t)) : (Ci.Object3D.call(this),
  46983. this.type = "Line",
  46984. this.geometry = void 0 !== e ? e : new Ci.Geometry,
  46985. void (this.material = void 0 !== t ? t : new Ci.LineBasicMaterial({
  46986. color: 16777215 * Math.random()
  46987. })))
  46988. }
  46989. ,
  46990. Ci.Line.prototype = Object.create(Ci.Object3D.prototype),
  46991. Ci.Line.prototype.constructor = Ci.Line,
  46992. Ci.Line.prototype.raycast = (Ht = new Ci.Matrix4,
  46993. zt = new Ci.Ray,
  46994. Gt = new Ci.Sphere,
  46995. function(e, t) {
  46996. var i = e.linePrecision
  46997. , n = i * i
  46998. , r = this.geometry
  46999. , o = this.matrixWorld;
  47000. if (null === r.boundingSphere && r.computeBoundingSphere(),
  47001. Gt.copy(r.boundingSphere),
  47002. Gt.applyMatrix4(o),
  47003. !1 !== e.ray.intersectsSphere(Gt)) {
  47004. Ht.getInverse(o),
  47005. zt.copy(e.ray).applyMatrix4(Ht);
  47006. var a = new Ci.Vector3
  47007. , s = new Ci.Vector3
  47008. , l = new Ci.Vector3
  47009. , c = new Ci.Vector3
  47010. , h = this instanceof Ci.LineSegments ? 2 : 1;
  47011. if (r instanceof Ci.BufferGeometry) {
  47012. var u = r.index
  47013. , d = r.attributes.position.array;
  47014. if (null !== u)
  47015. for (var p = u.array, f = 0, g = p.length - 1; f < g; f += h) {
  47016. var m = p[f]
  47017. , v = p[f + 1];
  47018. a.fromArray(d, 3 * m),
  47019. s.fromArray(d, 3 * v),
  47020. n < zt.distanceSqToSegment(a, s, c, l) || (c.applyMatrix4(this.matrixWorld),
  47021. (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
  47022. distance: C,
  47023. point: l.clone().applyMatrix4(this.matrixWorld),
  47024. index: f,
  47025. face: null,
  47026. faceIndex: null,
  47027. object: this
  47028. }))
  47029. }
  47030. else
  47031. for (f = 0,
  47032. g = d.length / 3 - 1; f < g; f += h)
  47033. a.fromArray(d, 3 * f),
  47034. s.fromArray(d, 3 * f + 3),
  47035. n < zt.distanceSqToSegment(a, s, c, l) || (c.applyMatrix4(this.matrixWorld),
  47036. (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
  47037. distance: C,
  47038. point: l.clone().applyMatrix4(this.matrixWorld),
  47039. index: f,
  47040. face: null,
  47041. faceIndex: null,
  47042. object: this
  47043. }))
  47044. } else if (r instanceof Ci.Geometry) {
  47045. var y = r.vertices
  47046. , A = y.length;
  47047. for (f = 0; f < A - 1; f += h) {
  47048. var C;
  47049. n < zt.distanceSqToSegment(y[f], y[f + 1], c, l) || (c.applyMatrix4(this.matrixWorld),
  47050. (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
  47051. distance: C,
  47052. point: l.clone().applyMatrix4(this.matrixWorld),
  47053. index: f,
  47054. face: null,
  47055. faceIndex: null,
  47056. object: this
  47057. }))
  47058. }
  47059. }
  47060. }
  47061. }
  47062. ),
  47063. Ci.Line.prototype.clone = function() {
  47064. return new this.constructor(this.geometry,this.material).copy(this)
  47065. }
  47066. ,
  47067. Ci.LineStrip = 0,
  47068. Ci.LinePieces = 1,
  47069. Ci.LineSegments = function(e, t) {
  47070. Ci.Line.call(this, e, t),
  47071. this.type = "LineSegments"
  47072. }
  47073. ,
  47074. Ci.LineSegments.prototype = Object.create(Ci.Line.prototype),
  47075. Ci.LineSegments.prototype.constructor = Ci.LineSegments,
  47076. Ci.Mesh = function(e, t) {
  47077. Ci.Object3D.call(this),
  47078. this.type = "Mesh",
  47079. this.geometry = void 0 !== e ? e : new Ci.Geometry,
  47080. this.material = void 0 !== t ? t : new Ci.MeshBasicMaterial({
  47081. color: 16777215 * Math.random()
  47082. }),
  47083. this.drawMode = Ci.TrianglesDrawMode,
  47084. this.updateMorphTargets()
  47085. }
  47086. ,
  47087. Ci.Mesh.prototype = Object.create(Ci.Object3D.prototype),
  47088. Ci.Mesh.prototype.constructor = Ci.Mesh,
  47089. Ci.Mesh.prototype.setDrawMode = function(e) {
  47090. this.drawMode = e
  47091. }
  47092. ,
  47093. Ci.Mesh.prototype.updateMorphTargets = function() {
  47094. if (void 0 !== this.geometry.morphTargets && 0 < this.geometry.morphTargets.length) {
  47095. this.morphTargetBase = -1,
  47096. this.morphTargetInfluences = [],
  47097. this.morphTargetDictionary = {};
  47098. for (var e = 0, t = this.geometry.morphTargets.length; e < t; e++)
  47099. this.morphTargetInfluences.push(0),
  47100. this.morphTargetDictionary[this.geometry.morphTargets[e].name] = e
  47101. }
  47102. }
  47103. ,
  47104. Ci.Mesh.prototype.getMorphTargetIndexByName = function(e) {
  47105. return void 0 !== this.morphTargetDictionary[e] ? this.morphTargetDictionary[e] : (console.warn("THREE.Mesh.getMorphTargetIndexByName: morph target " + e + " does not exist. Returning 0."),
  47106. 0)
  47107. }
  47108. ,
  47109. Ci.Mesh.prototype.raycast = (Tt = new Ci.Matrix4,
  47110. xt = new Ci.Ray,
  47111. St = new Ci.Sphere,
  47112. Mt = new Ci.Vector3,
  47113. Rt = new Ci.Vector3,
  47114. Pt = new Ci.Vector3,
  47115. Ot = new Ci.Vector3,
  47116. Lt = new Ci.Vector3,
  47117. Dt = new Ci.Vector3,
  47118. Nt = new Ci.Vector2,
  47119. Ft = new Ci.Vector2,
  47120. Bt = new Ci.Vector2,
  47121. Vt = new Ci.Vector3,
  47122. kt = new Ci.Vector3,
  47123. Ut = new Ci.Vector3,
  47124. function(e, t) {
  47125. var i, n, r = this.geometry, o = this.material, a = this.matrixWorld;
  47126. if (void 0 !== o && (null === r.boundingSphere && r.computeBoundingSphere(),
  47127. St.copy(r.boundingSphere),
  47128. St.applyMatrix4(a),
  47129. !1 !== e.ray.intersectsSphere(St) && (Tt.getInverse(a),
  47130. xt.copy(e.ray).applyMatrix4(Tt),
  47131. null === r.boundingBox || !1 !== xt.intersectsBox(r.boundingBox))))
  47132. if (r instanceof Ci.BufferGeometry) {
  47133. var s, l, c, h = r.index, u = r.attributes, d = u.position.array;
  47134. if (void 0 !== u.uv && (i = u.uv.array),
  47135. null !== h)
  47136. for (var p = h.array, f = 0, g = p.length; f < g; f += 3)
  47137. s = p[f],
  47138. l = p[f + 1],
  47139. c = p[f + 2],
  47140. (n = Ti(this, e, xt, d, i, s, l, c)) && (n.faceIndex = Math.floor(f / 3),
  47141. t.push(n));
  47142. else
  47143. for (f = 0,
  47144. g = d.length; f < g; f += 9)
  47145. (n = Ti(this, e, xt, d, i, s = f / 3, l = s + 1, c = s + 2)) && (n.index = s,
  47146. t.push(n))
  47147. } else if (r instanceof Ci.Geometry) {
  47148. var m, v, y, A = o instanceof Ci.MultiMaterial, C = 1 == A ? o.materials : null, I = r.vertices, E = r.faces, _ = r.faceVertexUvs[0];
  47149. 0 < _.length && (i = _);
  47150. for (var b = 0, w = E.length; b < w; b++) {
  47151. var T = E[b]
  47152. , x = 1 == A ? C[T.materialIndex] : o;
  47153. if (void 0 !== x) {
  47154. if (m = I[T.a],
  47155. v = I[T.b],
  47156. y = I[T.c],
  47157. !0 === x.morphTargets) {
  47158. var S = r.morphTargets
  47159. , M = this.morphTargetInfluences;
  47160. Mt.set(0, 0, 0),
  47161. Rt.set(0, 0, 0),
  47162. Pt.set(0, 0, 0);
  47163. for (var R = 0, P = S.length; R < P; R++) {
  47164. var O = M[R];
  47165. if (0 !== O) {
  47166. var L = S[R].vertices;
  47167. Mt.addScaledVector(Ot.subVectors(L[T.a], m), O),
  47168. Rt.addScaledVector(Lt.subVectors(L[T.b], v), O),
  47169. Pt.addScaledVector(Dt.subVectors(L[T.c], y), O)
  47170. }
  47171. }
  47172. Mt.add(m),
  47173. Rt.add(v),
  47174. Pt.add(y),
  47175. m = Mt,
  47176. v = Rt,
  47177. y = Pt
  47178. }
  47179. if (n = wi(this, e, xt, m, v, y, kt)) {
  47180. if (i) {
  47181. var D = i[b];
  47182. Nt.copy(D[0]),
  47183. Ft.copy(D[1]),
  47184. Bt.copy(D[2]),
  47185. n.uv = bi(kt, m, v, y, Nt, Ft, Bt)
  47186. }
  47187. n.face = T,
  47188. n.faceIndex = b,
  47189. t.push(n)
  47190. }
  47191. }
  47192. }
  47193. }
  47194. }
  47195. ),
  47196. Ci.Mesh.prototype.clone = function() {
  47197. return new this.constructor(this.geometry,this.material).copy(this)
  47198. }
  47199. ,
  47200. Ci.Bone = function(e) {
  47201. Ci.Object3D.call(this),
  47202. this.type = "Bone",
  47203. this.skin = e
  47204. }
  47205. ,
  47206. Ci.Bone.prototype = Object.create(Ci.Object3D.prototype),
  47207. Ci.Bone.prototype.constructor = Ci.Bone,
  47208. Ci.Bone.prototype.copy = function(e) {
  47209. return Ci.Object3D.prototype.copy.call(this, e),
  47210. this.skin = e.skin,
  47211. this
  47212. }
  47213. ,
  47214. Ci.Skeleton = function(e, t, i) {
  47215. if (this.useVertexTexture = void 0 === i || i,
  47216. this.identityMatrix = new Ci.Matrix4,
  47217. e = e || [],
  47218. this.bones = e.slice(0),
  47219. this.useVertexTexture) {
  47220. var n = Math.sqrt(4 * this.bones.length);
  47221. n = Ci.Math.nextPowerOfTwo(Math.ceil(n)),
  47222. n = Math.max(n, 4),
  47223. this.boneTextureWidth = n,
  47224. this.boneTextureHeight = n,
  47225. this.boneMatrices = new Float32Array(this.boneTextureWidth * this.boneTextureHeight * 4),
  47226. this.boneTexture = new Ci.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,Ci.RGBAFormat,Ci.FloatType)
  47227. } else
  47228. this.boneMatrices = new Float32Array(16 * this.bones.length);
  47229. if (void 0 === t)
  47230. this.calculateInverses();
  47231. else if (this.bones.length === t.length)
  47232. this.boneInverses = t.slice(0);
  47233. else {
  47234. console.warn("THREE.Skeleton bonInverses is the wrong length."),
  47235. this.boneInverses = [];
  47236. for (var r = 0, o = this.bones.length; r < o; r++)
  47237. this.boneInverses.push(new Ci.Matrix4)
  47238. }
  47239. }
  47240. ,
  47241. Ci.Skeleton.prototype.calculateInverses = function() {
  47242. this.boneInverses = [];
  47243. for (var e = 0, t = this.bones.length; e < t; e++) {
  47244. var i = new Ci.Matrix4;
  47245. this.bones[e] && i.getInverse(this.bones[e].matrixWorld),
  47246. this.boneInverses.push(i)
  47247. }
  47248. }
  47249. ,
  47250. Ci.Skeleton.prototype.pose = function() {
  47251. for (var e, t = 0, i = this.bones.length; t < i; t++)
  47252. (e = this.bones[t]) && e.matrixWorld.getInverse(this.boneInverses[t]);
  47253. for (t = 0,
  47254. i = this.bones.length; t < i; t++)
  47255. (e = this.bones[t]) && (e.parent ? (e.matrix.getInverse(e.parent.matrixWorld),
  47256. e.matrix.multiply(e.matrixWorld)) : e.matrix.copy(e.matrixWorld),
  47257. e.matrix.decompose(e.position, e.quaternion, e.scale))
  47258. }
  47259. ,
  47260. Ci.Skeleton.prototype.update = (wt = new Ci.Matrix4,
  47261. function() {
  47262. for (var e = 0, t = this.bones.length; e < t; e++) {
  47263. var i = this.bones[e] ? this.bones[e].matrixWorld : this.identityMatrix;
  47264. wt.multiplyMatrices(i, this.boneInverses[e]),
  47265. wt.flattenToArrayOffset(this.boneMatrices, 16 * e)
  47266. }
  47267. this.useVertexTexture && (this.boneTexture.needsUpdate = !0)
  47268. }
  47269. ),
  47270. Ci.Skeleton.prototype.clone = function() {
  47271. return new Ci.Skeleton(this.bones,this.boneInverses,this.useVertexTexture)
  47272. }
  47273. ,
  47274. Ci.SkinnedMesh = function(e, t, i) {
  47275. Ci.Mesh.call(this, e, t),
  47276. this.type = "SkinnedMesh",
  47277. this.bindMode = "attached",
  47278. this.bindMatrix = new Ci.Matrix4,
  47279. this.bindMatrixInverse = new Ci.Matrix4;
  47280. var n = [];
  47281. if (this.geometry && void 0 !== this.geometry.bones) {
  47282. for (var r, o, a = 0, s = this.geometry.bones.length; a < s; ++a)
  47283. o = this.geometry.bones[a],
  47284. r = new Ci.Bone(this),
  47285. n.push(r),
  47286. r.name = o.name,
  47287. r.position.fromArray(o.pos),
  47288. r.quaternion.fromArray(o.rotq),
  47289. void 0 !== o.scl && r.scale.fromArray(o.scl);
  47290. for (a = 0,
  47291. s = this.geometry.bones.length; a < s; ++a)
  47292. -1 !== (o = this.geometry.bones[a]).parent && null !== o.parent ? n[o.parent].add(n[a]) : this.add(n[a])
  47293. }
  47294. this.normalizeSkinWeights(),
  47295. this.updateMatrixWorld(!0),
  47296. this.bind(new Ci.Skeleton(n,void 0,i), this.matrixWorld)
  47297. }
  47298. ,
  47299. Ci.SkinnedMesh.prototype = Object.create(Ci.Mesh.prototype),
  47300. Ci.SkinnedMesh.prototype.constructor = Ci.SkinnedMesh,
  47301. Ci.SkinnedMesh.prototype.bind = function(e, t) {
  47302. this.skeleton = e,
  47303. void 0 === t && (this.updateMatrixWorld(!0),
  47304. this.skeleton.calculateInverses(),
  47305. t = this.matrixWorld),
  47306. this.bindMatrix.copy(t),
  47307. this.bindMatrixInverse.getInverse(t)
  47308. }
  47309. ,
  47310. Ci.SkinnedMesh.prototype.pose = function() {
  47311. this.skeleton.pose()
  47312. }
  47313. ,
  47314. Ci.SkinnedMesh.prototype.normalizeSkinWeights = function() {
  47315. if (this.geometry instanceof Ci.Geometry)
  47316. for (var e = 0; e < this.geometry.skinWeights.length; e++) {
  47317. var t = this.geometry.skinWeights[e];
  47318. (r = 1 / t.lengthManhattan()) !== 1 / 0 ? t.multiplyScalar(r) : t.set(1, 0, 0, 0)
  47319. }
  47320. else if (this.geometry instanceof Ci.BufferGeometry) {
  47321. var i = new Ci.Vector4
  47322. , n = this.geometry.attributes.skinWeight;
  47323. for (e = 0; e < n.count; e++) {
  47324. var r;
  47325. i.x = n.getX(e),
  47326. i.y = n.getY(e),
  47327. i.z = n.getZ(e),
  47328. i.w = n.getW(e),
  47329. (r = 1 / i.lengthManhattan()) !== 1 / 0 ? i.multiplyScalar(r) : i.set(1, 0, 0, 0),
  47330. n.setXYZW(e, i.x, i.y, i.z, i.w)
  47331. }
  47332. }
  47333. }
  47334. ,
  47335. Ci.SkinnedMesh.prototype.updateMatrixWorld = function(e) {
  47336. Ci.Mesh.prototype.updateMatrixWorld.call(this, !0),
  47337. "attached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.matrixWorld) : "detached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.bindMatrix) : console.warn("THREE.SkinnedMesh unrecognized bindMode: " + this.bindMode)
  47338. }
  47339. ,
  47340. Ci.SkinnedMesh.prototype.clone = function() {
  47341. return new this.constructor(this.geometry,this.material,this.useVertexTexture).copy(this)
  47342. }
  47343. ,
  47344. Ci.LOD = function() {
  47345. Ci.Object3D.call(this),
  47346. this.type = "LOD",
  47347. Object.defineProperties(this, {
  47348. levels: {
  47349. enumerable: !0,
  47350. value: []
  47351. },
  47352. objects: {
  47353. get: function() {
  47354. return console.warn("THREE.LOD: .objects has been renamed to .levels."),
  47355. this.levels
  47356. }
  47357. }
  47358. })
  47359. }
  47360. ,
  47361. Ci.LOD.prototype = Object.create(Ci.Object3D.prototype),
  47362. Ci.LOD.prototype.constructor = Ci.LOD,
  47363. Ci.LOD.prototype.addLevel = function(e, t) {
  47364. void 0 === t && (t = 0),
  47365. t = Math.abs(t);
  47366. for (var i = this.levels, n = 0; n < i.length && !(t < i[n].distance); n++)
  47367. ;
  47368. i.splice(n, 0, {
  47369. distance: t,
  47370. object: e
  47371. }),
  47372. this.add(e)
  47373. }
  47374. ,
  47375. Ci.LOD.prototype.getObjectForDistance = function(e) {
  47376. for (var t = this.levels, i = 1, n = t.length; i < n && !(e < t[i].distance); i++)
  47377. ;
  47378. return t[i - 1].object
  47379. }
  47380. ,
  47381. Ci.LOD.prototype.raycast = (bt = new Ci.Vector3,
  47382. function(e, t) {
  47383. bt.setFromMatrixPosition(this.matrixWorld);
  47384. var i = e.ray.origin.distanceTo(bt);
  47385. this.getObjectForDistance(i).raycast(e, t)
  47386. }
  47387. ),
  47388. Ci.LOD.prototype.update = (Et = new Ci.Vector3,
  47389. _t = new Ci.Vector3,
  47390. function(e) {
  47391. var t = this.levels;
  47392. if (1 < t.length) {
  47393. Et.setFromMatrixPosition(e.matrixWorld),
  47394. _t.setFromMatrixPosition(this.matrixWorld);
  47395. var i = Et.distanceTo(_t);
  47396. t[0].object.visible = !0;
  47397. for (var n = 1, r = t.length; n < r && i >= t[n].distance; n++)
  47398. t[n - 1].object.visible = !1,
  47399. t[n].object.visible = !0;
  47400. for (; n < r; n++)
  47401. t[n].object.visible = !1
  47402. }
  47403. }
  47404. ),
  47405. Ci.LOD.prototype.copy = function(e) {
  47406. Ci.Object3D.prototype.copy.call(this, e, !1);
  47407. for (var t = e.levels, i = 0, n = t.length; i < n; i++) {
  47408. var r = t[i];
  47409. this.addLevel(r.object.clone(), r.distance)
  47410. }
  47411. return this
  47412. }
  47413. ,
  47414. Ci.LOD.prototype.toJSON = function(e) {
  47415. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  47416. t.object.levels = [];
  47417. for (var i = this.levels, n = 0, r = i.length; n < r; n++) {
  47418. var o = i[n];
  47419. t.object.levels.push({
  47420. object: o.object.uuid,
  47421. distance: o.distance
  47422. })
  47423. }
  47424. return t
  47425. }
  47426. ,
  47427. Ci.Sprite = (yt = new Uint16Array([0, 1, 2, 0, 2, 3]),
  47428. At = new Float32Array([-.5, -.5, 0, .5, -.5, 0, .5, .5, 0, -.5, .5, 0]),
  47429. Ct = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]),
  47430. (It = new Ci.BufferGeometry).setIndex(new Ci.BufferAttribute(yt,1)),
  47431. It.addAttribute("position", new Ci.BufferAttribute(At,3)),
  47432. It.addAttribute("uv", new Ci.BufferAttribute(Ct,2)),
  47433. function(e) {
  47434. Ci.Object3D.call(this),
  47435. this.type = "Sprite",
  47436. this.geometry = It,
  47437. this.material = void 0 !== e ? e : new Ci.SpriteMaterial
  47438. }
  47439. ),
  47440. Ci.Sprite.prototype = Object.create(Ci.Object3D.prototype),
  47441. Ci.Sprite.prototype.constructor = Ci.Sprite,
  47442. Ci.Sprite.prototype.raycast = (vt = new Ci.Vector3,
  47443. function(e, t) {
  47444. vt.setFromMatrixPosition(this.matrixWorld);
  47445. var i = e.ray.distanceSqToPoint(vt);
  47446. this.scale.x * this.scale.y < i || t.push({
  47447. distance: Math.sqrt(i),
  47448. point: this.position,
  47449. face: null,
  47450. object: this
  47451. })
  47452. }
  47453. ),
  47454. Ci.Sprite.prototype.clone = function() {
  47455. return new this.constructor(this.material).copy(this)
  47456. }
  47457. ,
  47458. Ci.Particle = Ci.Sprite,
  47459. Ci.LensFlare = function(e, t, i, n, r) {
  47460. Ci.Object3D.call(this),
  47461. this.lensFlares = [],
  47462. this.positionScreen = new Ci.Vector3,
  47463. (this.customUpdateCallback = void 0) !== e && this.add(e, t, i, n, r)
  47464. }
  47465. ,
  47466. Ci.LensFlare.prototype = Object.create(Ci.Object3D.prototype),
  47467. Ci.LensFlare.prototype.constructor = Ci.LensFlare,
  47468. Ci.LensFlare.prototype.add = function(e, t, i, n, r, o) {
  47469. void 0 === t && (t = -1),
  47470. void 0 === i && (i = 0),
  47471. void 0 === o && (o = 1),
  47472. void 0 === r && (r = new Ci.Color(16777215)),
  47473. void 0 === n && (n = Ci.NormalBlending),
  47474. i = Math.min(i, Math.max(0, i)),
  47475. this.lensFlares.push({
  47476. texture: e,
  47477. size: t,
  47478. distance: i,
  47479. x: 0,
  47480. y: 0,
  47481. z: 0,
  47482. scale: 1,
  47483. rotation: 0,
  47484. opacity: o,
  47485. color: r,
  47486. blending: n
  47487. })
  47488. }
  47489. ,
  47490. Ci.LensFlare.prototype.updateLensFlares = function() {
  47491. var e, t, i = this.lensFlares.length, n = 2 * -this.positionScreen.x, r = 2 * -this.positionScreen.y;
  47492. for (e = 0; e < i; e++)
  47493. (t = this.lensFlares[e]).x = this.positionScreen.x + n * t.distance,
  47494. t.y = this.positionScreen.y + r * t.distance,
  47495. t.wantedRotation = t.x * Math.PI * .25,
  47496. t.rotation += .25 * (t.wantedRotation - t.rotation)
  47497. }
  47498. ,
  47499. Ci.LensFlare.prototype.copy = function(e) {
  47500. Ci.Object3D.prototype.copy.call(this, e),
  47501. this.positionScreen.copy(e.positionScreen),
  47502. this.customUpdateCallback = e.customUpdateCallback;
  47503. for (var t = 0, i = e.lensFlares.length; t < i; t++)
  47504. this.lensFlares.push(e.lensFlares[t]);
  47505. return this
  47506. }
  47507. ,
  47508. Ci.Scene = function() {
  47509. Ci.Object3D.call(this),
  47510. this.type = "Scene",
  47511. this.fog = null,
  47512. this.overrideMaterial = null,
  47513. this.autoUpdate = !0
  47514. }
  47515. ,
  47516. Ci.Scene.prototype = Object.create(Ci.Object3D.prototype),
  47517. Ci.Scene.prototype.constructor = Ci.Scene,
  47518. Ci.Scene.prototype.copy = function(e, t) {
  47519. return Ci.Object3D.prototype.copy.call(this, e, t),
  47520. null !== e.fog && (this.fog = e.fog.clone()),
  47521. null !== e.overrideMaterial && (this.overrideMaterial = e.overrideMaterial.clone()),
  47522. this.autoUpdate = e.autoUpdate,
  47523. this.matrixAutoUpdate = e.matrixAutoUpdate,
  47524. this
  47525. }
  47526. ,
  47527. Ci.Fog = function(e, t, i) {
  47528. this.name = "",
  47529. this.color = new Ci.Color(e),
  47530. this.near = void 0 !== t ? t : 1,
  47531. this.far = void 0 !== i ? i : 1e3
  47532. }
  47533. ,
  47534. Ci.Fog.prototype.clone = function() {
  47535. return new Ci.Fog(this.color.getHex(),this.near,this.far)
  47536. }
  47537. ,
  47538. Ci.FogExp2 = function(e, t) {
  47539. this.name = "",
  47540. this.color = new Ci.Color(e),
  47541. this.density = void 0 !== t ? t : 25e-5
  47542. }
  47543. ,
  47544. Ci.FogExp2.prototype.clone = function() {
  47545. return new Ci.FogExp2(this.color.getHex(),this.density)
  47546. }
  47547. ,
  47548. Ci.ShaderChunk = {},
  47549. Ci.ShaderChunk.alphamap_fragment = "#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n",
  47550. Ci.ShaderChunk.alphamap_pars_fragment = "#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n",
  47551. Ci.ShaderChunk.alphatest_fragment = "#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n",
  47552. 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",
  47553. Ci.ShaderChunk.aomap_pars_fragment = "#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",
  47554. Ci.ShaderChunk.begin_vertex = "\nvec3 transformed = vec3( position );\n",
  47555. Ci.ShaderChunk.beginnormal_vertex = "\nvec3 objectNormal = vec3( normal );\n",
  47556. 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",
  47557. 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",
  47558. Ci.ShaderChunk.color_fragment = "#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",
  47559. Ci.ShaderChunk.color_pars_fragment = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n",
  47560. Ci.ShaderChunk.color_pars_vertex = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",
  47561. Ci.ShaderChunk.color_vertex = "#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",
  47562. 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",
  47563. 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",
  47564. Ci.ShaderChunk.defaultnormal_vertex = "#ifdef FLIP_SIDED\n\tobjectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n",
  47565. Ci.ShaderChunk.displacementmap_vertex = "#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n",
  47566. Ci.ShaderChunk.displacementmap_pars_vertex = "#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n",
  47567. 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",
  47568. Ci.ShaderChunk.emissivemap_pars_fragment = "#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n",
  47569. 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",
  47570. Ci.ShaderChunk.encodings_fragment = " gl_FragColor = linearToOutputTexel( gl_FragColor );\n",
  47571. 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",
  47572. 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",
  47573. 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",
  47574. 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",
  47575. 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",
  47576. 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",
  47577. Ci.ShaderChunk.lightmap_fragment = "#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n",
  47578. Ci.ShaderChunk.lightmap_pars_fragment = "#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",
  47579. 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",
  47580. 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",
  47581. Ci.ShaderChunk.lights_phong_fragment = "BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",
  47582. 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",
  47583. Ci.ShaderChunk.lights_phong_pars_vertex = "#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\n",
  47584. Ci.ShaderChunk.lights_phong_vertex = "#ifdef USE_ENVMAP\n\tvWorldPosition = worldPosition.xyz;\n#endif\n",
  47585. 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",
  47586. 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",
  47587. 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",
  47588. Ci.ShaderChunk.logdepthbuf_fragment = "#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif",
  47589. 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",
  47590. 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",
  47591. 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",
  47592. Ci.ShaderChunk.map_fragment = "#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n",
  47593. Ci.ShaderChunk.map_pars_fragment = "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n",
  47594. 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",
  47595. Ci.ShaderChunk.map_particle_pars_fragment = "#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n",
  47596. Ci.ShaderChunk.metalnessmap_fragment = "float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.r;\n#endif\n",
  47597. Ci.ShaderChunk.metalnessmap_pars_fragment = "#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",
  47598. 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",
  47599. 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",
  47600. 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",
  47601. 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",
  47602. 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",
  47603. Ci.ShaderChunk.premultiplied_alpha_fragment = "#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n",
  47604. 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",
  47605. Ci.ShaderChunk.roughnessmap_fragment = "float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.r;\n#endif\n",
  47606. Ci.ShaderChunk.roughnessmap_pars_fragment = "#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",
  47607. 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",
  47608. 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",
  47609. 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",
  47610. 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",
  47611. 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",
  47612. 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",
  47613. 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",
  47614. 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",
  47615. 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",
  47616. Ci.ShaderChunk.specularmap_pars_fragment = "#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",
  47617. Ci.ShaderChunk.tonemapping_fragment = "#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n",
  47618. 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",
  47619. Ci.ShaderChunk.uv2_pars_fragment = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",
  47620. Ci.ShaderChunk.uv2_pars_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",
  47621. Ci.ShaderChunk.uv2_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",
  47622. 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",
  47623. 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",
  47624. 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",
  47625. 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",
  47626. Ci.UniformsUtils = {
  47627. merge: function(e) {
  47628. for (var t = {}, i = 0; i < e.length; i++) {
  47629. var n = this.clone(e[i]);
  47630. for (var r in n)
  47631. t[r] = n[r]
  47632. }
  47633. return t
  47634. },
  47635. clone: function(e) {
  47636. var t = {};
  47637. for (var i in e)
  47638. for (var n in t[i] = {},
  47639. e[i]) {
  47640. var r = e[i][n];
  47641. 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
  47642. }
  47643. return t
  47644. }
  47645. },
  47646. Ci.UniformsLib = {
  47647. common: {
  47648. diffuse: {
  47649. type: "c",
  47650. value: new Ci.Color(15658734)
  47651. },
  47652. opacity: {
  47653. type: "f",
  47654. value: 1
  47655. },
  47656. map: {
  47657. type: "t",
  47658. value: null
  47659. },
  47660. offsetRepeat: {
  47661. type: "v4",
  47662. value: new Ci.Vector4(0,0,1,1)
  47663. },
  47664. specularMap: {
  47665. type: "t",
  47666. value: null
  47667. },
  47668. alphaMap: {
  47669. type: "t",
  47670. value: null
  47671. },
  47672. envMap: {
  47673. type: "t",
  47674. value: null
  47675. },
  47676. flipEnvMap: {
  47677. type: "f",
  47678. value: -1
  47679. },
  47680. reflectivity: {
  47681. type: "f",
  47682. value: 1
  47683. },
  47684. refractionRatio: {
  47685. type: "f",
  47686. value: .98
  47687. }
  47688. },
  47689. aomap: {
  47690. aoMap: {
  47691. type: "t",
  47692. value: null
  47693. },
  47694. aoMapIntensity: {
  47695. type: "f",
  47696. value: 1
  47697. }
  47698. },
  47699. lightmap: {
  47700. lightMap: {
  47701. type: "t",
  47702. value: null
  47703. },
  47704. lightMapIntensity: {
  47705. type: "f",
  47706. value: 1
  47707. }
  47708. },
  47709. emissivemap: {
  47710. emissiveMap: {
  47711. type: "t",
  47712. value: null
  47713. }
  47714. },
  47715. bumpmap: {
  47716. bumpMap: {
  47717. type: "t",
  47718. value: null
  47719. },
  47720. bumpScale: {
  47721. type: "f",
  47722. value: 1
  47723. }
  47724. },
  47725. normalmap: {
  47726. normalMap: {
  47727. type: "t",
  47728. value: null
  47729. },
  47730. normalScale: {
  47731. type: "v2",
  47732. value: new Ci.Vector2(1,1)
  47733. }
  47734. },
  47735. displacementmap: {
  47736. displacementMap: {
  47737. type: "t",
  47738. value: null
  47739. },
  47740. displacementScale: {
  47741. type: "f",
  47742. value: 1
  47743. },
  47744. displacementBias: {
  47745. type: "f",
  47746. value: 0
  47747. }
  47748. },
  47749. roughnessmap: {
  47750. roughnessMap: {
  47751. type: "t",
  47752. value: null
  47753. }
  47754. },
  47755. metalnessmap: {
  47756. metalnessMap: {
  47757. type: "t",
  47758. value: null
  47759. }
  47760. },
  47761. fog: {
  47762. fogDensity: {
  47763. type: "f",
  47764. value: 25e-5
  47765. },
  47766. fogNear: {
  47767. type: "f",
  47768. value: 1
  47769. },
  47770. fogFar: {
  47771. type: "f",
  47772. value: 2e3
  47773. },
  47774. fogColor: {
  47775. type: "c",
  47776. value: new Ci.Color(16777215)
  47777. }
  47778. },
  47779. lights: {
  47780. ambientLightColor: {
  47781. type: "fv",
  47782. value: []
  47783. },
  47784. directionalLights: {
  47785. type: "sa",
  47786. value: [],
  47787. properties: {
  47788. direction: {
  47789. type: "v3"
  47790. },
  47791. color: {
  47792. type: "c"
  47793. },
  47794. shadow: {
  47795. type: "i"
  47796. },
  47797. shadowBias: {
  47798. type: "f"
  47799. },
  47800. shadowRadius: {
  47801. type: "f"
  47802. },
  47803. shadowMapSize: {
  47804. type: "v2"
  47805. }
  47806. }
  47807. },
  47808. directionalShadowMap: {
  47809. type: "tv",
  47810. value: []
  47811. },
  47812. directionalShadowMatrix: {
  47813. type: "m4v",
  47814. value: []
  47815. },
  47816. spotLights: {
  47817. type: "sa",
  47818. value: [],
  47819. properties: {
  47820. color: {
  47821. type: "c"
  47822. },
  47823. position: {
  47824. type: "v3"
  47825. },
  47826. direction: {
  47827. type: "v3"
  47828. },
  47829. distance: {
  47830. type: "f"
  47831. },
  47832. coneCos: {
  47833. type: "f"
  47834. },
  47835. penumbraCos: {
  47836. type: "f"
  47837. },
  47838. decay: {
  47839. type: "f"
  47840. },
  47841. shadow: {
  47842. type: "i"
  47843. },
  47844. shadowBias: {
  47845. type: "f"
  47846. },
  47847. shadowRadius: {
  47848. type: "f"
  47849. },
  47850. shadowMapSize: {
  47851. type: "v2"
  47852. }
  47853. }
  47854. },
  47855. spotShadowMap: {
  47856. type: "tv",
  47857. value: []
  47858. },
  47859. spotShadowMatrix: {
  47860. type: "m4v",
  47861. value: []
  47862. },
  47863. pointLights: {
  47864. type: "sa",
  47865. value: [],
  47866. properties: {
  47867. color: {
  47868. type: "c"
  47869. },
  47870. position: {
  47871. type: "v3"
  47872. },
  47873. decay: {
  47874. type: "f"
  47875. },
  47876. distance: {
  47877. type: "f"
  47878. },
  47879. shadow: {
  47880. type: "i"
  47881. },
  47882. shadowBias: {
  47883. type: "f"
  47884. },
  47885. shadowRadius: {
  47886. type: "f"
  47887. },
  47888. shadowMapSize: {
  47889. type: "v2"
  47890. }
  47891. }
  47892. },
  47893. pointShadowMap: {
  47894. type: "tv",
  47895. value: []
  47896. },
  47897. pointShadowMatrix: {
  47898. type: "m4v",
  47899. value: []
  47900. },
  47901. hemisphereLights: {
  47902. type: "sa",
  47903. value: [],
  47904. properties: {
  47905. direction: {
  47906. type: "v3"
  47907. },
  47908. skyColor: {
  47909. type: "c"
  47910. },
  47911. groundColor: {
  47912. type: "c"
  47913. }
  47914. }
  47915. }
  47916. },
  47917. points: {
  47918. diffuse: {
  47919. type: "c",
  47920. value: new Ci.Color(15658734)
  47921. },
  47922. opacity: {
  47923. type: "f",
  47924. value: 1
  47925. },
  47926. size: {
  47927. type: "f",
  47928. value: 1
  47929. },
  47930. scale: {
  47931. type: "f",
  47932. value: 1
  47933. },
  47934. map: {
  47935. type: "t",
  47936. value: null
  47937. },
  47938. offsetRepeat: {
  47939. type: "v4",
  47940. value: new Ci.Vector4(0,0,1,1)
  47941. }
  47942. }
  47943. },
  47944. 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",
  47945. 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",
  47946. 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",
  47947. 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",
  47948. 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",
  47949. 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",
  47950. 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",
  47951. 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",
  47952. 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",
  47953. 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",
  47954. 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",
  47955. 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",
  47956. 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",
  47957. 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",
  47958. 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",
  47959. 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",
  47960. 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",
  47961. 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",
  47962. 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",
  47963. 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",
  47964. 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",
  47965. 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",
  47966. 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",
  47967. 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",
  47968. Ci.ShaderLib = {
  47969. basic: {
  47970. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.aomap, Ci.UniformsLib.fog]),
  47971. vertexShader: Ci.ShaderChunk.meshbasic_vert,
  47972. fragmentShader: Ci.ShaderChunk.meshbasic_frag
  47973. },
  47974. lambert: {
  47975. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.aomap, Ci.UniformsLib.lightmap, Ci.UniformsLib.emissivemap, Ci.UniformsLib.fog, Ci.UniformsLib.lights, {
  47976. emissive: {
  47977. type: "c",
  47978. value: new Ci.Color(0)
  47979. }
  47980. }]),
  47981. vertexShader: Ci.ShaderChunk.meshlambert_vert,
  47982. fragmentShader: Ci.ShaderChunk.meshlambert_frag
  47983. },
  47984. phong: {
  47985. 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, {
  47986. emissive: {
  47987. type: "c",
  47988. value: new Ci.Color(0)
  47989. },
  47990. specular: {
  47991. type: "c",
  47992. value: new Ci.Color(1118481)
  47993. },
  47994. shininess: {
  47995. type: "f",
  47996. value: 30
  47997. }
  47998. }]),
  47999. vertexShader: Ci.ShaderChunk.meshphong_vert,
  48000. fragmentShader: Ci.ShaderChunk.meshphong_frag
  48001. },
  48002. standard: {
  48003. 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, {
  48004. emissive: {
  48005. type: "c",
  48006. value: new Ci.Color(0)
  48007. },
  48008. roughness: {
  48009. type: "f",
  48010. value: .5
  48011. },
  48012. metalness: {
  48013. type: "f",
  48014. value: 0
  48015. },
  48016. envMapIntensity: {
  48017. type: "f",
  48018. value: 1
  48019. }
  48020. }]),
  48021. vertexShader: Ci.ShaderChunk.meshstandard_vert,
  48022. fragmentShader: Ci.ShaderChunk.meshstandard_frag
  48023. },
  48024. points: {
  48025. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.points, Ci.UniformsLib.fog]),
  48026. vertexShader: Ci.ShaderChunk.points_vert,
  48027. fragmentShader: Ci.ShaderChunk.points_frag
  48028. },
  48029. dashed: {
  48030. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.fog, {
  48031. scale: {
  48032. type: "f",
  48033. value: 1
  48034. },
  48035. dashSize: {
  48036. type: "f",
  48037. value: 1
  48038. },
  48039. totalSize: {
  48040. type: "f",
  48041. value: 2
  48042. }
  48043. }]),
  48044. vertexShader: Ci.ShaderChunk.linedashed_vert,
  48045. fragmentShader: Ci.ShaderChunk.linedashed_frag
  48046. },
  48047. depth: {
  48048. uniforms: {
  48049. mNear: {
  48050. type: "f",
  48051. value: 1
  48052. },
  48053. mFar: {
  48054. type: "f",
  48055. value: 2e3
  48056. },
  48057. opacity: {
  48058. type: "f",
  48059. value: 1
  48060. }
  48061. },
  48062. vertexShader: Ci.ShaderChunk.depth_vert,
  48063. fragmentShader: Ci.ShaderChunk.depth_frag
  48064. },
  48065. normal: {
  48066. uniforms: {
  48067. opacity: {
  48068. type: "f",
  48069. value: 1
  48070. }
  48071. },
  48072. vertexShader: Ci.ShaderChunk.normal_vert,
  48073. fragmentShader: Ci.ShaderChunk.normal_frag
  48074. },
  48075. cube: {
  48076. uniforms: {
  48077. tCube: {
  48078. type: "t",
  48079. value: null
  48080. },
  48081. tFlip: {
  48082. type: "f",
  48083. value: -1
  48084. }
  48085. },
  48086. vertexShader: Ci.ShaderChunk.cube_vert,
  48087. fragmentShader: Ci.ShaderChunk.cube_frag
  48088. },
  48089. equirect: {
  48090. uniforms: {
  48091. tEquirect: {
  48092. type: "t",
  48093. value: null
  48094. },
  48095. tFlip: {
  48096. type: "f",
  48097. value: -1
  48098. }
  48099. },
  48100. vertexShader: Ci.ShaderChunk.equirect_vert,
  48101. fragmentShader: Ci.ShaderChunk.equirect_frag
  48102. },
  48103. depthRGBA: {
  48104. uniforms: {},
  48105. vertexShader: Ci.ShaderChunk.depthRGBA_vert,
  48106. fragmentShader: Ci.ShaderChunk.depthRGBA_frag
  48107. },
  48108. distanceRGBA: {
  48109. uniforms: {
  48110. lightPos: {
  48111. type: "v3",
  48112. value: new Ci.Vector3(0,0,0)
  48113. }
  48114. },
  48115. vertexShader: Ci.ShaderChunk.distanceRGBA_vert,
  48116. fragmentShader: Ci.ShaderChunk.distanceRGBA_frag
  48117. }
  48118. },
  48119. Ci.WebGLRenderer = function(e) {
  48120. function S() {
  48121. return null === Q ? he : 1
  48122. }
  48123. function i(e, t, i, n) {
  48124. !0 === V && (e *= n,
  48125. t *= n,
  48126. i *= n),
  48127. _e.clearColor(e, t, i, n)
  48128. }
  48129. function t() {
  48130. _e.init(),
  48131. _e.scissor(ie.copy(ue).multiplyScalar(he)),
  48132. _e.viewport(re.copy(pe).multiplyScalar(he)),
  48133. i(ae.r, ae.g, ae.b, se)
  48134. }
  48135. function n() {
  48136. te = K = null,
  48137. ee = "",
  48138. $ = -1,
  48139. _e.reset()
  48140. }
  48141. function r(e) {
  48142. e.preventDefault(),
  48143. n(),
  48144. t(),
  48145. be.clear()
  48146. }
  48147. function f(e) {
  48148. var t = e.target;
  48149. t.removeEventListener("dispose", f),
  48150. function(e) {
  48151. var t = be.get(e);
  48152. if (e.image && t.__image__webglTextureCube)
  48153. X.deleteTexture(t.__image__webglTextureCube);
  48154. else {
  48155. if (void 0 === t.__webglInit)
  48156. return;
  48157. X.deleteTexture(t.__webglTexture)
  48158. }
  48159. be.delete(e)
  48160. }(t),
  48161. ye.textures--
  48162. }
  48163. function a(e) {
  48164. var t = e.target;
  48165. t.removeEventListener("dispose", a),
  48166. function(e) {
  48167. var t = be.get(e)
  48168. , i = be.get(e.texture);
  48169. if (e && void 0 !== i.__webglTexture) {
  48170. if (X.deleteTexture(i.__webglTexture),
  48171. e instanceof Ci.WebGLRenderTargetCube)
  48172. for (var n = 0; n < 6; n++)
  48173. X.deleteFramebuffer(t.__webglFramebuffer[n]),
  48174. X.deleteRenderbuffer(t.__webglDepthbuffer[n]);
  48175. else
  48176. X.deleteFramebuffer(t.__webglFramebuffer),
  48177. X.deleteRenderbuffer(t.__webglDepthbuffer);
  48178. be.delete(e.texture),
  48179. be.delete(e)
  48180. }
  48181. }(t),
  48182. ye.textures--
  48183. }
  48184. function v(e) {
  48185. var t = e.target;
  48186. t.removeEventListener("dispose", v),
  48187. function(e) {
  48188. y(e),
  48189. be.delete(e)
  48190. }(t)
  48191. }
  48192. function y(e) {
  48193. var t = be.get(e).program;
  48194. (e.program = void 0) !== t && Te.releaseProgram(t)
  48195. }
  48196. function M(e, t) {
  48197. return Math.abs(t[0]) - Math.abs(e[0])
  48198. }
  48199. function s(e, t) {
  48200. 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
  48201. }
  48202. function l(e, t) {
  48203. 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
  48204. }
  48205. function d(e, t, i, n, r) {
  48206. var o, a;
  48207. a = i.transparent ? (o = G,
  48208. ++W) : (o = H,
  48209. ++z);
  48210. var s = o[a];
  48211. void 0 !== s ? (s.id = e.id,
  48212. s.object = e,
  48213. s.geometry = t,
  48214. s.material = i,
  48215. s.z = me.z,
  48216. s.group = r) : (s = {
  48217. id: e.id,
  48218. object: e,
  48219. geometry: t,
  48220. material: i,
  48221. z: me.z,
  48222. group: r
  48223. },
  48224. o.push(s))
  48225. }
  48226. function c(e, t, i, n) {
  48227. for (var r = 0, o = e.length; r < o; r++) {
  48228. var a = e[r]
  48229. , s = a.object
  48230. , l = a.geometry
  48231. , c = void 0 === n ? a.material : n
  48232. , h = a.group;
  48233. if (s.modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, s.matrixWorld),
  48234. s.normalMatrix.getNormalMatrix(s.modelViewMatrix),
  48235. s instanceof Ci.ImmediateRenderObject) {
  48236. R(c);
  48237. var u = P(t, i, c, s);
  48238. ee = "",
  48239. s.render(function(e) {
  48240. Z.renderBufferImmediate(e, u, c)
  48241. })
  48242. } else
  48243. Z.renderBufferDirect(t, i, l, c, s, h)
  48244. }
  48245. }
  48246. function R(e) {
  48247. (function(e) {
  48248. e.side !== Ci.DoubleSide ? _e.enable(X.CULL_FACE) : _e.disable(X.CULL_FACE),
  48249. _e.setFlipSided(e.side === Ci.BackSide)
  48250. }
  48251. )(e),
  48252. !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),
  48253. _e.setDepthFunc(e.depthFunc),
  48254. _e.setDepthTest(e.depthTest),
  48255. _e.setDepthWrite(e.depthWrite),
  48256. _e.setColorWrite(e.colorWrite),
  48257. _e.setPolygonOffset(e.polygonOffset, e.polygonOffsetFactor, e.polygonOffsetUnits)
  48258. }
  48259. function P(e, t, i, n) {
  48260. oe = 0;
  48261. var r = be.get(i);
  48262. void 0 === r.program && (i.needsUpdate = !0),
  48263. void 0 !== r.lightsHash && r.lightsHash !== ve.hash && (i.needsUpdate = !0),
  48264. i.needsUpdate && (function(e, t, i) {
  48265. var n = be.get(e)
  48266. , r = Te.getParameters(e, ve, t, i)
  48267. , o = Te.getProgramCode(e, r)
  48268. , a = n.program
  48269. , s = !0;
  48270. if (void 0 === a)
  48271. e.addEventListener("dispose", v);
  48272. else if (a.code !== o)
  48273. y(e);
  48274. else {
  48275. if (void 0 !== r.shaderID)
  48276. return;
  48277. s = !1
  48278. }
  48279. if (s) {
  48280. if (r.shaderID) {
  48281. var l = Ci.ShaderLib[r.shaderID];
  48282. n.__webglShader = {
  48283. name: e.type,
  48284. uniforms: Ci.UniformsUtils.clone(l.uniforms),
  48285. vertexShader: l.vertexShader,
  48286. fragmentShader: l.fragmentShader
  48287. }
  48288. } else
  48289. n.__webglShader = {
  48290. name: e.type,
  48291. uniforms: e.uniforms,
  48292. vertexShader: e.vertexShader,
  48293. fragmentShader: e.fragmentShader
  48294. };
  48295. e.__webglShader = n.__webglShader,
  48296. a = Te.acquireProgram(e, r, o),
  48297. n.program = a,
  48298. e.program = a
  48299. }
  48300. var c = a.getAttributes();
  48301. if (e.morphTargets)
  48302. for (var h = e.numSupportedMorphTargets = 0; h < Z.maxMorphTargets; h++)
  48303. 0 <= c["morphTarget" + h] && e.numSupportedMorphTargets++;
  48304. if (e.morphNormals)
  48305. for (h = e.numSupportedMorphNormals = 0; h < Z.maxMorphNormals; h++)
  48306. 0 <= c["morphNormal" + h] && e.numSupportedMorphNormals++;
  48307. n.uniformsList = [];
  48308. var u = n.__webglShader.uniforms
  48309. , d = n.program.getUniforms();
  48310. for (var p in u) {
  48311. var f = d[p];
  48312. f && n.uniformsList.push([n.__webglShader.uniforms[p], f])
  48313. }
  48314. (e instanceof Ci.MeshPhongMaterial || e instanceof Ci.MeshLambertMaterial || e instanceof Ci.MeshStandardMaterial || e.lights) && (n.lightsHash = ve.hash,
  48315. u.ambientLightColor.value = ve.ambient,
  48316. u.directionalLights.value = ve.directional,
  48317. u.spotLights.value = ve.spot,
  48318. u.pointLights.value = ve.point,
  48319. u.hemisphereLights.value = ve.hemi,
  48320. u.directionalShadowMap.value = ve.directionalShadowMap,
  48321. u.directionalShadowMatrix.value = ve.directionalShadowMatrix,
  48322. u.spotShadowMap.value = ve.spotShadowMap,
  48323. u.spotShadowMatrix.value = ve.spotShadowMatrix,
  48324. u.pointShadowMap.value = ve.pointShadowMap,
  48325. u.pointShadowMatrix.value = ve.pointShadowMatrix),
  48326. n.hasDynamicUniforms = !1;
  48327. for (var g = 0, m = n.uniformsList.length; g < m; g++) {
  48328. if (!0 === n.uniformsList[g][0].dynamic) {
  48329. n.hasDynamicUniforms = !0;
  48330. break
  48331. }
  48332. }
  48333. }(i, t, n),
  48334. i.needsUpdate = !1);
  48335. var o = !1
  48336. , a = !1
  48337. , s = !1
  48338. , l = r.program
  48339. , c = l.getUniforms()
  48340. , h = r.__webglShader.uniforms;
  48341. if (l.id !== K && (X.useProgram(l.program),
  48342. K = l.id,
  48343. s = a = o = !0),
  48344. i.id !== $ && ($ = i.id,
  48345. a = !0),
  48346. !o && e === te || (X.uniformMatrix4fv(c.projectionMatrix, !1, e.projectionMatrix.elements),
  48347. Ee.logarithmicDepthBuffer && X.uniform1f(c.logDepthBufFC, 2 / (Math.log(e.far + 1) / Math.LN2)),
  48348. e !== te && (te = e,
  48349. s = a = !0),
  48350. (i instanceof Ci.ShaderMaterial || i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshStandardMaterial || i.envMap) && void 0 !== c.cameraPosition && (me.setFromMatrixPosition(e.matrixWorld),
  48351. X.uniform3f(c.cameraPosition, me.x, me.y, me.z)),
  48352. (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),
  48353. void 0 !== c.toneMappingExposure && X.uniform1f(c.toneMappingExposure, Z.toneMappingExposure),
  48354. void 0 !== c.toneMappingWhitePoint && X.uniform1f(c.toneMappingWhitePoint, Z.toneMappingWhitePoint)),
  48355. i.skinning)
  48356. if (n.bindMatrix && void 0 !== c.bindMatrix && X.uniformMatrix4fv(c.bindMatrix, !1, n.bindMatrix.elements),
  48357. n.bindMatrixInverse && void 0 !== c.bindMatrixInverse && X.uniformMatrix4fv(c.bindMatrixInverse, !1, n.bindMatrixInverse.elements),
  48358. Ee.floatVertexTextures && n.skeleton && n.skeleton.useVertexTexture) {
  48359. if (void 0 !== c.boneTexture) {
  48360. var u = A();
  48361. X.uniform1i(c.boneTexture, u),
  48362. Z.setTexture(n.skeleton.boneTexture, u)
  48363. }
  48364. void 0 !== c.boneTextureWidth && X.uniform1i(c.boneTextureWidth, n.skeleton.boneTextureWidth),
  48365. void 0 !== c.boneTextureHeight && X.uniform1i(c.boneTextureHeight, n.skeleton.boneTextureHeight)
  48366. } else
  48367. n.skeleton && n.skeleton.boneMatrices && void 0 !== c.boneGlobalMatrices && X.uniformMatrix4fv(c.boneGlobalMatrices, !1, n.skeleton.boneMatrices);
  48368. return a && ((i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshLambertMaterial || i instanceof Ci.MeshStandardMaterial || i.lights) && function(e, t) {
  48369. e.ambientLightColor.needsUpdate = t,
  48370. e.directionalLights.needsUpdate = t,
  48371. e.pointLights.needsUpdate = t,
  48372. e.spotLights.needsUpdate = t,
  48373. e.hemisphereLights.needsUpdate = t
  48374. }(h, s),
  48375. t && i.fog && function(e, t) {
  48376. e.fogColor.value = t.color,
  48377. t instanceof Ci.Fog ? (e.fogNear.value = t.near,
  48378. e.fogFar.value = t.far) : t instanceof Ci.FogExp2 && (e.fogDensity.value = t.density)
  48379. }(h, t),
  48380. (i instanceof Ci.MeshBasicMaterial || i instanceof Ci.MeshLambertMaterial || i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshStandardMaterial) && function(e, t) {
  48381. var i;
  48382. if (e.opacity.value = t.opacity,
  48383. e.diffuse.value = t.color,
  48384. t.emissive && e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),
  48385. e.map.value = t.map,
  48386. e.specularMap.value = t.specularMap,
  48387. e.alphaMap.value = t.alphaMap,
  48388. t.aoMap && (e.aoMap.value = t.aoMap,
  48389. e.aoMapIntensity.value = t.aoMapIntensity),
  48390. 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),
  48391. void 0 !== i) {
  48392. i instanceof Ci.WebGLRenderTarget && (i = i.texture);
  48393. var n = i.offset
  48394. , r = i.repeat;
  48395. e.offsetRepeat.value.set(n.x, n.y, r.x, r.y)
  48396. }
  48397. e.envMap.value = t.envMap,
  48398. e.flipEnvMap.value = t.envMap instanceof Ci.WebGLRenderTargetCube ? 1 : -1,
  48399. e.reflectivity.value = t.reflectivity,
  48400. e.refractionRatio.value = t.refractionRatio
  48401. }(h, i),
  48402. i instanceof Ci.LineBasicMaterial ? p(h, i) : i instanceof Ci.LineDashedMaterial ? (p(h, i),
  48403. function(e, t) {
  48404. e.dashSize.value = t.dashSize,
  48405. e.totalSize.value = t.dashSize + t.gapSize,
  48406. e.scale.value = t.scale
  48407. }(h, i)) : i instanceof Ci.PointsMaterial ? function(e, t) {
  48408. if (e.diffuse.value = t.color,
  48409. e.opacity.value = t.opacity,
  48410. e.size.value = t.size * he,
  48411. e.scale.value = O.clientHeight / 2,
  48412. e.map.value = t.map,
  48413. null !== t.map) {
  48414. var i = t.map.offset
  48415. , n = t.map.repeat;
  48416. e.offsetRepeat.value.set(i.x, i.y, n.x, n.y)
  48417. }
  48418. }(h, i) : i instanceof Ci.MeshLambertMaterial ? function(e, t) {
  48419. t.lightMap && (e.lightMap.value = t.lightMap,
  48420. e.lightMapIntensity.value = t.lightMapIntensity),
  48421. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap)
  48422. }(h, i) : i instanceof Ci.MeshPhongMaterial ? function(e, t) {
  48423. e.specular.value = t.specular,
  48424. e.shininess.value = Math.max(t.shininess, 1e-4),
  48425. t.lightMap && (e.lightMap.value = t.lightMap,
  48426. e.lightMapIntensity.value = t.lightMapIntensity),
  48427. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  48428. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  48429. e.bumpScale.value = t.bumpScale),
  48430. t.normalMap && (e.normalMap.value = t.normalMap,
  48431. e.normalScale.value.copy(t.normalScale)),
  48432. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  48433. e.displacementScale.value = t.displacementScale,
  48434. e.displacementBias.value = t.displacementBias)
  48435. }(h, i) : i instanceof Ci.MeshStandardMaterial ? function(e, t) {
  48436. e.roughness.value = t.roughness,
  48437. e.metalness.value = t.metalness,
  48438. t.roughnessMap && (e.roughnessMap.value = t.roughnessMap),
  48439. t.metalnessMap && (e.metalnessMap.value = t.metalnessMap),
  48440. t.lightMap && (e.lightMap.value = t.lightMap,
  48441. e.lightMapIntensity.value = t.lightMapIntensity),
  48442. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  48443. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  48444. e.bumpScale.value = t.bumpScale),
  48445. t.normalMap && (e.normalMap.value = t.normalMap,
  48446. e.normalScale.value.copy(t.normalScale)),
  48447. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  48448. e.displacementScale.value = t.displacementScale,
  48449. e.displacementBias.value = t.displacementBias),
  48450. t.envMap && (e.envMapIntensity.value = t.envMapIntensity)
  48451. }(h, i) : i instanceof Ci.MeshDepthMaterial ? (h.mNear.value = e.near,
  48452. h.mFar.value = e.far,
  48453. h.opacity.value = i.opacity) : i instanceof Ci.MeshNormalMaterial && (h.opacity.value = i.opacity),
  48454. g(r.uniformsList)),
  48455. function(e, t) {
  48456. X.uniformMatrix4fv(e.modelViewMatrix, !1, t.modelViewMatrix.elements),
  48457. e.normalMatrix && X.uniformMatrix3fv(e.normalMatrix, !1, t.normalMatrix.elements)
  48458. }(c, n),
  48459. void 0 !== c.modelMatrix && X.uniformMatrix4fv(c.modelMatrix, !1, n.matrixWorld.elements),
  48460. !0 === r.hasDynamicUniforms && function(e, t, i) {
  48461. for (var n = [], r = 0, o = e.length; r < o; r++) {
  48462. var a = e[r][0]
  48463. , s = a.onUpdateCallback;
  48464. void 0 !== s && (s.bind(a)(t, i),
  48465. n.push(e[r]))
  48466. }
  48467. g(n)
  48468. }(r.uniformsList, n, e),
  48469. l
  48470. }
  48471. function p(e, t) {
  48472. e.diffuse.value = t.color,
  48473. e.opacity.value = t.opacity
  48474. }
  48475. function A() {
  48476. var e = oe;
  48477. return e >= Ee.maxTextures && console.warn("WebGLRenderer: trying to use " + e + " texture units while this GPU supports only " + Ee.maxTextures),
  48478. oe += 1,
  48479. e
  48480. }
  48481. function C(e, t, i, n) {
  48482. var r, o;
  48483. if ("1i" === t)
  48484. X.uniform1i(i, n);
  48485. else if ("1f" === t)
  48486. X.uniform1f(i, n);
  48487. else if ("2f" === t)
  48488. X.uniform2f(i, n[0], n[1]);
  48489. else if ("3f" === t)
  48490. X.uniform3f(i, n[0], n[1], n[2]);
  48491. else if ("4f" === t)
  48492. X.uniform4f(i, n[0], n[1], n[2], n[3]);
  48493. else if ("1iv" === t)
  48494. X.uniform1iv(i, n);
  48495. else if ("3iv" === t)
  48496. X.uniform3iv(i, n);
  48497. else if ("1fv" === t)
  48498. X.uniform1fv(i, n);
  48499. else if ("2fv" === t)
  48500. X.uniform2fv(i, n);
  48501. else if ("3fv" === t)
  48502. X.uniform3fv(i, n);
  48503. else if ("4fv" === t)
  48504. X.uniform4fv(i, n);
  48505. else if ("Matrix2fv" === t)
  48506. X.uniformMatrix2fv(i, !1, n);
  48507. else if ("Matrix3fv" === t)
  48508. X.uniformMatrix3fv(i, !1, n);
  48509. else if ("Matrix4fv" === t)
  48510. X.uniformMatrix4fv(i, !1, n);
  48511. else if ("i" === t)
  48512. X.uniform1i(i, n);
  48513. else if ("f" === t)
  48514. X.uniform1f(i, n);
  48515. else if ("v2" === t)
  48516. X.uniform2f(i, n.x, n.y);
  48517. else if ("v3" === t)
  48518. X.uniform3f(i, n.x, n.y, n.z);
  48519. else if ("v4" === t)
  48520. X.uniform4f(i, n.x, n.y, n.z, n.w);
  48521. else if ("c" === t)
  48522. X.uniform3f(i, n.r, n.g, n.b);
  48523. else if ("s" === t) {
  48524. var a = e.properties;
  48525. for (var s in a) {
  48526. var l = a[s]
  48527. , c = i[s]
  48528. , h = n[s];
  48529. C(l, l.type, c, h)
  48530. }
  48531. } else if ("sa" === t) {
  48532. a = e.properties;
  48533. for (var u = 0, d = n.length; u < d; u++)
  48534. for (var s in a) {
  48535. l = a[s],
  48536. c = i[u][s],
  48537. h = n[u][s];
  48538. C(l, l.type, c, h)
  48539. }
  48540. } else if ("iv1" === t)
  48541. X.uniform1iv(i, n);
  48542. else if ("iv" === t)
  48543. X.uniform3iv(i, n);
  48544. else if ("fv1" === t)
  48545. X.uniform1fv(i, n);
  48546. else if ("fv" === t)
  48547. X.uniform3fv(i, n);
  48548. else if ("v2v" === t) {
  48549. void 0 === e._array && (e._array = new Float32Array(2 * n.length));
  48550. u = 0;
  48551. for (var p = 0, f = n.length; u < f; u++,
  48552. p += 2)
  48553. e._array[p + 0] = n[u].x,
  48554. e._array[p + 1] = n[u].y;
  48555. X.uniform2fv(i, e._array)
  48556. } else if ("v3v" === t) {
  48557. void 0 === e._array && (e._array = new Float32Array(3 * n.length));
  48558. u = 0;
  48559. var g = 0;
  48560. for (f = n.length; u < f; u++,
  48561. g += 3)
  48562. e._array[g + 0] = n[u].x,
  48563. e._array[g + 1] = n[u].y,
  48564. e._array[g + 2] = n[u].z;
  48565. X.uniform3fv(i, e._array)
  48566. } else if ("v4v" === t) {
  48567. void 0 === e._array && (e._array = new Float32Array(4 * n.length));
  48568. u = 0;
  48569. var m = 0;
  48570. for (f = n.length; u < f; u++,
  48571. m += 4)
  48572. e._array[m + 0] = n[u].x,
  48573. e._array[m + 1] = n[u].y,
  48574. e._array[m + 2] = n[u].z,
  48575. e._array[m + 3] = n[u].w;
  48576. X.uniform4fv(i, e._array)
  48577. } else if ("m2" === t)
  48578. X.uniformMatrix2fv(i, !1, n.elements);
  48579. else if ("m3" === t)
  48580. X.uniformMatrix3fv(i, !1, n.elements);
  48581. else if ("m3v" === t) {
  48582. void 0 === e._array && (e._array = new Float32Array(9 * n.length));
  48583. for (u = 0,
  48584. f = n.length; u < f; u++)
  48585. n[u].flattenToArrayOffset(e._array, 9 * u);
  48586. X.uniformMatrix3fv(i, !1, e._array)
  48587. } else if ("m4" === t)
  48588. X.uniformMatrix4fv(i, !1, n.elements);
  48589. else if ("m4v" === t) {
  48590. void 0 === e._array && (e._array = new Float32Array(16 * n.length));
  48591. for (u = 0,
  48592. f = n.length; u < f; u++)
  48593. n[u].flattenToArrayOffset(e._array, 16 * u);
  48594. X.uniformMatrix4fv(i, !1, e._array)
  48595. } else if ("t" === t) {
  48596. if (r = n,
  48597. o = A(),
  48598. X.uniform1i(i, o),
  48599. !r)
  48600. return;
  48601. 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)
  48602. } else if ("tv" === t) {
  48603. void 0 === e._array && (e._array = []);
  48604. for (u = 0,
  48605. f = e.value.length; u < f; u++)
  48606. e._array[u] = A();
  48607. X.uniform1iv(i, e._array);
  48608. for (u = 0,
  48609. f = e.value.length; u < f; u++)
  48610. r = e.value[u],
  48611. o = e._array[u],
  48612. 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))
  48613. } else
  48614. console.warn("THREE.WebGLRenderer: Unknown uniform type: " + t)
  48615. }
  48616. function g(e) {
  48617. for (var t = 0, i = e.length; t < i; t++) {
  48618. var n = e[t][0];
  48619. if (!1 !== n.needsUpdate)
  48620. C(n, n.type, e[t][1], n.value)
  48621. }
  48622. }
  48623. function m(e, t, i) {
  48624. var n;
  48625. if (i ? (X.texParameteri(e, X.TEXTURE_WRAP_S, x(t.wrapS)),
  48626. X.texParameteri(e, X.TEXTURE_WRAP_T, x(t.wrapT)),
  48627. X.texParameteri(e, X.TEXTURE_MAG_FILTER, x(t.magFilter)),
  48628. X.texParameteri(e, X.TEXTURE_MIN_FILTER, x(t.minFilter))) : (X.texParameteri(e, X.TEXTURE_WRAP_S, X.CLAMP_TO_EDGE),
  48629. X.texParameteri(e, X.TEXTURE_WRAP_T, X.CLAMP_TO_EDGE),
  48630. 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),
  48631. X.texParameteri(e, X.TEXTURE_MAG_FILTER, T(t.magFilter)),
  48632. X.texParameteri(e, X.TEXTURE_MIN_FILTER, T(t.minFilter)),
  48633. 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)),
  48634. n = Ie.get("EXT_texture_filter_anisotropic")) {
  48635. if (t.type === Ci.FloatType && null === Ie.get("OES_texture_float_linear"))
  48636. return;
  48637. if (t.type === Ci.HalfFloatType && null === Ie.get("OES_texture_half_float_linear"))
  48638. return;
  48639. (1 < t.anisotropy || be.get(t).__currentAnisotropy) && (X.texParameterf(e, n.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(t.anisotropy, Z.getMaxAnisotropy())),
  48640. be.get(t).__currentAnisotropy = t.anisotropy)
  48641. }
  48642. }
  48643. function o(e, t, i) {
  48644. void 0 === e.__webglInit && (e.__webglInit = !0,
  48645. t.addEventListener("dispose", f),
  48646. e.__webglTexture = X.createTexture(),
  48647. ye.textures++),
  48648. _e.activeTexture(X.TEXTURE0 + i),
  48649. _e.bindTexture(X.TEXTURE_2D, e.__webglTexture),
  48650. X.pixelStorei(X.UNPACK_FLIP_Y_WEBGL, t.flipY),
  48651. X.pixelStorei(X.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  48652. X.pixelStorei(X.UNPACK_ALIGNMENT, t.unpackAlignment);
  48653. var n = I(t.image, Ee.maxTextureSize);
  48654. !function(e) {
  48655. return e.wrapS !== Ci.ClampToEdgeWrapping || e.wrapT !== Ci.ClampToEdgeWrapping || e.minFilter !== Ci.NearestFilter && e.minFilter !== Ci.LinearFilter
  48656. }(t) || !1 !== E(n) || (n = function(e) {
  48657. if (e instanceof HTMLImageElement || e instanceof HTMLCanvasElement) {
  48658. var t = document.createElement("canvas");
  48659. return t.width = Ci.Math.nearestPowerOfTwo(e.width),
  48660. t.height = Ci.Math.nearestPowerOfTwo(e.height),
  48661. t.getContext("2d").drawImage(e, 0, 0, t.width, t.height),
  48662. console.warn("THREE.WebGLRenderer: image is not power of two (" + e.width + "x" + e.height + "). Resized to " + t.width + "x" + t.height, e),
  48663. t
  48664. }
  48665. return e
  48666. }(n));
  48667. var r = E(n)
  48668. , o = x(t.format)
  48669. , a = x(t.type);
  48670. m(X.TEXTURE_2D, t, r);
  48671. var s, l = t.mipmaps;
  48672. if (t instanceof Ci.DataTexture)
  48673. if (0 < l.length && r) {
  48674. for (var c = 0, h = l.length; c < h; c++)
  48675. s = l[c],
  48676. _e.texImage2D(X.TEXTURE_2D, c, o, s.width, s.height, 0, o, a, s.data);
  48677. t.generateMipmaps = !1
  48678. } else
  48679. _e.texImage2D(X.TEXTURE_2D, 0, o, n.width, n.height, 0, o, a, n.data);
  48680. else if (t instanceof Ci.CompressedTexture)
  48681. for (c = 0,
  48682. h = l.length; c < h; c++)
  48683. s = l[c],
  48684. 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);
  48685. else if (0 < l.length && r) {
  48686. for (c = 0,
  48687. h = l.length; c < h; c++)
  48688. s = l[c],
  48689. _e.texImage2D(X.TEXTURE_2D, c, o, o, a, s);
  48690. t.generateMipmaps = !1
  48691. } else
  48692. _e.texImage2D(X.TEXTURE_2D, 0, o, o, a, n);
  48693. t.generateMipmaps && r && X.generateMipmap(X.TEXTURE_2D),
  48694. e.__version = t.version,
  48695. t.onUpdate && t.onUpdate(t)
  48696. }
  48697. function I(e, t) {
  48698. if (e.width > t || e.height > t) {
  48699. var i = t / Math.max(e.width, e.height)
  48700. , n = document.createElement("canvas");
  48701. return n.width = Math.floor(e.width * i),
  48702. n.height = Math.floor(e.height * i),
  48703. n.getContext("2d").drawImage(e, 0, 0, e.width, e.height, 0, 0, n.width, n.height),
  48704. console.warn("THREE.WebGLRenderer: image is too big (" + e.width + "x" + e.height + "). Resized to " + n.width + "x" + n.height, e),
  48705. n
  48706. }
  48707. return e
  48708. }
  48709. function E(e) {
  48710. return Ci.Math.isPowerOfTwo(e.width) && Ci.Math.isPowerOfTwo(e.height)
  48711. }
  48712. function _(e, t) {
  48713. var i = be.get(e);
  48714. if (6 === e.image.length)
  48715. if (0 < e.version && i.__version !== e.version) {
  48716. i.__image__webglTextureCube || (e.addEventListener("dispose", f),
  48717. i.__image__webglTextureCube = X.createTexture(),
  48718. ye.textures++),
  48719. _e.activeTexture(X.TEXTURE0 + t),
  48720. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__image__webglTextureCube),
  48721. X.pixelStorei(X.UNPACK_FLIP_Y_WEBGL, e.flipY);
  48722. for (var n = e instanceof Ci.CompressedTexture, r = e.image[0]instanceof Ci.DataTexture, o = [], a = 0; a < 6; a++)
  48723. !Z.autoScaleCubemaps || n || r ? o[a] = r ? e.image[a].image : e.image[a] : o[a] = I(e.image[a], Ee.maxCubemapSize);
  48724. var s = E(o[0])
  48725. , l = x(e.format)
  48726. , c = x(e.type);
  48727. m(X.TEXTURE_CUBE_MAP, e, s);
  48728. for (a = 0; a < 6; a++)
  48729. if (n)
  48730. for (var h, u = o[a].mipmaps, d = 0, p = u.length; d < p; d++)
  48731. h = u[d],
  48732. 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);
  48733. else
  48734. 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]);
  48735. e.generateMipmaps && s && X.generateMipmap(X.TEXTURE_CUBE_MAP),
  48736. i.__version = e.version,
  48737. e.onUpdate && e.onUpdate(e)
  48738. } else
  48739. _e.activeTexture(X.TEXTURE0 + t),
  48740. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__image__webglTextureCube)
  48741. }
  48742. function b(e, t) {
  48743. _e.activeTexture(X.TEXTURE0 + t),
  48744. _e.bindTexture(X.TEXTURE_CUBE_MAP, be.get(e).__webglTexture)
  48745. }
  48746. function h(e, t, i, n) {
  48747. var r = x(t.texture.format)
  48748. , o = x(t.texture.type);
  48749. _e.texImage2D(n, 0, r, t.width, t.height, 0, r, o, null),
  48750. X.bindFramebuffer(X.FRAMEBUFFER, e),
  48751. X.framebufferTexture2D(X.FRAMEBUFFER, i, n, be.get(t.texture).__webglTexture, 0),
  48752. X.bindFramebuffer(X.FRAMEBUFFER, null)
  48753. }
  48754. function u(e, t) {
  48755. X.bindRenderbuffer(X.RENDERBUFFER, e),
  48756. t.depthBuffer && !t.stencilBuffer ? (X.renderbufferStorage(X.RENDERBUFFER, X.DEPTH_COMPONENT16, t.width, t.height),
  48757. 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),
  48758. X.framebufferRenderbuffer(X.FRAMEBUFFER, X.DEPTH_STENCIL_ATTACHMENT, X.RENDERBUFFER, e)) : X.renderbufferStorage(X.RENDERBUFFER, X.RGBA4, t.width, t.height),
  48759. X.bindRenderbuffer(X.RENDERBUFFER, null)
  48760. }
  48761. function w(e) {
  48762. var t = be.get(e)
  48763. , i = be.get(e.texture);
  48764. e.addEventListener("dispose", a),
  48765. i.__webglTexture = X.createTexture(),
  48766. ye.textures++;
  48767. var n = e instanceof Ci.WebGLRenderTargetCube
  48768. , r = Ci.Math.isPowerOfTwo(e.width) && Ci.Math.isPowerOfTwo(e.height);
  48769. if (n) {
  48770. t.__webglFramebuffer = [];
  48771. for (var o = 0; o < 6; o++)
  48772. t.__webglFramebuffer[o] = X.createFramebuffer()
  48773. } else
  48774. t.__webglFramebuffer = X.createFramebuffer();
  48775. if (n) {
  48776. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__webglTexture),
  48777. m(X.TEXTURE_CUBE_MAP, e.texture, r);
  48778. for (o = 0; o < 6; o++)
  48779. h(t.__webglFramebuffer[o], e, X.COLOR_ATTACHMENT0, X.TEXTURE_CUBE_MAP_POSITIVE_X + o);
  48780. e.texture.generateMipmaps && r && X.generateMipmap(X.TEXTURE_CUBE_MAP),
  48781. _e.bindTexture(X.TEXTURE_CUBE_MAP, null)
  48782. } else
  48783. _e.bindTexture(X.TEXTURE_2D, i.__webglTexture),
  48784. m(X.TEXTURE_2D, e.texture, r),
  48785. h(t.__webglFramebuffer, e, X.COLOR_ATTACHMENT0, X.TEXTURE_2D),
  48786. e.texture.generateMipmaps && r && X.generateMipmap(X.TEXTURE_2D),
  48787. _e.bindTexture(X.TEXTURE_2D, null);
  48788. e.depthBuffer && function(e) {
  48789. var t = be.get(e);
  48790. if (e instanceof Ci.WebGLRenderTargetCube) {
  48791. t.__webglDepthbuffer = [];
  48792. for (var i = 0; i < 6; i++)
  48793. X.bindFramebuffer(X.FRAMEBUFFER, t.__webglFramebuffer[i]),
  48794. t.__webglDepthbuffer[i] = X.createRenderbuffer(),
  48795. u(t.__webglDepthbuffer[i], e)
  48796. } else
  48797. X.bindFramebuffer(X.FRAMEBUFFER, t.__webglFramebuffer),
  48798. t.__webglDepthbuffer = X.createRenderbuffer(),
  48799. u(t.__webglDepthbuffer, e);
  48800. X.bindFramebuffer(X.FRAMEBUFFER, null)
  48801. }(e)
  48802. }
  48803. function T(e) {
  48804. return e === Ci.NearestFilter || e === Ci.NearestMipMapNearestFilter || e === Ci.NearestMipMapLinearFilter ? X.NEAREST : X.LINEAR
  48805. }
  48806. function x(e) {
  48807. var t;
  48808. if (e === Ci.RepeatWrapping)
  48809. return X.REPEAT;
  48810. if (e === Ci.ClampToEdgeWrapping)
  48811. return X.CLAMP_TO_EDGE;
  48812. if (e === Ci.MirroredRepeatWrapping)
  48813. return X.MIRRORED_REPEAT;
  48814. if (e === Ci.NearestFilter)
  48815. return X.NEAREST;
  48816. if (e === Ci.NearestMipMapNearestFilter)
  48817. return X.NEAREST_MIPMAP_NEAREST;
  48818. if (e === Ci.NearestMipMapLinearFilter)
  48819. return X.NEAREST_MIPMAP_LINEAR;
  48820. if (e === Ci.LinearFilter)
  48821. return X.LINEAR;
  48822. if (e === Ci.LinearMipMapNearestFilter)
  48823. return X.LINEAR_MIPMAP_NEAREST;
  48824. if (e === Ci.LinearMipMapLinearFilter)
  48825. return X.LINEAR_MIPMAP_LINEAR;
  48826. if (e === Ci.UnsignedByteType)
  48827. return X.UNSIGNED_BYTE;
  48828. if (e === Ci.UnsignedShort4444Type)
  48829. return X.UNSIGNED_SHORT_4_4_4_4;
  48830. if (e === Ci.UnsignedShort5551Type)
  48831. return X.UNSIGNED_SHORT_5_5_5_1;
  48832. if (e === Ci.UnsignedShort565Type)
  48833. return X.UNSIGNED_SHORT_5_6_5;
  48834. if (e === Ci.ByteType)
  48835. return X.BYTE;
  48836. if (e === Ci.ShortType)
  48837. return X.SHORT;
  48838. if (e === Ci.UnsignedShortType)
  48839. return X.UNSIGNED_SHORT;
  48840. if (e === Ci.IntType)
  48841. return X.INT;
  48842. if (e === Ci.UnsignedIntType)
  48843. return X.UNSIGNED_INT;
  48844. if (e === Ci.FloatType)
  48845. return X.FLOAT;
  48846. if (null !== (t = Ie.get("OES_texture_half_float")) && e === Ci.HalfFloatType)
  48847. return t.HALF_FLOAT_OES;
  48848. if (e === Ci.AlphaFormat)
  48849. return X.ALPHA;
  48850. if (e === Ci.RGBFormat)
  48851. return X.RGB;
  48852. if (e === Ci.RGBAFormat)
  48853. return X.RGBA;
  48854. if (e === Ci.LuminanceFormat)
  48855. return X.LUMINANCE;
  48856. if (e === Ci.LuminanceAlphaFormat)
  48857. return X.LUMINANCE_ALPHA;
  48858. if (e === Ci.AddEquation)
  48859. return X.FUNC_ADD;
  48860. if (e === Ci.SubtractEquation)
  48861. return X.FUNC_SUBTRACT;
  48862. if (e === Ci.ReverseSubtractEquation)
  48863. return X.FUNC_REVERSE_SUBTRACT;
  48864. if (e === Ci.ZeroFactor)
  48865. return X.ZERO;
  48866. if (e === Ci.OneFactor)
  48867. return X.ONE;
  48868. if (e === Ci.SrcColorFactor)
  48869. return X.SRC_COLOR;
  48870. if (e === Ci.OneMinusSrcColorFactor)
  48871. return X.ONE_MINUS_SRC_COLOR;
  48872. if (e === Ci.SrcAlphaFactor)
  48873. return X.SRC_ALPHA;
  48874. if (e === Ci.OneMinusSrcAlphaFactor)
  48875. return X.ONE_MINUS_SRC_ALPHA;
  48876. if (e === Ci.DstAlphaFactor)
  48877. return X.DST_ALPHA;
  48878. if (e === Ci.OneMinusDstAlphaFactor)
  48879. return X.ONE_MINUS_DST_ALPHA;
  48880. if (e === Ci.DstColorFactor)
  48881. return X.DST_COLOR;
  48882. if (e === Ci.OneMinusDstColorFactor)
  48883. return X.ONE_MINUS_DST_COLOR;
  48884. if (e === Ci.SrcAlphaSaturateFactor)
  48885. return X.SRC_ALPHA_SATURATE;
  48886. if (null !== (t = Ie.get("WEBGL_compressed_texture_s3tc"))) {
  48887. if (e === Ci.RGB_S3TC_DXT1_Format)
  48888. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  48889. if (e === Ci.RGBA_S3TC_DXT1_Format)
  48890. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  48891. if (e === Ci.RGBA_S3TC_DXT3_Format)
  48892. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  48893. if (e === Ci.RGBA_S3TC_DXT5_Format)
  48894. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  48895. }
  48896. if (null !== (t = Ie.get("WEBGL_compressed_texture_pvrtc"))) {
  48897. if (e === Ci.RGB_PVRTC_4BPPV1_Format)
  48898. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  48899. if (e === Ci.RGB_PVRTC_2BPPV1_Format)
  48900. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  48901. if (e === Ci.RGBA_PVRTC_4BPPV1_Format)
  48902. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  48903. if (e === Ci.RGBA_PVRTC_2BPPV1_Format)
  48904. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  48905. }
  48906. if (null !== (t = Ie.get("WEBGL_compressed_texture_etc1")) && e === Ci.RGB_ETC1_Format)
  48907. return t.COMPRESSED_RGB_ETC1_WEBGL;
  48908. if (null !== (t = Ie.get("EXT_blend_minmax"))) {
  48909. if (e === Ci.MinEquation)
  48910. return t.MIN_EXT;
  48911. if (e === Ci.MaxEquation)
  48912. return t.MAX_EXT
  48913. }
  48914. return 0
  48915. }
  48916. console.log("THREE.WebGLRenderer", Ci.REVISION);
  48917. var O = void 0 !== (e = e || {}).canvas ? e.canvas : document.createElement("canvas")
  48918. , L = void 0 !== e.context ? e.context : null
  48919. , D = void 0 !== e.alpha && e.alpha
  48920. , N = void 0 === e.depth || e.depth
  48921. , F = void 0 === e.stencil || e.stencil
  48922. , B = void 0 !== e.antialias && e.antialias
  48923. , V = void 0 === e.premultipliedAlpha || e.premultipliedAlpha
  48924. , k = void 0 !== e.preserveDrawingBuffer && e.preserveDrawingBuffer
  48925. , U = []
  48926. , H = []
  48927. , z = -1
  48928. , G = []
  48929. , W = -1
  48930. , j = new Float32Array(8)
  48931. , Y = []
  48932. , q = [];
  48933. this.domElement = O,
  48934. this.context = null,
  48935. this.autoClear = !0,
  48936. this.autoClearColor = !0,
  48937. this.autoClearDepth = !0,
  48938. this.autoClearStencil = !0,
  48939. this.sortObjects = !0,
  48940. this.gammaFactor = 2,
  48941. this.gammaInput = !1,
  48942. this.gammaOutput = !1,
  48943. this.physicallyCorrectLights = !1,
  48944. this.toneMapping = Ci.LinearToneMapping,
  48945. this.toneMappingExposure = 1,
  48946. this.toneMappingWhitePoint = 1,
  48947. this.maxMorphTargets = 8,
  48948. this.maxMorphNormals = 4,
  48949. this.autoScaleCubemaps = !0;
  48950. 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 = {
  48951. hash: "",
  48952. ambient: [0, 0, 0],
  48953. directional: [],
  48954. directionalShadowMap: [],
  48955. directionalShadowMatrix: [],
  48956. spot: [],
  48957. spotShadowMap: [],
  48958. spotShadowMatrix: [],
  48959. point: [],
  48960. pointShadowMap: [],
  48961. pointShadowMatrix: [],
  48962. hemi: [],
  48963. shadows: [],
  48964. shadowsPointLight: 0
  48965. }, ye = {
  48966. geometries: 0,
  48967. textures: 0
  48968. }, Ae = {
  48969. calls: 0,
  48970. vertices: 0,
  48971. faces: 0,
  48972. points: 0
  48973. };
  48974. this.info = {
  48975. render: Ae,
  48976. memory: ye,
  48977. programs: null
  48978. };
  48979. try {
  48980. var Ce = {
  48981. alpha: D,
  48982. depth: N,
  48983. stencil: F,
  48984. antialias: B,
  48985. premultipliedAlpha: V,
  48986. preserveDrawingBuffer: k
  48987. };
  48988. if (null === (X = L || O.getContext("webgl", Ce) || O.getContext("experimental-webgl", Ce)))
  48989. throw null !== O.getContext("webgl") ? "Error creating WebGL context with your selected attributes." : "Error creating WebGL context.";
  48990. void 0 === X.getShaderPrecisionFormat && (X.getShaderPrecisionFormat = function() {
  48991. return {
  48992. rangeMin: 1,
  48993. rangeMax: 1,
  48994. precision: 1
  48995. }
  48996. }
  48997. ),
  48998. O.addEventListener("webglcontextlost", r, !1)
  48999. } catch (e) {
  49000. console.error("THREE.WebGLRenderer: " + e)
  49001. }
  49002. var Ie = new Ci.WebGLExtensions(X);
  49003. Ie.get("OES_texture_float"),
  49004. Ie.get("OES_texture_float_linear"),
  49005. Ie.get("OES_texture_half_float"),
  49006. Ie.get("OES_texture_half_float_linear"),
  49007. Ie.get("OES_standard_derivatives"),
  49008. Ie.get("ANGLE_instanced_arrays"),
  49009. Ie.get("OES_element_index_uint") && (Ci.BufferGeometry.MaxIndex = 4294967296);
  49010. var Ee = new Ci.WebGLCapabilities(X,Ie,e)
  49011. , _e = new Ci.WebGLState(X,Ie,x)
  49012. , be = new Ci.WebGLProperties
  49013. , we = new Ci.WebGLObjects(X,be,this.info)
  49014. , Te = new Ci.WebGLPrograms(this,Ee)
  49015. , xe = new Ci.WebGLLights;
  49016. this.info.programs = Te.programs;
  49017. var Se = new Ci.WebGLBufferRenderer(X,Ie,Ae)
  49018. , Me = new Ci.WebGLIndexedBufferRenderer(X,Ie,Ae);
  49019. t(),
  49020. this.context = X,
  49021. this.capabilities = Ee,
  49022. this.extensions = Ie,
  49023. this.properties = be,
  49024. this.state = _e;
  49025. var Re = new Ci.WebGLShadowMap(this,ve,we);
  49026. this.shadowMap = Re;
  49027. var Pe, Oe = new Ci.SpritePlugin(this,Y), Le = new Ci.LensFlarePlugin(this,q);
  49028. this.getContext = function() {
  49029. return X
  49030. }
  49031. ,
  49032. this.getContextAttributes = function() {
  49033. return X.getContextAttributes()
  49034. }
  49035. ,
  49036. this.forceContextLoss = function() {
  49037. Ie.get("WEBGL_lose_context").loseContext()
  49038. }
  49039. ,
  49040. this.getMaxAnisotropy = function() {
  49041. if (void 0 !== Pe)
  49042. return Pe;
  49043. var e = Ie.get("EXT_texture_filter_anisotropic");
  49044. return Pe = null !== e ? X.getParameter(e.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 0
  49045. }
  49046. ,
  49047. this.getPrecision = function() {
  49048. return Ee.precision
  49049. }
  49050. ,
  49051. this.getPixelRatio = function() {
  49052. return he
  49053. }
  49054. ,
  49055. this.setPixelRatio = function(e) {
  49056. void 0 !== e && (he = e,
  49057. this.setSize(pe.z, pe.w, !1))
  49058. }
  49059. ,
  49060. this.getSize = function() {
  49061. return {
  49062. width: le,
  49063. height: ce
  49064. }
  49065. }
  49066. ,
  49067. this.setSize = function(e, t, i, n) {
  49068. null != n && (he = n),
  49069. le = e,
  49070. ce = t,
  49071. O.width = e * he,
  49072. O.height = t * he,
  49073. !1 !== i && (O.style.width = e + "px",
  49074. O.style.height = t + "px"),
  49075. this.setViewport(0, 0, e, t)
  49076. }
  49077. ,
  49078. this.setViewport = function(e, t, i, n) {
  49079. _e.viewport(pe.set(e, t, i, n))
  49080. }
  49081. ,
  49082. this.setScissor = function(e, t, i, n) {
  49083. _e.scissor(ue.set(e, t, i, n))
  49084. }
  49085. ,
  49086. this.setScissorTest = function(e) {
  49087. _e.setScissorTest(de = e)
  49088. }
  49089. ,
  49090. this.getClearColor = function() {
  49091. return ae
  49092. }
  49093. ,
  49094. this.setClearColor = function(e, t) {
  49095. ae.set(e),
  49096. se = void 0 !== t ? t : 1,
  49097. i(ae.r, ae.g, ae.b, se)
  49098. }
  49099. ,
  49100. this.getClearAlpha = function() {
  49101. return se
  49102. }
  49103. ,
  49104. this.setClearAlpha = function(e) {
  49105. se = e,
  49106. i(ae.r, ae.g, ae.b, se)
  49107. }
  49108. ,
  49109. this.clear = function(e, t, i) {
  49110. var n = 0;
  49111. void 0 !== e && !e || (n |= X.COLOR_BUFFER_BIT),
  49112. void 0 !== t && !t || (n |= X.DEPTH_BUFFER_BIT),
  49113. void 0 !== i && !i || (n |= X.STENCIL_BUFFER_BIT),
  49114. X.clear(n)
  49115. }
  49116. ,
  49117. this.clearColor = function() {
  49118. this.clear(!0, !1, !1)
  49119. }
  49120. ,
  49121. this.clearDepth = function() {
  49122. this.clear(!1, !0, !1)
  49123. }
  49124. ,
  49125. this.clearStencil = function() {
  49126. this.clear(!1, !1, !0)
  49127. }
  49128. ,
  49129. this.clearTarget = function(e, t, i, n) {
  49130. this.setRenderTarget(e),
  49131. this.clear(t, i, n)
  49132. }
  49133. ,
  49134. this.resetGLState = n,
  49135. this.dispose = function() {
  49136. O.removeEventListener("webglcontextlost", r, !1)
  49137. }
  49138. ,
  49139. this.renderBufferImmediate = function(e, t, i) {
  49140. _e.initAttributes();
  49141. var n = be.get(e);
  49142. e.hasPositions && !n.position && (n.position = X.createBuffer()),
  49143. e.hasNormals && !n.normal && (n.normal = X.createBuffer()),
  49144. e.hasUvs && !n.uv && (n.uv = X.createBuffer()),
  49145. e.hasColors && !n.color && (n.color = X.createBuffer());
  49146. var r = t.getAttributes();
  49147. if (e.hasPositions && (X.bindBuffer(X.ARRAY_BUFFER, n.position),
  49148. X.bufferData(X.ARRAY_BUFFER, e.positionArray, X.DYNAMIC_DRAW),
  49149. _e.enableAttribute(r.position),
  49150. X.vertexAttribPointer(r.position, 3, X.FLOAT, !1, 0, 0)),
  49151. e.hasNormals) {
  49152. if (X.bindBuffer(X.ARRAY_BUFFER, n.normal),
  49153. "MeshPhongMaterial" !== i.type && "MeshStandardMaterial" !== i.type && i.shading === Ci.FlatShading)
  49154. for (var o = 0, a = 3 * e.count; o < a; o += 9) {
  49155. var s = e.normalArray
  49156. , l = (s[o + 0] + s[o + 3] + s[o + 6]) / 3
  49157. , c = (s[o + 1] + s[o + 4] + s[o + 7]) / 3
  49158. , h = (s[o + 2] + s[o + 5] + s[o + 8]) / 3;
  49159. s[o + 0] = l,
  49160. s[o + 1] = c,
  49161. s[o + 2] = h,
  49162. s[o + 3] = l,
  49163. s[o + 4] = c,
  49164. s[o + 5] = h,
  49165. s[o + 6] = l,
  49166. s[o + 7] = c,
  49167. s[o + 8] = h
  49168. }
  49169. X.bufferData(X.ARRAY_BUFFER, e.normalArray, X.DYNAMIC_DRAW),
  49170. _e.enableAttribute(r.normal),
  49171. X.vertexAttribPointer(r.normal, 3, X.FLOAT, !1, 0, 0)
  49172. }
  49173. e.hasUvs && i.map && (X.bindBuffer(X.ARRAY_BUFFER, n.uv),
  49174. X.bufferData(X.ARRAY_BUFFER, e.uvArray, X.DYNAMIC_DRAW),
  49175. _e.enableAttribute(r.uv),
  49176. X.vertexAttribPointer(r.uv, 2, X.FLOAT, !1, 0, 0)),
  49177. e.hasColors && i.vertexColors !== Ci.NoColors && (X.bindBuffer(X.ARRAY_BUFFER, n.color),
  49178. X.bufferData(X.ARRAY_BUFFER, e.colorArray, X.DYNAMIC_DRAW),
  49179. _e.enableAttribute(r.color),
  49180. X.vertexAttribPointer(r.color, 3, X.FLOAT, !1, 0, 0)),
  49181. _e.disableUnusedAttributes(),
  49182. X.drawArrays(X.TRIANGLES, 0, e.count),
  49183. e.count = 0
  49184. }
  49185. ,
  49186. this.renderBufferDirect = function(e, t, i, n, r, o) {
  49187. R(n);
  49188. var a = P(e, t, n, r)
  49189. , s = !1
  49190. , l = i.id + "_" + a.id + "_" + n.wireframe;
  49191. l !== ee && (ee = l,
  49192. s = !0);
  49193. var c = r.morphTargetInfluences;
  49194. if (void 0 !== c) {
  49195. for (var h = [], u = 0, d = c.length; u < d; u++) {
  49196. var p = c[u];
  49197. h.push([p, u])
  49198. }
  49199. h.sort(M),
  49200. 8 < h.length && (h.length = 8);
  49201. var f = i.morphAttributes;
  49202. for (u = 0,
  49203. d = h.length; u < d; u++) {
  49204. p = h[u];
  49205. if (j[u] = p[0],
  49206. 0 !== p[0]) {
  49207. var g = p[1];
  49208. !0 === n.morphTargets && f.position && i.addAttribute("morphTarget" + u, f.position[g]),
  49209. !0 === n.morphNormals && f.normal && i.addAttribute("morphNormal" + u, f.normal[g])
  49210. } else
  49211. !0 === n.morphTargets && i.removeAttribute("morphTarget" + u),
  49212. !0 === n.morphNormals && i.removeAttribute("morphNormal" + u)
  49213. }
  49214. var m = a.getUniforms();
  49215. null !== m.morphTargetInfluences && X.uniform1fv(m.morphTargetInfluences, j),
  49216. s = !0
  49217. }
  49218. g = i.index;
  49219. var v, y = i.attributes.position;
  49220. !0 === n.wireframe && (g = we.getWireframeAttribute(i)),
  49221. null !== g ? (v = Me).setIndex(g) : v = Se,
  49222. s && (function(e, t, i, n) {
  49223. var r;
  49224. if (i instanceof Ci.InstancedBufferGeometry && null === (r = Ie.get("ANGLE_instanced_arrays")))
  49225. console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
  49226. else {
  49227. void 0 === n && (n = 0),
  49228. _e.initAttributes();
  49229. var o = i.attributes
  49230. , a = t.getAttributes()
  49231. , s = e.defaultAttributeValues;
  49232. for (var l in a) {
  49233. var c = a[l];
  49234. if (0 <= c) {
  49235. var h = o[l];
  49236. if (void 0 !== h) {
  49237. var u = h.itemSize
  49238. , d = we.getAttributeBuffer(h);
  49239. if (h instanceof Ci.InterleavedBufferAttribute) {
  49240. var p = h.data
  49241. , f = p.stride
  49242. , g = h.offset;
  49243. p instanceof Ci.InstancedInterleavedBuffer ? (_e.enableAttributeAndDivisor(c, p.meshPerAttribute, r),
  49244. void 0 === i.maxInstancedCount && (i.maxInstancedCount = p.meshPerAttribute * p.count)) : _e.enableAttribute(c),
  49245. X.bindBuffer(X.ARRAY_BUFFER, d),
  49246. X.vertexAttribPointer(c, u, X.FLOAT, !1, f * p.array.BYTES_PER_ELEMENT, (n * f + g) * p.array.BYTES_PER_ELEMENT)
  49247. } else
  49248. h instanceof Ci.InstancedBufferAttribute ? (_e.enableAttributeAndDivisor(c, h.meshPerAttribute, r),
  49249. void 0 === i.maxInstancedCount && (i.maxInstancedCount = h.meshPerAttribute * h.count)) : _e.enableAttribute(c),
  49250. X.bindBuffer(X.ARRAY_BUFFER, d),
  49251. X.vertexAttribPointer(c, u, X.FLOAT, !1, 0, n * u * 4)
  49252. } else if (void 0 !== s) {
  49253. var m = s[l];
  49254. if (void 0 !== m)
  49255. switch (m.length) {
  49256. case 2:
  49257. X.vertexAttrib2fv(c, m);
  49258. break;
  49259. case 3:
  49260. X.vertexAttrib3fv(c, m);
  49261. break;
  49262. case 4:
  49263. X.vertexAttrib4fv(c, m);
  49264. break;
  49265. default:
  49266. X.vertexAttrib1fv(c, m)
  49267. }
  49268. }
  49269. }
  49270. }
  49271. _e.disableUnusedAttributes()
  49272. }
  49273. }(n, a, i),
  49274. null !== g && X.bindBuffer(X.ELEMENT_ARRAY_BUFFER, we.getAttributeBuffer(g)));
  49275. var A = 1 / 0;
  49276. null !== g ? A = g.count : void 0 !== y && (A = y.count);
  49277. var C = i.drawRange.start
  49278. , I = i.drawRange.count
  49279. , E = null !== o ? o.start : 0
  49280. , _ = null !== o ? o.count : 1 / 0
  49281. , b = Math.max(0, C, E)
  49282. , w = Math.min(0 + A, C + I, E + _) - 1
  49283. , T = Math.max(0, w - b + 1);
  49284. if (r instanceof Ci.Mesh)
  49285. if (!0 === n.wireframe)
  49286. _e.setLineWidth(n.wireframeLinewidth * S()),
  49287. v.setMode(X.LINES);
  49288. else
  49289. switch (r.drawMode) {
  49290. case Ci.TrianglesDrawMode:
  49291. v.setMode(X.TRIANGLES);
  49292. break;
  49293. case Ci.TriangleStripDrawMode:
  49294. v.setMode(X.TRIANGLE_STRIP);
  49295. break;
  49296. case Ci.TriangleFanDrawMode:
  49297. v.setMode(X.TRIANGLE_FAN)
  49298. }
  49299. else if (r instanceof Ci.Line) {
  49300. var x = n.linewidth;
  49301. void 0 === x && (x = 1),
  49302. _e.setLineWidth(x * S()),
  49303. r instanceof Ci.LineSegments ? v.setMode(X.LINES) : v.setMode(X.LINE_STRIP)
  49304. } else
  49305. r instanceof Ci.Points && v.setMode(X.POINTS);
  49306. i instanceof Ci.InstancedBufferGeometry ? 0 < i.maxInstancedCount && v.renderInstances(i, b, T) : v.render(b, T)
  49307. }
  49308. ,
  49309. this.render = function(e, t, i, n) {
  49310. if (t instanceof Ci.Camera != 0) {
  49311. var r = e.fog;
  49312. if (ee = "",
  49313. $ = -1,
  49314. !(te = null) === e.autoUpdate && e.updateMatrixWorld(),
  49315. null === t.parent && t.updateMatrixWorld(),
  49316. t.matrixWorldInverse.getInverse(t.matrixWorld),
  49317. ge.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse),
  49318. fe.setFromMatrix(ge),
  49319. U.length = 0,
  49320. W = z = -1,
  49321. Y.length = 0,
  49322. q.length = 0,
  49323. function e(t, i) {
  49324. if (!1 !== t.visible) {
  49325. if (t.layers.test(i.layers))
  49326. if (t instanceof Ci.Light)
  49327. U.push(t);
  49328. else if (t instanceof Ci.Sprite)
  49329. !1 !== t.frustumCulled && !0 !== fe.intersectsObject(t) || Y.push(t);
  49330. else if (t instanceof Ci.LensFlare)
  49331. q.push(t);
  49332. else if (t instanceof Ci.ImmediateRenderObject)
  49333. !0 === Z.sortObjects && (me.setFromMatrixPosition(t.matrixWorld),
  49334. me.applyProjection(ge)),
  49335. d(t, null, t.material, me.z, null);
  49336. else if ((t instanceof Ci.Mesh || t instanceof Ci.Line || t instanceof Ci.Points) && (t instanceof Ci.SkinnedMesh && t.skeleton.update(),
  49337. !1 === t.frustumCulled || !0 === fe.intersectsObject(t))) {
  49338. var n = t.material;
  49339. if (!0 === n.visible) {
  49340. !0 === Z.sortObjects && (me.setFromMatrixPosition(t.matrixWorld),
  49341. me.applyProjection(ge));
  49342. var r = we.update(t);
  49343. if (n instanceof Ci.MultiMaterial)
  49344. for (var o = r.groups, a = n.materials, s = 0, l = o.length; s < l; s++) {
  49345. var c = o[s]
  49346. , h = a[c.materialIndex];
  49347. !0 === h.visible && d(t, r, h, me.z, c)
  49348. }
  49349. else
  49350. d(t, r, n, me.z, null)
  49351. }
  49352. }
  49353. var u = t.children;
  49354. for (s = 0,
  49355. l = u.length; s < l; s++)
  49356. e(u[s], i)
  49357. }
  49358. }(e, t),
  49359. H.length = z + 1,
  49360. G.length = W + 1,
  49361. !0 === Z.sortObjects && (H.sort(s),
  49362. G.sort(l)),
  49363. function(e, t) {
  49364. 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;
  49365. for (i = ve.shadowsPointLight = 0,
  49366. n = e.length; i < n; i++)
  49367. if (o = (r = e[i]).color,
  49368. a = r.intensity,
  49369. s = r.distance,
  49370. r instanceof Ci.AmbientLight)
  49371. l += o.r * a,
  49372. c += o.g * a,
  49373. h += o.b * a;
  49374. else if (r instanceof Ci.DirectionalLight) {
  49375. (v = xe.get(r)).color.copy(r.color).multiplyScalar(r.intensity),
  49376. v.direction.setFromMatrixPosition(r.matrixWorld),
  49377. me.setFromMatrixPosition(r.target.matrixWorld),
  49378. v.direction.sub(me),
  49379. v.direction.transformDirection(u),
  49380. v.shadow = r.castShadow,
  49381. r.castShadow && (v.shadowBias = r.shadow.bias,
  49382. v.shadowRadius = r.shadow.radius,
  49383. v.shadowMapSize = r.shadow.mapSize,
  49384. ve.shadows[m++] = r),
  49385. ve.directionalShadowMap[d] = r.shadow.map,
  49386. ve.directionalShadowMatrix[d] = r.shadow.matrix,
  49387. ve.directional[d++] = v
  49388. } else if (r instanceof Ci.SpotLight) {
  49389. (v = xe.get(r)).position.setFromMatrixPosition(r.matrixWorld),
  49390. v.position.applyMatrix4(u),
  49391. v.color.copy(o).multiplyScalar(a),
  49392. v.distance = s,
  49393. v.direction.setFromMatrixPosition(r.matrixWorld),
  49394. me.setFromMatrixPosition(r.target.matrixWorld),
  49395. v.direction.sub(me),
  49396. v.direction.transformDirection(u),
  49397. v.coneCos = Math.cos(r.angle),
  49398. v.penumbraCos = Math.cos(r.angle * (1 - r.penumbra)),
  49399. v.decay = 0 === r.distance ? 0 : r.decay,
  49400. v.shadow = r.castShadow,
  49401. r.castShadow && (v.shadowBias = r.shadow.bias,
  49402. v.shadowRadius = r.shadow.radius,
  49403. v.shadowMapSize = r.shadow.mapSize,
  49404. ve.shadows[m++] = r),
  49405. ve.spotShadowMap[f] = r.shadow.map,
  49406. ve.spotShadowMatrix[f] = r.shadow.matrix,
  49407. ve.spot[f++] = v
  49408. } else if (r instanceof Ci.PointLight) {
  49409. (v = xe.get(r)).position.setFromMatrixPosition(r.matrixWorld),
  49410. v.position.applyMatrix4(u),
  49411. v.color.copy(r.color).multiplyScalar(r.intensity),
  49412. v.distance = r.distance,
  49413. v.decay = 0 === r.distance ? 0 : r.decay,
  49414. v.shadow = r.castShadow,
  49415. r.castShadow && (v.shadowBias = r.shadow.bias,
  49416. v.shadowRadius = r.shadow.radius,
  49417. v.shadowMapSize = r.shadow.mapSize,
  49418. ve.shadows[m++] = r),
  49419. ve.pointShadowMap[p] = r.shadow.map,
  49420. void 0 === ve.pointShadowMatrix[p] && (ve.pointShadowMatrix[p] = new Ci.Matrix4),
  49421. me.setFromMatrixPosition(r.matrixWorld).negate(),
  49422. ve.pointShadowMatrix[p].identity().setPosition(me),
  49423. ve.point[p++] = v
  49424. } else if (r instanceof Ci.HemisphereLight) {
  49425. var v;
  49426. (v = xe.get(r)).direction.setFromMatrixPosition(r.matrixWorld),
  49427. v.direction.transformDirection(u),
  49428. v.direction.normalize(),
  49429. v.skyColor.copy(r.color).multiplyScalar(a),
  49430. v.groundColor.copy(r.groundColor).multiplyScalar(a),
  49431. ve.hemi[g++] = v
  49432. }
  49433. ve.ambient[0] = l,
  49434. ve.ambient[1] = c,
  49435. ve.ambient[2] = h,
  49436. ve.directional.length = d,
  49437. ve.spot.length = f,
  49438. ve.point.length = p,
  49439. ve.hemi.length = g,
  49440. ve.shadows.length = m,
  49441. ve.hash = d + "," + p + "," + f + "," + g + "," + m
  49442. }(U, t),
  49443. Re.render(e, t),
  49444. Ae.calls = 0,
  49445. Ae.vertices = 0,
  49446. Ae.faces = 0,
  49447. void (Ae.points = 0) === i && (i = null),
  49448. this.setRenderTarget(i),
  49449. (this.autoClear || n) && this.clear(this.autoClearColor, this.autoClearDepth, this.autoClearStencil),
  49450. e.overrideMaterial) {
  49451. var o = e.overrideMaterial;
  49452. c(H, t, r, o),
  49453. c(G, t, r, o)
  49454. } else
  49455. _e.setBlending(Ci.NoBlending),
  49456. c(H, t, r),
  49457. c(G, t, r);
  49458. if (Oe.render(e, t),
  49459. Le.render(e, t, re),
  49460. i) {
  49461. var a = i.texture;
  49462. a.generateMipmaps && E(i) && a.minFilter !== Ci.NearestFilter && a.minFilter !== Ci.LinearFilter && function(e) {
  49463. var t = e instanceof Ci.WebGLRenderTargetCube ? X.TEXTURE_CUBE_MAP : X.TEXTURE_2D
  49464. , i = be.get(e.texture).__webglTexture;
  49465. _e.bindTexture(t, i),
  49466. X.generateMipmap(t),
  49467. _e.bindTexture(t, null)
  49468. }(i)
  49469. }
  49470. _e.setDepthTest(!0),
  49471. _e.setDepthWrite(!0),
  49472. _e.setColorWrite(!0)
  49473. } else
  49474. console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")
  49475. }
  49476. ,
  49477. this.setFaceCulling = function(e, t) {
  49478. e === Ci.CullFaceNone ? _e.disable(X.CULL_FACE) : (t === Ci.FrontFaceDirectionCW ? X.frontFace(X.CW) : X.frontFace(X.CCW),
  49479. e === Ci.CullFaceBack ? X.cullFace(X.BACK) : e === Ci.CullFaceFront ? X.cullFace(X.FRONT) : X.cullFace(X.FRONT_AND_BACK),
  49480. _e.enable(X.CULL_FACE))
  49481. }
  49482. ,
  49483. this.setTexture = function(e, t) {
  49484. var i = be.get(e);
  49485. if (0 < e.version && i.__version !== e.version) {
  49486. var n = e.image;
  49487. 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)
  49488. }
  49489. _e.activeTexture(X.TEXTURE0 + t),
  49490. _e.bindTexture(X.TEXTURE_2D, i.__webglTexture)
  49491. }
  49492. ,
  49493. this.getCurrentRenderTarget = function() {
  49494. return Q
  49495. }
  49496. ,
  49497. this.setRenderTarget = function(e) {
  49498. (Q = e) && void 0 === be.get(e).__webglFramebuffer && w(e);
  49499. var t, i = e instanceof Ci.WebGLRenderTargetCube;
  49500. if (e) {
  49501. var n = be.get(e);
  49502. t = i ? n.__webglFramebuffer[e.activeCubeFace] : n.__webglFramebuffer,
  49503. ie.copy(e.scissor),
  49504. ne = e.scissorTest,
  49505. re.copy(e.viewport)
  49506. } else
  49507. t = null,
  49508. ie.copy(ue).multiplyScalar(he),
  49509. ne = de,
  49510. re.copy(pe).multiplyScalar(he);
  49511. if (J !== t && (X.bindFramebuffer(X.FRAMEBUFFER, t),
  49512. J = t),
  49513. _e.scissor(ie),
  49514. _e.setScissorTest(ne),
  49515. _e.viewport(re),
  49516. i) {
  49517. var r = be.get(e.texture);
  49518. X.framebufferTexture2D(X.FRAMEBUFFER, X.COLOR_ATTACHMENT0, X.TEXTURE_CUBE_MAP_POSITIVE_X + e.activeCubeFace, r.__webglTexture, e.activeMipMapLevel)
  49519. }
  49520. }
  49521. ,
  49522. this.readRenderTargetPixels = function(e, t, i, n, r, o) {
  49523. if (e instanceof Ci.WebGLRenderTarget != 0) {
  49524. var a = be.get(e).__webglFramebuffer;
  49525. if (a) {
  49526. var s = !1;
  49527. a !== J && (X.bindFramebuffer(X.FRAMEBUFFER, a),
  49528. s = !0);
  49529. try {
  49530. var l = e.texture;
  49531. if (l.format !== Ci.RGBAFormat && x(l.format) !== X.getParameter(X.IMPLEMENTATION_COLOR_READ_FORMAT))
  49532. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");
  49533. 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")))
  49534. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");
  49535. 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.")
  49536. } finally {
  49537. s && X.bindFramebuffer(X.FRAMEBUFFER, J)
  49538. }
  49539. }
  49540. } else
  49541. console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")
  49542. }
  49543. }
  49544. ,
  49545. Ci.WebGLRenderTarget = function(e, t, i) {
  49546. this.uuid = Ci.Math.generateUUID(),
  49547. this.width = e,
  49548. this.height = t,
  49549. this.scissor = new Ci.Vector4(0,0,e,t),
  49550. this.scissorTest = !1,
  49551. this.viewport = new Ci.Vector4(0,0,e,t),
  49552. void 0 === (i = i || {}).minFilter && (i.minFilter = Ci.LinearFilter),
  49553. this.texture = new Ci.Texture(void 0,void 0,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy),
  49554. this.depthBuffer = void 0 === i.depthBuffer || i.depthBuffer,
  49555. this.stencilBuffer = void 0 === i.stencilBuffer || i.stencilBuffer
  49556. }
  49557. ,
  49558. Ci.WebGLRenderTarget.prototype = {
  49559. constructor: Ci.WebGLRenderTarget,
  49560. setSize: function(e, t) {
  49561. this.width === e && this.height === t || (this.width = e,
  49562. this.height = t,
  49563. this.dispose()),
  49564. this.viewport.set(0, 0, e, t),
  49565. this.scissor.set(0, 0, e, t)
  49566. },
  49567. clone: function() {
  49568. return (new this.constructor).copy(this)
  49569. },
  49570. copy: function(e) {
  49571. return this.width = e.width,
  49572. this.height = e.height,
  49573. this.viewport.copy(e.viewport),
  49574. this.texture = e.texture.clone(),
  49575. this.depthBuffer = e.depthBuffer,
  49576. this.stencilBuffer = e.stencilBuffer,
  49577. this
  49578. },
  49579. dispose: function() {
  49580. this.dispatchEvent({
  49581. type: "dispose"
  49582. })
  49583. }
  49584. },
  49585. Ci.EventDispatcher.prototype.apply(Ci.WebGLRenderTarget.prototype),
  49586. Ci.WebGLRenderTargetCube = function(e, t, i) {
  49587. Ci.WebGLRenderTarget.call(this, e, t, i),
  49588. this.activeCubeFace = 0,
  49589. this.activeMipMapLevel = 0
  49590. }
  49591. ,
  49592. Ci.WebGLRenderTargetCube.prototype = Object.create(Ci.WebGLRenderTarget.prototype),
  49593. Ci.WebGLRenderTargetCube.prototype.constructor = Ci.WebGLRenderTargetCube,
  49594. Ci.WebGLBufferRenderer = function(r, o, a) {
  49595. var s;
  49596. this.setMode = function(e) {
  49597. s = e
  49598. }
  49599. ,
  49600. this.render = function(e, t) {
  49601. r.drawArrays(s, e, t),
  49602. a.calls++,
  49603. a.vertices += t,
  49604. s === r.TRIANGLES && (a.faces += t / 3)
  49605. }
  49606. ,
  49607. this.renderInstances = function(e) {
  49608. var t = o.get("ANGLE_instanced_arrays");
  49609. if (null !== t) {
  49610. var i = e.attributes.position
  49611. , n = 0;
  49612. n = i instanceof Ci.InterleavedBufferAttribute ? i.data.count : i.count,
  49613. t.drawArraysInstancedANGLE(s, 0, n, e.maxInstancedCount),
  49614. a.calls++,
  49615. a.vertices += n * e.maxInstancedCount,
  49616. s === r.TRIANGLES && (a.faces += e.maxInstancedCount * n / 3)
  49617. } else
  49618. console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.")
  49619. }
  49620. }
  49621. ,
  49622. Ci.WebGLIndexedBufferRenderer = function(r, o, a) {
  49623. var s, l, c;
  49624. this.setMode = function(e) {
  49625. s = e
  49626. }
  49627. ,
  49628. this.setIndex = function(e) {
  49629. c = e.array instanceof Uint32Array && o.get("OES_element_index_uint") ? (l = r.UNSIGNED_INT,
  49630. 4) : (l = r.UNSIGNED_SHORT,
  49631. 2)
  49632. }
  49633. ,
  49634. this.render = function(e, t) {
  49635. r.drawElements(s, t, l, e * c),
  49636. a.calls++,
  49637. a.vertices += t,
  49638. s === r.TRIANGLES && (a.faces += t / 3)
  49639. }
  49640. ,
  49641. this.renderInstances = function(e, t, i) {
  49642. var n = o.get("ANGLE_instanced_arrays");
  49643. 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),
  49644. a.calls++,
  49645. a.vertices += i * e.maxInstancedCount,
  49646. void (s === r.TRIANGLES && (a.faces += e.maxInstancedCount * i / 3)))
  49647. }
  49648. }
  49649. ,
  49650. Ci.WebGLExtensions = function(i) {
  49651. var n = {};
  49652. this.get = function(e) {
  49653. if (void 0 !== n[e])
  49654. return n[e];
  49655. var t;
  49656. switch (e) {
  49657. case "EXT_texture_filter_anisotropic":
  49658. t = i.getExtension("EXT_texture_filter_anisotropic") || i.getExtension("MOZ_EXT_texture_filter_anisotropic") || i.getExtension("WEBKIT_EXT_texture_filter_anisotropic");
  49659. break;
  49660. case "WEBGL_compressed_texture_s3tc":
  49661. t = i.getExtension("WEBGL_compressed_texture_s3tc") || i.getExtension("MOZ_WEBGL_compressed_texture_s3tc") || i.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");
  49662. break;
  49663. case "WEBGL_compressed_texture_pvrtc":
  49664. t = i.getExtension("WEBGL_compressed_texture_pvrtc") || i.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");
  49665. break;
  49666. case "WEBGL_compressed_texture_etc1":
  49667. t = i.getExtension("WEBGL_compressed_texture_etc1");
  49668. break;
  49669. default:
  49670. t = i.getExtension(e)
  49671. }
  49672. return null === t && console.warn("THREE.WebGLRenderer: " + e + " extension not supported."),
  49673. n[e] = t
  49674. }
  49675. }
  49676. ,
  49677. Ci.WebGLCapabilities = function(t, e, i) {
  49678. function n(e) {
  49679. if ("highp" === e) {
  49680. if (0 < t.getShaderPrecisionFormat(t.VERTEX_SHADER, t.HIGH_FLOAT).precision && 0 < t.getShaderPrecisionFormat(t.FRAGMENT_SHADER, t.HIGH_FLOAT).precision)
  49681. return "highp";
  49682. e = "mediump"
  49683. }
  49684. 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"
  49685. }
  49686. this.getMaxPrecision = n,
  49687. this.precision = void 0 !== i.precision ? i.precision : "highp",
  49688. this.logarithmicDepthBuffer = void 0 !== i.logarithmicDepthBuffer && i.logarithmicDepthBuffer,
  49689. this.maxTextures = t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),
  49690. this.maxVertexTextures = t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),
  49691. this.maxTextureSize = t.getParameter(t.MAX_TEXTURE_SIZE),
  49692. this.maxCubemapSize = t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),
  49693. this.maxAttributes = t.getParameter(t.MAX_VERTEX_ATTRIBS),
  49694. this.maxVertexUniforms = t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),
  49695. this.maxVaryings = t.getParameter(t.MAX_VARYING_VECTORS),
  49696. this.maxFragmentUniforms = t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),
  49697. this.vertexTextures = 0 < this.maxVertexTextures,
  49698. this.floatFragmentTextures = !!e.get("OES_texture_float"),
  49699. this.floatVertexTextures = this.vertexTextures && this.floatFragmentTextures;
  49700. var r = n(this.precision);
  49701. r !== this.precision && (console.warn("THREE.WebGLRenderer:", this.precision, "not supported, using", r, "instead."),
  49702. this.precision = r),
  49703. this.logarithmicDepthBuffer && (this.logarithmicDepthBuffer = !!e.get("EXT_frag_depth"))
  49704. }
  49705. ,
  49706. Ci.WebGLGeometries = function(i, o, a) {
  49707. function s(e) {
  49708. var t = e.target
  49709. , i = c[t.id];
  49710. null !== i.index && l(i.index),
  49711. function(e) {
  49712. for (var t in e)
  49713. l(e[t])
  49714. }(i.attributes),
  49715. t.removeEventListener("dispose", s),
  49716. delete c[t.id];
  49717. var n = o.get(t);
  49718. n.wireframe && l(n.wireframe),
  49719. o.delete(t);
  49720. var r = o.get(i);
  49721. r.wireframe && l(r.wireframe),
  49722. o.delete(i),
  49723. a.memory.geometries--
  49724. }
  49725. function l(e) {
  49726. var t = function(e) {
  49727. return e instanceof Ci.InterleavedBufferAttribute ? o.get(e.data).__webglBuffer : o.get(e).__webglBuffer
  49728. }(e);
  49729. void 0 !== t && (i.deleteBuffer(t),
  49730. function(e) {
  49731. e instanceof Ci.InterleavedBufferAttribute ? o.delete(e.data) : o.delete(e)
  49732. }(e))
  49733. }
  49734. var c = {};
  49735. this.get = function(e) {
  49736. var t, i = e.geometry;
  49737. return void 0 !== c[i.id] ? c[i.id] : (i.addEventListener("dispose", s),
  49738. i instanceof Ci.BufferGeometry ? t = i : i instanceof Ci.Geometry && (void 0 === i._bufferGeometry && (i._bufferGeometry = (new Ci.BufferGeometry).setFromObject(e)),
  49739. t = i._bufferGeometry),
  49740. c[i.id] = t,
  49741. a.memory.geometries++,
  49742. t)
  49743. }
  49744. }
  49745. ,
  49746. Ci.WebGLLights = function() {
  49747. var i = {};
  49748. this.get = function(e) {
  49749. if (void 0 !== i[e.id])
  49750. return i[e.id];
  49751. var t;
  49752. switch (e.type) {
  49753. case "DirectionalLight":
  49754. t = {
  49755. direction: new Ci.Vector3,
  49756. color: new Ci.Color,
  49757. shadow: !1,
  49758. shadowBias: 0,
  49759. shadowRadius: 1,
  49760. shadowMapSize: new Ci.Vector2
  49761. };
  49762. break;
  49763. case "SpotLight":
  49764. t = {
  49765. position: new Ci.Vector3,
  49766. direction: new Ci.Vector3,
  49767. color: new Ci.Color,
  49768. distance: 0,
  49769. coneCos: 0,
  49770. penumbraCos: 0,
  49771. decay: 0,
  49772. shadow: !1,
  49773. shadowBias: 0,
  49774. shadowRadius: 1,
  49775. shadowMapSize: new Ci.Vector2
  49776. };
  49777. break;
  49778. case "PointLight":
  49779. t = {
  49780. position: new Ci.Vector3,
  49781. color: new Ci.Color,
  49782. distance: 0,
  49783. decay: 0,
  49784. shadow: !1,
  49785. shadowBias: 0,
  49786. shadowRadius: 1,
  49787. shadowMapSize: new Ci.Vector2
  49788. };
  49789. break;
  49790. case "HemisphereLight":
  49791. t = {
  49792. direction: new Ci.Vector3,
  49793. skyColor: new Ci.Color,
  49794. groundColor: new Ci.Color
  49795. }
  49796. }
  49797. return i[e.id] = t
  49798. }
  49799. }
  49800. ,
  49801. Ci.WebGLObjects = function(g, m, e) {
  49802. function v(e, t) {
  49803. var i = e instanceof Ci.InterleavedBufferAttribute ? e.data : e
  49804. , n = m.get(i);
  49805. void 0 === n.__webglBuffer ? function(e, t, i) {
  49806. e.__webglBuffer = g.createBuffer(),
  49807. g.bindBuffer(i, e.__webglBuffer);
  49808. var n = t.dynamic ? g.DYNAMIC_DRAW : g.STATIC_DRAW;
  49809. g.bufferData(i, t.array, n),
  49810. e.version = t.version
  49811. }(n, i, t) : n.version !== i.version && function(e, t, i) {
  49812. g.bindBuffer(i, e.__webglBuffer),
  49813. !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)),
  49814. t.updateRange.count = 0),
  49815. e.version = t.version
  49816. }(n, i, t)
  49817. }
  49818. function y(e, t, i) {
  49819. if (i < t) {
  49820. var n = t;
  49821. t = i,
  49822. i = n
  49823. }
  49824. var r = e[t];
  49825. return void 0 === r ? (e[t] = [i],
  49826. !0) : -1 === r.indexOf(i) && (r.push(i),
  49827. !0)
  49828. }
  49829. var c = new Ci.WebGLGeometries(g,m,e);
  49830. this.getAttributeBuffer = function(e) {
  49831. return e instanceof Ci.InterleavedBufferAttribute ? m.get(e.data).__webglBuffer : m.get(e).__webglBuffer
  49832. }
  49833. ,
  49834. this.getWireframeAttribute = function(e) {
  49835. var t = m.get(e);
  49836. if (void 0 !== t.wireframe)
  49837. return t.wireframe;
  49838. var i, n = [], r = e.index, o = e.attributes, a = o.position;
  49839. if (null !== r)
  49840. for (var s = {}, l = 0, c = (i = r.array).length; l < c; l += 3) {
  49841. var h = i[l + 0]
  49842. , u = i[l + 1]
  49843. , d = i[l + 2];
  49844. y(s, h, u) && n.push(h, u),
  49845. y(s, u, d) && n.push(u, d),
  49846. y(s, d, h) && n.push(d, h)
  49847. }
  49848. else
  49849. for (l = 0,
  49850. c = (i = o.position.array).length / 3 - 1; l < c; l += 3) {
  49851. h = l + 0,
  49852. u = l + 1,
  49853. d = l + 2;
  49854. n.push(h, u, u, d, d, h)
  49855. }
  49856. var p = 65535 < a.count ? Uint32Array : Uint16Array
  49857. , f = new Ci.BufferAttribute(new p(n),1);
  49858. return v(f, g.ELEMENT_ARRAY_BUFFER),
  49859. t.wireframe = f
  49860. }
  49861. ,
  49862. this.update = function(e) {
  49863. var t = c.get(e);
  49864. e.geometry instanceof Ci.Geometry && t.updateFromObject(e);
  49865. var i = t.index
  49866. , n = t.attributes;
  49867. for (var r in null !== i && v(i, g.ELEMENT_ARRAY_BUFFER),
  49868. n)
  49869. v(n[r], g.ARRAY_BUFFER);
  49870. var o = t.morphAttributes;
  49871. for (var r in o)
  49872. for (var a = o[r], s = 0, l = a.length; s < l; s++)
  49873. v(a[s], g.ARRAY_BUFFER);
  49874. return t
  49875. }
  49876. }
  49877. ,
  49878. Ci.WebGLProgram = (Qt = 0,
  49879. Jt = /^([\w\d_]+)\.([\w\d_]+)$/,
  49880. $t = /^([\w\d_]+)\[(\d+)\]\.([\w\d_]+)$/,
  49881. ei = /^([\w\d_]+)\[0\]$/,
  49882. function(e, t, i, n) {
  49883. var r = e.context
  49884. , o = i.extensions
  49885. , a = i.defines
  49886. , s = i.__webglShader.vertexShader
  49887. , l = i.__webglShader.fragmentShader
  49888. , c = "SHADOWMAP_TYPE_BASIC";
  49889. n.shadowMapType === Ci.PCFShadowMap ? c = "SHADOWMAP_TYPE_PCF" : n.shadowMapType === Ci.PCFSoftShadowMap && (c = "SHADOWMAP_TYPE_PCF_SOFT");
  49890. var h = "ENVMAP_TYPE_CUBE"
  49891. , u = "ENVMAP_MODE_REFLECTION"
  49892. , d = "ENVMAP_BLENDING_MULTIPLY";
  49893. if (n.envMap) {
  49894. switch (i.envMap.mapping) {
  49895. case Ci.CubeReflectionMapping:
  49896. case Ci.CubeRefractionMapping:
  49897. h = "ENVMAP_TYPE_CUBE";
  49898. break;
  49899. case Ci.CubeUVReflectionMapping:
  49900. case Ci.CubeUVRefractionMapping:
  49901. h = "ENVMAP_TYPE_CUBE_UV";
  49902. break;
  49903. case Ci.EquirectangularReflectionMapping:
  49904. case Ci.EquirectangularRefractionMapping:
  49905. h = "ENVMAP_TYPE_EQUIREC";
  49906. break;
  49907. case Ci.SphericalReflectionMapping:
  49908. h = "ENVMAP_TYPE_SPHERE"
  49909. }
  49910. switch (i.envMap.mapping) {
  49911. case Ci.CubeRefractionMapping:
  49912. case Ci.EquirectangularRefractionMapping:
  49913. u = "ENVMAP_MODE_REFRACTION"
  49914. }
  49915. switch (i.combine) {
  49916. case Ci.MultiplyOperation:
  49917. d = "ENVMAP_BLENDING_MULTIPLY";
  49918. break;
  49919. case Ci.MixOperation:
  49920. d = "ENVMAP_BLENDING_MIX";
  49921. break;
  49922. case Ci.AddOperation:
  49923. d = "ENVMAP_BLENDING_ADD"
  49924. }
  49925. }
  49926. var p, f, g = 0 < e.gammaFactor ? e.gammaFactor : 1, m = function(e, t, i) {
  49927. 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")
  49928. }(o, n, e.extensions), v = function(e) {
  49929. var t = [];
  49930. for (var i in e) {
  49931. var n = e[i];
  49932. !1 !== n && t.push("#define " + i + " " + n)
  49933. }
  49934. return t.join("\n")
  49935. }(a), y = r.createProgram();
  49936. 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"),
  49937. [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) {
  49938. var i;
  49939. switch (t) {
  49940. case Ci.LinearToneMapping:
  49941. i = "Linear";
  49942. break;
  49943. case Ci.ReinhardToneMapping:
  49944. i = "Reinhard";
  49945. break;
  49946. case Ci.Uncharted2ToneMapping:
  49947. i = "Uncharted2";
  49948. break;
  49949. case Ci.CineonToneMapping:
  49950. i = "OptimizedCineon";
  49951. break;
  49952. default:
  49953. throw new Error("unsupported toneMapping: " + t)
  49954. }
  49955. return "vec3 " + e + "( vec3 color ) { return " + i + "ToneMapping( color ); }"
  49956. }("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) {
  49957. var i = Mi(t);
  49958. return "vec4 " + e + "( vec4 value ) { return LinearTo" + i[0] + i[1] + "; }"
  49959. }("linearToOutputTexel", n.outputEncoding) : "", "\n"].filter(Pi).join("\n")),
  49960. s = Oi(s = Li(s), n),
  49961. l = Oi(l = Li(l), n),
  49962. i instanceof Ci.ShaderMaterial == 0 && (s = Di(s),
  49963. l = Di(l));
  49964. var A = p + s
  49965. , C = f + l
  49966. , I = Ci.WebGLShader(r, r.VERTEX_SHADER, A)
  49967. , E = Ci.WebGLShader(r, r.FRAGMENT_SHADER, C);
  49968. r.attachShader(y, I),
  49969. r.attachShader(y, E),
  49970. void 0 !== i.index0AttributeName ? r.bindAttribLocation(y, 0, i.index0AttributeName) : !0 === n.morphTargets && r.bindAttribLocation(y, 0, "position"),
  49971. r.linkProgram(y);
  49972. var _, b, w = r.getProgramInfoLog(y), T = r.getShaderInfoLog(I), x = r.getShaderInfoLog(E), S = !0, M = !0;
  49973. return !1 === r.getProgramParameter(y, r.LINK_STATUS) ? (S = !1,
  49974. 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),
  49975. M && (this.diagnostics = {
  49976. runnable: S,
  49977. material: i,
  49978. programLog: w,
  49979. vertexShader: {
  49980. log: T,
  49981. prefix: p
  49982. },
  49983. fragmentShader: {
  49984. log: x,
  49985. prefix: f
  49986. }
  49987. }),
  49988. r.deleteShader(I),
  49989. r.deleteShader(E),
  49990. this.getUniforms = function() {
  49991. return void 0 === _ && (_ = function(e, t) {
  49992. for (var i = {}, n = e.getProgramParameter(t, e.ACTIVE_UNIFORMS), r = 0; r < n; r++) {
  49993. var o = e.getActiveUniform(t, r).name
  49994. , a = e.getUniformLocation(t, o)
  49995. , s = Jt.exec(o);
  49996. if (s) {
  49997. var l = s[1]
  49998. , c = s[2]
  49999. , h = i[l];
  50000. (h = h || (i[l] = {}))[c] = a
  50001. } else if (s = $t.exec(o)) {
  50002. var u = s[1]
  50003. , d = s[2]
  50004. , p = s[3]
  50005. , f = i[u]
  50006. , g = (f = f || (i[u] = []))[d];
  50007. (g = g || (f[d] = {}))[p] = a
  50008. } else
  50009. (s = ei.exec(o)) ? i[u = s[1]] = a : i[o] = a
  50010. }
  50011. return i
  50012. }(r, y)),
  50013. _
  50014. }
  50015. ,
  50016. this.getAttributes = function() {
  50017. return void 0 === b && (b = function(e, t) {
  50018. for (var i = {}, n = e.getProgramParameter(t, e.ACTIVE_ATTRIBUTES), r = 0; r < n; r++) {
  50019. var o = e.getActiveAttrib(t, r).name;
  50020. i[o] = e.getAttribLocation(t, o)
  50021. }
  50022. return i
  50023. }(r, y)),
  50024. b
  50025. }
  50026. ,
  50027. this.destroy = function() {
  50028. r.deleteProgram(y),
  50029. this.program = void 0
  50030. }
  50031. ,
  50032. Object.defineProperties(this, {
  50033. uniforms: {
  50034. get: function() {
  50035. return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),
  50036. this.getUniforms()
  50037. }
  50038. },
  50039. attributes: {
  50040. get: function() {
  50041. return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),
  50042. this.getAttributes()
  50043. }
  50044. }
  50045. }),
  50046. this.id = Qt++,
  50047. this.code = t,
  50048. this.usedTimes = 1,
  50049. this.program = y,
  50050. this.vertexShader = I,
  50051. this.fragmentShader = E,
  50052. this
  50053. }
  50054. ),
  50055. Ci.WebGLPrograms = function(s, l) {
  50056. function c(e, t) {
  50057. var i;
  50058. return e ? e instanceof Ci.Texture ? i = e.encoding : e instanceof Ci.WebGLRenderTarget && (i = e.texture.encoding) : i = Ci.LinearEncoding,
  50059. i === Ci.LinearEncoding && t && (i = Ci.GammaEncoding),
  50060. i
  50061. }
  50062. var h = []
  50063. , u = {
  50064. MeshDepthMaterial: "depth",
  50065. MeshNormalMaterial: "normal",
  50066. MeshBasicMaterial: "basic",
  50067. MeshLambertMaterial: "lambert",
  50068. MeshPhongMaterial: "phong",
  50069. MeshStandardMaterial: "standard",
  50070. LineBasicMaterial: "basic",
  50071. LineDashedMaterial: "dashed",
  50072. PointsMaterial: "points"
  50073. }
  50074. , 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"];
  50075. this.getParameters = function(e, t, i, n) {
  50076. var r = u[e.type]
  50077. , o = function(e) {
  50078. if (l.floatVertexTextures && e && e.skeleton && e.skeleton.useVertexTexture)
  50079. return 1024;
  50080. var t = l.maxVertexUniforms
  50081. , i = Math.floor((t - 20) / 4);
  50082. 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)")),
  50083. i
  50084. }(n)
  50085. , a = s.getPrecision();
  50086. return null === e.precision || (a = l.getMaxPrecision(e.precision)) !== e.precision && console.warn("THREE.WebGLProgram.getParameters:", e.precision, "not supported, using", a, "instead."),
  50087. {
  50088. shaderID: r,
  50089. precision: a,
  50090. supportsVertexTextures: l.vertexTextures,
  50091. outputEncoding: c(s.getCurrentRenderTarget(), s.gammaOutput),
  50092. map: !!e.map,
  50093. mapEncoding: c(e.map, s.gammaInput),
  50094. envMap: !!e.envMap,
  50095. envMapMode: e.envMap && e.envMap.mapping,
  50096. envMapEncoding: c(e.envMap, s.gammaInput),
  50097. envMapCubeUV: !!e.envMap && (e.envMap.mapping === Ci.CubeUVReflectionMapping || e.envMap.mapping === Ci.CubeUVRefractionMapping),
  50098. lightMap: !!e.lightMap,
  50099. aoMap: !!e.aoMap,
  50100. emissiveMap: !!e.emissiveMap,
  50101. emissiveMapEncoding: c(e.emissiveMap, s.gammaInput),
  50102. bumpMap: !!e.bumpMap,
  50103. normalMap: !!e.normalMap,
  50104. displacementMap: !!e.displacementMap,
  50105. roughnessMap: !!e.roughnessMap,
  50106. metalnessMap: !!e.metalnessMap,
  50107. specularMap: !!e.specularMap,
  50108. alphaMap: !!e.alphaMap,
  50109. combine: e.combine,
  50110. vertexColors: e.vertexColors,
  50111. fog: i,
  50112. useFog: e.fog,
  50113. fogExp: i instanceof Ci.FogExp2,
  50114. flatShading: e.shading === Ci.FlatShading,
  50115. sizeAttenuation: e.sizeAttenuation,
  50116. logarithmicDepthBuffer: l.logarithmicDepthBuffer,
  50117. skinning: e.skinning,
  50118. maxBones: o,
  50119. useVertexTexture: l.floatVertexTextures && n && n.skeleton && n.skeleton.useVertexTexture,
  50120. morphTargets: e.morphTargets,
  50121. morphNormals: e.morphNormals,
  50122. maxMorphTargets: s.maxMorphTargets,
  50123. maxMorphNormals: s.maxMorphNormals,
  50124. numDirLights: t.directional.length,
  50125. numPointLights: t.point.length,
  50126. numSpotLights: t.spot.length,
  50127. numHemiLights: t.hemi.length,
  50128. pointLightShadows: t.shadowsPointLight,
  50129. shadowMapEnabled: s.shadowMap.enabled && n.receiveShadow && 0 < t.shadows.length,
  50130. shadowMapType: s.shadowMap.type,
  50131. toneMapping: s.toneMapping,
  50132. physicallyCorrectLights: s.physicallyCorrectLights,
  50133. premultipliedAlpha: e.premultipliedAlpha,
  50134. alphaTest: e.alphaTest,
  50135. doubleSided: e.side === Ci.DoubleSide,
  50136. flipSided: e.side === Ci.BackSide
  50137. }
  50138. }
  50139. ,
  50140. this.getProgramCode = function(e, t) {
  50141. var i = [];
  50142. if (t.shaderID ? i.push(t.shaderID) : (i.push(e.fragmentShader),
  50143. i.push(e.vertexShader)),
  50144. void 0 !== e.defines)
  50145. for (var n in e.defines)
  50146. i.push(n),
  50147. i.push(e.defines[n]);
  50148. for (var r = 0; r < a.length; r++) {
  50149. var o = a[r];
  50150. i.push(o),
  50151. i.push(t[o])
  50152. }
  50153. return i.join()
  50154. }
  50155. ,
  50156. this.acquireProgram = function(e, t, i) {
  50157. for (var n, r = 0, o = h.length; r < o; r++) {
  50158. var a = h[r];
  50159. if (a.code === i) {
  50160. ++(n = a).usedTimes;
  50161. break
  50162. }
  50163. }
  50164. return void 0 === n && (n = new Ci.WebGLProgram(s,i,e,t),
  50165. h.push(n)),
  50166. n
  50167. }
  50168. ,
  50169. this.releaseProgram = function(e) {
  50170. if (0 == --e.usedTimes) {
  50171. var t = h.indexOf(e);
  50172. h[t] = h[h.length - 1],
  50173. h.pop(),
  50174. e.destroy()
  50175. }
  50176. }
  50177. ,
  50178. this.programs = h
  50179. }
  50180. ,
  50181. Ci.WebGLProperties = function() {
  50182. var n = {};
  50183. this.get = function(e) {
  50184. var t = e.uuid
  50185. , i = n[t];
  50186. return void 0 === i && (i = {},
  50187. n[t] = i),
  50188. i
  50189. }
  50190. ,
  50191. this.delete = function(e) {
  50192. delete n[e.uuid]
  50193. }
  50194. ,
  50195. this.clear = function() {
  50196. n = {}
  50197. }
  50198. }
  50199. ,
  50200. Ci.WebGLShader = function(e, t, i) {
  50201. var n = e.createShader(t);
  50202. return e.shaderSource(n, i),
  50203. e.compileShader(n),
  50204. !1 === e.getShaderParameter(n, e.COMPILE_STATUS) && console.error("THREE.WebGLShader: Shader couldn't compile."),
  50205. "" !== e.getShaderInfoLog(n) && console.warn("THREE.WebGLShader: gl.getShaderInfoLog()", t === e.VERTEX_SHADER ? "vertex" : "fragment", e.getShaderInfoLog(n), function(e) {
  50206. for (var t = e.split("\n"), i = 0; i < t.length; i++)
  50207. t[i] = i + 1 + ": " + t[i];
  50208. return t.join("\n")
  50209. }(i)),
  50210. n
  50211. }
  50212. ,
  50213. Ci.WebGLShadowMap = function(P, O, L) {
  50214. function D(e, t, i, n) {
  50215. var r = e.geometry
  50216. , o = null
  50217. , a = p
  50218. , s = e.customDepthMaterial;
  50219. if (i && (a = f,
  50220. s = e.customDistanceMaterial),
  50221. s)
  50222. o = s;
  50223. else {
  50224. var l = void 0 !== r.morphTargets && 0 < r.morphTargets.length && t.morphTargets
  50225. , c = e instanceof Ci.SkinnedMesh && t.skinning
  50226. , h = 0;
  50227. l && (h |= u),
  50228. c && (h |= d),
  50229. o = a[h]
  50230. }
  50231. return o.visible = t.visible,
  50232. o.wireframe = t.wireframe,
  50233. o.wireframeLinewidth = t.wireframeLinewidth,
  50234. i && void 0 !== o.uniforms.lightPos && o.uniforms.lightPos.value.copy(n),
  50235. o
  50236. }
  50237. function N(e, t, i) {
  50238. if (!1 !== e.visible) {
  50239. 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)))
  50240. !0 === e.material.visible && (e.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse, e.matrixWorld),
  50241. G.push(e));
  50242. for (var n = e.children, r = 0, o = n.length; r < o; r++)
  50243. N(n[r], t, i)
  50244. }
  50245. }
  50246. 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) {
  50247. var a = 0 != (o & u)
  50248. , s = 0 != (o & d)
  50249. , l = new Ci.ShaderMaterial({
  50250. uniforms: i,
  50251. vertexShader: t.vertexShader,
  50252. fragmentShader: t.fragmentShader,
  50253. morphTargets: a,
  50254. skinning: s
  50255. });
  50256. p[o] = l;
  50257. var c = new Ci.ShaderMaterial({
  50258. defines: {
  50259. USE_SHADOWMAP: ""
  50260. },
  50261. uniforms: r,
  50262. vertexShader: n.vertexShader,
  50263. fragmentShader: n.fragmentShader,
  50264. morphTargets: a,
  50265. skinning: s
  50266. });
  50267. f[o] = c
  50268. }
  50269. var q = this;
  50270. this.enabled = !1,
  50271. this.autoUpdate = !0,
  50272. this.needsUpdate = !1,
  50273. this.type = Ci.PCFShadowMap,
  50274. this.cullFace = Ci.CullFaceFront,
  50275. this.render = function(e, t) {
  50276. var i, n, r = O.shadows;
  50277. if (0 !== r.length && !1 !== q.enabled && (!1 !== q.autoUpdate || !1 !== q.needsUpdate)) {
  50278. B.clearColor(1, 1, 1, 1),
  50279. B.disable(F.BLEND),
  50280. B.enable(F.CULL_FACE),
  50281. F.frontFace(F.CCW),
  50282. F.cullFace(q.cullFace === Ci.CullFaceFront ? F.FRONT : F.BACK),
  50283. B.setDepthTest(!0),
  50284. B.setScissorTest(!1);
  50285. for (var o = 0, a = r.length; o < a; o++) {
  50286. var s = r[o]
  50287. , l = s.shadow
  50288. , c = l.camera;
  50289. if (U.copy(l.mapSize),
  50290. s instanceof Ci.PointLight) {
  50291. i = 6,
  50292. n = !0;
  50293. var h = U.x
  50294. , u = U.y;
  50295. Y[0].set(2 * h, u, h, u),
  50296. Y[1].set(0, u, h, u),
  50297. Y[2].set(3 * h, u, h, u),
  50298. Y[3].set(h, u, h, u),
  50299. Y[4].set(3 * h, 0, h, u),
  50300. Y[5].set(h, 0, h, u),
  50301. U.x *= 4,
  50302. U.y *= 2
  50303. } else
  50304. n = !(i = 1);
  50305. if (null === l.map) {
  50306. var d = {
  50307. minFilter: Ci.NearestFilter,
  50308. magFilter: Ci.NearestFilter,
  50309. format: Ci.RGBAFormat
  50310. };
  50311. l.map = new Ci.WebGLRenderTarget(U.x,U.y,d),
  50312. s instanceof Ci.SpotLight && (c.aspect = U.x / U.y),
  50313. c.updateProjectionMatrix()
  50314. }
  50315. var p = l.map
  50316. , f = l.matrix;
  50317. z.setFromMatrixPosition(s.matrixWorld),
  50318. c.position.copy(z),
  50319. P.setRenderTarget(p),
  50320. P.clear();
  50321. for (var g = 0; g < i; g++) {
  50322. if (n) {
  50323. H.copy(c.position),
  50324. H.add(W[g]),
  50325. c.up.copy(j[g]),
  50326. c.lookAt(H);
  50327. var m = Y[g];
  50328. B.viewport(m)
  50329. } else
  50330. H.setFromMatrixPosition(s.target.matrixWorld),
  50331. c.lookAt(H);
  50332. c.updateMatrixWorld(),
  50333. c.matrixWorldInverse.getInverse(c.matrixWorld),
  50334. f.set(.5, 0, 0, .5, 0, .5, 0, .5, 0, 0, .5, .5, 0, 0, 0, 1),
  50335. f.multiply(c.projectionMatrix),
  50336. f.multiply(c.matrixWorldInverse),
  50337. k.multiplyMatrices(c.projectionMatrix, c.matrixWorldInverse),
  50338. V.setFromMatrix(k),
  50339. G.length = 0,
  50340. N(e, t, c);
  50341. for (var v = 0, y = G.length; v < y; v++) {
  50342. var A = G[v]
  50343. , C = L.update(A)
  50344. , I = A.material;
  50345. if (I instanceof Ci.MultiMaterial)
  50346. for (var E = C.groups, _ = I.materials, b = 0, w = E.length; b < w; b++) {
  50347. var T = E[b]
  50348. , x = _[T.materialIndex];
  50349. if (!0 === x.visible) {
  50350. var S = D(A, x, n, z);
  50351. P.renderBufferDirect(c, null, C, S, A, T)
  50352. }
  50353. }
  50354. else {
  50355. S = D(A, I, n, z);
  50356. P.renderBufferDirect(c, null, C, S, A, null)
  50357. }
  50358. }
  50359. }
  50360. }
  50361. var M = P.getClearColor()
  50362. , R = P.getClearAlpha();
  50363. P.setClearColor(M, R),
  50364. B.enable(F.BLEND),
  50365. q.cullFace === Ci.CullFaceFront && F.cullFace(F.BACK),
  50366. q.needsUpdate = !1
  50367. }
  50368. }
  50369. }
  50370. ,
  50371. Ci.WebGLState = function(l, i, c) {
  50372. var n = this
  50373. , r = new Ci.Vector4
  50374. , o = new Uint8Array(16)
  50375. , a = new Uint8Array(16)
  50376. , s = new Uint8Array(16)
  50377. , t = {}
  50378. , h = null
  50379. , u = null
  50380. , d = null
  50381. , p = null
  50382. , f = null
  50383. , g = null
  50384. , m = null
  50385. , v = null
  50386. , y = !1
  50387. , A = null
  50388. , C = null
  50389. , I = null
  50390. , E = null
  50391. , _ = null
  50392. , b = null
  50393. , w = null
  50394. , T = null
  50395. , x = null
  50396. , S = null
  50397. , M = null
  50398. , R = null
  50399. , P = null
  50400. , O = null
  50401. , L = null
  50402. , D = l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS)
  50403. , N = void 0
  50404. , F = {}
  50405. , B = new Ci.Vector4
  50406. , V = null
  50407. , k = null
  50408. , U = new Ci.Vector4
  50409. , H = new Ci.Vector4
  50410. , z = l.createTexture();
  50411. l.bindTexture(l.TEXTURE_2D, z),
  50412. l.texParameteri(l.TEXTURE_2D, l.TEXTURE_MIN_FILTER, l.LINEAR),
  50413. l.texImage2D(l.TEXTURE_2D, 0, l.RGB, 1, 1, 0, l.RGB, l.UNSIGNED_BYTE, new Uint8Array(3)),
  50414. this.init = function() {
  50415. this.clearColor(0, 0, 0, 1),
  50416. this.clearDepth(1),
  50417. this.clearStencil(0),
  50418. this.enable(l.DEPTH_TEST),
  50419. l.depthFunc(l.LEQUAL),
  50420. l.frontFace(l.CCW),
  50421. l.cullFace(l.BACK),
  50422. this.enable(l.CULL_FACE),
  50423. this.enable(l.BLEND),
  50424. l.blendEquation(l.FUNC_ADD),
  50425. l.blendFunc(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA)
  50426. }
  50427. ,
  50428. this.initAttributes = function() {
  50429. for (var e = 0, t = o.length; e < t; e++)
  50430. o[e] = 0
  50431. }
  50432. ,
  50433. this.enableAttribute = function(e) {
  50434. o[e] = 1,
  50435. 0 === a[e] && (l.enableVertexAttribArray(e),
  50436. a[e] = 1),
  50437. 0 !== s[e] && (i.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(e, 0),
  50438. s[e] = 0)
  50439. }
  50440. ,
  50441. this.enableAttributeAndDivisor = function(e, t, i) {
  50442. o[e] = 1,
  50443. 0 === a[e] && (l.enableVertexAttribArray(e),
  50444. a[e] = 1),
  50445. s[e] !== t && (i.vertexAttribDivisorANGLE(e, t),
  50446. s[e] = t)
  50447. }
  50448. ,
  50449. this.disableUnusedAttributes = function() {
  50450. for (var e = 0, t = a.length; e < t; e++)
  50451. a[e] !== o[e] && (l.disableVertexAttribArray(e),
  50452. a[e] = 0)
  50453. }
  50454. ,
  50455. this.enable = function(e) {
  50456. !0 !== t[e] && (l.enable(e),
  50457. t[e] = !0)
  50458. }
  50459. ,
  50460. this.disable = function(e) {
  50461. !1 !== t[e] && (l.disable(e),
  50462. t[e] = !1)
  50463. }
  50464. ,
  50465. this.getCompressedTextureFormats = function() {
  50466. if (null === h && (h = [],
  50467. i.get("WEBGL_compressed_texture_pvrtc") || i.get("WEBGL_compressed_texture_s3tc") || i.get("WEBGL_compressed_texture_etc1")))
  50468. for (var e = l.getParameter(l.COMPRESSED_TEXTURE_FORMATS), t = 0; t < e.length; t++)
  50469. h.push(e[t]);
  50470. return h
  50471. }
  50472. ,
  50473. this.setBlending = function(e, t, i, n, r, o, a, s) {
  50474. e === Ci.NoBlending ? this.disable(l.BLEND) : this.enable(l.BLEND),
  50475. e === u && s === y || (e === Ci.AdditiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50476. l.blendFuncSeparate(l.ONE, l.ONE, l.ONE, l.ONE)) : (l.blendEquation(l.FUNC_ADD),
  50477. l.blendFunc(l.SRC_ALPHA, l.ONE)) : e === Ci.SubtractiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50478. l.blendFuncSeparate(l.ZERO, l.ZERO, l.ONE_MINUS_SRC_COLOR, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  50479. l.blendFunc(l.ZERO, l.ONE_MINUS_SRC_COLOR)) : e === Ci.MultiplyBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50480. l.blendFuncSeparate(l.ZERO, l.ZERO, l.SRC_COLOR, l.SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  50481. l.blendFunc(l.ZERO, l.SRC_COLOR)) : s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50482. l.blendFuncSeparate(l.ONE, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50483. l.blendFuncSeparate(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)),
  50484. u = e,
  50485. y = s),
  50486. e === Ci.CustomBlending ? (r = r || t,
  50487. o = o || i,
  50488. a = a || n,
  50489. t === d && r === g || (l.blendEquationSeparate(c(t), c(r)),
  50490. d = t,
  50491. g = r),
  50492. i === p && n === f && o === m && a === v || (l.blendFuncSeparate(c(i), c(n), c(o), c(a)),
  50493. p = i,
  50494. f = n,
  50495. m = o,
  50496. v = a)) : v = m = g = f = p = d = null
  50497. }
  50498. ,
  50499. this.setDepthFunc = function(e) {
  50500. if (A !== e) {
  50501. if (e)
  50502. switch (e) {
  50503. case Ci.NeverDepth:
  50504. l.depthFunc(l.NEVER);
  50505. break;
  50506. case Ci.AlwaysDepth:
  50507. l.depthFunc(l.ALWAYS);
  50508. break;
  50509. case Ci.LessDepth:
  50510. l.depthFunc(l.LESS);
  50511. break;
  50512. case Ci.LessEqualDepth:
  50513. l.depthFunc(l.LEQUAL);
  50514. break;
  50515. case Ci.EqualDepth:
  50516. l.depthFunc(l.EQUAL);
  50517. break;
  50518. case Ci.GreaterEqualDepth:
  50519. l.depthFunc(l.GEQUAL);
  50520. break;
  50521. case Ci.GreaterDepth:
  50522. l.depthFunc(l.GREATER);
  50523. break;
  50524. case Ci.NotEqualDepth:
  50525. l.depthFunc(l.NOTEQUAL);
  50526. break;
  50527. default:
  50528. l.depthFunc(l.LEQUAL)
  50529. }
  50530. else
  50531. l.depthFunc(l.LEQUAL);
  50532. A = e
  50533. }
  50534. }
  50535. ,
  50536. this.setDepthTest = function(e) {
  50537. e ? this.enable(l.DEPTH_TEST) : this.disable(l.DEPTH_TEST)
  50538. }
  50539. ,
  50540. this.setDepthWrite = function(e) {
  50541. C !== e && (l.depthMask(e),
  50542. C = e)
  50543. }
  50544. ,
  50545. this.setColorWrite = function(e) {
  50546. I !== e && (l.colorMask(e, e, e, e),
  50547. I = e)
  50548. }
  50549. ,
  50550. this.setStencilFunc = function(e, t, i) {
  50551. _ === e && b === t && w === i || (l.stencilFunc(e, t, i),
  50552. _ = e,
  50553. b = t,
  50554. w = i)
  50555. }
  50556. ,
  50557. this.setStencilOp = function(e, t, i) {
  50558. T === e && x === t && S === i || (l.stencilOp(e, t, i),
  50559. T = e,
  50560. x = t,
  50561. S = i)
  50562. }
  50563. ,
  50564. this.setStencilTest = function(e) {
  50565. e ? this.enable(l.STENCIL_TEST) : this.disable(l.STENCIL_TEST)
  50566. }
  50567. ,
  50568. this.setStencilWrite = function(e) {
  50569. E !== e && (l.stencilMask(e),
  50570. E = e)
  50571. }
  50572. ,
  50573. this.setFlipSided = function(e) {
  50574. M !== e && (e ? l.frontFace(l.CW) : l.frontFace(l.CCW),
  50575. M = e)
  50576. }
  50577. ,
  50578. this.setLineWidth = function(e) {
  50579. e !== R && (l.lineWidth(e),
  50580. R = e)
  50581. }
  50582. ,
  50583. this.setPolygonOffset = function(e, t, i) {
  50584. e ? this.enable(l.POLYGON_OFFSET_FILL) : this.disable(l.POLYGON_OFFSET_FILL),
  50585. !e || P === t && O === i || (l.polygonOffset(t, i),
  50586. P = t,
  50587. O = i)
  50588. }
  50589. ,
  50590. this.getScissorTest = function() {
  50591. return L
  50592. }
  50593. ,
  50594. this.setScissorTest = function(e) {
  50595. (L = e) ? this.enable(l.SCISSOR_TEST) : this.disable(l.SCISSOR_TEST)
  50596. }
  50597. ,
  50598. this.activeTexture = function(e) {
  50599. void 0 === e && (e = l.TEXTURE0 + D - 1),
  50600. N !== e && (l.activeTexture(e),
  50601. N = e)
  50602. }
  50603. ,
  50604. this.bindTexture = function(e, t) {
  50605. void 0 === N && n.activeTexture();
  50606. var i = F[N];
  50607. void 0 === i && (i = {
  50608. type: void 0,
  50609. texture: void 0
  50610. },
  50611. F[N] = i),
  50612. i.type === e && i.texture === t || (l.bindTexture(e, t || z),
  50613. i.type = e,
  50614. i.texture = t)
  50615. }
  50616. ,
  50617. this.compressedTexImage2D = function() {
  50618. try {
  50619. l.compressedTexImage2D.apply(l, arguments)
  50620. } catch (e) {
  50621. console.error(e)
  50622. }
  50623. }
  50624. ,
  50625. this.texImage2D = function() {
  50626. try {
  50627. l.texImage2D.apply(l, arguments)
  50628. } catch (e) {
  50629. console.error(e)
  50630. }
  50631. }
  50632. ,
  50633. this.clearColor = function(e, t, i, n) {
  50634. r.set(e, t, i, n),
  50635. !1 === B.equals(r) && (l.clearColor(e, t, i, n),
  50636. B.copy(r))
  50637. }
  50638. ,
  50639. this.clearDepth = function(e) {
  50640. V !== e && (l.clearDepth(e),
  50641. V = e)
  50642. }
  50643. ,
  50644. this.clearStencil = function(e) {
  50645. k !== e && (l.clearStencil(e),
  50646. k = e)
  50647. }
  50648. ,
  50649. this.scissor = function(e) {
  50650. !1 === U.equals(e) && (l.scissor(e.x, e.y, e.z, e.w),
  50651. U.copy(e))
  50652. }
  50653. ,
  50654. this.viewport = function(e) {
  50655. !1 === H.equals(e) && (l.viewport(e.x, e.y, e.z, e.w),
  50656. H.copy(e))
  50657. }
  50658. ,
  50659. this.reset = function() {
  50660. for (var e = 0; e < a.length; e++)
  50661. 1 === a[e] && (l.disableVertexAttribArray(e),
  50662. a[e] = 0);
  50663. t = {},
  50664. N = void 0,
  50665. F = {},
  50666. M = E = C = I = u = h = null
  50667. }
  50668. }
  50669. ,
  50670. Ci.LensFlarePlugin = function(v, y) {
  50671. function A() {
  50672. 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]);
  50673. C = S.createBuffer(),
  50674. I = S.createBuffer(),
  50675. S.bindBuffer(S.ARRAY_BUFFER, C),
  50676. S.bufferData(S.ARRAY_BUFFER, t, S.STATIC_DRAW),
  50677. S.bindBuffer(S.ELEMENT_ARRAY_BUFFER, I),
  50678. S.bufferData(S.ELEMENT_ARRAY_BUFFER, i, S.STATIC_DRAW),
  50679. T = S.createTexture(),
  50680. x = S.createTexture(),
  50681. M.bindTexture(S.TEXTURE_2D, T),
  50682. S.texImage2D(S.TEXTURE_2D, 0, S.RGB, 16, 16, 0, S.RGB, S.UNSIGNED_BYTE, null),
  50683. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_S, S.CLAMP_TO_EDGE),
  50684. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_T, S.CLAMP_TO_EDGE),
  50685. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MAG_FILTER, S.NEAREST),
  50686. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MIN_FILTER, S.NEAREST),
  50687. M.bindTexture(S.TEXTURE_2D, x),
  50688. S.texImage2D(S.TEXTURE_2D, 0, S.RGBA, 16, 16, 0, S.RGBA, S.UNSIGNED_BYTE, null),
  50689. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_S, S.CLAMP_TO_EDGE),
  50690. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_T, S.CLAMP_TO_EDGE),
  50691. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MAG_FILTER, S.NEAREST),
  50692. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MIN_FILTER, S.NEAREST),
  50693. e = (w = 0 < S.getParameter(S.MAX_VERTEX_TEXTURE_IMAGE_UNITS)) ? {
  50694. 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"),
  50695. 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")
  50696. } : {
  50697. 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"),
  50698. 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")
  50699. },
  50700. E = function(e) {
  50701. var t = S.createProgram()
  50702. , i = S.createShader(S.FRAGMENT_SHADER)
  50703. , n = S.createShader(S.VERTEX_SHADER)
  50704. , r = "precision " + v.getPrecision() + " float;\n";
  50705. return S.shaderSource(i, r + e.fragmentShader),
  50706. S.shaderSource(n, r + e.vertexShader),
  50707. S.compileShader(i),
  50708. S.compileShader(n),
  50709. S.attachShader(t, i),
  50710. S.attachShader(t, n),
  50711. S.linkProgram(t),
  50712. t
  50713. }(e),
  50714. _ = {
  50715. vertex: S.getAttribLocation(E, "position"),
  50716. uv: S.getAttribLocation(E, "uv")
  50717. },
  50718. b = {
  50719. renderType: S.getUniformLocation(E, "renderType"),
  50720. map: S.getUniformLocation(E, "map"),
  50721. occlusionMap: S.getUniformLocation(E, "occlusionMap"),
  50722. opacity: S.getUniformLocation(E, "opacity"),
  50723. color: S.getUniformLocation(E, "color"),
  50724. scale: S.getUniformLocation(E, "scale"),
  50725. rotation: S.getUniformLocation(E, "rotation"),
  50726. screenPosition: S.getUniformLocation(E, "screenPosition")
  50727. }
  50728. }
  50729. var C, I, E, _, b, w, T, x, S = v.context, M = v.state;
  50730. this.render = function(e, t, i) {
  50731. if (0 !== y.length) {
  50732. var n = new Ci.Vector3
  50733. , r = i.w / i.z
  50734. , o = .5 * i.z
  50735. , a = .5 * i.w
  50736. , s = 16 / i.w
  50737. , l = new Ci.Vector2(s * r,s)
  50738. , c = new Ci.Vector3(1,1,0)
  50739. , h = new Ci.Vector2(1,1);
  50740. void 0 === E && A(),
  50741. S.useProgram(E),
  50742. M.initAttributes(),
  50743. M.enableAttribute(_.vertex),
  50744. M.enableAttribute(_.uv),
  50745. M.disableUnusedAttributes(),
  50746. S.uniform1i(b.occlusionMap, 0),
  50747. S.uniform1i(b.map, 1),
  50748. S.bindBuffer(S.ARRAY_BUFFER, C),
  50749. S.vertexAttribPointer(_.vertex, 2, S.FLOAT, !1, 16, 0),
  50750. S.vertexAttribPointer(_.uv, 2, S.FLOAT, !1, 16, 8),
  50751. S.bindBuffer(S.ELEMENT_ARRAY_BUFFER, I),
  50752. M.disable(S.CULL_FACE),
  50753. M.setDepthWrite(!1);
  50754. for (var u = 0, d = y.length; u < d; u++) {
  50755. s = 16 / i.w,
  50756. l.set(s * r, s);
  50757. var p = y[u];
  50758. if (n.set(p.matrixWorld.elements[12], p.matrixWorld.elements[13], p.matrixWorld.elements[14]),
  50759. n.applyMatrix4(t.matrixWorldInverse),
  50760. n.applyProjection(t.projectionMatrix),
  50761. c.copy(n),
  50762. h.x = c.x * o + o,
  50763. h.y = c.y * a + a,
  50764. w || 0 < h.x && h.x < i.z && 0 < h.y && h.y < i.w) {
  50765. M.activeTexture(S.TEXTURE0),
  50766. M.bindTexture(S.TEXTURE_2D, null),
  50767. M.activeTexture(S.TEXTURE1),
  50768. M.bindTexture(S.TEXTURE_2D, T),
  50769. S.copyTexImage2D(S.TEXTURE_2D, 0, S.RGB, i.x + h.x - 8, i.y + h.y - 8, 16, 16, 0),
  50770. S.uniform1i(b.renderType, 0),
  50771. S.uniform2f(b.scale, l.x, l.y),
  50772. S.uniform3f(b.screenPosition, c.x, c.y, c.z),
  50773. M.disable(S.BLEND),
  50774. M.enable(S.DEPTH_TEST),
  50775. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0),
  50776. M.activeTexture(S.TEXTURE0),
  50777. M.bindTexture(S.TEXTURE_2D, x),
  50778. S.copyTexImage2D(S.TEXTURE_2D, 0, S.RGBA, i.x + h.x - 8, i.y + h.y - 8, 16, 16, 0),
  50779. S.uniform1i(b.renderType, 1),
  50780. M.disable(S.DEPTH_TEST),
  50781. M.activeTexture(S.TEXTURE1),
  50782. M.bindTexture(S.TEXTURE_2D, T),
  50783. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0),
  50784. p.positionScreen.copy(c),
  50785. p.customUpdateCallback ? p.customUpdateCallback(p) : p.updateLensFlares(),
  50786. S.uniform1i(b.renderType, 2),
  50787. M.enable(S.BLEND);
  50788. for (var f = 0, g = p.lensFlares.length; f < g; f++) {
  50789. var m = p.lensFlares[f];
  50790. .001 < m.opacity && .001 < m.scale && (c.x = m.x,
  50791. c.y = m.y,
  50792. c.z = m.z,
  50793. s = m.size * m.scale / i.w,
  50794. l.x = s * r,
  50795. l.y = s,
  50796. S.uniform3f(b.screenPosition, c.x, c.y, c.z),
  50797. S.uniform2f(b.scale, l.x, l.y),
  50798. S.uniform1f(b.rotation, m.rotation),
  50799. S.uniform1f(b.opacity, m.opacity),
  50800. S.uniform3f(b.color, m.color.r, m.color.g, m.color.b),
  50801. M.setBlending(m.blending, m.blendEquation, m.blendSrc, m.blendDst),
  50802. v.setTexture(m.texture, 1),
  50803. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0))
  50804. }
  50805. }
  50806. }
  50807. M.enable(S.CULL_FACE),
  50808. M.enable(S.DEPTH_TEST),
  50809. M.setDepthWrite(!0),
  50810. v.resetGLState()
  50811. }
  50812. }
  50813. }
  50814. ,
  50815. Ci.SpritePlugin = function(u, d) {
  50816. function p() {
  50817. var e = new Float32Array([-.5, -.5, 0, 0, .5, -.5, 1, 0, .5, .5, 1, 1, -.5, .5, 0, 1])
  50818. , t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  50819. g = I.createBuffer(),
  50820. m = I.createBuffer(),
  50821. I.bindBuffer(I.ARRAY_BUFFER, g),
  50822. I.bufferData(I.ARRAY_BUFFER, e, I.STATIC_DRAW),
  50823. I.bindBuffer(I.ELEMENT_ARRAY_BUFFER, m),
  50824. I.bufferData(I.ELEMENT_ARRAY_BUFFER, t, I.STATIC_DRAW),
  50825. v = function() {
  50826. var e = I.createProgram()
  50827. , t = I.createShader(I.VERTEX_SHADER)
  50828. , i = I.createShader(I.FRAGMENT_SHADER);
  50829. 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")),
  50830. 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")),
  50831. I.compileShader(t),
  50832. I.compileShader(i),
  50833. I.attachShader(e, t),
  50834. I.attachShader(e, i),
  50835. I.linkProgram(e),
  50836. e
  50837. }(),
  50838. y = {
  50839. position: I.getAttribLocation(v, "position"),
  50840. uv: I.getAttribLocation(v, "uv")
  50841. },
  50842. A = {
  50843. uvOffset: I.getUniformLocation(v, "uvOffset"),
  50844. uvScale: I.getUniformLocation(v, "uvScale"),
  50845. rotation: I.getUniformLocation(v, "rotation"),
  50846. scale: I.getUniformLocation(v, "scale"),
  50847. color: I.getUniformLocation(v, "color"),
  50848. map: I.getUniformLocation(v, "map"),
  50849. opacity: I.getUniformLocation(v, "opacity"),
  50850. modelViewMatrix: I.getUniformLocation(v, "modelViewMatrix"),
  50851. projectionMatrix: I.getUniformLocation(v, "projectionMatrix"),
  50852. fogType: I.getUniformLocation(v, "fogType"),
  50853. fogDensity: I.getUniformLocation(v, "fogDensity"),
  50854. fogNear: I.getUniformLocation(v, "fogNear"),
  50855. fogFar: I.getUniformLocation(v, "fogFar"),
  50856. fogColor: I.getUniformLocation(v, "fogColor"),
  50857. alphaTest: I.getUniformLocation(v, "alphaTest")
  50858. };
  50859. var i = document.createElement("canvas");
  50860. i.width = 8,
  50861. i.height = 8;
  50862. var n = i.getContext("2d");
  50863. n.fillStyle = "white",
  50864. n.fillRect(0, 0, 8, 8),
  50865. (C = new Ci.Texture(i)).needsUpdate = !0
  50866. }
  50867. function f(e, t) {
  50868. return e.renderOrder !== t.renderOrder ? e.renderOrder - t.renderOrder : e.z !== t.z ? t.z - e.z : t.id - e.id
  50869. }
  50870. var g, m, v, y, A, C, I = u.context, E = u.state, _ = new Ci.Vector3, b = new Ci.Quaternion, w = new Ci.Vector3;
  50871. this.render = function(e, t) {
  50872. if (0 !== d.length) {
  50873. void 0 === v && p(),
  50874. I.useProgram(v),
  50875. E.initAttributes(),
  50876. E.enableAttribute(y.position),
  50877. E.enableAttribute(y.uv),
  50878. E.disableUnusedAttributes(),
  50879. E.disable(I.CULL_FACE),
  50880. E.enable(I.BLEND),
  50881. I.bindBuffer(I.ARRAY_BUFFER, g),
  50882. I.vertexAttribPointer(y.position, 2, I.FLOAT, !1, 16, 0),
  50883. I.vertexAttribPointer(y.uv, 2, I.FLOAT, !1, 16, 8),
  50884. I.bindBuffer(I.ELEMENT_ARRAY_BUFFER, m),
  50885. I.uniformMatrix4fv(A.projectionMatrix, !1, t.projectionMatrix.elements),
  50886. E.activeTexture(I.TEXTURE0),
  50887. I.uniform1i(A.map, 0);
  50888. var i = 0
  50889. , n = 0
  50890. , r = e.fog;
  50891. r ? (I.uniform3f(A.fogColor, r.color.r, r.color.g, r.color.b),
  50892. r instanceof Ci.Fog ? (I.uniform1f(A.fogNear, r.near),
  50893. I.uniform1f(A.fogFar, r.far),
  50894. I.uniform1i(A.fogType, 1),
  50895. n = i = 1) : r instanceof Ci.FogExp2 && (I.uniform1f(A.fogDensity, r.density),
  50896. I.uniform1i(A.fogType, 2),
  50897. n = i = 2)) : (I.uniform1i(A.fogType, 0),
  50898. n = i = 0);
  50899. for (var o = 0, a = d.length; o < a; o++) {
  50900. (l = d[o]).modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, l.matrixWorld),
  50901. l.z = -l.modelViewMatrix.elements[14]
  50902. }
  50903. d.sort(f);
  50904. var s = [];
  50905. for (o = 0,
  50906. a = d.length; o < a; o++) {
  50907. var l, c = (l = d[o]).material;
  50908. I.uniform1f(A.alphaTest, c.alphaTest),
  50909. I.uniformMatrix4fv(A.modelViewMatrix, !1, l.modelViewMatrix.elements),
  50910. l.matrixWorld.decompose(_, b, w),
  50911. s[0] = w.x,
  50912. s[1] = w.y;
  50913. var h = 0;
  50914. e.fog && c.fog && (h = n),
  50915. i !== h && (I.uniform1i(A.fogType, h),
  50916. i = h),
  50917. null !== c.map ? (I.uniform2f(A.uvOffset, c.map.offset.x, c.map.offset.y),
  50918. I.uniform2f(A.uvScale, c.map.repeat.x, c.map.repeat.y)) : (I.uniform2f(A.uvOffset, 0, 0),
  50919. I.uniform2f(A.uvScale, 1, 1)),
  50920. I.uniform1f(A.opacity, c.opacity),
  50921. I.uniform3f(A.color, c.color.r, c.color.g, c.color.b),
  50922. I.uniform1f(A.rotation, c.rotation),
  50923. I.uniform2fv(A.scale, s),
  50924. E.setBlending(c.blending, c.blendEquation, c.blendSrc, c.blendDst),
  50925. E.setDepthTest(c.depthTest),
  50926. E.setDepthWrite(c.depthWrite),
  50927. c.map && c.map.image && c.map.image.width ? u.setTexture(c.map, 0) : u.setTexture(C, 0),
  50928. I.drawElements(I.TRIANGLES, 6, I.UNSIGNED_SHORT, 0)
  50929. }
  50930. E.enable(I.CULL_FACE),
  50931. u.resetGLState()
  50932. }
  50933. }
  50934. }
  50935. ,
  50936. Object.defineProperties(Ci.Box2.prototype, {
  50937. empty: {
  50938. value: function() {
  50939. return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),
  50940. this.isEmpty()
  50941. }
  50942. },
  50943. isIntersectionBox: {
  50944. value: function(e) {
  50945. return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),
  50946. this.intersectsBox(e)
  50947. }
  50948. }
  50949. }),
  50950. Object.defineProperties(Ci.Box3.prototype, {
  50951. empty: {
  50952. value: function() {
  50953. return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),
  50954. this.isEmpty()
  50955. }
  50956. },
  50957. isIntersectionBox: {
  50958. value: function(e) {
  50959. return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),
  50960. this.intersectsBox(e)
  50961. }
  50962. },
  50963. isIntersectionSphere: {
  50964. value: function(e) {
  50965. return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  50966. this.intersectsSphere(e)
  50967. }
  50968. }
  50969. }),
  50970. Object.defineProperties(Ci.Matrix3.prototype, {
  50971. multiplyVector3: {
  50972. value: function(e) {
  50973. return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),
  50974. e.applyMatrix3(this)
  50975. }
  50976. },
  50977. multiplyVector3Array: {
  50978. value: function(e) {
  50979. return console.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  50980. this.applyToVector3Array(e)
  50981. }
  50982. }
  50983. }),
  50984. Object.defineProperties(Ci.Matrix4.prototype, {
  50985. extractPosition: {
  50986. value: function(e) {
  50987. return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),
  50988. this.copyPosition(e)
  50989. }
  50990. },
  50991. setRotationFromQuaternion: {
  50992. value: function(e) {
  50993. return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),
  50994. this.makeRotationFromQuaternion(e)
  50995. }
  50996. },
  50997. multiplyVector3: {
  50998. value: function(e) {
  50999. return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead."),
  51000. e.applyProjection(this)
  51001. }
  51002. },
  51003. multiplyVector4: {
  51004. value: function(e) {
  51005. return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  51006. e.applyMatrix4(this)
  51007. }
  51008. },
  51009. multiplyVector3Array: {
  51010. value: function(e) {
  51011. return console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  51012. this.applyToVector3Array(e)
  51013. }
  51014. },
  51015. rotateAxis: {
  51016. value: function(e) {
  51017. console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),
  51018. e.transformDirection(this)
  51019. }
  51020. },
  51021. crossVector: {
  51022. value: function(e) {
  51023. return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  51024. e.applyMatrix4(this)
  51025. }
  51026. },
  51027. translate: {
  51028. value: function(e) {
  51029. console.error("THREE.Matrix4: .translate() has been removed.")
  51030. }
  51031. },
  51032. rotateX: {
  51033. value: function(e) {
  51034. console.error("THREE.Matrix4: .rotateX() has been removed.")
  51035. }
  51036. },
  51037. rotateY: {
  51038. value: function(e) {
  51039. console.error("THREE.Matrix4: .rotateY() has been removed.")
  51040. }
  51041. },
  51042. rotateZ: {
  51043. value: function(e) {
  51044. console.error("THREE.Matrix4: .rotateZ() has been removed.")
  51045. }
  51046. },
  51047. rotateByAxis: {
  51048. value: function(e, t) {
  51049. console.error("THREE.Matrix4: .rotateByAxis() has been removed.")
  51050. }
  51051. }
  51052. }),
  51053. Object.defineProperties(Ci.Plane.prototype, {
  51054. isIntersectionLine: {
  51055. value: function(e) {
  51056. return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),
  51057. this.intersectsLine(e)
  51058. }
  51059. }
  51060. }),
  51061. Object.defineProperties(Ci.Quaternion.prototype, {
  51062. multiplyVector3: {
  51063. value: function(e) {
  51064. return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),
  51065. e.applyQuaternion(this)
  51066. }
  51067. }
  51068. }),
  51069. Object.defineProperties(Ci.Ray.prototype, {
  51070. isIntersectionBox: {
  51071. value: function(e) {
  51072. return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),
  51073. this.intersectsBox(e)
  51074. }
  51075. },
  51076. isIntersectionPlane: {
  51077. value: function(e) {
  51078. return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),
  51079. this.intersectsPlane(e)
  51080. }
  51081. },
  51082. isIntersectionSphere: {
  51083. value: function(e) {
  51084. return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  51085. this.intersectsSphere(e)
  51086. }
  51087. }
  51088. }),
  51089. Object.defineProperties(Ci.Vector3.prototype, {
  51090. setEulerFromRotationMatrix: {
  51091. value: function() {
  51092. console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")
  51093. }
  51094. },
  51095. setEulerFromQuaternion: {
  51096. value: function() {
  51097. console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")
  51098. }
  51099. },
  51100. getPositionFromMatrix: {
  51101. value: function(e) {
  51102. return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),
  51103. this.setFromMatrixPosition(e)
  51104. }
  51105. },
  51106. getScaleFromMatrix: {
  51107. value: function(e) {
  51108. return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),
  51109. this.setFromMatrixScale(e)
  51110. }
  51111. },
  51112. getColumnFromMatrix: {
  51113. value: function(e, t) {
  51114. return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),
  51115. this.setFromMatrixColumn(e, t)
  51116. }
  51117. }
  51118. }),
  51119. Ci.Face4 = function(e, t, i, n, r, o, a) {
  51120. return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),
  51121. new Ci.Face3(e,t,i,r,o,a)
  51122. }
  51123. ,
  51124. Ci.Vertex = function(e, t, i) {
  51125. return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),
  51126. new Ci.Vector3(e,t,i)
  51127. }
  51128. ,
  51129. Object.defineProperties(Ci.Object3D.prototype, {
  51130. eulerOrder: {
  51131. get: function() {
  51132. return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  51133. this.rotation.order
  51134. },
  51135. set: function(e) {
  51136. console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  51137. this.rotation.order = e
  51138. }
  51139. },
  51140. getChildByName: {
  51141. value: function(e) {
  51142. return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),
  51143. this.getObjectByName(e)
  51144. }
  51145. },
  51146. renderDepth: {
  51147. set: function(e) {
  51148. console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")
  51149. }
  51150. },
  51151. translate: {
  51152. value: function(e, t) {
  51153. return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),
  51154. this.translateOnAxis(t, e)
  51155. }
  51156. },
  51157. useQuaternion: {
  51158. get: function() {
  51159. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  51160. },
  51161. set: function(e) {
  51162. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  51163. }
  51164. }
  51165. }),
  51166. Object.defineProperties(Ci, {
  51167. PointCloud: {
  51168. value: function(e, t) {
  51169. return console.warn("THREE.PointCloud has been renamed to THREE.Points."),
  51170. new Ci.Points(e,t)
  51171. }
  51172. },
  51173. ParticleSystem: {
  51174. value: function(e, t) {
  51175. return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),
  51176. new Ci.Points(e,t)
  51177. }
  51178. }
  51179. }),
  51180. Object.defineProperties(Ci.Light.prototype, {
  51181. onlyShadow: {
  51182. set: function(e) {
  51183. console.warn("THREE.Light: .onlyShadow has been removed.")
  51184. }
  51185. },
  51186. shadowCameraFov: {
  51187. set: function(e) {
  51188. console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),
  51189. this.shadow.camera.fov = e
  51190. }
  51191. },
  51192. shadowCameraLeft: {
  51193. set: function(e) {
  51194. console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),
  51195. this.shadow.camera.left = e
  51196. }
  51197. },
  51198. shadowCameraRight: {
  51199. set: function(e) {
  51200. console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),
  51201. this.shadow.camera.right = e
  51202. }
  51203. },
  51204. shadowCameraTop: {
  51205. set: function(e) {
  51206. console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),
  51207. this.shadow.camera.top = e
  51208. }
  51209. },
  51210. shadowCameraBottom: {
  51211. set: function(e) {
  51212. console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),
  51213. this.shadow.camera.bottom = e
  51214. }
  51215. },
  51216. shadowCameraNear: {
  51217. set: function(e) {
  51218. console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),
  51219. this.shadow.camera.near = e
  51220. }
  51221. },
  51222. shadowCameraFar: {
  51223. set: function(e) {
  51224. console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),
  51225. this.shadow.camera.far = e
  51226. }
  51227. },
  51228. shadowCameraVisible: {
  51229. set: function(e) {
  51230. console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")
  51231. }
  51232. },
  51233. shadowBias: {
  51234. set: function(e) {
  51235. console.warn("THREE.Light: .shadowBias is now .shadow.bias."),
  51236. this.shadow.bias = e
  51237. }
  51238. },
  51239. shadowDarkness: {
  51240. set: function(e) {
  51241. console.warn("THREE.Light: .shadowDarkness has been removed.")
  51242. }
  51243. },
  51244. shadowMapWidth: {
  51245. set: function(e) {
  51246. console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),
  51247. this.shadow.mapSize.width = e
  51248. }
  51249. },
  51250. shadowMapHeight: {
  51251. set: function(e) {
  51252. console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),
  51253. this.shadow.mapSize.height = e
  51254. }
  51255. }
  51256. }),
  51257. Object.defineProperties(Ci.BufferAttribute.prototype, {
  51258. length: {
  51259. get: function() {
  51260. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  51261. this.array.length
  51262. }
  51263. }
  51264. }),
  51265. Object.defineProperties(Ci.BufferGeometry.prototype, {
  51266. drawcalls: {
  51267. get: function() {
  51268. return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),
  51269. this.groups
  51270. }
  51271. },
  51272. offsets: {
  51273. get: function() {
  51274. return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),
  51275. this.groups
  51276. }
  51277. },
  51278. addIndex: {
  51279. value: function(e) {
  51280. console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),
  51281. this.setIndex(e)
  51282. }
  51283. },
  51284. addDrawCall: {
  51285. value: function(e, t, i) {
  51286. void 0 !== i && console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),
  51287. console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),
  51288. this.addGroup(e, t)
  51289. }
  51290. },
  51291. clearDrawCalls: {
  51292. value: function() {
  51293. console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),
  51294. this.clearGroups()
  51295. }
  51296. },
  51297. computeTangents: {
  51298. value: function() {
  51299. console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")
  51300. }
  51301. },
  51302. computeOffsets: {
  51303. value: function() {
  51304. console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")
  51305. }
  51306. }
  51307. }),
  51308. Object.defineProperties(Ci.Material.prototype, {
  51309. wrapAround: {
  51310. get: function() {
  51311. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  51312. },
  51313. set: function(e) {
  51314. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  51315. }
  51316. },
  51317. wrapRGB: {
  51318. get: function() {
  51319. return console.warn("THREE." + this.type + ": .wrapRGB has been removed."),
  51320. new Ci.Color
  51321. }
  51322. }
  51323. }),
  51324. Object.defineProperties(Ci, {
  51325. PointCloudMaterial: {
  51326. value: function(e) {
  51327. return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),
  51328. new Ci.PointsMaterial(e)
  51329. }
  51330. },
  51331. ParticleBasicMaterial: {
  51332. value: function(e) {
  51333. return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),
  51334. new Ci.PointsMaterial(e)
  51335. }
  51336. },
  51337. ParticleSystemMaterial: {
  51338. value: function(e) {
  51339. return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),
  51340. new Ci.PointsMaterial(e)
  51341. }
  51342. }
  51343. }),
  51344. Object.defineProperties(Ci.MeshPhongMaterial.prototype, {
  51345. metal: {
  51346. get: function() {
  51347. return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),
  51348. !1
  51349. },
  51350. set: function(e) {
  51351. console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")
  51352. }
  51353. }
  51354. }),
  51355. Object.defineProperties(Ci.ShaderMaterial.prototype, {
  51356. derivatives: {
  51357. get: function() {
  51358. return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  51359. this.extensions.derivatives
  51360. },
  51361. set: function(e) {
  51362. console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  51363. this.extensions.derivatives = e
  51364. }
  51365. }
  51366. }),
  51367. Object.defineProperties(Ci.WebGLRenderer.prototype, {
  51368. supportsFloatTextures: {
  51369. value: function() {
  51370. return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),
  51371. this.extensions.get("OES_texture_float")
  51372. }
  51373. },
  51374. supportsHalfFloatTextures: {
  51375. value: function() {
  51376. return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),
  51377. this.extensions.get("OES_texture_half_float")
  51378. }
  51379. },
  51380. supportsStandardDerivatives: {
  51381. value: function() {
  51382. return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),
  51383. this.extensions.get("OES_standard_derivatives")
  51384. }
  51385. },
  51386. supportsCompressedTextureS3TC: {
  51387. value: function() {
  51388. return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),
  51389. this.extensions.get("WEBGL_compressed_texture_s3tc")
  51390. }
  51391. },
  51392. supportsCompressedTexturePVRTC: {
  51393. value: function() {
  51394. return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),
  51395. this.extensions.get("WEBGL_compressed_texture_pvrtc")
  51396. }
  51397. },
  51398. supportsBlendMinMax: {
  51399. value: function() {
  51400. return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),
  51401. this.extensions.get("EXT_blend_minmax")
  51402. }
  51403. },
  51404. supportsVertexTextures: {
  51405. value: function() {
  51406. return this.capabilities.vertexTextures
  51407. }
  51408. },
  51409. supportsInstancedArrays: {
  51410. value: function() {
  51411. return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),
  51412. this.extensions.get("ANGLE_instanced_arrays")
  51413. }
  51414. },
  51415. enableScissorTest: {
  51416. value: function(e) {
  51417. console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),
  51418. this.setScissorTest(e)
  51419. }
  51420. },
  51421. initMaterial: {
  51422. value: function() {
  51423. console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")
  51424. }
  51425. },
  51426. addPrePlugin: {
  51427. value: function() {
  51428. console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")
  51429. }
  51430. },
  51431. addPostPlugin: {
  51432. value: function() {
  51433. console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")
  51434. }
  51435. },
  51436. updateShadowMap: {
  51437. value: function() {
  51438. console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")
  51439. }
  51440. },
  51441. shadowMapEnabled: {
  51442. get: function() {
  51443. return this.shadowMap.enabled
  51444. },
  51445. set: function(e) {
  51446. console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),
  51447. this.shadowMap.enabled = e
  51448. }
  51449. },
  51450. shadowMapType: {
  51451. get: function() {
  51452. return this.shadowMap.type
  51453. },
  51454. set: function(e) {
  51455. console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),
  51456. this.shadowMap.type = e
  51457. }
  51458. },
  51459. shadowMapCullFace: {
  51460. get: function() {
  51461. return this.shadowMap.cullFace
  51462. },
  51463. set: function(e) {
  51464. console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace."),
  51465. this.shadowMap.cullFace = e
  51466. }
  51467. }
  51468. }),
  51469. Object.defineProperties(Ci.WebGLRenderTarget.prototype, {
  51470. wrapS: {
  51471. get: function() {
  51472. return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  51473. this.texture.wrapS
  51474. },
  51475. set: function(e) {
  51476. console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  51477. this.texture.wrapS = e
  51478. }
  51479. },
  51480. wrapT: {
  51481. get: function() {
  51482. return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  51483. this.texture.wrapT
  51484. },
  51485. set: function(e) {
  51486. console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  51487. this.texture.wrapT = e
  51488. }
  51489. },
  51490. magFilter: {
  51491. get: function() {
  51492. return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  51493. this.texture.magFilter
  51494. },
  51495. set: function(e) {
  51496. console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  51497. this.texture.magFilter = e
  51498. }
  51499. },
  51500. minFilter: {
  51501. get: function() {
  51502. return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  51503. this.texture.minFilter
  51504. },
  51505. set: function(e) {
  51506. console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  51507. this.texture.minFilter = e
  51508. }
  51509. },
  51510. anisotropy: {
  51511. get: function() {
  51512. return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  51513. this.texture.anisotropy
  51514. },
  51515. set: function(e) {
  51516. console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  51517. this.texture.anisotropy = e
  51518. }
  51519. },
  51520. offset: {
  51521. get: function() {
  51522. return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  51523. this.texture.offset
  51524. },
  51525. set: function(e) {
  51526. console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  51527. this.texture.offset = e
  51528. }
  51529. },
  51530. repeat: {
  51531. get: function() {
  51532. return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  51533. this.texture.repeat
  51534. },
  51535. set: function(e) {
  51536. console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  51537. this.texture.repeat = e
  51538. }
  51539. },
  51540. format: {
  51541. get: function() {
  51542. return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  51543. this.texture.format
  51544. },
  51545. set: function(e) {
  51546. console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  51547. this.texture.format = e
  51548. }
  51549. },
  51550. type: {
  51551. get: function() {
  51552. return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  51553. this.texture.type
  51554. },
  51555. set: function(e) {
  51556. console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  51557. this.texture.type = e
  51558. }
  51559. },
  51560. generateMipmaps: {
  51561. get: function() {
  51562. return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  51563. this.texture.generateMipmaps
  51564. },
  51565. set: function(e) {
  51566. console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  51567. this.texture.generateMipmaps = e
  51568. }
  51569. }
  51570. }),
  51571. Ci.GeometryUtils = {
  51572. merge: function(e, t, i) {
  51573. var n;
  51574. console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead."),
  51575. t instanceof Ci.Mesh && (t.matrixAutoUpdate && t.updateMatrix(),
  51576. n = t.matrix,
  51577. t = t.geometry),
  51578. e.merge(t, n, i)
  51579. },
  51580. center: function(e) {
  51581. return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),
  51582. e.center()
  51583. }
  51584. },
  51585. Ci.ImageUtils = {
  51586. crossOrigin: void 0,
  51587. loadTexture: function(e, t, i, n) {
  51588. console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");
  51589. var r = new Ci.TextureLoader;
  51590. r.setCrossOrigin(this.crossOrigin);
  51591. var o = r.load(e, i, void 0, n);
  51592. return t && (o.mapping = t),
  51593. o
  51594. },
  51595. loadTextureCube: function(e, t, i, n) {
  51596. console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");
  51597. var r = new Ci.CubeTextureLoader;
  51598. r.setCrossOrigin(this.crossOrigin);
  51599. var o = r.load(e, i, void 0, n);
  51600. return t && (o.mapping = t),
  51601. o
  51602. },
  51603. loadCompressedTexture: function() {
  51604. console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")
  51605. },
  51606. loadCompressedTextureCube: function() {
  51607. console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")
  51608. }
  51609. },
  51610. Ci.Projector = function() {
  51611. console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),
  51612. this.projectVector = function(e, t) {
  51613. console.warn("THREE.Projector: .projectVector() is now vector.project()."),
  51614. e.project(t)
  51615. }
  51616. ,
  51617. this.unprojectVector = function(e, t) {
  51618. console.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),
  51619. e.unproject(t)
  51620. }
  51621. ,
  51622. this.pickingRay = function(e, t) {
  51623. console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")
  51624. }
  51625. }
  51626. ,
  51627. Ci.CanvasRenderer = function() {
  51628. console.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"),
  51629. this.domElement = document.createElement("canvas"),
  51630. this.clear = function() {}
  51631. ,
  51632. this.render = function() {}
  51633. ,
  51634. this.setClearColor = function() {}
  51635. ,
  51636. this.setSize = function() {}
  51637. }
  51638. ,
  51639. Ci.MeshFaceMaterial = Ci.MultiMaterial,
  51640. Ci.CurveUtils = {
  51641. tangentQuadraticBezier: function(e, t, i, n) {
  51642. return 2 * (1 - e) * (i - t) + 2 * e * (n - i)
  51643. },
  51644. tangentCubicBezier: function(e, t, i, n, r) {
  51645. 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
  51646. },
  51647. tangentSpline: function(e, t, i, n, r) {
  51648. return 6 * e * e - 6 * e + (3 * e * e - 4 * e + 1) + (-6 * e * e + 6 * e) + (3 * e * e - 2 * e)
  51649. },
  51650. interpolate: function(e, t, i, n, r) {
  51651. var o = .5 * (i - e)
  51652. , a = .5 * (n - t)
  51653. , s = r * r;
  51654. return (2 * t - 2 * i + o + a) * (r * s) + (-3 * t + 3 * i - 2 * o - a) * s + o * r + t
  51655. }
  51656. },
  51657. Ci.SceneUtils = {
  51658. createMultiMaterialObject: function(e, t) {
  51659. for (var i = new Ci.Group, n = 0, r = t.length; n < r; n++)
  51660. i.add(new Ci.Mesh(e,t[n]));
  51661. return i
  51662. },
  51663. detach: function(e, t, i) {
  51664. e.applyMatrix(t.matrixWorld),
  51665. t.remove(e),
  51666. i.add(e)
  51667. },
  51668. attach: function(e, t, i) {
  51669. var n = new Ci.Matrix4;
  51670. n.getInverse(i.matrixWorld),
  51671. e.applyMatrix(n),
  51672. t.remove(e),
  51673. i.add(e)
  51674. }
  51675. },
  51676. Ci.ShapeUtils = {
  51677. area: function(e) {
  51678. for (var t = e.length, i = 0, n = t - 1, r = 0; r < t; n = r++)
  51679. i += e[n].x * e[r].y - e[r].x * e[n].y;
  51680. return .5 * i
  51681. },
  51682. triangulate: function(e, t) {
  51683. var i = e.length;
  51684. if (i < 3)
  51685. return null;
  51686. var n, r, o, a = [], s = [], l = [];
  51687. if (0 < Ci.ShapeUtils.area(e))
  51688. for (r = 0; r < i; r++)
  51689. s[r] = r;
  51690. else
  51691. for (r = 0; r < i; r++)
  51692. s[r] = i - 1 - r;
  51693. var c = i
  51694. , h = 2 * c;
  51695. for (r = c - 1; 2 < c; ) {
  51696. if (h-- <= 0)
  51697. return console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()"),
  51698. t ? l : a;
  51699. if (c <= (n = r) && (n = 0),
  51700. c <= (r = n + 1) && (r = 0),
  51701. c <= (o = r + 1) && (o = 0),
  51702. Si(e, n, r, o, c, s)) {
  51703. var u, d, p, f, g;
  51704. for (u = s[n],
  51705. d = s[r],
  51706. p = s[o],
  51707. a.push([e[u], e[d], e[p]]),
  51708. l.push([s[n], s[r], s[o]]),
  51709. g = (f = r) + 1; g < c; f++,
  51710. g++)
  51711. s[f] = s[g];
  51712. h = 2 * --c
  51713. }
  51714. }
  51715. return t ? l : a
  51716. },
  51717. triangulateShape: function(e, t) {
  51718. function w(e, t, i) {
  51719. 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
  51720. }
  51721. function b(e, t, i, n, r) {
  51722. var o = t.x - e.x
  51723. , a = t.y - e.y
  51724. , s = n.x - i.x
  51725. , l = n.y - i.y
  51726. , c = e.x - i.x
  51727. , h = e.y - i.y
  51728. , u = a * s - o * l
  51729. , d = a * c - o * h;
  51730. if (Math.abs(u) > Number.EPSILON) {
  51731. var p;
  51732. if (0 < u) {
  51733. if (d < 0 || u < d)
  51734. return [];
  51735. if ((p = l * c - s * h) < 0 || u < p)
  51736. return []
  51737. } else {
  51738. if (0 < d || d < u)
  51739. return [];
  51740. if (0 < (p = l * c - s * h) || p < u)
  51741. return []
  51742. }
  51743. if (0 === p)
  51744. return !r || 0 != d && d != u ? [e] : [];
  51745. if (p === u)
  51746. return !r || 0 != d && d != u ? [t] : [];
  51747. if (0 == d)
  51748. return [i];
  51749. if (d == u)
  51750. return [n];
  51751. var f = p / u;
  51752. return [{
  51753. x: e.x + f * o,
  51754. y: e.y + f * a
  51755. }]
  51756. }
  51757. if (0 != d || l * c != s * h)
  51758. return [];
  51759. var g, m, v, y, A, C, I, E, _ = 0 == o && 0 == a, b = 0 == s && 0 == l;
  51760. 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,
  51761. (m = t).x) : (v = (g = t).x,
  51762. (m = e).x),
  51763. i.x < n.x ? (I = (A = i).x,
  51764. (C = n).x) : (I = (A = n).x,
  51765. (C = i).x)) : (y = e.y < t.y ? (v = (g = e).y,
  51766. (m = t).y) : (v = (g = t).y,
  51767. (m = e).y),
  51768. i.y < n.y ? (I = (A = i).y,
  51769. (C = n).y) : (I = (A = n).y,
  51770. (C = i).y)),
  51771. 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])
  51772. }
  51773. function T(e, t, i, n) {
  51774. var r = t.x - e.x
  51775. , o = t.y - e.y
  51776. , a = i.x - e.x
  51777. , s = i.y - e.y
  51778. , l = n.x - e.x
  51779. , c = n.y - e.y
  51780. , h = r * s - o * a
  51781. , u = r * c - o * l;
  51782. if (Math.abs(h) > Number.EPSILON) {
  51783. var d = l * s - c * a;
  51784. return 0 < h ? 0 <= u && 0 <= d : 0 <= u || 0 <= d
  51785. }
  51786. return 0 < u
  51787. }
  51788. for (var i, n, r, o, a, s, l = {}, c = e.concat(), h = 0, u = t.length; h < u; h++)
  51789. Array.prototype.push.apply(c, t[h]);
  51790. for (i = 0,
  51791. n = c.length; i < n; i++)
  51792. void 0 !== l[a = c[i].x + ":" + c[i].y] && console.warn("THREE.Shape: Duplicate point", a),
  51793. l[a] = i;
  51794. var d = function(e, a) {
  51795. function t(e, t) {
  51796. var i = m.length - 1
  51797. , n = e - 1;
  51798. n < 0 && (n = i);
  51799. var r = e + 1;
  51800. i < r && (r = 0);
  51801. var o = T(m[e], m[n], m[r], c[t]);
  51802. if (!o)
  51803. return !1;
  51804. var a = c.length - 1
  51805. , s = t - 1;
  51806. s < 0 && (s = a);
  51807. var l = t + 1;
  51808. return a < l && (l = 0),
  51809. !!(o = T(c[t], c[s], c[l], m[e]))
  51810. }
  51811. function i(e, t) {
  51812. var i, n;
  51813. for (i = 0; i < m.length; i++)
  51814. if (n = i + 1,
  51815. n %= m.length,
  51816. 0 < b(e, t, m[i], m[n], !0).length)
  51817. return !0;
  51818. return !1
  51819. }
  51820. function n(e, t) {
  51821. var i, n, r, o;
  51822. for (i = 0; i < v.length; i++)
  51823. for (n = a[v[i]],
  51824. r = 0; r < n.length; r++)
  51825. if (o = r + 1,
  51826. o %= n.length,
  51827. 0 < b(e, t, n[r], n[o], !0).length)
  51828. return !0;
  51829. return !1
  51830. }
  51831. 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++)
  51832. v.push(A);
  51833. for (var I = 0, E = 2 * v.length; 0 < v.length; ) {
  51834. if (--E < 0) {
  51835. console.log("Infinite Loop! Holes left:" + v.length + ", Probably Hole outside Shape!");
  51836. break
  51837. }
  51838. for (o = I; o < m.length; o++) {
  51839. s = m[o],
  51840. r = -1;
  51841. for (A = 0; A < v.length; A++)
  51842. if (h = v[A],
  51843. void 0 === y[u = s.x + ":" + s.y + ":" + h]) {
  51844. c = a[h];
  51845. for (var _ = 0; _ < c.length; _++)
  51846. if (l = c[_],
  51847. t(o, _) && !i(s, l) && !n(s, l)) {
  51848. r = _,
  51849. v.splice(A, 1),
  51850. d = m.slice(0, o + 1),
  51851. p = m.slice(o),
  51852. f = c.slice(r),
  51853. g = c.slice(0, r + 1),
  51854. m = d.concat(f).concat(g).concat(p),
  51855. I = o;
  51856. break
  51857. }
  51858. if (0 <= r)
  51859. break;
  51860. y[u] = !0
  51861. }
  51862. if (0 <= r)
  51863. break
  51864. }
  51865. }
  51866. return m
  51867. }(e, t)
  51868. , p = Ci.ShapeUtils.triangulate(d, !1);
  51869. for (i = 0,
  51870. n = p.length; i < n; i++)
  51871. for (o = p[i],
  51872. r = 0; r < 3; r++)
  51873. void 0 !== (s = l[a = o[r].x + ":" + o[r].y]) && (o[r] = s);
  51874. return p.concat()
  51875. },
  51876. isClockWise: function(e) {
  51877. return Ci.ShapeUtils.area(e) < 0
  51878. },
  51879. b2: function(e, t, i, n) {
  51880. return function(e, t) {
  51881. var i = 1 - e;
  51882. return i * i * t
  51883. }(e, t) + function(e, t) {
  51884. return 2 * (1 - e) * e * t
  51885. }(e, i) + function(e, t) {
  51886. return e * e * t
  51887. }(e, n)
  51888. },
  51889. b3: function(e, t, i, n, r) {
  51890. return function(e, t) {
  51891. var i = 1 - e;
  51892. return i * i * i * t
  51893. }(e, t) + function(e, t) {
  51894. var i = 1 - e;
  51895. return 3 * i * i * e * t
  51896. }(e, i) + function(e, t) {
  51897. return 3 * (1 - e) * e * e * t
  51898. }(e, n) + function(e, t) {
  51899. return e * e * e * t
  51900. }(e, r)
  51901. }
  51902. },
  51903. Ci.Curve = function() {}
  51904. ,
  51905. Ci.Curve.prototype = {
  51906. constructor: Ci.Curve,
  51907. getPoint: function(e) {
  51908. return console.warn("THREE.Curve: Warning, getPoint() not implemented!"),
  51909. null
  51910. },
  51911. getPointAt: function(e) {
  51912. var t = this.getUtoTmapping(e);
  51913. return this.getPoint(t)
  51914. },
  51915. getPoints: function(e) {
  51916. e = e || 5;
  51917. var t, i = [];
  51918. for (t = 0; t <= e; t++)
  51919. i.push(this.getPoint(t / e));
  51920. return i
  51921. },
  51922. getSpacedPoints: function(e) {
  51923. e = e || 5;
  51924. var t, i = [];
  51925. for (t = 0; t <= e; t++)
  51926. i.push(this.getPointAt(t / e));
  51927. return i
  51928. },
  51929. getLength: function() {
  51930. var e = this.getLengths();
  51931. return e[e.length - 1]
  51932. },
  51933. getLengths: function(e) {
  51934. if (e = e || (this.__arcLengthDivisions ? this.__arcLengthDivisions : 200),
  51935. this.cacheArcLengths && this.cacheArcLengths.length === e + 1 && !this.needsUpdate)
  51936. return this.cacheArcLengths;
  51937. this.needsUpdate = !1;
  51938. var t, i, n = [], r = this.getPoint(0), o = 0;
  51939. for (n.push(0),
  51940. i = 1; i <= e; i++)
  51941. o += (t = this.getPoint(i / e)).distanceTo(r),
  51942. n.push(o),
  51943. r = t;
  51944. return this.cacheArcLengths = n
  51945. },
  51946. updateArcLengths: function() {
  51947. this.needsUpdate = !0,
  51948. this.getLengths()
  51949. },
  51950. getUtoTmapping: function(e, t) {
  51951. var i, n = this.getLengths(), r = 0, o = n.length;
  51952. i = t || e * n[o - 1];
  51953. for (var a, s = 0, l = o - 1; s <= l; )
  51954. if ((a = n[r = Math.floor(s + (l - s) / 2)] - i) < 0)
  51955. s = r + 1;
  51956. else {
  51957. if (!(0 < a)) {
  51958. l = r;
  51959. break
  51960. }
  51961. l = r - 1
  51962. }
  51963. if (n[r = l] === i)
  51964. return r / (o - 1);
  51965. var c = n[r];
  51966. return (r + (i - c) / (n[r + 1] - c)) / (o - 1)
  51967. },
  51968. getTangent: function(e) {
  51969. var t = e - 1e-4
  51970. , i = e + 1e-4;
  51971. t < 0 && (t = 0),
  51972. 1 < i && (i = 1);
  51973. var n = this.getPoint(t);
  51974. return this.getPoint(i).clone().sub(n).normalize()
  51975. },
  51976. getTangentAt: function(e) {
  51977. var t = this.getUtoTmapping(e);
  51978. return this.getTangent(t)
  51979. }
  51980. },
  51981. Ci.Curve.create = function(e, t) {
  51982. return e.prototype = Object.create(Ci.Curve.prototype),
  51983. (e.prototype.constructor = e).prototype.getPoint = t,
  51984. e
  51985. }
  51986. ,
  51987. Ci.CurvePath = function() {
  51988. this.curves = [],
  51989. this.autoClose = !1
  51990. }
  51991. ,
  51992. Ci.CurvePath.prototype = Object.create(Ci.Curve.prototype),
  51993. Ci.CurvePath.prototype.constructor = Ci.CurvePath,
  51994. Ci.CurvePath.prototype.add = function(e) {
  51995. this.curves.push(e)
  51996. }
  51997. ,
  51998. Ci.CurvePath.prototype.closePath = function() {
  51999. var e = this.curves[0].getPoint(0)
  52000. , t = this.curves[this.curves.length - 1].getPoint(1);
  52001. e.equals(t) || this.curves.push(new Ci.LineCurve(t,e))
  52002. }
  52003. ,
  52004. Ci.CurvePath.prototype.getPoint = function(e) {
  52005. for (var t = e * this.getLength(), i = this.getCurveLengths(), n = 0; n < i.length; ) {
  52006. if (i[n] >= t) {
  52007. var r = i[n] - t
  52008. , o = this.curves[n]
  52009. , a = 1 - r / o.getLength();
  52010. return o.getPointAt(a)
  52011. }
  52012. n++
  52013. }
  52014. return null
  52015. }
  52016. ,
  52017. Ci.CurvePath.prototype.getLength = function() {
  52018. var e = this.getCurveLengths();
  52019. return e[e.length - 1]
  52020. }
  52021. ,
  52022. Ci.CurvePath.prototype.getCurveLengths = function() {
  52023. if (this.cacheLengths && this.cacheLengths.length === this.curves.length)
  52024. return this.cacheLengths;
  52025. for (var e = [], t = 0, i = 0, n = this.curves.length; i < n; i++)
  52026. t += this.curves[i].getLength(),
  52027. e.push(t);
  52028. return this.cacheLengths = e
  52029. }
  52030. ,
  52031. Ci.CurvePath.prototype.createPointsGeometry = function(e) {
  52032. var t = this.getPoints(e);
  52033. return this.createGeometry(t)
  52034. }
  52035. ,
  52036. Ci.CurvePath.prototype.createSpacedPointsGeometry = function(e) {
  52037. var t = this.getSpacedPoints(e);
  52038. return this.createGeometry(t)
  52039. }
  52040. ,
  52041. Ci.CurvePath.prototype.createGeometry = function(e) {
  52042. for (var t = new Ci.Geometry, i = 0, n = e.length; i < n; i++) {
  52043. var r = e[i];
  52044. t.vertices.push(new Ci.Vector3(r.x,r.y,r.z || 0))
  52045. }
  52046. return t
  52047. }
  52048. ,
  52049. Ci.Font = function(e) {
  52050. this.data = e
  52051. }
  52052. ,
  52053. Ci.Font.prototype = {
  52054. constructor: Ci.Font,
  52055. generateShapes: function(e, s, b) {
  52056. function l(e, t, i) {
  52057. var n = w.glyphs[e] || w.glyphs["?"];
  52058. if (n) {
  52059. 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;
  52060. if (n.o)
  52061. for (var A = n._cachedOutline || (n._cachedOutline = n.o.split(" ")), C = 0, I = A.length; C < I; ) {
  52062. switch (A[C++]) {
  52063. case "m":
  52064. r = A[C++] * t + i,
  52065. o = A[C++] * t,
  52066. g.moveTo(r, o);
  52067. break;
  52068. case "l":
  52069. r = A[C++] * t + i,
  52070. o = A[C++] * t,
  52071. g.lineTo(r, o);
  52072. break;
  52073. case "q":
  52074. if (a = A[C++] * t + i,
  52075. s = A[C++] * t,
  52076. h = A[C++] * t + i,
  52077. u = A[C++] * t,
  52078. g.quadraticCurveTo(h, u, a, s),
  52079. f = m[m.length - 1]) {
  52080. l = f.x,
  52081. c = f.y;
  52082. for (var E = 1; E <= b; E++) {
  52083. v(_ = E / b, l, h, a),
  52084. v(_, c, u, s)
  52085. }
  52086. }
  52087. break;
  52088. case "b":
  52089. if (a = A[C++] * t + i,
  52090. s = A[C++] * t,
  52091. h = A[C++] * t + i,
  52092. u = A[C++] * t,
  52093. d = A[C++] * t + i,
  52094. p = A[C++] * t,
  52095. g.bezierCurveTo(h, u, d, p, a, s),
  52096. f = m[m.length - 1]) {
  52097. l = f.x,
  52098. c = f.y;
  52099. for (E = 1; E <= b; E++) {
  52100. var _;
  52101. y(_ = E / b, l, h, d, a),
  52102. y(_, c, u, p, s)
  52103. }
  52104. }
  52105. }
  52106. }
  52107. return {
  52108. offset: n.ha * t,
  52109. path: g
  52110. }
  52111. }
  52112. }
  52113. void 0 === s && (s = 100),
  52114. void 0 === b && (b = 4);
  52115. for (var w = this.data, t = function(e) {
  52116. for (var t = String(e).split(""), i = s / w.resolution, n = 0, r = [], o = 0; o < t.length; o++) {
  52117. var a = l(t[o], i, n);
  52118. n += a.offset,
  52119. r.push(a.path)
  52120. }
  52121. return r
  52122. }(e), i = [], n = 0, r = t.length; n < r; n++)
  52123. Array.prototype.push.apply(i, t[n].toShapes());
  52124. return i
  52125. }
  52126. },
  52127. Ci.Path = function(e) {
  52128. Ci.CurvePath.call(this),
  52129. this.actions = [],
  52130. e && this.fromPoints(e)
  52131. }
  52132. ,
  52133. Ci.Path.prototype = Object.create(Ci.CurvePath.prototype),
  52134. Ci.Path.prototype.constructor = Ci.Path,
  52135. Ci.Path.prototype.fromPoints = function(e) {
  52136. this.moveTo(e[0].x, e[0].y);
  52137. for (var t = 1, i = e.length; t < i; t++)
  52138. this.lineTo(e[t].x, e[t].y)
  52139. }
  52140. ,
  52141. Ci.Path.prototype.moveTo = function(e, t) {
  52142. this.actions.push({
  52143. action: "moveTo",
  52144. args: [e, t]
  52145. })
  52146. }
  52147. ,
  52148. Ci.Path.prototype.lineTo = function(e, t) {
  52149. var i = this.actions[this.actions.length - 1].args
  52150. , n = i[i.length - 2]
  52151. , r = i[i.length - 1]
  52152. , o = new Ci.LineCurve(new Ci.Vector2(n,r),new Ci.Vector2(e,t));
  52153. this.curves.push(o),
  52154. this.actions.push({
  52155. action: "lineTo",
  52156. args: [e, t]
  52157. })
  52158. }
  52159. ,
  52160. Ci.Path.prototype.quadraticCurveTo = function(e, t, i, n) {
  52161. var r = this.actions[this.actions.length - 1].args
  52162. , o = r[r.length - 2]
  52163. , a = r[r.length - 1]
  52164. , s = new Ci.QuadraticBezierCurve(new Ci.Vector2(o,a),new Ci.Vector2(e,t),new Ci.Vector2(i,n));
  52165. this.curves.push(s),
  52166. this.actions.push({
  52167. action: "quadraticCurveTo",
  52168. args: [e, t, i, n]
  52169. })
  52170. }
  52171. ,
  52172. Ci.Path.prototype.bezierCurveTo = function(e, t, i, n, r, o) {
  52173. var a = this.actions[this.actions.length - 1].args
  52174. , s = a[a.length - 2]
  52175. , l = a[a.length - 1]
  52176. , c = new Ci.CubicBezierCurve(new Ci.Vector2(s,l),new Ci.Vector2(e,t),new Ci.Vector2(i,n),new Ci.Vector2(r,o));
  52177. this.curves.push(c),
  52178. this.actions.push({
  52179. action: "bezierCurveTo",
  52180. args: [e, t, i, n, r, o]
  52181. })
  52182. }
  52183. ,
  52184. Ci.Path.prototype.splineThru = function(e) {
  52185. var t = Array.prototype.slice.call(arguments)
  52186. , i = this.actions[this.actions.length - 1].args
  52187. , n = i[i.length - 2]
  52188. , r = i[i.length - 1]
  52189. , o = [new Ci.Vector2(n,r)];
  52190. Array.prototype.push.apply(o, e);
  52191. var a = new Ci.SplineCurve(o);
  52192. this.curves.push(a),
  52193. this.actions.push({
  52194. action: "splineThru",
  52195. args: t
  52196. })
  52197. }
  52198. ,
  52199. Ci.Path.prototype.arc = function(e, t, i, n, r, o) {
  52200. var a = this.actions[this.actions.length - 1].args
  52201. , s = a[a.length - 2]
  52202. , l = a[a.length - 1];
  52203. this.absarc(e + s, t + l, i, n, r, o)
  52204. }
  52205. ,
  52206. Ci.Path.prototype.absarc = function(e, t, i, n, r, o) {
  52207. this.absellipse(e, t, i, i, n, r, o)
  52208. }
  52209. ,
  52210. Ci.Path.prototype.ellipse = function(e, t, i, n, r, o, a, s) {
  52211. var l = this.actions[this.actions.length - 1].args
  52212. , c = l[l.length - 2]
  52213. , h = l[l.length - 1];
  52214. this.absellipse(e + c, t + h, i, n, r, o, a, s)
  52215. }
  52216. ,
  52217. Ci.Path.prototype.absellipse = function(e, t, i, n, r, o, a, s) {
  52218. var l = [e, t, i, n, r, o, a, s || 0]
  52219. , c = new Ci.EllipseCurve(e,t,i,n,r,o,a,s);
  52220. this.curves.push(c);
  52221. var h = c.getPoint(1);
  52222. l.push(h.x),
  52223. l.push(h.y),
  52224. this.actions.push({
  52225. action: "ellipse",
  52226. args: l
  52227. })
  52228. }
  52229. ,
  52230. Ci.Path.prototype.getSpacedPoints = function(e) {
  52231. e = e || 40;
  52232. for (var t = [], i = 0; i < e; i++)
  52233. t.push(this.getPoint(i / e));
  52234. return this.autoClose && t.push(t[0]),
  52235. t
  52236. }
  52237. ,
  52238. Ci.Path.prototype.getPoints = function(e) {
  52239. e = e || 12;
  52240. 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++) {
  52241. var v = this.actions[g]
  52242. , y = v.action
  52243. , A = v.args;
  52244. switch (y) {
  52245. case "moveTo":
  52246. case "lineTo":
  52247. f.push(new Ci.Vector2(A[0],A[1]));
  52248. break;
  52249. case "quadraticCurveTo":
  52250. t = A[2],
  52251. i = A[3],
  52252. o = A[0],
  52253. a = A[1],
  52254. l = 0 < f.length ? (s = (c = f[f.length - 1]).x,
  52255. c.y) : (s = (c = this.actions[g - 1].args)[c.length - 2],
  52256. c[c.length - 1]);
  52257. for (var C = 1; C <= e; C++) {
  52258. h = d(O = C / e, s, o, t),
  52259. u = d(O, l, a, i),
  52260. f.push(new Ci.Vector2(h,u))
  52261. }
  52262. break;
  52263. case "bezierCurveTo":
  52264. t = A[4],
  52265. i = A[5],
  52266. o = A[0],
  52267. a = A[1],
  52268. n = A[2],
  52269. r = A[3],
  52270. l = 0 < f.length ? (s = (c = f[f.length - 1]).x,
  52271. c.y) : (s = (c = this.actions[g - 1].args)[c.length - 2],
  52272. c[c.length - 1]);
  52273. for (C = 1; C <= e; C++) {
  52274. h = p(O = C / e, s, o, n, t),
  52275. u = p(O, l, a, r, i),
  52276. f.push(new Ci.Vector2(h,u))
  52277. }
  52278. break;
  52279. case "splineThru":
  52280. c = this.actions[g - 1].args;
  52281. var I = [new Ci.Vector2(c[c.length - 2],c[c.length - 1])]
  52282. , E = e * A[0].length;
  52283. I = I.concat(A[0]);
  52284. var _ = new Ci.SplineCurve(I);
  52285. for (C = 1; C <= E; C++)
  52286. f.push(_.getPointAt(C / E));
  52287. break;
  52288. case "arc":
  52289. var b = A[0]
  52290. , w = A[1]
  52291. , T = A[2]
  52292. , x = A[3]
  52293. , S = A[4]
  52294. , M = !!A[5]
  52295. , R = S - x
  52296. , P = 2 * e;
  52297. for (C = 1; C <= P; C++) {
  52298. var O = C / P;
  52299. M || (O = 1 - O),
  52300. L = x + O * R,
  52301. h = b + T * Math.cos(L),
  52302. u = w + T * Math.sin(L),
  52303. f.push(new Ci.Vector2(h,u))
  52304. }
  52305. break;
  52306. case "ellipse":
  52307. b = A[0],
  52308. w = A[1];
  52309. var L, D, N, F = A[2], B = A[3], V = (x = A[4],
  52310. S = A[5],
  52311. M = !!A[6],
  52312. A[7]);
  52313. R = S - x,
  52314. P = 2 * e;
  52315. 0 !== V && (D = Math.cos(V),
  52316. N = Math.sin(V));
  52317. for (C = 1; C <= P; C++) {
  52318. O = C / P;
  52319. if (M || (O = 1 - O),
  52320. L = x + O * R,
  52321. h = b + F * Math.cos(L),
  52322. u = w + B * Math.sin(L),
  52323. 0 !== V) {
  52324. var k = h;
  52325. h = (k - b) * D - (u - w) * N + b,
  52326. u = (k - b) * N + (u - w) * D + w
  52327. }
  52328. f.push(new Ci.Vector2(h,u))
  52329. }
  52330. }
  52331. }
  52332. var U = f[f.length - 1];
  52333. 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),
  52334. this.autoClose && f.push(f[0]),
  52335. f
  52336. }
  52337. ,
  52338. Ci.Path.prototype.toShapes = function(e, t) {
  52339. function i(e) {
  52340. for (var t = [], i = 0, n = e.length; i < n; i++) {
  52341. var r = e[i]
  52342. , o = new Ci.Shape;
  52343. o.actions = r.actions,
  52344. o.curves = r.curves,
  52345. t.push(o)
  52346. }
  52347. return t
  52348. }
  52349. function n(e, t) {
  52350. for (var i = t.length, n = !1, r = i - 1, o = 0; o < i; r = o++) {
  52351. var a = t[r]
  52352. , s = t[o]
  52353. , l = s.x - a.x
  52354. , c = s.y - a.y;
  52355. if (Math.abs(c) > Number.EPSILON) {
  52356. if (c < 0 && (a = t[o],
  52357. l = -l,
  52358. s = t[r],
  52359. c = -c),
  52360. e.y < a.y || e.y > s.y)
  52361. continue;
  52362. if (e.y === a.y) {
  52363. if (e.x === a.x)
  52364. return !0
  52365. } else {
  52366. var h = c * (e.x - a.x) - l * (e.y - a.y);
  52367. if (0 == h)
  52368. return !0;
  52369. if (h < 0)
  52370. continue;
  52371. n = !n
  52372. }
  52373. } else {
  52374. if (e.y !== a.y)
  52375. continue;
  52376. if (s.x <= e.x && e.x <= a.x || a.x <= e.x && e.x <= s.x)
  52377. return !0
  52378. }
  52379. }
  52380. return n
  52381. }
  52382. var r = Ci.ShapeUtils.isClockWise
  52383. , o = function(e) {
  52384. for (var t = [], i = new Ci.Path, n = 0, r = e.length; n < r; n++) {
  52385. var o = e[n]
  52386. , a = o.args
  52387. , s = o.action;
  52388. "moveTo" === s && 0 !== i.actions.length && (t.push(i),
  52389. i = new Ci.Path),
  52390. i[s].apply(i, a)
  52391. }
  52392. return 0 !== i.actions.length && t.push(i),
  52393. t
  52394. }(this.actions);
  52395. if (0 === o.length)
  52396. return [];
  52397. if (!0 === t)
  52398. return i(o);
  52399. var a, s, l, c = [];
  52400. if (1 === o.length)
  52401. return s = o[0],
  52402. (l = new Ci.Shape).actions = s.actions,
  52403. l.curves = s.curves,
  52404. c.push(l),
  52405. c;
  52406. var h = !r(o[0].getPoints());
  52407. h = e ? !h : h;
  52408. var u, d = [], p = [], f = [], g = 0;
  52409. p[g] = void 0,
  52410. f[g] = [];
  52411. for (var m = 0, v = o.length; m < v; m++)
  52412. a = r(u = (s = o[m]).getPoints()),
  52413. (a = e ? !a : a) ? (!h && p[g] && g++,
  52414. p[g] = {
  52415. s: new Ci.Shape,
  52416. p: u
  52417. },
  52418. p[g].s.actions = s.actions,
  52419. p[g].s.curves = s.curves,
  52420. h && g++,
  52421. f[g] = []) : f[g].push({
  52422. h: s,
  52423. p: u[0]
  52424. });
  52425. if (!p[0])
  52426. return i(o);
  52427. if (1 < p.length) {
  52428. for (var y = !1, A = [], C = 0, I = p.length; C < I; C++)
  52429. d[C] = [];
  52430. for (C = 0,
  52431. I = p.length; C < I; C++)
  52432. for (var E = f[C], _ = 0; _ < E.length; _++) {
  52433. for (var b = E[_], w = !0, T = 0; T < p.length; T++)
  52434. n(b.p, p[T].p) && (C !== T && A.push({
  52435. froms: C,
  52436. tos: T,
  52437. hole: _
  52438. }),
  52439. w ? (w = !1,
  52440. d[T].push(b)) : y = !0);
  52441. w && d[C].push(b)
  52442. }
  52443. 0 < A.length && (y || (f = d))
  52444. }
  52445. m = 0;
  52446. for (var x, S = p.length; m < S; m++) {
  52447. l = p[m].s,
  52448. c.push(l);
  52449. for (var M = 0, R = (x = f[m]).length; M < R; M++)
  52450. l.holes.push(x[M].h)
  52451. }
  52452. return c
  52453. }
  52454. ,
  52455. Ci.Shape = function() {
  52456. Ci.Path.apply(this, arguments),
  52457. this.holes = []
  52458. }
  52459. ,
  52460. Ci.Shape.prototype = Object.create(Ci.Path.prototype),
  52461. Ci.Shape.prototype.constructor = Ci.Shape,
  52462. Ci.Shape.prototype.extrude = function(e) {
  52463. return new Ci.ExtrudeGeometry(this,e)
  52464. }
  52465. ,
  52466. Ci.Shape.prototype.makeGeometry = function(e) {
  52467. return new Ci.ShapeGeometry(this,e)
  52468. }
  52469. ,
  52470. Ci.Shape.prototype.getPointsHoles = function(e) {
  52471. for (var t = [], i = 0, n = this.holes.length; i < n; i++)
  52472. t[i] = this.holes[i].getPoints(e);
  52473. return t
  52474. }
  52475. ,
  52476. Ci.Shape.prototype.extractAllPoints = function(e) {
  52477. return {
  52478. shape: this.getPoints(e),
  52479. holes: this.getPointsHoles(e)
  52480. }
  52481. }
  52482. ,
  52483. Ci.Shape.prototype.extractPoints = function(e) {
  52484. return this.extractAllPoints(e)
  52485. }
  52486. ,
  52487. Ci.LineCurve = function(e, t) {
  52488. this.v1 = e,
  52489. this.v2 = t
  52490. }
  52491. ,
  52492. Ci.LineCurve.prototype = Object.create(Ci.Curve.prototype),
  52493. Ci.LineCurve.prototype.constructor = Ci.LineCurve,
  52494. Ci.LineCurve.prototype.getPoint = function(e) {
  52495. var t = this.v2.clone().sub(this.v1);
  52496. return t.multiplyScalar(e).add(this.v1),
  52497. t
  52498. }
  52499. ,
  52500. Ci.LineCurve.prototype.getPointAt = function(e) {
  52501. return this.getPoint(e)
  52502. }
  52503. ,
  52504. Ci.LineCurve.prototype.getTangent = function(e) {
  52505. return this.v2.clone().sub(this.v1).normalize()
  52506. }
  52507. ,
  52508. Ci.QuadraticBezierCurve = function(e, t, i) {
  52509. this.v0 = e,
  52510. this.v1 = t,
  52511. this.v2 = i
  52512. }
  52513. ,
  52514. Ci.QuadraticBezierCurve.prototype = Object.create(Ci.Curve.prototype),
  52515. Ci.QuadraticBezierCurve.prototype.constructor = Ci.QuadraticBezierCurve,
  52516. Ci.QuadraticBezierCurve.prototype.getPoint = function(e) {
  52517. var t = Ci.ShapeUtils.b2;
  52518. 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))
  52519. }
  52520. ,
  52521. Ci.QuadraticBezierCurve.prototype.getTangent = function(e) {
  52522. var t = Ci.CurveUtils.tangentQuadraticBezier;
  52523. 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()
  52524. }
  52525. ,
  52526. Ci.CubicBezierCurve = function(e, t, i, n) {
  52527. this.v0 = e,
  52528. this.v1 = t,
  52529. this.v2 = i,
  52530. this.v3 = n
  52531. }
  52532. ,
  52533. Ci.CubicBezierCurve.prototype = Object.create(Ci.Curve.prototype),
  52534. Ci.CubicBezierCurve.prototype.constructor = Ci.CubicBezierCurve,
  52535. Ci.CubicBezierCurve.prototype.getPoint = function(e) {
  52536. var t = Ci.ShapeUtils.b3;
  52537. 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))
  52538. }
  52539. ,
  52540. Ci.CubicBezierCurve.prototype.getTangent = function(e) {
  52541. var t = Ci.CurveUtils.tangentCubicBezier;
  52542. 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()
  52543. }
  52544. ,
  52545. Ci.SplineCurve = function(e) {
  52546. this.points = null == e ? [] : e
  52547. }
  52548. ,
  52549. Ci.SplineCurve.prototype = Object.create(Ci.Curve.prototype),
  52550. Ci.SplineCurve.prototype.constructor = Ci.SplineCurve,
  52551. Ci.SplineCurve.prototype.getPoint = function(e) {
  52552. var t = this.points
  52553. , i = (t.length - 1) * e
  52554. , n = Math.floor(i)
  52555. , r = i - n
  52556. , o = t[0 === n ? n : n - 1]
  52557. , a = t[n]
  52558. , s = t[n > t.length - 2 ? t.length - 1 : n + 1]
  52559. , l = t[n > t.length - 3 ? t.length - 1 : n + 2]
  52560. , c = Ci.CurveUtils.interpolate;
  52561. return new Ci.Vector2(c(o.x, a.x, s.x, l.x, r),c(o.y, a.y, s.y, l.y, r))
  52562. }
  52563. ,
  52564. Ci.EllipseCurve = function(e, t, i, n, r, o, a, s) {
  52565. this.aX = e,
  52566. this.aY = t,
  52567. this.xRadius = i,
  52568. this.yRadius = n,
  52569. this.aStartAngle = r,
  52570. this.aEndAngle = o,
  52571. this.aClockwise = a,
  52572. this.aRotation = s || 0
  52573. }
  52574. ,
  52575. Ci.EllipseCurve.prototype = Object.create(Ci.Curve.prototype),
  52576. Ci.EllipseCurve.prototype.constructor = Ci.EllipseCurve,
  52577. Ci.EllipseCurve.prototype.getPoint = function(e) {
  52578. var t, i = this.aEndAngle - this.aStartAngle;
  52579. i < 0 && (i += 2 * Math.PI),
  52580. i > 2 * Math.PI && (i -= 2 * Math.PI),
  52581. t = !0 === this.aClockwise ? this.aEndAngle + (1 - e) * (2 * Math.PI - i) : this.aStartAngle + e * i;
  52582. var n = this.aX + this.xRadius * Math.cos(t)
  52583. , r = this.aY + this.yRadius * Math.sin(t);
  52584. if (0 !== this.aRotation) {
  52585. var o = Math.cos(this.aRotation)
  52586. , a = Math.sin(this.aRotation)
  52587. , s = n
  52588. , l = r;
  52589. n = (s - this.aX) * o - (l - this.aY) * a + this.aX,
  52590. r = (s - this.aX) * a + (l - this.aY) * o + this.aY
  52591. }
  52592. return new Ci.Vector2(n,r)
  52593. }
  52594. ,
  52595. Ci.ArcCurve = function(e, t, i, n, r, o) {
  52596. Ci.EllipseCurve.call(this, e, t, i, i, n, r, o)
  52597. }
  52598. ,
  52599. Ci.ArcCurve.prototype = Object.create(Ci.EllipseCurve.prototype),
  52600. Ci.ArcCurve.prototype.constructor = Ci.ArcCurve,
  52601. Ci.LineCurve3 = Ci.Curve.create(function(e, t) {
  52602. this.v1 = e,
  52603. this.v2 = t
  52604. }, function(e) {
  52605. var t = new Ci.Vector3;
  52606. return t.subVectors(this.v2, this.v1),
  52607. t.multiplyScalar(e),
  52608. t.add(this.v1),
  52609. t
  52610. }),
  52611. Ci.QuadraticBezierCurve3 = Ci.Curve.create(function(e, t, i) {
  52612. this.v0 = e,
  52613. this.v1 = t,
  52614. this.v2 = i
  52615. }, function(e) {
  52616. var t = Ci.ShapeUtils.b2;
  52617. 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))
  52618. }),
  52619. Ci.CubicBezierCurve3 = Ci.Curve.create(function(e, t, i, n) {
  52620. this.v0 = e,
  52621. this.v1 = t,
  52622. this.v2 = i,
  52623. this.v3 = n
  52624. }, function(e) {
  52625. var t = Ci.ShapeUtils.b3;
  52626. 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))
  52627. }),
  52628. Ci.SplineCurve3 = Ci.Curve.create(function(e) {
  52629. console.warn("THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3"),
  52630. this.points = null == e ? [] : e
  52631. }, function(e) {
  52632. var t = this.points
  52633. , i = (t.length - 1) * e
  52634. , n = Math.floor(i)
  52635. , r = i - n
  52636. , o = t[0 == n ? n : n - 1]
  52637. , a = t[n]
  52638. , s = t[n > t.length - 2 ? t.length - 1 : n + 1]
  52639. , l = t[n > t.length - 3 ? t.length - 1 : n + 2]
  52640. , c = Ci.CurveUtils.interpolate;
  52641. 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))
  52642. }),
  52643. Ci.CatmullRomCurve3 = (qt = new Ci.Vector3,
  52644. Xt = new xi,
  52645. Zt = new xi,
  52646. Kt = new xi,
  52647. xi.prototype.init = function(e, t, i, n) {
  52648. this.c0 = e,
  52649. this.c1 = i,
  52650. this.c2 = -3 * e + 3 * t - 2 * i - n,
  52651. this.c3 = 2 * e - 2 * t + i + n
  52652. }
  52653. ,
  52654. xi.prototype.initNonuniformCatmullRom = function(e, t, i, n, r, o, a) {
  52655. var s = (t - e) / r - (i - e) / (r + o) + (i - t) / o
  52656. , l = (i - t) / o - (n - t) / (o + a) + (n - i) / a;
  52657. s *= o,
  52658. l *= o,
  52659. this.init(t, i, s, l)
  52660. }
  52661. ,
  52662. xi.prototype.initCatmullRom = function(e, t, i, n, r) {
  52663. this.init(t, i, r * (i - e), r * (n - t))
  52664. }
  52665. ,
  52666. xi.prototype.calc = function(e) {
  52667. var t = e * e
  52668. , i = t * e;
  52669. return this.c0 + this.c1 * e + this.c2 * t + this.c3 * i
  52670. }
  52671. ,
  52672. Ci.Curve.create(function(e) {
  52673. this.points = e || [],
  52674. this.closed = !1
  52675. }, function(e) {
  52676. var t, i, n, r, o, a, s, l, c = this.points;
  52677. if ((r = c.length) < 2 && console.log("duh, you need at least 2 points"),
  52678. n = (t = (r - (this.closed ? 0 : 1)) * e) - (i = Math.floor(t)),
  52679. this.closed ? i += 0 < i ? 0 : (Math.floor(Math.abs(i) / c.length) + 1) * c.length : 0 === n && i === r - 1 && (i = r - 2,
  52680. n = 1),
  52681. o = this.closed || 0 < i ? c[(i - 1) % r] : (qt.subVectors(c[0], c[1]).add(c[0]),
  52682. qt),
  52683. a = c[i % r],
  52684. s = c[(i + 1) % r],
  52685. l = this.closed || i + 2 < r ? c[(i + 2) % r] : (qt.subVectors(c[r - 1], c[r - 2]).add(c[r - 1]),
  52686. qt),
  52687. void 0 === this.type || "centripetal" === this.type || "chordal" === this.type) {
  52688. var h = "chordal" === this.type ? .5 : .25
  52689. , u = Math.pow(o.distanceToSquared(a), h)
  52690. , d = Math.pow(a.distanceToSquared(s), h)
  52691. , p = Math.pow(s.distanceToSquared(l), h);
  52692. d < 1e-4 && (d = 1),
  52693. u < 1e-4 && (u = d),
  52694. p < 1e-4 && (p = d),
  52695. Xt.initNonuniformCatmullRom(o.x, a.x, s.x, l.x, u, d, p),
  52696. Zt.initNonuniformCatmullRom(o.y, a.y, s.y, l.y, u, d, p),
  52697. Kt.initNonuniformCatmullRom(o.z, a.z, s.z, l.z, u, d, p)
  52698. } else if ("catmullrom" === this.type) {
  52699. var f = void 0 !== this.tension ? this.tension : .5;
  52700. Xt.initCatmullRom(o.x, a.x, s.x, l.x, f),
  52701. Zt.initCatmullRom(o.y, a.y, s.y, l.y, f),
  52702. Kt.initCatmullRom(o.z, a.z, s.z, l.z, f)
  52703. }
  52704. return new Ci.Vector3(Xt.calc(n),Zt.calc(n),Kt.calc(n))
  52705. })),
  52706. Ci.ClosedSplineCurve3 = function(e) {
  52707. console.warn("THREE.ClosedSplineCurve3 has been deprecated. Please use THREE.CatmullRomCurve3."),
  52708. Ci.CatmullRomCurve3.call(this, e),
  52709. this.type = "catmullrom",
  52710. this.closed = !0
  52711. }
  52712. ,
  52713. Ci.ClosedSplineCurve3.prototype = Object.create(Ci.CatmullRomCurve3.prototype),
  52714. Ci.BoxGeometry = function(e, t, i, n, r, o) {
  52715. Ci.Geometry.call(this),
  52716. this.type = "BoxGeometry",
  52717. this.parameters = {
  52718. width: e,
  52719. height: t,
  52720. depth: i,
  52721. widthSegments: n,
  52722. heightSegments: r,
  52723. depthSegments: o
  52724. },
  52725. this.fromBufferGeometry(new Ci.BoxBufferGeometry(e,t,i,n,r,o)),
  52726. this.mergeVertices()
  52727. }
  52728. ,
  52729. Ci.BoxGeometry.prototype = Object.create(Ci.Geometry.prototype),
  52730. Ci.BoxGeometry.prototype.constructor = Ci.BoxGeometry,
  52731. Ci.CubeGeometry = Ci.BoxGeometry,
  52732. Ci.BoxBufferGeometry = function(e, t, i, n, r, o) {
  52733. function a(e, t, i, n, r, o, a, s, l, c, h) {
  52734. 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++)
  52735. for (var E = I * d - f, _ = 0; _ < m; _++) {
  52736. var b = _ * u - p;
  52737. C[e] = b * n,
  52738. C[t] = E * r,
  52739. C[i] = g,
  52740. P[D] = C.x,
  52741. P[D + 1] = C.y,
  52742. P[D + 2] = C.z,
  52743. C[e] = 0,
  52744. C[t] = 0,
  52745. C[i] = 0 < s ? 1 : -1,
  52746. O[D] = C.x,
  52747. O[D + 1] = C.y,
  52748. O[D + 2] = C.z,
  52749. L[N] = _ / l,
  52750. L[N + 1] = 1 - I / c,
  52751. D += 3,
  52752. N += 2,
  52753. y += 1
  52754. }
  52755. for (I = 0; I < c; I++)
  52756. for (_ = 0; _ < l; _++) {
  52757. var w = B + _ + m * I
  52758. , T = B + _ + m * (I + 1)
  52759. , x = B + (_ + 1) + m * (I + 1)
  52760. , S = B + (_ + 1) + m * I;
  52761. R[F] = w,
  52762. R[F + 1] = T,
  52763. R[F + 2] = S,
  52764. R[F + 3] = T,
  52765. R[F + 4] = x,
  52766. R[F + 5] = S,
  52767. F += 6,
  52768. A += 6
  52769. }
  52770. M.addGroup(V, A, h),
  52771. V += A,
  52772. B += y
  52773. }
  52774. Ci.BufferGeometry.call(this),
  52775. this.type = "BoxBufferGeometry",
  52776. this.parameters = {
  52777. width: e,
  52778. height: t,
  52779. depth: i,
  52780. widthSegments: n,
  52781. heightSegments: r,
  52782. depthSegments: o
  52783. };
  52784. var M = this;
  52785. n = Math.floor(n) || 1,
  52786. r = Math.floor(r) || 1,
  52787. o = Math.floor(o) || 1;
  52788. var s, l, c, h, u = (h = 0,
  52789. h += (s = n) * (l = r) * 2,
  52790. h += s * (c = o) * 2,
  52791. 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;
  52792. a("z", "y", "x", -1, -1, i, t, e, o, r, 0),
  52793. a("z", "y", "x", 1, -1, i, t, -e, o, r, 1),
  52794. a("x", "z", "y", 1, 1, e, i, t, n, o, 2),
  52795. a("x", "z", "y", 1, -1, e, i, -t, n, o, 3),
  52796. a("x", "y", "z", 1, -1, e, t, i, n, r, 4),
  52797. a("x", "y", "z", -1, -1, e, t, -i, n, r, 5),
  52798. this.setIndex(new Ci.BufferAttribute(R,1)),
  52799. this.addAttribute("position", new Ci.BufferAttribute(P,3)),
  52800. this.addAttribute("normal", new Ci.BufferAttribute(O,3)),
  52801. this.addAttribute("uv", new Ci.BufferAttribute(L,2))
  52802. }
  52803. ,
  52804. Ci.BoxBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  52805. Ci.BoxBufferGeometry.prototype.constructor = Ci.BoxBufferGeometry,
  52806. Ci.CircleGeometry = function(e, t, i, n) {
  52807. Ci.Geometry.call(this),
  52808. this.type = "CircleGeometry",
  52809. this.parameters = {
  52810. radius: e,
  52811. segments: t,
  52812. thetaStart: i,
  52813. thetaLength: n
  52814. },
  52815. this.fromBufferGeometry(new Ci.CircleBufferGeometry(e,t,i,n))
  52816. }
  52817. ,
  52818. Ci.CircleGeometry.prototype = Object.create(Ci.Geometry.prototype),
  52819. Ci.CircleGeometry.prototype.constructor = Ci.CircleGeometry,
  52820. Ci.CircleBufferGeometry = function(e, t, i, n) {
  52821. Ci.BufferGeometry.call(this),
  52822. this.type = "CircleBufferGeometry",
  52823. this.parameters = {
  52824. radius: e,
  52825. segments: t,
  52826. thetaStart: i,
  52827. thetaLength: n
  52828. },
  52829. e = e || 50,
  52830. t = void 0 !== t ? Math.max(3, t) : 8,
  52831. i = void 0 !== i ? i : 0,
  52832. n = void 0 !== n ? n : 2 * Math.PI;
  52833. var r = t + 2
  52834. , o = new Float32Array(3 * r)
  52835. , a = new Float32Array(3 * r)
  52836. , s = new Float32Array(2 * r);
  52837. a[2] = 1,
  52838. s[0] = .5,
  52839. s[1] = .5;
  52840. for (var l = 0, c = 3, h = 2; l <= t; l++,
  52841. c += 3,
  52842. h += 2) {
  52843. var u = i + l / t * n;
  52844. o[c] = e * Math.cos(u),
  52845. o[c + 1] = e * Math.sin(u),
  52846. a[c + 2] = 1,
  52847. s[h] = (o[c] / e + 1) / 2,
  52848. s[h + 1] = (o[c + 1] / e + 1) / 2
  52849. }
  52850. var d = [];
  52851. for (c = 1; c <= t; c++)
  52852. d.push(c, c + 1, 0);
  52853. this.setIndex(new Ci.BufferAttribute(new Uint16Array(d),1)),
  52854. this.addAttribute("position", new Ci.BufferAttribute(o,3)),
  52855. this.addAttribute("normal", new Ci.BufferAttribute(a,3)),
  52856. this.addAttribute("uv", new Ci.BufferAttribute(s,2)),
  52857. this.boundingSphere = new Ci.Sphere(new Ci.Vector3,e)
  52858. }
  52859. ,
  52860. Ci.CircleBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  52861. Ci.CircleBufferGeometry.prototype.constructor = Ci.CircleBufferGeometry,
  52862. Ci.CylinderBufferGeometry = function(p, f, g, m, v, e, y, A) {
  52863. function t(e) {
  52864. var t, i, n, r = new Ci.Vector2, o = new Ci.Vector3, a = !0 === e ? p : f, s = !0 === e ? 1 : -1;
  52865. for (i = b,
  52866. t = 1; t <= m; t++)
  52867. I.setXYZ(b, 0, x * s, 0),
  52868. E.setXYZ(b, 0, s, 0),
  52869. !0 === e ? (r.x = t / m,
  52870. r.y = 0) : (r.x = (t - 1) / m,
  52871. r.y = 1),
  52872. _.setXY(b, r.x, r.y),
  52873. b++;
  52874. for (n = b,
  52875. t = 0; t <= m; t++) {
  52876. var l = t / m;
  52877. o.x = a * Math.sin(l * A + y),
  52878. o.y = x * s,
  52879. o.z = a * Math.cos(l * A + y),
  52880. I.setXYZ(b, o.x, o.y, o.z),
  52881. E.setXYZ(b, 0, s, 0),
  52882. _.setXY(b, l, !0 === e ? 1 : 0),
  52883. b++
  52884. }
  52885. for (t = 0; t < m; t++) {
  52886. var c = i + t
  52887. , h = n + t;
  52888. !0 === e ? (C.setX(w, h),
  52889. w++,
  52890. C.setX(w, h + 1)) : (C.setX(w, h + 1),
  52891. w++,
  52892. C.setX(w, h)),
  52893. w++,
  52894. C.setX(w, c),
  52895. w++
  52896. }
  52897. }
  52898. Ci.BufferGeometry.call(this),
  52899. this.type = "CylinderBufferGeometry",
  52900. this.parameters = {
  52901. radiusTop: p,
  52902. radiusBottom: f,
  52903. height: g,
  52904. radialSegments: m,
  52905. heightSegments: v,
  52906. openEnded: e,
  52907. thetaStart: y,
  52908. thetaLength: A
  52909. },
  52910. p = void 0 !== p ? p : 20,
  52911. f = void 0 !== f ? f : 20,
  52912. g = void 0 !== g ? g : 100,
  52913. m = Math.floor(m) || 8,
  52914. v = Math.floor(v) || 1,
  52915. e = void 0 !== e && e,
  52916. y = void 0 !== y ? y : 0,
  52917. A = void 0 !== A ? A : 2 * Math.PI;
  52918. var i, n, r = (n = (m + 1) * (v + 1),
  52919. !1 === e && (n += 2 * (m + 1) + 2 * m),
  52920. n), o = (i = m * v * 2 * 3,
  52921. !1 === e && (i += 2 * m * 3),
  52922. 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;
  52923. (function() {
  52924. var e, t, i = new Ci.Vector3, n = new Ci.Vector3, r = (f - p) / g;
  52925. for (t = 0; t <= v; t++) {
  52926. var o = []
  52927. , a = t / v
  52928. , s = a * (f - p) + p;
  52929. for (e = 0; e <= m; e++) {
  52930. var l = e / m;
  52931. n.x = s * Math.sin(l * A + y),
  52932. n.y = -a * g + x,
  52933. n.z = s * Math.cos(l * A + y),
  52934. I.setXYZ(b, n.x, n.y, n.z),
  52935. i.copy(n),
  52936. (0 === p && 0 === t || 0 === f && t === v) && (i.x = Math.sin(l * A + y),
  52937. i.z = Math.cos(l * A + y)),
  52938. i.setY(Math.sqrt(i.x * i.x + i.z * i.z) * r).normalize(),
  52939. E.setXYZ(b, i.x, i.y, i.z),
  52940. _.setXY(b, l, 1 - a),
  52941. o.push(b),
  52942. b++
  52943. }
  52944. T.push(o)
  52945. }
  52946. for (e = 0; e < m; e++)
  52947. for (t = 0; t < v; t++) {
  52948. var c = T[t][e]
  52949. , h = T[t + 1][e]
  52950. , u = T[t + 1][e + 1]
  52951. , d = T[t][e + 1];
  52952. C.setX(w, c),
  52953. w++,
  52954. C.setX(w, h),
  52955. w++,
  52956. C.setX(w, d),
  52957. w++,
  52958. C.setX(w, h),
  52959. w++,
  52960. C.setX(w, u),
  52961. w++,
  52962. C.setX(w, d),
  52963. w++
  52964. }
  52965. }
  52966. )(),
  52967. !1 === e && (0 < p && t(!0),
  52968. 0 < f && t(!1)),
  52969. this.setIndex(C),
  52970. this.addAttribute("position", I),
  52971. this.addAttribute("normal", E),
  52972. this.addAttribute("uv", _)
  52973. }
  52974. ,
  52975. Ci.CylinderBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  52976. Ci.CylinderBufferGeometry.prototype.constructor = Ci.CylinderBufferGeometry,
  52977. Ci.CylinderGeometry = function(e, t, i, n, r, o, a, s) {
  52978. Ci.Geometry.call(this),
  52979. this.type = "CylinderGeometry",
  52980. this.parameters = {
  52981. radiusTop: e,
  52982. radiusBottom: t,
  52983. height: i,
  52984. radialSegments: n,
  52985. heightSegments: r,
  52986. openEnded: o,
  52987. thetaStart: a,
  52988. thetaLength: s
  52989. },
  52990. this.fromBufferGeometry(new Ci.CylinderBufferGeometry(e,t,i,n,r,o,a,s)),
  52991. this.mergeVertices()
  52992. }
  52993. ,
  52994. Ci.CylinderGeometry.prototype = Object.create(Ci.Geometry.prototype),
  52995. Ci.CylinderGeometry.prototype.constructor = Ci.CylinderGeometry,
  52996. Ci.EdgesGeometry = function(e, t) {
  52997. function i(e, t) {
  52998. return e - t
  52999. }
  53000. Ci.BufferGeometry.call(this),
  53001. t = void 0 !== t ? t : 1;
  53002. var n, r = Math.cos(Ci.Math.degToRad(t)), o = [0, 0], a = {}, s = ["a", "b", "c"];
  53003. e instanceof Ci.BufferGeometry ? (n = new Ci.Geometry).fromBufferGeometry(e) : n = e.clone(),
  53004. n.mergeVertices(),
  53005. n.computeFaceNormals();
  53006. for (var l = n.vertices, c = n.faces, h = 0, u = c.length; h < u; h++)
  53007. for (var d = c[h], p = 0; p < 3; p++) {
  53008. o[0] = d[s[p]],
  53009. o[1] = d[s[(p + 1) % 3]],
  53010. o.sort(i),
  53011. void 0 === a[g = o.toString()] ? a[g] = {
  53012. vert1: o[0],
  53013. vert2: o[1],
  53014. face1: h,
  53015. face2: void 0
  53016. } : a[g].face2 = h
  53017. }
  53018. var f = [];
  53019. for (var g in a) {
  53020. var m = a[g];
  53021. if (void 0 === m.face2 || c[m.face1].normal.dot(c[m.face2].normal) <= r) {
  53022. var v = l[m.vert1];
  53023. f.push(v.x),
  53024. f.push(v.y),
  53025. f.push(v.z),
  53026. v = l[m.vert2],
  53027. f.push(v.x),
  53028. f.push(v.y),
  53029. f.push(v.z)
  53030. }
  53031. }
  53032. this.addAttribute("position", new Ci.BufferAttribute(new Float32Array(f),3))
  53033. }
  53034. ,
  53035. Ci.EdgesGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53036. Ci.EdgesGeometry.prototype.constructor = Ci.EdgesGeometry,
  53037. Ci.ExtrudeGeometry = function(e, t) {
  53038. return void 0 === e ? void (e = []) : (Ci.Geometry.call(this),
  53039. this.type = "ExtrudeGeometry",
  53040. e = Array.isArray(e) ? e : [e],
  53041. this.addShapeList(e, t),
  53042. void this.computeFaceNormals())
  53043. }
  53044. ;
  53045. Ci.ExtrudeGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53046. Ci.ExtrudeGeometry.prototype.constructor = Ci.ExtrudeGeometry,
  53047. Ci.ExtrudeGeometry.prototype.addShapeList = function(e, t) {
  53048. for (var i = e.length, n = 0; n < i; n++) {
  53049. var r = e[n];
  53050. this.addShape(r, t)
  53051. }
  53052. }
  53053. ,
  53054. Ci.ExtrudeGeometry.prototype.addShape = function(e, t) {
  53055. function i(e, t, i) {
  53056. return t || console.error("THREE.ExtrudeGeometry: vec does not exist"),
  53057. t.clone().multiplyScalar(i).add(e)
  53058. }
  53059. function n(e, t, i) {
  53060. 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;
  53061. if (Math.abs(u) > Number.EPSILON) {
  53062. var d = Math.sqrt(h)
  53063. , p = Math.sqrt(l * l + c * c)
  53064. , f = t.x - s / d
  53065. , g = t.y + a / d
  53066. , m = ((i.x - c / p - f) * c - (i.y + l / p - g) * l) / (a * c - s * l)
  53067. , v = (n = f + a * m - e.x) * n + (r = g + s * m - e.y) * r;
  53068. if (v <= 2)
  53069. return new Ci.Vector2(n,r);
  53070. o = Math.sqrt(v / 2)
  53071. } else {
  53072. var y = !1;
  53073. a > Number.EPSILON ? l > Number.EPSILON && (y = !0) : a < -Number.EPSILON ? l < -Number.EPSILON && (y = !0) : Math.sign(s) === Math.sign(c) && (y = !0),
  53074. o = y ? (n = -s,
  53075. r = a,
  53076. Math.sqrt(h)) : (n = a,
  53077. r = s,
  53078. Math.sqrt(h / 2))
  53079. }
  53080. return new Ci.Vector2(n / o,r / o)
  53081. }
  53082. function r(e, t) {
  53083. var i, n;
  53084. for (G = e.length; 0 <= --G; ) {
  53085. (n = (i = G) - 1) < 0 && (n = e.length - 1);
  53086. var r = 0
  53087. , o = A + 2 * m;
  53088. for (r = 0; r < o; r++) {
  53089. var a = U * r
  53090. , s = U * (r + 1);
  53091. l(t + i + a, t + n + a, t + n + s, t + i + s, e, r, o, i, n)
  53092. }
  53093. }
  53094. }
  53095. function o(e, t, i) {
  53096. T.vertices.push(new Ci.Vector3(e,t,i))
  53097. }
  53098. function a(e, t, i) {
  53099. e += x,
  53100. t += x,
  53101. i += x,
  53102. T.faces.push(new Ci.Face3(e,t,i,null,null,0));
  53103. var n = E.generateTopUV(T, e, t, i);
  53104. T.faceVertexUvs[0].push(n)
  53105. }
  53106. function l(e, t, i, n) {
  53107. e += x,
  53108. t += x,
  53109. i += x,
  53110. n += x,
  53111. T.faces.push(new Ci.Face3(e,t,n,null,null,1)),
  53112. T.faces.push(new Ci.Face3(t,i,n,null,null,1));
  53113. var r = E.generateSideWallUV(T, e, t, i, n);
  53114. T.faceVertexUvs[0].push([r[0], r[1], r[3]]),
  53115. T.faceVertexUvs[0].push([r[1], r[2], r[3]])
  53116. }
  53117. 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;
  53118. C && (s = C.getSpacedPoints(A),
  53119. v = !(I = !0),
  53120. c = void 0 !== t.frames ? t.frames : new Ci.TubeGeometry.FrenetFrames(C,A,!1),
  53121. h = new Ci.Vector3,
  53122. u = new Ci.Vector3,
  53123. d = new Ci.Vector3),
  53124. v || (g = f = m = 0);
  53125. var _, b, w, T = this, x = this.vertices.length, S = e.extractPoints(y), M = S.shape, R = S.holes, P = !Ci.ShapeUtils.isClockWise(M);
  53126. if (P) {
  53127. for (M = M.reverse(),
  53128. b = 0,
  53129. w = R.length; b < w; b++)
  53130. _ = R[b],
  53131. Ci.ShapeUtils.isClockWise(_) && (R[b] = _.reverse());
  53132. P = !1
  53133. }
  53134. var O = Ci.ShapeUtils.triangulateShape(M, R)
  53135. , L = M;
  53136. for (b = 0,
  53137. w = R.length; b < w; b++)
  53138. _ = R[b],
  53139. M = M.concat(_);
  53140. 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++,
  53141. j++,
  53142. Y++)
  53143. j === W && (j = 0),
  53144. Y === W && (Y = 0),
  53145. z[G] = n(L[G], L[j], L[Y]);
  53146. var q, X, Z = [], K = z.concat();
  53147. for (b = 0,
  53148. w = R.length; b < w; b++) {
  53149. for (_ = R[b],
  53150. q = [],
  53151. G = 0,
  53152. j = (W = _.length) - 1,
  53153. Y = G + 1; G < W; G++,
  53154. j++,
  53155. Y++)
  53156. j === W && (j = 0),
  53157. Y === W && (Y = 0),
  53158. q[G] = n(_[G], _[j], _[Y]);
  53159. Z.push(q),
  53160. K = K.concat(q)
  53161. }
  53162. for (D = 0; D < m; D++) {
  53163. for (B = f * (1 - (F = D / m)),
  53164. N = g * Math.sin(F * Math.PI / 2),
  53165. G = 0,
  53166. W = L.length; G < W; G++)
  53167. o((V = i(L[G], z[G], N)).x, V.y, -B);
  53168. for (b = 0,
  53169. w = R.length; b < w; b++)
  53170. for (_ = R[b],
  53171. q = Z[b],
  53172. G = 0,
  53173. W = _.length; G < W; G++)
  53174. o((V = i(_[G], q[G], N)).x, V.y, -B)
  53175. }
  53176. for (N = g,
  53177. G = 0; G < U; G++)
  53178. V = v ? i(M[G], K[G], N) : M[G],
  53179. I ? (u.copy(c.normals[0]).multiplyScalar(V.x),
  53180. h.copy(c.binormals[0]).multiplyScalar(V.y),
  53181. d.copy(s[0]).add(u).add(h),
  53182. o(d.x, d.y, d.z)) : o(V.x, V.y, 0);
  53183. for (X = 1; X <= A; X++)
  53184. for (G = 0; G < U; G++)
  53185. V = v ? i(M[G], K[G], N) : M[G],
  53186. I ? (u.copy(c.normals[X]).multiplyScalar(V.x),
  53187. h.copy(c.binormals[X]).multiplyScalar(V.y),
  53188. d.copy(s[X]).add(u).add(h),
  53189. o(d.x, d.y, d.z)) : o(V.x, V.y, p / A * X);
  53190. for (D = m - 1; 0 <= D; D--) {
  53191. for (B = f * (1 - (F = D / m)),
  53192. N = g * Math.sin(F * Math.PI / 2),
  53193. G = 0,
  53194. W = L.length; G < W; G++)
  53195. o((V = i(L[G], z[G], N)).x, V.y, p + B);
  53196. for (b = 0,
  53197. w = R.length; b < w; b++)
  53198. for (_ = R[b],
  53199. q = Z[b],
  53200. G = 0,
  53201. W = _.length; G < W; G++)
  53202. V = i(_[G], q[G], N),
  53203. I ? o(V.x, V.y + s[A - 1].y, s[A - 1].x + B) : o(V.x, V.y, p + B)
  53204. }
  53205. (function() {
  53206. if (v) {
  53207. var e = 0
  53208. , t = U * e;
  53209. for (G = 0; G < H; G++)
  53210. a((k = O[G])[2] + t, k[1] + t, k[0] + t);
  53211. for (t = U * (e = A + 2 * m),
  53212. G = 0; G < H; G++)
  53213. a((k = O[G])[0] + t, k[1] + t, k[2] + t)
  53214. } else {
  53215. for (G = 0; G < H; G++)
  53216. a((k = O[G])[2], k[1], k[0]);
  53217. for (G = 0; G < H; G++)
  53218. a((k = O[G])[0] + U * A, k[1] + U * A, k[2] + U * A)
  53219. }
  53220. }
  53221. )(),
  53222. function() {
  53223. var e = 0;
  53224. for (r(L, e),
  53225. e += L.length,
  53226. b = 0,
  53227. w = R.length; b < w; b++)
  53228. r(_ = R[b], e),
  53229. e += _.length
  53230. }()
  53231. }
  53232. ,
  53233. Ci.ExtrudeGeometry.WorldUVGenerator = {
  53234. generateTopUV: function(e, t, i, n) {
  53235. var r = e.vertices
  53236. , o = r[t]
  53237. , a = r[i]
  53238. , s = r[n];
  53239. return [new Ci.Vector2(o.x,o.y), new Ci.Vector2(a.x,a.y), new Ci.Vector2(s.x,s.y)]
  53240. },
  53241. generateSideWallUV: function(e, t, i, n, r) {
  53242. var o = e.vertices
  53243. , a = o[t]
  53244. , s = o[i]
  53245. , l = o[n]
  53246. , c = o[r];
  53247. 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)]
  53248. }
  53249. },
  53250. Ci.ShapeGeometry = function(e, t) {
  53251. Ci.Geometry.call(this),
  53252. !(this.type = "ShapeGeometry") === Array.isArray(e) && (e = [e]),
  53253. this.addShapeList(e, t),
  53254. this.computeFaceNormals()
  53255. }
  53256. ,
  53257. Ci.ShapeGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53258. Ci.ShapeGeometry.prototype.constructor = Ci.ShapeGeometry,
  53259. Ci.ShapeGeometry.prototype.addShapeList = function(e, t) {
  53260. for (var i = 0, n = e.length; i < n; i++)
  53261. this.addShape(e[i], t);
  53262. return this
  53263. }
  53264. ,
  53265. Ci.ShapeGeometry.prototype.addShape = function(e, t) {
  53266. void 0 === t && (t = {});
  53267. 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);
  53268. if (d) {
  53269. for (h = h.reverse(),
  53270. i = 0,
  53271. n = u.length; i < n; i++)
  53272. r = u[i],
  53273. Ci.ShapeUtils.isClockWise(r) && (u[i] = r.reverse());
  53274. d = !1
  53275. }
  53276. var p = Ci.ShapeUtils.triangulateShape(h, u);
  53277. for (i = 0,
  53278. n = u.length; i < n; i++)
  53279. r = u[i],
  53280. h = h.concat(r);
  53281. var f, g, m = h.length, v = p.length;
  53282. for (i = 0; i < m; i++)
  53283. f = h[i],
  53284. this.vertices.push(new Ci.Vector3(f.x,f.y,0));
  53285. for (i = 0; i < v; i++) {
  53286. var y = (g = p[i])[0] + l
  53287. , A = g[1] + l
  53288. , C = g[2] + l;
  53289. this.faces.push(new Ci.Face3(y,A,C,null,null,a)),
  53290. this.faceVertexUvs[0].push(s.generateTopUV(this, y, A, C))
  53291. }
  53292. }
  53293. ,
  53294. Ci.LatheBufferGeometry = function(e, t, i, n) {
  53295. Ci.BufferGeometry.call(this),
  53296. this.type = "LatheBufferGeometry",
  53297. this.parameters = {
  53298. points: e,
  53299. segments: t,
  53300. phiStart: i,
  53301. phiLength: n
  53302. },
  53303. t = Math.floor(t) || 12,
  53304. i = i || 0,
  53305. n = n || 2 * Math.PI,
  53306. n = Ci.Math.clamp(n, 0, 2 * Math.PI);
  53307. 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,
  53308. 1 / t), g = new Ci.Vector3, m = new Ci.Vector2;
  53309. for (o = 0; o <= t; o++) {
  53310. var v = i + o * f * n
  53311. , y = Math.sin(v)
  53312. , A = Math.cos(v);
  53313. for (a = 0; a <= e.length - 1; a++)
  53314. g.x = e[a].x * y,
  53315. g.y = e[a].y,
  53316. g.z = e[a].x * A,
  53317. h.setXYZ(d, g.x, g.y, g.z),
  53318. m.x = o / t,
  53319. m.y = a / (e.length - 1),
  53320. u.setXY(d, m.x, m.y),
  53321. d++
  53322. }
  53323. for (o = 0; o < t; o++)
  53324. for (a = 0; a < e.length - 1; a++) {
  53325. var C = r = a + o * e.length
  53326. , I = r + e.length
  53327. , E = r + e.length + 1
  53328. , _ = r + 1;
  53329. c.setX(p, C),
  53330. p++,
  53331. c.setX(p, I),
  53332. p++,
  53333. c.setX(p, _),
  53334. p++,
  53335. c.setX(p, I),
  53336. p++,
  53337. c.setX(p, E),
  53338. p++,
  53339. c.setX(p, _),
  53340. p++
  53341. }
  53342. if (this.setIndex(c),
  53343. this.addAttribute("position", h),
  53344. this.addAttribute("uv", u),
  53345. this.computeVertexNormals(),
  53346. n === 2 * Math.PI) {
  53347. var b = this.attributes.normal.array
  53348. , w = new Ci.Vector3
  53349. , T = new Ci.Vector3
  53350. , x = new Ci.Vector3;
  53351. for (r = t * e.length * 3,
  53352. a = o = 0; o < e.length; o++,
  53353. a += 3)
  53354. w.x = b[a + 0],
  53355. w.y = b[a + 1],
  53356. w.z = b[a + 2],
  53357. T.x = b[r + a + 0],
  53358. T.y = b[r + a + 1],
  53359. T.z = b[r + a + 2],
  53360. x.addVectors(w, T).normalize(),
  53361. b[a + 0] = b[r + a + 0] = x.x,
  53362. b[a + 1] = b[r + a + 1] = x.y,
  53363. b[a + 2] = b[r + a + 2] = x.z
  53364. }
  53365. }
  53366. ,
  53367. Ci.LatheBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53368. Ci.LatheBufferGeometry.prototype.constructor = Ci.LatheBufferGeometry,
  53369. Ci.LatheGeometry = function(e, t, i, n) {
  53370. Ci.Geometry.call(this),
  53371. this.type = "LatheGeometry",
  53372. this.parameters = {
  53373. points: e,
  53374. segments: t,
  53375. phiStart: i,
  53376. phiLength: n
  53377. },
  53378. this.fromBufferGeometry(new Ci.LatheBufferGeometry(e,t,i,n)),
  53379. this.mergeVertices()
  53380. }
  53381. ,
  53382. Ci.LatheGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53383. Ci.LatheGeometry.prototype.constructor = Ci.LatheGeometry,
  53384. Ci.PlaneGeometry = function(e, t, i, n) {
  53385. Ci.Geometry.call(this),
  53386. this.type = "PlaneGeometry",
  53387. this.parameters = {
  53388. width: e,
  53389. height: t,
  53390. widthSegments: i,
  53391. heightSegments: n
  53392. },
  53393. this.fromBufferGeometry(new Ci.PlaneBufferGeometry(e,t,i,n))
  53394. }
  53395. ,
  53396. Ci.PlaneGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53397. Ci.PlaneGeometry.prototype.constructor = Ci.PlaneGeometry,
  53398. Ci.PlaneBufferGeometry = function(e, t, i, n) {
  53399. Ci.BufferGeometry.call(this),
  53400. this.type = "PlaneBufferGeometry",
  53401. this.parameters = {
  53402. width: e,
  53403. height: t,
  53404. widthSegments: i,
  53405. heightSegments: n
  53406. };
  53407. 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++)
  53408. for (var y = v * u - o, A = 0; A < l; A++) {
  53409. var C = A * h - r;
  53410. d[g] = C,
  53411. d[g + 1] = -y,
  53412. p[g + 2] = 1,
  53413. f[m] = A / a,
  53414. f[m + 1] = 1 - v / s,
  53415. g += 3,
  53416. m += 2
  53417. }
  53418. g = 0;
  53419. var I = new (65535 < d.length / 3 ? Uint32Array : Uint16Array)(a * s * 6);
  53420. for (v = 0; v < s; v++)
  53421. for (A = 0; A < a; A++) {
  53422. var E = A + l * v
  53423. , _ = A + l * (v + 1)
  53424. , b = A + 1 + l * (v + 1)
  53425. , w = A + 1 + l * v;
  53426. I[g] = E,
  53427. I[g + 1] = _,
  53428. I[g + 2] = w,
  53429. I[g + 3] = _,
  53430. I[g + 4] = b,
  53431. I[g + 5] = w,
  53432. g += 6
  53433. }
  53434. this.setIndex(new Ci.BufferAttribute(I,1)),
  53435. this.addAttribute("position", new Ci.BufferAttribute(d,3)),
  53436. this.addAttribute("normal", new Ci.BufferAttribute(p,3)),
  53437. this.addAttribute("uv", new Ci.BufferAttribute(f,2))
  53438. }
  53439. ,
  53440. Ci.PlaneBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53441. Ci.PlaneBufferGeometry.prototype.constructor = Ci.PlaneBufferGeometry,
  53442. Ci.RingBufferGeometry = function(e, t, i, n, r, o) {
  53443. Ci.BufferGeometry.call(this),
  53444. this.type = "RingBufferGeometry",
  53445. this.parameters = {
  53446. innerRadius: e,
  53447. outerRadius: t,
  53448. thetaSegments: i,
  53449. phiSegments: n,
  53450. thetaStart: r,
  53451. thetaLength: o
  53452. },
  53453. e = e || 20,
  53454. t = t || 50,
  53455. r = void 0 !== r ? r : 0,
  53456. o = void 0 !== o ? o : 2 * Math.PI;
  53457. 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;
  53458. for (s = 0; s <= n; s++) {
  53459. for (l = 0; l <= i; l++)
  53460. a = r + l / i * o,
  53461. A.x = v * Math.cos(a),
  53462. A.y = v * Math.sin(a),
  53463. d.setXYZ(g, A.x, A.y, A.z),
  53464. p.setXYZ(g, 0, 0, 1),
  53465. C.x = (A.x / t + 1) / 2,
  53466. C.y = (A.y / t + 1) / 2,
  53467. f.setXY(g, C.x, C.y),
  53468. g++;
  53469. v += y
  53470. }
  53471. for (s = 0; s < n; s++) {
  53472. var I = s * (i + 1);
  53473. for (l = 0; l < i; l++) {
  53474. var E = a = l + I
  53475. , _ = a + i + 1
  53476. , b = a + i + 2
  53477. , w = a + 1;
  53478. u.setX(m, E),
  53479. m++,
  53480. u.setX(m, _),
  53481. m++,
  53482. u.setX(m, b),
  53483. m++,
  53484. u.setX(m, E),
  53485. m++,
  53486. u.setX(m, b),
  53487. m++,
  53488. u.setX(m, w),
  53489. m++
  53490. }
  53491. }
  53492. this.setIndex(u),
  53493. this.addAttribute("position", d),
  53494. this.addAttribute("normal", p),
  53495. this.addAttribute("uv", f)
  53496. }
  53497. ,
  53498. Ci.RingBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53499. Ci.RingBufferGeometry.prototype.constructor = Ci.RingBufferGeometry,
  53500. Ci.RingGeometry = function(e, t, i, n, r, o) {
  53501. Ci.Geometry.call(this),
  53502. this.type = "RingGeometry",
  53503. this.parameters = {
  53504. innerRadius: e,
  53505. outerRadius: t,
  53506. thetaSegments: i,
  53507. phiSegments: n,
  53508. thetaStart: r,
  53509. thetaLength: o
  53510. },
  53511. this.fromBufferGeometry(new Ci.RingBufferGeometry(e,t,i,n,r,o))
  53512. }
  53513. ,
  53514. Ci.RingGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53515. Ci.RingGeometry.prototype.constructor = Ci.RingGeometry,
  53516. Ci.SphereGeometry = function(e, t, i, n, r, o, a) {
  53517. Ci.Geometry.call(this),
  53518. this.type = "SphereGeometry",
  53519. this.parameters = {
  53520. radius: e,
  53521. widthSegments: t,
  53522. heightSegments: i,
  53523. phiStart: n,
  53524. phiLength: r,
  53525. thetaStart: o,
  53526. thetaLength: a
  53527. },
  53528. this.fromBufferGeometry(new Ci.SphereBufferGeometry(e,t,i,n,r,o,a))
  53529. }
  53530. ,
  53531. Ci.SphereGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53532. Ci.SphereGeometry.prototype.constructor = Ci.SphereGeometry,
  53533. Ci.SphereBufferGeometry = function(e, t, i, n, r, o, a) {
  53534. Ci.BufferGeometry.call(this),
  53535. this.type = "SphereBufferGeometry",
  53536. this.parameters = {
  53537. radius: e,
  53538. widthSegments: t,
  53539. heightSegments: i,
  53540. phiStart: n,
  53541. phiLength: r,
  53542. thetaStart: o,
  53543. thetaLength: a
  53544. },
  53545. e = e || 50,
  53546. t = Math.max(3, Math.floor(t) || 8),
  53547. i = Math.max(2, Math.floor(i) || 6),
  53548. n = void 0 !== n ? n : 0,
  53549. r = void 0 !== r ? r : 2 * Math.PI;
  53550. 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++) {
  53551. for (var m = [], v = g / i, y = 0; y <= t; y++) {
  53552. var A = y / t
  53553. , C = -e * Math.cos(n + A * r) * Math.sin(o + v * a)
  53554. , I = e * Math.cos(o + v * a)
  53555. , E = e * Math.sin(n + A * r) * Math.sin(o + v * a);
  53556. f.set(C, I, E).normalize(),
  53557. c.setXYZ(d, C, I, E),
  53558. h.setXYZ(d, f.x, f.y, f.z),
  53559. u.setXY(d, A, 1 - v),
  53560. m.push(d),
  53561. d++
  53562. }
  53563. p.push(m)
  53564. }
  53565. var _ = [];
  53566. for (g = 0; g < i; g++)
  53567. for (y = 0; y < t; y++) {
  53568. var b = p[g][y + 1]
  53569. , w = p[g][y]
  53570. , T = p[g + 1][y]
  53571. , x = p[g + 1][y + 1];
  53572. (0 !== g || 0 < o) && _.push(b, w, x),
  53573. (g !== i - 1 || s < Math.PI) && _.push(w, T, x)
  53574. }
  53575. this.setIndex(new (65535 < c.count ? Ci.Uint32Attribute : Ci.Uint16Attribute)(_,1)),
  53576. this.addAttribute("position", c),
  53577. this.addAttribute("normal", h),
  53578. this.addAttribute("uv", u),
  53579. this.boundingSphere = new Ci.Sphere(new Ci.Vector3,e)
  53580. }
  53581. ,
  53582. Ci.SphereBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53583. Ci.SphereBufferGeometry.prototype.constructor = Ci.SphereBufferGeometry,
  53584. Ci.TextGeometry = function(e, t) {
  53585. var i = (t = t || {}).font;
  53586. if (i instanceof Ci.Font == 0)
  53587. return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),
  53588. new Ci.Geometry;
  53589. var n = i.generateShapes(e, t.size, t.curveSegments);
  53590. t.amount = void 0 !== t.height ? t.height : 50,
  53591. void 0 === t.bevelThickness && (t.bevelThickness = 10),
  53592. void 0 === t.bevelSize && (t.bevelSize = 8),
  53593. void 0 === t.bevelEnabled && (t.bevelEnabled = !1),
  53594. Ci.ExtrudeGeometry.call(this, n, t),
  53595. this.type = "TextGeometry"
  53596. }
  53597. ,
  53598. Ci.TextGeometry.prototype = Object.create(Ci.ExtrudeGeometry.prototype),
  53599. Ci.TextGeometry.prototype.constructor = Ci.TextGeometry,
  53600. Ci.TorusBufferGeometry = function(e, t, i, n, r) {
  53601. Ci.BufferGeometry.call(this),
  53602. this.type = "TorusBufferGeometry",
  53603. this.parameters = {
  53604. radius: e,
  53605. tube: t,
  53606. radialSegments: i,
  53607. tubularSegments: n,
  53608. arc: r
  53609. },
  53610. e = e || 100,
  53611. t = t || 40,
  53612. i = Math.floor(i) || 8,
  53613. n = Math.floor(n) || 6,
  53614. r = r || 2 * Math.PI;
  53615. 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;
  53616. for (o = 0; o <= i; o++)
  53617. for (a = 0; a <= n; a++) {
  53618. var A = a / n * r
  53619. , C = o / i * Math.PI * 2;
  53620. v.x = (e + t * Math.cos(C)) * Math.cos(A),
  53621. v.y = (e + t * Math.cos(C)) * Math.sin(A),
  53622. v.z = t * Math.sin(C),
  53623. h[p] = v.x,
  53624. h[p + 1] = v.y,
  53625. h[p + 2] = v.z,
  53626. m.x = e * Math.cos(A),
  53627. m.y = e * Math.sin(A),
  53628. y.subVectors(v, m).normalize(),
  53629. u[p] = y.x,
  53630. u[p + 1] = y.y,
  53631. u[p + 2] = y.z,
  53632. d[f] = a / n,
  53633. d[f + 1] = o / i,
  53634. p += 3,
  53635. f += 2
  53636. }
  53637. for (o = 1; o <= i; o++)
  53638. for (a = 1; a <= n; a++) {
  53639. var I = (n + 1) * o + a - 1
  53640. , E = (n + 1) * (o - 1) + a - 1
  53641. , _ = (n + 1) * (o - 1) + a
  53642. , b = (n + 1) * o + a;
  53643. c[g] = I,
  53644. c[g + 1] = E,
  53645. c[g + 2] = b,
  53646. c[g + 3] = E,
  53647. c[g + 4] = _,
  53648. c[g + 5] = b,
  53649. g += 6
  53650. }
  53651. this.setIndex(new Ci.BufferAttribute(c,1)),
  53652. this.addAttribute("position", new Ci.BufferAttribute(h,3)),
  53653. this.addAttribute("normal", new Ci.BufferAttribute(u,3)),
  53654. this.addAttribute("uv", new Ci.BufferAttribute(d,2))
  53655. }
  53656. ,
  53657. Ci.TorusBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53658. Ci.TorusBufferGeometry.prototype.constructor = Ci.TorusBufferGeometry,
  53659. Ci.TorusGeometry = function(e, t, i, n, r) {
  53660. Ci.Geometry.call(this),
  53661. this.type = "TorusGeometry",
  53662. this.parameters = {
  53663. radius: e,
  53664. tube: t,
  53665. radialSegments: i,
  53666. tubularSegments: n,
  53667. arc: r
  53668. },
  53669. this.fromBufferGeometry(new Ci.TorusBufferGeometry(e,t,i,n,r))
  53670. }
  53671. ,
  53672. Ci.TorusGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53673. Ci.TorusGeometry.prototype.constructor = Ci.TorusGeometry,
  53674. Ci.TorusKnotBufferGeometry = function(e, t, i, n, r, o) {
  53675. function a(e, t, i, n, r) {
  53676. var o = Math.cos(e)
  53677. , a = Math.sin(e)
  53678. , s = i / t * e
  53679. , l = Math.cos(s);
  53680. r.x = n * (2 + l) * .5 * o,
  53681. r.y = n * (2 + l) * a * .5,
  53682. r.z = n * Math.sin(s) * .5
  53683. }
  53684. Ci.BufferGeometry.call(this),
  53685. this.type = "TorusKnotBufferGeometry",
  53686. this.parameters = {
  53687. radius: e,
  53688. tube: t,
  53689. tubularSegments: i,
  53690. radialSegments: n,
  53691. p: r,
  53692. q: o
  53693. },
  53694. e = e || 100,
  53695. t = t || 40,
  53696. i = Math.floor(i) || 64,
  53697. r = r || 2,
  53698. o = o || 3;
  53699. 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;
  53700. for (s = 0; s <= i; ++s) {
  53701. var w = s / i * r * Math.PI * 2;
  53702. for (a(w, r, o, e, C),
  53703. a(.01 + w, r, o, e, I),
  53704. _.subVectors(I, C),
  53705. b.addVectors(I, C),
  53706. E.crossVectors(_, b),
  53707. b.crossVectors(E, _),
  53708. E.normalize(),
  53709. b.normalize(),
  53710. l = 0; l <= n; ++l) {
  53711. var T = l / n * Math.PI * 2
  53712. , x = -t * Math.cos(T)
  53713. , S = t * Math.sin(T);
  53714. v.x = C.x + (x * b.x + S * E.x),
  53715. v.y = C.y + (x * b.y + S * E.y),
  53716. v.z = C.z + (x * b.z + S * E.z),
  53717. d.setXYZ(g, v.x, v.y, v.z),
  53718. y.subVectors(v, C).normalize(),
  53719. p.setXYZ(g, y.x, y.y, y.z),
  53720. A.x = s / i,
  53721. A.y = l / n,
  53722. f.setXY(g, A.x, A.y),
  53723. g++
  53724. }
  53725. }
  53726. for (l = 1; l <= i; l++)
  53727. for (s = 1; s <= n; s++) {
  53728. var M = (n + 1) * (l - 1) + (s - 1)
  53729. , R = (n + 1) * l + (s - 1)
  53730. , P = (n + 1) * l + s
  53731. , O = (n + 1) * (l - 1) + s;
  53732. u.setX(m, M),
  53733. m++,
  53734. u.setX(m, R),
  53735. m++,
  53736. u.setX(m, O),
  53737. m++,
  53738. u.setX(m, R),
  53739. m++,
  53740. u.setX(m, P),
  53741. m++,
  53742. u.setX(m, O),
  53743. m++
  53744. }
  53745. this.setIndex(u),
  53746. this.addAttribute("position", d),
  53747. this.addAttribute("normal", p),
  53748. this.addAttribute("uv", f)
  53749. }
  53750. ,
  53751. Ci.TorusKnotBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53752. Ci.TorusKnotBufferGeometry.prototype.constructor = Ci.TorusKnotBufferGeometry,
  53753. Ci.TorusKnotGeometry = function(e, t, i, n, r, o, a) {
  53754. Ci.Geometry.call(this),
  53755. this.type = "TorusKnotGeometry",
  53756. this.parameters = {
  53757. radius: e,
  53758. tube: t,
  53759. tubularSegments: i,
  53760. radialSegments: n,
  53761. p: r,
  53762. q: o
  53763. },
  53764. void 0 !== a && console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),
  53765. this.fromBufferGeometry(new Ci.TorusKnotBufferGeometry(e,t,i,n,r,o)),
  53766. this.mergeVertices()
  53767. }
  53768. ,
  53769. Ci.TorusKnotGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53770. Ci.TorusKnotGeometry.prototype.constructor = Ci.TorusKnotGeometry,
  53771. Ci.TubeGeometry = function(e, t, i, n, r, o) {
  53772. Ci.Geometry.call(this),
  53773. this.type = "TubeGeometry",
  53774. this.parameters = {
  53775. path: e,
  53776. segments: t,
  53777. radius: i,
  53778. radialSegments: n,
  53779. closed: r,
  53780. taper: o
  53781. },
  53782. t = t || 64,
  53783. i = i || 1,
  53784. n = n || 8,
  53785. r = r || !1,
  53786. o = o || Ci.TubeGeometry.NoTaper;
  53787. 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;
  53788. for (this.tangents = D,
  53789. this.normals = N,
  53790. this.binormals = F,
  53791. f = 0; f < P; f++)
  53792. for (M[f] = [],
  53793. l = f / (P - 1),
  53794. p = e.getPointAt(l),
  53795. D[f],
  53796. a = N[f],
  53797. s = F[f],
  53798. h = i * o(l),
  53799. g = 0; g < n; g++)
  53800. c = g / n * 2 * Math.PI,
  53801. u = -h * Math.cos(c),
  53802. d = h * Math.sin(c),
  53803. O.copy(p),
  53804. O.x += u * a.x + d * s.x,
  53805. O.y += u * a.y + d * s.y,
  53806. O.z += u * a.z + d * s.z,
  53807. M[f][g] = (T = O.x,
  53808. x = O.y,
  53809. S = O.z,
  53810. R.vertices.push(new Ci.Vector3(T,x,S)) - 1);
  53811. for (f = 0; f < t; f++)
  53812. for (g = 0; g < n; g++)
  53813. m = r ? (f + 1) % t : f + 1,
  53814. v = (g + 1) % n,
  53815. y = M[f][g],
  53816. A = M[m][g],
  53817. C = M[m][v],
  53818. I = M[f][v],
  53819. E = new Ci.Vector2(f / t,g / n),
  53820. _ = new Ci.Vector2((f + 1) / t,g / n),
  53821. b = new Ci.Vector2((f + 1) / t,(g + 1) / n),
  53822. w = new Ci.Vector2(f / t,(g + 1) / n),
  53823. this.faces.push(new Ci.Face3(y,A,I)),
  53824. this.faceVertexUvs[0].push([E, _, w]),
  53825. this.faces.push(new Ci.Face3(A,C,I)),
  53826. this.faceVertexUvs[0].push([_.clone(), b, w.clone()]);
  53827. this.computeFaceNormals(),
  53828. this.computeVertexNormals()
  53829. }
  53830. ,
  53831. Ci.TubeGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53832. Ci.TubeGeometry.prototype.constructor = Ci.TubeGeometry,
  53833. Ci.TubeGeometry.NoTaper = function(e) {
  53834. return 1
  53835. }
  53836. ,
  53837. Ci.TubeGeometry.SinusoidalTaper = function(e) {
  53838. return Math.sin(Math.PI * e)
  53839. }
  53840. ,
  53841. Ci.TubeGeometry.FrenetFrames = function(e, t, i) {
  53842. 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;
  53843. for (this.tangents = u,
  53844. this.normals = d,
  53845. this.binormals = p,
  53846. l = 0; l < m; l++)
  53847. c = l / (m - 1),
  53848. u[l] = e.getTangentAt(c),
  53849. u[l].normalize();
  53850. for (d[0] = new Ci.Vector3,
  53851. p[0] = new Ci.Vector3,
  53852. r = Number.MAX_VALUE,
  53853. o = Math.abs(u[0].x),
  53854. a = Math.abs(u[0].y),
  53855. s = Math.abs(u[0].z),
  53856. o <= r && (r = o,
  53857. h.set(1, 0, 0)),
  53858. a <= r && (r = a,
  53859. h.set(0, 1, 0)),
  53860. s <= r && h.set(0, 0, 1),
  53861. f.crossVectors(u[0], h).normalize(),
  53862. d[0].crossVectors(u[0], f),
  53863. p[0].crossVectors(u[0], d[0]),
  53864. l = 1; l < m; l++)
  53865. d[l] = d[l - 1].clone(),
  53866. p[l] = p[l - 1].clone(),
  53867. f.crossVectors(u[l - 1], u[l]),
  53868. f.length() > Number.EPSILON && (f.normalize(),
  53869. n = Math.acos(Ci.Math.clamp(u[l - 1].dot(u[l]), -1, 1)),
  53870. d[l].applyMatrix4(g.makeRotationAxis(f, n))),
  53871. p[l].crossVectors(u[l], d[l]);
  53872. if (i)
  53873. for (n = Math.acos(Ci.Math.clamp(d[0].dot(d[m - 1]), -1, 1)),
  53874. n /= m - 1,
  53875. 0 < u[0].dot(f.crossVectors(d[0], d[m - 1])) && (n = -n),
  53876. l = 1; l < m; l++)
  53877. d[l].applyMatrix4(g.makeRotationAxis(u[l], n * l)),
  53878. p[l].crossVectors(u[l], d[l])
  53879. }
  53880. ,
  53881. Ci.PolyhedronGeometry = function(e, t, i, n) {
  53882. function f(e) {
  53883. var t = e.normalize().clone();
  53884. t.index = m.vertices.push(t) - 1;
  53885. var i = a(e) / 2 / Math.PI + .5
  53886. , n = function(e) {
  53887. return Math.atan2(-e.y, Math.sqrt(e.x * e.x + e.z * e.z))
  53888. }(e) / Math.PI + .5;
  53889. return t.uv = new Ci.Vector2(i,1 - n),
  53890. t
  53891. }
  53892. function g(e, t, i, n) {
  53893. var r = new Ci.Face3(e.index,t.index,i.index,[e.clone(), t.clone(), i.clone()],void 0,n);
  53894. m.faces.push(r),
  53895. y.copy(e).add(t).add(i).divideScalar(3);
  53896. var o = a(y);
  53897. m.faceVertexUvs[0].push([s(e.uv, e, o), s(t.uv, t, o), s(i.uv, i, o)])
  53898. }
  53899. function r(e, t) {
  53900. 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++) {
  53901. a[l] = [];
  53902. 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++)
  53903. a[l][d] = 0 === d && l === i ? c : f(c.clone().lerp(h, d / u))
  53904. }
  53905. for (l = 0; l < i; l++)
  53906. for (d = 0; d < 2 * (i - l) - 1; d++) {
  53907. var p = Math.floor(d / 2);
  53908. 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)
  53909. }
  53910. }
  53911. function a(e) {
  53912. return Math.atan2(e.z, -e.x)
  53913. }
  53914. function s(e, t, i) {
  53915. return i < 0 && 1 === e.x && (e = new Ci.Vector2(e.x - 1,e.y)),
  53916. 0 === t.x && 0 === t.z && (e = new Ci.Vector2(i / 2 / Math.PI + .5,e.y)),
  53917. e.clone()
  53918. }
  53919. Ci.Geometry.call(this),
  53920. this.type = "PolyhedronGeometry",
  53921. this.parameters = {
  53922. vertices: e,
  53923. indices: t,
  53924. radius: i,
  53925. detail: n
  53926. },
  53927. i = i || 1,
  53928. n = n || 0;
  53929. for (var m = this, o = 0, l = e.length; o < l; o += 3)
  53930. f(new Ci.Vector3(e[o],e[o + 1],e[o + 2]));
  53931. var c = this.vertices
  53932. , h = []
  53933. , u = (o = 0,
  53934. 0);
  53935. for (l = t.length; o < l; o += 3,
  53936. u++) {
  53937. var d = c[t[o]]
  53938. , p = c[t[o + 1]]
  53939. , v = c[t[o + 2]];
  53940. h[u] = new Ci.Face3(d.index,p.index,v.index,[d.clone(), p.clone(), v.clone()],void 0,u)
  53941. }
  53942. var y = new Ci.Vector3;
  53943. for (o = 0,
  53944. l = h.length; o < l; o++)
  53945. r(h[o], n);
  53946. for (o = 0,
  53947. l = this.faceVertexUvs[0].length; o < l; o++) {
  53948. var A = this.faceVertexUvs[0][o]
  53949. , C = A[0].x
  53950. , I = A[1].x
  53951. , E = A[2].x
  53952. , _ = Math.max(C, I, E)
  53953. , b = Math.min(C, I, E);
  53954. .9 < _ && b < .1 && (C < .2 && (A[0].x += 1),
  53955. I < .2 && (A[1].x += 1),
  53956. E < .2 && (A[2].x += 1))
  53957. }
  53958. for (o = 0,
  53959. l = this.vertices.length; o < l; o++)
  53960. this.vertices[o].multiplyScalar(i);
  53961. this.mergeVertices(),
  53962. this.computeFaceNormals(),
  53963. this.boundingSphere = new Ci.Sphere(new Ci.Vector3,i)
  53964. }
  53965. ,
  53966. Ci.PolyhedronGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53967. Ci.PolyhedronGeometry.prototype.constructor = Ci.PolyhedronGeometry,
  53968. Ci.DodecahedronGeometry = function(e, t) {
  53969. var i = (1 + Math.sqrt(5)) / 2
  53970. , n = 1 / i
  53971. , 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];
  53972. 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),
  53973. this.type = "DodecahedronGeometry",
  53974. this.parameters = {
  53975. radius: e,
  53976. detail: t
  53977. }
  53978. }
  53979. ,
  53980. Ci.DodecahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  53981. Ci.DodecahedronGeometry.prototype.constructor = Ci.DodecahedronGeometry,
  53982. Ci.IcosahedronGeometry = function(e, t) {
  53983. var i = (1 + Math.sqrt(5)) / 2
  53984. , 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];
  53985. 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),
  53986. this.type = "IcosahedronGeometry",
  53987. this.parameters = {
  53988. radius: e,
  53989. detail: t
  53990. }
  53991. }
  53992. ,
  53993. Ci.IcosahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  53994. Ci.IcosahedronGeometry.prototype.constructor = Ci.IcosahedronGeometry,
  53995. Ci.OctahedronGeometry = function(e, t) {
  53996. 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),
  53997. this.type = "OctahedronGeometry",
  53998. this.parameters = {
  53999. radius: e,
  54000. detail: t
  54001. }
  54002. }
  54003. ,
  54004. Ci.OctahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  54005. Ci.OctahedronGeometry.prototype.constructor = Ci.OctahedronGeometry,
  54006. Ci.TetrahedronGeometry = function(e, t) {
  54007. 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),
  54008. this.type = "TetrahedronGeometry",
  54009. this.parameters = {
  54010. radius: e,
  54011. detail: t
  54012. }
  54013. }
  54014. ,
  54015. Ci.TetrahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  54016. Ci.TetrahedronGeometry.prototype.constructor = Ci.TetrahedronGeometry,
  54017. Ci.ParametricGeometry = function(e, t, i) {
  54018. Ci.Geometry.call(this),
  54019. this.type = "ParametricGeometry",
  54020. this.parameters = {
  54021. func: e,
  54022. slices: t,
  54023. stacks: i
  54024. };
  54025. 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;
  54026. for (n = 0; n <= i; n++)
  54027. for (a = n / i,
  54028. r = 0; r <= t; r++)
  54029. o = e(r / t, a),
  54030. g.push(o);
  54031. for (n = 0; n < i; n++)
  54032. for (r = 0; r < t; r++)
  54033. l = (s = n * y + r) + 1,
  54034. c = (n + 1) * y + r + 1,
  54035. h = (n + 1) * y + r,
  54036. u = new Ci.Vector2(r / t,n / i),
  54037. d = new Ci.Vector2((r + 1) / t,n / i),
  54038. p = new Ci.Vector2((r + 1) / t,(n + 1) / i),
  54039. f = new Ci.Vector2(r / t,(n + 1) / i),
  54040. m.push(new Ci.Face3(s,l,h)),
  54041. v.push([u, d, f]),
  54042. m.push(new Ci.Face3(l,c,h)),
  54043. v.push([d.clone(), p, f.clone()]);
  54044. this.computeFaceNormals(),
  54045. this.computeVertexNormals()
  54046. }
  54047. ,
  54048. Ci.ParametricGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54049. Ci.ParametricGeometry.prototype.constructor = Ci.ParametricGeometry,
  54050. Ci.WireframeGeometry = function(e) {
  54051. function t(e, t) {
  54052. return e - t
  54053. }
  54054. Ci.BufferGeometry.call(this);
  54055. var i = [0, 0]
  54056. , n = {}
  54057. , r = ["a", "b", "c"];
  54058. if (e instanceof Ci.Geometry) {
  54059. for (var o = e.vertices, a = e.faces, s = 0, l = new Uint32Array(6 * a.length), c = 0, h = a.length; c < h; c++)
  54060. for (var u = a[c], d = 0; d < 3; d++) {
  54061. i[0] = u[r[d]],
  54062. i[1] = u[r[(d + 1) % 3]],
  54063. i.sort(t),
  54064. void 0 === n[E = i.toString()] && (l[2 * s] = i[0],
  54065. l[2 * s + 1] = i[1],
  54066. n[E] = !0,
  54067. s++)
  54068. }
  54069. var p = new Float32Array(2 * s * 3);
  54070. for (c = 0,
  54071. h = s; c < h; c++)
  54072. for (d = 0; d < 2; d++) {
  54073. var f = o[l[2 * c + d]];
  54074. p[(_ = 6 * c + 3 * d) + 0] = f.x,
  54075. p[_ + 1] = f.y,
  54076. p[_ + 2] = f.z
  54077. }
  54078. this.addAttribute("position", new Ci.BufferAttribute(p,3))
  54079. } else if (e instanceof Ci.BufferGeometry)
  54080. if (null !== e.index) {
  54081. var g = e.index.array
  54082. , m = (o = e.attributes.position,
  54083. e.groups);
  54084. s = 0;
  54085. 0 === m.length && e.addGroup(0, g.length);
  54086. l = new Uint32Array(2 * g.length);
  54087. for (var v = 0, y = m.length; v < y; ++v)
  54088. for (var A = m[v], C = A.start, I = (c = C,
  54089. C + A.count); c < I; c += 3)
  54090. for (d = 0; d < 3; d++) {
  54091. var E;
  54092. i[0] = g[c + d],
  54093. i[1] = g[c + (d + 1) % 3],
  54094. i.sort(t),
  54095. void 0 === n[E = i.toString()] && (l[2 * s] = i[0],
  54096. l[2 * s + 1] = i[1],
  54097. n[E] = !0,
  54098. s++)
  54099. }
  54100. for (p = new Float32Array(2 * s * 3),
  54101. c = 0,
  54102. h = s; c < h; c++)
  54103. for (d = 0; d < 2; d++) {
  54104. var _ = 6 * c + 3 * d
  54105. , b = l[2 * c + d];
  54106. p[_ + 0] = o.getX(b),
  54107. p[_ + 1] = o.getY(b),
  54108. p[_ + 2] = o.getZ(b)
  54109. }
  54110. this.addAttribute("position", new Ci.BufferAttribute(p,3))
  54111. } else {
  54112. var w = (s = (o = e.attributes.position.array).length / 3) / 3;
  54113. for (p = new Float32Array(2 * s * 3),
  54114. c = 0,
  54115. h = w; c < h; c++)
  54116. for (d = 0; d < 3; d++) {
  54117. var T = 9 * c + 3 * d;
  54118. p[(_ = 18 * c + 6 * d) + 0] = o[T],
  54119. p[_ + 1] = o[1 + T],
  54120. p[_ + 2] = o[2 + T];
  54121. b = 9 * c + (d + 1) % 3 * 3;
  54122. p[_ + 3] = o[b],
  54123. p[_ + 4] = o[b + 1],
  54124. p[_ + 5] = o[b + 2]
  54125. }
  54126. this.addAttribute("position", new Ci.BufferAttribute(p,3))
  54127. }
  54128. }
  54129. ,
  54130. Ci.WireframeGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  54131. Ci.WireframeGeometry.prototype.constructor = Ci.WireframeGeometry,
  54132. Ci.AxisHelper = function(e) {
  54133. e = e || 1;
  54134. var t = new Float32Array([0, 0, 0, e, 0, 0, 0, 0, 0, 0, e, 0, 0, 0, 0, 0, 0, e])
  54135. , i = new Float32Array([1, 0, 0, 1, .6, 0, 0, 1, 0, .6, 1, 0, 0, 0, 1, 0, .6, 1])
  54136. , n = new Ci.BufferGeometry;
  54137. n.addAttribute("position", new Ci.BufferAttribute(t,3)),
  54138. n.addAttribute("color", new Ci.BufferAttribute(i,3));
  54139. var r = new Ci.LineBasicMaterial({
  54140. vertexColors: Ci.VertexColors
  54141. });
  54142. Ci.LineSegments.call(this, n, r)
  54143. }
  54144. ,
  54145. Ci.AxisHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54146. Ci.AxisHelper.prototype.constructor = Ci.AxisHelper,
  54147. Ci.ArrowHelper = function() {
  54148. var a = new Ci.Geometry;
  54149. a.vertices.push(new Ci.Vector3(0,0,0), new Ci.Vector3(0,1,0));
  54150. var s = new Ci.CylinderGeometry(0,.5,1,5,1);
  54151. return s.translate(0, -.5, 0),
  54152. function(e, t, i, n, r, o) {
  54153. Ci.Object3D.call(this),
  54154. void 0 === n && (n = 16776960),
  54155. void 0 === i && (i = 1),
  54156. void 0 === r && (r = .2 * i),
  54157. void 0 === o && (o = .2 * r),
  54158. this.position.copy(t),
  54159. this.line = new Ci.Line(a,new Ci.LineBasicMaterial({
  54160. color: n
  54161. })),
  54162. this.line.matrixAutoUpdate = !1,
  54163. this.add(this.line),
  54164. this.cone = new Ci.Mesh(s,new Ci.MeshBasicMaterial({
  54165. color: n
  54166. })),
  54167. this.cone.matrixAutoUpdate = !1,
  54168. this.add(this.cone),
  54169. this.setDirection(e),
  54170. this.setLength(i, r, o)
  54171. }
  54172. }(),
  54173. Ci.ArrowHelper.prototype = Object.create(Ci.Object3D.prototype),
  54174. Ci.ArrowHelper.prototype.constructor = Ci.ArrowHelper,
  54175. Ci.ArrowHelper.prototype.setDirection = (Ai = new Ci.Vector3,
  54176. function(e) {
  54177. .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(),
  54178. yi = Math.acos(e.y),
  54179. this.quaternion.setFromAxisAngle(Ai, yi))
  54180. }
  54181. ),
  54182. Ci.ArrowHelper.prototype.setLength = function(e, t, i) {
  54183. void 0 === t && (t = .2 * e),
  54184. void 0 === i && (i = .2 * t),
  54185. this.line.scale.set(1, Math.max(0, e - t), 1),
  54186. this.line.updateMatrix(),
  54187. this.cone.scale.set(i, t, i),
  54188. this.cone.position.y = e,
  54189. this.cone.updateMatrix()
  54190. }
  54191. ,
  54192. Ci.ArrowHelper.prototype.setColor = function(e) {
  54193. this.line.material.color.set(e),
  54194. this.cone.material.color.set(e)
  54195. }
  54196. ,
  54197. Ci.BoxHelper = function(e) {
  54198. 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])
  54199. , i = new Float32Array(24)
  54200. , n = new Ci.BufferGeometry;
  54201. n.setIndex(new Ci.BufferAttribute(t,1)),
  54202. n.addAttribute("position", new Ci.BufferAttribute(i,3)),
  54203. Ci.LineSegments.call(this, n, new Ci.LineBasicMaterial({
  54204. color: 16776960
  54205. })),
  54206. void 0 !== e && this.update(e)
  54207. }
  54208. ,
  54209. Ci.BoxHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54210. Ci.BoxHelper.prototype.constructor = Ci.BoxHelper,
  54211. Ci.BoxHelper.prototype.update = (vi = new Ci.Box3,
  54212. function(e) {
  54213. if (vi.setFromObject(e),
  54214. !vi.isEmpty()) {
  54215. var t = vi.min
  54216. , i = vi.max
  54217. , n = this.geometry.attributes.position
  54218. , r = n.array;
  54219. r[0] = i.x,
  54220. r[1] = i.y,
  54221. r[2] = i.z,
  54222. r[3] = t.x,
  54223. r[4] = i.y,
  54224. r[5] = i.z,
  54225. r[6] = t.x,
  54226. r[7] = t.y,
  54227. r[8] = i.z,
  54228. r[9] = i.x,
  54229. r[10] = t.y,
  54230. r[11] = i.z,
  54231. r[12] = i.x,
  54232. r[13] = i.y,
  54233. r[14] = t.z,
  54234. r[15] = t.x,
  54235. r[16] = i.y,
  54236. r[17] = t.z,
  54237. r[18] = t.x,
  54238. r[19] = t.y,
  54239. r[20] = t.z,
  54240. r[21] = i.x,
  54241. r[22] = t.y,
  54242. r[23] = t.z,
  54243. n.needsUpdate = !0,
  54244. this.geometry.computeBoundingSphere()
  54245. }
  54246. }
  54247. ),
  54248. Ci.BoundingBoxHelper = function(e, t) {
  54249. var i = void 0 !== t ? t : 8947848;
  54250. this.object = e,
  54251. this.box = new Ci.Box3,
  54252. Ci.Mesh.call(this, new Ci.BoxGeometry(1,1,1), new Ci.MeshBasicMaterial({
  54253. color: i,
  54254. wireframe: !0
  54255. }))
  54256. }
  54257. ,
  54258. Ci.BoundingBoxHelper.prototype = Object.create(Ci.Mesh.prototype),
  54259. Ci.BoundingBoxHelper.prototype.constructor = Ci.BoundingBoxHelper,
  54260. Ci.BoundingBoxHelper.prototype.update = function() {
  54261. this.box.setFromObject(this.object),
  54262. this.box.size(this.scale),
  54263. this.box.center(this.position)
  54264. }
  54265. ,
  54266. Ci.CameraHelper = function(e) {
  54267. function t(e, t, i) {
  54268. n(e, i),
  54269. n(t, i)
  54270. }
  54271. function n(e, t) {
  54272. i.vertices.push(new Ci.Vector3),
  54273. i.colors.push(new Ci.Color(t)),
  54274. void 0 === o[e] && (o[e] = []),
  54275. o[e].push(i.vertices.length - 1)
  54276. }
  54277. var i = new Ci.Geometry
  54278. , r = new Ci.LineBasicMaterial({
  54279. color: 16777215,
  54280. vertexColors: Ci.FaceColors
  54281. })
  54282. , o = {}
  54283. , a = 16755200
  54284. , s = 16711680
  54285. , l = 3355443;
  54286. t("n1", "n2", a),
  54287. t("n2", "n4", a),
  54288. t("n4", "n3", a),
  54289. t("n3", "n1", a),
  54290. t("f1", "f2", a),
  54291. t("f2", "f4", a),
  54292. t("f4", "f3", a),
  54293. t("f3", "f1", a),
  54294. t("n1", "f1", a),
  54295. t("n2", "f2", a),
  54296. t("n3", "f3", a),
  54297. t("n4", "f4", a),
  54298. t("p", "n1", s),
  54299. t("p", "n2", s),
  54300. t("p", "n3", s),
  54301. t("p", "n4", s),
  54302. t("u1", "u2", 43775),
  54303. t("u2", "u3", 43775),
  54304. t("u3", "u1", 43775),
  54305. t("c", "t", 16777215),
  54306. t("p", "c", l),
  54307. t("cn1", "cn2", l),
  54308. t("cn3", "cn4", l),
  54309. t("cf1", "cf2", l),
  54310. t("cf3", "cf4", l),
  54311. Ci.LineSegments.call(this, i, r),
  54312. this.camera = e,
  54313. this.camera.updateProjectionMatrix(),
  54314. this.matrix = e.matrixWorld,
  54315. this.matrixAutoUpdate = !1,
  54316. this.pointMap = o,
  54317. this.update()
  54318. }
  54319. ,
  54320. Ci.CameraHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54321. Ci.CameraHelper.prototype.constructor = Ci.CameraHelper,
  54322. Ci.CameraHelper.prototype.update = (gi = new Ci.Vector3,
  54323. mi = new Ci.Camera,
  54324. function() {
  54325. pi = this.geometry,
  54326. fi = this.pointMap,
  54327. mi.projectionMatrix.copy(this.camera.projectionMatrix),
  54328. Ni("c", 0, 0, -1),
  54329. Ni("t", 0, 0, 1),
  54330. Ni("n1", -1, -1, -1),
  54331. Ni("n2", 1, -1, -1),
  54332. Ni("n3", -1, 1, -1),
  54333. Ni("n4", 1, 1, -1),
  54334. Ni("f1", -1, -1, 1),
  54335. Ni("f2", 1, -1, 1),
  54336. Ni("f3", -1, 1, 1),
  54337. Ni("f4", 1, 1, 1),
  54338. Ni("u1", .7, 1.1, -1),
  54339. Ni("u2", -.7, 1.1, -1),
  54340. Ni("u3", 0, 2, -1),
  54341. Ni("cf1", -1, 0, 1),
  54342. Ni("cf2", 1, 0, 1),
  54343. Ni("cf3", 0, -1, 1),
  54344. Ni("cf4", 0, 1, 1),
  54345. Ni("cn1", -1, 0, -1),
  54346. Ni("cn2", 1, 0, -1),
  54347. Ni("cn3", 0, -1, -1),
  54348. Ni("cn4", 0, 1, -1),
  54349. pi.verticesNeedUpdate = !0
  54350. }
  54351. ),
  54352. Ci.DirectionalLightHelper = function(e, t) {
  54353. Ci.Object3D.call(this),
  54354. this.light = e,
  54355. this.light.updateMatrixWorld(),
  54356. this.matrix = e.matrixWorld,
  54357. this.matrixAutoUpdate = !1,
  54358. t = t || 1;
  54359. var i = new Ci.Geometry;
  54360. 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));
  54361. var n = new Ci.LineBasicMaterial({
  54362. fog: !1
  54363. });
  54364. n.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54365. this.lightPlane = new Ci.Line(i,n),
  54366. this.add(this.lightPlane),
  54367. (i = new Ci.Geometry).vertices.push(new Ci.Vector3, new Ci.Vector3),
  54368. (n = new Ci.LineBasicMaterial({
  54369. fog: !1
  54370. })).color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54371. this.targetLine = new Ci.Line(i,n),
  54372. this.add(this.targetLine),
  54373. this.update()
  54374. }
  54375. ,
  54376. Ci.DirectionalLightHelper.prototype = Object.create(Ci.Object3D.prototype),
  54377. Ci.DirectionalLightHelper.prototype.constructor = Ci.DirectionalLightHelper,
  54378. Ci.DirectionalLightHelper.prototype.dispose = function() {
  54379. this.lightPlane.geometry.dispose(),
  54380. this.lightPlane.material.dispose(),
  54381. this.targetLine.geometry.dispose(),
  54382. this.targetLine.material.dispose()
  54383. }
  54384. ,
  54385. Ci.DirectionalLightHelper.prototype.update = (hi = new Ci.Vector3,
  54386. ui = new Ci.Vector3,
  54387. di = new Ci.Vector3,
  54388. function() {
  54389. hi.setFromMatrixPosition(this.light.matrixWorld),
  54390. ui.setFromMatrixPosition(this.light.target.matrixWorld),
  54391. di.subVectors(ui, hi),
  54392. this.lightPlane.lookAt(di),
  54393. this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54394. this.targetLine.geometry.vertices[1].copy(di),
  54395. this.targetLine.geometry.verticesNeedUpdate = !0,
  54396. this.targetLine.material.color.copy(this.lightPlane.material.color)
  54397. }
  54398. ),
  54399. Ci.EdgesHelper = function(e, t, i) {
  54400. var n = void 0 !== t ? t : 16777215;
  54401. Ci.LineSegments.call(this, new Ci.EdgesGeometry(e.geometry,i), new Ci.LineBasicMaterial({
  54402. color: n
  54403. })),
  54404. this.matrix = e.matrixWorld,
  54405. this.matrixAutoUpdate = !1
  54406. }
  54407. ,
  54408. Ci.EdgesHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54409. Ci.EdgesHelper.prototype.constructor = Ci.EdgesHelper,
  54410. Ci.FaceNormalsHelper = function(e, t, i, n) {
  54411. this.object = e,
  54412. this.size = void 0 !== t ? t : 1;
  54413. var r = void 0 !== i ? i : 16776960
  54414. , o = void 0 !== n ? n : 1
  54415. , a = 0
  54416. , s = this.object.geometry;
  54417. s instanceof Ci.Geometry ? a = s.faces.length : console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");
  54418. var l = new Ci.BufferGeometry
  54419. , c = new Ci.Float32Attribute(2 * a * 3,3);
  54420. l.addAttribute("position", c),
  54421. Ci.LineSegments.call(this, l, new Ci.LineBasicMaterial({
  54422. color: r,
  54423. linewidth: o
  54424. })),
  54425. this.matrixAutoUpdate = !1,
  54426. this.update()
  54427. }
  54428. ,
  54429. Ci.FaceNormalsHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54430. Ci.FaceNormalsHelper.prototype.constructor = Ci.FaceNormalsHelper,
  54431. Ci.FaceNormalsHelper.prototype.update = (si = new Ci.Vector3,
  54432. li = new Ci.Vector3,
  54433. ci = new Ci.Matrix3,
  54434. function() {
  54435. this.object.updateMatrixWorld(!0),
  54436. ci.getNormalMatrix(this.object.matrixWorld);
  54437. 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++) {
  54438. var l = r[a]
  54439. , c = l.normal;
  54440. si.copy(n[l.a]).add(n[l.b]).add(n[l.c]).divideScalar(3).applyMatrix4(e),
  54441. li.copy(c).applyMatrix3(ci).normalize().multiplyScalar(this.size).add(si),
  54442. t.setXYZ(o, si.x, si.y, si.z),
  54443. o += 1,
  54444. t.setXYZ(o, li.x, li.y, li.z),
  54445. o += 1
  54446. }
  54447. return t.needsUpdate = !0,
  54448. this
  54449. }
  54450. ),
  54451. Ci.GridHelper = function(e, t) {
  54452. var i = new Ci.Geometry
  54453. , n = new Ci.LineBasicMaterial({
  54454. vertexColors: Ci.VertexColors
  54455. });
  54456. this.color1 = new Ci.Color(4473924),
  54457. this.color2 = new Ci.Color(8947848);
  54458. for (var r = -e; r <= e; r += t) {
  54459. 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));
  54460. var o = 0 === r ? this.color1 : this.color2;
  54461. i.colors.push(o, o, o, o)
  54462. }
  54463. Ci.LineSegments.call(this, i, n)
  54464. }
  54465. ,
  54466. Ci.GridHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54467. Ci.GridHelper.prototype.constructor = Ci.GridHelper,
  54468. Ci.GridHelper.prototype.setColors = function(e, t) {
  54469. this.color1.set(e),
  54470. this.color2.set(t),
  54471. this.geometry.colorsNeedUpdate = !0
  54472. }
  54473. ,
  54474. Ci.HemisphereLightHelper = function(e, t) {
  54475. Ci.Object3D.call(this),
  54476. this.light = e,
  54477. this.light.updateMatrixWorld(),
  54478. this.matrix = e.matrixWorld,
  54479. this.matrixAutoUpdate = !1,
  54480. this.colors = [new Ci.Color, new Ci.Color];
  54481. var i = new Ci.SphereGeometry(t,4,2);
  54482. i.rotateX(-Math.PI / 2);
  54483. for (var n = 0; n < 8; n++)
  54484. i.faces[n].color = this.colors[n < 4 ? 0 : 1];
  54485. var r = new Ci.MeshBasicMaterial({
  54486. vertexColors: Ci.FaceColors,
  54487. wireframe: !0
  54488. });
  54489. this.lightSphere = new Ci.Mesh(i,r),
  54490. this.add(this.lightSphere),
  54491. this.update()
  54492. }
  54493. ,
  54494. Ci.HemisphereLightHelper.prototype = Object.create(Ci.Object3D.prototype),
  54495. Ci.HemisphereLightHelper.prototype.constructor = Ci.HemisphereLightHelper,
  54496. Ci.HemisphereLightHelper.prototype.dispose = function() {
  54497. this.lightSphere.geometry.dispose(),
  54498. this.lightSphere.material.dispose()
  54499. }
  54500. ,
  54501. Ci.HemisphereLightHelper.prototype.update = (ai = new Ci.Vector3,
  54502. function() {
  54503. this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity),
  54504. this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity),
  54505. this.lightSphere.lookAt(ai.setFromMatrixPosition(this.light.matrixWorld).negate()),
  54506. this.lightSphere.geometry.colorsNeedUpdate = !0
  54507. }
  54508. ),
  54509. Ci.PointLightHelper = function(e, t) {
  54510. this.light = e,
  54511. this.light.updateMatrixWorld();
  54512. var i = new Ci.SphereGeometry(t,4,2)
  54513. , n = new Ci.MeshBasicMaterial({
  54514. wireframe: !0,
  54515. fog: !1
  54516. });
  54517. n.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54518. Ci.Mesh.call(this, i, n),
  54519. this.matrix = this.light.matrixWorld,
  54520. this.matrixAutoUpdate = !1
  54521. }
  54522. ,
  54523. Ci.PointLightHelper.prototype = Object.create(Ci.Mesh.prototype),
  54524. Ci.PointLightHelper.prototype.constructor = Ci.PointLightHelper,
  54525. Ci.PointLightHelper.prototype.dispose = function() {
  54526. this.geometry.dispose(),
  54527. this.material.dispose()
  54528. }
  54529. ,
  54530. Ci.PointLightHelper.prototype.update = function() {
  54531. this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  54532. }
  54533. ,
  54534. Ci.SkeletonHelper = function(e) {
  54535. this.bones = this.getBoneList(e);
  54536. for (var t = new Ci.Geometry, i = 0; i < this.bones.length; i++) {
  54537. this.bones[i].parent instanceof Ci.Bone && (t.vertices.push(new Ci.Vector3),
  54538. t.vertices.push(new Ci.Vector3),
  54539. t.colors.push(new Ci.Color(0,0,1)),
  54540. t.colors.push(new Ci.Color(0,1,0)))
  54541. }
  54542. t.dynamic = !0;
  54543. var n = new Ci.LineBasicMaterial({
  54544. vertexColors: Ci.VertexColors,
  54545. depthTest: !1,
  54546. depthWrite: !1,
  54547. transparent: !0
  54548. });
  54549. Ci.LineSegments.call(this, t, n),
  54550. this.root = e,
  54551. this.matrix = e.matrixWorld,
  54552. this.matrixAutoUpdate = !1,
  54553. this.update()
  54554. }
  54555. ,
  54556. Ci.SkeletonHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54557. Ci.SkeletonHelper.prototype.constructor = Ci.SkeletonHelper,
  54558. Ci.SkeletonHelper.prototype.getBoneList = function(e) {
  54559. var t = [];
  54560. e instanceof Ci.Bone && t.push(e);
  54561. for (var i = 0; i < e.children.length; i++)
  54562. t.push.apply(t, this.getBoneList(e.children[i]));
  54563. return t
  54564. }
  54565. ,
  54566. Ci.SkeletonHelper.prototype.update = function() {
  54567. 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++) {
  54568. var o = this.bones[r];
  54569. o.parent instanceof Ci.Bone && (i.multiplyMatrices(t, o.matrixWorld),
  54570. e.vertices[n].setFromMatrixPosition(i),
  54571. i.multiplyMatrices(t, o.parent.matrixWorld),
  54572. e.vertices[n + 1].setFromMatrixPosition(i),
  54573. n += 2)
  54574. }
  54575. e.verticesNeedUpdate = !0,
  54576. e.computeBoundingSphere()
  54577. }
  54578. ,
  54579. Ci.SpotLightHelper = function(e) {
  54580. Ci.Object3D.call(this),
  54581. this.light = e,
  54582. this.light.updateMatrixWorld(),
  54583. this.matrix = e.matrixWorld,
  54584. this.matrixAutoUpdate = !1;
  54585. var t = new Ci.CylinderGeometry(0,1,1,8,1,!0);
  54586. t.translate(0, -.5, 0),
  54587. t.rotateX(-Math.PI / 2);
  54588. var i = new Ci.MeshBasicMaterial({
  54589. wireframe: !0,
  54590. fog: !1
  54591. });
  54592. this.cone = new Ci.Mesh(t,i),
  54593. this.add(this.cone),
  54594. this.update()
  54595. }
  54596. ,
  54597. Ci.SpotLightHelper.prototype = Object.create(Ci.Object3D.prototype),
  54598. Ci.SpotLightHelper.prototype.constructor = Ci.SpotLightHelper,
  54599. Ci.SpotLightHelper.prototype.dispose = function() {
  54600. this.cone.geometry.dispose(),
  54601. this.cone.material.dispose()
  54602. }
  54603. ,
  54604. Ci.SpotLightHelper.prototype.update = (ri = new Ci.Vector3,
  54605. oi = new Ci.Vector3,
  54606. function() {
  54607. var e = this.light.distance ? this.light.distance : 1e4
  54608. , t = e * Math.tan(this.light.angle);
  54609. this.cone.scale.set(t, t, e),
  54610. ri.setFromMatrixPosition(this.light.matrixWorld),
  54611. oi.setFromMatrixPosition(this.light.target.matrixWorld),
  54612. this.cone.lookAt(oi.sub(ri)),
  54613. this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  54614. }
  54615. ),
  54616. Ci.VertexNormalsHelper = function(e, t, i, n) {
  54617. this.object = e,
  54618. this.size = void 0 !== t ? t : 1;
  54619. var r = void 0 !== i ? i : 16711680
  54620. , o = void 0 !== n ? n : 1
  54621. , a = 0
  54622. , s = this.object.geometry;
  54623. s instanceof Ci.Geometry ? a = 3 * s.faces.length : s instanceof Ci.BufferGeometry && (a = s.attributes.normal.count);
  54624. var l = new Ci.BufferGeometry
  54625. , c = new Ci.Float32Attribute(2 * a * 3,3);
  54626. l.addAttribute("position", c),
  54627. Ci.LineSegments.call(this, l, new Ci.LineBasicMaterial({
  54628. color: r,
  54629. linewidth: o
  54630. })),
  54631. this.matrixAutoUpdate = !1,
  54632. this.update()
  54633. }
  54634. ,
  54635. Ci.VertexNormalsHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54636. Ci.VertexNormalsHelper.prototype.constructor = Ci.VertexNormalsHelper,
  54637. Ci.VertexNormalsHelper.prototype.update = (ti = new Ci.Vector3,
  54638. ii = new Ci.Vector3,
  54639. ni = new Ci.Matrix3,
  54640. function() {
  54641. var e = ["a", "b", "c"];
  54642. this.object.updateMatrixWorld(!0),
  54643. ni.getNormalMatrix(this.object.matrixWorld);
  54644. var t = this.object.matrixWorld
  54645. , i = this.geometry.attributes.position
  54646. , n = this.object.geometry;
  54647. if (n instanceof Ci.Geometry)
  54648. for (var r = n.vertices, o = n.faces, a = 0, s = 0, l = o.length; s < l; s++)
  54649. for (var c = o[s], h = 0, u = c.vertexNormals.length; h < u; h++) {
  54650. var d = r[c[e[h]]]
  54651. , p = c.vertexNormals[h];
  54652. ti.copy(d).applyMatrix4(t),
  54653. ii.copy(p).applyMatrix3(ni).normalize().multiplyScalar(this.size).add(ti),
  54654. i.setXYZ(a, ti.x, ti.y, ti.z),
  54655. a += 1,
  54656. i.setXYZ(a, ii.x, ii.y, ii.z),
  54657. a += 1
  54658. }
  54659. else if (n instanceof Ci.BufferGeometry) {
  54660. var f = n.attributes.position
  54661. , g = n.attributes.normal;
  54662. for (h = a = 0,
  54663. u = f.count; h < u; h++)
  54664. ti.set(f.getX(h), f.getY(h), f.getZ(h)).applyMatrix4(t),
  54665. ii.set(g.getX(h), g.getY(h), g.getZ(h)),
  54666. ii.applyMatrix3(ni).normalize().multiplyScalar(this.size).add(ti),
  54667. i.setXYZ(a, ti.x, ti.y, ti.z),
  54668. a += 1,
  54669. i.setXYZ(a, ii.x, ii.y, ii.z),
  54670. a += 1
  54671. }
  54672. return i.needsUpdate = !0,
  54673. this
  54674. }
  54675. ),
  54676. Ci.WireframeHelper = function(e, t) {
  54677. var i = void 0 !== t ? t : 16777215;
  54678. Ci.LineSegments.call(this, new Ci.WireframeGeometry(e.geometry), new Ci.LineBasicMaterial({
  54679. color: i
  54680. })),
  54681. this.matrix = e.matrixWorld,
  54682. this.matrixAutoUpdate = !1
  54683. }
  54684. ,
  54685. Ci.WireframeHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54686. Ci.WireframeHelper.prototype.constructor = Ci.WireframeHelper,
  54687. Ci.ImmediateRenderObject = function(e) {
  54688. Ci.Object3D.call(this),
  54689. this.material = e,
  54690. this.render = function(e) {}
  54691. }
  54692. ,
  54693. Ci.ImmediateRenderObject.prototype = Object.create(Ci.Object3D.prototype),
  54694. Ci.ImmediateRenderObject.prototype.constructor = Ci.ImmediateRenderObject,
  54695. Ci.MorphBlendMesh = function(e, t) {
  54696. Ci.Mesh.call(this, e, t),
  54697. this.animationsMap = {},
  54698. this.animationsList = [];
  54699. var i = this.geometry.morphTargets.length
  54700. , n = i - 1
  54701. , r = i / 1;
  54702. this.createAnimation("__default", 0, n, r),
  54703. this.setAnimationWeight("__default", 1)
  54704. }
  54705. ,
  54706. Ci.MorphBlendMesh.prototype = Object.create(Ci.Mesh.prototype),
  54707. Ci.MorphBlendMesh.prototype.constructor = Ci.MorphBlendMesh,
  54708. Ci.MorphBlendMesh.prototype.createAnimation = function(e, t, i, n) {
  54709. var r = {
  54710. start: t,
  54711. end: i,
  54712. length: i - t + 1,
  54713. fps: n,
  54714. duration: (i - t) / n,
  54715. lastFrame: 0,
  54716. currentFrame: 0,
  54717. active: !1,
  54718. time: 0,
  54719. direction: 1,
  54720. weight: 1,
  54721. directionBackwards: !1,
  54722. mirroredLoop: !1
  54723. };
  54724. this.animationsMap[e] = r,
  54725. this.animationsList.push(r)
  54726. }
  54727. ,
  54728. Ci.MorphBlendMesh.prototype.autoCreateAnimations = function(e) {
  54729. for (var t, i = /([a-z]+)_?(\d+)/i, n = {}, r = this.geometry, o = 0, a = r.morphTargets.length; o < a; o++) {
  54730. var s = r.morphTargets[o].name.match(i);
  54731. if (s && 1 < s.length)
  54732. n[l = s[1]] || (n[l] = {
  54733. start: 1 / 0,
  54734. end: -1 / 0
  54735. }),
  54736. o < (c = n[l]).start && (c.start = o),
  54737. o > c.end && (c.end = o),
  54738. t = t || l
  54739. }
  54740. for (var l in n) {
  54741. var c = n[l];
  54742. this.createAnimation(l, c.start, c.end, e)
  54743. }
  54744. this.firstAnimation = t
  54745. }
  54746. ,
  54747. Ci.MorphBlendMesh.prototype.setAnimationDirectionForward = function(e) {
  54748. var t = this.animationsMap[e];
  54749. t && (t.direction = 1,
  54750. t.directionBackwards = !1)
  54751. }
  54752. ,
  54753. Ci.MorphBlendMesh.prototype.setAnimationDirectionBackward = function(e) {
  54754. var t = this.animationsMap[e];
  54755. t && (t.direction = -1,
  54756. t.directionBackwards = !0)
  54757. }
  54758. ,
  54759. Ci.MorphBlendMesh.prototype.setAnimationFPS = function(e, t) {
  54760. var i = this.animationsMap[e];
  54761. i && (i.fps = t,
  54762. i.duration = (i.end - i.start) / i.fps)
  54763. }
  54764. ,
  54765. Ci.MorphBlendMesh.prototype.setAnimationDuration = function(e, t) {
  54766. var i = this.animationsMap[e];
  54767. i && (i.duration = t,
  54768. i.fps = (i.end - i.start) / i.duration)
  54769. }
  54770. ,
  54771. Ci.MorphBlendMesh.prototype.setAnimationWeight = function(e, t) {
  54772. var i = this.animationsMap[e];
  54773. i && (i.weight = t)
  54774. }
  54775. ,
  54776. Ci.MorphBlendMesh.prototype.setAnimationTime = function(e, t) {
  54777. var i = this.animationsMap[e];
  54778. i && (i.time = t)
  54779. }
  54780. ,
  54781. Ci.MorphBlendMesh.prototype.getAnimationTime = function(e) {
  54782. var t = 0
  54783. , i = this.animationsMap[e];
  54784. return i && (t = i.time),
  54785. t
  54786. }
  54787. ,
  54788. Ci.MorphBlendMesh.prototype.getAnimationDuration = function(e) {
  54789. var t = -1
  54790. , i = this.animationsMap[e];
  54791. return i && (t = i.duration),
  54792. t
  54793. }
  54794. ,
  54795. Ci.MorphBlendMesh.prototype.playAnimation = function(e) {
  54796. var t = this.animationsMap[e];
  54797. t ? (t.time = 0,
  54798. t.active = !0) : console.warn("THREE.MorphBlendMesh: animation[" + e + "] undefined in .playAnimation()")
  54799. }
  54800. ,
  54801. Ci.MorphBlendMesh.prototype.stopAnimation = function(e) {
  54802. var t = this.animationsMap[e];
  54803. t && (t.active = !1)
  54804. }
  54805. ,
  54806. Ci.MorphBlendMesh.prototype.update = function(e) {
  54807. for (var t = 0, i = this.animationsList.length; t < i; t++) {
  54808. var n = this.animationsList[t];
  54809. if (n.active) {
  54810. var r = n.duration / n.length;
  54811. n.time += n.direction * e,
  54812. n.mirroredLoop ? (n.time > n.duration || n.time < 0) && (n.direction *= -1,
  54813. n.time > n.duration && (n.time = n.duration,
  54814. n.directionBackwards = !0),
  54815. n.time < 0 && (n.time = 0,
  54816. n.directionBackwards = !1)) : (n.time = n.time % n.duration,
  54817. n.time < 0 && (n.time += n.duration));
  54818. var o = n.start + Ci.Math.clamp(Math.floor(n.time / r), 0, n.length - 1)
  54819. , a = n.weight;
  54820. o !== n.currentFrame && (this.morphTargetInfluences[n.lastFrame] = 0,
  54821. this.morphTargetInfluences[n.currentFrame] = 1 * a,
  54822. this.morphTargetInfluences[o] = 0,
  54823. n.lastFrame = n.currentFrame,
  54824. n.currentFrame = o);
  54825. var s = n.time % r / r;
  54826. n.directionBackwards && (s = 1 - s),
  54827. n.currentFrame !== n.lastFrame ? (this.morphTargetInfluences[n.currentFrame] = s * a,
  54828. this.morphTargetInfluences[n.lastFrame] = (1 - s) * a) : this.morphTargetInfluences[n.currentFrame] = a
  54829. }
  54830. }
  54831. }
  54832. ,
  54833. void 0 !== i ? (void 0 !== t && t.exports && (i = t.exports = Ci),
  54834. i.THREE = Ci) : this.THREE = Ci
  54835. }
  54836. , {}]
  54837. }, {}, [116]);