main_2020_edit.js 2.4 MB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729297302973129732297332973429735297362973729738297392974029741297422974329744297452974629747297482974929750297512975229753297542975529756297572975829759297602976129762297632976429765297662976729768297692977029771297722977329774297752977629777297782977929780297812978229783297842978529786297872978829789297902979129792297932979429795297962979729798297992980029801298022980329804298052980629807298082980929810298112981229813298142981529816298172981829819298202982129822298232982429825298262982729828298292983029831298322983329834298352983629837298382983929840298412984229843298442984529846298472984829849298502985129852298532985429855298562985729858298592986029861298622986329864298652986629867298682986929870298712987229873298742987529876298772987829879298802988129882298832988429885298862988729888298892989029891298922989329894298952989629897298982989929900299012990229903299042990529906299072990829909299102991129912299132991429915299162991729918299192992029921299222992329924299252992629927299282992929930299312993229933299342993529936299372993829939299402994129942299432994429945299462994729948299492995029951299522995329954299552995629957299582995929960299612996229963299642996529966299672996829969299702997129972299732997429975299762997729978299792998029981299822998329984299852998629987299882998929990299912999229993299942999529996299972999829999300003000130002300033000430005300063000730008300093001030011300123001330014300153001630017300183001930020300213002230023300243002530026300273002830029300303003130032300333003430035300363003730038300393004030041300423004330044300453004630047300483004930050300513005230053300543005530056300573005830059300603006130062300633006430065300663006730068300693007030071300723007330074300753007630077300783007930080300813008230083300843008530086300873008830089300903009130092300933009430095300963009730098300993010030101301023010330104301053010630107301083010930110301113011230113301143011530116301173011830119301203012130122301233012430125301263012730128301293013030131301323013330134301353013630137301383013930140301413014230143301443014530146301473014830149301503015130152301533015430155301563015730158301593016030161301623016330164301653016630167301683016930170301713017230173301743017530176301773017830179301803018130182301833018430185301863018730188301893019030191301923019330194301953019630197301983019930200302013020230203302043020530206302073020830209302103021130212302133021430215302163021730218302193022030221302223022330224302253022630227302283022930230302313023230233302343023530236302373023830239302403024130242302433024430245302463024730248302493025030251302523025330254302553025630257302583025930260302613026230263302643026530266302673026830269302703027130272302733027430275302763027730278302793028030281302823028330284302853028630287302883028930290302913029230293302943029530296302973029830299303003030130302303033030430305303063030730308303093031030311303123031330314303153031630317303183031930320303213032230323303243032530326303273032830329303303033130332303333033430335303363033730338303393034030341303423034330344303453034630347303483034930350303513035230353303543035530356303573035830359303603036130362303633036430365303663036730368303693037030371303723037330374303753037630377303783037930380303813038230383303843038530386303873038830389303903039130392303933039430395303963039730398303993040030401304023040330404304053040630407304083040930410304113041230413304143041530416304173041830419304203042130422304233042430425304263042730428304293043030431304323043330434304353043630437304383043930440304413044230443304443044530446304473044830449304503045130452304533045430455304563045730458304593046030461304623046330464304653046630467304683046930470304713047230473304743047530476304773047830479304803048130482304833048430485304863048730488304893049030491304923049330494304953049630497304983049930500305013050230503305043050530506305073050830509305103051130512305133051430515305163051730518305193052030521305223052330524305253052630527305283052930530305313053230533305343053530536305373053830539305403054130542305433054430545305463054730548305493055030551305523055330554305553055630557305583055930560305613056230563305643056530566305673056830569305703057130572305733057430575305763057730578305793058030581305823058330584305853058630587305883058930590305913059230593305943059530596305973059830599306003060130602306033060430605306063060730608306093061030611306123061330614306153061630617306183061930620306213062230623306243062530626306273062830629306303063130632306333063430635306363063730638306393064030641306423064330644306453064630647306483064930650306513065230653306543065530656306573065830659306603066130662306633066430665306663066730668306693067030671306723067330674306753067630677306783067930680306813068230683306843068530686306873068830689306903069130692306933069430695306963069730698306993070030701307023070330704307053070630707307083070930710307113071230713307143071530716307173071830719307203072130722307233072430725307263072730728307293073030731307323073330734307353073630737307383073930740307413074230743307443074530746307473074830749307503075130752307533075430755307563075730758307593076030761307623076330764307653076630767307683076930770307713077230773307743077530776307773077830779307803078130782307833078430785307863078730788307893079030791307923079330794307953079630797307983079930800308013080230803308043080530806308073080830809308103081130812308133081430815308163081730818308193082030821308223082330824308253082630827308283082930830308313083230833308343083530836308373083830839308403084130842308433084430845308463084730848308493085030851308523085330854308553085630857308583085930860308613086230863308643086530866308673086830869308703087130872308733087430875308763087730878308793088030881308823088330884308853088630887308883088930890308913089230893308943089530896308973089830899309003090130902309033090430905309063090730908309093091030911309123091330914309153091630917309183091930920309213092230923309243092530926309273092830929309303093130932309333093430935309363093730938309393094030941309423094330944309453094630947309483094930950309513095230953309543095530956309573095830959309603096130962309633096430965309663096730968309693097030971309723097330974309753097630977309783097930980309813098230983309843098530986309873098830989309903099130992309933099430995309963099730998309993100031001310023100331004310053100631007310083100931010310113101231013310143101531016310173101831019310203102131022310233102431025310263102731028310293103031031310323103331034310353103631037310383103931040310413104231043310443104531046310473104831049310503105131052310533105431055310563105731058310593106031061310623106331064310653106631067310683106931070310713107231073310743107531076310773107831079310803108131082310833108431085310863108731088310893109031091310923109331094310953109631097310983109931100311013110231103311043110531106311073110831109311103111131112311133111431115311163111731118311193112031121311223112331124311253112631127311283112931130311313113231133311343113531136311373113831139311403114131142311433114431145311463114731148311493115031151311523115331154311553115631157311583115931160311613116231163311643116531166311673116831169311703117131172311733117431175311763117731178311793118031181311823118331184311853118631187311883118931190311913119231193311943119531196311973119831199312003120131202312033120431205312063120731208312093121031211312123121331214312153121631217312183121931220312213122231223312243122531226312273122831229312303123131232312333123431235312363123731238312393124031241312423124331244312453124631247312483124931250312513125231253312543125531256312573125831259312603126131262312633126431265312663126731268312693127031271312723127331274312753127631277312783127931280312813128231283312843128531286312873128831289312903129131292312933129431295312963129731298312993130031301313023130331304313053130631307313083130931310313113131231313313143131531316313173131831319313203132131322313233132431325313263132731328313293133031331313323133331334313353133631337313383133931340313413134231343313443134531346313473134831349313503135131352313533135431355313563135731358313593136031361313623136331364313653136631367313683136931370313713137231373313743137531376313773137831379313803138131382313833138431385313863138731388313893139031391313923139331394313953139631397313983139931400314013140231403314043140531406314073140831409314103141131412314133141431415314163141731418314193142031421314223142331424314253142631427314283142931430314313143231433314343143531436314373143831439314403144131442314433144431445314463144731448314493145031451314523145331454314553145631457314583145931460314613146231463314643146531466314673146831469314703147131472314733147431475314763147731478314793148031481314823148331484314853148631487314883148931490314913149231493314943149531496314973149831499315003150131502315033150431505315063150731508315093151031511315123151331514315153151631517315183151931520315213152231523315243152531526315273152831529315303153131532315333153431535315363153731538315393154031541315423154331544315453154631547315483154931550315513155231553315543155531556315573155831559315603156131562315633156431565315663156731568315693157031571315723157331574315753157631577315783157931580315813158231583315843158531586315873158831589315903159131592315933159431595315963159731598315993160031601316023160331604316053160631607316083160931610316113161231613316143161531616316173161831619316203162131622316233162431625316263162731628316293163031631316323163331634316353163631637316383163931640316413164231643316443164531646316473164831649316503165131652316533165431655316563165731658316593166031661316623166331664316653166631667316683166931670316713167231673316743167531676316773167831679316803168131682316833168431685316863168731688316893169031691316923169331694316953169631697316983169931700317013170231703317043170531706317073170831709317103171131712317133171431715317163171731718317193172031721317223172331724317253172631727317283172931730317313173231733317343173531736317373173831739317403174131742317433174431745317463174731748317493175031751317523175331754317553175631757317583175931760317613176231763317643176531766317673176831769317703177131772317733177431775317763177731778317793178031781317823178331784317853178631787317883178931790317913179231793317943179531796317973179831799318003180131802318033180431805318063180731808318093181031811318123181331814318153181631817318183181931820318213182231823318243182531826318273182831829318303183131832318333183431835318363183731838318393184031841318423184331844318453184631847318483184931850318513185231853318543185531856318573185831859318603186131862318633186431865318663186731868318693187031871318723187331874318753187631877318783187931880318813188231883318843188531886318873188831889318903189131892318933189431895318963189731898318993190031901319023190331904319053190631907319083190931910319113191231913319143191531916319173191831919319203192131922319233192431925319263192731928319293193031931319323193331934319353193631937319383193931940319413194231943319443194531946319473194831949319503195131952319533195431955319563195731958319593196031961319623196331964319653196631967319683196931970319713197231973319743197531976319773197831979319803198131982319833198431985319863198731988319893199031991319923199331994319953199631997319983199932000320013200232003320043200532006320073200832009320103201132012320133201432015320163201732018320193202032021320223202332024320253202632027320283202932030320313203232033320343203532036320373203832039320403204132042320433204432045320463204732048320493205032051320523205332054320553205632057320583205932060320613206232063320643206532066320673206832069320703207132072320733207432075320763207732078320793208032081320823208332084320853208632087320883208932090320913209232093320943209532096320973209832099321003210132102321033210432105321063210732108321093211032111321123211332114321153211632117321183211932120321213212232123321243212532126321273212832129321303213132132321333213432135321363213732138321393214032141321423214332144321453214632147321483214932150321513215232153321543215532156321573215832159321603216132162321633216432165321663216732168321693217032171321723217332174321753217632177321783217932180321813218232183321843218532186321873218832189321903219132192321933219432195321963219732198321993220032201322023220332204322053220632207322083220932210322113221232213322143221532216322173221832219322203222132222322233222432225322263222732228322293223032231322323223332234322353223632237322383223932240322413224232243322443224532246322473224832249322503225132252322533225432255322563225732258322593226032261322623226332264322653226632267322683226932270322713227232273322743227532276322773227832279322803228132282322833228432285322863228732288322893229032291322923229332294322953229632297322983229932300323013230232303323043230532306323073230832309323103231132312323133231432315323163231732318323193232032321323223232332324323253232632327323283232932330323313233232333323343233532336323373233832339323403234132342323433234432345323463234732348323493235032351323523235332354323553235632357323583235932360323613236232363323643236532366323673236832369323703237132372323733237432375323763237732378323793238032381323823238332384323853238632387323883238932390323913239232393323943239532396323973239832399324003240132402324033240432405324063240732408324093241032411324123241332414324153241632417324183241932420324213242232423324243242532426324273242832429324303243132432324333243432435324363243732438324393244032441324423244332444324453244632447324483244932450324513245232453324543245532456324573245832459324603246132462324633246432465324663246732468324693247032471324723247332474324753247632477324783247932480324813248232483324843248532486324873248832489324903249132492324933249432495324963249732498324993250032501325023250332504325053250632507325083250932510325113251232513325143251532516325173251832519325203252132522325233252432525325263252732528325293253032531325323253332534325353253632537325383253932540325413254232543325443254532546325473254832549325503255132552325533255432555325563255732558325593256032561325623256332564325653256632567325683256932570325713257232573325743257532576325773257832579325803258132582325833258432585325863258732588325893259032591325923259332594325953259632597325983259932600326013260232603326043260532606326073260832609326103261132612326133261432615326163261732618326193262032621326223262332624326253262632627326283262932630326313263232633326343263532636326373263832639326403264132642326433264432645326463264732648326493265032651326523265332654326553265632657326583265932660326613266232663326643266532666326673266832669326703267132672326733267432675326763267732678326793268032681326823268332684326853268632687326883268932690326913269232693326943269532696326973269832699327003270132702327033270432705327063270732708327093271032711327123271332714327153271632717327183271932720327213272232723327243272532726327273272832729327303273132732327333273432735327363273732738327393274032741327423274332744327453274632747327483274932750327513275232753327543275532756327573275832759327603276132762327633276432765327663276732768327693277032771327723277332774327753277632777327783277932780327813278232783327843278532786327873278832789327903279132792327933279432795327963279732798327993280032801328023280332804328053280632807328083280932810328113281232813328143281532816328173281832819328203282132822328233282432825328263282732828328293283032831328323283332834328353283632837328383283932840328413284232843328443284532846328473284832849328503285132852328533285432855328563285732858328593286032861328623286332864328653286632867328683286932870328713287232873328743287532876328773287832879328803288132882328833288432885328863288732888328893289032891328923289332894328953289632897328983289932900329013290232903329043290532906329073290832909329103291132912329133291432915329163291732918329193292032921329223292332924329253292632927329283292932930329313293232933329343293532936329373293832939329403294132942329433294432945329463294732948329493295032951329523295332954329553295632957329583295932960329613296232963329643296532966329673296832969329703297132972329733297432975329763297732978329793298032981329823298332984329853298632987329883298932990329913299232993329943299532996329973299832999330003300133002330033300433005330063300733008330093301033011330123301333014330153301633017330183301933020330213302233023330243302533026330273302833029330303303133032330333303433035330363303733038330393304033041330423304333044330453304633047330483304933050330513305233053330543305533056330573305833059330603306133062330633306433065330663306733068330693307033071330723307333074330753307633077330783307933080330813308233083330843308533086330873308833089330903309133092330933309433095330963309733098330993310033101331023310333104331053310633107331083310933110331113311233113331143311533116331173311833119331203312133122331233312433125331263312733128331293313033131331323313333134331353313633137331383313933140331413314233143331443314533146331473314833149331503315133152331533315433155331563315733158331593316033161331623316333164331653316633167331683316933170331713317233173331743317533176331773317833179331803318133182331833318433185331863318733188331893319033191331923319333194331953319633197331983319933200332013320233203332043320533206332073320833209332103321133212332133321433215332163321733218332193322033221332223322333224332253322633227332283322933230332313323233233332343323533236332373323833239332403324133242332433324433245332463324733248332493325033251332523325333254332553325633257332583325933260332613326233263332643326533266332673326833269332703327133272332733327433275332763327733278332793328033281332823328333284332853328633287332883328933290332913329233293332943329533296332973329833299333003330133302333033330433305333063330733308333093331033311333123331333314333153331633317333183331933320333213332233323333243332533326333273332833329333303333133332333333333433335333363333733338333393334033341333423334333344333453334633347333483334933350333513335233353333543335533356333573335833359333603336133362333633336433365333663336733368333693337033371333723337333374333753337633377333783337933380333813338233383333843338533386333873338833389333903339133392333933339433395333963339733398333993340033401334023340333404334053340633407334083340933410334113341233413334143341533416334173341833419334203342133422334233342433425334263342733428334293343033431334323343333434334353343633437334383343933440334413344233443334443344533446334473344833449334503345133452334533345433455334563345733458334593346033461334623346333464334653346633467334683346933470334713347233473334743347533476334773347833479334803348133482334833348433485334863348733488334893349033491334923349333494334953349633497334983349933500335013350233503335043350533506335073350833509335103351133512335133351433515335163351733518335193352033521335223352333524335253352633527335283352933530335313353233533335343353533536335373353833539335403354133542335433354433545335463354733548335493355033551335523355333554335553355633557335583355933560335613356233563335643356533566335673356833569335703357133572335733357433575335763357733578335793358033581335823358333584335853358633587335883358933590335913359233593335943359533596335973359833599336003360133602336033360433605336063360733608336093361033611336123361333614336153361633617336183361933620336213362233623336243362533626336273362833629336303363133632336333363433635336363363733638336393364033641336423364333644336453364633647336483364933650336513365233653336543365533656336573365833659336603366133662336633366433665336663366733668336693367033671336723367333674336753367633677336783367933680336813368233683336843368533686336873368833689336903369133692336933369433695336963369733698336993370033701337023370333704337053370633707337083370933710337113371233713337143371533716337173371833719337203372133722337233372433725337263372733728337293373033731337323373333734337353373633737337383373933740337413374233743337443374533746337473374833749337503375133752337533375433755337563375733758337593376033761337623376333764337653376633767337683376933770337713377233773337743377533776337773377833779337803378133782337833378433785337863378733788337893379033791337923379333794337953379633797337983379933800338013380233803338043380533806338073380833809338103381133812338133381433815338163381733818338193382033821338223382333824338253382633827338283382933830338313383233833338343383533836338373383833839338403384133842338433384433845338463384733848338493385033851338523385333854338553385633857338583385933860338613386233863338643386533866338673386833869338703387133872338733387433875338763387733878338793388033881338823388333884338853388633887338883388933890338913389233893338943389533896338973389833899339003390133902339033390433905339063390733908339093391033911339123391333914339153391633917339183391933920339213392233923339243392533926339273392833929339303393133932339333393433935339363393733938339393394033941339423394333944339453394633947339483394933950339513395233953339543395533956339573395833959339603396133962339633396433965339663396733968339693397033971339723397333974339753397633977339783397933980339813398233983339843398533986339873398833989339903399133992339933399433995339963399733998339993400034001340023400334004340053400634007340083400934010340113401234013340143401534016340173401834019340203402134022340233402434025340263402734028340293403034031340323403334034340353403634037340383403934040340413404234043340443404534046340473404834049340503405134052340533405434055340563405734058340593406034061340623406334064340653406634067340683406934070340713407234073340743407534076340773407834079340803408134082340833408434085340863408734088340893409034091340923409334094340953409634097340983409934100341013410234103341043410534106341073410834109341103411134112341133411434115341163411734118341193412034121341223412334124341253412634127341283412934130341313413234133341343413534136341373413834139341403414134142341433414434145341463414734148341493415034151341523415334154341553415634157341583415934160341613416234163341643416534166341673416834169341703417134172341733417434175341763417734178341793418034181341823418334184341853418634187341883418934190341913419234193341943419534196341973419834199342003420134202342033420434205342063420734208342093421034211342123421334214342153421634217342183421934220342213422234223342243422534226342273422834229342303423134232342333423434235342363423734238342393424034241342423424334244342453424634247342483424934250342513425234253342543425534256342573425834259342603426134262342633426434265342663426734268342693427034271342723427334274342753427634277342783427934280342813428234283342843428534286342873428834289342903429134292342933429434295342963429734298342993430034301343023430334304343053430634307343083430934310343113431234313343143431534316343173431834319343203432134322343233432434325343263432734328343293433034331343323433334334343353433634337343383433934340343413434234343343443434534346343473434834349343503435134352343533435434355343563435734358343593436034361343623436334364343653436634367343683436934370343713437234373343743437534376343773437834379343803438134382343833438434385343863438734388343893439034391343923439334394343953439634397343983439934400344013440234403344043440534406344073440834409344103441134412344133441434415344163441734418344193442034421344223442334424344253442634427344283442934430344313443234433344343443534436344373443834439344403444134442344433444434445344463444734448344493445034451344523445334454344553445634457344583445934460344613446234463344643446534466344673446834469344703447134472344733447434475344763447734478344793448034481344823448334484344853448634487344883448934490344913449234493344943449534496344973449834499345003450134502345033450434505345063450734508345093451034511345123451334514345153451634517345183451934520345213452234523345243452534526345273452834529345303453134532345333453434535345363453734538345393454034541345423454334544345453454634547345483454934550345513455234553345543455534556345573455834559345603456134562345633456434565345663456734568345693457034571345723457334574345753457634577345783457934580345813458234583345843458534586345873458834589345903459134592345933459434595345963459734598345993460034601346023460334604346053460634607346083460934610346113461234613346143461534616346173461834619346203462134622346233462434625346263462734628346293463034631346323463334634346353463634637346383463934640346413464234643346443464534646346473464834649346503465134652346533465434655346563465734658346593466034661346623466334664346653466634667346683466934670346713467234673346743467534676346773467834679346803468134682346833468434685346863468734688346893469034691346923469334694346953469634697346983469934700347013470234703347043470534706347073470834709347103471134712347133471434715347163471734718347193472034721347223472334724347253472634727347283472934730347313473234733347343473534736347373473834739347403474134742347433474434745347463474734748347493475034751347523475334754347553475634757347583475934760347613476234763347643476534766347673476834769347703477134772347733477434775347763477734778347793478034781347823478334784347853478634787347883478934790347913479234793347943479534796347973479834799348003480134802348033480434805348063480734808348093481034811348123481334814348153481634817348183481934820348213482234823348243482534826348273482834829348303483134832348333483434835348363483734838348393484034841348423484334844348453484634847348483484934850348513485234853348543485534856348573485834859348603486134862348633486434865348663486734868348693487034871348723487334874348753487634877348783487934880348813488234883348843488534886348873488834889348903489134892348933489434895348963489734898348993490034901349023490334904349053490634907349083490934910349113491234913349143491534916349173491834919349203492134922349233492434925349263492734928349293493034931349323493334934349353493634937349383493934940349413494234943349443494534946349473494834949349503495134952349533495434955349563495734958349593496034961349623496334964349653496634967349683496934970349713497234973349743497534976349773497834979349803498134982349833498434985349863498734988349893499034991349923499334994349953499634997349983499935000350013500235003350043500535006350073500835009350103501135012350133501435015350163501735018350193502035021350223502335024350253502635027350283502935030350313503235033350343503535036350373503835039350403504135042350433504435045350463504735048350493505035051350523505335054350553505635057350583505935060350613506235063350643506535066350673506835069350703507135072350733507435075350763507735078350793508035081350823508335084350853508635087350883508935090350913509235093350943509535096350973509835099351003510135102351033510435105351063510735108351093511035111351123511335114351153511635117351183511935120351213512235123351243512535126351273512835129351303513135132351333513435135351363513735138351393514035141351423514335144351453514635147351483514935150351513515235153351543515535156351573515835159351603516135162351633516435165351663516735168351693517035171351723517335174351753517635177351783517935180351813518235183351843518535186351873518835189351903519135192351933519435195351963519735198351993520035201352023520335204352053520635207352083520935210352113521235213352143521535216352173521835219352203522135222352233522435225352263522735228352293523035231352323523335234352353523635237352383523935240352413524235243352443524535246352473524835249352503525135252352533525435255352563525735258352593526035261352623526335264352653526635267352683526935270352713527235273352743527535276352773527835279352803528135282352833528435285352863528735288352893529035291352923529335294352953529635297352983529935300353013530235303353043530535306353073530835309353103531135312353133531435315353163531735318353193532035321353223532335324353253532635327353283532935330353313533235333353343533535336353373533835339353403534135342353433534435345353463534735348353493535035351353523535335354353553535635357353583535935360353613536235363353643536535366353673536835369353703537135372353733537435375353763537735378353793538035381353823538335384353853538635387353883538935390353913539235393353943539535396353973539835399354003540135402354033540435405354063540735408354093541035411354123541335414354153541635417354183541935420354213542235423354243542535426354273542835429354303543135432354333543435435354363543735438354393544035441354423544335444354453544635447354483544935450354513545235453354543545535456354573545835459354603546135462354633546435465354663546735468354693547035471354723547335474354753547635477354783547935480354813548235483354843548535486354873548835489354903549135492354933549435495354963549735498354993550035501355023550335504355053550635507355083550935510355113551235513355143551535516355173551835519355203552135522355233552435525355263552735528355293553035531355323553335534355353553635537355383553935540355413554235543355443554535546355473554835549355503555135552355533555435555355563555735558355593556035561355623556335564355653556635567355683556935570355713557235573355743557535576355773557835579355803558135582355833558435585355863558735588355893559035591355923559335594355953559635597355983559935600356013560235603356043560535606356073560835609356103561135612356133561435615356163561735618356193562035621356223562335624356253562635627356283562935630356313563235633356343563535636356373563835639356403564135642356433564435645356463564735648356493565035651356523565335654356553565635657356583565935660356613566235663356643566535666356673566835669356703567135672356733567435675356763567735678356793568035681356823568335684356853568635687356883568935690356913569235693356943569535696356973569835699357003570135702357033570435705357063570735708357093571035711357123571335714357153571635717357183571935720357213572235723357243572535726357273572835729357303573135732357333573435735357363573735738357393574035741357423574335744357453574635747357483574935750357513575235753357543575535756357573575835759357603576135762357633576435765357663576735768357693577035771357723577335774357753577635777357783577935780357813578235783357843578535786357873578835789357903579135792357933579435795357963579735798357993580035801358023580335804358053580635807358083580935810358113581235813358143581535816358173581835819358203582135822358233582435825358263582735828358293583035831358323583335834358353583635837358383583935840358413584235843358443584535846358473584835849358503585135852358533585435855358563585735858358593586035861358623586335864358653586635867358683586935870358713587235873358743587535876358773587835879358803588135882358833588435885358863588735888358893589035891358923589335894358953589635897358983589935900359013590235903359043590535906359073590835909359103591135912359133591435915359163591735918359193592035921359223592335924359253592635927359283592935930359313593235933359343593535936359373593835939359403594135942359433594435945359463594735948359493595035951359523595335954359553595635957359583595935960359613596235963359643596535966359673596835969359703597135972359733597435975359763597735978359793598035981359823598335984359853598635987359883598935990359913599235993359943599535996359973599835999360003600136002360033600436005360063600736008360093601036011360123601336014360153601636017360183601936020360213602236023360243602536026360273602836029360303603136032360333603436035360363603736038360393604036041360423604336044360453604636047360483604936050360513605236053360543605536056360573605836059360603606136062360633606436065360663606736068360693607036071360723607336074360753607636077360783607936080360813608236083360843608536086360873608836089360903609136092360933609436095360963609736098360993610036101361023610336104361053610636107361083610936110361113611236113361143611536116361173611836119361203612136122361233612436125361263612736128361293613036131361323613336134361353613636137361383613936140361413614236143361443614536146361473614836149361503615136152361533615436155361563615736158361593616036161361623616336164361653616636167361683616936170361713617236173361743617536176361773617836179361803618136182361833618436185361863618736188361893619036191361923619336194361953619636197361983619936200362013620236203362043620536206362073620836209362103621136212362133621436215362163621736218362193622036221362223622336224362253622636227362283622936230362313623236233362343623536236362373623836239362403624136242362433624436245362463624736248362493625036251362523625336254362553625636257362583625936260362613626236263362643626536266362673626836269362703627136272362733627436275362763627736278362793628036281362823628336284362853628636287362883628936290362913629236293362943629536296362973629836299363003630136302363033630436305363063630736308363093631036311363123631336314363153631636317363183631936320363213632236323363243632536326363273632836329363303633136332363333633436335363363633736338363393634036341363423634336344363453634636347363483634936350363513635236353363543635536356363573635836359363603636136362363633636436365363663636736368363693637036371363723637336374363753637636377363783637936380363813638236383363843638536386363873638836389363903639136392363933639436395363963639736398363993640036401364023640336404364053640636407364083640936410364113641236413364143641536416364173641836419364203642136422364233642436425364263642736428364293643036431364323643336434364353643636437364383643936440364413644236443364443644536446364473644836449364503645136452364533645436455364563645736458364593646036461364623646336464364653646636467364683646936470364713647236473364743647536476364773647836479364803648136482364833648436485364863648736488364893649036491364923649336494364953649636497364983649936500365013650236503365043650536506365073650836509365103651136512365133651436515365163651736518365193652036521365223652336524365253652636527365283652936530365313653236533365343653536536365373653836539365403654136542365433654436545365463654736548365493655036551365523655336554365553655636557365583655936560365613656236563365643656536566365673656836569365703657136572365733657436575365763657736578365793658036581365823658336584365853658636587365883658936590365913659236593365943659536596365973659836599366003660136602366033660436605366063660736608366093661036611366123661336614366153661636617366183661936620366213662236623366243662536626366273662836629366303663136632366333663436635366363663736638366393664036641366423664336644366453664636647366483664936650366513665236653366543665536656366573665836659366603666136662366633666436665366663666736668366693667036671366723667336674366753667636677366783667936680366813668236683366843668536686366873668836689366903669136692366933669436695366963669736698366993670036701367023670336704367053670636707367083670936710367113671236713367143671536716367173671836719367203672136722367233672436725367263672736728367293673036731367323673336734367353673636737367383673936740367413674236743367443674536746367473674836749367503675136752367533675436755367563675736758367593676036761367623676336764367653676636767367683676936770367713677236773367743677536776367773677836779367803678136782367833678436785367863678736788367893679036791367923679336794367953679636797367983679936800368013680236803368043680536806368073680836809368103681136812368133681436815368163681736818368193682036821368223682336824368253682636827368283682936830368313683236833368343683536836368373683836839368403684136842368433684436845368463684736848368493685036851368523685336854368553685636857368583685936860368613686236863368643686536866368673686836869368703687136872368733687436875368763687736878368793688036881368823688336884368853688636887368883688936890368913689236893368943689536896368973689836899369003690136902369033690436905369063690736908369093691036911369123691336914369153691636917369183691936920369213692236923369243692536926369273692836929369303693136932369333693436935369363693736938369393694036941369423694336944369453694636947369483694936950369513695236953369543695536956369573695836959369603696136962369633696436965369663696736968369693697036971369723697336974369753697636977369783697936980369813698236983369843698536986369873698836989369903699136992369933699436995369963699736998369993700037001370023700337004370053700637007370083700937010370113701237013370143701537016370173701837019370203702137022370233702437025370263702737028370293703037031370323703337034370353703637037370383703937040370413704237043370443704537046370473704837049370503705137052370533705437055370563705737058370593706037061370623706337064370653706637067370683706937070370713707237073370743707537076370773707837079370803708137082370833708437085370863708737088370893709037091370923709337094370953709637097370983709937100371013710237103371043710537106371073710837109371103711137112371133711437115371163711737118371193712037121371223712337124371253712637127371283712937130371313713237133371343713537136371373713837139371403714137142371433714437145371463714737148371493715037151371523715337154371553715637157371583715937160371613716237163371643716537166371673716837169371703717137172371733717437175371763717737178371793718037181371823718337184371853718637187371883718937190371913719237193371943719537196371973719837199372003720137202372033720437205372063720737208372093721037211372123721337214372153721637217372183721937220372213722237223372243722537226372273722837229372303723137232372333723437235372363723737238372393724037241372423724337244372453724637247372483724937250372513725237253372543725537256372573725837259372603726137262372633726437265372663726737268372693727037271372723727337274372753727637277372783727937280372813728237283372843728537286372873728837289372903729137292372933729437295372963729737298372993730037301373023730337304373053730637307373083730937310373113731237313373143731537316373173731837319373203732137322373233732437325373263732737328373293733037331373323733337334373353733637337373383733937340373413734237343373443734537346373473734837349373503735137352373533735437355373563735737358373593736037361373623736337364373653736637367373683736937370373713737237373373743737537376373773737837379373803738137382373833738437385373863738737388373893739037391373923739337394373953739637397373983739937400374013740237403374043740537406374073740837409374103741137412374133741437415374163741737418374193742037421374223742337424374253742637427374283742937430374313743237433374343743537436374373743837439374403744137442374433744437445374463744737448374493745037451374523745337454374553745637457374583745937460374613746237463374643746537466374673746837469374703747137472374733747437475374763747737478374793748037481374823748337484374853748637487374883748937490374913749237493374943749537496374973749837499375003750137502375033750437505375063750737508375093751037511375123751337514375153751637517375183751937520375213752237523375243752537526375273752837529375303753137532375333753437535375363753737538375393754037541375423754337544375453754637547375483754937550375513755237553375543755537556375573755837559375603756137562375633756437565375663756737568375693757037571375723757337574375753757637577375783757937580375813758237583375843758537586375873758837589375903759137592375933759437595375963759737598375993760037601376023760337604376053760637607376083760937610376113761237613376143761537616376173761837619376203762137622376233762437625376263762737628376293763037631376323763337634376353763637637376383763937640376413764237643376443764537646376473764837649376503765137652376533765437655376563765737658376593766037661376623766337664376653766637667376683766937670376713767237673376743767537676376773767837679376803768137682376833768437685376863768737688376893769037691376923769337694376953769637697376983769937700377013770237703377043770537706377073770837709377103771137712377133771437715377163771737718377193772037721377223772337724377253772637727377283772937730377313773237733377343773537736377373773837739377403774137742377433774437745377463774737748377493775037751377523775337754377553775637757377583775937760377613776237763377643776537766377673776837769377703777137772377733777437775377763777737778377793778037781377823778337784377853778637787377883778937790377913779237793377943779537796377973779837799378003780137802378033780437805378063780737808378093781037811378123781337814378153781637817378183781937820378213782237823378243782537826378273782837829378303783137832378333783437835378363783737838378393784037841378423784337844378453784637847378483784937850378513785237853378543785537856378573785837859378603786137862378633786437865378663786737868378693787037871378723787337874378753787637877378783787937880378813788237883378843788537886378873788837889378903789137892378933789437895378963789737898378993790037901379023790337904379053790637907379083790937910379113791237913379143791537916379173791837919379203792137922379233792437925379263792737928379293793037931379323793337934379353793637937379383793937940379413794237943379443794537946379473794837949379503795137952379533795437955379563795737958379593796037961379623796337964379653796637967379683796937970379713797237973379743797537976379773797837979379803798137982379833798437985379863798737988379893799037991379923799337994379953799637997379983799938000380013800238003380043800538006380073800838009380103801138012380133801438015380163801738018380193802038021380223802338024380253802638027380283802938030380313803238033380343803538036380373803838039380403804138042380433804438045380463804738048380493805038051380523805338054380553805638057380583805938060380613806238063380643806538066380673806838069380703807138072380733807438075380763807738078380793808038081380823808338084380853808638087380883808938090380913809238093380943809538096380973809838099381003810138102381033810438105381063810738108381093811038111381123811338114381153811638117381183811938120381213812238123381243812538126381273812838129381303813138132381333813438135381363813738138381393814038141381423814338144381453814638147381483814938150381513815238153381543815538156381573815838159381603816138162381633816438165381663816738168381693817038171381723817338174381753817638177381783817938180381813818238183381843818538186381873818838189381903819138192381933819438195381963819738198381993820038201382023820338204382053820638207382083820938210382113821238213382143821538216382173821838219382203822138222382233822438225382263822738228382293823038231382323823338234382353823638237382383823938240382413824238243382443824538246382473824838249382503825138252382533825438255382563825738258382593826038261382623826338264382653826638267382683826938270382713827238273382743827538276382773827838279382803828138282382833828438285382863828738288382893829038291382923829338294382953829638297382983829938300383013830238303383043830538306383073830838309383103831138312383133831438315383163831738318383193832038321383223832338324383253832638327383283832938330383313833238333383343833538336383373833838339383403834138342383433834438345383463834738348383493835038351383523835338354383553835638357383583835938360383613836238363383643836538366383673836838369383703837138372383733837438375383763837738378383793838038381383823838338384383853838638387383883838938390383913839238393383943839538396383973839838399384003840138402384033840438405384063840738408384093841038411384123841338414384153841638417384183841938420384213842238423384243842538426384273842838429384303843138432384333843438435384363843738438384393844038441384423844338444384453844638447384483844938450384513845238453384543845538456384573845838459384603846138462384633846438465384663846738468384693847038471384723847338474384753847638477384783847938480384813848238483384843848538486384873848838489384903849138492384933849438495384963849738498384993850038501385023850338504385053850638507385083850938510385113851238513385143851538516385173851838519385203852138522385233852438525385263852738528385293853038531385323853338534385353853638537385383853938540385413854238543385443854538546385473854838549385503855138552385533855438555385563855738558385593856038561385623856338564385653856638567385683856938570385713857238573385743857538576385773857838579385803858138582385833858438585385863858738588385893859038591385923859338594385953859638597385983859938600386013860238603386043860538606386073860838609386103861138612386133861438615386163861738618386193862038621386223862338624386253862638627386283862938630386313863238633386343863538636386373863838639386403864138642386433864438645386463864738648386493865038651386523865338654386553865638657386583865938660386613866238663386643866538666386673866838669386703867138672386733867438675386763867738678386793868038681386823868338684386853868638687386883868938690386913869238693386943869538696386973869838699387003870138702387033870438705387063870738708387093871038711387123871338714387153871638717387183871938720387213872238723387243872538726387273872838729387303873138732387333873438735387363873738738387393874038741387423874338744387453874638747387483874938750387513875238753387543875538756387573875838759387603876138762387633876438765387663876738768387693877038771387723877338774387753877638777387783877938780387813878238783387843878538786387873878838789387903879138792387933879438795387963879738798387993880038801388023880338804388053880638807388083880938810388113881238813388143881538816388173881838819388203882138822388233882438825388263882738828388293883038831388323883338834388353883638837388383883938840388413884238843388443884538846388473884838849388503885138852388533885438855388563885738858388593886038861388623886338864388653886638867388683886938870388713887238873388743887538876388773887838879388803888138882388833888438885388863888738888388893889038891388923889338894388953889638897388983889938900389013890238903389043890538906389073890838909389103891138912389133891438915389163891738918389193892038921389223892338924389253892638927389283892938930389313893238933389343893538936389373893838939389403894138942389433894438945389463894738948389493895038951389523895338954389553895638957389583895938960389613896238963389643896538966389673896838969389703897138972389733897438975389763897738978389793898038981389823898338984389853898638987389883898938990389913899238993389943899538996389973899838999390003900139002390033900439005390063900739008390093901039011390123901339014390153901639017390183901939020390213902239023390243902539026390273902839029390303903139032390333903439035390363903739038390393904039041390423904339044390453904639047390483904939050390513905239053390543905539056390573905839059390603906139062390633906439065390663906739068390693907039071390723907339074390753907639077390783907939080390813908239083390843908539086390873908839089390903909139092390933909439095390963909739098390993910039101391023910339104391053910639107391083910939110391113911239113391143911539116391173911839119391203912139122391233912439125391263912739128391293913039131391323913339134391353913639137391383913939140391413914239143391443914539146391473914839149391503915139152391533915439155391563915739158391593916039161391623916339164391653916639167391683916939170391713917239173391743917539176391773917839179391803918139182391833918439185391863918739188391893919039191391923919339194391953919639197391983919939200392013920239203392043920539206392073920839209392103921139212392133921439215392163921739218392193922039221392223922339224392253922639227392283922939230392313923239233392343923539236392373923839239392403924139242392433924439245392463924739248392493925039251392523925339254392553925639257392583925939260392613926239263392643926539266392673926839269392703927139272392733927439275392763927739278392793928039281392823928339284392853928639287392883928939290392913929239293392943929539296392973929839299393003930139302393033930439305393063930739308393093931039311393123931339314393153931639317393183931939320393213932239323393243932539326393273932839329393303933139332393333933439335393363933739338393393934039341393423934339344393453934639347393483934939350393513935239353393543935539356393573935839359393603936139362393633936439365393663936739368393693937039371393723937339374393753937639377393783937939380393813938239383393843938539386393873938839389393903939139392393933939439395393963939739398393993940039401394023940339404394053940639407394083940939410394113941239413394143941539416394173941839419394203942139422394233942439425394263942739428394293943039431394323943339434394353943639437394383943939440394413944239443394443944539446394473944839449394503945139452394533945439455394563945739458394593946039461394623946339464394653946639467394683946939470394713947239473394743947539476394773947839479394803948139482394833948439485394863948739488394893949039491394923949339494394953949639497394983949939500395013950239503395043950539506395073950839509395103951139512395133951439515395163951739518395193952039521395223952339524395253952639527395283952939530395313953239533395343953539536395373953839539395403954139542395433954439545395463954739548395493955039551395523955339554395553955639557395583955939560395613956239563395643956539566395673956839569395703957139572395733957439575395763957739578395793958039581395823958339584395853958639587395883958939590395913959239593395943959539596395973959839599396003960139602396033960439605396063960739608396093961039611396123961339614396153961639617396183961939620396213962239623396243962539626396273962839629396303963139632396333963439635396363963739638396393964039641396423964339644396453964639647396483964939650396513965239653396543965539656396573965839659396603966139662396633966439665396663966739668396693967039671396723967339674396753967639677396783967939680396813968239683396843968539686396873968839689396903969139692396933969439695396963969739698396993970039701397023970339704397053970639707397083970939710397113971239713397143971539716397173971839719397203972139722397233972439725397263972739728397293973039731397323973339734397353973639737397383973939740397413974239743397443974539746397473974839749397503975139752397533975439755397563975739758397593976039761397623976339764397653976639767397683976939770397713977239773397743977539776397773977839779397803978139782397833978439785397863978739788397893979039791397923979339794397953979639797397983979939800398013980239803398043980539806398073980839809398103981139812398133981439815398163981739818398193982039821398223982339824398253982639827398283982939830398313983239833398343983539836398373983839839398403984139842398433984439845398463984739848398493985039851398523985339854398553985639857398583985939860398613986239863398643986539866398673986839869398703987139872398733987439875398763987739878398793988039881398823988339884398853988639887398883988939890398913989239893398943989539896398973989839899399003990139902399033990439905399063990739908399093991039911399123991339914399153991639917399183991939920399213992239923399243992539926399273992839929399303993139932399333993439935399363993739938399393994039941399423994339944399453994639947399483994939950399513995239953399543995539956399573995839959399603996139962399633996439965399663996739968399693997039971399723997339974399753997639977399783997939980399813998239983399843998539986399873998839989399903999139992399933999439995399963999739998399994000040001400024000340004400054000640007400084000940010400114001240013400144001540016400174001840019400204002140022400234002440025400264002740028400294003040031400324003340034400354003640037400384003940040400414004240043400444004540046400474004840049400504005140052400534005440055400564005740058400594006040061400624006340064400654006640067400684006940070400714007240073400744007540076400774007840079400804008140082400834008440085400864008740088400894009040091400924009340094400954009640097400984009940100401014010240103401044010540106401074010840109401104011140112401134011440115401164011740118401194012040121401224012340124401254012640127401284012940130401314013240133401344013540136401374013840139401404014140142401434014440145401464014740148401494015040151401524015340154401554015640157401584015940160401614016240163401644016540166401674016840169401704017140172401734017440175401764017740178401794018040181401824018340184401854018640187401884018940190401914019240193401944019540196401974019840199402004020140202402034020440205402064020740208402094021040211402124021340214402154021640217402184021940220402214022240223402244022540226402274022840229402304023140232402334023440235402364023740238402394024040241402424024340244402454024640247402484024940250402514025240253402544025540256402574025840259402604026140262402634026440265402664026740268402694027040271402724027340274402754027640277402784027940280402814028240283402844028540286402874028840289402904029140292402934029440295402964029740298402994030040301403024030340304403054030640307403084030940310403114031240313403144031540316403174031840319403204032140322403234032440325403264032740328403294033040331403324033340334403354033640337403384033940340403414034240343403444034540346403474034840349403504035140352403534035440355403564035740358403594036040361403624036340364403654036640367403684036940370403714037240373403744037540376403774037840379403804038140382403834038440385403864038740388403894039040391403924039340394403954039640397403984039940400404014040240403404044040540406404074040840409404104041140412404134041440415404164041740418404194042040421404224042340424404254042640427404284042940430404314043240433404344043540436404374043840439404404044140442404434044440445404464044740448404494045040451404524045340454404554045640457404584045940460404614046240463404644046540466404674046840469404704047140472404734047440475404764047740478404794048040481404824048340484404854048640487404884048940490404914049240493404944049540496404974049840499405004050140502405034050440505405064050740508405094051040511405124051340514405154051640517405184051940520405214052240523405244052540526405274052840529405304053140532405334053440535405364053740538405394054040541405424054340544405454054640547405484054940550405514055240553405544055540556405574055840559405604056140562405634056440565405664056740568405694057040571405724057340574405754057640577405784057940580405814058240583405844058540586405874058840589405904059140592405934059440595405964059740598405994060040601406024060340604406054060640607406084060940610406114061240613406144061540616406174061840619406204062140622406234062440625406264062740628406294063040631406324063340634406354063640637406384063940640406414064240643406444064540646406474064840649406504065140652406534065440655406564065740658406594066040661406624066340664406654066640667406684066940670406714067240673406744067540676406774067840679406804068140682406834068440685406864068740688406894069040691406924069340694406954069640697406984069940700407014070240703407044070540706407074070840709407104071140712407134071440715407164071740718407194072040721407224072340724407254072640727407284072940730407314073240733407344073540736407374073840739407404074140742407434074440745407464074740748407494075040751407524075340754407554075640757407584075940760407614076240763407644076540766407674076840769407704077140772407734077440775407764077740778407794078040781407824078340784407854078640787407884078940790407914079240793407944079540796407974079840799408004080140802408034080440805408064080740808408094081040811408124081340814408154081640817408184081940820408214082240823408244082540826408274082840829408304083140832408334083440835408364083740838408394084040841408424084340844408454084640847408484084940850408514085240853408544085540856408574085840859408604086140862408634086440865408664086740868408694087040871408724087340874408754087640877408784087940880408814088240883408844088540886408874088840889408904089140892408934089440895408964089740898408994090040901409024090340904409054090640907409084090940910409114091240913409144091540916409174091840919409204092140922409234092440925409264092740928409294093040931409324093340934409354093640937409384093940940409414094240943409444094540946409474094840949409504095140952409534095440955409564095740958409594096040961409624096340964409654096640967409684096940970409714097240973409744097540976409774097840979409804098140982409834098440985409864098740988409894099040991409924099340994409954099640997409984099941000410014100241003410044100541006410074100841009410104101141012410134101441015410164101741018410194102041021410224102341024410254102641027410284102941030410314103241033410344103541036410374103841039410404104141042410434104441045410464104741048410494105041051410524105341054410554105641057410584105941060410614106241063410644106541066410674106841069410704107141072410734107441075410764107741078410794108041081410824108341084410854108641087410884108941090410914109241093410944109541096410974109841099411004110141102411034110441105411064110741108411094111041111411124111341114411154111641117411184111941120411214112241123411244112541126411274112841129411304113141132411334113441135411364113741138411394114041141411424114341144411454114641147411484114941150411514115241153411544115541156411574115841159411604116141162411634116441165411664116741168411694117041171411724117341174411754117641177411784117941180411814118241183411844118541186411874118841189411904119141192411934119441195411964119741198411994120041201412024120341204412054120641207412084120941210412114121241213412144121541216412174121841219412204122141222412234122441225412264122741228412294123041231412324123341234412354123641237412384123941240412414124241243412444124541246412474124841249412504125141252412534125441255412564125741258412594126041261412624126341264412654126641267412684126941270412714127241273412744127541276412774127841279412804128141282412834128441285412864128741288412894129041291412924129341294412954129641297412984129941300413014130241303413044130541306413074130841309413104131141312413134131441315413164131741318413194132041321413224132341324413254132641327413284132941330413314133241333413344133541336413374133841339413404134141342413434134441345413464134741348413494135041351413524135341354413554135641357413584135941360413614136241363413644136541366413674136841369413704137141372413734137441375413764137741378413794138041381413824138341384413854138641387413884138941390413914139241393413944139541396413974139841399414004140141402414034140441405414064140741408414094141041411414124141341414414154141641417414184141941420414214142241423414244142541426414274142841429414304143141432414334143441435414364143741438414394144041441414424144341444414454144641447414484144941450414514145241453414544145541456414574145841459414604146141462414634146441465414664146741468414694147041471414724147341474414754147641477414784147941480414814148241483414844148541486414874148841489414904149141492414934149441495414964149741498414994150041501415024150341504415054150641507415084150941510415114151241513415144151541516415174151841519415204152141522415234152441525415264152741528415294153041531415324153341534415354153641537415384153941540415414154241543415444154541546415474154841549415504155141552415534155441555415564155741558415594156041561415624156341564415654156641567415684156941570415714157241573415744157541576415774157841579415804158141582415834158441585415864158741588415894159041591415924159341594415954159641597415984159941600416014160241603416044160541606416074160841609416104161141612416134161441615416164161741618416194162041621416224162341624416254162641627416284162941630416314163241633416344163541636416374163841639416404164141642416434164441645416464164741648416494165041651416524165341654416554165641657416584165941660416614166241663416644166541666416674166841669416704167141672416734167441675416764167741678416794168041681416824168341684416854168641687416884168941690416914169241693416944169541696416974169841699417004170141702417034170441705417064170741708417094171041711417124171341714417154171641717417184171941720417214172241723417244172541726417274172841729417304173141732417334173441735417364173741738417394174041741417424174341744417454174641747417484174941750417514175241753417544175541756417574175841759417604176141762417634176441765417664176741768417694177041771417724177341774417754177641777417784177941780417814178241783417844178541786417874178841789417904179141792417934179441795417964179741798417994180041801418024180341804418054180641807418084180941810418114181241813418144181541816418174181841819418204182141822418234182441825418264182741828418294183041831418324183341834418354183641837418384183941840418414184241843418444184541846418474184841849418504185141852418534185441855418564185741858418594186041861418624186341864418654186641867418684186941870418714187241873418744187541876418774187841879418804188141882418834188441885418864188741888418894189041891418924189341894418954189641897418984189941900419014190241903419044190541906419074190841909419104191141912419134191441915419164191741918419194192041921419224192341924419254192641927419284192941930419314193241933419344193541936419374193841939419404194141942419434194441945419464194741948419494195041951419524195341954419554195641957419584195941960419614196241963419644196541966419674196841969419704197141972419734197441975419764197741978419794198041981419824198341984419854198641987419884198941990419914199241993419944199541996419974199841999420004200142002420034200442005420064200742008420094201042011420124201342014420154201642017420184201942020420214202242023420244202542026420274202842029420304203142032420334203442035420364203742038420394204042041420424204342044420454204642047420484204942050420514205242053420544205542056420574205842059420604206142062420634206442065420664206742068420694207042071420724207342074420754207642077420784207942080420814208242083420844208542086420874208842089420904209142092420934209442095420964209742098420994210042101421024210342104421054210642107421084210942110421114211242113421144211542116421174211842119421204212142122421234212442125421264212742128421294213042131421324213342134421354213642137421384213942140421414214242143421444214542146421474214842149421504215142152421534215442155421564215742158421594216042161421624216342164421654216642167421684216942170421714217242173421744217542176421774217842179421804218142182421834218442185421864218742188421894219042191421924219342194421954219642197421984219942200422014220242203422044220542206422074220842209422104221142212422134221442215422164221742218422194222042221422224222342224422254222642227422284222942230422314223242233422344223542236422374223842239422404224142242422434224442245422464224742248422494225042251422524225342254422554225642257422584225942260422614226242263422644226542266422674226842269422704227142272422734227442275422764227742278422794228042281422824228342284422854228642287422884228942290422914229242293422944229542296422974229842299423004230142302423034230442305423064230742308423094231042311423124231342314423154231642317423184231942320423214232242323423244232542326423274232842329423304233142332423334233442335423364233742338423394234042341423424234342344423454234642347423484234942350423514235242353423544235542356423574235842359423604236142362423634236442365423664236742368423694237042371423724237342374423754237642377423784237942380423814238242383423844238542386423874238842389423904239142392423934239442395423964239742398423994240042401424024240342404424054240642407424084240942410424114241242413424144241542416424174241842419424204242142422424234242442425424264242742428424294243042431424324243342434424354243642437424384243942440424414244242443424444244542446424474244842449424504245142452424534245442455424564245742458424594246042461424624246342464424654246642467424684246942470424714247242473424744247542476424774247842479424804248142482424834248442485424864248742488424894249042491424924249342494424954249642497424984249942500425014250242503425044250542506425074250842509425104251142512425134251442515425164251742518425194252042521425224252342524425254252642527425284252942530425314253242533425344253542536425374253842539425404254142542425434254442545425464254742548425494255042551425524255342554425554255642557425584255942560425614256242563425644256542566425674256842569425704257142572425734257442575425764257742578425794258042581425824258342584425854258642587425884258942590425914259242593425944259542596425974259842599426004260142602426034260442605426064260742608426094261042611426124261342614426154261642617426184261942620426214262242623426244262542626426274262842629426304263142632426334263442635426364263742638426394264042641426424264342644426454264642647426484264942650426514265242653426544265542656426574265842659426604266142662426634266442665426664266742668426694267042671426724267342674426754267642677426784267942680426814268242683426844268542686426874268842689426904269142692426934269442695426964269742698426994270042701427024270342704427054270642707427084270942710427114271242713427144271542716427174271842719427204272142722427234272442725427264272742728427294273042731427324273342734427354273642737427384273942740427414274242743427444274542746427474274842749427504275142752427534275442755427564275742758427594276042761427624276342764427654276642767427684276942770427714277242773427744277542776427774277842779427804278142782427834278442785427864278742788427894279042791427924279342794427954279642797427984279942800428014280242803428044280542806428074280842809428104281142812428134281442815428164281742818428194282042821428224282342824428254282642827428284282942830428314283242833428344283542836428374283842839428404284142842428434284442845428464284742848428494285042851428524285342854428554285642857428584285942860428614286242863428644286542866428674286842869428704287142872428734287442875428764287742878428794288042881428824288342884428854288642887428884288942890428914289242893428944289542896428974289842899429004290142902429034290442905429064290742908429094291042911429124291342914429154291642917429184291942920429214292242923429244292542926429274292842929429304293142932429334293442935429364293742938429394294042941429424294342944429454294642947429484294942950429514295242953429544295542956429574295842959429604296142962429634296442965429664296742968429694297042971429724297342974429754297642977429784297942980429814298242983429844298542986429874298842989429904299142992429934299442995429964299742998429994300043001430024300343004430054300643007430084300943010430114301243013430144301543016430174301843019430204302143022430234302443025430264302743028430294303043031430324303343034430354303643037430384303943040430414304243043430444304543046430474304843049430504305143052430534305443055430564305743058430594306043061430624306343064430654306643067430684306943070430714307243073430744307543076430774307843079430804308143082430834308443085430864308743088430894309043091430924309343094430954309643097430984309943100431014310243103431044310543106431074310843109431104311143112431134311443115431164311743118431194312043121431224312343124431254312643127431284312943130431314313243133431344313543136431374313843139431404314143142431434314443145431464314743148431494315043151431524315343154431554315643157431584315943160431614316243163431644316543166431674316843169431704317143172431734317443175431764317743178431794318043181431824318343184431854318643187431884318943190431914319243193431944319543196431974319843199432004320143202432034320443205432064320743208432094321043211432124321343214432154321643217432184321943220432214322243223432244322543226432274322843229432304323143232432334323443235432364323743238432394324043241432424324343244432454324643247432484324943250432514325243253432544325543256432574325843259432604326143262432634326443265432664326743268432694327043271432724327343274432754327643277432784327943280432814328243283432844328543286432874328843289432904329143292432934329443295432964329743298432994330043301433024330343304433054330643307433084330943310433114331243313433144331543316433174331843319433204332143322433234332443325433264332743328433294333043331433324333343334433354333643337433384333943340433414334243343433444334543346433474334843349433504335143352433534335443355433564335743358433594336043361433624336343364433654336643367433684336943370433714337243373433744337543376433774337843379433804338143382433834338443385433864338743388433894339043391433924339343394433954339643397433984339943400434014340243403434044340543406434074340843409434104341143412434134341443415434164341743418434194342043421434224342343424434254342643427434284342943430434314343243433434344343543436434374343843439434404344143442434434344443445434464344743448434494345043451434524345343454434554345643457434584345943460434614346243463434644346543466434674346843469434704347143472434734347443475434764347743478434794348043481434824348343484434854348643487434884348943490434914349243493434944349543496434974349843499435004350143502435034350443505435064350743508435094351043511435124351343514435154351643517435184351943520435214352243523435244352543526435274352843529435304353143532435334353443535435364353743538435394354043541435424354343544435454354643547435484354943550435514355243553435544355543556435574355843559435604356143562435634356443565435664356743568435694357043571435724357343574435754357643577435784357943580435814358243583435844358543586435874358843589435904359143592435934359443595435964359743598435994360043601436024360343604436054360643607436084360943610436114361243613436144361543616436174361843619436204362143622436234362443625436264362743628436294363043631436324363343634436354363643637436384363943640436414364243643436444364543646436474364843649436504365143652436534365443655436564365743658436594366043661436624366343664436654366643667436684366943670436714367243673436744367543676436774367843679436804368143682436834368443685436864368743688436894369043691436924369343694436954369643697436984369943700437014370243703437044370543706437074370843709437104371143712437134371443715437164371743718437194372043721437224372343724437254372643727437284372943730437314373243733437344373543736437374373843739437404374143742437434374443745437464374743748437494375043751437524375343754437554375643757437584375943760437614376243763437644376543766437674376843769437704377143772437734377443775437764377743778437794378043781437824378343784437854378643787437884378943790437914379243793437944379543796437974379843799438004380143802438034380443805438064380743808438094381043811438124381343814438154381643817438184381943820438214382243823438244382543826438274382843829438304383143832438334383443835438364383743838438394384043841438424384343844438454384643847438484384943850438514385243853438544385543856438574385843859438604386143862438634386443865438664386743868438694387043871438724387343874438754387643877438784387943880438814388243883438844388543886438874388843889438904389143892438934389443895438964389743898438994390043901439024390343904439054390643907439084390943910439114391243913439144391543916439174391843919439204392143922439234392443925439264392743928439294393043931439324393343934439354393643937439384393943940439414394243943439444394543946439474394843949439504395143952439534395443955439564395743958439594396043961439624396343964439654396643967439684396943970439714397243973439744397543976439774397843979439804398143982439834398443985439864398743988439894399043991439924399343994439954399643997439984399944000440014400244003440044400544006440074400844009440104401144012440134401444015440164401744018440194402044021440224402344024440254402644027440284402944030440314403244033440344403544036440374403844039440404404144042440434404444045440464404744048440494405044051440524405344054440554405644057440584405944060440614406244063440644406544066440674406844069440704407144072440734407444075440764407744078440794408044081440824408344084440854408644087440884408944090440914409244093440944409544096440974409844099441004410144102441034410444105441064410744108441094411044111441124411344114441154411644117441184411944120441214412244123441244412544126441274412844129441304413144132441334413444135441364413744138441394414044141441424414344144441454414644147441484414944150441514415244153441544415544156441574415844159441604416144162441634416444165441664416744168441694417044171441724417344174441754417644177441784417944180441814418244183441844418544186441874418844189441904419144192441934419444195441964419744198441994420044201442024420344204442054420644207442084420944210442114421244213442144421544216442174421844219442204422144222442234422444225442264422744228442294423044231442324423344234442354423644237442384423944240442414424244243442444424544246442474424844249442504425144252442534425444255442564425744258442594426044261442624426344264442654426644267442684426944270442714427244273442744427544276442774427844279442804428144282442834428444285442864428744288442894429044291442924429344294442954429644297442984429944300443014430244303443044430544306443074430844309443104431144312443134431444315443164431744318443194432044321443224432344324443254432644327443284432944330443314433244333443344433544336443374433844339443404434144342443434434444345443464434744348443494435044351443524435344354443554435644357443584435944360443614436244363443644436544366443674436844369443704437144372443734437444375443764437744378443794438044381443824438344384443854438644387443884438944390443914439244393443944439544396443974439844399444004440144402444034440444405444064440744408444094441044411444124441344414444154441644417444184441944420444214442244423444244442544426444274442844429444304443144432444334443444435444364443744438444394444044441444424444344444444454444644447444484444944450444514445244453444544445544456444574445844459444604446144462444634446444465444664446744468444694447044471444724447344474444754447644477444784447944480444814448244483444844448544486444874448844489444904449144492444934449444495444964449744498444994450044501445024450344504445054450644507445084450944510445114451244513445144451544516445174451844519445204452144522445234452444525445264452744528445294453044531445324453344534445354453644537445384453944540445414454244543445444454544546445474454844549445504455144552445534455444555445564455744558445594456044561445624456344564445654456644567445684456944570445714457244573445744457544576445774457844579445804458144582445834458444585445864458744588445894459044591445924459344594445954459644597445984459944600446014460244603446044460544606446074460844609446104461144612446134461444615446164461744618446194462044621446224462344624446254462644627446284462944630446314463244633446344463544636446374463844639446404464144642446434464444645446464464744648446494465044651446524465344654446554465644657446584465944660446614466244663446644466544666446674466844669446704467144672446734467444675446764467744678446794468044681446824468344684446854468644687446884468944690446914469244693446944469544696446974469844699447004470144702447034470444705447064470744708447094471044711447124471344714447154471644717447184471944720447214472244723447244472544726447274472844729447304473144732447334473444735447364473744738447394474044741447424474344744447454474644747447484474944750447514475244753447544475544756447574475844759447604476144762447634476444765447664476744768447694477044771447724477344774447754477644777447784477944780447814478244783447844478544786447874478844789447904479144792447934479444795447964479744798447994480044801448024480344804448054480644807448084480944810448114481244813448144481544816448174481844819448204482144822448234482444825448264482744828448294483044831448324483344834448354483644837448384483944840448414484244843448444484544846448474484844849448504485144852448534485444855448564485744858448594486044861448624486344864448654486644867448684486944870448714487244873448744487544876448774487844879448804488144882448834488444885448864488744888448894489044891448924489344894448954489644897448984489944900449014490244903449044490544906449074490844909449104491144912449134491444915449164491744918449194492044921449224492344924449254492644927449284492944930449314493244933449344493544936449374493844939449404494144942449434494444945449464494744948449494495044951449524495344954449554495644957449584495944960449614496244963449644496544966449674496844969449704497144972449734497444975449764497744978449794498044981449824498344984449854498644987449884498944990449914499244993449944499544996449974499844999450004500145002450034500445005450064500745008450094501045011450124501345014450154501645017450184501945020450214502245023450244502545026450274502845029450304503145032450334503445035450364503745038450394504045041450424504345044450454504645047450484504945050450514505245053450544505545056450574505845059450604506145062450634506445065450664506745068450694507045071450724507345074450754507645077450784507945080450814508245083450844508545086450874508845089450904509145092450934509445095450964509745098450994510045101451024510345104451054510645107451084510945110451114511245113451144511545116451174511845119451204512145122451234512445125451264512745128451294513045131451324513345134451354513645137451384513945140451414514245143451444514545146451474514845149451504515145152451534515445155451564515745158451594516045161451624516345164451654516645167451684516945170451714517245173451744517545176451774517845179451804518145182451834518445185451864518745188451894519045191451924519345194451954519645197451984519945200452014520245203452044520545206452074520845209452104521145212452134521445215452164521745218452194522045221452224522345224452254522645227452284522945230452314523245233452344523545236452374523845239452404524145242452434524445245452464524745248452494525045251452524525345254452554525645257452584525945260452614526245263452644526545266452674526845269452704527145272452734527445275452764527745278452794528045281452824528345284452854528645287452884528945290452914529245293452944529545296452974529845299453004530145302453034530445305453064530745308453094531045311453124531345314453154531645317453184531945320453214532245323453244532545326453274532845329453304533145332453334533445335453364533745338453394534045341453424534345344453454534645347453484534945350453514535245353453544535545356453574535845359453604536145362453634536445365453664536745368453694537045371453724537345374453754537645377453784537945380453814538245383453844538545386453874538845389453904539145392453934539445395453964539745398453994540045401454024540345404454054540645407454084540945410454114541245413454144541545416454174541845419454204542145422454234542445425454264542745428454294543045431454324543345434454354543645437454384543945440454414544245443454444544545446454474544845449454504545145452454534545445455454564545745458454594546045461454624546345464454654546645467454684546945470454714547245473454744547545476454774547845479454804548145482454834548445485454864548745488454894549045491454924549345494454954549645497454984549945500455014550245503455044550545506455074550845509455104551145512455134551445515455164551745518455194552045521455224552345524455254552645527455284552945530455314553245533455344553545536455374553845539455404554145542455434554445545455464554745548455494555045551455524555345554455554555645557455584555945560455614556245563455644556545566455674556845569455704557145572455734557445575455764557745578455794558045581455824558345584455854558645587455884558945590455914559245593455944559545596455974559845599456004560145602456034560445605456064560745608456094561045611456124561345614456154561645617456184561945620456214562245623456244562545626456274562845629456304563145632456334563445635456364563745638456394564045641456424564345644456454564645647456484564945650456514565245653456544565545656456574565845659456604566145662456634566445665456664566745668456694567045671456724567345674456754567645677456784567945680456814568245683456844568545686456874568845689456904569145692456934569445695456964569745698456994570045701457024570345704457054570645707457084570945710457114571245713457144571545716457174571845719457204572145722457234572445725457264572745728457294573045731457324573345734457354573645737457384573945740457414574245743457444574545746457474574845749457504575145752457534575445755457564575745758457594576045761457624576345764457654576645767457684576945770457714577245773457744577545776457774577845779457804578145782457834578445785457864578745788457894579045791457924579345794457954579645797457984579945800458014580245803458044580545806458074580845809458104581145812458134581445815458164581745818458194582045821458224582345824458254582645827458284582945830458314583245833458344583545836458374583845839458404584145842458434584445845458464584745848458494585045851458524585345854458554585645857458584585945860458614586245863458644586545866458674586845869458704587145872458734587445875458764587745878458794588045881458824588345884458854588645887458884588945890458914589245893458944589545896458974589845899459004590145902459034590445905459064590745908459094591045911459124591345914459154591645917459184591945920459214592245923459244592545926459274592845929459304593145932459334593445935459364593745938459394594045941459424594345944459454594645947459484594945950459514595245953459544595545956459574595845959459604596145962459634596445965459664596745968459694597045971459724597345974459754597645977459784597945980459814598245983459844598545986459874598845989459904599145992459934599445995459964599745998459994600046001460024600346004460054600646007460084600946010460114601246013460144601546016460174601846019460204602146022460234602446025460264602746028460294603046031460324603346034460354603646037460384603946040460414604246043460444604546046460474604846049460504605146052460534605446055460564605746058460594606046061460624606346064460654606646067460684606946070460714607246073460744607546076460774607846079460804608146082460834608446085460864608746088460894609046091460924609346094460954609646097460984609946100461014610246103461044610546106461074610846109461104611146112461134611446115461164611746118461194612046121461224612346124461254612646127461284612946130461314613246133461344613546136461374613846139461404614146142461434614446145461464614746148461494615046151461524615346154461554615646157461584615946160461614616246163461644616546166461674616846169461704617146172461734617446175461764617746178461794618046181461824618346184461854618646187461884618946190461914619246193461944619546196461974619846199462004620146202462034620446205462064620746208462094621046211462124621346214462154621646217462184621946220462214622246223462244622546226462274622846229462304623146232462334623446235462364623746238462394624046241462424624346244462454624646247462484624946250462514625246253462544625546256462574625846259462604626146262462634626446265462664626746268462694627046271462724627346274462754627646277462784627946280462814628246283462844628546286462874628846289462904629146292462934629446295462964629746298462994630046301463024630346304463054630646307463084630946310463114631246313463144631546316463174631846319463204632146322463234632446325463264632746328463294633046331463324633346334463354633646337463384633946340463414634246343463444634546346463474634846349463504635146352463534635446355463564635746358463594636046361463624636346364463654636646367463684636946370463714637246373463744637546376463774637846379463804638146382463834638446385463864638746388463894639046391463924639346394463954639646397463984639946400464014640246403464044640546406464074640846409464104641146412464134641446415464164641746418464194642046421464224642346424464254642646427464284642946430464314643246433464344643546436464374643846439464404644146442464434644446445464464644746448464494645046451464524645346454464554645646457464584645946460464614646246463464644646546466464674646846469464704647146472464734647446475464764647746478464794648046481464824648346484464854648646487464884648946490464914649246493464944649546496464974649846499465004650146502465034650446505465064650746508465094651046511465124651346514465154651646517465184651946520465214652246523465244652546526465274652846529465304653146532465334653446535465364653746538465394654046541465424654346544465454654646547465484654946550465514655246553465544655546556465574655846559465604656146562465634656446565465664656746568465694657046571465724657346574465754657646577465784657946580465814658246583465844658546586465874658846589465904659146592465934659446595465964659746598465994660046601466024660346604466054660646607466084660946610466114661246613466144661546616466174661846619466204662146622466234662446625466264662746628466294663046631466324663346634466354663646637466384663946640466414664246643466444664546646466474664846649466504665146652466534665446655466564665746658466594666046661466624666346664466654666646667466684666946670466714667246673466744667546676466774667846679466804668146682466834668446685466864668746688466894669046691466924669346694466954669646697466984669946700467014670246703467044670546706467074670846709467104671146712467134671446715467164671746718467194672046721467224672346724467254672646727467284672946730467314673246733467344673546736467374673846739467404674146742467434674446745467464674746748467494675046751467524675346754467554675646757467584675946760467614676246763467644676546766467674676846769467704677146772467734677446775467764677746778467794678046781467824678346784467854678646787467884678946790467914679246793467944679546796467974679846799468004680146802468034680446805468064680746808468094681046811468124681346814468154681646817468184681946820468214682246823468244682546826468274682846829468304683146832468334683446835468364683746838468394684046841468424684346844468454684646847468484684946850468514685246853468544685546856468574685846859468604686146862468634686446865468664686746868468694687046871468724687346874468754687646877468784687946880468814688246883468844688546886468874688846889468904689146892468934689446895468964689746898468994690046901469024690346904469054690646907469084690946910469114691246913469144691546916469174691846919469204692146922469234692446925469264692746928469294693046931469324693346934469354693646937469384693946940469414694246943469444694546946469474694846949469504695146952469534695446955469564695746958469594696046961469624696346964469654696646967469684696946970469714697246973469744697546976469774697846979469804698146982469834698446985469864698746988469894699046991469924699346994469954699646997469984699947000470014700247003470044700547006470074700847009470104701147012470134701447015470164701747018470194702047021470224702347024470254702647027470284702947030470314703247033470344703547036470374703847039470404704147042470434704447045470464704747048470494705047051470524705347054470554705647057470584705947060470614706247063470644706547066470674706847069470704707147072470734707447075470764707747078470794708047081470824708347084470854708647087470884708947090470914709247093470944709547096470974709847099471004710147102471034710447105471064710747108471094711047111471124711347114471154711647117471184711947120471214712247123471244712547126471274712847129471304713147132471334713447135471364713747138471394714047141471424714347144471454714647147471484714947150471514715247153471544715547156471574715847159471604716147162471634716447165471664716747168471694717047171471724717347174471754717647177471784717947180471814718247183471844718547186471874718847189471904719147192471934719447195471964719747198471994720047201472024720347204472054720647207472084720947210472114721247213472144721547216472174721847219472204722147222472234722447225472264722747228472294723047231472324723347234472354723647237472384723947240472414724247243472444724547246472474724847249472504725147252472534725447255472564725747258472594726047261472624726347264472654726647267472684726947270472714727247273472744727547276472774727847279472804728147282472834728447285472864728747288472894729047291472924729347294472954729647297472984729947300473014730247303473044730547306473074730847309473104731147312473134731447315473164731747318473194732047321473224732347324473254732647327473284732947330473314733247333473344733547336473374733847339473404734147342473434734447345473464734747348473494735047351473524735347354473554735647357473584735947360473614736247363473644736547366473674736847369473704737147372473734737447375473764737747378473794738047381473824738347384473854738647387473884738947390473914739247393473944739547396473974739847399474004740147402474034740447405474064740747408474094741047411474124741347414474154741647417474184741947420474214742247423474244742547426474274742847429474304743147432474334743447435474364743747438474394744047441474424744347444474454744647447474484744947450474514745247453474544745547456474574745847459474604746147462474634746447465474664746747468474694747047471474724747347474474754747647477474784747947480474814748247483474844748547486474874748847489474904749147492474934749447495474964749747498474994750047501475024750347504475054750647507475084750947510475114751247513475144751547516475174751847519475204752147522475234752447525475264752747528475294753047531475324753347534475354753647537475384753947540475414754247543475444754547546475474754847549475504755147552475534755447555475564755747558475594756047561475624756347564475654756647567475684756947570475714757247573475744757547576475774757847579475804758147582475834758447585475864758747588475894759047591475924759347594475954759647597475984759947600476014760247603476044760547606476074760847609476104761147612476134761447615476164761747618476194762047621476224762347624476254762647627476284762947630476314763247633476344763547636476374763847639476404764147642476434764447645476464764747648476494765047651476524765347654476554765647657476584765947660476614766247663476644766547666476674766847669476704767147672476734767447675476764767747678476794768047681476824768347684476854768647687476884768947690476914769247693476944769547696476974769847699477004770147702477034770447705477064770747708477094771047711477124771347714477154771647717477184771947720477214772247723477244772547726477274772847729477304773147732477334773447735477364773747738477394774047741477424774347744477454774647747477484774947750477514775247753477544775547756477574775847759477604776147762477634776447765477664776747768477694777047771477724777347774477754777647777477784777947780477814778247783477844778547786477874778847789477904779147792477934779447795477964779747798477994780047801478024780347804478054780647807478084780947810478114781247813478144781547816478174781847819478204782147822478234782447825478264782747828478294783047831478324783347834478354783647837478384783947840478414784247843478444784547846478474784847849478504785147852478534785447855478564785747858478594786047861478624786347864478654786647867478684786947870478714787247873478744787547876478774787847879478804788147882478834788447885478864788747888478894789047891478924789347894478954789647897478984789947900479014790247903479044790547906479074790847909479104791147912479134791447915479164791747918479194792047921479224792347924479254792647927479284792947930479314793247933479344793547936479374793847939479404794147942479434794447945479464794747948479494795047951479524795347954479554795647957479584795947960479614796247963479644796547966479674796847969479704797147972479734797447975479764797747978479794798047981479824798347984479854798647987479884798947990479914799247993479944799547996479974799847999480004800148002480034800448005480064800748008480094801048011480124801348014480154801648017480184801948020480214802248023480244802548026480274802848029480304803148032480334803448035480364803748038480394804048041480424804348044480454804648047480484804948050480514805248053480544805548056480574805848059480604806148062480634806448065480664806748068480694807048071480724807348074480754807648077480784807948080480814808248083480844808548086480874808848089480904809148092480934809448095480964809748098480994810048101481024810348104481054810648107481084810948110481114811248113481144811548116481174811848119481204812148122481234812448125481264812748128481294813048131481324813348134481354813648137481384813948140481414814248143481444814548146481474814848149481504815148152481534815448155481564815748158481594816048161481624816348164481654816648167481684816948170481714817248173481744817548176481774817848179481804818148182481834818448185481864818748188481894819048191481924819348194481954819648197481984819948200482014820248203482044820548206482074820848209482104821148212482134821448215482164821748218482194822048221482224822348224482254822648227482284822948230482314823248233482344823548236482374823848239482404824148242482434824448245482464824748248482494825048251482524825348254482554825648257482584825948260482614826248263482644826548266482674826848269482704827148272482734827448275482764827748278482794828048281482824828348284482854828648287482884828948290482914829248293482944829548296482974829848299483004830148302483034830448305483064830748308483094831048311483124831348314483154831648317483184831948320483214832248323483244832548326483274832848329483304833148332483334833448335483364833748338483394834048341483424834348344483454834648347483484834948350483514835248353483544835548356483574835848359483604836148362483634836448365483664836748368483694837048371483724837348374483754837648377483784837948380483814838248383483844838548386483874838848389483904839148392483934839448395483964839748398483994840048401484024840348404484054840648407484084840948410484114841248413484144841548416484174841848419484204842148422484234842448425484264842748428484294843048431484324843348434484354843648437484384843948440484414844248443484444844548446484474844848449484504845148452484534845448455484564845748458484594846048461484624846348464484654846648467484684846948470484714847248473484744847548476484774847848479484804848148482484834848448485484864848748488484894849048491484924849348494484954849648497484984849948500485014850248503485044850548506485074850848509485104851148512485134851448515485164851748518485194852048521485224852348524485254852648527485284852948530485314853248533485344853548536485374853848539485404854148542485434854448545485464854748548485494855048551485524855348554485554855648557485584855948560485614856248563485644856548566485674856848569485704857148572485734857448575485764857748578485794858048581485824858348584485854858648587485884858948590485914859248593485944859548596485974859848599486004860148602486034860448605486064860748608486094861048611486124861348614486154861648617486184861948620486214862248623486244862548626486274862848629486304863148632486334863448635486364863748638486394864048641486424864348644486454864648647486484864948650486514865248653486544865548656486574865848659486604866148662486634866448665486664866748668486694867048671486724867348674486754867648677486784867948680486814868248683486844868548686486874868848689486904869148692486934869448695486964869748698486994870048701487024870348704487054870648707487084870948710487114871248713487144871548716487174871848719487204872148722487234872448725487264872748728487294873048731487324873348734487354873648737487384873948740487414874248743487444874548746487474874848749487504875148752487534875448755487564875748758487594876048761487624876348764487654876648767487684876948770487714877248773487744877548776487774877848779487804878148782487834878448785487864878748788487894879048791487924879348794487954879648797487984879948800488014880248803488044880548806488074880848809488104881148812488134881448815488164881748818488194882048821488224882348824488254882648827488284882948830488314883248833488344883548836488374883848839488404884148842488434884448845488464884748848488494885048851488524885348854488554885648857488584885948860488614886248863488644886548866488674886848869488704887148872488734887448875488764887748878488794888048881488824888348884488854888648887488884888948890488914889248893488944889548896488974889848899489004890148902489034890448905489064890748908489094891048911489124891348914489154891648917489184891948920489214892248923489244892548926489274892848929489304893148932489334893448935489364893748938489394894048941489424894348944489454894648947489484894948950489514895248953489544895548956489574895848959489604896148962489634896448965489664896748968489694897048971489724897348974489754897648977489784897948980489814898248983489844898548986489874898848989489904899148992489934899448995489964899748998489994900049001490024900349004490054900649007490084900949010490114901249013490144901549016490174901849019490204902149022490234902449025490264902749028490294903049031490324903349034490354903649037490384903949040490414904249043490444904549046490474904849049490504905149052490534905449055490564905749058490594906049061490624906349064490654906649067490684906949070490714907249073490744907549076490774907849079490804908149082490834908449085490864908749088490894909049091490924909349094490954909649097490984909949100491014910249103491044910549106491074910849109491104911149112491134911449115491164911749118491194912049121491224912349124491254912649127491284912949130491314913249133491344913549136491374913849139491404914149142491434914449145491464914749148491494915049151491524915349154491554915649157491584915949160491614916249163491644916549166491674916849169491704917149172491734917449175491764917749178491794918049181491824918349184491854918649187491884918949190491914919249193491944919549196491974919849199492004920149202492034920449205492064920749208492094921049211492124921349214492154921649217492184921949220492214922249223492244922549226492274922849229492304923149232492334923449235492364923749238492394924049241492424924349244492454924649247492484924949250492514925249253492544925549256492574925849259492604926149262492634926449265492664926749268492694927049271492724927349274492754927649277492784927949280492814928249283492844928549286492874928849289492904929149292492934929449295492964929749298492994930049301493024930349304493054930649307493084930949310493114931249313493144931549316493174931849319493204932149322493234932449325493264932749328493294933049331493324933349334493354933649337493384933949340493414934249343493444934549346493474934849349493504935149352493534935449355493564935749358493594936049361493624936349364493654936649367493684936949370493714937249373493744937549376493774937849379493804938149382493834938449385493864938749388493894939049391493924939349394493954939649397493984939949400494014940249403494044940549406494074940849409494104941149412494134941449415494164941749418494194942049421494224942349424494254942649427494284942949430494314943249433494344943549436494374943849439494404944149442494434944449445494464944749448494494945049451494524945349454494554945649457494584945949460494614946249463494644946549466494674946849469494704947149472494734947449475494764947749478494794948049481494824948349484494854948649487494884948949490494914949249493494944949549496494974949849499495004950149502495034950449505495064950749508495094951049511495124951349514495154951649517495184951949520495214952249523495244952549526495274952849529495304953149532495334953449535495364953749538495394954049541495424954349544495454954649547495484954949550495514955249553495544955549556495574955849559495604956149562495634956449565495664956749568495694957049571495724957349574495754957649577495784957949580495814958249583495844958549586495874958849589495904959149592495934959449595495964959749598495994960049601496024960349604496054960649607496084960949610496114961249613496144961549616496174961849619496204962149622496234962449625496264962749628496294963049631496324963349634496354963649637496384963949640496414964249643496444964549646496474964849649496504965149652496534965449655496564965749658496594966049661496624966349664496654966649667496684966949670496714967249673496744967549676496774967849679496804968149682496834968449685496864968749688496894969049691496924969349694496954969649697496984969949700497014970249703497044970549706497074970849709497104971149712497134971449715497164971749718497194972049721497224972349724497254972649727497284972949730497314973249733497344973549736497374973849739497404974149742497434974449745497464974749748497494975049751497524975349754497554975649757497584975949760497614976249763497644976549766497674976849769497704977149772497734977449775497764977749778497794978049781497824978349784497854978649787497884978949790497914979249793497944979549796497974979849799498004980149802498034980449805498064980749808498094981049811498124981349814498154981649817498184981949820498214982249823498244982549826498274982849829498304983149832498334983449835498364983749838498394984049841498424984349844498454984649847498484984949850498514985249853498544985549856498574985849859498604986149862498634986449865498664986749868498694987049871498724987349874498754987649877498784987949880498814988249883498844988549886498874988849889498904989149892498934989449895498964989749898498994990049901499024990349904499054990649907499084990949910499114991249913499144991549916499174991849919499204992149922499234992449925499264992749928499294993049931499324993349934499354993649937499384993949940499414994249943499444994549946499474994849949499504995149952499534995449955499564995749958499594996049961499624996349964499654996649967499684996949970499714997249973499744997549976499774997849979499804998149982499834998449985499864998749988499894999049991499924999349994499954999649997499984999950000500015000250003500045000550006500075000850009500105001150012500135001450015500165001750018500195002050021500225002350024500255002650027500285002950030500315003250033500345003550036500375003850039500405004150042500435004450045500465004750048500495005050051500525005350054500555005650057500585005950060500615006250063500645006550066500675006850069500705007150072500735007450075500765007750078500795008050081500825008350084500855008650087500885008950090500915009250093500945009550096500975009850099501005010150102501035010450105501065010750108501095011050111501125011350114501155011650117501185011950120501215012250123501245012550126501275012850129501305013150132501335013450135501365013750138501395014050141501425014350144501455014650147501485014950150501515015250153501545015550156501575015850159501605016150162501635016450165501665016750168501695017050171501725017350174501755017650177501785017950180501815018250183501845018550186501875018850189501905019150192501935019450195501965019750198501995020050201502025020350204502055020650207502085020950210502115021250213502145021550216502175021850219502205022150222502235022450225502265022750228502295023050231502325023350234502355023650237502385023950240502415024250243502445024550246502475024850249502505025150252502535025450255502565025750258502595026050261502625026350264502655026650267502685026950270502715027250273502745027550276502775027850279502805028150282502835028450285502865028750288502895029050291502925029350294502955029650297502985029950300503015030250303503045030550306503075030850309503105031150312503135031450315503165031750318503195032050321503225032350324503255032650327503285032950330503315033250333503345033550336503375033850339503405034150342503435034450345503465034750348503495035050351503525035350354503555035650357503585035950360503615036250363503645036550366503675036850369503705037150372503735037450375503765037750378503795038050381503825038350384503855038650387503885038950390503915039250393503945039550396503975039850399504005040150402504035040450405504065040750408504095041050411504125041350414504155041650417504185041950420504215042250423504245042550426504275042850429504305043150432504335043450435504365043750438504395044050441504425044350444504455044650447504485044950450504515045250453504545045550456504575045850459504605046150462504635046450465504665046750468504695047050471504725047350474504755047650477504785047950480504815048250483504845048550486504875048850489504905049150492504935049450495504965049750498504995050050501505025050350504505055050650507505085050950510505115051250513505145051550516505175051850519505205052150522505235052450525505265052750528505295053050531505325053350534505355053650537505385053950540505415054250543505445054550546505475054850549505505055150552505535055450555505565055750558505595056050561505625056350564505655056650567505685056950570505715057250573505745057550576505775057850579505805058150582505835058450585505865058750588505895059050591505925059350594505955059650597505985059950600506015060250603506045060550606506075060850609506105061150612506135061450615506165061750618506195062050621506225062350624506255062650627506285062950630506315063250633506345063550636506375063850639506405064150642506435064450645506465064750648506495065050651506525065350654506555065650657506585065950660506615066250663506645066550666506675066850669506705067150672506735067450675506765067750678506795068050681506825068350684506855068650687506885068950690506915069250693506945069550696506975069850699507005070150702507035070450705507065070750708507095071050711507125071350714507155071650717507185071950720507215072250723507245072550726507275072850729507305073150732507335073450735507365073750738507395074050741507425074350744507455074650747507485074950750507515075250753507545075550756507575075850759507605076150762507635076450765507665076750768507695077050771507725077350774507755077650777507785077950780507815078250783507845078550786507875078850789507905079150792507935079450795507965079750798507995080050801508025080350804508055080650807508085080950810508115081250813508145081550816508175081850819508205082150822508235082450825508265082750828508295083050831508325083350834508355083650837508385083950840508415084250843508445084550846508475084850849508505085150852508535085450855508565085750858508595086050861508625086350864508655086650867508685086950870508715087250873508745087550876508775087850879508805088150882508835088450885508865088750888508895089050891508925089350894508955089650897508985089950900509015090250903509045090550906509075090850909509105091150912509135091450915509165091750918509195092050921509225092350924509255092650927509285092950930509315093250933509345093550936509375093850939509405094150942509435094450945509465094750948509495095050951509525095350954509555095650957509585095950960509615096250963509645096550966509675096850969509705097150972509735097450975509765097750978509795098050981509825098350984509855098650987509885098950990509915099250993509945099550996509975099850999510005100151002510035100451005510065100751008510095101051011510125101351014510155101651017510185101951020510215102251023510245102551026510275102851029510305103151032510335103451035510365103751038510395104051041510425104351044510455104651047510485104951050510515105251053510545105551056510575105851059510605106151062510635106451065510665106751068510695107051071510725107351074510755107651077510785107951080510815108251083510845108551086510875108851089510905109151092510935109451095510965109751098510995110051101511025110351104511055110651107511085110951110511115111251113511145111551116511175111851119511205112151122511235112451125511265112751128511295113051131511325113351134511355113651137511385113951140511415114251143511445114551146511475114851149511505115151152511535115451155511565115751158511595116051161511625116351164511655116651167511685116951170511715117251173511745117551176511775117851179511805118151182511835118451185511865118751188511895119051191511925119351194511955119651197511985119951200512015120251203512045120551206512075120851209512105121151212512135121451215512165121751218512195122051221512225122351224512255122651227512285122951230512315123251233512345123551236512375123851239512405124151242512435124451245512465124751248512495125051251512525125351254512555125651257512585125951260512615126251263512645126551266512675126851269512705127151272512735127451275512765127751278512795128051281512825128351284512855128651287512885128951290512915129251293512945129551296512975129851299513005130151302513035130451305513065130751308513095131051311513125131351314513155131651317513185131951320513215132251323513245132551326513275132851329513305133151332513335133451335513365133751338513395134051341513425134351344513455134651347513485134951350513515135251353513545135551356513575135851359513605136151362513635136451365513665136751368513695137051371513725137351374513755137651377513785137951380513815138251383513845138551386513875138851389513905139151392513935139451395513965139751398513995140051401514025140351404514055140651407514085140951410514115141251413514145141551416514175141851419514205142151422514235142451425514265142751428514295143051431514325143351434514355143651437514385143951440514415144251443514445144551446514475144851449514505145151452514535145451455514565145751458514595146051461514625146351464514655146651467514685146951470514715147251473514745147551476514775147851479514805148151482514835148451485514865148751488514895149051491514925149351494514955149651497514985149951500515015150251503515045150551506515075150851509515105151151512515135151451515515165151751518515195152051521515225152351524515255152651527515285152951530515315153251533515345153551536515375153851539515405154151542515435154451545515465154751548515495155051551515525155351554515555155651557515585155951560515615156251563515645156551566515675156851569515705157151572515735157451575515765157751578515795158051581515825158351584515855158651587515885158951590515915159251593515945159551596515975159851599516005160151602516035160451605516065160751608516095161051611516125161351614516155161651617516185161951620516215162251623516245162551626516275162851629516305163151632516335163451635516365163751638516395164051641516425164351644516455164651647516485164951650516515165251653516545165551656516575165851659516605166151662516635166451665516665166751668516695167051671516725167351674516755167651677516785167951680516815168251683516845168551686516875168851689516905169151692516935169451695516965169751698516995170051701517025170351704517055170651707517085170951710517115171251713517145171551716517175171851719517205172151722517235172451725517265172751728517295173051731517325173351734517355173651737517385173951740517415174251743517445174551746517475174851749517505175151752517535175451755517565175751758517595176051761517625176351764517655176651767517685176951770517715177251773517745177551776517775177851779517805178151782517835178451785517865178751788517895179051791517925179351794517955179651797517985179951800518015180251803518045180551806518075180851809518105181151812518135181451815518165181751818518195182051821518225182351824518255182651827518285182951830518315183251833518345183551836518375183851839518405184151842518435184451845518465184751848518495185051851518525185351854518555185651857518585185951860518615186251863518645186551866518675186851869518705187151872518735187451875518765187751878518795188051881518825188351884518855188651887518885188951890518915189251893518945189551896518975189851899519005190151902519035190451905519065190751908519095191051911519125191351914519155191651917519185191951920519215192251923519245192551926519275192851929519305193151932519335193451935519365193751938519395194051941519425194351944519455194651947519485194951950519515195251953519545195551956519575195851959519605196151962519635196451965519665196751968519695197051971519725197351974519755197651977519785197951980519815198251983519845198551986519875198851989519905199151992519935199451995519965199751998519995200052001520025200352004520055200652007520085200952010520115201252013520145201552016520175201852019520205202152022520235202452025520265202752028520295203052031520325203352034520355203652037520385203952040520415204252043520445204552046520475204852049520505205152052520535205452055520565205752058520595206052061520625206352064520655206652067520685206952070520715207252073520745207552076520775207852079520805208152082520835208452085520865208752088520895209052091520925209352094520955209652097520985209952100521015210252103521045210552106521075210852109521105211152112521135211452115521165211752118521195212052121521225212352124521255212652127521285212952130521315213252133521345213552136521375213852139521405214152142521435214452145521465214752148521495215052151521525215352154521555215652157521585215952160521615216252163521645216552166521675216852169521705217152172521735217452175521765217752178521795218052181521825218352184521855218652187521885218952190521915219252193521945219552196521975219852199522005220152202522035220452205522065220752208522095221052211522125221352214522155221652217522185221952220522215222252223522245222552226522275222852229522305223152232522335223452235522365223752238522395224052241522425224352244522455224652247522485224952250522515225252253522545225552256522575225852259522605226152262522635226452265522665226752268522695227052271522725227352274522755227652277522785227952280522815228252283522845228552286522875228852289522905229152292522935229452295522965229752298522995230052301523025230352304523055230652307523085230952310523115231252313523145231552316523175231852319523205232152322523235232452325523265232752328523295233052331523325233352334523355233652337523385233952340523415234252343523445234552346523475234852349523505235152352523535235452355523565235752358523595236052361523625236352364523655236652367523685236952370523715237252373523745237552376523775237852379523805238152382523835238452385523865238752388523895239052391523925239352394523955239652397523985239952400524015240252403524045240552406524075240852409524105241152412524135241452415524165241752418524195242052421524225242352424524255242652427524285242952430524315243252433524345243552436524375243852439524405244152442524435244452445524465244752448524495245052451524525245352454524555245652457524585245952460524615246252463524645246552466524675246852469524705247152472524735247452475524765247752478524795248052481524825248352484524855248652487524885248952490524915249252493524945249552496524975249852499525005250152502525035250452505525065250752508525095251052511525125251352514525155251652517525185251952520525215252252523525245252552526525275252852529525305253152532525335253452535525365253752538525395254052541525425254352544525455254652547525485254952550525515255252553525545255552556525575255852559525605256152562525635256452565525665256752568525695257052571525725257352574525755257652577525785257952580525815258252583525845258552586525875258852589525905259152592525935259452595525965259752598525995260052601526025260352604526055260652607526085260952610526115261252613526145261552616526175261852619526205262152622526235262452625526265262752628526295263052631526325263352634526355263652637526385263952640526415264252643526445264552646526475264852649526505265152652526535265452655526565265752658526595266052661526625266352664526655266652667526685266952670526715267252673526745267552676526775267852679526805268152682526835268452685526865268752688526895269052691526925269352694526955269652697526985269952700527015270252703527045270552706527075270852709527105271152712527135271452715527165271752718527195272052721527225272352724527255272652727527285272952730527315273252733527345273552736527375273852739527405274152742527435274452745527465274752748527495275052751527525275352754527555275652757527585275952760527615276252763527645276552766527675276852769527705277152772527735277452775527765277752778527795278052781527825278352784527855278652787527885278952790527915279252793527945279552796527975279852799528005280152802528035280452805528065280752808528095281052811528125281352814528155281652817528185281952820528215282252823528245282552826528275282852829528305283152832528335283452835528365283752838528395284052841528425284352844528455284652847528485284952850528515285252853528545285552856528575285852859528605286152862528635286452865528665286752868528695287052871528725287352874528755287652877528785287952880528815288252883528845288552886528875288852889528905289152892528935289452895528965289752898528995290052901529025290352904529055290652907529085290952910529115291252913529145291552916529175291852919529205292152922529235292452925529265292752928529295293052931529325293352934529355293652937529385293952940529415294252943529445294552946529475294852949529505295152952529535295452955529565295752958529595296052961529625296352964529655296652967529685296952970529715297252973529745297552976529775297852979529805298152982529835298452985529865298752988529895299052991529925299352994529955299652997529985299953000530015300253003530045300553006530075300853009530105301153012530135301453015530165301753018530195302053021530225302353024530255302653027530285302953030530315303253033530345303553036530375303853039530405304153042530435304453045530465304753048530495305053051530525305353054530555305653057530585305953060530615306253063530645306553066530675306853069530705307153072530735307453075530765307753078530795308053081530825308353084530855308653087530885308953090530915309253093530945309553096530975309853099531005310153102531035310453105531065310753108531095311053111531125311353114531155311653117531185311953120531215312253123531245312553126531275312853129531305313153132531335313453135531365313753138531395314053141531425314353144531455314653147531485314953150531515315253153531545315553156531575315853159531605316153162531635316453165531665316753168531695317053171531725317353174531755317653177531785317953180531815318253183531845318553186531875318853189531905319153192531935319453195531965319753198531995320053201532025320353204532055320653207532085320953210532115321253213532145321553216532175321853219532205322153222532235322453225532265322753228532295323053231532325323353234532355323653237532385323953240532415324253243532445324553246532475324853249532505325153252532535325453255532565325753258532595326053261532625326353264532655326653267532685326953270532715327253273532745327553276532775327853279532805328153282532835328453285532865328753288532895329053291532925329353294532955329653297532985329953300533015330253303533045330553306533075330853309533105331153312533135331453315533165331753318533195332053321533225332353324533255332653327533285332953330533315333253333533345333553336533375333853339533405334153342533435334453345533465334753348533495335053351533525335353354533555335653357533585335953360533615336253363533645336553366533675336853369533705337153372533735337453375533765337753378533795338053381533825338353384533855338653387533885338953390533915339253393533945339553396533975339853399534005340153402534035340453405534065340753408534095341053411534125341353414534155341653417534185341953420534215342253423534245342553426534275342853429534305343153432534335343453435534365343753438534395344053441534425344353444534455344653447534485344953450534515345253453534545345553456534575345853459534605346153462534635346453465534665346753468534695347053471534725347353474534755347653477534785347953480534815348253483534845348553486534875348853489534905349153492534935349453495534965349753498534995350053501535025350353504535055350653507535085350953510535115351253513535145351553516535175351853519535205352153522535235352453525535265352753528535295353053531535325353353534535355353653537535385353953540535415354253543535445354553546535475354853549535505355153552535535355453555535565355753558535595356053561535625356353564535655356653567535685356953570535715357253573535745357553576535775357853579535805358153582535835358453585535865358753588535895359053591535925359353594535955359653597535985359953600536015360253603536045360553606536075360853609536105361153612536135361453615536165361753618536195362053621536225362353624536255362653627536285362953630536315363253633536345363553636536375363853639536405364153642536435364453645536465364753648536495365053651536525365353654536555365653657536585365953660536615366253663536645366553666536675366853669536705367153672536735367453675536765367753678536795368053681536825368353684536855368653687536885368953690536915369253693536945369553696536975369853699537005370153702537035370453705537065370753708537095371053711537125371353714537155371653717537185371953720537215372253723537245372553726537275372853729537305373153732537335373453735537365373753738537395374053741537425374353744537455374653747537485374953750537515375253753537545375553756537575375853759537605376153762537635376453765537665376753768537695377053771537725377353774537755377653777537785377953780537815378253783537845378553786537875378853789537905379153792537935379453795537965379753798537995380053801538025380353804538055380653807538085380953810538115381253813538145381553816538175381853819538205382153822538235382453825538265382753828538295383053831538325383353834538355383653837538385383953840538415384253843538445384553846538475384853849538505385153852538535385453855538565385753858538595386053861538625386353864538655386653867538685386953870538715387253873538745387553876538775387853879538805388153882538835388453885538865388753888538895389053891538925389353894538955389653897538985389953900539015390253903539045390553906539075390853909539105391153912539135391453915539165391753918539195392053921539225392353924539255392653927539285392953930539315393253933539345393553936539375393853939539405394153942539435394453945539465394753948539495395053951539525395353954539555395653957539585395953960539615396253963539645396553966539675396853969539705397153972539735397453975539765397753978539795398053981539825398353984539855398653987539885398953990539915399253993539945399553996539975399853999540005400154002540035400454005540065400754008540095401054011540125401354014540155401654017540185401954020540215402254023540245402554026540275402854029540305403154032540335403454035540365403754038540395404054041540425404354044540455404654047540485404954050540515405254053540545405554056540575405854059540605406154062540635406454065540665406754068540695407054071540725407354074540755407654077540785407954080540815408254083540845408554086540875408854089540905409154092540935409454095540965409754098540995410054101541025410354104541055410654107541085410954110541115411254113541145411554116541175411854119541205412154122541235412454125541265412754128541295413054131541325413354134541355413654137541385413954140541415414254143541445414554146541475414854149541505415154152541535415454155541565415754158541595416054161541625416354164541655416654167541685416954170541715417254173541745417554176541775417854179541805418154182541835418454185541865418754188541895419054191541925419354194541955419654197541985419954200542015420254203542045420554206542075420854209542105421154212542135421454215542165421754218542195422054221542225422354224542255422654227542285422954230542315423254233542345423554236542375423854239542405424154242542435424454245542465424754248542495425054251542525425354254542555425654257542585425954260542615426254263542645426554266542675426854269542705427154272542735427454275542765427754278542795428054281542825428354284542855428654287542885428954290542915429254293542945429554296542975429854299543005430154302543035430454305543065430754308543095431054311543125431354314543155431654317543185431954320543215432254323543245432554326543275432854329543305433154332543335433454335543365433754338543395434054341543425434354344543455434654347543485434954350543515435254353543545435554356543575435854359543605436154362543635436454365543665436754368543695437054371543725437354374543755437654377543785437954380543815438254383543845438554386543875438854389543905439154392543935439454395543965439754398543995440054401544025440354404544055440654407544085440954410544115441254413544145441554416544175441854419544205442154422544235442454425544265442754428544295443054431544325443354434544355443654437544385443954440544415444254443544445444554446544475444854449544505445154452544535445454455544565445754458544595446054461544625446354464544655446654467544685446954470544715447254473544745447554476544775447854479544805448154482544835448454485544865448754488544895449054491544925449354494544955449654497544985449954500545015450254503545045450554506545075450854509545105451154512545135451454515545165451754518545195452054521545225452354524545255452654527545285452954530545315453254533545345453554536545375453854539545405454154542545435454454545545465454754548545495455054551545525455354554545555455654557545585455954560545615456254563545645456554566545675456854569545705457154572545735457454575545765457754578545795458054581545825458354584545855458654587545885458954590545915459254593545945459554596545975459854599546005460154602546035460454605546065460754608546095461054611546125461354614546155461654617546185461954620546215462254623546245462554626546275462854629546305463154632546335463454635546365463754638546395464054641546425464354644546455464654647546485464954650546515465254653546545465554656546575465854659546605466154662546635466454665546665466754668546695467054671546725467354674546755467654677546785467954680546815468254683546845468554686546875468854689546905469154692546935469454695546965469754698546995470054701547025470354704547055470654707547085470954710547115471254713547145471554716547175471854719547205472154722547235472454725547265472754728547295473054731547325473354734547355473654737547385473954740547415474254743547445474554746547475474854749547505475154752547535475454755547565475754758547595476054761547625476354764547655476654767547685476954770547715477254773547745477554776547775477854779547805478154782547835478454785547865478754788547895479054791547925479354794547955479654797547985479954800548015480254803548045480554806548075480854809548105481154812548135481454815548165481754818548195482054821548225482354824548255482654827548285482954830548315483254833548345483554836548375483854839548405484154842548435484454845548465484754848548495485054851548525485354854548555485654857548585485954860548615486254863548645486554866548675486854869548705487154872548735487454875548765487754878548795488054881548825488354884548855488654887548885488954890548915489254893548945489554896548975489854899549005490154902549035490454905549065490754908549095491054911549125491354914549155491654917549185491954920549215492254923549245492554926549275492854929549305493154932549335493454935549365493754938549395494054941549425494354944549455494654947549485494954950549515495254953549545495554956549575495854959549605496154962549635496454965549665496754968549695497054971549725497354974549755497654977549785497954980549815498254983549845498554986549875498854989549905499154992549935499454995549965499754998549995500055001550025500355004550055500655007550085500955010550115501255013550145501555016550175501855019550205502155022550235502455025550265502755028550295503055031550325503355034550355503655037550385503955040550415504255043550445504555046550475504855049550505505155052550535505455055550565505755058550595506055061550625506355064550655506655067550685506955070
  1. var dom = {
  2. getOffset: function(e, t, i) {
  3. for (left = "left" == e ? t.offsetLeft : t.offsetTop,
  4. i = i || $("body")[0]; (t = t.offsetParent) && t != i; )
  5. left += "left" == e ? t.offsetLeft : t.offsetTop;
  6. return left
  7. }
  8. };
  9. if (function() {
  10. "use strict";
  11. function o(e, t) {
  12. return typeof e === t
  13. }
  14. function a(e, t) {
  15. return e instanceof t
  16. }
  17. function s(e) {
  18. return e && e.nodeType
  19. }
  20. function l(e) {
  21. return s(e) ? e : a(e, y) ? e[0] : void 0
  22. }
  23. function e(e, i, n) {
  24. return y.each(e, function(e, t) {
  25. n = i.call(t, n, e, t)
  26. }),
  27. n
  28. }
  29. function t(e, t, i) {
  30. var n, r, o;
  31. if (e === t)
  32. return !0;
  33. if (!e || !t || e.constructor !== t.constructor)
  34. return !1;
  35. for (n = 0,
  36. r = i.length; n < r; n += 1) {
  37. if (e[o = i[n]] && E(e[o].equals) && !e[o].equals(t[o]))
  38. return !1;
  39. if (e[o] !== t[o])
  40. return !1
  41. }
  42. return !0
  43. }
  44. function c(e, t, i, n) {
  45. this.left = w(e),
  46. this.top = w(t),
  47. this.width = w(i),
  48. this.height = w(n),
  49. this.right = this.left + this.width,
  50. this.bottom = this.top + this.height
  51. }
  52. function h(e, t, i, n) {
  53. this.visible = e || 0,
  54. this.viewport = t || 0,
  55. this.possible = i || 0,
  56. this.rects = n && I({}, n) || null
  57. }
  58. function r(e, t) {
  59. this.els = e,
  60. this.viewport = t
  61. }
  62. function n(e, t) {
  63. return e.val - t.val
  64. }
  65. function u(e, t) {
  66. return t.val - e.val
  67. }
  68. function d(e) {
  69. var t = c.ofContent(e, !0)
  70. , i = c.ofViewport(e, !0)
  71. , n = t.width - i.width
  72. , r = t.height - i.height;
  73. this.content = t,
  74. this.viewport = i,
  75. this.width = n <= 0 ? null : i.left / n,
  76. this.height = r <= 0 ? null : i.top / r,
  77. this.left = i.left,
  78. this.top = i.top,
  79. this.right = t.right - i.right,
  80. this.bottom = t.bottom - i.bottom
  81. }
  82. function p(e) {
  83. this.el = e || window
  84. }
  85. function f(e, t) {
  86. this.context = e,
  87. this.viewport = t,
  88. this.init()
  89. }
  90. function g(e, t, i, n) {
  91. this.context = new r(e,t),
  92. this.property = i,
  93. this.descending = n,
  94. this.init()
  95. }
  96. function m(e) {
  97. e && e !== window && e !== document ? (this.context = e,
  98. this.$autoTarget = y(e)) : this.context = window,
  99. this.init()
  100. }
  101. var i, v, y = jQuery, A = y(window), C = y(document), I = y.extend, E = y.isFunction, _ = Math.max, b = Math.min, w = Math.round, T = (i = {},
  102. v = 1,
  103. function(e) {
  104. return e ? (i[e] || (i[e] = v,
  105. v += 1),
  106. i[e]) : 0
  107. }
  108. );
  109. I(c.prototype, {
  110. equals: function(e) {
  111. return t(this, e, ["left", "top", "width", "height"])
  112. },
  113. area: function() {
  114. return this.width * this.height
  115. },
  116. relativeTo: function(e) {
  117. return new c(this.left - e.left,this.top - e.top,this.width,this.height)
  118. },
  119. intersection: function(e) {
  120. if (!a(e, c))
  121. return null;
  122. var t = _(this.left, e.left)
  123. , i = b(this.right, e.right)
  124. , n = _(this.top, e.top)
  125. , r = i - t
  126. , o = b(this.bottom, e.bottom) - n;
  127. return 0 <= r && 0 <= o ? new c(t,n,r,o) : null
  128. },
  129. envelope: function(e) {
  130. if (!a(e, c))
  131. return this;
  132. var t = b(this.left, e.left)
  133. , i = _(this.right, e.right)
  134. , n = b(this.top, e.top);
  135. return new c(t,n,i - t,_(this.bottom, e.bottom) - n)
  136. }
  137. }),
  138. I(c, {
  139. ofContent: function(e, t) {
  140. return e && e !== document && e !== window ? t ? new c(0,0,e.scrollWidth,e.scrollHeight) : new c(e.offsetLeft - e.scrollLeft,e.offsetTop - e.scrollTop,e.scrollWidth,e.scrollHeight) : new c(0,0,C.width(),C.height())
  141. },
  142. ofViewport: function(e, t) {
  143. return e && e !== document && e !== window ? t ? new c(e.scrollLeft,e.scrollTop,e.clientWidth,e.clientHeight) : new c(e.offsetLeft,e.offsetTop,e.clientWidth,e.clientHeight) : new c(A.scrollLeft(),A.scrollTop(),A.width(),A.height())
  144. },
  145. ofElement: function(e) {
  146. var t = y(e);
  147. if (!t.is(":visible"))
  148. return null;
  149. var i = t.offset();
  150. return new c(i.left,i.top,t.outerWidth(),t.outerHeight())
  151. }
  152. }),
  153. I(h.prototype, {
  154. equals: function(e) {
  155. return this.fracsEqual(e) && this.rectsEqual(e)
  156. },
  157. fracsEqual: function(e) {
  158. return t(this, e, ["visible", "viewport", "possible"])
  159. },
  160. rectsEqual: function(e) {
  161. return t(this.rects, e.rects, ["document", "element", "viewport"])
  162. }
  163. }),
  164. I(h, {
  165. of: function(e, t) {
  166. var i, n, r;
  167. return e = s(e) && c.ofElement(e) || e,
  168. t = s(t) && c.ofViewport(t) || t || c.ofViewport(),
  169. e instanceof c && (i = e.intersection(t)) ? (n = i.area(),
  170. r = b(e.width, t.width) * b(e.height, t.height),
  171. new h(n / e.area(),n / t.area(),n / r,{
  172. document: i,
  173. element: i.relativeTo(e),
  174. viewport: i.relativeTo(t)
  175. })) : new h
  176. }
  177. });
  178. var x = ["width", "height", "left", "right", "top", "bottom"]
  179. , S = ["possible", "visible", "viewport"];
  180. I(r.prototype, {
  181. sorted: function(t, e) {
  182. var i = this.viewport;
  183. return y.map(this.els, function(e) {
  184. return {
  185. el: e,
  186. val: function(e, t, i) {
  187. var n;
  188. return 0 <= y.inArray(i, x) ? n = c.ofElement(e) : 0 <= y.inArray(i, S) && (n = h.of(e, t)),
  189. n ? n[i] : 0
  190. }(e, i, t)
  191. }
  192. }).sort(e ? u : n)
  193. },
  194. best: function(e, t) {
  195. return this.els.length ? this.sorted(e, t)[0] : null
  196. }
  197. }),
  198. I(d.prototype, {
  199. equals: function(e) {
  200. return t(this, e, ["width", "height", "left", "top", "right", "bottom", "content", "viewport"])
  201. }
  202. }),
  203. I(p.prototype, {
  204. equals: function(e) {
  205. return t(this, e, ["el"])
  206. },
  207. scrollState: function() {
  208. return new d(this.el)
  209. },
  210. scrollTo: function(e, t, i) {
  211. var n = y(this.el === window ? "html,body" : this.el);
  212. e = e || 0,
  213. t = t || 0,
  214. i = isNaN(i) ? 1e3 : i,
  215. n.stop(!0).animate({
  216. scrollLeft: e,
  217. scrollTop: t
  218. }, i)
  219. },
  220. scroll: function(e, t, i) {
  221. var n = this.el === window ? A : y(this.el);
  222. e = e || 0,
  223. t = t || 0,
  224. this.scrollTo(n.scrollLeft() + e, n.scrollTop() + t, i)
  225. },
  226. scrollToRect: function(e, t, i, n) {
  227. t = t || 0,
  228. i = i || 0,
  229. this.scrollTo(e.left - t, e.top - i, n)
  230. },
  231. scrollToElement: function(e, t, i, n) {
  232. var r = c.ofElement(e).relativeTo(c.ofContent(this.el));
  233. this.scrollToRect(r, t, i, n)
  234. }
  235. });
  236. var M = {
  237. init: function() {
  238. this.callbacks = y.Callbacks("memory unique"),
  239. this.currVal = null,
  240. this.prevVal = null,
  241. this.checkProxy = y.proxy(this.check, this),
  242. this.autoCheck()
  243. },
  244. bind: function(e) {
  245. this.callbacks.add(e)
  246. },
  247. unbind: function(e) {
  248. e ? this.callbacks.remove(e) : this.callbacks.empty()
  249. },
  250. trigger: function() {
  251. this.callbacks.fireWith(this.context, [this.currVal, this.prevVal])
  252. },
  253. check: function(e) {
  254. var t = this.updatedValue(e);
  255. return void 0 !== t && (this.prevVal = this.currVal,
  256. this.currVal = t,
  257. this.trigger(),
  258. !0)
  259. },
  260. $autoTarget: A,
  261. autoEvents: "load resize scroll",
  262. autoCheck: function(e) {
  263. this.$autoTarget[!1 === e ? "off" : "on"](this.autoEvents, this.checkProxy)
  264. }
  265. };
  266. I(f.prototype, M, {
  267. updatedValue: function() {
  268. var e = h.of(this.context, this.viewport);
  269. return this.currVal && this.currVal.equals(e) ? void 0 : e
  270. }
  271. }),
  272. I(g.prototype, M, {
  273. updatedValue: function() {
  274. var e = this.context.best(this.property, this.descending);
  275. return e && (e = 0 < e.val ? e.el : null,
  276. this.currVal !== e) ? e : void 0
  277. }
  278. }),
  279. I(m.prototype, M, {
  280. updatedValue: function() {
  281. var e = new d(this.context);
  282. return this.currVal && this.currVal.equals(e) ? void 0 : e
  283. }
  284. });
  285. var R, P, O, L, D, N, F, B, V, k, U = "fracs";
  286. function H(e, t, i, n) {
  287. return i = N(i) ? i.apply(e, t) : i,
  288. N(n[i]) ? n[i].apply(e, t) : void L.error('Method "' + i + '" does not exist on jQuery.' + R)
  289. }
  290. R = U,
  291. P = {
  292. statics: {
  293. version: "0.15.0",
  294. Rect: c,
  295. Fractions: h,
  296. Group: r,
  297. ScrollState: d,
  298. Viewport: p,
  299. FracsCallbacks: f,
  300. GroupCallbacks: g,
  301. ScrollStateCallbacks: m,
  302. fracs: function(e, t) {
  303. return h.of(e, t)
  304. }
  305. },
  306. methods: {
  307. content: function(e) {
  308. return this.length ? c.ofContent(this[0], e) : null
  309. },
  310. envelope: function() {
  311. return e(this, function(e) {
  312. var t = c.ofElement(this);
  313. return e ? e.envelope(t) : t
  314. })
  315. },
  316. fracs: function(e, i, n) {
  317. o(e, "string") || (n = i,
  318. i = e,
  319. e = null),
  320. E(i) || (n = i,
  321. i = null),
  322. n = l(n);
  323. var r = U + ".fracs." + T(n);
  324. return "unbind" === e ? this.each(function() {
  325. var e = y(this).data(r);
  326. e && e.unbind(i)
  327. }) : "check" === e ? this.each(function() {
  328. var e = y(this).data(r);
  329. e && e.check()
  330. }) : E(i) ? this.each(function() {
  331. var e = y(this)
  332. , t = e.data(r);
  333. t || (t = new f(this,n),
  334. e.data(r, t)),
  335. t.bind(i)
  336. }) : this.length ? h.of(this[0], n) : null
  337. },
  338. intersection: function() {
  339. return e(this, function(e) {
  340. var t = c.ofElement(this);
  341. return e ? e.intersection(t) : t
  342. })
  343. },
  344. max: function(e, t, i) {
  345. return E(t) || (i = t,
  346. t = null),
  347. i = l(i),
  348. t ? (new g(this,i,e,!0).bind(t),
  349. this) : this.pushStack(new r(this,i).best(e, !0).el)
  350. },
  351. min: function(e, t, i) {
  352. return E(t) || (i = t,
  353. t = null),
  354. i = l(i),
  355. t ? (new g(this,i,e).bind(t),
  356. this) : this.pushStack(new r(this,i).best(e).el)
  357. },
  358. rect: function() {
  359. return this.length ? c.ofElement(this[0]) : null
  360. },
  361. scrollState: function(e, i) {
  362. var n = U + ".scrollState";
  363. return o(e, "string") || (i = e,
  364. e = null),
  365. "unbind" === e ? this.each(function() {
  366. var e = y(this).data(n);
  367. e && e.unbind(i)
  368. }) : "check" === e ? this.each(function() {
  369. var e = y(this).data(n);
  370. e && e.check()
  371. }) : E(i) ? this.each(function() {
  372. var e = y(this)
  373. , t = e.data(n);
  374. t || (t = new m(this),
  375. e.data(n, t)),
  376. t.bind(i)
  377. }) : this.length ? new d(this[0]) : null
  378. },
  379. scroll: function(e, t, i) {
  380. return this.each(function() {
  381. new p(this).scroll(e, t, i)
  382. })
  383. },
  384. scrollTo: function(e, t, i, n) {
  385. return y.isNumeric(e) && (n = i,
  386. i = t,
  387. t = e,
  388. e = null),
  389. e = l(e),
  390. this.each(function() {
  391. e ? new p(this).scrollToElement(e, t, i, n) : new p(this).scrollTo(t, i, n)
  392. })
  393. },
  394. scrollToThis: function(e, t, i, n) {
  395. return (n = new p(l(n))).scrollToElement(this[0], e, t, i),
  396. this
  397. },
  398. softLink: function(t, i, n, r) {
  399. return r = new p(l(r)),
  400. this.filter("a[href^=#]").each(function() {
  401. var e = y(this);
  402. e.on("click", function() {
  403. r.scrollToElement(y(e.attr("href"))[0], t, i, n)
  404. })
  405. })
  406. },
  407. sort: function(e, t, i) {
  408. return o(t, "boolean") || (i = t,
  409. t = null),
  410. i = l(i),
  411. this.pushStack(y.map(new r(this,i).sorted(e, !t), function(e) {
  412. return e.el
  413. }))
  414. },
  415. viewport: function(e) {
  416. return this.length ? c.ofViewport(this[0], e) : null
  417. }
  418. },
  419. defaultStatic: "fracs",
  420. defaultMethod: "fracs"
  421. },
  422. O = [].slice,
  423. L = jQuery,
  424. D = L.extend,
  425. N = L.isFunction,
  426. F = D({}, P),
  427. B = function() {
  428. return H(this, O.call(arguments), F.defaultStatic, B)
  429. }
  430. ,
  431. V = function(e) {
  432. return N(V[e]) ? V[e].apply(this, O.call(arguments, 1)) : H(this, O.call(arguments), F.defaultMethod, V)
  433. }
  434. ,
  435. (k = function(e) {
  436. e && (D(B, e.statics),
  437. D(V, e.methods)),
  438. B.modplug = k
  439. }
  440. ).prev = {
  441. statics: L[R],
  442. methods: L.fn[R]
  443. },
  444. k(P),
  445. L[R] = B,
  446. L.fn[R] = V
  447. }(),
  448. "undefined" == typeof jQuery)
  449. throw new Error("Bootstrap's JavaScript requires jQuery");
  450. !function(m) {
  451. "use strict";
  452. function r(e, t) {
  453. this.type = this.options = this.enabled = this.timeout = this.hoverState = this.$element = null,
  454. this.init("tooltip", e, t)
  455. }
  456. r.VERSION = "3.2.0",
  457. r.DEFAULTS = {
  458. animation: !0,
  459. placement: "top",
  460. selector: !1,
  461. template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
  462. trigger: "hover focus",
  463. title: "",
  464. delay: 0,
  465. html: !1,
  466. container: !1,
  467. viewport: {
  468. selector: "body",
  469. padding: 0
  470. }
  471. },
  472. r.prototype.init = function(e, t, i) {
  473. this.enabled = !0,
  474. this.type = e,
  475. this.$element = m(t),
  476. this.options = this.getOptions(i),
  477. this.$viewport = this.options.viewport && m(this.options.viewport.selector || this.options.viewport);
  478. for (var n = this.options.trigger.split(" "), r = n.length; r--; ) {
  479. var o = n[r];
  480. if ("click" == o)
  481. this.$element.on("click." + this.type, this.options.selector, m.proxy(this.toggle, this));
  482. else if ("manual" != o) {
  483. var a = "hover" == o ? "mouseenter" : "focusin"
  484. , s = "hover" == o ? "mouseleave" : "focusout";
  485. this.$element.on(a + "." + this.type, this.options.selector, m.proxy(this.enter, this)),
  486. this.$element.on(s + "." + this.type, this.options.selector, m.proxy(this.leave, this))
  487. }
  488. }
  489. this.options.selector ? this._options = m.extend({}, this.options, {
  490. trigger: "manual",
  491. selector: ""
  492. }) : this.fixTitle()
  493. }
  494. ,
  495. r.prototype.getDefaults = function() {
  496. return r.DEFAULTS
  497. }
  498. ,
  499. r.prototype.getOptions = function(e) {
  500. return (e = m.extend({}, this.getDefaults(), this.$element.data(), e)).delay && "number" == typeof e.delay && (e.delay = {
  501. show: e.delay,
  502. hide: e.delay
  503. }),
  504. e
  505. }
  506. ,
  507. r.prototype.getDelegateOptions = function() {
  508. var i = {}
  509. , n = this.getDefaults();
  510. return this._options && m.each(this._options, function(e, t) {
  511. n[e] != t && (i[e] = t)
  512. }),
  513. i
  514. }
  515. ,
  516. r.prototype.enter = function(e) {
  517. var t = e instanceof this.constructor ? e : m(e.currentTarget).data("bs." + this.type);
  518. return t || (t = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  519. m(e.currentTarget).data("bs." + this.type, t)),
  520. clearTimeout(t.timeout),
  521. t.hoverState = "in",
  522. t.options.delay && t.options.delay.show ? void (t.timeout = setTimeout(function() {}, t.options.delay.show)) : t.show()
  523. }
  524. ,
  525. r.prototype.leave = function(e) {
  526. var t = e instanceof this.constructor ? e : m(e.currentTarget).data("bs." + this.type);
  527. return t || (t = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  528. m(e.currentTarget).data("bs." + this.type, t)),
  529. clearTimeout(t.timeout),
  530. t.hoverState = "out",
  531. t.options.delay && t.options.delay.hide ? void (t.timeout = setTimeout(function() {
  532. "out" == t.hoverState && t.hide()
  533. }, t.options.delay.hide)) : t.hide()
  534. }
  535. ,
  536. r.prototype.show = function() {
  537. var e = m.Event("show.bs." + this.type);
  538. if (this.hasContent() && this.enabled) {
  539. this.$element.trigger(e);
  540. var t = m.contains(document.documentElement, this.$element[0]);
  541. if (e.isDefaultPrevented() || !t)
  542. return;
  543. var i = this
  544. , n = this.tip()
  545. , r = this.getUID(this.type);
  546. this.setContent(),
  547. n.attr("id", r),
  548. this.$element.attr("aria-describedby", r),
  549. this.options.animation && n.addClass("fade");
  550. var o = "function" == typeof this.options.placement ? this.options.placement.call(this, n[0], this.$element[0]) : this.options.placement
  551. , a = /\s?auto?\s?/i
  552. , s = a.test(o);
  553. s && (o = o.replace(a, "") || "top"),
  554. n.detach().css({
  555. top: 0,
  556. left: 0,
  557. display: "block"
  558. }).addClass(o).data("bs." + this.type, this),
  559. this.options.container ? n.appendTo(this.options.container) : n.insertAfter(this.$element);
  560. var l = this.getPosition()
  561. , c = n[0].offsetWidth
  562. , h = n[0].offsetHeight;
  563. if (s) {
  564. var u = o
  565. , d = this.$element.parent()
  566. , p = this.getPosition(d);
  567. o = "bottom" == o && l.top + l.height + h - p.scroll > p.height ? "top" : "top" == o && l.top - p.scroll - h < 0 ? "bottom" : "right" == o && l.right + c > p.width ? "left" : "left" == o && l.left - c < p.left ? "right" : o,
  568. n.removeClass(u).addClass(o)
  569. }
  570. var f = this.getCalculatedOffset(o, l, c, h);
  571. this.applyPlacement(f, o);
  572. var g = function() {
  573. i.$element.trigger("shown.bs." + i.type),
  574. i.hoverState = null
  575. };
  576. m.support.transition && this.$tip.hasClass("fade") ? n.one("bsTransitionEnd", g).emulateTransitionEnd(150) : g()
  577. }
  578. }
  579. ,
  580. r.prototype.applyPlacement = function(e, t) {
  581. var i = this.tip()
  582. , n = i[0].offsetWidth
  583. , r = i[0].offsetHeight
  584. , o = parseInt(i.css("margin-top"), 10)
  585. , a = parseInt(i.css("margin-left"), 10);
  586. isNaN(o) && (o = 0),
  587. isNaN(a) && (a = 0),
  588. e.top = e.top + o,
  589. e.left = e.left + a,
  590. m.offset.setOffset(i[0], m.extend({
  591. using: function(e) {
  592. i.css({
  593. top: Math.round(e.top),
  594. left: Math.round(e.left)
  595. })
  596. }
  597. }, e), 0),
  598. i.addClass("in");
  599. var s = i[0].offsetWidth
  600. , l = i[0].offsetHeight;
  601. "top" == t && l != r && (e.top = e.top + r - l);
  602. var c = this.getViewportAdjustedDelta(t, e, s, l);
  603. c.left ? e.left += c.left : e.top += c.top;
  604. var h = c.left ? 2 * c.left - n + s : 2 * c.top - r + l
  605. , u = c.left ? "left" : "top"
  606. , d = c.left ? "offsetWidth" : "offsetHeight";
  607. i.offset(e),
  608. this.replaceArrow(h, i[0][d], u)
  609. }
  610. ,
  611. r.prototype.replaceArrow = function(e, t, i) {
  612. this.arrow().css(i, e ? 50 * (1 - e / t) + "%" : "")
  613. }
  614. ,
  615. r.prototype.setContent = function() {
  616. var e = this.tip()
  617. , t = this.getTitle();
  618. e.find(".tooltip-inner")[this.options.html ? "html" : "text"](t),
  619. e.removeClass("fade in top bottom left right")
  620. }
  621. ,
  622. r.prototype.hide = function() {
  623. function e() {
  624. "in" != t.hoverState && i.detach(),
  625. t.$element.trigger("hidden.bs." + t.type)
  626. }
  627. var t = this
  628. , i = this.tip()
  629. , n = m.Event("hide.bs." + this.type);
  630. if (this.$element.removeAttr("aria-describedby"),
  631. this.$element.trigger(n),
  632. !n.isDefaultPrevented())
  633. return i.removeClass("in"),
  634. m.support.transition && this.$tip.hasClass("fade") ? i.one("bsTransitionEnd", e).emulateTransitionEnd(150) : e(),
  635. this.hoverState = null,
  636. this
  637. }
  638. ,
  639. r.prototype.fixTitle = function() {
  640. var e = this.$element;
  641. !e.attr("title") && "string" == typeof e.attr("data-original-title") || e.attr("data-original-title", e.attr("title") || "").attr("title", "")
  642. }
  643. ,
  644. r.prototype.hasContent = function() {
  645. return this.getTitle()
  646. }
  647. ,
  648. r.prototype.getPosition = function(e) {
  649. var t = (e = e || this.$element)[0]
  650. , i = "BODY" == t.tagName;
  651. return m.extend({}, "function" == typeof t.getBoundingClientRect ? t.getBoundingClientRect() : null, {
  652. scroll: i ? document.documentElement.scrollTop || document.body.scrollTop : e.scrollTop(),
  653. width: i ? m(window).width() : e.outerWidth(),
  654. height: i ? m(window).height() : e.outerHeight()
  655. }, i ? {
  656. top: 0,
  657. left: 0
  658. } : e.offset())
  659. }
  660. ,
  661. r.prototype.getCalculatedOffset = function(e, t, i, n) {
  662. return "bottom" == e ? {
  663. top: t.top + t.height,
  664. left: t.left + t.width / 2 - i / 2
  665. } : "top" == e ? {
  666. top: t.top - n,
  667. left: t.left + t.width / 2 - i / 2
  668. } : "left" == e ? {
  669. top: t.top + t.height / 2 - n / 2,
  670. left: t.left - i
  671. } : {
  672. top: t.top + t.height / 2 - n / 2,
  673. left: t.left + t.width
  674. }
  675. }
  676. ,
  677. r.prototype.getViewportAdjustedDelta = function(e, t, i, n) {
  678. var r = {
  679. top: 0,
  680. left: 0
  681. };
  682. if (!this.$viewport)
  683. return r;
  684. var o = this.options.viewport && this.options.viewport.padding || 0
  685. , a = this.getPosition(this.$viewport);
  686. if (/right|left/.test(e)) {
  687. var s = t.top - o - a.scroll
  688. , l = t.top + o - a.scroll + n;
  689. s < a.top ? r.top = a.top - s : l > a.top + a.height && (r.top = a.top + a.height - l)
  690. } else {
  691. var c = t.left - o
  692. , h = t.left + o + i;
  693. c < a.left ? r.left = a.left - c : h > a.width && (r.left = a.left + a.width - h)
  694. }
  695. return r
  696. }
  697. ,
  698. r.prototype.getTitle = function() {
  699. var e = this.$element
  700. , t = this.options;
  701. return e.attr("data-original-title") || ("function" == typeof t.title ? t.title.call(e[0]) : t.title)
  702. }
  703. ,
  704. r.prototype.getUID = function(e) {
  705. for (; e += ~~(1e6 * Math.random()),
  706. document.getElementById(e); )
  707. ;
  708. return e
  709. }
  710. ,
  711. r.prototype.tip = function() {
  712. return this.$tip = this.$tip || m(this.options.template)
  713. }
  714. ,
  715. r.prototype.arrow = function() {
  716. return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
  717. }
  718. ,
  719. r.prototype.validate = function() {
  720. this.$element[0].parentNode || (this.hide(),
  721. this.$element = null,
  722. this.options = null)
  723. }
  724. ,
  725. r.prototype.enable = function() {
  726. this.enabled = !0
  727. }
  728. ,
  729. r.prototype.disable = function() {
  730. this.enabled = !1
  731. }
  732. ,
  733. r.prototype.toggleEnabled = function() {
  734. this.enabled = !this.enabled
  735. }
  736. ,
  737. r.prototype.toggle = function(e) {
  738. var t = this;
  739. e && ((t = m(e.currentTarget).data("bs." + this.type)) || (t = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  740. m(e.currentTarget).data("bs." + this.type, t))),
  741. t.tip().hasClass("in") ? t.leave(t) : t.enter(t)
  742. }
  743. ,
  744. r.prototype.destroy = function() {
  745. clearTimeout(this.timeout),
  746. this.hide().$element.off("." + this.type).removeData("bs." + this.type)
  747. }
  748. ;
  749. var e = m.fn.tooltip;
  750. m.fn.tooltip = function(n) {
  751. return this.each(function() {
  752. var e = m(this)
  753. , t = e.data("bs.tooltip")
  754. , i = "object" == typeof n && n;
  755. !t && "destroy" == n || (t || e.data("bs.tooltip", t = new r(this,i)),
  756. "string" == typeof n && t[n]())
  757. })
  758. }
  759. ,
  760. m.fn.tooltip.Constructor = r,
  761. m.fn.tooltip.noConflict = function() {
  762. return m.fn.tooltip = e,
  763. this
  764. }
  765. }(jQuery),
  766. function(e, t, i) {
  767. "undefined" != typeof module && module.exports ? module.exports = i() : "function" == typeof define && define.amd ? define(i) : t.Keen = i()
  768. }(0, this, function() {
  769. "use strict";
  770. function Keen() {
  771. return _init.apply(this, arguments)
  772. }
  773. function _init(e) {
  774. if (_isUndefined(e))
  775. throw new Error("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  776. if (_isUndefined(e.projectId) || "String" !== _type(e.projectId) || e.projectId.length < 1)
  777. throw new Error("Please provide a projectId");
  778. this.configure(e)
  779. }
  780. function _extend(e) {
  781. for (var t = 1; t < arguments.length; t++)
  782. for (var i in arguments[t])
  783. e[i] = arguments[t][i];
  784. return e
  785. }
  786. function _isUndefined(e) {
  787. return void 0 === e
  788. }
  789. function _type(e) {
  790. var t = e && e.constructor ? e.constructor.toString() : void 0;
  791. return t ? t.match(/function (.*)\(/)[1] : "Null"
  792. }
  793. function _each(e, t, i) {
  794. var n;
  795. if (!e)
  796. return 0;
  797. if (i = i || e,
  798. "array" === _type(e)) {
  799. for (n = 0; n < e.length; n++)
  800. if (!1 === t.call(i, e[n], n, e))
  801. return 0
  802. } else
  803. for (n in e)
  804. if (e.hasOwnProperty(n) && !1 === t.call(i, e[n], n, e))
  805. return 0;
  806. return 1
  807. }
  808. function _parse_params(e) {
  809. for (var t, i = {}, n = /\+/g, r = /([^&=]+)=?([^&]*)/g, o = function(e) {
  810. return decodeURIComponent(e.replace(n, " "))
  811. }, a = e.split("?")[1]; t = r.exec(a); )
  812. i[o(t[1])] = o(t[2]);
  813. return i
  814. }
  815. function _set_protocol(e) {
  816. switch (e) {
  817. case "http":
  818. return "http";
  819. case "auto":
  820. return location.protocol.replace(/:/g, "");
  821. case "https":
  822. case void 0:
  823. default:
  824. return "https"
  825. }
  826. }
  827. function _set_request_type(e) {
  828. var t = e || "jsonp"
  829. , i = !1;
  830. return ("Object" === _type(XMLHttpRequest) || "Function" === _type(XMLHttpRequest)) && "withCredentials"in new XMLHttpRequest && (i = !0),
  831. null == t || "xhr" == t ? i ? "xhr" : "jsonp" : t
  832. }
  833. function _build_url(e) {
  834. return this.client.endpoint + "/projects/" + this.client.projectId + e
  835. }
  836. function _uploadEvent(e, t, i, n, r) {
  837. var o = _build_url.apply(this, ["/events/" + e])
  838. , a = {};
  839. for (var s in i = !1 !== i,
  840. this.client.globalProperties && (a = this.client.globalProperties(e)),
  841. t)
  842. t.hasOwnProperty(s) && (a[s] = t[s]);
  843. switch (this.client.requestType) {
  844. case "xhr":
  845. _request.xhr.apply(this, ["POST", o, null, a, this.client.writeKey, i, n, r]);
  846. break;
  847. case "jsonp":
  848. var l = JSON.stringify(a)
  849. , c = Keen.Base64.encode(l);
  850. o = (o = (o = o + "?api_key=" + this.client.writeKey) + "&data=" + c) + "&modified=" + (new Date).getTime(),
  851. _request.jsonp.apply(this, [o, this.client.writeKey, n, r]);
  852. break;
  853. case "beacon":
  854. l = JSON.stringify(a),
  855. c = Keen.Base64.encode(l);
  856. o = (o = (o = o + "?api_key=" + encodeURIComponent(this.client.writeKey)) + "&data=" + encodeURIComponent(c)) + "&modified=" + encodeURIComponent((new Date).getTime()),
  857. o += "&c=clv1",
  858. _request.beacon.apply(this, [o, null, n, r])
  859. }
  860. }
  861. Keen.prototype.configure = function(e) {
  862. return e.host = _isUndefined(e.host) ? "api.keen.io/3.0" : e.host.replace(/.*?:\/\//g, ""),
  863. e.protocol = _set_protocol(e.protocol),
  864. e.requestType = _set_request_type(e.requestType),
  865. this.client = {
  866. projectId: e.projectId,
  867. writeKey: e.writeKey,
  868. readKey: e.readKey,
  869. globalProperties: null,
  870. endpoint: e.protocol + "://" + e.host,
  871. requestType: e.requestType
  872. },
  873. Keen.trigger("client", this, e),
  874. this.trigger("ready"),
  875. this
  876. }
  877. ;
  878. var _request = {
  879. xhr: function(e, t, i, n, r, o, a, s) {
  880. if (!r)
  881. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  882. var l = new XMLHttpRequest;
  883. if (l.onreadystatechange = function() {
  884. if (4 == l.readyState)
  885. if (200 <= l.status && l.status < 300) {
  886. var e;
  887. try {
  888. e = JSON.parse(l.responseText)
  889. } catch (e) {
  890. Keen.log("Could not JSON parse HTTP response: " + l.responseText),
  891. s && s(l, e)
  892. }
  893. a && e && a(e)
  894. } else
  895. Keen.log("HTTP request failed."),
  896. s && s(l, null)
  897. }
  898. ,
  899. l.open(e, t, o),
  900. r && l.setRequestHeader("Authorization", r),
  901. n && l.setRequestHeader("Content-Type", "application/json"),
  902. i)
  903. for (var c in i)
  904. i.hasOwnProperty(c) && l.setRequestHeader(c, i[c]);
  905. var h = n ? JSON.stringify(n) : null;
  906. l.send(h)
  907. },
  908. jsonp: function(e, t, i, n) {
  909. if (!t)
  910. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  911. if (t && e.indexOf("api_key") < 0) {
  912. var r = 0 < e.indexOf("?") ? "&" : "?";
  913. e = e + r + "api_key=" + t
  914. }
  915. for (var o = "keenJSONPCallback" + (new Date).getTime(); o in window; )
  916. o += "a";
  917. var a = !1;
  918. window[o] = function(e) {
  919. a = !0,
  920. i && e && i(e),
  921. window[o] = void 0
  922. }
  923. ,
  924. e = e + "&jsonp=" + o;
  925. var s = document.createElement("script");
  926. s.id = "keen-jsonp",
  927. s.src = e,
  928. document.getElementsByTagName("head")[0].appendChild(s),
  929. s.onreadystatechange = function() {
  930. !1 === a && "loaded" === this.readyState && (a = !0,
  931. n && n())
  932. }
  933. ,
  934. s.onerror = function() {
  935. !1 === a && (a = !0,
  936. n && n())
  937. }
  938. },
  939. beacon: function(e, t, i, n) {
  940. if (t && e.indexOf("api_key") < 0) {
  941. var r = 0 < e.indexOf("?") ? "&" : "?";
  942. e = e + r + "api_key=" + t
  943. }
  944. var o = document.createElement("img");
  945. o.onload = function() {
  946. if (!0,
  947. "naturalHeight"in this) {
  948. if (this.naturalHeight + this.naturalWidth === 0)
  949. return void this.onerror()
  950. } else if (this.width + this.height === 0)
  951. return void this.onerror();
  952. i && i({
  953. created: !0
  954. })
  955. }
  956. ,
  957. o.onerror = function() {
  958. !0,
  959. n && n()
  960. }
  961. ,
  962. o.src = e
  963. }
  964. }
  965. , Events = Keen.Events = {
  966. on: function(e, t) {
  967. return this.listeners || (this.listeners = {}),
  968. (this.listeners[e] || (this.listeners[e] = [])).push({
  969. callback: t
  970. }),
  971. this
  972. },
  973. off: function(e, t) {
  974. if (!e && !t)
  975. return this.listeners = void 0,
  976. delete this.listeners,
  977. this;
  978. for (var i = this.listeners[e] || [], n = i.length; n--; )
  979. t && t == i[n].callback && this.listeners[e].splice(n, 1),
  980. t && 0 != i.length || (this.listeners[e] = void 0,
  981. delete this.listeners[e]);
  982. return this
  983. },
  984. trigger: function(e) {
  985. if (!this.listeners)
  986. return this;
  987. for (var t = Array.prototype.slice.call(arguments, 1), i = this.listeners[e] || [], n = 0; n < i.length; n++)
  988. i[n].callback.apply(this, t);
  989. return this
  990. }
  991. };
  992. _extend(Keen.prototype, Events),
  993. _extend(Keen, Events),
  994. Keen.loaded = !0,
  995. Keen.utils = {
  996. each: _each,
  997. extend: _extend,
  998. parseParams: _parse_params
  999. },
  1000. Keen.ready = function(e) {
  1001. Keen.loaded ? e() : Keen.on("ready", e)
  1002. }
  1003. ,
  1004. Keen.log = function(e) {
  1005. "object" == typeof console && console.log("[Keen IO]", e)
  1006. }
  1007. ;
  1008. var Plugins = Keen.Plugins = {}, Hh, Ih;
  1009. Keen.prototype.addEvent = function() {
  1010. _uploadEvent.apply(this, arguments)
  1011. }
  1012. ,
  1013. Keen.prototype.addEventSync = function(e, t, i, n) {
  1014. _uploadEvent.apply(this, [e, t, !1, i, n])
  1015. }
  1016. ,
  1017. Keen.prototype.trackExternalLink = function(e, t, i, n, r) {
  1018. var o = e
  1019. , a = o.metaKey
  1020. , s = o.target
  1021. , l = !1
  1022. , c = function() {};
  1023. return void 0 === n && (n = 500),
  1024. "A" === s.nodeName ? c = function() {
  1025. a || l || (l = !0,
  1026. window.location = s.href)
  1027. }
  1028. : "FORM" === s.nodeName && (c = function() {
  1029. l || (l = !0,
  1030. s.submit())
  1031. }
  1032. ),
  1033. r && (c = function() {
  1034. l || (l = !0,
  1035. r())
  1036. }
  1037. ),
  1038. _uploadEvent.call(this, t, i, c, c),
  1039. setTimeout(function() {
  1040. c()
  1041. }, n),
  1042. !!a && void 0
  1043. }
  1044. ,
  1045. Keen.prototype.setGlobalProperties = function(e) {
  1046. if (!this.client)
  1047. return Keen.log("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  1048. if (!e || "function" != typeof e)
  1049. throw new Error("Invalid value for global properties: " + e);
  1050. this.client.globalProperties = e
  1051. }
  1052. ,
  1053. Keen.Base64 = {
  1054. map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  1055. encode: function(e) {
  1056. var t, i, n, r, o, a, s, l = "", c = 0, h = this.map;
  1057. for (e = this.utf8.encode(e); c < e.length; )
  1058. t = e.charCodeAt(c++),
  1059. i = e.charCodeAt(c++),
  1060. n = e.charCodeAt(c++),
  1061. r = t >> 2,
  1062. o = (3 & t) << 4 | i >> 4,
  1063. a = isNaN(i) ? 64 : (15 & i) << 2 | n >> 6,
  1064. s = isNaN(i) || isNaN(n) ? 64 : 63 & n,
  1065. l = l + h.charAt(r) + h.charAt(o) + h.charAt(a) + h.charAt(s);
  1066. return l
  1067. },
  1068. decode: function(e) {
  1069. var t, i, n, r, o, a, s = "", l = 0, c = this.map, h = String.fromCharCode;
  1070. for (e = e.replace(/[^A-Za-z0-9\+\/\=]/g, ""); l < e.length; )
  1071. t = c.indexOf(e.charAt(l++)),
  1072. o = (15 & (i = c.indexOf(e.charAt(l++)))) << 4 | (n = c.indexOf(e.charAt(l++))) >> 2,
  1073. a = (3 & n) << 6 | (r = c.indexOf(e.charAt(l++))),
  1074. s = s + (h(t << 2 | i >> 4) + (64 != n ? h(o) : "")) + (64 != r ? h(a) : "");
  1075. return this.utf8.decode(s)
  1076. },
  1077. utf8: {
  1078. encode: function(e) {
  1079. for (var t, i = "", n = 0, r = String.fromCharCode; n < e.length; )
  1080. i += (t = e.charCodeAt(n++)) < 128 ? r(t) : 127 < t && t < 2048 ? r(t >> 6 | 192) + r(63 & t | 128) : r(t >> 12 | 224) + r(t >> 6 & 63 | 128) + r(63 & t | 128);
  1081. return i
  1082. },
  1083. decode: function(e) {
  1084. for (var t, i = "", n = 0, r = String.fromCharCode; n < e.length; )
  1085. i += (t = e.charCodeAt(n)) < 128 ? [r(t), n++][0] : 191 < t && t < 224 ? [r((31 & t) << 6 | 63 & e.charCodeAt(n + 1)), n += 2][0] : [r((15 & t) << 12 | (63 & e.charCodeAt(n + 1)) << 6 | 63 & (c3 = e.charCodeAt(n + 2))), n += 3][0];
  1086. return i
  1087. }
  1088. }
  1089. },
  1090. "object" != typeof JSON && (JSON = {}),
  1091. function() {
  1092. function f(e) {
  1093. return e < 10 ? "0" + e : e
  1094. }
  1095. function quote(e) {
  1096. return escapable.lastIndex = 0,
  1097. escapable.test(e) ? '"' + e.replace(escapable, function(e) {
  1098. var t = meta[e];
  1099. return "string" == typeof t ? t : "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1100. }) + '"' : '"' + e + '"'
  1101. }
  1102. function str(e, t) {
  1103. var i, n, r, o, a, s = gap, l = t[e];
  1104. switch (l && "object" == typeof l && "function" == typeof l.toJSON && (l = l.toJSON(e)),
  1105. "function" == typeof rep && (l = rep.call(t, e, l)),
  1106. typeof l) {
  1107. case "string":
  1108. return quote(l);
  1109. case "number":
  1110. return isFinite(l) ? String(l) : "null";
  1111. case "boolean":
  1112. case "null":
  1113. return String(l);
  1114. case "object":
  1115. if (!l)
  1116. return "null";
  1117. if (gap += indent,
  1118. a = [],
  1119. "[object Array]" === Object.prototype.toString.apply(l)) {
  1120. for (o = l.length,
  1121. i = 0; i < o; i += 1)
  1122. a[i] = str(i, l) || "null";
  1123. return r = 0 === a.length ? "[]" : gap ? "[\n" + gap + a.join(",\n" + gap) + "\n" + s + "]" : "[" + a.join(",") + "]",
  1124. gap = s,
  1125. r
  1126. }
  1127. if (rep && "object" == typeof rep)
  1128. for (o = rep.length,
  1129. i = 0; i < o; i += 1)
  1130. "string" == typeof rep[i] && ((r = str(n = rep[i], l)) && a.push(quote(n) + (gap ? ": " : ":") + r));
  1131. else
  1132. for (n in l)
  1133. Object.prototype.hasOwnProperty.call(l, n) && ((r = str(n, l)) && a.push(quote(n) + (gap ? ": " : ":") + r));
  1134. return r = 0 === a.length ? "{}" : gap ? "{\n" + gap + a.join(",\n" + gap) + "\n" + s + "}" : "{" + a.join(",") + "}",
  1135. gap = s,
  1136. r
  1137. }
  1138. }
  1139. "function" != typeof Date.prototype.toJSON && (Date.prototype.toJSON = function() {
  1140. return isFinite(this.valueOf()) ? this.getUTCFullYear() + "-" + f(this.getUTCMonth() + 1) + "-" + f(this.getUTCDate()) + "T" + f(this.getUTCHours()) + ":" + f(this.getUTCMinutes()) + ":" + f(this.getUTCSeconds()) + "Z" : null
  1141. }
  1142. ,
  1143. String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function() {
  1144. return this.valueOf()
  1145. }
  1146. );
  1147. var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, gap, indent, meta = {
  1148. "\b": "\\b",
  1149. "\t": "\\t",
  1150. "\n": "\\n",
  1151. "\f": "\\f",
  1152. "\r": "\\r",
  1153. '"': '\\"',
  1154. "\\": "\\\\"
  1155. }, rep;
  1156. "function" != typeof JSON.stringify && (JSON.stringify = function(e, t, i) {
  1157. var n;
  1158. if (indent = gap = "",
  1159. "number" == typeof i)
  1160. for (n = 0; n < i; n += 1)
  1161. indent += " ";
  1162. else
  1163. "string" == typeof i && (indent = i);
  1164. if ((rep = t) && "function" != typeof t && ("object" != typeof t || "number" != typeof t.length))
  1165. throw new Error("JSON.stringify");
  1166. return str("", {
  1167. "": e
  1168. })
  1169. }
  1170. ),
  1171. "function" != typeof JSON.parse && (JSON.parse = function(text, reviver) {
  1172. function walk(e, t) {
  1173. var i, n, r = e[t];
  1174. if (r && "object" == typeof r)
  1175. for (i in r)
  1176. Object.prototype.hasOwnProperty.call(r, i) && (void 0 !== (n = walk(r, i)) ? r[i] = n : delete r[i]);
  1177. return reviver.call(e, t, r)
  1178. }
  1179. var j;
  1180. if (text = String(text),
  1181. cx.lastIndex = 0,
  1182. cx.test(text) && (text = text.replace(cx, function(e) {
  1183. return "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1184. })),
  1185. /^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]").replace(/(?:^|:|,)(?:\s*\[)+/g, "")))
  1186. return j = eval("(" + text + ")"),
  1187. "function" == typeof reviver ? walk({
  1188. "": j
  1189. }, "") : j;
  1190. throw new SyntaxError("JSON.parse")
  1191. }
  1192. )
  1193. }(),
  1194. Hh = Keen.utils,
  1195. Ih = function(i) {
  1196. function e(e) {
  1197. for (u = 1; e = n.shift(); )
  1198. e()
  1199. }
  1200. var t, n = [], r = document, o = r.documentElement, a = o.doScroll, s = "DOMContentLoaded", l = "addEventListener", c = "onreadystatechange", h = "readyState", u = (a ? /^loaded|^c/ : /^loaded|c/).test(r[h]);
  1201. return r[l] && r[l](s, t = function() {
  1202. r.removeEventListener(s, t, !1),
  1203. e()
  1204. }
  1205. , !1),
  1206. a && r.attachEvent(c, t = function() {
  1207. /^c/.test(r[h]) && (r.detachEvent(c, t),
  1208. e())
  1209. }
  1210. ),
  1211. i = a ? function(t) {
  1212. self != top ? u ? t() : n.push(t) : function() {
  1213. try {
  1214. o.doScroll("left")
  1215. } catch (e) {
  1216. return setTimeout(function() {
  1217. i(t)
  1218. }, 50)
  1219. }
  1220. t()
  1221. }()
  1222. }
  1223. : function(e) {
  1224. u ? e() : n.push(e)
  1225. }
  1226. }
  1227. ,
  1228. "undefined" != typeof module && module.exports ? module.exports = Ih() : "function" == typeof define && define.amd ? define(Ih) : Hh.domready = Ih();
  1229. var loaded = window.Keen, cached = window._Keen || {}, clients, ready;
  1230. if (loaded && cached) {
  1231. for (var instance in clients = cached.clients || {},
  1232. ready = cached.ready || [],
  1233. clients)
  1234. if (clients.hasOwnProperty(instance)) {
  1235. var client = clients[instance];
  1236. for (var method in Keen.prototype)
  1237. Keen.prototype.hasOwnProperty(method) && (loaded.prototype[method] = Keen.prototype[method]);
  1238. if (loaded.Query = Keen.Query ? Keen.Query : function() {}
  1239. ,
  1240. loaded.Visualization = Keen.Visualization ? Keen.Visualization : function() {}
  1241. ,
  1242. client._config && (client.configure.call(client, client._config),
  1243. delete client._config),
  1244. client._setGlobalProperties) {
  1245. for (var globals = client._setGlobalProperties, i = 0; i < globals.length; i++)
  1246. client.setGlobalProperties.apply(client, globals[i]);
  1247. delete client._setGlobalProperties
  1248. }
  1249. if (client._addEvent) {
  1250. for (var queue = client._addEvent || [], i = 0; i < queue.length; i++)
  1251. client.addEvent.apply(client, queue[i]);
  1252. delete client._addEvent
  1253. }
  1254. var callback = client._on || [];
  1255. if (client._on) {
  1256. for (var i = 0; i < callback.length; i++)
  1257. client.on.apply(client, callback[i]);
  1258. client.trigger("ready"),
  1259. delete client._on
  1260. }
  1261. }
  1262. for (var i = 0; i < ready.length; i++) {
  1263. var callback = ready[i];
  1264. Keen.on("ready", function() {
  1265. callback()
  1266. })
  1267. }
  1268. }
  1269. return Keen.loaded && setTimeout(function() {
  1270. Keen.utils.domready(function() {
  1271. Keen.trigger("ready")
  1272. })
  1273. }, 0),
  1274. Keen
  1275. }),
  1276. function() {
  1277. var i = window.analytics = window.analytics || [];
  1278. if (!i.initialize) {
  1279. if (i.invoked)
  1280. return window.console && console.error && console.error("Segment snippet included twice.");
  1281. i.invoked = !0,
  1282. i.methods = ["trackSubmit", "trackClick", "trackLink", "trackForm", "pageview", "identify", "reset", "group", "track", "ready", "alias", "debug", "page", "once", "off", "on"],
  1283. i.factory = function(t) {
  1284. return function() {
  1285. var e = Array.prototype.slice.call(arguments);
  1286. return e.unshift(t),
  1287. i.push(e),
  1288. i
  1289. }
  1290. }
  1291. ;
  1292. for (var e = 0; e < i.methods.length; e++) {
  1293. var t = i.methods[e];
  1294. i[t] = i.factory(t)
  1295. }
  1296. i.load = function(e) {
  1297. var t = document.createElement("script");
  1298. t.type = "text/javascript",
  1299. t.async = !0,
  1300. t.src = ("https:" === document.location.protocol ? "https://" : "http://") + "cdn.segment.com/analytics.js/v1/" + e + "/analytics.min.js";
  1301. var i = document.getElementsByTagName("script")[0];
  1302. i.parentNode.insertBefore(t, i)
  1303. }
  1304. ,
  1305. i.SNIPPET_VERSION = "4.0.0"
  1306. }
  1307. }(),
  1308. function(i, u) {
  1309. "use strict";
  1310. var d = "function"
  1311. , p = "undefined"
  1312. , f = "object"
  1313. , e = "major"
  1314. , t = "model"
  1315. , n = "name"
  1316. , r = "type"
  1317. , o = "vendor"
  1318. , a = "version"
  1319. , s = "architecture"
  1320. , l = "console"
  1321. , c = "mobile"
  1322. , h = "tablet"
  1323. , g = {
  1324. has: function(e, t) {
  1325. return -1 !== t.toLowerCase().indexOf(e.toLowerCase())
  1326. },
  1327. lowerize: function(e) {
  1328. return e.toLowerCase()
  1329. }
  1330. }
  1331. , m = {
  1332. rgx: function() {
  1333. for (var e, t, i, n, r, o, a, s = 0, l = arguments; s < l.length; s += 2) {
  1334. var c = l[s]
  1335. , h = l[s + 1];
  1336. if (typeof e == p)
  1337. for (n in e = {},
  1338. h)
  1339. typeof (r = h[n]) == f ? e[r[0]] = u : e[r] = u;
  1340. for (t = i = 0; t < c.length; t++)
  1341. if (o = c[t].exec(this.getUA())) {
  1342. for (n = 0; n < h.length; n++)
  1343. a = o[++i],
  1344. typeof (r = h[n]) == f && 0 < r.length ? 2 == r.length ? typeof r[1] == d ? e[r[0]] = r[1].call(this, a) : e[r[0]] = r[1] : 3 == r.length ? typeof r[1] != d || r[1].exec && r[1].test ? e[r[0]] = a ? a.replace(r[1], r[2]) : u : e[r[0]] = a ? r[1].call(this, a, r[2]) : u : 4 == r.length && (e[r[0]] = a ? r[3].call(this, a.replace(r[1], r[2])) : u) : e[r] = a || u;
  1345. break
  1346. }
  1347. if (o)
  1348. break
  1349. }
  1350. return e
  1351. },
  1352. str: function(e, t) {
  1353. for (var i in t)
  1354. if (typeof t[i] == f && 0 < t[i].length) {
  1355. for (var n = 0; n < t[i].length; n++)
  1356. if (g.has(t[i][n], e))
  1357. return "?" === i ? u : i
  1358. } else if (g.has(t[i], e))
  1359. return "?" === i ? u : i;
  1360. return e
  1361. }
  1362. }
  1363. , v = {
  1364. browser: {
  1365. oldsafari: {
  1366. major: {
  1367. 1: ["/8", "/1", "/3"],
  1368. 2: "/4",
  1369. "?": "/"
  1370. },
  1371. version: {
  1372. "1.0": "/8",
  1373. 1.2: "/1",
  1374. 1.3: "/3",
  1375. "2.0": "/412",
  1376. "2.0.2": "/416",
  1377. "2.0.3": "/417",
  1378. "2.0.4": "/419",
  1379. "?": "/"
  1380. }
  1381. }
  1382. },
  1383. device: {
  1384. sprint: {
  1385. model: {
  1386. "Evo Shift 4G": "7373KT"
  1387. },
  1388. vendor: {
  1389. HTC: "APA",
  1390. Sprint: "Sprint"
  1391. }
  1392. }
  1393. },
  1394. os: {
  1395. windows: {
  1396. version: {
  1397. ME: "4.90",
  1398. "NT 3.11": "NT3.51",
  1399. "NT 4.0": "NT4.0",
  1400. 2e3: "NT 5.0",
  1401. XP: ["NT 5.1", "NT 5.2"],
  1402. Vista: "NT 6.0",
  1403. 7: "NT 6.1",
  1404. 8: "NT 6.2",
  1405. 8.1: "NT 6.3",
  1406. RT: "ARM"
  1407. }
  1408. }
  1409. }
  1410. }
  1411. , y = {
  1412. browser: [[/(opera\smini)\/((\d+)?[\w\.-]+)/i, /(opera\s[mobiletab]+).+version\/((\d+)?[\w\.-]+)/i, /(opera).+version\/((\d+)?[\w\.]+)/i, /(opera)[\/\s]+((\d+)?[\w\.]+)/i], [n, a, e], [/\s(opr)\/((\d+)?[\w\.]+)/i], [[n, "Opera"], a, e], [/(kindle)\/((\d+)?[\w\.]+)/i, /(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?((\d+)?[\w\.]+)*/i, /(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?((\d+)?[\w\.]*)/i, /(?:ms|\()(ie)\s((\d+)?[\w\.]+)/i, /(rekonq)((?:\/)[\w\.]+)*/i, /(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron)\/((\d+)?[\w\.-]+)/i], [n, a, e], [/(trident).+rv[:\s]((\d+)?[\w\.]+).+like\sgecko/i], [[n, "IE"], a, e], [/(yabrowser)\/((\d+)?[\w\.]+)/i], [[n, "Yandex"], a, e], [/(comodo_dragon)\/((\d+)?[\w\.]+)/i], [[n, /_/g, " "], a, e], [/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?((\d+)?[\w\.]+)/i], [n, a, e], [/(dolfin)\/((\d+)?[\w\.]+)/i], [[n, "Dolphin"], a, e], [/((?:android.+)crmo|crios)\/((\d+)?[\w\.]+)/i], [[n, "Chrome"], a, e], [/version\/((\d+)?[\w\.]+).+?mobile\/\w+\s(safari)/i], [a, e, [n, "Mobile Safari"]], [/version\/((\d+)?[\w\.]+).+?(mobile\s?safari|safari)/i], [a, e, n], [/webkit.+?(mobile\s?safari|safari)((\/[\w\.]+))/i], [n, [e, m.str, v.browser.oldsafari.major], [a, m.str, v.browser.oldsafari.version]], [/(konqueror)\/((\d+)?[\w\.]+)/i, /(webkit|khtml)\/((\d+)?[\w\.]+)/i], [n, a, e], [/(navigator|netscape)\/((\d+)?[\w\.-]+)/i], [[n, "Netscape"], a, e], [/(swiftfox)/i, /(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?((\d+)?[\w\.\+]+)/i, /(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/((\d+)?[\w\.-]+)/i, /(mozilla)\/((\d+)?[\w\.]+).+rv\:.+gecko\/\d+/i, /(uc\s?browser|polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|qqbrowser)[\/\s]?((\d+)?[\w\.]+)/i, /(links)\s\(((\d+)?[\w\.]+)/i, /(gobrowser)\/?((\d+)?[\w\.]+)*/i, /(ice\s?browser)\/v?((\d+)?[\w\._]+)/i, /(mosaic)[\/\s]((\d+)?[\w\.]+)/i], [n, a, e], [/(apple(?:coremedia|))\/((\d+)[\w\._]+)/i, /(coremedia) v((\d+)[\w\._]+)/i], [n, a, e], [/(aqualung|lyssna|bsplayer)\/([\w\.-]+)/i], [n, a], [/(ares|ossproxy)\s((\d+)[\w\.-]+)/i], [n, a, e], [/(audacious|audimusicstream|amarok|bass|core|dalvik|gnomemplayer|music on console|nsplayer|psp-internetradioplayer|videos)\/((\d+)[\w\.-]+)/i, /(clementine|music player daemon)\s((\d+)[\w\.-]+)/i, /(lg player|nexplayer)\s((\d+)[\d\.]+)/i, /player\/(nexplayer|lg player)\s((\d+)[\w\.-]+)/i], [n, a, e], [/(nexplayer)\s((\d+)[\w\.-]+)/i], [n, a, e], [/(flrp)\/((\d+)[\w\.-]+)/i], [[n, "Flip Player"], a, e], [/(fstream|nativehost|queryseekspider|ia-archiver|facebookexternalhit)/i], [n], [/(gstreamer) souphttpsrc (?:\([^\)]+\)){0,1} libsoup\/((\d+)[\w\.-]+)/i], [n, a, e], [/(htc streaming player)\s[\w_]+\s\/\s((\d+)[\d\.]+)/i, /(java|python-urllib|python-requests|wget|libcurl)\/((\d+)[\w\.-_]+)/i, /(lavf)((\d+)[\d\.]+)/i], [n, a, e], [/(htc_one_s)\/((\d+)[\d\.]+)/i], [[n, /_/g, " "], a, e], [/(mplayer)(?:\s|\/)(?:(?:sherpya-){0,1}svn)(?:-|\s)(r\d+(?:-\d+[\w\.-]+){0,1})/i], [n, a], [/(mplayer)(?:\s|\/)((\d+)[\w\.-]+)/i, /(mplayer) unknown-((\d+)[\w\.\-]+)/i], [n, a, e], [/(mplayer)/i, /(yourmuze)/i, /(media player classic|nero showtime)/i], [n], [/(nero (?:home|scout))\/((\d+)[\w\.-]+)/i], [n, a, e], [/(nokia\d+)\/((\d+)[\w\.-]+)/i], [n, a, e], [/\s(songbird)\/((\d+)[\w\.-]+)/i], [n, a, e], [/(winamp)3 version ((\d+)[\w\.-]+)/i, /(winamp)\s((\d+)[\w\.-]+)/i, /(winamp)mpeg\/((\d+)[\w\.-]+)/i], [n, a, e], [/(ocms-bot|tapinradio|tunein radio|unknown|winamp|inlight radio)/i], [n], [/(quicktime|rma|radioapp|radioclientapplication|soundtap|totem|stagefright|streamium)\/((\d+)[\w\.-]+)/i], [n, a, e], [/(smp)((\d+)[\d\.]+)/i], [n, a, e], [/(vlc) media player - version ((\d+)[\w\.]+)/i, /(vlc)\/((\d+)[\w\.-]+)/i, /(xbmc|gvfs|xine|xmms|irapp)\/((\d+)[\w\.-]+)/i, /(foobar2000)\/((\d+)[\d\.]+)/i, /(itunes)\/((\d+)[\d\.]+)/i], [n, a, e], [/(wmplayer)\/((\d+)[\w\.-]+)/i, /(windows-media-player)\/((\d+)[\w\.-]+)/i], [[n, /-/g, " "], a, e], [/windows\/((\d+)[\w\.-]+) upnp\/[\d\.]+ dlnadoc\/[\d\.]+ (home media server)/i], [a, e, [n, "Windows"]], [/(com\.riseupradioalarm)\/((\d+)[\d\.]*)/i], [n, a, e], [/(rad.io)\s((\d+)[\d\.]+)/i, /(radio.(?:de|at|fr))\s((\d+)[\d\.]+)/i], [[n, "rad.io"], a, e]],
  1413. cpu: [[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i], [[s, "amd64"]], [/(ia32(?=;))/i], [[s, g.lowerize]], [/((?:i[346]|x)86)[;\)]/i], [[s, "ia32"]], [/windows\s(ce|mobile);\sppc;/i], [[s, "arm"]], [/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i], [[s, /ower/, "", g.lowerize]], [/(sun4\w)[;\)]/i], [[s, "sparc"]], [/(ia64(?=;)|68k(?=\))|arm(?=v\d+;)|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i], [s, g.lowerize]],
  1414. device: [[/\((ipad|playbook);[\w\s\);-]+(rim|apple)/i], [t, o, [r, h]], [/applecoremedia\/[\w\.]+ \((ipad)/], [t, [o, "Apple"], [r, h]], [/(apple\s{0,1}tv)/i], [[t, "Apple TV"], [o, "Apple"]], [/(hp).+(touchpad)/i, /(kindle)\/([\w\.]+)/i, /\s(nook)[\w\s]+build\/(\w+)/i, /(dell)\s(strea[kpr\s\d]*[\dko])/i], [o, t, [r, h]], [/\((ip[honed|\s\w*]+);.+(apple)/i], [t, o, [r, c]], [/\((ip[honed|\s\w*]+);/i], [t, [o, "Apple"], [r, c]], [/(blackberry)[\s-]?(\w+)/i, /(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|huawei|meizu|motorola)[\s_-]?([\w-]+)*/i, /(hp)\s([\w\s]+\w)/i, /(asus)-?(\w+)/i], [o, t, [r, c]], [/\((bb10);\s(\w+)/i], [[o, "BlackBerry"], t, [r, c]], [/android.+((transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+))/i], [[o, "Asus"], t, [r, h]], [/(sony)\s(tablet\s[ps])/i], [o, t, [r, h]], [/(nintendo)\s([wids3u]+)/i], [o, t, [r, l]], [/((playstation)\s[3portablevi]+)/i], [[o, "Sony"], t, [r, l]], [/(sprint\s(\w+))/i], [[o, m.str, v.device.sprint.vendor], [t, m.str, v.device.sprint.model], [r, c]], [/(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i, /(zte)-(\w+)*/i, /(alcatel|geeksphone|huawei|lenovo|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]+)*/i], [o, [t, /_/g, " "], [r, c]], [/\s((milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?(:?\s4g)?))[\w\s]+build\//i, /(mot)[\s-]?(\w+)*/i], [[o, "Motorola"], t, [r, c]], [/android.+\s((mz60\d|xoom[\s2]{0,2}))\sbuild\//i], [[o, "Motorola"], t, [r, h]], [/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n8000|sgh-t8[56]9))/i], [[o, "Samsung"], t, [r, h]], [/((s[cgp]h-\w+|gt-\w+|galaxy\snexus))/i, /(sam[sung]*)[\s-]*(\w+-?[\w-]*)*/i, /sec-((sgh\w+))/i], [[o, "Samsung"], t, [r, c]], [/(sie)-(\w+)*/i], [[o, "Siemens"], t, [r, c]], [/(maemo|nokia).*(n900|lumia\s\d+)/i, /(nokia)[\s_-]?([\w-]+)*/i], [[o, "Nokia"], t, [r, c]], [/android\s3\.[\s\w-;]{10}((a\d{3}))/i], [[o, "Acer"], t, [r, h]], [/android\s3\.[\s\w-;]{10}(lg?)-([06cv9]{3,4})/i], [[o, "LG"], t, [r, h]], [/((nexus\s[45]))/i, /(lg)[e;\s-\/]+(\w+)*/i], [[o, "LG"], t, [r, c]], [/android.+((ideatab[a-z0-9\-\s]+))/i], [[o, "Lenovo"], t, [r, h]], [/(lg) netcast\.tv/i], [o, [r, "smarttv"]], [/(mobile|tablet);.+rv\:.+gecko\//i], [r, o, t]],
  1415. engine: [[/(presto)\/([\w\.]+)/i, /(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i, /(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i, /(icab)[\/\s]([23]\.[\d\.]+)/i], [n, a], [/rv\:([\w\.]+).*(gecko)/i], [a, n]],
  1416. os: [[/microsoft\s(windows)\s(vista|xp)/i], [n, a], [/(windows)\snt\s6\.2;\s(arm)/i, /(windows\sphone(?:\sos)*|windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i], [n, [a, m.str, v.os.windows.version]], [/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i], [[n, "Windows"], [a, m.str, v.os.windows.version]], [/\((bb)(10);/i], [[n, "BlackBerry"], a], [/(blackberry)\w*\/?([\w\.]+)*/i, /(tizen)\/([\w\.]+)/i, /(android|webos|palm\os|qnx|bada|rim\stablet\sos|meego)[\/\s-]?([\w\.]+)*/i], [n, a], [/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i], [[n, "Symbian"], a], [/mozilla.+\(mobile;.+gecko.+firefox/i], [[n, "Firefox OS"], a], [/(nintendo|playstation)\s([wids3portablevu]+)/i, /(mint)[\/\s\(]?(\w+)*/i, /(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk)[\/\s-]?([\w\.-]+)*/i, /(hurd|linux)\s?([\w\.]+)*/i, /(gnu)\s?([\w\.]+)*/i], [n, a], [/(cros)\s[\w]+\s([\w\.]+\w)/i], [[n, "Chromium OS"], a], [/(sunos)\s?([\w\.]+\d)*/i], [[n, "Solaris"], a], [/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i], [n, a], [/(ip[honead]+)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i], [[n, "iOS"], [a, /_/g, "."]], [/(mac\sos\sx)\s?([\w\s\.]+\w)*/i], [n, [a, /_/g, "."]], [/(haiku)\s(\w+)/i, /(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i, /(macintosh|mac(?=_powerpc)|plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos)/i, /(unix)\s?([\w\.]+)*/i], [n, a]]
  1417. }
  1418. , A = function(e) {
  1419. var t = e || (i && i.navigator && i.navigator.userAgent ? i.navigator.userAgent : "");
  1420. return this instanceof A ? (this.getBrowser = function() {
  1421. return m.rgx.apply(this, y.browser)
  1422. }
  1423. ,
  1424. this.getCPU = function() {
  1425. return m.rgx.apply(this, y.cpu)
  1426. }
  1427. ,
  1428. this.getDevice = function() {
  1429. return m.rgx.apply(this, y.device)
  1430. }
  1431. ,
  1432. this.getEngine = function() {
  1433. return m.rgx.apply(this, y.engine)
  1434. }
  1435. ,
  1436. this.getOS = function() {
  1437. return m.rgx.apply(this, y.os)
  1438. }
  1439. ,
  1440. this.getResult = function() {
  1441. return {
  1442. ua: this.getUA(),
  1443. browser: this.getBrowser(),
  1444. engine: this.getEngine(),
  1445. os: this.getOS(),
  1446. device: this.getDevice(),
  1447. cpu: this.getCPU()
  1448. }
  1449. }
  1450. ,
  1451. this.getUA = function() {
  1452. return t
  1453. }
  1454. ,
  1455. this.setUA = function(e) {
  1456. return t = e,
  1457. this
  1458. }
  1459. ,
  1460. void this.setUA(t)) : new A(e).getResult()
  1461. };
  1462. if (typeof exports != p)
  1463. typeof module != p && module.exports && (exports = module.exports = A),
  1464. exports.UAParser = A;
  1465. else if (i.UAParser = A,
  1466. typeof define == d && define.amd && define(function() {
  1467. return A
  1468. }),
  1469. typeof i.jQuery != p) {
  1470. var C = i.jQuery
  1471. , I = new A;
  1472. C.ua = I.getResult(),
  1473. C.ua.get = function() {
  1474. return I.getUA()
  1475. }
  1476. ,
  1477. C.ua.set = function(e) {
  1478. I.setUA(e);
  1479. var t = I.getResult();
  1480. for (var i in t)
  1481. C.ua[i] = t[i]
  1482. }
  1483. }
  1484. }(this),
  1485. window.Modernizr = function(e, t) {
  1486. function i(e, t) {
  1487. return typeof e === t
  1488. }
  1489. var n, r, o, a = {}, s = t.documentElement, l = t.createElement("modernizr"), c = l.style, h = {}, u = [], d = u.slice, p = {}.hasOwnProperty;
  1490. for (var f in r = i(p, "undefined") || i(p.call, "undefined") ? function(e, t) {
  1491. return t in e && i(e.constructor.prototype[t], "undefined")
  1492. }
  1493. : function(e, t) {
  1494. return p.call(e, t)
  1495. }
  1496. ,
  1497. Function.prototype.bind || (Function.prototype.bind = function(n) {
  1498. var r = this;
  1499. if ("function" != typeof r)
  1500. throw new TypeError;
  1501. var o = d.call(arguments, 1)
  1502. , a = function() {
  1503. if (this instanceof a) {
  1504. function e() {}
  1505. e.prototype = r.prototype;
  1506. var t = new e
  1507. , i = r.apply(t, o.concat(d.call(arguments)));
  1508. return Object(i) === i ? i : t
  1509. }
  1510. return r.apply(n, o.concat(d.call(arguments)))
  1511. };
  1512. return a
  1513. }
  1514. ),
  1515. h.webgl = function() {
  1516. return !!e.WebGLRenderingContext
  1517. }
  1518. ,
  1519. h)
  1520. r(h, f) && (n = f.toLowerCase(),
  1521. a[n] = h[f](),
  1522. u.push((a[n] ? "" : "no-") + n));
  1523. return a.addTest = function(e, t) {
  1524. if ("object" == typeof e)
  1525. for (var i in e)
  1526. r(e, i) && a.addTest(i, e[i]);
  1527. else {
  1528. if (e = e.toLowerCase(),
  1529. void 0 !== a[e])
  1530. return a;
  1531. t = "function" == typeof t ? t() : t,
  1532. "undefined" != typeof enableClasses && enableClasses && (s.className += " " + (t ? "" : "no-") + e),
  1533. a[e] = t
  1534. }
  1535. return a
  1536. }
  1537. ,
  1538. o = "",
  1539. c.cssText = o,
  1540. l = null,
  1541. a._version = "2.8.2",
  1542. a
  1543. }(this, this.document),
  1544. function(xe, e, Se) {
  1545. "use strict";
  1546. function Me(s, e, n) {
  1547. function a(e) {
  1548. var t = Q.length;
  1549. if (G.old = xe.extend({}, G),
  1550. H = V ? 0 : k[F.horizontal ? "width" : "height"](),
  1551. Y = W[F.horizontal ? "width" : "height"](),
  1552. z = V ? s : U[F.horizontal ? "outerWidth" : "outerHeight"](),
  1553. Q.length = 0,
  1554. G.start = 0,
  1555. G.end = nt(z - H, 0),
  1556. le) {
  1557. $.length,
  1558. J = U.children(F.itemSelector),
  1559. $.length = 0;
  1560. var h, u = Ne(U, F.horizontal ? "paddingLeft" : "paddingTop"), d = Ne(U, F.horizontal ? "paddingRight" : "paddingBottom"), i = "border-box" === xe(J).css("boxSizing"), p = "none" !== J.css("float"), f = 0, g = J.length - 1;
  1561. z = 0,
  1562. J.each(function(e, t) {
  1563. var i = xe(t)
  1564. , n = t.getBoundingClientRect()
  1565. , r = it(F.horizontal ? n.width || n.right - n.left : n.height || n.bottom - n.top)
  1566. , o = Ne(i, F.horizontal ? "marginLeft" : "marginTop")
  1567. , a = Ne(i, F.horizontal ? "marginRight" : "marginBottom")
  1568. , s = r + o + a
  1569. , l = !o || !a
  1570. , c = {};
  1571. c.el = t,
  1572. c.size = l ? r : s,
  1573. c.half = c.size / 2,
  1574. c.start = z + (l ? o : 0),
  1575. c.center = c.start - it(H / 2 - c.size / 2),
  1576. c.end = c.start - H + c.size,
  1577. e || (z += u),
  1578. z += s,
  1579. F.horizontal || p || a && o && 0 < e && (z -= rt(o, a)),
  1580. e === g && (c.end += d,
  1581. z += d,
  1582. f = l ? a : 0),
  1583. $.push(c),
  1584. h = c
  1585. }),
  1586. U[0].style[F.horizontal ? "width" : "height"] = (i ? z : z - u - d) + "px",
  1587. z -= f,
  1588. $.length ? (G.start = $[0][ae ? "center" : "start"],
  1589. G.end = ae ? h.center : H < z ? h.end : G.start) : G.start = G.end = 0
  1590. }
  1591. if (G.center = it(G.end / 2 + G.start / 2),
  1592. v(),
  1593. j.length && 0 < Y && (F.dynamicHandle ? (q = Fe(q = G.start === G.end ? Y : it(Y * H / z), F.minHandleSize, Y),
  1594. j[0].style[F.horizontal ? "width" : "height"] = q + "px") : q = j[F.horizontal ? "outerWidth" : "outerHeight"](),
  1595. X.end = Y - q,
  1596. _e || c()),
  1597. !V && 0 < H) {
  1598. var n = G.start
  1599. , r = "";
  1600. if (le)
  1601. xe.each($, function(e, t) {
  1602. ae ? Q.push(t.center) : t.start + t.size > n && n <= G.end && (n = t.start,
  1603. Q.push(n),
  1604. (n += H) > G.end && n < G.end + H && Q.push(G.end))
  1605. });
  1606. else
  1607. for (; n - H < G.end; )
  1608. Q.push(n),
  1609. n += H;
  1610. if (Z[0] && t !== Q.length) {
  1611. for (var o = 0; o < Q.length; o++)
  1612. r += F.pageBuilder.call(B, o);
  1613. (K = Z.html(r).children()).eq(ee.activePage).addClass(F.activeClass)
  1614. }
  1615. }
  1616. if (ee.slideeSize = z,
  1617. ee.frameSize = H,
  1618. ee.sbSize = Y,
  1619. ee.handleSize = q,
  1620. le) {
  1621. e && null != F.startAt && (m(F.startAt),
  1622. B[se ? "toCenter" : "toStart"](F.startAt));
  1623. var a = $[ee.activeItem];
  1624. l(se && a ? a.center : Fe(G.dest, G.start, G.end))
  1625. } else
  1626. e ? null != F.startAt && l(F.startAt, 1) : l(Fe(G.dest, G.start, G.end));
  1627. L("load")
  1628. }
  1629. function l(e, t, i) {
  1630. if (le && Ie.released && !i) {
  1631. var n = d(e)
  1632. , r = e > G.start && e < G.end;
  1633. se ? (r && (e = $[n.centerItem].center),
  1634. ae && F.activateMiddle && m(n.centerItem)) : r && (e = $[n.firstItem].start)
  1635. }
  1636. Ie.init && Ie.slidee && F.elasticBounds ? e > G.end ? e = G.end + (e - G.end) / 6 : e < G.start && (e = G.start + (e - G.start) / 6) : e = Fe(e, G.start, G.end),
  1637. Ae.start = +new Date,
  1638. Ae.time = 0,
  1639. Ae.from = G.cur,
  1640. Ae.to = e,
  1641. Ae.delta = e - G.cur,
  1642. Ae.tweesing = Ie.tweese || Ie.init && !Ie.slidee,
  1643. Ae.immediate = !Ae.tweesing && (t || Ie.init && Ie.slidee || !F.speed),
  1644. Ie.tweese = 0,
  1645. e !== G.dest && (G.dest = e,
  1646. L("change"),
  1647. _e || o()),
  1648. g(),
  1649. v(),
  1650. p(),
  1651. K[0] && ye.page !== ee.activePage && (ye.page = ee.activePage,
  1652. K.removeClass(F.activeClass).eq(ee.activePage).addClass(F.activeClass),
  1653. L("activePage", ye.page))
  1654. }
  1655. function o() {
  1656. if (B.initialized) {
  1657. if (!_e)
  1658. return _e = Ge(o),
  1659. void (Ie.released && L("moveStart"));
  1660. Ae.immediate ? G.cur = Ae.to : Ae.tweesing ? (Ae.tweeseDelta = Ae.to - G.cur,
  1661. $e(Ae.tweeseDelta) < .1 ? G.cur = Ae.to : G.cur += Ae.tweeseDelta * (Ie.released ? F.swingSpeed : F.syncSpeed)) : (Ae.time = rt(+new Date - Ae.start, F.speed),
  1662. G.cur = Ae.from + Ae.delta * xe.easing[F.easing](Ae.time / F.speed, Ae.time, 0, 1, F.speed)),
  1663. Ae.to === G.cur ? (G.cur = Ae.to,
  1664. Ie.tweese = _e = 0) : _e = Ge(o),
  1665. L("move"),
  1666. V || (Ve ? U[0].style[Ve] = ke + (F.horizontal ? "translateX" : "translateY") + "(" + -G.cur + "px)" : U[0].style[F.horizontal ? "left" : "top"] = -it(G.cur) + "px"),
  1667. !_e && Ie.released && L("moveEnd"),
  1668. c()
  1669. }
  1670. }
  1671. function c() {
  1672. j.length && (X.cur = G.start === G.end ? 0 : ((Ie.init && !Ie.slidee ? G.dest : G.cur) - G.start) / (G.end - G.start) * X.end,
  1673. X.cur = Fe(it(X.cur), X.start, X.end),
  1674. ye.hPos !== X.cur && (ye.hPos = X.cur,
  1675. Ve ? j[0].style[Ve] = ke + (F.horizontal ? "translateX" : "translateY") + "(" + X.cur + "px)" : j[0].style[F.horizontal ? "left" : "top"] = X.cur + "px"))
  1676. }
  1677. function t() {
  1678. Ce.speed && G.cur !== (0 < Ce.speed ? G.end : G.start) || B.stop(),
  1679. Te = Ie.init ? Ge(t) : 0,
  1680. Ce.now = +new Date,
  1681. Ce.pos = G.cur + (Ce.now - Ce.lastTime) / 1e3 * Ce.speed,
  1682. l(Ie.init ? Ce.pos : it(Ce.pos)),
  1683. Ie.init || G.cur !== G.dest || L("moveEnd"),
  1684. Ce.lastTime = Ce.now
  1685. }
  1686. function i(e, t, i) {
  1687. if ("boolean" === Re(t) && (i = t,
  1688. t = Se),
  1689. t === Se)
  1690. l(G[e], i);
  1691. else {
  1692. if (se && "center" !== e)
  1693. return;
  1694. var n = B.getPos(t);
  1695. n && l(n[e], i, !se)
  1696. }
  1697. }
  1698. function h(e) {
  1699. return null != e ? De(e) ? 0 <= e && e < $.length ? e : -1 : J.index(e) : -1
  1700. }
  1701. function u(e) {
  1702. return h(De(e) && e < 0 ? e + $.length : e)
  1703. }
  1704. function m(e, t) {
  1705. var i = h(e);
  1706. return !(!le || i < 0) && (ye.active === i && !t || (J.eq(ee.activeItem).removeClass(F.activeClass),
  1707. J.eq(i).addClass(F.activeClass),
  1708. ye.active = ee.activeItem = i,
  1709. p(),
  1710. L("active", i)),
  1711. i)
  1712. }
  1713. function d(e) {
  1714. e = Fe(De(e) ? e : G.dest, G.start, G.end);
  1715. var t = {}
  1716. , i = ae ? 0 : H / 2;
  1717. if (!V)
  1718. for (var n = 0, r = Q.length; n < r; n++) {
  1719. if (e >= G.end || n === Q.length - 1) {
  1720. t.activePage = Q.length - 1;
  1721. break
  1722. }
  1723. if (e <= Q[n] + i) {
  1724. t.activePage = n;
  1725. break
  1726. }
  1727. }
  1728. if (le) {
  1729. for (var o = !1, a = !1, s = !1, l = 0, c = $.length; l < c; l++)
  1730. if (!1 === o && e <= $[l].start + $[l].half && (o = l),
  1731. !1 === s && e <= $[l].center + $[l].half && (s = l),
  1732. l === c - 1 || e <= $[l].end + $[l].half) {
  1733. a = l;
  1734. break
  1735. }
  1736. t.firstItem = De(o) ? o : 0,
  1737. t.centerItem = De(s) ? s : t.firstItem,
  1738. t.lastItem = De(a) ? a : t.centerItem
  1739. }
  1740. return t
  1741. }
  1742. function v(e) {
  1743. xe.extend(ee, d(e))
  1744. }
  1745. function p() {
  1746. var e = G.dest <= G.start
  1747. , t = G.dest >= G.end
  1748. , i = (e ? 1 : 0) | (t ? 2 : 0);
  1749. if (ye.slideePosState !== i && (ye.slideePosState = i,
  1750. ge.is("button,input") && ge.prop("disabled", e),
  1751. me.is("button,input") && me.prop("disabled", t),
  1752. ge.add(de)[e ? "addClass" : "removeClass"](F.disabledClass),
  1753. me.add(ue)[t ? "addClass" : "removeClass"](F.disabledClass)),
  1754. ye.fwdbwdState !== i && Ie.released && (ye.fwdbwdState = i,
  1755. de.is("button,input") && de.prop("disabled", e),
  1756. ue.is("button,input") && ue.prop("disabled", t)),
  1757. le && null != ee.activeItem) {
  1758. var n = 0 === ee.activeItem
  1759. , r = ee.activeItem >= $.length - 1
  1760. , o = (n ? 1 : 0) | (r ? 2 : 0);
  1761. ye.itemsButtonState !== o && (ye.itemsButtonState = o,
  1762. pe.is("button,input") && pe.prop("disabled", n),
  1763. fe.is("button,input") && fe.prop("disabled", r),
  1764. pe[n ? "addClass" : "removeClass"](F.disabledClass),
  1765. fe[r ? "addClass" : "removeClass"](F.disabledClass))
  1766. }
  1767. }
  1768. function r(e, t, i) {
  1769. if (e = u(e),
  1770. t = u(t),
  1771. -1 < e && -1 < t && e !== t && (!i || t !== e - 1) && (i || t !== e + 1)) {
  1772. J.eq(e)[i ? "insertAfter" : "insertBefore"]($[t].el);
  1773. var n = e < t ? e : i ? t : t - 1
  1774. , r = t < e ? e : i ? t + 1 : t
  1775. , o = t < e;
  1776. null != ee.activeItem && (e === ee.activeItem ? ye.active = ee.activeItem = i ? o ? t + 1 : t : o ? t : t - 1 : ee.activeItem > n && ee.activeItem < r && (ye.active = ee.activeItem += o ? 1 : -1)),
  1777. a()
  1778. }
  1779. }
  1780. function f(e, t) {
  1781. for (var i = 0, n = ve[e].length; i < n; i++)
  1782. if (ve[e][i] === t)
  1783. return i;
  1784. return -1
  1785. }
  1786. function g() {
  1787. Ie.released && !B.isPaused && B.resume()
  1788. }
  1789. function y(e) {
  1790. return it(Fe(e, X.start, X.end) / X.end * (G.end - G.start)) + G.start
  1791. }
  1792. function A() {
  1793. Ie.history[0] = Ie.history[1],
  1794. Ie.history[1] = Ie.history[2],
  1795. Ie.history[2] = Ie.history[3],
  1796. Ie.history[3] = Ie.delta
  1797. }
  1798. function C(e) {
  1799. Ie.released = 0,
  1800. Ie.source = e,
  1801. Ie.slidee = "slidee" === e
  1802. }
  1803. function I(e) {
  1804. var t = "touchstart" === e.type
  1805. , i = e.data.source
  1806. , n = "slidee" === i;
  1807. Ie.init || !t && b(e.target) || !("handle" !== i || F.dragHandle && X.start !== X.end) || n && !(t ? F.touchDragging : F.mouseDragging && e.which < 2) || (t || Pe(e),
  1808. C(i),
  1809. Ie.init = 0,
  1810. Ie.$source = xe(e.target),
  1811. Ie.touch = t,
  1812. Ie.pointer = t ? e.originalEvent.touches[0] : e,
  1813. Ie.initX = Ie.pointer.pageX,
  1814. Ie.initY = Ie.pointer.pageY,
  1815. Ie.initPos = n ? G.cur : X.cur,
  1816. Ie.start = +new Date,
  1817. Ie.time = 0,
  1818. Ie.path = 0,
  1819. Ie.delta = 0,
  1820. Ie.locked = 0,
  1821. Ie.history = [0, 0, 0, 0],
  1822. Ie.pathToLock = n ? t ? 30 : 10 : 0,
  1823. We.on(t ? qe : Ye, E),
  1824. B.pause(1),
  1825. (n ? U : j).addClass(F.draggedClass),
  1826. L("moveStart"),
  1827. n && (be = setInterval(A, 10)))
  1828. }
  1829. function E(e) {
  1830. if (Ie.released = "mouseup" === e.type || "touchend" === e.type,
  1831. Ie.pointer = Ie.touch ? e.originalEvent[Ie.released ? "changedTouches" : "touches"][0] : e,
  1832. Ie.pathX = Ie.pointer.pageX - Ie.initX,
  1833. Ie.pathY = Ie.pointer.pageY - Ie.initY,
  1834. Ie.path = et(tt(Ie.pathX, 2) + tt(Ie.pathY, 2)),
  1835. Ie.delta = F.horizontal ? Ie.pathX : Ie.pathY,
  1836. Ie.released || !(Ie.path < 1)) {
  1837. if (!Ie.init) {
  1838. if (!(F.horizontal ? $e(Ie.pathX) > $e(Ie.pathY) : $e(Ie.pathX) < $e(Ie.pathY)))
  1839. return _();
  1840. Ie.init = 1
  1841. }
  1842. Pe(e),
  1843. !Ie.locked && Ie.path > Ie.pathToLock && Ie.slidee && (Ie.locked = 1,
  1844. Ie.$source.on(Ze, Oe)),
  1845. Ie.released && (_(),
  1846. F.releaseSwing && Ie.slidee && (Ie.swing = (Ie.delta - Ie.history[0]) / 40 * 300,
  1847. Ie.delta += Ie.swing,
  1848. Ie.tweese = 10 < $e(Ie.swing))),
  1849. l(Ie.slidee ? it(Ie.initPos - Ie.delta) : y(Ie.initPos + Ie.delta))
  1850. }
  1851. }
  1852. function _() {
  1853. clearInterval(be),
  1854. Ie.released = !0,
  1855. We.off(Ie.touch ? qe : Ye, E),
  1856. (Ie.slidee ? U : j).removeClass(F.draggedClass),
  1857. setTimeout(function() {
  1858. Ie.$source.off(Ze, Oe)
  1859. }),
  1860. G.cur === G.dest && Ie.init && L("moveEnd"),
  1861. B.resume(1),
  1862. Ie.init = 0
  1863. }
  1864. function b(e) {
  1865. return ~xe.inArray(e.nodeName, Qe) || xe(e).is(F.interactive)
  1866. }
  1867. function w() {
  1868. B.stop(),
  1869. We.off("mouseup", w)
  1870. }
  1871. function T(e) {
  1872. switch (Pe(e),
  1873. this) {
  1874. case ue[0]:
  1875. case de[0]:
  1876. B.moveBy(ue.is(this) ? F.moveBy : -F.moveBy),
  1877. We.on("mouseup", w);
  1878. break;
  1879. case pe[0]:
  1880. B.prev();
  1881. break;
  1882. case fe[0]:
  1883. B.next();
  1884. break;
  1885. case ge[0]:
  1886. B.prevPage();
  1887. break;
  1888. case me[0]:
  1889. B.nextPage()
  1890. }
  1891. }
  1892. function x(e) {
  1893. e.originalEvent[He] = B;
  1894. var t = +new Date;
  1895. if (ot + F.scrollHijack > t && ce[0] !== document && ce[0] !== window)
  1896. ot = t;
  1897. else if (F.scrollBy && G.start !== G.end) {
  1898. var i = function(e) {
  1899. return Ee.curDelta = (F.horizontal ? e.deltaY || e.deltaX : e.deltaY) || -e.wheelDelta,
  1900. Ee.curDelta /= 1 === e.deltaMode ? 3 : 100,
  1901. le ? (Ue = +new Date,
  1902. Ee.last < Ue - Ee.resetTime && (Ee.delta = 0),
  1903. Ee.last = Ue,
  1904. Ee.delta += Ee.curDelta,
  1905. $e(Ee.delta) < 1 ? Ee.finalDelta = 0 : (Ee.finalDelta = it(Ee.delta / 1),
  1906. Ee.delta %= 1),
  1907. Ee.finalDelta) : Ee.curDelta
  1908. }(e.originalEvent);
  1909. (F.scrollTrap || 0 < i && G.dest < G.end || i < 0 && G.dest > G.start) && Pe(e, 1),
  1910. B.slideBy(F.scrollBy * i)
  1911. }
  1912. }
  1913. function S(e) {
  1914. F.clickBar && e.target === W[0] && (Pe(e),
  1915. l(y((F.horizontal ? e.pageX - W.offset().left : e.pageY - W.offset().top) - q / 2)))
  1916. }
  1917. function M(e) {
  1918. if (F.keyboardNavBy)
  1919. switch (e.which) {
  1920. case F.horizontal ? 37 : 38:
  1921. Pe(e),
  1922. B["pages" === F.keyboardNavBy ? "prevPage" : "prev"]();
  1923. break;
  1924. case F.horizontal ? 39 : 40:
  1925. Pe(e),
  1926. B["pages" === F.keyboardNavBy ? "nextPage" : "next"]()
  1927. }
  1928. }
  1929. function R(e) {
  1930. return b(this) ? void (e.originalEvent[He + "ignore"] = !0) : void (this.parentNode !== U[0] || e.originalEvent[He + "ignore"] || B.activate(this))
  1931. }
  1932. function P() {
  1933. this.parentNode === Z[0] && B.activatePage(K.index(this))
  1934. }
  1935. function O(e) {
  1936. F.pauseOnHover && B["mouseenter" === e.type ? "pause" : "resume"](2)
  1937. }
  1938. function L(e, t) {
  1939. if (ve[e]) {
  1940. for (N = ve[e].length,
  1941. Je.length = 0,
  1942. D = 0; D < N; D++)
  1943. Je.push(ve[e][D]);
  1944. for (D = 0; D < N; D++)
  1945. Je[D].call(B, e, t)
  1946. }
  1947. }
  1948. var D, N, F = xe.extend({}, Me.defaults, e), B = this, V = De(s), k = xe(s), U = F.slidee ? xe(F.slidee).eq(0) : k.children().eq(0), H = 0, z = 0, G = {
  1949. start: 0,
  1950. center: 0,
  1951. end: 0,
  1952. cur: 0,
  1953. dest: 0
  1954. }, W = xe(F.scrollBar).eq(0), j = W.children().eq(0), Y = 0, q = 0, X = {
  1955. start: 0,
  1956. end: 0,
  1957. cur: 0
  1958. }, Z = xe(F.pagesBar), K = 0, Q = [], J = 0, $ = [], ee = {
  1959. firstItem: 0,
  1960. lastItem: 0,
  1961. centerItem: 0,
  1962. activeItem: null,
  1963. activePage: 0
  1964. }, te = new Be(k[0]), ie = new Be(U[0]), ne = new Be(W[0]), re = new Be(j[0]), oe = "basic" === F.itemNav, ae = "forceCentered" === F.itemNav, se = "centered" === F.itemNav || ae, le = !V && (oe || se || ae), ce = F.scrollSource ? xe(F.scrollSource) : k, he = F.dragSource ? xe(F.dragSource) : k, ue = xe(F.forward), de = xe(F.backward), pe = xe(F.prev), fe = xe(F.next), ge = xe(F.prevPage), me = xe(F.nextPage), ve = {}, ye = {}, Ae = {}, Ce = {}, Ie = {
  1965. released: 1
  1966. }, Ee = {
  1967. last: 0,
  1968. delta: 0,
  1969. resetTime: 200
  1970. }, _e = 0, be = 0, we = 0, Te = 0;
  1971. V || (s = k[0]),
  1972. B.initialized = 0,
  1973. B.frame = s,
  1974. B.slidee = U[0],
  1975. B.pos = G,
  1976. B.rel = ee,
  1977. B.items = $,
  1978. B.pages = Q,
  1979. B.isPaused = 0,
  1980. B.options = F,
  1981. B.dragging = Ie,
  1982. B.reload = function() {
  1983. a()
  1984. }
  1985. ,
  1986. B.getPos = function(e) {
  1987. if (le) {
  1988. var t = h(e);
  1989. return -1 !== t && $[t]
  1990. }
  1991. var i = U.find(e).eq(0);
  1992. if (i[0]) {
  1993. var n = F.horizontal ? i.offset().left - U.offset().left : i.offset().top - U.offset().top
  1994. , r = i[F.horizontal ? "outerWidth" : "outerHeight"]();
  1995. return {
  1996. start: n,
  1997. center: n - H / 2 + r / 2,
  1998. end: n - H + r,
  1999. size: r
  2000. }
  2001. }
  2002. return !1
  2003. }
  2004. ,
  2005. B.moveBy = function(e) {
  2006. Ce.speed = e,
  2007. !Ie.init && Ce.speed && G.cur !== (0 < Ce.speed ? G.end : G.start) && (Ce.lastTime = +new Date,
  2008. Ce.startPos = G.cur,
  2009. C("button"),
  2010. Ie.init = 1,
  2011. L("moveStart"),
  2012. ze(Te),
  2013. t())
  2014. }
  2015. ,
  2016. B.stop = function() {
  2017. "button" === Ie.source && (Ie.init = 0,
  2018. Ie.released = 1)
  2019. }
  2020. ,
  2021. B.prev = function() {
  2022. B.activate(null == ee.activeItem ? 0 : ee.activeItem - 1)
  2023. }
  2024. ,
  2025. B.next = function() {
  2026. B.activate(null == ee.activeItem ? 0 : ee.activeItem + 1)
  2027. }
  2028. ,
  2029. B.prevPage = function() {
  2030. B.activatePage(ee.activePage - 1)
  2031. }
  2032. ,
  2033. B.nextPage = function() {
  2034. B.activatePage(ee.activePage + 1)
  2035. }
  2036. ,
  2037. B.slideBy = function(e, t) {
  2038. e && (le ? B[se ? "toCenter" : "toStart"](Fe((se ? ee.centerItem : ee.firstItem) + F.scrollBy * e, 0, $.length)) : l(G.dest + e, t))
  2039. }
  2040. ,
  2041. B.slideTo = function(e, t) {
  2042. l(e, t)
  2043. }
  2044. ,
  2045. B.toStart = function(e, t) {
  2046. i("start", e, t)
  2047. }
  2048. ,
  2049. B.toEnd = function(e, t) {
  2050. i("end", e, t)
  2051. }
  2052. ,
  2053. B.toCenter = function(e, t) {
  2054. i("center", e, t)
  2055. }
  2056. ,
  2057. B.getIndex = h,
  2058. B.activate = function(e, t) {
  2059. var i = m(e);
  2060. F.smart && !1 !== i && (se ? B.toCenter(i, t) : i >= ee.lastItem ? B.toStart(i, t) : i <= ee.firstItem ? B.toEnd(i, t) : g())
  2061. }
  2062. ,
  2063. B.activatePage = function(e, t) {
  2064. De(e) && l(Q[Fe(e, 0, Q.length - 1)], t)
  2065. }
  2066. ,
  2067. B.resume = function(e) {
  2068. F.cycleBy && F.cycleInterval && ("items" !== F.cycleBy || $[0] && null != ee.activeItem) && !(e < B.isPaused) && (B.isPaused = 0,
  2069. we ? we = clearTimeout(we) : L("resume"),
  2070. we = setTimeout(function() {
  2071. switch (L("cycle"),
  2072. F.cycleBy) {
  2073. case "items":
  2074. B.activate(ee.activeItem >= $.length - 1 ? 0 : ee.activeItem + 1);
  2075. break;
  2076. case "pages":
  2077. B.activatePage(ee.activePage >= Q.length - 1 ? 0 : ee.activePage + 1)
  2078. }
  2079. }, F.cycleInterval))
  2080. }
  2081. ,
  2082. B.pause = function(e) {
  2083. e < B.isPaused || (B.isPaused = e || 100,
  2084. we && (we = clearTimeout(we),
  2085. L("pause")))
  2086. }
  2087. ,
  2088. B.toggle = function() {
  2089. B[we ? "pause" : "resume"]()
  2090. }
  2091. ,
  2092. B.set = function(e, t) {
  2093. xe.isPlainObject(e) ? xe.extend(F, e) : F.hasOwnProperty(e) && (F[e] = t)
  2094. }
  2095. ,
  2096. B.add = function(e, t) {
  2097. var i = xe(e);
  2098. le ? (null == t || !$[0] || t >= $.length ? i.appendTo(U) : $.length && i.insertBefore($[t].el),
  2099. null != ee.activeItem && t <= ee.activeItem && (ye.active = ee.activeItem += i.length)) : U.append(i),
  2100. a()
  2101. }
  2102. ,
  2103. B.remove = function(e) {
  2104. if (le) {
  2105. var t = u(e);
  2106. if (-1 < t) {
  2107. J.eq(t).remove();
  2108. var i = t === ee.activeItem;
  2109. null != ee.activeItem && t < ee.activeItem && (ye.active = --ee.activeItem),
  2110. a(),
  2111. i && (ye.active = null,
  2112. B.activate(ee.activeItem))
  2113. }
  2114. } else
  2115. xe(e).remove(),
  2116. a()
  2117. }
  2118. ,
  2119. B.moveAfter = function(e, t) {
  2120. r(e, t, 1)
  2121. }
  2122. ,
  2123. B.moveBefore = function(e, t) {
  2124. r(e, t)
  2125. }
  2126. ,
  2127. B.on = function(e, t) {
  2128. if ("object" === Re(e))
  2129. for (var i in e)
  2130. e.hasOwnProperty(i) && B.on(i, e[i]);
  2131. else if ("function" === Re(t))
  2132. for (var n = e.split(" "), r = 0, o = n.length; r < o; r++)
  2133. ve[n[r]] = ve[n[r]] || [],
  2134. -1 === f(n[r], t) && ve[n[r]].push(t);
  2135. else if ("array" === Re(t))
  2136. for (var a = 0, s = t.length; a < s; a++)
  2137. B.on(e, t[a])
  2138. }
  2139. ,
  2140. B.one = function(t, i) {
  2141. B.on(t, function e() {
  2142. i.apply(B, arguments),
  2143. B.off(t, e)
  2144. })
  2145. }
  2146. ,
  2147. B.off = function(e, t) {
  2148. if (t instanceof Array)
  2149. for (var i = 0, n = t.length; i < n; i++)
  2150. B.off(e, t[i]);
  2151. else
  2152. for (var r = e.split(" "), o = 0, a = r.length; o < a; o++)
  2153. if (ve[r[o]] = ve[r[o]] || [],
  2154. null == t)
  2155. ve[r[o]].length = 0;
  2156. else {
  2157. var s = f(r[o], t);
  2158. -1 !== s && ve[r[o]].splice(s, 1)
  2159. }
  2160. }
  2161. ,
  2162. B.destroy = function() {
  2163. return ce.add(j).add(W).add(Z).add(ue).add(de).add(pe).add(fe).add(ge).add(me).off("." + He),
  2164. We.off("keydown", M),
  2165. pe.add(fe).add(ge).add(me).removeClass(F.disabledClass),
  2166. J && null != ee.activeItem && J.eq(ee.activeItem).removeClass(F.activeClass),
  2167. Z.empty(),
  2168. V || (k.off("." + He),
  2169. te.restore(),
  2170. ie.restore(),
  2171. ne.restore(),
  2172. re.restore(),
  2173. xe.removeData(s, He)),
  2174. $.length = Q.length = 0,
  2175. ye = {},
  2176. B.initialized = 0,
  2177. B
  2178. }
  2179. ,
  2180. B.init = function() {
  2181. if (!B.initialized) {
  2182. B.on(n);
  2183. var e = ["overflow", "position"]
  2184. , t = ["position", "webkitTransform", "msTransform", "transform", "left", "top", "width", "height"];
  2185. te.save.apply(te, e),
  2186. ne.save.apply(ne, e),
  2187. ie.save.apply(ie, t),
  2188. re.save.apply(re, t);
  2189. var i = j;
  2190. return V || (i = i.add(U),
  2191. k.css("overflow", "hidden"),
  2192. Ve || "static" !== k.css("position") || k.css("position", "relative")),
  2193. Ve ? ke && i.css(Ve, ke) : ("static" === W.css("position") && W.css("position", "relative"),
  2194. i.css({
  2195. position: "absolute"
  2196. })),
  2197. F.forward && ue.on(Ke, T),
  2198. F.backward && de.on(Ke, T),
  2199. F.prev && pe.on(Ze, T),
  2200. F.next && fe.on(Ze, T),
  2201. F.prevPage && ge.on(Ze, T),
  2202. F.nextPage && me.on(Ze, T),
  2203. ce.on(Xe, x),
  2204. W[0] && W.on(Ze, S),
  2205. le && F.activateOn && k.on(F.activateOn + "." + He, "*", R),
  2206. Z[0] && F.activatePageOn && Z.on(F.activatePageOn + "." + He, "*", P),
  2207. he.on(je, {
  2208. source: "slidee"
  2209. }, I),
  2210. j && j.on(je, {
  2211. source: "handle"
  2212. }, I),
  2213. We.on("keydown", M),
  2214. V || (k.on("mouseenter." + He + " mouseleave." + He, O),
  2215. k.on("scroll." + He, Le)),
  2216. B.initialized = 1,
  2217. a(!0),
  2218. F.cycleBy && !V && B[F.startPaused ? "pause" : "resume"](),
  2219. B
  2220. }
  2221. }
  2222. }
  2223. function Re(e) {
  2224. return null == e ? String(e) : "object" == typeof e || "function" == typeof e ? Object.prototype.toString.call(e).match(/\s([a-z]+)/i)[1].toLowerCase() || "object" : typeof e
  2225. }
  2226. function Pe(e, t) {
  2227. e.preventDefault(),
  2228. t && e.stopPropagation()
  2229. }
  2230. function Oe(e) {
  2231. Pe(e, 1),
  2232. xe(this).off(e.type, Oe)
  2233. }
  2234. function Le() {
  2235. this.scrollLeft = 0,
  2236. this.scrollTop = 0
  2237. }
  2238. function De(e) {
  2239. return !isNaN(parseFloat(e)) && isFinite(e)
  2240. }
  2241. function Ne(e, t) {
  2242. return 0 | it(String(e.css(t)).replace(/[^\-0-9.]/g, ""))
  2243. }
  2244. function Fe(e, t, i) {
  2245. return e < t ? t : i < e ? i : e
  2246. }
  2247. function Be(t) {
  2248. var i = {
  2249. style: {},
  2250. save: function() {
  2251. if (t && t.nodeType) {
  2252. for (var e = 0; e < arguments.length; e++)
  2253. i.style[arguments[e]] = t.style[arguments[e]];
  2254. return i
  2255. }
  2256. },
  2257. restore: function() {
  2258. if (t && t.nodeType) {
  2259. for (var e in i.style)
  2260. i.style.hasOwnProperty(e) && (t.style[e] = i.style[e]);
  2261. return i
  2262. }
  2263. }
  2264. };
  2265. return i
  2266. }
  2267. var Ve, ke, Ue, r, o, He = "sly", ze = e.cancelAnimationFrame || e.cancelRequestAnimationFrame, Ge = e.requestAnimationFrame, We = xe(document), je = "touchstart." + He + " mousedown." + He, Ye = "mousemove." + He + " mouseup." + He, qe = "touchmove." + He + " touchend." + He, Xe = (document.implementation.hasFeature("Event.wheel", "3.0") ? "wheel." : "mousewheel.") + He, Ze = "click." + He, Ke = "mousedown." + He, Qe = ["INPUT", "SELECT", "BUTTON", "TEXTAREA"], Je = [], $e = Math.abs, et = Math.sqrt, tt = Math.pow, it = Math.round, nt = Math.max, rt = Math.min, ot = 0;
  2268. function t(e) {
  2269. for (var t = 0, i = r.length; t < i; t++) {
  2270. var n = r[t] ? r[t] + e.charAt(0).toUpperCase() + e.slice(1) : e;
  2271. if (null != o.style[n])
  2272. return n
  2273. }
  2274. }
  2275. We.on(Xe, function(e) {
  2276. var t = e.originalEvent[He]
  2277. , i = +new Date;
  2278. (!t || t.options.scrollHijack < i - ot) && (ot = i)
  2279. }),
  2280. function(t) {
  2281. Ge = t.requestAnimationFrame || t.webkitRequestAnimationFrame || function(e) {
  2282. var t = (new Date).getTime()
  2283. , i = Math.max(0, 16 - (t - r))
  2284. , n = setTimeout(e, i);
  2285. return r = t,
  2286. n
  2287. }
  2288. ;
  2289. var r = (new Date).getTime()
  2290. , i = t.cancelAnimationFrame || t.webkitCancelAnimationFrame || t.clearTimeout;
  2291. ze = function(e) {
  2292. i.call(t, e)
  2293. }
  2294. }(window),
  2295. r = ["", "webkit", "moz", "ms", "o"],
  2296. o = document.createElement("div"),
  2297. Ve = t("transform"),
  2298. ke = t("perspective") ? "translateZ(0) " : "",
  2299. e.Sly = Me,
  2300. xe.fn.sly = function(n, r) {
  2301. var o, a;
  2302. return xe.isPlainObject(n) || ("string" !== Re(n) && !1 !== n || (o = !1 === n ? "destroy" : n,
  2303. a = Array.prototype.slice.call(arguments, 1)),
  2304. n = {}),
  2305. this.each(function(e, t) {
  2306. var i = xe.data(t, He);
  2307. i || o ? i && o && i[o] && i[o].apply(i, a) : i = xe.data(t, He, new Me(t,n,r).init())
  2308. })
  2309. }
  2310. ,
  2311. Me.defaults = {
  2312. slidee: null,
  2313. horizontal: !1,
  2314. itemNav: null,
  2315. itemSelector: null,
  2316. smart: !1,
  2317. activateOn: null,
  2318. activateMiddle: !1,
  2319. scrollSource: null,
  2320. scrollBy: 0,
  2321. scrollHijack: 300,
  2322. scrollTrap: !1,
  2323. dragSource: null,
  2324. mouseDragging: !1,
  2325. touchDragging: !1,
  2326. releaseSwing: !1,
  2327. swingSpeed: .2,
  2328. elasticBounds: !1,
  2329. interactive: null,
  2330. scrollBar: null,
  2331. dragHandle: !1,
  2332. dynamicHandle: !1,
  2333. minHandleSize: 50,
  2334. clickBar: !1,
  2335. syncSpeed: .5,
  2336. pagesBar: null,
  2337. activatePageOn: null,
  2338. pageBuilder: function(e) {
  2339. return "<li>" + (e + 1) + "</li>"
  2340. },
  2341. forward: null,
  2342. backward: null,
  2343. prev: null,
  2344. next: null,
  2345. prevPage: null,
  2346. nextPage: null,
  2347. cycleBy: null,
  2348. cycleInterval: 5e3,
  2349. pauseOnHover: !1,
  2350. startPaused: !1,
  2351. moveBy: 300,
  2352. speed: 0,
  2353. easing: "swing",
  2354. startAt: null,
  2355. keyboardNavBy: null,
  2356. draggedClass: "dragged",
  2357. activeClass: "active",
  2358. disabledClass: "disabled"
  2359. }
  2360. }(jQuery, window),
  2361. function o(a, s, l) {
  2362. function c(i, e) {
  2363. if (!s[i]) {
  2364. if (!a[i]) {
  2365. var t = "function" == typeof require && require;
  2366. if (!e && t)
  2367. return t(i, !0);
  2368. if (h)
  2369. return h(i, !0);
  2370. var n = new Error("Cannot find module '" + i + "'");
  2371. throw n.code = "MODULE_NOT_FOUND",
  2372. n
  2373. }
  2374. var r = s[i] = {
  2375. exports: {}
  2376. };
  2377. a[i][0].call(r.exports, function(e) {
  2378. var t = a[i][1][e];
  2379. return c(t || e)
  2380. }, r, r.exports, o, a, s, l)
  2381. }
  2382. return s[i].exports
  2383. }
  2384. for (var h = "function" == typeof require && require, e = 0; e < l.length; e++)
  2385. c(l[e]);
  2386. return c
  2387. }({
  2388. 1: [function(p, f, e) {
  2389. (function(e) {
  2390. "use strict";
  2391. function t(e) {
  2392. this.player = null,
  2393. this.director = null,
  2394. this.modelManager = null,
  2395. this.container = null,
  2396. this.tagManager = null,
  2397. this.fadeInSpeed = e,
  2398. null !== this.fadeInSpeed && void 0 !== this.fadeInSpeed || (this.fadeInSpeed = 0)
  2399. }
  2400. var r = p("three")
  2401. , i = p("./util/logger")
  2402. , n = (p("./util/common"),
  2403. p("./enum/PlayerEvents"))
  2404. , o = p("./enum/DirectorEvents")
  2405. , a = p("./settings")
  2406. , s = p("./enum/Viewmode")
  2407. , l = (p("./enum/WarpStyle"),
  2408. p("./enum/BlackoutStyle"),
  2409. p("./enum/ModelManagerEvents"))
  2410. , c = p("./enum/tagEvents")
  2411. , h = p("./util/transitions")
  2412. , u = p("./util/lerp")
  2413. , d = new i(e);
  2414. window.THREE = r,
  2415. t.prototype.init = function(e, t, i, n, r) {
  2416. (window.app = this).player = t,
  2417. this.director = e,
  2418. this.modelManager = i,
  2419. this.tagManager = n,
  2420. this.container = r,
  2421. this.updateModel(),
  2422. this.bindEvents()
  2423. }
  2424. ,
  2425. t.prototype.bindEvents = function() {
  2426. this.modelManager.on(l.ActiveModelChanged, this.updateModel.bind(this)),
  2427. this.player.on(n.ModeChanging, this.handlePlayerModeChanging.bind(this)),
  2428. this.player.on(n.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  2429. this.player.on(n.ClosestPanoChanging, this.handleClosestPanoChanging.bind(this)),
  2430. this.player.on(n.StartInside, this.handleStartInside.bind(this)),
  2431. this.player.on(n.StartOutside, this.handleStartOutside.bind(this)),
  2432. this.player.on(n.WarpStarted, this.handleWarpStarted.bind(this)),
  2433. this.director.on(o.ActionInterrupted, this.handleActionInterruption.bind(this)),
  2434. this.tagManager.on(c.TagActivated, this.ontagActivated.bind(this)),
  2435. this.tagManager.on(c.TagNavigation, this.onNavigationTotag.bind(this))
  2436. }
  2437. ,
  2438. t.prototype.updateModel = function() {
  2439. this.model = this.modelManager.getActiveModel()
  2440. }
  2441. ,
  2442. t.prototype.handleWarpStarted = function() {
  2443. this.hidePlayerReticule()
  2444. }
  2445. ,
  2446. t.prototype.ontagActivated = function() {
  2447. this.hidePlayerReticule()
  2448. }
  2449. ,
  2450. t.prototype.onNavigationTotag = function() {
  2451. this.hidePlayerReticule()
  2452. }
  2453. ,
  2454. t.prototype.handlePlayerModeChanging = function(e, t, i) {
  2455. var n = this.modelManager.getActiveModel()
  2456. , r = this.player.is360View(t, i) || this.director.tourIsPlaying ? 0 : a[t].markerOpacity;
  2457. n.fadePanoMarkers(r),
  2458. n.setMode(t)
  2459. }
  2460. ,
  2461. t.prototype.handlePlayerModeChanged = function(e, t) {
  2462. var i = this.modelManager.getActiveModel()
  2463. , n = t === s.PANORAMA ? r.DoubleSide : r.FrontSide;
  2464. i.setSide(n),
  2465. i.setMode(t)
  2466. }
  2467. ,
  2468. t.prototype.handleClosestPanoChanging = function(e, t, i) {
  2469. i !== s.TRANSITIONING && (e && !this.director.tourIsPlaying && e.hoverOff(i),
  2470. t && !this.director.tourIsPlaying && t.hoverOn(i))
  2471. }
  2472. ,
  2473. t.prototype.handleActionInterruption = function() {}
  2474. ,
  2475. t.prototype.handleStartInside = function(e) {
  2476. var t = a[this.player.mode]
  2477. , i = e ? 0 : t.transitionTime * t.skyboxOpacityLength;
  2478. this.fadeIn(this.fadeInSpeed),
  2479. this.model.alpha = 0,
  2480. this.model.skybox.material.uniforms.opacity.value = 1,
  2481. this.model.fadePanoMarkers(e ? 0 : t.markerOpacity);
  2482. var n = this.player.reticule;
  2483. h.start(u.property(n.material, "opacity", 0), i, null, 0, null, "retReOpac")
  2484. }
  2485. ,
  2486. t.prototype.handleStartOutside = function(e) {
  2487. this.fadeIn(e)
  2488. }
  2489. ,
  2490. t.prototype.fadeIn = function(e) {
  2491. null != e || (e = 2e3,
  2492. d.warn("DisplayController.fadeIn -> no transition time specified, defaulting to 2000 ms.")),
  2493. $(this.container).fadeIn(e)
  2494. }
  2495. ,
  2496. t.prototype.hidePlayerReticule = function() {
  2497. this.player.reticule.hide()
  2498. }
  2499. ,
  2500. f.exports = t
  2501. }
  2502. ).call(this, "/js/DisplayController.js")
  2503. }
  2504. , {
  2505. "./enum/BlackoutStyle": 18,
  2506. "./enum/DirectorEvents": 23,
  2507. "./enum/tagEvents": 32,
  2508. "./enum/ModelManagerEvents": 33,
  2509. "./enum/PlayerEvents": 40,
  2510. "./enum/Viewmode": 51,
  2511. "./enum/WarpStyle": 52,
  2512. "./settings": 166,
  2513. "./util/common": 185,
  2514. "./util/lerp": 188,
  2515. "./util/logger": 189,
  2516. "./util/transitions": 195,
  2517. three: 217
  2518. }],
  2519. 2: [function(e, t, i) {
  2520. "use strict";
  2521. function n() {
  2522. this.baseStartTime = performance.timing.navigationStart,
  2523. this.loadingStartTime = null,
  2524. this.waitingStartTime = null,
  2525. this.appReadyTime = null
  2526. }
  2527. n.prototype.setBaseStartTime = function(e) {
  2528. this.baseStartTime = e || Date.now()
  2529. }
  2530. ,
  2531. n.prototype.setWaitingStartTime = function(e) {
  2532. this.waitingStartTime = e || Date.now()
  2533. }
  2534. ,
  2535. n.prototype.setLoadingStartTime = function(e) {
  2536. this.loadingStartTime = e || Date.now()
  2537. }
  2538. ,
  2539. n.prototype.setAppReadyTime = function(e) {
  2540. this.appReadyTime = e || Date.now()
  2541. }
  2542. ,
  2543. n.prototype.calcFullLoadingTime = function() {
  2544. var e = this.appReadyTime - this.baseStartTime;
  2545. return this.waitingStartTime && (e -= this.loadingStartTime - this.waitingStartTime),
  2546. e
  2547. }
  2548. ,
  2549. t.exports = n
  2550. }
  2551. , {}],
  2552. 3: [function(i, n, e) {
  2553. (function(e) {
  2554. "use strict";
  2555. function a() {
  2556. return 100 * Math.random()
  2557. }
  2558. var t = i("./util/logger")
  2559. , s = i("./util/browser")
  2560. , l = new t(e)
  2561. , c = window.MP_AB_TESTS = window.MP_AB_TESTS || {
  2562. initialized: !1,
  2563. init: function(e, t) {
  2564. if (t = t || {},
  2565. !this.initialized) {
  2566. for (var i in this.initialized = !0,
  2567. s.valueFromHash("tilegen") && (t.tilegen = 1 === s.valueFromHash("tilegen", 0)),
  2568. s.valueFromHash("imgopt") && (t.imgopt = 1 === s.valueFromHash("imgopt", 0)),
  2569. e) {
  2570. var n = i.match("^sc_tilegen_([0-9]+)$");
  2571. n && (c.tilegen = a() < parseInt(n[1]));
  2572. var r = i.match("^sc_imgopt_([0-9]+)$");
  2573. r && (c.imgopt = a() < parseInt(r[1]))
  2574. }
  2575. for (var o in t)
  2576. c[o] = t[o],
  2577. l.debug("A/B override:", o, c[o])
  2578. }
  2579. },
  2580. changeIfTileGenerating: function(e) {
  2581. return c.tilegen && (e += -1 === e.indexOf("?") ? "?" : "&",
  2582. e += ""),
  2583. e
  2584. },
  2585. changeIfImageOptimzing: function(e) {
  2586. if(e.includes("blob:http"))return e;//add
  2587. return c.imgopt && -1 === e.indexOf("imgopt=1") && (e += -1 === e.indexOf("?") ? "?" : "&",
  2588. e += ""),
  2589. e
  2590. },
  2591. tilegen: !1,
  2592. imgopt: !1
  2593. };
  2594. n.exports = c
  2595. }
  2596. ).call(this, "/js/ab.js")
  2597. }
  2598. , {
  2599. "./util/browser": 182,
  2600. "./util/logger": 189
  2601. }],
  2602. 4: [function(u, d, e) {
  2603. (function(e) {
  2604. "use strict";
  2605. function r(n, e, t, i) {
  2606. function r(e) {
  2607. a[e.sid] = !0;
  2608. var t = e.billboard.media && e.billboard.media.type
  2609. , i = {
  2610. tag_id: e.sid,
  2611. tags_visited: Object.keys(a).length,
  2612. tag_count: Object.keys(n.tags).length,
  2613. tag_view_count: ++d,
  2614. has_media: !!t
  2615. };
  2616. t && (i.media_type = t),
  2617. g("tag_opened", i)
  2618. }
  2619. var o, a = {}, s = Date.now() - P, l = null;
  2620. i && (l = Date.now() - window.navigationStart);
  2621. try {
  2622. o = /* n.data.player_options.highlight_reel && */ 0 < n.heroLocations.length
  2623. } catch (n) {
  2624. o = !1
  2625. }
  2626. var c, h = n.supportsVR;
  2627. h || (c = "VR disabled at the model/account level",
  2628. y.valueFromHash("vr") === w.NONE ? c = "VR disabled, using &vr=0" : y.detectAndroid() ? _.isDeviceSupported(b.Android) || (c = "VR disabled, unsupported Android version") : y.detectIOS() && (_.isDeviceSupported(b.IOS) || (c = "VR disabled, unsupported iOS version"))),
  2629. g("model_loaded", {
  2630. duration: s,
  2631. duration_from_navigation_start: l,
  2632. has_hlr: o,
  2633. has_vr: h,
  2634. vr_reason: c
  2635. });
  2636. var u = 0;
  2637. n.panos.forEach(function(e) {
  2638. e.on("enter", function() {
  2639. f("pano_viewed", {
  2640. pano_id: e.id,
  2641. pano_view_count: ++u,
  2642. alignment_type: e.alignmentType,
  2643. interaction_source: R,
  2644. navigation_source: v
  2645. })
  2646. })
  2647. });
  2648. var d = 0;
  2649. for (var p in n.tags)
  2650. n.tags[p].billboard.on(M.OPENED, r.bind(this, n.tags[p]));
  2651. e.on("tour_auto", function(e) {
  2652. v = "tour_" + e
  2653. }),
  2654. e.on("tour_manual", function(e) {
  2655. R = "gui-" + e,
  2656. v = "tour_manual"
  2657. }),
  2658. t.on(C.InteractionKey, function() {
  2659. e.mode === A.TRANSITIONING || e.flying || m(C.InteractionKey)
  2660. }),
  2661. t.on(C.InteractionDirect, function() {
  2662. e.mode === A.TRANSITIONING || e.flying || m(C.InteractionDirect)
  2663. }),
  2664. function(t) {
  2665. I.on(T.OPENED, function() {
  2666. f("showcase_share_intent", {
  2667. pano_id: t.currentPano && t.currentPano.id
  2668. })
  2669. }),
  2670. I.on(T.LINK_CLICKED, function(e) {
  2671. f("showcase_share_action", {
  2672. channel: e.channel,
  2673. pano_id: t.currentPano && t.currentPano.id
  2674. })
  2675. }),
  2676. E.on(x.ORIGIN_LINK_CLICKED, function() {
  2677. f("showcase_share_origin_link_clicked")
  2678. })
  2679. }(e),
  2680. function() {
  2681. _.on(S.OPENED, f.bind(this, "showcase_gui", {
  2682. gui_action: "click_vr_button"
  2683. })),
  2684. _.on(S.LAUNCH, function(e) {
  2685. f("showcase_gui", {
  2686. gui_action: "launch_vr",
  2687. vr_platform: e.vr_platform,
  2688. vr_app: e.vr_app
  2689. })
  2690. }),
  2691. _.on(S.PREV, f.bind(this, "showcase_gui", {
  2692. gui_action: "vr_modal_prev"
  2693. })),
  2694. _.on(S.NEXT, function(e) {
  2695. f("showcase_gui", {
  2696. gui_action: e.nextAction
  2697. })
  2698. }),
  2699. _.on(S.CLOSED, f.bind(this, "showcase_gui", {
  2700. gui_action: "vr_modal_close"
  2701. })),
  2702. _.on(S.falseICECHOSEN, function(e) {
  2703. f("showcase_gui", {
  2704. gui_action: e.name + " "
  2705. })
  2706. }),
  2707. _.on(S.STORE, function(e) {
  2708. f("showcase_gui", {
  2709. gui_action: "launch_store",
  2710. store: e
  2711. })
  2712. })
  2713. }()
  2714. }
  2715. function f(e, t) {
  2716. if (t = t || {},
  2717. i)
  2718. try {
  2719. window.analytics.track(e, s.extendObject(t, c), {
  2720. context: {
  2721. app: {
  2722. name: "showcase",
  2723. version: "2.25.6-0-gd87e5b1"
  2724. },
  2725. screen: {
  2726. width: window.screen.width,
  2727. height: window.screen.height,
  2728. density: window.devicePixelRatio
  2729. }
  2730. }
  2731. })
  2732. } catch (t) {
  2733. console.warn("Failed to send data to segment for " + e)
  2734. }
  2735. }
  2736. function g(e, t) {
  2737. f(e, t = t || {})
  2738. }
  2739. function m(e, t) {
  2740. R = e === C.InteractionGui ? "gui-" + t : e,
  2741. v = "self_guided"
  2742. }
  2743. var v, o, a = (u("three"),
  2744. u("./util/ajax"),
  2745. u("./ab")), y = u("./util/browser"), s = u("./util/common"), t = u("./settings"), A = (u("./localization/localize"),
  2746. u("./enum/Viewmode")), C = u("./enum/ControlEvents"), I = u("./gui/sharing/modal"), E = u("./gui/title/titleBar"), _ = u("./gui/vr/vrModal"), b = u("./enum/VRPlatforms"), w = u("./enum/VROption"), T = u("./gui/sharing/ShareEvents"), x = u("./gui/title/TitleEvents"), S = u("./gui/vr/vrEvent"), M = u("./tag/Billboard/BillboardEvent"), l = new (u("./util/logger"))(e), R = (u("./enum/PlayerEvents"),
  2747. "direct"), i = null, n = !1, P = null, c = null, h = s.uuid4();
  2748. d.exports = {
  2749. report: function(e, t, i, n) {
  2750. !function(e, t) {
  2751. if (o)
  2752. try {
  2753. o.addEvent(e, s.extendObject({
  2754. host: window.location.host,
  2755. keen: {
  2756. addons: [{
  2757. name: "keen:ua_parser",
  2758. input: {
  2759. ua_string: "user_agent"
  2760. },
  2761. output: "parsed_user_agent"
  2762. }]
  2763. },
  2764. user_agent: "${keen.user_agent}",
  2765. referrer: {
  2766. url: s.normalizeUrl(document.referrer),
  2767. domain: s.domainFromUrl(document.referrer),
  2768. url_original: document.referrer
  2769. },
  2770. embedded: y.inIframe(),
  2771. is_mobile: y.isMobile(),
  2772. version: "2.25.6-0-gd87e5b1"
  2773. }, t))
  2774. } catch (e) {
  2775. l.warn("analytics.report -> client.addEvent() error (is there blocking software installed?). Error message: " + e)
  2776. }
  2777. }("Session starts", {
  2778. model: e,
  2779. status: t,
  2780. loadtime: Date.now() - (P || Date.now()),
  2781. loadtime_from_navigation_start: i ? Date.now() - window.navigationStart : null,
  2782. autoplay: i,
  2783. quickstart: n,
  2784. ab_tilegen: a.tilegen,
  2785. ab_imgopt: a.imgopt
  2786. })
  2787. },
  2788. impression: function(e) {
  2789. g("impression", {
  2790. visible: void 0 === (e = e || {}).isVisible || e.isVisible,
  2791. url_params: (void 0 !== e.immediate && e.immediate,
  2792. window.location.search.substr(1).split("&"))
  2793. })
  2794. },
  2795. initKeen: function(e) {
  2796. return e.token && e.appId ? void (o = new Keen({
  2797. projectId: e.appId,
  2798. writeKey: e.token,
  2799. readKey: "",
  2800. requestType: "xhr"
  2801. })) : void l.warn("no keen token/appId")
  2802. },
  2803. initSegment: function(e) {
  2804. return e.token ? (i = e.token,
  2805. window.analytics.load(e.token),
  2806. c = {
  2807. model_id: e.model,
  2808. start_source: e.startSource,
  2809. autoplay: e.autoplay,
  2810. quickstart: e.quickstart,
  2811. language_tag: t.languageTag,
  2812. is_mobile: y.isMobile(),
  2813. iframe: y.inIframe(),
  2814. aspect_ratio: y.aspectRatio(),
  2815. session_id: h,
  2816. window: {
  2817. width: $("#player").width(),
  2818. height: $("#player").height()
  2819. },
  2820. platform: {
  2821. browser: {
  2822. name: $.ua.browser.name,
  2823. major: $.ua.browser.major,
  2824. version: $.ua.browser.version
  2825. },
  2826. os: {
  2827. name: $.ua.os.name,
  2828. version: $.ua.os.version
  2829. },
  2830. device: {
  2831. vendor: $.ua.device.vendor,
  2832. model: $.ua.device.model,
  2833. type: $.ua.device.type
  2834. }
  2835. }
  2836. },
  2837. n = Math.random() < t.analytics.sessionTrackingRate,
  2838. l.debug("tracking sample rate = " + t.analytics.sessionTrackingRate),
  2839. void l.debug("tracking this session = " + n)) : void l.warn("no segment token")
  2840. },
  2841. sessionStart: function(e) {
  2842. l.debug("analytics user_session_start"),
  2843. f("session_started"),
  2844. P = Date.now(),
  2845. window.addEventListener("unload", function() {
  2846. !function(e, t) {
  2847. if (t = t || {},
  2848. navigator.sendBeacon && i)
  2849. try {
  2850. navigator.sendBeacon("https://api.segment.io/v1/t", JSON.stringify({
  2851. event: e,
  2852. anonymousId: window.analytics.user().anonymousId(),
  2853. properties: s.extendObject(t, c),
  2854. writeKey: i,
  2855. sentAt: Date.now(),
  2856. type: "track",
  2857. context: {
  2858. userAgent: y.userAgent(),
  2859. library: {
  2860. name: "showcase-beacon",
  2861. version: "2.25.6-0-gd87e5b1"
  2862. },
  2863. app: {
  2864. name: "showcase",
  2865. version: "2.25.6-0-gd87e5b1"
  2866. }
  2867. }
  2868. }))
  2869. } catch (e) {
  2870. console.warn("Failed to send async segment request")
  2871. }
  2872. }("session_ended", {
  2873. duration: Date.now() - P
  2874. })
  2875. })
  2876. },
  2877. modelLoaded: function(e, t, i, n) {
  2878. r(e, t, i, n)
  2879. },
  2880. loadComplete: function(e) {
  2881. f("load_times", {
  2882. time_to_app_start: e
  2883. })
  2884. },
  2885. track: function(e, t) {
  2886. n && (l.debug('analytics.track("' + e + '", ' + JSON.stringify(t) + " )"),
  2887. f(e, t))
  2888. },
  2889. trackAlways: function(e, t) {
  2890. l.debug('analytics.trackAlways("' + e + '", ' + JSON.stringify(t) + " )"),
  2891. f(e, t)
  2892. },
  2893. getSessionId: function() {
  2894. return h
  2895. },
  2896. updateInteraction: m
  2897. }
  2898. }
  2899. ).call(this, "/js/analytics.js")
  2900. }
  2901. , {
  2902. "./ab": 3,
  2903. "./enum/ControlEvents": 21,
  2904. "./enum/PlayerEvents": 40,
  2905. "./enum/VROption": 47,
  2906. "./enum/VRPlatforms": 49,
  2907. "./enum/Viewmode": 51,
  2908. "./gui/sharing/ShareEvents": 76,
  2909. "./gui/sharing/modal": 77,
  2910. "./gui/title/TitleEvents": 80,
  2911. "./gui/title/titleBar": 82,
  2912. "./gui/vr/vrEvent": 85,
  2913. "./gui/vr/vrModal": 87,
  2914. "./localization/localize": 108,
  2915. "./tag/Billboard/BillboardEvent": 120,
  2916. "./settings": 166,
  2917. "./util/ajax": 181,
  2918. "./util/browser": 182,
  2919. "./util/common": 185,
  2920. "./util/logger": 189,
  2921. three: 217
  2922. }],
  2923. 5: [function(e, t, i) {
  2924. "use strict";
  2925. function n() {
  2926. r.PerspectiveCamera.call(this, a.clampVFOV(o.dollhouseFOV), $("#player").width() / $("#player").height(), o.dollhouseNear, o.dollhouseFar),
  2927. this.controls = null
  2928. }
  2929. var r = e("three")
  2930. , o = e("../constants")
  2931. , a = e("../util/cameraLight");
  2932. (n.prototype = Object.create(r.PerspectiveCamera.prototype)).updateAspect = function(e) {
  2933. this.aspect = e,
  2934. this.updateProjectionMatrix()
  2935. }
  2936. ,
  2937. t.exports = n
  2938. }
  2939. , {
  2940. "../constants": 8,
  2941. "../util/cameraLight": 184,
  2942. three: 217
  2943. }],
  2944. 6: [function(e, t, i) {
  2945. "use strict";
  2946. function n() {
  2947. var e = $("#player").width() / $("#player").height();
  2948. r.OrthographicCamera.call(this, -o.orthoBase, o.orthoBase, o.orthoBase / e, -o.orthoBase / e, o.orthoNear, o.orthoFar),
  2949. this.controls = null,
  2950. this.updateAspect(e)
  2951. }
  2952. var r = e("three")
  2953. , o = e("../constants");
  2954. (n.prototype = Object.create(r.OrthographicCamera.prototype)).updateAspect = function(e) {
  2955. this.aspect = e,
  2956. this.top = o.orthoBase / e,
  2957. this.bottom = -o.orthoBase / e,
  2958. this.updateProjectionMatrix()
  2959. }
  2960. ,
  2961. t.exports = n
  2962. }
  2963. , {
  2964. "../constants": 8,
  2965. three: 217
  2966. }],
  2967. 7: [function(e, t, i) {
  2968. "use strict";
  2969. function n() {
  2970. r.PerspectiveCamera.call(this, a.clampVFOV(o.insideFOV), $("#player").width() / $("#player").height(), o.insideNear, o.insideFar),
  2971. this.controls = null
  2972. }
  2973. var r = e("three")
  2974. , o = e("../settings")
  2975. , a = e("../util/cameraLight");
  2976. (n.prototype = Object.create(r.PerspectiveCamera.prototype)).updateAspect = function(e) {
  2977. this.aspect = e,
  2978. this.updateProjectionMatrix()
  2979. }
  2980. ,
  2981. t.exports = n
  2982. }
  2983. , {
  2984. "../settings": 166,
  2985. "../util/cameraLight": 184,
  2986. three: 217
  2987. }],
  2988. 8: [function(e, t, i) {
  2989. "use strict";
  2990. t.exports = {
  2991. signedUrlDefaultExpireTime: 24e4,
  2992. signedUrlCheckInterval: 1e4,
  2993. signedUrlRefreshBuffer: 15e3,
  2994. dollhouseFOV: 70,
  2995. dollhouseNear: .1,//1,
  2996. dollhouseFar: 5e3,
  2997. insideFOV: 70,
  2998. insideFOVMax: 120,
  2999. insideNear: .1,
  3000. insideFar: 5e3,
  3001. insideLookSpeed: .12,
  3002. insideLookLimitUp: 40,
  3003. insideLookLimitDown: -40,
  3004. orthoNear: 1,
  3005. orthoFar: 5e3,
  3006. orthoBase: 10,
  3007. narrowLandscapeHeight: 290,
  3008. reallyNarrowLandscapeHeight: 250,
  3009. visionTilingStartDate: new Date("8/26/2016"),
  3010. visionTilingStartVersion: "1.1.407.13667",
  3011. windowHeightHighQualityThreshold: 900,
  3012. tourStepDelayDefault: 3500,
  3013. tourStepDelaySlideShow: 5e3,
  3014. workshopApsect: 9 / 16,
  3015. highQualityMaxZoom: 2,
  3016. ultraHighQualityMaxZoom: 3
  3017. }
  3018. }
  3019. , {}],
  3020. 9: [function(e, t, i) {
  3021. "use strict";
  3022. function n() {
  3023. this.activeControl = null,
  3024. this.controls = {},
  3025. this.cameras = {}
  3026. }
  3027. var a = e("./PanoramaControls")
  3028. , s = e("./DollhouseControls")
  3029. , l = e("./FloorplanControls")
  3030. , c = e("../cameras/PanoramaCamera")
  3031. , h = e("../cameras/DollhouseCamera")
  3032. , u = e("../cameras/FloorplanCamera")
  3033. , r = e("events").EventEmitter
  3034. , d = e("../enum/ControlEvents")
  3035. , o = e("../enum/ModelManagerEvents")
  3036. , p = e("../enum/Viewmode")
  3037. , f = e("../settings");
  3038. (n.prototype = Object.create(r.prototype)).init = function(e, t) {
  3039. this.setUpControls(),
  3040. this.bindEvents(e, t)
  3041. }
  3042. ,
  3043. n.prototype.activateControls = function(e) {
  3044. this.activeControl && (this.activeControl.reset(),
  3045. this.activeControl.enabled = !1),
  3046. this.controls[e] && (this.controls[e].enabled = !0),
  3047. this.activeControl = this.controls[e]
  3048. }
  3049. ,
  3050. n.prototype.setUpControls = function() {
  3051. var i = {}
  3052. , n = {}
  3053. , e = [p.PANORAMA, p.DOLLHOUSE, p.FLOORPLAN]
  3054. , r = [c, h, u]
  3055. , o = [a, s, l];
  3056. e.forEach(function(e, t) {
  3057. i[e] = new r[t],
  3058. n[e] = new o[t](i[e]),
  3059. n[e].on(d.Move, this.emit.bind(this, d.Move)),
  3060. n[e].on(d.InputStart, this.emit.bind(this, d.InputStart)),
  3061. n[e].on(d.InteractionDirect, this.emit.bind(this, d.InteractionDirect)),
  3062. n[e].on(d.InteractionKey, this.emit.bind(this, d.InteractionKey)),
  3063. n[e].on(d.Pinch, this.emit.bind(this, d.Pinch)),
  3064. n[e].on(d.Scroll, this.emit.bind(this, d.Scroll))
  3065. }
  3066. .bind(this)),
  3067. this.controls = n,
  3068. this.cameras = i
  3069. }
  3070. ,
  3071. n.prototype.bindEvents = function(e, t) {
  3072. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  3073. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  3074. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  3075. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  3076. f.useWheel && (e.addEventListener("mousewheel", this.onMouseWheel.bind(this), {
  3077. passive: !1
  3078. }),
  3079. e.addEventListener("DOMMouseScroll", this.onMouseWheel.bind(this))),
  3080. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  3081. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  3082. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  3083. e.addEventListener("contextmenu", function(e) {
  3084. e.preventDefault()
  3085. }),
  3086. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  3087. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  3088. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  3089. e.addEventListener("pointerout", this.onPointerCancel.bind(this)),
  3090. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  3091. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  3092. document.addEventListener("keyup", this.onKeyUp.bind(this)),
  3093. t.on(o.ActiveModelChanged, function(e) {
  3094. this.setModelForControls(e.model)
  3095. }
  3096. .bind(this))
  3097. }
  3098. ,
  3099. n.prototype.setModelForControls = function(e) {
  3100. this.controls[p.DOLLHOUSE].setZoomBounds(e.boundingBox);
  3101. var t = e.boundingBox.clone().expandByScalar(f.modelBoundsPadding);
  3102. [p.DOLLHOUSE, p.FLOORPLAN].forEach(function(e) {
  3103. this.controls[e].setBounds(t)
  3104. }
  3105. .bind(this))
  3106. }
  3107. ,
  3108. n.prototype.onMouseDown = function(e) {
  3109. e.preventDefault(),
  3110. this.activeControl && this.activeControl.onMouseDown(e)
  3111. }
  3112. ,
  3113. n.prototype.onMouseMove = function(e) {
  3114. e.preventDefault(),
  3115. this.activeControl && this.activeControl.onMouseMove(e)
  3116. }
  3117. ,
  3118. n.prototype.onMouseUp = function(e) {
  3119. e.preventDefault(),
  3120. this.activeControl && this.activeControl.onMouseUp(e)
  3121. }
  3122. ,
  3123. n.prototype.onMouseOver = function(e) {
  3124. e.preventDefault(),
  3125. this.activeControl && this.activeControl.onMouseOver(e)
  3126. }
  3127. ,
  3128. n.prototype.onMouseWheel = function(e) {
  3129. e.preventDefault(),
  3130. this.activeControl && this.activeControl.onMouseWheel(e)
  3131. }
  3132. ,
  3133. n.prototype.onTouchStart = function(e) {
  3134. e.preventDefault(),
  3135. this.activeControl && this.activeControl.onTouchStart(e),
  3136. $("#hotListWrap")[0].classList.remove("hotListActive"),
  3137. $("#hotListContent ul .active").removeClass("active"),
  3138. $("#hotList")[0].classList.remove("active")
  3139. }
  3140. ,
  3141. n.prototype.onTouchMove = function(e) {
  3142. e.preventDefault(),
  3143. this.activeControl && this.activeControl.onTouchMove(e)
  3144. }
  3145. ,
  3146. n.prototype.onTouchEnd = function(e) {
  3147. e.preventDefault(),
  3148. this.activeControl && this.activeControl.onTouchEnd(e)
  3149. }
  3150. ,
  3151. n.prototype.onPointerDown = function(e) {
  3152. if (e.preventDefault(),
  3153. this.activeControl)
  3154. switch (e.pointerType) {
  3155. case "mouse":
  3156. this.activeControl.onMouseDown(e);
  3157. break;
  3158. default:
  3159. this.activeControl.onPointerDown(e)
  3160. }
  3161. }
  3162. ,
  3163. n.prototype.onPointerMove = function(e) {
  3164. if (e.preventDefault(),
  3165. this.activeControl)
  3166. switch (e.pointerType) {
  3167. case "mouse":
  3168. this.activeControl.onMouseMove(e);
  3169. break;
  3170. default:
  3171. this.activeControl.onPointerMove(e)
  3172. }
  3173. }
  3174. ,
  3175. n.prototype.onPointerUp = function(e) {
  3176. if (e.preventDefault(),
  3177. this.activeControl)
  3178. switch (e.pointerType) {
  3179. case "mouse":
  3180. this.activeControl.onMouseUp(e);
  3181. break;
  3182. default:
  3183. this.activeControl.onPointerUp(e)
  3184. }
  3185. }
  3186. ,
  3187. n.prototype.onPointerCancel = function(e) {
  3188. e.preventDefault(),
  3189. this.activeControl && "mouse" !== e.pointerType && this.activeControl.onPointerUp(e)
  3190. }
  3191. ,
  3192. n.prototype.onKeyDown = function(e) {
  3193. e.metaKey || e.ctrlKey || (e.preventDefault(),
  3194. this.activeControl && this.activeControl.onKeyDown(e))
  3195. }
  3196. ,
  3197. n.prototype.onKeyUp = function(e) {
  3198. e.preventDefault(),
  3199. this.activeControl && this.activeControl.onKeyUp(e)
  3200. }
  3201. ,
  3202. t.exports = n
  3203. }
  3204. , {
  3205. "../cameras/DollhouseCamera": 5,
  3206. "../cameras/FloorplanCamera": 6,
  3207. "../cameras/PanoramaCamera": 7,
  3208. "../enum/ControlEvents": 21,
  3209. "../enum/ModelManagerEvents": 33,
  3210. "../enum/Viewmode": 51,
  3211. "../settings": 166,
  3212. "./DollhouseControls": 10,
  3213. "./FloorplanControls": 11,
  3214. "./PanoramaControls": 13,
  3215. events: 202
  3216. }],
  3217. 10: [function(e, t, i) {
  3218. "use strict";
  3219. function n(e) {
  3220. a.call(this, e),
  3221. this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3222. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle,
  3223. this.minDistance = o.dollhouseDefault.minDistance,
  3224. this.maxDistance = o.dollhouseDefault.maxDistance,
  3225. this.adjustedMinDistance = this.minDistance,
  3226. this.adjustedMaxDistance = this.maxDistance
  3227. }
  3228. var r = e("three")
  3229. , o = e("../settings")
  3230. , a = e("./OutsideControls");
  3231. (n.prototype = Object.create(a.prototype)).pan = function(e, t) {
  3232. this.camera.updateMatrix();
  3233. var i = this.camera.position.clone().sub(this.target).length();
  3234. i *= Math.tan(this.camera.fov / 2 * Math.PI / 180),
  3235. this.panLeft(2 * e * i / $("#player").height()),
  3236. this.panUp(-2 * t * i / $("#player").height())
  3237. }
  3238. ,
  3239. n.prototype.updateZoom = function() {
  3240. return this.offset.length() * this.scale
  3241. }
  3242. ,
  3243. n.prototype.setZoomBounds = function(e) {
  3244. var t = e.min.distanceTo(e.max);
  3245. this.adjustedMinDistance = Math.max(Math.min(t / 2, o.dollhouseDefault.minDistance), 0),
  3246. this.adjustedMaxDistance = Math.min(Math.max(t, o.dollhouseDefault.maxDistance), o.skyboxRadius),
  3247. this.minDistance = this.adjustedMinDistance,
  3248. this.maxDistance = this.adjustedMaxDistance
  3249. }
  3250. ,
  3251. n.prototype.resetRanges = function(e, t) {
  3252. e ? (this.minDistance = Math.min(e, this.minDistance),
  3253. this.maxDistance = Math.max(e, this.maxDistance)) : (this.minDistance = this.adjustedMinDistance,
  3254. this.maxDistance = this.adjustedMaxDistance),
  3255. t ? (this.minPolarAngle = r.Math.degToRad(-15),
  3256. this.maxPolarAngle = r.Math.degToRad(89.9)) : (this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3257. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle)
  3258. }
  3259. ,
  3260. n.prototype.toJSON = function() {
  3261. return a.prototype.toJSON.call(this)
  3262. }
  3263. ,
  3264. t.exports = n
  3265. }
  3266. , {
  3267. "../settings": 166,
  3268. "./OutsideControls": 12,
  3269. three: 217
  3270. }],
  3271. 11: [function(e, t, i) {
  3272. "use strict";
  3273. function n(e) {
  3274. c.call(this, e),
  3275. this.minDistance = 15,
  3276. this.maxDistance = 50,
  3277. this.noRotateUpDown = !0,
  3278. this.minPolarAngle = 0,
  3279. this.maxPolarAngle = 0,
  3280. this.mouseActions[u.LEFT] = h.PAN,
  3281. this.mouseActions[u.MIDDLE] = h.DOLLY,
  3282. this.mouseActions[u.RIGHT] = h.ROTATE,
  3283. this.touchActions[1] = h.PAN,
  3284. this.touchActions[2] = h.ROTATE_DOLLY,
  3285. this.absoluteScale = 1,
  3286. this.currentScale = 1
  3287. }
  3288. var r, o, a, s = e("three"), l = e("../settings"), c = e("./OutsideControls"), h = e("../enum/ControlActions"), u = e("../enum/MouseButton"), d = e("../util/math"), p = e("../util/browser");
  3289. (n.prototype = Object.create(c.prototype)).zoomToContain = function(e) {
  3290. var t = Math.max(e.x, e.z)
  3291. , i = Math.min(e.x, e.z)
  3292. , n = Math.max(t, i * this.camera.aspect)
  3293. , r = Math.max(i, t * this.camera.aspect);
  3294. this.absoluteScale = (p.aspectRatio() < 1 ? r : n) / 2 / l.orthoBase * 1.2,
  3295. this.currentScale = this.absoluteScale
  3296. }
  3297. ,
  3298. n.prototype.rotateToView = function(e, t) {
  3299. var i = 0;
  3300. p.aspectRatio() < 1 == e.x < e.z ? 0 < t.z && (i = Math.PI) : i = 0 < t.x ? Math.PI / 2 : -Math.PI / 2,
  3301. this.rotateLeft(i),
  3302. this.update(0)
  3303. }
  3304. ,
  3305. n.prototype.pan = function(e, t) {
  3306. this.camera.updateMatrix(),
  3307. this.panLeft(e * (this.camera.right - this.camera.left) / $("#player").width()),
  3308. this.panUp(-t * (this.camera.top - this.camera.bottom) / $("#player").height())
  3309. }
  3310. ,
  3311. n.prototype.updateZoom = function() {
  3312. return this.absoluteScale *= this.scale - .03 * this.keyboardZoomSpeed,
  3313. this.absoluteScale = Math.max(l.zoomNearLimit, Math.min(this.absoluteScale, l.zoomFarLimit)),
  3314. this.currentScale = .8 * this.currentScale + .2 * this.absoluteScale,
  3315. this.camera.left = -l.orthoBase * this.currentScale,
  3316. this.camera.right = l.orthoBase * this.currentScale,
  3317. this.camera.top = l.orthoBase * this.currentScale / this.camera.aspect,
  3318. this.camera.bottom = -l.orthoBase * this.currentScale / this.camera.aspect,
  3319. this.camera.updateProjectionMatrix(),
  3320. this.offset.length()
  3321. }
  3322. ,
  3323. n.prototype.toJSON = (r = new s.Quaternion,
  3324. o = (new s.Quaternion).setFromAxisAngle(new s.Vector3(0,1,0), s.Math.degToRad(90)),
  3325. a = new s.Quaternion,
  3326. function() {
  3327. var e = c.prototype.toJSON.call(this);
  3328. return r.copy(e.camera_quaternion),
  3329. a.copy(o),
  3330. a.multiply(r),
  3331. e.camera_quaternion.x = d.toPrecision(a.x, 4),
  3332. e.camera_quaternion.y = d.toPrecision(a.y, 4),
  3333. e.camera_quaternion.z = d.toPrecision(a.z, 4),
  3334. e.camera_quaternion.w = d.toPrecision(a.w, 4),
  3335. e.ortho_zoom = d.toPrecision(this.currentScale * this.camera.aspect, 4),
  3336. e
  3337. }
  3338. ),
  3339. t.exports = n
  3340. }
  3341. , {
  3342. "../enum/ControlActions": 20,
  3343. "../enum/MouseButton": 34,
  3344. "../settings": 166,
  3345. "../util/browser": 182,
  3346. "../util/math": 190,
  3347. "./OutsideControls": 12,
  3348. three: 217
  3349. }],
  3350. 12: [function(e, t, i) {
  3351. "use strict";
  3352. function n(e) {
  3353. this.camera = e,
  3354. (this.camera.controls = this).enabled = !1,
  3355. this.target = new a.Vector3,
  3356. this.targetBounds = new a.Box3,
  3357. this.zoomSpeed = 2,//编辑时缩放快一些
  3358. this.minDistance = 0,
  3359. this.maxDistance = 1 / 0,
  3360. this.noRotateUpDown = !1,
  3361. this.rotateSpeed = 1,
  3362. this.keyboardZoomSpeed = 0,
  3363. this.keyPanSpeed = 7,
  3364. this.autoRotate = !1,
  3365. this.autoRotateSpeed = 2,
  3366. this.autoPan = !1,
  3367. this.autoPanPosition = new a.Vector3,
  3368. this.minPolarAngle = a.Math.degToRad(25),
  3369. this.maxPolarAngle = a.Math.degToRad(65),
  3370. this.rotationAcceleration = new a.Vector2,
  3371. this.rotationSpeed = new a.Vector2,
  3372. this.panAcceleration = new a.Vector2,
  3373. this.panSpeed = new a.Vector2,
  3374. this.rotateStart = new a.Vector2,
  3375. this.rotateEnd = new a.Vector2,
  3376. this.rotateDelta = new a.Vector2,
  3377. this.panStart = new a.Vector2,
  3378. this.panEnd = new a.Vector2,
  3379. this.panDelta = new a.Vector2,
  3380. this.panOffset = new a.Vector3,
  3381. this.offset = new a.Vector3,
  3382. this.dollyStart = new a.Vector2,
  3383. this.dollyEnd = new a.Vector2,
  3384. this.dollyDelta = new a.Vector2,
  3385. this.phiDelta = 0,
  3386. this.thetaDelta = 0,
  3387. this.scale = 1,
  3388. this.panVector = new a.Vector3,
  3389. this.lastPosition = new a.Vector3,
  3390. this.state = u.NONE,
  3391. this.mouseActions = {},
  3392. this.mouseActions[d.LEFT] = u.ROTATE,
  3393. this.mouseActions[d.MIDDLE] = u.DOLLY,
  3394. this.mouseActions[d.RIGHT] = u.PAN,
  3395. this.touchActions = {},
  3396. this.touchActions[1] = u.ROTATE,
  3397. this.touchActions[2] = u.PAN_DOLLY,
  3398. this.lastMoveTime = 0,
  3399. this.pointersLimit = 2,
  3400. this.pointers = []
  3401. }
  3402. var r, o, a = e("three"), c = e("../settings"), h = e("../util/common"), s = e("../util/math"), l = e("../enum/Vectors"), u = e("../enum/ControlActions"), d = e("../enum/MouseButton"), p = e("../enum/Keys"), f = e("../enum/ControlEvents"), g = e("events").EventEmitter;
  3403. (n.prototype = Object.create(g.prototype)).setBounds = function(e) {
  3404. this.targetBounds = e
  3405. }
  3406. ,
  3407. n.prototype.isEngaged = function() {
  3408. return this.state !== u.NONE
  3409. }
  3410. ,
  3411. n.prototype.rotateLeft = function(e) {
  3412. void 0 === e && (e = this.getAutoRotationAngle()),
  3413. this.thetaDelta -= e
  3414. }
  3415. ,
  3416. n.prototype.rotateUp = function(e) {
  3417. this.noRotateUpDown || (void 0 === e && (e = this.getAutoRotationAngle()),
  3418. this.phiDelta -= e)
  3419. }
  3420. ,
  3421. n.prototype.panLeft = function(e) {
  3422. var t = this.camera.matrix.elements;
  3423. this.panOffset.set(t[0], 0, t[2]).normalize(),
  3424. this.panOffset.multiplyScalar(-e),
  3425. this.panVector.add(this.panOffset)
  3426. }
  3427. ,
  3428. n.prototype.panUp = function(e) {
  3429. var t = this.camera.matrix.elements;
  3430. this.panOffset.set(t[4], 0, t[6]).normalize(),
  3431. this.panOffset.multiplyScalar(-e),
  3432. this.panVector.add(this.panOffset)
  3433. }
  3434. ,
  3435. n.prototype.startRotating = function(e, t) {
  3436. e && this.navRotationAcc("x", e),
  3437. t && this.navRotationAcc("y", t)
  3438. }
  3439. ,
  3440. n.prototype.stopRotating = function(e) {
  3441. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  3442. this.navRotationAcc("x", 0),
  3443. this.navRotationAcc("y", 0)
  3444. }
  3445. ,
  3446. n.prototype.setAutoPanPosition = (r = new a.Vector3,
  3447. o = new a.Vector3,
  3448. function(e, t) {
  3449. r.copy(this.camera.position),
  3450. void 0 === e && null === e || r.setX(e),
  3451. void 0 === t && null === t || r.setZ(t);
  3452. var i = this.camera.position.distanceTo(this.target)
  3453. , n = l.FORWARD.clone().applyQuaternion(this.camera.quaternion);
  3454. this.targetClamped = !1,
  3455. o.copy(r).addScaledVector(n, i),
  3456. this.targetBounds.containsPoint(o) || (this.targetBounds.clampPoint(o, o),
  3457. r.copy(o).addScaledVector(n, -i),
  3458. this.targetClamped = !0),
  3459. this.autoPanPosition.x = r.x,
  3460. this.autoPanPosition.z = r.z,
  3461. this.autoPan && this.stopAutoPanning()
  3462. }
  3463. ),
  3464. n.prototype.stopAutoPanning = function() {
  3465. var e = this.autoPan;
  3466. this.autoPan = !1,
  3467. this.emit(this.targetClamped ? f.AutoPanClamped : e ? f.AutoPanInterrupt : f.AutoPanComplete)
  3468. }
  3469. ,
  3470. n.prototype.dollyIn = function(e) {
  3471. void 0 === e && (e = this.getZoomScale()),
  3472. this.scale /= e
  3473. }
  3474. ,
  3475. n.prototype.dollyOut = function(e) {
  3476. void 0 === e && (e = this.getZoomScale()),
  3477. this.scale *= e
  3478. }
  3479. ,
  3480. n.prototype.updatePan = function(e) {
  3481. if (this.panSpeed.multiplyScalar(1 - c.panFriction).addScaledVector(this.panAcceleration, c.panAccelerationOutside * e),
  3482. this.pan(-this.panSpeed.x, this.panSpeed.y),
  3483. this.autoPan) {
  3484. var t = (new a.Vector3).copy(this.autoPanPosition).sub(this.camera.position);
  3485. t.setY(0).clampLength(0, 50 * e),
  3486. this.target.add(t),
  3487. this.camera.position.add(t),
  3488. this.autoPanPosition.x === this.camera.position.x && this.autoPanPosition.z === this.camera.position.z && (this.autoPan = !1,
  3489. this.stopAutoPanning())
  3490. }
  3491. }
  3492. ,
  3493. n.prototype.update = function(e) {
  3494. e = e || 1 / 60,
  3495. this.rotationSpeed.multiplyScalar(1 - c.rotationFriction).addScaledVector(this.rotationAcceleration, c.rotationAccelerationOutside * e),
  3496. this.rotateLeft(-this.rotationSpeed.x),
  3497. this.noRotateUpDown || this.rotateUp(this.rotationSpeed.y),
  3498. this.updatePan(e);
  3499. var t = this.camera.position;
  3500. this.offset.copy(t).sub(this.target);
  3501. var i = Math.atan2(this.offset.x, this.offset.z)
  3502. , n = Math.atan2(Math.sqrt(this.offset.x * this.offset.x + this.offset.z * this.offset.z), this.offset.y);
  3503. this.autoRotate && this.rotateLeft(this.getAutoRotationAngle()),
  3504. i += this.thetaDelta,
  3505. n += this.phiDelta,
  3506. n = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, n)),
  3507. n = Math.max(1e-6, Math.min(Math.PI - 1e-6, n));
  3508. var r = this.updateZoom();
  3509. r = Math.max(this.minDistance, Math.min(this.maxDistance, r)),
  3510. this.target.add(this.panVector),
  3511. this.targetBounds.clampPoint(this.target, this.target),
  3512. this.offset.x = r * Math.sin(n) * Math.sin(i),
  3513. this.offset.y = r * Math.cos(n),
  3514. this.offset.z = r * Math.sin(n) * Math.cos(i),
  3515. t.copy(this.target).add(this.offset),
  3516. this.camera.lookAt(this.target),
  3517. this.thetaDelta = 0,
  3518. this.phiDelta = 0,
  3519. this.scale = 1,
  3520. this.panVector.set(0, 0, 0),
  3521. 0 < this.lastPosition.distanceTo(this.camera.position) && this.lastPosition.copy(this.camera.position)
  3522. }
  3523. ,
  3524. n.prototype.getAutoRotationAngle = function() {
  3525. return 2 * Math.PI / 60 / 60 * this.autoRotateSpeed
  3526. }
  3527. ,
  3528. n.prototype.getZoomScale = function() {
  3529. return Math.pow(.95, this.zoomSpeed)
  3530. }
  3531. ,
  3532. n.prototype.onMouseDown = function(e) {
  3533. if (this.enabled) {
  3534. switch (e.preventDefault(),
  3535. this.stopAutoPanning(),
  3536. this.mouseDown = !0,
  3537. this.state = this.mouseActions[e.button],
  3538. this.state) {
  3539. case u.ROTATE:
  3540. this.rotateStart.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3541. this.rotationSpeed.set(0, 0);
  3542. break;
  3543. case u.DOLLY:
  3544. this.dollyStart.set(e.clientX, e.clientY);
  3545. break;
  3546. case u.PAN:
  3547. this.panStart.set(e.clientX, e.clientY)
  3548. }
  3549. this.emit(f.InputStart, "mouse")
  3550. }
  3551. }
  3552. ,
  3553. n.prototype.onMouseMove = function(e) {
  3554. if (this.enabled && this.mouseDown && 0 !== e.buttons) {
  3555. switch (e.preventDefault(),
  3556. this.state) {
  3557. case u.ROTATE:
  3558. this.rotateEnd.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3559. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3560. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3561. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3562. this.rotateStart.copy(this.rotateEnd);
  3563. break;
  3564. case u.DOLLY:
  3565. this.dollyEnd.set(e.clientX, e.clientY),
  3566. this.dollyDelta.subVectors(this.dollyEnd, this.dollyStart),
  3567. (0 < this.dollyDelta.y ? this.dollyIn : this.dollyOut).call(this),
  3568. this.dollyStart.copy(this.dollyEnd);
  3569. break;
  3570. case u.PAN:
  3571. this.panEnd.set(e.clientX, e.clientY),
  3572. this.panDelta.subVectors(this.panEnd, this.panStart),
  3573. this.pan(this.panDelta.x, this.panDelta.y),
  3574. this.panStart.copy(this.panEnd)
  3575. }
  3576. this.emit(f.Move, "mouse"),
  3577. this.lastMoveTime = e.timeStamp,
  3578. this.update()
  3579. }
  3580. }
  3581. ,
  3582. n.prototype.onMouseUp = function(e) {
  3583. this.enabled && (this.mouseDown = !1,
  3584. this.state = u.NONE,
  3585. "mouseover" !== e.type && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3586. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y),
  3587. this.update(),
  3588. this.rotationAcceleration.set(0, 0),
  3589. this.rotateDelta.set(0, 0)))
  3590. }
  3591. ,
  3592. n.prototype.onMouseOver = function(e) {
  3593. 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  3594. }
  3595. ,
  3596. n.prototype.onMouseWheel = function(e) {
  3597. this.enabled && c.useWheel && (this.emit(f.Move, "wheel"),
  3598. (0 < (e.wheelDelta || -e.detail) ? this.dollyOut : this.dollyIn).call(this),
  3599. this.update())
  3600. }
  3601. ,
  3602. n.prototype.onKeyDown = function(e) {
  3603. this.enabled && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  3604. this.handleKeyDown(e.which)))
  3605. }
  3606. ,
  3607. n.prototype.navRotationAcc = function(e, t) {
  3608. "y" === e ? this.noRotateUpDown ? this.keyboardZoomSpeed = t : this.rotationAcceleration.y = t : this.rotationAcceleration.x = t
  3609. }
  3610. ,
  3611. n.prototype.navPanAcc = function(e, t) {
  3612. this.stopAutoPanning(),
  3613. this.panAcceleration[e] = t
  3614. }
  3615. ,
  3616. n.prototype.handleKeyDown = function(e) {
  3617. var t = !0;
  3618. switch (e) {
  3619. case p.UPARROW:
  3620. case p.I:
  3621. this.navRotationAcc("y", 1);
  3622. break;
  3623. case p.DOWNARROW:
  3624. case p.K:
  3625. this.navRotationAcc("y", -1);
  3626. break;
  3627. case p.LEFTARROW:
  3628. case p.J:
  3629. this.navRotationAcc("x", -1);
  3630. break;
  3631. case p.RIGHTARROW:
  3632. case p.L:
  3633. this.navRotationAcc("x", 1);
  3634. break;
  3635. case p.W:
  3636. this.navPanAcc("y", 1);
  3637. break;
  3638. case p.S:
  3639. this.navPanAcc("y", -1);
  3640. break;
  3641. case p.A:
  3642. this.navPanAcc("x", -1);
  3643. break;
  3644. case p.D:
  3645. this.navPanAcc("x", 1);
  3646. break;
  3647. default:
  3648. t = !1
  3649. }
  3650. t && this.emit(f.Move, "key")
  3651. }
  3652. ,
  3653. n.prototype.onKeyUp = function(e) {
  3654. this.enabled && (e.preventDefault(),
  3655. e.stopPropagation(),
  3656. this.handleKeyUp(e.which))
  3657. }
  3658. ,
  3659. n.prototype.handleKeyUp = function(e) {
  3660. switch (e) {
  3661. case p.I:
  3662. case p.K:
  3663. case p.UPARROW:
  3664. case p.DOWNARROW:
  3665. this.keyboardZoomSpeed = 0,
  3666. this.rotationAcceleration.y = 0;
  3667. break;
  3668. case p.J:
  3669. case p.L:
  3670. case p.LEFTARROW:
  3671. case p.RIGHTARROW:
  3672. this.rotationAcceleration.x = 0;
  3673. break;
  3674. case p.S:
  3675. case p.W:
  3676. this.panAcceleration.y = 0;
  3677. break;
  3678. case p.A:
  3679. case p.D:
  3680. this.panAcceleration.x = 0
  3681. }
  3682. }
  3683. ,
  3684. n.prototype.onTouchStart = function(i) {
  3685. if (this.enabled || this.state === u.NONE) {
  3686. i.preventDefault(),
  3687. i.stopPropagation(),
  3688. this.stopAutoPanning();
  3689. var e = function() {
  3690. if (2 === i.touches.length) {
  3691. var e = i.touches[0].pageX - i.touches[1].pageX
  3692. , t = i.touches[0].pageY - i.touches[1].pageY;
  3693. this.dollyStart.set(e, t)
  3694. }
  3695. }
  3696. .bind(this)
  3697. , t = function() {
  3698. this.panStart.set(h.average(i.touches, "pageX"), h.average(i.touches, "pageY"))
  3699. }
  3700. .bind(this)
  3701. , n = function() {
  3702. this.rotateStart.set(h.average(i.touches, "pageX"), h.average(i.touches, "pageY"))
  3703. }
  3704. .bind(this);
  3705. switch (this.state = this.touchActions[i.touches.length],
  3706. this.state) {
  3707. case u.PAN_DOLLY:
  3708. e();
  3709. case u.PAN:
  3710. t();
  3711. break;
  3712. case u.ROTATE_DOLLY:
  3713. e();
  3714. case u.ROTATE:
  3715. n()
  3716. }
  3717. this.rotationSpeed.set(0, 0),
  3718. this.emit(f.InputStart, "touch")
  3719. }
  3720. }
  3721. ,
  3722. n.prototype.onTouchMove = function(a) {
  3723. if (this.enabled && this.state !== u.NONE) {
  3724. a.preventDefault(),
  3725. a.stopPropagation();
  3726. var s = function() {
  3727. var e = a.touches[0].pageX - a.touches[1].pageX
  3728. , t = a.touches[0].pageY - a.touches[1].pageY;
  3729. this.dollyEnd.set(e, t);
  3730. var i = this.dollyStart.length() - this.dollyEnd.length();
  3731. 0 < i ? this.dollyOut(1 + i / 500) : this.dollyIn(1 - i / 500),
  3732. this.dollyStart.copy(this.dollyEnd)
  3733. }
  3734. .bind(this)
  3735. , e = function() {
  3736. this.panEnd.set(h.average(a.touches, "pageX"), h.average(a.touches, "pageY")),
  3737. this.panDelta.subVectors(this.panEnd, this.panStart),
  3738. this.pan(this.panDelta.x, this.panDelta.y),
  3739. this.panStart.copy(this.panEnd),
  3740. this.rotateDelta.set(0, 0)
  3741. }
  3742. .bind(this)
  3743. , l = function() {
  3744. this.rotateEnd.set(h.average(a.touches, "pageX"), h.average(a.touches, "pageY")),
  3745. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3746. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3747. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3748. this.rotateStart.copy(this.rotateEnd)
  3749. }
  3750. .bind(this)
  3751. , t = function() {
  3752. if (2 === a.touches.length) {
  3753. var e = window.devicePixelRatio || 1
  3754. , t = a.touches[1].pageX - a.touches[0].pageX
  3755. , i = a.touches[1].pageY - a.touches[0].pageY
  3756. , n = Math.sqrt(t * t + i * i);
  3757. if (Math.abs(this.dollyStart.length() - n) > c.input.touchMoveThreshold * e)
  3758. this.state = u.DOLLY,
  3759. s();
  3760. else {
  3761. var r = h.average(a.touches, "pageX")
  3762. , o = h.average(a.touches, "pageY");
  3763. this.rotateDelta.set(r, o).sub(this.rotateStart).length() > c.input.touchMoveThreshold && (this.state = u.ROTATE,
  3764. this.rotateStart.set(r, o),
  3765. l())
  3766. }
  3767. }
  3768. }
  3769. .bind(this);
  3770. switch (this.state) {
  3771. case u.PAN_DOLLY:
  3772. s();
  3773. case u.PAN:
  3774. e();
  3775. break;
  3776. case u.ROTATE_DOLLY:
  3777. t();
  3778. break;
  3779. case u.DOLLY:
  3780. s();
  3781. break;
  3782. case u.ROTATE:
  3783. l();
  3784. break;
  3785. default:
  3786. this.state = u.NONE
  3787. }
  3788. this.lastMoveTime = a.timeStamp,
  3789. this.emit(f.Move, "touch")
  3790. }
  3791. }
  3792. ,
  3793. n.prototype.onTouchEnd = function(e) {
  3794. this.enabled && (this.state === u.ROTATE && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3795. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y)),
  3796. this.state = u.NONE,
  3797. this.update(),
  3798. this.rotationAcceleration.set(0, 0),
  3799. this.rotateDelta.set(0, 0))
  3800. }
  3801. ,
  3802. n.prototype.onPointerDown = function(e) {
  3803. this.enabled && ("touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  3804. id: e.pointerId,
  3805. pageX: e.pageX,
  3806. pageY: e.pageY
  3807. }),
  3808. e.touches = this.pointers,
  3809. this.onTouchStart(e)),
  3810. this.emit(f.InputStart, "pointer"))
  3811. }
  3812. ,
  3813. n.prototype.onPointerMove = function(t) {
  3814. this.enabled && "touch" === t.pointerType && (this.pointers.forEach(function(e) {
  3815. t.pointerId === e.id && (e.pageX = t.pageX,
  3816. e.pageY = t.pageY)
  3817. }),
  3818. t.touches = this.pointers,
  3819. this.onTouchMove(t))
  3820. }
  3821. ,
  3822. n.prototype.onPointerUp = function(i) {
  3823. this.enabled && "touch" === i.pointerType && (this.pointers.forEach(function(e, t) {
  3824. i.pointerId === e.id && this.pointers.splice(t, 1)
  3825. }
  3826. .bind(this)),
  3827. i.touches = this.pointers,
  3828. this.onTouchEnd(i))
  3829. }
  3830. ,
  3831. n.prototype.reset = function() {
  3832. this.state = u.NONE,
  3833. this.stopAutoPanning(),
  3834. this.rotationSpeed.set(0, 0),
  3835. this.rotationAcceleration.set(0, 0),
  3836. this.panSpeed.set(0, 0),
  3837. this.panAcceleration.set(0, 0)
  3838. }
  3839. ,
  3840. n.prototype.toJSON = function() {
  3841. return {
  3842. camera_position: {
  3843. x: s.toPrecision(this.camera.position.x, 4),
  3844. y: s.toPrecision(this.camera.position.y, 4),
  3845. z: s.toPrecision(this.camera.position.z, 4)
  3846. },
  3847. camera_quaternion: {
  3848. x: s.toPrecision(this.camera.quaternion.x, 4),
  3849. y: s.toPrecision(this.camera.quaternion.y, 4),
  3850. z: s.toPrecision(this.camera.quaternion.z, 4),
  3851. w: s.toPrecision(this.camera.quaternion.w, 4)
  3852. }
  3853. }
  3854. }
  3855. ,
  3856. t.exports = n
  3857. }
  3858. , {
  3859. "../enum/ControlActions": 20,
  3860. "../enum/ControlEvents": 21,
  3861. "../enum/Keys": 30,
  3862. "../enum/MouseButton": 34,
  3863. "../enum/Vectors": 50,
  3864. "../settings": 166,
  3865. "../util/common": 185,
  3866. "../util/math": 190,
  3867. events: 202,
  3868. three: 217
  3869. }],
  3870. 13: [function(u, d, e) {
  3871. (function(e) {
  3872. "use strict";
  3873. function t(e) {
  3874. this.camera = e,
  3875. (this.camera.controls = this).target = new s.Vector3(0,0,0),
  3876. this.lookVector = new s.Vector3,
  3877. this.lookSpeed = .05,
  3878. this.rotationAcc = new s.Vector2,
  3879. this.rotationSpeed = new s.Vector2,
  3880. this.lat = 0,
  3881. this.lon = 0,
  3882. this.phi = 0,
  3883. this.theta = 0,
  3884. this.enabled = !1,
  3885. this.locked = !1,
  3886. this.pointer = new s.Vector2(0,0),
  3887. this.rotationHistory = [],
  3888. this.rotationDifference = new s.Vector2,
  3889. this.pointerDragOn = !1,
  3890. this.pointerDragStart = new s.Vector2(0,0),
  3891. this.pinchDistance = 0,
  3892. this.moveStart = new s.Vector2,
  3893. this.moveTolerance = .01,
  3894. this.pointersLimit = 2,
  3895. this.pointers = []
  3896. }
  3897. var s = u("three")
  3898. , i = u("../util/logger")
  3899. , n = u("../settings")
  3900. , r = u("../util/common")
  3901. , o = u("../util/math")
  3902. , a = (u("../enum/Vectors"),
  3903. u("../enum/MouseButton"))
  3904. , l = u("../enum/Keys")
  3905. , c = u("../enum/ControlEvents")
  3906. , h = u("events").EventEmitter;
  3907. new i(e),
  3908. (t.prototype = Object.create(h.prototype)).usable = function() {
  3909. return this.enabled && !this.locked
  3910. }
  3911. ,
  3912. t.prototype.lookAt = function(e) {
  3913. var t = this.camera.position.clone().sub(e)
  3914. , i = Math.atan(t.z / t.x);
  3915. i += t.x < 0 ? Math.PI : 0,
  3916. i += 0 < t.x && t.z < 0 ? 2 * Math.PI : 0,
  3917. this.lon = s.Math.radToDeg(i) + 180;
  3918. var n = Math.sqrt(t.x * t.x + t.z * t.z)
  3919. , r = Math.atan(t.y / n);
  3920. this.lat = -s.Math.radToDeg(r)
  3921. }
  3922. ,
  3923. t.prototype.startRotationFrom = function(e, t) {
  3924. o.convertScreenPositionToNDC(e, t, this.pointer),
  3925. this.pointerDragOn = !0,
  3926. this.pointerDragStart.copy(this.pointer),
  3927. this.moveStart.copy(this.pointer),
  3928. this.rotationHistory = [],
  3929. this.rotationSpeed.set(0, 0)
  3930. }
  3931. ,
  3932. t.prototype.onMouseOver = function(e) {
  3933. !this.pointerDragOn || 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  3934. }
  3935. ,
  3936. t.prototype.onTouchStart = function(e) {
  3937. if (this.usable()) {
  3938. switch (e.preventDefault(),
  3939. e.stopPropagation(),
  3940. e.touches.length) {
  3941. case 1:
  3942. this.startRotationFrom(e.touches[0].clientX, e.touches[0].clientY);
  3943. break;
  3944. case 2:
  3945. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  3946. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height();
  3947. this.pinchDistance = Math.sqrt(t * t + i * i)
  3948. }
  3949. this.emit(c.InputStart, "touch")
  3950. }
  3951. }
  3952. ,
  3953. t.prototype.onPointerDown = function(e) {
  3954. this.usable() && "touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  3955. id: e.pointerId,
  3956. clientX: e.clientX,
  3957. clientY: e.clientY
  3958. }),
  3959. e.touches = this.pointers,
  3960. this.onTouchStart(e),
  3961. this.emit(c.InputStart, "pointer"))
  3962. }
  3963. ,
  3964. t.prototype.onMouseDown = function(e) {
  3965. if (this.usable()) {
  3966. switch (e.preventDefault(),
  3967. e.stopPropagation(),
  3968. e.button) {
  3969. case a.LEFT:
  3970. this.startRotationFrom(e.clientX, e.clientY)
  3971. }
  3972. this.emit(c.InputStart, "mouse")
  3973. }
  3974. }
  3975. ,
  3976. t.prototype.updateRotation = function() {
  3977. if (this.usable() && this.pointerDragOn) {
  3978. var e = new s.Vector3(this.pointerDragStart.x,this.pointerDragStart.y,-1).unproject(this.camera)
  3979. , t = new s.Vector3(this.pointer.x,this.pointer.y,-1).unproject(this.camera)
  3980. , i = Math.sqrt(e.x * e.x + e.z * e.z)
  3981. , n = Math.sqrt(t.x * t.x + t.z * t.z)
  3982. , r = Math.atan2(e.y, i)
  3983. , o = Math.atan2(t.y, n);
  3984. this.rotationDifference.y = s.Math.radToDeg(r - o),
  3985. e.y = 0,
  3986. t.y = 0;
  3987. var a = Math.acos(e.dot(t) / e.length() / t.length());
  3988. isNaN(a) || (this.rotationDifference.x = s.Math.radToDeg(a),
  3989. this.pointerDragStart.x < this.pointer.x && (this.rotationDifference.x *= -1)),
  3990. this.pointerDragStart.copy(this.pointer)
  3991. }
  3992. }
  3993. ,
  3994. t.prototype.onMouseMove = function(e) {
  3995. this.usable() && (o.convertScreenPositionToNDC(e.clientX, e.clientY, this.pointer),
  3996. this.pointerDragOn && (Math.abs(this.pointer.x - this.moveStart.x) > this.moveTolerance || Math.abs(this.pointer.y - this.moveStart.y) > this.moveTolerance) && this.emit(c.Move, "mouse"))
  3997. }
  3998. ,
  3999. t.prototype.onTouchMove = function(e) {
  4000. if (this.usable())
  4001. switch (this.emit(c.Move, "touch"),
  4002. e.touches.length) {
  4003. case 1:
  4004. o.convertScreenPositionToNDC(e.touches[0].clientX, e.touches[0].clientY, this.pointer);
  4005. break;
  4006. case 2:
  4007. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  4008. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height()
  4009. , n = this.pinchDistance - Math.sqrt(t * t + i * i);
  4010. .01 < Math.abs(n) && (this.emit(c.InteractionDirect),
  4011. this.emit(c.Pinch, n),
  4012. this.pinchDistance -= n)
  4013. }
  4014. }
  4015. ,
  4016. t.prototype.onPointerMove = function(t) {
  4017. this.usable() && "touch" === t.pointerType && (this.pointers.forEach(function(e) {
  4018. t.pointerId === e.id && (e.clientX = t.clientX,
  4019. e.clientY = t.clientY)
  4020. }),
  4021. t.touches = this.pointers,
  4022. this.onTouchMove(t))
  4023. }
  4024. ,
  4025. t.prototype.endRotation = function() {
  4026. this.pointerDragOn = !1;
  4027. var e = r.averageVectors(this.rotationHistory);
  4028. this.rotationSpeed.set(e.x * n.rotationAfterMoveMultiplier, e.y * n.rotationAfterMoveMultiplier)
  4029. }
  4030. ,
  4031. t.prototype.onTouchEnd = function(e) {
  4032. this.usable() && (e.preventDefault(),
  4033. e.stopPropagation(),
  4034. this.endRotation())
  4035. }
  4036. ,
  4037. t.prototype.onMouseUp = function(e) {
  4038. this.usable() && (e.preventDefault(),
  4039. e.stopPropagation(),
  4040. this.endRotation())
  4041. }
  4042. ,
  4043. t.prototype.onPointerUp = function(i) {
  4044. this.usable() && "touch" === i.pointerType && (this.pointers.forEach(function(e, t) {
  4045. i.pointerId === e.id && this.pointers.splice(t, 1)
  4046. }
  4047. .bind(this)),
  4048. i.touches = this.pointers,
  4049. this.onTouchEnd(i))
  4050. }
  4051. ,
  4052. t.prototype.update = function(e) {
  4053. for (this.lon,
  4054. this.lat,
  4055. this.updateRotation(),
  4056. this.rotationHistory.push(this.rotationDifference.clone()); this.rotationHistory.length > n.rotationAfterMoveHistoryCount; )
  4057. this.rotationHistory.shift();
  4058. this.lon += this.rotationDifference.x,
  4059. this.lat += this.rotationDifference.y,
  4060. this.rotationDifference.set(0, 0),
  4061. this.rotationSpeed.x = this.rotationSpeed.x * (1 - n.rotationFriction) + this.rotationAcc.x * n.rotationAccelerationInside,
  4062. this.rotationSpeed.y = this.rotationSpeed.y * (1 - n.rotationFriction) + this.rotationAcc.y * n.rotationAccelerationInside,
  4063. this.lon += this.rotationSpeed.x * e,
  4064. this.lat += this.rotationSpeed.y * e,
  4065. this.lat = Math.max(n.insideLookLimitDown, Math.min(n.insideLookLimitUp, this.lat)),
  4066. this.phi = s.Math.degToRad(90 - this.lat),
  4067. this.theta = s.Math.degToRad(this.lon),
  4068. this.lookVector.x = Math.sin(this.phi) * Math.cos(this.theta),
  4069. this.lookVector.y = Math.cos(this.phi),
  4070. this.lookVector.z = Math.sin(this.phi) * Math.sin(this.theta),
  4071. this.target.copy(this.lookVector).add(this.camera.position),
  4072. this.camera.lookAt(this.target)
  4073. }
  4074. ,
  4075. t.prototype.onMouseWheel = function(e) {
  4076. if (this.usable()) {
  4077. var t = e.wheelDelta || -e.detail;
  4078. this.emit(c.InteractionDirect),
  4079. this.emit(c.Scroll, t)
  4080. }
  4081. }
  4082. ,
  4083. t.prototype.onKeyDown = function(e) {
  4084. this.usable() && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  4085. this.handleKeyDown(e.which)))
  4086. }
  4087. ,
  4088. t.prototype.handleKeyDown = function(e) {
  4089. var t = function(e, t) {
  4090. this.rotationAcc[e] = t
  4091. }
  4092. .bind(this);
  4093. this.emit(c.InteractionKey);
  4094. var i = !0;
  4095. switch (e) {
  4096. case l.LEFTARROW:
  4097. case l.J:
  4098. t("x", -1);
  4099. break;
  4100. case l.RIGHTARROW:
  4101. case l.L:
  4102. t("x", 1);
  4103. break;
  4104. case l.I:
  4105. t("y", 1);
  4106. break;
  4107. case l.K:
  4108. t("y", -1);
  4109. break;
  4110. default:
  4111. i = !1
  4112. }
  4113. i && this.emit(c.Move, "key")
  4114. }
  4115. ,
  4116. t.prototype.onKeyUp = function(e) {
  4117. this.usable() && (e.preventDefault(),
  4118. e.stopPropagation(),
  4119. this.handleKeyUp(e.which))
  4120. }
  4121. ,
  4122. t.prototype.handleKeyUp = function(e) {
  4123. switch (e) {
  4124. case l.LEFTARROW:
  4125. case l.J:
  4126. case l.RIGHTARROW:
  4127. case l.L:
  4128. this.rotationAcc.x = 0;
  4129. break;
  4130. case l.I:
  4131. case l.K:
  4132. this.rotationAcc.y = 0
  4133. }
  4134. }
  4135. ,
  4136. t.prototype.startRotating = function(e, t) {
  4137. e && (this.rotationAcc.x = e),
  4138. t && (this.rotationAcc.y = t)
  4139. }
  4140. ,
  4141. t.prototype.stopRotating = function(e) {
  4142. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  4143. this.rotationAcc.set(0, 0)
  4144. }
  4145. ,
  4146. t.prototype.reset = function() {
  4147. this.pointerDragOn = !1,
  4148. this.rotationAcc.set(0, 0),
  4149. this.rotationSpeed.set(0, 0),
  4150. this.pointers = []
  4151. }
  4152. ,
  4153. t.prototype.toJSON = function() {
  4154. return {
  4155. camera_position: {
  4156. x: o.toPrecision(this.camera.position.x, 4),
  4157. y: o.toPrecision(this.camera.position.y, 4),
  4158. z: o.toPrecision(this.camera.position.z, 4)
  4159. },
  4160. camera_quaternion: {
  4161. x: o.toPrecision(this.camera.quaternion.x, 4),
  4162. y: o.toPrecision(this.camera.quaternion.y, 4),
  4163. z: o.toPrecision(this.camera.quaternion.z, 4),
  4164. w: o.toPrecision(this.camera.quaternion.w, 4)
  4165. }
  4166. }
  4167. }
  4168. ,
  4169. t.prototype.setStateFromJSON = function(e) {
  4170. this.camera.position.copy(e.camera_position),
  4171. this.camera.quaternion.copy(e.camera_quaternion)
  4172. }
  4173. ,
  4174. d.exports = t
  4175. }
  4176. ).call(this, "/js/controls/PanoramaControls.js")
  4177. }
  4178. , {
  4179. "../enum/ControlEvents": 21,
  4180. "../enum/Keys": 30,
  4181. "../enum/MouseButton": 34,
  4182. "../enum/Vectors": 50,
  4183. "../settings": 166,
  4184. "../util/common": 185,
  4185. "../util/logger": 189,
  4186. "../util/math": 190,
  4187. events: 202,
  4188. three: 217
  4189. }],
  4190. 14: [function(t, i, e) {
  4191. (function(e) {
  4192. "use strict";
  4193. var c = t("three")
  4194. , h = t("../enum/Viewmode")
  4195. , u = new (t("../util/logger"))(e);
  4196. i.exports = {
  4197. serialize: function(e) {
  4198. return encodeURI(JSON.stringify(e))
  4199. },
  4200. deserialize: function(e) {
  4201. function t(e) {
  4202. return e.reduce(function(e, t) {
  4203. return e && "number" == typeof t && !isNaN(t)
  4204. }, !0)
  4205. }
  4206. try {
  4207. var i = JSON.parse(decodeURI(e))
  4208. , n = {
  4209. mode: h.fromInt(i.camera_mode),
  4210. panoId: i.scan_id,
  4211. position: (new c.Vector3).copy(i.camera_position),
  4212. quaternion: (new c.Quaternion).copy(i.camera_quaternion),
  4213. zoom: i.ortho_zoom,
  4214. floorVisibility: i.floor_visibility
  4215. }
  4216. , r = n.position;
  4217. t([r.x, r.y, r.z]) || n.position.set(0, 0, 0);
  4218. var o = n.quaternion;
  4219. return t([o.x, o.y, o.z, o.w]) || n.quaternion.set(0, 0, 0, 1),
  4220. n
  4221. } catch (i) {
  4222. u.debug("Not able to parse start location as JSON; falling back to old array style parsing");
  4223. try {
  4224. var a = e.split(",")
  4225. , s = {
  4226. x: parseFloat(a[2]),
  4227. y: parseFloat(a[3]),
  4228. z: parseFloat(a[4])
  4229. }
  4230. , l = {
  4231. x: parseFloat(a[5]),
  4232. y: parseFloat(a[6]),
  4233. z: parseFloat(a[7]),
  4234. w: parseFloat(a[8])
  4235. };
  4236. return t([s.x, s.y, s.z]) || (s.x = 0,
  4237. s.y = 0,
  4238. s.z = 0),
  4239. t([l.x, l.y, l.z, l.w]) || (l.x = 0,
  4240. l.y = 0,
  4241. l.z = 0,
  4242. l.w = 1),
  4243. {
  4244. mode: h.fromInt(a[0]),
  4245. panoId: a[1],
  4246. position: (new c.Vector3).copy(s),
  4247. quaternion: (new c.Quaternion).copy(l)
  4248. }
  4249. } catch (t) {
  4250. u.warn('Invalid start override, ignoring: "' + e + '"', t.message)
  4251. }
  4252. }
  4253. return null
  4254. }
  4255. }
  4256. }
  4257. ).call(this, "/js/controls/serializer.js")
  4258. }
  4259. , {
  4260. "../enum/Viewmode": 51,
  4261. "../util/logger": 189,
  4262. three: 217
  4263. }],
  4264. 15: [function(C, I, e) {
  4265. (function(e) {
  4266. "use strict";
  4267. function t() {
  4268. this.endlessLoop = r.warp.loop,
  4269. this.clock = new i.Clock(!0),
  4270. this.model = null,
  4271. this.player = null,
  4272. this.currentItem = null,
  4273. this.destinationItem = null,
  4274. this.tourIsPlaying = !1,
  4275. this.transitionStage = v.None,
  4276. this.nextFunc = null,
  4277. this.onTheBus = !1,
  4278. this.tourInProgress = !1,
  4279. this.reachSource = null,
  4280. this.interrupted = !1,
  4281. this.nItems = 0,
  4282. this.walkingSectionPaused = !1
  4283. }
  4284. var i = C("three")
  4285. , n = C("./util/logger")
  4286. , r = C("./settings")
  4287. , o = C("./util/transitions")
  4288. , a = C("events").EventEmitter
  4289. , s = C("./enum/Viewmode")
  4290. , l = C("./analytics")
  4291. , c = C("./enum/WarpStyle")
  4292. , h = (o = C("./util/transitions"),
  4293. C("./model/ModelManager"),
  4294. C("./enum/ModelManagerEvents"))
  4295. , u = C("./enum/DirectorEvents")
  4296. , d = C("./enum/PlayerEvents")
  4297. , p = (C("./enum/ControlEvents"),
  4298. C("./enum/BlackoutStyle"))
  4299. , f = C("./enum/PathDiscardMode")
  4300. , g = C("./enum/PathDisplayMode")
  4301. , m = (C("./player"),
  4302. new n(e))
  4303. , v = Object.freeze({
  4304. None: 0,
  4305. Moving: 1,
  4306. Aiming: 2,
  4307. Interlude: 3
  4308. })
  4309. , y = Object.freeze({
  4310. Forward: 1,
  4311. NoChange: 0,
  4312. Backwards: -1
  4313. })
  4314. , A = o.getUniqueId();
  4315. (t.prototype = Object.create(a.prototype)).init = function(e, t) {
  4316. this.player = e,
  4317. this.modelManager = t,
  4318. this.updateModel(),
  4319. this.resetAll(),
  4320. this.bindEvents()
  4321. }
  4322. ,
  4323. t.prototype.resetAll = function() {
  4324. if (this.currentItem = null,
  4325. this.destinationItem = null,
  4326. this.tourIsPlaying = !1,
  4327. this.bgmReplay(),
  4328. this.transitionStage = v.None,
  4329. this.nextFunc = null,
  4330. this.onTheBus = !1,
  4331. this.reachSource = null,
  4332. this.interrupted = !1,
  4333. this.model) {
  4334. var e = r.path.typ === c.WALK ? c.WALK : c.STD;
  4335. this.defaultWarpStyle = this.model.data.hasOwnProperty("player_options") && this.model.data.player_options && !1 === this.model.data.player_options.fast_transitions ? e : c.BLACK
  4336. } else
  4337. this.defaultWarpStyle = c.BLACK,
  4338. m.warn('No model yet, choosing "' + this.defaultWarpStyle + '" transitions');
  4339. this.resetSpecialTransition()
  4340. }
  4341. ,
  4342. t.prototype.updateModel = function() {
  4343. this.model = this.modelManager.getActiveModel(),
  4344. this.nItems = this.model.heroLocations.length
  4345. }
  4346. ,
  4347. t.prototype.bindEvents = function() {
  4348. this.modelManager.on(h.ActiveModelChanged, this.updateModel.bind(this)),
  4349. this.player.on(d.WarpInterruptedWithFlyTo, this.checkAndHandleWalkingtourInterruption.bind(this)),
  4350. this.player.on(d.Move, this.handlePlayerMove.bind(this)),
  4351. this.player.on(d.PanoChosen, this.handlePlayerPanoChosen.bind(this)),
  4352. this.player.on(d.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  4353. this.player.on(d.InputStart, this.handlePlayerInputStart.bind(this)),
  4354. this.player.on(d.FlyingStarted, this.handlePlayerFlyingStarted.bind(this)),
  4355. this.player.once(d.Move, function() {
  4356. o.cancelById(A)
  4357. })
  4358. }
  4359. ,
  4360. t.prototype.checkAndHandleWalkingtourInterruption = function(e) {
  4361. return e === c.WALK && (this.interrupt(p.NONE),
  4362. this.pauseWalkingSection(),
  4363. this.player.fastForwardActivePanoFlight(),
  4364. !0)
  4365. }
  4366. ,
  4367. t.prototype.handlePlayerMove = function(e) {
  4368. this.transitionStage === v.Interlude && this.interrupt(p.NONE),
  4369. this.emit("update.controls")
  4370. }
  4371. ,
  4372. t.prototype.handlePlayerPanoChosen = function(e, t) {
  4373. this.intermediateState() || e.id === t.id || (this.onTheBus = !1,
  4374. this.emit("update.controls"))
  4375. }
  4376. ,
  4377. t.prototype.handlePlayerModeChanged = function(e, t) {
  4378. this.intermediateState() || e === t || (this.onTheBus = !1,
  4379. this.emit("update.controls"))
  4380. }
  4381. ,
  4382. t.prototype.handlePlayerInputStart = function(e) {
  4383. this.transitionStage === v.Interlude && this.interrupt(p.NONE)
  4384. }
  4385. ,
  4386. t.prototype.handlePlayerFlyingStarted = function() {
  4387. this.clearWalkingSectionPaused()
  4388. }
  4389. ,
  4390. t.prototype.describe = function() {
  4391. return {
  4392. nItems: this.nItems,
  4393. currentItem: this.currentItem,
  4394. destinationItem: this.destinationItem,
  4395. tourIsPlaying: this.tourIsPlaying,
  4396. onTheBus: this.onTheBus,
  4397. endlessLoop: this.endlessLoop,
  4398. viewMode: this.player.mode,
  4399. inTransition: this._inTransition(),
  4400. transitionStage: this.transitionStage,
  4401. tourInProgress: this.tourInProgress
  4402. }
  4403. }
  4404. ,
  4405. t.prototype._inTransition = function() {
  4406. return this.player.flying || this.player.isWarping() || this.player.isWaitingToWarp() || this.player.mode === s.TRANSITIONING || this.tourIsPlaying
  4407. }
  4408. ,
  4409. t.prototype.bounceable = function() {
  4410. var e = this.clock.getDelta();
  4411. return this.isInterrupted() || e < .9 && .01 < e || this.player.flying && !this.player.isWarping()
  4412. }
  4413. ,
  4414. t.prototype.currentMoveDirection = function() {
  4415. return null === this.currentItem || void 0 === this.currentItem ? y.Forward : this.destinationItem === this.currentItem ? y.NoChange : this.destinationItem > this.currentItem ? y.Forward : y.Backwards
  4416. }
  4417. ,
  4418. t.prototype.clearPath = function() {
  4419. this._inTransition() || this.player.path.discardPathObject()
  4420. }
  4421. ,
  4422. t.prototype.allFloors = function() {
  4423. this.model.toggleAllFloors()
  4424. }
  4425. ,
  4426. t.prototype.actionComplete = function(e) {
  4427. if (this.interrupted = !1,
  4428. this.transitionStage = v.None,
  4429. this.resetSpecialTransition(),
  4430. null !== this.destinationItem && this.setCurrentItem(this.destinationItem),
  4431. this.tourIsPlaying || (this.player.disablePreRendering(),
  4432. this.player.mode === s.PANORAMA && this.player.currentPano.isAligned() && this.model.fadePanoMarkers()),
  4433. this.emit("update.controls"),
  4434. this.nextFunc) {
  4435. var t = this.nextFunc;
  4436. this.nextFunc = null,
  4437. t()
  4438. }
  4439. }
  4440. ,
  4441. t.prototype.awaitCompletion = function(e, t) {
  4442. this.nextFunc = t,
  4443. e()
  4444. }
  4445. ,
  4446. t.prototype.updateSuccessFunction = function(e) {
  4447. this.nextFunc = e
  4448. }
  4449. ,
  4450. t.prototype.interrupt = function(e, t) {
  4451. return !!this.wouldInterrupt() && (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4452. this.tourIsPlaying = !1,
  4453. this.bgmReplay(),
  4454. this.interrupted = !0,
  4455. this.nextFunc = null,
  4456. this.emit(u.ActionInterrupted),
  4457. null != e || (e = p.BEGINNING),
  4458. this.player.interruptAndFastForward(e, t),
  4459. !0)
  4460. }
  4461. ,
  4462. t.prototype.wouldInterrupt = function() {
  4463. return this.transitionStage !== v.None
  4464. }
  4465. ,
  4466. t.prototype.intermediateState = function() {
  4467. return this.transitionStage !== v.None
  4468. }
  4469. ,
  4470. t.prototype.isInterrupted = function() {
  4471. return this.interrupted
  4472. }
  4473. ,
  4474. t.prototype.pauseWalkingSection = function() {
  4475. this.walkingSectionPaused = !0
  4476. }
  4477. ,
  4478. t.prototype.clearWalkingSectionPaused = function() {
  4479. this.walkingSectionPaused = !1
  4480. }
  4481. ,
  4482. t.prototype.autoTour = function() {
  4483. var i = Date.now();
  4484. this.model.auxDataPromise.then(function() {
  4485. i = Date.now() - i;
  4486. var e = r.warp.auto
  4487. , t = this.model.data && this.model.data.player_options/* && this.model.data.player_options.highlight_reel */;
  4488. 0 <= e && 1 < this.model.heroCount() && t && o.trigger({
  4489. duration: Math.max(1e3 * Math.min(300, e) - i, 0),
  4490. done: function() {
  4491. this.playTour()
  4492. }
  4493. .bind(this),
  4494. name: "_atr",
  4495. id: A
  4496. })
  4497. }
  4498. .bind(this))
  4499. }
  4500. ,
  4501. t.prototype.atDestinationPano = function() {
  4502. if (!this.player.currentPano || null === this.destinationItem)
  4503. return !1;
  4504. var e = this.player.currentPano.id;
  4505. if (void 0 === e)
  4506. return !1;
  4507. var t = this.model.heroLocations;
  4508. return null !== this.destinationItem && void 0 !== t[this.destinationItem] && e === t[this.destinationItem].panoId
  4509. }
  4510. ,
  4511. t.prototype.redirectToItem = function(e, t) {
  4512. if (null != e)
  4513. if (this.wouldInterrupt())
  4514. if (this.player.mode !== s.TRANSITIONING) {
  4515. m.debug("Director.redirectToItem() -> Redirecting to " + e + " via " + t);
  4516. var i = function() {
  4517. o.setTimeout(function() {
  4518. this.setDestinationItem(e),
  4519. this.goToDestination(!0, p.BEGINNING, r.warp.warpInterruptionRedirectTime, !1)
  4520. }
  4521. .bind(this), 0)
  4522. }
  4523. .bind(this);
  4524. this.interrupt(p.END, 0),
  4525. this.updateSuccessFunction(i)
  4526. } else
  4527. m.debug("Director.redirectToItem() -> Cannot redirect while transitioning.");
  4528. else
  4529. m.warn("Director.redirectToItem() -> Director cannot redirect if there is nothing to interrupt.");
  4530. else
  4531. m.warn("Director.redirectToItem() -> Redirecting to null item.")
  4532. }
  4533. ,
  4534. t.prototype.useSpecialTransition = function(e) {
  4535. void 0 !== e && this.defaultWarpStyle !== c.BLACK && m.debug("useSpecialTransition(): " + e),
  4536. this.nextWarpStyle = c.BLACK
  4537. }
  4538. ,
  4539. t.prototype.resetSpecialTransition = function() {
  4540. this.nextWarpStyle = this.defaultWarpStyle
  4541. }
  4542. ,
  4543. t.prototype.arrivedAtDestination = function(e) {
  4544. if (this.player.flying || this.player.isWarping())
  4545. m.warn("Cannot advance to interlude or aiming while player is flying or warping.");
  4546. else {
  4547. this.transitionStage = v.Aiming;
  4548. var t = this.tourIsPlaying ? this.tourInterlude.bind(this, this.nextItem(this.currentItem)) : null;
  4549. this.player.model.fadePanoMarkers(0),
  4550. this.awaitCompletion(function() {
  4551. this.resetSpecialTransition(),
  4552. e ? this.player.aimTourCamera(this.destinationItem, g.Retain, g.Slow, this.actionComplete.bind(this)) : this.actionComplete()
  4553. }
  4554. .bind(this), t)
  4555. }
  4556. }
  4557. ,
  4558. t.prototype.goToDestination = function(e, t, i, n) {
  4559. if (void 0 !== g_data2.tourAudio && null !== g_data2.tourAudio) {
  4560. var r = g_data2.tourAudio[this.model.heroLocations[this.destinationItem].sid];
  4561. if (r && 0 < r.music.length) {
  4562. var o = r.music.includes(g_Prefix.slice(-10)) ? r.music : g_Prefix + r.music;
  4563. g_tourAudio.src = manage.dealURL(o);
  4564. g_tourAudio.load(),
  4565. g_tourAudio.crossOrigin = "anonymous",
  4566. g_tourAudio.oncanplaythrough = function() {
  4567. g_tourAudio.play();
  4568. if(g_bgAudio && !g_bgAudio.paused){
  4569. manage.switchBgmState(false);
  4570. g_bgAudio.pauseByTour = true
  4571. }
  4572. g_playAudio = g_tourAudio;
  4573. }
  4574. }
  4575. }
  4576. if (this.onTheBus = !0,
  4577. this.emit("update.controls"),
  4578. this.player.updateLastView(),
  4579. n || !this.atDestinationPano())
  4580. if (this.player.flying || this.player.isWarping())
  4581. m.warn("Cannot go to new destination while player is flying or warping.");
  4582. else {
  4583. var a = this.model.getHeroDescriptorByIndex(this.destinationItem)
  4584. , s = null
  4585. , l = null;
  4586. if (a.isPano()) {
  4587. o = window.MP_PREFETCHED_MODELDATA.momentTour || "walk";
  4588. l = this.player.warpToPanoByHeroIndex.bind(this.player, this.destinationItem, g.Show, f.Slow, o, !0, i, this.actionComplete.bind(this)),
  4589. s = this.arrivedAtDestination.bind(this, !0)
  4590. } else
  4591. l = this.player.warpToNonPanoByHeroIndex.bind(this.player, this.destinationItem, this.actionComplete.bind(this)),
  4592. s = this.arrivedAtDestination.bind(this, !1);
  4593. this.transitionStage = v.Moving,
  4594. this.model.fadePanoMarkers(0),
  4595. this.awaitCompletion(function() {
  4596. l()
  4597. }
  4598. .bind(this), s),
  4599. this.emit("update.controls")
  4600. }
  4601. else
  4602. this.arrivedAtDestination(!0)
  4603. }
  4604. ,
  4605. t.prototype.tourInterlude = function() {
  4606. if (l.trackAlways("reach_highlight", {
  4607. reach_source: this.reachSource
  4608. }),
  4609. this.model.fadePanoMarkers(0),
  4610. this.emit("update.controls"),
  4611. this.tourIsPlaying)
  4612. return this.atEndOfTour() && !this.endlessLoop ? (this.tourInProgress = !1,
  4613. this.stopTour(),
  4614. this.emit(u.TourEnd),
  4615. void (this.player.mode === s.PANORAMA && this.model.fadePanoMarkers(r.panorama.markerOpacity))) : void this.awaitCompletion(function() {
  4616. this.transitionStage = v.Interlude,
  4617. this.player.tourInterlude(this.nextItem(this.currentItem), this.actionComplete.bind(this))
  4618. }
  4619. .bind(this), this.goNext.bind(this))
  4620. }
  4621. ,
  4622. t.prototype.playTour = function() {
  4623. if (!this.bounceable())
  4624. return this.tourIsPlaying ? void m.info("tour is already playing") : void (this.wouldInterrupt() || (this.player.emit("tour_auto", this.defaultWarpStyle),
  4625. this.tourInProgress = !0,
  4626. this.reachSource = "play",
  4627. this.tourIsPlaying = !0,
  4628. this.wasZoomEnabled = this.player.zoomEnabled,
  4629. this.player.zoomEnabled = !1,
  4630. this.resetSpecialTransition(),
  4631. this.emit("update.controls"),
  4632. this.emit(u.TourStart),
  4633. this.player.enablePreRendering(),
  4634. this.walkingSectionPaused ? (this.clearWalkingSectionPaused(),
  4635. this.goToDestination()) : this.goNext()))
  4636. }
  4637. ,
  4638. t.prototype.bgmReplay = function() {
  4639. if(g_bgAudio && g_bgAudio.paused && g_bgAudio.pauseByTour){
  4640. g_playAudio = g_bgAudio;
  4641. g_tourAudio && g_tourAudio.pause();
  4642. //window.tourAudio && window.tourAudio.pause();
  4643. manage.switchBgmState(true);
  4644. }
  4645. }
  4646. ,
  4647. t.prototype.stopTour = function(isAutoStop) {//停止导览 isAutoStop 希望仅在飞完结束自动停止时的stopTour不停止tourSound, 这样才能完整播放tourSound. 不过似乎会在倒数第二个片段点击按钮停止导览时也视作自动结束的(执行this.interrupt() )。
  4648. this.isInterrupted() || this.transitionStage === v.Moving && this.checkAndHandleWalkingtourInterruption(this.nextWarpStyle) || (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4649. this.tourIsPlaying = !1,
  4650. (!isAutoStop || g_tourAudio && g_tourAudio.paused )&&this.bgmReplay(),//xzw
  4651. this.interrupt(),
  4652. this.clearWalkingSectionPaused(),
  4653. this.resetSpecialTransition(),
  4654. this.emit("update.controls"))
  4655. if(!isAutoStop && g_tourAudio && g_tourAudio.paused == false )
  4656. {
  4657. g_tourAudio.pause();
  4658. g_tourAudio.src = ""
  4659. }
  4660. }
  4661. ,
  4662. t.prototype.endTourProgress = function() {
  4663. this.tourInProgress = !1,
  4664. this.emit("update.controls"),
  4665. this.emit(u.TourEnd)
  4666. }
  4667. ,
  4668. t.prototype.goToHighlight = function(e) {
  4669. if (this.wouldInterrupt())
  4670. e === this.destinationItem ? this.interrupt() : this.redirectToItem(e, "goToHighlight");
  4671. else {
  4672. if (m.debug("<tour.goto " + e + ">"),
  4673. this.isInterrupted())
  4674. return;
  4675. this.clearWalkingSectionPaused(),
  4676. this.setDestinationItem(e),
  4677. this.useSpecialTransition("Hilight"),
  4678. this.goToDestination(),
  4679. l.trackAlways("reach_highlight", {
  4680. reach_source: "thumb"
  4681. })
  4682. }
  4683. }
  4684. ,
  4685. t.prototype.prevHighlight = function() {
  4686. this.bounceable() || (this.player.emit("tour_manual", "prev"),
  4687. this.interrupt(p.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4688. this.reachSource = "prev",
  4689. this.goPrev()))
  4690. }
  4691. ,
  4692. t.prototype.nextHighlight = function() {
  4693. this.bounceable() || (this.player.emit("tour_manual", "next"),
  4694. this.interrupt(p.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4695. this.reachSource = "next",
  4696. this.goNext()))
  4697. }
  4698. ,
  4699. t.prototype.changeMode = function(e) {
  4700. var t = $.Deferred()
  4701. , i = t.resolve.bind(t)
  4702. , n = t.reject.bind(t);
  4703. if (this.emit(u.StartModeChange),
  4704. !function() {
  4705. return this.clearWalkingSectionPaused(),
  4706. !!this.wouldInterrupt() && (this.interrupt(),
  4707. !0)
  4708. }
  4709. .bind(this)()) {
  4710. switch (e) {
  4711. case s.PANORAMA:
  4712. 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);
  4713. break;
  4714. case s.DOLLHOUSE:
  4715. case s.FLOORPLAN:
  4716. this.player.flyToNewMode({
  4717. mode: e
  4718. }).done(i).fail(n);
  4719. break;
  4720. case s.OUTDOOR:
  4721. 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)
  4722. }
  4723. return t.promise()
  4724. }
  4725. }
  4726. ,
  4727. t.prototype.atEndOfTour = function() {
  4728. return this.currentItem >= this.nItems - 1
  4729. }
  4730. ,
  4731. t.prototype.firstDestination = function() {
  4732. return 0 < this.nItems ? 0 : null
  4733. }
  4734. ,
  4735. t.prototype.finalDestination = function() {
  4736. return 0 < this.nItems ? this.nItems - 1 : null
  4737. }
  4738. ,
  4739. t.prototype.goPrev = function() {
  4740. this.tourAdvance(-1)
  4741. }
  4742. ,
  4743. t.prototype.goNext = function() {
  4744. this.tourAdvance(1)
  4745. }
  4746. ,
  4747. t.prototype.setDestinationItem = function(e) {
  4748. this.destinationItem = e,
  4749. this.emit("update.controls")
  4750. }
  4751. ,
  4752. t.prototype.setCurrentItem = function(e) {
  4753. this.currentItem = e,
  4754. this.emit("update.controls")
  4755. }
  4756. ,
  4757. t.prototype.nextItem = function(e) {
  4758. return null === e ? this.firstDestination() : e >= this.nItems - 1 ? this.endlessLoop ? this.firstDestination() : null : e + 1
  4759. }
  4760. ,
  4761. t.prototype.prevItem = function(e) {
  4762. return null === e ? this.firstDestination() : e < 0 ? this.endlessLoop ? this.lastDestination() : null : e - 1
  4763. }
  4764. ,
  4765. t.prototype.tourAdvance = function(e) {
  4766. if (m.debug("tourAdvance(" + e + ")"),
  4767. null === this.currentItem || void 0 === this.currentItem ? this.setDestinationItem(this.firstDestination()) : this.setDestinationItem(this.currentItem + e),
  4768. this.destinationItem < 0 ? (this.setDestinationItem(this.finalDestination()),
  4769. this.useSpecialTransition("reverse-looping to end")) : this.destinationItem >= this.nItems && (this.setDestinationItem(this.firstDestination()),
  4770. this.useSpecialTransition("looping back to start")),
  4771. "black" === window.MP_PREFETCHED_MODELDATA.momentTour) {
  4772. var i = this.player.zoomLevel;
  4773. this.player.zoomEnabled = !0;
  4774. var t = function(e, t) {
  4775. this.player.zoomTo((1 - e) * i, !0)
  4776. }
  4777. .bind(this);
  4778. o.start(t, 1500, function() {}, 0, h.easeOutQuad, "zoom")
  4779. }
  4780. this.goToDestination()
  4781. }
  4782. ,
  4783. I.exports = t
  4784. }
  4785. ).call(this, "/js/director.js")
  4786. }
  4787. , {
  4788. "./analytics": 4,
  4789. "./enum/BlackoutStyle": 18,
  4790. "./enum/ControlEvents": 21,
  4791. "./enum/DirectorEvents": 23,
  4792. "./enum/ModelManagerEvents": 33,
  4793. "./enum/PathDiscardMode": 38,
  4794. "./enum/PathDisplayMode": 39,
  4795. "./enum/PlayerEvents": 40,
  4796. "./enum/Viewmode": 51,
  4797. "./enum/WarpStyle": 52,
  4798. "./model/ModelManager": 140,
  4799. "./player": 155,
  4800. "./settings": 166,
  4801. "./util/logger": 189,
  4802. "./util/transitions": 195,
  4803. events: 202,
  4804. three: 217
  4805. }],
  4806. 16: [function(e, t, i) {
  4807. "use strict";
  4808. var n = e("three")
  4809. , r = e("./enum/Viewmode")
  4810. , o = (e("./settings"),
  4811. e("./util/transitions"))
  4812. , a = e("./enum/PlayerEvents")
  4813. , s = new n.ShaderPass(n.HorizontalBlurShader)
  4814. , l = new n.ShaderPass(n.VerticalBlurShader);
  4815. l.renderToScreen = !0;
  4816. var c = $("#player").width() / $("#player").height();
  4817. isNaN(c) && (c = 1);
  4818. var h = {
  4819. currentBlur: 0,
  4820. aspect: c,
  4821. blurStrength: 1,
  4822. hblurPass: s,
  4823. vblurPass: l,
  4824. bindEvents: function(e) {
  4825. e.on(a.ModeChanged, function(e, t) {
  4826. e === r.PANORAMA && (o.cancel(h.blur),
  4827. o.cancel(h.addBlur),
  4828. o.start(h.removeBlur, 500, null, 0, null, "deblur"))
  4829. })
  4830. },
  4831. blur: function(e) {
  4832. var t = (h.currentBlur = e) * h.blurStrength;
  4833. l.uniforms.v.value = t / 512 * h.aspect,
  4834. s.uniforms.h.value = t / 512
  4835. },
  4836. addBlur: function(e) {
  4837. e = Math.max(e, h.currentBlur),
  4838. h.blur(e)
  4839. },
  4840. removeBlur: function(e) {
  4841. e = Math.min(1 - e, h.currentBlur),
  4842. h.blur(e)
  4843. }
  4844. };
  4845. h.blur(0),
  4846. t.exports = h
  4847. }
  4848. , {
  4849. "./enum/PlayerEvents": 40,
  4850. "./enum/Viewmode": 51,
  4851. "./settings": 166,
  4852. "./util/transitions": 195,
  4853. three: 217
  4854. }],
  4855. 17: [function(e, t, i) {
  4856. "use strict";
  4857. t.exports = {
  4858. UNKNOWN: 0,
  4859. ALIGNED: 1,
  4860. UNALIGNED: 2,
  4861. PLACED: 3
  4862. }
  4863. }
  4864. , {}],
  4865. 18: [function(e, t, i) {
  4866. "use strict";
  4867. t.exports = {
  4868. NONE: 0,
  4869. MIDDLE: 1,
  4870. END: 2,
  4871. BEGINNING: 3,
  4872. FADEIN: 4
  4873. }
  4874. }
  4875. , {}],
  4876. 19: [function(e, t, i) {
  4877. "use strict";
  4878. var r = e("three");
  4879. t.exports = {
  4880. newBlue: new r.Color(4967932),
  4881. altBlue: new r.Color(47355),
  4882. tagDefault: new r.Color(223357),
  4883. classicBlue: new r.Color(53759),
  4884. mpYellow: new r.Color(16502016),
  4885. mpOrange: new r.Color(16428055),
  4886. mpBlue: new r.Color(12096),
  4887. mpLtGrey: new r.Color(13751252),
  4888. mpDkGrey: new r.Color(10000019),
  4889. mpRed: new r.Color(12525854),
  4890. mpOrangeDesat: new r.Color(16764529),
  4891. mpBlueDesat: new r.Color(4034734),
  4892. mpRedDesat: new r.Color(14705505),
  4893. white: new r.Color(16777215),
  4894. black: new r.Color(0),
  4895. _desat: function(e, t) {
  4896. var i = t || .3
  4897. , n = (new r.Color).copy(e).getHSL();
  4898. return (new r.Color).setHSL(n.h, n.s * (1 - i), n.l)
  4899. },
  4900. _darken: function(e, t) {
  4901. var i = t || .2
  4902. , n = e.getHSL();
  4903. return (new r.Color).setHSL(n.h, n.s, n.l * (1 - i))
  4904. }
  4905. }
  4906. }
  4907. , {
  4908. three: 217
  4909. }],
  4910. 20: [function(e, t, i) {
  4911. "use strict";
  4912. t.exports = {
  4913. NONE: -1,
  4914. ROTATE: 0,
  4915. DOLLY: 1,
  4916. PAN: 2,
  4917. ROTATE_DOLLY: 3,
  4918. PAN_DOLLY: 4
  4919. }
  4920. }
  4921. , {}],
  4922. 21: [function(e, t, i) {
  4923. "use strict";
  4924. t.exports = {
  4925. Move: "move",
  4926. InteractionDirect: "interaction.direct",
  4927. InteractionKey: "interaction.key",
  4928. InteractionGui: "interaction.gui",
  4929. FlyInDirection: "fly.direction",
  4930. InputStart: "input.start",
  4931. Pinch: "input.pinch",
  4932. Scroll: "input.scroll",
  4933. AutoPanInterrupt: "autopan.interrupt",
  4934. AutoPanComplete: "autopan.complete",
  4935. AutoPanClamped: "autopan.clamped",
  4936. LongTap: "longtap"
  4937. }
  4938. }
  4939. , {}],
  4940. 22: [function(e, t, i) {
  4941. "use strict";
  4942. t.exports = Object.freeze({
  4943. FORWARD: "FORWARD",
  4944. LEFT: "LEFT",
  4945. RIGHT: "RIGHT",
  4946. BACK: "BACK",
  4947. UP: "UP",
  4948. DOWN: "DOWN"
  4949. })
  4950. }
  4951. , {}],
  4952. 23: [function(e, t, i) {
  4953. "use strict";
  4954. t.exports = {
  4955. ActionInterrupted: "action.interrupted",
  4956. TourStart: "tour.start",
  4957. TourEnd: "tour.end",
  4958. StartModeChange: "mode.startChange"
  4959. }
  4960. }
  4961. , {}],
  4962. 24: [function(e, t, i) {
  4963. "use strict";
  4964. t.exports = Object.freeze({
  4965. None: 0,
  4966. Queued: 1,
  4967. ForceQueued: 2,
  4968. Downloading: 3,
  4969. Downloaded: 4,
  4970. DownloadFailed: 5
  4971. })
  4972. }
  4973. , {}],
  4974. 25: [function(e, t, i) {
  4975. "use strict";
  4976. t.exports = {
  4977. GL_TEXTURE_CUBE_MAP_POSITIVE_X: 0,
  4978. GL_TEXTURE_CUBE_MAP_NEGATIVE_X: 1,
  4979. GL_TEXTURE_CUBE_MAP_POSITIVE_Y: 2,
  4980. GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: 3,
  4981. GL_TEXTURE_CUBE_MAP_POSITIVE_Z: 4,
  4982. GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: 5
  4983. }
  4984. }
  4985. , {}],
  4986. 26: [function(e, t, i) {
  4987. "use strict";
  4988. t.exports = {
  4989. Texture2D: 0,
  4990. TextureCube: 1
  4991. }
  4992. }
  4993. , {}],
  4994. 27: [function(e, t, i) {
  4995. "use strict";
  4996. t.exports = {
  4997. SMALL: "small",
  4998. LARGE: "large"
  4999. }
  5000. }
  5001. , {}],
  5002. 28: [function(e, t, i) {
  5003. "use strict";
  5004. var n = e("./Viewmode")
  5005. , r = {
  5006. LANDING: {},
  5007. NAVIGATION: "navigation",
  5008. MORE_HELP: "moreHelp",
  5009. TOUR_INTERACTION: {}
  5010. };
  5011. r.LANDING[n.PANORAMA] = "panorama.landing",
  5012. r.LANDING[n.OUTDOOR] = "outdoor.landing",
  5013. r.LANDING[n.DOLLHOUSE] = "dollhouse.landing",
  5014. r.LANDING[n.FLOORPLAN] = "floorplan.landing",
  5015. r.TOUR_INTERACTION.standard = "standard.tour",
  5016. r.TOUR_INTERACTION[n.OUTDOOR] = "outdoor.tour",
  5017. r.TOUR_INTERACTION[n.FLOORPLAN] = "floorplan.tour",
  5018. t.exports = r
  5019. }
  5020. , {
  5021. "./Viewmode": 51
  5022. }],
  5023. 29: [function(e, t, i) {
  5024. "use strict";
  5025. var n = {
  5026. UP: 1,
  5027. DOWN: -1,
  5028. LEFT: "L",
  5029. RIGHT: "R",
  5030. FORWARD: "F",
  5031. BACK: "B",
  5032. reverse: {},
  5033. opposite: function(e) {
  5034. return this.reverse[e.toString()]
  5035. }
  5036. };
  5037. n.reverse[n.UP] = n.DOWN,
  5038. n.reverse[n.DOWN] = n.UP,
  5039. n.reverse[n.LEFT] = n.RIGHT,
  5040. n.reverse[n.RIGHT] = n.LEFT,
  5041. n.reverse[n.FORWARD] = n.BACK,
  5042. n.reverse[n.BACK] = n.FORWARD,
  5043. t.exports = n
  5044. }
  5045. , {}],
  5046. 30: [function(e, t, i) {
  5047. "use strict";
  5048. var n = {
  5049. ZERO: 48,
  5050. ONE: 49,
  5051. TWO: 50,
  5052. THREE: 51,
  5053. FOUR: 52,
  5054. FIVE: 53,
  5055. SIX: 54,
  5056. SEVEN: 55,
  5057. EIGHT: 56,
  5058. NINE: 57,
  5059. LEFTARROW: 37,
  5060. UPARROW: 38,
  5061. RIGHTARROW: 39,
  5062. DOWNARROW: 40,
  5063. A: 65,
  5064. B: 66,
  5065. C: 67,
  5066. D: 68,
  5067. E: 69,
  5068. F: 70,
  5069. G: 71,
  5070. H: 72,
  5071. I: 73,
  5072. J: 74,
  5073. K: 75,
  5074. L: 76,
  5075. M: 77,
  5076. N: 78,
  5077. O: 79,
  5078. P: 80,
  5079. Q: 81,
  5080. R: 82,
  5081. S: 83,
  5082. T: 84,
  5083. U: 85,
  5084. V: 86,
  5085. W: 87,
  5086. X: 88,
  5087. Y: 89,
  5088. Z: 90,
  5089. SPACE: 32,
  5090. RETURN: 13,
  5091. SEMICOLON: 186,
  5092. PLUSEQUALS: 187,
  5093. DASHUNDERSCORE: 189,
  5094. OPENBRACKET: 219
  5095. };
  5096. e("../util/browser").detectFirefox() && (n.SEMICOLON = 59,
  5097. n.PLUSEQUALS = 61,
  5098. n.DASHUNDERSCORE = 173),
  5099. t.exports = n
  5100. }
  5101. , {
  5102. "../util/browser": 182
  5103. }],
  5104. 31: [function(e, t, i) {
  5105. "use strict";
  5106. t.exports = {
  5107. EN_US: "en-US",
  5108. ES_MX: "es-MX",
  5109. FR_FR: "fr-FR",
  5110. DE_DE: "de-DE",
  5111. RU_RU: "ru-RU",
  5112. CN_CN: "cn-CN",
  5113. JP_JP: "jp-JP"
  5114. }
  5115. }
  5116. , {}],
  5117. 32: [function(e, t, i) {
  5118. "use strict";
  5119. t.exports = {
  5120. TagActivated: "tag.activated",
  5121. TagDismissed: "tag.dismissed",
  5122. TagNavigation: "tag.navigation"
  5123. }
  5124. }
  5125. , {}],
  5126. 33: [function(e, t, i) {
  5127. "use strict";
  5128. t.exports = {
  5129. ModelAdded: "model-added",
  5130. ActiveModelChanged: "active-model-changed"
  5131. }
  5132. }
  5133. , {}],
  5134. 34: [function(e, t, i) {
  5135. "use strict";
  5136. t.exports = {
  5137. LEFT: 0,
  5138. MIDDLE: 1,
  5139. RIGHT: 2
  5140. }
  5141. }
  5142. , {}],
  5143. 35: [function(e, t, i) {
  5144. "use strict";
  5145. t.exports = {
  5146. PanoRenderComplete: "panorama.render.complete",
  5147. TileRenderFailure: "panorama.tile.render.failed",
  5148. TileRenderSuccess: "panorama.tile.render.success",
  5149. TileUploadAttempted: "panorama.tile.upload.attempted",
  5150. UploadAttemptedForAllTiles: "panorama.upload.attempted.all.tiles",
  5151. ZoomLevelRenderStarted: "panorama.zoom.render.started"
  5152. }
  5153. }
  5154. , {}],
  5155. 36: [function(e, t, i) {
  5156. "use strict";
  5157. t.exports = {
  5158. BASE: 1,
  5159. STANDARD: 2,
  5160. HIGH: 3,
  5161. ULTRAHIGH: 4
  5162. }
  5163. }
  5164. , {}],
  5165. 37: [function(e, t, i) {
  5166. "use strict";
  5167. t.exports = {
  5168. LoadComplete: "panorama.load.complete",
  5169. LoadFailed: "panorama.load.failed",
  5170. TileLoaded: "panorama.tile.loaded"
  5171. }
  5172. }
  5173. , {}],
  5174. 38: [function(e, t, i) {
  5175. "use strict";
  5176. t.exports = Object.freeze({
  5177. Standard: 0,
  5178. Slow: 1,
  5179. Retain: 2
  5180. })
  5181. }
  5182. , {}],
  5183. 39: [function(e, t, i) {
  5184. "use strict";
  5185. t.exports = Object.freeze({
  5186. Show: 0,
  5187. Hide: 1,
  5188. Retain: 2
  5189. })
  5190. }
  5191. , {}],
  5192. 40: [function(e, t, i) {
  5193. "use strict";
  5194. t.exports = {
  5195. Move: "move",
  5196. MoveComplete: "move.complete",
  5197. ModeChanged: "mode.changed",
  5198. ModeChanging: "mode.changing",
  5199. PanoChosen: "pano.chosen",
  5200. ClosestPanoChanging: "closest.pano.changing",
  5201. WarpStarted: "warp.started",
  5202. WarpInterrupted: "warp.interrupted",
  5203. WarpEnded: "warp.ended",
  5204. FlyinFinished: "flyin.finished",
  5205. FlyingStarted: "flying.started",
  5206. FlyingInterrupted: "flying.interrupted",
  5207. FlyingEnded: "flying.ended",
  5208. Ready: "ready",
  5209. StartInside: "start.inside",
  5210. StartOutside: "start.outside",
  5211. ViewChanged: "view.changed",
  5212. WarpInterruptedWithFlyTo: "warp.interrupted.flyto",
  5213. InputStart: "input.start"
  5214. }
  5215. }
  5216. , {}],
  5217. 41: [function(e, t, i) {
  5218. "use strict";
  5219. t.exports = Object.freeze({
  5220. DEFAULT: 0,
  5221. PANOMARKERS: 1,
  5222. RETICULE: 2,
  5223. TAG: 3
  5224. })
  5225. }
  5226. , {}],
  5227. 42: [function(e, t, i) {
  5228. "use strict";
  5229. t.exports = {
  5230. visibleFloor: 1,
  5231. ghostFloor: 3,
  5232. boundingSkybox: 1,
  5233. panoMarker: 2,
  5234. reticule: 3,
  5235. tagStem: 4,
  5236. tagDisc: 5,
  5237. ribbon: 100
  5238. }
  5239. }
  5240. , {}],
  5241. 43: [function(e, t, i) {
  5242. "use strict";
  5243. t.exports = {
  5244. ContextCreated: "scene-renderer-context-created",
  5245. AfterRender: "after-render",
  5246. MemoryUsageUpdated: "scene-renderer-memory-usage-updated"
  5247. }
  5248. }
  5249. , {}],
  5250. 44: [function(e, t, i) {
  5251. "use strict";
  5252. t.exports = {
  5253. IDLE: "idle",
  5254. BROWSE: "browse",
  5255. EXAMINE: "examine"
  5256. }
  5257. }
  5258. , {}],
  5259. 45: [function(e, t, i) {
  5260. "use strict";
  5261. t.exports = {
  5262. TileDownloadSuccess: "tiledownloader.download.success",
  5263. TileDownloadFailure: "tiledownloader.download.failure",
  5264. PanoDownloadComplete: "tiledownloader.pano.download.complete"
  5265. }
  5266. }
  5267. , {}],
  5268. 46: [function(e, t, i) {
  5269. "use strict";
  5270. t.exports = {
  5271. CardboardAndroid: "googlevr",
  5272. GearVR: "gearvr",
  5273. CardboardIOS: "googlevrios",
  5274. Cardboard: "googlevr"
  5275. }
  5276. }
  5277. , {}],
  5278. 47: [function(e, t, i) {
  5279. "use strict";
  5280. t.exports = {
  5281. NONE: 0,
  5282. CONTEXTUAL: 1,
  5283. ANDROID: 2
  5284. }
  5285. }
  5286. , {}],
  5287. 48: [function(e, t, i) {
  5288. "use strict";
  5289. var n = {
  5290. Title: 0,
  5291. Cardboard: 1
  5292. }
  5293. , r = {
  5294. Title: 0,
  5295. Cardboard: 1,
  5296. Gear: 2
  5297. };
  5298. [n, r].forEach(function(e) {
  5299. e.pageCount = Object.keys(e).length
  5300. }),
  5301. t.exports.ios = n,
  5302. t.exports.standard = r
  5303. }
  5304. , {}],
  5305. 49: [function(e, t, i) {
  5306. "use strict";
  5307. t.exports = {
  5308. Android: "android",
  5309. IOS: "ios",
  5310. Desktop: "desktop",
  5311. UnsupportedAndroid: "android-unsupported"
  5312. }
  5313. }
  5314. , {}],
  5315. 50: [function(e, t, i) {
  5316. "use strict";
  5317. var n = e("three");
  5318. t.exports = {
  5319. UP: new n.Vector3(0,1,0),
  5320. DOWN: new n.Vector3(0,-1,0),
  5321. LEFT: new n.Vector3(-1,0,0),
  5322. RIGHT: new n.Vector3(1,0,0),
  5323. FORWARD: new n.Vector3(0,0,-1),
  5324. BACK: new n.Vector3(0,0,1)
  5325. }
  5326. }
  5327. , {
  5328. three: 217
  5329. }],
  5330. 51: [function(e, t, i) {
  5331. "use strict";
  5332. var n = e("../exception/ViewmodeConvertException")
  5333. , r = e("./coreViewmodes")
  5334. , o = {
  5335. MESH: "mesh",
  5336. OUTDOOR: "outdoor",
  5337. TRANSITIONING: "transitioning",
  5338. toInt: function(e) {
  5339. switch (e) {
  5340. case this.PANORAMA:
  5341. return 1;
  5342. case this.DOLLHOUSE:
  5343. return 2;
  5344. case this.FLOORPLAN:
  5345. return 3;
  5346. case this.OUTDOOR:
  5347. return 4;
  5348. case this.TRANSITIONING:
  5349. return -1
  5350. }
  5351. throw new n("No known conversion for Viewmode to int for mode: " + e)
  5352. },
  5353. fromInt: function(e) {
  5354. switch (e) {
  5355. case "1":
  5356. case 1:
  5357. return this.PANORAMA;
  5358. case "2":
  5359. case 2:
  5360. return this.DOLLHOUSE;
  5361. case "3":
  5362. case 3:
  5363. return this.FLOORPLAN;
  5364. case "4":
  5365. case 4:
  5366. return this.OUTDOOR
  5367. }
  5368. throw new n("No known conversion for int to viewmode for int: " + e)
  5369. },
  5370. convertWorkshopModeInt: function(e) {
  5371. switch (e) {
  5372. case "0":
  5373. case 0:
  5374. case void 0:
  5375. return this.PANORAMA;
  5376. case "1":
  5377. case 1:
  5378. return this.FLOORPLAN;
  5379. case "2":
  5380. case 2:
  5381. return this.DOLLHOUSE;
  5382. case "3":
  5383. case 3:
  5384. return this.MESH
  5385. }
  5386. throw new n("No known conversion for Workshop int to viewmode for int: " + e)
  5387. }
  5388. };
  5389. e("../util/common").extendObject(o, r),
  5390. t.exports = o
  5391. }
  5392. , {
  5393. "../exception/ViewmodeConvertException": 58,
  5394. "../util/common": 185,
  5395. "./coreViewmodes": 54
  5396. }],
  5397. 52: [function(e, t, i) {
  5398. "use strict";
  5399. t.exports = {
  5400. BLACK: "black",
  5401. STD: "std",
  5402. WALK: "walk"
  5403. }
  5404. }
  5405. , {}],
  5406. 53: [function(e, t, i) {
  5407. "use strict";
  5408. t.exports = {
  5409. ZoomIn: "zoom.in",
  5410. ZoomOut: "zoom.out",
  5411. ZoomMax: "zoom.max",
  5412. ZoomMin: "zoom.min"
  5413. }
  5414. }
  5415. , {}],
  5416. 54: [function(e, t, i) {
  5417. "use strict";
  5418. t.exports = {
  5419. PANORAMA: "panorama",
  5420. DOLLHOUSE: "dollhouse",
  5421. FLOORPLAN: "floorplan"
  5422. }
  5423. }
  5424. , {}],
  5425. 55: [function(e, t, i) {
  5426. "use strict";
  5427. t.exports = function(e) {
  5428. this.message = e
  5429. }
  5430. }
  5431. , {}],
  5432. 56: [function(e, t, i) {
  5433. "use strict";
  5434. function n(e) {
  5435. r.call(this, e)
  5436. }
  5437. var r = e("./BasicException");
  5438. n.prototype = Object.create(r.prototype),
  5439. t.exports = n
  5440. }
  5441. , {
  5442. "./BasicException": 55
  5443. }],
  5444. 57: [function(e, t, i) {
  5445. "use strict";
  5446. function n(e) {
  5447. r.call(this, e)
  5448. }
  5449. var r = e("./BasicException");
  5450. n.prototype = Object.create(r.prototype),
  5451. t.exports = n
  5452. }
  5453. , {
  5454. "./BasicException": 55
  5455. }],
  5456. 58: [function(e, t, i) {
  5457. "use strict";
  5458. function n(e) {
  5459. r.call(this, e)
  5460. }
  5461. var r = e("./BasicException");
  5462. n.prototype = Object.create(r.prototype),
  5463. t.exports = n
  5464. }
  5465. , {
  5466. "./BasicException": 55
  5467. }],
  5468. 59: [function(a, s, e) {
  5469. (function(e) {
  5470. "use strict";
  5471. var i = a("./util/ajax")
  5472. , n = a("./util/showcase")
  5473. , t = a("./util/logger")
  5474. , r = new t(e)
  5475. , o = {};
  5476. s.exports = {
  5477. loadFeatureFlags: function(e) {
  5478. var t = $.Deferred();
  5479. return i.get(e.urlBase + "", {
  5480. responseType: "json",
  5481. prefetchFrom: "user",
  5482. auth: n.getAuthorizationHeader()
  5483. }).done(function(e) {
  5484. (o = function(e) {
  5485. var t = {};
  5486. if (e) {
  5487. var i = e.flags;
  5488. if (i)
  5489. for (var n in i)
  5490. i.hasOwnProperty(n) && (t[i[n]] = !0);
  5491. return t
  5492. }
  5493. return r.debug("Feature flags -> parseFeatureFlags: rawData is null."),
  5494. null
  5495. }(e)) ? t.resolve(o) : t.reject("loading-failed")
  5496. }).fail(function() {
  5497. r.debug("Retrieval of feature flags failed."),
  5498. t.reject("loading-failed")
  5499. }),
  5500. t.promise()
  5501. },
  5502. getFlags: function() {
  5503. return o
  5504. },
  5505. updateDependentSettings: function(e, t) {
  5506. (e = e || o).labels && (t.labels.enabled = !0),
  5507. e.zooming && !t.zoom.forceOff && (t.zoom.enabled = !0),
  5508. e.showcase_sdk && (t.sdkInit = !0),
  5509. e.mobile_highq_override && (t.tiling.mobileHighQualityOverride = !0),
  5510. e.showcase_webvr && (t.vr.allowWebVR = !0),
  5511. e.uhql && (t.tiling.allowUltraHighResolution = !0),
  5512. e.hide_sc_sharing && (t.share.enabled = !1)
  5513. }
  5514. }
  5515. }
  5516. ).call(this, "/js/featureflags.js")
  5517. }
  5518. , {
  5519. "./util/ajax": 181,
  5520. "./util/logger": 189,
  5521. "./util/showcase": 193
  5522. }],
  5523. 60: [function(e, t, i) {
  5524. "use strict";
  5525. var n = (e("../util/common"),
  5526. {
  5527. status: 0,
  5528. set: function(e) {
  5529. if (isNaN(e))
  5530. return !1;
  5531. var t = $(".progressbar");
  5532. e < 0 && (e = 0),
  5533. 100 < e && (e = 100);
  5534. var i = e * (parseInt(t.css("width").replace("px", "")) / 100)
  5535. , n = Math.round(e)
  5536. , r = parseInt(i) - 15;
  5537. t.find(".bar").css("width", i),
  5538. t.find(".label").css("left", r),
  5539. t.find(".perc").text(n + "%"),
  5540. this.status = e
  5541. },
  5542. done: function(e) {
  5543. return e || this.status ? (this.status = null,
  5544. this.set(100)) : this
  5545. }
  5546. });
  5547. t.exports.circleLoader = n
  5548. }
  5549. , {
  5550. "../util/common": 185
  5551. }],
  5552. 61: [function(e, t, i) {
  5553. "use strict";
  5554. t.exports = Object.freeze({
  5555. CLOSE: "modal.closer.close"
  5556. })
  5557. }
  5558. , {}],
  5559. 62: [function(e, t, i) {
  5560. "use strict";
  5561. function n(t, e) {
  5562. function i() {
  5563. var e = t.offsetHeight >= $("#player").height() && t.offsetWidth >= $("#player").width();
  5564. e !== p && ((p = e) ? (t.classList.add("closeByFooter"),
  5565. c.classList.add("closeByFooter")) : (t.classList.remove("closeByFooter"),
  5566. c.classList.remove("closeByFooter")))
  5567. }
  5568. e ? setTimeout(i, r.guiAnimationSpeed) : i()
  5569. }
  5570. var r = e("../../settings")
  5571. , o = (e("../../tag/Media/MediaEvent"),
  5572. e("../../util/browser"))
  5573. , a = e("../../util/common")
  5574. , s = e("./ModalCloserEvent")
  5575. , l = e("events").EventEmitter
  5576. , c = document.getElementsByClassName("footer")[0]
  5577. , h = c.querySelectorAll(".close")[0]
  5578. , u = null
  5579. , d = null
  5580. , p = null
  5581. , f = (o.isMobile(),
  5582. {
  5583. open: function(e) {
  5584. e && (n(e),
  5585. u && h.removeEventListener("click", u, !0),
  5586. u = function(e, t) {
  5587. t && (t.stopPropagation(),
  5588. t.preventDefault()),
  5589. e && this.emit(s.CLOSE, e),
  5590. f.reset()
  5591. }
  5592. .bind(this, e.id),
  5593. h.addEventListener("click", u, !0),
  5594. d && window.removeEventListener("resize", d, !0),
  5595. d = n.bind(this, e),
  5596. window.addEventListener("resize", d, !0))
  5597. },
  5598. reset: function() {
  5599. c.classList.remove("closeByFooter"),
  5600. h.removeEventListener("click", u, !0),
  5601. window.removeEventListener("resize", d, !0),
  5602. u = d = p = null
  5603. }
  5604. });
  5605. a.extendObject(f, l.prototype),
  5606. t.exports = f
  5607. }
  5608. , {
  5609. "../../tag/Media/MediaEvent": 131,
  5610. "../../settings": 166,
  5611. "../../util/browser": 182,
  5612. "../../util/common": 185,
  5613. "./ModalCloserEvent": 61,
  5614. events: 202
  5615. }],
  5616. 63: [function(e, t, i) {
  5617. "use strict";
  5618. var A = e("../lib/dat.gui")
  5619. , C = e("three")
  5620. , I = e("../util/easing")
  5621. , E = e("../enum/Viewmode")
  5622. , _ = e("../enum/Colors")
  5623. , b = e("../enum/WarpStyle")
  5624. , w = e("../settings");
  5625. e("../tag/tag"),
  5626. A.GUI.prototype.removeFolder = function(e) {
  5627. var t = this.__folders[e];
  5628. t && (t.close(),
  5629. this.__ul.removeChild(t.domElement.parentNode),
  5630. delete this.__folders[e],
  5631. this.onResize())
  5632. }
  5633. ,
  5634. t.exports.toggle = function(t, e, i) {
  5635. var n = new A.GUI({
  5636. width: 400
  5637. })
  5638. , r = n.addFolder("Flydown from Dollhouse");
  5639. r.add(w.flydown, "movementEasing", Object.keys(I)),
  5640. r.add(w.flydown, "movementDelay", 0, 1).step(.01),
  5641. r.add(w.flydown, "rotationEasing", Object.keys(I)),
  5642. r.add(w.flydown, "rotationDelay", 0, 1).step(.01),
  5643. r.add(w.flydown, "modelTextureDelay", 0, 1).step(.01),
  5644. r.add(w.flydown, "skyboxDelay", 0, 1).step(.01),
  5645. r.add(w.dollhouseDefault, "minPolarAngle", 0, C.Math.degToRad(50)),
  5646. r.add(w.dollhouseDefault, "maxPolarAngle", C.Math.degToRad(50), C.Math.degToRad(170));
  5647. var o = n.addFolder("Transition between panos");
  5648. o.add(w.transition, "blur", 0, 10).onFinishChange(function() {}),
  5649. o.add(w.transition, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  5650. w.transition.flyTime = 0,
  5651. o.__controllers.forEach(function(e) {
  5652. e.updateDisplay()
  5653. })
  5654. }),
  5655. o.add(w.transition, "flyTime", 0, 5e3).onFinishChange(function() {
  5656. w.transition.flySpeed = 0,
  5657. o.__controllers.forEach(function(e) {
  5658. e.updateDisplay()
  5659. })
  5660. }),
  5661. o.add(w.transition, "aimTime", 500, 2500).step(50),
  5662. o.add(w.transition, "aimSlowFactor", 1, 3).step(.1),
  5663. o.add(w.transition, "movementEasing", Object.keys(I));
  5664. var a = n.addFolder("Path Display");
  5665. a.add(w.path, "opacity", 0, 1).step(.01).onFinishChange(function() {}),
  5666. a.add(w.path, "height", 0, .2).step(.01).onFinishChange(function() {}),
  5667. a.add(w.path, "outsideHeight", 0, 2).step(.01).onFinishChange(function() {}),
  5668. a.add(w.path, "ribbonWidth", .01, .35).step(.01).onFinishChange(function() {}),
  5669. a.add(w.path, "waypointRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5670. a.add(w.path, "waypointPulse", 0, 3600).step(20).onFinishChange(function() {}),
  5671. a.add(w.path, "waypointIndoorRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5672. a.add(w.path, "fadeInTime", 0, 1200).step(10).onFinishChange(function() {}),
  5673. a.add(w.path, "fadeOutTime", 0, 1200).step(10).onFinishChange(function() {}),
  5674. a.add(w.path, "color", Object.keys(_)).onFinishChange(function() {
  5675. w.path.color = _[w.path.color],
  5676. w.path.colorUp = _._desat(w.path.color),
  5677. w.path.colorDown = _.darken(w.path.color)
  5678. }),
  5679. a.add(w, "reticuleColor", Object.keys(_)).onFinishChange(function() {
  5680. w.reticuleColor = _[w.reticuleColor]
  5681. });
  5682. var s = n.addFolder("Warping")
  5683. , l = s.addFolder("Warp/Teleport");
  5684. l.add(w.warp, "softPushDist", 0, 2).onFinishChange(function() {}),
  5685. l.add(w.warp, "softPushEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5686. l.add(w.warp, "softBendAngle", 0, 45).onFinishChange(function() {}),
  5687. l.add(w.warp, "softBendTilt", 0, 45).onFinishChange(function() {}),
  5688. l.add(w.warp, "softBendEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5689. l.add(w.warp, "burnsAngle", 0, 30).onFinishChange(function() {}),
  5690. l.add(w.warp, "minBurnsAngle", 0, 10).onFinishChange(function() {}),
  5691. l.add(w.warp, "brakeStrength", 1, 8).onFinishChange(function() {}),
  5692. l.add(w.warp, "minBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  5693. l.add(w.warp, "maxBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  5694. l.add(w.path, "mapGuides").onFinishChange(function() {}),
  5695. l.add(w.warp, "teleportTime", 0, 5e3).step(10).onFinishChange(function() {}),
  5696. l.add(w.warp, "outsideTime", 0, 5e3).step(10).onFinishChange(function() {}),
  5697. l.add(w.path, "typ", Object.keys(b)).onFinishChange(function() {
  5698. w.path.typ = b[w.path.typ]
  5699. }),
  5700. l.add(w.warp, "loop").onChange(function() {}).onFinishChange(function() {
  5701. e.endlessLoop = w.warp.loop
  5702. }),
  5703. l.add(w.warp, "walkSlideShowThreshhold", 1, 1e4).step(1).onFinishChange(function() {}),
  5704. l.add(w.warp, "walkExtraPanosDistance", 0, 3).step(.1).onFinishChange(function() {}),
  5705. l.add(w.transition, "fastForwardFactor", 1, 10).step(1).onFinishChange(function() {});
  5706. var c = s.addFolder("Long Warp Only");
  5707. c.add(w.warp, "minWarpTime", 0, 5e3).step(10).onFinishChange(function() {
  5708. w.warp.flySpeed = 0,
  5709. c.__controllers.forEach(function(e) {
  5710. e.updateDisplay()
  5711. })
  5712. }),
  5713. c.add(w.warp, "timePerMeter", 0, 5e3).step(10).onFinishChange(function() {}),
  5714. c.add(w.warp, "lookAheadMax", .01, 1).step(.01).onFinishChange(function() {}),
  5715. c.add(w.warp, "lookAheadDist", .01, 4).step(.01).onFinishChange(function() {}),
  5716. c.add(w.warp, "maxTurnPerSec", 0, 720).step(1).onFinishChange(function() {}),
  5717. c.add(w.warp, "maxAimPerSec", 0, 720).step(1).onFinishChange(function() {}),
  5718. c.add(w.warp, "turnFriction", 0, 1).step(.01).onFinishChange(function() {}),
  5719. c.add(w.warp, "walkDelay", 0, 2e3).step(10).onFinishChange(function() {}),
  5720. c.add(w.transition, "flytimeMaxDistanceThreshold", 0, 25).step(10).onFinishChange(function() {}),
  5721. c.add(w.warp, "walkMaxDist", 0, 100).step(1).onFinishChange(function() {});
  5722. var h = n.addFolder("Warp Esoterica");
  5723. h.add(w.warp, "nearPanoDist", .01, 12).step(0).onFinishChange(function() {}),
  5724. h.add(w.warp, "blur", .01, 1).onFinishChange(function() {}),
  5725. h.add(w.warp, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  5726. w.warp.minWarpTime = 0,
  5727. h.__controllers.forEach(function(e) {
  5728. e.updateDisplay()
  5729. })
  5730. }),
  5731. h.add(w.warp, "showBunny").onFinishChange(function() {}),
  5732. h.add(w.warp, "fastTime", 0, 2500).step(10).onFinishChange(function() {}),
  5733. h.add(w.warp, "movementEasing", Object.keys(I));
  5734. var u = n.addFolder("Misc");
  5735. u.add(w, "dollhouseFOV", 10, 180).onChange(function() {
  5736. i.cameras[E.DOLLHOUSE].fov = w.dollhouseFOV
  5737. }),
  5738. u.add(w, "insideFOV", 10, 180).onChange(function() {
  5739. i.cameras[E.PANORAMA].fov = w.insideFOV
  5740. }),
  5741. u.add(w, "insideLookSpeed", .01, .3).step(.01).onChange(function() {}),
  5742. u.add(w, "rotationAccelerationInside", .1, 10).step(.1).onChange(function() {}),
  5743. u.add(w, "rotationAccelerationOutside", .1, 10).step(.1).onChange(function() {});
  5744. var d = n.addFolder("Navigation");
  5745. d.add(w.navigation, "panoScores").onFinishChange(function() {
  5746. w.navigation.panoScores || t.panos.forEach(function(e) {
  5747. e.floor.remove(e.text3d),
  5748. e.text3d = null
  5749. })
  5750. }),
  5751. d.add(w.navigation, "mouseDirection"),
  5752. d.add(w.navigation, "filterStrictness", 0, 1),
  5753. d.add(w.navigation, "angleFactor", -60, 0),
  5754. d.add(w.navigation, "directionFactor", 1, 20),
  5755. d.add(w.navigation, "distanceFactor", -5, 5),
  5756. d.add(w.navigation, "optionalityFactor", .1, 10);
  5757. var p = n.addFolder("tags")
  5758. , f = p.addFolder("Tag Creation");
  5759. f.add(w.tags.pole, "enabled").name("poleEnabled"),
  5760. f.add(w.tags.pole, "height", 0, 2.5).step(.01).name("poleHeight"),
  5761. f.add(w.tags.pole, "width", 1, 10).step(1).name("poleWidth"),
  5762. f.add(w.tags.pole, "opacity", .1, 1).step(.1).name("poleOpacity");
  5763. var g = p.addFolder("Visibility");
  5764. g.add(w.tags.visibility, "anyDistance"),
  5765. g.add(w.tags.visibility, "visibleDistance", .1, 30).step(.1),
  5766. g.add(w.tags.visibility, "cameraClearance", 0, 1).step(.01),
  5767. g.add(w.tags.visibility, "hideViaFloor"),
  5768. g.add(w.tags.visibility, "hideOffScreenDisc").name("hideEdgeDisc"),
  5769. g.add(w.tags.visibility, "hideOffScreenObject").name("hideEdgeObject");
  5770. var m = p.addFolder("Disc Parameters");
  5771. m.add(w.tags.disc.scale, "nearBound", .1, 10).step(.1),
  5772. m.add(w.tags.disc.scale, "farBound", .1, 20).step(.1).listen(),
  5773. m.add(w.tags.disc.scale, "linkFarBound").onChange(function(e) {
  5774. e && (w.tags.disc.scale.farBound = w.tags.visibility.visibleDistance * (1 - w.tags.disc.scale.linkPercent / 100))
  5775. }),
  5776. m.add(w.tags.disc.scale, "linkPercent", 0, 100).step(1).onChange(function(e) {
  5777. w.tags.disc.scale.linkFarBound && (w.tags.disc.scale.farBound = w.tags.visibility.visibleDistance * (1 - e / 100))
  5778. }),
  5779. m.add(w.tags.disc.scale, "maxSize", 40, 200).step(1),
  5780. m.add(w.tags.disc.scale, "minSize", 20, 100).step(1),
  5781. m.add(w.tags.disc.scale, "responsiveness", 0, 100).step(1);
  5782. var v = p.addFolder("Navigate");
  5783. v.add(w.tags.navigate, "nearestPano").name("nearestPano"),
  5784. v.add(w.tags.navigate, "lineOfSight").name("lineOfSight"),
  5785. v.add(w.tags.navigate, "reactivate").name("reactivate"),
  5786. v.add(w.tags.navigate, "aimAt", ["disc", "object", "pole", "nothing"]).name("aim at"),
  5787. v.add(w.tags.navigate, "tiltTolerance", 0, 50).step(1),
  5788. v.add(w.tags.navigate, "rotateSpeedFactor", 0, 5).step(.1);
  5789. var y = n.addFolder("Debug");
  5790. y.add(w, "wireframe").onFinishChange(function() {
  5791. t.chunks.forEach(function(e) {
  5792. e.material && (e.wireframeTwin || (e.wireframeTwin = new C.WireframeHelper(e),
  5793. e.wireframeTwin.material.depthWrite = !1,
  5794. e.wireframeTwin.material.depthTest = !1,
  5795. e.wireframeTwin.material.opacity = .5,
  5796. e.wireframeTwin.material.transparent = !0),
  5797. w.wireframe ? t.add(e.wireframeTwin) : t.remove(e.wireframeTwin))
  5798. })
  5799. }),
  5800. y.add(w, "skyboxWireframe").onFinishChange(function() {
  5801. w.skyboxWireframe ? (t.skybox.wireframe = new C.WireframeHelper(t.skybox),
  5802. t.add(t.skybox.wireframe)) : (t.remove(t.skybox.wireframe),
  5803. t.skybox.wireframe = null)
  5804. }),
  5805. y.add(w, "showSweeps").onFinishChange(function() {
  5806. t.setSweepVisibility(w.showSweeps)
  5807. }),
  5808. y.add(w, "showMesh").onFinishChange(function() {
  5809. t.chunks.forEach(function(e) {
  5810. e.visible = w.showMesh
  5811. })
  5812. }),
  5813. y.add(w, "showFloors").onFinishChange(function() {
  5814. t.floors.forEach(function(e) {
  5815. e.collider.children.forEach(function(e) {
  5816. e.material.visible = w.showFloors
  5817. })
  5818. })
  5819. }),
  5820. y.add(w, "showSkyboxes").onFinishChange(function() {
  5821. t.panos.forEach(function(e) {
  5822. e.skyboxMesh.visible = w.showSkyboxes
  5823. })
  5824. }),
  5825. y.add(w, "showNeighbors").onChange(function() {}),
  5826. y.add(t, "alpha", 0, 1)
  5827. }
  5828. }
  5829. , {
  5830. "../enum/Colors": 19,
  5831. "../enum/Viewmode": 51,
  5832. "../enum/WarpStyle": 52,
  5833. "../lib/dat.gui": 93,
  5834. "../tag/tag": 123,
  5835. "../settings": 166,
  5836. "../util/easing": 186,
  5837. three: 217
  5838. }],
  5839. 64: [function(c, h, e) {
  5840. (function(e) {
  5841. "use strict";
  5842. function i(e, t, i, n) {
  5843. $(".gui-error .error-problem-text").text(e),
  5844. $(".gui-error .error-solution-text").text(t),
  5845. $(".gui-error .error-explanation").text(i),
  5846. $(".gui-error .error-actions").html(n),
  5847. $(window).resize(),
  5848. $(".gui-error").fadeIn(),
  5849. $("#bottom-logo").fadeIn()
  5850. }
  5851. function n(e) {
  5852. 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("");
  5853. i(e, s.ERROR_BROWSER_SOLUTION, s.ERROR_BROWSER_EXPLANATION, t),
  5854. r.isMobile() || $("[rel=tiletip]").tooltip({
  5855. placement: "bottom",
  5856. delay: {
  5857. show: 50,
  5858. hide: 0
  5859. },
  5860. trigger: "hover",
  5861. viewport: {
  5862. selector: "body",
  5863. padding: 10
  5864. }
  5865. })
  5866. }
  5867. function t() {
  5868. var e = r.isMobile() ? "" : '<span class="link install-browser">' + s.ERROR_GENERIC_ACTIONS_2 + "</span>" + s.ERROR_GENERIC_ACTIONS_3
  5869. , t = [s.ERROR_GENERIC_ACTIONS_1, e].join("");
  5870. i(s.ERROR_GENERIC_PROBLEM, s.ERROR_GENERIC_SOLUTION, "", t),
  5871. r.isMobile() || $(".install-browser").on("click touchstart", function(e) {
  5872. e.preventDefault(),
  5873. e.stopPropagation(),
  5874. n(" ")
  5875. })
  5876. }
  5877. var r = c("./../util/browser")
  5878. , o = c("./../analytics")
  5879. , a = c("./../settings")
  5880. , s = c("../localization/localize")
  5881. , l = new (c("./../util/logger"))(e);
  5882. h.exports.error = function(e) {
  5883. if ($("head title").text(a.pageTitle),
  5884. $("#gui-message, #gui-loading, #nprogress, #gui-thumb, #bottom-logo").hide(),
  5885. $("#gui-loading").fadeOut(250),
  5886. $("#quick-blackout").hide(),
  5887. o.track("showcase_error", {
  5888. error_key: e
  5889. }),
  5890. s.locale || s.init(),
  5891. "webgl-unsupported" === e)
  5892. r.isMobile() ? t() : n(s.ERROR_WEBGL_UNSUPPORTED_PROBLEM);
  5893. else if ("webgl-ios" === e)
  5894. 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>.");
  5895. else if ("webgl-safari" === e)
  5896. 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>.");
  5897. else if ("webgl-generic" === e)
  5898. t();
  5899. else if ("missing-urls" === e)
  5900. i(s.ERROR_MISSING_URLS_PROBLEM, "", s.ERROR_MISSING_URLS_EXPLANATION);
  5901. else if ("loading-failed" === e)
  5902. 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>.");
  5903. else {
  5904. if ("loading-failed-maintenance" !== e)
  5905. return void l.error("Unhandled error: " + e);
  5906. i(s.ERROR_MAINTENANCE_PROBLEM, s.ERROR_MAINTENANCE_SOLUTION)
  5907. }
  5908. }
  5909. }
  5910. ).call(this, "/js/gui/error.js")
  5911. }
  5912. , {
  5913. "../localization/localize": 108,
  5914. "./../analytics": 4,
  5915. "./../settings": 166,
  5916. "./../util/browser": 182,
  5917. "./../util/logger": 189
  5918. }],
  5919. 65: [function(Oe, Le, e) {
  5920. (function(e) {
  5921. "use strict";
  5922. function c() {
  5923. for (var e in Ce)
  5924. if (Ce.hasOwnProperty(e)) {
  5925. var t = Ce[e];
  5926. if (!t.visible)
  5927. for (var i = 0; i < t.elements.length; i++)
  5928. $(t.elements[i]).hide()
  5929. }
  5930. Ce.highlight.visible && $(".pinBottom").addClass("highlightExists"),
  5931. !1 === Ce.tourControls.visible && $("#drawer").addClass("fullWidth"),
  5932. ge = [],
  5933. Ce.floors.visible && ge.push(".gui-floor", ".gui-floor-title"),
  5934. ge.push(".hideTarget", ".pinTop.right")
  5935. }
  5936. function v(e, t) {
  5937. var i = !S.isMobile() && M.zoom.enabled && t.mode === ie.PANORAMA && !e.tourIsPlaying;
  5938. $("#gui-zoomin").toggle(i),
  5939. $("#gui-zoomout").toggle(i)
  5940. }
  5941. function l() {
  5942. n(),
  5943. $(".pinBottom").toggleClass("open"),
  5944. $("#drawer").toggleClass("open"),
  5945. $(".footer").toggleClass("open"),
  5946. $("#drawer").hasClass("open") ? ($("#pullTab .icon").attr("data-original-title", se.CLOSE_HIGHLIGHTS),
  5947. _e("highlights")) : ($("#pullTab .icon").attr("data-original-title", se.OPEN_HIGHLIGHTS),
  5948. O.resetDrawer()),
  5949. setTimeout(function() {
  5950. $("#pullTab").toggleClass("opened")
  5951. }, $("#drawer").hasClass("open") ? 0 : M.highlightAnimationDuration),
  5952. $(".pinBottom").hasClass("open") && t($(".vr-popup")) && $(".vr-popup").is(":visible") && X.dismiss()
  5953. }
  5954. function t(e) {
  5955. var t;
  5956. return "none" !== e.css("display") ? t = e.position().top + e.outerHeight() : (e.attr("style", "visibility: hidden"),
  5957. t = e.position().top + e.outerHeight(),
  5958. e.attr("style", "display: none")),
  5959. $("#player").outerHeight() - 130 < t + 25
  5960. }
  5961. function y(e) {
  5962. "touchstart" === e.type && e.preventDefault(),
  5963. e.stopPropagation()
  5964. }
  5965. function n() {
  5966. w && (w.reload(),
  5967. w.init())
  5968. }
  5969. function r() {
  5970. $("#gui-spinner").stop(!0, !0),
  5971. $("#gui-spinner").fadeOut(1e3),
  5972. !(Ae = !0)
  5973. }
  5974. function A(e, t) {
  5975. var i = e.mode
  5976. , n = t || e.currentPano;
  5977. $("#gui-modes-dollhouse").toggleClass("active", i === ie.DOLLHOUSE),
  5978. $("#gui-modes-floorplan").toggleClass("active", i === ie.FLOORPLAN),
  5979. $("#gui-modes-inside").toggleClass("active", i === ie.PANORAMA),
  5980. i === ie.PANORAMA ? ($("#view-controllers").slideUp(500),
  5981. M.show360Views.enabled && !n.isAligned() ? ($(".gui-floor").addClass("hidden"),
  5982. $("#gui-modes-outside").addClass("desktop-only")) : ($(".gui-floor").removeClass("hidden"),
  5983. $("#gui-modes-outside").removeClass("desktop-only")),
  5984. $("#gui-modes-outside").removeClass("hidden")) : i !== ie.TRANSITIONING && (r(),
  5985. pe = i,
  5986. $("#gui-modes-outside").addClass("hidden"),
  5987. e.model.has360Views && $(".gui-floor").removeClass("hidden"),
  5988. $("#view-controllers").is(":visible") || $("#view-controllers").slideDown(M.guiAnimationSpeed))
  5989. }
  5990. function C(t, i) {
  5991. function e() {
  5992. document.getElementById("vr").classList.remove("hidden"),
  5993. M.vr.allowWebVR ? S.getVRDisplay().then(function(e) {
  5994. S.supportsFullscreen() ? function(e) {
  5995. ue.info(e.displayName + " detected, VR button activates WebVR experience"),
  5996. Q.init(t.data, i, e, x),
  5997. Q.on(J.OPENED, _e.bind(gui, "vr")),
  5998. Q.on(J.SHOW_TERMS, W.show.bind(W))
  5999. }(e) : (ue.warn("Unable to use WebVR when full screen is not supported"),
  6000. $(".improper-embed").toggleClass("hidden", !1),
  6001. n())
  6002. }, function(e) {
  6003. n()
  6004. }) : n()
  6005. }
  6006. function n() {
  6007. var e;
  6008. ue.info("WebVR support not found, VR button activates native app VR modal"),
  6009. X.init(t.data, x),
  6010. X.on(Z.OPENED, (e = document.getElementById("vr-modal"),
  6011. function() {
  6012. _e("vr"),
  6013. V.open(e)
  6014. }
  6015. )),
  6016. X.on(Z.CLOSED, V.reset)
  6017. }
  6018. if (M.vr.enabled && t.supportsVR && !S.valueFromHash("mls", 0))
  6019. switch (M.vr.option) {
  6020. case le.CONTEXTUAL:
  6021. e();
  6022. break;
  6023. case le.ANDROID:
  6024. S.detectAndroid() && e();
  6025. break;
  6026. case le.NONE:
  6027. }
  6028. }
  6029. function h(e, i) {
  6030. for (var n = $(".gui-floor"), t = 0; t < e.floors.length; t++)
  6031. if ("372" !== getQueryVariable("m")) {
  6032. var r = $('<div class="floorChoice" data-index="' + t + '"></div>').text(e.floors.get(t).name);
  6033. $(".gui-floor").find(".container").prepend(r)
  6034. }
  6035. n.find(".container").prepend('<div class="floorChoice darkGlass allFloorBtn" data-index="all" style="display:none">' + se.FLOOR_ALL + "</div>"),
  6036. n.on("click", function(e) {
  6037. y(e),
  6038. _e("floor"),
  6039. n.toggleClass("open")
  6040. }),
  6041. $(".floorChoice").on("click", function(e) {
  6042. y(e);
  6043. var t = $(this).data("index");
  6044. "all" !== t ? (R.updateInteraction(oe.InteractionGui, "floor-control"),
  6045. i.player.gotoFloor(t),
  6046. R.track("showcase_gui", {
  6047. gui_action: "click_floor_select_button",
  6048. interaction_source: "gui"
  6049. })) : (R.updateInteraction(oe.InteractionGui, "floor-control"),
  6050. _e("move"),
  6051. i.allFloors(),
  6052. R.track("showcase_gui", {
  6053. gui_action: "click_toggle_all_floors_button",
  6054. interaction_source: "gui"
  6055. })),
  6056. n.removeClass("open")
  6057. })
  6058. }
  6059. function I(e, t) {
  6060. e && (t === ie.DOLLHOUSE || t === ie.FLOORPLAN ? ($(".allFloorBtn").show(),
  6061. $(".gui-floor-icon").hide(),
  6062. $(".gui-floor-title").show()) : ($(".allFloorBtn").hide(),
  6063. $(".gui-floor-icon").show(),
  6064. $(".gui-floor-title").hide()),
  6065. e.model.allFloorsVisible ? ($(".gui-floor-title").text(se.FLOOR_ALL),
  6066. $(".gui-floor-number").text(se.FLOOR_ALL),
  6067. $(".floorChoice").removeClass("active"),
  6068. $('.floorChoice[data-index="all"]').addClass("active")) : ($(".gui-floor-title").text(e.name),
  6069. $(".gui-floor-number").text(" " + (e.floorIndex + 1)),
  6070. $(".floorChoice").removeClass("active"),
  6071. $(".floorChoice[data-index=" + e.floorIndex + "]").addClass("active")))
  6072. }
  6073. function E() {
  6074. var e = $("#player").width() - 20
  6075. , t = $("#scroller")
  6076. , i = $("#drawer")
  6077. , n = $(".pinBottom");
  6078. $("#player").width() < 488 || $("#player").height() < 488 ? (t.addClass("hidden"),
  6079. i.addClass("noScroll"),
  6080. n.addClass("noScroll")) : e < T != !i.hasClass("noScroll") && (t.toggleClass("hidden"),
  6081. i.toggleClass("noScroll"),
  6082. n.toggleClass("noScroll"))
  6083. }
  6084. function _(e) {
  6085. e.waitQueue.length <= 0 ? r() : ye || function(e) {
  6086. e = e || 0,
  6087. Ae = !1,
  6088. window.setTimeout(function() {
  6089. Ae || (!0,
  6090. $("#gui-spinner").stop(!0, !0).show())
  6091. }
  6092. .bind(this), e)
  6093. }(M.modelComponentLoadSpinnerDelay)
  6094. }
  6095. function b(e, t) {
  6096. for (var i = []; e; )
  6097. i.push(e),
  6098. e = e.parentNode;
  6099. for (; t && -1 === i.indexOf(t); )
  6100. t = t.parentNode;
  6101. return t
  6102. }
  6103. var w, T, o, a, x, i, s, u, d, p, f, g, S = (Oe("three"),
  6104. Oe("../util/ajax"),
  6105. Oe("../util/browser")), M = Oe("../settings"), R = Oe("../analytics"), m = (Oe("../util/transitions"),
  6106. Oe("../util/camera"),
  6107. Oe("../util/logger")), P = (Oe("../objects/Snapshot"),
  6108. 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"),
  6109. Oe("../tag/Media/MediaEvent")), re = (Oe("../enum/PathDiscardMode"),
  6110. Oe("../enum/PathDisplayMode"),
  6111. Oe("../enum/DirectorEvents"),
  6112. Oe("../enum/PlayerEvents")), oe = Oe("../enum/ControlEvents"), ae = Oe("./sharing/ShareEvents"), se = Oe("../localization/localize"), le = (Oe("../enum/Vectors"),
  6113. Oe("../enum/WarpStyle"),
  6114. Oe("../enum/AlignmentType"),
  6115. Oe("../enum/VROption")), ce = Oe("./konami"), he = Oe("../lib/dat.gui"), ue = new m(e), de = (Oe("../util/showcase"),
  6116. Oe("../enum/ZoomEvents")), pe = ie.DOLLHOUSE, fe = 0, ge = [".hideTarget"], me = null, ve = null, ye = !1, Ae = !1, Ce = {
  6117. coBrand: {
  6118. visible: !0,
  6119. elements: [".co-brand", "#loaderCoBrand"]
  6120. },
  6121. help: {
  6122. visible: !0,
  6123. elements: [".nav-help", "#nav-help"]
  6124. },
  6125. tourControls: {
  6126. visible: !0,
  6127. elements: [".next", ".previous", "#play"]
  6128. },
  6129. highlight: {
  6130. visible: !0,
  6131. elements: ["#drawer", "#pullTab"]
  6132. },
  6133. share: {
  6134. visible: !0,
  6135. elements: [".socialButton", "#share"]
  6136. },
  6137. fullScreen: {
  6138. visible: !0,
  6139. elements: ["#gui-fullscreen"]
  6140. },
  6141. floors: {
  6142. visible: !0,
  6143. elements: [".gui-floor"]
  6144. }
  6145. }, Ie = (g = document.getElementById("drawer"),
  6146. function() {
  6147. $("#player").height() < 400 && g.classList.contains("open") && l()
  6148. }
  6149. ), Ee = (f = document.getElementById("meta-info"),
  6150. function() {
  6151. $("#player").height() < 400 && f.classList.contains("expand") && z.toggleMeta(!0)
  6152. }
  6153. ), _e = (i = document.getElementById("meta-info"),
  6154. s = document.getElementById("interaction-modal"),
  6155. u = $("#drawer").eq(0),
  6156. d = $(".gui-floor").eq(0),
  6157. p = $(".vr-popup").eq(0),
  6158. function(e) {
  6159. switch (e) {
  6160. case "info":
  6161. we(),
  6162. Te(),
  6163. Ie(),
  6164. Me(),
  6165. Re(),
  6166. xe(),
  6167. Pe();
  6168. break;
  6169. case "terms":
  6170. be(),
  6171. Te(),
  6172. Se(),
  6173. Me(),
  6174. Re(),
  6175. xe(),
  6176. Pe();
  6177. break;
  6178. case "help":
  6179. be(),
  6180. we(),
  6181. Me(),
  6182. Re(),
  6183. xe(),
  6184. Pe();
  6185. break;
  6186. case "vr":
  6187. be(),
  6188. we(),
  6189. Me(),
  6190. Re(),
  6191. Te(),
  6192. Pe(),
  6193. t(p) && Se();
  6194. break;
  6195. case "highlights":
  6196. Ee(),
  6197. we(),
  6198. Me(),
  6199. Re();
  6200. break;
  6201. case "share":
  6202. be(),
  6203. we(),
  6204. Te(),
  6205. Re(),
  6206. xe(),
  6207. Pe();
  6208. break;
  6209. case "floor":
  6210. we(),
  6211. Me(),
  6212. xe();
  6213. break;
  6214. case "view":
  6215. Re(),
  6216. Me(),
  6217. we(),
  6218. xe();
  6219. break;
  6220. case "tour":
  6221. case "move":
  6222. we(),
  6223. Me(),
  6224. Re(),
  6225. xe();
  6226. break;
  6227. case "resize":
  6228. be(),
  6229. Ie(),
  6230. Re();
  6231. break;
  6232. case "tag":
  6233. we(),
  6234. Te(),
  6235. Me(),
  6236. Re(),
  6237. xe()
  6238. }
  6239. }
  6240. );
  6241. function be() {
  6242. i.classList.contains("expand") && z.toggleMeta(!0)
  6243. }
  6244. function we() {
  6245. W.hide()
  6246. }
  6247. function Te() {
  6248. U.close()
  6249. }
  6250. function xe() {
  6251. X.dismiss()
  6252. }
  6253. function Se() {
  6254. u.hasClass("open") && l()
  6255. }
  6256. function Me() {
  6257. K.hide()
  6258. }
  6259. function Re() {
  6260. d.hasClass("open") && d.removeClass("open")
  6261. }
  6262. function Pe() {
  6263. s.classList.contains("fadeIn") && (s.classList.contains("landing") ? D.dismissModal() : s.classList.contains("tour") && q.dismissModal())
  6264. }
  6265. $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", function(e) {
  6266. $("#gui-fullscreen").toggle(!S.isFullscreen()),
  6267. $("#gui-fullscreen-exit").toggle(!!S.isFullscreen()),
  6268. setTimeout(function() {
  6269. $(".icon:visible").hide().show(0)
  6270. }, 100)
  6271. }),
  6272. $("#gui-fullscreen").find("a").on("click", function(e) {
  6273. y(e),
  6274. S.requestFullscreen($("body")[0]),
  6275. R.track("showcase_gui", {
  6276. gui_action: "click_enter_fullscreen",
  6277. interaction_source: "gui"
  6278. })
  6279. }),
  6280. $("#gui-fullscreen-exit").find("a").on("click", function(e) {
  6281. y(e),
  6282. S.exitFullscreen(),
  6283. R.track("showcase_gui", {
  6284. gui_action: "click_exit_fullscreen",
  6285. interaction_source: "gui"
  6286. })
  6287. }),
  6288. $(window).on("resize", function(e) {
  6289. var t = e.target.innerHeight
  6290. , i = e.target.innerWidth;
  6291. t === o && i === a || (Ce.highlight.visible && E(),
  6292. _e("resize"),
  6293. $(".pinTop.right").removeClass("hideUnderMeta"),
  6294. n(),
  6295. o = t,
  6296. a = i)
  6297. }).resize(),
  6298. S.supportsFullscreen() || $("#gui-fullscreen").hide(),
  6299. $("#pullTab").on("click", function(e) {
  6300. y(e),
  6301. $("#drawer").hasClass("open") ? (R.trackAlways("showcase_gui", {
  6302. gui_action: "hide_highlight_reel"
  6303. }),
  6304. $(this).addClass("open").children("img").attr("src", "images/auto.png")) : (R.trackAlways("showcase_gui", {
  6305. gui_action: "show_highlight_reel"
  6306. }),
  6307. $(this).removeClass("open").children("img").attr("src", "images/auto-suspend.png")),
  6308. l()
  6309. }),
  6310. window.MP_PREFETCHED_MODELDATA.showHotListSta && ($("#hotList").css("display", ""),
  6311. $("#hotList").on("click", function(e) {
  6312. y(e);
  6313. var t = $("#hotListWrap")[0];
  6314. t.classList.contains("hotListActive") ? (t.classList.remove("hotListActive"),
  6315. this.classList.remove("active")) : (t.classList.add("hotListActive"),
  6316. this.classList.add("active"))
  6317. }),
  6318. $("#hotListContent ul").on("mouseover", function(e) {
  6319. y(e);
  6320. var t = e.target
  6321. , i = document.getElementById("hotListWrap");
  6322. if ("SPAN" === t.tagName) {
  6323. var n = t.parentElement.parentElement;
  6324. t.offsetWidth + 116 >= n.clientWidth ? i.style.width = t.offsetWidth + 116 + "px" : i.style.width = ""
  6325. } else if ("LI" === t.tagName) {
  6326. n = t.parentElement;
  6327. t.children[0].offsetWidth + 116 >= n.clientWidth ? i.style.width = t.children[0].offsetWidth + 116 + "px" : i.style.width = ""
  6328. } else
  6329. i.style.width = ""
  6330. }),
  6331. $("#hotListContent ul").on("click", function(e) {
  6332. y(e),
  6333. this.preElem && this.preElem.classList.remove("active"),
  6334. "SPAN" === e.target.tagName ? (e.target.parentElement.classList.add("active"),
  6335. e.target.parentElement.hot && e.target.parentElement.hot.examine(window.player, !0),
  6336. this.preElem = e.target.parentElement) : (e.target.classList.add("active"),
  6337. e.target.hot && e.target.hot.examine(window.player, !0),
  6338. this.preElem = e.target)
  6339. }),
  6340. $("#hotListClose").on("click", function(e) {
  6341. y(e),
  6342. $("#hotListWrap")[0].classList.remove("hotListActive"),
  6343. $("#hotListContent ul .active").removeClass("active"),
  6344. $("#hotList")[0].classList.remove("active")
  6345. })),
  6346. "true" === window.MP_PREFETCHED_MODELDATA.supportsVR && $("#vr").css("display", ""),
  6347. $("#more-menu-button").on("click", function(e) {
  6348. y(e),
  6349. $("#more-menu").toggleClass("open")
  6350. }),
  6351. Le.exports.init = function(s, l, c, e, t, i, n) {
  6352. var r;
  6353. x = n,
  6354. s.outsideAllowed() || $("#gui-modes-outside").addClass("invisible"),
  6355. s.supportedModes[ie.PANORAMA] || $("#gui-modes-inside").addClass("invisible"),
  6356. F.init(),
  6357. D.init(s, i),
  6358. ce.init(s, l, e),
  6359. $(".icon").on("mouseover", function() {
  6360. l.player && l.player.reticule.hide()
  6361. }),
  6362. function(e, t) {
  6363. var i = t.player;
  6364. $("#gui-modes-inside").on("mousedown touchstart", function(e) {
  6365. y(e),
  6366. R.updateInteraction(oe.InteractionGui, "inside-button"),
  6367. R.track("USER", {
  6368. event_type: "showcase_gui",
  6369. gui_action: "click_inside_mode_button"
  6370. }),
  6371. t.changeMode(ie.PANORAMA)
  6372. }),
  6373. $("#gui-modes-outside").find("a").on("click", function(e) {
  6374. y(e),
  6375. R.track("showcase_gui", {
  6376. gui_action: "click_outside_mode_button"
  6377. }),
  6378. t.changeMode(pe)
  6379. }),
  6380. $("#gui-modes-floorplan").on("click", function(e) {
  6381. y(e),
  6382. i.mode !== ie.FLOORPLAN && (R.track("showcase_gui", {
  6383. gui_action: "click_floorplan_mode_button"
  6384. }),
  6385. t.changeMode(ie.FLOORPLAN))
  6386. }),
  6387. $("#gui-modes-dollhouse").on("click", function(e) {
  6388. y(e),
  6389. i.mode !== ie.DOLLHOUSE && (R.track("showcase_gui", {
  6390. gui_action: "click_dollhouse_mode_button"
  6391. }),
  6392. t.changeMode(ie.DOLLHOUSE))
  6393. })
  6394. }(0, l),
  6395. function(e, t) {
  6396. $("#play").on("mousedown touchstart", function(e) {
  6397. y(e),
  6398. _e("tour"),
  6399. q.play(),
  6400. R.trackAlways("showcase_gui", {
  6401. gui_action: "play_highlights"
  6402. })
  6403. }),
  6404. window.startAndPlay = function(e) {
  6405. _e("tour"),
  6406. q.play(),
  6407. R.trackAlways("showcase_gui", {
  6408. gui_action: "play_highlights"
  6409. })
  6410. }
  6411. ,
  6412. $("#pause").on("mousedown touchstart", function(e) {
  6413. y(e),
  6414. q.pause(),
  6415. R.trackAlways("showcase_gui", {
  6416. gui_action: "pause_highlights"
  6417. })
  6418. }),
  6419. $("#gui-zoomin").find("a").on("click", function(e) {
  6420. y(e),
  6421. t.player.zoomInIncrementally()
  6422. }),
  6423. $("#gui-zoomout").find("a").on("click", function(e) {
  6424. y(e),
  6425. t.player.zoomOutIncrementally()
  6426. })
  6427. }(0, l),
  6428. s.data.enable_social_sharing && s.data.is_public && M.share.enabled && (K.init(MP_PREFETCHED_MODELDATA.name/* s.data.name */),
  6429. K.on(ae.OPENED, (r = document.getElementById("share-modal"),
  6430. function() {
  6431. _e("share"),
  6432. V.open(r)
  6433. }
  6434. )),
  6435. K.on(ae.CLOSED, V.reset)),
  6436. //1 < s.heroLocations.length ? function(e, i, t) {
  6437. 0 < s.heroLocations.length ? function(e, i, t) {
  6438. var n = 100 / (fe = e.heroLocations.length) + "%"
  6439. , r = $("#thumb-container")
  6440. , o = $("#progressBar");
  6441. $("#status").find(".totalSteps").text(fe);
  6442. for (var a = 0; a < fe; a++) {
  6443. var s = e.heroLocations[a]
  6444. , l = $('<li class="thumbImg" data-index=""><img src=""></li>');
  6445. var tmp = s.thumbUrl.replace('https://','').replace('http://','')
  6446. if (l.attr("data-index", a),
  6447. //Ce.highlight.visible && l.find("img").attr("src",'https://'+tmp),
  6448. Ce.highlight.visible && l.find("img").attr("src", 'http://'+tmp),// xzw改 导览图片 https在某些服务器打不开
  6449. s.name) {
  6450. var c = $('<div class="overlay"></div>').text(s.name);
  6451. l.prepend(c)
  6452. }
  6453. if (e.has360Views && s.cameraMode === ie.PANORAMA) {
  6454. var h = e.panos.get(s.panoId)
  6455. , 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>';
  6456. l.prepend(u)
  6457. }
  6458. r.append(l),
  6459. o.append('<div class="step" data-idx="' + a + '" style="width:' + n + '"></div>')
  6460. }
  6461. T = 144 * fe,
  6462. 111 * fe,
  6463. $(".thumbImg").on("mouseover", function() {
  6464. !function(e) {
  6465. return e.describe().inTransition
  6466. }(i) && t.showPathToHeroLocation($(this).data("index"))
  6467. }),
  6468. $(".thumbImg").on("mouseout", function() {
  6469. i.clearPath()
  6470. }),
  6471. $(".thumbImg").on("click", function(e) {
  6472. y(e);
  6473. var t = $(this);
  6474. R.updateInteraction(oe.InteractionGui, "thumbnail"),
  6475. R.trackAlways("showcase_gui", {
  6476. gui_action: "click_highlight"
  6477. }),
  6478. i.goToHighlight(t.data("index"))
  6479. }),
  6480. $(".previous").find("a").on("click", function(e) {
  6481. y(e),
  6482. R.trackAlways("showcase_gui", {
  6483. gui_action: "prev_highlight"
  6484. }),
  6485. i.prevHighlight()
  6486. }),
  6487. $(".next").find("a").on("click", function(e) {
  6488. y(e),
  6489. R.trackAlways("showcase_gui", {
  6490. gui_action: "next_highlight"
  6491. }),
  6492. i.nextHighlight()
  6493. }),
  6494. $("#drawer").on("mouseleave", function(t) {
  6495. var i;
  6496. y(t);
  6497. try {
  6498. i = new MouseEvent("mouseup",{
  6499. clientX: t.clientX,
  6500. clientY: t.clientY,
  6501. screenX: t.screenX,
  6502. screenY: t.screenY
  6503. })
  6504. } catch (e) {
  6505. (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)
  6506. }
  6507. document.dispatchEvent(i)
  6508. }),
  6509. (w = new Sly($("#scrollFrame"),{
  6510. horizontal: !0,
  6511. itemNav: "centered",
  6512. smart: !0,
  6513. scrollTrap: !0,
  6514. scrollBy: 1,
  6515. mouseDragging: !0,
  6516. touchDragging: !0,
  6517. speed: 300,
  6518. dragHandle: !0,
  6519. dynamicHandle: !0,
  6520. clickBar: !0,
  6521. scrollBar: $("#scroller"),
  6522. activateOn: null
  6523. }).init()).on("active", function(e, t) {
  6524. t,
  6525. _e("tour"),
  6526. $(".step").removeClass("active"),
  6527. $("#status").find(".curIdx").text(t + 1);
  6528. for (var i = 0; i <= t; i++)
  6529. $("#progressBar").find("[data-idx='" + i + "']").addClass("active")
  6530. }),
  6531. E()
  6532. }(s, l, c) : (Ce.highlight.visible = !1,
  6533. Ce.tourControls.visible = !1),
  6534. z.on(G.OPEN_INFO, _e.bind(this, "info")),
  6535. function() {
  6536. var n;
  6537. document.body.addEventListener("mousedown", function(e) {
  6538. n = 0 === e.button || 1 === e.which ? e.target : null
  6539. }, !0),
  6540. document.body.addEventListener("mouseup", function(t) {
  6541. n !== t.target && (n = b(n, t.target));
  6542. var e = document.getElementById("gui-parent");
  6543. if (b(e, n) !== e && (n = null),
  6544. n) {
  6545. var i;
  6546. try {
  6547. i = new MouseEvent("click",t)
  6548. } catch (e) {
  6549. (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)
  6550. }
  6551. i.syntheticClick = !0,
  6552. n.dispatchEvent(i),
  6553. n = null
  6554. }
  6555. }, !0),
  6556. document.getElementById("gui-parent").addEventListener("click", function(e) {
  6557. e.syntheticClick || (e.stopPropagation(),
  6558. "A" === e.target.nodeName && e.preventDefault())
  6559. }, !0)
  6560. }(),
  6561. A(c),
  6562. C(s, t),
  6563. s.on("floor.changed", I),
  6564. s.on("waiting", function(e) {
  6565. _(e)
  6566. }
  6567. .bind(this, s)),
  6568. s.on("waiting-done", function(e) {
  6569. _(e)
  6570. }
  6571. .bind(this, s)),
  6572. c.on(re.ModeChanged, function(e, t) {
  6573. A(c),
  6574. v(l, c),
  6575. t === ie.PANORAMA && c.currentPano && !c.currentPano.isAligned() && (t = ie.OUTDOOR),
  6576. U.updateMode(t)
  6577. }),
  6578. e.on(oe.Move, _e.bind(this, "move")),
  6579. c.on(re.Ready, function() {
  6580. O.init(e, c, c.tagManager, l),
  6581. c.on(re.ModeChanged, function(e, t) {
  6582. e !== t && $(".vr-popup").is(":visible") && X.dismiss()
  6583. })
  6584. }),
  6585. c.on(re.PanoChosen, function(e, t) {
  6586. A(c, t),
  6587. U.updateMode(t && !t.isAligned() ? ie.OUTDOOR : ie.PANORAMA)
  6588. }),
  6589. V.on(k.CLOSE, function(e) {
  6590. switch (e) {
  6591. case "vr-modal":
  6592. X.dismiss();
  6593. break;
  6594. case "share-modal":
  6595. K.hide();
  6596. break;
  6597. case "terms-modal":
  6598. W.hide()
  6599. }
  6600. });
  6601. 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();
  6602. l.on("update.controls", function() {
  6603. var e, t, i, n = l.describe();
  6604. if (n.tourIsPlaying || c.isWarping() ? (Ce.tourControls.visible && (h.hide(),
  6605. u.show()),
  6606. n.tourInProgress && (d.forEach(function(e) {
  6607. e.classList.add("playing")
  6608. }),
  6609. p.addClass("playing"),
  6610. f.addClass("playing"))) : (Ce.tourControls.visible && (h.show(),
  6611. u.hide()),
  6612. n.tourInProgress || (q.stopTour(),
  6613. d.forEach(function(e) {
  6614. e.classList.remove("playing")
  6615. }),
  6616. p.removeClass("playing"),
  6617. f.removeClass("playing"))),
  6618. null !== n.currentItem) {
  6619. var r, o;
  6620. $("#status").find(".curIdx").text(n.currentItem + 1),
  6621. n.onTheBus ? (r = "active",
  6622. o = "recent") : (o = "active",
  6623. r = "recent");
  6624. var a = null === n.destinationItem || n.currentItem === n.destinationItem;
  6625. for (e = 0; e < s.heroLocations.length; e += 1)
  6626. i = g.eq(e),
  6627. t = m.eq(e),
  6628. i.removeClass(o),
  6629. t.removeClass(o),
  6630. n.onTheBus && e === n.destinationItem ? (i.addClass(r),
  6631. t.addClass(r),
  6632. w.activate(e)) : n.onTheBus && a && e === n.currentItem ? (i.addClass(r),
  6633. t.addClass(r)) : (i.removeClass(r),
  6634. t.removeClass(r))
  6635. } else
  6636. for (e = 0; e < s.heroLocations.length; e += 1)
  6637. i = g.eq(e),
  6638. t = m.eq(e),
  6639. i.removeClass("active recent"),
  6640. t.removeClass("active recent");
  6641. v(l, c)
  6642. }),
  6643. document.addEventListener("keydown", function(e) {
  6644. switch (R.updateInteraction(oe.InteractionKey),
  6645. e.which) {
  6646. case te.ZERO:
  6647. M.debug && s.toggleAlpha();
  6648. break;
  6649. case te.NINE:
  6650. M.debug && B.toggle();
  6651. break;
  6652. case te.ONE:
  6653. c.isInMode(ie.TRANSITIONING) || l.changeMode(ie.PANORAMA);
  6654. break;
  6655. case te.TWO:
  6656. s.outsideAllowed() && !c.isInMode(ie.DOLLHOUSE, ie.TRANSITIONING) && l.changeMode(ie.DOLLHOUSE);
  6657. break;
  6658. case te.THREE:
  6659. s.outsideAllowed() && !c.isInMode(ie.FLOORPLAN, ie.TRANSITIONING) && l.changeMode(ie.FLOORPLAN);
  6660. break;
  6661. case te.FOUR:
  6662. c.isInMode(ie.TRANSITIONING) || l.changeMode(ie.OUTDOOR);
  6663. break;
  6664. case te.SPACE:
  6665. Ce.tourControls.visible && ($("#playHead").hasClass("playing") || _e("tour"));
  6666. break;
  6667. case te.RETURN:
  6668. M.debug && s.toggleExplodeUp();
  6669. break;
  6670. case te.P:
  6671. !function(e) {
  6672. me.gui || (me.gui = function(e) {
  6673. var t = new he.GUI;
  6674. return t.add(M, "showSweeps").name("Show sweeps").onFinishChange(function() {
  6675. e.setSweepVisibility(M.showSweeps)
  6676. }),
  6677. t.add(M, "rotationAccelerationInside", .1, 10).name("Rotation speed").step(.1),
  6678. t.add(M.transition, "flyTime", 0, 5e3).name("Transition time").onFinishChange(function() {
  6679. M.transition.flySpeed = 0,
  6680. t.__controllers.forEach(function(e) {
  6681. e.updateDisplay()
  6682. })
  6683. }),
  6684. t.add(M.path, "opacity", 0, 1).name("Path opacity"),
  6685. $(t.__closeButton).hide(),
  6686. t
  6687. }(me.model)),
  6688. (me.visible = e) ? $(me.gui.domElement).show() : $(me.gui.domElement).hide()
  6689. }(!me.visible);
  6690. break;
  6691. case te.U:
  6692. !function(e) {
  6693. ve.gui || (ve.gui = function(t, i) {
  6694. function e() {
  6695. var e = i.toJSON();
  6696. n.linkToLocation = window.location.protocol + "//" + window.location.host + window.location.pathname + "?m=" + t.sid + "&start=" + ee.serialize(e),
  6697. i.tagManager.activeTag && (n.linkToLocation += "&tag=" + i.tagManager.activeTag.sid)
  6698. }
  6699. var n = {}
  6700. , r = new he.GUI({
  6701. autoPlace: !0,
  6702. width: "60%"
  6703. });
  6704. return e(),
  6705. i.on(re.ViewChanged, e),
  6706. r.add(n, "linkToLocation").name(se.LINK_TO_LOCATION).listen(),
  6707. r.domElement.id = "datLinks",
  6708. [].slice.call(r.domElement.querySelectorAll(".property-name")).forEach(function(e) {
  6709. if (!S.detectSafari()) {
  6710. var t = document.createElement("button");
  6711. t.classList.add("btn-deep-link"),
  6712. t.innerText = se.MENU_COPY,
  6713. e.nextSibling.appendChild(t);
  6714. var n = function() {
  6715. alert(se.LINK_ALERT_COPY),
  6716. t.hide()
  6717. };
  6718. t.addEventListener("click", function(e) {
  6719. try {
  6720. var t = e.target.parentNode.childNodes[0];
  6721. t.select();
  6722. var i = document.execCommand("copy");
  6723. t.blur(),
  6724. i || n()
  6725. } catch (e) {
  6726. n()
  6727. }
  6728. })
  6729. }
  6730. }),
  6731. $(r.__closeButton).hide(),
  6732. r
  6733. }(ve.model, ve.player)),
  6734. (ve.visible = e) ? $(ve.gui.domElement).show() : $(ve.gui.domElement).hide()
  6735. }(!ve.visible);
  6736. break;
  6737. case te.X:
  6738. M.debug && s.toggleExplode();
  6739. break;
  6740. case te.PLUSEQUALS:
  6741. l.player.activatePersistentZooming(!0),
  6742. O.hideUi();
  6743. break;
  6744. case te.DASHUNDERSCORE:
  6745. l.player.activatePersistentZooming(!1),
  6746. O.hideUi();
  6747. break;
  6748. case te.SEVEN:
  6749. ue.info("Zoom level: " + l.player.zoomLevel + ", FOV: " + l.player.zoomFov);
  6750. break;
  6751. case te.EIGHT:
  6752. l.player.decreaseZoomSpeed();
  6753. break;
  6754. case te.NINE:
  6755. l.player.increaseZoomSpeed()
  6756. }
  6757. return c && c.reticule.hide(),
  6758. !0
  6759. }
  6760. .bind(this)),
  6761. document.addEventListener("keyup", function(e) {
  6762. switch (e.which) {
  6763. case te.PLUSEQUALS:
  6764. l.player.deactivatePersistentZooming();
  6765. break;
  6766. case te.DASHUNDERSCORE:
  6767. l.player.deactivatePersistentZooming()
  6768. }
  6769. }
  6770. .bind(this)),
  6771. function(e) {
  6772. me = {
  6773. gui: null,
  6774. visible: !1,
  6775. model: e
  6776. }
  6777. }(s),
  6778. function(e, t) {
  6779. ve = {
  6780. gui: null,
  6781. visible: !1,
  6782. model: e,
  6783. player: t
  6784. }
  6785. }(s, l.player),
  6786. function(e) {
  6787. function t(e, i) {
  6788. $(e).find("a").each(function(e, t) {
  6789. i ? $(t).removeClass("buttonZoomDisabled").addClass("buttonZoomEnabled") : $(t).addClass("buttonZoomDisabled").removeClass("buttonZoomEnabled"),
  6790. t.style.pointerEvents = i ? "auto" : "none"
  6791. })
  6792. }
  6793. e.on(de.ZoomMax, function() {
  6794. t("#gui-zoomin", !1),
  6795. t("#gui-zoomout", !0)
  6796. }),
  6797. e.on(de.ZoomMin, function() {
  6798. t("#gui-zoomin", !0),
  6799. t("#gui-zoomout", !1)
  6800. }),
  6801. e.on(de.ZoomIn, function() {
  6802. t("#gui-zoomout", !0)
  6803. }),
  6804. e.on(de.ZoomOut, function() {
  6805. t("#gui-zoomin", !0)
  6806. }),
  6807. e.zoomLevel >= M.zoom.max ? t("#gui-zoomin", !1) : t("#gui-zoomin", !0),
  6808. e.zoomLevel <= M.zoom.min ? t("#gui-zoomout", !1) : t("#gui-zoomout", !0)
  6809. }(c),
  6810. P.setAutoPlay(s.heroCount()),
  6811. U.init(c, i.mode),
  6812. U.on(H.OPENED, _e.bind(this, "help")),
  6813. W.init(),
  6814. W.on(j.OPENED, (o = document.getElementById("terms-modal"),
  6815. function() {
  6816. _e("terms"),
  6817. V.open(o)
  6818. }
  6819. )),
  6820. W.on(j.CLOSED, V.reset),
  6821. M.quickstart.enabled || D.delayLanding(i.mode).then(D.showMessage.bind(this, c, l, Ce.coBrand.visible)),
  6822. (M.quickstart.enabled || c.model.outsideAllowed()) && O.init(e, c, c.tagManager, l),
  6823. M.profiling.enabled && B.show(),
  6824. q.init(l)
  6825. }
  6826. ,
  6827. Le.exports.startLoading = function(e, t, i, n, r, o) {
  6828. function a() {
  6829. o.setLoadingStartTime(),
  6830. function() {
  6831. function e(e) {
  6832. e.target === t || $.contains(t, e.target) || e.target === i || $.contains(i, e.target) || e.target === n || $.contains(n, e.target)
  6833. }
  6834. $("body").css("touch-action", "none"),
  6835. $("#gui-parent").find("*:not(#tag-billboards)").on("touchmove", function(e) {});
  6836. var t = document.getElementById("terms-text")
  6837. , i = document.getElementById("more-help-wrapper")
  6838. , n = (document.getElementById("navigation-help-wrapper"),
  6839. document.getElementById("help-dialog"),
  6840. document.getElementById("tag-billboards"));
  6841. M.useWheel && (document.body.addEventListener("mousewheel", e, {
  6842. passive: !1
  6843. }),
  6844. document.body.addEventListener("DOMMouseScroll", e)),
  6845. $("#terms-text, #more-help-wrapper, #navigation-help-wrapper").off("touchmove").on("touchmove", function(e) {
  6846. e.stopPropagation()
  6847. })
  6848. }(),
  6849. r ? (D.showMessage(t, i, Ce.coBrand.visible),
  6850. l()) : function(e) {
  6851. L.show(e),
  6852. c()
  6853. }(l)
  6854. }
  6855. var s = $.Deferred()
  6856. , l = s.resolve.bind(s);
  6857. ye = !0,
  6858. _(e);
  6859. e.data.player_options && function(e) {
  6860. Ce.tourControls.visible = true//e.tour_buttons && S.valueFromHash("gt", 1),
  6861. Ce.coBrand.visible = e.presented_by && 1 !== M.specialEdition && M.brand && !S.valueFromHash("mls", !1),
  6862. Ce.highlight.visible = /* e.highlight_reel && */ 1 !== M.specialEdition && M.showHighlights
  6863. }(e.data.player_options),
  6864. 1 === M.specialEdition && $("body").addClass("specialEdition");
  6865. se.localizeGUI();
  6866. !function(i) {
  6867. function e(e, t) {
  6868. return !!i.player_options[e] && i[t || e]
  6869. }
  6870. $(".model-title").text(i.name);
  6871. var t = M.pageTitle;
  6872. 2 !== S.valueFromHash("mls", 0) && i.name && (t = i.name),
  6873. document.title = t,
  6874. S.isMobile() ? $("#gui-fullscreen").css("display", "none") : ($("[rel=tooltip]").tooltip({
  6875. delay: {
  6876. show: 50,
  6877. hide: 0
  6878. },
  6879. trigger: "hover",
  6880. html: !1,
  6881. viewport: {
  6882. selector: "body",
  6883. padding: 10
  6884. }
  6885. }),
  6886. S.inIframe() && document.getElementsByClassName("pinBottom-container")[0].classList.add("embed")),
  6887. z.populate({
  6888. name: e("model_name", "name"),
  6889. coBrand: e("presented_by"),
  6890. description: e("model_summary", "summary") || "暂无内容",
  6891. contactName: e("contact_name"),
  6892. address: e("address"),
  6893. phone: e("contact_phone"),
  6894. formattedPhone: i.formatted_contact_phone,
  6895. email: e("contact_email"),
  6896. url: e("external_url"),
  6897. socialSharing: i.enable_social_sharing && i.is_public
  6898. })
  6899. }(e.data);
  6900. r || $(".quick").addClass("hidden");
  6901. n ? (R.impression(),
  6902. a()) : (o.setWaitingStartTime(),
  6903. N.show(r, a))
  6904. return s
  6905. }
  6906. ,
  6907. Le.exports.endLoading = function(e, t, i) {
  6908. var n = t.player;
  6909. function r() {
  6910. i.dismissExaminedTag(),
  6911. i.disableHovering()
  6912. }
  6913. $("#gui-thumb").fadeOut(2500),
  6914. L.hide(function() {
  6915. ye = !1
  6916. }),
  6917. Y.init(e, i),
  6918. z.finishSetup(Object.keys(e.tags).length),
  6919. i.on(ne.IMAGE_OPENED, _e.bind(this, "tag")),
  6920. X.on(Z.OPENED, r),
  6921. K.on(ae.OPENED, r),
  6922. U.on(H.OPENED, r),
  6923. W.on(j.OPENED, r);
  6924. var o = i.enableHovering.bind(i);
  6925. if (X.on(Z.CLOSED, o),
  6926. K.on(ae.CLOSED, o),
  6927. U.on(H.CLOSED, o),
  6928. W.on(j.CLOSED, o),
  6929. M.labels.enabled && Object.keys(e.labels).length,
  6930. e.floors.length <= 1 || !Ce.floors.visible ? Ce.floors.visible = !1 : (h(e, t),
  6931. I(e.currentFloor, n.mode)),
  6932. "372" === getQueryVariable("m") && (Ce.floors.visible = 1,
  6933. h(e, t)),
  6934. c(),
  6935. v(t, t.player),
  6936. $("#gui").fadeIn(1500),
  6937. Ce.highlight.visible && (2 !== M.startHighlights || e.has360Views) && setTimeout(function() {
  6938. l(),
  6939. (!e.has360Views && 1 !== M.startHighlights || e.has360Views && 0 === M.startHighlights) && setTimeout(l, 2e3)
  6940. }, 2e3),
  6941. !S.isMobile())
  6942. for (var a = ["a", "#title-toggle", ".next-button", ".prev-button", ".gui-floor", ".meta-toggle", ".thumbImg", "logo-button"], s = 0; s < a.length; s++)
  6943. $(a[s]).addClass("hasHover");
  6944. _(e),
  6945. z.setupToggling(),
  6946. window.editHotPanel && editHotPanel(),
  6947. function() {
  6948. var i = $("#pullTab")
  6949. , e = {
  6950. bottom: {
  6951. "border-bottom-left-radius": "10px",
  6952. "border-bottom-right-radius": "10px"
  6953. },
  6954. top: {
  6955. "border-top-left-radius": "10px",
  6956. "border-top-right-radius": "10px"
  6957. }
  6958. }
  6959. , t = {
  6960. bottom: {
  6961. "border-top-right-radius": "10px",
  6962. "border-bottom-right-radius": "10px"
  6963. },
  6964. top: {
  6965. "border-bottom-left-radius": "10px",
  6966. "border-top-left-radius": "10px"
  6967. }
  6968. };
  6969. function n(e, t) {
  6970. $("#gui-modes-map > div:visible:last").css(e),
  6971. i.is(":visible") ? $(".viewContainer > div:visible:first").css(t) : $("#gui-modes-map > div:visible:first").css(t)
  6972. }
  6973. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? n(e.bottom, e.top) : n(t.bottom, t.top);
  6974. (window.MP_PREFETCHED_MODELDATA.model.special || "true" === window.MP_PREFETCHED_MODELDATA.special) && window.specialScene && specialScene.special().afterImplement()
  6975. }(),
  6976. window.EditTools && (window.editTool = new EditTools(n.sceneRenderer))
  6977. }
  6978. ,
  6979. Le.exports.onProgress = function(e) {
  6980. L.progress(e)
  6981. }
  6982. }
  6983. ).call(this, "/js/gui/gui.js")
  6984. }
  6985. , {
  6986. "../analytics": 4,
  6987. "../controls/serializer": 14,
  6988. "../enum/AlignmentType": 17,
  6989. "../enum/BlackoutStyle": 18,
  6990. "../enum/ControlEvents": 21,
  6991. "../enum/DirectorEvents": 23,
  6992. "../enum/Keys": 30,
  6993. "../enum/PathDiscardMode": 38,
  6994. "../enum/PathDisplayMode": 39,
  6995. "../enum/PlayerEvents": 40,
  6996. "../enum/VROption": 47,
  6997. "../enum/Vectors": 50,
  6998. "../enum/Viewmode": 51,
  6999. "../enum/WarpStyle": 52,
  7000. "../enum/ZoomEvents": 53,
  7001. "../lib/dat.gui": 93,
  7002. "../localization/localize": 108,
  7003. "../tag/Media/MediaEvent": 131,
  7004. "../objects/Snapshot": 153,
  7005. "../settings": 166,
  7006. "../util/ajax": 181,
  7007. "../util/browser": 182,
  7008. "../util/camera": 183,
  7009. "../util/logger": 189,
  7010. "../util/showcase": 193,
  7011. "../util/transitions": 195,
  7012. "./closer/ModalCloserEvent": 61,
  7013. "./closer/modalCloser": 62,
  7014. "./help/HelpEvent": 66,
  7015. "./help/help": 67,
  7016. "./helpManager": 68,
  7017. "./immersiveMode": 69,
  7018. "./konami": 70,
  7019. "./landingScreen": 71,
  7020. "./loadingScreen": 72,
  7021. "./memoryUsage": 73,
  7022. "./playButton": 74,
  7023. "./populateModal": 75,
  7024. "./sharing/ShareEvents": 76,
  7025. "./sharing/modal": 77,
  7026. "./terms/TermsEvent": 78,
  7027. "./terms/terms": 79,
  7028. "./title/TitleEvents": 80,
  7029. "./title/tagToggle": 81,
  7030. "./title/titleBar": 82,
  7031. "./tourInteraction": 84,
  7032. "./vr/vrEvent": 85,
  7033. "./vr/vrModal": 87,
  7034. "./webvr/WebVrEvent": 88,
  7035. "./webvr/webVRgui": 89,
  7036. three: 217
  7037. }],
  7038. 66: [function(e, t, i) {
  7039. "use strict";
  7040. t.exports = Object.freeze({
  7041. OPENED: "help.opened",
  7042. CLOSED: "help.closed"
  7043. })
  7044. }
  7045. , {}],
  7046. 67: [function(e, t, i) {
  7047. "use strict";
  7048. function n() {
  7049. p.on("click", function(e) {
  7050. T && T !== a.TRANSITIONING && (0 < window.getComputedStyle(v).getPropertyValue("opacity") && !x ? S.close() : T && T !== a.TRANSITIONING && (x = !0,
  7051. setTimeout(function() {
  7052. x = !1
  7053. }, h.help.modalStayDuration),
  7054. S.emit(l.OPENED),
  7055. f.addClass("open " + T),
  7056. p.addClass("open"),
  7057. o(),
  7058. r(),
  7059. v.style.removeProperty ? v.style.removeProperty("display") : v.style.removeAttribute("display"),
  7060. v.classList.add("fadeIn")))
  7061. }),
  7062. E.on("click", function(e) {
  7063. S.close()
  7064. }),
  7065. C.on("click", function(e) {
  7066. T && T !== a.TRANSITIONING && (o(),
  7067. r())
  7068. }),
  7069. I.on("click", function(e) {
  7070. o(),
  7071. I.addClass("underline-tab"),
  7072. c.fill(b, s.MORE_HELP),
  7073. f.addClass("more-help")
  7074. })
  7075. }
  7076. function r() {
  7077. C.addClass("underline-tab"),
  7078. c.fill(_, s.NAVIGATION, T),
  7079. f.addClass(T)
  7080. }
  7081. function o() {
  7082. f.removeClass("more-help " + a.PANORAMA + " " + a.DOLLHOUSE + " " + a.FLOORPLAN + " " + a.OUTDOOR),
  7083. A.forEach(function(e) {
  7084. e.classList.remove("underline-tab")
  7085. })
  7086. }
  7087. var a = e("../../enum/Viewmode")
  7088. , s = e("../../enum/HelpModalType")
  7089. , l = e("./HelpEvent")
  7090. , c = (e("../helpManager"),
  7091. e("./../populateModal"))
  7092. , h = e("../../settings")
  7093. , u = e("../../util/common")
  7094. , d = e("events").EventEmitter
  7095. , p = $(".footer-help").eq(0)
  7096. , f = $("#help-dialog").eq(0)
  7097. , g = document.querySelector("#quick-logo")
  7098. , m = document.querySelector("#loaderCoBrand")
  7099. , v = document.querySelector("#help-dialog")
  7100. , y = document.querySelector(".footer")
  7101. , A = $(".help-tabs").children().toArray()
  7102. , C = $(".navigation-tab").eq(0)
  7103. , I = $(".more-help-tab").eq(0)
  7104. , E = ($("#interaction-modal").eq(0).find(".interaction").toArray(),
  7105. f.find(".close").eq(0))
  7106. , _ = f.find(".interactions").toArray()
  7107. , b = f.find(".ui-instructions").toArray()
  7108. , w = a.PANORAMA
  7109. , T = a.PANORAMA
  7110. , x = !1
  7111. , S = {
  7112. init: function(e, t) {
  7113. w = T = t,
  7114. [v, m, g, y].forEach(function(e) {
  7115. e.classList.add(c.deviceType)
  7116. }),
  7117. n()
  7118. },
  7119. close: function() {
  7120. if (f.hasClass("open") && (this.emit(l.CLOSED),
  7121. p.removeClass("open"),
  7122. f.removeClass("open"),
  7123. v.classList.contains("fadeIn"))) {
  7124. v.classList.remove("fadeIn");
  7125. var e = T === a.TRANSITIONING ? w : T;
  7126. c.clear(_, s.NAVIGATION, e)
  7127. }
  7128. },
  7129. updateMode: function(e) {
  7130. w = T,
  7131. T = e
  7132. }
  7133. };
  7134. u.extendObject(S, d.prototype),
  7135. t.exports = S
  7136. }
  7137. , {
  7138. "../../enum/HelpModalType": 28,
  7139. "../../enum/Viewmode": 51,
  7140. "../../settings": 166,
  7141. "../../util/common": 185,
  7142. "../helpManager": 68,
  7143. "./../populateModal": 75,
  7144. "./HelpEvent": 66,
  7145. events: 202
  7146. }],
  7147. 68: [function(s, l, e) {
  7148. (function(e) {
  7149. "use strict";
  7150. var t = s("../util/browser")
  7151. , i = s("./../util/logger")
  7152. , n = s("./../settings")
  7153. , r = new i(e)
  7154. , o = function() {
  7155. var t;
  7156. try {
  7157. return t = window.localStorage.getItem("visitCount") || "0",
  7158. t = (parseFloat(t) + 1).toString(),
  7159. window.localStorage.setItem("visitCount", t),
  7160. r.debug("visitCount = " + t),
  7161. t
  7162. } catch (e) {
  7163. t = "1",
  7164. r.debug("couldn't set local storage")
  7165. }
  7166. }()
  7167. , a = !1;
  7168. l.exports = {
  7169. isHelpDisabled: function() {
  7170. return "0" === t.valueFromHash("help", null) || a
  7171. },
  7172. isLargeHelpEnabled: function() {
  7173. return ("1" === o || "1" === t.valueFromHash("help", null)) && !this.isHelpDisabled()
  7174. },
  7175. isSmallHelpEnabled: function() {
  7176. return "2" === t.valueFromHash("help", null) && !this.isHelpDisabled()
  7177. },
  7178. isHelpEnabled: function() {
  7179. return this.isLargeHelpEnabled() || this.isSmallHelpEnabled()
  7180. },
  7181. setAutoPlay: function(e) {
  7182. a = 0 <= n.warp.auto && 1 < e
  7183. }
  7184. }
  7185. }
  7186. ).call(this, "/js/gui/helpManager.js")
  7187. }
  7188. , {
  7189. "../util/browser": 182,
  7190. "./../settings": 166,
  7191. "./../util/logger": 189
  7192. }],
  7193. 69: [function(e, t, i) {
  7194. "use strict";
  7195. function r(e) {
  7196. M || n(e) && C.hasClass("playing") || (clearTimeout(x),
  7197. T = !0,
  7198. h.close(),
  7199. function(e) {
  7200. !n(e) && S ? v.forEach(function(e) {
  7201. e.classList.remove("drawerOpen"),
  7202. e.classList.add("duringTour")
  7203. }) : C.hasClass("open") ? v.forEach(function(e) {
  7204. e.classList.remove("duringTour"),
  7205. e.classList.add("drawerOpen")
  7206. }) : P || R === g.FLOORPLAN || R === g.DOLLHOUSE || v.forEach(function(e) {
  7207. e.classList.add("fadeOut")
  7208. })
  7209. }(e),
  7210. R !== g.DOLLHOUSE && R !== g.FLOORPLAN && (E.hasClass("expand") && !_.hasClass("closed") || l.valueFromHash("title", 1),
  7211. C.hasClass("playing") || (y.forEach(function(e) {
  7212. e.classList.add("detectHover")
  7213. }),
  7214. x = setTimeout(a, c.immersive.timeToShowAgain))))
  7215. }
  7216. function o() {
  7217. C.hasClass("playing") || (clearTimeout(x),
  7218. x = setTimeout(a, c.immersive.timeToShowAgain))
  7219. }
  7220. function a() {
  7221. clearTimeout(x),
  7222. T = !1,
  7223. m.forEach(function(e) {
  7224. e.classList.remove("drawerOpen")
  7225. }),
  7226. S || v.forEach(function(e) {
  7227. e.classList.remove("duringTour")
  7228. }),
  7229. y.forEach(function(e) {
  7230. e.classList.remove("detectHover")
  7231. })
  7232. }
  7233. function s() {
  7234. T ? a() : r(),
  7235. M = !0,
  7236. setTimeout(function() {
  7237. M = !1
  7238. }, c.immersive.uiStayDuration)
  7239. }
  7240. function n(e) {
  7241. return "mouse" === e || "touch" === e || "key" === e || "gui" === e
  7242. }
  7243. var l = e("../util/browser")
  7244. , c = e("../settings")
  7245. , h = e("./help/help")
  7246. , u = e("../enum/tagEvents")
  7247. , d = e("../enum/ControlEvents")
  7248. , p = e("../enum/PlayerEvents")
  7249. , f = e("../enum/DirectorEvents")
  7250. , g = (p = e("../enum/PlayerEvents"),
  7251. e("../enum/Viewmode"))
  7252. , m = $(".pinTop.left, .pinBottom-container, #drawer-container, #drawer, .footer").toArray()
  7253. , v = $(".pinBottom-container, #drawer-container, .footer").toArray()
  7254. , y = $("#hover-bottom, #hover-top").toArray()
  7255. , A = ($("#pullTab").eq(0),
  7256. $("#playHead").eq(0),
  7257. $(".pinBottom-container").eq(0))
  7258. , C = $("#drawer").eq(0)
  7259. , I = $("#drawer-container").eq(0)
  7260. , E = $("#meta-info").eq(0)
  7261. , _ = $(".pinTop.left").eq(0)
  7262. , b = $("#player").eq(0)
  7263. , w = document.getElementById("pullTab")
  7264. , T = !1
  7265. , x = null
  7266. , S = !1
  7267. , M = !1
  7268. , R = null
  7269. , P = !1;
  7270. t.exports.init = function(e, t, i, n) {
  7271. (function(t, i, e, n) {
  7272. [g.PANORAMA, g.DOLLHOUSE, g.FLOORPLAN].forEach(function(e) {
  7273. t.controls[e].on(d.Move, r),
  7274. t.controls[e].on(d.LongTap, s)
  7275. }),
  7276. b.on("mousewheel DOMMouseScroll", r),
  7277. e.on(u.TagActivated, r),
  7278. e.on(u.TagNavigation, r),
  7279. i.on(p.FlyingEnded, o),
  7280. i.on(p.ModeChanging, function(e, t) {
  7281. P = t !== g.PANORAMA && e !== g.PANORAMA
  7282. }),
  7283. i.on(p.ModeChanged, function(e, t) {
  7284. R = i.mode,
  7285. t !== g.TRANSITIONING ? a() : r("modeChange")
  7286. }),
  7287. n.on(f.TourStart, function() {
  7288. S = !0,
  7289. r()
  7290. }),
  7291. n.on(f.TourEnd, function() {
  7292. S = !1,
  7293. a()
  7294. }),
  7295. n.on(f.ActionInterrupted, function() {
  7296. S = !1
  7297. }),
  7298. w.addEventListener("touchend", function() {
  7299. $("#pullTab").hasClass("opened") && !S && a()
  7300. }, !0)
  7301. }
  7302. )(e, t, i, n),
  7303. l.isMobile() ? (y.forEach(function(e) {
  7304. e.classList.add("mobile")
  7305. }),
  7306. A.click(a)) : (y.forEach(function(e) {
  7307. e.addEventListener("mouseleave", function() {
  7308. !b.is(":hover") && y[0].classList.contains("detectHover") && a()
  7309. }, !0)
  7310. }),
  7311. b.mouseleave(function() {
  7312. y[0].classList.contains("detectHover") && a()
  7313. })),
  7314. R = t.mode
  7315. }
  7316. ,
  7317. t.exports.hideUi = r,
  7318. t.exports.resetDrawer = function() {
  7319. I.hasClass("duringTour") || (S = !1,
  7320. r("gui"),
  7321. a())
  7322. }
  7323. }
  7324. , {
  7325. "../enum/ControlEvents": 21,
  7326. "../enum/DirectorEvents": 23,
  7327. "../enum/tagEvents": 32,
  7328. "../enum/PlayerEvents": 40,
  7329. "../enum/Viewmode": 51,
  7330. "../settings": 166,
  7331. "../util/browser": 182,
  7332. "./help/help": 67
  7333. }],
  7334. 70: [function(i, n, e) {
  7335. (function(e) {
  7336. "use strict";
  7337. var t = i("./../util/logger")
  7338. , o = i("./../settings")
  7339. , a = i("./debug")
  7340. , s = i("./../util/common")
  7341. , l = (i("./gui"),
  7342. new t(e));
  7343. o.console && $("body").append('<div id="debug-console"></div>'),
  7344. n.exports.init = function(i, n, r) {
  7345. l.debug("konami has the modelInstance");
  7346. var t = [];
  7347. $(window).on("keydown", function(e) {
  7348. t.push(e.which),
  7349. t.length > o.secretPanelWord.length && t.shift(),
  7350. s.equalLists(t, o.secretPanelWord) && (l.debug("Developer mode active."),
  7351. o.debug = !0)
  7352. }),
  7353. $(window).on("keydown", function e(t) {
  7354. o.debug && 72 === t.which && (i && r ? (a.toggle(i, n, r),
  7355. $(window).off("keydown", e)) : console.warn("sorry we're not ready yet"))
  7356. })
  7357. }
  7358. }
  7359. ).call(this, "/js/gui/konami.js")
  7360. }
  7361. , {
  7362. "./../settings": 166,
  7363. "./../util/common": 185,
  7364. "./../util/logger": 189,
  7365. "./debug": 63,
  7366. "./gui": 65
  7367. }],
  7368. 71: [function(e, t, i) {
  7369. "use strict";
  7370. function r() {
  7371. s.clear(m, l.LANDING[v]),
  7372. g.removeClass("fadeIn")
  7373. }
  7374. var o = e("../settings")
  7375. , a = (e("./help/help"),
  7376. e("./helpManager"))
  7377. , s = e("./populateModal")
  7378. , l = e("../enum/HelpModalType")
  7379. , n = e("../enum/Viewmode")
  7380. , c = e("../enum/DirectorEvents")
  7381. , h = e("../enum/PlayerEvents")
  7382. , u = $("#quick-blackout").eq(0)
  7383. , d = $("#quick-logo").eq(0)
  7384. , p = $(".quick-brand").toArray()
  7385. , f = $("#loaderCoBrand").eq(0)
  7386. , g = $("#interaction-modal").eq(0)
  7387. , m = g.find(".interaction").toArray()
  7388. , v = ($("#model-title, .pinBottom-container, #drawer-container, #drawer, .footer").toArray(),
  7389. "");
  7390. t.exports.delayLanding = function(e) {
  7391. var t = $.Deferred();
  7392. e || t.resolve();
  7393. var i = o.startupFlyinDelay;
  7394. return e === n.PANORAMA && (i += o.dollhouse.transitionTime),
  7395. setTimeout(t.resolve.bind(t), i),
  7396. t
  7397. }
  7398. ,
  7399. t.exports.showMessage = function(e, t, i) {
  7400. var n = 0;
  7401. o.quickstart.enabled && (function(e) {
  7402. /* e && (f.addClass("quick-brand"), //quick-brand样式有问题 会遮住屏幕
  7403. d.before(f),
  7404. p = $(".quick-brand").toArray()), */
  7405. u.addClass("fadeOut")
  7406. /* setTimeout(function() {
  7407. p.forEach(function(e) {
  7408. e.classList.add("fadeIn")
  7409. })
  7410. }, o.quickstart.showTextDelay),
  7411. setTimeout(function() {
  7412. p.forEach(function(e) {
  7413. e.classList.add("fadeOut")
  7414. })
  7415. }, o.quickstart.fadeOutDelay) */
  7416. }(i),
  7417. n = o.quickstart.showTextDelay + o.quickstart.fadeOutDelay),
  7418. function(e, t) {
  7419. setTimeout(function() {
  7420. if (a.isHelpEnabled()) {
  7421. if (t(),
  7422. s.init(),
  7423. g.addClass("fadeIn landing " + s.deviceType),
  7424. a.isSmallHelpEnabled())
  7425. return void g.addClass("small");
  7426. s.fill(m, l.LANDING[v]),
  7427. g.addClass(v)
  7428. }
  7429. }, e);
  7430. var i = {
  7431. pc: ["images/pc_step1.png", "images/pc_step2.png", "images/pc_step3.png"],
  7432. mobile: ["images/phone_step1.png", "images/phone_step2.png", "images/phone_step3.png"]
  7433. }
  7434. , n = $(".nav-icon .icon");
  7435. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) && n.attr("src", i.mobile[0]);
  7436. function r(e) {
  7437. e.on("click", function() {
  7438. var e = null;
  7439. if (e = "plus" == $(this).attr("data-id") ? +n.attr("data-page") + 1 : +n.attr("data-page") - 1,
  7440. i.length < e || e < 1)
  7441. return !1;
  7442. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? n.attr({
  7443. "data-page": e,
  7444. src: i.mobile[e - 1]
  7445. }) : n.attr({
  7446. "data-page": e,
  7447. src: i.pc[e - 1]
  7448. })
  7449. })
  7450. }
  7451. r($(".next-button")),
  7452. r($(".prev-button"))
  7453. }(n, function() {
  7454. e.once(h.Move, r),
  7455. t.once(c.TourStart, r)
  7456. })
  7457. }
  7458. ,
  7459. t.exports.init = function(e, t) {
  7460. v = t.mode === n.PANORAMA && t.pano && !t.pano.isAligned() ? n.OUTDOOR : t.mode
  7461. }
  7462. ,
  7463. t.exports.dismissModal = r
  7464. }
  7465. , {
  7466. "../enum/DirectorEvents": 23,
  7467. "../enum/HelpModalType": 28,
  7468. "../enum/PlayerEvents": 40,
  7469. "../enum/Viewmode": 51,
  7470. "../settings": 166,
  7471. "./help/help": 67,
  7472. "./helpManager": 68,
  7473. "./populateModal": 75
  7474. }],
  7475. 72: [function(e, t, i) {
  7476. "use strict";
  7477. var n = e("./circleLoader").circleLoader;
  7478. t.exports = {
  7479. element: $("#gui-loading"),
  7480. hide: function(e) {
  7481. n.done(),
  7482. this.element.fadeOut(1500, e)
  7483. },
  7484. show: function(e) {
  7485. this.element.fadeIn(500, function() {
  7486. this.element.css("display", "table"),
  7487. e && e()
  7488. }
  7489. .bind(this))
  7490. },
  7491. progress: function(e) {
  7492. n.set(e)
  7493. }
  7494. }
  7495. }
  7496. , {
  7497. "./circleLoader": 60
  7498. }],
  7499. 73: [function(e, t, i) {
  7500. "use strict";
  7501. var n = e("../settings")
  7502. , r = $("#memory-info")
  7503. , o = r.find("#memory-gpu")
  7504. , a = !1;
  7505. t.exports = {
  7506. show: function() {
  7507. n.profiling.enabled && (r.show(),
  7508. a = !0)
  7509. },
  7510. hide: function() {
  7511. r.hide(),
  7512. a = !1
  7513. },
  7514. toggle: function() {
  7515. a ? this.hide() : this.show()
  7516. },
  7517. update: function(e) {
  7518. n.profiling.enabled && o.text(Math.floor(e / 1e6) + "MB")
  7519. }
  7520. }
  7521. }
  7522. , {
  7523. "../settings": 166
  7524. }],
  7525. 74: [function(e, t, i) {
  7526. "use strict";
  7527. e("../util/browser"),
  7528. e("../analytics");
  7529. e("../settings"),
  7530. t.exports = {
  7531. show: function(e, t) {
  7532. $("#gui-message").fadeOut(500, function() {
  7533. t()
  7534. })
  7535. }
  7536. }
  7537. }
  7538. , {
  7539. "../analytics": 4,
  7540. "../settings": 166,
  7541. "../util/browser": 182
  7542. }],
  7543. 75: [function(e, t, i) {
  7544. "use strict";
  7545. function n(e, t, i, n) {
  7546. i ? this.assets[t][i][this.deviceType] : this.assets[t][this.deviceType]
  7547. }
  7548. var r = e("../util/browser")
  7549. , o = e("../localization/localize")
  7550. , a = e("../enum/HelpModalType")
  7551. , s = (e("../enum/HelpModalSize"),
  7552. e("../enum/Viewmode"));
  7553. t.exports = {
  7554. init: function() {
  7555. if (!this.hasInitialized) {
  7556. this.hasInitialized = !0,
  7557. this.deviceType = r.isMobile() ? "mobile" : "desktop",
  7558. this.assets = {},
  7559. this.assets[a.LANDING[s.PANORAMA]] = {
  7560. desktop: {
  7561. left: {
  7562. "top-info": o.ROTATE,
  7563. "big-image": "images/nav_help_mouse_drag_left.png",
  7564. keyboard: "images/nav_help_keyboard_left_right.png"
  7565. },
  7566. middle: {
  7567. "top-info": o.MOVE,
  7568. "big-image": "images/nav_help_mouse_click.png",
  7569. keyboard: "images/nav_help_keyboard_up_down.png"
  7570. },
  7571. right: {
  7572. "top-info": o.ZOOM,
  7573. "big-image": "images/nav_help_mouse_zoom.png",
  7574. keyboard: "images/nav_help_zoom_keys.png"
  7575. }
  7576. },
  7577. mobile: {
  7578. left: {
  7579. "top-info": o.ROTATE,
  7580. "big-image": "images/nav_help_gesture_drag.png"
  7581. },
  7582. middle: {
  7583. "top-info": o.MOVE,
  7584. "big-image": "images/nav_help_gesture_tap.png"
  7585. },
  7586. right: {
  7587. "top-info": o.ZOOM,
  7588. "big-image": "images/nav_help_gesture_pinch.png"
  7589. }
  7590. }
  7591. },
  7592. this.assets[a.LANDING[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.LANDING[s.PANORAMA]])),
  7593. this.assets[a.LANDING[s.DOLLHOUSE]] = {
  7594. desktop: {
  7595. left: {
  7596. "top-info": o.ROTATE,
  7597. "big-image": "images/nav_help_mouse_drag_left.png",
  7598. keyboard: "images/nav_help_keyboard_left_right.png"
  7599. },
  7600. middle: {
  7601. "top-info": o.MOVE,
  7602. "big-image": "images/nav_help_mouse_position_right.png"
  7603. }
  7604. },
  7605. mobile: {
  7606. left: {
  7607. "top-info": o.ROTATE,
  7608. "big-image": "images/nav_help_gesture_drag.png"
  7609. },
  7610. middle: {
  7611. "top-info": o.MOVE,
  7612. "big-image": "images/nav_help_gesture_position_two_finger.png"
  7613. }
  7614. }
  7615. },
  7616. this.assets[a.LANDING[s.FLOORPLAN]] = {
  7617. desktop: {
  7618. left: {
  7619. "top-info": o.MOVE,
  7620. "big-image": "images/nav_help_mouse_position_left.png"
  7621. },
  7622. middle: {
  7623. "top-info": o.ROTATE,
  7624. "big-image": "images/nav_help_mouse_drag_right.png",
  7625. keyboard: "images/nav_help_keyboard_left_right.png"
  7626. }
  7627. },
  7628. mobile: {
  7629. left: {
  7630. "top-info": o.MOVE,
  7631. "big-image": "images/nav_help_gesture_position.png"
  7632. },
  7633. middle: {
  7634. "top-info": o.ROTATE,
  7635. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  7636. }
  7637. }
  7638. };
  7639. var e = {
  7640. "top-info": o.INSIDE,
  7641. "big-image": "images/nav_help_click_inside.png",
  7642. keyboard: "images/nav_help_inside_key.png"
  7643. };
  7644. this.assets[a.LANDING[s.OUTDOOR]].desktop.middle = e,
  7645. this.assets[a.LANDING[s.DOLLHOUSE]].desktop.right = e,
  7646. this.assets[a.LANDING[s.FLOORPLAN]].desktop.right = e;
  7647. var t = {
  7648. "top-info": o.INSIDE,
  7649. "big-image": "images/nav_help_tap_inside.png"
  7650. };
  7651. this.assets[a.LANDING[s.OUTDOOR]].mobile.middle = t,
  7652. this.assets[a.LANDING[s.DOLLHOUSE]].mobile.right = t,
  7653. this.assets[a.LANDING[s.FLOORPLAN]].mobile.right = t,
  7654. this.assets[a.NAVIGATION] = {},
  7655. this.assets[a.NAVIGATION][s.PANORAMA] = {
  7656. desktop: {
  7657. left: {
  7658. "top-info": o.HELP_DESKTOP_PANORAMA_1A,
  7659. "bottom-info": o.HELP_DESKTOP_PANORAMA_1B,
  7660. "big-image": "images/nav_help_mouse_drag_left.png",
  7661. keyboard: "images/nav_help_keyboard_left_right.png"
  7662. },
  7663. middle: {
  7664. "top-info": o.HELP_DESKTOP_PANORAMA_2A,
  7665. "bottom-info": o.HELP_DESKTOP_PANORAMA_2B,
  7666. "big-image": "images/nav_help_mouse_click.png",
  7667. keyboard: "images/nav_help_keyboard_up_down.png"
  7668. },
  7669. right: {
  7670. "top-info": o.HELP_DESKTOP_PANORAMA_3A,
  7671. "bottom-info": o.HELP_DESKTOP_PANORAMA_3B,
  7672. "big-image": "images/nav_help_mouse_zoom.png",
  7673. keyboard: "images/nav_help_zoom_keys.png"
  7674. }
  7675. },
  7676. mobile: {
  7677. left: {
  7678. "top-info": o.HELP_MOBILE_PANORAMA_1,
  7679. "big-image": "images/nav_help_gesture_drag.png"
  7680. },
  7681. middle: {
  7682. "top-info": o.HELP_MOBILE_PANORAMA_2,
  7683. "big-image": "images/nav_help_gesture_tap.png"
  7684. },
  7685. right: {
  7686. "top-info": o.HELP_MOBILE_3,
  7687. "big-image": "images/nav_help_gesture_pinch.png"
  7688. }
  7689. }
  7690. },
  7691. this.assets[a.NAVIGATION][s.DOLLHOUSE] = {
  7692. desktop: {
  7693. left: {
  7694. "top-info": o.HELP_DESKTOP_DOLLHOUSE_1A,
  7695. "bottom-info": o.HELP_DESKTOP_DOLLHOUSE_1B,
  7696. "big-image": "images/nav_help_mouse_drag_left.png",
  7697. keyboard: "images/nav_help_keyboard_all.png"
  7698. },
  7699. middle: {
  7700. "top-info": o.HELP_DESKTOP_DOLLHOUSE_2A,
  7701. "big-image": "images/nav_help_mouse_position_right.png"
  7702. },
  7703. right: {
  7704. "top-info": o.HELP_DESKTOP_DOLLHOUSE_3A,
  7705. "big-image": "images/nav_help_mouse_zoom.png"
  7706. }
  7707. },
  7708. mobile: {
  7709. left: {
  7710. "top-info": o.HELP_MOBILE_DOLLHOUSE_1,
  7711. "big-image": "images/nav_help_gesture_drag.png"
  7712. },
  7713. middle: {
  7714. "top-info": o.HELP_MOBILE_DOLLHOUSE_2,
  7715. "big-image": "images/nav_help_gesture_position_two_finger.png"
  7716. },
  7717. right: {
  7718. "top-info": o.HELP_MOBILE_3,
  7719. "big-image": "images/nav_help_gesture_pinch.png"
  7720. }
  7721. }
  7722. },
  7723. this.assets[a.NAVIGATION][s.FLOORPLAN] = {
  7724. desktop: {
  7725. left: {
  7726. "top-info": o.HELP_DESKTOP_FLOORPLAN_1A,
  7727. "big-image": "images/nav_help_mouse_position_left.png"
  7728. },
  7729. middle: {
  7730. "top-info": o.HELP_DESKTOP_FLOORPLAN_2A,
  7731. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_2B,
  7732. "big-image": "images/nav_help_mouse_drag_right.png",
  7733. keyboard: "images/nav_help_keyboard_left_right.png"
  7734. },
  7735. right: {
  7736. "top-info": o.HELP_DESKTOP_FLOORPLAN_3A,
  7737. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_3B,
  7738. "big-image": "images/nav_help_mouse_zoom.png",
  7739. keyboard: "images/nav_help_keyboard_up_down.png"
  7740. }
  7741. },
  7742. mobile: {
  7743. left: {
  7744. "top-info": o.HELP_MOBILE_FLOORPLAN_1,
  7745. "big-image": "images/nav_help_gesture_position.png"
  7746. },
  7747. middle: {
  7748. "top-info": o.HELP_MOBILE_FLOORPLAN_2,
  7749. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  7750. },
  7751. right: {
  7752. "top-info": o.HELP_MOBILE_3,
  7753. "big-image": "images/nav_help_gesture_pinch.png"
  7754. }
  7755. }
  7756. },
  7757. this.assets[a.NAVIGATION][s.OUTDOOR] = JSON.parse(JSON.stringify(this.assets[a.NAVIGATION][s.PANORAMA])),
  7758. this.assets[a.NAVIGATION][s.OUTDOOR].desktop.middle = {
  7759. "top-info": o.HELP_DESKTOP_360_2A,
  7760. "bottom-info": o.HELP_DESKTOP_360_2B,
  7761. "big-image": "images/nav_help_click_inside.png",
  7762. keyboard: "images/nav_help_inside_key.png"
  7763. },
  7764. this.assets[a.NAVIGATION][s.OUTDOOR].mobile.middle = {
  7765. "top-info": o.HELP_MOBILE_360_2,
  7766. "big-image": "images/nav_help_tap_inside.png"
  7767. },
  7768. this.assets[a.MORE_HELP] = {
  7769. desktop: {
  7770. "more-help-hlr": {
  7771. "top-info": o.HELP_MORE_HLR_A,
  7772. "big-image": "images/nav_help_expand.svg",
  7773. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  7774. },
  7775. "more-help-dollhouse": {
  7776. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  7777. "big-image": "images/nav_help_dollhouse.svg",
  7778. "bottom-info": o.HELP_DESKTOP_MORE_DOLLHOUSE_B
  7779. },
  7780. "more-help-floors": {
  7781. "top-info": o.HELP_MORE_FLOORS_A,
  7782. "big-image": "images/nav_help_floor picker.svg",
  7783. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  7784. },
  7785. "more-help-tag": {
  7786. "top-info": o.HELP_MORE_TAG_A,
  7787. "big-image": "images/nav_help_tag.svg",
  7788. "bottom-info": o.HELP_DESKTOP_MORE_TAG_B
  7789. },
  7790. "more-help-zoom": {
  7791. "top-info": o.HELP_MORE_ZOOM_A,
  7792. "big-image": "images/nav_help_zoom.svg",
  7793. "bottom-info": o.HELP_DESKTOP_MORE_ZOOM_B
  7794. },
  7795. "more-help-tour": {
  7796. "top-info": o.HELP_MORE_TOUR_A,
  7797. "big-image": "images/nav_help_play.png",
  7798. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  7799. },
  7800. "more-help-inside": {
  7801. "top-info": o.HELP_MORE_INSIDE_A,
  7802. "big-image": "images/nav_help_inside.svg",
  7803. "bottom-info": o.HELP_DESKTOP_MORE_INSIDE_B
  7804. },
  7805. "more-help-vr": {
  7806. "top-info": o.HELP_MORE_VR_A,
  7807. "big-image": "images/nav_help_vr.svg",
  7808. "bottom-info": o.HELP_DESKTOP_MORE_VR_B
  7809. },
  7810. "more-help-360": {
  7811. "top-info": o.HELP_MORE_360_A,
  7812. "big-image": "images/nav_help_360.svg",
  7813. "bottom-info": o.HELP_DESKTOP_MORE_360_B
  7814. },
  7815. "more-help-fullscreen": {
  7816. "top-info": o.HELP_MORE_FULLSCREEN_A,
  7817. "big-image": "images/nav_help_fullscreen.svg",
  7818. "bottom-info": o.HELP_DESKTOP_MORE_FULLSCREEN_B
  7819. }
  7820. },
  7821. mobile: {
  7822. "more-help-hlr": {
  7823. "top-info": o.HELP_MORE_HLR_A,
  7824. "big-image": "images/nav_help_expand.svg",
  7825. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  7826. },
  7827. "more-help-dollhouse": {
  7828. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  7829. "big-image": "images/nav_help_dollhouse.svg",
  7830. "bottom-info": o.HELP_MOBILE_MORE_DOLLHOUSE_B
  7831. },
  7832. "more-help-floors": {
  7833. "top-info": o.HELP_MORE_FLOORS_A,
  7834. "big-image": "images/nav_help_floor picker.svg",
  7835. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  7836. },
  7837. "more-help-tag": {
  7838. "top-info": o.HELP_MORE_TAG_A,
  7839. "big-image": "images/nav_help_tag.svg",
  7840. "bottom-info": o.HELP_MOBILE_MORE_TAG_B
  7841. },
  7842. "more-help-tour": {
  7843. "top-info": o.HELP_MORE_TOUR_A,
  7844. "big-image": "images/nav_help_play.png",
  7845. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  7846. },
  7847. "more-help-inside": {
  7848. "top-info": o.HELP_MORE_INSIDE_A,
  7849. "big-image": "images/nav_help_inside.svg",
  7850. "bottom-info": o.HELP_MOBILE_MORE_INSIDE_B
  7851. },
  7852. "more-help-vr": {
  7853. "top-info": o.HELP_MORE_VR_A,
  7854. "big-image": "images/webvr.svg",
  7855. "bottom-info": o.HELP_MOBILE_MORE_VR_B
  7856. },
  7857. "more-help-360": {
  7858. "top-info": o.HELP_MORE_360_A,
  7859. "big-image": "images/nav_help_360.svg",
  7860. "bottom-info": o.HELP_MOBILE_MORE_360_B
  7861. }
  7862. }
  7863. },
  7864. this.assets[a.TOUR_INTERACTION[s.PANORAMA]] = {
  7865. desktop: {
  7866. left: {
  7867. "top-info": o.ROTATE,
  7868. "big-image": "images/nav_help_mouse_drag_left.png",
  7869. keyboard: "images/nav_help_keyboard_left_right.png"
  7870. },
  7871. middle: {
  7872. "top-info": o.MOVE,
  7873. "big-image": "images/nav_help_mouse_click.png",
  7874. keyboard: "images/nav_help_keyboard_up_down.png"
  7875. },
  7876. right: {
  7877. "top-info": o.PLAY,
  7878. "big-image": "images/Desktop-help-play-button.svg",
  7879. keyboard: "images/Desktop-help-spacebar-2.svg"
  7880. }
  7881. },
  7882. mobile: {
  7883. left: {
  7884. "top-info": o.ROTATE,
  7885. "big-image": "images/nav_help_gesture_drag.png"
  7886. },
  7887. middle: {
  7888. "top-info": o.MOVE,
  7889. "big-image": "images/nav_help_gesture_tap.png"
  7890. },
  7891. right: {
  7892. "top-info": o.PLAY,
  7893. "big-image": "images/mobile-help-play-button.svg"
  7894. }
  7895. }
  7896. },
  7897. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.PANORAMA]])),
  7898. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].desktop.middle = this.assets[a.LANDING[s.OUTDOOR]].desktop.middle,
  7899. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].mobile.middle = this.assets[a.LANDING[s.OUTDOOR]].mobile.middle,
  7900. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.OUTDOOR]])),
  7901. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].desktop.left = this.assets[a.LANDING[s.FLOORPLAN]].desktop.left,
  7902. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].mobile.left = this.assets[a.LANDING[s.FLOORPLAN]].mobile.left
  7903. }
  7904. },
  7905. fill: function(e, t, i) {
  7906. n.call(this, e, t, i, !0)
  7907. },
  7908. clear: function(e, t, i) {
  7909. n.call(this, e, t, i, !1)
  7910. }
  7911. }
  7912. }
  7913. , {
  7914. "../enum/HelpModalSize": 27,
  7915. "../enum/HelpModalType": 28,
  7916. "../enum/Viewmode": 51,
  7917. "../localization/localize": 108,
  7918. "../util/browser": 182
  7919. }],
  7920. 76: [function(e, t, i) {
  7921. "use strict";
  7922. t.exports = Object.freeze({
  7923. OPENED: "share.open",
  7924. CLOSED: "share.closed",
  7925. LINK_CLICKED: "share.linked"
  7926. })
  7927. }
  7928. , {}],
  7929. 77: [function(e, t, i) {
  7930. "use strict";
  7931. function n(n) {
  7932. function e(e, t) {
  7933. var i = "top=" + (window.screenY + ($("#player").height() - t) / 2) + ",left=" + (window.screenX + ($("#player").width() - e) / 2) + ",width=" + e + ",height=" + t;
  7934. I.emit(l.LINK_CLICKED, {
  7935. channel: n
  7936. }),
  7937. window.open(C[n], "shareWindow", i)
  7938. }
  7939. switch (n) {
  7940. case A.FACEBOOK:
  7941. e(580, 420);
  7942. break;
  7943. case A.TWITTER:
  7944. e(550, 440);
  7945. break;
  7946. case A.MAIL:
  7947. I.emit(l.LINK_CLICKED, {
  7948. channel: "email"
  7949. }),
  7950. window.open(C[n], "_blank");
  7951. break;
  7952. case A.LINKEDIN:
  7953. }
  7954. }
  7955. function r(e) {
  7956. I.emit(l.LINK_CLICKED, {
  7957. channel: "copylink"
  7958. });
  7959. var t = document.createRange();
  7960. t.selectNodeContents(v);
  7961. var i = window.getSelection();
  7962. i.removeAllRanges(),
  7963. i.addRange(t),
  7964. document.execCommand("copy"),
  7965. y.classList.remove("hidden"),
  7966. v.classList.add("highlighted")
  7967. }
  7968. function o(e) {
  7969. e && (e.stopPropagation(),
  7970. e.target === v) || (window.getSelection().removeAllRanges(),
  7971. v.classList.remove("highlighted"),
  7972. y.classList.add("hidden"))
  7973. }
  7974. var a = e("../../util/browser")
  7975. , s = e("../../localization/localize")
  7976. , l = e("./ShareEvents")
  7977. , c = e("../../util/common")
  7978. , h = e("events").EventEmitter
  7979. , u = document.getElementById("sharing")
  7980. , d = document.getElementById("share-modal")
  7981. , p = document.getElementById("share-close")
  7982. , f = document.getElementById("facebook-share")
  7983. , g = document.getElementById("twitter-share")
  7984. , m = document.getElementById("mail-share")
  7985. , v = document.getElementById("share-url-text")
  7986. , y = document.getElementById("copy-success")
  7987. , A = Object.freeze({
  7988. FACEBOOK: "facebook",
  7989. TWITTER: "twitter",
  7990. MAIL: "mail",
  7991. LINKEDIN: "linkedin"
  7992. })
  7993. , C = {};
  7994. C[A.FACEBOOK] = "http://www.facebook.com/sharer.php?u=" + encodeURIComponent(window.location.href + "&utm_source=1") + "&t=",
  7995. C[A.TWITTER] = "http://twitter.com/intent/tweet?text=",
  7996. C[A.MAIL] = "mailto:?subject=";
  7997. var I = {
  7998. init: function(e) {
  7999. var t = encodeURIComponent(s.SHARE_EXPLORE + e + " " + s.SHARE_AT + " ");
  8000. C[A.FACEBOOK] += t + encodeURIComponent(window.location.href + "&utm_source=1"),
  8001. C[A.TWITTER] += t + encodeURIComponent(window.location.href + "&utm_source=2 " + s.SHARE_WITH + " #port"),
  8002. C[A.MAIL] += encodeURIComponent(s.SHARE_EXPLORE + e + s.SHARE_3D) + "&body=" + t + encodeURIComponent(window.location.href + "&utm_source=3"),
  8003. u.addEventListener("click", this.toggle.bind(this)),
  8004. p.addEventListener("click", this.hide.bind(this)),
  8005. v.addEventListener("click", r),
  8006. d.addEventListener("click", o),
  8007. f.addEventListener("click", n.bind(this, A.FACEBOOK)),
  8008. g.addEventListener("click", n.bind(this, A.TWITTER)),
  8009. m.addEventListener("click", n.bind(this, A.MAIL)),
  8010. v.textContent = window.location.href + "&utm_source=4",
  8011. d.classList.add(a.isMobile() ? "mobile" : "desktop"),
  8012. u.classList.remove("hidden")
  8013. },
  8014. show: function() {
  8015. this.emit(l.OPENED),
  8016. d.classList.add("fadeIn")
  8017. },
  8018. hide: function() {
  8019. d.classList.contains("fadeIn") && (this.emit(l.CLOSED),
  8020. document.selection && document.selection.empty(),
  8021. window.getSelection().removeAllRanges(),
  8022. o(),
  8023. d.classList.remove("fadeIn"))
  8024. },
  8025. toggle: function() {
  8026. d.classList.contains("fadeIn") ? this.hide() : this.show()
  8027. }
  8028. };
  8029. c.extendObject(I, h.prototype),
  8030. t.exports = I
  8031. }
  8032. , {
  8033. "../../localization/localize": 108,
  8034. "../../util/browser": 182,
  8035. "../../util/common": 185,
  8036. "./ShareEvents": 76,
  8037. events: 202
  8038. }],
  8039. 78: [function(e, t, i) {
  8040. "use strict";
  8041. t.exports = Object.freeze({
  8042. OPENED: "terms.opened",
  8043. CLOSED: "terms.closed"
  8044. })
  8045. }
  8046. , {}],
  8047. 79: [function(e, t, i) {
  8048. "use strict";
  8049. var n = e("./TermsEvent")
  8050. , r = e("../../localization/localize")
  8051. , o = e("../../analytics")
  8052. , a = e("../../util/ajax")
  8053. , s = e("../../util/common")
  8054. , l = e("events").EventEmitter
  8055. , c = document.getElementById("terms-modal")
  8056. , h = {
  8057. init: function() {
  8058. $(".footer-terms").on("click", function(e) {
  8059. e.preventDefault(),
  8060. this.show()
  8061. }
  8062. .bind(this)),
  8063. $("#terms-modal .close").on("click", this.hide.bind(this))
  8064. },
  8065. show: function() {
  8066. this.emit(n.OPENED),
  8067. a.get("static/" + r.TERMS_TEXT_FILE).done(function(e) {
  8068. var t = $("#terms-text").html(e);
  8069. o.track("showcase_gui", {
  8070. gui_action: "click_terms_button",
  8071. interaction_source: "gui"
  8072. }),
  8073. t.find("a").attr("target", "_blank")
  8074. }).fail(function() {
  8075. $("#terms-text").html("<h1>" + r.TERMS_OF_USE + "</h1><p>" + r.TERMS_FAIL)
  8076. }),
  8077. c.classList.add("fadeIn")
  8078. },
  8079. hide: function(e) {
  8080. e && e.preventDefault(),
  8081. c.classList.contains("fadeIn") && this.emit(n.CLOSED),
  8082. c.classList.remove("fadeIn")
  8083. }
  8084. };
  8085. s.extendObject(h, l.prototype),
  8086. t.exports = h
  8087. }
  8088. , {
  8089. "../../analytics": 4,
  8090. "../../localization/localize": 108,
  8091. "../../util/ajax": 181,
  8092. "../../util/common": 185,
  8093. "./TermsEvent": 78,
  8094. events: 202
  8095. }],
  8096. 80: [function(e, t, i) {
  8097. "use strict";
  8098. t.exports = Object.freeze({
  8099. OPEN_INFO: "title.open.info",
  8100. CLOSE_INFO: "title.close.info",
  8101. SHOW_INFO: "title.show.info",
  8102. HIDE_INFO: "title.hide.info",
  8103. LINK_CLICKED: "title.link.click",
  8104. CONTACT_LINK_CLICKED: "title.contact.click",
  8105. ORIGIN_LINK_CLICKED: "title.origin.click"
  8106. })
  8107. }
  8108. , {}],
  8109. 81: [function(e, t, i) {
  8110. "use strict";
  8111. var o = e("../../settings");
  8112. t.exports.init = function(e, t) {
  8113. o.tags.enabled && 0 !== Object.keys(e.tags).length && function(t, i) {
  8114. function e(e) {
  8115. t.shouldShowtags = "show" === this.value,
  8116. t.shouldShowtags ? i.showAlltags(o.tags.startup.fadeInDuration) : i.hideAlltags(o.tags.startup.fadeInDuration)
  8117. }
  8118. document.getElementById("tag-toggles").classList.remove("hidden"),
  8119. document.getElementById("radio-tag-show").checked = !0;
  8120. for (var n = document.getElementById("tag-inputs").querySelectorAll("input"), r = 0; r < n.length; r++)
  8121. n[r].addEventListener("change", e)
  8122. }(e, t)
  8123. }
  8124. }
  8125. , {
  8126. "../../settings": 166
  8127. }],
  8128. 82: [function(S, M, e) {
  8129. (function(e) {
  8130. "use strict";
  8131. function i(e) {
  8132. return !(!e || l.inIframe() && document.referrer === e || (E.classList.remove("hidden"),
  8133. _.innerHTML = r.WEBVR_LEARN_MORE + ": ",
  8134. _.appendChild(function(e) {
  8135. var t = document.createElement("a");
  8136. return t.id = "url",
  8137. t.target = "_blank",
  8138. t.href = e,
  8139. t.innerText = e,
  8140. t.addEventListener("click", x.emit.bind(x, a.ORIGIN_LINK_CLICKED)),
  8141. t
  8142. }(e)),
  8143. b.forEach(function(e) {
  8144. e.classList.add("share-link")
  8145. }),
  8146. 0))
  8147. }
  8148. function s(e, t) {
  8149. var i = e
  8150. , n = t;
  8151. return function(e, t) {
  8152. i.push(t || n, e)
  8153. }
  8154. }
  8155. var l = S("../../util/browser")
  8156. , t = S("../../util/common")
  8157. , n = S("../../util/logger")
  8158. , r = S("../../localization/localize")
  8159. , o = S("./titleBarSettings")
  8160. , c = S("../../settings")
  8161. , a = S("./TitleEvents")
  8162. , h = S("events").EventEmitter
  8163. , u = new n(e)
  8164. , d = document.querySelector(".pinTop.left")
  8165. , p = document.getElementsByClassName("title-container")[0]
  8166. , f = document.getElementById("title-toggle").querySelector("i")
  8167. , g = document.getElementById("meta-info-wrapper")
  8168. , m = document.getElementById("meta-info")
  8169. , v = document.getElementById("meta-description")
  8170. , y = document.getElementsByClassName("contact-info")[0]
  8171. , A = document.getElementById("contact-data")
  8172. , C = document.getElementById("addressTxt")
  8173. , I = document.getElementById("tag-toggles")
  8174. , E = document.getElementById("share-origin")
  8175. , _ = document.getElementById("share-link-wrapper")
  8176. , b = [m, g, p]
  8177. , w = !1
  8178. , T = !1
  8179. , x = {
  8180. populate: function(e) {
  8181. if (function(e, t) {
  8182. return e && l.valueFromHash("title", 1) && 2 !== l.valueFromHash("mls", 0) ? (document.getElementsByClassName("titleText")[0].innerText = e,
  8183. (g_weixinObj.title = e).length > o.minTooltipCharacters && p.parentElement.setAttribute("data-original-title", e),
  8184. t && 1 !== c.specialEdition && c.brand && !c.mls ? document.getElementById("cobrandTitle").innerText = t : (document.getElementsByClassName("co-brand")[0].classList.add("hidden"),
  8185. document.getElementById("gui-name").classList.add("noCoBrand"),
  8186. document.getElementById("cobrandTitle").classList.add("hidden")),
  8187. !0) : (document.getElementById("model-title").classList.add("hidden"),
  8188. !1)
  8189. }(MP_PREFETCHED_MODELDATA.name, e.coBrand)) {
  8190. if (function(e) {
  8191. e ? (w = !0,
  8192. v.innerHTML = e) : v.classList.add("hidden")
  8193. }(e.description),
  8194. function(e, t, i, n) {
  8195. if ((e || t || i) && c.brand && !l.valueFromHash("mls", !1)) {
  8196. w = !0;
  8197. var r = []
  8198. , o = s(r, "<br>");
  8199. if (e && o('<span id="contactName">' + e + "</span>"),
  8200. t) {
  8201. var a = n || t;
  8202. o(l.isMobile() ? '<a id="phone" href="callto:' + t + '">' + a + "</a>" : "<span>" + a + "</span>")
  8203. }
  8204. i && o('<a id="email" href="mailTo:' + i + '">' + i + "</a>"),
  8205. r[0] = "",
  8206. A.innerHTML = r.join("")
  8207. } else
  8208. y.classList.add("hidden")
  8209. }(e.contactName, e.phone, e.email, e.formatted_contact_phone),
  8210. function(e) {
  8211. if ("string" == typeof e)
  8212. try {
  8213. e = JSON.parse(e)
  8214. } catch (e) {
  8215. return u.warn("Unable to parse address data"),
  8216. C.parentElement.classList.add("hidden")
  8217. }
  8218. if (e && (e.address_1 || e.address_2 || e.city || e.state || e.zip)) {
  8219. w = !0;
  8220. var t = []
  8221. , i = s(t, " ");
  8222. e.address_1 && i(e.address_1),
  8223. e.address_2 && i(e.address_2),
  8224. e.city && i(e.city, ", "),
  8225. e.state && i(e.state, ", "),
  8226. e.zip && i(e.zip, e.state ? " " : ", "),
  8227. t[0] = "",
  8228. C.innerText = t.join("")
  8229. } else
  8230. C.parentElement.classList.add("hidden")
  8231. }(e.address),
  8232. w) {
  8233. var t = document.createElement("br");
  8234. I.insertBefore(t, I.firstElementChild)
  8235. }
  8236. e.socialSharing && c.share.enabled && (T = i(e.url))
  8237. }
  8238. },
  8239. finishSetup: function(e) {
  8240. w = w || !!e,
  8241. document.getElementById("title-toggle").addEventListener("click", x.toggleTitle.bind(x)),
  8242. w && p.addEventListener("click", x.toggleMeta.bind(x, !1)),
  8243. [].slice.call(v.querySelectorAll("a")).forEach(function(e) {
  8244. e.addEventListener("click", x.emit.bind(x, a.LINK_CLICKED))
  8245. }),
  8246. [].slice.call(y.querySelectorAll("a")).forEach(function(e) {
  8247. e.addEventListener("click", x.emit.bind(x, a.CONTACT_LINK_CLICKED, {
  8248. contact_type: e.getAttribute("id")
  8249. }))
  8250. }),
  8251. w || (T ? p.classList.add("share-only") : p.classList.add("no-meta"))
  8252. },
  8253. toggleMeta: function(e, t) {
  8254. var i = document.getElementById("model-title");
  8255. t && t.preventDefault();
  8256. var n = m.classList.contains("expand");
  8257. e && !n || (n ? (b.forEach(function(e) {
  8258. e.classList.remove("expand")
  8259. }),
  8260. this.emit(a.CLOSE_INFO),
  8261. i.classList.remove("expand")) : (b.forEach(function(e) {
  8262. e.classList.add("expand")
  8263. }),
  8264. i.classList.add("expand"),
  8265. this.emit(a.OPEN_INFO)))
  8266. },
  8267. setupToggling: function() {
  8268. g.style.height = m.offsetHeight + "px",
  8269. m.addEventListener("transitionend", function() {
  8270. g.style.height = m.offsetHeight + "px"
  8271. })
  8272. },
  8273. toggleTitle: function(e) {
  8274. e && e.preventDefault(),
  8275. d.classList.contains("closed") ? (d.classList.add("open"),
  8276. f.classList.remove("icon-dpad-right"),
  8277. f.classList.add("icon-dpad-left"),
  8278. this.emit(a.SHOW_INFO),
  8279. setTimeout(function() {
  8280. d.classList.remove("closed"),
  8281. d.classList.remove("open")
  8282. }, o.removeAnimationClasses)) : (d.classList.add("closed"),
  8283. f.classList.remove("icon-dpad-left"),
  8284. f.classList.add("icon-dpad-right"),
  8285. this.emit(a.HIDE_INFO))
  8286. }
  8287. };
  8288. t.extendObject(x, h.prototype),
  8289. M.exports = x
  8290. }
  8291. ).call(this, "/js/gui/title/titleBar.js")
  8292. }
  8293. , {
  8294. "../../localization/localize": 108,
  8295. "../../settings": 166,
  8296. "../../util/browser": 182,
  8297. "../../util/common": 185,
  8298. "../../util/logger": 189,
  8299. "./TitleEvents": 80,
  8300. "./titleBarSettings": 83,
  8301. events: 202
  8302. }],
  8303. 83: [function(e, t, i) {
  8304. "use strict";
  8305. t.exports = Object.freeze({
  8306. minTooltipCharacters: 19,
  8307. removeAnimationClasses: 500
  8308. })
  8309. }
  8310. , {}],
  8311. 84: [function(e, t, i) {
  8312. "use strict";
  8313. function n() {
  8314. v.playTour(),
  8315. y && clearTimeout(y),
  8316. c(),
  8317. E.removeClass("fadeIn")
  8318. }
  8319. function r() {
  8320. A.classList.contains("playing") && (v.stopTour(),
  8321. E.addClass("fadeIn"),
  8322. setTimeout(function() {
  8323. E.removeClass("fadeIn")
  8324. }, h.tourInteraction.showPauseButton),
  8325. M || (clearTimeout(y),
  8326. y = setTimeout(s, h.tourInteraction.showModal)),
  8327. setTimeout(function() {
  8328. A.classList.remove("playing")
  8329. }, h.tourInteraction.allowNextClick))
  8330. }
  8331. function o() {
  8332. v.tourInProgress && (v.stopTour(),
  8333. v.endTourProgress(),
  8334. A.classList.remove("playing"))
  8335. }
  8336. function a() {
  8337. _.is(":visible") ? n() : r()
  8338. }
  8339. function s() {//去掉导览结束时的提示
  8340. /* if (!h.tourInteraction.disabled) {
  8341. T.removeClass("small landing " + d.FLOORPLAN + " " + d.OUTDOOR + " " + d.PANORAMA),
  8342. T.addClass("fadeIn tour " + p.deviceType);
  8343. var e, t = h.tourInteraction.smallModal ? m.SMALL : m.LARGE;
  8344. if (!h.tourInteraction.smallModal)
  8345. 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,
  8346. p.fill(x, g.TOUR_INTERACTION[e]),
  8347. T.addClass(e);
  8348. T.addClass(t)
  8349. } */
  8350. }
  8351. function l(e, t) {
  8352. if (t) {
  8353. var i = "keydown" === t.type
  8354. , n = t.which === u.SPACE || v.tourIsPlaying;
  8355. i && n || e || (M = !0),
  8356. v.atEndOfTour() && c(),
  8357. !v.tourIsPlaying && v.tourInProgress && (E.removeClass("fadeIn"),
  8358. c(),
  8359. t.which !== u.SPACE && o()),
  8360. i && n && a()
  8361. }
  8362. }
  8363. function c() {
  8364. T.removeClass("fadeIn")
  8365. }
  8366. var h = (e("../util/browser"),
  8367. e("../settings"))
  8368. , u = e("../enum/Keys")
  8369. , d = e("../enum/Viewmode")
  8370. , p = (e("./helpManager"),
  8371. e("./populateModal"))
  8372. , f = e("../enum/DirectorEvents")
  8373. , g = e("../enum/HelpModalType")
  8374. , m = e("../enum/HelpModalSize")
  8375. , v = null
  8376. , y = null
  8377. , A = document.getElementById("pause-overlay")
  8378. , C = document.getElementById("player")
  8379. , I = document.getElementById("gui")
  8380. , E = $("#pause-icon").eq(0)
  8381. , _ = $("#play").eq(0)
  8382. , b = $("#playHead").eq(0)
  8383. , w = $(".rightViewContainer, #previous, #next, #gui-modes-inside, #gui-modes-outside, #gui-modes-dollhouse, #gui-modes-floorplan").toArray()
  8384. , T = $("#interaction-modal").eq(0)
  8385. , x = $("#interaction-modal .interaction").toArray()
  8386. , S = ["touchstart", "mousedown", "pointerdown"]
  8387. , M = !1;
  8388. t.exports.init = function(e) {
  8389. v = e,
  8390. S.forEach(function(t) {
  8391. C.addEventListener(t, l.bind(this, !1), !0),
  8392. I.addEventListener(t, l.bind(this, !0), !0),
  8393. A.addEventListener(t, r, !0),
  8394. w.forEach(function(e) {
  8395. e.addEventListener(t, o, !0)
  8396. }),
  8397. $("#drawer img").on(t, o)
  8398. }),
  8399. document.addEventListener("keydown", l.bind(this, !1), !0),
  8400. v.on(f.TourStart, function() {
  8401. A.classList.add("playing")
  8402. })
  8403. }
  8404. ,
  8405. t.exports.play = n,
  8406. t.exports.pause = r,
  8407. t.exports.pauseWithoutCTA = o,
  8408. t.exports.togglePlay = a,
  8409. t.exports.stopTour = function() {
  8410. b.hasClass("playing") && (clearTimeout(y),
  8411. v.atEndOfTour() ? (A.classList.remove("playing"),
  8412. s()) : E.removeClass("fadeIn"))
  8413. }
  8414. ,
  8415. t.exports.dismissModal = c
  8416. }
  8417. , {
  8418. "../enum/DirectorEvents": 23,
  8419. "../enum/HelpModalSize": 27,
  8420. "../enum/HelpModalType": 28,
  8421. "../enum/Keys": 30,
  8422. "../enum/Viewmode": 51,
  8423. "../settings": 166,
  8424. "../util/browser": 182,
  8425. "./helpManager": 68,
  8426. "./populateModal": 75
  8427. }],
  8428. 85: [function(e, t, i) {
  8429. "use strict";
  8430. t.exports = Object.freeze({
  8431. OPENED: "vr.modal.opened",
  8432. LAUNCH: "vr.modal.launch",
  8433. CLOSED: "vr.modal.closed",
  8434. NEXT: "vr.modal.next",
  8435. PREV: "vr.modal.prev",
  8436. STORE: "vr.modal.store",
  8437. falseICECHOSEN: "vr.modal.device"
  8438. })
  8439. }
  8440. , {}],
  8441. 86: [function(e, t, i) {
  8442. "use strict";
  8443. var h = e("../../util/browser")
  8444. , u = e("../../enum/VRApps")
  8445. , n = e("../../enum/VRPlatforms")
  8446. , d = e("../../util/ajax")
  8447. , p = e("../../settings")
  8448. , r = {};
  8449. for (var o in r[u.CardboardAndroid] = "https://play.google.com/store/apps/details?id=com.port.mpvrcardboard&redirect_uri=",
  8450. r[u.CardboardIOS] = "https://itunes.apple.com/us/app/port-vr/id1168808473&redirect_uri=",
  8451. r[u.GearVR] = "https://www.oculus.com/experiences/gear-vr/811670972252145/?redirect_uri=",
  8452. u) {
  8453. var a = u[o];
  8454. r[a] += encodeURIComponent(document.referrer + "&display=" + a)
  8455. }
  8456. var s, f = {}, g = (-1 === (s = window.location.host).indexOf(".port.com") && -1 === s.indexOf("localhost") && (s = "my.port.com"),
  8457. "https://" + s);
  8458. t.exports.init = function(e, t, o) {
  8459. function a(e, t, i, n) {
  8460. function r() {
  8461. return "&utm_medium=" + (h.inIframe() ? "embed" : "direct") + ("&utm_source=" + s) + ("&utm_showcase_session_id=" + o)
  8462. }
  8463. 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()
  8464. }
  8465. var s = h.inIframe() ? encodeURIComponent(document.referrer) : encodeURIComponent(window.location.href)
  8466. , l = g + "/vr/dlist/?ret=" + s
  8467. , c = g + "/vr/show/?ret=" + s;
  8468. switch (e) {
  8469. case n.IOS:
  8470. !function(t, e, i, n) {
  8471. var r = a(t, e, i, n)
  8472. , o = {
  8473. responseType: "json",
  8474. data: {
  8475. branch_key: p.appConfig.branch_key,
  8476. data: {
  8477. m: e,
  8478. full_url: r,
  8479. $desktop_url: "",
  8480. $og_app_id: "331853976762864119",
  8481. $og_title: i,
  8482. $og_description: n,
  8483. $og_image_url: location.origin + "/api/v1/player/models/" + e + "/thumb",
  8484. $canonical_url: window.location.href
  8485. }
  8486. }
  8487. };
  8488. d.post("https://api.branch.io/v1/url", o).done(function(e) {
  8489. f[t] = e.url
  8490. }).fail(function(e) {
  8491. f[t] = e
  8492. }
  8493. .bind(this, r))
  8494. }(u.CardboardIOS, t.sid, t.name, t.summary);
  8495. break;
  8496. default:
  8497. !function(e, t, i) {
  8498. for (var n in u) {
  8499. var r = u[n]
  8500. , o = a(r, e, t, i);
  8501. f[r] = o
  8502. }
  8503. }(t.sid, t.name, t.summary)
  8504. }
  8505. }
  8506. ,
  8507. t.exports.launch = function(e) {
  8508. var t = f[e];
  8509. window.open(t, "_blank")
  8510. }
  8511. ,
  8512. t.exports.launchStore = function(e) {
  8513. var t = r[e];
  8514. window.open(t, "_blank")
  8515. }
  8516. }
  8517. , {
  8518. "../../enum/VRApps": 46,
  8519. "../../enum/VRPlatforms": 49,
  8520. "../../settings": 166,
  8521. "../../util/ajax": 181,
  8522. "../../util/browser": 182
  8523. }],
  8524. 87: [function(e, t, i) {
  8525. "use strict";
  8526. function c(e) {
  8527. var t;
  8528. switch (e) {
  8529. case y.IOS:
  8530. return 9 < (t = g.iosVersion()).major || 9 === t.major && 1 <= t.minor;
  8531. case y.Android:
  8532. return 4 < (t = g.androidVersion()).major || 4 === t.major && 4 < t.minor || 4 === t.major && 4 === t.minor && 4 <= t.patch
  8533. }
  8534. return !1
  8535. }
  8536. function h(e) {
  8537. switch (e) {
  8538. case y.Android:
  8539. x.filter(".cardboard").off().on("click", q.cardboardAndroid),
  8540. x.filter(".gearvr").off().on("click", q.gear),
  8541. n(k, U, "logo-button", "same-line");
  8542. break;
  8543. case y.UnsupportedAndroid:
  8544. n("", H, "", "");
  8545. break;
  8546. case y.IOS:
  8547. x.filter(".cardboard").off().on("click", q.cardboardIOS),
  8548. n(k, "", "logo-button", "");
  8549. break;
  8550. case y.Desktop:
  8551. x.filter(".cardboard").off().on("click", r.bind(this, null, N, B)),
  8552. x.filter(".gearvr").off().on("click", r.bind(this, U, F, null)),
  8553. n(k, U, "logo-button", "same-line"),
  8554. Q.cardboard()
  8555. }
  8556. }
  8557. function u(e) {
  8558. $(".p1, .p2, .p3").hide(),
  8559. l.insertAfter(T),
  8560. w.removeClass("front-page"),
  8561. w.removeClass("details-page"),
  8562. w.removeClass("lastPage"),
  8563. x.removeClass("logo-button"),
  8564. x.removeClass("same-line"),
  8565. T.removeClass("headsetOptions"),
  8566. S.attr("src", ""),
  8567. S.filter(".second").removeClass("gear"),
  8568. S.css("display", "inline-block"),
  8569. S.off(),
  8570. M.filter(".second").css("display", ""),
  8571. O.css("display", "none"),
  8572. $(".p" + (e + 1) + _).show(),
  8573. S.filter(".third").insertBefore(M.filter(".third"))
  8574. }
  8575. function n(e, t, i, n) {
  8576. w.addClass("front-page"),
  8577. S.filter(".first").attr("src", e),
  8578. S.filter(".second").attr("src", t),
  8579. x.filter(".first").addClass(i),
  8580. x.filter(".second").addClass(i),
  8581. x.addClass(n),
  8582. ".show-desktop" === _ && T.insertAfter(l)
  8583. }
  8584. function r(e, t, i) {
  8585. T.addClass("headsetOptions"),
  8586. x.off(),
  8587. S.filter(".second").attr("src", t),
  8588. O.css("display", "block"),
  8589. M.filter(".second").css("display", "none"),
  8590. O.on("click", function() {
  8591. u(b.Title),
  8592. h(y.Desktop)
  8593. }),
  8594. e && (X.emit(C.falseICECHOSEN, {
  8595. name: v.GearVR
  8596. }),
  8597. S.filter(".first").attr("src", e),
  8598. S.filter(".second").addClass("gear"),
  8599. S.filter(".second").on("click", m.launchStore.bind(this, v.GearVR)),
  8600. Q.gearvr()),
  8601. i && (X.emit(C.falseICECHOSEN, {
  8602. name: v.Cardboard
  8603. }),
  8604. S.filter(".third").attr("src", i),
  8605. S.filter(".third").show(),
  8606. S.filter(".third").insertAfter(S.filter(".second")),
  8607. S.filter(".third").addClass("link"),
  8608. S.filter(".second").addClass("link"),
  8609. S.filter(".second").on("click", m.launchStore.bind(this, v.CardboardIOS)),
  8610. S.filter(".third").on("click", m.launchStore.bind(this, v.CardboardAndroid)),
  8611. Q.cardboard())
  8612. }
  8613. function d(e, t) {
  8614. switch (t) {
  8615. case y.IOS:
  8616. j = W,
  8617. Y = G;
  8618. break;
  8619. case y.Desktop:
  8620. e === b.Cardboard ? (j = N,
  8621. Y = B,
  8622. S.filter(".second").on("click", m.launchStore.bind(this, v.CardboardIOS)),
  8623. S.filter(".third").on("click", m.launchStore.bind(this, v.CardboardAndroid))) : (j = F,
  8624. S.filter(".second").on("click", m.launchStore.bind(this, v.GearVR)),
  8625. Y = "");
  8626. break;
  8627. default:
  8628. Y = e === b.Cardboard ? (j = H,
  8629. G) : (j = V,
  8630. z)
  8631. }
  8632. }
  8633. function p(e, t, i) {
  8634. w.find(".inner").addClass("details-page"),
  8635. w.addClass("details-page"),
  8636. S.filter(".first").attr("src", e),
  8637. S.filter(".second").attr("src", t),
  8638. S.filter(".third").attr("src", i)
  8639. }
  8640. function f() {
  8641. var e = 1 < g.aspectRatio() && g.isMobile();
  8642. w.toggleClass("landscape", e).toggleClass("portrait", !e),
  8643. w.toggleClass("tiny", $("#player").height() <= o.narrowLandscapeHeight),
  8644. w.toggleClass("tinier", $("#player").height() <= o.reallyNarrowLandscapeHeight)
  8645. }
  8646. var g = e("../../util/browser")
  8647. , m = e("./vrLink")
  8648. , v = e("../../enum/VRApps")
  8649. , y = e("../../enum/VRPlatforms")
  8650. , A = e("../../enum/VRPages")
  8651. , C = e("./vrEvent")
  8652. , o = (e("../../settings"),
  8653. e("../../constants"))
  8654. , I = e("../../localization/localize")
  8655. , a = e("../../util/common")
  8656. , s = e("events").EventEmitter
  8657. , E = 0
  8658. , _ = null
  8659. , b = A.standard
  8660. , w = $(".vr-popup")
  8661. , l = w.find(".vr-popup-body")
  8662. , T = w.find(".vr-images")
  8663. , x = w.find(".img-container")
  8664. , S = w.find(".vr-sm-image")
  8665. , M = x.find(".vr-img-caption")
  8666. , R = $(".vr-buttons").find(".prev-button")
  8667. , P = $(".vr-buttons").find(".next-button")
  8668. , O = T.find(".front-close")
  8669. , L = $(".vr-page")
  8670. , D = w.find("img")
  8671. , N = "images/apple-store.png"
  8672. , F = "images/badge-oculus.png"
  8673. , B = "images/badge-cardboard.png"
  8674. , V = "images/logo-samsung.png"
  8675. , k = "images/headset-cardboard.png"
  8676. , U = "images/headset-gearvr.png"
  8677. , H = "images/ico-android-robot.png"
  8678. , z = "images/ico-gearvr.png"
  8679. , G = "images/ico-vr.png"
  8680. , W = "images/apple-logo-white.svg"
  8681. , j = null
  8682. , Y = null
  8683. , q = {}
  8684. , X = {
  8685. init: function(e, t) {
  8686. function i(e) {
  8687. X.emit(C.STORE, {
  8688. type: e
  8689. }),
  8690. m.launchStore(e)
  8691. }
  8692. function n(e) {
  8693. switch (e !== b.pageCount && (u(e),
  8694. L.text(e + 1 + " / " + b.pageCount)),
  8695. e) {
  8696. case b.Title:
  8697. R.css("display", "none"),
  8698. P.text(a[e]),
  8699. h(r);
  8700. break;
  8701. case b.Cardboard:
  8702. R.css("display", "block"),
  8703. P.text(a[e]),
  8704. x.filter(".cardboard").off(),
  8705. x.filter(".gearvr").off(),
  8706. d(e, r),
  8707. p(k, j, Y);
  8708. break;
  8709. case b.Gear:
  8710. P.text(a[e]),
  8711. d(e, r),
  8712. w.addClass("lastPage"),
  8713. p(U, j, Y);
  8714. break;
  8715. case b.pageCount:
  8716. w.removeClass("fadeIn"),
  8717. X.emit(C.CLOSED)
  8718. }
  8719. D.filter("[src='']").hide()
  8720. }
  8721. var r = g.detectAndroid() ? g.detectAndroidMobile() && c(y.Android) ? (w.addClass("supported"),
  8722. _ = ".show-supported",
  8723. y.Android) : (w.addClass("unsupported"),
  8724. _ = ".show-unsupported",
  8725. y.UnsupportedAndroid) : g.detectIPhone() || g.detectIPod() ? (w.addClass("ios"),
  8726. _ = ".show-ios",
  8727. b = A.ios,
  8728. y.IOS) : (w.addClass("desktop"),
  8729. _ = ".show-desktop",
  8730. y.Desktop);
  8731. function o(e) {
  8732. X.emit(C.LAUNCH, {
  8733. vr_platform: r,
  8734. vr_app: e
  8735. }),
  8736. m.launch(e)
  8737. }
  8738. m.init(r, e, t),
  8739. r !== y.Desktop && w.addClass("mobile"),
  8740. q.cardboardAndroid = o.bind(this, v.CardboardAndroid),
  8741. q.gear = o.bind(this, v.GearVR),
  8742. q.cardboardIOS = o.bind(this, v.CardboardIOS),
  8743. f(),
  8744. $(".show-supported, .show-unsupported, .show-ios, .show-desktop").hide(),
  8745. $(_).show();
  8746. var a = [I.VR_LEARN_MORE_CAPS, I.VR_NEXT_CAPS, I.VR_GOT_IT_CAPS]
  8747. , s = ["vr_modal_learn_more", "vr_modal_next", "vr_modal_done"];
  8748. r === y.IOS && (a.splice(1, 1),
  8749. s.splice(1, 1)),
  8750. $("#vr").on("click", function(e) {
  8751. e.preventDefault(),
  8752. window.vrEnabled || (window.vrEnabled = !0,
  8753. this.classList.add("active"),
  8754. $("#gui div").not("#vrOff").addClass("vrHide"),
  8755. $("#vrOffImg").css({
  8756. display: "inline-block"
  8757. }))
  8758. }),
  8759. $("#vrOff").on("click", function() {
  8760. window.vrEnabled = !1,
  8761. $("#gui div").not("#vrOff").removeClass("vrHide"),
  8762. $("#vrOffImg").css({
  8763. display: "none"
  8764. }),
  8765. $("#player canvas").css({
  8766. width: "",
  8767. height: ""
  8768. }),
  8769. $("#vr").removeClass("active")
  8770. });
  8771. var l = "https://my.port.com/vr/show/?m=" + e.sid;
  8772. r === y.IOS ? $(".cardboardLink").on("click", i.bind(this, v.CardboardIOS)) : $(".cardboardLink").on("click", i.bind(this, v.CardboardAndroid)),
  8773. $(".gearLink").on("click", i.bind(this, v.GearVR)),
  8774. $("span.modelLink").text(l),
  8775. R.on("click", function(e) {
  8776. X.emit(C.PREV),
  8777. n(--E)
  8778. }),
  8779. P.on("click", function(e) {
  8780. P.text(),
  8781. X.emit(C.NEXT, {
  8782. nextAction: s[E]
  8783. }),
  8784. n(++E)
  8785. }),
  8786. w.find(".close").on("click", X.dismiss)
  8787. },
  8788. dismiss: function() {
  8789. w.hasClass("fadeIn") && (w.removeClass("fadeIn"),
  8790. X.emit(C.CLOSED))
  8791. },
  8792. isDeviceSupported: c
  8793. };
  8794. a.extendObject(X, s.prototype),
  8795. $(window).resize(f);
  8796. var Z, K, Q = (Z = M.filter(".first").find(".cardboard"),
  8797. K = M.filter(".first").find(".gearvr"),
  8798. {
  8799. cardboard: function() {
  8800. K.addClass("hidden"),
  8801. Z.removeClass("hidden")
  8802. },
  8803. gearvr: function() {
  8804. Z.addClass("hidden"),
  8805. K.removeClass("hidden")
  8806. }
  8807. });
  8808. t.exports = X
  8809. }
  8810. , {
  8811. "../../constants": 8,
  8812. "../../enum/VRApps": 46,
  8813. "../../enum/VRPages": 48,
  8814. "../../enum/VRPlatforms": 49,
  8815. "../../localization/localize": 108,
  8816. "../../settings": 166,
  8817. "../../util/browser": 182,
  8818. "../../util/common": 185,
  8819. "./vrEvent": 85,
  8820. "./vrLink": 86,
  8821. events: 202
  8822. }],
  8823. 88: [function(e, t, i) {
  8824. "use strict";
  8825. t.exports = Object.freeze({
  8826. OPENED: "webvr.modal.opened",
  8827. SHOW_TERMS: "webvr.footer.show.terms"
  8828. })
  8829. }
  8830. , {}],
  8831. 89: [function(B, V, e) {
  8832. (function(e) {
  8833. "use strict";
  8834. function a() {
  8835. function t() {
  8836. p.isPresenting || (r.info("exiting webVR"),
  8837. c("webvr_exit_app"),
  8838. -1 === window.location.search.indexOf("&qs=1") ? window.location = window.location + "&qs=1" : window.location = window.location,
  8839. window.removeEventListener("vrdisplaypresentchange", t))
  8840. }
  8841. r.info("Headset mounted"),
  8842. u.suspend();
  8843. var e = document.createElement("canvas");
  8844. for (e.getContext("webgl"),
  8845. e.className = "webvr-canvas",
  8846. document.bgColor = "#000",
  8847. document.body.style.backgroundColor = "#000"; document.body.firstChild; )
  8848. document.body.removeChild(document.body.firstChild);
  8849. document.body.appendChild(e),
  8850. c("webvr_enter_app"),
  8851. p.requestPresent([{
  8852. source: e,
  8853. predistorted: !0
  8854. }]).catch(function(e) {
  8855. r.error("Failed to present: " + e),
  8856. c("webvr_exit_calibrate"),
  8857. t()
  8858. }),
  8859. d.then(function() {
  8860. window.dispatchEvent(new Event("vrapp-start"))
  8861. }),
  8862. window.addEventListener("vrdisplaypresentchange", t)
  8863. }
  8864. function s() {
  8865. c("webvr_modal_close"),
  8866. _.find(".enter-button").off("click", a),
  8867. E.fadeOut(g.guiAnimationSpeed, function() {
  8868. _.toggleClass("hidden", !1),
  8869. b.toggleClass("hidden", !0),
  8870. f.exitFullscreen()
  8871. }),
  8872. I.fadeIn(g.guiAnimationSpeed)
  8873. }
  8874. function t() {
  8875. M.toggleClass("hidden", !0),
  8876. S.toggleClass("hidden", !1)
  8877. }
  8878. function l() {
  8879. _.toggleClass("hidden"),
  8880. b.toggleClass("hidden")
  8881. }
  8882. function c(e) {
  8883. var t = f.isLandscape() ? "landscape" : "portrait";
  8884. i.trackAlways("showcase_gui", {
  8885. gui_action: e,
  8886. orientation: t
  8887. })
  8888. }
  8889. function h() {
  8890. var e = f.isLandscape();
  8891. E.toggleClass("landscape", e).toggleClass("portrait", !e)
  8892. }
  8893. var u, d, p, f = B("../../util/browser"), g = B("../../settings"), m = (B("./../gui"),
  8894. B("../../enum/VRPlatforms")), v = B("../../enum/VRApps"), y = B("./../vr/vrLink"), A = B("./WebVrEvent"), i = B("../../analytics"), C = (B("../../constants"),
  8895. 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 = {
  8896. init: function(e, t, i, n) {
  8897. function r(e) {
  8898. e.preventDefault(),
  8899. o(e.currentTarget.id)
  8900. }
  8901. function o(i) {
  8902. F[i](),
  8903. Object.keys(F).map(function(e, t) {
  8904. $("#" + e).toggleClass("tabs-underlined", e === i)
  8905. })
  8906. }
  8907. p = i,
  8908. u = t,
  8909. y.init(m.Android, e, n),
  8910. h(),
  8911. new RegExp("daydream","i").test(p.displayName) ? (o("tabdaydream"),
  8912. w.filter(".device-headset-side").attr("src", "images/device-daydream-side.png"),
  8913. _.find(".title").text(C.localizeText("WEBVR_FOR_DAYDREAM"))) : (o("tabcardboard"),
  8914. w.filter(".device-headset-side").attr("src", R),
  8915. _.find(".title").text(C.localizeText("WEBVR_FOR_CARDBOARD"))),
  8916. $("#vr").on("click", function(e) {
  8917. e.preventDefault(),
  8918. c("click_webvr_button"),
  8919. E.is(":hidden") && (N.emit(A.OPENED),
  8920. I.fadeOut(g.guiAnimationSpeed),
  8921. E.fadeIn(g.guiAnimationSpeed),
  8922. function() {
  8923. if (!d) {
  8924. var n = "https://static.port.com/webvr/" + (f.valueFromHash("webvr") || g.appConfig.webvr_version) + "/js/main.js";
  8925. d = new Promise(function(e, t) {
  8926. var i = document.createElement("script");
  8927. i.type = "text/javascript",
  8928. i.src = n,
  8929. i.onload = e,
  8930. document.head.appendChild(i)
  8931. }
  8932. )
  8933. }
  8934. _.find(".enter-button").on("click", a)
  8935. }())
  8936. }),
  8937. $(".webvr-popup .close").on("click", function(e) {
  8938. e.preventDefault(),
  8939. _.hasClass("hidden") ? (c("webvr_help_close"),
  8940. l()) : s()
  8941. }),
  8942. $("#tabcardboard").on("click", r),
  8943. $("#tabdaydream").on("click", r),
  8944. $("#tabnative").on("click", r),
  8945. $(".webvr-popup .open-with-app").on("click", function(e) {
  8946. e.preventDefault(),
  8947. c("webvr_learn_more"),
  8948. o("tabnative"),
  8949. l()
  8950. }),
  8951. $(".webvr-popup .help").on("click", function(e) {
  8952. e.preventDefault(),
  8953. c(_.hasClass("hidden") ? "webvr_help_close" : "webvr_help_show"),
  8954. l()
  8955. }),
  8956. $(".webvr-popup .terms").on("click", function(e) {
  8957. e.preventDefault(),
  8958. c("webvr_click_terms"),
  8959. s(),
  8960. N.emit(A.SHOW_TERMS)
  8961. }),
  8962. T.on("click", function(e) {
  8963. e.preventDefault(),
  8964. c(D),
  8965. window.open(L, "_blank")
  8966. }),
  8967. x.on("click", function(e) {
  8968. e.preventDefault(),
  8969. c("webvr_phone_link"),
  8970. window.open("https://vr.google.com/daydream/phones/", "_blank")
  8971. }),
  8972. $(".webvr-popup .badge-cardboard").on("click", function(e) {
  8973. e.preventDefault(),
  8974. c("webvr_cardboard_link"),
  8975. y.launch(v.CardboardAndroid)
  8976. }),
  8977. $(".webvr-popup .badge-oculus").on("click", function(e) {
  8978. e.preventDefault(),
  8979. c("webvr_oculus_link"),
  8980. y.launch(v.GearVR)
  8981. })
  8982. }
  8983. }, F = {
  8984. tabcardboard: function() {
  8985. w.filter(".device-headset").attr("src", R),
  8986. w.filter(".device-phone").attr("src", "images/ico-android-robot.png"),
  8987. L = "https://vr.google.com/cardboard/get-cardboard/",
  8988. D = "webvr_cardboard_link",
  8989. T.text(C.localizeText("VR_GOOGLE_CARDBOARD")),
  8990. x.text(C.localizeText("VR_COMPATIBLE_ANDROID_LONG")),
  8991. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !0),
  8992. t()
  8993. },
  8994. tabdaydream: function() {
  8995. w.filter(".device-headset").attr("src", "images/device-daydream.png"),
  8996. w.filter(".device-phone").attr("src", "images/device-pixel.png"),
  8997. L = P,
  8998. D = O,
  8999. T.text(C.localizeText("WEBVR_DAYDREAM_VIEW")),
  9000. x.text(C.localizeText("VR_NEED_DAYDREAM_PHONE")),
  9001. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !1),
  9002. t()
  9003. },
  9004. tabnative: function() {
  9005. w.filter(".badge-cardboard").attr("src", "images/badge-cardboard.png"),
  9006. w.filter(".badge-oculus").attr("src", "images/badge-oculus.png"),
  9007. M.toggleClass("hidden", !1),
  9008. S.toggleClass("hidden", !0)
  9009. }
  9010. };
  9011. n.extendObject(N, o.prototype),
  9012. $(window).resize(h),
  9013. V.exports = N
  9014. }
  9015. ).call(this, "/js/gui/webvr/webVRgui.js")
  9016. }
  9017. , {
  9018. "../../analytics": 4,
  9019. "../../constants": 8,
  9020. "../../enum/VRApps": 46,
  9021. "../../enum/VRPlatforms": 49,
  9022. "../../localization/localize": 108,
  9023. "../../settings": 166,
  9024. "../../util/browser": 182,
  9025. "../../util/common": 185,
  9026. "../../util/logger": 189,
  9027. "./../gui": 65,
  9028. "./../vr/vrLink": 86,
  9029. "./WebVrEvent": 88,
  9030. events: 202
  9031. }],
  9032. 90: [function(e, t, i) {
  9033. "use strict";
  9034. function n(e, t, i, n, r) {
  9035. this.floorId = n || 0 === n ? n : -1,
  9036. this.roomId = r || "",
  9037. this.labelId = e,
  9038. this.position = (new o.Vector3).copy(t),
  9039. this.text = i
  9040. }
  9041. var o = e("three")
  9042. , r = e("../util/browser");
  9043. n.prototype.build = function() {
  9044. var e = window.document.createElement("div");
  9045. r.isMobile() ? e.setAttribute("class", "gui-floorplan-label gui-floorplan-label-mobile") : e.setAttribute("class", "gui-floorplan-label");
  9046. var t = window.document.createElement("div");
  9047. t.setAttribute("class", "gui-floorplan-label-text");
  9048. var i = window.document.createTextNode(this.text);
  9049. t.appendChild(i),
  9050. e.appendChild(t),
  9051. window.document.body.appendChild(e),
  9052. this.labelGui = e,
  9053. this.textBlock = t,
  9054. $(this.labelGui).hide();
  9055. var n = window.getComputedStyle(this.labelGui);
  9056. this.initialTransform = n.transform || n.webkitTransform
  9057. }
  9058. ,
  9059. t.exports = n
  9060. }
  9061. , {
  9062. "../util/browser": 182,
  9063. three: 217
  9064. }],
  9065. 91: [function(e, t, i) {
  9066. "use strict";
  9067. function n() {
  9068. this.player = null,
  9069. this.modelManager = null,
  9070. this.container = null
  9071. }
  9072. var c, o, r = e("three"), a = (e("../util/common"),
  9073. e("../enum/PlayerEvents")), s = (e("../enum/DirectorEvents"),
  9074. e("../enum/ModelManagerEvents")), l = e("../settings"), h = e("../enum/Viewmode"), u = (e("../enum/WarpStyle"),
  9075. e("../util/transitions"),
  9076. e("../util/lerp"),
  9077. e("../util/browser"));
  9078. n.prototype.init = function(e, t, i) {
  9079. this.player = e,
  9080. this.modelManager = t,
  9081. this.container = i,
  9082. this.updateModel(),
  9083. this.bindEvents()
  9084. }
  9085. ,
  9086. n.prototype.bindEvents = function() {
  9087. this.modelManager.on(s.ActiveModelChanged, this.updateModel.bind(this)),
  9088. this.player.on(a.ViewChanged, this.handlePlayerViewChanged.bind(this)),
  9089. this.player.on(a.ModeChanged, this.handlePlayerViewChanged.bind(this)),
  9090. this.player.on(a.StartInside, this.handleStartInside.bind(this)),
  9091. this.player.on(a.StartOutside, this.handleStartOutside.bind(this))
  9092. }
  9093. ,
  9094. n.prototype.updateModel = function() {
  9095. this.model = this.modelManager.getActiveModel()
  9096. }
  9097. ,
  9098. n.prototype.handlePlayerViewChanged = function() {
  9099. this.updateLabelVisibility(),
  9100. this.updateLabelDisplay()
  9101. }
  9102. ,
  9103. n.prototype.getLabelsForFloor = function(t, i) {
  9104. return (i = i || []).length = 0,
  9105. this.model.labels.forEach(function(e) {
  9106. this.labelVisibleForFloor(e, t) && i.push(e)
  9107. }
  9108. .bind(this)),
  9109. i
  9110. }
  9111. ,
  9112. n.prototype.getLabelsForCurrentFloor = function(e) {
  9113. return this.getLabelsForFloor(this.model.currentFloor.floorIndex, e)
  9114. }
  9115. ,
  9116. n.prototype.labelVisibleForFloor = function(e, t) {
  9117. var i = u.isMobile() && this.player.getLabelScaleFactor() < l.labels.zoomHideThreshhold.mobile || !u.isMobile() && this.player.getLabelScaleFactor() < l.labels.zoomHideThreshhold.desktop;
  9118. if (!this.model.showingLabels || !e.labelGui || !i)
  9119. return !1;
  9120. var n = e.floorId === this.model.floors.size() - 1;
  9121. return this.model.allFloorsVisible ? n : e.floorId === t
  9122. }
  9123. ,
  9124. n.prototype.updateLabelVisibility = function(e) {
  9125. this.model.labels.forEach(function(e) {
  9126. 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)
  9127. }
  9128. .bind(this))
  9129. }
  9130. ,
  9131. n.prototype.showAllLabels = function(t, i) {
  9132. this.model.labels.forEach(function(e) {
  9133. this.showLabel(e, t, i)
  9134. }
  9135. .bind(this))
  9136. }
  9137. ,
  9138. n.prototype.hideAllLabels = function(t, i) {
  9139. this.model.labels.forEach(function(e) {
  9140. this.hideLabel(e, t, i)
  9141. }
  9142. .bind(this))
  9143. }
  9144. ,
  9145. n.prototype.showLabel = function(e, t, i) {
  9146. this.model.showingLabels && (e.visible || (e.visible = !0,
  9147. e.labelGui.style.display = "block",
  9148. e.labelGui.style.opacity = 0,
  9149. $(e.labelGui).delay(t).fadeTo(i, 1)))
  9150. }
  9151. ,
  9152. n.prototype.hideLabel = function(e, t, i) {
  9153. e.visible && (e.visible = !1,
  9154. u.isMobile() ? $(e.labelGui).hide() : $(e.labelGui).delay(t).fadeOut(i))
  9155. }
  9156. ,
  9157. n.prototype.supportedMode = function() {
  9158. return this.player.mode === h.FLOORPLAN
  9159. }
  9160. ,
  9161. n.prototype.updateLabelDisplay = (new r.Vector3,
  9162. new r.Vector3,
  9163. o = [],
  9164. function() {
  9165. var e = this.player.getLabelScaleFactor()
  9166. , t = 1.2 * (1 - e) + .6
  9167. , i = u.isMobile() ? l.labels.zoomTruncateThreshhold.mobile : l.labels.zoomTruncateThreshhold.desktop;
  9168. this.getLabelsForCurrentFloor(o);
  9169. for (var n = 0; n < o.length; n++) {
  9170. var r = o[n];
  9171. this.supportedMode() && r.labelGui && (this.updateProjectedGuiElement(r.labelGui, r.textBlock, r.position, t, t),
  9172. 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)
  9173. }
  9174. }
  9175. ),
  9176. n.prototype.updateProjectedGuiElement = (c = new r.Vector3,
  9177. new r.Vector3,
  9178. function(e, t, i, n, r) {
  9179. t.style.fontSize = 100 * r + "%";
  9180. var o = .5 * $("#player").width()
  9181. , a = .5 * $("#player").height();
  9182. c.copy(i),
  9183. c.project(this.player.camera);
  9184. var s = c.x * o + o
  9185. , l = -c.y * a + a;
  9186. s -= e.offsetWidth / 2,
  9187. l -= e.offsetHeight / 2,
  9188. e.style.left = s + "px",
  9189. e.style.top = l + "px"
  9190. }
  9191. ),
  9192. n.prototype.handleStartInside = function(e) {
  9193. this.updateLabelVisibility()
  9194. }
  9195. ,
  9196. n.prototype.handleStartOutside = function() {
  9197. this.updateLabelVisibility()
  9198. }
  9199. ,
  9200. t.exports = n
  9201. }
  9202. , {
  9203. "../enum/DirectorEvents": 23,
  9204. "../enum/ModelManagerEvents": 33,
  9205. "../enum/PlayerEvents": 40,
  9206. "../enum/Viewmode": 51,
  9207. "../enum/WarpStyle": 52,
  9208. "../settings": 166,
  9209. "../util/browser": 182,
  9210. "../util/common": 185,
  9211. "../util/lerp": 188,
  9212. "../util/transitions": 195,
  9213. three: 217
  9214. }],
  9215. 92: [function(e, t, i) {
  9216. "use strict";
  9217. Array.prototype.findIndex || (Array.prototype.findIndex = function(e) {
  9218. if (null == this)
  9219. throw new TypeError("Array.prototype.findIndex called on null or undefined");
  9220. if ("function" != typeof e)
  9221. throw new TypeError("predicate must be a function");
  9222. for (var t, i = Object(this), n = i.length >>> 0, r = arguments[1], o = 0; o < n; o++)
  9223. if (t = i[o],
  9224. e.call(r, t, o, i))
  9225. return o;
  9226. return -1
  9227. }
  9228. ),
  9229. Array.prototype.find || Object.defineProperty(Array.prototype, "find", {
  9230. value: function(e) {
  9231. if (null == this)
  9232. throw new TypeError('"this" is null or not defined');
  9233. var t = Object(this)
  9234. , i = t.length >>> 0;
  9235. if ("function" != typeof e)
  9236. throw new TypeError("predicate must be a function");
  9237. for (var n = arguments[1], r = 0; r < i; ) {
  9238. var o = t[r];
  9239. if (e.call(n, o, r, t))
  9240. return o;
  9241. r++
  9242. }
  9243. }
  9244. })
  9245. }
  9246. , {}],
  9247. 93: [function(e, t, i) {
  9248. "use strict";
  9249. 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 || {};
  9250. function te() {
  9251. this.backgroundElement = document.createElement("div"),
  9252. r.extend(this.backgroundElement.style, {
  9253. backgroundColor: "rgba(0,0,0,0.8)",
  9254. top: 0,
  9255. left: 0,
  9256. display: "none",
  9257. zIndex: "1000",
  9258. opacity: 0,
  9259. WebkitTransition: "opacity 0.2s linear"
  9260. }),
  9261. n.makeFullscreen(this.backgroundElement),
  9262. this.backgroundElement.style.position = "fixed",
  9263. this.domElement = document.createElement("div"),
  9264. r.extend(this.domElement.style, {
  9265. position: "fixed",
  9266. display: "none",
  9267. zIndex: "1001",
  9268. opacity: 0,
  9269. WebkitTransition: "-webkit-transform 0.2s ease-out, opacity 0.2s linear"
  9270. }),
  9271. document.body.appendChild(this.backgroundElement),
  9272. document.body.appendChild(this.domElement);
  9273. var e = this;
  9274. n.bind(this.backgroundElement, "click", function() {
  9275. e.hide()
  9276. })
  9277. }
  9278. function ie(e, t, i) {
  9279. Object.defineProperty(e, t, {
  9280. get: function() {
  9281. return "RGB" === this.__state.space || re(this, t, i),
  9282. this.__state[t]
  9283. },
  9284. set: function(e) {
  9285. "RGB" !== this.__state.space && (re(this, t, i),
  9286. this.__state.space = "RGB"),
  9287. this.__state[t] = e
  9288. }
  9289. })
  9290. }
  9291. function ne(e, t) {
  9292. Object.defineProperty(e, t, {
  9293. get: function() {
  9294. return "HSV" === this.__state.space || oe(this),
  9295. this.__state[t]
  9296. },
  9297. set: function(e) {
  9298. "HSV" !== this.__state.space && (oe(this),
  9299. this.__state.space = "HSV"),
  9300. this.__state[t] = e
  9301. }
  9302. })
  9303. }
  9304. function re(e, t, i) {
  9305. if ("HEX" === e.__state.space)
  9306. e.__state[t] = a.component_from_hex(e.__state.hex, i);
  9307. else {
  9308. if ("HSV" !== e.__state.space)
  9309. throw "Corrupted color state";
  9310. l.extend(e.__state, a.hsv_to_rgb(e.__state.h, e.__state.s, e.__state.v))
  9311. }
  9312. }
  9313. function oe(e) {
  9314. var t = a.rgb_to_hsv(e.r, e.g, e.b);
  9315. l.extend(e.__state, {
  9316. s: t.s,
  9317. v: t.v
  9318. }),
  9319. l.isNaN(t.h) ? l.isUndefined(e.__state.h) && (e.__state.h = 0) : e.__state.h = t.h
  9320. }
  9321. function ae() {
  9322. if (this.__state = o.apply(this, arguments),
  9323. !1 === this.__state)
  9324. throw "Failed to interpret color arguments";
  9325. this.__state.a = this.__state.a || 1
  9326. }
  9327. function se(e) {
  9328. return -1 < (e = e.toString()).indexOf(".") ? e.length - e.indexOf(".") - 1 : 0
  9329. }
  9330. function le(e, t) {
  9331. this.initialValue = e[t],
  9332. this.domElement = document.createElement("div"),
  9333. this.object = e,
  9334. this.property = t,
  9335. this.__onChange = void 0,
  9336. this.__onFinishChange = void 0
  9337. }
  9338. (t.exports = ee).gui = ee.gui || {},
  9339. ee.utils = ee.utils || {},
  9340. ee.controllers = ee.controllers || {},
  9341. ee.dom = ee.dom || {},
  9342. ee.color = ee.color || {},
  9343. ee.utils.css = {
  9344. load: function(e, t) {
  9345. var i = (t = t || document).createElement("link");
  9346. i.type = "text/css",
  9347. i.rel = "stylesheet",
  9348. i.href = e,
  9349. t.getElementsByTagName("head")[0].appendChild(i)
  9350. },
  9351. inject: function(e, t) {
  9352. t = t || document;
  9353. var i = document.createElement("style");
  9354. i.type = "text/css",
  9355. i.innerHTML = e,
  9356. t.getElementsByTagName("head")[0].appendChild(i)
  9357. }
  9358. },
  9359. ee.utils.common = (Q = Array.prototype.forEach,
  9360. J = Array.prototype.slice,
  9361. {
  9362. BREAK: {},
  9363. extend: function(i) {
  9364. return this.each(J.call(arguments, 1), function(e) {
  9365. for (var t in e)
  9366. this.isUndefined(e[t]) || (i[t] = e[t])
  9367. }, this),
  9368. i
  9369. },
  9370. defaults: function(i) {
  9371. return this.each(J.call(arguments, 1), function(e) {
  9372. for (var t in e)
  9373. this.isUndefined(i[t]) && (i[t] = e[t])
  9374. }, this),
  9375. i
  9376. },
  9377. compose: function() {
  9378. var i = J.call(arguments);
  9379. return function() {
  9380. for (var e = J.call(arguments), t = i.length - 1; 0 <= t; t--)
  9381. e = [i[t].apply(this, e)];
  9382. return e[0]
  9383. }
  9384. },
  9385. each: function(e, t, i) {
  9386. if (e)
  9387. if (Q && e.forEach && e.forEach === Q)
  9388. e.forEach(t, i);
  9389. else if (e.length === e.length + 0) {
  9390. for (var n = 0, r = e.length; n < r; n++)
  9391. if (n in e && t.call(i, e[n], n) === this.BREAK)
  9392. return
  9393. } else
  9394. for (var n in e)
  9395. if (t.call(i, e[n], n) === this.BREAK)
  9396. return
  9397. },
  9398. defer: function(e) {
  9399. setTimeout(e, 0)
  9400. },
  9401. toArray: function(e) {
  9402. return e.toArray ? e.toArray() : J.call(e)
  9403. },
  9404. isUndefined: function(e) {
  9405. return void 0 === e
  9406. },
  9407. isNull: function(e) {
  9408. return null === e
  9409. },
  9410. isNaN: function(e) {
  9411. return e != e
  9412. },
  9413. isArray: Array.isArray || function(e) {
  9414. return e.constructor === Array
  9415. }
  9416. ,
  9417. isObject: function(e) {
  9418. return e === Object(e)
  9419. },
  9420. isNumber: function(e) {
  9421. return e === e + 0
  9422. },
  9423. isString: function(e) {
  9424. return e === e + ""
  9425. },
  9426. isBoolean: function(e) {
  9427. return !1 === e || !0 === e
  9428. },
  9429. isFunction: function(e) {
  9430. return "[object Function]" === Object.prototype.toString.call(e)
  9431. }
  9432. }),
  9433. ee.controllers.Controller = (ee.utils.common.extend(le.prototype, {
  9434. onChange: function(e) {
  9435. return this.__onChange = e,
  9436. this
  9437. },
  9438. onFinishChange: function(e) {
  9439. return this.__onFinishChange = e,
  9440. this
  9441. },
  9442. setValue: function(e) {
  9443. return this.object[this.property] = e,
  9444. this.__onChange && this.__onChange.call(this, e),
  9445. this.updateDisplay(),
  9446. this
  9447. },
  9448. getValue: function() {
  9449. return this.object[this.property]
  9450. },
  9451. updateDisplay: function() {
  9452. return this
  9453. },
  9454. isModified: function() {
  9455. return this.initialValue !== this.getValue()
  9456. }
  9457. }),
  9458. le),
  9459. ee.dom.dom = function(c) {
  9460. function i(e) {
  9461. if ("0" === e || c.isUndefined(e))
  9462. return 0;
  9463. var t = e.match(n);
  9464. return c.isNull(t) ? 0 : parseFloat(t[1])
  9465. }
  9466. var h = {};
  9467. c.each({
  9468. HTMLEvents: ["change"],
  9469. MouseEvents: ["click", "mousemove", "mousedown", "mouseup", "mouseover"],
  9470. KeyboardEvents: ["keydown"]
  9471. }, function(e, t) {
  9472. c.each(e, function(e) {
  9473. h[e] = t
  9474. })
  9475. });
  9476. var n = /(\d+(\.\d+)?)px/
  9477. , r = {
  9478. makeSelectable: function(e, t) {
  9479. void 0 !== e && void 0 !== e.style && (e.onselectstart = t ? function() {
  9480. return !1
  9481. }
  9482. : function() {}
  9483. ,
  9484. e.style.MozUserSelect = t ? "auto" : "none",
  9485. e.style.KhtmlUserSelect = t ? "auto" : "none",
  9486. e.unselectable = t ? "on" : "off")
  9487. },
  9488. makeFullscreen: function(e, t, i) {
  9489. c.isUndefined(t) && (t = !0),
  9490. c.isUndefined(i) && (i = !0),
  9491. e.style.position = "absolute",
  9492. t && (e.style.left = 0,
  9493. e.style.right = 0),
  9494. i && (e.style.top = 0,
  9495. e.style.bottom = 0)
  9496. },
  9497. fakeEvent: function(e, t, i, n) {
  9498. i = i || {};
  9499. var r = h[t];
  9500. if (!r)
  9501. throw new Error("Event type " + t + " not supported.");
  9502. var o = document.createEvent(r);
  9503. switch (r) {
  9504. case "MouseEvents":
  9505. var a = i.x || i.clientX || 0
  9506. , s = i.y || i.clientY || 0;
  9507. o.initMouseEvent(t, i.bubbles || !1, i.cancelable || !0, window, i.clickCount || 1, 0, 0, a, s, !1, !1, !1, !1, 0, null);
  9508. break;
  9509. case "KeyboardEvents":
  9510. var l = o.initKeyboardEvent || o.initKeyEvent;
  9511. c.defaults(i, {
  9512. cancelable: !0,
  9513. ctrlKey: !1,
  9514. altKey: !1,
  9515. shiftKey: !1,
  9516. metaKey: !1,
  9517. keyCode: void 0,
  9518. charCode: void 0
  9519. }),
  9520. l(t, i.bubbles || !1, i.cancelable, window, i.ctrlKey, i.altKey, i.shiftKey, i.metaKey, i.keyCode, i.charCode);
  9521. break;
  9522. default:
  9523. o.initEvent(t, i.bubbles || !1, i.cancelable || !0)
  9524. }
  9525. c.defaults(o, n),
  9526. e.dispatchEvent(o)
  9527. },
  9528. bind: function(e, t, i, n) {
  9529. return n = n || !1,
  9530. e.addEventListener ? e.addEventListener(t, i, n) : e.attachEvent && e.attachEvent("on" + t, i),
  9531. r
  9532. },
  9533. unbind: function(e, t, i, n) {
  9534. return n = n || !1,
  9535. e.removeEventListener ? e.removeEventListener(t, i, n) : e.detachEvent && e.detachEvent("on" + t, i),
  9536. r
  9537. },
  9538. addClass: function(e, t) {
  9539. if (void 0 === e.className)
  9540. e.className = t;
  9541. else if (e.className !== t) {
  9542. var i = e.className.split(/ +/);
  9543. -1 == i.indexOf(t) && (i.push(t),
  9544. e.className = i.join(" ").replace(/^\s+/, "").replace(/\s+$/, ""))
  9545. }
  9546. return r
  9547. },
  9548. removeClass: function(e, t) {
  9549. if (t)
  9550. if (void 0 === e.className)
  9551. ;
  9552. else if (e.className === t)
  9553. e.removeAttribute("class");
  9554. else {
  9555. var i = e.className.split(/ +/)
  9556. , n = i.indexOf(t);
  9557. -1 != n && (i.splice(n, 1),
  9558. e.className = i.join(" "))
  9559. }
  9560. else
  9561. e.className = void 0;
  9562. return r
  9563. },
  9564. hasClass: function(e, t) {
  9565. return new RegExp("(?:^|\\s+)" + t + "(?:\\s+|$)").test(e.className) || !1
  9566. },
  9567. getWidth: function(e) {
  9568. var t = getComputedStyle(e);
  9569. return i(t["border-left-width"]) + i(t["border-right-width"]) + i(t["padding-left"]) + i(t["padding-right"]) + i(t.width)
  9570. },
  9571. getHeight: function(e) {
  9572. var t = getComputedStyle(e);
  9573. return i(t["border-top-width"]) + i(t["border-bottom-width"]) + i(t["padding-top"]) + i(t["padding-bottom"]) + i(t.height)
  9574. },
  9575. getOffset: function(e) {
  9576. var t = {
  9577. left: 0,
  9578. top: 0
  9579. };
  9580. if (e.offsetParent)
  9581. for (; t.left += e.offsetLeft,
  9582. t.top += e.offsetTop,
  9583. e = e.offsetParent; )
  9584. ;
  9585. return t
  9586. },
  9587. isActive: function(e) {
  9588. return e === document.activeElement && (e.type || e.href)
  9589. }
  9590. };
  9591. return r
  9592. }(ee.utils.common),
  9593. ee.controllers.OptionController = (q = ee.controllers.Controller,
  9594. X = ee.dom.dom,
  9595. Z = ee.utils.common,
  9596. (K = function(e, t, i) {
  9597. K.superclass.call(this, e, t);
  9598. var n = this;
  9599. if (this.__select = document.createElement("select"),
  9600. Z.isArray(i)) {
  9601. var r = {};
  9602. Z.each(i, function(e) {
  9603. r[e] = e
  9604. }),
  9605. i = r
  9606. }
  9607. Z.each(i, function(e, t) {
  9608. var i = document.createElement("option");
  9609. i.innerHTML = t,
  9610. i.setAttribute("value", e),
  9611. n.__select.appendChild(i)
  9612. }),
  9613. this.updateDisplay(),
  9614. X.bind(this.__select, "change", function() {
  9615. var e = this.options[this.selectedIndex].value;
  9616. n.setValue(e)
  9617. }),
  9618. this.domElement.appendChild(this.__select)
  9619. }
  9620. ).superclass = q,
  9621. Z.extend(K.prototype, q.prototype, {
  9622. setValue: function(e) {
  9623. var t = K.superclass.prototype.setValue.call(this, e);
  9624. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  9625. t
  9626. },
  9627. updateDisplay: function() {
  9628. return this.__select.value = this.getValue(),
  9629. K.superclass.prototype.updateDisplay.call(this)
  9630. }
  9631. }),
  9632. K),
  9633. ee.controllers.NumberController = (W = ee.controllers.Controller,
  9634. j = ee.utils.common,
  9635. (Y = function(e, t, i) {
  9636. Y.superclass.call(this, e, t),
  9637. i = i || {},
  9638. this.__min = i.min,
  9639. this.__max = i.max,
  9640. this.__step = i.step,
  9641. 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,
  9642. this.__precision = se(this.__impliedStep)
  9643. }
  9644. ).superclass = W,
  9645. j.extend(Y.prototype, W.prototype, {
  9646. setValue: function(e) {
  9647. return void 0 !== this.__min && e < this.__min ? e = this.__min : void 0 !== this.__max && e > this.__max && (e = this.__max),
  9648. void 0 !== this.__step && e % this.__step != 0 && (e = Math.round(e / this.__step) * this.__step),
  9649. Y.superclass.prototype.setValue.call(this, e)
  9650. },
  9651. min: function(e) {
  9652. return this.__min = e,
  9653. this
  9654. },
  9655. max: function(e) {
  9656. return this.__max = e,
  9657. this
  9658. },
  9659. step: function(e) {
  9660. return this.__step = e,
  9661. this.__impliedStep = e,
  9662. this.__precision = se(e),
  9663. this
  9664. }
  9665. }),
  9666. Y),
  9667. ee.controllers.NumberControllerBox = (U = ee.controllers.NumberController,
  9668. H = ee.dom.dom,
  9669. z = ee.utils.common,
  9670. (G = function(e, t, i) {
  9671. function n() {
  9672. var e = parseFloat(s.__input.value);
  9673. z.isNaN(e) || s.setValue(e)
  9674. }
  9675. function r(e) {
  9676. var t = a - e.clientY;
  9677. s.setValue(s.getValue() + t * s.__impliedStep),
  9678. a = e.clientY
  9679. }
  9680. function o() {
  9681. H.unbind(window, "mousemove", r),
  9682. H.unbind(window, "mouseup", o)
  9683. }
  9684. this.__truncationSuspended = !1,
  9685. G.superclass.call(this, e, t, i);
  9686. var a, s = this;
  9687. this.__input = document.createElement("input"),
  9688. this.__input.setAttribute("type", "text"),
  9689. H.bind(this.__input, "change", n),
  9690. H.bind(this.__input, "blur", function() {
  9691. n(),
  9692. s.__onFinishChange && s.__onFinishChange.call(s, s.getValue())
  9693. }),
  9694. H.bind(this.__input, "mousedown", function(e) {
  9695. H.bind(window, "mousemove", r),
  9696. H.bind(window, "mouseup", o),
  9697. a = e.clientY
  9698. }),
  9699. H.bind(this.__input, "keydown", function(e) {
  9700. 13 === e.keyCode && (s.__truncationSuspended = !0,
  9701. this.blur(),
  9702. s.__truncationSuspended = !1)
  9703. }),
  9704. this.updateDisplay(),
  9705. this.domElement.appendChild(this.__input)
  9706. }
  9707. ).superclass = U,
  9708. z.extend(G.prototype, U.prototype, {
  9709. updateDisplay: function() {
  9710. return this.__input.value = this.__truncationSuspended ? this.getValue() : function(e, t) {
  9711. var i = Math.pow(10, t);
  9712. return Math.round(e * i) / i
  9713. }(this.getValue(), this.__precision),
  9714. G.superclass.prototype.updateDisplay.call(this)
  9715. }
  9716. }),
  9717. G),
  9718. ee.controllers.NumberControllerSlider = (N = ee.controllers.NumberController,
  9719. F = ee.dom.dom,
  9720. B = ee.utils.css,
  9721. V = ee.utils.common,
  9722. (k = function(e, t, i, n, r) {
  9723. function o(e) {
  9724. e.preventDefault();
  9725. var t = F.getOffset(s.__background)
  9726. , i = F.getWidth(s.__background);
  9727. return s.setValue(function(e, t, i, n, r) {
  9728. return n + (e - t) / (i - t) * (r - n)
  9729. }(e.clientX, t.left, t.left + i, s.__min, s.__max)),
  9730. !1
  9731. }
  9732. function a() {
  9733. F.unbind(window, "mousemove", o),
  9734. F.unbind(window, "mouseup", a),
  9735. s.__onFinishChange && s.__onFinishChange.call(s, s.getValue())
  9736. }
  9737. k.superclass.call(this, e, t, {
  9738. min: i,
  9739. max: n,
  9740. step: r
  9741. });
  9742. var s = this;
  9743. this.__background = document.createElement("div"),
  9744. this.__foreground = document.createElement("div"),
  9745. F.bind(this.__background, "mousedown", function(e) {
  9746. F.bind(window, "mousemove", o),
  9747. F.bind(window, "mouseup", a),
  9748. o(e)
  9749. }),
  9750. F.addClass(this.__background, "slider"),
  9751. F.addClass(this.__foreground, "slider-fg"),
  9752. this.updateDisplay(),
  9753. this.__background.appendChild(this.__foreground),
  9754. this.domElement.appendChild(this.__background)
  9755. }
  9756. ).superclass = N,
  9757. k.useDefaultStyles = function() {
  9758. 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}")
  9759. }
  9760. ,
  9761. V.extend(k.prototype, N.prototype, {
  9762. updateDisplay: function() {
  9763. var e = (this.getValue() - this.__min) / (this.__max - this.__min);
  9764. return this.__foreground.style.width = 100 * e + "%",
  9765. k.superclass.prototype.updateDisplay.call(this)
  9766. }
  9767. }),
  9768. k),
  9769. ee.controllers.FunctionController = (P = ee.controllers.Controller,
  9770. O = ee.dom.dom,
  9771. L = ee.utils.common,
  9772. (D = function(e, t, i) {
  9773. D.superclass.call(this, e, t);
  9774. var n = this;
  9775. this.__button = document.createElement("div"),
  9776. this.__button.innerHTML = void 0 === i ? "Fire" : i,
  9777. O.bind(this.__button, "click", function(e) {
  9778. return e.preventDefault(),
  9779. n.fire(),
  9780. !1
  9781. }),
  9782. O.addClass(this.__button, "button"),
  9783. this.domElement.appendChild(this.__button)
  9784. }
  9785. ).superclass = P,
  9786. L.extend(D.prototype, P.prototype, {
  9787. fire: function() {
  9788. this.__onChange && this.__onChange.call(this),
  9789. this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  9790. this.getValue().call(this.object)
  9791. }
  9792. }),
  9793. D),
  9794. ee.controllers.BooleanController = (x = ee.controllers.Controller,
  9795. S = ee.dom.dom,
  9796. M = ee.utils.common,
  9797. (R = function(e, t) {
  9798. R.superclass.call(this, e, t);
  9799. var i = this;
  9800. this.__prev = this.getValue(),
  9801. this.__checkbox = document.createElement("input"),
  9802. this.__checkbox.setAttribute("type", "checkbox"),
  9803. S.bind(this.__checkbox, "change", function() {
  9804. i.setValue(!i.__prev)
  9805. }, !1),
  9806. this.domElement.appendChild(this.__checkbox),
  9807. this.updateDisplay()
  9808. }
  9809. ).superclass = x,
  9810. M.extend(R.prototype, x.prototype, {
  9811. setValue: function(e) {
  9812. var t = R.superclass.prototype.setValue.call(this, e);
  9813. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  9814. this.__prev = this.getValue(),
  9815. t
  9816. },
  9817. updateDisplay: function() {
  9818. return !0 === this.getValue() ? (this.__checkbox.setAttribute("checked", "checked"),
  9819. this.__checkbox.checked = !0) : this.__checkbox.checked = !1,
  9820. R.superclass.prototype.updateDisplay.call(this)
  9821. }
  9822. }),
  9823. R),
  9824. ee.color.toString = (T = ee.utils.common,
  9825. function(e) {
  9826. if (1 == e.a || T.isUndefined(e.a)) {
  9827. for (var t = e.hex.toString(16); t.length < 6; )
  9828. t = "0" + t;
  9829. return "#" + t
  9830. }
  9831. return "rgba(" + Math.round(e.r) + "," + Math.round(e.g) + "," + Math.round(e.b) + "," + e.a + ")"
  9832. }
  9833. ),
  9834. ee.color.interpret = (I = ee.color.toString,
  9835. E = ee.utils.common,
  9836. w = [{
  9837. litmus: E.isString,
  9838. conversions: {
  9839. THREE_CHAR_HEX: {
  9840. read: function(e) {
  9841. var t = e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);
  9842. return null !== t && {
  9843. space: "HEX",
  9844. hex: parseInt("0x" + t[1].toString() + t[1].toString() + t[2].toString() + t[2].toString() + t[3].toString() + t[3].toString())
  9845. }
  9846. },
  9847. write: I
  9848. },
  9849. SIX_CHAR_HEX: {
  9850. read: function(e) {
  9851. var t = e.match(/^#([A-F0-9]{6})$/i);
  9852. return null !== t && {
  9853. space: "HEX",
  9854. hex: parseInt("0x" + t[1].toString())
  9855. }
  9856. },
  9857. write: I
  9858. },
  9859. CSS_RGB: {
  9860. read: function(e) {
  9861. var t = e.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);
  9862. return null !== t && {
  9863. space: "RGB",
  9864. r: parseFloat(t[1]),
  9865. g: parseFloat(t[2]),
  9866. b: parseFloat(t[3])
  9867. }
  9868. },
  9869. write: I
  9870. },
  9871. CSS_RGBA: {
  9872. read: function(e) {
  9873. var t = e.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/);
  9874. return null !== t && {
  9875. space: "RGB",
  9876. r: parseFloat(t[1]),
  9877. g: parseFloat(t[2]),
  9878. b: parseFloat(t[3]),
  9879. a: parseFloat(t[4])
  9880. }
  9881. },
  9882. write: I
  9883. }
  9884. }
  9885. }, {
  9886. litmus: E.isNumber,
  9887. conversions: {
  9888. HEX: {
  9889. read: function(e) {
  9890. return {
  9891. space: "HEX",
  9892. hex: e,
  9893. conversionName: "HEX"
  9894. }
  9895. },
  9896. write: function(e) {
  9897. return e.hex
  9898. }
  9899. }
  9900. }
  9901. }, {
  9902. litmus: E.isArray,
  9903. conversions: {
  9904. RGB_ARRAY: {
  9905. read: function(e) {
  9906. return 3 == e.length && {
  9907. space: "RGB",
  9908. r: e[0],
  9909. g: e[1],
  9910. b: e[2]
  9911. }
  9912. },
  9913. write: function(e) {
  9914. return [e.r, e.g, e.b]
  9915. }
  9916. },
  9917. RGBA_ARRAY: {
  9918. read: function(e) {
  9919. return 4 == e.length && {
  9920. space: "RGB",
  9921. r: e[0],
  9922. g: e[1],
  9923. b: e[2],
  9924. a: e[3]
  9925. }
  9926. },
  9927. write: function(e) {
  9928. return [e.r, e.g, e.b, e.a]
  9929. }
  9930. }
  9931. }
  9932. }, {
  9933. litmus: E.isObject,
  9934. conversions: {
  9935. RGBA_OBJ: {
  9936. read: function(e) {
  9937. return !!(E.isNumber(e.r) && E.isNumber(e.g) && E.isNumber(e.b) && E.isNumber(e.a)) && {
  9938. space: "RGB",
  9939. r: e.r,
  9940. g: e.g,
  9941. b: e.b,
  9942. a: e.a
  9943. }
  9944. },
  9945. write: function(e) {
  9946. return {
  9947. r: e.r,
  9948. g: e.g,
  9949. b: e.b,
  9950. a: e.a
  9951. }
  9952. }
  9953. },
  9954. RGB_OBJ: {
  9955. read: function(e) {
  9956. return !!(E.isNumber(e.r) && E.isNumber(e.g) && E.isNumber(e.b)) && {
  9957. space: "RGB",
  9958. r: e.r,
  9959. g: e.g,
  9960. b: e.b
  9961. }
  9962. },
  9963. write: function(e) {
  9964. return {
  9965. r: e.r,
  9966. g: e.g,
  9967. b: e.b
  9968. }
  9969. }
  9970. },
  9971. HSVA_OBJ: {
  9972. read: function(e) {
  9973. return !!(E.isNumber(e.h) && E.isNumber(e.s) && E.isNumber(e.v) && E.isNumber(e.a)) && {
  9974. space: "HSV",
  9975. h: e.h,
  9976. s: e.s,
  9977. v: e.v,
  9978. a: e.a
  9979. }
  9980. },
  9981. write: function(e) {
  9982. return {
  9983. h: e.h,
  9984. s: e.s,
  9985. v: e.v,
  9986. a: e.a
  9987. }
  9988. }
  9989. },
  9990. HSV_OBJ: {
  9991. read: function(e) {
  9992. return !!(E.isNumber(e.h) && E.isNumber(e.s) && E.isNumber(e.v)) && {
  9993. space: "HSV",
  9994. h: e.h,
  9995. s: e.s,
  9996. v: e.v
  9997. }
  9998. },
  9999. write: function(e) {
  10000. return {
  10001. h: e.h,
  10002. s: e.s,
  10003. v: e.v
  10004. }
  10005. }
  10006. }
  10007. }
  10008. }],
  10009. function() {
  10010. b = !1;
  10011. var i = 1 < arguments.length ? E.toArray(arguments) : arguments[0];
  10012. return E.each(w, function(e) {
  10013. if (e.litmus(i))
  10014. return E.each(e.conversions, function(e, t) {
  10015. if (_ = e.read(i),
  10016. !1 === b && !1 !== _)
  10017. return (b = _).conversionName = t,
  10018. _.conversion = e,
  10019. E.BREAK
  10020. }),
  10021. E.BREAK
  10022. }),
  10023. b
  10024. }
  10025. ),
  10026. ee.GUI = ee.gui.GUI = function(e, t, i, c, h, u, d, p, f, n, g, r, o, m, v) {
  10027. function y(e, t, i, n) {
  10028. if (void 0 === t[i])
  10029. throw new Error("Object " + t + ' has no property "' + i + '"');
  10030. var r;
  10031. if (n.color)
  10032. r = new g(t,i);
  10033. else {
  10034. var o = [t, i].concat(n.factoryArgs);
  10035. r = c.apply(e, o)
  10036. }
  10037. n.before instanceof h && (n.before = n.before.__li),
  10038. C(e, r),
  10039. m.addClass(r.domElement, "c");
  10040. var a = document.createElement("span");
  10041. m.addClass(a, "property-name"),
  10042. a.innerHTML = r.property;
  10043. var s = document.createElement("div");
  10044. s.appendChild(a),
  10045. s.appendChild(r.domElement);
  10046. var l = A(e, s, n.before);
  10047. return m.addClass(l, R.CLASS_CONTROLLER_ROW),
  10048. m.addClass(l, typeof r.getValue()),
  10049. function(t, i, n) {
  10050. if (n.__li = i,
  10051. n.__gui = t,
  10052. v.extend(n, {
  10053. options: function(e) {
  10054. return 1 < arguments.length ? (n.remove(),
  10055. y(t, n.object, n.property, {
  10056. before: n.__li.nextElementSibling,
  10057. factoryArgs: [v.toArray(arguments)]
  10058. })) : v.isArray(e) || v.isObject(e) ? (n.remove(),
  10059. y(t, n.object, n.property, {
  10060. before: n.__li.nextElementSibling,
  10061. factoryArgs: [e]
  10062. })) : void 0
  10063. },
  10064. name: function(e) {
  10065. return n.__li.firstElementChild.firstElementChild.innerHTML = e,
  10066. n
  10067. },
  10068. listen: function() {
  10069. return n.__gui.listen(n),
  10070. n
  10071. },
  10072. remove: function() {
  10073. return n.__gui.remove(n),
  10074. n
  10075. }
  10076. }),
  10077. n instanceof f) {
  10078. var r = new p(n.object,n.property,{
  10079. min: n.__min,
  10080. max: n.__max,
  10081. step: n.__step
  10082. });
  10083. v.each(["updateDisplay", "onChange", "onFinishChange"], function(e) {
  10084. var t = n[e]
  10085. , i = r[e];
  10086. n[e] = r[e] = function() {
  10087. var e = Array.prototype.slice.call(arguments);
  10088. return t.apply(n, e),
  10089. i.apply(r, e)
  10090. }
  10091. }),
  10092. m.addClass(i, "has-slider"),
  10093. n.domElement.insertBefore(r.domElement, n.domElement.firstElementChild)
  10094. } else if (n instanceof p) {
  10095. var e = function(e) {
  10096. return v.isNumber(n.__min) && v.isNumber(n.__max) ? (n.remove(),
  10097. y(t, n.object, n.property, {
  10098. before: n.__li.nextElementSibling,
  10099. factoryArgs: [n.__min, n.__max, n.__step]
  10100. })) : e
  10101. };
  10102. n.min = v.compose(e, n.min),
  10103. n.max = v.compose(e, n.max)
  10104. } else
  10105. n instanceof u ? (m.bind(i, "click", function() {
  10106. m.fakeEvent(n.__checkbox, "click")
  10107. }),
  10108. m.bind(n.__checkbox, "click", function(e) {
  10109. e.stopPropagation()
  10110. })) : n instanceof d ? (m.bind(i, "click", function() {
  10111. m.fakeEvent(n.__button, "click")
  10112. }),
  10113. m.bind(i, "mouseover", function() {
  10114. m.addClass(n.__button, "hover")
  10115. }),
  10116. m.bind(i, "mouseout", function() {
  10117. m.removeClass(n.__button, "hover")
  10118. })) : n instanceof g && (m.addClass(i, "color"),
  10119. n.updateDisplay = v.compose(function(e) {
  10120. return i.style.borderLeftColor = n.__color.toString(),
  10121. e
  10122. }, n.updateDisplay),
  10123. n.updateDisplay());
  10124. n.setValue = v.compose(function(e) {
  10125. return t.getRoot().__preset_select && n.isModified() && _(t.getRoot(), !0),
  10126. e
  10127. }, n.setValue)
  10128. }(e, l, r),
  10129. e.__controllers.push(r),
  10130. r
  10131. }
  10132. function A(e, t, i) {
  10133. var n = document.createElement("li");
  10134. return t && n.appendChild(t),
  10135. i ? e.__ul.insertBefore(n, params.before) : e.__ul.appendChild(n),
  10136. e.onResize(),
  10137. n
  10138. }
  10139. function C(e, t) {
  10140. var i = e.getRoot()
  10141. , n = i.__rememberedObjects.indexOf(t.object);
  10142. if (-1 != n) {
  10143. var r = i.__rememberedObjectIndecesToControllers[n];
  10144. if (void 0 === r && (r = {},
  10145. i.__rememberedObjectIndecesToControllers[n] = r),
  10146. r[t.property] = t,
  10147. i.load && i.load.remembered) {
  10148. var o, a = i.load.remembered;
  10149. if (a[e.preset])
  10150. o = a[e.preset];
  10151. else {
  10152. if (!a[T])
  10153. return;
  10154. o = a[T]
  10155. }
  10156. if (o[n] && void 0 !== o[n][t.property]) {
  10157. var s = o[n][t.property];
  10158. t.initialValue = s,
  10159. t.setValue(s)
  10160. }
  10161. }
  10162. }
  10163. }
  10164. function I(e, t) {
  10165. return document.location.href + "." + t
  10166. }
  10167. function l(e, t) {
  10168. e.domElement.style.width = t + "px",
  10169. e.__save_row && e.autoPlace && (e.__save_row.style.width = t + "px"),
  10170. e.__closeButton && (e.__closeButton.style.width = t + "px")
  10171. }
  10172. function a(r, o) {
  10173. var a = {};
  10174. return v.each(r.__rememberedObjects, function(e, t) {
  10175. var i = {}
  10176. , n = r.__rememberedObjectIndecesToControllers[t];
  10177. v.each(n, function(e, t) {
  10178. i[t] = o ? e.initialValue : e.getValue()
  10179. }),
  10180. a[t] = i
  10181. }),
  10182. a
  10183. }
  10184. function E(e, t, i) {
  10185. var n = document.createElement("option");
  10186. n.innerHTML = t,
  10187. n.value = t,
  10188. e.__preset_select.appendChild(n),
  10189. i && (e.__preset_select.selectedIndex = e.__preset_select.length - 1)
  10190. }
  10191. function _(e, t) {
  10192. var i = e.__preset_select[e.__preset_select.selectedIndex];
  10193. i.innerHTML = t ? i.value + "*" : i.value
  10194. }
  10195. 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");
  10196. var b, w, T = "Default", x = function() {
  10197. try {
  10198. return "localStorage"in window && null !== window.localStorage
  10199. } catch (e) {
  10200. return !1
  10201. }
  10202. }(), S = !0, s = !1, M = [], R = function(t) {
  10203. var i = this;
  10204. this.domElement = document.createElement("div"),
  10205. this.__ul = document.createElement("ul"),
  10206. this.domElement.appendChild(this.__ul),
  10207. m.addClass(this.domElement, "dg"),
  10208. this.__folders = {},
  10209. this.__controllers = [],
  10210. this.__rememberedObjects = [],
  10211. this.__rememberedObjectIndecesToControllers = [],
  10212. this.__listening = [],
  10213. t = t || {},
  10214. t = v.defaults(t, {
  10215. autoPlace: !0,
  10216. width: R.DEFAULT_WIDTH
  10217. }),
  10218. t = v.defaults(t, {
  10219. resizable: t.autoPlace,
  10220. hideable: t.autoPlace
  10221. }),
  10222. v.isUndefined(t.load) ? t.load = {
  10223. preset: T
  10224. } : t.preset && (t.load.preset = t.preset),
  10225. v.isUndefined(t.parent) && t.hideable && M.push(this),
  10226. t.resizable = v.isUndefined(t.parent) && t.resizable,
  10227. t.autoPlace && v.isUndefined(t.scrollable) && (t.scrollable = !0);
  10228. var n, e, r = x && "true" === localStorage.getItem(I(0, "isLocal"));
  10229. if (Object.defineProperties(this, {
  10230. parent: {
  10231. get: function() {
  10232. return t.parent
  10233. }
  10234. },
  10235. scrollable: {
  10236. get: function() {
  10237. return t.scrollable
  10238. }
  10239. },
  10240. autoPlace: {
  10241. get: function() {
  10242. return t.autoPlace
  10243. }
  10244. },
  10245. preset: {
  10246. get: function() {
  10247. return i.parent ? i.getRoot().preset : t.load.preset
  10248. },
  10249. set: function(e) {
  10250. i.parent ? i.getRoot().preset = e : t.load.preset = e,
  10251. function(e) {
  10252. for (var t = 0; t < e.__preset_select.length; t++)
  10253. e.__preset_select[t].value == e.preset && (e.__preset_select.selectedIndex = t)
  10254. }(this),
  10255. i.revert()
  10256. }
  10257. },
  10258. width: {
  10259. get: function() {
  10260. return t.width
  10261. },
  10262. set: function(e) {
  10263. t.width = e,
  10264. l(i, e)
  10265. }
  10266. },
  10267. name: {
  10268. get: function() {
  10269. return t.name
  10270. },
  10271. set: function(e) {
  10272. t.name = e,
  10273. a && (a.innerHTML = t.name)
  10274. }
  10275. },
  10276. closed: {
  10277. get: function() {
  10278. return t.closed
  10279. },
  10280. set: function(e) {
  10281. t.closed = e,
  10282. t.closed ? m.addClass(i.__ul, R.CLASS_CLOSED) : m.removeClass(i.__ul, R.CLASS_CLOSED),
  10283. this.onResize(),
  10284. i.__closeButton && (i.__closeButton.innerHTML = e ? R.TEXT_OPEN : R.TEXT_CLOSED)
  10285. }
  10286. },
  10287. load: {
  10288. get: function() {
  10289. return t.load
  10290. }
  10291. },
  10292. useLocalStorage: {
  10293. get: function() {
  10294. return r
  10295. },
  10296. set: function(e) {
  10297. x && ((r = e) ? m.bind(window, "unload", n) : m.unbind(window, "unload", n),
  10298. localStorage.setItem(I(0, "isLocal"), e))
  10299. }
  10300. }
  10301. }),
  10302. v.isUndefined(t.parent)) {
  10303. if (t.closed = !1,
  10304. m.addClass(this.domElement, R.CLASS_MAIN),
  10305. m.makeSelectable(this.domElement, !1),
  10306. x && r) {
  10307. i.useLocalStorage = !0;
  10308. var o = localStorage.getItem(I(0, "gui"));
  10309. o && (t.load = JSON.parse(o))
  10310. }
  10311. this.__closeButton = document.createElement("div"),
  10312. this.__closeButton.innerHTML = R.TEXT_CLOSED,
  10313. m.addClass(this.__closeButton, R.CLASS_CLOSE_BUTTON),
  10314. this.domElement.appendChild(this.__closeButton),
  10315. m.bind(this.__closeButton, "click", function() {
  10316. i.closed = !i.closed
  10317. })
  10318. } else {
  10319. void 0 === t.closed && (t.closed = !0);
  10320. var a = document.createTextNode(t.name);
  10321. m.addClass(a, "controller-name");
  10322. var s = A(i, a);
  10323. m.addClass(this.__ul, R.CLASS_CLOSED),
  10324. m.addClass(s, "title"),
  10325. m.bind(s, "click", function(e) {
  10326. return e.preventDefault(),
  10327. i.closed = !i.closed,
  10328. !1
  10329. }),
  10330. t.closed || (this.closed = !1)
  10331. }
  10332. t.autoPlace && (v.isUndefined(t.parent) && (S && (w = document.createElement("div"),
  10333. m.addClass(w, "dg"),
  10334. m.addClass(w, R.CLASS_AUTO_PLACE_CONTAINER),
  10335. document.body.appendChild(w),
  10336. S = !1),
  10337. w.appendChild(this.domElement),
  10338. m.addClass(this.domElement, R.CLASS_AUTO_PLACE)),
  10339. this.parent || l(i, t.width)),
  10340. m.bind(window, "resize", function() {
  10341. i.onResize()
  10342. }),
  10343. m.bind(this.__ul, "webkitTransitionEnd", function() {
  10344. i.onResize()
  10345. }),
  10346. m.bind(this.__ul, "transitionend", function() {
  10347. i.onResize()
  10348. }),
  10349. m.bind(this.__ul, "oTransitionEnd", function() {
  10350. i.onResize()
  10351. }),
  10352. this.onResize(),
  10353. t.resizable && function(t) {
  10354. function e(e) {
  10355. return e.preventDefault(),
  10356. r = e.clientX,
  10357. m.addClass(t.__closeButton, R.CLASS_DRAG),
  10358. m.bind(window, "mousemove", i),
  10359. m.bind(window, "mouseup", n),
  10360. !1
  10361. }
  10362. function i(e) {
  10363. return e.preventDefault(),
  10364. t.width += r - e.clientX,
  10365. t.onResize(),
  10366. r = e.clientX,
  10367. !1
  10368. }
  10369. function n() {
  10370. m.removeClass(t.__closeButton, R.CLASS_DRAG),
  10371. m.unbind(window, "mousemove", i),
  10372. m.unbind(window, "mouseup", n)
  10373. }
  10374. var r;
  10375. t.__resize_handle = document.createElement("div"),
  10376. v.extend(t.__resize_handle.style, {
  10377. width: "6px",
  10378. marginLeft: "-3px",
  10379. height: "200px",
  10380. cursor: "ew-resize",
  10381. position: "absolute"
  10382. }),
  10383. m.bind(t.__resize_handle, "mousedown", e),
  10384. m.bind(t.__closeButton, "mousedown", e),
  10385. t.domElement.insertBefore(t.__resize_handle, t.domElement.firstElementChild)
  10386. }(this),
  10387. n = function() {
  10388. x && "true" === localStorage.getItem(I(0, "isLocal")) && localStorage.setItem(I(0, "gui"), JSON.stringify(i.getSaveObject()))
  10389. }
  10390. ,
  10391. this.saveToLocalStorageIfPossible = n,
  10392. i.getRoot(),
  10393. t.parent || ((e = i.getRoot()).width += 1,
  10394. v.defer(function() {
  10395. e.width -= 1
  10396. }))
  10397. };
  10398. return R.toggleHide = function() {
  10399. s = !s,
  10400. v.each(M, function(e) {
  10401. e.domElement.style.zIndex = s ? -999 : 999,
  10402. e.domElement.style.opacity = s ? 0 : 1
  10403. })
  10404. }
  10405. ,
  10406. R.CLASS_AUTO_PLACE = "a",
  10407. R.CLASS_AUTO_PLACE_CONTAINER = "ac",
  10408. R.CLASS_MAIN = "main",
  10409. R.CLASS_CONTROLLER_ROW = "cr",
  10410. R.CLASS_TOO_TALL = "taller-than-window",
  10411. R.CLASS_CLOSED = "closed",
  10412. R.CLASS_CLOSE_BUTTON = "close-button",
  10413. R.CLASS_DRAG = "drag",
  10414. R.DEFAULT_WIDTH = 245,
  10415. R.TEXT_CLOSED = "Close Controls",
  10416. R.TEXT_OPEN = "Open Controls",
  10417. m.bind(window, "keydown", function(e) {
  10418. "text" === document.activeElement.type || 72 !== e.which && 72 != e.keyCode || R.toggleHide()
  10419. }, !1),
  10420. v.extend(R.prototype, {
  10421. add: function(e, t) {
  10422. return y(this, e, t, {
  10423. factoryArgs: Array.prototype.slice.call(arguments, 2)
  10424. })
  10425. },
  10426. addColor: function(e, t) {
  10427. return y(this, e, t, {
  10428. color: !0
  10429. })
  10430. },
  10431. remove: function(e) {
  10432. this.__ul.removeChild(e.__li),
  10433. this.__controllers.slice(this.__controllers.indexOf(e), 1);
  10434. var t = this;
  10435. v.defer(function() {
  10436. t.onResize()
  10437. })
  10438. },
  10439. destroy: function() {
  10440. this.autoPlace && w.removeChild(this.domElement)
  10441. },
  10442. addFolder: function(e) {
  10443. if (void 0 !== this.__folders[e])
  10444. throw new Error('You already have a folder in this GUI by the name "' + e + '"');
  10445. var t = {
  10446. name: e,
  10447. parent: this
  10448. };
  10449. t.autoPlace = this.autoPlace,
  10450. this.load && this.load.folders && this.load.folders[e] && (t.closed = this.load.folders[e].closed,
  10451. t.load = this.load.folders[e]);
  10452. var i = new R(t);
  10453. this.__folders[e] = i;
  10454. var n = A(this, i.domElement);
  10455. return m.addClass(n, "folder"),
  10456. i
  10457. },
  10458. open: function() {
  10459. this.closed = !1
  10460. },
  10461. close: function() {
  10462. this.closed = !0
  10463. },
  10464. onResize: function() {
  10465. var t = this.getRoot();
  10466. if (t.scrollable) {
  10467. var e = m.getOffset(t.__ul).top
  10468. , i = 0;
  10469. v.each(t.__ul.childNodes, function(e) {
  10470. t.autoPlace && e === t.__save_row || (i += m.getHeight(e))
  10471. }),
  10472. $("#player").height() - e - 20 < i ? (m.addClass(t.domElement, R.CLASS_TOO_TALL),
  10473. t.__ul.style.height = $("#player").height() - e - 20 + "px") : (m.removeClass(t.domElement, R.CLASS_TOO_TALL),
  10474. t.__ul.style.height = "auto")
  10475. }
  10476. t.__resize_handle && v.defer(function() {
  10477. t.__resize_handle.style.height = t.__ul.offsetHeight + "px"
  10478. }),
  10479. t.__closeButton && (t.__closeButton.style.width = t.width + "px")
  10480. },
  10481. remember: function() {
  10482. 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>'),
  10483. this.parent)
  10484. throw new Error("You can only call remember on a top level GUI.");
  10485. var t = this;
  10486. v.each(Array.prototype.slice.call(arguments), function(e) {
  10487. 0 == t.__rememberedObjects.length && function(i) {
  10488. var e = i.__save_row = document.createElement("li");
  10489. m.addClass(i.domElement, "has-save"),
  10490. i.__ul.insertBefore(e, i.__ul.firstChild),
  10491. m.addClass(e, "save-row");
  10492. var t = document.createElement("span");
  10493. t.innerHTML = "&nbsp;",
  10494. m.addClass(t, "button gears");
  10495. var n = document.createElement("span");
  10496. n.innerHTML = "Save",
  10497. m.addClass(n, "button"),
  10498. m.addClass(n, "save");
  10499. var r = document.createElement("span");
  10500. r.innerHTML = "New",
  10501. m.addClass(r, "button"),
  10502. m.addClass(r, "save-as");
  10503. var o = document.createElement("span");
  10504. o.innerHTML = "Revert",
  10505. m.addClass(o, "button"),
  10506. m.addClass(o, "revert");
  10507. var a = i.__preset_select = document.createElement("select");
  10508. if (i.load && i.load.remembered ? v.each(i.load.remembered, function(e, t) {
  10509. E(i, t, t == i.preset)
  10510. }) : E(i, T, !1),
  10511. m.bind(a, "change", function() {
  10512. for (var e = 0; e < i.__preset_select.length; e++)
  10513. i.__preset_select[e].innerHTML = i.__preset_select[e].value;
  10514. i.preset = this.value
  10515. }),
  10516. e.appendChild(a),
  10517. e.appendChild(t),
  10518. e.appendChild(n),
  10519. e.appendChild(r),
  10520. e.appendChild(o),
  10521. x) {
  10522. var s = document.getElementById("dg-save-locally")
  10523. , l = document.getElementById("dg-local-explain");
  10524. s.style.display = "block";
  10525. var c = document.getElementById("dg-local-storage");
  10526. "true" === localStorage.getItem(I(0, "isLocal")) && c.setAttribute("checked", "checked");
  10527. var h = function() {
  10528. l.style.display = i.useLocalStorage ? "block" : "none"
  10529. };
  10530. h(),
  10531. m.bind(c, "change", function() {
  10532. i.useLocalStorage = !i.useLocalStorage,
  10533. h()
  10534. })
  10535. }
  10536. var u = document.getElementById("dg-new-constructor");
  10537. m.bind(u, "keydown", function(e) {
  10538. !e.metaKey || 67 !== e.which && 67 != e.keyCode || b.hide()
  10539. }),
  10540. m.bind(t, "click", function() {
  10541. u.innerHTML = JSON.stringify(i.getSaveObject(), void 0, 2),
  10542. b.show(),
  10543. u.focus(),
  10544. u.select()
  10545. }),
  10546. m.bind(n, "click", function() {
  10547. i.save()
  10548. }),
  10549. m.bind(r, "click", function() {
  10550. var e = prompt("Enter a new preset name.");
  10551. e && i.saveAs(e)
  10552. }),
  10553. m.bind(o, "click", function() {
  10554. i.revert()
  10555. })
  10556. }(t),
  10557. -1 == t.__rememberedObjects.indexOf(e) && t.__rememberedObjects.push(e)
  10558. }),
  10559. this.autoPlace && l(this, this.width)
  10560. },
  10561. getRoot: function() {
  10562. for (var e = this; e.parent; )
  10563. e = e.parent;
  10564. return e
  10565. },
  10566. getSaveObject: function() {
  10567. var i = this.load;
  10568. return i.closed = this.closed,
  10569. 0 < this.__rememberedObjects.length && (i.preset = this.preset,
  10570. i.remembered || (i.remembered = {}),
  10571. i.remembered[this.preset] = a(this)),
  10572. i.folders = {},
  10573. v.each(this.__folders, function(e, t) {
  10574. i.folders[t] = e.getSaveObject()
  10575. }),
  10576. i
  10577. },
  10578. save: function() {
  10579. this.load.remembered || (this.load.remembered = {}),
  10580. this.load.remembered[this.preset] = a(this),
  10581. _(this, !1),
  10582. this.saveToLocalStorageIfPossible()
  10583. },
  10584. saveAs: function(e) {
  10585. this.load.remembered || (this.load.remembered = {},
  10586. this.load.remembered[T] = a(this, !0)),
  10587. this.load.remembered[e] = a(this),
  10588. this.preset = e,
  10589. E(this, e, !0),
  10590. this.saveToLocalStorageIfPossible()
  10591. },
  10592. revert: function(t) {
  10593. v.each(this.__controllers, function(e) {
  10594. this.getRoot().load.remembered ? C(t || this.getRoot(), e) : e.setValue(e.initialValue)
  10595. }, this),
  10596. v.each(this.__folders, function(e) {
  10597. e.revert(e)
  10598. }),
  10599. t || _(this.getRoot(), !1)
  10600. },
  10601. listen: function(e) {
  10602. var t = 0 == this.__listening.length;
  10603. this.__listening.push(e),
  10604. t && function e(t) {
  10605. 0 != t.length && r(function() {
  10606. e(t)
  10607. }),
  10608. v.each(t, function(e) {
  10609. e.updateDisplay()
  10610. })
  10611. }(this.__listening)
  10612. }
  10613. }),
  10614. R
  10615. }(ee.utils.css, 0, 0, ee.controllers.factory = (h = ee.controllers.OptionController,
  10616. u = ee.controllers.NumberControllerBox,
  10617. d = ee.controllers.NumberControllerSlider,
  10618. p = ee.controllers.StringController = (v = ee.controllers.Controller,
  10619. y = ee.dom.dom,
  10620. A = ee.utils.common,
  10621. (C = function(e, t) {
  10622. function i() {
  10623. n.setValue(n.__input.value)
  10624. }
  10625. C.superclass.call(this, e, t);
  10626. var n = this;
  10627. this.__input = document.createElement("input"),
  10628. this.__input.setAttribute("type", "text"),
  10629. y.bind(this.__input, "keyup", i),
  10630. y.bind(this.__input, "change", i),
  10631. y.bind(this.__input, "blur", function() {
  10632. n.__onFinishChange && n.__onFinishChange.call(n, n.getValue())
  10633. }),
  10634. y.bind(this.__input, "keydown", function(e) {
  10635. 13 === e.keyCode && this.blur()
  10636. }),
  10637. this.updateDisplay(),
  10638. this.domElement.appendChild(this.__input)
  10639. }
  10640. ).superclass = v,
  10641. A.extend(C.prototype, v.prototype, {
  10642. updateDisplay: function() {
  10643. return y.isActive(this.__input) || (this.__input.value = this.getValue()),
  10644. C.superclass.prototype.updateDisplay.call(this)
  10645. }
  10646. }),
  10647. C),
  10648. f = ee.controllers.FunctionController,
  10649. g = ee.controllers.BooleanController,
  10650. m = ee.utils.common,
  10651. function(e, t) {
  10652. var i = e[t];
  10653. 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,{
  10654. min: arguments[2],
  10655. max: arguments[3]
  10656. }) : m.isString(i) ? new p(e,t) : m.isFunction(i) ? new f(e,t,"") : m.isBoolean(i) ? new g(e,t) : void 0
  10657. }
  10658. ), 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) {
  10659. function f(t, i, n, r) {
  10660. t.style.background = "",
  10661. p.each(o, function(e) {
  10662. t.style.cssText += "background: " + e + "linear-gradient(" + i + ", " + n + " 0%, " + r + " 100%); "
  10663. })
  10664. }
  10665. var g = function(e, t) {
  10666. function i(e) {
  10667. a(e),
  10668. h.bind(window, "mousemove", a),
  10669. h.bind(window, "mouseup", n)
  10670. }
  10671. function n() {
  10672. h.unbind(window, "mousemove", a),
  10673. h.unbind(window, "mouseup", n)
  10674. }
  10675. function r() {
  10676. var e = d(this.value);
  10677. !1 !== e ? (l.__color.__state = e,
  10678. l.setValue(l.__color.toOriginal())) : this.value = l.__color.toString()
  10679. }
  10680. function o() {
  10681. h.unbind(window, "mousemove", s),
  10682. h.unbind(window, "mouseup", o)
  10683. }
  10684. function a(e) {
  10685. e.preventDefault();
  10686. var t = h.getWidth(l.__saturation_field)
  10687. , i = h.getOffset(l.__saturation_field)
  10688. , n = (e.clientX - i.left + document.body.scrollLeft) / t
  10689. , r = 1 - (e.clientY - i.top + document.body.scrollTop) / t;
  10690. return 1 < r ? r = 1 : r < 0 && (r = 0),
  10691. 1 < n ? n = 1 : n < 0 && (n = 0),
  10692. l.__color.v = r,
  10693. l.__color.s = n,
  10694. l.setValue(l.__color.toOriginal()),
  10695. !1
  10696. }
  10697. function s(e) {
  10698. e.preventDefault();
  10699. var t = h.getHeight(l.__hue_field)
  10700. , i = h.getOffset(l.__hue_field)
  10701. , n = 1 - (e.clientY - i.top + document.body.scrollTop) / t;
  10702. return 1 < n ? n = 1 : n < 0 && (n = 0),
  10703. l.__color.h = 360 * n,
  10704. l.setValue(l.__color.toOriginal()),
  10705. !1
  10706. }
  10707. g.superclass.call(this, e, t),
  10708. this.__color = new u(this.getValue()),
  10709. this.__temp = new u(0);
  10710. var l = this;
  10711. this.domElement = document.createElement("div"),
  10712. h.makeSelectable(this.domElement, !1),
  10713. this.__selector = document.createElement("div"),
  10714. this.__selector.className = "selector",
  10715. this.__saturation_field = document.createElement("div"),
  10716. this.__saturation_field.className = "saturation-field",
  10717. this.__field_knob = document.createElement("div"),
  10718. this.__field_knob.className = "field-knob",
  10719. this.__field_knob_border = "2px solid ",
  10720. this.__hue_knob = document.createElement("div"),
  10721. this.__hue_knob.className = "hue-knob",
  10722. this.__hue_field = document.createElement("div"),
  10723. this.__hue_field.className = "hue-field",
  10724. this.__input = document.createElement("input"),
  10725. this.__input.type = "text",
  10726. this.__input_textShadow = "0 1px 1px ",
  10727. h.bind(this.__input, "keydown", function(e) {
  10728. 13 === e.keyCode && r.call(this)
  10729. }),
  10730. h.bind(this.__input, "blur", r),
  10731. h.bind(this.__selector, "mousedown", function(e) {
  10732. h.addClass(this, "drag").bind(window, "mouseup", function(e) {
  10733. h.removeClass(l.__selector, "drag")
  10734. })
  10735. });
  10736. var c = document.createElement("div");
  10737. p.extend(this.__selector.style, {
  10738. width: "122px",
  10739. height: "102px",
  10740. padding: "3px",
  10741. backgroundColor: "#222",
  10742. boxShadow: "0px 1px 3px rgba(0,0,0,0.3)"
  10743. }),
  10744. p.extend(this.__field_knob.style, {
  10745. position: "absolute",
  10746. width: "12px",
  10747. height: "12px",
  10748. border: this.__field_knob_border + (this.__color.v < .5 ? "#fff" : "#000"),
  10749. boxShadow: "0px 1px 3px rgba(0,0,0,0.5)",
  10750. borderRadius: "12px",
  10751. zIndex: 1
  10752. }),
  10753. p.extend(this.__hue_knob.style, {
  10754. position: "absolute",
  10755. width: "15px",
  10756. height: "2px",
  10757. borderRight: "4px solid #fff",
  10758. zIndex: 1
  10759. }),
  10760. p.extend(this.__saturation_field.style, {
  10761. width: "100px",
  10762. height: "100px",
  10763. border: "1px solid #555",
  10764. marginRight: "3px",
  10765. display: "inline-block",
  10766. cursor: "pointer"
  10767. }),
  10768. p.extend(c.style, {
  10769. width: "100%",
  10770. height: "100%",
  10771. background: "none"
  10772. }),
  10773. f(c, "top", "rgba(0,0,0,0)", "#000"),
  10774. p.extend(this.__hue_field.style, {
  10775. width: "15px",
  10776. height: "100px",
  10777. display: "inline-block",
  10778. border: "1px solid #555",
  10779. cursor: "ns-resize"
  10780. }),
  10781. function(e) {
  10782. e.style.background = "",
  10783. e.style.cssText += "background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",
  10784. e.style.cssText += "background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  10785. e.style.cssText += "background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  10786. e.style.cssText += "background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  10787. e.style.cssText += "background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"
  10788. }(this.__hue_field),
  10789. p.extend(this.__input.style, {
  10790. outline: "none",
  10791. textAlign: "center",
  10792. color: "#fff",
  10793. border: 0,
  10794. fontWeight: "bold",
  10795. textShadow: this.__input_textShadow + "rgba(0,0,0,0.7)"
  10796. }),
  10797. h.bind(this.__saturation_field, "mousedown", i),
  10798. h.bind(this.__field_knob, "mousedown", i),
  10799. h.bind(this.__hue_field, "mousedown", function(e) {
  10800. s(e),
  10801. h.bind(window, "mousemove", s),
  10802. h.bind(window, "mouseup", o)
  10803. }),
  10804. this.__saturation_field.appendChild(c),
  10805. this.__selector.appendChild(this.__field_knob),
  10806. this.__selector.appendChild(this.__saturation_field),
  10807. this.__selector.appendChild(this.__hue_field),
  10808. this.__hue_field.appendChild(this.__hue_knob),
  10809. this.domElement.appendChild(this.__input),
  10810. this.domElement.appendChild(this.__selector),
  10811. this.updateDisplay()
  10812. };
  10813. g.superclass = e,
  10814. p.extend(g.prototype, e.prototype, {
  10815. updateDisplay: function() {
  10816. var t = d(this.getValue());
  10817. if (!1 !== t) {
  10818. var i = !1;
  10819. p.each(u.COMPONENTS, function(e) {
  10820. if (!p.isUndefined(t[e]) && !p.isUndefined(this.__color.__state[e]) && t[e] !== this.__color.__state[e])
  10821. return i = !0,
  10822. {}
  10823. }, this),
  10824. i && p.extend(this.__color.__state, t)
  10825. }
  10826. p.extend(this.__temp.__state, this.__color.__state),
  10827. this.__temp.a = 1;
  10828. var e = this.__color.v < .5 || .5 < this.__color.s ? 255 : 0
  10829. , n = 255 - e;
  10830. p.extend(this.__field_knob.style, {
  10831. marginLeft: 100 * this.__color.s - 7 + "px",
  10832. marginTop: 100 * (1 - this.__color.v) - 7 + "px",
  10833. backgroundColor: this.__temp.toString(),
  10834. border: this.__field_knob_border + "rgb(" + e + "," + e + "," + e + ")"
  10835. }),
  10836. this.__hue_knob.style.marginTop = 100 * (1 - this.__color.h / 360) + "px",
  10837. this.__temp.s = 1,
  10838. this.__temp.v = 1,
  10839. f(this.__saturation_field, "left", "#fff", this.__temp.toString()),
  10840. p.extend(this.__input.style, {
  10841. backgroundColor: this.__input.value = this.__color.toString(),
  10842. color: "rgb(" + e + "," + e + "," + e + ")",
  10843. textShadow: this.__input_textShadow + "rgba(" + n + "," + n + "," + n + ",.7)"
  10844. })
  10845. }
  10846. });
  10847. var o = ["-moz-", "-o-", "-webkit-", "-ms-", ""];
  10848. return g
  10849. }(ee.controllers.Controller, ee.dom.dom, ee.color.Color = (o = ee.color.interpret,
  10850. a = ee.color.math = {
  10851. hsv_to_rgb: function(e, t, i) {
  10852. var n = Math.floor(e / 60) % 6
  10853. , r = e / 60 - Math.floor(e / 60)
  10854. , o = i * (1 - t)
  10855. , a = i * (1 - r * t)
  10856. , s = i * (1 - (1 - r) * t)
  10857. , l = [[i, s, o], [a, i, o], [o, i, s], [o, a, i], [s, o, i], [i, o, a]][n];
  10858. return {
  10859. r: 255 * l[0],
  10860. g: 255 * l[1],
  10861. b: 255 * l[2]
  10862. }
  10863. },
  10864. rgb_to_hsv: function(e, t, i) {
  10865. var n, r = Math.min(e, t, i), o = Math.max(e, t, i), a = o - r;
  10866. return 0 == o ? {
  10867. h: NaN,
  10868. s: 0,
  10869. v: 0
  10870. } : (n = e == o ? (t - i) / a : t == o ? 2 + (i - e) / a : 4 + (e - t) / a,
  10871. (n /= 6) < 0 && (n += 1),
  10872. {
  10873. h: 360 * n,
  10874. s: a / o,
  10875. v: o / 255
  10876. })
  10877. },
  10878. rgb_to_hex: function(e, t, i) {
  10879. var n = this.hex_with_component(0, 2, e);
  10880. return n = this.hex_with_component(n, 1, t),
  10881. this.hex_with_component(n, 0, i)
  10882. },
  10883. component_from_hex: function(e, t) {
  10884. return e >> 8 * t & 255
  10885. },
  10886. hex_with_component: function(e, t, i) {
  10887. return i << (c = 8 * t) | e & ~(255 << c)
  10888. }
  10889. },
  10890. s = ee.color.toString,
  10891. l = ee.utils.common,
  10892. ae.COMPONENTS = ["r", "g", "b", "h", "s", "v", "hex", "a"],
  10893. l.extend(ae.prototype, {
  10894. toString: function() {
  10895. return s(this)
  10896. },
  10897. toOriginal: function() {
  10898. return this.__state.conversion.write(this)
  10899. }
  10900. }),
  10901. ie(ae.prototype, "r", 2),
  10902. ie(ae.prototype, "g", 1),
  10903. ie(ae.prototype, "b", 0),
  10904. ne(ae.prototype, "h"),
  10905. ne(ae.prototype, "s"),
  10906. ne(ae.prototype, "v"),
  10907. Object.defineProperty(ae.prototype, "a", {
  10908. get: function() {
  10909. return this.__state.a
  10910. },
  10911. set: function(e) {
  10912. this.__state.a = e
  10913. }
  10914. }),
  10915. Object.defineProperty(ae.prototype, "hex", {
  10916. get: function() {
  10917. return "HEX" !== !this.__state.space && (this.__state.hex = a.rgb_to_hex(this.r, this.g, this.b)),
  10918. this.__state.hex
  10919. },
  10920. set: function(e) {
  10921. this.__state.space = "HEX",
  10922. this.__state.hex = e
  10923. }
  10924. }),
  10925. ae), ee.color.interpret, ee.utils.common), ee.utils.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(e, t) {
  10926. window.setTimeout(e, 1e3 / 60)
  10927. }
  10928. , ee.dom.CenteredDiv = (n = ee.dom.dom,
  10929. r = ee.utils.common,
  10930. te.prototype.show = function() {
  10931. var e = this;
  10932. this.backgroundElement.style.display = "block",
  10933. this.domElement.style.display = "block",
  10934. this.domElement.style.opacity = 0,
  10935. this.domElement.style.webkitTransform = "scale(1.1)",
  10936. this.layout(),
  10937. r.defer(function() {
  10938. e.backgroundElement.style.opacity = 1,
  10939. e.domElement.style.opacity = 1,
  10940. e.domElement.style.webkitTransform = "scale(1)"
  10941. })
  10942. }
  10943. ,
  10944. te.prototype.hide = function() {
  10945. var e = this
  10946. , t = function() {
  10947. e.domElement.style.display = "none",
  10948. e.backgroundElement.style.display = "none",
  10949. n.unbind(e.domElement, "webkitTransitionEnd", t),
  10950. n.unbind(e.domElement, "transitionend", t),
  10951. n.unbind(e.domElement, "oTransitionEnd", t)
  10952. };
  10953. n.bind(this.domElement, "webkitTransitionEnd", t),
  10954. n.bind(this.domElement, "transitionend", t),
  10955. n.bind(this.domElement, "oTransitionEnd", t),
  10956. this.backgroundElement.style.opacity = 0,
  10957. this.domElement.style.opacity = 0,
  10958. this.domElement.style.webkitTransform = "scale(1.1)"
  10959. }
  10960. ,
  10961. te.prototype.layout = function() {
  10962. this.domElement.style.left = $("#player").width() / 2 - n.getWidth(this.domElement) / 2 + "px",
  10963. this.domElement.style.top = $("#player").height() / 2 - n.getHeight(this.domElement) / 2 + "px"
  10964. }
  10965. ,
  10966. te), ee.dom.dom, ee.utils.common)
  10967. }
  10968. , {}],
  10969. 94: [function(e, t, i) {
  10970. (function(J) {
  10971. "use strict";
  10972. function i(e) {
  10973. function t(e, t) {
  10974. for (var i = 0, n = 0, r = new Array, o = 1; o <= 16; o++) {
  10975. for (var a = 1; a <= e[o]; a++)
  10976. r[t[n]] = [],
  10977. r[t[n]][0] = i,
  10978. r[t[n]][1] = o,
  10979. n++,
  10980. i++;
  10981. i *= 2
  10982. }
  10983. return r
  10984. }
  10985. function _(e) {
  10986. for (var t = e[0], i = e[1] - 1; 0 <= i; )
  10987. t & 1 << i && (B |= 1 << V),
  10988. i--,
  10989. --V < 0 && (255 == B ? (b(255),
  10990. b(0)) : b(B),
  10991. V = 7,
  10992. B = 0)
  10993. }
  10994. function b(e) {
  10995. F.push(e)
  10996. }
  10997. function w(e) {
  10998. b(e >> 8 & 255),
  10999. b(255 & e)
  11000. }
  11001. function T(e, t, i, n, r) {
  11002. for (var o, a = r[0], s = r[240], l = function(e, t) {
  11003. var i, n, r, o, a, s, l, c, h, u, d = 0;
  11004. for (h = 0; h < 8; ++h) {
  11005. i = e[d],
  11006. n = e[d + 1],
  11007. r = e[d + 2],
  11008. o = e[d + 3],
  11009. a = e[d + 4],
  11010. s = e[d + 5],
  11011. l = e[d + 6];
  11012. var p = i + (c = e[d + 7])
  11013. , f = i - c
  11014. , g = n + l
  11015. , m = n - l
  11016. , v = r + s
  11017. , y = r - s
  11018. , A = o + a
  11019. , C = o - a
  11020. , I = p + A
  11021. , E = p - A
  11022. , _ = g + v
  11023. , b = g - v;
  11024. e[d] = I + _,
  11025. e[d + 4] = I - _;
  11026. var w = .707106781 * (b + E);
  11027. e[d + 2] = E + w,
  11028. e[d + 6] = E - w;
  11029. var T = .382683433 * ((I = C + y) - (b = m + f))
  11030. , x = .5411961 * I + T
  11031. , S = 1.306562965 * b + T
  11032. , M = .707106781 * (_ = y + m)
  11033. , R = f + M
  11034. , P = f - M;
  11035. e[d + 5] = P + x,
  11036. e[d + 3] = P - x,
  11037. e[d + 1] = R + S,
  11038. e[d + 7] = R - S,
  11039. d += 8
  11040. }
  11041. for (h = d = 0; h < 8; ++h) {
  11042. i = e[d],
  11043. n = e[d + 8],
  11044. r = e[d + 16],
  11045. o = e[d + 24],
  11046. a = e[d + 32],
  11047. s = e[d + 40],
  11048. l = e[d + 48];
  11049. var O = i + (c = e[d + 56])
  11050. , L = i - c
  11051. , D = n + l
  11052. , N = n - l
  11053. , F = r + s
  11054. , B = r - s
  11055. , V = o + a
  11056. , k = o - a
  11057. , U = O + V
  11058. , H = O - V
  11059. , z = D + F
  11060. , G = D - F;
  11061. e[d] = U + z,
  11062. e[d + 32] = U - z;
  11063. var W = .707106781 * (G + H);
  11064. e[d + 16] = H + W,
  11065. e[d + 48] = H - W;
  11066. var j = .382683433 * ((U = k + B) - (G = N + L))
  11067. , Y = .5411961 * U + j
  11068. , q = 1.306562965 * G + j
  11069. , X = .707106781 * (z = B + N)
  11070. , Z = L + X
  11071. , K = L - X;
  11072. e[d + 40] = K + Y,
  11073. e[d + 24] = K - Y,
  11074. e[d + 8] = Z + q,
  11075. e[d + 56] = Z - q,
  11076. d++
  11077. }
  11078. for (h = 0; h < 64; ++h)
  11079. u = e[h] * t[h],
  11080. Q[h] = 0 < u ? .5 + u | 0 : u - .5 | 0;
  11081. return Q
  11082. }(e, t), c = 0; c < 64; ++c)
  11083. A[C[c]] = l[c];
  11084. var h = A[0] - i;
  11085. i = A[0],
  11086. 0 == h ? _(n[0]) : (_(n[y[o = 32767 + h]]),
  11087. _(v[o]));
  11088. for (var u = 63; 0 < u && 0 == A[u]; u--)
  11089. ;
  11090. if (0 == u)
  11091. return _(a),
  11092. i;
  11093. for (var d, p = 1; p <= u; ) {
  11094. for (var f = p; 0 == A[p] && p <= u; ++p)
  11095. ;
  11096. var g = p - f;
  11097. if (16 <= g) {
  11098. d = g >> 4;
  11099. for (var m = 1; m <= d; ++m)
  11100. _(s);
  11101. g &= 15
  11102. }
  11103. o = 32767 + A[p],
  11104. _(r[(g << 4) + y[o]]),
  11105. _(v[o]),
  11106. p++
  11107. }
  11108. return 63 != u && _(a),
  11109. i
  11110. }
  11111. function x(e) {
  11112. if (e <= 0 && (e = 1),
  11113. 100 < e && (e = 100),
  11114. i != e) {
  11115. (function(e) {
  11116. 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++) {
  11117. var n = u((t[i] * e + 50) / 100);
  11118. n < 1 ? n = 1 : 255 < n && (n = 255),
  11119. O[C[i]] = n
  11120. }
  11121. 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++) {
  11122. var a = u((r[o] * e + 50) / 100);
  11123. a < 1 ? a = 1 : 255 < a && (a = 255),
  11124. L[C[o]] = a
  11125. }
  11126. for (var s = [1, 1.387039845, 1.306562965, 1.175875602, 1, .785694958, .5411961, .275899379], l = 0, c = 0; c < 8; c++)
  11127. for (var h = 0; h < 8; h++)
  11128. D[l] = 1 / (O[C[l]] * s[c] * s[h] * 8),
  11129. N[l] = 1 / (L[C[l]] * s[c] * s[h] * 8),
  11130. l++
  11131. }
  11132. )(e < 50 ? Math.floor(5e3 / e) : Math.floor(200 - 2 * e)),
  11133. i = e
  11134. }
  11135. }
  11136. var S, M, R, P, i, u = (Math.round,
  11137. 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];
  11138. this.encode = function(e, t) {
  11139. var i = ((new Date).getTime(),
  11140. t.quality);
  11141. i && x(i),
  11142. F = new Array,
  11143. B = 0,
  11144. V = 7,
  11145. w(65496),
  11146. w(65504),
  11147. w(16),
  11148. b(74),
  11149. b(70),
  11150. b(73),
  11151. b(70),
  11152. b(0),
  11153. b(1),
  11154. b(1),
  11155. b(0),
  11156. w(1),
  11157. w(1),
  11158. b(0),
  11159. b(0),
  11160. function() {
  11161. w(65499),
  11162. w(132),
  11163. b(0);
  11164. for (var e = 0; e < 64; e++)
  11165. b(O[e]);
  11166. b(1);
  11167. for (var t = 0; t < 64; t++)
  11168. b(L[t])
  11169. }(),
  11170. function(e, t) {
  11171. w(65472),
  11172. w(17),
  11173. b(8),
  11174. w(t),
  11175. w(e),
  11176. b(3),
  11177. b(1),
  11178. b(17),
  11179. b(0),
  11180. b(2),
  11181. b(17),
  11182. b(1),
  11183. b(3),
  11184. b(17),
  11185. b(1)
  11186. }(e.width, e.height),
  11187. function() {
  11188. w(65476),
  11189. w(418),
  11190. b(0);
  11191. for (var e = 0; e < 16; e++)
  11192. b(G[e + 1]);
  11193. for (var t = 0; t <= 11; t++)
  11194. b(W[t]);
  11195. b(16);
  11196. for (var i = 0; i < 16; i++)
  11197. b(j[i + 1]);
  11198. for (var n = 0; n <= 161; n++)
  11199. b(Y[n]);
  11200. b(1);
  11201. for (var r = 0; r < 16; r++)
  11202. b(q[r + 1]);
  11203. for (var o = 0; o <= 11; o++)
  11204. b(X[o]);
  11205. b(17);
  11206. for (var a = 0; a < 16; a++)
  11207. b(Z[a + 1]);
  11208. for (var s = 0; s <= 161; s++)
  11209. b(K[s])
  11210. }(),
  11211. w(65498),
  11212. w(12),
  11213. b(3),
  11214. b(1),
  11215. b(0),
  11216. b(2),
  11217. b(17),
  11218. b(3),
  11219. b(17),
  11220. b(0),
  11221. b(63),
  11222. b(0);
  11223. var n = 0
  11224. , r = 0
  11225. , o = 0;
  11226. B = 0,
  11227. V = 7,
  11228. this.encode.displayName = "_encode_";
  11229. 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; ) {
  11230. for (a = 0; a < A; ) {
  11231. for (u = h = A * C + a,
  11232. d = -1,
  11233. f = p = 0; f < 64; f++)
  11234. u = h + (p = (y ? 63 - f : f) >> 3) * A + (d = 4 * (7 & f)),
  11235. v <= C + p && (u -= A * (C + 1 + p - v)),
  11236. A <= a + d && (u -= a + d - A + 4),
  11237. s = g[u++],
  11238. l = g[u++],
  11239. c = g[u++],
  11240. k[f] = (z[s] + z[l + 256 >> 0] + z[c + 512 >> 0] >> 16) - 128,
  11241. U[f] = (z[s + 768 >> 0] + z[l + 1024 >> 0] + z[c + 1280 >> 0] >> 16) - 128,
  11242. H[f] = (z[s + 1280 >> 0] + z[l + 1536 >> 0] + z[c + 1792 >> 0] >> 16) - 128;
  11243. n = T(k, D, n, S, R),
  11244. r = T(U, N, r, M, P),
  11245. o = T(H, N, o, M, P),
  11246. a += 32
  11247. }
  11248. C += I
  11249. }
  11250. if (0 <= V) {
  11251. var E = [];
  11252. E[1] = V + 1,
  11253. E[0] = (1 << V + 1) - 1,
  11254. _(E)
  11255. }
  11256. return w(65497),
  11257. new J(F)
  11258. }
  11259. ,
  11260. (new Date).getTime(),
  11261. e = e || 50,
  11262. function() {
  11263. for (var e = String.fromCharCode, t = 0; t < 256; t++)
  11264. n[t] = e(t)
  11265. }(),
  11266. S = t(G, W),
  11267. M = t(q, X),
  11268. R = t(j, Y),
  11269. P = t(Z, K),
  11270. function() {
  11271. for (var e = 1, t = 2, i = 1; i <= 15; i++) {
  11272. for (var n = e; n < t; n++)
  11273. y[32767 + n] = i,
  11274. v[32767 + n] = [],
  11275. v[32767 + n][1] = i,
  11276. v[32767 + n][0] = n;
  11277. for (var r = -(t - 1); r <= -e; r++)
  11278. y[32767 + r] = i,
  11279. v[32767 + r] = [],
  11280. v[32767 + r][1] = i,
  11281. v[32767 + r][0] = t - 1 + r;
  11282. e <<= 1,
  11283. t <<= 1
  11284. }
  11285. }(),
  11286. function() {
  11287. for (var e = 0; e < 256; e++)
  11288. z[e] = 19595 * e,
  11289. z[e + 256 >> 0] = 38470 * e,
  11290. z[e + 512 >> 0] = 7471 * e + 32768,
  11291. z[e + 768 >> 0] = -11059 * e,
  11292. z[e + 1024 >> 0] = -21709 * e,
  11293. z[e + 1280 >> 0] = 32768 * e + 8421375,
  11294. z[e + 1536 >> 0] = -27439 * e,
  11295. z[e + 1792 >> 0] = -5329 * e
  11296. }(),
  11297. x(e),
  11298. (new Date).getTime()
  11299. }
  11300. t.exports.encode = function(e, t) {
  11301. return (t = t || {}).quality = t.quality || 50,
  11302. {
  11303. data: new i(t.quality).encode(e, t),
  11304. width: e.width,
  11305. height: e.height
  11306. }
  11307. }
  11308. }
  11309. ).call(this, e("buffer").Buffer)
  11310. }
  11311. , {
  11312. buffer: 198
  11313. }],
  11314. 95: [function(e, t, i) {
  11315. "use strict";
  11316. !function() {
  11317. if ("performance"in window == 0 && (window.performance = {}),
  11318. Date.now = Date.now || function() {
  11319. return (new Date).getTime()
  11320. }
  11321. ,
  11322. "now"in window.performance == 0) {
  11323. var e = Date.now();
  11324. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  11325. window.performance.now = function() {
  11326. return Date.now() - e
  11327. }
  11328. }
  11329. }()
  11330. }
  11331. , {}],
  11332. 96: [function(e, t, i) {
  11333. "use strict";
  11334. var a = e("three");
  11335. a.EffectComposer = function(e, t) {
  11336. if (this.renderer = e,
  11337. void 0 === t) {
  11338. var i = {
  11339. minFilter: a.LinearFilter,
  11340. magFilter: a.LinearFilter,
  11341. format: a.RGBAFormat,
  11342. stencilBuffer: !1
  11343. }
  11344. , n = e.getSize();
  11345. t = new a.WebGLRenderTarget(n.width,n.height,i)
  11346. }
  11347. this.renderTarget1 = t,
  11348. this.renderTarget2 = t.clone(),
  11349. this.writeBuffer = this.renderTarget1,
  11350. this.readBuffer = this.renderTarget2,
  11351. this.passes = [],
  11352. void 0 === a.CopyShader && console.error("THREE.EffectComposer relies on THREE.CopyShader"),
  11353. this.copyPass = new a.ShaderPass(a.CopyShader)
  11354. }
  11355. ,
  11356. a.EffectComposer.prototype = {
  11357. swapBuffers: function() {
  11358. var e = this.readBuffer;
  11359. this.readBuffer = this.writeBuffer,
  11360. this.writeBuffer = e
  11361. },
  11362. addPass: function(e) {
  11363. this.passes.push(e)
  11364. },
  11365. insertPass: function(e, t) {
  11366. this.passes.splice(t, 0, e)
  11367. },
  11368. render: function(e) {
  11369. this.writeBuffer = this.renderTarget1,
  11370. this.readBuffer = this.renderTarget2;
  11371. var t, i, n = !1, r = this.passes.length;
  11372. for (i = 0; i < r; i++)
  11373. if ((t = this.passes[i]).enabled) {
  11374. if (t.render(this.renderer, this.writeBuffer, this.readBuffer, e, n),
  11375. t.needsSwap) {
  11376. if (n) {
  11377. var o = this.renderer.context;
  11378. o.stencilFunc(o.NOTEQUAL, 1, 4294967295),
  11379. this.copyPass.render(this.renderer, this.writeBuffer, this.readBuffer, e),
  11380. o.stencilFunc(o.EQUAL, 1, 4294967295)
  11381. }
  11382. this.swapBuffers()
  11383. }
  11384. t instanceof a.MaskPass ? n = !0 : t instanceof a.ClearMaskPass && (n = !1)
  11385. }
  11386. },
  11387. reset: function(e) {
  11388. if (void 0 === e) {
  11389. var t = this.renderer.getSize();
  11390. (e = this.renderTarget1.clone()).setSize(t.width, t.height)
  11391. }
  11392. this.renderTarget1.dispose(),
  11393. this.renderTarget2.dispose(),
  11394. this.renderTarget1 = e,
  11395. this.renderTarget2 = e.clone(),
  11396. this.writeBuffer = this.renderTarget1,
  11397. this.readBuffer = this.renderTarget2
  11398. },
  11399. setSize: function(e, t) {
  11400. this.renderTarget1.setSize(e, t),
  11401. this.renderTarget2.setSize(e, t)
  11402. }
  11403. }
  11404. }
  11405. , {
  11406. three: 217
  11407. }],
  11408. 97: [function(e, t, i) {
  11409. "use strict";
  11410. var n = e("three");
  11411. n.MaskPass = function(e, t) {
  11412. this.scene = e,
  11413. this.camera = t,
  11414. this.enabled = !0,
  11415. this.clear = !0,
  11416. this.needsSwap = !1,
  11417. this.inverse = !1
  11418. }
  11419. ,
  11420. n.MaskPass.prototype = {
  11421. render: function(e, t, i, n) {
  11422. var r, o, a = e.context;
  11423. a.colorMask(!1, !1, !1, !1),
  11424. a.depthMask(!1),
  11425. o = this.inverse ? (r = 0,
  11426. 1) : (r = 1,
  11427. 0),
  11428. a.enable(a.STENCIL_TEST),
  11429. a.stencilOp(a.REPLACE, a.REPLACE, a.REPLACE),
  11430. a.stencilFunc(a.ALWAYS, r, 4294967295),
  11431. a.clearStencil(o),
  11432. e.render(this.scene, this.camera, i, this.clear),
  11433. e.render(this.scene, this.camera, t, this.clear),
  11434. a.colorMask(!0, !0, !0, !0),
  11435. a.depthMask(!0),
  11436. a.stencilFunc(a.EQUAL, 1, 4294967295),
  11437. a.stencilOp(a.KEEP, a.KEEP, a.KEEP)
  11438. }
  11439. },
  11440. n.ClearMaskPass = function() {
  11441. this.enabled = !0
  11442. }
  11443. ,
  11444. n.ClearMaskPass.prototype = {
  11445. render: function(e, t, i, n) {
  11446. var r = e.context;
  11447. r.disable(r.STENCIL_TEST)
  11448. }
  11449. }
  11450. }
  11451. , {
  11452. three: 217
  11453. }],
  11454. 98: [function(e, t, i) {
  11455. "use strict";
  11456. var o = e("three");
  11457. o.RenderPass = function(e, t, i, n, r) {
  11458. this.scene = e,
  11459. this.camera = t,
  11460. this.overrideMaterial = i,
  11461. this.clearColor = n,
  11462. this.clearAlpha = void 0 !== r ? r : 1,
  11463. this.oldClearColor = new o.Color,
  11464. this.oldClearAlpha = 1,
  11465. this.enabled = !0,
  11466. this.clear = !0,
  11467. this.needsSwap = !1
  11468. }
  11469. ,
  11470. o.RenderPass.prototype = {
  11471. render: function(e, t, i, n) {
  11472. this.scene.overrideMaterial = this.overrideMaterial,
  11473. this.clearColor && (this.oldClearColor.copy(e.getClearColor()),
  11474. this.oldClearAlpha = e.getClearAlpha(),
  11475. e.setClearColor(this.clearColor, this.clearAlpha)),
  11476. e.render(this.scene, this.camera, i, this.clear),
  11477. this.clearColor && e.setClearColor(this.oldClearColor, this.oldClearAlpha),
  11478. this.scene.overrideMaterial = null
  11479. }
  11480. }
  11481. }
  11482. , {
  11483. three: 217
  11484. }],
  11485. 99: [function(e, t, i) {
  11486. "use strict";
  11487. var n = e("three");
  11488. n.ShaderPass = function(e, t) {
  11489. this.textureID = void 0 !== t ? t : "tDiffuse",
  11490. e instanceof n.ShaderMaterial ? (this.uniforms = e.uniforms,
  11491. this.material = e) : e && (this.uniforms = n.UniformsUtils.clone(e.uniforms),
  11492. this.material = new n.ShaderMaterial({
  11493. defines: e.defines || {},
  11494. uniforms: this.uniforms,
  11495. vertexShader: e.vertexShader,
  11496. fragmentShader: e.fragmentShader
  11497. })),
  11498. this.renderToScreen = !1,
  11499. this.enabled = !0,
  11500. this.needsSwap = !0,
  11501. this.clear = !1,
  11502. this.camera = new n.OrthographicCamera(-1,1,1,-1,0,1),
  11503. this.scene = new n.Scene,
  11504. this.quad = new n.Mesh(new n.PlaneBufferGeometry(2,2),null),
  11505. this.scene.add(this.quad)
  11506. }
  11507. ,
  11508. n.ShaderPass.prototype = {
  11509. render: function(e, t, i, n) {
  11510. this.uniforms[this.textureID] && (this.uniforms[this.textureID].value = i),
  11511. this.quad.material = this.material,
  11512. this.renderToScreen ? e.render(this.scene, this.camera) : e.render(this.scene, this.camera, t, this.clear)
  11513. }
  11514. }
  11515. }
  11516. , {
  11517. three: 217
  11518. }],
  11519. 100: [function(e, t, i) {
  11520. "use strict";
  11521. e("three").CopyShader = {
  11522. uniforms: {
  11523. tDiffuse: {
  11524. type: "t",
  11525. value: null
  11526. },
  11527. opacity: {
  11528. type: "f",
  11529. value: 1
  11530. }
  11531. },
  11532. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11533. fragmentShader: ["uniform float opacity;", "uniform sampler2D tDiffuse;", "varying vec2 vUv;", "void main() {", "vec4 texel = texture2D( tDiffuse, vUv );", "gl_FragColor = opacity * texel;", "}"].join("\n")
  11534. }
  11535. }
  11536. , {
  11537. three: 217
  11538. }],
  11539. 101: [function(e, t, i) {
  11540. "use strict";
  11541. e("three").HorizontalBlurShader = {
  11542. uniforms: {
  11543. tDiffuse: {
  11544. type: "t",
  11545. value: null
  11546. },
  11547. h: {
  11548. type: "f",
  11549. value: 1 / 512
  11550. }
  11551. },
  11552. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11553. 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")
  11554. }
  11555. }
  11556. , {
  11557. three: 217
  11558. }],
  11559. 102: [function(e, t, i) {
  11560. "use strict";
  11561. e("three").VerticalBlurShader = {
  11562. uniforms: {
  11563. tDiffuse: {
  11564. type: "t",
  11565. value: null
  11566. },
  11567. v: {
  11568. type: "f",
  11569. value: 1 / 512
  11570. }
  11571. },
  11572. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11573. 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")
  11574. }
  11575. }
  11576. , {
  11577. three: 217
  11578. }],
  11579. 103: [function(e, t, i) {
  11580. "use strict";
  11581. var z = e("three");
  11582. !function() {
  11583. if ("performance"in window == 0 && (window.performance = {}),
  11584. "now"in window.performance == 0) {
  11585. var e = Date.now();
  11586. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  11587. window.performance.now = function() {
  11588. return Date.now() - e
  11589. }
  11590. }
  11591. }(),
  11592. z.WebGLRenderer.prototype.paramThreeToGL = function(e) {
  11593. var t, i = this.extensions, n = this.context;
  11594. if (e === z.RepeatWrapping)
  11595. return n.REPEAT;
  11596. if (e === z.ClampToEdgeWrapping)
  11597. return n.CLAMP_TO_EDGE;
  11598. if (e === z.MirroredRepeatWrapping)
  11599. return n.MIRRORED_REPEAT;
  11600. if (e === z.NearestFilter)
  11601. return n.NEAREST;
  11602. if (e === z.NearestMipMapNearestFilter)
  11603. return n.NEAREST_MIPMAP_NEAREST;
  11604. if (e === z.NearestMipMapLinearFilter)
  11605. return n.NEAREST_MIPMAP_LINEAR;
  11606. if (e === z.LinearFilter)
  11607. return n.LINEAR;
  11608. if (e === z.LinearMipMapNearestFilter)
  11609. return n.LINEAR_MIPMAP_NEAREST;
  11610. if (e === z.LinearMipMapLinearFilter)
  11611. return n.LINEAR_MIPMAP_LINEAR;
  11612. if (e === z.UnsignedByteType)
  11613. return n.UNSIGNED_BYTE;
  11614. if (e === z.UnsignedShort4444Type)
  11615. return n.UNSIGNED_SHORT_4_4_4_4;
  11616. if (e === z.UnsignedShort5551Type)
  11617. return n.UNSIGNED_SHORT_5_5_5_1;
  11618. if (e === z.UnsignedShort565Type)
  11619. return n.UNSIGNED_SHORT_5_6_5;
  11620. if (e === z.ByteType)
  11621. return n.BYTE;
  11622. if (e === z.ShortType)
  11623. return n.SHORT;
  11624. if (e === z.UnsignedShortType)
  11625. return n.UNSIGNED_SHORT;
  11626. if (e === z.IntType)
  11627. return n.INT;
  11628. if (e === z.UnsignedIntType)
  11629. return n.UNSIGNED_INT;
  11630. if (e === z.FloatType)
  11631. return n.FLOAT;
  11632. if (null !== (t = i.get("OES_texture_half_float")) && e === z.HalfFloatType)
  11633. return t.HALF_FLOAT_OES;
  11634. if (e === z.AlphaFormat)
  11635. return n.ALPHA;
  11636. if (e === z.RGBFormat)
  11637. return n.RGB;
  11638. if (e === z.RGBAFormat)
  11639. return n.RGBA;
  11640. if (e === z.LuminanceFormat)
  11641. return n.LUMINANCE;
  11642. if (e === z.LuminanceAlphaFormat)
  11643. return n.LUMINANCE_ALPHA;
  11644. if (e === z.AddEquation)
  11645. return n.FUNC_ADD;
  11646. if (e === z.SubtractEquation)
  11647. return n.FUNC_SUBTRACT;
  11648. if (e === z.ReverseSubtractEquation)
  11649. return n.FUNC_REVERSE_SUBTRACT;
  11650. if (e === z.ZeroFactor)
  11651. return n.ZERO;
  11652. if (e === z.OneFactor)
  11653. return n.ONE;
  11654. if (e === z.SrcColorFactor)
  11655. return n.SRC_COLOR;
  11656. if (e === z.OneMinusSrcColorFactor)
  11657. return n.ONE_MINUS_SRC_COLOR;
  11658. if (e === z.SrcAlphaFactor)
  11659. return n.SRC_ALPHA;
  11660. if (e === z.OneMinusSrcAlphaFactor)
  11661. return n.ONE_MINUS_SRC_ALPHA;
  11662. if (e === z.DstAlphaFactor)
  11663. return n.DST_ALPHA;
  11664. if (e === z.OneMinusDstAlphaFactor)
  11665. return n.ONE_MINUS_DST_ALPHA;
  11666. if (e === z.DstColorFactor)
  11667. return n.DST_COLOR;
  11668. if (e === z.OneMinusDstColorFactor)
  11669. return n.ONE_MINUS_DST_COLOR;
  11670. if (e === z.SrcAlphaSaturateFactor)
  11671. return n.SRC_ALPHA_SATURATE;
  11672. if (null !== (t = i.get("WEBGL_compressed_texture_s3tc"))) {
  11673. if (e === z.RGB_S3TC_DXT1_Format)
  11674. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  11675. if (e === z.RGBA_S3TC_DXT1_Format)
  11676. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  11677. if (e === z.RGBA_S3TC_DXT3_Format)
  11678. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  11679. if (e === z.RGBA_S3TC_DXT5_Format)
  11680. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  11681. }
  11682. if (null !== (t = i.get("WEBGL_compressed_texture_pvrtc"))) {
  11683. if (e === z.RGB_PVRTC_4BPPV1_Format)
  11684. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  11685. if (e === z.RGB_PVRTC_2BPPV1_Format)
  11686. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  11687. if (e === z.RGBA_PVRTC_4BPPV1_Format)
  11688. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  11689. if (e === z.RGBA_PVRTC_2BPPV1_Format)
  11690. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  11691. }
  11692. if (null !== (t = i.get("WEBGL_compressed_texture_etc1")) && e === z.RGB_ETC1_Format)
  11693. return t.COMPRESSED_RGB_ETC1_WEBGL;
  11694. if (null !== (t = i.get("EXT_blend_minmax"))) {
  11695. if (e === z.MinEquation)
  11696. return t.MIN_EXT;
  11697. if (e === z.MaxEquation)
  11698. return t.MAX_EXT
  11699. }
  11700. return 0
  11701. }
  11702. ,
  11703. z.WebGLState = function(l, i, c) {
  11704. var n = this
  11705. , r = new z.Vector4
  11706. , e = l.getParameter(l.MAX_VERTEX_ATTRIBS)
  11707. , o = new Uint8Array(e)
  11708. , a = new Uint8Array(e)
  11709. , s = new Uint8Array(e)
  11710. , t = {}
  11711. , h = null
  11712. , u = null
  11713. , d = null
  11714. , p = null
  11715. , f = null
  11716. , g = null
  11717. , m = null
  11718. , v = null
  11719. , y = !1
  11720. , A = null
  11721. , C = null
  11722. , I = null
  11723. , E = null
  11724. , _ = null
  11725. , b = null
  11726. , w = null
  11727. , T = null
  11728. , x = null
  11729. , S = null
  11730. , M = null
  11731. , R = null
  11732. , P = null
  11733. , O = null
  11734. , L = null
  11735. , D = l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS)
  11736. , N = void 0
  11737. , F = {}
  11738. , B = new z.Vector4
  11739. , V = null
  11740. , k = null
  11741. , U = new z.Vector4
  11742. , H = new z.Vector4;
  11743. this.init = function() {
  11744. this.clearColor(0, 0, 0, 1),
  11745. this.clearDepth(1),
  11746. this.clearStencil(0),
  11747. this.enable(l.DEPTH_TEST),
  11748. l.depthFunc(l.LEQUAL),
  11749. l.frontFace(l.CCW),
  11750. l.cullFace(l.BACK),
  11751. this.enable(l.CULL_FACE),
  11752. this.enable(l.BLEND),
  11753. l.blendEquation(l.FUNC_ADD),
  11754. l.blendFunc(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA)
  11755. }
  11756. ,
  11757. this.initAttributes = function() {
  11758. for (var e = 0, t = o.length; e < t; e++)
  11759. o[e] = 0
  11760. }
  11761. ,
  11762. this.enableAttribute = function(e) {
  11763. o[e] = 1,
  11764. 0 === a[e] && (l.enableVertexAttribArray(e),
  11765. a[e] = 1),
  11766. 0 !== s[e] && (i.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(e, 0),
  11767. s[e] = 0)
  11768. }
  11769. ,
  11770. this.enableAttributeAndDivisor = function(e, t, i) {
  11771. o[e] = 1,
  11772. 0 === a[e] && (l.enableVertexAttribArray(e),
  11773. a[e] = 1),
  11774. s[e] !== t && (i.vertexAttribDivisorANGLE(e, t),
  11775. s[e] = t)
  11776. }
  11777. ,
  11778. this.disableUnusedAttributes = function() {
  11779. for (var e = 0, t = a.length; e < t; e++)
  11780. a[e] !== o[e] && (l.disableVertexAttribArray(e),
  11781. a[e] = 0)
  11782. }
  11783. ,
  11784. this.enable = function(e) {
  11785. !0 !== t[e] && (l.enable(e),
  11786. t[e] = !0)
  11787. }
  11788. ,
  11789. this.disable = function(e) {
  11790. !1 !== t[e] && (l.disable(e),
  11791. t[e] = !1)
  11792. }
  11793. ,
  11794. this.getCompressedTextureFormats = function() {
  11795. if (null === h && (h = [],
  11796. i.get("WEBGL_compressed_texture_pvrtc") || i.get("WEBGL_compressed_texture_s3tc") || i.get("WEBGL_compressed_texture_etc1")))
  11797. for (var e = l.getParameter(l.COMPRESSED_TEXTURE_FORMATS), t = 0; t < e.length; t++)
  11798. h.push(e[t]);
  11799. return h
  11800. }
  11801. ,
  11802. this.setBlending = function(e, t, i, n, r, o, a, s) {
  11803. e === z.NoBlending ? this.disable(l.BLEND) : this.enable(l.BLEND),
  11804. e === u && s === y || (e === z.AdditiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  11805. l.blendFuncSeparate(l.ONE, l.ONE, l.ONE, l.ONE)) : (l.blendEquation(l.FUNC_ADD),
  11806. l.blendFunc(l.SRC_ALPHA, l.ONE)) : e === z.SubtractiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  11807. l.blendFuncSeparate(l.ZERO, l.ZERO, l.ONE_MINUS_SRC_COLOR, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  11808. l.blendFunc(l.ZERO, l.ONE_MINUS_SRC_COLOR)) : e === z.MultiplyBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  11809. l.blendFuncSeparate(l.ZERO, l.ZERO, l.SRC_COLOR, l.SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  11810. l.blendFunc(l.ZERO, l.SRC_COLOR)) : s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  11811. l.blendFuncSeparate(l.ONE, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  11812. l.blendFuncSeparate(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)),
  11813. u = e,
  11814. y = s),
  11815. e === z.CustomBlending ? (r = r || t,
  11816. o = o || i,
  11817. a = a || n,
  11818. t === d && r === g || (l.blendEquationSeparate(c(t), c(r)),
  11819. d = t,
  11820. g = r),
  11821. i === p && n === f && o === m && a === v || (l.blendFuncSeparate(c(i), c(n), c(o), c(a)),
  11822. p = i,
  11823. f = n,
  11824. m = o,
  11825. v = a)) : v = m = g = f = p = d = null
  11826. }
  11827. ,
  11828. this.setDepthFunc = function(e) {
  11829. if (A !== e) {
  11830. if (e)
  11831. switch (e) {
  11832. case z.NeverDepth:
  11833. l.depthFunc(l.NEVER);
  11834. break;
  11835. case z.AlwaysDepth:
  11836. l.depthFunc(l.ALWAYS);
  11837. break;
  11838. case z.LessDepth:
  11839. l.depthFunc(l.LESS);
  11840. break;
  11841. case z.LessEqualDepth:
  11842. l.depthFunc(l.LEQUAL);
  11843. break;
  11844. case z.EqualDepth:
  11845. l.depthFunc(l.EQUAL);
  11846. break;
  11847. case z.GreaterEqualDepth:
  11848. l.depthFunc(l.GEQUAL);
  11849. break;
  11850. case z.GreaterDepth:
  11851. l.depthFunc(l.GREATER);
  11852. break;
  11853. case z.NotEqualDepth:
  11854. l.depthFunc(l.NOTEQUAL);
  11855. break;
  11856. default:
  11857. l.depthFunc(l.LEQUAL)
  11858. }
  11859. else
  11860. l.depthFunc(l.LEQUAL);
  11861. A = e
  11862. }
  11863. }
  11864. ,
  11865. this.setDepthTest = function(e) {
  11866. e ? this.enable(l.DEPTH_TEST) : this.disable(l.DEPTH_TEST)
  11867. }
  11868. ,
  11869. this.setDepthWrite = function(e) {
  11870. C !== e && (l.depthMask(e),
  11871. C = e)
  11872. }
  11873. ,
  11874. this.setColorWrite = function(e) {
  11875. I !== e && (l.colorMask(e, e, e, e),
  11876. I = e)
  11877. }
  11878. ,
  11879. this.setStencilFunc = function(e, t, i) {
  11880. _ === e && b === t && w === i || (l.stencilFunc(e, t, i),
  11881. _ = e,
  11882. b = t,
  11883. w = i)
  11884. }
  11885. ,
  11886. this.setStencilOp = function(e, t, i) {
  11887. T === e && x === t && S === i || (l.stencilOp(e, t, i),
  11888. T = e,
  11889. x = t,
  11890. S = i)
  11891. }
  11892. ,
  11893. this.setStencilTest = function(e) {
  11894. e ? this.enable(l.STENCIL_TEST) : this.disable(l.STENCIL_TEST)
  11895. }
  11896. ,
  11897. this.setStencilWrite = function(e) {
  11898. E !== e && (l.stencilMask(e),
  11899. E = e)
  11900. }
  11901. ,
  11902. this.setFlipSided = function(e) {
  11903. M !== e && (e ? l.frontFace(l.CW) : l.frontFace(l.CCW),
  11904. M = e)
  11905. }
  11906. ,
  11907. this.setLineWidth = function(e) {
  11908. e !== R && (l.lineWidth(e),
  11909. R = e)
  11910. }
  11911. ,
  11912. this.setPolygonOffset = function(e, t, i) {
  11913. e ? this.enable(l.POLYGON_OFFSET_FILL) : this.disable(l.POLYGON_OFFSET_FILL),
  11914. !e || P === t && O === i || (l.polygonOffset(t, i),
  11915. P = t,
  11916. O = i)
  11917. }
  11918. ,
  11919. this.getScissorTest = function() {
  11920. return L
  11921. }
  11922. ,
  11923. this.setScissorTest = function(e) {
  11924. (L = e) ? this.enable(l.SCISSOR_TEST) : this.disable(l.SCISSOR_TEST)
  11925. }
  11926. ,
  11927. this.activeTexture = function(e) {
  11928. void 0 === e && (e = l.TEXTURE0 + D - 1),
  11929. N !== e && (l.activeTexture(e),
  11930. N = e)
  11931. }
  11932. ,
  11933. this.bindTexture = function(e, t) {
  11934. void 0 === N && n.activeTexture();
  11935. var i = F[N];
  11936. void 0 === i && (i = {
  11937. type: void 0,
  11938. texture: void 0
  11939. },
  11940. F[N] = i),
  11941. i.type === e && i.texture === t || (l.bindTexture(e, t),
  11942. i.type = e,
  11943. i.texture = t)
  11944. }
  11945. ,
  11946. this.compressedTexImage2D = function() {
  11947. try {
  11948. l.compressedTexImage2D.apply(l, arguments)
  11949. } catch (e) {
  11950. console.error(e)
  11951. }
  11952. }
  11953. ,
  11954. this.texImage2D = function() {
  11955. try {
  11956. l.texImage2D.apply(l, arguments)
  11957. } catch (e) {
  11958. console.error(e)
  11959. }
  11960. }
  11961. ,
  11962. this.clearColor = function(e, t, i, n) {
  11963. r.set(e, t, i, n),
  11964. !1 === B.equals(r) && (l.clearColor(e, t, i, n),
  11965. B.copy(r))
  11966. }
  11967. ,
  11968. this.clearDepth = function(e) {
  11969. V !== e && (l.clearDepth(e),
  11970. V = e)
  11971. }
  11972. ,
  11973. this.clearStencil = function(e) {
  11974. k !== e && (l.clearStencil(e),
  11975. k = e)
  11976. }
  11977. ,
  11978. this.scissor = function(e) {
  11979. !1 === U.equals(e) && (l.scissor(e.x, e.y, e.z, e.w),
  11980. U.copy(e))
  11981. }
  11982. ,
  11983. this.viewport = function(e) {
  11984. !1 === H.equals(e) && (l.viewport(e.x, e.y, e.z, e.w),
  11985. H.copy(e))
  11986. }
  11987. ,
  11988. this.reset = function() {
  11989. for (var e = 0; e < a.length; e++)
  11990. 1 === a[e] && (l.disableVertexAttribArray(e),
  11991. a[e] = 0);
  11992. t = {},
  11993. N = void 0,
  11994. F = {},
  11995. M = E = C = I = u = h = null
  11996. }
  11997. }
  11998. }
  11999. , {
  12000. three: 217
  12001. }],
  12002. 104: [function(a, h, e) {
  12003. (function(i, e) {
  12004. "use strict";
  12005. function t(e) {
  12006. this.urls = e;
  12007. var t = i("bWVzc2FnZSBiaW5hcnlfbWVzaCB7CglyZXBlYXRlZCBjaHVua19zaW1wbGUgY2h1bmsgPSAxOwoJcmVwZWF0ZWQgY2h1bmtfcXVhbnRpemVkIHF1YW50aXplZF9jaHVuayA9IDI7Cn0KCi8vIERlZmluaXRpb24gb2YgdmVydGljZXM6IDNEIGNvb3JkaW5hdGVzLCBhbmQgMkQgdGV4dHVyZSBjb29yZGluYXRlcy4KbWVzc2FnZSB2ZXJ0aWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgZmxvYXQgeHl6ID0gMSBbcGFja2VkPXRydWVdOyAgLy8geF8wLHlfMCx6XzAsIHhfMSx5XzEsel8xLCAuLi4KCXJlcGVhdGVkIGZsb2F0IHV2ID0gMiBbcGFja2VkPXRydWVdOyAgLy8gdV8wLHZfMCwgdV8xLHZfMSwgLi4uCn0KCi8vIEluZGV4ZXMgb2YgdmVydGljZXMgb2YgZmFjZXMKbWVzc2FnZSBmYWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgdWludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgovLyBBIHNpbXBseSBlbmNvZGVkIGNodW5rLgovLyBUT0RPOiBhZGQgY2h1bmsgcHJvcGVyaXRlcyAoc3VjaCBhcyAicmVmbGVjdGl2ZSIpCm1lc3NhZ2UgY2h1bmtfc2ltcGxlIHsKCW9wdGlvbmFsIHZlcnRpY2VzX3NpbXBsZSB2ZXJ0aWNlcyA9IDE7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSAyOwoJb3B0aW9uYWwgc3RyaW5nIGNodW5rX25hbWUgPSAzOwoJb3B0aW9uYWwgc3RyaW5nIG1hdGVyaWFsX25hbWUgPSA0Owp9CgovLyBRdWFudGl6ZWQgdmVyc2lvbnMgZm9sbG93OgptZXNzYWdlIHZlcnRpY2VzX3F1YW50aXplZCB7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAxOwoJcmVwZWF0ZWQgZmxvYXQgdHJhbnNsYXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHggPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgeSA9IDQgW3BhY2tlZD10cnVlXTsKCXJlcGVhdGVkIHNpbnQzMiB6ID0gNSBbcGFja2VkPXRydWVdOwp9CgptZXNzYWdlIHV2X3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgbmFtZSA9IDE7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHUgPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgdiA9IDQgW3BhY2tlZD10cnVlXTsKfQoKLy8gSW5kZXhlcyBvZiB2ZXJ0aWNlcyBvZiBmYWNlcwptZXNzYWdlIGZhY2VzX2NvbXByZXNzZWQgewoJcmVwZWF0ZWQgc2ludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgptZXNzYWdlIGNodW5rX3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgY2h1bmtfbmFtZSA9IDE7CglvcHRpb25hbCBzdHJpbmcgbWF0ZXJpYWxfbmFtZSA9IDI7CglvcHRpb25hbCB2ZXJ0aWNlc19xdWFudGl6ZWQgdmVydGljZXMgPSAzOwoJcmVwZWF0ZWQgdXZfcXVhbnRpemVkIHV2cyA9IDQ7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSA1Owp9Cg==", "base64");
  12008. this.builder = n.loadProto(t),
  12009. this.decoder = this.builder.build("binary_mesh")
  12010. }
  12011. var s = a("three")
  12012. , n = a("protobufjs")
  12013. , r = a("../util/logger")
  12014. , o = (a("../util/common"),
  12015. a("../util/ajax"))
  12016. , l = a("../objects/Chunk")
  12017. , c = new r(e);
  12018. t.prototype = {
  12019. constructor: t,
  12020. load: function(t, i, n, r) {
  12021. return c.time("download"),
  12022. o.get(t, {
  12023. responseType: "arraybuffer"
  12024. }).done(function(e) {
  12025. c.timeEnd("download"),
  12026. this.parse(e, t, i, n, r)
  12027. }
  12028. .bind(this)).fail(r)
  12029. },
  12030. parse: function(e, t, i, n, r) {
  12031. var o = this.readProtobuf(e);
  12032. if (!o)
  12033. return r();
  12034. try {
  12035. c.time("convert to webgl"),
  12036. this.convertProtobufToSceneObject(o, t, i, n, r),
  12037. c.timeEnd("convert to webgl")
  12038. } catch (e) {
  12039. return c.error("failed parsing .dam"),
  12040. c.error(e.message),
  12041. r()
  12042. }
  12043. },
  12044. readProtobuf: function(e) {
  12045. var t;
  12046. try {
  12047. c.time("parse proto"),
  12048. t = this.decoder.decode(e),
  12049. c.timeEnd("parse proto")
  12050. } catch (e) {
  12051. return c.error("failed parsing proto for .dam"),
  12052. c.error(e.message),
  12053. null
  12054. }
  12055. return t
  12056. },
  12057. convertProtobufToSceneObject: function(e, i, t, n, r) {
  12058. if (0 === e.chunk.length)
  12059. return c.warn("No chunks in damfile..."),
  12060. t([]);
  12061. var o = new s.Matrix4;
  12062. o.set(1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1);
  12063. var a = e.chunk.map(function(e) {
  12064. var t = new s.BufferGeometry;
  12065. return t.addAttribute("position", new s.BufferAttribute(new Float32Array(e.vertices.xyz,0,3),3)),
  12066. 0 < e.vertices.uv.length && t.addAttribute("uv", new s.BufferAttribute(new Float32Array(e.vertices.uv,0,2),2)),
  12067. t.setIndex(new s.BufferAttribute(new Uint32Array(e.faces.faces,0,1),1)),
  12068. t.applyMatrix(o),
  12069. t.computeBoundingBox(),
  12070. new l({
  12071. geometry: t,
  12072. textureName: e.material_name,
  12073. name: e.chunk_name,
  12074. meshUrl: i
  12075. })
  12076. });
  12077. return a ? t(a) : (c.error(".dam protobuf came out with no chunks..."),
  12078. r())
  12079. }
  12080. },
  12081. h.exports = t
  12082. }
  12083. ).call(this, a("buffer").Buffer, "/js/loaders/DamLoader.js")
  12084. }
  12085. , {
  12086. "../objects/Chunk": 144,
  12087. "../util/ajax": 181,
  12088. "../util/common": 185,
  12089. "../util/logger": 189,
  12090. buffer: 198,
  12091. protobufjs: 214,
  12092. three: 217
  12093. }],
  12094. 105: [function(n, r, e) {
  12095. (function(e) {
  12096. "use strict";
  12097. var t = (n("three"),
  12098. n("../settings"),
  12099. n("../util/browser"),
  12100. n("./DamLoader"))
  12101. , i = n("../util/logger")
  12102. , u = (n("../ab"),
  12103. new i(e));
  12104. r.exports = {
  12105. getLoaders: function() {
  12106. return [["_50k", ".dam", t], ["", ".dam", t]]
  12107. },
  12108. load: function(e, t, i, n, r, o) {
  12109. var a = this.getLoaders()[o = o || 0];
  12110. if (a) {
  12111. var s = a[0]
  12112. , l = a[1]
  12113. , c = new a[2](t)
  12114. , h = t.get(e + s + l);
  12115. h ? (u.debug("Trying " + s + l),
  12116. c.load(h, i, n, function() {
  12117. this.load(e, t, i, n, r, ++o)
  12118. }
  12119. .bind(this))) : (u.debug("Skipping " + l + ", not available"),
  12120. this.load(e, t, i, n, r, ++o))
  12121. } else
  12122. r && r("No suitable model file found...")
  12123. }
  12124. }
  12125. }
  12126. ).call(this, "/js/loaders/ModelLoader.js")
  12127. }
  12128. , {
  12129. "../ab": 3,
  12130. "../settings": 166,
  12131. "../util/browser": 182,
  12132. "../util/logger": 189,
  12133. "./DamLoader": 104,
  12134. three: 217
  12135. }],
  12136. 106: [function(i, n, e) {
  12137. (function(e) {
  12138. "use strict";
  12139. var l = i("../util/common")
  12140. , c = i("../util/texture")
  12141. , h = i("../util/browser")
  12142. , t = i("../util/logger")
  12143. , u = i("../settings")
  12144. , d = new t(e);
  12145. n.exports = {
  12146. load: function(i, n) {
  12147. if (!i.chunks[0] || !i.chunks[0].meshUrl)
  12148. return $.when();
  12149. var r = l.countUnique(i.chunks.map(function(e) {
  12150. return e.textureName
  12151. }))
  12152. , e = -1 !== i.chunks[0].meshUrl.indexOf("_50k") ? "_50k" : ""
  12153. , t = "_50k" == e ? "high" : "low";
  12154. u.minimalMemoryMode && "high" === t && (h.detectSamsungS6() ? (d.warn("Galaxy S6 cannot handle large textures, turning down quality."),
  12155. t = "low") : r > u.maxMobileTextures && (d.warn("Model probably too large for mobile, turning down quality."),
  12156. t = "low"));
  12157. var o = i.data.job.uuid + e + "_texture_jpg_" + t + "/"
  12158. , a = $.Deferred()
  12159. , s = 0;
  12160. return i.chunks.forEach(function(e) {
  12161. if (!e.material.map && e.textureName) {
  12162. var t = i.urls.get(o + e.textureName);
  12163. e.setTextureMap(c.load(t, function(e, t) {
  12164. e || (n.push(t),
  12165. s++,
  12166. a.notify(s, r),
  12167. s === r && a.resolve())
  12168. }
  12169. .bind(this, c.isLoaded(t))))
  12170. }
  12171. }),
  12172. a.promise()
  12173. }
  12174. }
  12175. }
  12176. ).call(this, "/js/loaders/ModelTextureLoader.js")
  12177. }
  12178. , {
  12179. "../settings": 166,
  12180. "../util/browser": 182,
  12181. "../util/common": 185,
  12182. "../util/logger": 189,
  12183. "../util/texture": 194
  12184. }],
  12185. 107: [function(s, l, e) {
  12186. (function(n, e) {
  12187. "use strict";
  12188. function t(e) {
  12189. this.model = e,
  12190. this.modelDataPath = this.model.urls.get("vision.modeldata")+"?m="+new Date().getTime(),
  12191. this.sweepLocationsPath = this.model.urls.get("sweep_locations.csv");
  12192. var t = n("Ly8gUHJvdG9jb2wgQnVmZmVyIGZvciBwdWNrIHZpc2liaWxpdHkgYW5kIHJlbGF0ZWQgZGF0YQovLwovLyBUbyBkdW1wIG91dCBhIGJpbnJheSBtYW5pZmVzdCBpbiB0ZXh0IGZvcm1hdCwgeW91IGNhbiB1c2UgcHJvdG9jIGRpcmVjdGx5OgovLyAgIHByb3RvYyAtLXByb3RvX3BhdGggfi9kZXYvbXBfdmlzaW9uLyAgLS1kZWNvZGU9ZW9zLnN0b3JhZ2UuVmlzaW9uTW9kZWxkYXRhIH4vZGV2L21wX3Zpc2lvbi9lb3Mvc3RvcmFnZS92aXNpb25fbW9kZWxkYXRhLnByb3RvIDwgdmlzaW9uLm1vZGVsZGF0YQoKLy8gcGFja2FnZSBlb3Muc3RvcmFnZTsKCi8vIGltcG9ydCAiZW9zL2luZnJhL2NvbW1vbi5wcm90byI7Ci8vIFRoZSBmb2xsb3dpbmcgd2VyZSBtYW51YWxseSBleHRyYWN0ZWQgaGVyZSwgSlMgZG9lcyBub3QgbGlrZSBwcm90b2J1ZiBpbXBvcnRzCgptZXNzYWdlIEFmZmluZTNmIHsKCW9wdGlvbmFsIFF1YXRlcm5pb25mIHJvdGF0aW9uID0gMTsKCW9wdGlvbmFsIFZlY3RvcjNmIHRyYW5zbGF0aW9uID0gMjsKfQoKbWVzc2FnZSBRdWF0ZXJuaW9uZiB7CglvcHRpb25hbCBmbG9hdCB3ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHggPSAyOwoJb3B0aW9uYWwgZmxvYXQgeSA9IDM7CglvcHRpb25hbCBmbG9hdCB6ID0gNDsKfQoKbWVzc2FnZSBWZWN0b3IzZiB7CglvcHRpb25hbCBmbG9hdCB4ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHkgPSAyOwoJb3B0aW9uYWwgZmxvYXQgeiA9IDM7Cn0KCi8vCi8vIE9uZSBzd2VlcCAvIHBhbm8KLy8KbWVzc2FnZSBTd2VlcExvY2F0aW9uIHsKCW9wdGlvbmFsIGJ5dGVzIHV1aWQgPSAxOyAgLyogdXVpZCAqLwoJb3B0aW9uYWwgQWZmaW5lM2YgcG9zZSA9IDI7ICAvKiBjYW1lcmEgcG9zZSAoeCwgeSx6KSBpbiBtZXRlciBhbmQgYSBxdWF0ZXJuaW9uKi8KCW9wdGlvbmFsIFZlY3RvcjNmIHB1Y2sgPSAzOyAgLyogcHVjayBsb2NhdGlvbiAtIHggYW55IGlzIGdlbmVyYWxseSB0aGUgc2FtZSBhcyBwb3NlLCB6IGlzIHRoZSBoZWlnaHQgb2YgdGhlIGNsb3Nlc3QgZmxvb3IgdW5kZXIgdGhlIGNhbWVyYSAqLwoJb3B0aW9uYWwgaW50MzIgZ3JvdXAgPSA0OyAgLyogZmxvb3IgaW5kZXggKi8KCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gNTsgIC8qIHJvb20gaW5kZXggKi8KCXJlcGVhdGVkIGludDMyIHZpc2libGVzID0gNjsgIC8qIGxpc3Qgb2YgaW5kaWNlcyB0byBhbGwgcHVja3MgdmlzaWJsZSBmcm9tIHRoaXMgcHVjayAqLwoJcmVwZWF0ZWQgZmxvYXQgc2NvcmVzID0gNzsgLyogdXNlZCBhcyBwYXJ0IG9mIHNjb3JpbmcgZnVuY3Rpb24gZm9yIGRldGVybWluaW5nIHdoaWNoIHB1Y2sgdG8gZ28gdG8gbmV4dCAqLwogIG9wdGlvbmFsIHN0cmluZyBzd2VlcF9uYW1lID0gODsKCiAgLy8gV2l0aCBvdXRkb29yIHBhbm9zLCB3ZSBoYXZlIGEgY291cGxlIG9mIGRpZmZlcmVudCBzaXR1YXRpb25zIGZvciBhbGlnbm1lbnQuIFRoZSBjb21tb24KICAvLyBjYXNlIGlzIHRoYXQgdGhlIHBhbm8gYWxpZ25lZCBub3JtYWxseS4gSXQgY291bGQgYWxzbyBoYXZlIGJlZW4gcGxhY2VkIG1hbnVhbGx5IGluCiAgLy8gQ2FwdHVyZUFwcCBvciBXb3Jrc2hvcCwgb3IgbGVmdCB1bmFsaWduZWQgZm9yIGhpZ2hsaWdodC1yZWVsIHZpZXdpbmcuCiAgZW51bSBBbGlnbm1lbnRUeXBlCiAgewogICAgICBVTktOT1dOID0gMDsKICAgICAgQUxJR05FRCA9IDE7CiAgICAgIFVOQUxJR05FRCA9IDI7CiAgICAgIE1BTlVBTExZX1BMQUNFRCA9IDM7CiAgfQogIG9wdGlvbmFsIEFsaWdubWVudFR5cGUgYWxpZ25tZW50X3R5cGUgPSA5IFtkZWZhdWx0ID0gQUxJR05FRF07Cn0KCm1lc3NhZ2UgU3ViZ3JvdXBJbmZvIHsKCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gMTsKCW9wdGlvbmFsIGZsb2F0IGFyZWEgPSAyOyAvKiBmbG9vciBhcmVhIGluIG1eMiAoc3F1YXJlIG1ldGVyYWdlKSAqLwp9CgovKiBBbGwgcHVja3MgaW4gYSBtb2RlbC4gUHVja3MgYXJlIHN0b3JlZCBpbiBzY2FubmluZyBvcmRlci4gKi8KbWVzc2FnZSBWaXNpb25Nb2RlbGRhdGEgewoJcmVwZWF0ZWQgU3dlZXBMb2NhdGlvbiBzd2VlcExvY2F0aW9ucyA9IDE7CglyZXBlYXRlZCBTdWJncm91cEluZm8gc3ViZ3JvdXBJbmZvcyA9IDI7Cn0K", "base64")
  12193. , i = r.loadProto(t);
  12194. this.decoder = i.build("VisionModeldata")
  12195. }
  12196. var r = s("protobufjs")
  12197. , i = s("../util/ajax")
  12198. , o = (s("../util/common"),
  12199. s("../util/math"))
  12200. , a = new (s("../util/logger"))(e);
  12201. t.prototype.load = function() {
  12202. return this.modelDataPath ? (a.info("Using vision.modeldata"),
  12203. this.loadVisionModelData()) : this.sweepLocationsPath ? (a.warn("Using sweep_locations.csv"),
  12204. this.loadSweepLocationsCSV()) : (a.warn("No sweep file found"),
  12205. $.when([]))
  12206. }
  12207. ,
  12208. t.prototype.loadVisionModelData = function() {
  12209. return i.get(this.modelDataPath, {
  12210. responseType: "arraybuffer"
  12211. }).then(function(e) {
  12212. var t;
  12213. try {
  12214. t = this.decoder.decode(e)
  12215. } catch (e) {
  12216. return a.warn("Could not decode vision.modeldata, trying sweep_locations.csv"),
  12217. this.loadSweepLocationsCSV()
  12218. }
  12219. var i = t.sweepLocations.map(function(e) {
  12220. return {
  12221. uuid: e.uuid.toUTF8().replace(/-/g, ""),
  12222. position: {
  12223. x: e.pose.translation.x,
  12224. y: e.pose.translation.y,
  12225. z: e.pose.translation.z
  12226. },
  12227. quaternion: {
  12228. x: e.pose.rotation.x,
  12229. y: e.pose.rotation.y,
  12230. z: e.pose.rotation.z,
  12231. w: e.pose.rotation.w
  12232. },
  12233. puck: {
  12234. x: e.puck.x,
  12235. y: e.puck.y,
  12236. z: e.puck.z
  12237. },
  12238. floor: e.group,
  12239. neighbours: e.visibles,
  12240. alignmentType: e.alignment_type
  12241. }
  12242. }).map(function(e) {
  12243. return e.position = o.convertVisionVector(e.position),
  12244. e.quaternion = o.convertVisionQuaternion(e.quaternion),
  12245. e.puck = o.convertVisionVector(e.puck),
  12246. e
  12247. });
  12248. return i.forEach(function(e) {
  12249. e.neighbours = e.neighbours.map(function(e) {
  12250. return i[e].uuid
  12251. })
  12252. }),
  12253. i
  12254. }
  12255. .bind(this), function() {
  12256. return a.warn("Could not load vision.modeldata, trying sweep_locations.csv"),
  12257. this.loadSweepLocationsCSV()
  12258. }
  12259. .bind(this))
  12260. }
  12261. ,
  12262. t.prototype.loadSweepLocationsCSV = function() {
  12263. return i.get(this.sweepLocationsPath).then(function(e) {
  12264. return e.split("\n").map(function(e) {
  12265. return e.split(", ")
  12266. }).filter(function(e) {
  12267. return 1 < e.length
  12268. }).map(function(e) {
  12269. return {
  12270. uuid: e[0],
  12271. position: {
  12272. x: parseFloat(e[1]),
  12273. y: parseFloat(e[2]),
  12274. z: parseFloat(e[3])
  12275. },
  12276. quaternion: {
  12277. x: parseFloat(e[4]),
  12278. y: parseFloat(e[5]),
  12279. z: parseFloat(e[6]),
  12280. w: parseFloat(e[7])
  12281. }
  12282. }
  12283. }).map(function(e) {
  12284. return e.position = o.convertVisionVector(e.position),
  12285. e.quaternion = o.convertVisionQuaternion(e.quaternion),
  12286. e
  12287. })
  12288. }).fail(function() {
  12289. a.warn("Could not load sweep_locations.csv, no sweeps loaded.")
  12290. })
  12291. }
  12292. ,
  12293. l.exports = t
  12294. }
  12295. ).call(this, s("buffer").Buffer, "/js/loaders/SweepDataLoader.js")
  12296. }
  12297. , {
  12298. "../util/ajax": 181,
  12299. "../util/common": 185,
  12300. "../util/logger": 189,
  12301. "../util/math": 190,
  12302. buffer: 198,
  12303. protobufjs: 214
  12304. }],
  12305. 108: [function(s, l, e) {
  12306. (function(e) {
  12307. "use strict";
  12308. function t() {
  12309. this.locale = null
  12310. }
  12311. var i = s("../settings")
  12312. , n = s("../util/common")
  12313. , r = s("../util/logger")
  12314. , o = s("../enum/Locale")
  12315. , a = new r(e);
  12316. t.prototype.init = function() {
  12317. var e;
  12318. switch (i.languageTag) {
  12319. case null:
  12320. case "en":
  12321. case o.EN_US:
  12322. this.locale = o.EN_US,
  12323. e = s("./strings-en-US");
  12324. break;
  12325. case "es":
  12326. case o.ES_MX:
  12327. this.locale = o.ES_MX,
  12328. e = s("./strings-es-MX");
  12329. break;
  12330. case "fr":
  12331. case o.FR_FR:
  12332. this.locale = o.FR_FR,
  12333. e = s("./strings-fr-FR");
  12334. break;
  12335. case "de":
  12336. case o.DE_DE:
  12337. this.locale = o.DE_DE,
  12338. e = s("./strings-de-DE");
  12339. break;
  12340. case "ru":
  12341. case o.RU_RU:
  12342. this.locale = o.RU_RU,
  12343. e = s("./strings-ru-RU");
  12344. break;
  12345. case "cn":
  12346. case o.CN_CN:
  12347. this.locale = o.CN_CN,
  12348. e = s("./strings-cn-CN");
  12349. break;
  12350. case "jp":
  12351. case o.JP_JP:
  12352. this.locale = o.JP_JP,
  12353. e = s("./strings-jp-JP");
  12354. break;
  12355. default:
  12356. a.info("Unsupported language tag, defaulting to 'en-US'"),
  12357. this.locale = o.EN_US,
  12358. e = s("./strings-en-US")
  12359. }
  12360. a.info("Using locale '" + this.locale + "'"),
  12361. n.extendObject(this, e)
  12362. }
  12363. ,
  12364. t.prototype.localizeGUI = function() {
  12365. var e = document.querySelector("#gui-parent");
  12366. this.localizeTree(e),
  12367. this.localizeLoadingText()
  12368. }
  12369. ,
  12370. t.prototype.localizeLoadingText = function() {
  12371. document.querySelector("#help-dialog").classList.add(this.locale),
  12372. document.querySelector("#interaction-modal").classList.add(this.locale),
  12373. document.querySelector("#gui").classList.add(this.locale)
  12374. }
  12375. ,
  12376. t.prototype.localizeTree = function(e) {
  12377. var t, i, n = /{\[{ ?(\w+) ?}\]}/;
  12378. if (e.nodeType === Node.TEXT_NODE)
  12379. (t = e.data.match(n)) && (i = t[1],
  12380. e.data = this.localizeText(i) || i);
  12381. else if (e.nodeType === Node.ELEMENT_NODE) {
  12382. var r = e.getAttribute("title");
  12383. r && ((t = r.match(n)) && (i = t[1],
  12384. e.setAttribute("title", this.localizeText(i) || i)))
  12385. }
  12386. for (e = e.firstChild; e; )
  12387. this.localizeTree(e),
  12388. e = e.nextSibling
  12389. }
  12390. ,
  12391. t.prototype.localizeText = function(e) {
  12392. var t = this[e];
  12393. return t || this.locale === o.EN_US || (a.warn("Localization key '" + e + "' not available for locale '" + this.locale + "', defaulting to English."),
  12394. t = s("./strings-en-US")[e]),
  12395. t || a.warn("Localization key '" + e + "' not available for locale 'en-US'"),
  12396. t
  12397. }
  12398. ,
  12399. l.exports = new t
  12400. }
  12401. ).call(this, "/js/localization/localize.js")
  12402. }
  12403. , {
  12404. "../enum/Locale": 31,
  12405. "../settings": 166,
  12406. "../util/common": 185,
  12407. "../util/logger": 189,
  12408. "./strings-cn-CN": 109,
  12409. "./strings-de-DE": 110,
  12410. "./strings-en-US": 111,
  12411. "./strings-es-MX": 112,
  12412. "./strings-fr-FR": 113,
  12413. "./strings-jp-JP": 114,
  12414. "./strings-ru-RU": 115
  12415. }],
  12416. 109: [function(e, t, i) {
  12417. "use strict";
  12418. t.exports = {
  12419. PAGE_TITLE: "",
  12420. LOADING: "正在加载",
  12421. PRESENTED_BY_CAPS: "呈现者:",
  12422. POWERED_BY: "技术支持:",
  12423. POWERED_BY_CAPS: "技术支持:",
  12424. DESKTOP_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  12425. MOBILE_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  12426. PRESENTED_BY: "呈现者:",
  12427. MORE: "更多 ",
  12428. LESS: "更少 ",
  12429. TAG_CONTENT: "tag™ 内容",
  12430. SHOW: "显示",
  12431. HIDE: "隐藏",
  12432. DOLLHOUSE: "场景屋",
  12433. FLOOR_PLAN: "楼层平面图",
  12434. OPEN_HIGHLIGHTS: "打开精彩片段",
  12435. CLOSE_HIGHLIGHTS: "关闭",
  12436. PREVIOUS: "上一个",
  12437. PLAY: "播放",
  12438. PAUSE: "暂停",
  12439. NEXT: "下一个",
  12440. EXPLORE_3D_SPACE: "探索 3D 空间",
  12441. VIEW_DOLLHOUSE: "观看场景屋",
  12442. SOCIAL_SHARING: "分享这个空间",
  12443. VIEW_IN_VR: "以 VR 观看",
  12444. VIEW_FULLSCREEN: "全屏观看",
  12445. EXIT_FULLSCREEN: " 退出全屏",
  12446. ZOOM_IN: "放大",
  12447. ZOOM_OUT: "缩小",
  12448. FLOOR_NAME: "楼层",
  12449. FLOOR_ALL: "ALL",
  12450. FLOOR_Lang: ["Floor", ""],
  12451. TERMS: "条款",
  12452. PORT_TERMS: "port 条款",
  12453. TERMS_OF_USE: "使用条款",
  12454. CLOSE_TERMS: "关闭",
  12455. TERMS_TEXT_FILE: "terms-cn-CN.html",
  12456. TERMS_FAIL: "无法获取条款。请确保您有互联网连接以查看使用条款。",
  12457. WEBVR_FOR_DAYDREAM: "用于 Daydream 视图",
  12458. WEBVR_ENTER_WEBVR: "进入 VR",
  12459. WEBVR_DIFFERENT_HEADSET: "有其他耳机吗?",
  12460. WEBVR_LEARN_MORE: "了解更多",
  12461. WEBVR_VIEW_SPACE: "在 VR 中观看空间",
  12462. WEBVR_DAYDREAM_VIEW: "Daydream 视图",
  12463. WEBVR_DAYDREAM_PHONE: "支持 Daydream 的手机",
  12464. WEBVR_FOR_CARDBOARD: "用于 Google Cardboard",
  12465. WEBVR_VIEW_CARDBOARD: "或在 Google Cardboard 上观看",
  12466. VR_VIEW_SPACE: "在虚拟现实中观看空间",
  12467. VR_LEARN_MORE_CAPS: "了解更多",
  12468. VR_PREVIOUS_CAPS: "上一个’,",
  12469. VR_NEXT_CAPS: "下一个",
  12470. VR_GOT_IT_CAPS: "明白了",
  12471. VR_SHOW_SUPPORTED: "点击以使用 VR 观看空间",
  12472. VR_SHOW_UNSUPPORTED: "很遗憾,您的设备不符合在 VR 中观看空间的最低要求。",
  12473. VR_SHOW_IOS_1: "点击以使用 VR 观看空间",
  12474. VR_SHOW_IOS_2: "需要有 port VR 应用程序和兼容的 iPhone 才能观看",
  12475. VR_WHAT_YOU_NEED: "关于...您需要什么",
  12476. VR_NEED_CARDBOARD: "您使用 Google Cardboard 时需要什么",
  12477. VR_NEED_SAMSUNG: "您使用 Samsung Gear VR 时需要什么",
  12478. VR_NEED_DAYDREAM: "需要事先与 DAYDREAM VIEW 配对",
  12479. VR_NEED_DAYDREAM_PHONE: "支持 Daydream 的手机",
  12480. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  12481. VR_GOOGLE_DAYDREAM: "Google Daydream",
  12482. VR_APP: "port VR 应用程序",
  12483. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  12484. VR_COMPATIBLE_IPHONES_1: "iPhones",
  12485. VR_COMPATIBLE_IPHONES_2: "iPhone 5s 和更高版本,运行 iOS 9.1 和更高版本",
  12486. VR_COMPATIBLE_IPHONES_3: "兼容的 iPhone",
  12487. VR_COMPATIBLE_ANDROID: "兼容的 Android 设备",
  12488. VR_COMPATIBLE_ANDROID_LONG: "4.5-5.5 英寸、运行 Android OS 4.4.4 和更高版本的兼容型 Android 设备显示屏",
  12489. VR_ANDROID_DETAIL: "4.5 至 5.5 英寸、运行 Android OS 4.4.4 和更高版本的显示屏",
  12490. VR_ANDROID_DVICES: "Android 设备",
  12491. VR_COMPATIBLE_SAMSUNG: "兼容的 Samsung 设备",
  12492. VR_SAMSUNG_DETAIL: "Galaxy S6 和更高版本",
  12493. VR_APP_FOR_CARDBOARD: "用于 Google Cardboard 的 port VR 应用程序",
  12494. VR_APP_FOR_SAMSUNG: "用于 Gear VR 的 port VR 应用程序",
  12495. VR_APP_FOR_ANDROID: "用于 Android 手机的 port VR 应用程序",
  12496. VR_APP_OPEN: "请使用 port VR 应用程序打开",
  12497. VR_DOWNLOAD_HERE: "在此下载",
  12498. VR_REQUIRE_HEADSET: "需要一副 VR 耳机并安装用于 Android 的 port VR 应用程序",
  12499. VR_REDIRECT_TO_STORE: "如果未安装应用程序,您将跳转到应用程序商店。",
  12500. VR_IMPROPER_EMBED: "port 空间未正确嵌入,无法在您的 Web 浏览器支持 VR。",
  12501. VR_OPEN_ANDROID_LINK: "在您的手机上打开链接",
  12502. VR_ANDROID_OPTIONS: "可用的 VR 耳机选项",
  12503. SHARE_TO: "分享到",
  12504. SHARE_LINK: "直接链接",
  12505. SHARE_EXPLORE: "探索",
  12506. SHARE_AT: "在",
  12507. SHARE_WITH: "使用",
  12508. SHARE_3D: "以 3D",
  12509. SHARE_COPIED: "已复制!",
  12510. ERROR_BROWSER_SOLUTION: "安装更新的浏览器以探索 3D。",
  12511. ERROR_BROWSER_EXPLANATION: "WebGL 需要现代的浏览器。",
  12512. ERROR_GENERIC_PROBLEM: "糟糕,出现问题。",
  12513. ERROR_GENERIC_SOLUTION: "重新启动您的浏览器。",
  12514. ERROR_GENERIC_ACTIONS_1: "如果问题仍然存在,",
  12515. ERROR_GENERIC_ACTIONS_2: "请安装支持的浏览器",
  12516. ERROR_GENERIC_ACTIONS_3: " 或",
  12517. ERROR_GENERIC_ACTIONS_4: "查看我们的故障排除指南",
  12518. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "浏览器不受支持。",
  12519. ERROR_WEBGL_IOS_PROBLEM: "iOS 版本不受支持。",
  12520. ERROR_WEBGL_IOS_SOLUTION: "升级到 iOS 8 或更高版本以在 3D 中探索。",
  12521. ERROR_WEBGL_IOS_ACTIONS_1: "点击 ",
  12522. ERROR_WEBGL_IOS_ACTIONS_2: "设置 > 通用 > 软件更新",
  12523. ERROR_WEBGL_SAFARI_PROBLEM: "启用 WebGL 以在 3D 中探索。",
  12524. ERROR_WEBGL_SAFARI_ACTIONS_1: "单击",
  12525. ERROR_WEBGL_SAFARI_ACTIONS_2: "菜单栏中的首选项 > 高级 > 显示开发菜单",
  12526. ERROR_WEBGL_SAFARI_ACTIONS_3: "然后单击",
  12527. ERROR_WEBGL_SAFARI_ACTIONS_4: "开发 > 启用 WebGL",
  12528. ERROR_MISSING_URLS_PROBLEM: "糟糕,没有此模型的全景。",
  12529. ERROR_MISSING_URLS_EXPLANATION: "这是较早的模型。网站所有者可能正在开发一种新模型。",
  12530. ERROR_LOADING_FAILED_PROBLEM: "糟糕,模式不可用。",
  12531. ERROR_LOADING_FAILED_ACTIONS_1: "如果问题仍然存在,",
  12532. ERROR_LOADING_FAILED_ACTIONS_2: "查看我们的故障排除指南",
  12533. ERROR_MAINTENANCE_PROBLEM: "正在进行维护",
  12534. ERROR_MAINTENANCE_SOLUTION: "请过几分钟再来。",
  12535. LINK_TO_LOCATION: "地点链接",
  12536. MENU_COPY: "复制",
  12537. LINK_ALERT_COPY: "请使用 CTRL/CMD + C 复制。",
  12538. ROTATE: "旋转",
  12539. MOVE: "移动",
  12540. INSIDE: "内部",
  12541. ZOOM: "缩放",
  12542. HELP: "小帮手",
  12543. HELP_NAVIGATION_TAB: "导航",
  12544. HELP_MORE_HELP_TAB: "更多帮助",
  12545. HELP_DESKTOP_PANORAMA_1A: "单击并拖动以环顾空间。",
  12546. HELP_DESKTOP_PANORAMA_2A: "单击整个空间内的圆环以四处移动。",
  12547. HELP_DESKTOP_PANORAMA_3A: "使用鼠标滚轮来放大和缩小。",
  12548. HELP_DESKTOP_PANORAMA_1B: "或者,使用箭头键向左向右转。",
  12549. HELP_DESKTOP_PANORAMA_2B: "或者,使用箭头键向前移动和向后移动。",
  12550. HELP_DESKTOP_PANORAMA_3B: "或者,使用加号和减号键来放大和缩小。",
  12551. HELP_DESKTOP_360_2A: "单击内部视图图标以进入空间。",
  12552. HELP_DESKTOP_360_2B: "或者,按 1 号键进入内部视图。 ",
  12553. HELP_DESKTOP_DOLLHOUSE_1A: "左键单击并向左、向右、向上和向下拖动以旋转场景屋。",
  12554. HELP_DESKTOP_DOLLHOUSE_2A: "右键单击并向左、向右、向上和向下拖动以改变场景屋在屏幕上的位置。",
  12555. HELP_DESKTOP_DOLLHOUSE_3A: "使用鼠标滚轮来放大和缩小。",
  12556. HELP_DESKTOP_DOLLHOUSE_1B: "或者,使用箭头键来旋转场景屋。",
  12557. HELP_DESKTOP_FLOORPLAN_1A: "左键单击并向左、向右、向上和向下拖动以改变楼层平面图在屏幕上的位置。",
  12558. HELP_DESKTOP_FLOORPLAN_2A: "右键单击并向左或向右拖动以旋转楼层平面图。",
  12559. HELP_DESKTOP_FLOORPLAN_3A: "使用鼠标滚轮来放大和缩小。",
  12560. HELP_DESKTOP_FLOORPLAN_2B: "或者,使用箭头键以向左或向右旋转。",
  12561. HELP_DESKTOP_FLOORPLAN_3B: "或者,使用箭头键来放大和缩小。",
  12562. HELP_MOBILE_PANORAMA_1: "触摸并拖动以环顾空间。",
  12563. HELP_MOBILE_PANORAMA_2: "点击整个空间内的圆环以四处移动。",
  12564. HELP_MOBILE_3: "使用捏合手势来放大和缩小。",
  12565. HELP_MOBILE_360_2: "点击内部视图图标以进入空间。",
  12566. HELP_MOBILE_DOLLHOUSE_1: "触摸并向上、向下、向左和向右拖动以旋转场景屋。",
  12567. HELP_MOBILE_DOLLHOUSE_2: "用两指触摸并拖动以定位场景屋。",
  12568. HELP_MOBILE_FLOORPLAN_1: "触摸并拖动以定位楼层平面图。",
  12569. HELP_MOBILE_FLOORPLAN_2: "用两指触摸并拖动以旋转楼层平面图。",
  12570. HELP_MORE_HLR_A: "精彩片段集锦",
  12571. HELP_DESKTOP_MORE_HLR_B: "打开以使用缩略图图像在空间中流览。",
  12572. HELP_MORE_DOLLHOUSE_A: "场景屋",
  12573. HELP_DESKTOP_MORE_DOLLHOUSE_B: "单击以查看和旋转 3D 内整个空间的俯视图。",
  12574. HELP_MOBILE_MORE_DOLLHOUSE_B: "点击以查看和旋转 3D 内整个空间的俯视图。",
  12575. HELP_MORE_FLOORS_A: "楼层选择器",
  12576. HELP_DESKTOP_MORE_FLOORS_B: "在空间中的楼层之间切换。",
  12577. HELP_MORE_TAG_A: "tag™ 贴文",
  12578. HELP_DESKTOP_MORE_TAG_B: "单击或悬停鼠标以查看空间中的功能信息。",
  12579. HELP_MOBILE_MORE_TAG_B: "点击以查看空间中的功能信息。",
  12580. HELP_MORE_ZOOM_A: "缩放控件",
  12581. HELP_DESKTOP_MORE_ZOOM_B: "使用这些控件来放大和缩小或使用滚轮。",
  12582. HELP_MORE_TOUR_A: "导览控件",
  12583. HELP_DESKTOP_MORE_TOUR_B: "通过导览播放、暂停以及向前和向后流览。",
  12584. HELP_MORE_INSIDE_A: "内部视图",
  12585. HELP_DESKTOP_MORE_INSIDE_B: "单击以探索空间内部。",
  12586. HELP_MOBILE_MORE_INSIDE_B: "点击以探索空间内部。",
  12587. HELP_MORE_VR_A: "VR 模式",
  12588. HELP_DESKTOP_MORE_VR_B: "单击以在虚拟现实中启动空间。",
  12589. HELP_MOBILE_MORE_VR_B: "点击以在虚拟现实中启动空间。",
  12590. HELP_MORE_360_A: "360° 视图",
  12591. HELP_DESKTOP_MORE_360_B: "单击精彩片段集锦中的 360 视图中以观看室外场景。",
  12592. HELP_MOBILE_MORE_360_B: "点击精彩片段集锦中的 360 视图中以观看室外场景。",
  12593. HELP_MORE_FULLSCREEN_A: "全屏",
  12594. HELP_DESKTOP_MORE_FULLSCREEN_B: "将 3D Showcase 扩展到全屏。",
  12595. CLOSE: "关闭"
  12596. }
  12597. }
  12598. , {}],
  12599. 110: [function(e, t, i) {
  12600. "use strict";
  12601. t.exports = {
  12602. PAGE_TITLE: "",
  12603. LOADING: "Lädt",
  12604. PRESENTED_BY_CAPS: "PRÄSENTIERT VON",
  12605. POWERED_BY: "Angetrieben von",
  12606. POWERED_BY_CAPS: "ANGETRIEBEN VON",
  12607. DESKTOP_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  12608. MOBILE_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  12609. PRESENTED_BY: "Präsentiert von ",
  12610. MORE: "Mehr ",
  12611. LESS: "Weniger ",
  12612. TAG_CONTENT: "tag™ Inhalt",
  12613. SHOW: "Anzeigen",
  12614. HIDE: "Verbergen",
  12615. DOLLHOUSE: "Puppenhaus",
  12616. FLOOR_PLAN: "Grundriss",
  12617. OPEN_HIGHLIGHTS: "Highlights anzeigen",
  12618. CLOSE_HIGHLIGHTS: "Schließen",
  12619. PREVIOUS: "Vorheriges",
  12620. PLAY: "Abspielen",
  12621. PAUSE: "Pausieren",
  12622. NEXT: "Nächstes",
  12623. EXPLORE_3D_SPACE: "Innenraum betreten",
  12624. VIEW_DOLLHOUSE: "Puppenhaus ansehen",
  12625. SOCIAL_SHARING: "Teilen Sie diesen Raum",
  12626. VIEW_IN_VR: "In VR ansehen",
  12627. VIEW_FULLSCREEN: "Ansicht im Vollbildmodus",
  12628. EXIT_FULLSCREEN: "Beenden des Vollbildmodus",
  12629. ZOOM_IN: "Vergrößern",
  12630. ZOOM_OUT: "Verkleinern",
  12631. FLOOR_NAME: "Etage ",
  12632. FLOOR_ALL: "Alle",
  12633. TERMS: "Bedingungen",
  12634. PORT_TERMS: "port Bedingungen",
  12635. TERMS_OF_USE: "Nutzungsbedingungen",
  12636. TERMS_TEXT_FILE: "terms-de-DE.html",
  12637. CLOSE_TERMS: "Schließen",
  12638. TERMS_FAIL: "Konnte die Nutzungsbedingungen nicht abrufen. Bitte stellen Sie sicher, dass Sie zum Internet verbunden sind.",
  12639. HELP: "Hilfe",
  12640. HELP_NAVIGATION_TAB: "Navigation",
  12641. HELP_MORE_HELP_TAB: "Hilfe-Details",
  12642. CLOSE: "Schließen",
  12643. HELP_DESKTOP_PANORAMA_1A: "Klicken und ziehen Sie um sich im Raum umzusehen.",
  12644. HELP_DESKTOP_PANORAMA_2A: "Klicken Sie auf die Ringe im Raum um sich zu bewegen.",
  12645. HELP_DESKTOP_PANORAMA_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12646. HELP_DESKTOP_PANORAMA_1B: "Oder verwenden Sie die Pfeiltasten um sich nach links und rechts zu bewegen.",
  12647. HELP_DESKTOP_PANORAMA_2B: "Oder verwenden Sie die Pfeiltasten um sich vorwärts und rückwärts zubewegen.",
  12648. HELP_DESKTOP_PANORAMA_3B: "Oder verwenden Sie die Plus- und Minus-Tasten zum Vergrößern und Verkleinern.",
  12649. HELP_DESKTOP_360_2A: "Klicken Sie die Innenansicht ikone, um diesen Raum zu starten .",
  12650. HELP_DESKTOP_360_2B: "Oder, drücken Sie die 1-Taste um die Innenraumansicht zu starten.",
  12651. HELP_DESKTOP_DOLLHOUSE_1A: "Klicken Sie mit der linken Maustaste und ziehen Sie nach links, rechts, oben und unten um das Puppenhaus zu drehen.",
  12652. 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.",
  12653. HELP_DESKTOP_DOLLHOUSE_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12654. HELP_DESKTOP_DOLLHOUSE_1B: "Oder verwenden Sie die Pfeiltasten um das Puppenhaus zu drehen.",
  12655. 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.",
  12656. HELP_DESKTOP_FLOORPLAN_2A: "Klicken Sie mit der rechten Maustaste und ziehen Sie nach links oder rechts um den Grundriss zu drehen.",
  12657. HELP_DESKTOP_FLOORPLAN_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12658. HELP_DESKTOP_FLOORPLAN_2B: "Oder verwenden Sie die Pfeiltasten um das Modell nach links oder rechts zu drehen.",
  12659. HELP_DESKTOP_FLOORPLAN_3B: "Oder verwenden Sie die Pfeiltasten zum Vergrößern und Verkleinern.",
  12660. HELP_MOBILE_PANORAMA_1: "Berühren und ziehen an dem Raum um sich umzusehen.",
  12661. HELP_MOBILE_PANORAMA_2: "Klicken Sie auf die Ringe im Raum, um sich zu bewegen.",
  12662. HELP_MOBILE_3: "Benutzen Sie die Zoom-Gäste zum Vergrößern und Verkleinern.",
  12663. HELP_MOBILE_360_2: "Tippen Sie die Innenansicht ikone, um diesen Raum zu starten.",
  12664. HELP_MOBILE_DOLLHOUSE_1: "Berühren und nach oben, unten, links und rechts ziehen um das Puppenhaus zu drehen.",
  12665. HELP_MOBILE_DOLLHOUSE_2: "Berühren und mit zwei Fingern ziehen um das Puppenhaus zu positionieren.",
  12666. HELP_MOBILE_FLOORPLAN_1: "Berühren und ziehen, um den Grundriss zu positionieren.",
  12667. HELP_MOBILE_FLOORPLAN_2: "Berühren und ziehen mit zwei Fingern, um den Grundriss zu drehen.",
  12668. HELP_MORE_HLR_A: "Liste das Highlight",
  12669. HELP_DESKTOP_MORE_HLR_B: "Öffnen um durch den Raum mit Vorschau-Bildern zu navigieren.",
  12670. HELP_MORE_DOLLHOUSE_A: "Puppenhaus Ansicht",
  12671. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Klicken Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  12672. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tippen Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  12673. HELP_MORE_FLOORS_A: "Etage auswählen",
  12674. HELP_DESKTOP_MORE_FLOORS_B: "Zwischen den Etagen im Raum wechseln.",
  12675. HELP_MORE_TAG_A: "tag™ Posts",
  12676. HELP_DESKTOP_MORE_TAG_B: "Klicken Sie auf oder bewegen Sie Ihren Mauszeiger über die Informationen über die Funktionen im Raum.",
  12677. HELP_MOBILE_MORE_TAG_B: "Tippen Sie für Informationen über die Funktionen im Raum.",
  12678. HELP_MORE_ZOOM_A: "Zoom Steuerung",
  12679. HELP_DESKTOP_MORE_ZOOM_B: "Verwenden Sie diese Steuerung oder das Scrollrad zum Vergrößern und Verkleinern.",
  12680. HELP_MORE_TOUR_A: "Tour Steuerung",
  12681. HELP_DESKTOP_MORE_TOUR_B: "Abspielen, pausieren und vorwärts und rückwärts durch eine geführte Tour navigieren.",
  12682. HELP_MORE_INSIDE_A: "Innenansicht",
  12683. HELP_DESKTOP_MORE_INSIDE_B: "Klicken Sie hier um sich im Raum umzusehen.",
  12684. HELP_MOBILE_MORE_INSIDE_B: "Sehen Sie sich in diesen 3D Raum um.",
  12685. HELP_MORE_VR_A: "VR Modus",
  12686. HELP_DESKTOP_MORE_VR_B: "Klicken Sie hier, um den Raum in der virtuellen Realität zu starten.",
  12687. HELP_MOBILE_MORE_VR_B: "Tippen Sie um den Raum in der virtuellen Realität zu starten.",
  12688. HELP_MORE_360_A: "360° Views Ansicht ",
  12689. HELP_DESKTOP_MORE_360_B: "Klicken Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  12690. HELP_MOBILE_MORE_360_B: "Tippen Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  12691. HELP_MORE_FULLSCREEN_A: "Vollbild",
  12692. HELP_DESKTOP_MORE_FULLSCREEN_B: "Erweitern Sie 3D Showcase im Vollbildmodus.",
  12693. WEBVR_FOR_CARDBOARD: "Für Google Cardboard",
  12694. WEBVR_FOR_DAYDREAM: "Für Daydream View",
  12695. WEBVR_ENTER_WEBVR: "Starten Sie VR",
  12696. WEBVR_DIFFERENT_HEADSET: "Haben Sie anderes Headset?",
  12697. WEBVR_LEARN_MORE: "Mehr Infos",
  12698. WEBVR_VIEW_SPACE: "Ansicht des Raumes in VR",
  12699. WEBVR_DAYDREAM_VIEW: "Daydream View",
  12700. WEBVR_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  12701. WEBVR_VIEW_CARDBOARD: "Oder mit Google Cardboard ansehen",
  12702. VR_WHAT_YOU_NEED: "Was Sie dafür brauchen...",
  12703. VR_NEED_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  12704. VR_GOOGLE_DAYDREAM: "Google Daydream",
  12705. VR_APP: "port VR App",
  12706. VR_APP_OPEN: "Oder öffnen Sie die port VR App",
  12707. 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",
  12708. VR_SAMSUNG_DETAIL: "Galaxy S6 und neuer",
  12709. VR_APP_FOR_ANDROID: "port VR app für Android",
  12710. VR_NEED_DAYDREAM: "ERFORDERT VOR DER 'PAIRING' MIT DAYDREAM VIEW",
  12711. VR_VIEW_SPACE: "Ansicht des Raumes in VR",
  12712. VR_LEARN_MORE_CAPS: "MEHR INFOS",
  12713. VR_PREVIOUS_CAPS: "ZURÜCK",
  12714. VR_NEXT_CAPS: "WEITER",
  12715. VR_GOT_IT_CAPS: "VERSTANDEN",
  12716. VR_SHOW_SUPPORTED: "Tippen Sie um den Raum in VR zu sehen",
  12717. VR_SHOW_UNSUPPORTED: "Schade, aber Ihr Gerät erfüllt nicht die Mindestanforderungen um den Raum in VR zu sehen.",
  12718. VR_SHOW_IOS_1: "Tippen Sie um den Raum in VR zu sehen",
  12719. VR_SHOW_IOS_2: "port VR App sowie kompatibles iPhone sind von nöten um diesen Raum zu sehen",
  12720. VR_NEED_CARDBOARD: "Was Sie dafür brauchen ist Google Cardboard",
  12721. VR_NEED_SAMSUNG: "Was Sie dafür brauchen ist Samsung Gear VR",
  12722. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  12723. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  12724. VR_COMPATIBLE_IPHONES_1: "iPhones",
  12725. VR_COMPATIBLE_IPHONES_2: "iPhone 5s oder neuer, mit iOS 9.1 und später",
  12726. VR_COMPATIBLE_IPHONES_3: "Kompatibles iPhones",
  12727. VR_COMPATIBLE_ANDROID: "Kompatibles Android Gerät",
  12728. VR_ANDROID_DETAIL: "Bildschirmdiagonale von 11,5 bis 14 cm (4,5 - 5,5 Zoll) und Android 4.4.4 und neuer",
  12729. VR_ANDROID_DVICES: "Android Geräte",
  12730. VR_COMPATIBLE_SAMSUNG: "Kompatible Samsung Geräte",
  12731. VR_APP_FOR_CARDBOARD: "port VR App für Google Cardboard",
  12732. VR_APP_FOR_SAMSUNG: "port VR App für Gear VR",
  12733. VR_DOWNLOAD_HERE: "Hier runterladen",
  12734. VR_REQUIRE_HEADSET: "Benötigt das ein VR-Headset und port VR App für Android installiert wird",
  12735. VR_REDIRECT_TO_STORE: "Wenn App nicht installiert ist, werden Sie zum App Store umgeleitet.",
  12736. VR_IMPROPER_EMBED: "Der port Raum ist nicht richtig eingebettet um VR in Ihrem Webbrowser zu unterstützen.",
  12737. VR_OPEN_ANDROID_LINK: "Öffnen Sie den Link auf Ihrem Handy",
  12738. VR_ANDROID_OPTIONS: "VR Headset Optionen",
  12739. SHARE_TO: "Teilen auf",
  12740. SHARE_LINK: "Direkter Link",
  12741. SHARE_EXPLORE: "Umsehen",
  12742. SHARE_AT: "auf",
  12743. SHARE_WITH: "mit",
  12744. SHARE_3D: "in 3D",
  12745. SHARE_COPIED: "Kopiert!",
  12746. ERROR_BROWSER_SOLUTION: "Installieren Sie einen neueren Browser um sich in 3D umzusehen.",
  12747. ERROR_BROWSER_EXPLANATION: "WebGL benötigt einen modernen Browser.",
  12748. ERROR_GENERIC_PROBLEM: "Huch, etwas ist schief gelaufen.",
  12749. ERROR_GENERIC_SOLUTION: "Starten Sie Ihren Browser neu.",
  12750. ERROR_GENERIC_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  12751. ERROR_GENERIC_ACTIONS_2: "Installieren Sie einen unterstützten Browser",
  12752. ERROR_GENERIC_ACTIONS_3: " oder ",
  12753. ERROR_GENERIC_ACTIONS_4: "Sehen Sie unseren Leitfaden zur Fehlerbehebung",
  12754. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser wird nicht unterstützt.",
  12755. ERROR_WEBGL_IOS_PROBLEM: "iOS-Version wird nicht unterstützt.",
  12756. ERROR_WEBGL_IOS_SOLUTION: "Aktualisieren Sie auf iOS 8 oder neuer um sich in 3D umzusehen.",
  12757. ERROR_WEBGL_IOS_ACTIONS_1: "Tippen ",
  12758. ERROR_WEBGL_IOS_ACTIONS_2: "Einstellungen > Allgemein > Softwareaktualisierung",
  12759. ERROR_WEBGL_SAFARI_PROBLEM: "Aktivieren Sie WebVR um sich in 3D umzusehen.",
  12760. ERROR_WEBGL_SAFARI_ACTIONS_1: "Klicken ",
  12761. ERROR_WEBGL_SAFARI_ACTIONS_2: "Präferenzen > Fortgeschrittene > Entwickler-Menü anzeigen",
  12762. ERROR_WEBGL_SAFARI_ACTIONS_3: "Klicken Sie dann ",
  12763. ERROR_WEBGL_SAFARI_ACTIONS_4: "Entwickler > WebGL Aktivieren",
  12764. ERROR_MISSING_URLS_PROBLEM: "Huch, es gibt keine Panoramen für dieses Modell .",
  12765. ERROR_MISSING_URLS_EXPLANATION: "Dies ist ein älteres Modell. Der Website-Besitzer hat eventuell ein neues Modell in Arbeit.",
  12766. ERROR_LOADING_FAILED_PROBLEM: "Huch, das Modell ist nicht verfügbar.",
  12767. ERROR_LOADING_FAILED_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  12768. ERROR_LOADING_FAILED_ACTIONS_2: "sehen Sie unseren Leitfaden zur Fehlerbehebung",
  12769. ERROR_MAINTENANCE_PROBLEM: "Wartung im Gange.",
  12770. ERROR_MAINTENANCE_SOLUTION: "Bitte versuchen Sie es in ein paar Minuten nochmal.",
  12771. LINK_TO_LOCATION: "Link zu",
  12772. MENU_COPY: "Kopieren",
  12773. LINK_ALERT_COPY: "Bitte benutzen Sie CTRL/CMD + C zum kopieren.",
  12774. ROTATE: "Drehen",
  12775. INSIDE: "Drinnen",
  12776. MOVE: "Bewegen",
  12777. ZOOM: "Vergrößern"
  12778. }
  12779. }
  12780. , {}],
  12781. 111: [function(e, t, i) {
  12782. "use strict";
  12783. t.exports = {
  12784. PAGE_TITLE: "",
  12785. LOADING: "Loading",
  12786. PRESENTED_BY_CAPS: "PRESENTED BY",
  12787. POWERED_BY: "powered by ",
  12788. POWERED_BY_CAPS: "POWERED BY",
  12789. DESKTOP_SHORT_CTA: "Click to explore this 3D space.",
  12790. MOBILE_SHORT_CTA: "Tap to explore this 3D space.",
  12791. PRESENTED_BY: "Presented by ",
  12792. MORE: "More ",
  12793. LESS: "Less ",
  12794. TAG_CONTENT: "tag™ Content",
  12795. SHOW: "Show",
  12796. HIDE: "Hide",
  12797. DOLLHOUSE: "Dollhouse",
  12798. FLOOR_PLAN: "Floor plan",
  12799. OPEN_HIGHLIGHTS: "Open Highlights",
  12800. CLOSE_HIGHLIGHTS: "Close",
  12801. PREVIOUS: "Previous",
  12802. PLAY: "Play",
  12803. PAUSE: "Pause",
  12804. NEXT: "Next",
  12805. EXPLORE_3D_SPACE: "Explore 3D Space",
  12806. VIEW_DOLLHOUSE: "View dollhouse",
  12807. SOCIAL_SHARING: "Share this Space",
  12808. VIEW_IN_VR: "View in VR",
  12809. VIEW_FULLSCREEN: "全屏",
  12810. EXIT_FULLSCREEN: "退出全屏",
  12811. ZOOM_IN: "Zoom in",
  12812. ZOOM_OUT: "Zoom out",
  12813. FLOOR_NAME: "Floor ",
  12814. FLOOR_ALL: "全部",
  12815. TERMS: "Terms",
  12816. PORT_TERMS: "port terms",
  12817. TERMS_OF_USE: "Terms of Use",
  12818. TERMS_TEXT_FILE: "terms-en-US.html",
  12819. CLOSE_TERMS: "Close",
  12820. TERMS_FAIL: "Could not fetch terms. Please make sure you have an internet connection to view the terms of use.",
  12821. HELP: "Help",
  12822. HELP_NAVIGATION_TAB: "Navigation",
  12823. HELP_MORE_HELP_TAB: "More Help",
  12824. CLOSE: "Close",
  12825. HELP_DESKTOP_PANORAMA_1A: "Click and Drag to look around the Space.",
  12826. HELP_DESKTOP_PANORAMA_2A: "Click on the rings throughout the space to move around.",
  12827. HELP_DESKTOP_PANORAMA_3A: "Use the scroll wheel to zoom in and out.",
  12828. HELP_DESKTOP_PANORAMA_1B: "Or, use the arrow keys to turn left and right.",
  12829. HELP_DESKTOP_PANORAMA_2B: "Or, use the arrow keys to move forward and back.",
  12830. HELP_DESKTOP_PANORAMA_3B: "Or, use the plus and minus keys to zoom in and out.",
  12831. HELP_DESKTOP_360_2A: "Click the Inside View icon to enter the Space.",
  12832. HELP_DESKTOP_360_2B: "Or, press the number 1 key to enter Inside View.",
  12833. HELP_DESKTOP_DOLLHOUSE_1A: "Left click and drag left, right, up, and down to rotate the Dollhouse.",
  12834. HELP_DESKTOP_DOLLHOUSE_2A: "Right click and drag left, right, up, and down to change the Dollhouse position on screen.",
  12835. HELP_DESKTOP_DOLLHOUSE_3A: "Use the scroll wheel to zoom in and out.",
  12836. HELP_DESKTOP_DOLLHOUSE_1B: "Or, use the arrow keys to rotate the Dollhouse.",
  12837. HELP_DESKTOP_FLOORPLAN_1A: "Left click and drag left, right, up, and down to change the Floorplan position on screen.",
  12838. HELP_DESKTOP_FLOORPLAN_2A: "Right click and drag left or right to rotate the Floorplan.",
  12839. HELP_DESKTOP_FLOORPLAN_3A: "Use the scroll wheel to zoom in and out.",
  12840. HELP_DESKTOP_FLOORPLAN_2B: "Or, use the arrow keys to rotate left or right.",
  12841. HELP_DESKTOP_FLOORPLAN_3B: "Or, use the arrow keys to zoom in and out.",
  12842. HELP_MOBILE_PANORAMA_1: "Touch and Drag to look around the Space.",
  12843. HELP_MOBILE_PANORAMA_2: "Tap on the rings throughout the Space to move around.",
  12844. HELP_MOBILE_3: "Use a pinch gesture to zoom in and out.",
  12845. HELP_MOBILE_360_2: "Tap the Inside View icon to enter the Space.",
  12846. HELP_MOBILE_DOLLHOUSE_1: "Touch and drag up, down, left, and right to rotate the Dollhouse.",
  12847. HELP_MOBILE_DOLLHOUSE_2: "Touch and drag with two fingers to position the Dollhouse.",
  12848. HELP_MOBILE_FLOORPLAN_1: "Touch and drag to position the Floorplan.",
  12849. HELP_MOBILE_FLOORPLAN_2: "Touch and drag with two fingers to rotate the Floorplan.",
  12850. HELP_MORE_HLR_A: "Highlight Reel",
  12851. HELP_DESKTOP_MORE_HLR_B: "Open to navigate through the Space using thumbnail images.",
  12852. HELP_MORE_DOLLHOUSE_A: "Dollhouse View",
  12853. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Click to view and rotate a top-down view of the entire Space in 3D.",
  12854. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tap to view and rotate a top-down view of the entire Space in 3D.",
  12855. HELP_MORE_FLOORS_A: "Floor Selector",
  12856. HELP_DESKTOP_MORE_FLOORS_B: "Switch between floors in the Space.",
  12857. HELP_MORE_TAG_A: "tag™ Posts",
  12858. HELP_DESKTOP_MORE_TAG_B: "Click or hover over for information about features in the Space.",
  12859. HELP_MOBILE_MORE_TAG_B: "Tap for information about features in the Space.",
  12860. HELP_MORE_ZOOM_A: "Zoom Controls",
  12861. HELP_DESKTOP_MORE_ZOOM_B: "Use these controls to zoom in and out or use the scroll wheel.",
  12862. HELP_MORE_TOUR_A: "Tour Controls",
  12863. HELP_DESKTOP_MORE_TOUR_B: "Play, pause, and navigate forward and backward through a Guided Tour.",
  12864. HELP_MORE_INSIDE_A: "Inside View",
  12865. HELP_DESKTOP_MORE_INSIDE_B: "Click to explore inside the Space.",
  12866. HELP_MOBILE_MORE_INSIDE_B: "Tap to explore inside the Space.",
  12867. HELP_MORE_VR_A: "VR Mode",
  12868. HELP_DESKTOP_MORE_VR_B: "Click to launch the Space in virtual reality.",
  12869. HELP_MOBILE_MORE_VR_B: "Tap to launch the Space in virtual reality.",
  12870. HELP_MORE_360_A: "360° Views",
  12871. HELP_DESKTOP_MORE_360_B: "Click 360 Views in the Highlight Reel to view outdoor scenes.",
  12872. HELP_MOBILE_MORE_360_B: "Tap 360 Views in the Highlight Reel to view outdoor scenes.",
  12873. HELP_MORE_FULLSCREEN_A: "Full screen",
  12874. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expand 3D Showcase to full screen.",
  12875. WEBVR_FOR_CARDBOARD: "For Google Cardboard",
  12876. WEBVR_VIEW_CARDBOARD: "Or View on Google Cardboard",
  12877. WEBVR_FOR_DAYDREAM: "For Daydream View",
  12878. WEBVR_ENTER_WEBVR: "ENTER VR",
  12879. WEBVR_DIFFERENT_HEADSET: "Have a different headset?",
  12880. WEBVR_LEARN_MORE: "Learn more",
  12881. WEBVR_VIEW_SPACE: "View Space in VR",
  12882. WEBVR_DAYDREAM_VIEW: "Daydream View",
  12883. WEBVR_DAYDREAM_PHONE: "Daydream-ready phone",
  12884. VR_VIEW_SPACE: "View Space in Virtual Reality",
  12885. VR_LEARN_MORE_CAPS: "LEARN MORE",
  12886. VR_PREVIOUS_CAPS: "PREVIOUS",
  12887. VR_NEXT_CAPS: "NEXT",
  12888. VR_GOT_IT_CAPS: "GOT IT",
  12889. VR_SHOW_SUPPORTED: "Tap to view the Space in VR with",
  12890. VR_SHOW_UNSUPPORTED: "Sorry, but your device doesn't meet the minimum requirements to view a space in VR.",
  12891. VR_SHOW_IOS_1: "Tap to view the space in VR",
  12892. VR_SHOW_IOS_2: "Requires port VR app and compatible iPhone to view",
  12893. VR_WHAT_YOU_NEED: "What You'll Need For...",
  12894. VR_NEED_CARDBOARD: "What you'll need with Google Cardboard",
  12895. VR_NEED_SAMSUNG: "What you'll need with Samsung Gear VR",
  12896. VR_NEED_DAYDREAM: "NEEDS PRIOR PAIRING WITH DAYDREAM VIEW",
  12897. VR_NEED_DAYDREAM_PHONE: "Daydream-ready phone",
  12898. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  12899. VR_GOOGLE_DAYDREAM: "Google Daydream",
  12900. VR_APP: "port VR App",
  12901. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  12902. VR_COMPATIBLE_IPHONES_1: "iPhones",
  12903. VR_COMPATIBLE_IPHONES_2: "iPhone 5s and newer, running iOS 9.1 and higher",
  12904. VR_COMPATIBLE_IPHONES_3: "Compatible iPhones",
  12905. VR_COMPATIBLE_ANDROID: "Compatible Android Devices",
  12906. VR_COMPATIBLE_ANDROID_LONG: 'Compatible Android Devices Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  12907. VR_ANDROID_DETAIL: 'Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  12908. VR_ANDROID_DVICES: "Android Devices",
  12909. VR_COMPATIBLE_SAMSUNG: "Compatible Samsung Devices",
  12910. VR_SAMSUNG_DETAIL: "Galaxy S6 and Above",
  12911. VR_APP_FOR_CARDBOARD: "port VR app for Google Cardboard",
  12912. VR_APP_FOR_SAMSUNG: "port VR app for Gear VR",
  12913. VR_APP_FOR_ANDROID: "port VR app for Android Phones",
  12914. VR_APP_OPEN: "Open with the port VR app instead",
  12915. VR_DOWNLOAD_HERE: "Download here",
  12916. VR_REQUIRE_HEADSET: "Requires a VR headset and port VR app for Android to be installed",
  12917. VR_REDIRECT_TO_STORE: "If app is not installed, you will be redirected to the app store.",
  12918. VR_IMPROPER_EMBED: "The port Space is not embedded properly to support VR in your web browser.",
  12919. VR_OPEN_ANDROID_LINK: "Open the Link on Your Mobile Phone",
  12920. VR_ANDROID_OPTIONS: "Available VR Headset Options",
  12921. SHARE_TO: "Share to",
  12922. SHARE_LINK: "Direct Link",
  12923. SHARE_EXPLORE: "Explore ",
  12924. SHARE_AT: "at",
  12925. SHARE_WITH: "with",
  12926. SHARE_3D: " in 3D",
  12927. SHARE_COPIED: "Copied!",
  12928. ERROR_BROWSER_SOLUTION: "Install a new browser to explore in 3D.",
  12929. ERROR_BROWSER_EXPLANATION: "WebGL requires a modern browser.",
  12930. ERROR_GENERIC_PROBLEM: "Oops, something went wrong.",
  12931. ERROR_GENERIC_SOLUTION: "Restart your browser.",
  12932. ERROR_GENERIC_ACTIONS_1: "If the problem persists, ",
  12933. ERROR_GENERIC_ACTIONS_2: "install a supported browser",
  12934. ERROR_GENERIC_ACTIONS_3: " or ",
  12935. ERROR_GENERIC_ACTIONS_4: "see our troubleshooting guide",
  12936. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser not supported.",
  12937. ERROR_WEBGL_IOS_PROBLEM: "iOS version not supported.",
  12938. ERROR_WEBGL_IOS_SOLUTION: "Upgrade to iOS 8 or higher to explore in 3D.",
  12939. ERROR_WEBGL_IOS_ACTIONS_1: "Tap ",
  12940. ERROR_WEBGL_IOS_ACTIONS_2: "Settings > General > Software Update",
  12941. ERROR_WEBGL_SAFARI_PROBLEM: "Enable WebGL to explore in 3D.",
  12942. ERROR_WEBGL_SAFARI_ACTIONS_1: "Click ",
  12943. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferences > Advanced > Show Develop menu",
  12944. ERROR_WEBGL_SAFARI_ACTIONS_3: "Then click ",
  12945. ERROR_WEBGL_SAFARI_ACTIONS_4: "Develop > Enable WebGL",
  12946. ERROR_MISSING_URLS_PROBLEM: "Oops, there are no panoramas for this model.",
  12947. ERROR_MISSING_URLS_EXPLANATION: "This is an older model. The website owner may have a new model on the way.",
  12948. ERROR_LOADING_FAILED_PROBLEM: "模型不可用.",
  12949. ERROR_LOADING_FAILED_ACTIONS_1: "If the problem persists, ",
  12950. ERROR_LOADING_FAILED_ACTIONS_2: "see our troubleshooting guide",
  12951. ERROR_MAINTENANCE_PROBLEM: "Maintenance in progress.",
  12952. ERROR_MAINTENANCE_SOLUTION: "Please come back in a few minutes.",
  12953. LINK_TO_LOCATION: "Link to location",
  12954. MENU_COPY: "Copy",
  12955. LINK_ALERT_COPY: "Please use CTRL/CMD + C to copy.",
  12956. ROTATE: "Rotate",
  12957. INSIDE: "Inside",
  12958. MOVE: "Move",
  12959. ZOOM: "Zoom"
  12960. }
  12961. }
  12962. , {}],
  12963. 112: [function(e, t, i) {
  12964. "use strict";
  12965. t.exports = {
  12966. PAGE_TITLE: "",
  12967. LOADING: "Cargando",
  12968. PRESENTED_BY_CAPS: "PRESENTADO POR",
  12969. POWERED_BY: "potenciando por ",
  12970. POWERED_BY_CAPS: "POTENCIADO POR ",
  12971. DESKTOP_SHORT_CTA: "Haga clic para explorar este Espacio 3D.",
  12972. MOBILE_SHORT_CTA: "Pulse para explorar este Espacio 3D.",
  12973. PRESENTED_BY: "Presentado por ",
  12974. MORE: "Más ",
  12975. LESS: "Menos ",
  12976. TAG_CONTENT: "Contenido de tag™",
  12977. SHOW: "Mostrar",
  12978. HIDE: "Ocultar",
  12979. DOLLHOUSE: "Dollhouse",
  12980. FLOOR_PLAN: "Planos",
  12981. OPEN_HIGHLIGHTS: "Aspectos Destacados",
  12982. CLOSE_HIGHLIGHTS: "Cerrar",
  12983. PREVIOUS: "Anterior",
  12984. PLAY: "Play",
  12985. PAUSE: "Pausa",
  12986. NEXT: "Siguiente",
  12987. EXPLORE_3D_SPACE: "Explorar el Espacio 3D",
  12988. VIEW_DOLLHOUSE: "Ver dollhouse",
  12989. SOCIAL_SHARING: "Compartir este espacio",
  12990. VIEW_IN_VR: "Ver en realidad virtual",
  12991. VIEW_FULLSCREEN: "Ver en pantalla completa",
  12992. EXIT_FULLSCREEN: "Salir de pantalla completa",
  12993. ZOOM_IN: "Acercar",
  12994. ZOOM_OUT: "Alejar",
  12995. FLOOR_NAME: "Piso ",
  12996. FLOOR_ALL: "Todas",
  12997. TERMS: "Condiciones",
  12998. PORT_TERMS: "port términos de uso",
  12999. TERMS_OF_USE: "Términos de uso",
  13000. TERMS_TEXT_FILE: "terms-es-MX.html",
  13001. CLOSE_TERMS: "Cerrar",
  13002. 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.",
  13003. HELP: "Ayuda",
  13004. HELP_NAVIGATION_TAB: "Navegación",
  13005. HELP_MORE_HELP_TAB: "Más Ayuda",
  13006. CLOSE: "Cerrar",
  13007. HELP_DESKTOP_PANORAMA_1A: "Haga clic y arrastre para mirar alrededor del espacio.",
  13008. HELP_DESKTOP_PANORAMA_2A: "Haga clic en los aros a lo largo del espacio para moverse.",
  13009. HELP_DESKTOP_PANORAMA_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13010. HELP_DESKTOP_PANORAMA_1B: "O use las teclas de flecha para girar a la izquierda y a la derecha.",
  13011. HELP_DESKTOP_PANORAMA_2B: "O use las teclas de dirección para adelantar o retroceder.",
  13012. HELP_DESKTOP_PANORAMA_3B: "O use la tecla más para acercar y la tecla menos para alejar.",
  13013. HELP_DESKTOP_360_2A: "Haga clic en el icono Vista Interior para ingresar al Espacio.",
  13014. HELP_DESKTOP_360_2B: "O bien, presione la tecla numero 1 para entrar en la Vista Interior.",
  13015. HELP_DESKTOP_DOLLHOUSE_1A: "Haga clic izquierdo y arrastre hacia la izquierda, derecha, arriba o abajo para girar la Dollhouse.",
  13016. HELP_DESKTOP_DOLLHOUSE_2A: "Haga clic derecho y arrastre hacia la izquierda, derecha, arriba o abajo para cambiar la posición della dollhouse.",
  13017. HELP_DESKTOP_DOLLHOUSE_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13018. HELP_DESKTOP_DOLLHOUSE_1B: "O use las teclas de dirección para girar la Dollhouse.",
  13019. 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.",
  13020. HELP_DESKTOP_FLOORPLAN_2A: "Haga clic derecho y arrastre hacia la izquierda o derecha para girar la planta.",
  13021. HELP_DESKTOP_FLOORPLAN_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13022. HELP_DESKTOP_FLOORPLAN_2B: "O use las teclas para girar hacia la izquierda o derecha.",
  13023. HELP_DESKTOP_FLOORPLAN_3B: "O use las teclas de dirección para acercar o alejar.",
  13024. HELP_MOBILE_PANORAMA_1: "Toque y arrastre para mirar alrededor del espacio.",
  13025. HELP_MOBILE_PANORAMA_2: "Toque en los aros a lo largo del espacio para moverse.",
  13026. HELP_MOBILE_3: "Use el gesto de pellizcar para acercar o alejar.",
  13027. HELP_MOBILE_360_2: "Toque el ícono Vista Interior para entrar en el Espacio.",
  13028. HELP_MOBILE_DOLLHOUSE_1: "Toque y arrastre con dos dedos para cambiar la posición della dollhouse.",
  13029. HELP_MOBILE_DOLLHOUSE_2: "Toque y arrastre con dos dedos para cambiar la posición de la vista aérea.",
  13030. HELP_MOBILE_FLOORPLAN_1: "Toque y arrastre para cambiar la posición de la planta.",
  13031. HELP_MOBILE_FLOORPLAN_2: "Toque y arrastre con dos dedos para girar la planta.",
  13032. HELP_MORE_HLR_A: "Galería destacada",
  13033. HELP_DESKTOP_MORE_HLR_B: "Abra para navegar a través del espacio utilizando imágenes en miniatura.",
  13034. HELP_MORE_DOLLHOUSE_A: "Vista aérea por pisos",
  13035. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Haga clic para ver y girar la Dollhouse del espacio completo en 3D.",
  13036. HELP_MOBILE_MORE_DOLLHOUSE_B: "Toque para ver y girar la vista Dollhouse del espacio completo en 3D.",
  13037. HELP_MORE_FLOORS_A: "Seleccionador de plantas",
  13038. HELP_DESKTOP_MORE_FLOORS_B: "Cambie de una planta a otra en el espacio.",
  13039. HELP_MORE_TAG_A: "tag™ Posts",
  13040. HELP_DESKTOP_MORE_TAG_B: "Haga clic o coloque el cursor para obtener más información acerca de las características del espacio.",
  13041. HELP_MOBILE_MORE_TAG_B: "Toque para obtener más información acerca de las características del espacio.",
  13042. HELP_MORE_ZOOM_A: "Controles de zoom",
  13043. HELP_DESKTOP_MORE_ZOOM_B: "Use estos controles o la rueda de desplazamiento para acercar o alejar.",
  13044. HELP_MORE_TOUR_A: "Controles de recorrido",
  13045. HELP_DESKTOP_MORE_TOUR_B: "Reproduzca, pause, adelante o retroceda a través de un recorrido guiado.",
  13046. HELP_MORE_INSIDE_A: "Vista interior",
  13047. HELP_DESKTOP_MORE_INSIDE_B: "Haga clic para explorar el interior del espacio.",
  13048. HELP_MOBILE_MORE_INSIDE_B: "Toque para explorar el interior del espacio.",
  13049. HELP_MORE_VR_A: "Modo de realidad virtual",
  13050. HELP_DESKTOP_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13051. HELP_MOBILE_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13052. HELP_MORE_360_A: "360° Views",
  13053. HELP_DESKTOP_MORE_360_B: "Una vez que se encuentre en galería destacada, haga clic en vistas de 360º para ver el exterior.",
  13054. HELP_MOBILE_MORE_360_B: "Una vez que se encuentre en galería destacada, toque en vistas de 360º para ver el exterior.",
  13055. HELP_MORE_FULLSCREEN_A: "Pantalla completa",
  13056. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expanda el escenario 3D para verlo en pantalla completa.",
  13057. WEBVR_FOR_CARDBOARD: "Para Google Cardboard",
  13058. WEBVR_FOR_DAYDREAM: "Para Daydream View",
  13059. WEBVR_ENTER_WEBVR: "ENTRAR VR",
  13060. WEBVR_DIFFERENT_HEADSET: "¿Tiene un auricular diferente?",
  13061. WEBVR_LEARN_MORE: "Más información",
  13062. WEBVR_VIEW_SPACE: "Ver Espacio en VR",
  13063. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13064. WEBVR_DAYDREAM_PHONE: "Daydream Teléfono listos",
  13065. WEBVR_VIEW_CARDBOARD: "O Ver en Google Cardboard",
  13066. VR_NEED_DAYDREAM: "Necesidades antes de acoplarse con Daydream View",
  13067. VR_NEED_DAYDREAM_PHONE: "Teléfono listo para Daydream",
  13068. VR_GOOGLE_DAYDREAM: "Daydream de Google",
  13069. VR_APP: "port VR App",
  13070. VR_COMPATIBLE_ANDROID_LONG: 'Compatible con los Dispositivos Android con Pantallas de 4.5"-5.5" operando Android OS 4.4.4 y posteriores',
  13071. VR_APP_FOR_ANDROID: "Aplicación port VR para Teléfonos Android",
  13072. VR_APP_OPEN: "Abrir con la aplicación port VR en su lugar",
  13073. VR_VIEW_SPACE: "Ver Espacio en realidad virtual",
  13074. VR_LEARN_MORE_CAPS: "SABER MÁS",
  13075. VR_PREVIOUS_CAPS: "ANTERIOR",
  13076. VR_NEXT_CAPS: "SIGUIENTE",
  13077. VR_GOT_IT_CAPS: "COMPRENDIDO",
  13078. VR_SHOW_SUPPORTED: "Pulse para ver el Espacio en realidad virtual con",
  13079. VR_SHOW_UNSUPPORTED: "Lo sentimos, pero su dispositivo no cumple los requisitos mínimos para ver un Espacio en realidad virtual.",
  13080. VR_SHOW_IOS_1: "Pulse para ver el Espacio en realidad virtual",
  13081. VR_SHOW_IOS_2: "Necesita la aplicación port VR y un iPhone compatible para ver",
  13082. VR_WHAT_YOU_NEED: "Lo que necesitaras...",
  13083. VR_NEED_CARDBOARD: "Lo que necesitaras con Google Cardboard",
  13084. VR_NEED_SAMSUNG: "Lo que necesitaras con el Samsung Gear VR",
  13085. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13086. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13087. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13088. VR_COMPATIBLE_IPHONES_2: "Compatible con iPhone 6S o superior y con iOS 9.1 en adelante",
  13089. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13090. VR_COMPATIBLE_ANDROID: "Dispositivos Android compatibles",
  13091. VR_ANDROID_DETAIL: "Pantallas de 11.43 cm a 13.97 cm con OS de Android 4.4.4 en adelante",
  13092. VR_ANDROID_DVICES: "Dispositivos Android",
  13093. VR_COMPATIBLE_SAMSUNG: "Dispositivos compatibles del Samsung",
  13094. VR_SAMSUNG_DETAIL: "Galaxy S5 en adelante",
  13095. VR_APP_FOR_CARDBOARD: "Aplicación port VR para Google Cardboard",
  13096. VR_APP_FOR_SAMSUNG: "Aplicación port VR para Gear VR",
  13097. VR_DOWNLOAD_HERE: "Descargar aquí",
  13098. VR_REQUIRE_HEADSET: "Necesita un casco de realidad virtual y que se instale la aplicación port VR para Android",
  13099. VR_REDIRECT_TO_STORE: "Si la aplicación no está instalada, se le redirigirá a la tienda de aplicaciones.",
  13100. VR_IMPROPER_EMBED: "El espacio de port no está incorporado correctamente para apoyar VR en su navegador web.",
  13101. VR_OPEN_ANDROID_LINK: "Abre el enlace en tu teléfono móvil",
  13102. VR_ANDROID_OPTIONS: "Opciones de auriculares en RV disponibles",
  13103. SHARE_TO: "Compartir en",
  13104. SHARE_LINK: "Enlace directo",
  13105. SHARE_EXPLORE: "Explorar ",
  13106. SHARE_AT: "en",
  13107. SHARE_WITH: "con",
  13108. SHARE_3D: " en 3D",
  13109. SHARE_COPIED: "¡Copiado!",
  13110. ERROR_BROWSER_SOLUTION: "Instale un nuevo navegador para explorar en 3D.",
  13111. ERROR_BROWSER_EXPLANATION: "WebGL requiere un navegador moderno.",
  13112. ERROR_GENERIC_PROBLEM: "Vaya, algo ha ido mal.",
  13113. ERROR_GENERIC_SOLUTION: "Reinicie su navegador.",
  13114. ERROR_GENERIC_ACTIONS_1: "Si el problema persiste, ",
  13115. ERROR_GENERIC_ACTIONS_2: "instale un navegador compatible",
  13116. ERROR_GENERIC_ACTIONS_3: " o ",
  13117. ERROR_GENERIC_ACTIONS_4: "consulte nuestra guía de solución de problemas",
  13118. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navegador no compatible.",
  13119. ERROR_WEBGL_IOS_PROBLEM: "Versión de iOS no compatible.",
  13120. ERROR_WEBGL_IOS_SOLUTION: "Actualice a iOS 8 o superior para explorar en 3D.",
  13121. ERROR_WEBGL_IOS_ACTIONS_1: "Pulse ",
  13122. ERROR_WEBGL_IOS_ACTIONS_2: "Ajustes > General > Actualización de software",
  13123. ERROR_WEBGL_SAFARI_PROBLEM: "Habilite WebGL para explorar en 3D.",
  13124. ERROR_WEBGL_SAFARI_ACTIONS_1: "Haga clic en ",
  13125. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferencias > Avanzado > Mostrar el menú Desarrollar",
  13126. ERROR_WEBGL_SAFARI_ACTIONS_3: "Después, haga clic en ",
  13127. ERROR_WEBGL_SAFARI_ACTIONS_4: "Desarrollar > Habilitar WebGL",
  13128. ERROR_MISSING_URLS_PROBLEM: "Vaya, no hay panoramas para este modelo.",
  13129. ERROR_MISSING_URLS_EXPLANATION: "Este es un modelo antiguo. El propietario del sitio web puede tener un nuevo modelo en mente.",
  13130. ERROR_LOADING_FAILED_PROBLEM: "Vaya, modelo no disponible.",
  13131. ERROR_LOADING_FAILED_ACTIONS_1: "Si el problema persiste, ",
  13132. ERROR_LOADING_FAILED_ACTIONS_2: "consulte nuestra guía de solución de problemas",
  13133. ERROR_MAINTENANCE_PROBLEM: "Mantenimiento en progreso.",
  13134. ERROR_MAINTENANCE_SOLUTION: "Regrese en unos minutos.",
  13135. LINK_TO_LOCATION: "Enlace a la ubicación",
  13136. MENU_COPY: "Copiar",
  13137. LINK_ALERT_COPY: "Utilice CTRL/CMD + C para copiar.",
  13138. ROTATE: "Girar",
  13139. INSIDE: "Interior",
  13140. MOVE: "Moverse",
  13141. ZOOM: "Acercar o alejar"
  13142. }
  13143. }
  13144. , {}],
  13145. 113: [function(e, t, i) {
  13146. "use strict";
  13147. t.exports = {
  13148. PAGE_TITLE: "",
  13149. LOADING: "Chargement",
  13150. PRESENTED_BY_CAPS: "PRÉSENTÉ PAR",
  13151. POWERED_BY: "alimenté par ",
  13152. POWERED_BY_CAPS: "ALIMENTÉ PAR",
  13153. DESKTOP_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13154. MOBILE_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13155. PRESENTED_BY: "Présenté par ",
  13156. MORE: "Plus ",
  13157. LESS: "Moins ",
  13158. TAG_CONTENT: "Contenu tag™",
  13159. SHOW: "Montrer",
  13160. HIDE: "Cacher",
  13161. DOLLHOUSE: "Dollhouse",
  13162. FLOOR_PLAN: "Plan de sol",
  13163. OPEN_HIGHLIGHTS: "Ouvrir les faits saillants",
  13164. CLOSE_HIGHLIGHTS: "Fermer",
  13165. PREVIOUS: "Précédent",
  13166. PLAY: "Lecture",
  13167. PAUSE: "Pause",
  13168. NEXT: "Suivant",
  13169. EXPLORE_3D_SPACE: "Explorer l'Espace en 3D",
  13170. VIEW_DOLLHOUSE: "Voir dollhouse",
  13171. SOCIAL_SHARING: "Partager cet espace",
  13172. VIEW_IN_VR: "Voir en VR",
  13173. VIEW_FULLSCREEN: "Plein écran",
  13174. EXIT_FULLSCREEN: "Fermer plein écran",
  13175. ZOOM_IN: "Zoom avant",
  13176. ZOOM_OUT: "Zoom arrière",
  13177. FLOOR_NAME: "Étage ",
  13178. FLOOR_ALL: "Tous",
  13179. TERMS: "Mentions légales",
  13180. PORT_TERMS: "port mentions légales",
  13181. TERMS_OF_USE: "Conditions d'utilisation",
  13182. TERMS_TEXT_FILE: "terms-fr-FR.html",
  13183. CLOSE_TERMS: "Fermer",
  13184. TERMS_FAIL: "Impossible d'accéder aux mentions légales. Vérifiez que vous avez une connexion Internet pour afficher les conditions d'utilisation.",
  13185. HELP: "Aide",
  13186. HELP_NAVIGATION_TAB: "Navigation",
  13187. HELP_MORE_HELP_TAB: "Aide",
  13188. CLOSE: "Fermer",
  13189. HELP_DESKTOP_PANORAMA_1A: "Cliquez et faites glisser pour regarder autour de l’espace.",
  13190. HELP_DESKTOP_PANORAMA_2A: "Cliquez sur les anneaux pour vous déplacer.",
  13191. HELP_DESKTOP_PANORAMA_3A: "Utilisez la molette de votre souris pour zoomer.",
  13192. HELP_DESKTOP_PANORAMA_1B: "Ou utilisez les touches pour tourner.",
  13193. HELP_DESKTOP_PANORAMA_2B: "Ou utilisez les touches pour avancer et reculer.",
  13194. HELP_DESKTOP_PANORAMA_3B: "Ou utilisez les touches plus et moins pour zoomer.",
  13195. HELP_DESKTOP_360_2A: "Cliquez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13196. HELP_DESKTOP_360_2B: "Ou, appuyez sur la touche numéro 1 pour entrer dans la Vue Intérieure.",
  13197. HELP_DESKTOP_DOLLHOUSE_1A: "Faites un clic gauche et bougez votre souris pour faire pivoter la vue Dollhouse.",
  13198. HELP_DESKTOP_DOLLHOUSE_2A: "Faites un clic droit et bougez votre souris pour changer la position de la vue Dollhouse.",
  13199. HELP_DESKTOP_DOLLHOUSE_3A: "Utilisez la molette de votre souris pour zoomer.",
  13200. HELP_DESKTOP_DOLLHOUSE_1B: "Ou utilisez les touches pour faire pivoter la vue Dollhouse.",
  13201. HELP_DESKTOP_FLOORPLAN_1A: "Faites un clic droit pour changer la position du plan sur l’écran.",
  13202. HELP_DESKTOP_FLOORPLAN_2A: "Faites un clic droit et faites glisser à gauche ou à droite pour faire pivoter le plan.",
  13203. HELP_DESKTOP_FLOORPLAN_3A: "Utilisez la molette de votre souris pour zoomer.",
  13204. HELP_DESKTOP_FLOORPLAN_2B: "Ou utilisez les touches pour faire pivoter à gauche ou à droite.",
  13205. HELP_DESKTOP_FLOORPLAN_3B: "Ou utilisez les touches pour effectuer un zoom avant ou arrière.",
  13206. HELP_MOBILE_PANORAMA_1: "Touchez et faites glisser pour regarder autour de l’espace.",
  13207. HELP_MOBILE_PANORAMA_2: "Tapez sur les anneaux dans tout l’espace pour vous déplacer.",
  13208. HELP_MOBILE_3: "Utilisez un geste de pincement pour zoomer avant/arrière.",
  13209. HELP_MOBILE_360_2: "Tapez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13210. HELP_MOBILE_DOLLHOUSE_1: "Touchez et faites glisser vers le haut/bas/gauche/droite pour faire pivoter la vue Dollhouse.",
  13211. HELP_MOBILE_DOLLHOUSE_2: "Touchez et faites glisser avec deux doigts pour positionner vue en coupe.",
  13212. HELP_MOBILE_FLOORPLAN_1: "Touchez et faites glisser pour positionner le plan.",
  13213. HELP_MOBILE_FLOORPLAN_2: "Touchez et faites glisser avec deux doigts pour faire pivoter le plan.",
  13214. HELP_MORE_HLR_A: "Carrousel",
  13215. HELP_DESKTOP_MORE_HLR_B: "Ouvrez pour naviguer dans l’espace en utilisant les vignettes.",
  13216. HELP_MORE_DOLLHOUSE_A: "Vue en coupe",
  13217. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Cliquez pour afficher et faire pivoter l’espace entier en 3D.",
  13218. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tapez pour afficher et faire pivoter l’espace entier en 3D.",
  13219. HELP_MORE_FLOORS_A: "Sélecteur d’étage",
  13220. HELP_DESKTOP_MORE_FLOORS_B: "Basculer entre les étages dans l’espace.",
  13221. HELP_MORE_TAG_A: "tag™ Posts",
  13222. HELP_DESKTOP_MORE_TAG_B: "Cliquez ou survolez pour obtenir des informations sur l’espace.",
  13223. HELP_MOBILE_MORE_TAG_B: "Tapez pour obtenir des informations sur l’espace.",
  13224. HELP_MORE_ZOOM_A: "Commandes de zoom",
  13225. HELP_DESKTOP_MORE_ZOOM_B: "Utilisez votre clavier ou la molette de votre souris pour zoomer.",
  13226. HELP_MORE_TOUR_A: "Commandes de la visite",
  13227. HELP_DESKTOP_MORE_TOUR_B: "Mettez en marche ou en pause, avancez et reculez lors d'une visite guidée.",
  13228. HELP_MORE_INSIDE_A: "Vue intérieure",
  13229. HELP_DESKTOP_MORE_INSIDE_B: "Cliquez pour explorer l’intérieur de l’espace.",
  13230. HELP_MOBILE_MORE_INSIDE_B: "Tapez pour explorer l’intérieur de l’espace.",
  13231. HELP_MORE_VR_A: "Mode RV",
  13232. HELP_DESKTOP_MORE_VR_B: "Cliquez pour lancer l’espace en réalité virtuelle.",
  13233. HELP_MOBILE_MORE_VR_B: "Tapez pour lancer l’espace en réalité virtuelle.",
  13234. HELP_MORE_360_A: "Vues 360°",
  13235. HELP_DESKTOP_MORE_360_B: "Cliquez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13236. HELP_MOBILE_MORE_360_B: "Tapez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13237. HELP_MORE_FULLSCREEN_A: "Plein écran",
  13238. HELP_DESKTOP_MORE_FULLSCREEN_B: "Voir 3D Showcase en plein écran.",
  13239. WEBVR_FOR_CARDBOARD: "Pour Google Cardboard",
  13240. WEBVR_FOR_DAYDREAM: "Pour Daydream View",
  13241. WEBVR_ENTER_WEBVR: "ENTRER VR",
  13242. WEBVR_DIFFERENT_HEADSET: "Avez-vous un casque différent?",
  13243. WEBVR_LEARN_MORE: "En savoir plus",
  13244. WEBVR_VIEW_SPACE: "Voir Espace en VR",
  13245. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13246. WEBVR_DAYDREAM_PHONE: "Téléphone compatibles Daydream",
  13247. WEBVR_VIEW_CARDBOARD: "Ou Afficher sur Google Cardboard",
  13248. VR_VIEW_SPACE: "Voir l'Espace en Réalité Virtuelle",
  13249. VR_LEARN_MORE_CAPS: "EN SAVOIR PLUS",
  13250. VR_PREVIOUS_CAPS: "PRÉCÉDENT",
  13251. VR_NEXT_CAPS: "SUIVANT",
  13252. VR_GOT_IT_CAPS: "BIEN COMPRIS",
  13253. VR_SHOW_SUPPORTED: "Taper pour voir l'Espace en VR avec",
  13254. VR_SHOW_UNSUPPORTED: "Désolé mais votre appareil ne répond pas aux critères minimaux pour voir cet Espace en mode VR.",
  13255. VR_SHOW_IOS_1: "Taper pour voir l’Espace en Realité Virtuelle",
  13256. VR_SHOW_IOS_2: "Nécessite l’application port VR et un iPhone compatible pour voir",
  13257. VR_WHAT_YOU_NEED: "Ce dont vous aurez besoin pour...",
  13258. VR_NEED_CARDBOARD: "Ce dont vous aurez besoin avec Google Cardboard",
  13259. VR_NEED_SAMSUNG: "Ce dont vous aurez besoin avec Samsung Gear VR",
  13260. VR_NEED_DAYDREAM: "BESOINS AVANT APPARIEMENT AVEC DAYDREAM VIEW",
  13261. VR_NEED_DAYDREAM_PHONE: "Téléphone compatible avec Daydream",
  13262. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13263. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13264. VR_APP: "port VR App",
  13265. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13266. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13267. VR_COMPATIBLE_IPHONES_2: "iPhone 5s et plus récent, avec iOS 9.1 et plus récent",
  13268. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13269. VR_COMPATIBLE_ANDROID: "Appareils Android compatibles",
  13270. 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",
  13271. VR_ANDROID_DETAIL: 'Écrans 4.5" à 5.5" avec Android 4.4.4 ou plus récent',
  13272. VR_ANDROID_DVICES: "Appareils Android",
  13273. VR_COMPATIBLE_SAMSUNG: "Appareils Samsung Compatibles",
  13274. VR_SAMSUNG_DETAIL: "Galaxy S6 et plus récents",
  13275. VR_APP_FOR_CARDBOARD: "Application port VR pour Google Cardboard",
  13276. VR_APP_FOR_SAMSUNG: "Application port VR pour Gear VR",
  13277. VR_APP_FOR_ANDROID: "Application port VR pour téléphones Android",
  13278. VR_APP_OPEN: "Ouvrir plutôt avec l’application port VR",
  13279. VR_DOWNLOAD_HERE: "Télécharger ici",
  13280. VR_REQUIRE_HEADSET: "Nécessite un casque VR et l'application port VR pour Android afin d'être installé",
  13281. VR_REDIRECT_TO_STORE: "Si l'application n'est pas installée, vous serez rediriger vers l'App store.",
  13282. VR_IMPROPER_EMBED: "L'Espace port n'est pas correctement intégré pour supporter VR dans votre navigateur Web.",
  13283. VR_OPEN_ANDROID_LINK: "Ouvrez ce lien avec votre appareil mobile",
  13284. VR_ANDROID_OPTIONS: "Options disponibles pour casque VR sous",
  13285. SHARE_TO: "Partager sur",
  13286. SHARE_LINK: "Lien direct",
  13287. SHARE_EXPLORE: "Explorer ",
  13288. SHARE_AT: "à",
  13289. SHARE_WITH: "avec",
  13290. SHARE_3D: " en 3D",
  13291. SHARE_COPIED: "Copié!",
  13292. ERROR_BROWSER_SOLUTION: "Installer un nouveau navigateur pour explorer en 3D.",
  13293. ERROR_BROWSER_EXPLANATION: "WebGL a besoin d'un navigateur récent.",
  13294. ERROR_GENERIC_PROBLEM: "Il y eu un problème.",
  13295. ERROR_GENERIC_SOLUTION: "Redémarrer votre navigateur.",
  13296. ERROR_GENERIC_ACTIONS_1: "Si le problème persiste, ",
  13297. ERROR_GENERIC_ACTIONS_2: "installez un navigateur plus récent",
  13298. ERROR_GENERIC_ACTIONS_3: " ou ",
  13299. ERROR_GENERIC_ACTIONS_4: "voir notre guide de dépannage",
  13300. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navigateur non-supporté.",
  13301. ERROR_WEBGL_IOS_PROBLEM: "Version iOS non-supportée.",
  13302. ERROR_WEBGL_IOS_SOLUTION: "Mettre à jour avec iOS8 au minimum pour voir l'Espace en 3D.",
  13303. ERROR_WEBGL_IOS_ACTIONS_1: "Tapez ",
  13304. ERROR_WEBGL_IOS_ACTIONS_2: "Paramètres > Général > Mise à jour Software",
  13305. ERROR_WEBGL_SAFARI_PROBLEM: "Activez WegGL pour explorer en 3D.",
  13306. ERROR_WEBGL_SAFARI_ACTIONS_1: "Cliquez ",
  13307. ERROR_WEBGL_SAFARI_ACTIONS_2: "Préferences > Avancés > Voir menu développeur",
  13308. ERROR_WEBGL_SAFARI_ACTIONS_3: "Puis cliquez ",
  13309. ERROR_WEBGL_SAFARI_ACTIONS_4: "Développe > Activé WebGL",
  13310. ERROR_MISSING_URLS_PROBLEM: "Il n'y a pas de panoromas pour ce modèle.",
  13311. ERROR_MISSING_URLS_EXPLANATION: "Ceci est un ancien modèle. Le propriétaire du site a peut-être un nouveau modèle en cours.",
  13312. ERROR_LOADING_FAILED_PROBLEM: "Ce modèle n'est pas disponible.",
  13313. ERROR_LOADING_FAILED_ACTIONS_1: "Si le problème persiste, ",
  13314. ERROR_LOADING_FAILED_ACTIONS_2: "voir notre guide de dépannage",
  13315. ERROR_MAINTENANCE_PROBLEM: "Maintenance en cours.",
  13316. ERROR_MAINTENANCE_SOLUTION: "Revenez dans quelques instants.",
  13317. LINK_TO_LOCATION: "Lien vers l'emplacement",
  13318. MENU_COPY: "Copie",
  13319. LINK_ALERT_COPY: "Utiliser CTRL+CMD C pour copier.",
  13320. ROTATE: "Faire pivoter",
  13321. INSIDE: "Intérieure",
  13322. MOVE: "Se déplacer",
  13323. ZOOM: "Zoom"
  13324. }
  13325. }
  13326. , {}],
  13327. 114: [function(e, t, i) {
  13328. "use strict";
  13329. t.exports = {
  13330. PAGE_TITLE: "",
  13331. LOADING: "読み込み中",
  13332. PRESENTED_BY_CAPS: "PRESENTED BY",
  13333. POWERED_BY: "powered by",
  13334. POWERED_BY_CAPS: "POWERED BY",
  13335. DESKTOP_SHORT_CTA: "クリックしてこの3D Spaceを探索",
  13336. MOBILE_SHORT_CTA: "タップしてこの3D Spaceを探索",
  13337. PRESENTED_BY: "Presented by ",
  13338. MORE: "全て表示 ",
  13339. LESS: "閉じる ",
  13340. TAG_CONTENT: "tag™コンテンツ ",
  13341. SHOW: "表示",
  13342. HIDE: "非表示",
  13343. DOLLHOUSE: "ドールハウス",
  13344. FLOOR_PLAN: "フロアプラン",
  13345. OPEN_HIGHLIGHTS: "ハイライトを開く",
  13346. CLOSE_HIGHLIGHTS: "閉じる",
  13347. PREVIOUS: "前へ",
  13348. PLAY: "再生",
  13349. PAUSE: "一時停止",
  13350. NEXT: "次へ",
  13351. EXPLORE_3D_SPACE: "3DSpaceの探索",
  13352. VIEW_DOLLHOUSE: "ドールハウスの表示",
  13353. SOCIAL_SHARING: "このSpaceを共有する",
  13354. VIEW_IN_VR: "VRで表示",
  13355. VIEW_FULLSCREEN: "フルスクリーン表示",
  13356. EXIT_FULLSCREEN: "フルスクリーン表示を終了",
  13357. ZOOM_IN: "ズームイン",
  13358. ZOOM_OUT: "ズームアウト",
  13359. FLOOR_NAME: "フロア ",
  13360. FLOOR_ALL: "すべて",
  13361. TERMS: "規約",
  13362. PORT_TERMS: "port規約",
  13363. TERMS_OF_USE: "利用規約",
  13364. CLOSE_TERMS: "閉じる",
  13365. TERMS_TEXT_FILE: "terms-jp-JP.html",
  13366. TERMS_FAIL: "規約を取得できませんでした。利用規約を表示するためにインターネットに接続されていることを確認してください。",
  13367. WEBVR_FOR_DAYDREAM: "Daydream View用",
  13368. WEBVR_ENTER_WEBVR: "VRに入る",
  13369. WEBVR_DIFFERENT_HEADSET: "別のヘッドセットをお持ちですか?",
  13370. WEBVR_LEARN_MORE: "もっと詳しく",
  13371. WEBVR_VIEW_SPACE: "VRでSpaceを表示",
  13372. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13373. WEBVR_DAYDREAM_PHONE: "Daydream対応スマホ",
  13374. WEBVR_FOR_CARDBOARD: "Google Cardboard用",
  13375. WEBVR_VIEW_CARDBOARD: "またはGoogle Cardboardで表示",
  13376. VR_VIEW_SPACE: "バーチャルリアリティでSpaceを表示",
  13377. VR_LEARN_MORE_CAPS: "もっと詳しく",
  13378. VR_PREVIOUS_CAPS: "前へ",
  13379. VR_NEXT_CAPS: "次へ",
  13380. VR_GOT_IT_CAPS: "了解",
  13381. VR_SHOW_SUPPORTED: "タップして次を使用してVRでSpaceを表示: ",
  13382. VR_SHOW_UNSUPPORTED: "お使いのデバイスはVRでSpaceを表示する最低要件を満たしていません",
  13383. VR_SHOW_IOS_1: "タップしてVRでSpaceを表示",
  13384. VR_SHOW_IOS_2: "表示するにはport VRアプリと互換性のあるiPhoneが必要です",
  13385. VR_WHAT_YOU_NEED: "必要なもの",
  13386. VR_NEED_CARDBOARD: "Google Cardboardに必要なもの",
  13387. VR_NEED_SAMSUNG: "Samsung Gear VRに必要なもの",
  13388. VR_NEED_DAYDREAM: "事前にDaydream Viewとのペアリングが必要です",
  13389. VR_NEED_DAYDREAM_PHONE: "Daydream対応スマホ",
  13390. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13391. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13392. VR_APP: "port VRアプリ",
  13393. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13394. VR_COMPATIBLE_IPHONES_1: "iPhone",
  13395. VR_COMPATIBLE_IPHONES_2: "iOS 9.1以降で動作するiPhone 5s以降のモデル",
  13396. VR_COMPATIBLE_IPHONES_3: "互換性のあるiPhone",
  13397. VR_COMPATIBLE_ANDROID: "互換性のあるAndroidデバイス",
  13398. VR_COMPATIBLE_ANDROID_LONG: "Android OS 4.4.4以降で動作する互換性のあるAndroidデバイスの4.5~5.5インチディスプレイ",
  13399. VR_ANDROID_DETAIL: "Android OS 4.4.4以降で動作する4.5~5.5インチディスプレイ",
  13400. VR_ANDROID_DVICES: "Androidデバイス",
  13401. VR_COMPATIBLE_SAMSUNG: "互換性のあるSamsungデバイス",
  13402. VR_SAMSUNG_DETAIL: "Galaxy S5以降のモデル",
  13403. VR_APP_FOR_CARDBOARD: "Google Cardboard用のport VRアプリ",
  13404. VR_APP_FOR_SAMSUNG: "Gear VR 用のport VRアプリ",
  13405. VR_APP_FOR_ANDROID: "Androidフォン用のport VRアプリ",
  13406. VR_APP_OPEN: "port VRアプリで開く",
  13407. VR_DOWNLOAD_HERE: "ここからダウンロード",
  13408. VR_REQUIRE_HEADSET: "Android 用のVRヘッドセットとport VRアプリ をインストールする必要があります",
  13409. VR_REDIRECT_TO_STORE: "アプリがインストールされていない場合、App Storeにリダイレクトされます",
  13410. VR_IMPROPER_EMBED: "お使いのウェブブラウザでVRがサポートされるようport Spaceが適切に埋め込まれていません。",
  13411. VR_OPEN_ANDROID_LINK: "お使いの携帯電話でリンクを開いてください",
  13412. VR_ANDROID_OPTIONS: "利用可能なVRヘッドセットオプション",
  13413. SHARE_TO: "共有先",
  13414. SHARE_LINK: "ダイレクトリンク",
  13415. SHARE_EXPLORE: "探索",
  13416. SHARE_AT: "場所",
  13417. SHARE_WITH: "使用アプリ",
  13418. SHARE_3D: "3Dで",
  13419. SHARE_COPIED: "コピーされました!",
  13420. ERROR_BROWSER_SOLUTION: "3D探索するには、新しいバージョンのブラウザをインストールしてください",
  13421. ERROR_BROWSER_EXPLANATION: "WebGLにはモダンブラウザが必要です。",
  13422. ERROR_GENERIC_PROBLEM: "問題が発生しました。",
  13423. ERROR_GENERIC_SOLUTION: "ブラウザを再起動してください。",
  13424. ERROR_GENERIC_ACTIONS_1: "問題が解決しない場合は、",
  13425. ERROR_GENERIC_ACTIONS_2: "サポートされているブラウザをインストールしてください",
  13426. ERROR_GENERIC_ACTIONS_3: "または",
  13427. ERROR_GENERIC_ACTIONS_4: "トラブルシューティングガイドを参照してください",
  13428. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "ブラウザがサポートされていません。",
  13429. ERROR_WEBGL_IOS_PROBLEM: "サポートされていないiOSバージョンです。",
  13430. ERROR_WEBGL_IOS_SOLUTION: "3D探索するには、iOS 8以降にアップグレードしてください。",
  13431. ERROR_WEBGL_IOS_ACTIONS_1: "以下の順にタップします:",
  13432. ERROR_WEBGL_IOS_ACTIONS_2: "設定 > 全般 > ソフトウェアの更新",
  13433. ERROR_WEBGL_SAFARI_PROBLEM: "WebGLを有効にして3Dで探索します。",
  13434. ERROR_WEBGL_SAFARI_ACTIONS_1: "以下の順にクリックします:",
  13435. ERROR_WEBGL_SAFARI_ACTIONS_2: "環境設定 > 詳細 > メニューバーに開発メニューを表示",
  13436. ERROR_WEBGL_SAFARI_ACTIONS_3: "その後、以下の順にクリックします:",
  13437. ERROR_WEBGL_SAFARI_ACTIONS_4: "開発 > WebGLを有効にする",
  13438. ERROR_MISSING_URLS_PROBLEM: "このモデルではパノラマを使用できません。",
  13439. ERROR_MISSING_URLS_EXPLANATION: "これは古いモデルです。ウェブサイト所有者が新しいモデルを開発中かもしれません。",
  13440. ERROR_LOADING_FAILED_PROBLEM: "モデルは利用できません。",
  13441. ERROR_LOADING_FAILED_ACTIONS_1: "問題が解決しない場合は、",
  13442. ERROR_LOADING_FAILED_ACTIONS_2: "トラブルシューティングガイドを参照してください",
  13443. ERROR_MAINTENANCE_PROBLEM: "メンテナンスは進行中です。",
  13444. ERROR_MAINTENANCE_SOLUTION: "しばらくしてからやり直し てください。",
  13445. LINK_TO_LOCATION: "ロケーションへのリンク",
  13446. MENU_COPY: "コピー",
  13447. LINK_ALERT_COPY: "コピーするにはCTRL/CMD + Cを使用してください。",
  13448. ROTATE: "回転",
  13449. MOVE: "移動",
  13450. INSIDE: "内側",
  13451. ZOOM: "ズーム",
  13452. HELP: "ヘルプ",
  13453. HELP_NAVIGATION_TAB: "ナビゲーション",
  13454. HELP_MORE_HELP_TAB: "その他のヘルプ",
  13455. HELP_DESKTOP_PANORAMA_1A: "Spaceを見回すには、クリックしてドラッグします。",
  13456. HELP_DESKTOP_PANORAMA_2A: "移動するには、Space全体にあるリングをクリックします。",
  13457. HELP_DESKTOP_PANORAMA_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13458. HELP_DESKTOP_PANORAMA_1B: "または、矢印キーを使用して左右に向きを変えます。",
  13459. HELP_DESKTOP_PANORAMA_2B: "または、矢印キーを使用して前後に向きを変えます。",
  13460. HELP_DESKTOP_PANORAMA_3B: "あるいは、プラス(+)キーまたはマイナス(-)キーを使用して、ズームイン、ズームアウトします。",
  13461. HELP_DESKTOP_360_2A: "内側ビューアイコンをクリックしてSpaceに入ります。",
  13462. HELP_DESKTOP_360_2B: "または、数字キー1を押して内側ビューに入ります。",
  13463. HELP_DESKTOP_DOLLHOUSE_1A: "左クリックと左右、上下のドラッグでドールハウスを回転します。",
  13464. HELP_DESKTOP_DOLLHOUSE_2A: "右クリックと左右、上下のドラッグでドールハウスの画面上の位置を変更します。",
  13465. HELP_DESKTOP_DOLLHOUSE_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13466. HELP_DESKTOP_DOLLHOUSE_1B: "または、矢印キーを使用してドールハウスを回転します。",
  13467. HELP_DESKTOP_FLOORPLAN_1A: "左ボタンを押しながら、上下左右にドラッグしてフロアプランの画面上の位置を変更します。",
  13468. HELP_DESKTOP_FLOORPLAN_2A: "右ボタンを押しながら左右にドラッグして、フロアプランを回転します。",
  13469. HELP_DESKTOP_FLOORPLAN_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13470. HELP_DESKTOP_FLOORPLAN_2B: "または、矢印キーを使用して左右に回転します。",
  13471. HELP_DESKTOP_FLOORPLAN_3B: "または、矢印キーを使用して、ズームイン、ズームアウトします。",
  13472. HELP_MOBILE_PANORAMA_1: "Spaceを見回すには、タッチしてドラッグします。",
  13473. HELP_MOBILE_PANORAMA_2: "移動するには、Space全体にあるリングをタップします。",
  13474. HELP_MOBILE_3: "ピンチジェスチャーを使用してズームイン、ズームアウトします。",
  13475. HELP_MOBILE_360_2: "内側ビューアイコンをタップしてSpaceに入ります。",
  13476. HELP_MOBILE_DOLLHOUSE_1: "タッチして上下左右にドラッグしてドールハウスを回転します。",
  13477. HELP_MOBILE_DOLLHOUSE_2: "タッチして、2本指でドラッグしてドールハウスを配置します。",
  13478. HELP_MOBILE_FLOORPLAN_1: "タッチ&ドラッグしてフロアプランを配置します。",
  13479. HELP_MOBILE_FLOORPLAN_2: "タッチして、2本指でドラッグしてフロアプランを回転します。",
  13480. HELP_MORE_HLR_A: "ハイライト",
  13481. HELP_DESKTOP_MORE_HLR_B: "サムネイル画像を使用してSpaceを移動するために開きます。",
  13482. HELP_MORE_DOLLHOUSE_A: "ドールハウス",
  13483. HELP_DESKTOP_MORE_DOLLHOUSE_B: "クリックして3DでSpace全体のトップダウンビューを表示して回転します。",
  13484. HELP_MOBILE_MORE_DOLLHOUSE_B: "タップして3DでSpace全体のトップダウンビューを表示して回転します。",
  13485. HELP_MORE_FLOORS_A: "フロアセレクター",
  13486. HELP_DESKTOP_MORE_FLOORS_B: "Space内のフロアを切り替えます。",
  13487. HELP_MORE_TAG_A: "tag™ Posts",
  13488. HELP_DESKTOP_MORE_TAG_B: "クリックするか、カーソルを置くとSpace内の機能についての説明が表示されます。",
  13489. HELP_MOBILE_MORE_TAG_B: "タップするとSpace内の機能についての説明が表示されます。",
  13490. HELP_MORE_ZOOM_A: "ズームコントロール",
  13491. HELP_DESKTOP_MORE_ZOOM_B: "これらのコントロールまたはスクロールホイールを使用して、ズームイン、ズームアウトします。",
  13492. HELP_MORE_TOUR_A: "ツアーコントロール",
  13493. HELP_DESKTOP_MORE_TOUR_B: "ガイド付きツアー中に再生、一時停止、前方・後方に移動します。",
  13494. HELP_MORE_INSIDE_A: "内側ビュー",
  13495. HELP_DESKTOP_MORE_INSIDE_B: "クリックしてSpace内を探索します。",
  13496. HELP_MOBILE_MORE_INSIDE_B: "タップしてSpace内を探索します。",
  13497. HELP_MORE_VR_A: "VRモード",
  13498. HELP_DESKTOP_MORE_VR_B: "クリックしてバーチャルリアリティでSpaceを起動します。",
  13499. HELP_MOBILE_MORE_VR_B: "タップしてバーチャルリアリティでSpaceを起動します。",
  13500. HELP_MORE_360_A: "360° Views",
  13501. HELP_DESKTOP_MORE_360_B: "Highlight Reelの360° Viewsをクリックして屋外シーンを表示します。",
  13502. HELP_MOBILE_MORE_360_B: "Highlight Reelの360° Viewsをタップして屋外シーンを表示します。",
  13503. HELP_MORE_FULLSCREEN_A: "フルスクリーン",
  13504. HELP_DESKTOP_MORE_FULLSCREEN_B: "3D Showcaseをフルスクリーン表示にします。",
  13505. CLOSE: "閉じる"
  13506. }
  13507. }
  13508. , {}],
  13509. 115: [function(e, t, i) {
  13510. "use strict";
  13511. t.exports = {
  13512. PAGE_TITLE: "",
  13513. LOADING: "Загрузка",
  13514. PRESENTED_BY_CAPS: "ПРЕДСТАВЛЕНО",
  13515. POWERED_BY: "разработано на платформе ",
  13516. POWERED_BY_CAPS: "РАЗРАБОТАНО НА ПЛАТФОРМЕ",
  13517. DESKTOP_SHORT_CTA: "Нажмите для просмотра.",
  13518. MOBILE_SHORT_CTA: "Нажмите для просмотра.",
  13519. PRESENTED_BY: "Представлено ",
  13520. MORE: "Больше ",
  13521. LESS: "Меньше ",
  13522. TAG_CONTENT: "tag™ Контент",
  13523. SHOW: "Показать",
  13524. HIDE: "Скрыть",
  13525. DOLLHOUSE: "Dollhouse",
  13526. FLOOR_PLAN: "Планировка",
  13527. OPEN_HIGHLIGHTS: "Открыть Фотоколлаж",
  13528. CLOSE_HIGHLIGHTS: "Закрыть",
  13529. PREVIOUS: "Предыдущий",
  13530. PLAY: "Воспроизвести",
  13531. PAUSE: "Пауза",
  13532. NEXT: "Следующий",
  13533. EXPLORE_3D_SPACE: "Просмотреть 3D модель",
  13534. VIEW_DOLLHOUSE: "Посмотреть Dollhouse",
  13535. SOCIAL_SHARING: "Поделиться этой моделью",
  13536. VIEW_IN_VR: "Посмотреть в VR",
  13537. VIEW_FULLSCREEN: "Полный экран",
  13538. EXIT_FULLSCREEN: "Выйти из полноэкранного режима",
  13539. ZOOM_IN: "Увеличить",
  13540. ZOOM_OUT: "Уменьшить",
  13541. FLOOR_NAME: "Этаж ",
  13542. FLOOR_ALL: "Все",
  13543. TERMS: "Условия",
  13544. PORT_TERMS: "Правила пользования",
  13545. TERMS_OF_USE: "Условия использования",
  13546. TERMS_TEXT_FILE: "terms-ru-RU.html",
  13547. CLOSE_TERMS: "Закрыть",
  13548. TERMS_FAIL: "Не удалось загрузить условия использования. Для просмотра условий использования, пожалуйста, убедитесь, что у Вас есть подключение к Интернету.",
  13549. HELP: "Помощь",
  13550. HELP_NAVIGATION_TAB: "Навигация",
  13551. HELP_MORE_HELP_TAB: "Доп. Помощь",
  13552. CLOSE: "Закрыть",
  13553. HELP_DESKTOP_PANORAMA_1A: "Нажмите и перетащите, чтобы осмотреть пространство вокруг.",
  13554. HELP_DESKTOP_PANORAMA_2A: "Для передвижения по модели нажимайте на круги .",
  13555. HELP_DESKTOP_PANORAMA_3A: "Используйте колесо прокрутки для увеличения и уменьшения.",
  13556. HELP_DESKTOP_PANORAMA_1B: "Или используйте клавиши со стрелками для поворота влево и вправо.",
  13557. HELP_DESKTOP_PANORAMA_2B: "Или используйте стрелки для перемещения вперед и назад.",
  13558. HELP_DESKTOP_PANORAMA_3B: "Или используйте клавиши ‘плюс’ и ‘минус’ для увеличения и уменьшения изображения.",
  13559. HELP_DESKTOP_360_2A: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  13560. HELP_DESKTOP_360_2B: "или нажмите 1 на клавиатуре, чтобы увидеть внутреннюю панораму.",
  13561. HELP_DESKTOP_DOLLHOUSE_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы повернуть Dollhouse.",
  13562. HELP_DESKTOP_DOLLHOUSE_2A: "Нажмите правую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить позицию Dollhouse на экране.",
  13563. HELP_DESKTOP_DOLLHOUSE_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  13564. HELP_DESKTOP_DOLLHOUSE_1B: "Или используйте клавиши со стрелками, чтобы повернуть Dollhouse.",
  13565. HELP_DESKTOP_FLOORPLAN_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить положение Планировки на экране.",
  13566. HELP_DESKTOP_FLOORPLAN_2A: "Нажмите правую кнопку мыши и перетащите влево или вправо, чтобы повернуть Планировку.",
  13567. HELP_DESKTOP_FLOORPLAN_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  13568. HELP_DESKTOP_FLOORPLAN_2B: "Или используйте клавиши со стрелками для поворота влево или вправо.",
  13569. HELP_DESKTOP_FLOORPLAN_3B: "Или используйте стрелки для увеличения и уменьшения.",
  13570. HELP_MOBILE_PANORAMA_1: "Нажмите и перетащите, чтобы осмотреть модель.",
  13571. HELP_MOBILE_PANORAMA_2: "Для передвижения по модели нажимайте на круги.",
  13572. HELP_MOBILE_3: "Используйте движение двумя пальцами в разные стороны, чтобы увеличить и уменьшить.",
  13573. HELP_MOBILE_360_2: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  13574. HELP_MOBILE_DOLLHOUSE_1: "Нажмите и перетащите вверх, вниз, влево и вправо, чтобы повернуть Dollhouse.",
  13575. HELP_MOBILE_DOLLHOUSE_2: "Нажмите и перетащите, чтобы расположить Dollhouse.",
  13576. HELP_MOBILE_FLOORPLAN_1: "Нажмите и перетащите, чтобы расположить план здания.",
  13577. HELP_MOBILE_FLOORPLAN_2: "Коснитесь и перетащите двумя пальцами, чтобы повернуть план здания.",
  13578. HELP_MORE_HLR_A: "Фотоколлаж",
  13579. HELP_DESKTOP_MORE_HLR_B: "Откройте для перемещения по модели, используя иконки изображений.",
  13580. HELP_MORE_DOLLHOUSE_A: "Dollhouse",
  13581. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  13582. HELP_MOBILE_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  13583. HELP_MORE_FLOORS_A: "Выбор Этажа",
  13584. HELP_DESKTOP_MORE_FLOORS_B: "Переключение между этажами.",
  13585. HELP_MORE_TAG_A: "tag™ Posts",
  13586. HELP_DESKTOP_MORE_TAG_B: "Нажмите или наведите курсор мыши для получения информации о функциях в Пространстве.",
  13587. HELP_MOBILE_MORE_TAG_B: "Нажмите для получения информации о функциях.",
  13588. HELP_MORE_ZOOM_A: "Масштаб",
  13589. HELP_DESKTOP_MORE_ZOOM_B: "Используйте эти кнопки для увеличения и уменьшения изображения или используйте колесо прокрутки.",
  13590. HELP_MORE_TOUR_A: "Управление Туром",
  13591. HELP_DESKTOP_MORE_TOUR_B: "Используйте кнопки Воспроизвести, Пауза, Вперед и Назад для управления фотоколлажем.",
  13592. HELP_MORE_INSIDE_A: "Вид Изнутри",
  13593. HELP_DESKTOP_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  13594. HELP_MOBILE_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  13595. HELP_MORE_VR_A: "Режим VR",
  13596. HELP_DESKTOP_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  13597. HELP_MOBILE_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  13598. HELP_MORE_360_A: "360° Views",
  13599. HELP_DESKTOP_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  13600. HELP_MOBILE_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  13601. HELP_MORE_FULLSCREEN_A: "Полный экран",
  13602. HELP_DESKTOP_MORE_FULLSCREEN_B: "Развернуть 3D Showcase во весь экран.",
  13603. WEBVR_FOR_CARDBOARD: "Для Google Cardboard",
  13604. WEBVR_FOR_DAYDREAM: "Для просмотра в Daydream",
  13605. WEBVR_ENTER_WEBVR: "ВОЙТИ В VR ",
  13606. WEBVR_DIFFERENT_HEADSET: "Есть другой VR-шлем?",
  13607. WEBVR_LEARN_MORE: "Узнать больше",
  13608. WEBVR_VIEW_SPACE: "Запустить модель в VR",
  13609. WEBVR_DAYDREAM_VIEW: "Посмотреть в Daydream",
  13610. WEBVR_DAYDREAM_PHONE: "Daydream-готовый телефон",
  13611. WEBVR_VIEW_CARDBOARD: "Или просмотреть в Google Cardboard",
  13612. VR_WHAT_YOU_NEED: "Что Вам потребуется...",
  13613. VR_NEED_DAYDREAM_PHONE: "Daydream-готовый телефон",
  13614. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13615. VR_APP: "port VR App",
  13616. VR_APP_OPEN: "Или открыть через приложение port VR",
  13617. VR_COMPATIBLE_ANDROID_LONG: 'Совместимые Android устройства с диагональю экрана 4.5"-5.5" дюймов и Android версией 4.4.4, и выше',
  13618. VR_SAMSUNG_DETAIL: "Galaxy S6 и выше",
  13619. VR_APP_FOR_ANDROID: "Приложение port VR для Android",
  13620. VR_NEED_DAYDREAM: "Необходимо для соединением с Daydream",
  13621. VR_VIEW_SPACE: "Запустить модель в VR",
  13622. VR_LEARN_MORE_CAPS: "УЗНАТЬ БОЛЬШЕ",
  13623. VR_PREVIOUS_CAPS: "ПРЕДЫДУЩИЙ",
  13624. VR_NEXT_CAPS: "СЛЕДУЮЩИЙ",
  13625. VR_GOT_IT_CAPS: "ЯСНО",
  13626. VR_SHOW_SUPPORTED: "Нажмите, чтобы просмотреть модель в VR с помощью",
  13627. VR_SHOW_UNSUPPORTED: "Извините, но Ваше устройство не соответствует минимальным требованиям для просмотра модели в VR.",
  13628. VR_SHOW_IOS_1: "Нажмите, чтобы просмотреть модель в VR",
  13629. VR_SHOW_IOS_2: "Для просмотра требуется приложение port VR и совместимый iPhone",
  13630. VR_NEED_CARDBOARD: "Что Вам потребуется для Google Cardboard",
  13631. VR_NEED_SAMSUNG: "Что Вам потребуется для Samsung Gear VR",
  13632. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13633. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13634. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13635. VR_COMPATIBLE_IPHONES_2: "iPhone 5s или новее с iOS 9.1 и выше",
  13636. VR_COMPATIBLE_IPHONES_3: "Совместимые модели iPhone",
  13637. VR_COMPATIBLE_ANDROID: "Совместимые Android устройства",
  13638. VR_ANDROID_DETAIL: 'Экран от 4.5" до 5.5" и Android 4.4.4, и выше',
  13639. VR_ANDROID_DVICES: "Android устройства",
  13640. VR_COMPATIBLE_SAMSUNG: "Совместимые Samsung устройства",
  13641. VR_APP_FOR_CARDBOARD: "Приложение port VR для Google Cardboard",
  13642. VR_APP_FOR_SAMSUNG: "Приложение port VR для Gear VR",
  13643. VR_DOWNLOAD_HERE: "Скачать здесь",
  13644. VR_REQUIRE_HEADSET: "Требуется VR-шлем и установленное приложение port VR для Android",
  13645. VR_REDIRECT_TO_STORE: "Если приложение не установлено, Вы будете перенаправлены на страницу магазина приложений.",
  13646. VR_IMPROPER_EMBED: "port модель не встроена должным образом для поддержки VR в вашем веб-браузере.",
  13647. VR_OPEN_ANDROID_LINK: "Откройте ссылку на Вашем мобильном телефоне",
  13648. VR_ANDROID_OPTIONS: "Доступные опции VR-шлемов",
  13649. SHARE_TO: "Поделиться",
  13650. SHARE_LINK: "Прямая ссылка",
  13651. SHARE_EXPLORE: "просмотреть",
  13652. SHARE_AT: "на",
  13653. SHARE_WITH: "с",
  13654. SHARE_3D: "в 3D",
  13655. SHARE_COPIED: "Скопировано!",
  13656. ERROR_BROWSER_SOLUTION: "установите новый браузер, чтобы просмотреть 3D пространство.",
  13657. ERROR_BROWSER_EXPLANATION: "WebGL требует современный браузер.",
  13658. ERROR_GENERIC_PROBLEM: "Ой, что-то пошло не так.",
  13659. ERROR_GENERIC_SOLUTION: "Перезапустите браузер.",
  13660. ERROR_GENERIC_ACTIONS_1: "Если проблема не устранена, ",
  13661. ERROR_GENERIC_ACTIONS_2: "установите поддерживаемый браузер",
  13662. ERROR_GENERIC_ACTIONS_3: " или ",
  13663. ERROR_GENERIC_ACTIONS_4: "смотрите наше руководство по устранению неполадок",
  13664. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Браузер не поддерживается.",
  13665. ERROR_WEBGL_IOS_PROBLEM: "iOS-версия не поддерживается.",
  13666. ERROR_WEBGL_IOS_SOLUTION: "Обновите до iOS 8 или выше, чтобы просмотреть пространство в 3D.",
  13667. ERROR_WEBGL_IOS_ACTIONS_1: "Нажмите ",
  13668. ERROR_WEBGL_IOS_ACTIONS_2: "Настройки > Общие > Обновление ПО",
  13669. ERROR_WEBGL_SAFARI_PROBLEM: "Включите WebGL для 3D-просмотра.",
  13670. ERROR_WEBGL_SAFARI_ACTIONS_1: "Нажмите ",
  13671. ERROR_WEBGL_SAFARI_ACTIONS_2: "Настойки > Дополнения > Показывать меню “Разработка” в строке меню",
  13672. ERROR_WEBGL_SAFARI_ACTIONS_3: "Затем нажмите ",
  13673. ERROR_WEBGL_SAFARI_ACTIONS_4: "Разработка > Разрешить WebGL",
  13674. ERROR_MISSING_URLS_PROBLEM: "Ой, для этой модели нет панорамы.",
  13675. ERROR_MISSING_URLS_EXPLANATION: "Эта модель устарела. У владельца веб-сайта может быть новая модель.",
  13676. ERROR_LOADING_FAILED_PROBLEM: "Ой, модель недоступна.",
  13677. ERROR_LOADING_FAILED_ACTIONS_1: "Если проблема не устранена, ",
  13678. ERROR_LOADING_FAILED_ACTIONS_2: "посмотрите наше руководство по устранению неполадок",
  13679. ERROR_MAINTENANCE_PROBLEM: "Выполняется техническое обслуживание.",
  13680. ERROR_MAINTENANCE_SOLUTION: "Пожалуйста, попробуйте снова через несколько минут.",
  13681. LINK_TO_LOCATION: "Ссылка на местоположение",
  13682. MENU_COPY: "Копировать",
  13683. LINK_ALERT_COPY: "Для того, чтобы скопировать, пожалуйста, используйте CTRL/CMD + C.",
  13684. ROTATE: "Вращать",
  13685. MOVE: "Передвигаться",
  13686. INSIDE: "Вид изнутри",
  13687. ZOOM: "Масштаб"
  13688. }
  13689. }
  13690. , {}],
  13691. 116: [function(r, e, t) {
  13692. (function(i) {
  13693. "use strict";
  13694. function re(e) {
  13695. console.log("e1:" + e),
  13696. e = Math.round(.4 * e * 100),
  13697. console.log("e2:" + e);
  13698. var t = $(".progressbar");
  13699. t.find(".bar").css("width", e + "%"),
  13700. t.find(".label").css("left", t.width() * e / 100 - 15 + "px"),
  13701. t.find(".perc").text(e + "%")
  13702. }
  13703. $("#gui-loading").fadeIn(200),
  13704. re(.1);
  13705. var e = g_version ? "modeldata.js" : "someData.json";
  13706. $.ajax(g_Prefix + "data/" + window.number + "/" + e + "?" + randomTime().getTime(), {
  13707. dataType: "json"
  13708. }).done(function(e) {
  13709. var t = matcher(e);
  13710. t.files.templates[0] = g_Prefix + e.files.templates[0].replace("{{number}}", window.number),
  13711. t.user = {
  13712. is_authenticated: !1,
  13713. 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"]
  13714. }
  13715. try{//处理一下导览数据,旧的曾有导览数据是错误的,将它删除
  13716. var newImages = [];
  13717. t.model.images.forEach((tourImg)=>{tourImg.thumbnail_signed_src && newImages.push(tourImg)})
  13718. t.model.images = newImages
  13719. }catch(e){console.log(e) }
  13720. window.MP_PREFETCHED_MODELDATA = t
  13721. t.model.summary = t.summary
  13722. t.model.name = t.name
  13723. for(let i in t){
  13724. t[i] == "false" && (t[i] = false)
  13725. }
  13726. re(.7),
  13727. function() {
  13728. function y(e) {
  13729. t.update(e)
  13730. }
  13731. function A(e, t) {
  13732. ne.error(t),
  13733. n.error(t),
  13734. N.report(e, "error-" + t)
  13735. }
  13736. function C(e, t, i) {
  13737. try {
  13738. e.start(t)
  13739. } catch (e) {
  13740. throw ne.warn(e.message),
  13741. function(e) {
  13742. var t = O.details();
  13743. t && "Safari" === t.name && 500 < t.version && t.version < 600 ? (n.error("webgl-safari"),
  13744. N.report(e, "error-webgl-safari")) : (n.error("webgl-generic"),
  13745. N.report(e, "error-webgl-generic"))
  13746. }(i.sid),
  13747. e
  13748. }
  13749. }
  13750. function I(e) {
  13751. e.stopPropagation(),
  13752. e.preventDefault()
  13753. }
  13754. window.MP_PREFETCHED_MODELDATA.hoticon && (g_HotImage = {
  13755. point: window.MP_PREFETCHED_MODELDATA.hoticon.default || "https://super.4dage.com/images/4dagePoint2.png",
  13756. point2: window.MP_PREFETCHED_MODELDATA.hoticon.higt || "https://super.4dage.com/images/4dagePoint.png"
  13757. });
  13758. /* window.MP_PREFETCHED_MODELDATA.backgroundMusic ? (g_bgAudio.src = window.MP_PREFETCHED_MODELDATA.backgroundMusic,
  13759. $("#volume").show()) : "one" === g_version && (g_bgAudio.src = g_Prefix + "/audio/audio" + window.number + "/background.mp3");
  13760. */
  13761. if (window.MP_PREFETCHED_MODELDATA.backgroundMusic) {
  13762. if(window.isLocal) g_bgAudio.src = manage.dealURL(window.MP_PREFETCHED_MODELDATA.backgroundMusic) ;
  13763. else g_bgAudio.src = window.MP_PREFETCHED_MODELDATA.backgroundMusic.substr(0,4)=="http" ? window.MP_PREFETCHED_MODELDATA.backgroundMusic : "//" + window.MP_PREFETCHED_MODELDATA.backgroundMusic;
  13764. $("#volume").show();
  13765. }else if (g_version === "one"){
  13766. g_bgAudio.src = g_Prefix+"/audio/"+"audio"+window.number + "/background.mp3";
  13767. //g_bgAudio.src = manage.dealURL(src) ;
  13768. }
  13769. //隐藏公司logo
  13770. window.MP_PREFETCHED_MODELDATA.loadlogo && showLogo();
  13771. r("./lib/three75-shim"),
  13772. r("./lib/array-polyfill"),
  13773. r("./lib/performance-polyfill"),
  13774. r("./lib/shaders/CopyShader.js"),
  13775. r("./lib/shaders/HorizontalBlurShader.js"),
  13776. r("./lib/shaders/VerticalBlurShader.js"),
  13777. r("./lib/postprocessing/EffectComposer.js"),
  13778. r("./lib/postprocessing/RenderPass.js"),
  13779. r("./lib/postprocessing/MaskPass.js"),
  13780. r("./lib/postprocessing/ShaderPass.js"),
  13781. window.Promise || (window.Promise = r("promise-polyfill"));
  13782. var E = r("three")
  13783. , _ = r("three")
  13784. , b = (r("./util/sentry"),
  13785. r("./player"))
  13786. , w = r("./director")
  13787. , T = r("./controls/CameraControls")
  13788. , x = r("./model/ModelManager")
  13789. , S = r("./DisplayController")
  13790. , M = r("./label/LabelDisplayController")
  13791. , R = r("./enum/Viewmode")
  13792. , e = r("./util/logger")
  13793. , P = r("./showcase")
  13794. , O = r("./util/browser")
  13795. , L = r("./settings")
  13796. , D = r("./gui/gui")
  13797. , n = r("./gui/error")
  13798. , N = r("./analytics")
  13799. , F = r("./util/transitions")
  13800. , B = r("./effects")
  13801. , V = r("./objects/Skybox")
  13802. , k = (r("./util/common"),
  13803. r("./util/PanoramaCollection"),
  13804. r("./util/math"),
  13805. r("./util/showcase"))
  13806. , U = r("./util/camera")
  13807. , H = (r("./objects/Panorama"),
  13808. r("./cameras/PanoramaCamera"),
  13809. r("./preloaders"))
  13810. , z = r("events").EventEmitter
  13811. , G = r("./featureflags")
  13812. , W = (r("./util/lerp"),
  13813. r("./util/ajax"),
  13814. r("./ab"))
  13815. , j = r("./sdk/automation.js")
  13816. , Y = r("./scene/SceneRenderer")
  13817. , q = r("./scene/QuickstartManager")
  13818. , X = r("./tile/QualityManager.js")
  13819. , Z = r("./localization/localize")
  13820. , K = r("./tag/tagManager")
  13821. , Q = r("./tile/TileDownloader")
  13822. , J = r("./tile/PanoRenderer")
  13823. , ee = (r("./enum/PanoSizeClass"),
  13824. r("./enum/PanoramaEvents"),
  13825. r("./enum/SceneRendererEvents"))
  13826. , t = r("./gui/memoryUsage")
  13827. , te = r("./enum/RenderLayers")
  13828. , ie = r("./TimingData")
  13829. , ne = new e(i);
  13830. e.level = L.logLevel,
  13831. e.consoleEnabled = L.console,
  13832. function() {
  13833. var e = k.getModelIDFromQueryString();
  13834. if (!e)
  13835. return A(null, "loading-failed");
  13836. var t = k.parseSidUrl(e)
  13837. , i = O.valueFromHash("play", !1) ? "autoplay" : O.inIframe() ? "click" : "fullpage"
  13838. , n = {
  13839. panoElementsToLoad: 6,
  13840. modelElementsToLoad: 0,
  13841. totalElementsLoaded: 0,
  13842. totalElementsToLoad: 0,
  13843. totalPercentageLoaded: 0,
  13844. progressCallback: null
  13845. }
  13846. , r = document.getElementById("player")
  13847. , o = L.quickstart.enabled
  13848. , a = null
  13849. , s = null
  13850. , l = null
  13851. , c = null
  13852. , h = null
  13853. , u = null
  13854. , d = null
  13855. , p = null
  13856. , f = null
  13857. , g = null
  13858. , m = null
  13859. , v = new ie;
  13860. !function(e) {
  13861. ne.info("Version", "2.25.6-0-gd87e5b1"),
  13862. z.defaultMaxListeners = 1e3,
  13863. function(e) {
  13864. e.addEventListener("dragenter", I, !1),
  13865. e.addEventListener("dragover", I, !1)
  13866. }(e),
  13867. O.valueFromHash("title", !0) || $(document).ready(function() {
  13868. $(".model-title").hide()
  13869. })
  13870. }(r),
  13871. function(e) {
  13872. return G.loadFeatureFlags(e).done(function(e) {
  13873. G.updateDependentSettings(e, L)
  13874. })
  13875. }({
  13876. urlBase: t.urlBase
  13877. }).then(function() {
  13878. return Z.init(),
  13879. function(e, t) {
  13880. var i = P.getModel({
  13881. url: t,
  13882. floors: O.valueFromHash("f", !0),
  13883. autoload: !1
  13884. });
  13885. return $.when(i, y).then(null, function(e) {
  13886. return this
  13887. })
  13888. }(0, e)
  13889. }).then(function(e) {
  13890. return re(.9),
  13891. function(e, t, i, n, r) {
  13892. ne.info("Model data loaded"),
  13893. ne.debug("UUID: " + e.data.job.uuid),
  13894. W.init(G.getFlags()),
  13895. i && N.initKeen({
  13896. token: i,
  13897. appId: n
  13898. }),
  13899. N.initSegment({
  13900. model: e.sid,
  13901. version: "2.25.6-0-gd87e5b1",
  13902. startSource: r.startSource,
  13903. token: t,
  13904. autoplay: r.autoplay,
  13905. quickstart: r.quickstart
  13906. })
  13907. }(g = e, L.appConfig.segment_key, L.appConfig.keen_write_key, L.appConfig.keen_project_id, {
  13908. startSource: i,
  13909. autoplay: L.autoplay,
  13910. quickstart: o
  13911. }),
  13912. g.urls.init()
  13913. }).then(function() {
  13914. return g.loadPanos()
  13915. }).then(function() {
  13916. s = U.getStartCameraOptions(g, g.panos);
  13917. //初始画面
  13918. window.MP_PREFETCHED_MODELDATA.camera_start && window.MP_PREFETCHED_MODELDATA.camera_start.thumbImg && function(e) {
  13919. $("<img/>").attr("src", e).on("load", function() {
  13920. $("#gui-thumb").css("backgroundImage", "url(" + e + ")").fadeIn(500),
  13921. $(this).remove()
  13922. $(".shotImg.innerBtn").removeClass('blank').css("background-image", "url(" + e + ")")
  13923. })
  13924. }(window.MP_PREFETCHED_MODELDATA.camera_start.thumbImg);
  13925. d = function(e) {
  13926. var t = new E.PerspectiveCamera;
  13927. t.layers.enable(te.PANOMARKERS),
  13928. t.layers.enable(te.RETICULE),
  13929. t.layers.enable(te.TAG);
  13930. var o = new E.Scene
  13931. , i = new E.AmbientLight(16777215);
  13932. return o.add(i),
  13933. o.skybox = new V,
  13934. o.add(o.skybox),
  13935. o.plane = new E.Mesh(new E.PlaneBufferGeometry(1e5,1e5),new E.RawShaderMaterial({
  13936. side: E.DoubleSide
  13937. })),
  13938. o.plane.position.y = 0,
  13939. o.plane.rotateX(-Math.PI / 2),
  13940. o.plane.material.visible = !1,
  13941. o.add(o.plane),
  13942. o.updateMatrixWorld(),
  13943. L.showScreenshotLocations && e.data.images.forEach(function(e) {
  13944. if (e.metadata && e.metadata.camera_position) {
  13945. var t = e.metadata.camera_position
  13946. , i = new E.Mesh(new E.BoxGeometry(.3,.3,.3));
  13947. i.position = t.clone(),
  13948. o.add(i);
  13949. var n = e.metadata.camera_quaternion
  13950. , r = new E.Vector3(0,0,-1).applyQuaternion(n);
  13951. o.add(new E.ArrowHelper(r,t.clone(),1,16711680))
  13952. }
  13953. }),
  13954. L.showAxis && (o.add(new E.ArrowHelper(new E.Vector3(0,1,0),new E.Vector3(0,0,0),1,255)),
  13955. o.add(new E.ArrowHelper(new E.Vector3(0,0,1),new E.Vector3(0,0,0),1,16711680)),
  13956. o.add(new E.ArrowHelper(new E.Vector3(1,0,0),new E.Vector3(0,0,0),1,65280))),
  13957. new Y(o,t,B)
  13958. }(g),
  13959. m = function(e, t) {
  13960. var i = e ? 1 : 1e3
  13961. , n = W.tilegen || W.imgopt ? 6 : 2;
  13962. n = O.valueFromHash("tileconc", n);
  13963. var r = new X
  13964. , o = new Q({
  13965. concurrentDownloads: n
  13966. })
  13967. , a = new J
  13968. , s = new x
  13969. , l = new w
  13970. , c = new b(t)
  13971. , h = new T
  13972. , u = new S(i)
  13973. , d = new M
  13974. , p = new K;
  13975. return {
  13976. qualityManager: r,
  13977. panoRenderer: a,
  13978. tileDownloader: o,
  13979. player: c,
  13980. director: l,
  13981. modelManager: s,
  13982. tagManager: p,
  13983. displayController: u,
  13984. labelDisplayController: d,
  13985. controls: h
  13986. }
  13987. }(o, s.mode),
  13988. l = m.controls,
  13989. c = m.player,
  13990. h = m.director,
  13991. u = m.tagManager,
  13992. p = m.tileDownloader,
  13993. f = m.qualityManager,
  13994. m.panoRenderer,
  13995. function(e, t, i, n) {
  13996. var r = i.controls
  13997. , o = i.qualityManager
  13998. , a = i.panoRenderer
  13999. , s = i.tileDownloader
  14000. , l = i.modelManager;
  14001. r.init(n, l),
  14002. j.init(i.director, r, i.player, l, t),
  14003. o.init(l),
  14004. s.init(o),
  14005. a.init(t, s, o),
  14006. l.init(s, a, o),
  14007. l.addModel(e),
  14008. t.addComponent(F)
  14009. }(g, d, m, r),
  14010. c.director = h,
  14011. g.supportsTiles && p.start(),
  14012. !o || s.mode === R.PANORAMA && s.pano || (ne.warn("Tried to quickstart, but failed as we are not starting in inside mode."),
  14013. o = !1);
  14014. var e = null;
  14015. if (o) {
  14016. ne.warn("Quickstart engaged. Hold on to your knickers.");
  14017. var t = l.controls[R.PANORAMA];
  14018. a = new q(f,d.scene,d.camera,t,r),
  14019. C(d, r, g),
  14020. e = a.load(s).then(function() {
  14021. d.addComponent(a),
  14022. d.once(ee.AfterRender, function() {
  14023. ne.warn("First render after quickstart load finished.")
  14024. })
  14025. })
  14026. }
  14027. return window.flyToFirst = function() {
  14028. var e = c.model.panos.get("8d778e19657f433fb9cf8947d823bb70")
  14029. , t = new _.Quaternion(.7099827027821568,-.07708150183830938,.6958985789714591,.07555241737970636)
  14030. , i = new _.Vector3(0,0,-1).applyQuaternion(t).add(e.position);
  14031. c.flyToPano({
  14032. pano: e,
  14033. lookAtPoint: i
  14034. })
  14035. }
  14036. ,
  14037. $.when(e, D.startLoading(g, c, h, L.autoplay, o, v))
  14038. }).then(function() {
  14039. return function(e, t, i, n, r) {
  14040. return r.progressCallback = t,
  14041. N.sessionStart(),
  14042. e.load(n).progress(function(e, t) {
  14043. e.modelElementsToLoad = t[1],
  14044. function(e) {
  14045. e.totalElementsToLoad = e.modelElementsToLoad + e.panoElementsToLoad
  14046. }(e),
  14047. function(e) {
  14048. e.totalElementsLoaded++,
  14049. e.totalPercentageLoaded = e.totalElementsLoaded / e.totalElementsToLoad,
  14050. isNaN(e.totalPercentageLoaded) && (e.totalPercentageLoaded = 0),
  14051. e.totalPercentageLoaded = .4 + .6 * e.totalPercentageLoaded,
  14052. console.log("pro:" + e.totalPercentageLoaded),
  14053. e.progressCallback && e.progressCallback(100 * e.totalPercentageLoaded)
  14054. }(e)
  14055. }
  14056. .bind(this, r))
  14057. }(g, D.onProgress, 0, !o, n)
  14058. }).then(function() {
  14059. s.quickstart = o,
  14060. function(e, t, i, n) {
  14061. var r = i.qualityManager
  14062. , o = i.panoRenderer
  14063. , a = i.tileDownloader
  14064. , s = i.modelManager
  14065. , l = i.player
  14066. , c = i.director
  14067. , h = i.tagManager
  14068. , u = i.displayController
  14069. , d = i.labelDisplayController
  14070. , p = i.controls;
  14071. t.scene.add(e),
  14072. t.qualityManager = r;
  14073. var f = {
  14074. camera: t.camera,
  14075. director: c,
  14076. modelManager: s,
  14077. tileDownloader: a,
  14078. panoRenderer: o,
  14079. qualityManager: r,
  14080. tagManager: h,
  14081. container: n,
  14082. controls: p
  14083. };
  14084. l.init(f),
  14085. l.setScene(t.scene),
  14086. h.init(s, l),
  14087. c.init(l, s),
  14088. u.init(c, l, s, h, n),
  14089. d.init(l, s, n),
  14090. B.bindEvents(l),
  14091. t.addComponent(h),
  14092. t.addComponent(l),
  14093. t.addComponent(o),
  14094. l.sceneRenderer = t
  14095. }(g, d, m, r),
  14096. d.started || C(d, r, g),
  14097. N.modelLoaded(g, c, l, L.autoplay),
  14098. function(e, t, i, n) {
  14099. return ne.info("Starting player in " + i.mode),
  14100. N.report(t.sid, "started-playing", n, i.quickstart),
  14101. e.start(i)
  14102. }(c, g, s, L.autoplay).done(function() {
  14103. h.autoTour()
  14104. }),
  14105. g.supportsTiles || new H(g,c).start();
  14106. o && (d.removeComponent(a),
  14107. a.destroy(),
  14108. s.pano.enter()),
  14109. D.init(g, h, c, l, d, s, N.getSessionId()),
  14110. D.endLoading(g, h, u),
  14111. d.once(ee.AfterRender, function() {
  14112. v.setAppReadyTime();
  14113. var e = v.calcFullLoadingTime();
  14114. ne.warn("Total load time: " + e / 1e3),
  14115. N.loadComplete(e),
  14116. ne.warn("First render after model load finished.")
  14117. }),
  14118. d.on(ee.MemoryUsageUpdated, y)
  14119. }).fail(A.bind(this, e))
  14120. }()
  14121. }()
  14122. })
  14123. }
  14124. ).call(this, "/js/main.js")
  14125. }
  14126. , {
  14127. "./DisplayController": 1,
  14128. "./TimingData": 2,
  14129. "./ab": 3,
  14130. "./analytics": 4,
  14131. "./cameras/PanoramaCamera": 7,
  14132. "./controls/CameraControls": 9,
  14133. "./director": 15,
  14134. "./effects": 16,
  14135. "./enum/PanoSizeClass": 36,
  14136. "./enum/PanoramaEvents": 37,
  14137. "./enum/RenderLayers": 41,
  14138. "./enum/SceneRendererEvents": 43,
  14139. "./enum/Viewmode": 51,
  14140. "./featureflags": 59,
  14141. "./gui/error": 64,
  14142. "./gui/gui": 65,
  14143. "./gui/memoryUsage": 73,
  14144. "./label/LabelDisplayController": 91,
  14145. "./lib/array-polyfill": 92,
  14146. "./lib/performance-polyfill": 95,
  14147. "./lib/postprocessing/EffectComposer.js": 96,
  14148. "./lib/postprocessing/MaskPass.js": 97,
  14149. "./lib/postprocessing/RenderPass.js": 98,
  14150. "./lib/postprocessing/ShaderPass.js": 99,
  14151. "./lib/shaders/CopyShader.js": 100,
  14152. "./lib/shaders/HorizontalBlurShader.js": 101,
  14153. "./lib/shaders/VerticalBlurShader.js": 102,
  14154. "./lib/three75-shim": 103,
  14155. "./localization/localize": 108,
  14156. "./tag/tagManager": 124,
  14157. "./model/ModelManager": 140,
  14158. "./objects/Panorama": 148,
  14159. "./objects/Skybox": 152,
  14160. "./player": 155,
  14161. "./preloaders": 156,
  14162. "./scene/QuickstartManager": 157,
  14163. "./scene/SceneRenderer": 158,
  14164. "./sdk/automation.js": 164,
  14165. "./settings": 166,
  14166. "./showcase": 168,
  14167. "./tile/PanoRenderer": 169,
  14168. "./tile/QualityManager.js": 170,
  14169. "./tile/TileDownloader": 171,
  14170. "./util/PanoramaCollection": 178,
  14171. "./util/ajax": 181,
  14172. "./util/browser": 182,
  14173. "./util/camera": 183,
  14174. "./util/common": 185,
  14175. "./util/lerp": 188,
  14176. "./util/logger": 189,
  14177. "./util/math": 190,
  14178. "./util/sentry": 192,
  14179. "./util/showcase": 193,
  14180. "./util/transitions": 195,
  14181. events: 202,
  14182. "promise-polyfill": 213,
  14183. three: 217
  14184. }],
  14185. 117: [function(e, t, i) {
  14186. "use strict";
  14187. function n(e) {
  14188. e = e || {},
  14189. r.RawShaderMaterial.call(this, a.extendObject({
  14190. fragmentShader: o.cube.fragmentShader,
  14191. vertexShader: o.cube.vertexShader,
  14192. uniforms: r.UniformsUtils.clone(o.cube.uniforms),
  14193. name: "CubemapMaterial"
  14194. }, e))
  14195. }
  14196. var r = e("three")
  14197. , o = e("../shaders")
  14198. , a = e("../util/common");
  14199. (n.prototype = Object.create(r.RawShaderMaterial.prototype)).constructor = n,
  14200. t.exports = n
  14201. }
  14202. , {
  14203. "../shaders": 167,
  14204. "../util/common": 185,
  14205. three: 217
  14206. }],
  14207. 118: [function(e, t, i) {
  14208. "use strict";
  14209. function n(e) {
  14210. e = e || {},
  14211. r.RawShaderMaterial.call(this, a.extendObject({
  14212. fragmentShader: o.model.fragmentShader,
  14213. vertexShader: o.model.vertexShader,
  14214. uniforms: r.UniformsUtils.clone(o.model.uniforms),
  14215. name: "ModelTextureMaterial"
  14216. }, e))
  14217. }
  14218. var r = e("three")
  14219. , o = e("../shaders")
  14220. , a = e("../util/common");
  14221. ((n.prototype = Object.create(r.RawShaderMaterial.prototype)).constructor = n).prototype.setProjectedPanos = function(e, t, i) {
  14222. i && (this.uniforms.progress.value = 0),
  14223. e.ensureSkyboxReadyForRender(),
  14224. this.uniforms.pano0Map.value = e.getSkyboxTexture(),
  14225. this.uniforms.pano0Position.value.copy(e.position),
  14226. this.uniforms.pano0Matrix.value.copy(e.skyboxMesh.matrixWorld),
  14227. t.ensureSkyboxReadyForRender(),
  14228. this.uniforms.pano1Map.value = t.getSkyboxTexture(),
  14229. this.uniforms.pano1Position.value.copy(t.position),
  14230. this.uniforms.pano1Matrix.value.copy(t.skyboxMesh.matrixWorld)
  14231. }
  14232. ,
  14233. t.exports = n
  14234. }
  14235. , {
  14236. "../shaders": 167,
  14237. "../util/common": 185,
  14238. three: 217
  14239. }],
  14240. 119: [function(m, v, e) {
  14241. (function(e) {
  14242. "use strict";
  14243. function t(e, t, i, n) {
  14244. this.div = null,
  14245. this.body = null,
  14246. this.label = e,
  14247. this.description = t,
  14248. this.parsedDescription = [],
  14249. this.media = i || {
  14250. type: null
  14251. },
  14252. this.loadingSpinner = null,
  14253. this.parser = new r({
  14254. supportLinks: !c.valueFromHash("mls"),
  14255. keepLinkLabels: !0
  14256. }),
  14257. this.state = g.CLOSED,
  14258. this.orientation = "",
  14259. this.initialTransform = "",
  14260. this.hovering = !1,
  14261. this.openTransition = null,
  14262. this.closeTransition = null,
  14263. this.openPromise = null,
  14264. this.closePromise = null,
  14265. this.animationTransition = null,
  14266. this.animationScale = 0
  14267. }
  14268. var r = m("../Parser/DescriptionParser")
  14269. , i = m("../Media/Link")
  14270. , n = m("../Media/Image")
  14271. , o = m("../Media/EmbedlyPlayer")
  14272. , a = m("../Media/EmbedlyEmbed")
  14273. , s = m("../../util/transitions")
  14274. , l = m("../../util/lerp")
  14275. , c = m("../../util/browser")
  14276. , b = m("./BillboardEvent")
  14277. , w = m("../Media/MediaEvent")
  14278. , h = m("../Parser/DescriptionChunkType")
  14279. , u = m("events").EventEmitter
  14280. , d = m("./billboardSettings")
  14281. , T = m("./overlaySettings")
  14282. , p = new (m("../../util/logger"))(e)
  14283. , f = document.getElementById("tag-billboards");
  14284. f.addEventListener("touchend", function(e) {
  14285. f.style.pointerEvents = "none"
  14286. }),
  14287. f.addEventListener("touchcancel", function(e) {
  14288. f.style.pointerEvents = "none"
  14289. });
  14290. var g = {
  14291. CLOSED: "closed",
  14292. OPENING: "opening",
  14293. OPEN: "open",
  14294. CLOSING: "closing",
  14295. ACTIVE: "active"
  14296. };
  14297. (t.prototype = Object.create(u.prototype)).build = function(e) {
  14298. this.parsedDescription = this.parser.parse(this.description);
  14299. var t = document.createElement("div");
  14300. t.className = "tag-container has-hotzone",
  14301. this.div = t,
  14302. this.body = document.createElement("div"),
  14303. this.body.className = "tag-body";
  14304. var i = document.createElement("div");
  14305. i.classList.add("tag-content");
  14306. var n = document.createElement("div");
  14307. n.classList.add("tag-text-content");
  14308. var r = document.createElement("div");
  14309. r.className = "tag-label",
  14310. r.textContent = this.label,
  14311. n.appendChild(r);
  14312. var o = document.createElement("div");
  14313. o.className = "tag-desc",
  14314. n.appendChild(o),
  14315. i.appendChild(n),
  14316. this.body.appendChild(i),
  14317. this.appendDescriptionElements(this.parsedDescription, o),
  14318. this.appendMedia(),
  14319. t.appendChild(this.body),
  14320. f.appendChild(t),
  14321. this.bindEvents(t, this.body)
  14322. }
  14323. ,
  14324. t.prototype.bindEvents = function(i, e) {
  14325. function t(n) {
  14326. return function(e) {
  14327. if (!this.div.classList.contains("overlay")) {
  14328. var t, i = document.getElementById("player");
  14329. try {
  14330. t = new MouseEvent(n,e)
  14331. } catch (i) {
  14332. (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)
  14333. }
  14334. i.dispatchEvent(t)
  14335. }
  14336. }
  14337. }
  14338. e.addEventListener("mousedown", function(e) {
  14339. e.stopPropagation()
  14340. }),
  14341. e.addEventListener("mouseup", function(e) {
  14342. e.stopPropagation()
  14343. }),
  14344. i.addEventListener("touchstart", function(e) {
  14345. f.style.pointerEvents = "auto"
  14346. }),
  14347. i.addEventListener("mousedown", t("mousedown").bind(this)),
  14348. i.addEventListener("mouseup", t("mouseup").bind(this)),
  14349. e.addEventListener("mouseover", function(e) {
  14350. this.state === g.OPEN && i.classList.remove("has-hotzone")
  14351. }
  14352. .bind(this)),
  14353. i.addEventListener("mouseenter", function(e) {
  14354. this.state !== g.CLOSING && (this.hovering = !0,
  14355. this.emit(b.ENTER))
  14356. }
  14357. .bind(this)),
  14358. i.addEventListener("mouseleave", function(e) {
  14359. this.hovering = !1,
  14360. this.emit(b.LEAVE)
  14361. }
  14362. .bind(this)),
  14363. i.addEventListener("gesturestart", function(e) {
  14364. e.preventDefault()
  14365. });
  14366. var n = i.querySelector(".tag-text-content")
  14367. , r = 0;
  14368. n.addEventListener("touchstart", function(e) {
  14369. r = e.changedTouches[0].clientY
  14370. }),
  14371. n.addEventListener("touchmove", function(t) {
  14372. function e(e) {
  14373. e && (0 === e.scrollTop && t.changedTouches[0].clientY > r || e.scrollTop + e.clientHeight - e.scrollHeight == 0 && t.changedTouches[0].clientY < r) && t.preventDefault()
  14374. }
  14375. return i.classList.contains("overlay") ? e(this.querySelector(".tag-desc")) : void e(this)
  14376. }),
  14377. i.addEventListener("touchmove", function(e) {
  14378. 0 == (n.compareDocumentPosition(e.target) & Node.DOCUMENT_POSITION_CONTAINED_BY) && e.preventDefault()
  14379. })
  14380. }
  14381. ,
  14382. t.prototype.appendDescriptionElements = function(e, i) {
  14383. 0 < e.length && this.div.classList.add("has-text"),
  14384. e.forEach(function(e, t) {
  14385. switch (e.type) {
  14386. case h.TEXT:
  14387. i.appendChild(this.createTextElement(e.text));
  14388. break;
  14389. case h.LINK:
  14390. i.appendChild(this.createLinkElement(e.link))
  14391. }
  14392. }
  14393. .bind(this))
  14394. }
  14395. ,
  14396. t.prototype.appendLoadingSpinner = function() {
  14397. this.loadingSpinner = document.createElement("div"),
  14398. this.loadingSpinner.classList.add("loading-spinner");
  14399. var e = document.createElement("div");
  14400. e.classList.add("gui-spinner-icon"),
  14401. this.loadingSpinner.appendChild(e),
  14402. this.body.appendChild(this.loadingSpinner)
  14403. }
  14404. ,
  14405. t.prototype.onMediaLoadFinished = function() {
  14406. this.loadingSpinner && (this.loadingSpinner.parentNode.removeChild(this.loadingSpinner),
  14407. this.applyOrientation(this.orientation),
  14408. this.loadingSpinner = null)
  14409. }
  14410. ,
  14411. t.prototype.appendMedia = function() {
  14412. if (this.media && this.media.type && "error" !== this.media.type && (!c.valueFromHash("mls", 0) || this.media.type === h.IMAGE)) {
  14413. this.appendLoadingSpinner();
  14414. var e = document.createElement("div");
  14415. e.classList.add("tag-media-content");
  14416. var t = document.createElement("i");
  14417. switch (["icon", "icon-close-thin", "close"].forEach(function(e) {
  14418. t.classList.add(e)
  14419. }),
  14420. this.body.appendChild(t),
  14421. this.body.appendChild(e),
  14422. this.media.type) {
  14423. case h.IMAGE:
  14424. e.appendChild(this.createImageElement(this.media, this.body));
  14425. break;
  14426. case h.VIDEO:
  14427. e.appendChild(this.createVideoElement(this.media, this.body));
  14428. break;
  14429. case h.RICH:
  14430. e.appendChild(this.createEmbedElement(this.media, this.body))
  14431. }
  14432. }
  14433. }
  14434. ,
  14435. t.prototype.createTextElement = function(e) {
  14436. var t = document.createElement("span");
  14437. return t.textContent = e,
  14438. t
  14439. }
  14440. ,
  14441. t.prototype.createLinkElement = function(e) {
  14442. var t = new i(e);
  14443. return t.on(w.LINK_CLICK, this.emit.bind(this, w.LINK_CLICK)),
  14444. t.createDomElement()
  14445. }
  14446. ,
  14447. t.prototype.createImageElement = function(t, C) {
  14448. function e() {
  14449. function e() {
  14450. p || (E.classList.remove("view-image"),
  14451. a.classList.add("overlay"),
  14452. t(),
  14453. window.addEventListener("resize", A),
  14454. a.addEventListener("click", i),
  14455. c.addEventListener("click", r),
  14456. o.addEventListener("click", n),
  14457. p = !0,
  14458. _.emit(w.IMAGE_OPENED))
  14459. }
  14460. function t() {
  14461. C.classList.add("show-info"),
  14462. s.classList.remove("collapsible"),
  14463. s.style.height = "";
  14464. var e = parseFloat(getComputedStyle(v).lineHeight)
  14465. , t = g + e
  14466. , i = a.clientWidth - 2 * T.boundaryWidth - m
  14467. , n = a.clientHeight - 2 * T.boundaryHeight - m - t
  14468. , r = n
  14469. , o = r * I.aspect;
  14470. i < o && (r = (o = i) / I.aspect),
  14471. n < r && (o = (r = n) * I.aspect),
  14472. o += m,
  14473. r += m + t,
  14474. C.style.width = o + "px",
  14475. C.style.height = r + "px",
  14476. l.style.paddingTop = e + m + "px",
  14477. 0 < _.description.length && (s.classList.add("collapsible"),
  14478. s.style.height = s.clientHeight + 12 + "px",
  14479. y.style.height = "calc(100% - " + v.clientHeight + "px)")
  14480. }
  14481. function i(e) {
  14482. e.target === a && n()
  14483. }
  14484. function n() {
  14485. p && (p = !1,
  14486. E.classList.add("view-image"),
  14487. a.classList.remove("overlay"),
  14488. s.style.height = "",
  14489. l.style.paddingTop = "",
  14490. C.style.width = "",
  14491. C.style.height = "",
  14492. window.removeEventListener("resize", A),
  14493. a.removeEventListener("click", i),
  14494. c.removeEventListener("click", r),
  14495. o.removeEventListener("click", n),
  14496. _.emit(w.IMAGE_CLOSED),
  14497. _.close(!0))
  14498. }
  14499. function r(e) {
  14500. C.classList.toggle("show-info")
  14501. }
  14502. var a = _.div
  14503. , s = a.getElementsByClassName("tag-content")[0]
  14504. , l = a.getElementsByClassName("tag-media-content")[0]
  14505. , o = C.getElementsByClassName("close")[0]
  14506. , c = s.getElementsByClassName("tag-label")[0];
  14507. a.classList.add("has-image"),
  14508. E.classList.add("view-image"),
  14509. a.classList.add(1 <= I.aspect ? "image-landscape" : "image-portrait"),
  14510. _.applyOrientation(_.orientation);
  14511. 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,
  14512. function() {
  14513. clearInterval(h),
  14514. clearTimeout(u),
  14515. h = setInterval(function() {
  14516. var e = a.clientHeight;
  14517. d !== e && (t(),
  14518. d = e)
  14519. }, 100),
  14520. u = setTimeout(clearInterval.bind(this, h), 1e3)
  14521. }
  14522. );
  14523. I.on(w.IMAGE_OPENING, e),
  14524. _.on(b.ACTIVATE, e),
  14525. _.on(w.IMAGE_CLOSED, I.onClosed.bind(I)),
  14526. _.on(b.CLOSING, n)
  14527. }
  14528. var I = new n
  14529. , E = I.createDomElement();
  14530. this.once(b.OPENED, function() {
  14531. I.load(t.src).then(e).catch(function(e) {
  14532. p.warn("Failed to load image:", t.src),
  14533. p.warn("with error:", e)
  14534. }).then(this.onMediaLoadFinished.bind(this))
  14535. });
  14536. var _ = this;
  14537. return E
  14538. }
  14539. ,
  14540. t.prototype.createVideoElement = function(t, e) {
  14541. var i = new o({
  14542. autoPlay: !0,
  14543. autoResume: !0,
  14544. startMuted: !1,
  14545. loop: !1
  14546. })
  14547. , n = i.createDomElement();
  14548. return this.once(b.OPENED, function() {
  14549. i.load(t.src).then(function() {
  14550. this.div.classList.add("has-video"),
  14551. this.state !== g.OPEN && this.state !== g.ACTIVE || (i.show(),
  14552. i.play()),
  14553. this.on(b.OPENING, i.show.bind(i)),
  14554. this.on(b.OPENED, i.play.bind(i)),
  14555. this.on(b.CLOSING, i.pause.bind(i)),
  14556. this.on(b.CLOSED, i.hide.bind(i))
  14557. }
  14558. .bind(this)).catch(function(e) {
  14559. p.warn("Failed to embed video:", t.src),
  14560. p.warn("with error:", e)
  14561. }).then(this.onMediaLoadFinished.bind(this))
  14562. }
  14563. .bind(this)),
  14564. n
  14565. }
  14566. ,
  14567. t.prototype.createEmbedElement = function(t, e) {
  14568. var i = new a
  14569. , n = i.createDomElement();
  14570. return this.once(b.OPENED, function() {
  14571. i.load(t.src).then(function() {
  14572. this.div.classList.add("has-embed"),
  14573. this.state !== g.OPEN && this.state !== g.ACTIVE || i.show(),
  14574. this.applyOrientation(this.orientation),
  14575. this.on(b.OPENING, i.show.bind(i)),
  14576. this.on(b.CLOSED, i.hide.bind(i))
  14577. }
  14578. .bind(this)).catch(function(e) {
  14579. p.warn("Failed to embed:", t.src),
  14580. p.warn("with error:", e)
  14581. }).then(this.onMediaLoadFinished.bind(this))
  14582. }
  14583. .bind(this)),
  14584. n
  14585. }
  14586. ,
  14587. t.prototype.open = function(e) {
  14588. return this.openPromise = $.Deferred(),
  14589. this.state === g.ACTIVE ? this.openPromise.resolve().promise() : (this.hovering || this.div.classList.add("has-hotzone"),
  14590. this.openTransition ? e && this.setActiveState() : this.openTransition = s.setTimeout(function() {
  14591. this.state !== g.OPEN && (this.emit(b.OPENING),
  14592. e && this.emit(b.ACTIVATING),
  14593. this.state = g.OPENING,
  14594. this.animateOpen(function() {
  14595. e && this.setActiveState(),
  14596. this.openPromise.resolve()
  14597. }
  14598. .bind(this)))
  14599. }
  14600. .bind(this), d.animation.openDelay),
  14601. s.cancel(this.closeTransition),
  14602. this.closePromise && this.closePromise.reject(),
  14603. this.closeTransition = void 0,
  14604. this.openPromise.promise())
  14605. }
  14606. ,
  14607. t.prototype.close = function(e) {
  14608. return this.closePromise = $.Deferred(),
  14609. !e && this.hovering ? this.closePromise.reject().promise() : (this.closeTransition || (this.closeTransition = s.setTimeout(function() {
  14610. this.state !== g.CLOSED && (this.emit(b.CLOSING),
  14611. this.state = g.CLOSING,
  14612. this.animateClose())
  14613. }
  14614. .bind(this), d.animation.closeDelay)),
  14615. s.cancel(this.openTransition),
  14616. this.openPromise && this.openPromise.reject(),
  14617. this.openTransition = void 0,
  14618. this.closePromise.resolve(),
  14619. this.closePromise.promise())
  14620. }
  14621. ,
  14622. t.prototype.setActiveState = function() {
  14623. this.state !== g.CLOSED && (this.state = g.ACTIVE,
  14624. this.emit(b.ACTIVATE),
  14625. this.div.classList.remove("has-hotzone"))
  14626. }
  14627. ,
  14628. t.prototype.animateOpen = function(e) {
  14629. if (this.state === g.OPENING) {
  14630. if (s.cancel(this.animationTransition),
  14631. c.detectSamsungNative())
  14632. return this.boardOrientation = null,
  14633. this.div.style.visibility = "visible",
  14634. this.emit(b.OPENED),
  14635. this.state = g.OPEN,
  14636. void (e && e());
  14637. this.div.style.webkitTransform = "scale(0)",
  14638. this.div.style.transform = "scale(0)",
  14639. this.div.style.visibility = "visible",
  14640. this.animationTransition = s.start(l.property(this, "animationScale", 1), d.animation.openDuration, function() {
  14641. this.emit(b.OPENED),
  14642. this.state = g.OPEN,
  14643. e && e()
  14644. }
  14645. .bind(this))
  14646. }
  14647. }
  14648. ,
  14649. t.prototype.animateClose = function(e) {
  14650. this.state === g.CLOSING && (s.cancel(this.animationTransition),
  14651. this.animationTransition = s.start(l.property(this, "animationScale", 0), d.animation.closeDuration, function() {
  14652. this.emit(b.CLOSED),
  14653. this.state = g.CLOSED,
  14654. this.div.style.visibility = "hidden",
  14655. this.div.classList.contains("has-hotzone") || this.div.classList.add("has-hotzone"),
  14656. e && e()
  14657. }
  14658. .bind(this)))
  14659. }
  14660. ,
  14661. t.prototype.needsUpdate = function() {
  14662. return this.state !== g.CLOSED
  14663. }
  14664. ,
  14665. t.prototype.update = function(e, t) {
  14666. if (this.needsUpdate()) {
  14667. var i = (this.updateOrientation(e),
  14668. this.calcScale(t))
  14669. , n = {
  14670. x: (e.x + 1) * $("#player").width() / 2,
  14671. y: (e.y + 1) * $("#player").height() / 2
  14672. };
  14673. this.div.screenTransform = this.initialTransform + " translate(" + n.x + "px, " + n.y + "px) scale(" + i * this.animationScale + ")",
  14674. this.div.style.webkitTransform = this.div.screenTransform,
  14675. this.div.style.transform = this.div.screenTransform
  14676. }
  14677. }
  14678. ,
  14679. t.prototype.getDimensions = function() {
  14680. return this.div.getBoundingClientRect()
  14681. }
  14682. ,
  14683. t.prototype.calcScale = function(e) {
  14684. return Math.sqrt(e / 40) * d.boardToDiscRatio
  14685. }
  14686. ,
  14687. t.prototype.updateOrientation = function(e) {
  14688. if (this.state !== g.ACTIVE) {
  14689. var t = e.y < -1 / 3 ? 0 : e.y < 1 / 3 ? 1 : 2
  14690. , i = e.x < -1 / 3 ? 0 : e.x < 1 / 3 ? 1 : 2
  14691. , n = "";
  14692. n += 0 == i ? "right" : 2 == i ? "left" : "",
  14693. n += 0 == t ? "-down" : 2 == t ? "-up" : "",
  14694. 1 == i && (n = 0 == t ? "bottom" : 2 == t ? "top" : "",
  14695. 1 == t && (n = $("#player").width() > $("#player").height() ? e.x < 0 ? "right" : "left" : e.y < 0 ? "bottom" : "top")),
  14696. 1 == i && 1 == t && n === this.orientation || this.applyOrientation(n)
  14697. }
  14698. }
  14699. ,
  14700. t.prototype.applyOrientation = function(e) {
  14701. this.div.style.transform = this.div.style.webkitTransform = "",
  14702. this.div.classList.remove("tag-container-" + this.orientation),
  14703. this.div.classList.add("tag-container-" + e);
  14704. var t = window.getComputedStyle(this.div);
  14705. this.initialTransform = t.transform || t.webkitTransform,
  14706. "none" === this.initialTransform && (this.initialTransform = "");
  14707. var i = t.transform.slice(7, -1).split(",")
  14708. , n = -i[4]
  14709. , r = -i[5];
  14710. this.div.style.webkitTransformOrigin = n + "px " + r + "px",
  14711. this.div.style.transformOrigin = n + "px " + r + "px",
  14712. this.orientation = e
  14713. }
  14714. ,
  14715. v.exports = t
  14716. }
  14717. ).call(this, "/js/tag/Billboard/Billboard.js")
  14718. }
  14719. , {
  14720. "../../util/browser": 182,
  14721. "../../util/lerp": 188,
  14722. "../../util/logger": 189,
  14723. "../../util/transitions": 195,
  14724. "../Media/EmbedlyEmbed": 125,
  14725. "../Media/EmbedlyPlayer": 126,
  14726. "../Media/Image": 128,
  14727. "../Media/Link": 129,
  14728. "../Media/MediaEvent": 131,
  14729. "../Parser/DescriptionChunkType": 133,
  14730. "../Parser/DescriptionParser": 134,
  14731. "./BillboardEvent": 120,
  14732. "./billboardSettings": 121,
  14733. "./overlaySettings": 122,
  14734. events: 202
  14735. }],
  14736. 120: [function(e, t, i) {
  14737. "use strict";
  14738. t.exports = Object.freeze({
  14739. ENTER: "billboard.enter",
  14740. LEAVE: "billboard.leave",
  14741. OPENING: "billboard.opening",
  14742. OPENED: "billboard.open",
  14743. CLOSING: "billboard.closing",
  14744. CLOSED: "billboard.closed",
  14745. ACTIVATING: "billboard.activating",
  14746. ACTIVATE: "billboard.activate"
  14747. })
  14748. }
  14749. , {}],
  14750. 121: [function(e, t, i) {
  14751. "use strict";
  14752. t.exports = Object.freeze({
  14753. animation: Object.freeze({
  14754. hoverOnClosing: !1,
  14755. openDelay: 100,
  14756. closeDelay: 50,
  14757. openDuration: 200,
  14758. closeDuration: 100
  14759. }),
  14760. boardToDiscRatio: 1.2
  14761. })
  14762. }
  14763. , {}],
  14764. 122: [function(e, t, i) {
  14765. "use strict";
  14766. t.exports = Object.freeze({
  14767. boundaryWidth: 30,
  14768. boundaryHeight: 0
  14769. })
  14770. }
  14771. , {}],
  14772. hot: [function(e, t, i) {
  14773. "use strict";
  14774. function n(e, t, i) {
  14775. this.sid = e,
  14776. this.position = this.convertValue(t.position, g.Vector3)
  14777. if(t.quaternion){
  14778. this.quaternion = this.convertValue(t.quaternion, g.Quaternion)
  14779. }else{
  14780. this.rotation = new g.Euler().setFromVector3(this.convertValue(t.rotation, g.Vector3 ))
  14781. }
  14782. this.quaternion || (this.quaternion = new THREE.Quaternion().setFromEuler(this.rotation))
  14783. this.isSprite = t.isSprite
  14784. this.noAction = t.noAction
  14785. this.linkType = t.linkType || "common"
  14786. this.link = t.link,
  14787. this.model = i,
  14788. this.size = t.size;
  14789. this.styleTex = [] // 存储热点icon的图片 [{src:...}, {src:...} ] 最多两个,里面是带有src的object, 可以是img
  14790. this.build()
  14791. t.infoAttribute && t.infoAttribute.title && this.createTitleElem(t.infoAttribute.title)
  14792. this.changeTex()
  14793. this.setVisiblePanos(t.visiblePanos);
  14794. this.infoAttribute = t.infoAttribute;
  14795. }
  14796. var g = e("three")
  14797. , r = e("../shaders")
  14798. , m = e("../settings")
  14799. , v = e("../enum/Viewmode")
  14800. , d = e("../objects/Panorama")
  14801. , o = e("../util/texture")
  14802. , math = e("../util/math")
  14803. , p = new g.Raycaster
  14804. , a = new g.PlaneBufferGeometry(g_HotMeshSize.g_HotMeshWidth,g_HotMeshSize.g_HotMeshHeight,1,1)
  14805. var defaultTex1 = o.load(g_HotImage.point);
  14806. var defaultTex2 = o.load(g_HotImage.point2)
  14807. n.prototype.changeTex = function(){
  14808. var u = this.mesh.material.uniforms
  14809. if(this.styleTex.length){
  14810. u.texture1.value = o.load(this.styleTex[0].src);
  14811. u.texture2.value = o.load(this.styleTex[1]&&this.styleTex[1].src || this.styleTex[0].src);
  14812. }else{
  14813. u.texture1.value = defaultTex1;
  14814. u.texture2.value = defaultTex2;
  14815. }
  14816. }
  14817. n.prototype.initStyleImg = function(t){
  14818. this.styleTex = []
  14819. t.styleImg = t.styleImg || [];
  14820. t.styleImg.forEach((src)=>{
  14821. this.styleTex.push({src:manage.dealURL(src)})
  14822. })
  14823. this.changeTex()
  14824. }
  14825. n.prototype.update = function(camera) {
  14826. if(this.isSprite){
  14827. this.mesh.quaternion.copy(camera.quaternion)
  14828. }
  14829. }
  14830. n.prototype.setVisiblePanos = function(visibleData){
  14831. if(visibleData == "get"){
  14832. this.visiblePanos = player.model.panos.list.map((pano)=>{return pano.id})
  14833. }else if(visibleData){
  14834. this.visiblePanos = visibleData;
  14835. }
  14836. }
  14837. n.prototype.build = function() {
  14838. var t = g.UniformsUtils.clone(r.hot.uniforms);
  14839. var e = new g.Mesh(a, new g.ShaderMaterial({
  14840. uniforms: t,
  14841. vertexShader: r.hot.vertexShader,
  14842. fragmentShader: r.hot.fragmentShader,
  14843. transparent: !0
  14844. }))
  14845. , t = parseFloat(window.MP_PREFETCHED_MODELDATA.hotIconScale);
  14846. e.dynamic = !0,
  14847. e.position.copy(this.position);
  14848. e.quaternion.copy(this.quaternion)
  14849. t && e.scale.set(t, t, t),
  14850. e.name = this.sid,
  14851. e.type = "hotSprite",
  14852. (e.belongHot = this).link && (e.hotLink = this.link),
  14853. this.mesh = e,
  14854. this.model.add(e),
  14855. g_HotMeshes.push(e);
  14856. }
  14857. n.prototype.createTitleElem = function(title){
  14858. var root = $("#hot");
  14859. var elem = $(`<div> ${title}</div>`)
  14860. root.append(elem);
  14861. this.titleElem = elem;
  14862. }
  14863. n.prototype.showTitle = function(){
  14864. if(!this.titleElem)return;
  14865. var pos = math.getPos2d(this.position, player.camera, $("#player")[0])
  14866. this.titleElem.css( { "left" : `${pos.pos.x}px`, "top": `${pos.pos.y}px ` });
  14867. this.titleElem.css("display","block");
  14868. }
  14869. n.prototype.hideTitle = function(){
  14870. if(!this.titleElem)return;
  14871. this.titleElem.css("display","none");
  14872. }
  14873. ,
  14874. n.prototype.closestPanoTowardTag = function(e, t) {
  14875. var i = []
  14876. , n = []
  14877. , r = this.mesh.position;
  14878. if (e === v.PANORAMA) {
  14879. var o = t.position.clone().sub(r).normalize();
  14880. n.push(d.scoreFunctions.direction(r, o))
  14881. }
  14882. var a = new g.Vector3;
  14883. i.push(function(e) {
  14884. return Math.abs(e.position.x - r.x) > m.tags.visibility.cameraClearance || Math.abs(e.position.z - r.z) > m.tags.visibility.cameraClearance
  14885. }, function(e) {
  14886. a.copy(r).sub(e.position);
  14887. var t = -g.Math.radToDeg(Math.atan(a.y / Math.sqrt(a.x * a.x + a.z * a.z)))
  14888. , i = m.tags.navigate.tiltTolerance;
  14889. return m.insideLookLimitDown - i < t && t < m.insideLookLimitUp + i
  14890. },
  14891. (pano)=>{ // add
  14892. player.checkHasNeighbor(pano)
  14893. }
  14894. ),
  14895. n.push(d.scoreFunctions.distanceSquared(this.mesh, -2));
  14896. var s = t.model.panos.sortByScore(i, n);
  14897. if (s && m.tags.navigate.lineOfSight) {
  14898. for (var l = 0; l < s.length; l++) {
  14899. var c = s[l].pano
  14900. , h = c.position.distanceTo(r);
  14901. p.set(c.position, r.clone().sub(c.position).normalize());
  14902. var u = p.intersectObjects(t.model.colliders);
  14903. if (0 === u.length || u[0].distance > h)
  14904. return console.log(l),
  14905. c
  14906. }
  14907. return null
  14908. }
  14909. return s && 0 < s.length && s[0].pano
  14910. }
  14911. var getLink = function(link){
  14912. var src = '';
  14913. var r = link.substring(link.indexOf("html") + 4)
  14914. , o = "en" == manage.number("lang") ? "&lang=" + manage.number("lang") : "";
  14915. -1 == r.indexOf("?") ? src = link + "?time=" + randomTime().getTime() + "&id=" + window.number + o : src = link + "&time=" + randomTime().getTime() + "&id=" + window.number + o
  14916. return src
  14917. }
  14918. n.prototype.examine = function(e, options) {
  14919. options = options || {}
  14920. if(this.linkType!="common" && this.infoAttribute.iframe && this.infoAttribute.iframe[0] && !options.dontOpen){
  14921. var src = getLink(this.infoAttribute.iframe[0]);
  14922. if(this.linkType=="jumpLink"){
  14923. var newPage = window.open(src, "_blank" );
  14924. newPage.focus();
  14925. }else if(this.linkType=="iframeDiv"){
  14926. var div = document.createElement("div");
  14927. $("body").append(div);
  14928. div.style.position = 'fixed';
  14929. div.style.width = div.style.height = "100%";
  14930. div.style.left = div.style.top = '0';
  14931. div.style["z-index"] = "999"
  14932. var exit = document.createElement("div");
  14933. exit.style["background-image"] = "url(images/vrOffImg.png)";
  14934. exit.style.position = 'absolute';
  14935. exit.style.width = exit.style.height = "50px";
  14936. exit.style.left = '17px'; exit.style.top = "20px"
  14937. exit.style.cursor = "pointer";
  14938. exit.style["background-repeat"] = "no-repeat";
  14939. exit.style["background-size"] = "25%";
  14940. exit.style["background-position"] = "center center";
  14941. exit.style["background-color"] = "rgba(0, 0, 0, 0.2)";
  14942. exit.style["border-radius"] = "50%";
  14943. exit.style["z-index"] = "3"
  14944. exit.onclick = ()=>{
  14945. $(div).remove()
  14946. if(g_bgAudio && g_bgAudio.pauseByHot){
  14947. manage.switchBgmState(true)
  14948. }
  14949. }
  14950. var myElement = document.createElement("iframe");
  14951. myElement.style.position = 'absolute';
  14952. myElement.style.width = myElement.style.height = "100%";
  14953. myElement.style.left = myElement.style.top = '0';
  14954. myElement.src = src
  14955. div.appendChild(exit);
  14956. div.appendChild(myElement)
  14957. if(g_bgAudio && !g_bgAudio.paused){
  14958. manage.switchBgmState(false);
  14959. g_bgAudio.pauseByHot = true
  14960. }
  14961. if(g_tourAudio)g_tourAudio.pause()
  14962. }
  14963. return;
  14964. }
  14965. if(!player.currentPano)return;
  14966. var i = document.getElementById("popup");
  14967. if (this.link && !options.dontOpen) {
  14968. g_currentHot = this,
  14969. i.style.display = "block",
  14970. i.classList.add("wait");
  14971. var n = document.createElement("iframe");
  14972. if(g_bgAudio && !g_bgAudio.paused){
  14973. manage.switchBgmState(false);
  14974. g_bgAudio.pauseByHot = true
  14975. }
  14976. if(g_tourAudio)g_tourAudio.pause()
  14977. var src = getLink(this.link )
  14978. n.src = src;
  14979. n.id = "id1",
  14980. n.allowTransparency = "true";
  14981. var a = document.getElementById("id1");
  14982. if (void 0 === a || null == a) {
  14983. document.querySelector(".popup-content").appendChild(n);
  14984. var s = !1;
  14985. window.loaddingSuccess = function() {
  14986. s = !0
  14987. }
  14988. ,
  14989. setTimeout(function e() {
  14990. if (s) {
  14991. var t = document.querySelector("#id1").contentWindow.document;
  14992. t.querySelector("video") && (t.querySelector("video").play(),
  14993. !t.querySelector("video").paused && t.querySelector(".playPause") && t.querySelector(".playPause").classList.add("fa-pause")),
  14994. t.querySelector("audio") && t.querySelector("audio").play()
  14995. } else
  14996. setTimeout(e, 300)
  14997. }, 800)
  14998. }
  14999. }
  15000. var l = e.mode
  15001. , c = m.tags.navigate.nearestPano && this.closestPanoTowardTag(l, e.currentPano) || e.currentPano
  15002. , h = this.mesh.position;
  15003. e.flyingToTag = !0;
  15004. var u = function() {
  15005. e.flyingToTag = !1;
  15006. options.dontOpen || this.link && i.classList.remove("wait")
  15007. }
  15008. .bind(this);
  15009. if (l === v.PANORAMA) {
  15010. var d = {
  15011. pano: c,
  15012. lookAtPoint: h,
  15013. duration: null,
  15014. maxDistanceOverride: null,
  15015. skipWarpingCheck: !1
  15016. };
  15017. e.flyToPano(d, u)
  15018. } else {
  15019. var p = {
  15020. pano: c
  15021. };
  15022. if (h) {
  15023. var f = (new g.Matrix4).lookAt(c.position, h, new g.Vector3(0,1,0));
  15024. p.quaternion = (new g.Quaternion).setFromRotationMatrix(f)
  15025. }
  15026. p.callback = u,
  15027. p.duration = 1500,
  15028. p.mode = v.PANORAMA,
  15029. e.flyToNewMode(p)
  15030. }
  15031. }
  15032. ,
  15033. n.prototype.dispose = function(){
  15034. this.mesh.parent.remove(this.mesh);
  15035. var index = g_HotMeshes.indexOf(this.mesh);
  15036. g_HotMeshes.splice(index,1)
  15037. }
  15038. /* n.prototype.conversionArray = function(e) {
  15039. if ("[object Array]" == Object.prototype.toString.call(e))
  15040. return e;
  15041. var t = [];
  15042. for (var i in e)
  15043. t.push(parseFloat(e[i]));
  15044. return t
  15045. } */
  15046. n.prototype.convertValue = function(v ,Type){
  15047. var value;
  15048. if(v instanceof Array){
  15049. v.forEach((v1)=>{v1 = parseFloat(v1)})
  15050. value = new Type().fromArray(v);
  15051. }else{
  15052. for(let i in v){v[i] = parseFloat(v[i])}
  15053. value = new Type().copy(v);
  15054. }
  15055. return value
  15056. }
  15057. ,
  15058. t.exports = n
  15059. }
  15060. , {
  15061. three: 217,
  15062. "../shaders": 167,
  15063. "../enum/Viewmode": 51,
  15064. "../objects/Panorama": 148,
  15065. "../util/texture": 194,
  15066. "../settings": 166,
  15067. "../util/math": 190,
  15068. }],
  15069. 123: [function(M, R, e) {
  15070. (function(e) {
  15071. "use strict";
  15072. function d(e, t, i) {
  15073. var n = i.version || "0";
  15074. "0" !== n && w.info("tag defined using version " + n),
  15075. this.model = e,
  15076. this.sid = t,
  15077. this.color = (new f.Color).set(i.color || o.tagDefault),
  15078. this.hoverColor = o._darken(this.color, .2),
  15079. this.floor = null,
  15080. this.floorIndex = i.floor,
  15081. this.mode = m.PANORAMA,
  15082. i.preferred_camera && i.preferred_camera.mode && (this.mode = i.preferred_camera.mode),
  15083. this.obj3d = null,
  15084. this.disc = null,
  15085. this.materials = {
  15086. disc: null,
  15087. pole: null
  15088. },
  15089. this.position = (new f.Vector3).copy(i.position),
  15090. this.discPosition = (new f.Vector3).copy(i.stem.direction),
  15091. this.discWorldPosition = null,
  15092. this.discScale = .05,
  15093. this.poleEnabled = i.stem.enabled,
  15094. this.billboard = new r(i.label,i.description,i.media,this),
  15095. this.visibleTransition = null,
  15096. this.hoveringDisc = !1
  15097. }
  15098. 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"),
  15099. 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);
  15100. d.prototype = Object.create(b.prototype),
  15101. d.raycaster = new f.Raycaster,
  15102. d.prototype.bindEvents = function() {
  15103. this.billboard.on(_.ENTER, this.setHoverState.bind(this)),
  15104. this.billboard.on(_.LEAVE, this.setFreeState.bind(this))
  15105. }
  15106. ,
  15107. d.prototype.build = function() {
  15108. return this.floor = this.model.floors.get(this.floorIndex) || this.model.floors.first(),
  15109. this.floor && (this.billboard.build(this.model.sid),
  15110. this.obj3d = this.buildObject3D(),
  15111. this.floor.add(this.obj3d)),
  15112. this
  15113. }
  15114. ,
  15115. d.prototype.buildObject3D = function() {
  15116. var e = new f.Object3D;
  15117. e.position.copy(this.position);
  15118. var t = f.UniformsUtils.clone(A.tagDisc.uniforms);
  15119. t.bg.value = x,
  15120. t.mask.value = T,
  15121. t.color.value.copy(this.color),
  15122. this.materials.disc = new f.RawShaderMaterial({
  15123. transparent: !0,
  15124. vertexShader: A.tagDisc.vertexShader,
  15125. fragmentShader: A.tagDisc.fragmentShader,
  15126. uniforms: t
  15127. }),
  15128. this.disc = new f.Mesh(S,this.materials.disc),
  15129. this.disc.layers.set(a.TAG),
  15130. this.disc.position.copy(this.discPosition),
  15131. this.disc.renderOrder = s.tagDisc;
  15132. var i = (this.disc.tag = this).buildPole();
  15133. return i.layers.set(a.TAG),
  15134. i.renderOrder = s.tagStem,
  15135. e.add(i),
  15136. e.layers.set(a.TAG),
  15137. e.add(this.disc)
  15138. }
  15139. ,
  15140. d.prototype.buildPole = function() {
  15141. var e = new f.BufferGeometry
  15142. , t = new Float32Array(6);
  15143. return t[0] = t[1] = t[2] = 0,
  15144. t[3] = this.discPosition.x,
  15145. t[4] = this.discPosition.y,
  15146. t[5] = this.discPosition.z,
  15147. e.addAttribute("position", new f.BufferAttribute(t,3)),
  15148. this.materials.pole = new f.LineBasicMaterial({
  15149. linewidth: g.tags.pole.width,
  15150. color: g.tags.pole.color,
  15151. opacity: 0,
  15152. visible: this.poleEnabled,
  15153. transparent: !0,
  15154. depthWrite: !1
  15155. }),
  15156. new f.Line(e,this.materials.pole)
  15157. }
  15158. ,
  15159. d.prototype.setFreeState = function(e) {
  15160. !e && this.hoveringDisc || this.billboard.close(e).then(function() {
  15161. this.materials.disc.uniforms.color.value = this.color
  15162. }
  15163. .bind(this))
  15164. }
  15165. ,
  15166. d.prototype.setHoverState = function(e) {
  15167. this.billboard.open(e),
  15168. this.materials.disc.uniforms.color.value = this.hoverColor
  15169. }
  15170. ,
  15171. d.prototype.hide = function(e, t) {
  15172. var i = $.Deferred();
  15173. if (0 === this.materials.disc.uniforms.opacity.value && !C.isRunning(this.visibleTransition))
  15174. return i.resolve().promise();
  15175. e = e || 0,
  15176. t = t || 0,
  15177. C.cancel(this.visibleTransition);
  15178. var n, r, o, a = this.materials.disc.uniforms.opacity.value / g.tags.disc.opacity, s = t + e, l = t / s;
  15179. return this.visibleTransition = C.start((n = this,
  15180. r = I.property(n.materials.disc.uniforms.opacity, "value", 0),
  15181. o = I.property(n.materials.pole, "opacity", 0),
  15182. function(e) {
  15183. r(e),
  15184. n.materials.pole && o(e)
  15185. }
  15186. ), s * a, function() {
  15187. i.resolve()
  15188. }, l, E[g.warp.blendEasing]),
  15189. i.promise()
  15190. }
  15191. ,
  15192. d.prototype.show = function(e, t) {
  15193. var i = $.Deferred();
  15194. if (this.materials.disc.uniforms.opacity.value === g.tags.disc.opacity && !C.isRunning(this.visibleTransition))
  15195. return i.resolve().promise();
  15196. e = e || 0,
  15197. t = t || 0,
  15198. C.cancel(this.visibleTransition);
  15199. 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;
  15200. return this.visibleTransition = C.start((n = this,
  15201. r = I.property(n.materials.disc.uniforms.opacity, "value", g.tags.disc.opacity),
  15202. o = I.property(n.materials.pole, "opacity", g.tags.pole.opacity),
  15203. function(e) {
  15204. r(e),
  15205. n.materials.pole && o(e)
  15206. }
  15207. ), s * a, function() {
  15208. i.resolve()
  15209. }, l, E[g.warp.blendEasing]),
  15210. i.promise()
  15211. }
  15212. ,
  15213. d.prototype.closestPanoTowardTag = function(e, t) {
  15214. var i = []
  15215. , n = []
  15216. , r = this.disc.getWorldPosition();
  15217. if (e === m.PANORAMA) {
  15218. var o = t.position.clone().sub(r).normalize();
  15219. i.push(y.filters.isPanoAligned()),
  15220. i.push(y.filters.inPanoDirection(r, o, .5)),
  15221. i.push(y.filters.isNeighbourPanoTo(t)),
  15222. n.push(y.scoreFunctions.direction(r, o))
  15223. }
  15224. var a = new f.Vector3;
  15225. i.push(function(e) {
  15226. return Math.abs(e.position.x - r.x) > g.tags.visibility.cameraClearance || Math.abs(e.position.z - r.z) > g.tags.visibility.cameraClearance
  15227. }, function(e) {
  15228. a.copy(r).sub(e.position);
  15229. var t = -f.Math.radToDeg(Math.atan(a.y / Math.sqrt(a.x * a.x + a.z * a.z)))
  15230. , i = g.tags.navigate.tiltTolerance;
  15231. return g.insideLookLimitDown - i < t && t < g.insideLookLimitUp + i
  15232. }),
  15233. n.push(y.scoreFunctions.distanceSquared(this, -2));
  15234. var s = this.model.panos.sortByScore(i, n);
  15235. if (g.tags.navigate.lineOfSight) {
  15236. for (var l = 0; l < s.length; l++) {
  15237. var c = s[l].pano
  15238. , h = c.position.distanceTo(r);
  15239. if (!g.tags.visibility.anyDistance && h > g.tags.visibility.visibleDistance)
  15240. return null;
  15241. d.raycaster.set(c.position, r.clone().sub(c.position).normalize());
  15242. var u = d.raycaster.intersectObjects(this.model.colliders);
  15243. if (0 === u.length || u[0].distance > h)
  15244. return c
  15245. }
  15246. return null
  15247. }
  15248. return 0 < s.length && s[0].pano
  15249. }
  15250. ,
  15251. d.prototype.examine = function(i) {
  15252. if(!player.currentPano)return;
  15253. var e = i.mode
  15254. , n = g.tags.navigate.nearestPano && this.closestPanoTowardTag(e, i.currentPano) || i.currentPano
  15255. , t = this.disc.getWorldPosition();
  15256. this.billboard.setActiveState();
  15257. var r = function() {
  15258. var e = this.billboard.getDimensions()
  15259. , t = new f.Vector3;
  15260. v.convertScreenPositionToNDC(e.left + e.width / 2, e.top + e.height / 2, t),
  15261. t.unproject(i.camera),
  15262. i.flyToPano({
  15263. pano: n,
  15264. lookAtPoint: t
  15265. })
  15266. }
  15267. .bind(this);
  15268. if (e === m.PANORAMA)
  15269. if (n !== i.currentPano) {
  15270. var o = {
  15271. pano: n,
  15272. lookAtPoint: t,
  15273. duration: null,
  15274. maxDistanceOverride: null,
  15275. skipWarpingCheck: !1
  15276. };
  15277. i.flyToPano(o, r)
  15278. } else
  15279. setTimeout(function() {
  15280. this.billboard.open().then(function() {
  15281. r()
  15282. })
  15283. }
  15284. .bind(this), 0);
  15285. else {
  15286. var a = {
  15287. pano: n
  15288. };
  15289. if (t) {
  15290. var s = (new f.Matrix4).lookAt(n.position, t, new f.Vector3(0,1,0));
  15291. a.quaternion = (new f.Quaternion).setFromRotationMatrix(s)
  15292. }
  15293. a.callback = r,
  15294. a.duration = 1500,
  15295. a.mode = m.PANORAMA,
  15296. i.flyToNewMode(a)
  15297. }
  15298. }
  15299. ,
  15300. d.prototype.update = (n = new f.Vector3,
  15301. function(e, t) {
  15302. this.discWorldPosition = this.disc.getWorldPosition(),
  15303. this.updateDisc(e, t),
  15304. this.billboard.needsUpdate() && (n.copy(this.discWorldPosition).project(t),
  15305. n.z < 1 && (n.y *= -1,
  15306. this.billboard.update(n, this.getDiscRadius(n, t))))
  15307. }
  15308. ),
  15309. d.prototype.updateDisc = (l = new f.Vector3,
  15310. c = new f.Vector3,
  15311. h = new f.Vector3,
  15312. u = new f.Vector3,
  15313. p = new f.Vector3,
  15314. function(e, t) {
  15315. var i = g.tags.visibility
  15316. , n = g.tags.disc.scale
  15317. , r = e === m.DOLLHOUSE || e === m.FLOORPLAN ? g.tags.visibility.visibleDistance : t.position.distanceTo(this.discWorldPosition);
  15318. 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)),
  15319. this.obj3d.visible) {
  15320. this.disc.quaternion.copy(t.quaternion);
  15321. var o = n.maxSize - (n.maxSize - n.minSize) * f.Math.smoothstep(r, n.nearBound, n.farBound);
  15322. l.copy(this.discWorldPosition).project(t),
  15323. c.set($("#player").width() / 2, $("#player").height() / 2, 1).multiply(l),
  15324. h.set(o / 2, 0, 0).add(c),
  15325. u.set(2 / $("#player").width(), 2 / $("#player").height(), 1).multiply(h),
  15326. p.copy(u).unproject(t);
  15327. var a = p.distanceTo(this.discWorldPosition)
  15328. , s = 1 + g.tags.disc.scale.responsiveness / 100 * (d.viewportScale() - 1);
  15329. this.discScale = a * s,
  15330. this.disc.scale.set(this.discScale, this.discScale, this.discScale)
  15331. }
  15332. }
  15333. ),
  15334. d.prototype.getDiscRadius = (i = new f.Vector3,
  15335. function(e, t) {
  15336. return i.set(-this.discScale / 2, 0, 0).applyQuaternion(t.quaternion).add(this.discWorldPosition).project(t),
  15337. Math.abs(e.x - i.x) * $("#player").width()
  15338. }
  15339. ),
  15340. d.prototype.tagVisibleOnCurrentFloor = function(e) {
  15341. return !(e === m.DOLLHOUSE || e === m.FLOORPLAN) || this.model.allFloorsVisible || !this.floor.hidden
  15342. }
  15343. ,
  15344. d.prototype.offScreen = function(e, t) {
  15345. var i = e.getWorldPosition().project(t);
  15346. return !(-1 < i.x && i.x < 1 && -1 < i.y && i.y < 1)
  15347. }
  15348. ,
  15349. d.viewportScale = function() {
  15350. return d.viewportWidth === $("#player").width() && d.viewportHeight === $("#player").height() || (d.viewportWidth = $("#player").width(),
  15351. d.viewportHeight = $("#player").height(),
  15352. d.currentViewportScale = Math.sqrt(Math.min(d.viewportWidth, d.viewportHeight) / g.tags.disc.scale.baseViewportSize)),
  15353. d.currentViewportScale
  15354. }
  15355. ,
  15356. R.exports = d
  15357. }
  15358. ).call(this, "/js/tag/tag.js")
  15359. }
  15360. , {
  15361. "../enum/Colors": 19,
  15362. "../enum/RenderLayers": 41,
  15363. "../enum/RenderOrder": 42,
  15364. "../enum/Viewmode": 51,
  15365. "../objects/Panorama": 148,
  15366. "../settings": 166,
  15367. "../shaders": 167,
  15368. "../util/common": 185,
  15369. "../util/easing": 186,
  15370. "../util/lerp": 188,
  15371. "../util/logger": 189,
  15372. "../util/math": 190,
  15373. "../util/texture": 194,
  15374. "../util/transitions": 195,
  15375. "./Billboard/Billboard": 119,
  15376. "./Billboard/BillboardEvent": 120,
  15377. events: 202,
  15378. three: 217
  15379. }],
  15380. 124: [function(M, R, e) {
  15381. (function(e) {
  15382. "use strict";
  15383. function t() {
  15384. this.tagState = T.IDLE,
  15385. this.intersectTag = null,
  15386. this.hoveredTag = null,
  15387. this.activeTag = null,
  15388. this.tagDiscs = [],
  15389. this.raycaster = new i.Raycaster,
  15390. this.modelManager = null,
  15391. this.player = null,
  15392. this.totaltags = 0,
  15393. this.navigatingViaTag = !1,
  15394. this.enabled = !1
  15395. }
  15396. 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"),
  15397. M("../enum/TagStates")), x = M("events").EventEmitter, S = new n(e);
  15398. r.extend(t, x),
  15399. t.prototype.init = function(e, t) {
  15400. this.modelManager = e,
  15401. this.player = t,
  15402. this.updateModel(),
  15403. this.bindEvents()
  15404. }
  15405. ,
  15406. t.prototype.update = function(e) {
  15407. this.updateTags(this.player.mode, this.player.camera, this.player.currentPano, this.player.flying)
  15408. }
  15409. ,
  15410. t.prototype.updateTags = function(e, t, i, n) {
  15411. for (var r in this.model.tags)
  15412. this.model.tags[r].update(e, t, i, n)
  15413. }
  15414. ,
  15415. t.prototype.updateModel = function() {
  15416. this.model = this.modelManager.getActiveModel(),
  15417. this.gettagsFromModel(),
  15418. this.totaltags = Object.keys(this.model.tags).length
  15419. }
  15420. ,
  15421. t.prototype.gettagsFromModel = function() {
  15422. for (var e in this.tagDiscs = [],
  15423. this.model.tags) {
  15424. var t = this.model.tags[e].disc;
  15425. t && this.tagDiscs.push(t)
  15426. }
  15427. }
  15428. ,
  15429. t.prototype.bindEvents = function() {
  15430. function e() {
  15431. Object.keys(this.model.tags).forEach(function(e) {
  15432. var t = this.model.tags[e];
  15433. t.bindEvents(),
  15434. t.billboard.on(y.LINK_CLICK, function(e) {
  15435. e.type === A.NAVIGATION && this.navigateViaLink(e.url)
  15436. }
  15437. .bind(this)),
  15438. t.billboard.on(y.IMAGE_OPENED, function() {
  15439. this.tagState = T.EXAMINE,
  15440. this.emit(y.IMAGE_OPENED)
  15441. }
  15442. .bind(this)),
  15443. t.billboard.on(v.CLOSING, this.dismissExaminedTag.bind(this))
  15444. }
  15445. .bind(this))
  15446. }
  15447. this.modelManager.on(_.ActiveModelChanged, this.updateModel.bind(this)),
  15448. this.modelManager.on(_.ActiveModelChanged, e.bind(this)),
  15449. this.player.on(w.ModeChanging, this.onPlayerModeChanging.bind(this)),
  15450. this.player.on(w.PanoChosen, this.onPanoChange.bind(this)),
  15451. this.player.on(w.Ready, this.onPlayerReady.bind(this)),
  15452. this.player.on(w.FlyingEnded, this.onPlayerFlyingEnded.bind(this)),
  15453. this.player.on(w.WarpStarted, this.handleWarpStart.bind(this)),
  15454. this.player.on(w.WarpInterrupted, this.handleWarpInterruption.bind(this)),
  15455. e.call(this)
  15456. }
  15457. ,
  15458. t.prototype.navigateViaLink = function(e) {
  15459. var t = a.deserialize(e);
  15460. if (t)
  15461. if (t.mode === C.PANORAMA) {
  15462. try {
  15463. this.player.model.panos.get(t.panoId)
  15464. } catch (e) {
  15465. return void S.warn("Unable to find panorama location", t.panoId)
  15466. }
  15467. this.player.warpToPanoById(t.panoId, t.quaternion, null, null, I.BLACK)
  15468. } else {
  15469. var i = {
  15470. cameraMode: t.mode,
  15471. position: t.position,
  15472. quaternion: t.quaternion,
  15473. scanId: t.panoId,
  15474. orthoZoom: t.zoom,
  15475. floorVisibility: t.floorVisibility,
  15476. thumbUrl: null,
  15477. name: null
  15478. };
  15479. this.player.flyToNewMode({
  15480. mode: t.mode,
  15481. duration: m.warp.outsideTime,
  15482. warpDest: new g(i),
  15483. force: !0
  15484. })
  15485. }
  15486. }
  15487. ,
  15488. t.prototype.handleWarpStart = function(e, t, i, n) {
  15489. this.dismissExaminedTag(),
  15490. t === I.BLACK && (null != n || (n = m.warp.teleportTime),
  15491. e && (i = E.END),
  15492. this.hideShowTagsForBlackoutStyle(i, n))
  15493. }
  15494. ,
  15495. t.prototype.handleWarpInterruption = function(e, t, i) {
  15496. null != i || (i = m.warp.teleportTime),
  15497. this.hideShowTagsForBlackoutStyle(t, i)
  15498. }
  15499. ,
  15500. t.prototype.hideShowTagsForBlackoutStyle = function(e, t) {
  15501. var i = 0
  15502. , n = 0
  15503. , r = t / 2;
  15504. switch (null != e || (e = E.MIDDLE),
  15505. e) {
  15506. case E.END:
  15507. this.hideAlltags(r);
  15508. break;
  15509. case E.BEGINNING:
  15510. this.hideAlltags().done(this.showAlltags.bind(this, r));
  15511. break;
  15512. case E.NONE:
  15513. break;
  15514. case E.MIDDLE:
  15515. n = i = r,
  15516. this.hideAlltags(n),
  15517. setTimeout(function() {
  15518. this.showAlltags(i)
  15519. }
  15520. .bind(this), n);
  15521. break;
  15522. case E.FADEIN:
  15523. setTimeout(function() {
  15524. this.showAlltags(r)
  15525. }
  15526. .bind(this), r)
  15527. }
  15528. }
  15529. ,
  15530. t.prototype.onPlayerModeChanging = function(e, t) {
  15531. t !== C.PANORAMA && this.dismissExaminedTag(),
  15532. t === C.PANORAMA && player.currentPano && !player.currentPano.isAligned() && (t = C.OUTDOOR);
  15533. var i = t !== C.OUTDOOR;
  15534. i !== this.model.tagsShown && (i ? this.showAlltags(m.tags.startup.fadeInDuration) : this.hideAlltags(m.tags.startup.fadeInDuration))
  15535. }
  15536. ,
  15537. t.prototype.onPanoChange = function(e, t) {
  15538. var i = this.navigatingViaTag;
  15539. if (this.navigatingViaTag = !1,
  15540. !i) {
  15541. this.dismissExaminedTag();
  15542. var n = e && !e.isAligned() ? C.OUTDOOR : C.PANORAMA
  15543. , r = t && !t.isAligned() ? C.OUTDOOR : C.PANORAMA;
  15544. n !== r && (r === C.PANORAMA ? this.showAlltags(m.tags.startup.fadeInDuration, null, !0) : this.hideAlltags(m.tags.startup.fadeInDuration))
  15545. }
  15546. }
  15547. ,
  15548. t.prototype.onPlayerReady = function(e, t, i) {
  15549. this.startAlltags(e, t ? i : null)
  15550. }
  15551. ,
  15552. t.prototype.onPlayerFlyingEnded = function(e, t) {
  15553. this.updateClosestTags(e)
  15554. }
  15555. ,
  15556. t.prototype.dismissExaminedTag = function() {
  15557. this.activeTag && this.tagState === T.EXAMINE && this.dismissActiveTag(),
  15558. this.hoveredTag && (this.hoveredTag.setFreeState(!0),
  15559. this.hoveredTag = null)
  15560. }
  15561. ,
  15562. t.prototype.startAlltags = function(e, t) {
  15563. this.model.shouldShowtags = m.tags.enabled,
  15564. this.enabled = !0,
  15565. e || (this.showAlltags(m.tags.startup.fadeInDuration, m.tags.startup.fadeInDelay),
  15566. t && setTimeout(function() {
  15567. this.activateTag(this.model.getTagBySid(t))
  15568. }
  15569. .bind(this), m.tags.startup.fadeInDuration / 2))
  15570. }
  15571. ,
  15572. t.prototype.showAlltags = function(e, t, i) {
  15573. function n() {
  15574. ++o === this.totaltags && (this.model.tagsShown = !0,
  15575. r.resolve())
  15576. }
  15577. var r = $.Deferred();
  15578. if (!i && this.player.mode === C.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || !this.model.shouldShowtags)
  15579. return r.resolve().promise();
  15580. var o = 0;
  15581. for (var a in this.model.tags) {
  15582. this.model.tags[a].show(e, t).done(n.bind(this))
  15583. }
  15584. return r.promise()
  15585. }
  15586. ,
  15587. t.prototype.hideAlltags = function(e, t) {
  15588. function i() {
  15589. ++r === this.totaltags && (this.model.tagsShown = !1,
  15590. n.resolve())
  15591. }
  15592. var n = $.Deferred()
  15593. , r = 0;
  15594. for (var o in this.model.tags) {
  15595. var a = this.model.tags[o];
  15596. a.hide(e, t).done(i.bind(this)),
  15597. a === this.activeTag && this.dismissActiveTag()
  15598. }
  15599. return n.promise()
  15600. }
  15601. ,
  15602. t.prototype.enableHovering = function() {
  15603. this.enabled = !0
  15604. }
  15605. ,
  15606. t.prototype.disableHovering = function() {
  15607. this.enabled = !1
  15608. }
  15609. ,
  15610. t.prototype.activateTag = function(e, t) {
  15611. t = t || T.EXAMINE,
  15612. this.activeTag = e,
  15613. this.activeTag.hoveringDisc = !0,
  15614. this.activeTag.setHoverState(t === T.EXAMINE),
  15615. this.tagState = t,
  15616. this.emit(b.TagActivated, e)
  15617. }
  15618. ,
  15619. t.prototype.dismissActiveTag = function() {
  15620. this.activeTag.hoveringDisc = !1,
  15621. this.activeTag.setFreeState(!0);
  15622. var e = this.activeTag;
  15623. this.activeTag = null,
  15624. this.tagState = T.IDLE,
  15625. this.emit(b.TagDismissed, e)
  15626. }
  15627. ,
  15628. t.prototype.clickedOnTag = function(e) {
  15629. var t = function() {
  15630. this.navigatingViaTag = !0,
  15631. this.activeTag.examine(this.player),
  15632. this.emit(b.TagNavigation, this.activeTag)
  15633. }
  15634. .bind(this);
  15635. return this.tagState !== T.EXAMINE ? (this.activateTag(this.intersectTag, T.EXAMINE),
  15636. this.activeTag = this.intersectTag,
  15637. t(),
  15638. !0) : (this.dismissActiveTag(),
  15639. !1)
  15640. }
  15641. ,
  15642. t.prototype.intersecttag = (s = new i.Vector3,
  15643. l = new i.Vector3,
  15644. c = new i.Vector3,
  15645. function(e, t, i) {
  15646. if (!this.enabled)
  15647. return null;
  15648. var n = null
  15649. , r = this.tagDiscs.filter(function(e) {
  15650. return e.parent.visible
  15651. });
  15652. if (0 < r.length) {
  15653. var o = this.model.floors.reduce(function(e, t) {
  15654. return t.hidden ? e : e.concat(t.collider.children)
  15655. }, r);
  15656. s.set(e.x, e.y, -1).unproject(i),
  15657. l.set(e.x, e.y, 1).unproject(i),
  15658. c.copy(l).sub(s).normalize(),
  15659. this.raycaster.set(s, c);
  15660. var a = this.raycaster.intersectObjects(o);
  15661. 0 < a.length && -1 !== r.indexOf(a[0].object) && (n = a[0].object.tag)
  15662. }
  15663. return this.intersectTag = n,
  15664. t && (this.activeTag && n !== this.activeTag && (this.tagState === T.BROWSE || this.tagState === T.EXAMINE && n) && this.dismissActiveTag(),
  15665. n && n !== this.activeTag && (n.listeners(v.ENTER).length < 1 && (n.billboard.on(v.ENTER, function() {
  15666. this.hoveredTag = n
  15667. }
  15668. .bind(this)),
  15669. n.billboard.on(v.LEAVE, function() {
  15670. this.hoveredTag = null
  15671. }
  15672. .bind(this))),
  15673. this.activateTag(n, T.BROWSE))),
  15674. n
  15675. }
  15676. ),
  15677. t.prototype.rankedtagInDirection = (h = [],
  15678. u = [],
  15679. d = new i.Vector3,
  15680. p = new i.Vector3,
  15681. f = new i.Vector3,
  15682. function(e, t, i, n) {
  15683. for (var r = 0, o = u.length = 0; o < this.closesttags.length; o++) {
  15684. var a = this.closesttags[o];
  15685. p.copy(a.position),
  15686. p.add(a.discPosition),
  15687. d.copy(t),
  15688. d.sub(p).negate(),
  15689. d.normalize();
  15690. var s = d.dot(n);
  15691. if (0 <= s && (f.copy(p),
  15692. f.project(i),
  15693. this.intersecttag(f, !1, i))) {
  15694. if (r >= h.length)
  15695. for (var l = 0; l < 64; l++)
  15696. h.push({
  15697. tag: a,
  15698. dot: s
  15699. });
  15700. var c = h[r];
  15701. c.tag = a,
  15702. c.dot = s,
  15703. c.position = math.projectPositionToCanvas(p, i),
  15704. u.push(c),
  15705. r++
  15706. }
  15707. }
  15708. return u.sort(function(e, t) {
  15709. return e.dot > t.dot ? -1 : e.dot < t.dot ? 1 : 0
  15710. }),
  15711. e < u.length ? u[e].tag : null
  15712. }
  15713. ),
  15714. t.prototype.updateClosestTags = (o = new i.Vector3,
  15715. function(e) {
  15716. this.closesttags || (this.closesttags = []),
  15717. this.closesttags.length = 0;
  15718. var t = this.model.tags;
  15719. if (t)
  15720. for (var i in t)
  15721. if (t.hasOwnProperty(i)) {
  15722. var n = t[i]
  15723. , r = n.position;
  15724. o.copy(e),
  15725. o.sub(r).negate(),
  15726. o.lengthSq() < 30 && this.closesttags.push(n)
  15727. }
  15728. }
  15729. ),
  15730. R.exports = t
  15731. }
  15732. ).call(this, "/js/tag/tagManager.js")
  15733. }
  15734. , {
  15735. "../controls/serializer": 14,
  15736. "../enum/BlackoutStyle": 18,
  15737. "../enum/tagEvents": 32,
  15738. "../enum/ModelManagerEvents": 33,
  15739. "../enum/PlayerEvents": 40,
  15740. "../enum/TagStates": 44,
  15741. "../enum/Viewmode": 51,
  15742. "../enum/WarpStyle": 52,
  15743. "../objects/Snapshot": 153,
  15744. "../settings": 166,
  15745. "../util/common": 185,
  15746. "../util/lerp": 188,
  15747. "../util/logger": 189,
  15748. "./Billboard/BillboardEvent": 120,
  15749. "./Media/LinkType": 130,
  15750. "./Media/MediaEvent": 131,
  15751. events: 202,
  15752. three: 217
  15753. }],
  15754. 125: [function(r, o, e) {
  15755. (function(e) {
  15756. "use strict";
  15757. function t() {
  15758. this.embedWrapper = null,
  15759. this.embedElement = null
  15760. }
  15761. var i = r("../../util/ajax")
  15762. , a = r("./mediaSettings")
  15763. , n = r("../../settings")
  15764. , s = new (r("../../util/logger"))(e);
  15765. t.prototype.createDomElement = function() {
  15766. return this.embedWrapper = document.createElement("div"),
  15767. this.embedWrapper.classList.add("tag-embed"),
  15768. this.embedWrapper.classList.add("hidden"),
  15769. this.embedWrapper
  15770. }
  15771. ,
  15772. t.prototype.load = function(e) {
  15773. var t = "https://api.embedly.com/1/oembed?key=" + n.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&maxwidth=" + a.maxEmbedWidth;
  15774. return new Promise(function(r, o) {
  15775. i.get(t).then(function(e) {
  15776. if ((e = JSON.parse(e)).html && -1 === e.html.indexOf("<script")) {
  15777. this.embedWrapper.innerHTML = e.html;
  15778. var t = Math.min(e.width, a.maxEmbedWidth) || a.maxEmbedWidth;
  15779. if (this.embedWrapper.style.width = t + "px",
  15780. e.height) {
  15781. var i = e.height / e.width;
  15782. this.embedWrapper.style.height = t * i + "px"
  15783. }
  15784. this.embedElement = this.embedWrapper.firstChild;
  15785. var n = [];
  15786. try {
  15787. n = [].slice.call(this.embedElement.querySelectorAll("a"))
  15788. } catch (e) {
  15789. s.debug("Error getting `a` elements for embed; was it an iframe?")
  15790. }
  15791. n.forEach(function(e) {
  15792. e.setAttribute("target", "_blank")
  15793. }),
  15794. this.embedElement.classList.add("hidden"),
  15795. this.embedWrapper.classList.remove("hidden"),
  15796. r()
  15797. } else
  15798. o("Not a valid embed")
  15799. }
  15800. .bind(this), function(e) {
  15801. o(e.response)
  15802. })
  15803. }
  15804. .bind(this))
  15805. }
  15806. ,
  15807. t.prototype.show = function() {
  15808. this.embedElement && this.embedElement.classList.remove("hidden")
  15809. }
  15810. ,
  15811. t.prototype.hide = function() {
  15812. this.embedElement && this.embedElement.classList.add("hidden")
  15813. }
  15814. ,
  15815. o.exports = t
  15816. }
  15817. ).call(this, "/js/tag/Media/EmbedlyEmbed.js")
  15818. }
  15819. , {
  15820. "../../settings": 166,
  15821. "../../util/ajax": 181,
  15822. "../../util/logger": 189,
  15823. "./mediaSettings": 132
  15824. }],
  15825. 126: [function(a, s, e) {
  15826. (function(e) {
  15827. "use strict";
  15828. function t(e) {
  15829. r.call(this),
  15830. this.options = e,
  15831. this.playerControls = null,
  15832. this.state = o.NOT_READY
  15833. }
  15834. var i, n = a("../../util/browser"), r = a("./EmbedlyEmbed"), o = (new (a("../../util/logger"))(e),
  15835. Object.freeze({
  15836. NOT_READY: "player.not.ready",
  15837. CUED: "player.cued",
  15838. PLAYING: "player.playing",
  15839. PAUSED: "player.paused"
  15840. }));
  15841. (t.prototype = Object.create(r.prototype)).createDomElement = function() {
  15842. return this.embedWrapper = document.createElement("div"),
  15843. this.embedWrapper.classList.add("tag-video"),
  15844. this.embedWrapper.classList.add("hidden"),
  15845. this.embedWrapper
  15846. }
  15847. ,
  15848. t.prototype.load = function(e) {
  15849. var t = function() {
  15850. function e(e) {
  15851. this.playerState = e
  15852. }
  15853. this.playerControls = new playerjs.Player(this.embedElement),
  15854. this.playerControls.on("ready", function(e) {
  15855. this.playerState = o.CUED,
  15856. this.options.startMuted && this.playerControls.mute()
  15857. }
  15858. .bind(this)),
  15859. this.playerControls.on("play", e.bind(this, o.PLAYING)),
  15860. this.playerControls.on("pause", e.bind(this, o.PAUSED)),
  15861. this.playerControls.on("ended", function(e) {
  15862. this.playerControls.setCurrentTime(0),
  15863. this.options.loop ? this.playerControls.play() : this.playerControls.pause()
  15864. }
  15865. .bind(this))
  15866. }
  15867. .bind(this);
  15868. return r.prototype.load.call(this, e).then(t.bind(this))
  15869. }
  15870. ,
  15871. t.prototype.play = (i = n.isMobile(),
  15872. function() {
  15873. this.playerState !== o.NOT_READY && this.playerControls && !i && (this.state === o.CUED && this.options.autoPlay || this.options.autoResume) && this.playerControls.play()
  15874. }
  15875. ),
  15876. t.prototype.pause = function() {
  15877. this.playerState !== o.NOT_READY && this.playerControls && this.playerControls.pause()
  15878. }
  15879. ,
  15880. s.exports = t
  15881. }
  15882. ).call(this, "/js/tag/Media/EmbedlyPlayer.js")
  15883. }
  15884. , {
  15885. "../../util/browser": 182,
  15886. "../../util/logger": 189,
  15887. "./EmbedlyEmbed": 125
  15888. }],
  15889. 127: [function(t, i, e) {
  15890. (function(e) {
  15891. "use strict";
  15892. var r = t("../../util/ajax")
  15893. , o = new (t("./mediaSettings"),
  15894. t("../../util/logger"))(e)
  15895. , a = Promise.resolve();
  15896. i.exports.enqueue = function(i) {
  15897. function n() {}
  15898. return a = new Promise(function(e, t) {
  15899. a.catch(n).then(function() {
  15900. (o.debug("requesting file from embedly:", i.href),
  15901. r.get(i.href, {
  15902. responseType: i.responseType
  15903. }).then(function(e) {
  15904. return o.debug("requesting file finished:", i.href),
  15905. e
  15906. })).then(e, t)
  15907. })
  15908. }
  15909. )
  15910. }
  15911. }
  15912. ).call(this, "/js/tag/Media/EmbedlyQueue.js")
  15913. }
  15914. , {
  15915. "../../util/ajax": 181,
  15916. "../../util/logger": 189,
  15917. "./mediaSettings": 132
  15918. }],
  15919. 128: [function(s, l, e) {
  15920. (function(e) {
  15921. "use strict";
  15922. function t() {
  15923. this.imageWrapper = null,
  15924. this.width = 0,
  15925. this.height = 0,
  15926. this.aspect = 1
  15927. }
  15928. var i = s("./MediaEvent")
  15929. , n = s("./EmbedlyQueue")
  15930. , r = s("events").EventEmitter
  15931. , o = s("../../util/logger")
  15932. , a = s("../../settings");
  15933. new o(e),
  15934. (t.prototype = Object.create(r.prototype)).createDomElement = function() {
  15935. return this.imageWrapper = document.createElement("div"),
  15936. this.imageWrapper.classList.add("tag-image"),
  15937. this.imageWrapper.classList.add("hidden"),
  15938. this.imageWrapper.addEventListener("click", function(e) {
  15939. e.stopPropagation(),
  15940. this.emit(i.IMAGE_OPENING),
  15941. this.imageWrapper.style.pointerEvents = "none"
  15942. }
  15943. .bind(this)),
  15944. this.imageWrapper
  15945. }
  15946. ,
  15947. t.prototype.onClosed = function() {
  15948. this.imageWrapper.style.pointerEvents = "auto"
  15949. }
  15950. ,
  15951. t.prototype.load = function(e) {
  15952. var t = Math.max(window.screen.height, window.screen.width)
  15953. , i = "https://i.embed.ly/1/display/resize?key=" + a.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&width=" + t + "&height=" + t;
  15954. return new Promise(function(o, e) {
  15955. n.enqueue({
  15956. href: i,
  15957. responseType: "arraybuffer"
  15958. }).then(function(e) {
  15959. var t = new Uint8Array(e)
  15960. , i = new Blob([t])
  15961. , n = new window.Image;
  15962. n.addEventListener("load", function(e) {
  15963. var t = e.target;
  15964. this.width = t.naturalWidth,
  15965. this.height = t.naturalHeight,
  15966. this.aspect = this.width / this.height;
  15967. var i = e.target.src;
  15968. this.imageWrapper.style.backgroundImage = 'url("' + i + '")',
  15969. this.imageWrapper.style.width = this.width + "px",
  15970. this.imageWrapper.style.height = this.height + "px",
  15971. this.imageWrapper.classList.remove("hidden"),
  15972. o()
  15973. }
  15974. .bind(this));
  15975. var r = URL.createObjectURL(i);
  15976. n.src = r
  15977. }
  15978. .bind(this), e)
  15979. }
  15980. .bind(this))
  15981. }
  15982. ,
  15983. l.exports = t
  15984. }
  15985. ).call(this, "/js/tag/Media/Image.js")
  15986. }
  15987. , {
  15988. "../../settings": 166,
  15989. "../../util/logger": 189,
  15990. "./EmbedlyQueue": 127,
  15991. "./MediaEvent": 131,
  15992. events: 202
  15993. }],
  15994. 129: [function(e, t, i) {
  15995. "use strict";
  15996. function n(e) {
  15997. this.label = e.label,
  15998. this.href = e.url,
  15999. this.type = this.updateLinkForType(),
  16000. this.domElement = null,
  16001. this.id = c++
  16002. }
  16003. var r = e("./LinkType")
  16004. , o = e("./MediaEvent")
  16005. , a = e("../../util/browser")
  16006. , s = e("../../analytics")
  16007. , l = e("events").EventEmitter
  16008. , c = 0;
  16009. (n.prototype = Object.create(l.prototype)).updateLinkForType = function() {
  16010. var e, t = a.valueFromHash("m") || a.valueFromHash("model");
  16011. 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,
  16012. new RegExp("[#&?]start=([^#&?]*)").exec(e)[1]),
  16013. r.NAVIGATION) : (this.href = this.href + "&play=1",
  16014. r.MODEL) : r.EXT_LINK
  16015. }
  16016. ;
  16017. var h = {};
  16018. n.prototype.createDomElement = function() {
  16019. if (this.domElement = document.createElement("a"),
  16020. this.domElement.classList.add("tag-link"),
  16021. this.domElement.textContent = this.label,
  16022. this.type === r.EXT_LINK) {
  16023. this.domElement.textContent += " ";
  16024. var e = document.createElement("i");
  16025. e.classList.add("icon-ext-link"),
  16026. e.title = "Link to external web site",
  16027. this.domElement.appendChild(e)
  16028. }
  16029. return this.domElement.addEventListener("click", function(e) {
  16030. switch (e.stopPropagation(),
  16031. h[this.id] = !0,
  16032. s.trackAlways("click_tag_link", {
  16033. link_type: this.type,
  16034. link_count: c,
  16035. links_clicked: Object.keys(h).length
  16036. }),
  16037. this.type) {
  16038. case r.MODEL:
  16039. window.location.replace(this.href);
  16040. break;
  16041. case r.EXT_LINK:
  16042. window.open(this.href, "_blank")
  16043. }
  16044. this.emit(o.LINK_CLICK, {
  16045. type: this.type,
  16046. url: this.href
  16047. })
  16048. }
  16049. .bind(this)),
  16050. this.domElement
  16051. }
  16052. ,
  16053. t.exports = n
  16054. }
  16055. , {
  16056. "../../analytics": 4,
  16057. "../../util/browser": 182,
  16058. "./LinkType": 130,
  16059. "./MediaEvent": 131,
  16060. events: 202
  16061. }],
  16062. 130: [function(e, t, i) {
  16063. "use strict";
  16064. t.exports = {
  16065. NAVIGATION: "navigation",
  16066. MODEL: "model",
  16067. EXT_LINK: "ext-link"
  16068. }
  16069. }
  16070. , {}],
  16071. 131: [function(e, t, i) {
  16072. "use strict";
  16073. t.exports = Object.freeze({
  16074. LINK_CLICK: "mtmedia.link",
  16075. IMAGE_LOADED: "mtmedia.image.loaded",
  16076. IMAGE_OPENING: "mtmedia.image.opening",
  16077. IMAGE_OPENED: "mtmedia.image.opened",
  16078. IMAGE_CLOSING: "mtmedia.image.closing",
  16079. IMAGE_CLOSED: "mtmedia.image.closed",
  16080. VIDEO_START: "mtmedia.video.start",
  16081. VIDEO_PAUSE: "mtmedia.video.pause",
  16082. VIDEO_ENDED: "mtmedia.video.end"
  16083. })
  16084. }
  16085. , {}],
  16086. 132: [function(e, t, i) {
  16087. "use strict";
  16088. t.exports = Object.freeze({
  16089. maxEmbedWidth: 350,
  16090. defaultAspectRatio: .75
  16091. })
  16092. }
  16093. , {}],
  16094. 133: [function(e, t, i) {
  16095. "use strict";
  16096. t.exports = Object.freeze({
  16097. TEXT: "text",
  16098. LINK: "link",
  16099. IMAGE: "photo",
  16100. VIDEO: "video",
  16101. RICH: "rich"
  16102. })
  16103. }
  16104. , {}],
  16105. 134: [function(e, t, i) {
  16106. "use strict";
  16107. function n(e) {
  16108. this.capabilities = {
  16109. links: {
  16110. enable: e.supportLinks,
  16111. keepLabels: e.keepLinkLabels
  16112. }
  16113. }
  16114. }
  16115. var r = e("./DescriptionChunkType");
  16116. n.prototype.parse = function(e, i) {
  16117. var n = [];
  16118. return e.split("[").map(function(e, t) {
  16119. return 0 === t ? e : "[" + e
  16120. }).forEach(function(e) {
  16121. var t = this.findMarkdown(e);
  16122. if (t) {
  16123. if (-1 !== t.url.indexOf("javascript:"))
  16124. return;
  16125. this.addLinkChunk(n, t, i),
  16126. this.addTextChunk(n, e.slice(t.markdown.length))
  16127. } else
  16128. this.addTextChunk(n, e)
  16129. }
  16130. .bind(this)),
  16131. n
  16132. }
  16133. ,
  16134. n.prototype.findMarkdown = function(e) {
  16135. var t = e.match(/\[([^\]]*)\]\((.*)\)/);
  16136. if (t) {
  16137. for (var i = t[2], n = 1, r = 0; r < i.length && ("(" === i[r] ? n++ : ")" === i[r] && n--,
  16138. 0 !== n); )
  16139. r++;
  16140. var o = i.length - r;
  16141. return {
  16142. markdown: t[0].substring(0, t[0].length - o),
  16143. label: t[1],
  16144. url: t[2].substring(0, r)
  16145. }
  16146. }
  16147. }
  16148. ,
  16149. n.prototype.addTextChunk = function(e, t) {
  16150. 0 !== t.length && e.push({
  16151. type: r.TEXT,
  16152. text: t
  16153. })
  16154. }
  16155. ,
  16156. n.prototype.addLinkChunk = function(e, t) {
  16157. if (this.capabilities.links.enable) {
  16158. var i = {
  16159. label: t.label,
  16160. url: t.url
  16161. };
  16162. -1 === i.url.indexOf("://") && (i.url = "http://" + i.url),
  16163. e.push({
  16164. type: r.LINK,
  16165. link: i
  16166. })
  16167. } else
  16168. this.capabilities.links.keepLabels && this.addTextChunk(e, t.label)
  16169. }
  16170. ,
  16171. t.exports = n
  16172. }
  16173. , {
  16174. "./DescriptionChunkType": 133
  16175. }],
  16176. 135: [function(t, r, e) {
  16177. (function(e) {
  16178. "use strict";
  16179. var i = new (t("../util/logger"))(e)
  16180. , n = {
  16181. parseIdsFromChunkName: function(e, t) {
  16182. t.floorId = n.parseFloor(e),
  16183. t.roomId = n.parseRoom(e)
  16184. },
  16185. parseFloor: function(e) {
  16186. var t = e.match(/_group([0-9]+)/);
  16187. if (!t)
  16188. return 0;
  16189. try {
  16190. return parseInt(t[1], 10)
  16191. } catch (e) {
  16192. return i.warn('Non-int value "' + t[1] + '" for mesh group, defaulting to floor 0'),
  16193. 0
  16194. }
  16195. },
  16196. parseRoom: function(e) {
  16197. var t = e.match(/_sub([0-9]+)/);
  16198. if (!t)
  16199. return -1;
  16200. try {
  16201. return parseInt(t[1], 10)
  16202. } catch (e) {
  16203. return i.warn('Non-int value "' + t[1] + '" for mesh subgroup, defaulting to subgroup 0'),
  16204. 0
  16205. }
  16206. }
  16207. };
  16208. r.exports = n
  16209. }
  16210. ).call(this, "/js/model/Chunks.js")
  16211. }
  16212. , {
  16213. "../util/logger": 189
  16214. }],
  16215. 136: [function(a, c, e) {
  16216. (function(e) {
  16217. "use strict";
  16218. function t(e) {
  16219. r.call(this),
  16220. this.model = e,
  16221. this.exploded = !1
  16222. }
  16223. var i = a("../objects/Floor")
  16224. , n = (a("../settings"),
  16225. a("../util/logger"))
  16226. , s = a("../util/transitions")
  16227. , r = a("../util/IndexedCollection")
  16228. , o = a("../util/common")
  16229. , l = a("../util/easing");
  16230. new n(e),
  16231. o.inherit(t, r),
  16232. t.prototype.add = function(e) {
  16233. r.prototype.add.call(this, e),
  16234. this.model.add(e)
  16235. }
  16236. ,
  16237. t.prototype.getIndex = function(e) {
  16238. return e.floorIndex
  16239. }
  16240. ,
  16241. t.prototype.build = function() {
  16242. this.list.forEach(function(e) {
  16243. e.build()
  16244. })
  16245. }
  16246. ,
  16247. t.prototype.size = function() {
  16248. return this.length
  16249. }
  16250. ,
  16251. t.prototype.sort = function() {
  16252. r.prototype.sort.call(this, function(e, t) {
  16253. return e.floorIndex - t.floorIndex
  16254. })
  16255. }
  16256. ,
  16257. t.prototype.nextFloor = function(e, t) {
  16258. return this.index[e.floorIndex + t] || null
  16259. }
  16260. ,
  16261. t.prototype.getFloorAtPoint = function(e) {
  16262. for (var t = null, i = 1 / 0, n = 0; n < this.list.length; n++) {
  16263. var r = this.list[n]
  16264. , o = r.distanceToPoint(e);
  16265. (!t || o < i) && (i = o,
  16266. t = r)
  16267. }
  16268. return t
  16269. }
  16270. ,
  16271. t.prototype.getOrMakeFloor = function(e) {
  16272. var t = this.index[e];
  16273. return t || (t = new i(this.model,e),
  16274. this.add(t)),
  16275. t
  16276. }
  16277. ,
  16278. t.prototype.hide = function() {
  16279. this.list.forEach(function(e) {
  16280. e.hide()
  16281. })
  16282. }
  16283. ,
  16284. t.prototype.show = function() {
  16285. this.list.forEach(function(e) {
  16286. e.show()
  16287. })
  16288. }
  16289. ,
  16290. t.prototype.names = function() {
  16291. return this.list.reduce(function(e, t) {
  16292. return e.concat(t.name)
  16293. }, [])
  16294. }
  16295. ,
  16296. t.prototype.toggleExplodeHorizontal = function() {
  16297. function i(e, t) {
  16298. a.copy(e.position),
  16299. e.position.x = r[e.floorIndex] * t,
  16300. e.position.y = 1 * e.floorIndex * t,
  16301. a.sub(e.position).multiplyScalar(-1),
  16302. e.panos.forEach(function(e) {
  16303. e.translate(a)
  16304. })
  16305. }
  16306. var n, r = [], o = 0;
  16307. this.list.forEach(function(e, t, i) {
  16308. n = 0 < t ? Math.max(i[t - 1].boundingBox.max.x - e.boundingBox.min.x, e.boundingBox.size().x / 2) : 0,
  16309. o += n,
  16310. r[t] = o
  16311. }),
  16312. r = r.map(function(e) {
  16313. return e - o / 2
  16314. });
  16315. var a = this.list[0].position.clone();
  16316. this.exploded ? this.list.forEach(function(t) {
  16317. s.start(function(e) {
  16318. i(t, 1 - e)
  16319. }, 1500, null, 0, l.easeOutExpo)
  16320. }) : this.list.forEach(function(t) {
  16321. s.start(function(e) {
  16322. i(t, e)
  16323. }, 1500, null, 0, l.easeOutExpo)
  16324. }),
  16325. this.exploded = !this.exploded
  16326. }
  16327. ,
  16328. t.prototype.toggleExplodeVertical = function() {
  16329. function i(e, t) {
  16330. var i = i.copy(e.position);
  16331. e.position.y = (5 * e.floorIndex - n.y / 2) * t,
  16332. i.sub(e.position).multiplyScalar(-1),
  16333. e.panos.forEach(function(e) {
  16334. e.translate(i)
  16335. })
  16336. }
  16337. var n = this.model.size;
  16338. this.list[0].position.clone(),
  16339. this.exploded ? this.list.forEach(function(t) {
  16340. s.start(function(e) {
  16341. i(t, 1 - e)
  16342. }, 1500, null, 0, l.easeOutExpo)
  16343. }) : this.list.forEach(function(t) {
  16344. s.start(function(e) {
  16345. i(t, e)
  16346. }, 1500, null, 0, l.easeOutExpo)
  16347. }),
  16348. this.exploded = !this.exploded
  16349. }
  16350. ,
  16351. c.exports = t
  16352. }
  16353. ).call(this, "/js/model/FloorCollection.js")
  16354. }
  16355. , {
  16356. "../objects/Floor": 146,
  16357. "../settings": 166,
  16358. "../util/IndexedCollection": 175,
  16359. "../util/common": 185,
  16360. "../util/easing": 186,
  16361. "../util/logger": 189,
  16362. "../util/transitions": 195
  16363. }],
  16364. 137: [function(r, o, e) {
  16365. (function(e) {
  16366. "use strict";
  16367. function h() {
  16368. n.call(this)
  16369. }
  16370. var u = r("../settings")
  16371. , t = r("../util/logger")
  16372. , d = r("../enum/Viewmode")
  16373. , p = r("../objects/Snapshot")
  16374. , i = (r("../util/math"),
  16375. r("../util/common"))
  16376. , n = r("../util/IndexedCollection")
  16377. , l = new t(e);
  16378. i.inherit(h, n),
  16379. h.prototype.getImage = function(e) {
  16380. return e && this.index.hasOwnProperty(e) ? this.index[e] : null
  16381. }
  16382. ,
  16383. h.prototype.filterByModesAndReel = function(e, t) {
  16384. for (var i = [], n = 0; n < t.length; n += 1) {
  16385. var r = t[n]
  16386. , o = this.index[r.sid];
  16387. o && i.push(o)
  16388. }
  16389. var a = e[d.DOLLHOUSE]
  16390. , s = e[d.FLOORPLAN];
  16391. (i = i.filter(function(e) {
  16392. if (!e.metadata || void 0 === e.metadata.camera_mode)
  16393. return !0;
  16394. var t;
  16395. try {
  16396. t = d.convertWorkshopModeInt(e.metadata.camera_mode)
  16397. } catch (e) {
  16398. return l.debug(e.message),
  16399. !1
  16400. }
  16401. return t === d.PANORAMA || t === d.FLOORPLAN && s || t === d.DOLLHOUSE && a
  16402. })).length !== this.list.length && l.info("Disallowed " + (this.list.length - i.length) + " highlight images"),
  16403. this.list = i,
  16404. this.reIndex()
  16405. }
  16406. ,
  16407. h.prototype.getHeroLocations = function(e) {
  16408. if (0 === this.list.length)
  16409. return [];
  16410. for (var t = [], i = 0; i < this.list.length; ++i) {
  16411. var n = this.list[i]
  16412. , r = n.thumbnail_signed_src
  16413. , o = n.name || "";
  16414. if (n.metadata && void 0 !== n.metadata.camera_quaternion) {
  16415. if (!u.show360Views.enabled && n.metadata.scan_id) {
  16416. var a = e.get(n.metadata.scan_id);
  16417. if (a && !a.isAligned())
  16418. continue
  16419. }
  16420. var s = d.convertWorkshopModeInt(n.metadata.camera_mode);
  16421. if (s === d.MESH)
  16422. continue;
  16423. if(window.isLocal)var src = manage.dealURL(r)
  16424. else var src = "one" === g_version ? g_Prefix + r + "?" + randomTime().getTime() : r + "?" + randomTime().getTime()
  16425. var l = {
  16426. cameraMode: s,
  16427. position: n.metadata.camera_position,
  16428. quaternion: n.metadata.camera_quaternion,
  16429. zoom: n.metadata.zoom,
  16430. panoId: n.metadata.scan_id,
  16431. orthoZoom: n.metadata.ortho_zoom,
  16432. floorVisibility: void 0 !== n.metadata.floor_visibility ? n.metadata.floor_visibility.slice(0) : [],
  16433. thumbUrl: src,
  16434. name: h.filterImageName(o),
  16435. sid: n.sid
  16436. }
  16437. , c = new p(l);
  16438. t.push(c)
  16439. }
  16440. }
  16441. return t
  16442. }
  16443. ,
  16444. h.prototype.getIndex = function(e) {
  16445. return e.sid
  16446. }
  16447. ,
  16448. h.filterImageName = function(e) {
  16449. return "" === e || e.match(/^[0-9.]+_[0-9.]+$/) ? null : e
  16450. }
  16451. ,
  16452. o.exports = h
  16453. }
  16454. ).call(this, "/js/model/ImageCollection.js")
  16455. }
  16456. , {
  16457. "../enum/Viewmode": 51,
  16458. "../objects/Snapshot": 153,
  16459. "../settings": 166,
  16460. "../util/IndexedCollection": 175,
  16461. "../util/common": 185,
  16462. "../util/logger": 189,
  16463. "../util/math": 190
  16464. }],
  16465. 138: [function(h, u, e) {
  16466. (function(e) {
  16467. "use strict";
  16468. function n() {
  16469. c.call(this)
  16470. }
  16471. var r = h("../label/Label")
  16472. , i = h("../settings")
  16473. , t = h("../util/logger")
  16474. , o = h("../util/math")
  16475. , a = h("../util/ajax")
  16476. , s = h("./RoomCollection")
  16477. , l = h("../util/common")
  16478. , c = h("../util/IndexedCollection");
  16479. new t(e),
  16480. l.inherit(n, c),
  16481. n.prototype.getIndex = function(e) {
  16482. return e.labelId
  16483. }
  16484. ,
  16485. n.prototype.associateWithRooms = function(e) {
  16486. this.forEach(function(t) {
  16487. e.forEach(function(e) {
  16488. e.roomId === t.roomId && (t.room = e)
  16489. })
  16490. })
  16491. }
  16492. ,
  16493. n.prototype.createFromLabelData = function(e) {
  16494. e.forEach(function(e) {
  16495. var t = n.parseRoomIndexFromWorkshopRoomId(e.roomId);
  16496. t = s.generateRoomId(e.floorId, t);
  16497. var i = new r(e.sid,e.position || e.positions[0],e.text,e.floorId,t);
  16498. i.position = o.convertWorkshopVector(i.position),
  16499. this.add(i),
  16500. i.build()
  16501. }
  16502. .bind(this))
  16503. }
  16504. ,
  16505. n.prototype.load = function(e, t) {
  16506. return a.get(e, {
  16507. responseType: "json",
  16508. auth: t ? i.authorizationHeader : null
  16509. }).done(function(e) {
  16510. var t = [];
  16511. for (var i in e) {
  16512. var n = e[i];
  16513. t.push(n)
  16514. }
  16515. this.createFromLabelData(t)
  16516. }
  16517. .bind(this))
  16518. }
  16519. ,
  16520. n.parseRoomIndexFromWorkshopRoomId = function(e) {
  16521. var t = -1;
  16522. if (e) {
  16523. var i = e.split("_");
  16524. t = parseInt(i[0])
  16525. }
  16526. return t
  16527. }
  16528. ,
  16529. u.exports = n
  16530. }
  16531. ).call(this, "/js/model/LabelCollection.js")
  16532. }
  16533. , {
  16534. "../label/Label": 90,
  16535. "../settings": 166,
  16536. "../util/IndexedCollection": 175,
  16537. "../util/ajax": 181,
  16538. "../util/common": 185,
  16539. "../util/logger": 189,
  16540. "../util/math": 190,
  16541. "./RoomCollection": 141
  16542. }],
  16543. 139: [function(P, O, e) {
  16544. (function(e) {
  16545. "use strict";
  16546. function t(e, t) {
  16547. o.Object3D.call(this),
  16548. this.sid = window.number;//t.sid,
  16549. this.data = t,
  16550. this.options = e,
  16551. this.urls = new i(e.urlFiles),
  16552. this.isPublic = void 0 !== t.is_public && t.is_public,
  16553. this.images = new E(this),
  16554. this.images.extend(t.images),
  16555. this.heroImage = this.images.getImage(t.icon),
  16556. this.heroLocations = [],
  16557. this.outdoorPanoLocations = [],
  16558. this.floors = new c(this),
  16559. this.floorsEnabled = void 0 === e.floors || e.floors,
  16560. this.changingFloor = !1,
  16561. this.chunks = [],
  16562. this.panos = new g,
  16563. this.colliders = [],
  16564. this.loadPanosPromise = null,
  16565. this.loadMeshTexturesPromise = null,
  16566. this.auxDataPromise = null,
  16567. this.meshTexturesLoaded = !1,
  16568. this.meshTextures = [],
  16569. this.tags = {},
  16570. this.tagsShown = !1,
  16571. this.shouldShowtags = !1,
  16572. this.has360Views = !1,
  16573. this.showingLabels = u.labels.enabled && t.player_options.labels,
  16574. this.supportedModes = {},
  16575. this.supportedModes[s.PANORAMA] = !0,
  16576. this.supportedModes[s.DOLLHOUSE] = !t.player_options || t.player_options.dollhouse && I.valueFromHash("dh", 1),
  16577. this.supportedModes[s.FLOORPLAN] = !t.player_options || t.player_options.floor_plan && I.valueFromHash("dh", 1),
  16578. this.supportedModes[s.TRANSITIONING] = !0,
  16579. this.supportsTiles = this.configureTiling(),
  16580. this.supportsVR = window.MP_PREFETCHED_MODELDATA.supportsVR || false//!0,
  16581. this.mode = s.DOLLHOUSE,
  16582. this.size = null,
  16583. this.center = null,
  16584. this.boundingBox = new o.Box3,
  16585. this.currentFloor = null,
  16586. this.allFloorsVisible = !0,
  16587. this.projectedPano0 = null,
  16588. this.projectedPano1 = null,
  16589. this.floorsEnabled && t.floors && -1 !== t.floors.indexOf(",") && t.floors.split(",").forEach(function(e, t) {
  16590. this.addFloor(new r(this,t,e.trim()))
  16591. }
  16592. .bind(this)),
  16593. this.waitQueue = [],
  16594. this.on("load", function(e) {
  16595. 0 !== this.waitQueue.length && (this.waitQueue = this.waitQueue.filter(function(e) {
  16596. return !e.isLoadedCallback()
  16597. }),
  16598. 0 === this.waitQueue.length && this.emit("waiting-done"))
  16599. }
  16600. .bind(this)),
  16601. this.setupCustomProperties(),
  16602. this.hots = {}
  16603. }
  16604. var o = P("three")
  16605. , a = P("../util/ajax")
  16606. , i = P("../util/ModelUrls")
  16607. , n = P("../objects/BoundingTextureSkybox")
  16608. , s = P("../enum/Viewmode")
  16609. , l = P("../enum/RenderOrder")
  16610. , r = (P("../enum/AlignmentType"),
  16611. P("../objects/Floor"))
  16612. , c = P("./FloorCollection")
  16613. , h = P("../objects/Chunk")
  16614. , u = (P("../objects/Room"),
  16615. P("../objects/Snapshot"),
  16616. P("../label/Label"),
  16617. P("../util/math"),
  16618. P("../settings"))
  16619. , d = P("../shaders")
  16620. , p = P("../util/logger")
  16621. , f = (P("../tag/tag"),
  16622. P("../tag/tagManager"),
  16623. P("../objects/Panorama"))
  16624. , g = P("../util/PanoramaCollection")
  16625. , m = P("../loaders/ModelLoader")
  16626. , v = P("../loaders/ModelTextureLoader")
  16627. , y = P("../loaders/SweepDataLoader")
  16628. , A = P("../util/transitions")
  16629. , C = (P("../util/easing"),
  16630. P("../util/lerp"),
  16631. P("../util/common"))
  16632. , I = (P("../util/texture"),
  16633. P("./../util/browser"))
  16634. , E = P("./ImageCollection")
  16635. , _ = P("./RoomCollection")
  16636. , b = P("./LabelCollection")
  16637. , w = P("./Chunks")
  16638. , T = P("./../util/showcase")
  16639. , x = P("../exception/BasicException")
  16640. , S = (P("../constants"),
  16641. P("events").EventEmitter)
  16642. , M = P("hot")
  16643. , R = new p(e);
  16644. t.prototype = Object.create(o.Object3D.prototype),
  16645. C.extend(t, S),
  16646. t.prototype.setupCustomProperties = function() {
  16647. var t = u.modelAlpha;
  16648. Object.defineProperty(this, "alpha", {
  16649. get: function() {
  16650. return t
  16651. },
  16652. set: function(e) {
  16653. t = e,
  16654. this.chunks.forEach(function(e) {
  16655. e.material && e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = t)
  16656. })
  16657. }
  16658. })
  16659. }
  16660. ,
  16661. t.prototype.configureTiling = function() {
  16662. var e = function() {
  16663. try {
  16664. var e = document.createElement("canvas")
  16665. , t = e.getContext("webgl");
  16666. return (t = t || e.getContext("experimental-webgl")).getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE)
  16667. } catch (e) {
  16668. return 0
  16669. }
  16670. }();
  16671. if (e < 2048)
  16672. return !1;
  16673. R.warn("Max cube texture size: " + e);
  16674. for (var t = 0; t < u.tiling.tilingFlagNames.length; t++) {
  16675. var i = u.tiling.tilingFlagNames[t];
  16676. if ("1" === I.valueFromHash(i, null))
  16677. return !0;
  16678. if ("0" === I.valueFromHash(i, null))
  16679. return !1
  16680. }
  16681. return !!T.modelDataPromisesTiles(this.data)
  16682. }
  16683. ,
  16684. t.prototype.toggleAlpha = function() {
  16685. this.alpha < 1 ? this.alpha = 1 : this.alpha = 0
  16686. }
  16687. ,
  16688. t.prototype.load = function(e) {
  16689. var t = this.urls.init().then(function() {
  16690. return $.when(this.loadPanos(), this.loadMesh())
  16691. }
  16692. .bind(this));
  16693. return e ? t = t.then(this.loadMeshTextures.bind(this)) : t.then(this.loadMeshTextures.bind(this)),
  16694. this.auxDataPromise = $.when(this.loadhots(), this.loadLabels()),
  16695. $.when(t, this.auxDataPromise).done(this.build.bind(this))
  16696. }
  16697. ,
  16698. t.prototype.loadMesh = function() {
  16699. var n = $.Deferred()
  16700. , r = this;
  16701. return m.load(r.data.job.uuid, r.urls, function(e, t) {
  16702. if (0 === e.length) {
  16703. R.warn("No geometry found for model, loading faux geometry, disabling outside mode"),
  16704. r.supportedModes[s.DOLLHOUSE] = !1,
  16705. r.supportedModes[s.FLOORPLAN] = !1;
  16706. var i = new h({
  16707. geometry: new o.PlaneBufferGeometry(5,5,1,1)
  16708. });
  16709. i.material.visible = !1,
  16710. i.rotateX(-Math.PI / 2),
  16711. i.geometry.computeBoundingBox(),
  16712. e = [i]
  16713. }
  16714. e.forEach(function(e) {
  16715. var t = r.floorsEnabled ? w.parseFloor(e.name) : 0;
  16716. r.addChunk(t, e)
  16717. }),
  16718. r.floors.sort(),
  16719. n.resolve(r)
  16720. }, function(e, t) {
  16721. n.notify(e, t)
  16722. }, function(e) {
  16723. R.error(e),
  16724. n.reject("loading-failed")
  16725. }),
  16726. n.promise()
  16727. }
  16728. ,
  16729. t.prototype.loadMeshTextures = function() {
  16730. return this.loadTexturesPromise || (this.loadTexturesPromise = v.load(this, this.meshTextures).then(function() {
  16731. this.meshTexturesLoaded = !0
  16732. }
  16733. .bind(this))),
  16734. this.loadTexturesPromise
  16735. }
  16736. ,
  16737. t.prototype.shineHots = function() {
  16738. A.trigger({
  16739. func: function(e) {
  16740. var opa = e <= .5 ? 2 * e : -2 * e + 2
  16741. for(var i in this.hots){
  16742. this.hots[i].mesh.material.uniforms.opac.value = opa;
  16743. }
  16744. }
  16745. .bind(this),
  16746. cycling: !0,
  16747. duration: 3e3,
  16748. name: "hotShine"
  16749. })
  16750. }
  16751. ,
  16752. t.prototype.createHotItem = function(e, t) {
  16753. for (var i = document.createDocumentFragment(), n = Object.keys(e), r = 0; r < n.length; r++) {
  16754. var o = document.createElement("li")
  16755. , a = document.createElement("span");
  16756. a.innerHTML = e[n[r]].title || e[n[r]].infoAttribute.title || "热点",
  16757. o.hot = t[n[r]],
  16758. o.appendChild(a),
  16759. i.appendChild(o)
  16760. }
  16761. document.querySelector("#hotListContent ul").appendChild(i),
  16762. console.log(i)
  16763. }
  16764. ,
  16765. t.prototype.loadOverlays = function(overlays){
  16766. var overlays = window.data2 && window.data2.overlays /* ||
  16767. [
  16768. { depth: 0.02,
  16769. file: "https://super.4dage.com/data/TEST/overlay/b6fe7cb6bd2b6.mp4",
  16770. hasBox: 0,
  16771. height: 0.8165,
  16772. media: ["video"],
  16773. pos: [-4.3132, 0.6788, -13.5162],
  16774. qua: [0, 0.9396, 0, 0.3421],
  16775. sid: "1591079418827",
  16776. width: 0.6124
  16777. }] */
  16778. overlays && overlays.forEach((info)=>{
  16779. new Overlay(info)
  16780. })
  16781. }
  16782. ,
  16783. t.prototype.loadhots = function() {
  16784. var r = $.Deferred()
  16785. , e = g_Prefix + "data/" + this.sid + "/data2.js?" + randomTime().getTime();
  16786. return a.get(e, {
  16787. responseType: "json",
  16788. auth: this.isPublic ? null : u.authorizationHeader
  16789. }).done(function(e) {
  16790. window.data2 = e;
  16791. if(!e){
  16792. console.error("data2 is null")
  16793. }else{
  16794. g_data2 = hotMatcher(e)
  16795. this.hotsCount = 0;
  16796. //因为热点保存后在hots里的顺序会被修改,所以使用order来记录顺序,这里要重排序:
  16797. window.hotData = {}
  16798. if(e.hots){
  16799. var sids = Object.keys(e.hots).sort((a,b)=>{return e.hots[a].order - e.hots[b].order});
  16800. sids.forEach((sid)=>{
  16801. this.hotsCount++,
  16802. this.hots[sid] = new M(sid,e.hots[sid] ,this);
  16803. e.hots[sid].infoAttribute || (e.hots[sid].infoAttribute = {})
  16804. this.hots[sid].initStyleImg(e.hots[sid].infoAttribute);
  16805. window.hotData[sid] = e.hots[sid];
  16806. })
  16807. }
  16808. this.createHotItem(window.hotData, this.hots);
  16809. g_index = I.valueFromHash("m"),
  16810. e.tourAudio && (g_tourAudio = new Audio,
  16811. g_tourAudio.loop = !1,
  16812. g_tourAudio.addEventListener("ended", function() {
  16813. var e = document.createEvent("MouseEvent");
  16814. e.initEvent("tourAudioEnded", !0, !0),
  16815. window.dispatchEvent(e)
  16816. }));
  16817. e.weixinDesc && (g_weixinObj.desc = e.weixinDesc)
  16818. //window.wx && manage.weixinShare(),
  16819. }
  16820. /* var i = $.Deferred()
  16821. , n = g_Prefix + "data/" + this.sid + "/hot/js/data.js?" + randomTime().getTime();
  16822. a.get(n, {
  16823. responseType: "json",
  16824. auth: this.isPublic ? null : u.authorizationHeader
  16825. }).done(function(e) {
  16826. window.hotData = e,
  16827. this.createHotItem(e, this.hots);
  16828. for(let i in this.hots){
  16829. e[i] && this.hots[i].initStyleImg(e[i]);
  16830. }
  16831. i.resolve()
  16832. }
  16833. .bind(this)).fail(function() {
  16834. console.log("Data.js is empty");
  16835. i.resolve()
  16836. }),
  16837. */
  16838. r.resolve()
  16839. }
  16840. .bind(this)).fail(function() {
  16841. console.log("没有热点"),
  16842. //window.wx && manage.weixinShare(),
  16843. r.resolve()
  16844. }),
  16845. r
  16846. }
  16847. ,
  16848. t.prototype.loadPanos = function() {
  16849. if (this.loadPanosPromise)
  16850. return this.loadPanosPromise;
  16851. var e = new y(this);
  16852. return this.loadPanosPromise = e.load().then(function(e) {
  16853. return this.data.sweeps && 0 < Object.keys(this.data.sweeps).length && (e = e.filter(function(e) {
  16854. if(this.data.sweeps[e.uuid])return this.data.sweeps[e.uuid].enabled
  16855. else console.log(e.uuid)
  16856. //return this.data.sototype.loadOverlaysweeps[e.uuid].enabled
  16857. }
  16858. .bind(this))),
  16859. this.panos.extend(e.map(function(e) {
  16860. return new f(this,e.uuid,e,this.supportsTiles)
  16861. }
  16862. .bind(this))),
  16863. this.panos.forEach(function(i) {
  16864. i.neighbourUUIDs && (i.neighbourUUIDs.forEach(function(e) {
  16865. var t = this.panos.get(e);
  16866. t && this.panos.setNeighbour(i, t, !0)
  16867. }
  16868. .bind(this)),
  16869. i.neighbourPanos = this.panos.getNeighbours(i) || this.panos.setNeighbour(i, i, !0))
  16870. }
  16871. .bind(this)),
  16872. 0 === this.panos.length && (R.warn("Model has no panos, turning off inside mode"),
  16873. this.supportedModes[s.PANORAMA] = !1),
  16874. $.when(this)
  16875. }
  16876. .bind(this)),
  16877. this.loadPanosPromise
  16878. }
  16879. ,
  16880. t.prototype.loadHighlightReel = function() {
  16881. var t = $.Deferred()
  16882. , e = this.options.urlBase + "data/" + this.sid + "/active_reel.json";
  16883. return a.get(e, {
  16884. responseType: "json",
  16885. auth: this.isPublic ? null : u.authorizationHeader
  16886. }).done(function(e) {
  16887. e.reel ? (R.info("Got highlight reel with " + e.reel.length + " items"),
  16888. this.images.filterByModesAndReel(this.supportedModes, e.reel)) : R.info("No highlight reel found"),
  16889. t.resolve()
  16890. }
  16891. .bind(this)).fail(function() {
  16892. R.warn("Getting highlight reel failed, no highlights available"),
  16893. t.resolve()
  16894. }),
  16895. t
  16896. }
  16897. ,
  16898. t.prototype.waitForLoad = function(e, t) {
  16899. t() || (this.waitQueue.push({
  16900. object: e,
  16901. isLoadedCallback: t
  16902. }),
  16903. 1 === this.waitQueue.length && this.emit("waiting"))
  16904. }
  16905. ,
  16906. t.prototype.hide = function() {
  16907. this.floors.hide()
  16908. }
  16909. ,
  16910. t.prototype.show = function() {
  16911. this.floors.show()
  16912. }
  16913. ,
  16914. t.prototype.floorNames = function() {
  16915. return this.floors.names()
  16916. }
  16917. ,
  16918. t.prototype.warpDestFloors = function(e, t) {
  16919. if (e && this.floors.length === e.length) {
  16920. var i = e.findIndex(function(e) {
  16921. return e
  16922. }
  16923. .bind(this));
  16924. -1 !== i && this.setFloor(this.floors.list[i], null, t)
  16925. } else
  16926. this.toggleAllFloors(!0)
  16927. }
  16928. ,
  16929. t.prototype.setFloor = function(e, t, i) {
  16930. this.allFloorsVisible && this.emit("allfloors.toggled", !1, this.currentFloor),
  16931. this.allFloorsVisible = !1,
  16932. this._setFloor(e, t, i)
  16933. }
  16934. ,
  16935. t.prototype.toggleAllFloors = function(e) {
  16936. this.allFloorsVisible = void 0 !== e ? e : !this.allFloorsVisible,
  16937. this.emit("allfloors.toggled", this.allFloorsVisible, this.currentFloor),
  16938. this._setFloor(this.currentFloor)
  16939. }
  16940. ,
  16941. t.prototype._setFloor = function(e, t, i) {
  16942. var n;
  16943. if (t = t || this.mode,
  16944. this.emit("floor.changed", e, t, this.currentFloor),
  16945. this.currentFloor = e,
  16946. t === s.PANORAMA) {
  16947. if (this.show(),
  16948. this.shouldShowtags && this.tagsShown)
  16949. for (n in this.tags)
  16950. this.tags[n].show(u.showFloorDuration)
  16951. } else if ((t === s.FLOORPLAN || t === s.DOLLHOUSE) && (this.floors.list.forEach(function(e, t) {
  16952. e.toggle(e === this.currentFloor || this.allFloorsVisible, i || this.allFloorsVisible)
  16953. }
  16954. .bind(this)),
  16955. this.shouldShowtags && this.tagsShown))
  16956. for (n in this.tags) {
  16957. var r = this.tags[n];
  16958. this.allFloorsVisible ? r.show(u.showFloorDuration) : r.floor === this.currentFloor ? r.show(u.showFloorDuration, u.showFloorDelay) : r.hide(u.hideFloorDuration, u.hideFloorDelay)
  16959. }
  16960. var o = this
  16961. , a = e;
  16962. A.start(function() {}, u.showFloorDelay, function() {
  16963. o.floors.forEach(function(t) {
  16964. t.chunks.forEach(function(e) {
  16965. e.renderOrder = t === a ? l.visibleFloor : l.ghostFloor
  16966. })
  16967. })
  16968. }
  16969. .bind(this))
  16970. }
  16971. ,
  16972. t.prototype.toggleExplode = function() {
  16973. this.floors.toggleExplodeHorizontal()
  16974. }
  16975. ,
  16976. t.prototype.toggleExplodeUp = function() {
  16977. this.floors.toggleExplodeVertical()
  16978. }
  16979. ,
  16980. t.prototype.nextFloor = function(e) {
  16981. return this.floors.nextFloor(this.currentFloor, e)
  16982. }
  16983. ,
  16984. t.prototype.addFloor = function(e) {
  16985. this.floors.add(e)
  16986. }
  16987. ,
  16988. t.prototype.getFloorAtPoint = function(e) {
  16989. return this.floors.getFloorAtPoint(e)
  16990. }
  16991. ,
  16992. t.prototype.getTagBySid = function(e) {
  16993. return this.tags[e]
  16994. }
  16995. ,
  16996. t.prototype.addChunk = function(e, t) {
  16997. this.floors.getOrMakeFloor(e).addChunk(t),
  16998. this.chunks.push(t)
  16999. }
  17000. ,
  17001. t.prototype.setMode = function(t) {
  17002. if (!this.supportedModes[t])
  17003. throw new x("Mode not supported for this model: " + t);
  17004. this.mode = t
  17005. this.skybox.material.transparent = t == "panorama" ? false : true //xzw add // 如果skybox透明,会让其中其他mesh 如热点的透明出问题
  17006. this.chunks.forEach(function(e) {
  17007. e.setMode(t)
  17008. })
  17009. }
  17010. ,
  17011. t.prototype.build = function() {
  17012. this.heroLocations = this.images.getHeroLocations(this.panos);
  17013. var e = function() {
  17014. 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()
  17015. }
  17016. .bind(this)();
  17017. for (var t in this.has360Views = u.show360Views.enabled && this.heroLocations.some(function(e) {
  17018. return e.cameraMode === s.PANORAMA && this.panos.get(e.panoId) && !this.panos.get(e.panoId).isAligned()
  17019. }
  17020. .bind(this)) || e,
  17021. null === this.heroImage && R.warn("No hero image defined."),
  17022. this.currentFloor = this.floors.last(),
  17023. this.floors.build(),
  17024. this.colliders = this.floors.reduce(function(e, t) {
  17025. return e.concat(t.collider.children)
  17026. }, []),
  17027. this.panos.forEach(function(e) {
  17028. e.build1(),
  17029. e.on("enter", function() {
  17030. e.floor !== this.currentFloor && this.setFloor(e.floor)
  17031. }
  17032. .bind(this))
  17033. }
  17034. .bind(this)),
  17035. this.panos.forEach(function(e) {
  17036. e.build2()
  17037. }),
  17038. this.floors.forEach(function(e) {
  17039. this.boundingBox.union(e.boundingBox)
  17040. }
  17041. .bind(this)),
  17042. this.size = this.boundingBox.size(),
  17043. this.center = this.boundingBox.center(),
  17044. this.floors.forEach(function(e) {
  17045. R.info("Floor " + e + ": " + e.children.length + " chunks, " + e.panos.length + " panos.")
  17046. }
  17047. .bind(this)),
  17048. this.panos.populate_path_graph(),
  17049. this.skybox = new n(this.boundingBox),
  17050. this.skybox.matrixWorldNeedsUpdate = !0,
  17051. this.add(this.skybox),
  17052. setTimeout(function() {
  17053. this.hotsCount && this.shineHots()
  17054. }
  17055. .bind(this), 1300),
  17056. this.tags)
  17057. this.tags[t].build();
  17058. return R.debug("Done building model"),
  17059. 0 < f.raycastsDone && (R.warn("raycasts: " + f.raycastsDone),
  17060. R.warn("raycasts skipped: " + f.raycastsSkipped)),
  17061. this.buildRooms(),
  17062. this.labels.associateWithRooms(this.rooms),
  17063. $.when(this)
  17064. }
  17065. ,
  17066. t.prototype.loadLabels = function() {
  17067. this.labels = new b(this);
  17068. var e = $.Deferred();
  17069. /* if (window.MP_PREFETCHED_MODELDATA.model.player_options.labels && (this.showingLabels = !0),
  17070. !this.showingLabels) */
  17071. return e.resolve();
  17072. var t = g_Prefix + "data/" + this.sid + "/labels.json";
  17073. return this.labels.load(t, !this.isPublic).done(e.resolve.bind(e)).fail(function() {
  17074. R.warn("Getting labels failed, not displaying labels."),
  17075. e.resolve()
  17076. }),
  17077. e
  17078. }
  17079. ,
  17080. t.prototype.buildRooms = function() {
  17081. this.rooms = new _(this),
  17082. this.rooms.createFromChunks(this.chunks),
  17083. this.rooms.calcRoomBoundaries()
  17084. }
  17085. ,
  17086. t.prototype.updateProjectedPanos = function() {
  17087. this.projectedPano0 && this.projectedPano1 && this.setProjectedPanos(this.projectedPano0, this.projectedPano1, !1)
  17088. }
  17089. ,
  17090. t.prototype.setProjectedPanos = function(t, i, n) {
  17091. null != n || (n = !0),
  17092. n = !!n,
  17093. this.projectedPano0 = t,
  17094. this.projectedPano1 = i,
  17095. this.skybox.material.setProjectedPanos(t, i, n),
  17096. this.chunks.forEach(function(e) {
  17097. e.materialInside.setProjectedPanos(t, i, n)
  17098. })
  17099. }
  17100. ,
  17101. t.prototype.setSide = function(t) {
  17102. this.floors.forEach(function(e) {
  17103. e.collider.material.side = t
  17104. })
  17105. }
  17106. ,
  17107. t.prototype.heroCount = function() {
  17108. return this.heroLocations ? this.heroLocations.length : 0
  17109. }
  17110. ,
  17111. t.prototype.getHeroDescriptorByIndex = function(e) {
  17112. if (e < 0)
  17113. return R.warn("Model.getHeroDescriptorByHeroIndex() -> heroIndex is less than 0."),
  17114. null;
  17115. if (this.heroCount() < 1)
  17116. return R.warn("Model.getHeroDescriptorByIndex() -> No hero locations in this model"),
  17117. null;
  17118. var t = this.heroLocations[e];
  17119. return void 0 === t ? (R.warn("Model.getHeroDescriptorByIndex() -> Index " + e + " is not a validindex"),
  17120. null) : t
  17121. }
  17122. ,
  17123. t.prototype.findPanoramicHero = function() {
  17124. for (var e in this.heroLocations)
  17125. if (this.heroLocations[e].cameraMode === s.PANORAMA)
  17126. return this.heroLocations[e];
  17127. return null
  17128. }
  17129. ,
  17130. t.prototype.listImagePanos = function() {
  17131. var i = []
  17132. , n = this;
  17133. return this.images.forEach(function(e) {
  17134. if (e.metadata && e.metadata.scan_id) {
  17135. var t = n.panos.get(e.metadata.scan_id);
  17136. t && (n.supportsTiles || t.isLoaded("high") || i.push(t))
  17137. }
  17138. }),
  17139. i
  17140. }
  17141. ,
  17142. t.prototype.fadePanoMarkers = function(e, t) {
  17143. this.panos.fadeMarkerOpacity(e, t)
  17144. }
  17145. ,
  17146. t.prototype.setSweepVisibility = function(t) {
  17147. this.panos.forEach(function(e) {
  17148. e.marker && (e.marker.visible = t)
  17149. })
  17150. }
  17151. ,
  17152. t.prototype.outsideAllowed = function() {
  17153. return this.supportedModes[s.DOLLHOUSE] && this.supportedModes[s.FLOORPLAN]
  17154. }
  17155. ,
  17156. O.exports = t
  17157. }
  17158. ).call(this, "/js/model/Model.js")
  17159. }
  17160. , {
  17161. "../constants": 8,
  17162. "../enum/AlignmentType": 17,
  17163. "../enum/RenderOrder": 42,
  17164. "../enum/Viewmode": 51,
  17165. "../exception/BasicException": 55,
  17166. "../label/Label": 90,
  17167. "../loaders/ModelLoader": 105,
  17168. "../loaders/ModelTextureLoader": 106,
  17169. "../loaders/SweepDataLoader": 107,
  17170. "../tag/tag": 123,
  17171. "../tag/tagManager": 124,
  17172. "../objects/BoundingTextureSkybox": 143,
  17173. "../objects/Chunk": 144,
  17174. "../objects/Floor": 146,
  17175. "../objects/Panorama": 148,
  17176. "../objects/Room": 150,
  17177. "../objects/Snapshot": 153,
  17178. "../settings": 166,
  17179. "../shaders": 167,
  17180. "../util/ModelUrls": 177,
  17181. "../util/PanoramaCollection": 178,
  17182. "../util/ajax": 181,
  17183. "../util/common": 185,
  17184. "../util/easing": 186,
  17185. "../util/lerp": 188,
  17186. "../util/logger": 189,
  17187. "../util/math": 190,
  17188. "../util/texture": 194,
  17189. "../util/transitions": 195,
  17190. "./../util/browser": 182,
  17191. "./../util/showcase": 193,
  17192. "./Chunks": 135,
  17193. "./FloorCollection": 136,
  17194. "./ImageCollection": 137,
  17195. "./LabelCollection": 138,
  17196. "./RoomCollection": 141,
  17197. events: 202,
  17198. three: 217,
  17199. hot: "hot"
  17200. }],
  17201. 140: [function(e, t, i) {
  17202. "use strict";
  17203. function n() {
  17204. this.modelMap = {},
  17205. this.activeModel = null,
  17206. this.modelCount = 0,
  17207. this.tileDownloader = null,
  17208. this.panoRenderer = null
  17209. }
  17210. var r = (e("three"),
  17211. e("../util/common"))
  17212. , o = e("../exception/BasicException")
  17213. , a = e("../enum/ModelManagerEvents")
  17214. , s = e("../enum/PanoRendererEvents")
  17215. , l = e("events").EventEmitter;
  17216. n.prototype.init = function(e, t, i) {
  17217. this.tileDownloader = e,
  17218. this.panoRenderer = t,
  17219. this.qualityManager = i,
  17220. this.bindEvents()
  17221. }
  17222. ,
  17223. n.prototype.bindEvents = function() {
  17224. this.panoRenderer.on(s.TileRenderSuccess, this.onTileRendered.bind(this))
  17225. }
  17226. ,
  17227. n.prototype.onTileRendered = function(e, t, i, n) {}
  17228. ,
  17229. n.prototype.addModel = function(e) {
  17230. this.modelMap[e.sid] = e,
  17231. 0 === this.modelCount && this.activateModel(e.sid),
  17232. this.modelCount++,
  17233. this.emit(a.ModelAdded)
  17234. }
  17235. ,
  17236. n.prototype.getModel = function(e) {
  17237. return this.modelMap[e]
  17238. }
  17239. ,
  17240. n.prototype.activateModel = function(e) {
  17241. var t = this.modelMap[e];
  17242. if (!t)
  17243. throw new o("Tried to activate invalid model!");
  17244. var i = this.activeModel;
  17245. this.activeModel = t,
  17246. this.tileDownloader.setPanoData(t.panos, t.listImagePanos(), t.sid),
  17247. this.tileDownloader.setUrls(t.urls),
  17248. t.panos.forEach(function(e) {
  17249. e.attachToPanoRenderer(this.panoRenderer),
  17250. e.tileDownloader = this.tileDownloader,
  17251. e.qualityManager = this.qualityManager
  17252. }
  17253. .bind(this)),
  17254. this.emit(a.ActiveModelChanged, {
  17255. oldModel: i,
  17256. model: t
  17257. })
  17258. }
  17259. ,
  17260. n.prototype.getActiveModel = function() {
  17261. return this.activeModel
  17262. }
  17263. ,
  17264. r.extend(n, l),
  17265. t.exports = n
  17266. }
  17267. , {
  17268. "../enum/ModelManagerEvents": 33,
  17269. "../enum/PanoRendererEvents": 35,
  17270. "../exception/BasicException": 55,
  17271. "../util/common": 185,
  17272. events: 202,
  17273. three: 217
  17274. }],
  17275. 141: [function(r, l, e) {
  17276. (function(e) {
  17277. "use strict";
  17278. function o() {
  17279. n.call(this)
  17280. }
  17281. var a = r("../objects/Room")
  17282. , t = (r("../settings"),
  17283. r("../util/logger"))
  17284. , i = (r("../util/transitions"),
  17285. r("../util/easing"),
  17286. r("../util/common"))
  17287. , n = r("../util/IndexedCollection")
  17288. , s = r("./Chunks");
  17289. new t(e),
  17290. i.inherit(o, n),
  17291. o.prototype.getIndex = function(e) {
  17292. return e.roomId
  17293. }
  17294. ,
  17295. o.prototype.calcRoomBoundaries = function() {
  17296. this.forEach(function(e) {
  17297. e.calcBoundaries()
  17298. })
  17299. }
  17300. ,
  17301. o.prototype.createFromChunks = function(e) {
  17302. var n = {
  17303. floorId: -1,
  17304. roomId: -1
  17305. }
  17306. , r = {};
  17307. e.forEach(function(e) {
  17308. s.parseIdsFromChunkName(e.name, n);
  17309. var t = r[n.roomId];
  17310. if (!t) {
  17311. var i = o.generateRoomId(n.floorId, n.roomId);
  17312. t = new a(n.floorId,i),
  17313. this.add(t),
  17314. r[n.roomId] = t
  17315. }
  17316. t.addChunk(e)
  17317. }
  17318. .bind(this)),
  17319. this.calcRoomBoundaries()
  17320. }
  17321. ,
  17322. o.generateRoomId = function(e, t) {
  17323. return e + "_" + t
  17324. }
  17325. ,
  17326. l.exports = o
  17327. }
  17328. ).call(this, "/js/model/RoomCollection.js")
  17329. }
  17330. , {
  17331. "../objects/Room": 150,
  17332. "../settings": 166,
  17333. "../util/IndexedCollection": 175,
  17334. "../util/common": 185,
  17335. "../util/easing": 186,
  17336. "../util/logger": 189,
  17337. "../util/transitions": 195,
  17338. "./Chunks": 135
  17339. }],
  17340. 142: [function(e, t, i) {
  17341. "use strict";
  17342. function n(e, t, i) {
  17343. var n = (e = e.clone().expandByScalar(0.01)).size()
  17344. , r = new o.BoxGeometry(n.x,n.y,n.z);
  17345. r.boundingBox = e,
  17346. o.Mesh.call(this, r, t),
  17347. this.position.copy(e.center()),
  17348. this.frustumCulled = !1,
  17349. i && this.add(new o.WireframeHelper(this))
  17350. }
  17351. var o = e("three");
  17352. (n.prototype = Object.create(o.Mesh.prototype)).constructor = n,
  17353. t.exports = n
  17354. }
  17355. , {
  17356. three: 217
  17357. }],
  17358. 143: [function(l, c, e) {
  17359. (function(e) {
  17360. "use strict";
  17361. function t(e) {
  17362. s.time("Computing a nice bounding cubemap");
  17363. var t = new r({
  17364. side: i.BackSide,
  17365. transparent: !0
  17366. });
  17367. t.uniforms.modelAlpha.value = 0,
  17368. t.uniforms.opacity.value = 1 - o.modelAlpha,
  17369. this.renderOrder = a.boundingSkybox,
  17370. n.call(this, e, t),
  17371. s.timeEnd("Computing a nice bounding cubemap")
  17372. }
  17373. var i = l("three")
  17374. , n = (l("../enum/Viewmode"),
  17375. l("../shaders"),
  17376. l("./BoundingMesh"))
  17377. , r = l("../materials/ModelTextureMaterial")
  17378. , o = l("../settings")
  17379. , a = l("../enum/RenderOrder")
  17380. , s = new (l("../util/logger"))(e);
  17381. (t.prototype = Object.create(n.prototype)).constructor = t,
  17382. c.exports = t
  17383. }
  17384. ).call(this, "/js/objects/BoundingTextureSkybox.js")
  17385. }
  17386. , {
  17387. "../enum/RenderOrder": 42,
  17388. "../enum/Viewmode": 51,
  17389. "../materials/ModelTextureMaterial": 118,
  17390. "../settings": 166,
  17391. "../shaders": 167,
  17392. "../util/logger": 189,
  17393. "./BoundingMesh": 142,
  17394. three: 217
  17395. }],
  17396. 144: [function(e, t, i) {
  17397. "use strict";
  17398. function n(e) {
  17399. this.materialInside = new s({
  17400. side: r.DoubleSide
  17401. });
  17402. var t = r.UniformsUtils.clone(o.modelOutside.uniforms);
  17403. this.materialOutside = new r.RawShaderMaterial({
  17404. fragmentShader: o.modelOutside.fragmentShader,
  17405. vertexShader: o.modelOutside.vertexShader,
  17406. uniforms: t,
  17407. side: r.FrontSide,
  17408. name: "chunkOut"
  17409. }),
  17410. r.Mesh.call(this, e.geometry, this.materialInside),
  17411. this.name = e.name || "",
  17412. this.textureName = e.textureName,
  17413. this.meshUrl = e.meshUrl
  17414. }
  17415. var r = e("three")
  17416. , o = e("../shaders")
  17417. , a = e("../enum/Viewmode")
  17418. , s = e("../materials/ModelTextureMaterial");
  17419. (n.prototype = Object.create(r.Mesh.prototype)).setTextureMap = function(e) {
  17420. this.materialInside.uniforms.map.value = e,
  17421. this.materialOutside.uniforms.map.value = e
  17422. }
  17423. ,
  17424. n.prototype.setMode = function(e) {
  17425. var t = e === a.DOLLHOUSE || e === a.FLOORPLAN ? this.materialOutside : this.materialInside;
  17426. t.side = e === a.PANORAMA ? r.DoubleSide : r.FrontSide,
  17427. t.transparent = this.material.transparent,
  17428. t.uniforms.opacity.value = this.material.uniforms.opacity.value;
  17429. this.material = t
  17430. }
  17431. ,
  17432. t.exports = n
  17433. }
  17434. , {
  17435. "../enum/Viewmode": 51,
  17436. "../materials/ModelTextureMaterial": 118,
  17437. "../shaders": 167,
  17438. three: 217
  17439. }],
  17440. 145: [function(e, t, i) {
  17441. "use strict";
  17442. function n(e) {
  17443. this.chunksize = e || 10,
  17444. this.chunks = {},
  17445. this.boundingBoxes = {},
  17446. this.children = [],
  17447. this.offset = new m.Vector3(0,.5,0),
  17448. this.material = new m.MeshBasicMaterial({
  17449. color: 16777215 * Math.random(),
  17450. side: m.DoubleSide
  17451. })
  17452. }
  17453. var m = e("three");
  17454. e("../enum/Viewmode"),
  17455. n.prototype.add = function(e) {
  17456. var t, i, n, r, o, a, s, l, c, h, u = e.attributes;
  17457. u ? (t = u.position.array,
  17458. i = void 0 !== e.index ? e.index.array : void 0) : (t = e.vertices,
  17459. e.faces);
  17460. var d = new m.Vector3;
  17461. if (i)
  17462. for (n = 0,
  17463. r = i.length; n < r; n += 3) {
  17464. var p = 3 * i[n]
  17465. , f = 3 * i[n + 1]
  17466. , g = 3 * i[n + 2];
  17467. o = (t[p] + t[f] + t[g]) / 3,
  17468. a = (t[1 + p] + t[1 + f] + t[1 + g]) / 3,
  17469. s = (t[2 + p] + t[2 + f] + t[2 + g]) / 3,
  17470. c = (l = Math.floor(o / this.chunksize) + "." + Math.floor(a / this.chunksize) + "." + Math.floor(s / this.chunksize))in this.chunks ? (h = this.chunks[l],
  17471. this.boundingBoxes[l]) : (h = this.chunks[l] = [],
  17472. this.boundingBoxes[l] = new m.Box3),
  17473. 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]),
  17474. c.expandByPoint(d.set(t[p], t[1 + p], t[2 + p])),
  17475. c.expandByPoint(d.set(t[f], t[1 + f], t[2 + f])),
  17476. c.expandByPoint(d.set(t[g], t[1 + g], t[2 + g]))
  17477. }
  17478. else
  17479. for (n = 0,
  17480. r = t.length; n < r; n += 9)
  17481. o = (t[n] + t[n + 3] + t[n + 6]) / 3,
  17482. a = (t[n + 1] + t[n + 4] + t[n + 7]) / 3,
  17483. s = (t[n + 2] + t[n + 5] + t[n + 8]) / 3,
  17484. c = (l = Math.floor(o / this.chunksize) + "." + Math.floor(a / this.chunksize) + "." + Math.floor(s / this.chunksize))in this.chunks ? (h = this.chunks[l],
  17485. this.boundingBoxes[l]) : (h = this.chunks[l] = [],
  17486. this.boundingBoxes[l] = new m.Box3),
  17487. 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]),
  17488. c.expandByPoint(d.set(t[n], t[n + 1], t[n + 2])),
  17489. c.expandByPoint(d.set(t[n + 3], t[n + 4], t[n + 5])),
  17490. c.expandByPoint(d.set(t[n + 6], t[n + 7], t[n + 8]))
  17491. }
  17492. ,
  17493. n.prototype.build = function() {
  17494. var e = new m.Object3D;
  17495. for (var t in e.material = this.material,
  17496. this.chunks) {
  17497. var i = this.chunks[t]
  17498. , n = new m.BufferGeometry;
  17499. n.addAttribute("position", new m.BufferAttribute(new Float32Array(i),3)),
  17500. n.boundingBox = this.boundingBoxes[t];
  17501. var r = new m.Mesh(n,this.material);
  17502. r.material.visible = !1,
  17503. e.add(r),
  17504. this.chunks[t] = []
  17505. }
  17506. return e
  17507. }
  17508. ,
  17509. t.exports = n
  17510. }
  17511. , {
  17512. "../enum/Viewmode": 51,
  17513. three: 217
  17514. }],
  17515. 146: [function(e, t, i) {
  17516. "use strict";
  17517. var n = e("three")
  17518. , r = e("../settings")
  17519. , o = e("../util/common")
  17520. , a = e("../util/lerp")
  17521. , s = e("./ChunkedCollider")
  17522. , l = e("../util/transitions")
  17523. , c = e("../util/easing")
  17524. , h = (e("../objects/Panorama"),
  17525. e("../enum/RenderOrder"));
  17526. e("../localization/localize");
  17527. function u(e, t, i) {
  17528. n.Object3D.call(this),
  17529. this.model = e,
  17530. this.floorIndex = t,
  17531. this.lang = r.languageTag,
  17532. this.name = i || "cn" === r.languageTag ? "Floor " + (t + 1) : "第" + (t + 1) + "层",
  17533. this.panos = [],
  17534. this.chunks = [],
  17535. this.colliderBuilder = new s(3),
  17536. this.collider = null,
  17537. this.center = null,
  17538. this.boundingBox = new n.Box3,
  17539. this.size = null,
  17540. this.hidden = !1,
  17541. this.conservativeBoundingBox = new n.Box3,
  17542. this.debugColor = 16777215 * Math.random(),
  17543. this.transition = null
  17544. }
  17545. (u.prototype = Object.create(n.Object3D.prototype)).enter = function(e) {
  17546. this.model.setFloor(this, e)
  17547. }
  17548. ,
  17549. u.prototype.hide = function(e) {
  17550. if (!this.hidden || this.transition) {
  17551. this.chunks.forEach(function(e) {
  17552. e.material.transparent = !0
  17553. }),
  17554. l.cancel(this.transition);
  17555. var t = e ? 0 : r.hideFloorDuration + r.hideFloorDelay
  17556. , i = e ? 0 : r.hideFloorDelay / t;
  17557. this.transition = l.start(a.allUniforms(this.chunks, "opacity", .08), t, function() {
  17558. this.hidden = !0
  17559. }
  17560. .bind(this), i, c.easeInOutQuad)
  17561. }
  17562. }
  17563. ,
  17564. u.prototype.show = function(e) {
  17565. if (this.hidden || this.transition) {
  17566. this.hidden = !1,
  17567. l.cancel(this.transition);
  17568. var t = e ? r.showFloorDuration : r.showFloorDuration + r.showFloorDelay
  17569. , i = e ? 0 : r.showFloorDelay / t;
  17570. this.transition = l.start(a.allUniforms(this.chunks, "opacity", 1), t, function() {
  17571. this.hidden || this.chunks.forEach(function(e) {
  17572. e.material.transparent = !1
  17573. })
  17574. }
  17575. .bind(this), i, c.easeInOutQuad)
  17576. }
  17577. }
  17578. ,
  17579. u.prototype.toggle = function(e, t) {
  17580. (e = void 0 === e ? this.hidden : e) ? this.show(t) : this.hide(t)
  17581. }
  17582. ,
  17583. u.prototype.containsPoint = function(t) {
  17584. return this.collider.children.some(function(e) {
  17585. return e.geometry.boundingBox || e.geometry.computeBoundingBox(),
  17586. e.geometry.boundingBox.containsPoint(t)
  17587. })
  17588. }
  17589. ,
  17590. u.prototype.distanceToPoint = function(i) {
  17591. var n = null
  17592. , r = 1 / 0;
  17593. return this.collider.children.forEach(function(e) {
  17594. e.geometry.boundingBox || e.geometry.computeBoundingBox();
  17595. var t = e.geometry.boundingBox.distanceToPoint(i);
  17596. (!n || t < r) && (r = t,
  17597. n = e)
  17598. }),
  17599. r
  17600. }
  17601. ,
  17602. u.prototype.addChunk = function(e) {
  17603. e.renderOrder = h.ghostFloor,
  17604. this.add(e),
  17605. this.chunks.push(e),
  17606. this.boundingBox.union(e.geometry.boundingBox),
  17607. this.size = this.boundingBox.size(),
  17608. this.colliderBuilder.add(e.geometry)
  17609. }
  17610. ,
  17611. u.prototype.addPano = function(e) {
  17612. this.panos.push(e),
  17613. this.add(e.skyboxMesh),
  17614. e.marker && this.add(e.marker);
  17615. var t = new n.Vector3(1,1,1)
  17616. , i = (new n.Box3).setFromCenterAndSize(e.position, t);
  17617. this.boundingBox.union(i)
  17618. }
  17619. ,
  17620. u.prototype.build = function() {
  17621. this.collider = this.colliderBuilder.build(!0),
  17622. this.add(this.collider),
  17623. this.center = this.boundingBox.center(),
  17624. this.conservativeBoundingBox.copy(this.boundingBox),
  17625. this.conservativeBoundingBox.min.y = o.lowerMedian(this.collider.children.map(function(e) {
  17626. return e.geometry.boundingBox.min.y
  17627. }), 5),
  17628. this.conservativeBoundingBox.max.y = o.lowerMedian(this.collider.children.map(function(e) {
  17629. return e.geometry.boundingBox.max.y
  17630. }), 5),
  17631. this.colliderBuilder = null
  17632. }
  17633. ,
  17634. u.prototype.toShortString = function() {
  17635. return o.nth(this.floorIndex + 1)
  17636. }
  17637. ,
  17638. u.prototype.toString = function() {
  17639. return this.name
  17640. }
  17641. ,
  17642. t.exports = u
  17643. }
  17644. , {
  17645. "../enum/RenderOrder": 42,
  17646. "../localization/localize": 108,
  17647. "./strings-cn-CN": 109,
  17648. "../objects/Panorama": 148,
  17649. "../settings": 166,
  17650. "../util/common": 185,
  17651. "../util/easing": 186,
  17652. "../util/lerp": 188,
  17653. "../util/transitions": 195,
  17654. "./ChunkedCollider": 145,
  17655. three: 217
  17656. }],
  17657. 147: [function(e, t, i) {
  17658. "use strict";
  17659. function n(e) {
  17660. this.player = e,
  17661. this.obj3d = null,
  17662. this.UP = new u.Vector3(0,1,0)
  17663. }
  17664. var u = e("three")
  17665. , d = e("../settings");
  17666. n.prototype.prefs = {
  17667. linewidth: 3,
  17668. height: .07,
  17669. opacity: .45,
  17670. endScale: .05
  17671. },
  17672. n.prototype.discard = function() {
  17673. if (this.obj3d) {
  17674. var e = this.obj3d.parent;
  17675. e && e.remove(this.obj3d)
  17676. }
  17677. this.obj3d = null
  17678. }
  17679. ,
  17680. n.prototype.draw = function() {
  17681. if (this.discard(),
  17682. d.showNeighbors) {
  17683. var e = this.player.currentPano.floor;
  17684. this.obj3d = new u.Object3D;
  17685. var t = this.player.model.panos.getNeighbours(this.player.currentPano)
  17686. , i = this.player.currentPano.floorPosition.clone().sub(this.player.model.position);
  17687. i.y += this.prefs.height;
  17688. var n = .1525
  17689. , r = new u.Matrix4;
  17690. for (var o in t)
  17691. if (t[o]) {
  17692. var a = this.player.model.panos.get(o)
  17693. , s = (a.position.clone().sub(this.player.model.position),
  17694. a.position.clone().sub(a.floorPosition))
  17695. , l = a.floorPosition.clone().sub(this.player.model.position);
  17696. l.y += this.prefs.height;
  17697. var c = new u.Geometry;
  17698. 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)),
  17699. 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)),
  17700. r.identity().setPosition(s),
  17701. c.applyMatrix(r),
  17702. c.vertices.push(new u.Vector3(0,-this.prefs.endScale,0)),
  17703. 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)),
  17704. r.lookAt(l, i, this.UP).setPosition(l),
  17705. c.applyMatrix(r),
  17706. c.vertices.push(l, i);
  17707. var h = new u.Line(c,new u.LineBasicMaterial({
  17708. color: a.debugColor.getHex(),
  17709. transparent: !0,
  17710. opacity: this.prefs.opacity,
  17711. depthWrite: !1,
  17712. name: "sLine" + o,
  17713. linewidth: this.prefs.linewidth
  17714. }));
  17715. this.obj3d.add(h)
  17716. }
  17717. e.add(this.obj3d)
  17718. }
  17719. }
  17720. ,
  17721. n.prototype.update = function() {
  17722. d.showNeighbors && this.obj3d && this.obj3d.updateMatrixWorld()
  17723. }
  17724. ,
  17725. t.exports = n
  17726. }
  17727. , {
  17728. "../settings": 166,
  17729. three: 217
  17730. }],
  17731. 148: [function(S, M, e) {
  17732. (function(e) {
  17733. "use strict";
  17734. function r(e, t, i, n) {
  17735. this.model = e,
  17736. this.id = t,
  17737. this.alignmentType = i.alignmentType || c.ALIGNED,
  17738. this.neighbourUUIDs = i.neighbours || null,
  17739. this.neighbourPanos = null,
  17740. this.floor = null,
  17741. this.floorIndex = i.floor,
  17742. this.failedLoadingAt = 0,
  17743. this.maxLoadRetries = 4,
  17744. this.origin = i.position.clone(),
  17745. this.position = this.alignmentType === c.UNALIGNED ? new s.Vector3(0,-5,0) : i.position.clone(),
  17746. this.quaternion = i.quaternion.clone(),
  17747. this.skyboxMesh = new s.Mesh(E),
  17748. this.skyboxMesh.position.copy(this.position),
  17749. this.skyboxMesh.quaternion.copy(this.quaternion),
  17750. this.skyboxMesh.name = "skybox",
  17751. this.skyboxMesh.visible = !1,
  17752. this.skyboxMesh.updateMatrix(),
  17753. this.skyboxMesh.updateMatrixWorld(),
  17754. this.marker = null,
  17755. this.showFloorMarker = this.showFloorMarker = !window.MP_PREFETCHED_MODELDATA.hideFloorMarker,
  17756. this.isAligned() && (this.marker = new s.Mesh(_,new s.MeshBasicMaterial({
  17757. map: b,
  17758. side: s.DoubleSide,
  17759. opacity: 0,
  17760. transparent: !0,
  17761. depthWrite: !1
  17762. })),
  17763. this.marker.visible = this.showFloorMarker,
  17764. this.marker.renderOrder = l.panoMarker,
  17765. this.marker.name = "marker",
  17766. (this.marker.pano = this).marker.layers.set(v.PANOMARKERS),
  17767. this.marker.updateMatrixWorld(),
  17768. a.colorMarkerOnLoad && this.on("load", function() {
  17769. this.marker.material.color.set(65280)
  17770. })),
  17771. this.debugColor = (new s.Color).setHSL(.06 + .53 * Math.random(), .8 + .2 * Math.random(), .5 + .2 * Math.random()),
  17772. this.floorPosition = i.puck ? i.puck.clone() : null,
  17773. this.tiled = n,
  17774. this.tiled ? this.solidSkybox = null : (this.solidSkybox = new s.Texture([null, null, null, null, null, null]),
  17775. this.solidSkybox.flipY = !1,
  17776. a.minimalMemoryMode && (this.solidSkybox.minFilter = s.LinearFilter,
  17777. this.solidSkybox.magFilter = s.LinearFilter,
  17778. this.solidSkybox.generateMipmaps = !1)),
  17779. this.zoomed = !1,
  17780. this.panoRenderer = null,
  17781. this.qualityManager = null,
  17782. this.tileDownloader = null,
  17783. this.tiledPanoRenderTarget = null,
  17784. this.minimumTiledPanoLoaded = !1,
  17785. this.highestPartialTileRenderOpCompleted = 0,
  17786. this.highestFullTileRenderOpCompleted = 0,
  17787. this.shouldRedrawOnBaseLoaded = !1,
  17788. this.lockUntilRenderingComplete = !1,
  17789. a.colorMarkerOnLoad && this.on("load", function() {
  17790. this.marker.material.color.set(65280)
  17791. }),
  17792. (e = new s.TextureLoader).setCrossOrigin(!0);
  17793. var r = e.load("images/texture.jpg");
  17794. if (this.vrMarker = new s.Mesh(new s.OctahedronGeometry(.1,0),new s.MeshLambertMaterial({
  17795. color: 16777215,
  17796. transparent: !0,
  17797. opacity: .75,
  17798. map: r
  17799. })),
  17800. this.vrMarker.boluoType = "vr",
  17801. this.vrMarker.position.z = 1,
  17802. this.vrMarker.enabled = !0,
  17803. this.vrMarker.visible = !1,
  17804. window.vrMarkers = window.vrMarkers || [],
  17805. window.vrMarkers.push(this.vrMarker),
  17806. this.marker && this.marker.add(this.vrMarker),
  17807. a.showAxis && (this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(0,1,0),new s.Vector3(0,0,0),1,255)),
  17808. this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(0,0,1),new s.Vector3(0,0,0),1,16711680)),
  17809. this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(1,0,0),new s.Vector3(0,0,0),1,65280))),
  17810. this.adjustAngleEnable) {
  17811. (i = new s.Quaternion).setFromAxisAngle(new s.Vector3(1,0,0), this.adjustAngleX),
  17812. this.skyboxMesh.quaternion.multiply(i);
  17813. var o = new s.Quaternion;
  17814. o.setFromAxisAngle(new s.Vector3(0,1,0), this.adjustAngleY),
  17815. this.skyboxMesh.quaternion.multiply(o),
  17816. (n = new s.Quaternion).setFromAxisAngle(new s.Vector3(0,0,1), this.adjustAngleZ),
  17817. this.skyboxMesh.quaternion.multiply(n),
  17818. this.skyboxMesh.updateMatrix(),
  17819. this.skyboxMesh.updateMatrixWorld(),
  17820. this.model.updateProjectedPanos()
  17821. }
  17822. }
  17823. var i, t, s = S("three"), n = S("../util/logger"), a = S("../settings"), l = (S("../enum/Viewmode"),
  17824. S("../enum/RenderOrder")), c = S("../enum/AlignmentType"), o = (S("../util/common"),
  17825. S("../util/transitions")), h = S("../util/lerp"), u = S("../util/ajax"), d = S("../util/texture"), p = S("../util/panorama"), f = (S("../enum/TileDownloaderEvents"),
  17826. S("../enum/PanoramaEvents")), g = S("../enum/PanoRendererEvents"), m = S("../enum/PanoSizeClass"), v = S("../enum/RenderLayers"), y = (S("../scene/SceneRenderer"),
  17827. S("../enum/GLCubeFaces"),
  17828. 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");
  17829. (r.prototype = Object.create(C.prototype)).enter = (t = null,
  17830. function() {
  17831. this.setZoomed(!1),
  17832. this.emit("enter", {
  17833. oldPano: t,
  17834. newPano: this
  17835. }),
  17836. t = this
  17837. }
  17838. ),
  17839. r.prototype.exit = function() {
  17840. this.tiled ? (this.clearWaitDeferreds(),
  17841. this.minimumTiledPanoLoaded = !1,
  17842. this.tiledPanoRenderTarget = null,
  17843. this.setZoomed(!1),
  17844. this.panoRenderer.deactivateTiledPano(this),
  17845. this.highestPartialTileRenderOpCompleted = 0,
  17846. this.highestFullTileRenderOpCompleted = 0) : (this.solidSkybox.dispose(),
  17847. this.solidSkybox.loaded = !1,
  17848. this.solidSkybox.version = 0),
  17849. this.emit("exit")
  17850. }
  17851. ,
  17852. r.prototype.hoverOn = function(e) {
  17853. this.marker && (o.start(h.property(this.marker.material, "opacity", a[e].markerOpacityOnHover), 250),
  17854. a.navigation.panoScores & a.navigation.mouseDirection && this.addTextSprite("HIT", 12525854))
  17855. }
  17856. ,
  17857. r.prototype.hoverOff = function(e) {
  17858. this.marker && o.start(h.property(this.marker.material, "opacity", a[e].markerOpacity), 250)
  17859. }
  17860. ,
  17861. r.prototype.build1 = function() {
  17862. this.floor = this.floor || this.model.floors.get(this.floorIndex) || this.raycastToFindFloor() || this.model.getFloorAtPoint(this.position),
  17863. this.floor.addPano(this),
  17864. this.floorPosition = this.floorPosition || this.raycastFloorPosition(),
  17865. this.neighbourPanos = this.neighbourPanos || this.findNeighourPanos(),
  17866. a.colorMarkerByFloor && this.marker && this.marker.material.color.set(this.floor.debugColor)
  17867. }
  17868. ,
  17869. r.prototype.build2 = function() {
  17870. this.floorPosition = this.floorPosition || this.interpolateFloorPosition(),
  17871. this.height = this.position.distanceTo(this.floorPosition),
  17872. this.placeMarker()
  17873. }
  17874. ,
  17875. r.prototype.interpolateFloorPosition = function() {
  17876. var e = this.model.panos.filter(r.filters.isNeighbourPanoTo(this)).filter(function(e) {
  17877. return !!e.floorPosition
  17878. }).sort(function(e, t) {
  17879. return e.position.distanceTo(this.position) - t.position.distanceTo(this.position)
  17880. }
  17881. .bind(this))
  17882. , t = this.position.clone();
  17883. return 2 <= e.length ? t.y = (e[0].floorPosition.y + e[1].floorPosition.y) / 2 : t.add(a.noMeshFloorPositionOffset),
  17884. t
  17885. }
  17886. ,
  17887. r.prototype.raycastFloorPosition = function() {
  17888. I.warn("Performance warning: Raycasting to find floor position");
  17889. var e = new s.Raycaster(this.position,new s.Vector3(0,-1,0)).intersectObjects(this.model.colliders);
  17890. return e.length ? e[0].point : null
  17891. }
  17892. ,
  17893. 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)],
  17894. function() {
  17895. I.warn("Performance warning: Raycasting to find floor index");
  17896. for (var e = 0; e < i.length; e++) {
  17897. var t = new s.Raycaster(this.position.clone(),i[e].clone()).intersectObjects(this.model.colliders);
  17898. if (t.length)
  17899. return t[0].object.parent.parent
  17900. }
  17901. return null
  17902. }
  17903. ),
  17904. r.prototype.placeMarker = function() {
  17905. this.marker && (this.marker.position.copy(this.floorPosition),
  17906. this.marker.position.y += .05,
  17907. this.marker.lookAt(new s.Vector3(0,1,0).add(this.marker.position)))
  17908. }
  17909. ,
  17910. r.prototype.translate = function(e) {
  17911. this.position.add(e),
  17912. this.floorPosition.add(e)
  17913. }
  17914. ,
  17915. r.prototype.findClosestMidtpointPanoTo = function(e) {
  17916. return (new s.Vector3).addVectors(this.position, e.position).divideScalar(2),
  17917. this.model.panos.find([r.filters.notIn([this, e])], [r.sortFunctions.distanceToPoint(point)])
  17918. }
  17919. ,
  17920. r.prototype.attachToPanoRenderer = function(e) {
  17921. this.panoRenderer = e,
  17922. this.panoRenderer.on(g.TileRenderSuccess, this.onTileRendered.bind(this)),
  17923. this.panoRenderer.on(g.PanoRenderComplete, this.onPanoRendered.bind(this)),
  17924. this.panoRenderer.on(g.TileRenderFailure, this.onTileRenderFail.bind(this)),
  17925. this.panoRenderer.on(g.UploadAttemptedForAllTiles, this.onUploadAttemptedForAllTiles.bind(this))
  17926. }
  17927. ;
  17928. var w, T, x = {};
  17929. r.prototype.getWaitDeferred = function(e) {
  17930. var t = x[this.id];
  17931. t || (t = {},
  17932. x[this.id] = t);
  17933. var i = t[e];
  17934. return i || (i = {
  17935. deferred: $.Deferred(),
  17936. active: !1
  17937. },
  17938. t[e] = i),
  17939. i
  17940. }
  17941. ,
  17942. r.prototype.resetWaitDeferred = function(e) {
  17943. var t = this.getWaitDeferred(e);
  17944. t.active = !1,
  17945. t.deferred = $.Deferred()
  17946. }
  17947. ,
  17948. r.prototype.clearWaitDeferreds = function() {
  17949. var e = x[this.id];
  17950. for (var t in e || (e = {},
  17951. x[this.id] = e),
  17952. e)
  17953. if (e.hasOwnProperty(t)) {
  17954. var i = e[t];
  17955. i.active = !1,
  17956. i.deferred = $.Deferred()
  17957. }
  17958. }
  17959. ,
  17960. r.prototype.loadTiledPano = (new s.Vector3,
  17961. w = [],
  17962. T = [],
  17963. function(e, t, i, n, r, o) {
  17964. null != n || (n = !0),
  17965. null != r || (r = !0);
  17966. var a = this.getWaitDeferred(e)
  17967. , s = a.deferred
  17968. , l = null
  17969. , c = null;
  17970. if (i && ("number" == typeof i ? l = i : (l = i.hFov,
  17971. c = i.vFov)),
  17972. !this.isLoaded(e)) {
  17973. if (!a.active) {
  17974. if (a.active = !0,
  17975. i) {
  17976. var h = A.matchingTilesInDirection(this, e, t, l, c);
  17977. w[this.id + ":" + e] = {
  17978. tileCount: 0,
  17979. targetTileCount: h
  17980. },
  17981. I.info("Loading partial pano: " + this.id + " with " + h + " tiles")
  17982. }
  17983. T[this.id] || (T[this.id] = !0,
  17984. this.on(f.LoadComplete, function(e, t) {
  17985. var i = this.getWaitDeferred(e).deferred;
  17986. i && "pending" === i.state() && this.highestPartialTileRenderOpCompleted >= e && (i.resolve(e, t),
  17987. this.resetWaitDeferred(e))
  17988. }
  17989. .bind(this)),
  17990. this.on(f.LoadFailed, function(e) {
  17991. var t = this.getWaitDeferred(e).deferred;
  17992. t && "pending" === t.state() && this.highestPartialTileRenderOpCompleted >= e && (t.reject(e),
  17993. this.resetWaitDeferred(e))
  17994. }
  17995. .bind(this)),
  17996. this.on(f.TileLoaded, function(e, t, i) {
  17997. var n = this.getWaitDeferred(e).deferred;
  17998. if (n && "pending" === n.state()) {
  17999. n.notify(e, t, i);
  18000. var r = w[this.id + ":" + e];
  18001. r && (r.tileCount++,
  18002. r.tileCount === r.targetTileCount && (this.onPanoRendered(this.id, e, i, !0),
  18003. n.resolve(e, i),
  18004. this.resetWaitDeferred(e)))
  18005. }
  18006. }
  18007. .bind(this)))
  18008. }
  18009. this.tileDownloader.clearForceQueue(),
  18010. this.tileDownloader.forceQueueTilesForPano(this, e, t, l, c, o),
  18011. this.tiledPanoRenderTarget = this.panoRenderer.activateTiledPano(this, this.qualityManager.getMaxNavPanoSize(), n),
  18012. this.panoRenderer.renderPanoTiles(this.id, t, r)
  18013. }
  18014. return s.promise()
  18015. }
  18016. ),
  18017. r.prototype.onUploadAttemptedForAllTiles = function(e, t, i) {
  18018. e === this.id && t === this.qualityManager.getPanoSize(m.BASE) && this.shouldRedrawOnBaseLoaded && (this.shouldRedrawOnBaseLoaded = !1,
  18019. this.panoRenderer.resetRenderStatus(this.id, !0, !1),
  18020. this.panoRenderer.renderPanoTiles(this.id, null, !0, !0))
  18021. }
  18022. ,
  18023. r.prototype.onTileRendered = function(e, t, i, n) {
  18024. e === this.id && this.emit(f.TileLoaded, t, i, n)
  18025. }
  18026. ,
  18027. r.prototype.onPanoRendered = function(e, t, i, n) {
  18028. e === this.id && (this.minimumTiledPanoLoaded = !0,
  18029. this.updateSkyboxForZoomLevel(),
  18030. t > this.highestPartialTileRenderOpCompleted && (this.highestPartialTileRenderOpCompleted = t),
  18031. !n && t > this.highestFullTileRenderOpCompleted && (this.highestFullTileRenderOpCompleted = t),
  18032. this.emit("load", t),
  18033. this.model.emit("load", this),
  18034. this.emit(f.LoadComplete, t, i))
  18035. }
  18036. ,
  18037. r.prototype.setZoomed = function(e) {
  18038. this.zoomed = e,
  18039. this.updateSkyboxForZoomLevel()
  18040. }
  18041. ,
  18042. r.prototype.ensureSkyboxReadyForRender = function() {
  18043. this.tiled || (this.solidSkybox.loaded || (this.solidSkybox.needsUpdate = !0),
  18044. this.solidSkybox.loaded = !0)
  18045. }
  18046. ,
  18047. r.prototype.updateSkyboxForZoomLevel = function() {
  18048. this.minimumTiledPanoLoaded && this.model.updateProjectedPanos()
  18049. }
  18050. ,
  18051. r.prototype.getSkyboxTexture = function() {
  18052. return this.tiled ? this.minimumTiledPanoLoaded ? this.zoomed ? this.panoRenderer.zoomRenderTarget.texture : this.tiledPanoRenderTarget.texture : null : this.solidSkybox
  18053. }
  18054. ,
  18055. r.prototype.onTileRenderFail = function(e, t, i) {
  18056. e === this.id && this.emit(f.LoadFailed, t)
  18057. }
  18058. ,
  18059. r.prototype.isLoaded = function(e) {
  18060. if (this.tiled) {
  18061. if (e && "string" == typeof e)
  18062. throw new y("Wrong panoSize given to Panorama.isLoaded(); a tiled pano uses PanoSizeClass");
  18063. return !!this.minimumTiledPanoLoaded && (!e || this.highestPartialTileRenderOpCompleted >= e)
  18064. }
  18065. if (e && "number" == typeof e)
  18066. throw new y("Wrong panoSize given to Panorama.isLoaded(); a non-tiled pano uses high/low.");
  18067. return !!this.solidSkybox.high || e in this.solidSkybox
  18068. }
  18069. ,
  18070. r.prototype.loadCube = function(a) {
  18071. if (this.isLoaded(a))
  18072. return I.info("Skipping load of pano, already loaded"),
  18073. $.when();
  18074. this.emit("loading", a),
  18075. this.model.emit("loading", this);
  18076. var n = p.getCubemapUrls(this.model.urls, this.id, a)
  18077. , e = n.filter(function(e) {
  18078. return !e
  18079. });
  18080. "low" === a && 0 < e.length && (I.info("Pano", this.id, "not available in low res, loading high res right away"),
  18081. a = "high",
  18082. n = p.getCubemapUrls(this.model.urls, this.id, a));
  18083. var t = 0
  18084. , i = [0, 1, 2, 3, 4, 5].map(function(e, t, i) {
  18085. return u.getImage(n[t])
  18086. }
  18087. .bind(this));
  18088. return $.when(i[0], i[1], i[2], i[3], i[4], i[5]).then(function(e, t, i, n, r, o) {
  18089. return this.solidSkybox[a] = [e, t, i, n, r, o],
  18090. "high" !== a && this.solidSkybox.high || (this.solidSkybox.image = this.solidSkybox[a],
  18091. this.solidSkybox.low = null),
  18092. this.solidSkybox.needsUpdate = !0,
  18093. this.emit("load", a),
  18094. this.model.emit("load", this),
  18095. this
  18096. }
  18097. .bind(this), function() {
  18098. I.error("Downloading cubemap for pano", this.id, "failed"),
  18099. this.failedLoadingAt = Date.now()
  18100. }
  18101. .bind(this), function() {
  18102. return $.when(++t, 6)
  18103. })
  18104. }
  18105. ,
  18106. r.raycastsSkipped = 0,
  18107. r.raycastsDone = 0,
  18108. r.prototype.findNeighourPanos = function() {
  18109. return this.model.panos.setNeighbour(this.id, this.id, !1),
  18110. this.model.panos.forEach(function(e) {
  18111. if (e !== this && (!this.model.panos.neighbourMap[this.id] || void 0 === this.model.panos.neighbourMap[this.id][e.id])) {
  18112. var t = this.position.distanceTo(e.position);
  18113. if (t > a.panoramaNeighbourMaxDistance)
  18114. return this.model.panos.setNeighbour(this, e, !1),
  18115. void r.raycastsSkipped++;
  18116. var i = e.position.clone().sub(this.position).normalize()
  18117. , n = new s.Raycaster(this.position,i.clone(),0,t).intersectObjects(this.model.colliders);
  18118. r.raycastsDone++,
  18119. this.model.panos.setNeighbour(this, e, 0 === n.length),
  18120. 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)))
  18121. }
  18122. }
  18123. .bind(this)),
  18124. this.model.panos.neighbourMap[this.id]
  18125. }
  18126. ,
  18127. r.prototype.worldPosition = function() {
  18128. return this.position
  18129. }
  18130. ,
  18131. r.prototype.addTextSprite = function(e, t) {
  18132. this.removeTextSprite();
  18133. var i = document.createElement("canvas")
  18134. , n = i.getContext("2d");
  18135. i.width = 256,
  18136. i.height = 256;
  18137. n.font = "bold 60px Arial",
  18138. n.fillStyle = "white";
  18139. var r = n.measureText(e).width;
  18140. n.fillText(e, (i.width - r) / 2, (i.height + 60) / 2);
  18141. var o = new s.Texture(i);
  18142. o.needsUpdate = !0;
  18143. var a = new s.SpriteMaterial({
  18144. map: o,
  18145. color: t || 16428055
  18146. });
  18147. this.text3d = new s.Sprite(a),
  18148. this.text3d.position.copy(this.skyboxMesh.position),
  18149. this.floor.add(this.text3d)
  18150. }
  18151. ,
  18152. r.prototype.removeTextSprite = function() {
  18153. this.text3d && (this.floor.remove(this.text3d),
  18154. this.text3d = null)
  18155. }
  18156. ,
  18157. r.prototype.isAligned = function() {
  18158. return this.alignmentType === c.ALIGNED
  18159. }
  18160. ,
  18161. r.filters = {
  18162. inDirection: function(t, i, n) {
  18163. return function(e) {
  18164. return e.position.clone().sub(t).normalize().dot(i) > n
  18165. }
  18166. },
  18167. inFloorDirection: function(t, i, n) {
  18168. return function(e) {
  18169. return e.floorPosition.clone().sub(t).normalize().dot(i) > n
  18170. }
  18171. },
  18172. inPanoDirection: function(n, r, o) {
  18173. return o = a.navigation.panoScores ? a.navigation.filterStrictness : o,
  18174. function(e) {
  18175. var t = e.floorPosition.clone().sub(n).normalize()
  18176. , i = e.position.clone().sub(n).normalize();
  18177. return t.dot(r) > o || i.dot(r) > o
  18178. }
  18179. },
  18180. atFloor: function(t) {
  18181. return function(e) {
  18182. return !t || e.floor === t
  18183. }
  18184. },
  18185. not: function(t) {
  18186. return function(e) {
  18187. return e !== t
  18188. }
  18189. },
  18190. notIn: function(t) {
  18191. return function(e) {
  18192. return -1 === t.indexOf(e)
  18193. }
  18194. },
  18195. isLoaded: function() {
  18196. return function(e) {
  18197. return e.isLoaded()
  18198. }
  18199. },
  18200. isNotLoaded: function() {
  18201. return function(e) {
  18202. return !e.isLoaded()
  18203. }
  18204. },
  18205. isCloseEnoughTo: function(t, i) {
  18206. return function(e) {
  18207. return t.distanceTo(e.floorPosition) < i
  18208. }
  18209. },
  18210. hasMinimumHeightDifferenceTo: function(t, i) {
  18211. return function(e) {
  18212. return Math.abs(e.position.y - t.y) > i
  18213. }
  18214. },
  18215. isNotBehindNormal: function(t, i) {
  18216. var n = new s.Vector3;
  18217. return i = i.clone(),
  18218. function(e) {
  18219. return 0 < n.copy(e.position).sub(t).normalize().dot(i)
  18220. }
  18221. },
  18222. isNeighbourPanoTo: function(t) {
  18223. return function(e) {
  18224. return !t || !t.neighbourPanos || !!t.neighbourPanos[e.id]
  18225. }
  18226. },
  18227. isNeighbourOfNeighbourTo: function(n) {
  18228. return function(i) {
  18229. return !!n.neighbourPanos[i.id] || n.neighbourUUIDs.some(function(e) {
  18230. var t = n.model.panos.get(e);
  18231. return !!t && t.neighbourPanos[i.id]
  18232. })
  18233. }
  18234. },
  18235. isNotRecentlyFailed: function(t) {
  18236. return function(e) {
  18237. return Date.now() - e.failedLoadingAt > t
  18238. }
  18239. },
  18240. isOnVisibleFloor: function() {
  18241. return function(e) {
  18242. return !e.floor.hidden
  18243. }
  18244. },
  18245. isPanoAligned: function() {
  18246. return function(e) {
  18247. return e.isAligned()
  18248. }
  18249. }
  18250. },
  18251. r.sortFunctions = {
  18252. distanceToPoint: function(i) {
  18253. return function(e, t) {
  18254. return e.position.distanceTo(i) - t.position.distanceTo(i)
  18255. }
  18256. },
  18257. floorDistanceToPoint: function(i) {
  18258. return function(e, t) {
  18259. return e.floorPosition.distanceTo(i) - t.floorPosition.distanceTo(i)
  18260. }
  18261. },
  18262. choose: function(i) {
  18263. return function(e, t) {
  18264. return i.id === e.id ? -1 : i.id === t.id ? 1 : 0
  18265. }
  18266. }
  18267. },
  18268. r.scoreFunctions = {
  18269. distance: function(t, i) {
  18270. return i = i || a.navigation.distanceFactor,
  18271. function(e) {
  18272. return t ? t.position.distanceTo(e.position) * i : 0
  18273. }
  18274. },
  18275. distanceSquared: function(t, i) {
  18276. return i = i || a.navigation.distanceFactor,
  18277. function(e) {
  18278. return t ? t.position.distanceToSquared(e.position) * i : 0
  18279. }
  18280. },
  18281. direction: function(t, i) {
  18282. return function(e) {
  18283. return e.position.clone().sub(t).normalize().dot(i) * a.navigation.directionFactor
  18284. }
  18285. },
  18286. angle: function(t, i) {
  18287. return function(e) {
  18288. return e.position.clone().sub(t).normalize().angleTo(i) * a.navigation.angleFactor
  18289. }
  18290. },
  18291. inFieldOfView: function(t, i) {
  18292. return function(e) {
  18293. return .75 < e.position.clone().sub(t).normalize().dot(i) ? 10 : -1
  18294. }
  18295. },
  18296. optionality: function(t) {
  18297. return function(e) {
  18298. return e.neighbourUUIDs.filter(function(e) {
  18299. return !(e in t.neighbourUUIDs) && e !== t.id
  18300. }).length * a.navigation.optionalityFactor
  18301. }
  18302. },
  18303. penalizeHeightDifferenceUnder: function(t, i) {
  18304. return function(e) {
  18305. return t.y - e.position.y < i ? -20 : 0
  18306. }
  18307. }
  18308. },
  18309. M.exports = r
  18310. }
  18311. ).call(this, "/js/objects/Panorama.js")
  18312. }
  18313. , {
  18314. "../enum/AlignmentType": 17,
  18315. "../enum/GLCubeFaces": 25,
  18316. "../enum/PanoRendererEvents": 35,
  18317. "../enum/PanoSizeClass": 36,
  18318. "../enum/PanoramaEvents": 37,
  18319. "../enum/RenderLayers": 41,
  18320. "../enum/RenderOrder": 42,
  18321. "../enum/TileDownloaderEvents": 45,
  18322. "../enum/Viewmode": 51,
  18323. "../exception/BasicException": 55,
  18324. "../scene/SceneRenderer": 158,
  18325. "../settings": 166,
  18326. "../tile/TileUtils": 174,
  18327. "../util/ajax": 181,
  18328. "../util/common": 185,
  18329. "../util/lerp": 188,
  18330. "../util/logger": 189,
  18331. "../util/panorama": 191,
  18332. "../util/texture": 194,
  18333. "../util/transitions": 195,
  18334. events: 202,
  18335. three: 217
  18336. }],
  18337. 149: [function(e, t, i) {
  18338. "use strict";
  18339. function n(e) {
  18340. var t = r.UniformsUtils.clone(c.waypoint.uniforms);
  18341. t.map.value = d,
  18342. t.opacity.value = 0,
  18343. t.color.value.set(o.reticuleColor),
  18344. t.showMouseMarker = !window.MP_PREFETCHED_MODELDATA.hideMouseMarker;
  18345. r.Mesh.call(this, new r.PlaneBufferGeometry(.4,.4,1,1), new r.RawShaderMaterial({
  18346. side: r.DoubleSide,
  18347. depthWrite: !1,
  18348. depthTest: !1,
  18349. transparent: !0,
  18350. vertexShader: c.waypoint.vertexShader,
  18351. fragmentShader: c.waypoint.fragmentShader,
  18352. uniforms: t,
  18353. name: "waypoint",
  18354. opacity: 0,
  18355. visible: t.showMouseMarker
  18356. })),
  18357. this.layers.set(h.RETICULE),
  18358. this.renderOrder = u.reticule,
  18359. this.player = e,
  18360. this.direction = new r.Vector3,
  18361. this.hidden = !0,
  18362. this.mouseLastMoveTime = Date.now()
  18363. }
  18364. var r = e("three")
  18365. , o = e("../settings")
  18366. , a = e("../util/transitions")
  18367. , s = e("../util/texture")
  18368. , l = e("../util/lerp")
  18369. , c = e("../shaders")
  18370. , h = e("../enum/RenderLayers")
  18371. , u = e("../enum/RenderOrder")
  18372. , d = s.load("images/reticule-256x256.png");
  18373. (n.prototype = Object.create(r.Mesh.prototype)).move = function(e, t, i) {
  18374. this.hidden = i,
  18375. this.mouseLastMoveTime = Date.now()
  18376. }
  18377. ,
  18378. n.prototype.hide = function() {
  18379. this.hidden || (this.hidden = !0,
  18380. a.start(l.property(this.material.uniforms.opacity, "value", 0), o.reticuleOpacityTransitionTime))
  18381. }
  18382. ,
  18383. n.prototype.show = function() {
  18384. this.hidden = !1,
  18385. this.material.opacity <= 0 && a.start(l.property(this.material.uniforms.opacity, "value", o[this.player.mode].reticuleOpacity), o.reticuleOpacityTransitionTime)
  18386. }
  18387. ,
  18388. n.prototype.update = function() {
  18389. Date.now() - this.mouseLastMoveTime > o.hideReticuleTimeout && !this.hidden && this.hide()
  18390. }
  18391. ,
  18392. n.prototype.updatePosition = function(e, t) {
  18393. if (!this.hidden) {
  18394. if (!t)
  18395. return this.hide();
  18396. var i = t.point
  18397. , n = e.distanceTo(i)
  18398. , r = 1 + .01 * n;
  18399. n < 1 && (r -= 1 - n),
  18400. this.show(),
  18401. this.scale.set(r, r, r),
  18402. this.direction = this.direction.multiplyScalar(.8),
  18403. this.direction.add(t.face.normal.clone().multiplyScalar(.2)),
  18404. this.position.copy(i).add(t.face.normal.clone().multiplyScalar(.01)),
  18405. this.lookAt(this.position.clone().add(this.direction))
  18406. }
  18407. }
  18408. ,
  18409. n.prototype.writeAstag = function() {
  18410. var e = Math.floor(4294967296 * (1 + Math.random())).toString(16) + Math.floor(16 * (1 + Math.random())).toString(16)
  18411. , t = new Date;
  18412. this.tagCount = void 0 === this.tagCount ? 1 : this.tagCount + 1;
  18413. var i = {
  18414. enabled: !0,
  18415. version: "0",
  18416. created: t.toISOString(),
  18417. created_by: "APITest",
  18418. position: this.position.clone(),
  18419. stem: {
  18420. enabled: o.tags.pole.enabled,
  18421. direction: this.direction.multiplyScalar(o.tags.pole.height)
  18422. },
  18423. label: "tag " + this.tagCount,
  18424. description: "Description " + e,
  18425. floor: function(e) {
  18426. if (e.currentFloor) {
  18427. var t = e.floors.indexOf(e.currentFloor);
  18428. return -1 < t ? t : void 0
  18429. }
  18430. }(this.player.model),
  18431. type: "info",
  18432. metadata: {
  18433. preferred_camera: {
  18434. mode: this.player.mode
  18435. }
  18436. }
  18437. };
  18438. console.log("--------------------------"),
  18439. console.log(JSON.stringify(i));
  18440. var n = this.player.model.addtag(e, i).build();
  18441. n && (n.disc && this.player.tagDiscs.push(n.disc),
  18442. n.visible || n.show(o.tags.startup.fadeInDuration))
  18443. }
  18444. ,
  18445. t.exports = n
  18446. }
  18447. , {
  18448. "../enum/RenderLayers": 41,
  18449. "../enum/RenderOrder": 42,
  18450. "../settings": 166,
  18451. "../shaders": 167,
  18452. "../util/lerp": 188,
  18453. "../util/texture": 194,
  18454. "../util/transitions": 195,
  18455. three: 217
  18456. }],
  18457. 150: [function(e, t, i) {
  18458. "use strict";
  18459. function n(e, t) {
  18460. this.chunks = [],
  18461. this.floorId = e,
  18462. this.roomId = t,
  18463. this.position = new l.Vector3
  18464. }
  18465. var l = e("three");
  18466. n.prototype.addChunk = function(e) {
  18467. this.chunks.push(e)
  18468. }
  18469. ,
  18470. n.prototype.calcBoundaries = function() {
  18471. 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++) {
  18472. var a = this.chunks[o].geometry.attributes.position;
  18473. if (a)
  18474. for (var s = 0; s < a.array.length; s += 3)
  18475. e.set(a.array[s], a.array[s + 1], a.array[s + 2]),
  18476. t.add(e),
  18477. 0 === s ? (i.copy(e),
  18478. n.copy(e)) : (i.max(e),
  18479. n.min(e)),
  18480. r++
  18481. }
  18482. 0 < r ? (t.multiplyScalar(1 / r),
  18483. this.average = t) : this.average = null,
  18484. this.boundsMax = i,
  18485. this.boundsMin = n,
  18486. this.center = new l.Vector3,
  18487. this.center.copy(i).sub(n).multiplyScalar(.5).add(n)
  18488. }
  18489. ,
  18490. t.exports = n
  18491. }
  18492. , {
  18493. three: 217
  18494. }],
  18495. 151: [function(o, v, e) {
  18496. (function(e) {
  18497. "use strict";
  18498. function t(e, t, i) {
  18499. this.obj3d = null,
  18500. this.nodes = [],
  18501. this.colorHull = [],
  18502. this.shortPaths = {},
  18503. this.floorHull = null,
  18504. this.cameraHull = null,
  18505. this.floorPathDistance = 0,
  18506. this.floorCurvePoints = null,
  18507. this.floorCurveColors = null,
  18508. this.camCurvePoints = null,
  18509. this.warpDestHeroLoc = null,
  18510. this.warpDestPano = null,
  18511. this.warpPathPoints = null,
  18512. this.warpPathLengths = [0],
  18513. this.warpLength = 0,
  18514. this.closeWarpDistance = 4,
  18515. this.UP = U.UP.clone(),
  18516. this.longestStep = 0,
  18517. this.upcomingTransType = null,
  18518. this.burnsDir = 1,
  18519. this.prevNextDist = 0,
  18520. this.nextI = 0,
  18521. this.activeTransType = null,
  18522. this.lastTransType = null,
  18523. this.bunnyObj = null,
  18524. this.director = e,
  18525. this.player = t,
  18526. this.playerControls = i,
  18527. this.modelManager = t.modelManager,
  18528. this.updateModel(),
  18529. this.updateDefaultsFromModelData(),
  18530. this.bindEvents(),
  18531. this.warping = !1,
  18532. this.waitingToWarp = !1,
  18533. this.warpInterrupted = !1,
  18534. this.warpInterruptionBlackoutStyle = null,
  18535. this.warpInterruptionTravelTime = null
  18536. }
  18537. 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"),
  18538. o("../util/texture")), U = o("../enum/Vectors"), H = (o("../model/ModelManager"),
  18539. new i(e)), g = o("../enum/PlayerEvents"), z = o("../enum/BlackoutStyle"), r = o("../enum/ModelManagerEvents"), m = o("../constants"), I = {
  18540. 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"),
  18541. pathEnd: n.load("images/End.png"),
  18542. 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==")
  18543. };
  18544. t.prototype.setScene = function(e) {
  18545. this.createCpm(e),
  18546. this.createBunnyObj(e)
  18547. }
  18548. ,
  18549. t.prototype.updateModel = function() {
  18550. this.model = this.modelManager.getActiveModel()
  18551. }
  18552. ,
  18553. t.prototype.bindEvents = function() {
  18554. this.modelManager.on(r.ActiveModelChanged, this.updateModel.bind(this))
  18555. }
  18556. ,
  18557. t.prototype.updateDefaultsFromModelData = function() {
  18558. this.model.data
  18559. }
  18560. ,
  18561. t.prototype.pointPathDistance = function(e) {
  18562. for (var t = 0, i = 1; i < e.length; i += 1)
  18563. t += e[i - 1].distanceTo(e[i]);
  18564. return t
  18565. }
  18566. ,
  18567. t.prototype.pointPathLengths = function(e) {
  18568. for (var t = [0], i = 1; i < e.length; i += 1)
  18569. t.push(t[i - 1] + e[i - 1].distanceTo(e[i]));
  18570. return t
  18571. }
  18572. ,
  18573. t.prototype.interpAlongPath = function(e, t, i) {
  18574. var n, r = new P.Vector3, o = t[t.length - 1];
  18575. if (i < 1) {
  18576. n = i * o;
  18577. for (var a = 1; a < t.length; a += 1)
  18578. if (t[a] > n) {
  18579. var s = (n - t[a - 1]) / (t[a] - t[a - 1]);
  18580. return r.copy(e[a]),
  18581. r.sub(e[a - 1]),
  18582. r.multiplyScalar(s),
  18583. r.add(e[a - 1]),
  18584. r
  18585. }
  18586. } else
  18587. r.copy(e[e.length - 1]);
  18588. return r
  18589. }
  18590. ,
  18591. t.prototype.pathHeight = function() {
  18592. return this.player.mode !== O.FLOORPLAN ? D.path.height : D.path.outsideHeight
  18593. }
  18594. ,
  18595. t.prototype.createBunnyObj = function(e) {
  18596. this.bunnyObj || (this.bunnyObj = new P.AxisHelper(.1),
  18597. this.bunnyObj.visible = D.warp.showBunny),
  18598. this.bunnyObj.parent && this.bunnyObj.parent.remove(bunnyObj),
  18599. e.add(this.bunnyObj)
  18600. }
  18601. ,
  18602. t.prototype.createCpm = function(e) {
  18603. if (!this.currentPanoMarker) {
  18604. var t = this.makeWaypointObj(I.pathEnd, "Current");
  18605. t.material.uniforms.opacity.value = 0,
  18606. this.currentPanoMarker = {
  18607. mesh: t,
  18608. placed: !1
  18609. }
  18610. }
  18611. this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  18612. this.placeCpm(),
  18613. this.currentPanoMarker.mesh.parent || e.add(this.currentPanoMarker.mesh)
  18614. }
  18615. ,
  18616. t.prototype.placeCpm = function() {
  18617. if (D.path.mapGuides && this.player.currentPano && this.player.currentPano.isAligned()) {
  18618. var e = this.player.currentPano.floor;
  18619. this.currentPanoMarker.mesh.parent !== this.player.currentPano.floor && (this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  18620. e.add(this.currentPanoMarker.mesh)),
  18621. this.currentPanoMarker.mesh.position.copy(this.player.currentPano.floorPosition).sub(e.position),
  18622. this.currentPanoMarker.mesh.position.y += this.pathHeight(),
  18623. this.currentPanoMarker.placed = !0
  18624. } else
  18625. this.popOutCpm()
  18626. }
  18627. ,
  18628. t.prototype.fadeInCpm = function(e) {
  18629. 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)
  18630. }
  18631. ,
  18632. t.prototype.fadeOutCpm = function(e) {
  18633. V.start(F.property(this.currentPanoMarker.mesh.material.uniforms.opacity, "value", 0), e)
  18634. }
  18635. ,
  18636. t.prototype.popInCpm = function() {
  18637. D.path.mapGuides && this.currentPanoMarker.placed && this.fadeInCpm(2)
  18638. }
  18639. ,
  18640. t.prototype.popOutCpm = function() {
  18641. this.fadeOutCpm(2)
  18642. }
  18643. ,
  18644. t.prototype.brushPrefs = {
  18645. linewidth: 7,
  18646. strokeWidth: 15,
  18647. cvSegments: 48,
  18648. paveStep: .1,
  18649. paveWidth: .2,
  18650. lookBlendDist: 3,
  18651. maxTurn: P.Math.degToRad(2)
  18652. },
  18653. t.prototype.panoPathDistance = function(e) {
  18654. var t = this.model.panos;
  18655. if (!e || e.length < 2)
  18656. return 0;
  18657. for (var i = [], n = 0; n < e.length; n += 1)
  18658. i.push(t.get(e[n]).floorPosition);
  18659. return this.pointPathDistance(i)
  18660. }
  18661. ,
  18662. t.prototype.loadTileTexture = function(t) {
  18663. var e = n.load(t, function(e) {
  18664. e.wrapS = P.RepeatWrapping,
  18665. e.wrapT = P.RepeatWrapping,
  18666. e.needsUpdate = !0,
  18667. H.debug('path texture "' + t + '" is ready')
  18668. }, function() {
  18669. H.error('path texture "' + t + '" failed')
  18670. });
  18671. return e.mapping = P.UVMapping,
  18672. e
  18673. }
  18674. ,
  18675. t.prototype.buildWarpDestinationDescriptor = function(e, t, i, n, r, o) {
  18676. return new l({
  18677. cameraMode: n,
  18678. position: e,
  18679. quaternion: t,
  18680. panoId: i,
  18681. orthoZoom: o,
  18682. floorVisibility: r,
  18683. thumbUrl: null,
  18684. name: null
  18685. })
  18686. }
  18687. ,
  18688. t.prototype.buildWarpDestinationDescriptorFromHero = function(e) {
  18689. return this.buildWarpDestinationDescriptor(e.position, e.quaternion, this.getHeroId(e), e.cameraMode, e.floorVisibility, e.orthoZoom)
  18690. }
  18691. ,
  18692. t.prototype.setWarpDestination = function(e) {
  18693. this.warpDestHeroLoc = e
  18694. }
  18695. ,
  18696. t.prototype.setWarpDestinationByHeroIndex = function(e) {
  18697. var t = this.getHeroDescriptorByHeroIndex(e);
  18698. return null !== t && (this.setWarpDestination(t),
  18699. !0)
  18700. }
  18701. ,
  18702. t.prototype.setWarpDestinationByPano = function(e, t) {
  18703. return !!this.model.panos.get(e.id) && this.setWarpDestinationByPanoId(e.id, t)
  18704. }
  18705. ,
  18706. t.prototype.setWarpDestinationByPanoId = function(e, t) {
  18707. var i = this.model.panos.get(e);
  18708. if (i) {
  18709. t = t || new P.Quaternion;
  18710. var n = this.buildWarpDestinationDescriptor(i.position, t, i.id, "panorama", [], -1);
  18711. return this.setWarpDestination(n),
  18712. !0
  18713. }
  18714. return !1
  18715. }
  18716. ,
  18717. t.prototype.getHeroDescriptorByHeroIndex = function(e) {
  18718. var t = this.model.heroCount();
  18719. if (null !== this.warpDestHeroLoc && t < 2)
  18720. return H.info("ShowPath.getHeroDescriptorByHeroIndex() -> Only one hero location is available."),
  18721. this.model.getHeroDescriptorByIndex(0);
  18722. var i = this.model.getHeroDescriptorByIndex(e);
  18723. if (i) {
  18724. var n = i.isPano() ? i.panoId : i.cameraMode;
  18725. H.debug('ShowPath.getHeroDescriptorByHeroIndex() -> New brush/warp destination: "' + n + '" out of ' + t + " choices.")
  18726. }
  18727. return i
  18728. }
  18729. ,
  18730. t.prototype.getHeroDescriptorByPano = function(e) {
  18731. return this.model.panos.get(e.id) ? this.getHeroDescriptorByPanoId(e.id) : null
  18732. }
  18733. ,
  18734. t.prototype.getHeroDescriptorByPanoId = function(e) {
  18735. var t = this.getHeroIndexFromPanoId(e);
  18736. return this.getHeroDescriptorByHeroIndex(t)
  18737. }
  18738. ,
  18739. t.prototype.getHeroIndexFromPanoId = function(e) {
  18740. for (var t = 0; t < this.model.heroLocations.length; t++) {
  18741. var i = this.model.heroLocations[t]
  18742. , n = this.getHeroId(i);
  18743. if (n && n === e)
  18744. return t
  18745. }
  18746. return -1
  18747. }
  18748. ,
  18749. t.prototype.getHeroPano = function(e) {
  18750. if (null === e)
  18751. return H.warn("getHeroPano(): no destination"),
  18752. null;
  18753. var t = this.getHeroId(e)
  18754. , i = this.model.panos.get(t);
  18755. return void 0 === i && (i = null,
  18756. "" !== t && H.debug('unable to find pano "' + t + '"')),
  18757. i
  18758. }
  18759. ,
  18760. t.prototype.getHeroId = function(e) {
  18761. return e.panoId
  18762. }
  18763. ,
  18764. t.prototype.setWarpDestPano = function() {
  18765. return this.warpDestPano = this.getHeroPano(this.warpDestHeroLoc),
  18766. this.warpDestPano
  18767. }
  18768. ,
  18769. t.prototype.brushToWarpPano = function(e, t) {
  18770. if (this.discardPathObject(),
  18771. !this.setWarpDestPano())
  18772. return !1;
  18773. if (this.warpDestHeroLoc.cameraMode !== O.PANORAMA && H.warn("Can only brush from pano to pano"),
  18774. !this.warpDestPano)
  18775. return H.info("No brush"),
  18776. !1;
  18777. if (!this.player.currentPano)
  18778. return H.debug("No current pano, visibility undefined"),
  18779. !1;
  18780. if (!this.warpDestPano)
  18781. return H.info("No wPano, visibility undefined"),
  18782. !1;
  18783. if (!this.warpDestPano.isAligned())
  18784. return H.debug("Cannot brush to unaligned pano"),
  18785. !1;
  18786. var i = (e === L.STD || e === L.WALK) && D.path.mapGuides
  18787. , n = !0;
  18788. if (this.player.currentPano.id === this.warpDestPano.id)
  18789. H.debug("Already at destination pano");
  18790. else {
  18791. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  18792. n = void 0 === this.nodes || null === this.nodes || this.nodes.length < 1,
  18793. this.obj3d = new P.Object3D,
  18794. H.debug('Brushing from "' + this.player.currentPano.id + '" to "' + this.warpDestPano.id + '" (' + (this.nodes ? this.nodes.length : 0) + ")"),
  18795. n ? (H.info('No "walkable" route, using fall-back warp style transition'),
  18796. e = t) : (this.setPathHulls(this.nodes),
  18797. this.setFloorCurves(),
  18798. 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)))),
  18799. this.player.currentPano.floor.add(this.obj3d);
  18800. var r = this.player.mode === O.DOLLHOUSE || this.player.mode === O.FLOORPLAN
  18801. , o = e === L.STD;
  18802. if (!n && (i || o)) {
  18803. if (r) {
  18804. var a = this.makeStartMarker(this.floorHull[0], this.floorCurvePoints);
  18805. this.obj3d.add(a)
  18806. }
  18807. var s = this.makeEndMarker(this.floorHull[this.floorHull.length - 1]);
  18808. this.obj3d.add(s)
  18809. }
  18810. this.appearSlow()
  18811. }
  18812. return this.upcomingTransType = e,
  18813. !n
  18814. }
  18815. ,
  18816. t.prototype.findShortestPath = function(e, t) {
  18817. if (!e || !t)
  18818. return null;
  18819. var i = D.warp.walkExtraPanosDistance
  18820. , n = e.id + ":" + t.id + ":" + i;
  18821. if (this.shortPaths.hasOwnProperty(n))
  18822. return this.shortPaths[n] ? this.shortPaths[n].slice() : null;
  18823. var r = t.id + ":" + e.id + ":" + i;
  18824. if (this.shortPaths.hasOwnProperty(r))
  18825. return this.shortPaths[r] ? this.shortPaths[r].slice().reverse() : null;
  18826. var o = this.model.panos.aStarSearch(e, t);
  18827. return this.model.panos.includeNodesNearPath(o, i),
  18828. this.shortPaths[n] = o ? o.slice() : null,
  18829. o
  18830. }
  18831. ,
  18832. t.prototype.makePathHulls = function(e) {
  18833. var t, i, n, r, o, a = 0, s = [], l = [], c = [], h = this.model.panos;
  18834. r = (t = h.get(e[0])).floor.floorIndex;
  18835. for (var u = 0; u < e.length; u += 1)
  18836. (i = (t = h.get(e[u])).floorPosition.clone().sub(this.model.position)).y += this.pathHeight(),
  18837. s.push(i),
  18838. l.push(t.position.clone()),
  18839. n = t.floor.floorIndex,
  18840. c.push(r < n ? D.path.colorUp : n < r ? D.path.colorDown : D.path.color),
  18841. 0 < u && (a < (o = l[u].distanceTo(l[u - 1])) && (a = o));
  18842. return a > this.longestStep && (this.longestStep = a,
  18843. H.debug("path contains " + a + " meter segment")),
  18844. {
  18845. floor: s,
  18846. camera: l,
  18847. color: c
  18848. }
  18849. }
  18850. ,
  18851. t.prototype.makeFloorCurves = function(e, t, i) {
  18852. var n = this.player.mode === O.PANORAMA ? D.path.waypointIndoorRadius : D.path.waypointRadius
  18853. , r = this.pointPathDistance(e) - 2 * n
  18854. , o = e.slice(0)
  18855. , a = o[1].clone().sub(o[0]);
  18856. a.y = 0,
  18857. a.normalize().multiplyScalar(n),
  18858. o[0] = (new P.Vector3).copy(o[0]).add(a),
  18859. (a = o[o.length - 2].clone().sub(o[o.length - 1])).y = 0,
  18860. a.normalize().multiplyScalar(n),
  18861. o[o.length - 1] = (new P.Vector3).copy(o[o.length - 1]).add(a);
  18862. var s = new P.CatmullRomCurve3(o)
  18863. , l = Math.floor(r / i);
  18864. l = 4 * Math.floor(l / 4),
  18865. l = Math.max(4, l);
  18866. for (var c, h, u = s.getSpacedPoints(l), d = [], p = new P.Vector3, f = 0; f < u.length; f += 1) {
  18867. h = 0,
  18868. c = u[f].distanceTo(e[0]);
  18869. for (var g = 1; g < e.length; g += 1)
  18870. p.copy(u[f]).sub(e[g]),
  18871. p.y *= 4,
  18872. p.length() < c && (h = g);
  18873. d.push(t[h])
  18874. }
  18875. return {
  18876. distance: r,
  18877. points: u,
  18878. colors: d
  18879. }
  18880. }
  18881. ,
  18882. t.prototype.makeCameraCurvePoints = function(e, t) {
  18883. var i = this.pointPathDistance(e);
  18884. return new P.CatmullRomCurve3(e).getSpacedPoints(Math.max(2, Math.floor(i / t)))
  18885. }
  18886. ,
  18887. t.prototype.makeCameraCurveTangents = function(e, t) {
  18888. var i = this.pointPathDistance(e)
  18889. , n = new P.CatmullRomCurve3(e)
  18890. , r = Math.max(2, Math.floor(i / t));
  18891. r = r || 5;
  18892. for (var o = [], a = 0; a <= r; a++)
  18893. o.push(n.getTangentAt(a / r));
  18894. return o
  18895. }
  18896. ,
  18897. t.prototype.setPathHulls = function(e) {
  18898. var t = this.makePathHulls(e);
  18899. this.floorHull = t.floor,
  18900. this.cameraHull = t.camera,
  18901. this.colorHull = t.color
  18902. }
  18903. ,
  18904. t.prototype.setFloorCurves = function() {
  18905. var e = this.makeFloorCurves(this.floorHull, this.colorHull, this.brushPrefs.paveStep);
  18906. this.floorPathDistance = e.distance,
  18907. this.floorCurvePoints = e.points,
  18908. this.floorCurveColors = e.colors
  18909. }
  18910. ,
  18911. t.prototype.setCameraCurvePoints = function() {
  18912. this.camCurvePoints = this.makeCameraCurvePoints(this.cameraHull, D.warp.stepFactor * this.brushPrefs.paveStep)
  18913. }
  18914. ,
  18915. t.prototype.chooseWarpPath = function(e) {
  18916. var t, i, n, r = this.playerControls.cameras[O.PANORAMA];
  18917. if (this.player.currentPano === this.warpDestPano || !e)
  18918. return this.warpPathPoints = null,
  18919. this.warpLength = 0,
  18920. !1;
  18921. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  18922. void 0 === this.nodes || null === this.nodes || this.nodes.length < 1 ? (H.debug("warp path to unreachable node"),
  18923. i = (t = this.warpDestPano.position.clone().sub(r.position)).clone().negate(),
  18924. t.multiplyScalar(.15).add(r.position),
  18925. i.multiplyScalar(.15).add(this.warpDestPano.position),
  18926. t.y = r.position.y,
  18927. i.y = this.warpDestPano.position.y,
  18928. n = new P.CubicBezierCurve3(r.position.clone(),t,i,this.warpDestPano.position.clone()),
  18929. this.warpPathPoints = n.getSpacedPoints(this.brushPrefs.cvSegments)) : (H.debug("follow warp path (path distance was " + this.nodes.length + " nodes, " + this.floorPathDistance + ")"),
  18930. this.setCameraCurvePoints(),
  18931. this.warpPathPoints = this.camCurvePoints.slice(0)),
  18932. this.warpLength = 0,
  18933. this.warpPathLengths = [0];
  18934. 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) {
  18935. o.copy(this.warpPathPoints[c - 1]).sub(this.warpPathPoints[c]);
  18936. var h = o.length();
  18937. o.y *= D.warp.climbEffort;
  18938. var u = o.length() / h;
  18939. if (1 < c) {
  18940. o.setY(0).normalize(),
  18941. a.copy(this.warpPathPoints[c - 2]).sub(this.warpPathPoints[c - 1]).setY(0).normalize();
  18942. var d = Math.min(1, o.dot(a))
  18943. , p = 1 + (D.warp.brakeStrength - 1) * (1 - P.Math.smoothstep(d, l, s));
  18944. u = Math.max(p, u)
  18945. }
  18946. this.warpLength += h * u,
  18947. this.warpPathLengths[c] = this.warpLength
  18948. }
  18949. return !0
  18950. }
  18951. ,
  18952. t.prototype.drawPathRibbon = function(e, t) {
  18953. this.bunnyObj.visible = D.warp.showBunny;
  18954. 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) {
  18955. a.copy(e[s]),
  18956. 0 === s ? a.sub(e[s + 1]) : a.sub(e[s - 1]).negate(),
  18957. a.normalize(),
  18958. n.crossVectors(a, U.UP),
  18959. n.multiplyScalar(i);
  18960. var l = (new P.Vector3).copy(e[s]).add(r);
  18961. l.sub(n),
  18962. o.vertices.push(l),
  18963. (l = (new P.Vector3).copy(e[s]).add(r)).add(n),
  18964. o.vertices.push(l)
  18965. }
  18966. var c, h, u, d = 0;
  18967. for (s = 0; s < e.length - 1; s += 1) {
  18968. var p = 2 * s
  18969. , f = d
  18970. , g = d += e[s + 1].distanceTo(e[s])
  18971. , m = t[s]
  18972. , v = t[s + 1];
  18973. (c = new P.Face3(p,1 + p,2 + p)).vertexColors = [new P.Color(m), new P.Color(m), new P.Color(v)],
  18974. o.faces.push(c),
  18975. o.faceVertexUvs[0].push([new P.Vector2(0,f), new P.Vector2(1,f), new P.Vector2(0,g)]),
  18976. (c = new P.Face3(2 + p,1 + p,3 + p)).vertexColors = [new P.Color(v), new P.Color(m), new P.Color(v)],
  18977. o.faces.push(c),
  18978. o.faceVertexUvs[0].push([new P.Vector2(0,g), new P.Vector2(1,f), new P.Vector2(1,g)])
  18979. }
  18980. o.computeFaceNormals(),
  18981. o.computeVertexNormals(),
  18982. h = this.player.mode === O.PANORAMA ? ((u = P.UniformsUtils.clone(C.ribbon.uniforms)).map.value = I.path,
  18983. u.opacity.value = 0,
  18984. u.color.value.set(D.path.color),
  18985. new P.RawShaderMaterial({
  18986. side: P.DoubleSide,
  18987. depthWrite: !1,
  18988. transparent: !0,
  18989. vertexShader: C.ribbon.vertexShader,
  18990. fragmentShader: C.ribbon.fragmentShader,
  18991. uniforms: u,
  18992. name: "ribbonT",
  18993. opacity: 0
  18994. })) : new P.MeshBasicMaterial({
  18995. color: 16777215,
  18996. side: P.DoubleSide,
  18997. name: "ribbonOut",
  18998. vertexColors: P.VertexColors
  18999. });
  19000. var y = new P.Mesh(o,h);
  19001. return y.name = "ribbon",
  19002. this.player.mode === O.PANORAMA && (y.renderOrder = A.ribbon),
  19003. y
  19004. }
  19005. ,
  19006. t.prototype.drawPathPavement = function(e) {
  19007. for (var t, i = new P.Vector3, n = new P.Geometry, r = new P.Vector3, o = 0; o < e.length; o += 1)
  19008. r.copy(e[o]),
  19009. 0 === o ? r.sub(e[o + 1]).negate() : r.sub(e[o - 1]),
  19010. r.normalize(),
  19011. i.crossVectors(r, U.UP),
  19012. i.multiplyScalar(this.brushPrefs.paveWidth),
  19013. (t = (new P.Vector3).copy(e[o])).sub(i),
  19014. n.vertices.push(t),
  19015. n.vertices.push((new P.Vector3).copy(e[o])),
  19016. (t = (new P.Vector3).copy(e[o])).add(i),
  19017. n.vertices.push(t);
  19018. var a, s, l;
  19019. for (o = 0; o < e.length - 1; o += 1)
  19020. a = 3 * o + 1,
  19021. l = .25 + (s = .25 * o),
  19022. n.faces.push(new P.Face3(a - 1,a,3 + a)),
  19023. n.faceVertexUvs[0].push([new P.Vector2(0,s), new P.Vector2(.5,s), new P.Vector2(.5,l)]),
  19024. n.faces.push(new P.Face3(3 + a,2 + a,a - 1)),
  19025. n.faceVertexUvs[0].push([new P.Vector2(.5,l), new P.Vector2(0,l), new P.Vector2(0,s)]),
  19026. n.faces.push(new P.Face3(3 + a,a,1 + a)),
  19027. n.faceVertexUvs[0].push([new P.Vector2(.5,l), new P.Vector2(.5,s), new P.Vector2(1,s)]),
  19028. n.faces.push(new P.Face3(3 + a,1 + a,4 + a)),
  19029. n.faceVertexUvs[0].push([new P.Vector2(.5,l), new P.Vector2(1,s), new P.Vector2(1,l)]);
  19030. var c = this.player.mode === O.PANORAMA ? new P.MeshBasicMaterial({
  19031. color: D.path.color,
  19032. side: P.DoubleSide,
  19033. transparent: !0,
  19034. depthWrite: !1,
  19035. opacity: 0,
  19036. name: "paveT",
  19037. map: I.path
  19038. }) : new P.MeshBasicMaterial({
  19039. color: D.path.color,
  19040. side: P.DoubleSide,
  19041. transparent: !0,
  19042. depthWrite: !1,
  19043. opacity: 1,
  19044. name: "paveO",
  19045. map: I.path
  19046. });
  19047. return new P.Mesh(n,c)
  19048. }
  19049. ,
  19050. t.prototype.hintPrefs = {
  19051. rad: .18,
  19052. width: .0125,
  19053. depth: .0625,
  19054. setBack: -.04,
  19055. markRad: .25,
  19056. markInnerRad: .16
  19057. },
  19058. t.prototype.makeWaypointObj = function(e, t) {
  19059. var i = new P.Geometry
  19060. , n = this.player.mode === O.PANORAMA ? D.path.waypointIndoorRadius : D.path.waypointRadius
  19061. , r = this.pathHeight();
  19062. 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)),
  19063. i.faces.push(new P.Face3(0,1,2), new P.Face3(2,3,0)),
  19064. i.faceVertexUvs[0].push([new P.Vector2(0,0), new P.Vector2(1,0), new P.Vector2(1,1)]),
  19065. i.faceVertexUvs[0].push([new P.Vector2(1,1), new P.Vector2(0,1), new P.Vector2(0,0)]);
  19066. var o = P.UniformsUtils.clone(C.waypoint.uniforms);
  19067. o.map.value = e,
  19068. o.opacity.value = 0,
  19069. o.color.value.set(D.path.color);
  19070. var a = {
  19071. side: P.DoubleSide,
  19072. depthWrite: !1,
  19073. transparent: !0,
  19074. vertexShader: C.waypoint.vertexShader,
  19075. fragmentShader: C.waypoint.fragmentShader,
  19076. uniforms: o,
  19077. name: "waypoint",
  19078. opacity: 0
  19079. };
  19080. this.player.mode !== O.PANORAMA && (a.depthTest = !1,
  19081. a.name = "wayPtOut");
  19082. var s = new P.RawShaderMaterial(a)
  19083. , l = new P.Mesh(i,s);
  19084. return l.name = t,
  19085. l
  19086. }
  19087. ,
  19088. t.prototype.makeStartMarker = function(e, t) {
  19089. var i = (new P.Vector3).copy(t[1]).sub(t[0]);
  19090. i.y = 0,
  19091. i.normalize();
  19092. var n = Math.acos(i.x)
  19093. , r = this.makeWaypointObj(I.pathStart, "Start");
  19094. return r.rotateOnAxis(new P.Vector3(0,1,0), n),
  19095. r.position.copy(e),
  19096. r
  19097. }
  19098. ,
  19099. t.prototype.makeEndMarker = function(e) {
  19100. var t = this.makeWaypointObj(I.pathEnd, "End")
  19101. , i = this.model.panos.get(this.nodes[0]).floor.floorIndex
  19102. , n = this.model.panos.get(this.nodes[this.nodes.length - 1]).floor.floorIndex;
  19103. return i < n ? t.material.uniforms.color.value.set(D.path.colorUp) : n < i && t.material.uniforms.color.value.set(D.path.colorDown),
  19104. t.position.copy(e),
  19105. t
  19106. }
  19107. ,
  19108. t.prototype.pathClean = function(e) {
  19109. if (e) {
  19110. for (var t in e.children)
  19111. this.pathClean(e.children[t]);
  19112. e.geometry && e.geometry.dispose(),
  19113. e.material && e.material.dispose()
  19114. }
  19115. }
  19116. ,
  19117. t.prototype.discardPathObject = function() {
  19118. if (this.obj3d) {
  19119. var e = this.obj3d.parent;
  19120. e && e.remove(this.obj3d),
  19121. this.pathClean(this.obj3d)
  19122. }
  19123. this.obj3d = null,
  19124. this.popInCpm()
  19125. }
  19126. ,
  19127. t.prototype.discardSlow = function() {
  19128. if (this.obj3d) {
  19129. if (this.player.mode !== O.PANORAMA)
  19130. return void this.discardPathObject();
  19131. for (var e, t = 0, i = function() {
  19132. this.discardPathObject()
  19133. }
  19134. .bind(this), n = 0; n < this.obj3d.children.length; n += 1)
  19135. 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]),
  19136. t += 1,
  19137. i = null);
  19138. 0 === t && this.discardPathObject(),
  19139. this.player.mode !== O.PANORAMA && this.fadeInCpm(D.path.fadeInTime - 3)
  19140. }
  19141. }
  19142. ,
  19143. t.prototype.appearSlow = function() {
  19144. var e;
  19145. this.fadeOutCpm(D.path.fadeInTime);
  19146. for (var t = this.player.mode === O.PANORAMA ? D.path.opacity : 1, i = 0; i < this.obj3d.children.length; i += 1)
  19147. 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]))
  19148. }
  19149. ,
  19150. t.prototype.update = function() {
  19151. this.obj3d && this.obj3d.updateMatrixWorld()
  19152. }
  19153. ,
  19154. t.prototype.calcBurnsAmount = function(e) {
  19155. var n = P.Math.degToRad(D.warp.burnsAngle);
  19156. if (this.player.mode !== O.PANORAMA)
  19157. return this.player.mode === O.DOLLHOUSE ? .02 * this.burnsDir : this.burnsDir;
  19158. var t = this.burnsDir * n;
  19159. if (this.upcomingTransType === L.BLACK)
  19160. return t;
  19161. var i = e;
  19162. if (null === i)
  19163. return H.warn("Transition request for non-highlight"),
  19164. t;
  19165. var r = this.getHeroDescriptorByHeroIndex(i);
  19166. if (null === r)
  19167. return t;
  19168. if (!r.isPano())
  19169. return t;
  19170. function o(e) {
  19171. var t = Math.acos(Math.min(1, e.dot(l)))
  19172. , i = (new P.Vector3).crossVectors(l, e);
  19173. return Math.max(c, Math.min(Math.abs(t), n)) * Math.sign(i.y)
  19174. }
  19175. var a = this.getHeroPano(r)
  19176. , s = this.playerControls.cameras[O.PANORAMA]
  19177. , l = U.FORWARD.clone().applyQuaternion(s.quaternion).setY(0).normalize()
  19178. , c = Math.min(P.Math.degToRad(D.warp.minBurnsAngle), n);
  19179. if (a === this.player.currentPano)
  19180. return o(U.FORWARD.clone().applyQuaternion(r.quaternion).setY(0).normalize());
  19181. var h = this.findShortestPath(this.player.currentPano, a);
  19182. if (null == h || h.length < 1)
  19183. return H.debug("Empty path ahead..."),
  19184. t;
  19185. var u = this.makePathHulls(h)
  19186. , d = new P.CatmullRomCurve3(u.camera)
  19187. , p = Math.min(.1, D.warp.lookAheadDist / d.getLength());
  19188. return o(d.getPointAt(p).clone().sub(s.position).setY(0).normalize())
  19189. }
  19190. ,
  19191. t.prototype.waitNextStep = function(e, t, i) {
  19192. var o = null == i ? D.warp.tourStepDelay : i;
  19193. o = o || (this.lastTransType === L.BLACK ? m.tourStepDelaySlideShow : m.tourStepDelayDefault);
  19194. var a = new P.Euler
  19195. , s = new P.Vector3;
  19196. H.debug("Starting wait: " + (void 0 !== t));
  19197. var l = this.calcBurnsAmount(e)
  19198. , c = function() {
  19199. this.endWarpState(),
  19200. this.player.mode === O.DOLLHOUSE && (this.playerControls.cameras[O.DOLLHOUSE].controls.rotationAcceleration.x = 0),
  19201. t && t()
  19202. }
  19203. .bind(this)
  19204. , n = function(e, t) {
  19205. if (this.warpInterrupted)
  19206. return c(),
  19207. !0;
  19208. var i = t || 1e3 / 60;
  19209. if (D.warp.doBurns)
  19210. if (this.player.mode === O.PANORAMA) {
  19211. var n = this.playerControls.cameras[O.PANORAMA];
  19212. a.setFromQuaternion(n.quaternion, D.warp.eOrder);
  19213. var r = i * l / o;
  19214. a.y += r,
  19215. s.set(0, 0, -1),
  19216. s.applyEuler(a),
  19217. s.add(n.position),
  19218. n.controls.lookAt(s),
  19219. n.controls.lookVector.copy(s),
  19220. n.lookAt(s)
  19221. } else
  19222. this.player.mode === O.DOLLHOUSE ? this.playerControls.controls[O.DOLLHOUSE].rotationAcceleration.x = l : this.playerControls.controls[O.FLOORPLAN].absoluteScale *= .9996
  19223. }
  19224. .bind(this);
  19225. this.startWarpState(),
  19226. V.start(n, o, c, 0, B.easeInOutQuad, "wait");
  19227. /* var r = player.model.heroLocations[app.director.currentItem];
  19228. this.player.zoomEnabled = !0;
  19229. var h = function(e, t) {
  19230. //console.log(e),
  19231. this.player.zoomTo(e * r.zoom.toFixed(2), !0)
  19232. }
  19233. .bind(this);
  19234. V.start(h, 2e3, null, 0, B.easeOutQuad, "zoom") */
  19235. }
  19236. ,
  19237. t.prototype.warpToNonPano = function(e) {
  19238. if (this.discardPathObject(),
  19239. this.warpDestHeroLoc.cameraMode === O.DOLLHOUSE || this.warpDestHeroLoc.cameraMode === O.FLOORPLAN) {
  19240. var t = function() {
  19241. e && e()
  19242. }
  19243. .bind(this);
  19244. this.player.flyToNewMode({
  19245. mode: this.warpDestHeroLoc.cameraMode,
  19246. duration: D.warp.outsideTime,
  19247. warpDest: this.warpDestHeroLoc,
  19248. callback: t,
  19249. force: !0
  19250. })
  19251. } else
  19252. H.warn("no warp destination!!!"),
  19253. e && e()
  19254. }
  19255. ,
  19256. t.prototype._resetWarpShaderParams = function(e) {
  19257. this.player.mode === O.PANORAMA && (void 0 !== e.material.uniforms.blackout && (e.material.uniforms.blackout.value = 0),
  19258. void 0 !== e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = 0))
  19259. }
  19260. ,
  19261. t.prototype._clearWarpShading = function() {
  19262. for (var e = this.model.chunks, t = 0; t < e.length; t += 1)
  19263. this._resetWarpShaderParams(e[t]),
  19264. e[t].visible = !0;
  19265. this._resetWarpShaderParams(this.model.skybox)
  19266. }
  19267. ,
  19268. t.prototype._warpStopFlying = function() {
  19269. this.activeTransType = null,
  19270. this.placeCpm()
  19271. }
  19272. ,
  19273. t.prototype._wrapupTravelOnlyBits = function() {
  19274. this._warpStopFlying(),
  19275. this.warpPathPoints && (this.player.currentPano.exit(),
  19276. this.warpDestPano.enter(),
  19277. this.player.currentPano = this.warpDestPano),
  19278. this.player.spider.draw(),
  19279. this.placeCpm()
  19280. }
  19281. ,
  19282. t.prototype._wrapupTravel = function(e) {
  19283. this._wrapupTravelOnlyBits(),
  19284. this.warpCameraAim(e)
  19285. }
  19286. ,
  19287. t.prototype._wrapupWarpShading = function(e) {
  19288. this._clearWarpShading(),
  19289. this._wrapupTravel(e)
  19290. }
  19291. ,
  19292. t.prototype.wrapupWarpShadingOnly = function(e, t) {
  19293. t !== z.END && this._clearWarpShading(),
  19294. this._wrapupTravelOnlyBits(),
  19295. this.upcomingTransType = null,
  19296. e && e()
  19297. }
  19298. ,
  19299. t.prototype._warpCameraAim = function(e, t) {
  19300. var i = this.warpDestHeroLoc.quaternion
  19301. , n = this.playerControls.cameras[O.PANORAMA]
  19302. , r = new P.Vector3(0,0,1).applyQuaternion(i).normalize()
  19303. , o = new P.Vector3(0,0,1).applyQuaternion(n.quaternion).normalize().dot(r)
  19304. , a = P.Math.radToDeg(Math.acos(o))
  19305. , s = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(i, D.warp.eOrder)
  19306. , l = (new P.Euler).setFromQuaternion(n.quaternion, D.warp.eOrder)
  19307. , c = new P.Euler(s.x - l.x,s.y - l.y,s.z - l.z,D.warp.eOrder);
  19308. c.y = N.constrainedTurn(c.y),
  19309. this.burnsDir = Math.sign(c.y);
  19310. var h = new P.Euler(0,0,0,D.warp.eOrder)
  19311. , u = new P.Vector3
  19312. , d = function(e, t) {
  19313. return !!this.warpInterrupted || (h.x = l.x + e * c.x,
  19314. h.y = l.y + e * c.y,
  19315. h.z = l.z + e * c.z,
  19316. u.set(0, 0, -1),
  19317. u.applyEuler(h),
  19318. u.add(n.position),
  19319. n.controls.lookAt(u),
  19320. n.controls.lookVector.copy(u),
  19321. void n.lookAt(u))
  19322. }
  19323. .bind(this);
  19324. 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"),
  19325. void (t && t()))
  19326. }
  19327. ,
  19328. t.prototype._warpBendAim = function(e, t, i, n) {
  19329. var r = n || 0
  19330. , o = this.playerControls.cameras[O.PANORAMA]
  19331. , a = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19332. , s = (new P.Euler).setFromQuaternion(o.quaternion, D.warp.eOrder)
  19333. , l = new P.Euler(a.x - s.x,a.y - s.y,a.z - s.z,D.warp.eOrder);
  19334. l.y = N.constrainedTurn(l.y);
  19335. var c = Math.min(P.Math.degToRad(D.warp.softBendTilt), Math.abs(l.x));
  19336. l.x = c * Math.sign(l.x),
  19337. c = Math.min(P.Math.degToRad(Math.max(0, D.warp.softBendAngle)), c),
  19338. this.burnsDir = Math.sign(l.y),
  19339. c *= Math.sign(l.y),
  19340. l.y = c;
  19341. var h = new P.Euler(0,0,0,D.warp.eOrder)
  19342. , u = new P.Vector3
  19343. , d = function(e, t) {
  19344. if (e < .5)
  19345. h.x = s.x + e * l.x,
  19346. h.y = s.y + e * l.y,
  19347. h.z = s.z + e * l.z;
  19348. else {
  19349. var i = (1 - e) * D.warp.softBendEnd;
  19350. h.x = a.x - i * l.x,
  19351. h.y = a.y - i * l.y,
  19352. h.z = a.z - i * l.z
  19353. }
  19354. u.set(0, 0, -1),
  19355. u.applyEuler(h),
  19356. u.add(o.position),
  19357. o.controls.lookAt(u),
  19358. o.controls.lookVector.copy(u),
  19359. o.lookAt(u)
  19360. }
  19361. .bind(this);
  19362. return V.start(d, t, i, r, B[D.warp.movementEasing])
  19363. }
  19364. ,
  19365. t.prototype._warpStepCameraAim = function(e, t, i) {
  19366. var n = this.playerControls.cameras[O.PANORAMA]
  19367. , r = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19368. , o = (new P.Euler).setFromQuaternion(n.quaternion, D.warp.eOrder)
  19369. , a = new P.Euler(r.x - o.x,r.y - o.y,r.z - o.z,D.warp.eOrder);
  19370. a.y = N.constrainedTurn(a.y),
  19371. this.burnsDir = Math.sign(a.y);
  19372. var s = new P.Euler(0,0,0,D.warp.eOrder)
  19373. , l = new P.Vector3
  19374. , c = function(e, t) {
  19375. e < .5 ? s.copy(o) : s.copy(r),
  19376. l.set(0, 0, -1),
  19377. l.applyEuler(s),
  19378. l.add(n.position),
  19379. n.controls.lookAt(l),
  19380. n.controls.lookVector.copy(l),
  19381. n.lookAt(l)
  19382. }
  19383. .bind(this);
  19384. return V.start(c, t, i, 0, B[D.warp.movementEasing])
  19385. }
  19386. ,
  19387. t.prototype.setBurnsDir = function() {
  19388. var e = this.playerControls.cameras[O.PANORAMA]
  19389. , t = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19390. , i = (new P.Euler).setFromQuaternion(e.quaternion, D.warp.eOrder)
  19391. , n = new P.Euler(t.x - i.x,t.y - i.y,t.z - i.z,D.warp.eOrder);
  19392. n.y = N.constrainedTurn(n.y),
  19393. this.burnsDir = Math.sign(n.y)
  19394. }
  19395. ,
  19396. t.prototype.stepWarpPath = function(e, t) {
  19397. var i = this.playerControls.cameras[O.PANORAMA];
  19398. if (!this.warpPathPoints)
  19399. return i.position.copy(this.warpDestPano.position),
  19400. !0;
  19401. var n = this.warpPathPoints[0]
  19402. , r = this.warpDestPano.position;
  19403. if (null !== this.nodes && 1 < this.cameraHull.length) {
  19404. var o = new P.Vector3;
  19405. 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),
  19406. i.position.copy(o)
  19407. } else
  19408. e < .5 ? i.position.copy(n) : i.position.copy(r)
  19409. }
  19410. ,
  19411. t.prototype.interruptAndFastForward = function(e, t) {
  19412. this.warping && (this.warpInterrupted = !0,
  19413. this.warpInterruptionBlackoutStyle = e,
  19414. this.warpInterruptionTravelTime = t,
  19415. null !== this.warpInterruptionBlackoutStyle && void 0 !== this.warpInterruptionBlackoutStyle || (this.warpInterruptionBlackoutStyle = z.MIDDLE),
  19416. null !== this.warpInterruptionTravelTime && void 0 !== this.warpInterruptionTravelTime || (this.warpInterruptionTravelTime = D.minWarpTime))
  19417. }
  19418. ,
  19419. t.prototype.warpCameraAim = function(e) {
  19420. var t = D.warp.minWarpTime;
  19421. if (this.upcomingTransType === L.BLACK)
  19422. t = D.warp.teleportTime;
  19423. else {
  19424. var i = this.playerControls.cameras[O.PANORAMA]
  19425. , n = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19426. , r = (new P.Euler).setFromQuaternion(i.quaternion, D.warp.eOrder)
  19427. , o = new P.Euler(n.x - r.x,n.y - r.y,n.z - r.z,D.warp.eOrder);
  19428. o.y = N.constrainedTurn(o.y);
  19429. var a = 1e3 * Math.abs(o.y) / P.Math.degToRad(D.warp.maxAimPerSec);
  19430. t = Math.max(t, a)
  19431. }
  19432. var s = function() {
  19433. this._warpStopFlying(),
  19434. this.discardSlow(),
  19435. e && e()
  19436. }
  19437. .bind(this);
  19438. this._warpCameraAim(t, s)
  19439. }
  19440. ,
  19441. t.prototype.warpCommonParameters = function(e, t, i, n) {
  19442. this.model.skybox.material.uniforms.blackout.value = n;
  19443. var r = F.uniform(this.model.skybox, "progress", 1)
  19444. , o = F.allUniforms(this.model.chunks, "progress", 1)
  19445. , a = !1
  19446. , s = function() {
  19447. if (this.warpInterrupted)
  19448. return a = !0
  19449. }
  19450. .bind(this)
  19451. , l = function(e, t) {
  19452. return i && a ? !(this.model.skybox.material.uniforms.progress.value = 0) : void r(e, t)
  19453. }
  19454. .bind(this)
  19455. , c = function(e, t) {
  19456. return i && a ? (o(0),
  19457. !0) : void o(e, t)
  19458. }
  19459. .bind(this);
  19460. V.start(s, e, null, t, null, "safeHaltWatch"),
  19461. V.start(l, e, null, t, B[D.warp.blendEasing], "skyboxProgress"),
  19462. V.start(c, e, null, t, B[D.warp.blendEasing], "chunkProgress")
  19463. }
  19464. ,
  19465. t.prototype.warpTravel_STD = function(e) {
  19466. 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),
  19467. 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;
  19468. t += this.warpLength * D.warp.timePerMeter,
  19469. .01 < D.warp.flySpeed && (t = 1e3 * this.warpLength / D.warp.flySpeed);
  19470. function n(e) {
  19471. var t = i;
  19472. return P.Math.smoothstep(e, 0, t) * (1 - P.Math.smoothstep(e, 1 - t, 1))
  19473. }
  19474. var y = !1
  19475. , r = this.warpDestHeroLoc.quaternion
  19476. , o = new P.Vector3(0,0,-1).applyQuaternion(r).normalize()
  19477. , A = this.warpPathPoints[this.warpPathPoints.length - 1].clone().sub(this.warpPathPoints[this.warpPathPoints.length - 2]).normalize()
  19478. , a = A.dot(o)
  19479. , C = P.Math.radToDeg(Math.acos(a))
  19480. , s = function() {
  19481. return m.lookAt(g, l, U.UP),
  19482. u.setFromRotationMatrix(m, D.warp.eOrder),
  19483. p.setFromQuaternion(h.quaternion, D.warp.eOrder),
  19484. v.set(u.x - p.x, u.y - p.y, u.z - p.z, D.warp.eOrder),
  19485. N.constrainedTurn(v.y)
  19486. }
  19487. .bind(this)
  19488. , I = function(e, t) {
  19489. if (this.warpInterrupted)
  19490. return y = !0
  19491. }
  19492. .bind(this)
  19493. , E = function(e, t) {
  19494. return y || !this.warpPathPoints ? (k.blur(0),
  19495. !0) : void k.blur(e)
  19496. }
  19497. .bind(this)
  19498. , _ = F.allUniforms(this.model.chunks, "modelAlpha", 1)
  19499. , b = function(e, t) {
  19500. return y || !this.warpPathPoints ? (_(0),
  19501. !0) : void _(e, t)
  19502. }
  19503. .bind(this)
  19504. , w = function(e, t) {
  19505. if (!this.warpPathPoints)
  19506. return h.position.copy(this.warpDestPano.position),
  19507. !0;
  19508. if (y)
  19509. return !0;
  19510. var i = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, e);
  19511. h.position.copy(i),
  19512. g = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, .99 * e)
  19513. }
  19514. .bind(this)
  19515. , T = function(e, t) {
  19516. return this.warpPathPoints ? !!y || void (l = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, Math.min(e + c, 1))) : (H.debug("Lost bunny."),
  19517. !0)
  19518. }
  19519. .bind(this)
  19520. , x = function(e, t) {
  19521. if (y)
  19522. return H.debug(">>>> Walkthrough interupted at t=" + e),
  19523. !0;
  19524. if (!this.warpPathPoints)
  19525. return !0;
  19526. var i = this.warpLength * e
  19527. , n = P.Math.smoothstep(i, 0, this.brushPrefs.lookBlendDist)
  19528. , r = P.Math.smoothstep(i, this.warpLength - this.brushPrefs.lookBlendDist, this.warpLength);
  19529. D.warp.matchCam && (n *= 1 - r),
  19530. m.lookAt(g, l, U.UP),
  19531. u.setFromRotationMatrix(m, D.warp.eOrder),
  19532. p.setFromQuaternion(h.quaternion, D.warp.eOrder),
  19533. v.set(u.x - p.x, u.y - p.y, u.z - p.z, D.warp.eOrder),
  19534. v.y = N.constrainedTurn(v.y),
  19535. u.x = p.x + n * v.x,
  19536. u.y = p.y + n * v.y,
  19537. u.z = p.z + n * v.z,
  19538. v.set(u.x - f.x, u.y - f.y, u.z - f.z, D.warp.eOrder),
  19539. v.y = N.constrainedTurn(v.y);
  19540. var o = P.Math.degToRad(D.warp.maxTurnPerSec) * t / 1e3;
  19541. v.y = Math.sign(v.y) * Math.min(o, Math.abs(v.y)),
  19542. f.x = f.x + v.x * D.warp.turnFriction,
  19543. f.y = f.y + v.y * D.warp.turnFriction,
  19544. f.z = f.z + v.z * D.warp.turnFriction,
  19545. f.x = Math.max(P.Math.degToRad(D.warp.minDownAngle), f.x);
  19546. var a = l.clone().sub(g).normalize();
  19547. if (C < D.warp.maxAimRotation && 0 < r) {
  19548. var s = 1 - r;
  19549. a.x = a.x * s + r * A.x,
  19550. a.y = a.y * s + r * A.y,
  19551. a.z = a.z * s + r * A.z,
  19552. a.normalize()
  19553. }
  19554. this.bunnyObj.position.copy(h.position).add(a),
  19555. d.set(0, 0, -1).applyEuler(f).normalize(),
  19556. d.multiplyScalar(8),
  19557. d.add(h.position),
  19558. 1 - c < e && D.warp.matchCam || (h.controls.lookAt(d),
  19559. h.controls.lookVector.copy(d),
  19560. h.lookAt(d))
  19561. }
  19562. .bind(this)
  19563. , S = function() {
  19564. y ? (this.discardSlow(),
  19565. this.upcomingTransType = L.BLACK,
  19566. this.warpTravel_BLACK(-.5, this.warpInterruptionTravelTime, z.BEGINNING, e)) : this._wrapupWarpShading(e)
  19567. }
  19568. .bind(this);
  19569. T(0);
  19570. var M = D.warp.motionLeadTime + 1e3 * Math.abs(s()) / P.Math.degToRad(D.warp.maxTurnPerSec)
  19571. , R = M / (t += M);
  19572. this.warpCommonParameters(t, R, !0, z.NONE),
  19573. V.start(I, t, null, 0, null, "_haltWatcher"),
  19574. 0 < D.warp.blur && (k.blurStrength = D.warp.blur,
  19575. V.start(E, t, null, R, n, "blurring")),
  19576. V.start(b, t, null, R, n, "modelAlpha"),
  19577. V.start(w, t, null, R, B[D.warp.blendEasing], "followPath"),
  19578. V.start(T, t, null, R, B[D.warp.blendEasing], "goBunny"),
  19579. V.start(x, t, S, 0, B[D.warp.blendEasing], "lookAtBunny")
  19580. }
  19581. ,
  19582. t.prototype.warpTravel_BLACK = function(e, t, i, n) {
  19583. var r = e || 0;
  19584. null != t || (t = D.warp.teleportTime),
  19585. this.warpCommonParameters(t, r, !1, i),
  19586. this.model.chunks.forEach(function(e) {
  19587. e.material.uniforms.blackout.value = i
  19588. }),
  19589. this._warpBendAim(null, t, null, r);
  19590. var o = function() {
  19591. this.wrapupWarpShadingOnly(n, i)
  19592. }
  19593. .bind(this);
  19594. V.start(this.stepWarpPath.bind(this), t, o, r, B[D.warp.blendEasing], "stepMotion")
  19595. }
  19596. ,
  19597. t.prototype.flightStepWalk = (a = new P.Vector3,
  19598. s = new P.Vector3,
  19599. function(e, t, i) {
  19600. if (this.warpInterrupted)
  19601. i && i();
  19602. else if (this.activeTransType !== L.WALK)
  19603. this._clearWarpShading(),
  19604. this._warpStopFlying(),
  19605. this.player.spider.draw(),
  19606. this.placeCpm(),
  19607. i && i();
  19608. else if (this.player.currentPano !== e) {
  19609. var n = {
  19610. pano: e,
  19611. lookAtPoint: t,
  19612. duration: null,
  19613. maxDistanceOverride: D.warp.walkMaxDist,
  19614. skipWarpingCheck: !1,
  19615. constantMoveSpeed: !0
  19616. };
  19617. n.duration = function(e, t) {
  19618. var i = Math.min(this.player.position.distanceTo(e.position), D.transition.flytimeMaxDistanceThreshold) * D.transition.flytimeDistanceMultiplier + D.transition.flyTime;
  19619. s.copy(U.FORWARD),
  19620. this.player.getDirection(s),
  19621. a.copy(t).sub(e.position).normalize();
  19622. var n = a.dot(s)
  19623. , r = Math.acos(n)
  19624. , o = r / i;
  19625. return .001 < o && (i *= o / .001,
  19626. r < 1 && (i *= 1.2)),
  19627. i
  19628. }
  19629. .call(this, e, t),
  19630. this.player.nonInterruptingFlyToPano(n, i)
  19631. } else
  19632. i && i()
  19633. }
  19634. ),
  19635. t.prototype.makeWalkFlightFunc = function(e, t, i) {
  19636. return this.flightStepWalk.bind(this, e, t, i)
  19637. }
  19638. ,
  19639. t.prototype.warpTravel_WALK = (f = [],
  19640. function(e) {
  19641. for (var t = this.player.model.panos, i = null, n = !1, r = f.length = 0; r < this.nodes.length; r++) {
  19642. var o = this.nodes[r]
  19643. , a = t.get(o);
  19644. this.nodes.length,
  19645. n = i && a.position.distanceTo(i.position) < D.warp.walkMinDist,
  19646. i && n || (f.push(o),
  19647. i = a)
  19648. }
  19649. n && 1 < this.nodes.length && (f[f.length - 1] = this.nodes[this.nodes.length - 1]);
  19650. var s = f.length
  19651. , l = t.get(f[s - 1])
  19652. , c = new Array(s + 1);
  19653. c[c.length - 1] = function() {
  19654. e && e()
  19655. }
  19656. .bind(this);
  19657. for (var h = s - 1, u = c.length - 1; 0 < u; u -= 1) {
  19658. var d = f[h];
  19659. l = t.get(d);
  19660. var p = new P.Vector3;
  19661. this.getLookAtForWalkingTourNode(f, h, p),
  19662. c[u - 1] = this.makeWalkFlightFunc(l, p, c[u]),
  19663. h--
  19664. }
  19665. c[0]()
  19666. }
  19667. ),
  19668. t.prototype.getLookAtForWalkingTourNode = (c = new P.Vector3,
  19669. h = new P.Vector3,
  19670. u = new P.Vector3,
  19671. d = new P.Vector3,
  19672. p = new P.Vector3,
  19673. function(e, t, i) {
  19674. var n = e.length;
  19675. if (n <= t)
  19676. return !1;
  19677. var r = 1
  19678. , o = 1;
  19679. h.set(0, 0, 0),
  19680. p.set(0, 0, 0);
  19681. for (var a = null, s = t; s < t + 3 && !(n <= s); s++) {
  19682. if (a = this.player.model.panos.get(e[s]),
  19683. this.getOrientationForWalkingTourNode(e, s, u),
  19684. s === t && c.copy(u),
  19685. d.copy(u),
  19686. t < s) {
  19687. var l = d.dot(c) < .65;
  19688. r *= l ? .2 : .75,
  19689. o *= l ? .2 : .4
  19690. }
  19691. u.multiplyScalar(r),
  19692. h.add(u),
  19693. p.lerp(a.position, o)
  19694. }
  19695. return h.normalize(),
  19696. i.copy(p),
  19697. i.add(h),
  19698. !0
  19699. }
  19700. ),
  19701. t.prototype.getOrientationForWalkingTourNode = function(e, t, i) {
  19702. var n = e.length;
  19703. if (n <= t)
  19704. return !1;
  19705. if (t === n - 1)
  19706. i.copy(U.FORWARD).applyQuaternion(this.warpDestHeroLoc.quaternion);
  19707. else {
  19708. var r = this.player.model.panos.get(e[t])
  19709. , o = this.player.model.panos.get(e[t + 1]);
  19710. i.copy(o.position).sub(r.position)
  19711. }
  19712. return i.normalize(),
  19713. !0
  19714. }
  19715. ,
  19716. t.prototype.warpCameraTravel = function(e, t, i, n) {
  19717. if (this.activeTransType = this.upcomingTransType,
  19718. this.lastTransType = this.activeTransType,
  19719. this.upcomingTransType = null,
  19720. e)
  19721. this.activeTransType === L.BLACK ? this.warpTravel_BLACK(null, i, t, n) : this.activeTransType === L.WALK ? this.warpTravel_WALK(function() {
  19722. this._clearWarpShading(),
  19723. this._warpStopFlying(),
  19724. this.player.spider.draw(),
  19725. this.placeCpm(),
  19726. n && n()
  19727. }
  19728. .bind(this)) : this.warpTravel_STD(n);
  19729. else {
  19730. var r = function() {
  19731. this._wrapupTravel(n)
  19732. }
  19733. .bind(this)
  19734. , o = {
  19735. pano: this.warpDestPano,
  19736. lookAtPoint: null,
  19737. duration: null,
  19738. maxDistanceOverride: null,
  19739. skipWarpingCheck: !1
  19740. };
  19741. this.player.flyToPano(o, r)
  19742. }
  19743. }
  19744. ,
  19745. t.prototype.startWarpState = function() {
  19746. this.warping = !0,
  19747. this.warpInterrupted = !1,
  19748. this.warpInterruptionBlackoutStyle = null,
  19749. this.warpInterruptionTravelTime = null
  19750. }
  19751. ,
  19752. t.prototype.endWarpState = function() {
  19753. this.warping = !1
  19754. }
  19755. ,
  19756. t.prototype.warpToPano = function(e, t, i, n) {
  19757. if (this.warping)
  19758. H.warn("Cannot warp when already warping");
  19759. else {
  19760. if (this.upcomingTransType = e,
  19761. this.activeTransType = null,
  19762. !this.setWarpDestPano())
  19763. return this.upcomingTransType = null,
  19764. void this.warpToNonPano(n);
  19765. if (this.player.mode !== O.PANORAMA)
  19766. return this.upcomingTransType = null,
  19767. this.discardSlow(),
  19768. void this.player.flyToNewMode({
  19769. mode: O.PANORAMA,
  19770. pano: this.warpDestPano,
  19771. duration: D.warp.outsideTime,
  19772. warpDest: this.warpDestHeroLoc,
  19773. callback: n,
  19774. force: !0
  19775. });
  19776. if (!this.warpDestPano)
  19777. return H.warn("no warp destination, callback dropped"),
  19778. void (this.upcomingTransType = null);
  19779. 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)
  19780. , o = this.chooseWarpPath(r);
  19781. if (o && this.upcomingTransType !== L.WALK) {
  19782. var a = function() {
  19783. this.waitingToWarp = !1,
  19784. this.warpToPano(e, t, i, n)
  19785. }
  19786. .bind(this);
  19787. if (this.player.checkAndWaitForPanoLoad(this.warpDestPano, "high", "low", this.player.basePanoSize, a))
  19788. return void (this.waitingToWarp = !0)
  19789. }
  19790. this.player.currentPano || (H.warn("Arrived at a very strange spot!"),
  19791. this.player.currentPano = this.warpDestPano,
  19792. this.placeCpm(),
  19793. this.fadeOutCpm(D.path.fadeOutTime),
  19794. this.player.spider.draw()),
  19795. H.debug("Warping to pano ", this.warpDestPano.position),
  19796. this.upcomingTransType !== L.WALK && this.player.emit(g.PanoChosen, this.player.currentPano, this.warpDestPano),
  19797. this.startWarpState();
  19798. var s = function() {
  19799. this.endWarpState(),
  19800. n && n()
  19801. }
  19802. .bind(this);
  19803. o ? this.warpCameraTravel(r, t, i, s) : this.warpCameraAim(s)
  19804. }
  19805. }
  19806. ,
  19807. v.exports = t
  19808. }
  19809. ).call(this, "/js/objects/ShowPath.js")
  19810. }
  19811. , {
  19812. "../constants": 8,
  19813. "../effects": 16,
  19814. "../enum/BlackoutStyle": 18,
  19815. "../enum/ModelManagerEvents": 33,
  19816. "../enum/PlayerEvents": 40,
  19817. "../enum/RenderOrder": 42,
  19818. "../enum/Vectors": 50,
  19819. "../enum/Viewmode": 51,
  19820. "../enum/WarpStyle": 52,
  19821. "../gui/gui": 65,
  19822. "../model/ModelManager": 140,
  19823. "../objects/Snapshot": 153,
  19824. "../settings": 166,
  19825. "../shaders": 167,
  19826. "../util/easing": 186,
  19827. "../util/lerp": 188,
  19828. "../util/logger": 189,
  19829. "../util/math": 190,
  19830. "../util/texture": 194,
  19831. "../util/transitions": 195,
  19832. three: 217
  19833. }],
  19834. 152: [function(e, t, i) {
  19835. "use strict";
  19836. function n() {
  19837. var e = new r.SphereBufferGeometry(a.skyboxRadius,20,5)
  19838. , t = new r.RawShaderMaterial({
  19839. fragmentShader: o.skysphere.fragmentShader,
  19840. vertexShader: o.skysphere.vertexShader,
  19841. uniforms: r.UniformsUtils.clone(o.skysphere.uniforms),
  19842. side: r.BackSide,
  19843. name: "skysphere"
  19844. });
  19845. t.uniforms.radius.value = e.parameters.radius,
  19846. r.Mesh.call(this, e, t)
  19847. }
  19848. var r = e("three")
  19849. , o = e("../shaders")
  19850. , a = e("../settings");
  19851. (n.prototype = Object.create(r.Mesh.prototype)).constructor = n,
  19852. t.exports = n
  19853. }
  19854. , {
  19855. "../settings": 166,
  19856. "../shaders": 167,
  19857. three: 217
  19858. }],
  19859. 153: [function(r, o, e) {
  19860. (function(e) {
  19861. "use strict";
  19862. function t(e) {
  19863. n.call(this, e),
  19864. this.sid = e.sid,
  19865. this.panoId = e.panoId,
  19866. this.orthoZoom = e.orthoZoom,
  19867. this.floorVisibility = e.floorVisibility,
  19868. this.thumbUrl = e.thumbUrl,
  19869. this.name = e.name,
  19870. this.zoom = e.zoom
  19871. }
  19872. var i = (r("three"),
  19873. r("../util/logger"))
  19874. , n = (r("../settings"),
  19875. r("../enum/Viewmode"),
  19876. r("../util/common"),
  19877. r("../util/transitions"),
  19878. r("../util/lerp"),
  19879. r("../util/ajax"),
  19880. r("../util/texture"),
  19881. r("./View"));
  19882. r("events").EventEmitter,
  19883. new i(e),
  19884. (t.prototype = Object.create(n.prototype)).isPano = function() {
  19885. return this.panoId && "" !== this.panoId && this.panoId != "outside"
  19886. }
  19887. ,
  19888. o.exports = t
  19889. }
  19890. ).call(this, "/js/objects/Snapshot.js")
  19891. }
  19892. , {
  19893. "../enum/Viewmode": 51,
  19894. "../settings": 166,
  19895. "../util/ajax": 181,
  19896. "../util/common": 185,
  19897. "../util/lerp": 188,
  19898. "../util/logger": 189,
  19899. "../util/texture": 194,
  19900. "../util/transitions": 195,
  19901. "./View": 154,
  19902. events: 202,
  19903. three: 217
  19904. }],
  19905. 154: [function(o, a, e) {
  19906. (function(e) {
  19907. "use strict";
  19908. function t(e) {
  19909. e = e || {},
  19910. this.position = new i.Vector3,
  19911. this.quaternion = new i.Quaternion,
  19912. this.update(e)
  19913. }
  19914. var i = o("three")
  19915. , n = o("../util/logger")
  19916. , r = (o("../settings"),
  19917. o("../enum/Viewmode"),
  19918. o("../util/common"),
  19919. o("../util/transitions"),
  19920. o("../util/lerp"),
  19921. o("../util/ajax"),
  19922. o("../util/texture"),
  19923. o("events").EventEmitter);
  19924. new n(e),
  19925. (t.prototype = Object.create(r.prototype)).isValid = function() {
  19926. return !!this.cameraMode
  19927. }
  19928. ,
  19929. t.prototype.update = function(e) {
  19930. return this.cameraMode = e.cameraMode || this.cameraMode,
  19931. this.pano = e.pano || this.pano,
  19932. e.position && this.position.copy(e.position),
  19933. e.quaternion && this.quaternion.copy(e.quaternion),
  19934. this
  19935. }
  19936. ,
  19937. a.exports = t
  19938. }
  19939. ).call(this, "/js/objects/View.js")
  19940. }
  19941. , {
  19942. "../enum/Viewmode": 51,
  19943. "../settings": 166,
  19944. "../util/ajax": 181,
  19945. "../util/common": 185,
  19946. "../util/lerp": 188,
  19947. "../util/logger": 189,
  19948. "../util/texture": 194,
  19949. "../util/transitions": 195,
  19950. events: 202,
  19951. three: 217
  19952. }],
  19953. 155: [function(J, ee, e) {
  19954. (function(e) {
  19955. "use strict";
  19956. function t(e) {
  19957. this.currentPano = null,
  19958. this.nextPano = null,
  19959. this.camera = null,
  19960. this.paused = !1,
  19961. this.flying = !1,
  19962. this.sceneIntersectionPlane = null,
  19963. this.target = new B.Vector3,
  19964. this.mouse = new B.Vector3(1.1,1.1,.5),
  19965. this.mouseAtMouseDown = new B.Vector2,
  19966. this.mouseCouldBeClickToMove = !1,
  19967. this.mouseLastMoveTime = Date.now(),
  19968. this.mouseDown = !1,
  19969. this.mouseDownTimer = null,
  19970. this.couldBeLongTap = !1,
  19971. this.containsMouse = !0,
  19972. this.isTouchEvent = !1,
  19973. this.isPanoHover = !1,
  19974. this.reticule = new n(this),
  19975. this.panoMarkers = [],
  19976. this.spider = new s(this),
  19977. this.quaternion = new B.Quaternion,
  19978. this.position = new B.Vector3(15,10,15),
  19979. this.previousState = null,
  19980. this.lastInsideView = new o,
  19981. this.last360View = new o,
  19982. this.raycaster = new B.Raycaster,
  19983. this.intersect = null,
  19984. this.lastChangeTime = Date.now(),
  19985. this.history = new h,
  19986. this.cameraControls = null,
  19987. this.path = null,
  19988. this.model = null,
  19989. this.domElement = null,
  19990. this.cachedPanoCandidates = null,
  19991. this.basePanoSize = 0,
  19992. this.standardPanoSize = 0,
  19993. this.highPanoSize = 0,
  19994. this.ultraHighPanoSize = 0,
  19995. this.zoomLevel = 1,
  19996. this.zooming = 0,
  19997. this.zoomSpeed = .5,
  19998. this.scrollZoomSpeed = .06,
  19999. this.zoomSpeedAdjust = .05,
  20000. this.defaultZoomIncrement = .2,
  20001. this.baseFov = k.insideFOV,
  20002. this.zoomFov = this.baseFov,
  20003. this.zoomEnabled = !0,
  20004. this.preRenderingEnabled = !1,
  20005. this.setupCustomProperties(e),
  20006. this.zoomStats = new v,
  20007. this.modeTran = ''
  20008. this.currentCursor = '';
  20009. }
  20010. var B = J("three")
  20011. , i = J("./util/logger")
  20012. , n = J("./objects/Reticule")
  20013. , a = J("./objects/Panorama")
  20014. , r = J("./objects/ShowPath")
  20015. , o = J("./objects/View")
  20016. , s = (J("./objects/Snapshot"),
  20017. J("./objects/NSpider"))
  20018. , V = J("./enum/Viewmode")
  20019. , T = (J("./enum/TagStates"),
  20020. J("./enum/Vectors"))
  20021. , l = J("./enum/Keys")
  20022. , k = (J("./enum/AlignmentType"),
  20023. J("./settings"))
  20024. , x = J("./util/common")
  20025. , U = (J("./util/browser"),
  20026. J("./util/math"))
  20027. , H = J("./util/lerp")
  20028. , z = J("./util/easing")
  20029. , G = J("./util/transitions")
  20030. , c = J("events").EventEmitter
  20031. , h = (J("./shaders"),
  20032. J("./util/history"))
  20033. , S = (J("./util/camera"),
  20034. J("./model/ModelManager"),
  20035. J("./enum/PathDiscardMode"))
  20036. , M = J("./enum/PathDisplayMode")
  20037. , W = J("./enum/PlayerEvents")
  20038. , u = J("./enum/ControlEvents")
  20039. , d = J("./enum/ModelManagerEvents")
  20040. , R = J("./enum/WarpStyle")
  20041. , P = J("./enum/BlackoutStyle")
  20042. , p = J("./exception/BasicException")
  20043. , f = J("./enum/PanoSizeClass")
  20044. , g = (J("./tile/TileDownloader"),
  20045. J("./tile/TilePrioritizer"))
  20046. , m = (J("./enum/PanoramaEvents"),
  20047. J("./enum/ZoomEvents"))
  20048. , v = J("./util/ZoomStats")
  20049. , y = J("./constants")
  20050. , j = J("./util/common")
  20051. , A = J("./util/cameraLight")
  20052. , C = J("hot")
  20053. , Y = new i(e)
  20054. , q = Object.freeze({
  20055. FlyToPano: G.getUniqueId(),
  20056. FlyToNewMode: G.getUniqueId(),
  20057. FlyToSameMode: G.getUniqueId(),
  20058. FlyToViewFloor: G.getUniqueId(),
  20059. LookTransition: G.getUniqueId(),
  20060. ZoomTransition: G.getUniqueId()
  20061. });
  20062. function I(e) {
  20063. for (var t = e.split(","), i = t[0].match(/:(.*?);/)[1], n = atob(t[1]), r = n.length, o = new Uint8Array(r); r--; )
  20064. o[r] = n.charCodeAt(r);
  20065. return new Blob([o],{
  20066. type: i
  20067. })
  20068. }
  20069. (t.prototype = Object.create(c.prototype)).init = function(e) {
  20070. (window.player = this).modelManager = e.modelManager,
  20071. this.tileDownloader = e.tileDownloader,
  20072. this.panoRenderer = e.panoRenderer,
  20073. this.qualityManager = e.qualityManager,
  20074. this.domElement = e.container,
  20075. this.camera = e.camera,
  20076. this.tagManager = e.tagManager,
  20077. this.cameraControls = e.controls,
  20078. this.path = new r(e.director,this,e.controls),
  20079. this.basePanoSize = this.qualityManager.getPanoSize(f.BASE),
  20080. this.standardPanoSize = this.qualityManager.getPanoSize(f.STANDARD),
  20081. this.highPanoSize = this.qualityManager.getPanoSize(f.HIGH),
  20082. this.ultraHighPanoSize = this.qualityManager.getPanoSize(f.ULTRAHIGH),
  20083. this.tileDownloader.processPriorityQueue = !1,
  20084. this.tileDownloader.tilePrioritizer = new g(this.qualityManager,this.basePanoSize,this.standardPanoSize,this.highPanoSize,this.ultraHighPanoSize),
  20085. this.bindEvents(e.container),
  20086. this.updateModel()
  20087. }
  20088. ,
  20089. t.prototype.screenShot = function(i) {
  20090. if (!this.flying && !this.flyingToTag) {
  20091. var n = this.sceneRenderer;
  20092. for (var e in n.updateScreenSize(i),
  20093. this.model.panos.index)
  20094. this.model.panos.index[e].marker && (this.model.panos.index[e].marker.forceHide = this.model.panos.index[e].marker.visible,
  20095. this.model.panos.index[e].marker.visible = !1);
  20096. for (var e in this.model.hots)
  20097. this.model.hots[e].mesh.visible = !1;
  20098. this.reticule.visible = !1,
  20099. this.reticule.forceUnvisible = !0,
  20100. this.path.currentPanoMarker.mesh.visible = !1,
  20101. setTimeout(function() {
  20102. n.renderer.clear(!0, !0, !0),
  20103. n.renderer.render(n.scene, n.camera);
  20104. var e = n.renderer.domElement.toDataURL(i.type, .9);
  20105. for (var t in i.f && i.f(e),
  20106. n.updateScreenSize({
  20107. resize: !0
  20108. }),
  20109. this.reticule.visible = !0,
  20110. this.model.hots)
  20111. this.model.hots[t].mesh.visible = !0;
  20112. for (var t in this.model.panos.index)
  20113. this.model.panos.index[t].marker.visible = this.model.panos.index[t].marker.forceHide;
  20114. this.path.currentPanoMarker.mesh.visible = !0,
  20115. n.renderer.render(n.scene, n.camera)
  20116. }
  20117. .bind(this), 30)
  20118. }
  20119. }
  20120. ;
  20121. var E, _, b, w, O, L, D, N, F, X, Z, K, Q = J("scaleImg");
  20122. t.prototype.getWrapShot = function() {
  20123. var i = this.getSnapAngleInfo()
  20124. , n = ",{\r\t" + i
  20125. , r = arguments[0];
  20126. this.screenShot({
  20127. width: g_snapShotWidth,
  20128. height: g_snapShotHeight,
  20129. type: "image/jpeg",
  20130. f: function(e) {
  20131. if (r && r.__callback)
  20132. return r.__callback(e, i);
  20133. var t = new Image;
  20134. t.src = e,
  20135. t.onload = function() {
  20136. var e = function(r, i) {
  20137. function n(e, t) {
  20138. var i = o || r
  20139. , n = document.createElement("canvas");
  20140. n.width = i.width,
  20141. n.height = i.height,
  20142. n.getContext("2d").drawImage(i, 0, 0, i.width, i.height),
  20143. o = Q(e, n, t)
  20144. }
  20145. function e() {
  20146. var e = o || r
  20147. , t = I(e.src);
  20148. i.maxWeight && t.size > i.maxWeight && (n(i.maxWeight / t.size, "jpeg"),
  20149. t = I(e.src)),
  20150. (o = o || new Image).base64Src = e.src,
  20151. o.src = window.URL.createObjectURL(t)
  20152. }
  20153. var o, t = Math.max(r.width, r.height);
  20154. return "png" != i.toType && ("jpeg" == i.oldType ? (t > i.maxSize && n(i.maxSize / t, "jpeg"),
  20155. e()) : "png" == i.oldType && i.maxWeight && i.weight > i.maxWeight && (n(t > i.maxSize ? i.maxSize / t : 1, "jpeg"),
  20156. e())),
  20157. o || r
  20158. }(this, {
  20159. maxSize: g_snapShotWidth,
  20160. oldType: "jpeg"
  20161. });
  20162. e.src.replace(function(e) {
  20163. return "image/" + (e = e.toLowerCase().replace(/jpg/i, "jpeg")).match(/png|jpeg|bmp|gif/)[0]
  20164. }("image/jpeg"), "image/octet-stream");
  20165. var t = "snap" + (new Date).getTime();
  20166. !function(e, t) {
  20167. var i = document.createElementNS("http://www.w3.org/1999/xhtml", "a");
  20168. i.href = e,
  20169. i.download = t;
  20170. var n = document.createEvent("MouseEvents");
  20171. n.initMouseEvent("click", !0, !1, window, 0, 0, 0, 0, 0, !1, !1, !1, !1, 0, null),
  20172. i.dispatchEvent(n)
  20173. }(e.src, t + ".jpg"),
  20174. n += ',\r\t"thumbnail_signed_src":"' + t + '.jpg",',
  20175. n += '\r\t"sid":"' + t + '",',
  20176. n += '\r\t"name":"' + t + '"\r}',
  20177. logData(n)
  20178. }
  20179. }
  20180. })
  20181. }
  20182. /* ,
  20183. t.prototype.getSnapAngleInfo = function() {
  20184. var e = {}
  20185. , t = '"metadata":{'
  20186. , i = this.camera.quaternion.clone();
  20187. switch (this.mode) {
  20188. case "panorama":
  20189. e.scan_id = this.currentPano.id,
  20190. t += '"scan_id":"' + this.currentPano.id + '",';
  20191. break;
  20192. case "floorplan":
  20193. e.camera_mode = 1,
  20194. (i = (new B.Quaternion).setFromAxisAngle(new B.Vector3(0,1,0), B.Math.degToRad(90))).multiply(this.camera.quaternion),
  20195. t += '"camera_mode":1,',
  20196. t += '"ortho_zoom":' + U.toPrecision(this.cameraControls.activeControl.currentScale, 4) + ",";
  20197. break;
  20198. case "dollhouse":
  20199. e.camera_mode = 2,
  20200. t += '"camera_mode":2,'
  20201. }
  20202. var n = new B.Quaternion(i.x,i.y,i.z,i.w);
  20203. return n.multiply(new B.Quaternion(Math.sqrt(2) / 2,Math.sqrt(2) / 2,0,0).conjugate()),
  20204. n.x *= -1,
  20205. n.w *= -1,
  20206. e.camera_position = U.toPrecision(this.camera.position.toArray(), 4),
  20207. e.camera_quaternion = U.toPrecision(n.toArray(), 4),
  20208. e.zoom = this.zoomLevel,
  20209. t += '"camera_position":[' + e.camera_position + '],"camera_quaternion":[' + e.camera_quaternion + '], "zoom":' + e.zoom + "}"
  20210. }
  20211. , */
  20212. t.prototype.getSnapAngleInfo = function(){
  20213. var info = {};
  20214. var str = '"metadata":{';
  20215. var q = this.camera.quaternion.clone();
  20216. switch (this.mode) {
  20217. case "panorama":
  20218. info.scan_id = this.currentPano.id;
  20219. str += ('"scan_id":"'+this.currentPano.id+'",');
  20220. break;
  20221. case "floorplan":
  20222. info.camera_mode = 1;
  20223. q = (new B.Quaternion).setFromAxisAngle(new B.Vector3(0,1,0), B.Math.degToRad(90))
  20224. q.multiply(this.camera.quaternion);
  20225. str += ('"camera_mode":1,');
  20226. //str += ('"ortho_zoom":'+m.toPrecision(this.cameraControls.activeControl.currentScale * $("#player").height() / $("#player").width() * D.workshopApsect * 16, 4)+",");
  20227. str += ('"ortho_zoom":'+ U.toPrecision(this.cameraControls.activeControl.currentScale, 4 )+",");
  20228. break;
  20229. case "dollhouse":
  20230. info.camera_mode = 2;
  20231. str += ('"camera_mode":2,');
  20232. break;
  20233. }
  20234. info.camera_position = U.toPrecision(this.camera.position.toArray(),4);
  20235. //console.log(info.camera_position)
  20236. info.camera_quaternion = U.toPrecision(q.toArray(),4);
  20237. /* if(window.screenSta === 'tour'){ // fyz 导览截屏需要做额外的 fyz 对相机截屏的角度进行校对
  20238. var out = new B.Quaternion(q.x, q.y, q.z, q.w)
  20239. out.multiply(new B.Quaternion(Math.sqrt(2) / 2, Math.sqrt(2) / 2, 0, 0).conjugate())
  20240. out.x *= -1;
  20241. out.w *= -1;
  20242. info.camera_quaternion = U.toPrecision(out.toArray(),4);
  20243. }else{
  20244. info.camera_quaternion = U.toPrecision(q.toArray(),4);;
  20245. } */
  20246. info.zoom = this.zoomLevel;
  20247. //console.log(info.camera_quaternion)
  20248. // str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+"]}");
  20249. // fyz 扩展编辑页面, 加上导览点缩放值
  20250. str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+'], "zoom":' + info.zoom + '}');
  20251. console.log(str)
  20252. return str;
  20253. }
  20254. //------end
  20255. t.prototype.closePopup = function() {
  20256. if (g_currentHot) {
  20257. g_currentHot = null,
  20258. document.getElementById("popup").style.display = "none",
  20259. document.querySelector(".popup-content").removeChild(document.getElementById("id1")),
  20260. $("#popup iframe:last").remove();
  20261. document.getElementById("bgaudio");
  20262. if(g_bgAudio && g_bgAudio.pauseByHot){
  20263. manage.switchBgmState(true)
  20264. }
  20265. return false
  20266. }
  20267. }
  20268. ,
  20269. t.prototype.setupCustomProperties = function(e) {
  20270. var i = e || V.PANORAMA;
  20271. Object.defineProperty(this, "mode", {
  20272. get: function() {
  20273. return i
  20274. },
  20275. set: function(e) {
  20276. var t = i;
  20277. i = e,
  20278. this.onModeUpdated(t, i)
  20279. }
  20280. })
  20281. }
  20282. ,
  20283. t.prototype.isInMode = function() {
  20284. for (var e = 0; e < arguments.length; e++)
  20285. if (this.mode === arguments[e])
  20286. return !0;
  20287. return !1
  20288. }
  20289. ,
  20290. t.prototype.isOutsideMode = function(e) {
  20291. return (e = e || this.mode) === V.DOLLHOUSE || e === V.FLOORPLAN
  20292. }
  20293. ,
  20294. t.prototype.is360View = function(e, t) {
  20295. return e === V.PANORAMA && t && !t.isAligned()
  20296. }
  20297. ,
  20298. t.prototype.setScene = function(e) {
  20299. this.sceneIntersectionPlane = e.plane,
  20300. this.path.setScene(e),
  20301. this.moveReticuleToScene(e)
  20302. }
  20303. ,
  20304. t.prototype.moveReticuleToScene = function(e) {
  20305. this.reticule.parent && this.reticule.parent.remove(this.reticule),
  20306. e.add(this.reticule)
  20307. }
  20308. ,
  20309. t.prototype.updateModel = function() {
  20310. function n(e) {
  20311. var t = this.cameraControls.cameras[V.DOLLHOUSE]
  20312. , i = this.cameraControls.controls[V.DOLLHOUSE]
  20313. , n = t.position.y + (e - i.target.y)
  20314. , r = k.showFloorDuration + k.showFloorDelay;
  20315. G.start(H.property(i.target, "y", e), r, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToViewFloor),
  20316. G.start(H.property(t.position, "y", n), r, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToViewFloor)
  20317. }
  20318. this.model = this.modelManager.getActiveModel(),
  20319. this.model.on("floor.changed", function(e, t, i) {
  20320. this.mode === V.DOLLHOUSE && e !== i && n.call(this, e.center.y)
  20321. }
  20322. .bind(this)),
  20323. this.model.on("allfloors.toggled", function(e, t) {
  20324. if (this.mode === V.DOLLHOUSE) {
  20325. var i = e ? this.model.center.y : i = t.center.y;
  20326. n.call(this, i)
  20327. }
  20328. }
  20329. .bind(this)),
  20330. this.on(W.PanoChosen, this.model.setProjectedPanos.bind(this.model));
  20331. var t = this;
  20332. this.model.panos.list.forEach(function(e) {
  20333. e.vrMarker.addEventListener("click", function() {
  20334. t.flyToPano({
  20335. pano: e
  20336. })
  20337. })
  20338. })
  20339. }
  20340. ,
  20341. t.prototype.updateModelDependentData = function() {
  20342. this.cameraControls.setModelForControls(this.model),
  20343. this.getPanoMarkersFromModel(this.model)
  20344. }
  20345. ,
  20346. t.prototype.onModelChanged = function() {
  20347. this.updateModel(),
  20348. this.updateModelDependentData()
  20349. }
  20350. ,
  20351. t.prototype.getPanoMarkersFromModel = function(e) {
  20352. this.panoMarkers = e.panos.list.reduce(function(e, t) {
  20353. return t.marker ? e.concat(t.marker) : e
  20354. }, [])
  20355. }
  20356. ,
  20357. t.prototype.handleControlMove = function(e) {
  20358. this.emit(W.Move, e)
  20359. }
  20360. ,
  20361. t.prototype.handleControlInputStart = function(e) {
  20362. this.emit(W.InputStart, e)
  20363. }
  20364. ,
  20365. t.prototype.onModeUpdated = function(e, t) {
  20366. this.cameraControls.activateControls(t),
  20367. this.emit(W.ModeChanged, e, t)
  20368. }
  20369. ,
  20370. t.prototype.isWarping = function() {
  20371. return this.path.warping
  20372. }
  20373. ,
  20374. t.prototype.isWaitingToWarp = function() {
  20375. return this.path.waitingToWarp
  20376. }
  20377. ,
  20378. t.prototype.getLabelScaleFactor = function() {
  20379. if (this.isOutsideMode()) {
  20380. return Math.sqrt(this.cameraControls.controls[V.FLOORPLAN].currentScale / 10)
  20381. }
  20382. return .5
  20383. }
  20384. ,
  20385. t.prototype.changeMusic = function() {
  20386. if(!this.director.tourIsPlaying) this.director.bgmReplay()
  20387. }
  20388. ,
  20389. t.prototype.bindEvents = function(e) {
  20390. e !== document && e.setAttribute("tabindex", -1),
  20391. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  20392. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  20393. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  20394. e.addEventListener("mouseout", this.onMouseOut.bind(this)),
  20395. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  20396. this.modelManager.on(d.ActiveModelChanged, this.onModelChanged.bind(this)),
  20397. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  20398. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  20399. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  20400. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  20401. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  20402. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  20403. document.addEventListener("pointerup", ()=>{//add
  20404. window.transformControls && transformControls.onPointerUp()
  20405. }),
  20406. e.addEventListener("pointerout", this.onPointerOut.bind(this)),
  20407. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  20408. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  20409. this.cameraControls.on(u.Move, this.handleControlMove.bind(this)),
  20410. this.cameraControls.on(u.InputStart, this.handleControlInputStart.bind(this)),
  20411. this.cameraControls.on(u.Pinch, this.handleControlPinch.bind(this)),
  20412. this.cameraControls.on(u.Scroll, this.handleControlScroll.bind(this)),
  20413. window.addEventListener("snapshotBegin", this.getWrapShot.bind(this)),
  20414. window.addEventListener("tourAudioEnded", this.changeMusic.bind(this)),
  20415. window.getSeft && getSeft(this),
  20416. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? $("#closepop").on("touchstart", this.closePopup.bind(this)) : $("#closepop").on("click", this.closePopup.bind(this))
  20417. }
  20418. ,
  20419. t.prototype.onMouseDown = function(e) {
  20420. e.currentTarget !== document && e.currentTarget.focus(),
  20421. 0 === e.button && (this.handleInputStart.call(this, e.clientX, e.clientY, !1),
  20422. this.updateIntersect())
  20423. }
  20424. ,
  20425. t.prototype.onMouseMove = function(e) {
  20426. this.isTouchEvent = !1,
  20427. this.handleInputMove.call(this, e.clientX, e.clientY, !1)
  20428. }
  20429. ,
  20430. t.prototype.onMouseOver = function(e) {
  20431. this.containsMouse = !0,
  20432. !this.mouseDown || 0 !== e.which && 0 !== e.buttons || (this.mouseDown = !1)
  20433. }
  20434. ,
  20435. t.prototype.onMouseOut = function(e) {
  20436. this.containsMouse = !1
  20437. }
  20438. ,
  20439. t.prototype.onMouseUp = function(e) {
  20440. this.handleInputEnd.call(this, e.clientX, e.clientY, !1)
  20441. }
  20442. ,
  20443. t.prototype.onTouchStart = function(e) {
  20444. if (e.currentTarget !== document && e.currentTarget.focus(),
  20445. !this.mouseDown) {
  20446. this.couldBeLongTap = !0;
  20447. var t = x.average(e.changedTouches, "clientX")
  20448. , i = x.average(e.changedTouches, "clientY");
  20449. this.handleInputStart.call(this, t, i, !0),
  20450. this.mouseDownTimer = setTimeout(function() {
  20451. this.updateIntersect(),
  20452. this.handleInputEnd.call(this, t, i, !0)
  20453. }
  20454. .bind(this), k.input.longTapThreshold)
  20455. }
  20456. }
  20457. ,
  20458. t.prototype.onTouchMove = function(e) {
  20459. var t = x.average(e.changedTouches, "clientX")
  20460. , i = x.average(e.changedTouches, "clientY");
  20461. this.handleInputMove.call(this, t, i, !0)
  20462. }
  20463. ,
  20464. t.prototype.onTouchEnd = function(e) {
  20465. if (clearTimeout(this.mouseDownTimer),
  20466. this.mouseDown) {
  20467. this.couldBeLongTap = !1,
  20468. this.updateIntersect();
  20469. var t = x.average(e.changedTouches, "clientX")
  20470. , i = x.average(e.changedTouches, "clientY");
  20471. this.handleInputEnd.call(this, t, i, !0)
  20472. }
  20473. }
  20474. ,
  20475. t.prototype.onPointerDown = function(e) {
  20476. return e.currentTarget !== document && e.currentTarget.focus(),
  20477. this.mouseDown || "mouse" === e.pointerType ? this.onMouseDown(e) : (this.couldBeLongTap = !0,
  20478. this.handleInputStart.call(this, e.clientX, e.clientY, !0),
  20479. void (this.mouseDownTimer = setTimeout(function() {
  20480. this.updateIntersect(),
  20481. this.handleInputEnd.call(this, e.clientX, e.clientY, !0)
  20482. }
  20483. .bind(this), k.input.longTapThreshold)))
  20484. }
  20485. ,
  20486. t.prototype.onPointerMove = function(e) {
  20487. "mouse" !== e.pointerType ? this.handleInputMove.call(this, e.clientX, e.clientY, !0) : this.onMouseMove(e)
  20488. }
  20489. ,
  20490. t.prototype.onPointerUp = function(e) {
  20491. return this.mouseDown && "mouse" !== e.pointerType ? (clearTimeout(this.mouseDownTimer),
  20492. this.couldBeLongTap = !1,
  20493. this.updateIntersect(),
  20494. void this.handleInputEnd.call(this, e.clientX, e.clientY, !0)) : this.onMouseUp(e)
  20495. }
  20496. ,
  20497. t.prototype.onPointerOut = function(e) {
  20498. this.mouseDown = !1
  20499. }
  20500. ,
  20501. t.prototype.onPointerCancel = function(e) {
  20502. this.mouseDown = !1
  20503. }
  20504. ,
  20505. t.prototype.onKeyDown = function(e) {
  20506. var t = function() {
  20507. this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.Move, "key")
  20508. }
  20509. .bind(this)
  20510. , i = e.which;
  20511. switch (i) {
  20512. case l.F:
  20513. t(),
  20514. this.changeFloor(-1);
  20515. break;
  20516. case l.R:
  20517. t(),
  20518. this.changeFloor(1)
  20519. }
  20520. if (this.mode === V.PANORAMA)
  20521. switch (i) {
  20522. case l.UPARROW:
  20523. case l.W:
  20524. this.flyLocalDirection(T.FORWARD.clone());
  20525. break;
  20526. case l.DOWNARROW:
  20527. case l.S:
  20528. this.flyLocalDirection(T.BACK.clone());
  20529. break;
  20530. case l.A:
  20531. this.flyLocalDirection(T.LEFT.clone());
  20532. break;
  20533. case l.D:
  20534. this.flyLocalDirection(T.RIGHT.clone())
  20535. }
  20536. }
  20537. ,
  20538. t.prototype.handleScrollPinchZoom = function(e) {
  20539. var t = e
  20540. , i = this.zoomLevel;
  20541. this.zoomBy(t),
  20542. this.currentPano && this.zoomStats.addZoomAction(i, this.zoomLevel, this.currentPano.id)
  20543. }
  20544. ,
  20545. t.prototype.handleControlPinch = function(e) {
  20546. k.zoom.enabled ? this.handleScrollPinchZoom(1 - e) : this.flyLocalDirection(new B.Vector3(0,0,e).normalize())
  20547. }
  20548. ,
  20549. t.prototype.handleControlScroll = function(e) {
  20550. k.zoom.enabled ? (0 < e ? e = 1 + this.scrollZoomSpeed : e < 0 && (e = 1 - this.scrollZoomSpeed),
  20551. 0 !== e && this.handleScrollPinchZoom(e)) : this.flyLocalDirection(new B.Vector3(0,0,-e).normalize())
  20552. }
  20553. ,
  20554. t.prototype.handleInputStart = function(e, t, i) {
  20555. var n = this.handelPadding(e, t);
  20556. e = n.x,
  20557. t = n.y,
  20558. this.isTouchEvent = i,
  20559. U.convertScreenPositionToNDC(e, t, this.mouse),
  20560. U.convertScreenPositionToNDC(e, t, this.mouseAtMouseDown),
  20561. this.mouseCouldBeClickToMove = !0,
  20562. this.mouseDown = !0,
  20563. this.mouseCouldBeClickToMove && window.Hotpoint && (new Hotpoint).state(this, C)
  20564. window.transformControls && transformControls.onPointerDown()
  20565. if(!this.overlayInitedPlay && this.overlayGroup.children.length){
  20566. try{
  20567. this.overlayGroup.children.forEach((overlay)=>{
  20568. overlay.overlayType == "video" && overlay.plane.material.map.image.play()
  20569. })
  20570. }catch(e){}
  20571. this.overlayInitedPlay = true
  20572. }
  20573. }
  20574. ,
  20575. t.prototype.handelPadding = function(e, t) {
  20576. return this.pad || (this.pad = {
  20577. x: dom.getOffset("left", $("#player")[0]),
  20578. y: dom.getOffset("top", $("#player")[0])
  20579. }),
  20580. {
  20581. x: e - this.pad.x,
  20582. y: t - this.pad.y
  20583. }
  20584. }
  20585. ,
  20586. t.prototype.handleInputMove = function(e, t, i) {
  20587. var n = this.handelPadding(e, t);
  20588. e = n.x,
  20589. t = n.y,
  20590. this.isTouchEvent = i,
  20591. U.convertScreenPositionToNDC(e, t, this.mouse);
  20592. var moveToleranceNDC = (window.transformControls && transformControls.visible) ? 0.0000001 : k.input.moveToleranceNDC
  20593. this.mouseAtMouseDown.distanceTo(this.mouse) > moveToleranceNDC && (this.mouseCouldBeClickToMove = !1,
  20594. this.couldBeLongTap = !1,
  20595. clearTimeout(this.mouseDownTimer)),
  20596. this.mouseLastMoveTime = Date.now(),
  20597. this.reticule.move(e, t, i)
  20598. window.transformControls && transformControls.onPointerMove()
  20599. }
  20600. ,
  20601. t.prototype.handleInputEnd = function(e, t, i) {
  20602. if (this.isTouchEvent = i,
  20603. this.mouseDown = !1,
  20604. this.cameraControls.controls[V.PANORAMA].emit("interaction.direct"),
  20605. !i && this.couldBeLongTap)
  20606. return !0;
  20607. if (this.handleLongTap())
  20608. return !0;
  20609. window.transformControls && transformControls.onPointerUp()
  20610. if (this.mouseCouldBeClickToMove) {
  20611. if (this.flying)
  20612. return this.path.activeTransType === R.WALK && this.emit(W.WarpInterruptedWithFlyTo, this.path.activeTransType),
  20613. !0;
  20614. //add----
  20615. if (this.checkHotClick())
  20616. return !0;
  20617. if (window.VisiSet && VisiSet.setPanoVisible) {//正在设置漫游可行
  20618. this.intersect && this.intersect.object.visible && VisiSet.dealPanoVisible(this.intersect.object.name);
  20619. return;
  20620. }
  20621. if (window.VisiSet && VisiSet.setTagVisible ) {
  20622. VisiSet.tagVsetting && this.intersect && this.intersect.object.visible && VisiSet.dealTagVisible(VisiSet.tagVsetting, this.intersect.object.name);
  20623. return;
  20624. }
  20625. if(this.hoveringPlane){
  20626. this.clickOverlay(this.hoveringPlane)
  20627. return;
  20628. }
  20629. if(window.EditOverlay && EditOverlay.objCursorType == "overlay"){
  20630. return EditOverlay.addPlane({intersect:this.intersect});
  20631. }
  20632. /* if(objects.mainDesign && objects.mainDesign.editing && objects.mainDesign.handleClickEnd(this)){//许钟文加
  20633. if(objects.mainDesign.editType == "wallDesign" && this.mode == "panorama") return !0;
  20634. else if(objects.mainDesign.editType == "addOverlay")return !0;
  20635. } */
  20636. //----------
  20637. if (this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.Move, this.isTouchEvent ? "touch" : "mouse"),
  20638. this.history.invalidate(),
  20639. this.intersect)
  20640. return this.flyToPanoClosestToMouse();
  20641. if (this.mode === V.PANORAMA) {
  20642. var n = this.closestPanoInDirection(this.getMouseDirection());
  20643. return n ? this.flyToPano({
  20644. pano: n
  20645. }) : this.bump(this.getMouseDirection())
  20646. }
  20647. }
  20648. this.intersect && this.closestPano && this.closestPano.hoverOff(this.mode)
  20649. }
  20650. ,
  20651. t.prototype.handleLongTap = function() {
  20652. if (this.couldBeLongTap && (!this.isPanoHover || this.mode !== V.PANORAMA))
  20653. return this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.LongTap, "touch"),
  20654. !0
  20655. }
  20656. ,
  20657. t.prototype.checktagClick = function() {
  20658. if (this.tagManager.intersectTag) {
  20659. var e = this.isTouchEvent
  20660. , t = this.tagManager.clickedOnTag(e, this);
  20661. return e || t || G.cancelById(q.LookTransition),
  20662. !0
  20663. }
  20664. if (this.tagManager.activeTag)
  20665. return this.tagManager.dismissActiveTag(),
  20666. !1
  20667. }
  20668. ,
  20669. t.prototype.rankedtagInDirection = function(e, t) {
  20670. return this.tagManager.rankedtagInDirection(e, this.position, this.camera, t)
  20671. }
  20672. ,
  20673. t.prototype.start = function(e) {
  20674. $(".toolLeft").removeClass("unable");
  20675. $(".toolTop").removeClass("unable");
  20676. //-------------------
  20677. window.initTransformCtl(B)
  20678. window.initOverlay(B)
  20679. this.model.loadOverlays()
  20680. window.EditOverlay && window.EditOverlay.init(B);
  20681. window.VisiSet && VisiSet.init()
  20682. //-------------------
  20683. var t = e.mode
  20684. , i = e.pano
  20685. , n = e.position
  20686. , r = e.quaternion
  20687. , o = e.tag
  20688. , a = e.quickstart
  20689. , s = $.Deferred();
  20690. this.updateModelDependentData(),
  20691. this.updateFromControls(),
  20692. this.findDefaultViews();
  20693. var l = this.is360View(t, i);
  20694. return !this.model.outsideAllowed() || l || a ? this.startInside(i, n, r, o, s) : this.startOutside(e, s),
  20695. s.done(function(e) {
  20696. this.emit(W.Ready, l, e, o)
  20697. }
  20698. .bind(this)),
  20699. s.promise()
  20700. }
  20701. ,
  20702. t.prototype.startOutside = function(e, t) {
  20703. var i = e.mode
  20704. , n = e.pano
  20705. , r = e.position
  20706. , o = e.quaternion
  20707. , a = e.zoom
  20708. , s = e.floorVisibility
  20709. , l = e.tag;
  20710. this.emit(W.StartOutside, k[i].transitionTime),
  20711. this.isOutsideMode(i) ? (this.model.warpDestFloors(s, !0),
  20712. G.cancelById(q.FlyToViewFloor),
  20713. i === V.FLOORPLAN ? this.floorplanMode(r, o, a) : this.dollhouseMode(r, o),
  20714. t.resolve(!1)) : this.startInsideWithFlyin(n, r, o, l, t)
  20715. }
  20716. ,
  20717. t.prototype.startInside = function(e, t, i, n, r) {
  20718. r = r || $.Deferred();
  20719. var o = (this.currentPano = e) && !e.isAligned();
  20720. if (t = o ? e.position : t || e.position,
  20721. i = i || e.quaternion,
  20722. e) {
  20723. var a = this.startInside.bind(this, e, t, i, n, r);
  20724. if (this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, a))
  20725. return
  20726. }
  20727. //add
  20728. this.transitionPos({type:"beforeFlytopano", pano:this.currentPano, dur:0})
  20729. return this.mode = V.PANORAMA,
  20730. e.floor.enter(this.mode),
  20731. this.emit(W.PanoChosen, this.currentPano, this.currentPano),
  20732. this.switchCameraMode(this.mode, i),
  20733. this.emit(W.StartInside, o),
  20734. r.resolve(!0),
  20735. r
  20736. }
  20737. ,
  20738. t.prototype.startInsideWithFlyin = function(i, e, n, t, r) {
  20739. if (r = r || $.Deferred(),
  20740. this.dollhouseMode(),
  20741. !i)
  20742. return Y.warn("Player.startInsideWithFlyin() -> targetPano is invalid."),
  20743. r.resolve(!1),
  20744. r;
  20745. e = e || i.position;
  20746. var o = n || this.cameraControls.activeControl.camera.quaternion
  20747. , a = i.position;
  20748. return this.fitDollhouse(a, e, o),
  20749. setTimeout(function(e) {
  20750. this.cameraControls.activeControl && (this.cameraControls.activeControl.maxDistance = e);
  20751. var t = {
  20752. mode: V.PANORAMA,
  20753. pano: i,
  20754. quaternion: n,
  20755. callback: function() {
  20756. this.emit(W.FlyinFinished),
  20757. r.resolve(!0)
  20758. }
  20759. .bind(this)
  20760. };
  20761. this.flyToNewMode(t)
  20762. }
  20763. .bind(this, this.cameraControls.activeControl.maxDistance), k.startupFlyinDelay),
  20764. r
  20765. }
  20766. ,
  20767. t.prototype.checkAndWaitForPanoLoad = (Z = {},
  20768. K = {},
  20769. function(t, e, i, n, r, o, a, s, l, c) {
  20770. if (function() {
  20771. for (var e in Z)
  20772. if (Z.hasOwnProperty(e) && Z[e] && performance.now() - K[e] < 5e3)
  20773. return !0;
  20774. return !1
  20775. }())
  20776. return !0;
  20777. var h = function(e, t, i) {
  20778. j.delayOneFrame(function() {
  20779. Z[e] = !1,
  20780. r && r(t, i)
  20781. }
  20782. .bind(this))
  20783. }
  20784. .bind(this, t.id)
  20785. , u = function(e, t) {
  20786. j.delayOneFrame(function() {
  20787. Z[e] = !1,
  20788. o && o(t)
  20789. }
  20790. .bind(this))
  20791. }
  20792. .bind(this, t.id);
  20793. try {
  20794. return null != s || (s = !0),
  20795. 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),
  20796. Z[t.id] && (K[t.id] = performance.now()),
  20797. Z[t.id]
  20798. } catch (e) {
  20799. throw Z[t.id] = !1,
  20800. K[t.id] = performance.now() - 5e3,
  20801. e
  20802. }
  20803. }
  20804. ),
  20805. t.prototype.checkAndWaitForWholePanoLoad = function(e, t, i, n, r) {
  20806. if (!e)
  20807. throw new p("Player.checkAndWaitForWholePanoLoad() -> Cannot load texture for null pano.");
  20808. return r && this.model.waitForLoad(e, function() {
  20809. return e.isLoaded(i)
  20810. }),
  20811. !e.isLoaded(t) && (e.loadCube(t).done(n),
  20812. !0)
  20813. }
  20814. ,
  20815. t.prototype.checkAndWaitForTiledPanoLoad = (X = new B.Vector3,
  20816. function(e, t, i, n, r, o, a, s) {
  20817. if (!e)
  20818. throw new p("Player.checkAndWaitForTiledPanoLoad() -> Cannot load texture for null pano.");
  20819. return X.copy(T.FORWARD),
  20820. this.getDirection(X),
  20821. !e.isLoaded(t) && (o && this.model.waitForLoad(e, function() {
  20822. return e.isLoaded(t)
  20823. }),
  20824. e.loadTiledPano(t, X, null, a, s).done(function(e, t) {
  20825. i && i(e, t)
  20826. }
  20827. .bind(this)).fail(function(e) {
  20828. n && n(e)
  20829. }
  20830. .bind(this)).progress(function(e, t, i) {
  20831. r && r(e, t, i)
  20832. }
  20833. .bind(this)),
  20834. !0)
  20835. }
  20836. ),
  20837. t.prototype.switchCameraMode = function(e, t) {
  20838. var i = this.cameraControls.controls[e]
  20839. , n = i.camera;
  20840. switch (e) {
  20841. case V.PANORAMA:
  20842. n.position.copy(this.currentPano.position);
  20843. var r = t ? T.FORWARD.clone().applyQuaternion(t) : this.getDirection().setY(0).normalize();
  20844. i.lookAt(r.add(n.position));
  20845. break;
  20846. case V.DOLLHOUSE:
  20847. /* var o = this.position.clone();
  20848. 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),
  20849. n.position.copy(o),
  20850. i.target.copy(this.target.clone().setY(this.model.center.y));
  20851. break; */
  20852. //for多楼层 且 让模型刚好适应屏幕
  20853. var box = this.model.boundingBox.clone();
  20854. box.applyMatrix4(this.camera.matrixWorld);//将 boundingbox、也就是模型, 转换到当前相机朝向
  20855. var boxSize = box.size() //其中boxSize.x是模型在当前相机视角下的横向宽度,当飞出后,该宽度要刚好占满窗口宽度
  20856. var fov = A.getHFOVFromVFOV(k.insideFOV, n.aspect, 1); //获得在当前窗口的横向的fov
  20857. var distance = Math.abs(boxSize.x) / 2 / Math.tan(THREE.Math.degToRad(fov / 2))//根据上面获得的参数得到target到相机的距离
  20858. console.log(boxSize.x,distance, boxSize.length() / 2)
  20859. distance += boxSize.length() / 2 //由于此时模型从中心向相机的部分由于近大远小仍超出屏幕,所以将target放在靠近模型靠近相机的这一端,故而再加上box的对角线长度的一半, 虽然本该加上Math.sqrt(boxSize.z*boxSize.z +boxSize.y+boxSize.y)/2,但是这样模型显得比较满
  20860. if(this.mode === V.PANORAMA){
  20861. i.target.copy(this.model.center);
  20862. var vec = this.getDirection().negate().setY(1).normalize()//获得朝向
  20863. }else{
  20864. i.target.copy(this.target.clone().setY(this.model.center.y))
  20865. var vec = T.DOWN.clone().applyQuaternion(this.quaternion).setY(1).normalize()
  20866. }
  20867. vec.multiplyScalar(distance )
  20868. n.position.copy(i.target.clone().add(vec))
  20869. break
  20870. case V.FLOORPLAN:
  20871. n.position.copy(this.model.center).setY(k.floorplan.cameraHeight),
  20872. i.target.copy(this.model.center).setY(0),
  20873. i.zoomToContain(this.model.size),
  20874. i.rotateToView(this.model.size, this.getDirection())
  20875. }
  20876. i.update(0)
  20877. }
  20878. ,
  20879. t.prototype.update = (new B.Vector3,
  20880. N = {},
  20881. F = [],
  20882. function(e) {
  20883. this.updatePersistentZooming(e),
  20884. this.updateFromControls(e),
  20885. this.getCurrentNodePanos(F)
  20886. if(this.hasChanged(N)){
  20887. this.lastChangeTime = Date.now(),
  20888. !this.mouseDown && this.containsMouse && this.updateIntersect()
  20889. this.emit(W.ViewChanged)
  20890. //add:
  20891. if (window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setTagVisible)) VisiSet.updateFootIconSize();
  20892. this.intersectHot && this.intersectHot.showTitle()
  20893. for(var i in this.model.hots){
  20894. this.model.hots[i].update(this.camera)
  20895. }
  20896. }
  20897. this.mode == "panorama" && cad.setSign({ x: this.position.x, y: this.position.z },this.cameraControls.controls.panorama.lon);
  20898. this.model.supportsTiles && (this.updateTileDownloader(F),
  20899. this.updatePanoRenderer(F)),
  20900. this.updatePreRendering(F),
  20901. this.reticule.update(),
  20902. this.path.update(),
  20903. this.spider.update(),
  20904. this.cachedPanoCandidates && k.navigation.panoScores && this.model.panos.showPanoScores(this.cachedPanoCandidates),
  20905. this.updateControlLocks(),
  20906. this.model.supportsTiles && this.updateZoomPano()
  20907. }
  20908. ),
  20909. t.prototype.updatePersistentZooming = function(e) {
  20910. 1 === this.zooming ? this.zoomBy(1 + this.zoomSpeed * e) : -1 === this.zooming && this.zoomBy(1 - this.zoomSpeed * e)
  20911. }
  20912. ,
  20913. t.prototype.updateControlLocks = function() {
  20914. this.currentPano && this.model.supportsTiles && (this.cameraControls.controls[V.PANORAMA].locked = !this.currentPano.highestFullTileRenderOpCompleted && this.currentPano.lockUntilRenderingComplete)
  20915. }
  20916. ,
  20917. t.prototype.updatePanoRenderer = (D = new B.Vector3,
  20918. function(e) {
  20919. var t = this.nextPano || this.currentPano;
  20920. this.panoRenderer.hasQueuedTiles() && t && (D.copy(T.FORWARD),
  20921. this.getDirection(D),
  20922. this.panoRenderer.updateDirection(D))
  20923. }
  20924. ),
  20925. t.prototype.cleanupInactivePanos = (O = [],
  20926. L = [],
  20927. function() {
  20928. O.length = 0,
  20929. O.push(this.currentPano),
  20930. this.nextPano && O.push(this.nextPano);
  20931. for (var e = L.length = 0; e < this.panoRenderer.activePanos.length; e++)
  20932. L.push(this.panoRenderer.activePanos[e]);
  20933. for (var t = 0; t < L.length; t++) {
  20934. for (var i = L[t], n = !0, r = 0; r < O.length; r++)
  20935. i.id === O[r].id && (n = !1);
  20936. n && i.exit()
  20937. }
  20938. }
  20939. ),
  20940. t.prototype.updatePreRendering = (w = {},
  20941. function(e) {
  20942. if (1 === k.tiling.preRenderTourPanos && this.preRenderingEnabled) {
  20943. var t = this.nextPano || this.currentPano;
  20944. if (t && e && 1 < e.length) {
  20945. var i = e.findIndex(function(e) {
  20946. if (e.id === t.id)
  20947. return !0
  20948. });
  20949. if (0 <= i && i + 1 < e.length) {
  20950. var n = e[i + 1];
  20951. n.isLoaded(this.basePanoSize) || w[n.id] || (window.setTimeout(function(e) {
  20952. this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, null, null, null, !1, !1, !1),
  20953. window.setTimeout(function(e) {
  20954. w[e.id] = !1
  20955. }
  20956. .bind(this, e), k.tiling.panoPreRenderRepeatDelay)
  20957. }
  20958. .bind(this, n), k.tiling.panoPreRenderDelay),
  20959. w[n.id] = !0)
  20960. }
  20961. }
  20962. }
  20963. }
  20964. ),
  20965. t.prototype.enablePreRendering = function() {
  20966. this.preRenderingEnabled = !0
  20967. }
  20968. ,
  20969. t.prototype.disablePreRendering = function() {
  20970. this.preRenderingEnabled = !1,
  20971. this.cleanupInactivePanos()
  20972. }
  20973. ,
  20974. t.prototype.updateTileDownloader = (b = new B.Vector3,
  20975. function(e) {
  20976. var t = this.nextPano || this.currentPano;
  20977. t && (b.copy(T.FORWARD),
  20978. this.getDirection(b),
  20979. this.tileDownloader.tilePrioritizer.updateCriteria(t, this.position, b, 0 < e.length ? e : null),
  20980. this.tileDownloader.processPriorityQueue = !0)
  20981. }
  20982. ),
  20983. t.prototype.updateFromControls = function(e) {
  20984. null != e || (e = 0),
  20985. this.cameraControls.activeControl && (this.cameraControls.activeControl.update(e),
  20986. this.quaternion.copy(this.cameraControls.activeControl.camera.quaternion),
  20987. this.position.copy(this.cameraControls.activeControl.camera.position),
  20988. this.target.copy(this.cameraControls.activeControl.target),
  20989. this.cameraControls.activeControl.camera.updateProjectionMatrix(),
  20990. this.camera.projectionMatrix.copy(this.cameraControls.activeControl.camera.projectionMatrix)),
  20991. this.camera.position.copy(this.position),
  20992. this.camera.quaternion.copy(this.quaternion),
  20993. this.camera.updateMatrix(),
  20994. this.camera.updateMatrixWorld()
  20995. }
  20996. ,
  20997. t.prototype.hasChanged = function(e) {
  20998. if (!this.previousState)
  20999. return this.previousState = {
  21000. allFloorsVisible: this.model.allFloorsVisible,
  21001. position: this.position.clone(),
  21002. quaternion: this.quaternion.clone(),
  21003. mouse: this.mouse.clone(),
  21004. labelScaleFactor: this.getLabelScaleFactor(),
  21005. currentFloor: this.model.currentFloor,
  21006. projectionMatrix: this.camera.projectionMatrix.clone(),
  21007. worldMatrix: this.camera.matrixWorld.clone(),
  21008. mode: this.mode,
  21009. modelPosition: this.model.position.clone(),
  21010. modelCenter: this.model.center.clone(),
  21011. zoomLevel: this.zoomLevel
  21012. },
  21013. !0;
  21014. 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;
  21015. return e.allFloorsVisible = this.model.allFloorsVisible !== this.previousState.allFloorsVisible,
  21016. e.moved = !this.position.equals(this.previousState.position),
  21017. e.rotated = !this.quaternion.equals(this.previousState.quaternion),
  21018. e.mouseMoved = !this.mouse.equals(this.previousState.mouse),
  21019. e.labelScaleFactor = this.getLabelScaleFactor() !== this.previousState.labelScaleFactor,
  21020. e.floorChanged = this.model.currentFloor !== this.previousState.currentFloor,
  21021. e.cameraProjectionChanged = !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix),
  21022. e.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(this.previousState.worldMatrix),
  21023. e.modeChanged = this.mode !== this.previousState.mode,
  21024. e.modelPositionChanged = !this.model.position.equals(this.previousState.modelPosition),
  21025. e.modelCenterChanged = !this.model.center.equals(this.previousState.modelCenter),
  21026. e.nextPanoActive = null !== this.nextPano,
  21027. e.zoomLevel = this.zoomLevel !== this.previousState.zoomLevel,
  21028. this.previousState.allFloorsVisible = this.model.allFloorsVisible,
  21029. this.previousState.position.copy(this.position),
  21030. this.previousState.quaternion.copy(this.quaternion),
  21031. this.previousState.mouse.copy(this.mouse),
  21032. this.previousState.labelScaleFactor = this.getLabelScaleFactor(),
  21033. this.previousState.currentFloor = this.model.currentFloor,
  21034. this.previousState.projectionMatrix.copy(this.camera.projectionMatrix),
  21035. this.previousState.worldMatrix.copy(this.camera.matrixWorld),
  21036. this.previousState.mode = this.mode,
  21037. this.previousState.modelPosition.copy(this.model.position),
  21038. this.previousState.modelCenter.copy(this.model.center),
  21039. this.previousState.zoomLevel = this.zoomLevel,
  21040. !t
  21041. }
  21042. ,
  21043. t.prototype.updateIntersect = function() {
  21044. var e = this.flying || this.isWarping()
  21045. , t = this.isOutsideMode() && this.cameraControls.controls[this.mode].isEngaged()
  21046. , i = G.getById(q.LookTransition);
  21047. e || t || this.isTouchEvent || i.length && i[0].running;
  21048. if (window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setTagVisible)) {
  21049. this.intersect = this.getMouseIntersect(null, VisiSet.footIcons);
  21050. if (this.intersect && this.intersect.object.visible )
  21051. $("#player").css("cursor", "pointer");
  21052. else
  21053. $("#player").css("cursor", "")
  21054. return;
  21055. }
  21056. this.intersect = this.getMouseIntersect(),
  21057. this.intersect && this.updateClosestPano(this.intersect),
  21058. this.closestPano || this.closestPanoInDirection(this.getMouseDirection()) ? (this.reticule.updatePosition(this.position, this.intersect),
  21059. k.navigation.panoScores && !k.navigation.mouseDirection && this.closestPanoInDirection(this.getDirection())) : this.reticule.hide()
  21060. }
  21061. ,
  21062. t.prototype.checkHotClick = function() {
  21063. if (this.intersectHot){
  21064. if (window.VisiSet && VisiSet.setTagVisible ) {
  21065. VisiSet.SetOneTagVisible(this.intersectHot); //设置这个热点的可见性
  21066. return;
  21067. }
  21068. this.intersectHot.noAction || this.intersectHot.examine(this)
  21069. return !0
  21070. }
  21071. }
  21072. ,
  21073. t.prototype.getMouseDirection = function(e) {
  21074. e = e || this.mouse;
  21075. var t = new B.Vector3(e.x,e.y,-1).unproject(this.camera);
  21076. return new B.Vector3(e.x,e.y,1).unproject(this.camera).sub(t).normalize()
  21077. }
  21078. ,
  21079. t.prototype.hoverOverlay = function(mesh){
  21080. if(!mesh){
  21081. this.hoveringPlane = null;
  21082. $("#player").css("cursor",this.currentCursor || "" );
  21083. }else{
  21084. var overlay = mesh.parent;
  21085. $("#player").css("cursor","pointer");
  21086. this.hoveringPlane = overlay;
  21087. return true;
  21088. }
  21089. },
  21090. t.prototype.clickOverlay = function(overlay){
  21091. if(this.openOverlay && !overlay)return;
  21092. var plane = overlay.plane;
  21093. if(overlay.overlayType == "video"){
  21094. if(plane.material.map.image.paused)plane.material.map.image.play()
  21095. else plane.material.map.image.pause();
  21096. }
  21097. if(window.EditOverlay &&EditOverlay.editing){
  21098. if(EditOverlay.editPlane && overlay != EditOverlay.editPlane) EditOverlay.closeOverlayPanel('cancel')
  21099. $('#overlayProp').removeClass('atRight').removeClass('hide')
  21100. EditOverlay.endAddPlane();
  21101. EditOverlay.updateOverlayPanel(overlay)
  21102. transformControls.attach(overlay)
  21103. return;
  21104. }
  21105. },
  21106. t.prototype.getMouseIntersect = function(e, t) {
  21107. e = e || this.mouse.clone(),
  21108. t = t || this.model.floors.reduce(function(e, t) {
  21109. return t.hidden ? e : e.concat(t.collider.children)
  21110. }, this.mode === V.PANORAMA ? this.panoMarkers : []),
  21111. t = t.slice(0)
  21112. for (var i in this.model.hots) t.push(this.model.hots[i].mesh);
  21113. this.overlayGroup && (t = t.concat(this.overlayGroup.children));
  21114. i = new B.Vector3(e.x,e.y,-1).unproject(this.camera);
  21115. this.raycaster.set(i, this.getMouseDirection(e));
  21116. var n = this.raycaster.intersectObjects(t, true);//add true
  21117. if ("add" == g_HotStatus) {
  21118. var r = this.raycaster.intersectObjects(window.player.model.chunks);
  21119. //console.log(r[0]),
  21120. 1 <= r.length ? ($("#player").css("cursor", "cell"),
  21121. window.hotIntersect = r[0]) : ($("#player").css("cursor", "not-allowed"),
  21122. window.hotIntersect = !1)
  21123. return;
  21124. }
  21125. this.intersectHot && this.intersectHot.hideTitle()
  21126. if (0 === n.length)
  21127. return this.intersectHot = null,
  21128. "add" != g_HotStatus && $("#player").css("cursor", ""),
  21129. null;
  21130. var o = n[0];
  21131. if ("hotSprite" == o.object.type){
  21132. this.intersectHot = o.object.belongHot
  21133. this.intersectHot.showTitle()
  21134. $(`.toolRight .spotList ul li[data-spid=${this.intersectHot.sid}]`).addClass("active")
  21135. this.intersectHot.noAction || $("#player").css("cursor", "pointer");
  21136. return;
  21137. }
  21138. $(".toolRight .spotList ul li").removeClass("active")
  21139. this.intersectHot = null;
  21140. /* if(window.EditOverlay && n && n.length){
  21141. if(n[0].object.parent.parent == this.overlayGroup){
  21142. this.hoverOverlay(n[0].object);
  21143. }else()
  21144. } */
  21145. var intersect = this.hoverOverlay(this.overlayGroup && o && o.object.parent.parent == this.overlayGroup && o.object)
  21146. intersect || "add" != g_HotStatus && $("#player").css("cursor", this.currentCursor),
  21147. o.face && (o.normal = o.face.normal.applyQuaternion(o.object.quaternion),
  21148. this.position.clone().sub(o.point).dot(o.normal) < 0 && o.normal.negate(),
  21149. this.currentPano ? o.onFloor = o.point.y < this.position.y - .5 * this.currentPano.height : o.onFloor = o.point.y < this.position.y - .5,
  21150. o.horizontal = .8 < o.normal.y);
  21151. return o
  21152. }
  21153. ,
  21154. t.prototype.updateClosestPano = function(e) {
  21155. var t = [a.filters.isPanoAligned()];
  21156. if (this.mode === V.PANORAMA) {
  21157. if (!this.currentPano)
  21158. return;
  21159. t.push(a.filters.not(this.currentPano)),
  21160. t.push(a.filters.inFloorDirection(this.currentPano.floorPosition, this.getDirection(), .25)),
  21161. t.push(a.filters.isNeighbourPanoTo(this.currentPano)),
  21162. t.push(a.filters.isCloseEnoughTo(e.point, k.panoFloorClickRadius)),
  21163. t.push(a.filters.isNotBehindNormal(e.point, e.normal))
  21164. } else{
  21165. t.push((pano)=>{ // add
  21166. return this.checkHasNeighbor(pano)
  21167. })
  21168. t.push(a.filters.isOnVisibleFloor()),
  21169. this.mode !== V.FLOORPLAN && t.push(a.filters.inDirection(this.position, this.getDirection(), .25));
  21170. }
  21171. var i = this.model.panos.find(t, [a.sortFunctions.floorDistanceToPoint(e.point)]);
  21172. i !== this.closestPano ? (i && (this.isPanoHover = !0),
  21173. this.emit(W.ClosestPanoChanging, this.closestPano, i, this.mode),
  21174. this.closestPano = i) : this.isPanoHover = !1
  21175. }
  21176. ,
  21177. t.prototype.dollhouseMode = function(e, t) {
  21178. this.emit(W.ModeChanging, this.mode, V.DOLLHOUSE),
  21179. this.mode = V.DOLLHOUSE,
  21180. this.cameraControls.controls[V.DOLLHOUSE].reset();
  21181. var i = new B.Vector3(this.model.center.x,0,this.model.center.z)
  21182. , n = new B.Vector3(15,10,15);
  21183. if (e && t) {
  21184. var r = T.FORWARD.clone().applyQuaternion(t)
  21185. , o = this.model.center.clone().sub(e).dot(r);
  21186. 0 < o ? (i = r.clone().multiplyScalar(o).add(e),
  21187. n.copy(e)) : Y.warn("Tried to initiate dollhouse mode that wasn't looking at the model", e, t)
  21188. }
  21189. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(0, !0),
  21190. this.cameraControls.controls[V.DOLLHOUSE].target.copy(i),
  21191. this.cameraControls.cameras[V.DOLLHOUSE].position.copy(n),
  21192. this.updateFromControls(),
  21193. this.model.alpha = 1,
  21194. this.model.skybox.material.uniforms.opacity.value = 0
  21195. }
  21196. ,
  21197. t.prototype.insideMode = function(e, t) {
  21198. var i = $.Deferred()
  21199. , n = t || null;
  21200. if (this.mode !== V.PANORAMA && this.mode !== V.TRANSITIONING) {
  21201. var r = [a.filters.isPanoAligned()];
  21202. this.model.currentFloor && r.push(a.filters.atFloor(this.model.currentFloor)),
  21203. e = e || this.currentPano || this.model.panos.find(r, [a.sortFunctions.distanceToPoint(this.cameraControls.activeControl.target)]),
  21204. this.flyToNewMode({
  21205. mode: V.PANORAMA,
  21206. pano: e,
  21207. callback: n
  21208. }).done(i.resolve.bind(i)).fail(i.reject.bind(i))
  21209. } else {
  21210. var o = this.mode === V.PANORAMA ? "Already in panorama mode" : "Cannot change mode during mode transition";
  21211. i.reject(o)
  21212. }
  21213. return i.promise()
  21214. }
  21215. ,
  21216. t.prototype.fitDollhouse = function(e, t, i) {
  21217. var maxY = this.model.boundingBox.max.y;//add
  21218. var n = T.FORWARD.clone().applyQuaternion(i);
  21219. i = n.clone().add(e);
  21220. this.cameraControls.activeControl.target.copy(i),
  21221. this.cameraControls.activeControl.camera.position.set(0, maxY * 2.4, 0).add(e).add(n.multiplyScalar(-10))
  21222. }
  21223. ,
  21224. t.prototype.floorplanMode = function(e, t, i) {
  21225. this.mode = V.FLOORPLAN;
  21226. var n = this.cameraControls.controls[V.FLOORPLAN];
  21227. n.reset();
  21228. var r = e || this.model.center;
  21229. if (n.target.copy(r).setY(0),
  21230. n.camera.position.copy(r).setY(k.floorplan.cameraHeight),
  21231. i ? (n.currentScale = i / ($("#player").width() / $("#player").height()),
  21232. n.absoluteScale = n.currentScale) : n.zoomToContain(this.model.size),
  21233. t) {
  21234. var o = T.LEFT.clone().applyQuaternion(t);
  21235. n.rotateLeft(-Math.atan2(o.x, o.z))
  21236. } else
  21237. n.rotateToView(this.model.size, this.getDirection());
  21238. n.update(0)
  21239. }
  21240. ,
  21241. t.prototype.nonInterruptingFlyToPano = function(e, t) {
  21242. return e.skipWarpingCheck = !0,
  21243. this.flyToPano(e, t)
  21244. }
  21245. ,
  21246. t.prototype.updateMarkerVisi = function() {//加
  21247. if(this.mode != "panorama")return;
  21248. this.model.panos.list.forEach((pano)=>{
  21249. if(!pano.marker)return;
  21250. pano.marker.material.visible = !!pano.neighbourPanos[this.currentPano.id];
  21251. })
  21252. }
  21253. ,
  21254. t.prototype.updateHotVisible = function(pano){
  21255. var hots = this.model.hots;
  21256. pano = pano || this.currentPano;
  21257. for (var index in hots){
  21258. var visible;
  21259. if(this.mode != "panorama"){
  21260. visible = true;
  21261. }else{
  21262. //hots[index].mesh.material.depthTest = false;
  21263. visible = !hots[index].visiblePanos || hots[index].visiblePanos.indexOf(pano.id) > -1
  21264. }
  21265. hots[index].mesh.visible = visible;
  21266. }
  21267. },
  21268. t.prototype.flyToPano = function(e, t) {
  21269. 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;
  21270. if (window.specialScene && specialScene.special().specifySpot && specialScene.special().specifySpot(n),
  21271. this.isWarping() && !l && (this.path.activeTransType === R.BLACK || this.path.activeTransType === R.STD))
  21272. return Y.warn("Player.flyToPano() -> Cannot fly when warping"),
  21273. t && t(),
  21274. !1;
  21275. if (this.updateLastView(),
  21276. this.mode !== V.PANORAMA)
  21277. return r && (i = (new B.Quaternion).setFromUnitVectors(T.FORWARD, r.sub(n.position).normalize())),
  21278. void this.flyToNewMode({
  21279. mode: V.PANORAMA,
  21280. pano: n,
  21281. duration: o,
  21282. quaternion: i,
  21283. callback: t
  21284. });
  21285. if (!n || (h = x.deepExtend(e),
  21286. u = function() {
  21287. j.delayOneFrame(function() {
  21288. this.flyToPano(h, t)
  21289. }
  21290. .bind(this))
  21291. }
  21292. .bind(this),
  21293. !this.checkAndWaitForPanoLoad(n, "high", "low", this.basePanoSize, u))) {
  21294. var d = function(e) {
  21295. t && t(e)
  21296. }
  21297. .bind(this);
  21298. this.currentPano || (this.currentPano = n,
  21299. this.path.placeCpm(),
  21300. this.path.fadeOutCpm(k.path.fadeOutTime),
  21301. this.spider.draw());
  21302. var p = o;
  21303. if ("number" != typeof o) {
  21304. var f = s || k.transition.flytimeMaxDistanceThreshold;
  21305. p = Math.min(this.currentPano.position.distanceTo(n.position), f) * k.transition.flytimeDistanceMultiplier + k.transition.flyTime
  21306. }
  21307. if (.01 < k.transition.flySpeed && (p = 1e3 * this.currentPano.position.distanceTo(n.position) / k.transition.flySpeed),
  21308. 1 !== this.zoomLevel)
  21309. switch (k.zoom.transitionStyle) {
  21310. case 1:
  21311. this.smoothZoomToDefault(p / 2);
  21312. break;
  21313. case 2:
  21314. return h = x.deepExtend(e),
  21315. u = this.flyToPano.bind(this, h, t),
  21316. void this.smoothZoomToDefault(k.zoom.restoreTime * (this.zoomLevel - 1), u)
  21317. }
  21318. if (r) {
  21319. G.cancelById(q.LookTransition),
  21320. p *= k.transition.aimSlowFactor;
  21321. var g = this.cameraControls.activeControl.camera.quaternion.clone()
  21322. , m = (new B.Matrix4).lookAt(n.position, r, T.UP)
  21323. , v = (new B.Quaternion).setFromRotationMatrix(m)
  21324. , y = g.clone()
  21325. , A = new B.Vector3;
  21326. if (n === this.currentPano) {
  21327. var C = T.FORWARD.clone().applyQuaternion(g)
  21328. , I = T.FORWARD.clone().applyQuaternion(v)
  21329. , E = C.angleTo(I);
  21330. return null != a || (a = 1 * Math.sqrt(E) / k.tags.navigate.rotateSpeedFactor * 1e3),
  21331. void G.start(function(e) {
  21332. y.copy(g),
  21333. H.quaternion(y, v)(e),
  21334. A.copy(T.FORWARD).applyQuaternion(y).add(this.cameraControls.activeControl.camera.position),
  21335. this.cameraControls.activeControl.lookAt(A)
  21336. }
  21337. .bind(this), a, d, 0, z[k.transition.movementEasing], null, q.LookTransition)
  21338. }
  21339. }
  21340. if (n === this.currentPano || this.flying)
  21341. return void d();
  21342. this.flying = !0;
  21343. var _ = this.position.clone()
  21344. , b = this.currentPano;
  21345. Y.debug("Flying to pano ", n.position);
  21346. this.emit(W.PanoChosen, this.currentPano, n);
  21347. this.emit(W.FlyingStarted, n.position, _, n, b);
  21348. this.updateHotVisible(n); //更新热点显示
  21349. this.transitionPos({type:"beforeFlytopano", pano:n, dur:p})//add
  21350. r && G.start(function(e) {
  21351. y.copy(g),
  21352. H.quaternion(y, v)(e),
  21353. A.copy(T.FORWARD).applyQuaternion(y).add(this.cameraControls.activeControl.camera.position),
  21354. this.cameraControls.activeControl.lookAt(A)
  21355. }
  21356. .bind(this), p, null, 0, z[k.transition.movementEasing], null, q.LookTransition);
  21357. var w = c ? null : z[k.transition.movementEasing];
  21358. this.nextPano = n;
  21359. G.start(H.uniform(this.model.skybox, "progress", 1), p, null, 0, z[k.transition.blendEasing], "skyFly", q.FlyToPano),
  21360. G.start(H.allUniforms(this.model.chunks, "progress", 1), p, null, 0, z[k.transition.blendEasing], "chunkFly", q.FlyToPano),
  21361. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, n.position), p, function(e) {
  21362. this.flying = !1,
  21363. this.currentPano !== n && this.currentPano.exit(),
  21364. n.enter(),
  21365. this.currentPano = n,
  21366. this.nextPano = null,
  21367. this.path.placeCpm(),
  21368. this.path.fadeOutCpm(k.path.fadeOutTime),
  21369. this.spider.draw(),
  21370. this.emit(W.FlyingEnded, n.position, _, n, b),
  21371. this.updateMarkerVisi();//add
  21372. d(e)
  21373. if(this.mode == "panorama" && EditOverlay.editing){
  21374. EditOverlay.updatePano(this.currentPano)
  21375. }
  21376. }
  21377. .bind(this), 0, w, "camFly", q.FlyToPano)
  21378. }
  21379. }
  21380. ,
  21381. window._transitionPosId = 9999
  21382. t.prototype.transitionPos = function(o={}) {//渐变overlay和热点的位置
  21383. G.cancelById(_transitionPosId)
  21384. var begin = function(object, pos, qua, scale){
  21385. if(pos){
  21386. if(!same(object.position, pos, 0.01)){
  21387. G.start(H.vector(object.position, pos), o.dur, (e)=>{
  21388. },0, z[k.transition.movementEasing], "transitionPos", _transitionPosId)
  21389. }
  21390. if(!same(object.quaternion, qua, 1e-6)){
  21391. G.start(H.quaternion(object.quaternion, qua), o.dur, (e)=>{
  21392. },0, z[k.transition.movementEasing], "transitionPos", _transitionPosId)
  21393. }
  21394. if(!same(object.scale, scale, 0.001)){
  21395. G.start(H.vector(object.scale, scale), o.dur, (e)=>{
  21396. },0, z[k.transition.movementEasing], "transitionPos", _transitionPosId)
  21397. }
  21398. }
  21399. }
  21400. var same = function(vec1, vec2, diff){
  21401. var s = Math.abs(vec1.x-vec2.x) < diff && Math.abs(vec1.y-vec2.y) < diff && Math.abs(vec1.z-vec2.z) < diff
  21402. if(s && vec1.w) s = Math.abs(vec1.w-vec2.w) < diff
  21403. return s
  21404. }
  21405. this.overlayGroup.children.forEach(overlay=>{
  21406. var panoData = o.pano != void 0 && overlay.transformAtPanos[o.pano.id]
  21407. var useCustom = o.type == "beforeFlyOut" || !panoData
  21408. var pos = useCustom ? overlay.posCustom : panoData.pos;
  21409. var qua = useCustom ? overlay.quaCustom : panoData.qua;
  21410. var scale = useCustom ? overlay.getScaleBySize(overlay.widthCustom, overlay.heightCustom) :
  21411. overlay.getScaleBySize(panoData.width , panoData.height)
  21412. scale = new THREE.Vector3(scale.x, scale.y, overlay.scale.z)
  21413. begin(overlay, pos, qua, scale )
  21414. })
  21415. }
  21416. t.prototype.fastForwardActivePanoFlight = function(e) {
  21417. e = e || k.transition.fastForwardFactor / 10 * 4 + 1,
  21418. G.adjustSpeed(q.FlyToPano, e),
  21419. G.adjustSpeed(q.LookTransition, e)
  21420. }
  21421. ,
  21422. t.prototype.flyToPanoClosestToMouse = function() {
  21423. if (50 < Date.now() - this.mouseLastMoveTime && (this.intersect = this.getMouseIntersect(),
  21424. this.intersect && this.updateClosestPano(this.intersect)),
  21425. this.closestPano)
  21426. return this.flyToPano({
  21427. pano: this.closestPano
  21428. });
  21429. var e = this.getMouseDirection();
  21430. this.flyDirection(e) || this.flyToPano({
  21431. pano: this.currentPano
  21432. })
  21433. }
  21434. ,
  21435. t.prototype.flyLocalDirection = function(e) {
  21436. var t = this.getDirection(e)
  21437. , i = 1 === e.z ? .4 : .75
  21438. , n = 1 === Math.abs(e.x);
  21439. return this.flyDirection(t, i, n)
  21440. }
  21441. ,
  21442. t.prototype.flyDirection = function(e, t, i) {
  21443. this.closePopup();
  21444. var n = $.Deferred();
  21445. this.history.invalidate();
  21446. var r = this.closestPanoInDirection(e, t, i);
  21447. return r ? this.flyToPano({
  21448. pano: r
  21449. }, n.resolve.bind(n, !0)) : (this.bump(e),
  21450. n.resolve(!1)),
  21451. n.promise()
  21452. }
  21453. ,
  21454. t.prototype.closestPanoInDirection = function(e, t, i) {
  21455. return this.rankedPanoInDirection(0, e, t, i)
  21456. }
  21457. ,
  21458. t.prototype.rankedPanoInDirection = (_ = {
  21459. pano: null,
  21460. candidates: []
  21461. },
  21462. function(e, t, i, n) {
  21463. e = e || 0,
  21464. i = void 0 !== i ? i : .75;
  21465. var r = n ? "angle" : "direction";
  21466. 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)], _),
  21467. this.cachedPanoCandidates = _.candidates,
  21468. _.pano
  21469. }
  21470. ),
  21471. t.prototype.bump = function(e) {
  21472. if (this.mode === V.PANORAMA && !this.flying && !this.isWarping()) {
  21473. var t, i, n, r = k.transition, o = (r.flytimeMaxDistanceThreshold * r.flytimeDistanceMultiplier + r.flyTime) / 8, a = this.camera.getWorldDirection().dot(e);
  21474. if (.5 < Math.abs(a))
  21475. t = function() {
  21476. G.start(H.property(this.cameraControls.cameras[V.PANORAMA], "zoom", 0 < a ? 1.04 : .96), o, i, 0, z.easeInOutSine, "bumpZStart")
  21477. }
  21478. .bind(this),
  21479. i = function() {
  21480. G.start(H.property(this.cameraControls.cameras[V.PANORAMA], "zoom", 1), 5 * o, n, 0, z.easeInOutSine, "bumpZRelax")
  21481. }
  21482. .bind(this);
  21483. else {
  21484. var s = this.camera.position.clone()
  21485. , l = e.clone();
  21486. this.raycaster.set(s, l);
  21487. var c = this.model.floors.reduce(function(e, t) {
  21488. return e.concat(t.collider.children)
  21489. }, [])
  21490. , h = this.raycaster.intersectObjects(c)
  21491. , u = 0 < h.length ? h[0].distance / 25 : .04
  21492. , d = s.clone().add(l.multiplyScalar(u));
  21493. t = function() {
  21494. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, d), o, i, 0, z.easeInOutSine, "bumpTStart")
  21495. }
  21496. .bind(this),
  21497. i = function() {
  21498. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, s), 5 * o, n, 0, z.easeInOutSine, "bumpTRelax")
  21499. }
  21500. .bind(this)
  21501. }
  21502. n = function() {
  21503. this.flying = !1
  21504. }
  21505. .bind(this),
  21506. this.flying = !0,
  21507. t()
  21508. }
  21509. }
  21510. ,
  21511. t.prototype.changeFloor = function(e) {
  21512. if (!this.is360View(this.mode, this.currentPano))
  21513. if (this.mode === V.PANORAMA) {
  21514. var t = this.history.reversePano(e);
  21515. t && t.isAligned() ? this.flyToPano({
  21516. pano: t
  21517. }) : this.changeFloorByScore(e)
  21518. } else
  21519. this.model.setFloor(this.model.nextFloor(e) || this.model.currentFloor)
  21520. }
  21521. ,
  21522. t.prototype.changeFloorByScore = (E = {
  21523. pano: null,
  21524. candidates: []
  21525. },
  21526. function(e) {
  21527. var t = this.model.nextFloor(e);
  21528. 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),
  21529. void (E.pano ? (this.cachedPanoCandidates = E.candidates,
  21530. this.history.push(e, this.currentPano),
  21531. this.flyToPano({
  21532. pano: E.pano
  21533. })) : Y.warn("No pano found on selected floor, not moving there."))) : void Y.debug("player.changeFloor(" + e + "): no such floor")
  21534. }
  21535. ),
  21536. t.prototype.gotoFloor = function(e) {
  21537. var t = e - this.model.currentFloor.floorIndex;
  21538. this.changeFloor(t)
  21539. }
  21540. ,
  21541. t.prototype.getDirection = function(e) {
  21542. return (e = e || (new B.Vector3).copy(T.FORWARD)).applyQuaternion(this.camera.quaternion)
  21543. }
  21544. ,
  21545. t.prototype.flyToSameMode = function(e, t, i, n, r) {
  21546. if (r = r || $.Deferred(),
  21547. this.mode === V.TRANSITIONING)
  21548. return Y.warn("should not be transitioning here"),
  21549. n && n(!1),
  21550. r.reject().promise();
  21551. var o = i || !1
  21552. , a = i ? i.position : this.position
  21553. , s = this.position.clone()
  21554. , l = this.currentPano;
  21555. if (Y.debug("New pose in mode " + this.mode),
  21556. !e || (retryCallback = function() {
  21557. j.delayOneFrame(function() {
  21558. this.flyToSameMode(e, t, i, n, r)
  21559. }
  21560. .bind(this))
  21561. }
  21562. .bind(this),
  21563. !this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, retryCallback))) {
  21564. var c = function() {
  21565. this.emit(W.FlyingEnded, a, s, e, l),
  21566. n && n(!0)
  21567. }
  21568. .bind(this)
  21569. , h = k[this.mode]
  21570. , u = void 0 !== t ? t : h.transitionTime
  21571. , d = new B.Vector3
  21572. , p = new B.Vector3;
  21573. if (this.emit(W.FlyingStarted, a, s, e, l),
  21574. this.mode === V.PANORAMA)
  21575. Y.warn("we should not be here for panorama views");
  21576. else if (this.mode === V.DOLLHOUSE)
  21577. if (o) {
  21578. var f = new B.Vector3(0,1,0);
  21579. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(1, !0),
  21580. this.model.warpDestFloors(i.floorVisibility),
  21581. p.copy(i.position);
  21582. var g = new B.Vector3(0,0,-1).applyQuaternion(i.quaternion)
  21583. , m = new B.Raycaster(p.clone(),g.clone(),0,1 / 0).intersectObjects(this.model.colliders)
  21584. , v = 3;
  21585. m.length ? (d.copy(m[0].point),
  21586. v = .75 * p.distanceTo(d)) : (d.copy(g).multiplyScalar(3).add(p),
  21587. Y.debug("Tried to restore dollhouse mode that did not intersect...", i.position, i.quaternion));
  21588. var y = (new B.Matrix4).lookAt(p, d, f)
  21589. , A = (new B.Euler).setFromRotationMatrix(y, k.warp.eOrder)
  21590. , C = d.distanceTo(p)
  21591. , I = (new B.Matrix4).lookAt(this.cameraControls.cameras[V.DOLLHOUSE].position, this.cameraControls.controls[V.DOLLHOUSE].target, f)
  21592. , E = (new B.Euler).setFromRotationMatrix(I, k.warp.eOrder)
  21593. , _ = this.cameraControls.cameras[V.DOLLHOUSE].position.distanceTo(this.cameraControls.controls[V.DOLLHOUSE].target);
  21594. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(Math.min(_, v), !0);
  21595. var b = new B.Euler(A.x - E.x,A.y - E.y,A.z - E.z,k.warp.eOrder);
  21596. b.y = b.y > Math.PI ? b.y -= 2 * Math.PI : b.y < -Math.PI ? b.y += 2 * Math.PI : b.y,
  21597. this.path.burnsDir = Math.sign(b.y);
  21598. var w = new B.Euler(0,0,0,k.warp.eOrder)
  21599. , T = new B.Vector3;
  21600. G.start(H.vector(this.cameraControls.controls[V.DOLLHOUSE].target, d), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode),
  21601. G.start(function(e, t) {
  21602. w.x = E.x + e * b.x,
  21603. w.y = E.y + e * b.y,
  21604. w.z = E.z + e * b.z;
  21605. var i = _ + e * (C - _);
  21606. T.set(0, 0, i).applyEuler(w).add(this.cameraControls.controls[V.DOLLHOUSE].target),
  21607. this.cameraControls.cameras[V.DOLLHOUSE].position.copy(T).add(this.model.position)
  21608. }
  21609. .bind(this), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode),
  21610. G.start(function(e, t) {
  21611. this.cameraControls.controls[V.DOLLHOUSE].update(),
  21612. this.quaternion.copy(this.cameraControls.cameras[V.DOLLHOUSE].quaternion),
  21613. this.position.copy(this.cameraControls.cameras[V.DOLLHOUSE].position)
  21614. }
  21615. .bind(this), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode)
  21616. } else
  21617. Y.warn("invalid warp destination in flyToSameMode()? ignore it then");
  21618. else if (this.path.placeCpm(),
  21619. this.path.fadeInCpm(k.path.fadeInTime),
  21620. i) {
  21621. this.model.warpDestFloors(i.floorVisibility);
  21622. var x = this.cameraControls.cameras[V.FLOORPLAN]
  21623. , S = this.cameraControls.controls[V.FLOORPLAN]
  21624. , M = S.target.clone()
  21625. , R = i.position.clone().sub(M)
  21626. , P = x.position.clone().sub(S.target).length()
  21627. , O = new B.Vector3(-1,0,0).applyQuaternion(i.quaternion).normalize()
  21628. , L = Math.atan2(S.offset.x, S.offset.z)
  21629. , D = Math.atan2(O.x, O.z)
  21630. , N = S.absoluteScale
  21631. , F = U.convertWorkshopOrthoZoom(i.orthoZoom);
  21632. G.start(function(e, t) {
  21633. S.target.copy(R).multiplyScalar(e).add(M);
  21634. var i = L + (D - L) * e;
  21635. S.offset.x = P * Math.sin(i),
  21636. S.offset.z = P * Math.cos(i),
  21637. x.position.copy(S.target).add(S.offset),
  21638. S.absoluteScale = N + e * (F - N),
  21639. S.update(),
  21640. this.quaternion.copy(x.quaternion),
  21641. this.position.copy(x.position),
  21642. this.target.copy(S.target),
  21643. this.camera.projectionMatrix.copy(x.projectionMatrix)
  21644. }
  21645. .bind(this), u, null, 0, z[k.flydown.movementEasing], null, q.FlyToSameMode)
  21646. } else
  21647. Y.info("flyToSameMode() funny floorplan view? skipping");
  21648. return G.setTimeout(function(e) {
  21649. this.mode = e,
  21650. c(),
  21651. r.resolve(!0)
  21652. }
  21653. .bind(this, this.mode), u, q.FlyToSameMode),
  21654. this.mode = V.TRANSITIONING,
  21655. r.promise()
  21656. }
  21657. }
  21658. ,
  21659. t.prototype.flyToNewMode = function(e, t) {
  21660. var i = (e = e || {}).mode
  21661. , n = e.pano
  21662. , r = e.duration
  21663. , o = e.warpDest
  21664. , a = e.callback
  21665. , s = e.force
  21666. , l = e.quaternion;
  21667. if (t = t || $.Deferred(),
  21668. this.isWarping())
  21669. return Y.warn("Player.flyToNewMode() -> Cannot fly when warping"),
  21670. a && a(!1),
  21671. t.reject("Cannot change mode during tour transition").promise();
  21672. if (this.mode === V.TRANSITIONING)
  21673. return a && a(!1),
  21674. t.reject("Cannot change mode during mode transition").promise();
  21675. if (i === this.mode)
  21676. return s ? (this.flyToSameMode(n, r, o, a).done(t.resolve.bind(t)).fail(t.reject.bind(t)),
  21677. t.promise()) : (a && a(!1),
  21678. t.reject("Already in " + i + " mode").promise());
  21679. var c = o || !1;
  21680. Y.debug("Switching mode to " + i);
  21681. var h = function() {
  21682. j.delayOneFrame(function() {
  21683. this.flyToNewMode(e, t)
  21684. }
  21685. .bind(this))
  21686. }
  21687. .bind(this);
  21688. if (n && this.checkAndWaitForPanoLoad(n, "low", "low", this.basePanoSize, h))
  21689. return t.promise();
  21690. if (!this.model.meshTexturesLoaded && this.isOutsideMode(i))
  21691. return Y.info("Waiting for model textures to be loaded before going out to dollhouse"),
  21692. this.model.waitForLoad(this.model, function() {
  21693. return this.model.meshTexturesLoaded
  21694. }
  21695. .bind(this)),
  21696. this.model.loadMeshTextures().done(h),
  21697. t.promise();
  21698. this.history.invalidate(),
  21699. this.updateLastView();
  21700. var u = this.mode
  21701. , d = this.cameraControls.cameras[i];
  21702. e = x.deepExtend({}, k[i], k[u + "-" + i]);
  21703. var p = void 0 !== r ? r : e.transitionTime;
  21704. this.emit(W.ModeChanging, u, i, n),
  21705. n && (this.currentPano = n),
  21706. this.switchCameraMode(i, l),
  21707. G.cancelById(q.LookTransition);
  21708. var f = (new B.Vector3).copy(this.position);
  21709. this.modeTran = this.mode + "-" + i;
  21710. if(this.mode == "floorplan" && window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setTagVisible)){
  21711. VisiSet.finishSetPanoVisible()
  21712. VisiSet.finishSetTagVisible()
  21713. }
  21714. if(editTool.atPanel == "screen"){
  21715. if(this.mode == "panorama") $(".confirmSnap").addClass("unable")
  21716. else if(i == "panorama") $(".confirmSnap").removeClass("unable")
  21717. }
  21718. if(i == "panorama"){
  21719. this.transitionPos({type:"beforeFlyIn", pano:n, dur:p})//add
  21720. }else{
  21721. this.transitionPos({type:"beforeFlyOut", dur:p/2})//add
  21722. }
  21723. if (i === V.PANORAMA)
  21724. this.emit(W.PanoChosen, n, n),
  21725. setTimeout(function() {
  21726. n.floor.enter(i)
  21727. }
  21728. .bind(this), p / 2),
  21729. this.path.fadeOutCpm(k.path.fadeOutTime);
  21730. else if (i === V.DOLLHOUSE) {
  21731. if (c && (this.model.stayPut = !0),
  21732. o ? (this.cameraControls.controls[V.DOLLHOUSE].resetRanges(1, !0),
  21733. this.model.warpDestFloors(o.floorVisibility)) : this.model.toggleAllFloors(!0),
  21734. this.path.placeCpm(),
  21735. this.path.fadeInCpm(k.path.fadeInTime),
  21736. c) {
  21737. var g = new B.Vector3(this.model.center.x,0,this.model.center.z);
  21738. f.set(15, 10, 15);
  21739. var m = new B.Vector3(0,0,-1).applyQuaternion(o.quaternion)
  21740. , v = new B.Raycaster(o.position.clone(),m.clone(),0,1 / 0).intersectObjects([this.sceneIntersectionPlane]);
  21741. v.length ? (g.copy(v[0].point),
  21742. f.copy(o.position),
  21743. 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),
  21744. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(3, !0)),
  21745. this.cameraControls.controls[V.DOLLHOUSE].target.copy(g),
  21746. f.add(this.model.position),
  21747. d.position.copy(f),
  21748. this.cameraControls.controls[V.DOLLHOUSE].update()
  21749. }
  21750. } else if (this.path.placeCpm(),
  21751. this.path.fadeInCpm(k.path.fadeInTime),
  21752. o) {
  21753. this.model.warpDestFloors(o.floorVisibility);
  21754. var y = this.cameraControls.cameras[V.FLOORPLAN]
  21755. , A = this.cameraControls.controls[V.FLOORPLAN]
  21756. , C = y.position.clone().sub(A.target)
  21757. , I = new B.Vector3(-1,0,0).applyQuaternion(o.quaternion).normalize()
  21758. , E = Math.atan2(I.x, I.z);
  21759. A.target.copy(o.position);
  21760. var _ = C.length();
  21761. A.offset.x = _ * Math.sin(E),
  21762. A.offset.y = 0,
  21763. A.offset.z = _ * Math.cos(E),
  21764. y.position.copy(A.target).add(A.offset),
  21765. A.target.clone().sub(d.position),
  21766. d.quaternion.copy(o.quaternion),
  21767. A.currentScale = U.convertWorkshopOrthoZoom(o.orthoZoom),
  21768. A.absoluteScale = A.currentScale,
  21769. A.update()
  21770. } else
  21771. this.model.currentFloor.enter(i);
  21772. var b = this.currentPano
  21773. , w = this.position.clone();
  21774. return this.emit(W.FlyingStarted, f, w, n, this.currentPano),
  21775. this.flying = !0,
  21776. this.isOutsideMode(i) && this.is360View(u, b) ? (c || i !== V.DOLLHOUSE || (d.position.set(15, 10, 15),
  21777. d.controls.target.set(this.model.center.x, 0, this.model.center.z),
  21778. d.controls.update()),
  21779. e.blackoutStyle = P.FADEIN,
  21780. p = k.show360Views.transitionTime,
  21781. this.fade360View(p, d, e)) : this.isOutsideMode(u) && this.is360View(i, n) ? (c && this.switchCameraMode(i, c.quaternion),
  21782. this.mode = i,
  21783. this.path && this.path.popOutCpm(),
  21784. e.blackoutStyle = P.END,
  21785. p = k.show360Views.transitionTime,
  21786. this.fade360View(p, d, e)) : (G.start(H.property(this.model, "alpha", e.modelAlpha, null), p * e.modelAlphaLength, null, e.modelAlphaDelay, null, q.FlyToNewMode),
  21787. G.start(H.vector(this.position, d.position), p, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToNewMode),
  21788. G.start(H.quaternion(this.quaternion, d.quaternion), p * e.rotationDuration, null, e.rotationDelay, z[k.flydown.rotationEasing], null, q.FlyToNewMode),
  21789. G.start(H.matrix4(this.camera.projectionMatrix, d.projectionMatrix), p * e.cameraMatrixDuration, null, e.cameraMatrixDelay, e.cameraMatrixEase, null, q.FlyToNewMode),
  21790. G.start(H.uniform(this.model.skybox, "opacity", e.skyboxOpacity), p * e.skyboxOpacityLength, null, e.skyboxOpacityDelay, null, q.FlyToNewMode),
  21791. G.start(H.property(this.reticule.material.uniforms.opacity, "value", 0), p, null, q.FlyToNewMode)),
  21792. G.setTimeout(function() {
  21793. this.flying = !1,
  21794. u === V.PANORAMA && i !== V.PANORAMA ? this.currentPano.exit() : u !== V.PANORAMA && i === V.PANORAMA && (this.currentPano !== b && b.exit(),
  21795. this.currentPano.enter(),
  21796. this.path.placeCpm(),
  21797. this.path.fadeOutCpm(k.path.fadeOutTime),
  21798. this.spider.draw()),
  21799. u === V.DOLLHOUSE && this.cameraControls.controls[V.DOLLHOUSE].resetRanges(),
  21800. this.mode = i,
  21801. this.emit(W.FlyingEnded, f, w, this.currentPano, b)
  21802. if (this.afterCModeFuc) {
  21803. //手动加的函数
  21804. var cf = this.afterCModeFuc;
  21805. this.afterCModeFuc = null;//因为可能在执行afterCModeFuc时需要再添加afterCModeFuc所以要置空的话提前
  21806. cf();
  21807. }
  21808. this.updateMarkerVisi();//add
  21809. (u === V.PANORAMA || i == V.PANORAMA) && this.updateHotVisible()//add
  21810. if(this.mode == "panorama" && EditOverlay.editing){
  21811. EditOverlay.updatePano(this.currentPano)
  21812. }
  21813. //this.mode == u.PANORAMA && this.transitionPos({type:"flyDone", this.currentPano})//add
  21814. c && u !== V.PANORAMA && i === V.PANORAMA ? this.startWarp(M.Retain, S.Retain, R.BLACK, null, null, a) : (a && a(),
  21815. t.resolve())
  21816. }
  21817. .bind(this), p, q.FlyToNewMode),
  21818. this.mode = V.TRANSITIONING,
  21819. t.promise()
  21820. }
  21821. ,
  21822. t.prototype.fade360View = function(e, t, i) {
  21823. this.tagManager.hideShowTagsForBlackoutStyle(i.blackoutStyle, e),
  21824. $(this.domElement).fadeOut(.5 * e, function() {
  21825. this.model.skybox.material.uniforms.opacity.value = i.skyboxOpacity,
  21826. this.model.alpha = i.modelAlpha,
  21827. this.position.copy(t.position),
  21828. this.quaternion.copy(t.quaternion),
  21829. this.camera.projectionMatrix.copy(t.projectionMatrix),
  21830. $(this.domElement).fadeIn(.5 * e)
  21831. }
  21832. .bind(this))
  21833. }
  21834. ,
  21835. t.prototype.findDefaultViews = function() {
  21836. this.findDefaultView(this.lastInsideView, !0),
  21837. this.findDefaultView(this.last360View, !1)
  21838. }
  21839. ,
  21840. t.prototype.findDefaultView = function(e, i) {
  21841. var t, n = this.model.heroLocations, r = this.model.panos, o = n.findIndex(function(e) {
  21842. if (e.cameraMode !== V.PANORAMA)
  21843. return !1;
  21844. var t = r.get(e.panoId);
  21845. return t && t.isAligned() === i
  21846. });
  21847. 0 <= o ? (t = r.get(n[o].panoId),
  21848. e.update({
  21849. cameraMode: V.PANORAMA,
  21850. pano: t,
  21851. position: n[o].position,
  21852. quaternion: n[o].quaternion
  21853. })) : 0 <= (o = r.list.findIndex(function(e) {
  21854. return e.isAligned() === i
  21855. })) ? (t = r.list[o],
  21856. e.update({
  21857. cameraMode: V.PANORAMA,
  21858. pano: t,
  21859. position: t.position
  21860. })) : Y.warn("There are no", i ? "inside" : "360º", "views in this model")
  21861. }
  21862. ,
  21863. t.prototype.updateLastView = function() {
  21864. this.mode === V.PANORAMA && (this.currentPano.isAligned() ? this.lastInsideView : this.last360View).update({
  21865. pano: this.currentPano,
  21866. position: this.position,
  21867. quaternion: this.quaternion
  21868. })
  21869. }
  21870. ,
  21871. t.prototype.goToLastView = function(e, t) {
  21872. var i = $.Deferred()
  21873. , n = i.resolve.bind(i)
  21874. , r = i.reject.bind(i)
  21875. , o = e ? this.lastInsideView : this.last360View;
  21876. return this.isInMode(V.PANORAMA) && this.currentPano.isAligned() !== e && this.updateLastView(),
  21877. this.isInMode(V.PANORAMA) ? (this.path && this.path.popOutCpm(),
  21878. this.fadeToView(e, o, k.show360Views.transitionTime, t).done(n).fail(r)) : this.isOutsideMode() && this.flyToNewMode({
  21879. mode: o.cameraMode,
  21880. pano: o.pano,
  21881. quaternion: o.quaternion,
  21882. callback: t
  21883. }).done(n).fail(r),
  21884. i.promise()
  21885. }
  21886. ,
  21887. t.prototype.fadeToView = function(e, t, i, n) {
  21888. var r = $.Deferred()
  21889. , o = r.resolve.bind(r)
  21890. , a = r.reject.bind(r);
  21891. if (!t.isValid() || t.cameraMode === V.PANORAMA && !t.pano)
  21892. return Y.warn("Tried to fade to an illegal view", t.cameraMode),
  21893. a("Cannot go to illegal view"),
  21894. r.promise();
  21895. var s = (k[t.cameraMode],
  21896. function() {
  21897. $(this.domElement).fadeIn(.5 * i),
  21898. n && n(),
  21899. o()
  21900. }
  21901. .bind(this))
  21902. , l = e ? P.FADEIN : P.END;
  21903. return this.tagManager.hideShowTagsForBlackoutStyle(l, i),
  21904. $(this.domElement).fadeOut(.5 * i, function() {
  21905. this.model.fadePanoMarkers(e ? k.panorama.markerOpacity : 0),
  21906. t.cameraMode === V.PANORAMA ? this.flyToPano({
  21907. pano: t.pano,
  21908. lookAtPoint: T.FORWARD.clone().applyQuaternion(t.quaternion).add(t.pano.position),
  21909. duration: 0
  21910. }, s) : this.flyToNewMode({
  21911. mode: t.cameraMode,
  21912. quaternion: t.quaternion,
  21913. duration: 0,
  21914. callback: s
  21915. })
  21916. }
  21917. .bind(this)),
  21918. r.promise()
  21919. }
  21920. ,
  21921. t.prototype.startWarp = function(e, t, i, n, r, o) {
  21922. if (this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !1),
  21923. this.flying)
  21924. return Y.warn("Player.startWarp() -> Cannot warp when flying"),
  21925. o && o(),
  21926. !1;
  21927. null != e || (e = M.Show),
  21928. this.history.invalidate(),
  21929. e !== M.Retain ? this.path.brushToWarpPano(i, R.BLACK) || (i = R.BLACK) : i = this.path.upcomingTransType;
  21930. var a = this.path.warpDestPano && !this.path.warpDestPano.isAligned();
  21931. return this.emit(W.WarpStarted, a, i, n, r),
  21932. n = n || P.MIDDLE,
  21933. this.path.warpToPano(i, n, r, function() {
  21934. t === S.Slow ? this.path.discardSlow() : t === S.Standard && this.path.discardPathObject(),
  21935. this.emit(W.WarpEnded, i),
  21936. this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !0),
  21937. o && o()
  21938. }
  21939. .bind(this)),
  21940. e === M.Hide && this.path.discardPathObject(),
  21941. !0
  21942. }
  21943. ,
  21944. t.prototype.warpToPanoById = function(e, t, i, n, r, o, a, s) {
  21945. return this.path.setWarpDestinationByPanoId(e, t) ? this.startWarp(i, n, r, o, a, s) : (Y.warn("Player.warpToPanoById() -> Could not setWarpDestinationByPanoId()"),
  21946. s && s(),
  21947. !1)
  21948. }
  21949. ,
  21950. t.prototype.warpToPanoByHeroIndex = function(e, t, i, n, r, o, a) {
  21951. return this.path.setWarpDestinationByHeroIndex(e) ? this.startWarp(t, i, n, r, o, a) : (Y.warn("Player.warpToPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  21952. a && a(),
  21953. !1)
  21954. }
  21955. ,
  21956. t.prototype.warpToPano = function(e, t, i, n, r, o, a, s) {
  21957. return this.warpToPanoById(e.id, t, i, n, r, o, a, s)
  21958. }
  21959. ,
  21960. t.prototype.warpToNonPanoByHeroIndex = function(e, t) {
  21961. return this.path.setWarpDestinationByHeroIndex(e) ? (this.path.warpToNonPano(t),
  21962. !0) : (Y.warn("Player.warpToNonPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  21963. t && t(),
  21964. !1)
  21965. }
  21966. ,
  21967. t.prototype.aimTourCamera = function(e, t, i, n) {
  21968. return Y.debug("player.aimTourCamera(" + e + ") calling warpToPanoByHeroIndex(" + e + ")"),
  21969. this.warpToPanoByHeroIndex(e, t, i, null, null, null, n)
  21970. }
  21971. ,
  21972. t.prototype.showPathToHeroLocation = function(e) {
  21973. this.path.setWarpDestinationByHeroIndex(e) && this.path.brushToWarpPano(R.STD, R.BLACK)
  21974. }
  21975. ,
  21976. t.prototype.tourInterlude = function(e, t) {
  21977. this.history.invalidate(),
  21978. this.path.discardSlow();
  21979. var i = g_data2.tourAudio && g_data2.tourAudio[this.model.heroLocations[this.director.currentItem].sid]
  21980. , n = g_tourAudio ? 1e3 * g_tourAudio.currentTime : 0
  21981. , r = i && i.music ? i.time - n : 2e3;
  21982. this.path.waitNextStep(e, function() {
  21983. t && t()
  21984. }
  21985. .bind(this), r)
  21986. }
  21987. ,
  21988. t.prototype.stopInterlude = function() {
  21989. this.interruptAndFastForward(null, 0)
  21990. }
  21991. ,
  21992. t.prototype.interruptAndFastForward = function(e, t) {
  21993. this.isWarping() && this.emit(W.WarpInterrupted, this.path.activeTransType, e, t),
  21994. this.flying && this.emit(W.FlyingInterrupted),
  21995. this.path.interruptAndFastForward(e, t)
  21996. }
  21997. ,
  21998. t.prototype.setSize = function(e, t) {
  21999. var i = e / t;
  22000. this.baseFov = A.clampVFOV(k.insideFOV, k.insideFOVMax, e, t);
  22001. var n = A.getHFOVFromVFOV(k.insideFOV, e, t);
  22002. for (var r in n > k.insideFOVMax ? this.baseFov = A.getVFOVFromHFOV(k.insideFOVMax, e, t) : this.baseFov = k.insideFOV,
  22003. this.cameraControls.cameras) {
  22004. var o = this.cameraControls.cameras[r];
  22005. o.fov = this.baseFov * (1 / this.zoomLevel),
  22006. o.updateAspect(i)
  22007. }
  22008. }
  22009. ,
  22010. t.prototype.toJSON = function() {
  22011. var e = {};
  22012. return this.cameraControls.activeControl && ((e = this.cameraControls.activeControl.toJSON()).camera_mode = V.toInt(this.mode),
  22013. this.isOutsideMode() ? this.model.allFloorsVisible ? e.floor_visibility = [] : e.floor_visibility = this.model.floors.list.map(function(e) {
  22014. return e.hidden ? 0 : 1
  22015. }) : V.PANORAMA && (e.scan_id = this.currentPano.id)),
  22016. e
  22017. }
  22018. ,
  22019. t.prototype.getCurrentNodePanos = function(e) {
  22020. if (this.model.panos.map,
  22021. e.length = 0,
  22022. this.path.nodes)
  22023. for (var t = 0; t < this.path.nodes.length; t++) {
  22024. var i = this.path.nodes[t];
  22025. e.push(this.model.panos.get(i))
  22026. }
  22027. }
  22028. ,
  22029. t.prototype.zoomIncrementally = function(e) {
  22030. var t = this.zoomLevel;
  22031. this.zoomTo(this.zoomLevel + e),
  22032. t !== this.zoomLevel && this.currentPano && this.zoomStats.addZoomAction(t, this.zoomLevel, this.currentPano.id)
  22033. }
  22034. ,
  22035. t.prototype.zoomInIncrementally = function(e) {
  22036. e = e || this.defaultZoomIncrement,
  22037. this.zoomIncrementally(e)
  22038. }
  22039. ,
  22040. t.prototype.zoomOutIncrementally = function(e) {
  22041. e = e || -this.defaultZoomIncrement,
  22042. this.zoomIncrementally(e)
  22043. }
  22044. ,
  22045. t.prototype.zoomBy = function(e) {
  22046. this.zoomTo(this.zoomLevel * e)
  22047. }
  22048. ,
  22049. t.prototype.zoomIn = function() {
  22050. this.zoomBy(1 + this.zoomSpeed)
  22051. }
  22052. ,
  22053. t.prototype.zoomOut = function() {
  22054. this.zoomBy(1 - this.zoomSpeed)
  22055. }
  22056. ,
  22057. t.prototype.zoomTo = function(e, t) {
  22058. if ((t || k.zoom.enabled && this.mode === V.PANORAMA && this.zoomEnabled) && (e < k.zoom.min && (e = k.zoom.min),
  22059. e > k.zoom.max && (e = k.zoom.max),
  22060. e > this.zoomLevel ? (this.emit(m.ZoomIn),
  22061. e === k.zoom.max && this.emit(m.ZoomMax)) : e < this.zoomLevel && (this.emit(m.ZoomOut),
  22062. e === k.zoom.min && this.emit(m.ZoomMin)),
  22063. this.cameraControls.activeControl)) {
  22064. var i = this.cameraControls.activeControl.camera;
  22065. this.zoomLevel = e,
  22066. i.fov = this.baseFov * (1 / this.zoomLevel),
  22067. i.updateProjectionMatrix(),
  22068. this.zoomFov = i.fov
  22069. }
  22070. }
  22071. ,
  22072. t.prototype.increaseZoomSpeed = function() {
  22073. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed + this.zoomSpeedAdjust)
  22074. }
  22075. ,
  22076. t.prototype.decreaseZoomSpeed = function() {
  22077. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed - this.zoomSpeedAdjust)
  22078. }
  22079. ,
  22080. t.prototype.clampZoomSpeed = function(e) {
  22081. return e < 0 ? 0 : e
  22082. }
  22083. ,
  22084. t.prototype.activatePersistentZooming = function(e) {
  22085. this.zooming = e ? 1 : -1
  22086. }
  22087. ,
  22088. t.prototype.deactivatePersistentZooming = function() {
  22089. this.zooming = 0
  22090. }
  22091. ,
  22092. t.prototype.zoomDefault = function() {
  22093. this.zoomTo(1, !0)
  22094. }
  22095. ,
  22096. t.prototype.smoothZoomToDefault = function(e, t) {
  22097. var i, n = this.zoomLevel, r = function(e) {
  22098. 1 < e && (e = 1),
  22099. i = n * (1 - e) + e,
  22100. this.zoomTo(i, !0)
  22101. }
  22102. .bind(this), o = function() {
  22103. this.zoomDefault(),
  22104. t && window.setTimeout(t, 50)
  22105. }
  22106. .bind(this);
  22107. G.start(r, e, o, null, 0, z[k.transition.blendEasing])
  22108. }
  22109. ,
  22110. t.prototype.updateZoomPano = function() {
  22111. if (!this.panoRenderer.zoomPanoRenderingDisabled && this.mode === V.PANORAMA) {
  22112. var e = this.currentPano;
  22113. if (e) {
  22114. var t = this.zoomLevel > k.zoom.activationThreshold
  22115. , i = (this.flying && this.nextPano && this.nextPano !== this.currentPano || this.isWarping(),
  22116. t);
  22117. this.tileDownloader.tilePrioritizer.setZoomingActive(i),
  22118. this.panoRenderer.setZoomingActive(i, e, !0);
  22119. var n = function(e, t) {
  22120. this.panoRenderer.resetRenderStatus(e.id, !1, !0, this.qualityManager.getMaxNavPanoSize()),
  22121. this.panoRenderer.clearAllQueuedUploadsForPano(e.id),
  22122. this.panoRenderer.renderPanoTiles(e.id, null, !1, !1),
  22123. e.setZoomed(t)
  22124. }
  22125. .bind(this);
  22126. i && !e.zoomed ? (n(e, !0),
  22127. this.panoRenderer.enableUltraHighQualityMode(function() {
  22128. this.qualityManager.useUltraHighResolutionPanos && !k.zoom.overridemax && (k.zoom.max = y.ultraHighQualityMaxZoom),
  22129. i && n(e, !0)
  22130. }
  22131. .bind(this))) : !t && e.zoomed && n(e, !1)
  22132. }
  22133. }
  22134. },
  22135. //--------
  22136. t.prototype.flyToMode = function(mode, f1){ //飞到某个模式后再执行f1函数
  22137. var f2;
  22138. if (this.mode == mode) {
  22139. f1 && f1()
  22140. } else {
  22141. f2 = f1;
  22142. if (this.mode == "transitioning" && this.modeTran.split('-')[1] != mode) {//正飞向其他模式,就要先飞完再飞进来然后执行
  22143. this.afterCModeFuc = function() {
  22144. this.afterCModeFuc = f2
  22145. this.flyToNewMode({mode:mode, pano: mode == "panorama" && this.currentPano });
  22146. }.bind(this)
  22147. } else {
  22148. this.afterCModeFuc = f2;//飞入后执行
  22149. try{ //在场景刚开始加载 control还没建好时这句可能会报错所以用try。 不用callback而用 afterCModeFuc也是这个原因,因为会有别的函数可以飞入然后执行它
  22150. this.flyToNewMode({mode:mode, pano: mode == "panorama" && this.currentPano});
  22151. }catch(e){}
  22152. }
  22153. }
  22154. }
  22155. ,
  22156. t.prototype.checkHasNeighbor = function(pano){//add
  22157. for(var i in pano.neighbourPanos ){
  22158. if(i == pano.id)continue;
  22159. if(pano.neighbourPanos[i]){
  22160. return true;
  22161. }
  22162. }
  22163. }
  22164. ,
  22165. ee.exports = t
  22166. }
  22167. ).call(this, "/js/player.js")
  22168. }
  22169. , {
  22170. "./constants": 8,
  22171. "./enum/AlignmentType": 17,
  22172. "./enum/BlackoutStyle": 18,
  22173. "./enum/ControlEvents": 21,
  22174. "./enum/Keys": 30,
  22175. "./enum/ModelManagerEvents": 33,
  22176. "./enum/PanoSizeClass": 36,
  22177. "./enum/PanoramaEvents": 37,
  22178. "./enum/PathDiscardMode": 38,
  22179. "./enum/PathDisplayMode": 39,
  22180. "./enum/PlayerEvents": 40,
  22181. "./enum/TagStates": 44,
  22182. "./enum/Vectors": 50,
  22183. "./enum/Viewmode": 51,
  22184. "./enum/WarpStyle": 52,
  22185. "./enum/ZoomEvents": 53,
  22186. "./exception/BasicException": 55,
  22187. "./model/ModelManager": 140,
  22188. "./objects/NSpider": 147,
  22189. "./objects/Panorama": 148,
  22190. "./objects/Reticule": 149,
  22191. "./objects/ShowPath": 151,
  22192. "./objects/Snapshot": 153,
  22193. "./objects/View": 154,
  22194. "./settings": 166,
  22195. "./shaders": 167,
  22196. "./tile/TileDownloader": 171,
  22197. "./tile/TilePrioritizer": 172,
  22198. "./util/ZoomStats": 179,
  22199. "./util/browser": 182,
  22200. "./util/camera": 183,
  22201. "./util/cameraLight": 184,
  22202. "./util/common": 185,
  22203. "./util/easing": 186,
  22204. "./util/history": 187,
  22205. "./util/lerp": 188,
  22206. "./util/logger": 189,
  22207. "./util/math": 190,
  22208. "./util/transitions": 195,
  22209. hot: "hot",
  22210. scaleImg: "scaleImg",
  22211. events: 202,
  22212. three: 217
  22213. }],
  22214. scaleImg: [function(e, t) {
  22215. var i = t;
  22216. (function() {
  22217. function e(e, t, i, n) {
  22218. function r() {
  22219. (U = "object" == typeof i ? i : t.src || n ? s : document.createElement("canvas")).width = d,
  22220. U.height = p,
  22221. H = U.getContext("2d")
  22222. }
  22223. function o(e) {
  22224. if (e) {
  22225. var t, i = H.getImageData(0, 0, d, p), n = i.data;
  22226. for (t = 0; t < ie; t += 4)
  22227. n[t] = e[t] * ne | 0,
  22228. n[t + 1] = e[t + 1] * ne | 0,
  22229. n[t + 2] = e[t + 2] * ne | 0,
  22230. n[t + 3] = e[t + 3] * ne | 0;
  22231. return delete e,
  22232. i
  22233. }
  22234. return H.getImageData(0, 0, d, p)
  22235. }
  22236. function a(e, t, i, n, r) {
  22237. return .5 * (n - t + (2 * t - 5 * i + 4 * n - r + (3 * (i - n) + r - t) * e) * e) * e + i
  22238. }
  22239. var s, l;
  22240. if (t || (t = e.input,
  22241. i = e.output,
  22242. n = e.inputRemovable,
  22243. e.scale && (e = e.scale)),
  22244. t.src)
  22245. if (s = document.createElement("canvas"),
  22246. null != t.naturalWidth)
  22247. s.width = t.naturalWidth,
  22248. s.height = t.naturalHeight;
  22249. else if (null != t.runtimeStyle) {
  22250. var c = t.runtimeStyle
  22251. , h = c.width
  22252. , u = c.height;
  22253. c.width = "auto",
  22254. c.height = "auto",
  22255. s.width = t.width,
  22256. s.height = t.height,
  22257. c.width = h,
  22258. c.height = u
  22259. } else {
  22260. h = t.width,
  22261. u = t.height;
  22262. t.removeAttribute && (t.removeAttribute("width"),
  22263. t.removeAttribute("height")),
  22264. s.width = t.width,
  22265. s.height = t.height,
  22266. t.width = h,
  22267. t.height = u
  22268. }
  22269. else
  22270. s = t;
  22271. l = s.getContext("2d"),
  22272. t.src && l.drawImage(t, 0, 0);
  22273. var d, p, f = s.width, g = s.height, m = l.getImageData(0, 0, f, g).data;
  22274. if (!f || !g)
  22275. return !1;
  22276. (t.src || n) && s.clearRect(0, 0, f, g),
  22277. p = "object" == typeof e ? e.width ? (d = e.width + .5 | 0,
  22278. e.height + .5 | 0) : (d = f * e.scaleX + .5 | 0,
  22279. g * e.scaleY + .5 | 0) : (d = e * f + .5 | 0,
  22280. e * g + .5 | 0);
  22281. 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;
  22282. if (1 < re || 1 < oe)
  22283. for (r(),
  22284. G = (z = o()).data,
  22285. C = 0; C < p; C++)
  22286. for (V = (y = C / oe) - (w = 0 | y),
  22287. j = w * $,
  22288. W = w < 1 ? j : j - $,
  22289. w < g - 2 ? (Y = j + $,
  22290. q = (2 + w) * $) : Y = q = g - 2 < w ? j : j + $,
  22291. A = 0; A < d; A++,
  22292. te += 4)
  22293. Z = (b = 0 | (v = A / re)) << 2,
  22294. b < f - 2 ? (K = Z + 4,
  22295. Q = Z + 8) : K = Q = f - 2 < b ? Z : Z + 4,
  22296. 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,
  22297. ++Z,
  22298. ++K,
  22299. ++Q,
  22300. 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,
  22301. ++Z,
  22302. ++K,
  22303. ++Q,
  22304. 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,
  22305. ++Z,
  22306. ++K,
  22307. ++Q,
  22308. 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,
  22309. G[te] = 0 <= D ? D < 256 ? D : 255 : 0,
  22310. G[te + 1] = 0 <= F ? F < 256 ? F : 255 : 0,
  22311. G[te + 2] = 0 <= B ? B < 256 ? B : 255 : 0,
  22312. G[te + 3] = 0 <= N ? N < 256 ? N : 255 : 0;
  22313. else {
  22314. if (le.Float32Array)
  22315. L = new Float32Array(ie);
  22316. else
  22317. for (L = [],
  22318. te = 0; te < ie; ++te)
  22319. L[te] = 0;
  22320. for (y = 0; y < g; y++)
  22321. for (I = (_ = 0 | (C = y * oe)) * J,
  22322. (O = !!((_ - (C + oe | 0)) * (g - 1 - y)) << 1) && (M = 1 + _ - C,
  22323. R = C + oe - _ - 1),
  22324. v = 0; v < f; v++,
  22325. ee += 4)
  22326. switch (A = v * re,
  22327. E = 0 | A,
  22328. te = I + (E << 2),
  22329. P = !!((E - (A + re | 0)) * (f - 1 - v)),
  22330. P && (x = 1 + E - A,
  22331. S = A + re - E - 1),
  22332. D = m[ee],
  22333. F = m[ee + 1],
  22334. B = m[ee + 2],
  22335. N = m[ee + 3],
  22336. P + O) {
  22337. case 0:
  22338. L[te] += D * ae,
  22339. L[te + 1] += F * ae,
  22340. L[te + 2] += B * ae,
  22341. L[te + 3] += N * ae;
  22342. break;
  22343. case 1:
  22344. T = x * oe,
  22345. L[te] += D * T,
  22346. L[te + 1] += F * T,
  22347. L[te + 2] += B * T,
  22348. L[te + 3] += N * T,
  22349. T = S * oe,
  22350. L[te + 4] += D * T,
  22351. L[te + 5] += F * T,
  22352. L[te + 6] += B * T,
  22353. L[te + 7] += N * T;
  22354. break;
  22355. case 2:
  22356. T = re * M,
  22357. L[te] += D * T,
  22358. L[te + 1] += F * T,
  22359. L[te + 2] += B * T,
  22360. L[te + 3] += N * T,
  22361. T = re * R,
  22362. L[te += J] += D * T,
  22363. L[te + 1] += F * T,
  22364. L[te + 2] += B * T,
  22365. L[te + 3] += N * T;
  22366. break;
  22367. default:
  22368. T = x * M,
  22369. L[te] += D * T,
  22370. L[te + 1] += F * T,
  22371. L[te + 2] += B * T,
  22372. L[te + 3] += N * T,
  22373. T = S * M,
  22374. L[te + 4] += D * T,
  22375. L[te + 5] += F * T,
  22376. L[te + 6] += B * T,
  22377. L[te + 7] += N * T,
  22378. T = x * R,
  22379. L[te += J] += D * T,
  22380. L[te + 1] += F * T,
  22381. L[te + 2] += B * T,
  22382. L[te + 3] += N * T,
  22383. T = S * R,
  22384. L[te + 4] += D * T,
  22385. L[te + 5] += F * T,
  22386. L[te + 6] += B * T,
  22387. L[te + 7] += N * T
  22388. }
  22389. delete m,
  22390. r(),
  22391. z = o(L)
  22392. }
  22393. if (H.putImageData(z, 0, 0),
  22394. "string" == typeof i) {
  22395. var se;
  22396. if ("png" === i || "jpeg" === i)
  22397. return (se = n && t.src ? t : new Image).width = d,
  22398. se.height = p,
  22399. se.src = U.toDataURL("image/" + i, .85),
  22400. se;
  22401. if ("png-src" === i || "jpeg-src" === i)
  22402. return U.toDataURL("image/" + i.split("-")[0], .85)
  22403. }
  22404. return U
  22405. }
  22406. var le = this;
  22407. "undefined" != typeof exports ? ("undefined" != typeof module && module.exports && (exports = module.exports = e),
  22408. exports.scale = e) : c = e
  22409. }
  22410. ).call(this),
  22411. i.exports = c
  22412. }
  22413. , {}],
  22414. 156: [function(i, n, e) {
  22415. (function(e) {
  22416. "use strict";
  22417. function t(e, t) {
  22418. this.model = e,
  22419. this.panos = e.panos,
  22420. this.player = t,
  22421. this.imagePanos = this.listImagePanos(),
  22422. this.retryMinimumTime = 1e4
  22423. }
  22424. var r = (i("three"),
  22425. i("./enum/Viewmode"))
  22426. , o = (i("./settings"),
  22427. i("./objects/Panorama"))
  22428. , a = new (i("./util/logger"))(e);
  22429. t.prototype.start = function() {
  22430. this.loadNextPano(function(e) {
  22431. e ? this.start() : (a.debug("No suitable pano loaded, waiting a little while before looking again"),
  22432. setTimeout(function() {
  22433. this.start()
  22434. }
  22435. .bind(this), 1e3))
  22436. }
  22437. .bind(this))
  22438. }
  22439. ,
  22440. t.prototype.validLoadTarget = function(e) {
  22441. return e && !e.isLoaded("high") && Date.now() - e.failedLoadingAt > this.retryMinimumTime
  22442. }
  22443. ,
  22444. t.prototype.listImagePanos = function() {
  22445. var i = []
  22446. , n = this;
  22447. return this.model.images.forEach(function(e) {
  22448. if (e.metadata && e.metadata.scan_id) {
  22449. var t = n.model.panos.get(e.metadata.scan_id);
  22450. t && !t.isLoaded("high") && i.push(t)
  22451. }
  22452. }),
  22453. i
  22454. }
  22455. ,
  22456. t.prototype.nextNotLoadedImage = function() {
  22457. for (; 0 < this.imagePanos.length; ) {
  22458. var e = this.imagePanos[0];
  22459. if (!e.isLoaded("high"))
  22460. return e;
  22461. this.imagePanos.shift()
  22462. }
  22463. return null
  22464. }
  22465. ,
  22466. t.prototype.loadNextPano = function(e) {
  22467. var t, i, n = this.model.waitQueue.filter(function(e) {
  22468. return e.object instanceof o
  22469. });
  22470. 0 < n.length ? (t = n[0].object,
  22471. a.debug("Overrode pano selection: Flying to an unloaded pano " + t.id)) : this.validLoadTarget(this.player.currentPano) ? (t = this.player.currentPano,
  22472. a.debug("Overrode pano selection: Currently at an unloaded pano " + t.id)) : this.validLoadTarget(this.player.closestPano) ? (t = this.player.closestPano,
  22473. a.debug("Overrode pano selection: Hovering over an unloaded pano " + t.id)) : this.validLoadTarget(this.nextNotLoadedImage()) ? (i = "high",
  22474. t = this.imagePanos[0],
  22475. 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),
  22476. t ? (i = i || t.isLoaded("low") ? "high" : "low",
  22477. a.debug("Preloading " + i + "-res pano " + t.id),
  22478. t.loadCube(i).done(e).fail(function() {
  22479. a.warn("Failed preloading pano", t.id, ", marking it as failed and forgetting it for a while"),
  22480. e()
  22481. })) : e && e(null)
  22482. }
  22483. ,
  22484. n.exports = t
  22485. }
  22486. ).call(this, "/js/preloaders.js")
  22487. }
  22488. , {
  22489. "./enum/Viewmode": 51,
  22490. "./objects/Panorama": 148,
  22491. "./settings": 166,
  22492. "./util/logger": 189,
  22493. three: 217
  22494. }],
  22495. 157: [function(a, s, e) {
  22496. (function(e) {
  22497. "use strict";
  22498. function t(e, t, i, n, r) {
  22499. this.qualityManager = e,
  22500. this.scene = t,
  22501. this.camera = i,
  22502. this.container = r,
  22503. this.controls = n,
  22504. this.controls.enabled = !0,
  22505. this.controls.locked = !0,
  22506. this.quickstartCamera = n.camera,
  22507. this.quickstartCamera.fov = d.clampVFOV(o.insideFOV, o.insideFOVMax, $("#player").width(), $("#player").height()),
  22508. this.skybox = null
  22509. }
  22510. var i = a("three")
  22511. , n = a("../util/logger")
  22512. , o = a("../constants")
  22513. , h = (a("../util/transitions"),
  22514. a("../util/lerp"),
  22515. a("../util/easing"),
  22516. a("../enum/Vectors"))
  22517. , u = a("../enum/PanoSizeClass")
  22518. , r = (a("../materials/ModelTextureMaterial"),
  22519. a("../materials/CubemapMaterial"))
  22520. , d = (a("../cameras/PanoramaCamera"),
  22521. a("../controls/PanoramaControls"),
  22522. a("../tile/TileUtils"),
  22523. a("../util/camera"),
  22524. a("../util/cameraLight"))
  22525. , p = (a("../util/browser"),
  22526. a("../settings"),
  22527. a("../gui/helpManager"),
  22528. new n(e));
  22529. t.prototype.load = function(e) {
  22530. e.pano.shouldRedrawOnBaseLoaded = !0;
  22531. var t, i, n = this, r = h.FORWARD.clone().applyQuaternion(e.quaternion), o = r.clone().negate();
  22532. this.controls.lookAt(r.add(this.quickstartCamera.position));
  22533. var a = this.qualityManager.getPanoSize(u.BASE)
  22534. , s = this.qualityManager.getPanoSize(u.STANDARD);
  22535. if (e.pano.tiled) {
  22536. p.warn("Loading startPano, TILED", e.pano.id);
  22537. var l = d.getHFOVForCamera(this.quickstartCamera, $("#player").width(), $("#player").height())
  22538. , c = this.quickstartCamera.fov;
  22539. p.warn("Quickstart loading tiles in frustum: [horizontal FOV: " + l + ", vertical FOV: " + c + "]"),
  22540. t = e.pano.loadTiledPano(s, r, {
  22541. hFov: l,
  22542. vFov: c
  22543. }, !1, !1, !0),
  22544. i = e.pano.loadTiledPano(a, o, null, !1, !1, !0)
  22545. } else
  22546. p.warn("Loading startPano", e.pano.id),
  22547. t = e.pano.loadCube("high");
  22548. return $.when(t).then(function() {
  22549. n.init(e.pano, e.quaternion),
  22550. e.pano.tiled ? i.done(function() {
  22551. e.pano.lockUntilRenderingComplete = !1,
  22552. this.controls.locked = !1
  22553. }
  22554. .bind(this)) : this.controls.locked = !1
  22555. }
  22556. .bind(this))
  22557. }
  22558. ,
  22559. t.prototype.init = function(e, t) {
  22560. p.info("Quickstart done loading, adding scene objects"),
  22561. e.lockUntilRenderingComplete = !0,
  22562. this.skybox = new i.Mesh(new i.CubeGeometry(1,1,1),new r({
  22563. side: i.BackSide
  22564. })),
  22565. this.skybox.material.uniforms.map.value = e.getSkyboxTexture(),
  22566. this.skybox.quaternion.copy(e.quaternion),
  22567. this.scene.add(this.skybox),
  22568. $(this.container).show()
  22569. }
  22570. ,
  22571. t.prototype.update = function(e) {
  22572. this.controls.update(e),
  22573. this.camera.copy(this.quickstartCamera)
  22574. }
  22575. ,
  22576. t.prototype.setSize = function(e, t) {
  22577. this.quickstartCamera.updateAspect(e / t)
  22578. }
  22579. ,
  22580. t.prototype.destroy = function() {
  22581. this.scene.remove(this.skybox)
  22582. }
  22583. ,
  22584. s.exports = t
  22585. }
  22586. ).call(this, "/js/scene/QuickstartManager.js")
  22587. }
  22588. , {
  22589. "../cameras/PanoramaCamera": 7,
  22590. "../constants": 8,
  22591. "../controls/PanoramaControls": 13,
  22592. "../enum/PanoSizeClass": 36,
  22593. "../enum/Vectors": 50,
  22594. "../gui/helpManager": 68,
  22595. "../materials/CubemapMaterial": 117,
  22596. "../materials/ModelTextureMaterial": 118,
  22597. "../settings": 166,
  22598. "../tile/TileUtils": 174,
  22599. "../util/browser": 182,
  22600. "../util/camera": 183,
  22601. "../util/cameraLight": 184,
  22602. "../util/easing": 186,
  22603. "../util/lerp": 188,
  22604. "../util/logger": 189,
  22605. "../util/transitions": 195,
  22606. three: 217
  22607. }],
  22608. 158: [function(e, t, i) {
  22609. "use strict";
  22610. function h(e, t, i) {
  22611. this.scene = e,
  22612. this.camera = t,
  22613. this.renderer = null,
  22614. this.effects = i,
  22615. this.animateCallback = null,
  22616. this.composer = null,
  22617. this.qualityManager = null,
  22618. e.renderWidth = 0,
  22619. e.renderHeight = 0,
  22620. this.updateClock = new M.Clock,
  22621. this.components = [],
  22622. this.updateListeners = [],
  22623. this.resizeListeners = [],
  22624. this.forceUpdateSize = !1,
  22625. this.started = !1,
  22626. this.textures = {},
  22627. this.suspendedObjects = []
  22628. }
  22629. 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;
  22630. window.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame,
  22631. (h.prototype = Object.create(p.prototype)).addComponent = function(e) {
  22632. this.components.push(e),
  22633. e.update && this.updateListeners.push(e),
  22634. e.setSize && (this.resizeListeners.push(e),
  22635. this.forceUpdateSize = !0)
  22636. }
  22637. ,
  22638. h.prototype.removeComponent = function(t) {
  22639. function e(e) {
  22640. return e !== t
  22641. }
  22642. this.components = this.components.filter(e),
  22643. this.updateListeners = this.updateListeners.filter(e),
  22644. this.resizeListeners = this.resizeListeners.filter(e)
  22645. }
  22646. ,
  22647. h.prototype.start = function(e) {
  22648. if (this.started)
  22649. throw new l("Can't start SceneRenderer, already started");
  22650. this.createContext(e),
  22651. //u.isMobile() && this.boluoVrInit(),
  22652. this.initComposer(),
  22653. this.started = !0,
  22654. (b = b.bind(this))()
  22655. }
  22656. ,
  22657. h.prototype.createContext = function(e) {
  22658. try {
  22659. this.renderer = new M.WebGLRenderer({antialias: !u.isMobile()}),
  22660. this.renderer.autoClear = !0,
  22661. this.renderer.setPixelRatio(window.devicePixelRatio ? window.devicePixelRatio : 1),
  22662. this.renderer.setSize($("#player").width(), $("#player").height(), !1),
  22663. this.emit(r.ContextCreated)
  22664. } catch (e) {
  22665. throw new c("Unable to create a WebGL rendering context")
  22666. }
  22667. d.profiling.enabled && this.overrideTextures(),
  22668. e.appendChild(this.renderer.domElement)
  22669. }
  22670. ,
  22671. h.prototype.overrideTextures = function() {
  22672. var d = this.renderer.context
  22673. , t = 0
  22674. , i = d.createTexture;
  22675. d.createTexture = function() {
  22676. var e = i.call(d);
  22677. return e.id = t++,
  22678. this.textures[e.id] = e
  22679. }
  22680. .bind(this);
  22681. var p = d.texImage2D;
  22682. d.texImage2D = function(e, t, i, n, r, o, a, s, l) {
  22683. var c, h = this.getTextureTypeFromTarget(d, e);
  22684. c = h === f.TextureCube ? d.getParameter(d.TEXTURE_BINDING_CUBE_MAP) : d.getParameter(d.TEXTURE_BINDING_2D),
  22685. void 0 !== a ? p.call(d, e, t, i, n, r, o, a, s, l) : (a = n,
  22686. s = r,
  22687. n = (l = o).naturalWidth,
  22688. r = l.naturalHeight,
  22689. p.call(d, e, t, i, a, s, l));
  22690. var u = this.textures[c.id];
  22691. u.width = h === f.TextureCube ? 6 * n : n,
  22692. u.height = r
  22693. }
  22694. .bind(this);
  22695. var n = d.deleteTexture;
  22696. d.deleteTexture = function(e) {
  22697. delete this.textures[e.id],
  22698. n.call(d, e)
  22699. }
  22700. .bind(this)
  22701. }
  22702. ,
  22703. h.prototype.updateTextureMemory = (n = null,
  22704. function() {
  22705. var e = 0;
  22706. for (var t in this.textures) {
  22707. var i = this.textures[t];
  22708. i.width && i.height && (e += i.width * i.height * 4)
  22709. }
  22710. e !== n && this.emit(r.MemoryUsageUpdated, e),
  22711. n = e
  22712. }
  22713. ),
  22714. h.prototype.getTextureTypeFromTarget = function(e, t) {
  22715. switch (t) {
  22716. case e.TEXTURE_CUBE_MAP_POSITIVE_X:
  22717. case e.TEXTURE_CUBE_MAP_NEGATIVE_X:
  22718. case e.TEXTURE_CUBE_MAP_POSITIVE_Y:
  22719. case e.TEXTURE_CUBE_MAP_NEGATIVE_Y:
  22720. case e.TEXTURE_CUBE_MAP_POSITIVE_Z:
  22721. case e.TEXTURE_CUBE_MAP_NEGATIVE_Z:
  22722. return f.TextureCube;
  22723. case e.TEXTURE_2D:
  22724. return f.Texture2D;
  22725. default:
  22726. return null
  22727. }
  22728. }
  22729. ,
  22730. h.prototype.initComposer = function() {
  22731. this.composer = new M.EffectComposer(this.renderer),
  22732. this.composer.addPass(new M.RenderPass(this.scene,this.camera)),
  22733. this.composer.addPass(this.effects.hblurPass),
  22734. this.composer.addPass(this.effects.vblurPass)
  22735. }
  22736. ,
  22737. h.prototype.setSize = function(e, t, i) {
  22738. this.renderWidth = e,
  22739. this.renderHeight = t,
  22740. this.effects.aspect = e / t,
  22741. this.renderer.setSize(e, t, !1, i),
  22742. this.composer.setSize(e, t);
  22743. for (var n = 0; n < this.resizeListeners.length; n++)
  22744. this.resizeListeners[n].setSize(e, t)
  22745. }
  22746. ,
  22747. h.prototype.render = function() {
  22748. 0 < this.effects.currentBlur ? this.composer.render() : this.renderer.render(this.scene, this.camera)
  22749. }
  22750. ,
  22751. h.prototype.boluoVrInit = function() {
  22752. console.log("boluoVrInit"),
  22753. this.isHuawei5X = u.detectHUAWEI5X(),
  22754. this.oldRenderer = this.renderer,
  22755. this.newRenderer = new this.vrRenderer(this.renderer,this,this.camera),
  22756. window.panoCamera = this.camera;
  22757. var i = this;
  22758. window._vrEnabled = !1,
  22759. Object.defineProperty(window, "vrEnabled", {
  22760. get: function() {
  22761. return window._vrEnabled
  22762. },
  22763. set: function(e) {
  22764. (e = !!e) ? (i.renderer = i.newRenderer,
  22765. window.vrMarkers.forEach(function(e) {
  22766. e.visible = !0
  22767. })) : (i.renderer = i.oldRenderer,
  22768. window.vrMarkers.forEach(function(e) {
  22769. e.visible = !1
  22770. })),
  22771. i.cursor.visible = e,
  22772. i.setSize(window.innerWidth, window.innerHeight),
  22773. window._vrEnabled = e,
  22774. setTimeout(function() {
  22775. console.log(player.cameraControls.activeControl.camera.fov)
  22776. }, 500)
  22777. }
  22778. }),
  22779. this.createCursor(.5, !1, 1, 16777215, 0);
  22780. var e = {
  22781. setSize: function(e, t) {
  22782. i.camera.aspect = e / t
  22783. }
  22784. };
  22785. this.resizeListeners.push(e),
  22786. this.vrLoadingInit()
  22787. }
  22788. ,
  22789. h.prototype.vrLoadingInit = function() {
  22790. var e = new (e = function(camera) {
  22791. var t = this
  22792. , e = new M.RingGeometry(1.3,1.5,32,32,0,1.2 * Math.PI)
  22793. , i = new M.MeshBasicMaterial({
  22794. color: 4967932,
  22795. side: M.DoubleSide
  22796. })
  22797. , n = new M.Mesh(e,i);
  22798. (this.mesh = n).position.z = -2,
  22799. n.scale.set(.08, .08, .08),
  22800. n.visible = !1,
  22801. //window.player.camera.add(n),
  22802. camera.add(n),
  22803. t.enabled = !1,
  22804. this.update = function(e) {
  22805. 1 == t.enabled && (n.rotation.z += 15 * e)
  22806. }
  22807. }
  22808. )(this.camera);
  22809. window.Loading = e,
  22810. this.updateListeners.push(e)
  22811. }
  22812. ,
  22813. h.prototype.createCursor = function(e, t, i, n, r) {
  22814. var o, a = new M.SpriteMaterial({
  22815. opacity: i,
  22816. color: n,
  22817. transparent: t,
  22818. map: this.boluoGetTexture("images/cursor.png"),
  22819. needsUpdate: !0,
  22820. side: M.DoubleSide
  22821. });
  22822. a.map.offset = new M.Vector2(1 / 17 * r,0),
  22823. a.map.repeat = new M.Vector2(1 / 17,1),
  22824. a.depthTest = !1,
  22825. a.blending = M.AdditiveBlending,
  22826. (o = new M.Sprite(a)).scale.set(.3, .3, .3),
  22827. o.position.z = -2,
  22828. o.visible = !1,
  22829. o.name = "cursor",
  22830. this.camera.add(o),
  22831. this.scene.add(this.camera),
  22832. this.cursor = o;
  22833. var s = new this.CursorAnimation(this.scene,o,this.camera);
  22834. this.cursor.triggerTargetEvent = s.triggerTargetEvent,
  22835. this.updateListeners.push(s)
  22836. }
  22837. ,
  22838. h.prototype.CursorAnimation = function(e, t, o) {
  22839. this.cursor = t,
  22840. this.raycaster = new M.Raycaster,
  22841. this.targetEventObj = {},
  22842. this.type = 1,
  22843. this.tweenFlag = !0;
  22844. var s = this;
  22845. this.target = o,
  22846. console.log(o.uuid),
  22847. this.euler = new M.Euler,
  22848. this.q0 = new M.Quaternion,
  22849. this.q1 = new M.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5)),
  22850. this.zee = new M.Vector3(0,0,1),
  22851. this.alpha = -1e3,
  22852. this.beta = -1e3,
  22853. this.gamma = -1e3,
  22854. this.orient = M.Math.degToRad(window.orientation || 0),
  22855. window.addEventListener("orientationchange", function() {
  22856. s.orient = M.Math.degToRad(window.orientation || 0)
  22857. }),
  22858. window.addEventListener("deviceorientation", function(e) {
  22859. var t = M.Math.degToRad(e.alpha)
  22860. , i = M.Math.degToRad(e.beta)
  22861. , n = M.Math.degToRad(e.gamma);
  22862. if (this.isHuawei5X ? (-1e3 === s.alpha && (s.alpha = t),
  22863. -1e3 === s.beta && (s.beta = i),
  22864. -1e3 === s.gamma && (s.gamma = n),
  22865. .06 < Math.abs(t - s.alpha) && (s.alpha = t),
  22866. .006 < Math.abs(i - s.beta) && (s.beta = i),
  22867. .006 < Math.abs(n - s.gamma) && (s.gamma = n)) : (s.alpha = t,
  22868. s.beta = i,
  22869. s.gamma = n),
  22870. h.vrDebug) {
  22871. $("#info-device-orientation").css("display", "block");
  22872. var r = "";
  22873. r += "alpha=(" + s.alpha + ")<BR/>",
  22874. r += "beta=(" + s.beta + ")<BR/>",
  22875. r += "gamma=" + s.gamma + "<BR/>",
  22876. document.getElementById("info-device-orientation").innerHTML = r
  22877. }
  22878. }),
  22879. this.setObjectQuaternion = function(e, t, i, n, r) {
  22880. s.euler.set(i, t, -n, "YXZ"),
  22881. e.setFromEuler(s.euler),
  22882. e.multiply(s.q1),
  22883. e.multiply(s.q0.setFromAxisAngle(s.zee, -r)),
  22884. o.updateMatrixWorld()
  22885. }
  22886. ,
  22887. parent !== window && window.addEventListener("message", function(e) {
  22888. var t, i, n, r, o = JSON.parse(e.data), a = -1 !== window.navigator.userAgent.indexOf("KIW-TL00H");
  22889. o && o.alpha && o.beta && o.gamma && (t = a,
  22890. i = M.Math.degToRad(o.alpha),
  22891. n = M.Math.degToRad(o.beta),
  22892. r = M.Math.degToRad(o.gamma),
  22893. t ? (-1e3 === s.alpha && (s.alpha = i),
  22894. -1e3 === s.beta && (s.beta = n),
  22895. -1e3 === s.gamma && (s.gamma = r),
  22896. .06 < Math.abs(i - s.alpha) && (s.alpha = i),
  22897. .006 < Math.abs(n - s.beta) && (s.beta = n),
  22898. .006 < Math.abs(r - s.gamma) && (s.gamma = r)) : (s.alpha = i,
  22899. s.beta = n,
  22900. s.gamma = r))
  22901. }),
  22902. this.update = function(e) {
  22903. TWEEN.update(),
  22904. window.vrEnabled && (this.setObjectQuaternion(this.target.quaternion, this.alpha, this.beta, this.gamma, this.orient),
  22905. this.triggerTargetEvent())
  22906. }
  22907. ,
  22908. this.triggerTargetEvent = function() {
  22909. var e = this.choseObj()
  22910. , t = e ? e.object : void 0;
  22911. (this.targetEventObj.currentObj = t) !== this.targetEventObj.lastObj && (t && this.autoCursorPosition(e),
  22912. 1 === this.type ? (this.cursorAnimate && this.cursorAnimate.stop(),
  22913. t && t.enabled && this.startAnimate(function() {
  22914. this.clickCallback(t)
  22915. }
  22916. .bind(this))) : this.type,
  22917. this.targetEventObj.lastObj = t)
  22918. }
  22919. ,
  22920. this.choseObj = function() {
  22921. this.raycaster.setFromCamera({
  22922. x: 0,
  22923. y: 0
  22924. }, o);
  22925. var e = (this.raycaster.ray,
  22926. window.vrMarkers)
  22927. , t = this.raycaster.intersectObjects(e);
  22928. if (0 < t.length)
  22929. return t[0]
  22930. }
  22931. ,
  22932. this.clickCallback = function(e) {
  22933. this.runTHREEAction(e, "onclick")
  22934. }
  22935. ,
  22936. this.runTHREEAction = function(e, t) {
  22937. switch (t) {
  22938. case "onclick":
  22939. e._listeners && e._listeners.click && e._listeners.click.forEach(function(e) {
  22940. e()
  22941. });
  22942. break;
  22943. case "onhover":
  22944. e._listeners && e._listeners.hover && e._listeners.hover.forEach(function(e) {
  22945. e()
  22946. });
  22947. break;
  22948. case "onout":
  22949. e._listeners && e._listeners.out && e._listeners.out.forEach(function(e) {
  22950. e()
  22951. })
  22952. }
  22953. }
  22954. ,
  22955. this.startAnimate = function(e) {
  22956. this.tweenFlag && this.initAnimation(e)
  22957. }
  22958. ,
  22959. this.initAnimation = function(e) {
  22960. var t = this
  22961. , i = this.cursor.material.map.offset;
  22962. t.tweenFlag = !1,
  22963. this.cursorAnimate = new TWEEN.Tween(i).to({
  22964. x: 1
  22965. }, 1e3).onStart(function() {
  22966. t.tweenFlag = !1
  22967. }).onStop(function() {
  22968. t.tweenFlag = !0,
  22969. this.x = 0,
  22970. i.x = 0
  22971. }).onUpdate(function() {}).onComplete(function() {
  22972. e(),
  22973. i.x = 0,
  22974. setTimeout(function() {
  22975. t.tweenFlag = !0
  22976. }, 1500)
  22977. }),
  22978. this.cursorAnimate.easing(function(e) {
  22979. return Math.floor(17 * e) / 17
  22980. }),
  22981. this.cursorAnimate.start()
  22982. }
  22983. ,
  22984. this.autoCursorPosition = function(e) {
  22985. this.cursor.scale.set(.3, .3, .3)
  22986. }
  22987. }
  22988. ,
  22989. h.prototype.vrRenderer = function(a, i, e) {
  22990. var s = new i.vrCamera(e);
  22991. s.bananaAspect = .8,
  22992. this.width,
  22993. this.height;
  22994. i = this;
  22995. this.setSize = function(e, t) {
  22996. a.setSize.call(this, e, t),
  22997. i.width = e,
  22998. i.height = t
  22999. }
  23000. ,
  23001. this.render = function(e, t, i, n) {
  23002. var r, o;
  23003. if (window.cameraQua = t.quaternion.clone(),
  23004. t.__RESS__SKIP__STEREO__)
  23005. return a.render(e, t, i, n);
  23006. if ("PerspectiveCamera" === t.type)
  23007. r = s.cameraL,
  23008. o = s.cameraR,
  23009. e.updateMatrixWorld(),
  23010. null === t.parent && t.updateMatrixWorld(),
  23011. s.vrCameraUpdate(t);
  23012. else {
  23013. if ("OrthographicCamera" !== t.type)
  23014. return DEBUG && console.error("Unsupported renderer: ", t.type);
  23015. r = o = t
  23016. }
  23017. a.setScissorTest(!0),
  23018. a.setScissor(0, 0, this.width / 2, this.height),
  23019. a.setViewport(0, 0, this.width / 2, this.height),
  23020. a.render.call(this, e, r, i, n),
  23021. a.setScissor(this.width / 2, 0, this.width / 2, this.height),
  23022. a.setViewport(this.width / 2, 0, this.width / 2, this.height),
  23023. a.render.call(this, e, o, i, n),
  23024. a.setScissorTest(!1)
  23025. }
  23026. ,
  23027. this.__proto__ = {
  23028. __proto__: a
  23029. }
  23030. }
  23031. ,
  23032. h.prototype.vrCamera = function(e) {
  23033. this.type = "StereoCamera",
  23034. this._aspect = 1,
  23035. this._overlap = .064,
  23036. this.cameraL = new M.PerspectiveCamera,
  23037. this.cameraL.layers.enable(1),
  23038. this.cameraL.matrixAutoUpdate = !1,
  23039. this.cameraR = new M.PerspectiveCamera,
  23040. this.cameraR.layers.enable(2),
  23041. this.cameraR.matrixAutoUpdate = !1,
  23042. this.eyeRight = new M.Matrix4,
  23043. this.eyeLeft = new M.Matrix4,
  23044. this.vrCameraNeedsUpdate = !0,
  23045. window.vrCameraL = this.cameraL,
  23046. Object.defineProperty(this, "bananaAspect", {
  23047. get: function() {
  23048. return this._aspect
  23049. },
  23050. set: function(e) {
  23051. this._aspect !== e && (this.vrCameraNeedsUpdate = !0),
  23052. this._aspect = e
  23053. }
  23054. }),
  23055. Object.defineProperty(this, "overlap", {
  23056. get: function() {
  23057. return this._overlap
  23058. },
  23059. set: function(e) {
  23060. this._overlap !== e && (this.vrCameraNeedsUpdate = !0),
  23061. this._overlap = e
  23062. }
  23063. }),
  23064. this.vrCameraUpdate = function(e) {
  23065. if (this.vrCameraNeedsUpdate = !0,
  23066. this.vrCameraNeedsUpdate = this.vrCameraNeedsUpdate || this.bananaFov !== e.fov || this.bananaReal_aspect !== e.aspect * this.bananaAspect || this.bananaNear !== e.near || this.bananaFar !== e.far,
  23067. this.vrCameraNeedsUpdate) {
  23068. this.vrCameraNeedsUpdate = !1,
  23069. console.debug("vrCameraUpdate"),
  23070. this.bananaFocus = e.focus,
  23071. this.bananaFov = e.fov,
  23072. this.bananaReal_aspect = e.aspect * this.bananaAspect,
  23073. this.bananaNear = e.near,
  23074. this.bananaFar = e.far,
  23075. console.debug(e.aspect),
  23076. this.bananaFocus = 10;
  23077. 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);
  23078. this.eyeLeft.elements[12] = -r,
  23079. this.eyeRight.elements[12] = r,
  23080. t = -a * this.bananaReal_aspect + o,
  23081. i = a * this.bananaReal_aspect + o,
  23082. n.elements[0] = 2 * this.bananaNear / (i - t),
  23083. n.elements[8] = (i + t) / (i - t),
  23084. this.cameraL.projectionMatrix.copy(n),
  23085. t = -a * this.bananaReal_aspect - o,
  23086. i = a * this.bananaReal_aspect - o,
  23087. n.elements[0] = 2 * this.bananaNear / (i - t),
  23088. n.elements[8] = (i + t) / (i - t),
  23089. this.cameraR.projectionMatrix.copy(n)
  23090. }
  23091. this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(this.eyeLeft),
  23092. this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(this.eyeRight)
  23093. }
  23094. }
  23095. ,
  23096. h.prototype.boluoGetTexture = function(e) {
  23097. var t = new M.TextureLoader;
  23098. return t.crossOrigin = "anonymous",
  23099. t.load(e)
  23100. }
  23101. ,
  23102. h.prototype.updateScreenSize = function(e) {
  23103. var t, i, n, r = !1;
  23104. e && !e.resize && null != e.width && null != e.height ? (i = e.width,
  23105. n = e.height,
  23106. r = !0,
  23107. t = 1) : (i = $("#player").width(),
  23108. n = $("#player").height(),
  23109. e && e.resize && (o = this.renderWidth,
  23110. a = this.renderHeight),
  23111. i === o && n === a && !this.forceUpdateSize || (o = i,
  23112. a = n,
  23113. r = !0,
  23114. t = window.devicePixelRatio)),
  23115. r && (this.setSize(i, n, t),
  23116. this.forceUpdateSize = !1)
  23117. }
  23118. ,
  23119. h.prototype.updateComponents = function() {
  23120. for (var e = Math.min(1, this.updateClock.getDelta()), t = 0; t < this.updateListeners.length; t++)
  23121. this.updateListeners[t].update(e)
  23122. }
  23123. ,
  23124. h.prototype.suspend = function() {
  23125. this.started = !1,
  23126. this.suspendedObjects = this.scene.children.map(function(e) {
  23127. return this.scene.remove(e),
  23128. e
  23129. }
  23130. .bind(this)),
  23131. this.render()
  23132. }
  23133. ,
  23134. h.prototype.resume = function() {
  23135. this.suspendedObjects.forEach(function(e) {
  23136. this.scene.add(e)
  23137. }
  23138. .bind(this)),
  23139. this.suspendedObjects = [],
  23140. this.started = !0,
  23141. b()
  23142. }
  23143. ;
  23144. var g, m, v, y, A, C, I, P, O, L, D, N, F, E, _, b = function() {
  23145. this.started && (window.requestAnimationFrame(b),
  23146. this.updateScreenSize(),
  23147. this.updateComponents(),
  23148. this.updateTextureMemory(),
  23149. this.render(),
  23150. this.emit(r.AfterRender))
  23151. };
  23152. h.prototype.getImageData = (E = document.createElement("canvas"),
  23153. _ = E.getContext("2d"),
  23154. function(e, t, i) {
  23155. return E.width === t && E.height === i || (E.width = t,
  23156. E.height = i),
  23157. _.drawImage(e, 0, 0, t, i),
  23158. _.getImageData(0, 0, t, i)
  23159. }
  23160. ),
  23161. h.prototype.initSizedTexture2D = function(e, t, i) {
  23162. var n = this.renderer
  23163. , r = n.context
  23164. , o = n.state
  23165. , a = new M.Texture(null);
  23166. !(a.flipY = !1) !== i && (i = !1),
  23167. a.generateMipmaps = i;
  23168. var s = n.paramThreeToGL(a.format)
  23169. , l = n.paramThreeToGL(a.type)
  23170. , c = n.properties.get(a)
  23171. , h = r.createTexture();
  23172. o.bindTexture(r.TEXTURE_2D, h),
  23173. r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL, a.flipY),
  23174. r.texImage2D(r.TEXTURE_2D, 0, s, e, e, 0, s, l, null),
  23175. a.wrapS = t,
  23176. a.wrapT = t;
  23177. var u = n.paramThreeToGL(t);
  23178. return r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_S, u),
  23179. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_T, u),
  23180. i ? (a.magFilter = M.LinearFilter,
  23181. a.minFilter = M.LinearMipMapLinearFilter,
  23182. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MAG_FILTER, r.LINEAR),
  23183. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, r.LINEAR_MIPMAP_NEAREST),
  23184. r.generateMipmap(r.TEXTURE_2D)) : (a.magFilter = M.LinearFilter,
  23185. a.minFilter = M.LinearFilter,
  23186. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MAG_FILTER, r.LINEAR),
  23187. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, r.LINEAR)),
  23188. o.bindTexture(r.TEXTURE_2D, null),
  23189. c.__webglTexture = h,
  23190. a
  23191. }
  23192. ,
  23193. h.prototype.initSizedCubeMap = function(e, t) {
  23194. var i = this.renderer
  23195. , n = i.context
  23196. , r = i.state
  23197. , o = new M.CubeTexture([null, null, null, null, null, null]);
  23198. o.flipY = !1,
  23199. o.generateMipmaps = t;
  23200. var a = i.paramThreeToGL(o.format)
  23201. , s = i.paramThreeToGL(o.type)
  23202. , l = i.properties.get(o)
  23203. , c = n.createTexture();
  23204. r.bindTexture(n.TEXTURE_CUBE_MAP, c),
  23205. n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL, o.flipY);
  23206. for (var h = 0; h < 6; h++)
  23207. n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + h, 0, a, e, e, 0, a, s, null);
  23208. return t ? (o.magFilter = M.LinearFilter,
  23209. o.minFilter = M.LinearMipMapLinearFilter,
  23210. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  23211. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR_MIPMAP_LINEAR),
  23212. n.texParameteri(n.TEXTURE_CUBE_MAP, n.GENERATE_MIPMAP, n.TRUE),
  23213. n.generateMipmap(n.TEXTURE_CUBE_MAP)) : (o.magFilter = M.LinearFilter,
  23214. o.minFilter = M.LinearFilter,
  23215. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  23216. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR)),
  23217. r.bindTexture(n.TEXTURE_CUBE_MAP, null),
  23218. l.__image__webglTextureCube = c,
  23219. o
  23220. }
  23221. ,
  23222. h.prototype.deallocateCubeTexture = function(e) {
  23223. var t = this.renderer
  23224. , i = t.context
  23225. , n = t.properties.get(e);
  23226. i.deleteTexture(n.__image__webglTextureCube)
  23227. }
  23228. ,
  23229. h.prototype.uploadTexture2D = function(e, t, i, n, r, o) {
  23230. var a = this.renderer
  23231. , s = a.context
  23232. , l = a.state
  23233. , c = a.properties.get(t);
  23234. l.bindTexture(s.TEXTURE_2D, c.__webglTexture),
  23235. s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, t.flipY),
  23236. s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  23237. s.pixelStorei(s.UNPACK_ALIGNMENT, t.unpackAlignment),
  23238. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_S, a.paramThreeToGL(t.wrapS)),
  23239. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_T, a.paramThreeToGL(t.wrapT)),
  23240. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MAG_FILTER, a.paramThreeToGL(t.magFilter)),
  23241. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MIN_FILTER, a.paramThreeToGL(t.minFilter)),
  23242. s.texSubImage2D(s.TEXTURE_2D, 0, i, n, s.RGBA, s.UNSIGNED_BYTE, e),
  23243. t.generateMipmaps && s.generateMipmap(s.TEXTURE_2D),
  23244. l.bindTexture(s.TEXTURE_2D, null)
  23245. }
  23246. ,
  23247. h.prototype.uploadTexture3D = function(e, t, i, n, r, o, a) {
  23248. var s = this.renderer
  23249. , l = s.context
  23250. , c = s.state
  23251. , h = s.properties.get(t);
  23252. c.bindTexture(l.TEXTURE_CUBE_MAP, h.__image__webglTextureCube),
  23253. l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL, t.flipY),
  23254. l.texSubImage2D(r, 0, i, n, l.RGBA, l.UNSIGNED_BYTE, e),
  23255. t.generateMipmaps && l.generateMipmap(l.TEXTURE_CUBE_MAP),
  23256. c.bindTexture(l.TEXTURE_CUBE_MAP, null)
  23257. }
  23258. ,
  23259. h.prototype.rebuildMipMaps2D = function(e) {
  23260. var t = this.renderer
  23261. , i = t.context
  23262. , n = t.state;
  23263. t.properties.get(e),
  23264. i.generateMipmap(i.TEXTURE_2D),
  23265. n.bindTexture(i.TEXTURE_2D, null)
  23266. }
  23267. ,
  23268. h.prototype.rebuildMipMaps3D = function(e) {
  23269. var t = this.renderer
  23270. , i = t.context
  23271. , n = t.state
  23272. , r = t.properties.get(e);
  23273. n.bindTexture(i.TEXTURE_CUBE_MAP, r.__image__webglTextureCube),
  23274. i.generateMipmap(i.TEXTURE_CUBE_MAP),
  23275. n.bindTexture(i.TEXTURE_CUBE_MAP, null)
  23276. }
  23277. ,
  23278. h.prototype.renderToCubeMap = (P = !1,
  23279. F = N = D = L = O = null,
  23280. function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  23281. this.renderer.context,
  23282. P || ((L = new M.OrthographicCamera(-.5,.5,.5,-.5,-200,200)).position.z = 150,
  23283. (O = new M.Scene).add(L),
  23284. D = new M.ShaderMaterial({
  23285. uniforms: {
  23286. tDiffuse: {
  23287. type: "t",
  23288. value: null
  23289. },
  23290. alpha: {
  23291. type: "f",
  23292. value: 1
  23293. }
  23294. },
  23295. vertexShader: R.basicTextured.vertexShader,
  23296. fragmentShader: R.basicTextured.fragmentShader,
  23297. depthWrite: !1,
  23298. depthTest: !1,
  23299. side: M.DoubleSide
  23300. }),
  23301. N = new M.PlaneBufferGeometry(1,1),
  23302. (F = new M.Mesh(N,D)).position.z = 0,
  23303. O.add(F),
  23304. P = !0);
  23305. var m = N.getAttribute("uv");
  23306. m.setDynamic(!0),
  23307. m.needsUpdate = !0;
  23308. var v = m.array
  23309. , y = r / i
  23310. , A = o / n
  23311. , C = a / i
  23312. , I = s / n;
  23313. v[0] = y,
  23314. v[1] = A + I,
  23315. v[2] = y + C,
  23316. v[3] = A + I,
  23317. v[4] = y,
  23318. v[5] = A,
  23319. v[6] = y + C,
  23320. v[7] = A;
  23321. var E = N.getAttribute("position");
  23322. E.setDynamic(!0),
  23323. E.needsUpdate = !0;
  23324. var _ = E.array
  23325. , b = l / t.width - .5
  23326. , w = c / t.height - .5
  23327. , T = h / t.width
  23328. , x = u / t.height;
  23329. _[0] = b,
  23330. _[1] = w + x,
  23331. _[3] = b + T,
  23332. _[4] = w + x,
  23333. _[6] = b,
  23334. _[7] = w,
  23335. _[9] = b + T,
  23336. _[10] = w,
  23337. this.renderer.properties.get(e),
  23338. D.uniforms.tDiffuse.value = e,
  23339. D.blending = p || M.NoBlending,
  23340. D.transparent = !!f,
  23341. null != g || (g = 1),
  23342. D.uniforms.alpha.value = g,
  23343. D.needUpdate = !0,
  23344. t.activeCubeFace = d,
  23345. t.viewport.set(0, 0, t.width, t.height);
  23346. var S = this.renderer.autoClear;
  23347. this.renderer.autoClear = !1,
  23348. this.renderer.render(O, L, t, !1),
  23349. this.renderer.autoClear = S
  23350. }
  23351. ),
  23352. h.prototype.copyCubeMap = (g = !1,
  23353. C = A = y = v = m = null,
  23354. I = new M.Euler,
  23355. new M.Vector3,
  23356. function(e, t, i, n, r, o, a, s, l) {
  23357. this.renderer,
  23358. g || ((v = new M.OrthographicCamera(-1,1,1,-1,0,200)).position.set(0, 0, 0),
  23359. (m = new M.Scene).add(v),
  23360. y = new M.ShaderMaterial({
  23361. uniforms: {
  23362. tDiffuse: {
  23363. type: "t",
  23364. value: null
  23365. },
  23366. alpha: {
  23367. type: "f",
  23368. value: 1
  23369. }
  23370. },
  23371. vertexShader: R.copyCubeMap.vertexShader,
  23372. fragmentShader: R.copyCubeMap.fragmentShader,
  23373. depthWrite: !1,
  23374. depthTest: !1,
  23375. side: M.DoubleSide
  23376. }),
  23377. A = new M.BoxGeometry(2,2,2),
  23378. C = new M.Mesh(A,y),
  23379. m.add(C),
  23380. g = !0);
  23381. for (var c = 0; c < 6; c++)
  23382. h.getCubeOrientationForCubeFace(c, I),
  23383. C.rotation.copy(I),
  23384. C.matrixWorldNeedsUpdate = !0,
  23385. C.updateMatrixWorld(),
  23386. y.uniforms.tDiffuse.value = e,
  23387. y.blending = a || M.NoBlending,
  23388. y.transparent = !!s,
  23389. null != l || (l = 1),
  23390. y.uniforms.alpha.value = l,
  23391. y.needUpdate = !0,
  23392. t.activeCubeFace = c,
  23393. t.viewport.set(0, 0, r, o),
  23394. this.renderer.render(m, v, t, !1)
  23395. }
  23396. ),
  23397. h.getLookAtForCubeFace = function(e, t) {
  23398. switch (e) {
  23399. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  23400. t.set(1, 0, 0);
  23401. break;
  23402. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  23403. t.set(-1, 0, 0);
  23404. break;
  23405. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  23406. t.set(0, 1, 0);
  23407. break;
  23408. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  23409. t.set(0, -1, 0);
  23410. break;
  23411. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  23412. t.set(0, 0, 1);
  23413. break;
  23414. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  23415. t.set(0, 0, -1)
  23416. }
  23417. }
  23418. ,
  23419. h.getCubeOrientationForCubeFace = function(e, t) {
  23420. switch (e) {
  23421. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  23422. t.set(0, -Math.PI / 2, 0);
  23423. break;
  23424. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  23425. t.set(0, Math.PI / 2, 0);
  23426. break;
  23427. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  23428. t.set(Math.PI / 2, Math.PI, 0);
  23429. break;
  23430. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  23431. t.set(-Math.PI / 2, Math.PI, 0);
  23432. break;
  23433. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  23434. t.set(0, -Math.PI, 0);
  23435. break;
  23436. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  23437. t.set(0, 0, 0)
  23438. }
  23439. }
  23440. ,
  23441. t.exports = h
  23442. }
  23443. , {
  23444. "../enum/GLCubeFaces": 25,
  23445. "../enum/GLTextureType": 26,
  23446. "../enum/SceneRendererEvents": 43,
  23447. "../exception/BasicException": 55,
  23448. "../exception/RendererCreationException": 57,
  23449. "../settings": 166,
  23450. "../shaders": 167,
  23451. "../util/browser": 182,
  23452. events: 202,
  23453. three: 217
  23454. }],
  23455. 159: [function(e, t, i) {
  23456. "use strict";
  23457. function n(e) {
  23458. this.messenger = new a(e),
  23459. this.clientKey = null
  23460. }
  23461. var o = e("../util/ajax")
  23462. , r = e("./PostMessageType")
  23463. , a = e("./postmessage")
  23464. , s = e("./VersionInfo")
  23465. , l = e("events").EventEmitter
  23466. , c = window.location.origin + "/api/v1/user/";
  23467. (n.prototype = Object.create(l.prototype)).bindEvents = function() {
  23468. this.messenger.on(r.ACTION, this.onMessageReceived.bind(this))
  23469. }
  23470. ,
  23471. n.prototype.waitForConnection = function() {
  23472. return new Promise(function(t, i) {
  23473. this.messenger.on(r.CONNECT, function(e) {
  23474. this.onConnectionReceived(e).then(t.bind(this, e.sdkVersion), i.bind())
  23475. }
  23476. .bind(this))
  23477. }
  23478. .bind(this))
  23479. }
  23480. ,
  23481. n.prototype.onConnectionReceived = function(i) {
  23482. return this.messenger.setTarget(i.source, i.origin),
  23483. this.verifyConnection(i).then(function(e, t) {
  23484. this.messenger.send({
  23485. type: r.ACCEPT,
  23486. toId: i.fromId,
  23487. warning: t
  23488. }),
  23489. this.clientKey = e,
  23490. this.messenger.removeAllListeners(r.CONNECT),
  23491. this.bindEvents()
  23492. }
  23493. .bind(this), function(e) {
  23494. this.messenger.send({
  23495. type: r.REJECT,
  23496. toId: i.fromId,
  23497. reason: e
  23498. }),
  23499. this.messenger.setTarget()
  23500. }
  23501. .bind(this))
  23502. }
  23503. ,
  23504. n.prototype.verifyConnection = function(r) {
  23505. return new Promise(function(e, t) {
  23506. var i;
  23507. if (s.isDeprecated(r.sdkVersion))
  23508. i = "这个版本正在被弃用";
  23509. else if (!s.isSupported(r.sdkVersion))
  23510. return t("不支持此版本的SDK");
  23511. var n = {
  23512. cache: !1,
  23513. headers: {
  23514. "X-port-Application-Key": r.applicationKey,
  23515. "X-port-Referrer": r.origin
  23516. }
  23517. };
  23518. o.get(c, n).done(e.bind(this, r.applicationKey, i)).fail(t.bind(this, "key/referrer mismatch"))
  23519. }
  23520. )
  23521. }
  23522. ,
  23523. n.prototype.onMessageReceived = function(t) {
  23524. if (this.validateClientApplicationKey(t.applicationKey)) {
  23525. var i = this;
  23526. t.onDone = function(e) {
  23527. e.toId = t.fromId,
  23528. e.uid = t.uid,
  23529. e.type = r.RESPONSE,
  23530. i.messenger.send(e)
  23531. }
  23532. ,
  23533. this.emit(r.ACTION, t)
  23534. }
  23535. }
  23536. ,
  23537. n.prototype.validateClientApplicationKey = function(e) {
  23538. return this.clientKey === e
  23539. }
  23540. ,
  23541. n.prototype.sendEvent = function(e, t) {
  23542. this.messenger.send({
  23543. type: r.EVENT,
  23544. eventType: e,
  23545. eventData: t
  23546. })
  23547. }
  23548. ,
  23549. t.exports = n
  23550. }
  23551. , {
  23552. "../util/ajax": 181,
  23553. "./PostMessageType": 160,
  23554. "./VersionInfo": 163,
  23555. "./postmessage": 165,
  23556. events: 202
  23557. }],
  23558. 160: [function(e, t, i) {
  23559. "use strict";
  23560. t.exports = Object.freeze({
  23561. CONNECT: "postmessage.connect",
  23562. ACCEPT: "postmessage.accept",
  23563. REJECT: "postmessage.reject",
  23564. ACTION: "postmessage.action",
  23565. RESPONSE: "postmessage.response",
  23566. EVENT: "postmessage.event"
  23567. })
  23568. }
  23569. , {}],
  23570. 161: [function(e, t, i) {
  23571. "use strict";
  23572. t.exports = Object.freeze({
  23573. MOVE: "sdk.move",
  23574. ENTER_PANO: "sdk.enterpano",
  23575. MODEL_LOADED: "sdk.modelloaded"
  23576. })
  23577. }
  23578. , {}],
  23579. 162: [function(e, t, i) {
  23580. "use strict";
  23581. t.exports = Object.freeze({
  23582. FLY: "transition.fly",
  23583. FADEOUT: "transition.fade",
  23584. INSTANT: "transition.instant"
  23585. })
  23586. }
  23587. , {}],
  23588. 163: [function(e, t, i) {
  23589. "use strict";
  23590. t.exports = {
  23591. current: "1.0",
  23592. supported: ["1.0"],
  23593. deprecated: [],
  23594. isSupported: function(e) {
  23595. return -1 !== this.supported.indexOf(e)
  23596. },
  23597. isDeprecated: function(e) {
  23598. return -1 !== this.deprecated.indexOf(e)
  23599. },
  23600. isValid: function(e) {
  23601. return this.isSupported(e) || this.isDeprecated(e)
  23602. }
  23603. }
  23604. }
  23605. , {}],
  23606. 164: [function(q, X, e) {
  23607. (function(e) {
  23608. "use strict";
  23609. function r(e, t, i) {
  23610. e = e && e.toLowerCase().trim();
  23611. var n = new C.UP.clone
  23612. , r = Math.PI / 3
  23613. , o = Math.PI / 2;
  23614. switch (e) {
  23615. case "left":
  23616. i.copy(t),
  23617. i.applyAxisAngle(n, o);
  23618. break;
  23619. case "right":
  23620. i.copy(t),
  23621. i.applyAxisAngle(n, -o);
  23622. break;
  23623. case "forwardleft":
  23624. i.copy(t),
  23625. i.applyAxisAngle(n, r);
  23626. break;
  23627. case "forwardright":
  23628. i.copy(t),
  23629. i.applyAxisAngle(n, -r);
  23630. break;
  23631. case "forward":
  23632. default:
  23633. i.copy(t)
  23634. }
  23635. return i
  23636. }
  23637. function o(e, t) {
  23638. if (e) {
  23639. var i = {
  23640. pano: e,
  23641. lookAtPoint: null,
  23642. duration: null,
  23643. maxDistanceOverride: null,
  23644. skipWarpingCheck: !1
  23645. };
  23646. this.player.flyToPano(i, function() {
  23647. t && t({
  23648. success: !0,
  23649. message: "Transition complete."
  23650. })
  23651. })
  23652. } else
  23653. M.warn("Showcase -> clickPanoObject: Unable to find pano."),
  23654. t && t({
  23655. success: !1,
  23656. error: "Unable to find pano."
  23657. })
  23658. }
  23659. function a(e, t) {
  23660. t.copy(C.FORWARD),
  23661. e.getDirection(t)
  23662. }
  23663. function c(i) {
  23664. return {
  23665. panos: i.panos.list.map(function(e) {
  23666. var t = y.getCubemapUrls(i.urls, e.id, "high")[A.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z];
  23667. return {
  23668. uuid: e.id,
  23669. aligned: e.alignmentType === g.ALIGNED,
  23670. neighbourUUIDs: e.neighbourUUIDs.slice(),
  23671. position: function(e) {
  23672. return e.alignmentType !== g.ALIGNED ? null : {
  23673. x: e.position.x,
  23674. y: e.position.y,
  23675. z: e.position.z
  23676. }
  23677. }(e),
  23678. rotation: function(e) {
  23679. var t = (new h.Euler).setFromQuaternion(e.quaternion, "YXZ");
  23680. return {
  23681. x: h.Math.radToDeg(t._x),
  23682. y: h.Math.radToDeg(t._y),
  23683. z: h.Math.radToDeg(t._z)
  23684. }
  23685. }(e),
  23686. thumbnail: t
  23687. }
  23688. })
  23689. }
  23690. }
  23691. 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"),
  23692. q("../enum/PlayerEvents")), b = q("../sdk/SdkEvents"), w = (C = q("../enum/Vectors"),
  23693. q("../enum/ControlEvents")), T = q("../enum/RenderLayers"), x = (q("../constants"),
  23694. q("../settings")), S = q("../lib/jpeg_encoder"), M = new n(e), R = (N.active = !1,
  23695. N.angle = 0,
  23696. N.angleTravelled = 0,
  23697. N.playerDirection = new h.Vector3,
  23698. N.lastFacingDirection = new h.Vector3,
  23699. N.onDone = null,
  23700. N.player = null,
  23701. N.start = function(e, t, i, n) {
  23702. N.active = !0,
  23703. e && t && (t = 0),
  23704. N.angle = e || t,
  23705. N.xAngle = e,
  23706. N.yAngle = t,
  23707. N.angleTravelled = 0,
  23708. N.playerDirection.copy(i.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  23709. i.getDirection(N.playerDirection),
  23710. N.lastFacingDirection.copy(N.playerDirection),
  23711. N.projectVectors(),
  23712. N.onDone = n,
  23713. N.player = i,
  23714. N()
  23715. }
  23716. ,
  23717. N.projectVectors = function() {
  23718. N.xAngle && (N.playerDirection.projectOnPlane(C.UP),
  23719. N.lastFacingDirection.projectOnPlane(C.UP))
  23720. }
  23721. ,
  23722. N), P = (i = new h.Vector3,
  23723. function(e) {
  23724. e ? (i.copy(e.position),
  23725. i.add(e.discPosition),
  23726. s.projectPositionToCanvas(i, this.player.camera, i),
  23727. this.click(i.x, i.y)) : M.warn("Showcase -> clicktagObject: Unable to find tag.")
  23728. }
  23729. ), O = (l = new h.Vector3,
  23730. function(e) {
  23731. var t = this.player.getDirection();
  23732. l.copy(t);
  23733. var i = l.y;
  23734. l.y = 0,
  23735. l.normalize();
  23736. var n = h.Math.radToDeg(l.angleTo(t)) * (i < 0 ? -1 : 1);
  23737. if (this.player.mode !== I.DOLLHOUSE && this.player.mode !== I.PANORAMA)
  23738. return 0 !== e && M.warn("Cannot rotate in y direction when in " + this.player.mode + " mode"),
  23739. 0;
  23740. this.player.mode === I.DOLLHOUSE && (n = -n);
  23741. var r = function() {
  23742. return this.player.mode === I.PANORAMA ? x.insideLookLimitUp : this.player.mode === I.DOLLHOUSE ? 90 - h.Math.radToDeg(x.dollhouseDefault.minPolarAngle) : null
  23743. }
  23744. .call(this) - .1
  23745. , o = function() {
  23746. return this.player.mode === I.PANORAMA ? x.insideLookLimitDown : this.player.mode === I.DOLLHOUSE ? 90 - h.Math.radToDeg(x.dollhouseDefault.maxPolarAngle) : null
  23747. }
  23748. .call(this) + .1
  23749. , a = n + e;
  23750. r < a ? a = r : a < o && (a = o);
  23751. var s = a - n;
  23752. return 0 < e && s < .01 && (s = 0),
  23753. e < 0 && -.01 < s && (s = 0),
  23754. s
  23755. }
  23756. ), L = (t = new h.Euler,
  23757. function(e) {
  23758. return t.setFromQuaternion(e.quaternion, "YXZ"),
  23759. {
  23760. position: {
  23761. x: e.position.x,
  23762. y: e.position.y,
  23763. z: e.position.z
  23764. },
  23765. rotation: {
  23766. x: h.Math.radToDeg(t.x),
  23767. y: h.Math.radToDeg(t.y),
  23768. z: 0
  23769. },
  23770. pano: e.currentPano ? e.currentPano.id : null,
  23771. mode: e.mode
  23772. }
  23773. }
  23774. ), D = null;
  23775. function N() {
  23776. N.playerDirection.copy(N.player.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  23777. N.player.getDirection(N.playerDirection),
  23778. N.projectVectors();
  23779. var e = N.playerDirection.angleTo(N.lastFacingDirection);
  23780. (N.angleTravelled += Math.abs(e)) >= Math.abs(N.angle) ? (N.active = !1,
  23781. N.onDone && (0,
  23782. N.onDone)()) : (N.lastFacingDirection.copy(N.playerDirection),
  23783. window.setTimeout(N, 4))
  23784. }
  23785. X.exports = {
  23786. init: function(e, t, i, n, r) {
  23787. Y.init(e, t, i, r),
  23788. D = new Promise(function(e, t) {
  23789. i.on(_.Ready, function() {
  23790. e()
  23791. })
  23792. }
  23793. .bind(this));
  23794. var o = new u(window)
  23795. , a = o.waitForConnection();
  23796. a.then(function(e) {
  23797. o.on(f.ACTION, Y.onMessageReceive.bind(Y))
  23798. });
  23799. var s, l = (s = Date.now(),
  23800. function() {
  23801. if (!(Date.now() - s < 100)) {
  23802. var e = L(i);
  23803. o.sendEvent(b.MOVE, {
  23804. state: e
  23805. }),
  23806. s = Date.now()
  23807. }
  23808. }
  23809. );
  23810. i.on(_.Move, l),
  23811. i.on(_.ViewChanged, l),
  23812. n.on(p.ActiveModelChanged, function(e) {
  23813. function t(e) {
  23814. var t, i = e.newPano.id;
  23815. e.oldPano && (t = e.oldPano.id),
  23816. i !== t && o.sendEvent(b.ENTER_PANO, {
  23817. oldPano: t,
  23818. newPano: i
  23819. })
  23820. }
  23821. var i = e.model
  23822. , n = e.oldModel;
  23823. Y.model = i,
  23824. a.then(function() {
  23825. o.sendEvent(b.MODEL_LOADED, {
  23826. metadata: c(i)
  23827. })
  23828. }),
  23829. n && n.panos.forEach(function(e) {
  23830. e.removeEventListener("enter", t)
  23831. }),
  23832. i.panos.forEach(function(e) {
  23833. e.on("enter", t)
  23834. })
  23835. })
  23836. }
  23837. };
  23838. var F, B, V, k, U, H, z, G, W, j, Y = {
  23839. director: null,
  23840. player: null,
  23841. controls: null,
  23842. sceneRenderer: null,
  23843. model: null,
  23844. init: function(e, t, i, n) {
  23845. this.director = e,
  23846. this.player = i,
  23847. this.controls = t,
  23848. this.sceneRenderer = n
  23849. },
  23850. handleToObject: {},
  23851. objectToHandle: {},
  23852. handleCount: 0,
  23853. onMessageReceive: function(e) {
  23854. if (e) {
  23855. var t = e.targetFunction
  23856. , i = e.params
  23857. , n = e.onDone;
  23858. t && this[t] && this[t](i, n)
  23859. }
  23860. },
  23861. waitForInit: function(e, t) {
  23862. D.then(t.bind({
  23863. success: !0,
  23864. message: "Init complete."
  23865. }))
  23866. },
  23867. moveToPano: (W = new h.Euler(0,0,0,"YXZ"),
  23868. j = new h.Quaternion,
  23869. function(e, t) {
  23870. var i = e.pano
  23871. , n = e.rotation
  23872. , r = e.transition;
  23873. if (!this.model)
  23874. return t({
  23875. success: !1,
  23876. error: "The model has not been loaded yet"
  23877. });
  23878. var o = this.model.panos.get(i);
  23879. if (!o)
  23880. return t({
  23881. success: !1,
  23882. error: i + " does not exist in this model"
  23883. });
  23884. if (!n)
  23885. return t({
  23886. sucess: !1,
  23887. erorr: n + " is not a valid rotation"
  23888. });
  23889. W.set(h.Math.degToRad(n.x || 0), h.Math.degToRad(n.y || 0), h.Math.degToRad(n.z || 0), "YXZ"),
  23890. console.log(n.z);
  23891. var a = {
  23892. success: !0,
  23893. message: i
  23894. };
  23895. if (r === v.FADEOUT)
  23896. j.setFromEuler(W),
  23897. this.player.warpToPano(o, j, null, null, E.BLACK, null, null, t.bind(this, a));
  23898. else {
  23899. var s, l;
  23900. r === v.INSTANT && (l = s = 0);
  23901. var c = C.FORWARD.clone().applyEuler(W).add(o.position);
  23902. this.player.flyToPano({
  23903. pano: o,
  23904. lookAtPoint: c,
  23905. duration: s,
  23906. aimDuration: l
  23907. }, t.bind(this, a))
  23908. }
  23909. }
  23910. ),
  23911. moveInDirection: function(e, t) {
  23912. var i = e.direction;
  23913. return void 0 === m[i] ? (M.warn("Showcase -> moveInDirection: Cannot move in invalid direction."),
  23914. void (t && t({
  23915. success: !1,
  23916. error: "Invalid direction."
  23917. }))) : void this.player.flyLocalDirection(C[i].clone()).then(function(e) {
  23918. t(e ? {
  23919. success: !0,
  23920. message: "moved " + i
  23921. } : {
  23922. success: !1,
  23923. error: "Cannot move in direction: " + i
  23924. })
  23925. })
  23926. },
  23927. getPose: function(e, t) {
  23928. return this.player.camera.position,
  23929. (new h.Euler).setFromQuaternion(this.player.camera.quaternion, "YXZ"),
  23930. t({
  23931. success: !0,
  23932. message: L(this.player)
  23933. })
  23934. },
  23935. takeScreenShot: (z = new h.PerspectiveCamera,
  23936. G = new h.WebGLRenderTarget,
  23937. function(e, t) {
  23938. if (!e.resolution)
  23939. return t({
  23940. success: !1,
  23941. error: "An invalid resolution was specified"
  23942. });
  23943. if (-1 === e.resolution.width || -1 === e.resolution.height) {
  23944. var i = this.sceneRenderer.renderer.getSize();
  23945. e.resolution.width = i.width,
  23946. e.resolution.height = i.height
  23947. }
  23948. z.layers.set(T.DEFAULT),
  23949. e.visibleObjects && (e.visibleObjects.showtags && z.layers.enable(T.TAG),
  23950. e.visibleObjects.showPucks && z.layers.enable(T.PANOMARKERS),
  23951. e.visibleObjects.showReticule && z.layers.enable(T.RETICULE));
  23952. var n = e.resolution.width
  23953. , r = e.resolution.height
  23954. , o = n / r;
  23955. z.position.copy(this.sceneRenderer.camera.position),
  23956. z.quaternion.copy(this.sceneRenderer.camera.quaternion),
  23957. z.projectionMatrix.copy(this.player.camera.projectionMatrix),
  23958. z.projectionMatrix.elements[0] = this.player.camera.projectionMatrix.elements[5] / o,
  23959. G.setSize(n, r),
  23960. this.sceneRenderer.renderer.render(this.sceneRenderer.scene, z, G);
  23961. var a = new Uint8Array(n * r * 4);
  23962. this.sceneRenderer.renderer.readRenderTargetPixels(G, 0, 0, n, r, a);
  23963. var s = S.encode({
  23964. data: a,
  23965. width: n,
  23966. height: r,
  23967. heading: 180,
  23968. pitch: 0
  23969. }, {
  23970. quality: 75,
  23971. flipY: !0
  23972. });
  23973. t({
  23974. success: !0,
  23975. message: "data:image/jpg;base64," + d.uint8ToBase64(s.data)
  23976. })
  23977. }
  23978. ),
  23979. findRankedPano: (U = new h.Vector3,
  23980. H = new h.Vector3,
  23981. function(e, t) {
  23982. a(this.player, H),
  23983. r(t, H, U);
  23984. var i = this.player.rankedPanoInDirection(e, U);
  23985. if (i) {
  23986. var n = this.objectToHandle[i.id];
  23987. return n || (this.objectToHandle[i.id] = n = this.handleCount++,
  23988. this.handleToObject[n] = i),
  23989. n
  23990. }
  23991. return M.warn("Showcase -> findRankedPano: Unable to find nearby pano."),
  23992. -1
  23993. }
  23994. ),
  23995. findRankedtag: (V = new h.Vector3,
  23996. k = new h.Vector3,
  23997. function(e, t) {
  23998. a(this.player, k),
  23999. r(t, k, V);
  24000. var i = this.player.rankedtagInDirection(e, V);
  24001. if (i) {
  24002. var n = this.objectToHandle[i.sid];
  24003. return n || (this.objectToHandle[i.sid] = n = this.handleCount++,
  24004. this.handleToObject[n] = i),
  24005. n
  24006. }
  24007. return M.warn("Showcase -> findRankedtag: Unable to find nearby tag."),
  24008. -1
  24009. }
  24010. ),
  24011. clickNearesttag: function(e) {
  24012. this.clickRankedtag(0, e)
  24013. },
  24014. clickRankedtag: function(e, t) {
  24015. var i = function(e, t) {
  24016. var i = this.findRankedtag(e, t);
  24017. return 0 <= i ? this.handleToObject[i] : (M.warn("Showcase -> findRankedtagObject: Unable to find nearby tag."),
  24018. null)
  24019. }
  24020. .call(this, e, t);
  24021. i && P.call(this, i)
  24022. },
  24023. clickNearestPano: function(e, t) {
  24024. this.clickRankedPano(0, e, t)
  24025. },
  24026. clickRankedPano: function(e, t, i) {
  24027. var n = function(e, t) {
  24028. var i = this.findRankedPano(e, t);
  24029. return 0 <= i ? this.handleToObject[i] : (M.warn("Showcase -> findRankedPanoObject: Unable to find nearby pano."),
  24030. null)
  24031. }
  24032. .call(this, e, t);
  24033. n ? o.call(this, n, i) : i(null)
  24034. },
  24035. clickPano: function(e, t) {
  24036. var i = this.handleTable[e];
  24037. i ? o.call(this, i, t) : t(null)
  24038. },
  24039. rotateDirection: function(e, t) {
  24040. var i = e.direction
  24041. , n = e.angle;
  24042. if (!R.active) {
  24043. var r = 0
  24044. , o = 0
  24045. , a = 0
  24046. , s = 0;
  24047. if (!n || isNaN(n))
  24048. return M.warn("Showcase -> rotateDirection: Invalid rotation angle."),
  24049. void (t && t({
  24050. success: !1,
  24051. error: "Invalid rotation angle."
  24052. }));
  24053. if (this.player.mode === I.TRANSITIONING)
  24054. return M.warn("Automation -> rotateDirection: Cannot rotate while transitioning"),
  24055. void (t && t({
  24056. success: !1,
  24057. error: "Cannot rotate while transitioning"
  24058. }));
  24059. if (i === m.RIGHT || i === m.LEFT)
  24060. i === m.RIGHT && (n = -n),
  24061. r = 0 < n ? -1 : 1,
  24062. a = n;
  24063. else {
  24064. if (i !== m.UP && i !== m.DOWN)
  24065. return M.warn("Showcase -> rotateDirection: Invalid direction for rotation: " + i),
  24066. void (t && t({
  24067. success: !1,
  24068. error: "Invalid direction for rotation."
  24069. }));
  24070. if (this.player.mode === I.FLOORPLAN)
  24071. return M.warn("Showcase -> rotateDirection: Cannot rotate " + i + " in floorplan mode"),
  24072. void (t && t({
  24073. success: !1,
  24074. error: "Cannot rotate " + i + " in floorplan mode"
  24075. }));
  24076. if (i === m.DOWN && (n = -n),
  24077. 0 === (n = O.call(this, n)))
  24078. return M.warn("Showcase -> rotateDirection: Already at maximum rotation in direction: " + i),
  24079. void (t && t({
  24080. success: !1,
  24081. error: "Already at maximum rotation in direction: " + i
  24082. }));
  24083. o = 0 < n ? 1 : -1,
  24084. s = n
  24085. }
  24086. var l = n;
  24087. n = h.Math.degToRad(n),
  24088. a = h.Math.degToRad(a),
  24089. s = h.Math.degToRad(s);
  24090. var c = this.controls.activeControl;
  24091. c.startRotating(r, o),
  24092. R.start(a, s, this.player, function() {
  24093. c.stopRotating(!0),
  24094. t && t({
  24095. success: !0,
  24096. message: "Rotated " + l.toFixed(2) + "° in direction: " + e.direction
  24097. })
  24098. })
  24099. }
  24100. },
  24101. rotate: (F = new h.Vector3,
  24102. B = new h.Vector3,
  24103. function(e, t) {
  24104. var i = e.xAngle
  24105. , n = e.yAngle;
  24106. if (!R.active) {
  24107. if (i = i || 0,
  24108. n = n || 0,
  24109. isNaN(i) || isNaN(n))
  24110. return M.warn("Showcase -> rotate: Invalid rotation angle."),
  24111. void (t && t({
  24112. success: !1,
  24113. error: "Invalid rotation angle."
  24114. }));
  24115. if (this.player.mode === I.TRANSITIONING)
  24116. return M.warn("Automation -> rotate: Cannot rotate while transitioning"),
  24117. void (t && t({
  24118. success: !1,
  24119. error: "Cannot rotate while transitioning"
  24120. }));
  24121. Math.abs(i) < .01 && (i = 0),
  24122. Math.abs(n) < .01 && (n = 0);
  24123. var r = n;
  24124. n = O.call(this, n);
  24125. var o = 0 < r ? "UP" : "DOWN";
  24126. if (!(i = -i) && r && !n)
  24127. return M.warn("Showcase -> rotate: Already at maximum rotation in direction: " + o),
  24128. void (t && t({
  24129. success: !1,
  24130. error: "Already at maximum rotation in direction: " + o
  24131. }));
  24132. n < r && M.warn("Showcase -> rotate: Reached maximum rotation in direction: " + o);
  24133. var a = n;
  24134. n = h.Math.degToRad(n),
  24135. i = h.Math.degToRad(i),
  24136. F.copy(this.player.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  24137. this.player.getDirection(F),
  24138. B.copy(F).applyAxisAngle(C.UP, i),
  24139. B.applyAxisAngle(C.RIGHT, n);
  24140. var s = (F.angleTo(B),
  24141. 0 < i ? -1 : i < 0 ? 1 : 0)
  24142. , l = 0 < n ? 1 : n < 0 ? -1 : 0;
  24143. Math.abs(i) > Math.abs(n) ? l *= Math.abs(n / i) : Math.abs(n) > Math.abs(i) && (s *= Math.abs(i / n));
  24144. var c = this.controls.activeControl;
  24145. c.startRotating(s, l),
  24146. R.start(i, n, this.player, function() {
  24147. c.stopRotating(!0),
  24148. t && t({
  24149. success: !0,
  24150. message: "Rotated " + e.xAngle.toFixed(2) + "° horizontally, " + a.toFixed(2) + "° vertically"
  24151. })
  24152. })
  24153. }
  24154. }
  24155. ),
  24156. panCamera: function(e, i) {
  24157. function t(e) {
  24158. switch (r.removeAllListeners(w.AutoPanComplete),
  24159. r.removeAllListeners(w.AutoPanInterrupt),
  24160. r.removeAllListeners(w.AutoPanClamped),
  24161. e) {
  24162. case w.AutoPanInterrupt:
  24163. i({
  24164. success: !0,
  24165. message: "Camera panning interrupted."
  24166. });
  24167. break;
  24168. case w.AutoPanClamped:
  24169. if (r.autoPanPosition.x !== n.x || r.autoPanPosition.z !== n.z) {
  24170. if (Math.abs(this.player.position.x - r.autoPanPosition.x) < .01 && Math.abs(this.player.position.z - r.autoPanPosition.z) < .01)
  24171. return void i({
  24172. success: !1,
  24173. error: "Already at edge of current model bounds."
  24174. });
  24175. var t = "The view point is outside the bounds for the current model. ";
  24176. t += "The view point was clamped to " + o(r.target.x, r.target.z),
  24177. console.warn(t)
  24178. }
  24179. case w.AutoPanComplete:
  24180. i({
  24181. success: !0,
  24182. message: "Panned camera to position " + o(r.autoPanPosition.x, r.autoPanPosition.z)
  24183. })
  24184. }
  24185. }
  24186. if (this.player.mode !== I.DOLLHOUSE && this.player.mode !== I.FLOORPLAN)
  24187. return i({
  24188. success: !1,
  24189. error: "Camera panning is not available in the current mode: " + this.player.mode
  24190. });
  24191. var n = e.position
  24192. , r = this.player.control;
  24193. r.setAutoPanPosition(n.x, n.z),
  24194. r.autoPan = !0;
  24195. var o = function(e, t) {
  24196. return "(" + e.toFixed(2) + ", " + t.toFixed(2) + ")"
  24197. };
  24198. r.on(w.AutoPanComplete, t.bind(this, w.AutoPanComplete)),
  24199. r.on(w.AutoPanInterrupt, t.bind(this, w.AutoPanInterrupt)),
  24200. r.on(w.AutoPanClamped, t.bind(this, w.AutoPanClamped))
  24201. },
  24202. click: function(e, t) {
  24203. var i = e.x
  24204. , n = e.y;
  24205. !0 === e.percentage && (i = i / 100 * $("#player").width(),
  24206. n = n / 100 * $("#player").height()),
  24207. this.player.handleInputStart(i, n),
  24208. this.player.updateIntersect(),
  24209. this.player.handleInputEnd(i, n)
  24210. },
  24211. mouseOver: function(e, t) {
  24212. var i = e.x
  24213. , n = e.y;
  24214. !0 === e.percentage && (i = i / 100 * $("#player").width(),
  24215. n = n / 100 * $("#player").height()),
  24216. this.player.handleInputMove(i, n),
  24217. this.player.updateIntersect()
  24218. },
  24219. moveToMode: function(e, t) {
  24220. function i(e) {
  24221. t(e ? {
  24222. success: !1,
  24223. error: "Failed to load new mode: " + e
  24224. } : {
  24225. success: !0,
  24226. message: "Moved to new mode: " + n
  24227. })
  24228. }
  24229. var n = e.mode;
  24230. n === I.PANORAMA || n === I.DOLLHOUSE || n === I.FLOORPLAN ? this.director.changeMode(n).then(function() {
  24231. i()
  24232. }, function(e) {
  24233. i(e)
  24234. }) : t({
  24235. success: !1,
  24236. error: "Invalid mode selection"
  24237. })
  24238. }
  24239. }
  24240. }
  24241. ).call(this, "/js/sdk/automation.js")
  24242. }
  24243. , {
  24244. "../constants": 8,
  24245. "../enum/AlignmentType": 17,
  24246. "../enum/ControlEvents": 21,
  24247. "../enum/Direction": 22,
  24248. "../enum/GLCubeFaces": 25,
  24249. "../enum/Keys": 30,
  24250. "../enum/ModelManagerEvents": 33,
  24251. "../enum/PlayerEvents": 40,
  24252. "../enum/RenderLayers": 41,
  24253. "../enum/Vectors": 50,
  24254. "../enum/Viewmode": 51,
  24255. "../enum/WarpStyle": 52,
  24256. "../lib/jpeg_encoder": 94,
  24257. "../sdk/SdkEvents": 161,
  24258. "../settings": 166,
  24259. "../util/common": 185,
  24260. "../util/logger": 189,
  24261. "../util/math": 190,
  24262. "../util/panorama": 191,
  24263. "./ApiHost": 159,
  24264. "./PostMessageType": 160,
  24265. "./TransitionStyles": 162,
  24266. three: 217
  24267. }],
  24268. 165: [function(e, t, i) {
  24269. "use strict";
  24270. function n(e) {
  24271. this.sourceWindow = e,
  24272. this.targetWindow = null,
  24273. this.targetOrigin = null,
  24274. this.id = Math.floor(1e5 * Math.random()),
  24275. this.bindEvents()
  24276. }
  24277. var r = e("./PostMessageType")
  24278. , o = e("events").EventEmitter;
  24279. (n.prototype = Object.create(o.prototype)).bindEvents = function() {
  24280. this.sourceWindow.addEventListener("message", this.onPostmessageReceived.bind(this))
  24281. }
  24282. ,
  24283. n.prototype.setTarget = function(e, t) {
  24284. this.targetWindow = e,
  24285. this.targetOrigin = t
  24286. }
  24287. ,
  24288. n.prototype.onPostmessageReceived = function(e) {
  24289. var t = e.origin || e.originalEvent.origin
  24290. , i = e.source;
  24291. switch (e.data.type) {
  24292. case r.CONNECT:
  24293. break;
  24294. case r.RESPONSE:
  24295. if (this.id !== e.data.toId)
  24296. return;
  24297. default:
  24298. if (!this.validateMessageOrigin(t))
  24299. return
  24300. }
  24301. var n = e.data;
  24302. n.source = i,
  24303. n.origin = t,
  24304. n.timestamp = Date.now(),
  24305. this.emit(e.data.type, n)
  24306. }
  24307. ,
  24308. n.prototype.validateMessageOrigin = function(e) {
  24309. return "*" === this.targetOrigin || e === this.targetOrigin
  24310. }
  24311. ,
  24312. n.prototype.send = function(e) {
  24313. this.targetWindow && this.targetOrigin && (e.fromId = this.id,
  24314. this.targetWindow.postMessage(e, this.targetOrigin))
  24315. }
  24316. ,
  24317. t.exports = n
  24318. }
  24319. , {
  24320. "./PostMessageType": 160,
  24321. events: 202
  24322. }],
  24323. 166: [function(e, t, i) {
  24324. "use strict";
  24325. var n = e("three")
  24326. , r = e("./util/browser")
  24327. , o = e("./enum/Viewmode")
  24328. , a = e("./enum/VROption")
  24329. , s = e("./enum/Colors")
  24330. , l = e("./enum/WarpStyle")
  24331. , c = e("./util/easing")
  24332. , h = e("./util/common")
  24333. , u = e("./util/showcase")
  24334. , d = e("./constants")
  24335. , p = {
  24336. debug: !1,
  24337. version: "2.25.6-0-gd87e5b1",
  24338. languageTag: r.valueFromHash("lang", null),
  24339. pageTitle: "四维虚拟漫游",
  24340. authorizationHeader: u.getAuthorizationHeader(),
  24341. autoplay: r.valueFromHash("play", !1) || !r.inIframe(),
  24342. logLevel: r.valueFromHash("log", 2),
  24343. skyboxRadius: 2500,
  24344. modelBoundsPadding: 5,
  24345. showNeighbors: !1,
  24346. brand: r.valueFromHash("brand", !0),
  24347. showHighlights: r.valueFromHash("hhl", !0) && r.valueFromHash("hr", 1),
  24348. startHighlights: r.valueFromHash("hl", -1),
  24349. specialEdition: r.valueFromHash("bn", 0),
  24350. useWheel: r.valueFromHash("wh", !0),
  24351. crossOrigin: "anonymous",
  24352. fancierTransition: !1,
  24353. wireframe: !1,
  24354. skyboxWireframe: !1,
  24355. modelAlpha: 1,
  24356. highlightPanoSelection: !1,
  24357. showSweeps: !0,
  24358. showSkyboxes: !1,
  24359. showMesh: !0,
  24360. showFloors: !1,
  24361. showFloorDuration: 300,
  24362. showFloorDelay: 300,
  24363. hideFloorDuration: 300,
  24364. hideFloorDelay: 0,
  24365. reticuleOpacityTransitionTime: 250,
  24366. reticuleColor: window.MP_PREFETCHED_MODELDATA.mouseMarkerColor || s.newBlue,
  24367. markerOpacityTransitionTime: 500,
  24368. guiAnimationSpeed: 250,
  24369. highlightAnimationDuration: 500,
  24370. modelComponentLoadSpinnerDelay: 150,
  24371. captureErrors: !1,
  24372. maxMobileTextures: 6,
  24373. minimalMemoryMode: r.valueFromHash("m3", r.isMobile()),
  24374. startupFlyinDelay: 3e3,
  24375. dollhouseDefault: {
  24376. minDistance: 1,//15, //编辑页面给近一些
  24377. maxDistance: 50,
  24378. minPolarAngle: n.Math.degToRad(10),
  24379. maxPolarAngle: n.Math.degToRad(90)
  24380. },
  24381. hideReticuleTimeout: 1e3,
  24382. analytics: {
  24383. inactivityThreshold: 30,
  24384. sessionTrackingRate: .15,
  24385. maxTrackedErrors: 20,
  24386. sessionDurationPingFrequency: 10,
  24387. sessionDurationTimeout: 15
  24388. },
  24389. flydown: {
  24390. movementEasing: "easeInOutQuad",
  24391. movementDelay: .001,
  24392. rotationEasing: "easeInOutQuad",
  24393. rotationDelay: .5,
  24394. modelTextureDelay: .75,
  24395. skyboxDelay: .75
  24396. },
  24397. transition: {
  24398. flySpeed: .001,
  24399. flyTime: 750,
  24400. flytimeMaxDistanceThreshold: 5,
  24401. flytimeDistanceMultiplier: 150,
  24402. aimTime: 1500,
  24403. aimSlowFactor: 1.5,
  24404. blur: .8,
  24405. movementEasing: "easeInOutQuad",
  24406. blendEasing: "easeInOutQuad",
  24407. fastForwardFactor: 3
  24408. },
  24409. show360Views: {
  24410. enabled: !0,
  24411. transitionTime: 1e3
  24412. },
  24413. quickstart: {
  24414. enabled: 1 === r.valueFromHash("qust", 0) || 1 === r.valueFromHash("qs", 0),
  24415. animation: 1400,
  24416. showTextDelay: 500,
  24417. fadeOutDelay: 3e3,
  24418. fovChange: 10
  24419. },
  24420. appConfig: {
  24421. webvr_version: null,
  24422. segment_key: null,
  24423. embedly_key: null,
  24424. branch_key: null,
  24425. keen_write_key: null,
  24426. keen_project_id: null
  24427. },
  24428. vr: {
  24429. enabled: !0,
  24430. allowWebVR: !1,
  24431. option: r.valueFromHash("vr", a.CONTEXTUAL)
  24432. },
  24433. share: {
  24434. enabled: !r.valueFromHash("mls", 0) && r.valueFromHash("brand", !0)
  24435. },
  24436. input: {
  24437. longTapThreshold: 200,
  24438. moveToleranceNDC: .08,
  24439. touchMoveThreshold: 25
  24440. },
  24441. help: {
  24442. modalStayDuration: 600
  24443. },
  24444. immersive: {
  24445. timeToShowAgain: 1250,
  24446. uiStayDuration: 600
  24447. },
  24448. tourInteraction: {
  24449. disabled: "0" === r.valueFromHash("tourcta", null),
  24450. showPauseButton: 1e3,
  24451. showModal: 1500,
  24452. allowNextClick: 200,
  24453. largeModal: "1" === r.valueFromHash("tourcta", null),
  24454. smallModal: "2" === r.valueFromHash("tourcta", null)
  24455. },
  24456. labels: {
  24457. enabled: !1,
  24458. hideUntilStart: !0,
  24459. fadeInDuration: 250,
  24460. fadeInDelay: 250,
  24461. fadeOutDuration: 250,
  24462. fadeOutDelay: 0,
  24463. zoomHideThreshhold: {
  24464. mobile: r.isSmallScreen() ? .45 : .6,
  24465. desktop: 2
  24466. },
  24467. zoomTruncateThreshhold: {
  24468. mobile: r.isSmallScreen() ? .35 : .45,
  24469. desktop: .85
  24470. },
  24471. minLengthForTruncate: 16,
  24472. truncateLength: 12,
  24473. truncateSuffix: "..."
  24474. },
  24475. tags: {
  24476. enabled: r.valueFromHash("mt", 1),
  24477. startup: {
  24478. hideUntilStart: !0,
  24479. fadeInDuration: 500,
  24480. fadeInDelay: 100
  24481. },
  24482. visibility: {
  24483. anyDistance: !0,
  24484. visibleDistance: 8,
  24485. cameraClearance: .1,
  24486. alphaTestLevel: .05,
  24487. hideViaFloor: !0,
  24488. hideOffScreenDisc: !1,
  24489. hideOffScreenObject: !1
  24490. },
  24491. disc: {
  24492. opacity: 1,
  24493. disabledOpacity: .5,
  24494. scale: {
  24495. nearBound: 1.5,
  24496. farBound: 4.8,
  24497. linkFarBound: !1,
  24498. linkPercent: 40,
  24499. maxSize: 80,
  24500. minSize: 40,
  24501. baseViewportSize: 800,
  24502. responsiveness: 100
  24503. }
  24504. },
  24505. pole: {
  24506. enabled: !0,
  24507. height: .5,
  24508. width: 2,
  24509. opacity: .5,
  24510. color: "white"
  24511. },
  24512. navigate: {
  24513. nearestPano: !0,
  24514. lineOfSight: !0,
  24515. reactivate: !0,
  24516. aimAt: "disc",
  24517. tiltTolerance: 25,
  24518. rotateSpeedFactor: .6
  24519. }
  24520. },
  24521. path: {
  24522. color: window.MP_PREFETCHED_MODELDATA.floorMarkerColor || s.newBlue,
  24523. colorUp: s._desat(s.newBlue, .5),
  24524. colorDown: s._darken(s.newBlue, .35),
  24525. opacity: .5,
  24526. style: "ribbon",
  24527. height: .025,
  24528. ribbonWidth: .24,
  24529. outsideHeight: .5,
  24530. waypointRadius: .5,
  24531. waypointIndoorRadius: .24,
  24532. waypointPulse: 1e3,
  24533. typ: l.BLACK,
  24534. meshFree: r.valueFromHash("mf", 1),
  24535. mapGuides: r.valueFromHash("guides", !0),
  24536. fadeInTime: 400,
  24537. fadeOutTime: 300
  24538. },
  24539. warp: {
  24540. nearPanoDist: .1,
  24541. matchCam: !1,
  24542. blur: .33,
  24543. fastTime: 1500,
  24544. teleportTime: 1500,
  24545. outsideTime: 2e3,
  24546. lookAheadMax: .3,
  24547. lookAheadDist: 2.5,
  24548. softPushDist: .37,
  24549. softPushEnd: .3,
  24550. softBendAngle: 8,
  24551. softBendTilt: 4,
  24552. softBendEnd: .3,
  24553. doBurns: !0,
  24554. burnsAngle: 8,
  24555. minBurnsAngle: 35,
  24556. minDownAngle: -35,
  24557. maxTurnPerSec: 280,
  24558. maxAimPerSec: 35,
  24559. minRotation: 12,
  24560. maxAimRotation: 33.2,
  24561. turnFriction: .2,
  24562. flySpeed: .01,
  24563. minWarpTime: 1200,
  24564. warpInterruptionRedirectTime: 500,
  24565. tourStepDelay: r.valueFromHash("st", 0),
  24566. walkDelay: 0,
  24567. walkMaxDist: 50,
  24568. walkMinDist: .8,
  24569. walkSlideShowThreshhold: 3e3,
  24570. walkExtraPanosDistance: .4,
  24571. timePerMeter: 1200,
  24572. motionLeadTime: 5e3,
  24573. movementEasing: "easeInOutQuad",
  24574. blendEasing: "easeInOutQuad",
  24575. showBunny: !1,
  24576. loop: r.valueFromHash("lp", !1),
  24577. auto: r.valueFromHash("ts", -1),
  24578. eOrder: "YXZ",
  24579. stepFactor: .25,
  24580. brakeStrength: 2,
  24581. minBrakeAngle: .1,
  24582. maxBrakeAngle: 1.8,
  24583. climbEffort: 4
  24584. },
  24585. rotationFriction: .05,
  24586. rotationAccelerationInside: 4.5,
  24587. rotationAccelerationOutside: .15,
  24588. rotationAfterMoveMultiplier: 40,
  24589. rotationAfterMoveHistoryCount: 5,
  24590. panFriction: .09,
  24591. panAccelerationOutside: 60,
  24592. onload: r.valueFromHash("onload", o.PANORAMA),
  24593. zoomNearLimit: .1,
  24594. zoomFarLimit: 10,
  24595. navigation: {
  24596. panoScores: !1,
  24597. mouseDirection: !0,
  24598. filterStrictness: .75,
  24599. angleFactor: -30,
  24600. directionFactor: 10,
  24601. distanceFactor: -1,
  24602. optionalityFactor: 3
  24603. },
  24604. sdkInit: !1,
  24605. secretPanelWord: [38, 38, 40, 40, 37, 39, 37, 39, 66, 65],
  24606. console: r.valueFromHash("console", !1),
  24607. noMeshFloorPositionOffset: new n.Vector3(0,-1.2,0),
  24608. panoramaNeighbourMaxDistance: 5,
  24609. panoFloorClickRadius: .35,
  24610. showScreenshotLocations: !1,
  24611. showAxis: !1,
  24612. showNeighbourRaycasts: !1,
  24613. colorMarkerOnLoad: !1,
  24614. colorMarkerByFloor: !1,
  24615. tiling: {
  24616. panoPreRenderRepeatDelay: 2500,
  24617. panoPreRenderDelay: 500,
  24618. preRenderTourPanos: r.valueFromHash("tileprerender", 0),
  24619. tilingFlagNames: ["usetiles", "tiles"],
  24620. maxNavPanoQuality: r.valueFromHash("maxtileq", null),
  24621. maxZoomPanoQuality: r.valueFromHash("maxztileq", null),
  24622. overlayStyle: r.valueFromHash("tileoverlay", 0),
  24623. uploadIntervalDelay: r.valueFromHash("tileupdelay", 10),
  24624. initialIntervalDelay: r.valueFromHash("itiledelay", 0),
  24625. maxNonBaseUploadsPerFrame: r.valueFromHash("maxnbtpf", 2),
  24626. maxBaseUploadsPerFrame: r.valueFromHash("maxbtpf", 6),
  24627. customCompression: r.valueFromHash("tilecustcomp", 0),
  24628. mobileHighQualityOverride: 1,
  24629. allowUltraHighResolution: !0
  24630. },
  24631. zoom: {
  24632. enabled: !0,
  24633. forceOff: r.valueFromHash("nozoom", 0),
  24634. overridemax: r.valueFromHash("maxzoom", null),
  24635. overridemin: r.valueFromHash("minzoom", null),
  24636. max: d.highQualityMaxZoom,
  24637. min: 1,
  24638. transitionStyle: r.valueFromHash("zoomtrans", 1),
  24639. activationThreshold: 1.1,
  24640. restoreTime: 500
  24641. },
  24642. profiling: {
  24643. enabled: r.valueFromHash("mem", !1)
  24644. }
  24645. };
  24646. (p = h.deepExtend(p, d, {
  24647. insideFOV: r.valueFromHash("fov", d.insideFOV),
  24648. insideFOVMax: r.valueFromHash("fovmax", d.insideFOVMax),
  24649. panorama: {
  24650. transitionTime: 1e3,
  24651. modelAlpha: 0,
  24652. modelAlphaDelay: p.flydown.modelTextureDelay,
  24653. modelAlphaLength: 1,
  24654. skyboxOpacity: 1,
  24655. skyboxOpacityDelay: p.flydown.skyboxDelay,
  24656. skyboxOpacityLength: .9,
  24657. fovLength: 1,
  24658. fovDelay: 0,
  24659. cameraMatrixDuration: .8,
  24660. cameraMatrixDelay: 0,
  24661. cameraMatrixEase: c.easeInCubic,
  24662. reticuleOpacity: 1,
  24663. markerOpacity: .3,
  24664. markerOpacityOnHover: 1
  24665. },
  24666. dollhouse: {
  24667. transitionTime: 1e3,
  24668. modelAlpha: 1,
  24669. modelAlphaDelay: 0,
  24670. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  24671. skyboxOpacity: 0,
  24672. skyboxOpacityDelay: 0,
  24673. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  24674. fovLength: 1,
  24675. fovDelay: 0,
  24676. cameraMatrixDuration: .8,
  24677. cameraMatrixDelay: .3,
  24678. cameraMatrixEase: c.easeInCubic,
  24679. reticuleOpacity: 1,
  24680. markerOpacity: 0,
  24681. markerOpacityOnHover: 0
  24682. },
  24683. floorplan: {
  24684. transitionTime: 1e3,
  24685. modelAlpha: 1,
  24686. modelAlphaDelay: 0,
  24687. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  24688. skyboxOpacity: 0,
  24689. skyboxOpacityDelay: 0,
  24690. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  24691. fovLength: 1,
  24692. fovDelay: 0,
  24693. cameraMatrixDuration: .5,
  24694. cameraMatrixDelay: 0,
  24695. cameraMatrixEase: c.easeOutCubic,
  24696. reticuleOpacity: 1,
  24697. markerOpacity: 0,
  24698. markerOpacityOnHover: 0,
  24699. cameraHeight: 50
  24700. },
  24701. transitioning: {
  24702. reticuleOpacity: 0,
  24703. markerOpacity: .3,
  24704. markerOpacityOnHover: 1
  24705. },
  24706. "floorplan-dollhouse": {
  24707. rotationDelay: 0,
  24708. rotationDuration: 1
  24709. },
  24710. "floorplan-panorama": {
  24711. rotationDelay: .5,
  24712. rotationDuration: 1
  24713. },
  24714. "dollhouse-panorama": {
  24715. rotationDelay: .5,
  24716. rotationDuration: 1
  24717. },
  24718. "dollhouse-floorplan": {
  24719. rotationDelay: 0,
  24720. rotationDuration: 1,
  24721. cameraMatrixDuration: 1.05,
  24722. cameraMatrixDelay: .5
  24723. },
  24724. "panorama-dollhouse": {
  24725. rotationDelay: 0,
  24726. rotationDuration: .5
  24727. },
  24728. "panorama-floorplan": {
  24729. transitionTime: 1500,
  24730. rotationDelay: 0,
  24731. rotationDuration: .5
  24732. }
  24733. })).path.meshFree && (p.path.typ = l.WALK),
  24734. p.zoom.max = p.zoom.overridemax || p.zoom.max,
  24735. p.zoom.min = p.zoom.overridemin || p.zoom.min,
  24736. t.exports = p
  24737. }
  24738. , {
  24739. "./constants": 8,
  24740. "./enum/Colors": 19,
  24741. "./enum/VROption": 47,
  24742. "./enum/Viewmode": 51,
  24743. "./enum/WarpStyle": 52,
  24744. "./util/browser": 182,
  24745. "./util/common": 185,
  24746. "./util/easing": 186,
  24747. "./util/showcase": 193,
  24748. three: 217
  24749. }],
  24750. 167: [function(e, t, i) {
  24751. "use strict";
  24752. var n = e("three")
  24753. , r = e("./settings")
  24754. , 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"
  24755. , a = "precision highp float;\nprecision highp int;\n\nuniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n";
  24756. t.exports = {
  24757. basicTextured: {
  24758. uniforms: {
  24759. tDiffuse: {
  24760. type: "t",
  24761. value: null
  24762. },
  24763. alpha: {
  24764. type: "f",
  24765. value: 1
  24766. }
  24767. },
  24768. vertexShader: "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  24769. 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}"
  24770. },
  24771. copyCubeMap: {
  24772. uniforms: {
  24773. tDiffuse: {
  24774. type: "t",
  24775. value: null
  24776. },
  24777. alpha: {
  24778. type: "f",
  24779. value: 1
  24780. }
  24781. },
  24782. 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}",
  24783. 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}"
  24784. },
  24785. cube: {
  24786. uniforms: {
  24787. map: {
  24788. type: "t",
  24789. value: null
  24790. },
  24791. opacity: {
  24792. type: "f",
  24793. value: 1
  24794. }
  24795. },
  24796. vertexShader: o + "varying vec3 vWorldPosition;\n\nvoid main() {\n vWorldPosition = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n",
  24797. 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"
  24798. },
  24799. model: {
  24800. uniforms: {
  24801. map: {
  24802. type: "t",
  24803. value: null
  24804. },
  24805. modelAlpha: {
  24806. type: "f",
  24807. value: r.modelAlpha
  24808. },
  24809. opacity: {
  24810. type: "f",
  24811. value: 1
  24812. },
  24813. progress: {
  24814. type: "f",
  24815. value: 0
  24816. },
  24817. blackout: {
  24818. type: "i",
  24819. value: 0
  24820. },
  24821. pano0Map: {
  24822. type: "t",
  24823. value: null
  24824. },
  24825. pano0Position: {
  24826. type: "v3",
  24827. value: new n.Vector3
  24828. },
  24829. pano0Matrix: {
  24830. type: "m4",
  24831. value: new n.Matrix4
  24832. },
  24833. pano1Map: {
  24834. type: "t",
  24835. value: null
  24836. },
  24837. pano1Position: {
  24838. type: "v3",
  24839. value: new n.Vector3
  24840. },
  24841. pano1Matrix: {
  24842. type: "m4",
  24843. value: new n.Matrix4
  24844. }
  24845. },
  24846. 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",
  24847. 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"
  24848. },
  24849. hot: {
  24850. uniforms: {
  24851. color: {
  24852. type: "c",
  24853. value: new n.Color(16720384)
  24854. },
  24855. opac: {
  24856. type: "f",
  24857. value: 0
  24858. },
  24859. texture1: {
  24860. type: "t",
  24861. value: null
  24862. },
  24863. texture2: {
  24864. type: "t",
  24865. value: null
  24866. }
  24867. },
  24868. vertexShader: "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv ;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  24869. 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"
  24870. },
  24871. modelOutside: {
  24872. uniforms: {
  24873. map: {
  24874. type: "t",
  24875. value: null
  24876. },
  24877. opacity: {
  24878. type: "f",
  24879. value: 1
  24880. }
  24881. },
  24882. vertexShader: o + "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  24883. 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"
  24884. },
  24885. ribbon: {
  24886. uniforms: {
  24887. map: {
  24888. type: "t",
  24889. value: null
  24890. },
  24891. opacity: {
  24892. type: "f",
  24893. value: 1
  24894. },
  24895. color: {
  24896. type: "c",
  24897. value: new n.Color(r.path.color)
  24898. }
  24899. },
  24900. 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",
  24901. 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"
  24902. },
  24903. waypoint: {
  24904. uniforms: {
  24905. map: {
  24906. type: "t",
  24907. value: null
  24908. },
  24909. opacity: {
  24910. type: "f",
  24911. value: 1
  24912. },
  24913. pulse: {
  24914. type: "f",
  24915. value: 1
  24916. },
  24917. nearFade: {
  24918. type: "v2",
  24919. value: new n.Vector2(2 * r.insideNear,2 * r.path.waypointIndoorRadius)
  24920. },
  24921. color: {
  24922. type: "c",
  24923. value: new n.Color(r.reticuleColor)
  24924. }
  24925. },
  24926. 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",
  24927. 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"
  24928. },
  24929. modelDebug: {
  24930. uniforms: {
  24931. map: {
  24932. type: "t",
  24933. value: null
  24934. },
  24935. modelAlpha: {
  24936. type: "f",
  24937. value: r.modelAlpha
  24938. },
  24939. depthmapRatio: {
  24940. type: "f",
  24941. value: 0
  24942. },
  24943. opacity: {
  24944. type: "f",
  24945. value: 1
  24946. },
  24947. progress: {
  24948. type: "f",
  24949. value: 0
  24950. },
  24951. considerOcclusion: {
  24952. type: "i",
  24953. value: r.fancierTransition
  24954. },
  24955. highlightPanoSelection: {
  24956. type: "i",
  24957. value: 0
  24958. },
  24959. useThirdPano: {
  24960. type: "i",
  24961. value: r.useThirdPano
  24962. },
  24963. pano0Map: {
  24964. type: "t",
  24965. value: null
  24966. },
  24967. pano0Depth: {
  24968. type: "t",
  24969. value: null
  24970. },
  24971. pano0Position: {
  24972. type: "v3",
  24973. value: new n.Vector3
  24974. },
  24975. pano0Matrix: {
  24976. type: "m4",
  24977. value: new n.Matrix4
  24978. },
  24979. pano0Weight: {
  24980. type: "f",
  24981. value: r.transition.pano0Weight
  24982. },
  24983. pano1Map: {
  24984. type: "t",
  24985. value: null
  24986. },
  24987. pano1Depth: {
  24988. type: "t",
  24989. value: null
  24990. },
  24991. pano1Position: {
  24992. type: "v3",
  24993. value: new n.Vector3
  24994. },
  24995. pano1Matrix: {
  24996. type: "m4",
  24997. value: new n.Matrix4
  24998. },
  24999. pano1Weight: {
  25000. type: "f",
  25001. value: r.transition.pano1Weight
  25002. },
  25003. pano2Map: {
  25004. type: "t",
  25005. value: null
  25006. },
  25007. pano2Depth: {
  25008. type: "t",
  25009. value: null
  25010. },
  25011. pano2Position: {
  25012. type: "v3",
  25013. value: new n.Vector3
  25014. },
  25015. pano2Matrix: {
  25016. type: "m4",
  25017. value: new n.Matrix4
  25018. },
  25019. pano2Weight: {
  25020. type: "f",
  25021. value: r.transition.pano2Weight
  25022. }
  25023. },
  25024. 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",
  25025. 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"
  25026. },
  25027. customDepth: {
  25028. uniforms: {
  25029. panoPosition: {
  25030. type: "v3",
  25031. value: new n.Vector3
  25032. }
  25033. },
  25034. 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",
  25035. 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"
  25036. },
  25037. skysphere: {
  25038. uniforms: {
  25039. radius: {
  25040. type: "f",
  25041. value: 0
  25042. }
  25043. },
  25044. 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",
  25045. 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"
  25046. },
  25047. tagDisc: {
  25048. uniforms: {
  25049. opacity: {
  25050. type: "f",
  25051. value: 0
  25052. },
  25053. color: {
  25054. type: "c",
  25055. value: new n.Color
  25056. },
  25057. bg: {
  25058. type: "t",
  25059. value: null
  25060. },
  25061. mask: {
  25062. type: "t",
  25063. value: null
  25064. }
  25065. },
  25066. vertexShader: o + "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  25067. 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"
  25068. }
  25069. }
  25070. window.shaders = t.exports;
  25071. }
  25072. , {
  25073. "./settings": 166,
  25074. three: 217
  25075. }],
  25076. 168: [function(E, _, e) {
  25077. (function(e) {
  25078. "use strict";
  25079. var t = E("three")
  25080. , i = (E("url"),
  25081. E("./util/ajax"))
  25082. , n = E("./settings")
  25083. , r = E("./util/logger")
  25084. , o = E("./util/math")
  25085. , a = E("./util/showcase")
  25086. , s = E("./objects/Panorama")
  25087. , l = new r(e)
  25088. , c = E("./model/Model")
  25089. , h = E("./shaders")
  25090. , u = E("./util/transitions")
  25091. , d = E("./objects/Chunk")
  25092. , p = E("./objects/Reticule")
  25093. , f = E("./objects/Skybox")
  25094. , g = E("./objects/Floor")
  25095. , m = E("./cameras/DollhouseCamera")
  25096. , v = E("./cameras/FloorplanCamera")
  25097. , y = E("./cameras/PanoramaCamera")
  25098. , A = E("./controls/DollhouseControls")
  25099. , C = E("./controls/FloorplanControls")
  25100. , I = E("./controls/PanoramaControls");
  25101. t.ImageUtils.crossOrigin = n.crossOrigin,
  25102. _.exports = {
  25103. shaders: h,
  25104. transitions: u,
  25105. Model: c,
  25106. Chunk: d,
  25107. Floor: g,
  25108. Skybox: f,
  25109. Reticule: p,
  25110. Panorama: s,
  25111. DollhouseCamera: m,
  25112. FloorplanCamera: v,
  25113. PanoramaCamera: y,
  25114. DollhouseControls: A,
  25115. FloorplanControls: C,
  25116. PanoramaControls: I,
  25117. getModel: function(e) {
  25118. if (!e.url)
  25119. throw 'getModel(): missing parameter "url"';
  25120. e.autoload = void 0 === e.autoload || e.autoload;
  25121. var t = a.parseSidUrl(e.url);
  25122. e.urlBase = t.urlBase,
  25123. e.urlModel = t.urlModel,
  25124. e.urlFiles = t.urlFiles;
  25125. var i = this._getPlatformError();
  25126. return i ? $.Deferred().reject(i).promise() : (this.options = e,
  25127. this._loadModel().then(this._buildModel.bind(this)))
  25128. },
  25129. _getPlatformError: function() {
  25130. 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"
  25131. },
  25132. _loadModel: function() {
  25133. return i.get(this.options.urlModel, {
  25134. responseType: "json",
  25135. prefetchFrom: "model",
  25136. auth: a.getAuthorizationHeader()
  25137. }).then(null, function() {
  25138. return l.warn("Model loading failed at initial metadata load"),
  25139. "loading-failed"
  25140. })
  25141. },
  25142. _buildModel: function(e) {
  25143. e = a.normalizeModeldata(e, o);
  25144. var t = new c(this.options,e);
  25145. return this.options.autoload ? t.load(!0) : $.when(t)
  25146. }
  25147. }
  25148. }
  25149. ).call(this, "/js/showcase.js")
  25150. }
  25151. , {
  25152. "./cameras/DollhouseCamera": 5,
  25153. "./cameras/FloorplanCamera": 6,
  25154. "./cameras/PanoramaCamera": 7,
  25155. "./controls/DollhouseControls": 10,
  25156. "./controls/FloorplanControls": 11,
  25157. "./controls/PanoramaControls": 13,
  25158. "./model/Model": 139,
  25159. "./objects/Chunk": 144,
  25160. "./objects/Floor": 146,
  25161. "./objects/Panorama": 148,
  25162. "./objects/Reticule": 149,
  25163. "./objects/Skybox": 152,
  25164. "./settings": 166,
  25165. "./shaders": 167,
  25166. "./util/ajax": 181,
  25167. "./util/logger": 189,
  25168. "./util/math": 190,
  25169. "./util/showcase": 193,
  25170. "./util/transitions": 195,
  25171. three: 217,
  25172. url: 208
  25173. }],
  25174. 169: [function(e, t, i) {
  25175. "use strict";
  25176. function l(e) {
  25177. var t = {
  25178. renderTarget: null,
  25179. inUse: !1,
  25180. size: -1,
  25181. pano: null
  25182. };
  25183. return t.inUse = !0,
  25184. t.size = e,
  25185. function(e) {
  25186. O.push(e)
  25187. }(t),
  25188. t
  25189. }
  25190. function c(e) {
  25191. for (var t = 0; t < O.length; t++) {
  25192. var i = O[t];
  25193. if (i.renderTarget === e)
  25194. return !(i.inUse = !1)
  25195. }
  25196. return !1
  25197. }
  25198. function n() {
  25199. this.tileDirectory = {},
  25200. this.activeRenderTargetDescriptors = {},
  25201. this.activePanos = [],
  25202. this.panoLODDescriptors = {},
  25203. this.panoDescriptors = {},
  25204. this.tileTrees = {},
  25205. this.sceneRenderer = null,
  25206. this.tileDownloader = null,
  25207. this.forceQueue = [],
  25208. this.uploadQueues = {},
  25209. this.uploadInterval = null,
  25210. this.uploadIntervalCancelled = !1,
  25211. this.usingTileOverlay = !1,
  25212. this.overlayTilesLoaded = !1,
  25213. this.overlayTileBase = null,
  25214. this.overlayTilesBasic = {},
  25215. this.overlayTilesEnhanced = {},
  25216. this.zoomRenderTarget = null,
  25217. this.zoomPano = null,
  25218. this.zoomingActive = !1,
  25219. this.zoomPanoId = null,
  25220. this.zoomPanoRenderingDisabled = !1,
  25221. this.direction = new _.Vector3,
  25222. this.initTime = -1,
  25223. this.maxBaseUploadsPerFrame = R,
  25224. this.maxNonBaseUploadsPerFrame = M
  25225. }
  25226. 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"),
  25227. e("../enum/PanoRendererEvents")), f = e("../enum/SceneRendererEvents"), g = e("../enum/TileDownloaderEvents"), m = e("../enum/Vectors"), v = (e("../enum/GLCubeFaces"),
  25228. e("../objects/Panorama"),
  25229. e("./TileTree")), y = (e("./TileDownloader"),
  25230. e("./TilePrioritizer")), A = e("./TileUtils"), C = (p = e("../enum/PanoSizeClass"),
  25231. e("../util/browser"),
  25232. 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 = {
  25233. Base: 0,
  25234. Remaining: 1
  25235. }, O = [];
  25236. function L(e) {
  25237. var t = e.shift();
  25238. return t.uploadQueued = !1,
  25239. t
  25240. }
  25241. (n.prototype = Object.create(w.prototype)).init = function(e, t, i) {
  25242. this.sceneRenderer = e,
  25243. this.tileDownloader = t,
  25244. this.qualityManager = i,
  25245. this.bindEvents(),
  25246. this.sceneRenderer.on(f.ContextCreated, this.loadOverlayTiles.bind(this)),
  25247. this.initTime = performance.now()
  25248. }
  25249. ,
  25250. n.prototype.getActivePanoTextures = function(e) {
  25251. e = e || [];
  25252. for (var t = 0; t < O.length; t++) {
  25253. var i = O[t];
  25254. i.renderTarget && i.renderTarget.texture && e.push(i.renderTarget.texture)
  25255. }
  25256. }
  25257. ,
  25258. n.prototype.hasQueuedTiles = function() {
  25259. var e = this.peekNextFromUploadQueue();
  25260. return null != e
  25261. }
  25262. ,
  25263. n.prototype.getActiveRenderTargetDescriptor = function(e) {
  25264. return this.activeRenderTargetDescriptors[e]
  25265. }
  25266. ,
  25267. n.prototype.setActiveRenderTargetDescriptor = function(e, t) {
  25268. this.activeRenderTargetDescriptors[e] = t
  25269. }
  25270. ,
  25271. n.prototype.loadOverlayTiles = function() {
  25272. if (0 !== d.tiling.overlayStyle) {
  25273. var n = 0
  25274. , e = function(e, t, i) {
  25275. e = t ? e[t] = this.sceneRenderer.initSizedTexture2D(A.TILE_SIZE, _.ClampToEdgeWrapping) : this.overlayTileBase = this.sceneRenderer.initSizedTexture2D(A.TILE_SIZE, _.ClampToEdgeWrapping),
  25276. this.sceneRenderer.uploadTexture2D(i, e, 0, 0, A.TILE_SIZE, A.TILE_SIZE),
  25277. ++n === r.length && (this.overlayTilesLoaded = !0)
  25278. }
  25279. .bind(this)
  25280. , 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)]];
  25281. r.forEach(function(e) {
  25282. this.tileDownloader.loadImage(e[0], 0, e[1])
  25283. }
  25284. .bind(this)),
  25285. this.usingTileOverlay = !0
  25286. } else
  25287. this.usingTileOverlay = !1
  25288. }
  25289. ,
  25290. n.prototype.bindEvents = function() {
  25291. this.tileDownloader.on(g.TileDownloadSuccess, this.onTileDownloaded.bind(this))
  25292. }
  25293. ,
  25294. n.prototype.setupZoomRenderTarget = function() {
  25295. if (this.qualityManager.getMaxZoomPanoSize() >= this.qualityManager.getMaxNavPanoSize()) {
  25296. if (this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize())
  25297. return;
  25298. var e = this.zoomRenderTarget;
  25299. if (this.zoomRenderTarget = this.initTiledPano(this.qualityManager.getMaxZoomPanoSize(), !1),
  25300. e) {
  25301. var t = e.width
  25302. , i = this.zoomRenderTarget.width;
  25303. this.sceneRenderer.copyCubeMap(e.texture, this.zoomRenderTarget, t, t, i, i),
  25304. e.texture.dispose(),
  25305. e.texture.loaded = !1,
  25306. e.texture.version = 0,
  25307. this.sceneRenderer.deallocateCubeTexture(e.texture),
  25308. e.texture = null
  25309. }
  25310. this.zoomPanoRenderingDisabled = !1
  25311. } else
  25312. this.zoomPanoRenderingDisabled = !0
  25313. }
  25314. ,
  25315. n.prototype.enableUltraHighQualityMode = function(t) {
  25316. if (!this.qualityManager.ultraHighQualityModeEnabled()) {
  25317. var e = this.qualityManager.getPanoSize(p.ULTRAHIGH);
  25318. this.tileDownloader.testDownload(e, A.TILE_SIZE, function(e) {
  25319. e && (this.qualityManager.enableUltraHighQualityMode(),
  25320. this.setupZoomRenderTarget(),
  25321. t())
  25322. }
  25323. .bind(this))
  25324. }
  25325. }
  25326. ,
  25327. n.prototype.activateTiledPano = function(e, t, i) {
  25328. i && this.clearAllQueuedUploads();
  25329. for (var n = 0; n < A.FACES_PER_PANO; n++)
  25330. this.initTileTree(e.id, n, this.qualityManager.getMaxPossiblePanoSize());
  25331. this.linkAllTilesAndNodes(e);
  25332. var r = this.getActiveRenderTargetDescriptor(e.id)
  25333. , o = t;
  25334. if (o > this.qualityManager.getMaxNavPanoSize() && (o = this.qualityManager.getMaxNavPanoSize()),
  25335. !r || o !== r.size) {
  25336. if (r && c(r.renderTarget),
  25337. !(r = function(e) {
  25338. for (var t = 0; t < O.length; t++) {
  25339. var i = O[t];
  25340. if (!i.inUse && i.size === e)
  25341. return i.inUse = !0,
  25342. i
  25343. }
  25344. return null
  25345. }(o))) {
  25346. var a = this.initTiledPano(o, !1);
  25347. (r = l(a.width)).renderTarget = a
  25348. }
  25349. r.pano = e,
  25350. this.resetPanoDescriptor(e.id),
  25351. this.resetPanoLODDescriptors(e.id),
  25352. this.resetRenderStatus(e.id, !0, !0)
  25353. }
  25354. this.setActiveRenderTargetDescriptor(e.id, r);
  25355. var s = i ? 0 : 1;
  25356. return this.updateActivePanos(e, s),
  25357. r.renderTarget
  25358. }
  25359. ,
  25360. n.prototype.deactivateTiledPano = function(e) {
  25361. var t = this.getActiveRenderTargetDescriptor(e.id);
  25362. this.isRenderTargetDescriptorValid(t) && c(t.renderTarget),
  25363. this.setActiveRenderTargetDescriptor(e.id, null);
  25364. var i = this.getUploadQueueForPano(e.id);
  25365. this.clearUploadQueue(i),
  25366. this.updateActivePanos()
  25367. }
  25368. ,
  25369. n.prototype.updateActivePanos = (s = [],
  25370. function(e, t) {
  25371. for (var i = s.length = 0; i < this.activePanos.length; i++) {
  25372. e && s.length === t && s.push(e);
  25373. var n = this.activePanos[i]
  25374. , r = this.getActiveRenderTargetDescriptor(n.id);
  25375. e && n.id === e.id || !this.isRenderTargetDescriptorValid(r) || s.push(n)
  25376. }
  25377. e && t >= s.length && s.push(e),
  25378. this.activePanos.length = 0,
  25379. this.activePanos.push.apply(this.activePanos, s)
  25380. }
  25381. ),
  25382. n.prototype.getActivePanoCount = function() {
  25383. return this.activePanos.length
  25384. }
  25385. ,
  25386. n.prototype.resetRenderStatus = function(e, r, o, t) {
  25387. var i = null;
  25388. t && (i = v.getLevelCountForSize(A.TILE_SIZE, t) + 1);
  25389. for (var n = function(e, t, i, n) {
  25390. o && (t.tile.zoomUploaded = !1),
  25391. r && (t.tile.uploaded = !1)
  25392. }, a = 0; a < A.FACES_PER_PANO; a++) {
  25393. this.getTileTree(e, a).breadthFirst({
  25394. callback: n.bind(this, a),
  25395. minLevel: i
  25396. })
  25397. }
  25398. }
  25399. ,
  25400. n.prototype.copyBaseRenderStatusToZoomed = function(e) {
  25401. for (var t = v.getLevelCountForSize(A.TILE_SIZE, this.qualityManager.getMaxNavPanoSize()), i = function(e, t, i, n) {
  25402. t.tile.zoomUploaded = t.tile.uploaded,
  25403. t.zoomCovered = t.covered
  25404. }, n = 0; n < A.FACES_PER_PANO; n++) {
  25405. this.getTileTree(e, n).breadthFirst({
  25406. callback: i.bind(this, n),
  25407. maxLevel: t
  25408. })
  25409. }
  25410. }
  25411. ,
  25412. n.prototype.renderPanoTiles = (h = [],
  25413. function(e, t, i, n) {
  25414. this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize() || this.zoomPanoRenderingDisabled || this.setupZoomRenderTarget(),
  25415. t = t || this.direction || m.FORWARD;
  25416. var r = this.getActiveRenderTargetDescriptor(e);
  25417. if (!this.isRenderTargetDescriptorValid(r))
  25418. throw new u("PanoRenderer.renderPanoTiles() -> Cannot render to a pano that is not activated.");
  25419. for (var o = 0; o < A.FACES_PER_PANO; o++) {
  25420. var a = this.getTileTree(e, o);
  25421. h.length = 0,
  25422. a.breadthFirst({
  25423. saveVisited: h
  25424. });
  25425. for (var s = 0; s < h.length; s++) {
  25426. var l = h[s];
  25427. this.queueTileUpload(l.tile, !1, n || 0 === s && i)
  25428. }
  25429. }
  25430. this.updateDirection(t)
  25431. }
  25432. ),
  25433. n.prototype.isRenderTargetDescriptorValid = function(e) {
  25434. return e && e.renderTarget
  25435. }
  25436. ,
  25437. n.prototype.isPanoActive = function(e) {
  25438. var t = this.getActiveRenderTargetDescriptor(e);
  25439. return this.isRenderTargetDescriptorValid(t)
  25440. }
  25441. ,
  25442. n.prototype.isPanoZoomed = function(e) {
  25443. return this.zoomingActive && this.zoomPanoId === e
  25444. }
  25445. ,
  25446. n.prototype.initTileTree = function(e, t, i) {
  25447. var n = this.tileTrees[e];
  25448. n || (n = [],
  25449. this.tileTrees[e] = n);
  25450. var r = n[t];
  25451. if (!r) {
  25452. var o = v.getLevelCountForSize(A.TILE_SIZE, i);
  25453. r = new v(A.TILE_SIZE,o),
  25454. n[t] = r
  25455. }
  25456. }
  25457. ,
  25458. n.prototype.getTileTree = function(e, t) {
  25459. var i = this.tileTrees[e];
  25460. if (!i)
  25461. throw new u("PanoRenderer.getTileTree() -> Tree array not yet initialized!");
  25462. var n = i[t];
  25463. if (!n)
  25464. throw new u("PanoRenderer.getTileTree() -> Tree not yet initialized!");
  25465. return n
  25466. }
  25467. ,
  25468. n.prototype.initTiledPano = function(e, t) {
  25469. var i = this.sceneRenderer.renderer
  25470. , n = (i.context,
  25471. new _.WebGLRenderTargetCube(e,e,{
  25472. stencilBuffer: !1
  25473. }))
  25474. , r = new _.CubeTexture([]);
  25475. (n.texture = r).image = [null, null, null, null, null, null],
  25476. r.flipY = !0,
  25477. t ? (r.generateMipmaps = !0,
  25478. r.magFilter = _.LinearFilter,
  25479. r.minFilter = _.LinearMipMapLinearFilter) : (r.generateMipmaps = !1,
  25480. r.magFilter = _.LinearFilter,
  25481. r.minFilter = _.LinearFilter),
  25482. r.format = _.RGBAFormat,
  25483. i.setRenderTarget(n),
  25484. i.setRenderTarget(null);
  25485. var o = i.properties.get(r);
  25486. return o.__image__webglTextureCube = o.__webglTexture,
  25487. n
  25488. }
  25489. ,
  25490. n.prototype.getUploadQueueForPano = function(e) {
  25491. var t = this.uploadQueues[e];
  25492. return t || (t = [],
  25493. this.uploadQueues[e] = t),
  25494. t
  25495. }
  25496. ,
  25497. n.prototype.isTileUploaded = function(e) {
  25498. return this.isPanoZoomed(e.panoId) ? e.zoomUploaded : e.uploaded
  25499. }
  25500. ,
  25501. n.prototype.setUploaded = function(e, t) {
  25502. this.isPanoZoomed(e.panoId) ? e.zoomUploaded = t : e.uploaded = t
  25503. }
  25504. ,
  25505. n.prototype.queueTileUpload = function(e, t, i) {
  25506. var n = this.getActiveRenderTargetDescriptor(e.panoId);
  25507. if (this.isRenderTargetDescriptorValid(n) && e.downloaded && !this.isTileUploaded(e) && (!e.uploadQueued || i) && (!(e.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive)) {
  25508. var r = this.getUploadQueueForPano(e.panoId);
  25509. 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),
  25510. e.uploadQueued = !0,
  25511. this.uploadInterval || this.uploadIntervalCancelled || this.refreshUploadInterval(0))
  25512. }
  25513. }
  25514. ,
  25515. n.prototype.shoulPushToFrontOfQueue = function(e) {
  25516. return 0 === v.getLevelCountForSize(A.TILE_SIZE, e.panoSize)
  25517. }
  25518. ,
  25519. n.prototype.getTopUploadQueue = function() {
  25520. for (var e = null, t = null, i = P.Base; i <= P.Remaining; i++)
  25521. for (var n = 0; n < this.activePanos.length; n++)
  25522. if (e = this.activePanos[n],
  25523. 0 < (t = this.getUploadQueueForPano(e.id)).length)
  25524. switch (i) {
  25525. case P.Base:
  25526. if (0 === t[0].level)
  25527. return t;
  25528. break;
  25529. case P.Remaining:
  25530. return t
  25531. }
  25532. return null
  25533. }
  25534. ,
  25535. n.prototype.getNextFromUploadQueue = function() {
  25536. if (0 < this.forceQueue.length)
  25537. return L(this.forceQueue);
  25538. var e = this.getTopUploadQueue();
  25539. return e && 0 < e.length ? L(e) : null
  25540. }
  25541. ,
  25542. n.prototype.peekNextFromUploadQueue = function() {
  25543. if (0 < this.forceQueue.length)
  25544. return this.forceQueue[0];
  25545. var e = this.getTopUploadQueue();
  25546. return e && 0 < e.length ? e[0] : null
  25547. }
  25548. ,
  25549. n.prototype.clearAllQueuedUploads = function() {
  25550. this.clearAllUploadQueues(null, 0)
  25551. }
  25552. ,
  25553. n.prototype.clearAllQueuedUploadsForPano = function(e) {
  25554. this.clearAllUploadQueues(e, 0)
  25555. }
  25556. ,
  25557. n.prototype.clearAllUploadQueues = function(e, t) {
  25558. if (e)
  25559. this.clearUploadQueue(this.getUploadQueueForPano(e), t),
  25560. this.clearUploadQueue(this.forceQueue, t, e);
  25561. else {
  25562. for (var i = 0; i < this.activePanos.length; i++) {
  25563. var n = this.activePanos[i];
  25564. this.clearUploadQueue(this.getUploadQueueForPano(n.id), t)
  25565. }
  25566. this.clearUploadQueue(this.forceQueue, t)
  25567. }
  25568. }
  25569. ,
  25570. n.prototype.clearUploadQueue = function(e, t, i) {
  25571. null != t || (t = 0);
  25572. for (var n = 0; n < e.length; ) {
  25573. var r = e[n];
  25574. (!i || i && i === r.tile.panoId) && r.level >= t ? (r.uploadQueued = !1,
  25575. e.splice(n, 1)) : n++
  25576. }
  25577. }
  25578. ,
  25579. n.prototype.refreshUploadInterval = (a = null,
  25580. function(e) {
  25581. this.uploadIntervalCancelled || (a = a || function() {
  25582. this.uploadIntervalCancelled || (this.overlayTilesLoaded || !this.usingTileOverlay ? (T = !0,
  25583. this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  25584. this.peekNextFromUploadQueue() ? this.refreshUploadInterval(x) : this.uploadInterval = null) : this.refreshUploadInterval(this.uploadIntervalDelay))
  25585. }
  25586. .bind(this),
  25587. null != e || (e = x),
  25588. T || (e = S),
  25589. this.uploadInterval = window.setTimeout(a, e),
  25590. this.uploadIntervalDelay = e)
  25591. }
  25592. ),
  25593. n.prototype.update = (r = performance.now(),
  25594. o = 0,
  25595. function() {
  25596. this.uploadIntervalCancelled = !0,
  25597. window.clearTimeout(this.uploadInterval),
  25598. this.uploadInterval = null;
  25599. var e = performance.now() - r;
  25600. !(x < e || 0 === o) || !this.overlayTilesLoaded && this.usingTileOverlay || (this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  25601. r = performance.now()),
  25602. o++
  25603. }
  25604. ),
  25605. n.prototype.updateUploadQueue = function(e, t) {
  25606. e = e || 1;
  25607. for (var i = 0, n = 0; !(t <= n || e <= i); ) {
  25608. var r = this.getNextFromUploadQueue();
  25609. if (!r)
  25610. break;
  25611. if (0 !== r.level ? i++ : n++,
  25612. !(r.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive) {
  25613. var o = this.getActiveRenderTargetDescriptor(r.panoId);
  25614. this.isRenderTargetDescriptorValid(o) && this.uploadTile(r, r.forceUpload)
  25615. }
  25616. }
  25617. }
  25618. ,
  25619. n.prototype.updateDirection = function(e) {
  25620. if (e = e || this.direction) {
  25621. this.direction = e;
  25622. for (var t = 0; t < this.activePanos.length; t++) {
  25623. var i = this.activePanos[t]
  25624. , n = this.getUploadQueueForPano(i.id);
  25625. y.sortPanoTiles(n, i, this.direction)
  25626. }
  25627. }
  25628. }
  25629. ,
  25630. n.prototype.uploadTile = (I = {},
  25631. new _.Vector4,
  25632. E = d.tiling.overlayStyle,
  25633. function(e, t) {
  25634. var i = e.panoId
  25635. , n = e.image
  25636. , r = e.tileSize
  25637. , o = e.panoSize
  25638. , a = e.tileIndex
  25639. , s = (e.faceTileIndex,
  25640. e.totalTiles)
  25641. , l = (e.face,
  25642. e.tileX)
  25643. , c = e.tileY
  25644. , h = !0
  25645. , u = !1
  25646. , d = (this.getPanoDescriptor(i),
  25647. this.getPanoLODDescriptor(i, o))
  25648. , p = this.getActiveRenderTargetDescriptor(i)
  25649. , f = p.renderTarget
  25650. , g = p.size;
  25651. if (this.isPanoZoomed(i) && (f = this.zoomRenderTarget,
  25652. g = this.qualityManager.getMaxZoomPanoSize()),
  25653. this.isRenderTargetDescriptorValid(p) || (u = h = !1),
  25654. t || (this.anyUploaded(e.node) && (u = !(h = !1)),
  25655. this.isTileUploaded(e) && (u = h = !1)),
  25656. h) {
  25657. var m = r / o * g
  25658. , v = l * r / o * g
  25659. , y = c * r / o * g;
  25660. I[r] || (I[r] = this.sceneRenderer.initSizedTexture2D(r, _.ClampToEdgeWrapping));
  25661. var A = I[r];
  25662. if (this.sceneRenderer.uploadTexture2D(n, A, 0, 0, r, r),
  25663. 1 === E || 2 === E) {
  25664. var C = 1 === E ? this.overlayTilesBasic : this.overlayTilesEnhanced;
  25665. this.sceneRenderer.renderToCubeMap(A, f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace),
  25666. this.sceneRenderer.renderToCubeMap(C[o], f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace, _.NormalBlending, !0, .5)
  25667. } else
  25668. this.sceneRenderer.renderToCubeMap(A, f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace);
  25669. d.uploadCount++,
  25670. this.emit(b.TileRenderSuccess, i, o, a, s),
  25671. d.uploadCount === s && this.emit(b.PanoRenderComplete, i, o, s),
  25672. this.setUploaded(e, !0),
  25673. this.addCoverageForNode(e.node)
  25674. } else
  25675. this.setUploaded(e, !1);
  25676. return e.uploadAttempted || (d.uploadAttempts++,
  25677. this.emit(b.TileUploadAttempted, i, o, a, s)),
  25678. e.uploadAttempted = !0,
  25679. d.uploadAttempts === s && this.emit(b.UploadAttemptedForAllTiles, i, o, s),
  25680. u
  25681. }
  25682. ),
  25683. n.prototype.linkTileAndNode = function(e, t) {
  25684. (t.tile = e).node = t
  25685. }
  25686. ,
  25687. n.prototype.linkAllTilesAndNodes = function(a) {
  25688. for (var e = function(e, t, i, n, r) {
  25689. var o = this.getTileDirectoryEntry(a.id, t, n, r);
  25690. this.linkTileAndNode(o, i)
  25691. }, t = 0; t < A.FACES_PER_PANO; t++) {
  25692. var i = this.getTileTree(a.id, t);
  25693. i.breadthFirst({
  25694. callback: e.bind(this, i, t)
  25695. })
  25696. }
  25697. }
  25698. ,
  25699. n.prototype.anyUploaded = function(e) {
  25700. if (!e)
  25701. return !1;
  25702. if (e.tile && this.isTileUploaded(e.tile))
  25703. return !0;
  25704. if (e.children)
  25705. for (var t = 0; t < e.children.length; t++) {
  25706. var i = e.children[t];
  25707. if (this.anyUploaded(i))
  25708. return !0
  25709. }
  25710. return !1
  25711. }
  25712. ,
  25713. n.prototype.setNodeCovered = function(e, t) {
  25714. this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered = t : e.covered = t
  25715. }
  25716. ,
  25717. n.prototype.isNodeCovered = function(e) {
  25718. return !!e && (this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered : e.covered)
  25719. }
  25720. ,
  25721. n.prototype.addCoverageForNode = function(e) {
  25722. if (this.setNodeCovered(e, !0),
  25723. e.parent && e.covered) {
  25724. var t = e.parent;
  25725. this.nodeSubcovered(t) && this.addCoverageForNode(t, !0)
  25726. }
  25727. }
  25728. ,
  25729. n.prototype.calcFullCoverage = function(e) {
  25730. var t = !1;
  25731. if (e.children)
  25732. for (var i = 0; i < e.children.length; i++) {
  25733. var n = e.children[i];
  25734. t = t || this.calcFullCoverage(n)
  25735. }
  25736. e.covered = e.tile.uploaded || t
  25737. }
  25738. ,
  25739. n.prototype.nodeSubcovered = function(e) {
  25740. if (!e.children)
  25741. return !1;
  25742. for (var t = 0; t < e.children.length; t++)
  25743. if (!e.children[t] || !this.isNodeCovered(e.children[t]))
  25744. return !1;
  25745. return !0
  25746. }
  25747. ,
  25748. n.prototype.resetPanoDescriptor = function(e) {
  25749. this.getPanoDescriptor(e)
  25750. }
  25751. ,
  25752. n.prototype.getPanoDescriptor = function(e) {
  25753. var t = this.panoDescriptors[e];
  25754. return t || (t = {},
  25755. this.panoDescriptors[e] = t),
  25756. t
  25757. }
  25758. ,
  25759. n.prototype.resetPanoLODDescriptors = function(e) {
  25760. var t = this.getPanoLODDescriptors(e);
  25761. for (var i in t)
  25762. if (t.hasOwnProperty(i)) {
  25763. var n = t[i];
  25764. n.uploadCount = 0,
  25765. n.uploadAttempts = 0
  25766. }
  25767. }
  25768. ,
  25769. n.prototype.getPanoLODDescriptor = function(e, t) {
  25770. var i = this.getPanoLODDescriptors(e)
  25771. , n = i[t];
  25772. return n || (n = {
  25773. uploadCount: 0,
  25774. uploadAttempts: 0
  25775. },
  25776. i[t] = n),
  25777. n
  25778. }
  25779. ,
  25780. n.prototype.getPanoLODDescriptors = function(e) {
  25781. var t = this.panoLODDescriptors[e];
  25782. return t || (t = {},
  25783. this.panoLODDescriptors[e] = t),
  25784. t
  25785. }
  25786. ,
  25787. n.prototype.onTileDownloaded = function(e) {
  25788. var t = v.getLevelCountForSize(A.TILE_SIZE, e.panoSize)
  25789. , i = this.getTileDirectoryEntry(e.panoId, e.face, t, e.faceTileIndex);
  25790. if (i.downloaded = !0,
  25791. i.image = e.image,
  25792. i.panoSize = e.panoSize,
  25793. i.tileX = e.tileX,
  25794. i.tileY = e.tileY,
  25795. i.totalTiles = e.totalTiles,
  25796. i.tileIndex = e.tileIndex,
  25797. i.faceTileIndex = e.faceTileIndex,
  25798. i.face = e.face,
  25799. i.cubeFace = C.mapFaceToCubemapFace(e.face),
  25800. i.panoId = e.panoId,
  25801. i.tileSize = e.tileSize,
  25802. i.direction = (new _.Vector3).copy(e.direction),
  25803. i.node = null,
  25804. i.level = v.getLevelCountForSize(A.TILE_SIZE, i.panoSize),
  25805. this.isPanoActive(i.panoId)) {
  25806. var n = this.getTileTree(i.panoId, i.face).getSubNode(i.panoSize, i.tileX, i.tileY);
  25807. this.linkTileAndNode(i, n),
  25808. this.queueTileUpload(i, !0)
  25809. }
  25810. }
  25811. ,
  25812. n.prototype.getTileDirectoryEntry = function(e, t, i, n) {
  25813. var r = this.tileDirectory[e];
  25814. r || (r = {},
  25815. this.tileDirectory[e] = r);
  25816. var o = 16384 * t + 1024 * i + n
  25817. , a = r[o];
  25818. return a || (a = {
  25819. downloaded: !1,
  25820. uploaded: !1,
  25821. zoomUploaded: !1
  25822. },
  25823. r[o] = a),
  25824. a._key = e + ":" + t + ":" + i + ":" + n,
  25825. a._tileKey = o,
  25826. a
  25827. }
  25828. ,
  25829. n.prototype.setZoomingActive = function(e, t, i) {
  25830. this.zoomPanoRenderingDisabled || e === this.zoomingActive && this.zoomPanoId === t.id || (this.zoomingActive = e,
  25831. this.zoomPanoId = t.id,
  25832. this.zoomingActive && (this.zoomPanoId !== t.id || i) && this.updateZoomedPanoFromBase(t))
  25833. }
  25834. ,
  25835. n.prototype.updateZoomedPanoFromBase = function(e) {
  25836. if (!this.zoomPanoRenderingDisabled) {
  25837. var t = this.getActiveRenderTargetDescriptor(e.id);
  25838. if (t && t.renderTarget) {
  25839. var i = this.qualityManager.getMaxZoomPanoSize()
  25840. , n = t.renderTarget
  25841. , r = t.size;
  25842. this.sceneRenderer.copyCubeMap(n.texture, this.zoomRenderTarget, r, r, i, i),
  25843. this.copyBaseRenderStatusToZoomed(e.id)
  25844. }
  25845. }
  25846. }
  25847. ,
  25848. t.exports = n
  25849. }
  25850. , {
  25851. "../enum/GLCubeFaces": 25,
  25852. "../enum/PanoRendererEvents": 35,
  25853. "../enum/PanoSizeClass": 36,
  25854. "../enum/SceneRendererEvents": 43,
  25855. "../enum/TileDownloaderEvents": 45,
  25856. "../enum/Vectors": 50,
  25857. "../exception/BasicException": 55,
  25858. "../objects/Panorama": 148,
  25859. "../settings": 166,
  25860. "../util/browser": 182,
  25861. "../util/panorama": 191,
  25862. "./TileDownloader": 171,
  25863. "./TilePrioritizer": 172,
  25864. "./TileTree": 173,
  25865. "./TileUtils": 174,
  25866. events: 202,
  25867. three: 217
  25868. }],
  25869. 170: [function(e, t, i) {
  25870. "use strict";
  25871. function n(e, t, i) {
  25872. this.maxNavPanoSize = -1,
  25873. this.maxZoomPanoSize = -1,
  25874. this.devicePixelDensity = e,
  25875. this.deviceScreenSize = t,
  25876. this.clientBandwidth = i,
  25877. this.panoSizeClassMap = {},
  25878. this.useHighResolutionPanos = !0,
  25879. this.useUltraHighResolutionPanos = !1,
  25880. this.modelHasUltraHighPanos = !1
  25881. }
  25882. var r = e("../enum/PanoSizeClass")
  25883. , o = e("../settings")
  25884. , a = e("../util/browser")
  25885. , s = e("../constants")
  25886. , l = e("../util/showcase")
  25887. , c = e("../enum/ModelManagerEvents");
  25888. n.prototype.init = function(e) {
  25889. this.buildPanoSizeClassMap(this.devicePixelDensity, this.deviceScreenSize, this.clientBandwidth),
  25890. this.ultraHighSize = this.getPanoSize(r.ULTRAHIGH),
  25891. this.highSize = this.getPanoSize(r.HIGH),
  25892. this.standardSize = this.getPanoSize(r.STANDARD),
  25893. this.baseSize = this.getPanoSize(r.BASE),
  25894. o.tiling.maxZoomPanoQuality && this.ultraHighSize <= o.tiling.maxZoomPanoQuality && (o.tiling.allowUltraHighResolution = !0),
  25895. this.highQualityThreshold = a.valueFromHash("threshold2k", s.windowHeightHighQualityThreshold),
  25896. this.updateMaximums(),
  25897. e.on(c.ActiveModelChanged, this.onModelChanged.bind(this))
  25898. }
  25899. ,
  25900. n.prototype.updateFromModel = function(e) {
  25901. this.updateHighResolutionSettings(e),
  25902. this.updateUltraHighResolutionSettings(e)
  25903. }
  25904. ,
  25905. n.prototype.updateHighResolutionSettings = function(e) {
  25906. l.modelDataPromisesTiles(e.data) ? this.useHighResolutionPanos = !0 : this.useHighResolutionPanos = !1,
  25907. this.updateMaximums()
  25908. }
  25909. ,
  25910. n.prototype.updateUltraHighResolutionSettings = function(e) {
  25911. o.tiling.allowUltraHighResolution && this.modelHasUltraHighPanos ? this.useUltraHighResolutionPanos = !0 : this.useUltraHighResolutionPanos = !1,
  25912. this.updateMaximums()
  25913. }
  25914. ,
  25915. n.prototype.enableUltraHighQualityMode = function() {
  25916. this.modelHasUltraHighPanos = !0,
  25917. this.updateUltraHighResolutionSettings(null)
  25918. }
  25919. ,
  25920. n.prototype.ultraHighQualityModeEnabled = function() {
  25921. return this.modelHasUltraHighPanos
  25922. }
  25923. ,
  25924. n.prototype.onModelChanged = function(e) {
  25925. this.updateFromModel(e.model),
  25926. this.updateMaximums()
  25927. }
  25928. ,
  25929. n.prototype.updateMaximums = function() {
  25930. this.maxNavPanoSize = o.tiling.maxNavPanoQuality || this.detectMaxNavPanoSize(),
  25931. this.maxZoomPanoSize = o.tiling.maxZoomPanoQuality || this.detectMaxZoomPanoSize(),
  25932. this.maxZoomPanoSize < this.maxNavPanoSize && (this.maxNavPanoSize = this.maxZoomPanoSize)
  25933. }
  25934. ,
  25935. n.prototype.buildPanoSizeClassMap = function() {
  25936. this.panoSizeClassMap[r.BASE] = 512,
  25937. this.panoSizeClassMap[r.STANDARD] = 1024,
  25938. this.panoSizeClassMap[r.HIGH] = 2048,
  25939. this.panoSizeClassMap[r.ULTRAHIGH] = 4096
  25940. }
  25941. ,
  25942. n.prototype.getPanoSize = function(e) {
  25943. return this.panoSizeClassMap[e]
  25944. }
  25945. ,
  25946. n.prototype.getMaxPossiblePanoSize = function() {
  25947. return this.getPanoSize(r.ULTRAHIGH)
  25948. }
  25949. ,
  25950. n.prototype.getMaxPanoSize = function() {
  25951. return this.maxZoomPanoSize
  25952. }
  25953. ,
  25954. n.prototype.getMaxNavPanoSize = function() {
  25955. return this.maxNavPanoSize
  25956. }
  25957. ,
  25958. n.prototype.getMaxZoomPanoSize = function() {
  25959. return this.maxZoomPanoSize
  25960. }
  25961. ,
  25962. n.prototype.detectMaxNavPanoSizeClass = function() {
  25963. return this.useHighResolutionPanos ? a.isMobile() ? r.STANDARD : $("#player").height() < this.highQualityThreshold ? r.STANDARD : r.HIGH : r.STANDARD
  25964. }
  25965. ,
  25966. n.prototype.detectMaxNavPanoSize = function() {
  25967. var e = this.detectMaxNavPanoSizeClass();
  25968. return this.getPanoSize(e)
  25969. }
  25970. ,
  25971. n.prototype.detectMaxZoomPanoSize = function() {
  25972. 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)
  25973. }
  25974. ,
  25975. t.exports = n
  25976. }
  25977. , {
  25978. "../constants": 8,
  25979. "../enum/ModelManagerEvents": 33,
  25980. "../enum/PanoSizeClass": 36,
  25981. "../settings": 166,
  25982. "../util/browser": 182,
  25983. "../util/showcase": 193
  25984. }],
  25985. 171: [function(A, C, e) {
  25986. (function(e) {
  25987. "use strict";
  25988. function i(e) {
  25989. this.panos = null,
  25990. this.retryMinimumTime = 1e4,
  25991. this.urls = null,
  25992. this.panoLoadCallbacks = {},
  25993. this.downloadDescriptors = {},
  25994. this.priorityQueue = [],
  25995. this.forceQueue = [],
  25996. this.activeDownloads = [],
  25997. this.qualityManager = null,
  25998. this.tilePrioritizer = null,
  25999. this.refreshInterval = null,
  26000. this.processPriorityQueue = !1,
  26001. this.concurrentDownloads = e.concurrentDownloads || 1,
  26002. this.downloadTestResults = {}
  26003. }
  26004. var c, h, n, p, f, t = A("three"), u = (A("../enum/Viewmode"),
  26005. A("../settings")), r = (A("../objects/Panorama"),
  26006. A("../util/logger")), o = (A("../enum/Vectors"),
  26007. A("../enum/PanoSizeClass"),
  26008. A("../enum/TileDownloaderEvents")), g = A("./TilePrioritizer"), m = A("./TileUtils"), v = (A("../enum/GLCubeFaces"),
  26009. A("../enum/DownloadStatus")), a = A("../util/panorama"), s = A("../util/ajax"), d = A("../ab"), l = A("events").EventEmitter, y = (new r(e),
  26010. Object.freeze({
  26011. Testing: 1,
  26012. Success: 2,
  26013. Fail: 3
  26014. }));
  26015. i.prototype = Object.create(l.prototype),
  26016. i.IDLE_REFRESH_DELAY = 500,
  26017. i.ACTIVE_REFRESH_DELAY = 16,
  26018. i.DOWNLOAD_RETRIES = 4,
  26019. i.prototype.init = function(e) {
  26020. this.qualityManager = e
  26021. }
  26022. ,
  26023. i.prototype.setUrls = function(e) {
  26024. this.urls = e
  26025. }
  26026. ,
  26027. i.prototype.setPanoData = function(e, t, i) {
  26028. this.panos = e,
  26029. this.imagePanos = t,
  26030. this.panoGroupId = i
  26031. }
  26032. ,
  26033. i.prototype.start = function() {
  26034. this.refreshUpdateInterval(0)
  26035. }
  26036. ,
  26037. i.prototype.stop = function() {
  26038. window.cancel(this.refreshInterval)
  26039. }
  26040. ,
  26041. i.prototype.refreshUpdateInterval = function(e) {
  26042. e = e || 0,
  26043. this.refreshInterval = window.setTimeout(function() {
  26044. this.update() ? this.refreshUpdateInterval(i.ACTIVE_REFRESH_DELAY) : this.refreshUpdateInterval(i.IDLE_REFRESH_DELAY)
  26045. }
  26046. .bind(this), e)
  26047. }
  26048. ,
  26049. i.prototype.update = function() {
  26050. var e = 0 < this.forceQueue.length;
  26051. return this.processQueueForDownloading(this.forceQueue),
  26052. this.processPriorityQueue && (this.queuePrioritizedTilesForPanos(this.panos),
  26053. 0 < this.priorityQueue.length && (e = !0),
  26054. this.processQueueForDownloading(this.priorityQueue)),
  26055. e
  26056. }
  26057. ,
  26058. i.prototype.forceQueueTilesForPano = (p = [],
  26059. f = [],
  26060. function(e, t, i, n, r, o) {
  26061. p.length = 0;
  26062. for (var a = this.getTileDownloadDescriptors(e, t), s = 0; s < a.length; s++) {
  26063. var l = a[s];
  26064. l.status !== v.None && l.status !== v.Queued || p.push(l)
  26065. }
  26066. if (i && 0 < p.length) {
  26067. g.sortPanoTiles(p, e, i),
  26068. f.length = 0,
  26069. m.matchingTilesInDirection(e, t, i, n, r, f);
  26070. for (var c = 0, h = function(e) {
  26071. return e.face === u.face && e.faceTileIndex === u.faceTileIndex
  26072. }; c < p.length; ) {
  26073. var u = p[c];
  26074. f.findIndex(h) < 0 ? p.splice(c, 1) : c++
  26075. }
  26076. }
  26077. for (var d = 0; d < p.length; d++)
  26078. this.forceQueue.push(p[d]);
  26079. this.setStatusForAllDescriptors(this.forceQueue, v.ForceQueued),
  26080. this.clearFromQueue(this.priorityQueue, v.ForceQueued, !1),
  26081. o && this.processQueueForDownloading(this.forceQueue, !0)
  26082. }
  26083. ),
  26084. i.prototype.clearForceQueue = function() {
  26085. this.clearQueue(this.forceQueue)
  26086. }
  26087. ,
  26088. i.prototype.queuePrioritizedTilesForPanos = function(e) {
  26089. this.tilePrioritizer && (this.clearQueue(this.priorityQueue),
  26090. this.tilePrioritizer.filterAndPrioritize(this.priorityQueue, e, this),
  26091. this.clearFromQueue(this.priorityQueue, v.None, !0),
  26092. this.setStatusOrRemoveForAllDescriptors(this.priorityQueue, v.Queued))
  26093. }
  26094. ,
  26095. i.prototype.clearQueue = function(e) {
  26096. this.setStatusForAllDescriptors(e, v.None),
  26097. e.length = 0
  26098. }
  26099. ,
  26100. i.prototype.clearFromQueue = function(e, t, i) {
  26101. for (var n = 0; n < e.length; n++) {
  26102. var r = e[n];
  26103. r && (t === r.status && !i || t !== r.status && i) && (e[n] = null)
  26104. }
  26105. }
  26106. ,
  26107. i.prototype.setStatusForAllDescriptors = function(e, t) {
  26108. for (var i = 0; i < e.length; i++) {
  26109. var n = e[i];
  26110. n && (n.status = t)
  26111. }
  26112. }
  26113. ,
  26114. i.prototype.setStatusOrRemoveForAllDescriptors = function(e, t) {
  26115. for (var i = 0; i < e.length; i++) {
  26116. var n = e[i];
  26117. n && (n.status !== t ? n.status = t : e[i] = null)
  26118. }
  26119. }
  26120. ,
  26121. i.prototype.getTileDownloadDescriptors = function(e, t) {
  26122. var i = this.getAllTileDownloadDescriptorsForPano(e)
  26123. , n = i[t];
  26124. return n || (n = this.buildDownloadDescriptorArray(t),
  26125. i[t] = n,
  26126. this.initTileDownloadDescriptors(n, e, t)),
  26127. n
  26128. }
  26129. ,
  26130. i.prototype.getAllTileDownloadDescriptorsForPano = function(e) {
  26131. var t = this.downloadDescriptors[e.id];
  26132. return t || (t = {},
  26133. this.downloadDescriptors[e.id] = t),
  26134. t
  26135. }
  26136. ,
  26137. i.prototype.processQueueForDownloading = function(e, t) {
  26138. if (this.cleanupActiveDownloads(),
  26139. this.activeDownloads.length < this.concurrentDownloads || t)
  26140. for (var i = t ? e.length : this.concurrentDownloads - this.activeDownloads.length, n = 0; n < i && 0 < e.length; 0) {
  26141. var r = e.shift();
  26142. r && (this.startDownload(r),
  26143. n++)
  26144. }
  26145. }
  26146. ,
  26147. i.prototype.testDownload = function(t, e, i) {
  26148. var n = this.downloadTestResults[t];
  26149. if (n)
  26150. n === y.Success ? i(!0) : n === y.Fail && i(!1);
  26151. else {
  26152. this.downloadTestResults[t] = y.Testing;
  26153. var r = this.panos.list[0]
  26154. , o = this.getTileUrl(r.id, t, e, 0)
  26155. , a = function(e) {
  26156. this.downloadTestResults[t] = y.Success,
  26157. i(!0)
  26158. }
  26159. .bind(this)
  26160. , s = function() {
  26161. this.downloadTestResults[t] = y.Fail,
  26162. i(!1)
  26163. }
  26164. .bind(this);
  26165. this.loadImage(o, 0, a, s)
  26166. }
  26167. }
  26168. ,
  26169. i.prototype.startDownload = function(e) {
  26170. e.status = v.Downloading;
  26171. var t = this.getTileUrl(e.pano.id, e.panoSize, e.tileSize, e.tileIndex);
  26172. this.activeDownloads.push(e),
  26173. this.loadImage(t, i.DOWNLOAD_RETRIES, this.downloadComplete.bind(this, e), this.downloadFailed.bind(this, e))
  26174. }
  26175. ,
  26176. i.prototype.downloadFailed = function(e, t) {}
  26177. ,
  26178. i.prototype.downloadComplete = function(e, t) {
  26179. if (e.panoGroupId === this.panoGroupId) {
  26180. var i = this.getPanoLoadCallbacks(e.pano, e.panoSize);
  26181. e.status = v.Downloaded,
  26182. i && i.onProgress && i.onProgress(e.pano, e.panoSize);
  26183. var n = {
  26184. panoId: e.pano.id,
  26185. image: t,
  26186. tileSize: e.tileSize,
  26187. panoSize: e.panoSize,
  26188. tileIndex: e.tileIndex,
  26189. faceTileIndex: e.faceTileIndex,
  26190. totalTiles: e.totalTiles,
  26191. face: e.face,
  26192. tileX: e.tileX,
  26193. tileY: e.tileY,
  26194. direction: e.direction
  26195. };
  26196. e.image = t,
  26197. this.emit(o.TileDownloadSuccess, n),
  26198. this.isPanoDownloaded(e.pano, e.panoSize) && (n = {
  26199. panoId: e.pano.id,
  26200. tileSize: e.tileSize,
  26201. panoSize: e.panoSize
  26202. },
  26203. this.emit(o.PanoDownloadComplete, n),
  26204. i && i.onLoad && i.onLoad(e.pano, e.panoSize))
  26205. }
  26206. }
  26207. ,
  26208. i.prototype.cleanupActiveDownloads = (n = [],
  26209. function() {
  26210. for (var e = n.length = 0; e < this.activeDownloads.length; e++) {
  26211. var t = this.activeDownloads[e];
  26212. t.status !== v.Downloaded && t.status !== v.Failed && n.push(t)
  26213. }
  26214. this.activeDownloads.length = 0,
  26215. this.activeDownloads.push.apply(this.activeDownloads, n)
  26216. }
  26217. ),
  26218. i.prototype.isPanoDownloaded = function(e, t) {
  26219. var i = this.getTileDownloadDescriptors(e, t);
  26220. if (i.length <= 0)
  26221. return !1;
  26222. for (var n = 0; n < i.length; n++) {
  26223. if (i[n].status !== v.Downloaded)
  26224. return !1
  26225. }
  26226. return !0
  26227. }
  26228. ,
  26229. i.prototype.setPanoLoadCallbacks = function(e, t, i, n, r) {
  26230. var o = e.id + ":" + this.qualityManager.getPanoSize(t);
  26231. this.panoLoadCallbacks[o] = {
  26232. onLoad: i,
  26233. onFail: n,
  26234. onProgress: r
  26235. }
  26236. }
  26237. ,
  26238. i.prototype.getPanoLoadCallbacks = function(e, t) {
  26239. var i = e.id + ":" + t;
  26240. return this.panoLoadCallbacks[i]
  26241. }
  26242. ,
  26243. i.prototype.buildDownloadDescriptorArray = function(e) {
  26244. for (var t = m.getTileCountForSize(e), i = [], n = 0; n < t; n++) {
  26245. var r = this.buildDownloadDescriptor();
  26246. i.push(r)
  26247. }
  26248. return i
  26249. }
  26250. ,
  26251. i.prototype.buildDownloadDescriptor = function() {
  26252. return {
  26253. panoGroupId: null,
  26254. pano: null,
  26255. panoSize: -1,
  26256. tileSize: -1,
  26257. tileIndex: -1,
  26258. totalTiles: -1,
  26259. faceTileIndex: -1,
  26260. status: v.None,
  26261. url: null,
  26262. image: null,
  26263. direction: new t.Vector3,
  26264. face: -1,
  26265. cubeFace: -1,
  26266. tileX: -1,
  26267. tileY: -1
  26268. }
  26269. }
  26270. ,
  26271. i.prototype.initTileDownloadDescriptors = function(e, t, i) {
  26272. for (var n = 0; n < e.length; n++) {
  26273. var r = e[n];
  26274. this.initTileDownloadDescriptor(r, t, i, n)
  26275. }
  26276. }
  26277. ,
  26278. i.prototype.initTileDownloadDescriptor = function(e, t, i, n) {
  26279. var r = i >= m.TILE_SIZE ? m.TILE_SIZE : i;
  26280. e.face = m.getFaceForTile(i, n),
  26281. e.cubeFace = a.mapFaceToCubemapFace(e.face),
  26282. e.panoGroupId = this.panoGroupId,
  26283. e.pano = t,
  26284. e.panoSize = i,
  26285. e.tileSize = r,
  26286. e.tileIndex = n,
  26287. e.totalTiles = m.getTileCountForSize(i),
  26288. e.status = v.None,
  26289. e.image = null,
  26290. m.getTileLocation(e.panoSize, e.tileIndex, e),
  26291. m.getTileVector(e.panoSize, e.tileSize, e.cubeFace, e.tileX, e.tileY, m.LocationOnTile.Center, 0, e.direction)
  26292. }
  26293. ,
  26294. i.prototype.getTileUrl = (c = {
  26295. 256: "256",
  26296. 512: "512",
  26297. 1024: "1k",
  26298. 2048: "2k",
  26299. 4096: "4k"
  26300. },
  26301. h = {
  26302. face: -1,
  26303. faceTileIndex: -1,
  26304. tileX: -1,
  26305. tileY: -1
  26306. },
  26307. function(e, t, i, n) {
  26308. m.getTileLocation(t, n, h);
  26309. var r = Math.floor(t / i)
  26310. , o = r * r
  26311. , a = Math.floor(n / o)
  26312. , s = "";
  26313. 1 === u.tiling.customCompression && (s = "_" + u.tiling["q" + c[t]]);
  26314. var l = this.urls.get("tiles/" + e + "/" + c[t] + s + "_face" + a + "_" + h.tileX + "_" + h.tileY + ".jpg");
  26315. return d.changeIfTileGenerating(l)
  26316. }
  26317. ),
  26318. i.prototype.loadImage = function(e, t, i, n) {
  26319. s.getImage(e, t).then(function(e) {
  26320. i(e)
  26321. }).fail(n)
  26322. }
  26323. ,
  26324. C.exports = i
  26325. }
  26326. ).call(this, "/js/tile/TileDownloader.js")
  26327. }
  26328. , {
  26329. "../ab": 3,
  26330. "../enum/DownloadStatus": 24,
  26331. "../enum/GLCubeFaces": 25,
  26332. "../enum/PanoSizeClass": 36,
  26333. "../enum/TileDownloaderEvents": 45,
  26334. "../enum/Vectors": 50,
  26335. "../enum/Viewmode": 51,
  26336. "../objects/Panorama": 148,
  26337. "../settings": 166,
  26338. "../util/ajax": 181,
  26339. "../util/logger": 189,
  26340. "../util/panorama": 191,
  26341. "./TilePrioritizer": 172,
  26342. "./TileUtils": 174,
  26343. events: 202,
  26344. three: 217
  26345. }],
  26346. 172: [function(n, C, e) {
  26347. (function(e) {
  26348. "use strict";
  26349. function h(e, t, i, n, r) {
  26350. this.qualityManager = e,
  26351. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  26352. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize(),
  26353. this.baseSize = t,
  26354. this.standardSize = i,
  26355. this.highSize = n,
  26356. this.ultraHighSize = r,
  26357. this.priorityCriteria = new h.PriorityCriteria(null,new o.Vector3(0,0,0),new o.Vector3(0,0,-1),new o.Vector3(0,0,-1))
  26358. }
  26359. var c, s, l, d, r, u, p, f, o = n("three"), g = (n("../enum/Viewmode"),
  26360. n("../settings"),
  26361. n("../settings"),
  26362. n("../objects/Panorama")), t = n("../util/logger"), i = (n("../enum/Vectors"),
  26363. n("../enum/PanoSizeClass"),
  26364. n("../enum/ModelManagerEvents"),
  26365. n("../enum/GLCubeFaces"),
  26366. n("../enum/DownloadStatus")), m = (n("../util/browser"),
  26367. n("./TileUtils")), v = n("../util/math"), a = (n("events").EventEmitter,
  26368. new t(e),
  26369. Object.freeze({
  26370. None: 0,
  26371. DirectionalFOV: 1
  26372. }));
  26373. h.PriorityCriteria = function(e, t, i, n, r) {
  26374. this.pano = e,
  26375. this.cameraPosition = (new o.Vector3).copy(t),
  26376. this.cameraDir = (new o.Vector3).copy(i),
  26377. this.panoSpaceDir = (new o.Vector3).copy(n),
  26378. this.upcomingPanos = r,
  26379. this.copy = function(e) {
  26380. this.pano = e.pano,
  26381. this.cameraPosition.copy(e.cameraPosition),
  26382. this.cameraDir.copy(e.cameraDir),
  26383. this.panoSpaceDir.copy(e.panoSpaceDir),
  26384. this.upcomingPanos = r
  26385. }
  26386. ,
  26387. this.zoomingActive = !1
  26388. }
  26389. ,
  26390. h.DIRECTIONAL_FOV = 180,
  26391. h.DIRECTIONAL_FOV_NARROW = 120,
  26392. h.MAX_SCORED_PANOS_TOCONSIDER = 6,
  26393. h.MAX_SCORED_PANOS_TOADD = 2,
  26394. h.MAX_UPCOMING_PANOS_TOADD = 3,
  26395. h.DIRECTION_SCORE_STRICTNESS = .75,
  26396. h.appendQueue = function(e, t) {
  26397. if (e && t)
  26398. for (var i = 0; i < t.length; i++)
  26399. e.push(t[i])
  26400. }
  26401. ,
  26402. h.prototype.updateCriteria = function(e, t, i, n) {
  26403. this.priorityCriteria.pano = e,
  26404. this.priorityCriteria.cameraPosition.copy(t),
  26405. this.priorityCriteria.cameraDir.copy(i),
  26406. this.priorityCriteria.upcomingPanos = n,
  26407. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  26408. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize()
  26409. }
  26410. ,
  26411. h.prototype.filterAndPrioritize = (u = [],
  26412. p = [],
  26413. f = [],
  26414. function(e, t, i) {
  26415. this.populateNeighborPanos(this.priorityCriteria.pano, t, u),
  26416. this.populateScoredPanos(this.priorityCriteria.pano, t, p, this.priorityCriteria.cameraDir, h.MAX_SCORED_PANOS_TOCONSIDER);
  26417. var n = this.baseSize
  26418. , r = this.standardSize
  26419. , o = this.highSize
  26420. , a = this.ultraHighSize;
  26421. this.queueTilesForPano(e, i, this.priorityCriteria.pano, n),
  26422. this.priorityCriteria.upcomingPanos && this.queueTilesForPanos(e, this.priorityCriteria.upcomingPanos, i, n, h.MAX_UPCOMING_PANOS_TOADD),
  26423. f.length = 0,
  26424. this.canDownloadSize(r) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, r, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  26425. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26426. h.appendQueue(e, f),
  26427. this.queueTilesForPanos(e, p, i, n, h.MAX_SCORED_PANOS_TOADD),
  26428. f.length = 0,
  26429. this.canDownloadSize(o) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, o, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  26430. this.canDownloadSize(a) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, a, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  26431. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26432. h.appendQueue(e, f),
  26433. f.length = 0,
  26434. this.canDownloadSize(r) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, r, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  26435. this.canDownloadSize(o) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, o, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  26436. this.canDownloadSize(a) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, a, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  26437. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26438. h.appendQueue(e, f),
  26439. this.queueTilesForPanos(e, u, i, n)
  26440. }
  26441. ),
  26442. h.prototype.canDownloadSize = function(e) {
  26443. return this.maxNavQuality >= e || this.maxZoomQuality >= e && this.zoomingActive
  26444. }
  26445. ,
  26446. h.prototype.populateNeighborPanos = function(e, t, i) {
  26447. (i = i || []).length = 0;
  26448. var n = t.getNeighbours(e);
  26449. for (var r in n)
  26450. if (n.hasOwnProperty(r)) {
  26451. var o = t.get(r);
  26452. i.push(o)
  26453. }
  26454. return i
  26455. }
  26456. ,
  26457. h.prototype.populateScoredPanos = function(e, t, i, n, r) {
  26458. (i = i || []).length = 0;
  26459. var o = [g.filters.inPanoDirection(e.position, n, h.DIRECTION_SCORE_STRICTNESS), g.filters.not(e)]
  26460. , a = [g.scoreFunctions.distanceSquared(e), g.scoreFunctions.direction(e.position, n)]
  26461. , s = t.sortByScore(o, a);
  26462. if (s)
  26463. for (var l = 0; l < s.length && l < r; l++) {
  26464. var c = s[l].pano;
  26465. i.push(c)
  26466. }
  26467. return i
  26468. }
  26469. ,
  26470. h.prototype.queueTilesForPanos = function(e, t, i, n, r) {
  26471. for (var o = 0, a = 0; a < t.length; a++) {
  26472. var s = t[a];
  26473. if (o += 0 < this.queueTilesForPano(e, i, s, n) ? 1 : 0,
  26474. r && r <= o)
  26475. break
  26476. }
  26477. return o
  26478. }
  26479. ,
  26480. h.prototype.queueTilesForPano = (r = {
  26481. filter: a.None
  26482. },
  26483. function(e, t, i, n) {
  26484. return this.filterAndQueueTileDownloadDescriptors(e, t, i, n, r)
  26485. }
  26486. ),
  26487. h.prototype.queueTilesForPanosInDirection = (d = new o.Vector3,
  26488. function(e, t, i, n, r, o, a, s) {
  26489. for (var l = 0, c = 0; c < i.length; c++) {
  26490. var h = i[c];
  26491. d.copy(h.position),
  26492. d.sub(r),
  26493. d.normalize();
  26494. var u = Math.max(Math.min(o.dot(d), 1), -1);
  26495. if (v.getFOVDotThreshold(a) <= u && (l += 0 < this.queueTilesInDirectionForPano(e, t, h, n, r, o, a) ? 1 : 0,
  26496. s && s <= l))
  26497. break
  26498. }
  26499. return l
  26500. }
  26501. ),
  26502. h.prototype.queueTilesInDirectionForPanos = function(e, t, i, n, r, o, a, s) {
  26503. for (var l = 0, c = 0; c < i.length; c++) {
  26504. var h = i[c];
  26505. if (l += 0 < this.queueTilesInDirectionForPano(e, t, h, n, o, a) ? 1 : 0,
  26506. s && s <= l)
  26507. break
  26508. }
  26509. return l
  26510. }
  26511. ,
  26512. h.prototype.queueTilesInDirectionForPano = (s = {
  26513. filter: a.DirectionalFOV,
  26514. direction: new o.Vector3,
  26515. fov: 60
  26516. },
  26517. l = new o.Vector3,
  26518. function(e, t, i, n, r, o, a) {
  26519. return l.copy(o),
  26520. m.getRelativeDirection(i.quaternion, l),
  26521. s.direction.copy(l),
  26522. s.fov = a,
  26523. this.filterAndQueueTileDownloadDescriptors(e, t, i, n, s)
  26524. }
  26525. ),
  26526. h.prototype.filterAndQueueTileDownloadDescriptors = (c = [],
  26527. function(e, t, i, n, r) {
  26528. var o = t.getTileDownloadDescriptors(i, n);
  26529. c.length = 0,
  26530. this.filterTileDownloadDescriptors(i, o, c, r);
  26531. for (var a = 0, s = 0; s < c.length; s++) {
  26532. var l = c[s];
  26533. l && (e.push(l),
  26534. a++)
  26535. }
  26536. return a
  26537. }
  26538. ),
  26539. h.prototype.filterTileDownloadDescriptors = (new o.Vector3,
  26540. function(e, t, i, n) {
  26541. var r, o;
  26542. switch (n.filter) {
  26543. case a.DirectionalFOV:
  26544. for (r = 0; r < t.length; r++)
  26545. o = t[r],
  26546. m.isTileWithinFOV(o.panoSize, o.tileSize, o.face, o.tileX, o.tileY, n.direction, n.fov) && i.push(o);
  26547. break;
  26548. default:
  26549. for (r = 0; r < t.length; r++)
  26550. o = t[r],
  26551. i.push(o)
  26552. }
  26553. for (r = 0; r < i.length; r++)
  26554. o = i[r],
  26555. this.canIncludeDescriptor(o) || (i[r] = null)
  26556. }
  26557. ),
  26558. h.prototype.canIncludeDescriptor = function(e) {
  26559. return e.status !== i.Downloading && e.status !== i.Downloaded
  26560. }
  26561. ,
  26562. h.prototype.canIncludePano = function(e, t) {
  26563. return !e.isLoaded(t)
  26564. }
  26565. ,
  26566. h.getFOVDotThreshold = function(e) {
  26567. return Math.cos(o.Math.degToRad(e / 2))
  26568. }
  26569. ;
  26570. var y = (A._panoSpaceDir = new o.Vector3,
  26571. A._fovThreshold = -1,
  26572. A._fovThresholdNarrow = -1,
  26573. A);
  26574. function A(e, t) {
  26575. var i = A._panoSpaceDir
  26576. , n = A._fovThreshold
  26577. , r = A._fovThresholdNarrow
  26578. , o = Math.max(Math.min(i.dot(e.direction), 1), -1)
  26579. , a = Math.max(Math.min(i.dot(t.direction), 1), -1);
  26580. return e._dot = o,
  26581. t._dot = a,
  26582. 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)
  26583. }
  26584. h.sortPanoTiles = function(e, t, i) {
  26585. y._panoSpaceDir.copy(i),
  26586. m.getRelativeDirection(t.quaternion, y._panoSpaceDir),
  26587. y._fovThresholdNarrow = v.getFOVDotThreshold(h.DIRECTIONAL_FOV_NARROW),
  26588. y._fovThreshold = v.getFOVDotThreshold(h.DIRECTIONAL_FOV),
  26589. e.sort(y)
  26590. }
  26591. ,
  26592. h.insertSortedPanoTile = function(e, t, i, n) {
  26593. y._panoSpaceDir.copy(n),
  26594. m.getRelativeDirection(i.quaternion, y._panoSpaceDir),
  26595. y._fovThresholdNarrow = v.getFOVDotThreshold(h.DIRECTIONAL_FOV_NARROW),
  26596. y._fovThreshold = v.getFOVDotThreshold(h.DIRECTIONAL_FOV);
  26597. for (var r = -1, o = 0; o < e.length; o++) {
  26598. if (y(t, e[o]) <= 0) {
  26599. r = o;
  26600. break
  26601. }
  26602. }
  26603. if (-1 === r)
  26604. e[e.length] = t;
  26605. else {
  26606. for (var a = e.length; r < a; a--)
  26607. e[a] = e[a - 1];
  26608. e[r] = t
  26609. }
  26610. }
  26611. ,
  26612. h.prototype.setZoomingActive = function(e) {
  26613. e !== this.zoomingActive && (this.zoomingActive = e)
  26614. }
  26615. ,
  26616. C.exports = h
  26617. }
  26618. ).call(this, "/js/tile/TilePrioritizer.js")
  26619. }
  26620. , {
  26621. "../enum/DownloadStatus": 24,
  26622. "../enum/GLCubeFaces": 25,
  26623. "../enum/ModelManagerEvents": 33,
  26624. "../enum/PanoSizeClass": 36,
  26625. "../enum/Vectors": 50,
  26626. "../enum/Viewmode": 51,
  26627. "../objects/Panorama": 148,
  26628. "../settings": 166,
  26629. "../util/browser": 182,
  26630. "../util/logger": 189,
  26631. "../util/math": 190,
  26632. "./TileUtils": 174,
  26633. events: 202,
  26634. three: 217
  26635. }],
  26636. 173: [function(e, t, i) {
  26637. "use strict";
  26638. function f(e, t) {
  26639. this.levels = t,
  26640. this.tileSize = e,
  26641. this.root = null,
  26642. this.allNodes = [],
  26643. function(e) {
  26644. e.root = function e(t, i, n) {
  26645. if (n > t.levels)
  26646. return null;
  26647. var r = new a(t,i);
  26648. t.allNodes.push(r);
  26649. for (var o = 0; o < s; o++)
  26650. r.children[o] = e(t, r, n + 1);
  26651. return r
  26652. }(e, null, 0)
  26653. }(this)
  26654. }
  26655. function a(e, t) {
  26656. this.tree = e,
  26657. this.parent = t,
  26658. this.children = [],
  26659. this.id = ++n
  26660. }
  26661. var g = (e("three"),
  26662. e("./TileUtils"),
  26663. e("../objects/Panorama"),
  26664. e("../util/panorama"),
  26665. e("events").EventEmitter,
  26666. 2)
  26667. , s = g * g;
  26668. f.TraversalType = Object.freeze({
  26669. PreOrder: 0,
  26670. PostOrder: 1
  26671. });
  26672. var n = 0;
  26673. f.getLevelCountForSize = function(e, t) {
  26674. var i = 0;
  26675. for (t < e && (t = e); !((t /= g) < e); )
  26676. i++;
  26677. return i
  26678. }
  26679. ,
  26680. f.getSizeForLevel = function(e, t) {
  26681. return Math.pow(g, t) * e
  26682. }
  26683. ,
  26684. f.prototype.getSubNode = function(e, t, i) {
  26685. (!t || e < this.tileSize) && (t = 0),
  26686. (!i || e < this.tileSize) && (i = 0),
  26687. e < this.tileSize && (e = this.tileSize);
  26688. var n = f.getLevelCountForSize(this.tileSize, e);
  26689. return function e(t, i, n, r, o) {
  26690. if (!t)
  26691. return null;
  26692. if (0 === n)
  26693. return t;
  26694. if (!t.children || 0 === t.children.length)
  26695. return null;
  26696. var a = Math.pow(g, n) / g
  26697. , s = r % a
  26698. , l = o % a
  26699. , c = Math.floor(o / a)
  26700. , h = Math.floor(r / a)
  26701. , u = c * g + h;
  26702. return e(t.children[u], i + 1, n - 1, s, l)
  26703. }(this.root, 0, n, t, i)
  26704. }
  26705. ,
  26706. f.prototype.breadthFirst = function(e) {
  26707. var t = !!(e = e || {}).nullLevelEnd
  26708. , i = e.maxLevel
  26709. , n = e.minLevel
  26710. , r = e.callback
  26711. , o = e.saveVisited
  26712. , a = []
  26713. , s = {}
  26714. , l = 0;
  26715. for (a.push(this.root),
  26716. a.push(s); 0 < a.length && !(i && i < l); ) {
  26717. var c = a.shift();
  26718. if (c === s)
  26719. (!n || n <= l) && (r && t && r(null),
  26720. o && t && o.push(null)),
  26721. 0 < a.length && a.push(s),
  26722. l++,
  26723. 0;
  26724. else {
  26725. if (c.children)
  26726. for (var h = 0; h < c.children.length; h++) {
  26727. c.children[h] && a.push(c.children[h])
  26728. }
  26729. var u = this.getFaceIndexFromNode(c);
  26730. (!n || n <= l) && (r && r(c, l, u),
  26731. o && o.push(c)),
  26732. 0
  26733. }
  26734. }
  26735. }
  26736. ,
  26737. f.prototype.getFaceIndexFromNode = function(e) {
  26738. if (!e)
  26739. return -1;
  26740. for (var t = 1, i = e, n = 0, r = 0; ; ) {
  26741. var o = i.parent;
  26742. if (!o)
  26743. break;
  26744. for (var a = -1, s = 0; s < o.children.length; s++)
  26745. o.children[s] === i && (a = s);
  26746. n = a % g * t + n,
  26747. r = Math.floor(a / g) * t + r,
  26748. t *= g,
  26749. i = o
  26750. }
  26751. return r * t + n
  26752. }
  26753. ,
  26754. f.prototype.depthFirst = function(e, t, i) {
  26755. !function e(t, i, n, r, o, a, s, l) {
  26756. if (t) {
  26757. s = s || f.TraversalType.PreOrder;
  26758. var c = r * g + n;
  26759. if (s === f.TraversalType.PreOrder && (o && o(t, i, c, n, r),
  26760. a && a.push(t)),
  26761. t.children && 0 !== t.children.length) {
  26762. for (var h = r * g, u = n * g, d = 0; d < g; d++)
  26763. for (var p = 0; p < g; p++)
  26764. e(t.children[p * g + d], i + 1, u + d, h + p, o, a, s, l);
  26765. s === f.TraversalType.PostOrder && (o && o(t, i, c, n, r),
  26766. a && a.push(t))
  26767. }
  26768. }
  26769. }(this.root, 0, 0, 0, e, t, i, this.tileSize)
  26770. }
  26771. ,
  26772. t.exports = f
  26773. }
  26774. , {
  26775. "../objects/Panorama": 148,
  26776. "../util/panorama": 191,
  26777. "./TileUtils": 174,
  26778. events: 202,
  26779. three: 217
  26780. }],
  26781. 174: [function(e, t, i) {
  26782. "use strict";
  26783. var n, a, s, p, f, g, E, l, c, h, u, d, r, o, m = e("../enum/GLCubeFaces"), _ = e("../util/MathLight"), b = {};
  26784. b.TILE_SIZE = 512,
  26785. b.FACES_PER_PANO = 6,
  26786. b.LocationOnTile = {
  26787. Center: 0,
  26788. UpperLeft: 1,
  26789. UpperRight: 2,
  26790. LowerRight: 3,
  26791. LowerLeft: 4
  26792. },
  26793. b.getTileVector = function(e, t, i, n, r, o, a, s) {
  26794. var l = e / t
  26795. , c = t / e * 2
  26796. , h = c / 2
  26797. , u = n / l * 2 - 1 + h
  26798. , d = (r = l - 1 - r) / l * 2 - 1 + h;
  26799. switch (o = o || b.LocationOnTile.Center) {
  26800. case b.LocationOnTile.UpperLeft:
  26801. u -= h,
  26802. d += h,
  26803. u += a * c;
  26804. break;
  26805. case b.LocationOnTile.UpperRight:
  26806. u += h,
  26807. d += h,
  26808. d -= a * c;
  26809. break;
  26810. case b.LocationOnTile.LowerRight:
  26811. u += h,
  26812. d -= h,
  26813. u -= a * c;
  26814. break;
  26815. case b.LocationOnTile.LowerLeft:
  26816. u -= h,
  26817. d -= h,
  26818. d += a * c;
  26819. break;
  26820. case b.LocationOnTile.Center:
  26821. }
  26822. switch (i) {
  26823. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  26824. _.setVector(s, -1, d, -u);
  26825. break;
  26826. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  26827. _.setVector(s, 1, d, u);
  26828. break;
  26829. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  26830. _.setVector(s, -u, 1, -d);
  26831. break;
  26832. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  26833. _.setVector(s, -u, -1, d);
  26834. break;
  26835. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  26836. _.setVector(s, -u, d, 1);
  26837. break;
  26838. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  26839. _.setVector(s, u, d, -1)
  26840. }
  26841. _.normalize(s)
  26842. }
  26843. ,
  26844. b.getFaceForTile = function(e, t) {
  26845. var i = b.TILE_SIZE;
  26846. e < b.TILE_SIZE && (i = e);
  26847. var n = Math.floor(e / i)
  26848. , r = n * n;
  26849. return Math.floor(t / r)
  26850. }
  26851. ,
  26852. b.getTileLocation = function(e, t, i) {
  26853. var n = b.TILE_SIZE;
  26854. e < b.TILE_SIZE && (n = e);
  26855. var r = b.getFaceForTile(e, t)
  26856. , o = Math.floor(e / n)
  26857. , a = t - r * (o * o);
  26858. i.tileX = a % o,
  26859. i.tileY = Math.floor(a / o),
  26860. i.face = r,
  26861. i.faceTileIndex = a
  26862. }
  26863. ,
  26864. b.getTileCountForSize = function(e) {
  26865. if (e <= b.TILE_SIZE)
  26866. return b.FACES_PER_PANO;
  26867. var t = Math.floor(e / b.TILE_SIZE);
  26868. return t * t * b.FACES_PER_PANO
  26869. }
  26870. ,
  26871. b.getRelativeDirection = (r = new _.Matrix4,
  26872. o = new _.Quaternion,
  26873. function(e, t) {
  26874. o.copy(e),
  26875. o.inverse(),
  26876. r.makeRotationFromQuaternion(o),
  26877. r.applyToVector3(t),
  26878. _.normalize(t)
  26879. }
  26880. ),
  26881. b.matchingTilesInDirection = (c = new _.Vector3,
  26882. h = new _.Vector3(0,0,-1),
  26883. u = new _.Quaternion,
  26884. l = {
  26885. face: -1,
  26886. faceTileIndex: -1,
  26887. tileX: -1,
  26888. tileY: -1
  26889. },
  26890. d = function(e, t, i) {
  26891. for (var n = b.getTileCountForSize(e), r = 0, o = 0; o < n; o++)
  26892. b.getTileLocation(e, o, l),
  26893. t && !t(l) || (r++,
  26894. i && (a = l,
  26895. i.push({
  26896. face: a.face,
  26897. faceTileIndex: a.faceTileIndex,
  26898. tileX: a.tileX,
  26899. tileY: a.tileY
  26900. })));
  26901. var a;
  26902. return r
  26903. }
  26904. ,
  26905. function(e, t, i, n, r, o) {
  26906. var a = t < b.TILE_SIZE ? t : b.TILE_SIZE;
  26907. if (b.getTileCountForSize(t),
  26908. !n && !r)
  26909. return d(t, null, o);
  26910. var s = !!r;
  26911. return r = r || n,
  26912. r = Math.max(0, Math.min(r, 360)),
  26913. n = Math.max(0, Math.min(n, 360)),
  26914. _.copyVector(i, c),
  26915. b.getRelativeDirection(e.quaternion, c),
  26916. s ? (u.setFromUnitVectors(c, h),
  26917. d(t, function(e) {
  26918. return b.isTileWithinFrustum(t, a, e.face, e.tileX, e.tileY, u, n, r)
  26919. }, o)) : d(t, function(e) {
  26920. return b.isTileWithinFOV(t, a, e.face, e.tileX, e.tileY, c, n)
  26921. }, o)
  26922. }
  26923. ),
  26924. b.isTileWithinFrustum = (E = new _.Vector3,
  26925. function(e, t, i, n, r, o, a, s) {
  26926. 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++)
  26927. if (b.getTileVector(e, t, d, n, r, y, 0, E),
  26928. _.applyQuaternionToVector(o, E),
  26929. -1e-5 <= E.z)
  26930. ;
  26931. else {
  26932. var A = -1 / E.z
  26933. , C = E.x * A
  26934. , I = E.y * A;
  26935. l < I ? p++ : I < c && f++,
  26936. h < C ? g++ : C < u && m++,
  26937. v++
  26938. }
  26939. return f !== v && p !== v && g !== v && m !== v
  26940. }
  26941. ),
  26942. b.isTileWithinFOV = (p = new _.Vector3,
  26943. f = new _.Vector3(0,1,0),
  26944. g = new _.Vector3(1,0,0),
  26945. function(e, t, i, n, r, o, a) {
  26946. var s = b.mapFaceToCubemapFace(i);
  26947. if (_.cross(o, f, g),
  26948. b.getTileVector(e, t, s, n, r, b.LocationOnTile.Center, 0, p),
  26949. b.isWithinFOV(p, o, a, null))
  26950. return !0;
  26951. for (var l = a / 360, c = Math.floor(1 / l), h = 0, u = 0; u < c; u++) {
  26952. for (var d = b.LocationOnTile.UpperLeft; d <= b.LocationOnTile.LowerLeft; d++)
  26953. if (b.getTileVector(e, t, s, n, r, d, h, p),
  26954. b.isWithinFOV(p, o, a, null))
  26955. return !0;
  26956. h += l
  26957. }
  26958. return !1
  26959. }
  26960. ),
  26961. b.isWithinFOV = (a = new _.Vector3,
  26962. s = new _.Vector3,
  26963. function(e, t, i, n) {
  26964. if (_.copyVector(e, s),
  26965. n) {
  26966. _.copyVector(n, a),
  26967. _.normalize(a);
  26968. var r = _.dot(a, e);
  26969. a.x *= r,
  26970. a.y *= r,
  26971. a.z *= r,
  26972. _.subVector(s, a)
  26973. }
  26974. var o = i / 2 * _.RADIANS_PER_DEGREE;
  26975. return Math.cos(o) <= _.dot(s, t)
  26976. }
  26977. ),
  26978. b.mapFaceToCubemapFace = (n = {
  26979. 0: m.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  26980. 1: m.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  26981. 2: m.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  26982. 3: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  26983. 4: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  26984. 5: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  26985. },
  26986. function(e) {
  26987. return n[e]
  26988. }
  26989. ),
  26990. t.exports = b
  26991. }
  26992. , {
  26993. "../enum/GLCubeFaces": 25,
  26994. "../util/MathLight": 176
  26995. }],
  26996. 175: [function(i, n, e) {
  26997. (function(e) {
  26998. "use strict";
  26999. function t() {
  27000. this.list = [],
  27001. this.index = {},
  27002. Object.defineProperty(this, "length", {
  27003. get: function() {
  27004. return this.list.length
  27005. }
  27006. })
  27007. }
  27008. new (i("./common"),
  27009. i("./logger"))(e),
  27010. t.prototype.forEach = function(e) {
  27011. this.list.forEach(e)
  27012. }
  27013. ,
  27014. t.prototype.add = function(e) {
  27015. this.list.push(e),
  27016. this.index[this.getIndex(e)] = e
  27017. }
  27018. ,
  27019. t.prototype.getIndex = function(e) {
  27020. throw new Error("IndexedCollection.getIndex not implemented in subclass.")
  27021. }
  27022. ,
  27023. t.prototype.extend = function(e) {
  27024. for (var t = 0; t < e.length; t++)
  27025. this.add(e[t])
  27026. }
  27027. ,
  27028. t.prototype.get = function(e) {
  27029. return this.index[e]
  27030. }
  27031. ,
  27032. t.prototype.first = function() {
  27033. return this.list[0]
  27034. }
  27035. ,
  27036. t.prototype.last = function() {
  27037. return this.list[this.list.length - 1]
  27038. }
  27039. ,
  27040. t.prototype.reIndex = function() {
  27041. this.index = {};
  27042. var t = this;
  27043. this.forEach(function(e) {
  27044. t.index[t.getIndex(e)] = e
  27045. })
  27046. }
  27047. ,
  27048. t.prototype.filter = function(e) {
  27049. var t = this.list.filter(e);
  27050. return this.reIndex(),
  27051. t
  27052. }
  27053. ,
  27054. t.prototype.reduce = function(e, t) {
  27055. return this.list.reduce(e, t)
  27056. }
  27057. ,
  27058. t.prototype.sort = function(e) {
  27059. return this.list.sort(e)
  27060. }
  27061. ,
  27062. t.prototype.indexOf = function(e) {
  27063. for (var t = 0; t < this.list.length; ++t)
  27064. if (this.list[t] === e)
  27065. return t;
  27066. return -1
  27067. }
  27068. ,
  27069. n.exports = t
  27070. }
  27071. ).call(this, "/js/util/IndexedCollection.js")
  27072. }
  27073. , {
  27074. "./common": 185,
  27075. "./logger": 189
  27076. }],
  27077. 176: [function(e, t, i) {
  27078. "use strict";
  27079. e("../constants");
  27080. var n, r, o = {};
  27081. o.RADIANS_PER_DEGREE = Math.PI / 180,
  27082. o.DEGREES_PER_RADIAN = 180 / Math.PI,
  27083. o.Vector3 = function(e, t, i) {
  27084. this.x = e || 0,
  27085. this.y = t || 0,
  27086. this.z = i || 0
  27087. }
  27088. ,
  27089. o.Matrix4 = function() {
  27090. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  27091. 0 < arguments.length && console.error("MathLight.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  27092. }
  27093. ,
  27094. o.Matrix4.prototype = {
  27095. identity: function() {
  27096. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  27097. this
  27098. },
  27099. copy: function(e) {
  27100. return this.elements.set(e.elements),
  27101. this
  27102. },
  27103. applyToVector3: function(e) {
  27104. var t = e.x
  27105. , i = e.y
  27106. , n = e.z
  27107. , r = this.elements;
  27108. return e.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  27109. e.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  27110. e.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  27111. this
  27112. },
  27113. getInverse: function(e, t) {
  27114. var i = this.elements
  27115. , n = e.elements
  27116. , r = n[0]
  27117. , o = n[1]
  27118. , a = n[2]
  27119. , s = n[3]
  27120. , l = n[4]
  27121. , c = n[5]
  27122. , h = n[6]
  27123. , u = n[7]
  27124. , d = n[8]
  27125. , p = n[9]
  27126. , f = n[10]
  27127. , g = n[11]
  27128. , m = n[12]
  27129. , v = n[13]
  27130. , y = n[14]
  27131. , A = n[15]
  27132. , C = p * y * u - v * f * u + v * h * g - c * y * g - p * h * A + c * f * A
  27133. , I = m * f * u - d * y * u - m * h * g + l * y * g + d * h * A - l * f * A
  27134. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * A + l * p * A
  27135. , _ = m * p * h - d * v * h - m * c * f + l * v * f + d * c * y - l * p * y
  27136. , b = r * C + o * I + a * E + s * _;
  27137. if (0 == b) {
  27138. var w = "MathLight.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  27139. if (t)
  27140. throw new Error(w);
  27141. return console.warn(w),
  27142. this.identity()
  27143. }
  27144. var T = 1 / b;
  27145. return i[0] = C * T,
  27146. i[1] = (v * f * s - p * y * s - v * a * g + o * y * g + p * a * A - o * f * A) * T,
  27147. i[2] = (c * y * s - v * h * s + v * a * u - o * y * u - c * a * A + o * h * A) * T,
  27148. i[3] = (p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g) * T,
  27149. i[4] = I * T,
  27150. i[5] = (d * y * s - m * f * s + m * a * g - r * y * g - d * a * A + r * f * A) * T,
  27151. i[6] = (m * h * s - l * y * s - m * a * u + r * y * u + l * a * A - r * h * A) * T,
  27152. i[7] = (l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g) * T,
  27153. i[8] = E * T,
  27154. i[9] = (m * p * s - d * v * s - m * o * g + r * v * g + d * o * A - r * p * A) * T,
  27155. i[10] = (l * v * s - m * c * s + m * o * u - r * v * u - l * o * A + r * c * A) * T,
  27156. i[11] = (d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g) * T,
  27157. i[12] = _ * T,
  27158. i[13] = (d * v * a - m * p * a + m * o * f - r * v * f - d * o * y + r * p * y) * T,
  27159. i[14] = (m * c * a - l * v * a - m * o * h + r * v * h + l * o * y - r * c * y) * T,
  27160. i[15] = (l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f) * T,
  27161. this
  27162. },
  27163. makeRotationFromQuaternion: function(e) {
  27164. var t = this.elements
  27165. , i = e.x
  27166. , n = e.y
  27167. , r = e.z
  27168. , o = e.w
  27169. , a = i + i
  27170. , s = n + n
  27171. , l = r + r
  27172. , c = i * a
  27173. , h = i * s
  27174. , u = i * l
  27175. , d = n * s
  27176. , p = n * l
  27177. , f = r * l
  27178. , g = o * a
  27179. , m = o * s
  27180. , v = o * l;
  27181. return t[0] = 1 - (d + f),
  27182. t[4] = h - v,
  27183. t[8] = u + m,
  27184. t[1] = h + v,
  27185. t[5] = 1 - (c + f),
  27186. t[9] = p - g,
  27187. t[2] = u - m,
  27188. t[6] = p + g,
  27189. t[10] = 1 - (c + d),
  27190. t[3] = 0,
  27191. t[7] = 0,
  27192. t[11] = 0,
  27193. t[12] = 0,
  27194. t[13] = 0,
  27195. t[14] = 0,
  27196. t[15] = 1,
  27197. this
  27198. }
  27199. },
  27200. o.Quaternion = function(e, t, i, n) {
  27201. this._x = e || 0,
  27202. this._y = t || 0,
  27203. this._z = i || 0,
  27204. this._w = void 0 !== n ? n : 1
  27205. }
  27206. ,
  27207. o.Quaternion.prototype = {
  27208. get x() {
  27209. return this._x
  27210. },
  27211. set x(e) {
  27212. this._x = e
  27213. },
  27214. get y() {
  27215. return this._y
  27216. },
  27217. set y(e) {
  27218. this._y = e
  27219. },
  27220. get z() {
  27221. return this._z
  27222. },
  27223. set z(e) {
  27224. this._z = e
  27225. },
  27226. get w() {
  27227. return this._w
  27228. },
  27229. set w(e) {
  27230. this._w = e
  27231. },
  27232. copy: function(e) {
  27233. this._x = e.x,
  27234. this._y = e.y,
  27235. this._z = e.z,
  27236. this._w = e.w
  27237. },
  27238. inverse: function() {
  27239. return this.conjugate().normalize()
  27240. },
  27241. conjugate: function() {
  27242. return this._x *= -1,
  27243. this._y *= -1,
  27244. this._z *= -1,
  27245. this
  27246. },
  27247. length: function() {
  27248. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  27249. },
  27250. normalize: function() {
  27251. var e = this.length();
  27252. return 0 === e ? (this._x = 0,
  27253. this._y = 0,
  27254. this._z = 0,
  27255. this._w = 1) : (e = 1 / e,
  27256. this._x = this._x * e,
  27257. this._y = this._y * e,
  27258. this._z = this._z * e,
  27259. this._w = this._w * e),
  27260. this
  27261. },
  27262. setFromAxisAngle: function(e, t) {
  27263. var i = t / 2
  27264. , n = Math.sin(i);
  27265. return this._x = e.x * n,
  27266. this._y = e.y * n,
  27267. this._z = e.z * n,
  27268. this._w = Math.cos(i),
  27269. this
  27270. },
  27271. setFromUnitVectors: function(e, t) {
  27272. return void 0 === n && (n = new o.Vector3),
  27273. (r = o.dot(e, t) + 1) < 1e-6 ? (r = 0,
  27274. 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),
  27275. this._x = n.x,
  27276. this._y = n.y,
  27277. this._z = n.z,
  27278. this._w = r,
  27279. this.normalize()
  27280. },
  27281. multiply: function(e) {
  27282. return this.multiplyQuaternions(this, e)
  27283. },
  27284. premultiply: function(e) {
  27285. return this.multiplyQuaternions(e, this)
  27286. },
  27287. multiplyQuaternions: function(e, t) {
  27288. var i = e._x
  27289. , n = e._y
  27290. , r = e._z
  27291. , o = e._w
  27292. , a = t._x
  27293. , s = t._y
  27294. , l = t._z
  27295. , c = t._w;
  27296. return this._x = i * c + o * a + n * l - r * s,
  27297. this._y = n * c + o * s + r * a - i * l,
  27298. this._z = r * c + o * l + i * s - n * a,
  27299. this._w = o * c - i * a - n * s - r * l,
  27300. this
  27301. }
  27302. },
  27303. o.convertWorkshopVector = function(e) {
  27304. return new o.Vector3(-e.x,e.y,e.z)
  27305. }
  27306. ,
  27307. o.convertWorkshopQuaternion = function(e) {
  27308. 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))
  27309. }
  27310. ,
  27311. o.convertWorkshopOrthoZoom = function(e) {
  27312. return -1 === e ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight
  27313. }
  27314. ,
  27315. o.convertWorkshopPanoramaQuaternion = function(e) {
  27316. 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))
  27317. }
  27318. ,
  27319. o.normalize = function(e) {
  27320. var t = e.x * e.x + e.y * e.y + e.z * e.z
  27321. , i = Math.sqrt(t);
  27322. e.x /= i,
  27323. e.y /= i,
  27324. e.z /= i
  27325. }
  27326. ,
  27327. o.dot = function(e, t) {
  27328. return e.x * t.x + e.y * t.y + e.z * t.z
  27329. }
  27330. ,
  27331. o.cross = function(e, t, i) {
  27332. var n = e.x
  27333. , r = e.y
  27334. , o = e.z;
  27335. i.x = r * t.z - o * t.y,
  27336. i.y = o * t.x - n * t.z,
  27337. i.z = n * t.y - r * t.x
  27338. }
  27339. ,
  27340. o.setVector = function(e, t, i, n) {
  27341. e.x = t,
  27342. e.y = i,
  27343. e.z = n
  27344. }
  27345. ,
  27346. o.copyVector = function(e, t) {
  27347. t.x = e.x,
  27348. t.y = e.y,
  27349. t.z = e.z
  27350. }
  27351. ,
  27352. o.addVector = function(e, t) {
  27353. e.x += t.x,
  27354. e.y += t.y,
  27355. e.z += t.z
  27356. }
  27357. ,
  27358. o.subVector = function(e, t) {
  27359. e.x -= t.x,
  27360. e.y -= t.y,
  27361. e.z -= t.z
  27362. }
  27363. ,
  27364. o.applyQuaternionToVector = function(e, t) {
  27365. var i = t.x
  27366. , n = t.y
  27367. , r = t.z
  27368. , o = e.x
  27369. , a = e.y
  27370. , s = e.z
  27371. , l = e.w
  27372. , c = l * i + a * r - s * n
  27373. , h = l * n + s * i - o * r
  27374. , u = l * r + o * n - a * i
  27375. , d = -o * i - a * n - s * r;
  27376. t.x = c * l + d * -o + h * -s - u * -a,
  27377. t.y = h * l + d * -a + u * -o - c * -s,
  27378. t.z = u * l + d * -s + c * -a - h * -o
  27379. }
  27380. ,
  27381. o.angleBetweenVectors = function(e, t) {
  27382. return Math.acos(o.dot(e, t))
  27383. }
  27384. ,
  27385. t.exports = o
  27386. }
  27387. , {
  27388. "../constants": 8
  27389. }],
  27390. 177: [function(c, h, e) {
  27391. (function(e) {
  27392. "use strict";
  27393. function t(e) {
  27394. this.cache = null,
  27395. this.expires = 0
  27396. }
  27397. function i() {
  27398. this.baseUrl = null,
  27399. this.cache = null,
  27400. this.expires = 0
  27401. }
  27402. function n() {
  27403. this.baseUrl = null,
  27404. this.expires = 0
  27405. }
  27406. function r(e) {
  27407. this.initialLoadingPromise = null,
  27408. this.endpoint = e + "?type=3",
  27409. this.urlContainer = null,
  27410. this.authorizationHeader = s.getAuthorizationHeader(),
  27411. this.containerClasses = [n, i, t]
  27412. }
  27413. c("./ajax");
  27414. var o = c("./logger")
  27415. , a = c("../constants")
  27416. , s = c("./showcase")
  27417. , l = (c("../ab"),
  27418. new o(e));
  27419. t.prototype = {
  27420. version: 1,
  27421. validate: function(e) {
  27422. return "catalog.json"in e && 0 < Object.keys(e).length
  27423. },
  27424. update: function(e) {
  27425. return this.cache = e,
  27426. this.expires = Date.now() + a.signedUrlDefaultExpireTime,
  27427. $.when()
  27428. },
  27429. get: function(e) {
  27430. return this.cache[e]
  27431. }
  27432. },
  27433. i.prototype = {
  27434. version: 2,
  27435. validate: function(e) {
  27436. return "catalog.json"in e && "base.url"in e && 1 < Object.keys(e).length
  27437. },
  27438. update: function(e) {
  27439. return this.baseUrl = e["base.url"],
  27440. this.cache = e,
  27441. this.expires = Date.now() + a.signedUrlDefaultExpireTime,
  27442. $.when()
  27443. },
  27444. get: function(e) {
  27445. var t = this.cache[e];
  27446. return t ? this.baseUrl.replace("{{filename}}", e) + t : null
  27447. }
  27448. },
  27449. n.prototype = {
  27450. version: 3,
  27451. validate: function(e) {
  27452. return e.templates && e.catalog_file && (!e.expires || 1e3 * e.expires > Date.now())
  27453. },
  27454. update: function(e) {
  27455. return this.baseUrl = e.templates[0],
  27456. e.expires ? this.expires = 1e3 * e.expires : this.expires = Date.now() + a.signedUrlDefaultExpireTime,
  27457. $.when()
  27458. },
  27459. get: function(e) {
  27460. return this.baseUrl.replace("{{filename}}", e)
  27461. }
  27462. },
  27463. r.prototype = {
  27464. init: function() {
  27465. return this.initialLoadingPromise || (setInterval(function() {
  27466. var e = this.urlContainer ? this.urlContainer.expires : Date.now();
  27467. Date.now() + a.signedUrlRefreshBuffer > e && (l.debug("Refreshing urls..."),
  27468. this.refresh().done(function() {
  27469. l.debug("Refreshed")
  27470. }).fail(function() {
  27471. l.error("Failed url refresh, urls might go stale soon")
  27472. }))
  27473. }
  27474. .bind(this), a.signedUrlCheckInterval),
  27475. this.initialLoadingPromise = this.refresh()),
  27476. this.initialLoadingPromise
  27477. },
  27478. refresh: function(e) {
  27479. return {},
  27480. $.Deferred().resolve()
  27481. },
  27482. get: function(e) {
  27483. return window.MP_PREFETCHED_MODELDATA.files.templates[0].replace("{{filename}}", e)
  27484. }
  27485. },
  27486. h.exports = r
  27487. }
  27488. ).call(this, "/js/util/ModelUrls.js")
  27489. }
  27490. , {
  27491. "../ab": 3,
  27492. "../constants": 8,
  27493. "./ajax": 181,
  27494. "./logger": 189,
  27495. "./showcase": 193
  27496. }],
  27497. 178: [function(l, c, e) {
  27498. (function(e) {
  27499. "use strict";
  27500. function t() {
  27501. i.call(this),
  27502. this.neighbourMap = {},
  27503. this.map = null
  27504. }
  27505. 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"),
  27506. l("./aStar")), T = new (l("./logger"))(e), i = l("./IndexedCollection"), s = l("./transitions");
  27507. n.inherit(t, i),
  27508. t.prototype.getIndex = function(e) {
  27509. return e.id
  27510. }
  27511. ,
  27512. t.prototype.find = function(e, t) {
  27513. var i = n.filterAll(this.list, e);
  27514. return 0 === i.length ? null : (t && t.forEach(function(e) {
  27515. i = n.stableSort(i, e)
  27516. }),
  27517. i[0])
  27518. }
  27519. ,
  27520. t.prototype.sortByScore = function(e, t) {
  27521. var i = n.filterAll(this.list, e);
  27522. return 0 === i.length ? null : i = i.map(function(i) {
  27523. return {
  27524. pano: i,
  27525. score: t.reduce(function(e, t) {
  27526. return e + t(i)
  27527. }, 0)
  27528. }
  27529. }).sort(function(e, t) {
  27530. return t.score - e.score
  27531. })
  27532. }
  27533. ,
  27534. t.prototype.lowestByScore = function(e, t, i) {
  27535. return this.findRankedByScore(0, e, t, i)
  27536. }
  27537. ,
  27538. t.prototype.findRankedByScore = function(e, t, i, n) {
  27539. n && (n.candidates = null,
  27540. n.pano = null),
  27541. e = e || 0;
  27542. var r = this.sortByScore(t, i);
  27543. return !r || 0 === r.length || e >= r.length ? null : (n && (n.candidates = r,
  27544. n.pano = r[e].pano),
  27545. r[e].pano)
  27546. }
  27547. ,
  27548. t.prototype.showPanoScores = function(e) {
  27549. this.list.forEach(function(e) {
  27550. e.removeTextSprite()
  27551. });
  27552. var t = 6344768;
  27553. e.forEach(function(e) {
  27554. e.pano.addTextSprite(e.score.toFixed(2), t),
  27555. t = 16428055
  27556. })
  27557. }
  27558. ,
  27559. t.prototype.isNeighbour = function(e, t) {
  27560. return this.neighbourMap[e.id][t.id]
  27561. }
  27562. ,
  27563. t.prototype.getNeighbours = function(e) {
  27564. return this.neighbourMap[e.id]
  27565. }
  27566. ,
  27567. t.prototype.setNeighbour = function(e, t, i) {
  27568. return this.neighbourMap[e.id] || (this.neighbourMap[e.id] = {}),
  27569. this.neighbourMap[t.id] || (this.neighbourMap[t.id] = {}),
  27570. this.neighbourMap[e.id][e.id] = !0,
  27571. this.neighbourMap[t.id][t.id] = !0,
  27572. this.neighbourMap[e.id][t.id] = i,
  27573. this.neighbourMap[t.id][e.id] = i,
  27574. this.neighbourMap[e.id]
  27575. }
  27576. ,
  27577. t.prototype.findClosest = function(e, t) {
  27578. var i = [r.filters.isPanoAligned()];
  27579. return t && i.push(r.filters.inDirection(e, t, .75)),
  27580. this.find(i, [r.sortFunctions.distanceToPoint(e)])
  27581. }
  27582. ,
  27583. t.prototype.dualNeighbors = function(e, t) {
  27584. var i, n = [];
  27585. for (i in this.neighbourMap[e.id])
  27586. this.neighbourMap[t.id][i] && n.push(i);
  27587. return n
  27588. }
  27589. ,
  27590. t.prototype.populate_path_graph = function() {
  27591. var e, t, i, n, r, o, a, s, l = Date.now(), c = {}, h = 0, u = new w.Vector3(0,0,0);
  27592. for (e = 0; e < this.list.length; e += 1) {
  27593. for (t in s = !(a = {}),
  27594. i = (r = this.list[e]).neighbourPanos || r.findNeighourPanos())
  27595. if (i[t]) {
  27596. o = this.index[t],
  27597. u.copy(r.floorPosition),
  27598. u.sub(o.floorPosition);
  27599. var d = Math.sqrt(u.x * u.x + u.z * u.z)
  27600. , p = (Math.abs(u.y),
  27601. Math.max(d, .01),
  27602. Math.max(0, Math.abs(u.y) - .2));
  27603. n = 0 < p ? (1,
  27604. p = Math.pow(4 * p, 2),
  27605. d = Math.pow(d, 2),
  27606. Math.sqrt(p * p + d * d)) : (1,
  27607. u.length()),
  27608. a[o.id] = n,
  27609. s = !0
  27610. }
  27611. s ? c[r.id] = a : h += 1
  27612. }
  27613. this.map = c,
  27614. T.info("graph ready in " + (Date.now() - l) + "ms, " + h + " had no neighbors")
  27615. }
  27616. ,
  27617. t.prototype.aStarSearch = function(e, t) {
  27618. var i = Date.now()
  27619. , n = new o({
  27620. start: e,
  27621. isEnd: function(e) {
  27622. return e === t
  27623. },
  27624. neighbor: function(e) {
  27625. var t = e.neighbourPanos || e.findNeighourPanos()
  27626. , i = [];
  27627. for (var n in t)
  27628. i.push(this.index[n]);
  27629. return i
  27630. }
  27631. .bind(this),
  27632. distance: function(e, t) {
  27633. return this.map[e.id][t.id]
  27634. }
  27635. .bind(this),
  27636. heuristic: function(e, t) {
  27637. return 1
  27638. }
  27639. .bind(this),
  27640. hash: function(e) {
  27641. return e.id
  27642. },
  27643. timeout: 5e3
  27644. });
  27645. if (T.debug("A* search in " + (Date.now() - i) + "ms"),
  27646. "success" !== n.status)
  27647. return T.debug("Did not find A* path from " + e + " to " + t),
  27648. null;
  27649. T.debug("Total cost " + n.cost.toPrecision(3) + ", " + n.path.length + " steps");
  27650. var r = [];
  27651. return n.path.forEach(function(e) {
  27652. r.push(e.id)
  27653. }),
  27654. r
  27655. }
  27656. ,
  27657. t.prototype.includeNodesNearPath = (f = new w.Vector3,
  27658. g = new w.Vector3,
  27659. m = new w.Vector3,
  27660. v = new w.Vector3,
  27661. y = new w.Vector3,
  27662. A = new w.Vector3,
  27663. C = new w.Vector3,
  27664. I = new w.Vector3,
  27665. E = [],
  27666. _ = new w.Vector3,
  27667. b = new w.Vector3,
  27668. function(e, t) {
  27669. if (e)
  27670. for (var i = function(e, t, i) {
  27671. return y.copy(t).sub(e),
  27672. y.dot(i)
  27673. }, n = function(e, t) {
  27674. return i(_, e.position, m) - i(_, t.position, m)
  27675. }, r = 0; r < e.length - 1; ) {
  27676. var o = e[r]
  27677. , a = e[r + 1]
  27678. , s = this.index[o]
  27679. , l = this.index[a];
  27680. _.copy(s.position),
  27681. b.copy(l.position),
  27682. E.length = 0,
  27683. f.copy(b).sub(_),
  27684. m.copy(f).normalize();
  27685. for (var c = 0; c < this.list.length; c++) {
  27686. var h = this.list[c];
  27687. y.copy(h.position).sub(_);
  27688. var u = y.dot(m);
  27689. 0 < u && (C.copy(m),
  27690. C.multiplyScalar(u),
  27691. A.copy(y),
  27692. A.sub(C),
  27693. A.length() < t && (g.copy(f).negate(),
  27694. v.copy(g).normalize(),
  27695. I.copy(h.position).sub(b),
  27696. 0 < I.dot(v) && E.push(h)))
  27697. }
  27698. if (0 < E.length) {
  27699. E.sort(n);
  27700. for (var d = e.length + E.length - 1; d >= r + E.length; d--)
  27701. e[d] = e[d - E.length];
  27702. for (var p = 0; p < E.length; p++)
  27703. e[p + r + 1] = E[p].id
  27704. }
  27705. r += E.length + 1
  27706. }
  27707. }
  27708. ),
  27709. t.prototype.fadeMarkerOpacity = function(e, t) {
  27710. var i = void 0 === e ? a.panorama.markerOpacity : e
  27711. , n = this.list.findIndex(function(e) {
  27712. return e.marker
  27713. });
  27714. if (!(n < 0)) {
  27715. var r = this.list[n].marker.material.opacity;
  27716. if (r !== e) {
  27717. var o = i - r;
  27718. s.trigger({
  27719. func: function(e, t) {
  27720. var i = r + e * o;
  27721. this.forEach(function(e) {
  27722. e.marker && (e.marker.material.opacity = i)
  27723. })
  27724. }
  27725. .bind(this),
  27726. duration: void 0 === t ? a.markerOpacityTransitionTime : t,
  27727. name: "_fpm"
  27728. })
  27729. }
  27730. }
  27731. }
  27732. ,
  27733. c.exports = t
  27734. }
  27735. ).call(this, "/js/util/PanoramaCollection.js")
  27736. }
  27737. , {
  27738. "../objects/Panorama": 148,
  27739. "../settings": 166,
  27740. "./IndexedCollection": 175,
  27741. "./aStar": 180,
  27742. "./common": 185,
  27743. "./logger": 189,
  27744. "./transitions": 195,
  27745. three: 217
  27746. }],
  27747. 179: [function(e, t, i) {
  27748. "use strict";
  27749. function n() {
  27750. this.actionSequence = [],
  27751. this.actionSequenceInProgress = !1
  27752. }
  27753. function r(e, t, i, n) {
  27754. c.trackAlways("zoom_" + e, {
  27755. from: t,
  27756. to: i,
  27757. pano: n
  27758. })
  27759. }
  27760. var o, a, s, l, c = e("../analytics");
  27761. n.prototype.reset = function(e) {
  27762. this.actionSequenceInProgress = !1,
  27763. this.actionSequence.length = 0
  27764. }
  27765. ,
  27766. n.prototype.addZoomAction = (a = o = null,
  27767. s = !1,
  27768. l = function() {
  27769. if (o = null,
  27770. 0 < this.actionSequence.length) {
  27771. var e = this.actionSequence[0].start
  27772. , t = this.actionSequence[this.actionSequence.length - 1].end;
  27773. 1 === e ? function(e, t) {
  27774. r("initial", 1, e, t)
  27775. }(t, a) : function(e, t, i) {
  27776. r("followup", e, t, i)
  27777. }(e, t, a)
  27778. }
  27779. this.reset()
  27780. }
  27781. ,
  27782. function(e, t, i) {
  27783. if (e !== t) {
  27784. s || (l = l.bind(this),
  27785. s = !0),
  27786. o && (window.clearTimeout(o),
  27787. o = null),
  27788. i === a && this.actionSequenceInProgress || (this.reset(),
  27789. a = i),
  27790. this.actionSequenceInProgress = !0;
  27791. var n = {
  27792. start: e,
  27793. end: t
  27794. };
  27795. this.actionSequence.push(n),
  27796. o = window.setTimeout(l, 150)
  27797. }
  27798. }
  27799. ),
  27800. t.exports = n
  27801. }
  27802. , {
  27803. "../analytics": 4
  27804. }],
  27805. 180: [function(e, t, i) {
  27806. "use strict";
  27807. function g(e) {
  27808. if (void 0 === e.parent)
  27809. return [e.data];
  27810. var t = g(e.parent);
  27811. return t.push(e.data),
  27812. t
  27813. }
  27814. function m(e) {
  27815. return e.toString()
  27816. }
  27817. function v(e, t) {
  27818. return e.f - t.f
  27819. }
  27820. var y = e("Set")
  27821. , A = e("heap")
  27822. , C = e("dict");
  27823. t.exports = function(e) {
  27824. void 0 === e.timeout && (e.timeout = 1 / 0);
  27825. var t = e.hash || m
  27826. , i = {
  27827. data: e.start,
  27828. g: 0,
  27829. h: e.heuristic(e.start)
  27830. }
  27831. , n = i;
  27832. i.f = i.h;
  27833. var r = new y
  27834. , o = new A(v)
  27835. , a = C();
  27836. o.push(i),
  27837. a.set(t(i.data), i);
  27838. for (var s = new Date; o.size(); ) {
  27839. if (new Date - s > e.timeout)
  27840. return {
  27841. status: "timeout",
  27842. cost: n.g,
  27843. path: g(n)
  27844. };
  27845. var l = o.pop();
  27846. if (a.delete(t(l.data)),
  27847. e.isEnd(l.data))
  27848. return {
  27849. status: "success",
  27850. cost: l.g,
  27851. path: g(l)
  27852. };
  27853. r.add(t(l.data));
  27854. for (var c = e.neighbor(l.data), h = 0; h < c.length; h++) {
  27855. var u = c[h];
  27856. if (!r.contains(t(u))) {
  27857. var d = l.g + e.distance(l.data, u)
  27858. , p = a.get(t(u))
  27859. , f = !1;
  27860. if (void 0 === p)
  27861. p = {
  27862. data: u
  27863. },
  27864. a.set(t(u), p);
  27865. else {
  27866. if (p.g < d)
  27867. continue;
  27868. f = !0
  27869. }
  27870. p.parent = l,
  27871. p.g = d,
  27872. p.h = e.heuristic(u),
  27873. p.f = d + p.h,
  27874. p.h < n.h && (n = p),
  27875. f ? o.heapify() : o.push(p)
  27876. }
  27877. }
  27878. }
  27879. return {
  27880. status: "noPath",
  27881. cost: n.g,
  27882. path: g(n)
  27883. }
  27884. }
  27885. }
  27886. , {
  27887. Set: 196,
  27888. dict: 210,
  27889. heap: 211
  27890. }],
  27891. 181: [function(i, n, e) {
  27892. (function(e) {
  27893. "use strict";
  27894. function s(e, t, i) {
  27895. function n() {
  27896. l.warn("Retrying ", t),
  27897. s(e, t, i).done(a.resolve.bind(a)).progress(a.notify.bind(a)).fail(a.reject.bind(a))
  27898. }
  27899. var r = function(e, t, i) {
  27900. var n = new XMLHttpRequest;
  27901. if (i && "withCredentials"in n)
  27902. n.open(e, t, i);
  27903. else if ("undefined" != typeof XDomainRequest)
  27904. (n = new XDomainRequest).open(e, t);
  27905. else {
  27906. if (i)
  27907. throw "Browser does not support CORS!";
  27908. n.open(e, t)
  27909. }
  27910. return n
  27911. }(e, t, !1);
  27912. if ((i = i || {}).retries = void 0 !== i.retries ? i.retries : 0,
  27913. i.retry = void 0 !== i.retry ? i.retry : "get" === e.toLowerCase(),
  27914. i.responseType)
  27915. if (-1 < ["arraybuffer", "text", "json"].indexOf(i.responseType))
  27916. r.responseType = i.responseType;
  27917. else {
  27918. if ("image/jpeg" !== i.responseType)
  27919. throw new Error('reponseType can only be one of "arraybuffer", "text" or "json", "image/jpeg"');
  27920. r.responseType = "arraybuffer"
  27921. }
  27922. if ("json" === i.responseType && r.setRequestHeader("Accept", "application/json"),
  27923. i.auth && r.setRequestHeader("Authorization", i.auth),
  27924. "object" == typeof i.data && (i.data = JSON.stringify(i.data),
  27925. r.setRequestHeader("Content-Type", "application/json")),
  27926. "object" == typeof i.headers)
  27927. for (var o in i.headers)
  27928. r.setRequestHeader(o, i.headers[o]);
  27929. var a = $.Deferred();
  27930. return r.onreadystatechange = function(e) {
  27931. if (4 === this.readyState)
  27932. if (500 <= this.status && this.status <= 600 && i.retry && i.retries < 3)
  27933. i.retries++,
  27934. setTimeout(n, 1e3);
  27935. else if (200 === this.status) {
  27936. var t = function(e, t) {
  27937. var i = e.response;
  27938. if ("json" === t && "object" != typeof i)
  27939. try {
  27940. i = JSON.parse(e.responseText)
  27941. } catch (e) {
  27942. return void a.reject({
  27943. error: "Failed parsing JSON"
  27944. })
  27945. }
  27946. else if ("image/jpeg" === t) {
  27947. var n = new Uint8Array(e.response)
  27948. , r = new Blob([n],{
  27949. type: "image/jpeg"
  27950. })
  27951. , o = URL.createObjectURL(r);
  27952. (i = new Image).src = o,
  27953. i.crossOrigin = "Anonymous",
  27954. i.onload = function() {
  27955. URL.revokeObjectURL(o)
  27956. }
  27957. }
  27958. return i
  27959. }(this, i.responseType);
  27960. a.resolve(t)
  27961. } else
  27962. a.reject(this)
  27963. }
  27964. ,
  27965. r.onprogress = function(e) {
  27966. a.notify(e)
  27967. }
  27968. ,
  27969. r.send(i.data),
  27970. a.promise()
  27971. }
  27972. function o(e, t) {
  27973. var i = e + "__" + (t.responseType || null) + "__" + (t.auth || null) + "__" + (t.prefetchFrom || null);
  27974. return t.headers && function(t) {
  27975. return Object.keys(t).sort().map(function(e) {
  27976. return {
  27977. key: e,
  27978. value: t[e]
  27979. }
  27980. })
  27981. }(t.headers).forEach(function(e) {
  27982. i += "__" + e.key + ":" + e.value
  27983. }),
  27984. i
  27985. }
  27986. var t = i("./logger")
  27987. , a = i("../ab")
  27988. , l = new t(e);
  27989. window.URL = window.URL || window.webkitURL,
  27990. window.MP_REQUEST_CACHE = window.MP_REQUEST_CACHE || {},
  27991. window.MP_PREFETCHED_MODELDATA = window.MP_PREFETCHED_MODELDATA || {},
  27992. n.exports = {
  27993. get: function(e, t) {
  27994. var i, n = void 0 === (t = t || {}).cache || t.cache;
  27995. if (n) {
  27996. var r = function(e, t) {
  27997. return window.MP_REQUEST_CACHE ? window.MP_REQUEST_CACHE[o(e, t)] : null
  27998. }(e, t);
  27999. if (r)
  28000. return r
  28001. }
  28002. return i = t.prefetchFrom && window.MP_PREFETCHED_MODELDATA[t.prefetchFrom] ? $.when(window.MP_PREFETCHED_MODELDATA[t.prefetchFrom]) : s("GET", e, t),
  28003. n && function(e, t, i) {
  28004. window.MP_REQUEST_CACHE && (window.MP_REQUEST_CACHE[o(e, t)] = i)
  28005. }(e, t, i),
  28006. i
  28007. },
  28008. post: function(e, t) {
  28009. return s("POST", e, t)
  28010. },
  28011. patch: function(e, t) {
  28012. return s("PATCH", e, t)
  28013. },
  28014. getImage: function(e, t) {
  28015. function i() {
  28016. l.warn("Retrying ", e),
  28017. o.getImage(e, t - 1).done(n.resolve.bind(n)).progress(n.notify.bind(n)).fail(n.reject.bind(n))
  28018. }
  28019. var n = $.Deferred()
  28020. , r = new Image
  28021. , o = this;
  28022. return e = a.changeIfImageOptimzing(e),
  28023. null != t || (t = 3),
  28024. r.onerror = function() {
  28025. 0 < t ? setTimeout(i, 1e3) : n.reject()
  28026. }
  28027. ,
  28028. r.onload = function() {
  28029. n.resolve(r)
  28030. }
  28031. ,
  28032. r.crossOrigin = "anonymous",
  28033. r.src = e,
  28034. n
  28035. }
  28036. }
  28037. }
  28038. ).call(this, "/js/util/ajax.js")
  28039. }
  28040. , {
  28041. "../ab": 3,
  28042. "./logger": 189
  28043. }],
  28044. 182: [function(e, t, i) {
  28045. "use strict";
  28046. function n(e, t) {
  28047. var i = window.navigator.userAgent.match(e);
  28048. return i = i ? i[1].split(t) : [],
  28049. {
  28050. major: parseInt(i[0]) || 0,
  28051. minor: parseInt(i[1]) || 0,
  28052. patch: parseInt(i[2]) || 0
  28053. }
  28054. }
  28055. var r = e("../exception/DeviceMismatchException");
  28056. t.exports = {
  28057. isFullscreen: function() {
  28058. return document.fullscreenElement || document.mozFullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement
  28059. },
  28060. supportsFullscreen: function() {
  28061. return document.fullscreenEnabled || document.mozFullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled || document.msFullscreenEnabled
  28062. },
  28063. isPointerLocked: function() {
  28064. return document.pointerLockElement || document.mozPointerLockElement || document.webkitPointerLockElement
  28065. },
  28066. requestFullscreen: function(e, t) {
  28067. e.requestFullscreen ? e.requestFullscreen() : e.mozRequestFullScreen ? e.mozRequestFullScreen() : e.webkitRequestFullscreen ? e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT) : e.msRequestFullscreen && e.msRequestFullscreen(),
  28068. t && $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", browser.requestPointerLock)
  28069. },
  28070. requestPointerLock: function() {
  28071. var e;
  28072. if (document.fullscreenElement)
  28073. e = document.fullscreenElement();
  28074. else if (document.mozFullscreenElement)
  28075. e = document.mozFullscreenElement();
  28076. else if (document.mozFullScreenElement)
  28077. e = document.mozFullScreenElement();
  28078. else {
  28079. if (!document.webkitFullscreenElement)
  28080. return;
  28081. e = document.webkitFullscreenElement()
  28082. }
  28083. e.requestPointerLock = e.requestPointerLock || e.mozRequestPointerLock || e.webkitRequestPointerLock,
  28084. e.requestPointerLock(),
  28085. $(document).off("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", this)
  28086. },
  28087. exitPointerLock: function() {
  28088. document.exitPointerLock = document.exitPointerLock || document.mozExitPointerLock || document.webkitExitPointerLock,
  28089. document.exitPointerLock()
  28090. },
  28091. exitFullscreen: function() {
  28092. document.exitFullscreen ? document.exitFullscreen() : document.msExitFullscreen ? document.msExitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.webkitExitFullscreen && document.webkitExitFullscreen()
  28093. },
  28094. details: function() {
  28095. var e = navigator.userAgent.match("(Firefox|Chrome|Safari)/([\\d]+)");
  28096. return e ? {
  28097. name: e[1],
  28098. version: parseInt(e[2]),
  28099. platform: navigator.platform
  28100. } : {}
  28101. },
  28102. is: function(e) {
  28103. return this.details() && this.details().name === e
  28104. },
  28105. inIframe: function() {
  28106. return window.parent !== window
  28107. },
  28108. aspectRatio: function() {
  28109. var e = $("#player").width() / $("#player").height();
  28110. return isFinite(e) ? e : 0
  28111. },
  28112. userAgent: function() {
  28113. return window.navigator.userAgent
  28114. },
  28115. isMobile: function() {
  28116. var e = navigator.userAgent || navigator.vendor || window.opera;
  28117. 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))
  28118. },
  28119. isLandscape: function() {
  28120. return this.isMobile && 1 < this.aspectRatio()
  28121. },
  28122. isSmallScreen: function() {
  28123. return screen.width / window.devicePixelRatio < 240
  28124. },
  28125. detectIE: function() {
  28126. return -1 !== window.navigator.userAgent.indexOf("MSIE ") || !!navigator.userAgent.match(/Trident.*rv\:11\./)
  28127. },
  28128. detectSafari: function() {
  28129. return -1 !== window.navigator.userAgent.indexOf("Safari") && !this.detectChrome()
  28130. },
  28131. detectFirefox: function() {
  28132. return -1 !== window.navigator.userAgent.indexOf("Firefox")
  28133. },
  28134. detectChrome: function() {
  28135. return -1 !== window.navigator.userAgent.indexOf("Chrome") && !this.detectOpera()
  28136. },
  28137. detectOpera: function() {
  28138. return -1 !== window.navigator.userAgent.indexOf("OPR")
  28139. },
  28140. detectIOS: function() {
  28141. return this.detectIPhone() || this.detectIPad() || this.detectIPod()
  28142. },
  28143. detectIPad: function() {
  28144. var e = window.navigator.userAgent;
  28145. return /iPad/.test(e)
  28146. },
  28147. detectIPod: function() {
  28148. var e = window.navigator.userAgent;
  28149. return /iPod/.test(e)
  28150. },
  28151. detectIPhone: function() {
  28152. var e = window.navigator.userAgent;
  28153. return /iPhone/.test(e)
  28154. },
  28155. detectAndroid: function() {
  28156. return -1 !== window.navigator.userAgent.indexOf("Android")
  28157. },
  28158. detectAndroidMobile: function() {
  28159. var e = window.navigator.userAgent;
  28160. return this.detectAndroid() && -1 !== e.indexOf("Mobile")
  28161. },
  28162. detectSamsungNative: function() {
  28163. var e = window.navigator.userAgent;
  28164. return -1 !== e.indexOf("SM-G900H") || -1 !== e.indexOf("GT-I9500") || -1 !== e.indexOf("SM-N900")
  28165. },
  28166. detectSamsungS6: function() {
  28167. return -1 !== window.navigator.userAgent.indexOf("SM-G92")
  28168. },
  28169. detectHUAWEI5X: function() {
  28170. return -1 !== window.navigator.userAgent.indexOf("KIW-TL00H")
  28171. },
  28172. detectWebVR: function() {
  28173. return !(!window.navigator.getVRDisplays || !window.VRDisplay)
  28174. },
  28175. getVRDisplay: function() {
  28176. var t = $.Deferred();
  28177. return this.detectWebVR() ? (navigator.getVRDisplays().then(function(e) {
  28178. 1 <= e.length && t.resolve(e[0]),
  28179. t.reject(null)
  28180. }),
  28181. t) : t.reject(null)
  28182. },
  28183. iosVersion: function() {
  28184. if (!this.detectIOS())
  28185. throw new r("Did not detect an iDevice");
  28186. return n(/((?:\d+\_?){1,3}) like Mac OS/, "_")
  28187. },
  28188. androidVersion: function() {
  28189. if (!this.detectAndroid())
  28190. throw new r("Did not detect an Android based device");
  28191. return n(/Android ((?:\d+\.?){1,3})/, ".")
  28192. },
  28193. valueFromCookie: function(e, t) {
  28194. var i = new RegExp(e + "=([0-9a-f]+)(; ?|$)").exec(document.cookie);
  28195. if (!i)
  28196. return t;
  28197. var n = i[1];
  28198. return "boolean" == typeof t ? "true" === n || "1" === n : "number" == typeof t ? parseFloat(n) : n
  28199. },
  28200. valueFromHash: function(e, t) {
  28201. var i = new RegExp("[#&?]" + e + "=([^#&?]*)").exec(window.location.href);
  28202. if (!i)
  28203. return t;
  28204. var n = i[1];
  28205. return "boolean" == typeof t ? "true" === n || "1" === n : "number" == typeof t ? parseFloat(n) : window.decodeURIComponent(n)
  28206. }
  28207. }
  28208. }
  28209. , {
  28210. "../exception/DeviceMismatchException": 56
  28211. }],
  28212. 183: [function(i, n, e) {
  28213. (function(e) {
  28214. "use strict";
  28215. var o = i("../controls/serializer")
  28216. , a = i("../util/math")
  28217. , s = i("./browser")
  28218. , l = i("../enum/Viewmode")
  28219. , t = i("../util/logger")
  28220. , c = i("three")
  28221. , h = new t(e);
  28222. n.exports = {
  28223. getStartCameraOptions: function(e, t) {
  28224. var i = function(e) {
  28225. var t = s.valueFromHash("start", "")
  28226. , i = {};
  28227. if ("" !== t) {
  28228. h.debug("Start override found in parameters, trying to parse..."),
  28229. i = function(e) {
  28230. return o.deserialize(e)
  28231. }(t) || {};
  28232. var n = s.valueFromHash("tag", null);
  28233. n && (i.tag = n),
  28234. i.panoId && (i.pano = e.get(i.panoId))
  28235. }
  28236. return i
  28237. }(t);
  28238. if (0 < Object.keys(i).length)
  28239. return i;
  28240. if (e.heroImage)
  28241. i = function(e, t) {
  28242. if (!e.heroImage || !e.heroImage.metadata.camera_position)
  28243. return {};
  28244. var i = {}
  28245. , n = e.heroImage.metadata;
  28246. h.debug("Using start position from thumbnail image"),
  28247. i.position = n.camera_position,
  28248. i.quaternion = n.camera_quaternion;
  28249. try {
  28250. i.mode = l.convertWorkshopModeInt(n.camera_mode),
  28251. i.mode === l.PANORAMA ? i.pano = t.get(n.scan_id) : i.floorVisibility = n.floor_visibility
  28252. } catch (e) {
  28253. h.debug(e.message)
  28254. }
  28255. return i
  28256. }(e, t);
  28257. else if (window.MP_PREFETCHED_MODELDATA.camera_start) {
  28258. var n = window.MP_PREFETCHED_MODELDATA.camera_start;
  28259. try {
  28260. 0 < Object.keys(n).length && !a.isEmptyQuaternion(n.camera.quaternion) && (i.mode = l.convertWorkshopModeInt(n.mode),
  28261. i.position = (new c.Vector3).fromArray(n.camera.position),
  28262. i.quaternion = (new c.Quaternion).fromArray(n.camera.quaternion),
  28263. i.zoom = a.convertWorkshopOrthoZoom(n.camera.zoom),
  28264. n.pano && (i.pano = t.get(n.pano.uuid) || t.findClosest(i.position),
  28265. h.debug("Using camera_start"),
  28266. h.debug("Modeldata pano: ", i.pano.quaternion),
  28267. h.debug("Camera start pano: ", n.pano.quaternion)),
  28268. i.mode !== l.PANORAMA && (i.floorVisibility = e.heroImage.metadata.floor_visibility));
  28269. } catch (e) {
  28270. h.warn(e.message)
  28271. if(i.mode == "panorama" && !i.pano){
  28272. i.pano = t.list[0]
  28273. }
  28274. }
  28275. }
  28276. if (e.outsideAllowed() || i.mode === l.PANORAMA || (i = {}),
  28277. i.mode === l.MESH && i.position && (i.mode = l.PANORAMA,
  28278. i.pano = t.findClosest(i.position) ,
  28279. i.quaternion = i.pano.quaternion),
  28280. 0 === Object.keys(i).length) {
  28281. var r = t.list[0];
  28282. r && (i.mode = l.PANORAMA,
  28283. i.pano = r,
  28284. i.position = r.position,
  28285. i.quaternion = r.quaternion,
  28286. h.info("Starting at 1st pano " + r.id))
  28287. }
  28288. return i.mode = i.mode || l.DOLLHOUSE,
  28289. i
  28290. }
  28291. }
  28292. }
  28293. ).call(this, "/js/util/camera.js")
  28294. }
  28295. , {
  28296. "../controls/serializer": 14,
  28297. "../enum/Viewmode": 51,
  28298. "../util/logger": 189,
  28299. "../util/math": 190,
  28300. "./browser": 182,
  28301. three: 217
  28302. }],
  28303. 184: [function(e, t, i) {
  28304. "use strict";
  28305. function r(e, t, i) {
  28306. var n = t
  28307. , r = i;
  28308. return 2 * Math.atan(Math.tan(e * a.RADIANS_PER_DEGREE / 2) * (n / r)) * a.DEGREES_PER_RADIAN
  28309. }
  28310. function o(e, t, i) {
  28311. var n = t
  28312. , r = i;
  28313. return 2 * Math.atan(Math.tan(e * a.RADIANS_PER_DEGREE / 2) * (r / n)) * a.DEGREES_PER_RADIAN
  28314. }
  28315. var a = e("./MathLight");
  28316. t.exports = {
  28317. clampVFOV: function(e, t, i, n) {
  28318. return t < r(e, i, n) ? o(t, i, n) : e
  28319. },
  28320. getHFOVForCamera: function(e, t, i) {
  28321. return r(e.fov, t, i)
  28322. },
  28323. getHFOVFromVFOV: r,
  28324. getVFOVFromHFOV: o
  28325. }
  28326. }
  28327. , {
  28328. "./MathLight": 176
  28329. }],
  28330. 185: [function(e, t, i) {
  28331. "use strict";
  28332. var a = e("three");
  28333. t.exports = {
  28334. delayOneFrame: function(e) {
  28335. window.setTimeout(e, 1)
  28336. },
  28337. normalizeUrl: function(e) {
  28338. return e.replace("https://", "http://")
  28339. },
  28340. domainFromUrl: function(e) {
  28341. var t = /^([^:]*:\/\/)?(www\.)?([^\/]+)/.exec(e);
  28342. return t ? t[3] : e
  28343. },
  28344. average: function(e, t) {
  28345. if (0 === e.length)
  28346. return null;
  28347. for (var i = 0, n = 0, r = 0; r < e.length; r++) {
  28348. i += t ? e[r][t] : e[r],
  28349. n++
  28350. }
  28351. return i / n
  28352. },
  28353. countUnique: function(e) {
  28354. for (var t = {}, i = 0; i < e.length; i++)
  28355. t[e[i]] = 1 + (t[e[i]] || 0);
  28356. return Object.keys(t).length
  28357. },
  28358. averageVectors: function(e, t) {
  28359. var i = new a.Vector3;
  28360. if (0 === e.length)
  28361. return i;
  28362. for (var n = 0, r = 0; r < e.length; r++) {
  28363. var o = t ? e[r][t] : e[r];
  28364. i.add(o),
  28365. n++
  28366. }
  28367. return i.divideScalar(n)
  28368. },
  28369. equalLists: function(e, t) {
  28370. if (e.length !== t.length)
  28371. return !1;
  28372. for (var i = 0; i < e.length; i++)
  28373. if (e[i] !== t[i])
  28374. return !1;
  28375. return !0
  28376. },
  28377. lowerMedian: function(e, t) {
  28378. return 0 === e.length ? null : (t = t || 2,
  28379. e.sort(function(e, t) {
  28380. return e - t
  28381. }),
  28382. e[Math.floor(e.length / t)])
  28383. },
  28384. stableSort: function(e, n) {
  28385. return e.map(function(e, t) {
  28386. return {
  28387. value: e,
  28388. index: t
  28389. }
  28390. }).sort(function(e, t) {
  28391. var i = n(e.value, t.value);
  28392. return 0 !== i ? i : e.index - t.index
  28393. }).map(function(e) {
  28394. return e.value
  28395. })
  28396. },
  28397. filterAll: function(e, i) {
  28398. return e.filter(function(t) {
  28399. return i.every(function(e) {
  28400. return e(t)
  28401. })
  28402. })
  28403. },
  28404. formatDate: function(e) {
  28405. return [e.getFullYear(), e.getMonth() + 1, e.getDate()].join("-")
  28406. },
  28407. formatDatetime: function(e) {
  28408. return [e.getFullYear(), e.getMonth() + 1, e.getDate(), e.getHours(), e.getMinutes()].join("-")
  28409. },
  28410. randomString: function(e) {
  28411. for (var t = "", i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", n = 0; n < e; n++)
  28412. t += i.charAt(Math.floor(Math.random() * i.length));
  28413. return t
  28414. },
  28415. uint8ToBase64: function(e, t) {
  28416. t && "number" == typeof t || (t = 8192);
  28417. for (var i = [], n = 0; n < e.length; n += t)
  28418. i.push(String.fromCharCode.apply(null, e.subarray(n, n + t)));
  28419. return btoa(i.join(""))
  28420. },
  28421. uuid4: function e(t) {
  28422. return t ? (t ^ 16 * Math.random() >> t / 4).toString(16) : ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, e)
  28423. },
  28424. nth: function(e) {
  28425. return 1 === (e %= 10) ? e + "st" : 2 === e ? e + "nd" : 3 === e ? e + "rd" : e + "th"
  28426. },
  28427. extendObject: function(t, i) {
  28428. return Object.keys(i).forEach(function(e) {
  28429. t[e] = i[e]
  28430. }),
  28431. t
  28432. },
  28433. deepExtend: function e(t) {
  28434. t = t || {};
  28435. for (var i = 1; i < arguments.length; i++) {
  28436. var n = arguments[i];
  28437. if (n)
  28438. for (var r in n)
  28439. n.hasOwnProperty(r) && ("object" == typeof n[r] ? t[r] = e(t[r], n[r]) : t[r] = n[r])
  28440. }
  28441. return t
  28442. },
  28443. inherit: function(e, t) {
  28444. e.prototype = Object.create(t.prototype),
  28445. e.prototype.constructor = e
  28446. },
  28447. extend: function(e, t) {
  28448. for (var i in t.prototype)
  28449. e.prototype[i] = t.prototype[i]
  28450. }
  28451. },
  28452. Math.sign = function(e) {
  28453. return e < 0 ? -1 : 1
  28454. }
  28455. }
  28456. , {
  28457. three: 217
  28458. }],
  28459. 186: [function(e, t, i) {
  28460. "use strict";
  28461. var r = {
  28462. linearTween: function(e, t, i, n) {
  28463. return i * e / n + t
  28464. },
  28465. easeInQuad: function(e, t, i, n) {
  28466. return i * (e /= n) * e + t
  28467. },
  28468. easeOutQuad: function(e, t, i, n) {
  28469. return -i * (e /= n) * (e - 2) + t
  28470. },
  28471. easeInOutQuad: function(e, t, i, n) {
  28472. return (e /= n / 2) < 1 ? i / 2 * e * e + t : -i / 2 * (--e * (e - 2) - 1) + t
  28473. },
  28474. easeInCubic: function(e, t, i, n) {
  28475. return i * (e /= n) * e * e + t
  28476. },
  28477. easeOutCubic: function(e, t, i, n) {
  28478. return e /= n,
  28479. i * (--e * e * e + 1) + t
  28480. },
  28481. easeInOutCubic: function(e, t, i, n) {
  28482. return (e /= n / 2) < 1 ? i / 2 * e * e * e + t : i / 2 * ((e -= 2) * e * e + 2) + t
  28483. },
  28484. easeInQuart: function(e, t, i, n) {
  28485. return i * (e /= n) * e * e * e + t
  28486. },
  28487. easeOutQuart: function(e, t, i, n) {
  28488. return e /= n,
  28489. -i * (--e * e * e * e - 1) + t
  28490. },
  28491. easeInOutQuart: function(e, t, i, n) {
  28492. return (e /= n / 2) < 1 ? i / 2 * e * e * e * e + t : -i / 2 * ((e -= 2) * e * e * e - 2) + t
  28493. },
  28494. easeInQuint: function(e, t, i, n) {
  28495. return i * (e /= n) * e * e * e * e + t
  28496. },
  28497. easeOutQuint: function(e, t, i, n) {
  28498. return e /= n,
  28499. i * (--e * e * e * e * e + 1) + t
  28500. },
  28501. easeInOutQuint: function(e, t, i, n) {
  28502. return (e /= n / 2) < 1 ? i / 2 * e * e * e * e * e + t : i / 2 * ((e -= 2) * e * e * e * e + 2) + t
  28503. },
  28504. easeInSine: function(e, t, i, n) {
  28505. return -i * Math.cos(e / n * (Math.PI / 2)) + i + t
  28506. },
  28507. easeOutSine: function(e, t, i, n) {
  28508. return i * Math.sin(e / n * (Math.PI / 2)) + t
  28509. },
  28510. easeInOutSine: function(e, t, i, n) {
  28511. return -i / 2 * (Math.cos(Math.PI * e / n) - 1) + t
  28512. },
  28513. easeInExpo: function(e, t, i, n) {
  28514. return i * Math.pow(2, 10 * (e / n - 1)) + t
  28515. },
  28516. easeOutExpo: function(e, t, i, n) {
  28517. return i * (1 - Math.pow(2, -10 * e / n)) + t
  28518. },
  28519. easeInOutExpo: function(e, t, i, n) {
  28520. return (e /= n / 2) < 1 ? i / 2 * Math.pow(2, 10 * (e - 1)) + t : (e--,
  28521. i / 2 * (2 - Math.pow(2, -10 * e)) + t)
  28522. },
  28523. easeInCirc: function(e, t, i, n) {
  28524. return e /= n,
  28525. -i * (Math.sqrt(1 - e * e) - 1) + t
  28526. },
  28527. easeOutCirc: function(e, t, i, n) {
  28528. return e /= n,
  28529. e--,
  28530. i * Math.sqrt(1 - e * e) + t
  28531. },
  28532. easeInOutCirc: function(e, t, i, n) {
  28533. return (e /= n / 2) < 1 ? -i / 2 * (Math.sqrt(1 - e * e) - 1) + t : (e -= 2,
  28534. i / 2 * (Math.sqrt(1 - e * e) + 1) + t)
  28535. },
  28536. easeInElastic: function(e, t, i, n) {
  28537. var r = 1.70158
  28538. , o = 0
  28539. , a = i;
  28540. return 0 === e ? t : 1 == (e /= n) ? t + i : (o = o || .3 * n,
  28541. r = a < Math.abs(i) ? (a = i,
  28542. o / 4) : o / (2 * Math.PI) * Math.asin(i / a),
  28543. -a * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o) + t)
  28544. },
  28545. easeOutElastic: function(e, t, i, n) {
  28546. var r = 1.70158
  28547. , o = 0
  28548. , a = i;
  28549. return 0 === e ? t : 1 == (e /= n) ? t + i : (o = o || .3 * n,
  28550. r = a < Math.abs(i) ? (a = i,
  28551. o / 4) : o / (2 * Math.PI) * Math.asin(i / a),
  28552. a * Math.pow(2, -10 * e) * Math.sin((e * n - r) * (2 * Math.PI) / o) + i + t)
  28553. },
  28554. easeInOutElastic: function(e, t, i, n) {
  28555. var r = 1.70158
  28556. , o = 0
  28557. , a = i;
  28558. return 0 === e ? t : 2 == (e /= n / 2) ? t + i : (o = o || n * (.3 * 1.5),
  28559. r = a < Math.abs(i) ? (a = i,
  28560. o / 4) : o / (2 * Math.PI) * Math.asin(i / a),
  28561. 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)
  28562. },
  28563. easeInBack: function(e, t, i, n, r) {
  28564. return void 0 === r && (r = 1.70158),
  28565. i * (e /= n) * e * ((r + 1) * e - r) + t
  28566. },
  28567. easeOutBack: function(e, t, i, n, r) {
  28568. return void 0 === r && (r = 1.70158),
  28569. i * ((e = e / n - 1) * e * ((r + 1) * e + r) + 1) + t
  28570. },
  28571. easeInOutBack: function(e, t, i, n, r) {
  28572. return void 0 === r && (r = 1.70158),
  28573. (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
  28574. },
  28575. easeOutBounce: function(e, t, i, n) {
  28576. 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
  28577. },
  28578. easeInBounce: function(e, t, i, n) {
  28579. return i - r.easeOutBounce(n - e, 0, i, n) + t
  28580. },
  28581. easeInOutBounce: function(e, t, i, n) {
  28582. 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
  28583. }
  28584. };
  28585. t.exports = r
  28586. }
  28587. , {}],
  28588. 187: [function(e, t, i) {
  28589. "use strict";
  28590. function n() {
  28591. this.events = [],
  28592. this.valid = !1
  28593. }
  28594. var r = e("../enum/Joystick");
  28595. n.prototype.push = function(e, t) {
  28596. this.events.push({
  28597. direction: e,
  28598. pano: t
  28599. }),
  28600. this.valid = !0
  28601. }
  28602. ,
  28603. n.prototype.pop = function(e) {
  28604. var t = this.events.pop();
  28605. return this.events.length < 1 && (this.valid = !1),
  28606. t
  28607. }
  28608. ,
  28609. n.prototype.peek = function() {
  28610. return this.events.length ? this.events[this.events.length - 1] : {
  28611. direction: null,
  28612. pano: null
  28613. }
  28614. }
  28615. ,
  28616. n.prototype.invalidate = function() {
  28617. this.events = [],
  28618. this.valid = !1
  28619. }
  28620. ,
  28621. n.prototype.reversePano = function(e) {
  28622. if (!this.valid)
  28623. return null;
  28624. var t = this.peek();
  28625. return r.opposite(e) === t.direction ? (this.pop(),
  28626. t.pano) : null
  28627. }
  28628. ,
  28629. t.exports = n
  28630. }
  28631. , {
  28632. "../enum/Joystick": 29
  28633. }],
  28634. 188: [function(e, t, i) {
  28635. "use strict";
  28636. t.exports = {
  28637. vector: function(t, i) {
  28638. var n = t.clone();
  28639. return i = i.clone(),
  28640. function(e) {
  28641. t.set(n.x * (1 - e) + i.x * e, n.y * (1 - e) + i.y * e, n.z * (1 - e) + i.z * e)
  28642. }
  28643. },
  28644. quaternion: function(t, i) {
  28645. var n = t.clone();
  28646. return function(e) {
  28647. t.copy(n).slerp(i, e)
  28648. }
  28649. },
  28650. property: function(t, i, n, r) {
  28651. var o = t[i];
  28652. return function(e) {
  28653. t[i] = o * (1 - e) + n * e,
  28654. r && r(t[i])
  28655. }
  28656. },
  28657. uniform: function(t, i, n) {
  28658. var r = t.material.uniforms[i].value;
  28659. return function(e) {
  28660. t.material.uniforms[i] && (t.material.uniforms[i].value = r * (1 - e) + n * e)
  28661. }
  28662. },
  28663. matrix4: function(o, a) {
  28664. var s = o.clone();
  28665. return function(e) {
  28666. for (var t = o.elements, i = s.elements, n = a.elements, r = 0; r < 16; r++)
  28667. t[r] = i[r] * (1 - e) + n[r] * e
  28668. }
  28669. },
  28670. allUniforms: function(e, t, i) {
  28671. var n = e.map(function(e) {
  28672. return this.uniform(e, t, i)
  28673. }
  28674. .bind(this));
  28675. return function(t) {
  28676. n.forEach(function(e) {
  28677. e(t)
  28678. })
  28679. }
  28680. }
  28681. }
  28682. }
  28683. , {}],
  28684. 189: [function(e, t, i) {
  28685. "use strict";
  28686. function h(n) {
  28687. var e, t, i, r, o = n.split("/"), a = "[" + o[o.length - 1].replace(".js", "") + "]", s = {};
  28688. if (h.consoleEnabled) {
  28689. var l = function(e) {
  28690. $("#debug-console").append("<p>" + e + "</p>"),
  28691. $("#debug-console")[0].scrollTop = $("#debug-console")[0].scrollHeight
  28692. };
  28693. e = function(e) {
  28694. l(Array.prototype.slice.call(arguments).join(" "))
  28695. }
  28696. ,
  28697. t = function(e) {
  28698. l(Array.prototype.slice.call(arguments).join(" "))
  28699. }
  28700. ,
  28701. i = function(e) {
  28702. l("WARN: " + Array.prototype.slice.call(arguments).join(" "))
  28703. }
  28704. ,
  28705. r = function(e) {
  28706. l("ERROR: " + Array.prototype.slice.call(arguments).join(" "))
  28707. }
  28708. } else
  28709. console.log ? (e = console.log,
  28710. t = console.info ? console.info : console.log,
  28711. i = console.warn ? console.warn : console.log,
  28712. r = console.error ? console.error : console.log) : e = t = i = r = function() {}
  28713. ;
  28714. function c(e) {
  28715. return [a, h.timestamp()].concat(Array.prototype.slice.call(e))
  28716. }
  28717. return {
  28718. debug: function() {
  28719. h.level >= h.levels.debug && e.apply(console, c(arguments))
  28720. },
  28721. info: function() {
  28722. h.level >= h.levels.info && t.apply(console, c(arguments))
  28723. },
  28724. warn: function() {
  28725. (function(e, t) {
  28726. if (u) {
  28727. var i = Array.prototype.slice.call(e).join(" ");
  28728. u.captureMessage(i, {
  28729. level: t,
  28730. path: n,
  28731. timestamp: h.timestamp()
  28732. })
  28733. }
  28734. }
  28735. )(arguments, "warn"),
  28736. h.level >= h.levels.warn && i.apply(console, c(arguments))
  28737. },
  28738. error: function() {
  28739. (function(e, t) {
  28740. if (u) {
  28741. var i = Array.prototype.slice.call(e).join(" ");
  28742. u.captureException(new Error(i), {
  28743. level: t,
  28744. path: n,
  28745. timestamp: h.timestamp()
  28746. })
  28747. }
  28748. }
  28749. )(arguments, "error"),
  28750. h.level >= h.levels.error && r.apply(console, c(arguments))
  28751. },
  28752. v3str: function(e, t) {
  28753. var i = void 0 === t ? 2 : t;
  28754. return "(" + e.x.toPrecision(i) + ", " + e.y.toPrecision(i) + ", " + e.z.toPrecision(i) + ")"
  28755. },
  28756. eulstr: function(e, t) {
  28757. var i = void 0 === t ? 2 : t;
  28758. return "(" + THREE.Math.radToDeg(e.x).toPrecision(i) + ", " + THREE.Math.radToDeg(e.y).toPrecision(i) + ", " + THREE.Math.radToDeg(e.z).toPrecision(i) + ' "' + e.order + '")'
  28759. },
  28760. time: function(e) {
  28761. h.level >= h.levels.debug && (s[e] = Date.now())
  28762. },
  28763. timeEnd: function(e) {
  28764. if (h.level >= h.levels.debug) {
  28765. var t = s[e];
  28766. if (!t)
  28767. return;
  28768. var i = (Date.now() - t) / 1e3;
  28769. this.debug(e, i + "s")
  28770. }
  28771. }
  28772. }
  28773. }
  28774. var u = window.Raven;
  28775. h.timestamp = function() {
  28776. return (Date.now() - window.navigationStart) / 1e3 + "s"
  28777. }
  28778. ,
  28779. h.level = (h.levels = {
  28780. debug: 3,
  28781. info: 2,
  28782. warn: 1,
  28783. error: 0
  28784. }).info,
  28785. t.exports = h
  28786. }
  28787. , {}],
  28788. 190: [function(e, t, i) {
  28789. "use strict";
  28790. var o = e("three")
  28791. , r = e("../enum/GLCubeFaces");
  28792. e("../constants");
  28793. t.exports = {
  28794. convertVisionVector: function(e) {
  28795. return new o.Vector3(e.x,e.z,-e.y)
  28796. },
  28797. convertVisionQuaternion: function(e) {
  28798. 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)))
  28799. },
  28800. convertWorkshopVector: function(e) {
  28801. return new o.Vector3(-e.x,e.y,e.z)
  28802. },
  28803. convertWorkshopQuaternion: function(e) {
  28804. 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))
  28805. },
  28806. convertWorkshopPanoramaQuaternion: function(e) {
  28807. 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)))
  28808. },
  28809. convertWorkshopOrthoZoom: function(e) {
  28810. return -1 === e ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight
  28811. },
  28812. toPrecision: function(e, t) {
  28813. function i(e, t) {
  28814. var i = Math.pow(10, t);
  28815. return Math.round(e * i) / i
  28816. }
  28817. if (e instanceof Array) {
  28818. for (var n = 0; n < e.length; n++)
  28819. e[n] = i(e[n], t);
  28820. return e
  28821. }
  28822. return i(e, t)
  28823. },
  28824. isEmptyQuaternion: function(e) {
  28825. return 0 === Math.abs(e.x) && 0 === Math.abs(e.y) && 0 === Math.abs(e.z) && 0 === Math.abs(e.w)
  28826. },
  28827. projectPositionToCanvas: function(e, t, i) {
  28828. (i = i || new o.Vector3).copy(e);
  28829. var n = .5 * $("#player").width()
  28830. , r = .5 * $("#player").height();
  28831. return i.project(t),
  28832. i.x = i.x * n + n,
  28833. i.y = -i.y * r + r,
  28834. i
  28835. },
  28836. convertScreenPositionToNDC: function(e, t, i) {
  28837. return (i = i || new o.Vector2).x = e / $("#player").width() * 2 - 1,
  28838. i.y = -t / $("#player").height() * 2 + 1,
  28839. i
  28840. },
  28841. constrainedTurn: function(e) {
  28842. var t = e % (2 * Math.PI);
  28843. return t > Math.PI ? t -= 2 * Math.PI : t < -Math.PI ? t += 2 * Math.PI : t
  28844. },
  28845. getFOVDotThreshold: function(e) {
  28846. return Math.cos(o.Math.degToRad(e / 2))
  28847. },
  28848. transform2DForwardVectorByCubeFace: function(e, t, i, n) {
  28849. switch (e) {
  28850. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  28851. i.set(1, t.y, t.x);
  28852. break;
  28853. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  28854. i.set(-1, t.y, -t.x);
  28855. break;
  28856. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  28857. i.set(-t.x, 1, -t.y);
  28858. break;
  28859. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  28860. i.set(-t.x, -1, t.y);
  28861. break;
  28862. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  28863. i.set(-t.x, t.y, 1);
  28864. break;
  28865. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  28866. i.set(t.x, t.y, -1)
  28867. }
  28868. n && i.normalize()
  28869. },
  28870. //add:
  28871. getPos2d : function(point, camera, dom){
  28872. var camera = camera ;
  28873. var dom = dom;
  28874. 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);
  28875. var x,y;
  28876. x = (pos.x + 1) / 2 * dom.clientWidth;
  28877. y = (1 - (pos.y + 1) / 2) * dom.clientHeight;
  28878. var inSight = x <= dom.clientWidth && x >= 0
  28879. && y <= dom.clientHeight && y >= 0
  28880. return {
  28881. pos: new THREE.Vector2(x,y),
  28882. vector: pos,
  28883. trueSide : pos.z<1, //trueSide为false时,即使在屏幕范围内可见,也是反方向的另一个不可以被渲染的点 参见Tag.update
  28884. inSight : inSight //在屏幕范围内可见
  28885. };
  28886. },
  28887. }
  28888. }
  28889. , {
  28890. "../constants": 8,
  28891. "../enum/GLCubeFaces": 25,
  28892. three: 217
  28893. }],
  28894. 191: [function(e, t, i) {
  28895. "use strict";
  28896. function o(e) {
  28897. return r[e]
  28898. }
  28899. var n = e("../enum/GLCubeFaces")
  28900. , a = [0, 1, 2, 3, 4, 5]
  28901. , r = {
  28902. 0: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  28903. 1: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  28904. 2: n.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  28905. 3: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  28906. 4: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  28907. 5: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  28908. };
  28909. t.exports = {
  28910. mapFaceToCubemapFace: o,
  28911. getCubemapUrls: function(i, n, r) {
  28912. return a.map(function(e, t) {
  28913. return i.get("pan/" + r + "/" + n + "_skybox" + o(e) + ".jpg")
  28914. }
  28915. .bind(this))
  28916. }
  28917. }
  28918. }
  28919. , {
  28920. "../enum/GLCubeFaces": 25
  28921. }],
  28922. 192: [function(e, t, i) {
  28923. "use strict";
  28924. t.exports = {
  28925. captureErrors: function(e, t, i) {
  28926. if ("Raven"in window) {
  28927. Raven.config(e, t).install(),
  28928. i && Raven.setTagsContext(i);
  28929. var n = console.warn
  28930. , r = console.error;
  28931. console.warn = function() {
  28932. var e = Array.prototype.slice.call(arguments);
  28933. Raven.captureMessage(e.join(" "), {
  28934. level: "warning"
  28935. }),
  28936. n.apply(console, e)
  28937. }
  28938. ,
  28939. console.error = function() {
  28940. var e = Array.prototype.slice.call(arguments);
  28941. Raven.captureException(new Error(e.join(" ")), {
  28942. level: "error"
  28943. }),
  28944. r.apply(console, e)
  28945. }
  28946. } else
  28947. console.error("Raven not found, not capturing errors.")
  28948. }
  28949. }
  28950. }
  28951. , {}],
  28952. 193: [function(c, h, e) {
  28953. (function(e) {
  28954. "use strict";
  28955. var i, n = c("./browser"), r = c("../constants"), o = c("url"), t = c("./logger"), a = c("three"), s = new t(e), l = {
  28956. getAuthorizationHeader: function() {
  28957. var e = n.valueFromHash("auth");
  28958. if (e)
  28959. return e.replace(",", " ");
  28960. var t = n.valueFromCookie("token");
  28961. return t ? "Token " + t : null
  28962. },
  28963. parseSidUrl: function(e) {
  28964. var t, i;
  28965. if (t = g_Prefix,
  28966. (e = e || "").match(/^https?/)) {
  28967. o.parse(e);
  28968. t = g_Prefix,
  28969. i = e
  28970. } else
  28971. i = (t = g_Prefix) + "data/" + e;
  28972. return {
  28973. urlBase: t,
  28974. urlModel: i,
  28975. urlFiles: i + (i.match(/\/$/) ? "files" : "/files"),
  28976. urlThumb: i + (i.match(/\/$/) ? "thumb" : "/thumb")
  28977. }
  28978. },
  28979. getModelIDFromQueryString: function() {
  28980. return n.valueFromHash("model") || n.valueFromHash("m")
  28981. },
  28982. /* normalizeModeldata: function(e, i) {
  28983. e = JSON.parse(JSON.stringify(e));
  28984. var n = null;
  28985. if (e.images.forEach(function(t) {
  28986. if (t.metadata) {
  28987. if ("string" == typeof t.metadata)
  28988. try {
  28989. t.metadata = JSON.parse(t.metadata)
  28990. } catch (e) {
  28991. s.warn("Unable to parse image metadata"),
  28992. t.metadata = null
  28993. }
  28994. else
  28995. "object" == typeof t.metadata && s.debug("image.metadata already a JSON object");
  28996. t.metadata.camera_position instanceof Array ? (t.metadata.camera_position = (new a.Vector3).fromArray(t.metadata.camera_position),
  28997. 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)),
  28998. t.metadata.camera_position && (t.metadata.camera_position = i.convertWorkshopVector(t.metadata.camera_position)),
  28999. t.metadata.zoom = t.metadata.zoom || 1),
  29000. !n && e.icon && e.icon === t.sid && (n = t.metadata)
  29001. }
  29002. }),
  29003. n && n.camera_quaternion && n.camera_position && n.scan_position && n.scan_quaternion) {
  29004. var t = {};
  29005. t.pano = {
  29006. quaternion: i.convertWorkshopPanoramaQuaternion(n.scan_quaternion),
  29007. position: i.convertWorkshopVector(n.scan_position),
  29008. uuid: n.scan_id
  29009. },
  29010. t.camera = {
  29011. quaternion: n.camera_quaternion,
  29012. position: n.camera_position
  29013. },
  29014. e.startPano = t
  29015. }
  29016. return e
  29017. }, */
  29018. normalizeModeldata: function(e, t) {//xzw 修改导览images数据
  29019. e = JSON.parse(JSON.stringify(e));
  29020. var i = null;
  29021. if (e.images.forEach(function(n) {
  29022. if(!n.metadata) return;
  29023. if ("string" == typeof n.metadata)
  29024. try {
  29025. n.metadata = JSON.parse(n.metadata)
  29026. } catch (e) {
  29027. s.warn("Unable to parse image metadata"),
  29028. n.metadata = null
  29029. }
  29030. else{
  29031. "object" == typeof n.metadata && s.debug("image.metadata already a JSON object");
  29032. }
  29033. if(n.metadata.camera_position instanceof Array){//xzw 改的格式
  29034. n.metadata.camera_position = new a.Vector3().fromArray(n.metadata.camera_position);
  29035. n.metadata.camera_quaternion = new a.Quaternion().fromArray(n.metadata.camera_quaternion);
  29036. }else{
  29037. n.metadata.camera_position = new a.Vector3().copy(n.metadata.camera_position)
  29038. n.metadata.camera_quaternion = new a.Quaternion().copy(n.metadata.camera_quaternion)
  29039. /* n.metadata.camera_quaternion && (n.metadata.camera_quaternion = i.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  29040. n.metadata.camera_position && (n.metadata.camera_position = i.convertWorkshopVector(n.metadata.camera_position)) */
  29041. }
  29042. !i && e.icon && e.icon === n.sid && (i = n.metadata)
  29043. }),
  29044. //icon初始视角的:
  29045. i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
  29046. var n = {};
  29047. n.pano = {
  29048. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  29049. position: t.convertWorkshopVector(i.scan_position),
  29050. uuid: i.scan_id
  29051. },
  29052. n.camera = {
  29053. quaternion: i.camera_quaternion,
  29054. position: i.camera_position
  29055. },
  29056. e.startPano = n
  29057. }
  29058. return e
  29059. },
  29060. visionVersionToInt: (i = new RegExp(["(?:[0-9.]+\\.){1,4}", "([0-9]+)", "[^\\.]*$"].join("")),
  29061. function(e) {
  29062. if (!e)
  29063. throw new Error("Vision version is required");
  29064. var t = i.exec(e);
  29065. if (null === t)
  29066. throw new Error("String is not a vision version: " + e);
  29067. return parseInt(t[1])
  29068. }
  29069. ),
  29070. modelDataPromisesTiles: function(e) {
  29071. var t = e.vision_version || window.MP_PREFETCHED_MODELDATA.vision_version;
  29072. if (t)
  29073. try {
  29074. return l.visionVersionToInt(t) >= l.visionVersionToInt(r.visionTilingStartVersion)
  29075. } catch (e) {
  29076. s.warn("Invalid vision version: " + t)
  29077. }
  29078. return !1
  29079. }
  29080. };
  29081. h.exports = l
  29082. }
  29083. ).call(this, "/js/util/showcase.js")
  29084. }
  29085. , {
  29086. "../constants": 8,
  29087. "./browser": 182,
  29088. "./logger": 189,
  29089. three: 217,
  29090. url: 208
  29091. }],
  29092. 194: [function(e, t, i) {
  29093. "use strict";
  29094. var r = e("../util/ajax")
  29095. , o = e("three")
  29096. , a = e("../settings")
  29097. , s = {};
  29098. t.exports = {
  29099. load: function(e, t, i) {
  29100. var n = s[e];
  29101. return n ? t && setTimeout(function() {
  29102. t(n)
  29103. }, 1) : (n = new o.Texture,
  29104. a.minimalMemoryMode && (n.minFilter = o.LinearFilter,
  29105. n.magFilter = o.LinearFilter,
  29106. n.generateMipmaps = !1),
  29107. n.sourceFile = e,
  29108. s[e] = n,
  29109. r.getImage(e).then(function(e) {
  29110. n.image = e,
  29111. n.needsUpdate = !0,
  29112. t && t(n)
  29113. }).fail(i)),
  29114. n
  29115. },
  29116. loadBase64: function(e, t) {
  29117. t = t || "png";
  29118. var i = new o.Texture;
  29119. return i.image = document.createElement("img"),
  29120. i.image.setAttribute("src", "data:image/" + t + ";base64," + e),
  29121. a.minimalMemoryMode && (i.minFilter = o.LinearFilter,
  29122. i.magFilter = o.LinearFilter,
  29123. i.generateMipmaps = !1),
  29124. i.needsUpdate = !0,
  29125. i
  29126. },
  29127. isLoaded: function(e) {
  29128. return !!s[e]
  29129. }
  29130. }
  29131. window.Texture = t.exports
  29132. }
  29133. , {
  29134. "../settings": 166,
  29135. "../util/ajax": 181,
  29136. three: 217
  29137. }],
  29138. 195: [function(e, t, i) {
  29139. "use strict";
  29140. var l = e("./easing");
  29141. t.exports = {
  29142. globalDone: null,
  29143. funcs: [],
  29144. counter: 0,
  29145. uniqueID: 0,
  29146. start: function(e, t, i, n, r, o, a) {
  29147. return n = n || 0,
  29148. this.funcs.push({
  29149. func: e,
  29150. current: -n * Math.abs(t),
  29151. duration: (1 - Math.max(n, 0)) * Math.abs(t),
  29152. done: i,
  29153. easing: r || l.linearTween,
  29154. cycling: t < 0,
  29155. running: !0,
  29156. debug: n < 0,
  29157. name: o || "T" + this.counter,
  29158. id: void 0 === a ? this.counter : a,
  29159. paused: !1
  29160. }),
  29161. e(0, 16),
  29162. this.counter += 1,
  29163. e
  29164. },
  29165. trigger: function(e) {
  29166. var t = void 0 === e.delayRatio ? 0 : e.delayRatio
  29167. , i = e.func || function() {}
  29168. , n = void 0 === e.duration ? 0 : e.duration;
  29169. void 0 !== e.cycling && e.cycling && (n = -Math.abs(n));
  29170. var r = e.done || null
  29171. , o = e.easing || l.linearTween
  29172. , a = e.name || "R" + this.counter
  29173. , s = void 0 === e.id ? this.counter : e.id;
  29174. return this.start(i, n, r, t, o, a, s)
  29175. },
  29176. setTimeout: function(e, t, i) {
  29177. var n = void 0 === i ? this.counter : i;
  29178. return this.trigger({
  29179. done: e,
  29180. duration: void 0 === t ? 0 : t,
  29181. name: "O" + this.counter,
  29182. id: n
  29183. })
  29184. },
  29185. pause: function() {
  29186. this.paused = !0
  29187. },
  29188. resume: function() {
  29189. this.paused = !1
  29190. },
  29191. update: function(n) {
  29192. this.funcs.forEach(function(e) {
  29193. if (!(e.paused || (e.current += 1e3 * n,
  29194. e.current < 0)))
  29195. if (e.current >= e.duration && !e.cycling) {
  29196. var t = e.easing(1, 0, 1, 1);
  29197. e.func(t, 1e3 * n),
  29198. e.done && e.done(),
  29199. e.running = !1
  29200. } else {
  29201. var i = e.easing(e.current % e.duration / e.duration, 0, 1, 1);
  29202. (e.func(i, 1e3 * n) || !1) && (e.done && e.done(),
  29203. e.running = !1)
  29204. }
  29205. });
  29206. var e = this.funcs.length;
  29207. this.funcs = this.funcs.filter(function(e) {
  29208. return e.running
  29209. });
  29210. var t = this.funcs.length;
  29211. if (0 < e && 0 === t && this.globalDone) {
  29212. var i = this.globalDone;
  29213. this.globalDone = null,
  29214. i()
  29215. }
  29216. },
  29217. adjustSpeed: function(e, t) {
  29218. for (var i = this.getById(e), n = 0; n < i.length; n++) {
  29219. var r = i[n];
  29220. r.duration /= t,
  29221. r.current /= t
  29222. }
  29223. },
  29224. getById: function(t) {
  29225. return this.funcs.filter(function(e) {
  29226. return t === e.id
  29227. })
  29228. },
  29229. get: function(e) {
  29230. for (var t = 0; t < this.funcs.length; t += 1)
  29231. if (this.funcs[t].func === e)
  29232. return this.funcs[t];
  29233. return null
  29234. },
  29235. isRunning: function(e) {
  29236. var t = this.get(e);
  29237. return null !== t && t.running
  29238. },
  29239. countActive: function() {
  29240. for (var e = 0, t = 0; t < this.funcs.length; t += 1)
  29241. e += this.funcs[t].running;
  29242. return e
  29243. },
  29244. listActive: function() {
  29245. for (var e = [], t = 0; t < this.funcs.length; t += 1)
  29246. this.funcs[t].running && e.push(this.funcs[t].name);
  29247. return e
  29248. },
  29249. done: function(e) {
  29250. this.globalDone = e
  29251. },
  29252. cancelById: function(e) {
  29253. var t = void 0 === e ? 0 : e;
  29254. this.funcs = this.funcs.filter(function(e) {
  29255. return e.id !== t
  29256. })
  29257. },
  29258. cancel: function(t) {
  29259. this.funcs = this.funcs.filter(function(e) {
  29260. return e.func !== t
  29261. })
  29262. },
  29263. getUniqueId: function() {
  29264. return this.uniqueID -= 1,
  29265. this.uniqueID
  29266. }
  29267. }
  29268. }
  29269. , {
  29270. "./easing": 186
  29271. }],
  29272. 196: [function(e, t, i) {
  29273. function n(e) {
  29274. if (this.set = {},
  29275. this.infContains = function() {
  29276. return !0
  29277. }
  29278. ,
  29279. "object" == typeof e)
  29280. if (e instanceof Array)
  29281. for (var t = 0; t < e.length; t++)
  29282. this.set[e[t]] = !0;
  29283. else
  29284. this.set = e;
  29285. else if ("function" == typeof e)
  29286. this.infContains = e;
  29287. else if (void 0 !== e)
  29288. throw new Error("set must be either an array or an object.")
  29289. }
  29290. (t.exports = n).prototype.has = n.prototype.contains = function(e) {
  29291. return !!this.set[e]
  29292. }
  29293. ,
  29294. n.prototype.add = function(e) {
  29295. if (1 == arguments.length)
  29296. this.set[e] = !0;
  29297. else
  29298. for (var t = 0; t < arguments.length; t++)
  29299. this.set[arguments[t]] = !0
  29300. }
  29301. ,
  29302. n.prototype.addAll = function(e) {
  29303. if ("object" != typeof e && !(e instanceof Array))
  29304. throw new Error("arr must be an array.");
  29305. for (var t = 0; t < e.length; t++)
  29306. this.add(e[t])
  29307. }
  29308. ,
  29309. n.prototype.delete = n.prototype.remove = function(e) {
  29310. if (1 == arguments.length)
  29311. delete this.set[e];
  29312. else
  29313. for (var t = 0; t < arguments.length; t++)
  29314. delete this.set[arguments[t]]
  29315. }
  29316. ,
  29317. n.prototype.clear = function() {
  29318. this.set = {}
  29319. }
  29320. ,
  29321. n.prototype.size = function() {
  29322. return Object.keys(this.set).length
  29323. }
  29324. ,
  29325. n.prototype.toString = function() {
  29326. return "{" + Object.keys(this.set).toString() + "}"
  29327. }
  29328. ,
  29329. n.prototype["*values"] = n.prototype.toArray = function() {
  29330. return void 0 === this.set ? [] : Object.keys(this.set)
  29331. }
  29332. }
  29333. , {}],
  29334. 197: [function(e, t, i) {}
  29335. , {}],
  29336. 198: [function(N, e, F) {
  29337. (function(e) {
  29338. "use strict";
  29339. function i() {
  29340. return u.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823
  29341. }
  29342. function o(e, t) {
  29343. if (i() < t)
  29344. throw new RangeError("Invalid typed array length");
  29345. return u.TYPED_ARRAY_SUPPORT ? (e = new Uint8Array(t)).__proto__ = u.prototype : (null === e && (e = new u(t)),
  29346. e.length = t),
  29347. e
  29348. }
  29349. function u(e, t, i) {
  29350. if (!(u.TYPED_ARRAY_SUPPORT || this instanceof u))
  29351. return new u(e,t,i);
  29352. if ("number" != typeof e)
  29353. return n(this, e, t, i);
  29354. if ("string" == typeof t)
  29355. throw new Error("If encoding is specified then the first argument must be a string");
  29356. return a(this, e)
  29357. }
  29358. function n(e, t, i, n) {
  29359. if ("number" == typeof t)
  29360. throw new TypeError('"value" argument must not be a number');
  29361. return "undefined" != typeof ArrayBuffer && t instanceof ArrayBuffer ? function(e, t, i, n) {
  29362. if (t.byteLength,
  29363. i < 0 || t.byteLength < i)
  29364. throw new RangeError("'offset' is out of bounds");
  29365. if (t.byteLength < i + (n || 0))
  29366. throw new RangeError("'length' is out of bounds");
  29367. return t = void 0 === i && void 0 === n ? new Uint8Array(t) : void 0 === n ? new Uint8Array(t,i) : new Uint8Array(t,i,n),
  29368. u.TYPED_ARRAY_SUPPORT ? (e = t).__proto__ = u.prototype : e = s(e, t),
  29369. e
  29370. }(e, t, i, n) : "string" == typeof t ? function(e, t, i) {
  29371. if ("string" == typeof i && "" !== i || (i = "utf8"),
  29372. !u.isEncoding(i))
  29373. throw new TypeError('"encoding" must be a valid string encoding');
  29374. var n = 0 | c(t, i)
  29375. , r = (e = o(e, n)).write(t, i);
  29376. return r !== n && (e = e.slice(0, r)),
  29377. e
  29378. }(e, t, i) : function(e, t) {
  29379. if (u.isBuffer(t)) {
  29380. var i = 0 | l(t.length);
  29381. return 0 === (e = o(e, i)).length || t.copy(e, 0, 0, i),
  29382. e
  29383. }
  29384. if (t) {
  29385. if ("undefined" != typeof ArrayBuffer && t.buffer instanceof ArrayBuffer || "length"in t)
  29386. return "number" != typeof t.length || function(e) {
  29387. return e != e
  29388. }(t.length) ? o(e, 0) : s(e, t);
  29389. if ("Buffer" === t.type && L(t.data))
  29390. return s(e, t.data)
  29391. }
  29392. throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")
  29393. }(e, t)
  29394. }
  29395. function r(e) {
  29396. if ("number" != typeof e)
  29397. throw new TypeError('"size" argument must be a number');
  29398. if (e < 0)
  29399. throw new RangeError('"size" argument must not be negative')
  29400. }
  29401. function a(e, t) {
  29402. if (r(t),
  29403. e = o(e, t < 0 ? 0 : 0 | l(t)),
  29404. !u.TYPED_ARRAY_SUPPORT)
  29405. for (var i = 0; i < t; ++i)
  29406. e[i] = 0;
  29407. return e
  29408. }
  29409. function s(e, t) {
  29410. var i = t.length < 0 ? 0 : 0 | l(t.length);
  29411. e = o(e, i);
  29412. for (var n = 0; n < i; n += 1)
  29413. e[n] = 255 & t[n];
  29414. return e
  29415. }
  29416. function l(e) {
  29417. if (e >= i())
  29418. throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + i().toString(16) + " bytes");
  29419. return 0 | e
  29420. }
  29421. function c(e, t) {
  29422. if (u.isBuffer(e))
  29423. return e.length;
  29424. if ("undefined" != typeof ArrayBuffer && "function" == typeof ArrayBuffer.isView && (ArrayBuffer.isView(e) || e instanceof ArrayBuffer))
  29425. return e.byteLength;
  29426. "string" != typeof e && (e = "" + e);
  29427. var i = e.length;
  29428. if (0 === i)
  29429. return 0;
  29430. for (var n = !1; ; )
  29431. switch (t) {
  29432. case "ascii":
  29433. case "latin1":
  29434. case "binary":
  29435. return i;
  29436. case "utf8":
  29437. case "utf-8":
  29438. case void 0:
  29439. return S(e).length;
  29440. case "ucs2":
  29441. case "ucs-2":
  29442. case "utf16le":
  29443. case "utf-16le":
  29444. return 2 * i;
  29445. case "hex":
  29446. return i >>> 1;
  29447. case "base64":
  29448. return M(e).length;
  29449. default:
  29450. if (n)
  29451. return S(e).length;
  29452. t = ("" + t).toLowerCase(),
  29453. n = !0
  29454. }
  29455. }
  29456. function h(e, t, i) {
  29457. var n = e[t];
  29458. e[t] = e[i],
  29459. e[i] = n
  29460. }
  29461. function d(e, t, i, n, r) {
  29462. if (0 === e.length)
  29463. return -1;
  29464. if ("string" == typeof i ? (n = i,
  29465. i = 0) : 2147483647 < i ? i = 2147483647 : i < -2147483648 && (i = -2147483648),
  29466. i = +i,
  29467. isNaN(i) && (i = r ? 0 : e.length - 1),
  29468. i < 0 && (i = e.length + i),
  29469. i >= e.length) {
  29470. if (r)
  29471. return -1;
  29472. i = e.length - 1
  29473. } else if (i < 0) {
  29474. if (!r)
  29475. return -1;
  29476. i = 0
  29477. }
  29478. if ("string" == typeof t && (t = u.from(t, n)),
  29479. u.isBuffer(t))
  29480. return 0 === t.length ? -1 : p(e, t, i, n, r);
  29481. if ("number" == typeof t)
  29482. return t &= 255,
  29483. 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);
  29484. throw new TypeError("val must be string, number or Buffer")
  29485. }
  29486. function p(e, t, i, n, r) {
  29487. function o(e, t) {
  29488. return 1 === s ? e[t] : e.readUInt16BE(t * s)
  29489. }
  29490. var a, s = 1, l = e.length, c = t.length;
  29491. if (void 0 !== n && ("ucs2" === (n = String(n).toLowerCase()) || "ucs-2" === n || "utf16le" === n || "utf-16le" === n)) {
  29492. if (e.length < 2 || t.length < 2)
  29493. return -1;
  29494. l /= s = 2,
  29495. c /= 2,
  29496. i /= 2
  29497. }
  29498. if (r) {
  29499. var h = -1;
  29500. for (a = i; a < l; a++)
  29501. if (o(e, a) === o(t, -1 === h ? 0 : a - h)) {
  29502. if (-1 === h && (h = a),
  29503. a - h + 1 === c)
  29504. return h * s
  29505. } else
  29506. -1 !== h && (a -= a - h),
  29507. h = -1
  29508. } else
  29509. for (l < i + c && (i = l - c),
  29510. a = i; 0 <= a; a--) {
  29511. for (var u = !0, d = 0; d < c; d++)
  29512. if (o(e, a + d) !== o(t, d)) {
  29513. u = !1;
  29514. break
  29515. }
  29516. if (u)
  29517. return a
  29518. }
  29519. return -1
  29520. }
  29521. function g(e, t, i, n) {
  29522. i = Number(i) || 0;
  29523. var r = e.length - i;
  29524. n ? r < (n = Number(n)) && (n = r) : n = r;
  29525. var o = t.length;
  29526. if (o % 2 != 0)
  29527. throw new TypeError("Invalid hex string");
  29528. o / 2 < n && (n = o / 2);
  29529. for (var a = 0; a < n; ++a) {
  29530. var s = parseInt(t.substr(2 * a, 2), 16);
  29531. if (isNaN(s))
  29532. return a;
  29533. e[i + a] = s
  29534. }
  29535. return a
  29536. }
  29537. function m(e, t, i, n) {
  29538. return R(function(e) {
  29539. for (var t = [], i = 0; i < e.length; ++i)
  29540. t.push(255 & e.charCodeAt(i));
  29541. return t
  29542. }(t), e, i, n)
  29543. }
  29544. function f(e, t, i) {
  29545. i = Math.min(e.length, i);
  29546. for (var n = [], r = t; r < i; ) {
  29547. var o, a, s, l, c = e[r], h = null, u = 239 < c ? 4 : 223 < c ? 3 : 191 < c ? 2 : 1;
  29548. if (r + u <= i)
  29549. switch (u) {
  29550. case 1:
  29551. c < 128 && (h = c);
  29552. break;
  29553. case 2:
  29554. 128 == (192 & (o = e[r + 1])) && (127 < (l = (31 & c) << 6 | 63 & o) && (h = l));
  29555. break;
  29556. case 3:
  29557. o = e[r + 1],
  29558. a = e[r + 2],
  29559. 128 == (192 & o) && 128 == (192 & a) && (2047 < (l = (15 & c) << 12 | (63 & o) << 6 | 63 & a) && (l < 55296 || 57343 < l) && (h = l));
  29560. break;
  29561. case 4:
  29562. o = e[r + 1],
  29563. a = e[r + 2],
  29564. s = e[r + 3],
  29565. 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))
  29566. }
  29567. null === h ? (h = 65533,
  29568. u = 1) : 65535 < h && (h -= 65536,
  29569. n.push(h >>> 10 & 1023 | 55296),
  29570. h = 56320 | 1023 & h),
  29571. n.push(h),
  29572. r += u
  29573. }
  29574. return function(e) {
  29575. var t = e.length;
  29576. if (t <= D)
  29577. return String.fromCharCode.apply(String, e);
  29578. for (var i = "", n = 0; n < t; )
  29579. i += String.fromCharCode.apply(String, e.slice(n, n += D));
  29580. return i
  29581. }(n)
  29582. }
  29583. function v(e, t, i) {
  29584. var n = "";
  29585. i = Math.min(e.length, i);
  29586. for (var r = t; r < i; ++r)
  29587. n += String.fromCharCode(127 & e[r]);
  29588. return n
  29589. }
  29590. function y(e, t, i) {
  29591. var n = "";
  29592. i = Math.min(e.length, i);
  29593. for (var r = t; r < i; ++r)
  29594. n += String.fromCharCode(e[r]);
  29595. return n
  29596. }
  29597. function A(e, t, i) {
  29598. var n, r = e.length;
  29599. (!t || t < 0) && (t = 0),
  29600. (!i || i < 0 || r < i) && (i = r);
  29601. for (var o = "", a = t; a < i; ++a)
  29602. o += (n = e[a]) < 16 ? "0" + n.toString(16) : n.toString(16);
  29603. return o
  29604. }
  29605. function C(e, t, i) {
  29606. for (var n = e.slice(t, i), r = "", o = 0; o < n.length; o += 2)
  29607. r += String.fromCharCode(n[o] + 256 * n[o + 1]);
  29608. return r
  29609. }
  29610. function I(e, t, i) {
  29611. if (e % 1 != 0 || e < 0)
  29612. throw new RangeError("offset is not uint");
  29613. if (i < e + t)
  29614. throw new RangeError("Trying to access beyond buffer length")
  29615. }
  29616. function E(e, t, i, n, r, o) {
  29617. if (!u.isBuffer(e))
  29618. throw new TypeError('"buffer" argument must be a Buffer instance');
  29619. if (r < t || t < o)
  29620. throw new RangeError('"value" argument is out of bounds');
  29621. if (i + n > e.length)
  29622. throw new RangeError("Index out of range")
  29623. }
  29624. function _(e, t, i, n) {
  29625. t < 0 && (t = 65535 + t + 1);
  29626. for (var r = 0, o = Math.min(e.length - i, 2); r < o; ++r)
  29627. e[i + r] = (t & 255 << 8 * (n ? r : 1 - r)) >>> 8 * (n ? r : 1 - r)
  29628. }
  29629. function b(e, t, i, n) {
  29630. t < 0 && (t = 4294967295 + t + 1);
  29631. for (var r = 0, o = Math.min(e.length - i, 4); r < o; ++r)
  29632. e[i + r] = t >>> 8 * (n ? r : 3 - r) & 255
  29633. }
  29634. function w(e, t, i, n) {
  29635. if (i + n > e.length)
  29636. throw new RangeError("Index out of range");
  29637. if (i < 0)
  29638. throw new RangeError("Index out of range")
  29639. }
  29640. function T(e, t, i, n, r) {
  29641. return r || w(e, 0, i, 4),
  29642. O.write(e, t, i, n, 23, 4),
  29643. i + 4
  29644. }
  29645. function x(e, t, i, n, r) {
  29646. return r || w(e, 0, i, 8),
  29647. O.write(e, t, i, n, 52, 8),
  29648. i + 8
  29649. }
  29650. function S(e, t) {
  29651. t = t || 1 / 0;
  29652. for (var i, n = e.length, r = null, o = [], a = 0; a < n; ++a) {
  29653. if (55295 < (i = e.charCodeAt(a)) && i < 57344) {
  29654. if (!r) {
  29655. if (56319 < i) {
  29656. -1 < (t -= 3) && o.push(239, 191, 189);
  29657. continue
  29658. }
  29659. if (a + 1 === n) {
  29660. -1 < (t -= 3) && o.push(239, 191, 189);
  29661. continue
  29662. }
  29663. r = i;
  29664. continue
  29665. }
  29666. if (i < 56320) {
  29667. -1 < (t -= 3) && o.push(239, 191, 189),
  29668. r = i;
  29669. continue
  29670. }
  29671. i = 65536 + (r - 55296 << 10 | i - 56320)
  29672. } else
  29673. r && -1 < (t -= 3) && o.push(239, 191, 189);
  29674. if (r = null,
  29675. i < 128) {
  29676. if ((t -= 1) < 0)
  29677. break;
  29678. o.push(i)
  29679. } else if (i < 2048) {
  29680. if ((t -= 2) < 0)
  29681. break;
  29682. o.push(i >> 6 | 192, 63 & i | 128)
  29683. } else if (i < 65536) {
  29684. if ((t -= 3) < 0)
  29685. break;
  29686. o.push(i >> 12 | 224, i >> 6 & 63 | 128, 63 & i | 128)
  29687. } else {
  29688. if (!(i < 1114112))
  29689. throw new Error("Invalid code point");
  29690. if ((t -= 4) < 0)
  29691. break;
  29692. o.push(i >> 18 | 240, i >> 12 & 63 | 128, i >> 6 & 63 | 128, 63 & i | 128)
  29693. }
  29694. }
  29695. return o
  29696. }
  29697. function M(e) {
  29698. return P.toByteArray(function(e) {
  29699. if ((e = function(e) {
  29700. return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, "")
  29701. }(e).replace(t, "")).length < 2)
  29702. return "";
  29703. for (; e.length % 4 != 0; )
  29704. e += "=";
  29705. return e
  29706. }(e))
  29707. }
  29708. function R(e, t, i, n) {
  29709. for (var r = 0; r < n && !(r + i >= t.length || r >= e.length); ++r)
  29710. t[r + i] = e[r];
  29711. return r
  29712. }
  29713. var P = N("base64-js")
  29714. , O = N("ieee754")
  29715. , L = N("isarray");
  29716. F.Buffer = u,
  29717. F.SlowBuffer = function(e) {
  29718. return +e != e && (e = 0),
  29719. u.alloc(+e)
  29720. }
  29721. ,
  29722. F.INSPECT_MAX_BYTES = 50,
  29723. u.TYPED_ARRAY_SUPPORT = void 0 !== e.TYPED_ARRAY_SUPPORT ? e.TYPED_ARRAY_SUPPORT : function() {
  29724. try {
  29725. var e = new Uint8Array(1);
  29726. return e.__proto__ = {
  29727. __proto__: Uint8Array.prototype,
  29728. foo: function() {
  29729. return 42
  29730. }
  29731. },
  29732. 42 === e.foo() && "function" == typeof e.subarray && 0 === e.subarray(1, 1).byteLength
  29733. } catch (e) {
  29734. return !1
  29735. }
  29736. }(),
  29737. F.kMaxLength = i(),
  29738. u.poolSize = 8192,
  29739. u._augment = function(e) {
  29740. return e.__proto__ = u.prototype,
  29741. e
  29742. }
  29743. ,
  29744. u.from = function(e, t, i) {
  29745. return n(null, e, t, i)
  29746. }
  29747. ,
  29748. u.TYPED_ARRAY_SUPPORT && (u.prototype.__proto__ = Uint8Array.prototype,
  29749. u.__proto__ = Uint8Array,
  29750. "undefined" != typeof Symbol && Symbol.species && u[Symbol.species] === u && Object.defineProperty(u, Symbol.species, {
  29751. value: null,
  29752. configurable: !0
  29753. })),
  29754. u.alloc = function(e, t, i) {
  29755. return function(e, t, i, n) {
  29756. return r(t),
  29757. 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)
  29758. }(null, e, t, i)
  29759. }
  29760. ,
  29761. u.allocUnsafe = function(e) {
  29762. return a(null, e)
  29763. }
  29764. ,
  29765. u.allocUnsafeSlow = function(e) {
  29766. return a(null, e)
  29767. }
  29768. ,
  29769. u.isBuffer = function(e) {
  29770. return !(null == e || !e._isBuffer)
  29771. }
  29772. ,
  29773. u.compare = function(e, t) {
  29774. if (!u.isBuffer(e) || !u.isBuffer(t))
  29775. throw new TypeError("Arguments must be Buffers");
  29776. if (e === t)
  29777. return 0;
  29778. for (var i = e.length, n = t.length, r = 0, o = Math.min(i, n); r < o; ++r)
  29779. if (e[r] !== t[r]) {
  29780. i = e[r],
  29781. n = t[r];
  29782. break
  29783. }
  29784. return i < n ? -1 : n < i ? 1 : 0
  29785. }
  29786. ,
  29787. u.isEncoding = function(e) {
  29788. switch (String(e).toLowerCase()) {
  29789. case "hex":
  29790. case "utf8":
  29791. case "utf-8":
  29792. case "ascii":
  29793. case "latin1":
  29794. case "binary":
  29795. case "base64":
  29796. case "ucs2":
  29797. case "ucs-2":
  29798. case "utf16le":
  29799. case "utf-16le":
  29800. return !0;
  29801. default:
  29802. return !1
  29803. }
  29804. }
  29805. ,
  29806. u.concat = function(e, t) {
  29807. if (!L(e))
  29808. throw new TypeError('"list" argument must be an Array of Buffers');
  29809. if (0 === e.length)
  29810. return u.alloc(0);
  29811. var i;
  29812. if (void 0 === t)
  29813. for (i = t = 0; i < e.length; ++i)
  29814. t += e[i].length;
  29815. var n = u.allocUnsafe(t)
  29816. , r = 0;
  29817. for (i = 0; i < e.length; ++i) {
  29818. var o = e[i];
  29819. if (!u.isBuffer(o))
  29820. throw new TypeError('"list" argument must be an Array of Buffers');
  29821. o.copy(n, r),
  29822. r += o.length
  29823. }
  29824. return n
  29825. }
  29826. ,
  29827. u.byteLength = c,
  29828. u.prototype._isBuffer = !0,
  29829. u.prototype.swap16 = function() {
  29830. var e = this.length;
  29831. if (e % 2 != 0)
  29832. throw new RangeError("Buffer size must be a multiple of 16-bits");
  29833. for (var t = 0; t < e; t += 2)
  29834. h(this, t, t + 1);
  29835. return this
  29836. }
  29837. ,
  29838. u.prototype.swap32 = function() {
  29839. var e = this.length;
  29840. if (e % 4 != 0)
  29841. throw new RangeError("Buffer size must be a multiple of 32-bits");
  29842. for (var t = 0; t < e; t += 4)
  29843. h(this, t, t + 3),
  29844. h(this, t + 1, t + 2);
  29845. return this
  29846. }
  29847. ,
  29848. u.prototype.swap64 = function() {
  29849. var e = this.length;
  29850. if (e % 8 != 0)
  29851. throw new RangeError("Buffer size must be a multiple of 64-bits");
  29852. for (var t = 0; t < e; t += 8)
  29853. h(this, t, t + 7),
  29854. h(this, t + 1, t + 6),
  29855. h(this, t + 2, t + 5),
  29856. h(this, t + 3, t + 4);
  29857. return this
  29858. }
  29859. ,
  29860. u.prototype.toString = function() {
  29861. var e = 0 | this.length;
  29862. return 0 == e ? "" : 0 === arguments.length ? f(this, 0, e) : function(e, t, i) {
  29863. var n, r, o, a = !1;
  29864. if ((void 0 === t || t < 0) && (t = 0),
  29865. t > this.length)
  29866. return "";
  29867. if ((void 0 === i || i > this.length) && (i = this.length),
  29868. i <= 0)
  29869. return "";
  29870. if ((i >>>= 0) <= (t >>>= 0))
  29871. return "";
  29872. for (e = e || "utf8"; ; )
  29873. switch (e) {
  29874. case "hex":
  29875. return A(this, t, i);
  29876. case "utf8":
  29877. case "utf-8":
  29878. return f(this, t, i);
  29879. case "ascii":
  29880. return v(this, t, i);
  29881. case "latin1":
  29882. case "binary":
  29883. return y(this, t, i);
  29884. case "base64":
  29885. return n = this,
  29886. o = i,
  29887. 0 === (r = t) && o === n.length ? P.fromByteArray(n) : P.fromByteArray(n.slice(r, o));
  29888. case "ucs2":
  29889. case "ucs-2":
  29890. case "utf16le":
  29891. case "utf-16le":
  29892. return C(this, t, i);
  29893. default:
  29894. if (a)
  29895. throw new TypeError("Unknown encoding: " + e);
  29896. e = (e + "").toLowerCase(),
  29897. a = !0
  29898. }
  29899. }
  29900. .apply(this, arguments)
  29901. }
  29902. ,
  29903. u.prototype.equals = function(e) {
  29904. if (!u.isBuffer(e))
  29905. throw new TypeError("Argument must be a Buffer");
  29906. return this === e || 0 === u.compare(this, e)
  29907. }
  29908. ,
  29909. u.prototype.inspect = function() {
  29910. var e = ""
  29911. , t = F.INSPECT_MAX_BYTES;
  29912. return 0 < this.length && (e = this.toString("hex", 0, t).match(/.{2}/g).join(" "),
  29913. this.length > t && (e += " ... ")),
  29914. "<Buffer " + e + ">"
  29915. }
  29916. ,
  29917. u.prototype.compare = function(e, t, i, n, r) {
  29918. if (!u.isBuffer(e))
  29919. throw new TypeError("Argument must be a Buffer");
  29920. if (void 0 === t && (t = 0),
  29921. void 0 === i && (i = e ? e.length : 0),
  29922. void 0 === n && (n = 0),
  29923. void 0 === r && (r = this.length),
  29924. t < 0 || i > e.length || n < 0 || r > this.length)
  29925. throw new RangeError("out of range index");
  29926. if (r <= n && i <= t)
  29927. return 0;
  29928. if (r <= n)
  29929. return -1;
  29930. if (i <= t)
  29931. return 1;
  29932. if (this === e)
  29933. return 0;
  29934. 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)
  29935. if (l[h] !== c[h]) {
  29936. o = l[h],
  29937. a = c[h];
  29938. break
  29939. }
  29940. return o < a ? -1 : a < o ? 1 : 0
  29941. }
  29942. ,
  29943. u.prototype.includes = function(e, t, i) {
  29944. return -1 !== this.indexOf(e, t, i)
  29945. }
  29946. ,
  29947. u.prototype.indexOf = function(e, t, i) {
  29948. return d(this, e, t, i, !0)
  29949. }
  29950. ,
  29951. u.prototype.lastIndexOf = function(e, t, i) {
  29952. return d(this, e, t, i, !1)
  29953. }
  29954. ,
  29955. u.prototype.write = function(e, t, i, n) {
  29956. if (void 0 === t)
  29957. n = "utf8",
  29958. i = this.length,
  29959. t = 0;
  29960. else if (void 0 === i && "string" == typeof t)
  29961. n = t,
  29962. i = this.length,
  29963. t = 0;
  29964. else {
  29965. if (!isFinite(t))
  29966. throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
  29967. t |= 0,
  29968. isFinite(i) ? (i |= 0,
  29969. void 0 === n && (n = "utf8")) : (n = i,
  29970. i = void 0)
  29971. }
  29972. var r, o, a, s, l, c, h, u, d, p = this.length - t;
  29973. if ((void 0 === i || p < i) && (i = p),
  29974. 0 < e.length && (i < 0 || t < 0) || t > this.length)
  29975. throw new RangeError("Attempt to write outside buffer bounds");
  29976. n = n || "utf8";
  29977. for (var f = !1; ; )
  29978. switch (n) {
  29979. case "hex":
  29980. return g(this, e, t, i);
  29981. case "utf8":
  29982. case "utf-8":
  29983. return u = t,
  29984. d = i,
  29985. R(S(e, (h = this).length - u), h, u, d);
  29986. case "ascii":
  29987. return m(this, e, t, i);
  29988. case "latin1":
  29989. case "binary":
  29990. return m(this, e, t, i);
  29991. case "base64":
  29992. return s = this,
  29993. l = t,
  29994. c = i,
  29995. R(M(e), s, l, c);
  29996. case "ucs2":
  29997. case "ucs-2":
  29998. case "utf16le":
  29999. case "utf-16le":
  30000. return o = t,
  30001. a = i,
  30002. R(function(e, t) {
  30003. for (var i, n, r, o = [], a = 0; a < e.length && !((t -= 2) < 0); ++a)
  30004. i = e.charCodeAt(a),
  30005. n = i >> 8,
  30006. r = i % 256,
  30007. o.push(r),
  30008. o.push(n);
  30009. return o
  30010. }(e, (r = this).length - o), r, o, a);
  30011. default:
  30012. if (f)
  30013. throw new TypeError("Unknown encoding: " + n);
  30014. n = ("" + n).toLowerCase(),
  30015. f = !0
  30016. }
  30017. }
  30018. ,
  30019. u.prototype.toJSON = function() {
  30020. return {
  30021. type: "Buffer",
  30022. data: Array.prototype.slice.call(this._arr || this, 0)
  30023. }
  30024. }
  30025. ;
  30026. var D = 4096;
  30027. u.prototype.slice = function(e, t) {
  30028. var i, n = this.length;
  30029. if ((e = ~~e) < 0 ? (e += n) < 0 && (e = 0) : n < e && (e = n),
  30030. (t = void 0 === t ? n : ~~t) < 0 ? (t += n) < 0 && (t = 0) : n < t && (t = n),
  30031. t < e && (t = e),
  30032. u.TYPED_ARRAY_SUPPORT)
  30033. (i = this.subarray(e, t)).__proto__ = u.prototype;
  30034. else {
  30035. var r = t - e;
  30036. i = new u(r,void 0);
  30037. for (var o = 0; o < r; ++o)
  30038. i[o] = this[o + e]
  30039. }
  30040. return i
  30041. }
  30042. ,
  30043. u.prototype.readUIntLE = function(e, t, i) {
  30044. e |= 0,
  30045. t |= 0,
  30046. i || I(e, t, this.length);
  30047. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  30048. n += this[e + o] * r;
  30049. return n
  30050. }
  30051. ,
  30052. u.prototype.readUIntBE = function(e, t, i) {
  30053. e |= 0,
  30054. t |= 0,
  30055. i || I(e, t, this.length);
  30056. for (var n = this[e + --t], r = 1; 0 < t && (r *= 256); )
  30057. n += this[e + --t] * r;
  30058. return n
  30059. }
  30060. ,
  30061. u.prototype.readUInt8 = function(e, t) {
  30062. return t || I(e, 1, this.length),
  30063. this[e]
  30064. }
  30065. ,
  30066. u.prototype.readUInt16LE = function(e, t) {
  30067. return t || I(e, 2, this.length),
  30068. this[e] | this[e + 1] << 8
  30069. }
  30070. ,
  30071. u.prototype.readUInt16BE = function(e, t) {
  30072. return t || I(e, 2, this.length),
  30073. this[e] << 8 | this[e + 1]
  30074. }
  30075. ,
  30076. u.prototype.readUInt32LE = function(e, t) {
  30077. return t || I(e, 4, this.length),
  30078. (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + 16777216 * this[e + 3]
  30079. }
  30080. ,
  30081. u.prototype.readUInt32BE = function(e, t) {
  30082. return t || I(e, 4, this.length),
  30083. 16777216 * this[e] + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3])
  30084. }
  30085. ,
  30086. u.prototype.readIntLE = function(e, t, i) {
  30087. e |= 0,
  30088. t |= 0,
  30089. i || I(e, t, this.length);
  30090. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  30091. n += this[e + o] * r;
  30092. return (r *= 128) <= n && (n -= Math.pow(2, 8 * t)),
  30093. n
  30094. }
  30095. ,
  30096. u.prototype.readIntBE = function(e, t, i) {
  30097. e |= 0,
  30098. t |= 0,
  30099. i || I(e, t, this.length);
  30100. for (var n = t, r = 1, o = this[e + --n]; 0 < n && (r *= 256); )
  30101. o += this[e + --n] * r;
  30102. return (r *= 128) <= o && (o -= Math.pow(2, 8 * t)),
  30103. o
  30104. }
  30105. ,
  30106. u.prototype.readInt8 = function(e, t) {
  30107. return t || I(e, 1, this.length),
  30108. 128 & this[e] ? -1 * (255 - this[e] + 1) : this[e]
  30109. }
  30110. ,
  30111. u.prototype.readInt16LE = function(e, t) {
  30112. t || I(e, 2, this.length);
  30113. var i = this[e] | this[e + 1] << 8;
  30114. return 32768 & i ? 4294901760 | i : i
  30115. }
  30116. ,
  30117. u.prototype.readInt16BE = function(e, t) {
  30118. t || I(e, 2, this.length);
  30119. var i = this[e + 1] | this[e] << 8;
  30120. return 32768 & i ? 4294901760 | i : i
  30121. }
  30122. ,
  30123. u.prototype.readInt32LE = function(e, t) {
  30124. return t || I(e, 4, this.length),
  30125. this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24
  30126. }
  30127. ,
  30128. u.prototype.readInt32BE = function(e, t) {
  30129. return t || I(e, 4, this.length),
  30130. this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]
  30131. }
  30132. ,
  30133. u.prototype.readFloatLE = function(e, t) {
  30134. return t || I(e, 4, this.length),
  30135. O.read(this, e, !0, 23, 4)
  30136. }
  30137. ,
  30138. u.prototype.readFloatBE = function(e, t) {
  30139. return t || I(e, 4, this.length),
  30140. O.read(this, e, !1, 23, 4)
  30141. }
  30142. ,
  30143. u.prototype.readDoubleLE = function(e, t) {
  30144. return t || I(e, 8, this.length),
  30145. O.read(this, e, !0, 52, 8)
  30146. }
  30147. ,
  30148. u.prototype.readDoubleBE = function(e, t) {
  30149. return t || I(e, 8, this.length),
  30150. O.read(this, e, !1, 52, 8)
  30151. }
  30152. ,
  30153. u.prototype.writeUIntLE = function(e, t, i, n) {
  30154. e = +e,
  30155. t |= 0,
  30156. i |= 0,
  30157. n || E(this, e, t, i, Math.pow(2, 8 * i) - 1, 0);
  30158. var r = 1
  30159. , o = 0;
  30160. for (this[t] = 255 & e; ++o < i && (r *= 256); )
  30161. this[t + o] = e / r & 255;
  30162. return t + i
  30163. }
  30164. ,
  30165. u.prototype.writeUIntBE = function(e, t, i, n) {
  30166. e = +e,
  30167. t |= 0,
  30168. i |= 0,
  30169. n || E(this, e, t, i, Math.pow(2, 8 * i) - 1, 0);
  30170. var r = i - 1
  30171. , o = 1;
  30172. for (this[t + r] = 255 & e; 0 <= --r && (o *= 256); )
  30173. this[t + r] = e / o & 255;
  30174. return t + i
  30175. }
  30176. ,
  30177. u.prototype.writeUInt8 = function(e, t, i) {
  30178. return e = +e,
  30179. t |= 0,
  30180. i || E(this, e, t, 1, 255, 0),
  30181. u.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  30182. this[t] = 255 & e,
  30183. t + 1
  30184. }
  30185. ,
  30186. u.prototype.writeUInt16LE = function(e, t, i) {
  30187. return e = +e,
  30188. t |= 0,
  30189. i || E(this, e, t, 2, 65535, 0),
  30190. u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30191. this[t + 1] = e >>> 8) : _(this, e, t, !0),
  30192. t + 2
  30193. }
  30194. ,
  30195. u.prototype.writeUInt16BE = function(e, t, i) {
  30196. return e = +e,
  30197. t |= 0,
  30198. i || E(this, e, t, 2, 65535, 0),
  30199. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  30200. this[t + 1] = 255 & e) : _(this, e, t, !1),
  30201. t + 2
  30202. }
  30203. ,
  30204. u.prototype.writeUInt32LE = function(e, t, i) {
  30205. return e = +e,
  30206. t |= 0,
  30207. i || E(this, e, t, 4, 4294967295, 0),
  30208. u.TYPED_ARRAY_SUPPORT ? (this[t + 3] = e >>> 24,
  30209. this[t + 2] = e >>> 16,
  30210. this[t + 1] = e >>> 8,
  30211. this[t] = 255 & e) : b(this, e, t, !0),
  30212. t + 4
  30213. }
  30214. ,
  30215. u.prototype.writeUInt32BE = function(e, t, i) {
  30216. return e = +e,
  30217. t |= 0,
  30218. i || E(this, e, t, 4, 4294967295, 0),
  30219. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  30220. this[t + 1] = e >>> 16,
  30221. this[t + 2] = e >>> 8,
  30222. this[t + 3] = 255 & e) : b(this, e, t, !1),
  30223. t + 4
  30224. }
  30225. ,
  30226. u.prototype.writeIntLE = function(e, t, i, n) {
  30227. if (e = +e,
  30228. t |= 0,
  30229. !n) {
  30230. var r = Math.pow(2, 8 * i - 1);
  30231. E(this, e, t, i, r - 1, -r)
  30232. }
  30233. var o = 0
  30234. , a = 1
  30235. , s = 0;
  30236. for (this[t] = 255 & e; ++o < i && (a *= 256); )
  30237. e < 0 && 0 === s && 0 !== this[t + o - 1] && (s = 1),
  30238. this[t + o] = (e / a >> 0) - s & 255;
  30239. return t + i
  30240. }
  30241. ,
  30242. u.prototype.writeIntBE = function(e, t, i, n) {
  30243. if (e = +e,
  30244. t |= 0,
  30245. !n) {
  30246. var r = Math.pow(2, 8 * i - 1);
  30247. E(this, e, t, i, r - 1, -r)
  30248. }
  30249. var o = i - 1
  30250. , a = 1
  30251. , s = 0;
  30252. for (this[t + o] = 255 & e; 0 <= --o && (a *= 256); )
  30253. e < 0 && 0 === s && 0 !== this[t + o + 1] && (s = 1),
  30254. this[t + o] = (e / a >> 0) - s & 255;
  30255. return t + i
  30256. }
  30257. ,
  30258. u.prototype.writeInt8 = function(e, t, i) {
  30259. return e = +e,
  30260. t |= 0,
  30261. i || E(this, e, t, 1, 127, -128),
  30262. u.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  30263. e < 0 && (e = 255 + e + 1),
  30264. this[t] = 255 & e,
  30265. t + 1
  30266. }
  30267. ,
  30268. u.prototype.writeInt16LE = function(e, t, i) {
  30269. return e = +e,
  30270. t |= 0,
  30271. i || E(this, e, t, 2, 32767, -32768),
  30272. u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30273. this[t + 1] = e >>> 8) : _(this, e, t, !0),
  30274. t + 2
  30275. }
  30276. ,
  30277. u.prototype.writeInt16BE = function(e, t, i) {
  30278. return e = +e,
  30279. t |= 0,
  30280. i || E(this, e, t, 2, 32767, -32768),
  30281. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  30282. this[t + 1] = 255 & e) : _(this, e, t, !1),
  30283. t + 2
  30284. }
  30285. ,
  30286. u.prototype.writeInt32LE = function(e, t, i) {
  30287. return e = +e,
  30288. t |= 0,
  30289. i || E(this, e, t, 4, 2147483647, -2147483648),
  30290. u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30291. this[t + 1] = e >>> 8,
  30292. this[t + 2] = e >>> 16,
  30293. this[t + 3] = e >>> 24) : b(this, e, t, !0),
  30294. t + 4
  30295. }
  30296. ,
  30297. u.prototype.writeInt32BE = function(e, t, i) {
  30298. return e = +e,
  30299. t |= 0,
  30300. i || E(this, e, t, 4, 2147483647, -2147483648),
  30301. e < 0 && (e = 4294967295 + e + 1),
  30302. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  30303. this[t + 1] = e >>> 16,
  30304. this[t + 2] = e >>> 8,
  30305. this[t + 3] = 255 & e) : b(this, e, t, !1),
  30306. t + 4
  30307. }
  30308. ,
  30309. u.prototype.writeFloatLE = function(e, t, i) {
  30310. return T(this, e, t, !0, i)
  30311. }
  30312. ,
  30313. u.prototype.writeFloatBE = function(e, t, i) {
  30314. return T(this, e, t, !1, i)
  30315. }
  30316. ,
  30317. u.prototype.writeDoubleLE = function(e, t, i) {
  30318. return x(this, e, t, !0, i)
  30319. }
  30320. ,
  30321. u.prototype.writeDoubleBE = function(e, t, i) {
  30322. return x(this, e, t, !1, i)
  30323. }
  30324. ,
  30325. u.prototype.copy = function(e, t, i, n) {
  30326. if (i = i || 0,
  30327. n || 0 === n || (n = this.length),
  30328. t >= e.length && (t = e.length),
  30329. t = t || 0,
  30330. 0 < n && n < i && (n = i),
  30331. n === i)
  30332. return 0;
  30333. if (0 === e.length || 0 === this.length)
  30334. return 0;
  30335. if (t < 0)
  30336. throw new RangeError("targetStart out of bounds");
  30337. if (i < 0 || i >= this.length)
  30338. throw new RangeError("sourceStart out of bounds");
  30339. if (n < 0)
  30340. throw new RangeError("sourceEnd out of bounds");
  30341. n > this.length && (n = this.length),
  30342. e.length - t < n - i && (n = e.length - t + i);
  30343. var r, o = n - i;
  30344. if (this === e && i < t && t < n)
  30345. for (r = o - 1; 0 <= r; --r)
  30346. e[r + t] = this[r + i];
  30347. else if (o < 1e3 || !u.TYPED_ARRAY_SUPPORT)
  30348. for (r = 0; r < o; ++r)
  30349. e[r + t] = this[r + i];
  30350. else
  30351. Uint8Array.prototype.set.call(e, this.subarray(i, i + o), t);
  30352. return o
  30353. }
  30354. ,
  30355. u.prototype.fill = function(e, t, i, n) {
  30356. if ("string" == typeof e) {
  30357. if ("string" == typeof t ? (n = t,
  30358. t = 0,
  30359. i = this.length) : "string" == typeof i && (n = i,
  30360. i = this.length),
  30361. 1 === e.length) {
  30362. var r = e.charCodeAt(0);
  30363. r < 256 && (e = r)
  30364. }
  30365. if (void 0 !== n && "string" != typeof n)
  30366. throw new TypeError("encoding must be a string");
  30367. if ("string" == typeof n && !u.isEncoding(n))
  30368. throw new TypeError("Unknown encoding: " + n)
  30369. } else
  30370. "number" == typeof e && (e &= 255);
  30371. if (t < 0 || this.length < t || this.length < i)
  30372. throw new RangeError("Out of range index");
  30373. if (i <= t)
  30374. return this;
  30375. var o;
  30376. if (t >>>= 0,
  30377. i = void 0 === i ? this.length : i >>> 0,
  30378. "number" == typeof (e = e || 0))
  30379. for (o = t; o < i; ++o)
  30380. this[o] = e;
  30381. else {
  30382. var a = u.isBuffer(e) ? e : S(new u(e,n).toString())
  30383. , s = a.length;
  30384. for (o = 0; o < i - t; ++o)
  30385. this[o + t] = a[o % s]
  30386. }
  30387. return this
  30388. }
  30389. ;
  30390. var t = /[^+\/0-9A-Za-z-_]/g
  30391. }
  30392. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  30393. }
  30394. , {
  30395. "base64-js": 199,
  30396. ieee754: 200,
  30397. isarray: 201
  30398. }],
  30399. 199: [function(e, t, i) {
  30400. "use strict";
  30401. function l(e) {
  30402. var t = e.length;
  30403. if (0 < t % 4)
  30404. throw new Error("Invalid string. Length must be a multiple of 4");
  30405. return "=" === e[t - 2] ? 2 : "=" === e[t - 1] ? 1 : 0
  30406. }
  30407. function c(e, t, i) {
  30408. for (var n, r = [], o = t; o < i; o += 3)
  30409. n = (e[o] << 16) + (e[o + 1] << 8) + e[o + 2],
  30410. r.push(h[(a = n) >> 18 & 63] + h[a >> 12 & 63] + h[a >> 6 & 63] + h[63 & a]);
  30411. var a;
  30412. return r.join("")
  30413. }
  30414. i.byteLength = function(e) {
  30415. return 3 * e.length / 4 - l(e)
  30416. }
  30417. ,
  30418. i.toByteArray = function(e) {
  30419. var t, i, n, r, o, a = e.length;
  30420. r = l(e),
  30421. o = new d(3 * a / 4 - r),
  30422. i = 0 < r ? a - 4 : a;
  30423. var s = 0;
  30424. for (t = 0; t < i; t += 4,
  30425. 3)
  30426. n = u[e.charCodeAt(t)] << 18 | u[e.charCodeAt(t + 1)] << 12 | u[e.charCodeAt(t + 2)] << 6 | u[e.charCodeAt(t + 3)],
  30427. o[s++] = n >> 16 & 255,
  30428. o[s++] = n >> 8 & 255,
  30429. o[s++] = 255 & n;
  30430. return 2 === r ? (n = u[e.charCodeAt(t)] << 2 | u[e.charCodeAt(t + 1)] >> 4,
  30431. o[s++] = 255 & n) : 1 === r && (n = u[e.charCodeAt(t)] << 10 | u[e.charCodeAt(t + 1)] << 4 | u[e.charCodeAt(t + 2)] >> 2,
  30432. o[s++] = n >> 8 & 255,
  30433. o[s++] = 255 & n),
  30434. o
  30435. }
  30436. ,
  30437. i.fromByteArray = function(e) {
  30438. for (var t, i = e.length, n = i % 3, r = "", o = [], a = 0, s = i - n; a < s; a += 16383)
  30439. o.push(c(e, a, s < a + 16383 ? s : a + 16383));
  30440. return 1 == n ? (t = e[i - 1],
  30441. r += h[t >> 2],
  30442. r += h[t << 4 & 63],
  30443. r += "==") : 2 == n && (t = (e[i - 2] << 8) + e[i - 1],
  30444. r += h[t >> 10],
  30445. r += h[t >> 4 & 63],
  30446. r += h[t << 2 & 63],
  30447. r += "="),
  30448. o.push(r),
  30449. o.join("")
  30450. }
  30451. ;
  30452. for (var h = [], u = [], d = "undefined" != typeof Uint8Array ? Uint8Array : Array, n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", r = 0, o = n.length; r < o; ++r)
  30453. h[r] = n[r],
  30454. u[n.charCodeAt(r)] = r;
  30455. u["-".charCodeAt(0)] = 62,
  30456. u["_".charCodeAt(0)] = 63
  30457. }
  30458. , {}],
  30459. 200: [function(e, t, i) {
  30460. i.read = function(e, t, i, n, r) {
  30461. 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];
  30462. for (u += d,
  30463. o = p & (1 << -h) - 1,
  30464. p >>= -h,
  30465. h += s; 0 < h; o = 256 * o + e[t + u],
  30466. u += d,
  30467. h -= 8)
  30468. ;
  30469. for (a = o & (1 << -h) - 1,
  30470. o >>= -h,
  30471. h += n; 0 < h; a = 256 * a + e[t + u],
  30472. u += d,
  30473. h -= 8)
  30474. ;
  30475. if (0 === o)
  30476. o = 1 - c;
  30477. else {
  30478. if (o === l)
  30479. return a ? NaN : 1 / 0 * (p ? -1 : 1);
  30480. a += Math.pow(2, n),
  30481. o -= c
  30482. }
  30483. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  30484. }
  30485. ,
  30486. i.write = function(e, t, i, n, r, o) {
  30487. 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;
  30488. for (t = Math.abs(t),
  30489. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  30490. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  30491. t * (l = Math.pow(2, -a)) < 1 && (a--,
  30492. l *= 2),
  30493. 2 <= (t += 1 <= a + u ? d / l : d * Math.pow(2, 1 - u)) * l && (a++,
  30494. l /= 2),
  30495. h <= a + u ? (s = 0,
  30496. a = h) : 1 <= a + u ? (s = (t * l - 1) * Math.pow(2, r),
  30497. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  30498. a = 0)); 8 <= r; e[i + p] = 255 & s,
  30499. p += f,
  30500. s /= 256,
  30501. r -= 8)
  30502. ;
  30503. for (a = a << r | s,
  30504. c += r; 0 < c; e[i + p] = 255 & a,
  30505. p += f,
  30506. a /= 256,
  30507. c -= 8)
  30508. ;
  30509. e[i + p - f] |= 128 * g
  30510. }
  30511. }
  30512. , {}],
  30513. 201: [function(e, t, i) {
  30514. var n = {}.toString;
  30515. t.exports = Array.isArray || function(e) {
  30516. return "[object Array]" == n.call(e)
  30517. }
  30518. }
  30519. , {}],
  30520. 202: [function(e, t, i) {
  30521. function n() {
  30522. this._events = this._events || {},
  30523. this._maxListeners = this._maxListeners || void 0
  30524. }
  30525. function l(e) {
  30526. return "function" == typeof e
  30527. }
  30528. function c(e) {
  30529. return "object" == typeof e && null !== e
  30530. }
  30531. function h(e) {
  30532. return void 0 === e
  30533. }
  30534. ((t.exports = n).EventEmitter = n).prototype._events = void 0,
  30535. n.prototype._maxListeners = void 0,
  30536. n.defaultMaxListeners = 10,
  30537. n.prototype.setMaxListeners = function(e) {
  30538. if (!function(e) {
  30539. return "number" == typeof e
  30540. }(e) || e < 0 || isNaN(e))
  30541. throw TypeError("n must be a positive number");
  30542. return this._maxListeners = e,
  30543. this
  30544. }
  30545. ,
  30546. n.prototype.emit = function(e) {
  30547. var t, i, n, r, o, a;
  30548. if (this._events || (this._events = {}),
  30549. "error" === e && (!this._events.error || c(this._events.error) && !this._events.error.length)) {
  30550. if ((t = arguments[1])instanceof Error)
  30551. throw t;
  30552. var s = new Error('Uncaught, unspecified "error" event. (' + t + ")");
  30553. throw s.context = t,
  30554. s
  30555. }
  30556. if (h(i = this._events[e]))
  30557. return !1;
  30558. if (l(i))
  30559. switch (arguments.length) {
  30560. case 1:
  30561. i.call(this);
  30562. break;
  30563. case 2:
  30564. i.call(this, arguments[1]);
  30565. break;
  30566. case 3:
  30567. i.call(this, arguments[1], arguments[2]);
  30568. break;
  30569. default:
  30570. r = Array.prototype.slice.call(arguments, 1),
  30571. i.apply(this, r)
  30572. }
  30573. else if (c(i))
  30574. for (r = Array.prototype.slice.call(arguments, 1),
  30575. n = (a = i.slice()).length,
  30576. o = 0; o < n; o++)
  30577. a[o].apply(this, r);
  30578. return !0
  30579. }
  30580. ,
  30581. n.prototype.on = n.prototype.addListener = function(e, t) {
  30582. var i;
  30583. if (!l(t))
  30584. throw TypeError("listener must be a function");
  30585. return this._events || (this._events = {}),
  30586. this._events.newListener && this.emit("newListener", e, l(t.listener) ? t.listener : t),
  30587. this._events[e] ? c(this._events[e]) ? this._events[e].push(t) : this._events[e] = [this._events[e], t] : this._events[e] = t,
  30588. 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,
  30589. console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.", this._events[e].length),
  30590. "function" == typeof console.trace && console.trace())),
  30591. this
  30592. }
  30593. ,
  30594. n.prototype.once = function(e, t) {
  30595. function i() {
  30596. this.removeListener(e, i),
  30597. n || (n = !0,
  30598. t.apply(this, arguments))
  30599. }
  30600. if (!l(t))
  30601. throw TypeError("listener must be a function");
  30602. var n = !1;
  30603. return i.listener = t,
  30604. this.on(e, i),
  30605. this
  30606. }
  30607. ,
  30608. n.prototype.removeListener = function(e, t) {
  30609. var i, n, r, o;
  30610. if (!l(t))
  30611. throw TypeError("listener must be a function");
  30612. if (!this._events || !this._events[e])
  30613. return this;
  30614. if (r = (i = this._events[e]).length,
  30615. n = -1,
  30616. i === t || l(i.listener) && i.listener === t)
  30617. delete this._events[e],
  30618. this._events.removeListener && this.emit("removeListener", e, t);
  30619. else if (c(i)) {
  30620. for (o = r; 0 < o--; )
  30621. if (i[o] === t || i[o].listener && i[o].listener === t) {
  30622. n = o;
  30623. break
  30624. }
  30625. if (n < 0)
  30626. return this;
  30627. 1 === i.length ? (i.length = 0,
  30628. delete this._events[e]) : i.splice(n, 1),
  30629. this._events.removeListener && this.emit("removeListener", e, t)
  30630. }
  30631. return this
  30632. }
  30633. ,
  30634. n.prototype.removeAllListeners = function(e) {
  30635. var t, i;
  30636. if (!this._events)
  30637. return this;
  30638. if (!this._events.removeListener)
  30639. return 0 === arguments.length ? this._events = {} : this._events[e] && delete this._events[e],
  30640. this;
  30641. if (0 === arguments.length) {
  30642. for (t in this._events)
  30643. "removeListener" !== t && this.removeAllListeners(t);
  30644. return this.removeAllListeners("removeListener"),
  30645. this._events = {},
  30646. this
  30647. }
  30648. if (l(i = this._events[e]))
  30649. this.removeListener(e, i);
  30650. else if (i)
  30651. for (; i.length; )
  30652. this.removeListener(e, i[i.length - 1]);
  30653. return delete this._events[e],
  30654. this
  30655. }
  30656. ,
  30657. n.prototype.listeners = function(e) {
  30658. return this._events && this._events[e] ? l(this._events[e]) ? [this._events[e]] : this._events[e].slice() : []
  30659. }
  30660. ,
  30661. n.prototype.listenerCount = function(e) {
  30662. if (this._events) {
  30663. var t = this._events[e];
  30664. if (l(t))
  30665. return 1;
  30666. if (t)
  30667. return t.length
  30668. }
  30669. return 0
  30670. }
  30671. ,
  30672. n.listenerCount = function(e, t) {
  30673. return e.listenerCount(t)
  30674. }
  30675. }
  30676. , {}],
  30677. 203: [function(e, t, i) {
  30678. function n() {
  30679. throw new Error("setTimeout has not been defined")
  30680. }
  30681. function r() {
  30682. throw new Error("clearTimeout has not been defined")
  30683. }
  30684. function o(t) {
  30685. if (h === setTimeout)
  30686. return setTimeout(t, 0);
  30687. if ((h === n || !h) && setTimeout)
  30688. return h = setTimeout,
  30689. setTimeout(t, 0);
  30690. try {
  30691. return h(t, 0)
  30692. } catch (e) {
  30693. try {
  30694. return h.call(null, t, 0)
  30695. } catch (e) {
  30696. return h.call(this, t, 0)
  30697. }
  30698. }
  30699. }
  30700. function a() {
  30701. g && p && (g = !1,
  30702. p.length ? f = p.concat(f) : m = -1,
  30703. f.length && s())
  30704. }
  30705. function s() {
  30706. if (!g) {
  30707. var e = o(a);
  30708. g = !0;
  30709. for (var t = f.length; t; ) {
  30710. for (p = f,
  30711. f = []; ++m < t; )
  30712. p && p[m].run();
  30713. m = -1,
  30714. t = f.length
  30715. }
  30716. p = null,
  30717. g = !1,
  30718. function(t) {
  30719. if (u === clearTimeout)
  30720. return clearTimeout(t);
  30721. if ((u === r || !u) && clearTimeout)
  30722. return u = clearTimeout,
  30723. clearTimeout(t);
  30724. try {
  30725. u(t)
  30726. } catch (e) {
  30727. try {
  30728. return u.call(null, t)
  30729. } catch (e) {
  30730. return u.call(this, t)
  30731. }
  30732. }
  30733. }(e)
  30734. }
  30735. }
  30736. function l(e, t) {
  30737. this.fun = e,
  30738. this.array = t
  30739. }
  30740. function c() {}
  30741. var h, u, d = t.exports = {};
  30742. !function() {
  30743. try {
  30744. h = "function" == typeof setTimeout ? setTimeout : n
  30745. } catch (e) {
  30746. h = n
  30747. }
  30748. try {
  30749. u = "function" == typeof clearTimeout ? clearTimeout : r
  30750. } catch (e) {
  30751. u = r
  30752. }
  30753. }();
  30754. var p, f = [], g = !1, m = -1;
  30755. d.nextTick = function(e) {
  30756. var t = new Array(arguments.length - 1);
  30757. if (1 < arguments.length)
  30758. for (var i = 1; i < arguments.length; i++)
  30759. t[i - 1] = arguments[i];
  30760. f.push(new l(e,t)),
  30761. 1 !== f.length || g || o(s)
  30762. }
  30763. ,
  30764. l.prototype.run = function() {
  30765. this.fun.apply(null, this.array)
  30766. }
  30767. ,
  30768. d.title = "browser",
  30769. d.browser = !0,
  30770. d.env = {},
  30771. d.argv = [],
  30772. d.version = "",
  30773. d.versions = {},
  30774. d.on = c,
  30775. d.addListener = c,
  30776. d.once = c,
  30777. d.off = c,
  30778. d.removeListener = c,
  30779. d.removeAllListeners = c,
  30780. d.emit = c,
  30781. d.binding = function(e) {
  30782. throw new Error("process.binding is not supported")
  30783. }
  30784. ,
  30785. d.cwd = function() {
  30786. return "/"
  30787. }
  30788. ,
  30789. d.chdir = function(e) {
  30790. throw new Error("process.chdir is not supported")
  30791. }
  30792. ,
  30793. d.umask = function() {
  30794. return 0
  30795. }
  30796. }
  30797. , {}],
  30798. 204: [function(e, O, L) {
  30799. (function(P) {
  30800. !function(e) {
  30801. function v(e) {
  30802. throw new RangeError(g[e])
  30803. }
  30804. function r(e, t) {
  30805. for (var i = e.length, n = []; i--; )
  30806. n[i] = t(e[i]);
  30807. return n
  30808. }
  30809. function t(e, t) {
  30810. var i = e.split("@")
  30811. , n = "";
  30812. return 1 < i.length && (n = i[0] + "@",
  30813. e = i[1]),
  30814. n + r((e = e.replace(f, ".")).split("."), t).join(".")
  30815. }
  30816. function y(e) {
  30817. for (var t, i, n = [], r = 0, o = e.length; r < o; )
  30818. 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),
  30819. r--) : n.push(t);
  30820. return n
  30821. }
  30822. function A(e) {
  30823. return r(e, function(e) {
  30824. var t = "";
  30825. return 65535 < e && (t += R((e -= 65536) >>> 10 & 1023 | 55296),
  30826. e = 56320 | 1023 & e),
  30827. t + R(e)
  30828. }).join("")
  30829. }
  30830. function C(e, t) {
  30831. return e + 22 + 75 * (e < 26) - ((0 != t) << 5)
  30832. }
  30833. function I(e, t, i) {
  30834. var n = 0;
  30835. for (e = i ? M(e / u) : e >> 1,
  30836. e += M(e / t); m * w >> 1 < e; n += _)
  30837. e = M(e / m);
  30838. return M(n + (m + 1) * e / (e + h))
  30839. }
  30840. function i(e) {
  30841. var t, i, n, r, o, a, s, l, c, h, u, d = [], p = e.length, f = 0, g = x, m = T;
  30842. for ((i = e.lastIndexOf(S)) < 0 && (i = 0),
  30843. n = 0; n < i; ++n)
  30844. 128 <= e.charCodeAt(n) && v("not-basic"),
  30845. d.push(e.charCodeAt(n));
  30846. for (r = 0 < i ? i + 1 : 0; r < p; ) {
  30847. for (o = f,
  30848. a = 1,
  30849. s = _; p <= r && v("invalid-input"),
  30850. u = e.charCodeAt(r++),
  30851. (_ <= (l = u - 48 < 10 ? u - 22 : u - 65 < 26 ? u - 65 : u - 97 < 26 ? u - 97 : _) || l > M((E - f) / a)) && v("overflow"),
  30852. f += l * a,
  30853. !(l < (c = s <= m ? b : m + w <= s ? w : s - m)); s += _)
  30854. a > M(E / (h = _ - c)) && v("overflow"),
  30855. a *= h;
  30856. m = I(f - o, t = d.length + 1, 0 == o),
  30857. M(f / t) > E - g && v("overflow"),
  30858. g += M(f / t),
  30859. f %= t,
  30860. d.splice(f++, 0, g)
  30861. }
  30862. return A(d)
  30863. }
  30864. function n(e) {
  30865. var t, i, n, r, o, a, s, l, c, h, u, d, p, f, g, m = [];
  30866. for (d = (e = y(e)).length,
  30867. t = x,
  30868. o = T,
  30869. a = i = 0; a < d; ++a)
  30870. (u = e[a]) < 128 && m.push(R(u));
  30871. for (n = r = m.length,
  30872. r && m.push(S); n < d; ) {
  30873. for (s = E,
  30874. a = 0; a < d; ++a)
  30875. t <= (u = e[a]) && u < s && (s = u);
  30876. for (s - t > M((E - i) / (p = n + 1)) && v("overflow"),
  30877. i += (s - t) * p,
  30878. t = s,
  30879. a = 0; a < d; ++a)
  30880. if ((u = e[a]) < t && ++i > E && v("overflow"),
  30881. u == t) {
  30882. for (l = i,
  30883. c = _; !(l < (h = c <= o ? b : o + w <= c ? w : c - o)); c += _)
  30884. g = l - h,
  30885. f = _ - h,
  30886. m.push(R(C(h + g % f, 0))),
  30887. l = M(g / f);
  30888. m.push(R(C(l, 0))),
  30889. o = I(i, p, n == r),
  30890. i = 0,
  30891. ++n
  30892. }
  30893. ++i,
  30894. ++t
  30895. }
  30896. return m.join("")
  30897. }
  30898. var o = "object" == typeof L && L && !L.nodeType && L
  30899. , a = "object" == typeof O && O && !O.nodeType && O
  30900. , s = "object" == typeof P && P;
  30901. s.global !== s && s.window !== s && s.self !== s || (e = s);
  30902. 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 = {
  30903. overflow: "Overflow: input needs wider integers to process",
  30904. "not-basic": "Illegal input >= 0x80 (not a basic code point)",
  30905. "invalid-input": "Invalid input"
  30906. }, m = _ - b, M = Math.floor, R = String.fromCharCode;
  30907. if (l = {
  30908. version: "1.4.1",
  30909. ucs2: {
  30910. decode: y,
  30911. encode: A
  30912. },
  30913. decode: i,
  30914. encode: n,
  30915. toASCII: function(e) {
  30916. return t(e, function(e) {
  30917. return p.test(e) ? "xn--" + n(e) : e
  30918. })
  30919. },
  30920. toUnicode: function(e) {
  30921. return t(e, function(e) {
  30922. return d.test(e) ? i(e.slice(4).toLowerCase()) : e
  30923. })
  30924. }
  30925. },
  30926. "function" == typeof define && "object" == typeof define.amd && define.amd)
  30927. define("punycode", function() {
  30928. return l
  30929. });
  30930. else if (o && a)
  30931. if (O.exports == o)
  30932. a.exports = l;
  30933. else
  30934. for (c in l)
  30935. l.hasOwnProperty(c) && (o[c] = l[c]);
  30936. else
  30937. e.punycode = l
  30938. }(this)
  30939. }
  30940. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  30941. }
  30942. , {}],
  30943. 205: [function(e, t, i) {
  30944. "use strict";
  30945. t.exports = function(e, t, i, n) {
  30946. t = t || "&",
  30947. i = i || "=";
  30948. var r = {};
  30949. if ("string" != typeof e || 0 === e.length)
  30950. return r;
  30951. var o = /\+/g;
  30952. e = e.split(t);
  30953. var a = 1e3;
  30954. n && "number" == typeof n.maxKeys && (a = n.maxKeys);
  30955. var s, l, c = e.length;
  30956. 0 < a && a < c && (c = a);
  30957. for (var h = 0; h < c; ++h) {
  30958. var u, d, p, f, g = e[h].replace(o, "%20"), m = g.indexOf(i);
  30959. d = 0 <= m ? (u = g.substr(0, m),
  30960. g.substr(m + 1)) : (u = g,
  30961. ""),
  30962. p = decodeURIComponent(u),
  30963. f = decodeURIComponent(d),
  30964. s = r,
  30965. l = p,
  30966. Object.prototype.hasOwnProperty.call(s, l) ? v(r[p]) ? r[p].push(f) : r[p] = [r[p], f] : r[p] = f
  30967. }
  30968. return r
  30969. }
  30970. ;
  30971. var v = Array.isArray || function(e) {
  30972. return "[object Array]" === Object.prototype.toString.call(e)
  30973. }
  30974. }
  30975. , {}],
  30976. 206: [function(e, t, i) {
  30977. "use strict";
  30978. function o(e, t) {
  30979. if (e.map)
  30980. return e.map(t);
  30981. for (var i = [], n = 0; n < e.length; n++)
  30982. i.push(t(e[n], n));
  30983. return i
  30984. }
  30985. function a(e) {
  30986. switch (typeof e) {
  30987. case "string":
  30988. return e;
  30989. case "boolean":
  30990. return e ? "true" : "false";
  30991. case "number":
  30992. return isFinite(e) ? e : "";
  30993. default:
  30994. return ""
  30995. }
  30996. }
  30997. t.exports = function(i, n, r, e) {
  30998. return n = n || "&",
  30999. r = r || "=",
  31000. null === i && (i = void 0),
  31001. "object" == typeof i ? o(l(i), function(e) {
  31002. var t = encodeURIComponent(a(e)) + r;
  31003. return s(i[e]) ? o(i[e], function(e) {
  31004. return t + encodeURIComponent(a(e))
  31005. }).join(n) : t + encodeURIComponent(a(i[e]))
  31006. }).join(n) : e ? encodeURIComponent(a(e)) + r + encodeURIComponent(a(i)) : ""
  31007. }
  31008. ;
  31009. var s = Array.isArray || function(e) {
  31010. return "[object Array]" === Object.prototype.toString.call(e)
  31011. }
  31012. , l = Object.keys || function(e) {
  31013. var t = [];
  31014. for (var i in e)
  31015. Object.prototype.hasOwnProperty.call(e, i) && t.push(i);
  31016. return t
  31017. }
  31018. }
  31019. , {}],
  31020. 207: [function(e, t, i) {
  31021. "use strict";
  31022. i.decode = i.parse = e("./decode"),
  31023. i.encode = i.stringify = e("./encode")
  31024. }
  31025. , {
  31026. "./decode": 205,
  31027. "./encode": 206
  31028. }],
  31029. 208: [function(e, t, i) {
  31030. "use strict";
  31031. function x() {
  31032. this.protocol = null,
  31033. this.slashes = null,
  31034. this.auth = null,
  31035. this.host = null,
  31036. this.port = null,
  31037. this.hostname = null,
  31038. this.hash = null,
  31039. this.search = null,
  31040. this.query = null,
  31041. this.pathname = null,
  31042. this.path = null,
  31043. this.href = null
  31044. }
  31045. function n(e, t, i) {
  31046. if (e && D.isObject(e) && e instanceof x)
  31047. return e;
  31048. var n = new x;
  31049. return n.parse(e, t, i),
  31050. n
  31051. }
  31052. var L = e("punycode")
  31053. , D = e("./util");
  31054. i.parse = n,
  31055. i.resolve = function(e, t) {
  31056. return n(e, !1, !0).resolve(t)
  31057. }
  31058. ,
  31059. i.resolveObject = function(e, t) {
  31060. return e ? n(e, !1, !0).resolveObject(t) : t
  31061. }
  31062. ,
  31063. i.format = function(e) {
  31064. return D.isString(e) && (e = n(e)),
  31065. e instanceof x ? e.format() : x.prototype.format.call(e)
  31066. }
  31067. ,
  31068. i.Url = x;
  31069. var N = /^([a-z0-9.+-]+:)/i
  31070. , r = /:[0-9]*$/
  31071. , F = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/
  31072. , o = ["{", "}", "|", "\\", "^", "`"].concat(["<", ">", '"', "`", " ", "\r", "\n", "\t"])
  31073. , B = ["'"].concat(o)
  31074. , V = ["%", "/", "?", ";", "#"].concat(B)
  31075. , k = ["/", "?", "#"]
  31076. , U = /^[+a-z0-9A-Z_-]{0,63}$/
  31077. , H = /^([+a-z0-9A-Z_-]{0,63})(.*)$/
  31078. , z = {
  31079. javascript: !0,
  31080. "javascript:": !0
  31081. }
  31082. , G = {
  31083. javascript: !0,
  31084. "javascript:": !0
  31085. }
  31086. , W = {
  31087. http: !0,
  31088. https: !0,
  31089. ftp: !0,
  31090. gopher: !0,
  31091. file: !0,
  31092. "http:": !0,
  31093. "https:": !0,
  31094. "ftp:": !0,
  31095. "gopher:": !0,
  31096. "file:": !0
  31097. }
  31098. , j = e("querystring");
  31099. x.prototype.parse = function(e, t, i) {
  31100. if (!D.isString(e))
  31101. throw new TypeError("Parameter 'url' must be a string, not " + typeof e);
  31102. var n = e.indexOf("?")
  31103. , r = -1 !== n && n < e.indexOf("#") ? "?" : "#"
  31104. , o = e.split(r);
  31105. o[0] = o[0].replace(/\\/g, "/");
  31106. var a = e = o.join(r);
  31107. if (a = a.trim(),
  31108. !i && 1 === e.split("#").length) {
  31109. var s = F.exec(a);
  31110. if (s)
  31111. return this.path = a,
  31112. this.href = a,
  31113. this.pathname = s[1],
  31114. s[2] ? (this.search = s[2],
  31115. this.query = t ? j.parse(this.search.substr(1)) : this.search.substr(1)) : t && (this.search = "",
  31116. this.query = {}),
  31117. this
  31118. }
  31119. var l = N.exec(a);
  31120. if (l) {
  31121. var c = (l = l[0]).toLowerCase();
  31122. this.protocol = c,
  31123. a = a.substr(l.length)
  31124. }
  31125. if (i || l || a.match(/^\/\/[^@\/]+@[^@\/]+/)) {
  31126. var h = "//" === a.substr(0, 2);
  31127. !h || l && G[l] || (a = a.substr(2),
  31128. this.slashes = !0)
  31129. }
  31130. if (!G[l] && (h || l && !W[l])) {
  31131. for (var u = -1, d = 0; d < k.length; d++) {
  31132. -1 !== (g = a.indexOf(k[d])) && (-1 === u || g < u) && (u = g)
  31133. }
  31134. var p, f;
  31135. -1 !== (f = -1 === u ? a.lastIndexOf("@") : a.lastIndexOf("@", u)) && (p = a.slice(0, f),
  31136. a = a.slice(f + 1),
  31137. this.auth = decodeURIComponent(p)),
  31138. u = -1;
  31139. for (d = 0; d < V.length; d++) {
  31140. var g;
  31141. -1 !== (g = a.indexOf(V[d])) && (-1 === u || g < u) && (u = g)
  31142. }
  31143. -1 === u && (u = a.length),
  31144. this.host = a.slice(0, u),
  31145. a = a.slice(u),
  31146. this.parseHost(),
  31147. this.hostname = this.hostname || "";
  31148. var m = "[" === this.hostname[0] && "]" === this.hostname[this.hostname.length - 1];
  31149. if (!m)
  31150. for (var v = this.hostname.split(/\./), y = (d = 0,
  31151. v.length); d < y; d++) {
  31152. var A = v[d];
  31153. if (A && !A.match(U)) {
  31154. for (var C = "", I = 0, E = A.length; I < E; I++)
  31155. C += 127 < A.charCodeAt(I) ? "x" : A[I];
  31156. if (!C.match(U)) {
  31157. var _ = v.slice(0, d)
  31158. , b = v.slice(d + 1)
  31159. , w = A.match(H);
  31160. w && (_.push(w[1]),
  31161. b.unshift(w[2])),
  31162. b.length && (a = "/" + b.join(".") + a),
  31163. this.hostname = _.join(".");
  31164. break
  31165. }
  31166. }
  31167. }
  31168. 255 < this.hostname.length ? this.hostname = "" : this.hostname = this.hostname.toLowerCase(),
  31169. m || (this.hostname = L.toASCII(this.hostname));
  31170. var T = this.port ? ":" + this.port : ""
  31171. , x = this.hostname || "";
  31172. this.host = x + T,
  31173. this.href += this.host,
  31174. m && (this.hostname = this.hostname.substr(1, this.hostname.length - 2),
  31175. "/" !== a[0] && (a = "/" + a))
  31176. }
  31177. if (!z[c])
  31178. for (d = 0,
  31179. y = B.length; d < y; d++) {
  31180. var S = B[d];
  31181. if (-1 !== a.indexOf(S)) {
  31182. var M = encodeURIComponent(S);
  31183. M === S && (M = escape(S)),
  31184. a = a.split(S).join(M)
  31185. }
  31186. }
  31187. var R = a.indexOf("#");
  31188. -1 !== R && (this.hash = a.substr(R),
  31189. a = a.slice(0, R));
  31190. var P = a.indexOf("?");
  31191. if (-1 !== P ? (this.search = a.substr(P),
  31192. this.query = a.substr(P + 1),
  31193. t && (this.query = j.parse(this.query)),
  31194. a = a.slice(0, P)) : t && (this.search = "",
  31195. this.query = {}),
  31196. a && (this.pathname = a),
  31197. W[c] && this.hostname && !this.pathname && (this.pathname = "/"),
  31198. this.pathname || this.search) {
  31199. T = this.pathname || "";
  31200. var O = this.search || "";
  31201. this.path = T + O
  31202. }
  31203. return this.href = this.format(),
  31204. this
  31205. }
  31206. ,
  31207. x.prototype.format = function() {
  31208. var e = this.auth || "";
  31209. e && (e = (e = encodeURIComponent(e)).replace(/%3A/i, ":"),
  31210. e += "@");
  31211. var t = this.protocol || ""
  31212. , i = this.pathname || ""
  31213. , n = this.hash || ""
  31214. , r = !1
  31215. , o = "";
  31216. this.host ? r = e + this.host : this.hostname && (r = e + (-1 === this.hostname.indexOf(":") ? this.hostname : "[" + this.hostname + "]"),
  31217. this.port && (r += ":" + this.port)),
  31218. this.query && D.isObject(this.query) && Object.keys(this.query).length && (o = j.stringify(this.query));
  31219. var a = this.search || o && "?" + o || "";
  31220. return t && ":" !== t.substr(-1) && (t += ":"),
  31221. this.slashes || (!t || W[t]) && !1 !== r ? (r = "//" + (r || ""),
  31222. i && "/" !== i.charAt(0) && (i = "/" + i)) : r = r || "",
  31223. n && "#" !== n.charAt(0) && (n = "#" + n),
  31224. a && "?" !== a.charAt(0) && (a = "?" + a),
  31225. t + r + (i = i.replace(/[?#]/g, function(e) {
  31226. return encodeURIComponent(e)
  31227. })) + (a = a.replace("#", "%23")) + n
  31228. }
  31229. ,
  31230. x.prototype.resolve = function(e) {
  31231. return this.resolveObject(n(e, !1, !0)).format()
  31232. }
  31233. ,
  31234. x.prototype.resolveObject = function(e) {
  31235. if (D.isString(e)) {
  31236. var t = new x;
  31237. t.parse(e, !1, !0),
  31238. e = t
  31239. }
  31240. for (var i = new x, n = Object.keys(this), r = 0; r < n.length; r++) {
  31241. var o = n[r];
  31242. i[o] = this[o]
  31243. }
  31244. if (i.hash = e.hash,
  31245. "" === e.href)
  31246. return i.href = i.format(),
  31247. i;
  31248. if (e.slashes && !e.protocol) {
  31249. for (var a = Object.keys(e), s = 0; s < a.length; s++) {
  31250. var l = a[s];
  31251. "protocol" !== l && (i[l] = e[l])
  31252. }
  31253. return W[i.protocol] && i.hostname && !i.pathname && (i.path = i.pathname = "/"),
  31254. i.href = i.format(),
  31255. i
  31256. }
  31257. if (e.protocol && e.protocol !== i.protocol) {
  31258. if (!W[e.protocol]) {
  31259. for (var c = Object.keys(e), h = 0; h < c.length; h++) {
  31260. var u = c[h];
  31261. i[u] = e[u]
  31262. }
  31263. return i.href = i.format(),
  31264. i
  31265. }
  31266. if (i.protocol = e.protocol,
  31267. e.host || G[e.protocol])
  31268. i.pathname = e.pathname;
  31269. else {
  31270. for (var d = (e.pathname || "").split("/"); d.length && !(e.host = d.shift()); )
  31271. ;
  31272. e.host || (e.host = ""),
  31273. e.hostname || (e.hostname = ""),
  31274. "" !== d[0] && d.unshift(""),
  31275. d.length < 2 && d.unshift(""),
  31276. i.pathname = d.join("/")
  31277. }
  31278. if (i.search = e.search,
  31279. i.query = e.query,
  31280. i.host = e.host || "",
  31281. i.auth = e.auth,
  31282. i.hostname = e.hostname || e.host,
  31283. i.port = e.port,
  31284. i.pathname || i.search) {
  31285. var p = i.pathname || ""
  31286. , f = i.search || "";
  31287. i.path = p + f
  31288. }
  31289. return i.slashes = i.slashes || e.slashes,
  31290. i.href = i.format(),
  31291. i
  31292. }
  31293. var g = i.pathname && "/" === i.pathname.charAt(0)
  31294. , m = e.host || e.pathname && "/" === e.pathname.charAt(0)
  31295. , v = m || g || i.host && e.pathname
  31296. , y = v
  31297. , A = i.pathname && i.pathname.split("/") || []
  31298. , C = (d = e.pathname && e.pathname.split("/") || [],
  31299. i.protocol && !W[i.protocol]);
  31300. if (C && (i.hostname = "",
  31301. i.port = null,
  31302. i.host && ("" === A[0] ? A[0] = i.host : A.unshift(i.host)),
  31303. i.host = "",
  31304. e.protocol && (e.hostname = null,
  31305. e.port = null,
  31306. e.host && ("" === d[0] ? d[0] = e.host : d.unshift(e.host)),
  31307. e.host = null),
  31308. v = v && ("" === d[0] || "" === A[0])),
  31309. m)
  31310. i.host = e.host || "" === e.host ? e.host : i.host,
  31311. i.hostname = e.hostname || "" === e.hostname ? e.hostname : i.hostname,
  31312. i.search = e.search,
  31313. i.query = e.query,
  31314. A = d;
  31315. else if (d.length)
  31316. (A = A || []).pop(),
  31317. A = A.concat(d),
  31318. i.search = e.search,
  31319. i.query = e.query;
  31320. else if (!D.isNullOrUndefined(e.search)) {
  31321. if (C)
  31322. i.hostname = i.host = A.shift(),
  31323. (w = !!(i.host && 0 < i.host.indexOf("@")) && i.host.split("@")) && (i.auth = w.shift(),
  31324. i.host = i.hostname = w.shift());
  31325. return i.search = e.search,
  31326. i.query = e.query,
  31327. D.isNull(i.pathname) && D.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  31328. i.href = i.format(),
  31329. i
  31330. }
  31331. if (!A.length)
  31332. return i.pathname = null,
  31333. i.search ? i.path = "/" + i.search : i.path = null,
  31334. i.href = i.format(),
  31335. i;
  31336. 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--)
  31337. "." === (I = A[b]) ? A.splice(b, 1) : ".." === I ? (A.splice(b, 1),
  31338. _++) : _ && (A.splice(b, 1),
  31339. _--);
  31340. if (!v && !y)
  31341. for (; _--; )
  31342. A.unshift("..");
  31343. !v || "" === A[0] || A[0] && "/" === A[0].charAt(0) || A.unshift(""),
  31344. E && "/" !== A.join("/").substr(-1) && A.push("");
  31345. var w, T = "" === A[0] || A[0] && "/" === A[0].charAt(0);
  31346. C && (i.hostname = i.host = T ? "" : A.length ? A.shift() : "",
  31347. (w = !!(i.host && 0 < i.host.indexOf("@")) && i.host.split("@")) && (i.auth = w.shift(),
  31348. i.host = i.hostname = w.shift()));
  31349. return (v = v || i.host && A.length) && !T && A.unshift(""),
  31350. A.length ? i.pathname = A.join("/") : (i.pathname = null,
  31351. i.path = null),
  31352. D.isNull(i.pathname) && D.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  31353. i.auth = e.auth || i.auth,
  31354. i.slashes = i.slashes || e.slashes,
  31355. i.href = i.format(),
  31356. i
  31357. }
  31358. ,
  31359. x.prototype.parseHost = function() {
  31360. var e = this.host
  31361. , t = r.exec(e);
  31362. t && (":" !== (t = t[0]) && (this.port = t.substr(1)),
  31363. e = e.substr(0, e.length - t.length)),
  31364. e && (this.hostname = e)
  31365. }
  31366. }
  31367. , {
  31368. "./util": 209,
  31369. punycode: 204,
  31370. querystring: 207
  31371. }],
  31372. 209: [function(e, t, i) {
  31373. "use strict";
  31374. t.exports = {
  31375. isString: function(e) {
  31376. return "string" == typeof e
  31377. },
  31378. isObject: function(e) {
  31379. return "object" == typeof e && null !== e
  31380. },
  31381. isNull: function(e) {
  31382. return null === e
  31383. },
  31384. isNullOrUndefined: function(e) {
  31385. return null == e
  31386. }
  31387. }
  31388. }
  31389. , {}],
  31390. 210: [function(e, t, i) {
  31391. "use strict";
  31392. function r(e) {
  31393. return c + e
  31394. }
  31395. function s(e) {
  31396. if ("string" != typeof e)
  31397. throw new TypeError("key must be a string.")
  31398. }
  31399. var l = Object.prototype.hasOwnProperty
  31400. , c = "~";
  31401. t.exports = function(t) {
  31402. var o = Object.create(null)
  31403. , n = 0
  31404. , a = {};
  31405. return function(e, t) {
  31406. for (var i in t)
  31407. Object.defineProperty(e, i, {
  31408. value: t[i],
  31409. configurable: !0,
  31410. writable: !0
  31411. })
  31412. }(a, {
  31413. get: function(e, t) {
  31414. s(e);
  31415. var i = r(e);
  31416. return i in o ? o[i] : t
  31417. },
  31418. set: function(e, t) {
  31419. s(e);
  31420. var i = r(e);
  31421. return i in o || ++n,
  31422. o[i] = t
  31423. },
  31424. has: function(e) {
  31425. return s(e),
  31426. r(e)in o
  31427. },
  31428. delete: function(e) {
  31429. s(e);
  31430. var t = r(e);
  31431. return t in o && (--n,
  31432. delete o[t],
  31433. !0)
  31434. },
  31435. clear: function() {
  31436. o = Object.create(null),
  31437. n = 0
  31438. },
  31439. forEach: function(e, t) {
  31440. if ("function" != typeof e)
  31441. throw new TypeError("`callback` must be a function");
  31442. for (var i in o)
  31443. if (l.call(o, i)) {
  31444. var n = i.substring(c.length)
  31445. , r = o[i];
  31446. e.call(t, r, n, a)
  31447. }
  31448. }
  31449. }),
  31450. Object.defineProperty(a, "size", {
  31451. get: function() {
  31452. return n
  31453. },
  31454. configurable: !0
  31455. }),
  31456. "object" == typeof t && null !== t && Object.keys(t).forEach(function(e) {
  31457. a.set(e, t[e])
  31458. }),
  31459. a
  31460. }
  31461. }
  31462. , {}],
  31463. 211: [function(e, t, i) {
  31464. t.exports = e("./lib/heap")
  31465. }
  31466. , {
  31467. "./lib/heap": 212
  31468. }],
  31469. 212: [function(e, y, A) {
  31470. (function() {
  31471. var e, d, l, p, f, t, c, i, g, m, n, r, o, h, u, a, s;
  31472. function v(e) {
  31473. this.cmp = null != e ? e : d,
  31474. this.nodes = []
  31475. }
  31476. l = Math.floor,
  31477. m = Math.min,
  31478. d = function(e, t) {
  31479. return e < t ? -1 : t < e ? 1 : 0
  31480. }
  31481. ,
  31482. g = function(e, t, i, n, r) {
  31483. var o;
  31484. if (null == i && (i = 0),
  31485. null == r && (r = d),
  31486. i < 0)
  31487. throw new Error("lo must be non-negative");
  31488. for (null == n && (n = e.length); i < n; )
  31489. r(t, e[o = l((i + n) / 2)]) < 0 ? n = o : i = o + 1;
  31490. return [].splice.apply(e, [i, i - i].concat(t)),
  31491. t
  31492. }
  31493. ,
  31494. t = function(e, t, i) {
  31495. return null == i && (i = d),
  31496. e.push(t),
  31497. h(e, 0, e.length - 1, i)
  31498. }
  31499. ,
  31500. f = function(e, t) {
  31501. var i, n;
  31502. return null == t && (t = d),
  31503. i = e.pop(),
  31504. e.length ? (n = e[0],
  31505. e[0] = i,
  31506. u(e, 0, t)) : n = i,
  31507. n
  31508. }
  31509. ,
  31510. i = function(e, t, i) {
  31511. var n;
  31512. return null == i && (i = d),
  31513. n = e[0],
  31514. e[0] = t,
  31515. u(e, 0, i),
  31516. n
  31517. }
  31518. ,
  31519. c = function(e, t, i) {
  31520. var n;
  31521. return null == i && (i = d),
  31522. e.length && i(e[0], t) < 0 && (t = (n = [e[0], t])[0],
  31523. e[0] = n[1],
  31524. u(e, 0, i)),
  31525. t
  31526. }
  31527. ,
  31528. p = function(i, e) {
  31529. var t, n, r, o, a, s;
  31530. for (null == e && (e = d),
  31531. a = [],
  31532. n = 0,
  31533. r = (o = function() {
  31534. s = [];
  31535. for (var e = 0, t = l(i.length / 2); 0 <= t ? e < t : t < e; 0 <= t ? e++ : e--)
  31536. s.push(e);
  31537. return s
  31538. }
  31539. .apply(this).reverse()).length; n < r; n++)
  31540. t = o[n],
  31541. a.push(u(i, t, e));
  31542. return a
  31543. }
  31544. ,
  31545. o = function(e, t, i) {
  31546. var n;
  31547. if (null == i && (i = d),
  31548. -1 !== (n = e.indexOf(t)))
  31549. return h(e, 0, n, i),
  31550. u(e, n, i)
  31551. }
  31552. ,
  31553. n = function(e, t, i) {
  31554. var n, r, o, a, s;
  31555. if (null == i && (i = d),
  31556. !(r = e.slice(0, t)).length)
  31557. return r;
  31558. for (p(r, i),
  31559. o = 0,
  31560. a = (s = e.slice(t)).length; o < a; o++)
  31561. n = s[o],
  31562. c(r, n, i);
  31563. return r.sort(i).reverse()
  31564. }
  31565. ,
  31566. r = function(e, t, i) {
  31567. var n, r, o, a, s, l, c, h, u;
  31568. if (null == i && (i = d),
  31569. 10 * t <= e.length) {
  31570. if (!(o = e.slice(0, t).sort(i)).length)
  31571. return o;
  31572. for (r = o[o.length - 1],
  31573. a = 0,
  31574. l = (c = e.slice(t)).length; a < l; a++)
  31575. i(n = c[a], r) < 0 && (g(o, n, 0, null, i),
  31576. o.pop(),
  31577. r = o[o.length - 1]);
  31578. return o
  31579. }
  31580. for (p(e, i),
  31581. u = [],
  31582. s = 0,
  31583. h = m(t, e.length); 0 <= h ? s < h : h < s; 0 <= h ? ++s : --s)
  31584. u.push(f(e, i));
  31585. return u
  31586. }
  31587. ,
  31588. h = function(e, t, i, n) {
  31589. var r, o, a;
  31590. for (null == n && (n = d),
  31591. r = e[i]; t < i && n(r, o = e[a = i - 1 >> 1]) < 0; )
  31592. e[i] = o,
  31593. i = a;
  31594. return e[i] = r
  31595. }
  31596. ,
  31597. u = function(e, t, i) {
  31598. var n, r, o, a, s;
  31599. for (null == i && (i = d),
  31600. r = e.length,
  31601. o = e[s = t],
  31602. n = 2 * t + 1; n < r; )
  31603. (a = n + 1) < r && !(i(e[n], e[a]) < 0) && (n = a),
  31604. e[t] = e[n],
  31605. n = 2 * (t = n) + 1;
  31606. return e[t] = o,
  31607. h(e, s, t, i)
  31608. }
  31609. ,
  31610. v.push = t,
  31611. v.pop = f,
  31612. v.replace = i,
  31613. v.pushpop = c,
  31614. v.heapify = p,
  31615. v.updateItem = o,
  31616. v.nlargest = n,
  31617. v.nsmallest = r,
  31618. v.prototype.push = function(e) {
  31619. return t(this.nodes, e, this.cmp)
  31620. }
  31621. ,
  31622. v.prototype.pop = function() {
  31623. return f(this.nodes, this.cmp)
  31624. }
  31625. ,
  31626. v.prototype.peek = function() {
  31627. return this.nodes[0]
  31628. }
  31629. ,
  31630. v.prototype.contains = function(e) {
  31631. return -1 !== this.nodes.indexOf(e)
  31632. }
  31633. ,
  31634. v.prototype.replace = function(e) {
  31635. return i(this.nodes, e, this.cmp)
  31636. }
  31637. ,
  31638. v.prototype.pushpop = function(e) {
  31639. return c(this.nodes, e, this.cmp)
  31640. }
  31641. ,
  31642. v.prototype.heapify = function() {
  31643. return p(this.nodes, this.cmp)
  31644. }
  31645. ,
  31646. v.prototype.updateItem = function(e) {
  31647. return o(this.nodes, e, this.cmp)
  31648. }
  31649. ,
  31650. v.prototype.clear = function() {
  31651. return this.nodes = []
  31652. }
  31653. ,
  31654. v.prototype.empty = function() {
  31655. return 0 === this.nodes.length
  31656. }
  31657. ,
  31658. v.prototype.size = function() {
  31659. return this.nodes.length
  31660. }
  31661. ,
  31662. v.prototype.clone = function() {
  31663. var e;
  31664. return (e = new v).nodes = this.nodes.slice(0),
  31665. e
  31666. }
  31667. ,
  31668. v.prototype.toArray = function() {
  31669. return this.nodes.slice(0)
  31670. }
  31671. ,
  31672. v.prototype.insert = v.prototype.push,
  31673. v.prototype.top = v.prototype.peek,
  31674. v.prototype.front = v.prototype.peek,
  31675. v.prototype.has = v.prototype.contains,
  31676. v.prototype.copy = v.prototype.clone,
  31677. e = v,
  31678. a = this,
  31679. s = function() {
  31680. return e
  31681. }
  31682. ,
  31683. "function" == typeof define && define.amd ? define([], s) : "object" == typeof A ? y.exports = s() : a.Heap = s()
  31684. }
  31685. ).call(this)
  31686. }
  31687. , {}],
  31688. 213: [function(e, t, i) {
  31689. function n() {}
  31690. function o(e) {
  31691. if ("object" != typeof this)
  31692. throw new TypeError("Promises must be constructed via new");
  31693. if ("function" != typeof e)
  31694. throw new TypeError("not a function");
  31695. this._state = 0,
  31696. this._handled = !1,
  31697. this._value = void 0,
  31698. this._deferreds = [],
  31699. h(e, this)
  31700. }
  31701. function r(i, n) {
  31702. for (; 3 === i._state; )
  31703. i = i._value;
  31704. return 0 === i._state ? void i._deferreds.push(n) : (i._handled = !0,
  31705. void o._immediateFn(function() {
  31706. var e = 1 === i._state ? n.onFulfilled : n.onRejected;
  31707. if (null !== e) {
  31708. var t;
  31709. try {
  31710. t = e(i._value)
  31711. } catch (e) {
  31712. return void s(n.promise, e)
  31713. }
  31714. a(n.promise, t)
  31715. } else
  31716. (1 === i._state ? a : s)(n.promise, i._value)
  31717. }))
  31718. }
  31719. function a(e, t) {
  31720. try {
  31721. if (t === e)
  31722. throw new TypeError("A promise cannot be resolved with itself.");
  31723. if (t && ("object" == typeof t || "function" == typeof t)) {
  31724. var i = t.then;
  31725. if (t instanceof o)
  31726. return e._state = 3,
  31727. e._value = t,
  31728. void l(e);
  31729. if ("function" == typeof i)
  31730. return void h(function(e, t) {
  31731. return function() {
  31732. e.apply(t, arguments)
  31733. }
  31734. }(i, t), e)
  31735. }
  31736. e._state = 1,
  31737. e._value = t,
  31738. l(e)
  31739. } catch (t) {
  31740. s(e, t)
  31741. }
  31742. }
  31743. function s(e, t) {
  31744. e._state = 2,
  31745. e._value = t,
  31746. l(e)
  31747. }
  31748. function l(e) {
  31749. 2 === e._state && 0 === e._deferreds.length && o._immediateFn(function() {
  31750. e._handled || o._unhandledRejectionFn(e._value)
  31751. });
  31752. for (var t = 0, i = e._deferreds.length; t < i; t++)
  31753. r(e, e._deferreds[t]);
  31754. e._deferreds = null
  31755. }
  31756. function c(e, t, i) {
  31757. this.onFulfilled = "function" == typeof e ? e : null,
  31758. this.onRejected = "function" == typeof t ? t : null,
  31759. this.promise = i
  31760. }
  31761. function h(e, t) {
  31762. var i = !1;
  31763. try {
  31764. e(function(e) {
  31765. i || (i = !0,
  31766. a(t, e))
  31767. }, function(e) {
  31768. i || (i = !0,
  31769. s(t, e))
  31770. })
  31771. } catch (e) {
  31772. if (i)
  31773. return;
  31774. i = !0,
  31775. s(t, e)
  31776. }
  31777. }
  31778. var u, d;
  31779. u = this,
  31780. d = setTimeout,
  31781. o.prototype.catch = function(e) {
  31782. return this.then(null, e)
  31783. }
  31784. ,
  31785. o.prototype.then = function(e, t) {
  31786. var i = new this.constructor(n);
  31787. return r(this, new c(e,t,i)),
  31788. i
  31789. }
  31790. ,
  31791. o.all = function(e) {
  31792. var s = Array.prototype.slice.call(e);
  31793. return new o(function(n, r) {
  31794. function o(t, e) {
  31795. try {
  31796. if (e && ("object" == typeof e || "function" == typeof e)) {
  31797. var i = e.then;
  31798. if ("function" == typeof i)
  31799. return void i.call(e, function(e) {
  31800. o(t, e)
  31801. }, r)
  31802. }
  31803. s[t] = e,
  31804. 0 == --a && n(s)
  31805. } catch (e) {
  31806. r(e)
  31807. }
  31808. }
  31809. if (0 === s.length)
  31810. return n([]);
  31811. for (var a = s.length, e = 0; e < s.length; e++)
  31812. o(e, s[e])
  31813. }
  31814. )
  31815. }
  31816. ,
  31817. o.resolve = function(t) {
  31818. return t && "object" == typeof t && t.constructor === o ? t : new o(function(e) {
  31819. e(t)
  31820. }
  31821. )
  31822. }
  31823. ,
  31824. o.reject = function(i) {
  31825. return new o(function(e, t) {
  31826. t(i)
  31827. }
  31828. )
  31829. }
  31830. ,
  31831. o.race = function(r) {
  31832. return new o(function(e, t) {
  31833. for (var i = 0, n = r.length; i < n; i++)
  31834. r[i].then(e, t)
  31835. }
  31836. )
  31837. }
  31838. ,
  31839. o._immediateFn = "function" == typeof setImmediate && function(e) {
  31840. setImmediate(e)
  31841. }
  31842. || function(e) {
  31843. d(e, 0)
  31844. }
  31845. ,
  31846. o._unhandledRejectionFn = function(e) {
  31847. "undefined" != typeof console && console && console.warn("Possible Unhandled Promise Rejection:", e)
  31848. }
  31849. ,
  31850. o._setImmediateFn = function(e) {
  31851. o._immediateFn = e
  31852. }
  31853. ,
  31854. o._setUnhandledRejectionFn = function(e) {
  31855. o._unhandledRejectionFn = e
  31856. }
  31857. ,
  31858. void 0 !== t && t.exports ? t.exports = o : u.Promise || (u.Promise = o)
  31859. }
  31860. , {}],
  31861. 214: [function(p, i, e) {
  31862. (function(d) {
  31863. var e, t;
  31864. e = this,
  31865. t = function(I, e) {
  31866. "use strict";
  31867. var a, t, u, i, s, n, r, o = {};
  31868. return o.ByteBuffer = I,
  31869. o.Long = I.Long || null,
  31870. o.VERSION = "5.0.1",
  31871. o.WIRE_TYPES = {},
  31872. o.WIRE_TYPES.VARINT = 0,
  31873. o.WIRE_TYPES.BITS64 = 1,
  31874. o.WIRE_TYPES.LDELIM = 2,
  31875. o.WIRE_TYPES.STARTGROUP = 3,
  31876. o.WIRE_TYPES.ENDGROUP = 4,
  31877. o.WIRE_TYPES.BITS32 = 5,
  31878. o.PACKABLE_WIRE_TYPES = [o.WIRE_TYPES.VARINT, o.WIRE_TYPES.BITS64, o.WIRE_TYPES.BITS32],
  31879. o.TYPES = {
  31880. int32: {
  31881. name: "int32",
  31882. wireType: o.WIRE_TYPES.VARINT,
  31883. defaultValue: 0
  31884. },
  31885. uint32: {
  31886. name: "uint32",
  31887. wireType: o.WIRE_TYPES.VARINT,
  31888. defaultValue: 0
  31889. },
  31890. sint32: {
  31891. name: "sint32",
  31892. wireType: o.WIRE_TYPES.VARINT,
  31893. defaultValue: 0
  31894. },
  31895. int64: {
  31896. name: "int64",
  31897. wireType: o.WIRE_TYPES.VARINT,
  31898. defaultValue: o.Long ? o.Long.ZERO : void 0
  31899. },
  31900. uint64: {
  31901. name: "uint64",
  31902. wireType: o.WIRE_TYPES.VARINT,
  31903. defaultValue: o.Long ? o.Long.UZERO : void 0
  31904. },
  31905. sint64: {
  31906. name: "sint64",
  31907. wireType: o.WIRE_TYPES.VARINT,
  31908. defaultValue: o.Long ? o.Long.ZERO : void 0
  31909. },
  31910. bool: {
  31911. name: "bool",
  31912. wireType: o.WIRE_TYPES.VARINT,
  31913. defaultValue: !1
  31914. },
  31915. double: {
  31916. name: "double",
  31917. wireType: o.WIRE_TYPES.BITS64,
  31918. defaultValue: 0
  31919. },
  31920. string: {
  31921. name: "string",
  31922. wireType: o.WIRE_TYPES.LDELIM,
  31923. defaultValue: ""
  31924. },
  31925. bytes: {
  31926. name: "bytes",
  31927. wireType: o.WIRE_TYPES.LDELIM,
  31928. defaultValue: null
  31929. },
  31930. fixed32: {
  31931. name: "fixed32",
  31932. wireType: o.WIRE_TYPES.BITS32,
  31933. defaultValue: 0
  31934. },
  31935. sfixed32: {
  31936. name: "sfixed32",
  31937. wireType: o.WIRE_TYPES.BITS32,
  31938. defaultValue: 0
  31939. },
  31940. fixed64: {
  31941. name: "fixed64",
  31942. wireType: o.WIRE_TYPES.BITS64,
  31943. defaultValue: o.Long ? o.Long.UZERO : void 0
  31944. },
  31945. sfixed64: {
  31946. name: "sfixed64",
  31947. wireType: o.WIRE_TYPES.BITS64,
  31948. defaultValue: o.Long ? o.Long.ZERO : void 0
  31949. },
  31950. float: {
  31951. name: "float",
  31952. wireType: o.WIRE_TYPES.BITS32,
  31953. defaultValue: 0
  31954. },
  31955. enum: {
  31956. name: "enum",
  31957. wireType: o.WIRE_TYPES.VARINT,
  31958. defaultValue: 0
  31959. },
  31960. message: {
  31961. name: "message",
  31962. wireType: o.WIRE_TYPES.LDELIM,
  31963. defaultValue: null
  31964. },
  31965. group: {
  31966. name: "group",
  31967. wireType: o.WIRE_TYPES.STARTGROUP,
  31968. defaultValue: null
  31969. }
  31970. },
  31971. 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],
  31972. o.ID_MIN = 1,
  31973. o.ID_MAX = 536870911,
  31974. o.convertFieldsToCamelCase = !1,
  31975. o.populateAccessors = !0,
  31976. o.populateDefaults = !0,
  31977. o.Util = ((r = {}).IS_NODE = !("object" != typeof d || d + "" != "[object process]" || d.browser),
  31978. r.XHR = function() {
  31979. for (var e = [function() {
  31980. return new XMLHttpRequest
  31981. }
  31982. , function() {
  31983. return new ActiveXObject("Msxml2.XMLHTTP")
  31984. }
  31985. , function() {
  31986. return new ActiveXObject("Msxml3.XMLHTTP")
  31987. }
  31988. , function() {
  31989. return new ActiveXObject("Microsoft.XMLHTTP")
  31990. }
  31991. ], t = null, i = 0; i < e.length; i++) {
  31992. try {
  31993. t = e[i]()
  31994. } catch (e) {
  31995. continue
  31996. }
  31997. break
  31998. }
  31999. if (!t)
  32000. throw Error("XMLHttpRequest is not supported");
  32001. return t
  32002. }
  32003. ,
  32004. r.fetch = function(e, i) {
  32005. if (i && "function" != typeof i && (i = null),
  32006. r.IS_NODE) {
  32007. var t = p("fs");
  32008. if (i)
  32009. t.readFile(e, function(e, t) {
  32010. i(e ? null : "" + t)
  32011. });
  32012. else
  32013. try {
  32014. return t.readFileSync(e)
  32015. } catch (e) {
  32016. return null
  32017. }
  32018. } else {
  32019. var n = r.XHR();
  32020. if (n.open("GET", e, !!i),
  32021. n.setRequestHeader("Accept", "text/plain"),
  32022. "function" == typeof n.overrideMimeType && n.overrideMimeType("text/plain"),
  32023. !i)
  32024. return n.send(null),
  32025. 200 == n.status || 0 == n.status && "string" == typeof n.responseText ? n.responseText : null;
  32026. if (n.onreadystatechange = function() {
  32027. 4 == n.readyState && i(200 == n.status || 0 == n.status && "string" == typeof n.responseText ? n.responseText : null)
  32028. }
  32029. ,
  32030. 4 == n.readyState)
  32031. return;
  32032. n.send(null)
  32033. }
  32034. }
  32035. ,
  32036. r.toCamelCase = function(e) {
  32037. return e.replace(/_([a-zA-Z])/g, function(e, t) {
  32038. return t.toUpperCase()
  32039. })
  32040. }
  32041. ,
  32042. r),
  32043. o.Lang = {
  32044. DELIM: /[\s\{\}=;:\[\],'"\(\)<>]/g,
  32045. RULE: /^(?:required|optional|repeated|map)$/,
  32046. TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,
  32047. NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,
  32048. TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,
  32049. TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,
  32050. FQTYPEREF: /^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,
  32051. NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,
  32052. NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,
  32053. NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/,
  32054. NUMBER_OCT: /^0[0-7]+$/,
  32055. NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,
  32056. BOOL: /^(?:true|false)$/i,
  32057. ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  32058. NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  32059. WHITESPACE: /\s/,
  32060. STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,
  32061. STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,
  32062. STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g
  32063. },
  32064. o.DotProto = function(r, a) {
  32065. function s(e, t) {
  32066. var i = -1
  32067. , n = 1;
  32068. if ("-" == e.charAt(0) && (n = -1,
  32069. e = e.substring(1)),
  32070. a.NUMBER_DEC.test(e))
  32071. i = parseInt(e);
  32072. else if (a.NUMBER_HEX.test(e))
  32073. i = parseInt(e.substring(2), 16);
  32074. else {
  32075. if (!a.NUMBER_OCT.test(e))
  32076. throw Error("illegal id value: " + (n < 0 ? "-" : "") + e);
  32077. i = parseInt(e.substring(1), 8)
  32078. }
  32079. if (i = n * i | 0,
  32080. !t && i < 0)
  32081. throw Error("illegal id value: " + (n < 0 ? "-" : "") + e);
  32082. return i
  32083. }
  32084. function o(e) {
  32085. var t = 1;
  32086. if ("-" == e.charAt(0) && (t = -1,
  32087. e = e.substring(1)),
  32088. a.NUMBER_DEC.test(e))
  32089. return t * parseInt(e, 10);
  32090. if (a.NUMBER_HEX.test(e))
  32091. return t * parseInt(e.substring(2), 16);
  32092. if (a.NUMBER_OCT.test(e))
  32093. return t * parseInt(e.substring(1), 8);
  32094. if ("inf" === e)
  32095. return t * (1 / 0);
  32096. if ("nan" === e)
  32097. return NaN;
  32098. if (a.NUMBER_FLT.test(e))
  32099. return t * parseFloat(e);
  32100. throw Error("illegal number value: " + (t < 0 ? "-" : "") + e)
  32101. }
  32102. function n(e, t, i) {
  32103. void 0 === e[t] ? e[t] = i : (Array.isArray(e[t]) || (e[t] = [e[t]]),
  32104. e[t].push(i))
  32105. }
  32106. function t(e) {
  32107. this.source = e + "",
  32108. this.index = 0,
  32109. this.line = 1,
  32110. this.stack = [],
  32111. this._stringOpen = null
  32112. }
  32113. var e = {}
  32114. , i = t.prototype;
  32115. i._readString = function() {
  32116. var e = '"' === this._stringOpen ? a.STRING_DQ : a.STRING_SQ;
  32117. e.lastIndex = this.index - 1;
  32118. var t = e.exec(this.source);
  32119. if (!t)
  32120. throw Error("unterminated string");
  32121. return this.index = e.lastIndex,
  32122. this.stack.push(this._stringOpen),
  32123. this._stringOpen = null,
  32124. t[1]
  32125. }
  32126. ,
  32127. i.next = function() {
  32128. if (0 < this.stack.length)
  32129. return this.stack.shift();
  32130. if (this.index >= this.source.length)
  32131. return null;
  32132. if (null !== this._stringOpen)
  32133. return this._readString();
  32134. var e, t, i;
  32135. do {
  32136. for (e = !1; a.WHITESPACE.test(i = this.source.charAt(this.index)); )
  32137. if ("\n" === i && ++this.line,
  32138. ++this.index === this.source.length)
  32139. return null;
  32140. if ("/" === this.source.charAt(this.index))
  32141. if (++this.index,
  32142. "/" === this.source.charAt(this.index)) {
  32143. for (; "\n" !== this.source.charAt(++this.index); )
  32144. if (this.index == this.source.length)
  32145. return null;
  32146. ++this.index,
  32147. ++this.line,
  32148. e = !0
  32149. } else {
  32150. if ("*" !== (i = this.source.charAt(this.index)))
  32151. return "/";
  32152. do {
  32153. if ("\n" === i && ++this.line,
  32154. ++this.index === this.source.length)
  32155. return null;
  32156. t = i,
  32157. i = this.source.charAt(this.index)
  32158. } while ("*" !== t || "/" !== i);++this.index,
  32159. e = !0
  32160. }
  32161. } while (e);if (this.index === this.source.length)
  32162. return null;
  32163. var n = this.index;
  32164. if (a.DELIM.lastIndex = 0,
  32165. !a.DELIM.test(this.source.charAt(n++)))
  32166. for (; n < this.source.length && !a.DELIM.test(this.source.charAt(n)); )
  32167. ++n;
  32168. var r = this.source.substring(this.index, this.index = n);
  32169. return '"' !== r && "'" !== r || (this._stringOpen = r),
  32170. r
  32171. }
  32172. ,
  32173. i.peek = function() {
  32174. if (0 === this.stack.length) {
  32175. var e = this.next();
  32176. if (null === e)
  32177. return null;
  32178. this.stack.push(e)
  32179. }
  32180. return this.stack[0]
  32181. }
  32182. ,
  32183. i.skip = function(e) {
  32184. var t = this.next();
  32185. if (t !== e)
  32186. throw Error("illegal '" + t + "', '" + e + "' expected")
  32187. }
  32188. ,
  32189. i.omit = function(e) {
  32190. return this.peek() === e && (this.next(),
  32191. !0)
  32192. }
  32193. ,
  32194. i.toString = function() {
  32195. return "Tokenizer (" + this.index + "/" + this.source.length + " at line " + this.line + ")"
  32196. }
  32197. ,
  32198. e.Tokenizer = t;
  32199. function l(e) {
  32200. this.tn = new t(e),
  32201. this.proto3 = !1
  32202. }
  32203. var c = l.prototype;
  32204. return c.parse = function() {
  32205. var e, t, i = {
  32206. name: "[ROOT]",
  32207. package: null,
  32208. messages: [],
  32209. enums: [],
  32210. imports: [],
  32211. options: {},
  32212. services: []
  32213. }, n = !0;
  32214. try {
  32215. for (; e = this.tn.next(); )
  32216. switch (e) {
  32217. case "package":
  32218. if (!n || null !== i.package)
  32219. throw Error("unexpected 'package'");
  32220. if (e = this.tn.next(),
  32221. !a.TYPEREF.test(e))
  32222. throw Error("illegal package name: " + e);
  32223. this.tn.skip(";"),
  32224. i.package = e;
  32225. break;
  32226. case "import":
  32227. if (!n)
  32228. throw Error("unexpected 'import'");
  32229. "public" !== (e = this.tn.peek()) && !(t = "weak" === e) || this.tn.next(),
  32230. e = this._readString(),
  32231. this.tn.skip(";"),
  32232. t || i.imports.push(e);
  32233. break;
  32234. case "syntax":
  32235. if (!n)
  32236. throw Error("unexpected 'syntax'");
  32237. this.tn.skip("="),
  32238. "proto3" === (i.syntax = this._readString()) && (this.proto3 = !0),
  32239. this.tn.skip(";");
  32240. break;
  32241. case "message":
  32242. this._parseMessage(i, null),
  32243. n = !1;
  32244. break;
  32245. case "enum":
  32246. this._parseEnum(i),
  32247. n = !1;
  32248. break;
  32249. case "option":
  32250. this._parseOption(i);
  32251. break;
  32252. case "service":
  32253. this._parseService(i);
  32254. break;
  32255. case "extend":
  32256. this._parseExtend(i);
  32257. break;
  32258. default:
  32259. throw Error("unexpected '" + e + "'")
  32260. }
  32261. } catch (e) {
  32262. throw e.message = "Parse error at line " + this.tn.line + ": " + e.message,
  32263. e
  32264. }
  32265. return delete i.name,
  32266. i
  32267. }
  32268. ,
  32269. l.parse = function(e) {
  32270. return new l(e).parse()
  32271. }
  32272. ,
  32273. c._readString = function() {
  32274. var e, t, i = "";
  32275. do {
  32276. if ("'" !== (t = this.tn.next()) && '"' !== t)
  32277. throw Error("illegal string delimiter: " + t);
  32278. i += this.tn.next(),
  32279. this.tn.skip(t),
  32280. e = this.tn.peek()
  32281. } while ('"' === e || '"' === e);return i
  32282. }
  32283. ,
  32284. c._readValue = function(e) {
  32285. var t = this.tn.peek();
  32286. if ('"' === t || "'" === t)
  32287. return this._readString();
  32288. if (this.tn.next(),
  32289. a.NUMBER.test(t))
  32290. return o(t);
  32291. if (a.BOOL.test(t))
  32292. return "true" === t.toLowerCase();
  32293. if (e && a.TYPEREF.test(t))
  32294. return t;
  32295. throw Error("illegal value: " + t)
  32296. }
  32297. ,
  32298. c._parseOption = function(e, t) {
  32299. var i = this.tn.next()
  32300. , n = !1;
  32301. if ("(" === i && (n = !0,
  32302. i = this.tn.next()),
  32303. !a.TYPEREF.test(i))
  32304. throw Error("illegal option name: " + i);
  32305. var r = i;
  32306. n && (this.tn.skip(")"),
  32307. r = "(" + r + ")",
  32308. i = this.tn.peek(),
  32309. a.FQTYPEREF.test(i) && (r += i,
  32310. this.tn.next())),
  32311. this.tn.skip("="),
  32312. this._parseOptionValue(e, r),
  32313. t || this.tn.skip(";")
  32314. }
  32315. ,
  32316. c._parseOptionValue = function(e, t) {
  32317. var i = this.tn.peek();
  32318. if ("{" !== i)
  32319. n(e.options, t, this._readValue(!0));
  32320. else
  32321. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); ) {
  32322. if (!a.NAME.test(i))
  32323. throw Error("illegal option name: " + t + "." + i);
  32324. this.tn.omit(":") ? n(e.options, t + "." + i, this._readValue(!0)) : this._parseOptionValue(e, t + "." + i)
  32325. }
  32326. }
  32327. ,
  32328. c._parseService = function(e) {
  32329. var t = this.tn.next();
  32330. if (!a.NAME.test(t))
  32331. throw Error("illegal service name at line " + this.tn.line + ": " + t);
  32332. var i = {
  32333. name: t,
  32334. rpc: {},
  32335. options: {}
  32336. };
  32337. for (this.tn.skip("{"); "}" !== (t = this.tn.next()); )
  32338. if ("option" === t)
  32339. this._parseOption(i);
  32340. else {
  32341. if ("rpc" !== t)
  32342. throw Error("illegal service token: " + t);
  32343. this._parseServiceRPC(i)
  32344. }
  32345. this.tn.omit(";"),
  32346. e.services.push(i)
  32347. }
  32348. ,
  32349. c._parseServiceRPC = function(e) {
  32350. var t = this.tn.next();
  32351. if (!a.NAME.test(t))
  32352. throw Error("illegal rpc service method name: " + t);
  32353. var i = t
  32354. , n = {
  32355. request: null,
  32356. response: null,
  32357. request_stream: !1,
  32358. response_stream: !1,
  32359. options: {}
  32360. };
  32361. if (this.tn.skip("("),
  32362. "stream" === (t = this.tn.next()).toLowerCase() && (n.request_stream = !0,
  32363. t = this.tn.next()),
  32364. !a.TYPEREF.test(t))
  32365. throw Error("illegal rpc service request type: " + t);
  32366. if (n.request = t,
  32367. this.tn.skip(")"),
  32368. "returns" !== (t = this.tn.next()).toLowerCase())
  32369. throw Error("illegal rpc service request type delimiter: " + t);
  32370. if (this.tn.skip("("),
  32371. "stream" === (t = this.tn.next()).toLowerCase() && (n.response_stream = !0,
  32372. t = this.tn.next()),
  32373. n.response = t,
  32374. this.tn.skip(")"),
  32375. "{" === (t = this.tn.peek())) {
  32376. for (this.tn.next(); "}" !== (t = this.tn.next()); ) {
  32377. if ("option" !== t)
  32378. throw Error("illegal rpc service token: " + t);
  32379. this._parseOption(n)
  32380. }
  32381. this.tn.omit(";")
  32382. } else
  32383. this.tn.skip(";");
  32384. void 0 === e.rpc && (e.rpc = {}),
  32385. e.rpc[i] = n
  32386. }
  32387. ,
  32388. c._parseMessage = function(e, t) {
  32389. var i = !!t
  32390. , n = this.tn.next()
  32391. , r = {
  32392. name: "",
  32393. fields: [],
  32394. enums: [],
  32395. messages: [],
  32396. options: {},
  32397. services: [],
  32398. oneofs: {}
  32399. };
  32400. if (!a.NAME.test(n))
  32401. throw Error("illegal " + (i ? "group" : "message") + " name: " + n);
  32402. for (r.name = n,
  32403. i && (this.tn.skip("="),
  32404. t.id = s(this.tn.next()),
  32405. r.isGroup = !0),
  32406. "[" === (n = this.tn.peek()) && t && this._parseFieldOptions(t),
  32407. this.tn.skip("{"); "}" !== (n = this.tn.next()); )
  32408. if (a.RULE.test(n))
  32409. this._parseMessageField(r, n);
  32410. else if ("oneof" === n)
  32411. this._parseMessageOneOf(r);
  32412. else if ("enum" === n)
  32413. this._parseEnum(r);
  32414. else if ("message" === n)
  32415. this._parseMessage(r);
  32416. else if ("option" === n)
  32417. this._parseOption(r);
  32418. else if ("service" === n)
  32419. this._parseService(r);
  32420. else if ("extensions" === n)
  32421. r.extensions = this._parseExtensionRanges();
  32422. else if ("reserved" === n)
  32423. this._parseIgnored();
  32424. else if ("extend" === n)
  32425. this._parseExtend(r);
  32426. else {
  32427. if (!a.TYPEREF.test(n))
  32428. throw Error("illegal message token: " + n);
  32429. if (!this.proto3)
  32430. throw Error("illegal field rule: " + n);
  32431. this._parseMessageField(r, "optional", n)
  32432. }
  32433. return this.tn.omit(";"),
  32434. e.messages.push(r),
  32435. r
  32436. }
  32437. ,
  32438. c._parseIgnored = function() {
  32439. for (; ";" !== this.tn.peek(); )
  32440. this.tn.next();
  32441. this.tn.skip(";")
  32442. }
  32443. ,
  32444. c._parseMessageField = function(e, t, i) {
  32445. if (!a.RULE.test(t))
  32446. throw Error("illegal message field rule: " + t);
  32447. var n, r = {
  32448. rule: t,
  32449. type: "",
  32450. name: "",
  32451. options: {},
  32452. id: 0
  32453. };
  32454. if ("map" === t) {
  32455. if (i)
  32456. throw Error("illegal type: " + i);
  32457. if (this.tn.skip("<"),
  32458. n = this.tn.next(),
  32459. !a.TYPE.test(n) && !a.TYPEREF.test(n))
  32460. throw Error("illegal message field type: " + n);
  32461. if (r.keytype = n,
  32462. this.tn.skip(","),
  32463. n = this.tn.next(),
  32464. !a.TYPE.test(n) && !a.TYPEREF.test(n))
  32465. throw Error("illegal message field: " + n);
  32466. if (r.type = n,
  32467. this.tn.skip(">"),
  32468. n = this.tn.next(),
  32469. !a.NAME.test(n))
  32470. throw Error("illegal message field name: " + n);
  32471. r.name = n,
  32472. this.tn.skip("="),
  32473. r.id = s(this.tn.next()),
  32474. "[" === (n = this.tn.peek()) && this._parseFieldOptions(r),
  32475. this.tn.skip(";")
  32476. } else if ("group" === (i = void 0 !== i ? i : this.tn.next())) {
  32477. var o = this._parseMessage(e, r);
  32478. if (!/^[A-Z]/.test(o.name))
  32479. throw Error("illegal group name: " + o.name);
  32480. r.type = o.name,
  32481. r.name = o.name.toLowerCase(),
  32482. this.tn.omit(";")
  32483. } else {
  32484. if (!a.TYPE.test(i) && !a.TYPEREF.test(i))
  32485. throw Error("illegal message field type: " + i);
  32486. if (r.type = i,
  32487. n = this.tn.next(),
  32488. !a.NAME.test(n))
  32489. throw Error("illegal message field name: " + n);
  32490. r.name = n,
  32491. this.tn.skip("="),
  32492. r.id = s(this.tn.next()),
  32493. "[" === (n = this.tn.peek()) && this._parseFieldOptions(r),
  32494. this.tn.skip(";")
  32495. }
  32496. return e.fields.push(r),
  32497. r
  32498. }
  32499. ,
  32500. c._parseMessageOneOf = function(e) {
  32501. var t = this.tn.next();
  32502. if (!a.NAME.test(t))
  32503. throw Error("illegal oneof name: " + t);
  32504. var i, n = t, r = [];
  32505. for (this.tn.skip("{"); "}" !== (t = this.tn.next()); )
  32506. (i = this._parseMessageField(e, "optional", t)).oneof = n,
  32507. r.push(i.id);
  32508. this.tn.omit(";"),
  32509. e.oneofs[n] = r
  32510. }
  32511. ,
  32512. c._parseFieldOptions = function(e) {
  32513. this.tn.skip("[");
  32514. for (var t = !0; "]" !== this.tn.peek(); )
  32515. t || this.tn.skip(","),
  32516. this._parseOption(e, !0),
  32517. t = !1;
  32518. this.tn.next()
  32519. }
  32520. ,
  32521. c._parseEnum = function(e) {
  32522. var t = {
  32523. name: "",
  32524. values: [],
  32525. options: {}
  32526. }
  32527. , i = this.tn.next();
  32528. if (!a.NAME.test(i))
  32529. throw Error("illegal name: " + i);
  32530. for (t.name = i,
  32531. this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  32532. if ("option" === i)
  32533. this._parseOption(t);
  32534. else {
  32535. if (!a.NAME.test(i))
  32536. throw Error("illegal name: " + i);
  32537. this.tn.skip("=");
  32538. var n = {
  32539. name: i,
  32540. id: s(this.tn.next(), !0)
  32541. };
  32542. "[" === (i = this.tn.peek()) && this._parseFieldOptions({
  32543. options: {}
  32544. }),
  32545. this.tn.skip(";"),
  32546. t.values.push(n)
  32547. }
  32548. this.tn.omit(";"),
  32549. e.enums.push(t)
  32550. }
  32551. ,
  32552. c._parseExtensionRanges = function() {
  32553. var e, t, i, n = [];
  32554. do {
  32555. for (t = []; ; ) {
  32556. switch (e = this.tn.next()) {
  32557. case "min":
  32558. i = r.ID_MIN;
  32559. break;
  32560. case "max":
  32561. i = r.ID_MAX;
  32562. break;
  32563. default:
  32564. i = o(e)
  32565. }
  32566. if (t.push(i),
  32567. 2 === t.length)
  32568. break;
  32569. if ("to" !== this.tn.peek()) {
  32570. t.push(i);
  32571. break
  32572. }
  32573. this.tn.next()
  32574. }
  32575. n.push(t)
  32576. } while (this.tn.omit(","));return this.tn.skip(";"),
  32577. n
  32578. }
  32579. ,
  32580. c._parseExtend = function(e) {
  32581. var t = this.tn.next();
  32582. if (!a.TYPEREF.test(t))
  32583. throw Error("illegal extend reference: " + t);
  32584. var i = {
  32585. ref: t,
  32586. fields: []
  32587. };
  32588. for (this.tn.skip("{"); "}" !== (t = this.tn.next()); )
  32589. if (a.RULE.test(t))
  32590. this._parseMessageField(i, t);
  32591. else {
  32592. if (!a.TYPEREF.test(t))
  32593. throw Error("illegal extend token: " + t);
  32594. if (!this.proto3)
  32595. throw Error("illegal field rule: " + t);
  32596. this._parseMessageField(i, "optional", t)
  32597. }
  32598. return this.tn.omit(";"),
  32599. e.messages.push(i),
  32600. i
  32601. }
  32602. ,
  32603. c.toString = function() {
  32604. return "Parser at line " + this.tn.line
  32605. }
  32606. ,
  32607. e.Parser = l,
  32608. e
  32609. }(o, o.Lang),
  32610. o.Reflect = function(g) {
  32611. function a(e, t) {
  32612. if (e && "number" == typeof e.low && "number" == typeof e.high && "boolean" == typeof e.unsigned && e.low == e.low && e.high == e.high)
  32613. return new g.Long(e.low,e.high,void 0 === t ? e.unsigned : t);
  32614. if ("string" == typeof e)
  32615. return g.Long.fromString(e, t || !1, 10);
  32616. if ("number" == typeof e)
  32617. return g.Long.fromNumber(e, t || !1);
  32618. throw Error("not convertible to Long")
  32619. }
  32620. function m(e, t) {
  32621. var i = t.readVarint32()
  32622. , n = 7 & i
  32623. , r = i >>> 3;
  32624. switch (n) {
  32625. case g.WIRE_TYPES.VARINT:
  32626. for (; 128 == (128 & (i = t.readUint8())); )
  32627. ;
  32628. break;
  32629. case g.WIRE_TYPES.BITS64:
  32630. t.offset += 8;
  32631. break;
  32632. case g.WIRE_TYPES.LDELIM:
  32633. i = t.readVarint32(),
  32634. t.offset += i;
  32635. break;
  32636. case g.WIRE_TYPES.STARTGROUP:
  32637. m(r, t);
  32638. break;
  32639. case g.WIRE_TYPES.ENDGROUP:
  32640. if (r === e)
  32641. return !1;
  32642. throw Error("Illegal GROUPEND after unknown group: " + r + " (" + e + " expected)");
  32643. case g.WIRE_TYPES.BITS32:
  32644. t.offset += 4;
  32645. break;
  32646. default:
  32647. throw Error("Illegal wire type in unknown group " + e + ": " + n)
  32648. }
  32649. return !0
  32650. }
  32651. function h(e, t, i) {
  32652. this.builder = e,
  32653. this.parent = t,
  32654. this.name = i,
  32655. this.className
  32656. }
  32657. var s = {}
  32658. , e = h.prototype;
  32659. e.fqn = function() {
  32660. for (var e = this.name, t = this; null != (t = t.parent); )
  32661. e = t.name + "." + e;
  32662. return e
  32663. }
  32664. ,
  32665. e.toString = function(e) {
  32666. return (e ? this.className + " " : "") + this.fqn()
  32667. }
  32668. ,
  32669. e.build = function() {
  32670. throw Error(this.toString(!0) + " cannot be built directly")
  32671. }
  32672. ,
  32673. s.T = h;
  32674. function l(e, t, i, n, r) {
  32675. h.call(this, e, t, i),
  32676. this.className = "Namespace",
  32677. this.children = [],
  32678. this.options = n || {},
  32679. this.syntax = r || "proto2"
  32680. }
  32681. var t = l.prototype = Object.create(h.prototype);
  32682. t.getChildren = function(e) {
  32683. if (null == (e = e || null))
  32684. return this.children.slice();
  32685. for (var t = [], i = 0, n = this.children.length; i < n; ++i)
  32686. this.children[i]instanceof e && t.push(this.children[i]);
  32687. return t
  32688. }
  32689. ,
  32690. t.addChild = function(e) {
  32691. var t;
  32692. if (t = this.getChild(e.name))
  32693. if (t instanceof d.Field && t.name !== t.originalName && null === this.getChild(t.originalName))
  32694. t.name = t.originalName;
  32695. else {
  32696. if (!(e instanceof d.Field && e.name !== e.originalName && null === this.getChild(e.originalName)))
  32697. throw Error("Duplicate name in namespace " + this.toString(!0) + ": " + e.name);
  32698. e.name = e.originalName
  32699. }
  32700. this.children.push(e)
  32701. }
  32702. ,
  32703. t.getChild = function(e) {
  32704. for (var t = "number" == typeof e ? "id" : "name", i = 0, n = this.children.length; i < n; ++i)
  32705. if (this.children[i][t] === e)
  32706. return this.children[i];
  32707. return null
  32708. }
  32709. ,
  32710. t.resolve = function(e, t) {
  32711. var i, n = "string" == typeof e ? e.split(".") : e, r = this, o = 0;
  32712. if ("" === n[o]) {
  32713. for (; null !== r.parent; )
  32714. r = r.parent;
  32715. o++
  32716. }
  32717. do {
  32718. do {
  32719. if (!(r instanceof s.Namespace)) {
  32720. r = null;
  32721. break
  32722. }
  32723. if (!(i = r.getChild(n[o])) || !(i instanceof s.T) || t && !(i instanceof s.Namespace)) {
  32724. r = null;
  32725. break
  32726. }
  32727. r = i,
  32728. o++
  32729. } while (o < n.length);if (null != r)
  32730. break;
  32731. if (null !== this.parent)
  32732. return this.parent.resolve(e, t)
  32733. } while (null != r);return r
  32734. }
  32735. ,
  32736. t.qn = function(e) {
  32737. for (var t = [], i = e; t.unshift(i.name),
  32738. null !== (i = i.parent); )
  32739. ;
  32740. for (var n = 1; n <= t.length; n++) {
  32741. var r = t.slice(t.length - n);
  32742. if (e === this.resolve(r, e instanceof s.Namespace))
  32743. return r.join(".")
  32744. }
  32745. return e.fqn()
  32746. }
  32747. ,
  32748. t.build = function() {
  32749. for (var e, t = {}, i = this.children, n = 0, r = i.length; n < r; ++n)
  32750. (e = i[n])instanceof l && (t[e.name] = e.build());
  32751. return Object.defineProperty && Object.defineProperty(t, "$options", {
  32752. value: this.buildOpt()
  32753. }),
  32754. t
  32755. }
  32756. ,
  32757. t.buildOpt = function() {
  32758. for (var e = {}, t = Object.keys(this.options), i = 0, n = t.length; i < n; ++i) {
  32759. var r = t[i]
  32760. , o = this.options[t[i]];
  32761. e[r] = o
  32762. }
  32763. return e
  32764. }
  32765. ,
  32766. t.getOption = function(e) {
  32767. return void 0 === e ? this.options : void 0 !== this.options[e] ? this.options[e] : null
  32768. }
  32769. ,
  32770. s.Namespace = l;
  32771. function u(e, t, i, n) {
  32772. if (this.type = e,
  32773. this.resolvedType = t,
  32774. this.isMapKey = i,
  32775. this.syntax = n,
  32776. i && g.MAP_KEY_TYPES.indexOf(e) < 0)
  32777. throw Error("Invalid map key type: " + e.name)
  32778. }
  32779. var i = u.prototype;
  32780. u.defaultFieldValue = function(e) {
  32781. if ("string" == typeof e && (e = g.TYPES[e]),
  32782. void 0 === e.defaultValue)
  32783. throw Error("default value for type " + e.name + " is not supported");
  32784. return e == g.TYPES.bytes ? new I(0) : e.defaultValue
  32785. }
  32786. ,
  32787. i.verifyValue = function(t) {
  32788. function i(e, t) {
  32789. throw Error("Illegal value for " + n.toString(!0) + " of type " + n.type.name + ": " + e + " (" + t + ")")
  32790. }
  32791. var n = this;
  32792. switch (this.type) {
  32793. case g.TYPES.int32:
  32794. case g.TYPES.sint32:
  32795. case g.TYPES.sfixed32:
  32796. return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"),
  32797. 4294967295 < t ? 0 | t : t;
  32798. case g.TYPES.uint32:
  32799. case g.TYPES.fixed32:
  32800. return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"),
  32801. t < 0 ? t >>> 0 : t;
  32802. case g.TYPES.int64:
  32803. case g.TYPES.sint64:
  32804. case g.TYPES.sfixed64:
  32805. if (g.Long)
  32806. try {
  32807. return a(t, !1)
  32808. } catch (e) {
  32809. i(typeof t, e.message)
  32810. }
  32811. else
  32812. i(typeof t, "requires Long.js");
  32813. case g.TYPES.uint64:
  32814. case g.TYPES.fixed64:
  32815. if (g.Long)
  32816. try {
  32817. return a(t, !0)
  32818. } catch (e) {
  32819. i(typeof t, e.message)
  32820. }
  32821. else
  32822. i(typeof t, "requires Long.js");
  32823. case g.TYPES.bool:
  32824. return "boolean" != typeof t && i(typeof t, "not a boolean"),
  32825. t;
  32826. case g.TYPES.float:
  32827. case g.TYPES.double:
  32828. return "number" != typeof t && i(typeof t, "not a number"),
  32829. t;
  32830. case g.TYPES.string:
  32831. return "string" == typeof t || t && t instanceof String || i(typeof t, "not a string"),
  32832. "" + t;
  32833. case g.TYPES.bytes:
  32834. return I.isByteBuffer(t) ? t : I.wrap(t, "base64");
  32835. case g.TYPES.enum:
  32836. var e = this.resolvedType.getChildren(g.Reflect.Enum.Value);
  32837. for (o = 0; o < e.length; o++) {
  32838. if (e[o].name == t)
  32839. return e[o].id;
  32840. if (e[o].id == t)
  32841. return e[o].id
  32842. }
  32843. if ("proto3" === this.syntax)
  32844. return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"),
  32845. (4294967295 < t || t < 0) && i(typeof t, "not in range for uint32"),
  32846. t;
  32847. i(t, "not a valid enum value");
  32848. case g.TYPES.group:
  32849. case g.TYPES.message:
  32850. if (t && "object" == typeof t || i(typeof t, "object expected"),
  32851. t instanceof this.resolvedType.clazz)
  32852. return t;
  32853. if (t instanceof g.Builder.Message) {
  32854. var r = {};
  32855. for (var o in t)
  32856. t.hasOwnProperty(o) && (r[o] = t[o]);
  32857. t = r
  32858. }
  32859. return new this.resolvedType.clazz(t)
  32860. }
  32861. throw Error("[INTERNAL] Illegal value for " + this.toString(!0) + ": " + t + " (undefined type " + this.type + ")")
  32862. }
  32863. ,
  32864. i.calculateLength = function(e, t) {
  32865. if (null === t)
  32866. return 0;
  32867. var i;
  32868. switch (this.type) {
  32869. case g.TYPES.int32:
  32870. return t < 0 ? I.calculateVarint64(t) : I.calculateVarint32(t);
  32871. case g.TYPES.uint32:
  32872. return I.calculateVarint32(t);
  32873. case g.TYPES.sint32:
  32874. return I.calculateVarint32(I.zigZagEncode32(t));
  32875. case g.TYPES.fixed32:
  32876. case g.TYPES.sfixed32:
  32877. case g.TYPES.float:
  32878. return 4;
  32879. case g.TYPES.int64:
  32880. case g.TYPES.uint64:
  32881. return I.calculateVarint64(t);
  32882. case g.TYPES.sint64:
  32883. return I.calculateVarint64(I.zigZagEncode64(t));
  32884. case g.TYPES.fixed64:
  32885. case g.TYPES.sfixed64:
  32886. return 8;
  32887. case g.TYPES.bool:
  32888. return 1;
  32889. case g.TYPES.enum:
  32890. return I.calculateVarint32(t);
  32891. case g.TYPES.double:
  32892. return 8;
  32893. case g.TYPES.string:
  32894. return i = I.calculateUTF8Bytes(t),
  32895. I.calculateVarint32(i) + i;
  32896. case g.TYPES.bytes:
  32897. if (t.remaining() < 0)
  32898. throw Error("Illegal value for " + this.toString(!0) + ": " + t.remaining() + " bytes remaining");
  32899. return I.calculateVarint32(t.remaining()) + t.remaining();
  32900. case g.TYPES.message:
  32901. return i = this.resolvedType.calculate(t),
  32902. I.calculateVarint32(i) + i;
  32903. case g.TYPES.group:
  32904. return (i = this.resolvedType.calculate(t)) + I.calculateVarint32(e << 3 | g.WIRE_TYPES.ENDGROUP)
  32905. }
  32906. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + t + " (unknown type)")
  32907. }
  32908. ,
  32909. i.encodeValue = function(e, t, i) {
  32910. if (null === t)
  32911. return i;
  32912. switch (this.type) {
  32913. case g.TYPES.int32:
  32914. t < 0 ? i.writeVarint64(t) : i.writeVarint32(t);
  32915. break;
  32916. case g.TYPES.uint32:
  32917. i.writeVarint32(t);
  32918. break;
  32919. case g.TYPES.sint32:
  32920. i.writeVarint32ZigZag(t);
  32921. break;
  32922. case g.TYPES.fixed32:
  32923. i.writeUint32(t);
  32924. break;
  32925. case g.TYPES.sfixed32:
  32926. i.writeInt32(t);
  32927. break;
  32928. case g.TYPES.int64:
  32929. case g.TYPES.uint64:
  32930. i.writeVarint64(t);
  32931. break;
  32932. case g.TYPES.sint64:
  32933. i.writeVarint64ZigZag(t);
  32934. break;
  32935. case g.TYPES.fixed64:
  32936. i.writeUint64(t);
  32937. break;
  32938. case g.TYPES.sfixed64:
  32939. i.writeInt64(t);
  32940. break;
  32941. case g.TYPES.bool:
  32942. "string" == typeof t ? i.writeVarint32("false" === t.toLowerCase() ? 0 : !!t) : i.writeVarint32(t ? 1 : 0);
  32943. break;
  32944. case g.TYPES.enum:
  32945. i.writeVarint32(t);
  32946. break;
  32947. case g.TYPES.float:
  32948. i.writeFloat32(t);
  32949. break;
  32950. case g.TYPES.double:
  32951. i.writeFloat64(t);
  32952. break;
  32953. case g.TYPES.string:
  32954. i.writeVString(t);
  32955. break;
  32956. case g.TYPES.bytes:
  32957. if (t.remaining() < 0)
  32958. throw Error("Illegal value for " + this.toString(!0) + ": " + t.remaining() + " bytes remaining");
  32959. var n = t.offset;
  32960. i.writeVarint32(t.remaining()),
  32961. i.append(t),
  32962. t.offset = n;
  32963. break;
  32964. case g.TYPES.message:
  32965. var r = (new I).LE();
  32966. this.resolvedType.encode(t, r),
  32967. i.writeVarint32(r.offset),
  32968. i.append(r.flip());
  32969. break;
  32970. case g.TYPES.group:
  32971. this.resolvedType.encode(t, i),
  32972. i.writeVarint32(e << 3 | g.WIRE_TYPES.ENDGROUP);
  32973. break;
  32974. default:
  32975. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + t + " (unknown type)")
  32976. }
  32977. return i
  32978. }
  32979. ,
  32980. i.decode = function(e, t, i) {
  32981. if (t != this.type.wireType)
  32982. throw Error("Unexpected wire type for element");
  32983. var n, r;
  32984. switch (this.type) {
  32985. case g.TYPES.int32:
  32986. return 0 | e.readVarint32();
  32987. case g.TYPES.uint32:
  32988. return e.readVarint32() >>> 0;
  32989. case g.TYPES.sint32:
  32990. return 0 | e.readVarint32ZigZag();
  32991. case g.TYPES.fixed32:
  32992. return e.readUint32() >>> 0;
  32993. case g.TYPES.sfixed32:
  32994. return 0 | e.readInt32();
  32995. case g.TYPES.int64:
  32996. return e.readVarint64();
  32997. case g.TYPES.uint64:
  32998. return e.readVarint64().toUnsigned();
  32999. case g.TYPES.sint64:
  33000. return e.readVarint64ZigZag();
  33001. case g.TYPES.fixed64:
  33002. return e.readUint64();
  33003. case g.TYPES.sfixed64:
  33004. return e.readInt64();
  33005. case g.TYPES.bool:
  33006. return !!e.readVarint32();
  33007. case g.TYPES.enum:
  33008. return e.readVarint32();
  33009. case g.TYPES.float:
  33010. return e.readFloat();
  33011. case g.TYPES.double:
  33012. return e.readDouble();
  33013. case g.TYPES.string:
  33014. return e.readVString();
  33015. case g.TYPES.bytes:
  33016. if (r = e.readVarint32(),
  33017. e.remaining() < r)
  33018. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + r + " required but got only " + e.remaining());
  33019. return (n = e.clone()).limit = n.offset + r,
  33020. e.offset += r,
  33021. n;
  33022. case g.TYPES.message:
  33023. return r = e.readVarint32(),
  33024. this.resolvedType.decode(e, r);
  33025. case g.TYPES.group:
  33026. return this.resolvedType.decode(e, -1, i)
  33027. }
  33028. throw Error("[INTERNAL] Illegal decode type")
  33029. }
  33030. ,
  33031. i.valueFromString = function(e) {
  33032. if (!this.isMapKey)
  33033. throw Error("valueFromString() called on non-map-key element");
  33034. switch (this.type) {
  33035. case g.TYPES.int32:
  33036. case g.TYPES.sint32:
  33037. case g.TYPES.sfixed32:
  33038. case g.TYPES.uint32:
  33039. case g.TYPES.fixed32:
  33040. return this.verifyValue(parseInt(e));
  33041. case g.TYPES.int64:
  33042. case g.TYPES.sint64:
  33043. case g.TYPES.sfixed64:
  33044. case g.TYPES.uint64:
  33045. case g.TYPES.fixed64:
  33046. return this.verifyValue(e);
  33047. case g.TYPES.bool:
  33048. return "true" === e;
  33049. case g.TYPES.string:
  33050. return this.verifyValue(e);
  33051. case g.TYPES.bytes:
  33052. return I.fromBinary(e)
  33053. }
  33054. }
  33055. ,
  33056. i.valueToString = function(e) {
  33057. if (!this.isMapKey)
  33058. throw Error("valueToString() called on non-map-key element");
  33059. return this.type === g.TYPES.bytes ? e.toString("binary") : e.toString()
  33060. }
  33061. ,
  33062. s.Element = u;
  33063. var d = function(e, t, i, n, r, o) {
  33064. l.call(this, e, t, i, n, o),
  33065. this.className = "Message",
  33066. this.extensions = void 0,
  33067. this.clazz = null,
  33068. this.isGroup = !!r,
  33069. this._fields = null,
  33070. this._fieldsById = null,
  33071. this._fieldsByName = null
  33072. }
  33073. , n = d.prototype = Object.create(l.prototype);
  33074. n.build = function(e) {
  33075. if (this.clazz && !e)
  33076. return this.clazz;
  33077. var t = function(u, a) {
  33078. function d(e, i, n, r) {
  33079. if (null === e || "object" != typeof e) {
  33080. if (r && r instanceof u.Reflect.Enum) {
  33081. var t = u.Reflect.Enum.getName(r.object, e);
  33082. if (null !== t)
  33083. return t
  33084. }
  33085. return e
  33086. }
  33087. if (I.isByteBuffer(e))
  33088. return i ? e.toBase64() : e.toBuffer();
  33089. if (u.Long.isLong(e))
  33090. return n ? e.toString() : u.Long.fromValue(e);
  33091. var o;
  33092. if (Array.isArray(e))
  33093. return o = [],
  33094. e.forEach(function(e, t) {
  33095. o[t] = d(e, i, n, r)
  33096. }),
  33097. o;
  33098. if (o = {},
  33099. e instanceof u.Map) {
  33100. for (var a = e.entries(), s = a.next(); !s.done; s = a.next())
  33101. o[e.keyElem.valueToString(s.value[0])] = d(s.value[1], i, n, e.valueElem.resolvedType);
  33102. return o
  33103. }
  33104. var l = e.$type
  33105. , c = void 0;
  33106. for (var h in e)
  33107. e.hasOwnProperty(h) && (l && (c = l.getChild(h)) ? o[h] = d(e[h], i, n, c.resolvedType) : o[h] = d(e[h], i, n));
  33108. return o
  33109. }
  33110. var s = a.getChildren(u.Reflect.Message.Field)
  33111. , l = a.getChildren(u.Reflect.Message.OneOf)
  33112. , c = function(e, t) {
  33113. u.Builder.Message.call(this);
  33114. for (var i = 0, n = l.length; i < n; ++i)
  33115. this[l[i].name] = null;
  33116. for (i = 0,
  33117. n = s.length; i < n; ++i) {
  33118. var r = s[i];
  33119. this[r.name] = r.repeated ? [] : r.map ? new u.Map(r) : null,
  33120. !r.required && "proto3" !== a.syntax || null === r.defaultValue || (this[r.name] = r.defaultValue)
  33121. }
  33122. var o;
  33123. if (0 < arguments.length)
  33124. 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)
  33125. for (i = 0,
  33126. n = arguments.length; i < n; ++i)
  33127. void 0 !== (o = arguments[i]) && this.$set(s[i].name, o);
  33128. else
  33129. this.$set(e)
  33130. }
  33131. , o = c.prototype = Object.create(u.Builder.Message.prototype);
  33132. o.add = function(e, t, i) {
  33133. var n = a._fieldsByName[e];
  33134. if (!i) {
  33135. if (!n)
  33136. throw Error(this + "#" + e + " is undefined");
  33137. if (!(n instanceof u.Reflect.Message.Field))
  33138. throw Error(this + "#" + e + " is not a field: " + n.toString(!0));
  33139. if (!n.repeated)
  33140. throw Error(this + "#" + e + " is not a repeated field");
  33141. t = n.verifyValue(t, !0)
  33142. }
  33143. return null === this[e] && (this[e] = []),
  33144. this[e].push(t),
  33145. this
  33146. }
  33147. ,
  33148. o.$add = o.add,
  33149. o.set = function(e, t, i) {
  33150. if (e && "object" == typeof e) {
  33151. for (var n in i = t,
  33152. e)
  33153. e.hasOwnProperty(n) && void 0 !== (t = e[n]) && this.$set(n, t, i);
  33154. return this
  33155. }
  33156. var r = a._fieldsByName[e];
  33157. if (i)
  33158. this[e] = t;
  33159. else {
  33160. if (!r)
  33161. throw Error(this + "#" + e + " is not a field: undefined");
  33162. if (!(r instanceof u.Reflect.Message.Field))
  33163. throw Error(this + "#" + e + " is not a field: " + r.toString(!0));
  33164. this[r.name] = t = r.verifyValue(t)
  33165. }
  33166. if (r && r.oneof) {
  33167. var o = this[r.oneof.name];
  33168. null !== t ? (null !== o && o !== r.name && (this[o] = null),
  33169. this[r.oneof.name] = r.name) : o === e && (this[r.oneof.name] = null)
  33170. }
  33171. return this
  33172. }
  33173. ,
  33174. o.$set = o.set,
  33175. o.get = function(e, t) {
  33176. if (t)
  33177. return this[e];
  33178. var i = a._fieldsByName[e];
  33179. if (!(i && i instanceof u.Reflect.Message.Field))
  33180. throw Error(this + "#" + e + " is not a field: undefined");
  33181. if (!(i instanceof u.Reflect.Message.Field))
  33182. throw Error(this + "#" + e + " is not a field: " + i.toString(!0));
  33183. return this[i.name]
  33184. }
  33185. ,
  33186. o.$get = o.get;
  33187. for (var e = 0; e < s.length; e++) {
  33188. var t = s[e];
  33189. t instanceof u.Reflect.Message.ExtensionField || a.builder.options.populateAccessors && function(i) {
  33190. var e = i.originalName.replace(/(_[a-zA-Z])/g, function(e) {
  33191. return e.toUpperCase().replace("_", "")
  33192. });
  33193. e = e.substring(0, 1).toUpperCase() + e.substring(1);
  33194. function t(e, t) {
  33195. return this[i.name] = t ? e : i.verifyValue(e),
  33196. this
  33197. }
  33198. function n() {
  33199. return this[i.name]
  33200. }
  33201. var r = i.originalName.replace(/([A-Z])/g, function(e) {
  33202. return "_" + e
  33203. });
  33204. null === a.getChild("set" + e) && (o["set" + e] = t),
  33205. null === a.getChild("set_" + r) && (o["set_" + r] = t),
  33206. null === a.getChild("get" + e) && (o["get" + e] = n),
  33207. null === a.getChild("get_" + r) && (o["get_" + r] = n)
  33208. }(t)
  33209. }
  33210. return o.encode = function(t, e) {
  33211. "boolean" == typeof t && (e = t,
  33212. t = void 0);
  33213. var i = !1;
  33214. t || (t = new I,
  33215. i = !0);
  33216. var n = t.littleEndian;
  33217. try {
  33218. return a.encode(this, t.LE(), e),
  33219. (i ? t.flip() : t).LE(n)
  33220. } catch (e) {
  33221. throw t.LE(n),
  33222. e
  33223. }
  33224. }
  33225. ,
  33226. c.encode = function(e, t, i) {
  33227. return new c(e).encode(t, i)
  33228. }
  33229. ,
  33230. o.calculate = function() {
  33231. return a.calculate(this)
  33232. }
  33233. ,
  33234. o.encodeDelimited = function(e, t) {
  33235. var i = !1;
  33236. e || (e = new I,
  33237. i = !0);
  33238. var n = (new I).LE();
  33239. return a.encode(this, n, t).flip(),
  33240. e.writeVarint32(n.remaining()),
  33241. e.append(n),
  33242. i ? e.flip() : e
  33243. }
  33244. ,
  33245. o.encodeAB = function() {
  33246. try {
  33247. return this.encode().toArrayBuffer()
  33248. } catch (e) {
  33249. throw e.encoded && (e.encoded = e.encoded.toArrayBuffer()),
  33250. e
  33251. }
  33252. }
  33253. ,
  33254. o.toArrayBuffer = o.encodeAB,
  33255. o.encodeNB = function() {
  33256. try {
  33257. return this.encode().toBuffer()
  33258. } catch (e) {
  33259. throw e.encoded && (e.encoded = e.encoded.toBuffer()),
  33260. e
  33261. }
  33262. }
  33263. ,
  33264. o.toBuffer = o.encodeNB,
  33265. o.encode64 = function() {
  33266. try {
  33267. return this.encode().toBase64()
  33268. } catch (e) {
  33269. throw e.encoded && (e.encoded = e.encoded.toBase64()),
  33270. e
  33271. }
  33272. }
  33273. ,
  33274. o.toBase64 = o.encode64,
  33275. o.encodeHex = function() {
  33276. try {
  33277. return this.encode().toHex()
  33278. } catch (e) {
  33279. throw e.encoded && (e.encoded = e.encoded.toHex()),
  33280. e
  33281. }
  33282. }
  33283. ,
  33284. o.toHex = o.encodeHex,
  33285. o.toRaw = function(e, t) {
  33286. return d(this, !!e, !!t, this.$type)
  33287. }
  33288. ,
  33289. o.encodeJSON = function() {
  33290. return JSON.stringify(d(this, !0, !0, this.$type))
  33291. }
  33292. ,
  33293. c.decode = function(t, e, i) {
  33294. "string" == typeof e && (i = e,
  33295. e = -1),
  33296. "string" == typeof t && (t = I.wrap(t, i || "base64"));
  33297. var n = (t = I.isByteBuffer(t) ? t : I.wrap(t)).littleEndian;
  33298. try {
  33299. var r = a.decode(t.LE());
  33300. return t.LE(n),
  33301. r
  33302. } catch (e) {
  33303. throw t.LE(n),
  33304. e
  33305. }
  33306. }
  33307. ,
  33308. c.decodeDelimited = function(t, e) {
  33309. if ("string" == typeof t && (t = I.wrap(t, e || "base64")),
  33310. (t = I.isByteBuffer(t) ? t : I.wrap(t)).remaining() < 1)
  33311. return null;
  33312. var i = t.offset
  33313. , n = t.readVarint32();
  33314. if (t.remaining() < n)
  33315. return t.offset = i,
  33316. null;
  33317. try {
  33318. var r = a.decode(t.slice(t.offset, t.offset + n).LE());
  33319. return t.offset += n,
  33320. r
  33321. } catch (e) {
  33322. throw t.offset += n,
  33323. e
  33324. }
  33325. }
  33326. ,
  33327. c.decode64 = function(e) {
  33328. return c.decode(e, "base64")
  33329. }
  33330. ,
  33331. c.decodeHex = function(e) {
  33332. return c.decode(e, "hex")
  33333. }
  33334. ,
  33335. c.decodeJSON = function(e) {
  33336. return new c(JSON.parse(e))
  33337. }
  33338. ,
  33339. o.toString = function() {
  33340. return a.toString()
  33341. }
  33342. ,
  33343. Object.defineProperty && (Object.defineProperty(c, "$options", {
  33344. value: a.buildOpt()
  33345. }),
  33346. Object.defineProperty(o, "$options", {
  33347. value: c.$options
  33348. }),
  33349. Object.defineProperty(c, "$type", {
  33350. value: a
  33351. }),
  33352. Object.defineProperty(o, "$type", {
  33353. value: a
  33354. })),
  33355. c
  33356. }(g, this);
  33357. this._fields = [],
  33358. this._fieldsById = {},
  33359. this._fieldsByName = {};
  33360. for (var i, n = 0, r = this.children.length; n < r; n++)
  33361. if ((i = this.children[n])instanceof p || i instanceof d || i instanceof y) {
  33362. if (t.hasOwnProperty(i.name))
  33363. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + i.toString(!0) + " cannot override static property '" + i.name + "'");
  33364. t[i.name] = i.build()
  33365. } else if (i instanceof d.Field)
  33366. i.build(),
  33367. this._fields.push(i),
  33368. this._fieldsById[i.id] = i,
  33369. this._fieldsByName[i.name] = i;
  33370. else if (!(i instanceof d.OneOf || i instanceof v))
  33371. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + this.children[n].toString(!0));
  33372. return this.clazz = t
  33373. }
  33374. ,
  33375. n.encode = function(e, t, i) {
  33376. for (var n, r, o = null, a = 0, s = this._fields.length; a < s; ++a)
  33377. r = e[(n = this._fields[a]).name],
  33378. n.required && null === r ? null === o && (o = n) : n.encode(i ? r : n.verifyValue(r), t, e);
  33379. if (null === o)
  33380. return t;
  33381. var l = Error("Missing at least one required field for " + this.toString(!0) + ": " + o);
  33382. throw l.encoded = t,
  33383. l
  33384. }
  33385. ,
  33386. n.calculate = function(e) {
  33387. for (var t, i, n = 0, r = 0, o = this._fields.length; r < o; ++r) {
  33388. if (i = e[(t = this._fields[r]).name],
  33389. t.required && null === i)
  33390. throw Error("Missing at least one required field for " + this.toString(!0) + ": " + t);
  33391. n += t.calculate(i, e)
  33392. }
  33393. return n
  33394. }
  33395. ,
  33396. n.decode = function(e, t, i) {
  33397. t = "number" == typeof t ? t : -1;
  33398. for (var n, r, o, a, s = e.offset, l = new this.clazz; e.offset < s + t || -1 === t && 0 < e.remaining(); ) {
  33399. if (o = (n = e.readVarint32()) >>> 3,
  33400. (r = 7 & n) === g.WIRE_TYPES.ENDGROUP) {
  33401. if (o !== i)
  33402. throw Error("Illegal group end indicator for " + this.toString(!0) + ": " + o + " (" + (i ? i + " expected" : "not a group") + ")");
  33403. break
  33404. }
  33405. if (a = this._fieldsById[o]) {
  33406. if (a.repeated && !a.options.packed)
  33407. l[a.name].push(a.decode(r, e));
  33408. else if (a.map) {
  33409. var c = a.decode(r, e);
  33410. l[a.name].set(c[0], c[1])
  33411. } else if (l[a.name] = a.decode(r, e),
  33412. a.oneof) {
  33413. var h = l[a.oneof.name];
  33414. null !== h && h !== a.name && (l[h] = null),
  33415. l[a.oneof.name] = a.name
  33416. }
  33417. } else
  33418. switch (r) {
  33419. case g.WIRE_TYPES.VARINT:
  33420. e.readVarint32();
  33421. break;
  33422. case g.WIRE_TYPES.BITS32:
  33423. e.offset += 4;
  33424. break;
  33425. case g.WIRE_TYPES.BITS64:
  33426. e.offset += 8;
  33427. break;
  33428. case g.WIRE_TYPES.LDELIM:
  33429. var u = e.readVarint32();
  33430. e.offset += u;
  33431. break;
  33432. case g.WIRE_TYPES.STARTGROUP:
  33433. for (; m(o, e); )
  33434. ;
  33435. break;
  33436. default:
  33437. throw Error("Illegal wire type for unknown field " + o + " in " + this.toString(!0) + "#decode: " + r)
  33438. }
  33439. }
  33440. for (var d = 0, p = this._fields.length; d < p; ++d)
  33441. if (null === l[(a = this._fields[d]).name])
  33442. if ("proto3" === this.syntax)
  33443. l[a.name] = a.defaultValue;
  33444. else {
  33445. if (a.required) {
  33446. var f = Error("Missing at least one required field for " + this.toString(!0) + ": " + a.name);
  33447. throw f.decoded = l,
  33448. f
  33449. }
  33450. g.populateDefaults && null !== a.defaultValue && (l[a.name] = a.defaultValue)
  33451. }
  33452. return l
  33453. }
  33454. ,
  33455. s.Message = d;
  33456. function c(e, t, i, n, r, o, a, s, l, c) {
  33457. h.call(this, e, t, o),
  33458. this.className = "Message.Field",
  33459. this.required = "required" === i,
  33460. this.repeated = "repeated" === i,
  33461. this.map = "map" === i,
  33462. this.keyType = n || null,
  33463. this.type = r,
  33464. this.resolvedType = null,
  33465. this.id = a,
  33466. this.options = s || {},
  33467. this.defaultValue = null,
  33468. this.oneof = l || null,
  33469. this.syntax = c || "proto2",
  33470. this.originalName = this.name,
  33471. this.element = null,
  33472. this.keyElement = null,
  33473. !this.builder.options.convertFieldsToCamelCase || this instanceof d.ExtensionField || (this.name = g.Util.toCamelCase(this.name))
  33474. }
  33475. var r = c.prototype = Object.create(h.prototype);
  33476. r.build = function() {
  33477. this.element = new u(this.type,this.resolvedType,!1,this.syntax),
  33478. this.map && (this.keyElement = new u(this.keyType,void 0,!0,this.syntax)),
  33479. "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)
  33480. }
  33481. ,
  33482. r.verifyValue = function(e, t) {
  33483. function i(e, t) {
  33484. throw Error("Illegal value for " + r.toString(!0) + " of type " + r.type.name + ": " + e + " (" + t + ")")
  33485. }
  33486. t = t || !1;
  33487. var n, r = this;
  33488. if (null === e)
  33489. return this.required && i(typeof e, "required"),
  33490. "proto3" === this.syntax && this.type !== g.TYPES.message && i(typeof e, "proto3 field without field presence cannot be null"),
  33491. null;
  33492. if (!this.repeated || t)
  33493. return this.map && !t ? e instanceof g.Map ? e : (e instanceof Object || i(typeof e, "expected ProtoBuf.Map or raw object for map field"),
  33494. new g.Map(this,e)) : (!this.repeated && Array.isArray(e) && i(typeof e, "no array expected"),
  33495. this.element.verifyValue(e));
  33496. Array.isArray(e) || (e = [e]);
  33497. var o = [];
  33498. for (n = 0; n < e.length; n++)
  33499. o.push(this.element.verifyValue(e[n]));
  33500. return o
  33501. }
  33502. ,
  33503. r.hasWirePresence = function(e, t) {
  33504. if ("proto3" !== this.syntax)
  33505. return null !== e;
  33506. if (this.oneof && t[this.oneof.name] === this.name)
  33507. return !0;
  33508. switch (this.type) {
  33509. case g.TYPES.int32:
  33510. case g.TYPES.sint32:
  33511. case g.TYPES.sfixed32:
  33512. case g.TYPES.uint32:
  33513. case g.TYPES.fixed32:
  33514. return 0 !== e;
  33515. case g.TYPES.int64:
  33516. case g.TYPES.sint64:
  33517. case g.TYPES.sfixed64:
  33518. case g.TYPES.uint64:
  33519. case g.TYPES.fixed64:
  33520. return 0 !== e.low || 0 !== e.high;
  33521. case g.TYPES.bool:
  33522. return e;
  33523. case g.TYPES.float:
  33524. case g.TYPES.double:
  33525. return 0 !== e;
  33526. case g.TYPES.string:
  33527. return 0 < e.length;
  33528. case g.TYPES.bytes:
  33529. return 0 < e.remaining();
  33530. case g.TYPES.enum:
  33531. return 0 !== e;
  33532. case g.TYPES.message:
  33533. return null !== e;
  33534. default:
  33535. return !0
  33536. }
  33537. }
  33538. ,
  33539. r.encode = function(t, r, e) {
  33540. if (null === this.type || "object" != typeof this.type)
  33541. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  33542. if (null === t || this.repeated && 0 == t.length)
  33543. return r;
  33544. try {
  33545. var i;
  33546. if (this.repeated)
  33547. if (this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)) {
  33548. r.writeVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  33549. r.ensureCapacity(r.offset += 1);
  33550. var n = r.offset;
  33551. for (i = 0; i < t.length; i++)
  33552. this.element.encodeValue(this.id, t[i], r);
  33553. var o = r.offset - n
  33554. , a = I.calculateVarint32(o);
  33555. if (1 < a) {
  33556. var s = r.slice(n, r.offset);
  33557. n += a - 1,
  33558. r.offset = n,
  33559. r.append(s)
  33560. }
  33561. r.writeVarint32(o, n - a)
  33562. } else
  33563. for (i = 0; i < t.length; i++)
  33564. r.writeVarint32(this.id << 3 | this.type.wireType),
  33565. this.element.encodeValue(this.id, t[i], r);
  33566. else
  33567. this.map ? t.forEach(function(e, t, i) {
  33568. var n = I.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, t) + I.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, e);
  33569. r.writeVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  33570. r.writeVarint32(n),
  33571. r.writeVarint32(8 | this.keyType.wireType),
  33572. this.keyElement.encodeValue(1, t, r),
  33573. r.writeVarint32(16 | this.type.wireType),
  33574. this.element.encodeValue(2, e, r)
  33575. }, this) : this.hasWirePresence(t, e) && (r.writeVarint32(this.id << 3 | this.type.wireType),
  33576. this.element.encodeValue(this.id, t, r))
  33577. } catch (e) {
  33578. throw Error("Illegal value for " + this.toString(!0) + ": " + t + " (" + e + ")")
  33579. }
  33580. return r
  33581. }
  33582. ,
  33583. r.calculate = function(t, e) {
  33584. if (t = this.verifyValue(t),
  33585. null === this.type || "object" != typeof this.type)
  33586. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  33587. if (null === t || this.repeated && 0 == t.length)
  33588. return 0;
  33589. var r = 0;
  33590. try {
  33591. var i, n;
  33592. if (this.repeated)
  33593. if (this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)) {
  33594. for (r += I.calculateVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  33595. i = n = 0; i < t.length; i++)
  33596. n += this.element.calculateLength(this.id, t[i]);
  33597. r += I.calculateVarint32(n),
  33598. r += n
  33599. } else
  33600. for (i = 0; i < t.length; i++)
  33601. r += I.calculateVarint32(this.id << 3 | this.type.wireType),
  33602. r += this.element.calculateLength(this.id, t[i]);
  33603. else
  33604. this.map ? t.forEach(function(e, t, i) {
  33605. var n = I.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, t) + I.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, e);
  33606. r += I.calculateVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  33607. r += I.calculateVarint32(n),
  33608. r += n
  33609. }, this) : this.hasWirePresence(t, e) && (r += I.calculateVarint32(this.id << 3 | this.type.wireType),
  33610. r += this.element.calculateLength(this.id, t))
  33611. } catch (e) {
  33612. throw Error("Illegal value for " + this.toString(!0) + ": " + t + " (" + e + ")")
  33613. }
  33614. return r
  33615. }
  33616. ,
  33617. r.decode = function(e, t, i) {
  33618. var n, r;
  33619. 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))
  33620. throw Error("Illegal wire type for field " + this.toString(!0) + ": " + e + " (" + this.type.wireType + " expected)");
  33621. if (e == g.WIRE_TYPES.LDELIM && this.repeated && this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) && !i) {
  33622. r = t.readVarint32(),
  33623. r = t.offset + r;
  33624. for (var o = []; t.offset < r; )
  33625. o.push(this.decode(this.type.wireType, t, !0));
  33626. return o
  33627. }
  33628. if (this.map) {
  33629. var a = u.defaultFieldValue(this.keyType);
  33630. if (n = u.defaultFieldValue(this.type),
  33631. r = t.readVarint32(),
  33632. t.remaining() < r)
  33633. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + r + " required but got only " + t.remaining());
  33634. var s = t.clone();
  33635. for (s.limit = s.offset + r,
  33636. t.offset += r; 0 < s.remaining(); ) {
  33637. var l = s.readVarint32();
  33638. e = 7 & l;
  33639. var c = l >>> 3;
  33640. if (1 == c)
  33641. a = this.keyElement.decode(s, e, c);
  33642. else {
  33643. if (2 != c)
  33644. throw Error("Unexpected tag in map field key/value submessage");
  33645. n = this.element.decode(s, e, c)
  33646. }
  33647. }
  33648. return [a, n]
  33649. }
  33650. return this.element.decode(t, e, this.id)
  33651. }
  33652. ,
  33653. s.Message.Field = c;
  33654. function o(e, t, i, n, r, o, a) {
  33655. c.call(this, e, t, i, null, n, r, o, a),
  33656. this.extension
  33657. }
  33658. o.prototype = Object.create(c.prototype),
  33659. s.Message.ExtensionField = o;
  33660. s.Message.OneOf = function(e, t, i) {
  33661. h.call(this, e, t, i),
  33662. this.fields = []
  33663. }
  33664. ;
  33665. var p = function(e, t, i, n, r) {
  33666. l.call(this, e, t, i, n, r),
  33667. this.className = "Enum",
  33668. this.object = null
  33669. };
  33670. p.getName = function(e, t) {
  33671. for (var i, n = Object.keys(e), r = 0; r < n.length; ++r)
  33672. if (e[i = n[r]] === t)
  33673. return i;
  33674. return null
  33675. }
  33676. ,
  33677. (p.prototype = Object.create(l.prototype)).build = function(e) {
  33678. if (this.object && !e)
  33679. return this.object;
  33680. for (var t = new g.Builder.Enum, i = this.getChildren(p.Value), n = 0, r = i.length; n < r; ++n)
  33681. t[i[n].name] = i[n].id;
  33682. return Object.defineProperty && Object.defineProperty(t, "$options", {
  33683. value: this.buildOpt(),
  33684. enumerable: !1
  33685. }),
  33686. this.object = t
  33687. }
  33688. ,
  33689. s.Enum = p;
  33690. function f(e, t, i, n) {
  33691. h.call(this, e, t, i),
  33692. this.className = "Enum.Value",
  33693. this.id = n
  33694. }
  33695. f.prototype = Object.create(h.prototype),
  33696. s.Enum.Value = f;
  33697. var v = function(e, t, i, n) {
  33698. h.call(this, e, t, i),
  33699. this.field = n
  33700. };
  33701. v.prototype = Object.create(h.prototype),
  33702. s.Extension = v;
  33703. var y = function(e, t, i, n) {
  33704. l.call(this, e, t, i, n),
  33705. this.className = "Service",
  33706. this.clazz = null
  33707. };
  33708. (y.prototype = Object.create(l.prototype)).build = function(e) {
  33709. return this.clazz && !e ? this.clazz : this.clazz = function(t, r) {
  33710. for (var o = function(e) {
  33711. t.Builder.Service.call(this),
  33712. this.rpcImpl = e || function(e, t, i) {
  33713. setTimeout(i.bind(this, Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")), 0)
  33714. }
  33715. }, e = o.prototype = Object.create(t.Builder.Service.prototype), i = r.getChildren(t.Reflect.Service.RPCMethod), n = 0; n < i.length; n++)
  33716. !function(n) {
  33717. e[n.name] = function(e, i) {
  33718. try {
  33719. try {
  33720. e = n.resolvedRequestType.clazz.decode(I.wrap(e))
  33721. } catch (e) {
  33722. if (!(e instanceof TypeError))
  33723. throw e
  33724. }
  33725. if (null === e || "object" != typeof e)
  33726. throw Error("Illegal arguments");
  33727. e instanceof n.resolvedRequestType.clazz || (e = new n.resolvedRequestType.clazz(e)),
  33728. this.rpcImpl(n.fqn(), e, function(e, t) {
  33729. if (!e) {
  33730. null === t && (t = "");
  33731. try {
  33732. t = n.resolvedResponseType.clazz.decode(t)
  33733. } catch (e) {}
  33734. 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))
  33735. }
  33736. i(e)
  33737. })
  33738. } catch (e) {
  33739. setTimeout(i.bind(this, e), 0)
  33740. }
  33741. }
  33742. ,
  33743. o[n.name] = function(e, t, i) {
  33744. new o(e)[n.name](t, i)
  33745. }
  33746. ,
  33747. Object.defineProperty && (Object.defineProperty(o[n.name], "$options", {
  33748. value: n.buildOpt()
  33749. }),
  33750. Object.defineProperty(e[n.name], "$options", {
  33751. value: o[n.name].$options
  33752. }))
  33753. }(i[n]);
  33754. return Object.defineProperty && (Object.defineProperty(o, "$options", {
  33755. value: r.buildOpt()
  33756. }),
  33757. Object.defineProperty(e, "$options", {
  33758. value: o.$options
  33759. }),
  33760. Object.defineProperty(o, "$type", {
  33761. value: r
  33762. }),
  33763. Object.defineProperty(e, "$type", {
  33764. value: r
  33765. })),
  33766. o
  33767. }(g, this)
  33768. }
  33769. ,
  33770. s.Service = y;
  33771. function A(e, t, i, n) {
  33772. h.call(this, e, t, i),
  33773. this.className = "Service.Method",
  33774. this.options = n || {}
  33775. }
  33776. (A.prototype = Object.create(h.prototype)).buildOpt = t.buildOpt,
  33777. s.Service.Method = A;
  33778. function C(e, t, i, n, r, o, a, s) {
  33779. A.call(this, e, t, i, s),
  33780. this.className = "Service.RPCMethod",
  33781. this.requestName = n,
  33782. this.responseName = r,
  33783. this.requestStream = o,
  33784. this.responseStream = a,
  33785. this.resolvedRequestType = null,
  33786. this.resolvedResponseType = null
  33787. }
  33788. return C.prototype = Object.create(A.prototype),
  33789. s.Service.RPCMethod = C,
  33790. s
  33791. }(o),
  33792. o.Builder = (i = (u = o).Lang,
  33793. s = o.Reflect,
  33794. n = h.prototype,
  33795. h.isMessage = function(e) {
  33796. return "string" == typeof e.name && void 0 === e.values && void 0 === e.rpc
  33797. }
  33798. ,
  33799. h.isMessageField = function(e) {
  33800. return "string" == typeof e.rule && "string" == typeof e.name && "string" == typeof e.type && void 0 !== e.id
  33801. }
  33802. ,
  33803. h.isEnum = function(e) {
  33804. return "string" == typeof e.name && !(void 0 === e.values || !Array.isArray(e.values) || 0 === e.values.length)
  33805. }
  33806. ,
  33807. h.isService = function(e) {
  33808. return !("string" != typeof e.name || "object" != typeof e.rpc || !e.rpc)
  33809. }
  33810. ,
  33811. h.isExtend = function(e) {
  33812. return "string" == typeof e.ref
  33813. }
  33814. ,
  33815. n.reset = function() {
  33816. return this.ptr = this.ns,
  33817. this
  33818. }
  33819. ,
  33820. n.define = function(e) {
  33821. if ("string" != typeof e || !i.TYPEREF.test(e))
  33822. throw Error("illegal namespace: " + e);
  33823. return e.split(".").forEach(function(e) {
  33824. var t = this.ptr.getChild(e);
  33825. null === t && this.ptr.addChild(t = new s.Namespace(this,this.ptr,e)),
  33826. this.ptr = t
  33827. }, this),
  33828. this
  33829. }
  33830. ,
  33831. n.create = function(e) {
  33832. if (!e)
  33833. return this;
  33834. if (Array.isArray(e)) {
  33835. if (0 === e.length)
  33836. return this;
  33837. e = e.slice()
  33838. } else
  33839. e = [e];
  33840. for (var t = [e]; 0 < t.length; ) {
  33841. if (e = t.pop(),
  33842. !Array.isArray(e))
  33843. throw Error("not a valid namespace: " + JSON.stringify(e));
  33844. for (; 0 < e.length; ) {
  33845. var i = e.shift();
  33846. if (h.isMessage(i)) {
  33847. var o = new s.Message(this,this.ptr,i.name,i.options,i.isGroup,i.syntax)
  33848. , n = {};
  33849. i.oneofs && Object.keys(i.oneofs).forEach(function(e) {
  33850. o.addChild(n[e] = new s.Message.OneOf(this,o,e))
  33851. }, this),
  33852. i.fields && i.fields.forEach(function(e) {
  33853. if (null !== o.getChild(0 | e.id))
  33854. throw Error("duplicate or invalid field id in " + o.name + ": " + e.id);
  33855. if (e.options && "object" != typeof e.options)
  33856. throw Error("illegal field options in " + o.name + "#" + e.name);
  33857. var t = null;
  33858. if ("string" == typeof e.oneof && !(t = n[e.oneof]))
  33859. throw Error("illegal oneof in " + o.name + "#" + e.name + ": " + e.oneof);
  33860. e = new s.Message.Field(this,o,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,i.syntax),
  33861. t && t.fields.push(e),
  33862. o.addChild(e)
  33863. }, this);
  33864. var r = [];
  33865. if (i.enums && i.enums.forEach(function(e) {
  33866. r.push(e)
  33867. }),
  33868. i.messages && i.messages.forEach(function(e) {
  33869. r.push(e)
  33870. }),
  33871. i.services && i.services.forEach(function(e) {
  33872. r.push(e)
  33873. }),
  33874. i.extensions && ("number" == typeof i.extensions[0] ? o.extensions = [i.extensions] : o.extensions = i.extensions),
  33875. this.ptr.addChild(o),
  33876. 0 < r.length) {
  33877. t.push(e),
  33878. e = r,
  33879. r = null,
  33880. this.ptr = o,
  33881. o = null;
  33882. continue
  33883. }
  33884. r = null
  33885. } else if (h.isEnum(i))
  33886. o = new s.Enum(this,this.ptr,i.name,i.options,i.syntax),
  33887. i.values.forEach(function(e) {
  33888. o.addChild(new s.Enum.Value(this,o,e.name,e.id))
  33889. }, this),
  33890. this.ptr.addChild(o);
  33891. else if (h.isService(i))
  33892. o = new s.Service(this,this.ptr,i.name,i.options),
  33893. Object.keys(i.rpc).forEach(function(e) {
  33894. var t = i.rpc[e];
  33895. o.addChild(new s.Service.RPCMethod(this,o,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))
  33896. }, this),
  33897. this.ptr.addChild(o);
  33898. else {
  33899. if (!h.isExtend(i))
  33900. throw Error("not a valid definition: " + JSON.stringify(i));
  33901. if (o = this.ptr.resolve(i.ref, !0))
  33902. i.fields.forEach(function(t) {
  33903. if (null !== o.getChild(0 | t.id))
  33904. throw Error("duplicate extended field id in " + o.name + ": " + t.id);
  33905. if (o.extensions) {
  33906. var i = !1;
  33907. if (o.extensions.forEach(function(e) {
  33908. t.id >= e[0] && t.id <= e[1] && (i = !0)
  33909. }),
  33910. !i)
  33911. throw Error("illegal extended field id in " + o.name + ": " + t.id + " (not within valid ranges)")
  33912. }
  33913. var e = t.name;
  33914. this.options.convertFieldsToCamelCase && (e = u.Util.toCamelCase(e));
  33915. var n = new s.Message.ExtensionField(this,o,t.rule,t.type,this.ptr.fqn() + "." + e,t.id,t.options)
  33916. , r = new s.Extension(this,this.ptr,t.name,n);
  33917. n.extension = r,
  33918. this.ptr.addChild(r),
  33919. o.addChild(n)
  33920. }, this);
  33921. else if (!/\.?google\.protobuf\./.test(i.ref))
  33922. throw Error("extended message " + i.ref + " is not defined")
  33923. }
  33924. o = i = null
  33925. }
  33926. e = null,
  33927. this.ptr = this.ptr.parent
  33928. }
  33929. return this.resolved = !1,
  33930. this.result = null,
  33931. this
  33932. }
  33933. ,
  33934. n.import = function(t, e) {
  33935. var i = "/";
  33936. if ("string" == typeof e) {
  33937. if (u.Util.IS_NODE && (e = p("path").resolve(e)),
  33938. !0 === this.files[e])
  33939. return this.reset();
  33940. this.files[e] = !0
  33941. } else if ("object" == typeof e) {
  33942. var n = e.root;
  33943. u.Util.IS_NODE && (n = p("path").resolve(n)),
  33944. (0 <= n.indexOf("\\") || 0 <= e.file.indexOf("\\")) && (i = "\\");
  33945. var r = n + i + e.file;
  33946. if (!0 === this.files[r])
  33947. return this.reset();
  33948. this.files[r] = !0
  33949. }
  33950. if (t.imports && 0 < t.imports.length) {
  33951. var o, a = !1;
  33952. "object" == typeof e ? (this.importRoot = e.root,
  33953. a = !0,
  33954. o = this.importRoot,
  33955. e = e.file,
  33956. (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(/\\[^\\]*$/, ""),
  33957. i = "\\") : o = "." : o = null;
  33958. for (var s = 0; s < t.imports.length; s++)
  33959. if ("string" == typeof t.imports[s]) {
  33960. if (!o)
  33961. throw Error("cannot determine import root");
  33962. var l = t.imports[s];
  33963. if ("google/protobuf/descriptor.proto" === l)
  33964. continue;
  33965. if (l = o + i + l,
  33966. !0 === this.files[l])
  33967. continue;
  33968. /\.proto$/i.test(l) && !u.DotProto && (l = l.replace(/\.proto$/, ".json"));
  33969. var c = u.Util.fetch(l);
  33970. if (null === c)
  33971. throw Error("failed to import '" + l + "' in '" + e + "': file not found");
  33972. /\.json$/i.test(l) ? this.import(JSON.parse(c + ""), l) : this.import(u.DotProto.Parser.parse(c), l)
  33973. } else
  33974. e ? /\.(\w+)$/.test(e) ? this.import(t.imports[s], e.replace(/^(.+)\.(\w+)$/, function(e, t, i) {
  33975. return t + "_import" + s + "." + i
  33976. })) : this.import(t.imports[s], e + "_import" + s) : this.import(t.imports[s]);
  33977. a && (this.importRoot = null)
  33978. }
  33979. t.package && this.define(t.package),
  33980. t.syntax && function t(i) {
  33981. i.messages && i.messages.forEach(function(e) {
  33982. e.syntax = i.syntax,
  33983. t(e)
  33984. }),
  33985. i.enums && i.enums.forEach(function(e) {
  33986. e.syntax = i.syntax
  33987. })
  33988. }(t);
  33989. var h = this.ptr;
  33990. return t.options && Object.keys(t.options).forEach(function(e) {
  33991. h.options[e] = t.options[e]
  33992. }),
  33993. t.messages && (this.create(t.messages),
  33994. this.ptr = h),
  33995. t.enums && (this.create(t.enums),
  33996. this.ptr = h),
  33997. t.services && (this.create(t.services),
  33998. this.ptr = h),
  33999. t.extends && this.create(t.extends),
  34000. this.reset()
  34001. }
  34002. ,
  34003. n.resolveAll = function() {
  34004. var e;
  34005. if (null == this.ptr || "object" == typeof this.ptr.type)
  34006. return this;
  34007. if (this.ptr instanceof s.Namespace)
  34008. this.ptr.children.forEach(function(e) {
  34009. this.ptr = e,
  34010. this.resolveAll()
  34011. }, this);
  34012. else if (this.ptr instanceof s.Message.Field) {
  34013. if (i.TYPE.test(this.ptr.type))
  34014. this.ptr.type = u.TYPES[this.ptr.type];
  34015. else {
  34016. if (!i.TYPEREF.test(this.ptr.type))
  34017. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  34018. if (!(e = (this.ptr instanceof s.Message.ExtensionField ? this.ptr.extension.parent : this.ptr.parent).resolve(this.ptr.type, !0)))
  34019. throw Error("unresolvable type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  34020. if ((this.ptr.resolvedType = e)instanceof s.Enum) {
  34021. if (this.ptr.type = u.TYPES.enum,
  34022. "proto3" === this.ptr.syntax && "proto3" !== e.syntax)
  34023. throw Error("proto3 message cannot reference proto2 enum")
  34024. } else {
  34025. if (!(e instanceof s.Message))
  34026. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  34027. this.ptr.type = e.isGroup ? u.TYPES.group : u.TYPES.message
  34028. }
  34029. }
  34030. if (this.ptr.map) {
  34031. if (!i.TYPE.test(this.ptr.keyType))
  34032. throw Error("illegal key type for map field in " + this.ptr.toString(!0) + ": " + this.ptr.keyType);
  34033. this.ptr.keyType = u.TYPES[this.ptr.keyType]
  34034. }
  34035. } else if (this.ptr instanceof u.Reflect.Service.Method) {
  34036. if (!(this.ptr instanceof u.Reflect.Service.RPCMethod))
  34037. throw Error("illegal service type in " + this.ptr.toString(!0));
  34038. if (!((e = this.ptr.parent.resolve(this.ptr.requestName, !0)) && e instanceof u.Reflect.Message))
  34039. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.requestName);
  34040. if (this.ptr.resolvedRequestType = e,
  34041. !((e = this.ptr.parent.resolve(this.ptr.responseName, !0)) && e instanceof u.Reflect.Message))
  34042. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.responseName);
  34043. this.ptr.resolvedResponseType = e
  34044. } else if (!(this.ptr instanceof u.Reflect.Message.OneOf || this.ptr instanceof u.Reflect.Extension || this.ptr instanceof u.Reflect.Enum.Value))
  34045. throw Error("illegal object in namespace: " + typeof this.ptr + ": " + this.ptr);
  34046. return this.reset()
  34047. }
  34048. ,
  34049. n.build = function(e) {
  34050. if (this.reset(),
  34051. this.resolved || (this.resolveAll(),
  34052. this.resolved = !0,
  34053. this.result = null),
  34054. null === this.result && (this.result = this.ns.build()),
  34055. !e)
  34056. return this.result;
  34057. for (var t = "string" == typeof e ? e.split(".") : e, i = this.result, n = 0; n < t.length; n++) {
  34058. if (!i[t[n]]) {
  34059. i = null;
  34060. break
  34061. }
  34062. i = i[t[n]]
  34063. }
  34064. return i
  34065. }
  34066. ,
  34067. n.lookup = function(e, t) {
  34068. return e ? this.ns.resolve(e, t) : this.ns
  34069. }
  34070. ,
  34071. n.toString = function() {
  34072. return "Builder"
  34073. }
  34074. ,
  34075. h.Message = function() {}
  34076. ,
  34077. h.Enum = function() {}
  34078. ,
  34079. h.Service = function() {}
  34080. ,
  34081. h),
  34082. o.Map = (a = o.Reflect,
  34083. (t = c.prototype).clear = function() {
  34084. this.map = {}
  34085. }
  34086. ,
  34087. t.delete = function(e) {
  34088. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e))
  34089. , i = t in this.map;
  34090. return delete this.map[t],
  34091. i
  34092. }
  34093. ,
  34094. t.entries = function() {
  34095. for (var e, t = [], i = Object.keys(this.map), n = 0; n < i.length; n++)
  34096. t.push([(e = this.map[i[n]]).key, e.value]);
  34097. return l(t)
  34098. }
  34099. ,
  34100. t.keys = function() {
  34101. for (var e = [], t = Object.keys(this.map), i = 0; i < t.length; i++)
  34102. e.push(this.map[t[i]].key);
  34103. return l(e)
  34104. }
  34105. ,
  34106. t.values = function() {
  34107. for (var e = [], t = Object.keys(this.map), i = 0; i < t.length; i++)
  34108. e.push(this.map[t[i]].value);
  34109. return l(e)
  34110. }
  34111. ,
  34112. t.forEach = function(e, t) {
  34113. for (var i, n = Object.keys(this.map), r = 0; r < n.length; r++)
  34114. e.call(t, (i = this.map[n[r]]).value, i.key, this)
  34115. }
  34116. ,
  34117. t.set = function(e, t) {
  34118. var i = this.keyElem.verifyValue(e)
  34119. , n = this.valueElem.verifyValue(t);
  34120. return this.map[this.keyElem.valueToString(i)] = {
  34121. key: i,
  34122. value: n
  34123. },
  34124. this
  34125. }
  34126. ,
  34127. t.get = function(e) {
  34128. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  34129. if (t in this.map)
  34130. return this.map[t].value
  34131. }
  34132. ,
  34133. t.has = function(e) {
  34134. return this.keyElem.valueToString(this.keyElem.verifyValue(e))in this.map
  34135. }
  34136. ,
  34137. c),
  34138. o.loadProto = function(e, t, i) {
  34139. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  34140. t = void 0),
  34141. o.loadJson(o.DotProto.Parser.parse(e), t, i)
  34142. }
  34143. ,
  34144. o.protoFromString = o.loadProto,
  34145. o.loadProtoFile = function(t, i, n) {
  34146. if (i && "object" == typeof i ? (n = i,
  34147. i = null) : i && "function" == typeof i || (i = null),
  34148. i)
  34149. return o.Util.fetch("string" == typeof t ? t : t.root + "/" + t.file, function(e) {
  34150. if (null !== e)
  34151. try {
  34152. i(null, o.loadProto(e, n, t))
  34153. } catch (e) {
  34154. i(e)
  34155. }
  34156. else
  34157. i(Error("Failed to fetch file"))
  34158. });
  34159. var e = o.Util.fetch("object" == typeof t ? t.root + "/" + t.file : t);
  34160. return null === e ? null : o.loadProto(e, n, t)
  34161. }
  34162. ,
  34163. o.protoFromFile = o.loadProtoFile,
  34164. o.newBuilder = function(e) {
  34165. return void 0 === (e = e || {}).convertFieldsToCamelCase && (e.convertFieldsToCamelCase = o.convertFieldsToCamelCase),
  34166. void 0 === e.populateAccessors && (e.populateAccessors = o.populateAccessors),
  34167. new o.Builder(e)
  34168. }
  34169. ,
  34170. o.loadJson = function(e, t, i) {
  34171. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  34172. t = null),
  34173. t && "object" == typeof t || (t = o.newBuilder()),
  34174. "string" == typeof e && (e = JSON.parse(e)),
  34175. t.import(e, i),
  34176. t.resolveAll(),
  34177. t
  34178. }
  34179. ,
  34180. o.loadJsonFile = function(t, i, n) {
  34181. if (i && "object" == typeof i ? (n = i,
  34182. i = null) : i && "function" == typeof i || (i = null),
  34183. i)
  34184. return o.Util.fetch("string" == typeof t ? t : t.root + "/" + t.file, function(e) {
  34185. if (null !== e)
  34186. try {
  34187. i(null, o.loadJson(JSON.parse(e), n, t))
  34188. } catch (e) {
  34189. i(e)
  34190. }
  34191. else
  34192. i(Error("Failed to fetch file"))
  34193. });
  34194. var e = o.Util.fetch("object" == typeof t ? t.root + "/" + t.file : t);
  34195. return null === e ? null : o.loadJson(JSON.parse(e), n, t)
  34196. }
  34197. ,
  34198. o;
  34199. function l(e) {
  34200. var t = 0;
  34201. return {
  34202. next: function() {
  34203. return t < e.length ? {
  34204. done: !1,
  34205. value: e[t++]
  34206. } : {
  34207. done: !0
  34208. }
  34209. }
  34210. }
  34211. }
  34212. function c(e, t) {
  34213. if (!e.map)
  34214. throw Error("field is not a map");
  34215. if (this.field = e,
  34216. this.keyElem = new a.Element(e.keyType,null,!0,e.syntax),
  34217. this.valueElem = new a.Element(e.type,e.resolvedType,!1,e.syntax),
  34218. this.map = {},
  34219. Object.defineProperty(this, "size", {
  34220. get: function() {
  34221. return Object.keys(this.map).length
  34222. }
  34223. }),
  34224. t)
  34225. for (var i = Object.keys(t), n = 0; n < i.length; n++) {
  34226. var r = this.keyElem.valueFromString(i[n])
  34227. , o = this.valueElem.verifyValue(t[i[n]]);
  34228. this.map[this.keyElem.valueToString(r)] = {
  34229. key: r,
  34230. value: o
  34231. }
  34232. }
  34233. }
  34234. function h(e) {
  34235. this.ns = new s.Namespace(this,null,""),
  34236. this.ptr = this.ns,
  34237. this.resolved = !1,
  34238. this.result = null,
  34239. this.files = {},
  34240. this.importRoot = null,
  34241. this.options = e || {}
  34242. }
  34243. }
  34244. ,
  34245. "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)
  34246. }
  34247. ).call(this, p("_process"))
  34248. }
  34249. , {
  34250. _process: 203,
  34251. bytebuffer: 215,
  34252. fs: 197,
  34253. path: 197
  34254. }],
  34255. 215: [function(t, e, i) {
  34256. var n, r;
  34257. n = this,
  34258. r = function(l) {
  34259. "use strict";
  34260. function s(e) {
  34261. var t = 0;
  34262. return function() {
  34263. return t < e.length ? e.charCodeAt(t++) : null
  34264. }
  34265. }
  34266. function c() {
  34267. var e = []
  34268. , t = [];
  34269. return function() {
  34270. return 0 === arguments.length ? t.join("") + i.apply(String, e) : (1024 < e.length + arguments.length && (t.push(i.apply(String, e)),
  34271. e.length = 0),
  34272. void Array.prototype.push.apply(e, arguments))
  34273. }
  34274. }
  34275. function n(e, t, i, n, r) {
  34276. 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];
  34277. for (u += d,
  34278. o = p & (1 << -h) - 1,
  34279. p >>= -h,
  34280. h += s; 0 < h; o = 256 * o + e[t + u],
  34281. u += d,
  34282. h -= 8)
  34283. ;
  34284. for (a = o & (1 << -h) - 1,
  34285. o >>= -h,
  34286. h += n; 0 < h; a = 256 * a + e[t + u],
  34287. u += d,
  34288. h -= 8)
  34289. ;
  34290. if (0 === o)
  34291. o = 1 - c;
  34292. else {
  34293. if (o === l)
  34294. return a ? NaN : 1 / 0 * (p ? -1 : 1);
  34295. a += Math.pow(2, n),
  34296. o -= c
  34297. }
  34298. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  34299. }
  34300. function r(e, t, i, n, r, o) {
  34301. 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;
  34302. for (t = Math.abs(t),
  34303. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  34304. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  34305. t * (l = Math.pow(2, -a)) < 1 && (a--,
  34306. l *= 2),
  34307. 2 <= (t += 1 <= a + u ? d / l : d * Math.pow(2, 1 - u)) * l && (a++,
  34308. l /= 2),
  34309. h <= a + u ? (s = 0,
  34310. a = h) : 1 <= a + u ? (s = (t * l - 1) * Math.pow(2, r),
  34311. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  34312. a = 0)); 8 <= r; e[i + p] = 255 & s,
  34313. p += f,
  34314. s /= 256,
  34315. r -= 8)
  34316. ;
  34317. for (a = a << r | s,
  34318. c += r; 0 < c; e[i + p] = 255 & a,
  34319. p += f,
  34320. a /= 256,
  34321. c -= 8)
  34322. ;
  34323. e[i + p - f] |= 128 * g
  34324. }
  34325. var f = function(e, t, i) {
  34326. if (void 0 === e && (e = f.DEFAULT_CAPACITY),
  34327. void 0 === t && (t = f.DEFAULT_ENDIAN),
  34328. void 0 === i && (i = f.DEFAULT_NOASSERT),
  34329. !i) {
  34330. if ((e |= 0) < 0)
  34331. throw RangeError("Illegal capacity");
  34332. t = !!t,
  34333. i = !!i
  34334. }
  34335. this.buffer = 0 === e ? o : new ArrayBuffer(e),
  34336. this.view = 0 === e ? null : new Uint8Array(this.buffer),
  34337. this.offset = 0,
  34338. this.markedOffset = -1,
  34339. this.limit = e,
  34340. this.littleEndian = t,
  34341. this.noAssert = i
  34342. };
  34343. f.VERSION = "5.0.1",
  34344. f.LITTLE_ENDIAN = !0,
  34345. f.BIG_ENDIAN = !1,
  34346. f.DEFAULT_CAPACITY = 16,
  34347. f.DEFAULT_ENDIAN = f.BIG_ENDIAN,
  34348. f.DEFAULT_NOASSERT = !1,
  34349. f.Long = l || null;
  34350. var a = f.prototype;
  34351. a.__isByteBuffer__,
  34352. Object.defineProperty(a, "__isByteBuffer__", {
  34353. value: !0,
  34354. enumerable: !1,
  34355. configurable: !1
  34356. });
  34357. var o = new ArrayBuffer(0)
  34358. , i = String.fromCharCode;
  34359. f.accessor = function() {
  34360. return Uint8Array
  34361. }
  34362. ,
  34363. f.allocate = function(e, t, i) {
  34364. return new f(e,t,i)
  34365. }
  34366. ,
  34367. f.concat = function(e, t, i, n) {
  34368. "boolean" != typeof t && "string" == typeof t || (n = i,
  34369. i = t,
  34370. t = void 0);
  34371. for (var r, o = 0, a = 0, s = e.length; a < s; ++a)
  34372. f.isByteBuffer(e[a]) || (e[a] = f.wrap(e[a], t)),
  34373. 0 < (r = e[a].limit - e[a].offset) && (o += r);
  34374. if (0 === o)
  34375. return new f(0,i,n);
  34376. var l, c = new f(o,i,n);
  34377. for (a = 0; a < s; )
  34378. (r = (l = e[a++]).limit - l.offset) <= 0 || (c.view.set(l.view.subarray(l.offset, l.limit), c.offset),
  34379. c.offset += r);
  34380. return c.limit = c.offset,
  34381. c.offset = 0,
  34382. c
  34383. }
  34384. ,
  34385. f.isByteBuffer = function(e) {
  34386. return !0 === (e && e.__isByteBuffer__)
  34387. }
  34388. ,
  34389. f.type = function() {
  34390. return ArrayBuffer
  34391. }
  34392. ,
  34393. f.wrap = function(e, t, i, n) {
  34394. if ("string" != typeof t && (n = i,
  34395. i = t,
  34396. t = void 0),
  34397. "string" == typeof e)
  34398. switch (void 0 === t && (t = "utf8"),
  34399. t) {
  34400. case "base64":
  34401. return f.fromBase64(e, i);
  34402. case "hex":
  34403. return f.fromHex(e, i);
  34404. case "binary":
  34405. return f.fromBinary(e, i);
  34406. case "utf8":
  34407. return f.fromUTF8(e, i);
  34408. case "debug":
  34409. return f.fromDebug(e, i);
  34410. default:
  34411. throw Error("Unsupported encoding: " + t)
  34412. }
  34413. if (null === e || "object" != typeof e)
  34414. throw TypeError("Illegal buffer");
  34415. var r;
  34416. if (f.isByteBuffer(e))
  34417. return (r = a.clone.call(e)).markedOffset = -1,
  34418. r;
  34419. if (e instanceof Uint8Array)
  34420. r = new f(0,i,n),
  34421. 0 < e.length && (r.buffer = e.buffer,
  34422. r.offset = e.byteOffset,
  34423. r.limit = e.byteOffset + e.byteLength,
  34424. r.view = new Uint8Array(e.buffer));
  34425. else if (e instanceof ArrayBuffer)
  34426. r = new f(0,i,n),
  34427. 0 < e.byteLength && (r.buffer = e,
  34428. r.offset = 0,
  34429. r.limit = e.byteLength,
  34430. r.view = 0 < e.byteLength ? new Uint8Array(e) : null);
  34431. else {
  34432. if ("[object Array]" !== Object.prototype.toString.call(e))
  34433. throw TypeError("Illegal buffer");
  34434. (r = new f(e.length,i,n)).limit = e.length;
  34435. for (var o = 0; o < e.length; ++o)
  34436. r.view[o] = e[o]
  34437. }
  34438. return r
  34439. }
  34440. ,
  34441. a.writeBitSet = function(e, t) {
  34442. var i = void 0 === t;
  34443. if (i && (t = this.offset),
  34444. !this.noAssert) {
  34445. if (!(e instanceof Array))
  34446. throw TypeError("Illegal BitSet: Not an array");
  34447. if ("number" != typeof t || t % 1 != 0)
  34448. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34449. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34450. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34451. }
  34452. var n, r = t, o = e.length, a = o >> 3, s = 0;
  34453. for (t += this.writeVarint32(o, t); a--; )
  34454. 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,
  34455. this.writeByte(n, t++);
  34456. if (s < o) {
  34457. var l = 0;
  34458. for (n = 0; s < o; )
  34459. n |= (1 & !!e[s++]) << l++;
  34460. this.writeByte(n, t++)
  34461. }
  34462. return i ? (this.offset = t,
  34463. this) : t - r
  34464. }
  34465. ,
  34466. a.readBitSet = function(e) {
  34467. var t = void 0 === e;
  34468. t && (e = this.offset);
  34469. var i, n = this.readVarint32(e), r = n.value, o = r >> 3, a = 0, s = [];
  34470. for (e += n.length; o--; )
  34471. i = this.readByte(e++),
  34472. s[a++] = !!(1 & i),
  34473. s[a++] = !!(2 & i),
  34474. s[a++] = !!(4 & i),
  34475. s[a++] = !!(8 & i),
  34476. s[a++] = !!(16 & i),
  34477. s[a++] = !!(32 & i),
  34478. s[a++] = !!(64 & i),
  34479. s[a++] = !!(128 & i);
  34480. if (a < r) {
  34481. var l = 0;
  34482. for (i = this.readByte(e++); a < r; )
  34483. s[a++] = !!(i >> l++ & 1)
  34484. }
  34485. return t && (this.offset = e),
  34486. s
  34487. }
  34488. ,
  34489. a.readBytes = function(e, t) {
  34490. var i = void 0 === t;
  34491. if (i && (t = this.offset),
  34492. !this.noAssert) {
  34493. if ("number" != typeof t || t % 1 != 0)
  34494. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34495. if ((t >>>= 0) < 0 || t + e > this.buffer.byteLength)
  34496. throw RangeError("Illegal offset: 0 <= " + t + " (+" + e + ") <= " + this.buffer.byteLength)
  34497. }
  34498. var n = this.slice(t, t + e);
  34499. return i && (this.offset += e),
  34500. n
  34501. }
  34502. ,
  34503. a.writeBytes = a.append,
  34504. a.writeInt8 = function(e, t) {
  34505. var i = void 0 === t;
  34506. if (i && (t = this.offset),
  34507. !this.noAssert) {
  34508. if ("number" != typeof e || e % 1 != 0)
  34509. throw TypeError("Illegal value: " + e + " (not an integer)");
  34510. if (e |= 0,
  34511. "number" != typeof t || t % 1 != 0)
  34512. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34513. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34514. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34515. }
  34516. t += 1;
  34517. var n = this.buffer.byteLength;
  34518. return n < t && this.resize((n *= 2) > t ? n : t),
  34519. t -= 1,
  34520. this.view[t] = e,
  34521. i && (this.offset += 1),
  34522. this
  34523. }
  34524. ,
  34525. a.writeByte = a.writeInt8,
  34526. a.readInt8 = function(e) {
  34527. var t = void 0 === e;
  34528. if (t && (e = this.offset),
  34529. !this.noAssert) {
  34530. if ("number" != typeof e || e % 1 != 0)
  34531. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34532. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  34533. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  34534. }
  34535. var i = this.view[e];
  34536. return 128 == (128 & i) && (i = -(255 - i + 1)),
  34537. t && (this.offset += 1),
  34538. i
  34539. }
  34540. ,
  34541. a.readByte = a.readInt8,
  34542. a.writeUint8 = function(e, t) {
  34543. var i = void 0 === t;
  34544. if (i && (t = this.offset),
  34545. !this.noAssert) {
  34546. if ("number" != typeof e || e % 1 != 0)
  34547. throw TypeError("Illegal value: " + e + " (not an integer)");
  34548. if (e >>>= 0,
  34549. "number" != typeof t || t % 1 != 0)
  34550. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34551. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34552. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34553. }
  34554. t += 1;
  34555. var n = this.buffer.byteLength;
  34556. return n < t && this.resize((n *= 2) > t ? n : t),
  34557. t -= 1,
  34558. this.view[t] = e,
  34559. i && (this.offset += 1),
  34560. this
  34561. }
  34562. ,
  34563. a.writeUInt8 = a.writeUint8,
  34564. a.readUint8 = function(e) {
  34565. var t = void 0 === e;
  34566. if (t && (e = this.offset),
  34567. !this.noAssert) {
  34568. if ("number" != typeof e || e % 1 != 0)
  34569. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34570. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  34571. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  34572. }
  34573. var i = this.view[e];
  34574. return t && (this.offset += 1),
  34575. i
  34576. }
  34577. ,
  34578. a.readUInt8 = a.readUint8,
  34579. a.writeInt16 = function(e, t) {
  34580. var i = void 0 === t;
  34581. if (i && (t = this.offset),
  34582. !this.noAssert) {
  34583. if ("number" != typeof e || e % 1 != 0)
  34584. throw TypeError("Illegal value: " + e + " (not an integer)");
  34585. if (e |= 0,
  34586. "number" != typeof t || t % 1 != 0)
  34587. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34588. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34589. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34590. }
  34591. t += 2;
  34592. var n = this.buffer.byteLength;
  34593. return n < t && this.resize((n *= 2) > t ? n : t),
  34594. t -= 2,
  34595. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  34596. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  34597. this.view[t + 1] = 255 & e),
  34598. i && (this.offset += 2),
  34599. this
  34600. }
  34601. ,
  34602. a.writeShort = a.writeInt16,
  34603. a.readInt16 = function(e) {
  34604. var t = void 0 === e;
  34605. if (t && (e = this.offset),
  34606. !this.noAssert) {
  34607. if ("number" != typeof e || e % 1 != 0)
  34608. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34609. if ((e >>>= 0) < 0 || e + 2 > this.buffer.byteLength)
  34610. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  34611. }
  34612. var i = 0;
  34613. return this.littleEndian ? (i = this.view[e],
  34614. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  34615. i |= this.view[e + 1]),
  34616. 32768 == (32768 & i) && (i = -(65535 - i + 1)),
  34617. t && (this.offset += 2),
  34618. i
  34619. }
  34620. ,
  34621. a.readShort = a.readInt16,
  34622. a.writeUint16 = function(e, t) {
  34623. var i = void 0 === t;
  34624. if (i && (t = this.offset),
  34625. !this.noAssert) {
  34626. if ("number" != typeof e || e % 1 != 0)
  34627. throw TypeError("Illegal value: " + e + " (not an integer)");
  34628. if (e >>>= 0,
  34629. "number" != typeof t || t % 1 != 0)
  34630. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34631. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34632. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34633. }
  34634. t += 2;
  34635. var n = this.buffer.byteLength;
  34636. return n < t && this.resize((n *= 2) > t ? n : t),
  34637. t -= 2,
  34638. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  34639. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  34640. this.view[t + 1] = 255 & e),
  34641. i && (this.offset += 2),
  34642. this
  34643. }
  34644. ,
  34645. a.writeUInt16 = a.writeUint16,
  34646. a.readUint16 = function(e) {
  34647. var t = void 0 === e;
  34648. if (t && (e = this.offset),
  34649. !this.noAssert) {
  34650. if ("number" != typeof e || e % 1 != 0)
  34651. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34652. if ((e >>>= 0) < 0 || e + 2 > this.buffer.byteLength)
  34653. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  34654. }
  34655. var i = 0;
  34656. return this.littleEndian ? (i = this.view[e],
  34657. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  34658. i |= this.view[e + 1]),
  34659. t && (this.offset += 2),
  34660. i
  34661. }
  34662. ,
  34663. a.readUInt16 = a.readUint16,
  34664. a.writeInt32 = function(e, t) {
  34665. var i = void 0 === t;
  34666. if (i && (t = this.offset),
  34667. !this.noAssert) {
  34668. if ("number" != typeof e || e % 1 != 0)
  34669. throw TypeError("Illegal value: " + e + " (not an integer)");
  34670. if (e |= 0,
  34671. "number" != typeof t || t % 1 != 0)
  34672. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34673. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34674. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34675. }
  34676. t += 4;
  34677. var n = this.buffer.byteLength;
  34678. return n < t && this.resize((n *= 2) > t ? n : t),
  34679. t -= 4,
  34680. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  34681. this.view[t + 2] = e >>> 16 & 255,
  34682. this.view[t + 1] = e >>> 8 & 255,
  34683. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  34684. this.view[t + 1] = e >>> 16 & 255,
  34685. this.view[t + 2] = e >>> 8 & 255,
  34686. this.view[t + 3] = 255 & e),
  34687. i && (this.offset += 4),
  34688. this
  34689. }
  34690. ,
  34691. a.writeInt = a.writeInt32,
  34692. a.readInt32 = function(e) {
  34693. var t = void 0 === e;
  34694. if (t && (e = this.offset),
  34695. !this.noAssert) {
  34696. if ("number" != typeof e || e % 1 != 0)
  34697. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34698. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  34699. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  34700. }
  34701. var i = 0;
  34702. return this.littleEndian ? (i = this.view[e + 2] << 16,
  34703. i |= this.view[e + 1] << 8,
  34704. i |= this.view[e],
  34705. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  34706. i |= this.view[e + 2] << 8,
  34707. i |= this.view[e + 3],
  34708. i += this.view[e] << 24 >>> 0),
  34709. i |= 0,
  34710. t && (this.offset += 4),
  34711. i
  34712. }
  34713. ,
  34714. a.readInt = a.readInt32,
  34715. a.writeUint32 = function(e, t) {
  34716. var i = void 0 === t;
  34717. if (i && (t = this.offset),
  34718. !this.noAssert) {
  34719. if ("number" != typeof e || e % 1 != 0)
  34720. throw TypeError("Illegal value: " + e + " (not an integer)");
  34721. if (e >>>= 0,
  34722. "number" != typeof t || t % 1 != 0)
  34723. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34724. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34725. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34726. }
  34727. t += 4;
  34728. var n = this.buffer.byteLength;
  34729. return n < t && this.resize((n *= 2) > t ? n : t),
  34730. t -= 4,
  34731. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  34732. this.view[t + 2] = e >>> 16 & 255,
  34733. this.view[t + 1] = e >>> 8 & 255,
  34734. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  34735. this.view[t + 1] = e >>> 16 & 255,
  34736. this.view[t + 2] = e >>> 8 & 255,
  34737. this.view[t + 3] = 255 & e),
  34738. i && (this.offset += 4),
  34739. this
  34740. }
  34741. ,
  34742. a.writeUInt32 = a.writeUint32,
  34743. a.readUint32 = function(e) {
  34744. var t = void 0 === e;
  34745. if (t && (e = this.offset),
  34746. !this.noAssert) {
  34747. if ("number" != typeof e || e % 1 != 0)
  34748. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34749. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  34750. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  34751. }
  34752. var i = 0;
  34753. return this.littleEndian ? (i = this.view[e + 2] << 16,
  34754. i |= this.view[e + 1] << 8,
  34755. i |= this.view[e],
  34756. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  34757. i |= this.view[e + 2] << 8,
  34758. i |= this.view[e + 3],
  34759. i += this.view[e] << 24 >>> 0),
  34760. t && (this.offset += 4),
  34761. i
  34762. }
  34763. ,
  34764. a.readUInt32 = a.readUint32,
  34765. l && (a.writeInt64 = function(e, t) {
  34766. var i = void 0 === t;
  34767. if (i && (t = this.offset),
  34768. !this.noAssert) {
  34769. if ("number" == typeof e)
  34770. e = l.fromNumber(e);
  34771. else if ("string" == typeof e)
  34772. e = l.fromString(e);
  34773. else if (!(e && e instanceof l))
  34774. throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  34775. if ("number" != typeof t || t % 1 != 0)
  34776. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34777. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34778. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34779. }
  34780. "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e)),
  34781. t += 8;
  34782. var n = this.buffer.byteLength;
  34783. n < t && this.resize((n *= 2) > t ? n : t),
  34784. t -= 8;
  34785. var r = e.low
  34786. , o = e.high;
  34787. return this.littleEndian ? (this.view[t + 3] = r >>> 24 & 255,
  34788. this.view[t + 2] = r >>> 16 & 255,
  34789. this.view[t + 1] = r >>> 8 & 255,
  34790. this.view[t] = 255 & r,
  34791. t += 4,
  34792. this.view[t + 3] = o >>> 24 & 255,
  34793. this.view[t + 2] = o >>> 16 & 255,
  34794. this.view[t + 1] = o >>> 8 & 255,
  34795. this.view[t] = 255 & o) : (this.view[t] = o >>> 24 & 255,
  34796. this.view[t + 1] = o >>> 16 & 255,
  34797. this.view[t + 2] = o >>> 8 & 255,
  34798. this.view[t + 3] = 255 & o,
  34799. t += 4,
  34800. this.view[t] = r >>> 24 & 255,
  34801. this.view[t + 1] = r >>> 16 & 255,
  34802. this.view[t + 2] = r >>> 8 & 255,
  34803. this.view[t + 3] = 255 & r),
  34804. i && (this.offset += 8),
  34805. this
  34806. }
  34807. ,
  34808. a.writeLong = a.writeInt64,
  34809. a.readInt64 = function(e) {
  34810. var t = void 0 === e;
  34811. if (t && (e = this.offset),
  34812. !this.noAssert) {
  34813. if ("number" != typeof e || e % 1 != 0)
  34814. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34815. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength)
  34816. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  34817. }
  34818. var i = 0
  34819. , n = 0;
  34820. this.littleEndian ? (i = this.view[e + 2] << 16,
  34821. i |= this.view[e + 1] << 8,
  34822. i |= this.view[e],
  34823. i += this.view[e + 3] << 24 >>> 0,
  34824. e += 4,
  34825. n = this.view[e + 2] << 16,
  34826. n |= this.view[e + 1] << 8,
  34827. n |= this.view[e],
  34828. n += this.view[e + 3] << 24 >>> 0) : (n = this.view[e + 1] << 16,
  34829. n |= this.view[e + 2] << 8,
  34830. n |= this.view[e + 3],
  34831. n += this.view[e] << 24 >>> 0,
  34832. e += 4,
  34833. i = this.view[e + 1] << 16,
  34834. i |= this.view[e + 2] << 8,
  34835. i |= this.view[e + 3],
  34836. i += this.view[e] << 24 >>> 0);
  34837. var r = new l(i,n,!1);
  34838. return t && (this.offset += 8),
  34839. r
  34840. }
  34841. ,
  34842. a.readLong = a.readInt64,
  34843. a.writeUint64 = function(e, t) {
  34844. var i = void 0 === t;
  34845. if (i && (t = this.offset),
  34846. !this.noAssert) {
  34847. if ("number" == typeof e)
  34848. e = l.fromNumber(e);
  34849. else if ("string" == typeof e)
  34850. e = l.fromString(e);
  34851. else if (!(e && e instanceof l))
  34852. throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  34853. if ("number" != typeof t || t % 1 != 0)
  34854. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34855. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34856. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34857. }
  34858. "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e)),
  34859. t += 8;
  34860. var n = this.buffer.byteLength;
  34861. n < t && this.resize((n *= 2) > t ? n : t),
  34862. t -= 8;
  34863. var r = e.low
  34864. , o = e.high;
  34865. return this.littleEndian ? (this.view[t + 3] = r >>> 24 & 255,
  34866. this.view[t + 2] = r >>> 16 & 255,
  34867. this.view[t + 1] = r >>> 8 & 255,
  34868. this.view[t] = 255 & r,
  34869. t += 4,
  34870. this.view[t + 3] = o >>> 24 & 255,
  34871. this.view[t + 2] = o >>> 16 & 255,
  34872. this.view[t + 1] = o >>> 8 & 255,
  34873. this.view[t] = 255 & o) : (this.view[t] = o >>> 24 & 255,
  34874. this.view[t + 1] = o >>> 16 & 255,
  34875. this.view[t + 2] = o >>> 8 & 255,
  34876. this.view[t + 3] = 255 & o,
  34877. t += 4,
  34878. this.view[t] = r >>> 24 & 255,
  34879. this.view[t + 1] = r >>> 16 & 255,
  34880. this.view[t + 2] = r >>> 8 & 255,
  34881. this.view[t + 3] = 255 & r),
  34882. i && (this.offset += 8),
  34883. this
  34884. }
  34885. ,
  34886. a.writeUInt64 = a.writeUint64,
  34887. a.readUint64 = function(e) {
  34888. var t = void 0 === e;
  34889. if (t && (e = this.offset),
  34890. !this.noAssert) {
  34891. if ("number" != typeof e || e % 1 != 0)
  34892. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34893. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength)
  34894. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  34895. }
  34896. var i = 0
  34897. , n = 0;
  34898. this.littleEndian ? (i = this.view[e + 2] << 16,
  34899. i |= this.view[e + 1] << 8,
  34900. i |= this.view[e],
  34901. i += this.view[e + 3] << 24 >>> 0,
  34902. e += 4,
  34903. n = this.view[e + 2] << 16,
  34904. n |= this.view[e + 1] << 8,
  34905. n |= this.view[e],
  34906. n += this.view[e + 3] << 24 >>> 0) : (n = this.view[e + 1] << 16,
  34907. n |= this.view[e + 2] << 8,
  34908. n |= this.view[e + 3],
  34909. n += this.view[e] << 24 >>> 0,
  34910. e += 4,
  34911. i = this.view[e + 1] << 16,
  34912. i |= this.view[e + 2] << 8,
  34913. i |= this.view[e + 3],
  34914. i += this.view[e] << 24 >>> 0);
  34915. var r = new l(i,n,!0);
  34916. return t && (this.offset += 8),
  34917. r
  34918. }
  34919. ,
  34920. a.readUInt64 = a.readUint64),
  34921. a.writeFloat32 = function(e, t) {
  34922. var i = void 0 === t;
  34923. if (i && (t = this.offset),
  34924. !this.noAssert) {
  34925. if ("number" != typeof e)
  34926. throw TypeError("Illegal value: " + e + " (not a number)");
  34927. if ("number" != typeof t || t % 1 != 0)
  34928. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34929. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34930. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34931. }
  34932. t += 4;
  34933. var n = this.buffer.byteLength;
  34934. return n < t && this.resize((n *= 2) > t ? n : t),
  34935. t -= 4,
  34936. r(this.view, e, t, this.littleEndian, 23, 4),
  34937. i && (this.offset += 4),
  34938. this
  34939. }
  34940. ,
  34941. a.writeFloat = a.writeFloat32,
  34942. a.readFloat32 = function(e) {
  34943. var t = void 0 === e;
  34944. if (t && (e = this.offset),
  34945. !this.noAssert) {
  34946. if ("number" != typeof e || e % 1 != 0)
  34947. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34948. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  34949. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  34950. }
  34951. var i = n(this.view, e, this.littleEndian, 23, 4);
  34952. return t && (this.offset += 4),
  34953. i
  34954. }
  34955. ,
  34956. a.readFloat = a.readFloat32,
  34957. a.writeFloat64 = function(e, t) {
  34958. var i = void 0 === t;
  34959. if (i && (t = this.offset),
  34960. !this.noAssert) {
  34961. if ("number" != typeof e)
  34962. throw TypeError("Illegal value: " + e + " (not a number)");
  34963. if ("number" != typeof t || t % 1 != 0)
  34964. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34965. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34966. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34967. }
  34968. t += 8;
  34969. var n = this.buffer.byteLength;
  34970. return n < t && this.resize((n *= 2) > t ? n : t),
  34971. t -= 8,
  34972. r(this.view, e, t, this.littleEndian, 52, 8),
  34973. i && (this.offset += 8),
  34974. this
  34975. }
  34976. ,
  34977. a.writeDouble = a.writeFloat64,
  34978. a.readFloat64 = function(e) {
  34979. var t = void 0 === e;
  34980. if (t && (e = this.offset),
  34981. !this.noAssert) {
  34982. if ("number" != typeof e || e % 1 != 0)
  34983. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34984. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength)
  34985. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  34986. }
  34987. var i = n(this.view, e, this.littleEndian, 52, 8);
  34988. return t && (this.offset += 8),
  34989. i
  34990. }
  34991. ,
  34992. a.readDouble = a.readFloat64,
  34993. f.MAX_VARINT32_BYTES = 5,
  34994. f.calculateVarint32 = function(e) {
  34995. return (e >>>= 0) < 128 ? 1 : e < 16384 ? 2 : e < 1 << 21 ? 3 : e < 1 << 28 ? 4 : 5
  34996. }
  34997. ,
  34998. f.zigZagEncode32 = function(e) {
  34999. return ((e |= 0) << 1 ^ e >> 31) >>> 0
  35000. }
  35001. ,
  35002. f.zigZagDecode32 = function(e) {
  35003. return e >>> 1 ^ -(1 & e) | 0
  35004. }
  35005. ,
  35006. a.writeVarint32 = function(e, t) {
  35007. var i = void 0 === t;
  35008. if (i && (t = this.offset),
  35009. !this.noAssert) {
  35010. if ("number" != typeof e || e % 1 != 0)
  35011. throw TypeError("Illegal value: " + e + " (not an integer)");
  35012. if (e |= 0,
  35013. "number" != typeof t || t % 1 != 0)
  35014. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35015. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35016. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35017. }
  35018. var n, r = f.calculateVarint32(e);
  35019. t += r;
  35020. var o = this.buffer.byteLength;
  35021. for (o < t && this.resize((o *= 2) > t ? o : t),
  35022. t -= r,
  35023. e >>>= 0; 128 <= e; )
  35024. n = 127 & e | 128,
  35025. this.view[t++] = n,
  35026. e >>>= 7;
  35027. return this.view[t++] = e,
  35028. i ? (this.offset = t,
  35029. this) : r
  35030. }
  35031. ,
  35032. a.writeVarint32ZigZag = function(e, t) {
  35033. return this.writeVarint32(f.zigZagEncode32(e), t)
  35034. }
  35035. ,
  35036. a.readVarint32 = function(e) {
  35037. var t = void 0 === e;
  35038. if (t && (e = this.offset),
  35039. !this.noAssert) {
  35040. if ("number" != typeof e || e % 1 != 0)
  35041. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35042. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35043. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35044. }
  35045. var i, n = 0, r = 0;
  35046. do {
  35047. if (!this.noAssert && e > this.limit) {
  35048. var o = Error("Truncated");
  35049. throw o.truncated = !0,
  35050. o
  35051. }
  35052. i = this.view[e++],
  35053. n < 5 && (r |= (127 & i) << 7 * n),
  35054. ++n
  35055. } while (0 != (128 & i));return r |= 0,
  35056. t ? (this.offset = e,
  35057. r) : {
  35058. value: r,
  35059. length: n
  35060. }
  35061. }
  35062. ,
  35063. a.readVarint32ZigZag = function(e) {
  35064. var t = this.readVarint32(e);
  35065. return "object" == typeof t ? t.value = f.zigZagDecode32(t.value) : t = f.zigZagDecode32(t),
  35066. t
  35067. }
  35068. ,
  35069. l && (f.MAX_VARINT64_BYTES = 10,
  35070. f.calculateVarint64 = function(e) {
  35071. "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e));
  35072. var t = e.toInt() >>> 0
  35073. , i = e.shiftRightUnsigned(28).toInt() >>> 0
  35074. , n = e.shiftRightUnsigned(56).toInt() >>> 0;
  35075. 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
  35076. }
  35077. ,
  35078. f.zigZagEncode64 = function(e) {
  35079. return "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned()),
  35080. e.shiftLeft(1).xor(e.shiftRight(63)).toUnsigned()
  35081. }
  35082. ,
  35083. f.zigZagDecode64 = function(e) {
  35084. return "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned()),
  35085. e.shiftRightUnsigned(1).xor(e.and(l.ONE).toSigned().negate()).toSigned()
  35086. }
  35087. ,
  35088. a.writeVarint64 = function(e, t) {
  35089. var i = void 0 === t;
  35090. if (i && (t = this.offset),
  35091. !this.noAssert) {
  35092. if ("number" == typeof e)
  35093. e = l.fromNumber(e);
  35094. else if ("string" == typeof e)
  35095. e = l.fromString(e);
  35096. else if (!(e && e instanceof l))
  35097. throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  35098. if ("number" != typeof t || t % 1 != 0)
  35099. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35100. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35101. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35102. }
  35103. "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned());
  35104. var n = f.calculateVarint64(e)
  35105. , r = e.toInt() >>> 0
  35106. , o = e.shiftRightUnsigned(28).toInt() >>> 0
  35107. , a = e.shiftRightUnsigned(56).toInt() >>> 0;
  35108. t += n;
  35109. var s = this.buffer.byteLength;
  35110. switch (s < t && this.resize((s *= 2) > t ? s : t),
  35111. t -= n,
  35112. n) {
  35113. case 10:
  35114. this.view[t + 9] = a >>> 7 & 1;
  35115. case 9:
  35116. this.view[t + 8] = 9 !== n ? 128 | a : 127 & a;
  35117. case 8:
  35118. this.view[t + 7] = 8 !== n ? o >>> 21 | 128 : o >>> 21 & 127;
  35119. case 7:
  35120. this.view[t + 6] = 7 !== n ? o >>> 14 | 128 : o >>> 14 & 127;
  35121. case 6:
  35122. this.view[t + 5] = 6 !== n ? o >>> 7 | 128 : o >>> 7 & 127;
  35123. case 5:
  35124. this.view[t + 4] = 5 !== n ? 128 | o : 127 & o;
  35125. case 4:
  35126. this.view[t + 3] = 4 !== n ? r >>> 21 | 128 : r >>> 21 & 127;
  35127. case 3:
  35128. this.view[t + 2] = 3 !== n ? r >>> 14 | 128 : r >>> 14 & 127;
  35129. case 2:
  35130. this.view[t + 1] = 2 !== n ? r >>> 7 | 128 : r >>> 7 & 127;
  35131. case 1:
  35132. this.view[t] = 1 !== n ? 128 | r : 127 & r
  35133. }
  35134. return i ? (this.offset += n,
  35135. this) : n
  35136. }
  35137. ,
  35138. a.writeVarint64ZigZag = function(e, t) {
  35139. return this.writeVarint64(f.zigZagEncode64(e), t)
  35140. }
  35141. ,
  35142. a.readVarint64 = function(e) {
  35143. var t = void 0 === e;
  35144. if (t && (e = this.offset),
  35145. !this.noAssert) {
  35146. if ("number" != typeof e || e % 1 != 0)
  35147. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35148. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35149. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35150. }
  35151. var i = e
  35152. , n = 0
  35153. , r = 0
  35154. , o = 0
  35155. , a = 0;
  35156. if (n = 127 & (a = this.view[e++]),
  35157. 128 & a && (n |= (127 & (a = this.view[e++])) << 7,
  35158. (128 & a || this.noAssert && void 0 === a) && (n |= (127 & (a = this.view[e++])) << 14,
  35159. (128 & a || this.noAssert && void 0 === a) && (n |= (127 & (a = this.view[e++])) << 21,
  35160. (128 & a || this.noAssert && void 0 === a) && (r = 127 & (a = this.view[e++]),
  35161. (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 7,
  35162. (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 14,
  35163. (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 21,
  35164. (128 & a || this.noAssert && void 0 === a) && (o = 127 & (a = this.view[e++]),
  35165. (128 & a || this.noAssert && void 0 === a) && (o |= (127 & (a = this.view[e++])) << 7,
  35166. 128 & a || this.noAssert && void 0 === a))))))))))
  35167. throw Error("Buffer overrun");
  35168. var s = l.fromBits(n | r << 28, r >>> 4 | o << 24, !1);
  35169. return t ? (this.offset = e,
  35170. s) : {
  35171. value: s,
  35172. length: e - i
  35173. }
  35174. }
  35175. ,
  35176. a.readVarint64ZigZag = function(e) {
  35177. var t = this.readVarint64(e);
  35178. return t && t.value instanceof l ? t.value = f.zigZagDecode64(t.value) : t = f.zigZagDecode64(t),
  35179. t
  35180. }
  35181. ),
  35182. a.writeCString = function(e, t) {
  35183. var i = void 0 === t;
  35184. i && (t = this.offset);
  35185. var n, r = e.length;
  35186. if (!this.noAssert) {
  35187. if ("string" != typeof e)
  35188. throw TypeError("Illegal str: Not a string");
  35189. for (n = 0; n < r; ++n)
  35190. if (0 === e.charCodeAt(n))
  35191. throw RangeError("Illegal str: Contains NULL-characters");
  35192. if ("number" != typeof t || t % 1 != 0)
  35193. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35194. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35195. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35196. }
  35197. r = d.calculateUTF16asUTF8(s(e))[1],
  35198. t += r + 1;
  35199. var o = this.buffer.byteLength;
  35200. return o < t && this.resize((o *= 2) > t ? o : t),
  35201. t -= r + 1,
  35202. d.encodeUTF16toUTF8(s(e), function(e) {
  35203. this.view[t++] = e
  35204. }
  35205. .bind(this)),
  35206. this.view[t++] = 0,
  35207. i ? (this.offset = t,
  35208. this) : r
  35209. }
  35210. ,
  35211. a.readCString = function(e) {
  35212. var t = void 0 === e;
  35213. if (t && (e = this.offset),
  35214. !this.noAssert) {
  35215. if ("number" != typeof e || e % 1 != 0)
  35216. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35217. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35218. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35219. }
  35220. var i, n = e, r = -1;
  35221. return d.decodeUTF8toUTF16(function() {
  35222. if (0 === r)
  35223. return null;
  35224. if (e >= this.limit)
  35225. throw RangeError("Illegal range: Truncated data, " + e + " < " + this.limit);
  35226. return 0 === (r = this.view[e++]) ? null : r
  35227. }
  35228. .bind(this), i = c(), !0),
  35229. t ? (this.offset = e,
  35230. i()) : {
  35231. string: i(),
  35232. length: e - n
  35233. }
  35234. }
  35235. ,
  35236. a.writeIString = function(e, t) {
  35237. var i = void 0 === t;
  35238. if (i && (t = this.offset),
  35239. !this.noAssert) {
  35240. if ("string" != typeof e)
  35241. throw TypeError("Illegal str: Not a string");
  35242. if ("number" != typeof t || t % 1 != 0)
  35243. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35244. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35245. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35246. }
  35247. var n, r = t;
  35248. n = d.calculateUTF16asUTF8(s(e), this.noAssert)[1],
  35249. t += 4 + n;
  35250. var o = this.buffer.byteLength;
  35251. if (o < t && this.resize((o *= 2) > t ? o : t),
  35252. t -= 4 + n,
  35253. this.littleEndian ? (this.view[t + 3] = n >>> 24 & 255,
  35254. this.view[t + 2] = n >>> 16 & 255,
  35255. this.view[t + 1] = n >>> 8 & 255,
  35256. this.view[t] = 255 & n) : (this.view[t] = n >>> 24 & 255,
  35257. this.view[t + 1] = n >>> 16 & 255,
  35258. this.view[t + 2] = n >>> 8 & 255,
  35259. this.view[t + 3] = 255 & n),
  35260. t += 4,
  35261. d.encodeUTF16toUTF8(s(e), function(e) {
  35262. this.view[t++] = e
  35263. }
  35264. .bind(this)),
  35265. t !== r + 4 + n)
  35266. throw RangeError("Illegal range: Truncated data, " + t + " == " + (t + 4 + n));
  35267. return i ? (this.offset = t,
  35268. this) : t - r
  35269. }
  35270. ,
  35271. a.readIString = function(e) {
  35272. var t = void 0 === e;
  35273. if (t && (e = this.offset),
  35274. !this.noAssert) {
  35275. if ("number" != typeof e || e % 1 != 0)
  35276. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35277. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  35278. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35279. }
  35280. var i = e
  35281. , n = this.readUint32(e)
  35282. , r = this.readUTF8String(n, f.METRICS_BYTES, e += 4);
  35283. return e += r.length,
  35284. t ? (this.offset = e,
  35285. r.string) : {
  35286. string: r.string,
  35287. length: e - i
  35288. }
  35289. }
  35290. ,
  35291. f.METRICS_CHARS = "c",
  35292. f.METRICS_BYTES = "b",
  35293. a.writeUTF8String = function(e, t) {
  35294. var i = void 0 === t;
  35295. if (i && (t = this.offset),
  35296. !this.noAssert) {
  35297. if ("number" != typeof t || t % 1 != 0)
  35298. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35299. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35300. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35301. }
  35302. var n, r = t;
  35303. n = d.calculateUTF16asUTF8(s(e))[1],
  35304. t += n;
  35305. var o = this.buffer.byteLength;
  35306. return o < t && this.resize((o *= 2) > t ? o : t),
  35307. t -= n,
  35308. d.encodeUTF16toUTF8(s(e), function(e) {
  35309. this.view[t++] = e
  35310. }
  35311. .bind(this)),
  35312. i ? (this.offset = t,
  35313. this) : t - r
  35314. }
  35315. ,
  35316. a.writeString = a.writeUTF8String,
  35317. f.calculateUTF8Chars = function(e) {
  35318. return d.calculateUTF16asUTF8(s(e))[0]
  35319. }
  35320. ,
  35321. f.calculateUTF8Bytes = function(e) {
  35322. return d.calculateUTF16asUTF8(s(e))[1]
  35323. }
  35324. ,
  35325. f.calculateString = f.calculateUTF8Bytes,
  35326. a.readUTF8String = function(e, t, i) {
  35327. "number" == typeof t && (i = t,
  35328. t = void 0);
  35329. var n = void 0 === i;
  35330. if (n && (i = this.offset),
  35331. void 0 === t && (t = f.METRICS_CHARS),
  35332. !this.noAssert) {
  35333. if ("number" != typeof e || e % 1 != 0)
  35334. throw TypeError("Illegal length: " + e + " (not an integer)");
  35335. if (e |= 0,
  35336. "number" != typeof i || i % 1 != 0)
  35337. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35338. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength)
  35339. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35340. }
  35341. var r, o = 0, a = i;
  35342. if (t === f.METRICS_CHARS) {
  35343. if (r = c(),
  35344. d.decodeUTF8(function() {
  35345. return o < e && i < this.limit ? this.view[i++] : null
  35346. }
  35347. .bind(this), function(e) {
  35348. ++o,
  35349. d.UTF8toUTF16(e, r)
  35350. }),
  35351. o !== e)
  35352. throw RangeError("Illegal range: Truncated data, " + o + " == " + e);
  35353. return n ? (this.offset = i,
  35354. r()) : {
  35355. string: r(),
  35356. length: i - a
  35357. }
  35358. }
  35359. if (t !== f.METRICS_BYTES)
  35360. throw TypeError("Unsupported metrics: " + t);
  35361. if (!this.noAssert) {
  35362. if ("number" != typeof i || i % 1 != 0)
  35363. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35364. if ((i >>>= 0) < 0 || i + e > this.buffer.byteLength)
  35365. throw RangeError("Illegal offset: 0 <= " + i + " (+" + e + ") <= " + this.buffer.byteLength)
  35366. }
  35367. var s = i + e;
  35368. if (d.decodeUTF8toUTF16(function() {
  35369. return i < s ? this.view[i++] : null
  35370. }
  35371. .bind(this), r = c(), this.noAssert),
  35372. i !== s)
  35373. throw RangeError("Illegal range: Truncated data, " + i + " == " + s);
  35374. return n ? (this.offset = i,
  35375. r()) : {
  35376. string: r(),
  35377. length: i - a
  35378. }
  35379. }
  35380. ,
  35381. a.readString = a.readUTF8String,
  35382. a.writeVString = function(e, t) {
  35383. var i = void 0 === t;
  35384. if (i && (t = this.offset),
  35385. !this.noAssert) {
  35386. if ("string" != typeof e)
  35387. throw TypeError("Illegal str: Not a string");
  35388. if ("number" != typeof t || t % 1 != 0)
  35389. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35390. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  35391. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35392. }
  35393. var n, r, o = t;
  35394. n = d.calculateUTF16asUTF8(s(e), this.noAssert)[1],
  35395. r = f.calculateVarint32(n),
  35396. t += r + n;
  35397. var a = this.buffer.byteLength;
  35398. if (a < t && this.resize((a *= 2) > t ? a : t),
  35399. t -= r + n,
  35400. t += this.writeVarint32(n, t),
  35401. d.encodeUTF16toUTF8(s(e), function(e) {
  35402. this.view[t++] = e
  35403. }
  35404. .bind(this)),
  35405. t !== o + n + r)
  35406. throw RangeError("Illegal range: Truncated data, " + t + " == " + (t + n + r));
  35407. return i ? (this.offset = t,
  35408. this) : t - o
  35409. }
  35410. ,
  35411. a.readVString = function(e) {
  35412. var t = void 0 === e;
  35413. if (t && (e = this.offset),
  35414. !this.noAssert) {
  35415. if ("number" != typeof e || e % 1 != 0)
  35416. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35417. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  35418. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35419. }
  35420. var i = e
  35421. , n = this.readVarint32(e)
  35422. , r = this.readUTF8String(n.value, f.METRICS_BYTES, e += n.length);
  35423. return e += r.length,
  35424. t ? (this.offset = e,
  35425. r.string) : {
  35426. string: r.string,
  35427. length: e - i
  35428. }
  35429. }
  35430. ,
  35431. a.append = function(e, t, i) {
  35432. "number" != typeof t && "string" == typeof t || (i = t,
  35433. t = void 0);
  35434. var n = void 0 === i;
  35435. if (n && (i = this.offset),
  35436. !this.noAssert) {
  35437. if ("number" != typeof i || i % 1 != 0)
  35438. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35439. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength)
  35440. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35441. }
  35442. e instanceof f || (e = f.wrap(e, t));
  35443. var r = e.limit - e.offset;
  35444. if (r <= 0)
  35445. return this;
  35446. i += r;
  35447. var o = this.buffer.byteLength;
  35448. return o < i && this.resize((o *= 2) > i ? o : i),
  35449. i -= r,
  35450. this.view.set(e.view.subarray(e.offset, e.limit), i),
  35451. e.offset += r,
  35452. n && (this.offset += r),
  35453. this
  35454. }
  35455. ,
  35456. a.appendTo = function(e, t) {
  35457. return e.append(this, t),
  35458. this
  35459. }
  35460. ,
  35461. a.assert = function(e) {
  35462. return this.noAssert = !e,
  35463. this
  35464. }
  35465. ,
  35466. a.capacity = function() {
  35467. return this.buffer.byteLength
  35468. }
  35469. ,
  35470. a.clear = function() {
  35471. return this.offset = 0,
  35472. this.limit = this.buffer.byteLength,
  35473. this.markedOffset = -1,
  35474. this
  35475. }
  35476. ,
  35477. a.clone = function(e) {
  35478. var t = new f(0,this.littleEndian,this.noAssert);
  35479. return e ? (t.buffer = new ArrayBuffer(this.buffer.byteLength),
  35480. t.view = new Uint8Array(t.buffer)) : (t.buffer = this.buffer,
  35481. t.view = this.view),
  35482. t.offset = this.offset,
  35483. t.markedOffset = this.markedOffset,
  35484. t.limit = this.limit,
  35485. t
  35486. }
  35487. ,
  35488. a.compact = function(e, t) {
  35489. if (void 0 === e && (e = this.offset),
  35490. void 0 === t && (t = this.limit),
  35491. !this.noAssert) {
  35492. if ("number" != typeof e || e % 1 != 0)
  35493. throw TypeError("Illegal begin: Not an integer");
  35494. if (e >>>= 0,
  35495. "number" != typeof t || t % 1 != 0)
  35496. throw TypeError("Illegal end: Not an integer");
  35497. if (t >>>= 0,
  35498. e < 0 || t < e || t > this.buffer.byteLength)
  35499. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35500. }
  35501. if (0 === e && t === this.buffer.byteLength)
  35502. return this;
  35503. var i = t - e;
  35504. if (0 == i)
  35505. return this.buffer = o,
  35506. this.view = null,
  35507. 0 <= this.markedOffset && (this.markedOffset -= e),
  35508. this.offset = 0,
  35509. this.limit = 0,
  35510. this;
  35511. var n = new ArrayBuffer(i)
  35512. , r = new Uint8Array(n);
  35513. return r.set(this.view.subarray(e, t)),
  35514. this.buffer = n,
  35515. this.view = r,
  35516. 0 <= this.markedOffset && (this.markedOffset -= e),
  35517. this.offset = 0,
  35518. this.limit = i,
  35519. this
  35520. }
  35521. ,
  35522. a.copy = function(e, t) {
  35523. if (void 0 === e && (e = this.offset),
  35524. void 0 === t && (t = this.limit),
  35525. !this.noAssert) {
  35526. if ("number" != typeof e || e % 1 != 0)
  35527. throw TypeError("Illegal begin: Not an integer");
  35528. if (e >>>= 0,
  35529. "number" != typeof t || t % 1 != 0)
  35530. throw TypeError("Illegal end: Not an integer");
  35531. if (t >>>= 0,
  35532. e < 0 || t < e || t > this.buffer.byteLength)
  35533. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35534. }
  35535. if (e === t)
  35536. return new f(0,this.littleEndian,this.noAssert);
  35537. var i = t - e
  35538. , n = new f(i,this.littleEndian,this.noAssert);
  35539. return n.offset = 0,
  35540. n.limit = i,
  35541. 0 <= n.markedOffset && (n.markedOffset -= e),
  35542. this.copyTo(n, 0, e, t),
  35543. n
  35544. }
  35545. ,
  35546. a.copyTo = function(e, t, i, n) {
  35547. var r, o;
  35548. if (!this.noAssert && !f.isByteBuffer(e))
  35549. throw TypeError("Illegal target: Not a ByteBuffer");
  35550. if (t = (o = void 0 === t) ? e.offset : 0 | t,
  35551. i = (r = void 0 === i) ? this.offset : 0 | i,
  35552. n = void 0 === n ? this.limit : 0 | n,
  35553. t < 0 || t > e.buffer.byteLength)
  35554. throw RangeError("Illegal target range: 0 <= " + t + " <= " + e.buffer.byteLength);
  35555. if (i < 0 || n > this.buffer.byteLength)
  35556. throw RangeError("Illegal source range: 0 <= " + i + " <= " + this.buffer.byteLength);
  35557. var a = n - i;
  35558. return 0 == a ? e : (e.ensureCapacity(t + a),
  35559. e.view.set(this.view.subarray(i, n), t),
  35560. r && (this.offset += a),
  35561. o && (e.offset += a),
  35562. this)
  35563. }
  35564. ,
  35565. a.ensureCapacity = function(e) {
  35566. var t = this.buffer.byteLength;
  35567. return t < e ? this.resize((t *= 2) > e ? t : e) : this
  35568. }
  35569. ,
  35570. a.fill = function(e, t, i) {
  35571. var n = void 0 === t;
  35572. if (n && (t = this.offset),
  35573. "string" == typeof e && 0 < e.length && (e = e.charCodeAt(0)),
  35574. void 0 === t && (t = this.offset),
  35575. void 0 === i && (i = this.limit),
  35576. !this.noAssert) {
  35577. if ("number" != typeof e || e % 1 != 0)
  35578. throw TypeError("Illegal value: " + e + " (not an integer)");
  35579. if (e |= 0,
  35580. "number" != typeof t || t % 1 != 0)
  35581. throw TypeError("Illegal begin: Not an integer");
  35582. if (t >>>= 0,
  35583. "number" != typeof i || i % 1 != 0)
  35584. throw TypeError("Illegal end: Not an integer");
  35585. if (i >>>= 0,
  35586. t < 0 || i < t || i > this.buffer.byteLength)
  35587. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  35588. }
  35589. if (i <= t)
  35590. return this;
  35591. for (; t < i; )
  35592. this.view[t++] = e;
  35593. return n && (this.offset = t),
  35594. this
  35595. }
  35596. ,
  35597. a.flip = function() {
  35598. return this.limit = this.offset,
  35599. this.offset = 0,
  35600. this
  35601. }
  35602. ,
  35603. a.mark = function(e) {
  35604. if (e = void 0 === e ? this.offset : e,
  35605. !this.noAssert) {
  35606. if ("number" != typeof e || e % 1 != 0)
  35607. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35608. if ((e >>>= 0) < 0 || e + 0 > this.buffer.byteLength)
  35609. throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
  35610. }
  35611. return this.markedOffset = e,
  35612. this
  35613. }
  35614. ,
  35615. a.order = function(e) {
  35616. if (!this.noAssert && "boolean" != typeof e)
  35617. throw TypeError("Illegal littleEndian: Not a boolean");
  35618. return this.littleEndian = !!e,
  35619. this
  35620. }
  35621. ,
  35622. a.LE = function(e) {
  35623. return this.littleEndian = void 0 === e || !!e,
  35624. this
  35625. }
  35626. ,
  35627. a.BE = function(e) {
  35628. return this.littleEndian = void 0 !== e && !e,
  35629. this
  35630. }
  35631. ,
  35632. a.prepend = function(e, t, i) {
  35633. "number" != typeof t && "string" == typeof t || (i = t,
  35634. t = void 0);
  35635. var n = void 0 === i;
  35636. if (n && (i = this.offset),
  35637. !this.noAssert) {
  35638. if ("number" != typeof i || i % 1 != 0)
  35639. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35640. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength)
  35641. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35642. }
  35643. e instanceof f || (e = f.wrap(e, t));
  35644. var r = e.limit - e.offset;
  35645. if (r <= 0)
  35646. return this;
  35647. var o = r - i;
  35648. if (0 < o) {
  35649. var a = new ArrayBuffer(this.buffer.byteLength + o)
  35650. , s = new Uint8Array(a);
  35651. s.set(this.view.subarray(i, this.buffer.byteLength), r),
  35652. this.buffer = a,
  35653. this.view = s,
  35654. this.offset += o,
  35655. 0 <= this.markedOffset && (this.markedOffset += o),
  35656. this.limit += o,
  35657. i += o
  35658. } else
  35659. new Uint8Array(this.buffer);
  35660. return this.view.set(e.view.subarray(e.offset, e.limit), i - r),
  35661. e.offset = e.limit,
  35662. n && (this.offset -= r),
  35663. this
  35664. }
  35665. ,
  35666. a.prependTo = function(e, t) {
  35667. return e.prepend(this, t),
  35668. this
  35669. }
  35670. ,
  35671. a.printDebug = function(e) {
  35672. "function" != typeof e && (e = console.log.bind(console)),
  35673. e(this.toString() + "\n-------------------------------------------------------------------\n" + this.toDebug(!0))
  35674. }
  35675. ,
  35676. a.remaining = function() {
  35677. return this.limit - this.offset
  35678. }
  35679. ,
  35680. a.reset = function() {
  35681. return 0 <= this.markedOffset ? (this.offset = this.markedOffset,
  35682. this.markedOffset = -1) : this.offset = 0,
  35683. this
  35684. }
  35685. ,
  35686. a.resize = function(e) {
  35687. if (!this.noAssert) {
  35688. if ("number" != typeof e || e % 1 != 0)
  35689. throw TypeError("Illegal capacity: " + e + " (not an integer)");
  35690. if ((e |= 0) < 0)
  35691. throw RangeError("Illegal capacity: 0 <= " + e)
  35692. }
  35693. if (this.buffer.byteLength < e) {
  35694. var t = new ArrayBuffer(e)
  35695. , i = new Uint8Array(t);
  35696. i.set(this.view),
  35697. this.buffer = t,
  35698. this.view = i
  35699. }
  35700. return this
  35701. }
  35702. ,
  35703. a.reverse = function(e, t) {
  35704. if (void 0 === e && (e = this.offset),
  35705. void 0 === t && (t = this.limit),
  35706. !this.noAssert) {
  35707. if ("number" != typeof e || e % 1 != 0)
  35708. throw TypeError("Illegal begin: Not an integer");
  35709. if (e >>>= 0,
  35710. "number" != typeof t || t % 1 != 0)
  35711. throw TypeError("Illegal end: Not an integer");
  35712. if (t >>>= 0,
  35713. e < 0 || t < e || t > this.buffer.byteLength)
  35714. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35715. }
  35716. return e === t || Array.prototype.reverse.call(this.view.subarray(e, t)),
  35717. this
  35718. }
  35719. ,
  35720. a.skip = function(e) {
  35721. if (!this.noAssert) {
  35722. if ("number" != typeof e || e % 1 != 0)
  35723. throw TypeError("Illegal length: " + e + " (not an integer)");
  35724. e |= 0
  35725. }
  35726. var t = this.offset + e;
  35727. if (!this.noAssert && (t < 0 || t > this.buffer.byteLength))
  35728. throw RangeError("Illegal length: 0 <= " + this.offset + " + " + e + " <= " + this.buffer.byteLength);
  35729. return this.offset = t,
  35730. this
  35731. }
  35732. ,
  35733. a.slice = function(e, t) {
  35734. if (void 0 === e && (e = this.offset),
  35735. void 0 === t && (t = this.limit),
  35736. !this.noAssert) {
  35737. if ("number" != typeof e || e % 1 != 0)
  35738. throw TypeError("Illegal begin: Not an integer");
  35739. if (e >>>= 0,
  35740. "number" != typeof t || t % 1 != 0)
  35741. throw TypeError("Illegal end: Not an integer");
  35742. if (t >>>= 0,
  35743. e < 0 || t < e || t > this.buffer.byteLength)
  35744. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35745. }
  35746. var i = this.clone();
  35747. return i.offset = e,
  35748. i.limit = t,
  35749. i
  35750. }
  35751. ,
  35752. a.toBuffer = function(e) {
  35753. var t = this.offset
  35754. , i = this.limit;
  35755. if (!this.noAssert) {
  35756. if ("number" != typeof t || t % 1 != 0)
  35757. throw TypeError("Illegal offset: Not an integer");
  35758. if (t >>>= 0,
  35759. "number" != typeof i || i % 1 != 0)
  35760. throw TypeError("Illegal limit: Not an integer");
  35761. if (i >>>= 0,
  35762. t < 0 || i < t || i > this.buffer.byteLength)
  35763. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  35764. }
  35765. if (!e && 0 === t && i === this.buffer.byteLength)
  35766. return this.buffer;
  35767. if (t === i)
  35768. return o;
  35769. var n = new ArrayBuffer(i - t);
  35770. return new Uint8Array(n).set(new Uint8Array(this.buffer).subarray(t, i), 0),
  35771. n
  35772. }
  35773. ,
  35774. a.toArrayBuffer = a.toBuffer,
  35775. a.toString = function(e, t, i) {
  35776. if (void 0 === e)
  35777. return "ByteBufferAB(offset=" + this.offset + ",markedOffset=" + this.markedOffset + ",limit=" + this.limit + ",capacity=" + this.capacity() + ")";
  35778. switch ("number" == typeof e && (i = t = e = "utf8"),
  35779. e) {
  35780. case "utf8":
  35781. return this.toUTF8(t, i);
  35782. case "base64":
  35783. return this.toBase64(t, i);
  35784. case "hex":
  35785. return this.toHex(t, i);
  35786. case "binary":
  35787. return this.toBinary(t, i);
  35788. case "debug":
  35789. return this.toDebug();
  35790. case "columns":
  35791. return this.toColumns();
  35792. default:
  35793. throw Error("Unsupported encoding: " + e)
  35794. }
  35795. }
  35796. ;
  35797. var h = function() {
  35798. 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)
  35799. a[r[t]] = t;
  35800. return e.encode = function(e, t) {
  35801. for (var i, n; null !== (i = e()); )
  35802. t(r[i >> 2 & 63]),
  35803. n = (3 & i) << 4,
  35804. null !== (i = e()) ? (t(r[63 & ((n |= i >> 4 & 15) | i >> 4 & 15)]),
  35805. n = (15 & i) << 2,
  35806. null !== (i = e()) ? (t(r[63 & (n | i >> 6 & 3)]),
  35807. t(r[63 & i])) : (t(r[63 & n]),
  35808. t(61))) : (t(r[63 & n]),
  35809. t(61),
  35810. t(61))
  35811. }
  35812. ,
  35813. e.decode = function(e, t) {
  35814. function i(e) {
  35815. throw Error("Illegal character code: " + e)
  35816. }
  35817. for (var n, r, o; null !== (n = e()); )
  35818. if (void 0 === (r = a[n]) && i(n),
  35819. null !== (n = e()) && (void 0 === (o = a[n]) && i(n),
  35820. t(r << 2 >>> 0 | (48 & o) >> 4),
  35821. null !== (n = e()))) {
  35822. if (void 0 === (r = a[n])) {
  35823. if (61 === n)
  35824. break;
  35825. i(n)
  35826. }
  35827. if (t((15 & o) << 4 >>> 0 | (60 & r) >> 2),
  35828. null !== (n = e())) {
  35829. if (void 0 === (o = a[n])) {
  35830. if (61 === n)
  35831. break;
  35832. i(n)
  35833. }
  35834. t((3 & r) << 6 >>> 0 | o)
  35835. }
  35836. }
  35837. }
  35838. ,
  35839. e.test = function(e) {
  35840. return /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)
  35841. }
  35842. ,
  35843. e
  35844. }();
  35845. a.toBase64 = function(e, t) {
  35846. if (void 0 === e && (e = this.offset),
  35847. void 0 === t && (t = this.limit),
  35848. t |= 0,
  35849. (e |= 0) < 0 || t > this.capacity || t < e)
  35850. throw RangeError("begin, end");
  35851. var i;
  35852. return h.encode(function() {
  35853. return e < t ? this.view[e++] : null
  35854. }
  35855. .bind(this), i = c()),
  35856. i()
  35857. }
  35858. ,
  35859. f.fromBase64 = function(e, t) {
  35860. if ("string" != typeof e)
  35861. throw TypeError("str");
  35862. var i = new f(e.length / 4 * 3,t)
  35863. , n = 0;
  35864. return h.decode(s(e), function(e) {
  35865. i.view[n++] = e
  35866. }),
  35867. i.limit = n,
  35868. i
  35869. }
  35870. ,
  35871. f.btoa = function(e) {
  35872. return f.fromBinary(e).toBase64()
  35873. }
  35874. ,
  35875. f.atob = function(e) {
  35876. return f.fromBase64(e).toBinary()
  35877. }
  35878. ,
  35879. a.toBinary = function(e, t) {
  35880. if (void 0 === e && (e = this.offset),
  35881. void 0 === t && (t = this.limit),
  35882. t |= 0,
  35883. (e |= 0) < 0 || t > this.capacity() || t < e)
  35884. throw RangeError("begin, end");
  35885. if (e === t)
  35886. return "";
  35887. for (var i = [], n = []; e < t; )
  35888. i.push(this.view[e++]),
  35889. 1024 <= i.length && (n.push(String.fromCharCode.apply(String, i)),
  35890. i = []);
  35891. return n.join("") + String.fromCharCode.apply(String, i)
  35892. }
  35893. ,
  35894. f.fromBinary = function(e, t) {
  35895. if ("string" != typeof e)
  35896. throw TypeError("str");
  35897. for (var i, n = 0, r = e.length, o = new f(r,t); n < r; ) {
  35898. if (255 < (i = e.charCodeAt(n)))
  35899. throw RangeError("illegal char code: " + i);
  35900. o.view[n++] = i
  35901. }
  35902. return o.limit = r,
  35903. o
  35904. }
  35905. ,
  35906. a.toDebug = function(e) {
  35907. for (var t, i = -1, n = this.buffer.byteLength, r = "", o = "", a = ""; i < n; ) {
  35908. if (-1 !== i && (r += (t = this.view[i]) < 16 ? "0" + t.toString(16).toUpperCase() : t.toString(16).toUpperCase(),
  35909. e && (o += 32 < t && t < 127 ? String.fromCharCode(t) : ".")),
  35910. ++i,
  35911. e && 0 < i && i % 16 == 0 && i !== n) {
  35912. for (; r.length < 51; )
  35913. r += " ";
  35914. a += r + o + "\n",
  35915. r = o = ""
  35916. }
  35917. 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 ? " " : ""
  35918. }
  35919. if (e && " " !== r) {
  35920. for (; r.length < 51; )
  35921. r += " ";
  35922. a += r + o + "\n"
  35923. }
  35924. return e ? a : r
  35925. }
  35926. ,
  35927. f.fromDebug = function(e, t, i) {
  35928. 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; ) {
  35929. switch (n = e.charAt(s++)) {
  35930. case "!":
  35931. if (!i) {
  35932. if (h || u || d) {
  35933. p = !0;
  35934. break
  35935. }
  35936. h = u = d = !0
  35937. }
  35938. a.offset = a.markedOffset = a.limit = l,
  35939. c = !1;
  35940. break;
  35941. case "|":
  35942. if (!i) {
  35943. if (h || d) {
  35944. p = !0;
  35945. break
  35946. }
  35947. h = d = !0
  35948. }
  35949. a.offset = a.limit = l,
  35950. c = !1;
  35951. break;
  35952. case "[":
  35953. if (!i) {
  35954. if (h || u) {
  35955. p = !0;
  35956. break
  35957. }
  35958. h = u = !0
  35959. }
  35960. a.offset = a.markedOffset = l,
  35961. c = !1;
  35962. break;
  35963. case "<":
  35964. if (!i) {
  35965. if (h) {
  35966. p = !0;
  35967. break
  35968. }
  35969. h = !0
  35970. }
  35971. a.offset = l,
  35972. c = !1;
  35973. break;
  35974. case "]":
  35975. if (!i) {
  35976. if (d || u) {
  35977. p = !0;
  35978. break
  35979. }
  35980. d = u = !0
  35981. }
  35982. a.limit = a.markedOffset = l,
  35983. c = !1;
  35984. break;
  35985. case ">":
  35986. if (!i) {
  35987. if (d) {
  35988. p = !0;
  35989. break
  35990. }
  35991. d = !0
  35992. }
  35993. a.limit = l,
  35994. c = !1;
  35995. break;
  35996. case "'":
  35997. if (!i) {
  35998. if (u) {
  35999. p = !0;
  36000. break
  36001. }
  36002. u = !0
  36003. }
  36004. a.markedOffset = l,
  36005. c = !1;
  36006. break;
  36007. case " ":
  36008. c = !1;
  36009. break;
  36010. default:
  36011. if (!i && c) {
  36012. p = !0;
  36013. break
  36014. }
  36015. if (r = parseInt(n + e.charAt(s++), 16),
  36016. !i && (isNaN(r) || r < 0 || 255 < r))
  36017. throw TypeError("Illegal str: Not a debug encoded string");
  36018. a.view[l++] = r,
  36019. c = !0
  36020. }
  36021. if (p)
  36022. throw TypeError("Illegal str: Invalid symbol at " + s)
  36023. }
  36024. if (!i) {
  36025. if (!h || !d)
  36026. throw TypeError("Illegal str: Missing offset or limit");
  36027. if (l < a.buffer.byteLength)
  36028. throw TypeError("Illegal str: Not a debug encoded string (is it hex?) " + l + " < " + o)
  36029. }
  36030. return a
  36031. }
  36032. ,
  36033. a.toHex = function(e, t) {
  36034. if (e = void 0 === e ? this.offset : e,
  36035. t = void 0 === t ? this.limit : t,
  36036. !this.noAssert) {
  36037. if ("number" != typeof e || e % 1 != 0)
  36038. throw TypeError("Illegal begin: Not an integer");
  36039. if (e >>>= 0,
  36040. "number" != typeof t || t % 1 != 0)
  36041. throw TypeError("Illegal end: Not an integer");
  36042. if (t >>>= 0,
  36043. e < 0 || t < e || t > this.buffer.byteLength)
  36044. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  36045. }
  36046. for (var i, n = new Array(t - e); e < t; )
  36047. (i = this.view[e++]) < 16 ? n.push("0", i.toString(16)) : n.push(i.toString(16));
  36048. return n.join("")
  36049. }
  36050. ,
  36051. f.fromHex = function(e, t, i) {
  36052. if (!i) {
  36053. if ("string" != typeof e)
  36054. throw TypeError("Illegal str: Not a string");
  36055. if (e.length % 2 != 0)
  36056. throw TypeError("Illegal str: Length not a multiple of 2")
  36057. }
  36058. for (var n, r = e.length, o = new f(r / 2 | 0,t), a = 0, s = 0; a < r; a += 2) {
  36059. if (n = parseInt(e.substring(a, a + 2), 16),
  36060. !i && (!isFinite(n) || n < 0 || 255 < n))
  36061. throw TypeError("Illegal str: Contains non-hex characters");
  36062. o.view[s++] = n
  36063. }
  36064. return o.limit = s,
  36065. o
  36066. }
  36067. ;
  36068. var u, d = u = {
  36069. MAX_CODEPOINT: 1114111,
  36070. encodeUTF8: function(e, t) {
  36071. var i = null;
  36072. for ("number" == typeof e && (i = e,
  36073. e = function() {
  36074. return null
  36075. }
  36076. ); null !== i || null !== (i = e()); )
  36077. i < 128 ? t(127 & i) : (i < 2048 ? t(i >> 6 & 31 | 192) : (i < 65536 ? t(i >> 12 & 15 | 224) : (t(i >> 18 & 7 | 240),
  36078. t(i >> 12 & 63 | 128)),
  36079. t(i >> 6 & 63 | 128)),
  36080. t(63 & i | 128)),
  36081. i = null
  36082. },
  36083. decodeUTF8: function(e, t) {
  36084. for (var i, n, r, o, a = function(e) {
  36085. e = e.slice(0, e.indexOf(null));
  36086. var t = Error(e.toString());
  36087. throw t.name = "TruncatedError",
  36088. t.bytes = e,
  36089. t
  36090. }; null !== (i = e()); )
  36091. if (0 == (128 & i))
  36092. t(i);
  36093. else if (192 == (224 & i))
  36094. null === (n = e()) && a([i, n]),
  36095. t((31 & i) << 6 | 63 & n);
  36096. else if (224 == (240 & i))
  36097. null !== (n = e()) && null !== (r = e()) || a([i, n, r]),
  36098. t((15 & i) << 12 | (63 & n) << 6 | 63 & r);
  36099. else {
  36100. if (240 != (248 & i))
  36101. throw RangeError("Illegal starting byte: " + i);
  36102. null !== (n = e()) && null !== (r = e()) && null !== (o = e()) || a([i, n, r, o]),
  36103. t((7 & i) << 18 | (63 & n) << 12 | (63 & r) << 6 | 63 & o)
  36104. }
  36105. },
  36106. UTF16toUTF8: function(e, t) {
  36107. for (var i, n = null; null !== (i = null !== n ? n : e()); )
  36108. 55296 <= i && i <= 57343 && null !== (n = e()) && 56320 <= n && n <= 57343 ? (t(1024 * (i - 55296) + n - 56320 + 65536),
  36109. n = null) : t(i);
  36110. null !== n && t(n)
  36111. },
  36112. UTF8toUTF16: function(e, t) {
  36113. var i = null;
  36114. for ("number" == typeof e && (i = e,
  36115. e = function() {
  36116. return null
  36117. }
  36118. ); null !== i || null !== (i = e()); )
  36119. i <= 65535 ? t(i) : (t(55296 + ((i -= 65536) >> 10)),
  36120. t(i % 1024 + 56320)),
  36121. i = null
  36122. },
  36123. encodeUTF16toUTF8: function(e, t) {
  36124. u.UTF16toUTF8(e, function(e) {
  36125. u.encodeUTF8(e, t)
  36126. })
  36127. },
  36128. decodeUTF8toUTF16: function(e, t) {
  36129. u.decodeUTF8(e, function(e) {
  36130. u.UTF8toUTF16(e, t)
  36131. })
  36132. },
  36133. calculateCodePoint: function(e) {
  36134. return e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  36135. },
  36136. calculateUTF8: function(e) {
  36137. for (var t, i = 0; null !== (t = e()); )
  36138. i += t < 128 ? 1 : t < 2048 ? 2 : t < 65536 ? 3 : 4;
  36139. return i
  36140. },
  36141. calculateUTF16asUTF8: function(e) {
  36142. var t = 0
  36143. , i = 0;
  36144. return u.UTF16toUTF8(e, function(e) {
  36145. ++t,
  36146. i += e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  36147. }),
  36148. [t, i]
  36149. }
  36150. };
  36151. return a.toUTF8 = function(t, i) {
  36152. if (void 0 === t && (t = this.offset),
  36153. void 0 === i && (i = this.limit),
  36154. !this.noAssert) {
  36155. if ("number" != typeof t || t % 1 != 0)
  36156. throw TypeError("Illegal begin: Not an integer");
  36157. if (t >>>= 0,
  36158. "number" != typeof i || i % 1 != 0)
  36159. throw TypeError("Illegal end: Not an integer");
  36160. if (i >>>= 0,
  36161. t < 0 || i < t || i > this.buffer.byteLength)
  36162. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  36163. }
  36164. var e;
  36165. try {
  36166. d.decodeUTF8toUTF16(function() {
  36167. return t < i ? this.view[t++] : null
  36168. }
  36169. .bind(this), e = c())
  36170. } catch (e) {
  36171. if (t !== i)
  36172. throw RangeError("Illegal range: Truncated data, " + t + " != " + i)
  36173. }
  36174. return e()
  36175. }
  36176. ,
  36177. f.fromUTF8 = function(e, t, i) {
  36178. if (!i && "string" != typeof e)
  36179. throw TypeError("Illegal str: Not a string");
  36180. var n = new f(d.calculateUTF16asUTF8(s(e), !0)[1],t,i)
  36181. , r = 0;
  36182. return d.encodeUTF16toUTF8(s(e), function(e) {
  36183. n.view[r++] = e
  36184. }),
  36185. n.limit = r,
  36186. n
  36187. }
  36188. ,
  36189. f
  36190. }
  36191. ,
  36192. "function" == typeof define && define.amd ? define(["long"], r) : "function" == typeof t && "object" == typeof e && e && e.exports ? e.exports = function() {
  36193. var e;
  36194. try {
  36195. e = t("long")
  36196. } catch (e) {}
  36197. return r(e)
  36198. }() : (n.dcodeIO = n.dcodeIO || {}).ByteBuffer = r(n.dcodeIO.Long)
  36199. }
  36200. , {
  36201. long: 216
  36202. }],
  36203. 216: [function(e, t, i) {
  36204. var n, r;
  36205. n = this,
  36206. r = function() {
  36207. "use strict";
  36208. function n(e, t, i) {
  36209. this.low = 0 | e,
  36210. this.high = 0 | t,
  36211. this.unsigned = !!i
  36212. }
  36213. function p(e) {
  36214. return !0 === (e && e.__isLong__)
  36215. }
  36216. function e(e, t) {
  36217. var i, n, r;
  36218. return t ? (r = 0 <= (e >>>= 0) && e < 256) && (n = a[e]) ? n : (i = g(e, (0 | e) < 0 ? -1 : 0, !0),
  36219. r && (a[e] = i),
  36220. i) : (r = -128 <= (e |= 0) && e < 128) && (n = o[e]) ? n : (i = g(e, e < 0 ? -1 : 0, !1),
  36221. r && (o[e] = i),
  36222. i)
  36223. }
  36224. function f(e, t) {
  36225. if (isNaN(e) || !isFinite(e))
  36226. return t ? l : y;
  36227. if (t) {
  36228. if (e < 0)
  36229. return l;
  36230. if (r <= e)
  36231. return I
  36232. } else {
  36233. if (e <= -s)
  36234. return E;
  36235. if (s <= e + 1)
  36236. return C
  36237. }
  36238. return e < 0 ? f(-e, t).neg() : g(e % i | 0, e / i | 0, t)
  36239. }
  36240. function g(e, t, i) {
  36241. return new n(e,t,i)
  36242. }
  36243. function h(e, t, i) {
  36244. if (0 === e.length)
  36245. throw Error("empty string");
  36246. if ("NaN" === e || "Infinity" === e || "+Infinity" === e || "-Infinity" === e)
  36247. return y;
  36248. if (t = "number" == typeof t ? (i = t,
  36249. !1) : !!t,
  36250. (i = i || 10) < 2 || 36 < i)
  36251. throw RangeError("radix");
  36252. var n;
  36253. if (0 < (n = e.indexOf("-")))
  36254. throw Error("interior hyphen");
  36255. if (0 === n)
  36256. return h(e.substring(1), t, i).neg();
  36257. for (var r = f(u(i, 8)), o = y, a = 0; a < e.length; a += 8) {
  36258. var s = Math.min(8, e.length - a)
  36259. , l = parseInt(e.substring(a, a + s), i);
  36260. if (s < 8) {
  36261. var c = f(u(i, s));
  36262. o = o.mul(c).add(f(l))
  36263. } else
  36264. o = (o = o.mul(r)).add(f(l))
  36265. }
  36266. return o.unsigned = t,
  36267. o
  36268. }
  36269. function m(e) {
  36270. return e instanceof n ? e : "number" == typeof e ? f(e) : "string" == typeof e ? h(e) : g(e.low, e.high, e.unsigned)
  36271. }
  36272. Object.defineProperty(n.prototype, "__isLong__", {
  36273. value: !0,
  36274. enumerable: !1,
  36275. configurable: !1
  36276. }),
  36277. n.isLong = p;
  36278. var o = {}
  36279. , a = {};
  36280. n.fromInt = e,
  36281. n.fromNumber = f,
  36282. n.fromBits = g;
  36283. var u = Math.pow;
  36284. n.fromString = h,
  36285. n.fromValue = m;
  36286. var i = 4294967296
  36287. , r = 0x10000000000000000
  36288. , s = r / 2
  36289. , v = e(1 << 24)
  36290. , y = e(0);
  36291. n.ZERO = y;
  36292. var l = e(0, !0);
  36293. n.UZERO = l;
  36294. var c = e(1);
  36295. n.ONE = c;
  36296. var d = e(1, !0);
  36297. n.UONE = d;
  36298. var A = e(-1);
  36299. n.NEG_ONE = A;
  36300. var C = g(-1, 2147483647, !1);
  36301. n.MAX_VALUE = C;
  36302. var I = g(-1, -1, !0);
  36303. n.MAX_UNSIGNED_VALUE = I;
  36304. var E = g(0, -2147483648, !1);
  36305. n.MIN_VALUE = E;
  36306. var t = n.prototype;
  36307. return t.toInt = function() {
  36308. return this.unsigned ? this.low >>> 0 : this.low
  36309. }
  36310. ,
  36311. t.toNumber = function() {
  36312. return this.unsigned ? (this.high >>> 0) * i + (this.low >>> 0) : this.high * i + (this.low >>> 0)
  36313. }
  36314. ,
  36315. t.toString = function(e) {
  36316. if ((e = e || 10) < 2 || 36 < e)
  36317. throw RangeError("radix");
  36318. if (this.isZero())
  36319. return "0";
  36320. if (this.isNegative()) {
  36321. if (this.eq(E)) {
  36322. var t = f(e)
  36323. , i = this.div(t)
  36324. , n = i.mul(t).sub(this);
  36325. return i.toString(e) + n.toInt().toString(e)
  36326. }
  36327. return "-" + this.neg().toString(e)
  36328. }
  36329. for (var r = f(u(e, 6), this.unsigned), o = this, a = ""; ; ) {
  36330. var s = o.div(r)
  36331. , l = (o.sub(s.mul(r)).toInt() >>> 0).toString(e);
  36332. if ((o = s).isZero())
  36333. return l + a;
  36334. for (; l.length < 6; )
  36335. l = "0" + l;
  36336. a = "" + l + a
  36337. }
  36338. }
  36339. ,
  36340. t.getHighBits = function() {
  36341. return this.high
  36342. }
  36343. ,
  36344. t.getHighBitsUnsigned = function() {
  36345. return this.high >>> 0
  36346. }
  36347. ,
  36348. t.getLowBits = function() {
  36349. return this.low
  36350. }
  36351. ,
  36352. t.getLowBitsUnsigned = function() {
  36353. return this.low >>> 0
  36354. }
  36355. ,
  36356. t.getNumBitsAbs = function() {
  36357. if (this.isNegative())
  36358. return this.eq(E) ? 64 : this.neg().getNumBitsAbs();
  36359. for (var e = 0 != this.high ? this.high : this.low, t = 31; 0 < t && 0 == (e & 1 << t); t--)
  36360. ;
  36361. return 0 != this.high ? t + 33 : t + 1
  36362. }
  36363. ,
  36364. t.isZero = function() {
  36365. return 0 === this.high && 0 === this.low
  36366. }
  36367. ,
  36368. t.isNegative = function() {
  36369. return !this.unsigned && this.high < 0
  36370. }
  36371. ,
  36372. t.isPositive = function() {
  36373. return this.unsigned || 0 <= this.high
  36374. }
  36375. ,
  36376. t.isOdd = function() {
  36377. return 1 == (1 & this.low)
  36378. }
  36379. ,
  36380. t.isEven = function() {
  36381. return 0 == (1 & this.low)
  36382. }
  36383. ,
  36384. t.equals = function(e) {
  36385. return p(e) || (e = m(e)),
  36386. (this.unsigned === e.unsigned || this.high >>> 31 != 1 || e.high >>> 31 != 1) && this.high === e.high && this.low === e.low
  36387. }
  36388. ,
  36389. t.eq = t.equals,
  36390. t.notEquals = function(e) {
  36391. return !this.eq(e)
  36392. }
  36393. ,
  36394. t.neq = t.notEquals,
  36395. t.lessThan = function(e) {
  36396. return this.comp(e) < 0
  36397. }
  36398. ,
  36399. t.lt = t.lessThan,
  36400. t.lessThanOrEqual = function(e) {
  36401. return this.comp(e) <= 0
  36402. }
  36403. ,
  36404. t.lte = t.lessThanOrEqual,
  36405. t.greaterThan = function(e) {
  36406. return 0 < this.comp(e)
  36407. }
  36408. ,
  36409. t.gt = t.greaterThan,
  36410. t.greaterThanOrEqual = function(e) {
  36411. return 0 <= this.comp(e)
  36412. }
  36413. ,
  36414. t.gte = t.greaterThanOrEqual,
  36415. t.compare = function(e) {
  36416. if (p(e) || (e = m(e)),
  36417. this.eq(e))
  36418. return 0;
  36419. var t = this.isNegative()
  36420. , i = e.isNegative();
  36421. 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
  36422. }
  36423. ,
  36424. t.comp = t.compare,
  36425. t.negate = function() {
  36426. return !this.unsigned && this.eq(E) ? E : this.not().add(c)
  36427. }
  36428. ,
  36429. t.neg = t.negate,
  36430. t.add = function(e) {
  36431. p(e) || (e = m(e));
  36432. var t = this.high >>> 16
  36433. , i = 65535 & this.high
  36434. , n = this.low >>> 16
  36435. , r = 65535 & this.low
  36436. , o = e.high >>> 16
  36437. , a = 65535 & e.high
  36438. , s = e.low >>> 16
  36439. , l = 0
  36440. , c = 0
  36441. , h = 0
  36442. , u = 0;
  36443. return h += (u += r + (65535 & e.low)) >>> 16,
  36444. c += (h += n + s) >>> 16,
  36445. l += (c += i + a) >>> 16,
  36446. l += t + o,
  36447. g((h &= 65535) << 16 | (u &= 65535), (l &= 65535) << 16 | (c &= 65535), this.unsigned)
  36448. }
  36449. ,
  36450. t.subtract = function(e) {
  36451. return p(e) || (e = m(e)),
  36452. this.add(e.neg())
  36453. }
  36454. ,
  36455. t.sub = t.subtract,
  36456. t.multiply = function(e) {
  36457. if (this.isZero())
  36458. return y;
  36459. if (p(e) || (e = m(e)),
  36460. e.isZero())
  36461. return y;
  36462. if (this.eq(E))
  36463. return e.isOdd() ? E : y;
  36464. if (e.eq(E))
  36465. return this.isOdd() ? E : y;
  36466. if (this.isNegative())
  36467. return e.isNegative() ? this.neg().mul(e.neg()) : this.neg().mul(e).neg();
  36468. if (e.isNegative())
  36469. return this.mul(e.neg()).neg();
  36470. if (this.lt(v) && e.lt(v))
  36471. return f(this.toNumber() * e.toNumber(), this.unsigned);
  36472. var t = this.high >>> 16
  36473. , i = 65535 & this.high
  36474. , n = this.low >>> 16
  36475. , r = 65535 & this.low
  36476. , o = e.high >>> 16
  36477. , a = 65535 & e.high
  36478. , s = e.low >>> 16
  36479. , l = 65535 & e.low
  36480. , c = 0
  36481. , h = 0
  36482. , u = 0
  36483. , d = 0;
  36484. return u += (d += r * l) >>> 16,
  36485. h += (u += n * l) >>> 16,
  36486. u &= 65535,
  36487. h += (u += r * s) >>> 16,
  36488. c += (h += i * l) >>> 16,
  36489. h &= 65535,
  36490. c += (h += n * s) >>> 16,
  36491. h &= 65535,
  36492. c += (h += r * a) >>> 16,
  36493. c += t * l + i * s + n * a + r * o,
  36494. g((u &= 65535) << 16 | (d &= 65535), (c &= 65535) << 16 | (h &= 65535), this.unsigned)
  36495. }
  36496. ,
  36497. t.mul = t.multiply,
  36498. t.divide = function(e) {
  36499. if (p(e) || (e = m(e)),
  36500. e.isZero())
  36501. throw Error("division by zero");
  36502. if (this.isZero())
  36503. return this.unsigned ? l : y;
  36504. var t, i, n;
  36505. if (this.unsigned) {
  36506. if (e.unsigned || (e = e.toUnsigned()),
  36507. e.gt(this))
  36508. return l;
  36509. if (e.gt(this.shru(1)))
  36510. return d;
  36511. n = l
  36512. } else {
  36513. if (this.eq(E))
  36514. 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)),
  36515. n = t.add(i.div(e)));
  36516. if (e.eq(E))
  36517. return this.unsigned ? l : y;
  36518. if (this.isNegative())
  36519. return e.isNegative() ? this.neg().div(e.neg()) : this.neg().div(e).neg();
  36520. if (e.isNegative())
  36521. return this.div(e.neg()).neg();
  36522. n = y
  36523. }
  36524. for (i = this; i.gte(e); ) {
  36525. t = Math.max(1, Math.floor(i.toNumber() / e.toNumber()));
  36526. 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); )
  36527. s = (a = f(t -= o, this.unsigned)).mul(e);
  36528. a.isZero() && (a = c),
  36529. n = n.add(a),
  36530. i = i.sub(s)
  36531. }
  36532. return n
  36533. }
  36534. ,
  36535. t.div = t.divide,
  36536. t.modulo = function(e) {
  36537. return p(e) || (e = m(e)),
  36538. this.sub(this.div(e).mul(e))
  36539. }
  36540. ,
  36541. t.mod = t.modulo,
  36542. t.not = function() {
  36543. return g(~this.low, ~this.high, this.unsigned)
  36544. }
  36545. ,
  36546. t.and = function(e) {
  36547. return p(e) || (e = m(e)),
  36548. g(this.low & e.low, this.high & e.high, this.unsigned)
  36549. }
  36550. ,
  36551. t.or = function(e) {
  36552. return p(e) || (e = m(e)),
  36553. g(this.low | e.low, this.high | e.high, this.unsigned)
  36554. }
  36555. ,
  36556. t.xor = function(e) {
  36557. return p(e) || (e = m(e)),
  36558. g(this.low ^ e.low, this.high ^ e.high, this.unsigned)
  36559. }
  36560. ,
  36561. t.shiftLeft = function(e) {
  36562. return p(e) && (e = e.toInt()),
  36563. 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)
  36564. }
  36565. ,
  36566. t.shl = t.shiftLeft,
  36567. t.shiftRight = function(e) {
  36568. return p(e) && (e = e.toInt()),
  36569. 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)
  36570. }
  36571. ,
  36572. t.shr = t.shiftRight,
  36573. t.shiftRightUnsigned = function(e) {
  36574. if (p(e) && (e = e.toInt()),
  36575. 0 === (e &= 63))
  36576. return this;
  36577. var t = this.high;
  36578. return e < 32 ? g(this.low >>> e | t << 32 - e, t >>> e, this.unsigned) : g(32 === e ? t : t >>> e - 32, 0, this.unsigned)
  36579. }
  36580. ,
  36581. t.shru = t.shiftRightUnsigned,
  36582. t.toSigned = function() {
  36583. return this.unsigned ? g(this.low, this.high, !1) : this
  36584. }
  36585. ,
  36586. t.toUnsigned = function() {
  36587. return this.unsigned ? this : g(this.low, this.high, !0)
  36588. }
  36589. ,
  36590. t.toBytes = function(e) {
  36591. return e ? this.toBytesLE() : this.toBytesBE()
  36592. }
  36593. ,
  36594. t.toBytesLE = function() {
  36595. var e = this.high
  36596. , t = this.low;
  36597. return [255 & t, t >>> 8 & 255, t >>> 16 & 255, t >>> 24 & 255, 255 & e, e >>> 8 & 255, e >>> 16 & 255, e >>> 24 & 255]
  36598. }
  36599. ,
  36600. t.toBytesBE = function() {
  36601. var e = this.high
  36602. , t = this.low;
  36603. return [e >>> 24 & 255, e >>> 16 & 255, e >>> 8 & 255, 255 & e, t >>> 24 & 255, t >>> 16 & 255, t >>> 8 & 255, 255 & t]
  36604. }
  36605. ,
  36606. n
  36607. }
  36608. ,
  36609. "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()
  36610. }
  36611. , {}],
  36612. 217: [function(e, t, i) {
  36613. 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 = {
  36614. REVISION: "75"
  36615. };
  36616. function Ii(e, t) {
  36617. return e.distance - t.distance
  36618. }
  36619. function Ei(e, t, i, n) {
  36620. if (!1 !== e.visible && (e.raycast(t, i),
  36621. !0 === n))
  36622. for (var r = e.children, o = 0, a = r.length; o < a; o++)
  36623. Ei(r[o], t, i, !0)
  36624. }
  36625. function _i(e, t, i) {
  36626. return i < 0 && (i += 1),
  36627. 1 < i && (i -= 1),
  36628. i < 1 / 6 ? e + 6 * (t - e) * i : i < .5 ? t : i < 2 / 3 ? e + 6 * (t - e) * (2 / 3 - i) : e
  36629. }
  36630. function bi(e, t, i, n, r, o, a) {
  36631. return Ci.Triangle.barycoordFromPoint(e, t, i, n, Vt),
  36632. r.multiplyScalar(Vt.x),
  36633. o.multiplyScalar(Vt.y),
  36634. a.multiplyScalar(Vt.z),
  36635. r.add(o).add(a),
  36636. r.clone()
  36637. }
  36638. function wi(e, t, i, n, r, o, a) {
  36639. var s = e.material;
  36640. if (null === (s.side === Ci.BackSide ? i.intersectTriangle(o, r, n, !0, a) : i.intersectTriangle(n, r, o, s.side !== Ci.DoubleSide, a)))
  36641. return null;
  36642. Ut.copy(a),
  36643. Ut.applyMatrix4(e.matrixWorld);
  36644. var l = t.ray.origin.distanceTo(Ut);
  36645. return l < t.near || l > t.far ? null : {
  36646. distance: l,
  36647. point: Ut.clone(),
  36648. object: e
  36649. }
  36650. }
  36651. function Ti(e, t, i, n, r, o, a, s) {
  36652. Mt.fromArray(n, 3 * o),
  36653. Rt.fromArray(n, 3 * a),
  36654. Pt.fromArray(n, 3 * s);
  36655. var l = wi(e, t, i, Mt, Rt, Pt, kt);
  36656. return l && (r && (Nt.fromArray(r, 2 * o),
  36657. Ft.fromArray(r, 2 * a),
  36658. Bt.fromArray(r, 2 * s),
  36659. l.uv = bi(kt, Mt, Rt, Pt, Nt, Ft, Bt)),
  36660. l.face = new Ci.Face3(o,a,s,Ci.Triangle.normal(Mt, Rt, Pt)),
  36661. l.faceIndex = o),
  36662. l
  36663. }
  36664. function xi() {}
  36665. function Si(e, t, i, n, r, o) {
  36666. var a, s, l, c, h, u, d, p, f, g, m, v, y, A, C, I, E;
  36667. if (s = e[o[t]].x,
  36668. l = e[o[t]].y,
  36669. c = e[o[i]].x,
  36670. h = e[o[i]].y,
  36671. u = e[o[n]].x,
  36672. d = e[o[n]].y,
  36673. Number.EPSILON > (c - s) * (d - l) - (h - l) * (u - s))
  36674. return !1;
  36675. for (g = u - c,
  36676. m = d - h,
  36677. v = s - u,
  36678. y = l - d,
  36679. A = c - s,
  36680. C = h - l,
  36681. a = 0; a < r; a++)
  36682. if (p = e[o[a]].x,
  36683. f = e[o[a]].y,
  36684. !(p === s && f === l || p === c && f === h || p === u && f === d) && (I = A * (f - l) - C * (p - s),
  36685. E = v * (f - d) - y * (p - u),
  36686. g * (f - h) - m * (p - c) >= -Number.EPSILON && E >= -Number.EPSILON && I >= -Number.EPSILON))
  36687. return !1;
  36688. return !0
  36689. }
  36690. function Mi(e) {
  36691. switch (e) {
  36692. case Ci.LinearEncoding:
  36693. return ["Linear", "( value )"];
  36694. case Ci.sRGBEncoding:
  36695. return ["sRGB", "( value )"];
  36696. case Ci.RGBEEncoding:
  36697. return ["RGBE", "( value )"];
  36698. case Ci.RGBM7Encoding:
  36699. return ["RGBM", "( value, 7.0 )"];
  36700. case Ci.RGBM16Encoding:
  36701. return ["RGBM", "( value, 16.0 )"];
  36702. case Ci.RGBDEncoding:
  36703. return ["RGBD", "( value, 256.0 )"];
  36704. case Ci.GammaEncoding:
  36705. return ["Gamma", "( value, float( GAMMA_FACTOR ) )"];
  36706. default:
  36707. throw new Error("unsupported encoding: " + e)
  36708. }
  36709. }
  36710. function Ri(e, t) {
  36711. var i = Mi(t);
  36712. return "vec4 " + e + "( vec4 value ) { return " + i[0] + "ToLinear" + i[1] + "; }"
  36713. }
  36714. function Pi(e) {
  36715. return "" !== e
  36716. }
  36717. function Oi(e, t) {
  36718. 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)
  36719. }
  36720. function Li(e) {
  36721. return e.replace(/#include +<([\w\d.]+)>/g, function(e, t) {
  36722. var i = Ci.ShaderChunk[t];
  36723. if (void 0 === i)
  36724. throw new Error("Can not resolve #include <" + t + ">");
  36725. return Li(i)
  36726. })
  36727. }
  36728. function Di(e) {
  36729. return e.replace(/for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g, function(e, t, i, n) {
  36730. for (var r = "", o = parseInt(t); o < parseInt(i); o++)
  36731. r += n.replace(/\[ i \]/g, "[ " + o + " ]");
  36732. return r
  36733. })
  36734. }
  36735. function Ni(e, t, i, n) {
  36736. gi.set(t, i, n).unproject(mi);
  36737. var r = fi[e];
  36738. if (void 0 !== r)
  36739. for (var o = 0, a = r.length; o < a; o++)
  36740. pi.vertices[r[o]].copy(gi)
  36741. }
  36742. "function" == typeof define && define.amd ? define("three", Ci) : void 0 !== i && void 0 !== t && (t.exports = Ci),
  36743. void 0 === Number.EPSILON && (Number.EPSILON = Math.pow(2, -52)),
  36744. void 0 === Math.sign && (Math.sign = function(e) {
  36745. return e < 0 ? -1 : 0 < e ? 1 : +e
  36746. }
  36747. ),
  36748. void 0 === Function.prototype.name && void 0 !== Object.defineProperty && Object.defineProperty(Function.prototype, "name", {
  36749. get: function() {
  36750. return this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]
  36751. }
  36752. }),
  36753. void 0 === Object.assign && Object.defineProperty(Object, "assign", {
  36754. writable: !0,
  36755. configurable: !0,
  36756. value: function(e) {
  36757. "use strict";
  36758. if (null == e)
  36759. throw new TypeError("Cannot convert first argument to object");
  36760. for (var t = Object(e), i = 1, n = arguments.length; i !== n; ++i) {
  36761. var r = arguments[i];
  36762. if (null != r) {
  36763. r = Object(r);
  36764. for (var o = Object.keys(r), a = 0, s = o.length; a !== s; ++a) {
  36765. var l = o[a]
  36766. , c = Object.getOwnPropertyDescriptor(r, l);
  36767. void 0 !== c && c.enumerable && (t[l] = r[l])
  36768. }
  36769. }
  36770. }
  36771. return t
  36772. }
  36773. }),
  36774. Ci.MOUSE = {
  36775. LEFT: 0,
  36776. MIDDLE: 1,
  36777. RIGHT: 2
  36778. },
  36779. Ci.CullFaceNone = 0,
  36780. Ci.CullFaceBack = 1,
  36781. Ci.CullFaceFront = 2,
  36782. Ci.CullFaceFrontBack = 3,
  36783. Ci.FrontFaceDirectionCW = 0,
  36784. Ci.FrontFaceDirectionCCW = 1,
  36785. Ci.BasicShadowMap = 0,
  36786. Ci.PCFShadowMap = 1,
  36787. Ci.PCFSoftShadowMap = 2,
  36788. Ci.FrontSide = 0,
  36789. Ci.BackSide = 1,
  36790. Ci.DoubleSide = 2,
  36791. Ci.FlatShading = 1,
  36792. Ci.SmoothShading = 2,
  36793. Ci.NoColors = 0,
  36794. Ci.FaceColors = 1,
  36795. Ci.VertexColors = 2,
  36796. Ci.NoBlending = 0,
  36797. Ci.NormalBlending = 1,
  36798. Ci.AdditiveBlending = 2,
  36799. Ci.SubtractiveBlending = 3,
  36800. Ci.MultiplyBlending = 4,
  36801. Ci.CustomBlending = 5,
  36802. Ci.AddEquation = 100,
  36803. Ci.SubtractEquation = 101,
  36804. Ci.ReverseSubtractEquation = 102,
  36805. Ci.MinEquation = 103,
  36806. Ci.MaxEquation = 104,
  36807. Ci.ZeroFactor = 200,
  36808. Ci.OneFactor = 201,
  36809. Ci.SrcColorFactor = 202,
  36810. Ci.OneMinusSrcColorFactor = 203,
  36811. Ci.SrcAlphaFactor = 204,
  36812. Ci.OneMinusSrcAlphaFactor = 205,
  36813. Ci.DstAlphaFactor = 206,
  36814. Ci.OneMinusDstAlphaFactor = 207,
  36815. Ci.DstColorFactor = 208,
  36816. Ci.OneMinusDstColorFactor = 209,
  36817. Ci.SrcAlphaSaturateFactor = 210,
  36818. Ci.NeverDepth = 0,
  36819. Ci.AlwaysDepth = 1,
  36820. Ci.LessDepth = 2,
  36821. Ci.LessEqualDepth = 3,
  36822. Ci.EqualDepth = 4,
  36823. Ci.GreaterEqualDepth = 5,
  36824. Ci.GreaterDepth = 6,
  36825. Ci.NotEqualDepth = 7,
  36826. Ci.MultiplyOperation = 0,
  36827. Ci.MixOperation = 1,
  36828. Ci.AddOperation = 2,
  36829. Ci.NoToneMapping = 0,
  36830. Ci.LinearToneMapping = 1,
  36831. Ci.ReinhardToneMapping = 2,
  36832. Ci.Uncharted2ToneMapping = 3,
  36833. Ci.CineonToneMapping = 4,
  36834. Ci.UVMapping = 300,
  36835. Ci.CubeReflectionMapping = 301,
  36836. Ci.CubeRefractionMapping = 302,
  36837. Ci.EquirectangularReflectionMapping = 303,
  36838. Ci.EquirectangularRefractionMapping = 304,
  36839. Ci.SphericalReflectionMapping = 305,
  36840. Ci.CubeUVReflectionMapping = 306,
  36841. Ci.CubeUVRefractionMapping = 307,
  36842. Ci.RepeatWrapping = 1e3,
  36843. Ci.ClampToEdgeWrapping = 1001,
  36844. Ci.MirroredRepeatWrapping = 1002,
  36845. Ci.NearestFilter = 1003,
  36846. Ci.NearestMipMapNearestFilter = 1004,
  36847. Ci.NearestMipMapLinearFilter = 1005,
  36848. Ci.LinearFilter = 1006,
  36849. Ci.LinearMipMapNearestFilter = 1007,
  36850. Ci.LinearMipMapLinearFilter = 1008,
  36851. Ci.UnsignedByteType = 1009,
  36852. Ci.ByteType = 1010,
  36853. Ci.ShortType = 1011,
  36854. Ci.UnsignedShortType = 1012,
  36855. Ci.IntType = 1013,
  36856. Ci.UnsignedIntType = 1014,
  36857. Ci.FloatType = 1015,
  36858. Ci.HalfFloatType = 1025,
  36859. Ci.UnsignedShort4444Type = 1016,
  36860. Ci.UnsignedShort5551Type = 1017,
  36861. Ci.UnsignedShort565Type = 1018,
  36862. Ci.AlphaFormat = 1019,
  36863. Ci.RGBFormat = 1020,
  36864. Ci.RGBAFormat = 1021,
  36865. Ci.LuminanceFormat = 1022,
  36866. Ci.LuminanceAlphaFormat = 1023,
  36867. Ci.RGBEFormat = Ci.RGBAFormat,
  36868. Ci.RGB_S3TC_DXT1_Format = 2001,
  36869. Ci.RGBA_S3TC_DXT1_Format = 2002,
  36870. Ci.RGBA_S3TC_DXT3_Format = 2003,
  36871. Ci.RGBA_S3TC_DXT5_Format = 2004,
  36872. Ci.RGB_PVRTC_4BPPV1_Format = 2100,
  36873. Ci.RGB_PVRTC_2BPPV1_Format = 2101,
  36874. Ci.RGBA_PVRTC_4BPPV1_Format = 2102,
  36875. Ci.RGBA_PVRTC_2BPPV1_Format = 2103,
  36876. Ci.RGB_ETC1_Format = 2151,
  36877. Ci.LoopOnce = 2200,
  36878. Ci.LoopRepeat = 2201,
  36879. Ci.LoopPingPong = 2202,
  36880. Ci.InterpolateDiscrete = 2300,
  36881. Ci.InterpolateLinear = 2301,
  36882. Ci.InterpolateSmooth = 2302,
  36883. Ci.ZeroCurvatureEnding = 2400,
  36884. Ci.ZeroSlopeEnding = 2401,
  36885. Ci.WrapAroundEnding = 2402,
  36886. Ci.TrianglesDrawMode = 0,
  36887. Ci.TriangleStripDrawMode = 1,
  36888. Ci.TriangleFanDrawMode = 2,
  36889. Ci.LinearEncoding = 3e3,
  36890. Ci.sRGBEncoding = 3001,
  36891. Ci.GammaEncoding = 3007,
  36892. Ci.RGBEEncoding = 3002,
  36893. Ci.LogLuvEncoding = 3003,
  36894. Ci.RGBM7Encoding = 3004,
  36895. Ci.RGBM16Encoding = 3005,
  36896. Ci.RGBDEncoding = 3006,
  36897. Ci.Color = function(e) {
  36898. return 3 === arguments.length ? this.fromArray(arguments) : this.set(e)
  36899. }
  36900. ,
  36901. Ci.Color.prototype = {
  36902. constructor: Ci.Color,
  36903. r: 1,
  36904. g: 1,
  36905. b: 1,
  36906. set: function(e) {
  36907. return e instanceof Ci.Color ? this.copy(e) : "number" == typeof e ? this.setHex(e) : "string" == typeof e && this.setStyle(e),
  36908. this
  36909. },
  36910. setScalar: function(e) {
  36911. this.r = e,
  36912. this.g = e,
  36913. this.b = e
  36914. },
  36915. setHex: function(e) {
  36916. return e = Math.floor(e),
  36917. this.r = (e >> 16 & 255) / 255,
  36918. this.g = (e >> 8 & 255) / 255,
  36919. this.b = (255 & e) / 255,
  36920. this
  36921. },
  36922. setRGB: function(e, t, i) {
  36923. return this.r = e,
  36924. this.g = t,
  36925. this.b = i,
  36926. this
  36927. },
  36928. setHSL: function(e, t, i) {
  36929. if (e = Ci.Math.euclideanModulo(e, 1),
  36930. t = Ci.Math.clamp(t, 0, 1),
  36931. i = Ci.Math.clamp(i, 0, 1),
  36932. 0 === t)
  36933. this.r = this.g = this.b = i;
  36934. else {
  36935. var n = i <= .5 ? i * (1 + t) : i + t - i * t
  36936. , r = 2 * i - n;
  36937. this.r = _i(r, n, e + 1 / 3),
  36938. this.g = _i(r, n, e),
  36939. this.b = _i(r, n, e - 1 / 3)
  36940. }
  36941. return this
  36942. },
  36943. setStyle: function(t) {
  36944. function e(e) {
  36945. void 0 !== e && parseFloat(e) < 1 && console.warn("THREE.Color: Alpha component of " + t + " will be ignored.")
  36946. }
  36947. var i;
  36948. if (i = /^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(t)) {
  36949. var n, r = i[1], o = i[2];
  36950. switch (r) {
  36951. case "rgb":
  36952. case "rgba":
  36953. if (n = /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))
  36954. return this.r = Math.min(255, parseInt(n[1], 10)) / 255,
  36955. this.g = Math.min(255, parseInt(n[2], 10)) / 255,
  36956. this.b = Math.min(255, parseInt(n[3], 10)) / 255,
  36957. e(n[5]),
  36958. this;
  36959. if (n = /^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))
  36960. return this.r = Math.min(100, parseInt(n[1], 10)) / 100,
  36961. this.g = Math.min(100, parseInt(n[2], 10)) / 100,
  36962. this.b = Math.min(100, parseInt(n[3], 10)) / 100,
  36963. e(n[5]),
  36964. this;
  36965. break;
  36966. case "hsl":
  36967. case "hsla":
  36968. if (n = /^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o)) {
  36969. var a = parseFloat(n[1]) / 360
  36970. , s = parseInt(n[2], 10) / 100
  36971. , l = parseInt(n[3], 10) / 100;
  36972. return e(n[5]),
  36973. this.setHSL(a, s, l)
  36974. }
  36975. }
  36976. } else if (i = /^\#([A-Fa-f0-9]+)$/.exec(t)) {
  36977. var c, h = (c = i[1]).length;
  36978. if (3 === h)
  36979. return this.r = parseInt(c.charAt(0) + c.charAt(0), 16) / 255,
  36980. this.g = parseInt(c.charAt(1) + c.charAt(1), 16) / 255,
  36981. this.b = parseInt(c.charAt(2) + c.charAt(2), 16) / 255,
  36982. this;
  36983. if (6 === h)
  36984. return this.r = parseInt(c.charAt(0) + c.charAt(1), 16) / 255,
  36985. this.g = parseInt(c.charAt(2) + c.charAt(3), 16) / 255,
  36986. this.b = parseInt(c.charAt(4) + c.charAt(5), 16) / 255,
  36987. this
  36988. }
  36989. t && 0 < t.length && (void 0 !== (c = Ci.ColorKeywords[t]) ? this.setHex(c) : console.warn("THREE.Color: Unknown color " + t));
  36990. return this
  36991. },
  36992. clone: function() {
  36993. return new this.constructor(this.r,this.g,this.b)
  36994. },
  36995. copy: function(e) {
  36996. return this.r = e.r,
  36997. this.g = e.g,
  36998. this.b = e.b,
  36999. this
  37000. },
  37001. copyGammaToLinear: function(e, t) {
  37002. return void 0 === t && (t = 2),
  37003. this.r = Math.pow(e.r, t),
  37004. this.g = Math.pow(e.g, t),
  37005. this.b = Math.pow(e.b, t),
  37006. this
  37007. },
  37008. copyLinearToGamma: function(e, t) {
  37009. void 0 === t && (t = 2);
  37010. var i = 0 < t ? 1 / t : 1;
  37011. return this.r = Math.pow(e.r, i),
  37012. this.g = Math.pow(e.g, i),
  37013. this.b = Math.pow(e.b, i),
  37014. this
  37015. },
  37016. convertGammaToLinear: function() {
  37017. var e = this.r
  37018. , t = this.g
  37019. , i = this.b;
  37020. return this.r = e * e,
  37021. this.g = t * t,
  37022. this.b = i * i,
  37023. this
  37024. },
  37025. convertLinearToGamma: function() {
  37026. return this.r = Math.sqrt(this.r),
  37027. this.g = Math.sqrt(this.g),
  37028. this.b = Math.sqrt(this.b),
  37029. this
  37030. },
  37031. getHex: function() {
  37032. return 255 * this.r << 16 ^ 255 * this.g << 8 ^ 255 * this.b << 0
  37033. },
  37034. getHexString: function() {
  37035. return ("000000" + this.getHex().toString(16)).slice(-6)
  37036. },
  37037. getHSL: function(e) {
  37038. var t, i, n = e || {
  37039. h: 0,
  37040. s: 0,
  37041. l: 0
  37042. }, 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;
  37043. if (l === s)
  37044. i = t = 0;
  37045. else {
  37046. var h = s - l;
  37047. switch (i = c <= .5 ? h / (s + l) : h / (2 - s - l),
  37048. s) {
  37049. case r:
  37050. t = (o - a) / h + (o < a ? 6 : 0);
  37051. break;
  37052. case o:
  37053. t = (a - r) / h + 2;
  37054. break;
  37055. case a:
  37056. t = (r - o) / h + 4
  37057. }
  37058. t /= 6
  37059. }
  37060. return n.h = t,
  37061. n.s = i,
  37062. n.l = c,
  37063. n
  37064. },
  37065. getStyle: function() {
  37066. return "rgb(" + (255 * this.r | 0) + "," + (255 * this.g | 0) + "," + (255 * this.b | 0) + ")"
  37067. },
  37068. offsetHSL: function(e, t, i) {
  37069. var n = this.getHSL();
  37070. return n.h += e,
  37071. n.s += t,
  37072. n.l += i,
  37073. this.setHSL(n.h, n.s, n.l),
  37074. this
  37075. },
  37076. add: function(e) {
  37077. return this.r += e.r,
  37078. this.g += e.g,
  37079. this.b += e.b,
  37080. this
  37081. },
  37082. addColors: function(e, t) {
  37083. return this.r = e.r + t.r,
  37084. this.g = e.g + t.g,
  37085. this.b = e.b + t.b,
  37086. this
  37087. },
  37088. addScalar: function(e) {
  37089. return this.r += e,
  37090. this.g += e,
  37091. this.b += e,
  37092. this
  37093. },
  37094. multiply: function(e) {
  37095. return this.r *= e.r,
  37096. this.g *= e.g,
  37097. this.b *= e.b,
  37098. this
  37099. },
  37100. multiplyScalar: function(e) {
  37101. return this.r *= e,
  37102. this.g *= e,
  37103. this.b *= e,
  37104. this
  37105. },
  37106. lerp: function(e, t) {
  37107. return this.r += (e.r - this.r) * t,
  37108. this.g += (e.g - this.g) * t,
  37109. this.b += (e.b - this.b) * t,
  37110. this
  37111. },
  37112. equals: function(e) {
  37113. return e.r === this.r && e.g === this.g && e.b === this.b
  37114. },
  37115. fromArray: function(e, t) {
  37116. return void 0 === t && (t = 0),
  37117. this.r = e[t],
  37118. this.g = e[t + 1],
  37119. this.b = e[t + 2],
  37120. this
  37121. },
  37122. toArray: function(e, t) {
  37123. return void 0 === e && (e = []),
  37124. void 0 === t && (t = 0),
  37125. e[t] = this.r,
  37126. e[t + 1] = this.g,
  37127. e[t + 2] = this.b,
  37128. e
  37129. }
  37130. },
  37131. Ci.ColorKeywords = {
  37132. aliceblue: 15792383,
  37133. antiquewhite: 16444375,
  37134. aqua: 65535,
  37135. aquamarine: 8388564,
  37136. azure: 15794175,
  37137. beige: 16119260,
  37138. bisque: 16770244,
  37139. black: 0,
  37140. blanchedalmond: 16772045,
  37141. blue: 255,
  37142. blueviolet: 9055202,
  37143. brown: 10824234,
  37144. burlywood: 14596231,
  37145. cadetblue: 6266528,
  37146. chartreuse: 8388352,
  37147. chocolate: 13789470,
  37148. coral: 16744272,
  37149. cornflowerblue: 6591981,
  37150. cornsilk: 16775388,
  37151. crimson: 14423100,
  37152. cyan: 65535,
  37153. darkblue: 139,
  37154. darkcyan: 35723,
  37155. darkgoldenrod: 12092939,
  37156. darkgray: 11119017,
  37157. darkgreen: 25600,
  37158. darkgrey: 11119017,
  37159. darkkhaki: 12433259,
  37160. darkmagenta: 9109643,
  37161. darkolivegreen: 5597999,
  37162. darkorange: 16747520,
  37163. darkorchid: 10040012,
  37164. darkred: 9109504,
  37165. darksalmon: 15308410,
  37166. darkseagreen: 9419919,
  37167. darkslateblue: 4734347,
  37168. darkslategray: 3100495,
  37169. darkslategrey: 3100495,
  37170. darkturquoise: 52945,
  37171. darkviolet: 9699539,
  37172. deeppink: 16716947,
  37173. deepskyblue: 49151,
  37174. dimgray: 6908265,
  37175. dimgrey: 6908265,
  37176. dodgerblue: 2003199,
  37177. firebrick: 11674146,
  37178. floralwhite: 16775920,
  37179. forestgreen: 2263842,
  37180. fuchsia: 16711935,
  37181. gainsboro: 14474460,
  37182. ghostwhite: 16316671,
  37183. gold: 16766720,
  37184. goldenrod: 14329120,
  37185. gray: 8421504,
  37186. green: 32768,
  37187. greenyellow: 11403055,
  37188. grey: 8421504,
  37189. honeydew: 15794160,
  37190. hotpink: 16738740,
  37191. indianred: 13458524,
  37192. indigo: 4915330,
  37193. ivory: 16777200,
  37194. khaki: 15787660,
  37195. lavender: 15132410,
  37196. lavenderblush: 16773365,
  37197. lawngreen: 8190976,
  37198. lemonchiffon: 16775885,
  37199. lightblue: 11393254,
  37200. lightcoral: 15761536,
  37201. lightcyan: 14745599,
  37202. lightgoldenrodyellow: 16448210,
  37203. lightgray: 13882323,
  37204. lightgreen: 9498256,
  37205. lightgrey: 13882323,
  37206. lightpink: 16758465,
  37207. lightsalmon: 16752762,
  37208. lightseagreen: 2142890,
  37209. lightskyblue: 8900346,
  37210. lightslategray: 7833753,
  37211. lightslategrey: 7833753,
  37212. lightsteelblue: 11584734,
  37213. lightyellow: 16777184,
  37214. lime: 65280,
  37215. limegreen: 3329330,
  37216. linen: 16445670,
  37217. magenta: 16711935,
  37218. maroon: 8388608,
  37219. mediumaquamarine: 6737322,
  37220. mediumblue: 205,
  37221. mediumorchid: 12211667,
  37222. mediumpurple: 9662683,
  37223. mediumseagreen: 3978097,
  37224. mediumslateblue: 8087790,
  37225. mediumspringgreen: 64154,
  37226. mediumturquoise: 4772300,
  37227. mediumvioletred: 13047173,
  37228. midnightblue: 1644912,
  37229. mintcream: 16121850,
  37230. mistyrose: 16770273,
  37231. moccasin: 16770229,
  37232. navajowhite: 16768685,
  37233. navy: 128,
  37234. oldlace: 16643558,
  37235. olive: 8421376,
  37236. olivedrab: 7048739,
  37237. orange: 16753920,
  37238. orangered: 16729344,
  37239. orchid: 14315734,
  37240. palegoldenrod: 15657130,
  37241. palegreen: 10025880,
  37242. paleturquoise: 11529966,
  37243. palevioletred: 14381203,
  37244. papayawhip: 16773077,
  37245. peachpuff: 16767673,
  37246. peru: 13468991,
  37247. pink: 16761035,
  37248. plum: 14524637,
  37249. powderblue: 11591910,
  37250. purple: 8388736,
  37251. red: 16711680,
  37252. rosybrown: 12357519,
  37253. royalblue: 4286945,
  37254. saddlebrown: 9127187,
  37255. salmon: 16416882,
  37256. sandybrown: 16032864,
  37257. seagreen: 3050327,
  37258. seashell: 16774638,
  37259. sienna: 10506797,
  37260. silver: 12632256,
  37261. skyblue: 8900331,
  37262. slateblue: 6970061,
  37263. slategray: 7372944,
  37264. slategrey: 7372944,
  37265. snow: 16775930,
  37266. springgreen: 65407,
  37267. steelblue: 4620980,
  37268. tan: 13808780,
  37269. teal: 32896,
  37270. thistle: 14204888,
  37271. tomato: 16737095,
  37272. turquoise: 4251856,
  37273. violet: 15631086,
  37274. wheat: 16113331,
  37275. white: 16777215,
  37276. whitesmoke: 16119285,
  37277. yellow: 16776960,
  37278. yellowgreen: 10145074
  37279. },
  37280. Ci.Quaternion = function(e, t, i, n) {
  37281. this._x = e || 0,
  37282. this._y = t || 0,
  37283. this._z = i || 0,
  37284. this._w = void 0 !== n ? n : 1
  37285. }
  37286. ,
  37287. Ci.Quaternion.prototype = {
  37288. constructor: Ci.Quaternion,
  37289. get x() {
  37290. return this._x
  37291. },
  37292. set x(e) {
  37293. this._x = e,
  37294. this.onChangeCallback()
  37295. },
  37296. get y() {
  37297. return this._y
  37298. },
  37299. set y(e) {
  37300. this._y = e,
  37301. this.onChangeCallback()
  37302. },
  37303. get z() {
  37304. return this._z
  37305. },
  37306. set z(e) {
  37307. this._z = e,
  37308. this.onChangeCallback()
  37309. },
  37310. get w() {
  37311. return this._w
  37312. },
  37313. set w(e) {
  37314. this._w = e,
  37315. this.onChangeCallback()
  37316. },
  37317. set: function(e, t, i, n) {
  37318. return this._x = e,
  37319. this._y = t,
  37320. this._z = i,
  37321. this._w = n,
  37322. this.onChangeCallback(),
  37323. this
  37324. },
  37325. clone: function() {
  37326. return new this.constructor(this._x,this._y,this._z,this._w)
  37327. },
  37328. toObject:function(){//add
  37329. return {x:this.x, y:this.y,z:this.z, w:this.w};
  37330. },
  37331. copy: function(e) {
  37332. return this._x = e.x,
  37333. this._y = e.y,
  37334. this._z = e.z,
  37335. this._w = e.w,
  37336. this.onChangeCallback(),
  37337. this
  37338. },
  37339. setFromEuler: function(e, t) {
  37340. if (e instanceof Ci.Euler == 0)
  37341. throw new Error("THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  37342. var i = Math.cos(e._x / 2)
  37343. , n = Math.cos(e._y / 2)
  37344. , r = Math.cos(e._z / 2)
  37345. , o = Math.sin(e._x / 2)
  37346. , a = Math.sin(e._y / 2)
  37347. , s = Math.sin(e._z / 2)
  37348. , l = e.order;
  37349. return "XYZ" === l ? (this._x = o * n * r + i * a * s,
  37350. this._y = i * a * r - o * n * s,
  37351. this._z = i * n * s + o * a * r,
  37352. this._w = i * n * r - o * a * s) : "YXZ" === l ? (this._x = o * n * r + i * a * s,
  37353. this._y = i * a * r - o * n * s,
  37354. this._z = i * n * s - o * a * r,
  37355. this._w = i * n * r + o * a * s) : "ZXY" === l ? (this._x = o * n * r - i * a * s,
  37356. this._y = i * a * r + o * n * s,
  37357. this._z = i * n * s + o * a * r,
  37358. this._w = i * n * r - o * a * s) : "ZYX" === l ? (this._x = o * n * r - i * a * s,
  37359. this._y = i * a * r + o * n * s,
  37360. this._z = i * n * s - o * a * r,
  37361. this._w = i * n * r + o * a * s) : "YZX" === l ? (this._x = o * n * r + i * a * s,
  37362. this._y = i * a * r + o * n * s,
  37363. this._z = i * n * s - o * a * r,
  37364. this._w = i * n * r - o * a * s) : "XZY" === l && (this._x = o * n * r - i * a * s,
  37365. this._y = i * a * r - o * n * s,
  37366. this._z = i * n * s + o * a * r,
  37367. this._w = i * n * r + o * a * s),
  37368. !1 !== t && this.onChangeCallback(),
  37369. this
  37370. },
  37371. setFromAxisAngle: function(e, t) {
  37372. var i = t / 2
  37373. , n = Math.sin(i);
  37374. return this._x = e.x * n,
  37375. this._y = e.y * n,
  37376. this._z = e.z * n,
  37377. this._w = Math.cos(i),
  37378. this.onChangeCallback(),
  37379. this
  37380. },
  37381. setFromRotationMatrix: function(e) {
  37382. 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;
  37383. return 0 < d ? (t = .5 / Math.sqrt(d + 1),
  37384. this._w = .25 / t,
  37385. this._x = (h - l) * t,
  37386. this._y = (o - c) * t,
  37387. this._z = (a - r) * t) : s < n && u < n ? (t = 2 * Math.sqrt(1 + n - s - u),
  37388. this._w = (h - l) / t,
  37389. this._x = .25 * t,
  37390. this._y = (r + a) / t,
  37391. this._z = (o + c) / t) : u < s ? (t = 2 * Math.sqrt(1 + s - n - u),
  37392. this._w = (o - c) / t,
  37393. this._x = (r + a) / t,
  37394. this._y = .25 * t,
  37395. this._z = (l + h) / t) : (t = 2 * Math.sqrt(1 + u - n - s),
  37396. this._w = (a - r) / t,
  37397. this._x = (o + c) / t,
  37398. this._y = (l + h) / t,
  37399. this._z = .25 * t),
  37400. this.onChangeCallback(),
  37401. this
  37402. },
  37403. setFromUnitVectors: function(e, t) {
  37404. return void 0 === Be && (Be = new Ci.Vector3),
  37405. (Ve = e.dot(t) + 1) < 1e-6 ? (Ve = 0,
  37406. 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),
  37407. this._x = Be.x,
  37408. this._y = Be.y,
  37409. this._z = Be.z,
  37410. this._w = Ve,
  37411. this.normalize(),
  37412. this
  37413. },
  37414. inverse: function() {
  37415. return this.conjugate().normalize(),
  37416. this
  37417. },
  37418. conjugate: function() {
  37419. return this._x *= -1,
  37420. this._y *= -1,
  37421. this._z *= -1,
  37422. this.onChangeCallback(),
  37423. this
  37424. },
  37425. dot: function(e) {
  37426. return this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w
  37427. },
  37428. lengthSq: function() {
  37429. return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w
  37430. },
  37431. length: function() {
  37432. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  37433. },
  37434. normalize: function() {
  37435. var e = this.length();
  37436. return 0 === e ? (this._x = 0,
  37437. this._y = 0,
  37438. this._z = 0,
  37439. this._w = 1) : (e = 1 / e,
  37440. this._x = this._x * e,
  37441. this._y = this._y * e,
  37442. this._z = this._z * e,
  37443. this._w = this._w * e),
  37444. this.onChangeCallback(),
  37445. this
  37446. },
  37447. multiply: function(e, t) {
  37448. return void 0 !== t ? (console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),
  37449. this.multiplyQuaternions(e, t)) : this.multiplyQuaternions(this, e)
  37450. },
  37451. multiplyQuaternions: function(e, t) {
  37452. var i = e._x
  37453. , n = e._y
  37454. , r = e._z
  37455. , o = e._w
  37456. , a = t._x
  37457. , s = t._y
  37458. , l = t._z
  37459. , c = t._w;
  37460. return this._x = i * c + o * a + n * l - r * s,
  37461. this._y = n * c + o * s + r * a - i * l,
  37462. this._z = r * c + o * l + i * s - n * a,
  37463. this._w = o * c - i * a - n * s - r * l,
  37464. this.onChangeCallback(),
  37465. this
  37466. },
  37467. slerp: function(e, t) {
  37468. if (0 === t)
  37469. return this;
  37470. if (1 === t)
  37471. return this.copy(e);
  37472. var i = this._x
  37473. , n = this._y
  37474. , r = this._z
  37475. , o = this._w
  37476. , a = o * e._w + i * e._x + n * e._y + r * e._z;
  37477. if (a < 0 ? (this._w = -e._w,
  37478. this._x = -e._x,
  37479. this._y = -e._y,
  37480. this._z = -e._z,
  37481. a = -a) : this.copy(e),
  37482. 1 <= a)
  37483. return this._w = o,
  37484. this._x = i,
  37485. this._y = n,
  37486. this._z = r,
  37487. this;
  37488. var s = Math.sqrt(1 - a * a);
  37489. if (Math.abs(s) < .001)
  37490. return this._w = .5 * (o + this._w),
  37491. this._x = .5 * (i + this._x),
  37492. this._y = .5 * (n + this._y),
  37493. this._z = .5 * (r + this._z),
  37494. this;
  37495. var l = Math.atan2(s, a)
  37496. , c = Math.sin((1 - t) * l) / s
  37497. , h = Math.sin(t * l) / s;
  37498. return this._w = o * c + this._w * h,
  37499. this._x = i * c + this._x * h,
  37500. this._y = n * c + this._y * h,
  37501. this._z = r * c + this._z * h,
  37502. this.onChangeCallback(),
  37503. this
  37504. },
  37505. equals: function(e) {
  37506. return e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w
  37507. },
  37508. fromArray: function(e, t) {
  37509. return void 0 === t && (t = 0),
  37510. this._x = e[t],
  37511. this._y = e[t + 1],
  37512. this._z = e[t + 2],
  37513. this._w = e[t + 3],
  37514. this.onChangeCallback(),
  37515. this
  37516. },
  37517. toArray: function(e, t) {
  37518. return void 0 === e && (e = []),
  37519. void 0 === t && (t = 0),
  37520. e[t] = this._x,
  37521. e[t + 1] = this._y,
  37522. e[t + 2] = this._z,
  37523. e[t + 3] = this._w,
  37524. e
  37525. },
  37526. onChange: function(e) {
  37527. return this.onChangeCallback = e,
  37528. this
  37529. },
  37530. onChangeCallback: function() {}
  37531. },
  37532. Object.assign(Ci.Quaternion, {
  37533. slerp: function(e, t, i, n) {
  37534. return i.copy(e).slerp(t, n)
  37535. },
  37536. slerpFlat: function(e, t, i, n, r, o, a) {
  37537. var s = i[n + 0]
  37538. , l = i[n + 1]
  37539. , c = i[n + 2]
  37540. , h = i[n + 3]
  37541. , u = r[o + 0]
  37542. , d = r[o + 1]
  37543. , p = r[o + 2]
  37544. , f = r[o + 3];
  37545. if (h !== f || s !== u || l !== d || c !== p) {
  37546. var g = 1 - a
  37547. , m = s * u + l * d + c * p + h * f
  37548. , v = 0 <= m ? 1 : -1
  37549. , y = 1 - m * m;
  37550. if (y > Number.EPSILON) {
  37551. var A = Math.sqrt(y)
  37552. , C = Math.atan2(A, m * v);
  37553. g = Math.sin(g * C) / A,
  37554. a = Math.sin(a * C) / A
  37555. }
  37556. var I = a * v;
  37557. if (s = s * g + u * I,
  37558. l = l * g + d * I,
  37559. c = c * g + p * I,
  37560. h = h * g + f * I,
  37561. g === 1 - a) {
  37562. var E = 1 / Math.sqrt(s * s + l * l + c * c + h * h);
  37563. s *= E,
  37564. l *= E,
  37565. c *= E,
  37566. h *= E
  37567. }
  37568. }
  37569. e[t] = s,
  37570. e[t + 1] = l,
  37571. e[t + 2] = c,
  37572. e[t + 3] = h
  37573. }
  37574. }),
  37575. Ci.Vector2 = function(e, t) {
  37576. this.x = e || 0,
  37577. this.y = t || 0
  37578. }
  37579. ,
  37580. Ci.Vector2.prototype = {
  37581. constructor: Ci.Vector2,
  37582. get width() {
  37583. return this.x
  37584. },
  37585. set width(e) {
  37586. this.x = e
  37587. },
  37588. get height() {
  37589. return this.y
  37590. },
  37591. set height(e) {
  37592. this.y = e
  37593. },
  37594. set: function(e, t) {
  37595. return this.x = e,
  37596. this.y = t,
  37597. this
  37598. },
  37599. setScalar: function(e) {
  37600. return this.x = e,
  37601. this.y = e,
  37602. this
  37603. },
  37604. setX: function(e) {
  37605. return this.x = e,
  37606. this
  37607. },
  37608. setY: function(e) {
  37609. return this.y = e,
  37610. this
  37611. },
  37612. setComponent: function(e, t) {
  37613. switch (e) {
  37614. case 0:
  37615. this.x = t;
  37616. break;
  37617. case 1:
  37618. this.y = t;
  37619. break;
  37620. default:
  37621. throw new Error("index is out of range: " + e)
  37622. }
  37623. },
  37624. getComponent: function(e) {
  37625. switch (e) {
  37626. case 0:
  37627. return this.x;
  37628. case 1:
  37629. return this.y;
  37630. default:
  37631. throw new Error("index is out of range: " + e)
  37632. }
  37633. },
  37634. clone: function() {
  37635. return new this.constructor(this.x,this.y)
  37636. },
  37637. copy: function(e) {
  37638. return this.x = e.x,
  37639. this.y = e.y,
  37640. this
  37641. },
  37642. add: function(e, t) {
  37643. return void 0 !== t ? (console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  37644. this.addVectors(e, t)) : (this.x += e.x,
  37645. this.y += e.y,
  37646. this)
  37647. },
  37648. addScalar: function(e) {
  37649. return this.x += e,
  37650. this.y += e,
  37651. this
  37652. },
  37653. addVectors: function(e, t) {
  37654. return this.x = e.x + t.x,
  37655. this.y = e.y + t.y,
  37656. this
  37657. },
  37658. addScaledVector: function(e, t) {
  37659. return this.x += e.x * t,
  37660. this.y += e.y * t,
  37661. this
  37662. },
  37663. sub: function(e, t) {
  37664. return void 0 !== t ? (console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  37665. this.subVectors(e, t)) : (this.x -= e.x,
  37666. this.y -= e.y,
  37667. this)
  37668. },
  37669. subScalar: function(e) {
  37670. return this.x -= e,
  37671. this.y -= e,
  37672. this
  37673. },
  37674. subVectors: function(e, t) {
  37675. return this.x = e.x - t.x,
  37676. this.y = e.y - t.y,
  37677. this
  37678. },
  37679. multiply: function(e) {
  37680. return this.x *= e.x,
  37681. this.y *= e.y,
  37682. this
  37683. },
  37684. multiplyScalar: function(e) {
  37685. return isFinite(e) ? (this.x *= e,
  37686. this.y *= e) : (this.x = 0,
  37687. this.y = 0),
  37688. this
  37689. },
  37690. divide: function(e) {
  37691. return this.x /= e.x,
  37692. this.y /= e.y,
  37693. this
  37694. },
  37695. divideScalar: function(e) {
  37696. return this.multiplyScalar(1 / e)
  37697. },
  37698. min: function(e) {
  37699. return this.x = Math.min(this.x, e.x),
  37700. this.y = Math.min(this.y, e.y),
  37701. this
  37702. },
  37703. max: function(e) {
  37704. return this.x = Math.max(this.x, e.x),
  37705. this.y = Math.max(this.y, e.y),
  37706. this
  37707. },
  37708. clamp: function(e, t) {
  37709. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  37710. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  37711. this
  37712. },
  37713. clampScalar: function(e, t) {
  37714. return void 0 === Ne && (Ne = new Ci.Vector2,
  37715. Fe = new Ci.Vector2),
  37716. Ne.set(e, e),
  37717. Fe.set(t, t),
  37718. this.clamp(Ne, Fe)
  37719. },
  37720. clampLength: function(e, t) {
  37721. var i = this.length();
  37722. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  37723. this
  37724. },
  37725. floor: function() {
  37726. return this.x = Math.floor(this.x),
  37727. this.y = Math.floor(this.y),
  37728. this
  37729. },
  37730. ceil: function() {
  37731. return this.x = Math.ceil(this.x),
  37732. this.y = Math.ceil(this.y),
  37733. this
  37734. },
  37735. round: function() {
  37736. return this.x = Math.round(this.x),
  37737. this.y = Math.round(this.y),
  37738. this
  37739. },
  37740. roundToZero: function() {
  37741. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  37742. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  37743. this
  37744. },
  37745. negate: function() {
  37746. return this.x = -this.x,
  37747. this.y = -this.y,
  37748. this
  37749. },
  37750. dot: function(e) {
  37751. return this.x * e.x + this.y * e.y
  37752. },
  37753. lengthSq: function() {
  37754. return this.x * this.x + this.y * this.y
  37755. },
  37756. length: function() {
  37757. return Math.sqrt(this.x * this.x + this.y * this.y)
  37758. },
  37759. lengthManhattan: function() {
  37760. return Math.abs(this.x) + Math.abs(this.y)
  37761. },
  37762. normalize: function() {
  37763. return this.divideScalar(this.length())
  37764. },
  37765. angle: function() {
  37766. var e = Math.atan2(this.y, this.x);
  37767. return e < 0 && (e += 2 * Math.PI),
  37768. e
  37769. },
  37770. distanceTo: function(e) {
  37771. return Math.sqrt(this.distanceToSquared(e))
  37772. },
  37773. distanceToSquared: function(e) {
  37774. var t = this.x - e.x
  37775. , i = this.y - e.y;
  37776. return t * t + i * i
  37777. },
  37778. setLength: function(e) {
  37779. return this.multiplyScalar(e / this.length())
  37780. },
  37781. lerp: function(e, t) {
  37782. return this.x += (e.x - this.x) * t,
  37783. this.y += (e.y - this.y) * t,
  37784. this
  37785. },
  37786. lerpVectors: function(e, t, i) {
  37787. return this.subVectors(t, e).multiplyScalar(i).add(e),
  37788. this
  37789. },
  37790. equals: function(e) {
  37791. return e.x === this.x && e.y === this.y
  37792. },
  37793. fromArray: function(e, t) {
  37794. return void 0 === t && (t = 0),
  37795. this.x = e[t],
  37796. this.y = e[t + 1],
  37797. this
  37798. },
  37799. toArray: function(e, t) {
  37800. return void 0 === e && (e = []),
  37801. void 0 === t && (t = 0),
  37802. e[t] = this.x,
  37803. e[t + 1] = this.y,
  37804. e
  37805. },
  37806. fromAttribute: function(e, t, i) {
  37807. return void 0 === i && (i = 0),
  37808. t = t * e.itemSize + i,
  37809. this.x = e.array[t],
  37810. this.y = e.array[t + 1],
  37811. this
  37812. },
  37813. rotateAround: function(e, t) {
  37814. var i = Math.cos(t)
  37815. , n = Math.sin(t)
  37816. , r = this.x - e.x
  37817. , o = this.y - e.y;
  37818. return this.x = r * i - o * n + e.x,
  37819. this.y = r * n + o * i + e.y,
  37820. this
  37821. }
  37822. },
  37823. Ci.Vector3 = function(e, t, i) {
  37824. this.x = e || 0,
  37825. this.y = t || 0,
  37826. this.z = i || 0
  37827. }
  37828. ,
  37829. Ci.Vector3.prototype = {
  37830. constructor: Ci.Vector3,
  37831. set: function(e, t, i) {
  37832. return this.x = e,
  37833. this.y = t,
  37834. this.z = i,
  37835. this
  37836. },
  37837. setScalar: function(e) {
  37838. return this.x = e,
  37839. this.y = e,
  37840. this.z = e,
  37841. this
  37842. },
  37843. setX: function(e) {
  37844. return this.x = e,
  37845. this
  37846. },
  37847. setY: function(e) {
  37848. return this.y = e,
  37849. this
  37850. },
  37851. setZ: function(e) {
  37852. return this.z = e,
  37853. this
  37854. },
  37855. setComponent: function(e, t) {
  37856. switch (e) {
  37857. case 0:
  37858. this.x = t;
  37859. break;
  37860. case 1:
  37861. this.y = t;
  37862. break;
  37863. case 2:
  37864. this.z = t;
  37865. break;
  37866. default:
  37867. throw new Error("index is out of range: " + e)
  37868. }
  37869. },
  37870. getComponent: function(e) {
  37871. switch (e) {
  37872. case 0:
  37873. return this.x;
  37874. case 1:
  37875. return this.y;
  37876. case 2:
  37877. return this.z;
  37878. default:
  37879. throw new Error("index is out of range: " + e)
  37880. }
  37881. },
  37882. clone: function() {
  37883. return new this.constructor(this.x,this.y,this.z)
  37884. },
  37885. copy: function(e) {
  37886. return this.x = e.x,
  37887. this.y = e.y,
  37888. this.z = e.z,
  37889. this
  37890. },
  37891. add: function(e, t) {
  37892. return void 0 !== t ? (console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  37893. this.addVectors(e, t)) : (this.x += e.x,
  37894. this.y += e.y,
  37895. this.z += e.z,
  37896. this)
  37897. },
  37898. addScalar: function(e) {
  37899. return this.x += e,
  37900. this.y += e,
  37901. this.z += e,
  37902. this
  37903. },
  37904. addVectors: function(e, t) {
  37905. return this.x = e.x + t.x,
  37906. this.y = e.y + t.y,
  37907. this.z = e.z + t.z,
  37908. this
  37909. },
  37910. addScaledVector: function(e, t) {
  37911. return this.x += e.x * t,
  37912. this.y += e.y * t,
  37913. this.z += e.z * t,
  37914. this
  37915. },
  37916. sub: function(e, t) {
  37917. return void 0 !== t ? (console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  37918. this.subVectors(e, t)) : (this.x -= e.x,
  37919. this.y -= e.y,
  37920. this.z -= e.z,
  37921. this)
  37922. },
  37923. subScalar: function(e) {
  37924. return this.x -= e,
  37925. this.y -= e,
  37926. this.z -= e,
  37927. this
  37928. },
  37929. subVectors: function(e, t) {
  37930. return this.x = e.x - t.x,
  37931. this.y = e.y - t.y,
  37932. this.z = e.z - t.z,
  37933. this
  37934. },
  37935. multiply: function(e, t) {
  37936. return void 0 !== t ? (console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),
  37937. this.multiplyVectors(e, t)) : (this.x *= e.x,
  37938. this.y *= e.y,
  37939. this.z *= e.z,
  37940. this)
  37941. },
  37942. multiplyScalar: function(e) {
  37943. return isFinite(e) ? (this.x *= e,
  37944. this.y *= e,
  37945. this.z *= e) : (this.x = 0,
  37946. this.y = 0,
  37947. this.z = 0),
  37948. this
  37949. },
  37950. multiplyVectors: function(e, t) {
  37951. return this.x = e.x * t.x,
  37952. this.y = e.y * t.y,
  37953. this.z = e.z * t.z,
  37954. this
  37955. },
  37956. applyEuler: function(e) {
  37957. return e instanceof Ci.Euler == 0 && console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),
  37958. void 0 === De && (De = new Ci.Quaternion),
  37959. this.applyQuaternion(De.setFromEuler(e)),
  37960. this
  37961. },
  37962. applyAxisAngle: function(e, t) {
  37963. return void 0 === Le && (Le = new Ci.Quaternion),
  37964. this.applyQuaternion(Le.setFromAxisAngle(e, t)),
  37965. this
  37966. },
  37967. applyMatrix3: function(e) {
  37968. var t = this.x
  37969. , i = this.y
  37970. , n = this.z
  37971. , r = e.elements;
  37972. return this.x = r[0] * t + r[3] * i + r[6] * n,
  37973. this.y = r[1] * t + r[4] * i + r[7] * n,
  37974. this.z = r[2] * t + r[5] * i + r[8] * n,
  37975. this
  37976. },
  37977. applyMatrix4: function(e) {
  37978. var t = this.x
  37979. , i = this.y
  37980. , n = this.z
  37981. , r = e.elements;
  37982. return this.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  37983. this.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  37984. this.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  37985. this
  37986. },
  37987. applyProjection: function(e) {
  37988. var t = this.x
  37989. , i = this.y
  37990. , n = this.z
  37991. , r = e.elements
  37992. , o = 1 / (r[3] * t + r[7] * i + r[11] * n + r[15]);
  37993. return this.x = (r[0] * t + r[4] * i + r[8] * n + r[12]) * o,
  37994. this.y = (r[1] * t + r[5] * i + r[9] * n + r[13]) * o,
  37995. this.z = (r[2] * t + r[6] * i + r[10] * n + r[14]) * o,
  37996. this
  37997. },
  37998. applyQuaternion: function(e) {
  37999. var t = this.x
  38000. , i = this.y
  38001. , n = this.z
  38002. , r = e.x
  38003. , o = e.y
  38004. , a = e.z
  38005. , s = e.w
  38006. , l = s * t + o * n - a * i
  38007. , c = s * i + a * t - r * n
  38008. , h = s * n + r * i - o * t
  38009. , u = -r * t - o * i - a * n;
  38010. return this.x = l * s + u * -r + c * -a - h * -o,
  38011. this.y = c * s + u * -o + h * -r - l * -a,
  38012. this.z = h * s + u * -a + l * -o - c * -r,
  38013. this
  38014. },
  38015. project: function(e) {
  38016. return void 0 === Oe && (Oe = new Ci.Matrix4),
  38017. Oe.multiplyMatrices(e.projectionMatrix, Oe.getInverse(e.matrixWorld)),
  38018. this.applyProjection(Oe)
  38019. },
  38020. unproject: function(e) {
  38021. return void 0 === Pe && (Pe = new Ci.Matrix4),
  38022. Pe.multiplyMatrices(e.matrixWorld, Pe.getInverse(e.projectionMatrix)),
  38023. this.applyProjection(Pe)
  38024. },
  38025. transformDirection: function(e) {
  38026. var t = this.x
  38027. , i = this.y
  38028. , n = this.z
  38029. , r = e.elements;
  38030. return this.x = r[0] * t + r[4] * i + r[8] * n,
  38031. this.y = r[1] * t + r[5] * i + r[9] * n,
  38032. this.z = r[2] * t + r[6] * i + r[10] * n,
  38033. this.normalize(),
  38034. this
  38035. },
  38036. divide: function(e) {
  38037. return this.x /= e.x,
  38038. this.y /= e.y,
  38039. this.z /= e.z,
  38040. this
  38041. },
  38042. divideScalar: function(e) {
  38043. return this.multiplyScalar(1 / e)
  38044. },
  38045. min: function(e) {
  38046. return this.x = Math.min(this.x, e.x),
  38047. this.y = Math.min(this.y, e.y),
  38048. this.z = Math.min(this.z, e.z),
  38049. this
  38050. },
  38051. max: function(e) {
  38052. return this.x = Math.max(this.x, e.x),
  38053. this.y = Math.max(this.y, e.y),
  38054. this.z = Math.max(this.z, e.z),
  38055. this
  38056. },
  38057. clamp: function(e, t) {
  38058. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  38059. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  38060. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  38061. this
  38062. },
  38063. clampScalar: function(e, t) {
  38064. return void 0 === Me && (Me = new Ci.Vector3,
  38065. Re = new Ci.Vector3),
  38066. Me.set(e, e, e),
  38067. Re.set(t, t, t),
  38068. this.clamp(Me, Re)
  38069. },
  38070. clampLength: function(e, t) {
  38071. var i = this.length();
  38072. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  38073. this
  38074. },
  38075. floor: function() {
  38076. return this.x = Math.floor(this.x),
  38077. this.y = Math.floor(this.y),
  38078. this.z = Math.floor(this.z),
  38079. this
  38080. },
  38081. ceil: function() {
  38082. return this.x = Math.ceil(this.x),
  38083. this.y = Math.ceil(this.y),
  38084. this.z = Math.ceil(this.z),
  38085. this
  38086. },
  38087. round: function() {
  38088. return this.x = Math.round(this.x),
  38089. this.y = Math.round(this.y),
  38090. this.z = Math.round(this.z),
  38091. this
  38092. },
  38093. roundToZero: function() {
  38094. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  38095. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  38096. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  38097. this
  38098. },
  38099. negate: function() {
  38100. return this.x = -this.x,
  38101. this.y = -this.y,
  38102. this.z = -this.z,
  38103. this
  38104. },
  38105. dot: function(e) {
  38106. return this.x * e.x + this.y * e.y + this.z * e.z
  38107. },
  38108. lengthSq: function() {
  38109. return this.x * this.x + this.y * this.y + this.z * this.z
  38110. },
  38111. length: function() {
  38112. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z)
  38113. },
  38114. lengthManhattan: function() {
  38115. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z)
  38116. },
  38117. normalize: function() {
  38118. return this.divideScalar(this.length())
  38119. },
  38120. setLength: function(e) {
  38121. return this.multiplyScalar(e / this.length())
  38122. },
  38123. lerp: function(e, t) {
  38124. return this.x += (e.x - this.x) * t,
  38125. this.y += (e.y - this.y) * t,
  38126. this.z += (e.z - this.z) * t,
  38127. this
  38128. },
  38129. lerpVectors: function(e, t, i) {
  38130. return this.subVectors(t, e).multiplyScalar(i).add(e),
  38131. this
  38132. },
  38133. cross: function(e, t) {
  38134. if (void 0 !== t)
  38135. return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),
  38136. this.crossVectors(e, t);
  38137. var i = this.x
  38138. , n = this.y
  38139. , r = this.z;
  38140. return this.x = n * e.z - r * e.y,
  38141. this.y = r * e.x - i * e.z,
  38142. this.z = i * e.y - n * e.x,
  38143. this
  38144. },
  38145. crossVectors: function(e, t) {
  38146. var i = e.x
  38147. , n = e.y
  38148. , r = e.z
  38149. , o = t.x
  38150. , a = t.y
  38151. , s = t.z;
  38152. return this.x = n * s - r * a,
  38153. this.y = r * o - i * s,
  38154. this.z = i * a - n * o,
  38155. this
  38156. },
  38157. projectOnVector: function(e) {
  38158. return void 0 === xe && (xe = new Ci.Vector3),
  38159. xe.copy(e).normalize(),
  38160. Se = this.dot(xe),
  38161. this.copy(xe).multiplyScalar(Se)
  38162. },
  38163. projectOnPlane: function(e) {
  38164. return void 0 === Te && (Te = new Ci.Vector3),
  38165. Te.copy(this).projectOnVector(e),
  38166. this.sub(Te)
  38167. },
  38168. reflect: function(e) {
  38169. return void 0 === we && (we = new Ci.Vector3),
  38170. this.sub(we.copy(e).multiplyScalar(2 * this.dot(e)))
  38171. },
  38172. angleTo: function(e) {
  38173. var t = this.dot(e) / Math.sqrt(this.lengthSq() * e.lengthSq());
  38174. return Math.acos(Ci.Math.clamp(t, -1, 1))
  38175. },
  38176. distanceTo: function(e) {
  38177. return Math.sqrt(this.distanceToSquared(e))
  38178. },
  38179. distanceToSquared: function(e) {
  38180. var t = this.x - e.x
  38181. , i = this.y - e.y
  38182. , n = this.z - e.z;
  38183. return t * t + i * i + n * n
  38184. },
  38185. setFromSpherical: function(e) {
  38186. var t = Math.sin(e.phi) * e.radius;
  38187. return this.x = t * Math.sin(e.theta),
  38188. this.y = Math.cos(e.phi) * e.radius,
  38189. this.z = t * Math.cos(e.theta),
  38190. this
  38191. },
  38192. setFromMatrixPosition: function(e) {
  38193. return this.setFromMatrixColumn(e, 3)
  38194. },
  38195. setFromMatrixScale: function(e) {
  38196. var t = this.setFromMatrixColumn(e, 0).length()
  38197. , i = this.setFromMatrixColumn(e, 1).length()
  38198. , n = this.setFromMatrixColumn(e, 2).length();
  38199. return this.x = t,
  38200. this.y = i,
  38201. this.z = n,
  38202. this
  38203. },
  38204. setFromMatrixColumn: function(e, t) {
  38205. return "number" == typeof e && (console.warn("THREE.Vector3: setFromMatrixColumn now expects ( matrix, index )."),
  38206. t = e = t),
  38207. this.fromArray(e.elements, 4 * t)
  38208. },
  38209. equals: function(e) {
  38210. return e.x === this.x && e.y === this.y && e.z === this.z
  38211. },
  38212. fromArray: function(e, t) {
  38213. return void 0 === t && (t = 0),
  38214. this.x = e[t],
  38215. this.y = e[t + 1],
  38216. this.z = e[t + 2],
  38217. this
  38218. },
  38219. toArray: function(e, t) {
  38220. return void 0 === e && (e = []),
  38221. void 0 === t && (t = 0),
  38222. e[t] = this.x,
  38223. e[t + 1] = this.y,
  38224. e[t + 2] = this.z,
  38225. e
  38226. },
  38227. fromAttribute: function(e, t, i) {
  38228. return void 0 === i && (i = 0),
  38229. t = t * e.itemSize + i,
  38230. this.x = e.array[t],
  38231. this.y = e.array[t + 1],
  38232. this.z = e.array[t + 2],
  38233. this
  38234. }
  38235. },
  38236. Ci.Vector4 = function(e, t, i, n) {
  38237. this.x = e || 0,
  38238. this.y = t || 0,
  38239. this.z = i || 0,
  38240. this.w = void 0 !== n ? n : 1
  38241. }
  38242. ,
  38243. Ci.Vector4.prototype = {
  38244. constructor: Ci.Vector4,
  38245. set: function(e, t, i, n) {
  38246. return this.x = e,
  38247. this.y = t,
  38248. this.z = i,
  38249. this.w = n,
  38250. this
  38251. },
  38252. setScalar: function(e) {
  38253. return this.x = e,
  38254. this.y = e,
  38255. this.z = e,
  38256. this.w = e,
  38257. this
  38258. },
  38259. setX: function(e) {
  38260. return this.x = e,
  38261. this
  38262. },
  38263. setY: function(e) {
  38264. return this.y = e,
  38265. this
  38266. },
  38267. setZ: function(e) {
  38268. return this.z = e,
  38269. this
  38270. },
  38271. setW: function(e) {
  38272. return this.w = e,
  38273. this
  38274. },
  38275. setComponent: function(e, t) {
  38276. switch (e) {
  38277. case 0:
  38278. this.x = t;
  38279. break;
  38280. case 1:
  38281. this.y = t;
  38282. break;
  38283. case 2:
  38284. this.z = t;
  38285. break;
  38286. case 3:
  38287. this.w = t;
  38288. break;
  38289. default:
  38290. throw new Error("index is out of range: " + e)
  38291. }
  38292. },
  38293. getComponent: function(e) {
  38294. switch (e) {
  38295. case 0:
  38296. return this.x;
  38297. case 1:
  38298. return this.y;
  38299. case 2:
  38300. return this.z;
  38301. case 3:
  38302. return this.w;
  38303. default:
  38304. throw new Error("index is out of range: " + e)
  38305. }
  38306. },
  38307. clone: function() {
  38308. return new this.constructor(this.x,this.y,this.z,this.w)
  38309. },
  38310. copy: function(e) {
  38311. return this.x = e.x,
  38312. this.y = e.y,
  38313. this.z = e.z,
  38314. this.w = void 0 !== e.w ? e.w : 1,
  38315. this
  38316. },
  38317. add: function(e, t) {
  38318. return void 0 !== t ? (console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  38319. this.addVectors(e, t)) : (this.x += e.x,
  38320. this.y += e.y,
  38321. this.z += e.z,
  38322. this.w += e.w,
  38323. this)
  38324. },
  38325. addScalar: function(e) {
  38326. return this.x += e,
  38327. this.y += e,
  38328. this.z += e,
  38329. this.w += e,
  38330. this
  38331. },
  38332. addVectors: function(e, t) {
  38333. return this.x = e.x + t.x,
  38334. this.y = e.y + t.y,
  38335. this.z = e.z + t.z,
  38336. this.w = e.w + t.w,
  38337. this
  38338. },
  38339. addScaledVector: function(e, t) {
  38340. return this.x += e.x * t,
  38341. this.y += e.y * t,
  38342. this.z += e.z * t,
  38343. this.w += e.w * t,
  38344. this
  38345. },
  38346. sub: function(e, t) {
  38347. return void 0 !== t ? (console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  38348. this.subVectors(e, t)) : (this.x -= e.x,
  38349. this.y -= e.y,
  38350. this.z -= e.z,
  38351. this.w -= e.w,
  38352. this)
  38353. },
  38354. subScalar: function(e) {
  38355. return this.x -= e,
  38356. this.y -= e,
  38357. this.z -= e,
  38358. this.w -= e,
  38359. this
  38360. },
  38361. subVectors: function(e, t) {
  38362. return this.x = e.x - t.x,
  38363. this.y = e.y - t.y,
  38364. this.z = e.z - t.z,
  38365. this.w = e.w - t.w,
  38366. this
  38367. },
  38368. multiplyScalar: function(e) {
  38369. return isFinite(e) ? (this.x *= e,
  38370. this.y *= e,
  38371. this.z *= e,
  38372. this.w *= e) : (this.x = 0,
  38373. this.y = 0,
  38374. this.z = 0,
  38375. this.w = 0),
  38376. this
  38377. },
  38378. applyMatrix4: function(e) {
  38379. var t = this.x
  38380. , i = this.y
  38381. , n = this.z
  38382. , r = this.w
  38383. , o = e.elements;
  38384. return this.x = o[0] * t + o[4] * i + o[8] * n + o[12] * r,
  38385. this.y = o[1] * t + o[5] * i + o[9] * n + o[13] * r,
  38386. this.z = o[2] * t + o[6] * i + o[10] * n + o[14] * r,
  38387. this.w = o[3] * t + o[7] * i + o[11] * n + o[15] * r,
  38388. this
  38389. },
  38390. divideScalar: function(e) {
  38391. return this.multiplyScalar(1 / e)
  38392. },
  38393. setAxisAngleFromQuaternion: function(e) {
  38394. this.w = 2 * Math.acos(e.w);
  38395. var t = Math.sqrt(1 - e.w * e.w);
  38396. return t < 1e-4 ? (this.x = 1,
  38397. this.y = 0,
  38398. this.z = 0) : (this.x = e.x / t,
  38399. this.y = e.y / t,
  38400. this.z = e.z / t),
  38401. this
  38402. },
  38403. setAxisAngleFromRotationMatrix: function(e) {
  38404. 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];
  38405. if (Math.abs(s - c) < .01 && Math.abs(l - d) < .01 && Math.abs(u - p) < .01) {
  38406. if (Math.abs(s + c) < .1 && Math.abs(l + d) < .1 && Math.abs(u + p) < .1 && Math.abs(a + h + f - 3) < .1)
  38407. return this.set(1, 0, 0, 0),
  38408. this;
  38409. t = Math.PI;
  38410. var g = (a + 1) / 2
  38411. , m = (h + 1) / 2
  38412. , v = (f + 1) / 2
  38413. , y = (s + c) / 4
  38414. , A = (l + d) / 4
  38415. , C = (u + p) / 4;
  38416. return m < g && v < g ? r = g < .01 ? (i = 0,
  38417. n = .707106781) : (n = y / (i = Math.sqrt(g)),
  38418. A / i) : v < m ? r = m < .01 ? (n = 0,
  38419. i = .707106781) : (i = y / (n = Math.sqrt(m)),
  38420. C / n) : v < .01 ? (n = i = .707106781,
  38421. r = 0) : (i = A / (r = Math.sqrt(v)),
  38422. n = C / r),
  38423. this.set(i, n, r, t),
  38424. this
  38425. }
  38426. var I = Math.sqrt((p - u) * (p - u) + (l - d) * (l - d) + (c - s) * (c - s));
  38427. return Math.abs(I) < .001 && (I = 1),
  38428. this.x = (p - u) / I,
  38429. this.y = (l - d) / I,
  38430. this.z = (c - s) / I,
  38431. this.w = Math.acos((a + h + f - 1) / 2),
  38432. this
  38433. },
  38434. min: function(e) {
  38435. return this.x = Math.min(this.x, e.x),
  38436. this.y = Math.min(this.y, e.y),
  38437. this.z = Math.min(this.z, e.z),
  38438. this.w = Math.min(this.w, e.w),
  38439. this
  38440. },
  38441. max: function(e) {
  38442. return this.x = Math.max(this.x, e.x),
  38443. this.y = Math.max(this.y, e.y),
  38444. this.z = Math.max(this.z, e.z),
  38445. this.w = Math.max(this.w, e.w),
  38446. this
  38447. },
  38448. clamp: function(e, t) {
  38449. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  38450. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  38451. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  38452. this.w = Math.max(e.w, Math.min(t.w, this.w)),
  38453. this
  38454. },
  38455. clampScalar: function(e, t) {
  38456. return void 0 === _e && (_e = new Ci.Vector4,
  38457. be = new Ci.Vector4),
  38458. _e.set(e, e, e, e),
  38459. be.set(t, t, t, t),
  38460. this.clamp(_e, be)
  38461. },
  38462. floor: function() {
  38463. return this.x = Math.floor(this.x),
  38464. this.y = Math.floor(this.y),
  38465. this.z = Math.floor(this.z),
  38466. this.w = Math.floor(this.w),
  38467. this
  38468. },
  38469. ceil: function() {
  38470. return this.x = Math.ceil(this.x),
  38471. this.y = Math.ceil(this.y),
  38472. this.z = Math.ceil(this.z),
  38473. this.w = Math.ceil(this.w),
  38474. this
  38475. },
  38476. round: function() {
  38477. return this.x = Math.round(this.x),
  38478. this.y = Math.round(this.y),
  38479. this.z = Math.round(this.z),
  38480. this.w = Math.round(this.w),
  38481. this
  38482. },
  38483. roundToZero: function() {
  38484. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  38485. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  38486. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  38487. this.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w),
  38488. this
  38489. },
  38490. negate: function() {
  38491. return this.x = -this.x,
  38492. this.y = -this.y,
  38493. this.z = -this.z,
  38494. this.w = -this.w,
  38495. this
  38496. },
  38497. dot: function(e) {
  38498. return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w
  38499. },
  38500. lengthSq: function() {
  38501. return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w
  38502. },
  38503. length: function() {
  38504. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w)
  38505. },
  38506. lengthManhattan: function() {
  38507. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w)
  38508. },
  38509. normalize: function() {
  38510. return this.divideScalar(this.length())
  38511. },
  38512. setLength: function(e) {
  38513. return this.multiplyScalar(e / this.length())
  38514. },
  38515. lerp: function(e, t) {
  38516. return this.x += (e.x - this.x) * t,
  38517. this.y += (e.y - this.y) * t,
  38518. this.z += (e.z - this.z) * t,
  38519. this.w += (e.w - this.w) * t,
  38520. this
  38521. },
  38522. lerpVectors: function(e, t, i) {
  38523. return this.subVectors(t, e).multiplyScalar(i).add(e),
  38524. this
  38525. },
  38526. equals: function(e) {
  38527. return e.x === this.x && e.y === this.y && e.z === this.z && e.w === this.w
  38528. },
  38529. fromArray: function(e, t) {
  38530. return void 0 === t && (t = 0),
  38531. this.x = e[t],
  38532. this.y = e[t + 1],
  38533. this.z = e[t + 2],
  38534. this.w = e[t + 3],
  38535. this
  38536. },
  38537. toArray: function(e, t) {
  38538. return void 0 === e && (e = []),
  38539. void 0 === t && (t = 0),
  38540. e[t] = this.x,
  38541. e[t + 1] = this.y,
  38542. e[t + 2] = this.z,
  38543. e[t + 3] = this.w,
  38544. e
  38545. },
  38546. fromAttribute: function(e, t, i) {
  38547. return void 0 === i && (i = 0),
  38548. t = t * e.itemSize + i,
  38549. this.x = e.array[t],
  38550. this.y = e.array[t + 1],
  38551. this.z = e.array[t + 2],
  38552. this.w = e.array[t + 3],
  38553. this
  38554. }
  38555. },
  38556. Ci.Euler = function(e, t, i, n) {
  38557. this._x = e || 0,
  38558. this._y = t || 0,
  38559. this._z = i || 0,
  38560. this._order = n || Ci.Euler.DefaultOrder
  38561. }
  38562. ,
  38563. Ci.Euler.RotationOrders = ["XYZ", "YZX", "ZXY", "XZY", "YXZ", "ZYX"],
  38564. Ci.Euler.DefaultOrder = "XYZ",
  38565. Ci.Euler.prototype = {
  38566. constructor: Ci.Euler,
  38567. get x() {
  38568. return this._x
  38569. },
  38570. set x(e) {
  38571. this._x = e,
  38572. this.onChangeCallback()
  38573. },
  38574. get y() {
  38575. return this._y
  38576. },
  38577. set y(e) {
  38578. this._y = e,
  38579. this.onChangeCallback()
  38580. },
  38581. get z() {
  38582. return this._z
  38583. },
  38584. set z(e) {
  38585. this._z = e,
  38586. this.onChangeCallback()
  38587. },
  38588. get order() {
  38589. return this._order
  38590. },
  38591. set order(e) {
  38592. this._order = e,
  38593. this.onChangeCallback()
  38594. },
  38595. set: function(e, t, i, n) {
  38596. return this._x = e,
  38597. this._y = t,
  38598. this._z = i,
  38599. this._order = n || this._order,
  38600. this.onChangeCallback(),
  38601. this
  38602. },
  38603. clone: function() {
  38604. return new this.constructor(this._x,this._y,this._z,this._order)
  38605. },
  38606. copy: function(e) {
  38607. return this._x = e._x,
  38608. this._y = e._y,
  38609. this._z = e._z,
  38610. this._order = e._order,
  38611. this.onChangeCallback(),
  38612. this
  38613. },
  38614. toObject: function() {//xzw
  38615. return {x:this.x,y:this.y,z:this.z}
  38616. },
  38617. setFromRotationMatrix: function(e, t, i) {
  38618. var n = Ci.Math.clamp
  38619. , r = e.elements
  38620. , o = r[0]
  38621. , a = r[4]
  38622. , s = r[8]
  38623. , l = r[1]
  38624. , c = r[5]
  38625. , h = r[9]
  38626. , u = r[2]
  38627. , d = r[6]
  38628. , p = r[10];
  38629. return "XYZ" === (t = t || this._order) ? (this._y = Math.asin(n(s, -1, 1)),
  38630. Math.abs(s) < .99999 ? (this._x = Math.atan2(-h, p),
  38631. this._z = Math.atan2(-a, o)) : (this._x = Math.atan2(d, c),
  38632. this._z = 0)) : "YXZ" === t ? (this._x = Math.asin(-n(h, -1, 1)),
  38633. Math.abs(h) < .99999 ? (this._y = Math.atan2(s, p),
  38634. this._z = Math.atan2(l, c)) : (this._y = Math.atan2(-u, o),
  38635. this._z = 0)) : "ZXY" === t ? (this._x = Math.asin(n(d, -1, 1)),
  38636. Math.abs(d) < .99999 ? (this._y = Math.atan2(-u, p),
  38637. this._z = Math.atan2(-a, c)) : (this._y = 0,
  38638. this._z = Math.atan2(l, o))) : "ZYX" === t ? (this._y = Math.asin(-n(u, -1, 1)),
  38639. Math.abs(u) < .99999 ? (this._x = Math.atan2(d, p),
  38640. this._z = Math.atan2(l, o)) : (this._x = 0,
  38641. this._z = Math.atan2(-a, c))) : "YZX" === t ? (this._z = Math.asin(n(l, -1, 1)),
  38642. Math.abs(l) < .99999 ? (this._x = Math.atan2(-h, c),
  38643. this._y = Math.atan2(-u, o)) : (this._x = 0,
  38644. this._y = Math.atan2(s, p))) : "XZY" === t ? (this._z = Math.asin(-n(a, -1, 1)),
  38645. Math.abs(a) < .99999 ? (this._x = Math.atan2(d, c),
  38646. this._y = Math.atan2(s, o)) : (this._x = Math.atan2(-h, p),
  38647. this._y = 0)) : console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: " + t),
  38648. this._order = t,
  38649. !1 !== i && this.onChangeCallback(),
  38650. this
  38651. },
  38652. setFromQuaternion: function(e, t, i) {
  38653. return void 0 === Ee && (Ee = new Ci.Matrix4),
  38654. Ee.makeRotationFromQuaternion(e),
  38655. this.setFromRotationMatrix(Ee, t, i),
  38656. this
  38657. },
  38658. setFromVector3: function(e, t) {
  38659. return this.set(e.x, e.y, e.z, t || this._order)
  38660. },
  38661. reorder: (Ie = new Ci.Quaternion,
  38662. function(e) {
  38663. Ie.setFromEuler(this),
  38664. this.setFromQuaternion(Ie, e)
  38665. }
  38666. ),
  38667. equals: function(e) {
  38668. return e._x === this._x && e._y === this._y && e._z === this._z && e._order === this._order
  38669. },
  38670. fromArray: function(e) {
  38671. return this._x = e[0],
  38672. this._y = e[1],
  38673. this._z = e[2],
  38674. void 0 !== e[3] && (this._order = e[3]),
  38675. this.onChangeCallback(),
  38676. this
  38677. },
  38678. toArray: function(e, t) {
  38679. return void 0 === e && (e = []),
  38680. void 0 === t && (t = 0),
  38681. e[t] = this._x,
  38682. e[t + 1] = this._y,
  38683. e[t + 2] = this._z,
  38684. e[t + 3] = this._order,
  38685. e
  38686. },
  38687. toVector3: function(e) {
  38688. return e ? e.set(this._x, this._y, this._z) : new Ci.Vector3(this._x,this._y,this._z)
  38689. },
  38690. onChange: function(e) {
  38691. return this.onChangeCallback = e,
  38692. this
  38693. },
  38694. onChangeCallback: function() {}
  38695. },
  38696. Ci.Line3 = function(e, t) {
  38697. this.start = void 0 !== e ? e : new Ci.Vector3,
  38698. this.end = void 0 !== t ? t : new Ci.Vector3
  38699. }
  38700. ,
  38701. Ci.Line3.prototype = {
  38702. constructor: Ci.Line3,
  38703. set: function(e, t) {
  38704. return this.start.copy(e),
  38705. this.end.copy(t),
  38706. this
  38707. },
  38708. clone: function() {
  38709. return (new this.constructor).copy(this)
  38710. },
  38711. copy: function(e) {
  38712. return this.start.copy(e.start),
  38713. this.end.copy(e.end),
  38714. this
  38715. },
  38716. center: function(e) {
  38717. return (e || new Ci.Vector3).addVectors(this.start, this.end).multiplyScalar(.5)
  38718. },
  38719. delta: function(e) {
  38720. return (e || new Ci.Vector3).subVectors(this.end, this.start)
  38721. },
  38722. distanceSq: function() {
  38723. return this.start.distanceToSquared(this.end)
  38724. },
  38725. distance: function() {
  38726. return this.start.distanceTo(this.end)
  38727. },
  38728. at: function(e, t) {
  38729. var i = t || new Ci.Vector3;
  38730. return this.delta(i).multiplyScalar(e).add(this.start)
  38731. },
  38732. closestPointToPointParameter: (Ae = new Ci.Vector3,
  38733. Ce = new Ci.Vector3,
  38734. function(e, t) {
  38735. Ae.subVectors(e, this.start),
  38736. Ce.subVectors(this.end, this.start);
  38737. var i = Ce.dot(Ce)
  38738. , n = Ce.dot(Ae) / i;
  38739. return t && (n = Ci.Math.clamp(n, 0, 1)),
  38740. n
  38741. }
  38742. ),
  38743. closestPointToPoint: function(e, t, i) {
  38744. var n = this.closestPointToPointParameter(e, t)
  38745. , r = i || new Ci.Vector3;
  38746. return this.delta(r).multiplyScalar(n).add(this.start)
  38747. },
  38748. applyMatrix4: function(e) {
  38749. return this.start.applyMatrix4(e),
  38750. this.end.applyMatrix4(e),
  38751. this
  38752. },
  38753. equals: function(e) {
  38754. return e.start.equals(this.start) && e.end.equals(this.end)
  38755. }
  38756. },
  38757. Ci.Box2 = function(e, t) {
  38758. this.min = void 0 !== e ? e : new Ci.Vector2(1 / 0,1 / 0),
  38759. this.max = void 0 !== t ? t : new Ci.Vector2(-1 / 0,-1 / 0)
  38760. }
  38761. ,
  38762. Ci.Box2.prototype = {
  38763. constructor: Ci.Box2,
  38764. set: function(e, t) {
  38765. return this.min.copy(e),
  38766. this.max.copy(t),
  38767. this
  38768. },
  38769. setFromPoints: function(e) {
  38770. this.makeEmpty();
  38771. for (var t = 0, i = e.length; t < i; t++)
  38772. this.expandByPoint(e[t]);
  38773. return this
  38774. },
  38775. setFromCenterAndSize: (ye = new Ci.Vector2,
  38776. function(e, t) {
  38777. var i = ye.copy(t).multiplyScalar(.5);
  38778. return this.min.copy(e).sub(i),
  38779. this.max.copy(e).add(i),
  38780. this
  38781. }
  38782. ),
  38783. clone: function() {
  38784. return (new this.constructor).copy(this)
  38785. },
  38786. copy: function(e) {
  38787. return this.min.copy(e.min),
  38788. this.max.copy(e.max),
  38789. this
  38790. },
  38791. makeEmpty: function() {
  38792. return this.min.x = this.min.y = 1 / 0,
  38793. this.max.x = this.max.y = -1 / 0,
  38794. this
  38795. },
  38796. isEmpty: function() {
  38797. return this.max.x < this.min.x || this.max.y < this.min.y
  38798. },
  38799. center: function(e) {
  38800. return (e || new Ci.Vector2).addVectors(this.min, this.max).multiplyScalar(.5)
  38801. },
  38802. size: function(e) {
  38803. return (e || new Ci.Vector2).subVectors(this.max, this.min)
  38804. },
  38805. expandByPoint: function(e) {
  38806. return this.min.min(e),
  38807. this.max.max(e),
  38808. this
  38809. },
  38810. expandByVector: function(e) {
  38811. return this.min.sub(e),
  38812. this.max.add(e),
  38813. this
  38814. },
  38815. expandByScalar: function(e) {
  38816. return this.min.addScalar(-e),
  38817. this.max.addScalar(e),
  38818. this
  38819. },
  38820. containsPoint: function(e) {
  38821. return !(e.x < this.min.x || e.x > this.max.x || e.y < this.min.y || e.y > this.max.y)
  38822. },
  38823. containsBox: function(e) {
  38824. 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
  38825. },
  38826. getParameter: function(e, t) {
  38827. 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))
  38828. },
  38829. intersectsBox: function(e) {
  38830. 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)
  38831. },
  38832. clampPoint: function(e, t) {
  38833. return (t || new Ci.Vector2).copy(e).clamp(this.min, this.max)
  38834. },
  38835. distanceToPoint: (ve = new Ci.Vector2,
  38836. function(e) {
  38837. return ve.copy(e).clamp(this.min, this.max).sub(e).length()
  38838. }
  38839. ),
  38840. intersect: function(e) {
  38841. return this.min.max(e.min),
  38842. this.max.min(e.max),
  38843. this
  38844. },
  38845. union: function(e) {
  38846. return this.min.min(e.min),
  38847. this.max.max(e.max),
  38848. this
  38849. },
  38850. translate: function(e) {
  38851. return this.min.add(e),
  38852. this.max.add(e),
  38853. this
  38854. },
  38855. equals: function(e) {
  38856. return e.min.equals(this.min) && e.max.equals(this.max)
  38857. }
  38858. },
  38859. Ci.Box3 = function(e, t) {
  38860. this.min = void 0 !== e ? e : new Ci.Vector3(1 / 0,1 / 0,1 / 0),
  38861. this.max = void 0 !== t ? t : new Ci.Vector3(-1 / 0,-1 / 0,-1 / 0)
  38862. }
  38863. ,
  38864. Ci.Box3.prototype = {
  38865. constructor: Ci.Box3,
  38866. set: function(e, t) {
  38867. return this.min.copy(e),
  38868. this.max.copy(t),
  38869. this
  38870. },
  38871. setFromArray: function(e) {
  38872. this.makeEmpty();
  38873. 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) {
  38874. var c = e[s]
  38875. , h = e[s + 1]
  38876. , u = e[s + 2];
  38877. c < t && (t = c),
  38878. h < i && (i = h),
  38879. u < n && (n = u),
  38880. r < c && (r = c),
  38881. o < h && (o = h),
  38882. a < u && (a = u)
  38883. }
  38884. this.min.set(t, i, n),
  38885. this.max.set(r, o, a)
  38886. },
  38887. setFromPoints: function(e) {
  38888. this.makeEmpty();
  38889. for (var t = 0, i = e.length; t < i; t++)
  38890. this.expandByPoint(e[t]);
  38891. return this
  38892. },
  38893. setFromCenterAndSize: (me = new Ci.Vector3,
  38894. function(e, t) {
  38895. var i = me.copy(t).multiplyScalar(.5);
  38896. return this.min.copy(e).sub(i),
  38897. this.max.copy(e).add(i),
  38898. this
  38899. }
  38900. ),
  38901. setFromObject: function(e) {
  38902. void 0 === ge && (ge = new Ci.Box3);
  38903. var i = this;
  38904. return this.makeEmpty(),
  38905. e.updateMatrixWorld(!0),
  38906. e.traverse(function(e) {
  38907. var t = e.geometry;
  38908. void 0 !== t && (null === t.boundingBox && t.computeBoundingBox(),
  38909. !1 === t.boundingBox.isEmpty() && (ge.copy(t.boundingBox),
  38910. ge.applyMatrix4(e.matrixWorld),
  38911. i.union(ge)))
  38912. }),
  38913. this
  38914. },
  38915. clone: function() {
  38916. return (new this.constructor).copy(this)
  38917. },
  38918. copy: function(e) {
  38919. return this.min.copy(e.min),
  38920. this.max.copy(e.max),
  38921. this
  38922. },
  38923. makeEmpty: function() {
  38924. return this.min.x = this.min.y = this.min.z = 1 / 0,
  38925. this.max.x = this.max.y = this.max.z = -1 / 0,
  38926. this
  38927. },
  38928. isEmpty: function() {
  38929. return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z
  38930. },
  38931. center: function(e) {
  38932. return (e || new Ci.Vector3).addVectors(this.min, this.max).multiplyScalar(.5)
  38933. },
  38934. size: function(e) {
  38935. return (e || new Ci.Vector3).subVectors(this.max, this.min)
  38936. },
  38937. expandByPoint: function(e) {
  38938. return this.min.min(e),
  38939. this.max.max(e),
  38940. this
  38941. },
  38942. expandByVector: function(e) {
  38943. return this.min.sub(e),
  38944. this.max.add(e),
  38945. this
  38946. },
  38947. expandByScalar: function(e) {
  38948. return this.min.addScalar(-e),
  38949. this.max.addScalar(e),
  38950. this
  38951. },
  38952. containsPoint: function(e) {
  38953. 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)
  38954. },
  38955. containsBox: function(e) {
  38956. 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
  38957. },
  38958. getParameter: function(e, t) {
  38959. 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))
  38960. },
  38961. intersectsBox: function(e) {
  38962. 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)
  38963. },
  38964. intersectsSphere: function(e) {
  38965. return void 0 === fe && (fe = new Ci.Vector3),
  38966. this.clampPoint(e.center, fe),
  38967. fe.distanceToSquared(e.center) <= e.radius * e.radius
  38968. },
  38969. intersectsPlane: function(e) {
  38970. var t, i;
  38971. return i = 0 < e.normal.x ? (t = e.normal.x * this.min.x,
  38972. e.normal.x * this.max.x) : (t = e.normal.x * this.max.x,
  38973. e.normal.x * this.min.x),
  38974. 0 < e.normal.y ? (t += e.normal.y * this.min.y,
  38975. i += e.normal.y * this.max.y) : (t += e.normal.y * this.max.y,
  38976. i += e.normal.y * this.min.y),
  38977. 0 < e.normal.z ? (t += e.normal.z * this.min.z,
  38978. i += e.normal.z * this.max.z) : (t += e.normal.z * this.max.z,
  38979. i += e.normal.z * this.min.z),
  38980. t <= e.constant && i >= e.constant
  38981. },
  38982. clampPoint: function(e, t) {
  38983. return (t || new Ci.Vector3).copy(e).clamp(this.min, this.max)
  38984. },
  38985. distanceToPoint: (pe = new Ci.Vector3,
  38986. function(e) {
  38987. return pe.copy(e).clamp(this.min, this.max).sub(e).length()
  38988. }
  38989. ),
  38990. getBoundingSphere: (de = new Ci.Vector3,
  38991. function(e) {
  38992. var t = e || new Ci.Sphere;
  38993. return t.center = this.center(),
  38994. t.radius = .5 * this.size(de).length(),
  38995. t
  38996. }
  38997. ),
  38998. intersect: function(e) {
  38999. return this.min.max(e.min),
  39000. this.max.min(e.max),
  39001. this
  39002. },
  39003. union: function(e) {
  39004. return this.min.min(e.min),
  39005. this.max.max(e.max),
  39006. this
  39007. },
  39008. 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],
  39009. function(e) {
  39010. return ue[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(e),
  39011. ue[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(e),
  39012. ue[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(e),
  39013. ue[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(e),
  39014. ue[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(e),
  39015. ue[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(e),
  39016. ue[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(e),
  39017. ue[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(e),
  39018. this.makeEmpty(),
  39019. this.setFromPoints(ue),
  39020. this
  39021. }
  39022. ),
  39023. translate: function(e) {
  39024. return this.min.add(e),
  39025. this.max.add(e),
  39026. this
  39027. },
  39028. equals: function(e) {
  39029. return e.min.equals(this.min) && e.max.equals(this.max)
  39030. }
  39031. },
  39032. Ci.Matrix3 = function() {
  39033. this.elements = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]),
  39034. 0 < arguments.length && console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")
  39035. }
  39036. ,
  39037. Ci.Matrix3.prototype = {
  39038. constructor: Ci.Matrix3,
  39039. set: function(e, t, i, n, r, o, a, s, l) {
  39040. var c = this.elements;
  39041. return c[0] = e,
  39042. c[1] = n,
  39043. c[2] = a,
  39044. c[3] = t,
  39045. c[4] = r,
  39046. c[5] = s,
  39047. c[6] = i,
  39048. c[7] = o,
  39049. c[8] = l,
  39050. this
  39051. },
  39052. identity: function() {
  39053. return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1),
  39054. this
  39055. },
  39056. clone: function() {
  39057. return (new this.constructor).fromArray(this.elements)
  39058. },
  39059. copy: function(e) {
  39060. var t = e.elements;
  39061. return this.set(t[0], t[3], t[6], t[1], t[4], t[7], t[2], t[5], t[8]),
  39062. this
  39063. },
  39064. setFromMatrix4: function(e) {
  39065. var t = e.elements;
  39066. return this.set(t[0], t[4], t[8], t[1], t[5], t[9], t[2], t[6], t[10]),
  39067. this
  39068. },
  39069. applyToVector3Array: function(e, t, i) {
  39070. void 0 === he && (he = new Ci.Vector3),
  39071. void 0 === t && (t = 0),
  39072. void 0 === i && (i = e.length);
  39073. for (var n = 0, r = t; n < i; n += 3,
  39074. r += 3)
  39075. he.fromArray(e, r),
  39076. he.applyMatrix3(this),
  39077. he.toArray(e, r);
  39078. return e
  39079. },
  39080. applyToBuffer: function(e, t, i) {
  39081. void 0 === ce && (ce = new Ci.Vector3),
  39082. void 0 === t && (t = 0),
  39083. void 0 === i && (i = e.length / e.itemSize);
  39084. for (var n = 0, r = t; n < i; n++,
  39085. r++)
  39086. ce.x = e.getX(r),
  39087. ce.y = e.getY(r),
  39088. ce.z = e.getZ(r),
  39089. ce.applyMatrix3(this),
  39090. e.setXYZ(ce.x, ce.y, ce.z);
  39091. return e
  39092. },
  39093. multiplyScalar: function(e) {
  39094. var t = this.elements;
  39095. return t[0] *= e,
  39096. t[3] *= e,
  39097. t[6] *= e,
  39098. t[1] *= e,
  39099. t[4] *= e,
  39100. t[7] *= e,
  39101. t[2] *= e,
  39102. t[5] *= e,
  39103. t[8] *= e,
  39104. this
  39105. },
  39106. determinant: function() {
  39107. var e = this.elements
  39108. , t = e[0]
  39109. , i = e[1]
  39110. , n = e[2]
  39111. , r = e[3]
  39112. , o = e[4]
  39113. , a = e[5]
  39114. , s = e[6]
  39115. , l = e[7]
  39116. , c = e[8];
  39117. return t * o * c - t * a * l - i * r * c + i * a * s + n * r * l - n * o * s
  39118. },
  39119. getInverse: function(e, t) {
  39120. e instanceof Ci.Matrix4 && console.warn("THREE.Matrix3.getInverse no longer takes a Matrix4 argument.");
  39121. var i = e.elements
  39122. , n = this.elements
  39123. , r = i[0]
  39124. , o = i[1]
  39125. , a = i[2]
  39126. , s = i[3]
  39127. , l = i[4]
  39128. , c = i[5]
  39129. , h = i[6]
  39130. , u = i[7]
  39131. , d = i[8]
  39132. , p = d * l - c * u
  39133. , f = c * h - d * s
  39134. , g = u * s - l * h
  39135. , m = r * p + o * f + a * g;
  39136. if (0 != m)
  39137. return n[0] = p,
  39138. n[1] = a * u - d * o,
  39139. n[2] = c * o - a * l,
  39140. n[3] = f,
  39141. n[4] = d * r - a * h,
  39142. n[5] = a * s - c * r,
  39143. n[6] = g,
  39144. n[7] = o * h - u * r,
  39145. n[8] = l * r - o * s,
  39146. this.multiplyScalar(1 / m);
  39147. var v = "THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0";
  39148. if (t)
  39149. throw new Error(v);
  39150. return console.warn(v),
  39151. this.identity()
  39152. },
  39153. transpose: function() {
  39154. var e, t = this.elements;
  39155. return e = t[1],
  39156. t[1] = t[3],
  39157. t[3] = e,
  39158. e = t[2],
  39159. t[2] = t[6],
  39160. t[6] = e,
  39161. e = t[5],
  39162. t[5] = t[7],
  39163. t[7] = e,
  39164. this
  39165. },
  39166. flattenToArrayOffset: function(e, t) {
  39167. var i = this.elements;
  39168. return e[t] = i[0],
  39169. e[t + 1] = i[1],
  39170. e[t + 2] = i[2],
  39171. e[t + 3] = i[3],
  39172. e[t + 4] = i[4],
  39173. e[t + 5] = i[5],
  39174. e[t + 6] = i[6],
  39175. e[t + 7] = i[7],
  39176. e[t + 8] = i[8],
  39177. e
  39178. },
  39179. getNormalMatrix: function(e) {
  39180. return this.setFromMatrix4(e).getInverse(this).transpose()
  39181. },
  39182. transposeIntoArray: function(e) {
  39183. var t = this.elements;
  39184. return e[0] = t[0],
  39185. e[1] = t[3],
  39186. e[2] = t[6],
  39187. e[3] = t[1],
  39188. e[4] = t[4],
  39189. e[5] = t[7],
  39190. e[6] = t[2],
  39191. e[7] = t[5],
  39192. e[8] = t[8],
  39193. this
  39194. },
  39195. fromArray: function(e) {
  39196. return this.elements.set(e),
  39197. this
  39198. },
  39199. toArray: function() {
  39200. var e = this.elements;
  39201. return [e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8]]
  39202. }
  39203. },
  39204. Ci.Matrix4 = function() {
  39205. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  39206. 0 < arguments.length && console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  39207. }
  39208. ,
  39209. Ci.Matrix4.prototype = {
  39210. constructor: Ci.Matrix4,
  39211. set: function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  39212. var m = this.elements;
  39213. return m[0] = e,
  39214. m[4] = t,
  39215. m[8] = i,
  39216. m[12] = n,
  39217. m[1] = r,
  39218. m[5] = o,
  39219. m[9] = a,
  39220. m[13] = s,
  39221. m[2] = l,
  39222. m[6] = c,
  39223. m[10] = h,
  39224. m[14] = u,
  39225. m[3] = d,
  39226. m[7] = p,
  39227. m[11] = f,
  39228. m[15] = g,
  39229. this
  39230. },
  39231. identity: function() {
  39232. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  39233. this
  39234. },
  39235. clone: function() {
  39236. return (new Ci.Matrix4).fromArray(this.elements)
  39237. },
  39238. copy: function(e) {
  39239. return this.elements.set(e.elements),
  39240. this
  39241. },
  39242. copyPosition: function(e) {
  39243. var t = this.elements
  39244. , i = e.elements;
  39245. return t[12] = i[12],
  39246. t[13] = i[13],
  39247. t[14] = i[14],
  39248. this
  39249. },
  39250. extractBasis: function(e, t, i) {
  39251. return e.setFromMatrixColumn(this, 0),
  39252. t.setFromMatrixColumn(this, 1),
  39253. i.setFromMatrixColumn(this, 2),
  39254. this
  39255. },
  39256. makeBasis: function(e, t, i) {
  39257. 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),
  39258. this
  39259. },
  39260. extractRotation: function(e) {
  39261. void 0 === le && (le = new Ci.Vector3);
  39262. var t = this.elements
  39263. , i = e.elements
  39264. , n = 1 / le.setFromMatrixColumn(e, 0).length()
  39265. , r = 1 / le.setFromMatrixColumn(e, 1).length()
  39266. , o = 1 / le.setFromMatrixColumn(e, 2).length();
  39267. return t[0] = i[0] * n,
  39268. t[1] = i[1] * n,
  39269. t[2] = i[2] * n,
  39270. t[4] = i[4] * r,
  39271. t[5] = i[5] * r,
  39272. t[6] = i[6] * r,
  39273. t[8] = i[8] * o,
  39274. t[9] = i[9] * o,
  39275. t[10] = i[10] * o,
  39276. this
  39277. },
  39278. makeRotationFromEuler: function(e) {
  39279. e instanceof Ci.Euler == 0 && console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  39280. var t = this.elements
  39281. , i = e.x
  39282. , n = e.y
  39283. , r = e.z
  39284. , o = Math.cos(i)
  39285. , a = Math.sin(i)
  39286. , s = Math.cos(n)
  39287. , l = Math.sin(n)
  39288. , c = Math.cos(r)
  39289. , h = Math.sin(r);
  39290. if ("XYZ" === e.order) {
  39291. var u = o * c
  39292. , d = o * h
  39293. , p = a * c
  39294. , f = a * h;
  39295. t[0] = s * c,
  39296. t[4] = -s * h,
  39297. t[8] = l,
  39298. t[1] = d + p * l,
  39299. t[5] = u - f * l,
  39300. t[9] = -a * s,
  39301. t[2] = f - u * l,
  39302. t[6] = p + d * l,
  39303. t[10] = o * s
  39304. } else if ("YXZ" === e.order) {
  39305. var g = s * c
  39306. , m = s * h
  39307. , v = l * c
  39308. , y = l * h;
  39309. t[0] = g + y * a,
  39310. t[4] = v * a - m,
  39311. t[8] = o * l,
  39312. t[1] = o * h,
  39313. t[5] = o * c,
  39314. t[9] = -a,
  39315. t[2] = m * a - v,
  39316. t[6] = y + g * a,
  39317. t[10] = o * s
  39318. } else if ("ZXY" === e.order) {
  39319. g = s * c,
  39320. m = s * h,
  39321. v = l * c,
  39322. y = l * h;
  39323. t[0] = g - y * a,
  39324. t[4] = -o * h,
  39325. t[8] = v + m * a,
  39326. t[1] = m + v * a,
  39327. t[5] = o * c,
  39328. t[9] = y - g * a,
  39329. t[2] = -o * l,
  39330. t[6] = a,
  39331. t[10] = o * s
  39332. } else if ("ZYX" === e.order) {
  39333. u = o * c,
  39334. d = o * h,
  39335. p = a * c,
  39336. f = a * h;
  39337. t[0] = s * c,
  39338. t[4] = p * l - d,
  39339. t[8] = u * l + f,
  39340. t[1] = s * h,
  39341. t[5] = f * l + u,
  39342. t[9] = d * l - p,
  39343. t[2] = -l,
  39344. t[6] = a * s,
  39345. t[10] = o * s
  39346. } else if ("YZX" === e.order) {
  39347. var A = o * s
  39348. , C = o * l
  39349. , I = a * s
  39350. , E = a * l;
  39351. t[0] = s * c,
  39352. t[4] = E - A * h,
  39353. t[8] = I * h + C,
  39354. t[1] = h,
  39355. t[5] = o * c,
  39356. t[9] = -a * c,
  39357. t[2] = -l * c,
  39358. t[6] = C * h + I,
  39359. t[10] = A - E * h
  39360. } else if ("XZY" === e.order) {
  39361. A = o * s,
  39362. C = o * l,
  39363. I = a * s,
  39364. E = a * l;
  39365. t[0] = s * c,
  39366. t[4] = -h,
  39367. t[8] = l * c,
  39368. t[1] = A * h + E,
  39369. t[5] = o * c,
  39370. t[9] = C * h - I,
  39371. t[2] = I * h - C,
  39372. t[6] = a * c,
  39373. t[10] = E * h + A
  39374. }
  39375. return t[3] = 0,
  39376. t[7] = 0,
  39377. t[11] = 0,
  39378. t[12] = 0,
  39379. t[13] = 0,
  39380. t[14] = 0,
  39381. t[15] = 1,
  39382. this
  39383. },
  39384. makeRotationFromQuaternion: function(e) {
  39385. var t = this.elements
  39386. , i = e.x
  39387. , n = e.y
  39388. , r = e.z
  39389. , o = e.w
  39390. , a = i + i
  39391. , s = n + n
  39392. , l = r + r
  39393. , c = i * a
  39394. , h = i * s
  39395. , u = i * l
  39396. , d = n * s
  39397. , p = n * l
  39398. , f = r * l
  39399. , g = o * a
  39400. , m = o * s
  39401. , v = o * l;
  39402. return t[0] = 1 - (d + f),
  39403. t[4] = h - v,
  39404. t[8] = u + m,
  39405. t[1] = h + v,
  39406. t[5] = 1 - (c + f),
  39407. t[9] = p - g,
  39408. t[2] = u - m,
  39409. t[6] = p + g,
  39410. t[10] = 1 - (c + d),
  39411. t[3] = 0,
  39412. t[7] = 0,
  39413. t[11] = 0,
  39414. t[12] = 0,
  39415. t[13] = 0,
  39416. t[14] = 0,
  39417. t[15] = 1,
  39418. this
  39419. },
  39420. lookAt: function(e, t, i) {
  39421. void 0 === oe && (oe = new Ci.Vector3),
  39422. void 0 === ae && (ae = new Ci.Vector3),
  39423. void 0 === se && (se = new Ci.Vector3);
  39424. var n = this.elements;
  39425. return se.subVectors(e, t).normalize(),
  39426. 0 === se.lengthSq() && (se.z = 1),
  39427. oe.crossVectors(i, se).normalize(),
  39428. 0 === oe.lengthSq() && (se.x += 1e-4,
  39429. oe.crossVectors(i, se).normalize()),
  39430. ae.crossVectors(se, oe),
  39431. n[0] = oe.x,
  39432. n[4] = ae.x,
  39433. n[8] = se.x,
  39434. n[1] = oe.y,
  39435. n[5] = ae.y,
  39436. n[9] = se.y,
  39437. n[2] = oe.z,
  39438. n[6] = ae.z,
  39439. n[10] = se.z,
  39440. this
  39441. },
  39442. multiply: function(e, t) {
  39443. return void 0 !== t ? (console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),
  39444. this.multiplyMatrices(e, t)) : this.multiplyMatrices(this, e)
  39445. },
  39446. multiplyMatrices: function(e, t) {
  39447. var i = e.elements
  39448. , n = t.elements
  39449. , r = this.elements
  39450. , o = i[0]
  39451. , a = i[4]
  39452. , s = i[8]
  39453. , l = i[12]
  39454. , c = i[1]
  39455. , h = i[5]
  39456. , u = i[9]
  39457. , d = i[13]
  39458. , p = i[2]
  39459. , f = i[6]
  39460. , g = i[10]
  39461. , m = i[14]
  39462. , v = i[3]
  39463. , y = i[7]
  39464. , A = i[11]
  39465. , C = i[15]
  39466. , I = n[0]
  39467. , E = n[4]
  39468. , _ = n[8]
  39469. , b = n[12]
  39470. , w = n[1]
  39471. , T = n[5]
  39472. , x = n[9]
  39473. , S = n[13]
  39474. , M = n[2]
  39475. , R = n[6]
  39476. , P = n[10]
  39477. , O = n[14]
  39478. , L = n[3]
  39479. , D = n[7]
  39480. , N = n[11]
  39481. , F = n[15];
  39482. return r[0] = o * I + a * w + s * M + l * L,
  39483. r[4] = o * E + a * T + s * R + l * D,
  39484. r[8] = o * _ + a * x + s * P + l * N,
  39485. r[12] = o * b + a * S + s * O + l * F,
  39486. r[1] = c * I + h * w + u * M + d * L,
  39487. r[5] = c * E + h * T + u * R + d * D,
  39488. r[9] = c * _ + h * x + u * P + d * N,
  39489. r[13] = c * b + h * S + u * O + d * F,
  39490. r[2] = p * I + f * w + g * M + m * L,
  39491. r[6] = p * E + f * T + g * R + m * D,
  39492. r[10] = p * _ + f * x + g * P + m * N,
  39493. r[14] = p * b + f * S + g * O + m * F,
  39494. r[3] = v * I + y * w + A * M + C * L,
  39495. r[7] = v * E + y * T + A * R + C * D,
  39496. r[11] = v * _ + y * x + A * P + C * N,
  39497. r[15] = v * b + y * S + A * O + C * F,
  39498. this
  39499. },
  39500. multiplyToArray: function(e, t, i) {
  39501. var n = this.elements;
  39502. return this.multiplyMatrices(e, t),
  39503. i[0] = n[0],
  39504. i[1] = n[1],
  39505. i[2] = n[2],
  39506. i[3] = n[3],
  39507. i[4] = n[4],
  39508. i[5] = n[5],
  39509. i[6] = n[6],
  39510. i[7] = n[7],
  39511. i[8] = n[8],
  39512. i[9] = n[9],
  39513. i[10] = n[10],
  39514. i[11] = n[11],
  39515. i[12] = n[12],
  39516. i[13] = n[13],
  39517. i[14] = n[14],
  39518. i[15] = n[15],
  39519. this
  39520. },
  39521. multiplyScalar: function(e) {
  39522. var t = this.elements;
  39523. return t[0] *= e,
  39524. t[4] *= e,
  39525. t[8] *= e,
  39526. t[12] *= e,
  39527. t[1] *= e,
  39528. t[5] *= e,
  39529. t[9] *= e,
  39530. t[13] *= e,
  39531. t[2] *= e,
  39532. t[6] *= e,
  39533. t[10] *= e,
  39534. t[14] *= e,
  39535. t[3] *= e,
  39536. t[7] *= e,
  39537. t[11] *= e,
  39538. t[15] *= e,
  39539. this
  39540. },
  39541. applyToVector3Array: function(e, t, i) {
  39542. void 0 === re && (re = new Ci.Vector3),
  39543. void 0 === t && (t = 0),
  39544. void 0 === i && (i = e.length);
  39545. for (var n = 0, r = t; n < i; n += 3,
  39546. r += 3)
  39547. re.fromArray(e, r),
  39548. re.applyMatrix4(this),
  39549. re.toArray(e, r);
  39550. return e
  39551. },
  39552. applyToBuffer: function(e, t, i) {
  39553. void 0 === ne && (ne = new Ci.Vector3),
  39554. void 0 === t && (t = 0),
  39555. void 0 === i && (i = e.length / e.itemSize);
  39556. for (var n = 0, r = t; n < i; n++,
  39557. r++)
  39558. ne.x = e.getX(r),
  39559. ne.y = e.getY(r),
  39560. ne.z = e.getZ(r),
  39561. ne.applyMatrix4(this),
  39562. e.setXYZ(ne.x, ne.y, ne.z);
  39563. return e
  39564. },
  39565. determinant: function() {
  39566. var e = this.elements
  39567. , t = e[0]
  39568. , i = e[4]
  39569. , n = e[8]
  39570. , r = e[12]
  39571. , o = e[1]
  39572. , a = e[5]
  39573. , s = e[9]
  39574. , l = e[13]
  39575. , c = e[2]
  39576. , h = e[6]
  39577. , u = e[10]
  39578. , d = e[14];
  39579. 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)
  39580. },
  39581. transpose: function() {
  39582. var e, t = this.elements;
  39583. return e = t[1],
  39584. t[1] = t[4],
  39585. t[4] = e,
  39586. e = t[2],
  39587. t[2] = t[8],
  39588. t[8] = e,
  39589. e = t[6],
  39590. t[6] = t[9],
  39591. t[9] = e,
  39592. e = t[3],
  39593. t[3] = t[12],
  39594. t[12] = e,
  39595. e = t[7],
  39596. t[7] = t[13],
  39597. t[13] = e,
  39598. e = t[11],
  39599. t[11] = t[14],
  39600. t[14] = e,
  39601. this
  39602. },
  39603. flattenToArrayOffset: function(e, t) {
  39604. var i = this.elements;
  39605. return e[t] = i[0],
  39606. e[t + 1] = i[1],
  39607. e[t + 2] = i[2],
  39608. e[t + 3] = i[3],
  39609. e[t + 4] = i[4],
  39610. e[t + 5] = i[5],
  39611. e[t + 6] = i[6],
  39612. e[t + 7] = i[7],
  39613. e[t + 8] = i[8],
  39614. e[t + 9] = i[9],
  39615. e[t + 10] = i[10],
  39616. e[t + 11] = i[11],
  39617. e[t + 12] = i[12],
  39618. e[t + 13] = i[13],
  39619. e[t + 14] = i[14],
  39620. e[t + 15] = i[15],
  39621. e
  39622. },
  39623. getPosition: function() {
  39624. return void 0 === ie && (ie = new Ci.Vector3),
  39625. console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),
  39626. ie.setFromMatrixColumn(this, 3)
  39627. },
  39628. setPosition: function(e) {
  39629. var t = this.elements;
  39630. return t[12] = e.x,
  39631. t[13] = e.y,
  39632. t[14] = e.z,
  39633. this
  39634. },
  39635. getInverse: function(e, t) {
  39636. var i = this.elements
  39637. , n = e.elements
  39638. , r = n[0]
  39639. , o = n[1]
  39640. , a = n[2]
  39641. , s = n[3]
  39642. , l = n[4]
  39643. , c = n[5]
  39644. , h = n[6]
  39645. , u = n[7]
  39646. , d = n[8]
  39647. , p = n[9]
  39648. , f = n[10]
  39649. , g = n[11]
  39650. , m = n[12]
  39651. , v = n[13]
  39652. , y = n[14]
  39653. , A = n[15]
  39654. , C = p * y * u - v * f * u + v * h * g - c * y * g - p * h * A + c * f * A
  39655. , I = m * f * u - d * y * u - m * h * g + l * y * g + d * h * A - l * f * A
  39656. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * A + l * p * A
  39657. , _ = m * p * h - d * v * h - m * c * f + l * v * f + d * c * y - l * p * y
  39658. , b = r * C + o * I + a * E + s * _;
  39659. if (0 != b)
  39660. return i[0] = C,
  39661. i[1] = v * f * s - p * y * s - v * a * g + o * y * g + p * a * A - o * f * A,
  39662. i[2] = c * y * s - v * h * s + v * a * u - o * y * u - c * a * A + o * h * A,
  39663. i[3] = p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g,
  39664. i[4] = I,
  39665. i[5] = d * y * s - m * f * s + m * a * g - r * y * g - d * a * A + r * f * A,
  39666. i[6] = m * h * s - l * y * s - m * a * u + r * y * u + l * a * A - r * h * A,
  39667. i[7] = l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g,
  39668. i[8] = E,
  39669. i[9] = m * p * s - d * v * s - m * o * g + r * v * g + d * o * A - r * p * A,
  39670. i[10] = l * v * s - m * c * s + m * o * u - r * v * u - l * o * A + r * c * A,
  39671. i[11] = d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g,
  39672. i[12] = _,
  39673. i[13] = d * v * a - m * p * a + m * o * f - r * v * f - d * o * y + r * p * y,
  39674. i[14] = m * c * a - l * v * a - m * o * h + r * v * h + l * o * y - r * c * y,
  39675. i[15] = l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f,
  39676. this.multiplyScalar(1 / b);
  39677. var w = "THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  39678. if (t)
  39679. throw new Error(w);
  39680. return console.warn(w),
  39681. this.identity()
  39682. },
  39683. scale: function(e) {
  39684. var t = this.elements
  39685. , i = e.x
  39686. , n = e.y
  39687. , r = e.z;
  39688. return t[0] *= i,
  39689. t[4] *= n,
  39690. t[8] *= r,
  39691. t[1] *= i,
  39692. t[5] *= n,
  39693. t[9] *= r,
  39694. t[2] *= i,
  39695. t[6] *= n,
  39696. t[10] *= r,
  39697. t[3] *= i,
  39698. t[7] *= n,
  39699. t[11] *= r,
  39700. this
  39701. },
  39702. getMaxScaleOnAxis: function() {
  39703. var e = this.elements
  39704. , t = e[0] * e[0] + e[1] * e[1] + e[2] * e[2]
  39705. , i = e[4] * e[4] + e[5] * e[5] + e[6] * e[6]
  39706. , n = e[8] * e[8] + e[9] * e[9] + e[10] * e[10];
  39707. return Math.sqrt(Math.max(t, i, n))
  39708. },
  39709. makeTranslation: function(e, t, i) {
  39710. return this.set(1, 0, 0, e, 0, 1, 0, t, 0, 0, 1, i, 0, 0, 0, 1),
  39711. this
  39712. },
  39713. makeRotationX: function(e) {
  39714. var t = Math.cos(e)
  39715. , i = Math.sin(e);
  39716. return this.set(1, 0, 0, 0, 0, t, -i, 0, 0, i, t, 0, 0, 0, 0, 1),
  39717. this
  39718. },
  39719. makeRotationY: function(e) {
  39720. var t = Math.cos(e)
  39721. , i = Math.sin(e);
  39722. return this.set(t, 0, i, 0, 0, 1, 0, 0, -i, 0, t, 0, 0, 0, 0, 1),
  39723. this
  39724. },
  39725. makeRotationZ: function(e) {
  39726. var t = Math.cos(e)
  39727. , i = Math.sin(e);
  39728. return this.set(t, -i, 0, 0, i, t, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  39729. this
  39730. },
  39731. makeRotationAxis: function(e, t) {
  39732. var i = Math.cos(t)
  39733. , n = Math.sin(t)
  39734. , r = 1 - i
  39735. , o = e.x
  39736. , a = e.y
  39737. , s = e.z
  39738. , l = r * o
  39739. , c = r * a;
  39740. 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),
  39741. this
  39742. },
  39743. makeScale: function(e, t, i) {
  39744. return this.set(e, 0, 0, 0, 0, t, 0, 0, 0, 0, i, 0, 0, 0, 0, 1),
  39745. this
  39746. },
  39747. compose: function(e, t, i) {
  39748. return this.makeRotationFromQuaternion(t),
  39749. this.scale(i),
  39750. this.setPosition(e),
  39751. this
  39752. },
  39753. decompose: function(e, t, i) {
  39754. void 0 === ee && (ee = new Ci.Vector3),
  39755. void 0 === te && (te = new Ci.Matrix4);
  39756. var n = this.elements
  39757. , r = ee.set(n[0], n[1], n[2]).length()
  39758. , o = ee.set(n[4], n[5], n[6]).length()
  39759. , a = ee.set(n[8], n[9], n[10]).length();
  39760. this.determinant() < 0 && (r = -r),
  39761. e.x = n[12],
  39762. e.y = n[13],
  39763. e.z = n[14],
  39764. te.elements.set(this.elements);
  39765. var s = 1 / r
  39766. , l = 1 / o
  39767. , c = 1 / a;
  39768. return te.elements[0] *= s,
  39769. te.elements[1] *= s,
  39770. te.elements[2] *= s,
  39771. te.elements[4] *= l,
  39772. te.elements[5] *= l,
  39773. te.elements[6] *= l,
  39774. te.elements[8] *= c,
  39775. te.elements[9] *= c,
  39776. te.elements[10] *= c,
  39777. t.setFromRotationMatrix(te),
  39778. i.x = r,
  39779. i.y = o,
  39780. i.z = a,
  39781. this
  39782. },
  39783. makeFrustum: function(e, t, i, n, r, o) {
  39784. var a = this.elements
  39785. , s = 2 * r / (t - e)
  39786. , l = 2 * r / (n - i)
  39787. , c = (t + e) / (t - e)
  39788. , h = (n + i) / (n - i)
  39789. , u = -(o + r) / (o - r)
  39790. , d = -2 * o * r / (o - r);
  39791. return a[0] = s,
  39792. a[4] = 0,
  39793. a[8] = c,
  39794. a[12] = 0,
  39795. a[1] = 0,
  39796. a[5] = l,
  39797. a[9] = h,
  39798. a[13] = 0,
  39799. a[2] = 0,
  39800. a[6] = 0,
  39801. a[10] = u,
  39802. a[14] = d,
  39803. a[3] = 0,
  39804. a[7] = 0,
  39805. a[11] = -1,
  39806. a[15] = 0,
  39807. this
  39808. },
  39809. makePerspective: function(e, t, i, n) {
  39810. var r = i * Math.tan(Ci.Math.degToRad(.5 * e))
  39811. , o = -r
  39812. , a = o * t
  39813. , s = r * t;
  39814. return this.makeFrustum(a, s, o, r, i, n)
  39815. },
  39816. makeOrthographic: function(e, t, i, n, r, o) {
  39817. var a = this.elements
  39818. , s = 1 / (t - e)
  39819. , l = 1 / (i - n)
  39820. , c = 1 / (o - r)
  39821. , h = (t + e) * s
  39822. , u = (i + n) * l
  39823. , d = (o + r) * c;
  39824. return a[0] = 2 * s,
  39825. a[4] = 0,
  39826. a[8] = 0,
  39827. a[12] = -h,
  39828. a[1] = 0,
  39829. a[5] = 2 * l,
  39830. a[9] = 0,
  39831. a[13] = -u,
  39832. a[2] = 0,
  39833. a[6] = 0,
  39834. a[10] = -2 * c,
  39835. a[14] = -d,
  39836. a[3] = 0,
  39837. a[7] = 0,
  39838. a[11] = 0,
  39839. a[15] = 1,
  39840. this
  39841. },
  39842. equals: function(e) {
  39843. for (var t = this.elements, i = e.elements, n = 0; n < 16; n++)
  39844. if (t[n] !== i[n])
  39845. return !1;
  39846. return !0
  39847. },
  39848. fromArray: function(e) {
  39849. return this.elements.set(e),
  39850. this
  39851. },
  39852. toArray: function() {
  39853. var e = this.elements;
  39854. 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]]
  39855. }
  39856. },
  39857. Ci.Ray = function(e, t) {
  39858. this.origin = void 0 !== e ? e : new Ci.Vector3,
  39859. this.direction = void 0 !== t ? t : new Ci.Vector3
  39860. }
  39861. ,
  39862. Ci.Ray.prototype = {
  39863. constructor: Ci.Ray,
  39864. set: function(e, t) {
  39865. return this.origin.copy(e),
  39866. this.direction.copy(t),
  39867. this
  39868. },
  39869. clone: function() {
  39870. return (new this.constructor).copy(this)
  39871. },
  39872. copy: function(e) {
  39873. return this.origin.copy(e.origin),
  39874. this.direction.copy(e.direction),
  39875. this
  39876. },
  39877. at: function(e, t) {
  39878. return (t || new Ci.Vector3).copy(this.direction).multiplyScalar(e).add(this.origin)
  39879. },
  39880. lookAt: function(e) {
  39881. this.direction.copy(e).sub(this.origin).normalize()
  39882. },
  39883. recast: ($ = new Ci.Vector3,
  39884. function(e) {
  39885. return this.origin.copy(this.at(e, $)),
  39886. this
  39887. }
  39888. ),
  39889. closestPointToPoint: function(e, t) {
  39890. var i = t || new Ci.Vector3;
  39891. i.subVectors(e, this.origin);
  39892. var n = i.dot(this.direction);
  39893. return n < 0 ? i.copy(this.origin) : i.copy(this.direction).multiplyScalar(n).add(this.origin)
  39894. },
  39895. distanceToPoint: function(e) {
  39896. return Math.sqrt(this.distanceSqToPoint(e))
  39897. },
  39898. distanceSqToPoint: (J = new Ci.Vector3,
  39899. function(e) {
  39900. var t = J.subVectors(e, this.origin).dot(this.direction);
  39901. return t < 0 ? this.origin.distanceToSquared(e) : (J.copy(this.direction).multiplyScalar(t).add(this.origin),
  39902. J.distanceToSquared(e))
  39903. }
  39904. ),
  39905. distanceSqToSegment: (Z = new Ci.Vector3,
  39906. K = new Ci.Vector3,
  39907. Q = new Ci.Vector3,
  39908. function(e, t, i, n) {
  39909. Z.copy(e).add(t).multiplyScalar(.5),
  39910. K.copy(t).sub(e).normalize(),
  39911. Q.copy(this.origin).sub(Z);
  39912. 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);
  39913. if (0 < p)
  39914. if (o = c * h - u,
  39915. s = l * p,
  39916. 0 <= (r = c * u - h))
  39917. if (-s <= o)
  39918. if (o <= s) {
  39919. var f = 1 / p;
  39920. a = (r *= f) * (r + c * (o *= f) + 2 * h) + o * (c * r + o + 2 * u) + d
  39921. } else
  39922. o = l,
  39923. a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
  39924. else
  39925. o = -l,
  39926. a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
  39927. else
  39928. 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,
  39929. (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;
  39930. else
  39931. o = 0 < c ? -l : l,
  39932. a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
  39933. return i && i.copy(this.direction).multiplyScalar(r).add(this.origin),
  39934. n && n.copy(K).multiplyScalar(o).add(Z),
  39935. a
  39936. }
  39937. ),
  39938. intersectSphere: (X = new Ci.Vector3,
  39939. function(e, t) {
  39940. X.subVectors(e.center, this.origin);
  39941. var i = X.dot(this.direction)
  39942. , n = X.dot(X) - i * i
  39943. , r = e.radius * e.radius;
  39944. if (r < n)
  39945. return null;
  39946. var o = Math.sqrt(r - n)
  39947. , a = i - o
  39948. , s = i + o;
  39949. return a < 0 && s < 0 ? null : a < 0 ? this.at(s, t) : this.at(a, t)
  39950. }
  39951. ),
  39952. intersectsSphere: function(e) {
  39953. return this.distanceToPoint(e.center) <= e.radius
  39954. },
  39955. distanceToPlane: function(e) {
  39956. var t = e.normal.dot(this.direction);
  39957. if (0 === t)
  39958. return 0 === e.distanceToPoint(this.origin) ? 0 : null;
  39959. var i = -(this.origin.dot(e.normal) + e.constant) / t;
  39960. return 0 <= i ? i : null
  39961. },
  39962. intersectPlane: function(e, t) {
  39963. var i = this.distanceToPlane(e);
  39964. return null === i ? null : this.at(i, t)
  39965. },
  39966. intersectsPlane: function(e) {
  39967. var t = e.distanceToPoint(this.origin);
  39968. return 0 === t || e.normal.dot(this.direction) * t < 0
  39969. },
  39970. intersectBox: function(e, t) {
  39971. 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;
  39972. return n = 0 <= l ? (i = (e.min.x - u.x) * l,
  39973. (e.max.x - u.x) * l) : (i = (e.max.x - u.x) * l,
  39974. (e.min.x - u.x) * l),
  39975. (o = 0 <= c ? (r = (e.min.y - u.y) * c,
  39976. (e.max.y - u.y) * c) : (r = (e.max.y - u.y) * c,
  39977. (e.min.y - u.y) * c)) < i || n < r ? null : ((i < r || i != i) && (i = r),
  39978. (o < n || n != n) && (n = o),
  39979. (s = 0 <= h ? (a = (e.min.z - u.z) * h,
  39980. (e.max.z - u.z) * h) : (a = (e.max.z - u.z) * h,
  39981. (e.min.z - u.z) * h)) < i || n < a ? null : ((i < a || i != i) && (i = a),
  39982. (s < n || n != n) && (n = s),
  39983. n < 0 ? null : this.at(0 <= i ? i : n, t)))
  39984. },
  39985. intersectsBox: (q = new Ci.Vector3,
  39986. function(e) {
  39987. return null !== this.intersectBox(e, q)
  39988. }
  39989. ),
  39990. intersectTriangle: (G = new Ci.Vector3,
  39991. W = new Ci.Vector3,
  39992. j = new Ci.Vector3,
  39993. Y = new Ci.Vector3,
  39994. function(e, t, i, n, r) {
  39995. W.subVectors(t, e),
  39996. j.subVectors(i, e),
  39997. Y.crossVectors(W, j);
  39998. var o, a = this.direction.dot(Y);
  39999. if (0 < a) {
  40000. if (n)
  40001. return null;
  40002. o = 1
  40003. } else {
  40004. if (!(a < 0))
  40005. return null;
  40006. o = -1,
  40007. a = -a
  40008. }
  40009. G.subVectors(this.origin, e);
  40010. var s = o * this.direction.dot(j.crossVectors(G, j));
  40011. if (s < 0)
  40012. return null;
  40013. var l = o * this.direction.dot(W.cross(G));
  40014. if (l < 0)
  40015. return null;
  40016. if (a < s + l)
  40017. return null;
  40018. var c = -o * G.dot(Y);
  40019. return c < 0 ? null : this.at(c / a, r)
  40020. }
  40021. ),
  40022. applyMatrix4: function(e) {
  40023. return this.direction.add(this.origin).applyMatrix4(e),
  40024. this.origin.applyMatrix4(e),
  40025. this.direction.sub(this.origin),
  40026. this.direction.normalize(),
  40027. this
  40028. },
  40029. equals: function(e) {
  40030. return e.origin.equals(this.origin) && e.direction.equals(this.direction)
  40031. }
  40032. },
  40033. Ci.Sphere = function(e, t) {
  40034. this.center = void 0 !== e ? e : new Ci.Vector3,
  40035. this.radius = void 0 !== t ? t : 0
  40036. }
  40037. ,
  40038. Ci.Sphere.prototype = {
  40039. constructor: Ci.Sphere,
  40040. set: function(e, t) {
  40041. return this.center.copy(e),
  40042. this.radius = t,
  40043. this
  40044. },
  40045. setFromPoints: (z = new Ci.Box3,
  40046. function(e, t) {
  40047. var i = this.center;
  40048. void 0 !== t ? i.copy(t) : z.setFromPoints(e).center(i);
  40049. for (var n = 0, r = 0, o = e.length; r < o; r++)
  40050. n = Math.max(n, i.distanceToSquared(e[r]));
  40051. return this.radius = Math.sqrt(n),
  40052. this
  40053. }
  40054. ),
  40055. clone: function() {
  40056. return (new this.constructor).copy(this)
  40057. },
  40058. copy: function(e) {
  40059. return this.center.copy(e.center),
  40060. this.radius = e.radius,
  40061. this
  40062. },
  40063. empty: function() {
  40064. return this.radius <= 0
  40065. },
  40066. containsPoint: function(e) {
  40067. return e.distanceToSquared(this.center) <= this.radius * this.radius
  40068. },
  40069. distanceToPoint: function(e) {
  40070. return e.distanceTo(this.center) - this.radius
  40071. },
  40072. intersectsSphere: function(e) {
  40073. var t = this.radius + e.radius;
  40074. return e.center.distanceToSquared(this.center) <= t * t
  40075. },
  40076. intersectsBox: function(e) {
  40077. return e.intersectsSphere(this)
  40078. },
  40079. intersectsPlane: function(e) {
  40080. return Math.abs(this.center.dot(e.normal) - e.constant) <= this.radius
  40081. },
  40082. clampPoint: function(e, t) {
  40083. var i = this.center.distanceToSquared(e)
  40084. , n = t || new Ci.Vector3;
  40085. return n.copy(e),
  40086. i > this.radius * this.radius && (n.sub(this.center).normalize(),
  40087. n.multiplyScalar(this.radius).add(this.center)),
  40088. n
  40089. },
  40090. getBoundingBox: function(e) {
  40091. var t = e || new Ci.Box3;
  40092. return t.set(this.center, this.center),
  40093. t.expandByScalar(this.radius),
  40094. t
  40095. },
  40096. applyMatrix4: function(e) {
  40097. return this.center.applyMatrix4(e),
  40098. this.radius = this.radius * e.getMaxScaleOnAxis(),
  40099. this
  40100. },
  40101. translate: function(e) {
  40102. return this.center.add(e),
  40103. this
  40104. },
  40105. equals: function(e) {
  40106. return e.center.equals(this.center) && e.radius === this.radius
  40107. }
  40108. },
  40109. Ci.Frustum = function(e, t, i, n, r, o) {
  40110. 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]
  40111. }
  40112. ,
  40113. Ci.Frustum.prototype = {
  40114. constructor: Ci.Frustum,
  40115. set: function(e, t, i, n, r, o) {
  40116. var a = this.planes;
  40117. return a[0].copy(e),
  40118. a[1].copy(t),
  40119. a[2].copy(i),
  40120. a[3].copy(n),
  40121. a[4].copy(r),
  40122. a[5].copy(o),
  40123. this
  40124. },
  40125. clone: function() {
  40126. return (new this.constructor).copy(this)
  40127. },
  40128. copy: function(e) {
  40129. for (var t = this.planes, i = 0; i < 6; i++)
  40130. t[i].copy(e.planes[i]);
  40131. return this
  40132. },
  40133. setFromMatrix: function(e) {
  40134. var t = this.planes
  40135. , i = e.elements
  40136. , n = i[0]
  40137. , r = i[1]
  40138. , o = i[2]
  40139. , a = i[3]
  40140. , s = i[4]
  40141. , l = i[5]
  40142. , c = i[6]
  40143. , h = i[7]
  40144. , u = i[8]
  40145. , d = i[9]
  40146. , p = i[10]
  40147. , f = i[11]
  40148. , g = i[12]
  40149. , m = i[13]
  40150. , v = i[14]
  40151. , y = i[15];
  40152. return t[0].setComponents(a - n, h - s, f - u, y - g).normalize(),
  40153. t[1].setComponents(a + n, h + s, f + u, y + g).normalize(),
  40154. t[2].setComponents(a + r, h + l, f + d, y + m).normalize(),
  40155. t[3].setComponents(a - r, h - l, f - d, y - m).normalize(),
  40156. t[4].setComponents(a - o, h - c, f - p, y - v).normalize(),
  40157. t[5].setComponents(a + o, h + c, f + p, y + v).normalize(),
  40158. this
  40159. },
  40160. intersectsObject: (H = new Ci.Sphere,
  40161. function(e) {
  40162. var t = e.geometry;
  40163. return null === t.boundingSphere && t.computeBoundingSphere(),
  40164. H.copy(t.boundingSphere),
  40165. H.applyMatrix4(e.matrixWorld),
  40166. this.intersectsSphere(H)
  40167. }
  40168. ),
  40169. intersectsSphere: function(e) {
  40170. for (var t = this.planes, i = e.center, n = -e.radius, r = 0; r < 6; r++) {
  40171. if (t[r].distanceToPoint(i) < n)
  40172. return !1
  40173. }
  40174. return !0
  40175. },
  40176. intersectsBox: (k = new Ci.Vector3,
  40177. U = new Ci.Vector3,
  40178. function(e) {
  40179. for (var t = this.planes, i = 0; i < 6; i++) {
  40180. var n = t[i];
  40181. k.x = 0 < n.normal.x ? e.min.x : e.max.x,
  40182. U.x = 0 < n.normal.x ? e.max.x : e.min.x,
  40183. k.y = 0 < n.normal.y ? e.min.y : e.max.y,
  40184. U.y = 0 < n.normal.y ? e.max.y : e.min.y,
  40185. k.z = 0 < n.normal.z ? e.min.z : e.max.z,
  40186. U.z = 0 < n.normal.z ? e.max.z : e.min.z;
  40187. var r = n.distanceToPoint(k)
  40188. , o = n.distanceToPoint(U);
  40189. if (r < 0 && o < 0)
  40190. return !1
  40191. }
  40192. return !0
  40193. }
  40194. ),
  40195. containsPoint: function(e) {
  40196. for (var t = this.planes, i = 0; i < 6; i++)
  40197. if (t[i].distanceToPoint(e) < 0)
  40198. return !1;
  40199. return !0
  40200. }
  40201. },
  40202. Ci.Plane = function(e, t) {
  40203. this.normal = void 0 !== e ? e : new Ci.Vector3(1,0,0),
  40204. this.constant = void 0 !== t ? t : 0
  40205. }
  40206. ,
  40207. Ci.Plane.prototype = {
  40208. constructor: Ci.Plane,
  40209. set: function(e, t) {
  40210. return this.normal.copy(e),
  40211. this.constant = t,
  40212. this
  40213. },
  40214. setComponents: function(e, t, i, n) {
  40215. return this.normal.set(e, t, i),
  40216. this.constant = n,
  40217. this
  40218. },
  40219. setFromNormalAndCoplanarPoint: function(e, t) {
  40220. return this.normal.copy(e),
  40221. this.constant = -t.dot(this.normal),
  40222. this
  40223. },
  40224. setFromCoplanarPoints: (B = new Ci.Vector3,
  40225. V = new Ci.Vector3,
  40226. function(e, t, i) {
  40227. var n = B.subVectors(i, t).cross(V.subVectors(e, t)).normalize();
  40228. return this.setFromNormalAndCoplanarPoint(n, e),
  40229. this
  40230. }
  40231. ),
  40232. clone: function() {
  40233. return (new this.constructor).copy(this)
  40234. },
  40235. copy: function(e) {
  40236. return this.normal.copy(e.normal),
  40237. this.constant = e.constant,
  40238. this
  40239. },
  40240. normalize: function() {
  40241. var e = 1 / this.normal.length();
  40242. return this.normal.multiplyScalar(e),
  40243. this.constant *= e,
  40244. this
  40245. },
  40246. negate: function() {
  40247. return this.constant *= -1,
  40248. this.normal.negate(),
  40249. this
  40250. },
  40251. distanceToPoint: function(e) {
  40252. return this.normal.dot(e) + this.constant
  40253. },
  40254. distanceToSphere: function(e) {
  40255. return this.distanceToPoint(e.center) - e.radius
  40256. },
  40257. projectPoint: function(e, t) {
  40258. return this.orthoPoint(e, t).sub(e).negate()
  40259. },
  40260. orthoPoint: function(e, t) {
  40261. var i = this.distanceToPoint(e);
  40262. return (t || new Ci.Vector3).copy(this.normal).multiplyScalar(i)
  40263. },
  40264. intersectLine: (F = new Ci.Vector3,
  40265. function(e, t) {
  40266. var i = t || new Ci.Vector3
  40267. , n = e.delta(F)
  40268. , r = this.normal.dot(n);
  40269. if (0 !== r) {
  40270. var o = -(e.start.dot(this.normal) + this.constant) / r;
  40271. if (!(o < 0 || 1 < o))
  40272. return i.copy(n).multiplyScalar(o).add(e.start)
  40273. } else if (0 === this.distanceToPoint(e.start))
  40274. return i.copy(e.start)
  40275. }
  40276. ),
  40277. intersectsLine: function(e) {
  40278. var t = this.distanceToPoint(e.start)
  40279. , i = this.distanceToPoint(e.end);
  40280. return t < 0 && 0 < i || i < 0 && 0 < t
  40281. },
  40282. intersectsBox: function(e) {
  40283. return e.intersectsPlane(this)
  40284. },
  40285. intersectsSphere: function(e) {
  40286. return e.intersectsPlane(this)
  40287. },
  40288. coplanarPoint: function(e) {
  40289. return (e || new Ci.Vector3).copy(this.normal).multiplyScalar(-this.constant)
  40290. },
  40291. applyMatrix4: (L = new Ci.Vector3,
  40292. D = new Ci.Vector3,
  40293. N = new Ci.Matrix3,
  40294. function(e, t) {
  40295. var i = t || N.getNormalMatrix(e)
  40296. , n = L.copy(this.normal).applyMatrix3(i)
  40297. , r = this.coplanarPoint(D);
  40298. return r.applyMatrix4(e),
  40299. this.setFromNormalAndCoplanarPoint(n, r),
  40300. this
  40301. }
  40302. ),
  40303. translate: function(e) {
  40304. return this.constant = this.constant - e.dot(this.normal),
  40305. this
  40306. },
  40307. equals: function(e) {
  40308. return e.normal.equals(this.normal) && e.constant === this.constant
  40309. }
  40310. },
  40311. Ci.Spherical = function(e, t, i) {
  40312. return this.radius = void 0 !== e ? e : 1,
  40313. this.phi = void 0 !== t ? t : 0,
  40314. this.theta = void 0 !== i ? i : 0,
  40315. this
  40316. }
  40317. ,
  40318. Ci.Spherical.prototype = {
  40319. constructor: Ci.Spherical,
  40320. set: function(e, t, i) {
  40321. this.radius = e,
  40322. this.phi = t,
  40323. this.theta = i
  40324. },
  40325. clone: function() {
  40326. return (new this.constructor).copy(this)
  40327. },
  40328. copy: function(e) {
  40329. return this.radius.copy(e.radius),
  40330. this.phi.copy(e.phi),
  40331. this.theta.copy(e.theta),
  40332. this
  40333. },
  40334. makeSafe: function() {
  40335. this.phi = Math.max(1e-6, Math.min(Math.PI - 1e-6, this.phi))
  40336. },
  40337. setFromVector3: function(e) {
  40338. return this.radius = e.length(),
  40339. 0 === this.radius ? (this.theta = 0,
  40340. this.phi = 0) : (this.theta = Math.atan2(e.x, e.z),
  40341. this.phi = Math.acos(Ci.Math.clamp(e.y / this.radius, -1, 1))),
  40342. this
  40343. }
  40344. },
  40345. Ci.Math = {
  40346. generateUUID: (R = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),
  40347. P = new Array(36),
  40348. O = 0,
  40349. function() {
  40350. for (var e = 0; e < 36; e++)
  40351. 8 === e || 13 === e || 18 === e || 23 === e ? P[e] = "-" : 14 === e ? P[e] = "4" : (O <= 2 && (O = 33554432 + 16777216 * Math.random() | 0),
  40352. M = 15 & O,
  40353. O >>= 4,
  40354. P[e] = R[19 === e ? 3 & M | 8 : M]);
  40355. return P.join("")
  40356. }
  40357. ),
  40358. clamp: function(e, t, i) {
  40359. return Math.max(t, Math.min(i, e))
  40360. },
  40361. euclideanModulo: function(e, t) {
  40362. return (e % t + t) % t
  40363. },
  40364. mapLinear: function(e, t, i, n, r) {
  40365. return n + (e - t) * (r - n) / (i - t)
  40366. },
  40367. smoothstep: function(e, t, i) {
  40368. return e <= t ? 0 : i <= e ? 1 : (e = (e - t) / (i - t)) * e * (3 - 2 * e)
  40369. },
  40370. smootherstep: function(e, t, i) {
  40371. return e <= t ? 0 : i <= e ? 1 : (e = (e - t) / (i - t)) * e * e * (e * (6 * e - 15) + 10)
  40372. },
  40373. random16: function() {
  40374. return console.warn("THREE.Math.random16() has been deprecated. Use Math.random() instead."),
  40375. Math.random()
  40376. },
  40377. randInt: function(e, t) {
  40378. return e + Math.floor(Math.random() * (t - e + 1))
  40379. },
  40380. randFloat: function(e, t) {
  40381. return e + Math.random() * (t - e)
  40382. },
  40383. randFloatSpread: function(e) {
  40384. return e * (.5 - Math.random())
  40385. },
  40386. degToRad: (S = Math.PI / 180,
  40387. function(e) {
  40388. return e * S
  40389. }
  40390. ),
  40391. radToDeg: (x = 180 / Math.PI,
  40392. function(e) {
  40393. return e * x
  40394. }
  40395. ),
  40396. isPowerOfTwo: function(e) {
  40397. return 0 == (e & e - 1) && 0 !== e
  40398. },
  40399. nearestPowerOfTwo: function(e) {
  40400. return Math.pow(2, Math.round(Math.log(e) / Math.LN2))
  40401. },
  40402. nextPowerOfTwo: function(e) {
  40403. return e--,
  40404. e |= e >> 1,
  40405. e |= e >> 2,
  40406. e |= e >> 4,
  40407. e |= e >> 8,
  40408. e |= e >> 16,
  40409. ++e
  40410. }
  40411. },
  40412. Ci.Spline = function(e) {
  40413. function t(e, t, i, n, r, o, a) {
  40414. var s = .5 * (i - e)
  40415. , l = .5 * (n - t);
  40416. return (2 * (t - i) + s + l) * a + (-3 * (t - i) - 2 * s - l) * o + s * r + t
  40417. }
  40418. this.points = e;
  40419. var i, n, r, o, a, s, l, c, h, u = [], d = {
  40420. x: 0,
  40421. y: 0,
  40422. z: 0
  40423. };
  40424. this.initFromArray = function(e) {
  40425. this.points = [];
  40426. for (var t = 0; t < e.length; t++)
  40427. this.points[t] = {
  40428. x: e[t][0],
  40429. y: e[t][1],
  40430. z: e[t][2]
  40431. }
  40432. }
  40433. ,
  40434. this.getPoint = function(e) {
  40435. return i = (this.points.length - 1) * e,
  40436. n = Math.floor(i),
  40437. r = i - n,
  40438. u[0] = 0 === n ? n : n - 1,
  40439. u[1] = n,
  40440. u[2] = n > this.points.length - 2 ? this.points.length - 1 : n + 1,
  40441. u[3] = n > this.points.length - 3 ? this.points.length - 1 : n + 2,
  40442. s = this.points[u[0]],
  40443. l = this.points[u[1]],
  40444. c = this.points[u[2]],
  40445. h = this.points[u[3]],
  40446. a = r * (o = r * r),
  40447. d.x = t(s.x, l.x, c.x, h.x, r, o, a),
  40448. d.y = t(s.y, l.y, c.y, h.y, r, o, a),
  40449. d.z = t(s.z, l.z, c.z, h.z, r, o, a),
  40450. d
  40451. }
  40452. ,
  40453. this.getControlPointsArray = function() {
  40454. var e, t, i = this.points.length, n = [];
  40455. for (e = 0; e < i; e++)
  40456. t = this.points[e],
  40457. n[e] = [t.x, t.y, t.z];
  40458. return n
  40459. }
  40460. ,
  40461. this.getLength = function(e) {
  40462. var t, i, n, r, o = 0, a = 0, s = 0, l = new Ci.Vector3, c = new Ci.Vector3, h = [], u = 0;
  40463. for (h[0] = 0,
  40464. e = e || 100,
  40465. n = this.points.length * e,
  40466. l.copy(this.points[0]),
  40467. t = 1; t < n; t++)
  40468. i = t / n,
  40469. r = this.getPoint(i),
  40470. c.copy(r),
  40471. u += c.distanceTo(l),
  40472. l.copy(r),
  40473. o = (this.points.length - 1) * i,
  40474. (a = Math.floor(o)) !== s && (h[a] = u,
  40475. s = a);
  40476. return h[h.length] = u,
  40477. {
  40478. chunks: h,
  40479. total: u
  40480. }
  40481. }
  40482. ,
  40483. this.reparametrizeByArcLength = function(e) {
  40484. var t, i, n, r, o, a, s, l, c = [], h = new Ci.Vector3, u = this.getLength();
  40485. for (c.push(h.copy(this.points[0]).clone()),
  40486. t = 1; t < this.points.length; t++) {
  40487. for (a = u.chunks[t] - u.chunks[t - 1],
  40488. s = Math.ceil(e * a / u.total),
  40489. r = (t - 1) / (this.points.length - 1),
  40490. o = t / (this.points.length - 1),
  40491. i = 1; i < s - 1; i++)
  40492. n = r + i * (1 / s) * (o - r),
  40493. l = this.getPoint(n),
  40494. c.push(h.copy(l).clone());
  40495. c.push(h.copy(this.points[t]).clone())
  40496. }
  40497. this.points = c
  40498. }
  40499. }
  40500. ,
  40501. Ci.Triangle = function(e, t, i) {
  40502. this.a = void 0 !== e ? e : new Ci.Vector3,
  40503. this.b = void 0 !== t ? t : new Ci.Vector3,
  40504. this.c = void 0 !== i ? i : new Ci.Vector3
  40505. }
  40506. ,
  40507. Ci.Triangle.normal = (T = new Ci.Vector3,
  40508. function(e, t, i, n) {
  40509. var r = n || new Ci.Vector3;
  40510. r.subVectors(i, t),
  40511. T.subVectors(e, t),
  40512. r.cross(T);
  40513. var o = r.lengthSq();
  40514. return 0 < o ? r.multiplyScalar(1 / Math.sqrt(o)) : r.set(0, 0, 0)
  40515. }
  40516. ),
  40517. Ci.Triangle.barycoordFromPoint = (_ = new Ci.Vector3,
  40518. b = new Ci.Vector3,
  40519. w = new Ci.Vector3,
  40520. function(e, t, i, n, r) {
  40521. _.subVectors(n, t),
  40522. b.subVectors(i, t),
  40523. w.subVectors(e, t);
  40524. var o = _.dot(_)
  40525. , a = _.dot(b)
  40526. , s = _.dot(w)
  40527. , l = b.dot(b)
  40528. , c = b.dot(w)
  40529. , h = o * l - a * a
  40530. , u = r || new Ci.Vector3;
  40531. if (0 == h)
  40532. return u.set(-2, -1, -1);
  40533. var d = 1 / h
  40534. , p = (l * s - a * c) * d
  40535. , f = (o * c - a * s) * d;
  40536. return u.set(1 - p - f, f, p)
  40537. }
  40538. ),
  40539. Ci.Triangle.containsPoint = (E = new Ci.Vector3,
  40540. function(e, t, i, n) {
  40541. var r = Ci.Triangle.barycoordFromPoint(e, t, i, n, E);
  40542. return 0 <= r.x && 0 <= r.y && r.x + r.y <= 1
  40543. }
  40544. ),
  40545. Ci.Triangle.prototype = {
  40546. constructor: Ci.Triangle,
  40547. set: function(e, t, i) {
  40548. return this.a.copy(e),
  40549. this.b.copy(t),
  40550. this.c.copy(i),
  40551. this
  40552. },
  40553. setFromPointsAndIndices: function(e, t, i, n) {
  40554. return this.a.copy(e[t]),
  40555. this.b.copy(e[i]),
  40556. this.c.copy(e[n]),
  40557. this
  40558. },
  40559. clone: function() {
  40560. return (new this.constructor).copy(this)
  40561. },
  40562. copy: function(e) {
  40563. return this.a.copy(e.a),
  40564. this.b.copy(e.b),
  40565. this.c.copy(e.c),
  40566. this
  40567. },
  40568. area: (C = new Ci.Vector3,
  40569. I = new Ci.Vector3,
  40570. function() {
  40571. return C.subVectors(this.c, this.b),
  40572. I.subVectors(this.a, this.b),
  40573. .5 * C.cross(I).length()
  40574. }
  40575. ),
  40576. midpoint: function(e) {
  40577. return (e || new Ci.Vector3).addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3)
  40578. },
  40579. normal: function(e) {
  40580. return Ci.Triangle.normal(this.a, this.b, this.c, e)
  40581. },
  40582. plane: function(e) {
  40583. return (e || new Ci.Plane).setFromCoplanarPoints(this.a, this.b, this.c)
  40584. },
  40585. barycoordFromPoint: function(e, t) {
  40586. return Ci.Triangle.barycoordFromPoint(e, this.a, this.b, this.c, t)
  40587. },
  40588. containsPoint: function(e) {
  40589. return Ci.Triangle.containsPoint(e, this.a, this.b, this.c)
  40590. },
  40591. equals: function(e) {
  40592. return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c)
  40593. }
  40594. },
  40595. Ci.Interpolant = function(e, t, i, n) {
  40596. this.parameterPositions = e,
  40597. this._cachedIndex = 0,
  40598. this.resultBuffer = void 0 !== n ? n : new t.constructor(i),
  40599. this.sampleValues = t,
  40600. this.valueSize = i
  40601. }
  40602. ,
  40603. Ci.Interpolant.prototype = {
  40604. constructor: Ci.Interpolant,
  40605. evaluate: function(e) {
  40606. var t = this.parameterPositions
  40607. , i = this._cachedIndex
  40608. , n = t[i]
  40609. , r = t[i - 1];
  40610. e: {
  40611. t: {
  40612. var o;
  40613. i: {
  40614. n: if (!(e < n)) {
  40615. for (var a = i + 2; ; ) {
  40616. if (void 0 === n) {
  40617. if (e < r)
  40618. break n;
  40619. return i = t.length,
  40620. this._cachedIndex = i,
  40621. this.afterEnd_(i - 1, e, r)
  40622. }
  40623. if (i === a)
  40624. break;
  40625. if (r = n,
  40626. e < (n = t[++i]))
  40627. break t
  40628. }
  40629. o = t.length;
  40630. break i
  40631. }
  40632. if (r <= e)
  40633. break e;
  40634. var s = t[1];
  40635. e < s && (i = 2,
  40636. r = s);
  40637. for (a = i - 2; ; ) {
  40638. if (void 0 === r)
  40639. return this._cachedIndex = 0,
  40640. this.beforeStart_(0, e, n);
  40641. if (i === a)
  40642. break;
  40643. if (n = r,
  40644. (r = t[--i - 1]) <= e)
  40645. break t
  40646. }
  40647. o = i,
  40648. i = 0
  40649. }
  40650. for (; i < o; ) {
  40651. var l = i + o >>> 1;
  40652. e < t[l] ? o = l : i = 1 + l
  40653. }
  40654. if (n = t[i],
  40655. void 0 === (r = t[i - 1]))
  40656. return this._cachedIndex = 0,
  40657. this.beforeStart_(0, e, n);
  40658. if (void 0 === n)
  40659. return i = t.length,
  40660. this._cachedIndex = i,
  40661. this.afterEnd_(i - 1, r, e)
  40662. }
  40663. this._cachedIndex = i,
  40664. this.intervalChanged_(i, r, n)
  40665. }
  40666. return this.interpolate_(i, r, e, n)
  40667. },
  40668. settings: null,
  40669. DefaultSettings_: {},
  40670. getSettings_: function() {
  40671. return this.settings || this.DefaultSettings_
  40672. },
  40673. copySampleValue_: function(e) {
  40674. for (var t = this.resultBuffer, i = this.sampleValues, n = this.valueSize, r = e * n, o = 0; o !== n; ++o)
  40675. t[o] = i[r + o];
  40676. return t
  40677. },
  40678. interpolate_: function(e, t, i, n) {
  40679. throw new Error("call to abstract method")
  40680. },
  40681. intervalChanged_: function(e, t, i) {}
  40682. },
  40683. Object.assign(Ci.Interpolant.prototype, {
  40684. beforeStart_: Ci.Interpolant.prototype.copySampleValue_,
  40685. afterEnd_: Ci.Interpolant.prototype.copySampleValue_
  40686. }),
  40687. Ci.CubicInterpolant = function(e, t, i, n) {
  40688. Ci.Interpolant.call(this, e, t, i, n),
  40689. this._weightPrev = -0,
  40690. this._offsetPrev = -0,
  40691. this._weightNext = -0,
  40692. this._offsetNext = -0
  40693. }
  40694. ,
  40695. Ci.CubicInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  40696. constructor: Ci.CubicInterpolant,
  40697. DefaultSettings_: {
  40698. endingStart: Ci.ZeroCurvatureEnding,
  40699. endingEnd: Ci.ZeroCurvatureEnding
  40700. },
  40701. intervalChanged_: function(e, t, i) {
  40702. var n = this.parameterPositions
  40703. , r = e - 2
  40704. , o = e + 1
  40705. , a = n[r]
  40706. , s = n[o];
  40707. if (void 0 === a)
  40708. switch (this.getSettings_().endingStart) {
  40709. case Ci.ZeroSlopeEnding:
  40710. r = e,
  40711. a = 2 * t - i;
  40712. break;
  40713. case Ci.WrapAroundEnding:
  40714. a = t + n[r = n.length - 2] - n[r + 1];
  40715. break;
  40716. default:
  40717. r = e,
  40718. a = i
  40719. }
  40720. if (void 0 === s)
  40721. switch (this.getSettings_().endingEnd) {
  40722. case Ci.ZeroSlopeEnding:
  40723. o = e,
  40724. s = 2 * i - t;
  40725. break;
  40726. case Ci.WrapAroundEnding:
  40727. s = i + n[o = 1] - n[0];
  40728. break;
  40729. default:
  40730. o = e - 1,
  40731. s = t
  40732. }
  40733. var l = .5 * (i - t)
  40734. , c = this.valueSize;
  40735. this._weightPrev = l / (t - a),
  40736. this._weightNext = l / (s - i),
  40737. this._offsetPrev = r * c,
  40738. this._offsetNext = o * c
  40739. },
  40740. interpolate_: function(e, t, i, n) {
  40741. 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)
  40742. r[C] = m * o[c + C] + v * o[l + C] + y * o[s + C] + A * o[h + C];
  40743. return r
  40744. }
  40745. }),
  40746. Ci.DiscreteInterpolant = function(e, t, i, n) {
  40747. Ci.Interpolant.call(this, e, t, i, n)
  40748. }
  40749. ,
  40750. Ci.DiscreteInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  40751. constructor: Ci.DiscreteInterpolant,
  40752. interpolate_: function(e, t, i, n) {
  40753. return this.copySampleValue_(e - 1)
  40754. }
  40755. }),
  40756. Ci.LinearInterpolant = function(e, t, i, n) {
  40757. Ci.Interpolant.call(this, e, t, i, n)
  40758. }
  40759. ,
  40760. Ci.LinearInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  40761. constructor: Ci.LinearInterpolant,
  40762. interpolate_: function(e, t, i, n) {
  40763. 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)
  40764. r[u] = o[l + u] * h + o[s + u] * c;
  40765. return r
  40766. }
  40767. }),
  40768. Ci.QuaternionLinearInterpolant = function(e, t, i, n) {
  40769. Ci.Interpolant.call(this, e, t, i, n)
  40770. }
  40771. ,
  40772. Ci.QuaternionLinearInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  40773. constructor: Ci.QuaternionLinearInterpolant,
  40774. interpolate_: function(e, t, i, n) {
  40775. 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)
  40776. Ci.Quaternion.slerpFlat(r, 0, o, s - a, o, s, l);
  40777. return r
  40778. }
  40779. }),
  40780. Ci.Clock = function(e) {
  40781. this.autoStart = void 0 === e || e,
  40782. this.startTime = 0,
  40783. this.oldTime = 0,
  40784. this.elapsedTime = 0,
  40785. this.running = !1
  40786. }
  40787. ,
  40788. Ci.Clock.prototype = {
  40789. constructor: Ci.Clock,
  40790. start: function() {
  40791. this.startTime = performance.now(),
  40792. this.oldTime = this.startTime,
  40793. this.running = !0
  40794. },
  40795. stop: function() {
  40796. this.getElapsedTime(),
  40797. this.running = !1
  40798. },
  40799. getElapsedTime: function() {
  40800. return this.getDelta(),
  40801. this.elapsedTime
  40802. },
  40803. getDelta: function() {
  40804. var e = 0;
  40805. if (this.autoStart && !this.running && this.start(),
  40806. this.running) {
  40807. var t = performance.now();
  40808. e = .001 * (t - this.oldTime),
  40809. this.oldTime = t,
  40810. this.elapsedTime += e
  40811. }
  40812. return e
  40813. }
  40814. },
  40815. Ci.EventDispatcher = function() {}
  40816. ,
  40817. Ci.EventDispatcher.prototype = {
  40818. constructor: Ci.EventDispatcher,
  40819. apply: function(e) {
  40820. e.addEventListener = Ci.EventDispatcher.prototype.addEventListener,
  40821. e.hasEventListener = Ci.EventDispatcher.prototype.hasEventListener,
  40822. e.removeEventListener = Ci.EventDispatcher.prototype.removeEventListener,
  40823. e.dispatchEvent = Ci.EventDispatcher.prototype.dispatchEvent
  40824. },
  40825. addEventListener: function(e, t) {
  40826. void 0 === this._listeners && (this._listeners = {});
  40827. var i = this._listeners;
  40828. void 0 === i[e] && (i[e] = []),
  40829. -1 === i[e].indexOf(t) && i[e].push(t)
  40830. },
  40831. hasEventListener: function(e, t) {
  40832. if (void 0 === this._listeners)
  40833. return !1;
  40834. var i = this._listeners;
  40835. return void 0 !== i[e] && -1 !== i[e].indexOf(t)
  40836. },
  40837. removeEventListener: function(e, t) {
  40838. if (void 0 !== this._listeners) {
  40839. var i = this._listeners[e];
  40840. if (void 0 !== i) {
  40841. var n = i.indexOf(t);
  40842. -1 !== n && i.splice(n, 1)
  40843. }
  40844. }
  40845. },
  40846. dispatchEvent: function(e) {
  40847. if (void 0 !== this._listeners) {
  40848. var t = this._listeners[e.type];
  40849. if (void 0 !== t) {
  40850. e.target = this;
  40851. for (var i = [], n = t.length, r = 0; r < n; r++)
  40852. i[r] = t[r];
  40853. for (r = 0; r < n; r++)
  40854. i[r].call(this, e)
  40855. }
  40856. }
  40857. }
  40858. },
  40859. Ci.Layers = function() {
  40860. this.mask = 1
  40861. }
  40862. ,
  40863. Ci.Layers.prototype = {
  40864. constructor: Ci.Layers,
  40865. set: function(e) {
  40866. this.mask = 1 << e
  40867. },
  40868. enable: function(e) {
  40869. this.mask |= 1 << e
  40870. },
  40871. toggle: function(e) {
  40872. this.mask ^= 1 << e
  40873. },
  40874. disable: function(e) {
  40875. this.mask &= ~(1 << e)
  40876. },
  40877. test: function(e) {
  40878. return 0 != (this.mask & e.mask)
  40879. }
  40880. },
  40881. (A = Ci).Raycaster = function(e, t, i, n) {
  40882. this.ray = new A.Ray(e,t),
  40883. this.near = i || 0,
  40884. this.far = n || 1 / 0,
  40885. this.params = {
  40886. Mesh: {},
  40887. Line: {},
  40888. LOD: {},
  40889. Points: {
  40890. threshold: 1
  40891. },
  40892. Sprite: {}
  40893. },
  40894. Object.defineProperties(this.params, {
  40895. PointCloud: {
  40896. get: function() {
  40897. return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),
  40898. this.Points
  40899. }
  40900. }
  40901. })
  40902. }
  40903. ,
  40904. A.Raycaster.prototype = {
  40905. constructor: A.Raycaster,
  40906. linePrecision: 1,
  40907. set: function(e, t) {
  40908. this.ray.set(e, t)
  40909. },
  40910. setFromCamera: function(e, t) {
  40911. t instanceof A.PerspectiveCamera ? (this.ray.origin.setFromMatrixPosition(t.matrixWorld),
  40912. 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),
  40913. this.ray.direction.set(0, 0, -1).transformDirection(t.matrixWorld)) : console.error("THREE.Raycaster: Unsupported camera type.")
  40914. },
  40915. intersectObject: function(e, t) {
  40916. var i = [];
  40917. return Ei(e, this, i, t),
  40918. i.sort(Ii),
  40919. i
  40920. },
  40921. intersectObjects: function(e, t) {
  40922. var i = [];
  40923. if (!1 === Array.isArray(e))
  40924. return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),
  40925. i;
  40926. for (var n = 0, r = e.length; n < r; n++)
  40927. Ei(e[n], this, i, t);
  40928. return i.sort(Ii),
  40929. i
  40930. }
  40931. },
  40932. Ci.Object3D = function() {
  40933. Object.defineProperty(this, "id", {
  40934. value: Ci.Object3DIdCount++
  40935. }),
  40936. this.uuid = Ci.Math.generateUUID(),
  40937. this.name = "",
  40938. this.type = "Object3D",
  40939. this.parent = null,
  40940. this.children = [],
  40941. this.up = Ci.Object3D.DefaultUp.clone();
  40942. var e = new Ci.Vector3
  40943. , t = new Ci.Euler
  40944. , i = new Ci.Quaternion
  40945. , n = new Ci.Vector3(1,1,1);
  40946. t.onChange(function() {
  40947. i.setFromEuler(t, !1)
  40948. }),
  40949. i.onChange(function() {
  40950. t.setFromQuaternion(i, void 0, !1)
  40951. }),
  40952. Object.defineProperties(this, {
  40953. position: {
  40954. enumerable: !0,
  40955. value: e
  40956. },
  40957. rotation: {
  40958. enumerable: !0,
  40959. value: t
  40960. },
  40961. quaternion: {
  40962. enumerable: !0,
  40963. value: i
  40964. },
  40965. scale: {
  40966. enumerable: !0,
  40967. value: n
  40968. },
  40969. modelViewMatrix: {
  40970. value: new Ci.Matrix4
  40971. },
  40972. normalMatrix: {
  40973. value: new Ci.Matrix3
  40974. }
  40975. }),
  40976. this.rotationAutoUpdate = !0,
  40977. this.matrix = new Ci.Matrix4,
  40978. this.matrixWorld = new Ci.Matrix4,
  40979. this.matrixAutoUpdate = Ci.Object3D.DefaultMatrixAutoUpdate,
  40980. this.matrixWorldNeedsUpdate = !1,
  40981. this.layers = new Ci.Layers,
  40982. this.visible = !0,
  40983. this.castShadow = !1,
  40984. this.receiveShadow = !1,
  40985. this.frustumCulled = !0,
  40986. this.renderOrder = 0,
  40987. this.userData = {}
  40988. }
  40989. ,
  40990. Ci.Object3D.DefaultUp = new Ci.Vector3(0,1,0),
  40991. Ci.Object3D.DefaultMatrixAutoUpdate = !0,
  40992. Ci.Object3D.prototype = {
  40993. constructor: Ci.Object3D,
  40994. applyMatrix: function(e) {
  40995. this.matrix.multiplyMatrices(e, this.matrix),
  40996. this.matrix.decompose(this.position, this.quaternion, this.scale)
  40997. },
  40998. setRotationFromAxisAngle: function(e, t) {
  40999. this.quaternion.setFromAxisAngle(e, t)
  41000. },
  41001. setRotationFromEuler: function(e) {
  41002. this.quaternion.setFromEuler(e, !0)
  41003. },
  41004. setRotationFromMatrix: function(e) {
  41005. this.quaternion.setFromRotationMatrix(e)
  41006. },
  41007. setRotationFromQuaternion: function(e) {
  41008. this.quaternion.copy(e)
  41009. },
  41010. rotateOnAxis: (y = new Ci.Quaternion,
  41011. function(e, t) {
  41012. return y.setFromAxisAngle(e, t),
  41013. this.quaternion.multiply(y),
  41014. this
  41015. }
  41016. ),
  41017. rotateX: (v = new Ci.Vector3(1,0,0),
  41018. function(e) {
  41019. return this.rotateOnAxis(v, e)
  41020. }
  41021. ),
  41022. rotateY: (m = new Ci.Vector3(0,1,0),
  41023. function(e) {
  41024. return this.rotateOnAxis(m, e)
  41025. }
  41026. ),
  41027. rotateZ: (g = new Ci.Vector3(0,0,1),
  41028. function(e) {
  41029. return this.rotateOnAxis(g, e)
  41030. }
  41031. ),
  41032. translateOnAxis: (f = new Ci.Vector3,
  41033. function(e, t) {
  41034. return f.copy(e).applyQuaternion(this.quaternion),
  41035. this.position.add(f.multiplyScalar(t)),
  41036. this
  41037. }
  41038. ),
  41039. translateX: (p = new Ci.Vector3(1,0,0),
  41040. function(e) {
  41041. return this.translateOnAxis(p, e)
  41042. }
  41043. ),
  41044. translateY: (d = new Ci.Vector3(0,1,0),
  41045. function(e) {
  41046. return this.translateOnAxis(d, e)
  41047. }
  41048. ),
  41049. translateZ: (u = new Ci.Vector3(0,0,1),
  41050. function(e) {
  41051. return this.translateOnAxis(u, e)
  41052. }
  41053. ),
  41054. localToWorld: function(e) {
  41055. return e.applyMatrix4(this.matrixWorld)
  41056. },
  41057. worldToLocal: (h = new Ci.Matrix4,
  41058. function(e) {
  41059. return e.applyMatrix4(h.getInverse(this.matrixWorld))
  41060. }
  41061. ),
  41062. lookAt: (c = new Ci.Matrix4,
  41063. function(e) {
  41064. c.lookAt(e, this.position, this.up),
  41065. this.quaternion.setFromRotationMatrix(c)
  41066. }
  41067. ),
  41068. add: function(e) {
  41069. if (1 < arguments.length) {
  41070. for (var t = 0; t < arguments.length; t++)
  41071. this.add(arguments[t]);
  41072. return this
  41073. }
  41074. 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),
  41075. e.parent = this,
  41076. e.dispatchEvent({
  41077. type: "added"
  41078. }),
  41079. this.children.push(e)) : console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.", e),
  41080. this
  41081. },
  41082. remove: function(e) {
  41083. if (1 < arguments.length)
  41084. for (var t = 0; t < arguments.length; t++)
  41085. this.remove(arguments[t]);
  41086. var i = this.children.indexOf(e);
  41087. -1 !== i && (e.parent = null,
  41088. e.dispatchEvent({
  41089. type: "removed"
  41090. }),
  41091. this.children.splice(i, 1))
  41092. },
  41093. getObjectById: function(e) {
  41094. return this.getObjectByProperty("id", e)
  41095. },
  41096. getObjectByName: function(e) {
  41097. return this.getObjectByProperty("name", e)
  41098. },
  41099. getObjectByProperty: function(e, t) {
  41100. if (this[e] === t)
  41101. return this;
  41102. for (var i = 0, n = this.children.length; i < n; i++) {
  41103. var r = this.children[i].getObjectByProperty(e, t);
  41104. if (void 0 !== r)
  41105. return r
  41106. }
  41107. },
  41108. getWorldPosition: function(e) {
  41109. var t = e || new Ci.Vector3;
  41110. return this.updateMatrixWorld(!0),
  41111. t.setFromMatrixPosition(this.matrixWorld)
  41112. },
  41113. getWorldQuaternion: (s = new Ci.Vector3,
  41114. l = new Ci.Vector3,
  41115. function(e) {
  41116. var t = e || new Ci.Quaternion;
  41117. return this.updateMatrixWorld(!0),
  41118. this.matrixWorld.decompose(s, t, l),
  41119. t
  41120. }
  41121. ),
  41122. getWorldRotation: (a = new Ci.Quaternion,
  41123. function(e) {
  41124. var t = e || new Ci.Euler;
  41125. return this.getWorldQuaternion(a),
  41126. t.setFromQuaternion(a, this.rotation.order, !1)
  41127. }
  41128. ),
  41129. getWorldScale: (r = new Ci.Vector3,
  41130. o = new Ci.Quaternion,
  41131. function(e) {
  41132. var t = e || new Ci.Vector3;
  41133. return this.updateMatrixWorld(!0),
  41134. this.matrixWorld.decompose(r, o, t),
  41135. t
  41136. }
  41137. ),
  41138. getWorldDirection: (n = new Ci.Quaternion,
  41139. function(e) {
  41140. var t = e || new Ci.Vector3;
  41141. return this.getWorldQuaternion(n),
  41142. t.set(0, 0, 1).applyQuaternion(n)
  41143. }
  41144. ),
  41145. raycast: function() {},
  41146. traverse: function(e) {
  41147. e(this);
  41148. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  41149. t[i].traverse(e)
  41150. },
  41151. traverseVisible: function(e) {
  41152. if (!1 !== this.visible) {
  41153. e(this);
  41154. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  41155. t[i].traverseVisible(e)
  41156. }
  41157. },
  41158. traverseAncestors: function(e) {
  41159. var t = this.parent;
  41160. null !== t && (e(t),
  41161. t.traverseAncestors(e))
  41162. },
  41163. updateMatrix: function() {
  41164. this.matrix.compose(this.position, this.quaternion, this.scale),
  41165. this.matrixWorldNeedsUpdate = !0
  41166. },
  41167. updateMatrixWorld: function(e) {
  41168. !0 === this.matrixAutoUpdate && this.updateMatrix(),
  41169. !0 !== this.matrixWorldNeedsUpdate && !0 !== e || (null === this.parent ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix),
  41170. e = !(this.matrixWorldNeedsUpdate = !1));
  41171. for (var t = 0, i = this.children.length; t < i; t++)
  41172. this.children[t].updateMatrixWorld(e)
  41173. },
  41174. toJSON: function(e) {
  41175. function t(e) {
  41176. var t = [];
  41177. for (var i in e) {
  41178. var n = e[i];
  41179. delete n.metadata,
  41180. t.push(n)
  41181. }
  41182. return t
  41183. }
  41184. var i = void 0 === e
  41185. , n = {};
  41186. i && (e = {
  41187. geometries: {},
  41188. materials: {},
  41189. textures: {},
  41190. images: {}
  41191. },
  41192. n.metadata = {
  41193. version: 4.4,
  41194. type: "Object",
  41195. generator: "Object3D.toJSON"
  41196. });
  41197. var r = {};
  41198. if (r.uuid = this.uuid,
  41199. r.type = this.type,
  41200. "" !== this.name && (r.name = this.name),
  41201. "{}" !== JSON.stringify(this.userData) && (r.userData = this.userData),
  41202. !0 === this.castShadow && (r.castShadow = !0),
  41203. !0 === this.receiveShadow && (r.receiveShadow = !0),
  41204. !1 === this.visible && (r.visible = !1),
  41205. r.matrix = this.matrix.toArray(),
  41206. void 0 !== this.geometry && (void 0 === e.geometries[this.geometry.uuid] && (e.geometries[this.geometry.uuid] = this.geometry.toJSON(e)),
  41207. r.geometry = this.geometry.uuid),
  41208. void 0 !== this.material && (void 0 === e.materials[this.material.uuid] && (e.materials[this.material.uuid] = this.material.toJSON(e)),
  41209. r.material = this.material.uuid),
  41210. 0 < this.children.length) {
  41211. r.children = [];
  41212. for (var o = 0; o < this.children.length; o++)
  41213. r.children.push(this.children[o].toJSON(e).object)
  41214. }
  41215. if (i) {
  41216. var a = t(e.geometries)
  41217. , s = t(e.materials)
  41218. , l = t(e.textures)
  41219. , c = t(e.images);
  41220. 0 < a.length && (n.geometries = a),
  41221. 0 < s.length && (n.materials = s),
  41222. 0 < l.length && (n.textures = l),
  41223. 0 < c.length && (n.images = c)
  41224. }
  41225. return n.object = r,
  41226. n
  41227. },
  41228. clone: function(e) {
  41229. return (new this.constructor).copy(this, e)
  41230. },
  41231. copy: function(e, t) {
  41232. if (void 0 === t && (t = !0),
  41233. this.name = e.name,
  41234. this.up.copy(e.up),
  41235. this.position.copy(e.position),
  41236. this.quaternion.copy(e.quaternion),
  41237. this.scale.copy(e.scale),
  41238. this.rotationAutoUpdate = e.rotationAutoUpdate,
  41239. this.matrix.copy(e.matrix),
  41240. this.matrixWorld.copy(e.matrixWorld),
  41241. this.matrixAutoUpdate = e.matrixAutoUpdate,
  41242. this.matrixWorldNeedsUpdate = e.matrixWorldNeedsUpdate,
  41243. this.visible = e.visible,
  41244. this.castShadow = e.castShadow,
  41245. this.receiveShadow = e.receiveShadow,
  41246. this.frustumCulled = e.frustumCulled,
  41247. this.renderOrder = e.renderOrder,
  41248. this.userData = JSON.parse(JSON.stringify(e.userData)),
  41249. !0 === t)
  41250. for (var i = 0; i < e.children.length; i++) {
  41251. var n = e.children[i];
  41252. this.add(n.clone())
  41253. }
  41254. return this
  41255. }
  41256. },
  41257. Ci.EventDispatcher.prototype.apply(Ci.Object3D.prototype),
  41258. Ci.Object3DIdCount = 0,
  41259. Ci.Face3 = function(e, t, i, n, r, o) {
  41260. this.a = e,
  41261. this.b = t,
  41262. this.c = i,
  41263. this.normal = n instanceof Ci.Vector3 ? n : new Ci.Vector3,
  41264. this.vertexNormals = Array.isArray(n) ? n : [],
  41265. this.color = r instanceof Ci.Color ? r : new Ci.Color,
  41266. this.vertexColors = Array.isArray(r) ? r : [],
  41267. this.materialIndex = void 0 !== o ? o : 0
  41268. }
  41269. ,
  41270. Ci.Face3.prototype = {
  41271. constructor: Ci.Face3,
  41272. clone: function() {
  41273. return (new this.constructor).copy(this)
  41274. },
  41275. copy: function(e) {
  41276. this.a = e.a,
  41277. this.b = e.b,
  41278. this.c = e.c,
  41279. this.normal.copy(e.normal),
  41280. this.color.copy(e.color),
  41281. this.materialIndex = e.materialIndex;
  41282. for (var t = 0, i = e.vertexNormals.length; t < i; t++)
  41283. this.vertexNormals[t] = e.vertexNormals[t].clone();
  41284. for (t = 0,
  41285. i = e.vertexColors.length; t < i; t++)
  41286. this.vertexColors[t] = e.vertexColors[t].clone();
  41287. return this
  41288. }
  41289. },
  41290. Ci.BufferAttribute = function(e, t) {
  41291. this.uuid = Ci.Math.generateUUID(),
  41292. this.array = e,
  41293. this.itemSize = t,
  41294. this.dynamic = !1,
  41295. this.updateRange = {
  41296. offset: 0,
  41297. count: -1
  41298. },
  41299. this.version = 0
  41300. }
  41301. ,
  41302. Ci.BufferAttribute.prototype = {
  41303. constructor: Ci.BufferAttribute,
  41304. get count() {
  41305. return this.array.length / this.itemSize
  41306. },
  41307. set needsUpdate(e) {
  41308. !0 === e && this.version++
  41309. },
  41310. setDynamic: function(e) {
  41311. return this.dynamic = e,
  41312. this
  41313. },
  41314. copy: function(e) {
  41315. return this.array = new e.array.constructor(e.array),
  41316. this.itemSize = e.itemSize,
  41317. this.dynamic = e.dynamic,
  41318. this
  41319. },
  41320. copyAt: function(e, t, i) {
  41321. e *= this.itemSize,
  41322. i *= t.itemSize;
  41323. for (var n = 0, r = this.itemSize; n < r; n++)
  41324. this.array[e + n] = t.array[i + n];
  41325. return this
  41326. },
  41327. copyArray: function(e) {
  41328. return this.array.set(e),
  41329. this
  41330. },
  41331. copyColorsArray: function(e) {
  41332. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41333. var o = e[n];
  41334. void 0 === o && (console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined", n),
  41335. o = new Ci.Color),
  41336. t[i++] = o.r,
  41337. t[i++] = o.g,
  41338. t[i++] = o.b
  41339. }
  41340. return this
  41341. },
  41342. copyIndicesArray: function(e) {
  41343. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41344. var o = e[n];
  41345. t[i++] = o.a,
  41346. t[i++] = o.b,
  41347. t[i++] = o.c
  41348. }
  41349. return this
  41350. },
  41351. copyVector2sArray: function(e) {
  41352. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41353. var o = e[n];
  41354. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined", n),
  41355. o = new Ci.Vector2),
  41356. t[i++] = o.x,
  41357. t[i++] = o.y
  41358. }
  41359. return this
  41360. },
  41361. copyVector3sArray: function(e) {
  41362. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41363. var o = e[n];
  41364. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined", n),
  41365. o = new Ci.Vector3),
  41366. t[i++] = o.x,
  41367. t[i++] = o.y,
  41368. t[i++] = o.z
  41369. }
  41370. return this
  41371. },
  41372. copyVector4sArray: function(e) {
  41373. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41374. var o = e[n];
  41375. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined", n),
  41376. o = new Ci.Vector4),
  41377. t[i++] = o.x,
  41378. t[i++] = o.y,
  41379. t[i++] = o.z,
  41380. t[i++] = o.w
  41381. }
  41382. return this
  41383. },
  41384. set: function(e, t) {
  41385. return void 0 === t && (t = 0),
  41386. this.array.set(e, t),
  41387. this
  41388. },
  41389. getX: function(e) {
  41390. return this.array[e * this.itemSize]
  41391. },
  41392. setX: function(e, t) {
  41393. return this.array[e * this.itemSize] = t,
  41394. this
  41395. },
  41396. getY: function(e) {
  41397. return this.array[e * this.itemSize + 1]
  41398. },
  41399. setY: function(e, t) {
  41400. return this.array[e * this.itemSize + 1] = t,
  41401. this
  41402. },
  41403. getZ: function(e) {
  41404. return this.array[e * this.itemSize + 2]
  41405. },
  41406. setZ: function(e, t) {
  41407. return this.array[e * this.itemSize + 2] = t,
  41408. this
  41409. },
  41410. getW: function(e) {
  41411. return this.array[e * this.itemSize + 3]
  41412. },
  41413. setW: function(e, t) {
  41414. return this.array[e * this.itemSize + 3] = t,
  41415. this
  41416. },
  41417. setXY: function(e, t, i) {
  41418. return e *= this.itemSize,
  41419. this.array[e + 0] = t,
  41420. this.array[e + 1] = i,
  41421. this
  41422. },
  41423. setXYZ: function(e, t, i, n) {
  41424. return e *= this.itemSize,
  41425. this.array[e + 0] = t,
  41426. this.array[e + 1] = i,
  41427. this.array[e + 2] = n,
  41428. this
  41429. },
  41430. setXYZW: function(e, t, i, n, r) {
  41431. return e *= this.itemSize,
  41432. this.array[e + 0] = t,
  41433. this.array[e + 1] = i,
  41434. this.array[e + 2] = n,
  41435. this.array[e + 3] = r,
  41436. this
  41437. },
  41438. clone: function() {
  41439. return (new this.constructor).copy(this)
  41440. }
  41441. },
  41442. Ci.Int8Attribute = function(e, t) {
  41443. return new Ci.BufferAttribute(new Int8Array(e),t)
  41444. }
  41445. ,
  41446. Ci.Uint8Attribute = function(e, t) {
  41447. return new Ci.BufferAttribute(new Uint8Array(e),t)
  41448. }
  41449. ,
  41450. Ci.Uint8ClampedAttribute = function(e, t) {
  41451. return new Ci.BufferAttribute(new Uint8ClampedArray(e),t)
  41452. }
  41453. ,
  41454. Ci.Int16Attribute = function(e, t) {
  41455. return new Ci.BufferAttribute(new Int16Array(e),t)
  41456. }
  41457. ,
  41458. Ci.Uint16Attribute = function(e, t) {
  41459. return new Ci.BufferAttribute(new Uint16Array(e),t)
  41460. }
  41461. ,
  41462. Ci.Int32Attribute = function(e, t) {
  41463. return new Ci.BufferAttribute(new Int32Array(e),t)
  41464. }
  41465. ,
  41466. Ci.Uint32Attribute = function(e, t) {
  41467. return new Ci.BufferAttribute(new Uint32Array(e),t)
  41468. }
  41469. ,
  41470. Ci.Float32Attribute = function(e, t) {
  41471. return new Ci.BufferAttribute(new Float32Array(e),t)
  41472. }
  41473. ,
  41474. Ci.Float64Attribute = function(e, t) {
  41475. return new Ci.BufferAttribute(new Float64Array(e),t)
  41476. }
  41477. ,
  41478. Ci.DynamicBufferAttribute = function(e, t) {
  41479. return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),
  41480. new Ci.BufferAttribute(e,t).setDynamic(!0)
  41481. }
  41482. ,
  41483. Ci.InstancedBufferAttribute = function(e, t, i) {
  41484. Ci.BufferAttribute.call(this, e, t),
  41485. this.meshPerAttribute = i || 1
  41486. }
  41487. ,
  41488. Ci.InstancedBufferAttribute.prototype = Object.create(Ci.BufferAttribute.prototype),
  41489. Ci.InstancedBufferAttribute.prototype.constructor = Ci.InstancedBufferAttribute,
  41490. Ci.InstancedBufferAttribute.prototype.copy = function(e) {
  41491. return Ci.BufferAttribute.prototype.copy.call(this, e),
  41492. this.meshPerAttribute = e.meshPerAttribute,
  41493. this
  41494. }
  41495. ,
  41496. Ci.InterleavedBuffer = function(e, t) {
  41497. this.uuid = Ci.Math.generateUUID(),
  41498. this.array = e,
  41499. this.stride = t,
  41500. this.dynamic = !1,
  41501. this.updateRange = {
  41502. offset: 0,
  41503. count: -1
  41504. },
  41505. this.version = 0
  41506. }
  41507. ,
  41508. Ci.InterleavedBuffer.prototype = {
  41509. constructor: Ci.InterleavedBuffer,
  41510. get length() {
  41511. return this.array.length
  41512. },
  41513. get count() {
  41514. return this.array.length / this.stride
  41515. },
  41516. set needsUpdate(e) {
  41517. !0 === e && this.version++
  41518. },
  41519. setDynamic: function(e) {
  41520. return this.dynamic = e,
  41521. this
  41522. },
  41523. copy: function(e) {
  41524. return this.array = new e.array.constructor(e.array),
  41525. this.stride = e.stride,
  41526. this.dynamic = e.dynamic,
  41527. this
  41528. },
  41529. copyAt: function(e, t, i) {
  41530. e *= this.stride,
  41531. i *= t.stride;
  41532. for (var n = 0, r = this.stride; n < r; n++)
  41533. this.array[e + n] = t.array[i + n];
  41534. return this
  41535. },
  41536. set: function(e, t) {
  41537. return void 0 === t && (t = 0),
  41538. this.array.set(e, t),
  41539. this
  41540. },
  41541. clone: function() {
  41542. return (new this.constructor).copy(this)
  41543. }
  41544. },
  41545. Ci.InstancedInterleavedBuffer = function(e, t, i) {
  41546. Ci.InterleavedBuffer.call(this, e, t),
  41547. this.meshPerAttribute = i || 1
  41548. }
  41549. ,
  41550. Ci.InstancedInterleavedBuffer.prototype = Object.create(Ci.InterleavedBuffer.prototype),
  41551. Ci.InstancedInterleavedBuffer.prototype.constructor = Ci.InstancedInterleavedBuffer,
  41552. Ci.InstancedInterleavedBuffer.prototype.copy = function(e) {
  41553. return Ci.InterleavedBuffer.prototype.copy.call(this, e),
  41554. this.meshPerAttribute = e.meshPerAttribute,
  41555. this
  41556. }
  41557. ,
  41558. Ci.InterleavedBufferAttribute = function(e, t, i) {
  41559. this.uuid = Ci.Math.generateUUID(),
  41560. this.data = e,
  41561. this.itemSize = t,
  41562. this.offset = i
  41563. }
  41564. ,
  41565. Ci.InterleavedBufferAttribute.prototype = {
  41566. constructor: Ci.InterleavedBufferAttribute,
  41567. get length() {
  41568. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  41569. this.array.length
  41570. },
  41571. get count() {
  41572. return this.data.count
  41573. },
  41574. setX: function(e, t) {
  41575. return this.data.array[e * this.data.stride + this.offset] = t,
  41576. this
  41577. },
  41578. setY: function(e, t) {
  41579. return this.data.array[e * this.data.stride + this.offset + 1] = t,
  41580. this
  41581. },
  41582. setZ: function(e, t) {
  41583. return this.data.array[e * this.data.stride + this.offset + 2] = t,
  41584. this
  41585. },
  41586. setW: function(e, t) {
  41587. return this.data.array[e * this.data.stride + this.offset + 3] = t,
  41588. this
  41589. },
  41590. getX: function(e) {
  41591. return this.data.array[e * this.data.stride + this.offset]
  41592. },
  41593. getY: function(e) {
  41594. return this.data.array[e * this.data.stride + this.offset + 1]
  41595. },
  41596. getZ: function(e) {
  41597. return this.data.array[e * this.data.stride + this.offset + 2]
  41598. },
  41599. getW: function(e) {
  41600. return this.data.array[e * this.data.stride + this.offset + 3]
  41601. },
  41602. setXY: function(e, t, i) {
  41603. return e = e * this.data.stride + this.offset,
  41604. this.data.array[e + 0] = t,
  41605. this.data.array[e + 1] = i,
  41606. this
  41607. },
  41608. setXYZ: function(e, t, i, n) {
  41609. return e = e * this.data.stride + this.offset,
  41610. this.data.array[e + 0] = t,
  41611. this.data.array[e + 1] = i,
  41612. this.data.array[e + 2] = n,
  41613. this
  41614. },
  41615. setXYZW: function(e, t, i, n, r) {
  41616. return e = e * this.data.stride + this.offset,
  41617. this.data.array[e + 0] = t,
  41618. this.data.array[e + 1] = i,
  41619. this.data.array[e + 2] = n,
  41620. this.data.array[e + 3] = r,
  41621. this
  41622. }
  41623. },
  41624. Ci.Geometry = function() {
  41625. Object.defineProperty(this, "id", {
  41626. value: Ci.GeometryIdCount++
  41627. }),
  41628. this.uuid = Ci.Math.generateUUID(),
  41629. this.name = "",
  41630. this.type = "Geometry",
  41631. this.vertices = [],
  41632. this.colors = [],
  41633. this.faces = [],
  41634. this.faceVertexUvs = [[]],
  41635. this.morphTargets = [],
  41636. this.morphNormals = [],
  41637. this.skinWeights = [],
  41638. this.skinIndices = [],
  41639. this.lineDistances = [],
  41640. this.boundingBox = null,
  41641. this.boundingSphere = null,
  41642. this.verticesNeedUpdate = !1,
  41643. this.elementsNeedUpdate = !1,
  41644. this.uvsNeedUpdate = !1,
  41645. this.normalsNeedUpdate = !1,
  41646. this.colorsNeedUpdate = !1,
  41647. this.lineDistancesNeedUpdate = !1,
  41648. this.groupsNeedUpdate = !1
  41649. }
  41650. ,
  41651. Ci.Geometry.prototype = {
  41652. constructor: Ci.Geometry,
  41653. applyMatrix: function(e) {
  41654. for (var t = (new Ci.Matrix3).getNormalMatrix(e), i = 0, n = this.vertices.length; i < n; i++) {
  41655. this.vertices[i].applyMatrix4(e)
  41656. }
  41657. for (i = 0,
  41658. n = this.faces.length; i < n; i++) {
  41659. var r = this.faces[i];
  41660. r.normal.applyMatrix3(t).normalize();
  41661. for (var o = 0, a = r.vertexNormals.length; o < a; o++)
  41662. r.vertexNormals[o].applyMatrix3(t).normalize()
  41663. }
  41664. return null !== this.boundingBox && this.computeBoundingBox(),
  41665. null !== this.boundingSphere && this.computeBoundingSphere(),
  41666. this.verticesNeedUpdate = !0,
  41667. this.normalsNeedUpdate = !0,
  41668. this
  41669. },
  41670. rotateX: function(e) {
  41671. return void 0 === mt && (mt = new Ci.Matrix4),
  41672. mt.makeRotationX(e),
  41673. this.applyMatrix(mt),
  41674. this
  41675. },
  41676. rotateY: function(e) {
  41677. return void 0 === gt && (gt = new Ci.Matrix4),
  41678. gt.makeRotationY(e),
  41679. this.applyMatrix(gt),
  41680. this
  41681. },
  41682. rotateZ: function(e) {
  41683. return void 0 === ft && (ft = new Ci.Matrix4),
  41684. ft.makeRotationZ(e),
  41685. this.applyMatrix(ft),
  41686. this
  41687. },
  41688. translate: function(e, t, i) {
  41689. return void 0 === pt && (pt = new Ci.Matrix4),
  41690. pt.makeTranslation(e, t, i),
  41691. this.applyMatrix(pt),
  41692. this
  41693. },
  41694. scale: function(e, t, i) {
  41695. return void 0 === dt && (dt = new Ci.Matrix4),
  41696. dt.makeScale(e, t, i),
  41697. this.applyMatrix(dt),
  41698. this
  41699. },
  41700. lookAt: function(e) {
  41701. void 0 === ut && (ut = new Ci.Object3D),
  41702. ut.lookAt(e),
  41703. ut.updateMatrix(),
  41704. this.applyMatrix(ut.matrix)
  41705. },
  41706. fromBufferGeometry: function(e) {
  41707. function t(e, t, i, n) {
  41708. var r = void 0 !== l ? [d[e].clone(), d[t].clone(), d[i].clone()] : []
  41709. , o = void 0 !== c ? [s.colors[e].clone(), s.colors[t].clone(), s.colors[i].clone()] : []
  41710. , a = new Ci.Face3(e,t,i,r,o,n);
  41711. s.faces.push(a),
  41712. void 0 !== h && s.faceVertexUvs[0].push([p[e].clone(), p[t].clone(), p[i].clone()]),
  41713. void 0 !== u && s.faceVertexUvs[1].push([f[e].clone(), f[t].clone(), f[i].clone()])
  41714. }
  41715. var s = this
  41716. , i = null !== e.index ? e.index.array : void 0
  41717. , n = e.attributes
  41718. , r = n.position.array
  41719. , l = void 0 !== n.normal ? n.normal.array : void 0
  41720. , c = void 0 !== n.color ? n.color.array : void 0
  41721. , h = void 0 !== n.uv ? n.uv.array : void 0
  41722. , u = void 0 !== n.uv2 ? n.uv2.array : void 0;
  41723. void 0 !== u && (this.faceVertexUvs[1] = []);
  41724. for (var d = [], p = [], f = [], o = 0, a = 0; o < r.length; o += 3,
  41725. a += 2)
  41726. s.vertices.push(new Ci.Vector3(r[o],r[o + 1],r[o + 2])),
  41727. void 0 !== l && d.push(new Ci.Vector3(l[o],l[o + 1],l[o + 2])),
  41728. void 0 !== c && s.colors.push(new Ci.Color(c[o],c[o + 1],c[o + 2])),
  41729. void 0 !== h && p.push(new Ci.Vector2(h[a],h[a + 1])),
  41730. void 0 !== u && f.push(new Ci.Vector2(u[a],u[a + 1]));
  41731. if (void 0 !== i) {
  41732. var g = e.groups;
  41733. if (0 < g.length)
  41734. for (o = 0; o < g.length; o++)
  41735. for (var m = g[o], v = m.start, y = (a = v,
  41736. v + m.count); a < y; a += 3)
  41737. t(i[a], i[a + 1], i[a + 2], m.materialIndex);
  41738. else
  41739. for (o = 0; o < i.length; o += 3)
  41740. t(i[o], i[o + 1], i[o + 2])
  41741. } else
  41742. for (o = 0; o < r.length / 3; o += 3)
  41743. t(o, o + 1, o + 2);
  41744. return this.computeFaceNormals(),
  41745. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  41746. null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  41747. this
  41748. },
  41749. center: function() {
  41750. this.computeBoundingBox();
  41751. var e = this.boundingBox.center().negate();
  41752. return this.translate(e.x, e.y, e.z),
  41753. e
  41754. },
  41755. normalize: function() {
  41756. this.computeBoundingSphere();
  41757. var e = this.boundingSphere.center
  41758. , t = this.boundingSphere.radius
  41759. , i = 0 === t ? 1 : 1 / t
  41760. , n = new Ci.Matrix4;
  41761. 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),
  41762. this.applyMatrix(n),
  41763. this
  41764. },
  41765. computeFaceNormals: function() {
  41766. for (var e = new Ci.Vector3, t = new Ci.Vector3, i = 0, n = this.faces.length; i < n; i++) {
  41767. var r = this.faces[i]
  41768. , o = this.vertices[r.a]
  41769. , a = this.vertices[r.b]
  41770. , s = this.vertices[r.c];
  41771. e.subVectors(s, a),
  41772. t.subVectors(o, a),
  41773. e.cross(t),
  41774. e.normalize(),
  41775. r.normal.copy(e)
  41776. }
  41777. },
  41778. computeVertexNormals: function(e) {
  41779. var t, i, n, r, o, a;
  41780. for (void 0 === e && (e = !0),
  41781. a = new Array(this.vertices.length),
  41782. t = 0,
  41783. i = this.vertices.length; t < i; t++)
  41784. a[t] = new Ci.Vector3;
  41785. if (e) {
  41786. var s, l, c, h = new Ci.Vector3, u = new Ci.Vector3;
  41787. for (n = 0,
  41788. r = this.faces.length; n < r; n++)
  41789. o = this.faces[n],
  41790. s = this.vertices[o.a],
  41791. l = this.vertices[o.b],
  41792. c = this.vertices[o.c],
  41793. h.subVectors(c, l),
  41794. u.subVectors(s, l),
  41795. h.cross(u),
  41796. a[o.a].add(h),
  41797. a[o.b].add(h),
  41798. a[o.c].add(h)
  41799. } else
  41800. for (n = 0,
  41801. r = this.faces.length; n < r; n++)
  41802. a[(o = this.faces[n]).a].add(o.normal),
  41803. a[o.b].add(o.normal),
  41804. a[o.c].add(o.normal);
  41805. for (t = 0,
  41806. i = this.vertices.length; t < i; t++)
  41807. a[t].normalize();
  41808. for (n = 0,
  41809. r = this.faces.length; n < r; n++) {
  41810. var d = (o = this.faces[n]).vertexNormals;
  41811. 3 === d.length ? (d[0].copy(a[o.a]),
  41812. d[1].copy(a[o.b]),
  41813. d[2].copy(a[o.c])) : (d[0] = a[o.a].clone(),
  41814. d[1] = a[o.b].clone(),
  41815. d[2] = a[o.c].clone())
  41816. }
  41817. 0 < this.faces.length && (this.normalsNeedUpdate = !0)
  41818. },
  41819. computeMorphNormals: function() {
  41820. var e, t, i, n, r;
  41821. for (i = 0,
  41822. n = this.faces.length; i < n; i++)
  41823. for ((r = this.faces[i]).__originalFaceNormal ? r.__originalFaceNormal.copy(r.normal) : r.__originalFaceNormal = r.normal.clone(),
  41824. r.__originalVertexNormals || (r.__originalVertexNormals = []),
  41825. e = 0,
  41826. t = r.vertexNormals.length; e < t; e++)
  41827. r.__originalVertexNormals[e] ? r.__originalVertexNormals[e].copy(r.vertexNormals[e]) : r.__originalVertexNormals[e] = r.vertexNormals[e].clone();
  41828. var o = new Ci.Geometry;
  41829. for (o.faces = this.faces,
  41830. e = 0,
  41831. t = this.morphTargets.length; e < t; e++) {
  41832. if (!this.morphNormals[e]) {
  41833. this.morphNormals[e] = {},
  41834. this.morphNormals[e].faceNormals = [],
  41835. this.morphNormals[e].vertexNormals = [];
  41836. var a = this.morphNormals[e].faceNormals
  41837. , s = this.morphNormals[e].vertexNormals;
  41838. for (i = 0,
  41839. n = this.faces.length; i < n; i++)
  41840. l = new Ci.Vector3,
  41841. c = {
  41842. a: new Ci.Vector3,
  41843. b: new Ci.Vector3,
  41844. c: new Ci.Vector3
  41845. },
  41846. a.push(l),
  41847. s.push(c)
  41848. }
  41849. var l, c, h = this.morphNormals[e];
  41850. for (o.vertices = this.morphTargets[e].vertices,
  41851. o.computeFaceNormals(),
  41852. o.computeVertexNormals(),
  41853. i = 0,
  41854. n = this.faces.length; i < n; i++)
  41855. r = this.faces[i],
  41856. l = h.faceNormals[i],
  41857. c = h.vertexNormals[i],
  41858. l.copy(r.normal),
  41859. c.a.copy(r.vertexNormals[0]),
  41860. c.b.copy(r.vertexNormals[1]),
  41861. c.c.copy(r.vertexNormals[2])
  41862. }
  41863. for (i = 0,
  41864. n = this.faces.length; i < n; i++)
  41865. (r = this.faces[i]).normal = r.__originalFaceNormal,
  41866. r.vertexNormals = r.__originalVertexNormals
  41867. },
  41868. computeTangents: function() {
  41869. console.warn("THREE.Geometry: .computeTangents() has been removed.")
  41870. },
  41871. computeLineDistances: function() {
  41872. for (var e = 0, t = this.vertices, i = 0, n = t.length; i < n; i++)
  41873. 0 < i && (e += t[i].distanceTo(t[i - 1])),
  41874. this.lineDistances[i] = e
  41875. },
  41876. computeBoundingBox: function() {
  41877. null === this.boundingBox && (this.boundingBox = new Ci.Box3),
  41878. this.boundingBox.setFromPoints(this.vertices)
  41879. },
  41880. computeBoundingSphere: function() {
  41881. null === this.boundingSphere && (this.boundingSphere = new Ci.Sphere),
  41882. this.boundingSphere.setFromPoints(this.vertices)
  41883. },
  41884. merge: function(e, t, i) {
  41885. if (e instanceof Ci.Geometry != 0) {
  41886. 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];
  41887. void 0 === i && (i = 0),
  41888. void 0 !== t && (n = (new Ci.Matrix3).getNormalMatrix(t));
  41889. for (var u = 0, d = a.length; u < d; u++) {
  41890. var p = a[u].clone();
  41891. void 0 !== t && p.applyMatrix4(t),
  41892. o.push(p)
  41893. }
  41894. for (u = 0,
  41895. d = l.length; u < d; u++) {
  41896. var f, g, m, v = l[u], y = v.vertexNormals, A = v.vertexColors;
  41897. (f = new Ci.Face3(v.a + r,v.b + r,v.c + r)).normal.copy(v.normal),
  41898. void 0 !== n && f.normal.applyMatrix3(n).normalize();
  41899. for (var C = 0, I = y.length; C < I; C++)
  41900. g = y[C].clone(),
  41901. void 0 !== n && g.applyMatrix3(n).normalize(),
  41902. f.vertexNormals.push(g);
  41903. f.color.copy(v.color);
  41904. for (C = 0,
  41905. I = A.length; C < I; C++)
  41906. m = A[C],
  41907. f.vertexColors.push(m.clone());
  41908. f.materialIndex = v.materialIndex + i,
  41909. s.push(f)
  41910. }
  41911. for (u = 0,
  41912. d = h.length; u < d; u++) {
  41913. var E = h[u]
  41914. , _ = [];
  41915. if (void 0 !== E) {
  41916. for (C = 0,
  41917. I = E.length; C < I; C++)
  41918. _.push(E[C].clone());
  41919. c.push(_)
  41920. }
  41921. }
  41922. } else
  41923. console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.", e)
  41924. },
  41925. mergeMesh: function(e) {
  41926. return e instanceof Ci.Mesh == 0 ? void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.", e) : (e.matrixAutoUpdate && e.updateMatrix(),
  41927. void this.merge(e.geometry, e.matrix))
  41928. },
  41929. mergeVertices: function() {
  41930. var e, t, i, n, r, o, a, s, l = {}, c = [], h = [], u = Math.pow(10, 4);
  41931. for (i = 0,
  41932. n = this.vertices.length; i < n; i++)
  41933. e = this.vertices[i],
  41934. void 0 === l[t = Math.round(e.x * u) + "_" + Math.round(e.y * u) + "_" + Math.round(e.z * u)] ? (l[t] = i,
  41935. c.push(this.vertices[i]),
  41936. h[i] = c.length - 1) : h[i] = h[l[t]];
  41937. var d = [];
  41938. for (i = 0,
  41939. n = this.faces.length; i < n; i++) {
  41940. (r = this.faces[i]).a = h[r.a],
  41941. r.b = h[r.b],
  41942. r.c = h[r.c],
  41943. o = [r.a, r.b, r.c];
  41944. for (var p = 0; p < 3; p++)
  41945. if (o[p] === o[(p + 1) % 3]) {
  41946. p,
  41947. d.push(i);
  41948. break
  41949. }
  41950. }
  41951. for (i = d.length - 1; 0 <= i; i--) {
  41952. var f = d[i];
  41953. for (this.faces.splice(f, 1),
  41954. a = 0,
  41955. s = this.faceVertexUvs.length; a < s; a++)
  41956. this.faceVertexUvs[a].splice(f, 1)
  41957. }
  41958. var g = this.vertices.length - c.length;
  41959. return this.vertices = c,
  41960. g
  41961. },
  41962. sortFacesByMaterialIndex: function() {
  41963. for (var e = this.faces, t = e.length, i = 0; i < t; i++)
  41964. e[i]._id = i;
  41965. e.sort(function(e, t) {
  41966. return e.materialIndex - t.materialIndex
  41967. });
  41968. var n, r, o = this.faceVertexUvs[0], a = this.faceVertexUvs[1];
  41969. o && o.length === t && (n = []),
  41970. a && a.length === t && (r = []);
  41971. for (i = 0; i < t; i++) {
  41972. var s = e[i]._id;
  41973. n && n.push(o[s]),
  41974. r && r.push(a[s])
  41975. }
  41976. n && (this.faceVertexUvs[0] = n),
  41977. r && (this.faceVertexUvs[1] = r)
  41978. },
  41979. toJSON: function() {
  41980. function e(e, t, i) {
  41981. return i ? e | 1 << t : e & ~(1 << t)
  41982. }
  41983. function t(e) {
  41984. var t = e.x.toString() + e.y.toString() + e.z.toString();
  41985. return void 0 !== d[t] || (d[t] = u.length / 3,
  41986. u.push(e.x, e.y, e.z)),
  41987. d[t]
  41988. }
  41989. function i(e) {
  41990. var t = e.r.toString() + e.g.toString() + e.b.toString();
  41991. return void 0 !== f[t] || (f[t] = p.length,
  41992. p.push(e.getHex())),
  41993. f[t]
  41994. }
  41995. function n(e) {
  41996. var t = e.x.toString() + e.y.toString();
  41997. return void 0 !== m[t] || (m[t] = g.length / 2,
  41998. g.push(e.x, e.y)),
  41999. m[t]
  42000. }
  42001. var r = {
  42002. metadata: {
  42003. version: 4.4,
  42004. type: "Geometry",
  42005. generator: "Geometry.toJSON"
  42006. }
  42007. };
  42008. if (r.uuid = this.uuid,
  42009. r.type = this.type,
  42010. "" !== this.name && (r.name = this.name),
  42011. void 0 !== this.parameters) {
  42012. var o = this.parameters;
  42013. for (var a in o)
  42014. void 0 !== o[a] && (r[a] = o[a]);
  42015. return r
  42016. }
  42017. for (var s = [], l = 0; l < this.vertices.length; l++) {
  42018. var c = this.vertices[l];
  42019. s.push(c.x, c.y, c.z)
  42020. }
  42021. var h = []
  42022. , u = []
  42023. , d = {}
  42024. , p = []
  42025. , f = {}
  42026. , g = []
  42027. , m = {};
  42028. for (l = 0; l < this.faces.length; l++) {
  42029. var v = this.faces[l]
  42030. , y = void 0 !== this.faceVertexUvs[0][l]
  42031. , A = 0 < v.normal.length()
  42032. , C = 0 < v.vertexNormals.length
  42033. , I = 1 !== v.color.r || 1 !== v.color.g || 1 !== v.color.b
  42034. , E = 0 < v.vertexColors.length
  42035. , _ = 0;
  42036. 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),
  42037. h.push(_),
  42038. h.push(v.a, v.b, v.c),
  42039. h.push(v.materialIndex),
  42040. y) {
  42041. var b = this.faceVertexUvs[0][l];
  42042. h.push(n(b[0]), n(b[1]), n(b[2]))
  42043. }
  42044. if (A && h.push(t(v.normal)),
  42045. C) {
  42046. var w = v.vertexNormals;
  42047. h.push(t(w[0]), t(w[1]), t(w[2]))
  42048. }
  42049. if (I && h.push(i(v.color)),
  42050. E) {
  42051. var T = v.vertexColors;
  42052. h.push(i(T[0]), i(T[1]), i(T[2]))
  42053. }
  42054. }
  42055. return r.data = {},
  42056. r.data.vertices = s,
  42057. r.data.normals = u,
  42058. 0 < p.length && (r.data.colors = p),
  42059. 0 < g.length && (r.data.uvs = [g]),
  42060. r.data.faces = h,
  42061. r
  42062. },
  42063. clone: function() {
  42064. return (new Ci.Geometry).copy(this)
  42065. },
  42066. copy: function(e) {
  42067. this.vertices = [],
  42068. this.faces = [],
  42069. this.faceVertexUvs = [[]];
  42070. for (var t = e.vertices, i = 0, n = t.length; i < n; i++)
  42071. this.vertices.push(t[i].clone());
  42072. var r = e.faces;
  42073. for (i = 0,
  42074. n = r.length; i < n; i++)
  42075. this.faces.push(r[i].clone());
  42076. for (i = 0,
  42077. n = e.faceVertexUvs.length; i < n; i++) {
  42078. var o = e.faceVertexUvs[i];
  42079. void 0 === this.faceVertexUvs[i] && (this.faceVertexUvs[i] = []);
  42080. for (var a = 0, s = o.length; a < s; a++) {
  42081. for (var l = o[a], c = [], h = 0, u = l.length; h < u; h++) {
  42082. var d = l[h];
  42083. c.push(d.clone())
  42084. }
  42085. this.faceVertexUvs[i].push(c)
  42086. }
  42087. }
  42088. return this
  42089. },
  42090. dispose: function() {
  42091. this.dispatchEvent({
  42092. type: "dispose"
  42093. })
  42094. }
  42095. },
  42096. Ci.EventDispatcher.prototype.apply(Ci.Geometry.prototype),
  42097. Ci.GeometryIdCount = 0,
  42098. Ci.DirectGeometry = function() {
  42099. Object.defineProperty(this, "id", {
  42100. value: Ci.GeometryIdCount++
  42101. }),
  42102. this.uuid = Ci.Math.generateUUID(),
  42103. this.name = "",
  42104. this.type = "DirectGeometry",
  42105. this.indices = [],
  42106. this.vertices = [],
  42107. this.normals = [],
  42108. this.colors = [],
  42109. this.uvs = [],
  42110. this.uvs2 = [],
  42111. this.groups = [],
  42112. this.morphTargets = {},
  42113. this.skinWeights = [],
  42114. this.skinIndices = [],
  42115. this.boundingBox = null,
  42116. this.boundingSphere = null,
  42117. this.verticesNeedUpdate = !1,
  42118. this.normalsNeedUpdate = !1,
  42119. this.colorsNeedUpdate = !1,
  42120. this.uvsNeedUpdate = !1,
  42121. this.groupsNeedUpdate = !1
  42122. }
  42123. ,
  42124. Ci.DirectGeometry.prototype = {
  42125. constructor: Ci.DirectGeometry,
  42126. computeBoundingBox: Ci.Geometry.prototype.computeBoundingBox,
  42127. computeBoundingSphere: Ci.Geometry.prototype.computeBoundingSphere,
  42128. computeFaceNormals: function() {
  42129. console.warn("THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.")
  42130. },
  42131. computeVertexNormals: function() {
  42132. console.warn("THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.")
  42133. },
  42134. computeGroups: function(e) {
  42135. for (var t, i, n = [], r = e.faces, o = 0; o < r.length; o++) {
  42136. var a = r[o];
  42137. a.materialIndex !== i && (i = a.materialIndex,
  42138. void 0 !== t && (t.count = 3 * o - t.start,
  42139. n.push(t)),
  42140. t = {
  42141. start: 3 * o,
  42142. materialIndex: i
  42143. })
  42144. }
  42145. void 0 !== t && (t.count = 3 * o - t.start,
  42146. n.push(t)),
  42147. this.groups = n
  42148. },
  42149. fromGeometry: function(e) {
  42150. 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;
  42151. if (0 < l) {
  42152. t = [];
  42153. for (var c = 0; c < l; c++)
  42154. t[c] = [];
  42155. this.morphTargets.position = t
  42156. }
  42157. var h, u = e.morphNormals, d = u.length;
  42158. if (0 < d) {
  42159. h = [];
  42160. for (c = 0; c < d; c++)
  42161. h[c] = [];
  42162. this.morphTargets.normal = h
  42163. }
  42164. var p = e.skinIndices
  42165. , f = e.skinWeights
  42166. , g = p.length === n.length
  42167. , m = f.length === n.length;
  42168. for (c = 0; c < i.length; c++) {
  42169. var v = i[c];
  42170. this.vertices.push(n[v.a], n[v.b], n[v.c]);
  42171. var y = v.vertexNormals;
  42172. if (3 === y.length)
  42173. this.normals.push(y[0], y[1], y[2]);
  42174. else {
  42175. var A = v.normal;
  42176. this.normals.push(A, A, A)
  42177. }
  42178. var C, I = v.vertexColors;
  42179. if (3 === I.length)
  42180. this.colors.push(I[0], I[1], I[2]);
  42181. else {
  42182. var E = v.color;
  42183. this.colors.push(E, E, E)
  42184. }
  42185. if (!0 === o)
  42186. void 0 !== (C = r[0][c]) ? this.uvs.push(C[0], C[1], C[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ", c),
  42187. this.uvs.push(new Ci.Vector2, new Ci.Vector2, new Ci.Vector2));
  42188. if (!0 === a)
  42189. void 0 !== (C = r[1][c]) ? this.uvs2.push(C[0], C[1], C[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ", c),
  42190. this.uvs2.push(new Ci.Vector2, new Ci.Vector2, new Ci.Vector2));
  42191. for (var _ = 0; _ < l; _++) {
  42192. var b = s[_].vertices;
  42193. t[_].push(b[v.a], b[v.b], b[v.c])
  42194. }
  42195. for (_ = 0; _ < d; _++) {
  42196. var w = u[_].vertexNormals[c];
  42197. h[_].push(w.a, w.b, w.c)
  42198. }
  42199. g && this.skinIndices.push(p[v.a], p[v.b], p[v.c]),
  42200. m && this.skinWeights.push(f[v.a], f[v.b], f[v.c])
  42201. }
  42202. return this.computeGroups(e),
  42203. this.verticesNeedUpdate = e.verticesNeedUpdate,
  42204. this.normalsNeedUpdate = e.normalsNeedUpdate,
  42205. this.colorsNeedUpdate = e.colorsNeedUpdate,
  42206. this.uvsNeedUpdate = e.uvsNeedUpdate,
  42207. this.groupsNeedUpdate = e.groupsNeedUpdate,
  42208. this
  42209. },
  42210. dispose: function() {
  42211. this.dispatchEvent({
  42212. type: "dispose"
  42213. })
  42214. }
  42215. },
  42216. Ci.EventDispatcher.prototype.apply(Ci.DirectGeometry.prototype),
  42217. Ci.BufferGeometry = function() {
  42218. Object.defineProperty(this, "id", {
  42219. value: Ci.GeometryIdCount++
  42220. }),
  42221. this.uuid = Ci.Math.generateUUID(),
  42222. this.name = "",
  42223. this.type = "BufferGeometry",
  42224. this.index = null,
  42225. this.attributes = {},
  42226. this.morphAttributes = {},
  42227. this.groups = [],
  42228. this.boundingBox = null,
  42229. this.boundingSphere = null,
  42230. this.drawRange = {
  42231. start: 0,
  42232. count: 1 / 0
  42233. }
  42234. }
  42235. ,
  42236. Ci.BufferGeometry.prototype = {
  42237. constructor: Ci.BufferGeometry,
  42238. getIndex: function() {
  42239. return this.index
  42240. },
  42241. setIndex: function(e) {
  42242. this.index = e
  42243. },
  42244. addAttribute: function(e, t) {
  42245. return t instanceof Ci.BufferAttribute == 0 && t instanceof Ci.InterleavedBufferAttribute == 0 ? (console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),
  42246. void this.addAttribute(e, new Ci.BufferAttribute(t,arguments[2]))) : "index" === e ? (console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),
  42247. void this.setIndex(t)) : (this.attributes[e] = t,
  42248. this)
  42249. },
  42250. getAttribute: function(e) {
  42251. return this.attributes[e]
  42252. },
  42253. removeAttribute: function(e) {
  42254. return delete this.attributes[e],
  42255. this
  42256. },
  42257. addGroup: function(e, t, i) {
  42258. this.groups.push({
  42259. start: e,
  42260. count: t,
  42261. materialIndex: void 0 !== i ? i : 0
  42262. })
  42263. },
  42264. clearGroups: function() {
  42265. this.groups = []
  42266. },
  42267. setDrawRange: function(e, t) {
  42268. this.drawRange.start = e,
  42269. this.drawRange.count = t
  42270. },
  42271. applyMatrix: function(e) {
  42272. var t = this.attributes.position;
  42273. void 0 !== t && (e.applyToVector3Array(t.array),
  42274. t.needsUpdate = !0);
  42275. var i = this.attributes.normal;
  42276. void 0 !== i && ((new Ci.Matrix3).getNormalMatrix(e).applyToVector3Array(i.array),
  42277. i.needsUpdate = !0);
  42278. return null !== this.boundingBox && this.computeBoundingBox(),
  42279. null !== this.boundingSphere && this.computeBoundingSphere(),
  42280. this
  42281. },
  42282. rotateX: function(e) {
  42283. return void 0 === ht && (ht = new Ci.Matrix4),
  42284. ht.makeRotationX(e),
  42285. this.applyMatrix(ht),
  42286. this
  42287. },
  42288. rotateY: function(e) {
  42289. return void 0 === ct && (ct = new Ci.Matrix4),
  42290. ct.makeRotationY(e),
  42291. this.applyMatrix(ct),
  42292. this
  42293. },
  42294. rotateZ: function(e) {
  42295. return void 0 === lt && (lt = new Ci.Matrix4),
  42296. lt.makeRotationZ(e),
  42297. this.applyMatrix(lt),
  42298. this
  42299. },
  42300. translate: function(e, t, i) {
  42301. return void 0 === st && (st = new Ci.Matrix4),
  42302. st.makeTranslation(e, t, i),
  42303. this.applyMatrix(st),
  42304. this
  42305. },
  42306. scale: function(e, t, i) {
  42307. return void 0 === at && (at = new Ci.Matrix4),
  42308. at.makeScale(e, t, i),
  42309. this.applyMatrix(at),
  42310. this
  42311. },
  42312. lookAt: function(e) {
  42313. void 0 === ot && (ot = new Ci.Object3D),
  42314. ot.lookAt(e),
  42315. ot.updateMatrix(),
  42316. this.applyMatrix(ot.matrix)
  42317. },
  42318. center: function() {
  42319. this.computeBoundingBox();
  42320. var e = this.boundingBox.center().negate();
  42321. return this.translate(e.x, e.y, e.z),
  42322. e
  42323. },
  42324. setFromObject: function(e) {
  42325. var t = e.geometry;
  42326. if (e instanceof Ci.Points || e instanceof Ci.Line) {
  42327. var i = new Ci.Float32Attribute(3 * t.vertices.length,3)
  42328. , n = new Ci.Float32Attribute(3 * t.colors.length,3);
  42329. if (this.addAttribute("position", i.copyVector3sArray(t.vertices)),
  42330. this.addAttribute("color", n.copyColorsArray(t.colors)),
  42331. t.lineDistances && t.lineDistances.length === t.vertices.length) {
  42332. var r = new Ci.Float32Attribute(t.lineDistances.length,1);
  42333. this.addAttribute("lineDistance", r.copyArray(t.lineDistances))
  42334. }
  42335. null !== t.boundingSphere && (this.boundingSphere = t.boundingSphere.clone()),
  42336. null !== t.boundingBox && (this.boundingBox = t.boundingBox.clone())
  42337. } else
  42338. e instanceof Ci.Mesh && t instanceof Ci.Geometry && this.fromGeometry(t);
  42339. return this
  42340. },
  42341. updateFromObject: function(e) {
  42342. var t, i = e.geometry;
  42343. if (e instanceof Ci.Mesh) {
  42344. var n = i.__directGeometry;
  42345. if (void 0 === n)
  42346. return this.fromGeometry(i);
  42347. n.verticesNeedUpdate = i.verticesNeedUpdate,
  42348. n.normalsNeedUpdate = i.normalsNeedUpdate,
  42349. n.colorsNeedUpdate = i.colorsNeedUpdate,
  42350. n.uvsNeedUpdate = i.uvsNeedUpdate,
  42351. n.groupsNeedUpdate = i.groupsNeedUpdate,
  42352. i.verticesNeedUpdate = !1,
  42353. i.normalsNeedUpdate = !1,
  42354. i.colorsNeedUpdate = !1,
  42355. i.uvsNeedUpdate = !1,
  42356. i.groupsNeedUpdate = !1,
  42357. i = n
  42358. }
  42359. !0 === i.verticesNeedUpdate && (void 0 !== (t = this.attributes.position) && (t.copyVector3sArray(i.vertices),
  42360. t.needsUpdate = !0),
  42361. i.verticesNeedUpdate = !1);
  42362. !0 === i.normalsNeedUpdate && (void 0 !== (t = this.attributes.normal) && (t.copyVector3sArray(i.normals),
  42363. t.needsUpdate = !0),
  42364. i.normalsNeedUpdate = !1);
  42365. !0 === i.colorsNeedUpdate && (void 0 !== (t = this.attributes.color) && (t.copyColorsArray(i.colors),
  42366. t.needsUpdate = !0),
  42367. i.colorsNeedUpdate = !1);
  42368. i.uvsNeedUpdate && (void 0 !== (t = this.attributes.uv) && (t.copyVector2sArray(i.uvs),
  42369. t.needsUpdate = !0),
  42370. i.uvsNeedUpdate = !1);
  42371. i.lineDistancesNeedUpdate && (void 0 !== (t = this.attributes.lineDistance) && (t.copyArray(i.lineDistances),
  42372. t.needsUpdate = !0),
  42373. i.lineDistancesNeedUpdate = !1);
  42374. return i.groupsNeedUpdate && (i.computeGroups(e.geometry),
  42375. this.groups = i.groups,
  42376. i.groupsNeedUpdate = !1),
  42377. this
  42378. },
  42379. fromGeometry: function(e) {
  42380. return e.__directGeometry = (new Ci.DirectGeometry).fromGeometry(e),
  42381. this.fromDirectGeometry(e.__directGeometry)
  42382. },
  42383. fromDirectGeometry: function(e) {
  42384. var t = new Float32Array(3 * e.vertices.length);
  42385. if (this.addAttribute("position", new Ci.BufferAttribute(t,3).copyVector3sArray(e.vertices)),
  42386. 0 < e.normals.length) {
  42387. var i = new Float32Array(3 * e.normals.length);
  42388. this.addAttribute("normal", new Ci.BufferAttribute(i,3).copyVector3sArray(e.normals))
  42389. }
  42390. if (0 < e.colors.length) {
  42391. var n = new Float32Array(3 * e.colors.length);
  42392. this.addAttribute("color", new Ci.BufferAttribute(n,3).copyColorsArray(e.colors))
  42393. }
  42394. if (0 < e.uvs.length) {
  42395. var r = new Float32Array(2 * e.uvs.length);
  42396. this.addAttribute("uv", new Ci.BufferAttribute(r,2).copyVector2sArray(e.uvs))
  42397. }
  42398. if (0 < e.uvs2.length) {
  42399. var o = new Float32Array(2 * e.uvs2.length);
  42400. this.addAttribute("uv2", new Ci.BufferAttribute(o,2).copyVector2sArray(e.uvs2))
  42401. }
  42402. if (0 < e.indices.length) {
  42403. var a = new (65535 < e.vertices.length ? Uint32Array : Uint16Array)(3 * e.indices.length);
  42404. this.setIndex(new Ci.BufferAttribute(a,1).copyIndicesArray(e.indices))
  42405. }
  42406. for (var s in this.groups = e.groups,
  42407. e.morphTargets) {
  42408. for (var l = [], c = e.morphTargets[s], h = 0, u = c.length; h < u; h++) {
  42409. var d = c[h]
  42410. , p = new Ci.Float32Attribute(3 * d.length,3);
  42411. l.push(p.copyVector3sArray(d))
  42412. }
  42413. this.morphAttributes[s] = l
  42414. }
  42415. if (0 < e.skinIndices.length) {
  42416. var f = new Ci.Float32Attribute(4 * e.skinIndices.length,4);
  42417. this.addAttribute("skinIndex", f.copyVector4sArray(e.skinIndices))
  42418. }
  42419. if (0 < e.skinWeights.length) {
  42420. var g = new Ci.Float32Attribute(4 * e.skinWeights.length,4);
  42421. this.addAttribute("skinWeight", g.copyVector4sArray(e.skinWeights))
  42422. }
  42423. return null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  42424. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  42425. this
  42426. },
  42427. computeBoundingBox: (new Ci.Vector3,
  42428. function() {
  42429. null === this.boundingBox && (this.boundingBox = new Ci.Box3);
  42430. var e = this.attributes.position.array;
  42431. e && this.boundingBox.setFromArray(e),
  42432. void 0 !== e && 0 !== e.length || (this.boundingBox.min.set(0, 0, 0),
  42433. this.boundingBox.max.set(0, 0, 0)),
  42434. (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)
  42435. }
  42436. ),
  42437. computeBoundingSphere: (nt = new Ci.Box3,
  42438. rt = new Ci.Vector3,
  42439. function() {
  42440. null === this.boundingSphere && (this.boundingSphere = new Ci.Sphere);
  42441. var e = this.attributes.position.array;
  42442. if (e) {
  42443. var t = this.boundingSphere.center;
  42444. nt.setFromArray(e),
  42445. nt.center(t);
  42446. for (var i = 0, n = 0, r = e.length; n < r; n += 3)
  42447. rt.fromArray(e, n),
  42448. i = Math.max(i, t.distanceToSquared(rt));
  42449. this.boundingSphere.radius = Math.sqrt(i),
  42450. isNaN(this.boundingSphere.radius) && console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this)
  42451. }
  42452. }
  42453. ),
  42454. computeFaceNormals: function() {},
  42455. computeVertexNormals: function() {
  42456. var e = this.index
  42457. , t = this.attributes
  42458. , i = this.groups;
  42459. if (t.position) {
  42460. var n = t.position.array;
  42461. if (void 0 === t.normal)
  42462. this.addAttribute("normal", new Ci.BufferAttribute(new Float32Array(n.length),3));
  42463. else
  42464. for (var r = t.normal.array, o = 0, a = r.length; o < a; o++)
  42465. r[o] = 0;
  42466. 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;
  42467. if (e) {
  42468. var m = e.array;
  42469. 0 === i.length && this.addGroup(0, m.length);
  42470. for (var v = 0, y = i.length; v < y; ++v) {
  42471. var A = i[v]
  42472. , C = A.start;
  42473. for (o = C,
  42474. a = C + A.count; o < a; o += 3)
  42475. s = 3 * m[o + 0],
  42476. l = 3 * m[o + 1],
  42477. c = 3 * m[o + 2],
  42478. u.fromArray(n, s),
  42479. d.fromArray(n, l),
  42480. p.fromArray(n, c),
  42481. f.subVectors(p, d),
  42482. g.subVectors(u, d),
  42483. f.cross(g),
  42484. h[s] += f.x,
  42485. h[1 + s] += f.y,
  42486. h[2 + s] += f.z,
  42487. h[l] += f.x,
  42488. h[1 + l] += f.y,
  42489. h[2 + l] += f.z,
  42490. h[c] += f.x,
  42491. h[1 + c] += f.y,
  42492. h[2 + c] += f.z
  42493. }
  42494. } else
  42495. for (o = 0,
  42496. a = n.length; o < a; o += 9)
  42497. u.fromArray(n, o),
  42498. d.fromArray(n, o + 3),
  42499. p.fromArray(n, o + 6),
  42500. f.subVectors(p, d),
  42501. g.subVectors(u, d),
  42502. f.cross(g),
  42503. h[o] = f.x,
  42504. h[o + 1] = f.y,
  42505. h[o + 2] = f.z,
  42506. h[o + 3] = f.x,
  42507. h[o + 4] = f.y,
  42508. h[o + 5] = f.z,
  42509. h[o + 6] = f.x,
  42510. h[o + 7] = f.y,
  42511. h[o + 8] = f.z;
  42512. this.normalizeNormals(),
  42513. t.normal.needsUpdate = !0
  42514. }
  42515. },
  42516. merge: function(e, t) {
  42517. if (e instanceof Ci.BufferGeometry != 0) {
  42518. void 0 === t && (t = 0);
  42519. var i = this.attributes;
  42520. for (var n in i)
  42521. if (void 0 !== e.attributes[n])
  42522. for (var r = i[n].array, o = e.attributes[n], a = o.array, s = 0, l = o.itemSize * t; s < a.length; s++,
  42523. l++)
  42524. r[l] = a[s];
  42525. return this
  42526. }
  42527. console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.", e)
  42528. },
  42529. normalizeNormals: function() {
  42530. for (var e, t, i, n, r = this.attributes.normal.array, o = 0, a = r.length; o < a; o += 3)
  42531. e = r[o],
  42532. t = r[o + 1],
  42533. i = r[o + 2],
  42534. n = 1 / Math.sqrt(e * e + t * t + i * i),
  42535. r[o] *= n,
  42536. r[o + 1] *= n,
  42537. r[o + 2] *= n
  42538. },
  42539. toNonIndexed: function() {
  42540. if (null === this.index)
  42541. return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),
  42542. this;
  42543. var e = new Ci.BufferGeometry
  42544. , t = this.index.array
  42545. , i = this.attributes;
  42546. for (var n in i) {
  42547. 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++) {
  42548. l = t[h] * a;
  42549. for (var d = 0; d < a; d++)
  42550. s[c++] = o[l++]
  42551. }
  42552. e.addAttribute(n, new Ci.BufferAttribute(s,a))
  42553. }
  42554. return e
  42555. },
  42556. toJSON: function() {
  42557. var e = {
  42558. metadata: {
  42559. version: 4.4,
  42560. type: "BufferGeometry",
  42561. generator: "BufferGeometry.toJSON"
  42562. }
  42563. };
  42564. if (e.uuid = this.uuid,
  42565. e.type = this.type,
  42566. "" !== this.name && (e.name = this.name),
  42567. void 0 !== this.parameters) {
  42568. var t = this.parameters;
  42569. for (var i in t)
  42570. void 0 !== t[i] && (e[i] = t[i]);
  42571. return e
  42572. }
  42573. e.data = {
  42574. attributes: {}
  42575. };
  42576. var n = this.index;
  42577. if (null !== n) {
  42578. var r = Array.prototype.slice.call(n.array);
  42579. e.data.index = {
  42580. type: n.array.constructor.name,
  42581. array: r
  42582. }
  42583. }
  42584. var o = this.attributes;
  42585. for (var i in o) {
  42586. var a = o[i];
  42587. r = Array.prototype.slice.call(a.array);
  42588. e.data.attributes[i] = {
  42589. itemSize: a.itemSize,
  42590. type: a.array.constructor.name,
  42591. array: r
  42592. }
  42593. }
  42594. var s = this.groups;
  42595. 0 < s.length && (e.data.groups = JSON.parse(JSON.stringify(s)));
  42596. var l = this.boundingSphere;
  42597. return null !== l && (e.data.boundingSphere = {
  42598. center: l.center.toArray(),
  42599. radius: l.radius
  42600. }),
  42601. e
  42602. },
  42603. clone: function() {
  42604. return (new Ci.BufferGeometry).copy(this)
  42605. },
  42606. copy: function(e) {
  42607. var t = e.index;
  42608. null !== t && this.setIndex(t.clone());
  42609. var i = e.attributes;
  42610. for (var n in i) {
  42611. var r = i[n];
  42612. this.addAttribute(n, r.clone())
  42613. }
  42614. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  42615. var l = o[a];
  42616. this.addGroup(l.start, l.count)
  42617. }
  42618. return this
  42619. },
  42620. dispose: function() {
  42621. this.dispatchEvent({
  42622. type: "dispose"
  42623. })
  42624. }
  42625. },
  42626. Ci.EventDispatcher.prototype.apply(Ci.BufferGeometry.prototype),
  42627. Ci.BufferGeometry.MaxIndex = 65535,
  42628. Ci.InstancedBufferGeometry = function() {
  42629. Ci.BufferGeometry.call(this),
  42630. this.type = "InstancedBufferGeometry",
  42631. this.maxInstancedCount = void 0
  42632. }
  42633. ,
  42634. Ci.InstancedBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  42635. Ci.InstancedBufferGeometry.prototype.constructor = Ci.InstancedBufferGeometry,
  42636. Ci.InstancedBufferGeometry.prototype.addGroup = function(e, t, i) {
  42637. this.groups.push({
  42638. start: e,
  42639. count: t,
  42640. instances: i
  42641. })
  42642. }
  42643. ,
  42644. Ci.InstancedBufferGeometry.prototype.copy = function(e) {
  42645. var t = e.index;
  42646. null !== t && this.setIndex(t.clone());
  42647. var i = e.attributes;
  42648. for (var n in i) {
  42649. var r = i[n];
  42650. this.addAttribute(n, r.clone())
  42651. }
  42652. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  42653. var l = o[a];
  42654. this.addGroup(l.start, l.count, l.instances)
  42655. }
  42656. return this
  42657. }
  42658. ,
  42659. Ci.EventDispatcher.prototype.apply(Ci.InstancedBufferGeometry.prototype),
  42660. Ci.Uniform = function(e, t) {
  42661. this.type = e,
  42662. this.value = t,
  42663. this.dynamic = !1
  42664. }
  42665. ,
  42666. Ci.Uniform.prototype = {
  42667. constructor: Ci.Uniform,
  42668. onUpdate: function(e) {
  42669. return this.dynamic = !0,
  42670. this.onUpdateCallback = e,
  42671. this
  42672. }
  42673. },
  42674. Ci.AnimationClip = function(e, t, i) {
  42675. this.name = e || Ci.Math.generateUUID(),
  42676. this.tracks = i,
  42677. this.duration = void 0 !== t ? t : -1,
  42678. this.duration < 0 && this.resetDuration(),
  42679. this.trim(),
  42680. this.optimize()
  42681. }
  42682. ,
  42683. Ci.AnimationClip.prototype = {
  42684. constructor: Ci.AnimationClip,
  42685. resetDuration: function() {
  42686. for (var e = 0, t = 0, i = this.tracks.length; t !== i; ++t) {
  42687. var n = this.tracks[t];
  42688. e = Math.max(e, n.times[n.times.length - 1])
  42689. }
  42690. this.duration = e
  42691. },
  42692. trim: function() {
  42693. for (var e = 0; e < this.tracks.length; e++)
  42694. this.tracks[e].trim(0, this.duration);
  42695. return this
  42696. },
  42697. optimize: function() {
  42698. for (var e = 0; e < this.tracks.length; e++)
  42699. this.tracks[e].optimize();
  42700. return this
  42701. }
  42702. },
  42703. Object.assign(Ci.AnimationClip, {
  42704. parse: function(e) {
  42705. for (var t = [], i = e.tracks, n = 1 / (e.fps || 1), r = 0, o = i.length; r !== o; ++r)
  42706. t.push(Ci.KeyframeTrack.parse(i[r]).scale(n));
  42707. return new Ci.AnimationClip(e.name,e.duration,t)
  42708. },
  42709. toJSON: function(e) {
  42710. for (var t = [], i = e.tracks, n = {
  42711. name: e.name,
  42712. duration: e.duration,
  42713. tracks: t
  42714. }, r = 0, o = i.length; r !== o; ++r)
  42715. t.push(Ci.KeyframeTrack.toJSON(i[r]));
  42716. return n
  42717. },
  42718. CreateFromMorphTargetSequence: function(e, t, i) {
  42719. for (var n = t.length, r = [], o = 0; o < n; o++) {
  42720. var a = []
  42721. , s = [];
  42722. a.push((o + n - 1) % n, o, (o + 1) % n),
  42723. s.push(0, 1, 0);
  42724. var l = Ci.AnimationUtils.getKeyframeOrder(a);
  42725. a = Ci.AnimationUtils.sortedArray(a, 1, l),
  42726. s = Ci.AnimationUtils.sortedArray(s, 1, l),
  42727. 0 === a[0] && (a.push(n),
  42728. s.push(s[0])),
  42729. r.push(new Ci.NumberKeyframeTrack(".morphTargetInfluences[" + t[o].name + "]",a,s).scale(1 / i))
  42730. }
  42731. return new Ci.AnimationClip(e,-1,r)
  42732. },
  42733. findByName: function(e, t) {
  42734. for (var i = 0; i < e.length; i++)
  42735. if (e[i].name === t)
  42736. return e[i];
  42737. return null
  42738. },
  42739. CreateClipsFromMorphTargetSequences: function(e, t) {
  42740. for (var i = {}, n = /^([\w-]*?)([\d]+)$/, r = 0, o = e.length; r < o; r++) {
  42741. var a = e[r]
  42742. , s = a.name.match(n);
  42743. if (s && 1 < s.length) {
  42744. var l = i[h = s[1]];
  42745. l || (i[h] = l = []),
  42746. l.push(a)
  42747. }
  42748. }
  42749. var c = [];
  42750. for (var h in i)
  42751. c.push(Ci.AnimationClip.CreateFromMorphTargetSequence(h, i[h], t));
  42752. return c
  42753. },
  42754. parseAnimation: function(e, t, i) {
  42755. if (!e)
  42756. return console.error(" no animation in JSONLoader data"),
  42757. null;
  42758. function n(e, t, i, n, r) {
  42759. if (0 !== i.length) {
  42760. var o = []
  42761. , a = [];
  42762. Ci.AnimationUtils.flattenJSON(i, o, a, n),
  42763. 0 !== o.length && r.push(new e(t,o,a))
  42764. }
  42765. }
  42766. for (var r = [], o = e.name || "default", a = e.length || -1, s = e.fps || 30, l = e.hierarchy || [], c = 0; c < l.length; c++) {
  42767. var h = l[c].keys;
  42768. if (h && 0 != h.length)
  42769. if (h[0].morphTargets) {
  42770. for (var u = {}, d = 0; d < h.length; d++)
  42771. if (h[d].morphTargets)
  42772. for (var p = 0; p < h[d].morphTargets.length; p++)
  42773. u[h[d].morphTargets[p]] = -1;
  42774. for (var f in u) {
  42775. var g = []
  42776. , m = [];
  42777. for (p = 0; p !== h[d].morphTargets.length; ++p) {
  42778. var v = h[d];
  42779. g.push(v.time),
  42780. m.push(v.morphTarget === f ? 1 : 0)
  42781. }
  42782. r.push(new Ci.NumberKeyframeTrack(".morphTargetInfluence[" + f + "]",g,m))
  42783. }
  42784. a = u.length * (s || 1)
  42785. } else {
  42786. var y = ".bones[" + t[c].name + "]";
  42787. n(Ci.VectorKeyframeTrack, y + ".position", h, "pos", r),
  42788. n(Ci.QuaternionKeyframeTrack, y + ".quaternion", h, "rot", r),
  42789. n(Ci.VectorKeyframeTrack, y + ".scale", h, "scl", r)
  42790. }
  42791. }
  42792. return 0 === r.length ? null : new Ci.AnimationClip(o,a,r)
  42793. }
  42794. }),
  42795. Ci.AnimationMixer = function(e) {
  42796. this._root = e,
  42797. this._initMemoryManager(),
  42798. this._accuIndex = 0,
  42799. this.time = 0,
  42800. this.timeScale = 1
  42801. }
  42802. ,
  42803. Ci.AnimationMixer.prototype = {
  42804. constructor: Ci.AnimationMixer,
  42805. clipAction: function(e, t) {
  42806. var i, n = (t || this._root).uuid, r = "string" == typeof e ? e : e.name, o = e !== r ? e : null, a = this._actionsByClip[r];
  42807. if (void 0 !== a) {
  42808. var s = a.actionByRoot[n];
  42809. if (void 0 !== s)
  42810. return s;
  42811. if (o = (i = a.knownActions[0])._clip,
  42812. e !== r && e !== o)
  42813. throw new Error("Different clips with the same name detected!")
  42814. }
  42815. if (null === o)
  42816. return null;
  42817. var l = new Ci.AnimationMixer._Action(this,o,t);
  42818. return this._bindAction(l, i),
  42819. this._addInactiveAction(l, r, n),
  42820. l
  42821. },
  42822. existingAction: function(e, t) {
  42823. var i = (t || this._root).uuid
  42824. , n = "string" == typeof e ? e : e.name
  42825. , r = this._actionsByClip[n];
  42826. return void 0 !== r && r.actionByRoot[i] || null
  42827. },
  42828. stopAllAction: function() {
  42829. var e = this._actions
  42830. , t = this._nActiveActions
  42831. , i = this._bindings
  42832. , n = this._nActiveBindings;
  42833. this._nActiveActions = 0;
  42834. for (var r = this._nActiveBindings = 0; r !== t; ++r)
  42835. e[r].reset();
  42836. for (r = 0; r !== n; ++r)
  42837. i[r].useCount = 0;
  42838. return this
  42839. },
  42840. update: function(e) {
  42841. e *= this.timeScale;
  42842. 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) {
  42843. var s = t[a];
  42844. s.enabled && s._update(n, e, r, o)
  42845. }
  42846. var l = this._bindings
  42847. , c = this._nActiveBindings;
  42848. for (a = 0; a !== c; ++a)
  42849. l[a].apply(o);
  42850. return this
  42851. },
  42852. getRoot: function() {
  42853. return this._root
  42854. },
  42855. uncacheClip: function(e) {
  42856. var t = this._actions
  42857. , i = e.name
  42858. , n = this._actionsByClip
  42859. , r = n[i];
  42860. if (void 0 !== r) {
  42861. for (var o = r.knownActions, a = 0, s = o.length; a !== s; ++a) {
  42862. var l = o[a];
  42863. this._deactivateAction(l);
  42864. var c = l._cacheIndex
  42865. , h = t[t.length - 1];
  42866. l._cacheIndex = null,
  42867. l._byClipCacheIndex = null,
  42868. t[h._cacheIndex = c] = h,
  42869. t.pop(),
  42870. this._removeInactiveBindingsForAction(l)
  42871. }
  42872. delete n[i]
  42873. }
  42874. },
  42875. uncacheRoot: function(e) {
  42876. var t = e.uuid
  42877. , i = this._actionsByClip;
  42878. for (var n in i) {
  42879. var r = i[n].actionByRoot[t];
  42880. void 0 !== r && (this._deactivateAction(r),
  42881. this._removeInactiveAction(r))
  42882. }
  42883. var o = this._bindingsByRootAndName[t];
  42884. if (void 0 !== o)
  42885. for (var a in o) {
  42886. var s = o[a];
  42887. s.restoreOriginalState(),
  42888. this._removeInactiveBinding(s)
  42889. }
  42890. },
  42891. uncacheAction: function(e, t) {
  42892. var i = this.existingAction(e, t);
  42893. null !== i && (this._deactivateAction(i),
  42894. this._removeInactiveAction(i))
  42895. }
  42896. },
  42897. Ci.EventDispatcher.prototype.apply(Ci.AnimationMixer.prototype),
  42898. Ci.AnimationMixer._Action = function(e, t, i) {
  42899. this._mixer = e,
  42900. this._clip = t,
  42901. this._localRoot = i || null;
  42902. for (var n = t.tracks, r = n.length, o = new Array(r), a = {
  42903. endingStart: Ci.ZeroCurvatureEnding,
  42904. endingEnd: Ci.ZeroCurvatureEnding
  42905. }, s = 0; s !== r; ++s) {
  42906. var l = n[s].createInterpolant(null);
  42907. (o[s] = l).settings = a
  42908. }
  42909. this._interpolantSettings = a,
  42910. this._interpolants = o,
  42911. this._propertyBindings = new Array(r),
  42912. this._cacheIndex = null,
  42913. this._byClipCacheIndex = null,
  42914. this._timeScaleInterpolant = null,
  42915. this._weightInterpolant = null,
  42916. this.loop = Ci.LoopRepeat,
  42917. this._loopCount = -1,
  42918. this._startTime = null,
  42919. this.time = 0,
  42920. this.timeScale = 1,
  42921. this._effectiveTimeScale = 1,
  42922. this.weight = 1,
  42923. this._effectiveWeight = 1,
  42924. this.repetitions = 1 / 0,
  42925. this.paused = !1,
  42926. this.enabled = !0,
  42927. this.clampWhenFinished = !1,
  42928. this.zeroSlopeAtStart = !0,
  42929. this.zeroSlopeAtEnd = !0
  42930. }
  42931. ,
  42932. Ci.AnimationMixer._Action.prototype = {
  42933. constructor: Ci.AnimationMixer._Action,
  42934. play: function() {
  42935. return this._mixer._activateAction(this),
  42936. this
  42937. },
  42938. stop: function() {
  42939. return this._mixer._deactivateAction(this),
  42940. this.reset()
  42941. },
  42942. reset: function() {
  42943. return this.paused = !1,
  42944. this.enabled = !0,
  42945. this.time = 0,
  42946. this._loopCount = -1,
  42947. this._startTime = null,
  42948. this.stopFading().stopWarping()
  42949. },
  42950. isRunning: function() {
  42951. return this._startTime,
  42952. this.enabled && !this.paused && 0 !== this.timeScale && null === this._startTime && this._mixer._isActiveAction(this)
  42953. },
  42954. isScheduled: function() {
  42955. return this._mixer._isActiveAction(this)
  42956. },
  42957. startAt: function(e) {
  42958. return this._startTime = e,
  42959. this
  42960. },
  42961. setLoop: function(e, t) {
  42962. return this.loop = e,
  42963. this.repetitions = t,
  42964. this
  42965. },
  42966. setEffectiveWeight: function(e) {
  42967. return this.weight = e,
  42968. this._effectiveWeight = this.enabled ? e : 0,
  42969. this.stopFading()
  42970. },
  42971. getEffectiveWeight: function() {
  42972. return this._effectiveWeight
  42973. },
  42974. fadeIn: function(e) {
  42975. return this._scheduleFading(e, 0, 1)
  42976. },
  42977. fadeOut: function(e) {
  42978. return this._scheduleFading(e, 1, 0)
  42979. },
  42980. crossFadeFrom: function(e, t, i) {
  42981. if (this._mixer,
  42982. e.fadeOut(t),
  42983. this.fadeIn(t),
  42984. i) {
  42985. var n = this._clip.duration
  42986. , r = e._clip.duration
  42987. , o = r / n
  42988. , a = n / r;
  42989. e.warp(1, o, t),
  42990. this.warp(a, 1, t)
  42991. }
  42992. return this
  42993. },
  42994. crossFadeTo: function(e, t, i) {
  42995. return e.crossFadeFrom(this, t, i)
  42996. },
  42997. stopFading: function() {
  42998. var e = this._weightInterpolant;
  42999. return null !== e && (this._weightInterpolant = null,
  43000. this._mixer._takeBackControlInterpolant(e)),
  43001. this
  43002. },
  43003. setEffectiveTimeScale: function(e) {
  43004. return this.timeScale = e,
  43005. this._effectiveTimeScale = this.paused ? 0 : e,
  43006. this.stopWarping()
  43007. },
  43008. getEffectiveTimeScale: function() {
  43009. return this._effectiveTimeScale
  43010. },
  43011. setDuration: function(e) {
  43012. return this.timeScale = this._clip.duration / e,
  43013. this.stopWarping()
  43014. },
  43015. syncWith: function(e) {
  43016. return this.time = e.time,
  43017. this.timeScale = e.timeScale,
  43018. this.stopWarping()
  43019. },
  43020. halt: function(e) {
  43021. return this.warp(this._currentTimeScale, 0, e)
  43022. },
  43023. warp: function(e, t, i) {
  43024. var n = this._mixer
  43025. , r = n.time
  43026. , o = this._timeScaleInterpolant
  43027. , a = this.timeScale;
  43028. null === o && (o = n._lendControlInterpolant(),
  43029. this._timeScaleInterpolant = o);
  43030. var s = o.parameterPositions
  43031. , l = o.sampleValues;
  43032. return s[0] = r,
  43033. s[1] = r + i,
  43034. l[0] = e / a,
  43035. l[1] = t / a,
  43036. this
  43037. },
  43038. stopWarping: function() {
  43039. var e = this._timeScaleInterpolant;
  43040. return null !== e && (this._timeScaleInterpolant = null,
  43041. this._mixer._takeBackControlInterpolant(e)),
  43042. this
  43043. },
  43044. getMixer: function() {
  43045. return this._mixer
  43046. },
  43047. getClip: function() {
  43048. return this._clip
  43049. },
  43050. getRoot: function() {
  43051. return this._localRoot || this._mixer._root
  43052. },
  43053. _update: function(e, t, i, n) {
  43054. var r = this._startTime;
  43055. if (null !== r) {
  43056. var o = (e - r) * i;
  43057. if (o < 0 || 0 === i)
  43058. return;
  43059. this._startTime = null,
  43060. t = i * o
  43061. }
  43062. t *= this._updateTimeScale(e);
  43063. var a = this._updateTime(t)
  43064. , s = this._updateWeight(e);
  43065. if (0 < s)
  43066. for (var l = this._interpolants, c = this._propertyBindings, h = 0, u = l.length; h !== u; ++h)
  43067. l[h].evaluate(a),
  43068. c[h].accumulate(n, s)
  43069. },
  43070. _updateWeight: function(e) {
  43071. var t = 0;
  43072. if (this.enabled) {
  43073. t = this.weight;
  43074. var i = this._weightInterpolant;
  43075. if (null !== i) {
  43076. var n = i.evaluate(e)[0];
  43077. t *= n,
  43078. e > i.parameterPositions[1] && (this.stopFading(),
  43079. 0 === n && (this.enabled = !1))
  43080. }
  43081. }
  43082. return this._effectiveWeight = t
  43083. },
  43084. _updateTimeScale: function(e) {
  43085. var t = 0;
  43086. if (!this.paused) {
  43087. t = this.timeScale;
  43088. var i = this._timeScaleInterpolant;
  43089. if (null !== i)
  43090. t *= i.evaluate(e)[0],
  43091. e > i.parameterPositions[1] && (this.stopWarping(),
  43092. 0 === t ? this.pause = !0 : this.timeScale = t)
  43093. }
  43094. return this._effectiveTimeScale = t
  43095. },
  43096. _updateTime: function(e) {
  43097. var t = this.time + e;
  43098. if (0 === e)
  43099. return t;
  43100. var i = this._clip.duration
  43101. , n = this.loop
  43102. , r = this._loopCount
  43103. , o = !1;
  43104. switch (n) {
  43105. case Ci.LoopOnce:
  43106. if (-1 === r && (this.loopCount = 0,
  43107. this._setEndings(!0, !0, !1)),
  43108. i <= t)
  43109. t = i;
  43110. else {
  43111. if (!(t < 0))
  43112. break;
  43113. t = 0
  43114. }
  43115. this.clampWhenFinished ? this.pause = !0 : this.enabled = !1,
  43116. this._mixer.dispatchEvent({
  43117. type: "finished",
  43118. action: this,
  43119. direction: e < 0 ? -1 : 1
  43120. });
  43121. break;
  43122. case Ci.LoopPingPong:
  43123. o = !0;
  43124. case Ci.LoopRepeat:
  43125. if (-1 === r && (0 < e ? (r = 0,
  43126. this._setEndings(!0, 0 === this.repetitions, o)) : this._setEndings(0 === this.repetitions, !0, o)),
  43127. i <= t || t < 0) {
  43128. var a = Math.floor(t / i);
  43129. t -= i * a,
  43130. r += Math.abs(a);
  43131. var s = this.repetitions - r;
  43132. if (s < 0) {
  43133. this.clampWhenFinished ? this.paused = !0 : this.enabled = !1,
  43134. t = 0 < e ? i : 0,
  43135. this._mixer.dispatchEvent({
  43136. type: "finished",
  43137. action: this,
  43138. direction: 0 < e ? 1 : -1
  43139. });
  43140. break
  43141. }
  43142. if (0 == s) {
  43143. var l = e < 0;
  43144. this._setEndings(l, !l, o)
  43145. } else
  43146. this._setEndings(!1, !1, o);
  43147. this._loopCount = r,
  43148. this._mixer.dispatchEvent({
  43149. type: "loop",
  43150. action: this,
  43151. loopDelta: a
  43152. })
  43153. }
  43154. if (n === Ci.LoopPingPong && 1 == (1 & r))
  43155. return i - (this.time = t)
  43156. }
  43157. return this.time = t
  43158. },
  43159. _setEndings: function(e, t, i) {
  43160. var n = this._interpolantSettings;
  43161. i ? (n.endingStart = Ci.ZeroSlopeEnding,
  43162. n.endingEnd = Ci.ZeroSlopeEnding) : (n.endingStart = e ? this.zeroSlopeAtStart ? Ci.ZeroSlopeEnding : Ci.ZeroCurvatureEnding : Ci.WrapAroundEnding,
  43163. n.endingEnd = t ? this.zeroSlopeAtEnd ? Ci.ZeroSlopeEnding : Ci.ZeroCurvatureEnding : Ci.WrapAroundEnding)
  43164. },
  43165. _scheduleFading: function(e, t, i) {
  43166. var n = this._mixer
  43167. , r = n.time
  43168. , o = this._weightInterpolant;
  43169. null === o && (o = n._lendControlInterpolant(),
  43170. this._weightInterpolant = o);
  43171. var a = o.parameterPositions
  43172. , s = o.sampleValues;
  43173. return a[0] = r,
  43174. s[0] = t,
  43175. a[1] = r + e,
  43176. s[1] = i,
  43177. this
  43178. }
  43179. },
  43180. Object.assign(Ci.AnimationMixer.prototype, {
  43181. _bindAction: function(e, t) {
  43182. var i = e._localRoot || this._root
  43183. , n = e._clip.tracks
  43184. , r = n.length
  43185. , o = e._propertyBindings
  43186. , a = e._interpolants
  43187. , s = i.uuid
  43188. , l = this._bindingsByRootAndName
  43189. , c = l[s];
  43190. void 0 === c && (c = {},
  43191. l[s] = c);
  43192. for (var h = 0; h !== r; ++h) {
  43193. var u = n[h]
  43194. , d = u.name
  43195. , p = c[d];
  43196. if (void 0 !== p)
  43197. o[h] = p;
  43198. else {
  43199. if (void 0 !== (p = o[h])) {
  43200. null === p._cacheIndex && (++p.referenceCount,
  43201. this._addInactiveBinding(p, s, d));
  43202. continue
  43203. }
  43204. var f = t && t._propertyBindings[h].binding.parsedPath;
  43205. ++(p = new Ci.PropertyMixer(Ci.PropertyBinding.create(i, d, f),u.ValueTypeName,u.getValueSize())).referenceCount,
  43206. this._addInactiveBinding(p, s, d),
  43207. o[h] = p
  43208. }
  43209. a[h].resultBuffer = p.buffer
  43210. }
  43211. },
  43212. _activateAction: function(e) {
  43213. if (!this._isActiveAction(e)) {
  43214. if (null === e._cacheIndex) {
  43215. var t = (e._localRoot || this._root).uuid
  43216. , i = e._clip.name
  43217. , n = this._actionsByClip[i];
  43218. this._bindAction(e, n && n.knownActions[0]),
  43219. this._addInactiveAction(e, i, t)
  43220. }
  43221. for (var r = e._propertyBindings, o = 0, a = r.length; o !== a; ++o) {
  43222. var s = r[o];
  43223. 0 == s.useCount++ && (this._lendBinding(s),
  43224. s.saveOriginalState())
  43225. }
  43226. this._lendAction(e)
  43227. }
  43228. },
  43229. _deactivateAction: function(e) {
  43230. if (this._isActiveAction(e)) {
  43231. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  43232. var r = t[i];
  43233. 0 == --r.useCount && (r.restoreOriginalState(),
  43234. this._takeBackBinding(r))
  43235. }
  43236. this._takeBackAction(e)
  43237. }
  43238. },
  43239. _initMemoryManager: function() {
  43240. this._actions = [],
  43241. this._nActiveActions = 0,
  43242. this._actionsByClip = {},
  43243. this._bindings = [],
  43244. this._nActiveBindings = 0,
  43245. this._bindingsByRootAndName = {},
  43246. this._controlInterpolants = [],
  43247. this._nActiveControlInterpolants = 0;
  43248. var e = this;
  43249. this.stats = {
  43250. actions: {
  43251. get total() {
  43252. return e._actions.length
  43253. },
  43254. get inUse() {
  43255. return e._nActiveActions
  43256. }
  43257. },
  43258. bindings: {
  43259. get total() {
  43260. return e._bindings.length
  43261. },
  43262. get inUse() {
  43263. return e._nActiveBindings
  43264. }
  43265. },
  43266. controlInterpolants: {
  43267. get total() {
  43268. return e._controlInterpolants.length
  43269. },
  43270. get inUse() {
  43271. return e._nActiveControlInterpolants
  43272. }
  43273. }
  43274. }
  43275. },
  43276. _isActiveAction: function(e) {
  43277. var t = e._cacheIndex;
  43278. return null !== t && t < this._nActiveActions
  43279. },
  43280. _addInactiveAction: function(e, t, i) {
  43281. var n = this._actions
  43282. , r = this._actionsByClip
  43283. , o = r[t];
  43284. if (void 0 === o)
  43285. o = {
  43286. knownActions: [e],
  43287. actionByRoot: {}
  43288. },
  43289. e._byClipCacheIndex = 0,
  43290. r[t] = o;
  43291. else {
  43292. var a = o.knownActions;
  43293. e._byClipCacheIndex = a.length,
  43294. a.push(e)
  43295. }
  43296. e._cacheIndex = n.length,
  43297. n.push(e),
  43298. o.actionByRoot[i] = e
  43299. },
  43300. _removeInactiveAction: function(e) {
  43301. var t = this._actions
  43302. , i = t[t.length - 1]
  43303. , n = e._cacheIndex;
  43304. t[i._cacheIndex = n] = i,
  43305. t.pop(),
  43306. e._cacheIndex = null;
  43307. var r = e._clip.name
  43308. , o = this._actionsByClip
  43309. , a = o[r]
  43310. , s = a.knownActions
  43311. , l = s[s.length - 1]
  43312. , c = e._byClipCacheIndex;
  43313. s[l._byClipCacheIndex = c] = l,
  43314. s.pop(),
  43315. e._byClipCacheIndex = null,
  43316. delete a.actionByRoot[(t._localRoot || this._root).uuid],
  43317. 0 === s.length && delete o[r],
  43318. this._removeInactiveBindingsForAction(e)
  43319. },
  43320. _removeInactiveBindingsForAction: function(e) {
  43321. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  43322. var r = t[i];
  43323. 0 == --r.referenceCount && this._removeInactiveBinding(r)
  43324. }
  43325. },
  43326. _lendAction: function(e) {
  43327. var t = this._actions
  43328. , i = e._cacheIndex
  43329. , n = this._nActiveActions++
  43330. , r = t[n];
  43331. t[e._cacheIndex = n] = e,
  43332. t[r._cacheIndex = i] = r
  43333. },
  43334. _takeBackAction: function(e) {
  43335. var t = this._actions
  43336. , i = e._cacheIndex
  43337. , n = --this._nActiveActions
  43338. , r = t[n];
  43339. t[e._cacheIndex = n] = e,
  43340. t[r._cacheIndex = i] = r
  43341. },
  43342. _addInactiveBinding: function(e, t, i) {
  43343. var n = this._bindingsByRootAndName
  43344. , r = n[t]
  43345. , o = this._bindings;
  43346. void 0 === r && (r = {},
  43347. n[t] = r),
  43348. (r[i] = e)._cacheIndex = o.length,
  43349. o.push(e)
  43350. },
  43351. _removeInactiveBinding: function(e) {
  43352. var t = this._bindings
  43353. , i = e.binding
  43354. , n = i.rootNode.uuid
  43355. , r = i.path
  43356. , o = this._bindingsByRootAndName
  43357. , a = o[n]
  43358. , s = t[t.length - 1]
  43359. , l = e._cacheIndex;
  43360. t[s._cacheIndex = l] = s,
  43361. t.pop(),
  43362. delete a[r];
  43363. e: {
  43364. for (var c in a)
  43365. break e;
  43366. delete o[n]
  43367. }
  43368. },
  43369. _lendBinding: function(e) {
  43370. var t = this._bindings
  43371. , i = e._cacheIndex
  43372. , n = this._nActiveBindings++
  43373. , r = t[n];
  43374. t[e._cacheIndex = n] = e,
  43375. t[r._cacheIndex = i] = r
  43376. },
  43377. _takeBackBinding: function(e) {
  43378. var t = this._bindings
  43379. , i = e._cacheIndex
  43380. , n = --this._nActiveBindings
  43381. , r = t[n];
  43382. t[e._cacheIndex = n] = e,
  43383. t[r._cacheIndex = i] = r
  43384. },
  43385. _lendControlInterpolant: function() {
  43386. var e = this._controlInterpolants
  43387. , t = this._nActiveControlInterpolants++
  43388. , i = e[t];
  43389. return void 0 === i && (e[(i = new Ci.LinearInterpolant(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer)).__cacheIndex = t] = i),
  43390. i
  43391. },
  43392. _takeBackControlInterpolant: function(e) {
  43393. var t = this._controlInterpolants
  43394. , i = e.__cacheIndex
  43395. , n = --this._nActiveControlInterpolants
  43396. , r = t[n];
  43397. t[e.__cacheIndex = n] = e,
  43398. t[r.__cacheIndex = i] = r
  43399. },
  43400. _controlInterpolantsResultBuffer: new Float32Array(1)
  43401. }),
  43402. Ci.AnimationObjectGroup = function(e) {
  43403. this.uuid = Ci.Math.generateUUID(),
  43404. this._objects = Array.prototype.slice.call(arguments),
  43405. this.nCachedObjects_ = 0;
  43406. var t = {};
  43407. this._indicesByUUID = t;
  43408. for (var i = 0, n = arguments.length; i !== n; ++i)
  43409. t[arguments[i].uuid] = i;
  43410. this._paths = [],
  43411. this._parsedPaths = [],
  43412. this._bindings = [],
  43413. this._bindingsIndicesByPath = {};
  43414. var r = this;
  43415. this.stats = {
  43416. objects: {
  43417. get total() {
  43418. return r._objects.length
  43419. },
  43420. get inUse() {
  43421. return this.total - r.nCachedObjects_
  43422. }
  43423. },
  43424. get bindingsPerObject() {
  43425. return r._bindings.length
  43426. }
  43427. }
  43428. }
  43429. ,
  43430. Ci.AnimationObjectGroup.prototype = {
  43431. constructor: Ci.AnimationObjectGroup,
  43432. add: function(e) {
  43433. 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) {
  43434. var u = arguments[c]
  43435. , d = u.uuid
  43436. , p = r[d];
  43437. if (void 0 === p) {
  43438. p = i++,
  43439. r[d] = p,
  43440. t.push(u);
  43441. for (var f = 0, g = l; f !== g; ++f)
  43442. s[f].push(new Ci.PropertyBinding(u,o[f],a[f]))
  43443. } else if (p < n) {
  43444. var m = t[p]
  43445. , v = --n
  43446. , y = t[v];
  43447. t[r[y.uuid] = p] = y,
  43448. t[r[d] = v] = u;
  43449. for (f = 0,
  43450. g = l; f !== g; ++f) {
  43451. var A = s[f]
  43452. , C = A[v]
  43453. , I = A[p];
  43454. A[p] = C,
  43455. void 0 === I && (I = new Ci.PropertyBinding(u,o[f],a[f])),
  43456. A[v] = I
  43457. }
  43458. } else
  43459. t[p] !== m && console.error("Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes...")
  43460. }
  43461. this.nCachedObjects_ = n
  43462. },
  43463. remove: function(e) {
  43464. for (var t = this._objects, i = (t.length,
  43465. this.nCachedObjects_), n = this._indicesByUUID, r = this._bindings, o = r.length, a = 0, s = arguments.length; a !== s; ++a) {
  43466. var l = arguments[a]
  43467. , c = l.uuid
  43468. , h = n[c];
  43469. if (void 0 !== h && i <= h) {
  43470. var u = i++
  43471. , d = t[u];
  43472. t[n[d.uuid] = h] = d,
  43473. t[n[c] = u] = l;
  43474. for (var p = 0, f = o; p !== f; ++p) {
  43475. var g = r[p]
  43476. , m = g[u]
  43477. , v = g[h];
  43478. g[h] = m,
  43479. g[u] = v
  43480. }
  43481. }
  43482. }
  43483. this.nCachedObjects_ = i
  43484. },
  43485. uncache: function(e) {
  43486. 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) {
  43487. var c = arguments[s].uuid
  43488. , h = r[c];
  43489. if (void 0 !== h)
  43490. if (delete r[c],
  43491. h < n) {
  43492. var u = --n
  43493. , d = t[u]
  43494. , p = t[y = --i];
  43495. t[r[d.uuid] = h] = d,
  43496. t[r[p.uuid] = u] = p,
  43497. t.pop();
  43498. for (var f = 0, g = a; f !== g; ++f) {
  43499. var m = (A = o[f])[u]
  43500. , v = A[y];
  43501. A[h] = m,
  43502. A[u] = v,
  43503. A.pop()
  43504. }
  43505. } else {
  43506. var y;
  43507. t[r[(p = t[y = --i]).uuid] = h] = p,
  43508. t.pop();
  43509. for (f = 0,
  43510. g = a; f !== g; ++f) {
  43511. var A;
  43512. (A = o[f])[h] = A[y],
  43513. A.pop()
  43514. }
  43515. }
  43516. }
  43517. this.nCachedObjects_ = n
  43518. },
  43519. subscribe_: function(e, t) {
  43520. var i = this._bindingsIndicesByPath
  43521. , n = i[e]
  43522. , r = this._bindings;
  43523. if (void 0 !== n)
  43524. return r[n];
  43525. var o = this._paths
  43526. , a = this._parsedPaths
  43527. , s = this._objects
  43528. , l = s.length
  43529. , c = this.nCachedObjects_
  43530. , h = new Array(l);
  43531. n = r.length,
  43532. i[e] = n,
  43533. o.push(e),
  43534. a.push(t),
  43535. r.push(h);
  43536. for (var u = c, d = s.length; u !== d; ++u) {
  43537. var p = s[u];
  43538. h[u] = new Ci.PropertyBinding(p,e,t)
  43539. }
  43540. return h
  43541. },
  43542. unsubscribe_: function(e) {
  43543. var t = this._bindingsIndicesByPath
  43544. , i = t[e];
  43545. if (void 0 !== i) {
  43546. var n = this._paths
  43547. , r = this._parsedPaths
  43548. , o = this._bindings
  43549. , a = o.length - 1
  43550. , s = o[a];
  43551. o[t[e[a]] = i] = s,
  43552. o.pop(),
  43553. r[i] = r[a],
  43554. r.pop(),
  43555. n[i] = n[a],
  43556. n.pop()
  43557. }
  43558. }
  43559. },
  43560. Ci.AnimationUtils = {
  43561. arraySlice: function(e, t, i) {
  43562. return Ci.AnimationUtils.isTypedArray(e) ? new e.constructor(e.subarray(t, i)) : e.slice(t, i)
  43563. },
  43564. convertArray: function(e, t, i) {
  43565. return !e || !i && e.constructor === t ? e : "number" == typeof t.BYTES_PER_ELEMENT ? new t(e) : Array.prototype.slice.call(e)
  43566. },
  43567. isTypedArray: function(e) {
  43568. return ArrayBuffer.isView(e) && !(e instanceof DataView)
  43569. },
  43570. getKeyframeOrder: function(i) {
  43571. for (var e = i.length, t = new Array(e), n = 0; n !== e; ++n)
  43572. t[n] = n;
  43573. return t.sort(function(e, t) {
  43574. return i[e] - i[t]
  43575. }),
  43576. t
  43577. },
  43578. sortedArray: function(e, t, i) {
  43579. for (var n = e.length, r = new e.constructor(n), o = 0, a = 0; a !== n; ++o)
  43580. for (var s = i[o] * t, l = 0; l !== t; ++l)
  43581. r[a++] = e[s + l];
  43582. return r
  43583. },
  43584. flattenJSON: function(e, t, i, n) {
  43585. for (var r = 1, o = e[0]; void 0 !== o && void 0 === o[n]; )
  43586. o = e[r++];
  43587. if (void 0 !== o) {
  43588. var a = o[n];
  43589. if (void 0 !== a)
  43590. if (Array.isArray(a))
  43591. for (; void 0 !== (a = o[n]) && (t.push(o.time),
  43592. i.push.apply(i, a)),
  43593. void 0 !== (o = e[r++]); )
  43594. ;
  43595. else if (void 0 !== a.toArray)
  43596. for (; void 0 !== (a = o[n]) && (t.push(o.time),
  43597. a.toArray(i, i.length)),
  43598. void 0 !== (o = e[r++]); )
  43599. ;
  43600. else
  43601. for (; void 0 !== (a = o[n]) && (t.push(o.time),
  43602. i.push(a)),
  43603. void 0 !== (o = e[r++]); )
  43604. ;
  43605. }
  43606. }
  43607. },
  43608. Ci.KeyframeTrack = function(e, t, i, n) {
  43609. if (void 0 === e)
  43610. throw new Error("track name is undefined");
  43611. if (void 0 === t || 0 === t.length)
  43612. throw new Error("no keyframes in track named " + e);
  43613. this.name = e,
  43614. this.times = Ci.AnimationUtils.convertArray(t, this.TimeBufferType),
  43615. this.values = Ci.AnimationUtils.convertArray(i, this.ValueBufferType),
  43616. this.setInterpolation(n || this.DefaultInterpolation),
  43617. this.validate(),
  43618. this.optimize()
  43619. }
  43620. ,
  43621. Ci.KeyframeTrack.prototype = {
  43622. constructor: Ci.KeyframeTrack,
  43623. TimeBufferType: Float32Array,
  43624. ValueBufferType: Float32Array,
  43625. DefaultInterpolation: Ci.InterpolateLinear,
  43626. InterpolantFactoryMethodDiscrete: function(e) {
  43627. return new Ci.DiscreteInterpolant(this.times,this.values,this.getValueSize(),e)
  43628. },
  43629. InterpolantFactoryMethodLinear: function(e) {
  43630. return new Ci.LinearInterpolant(this.times,this.values,this.getValueSize(),e)
  43631. },
  43632. InterpolantFactoryMethodSmooth: function(e) {
  43633. return new Ci.CubicInterpolant(this.times,this.values,this.getValueSize(),e)
  43634. },
  43635. setInterpolation: function(e) {
  43636. var t = void 0;
  43637. switch (e) {
  43638. case Ci.InterpolateDiscrete:
  43639. t = this.InterpolantFactoryMethodDiscrete;
  43640. break;
  43641. case Ci.InterpolateLinear:
  43642. t = this.InterpolantFactoryMethodLinear;
  43643. break;
  43644. case Ci.InterpolateSmooth:
  43645. t = this.InterpolantFactoryMethodSmooth
  43646. }
  43647. if (void 0 !== t)
  43648. this.createInterpolant = t;
  43649. else {
  43650. var i = "unsupported interpolation for " + this.ValueTypeName + " keyframe track named " + this.name;
  43651. if (void 0 === this.createInterpolant) {
  43652. if (e === this.DefaultInterpolation)
  43653. throw new Error(i);
  43654. this.setInterpolation(this.DefaultInterpolation)
  43655. }
  43656. console.warn(i)
  43657. }
  43658. },
  43659. getInterpolation: function() {
  43660. switch (this.createInterpolant) {
  43661. case this.InterpolantFactoryMethodDiscrete:
  43662. return Ci.InterpolateDiscrete;
  43663. case this.InterpolantFactoryMethodLinear:
  43664. return Ci.InterpolateLinear;
  43665. case this.InterpolantFactoryMethodSmooth:
  43666. return Ci.InterpolateSmooth
  43667. }
  43668. },
  43669. getValueSize: function() {
  43670. return this.values.length / this.times.length
  43671. },
  43672. shift: function(e) {
  43673. if (0 !== e)
  43674. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  43675. t[i] += e;
  43676. return this
  43677. },
  43678. scale: function(e) {
  43679. if (1 !== e)
  43680. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  43681. t[i] *= e;
  43682. return this
  43683. },
  43684. trim: function(e, t) {
  43685. for (var i = this.times, n = i.length, r = 0, o = n - 1; r !== n && i[r] < e; )
  43686. ++r;
  43687. for (; -1 !== o && i[o] > t; )
  43688. --o;
  43689. if (++o,
  43690. 0 !== r || o !== n) {
  43691. o <= r && (r = (o = Math.max(o, 1)) - 1);
  43692. var a = this.getValueSize();
  43693. this.times = Ci.AnimationUtils.arraySlice(i, r, o),
  43694. this.values = Ci.AnimationUtils.arraySlice(this.values, r * a, o * a)
  43695. }
  43696. return this
  43697. },
  43698. validate: function() {
  43699. var e = !0
  43700. , t = this.getValueSize();
  43701. t - Math.floor(t) != 0 && (console.error("invalid value size in track", this),
  43702. e = !1);
  43703. var i = this.times
  43704. , n = this.values
  43705. , r = i.length;
  43706. 0 === r && (console.error("track is empty", this),
  43707. e = !1);
  43708. for (var o = null, a = 0; a !== r; a++) {
  43709. var s = i[a];
  43710. if ("number" == typeof s && isNaN(s)) {
  43711. console.error("time is not a valid number", this, a, s),
  43712. e = !1;
  43713. break
  43714. }
  43715. if (null !== o && s < o) {
  43716. console.error("out of order keys", this, a, s, o),
  43717. e = !1;
  43718. break
  43719. }
  43720. o = s
  43721. }
  43722. if (void 0 !== n && Ci.AnimationUtils.isTypedArray(n)) {
  43723. a = 0;
  43724. for (var l = n.length; a !== l; ++a) {
  43725. var c = n[a];
  43726. if (isNaN(c)) {
  43727. console.error("value is not a valid number", this, a, c),
  43728. e = !1;
  43729. break
  43730. }
  43731. }
  43732. }
  43733. return e
  43734. },
  43735. optimize: function() {
  43736. for (var e = this.times, t = this.values, i = this.getValueSize(), n = 1, r = 1, o = e.length - 1; r <= o; ++r) {
  43737. var a = !1
  43738. , s = e[r];
  43739. if (s !== e[r + 1] && (1 !== r || s !== s[0]))
  43740. for (var l = r * i, c = l - i, h = l + i, u = 0; u !== i; ++u) {
  43741. var d = t[l + u];
  43742. if (d !== t[c + u] || d !== t[h + u]) {
  43743. a = !0;
  43744. break
  43745. }
  43746. }
  43747. if (a) {
  43748. if (r !== n) {
  43749. e[n] = e[r];
  43750. var p = r * i
  43751. , f = n * i;
  43752. for (u = 0; u !== i; ++u)
  43753. t[f + u] = t[p + u]
  43754. }
  43755. ++n
  43756. }
  43757. }
  43758. return n !== e.length && (this.times = Ci.AnimationUtils.arraySlice(e, 0, n),
  43759. this.values = Ci.AnimationUtils.arraySlice(t, 0, n * i)),
  43760. this
  43761. }
  43762. },
  43763. Object.assign(Ci.KeyframeTrack, {
  43764. parse: function(e) {
  43765. if (void 0 === e.type)
  43766. throw new Error("track type undefined, can not parse");
  43767. var t = Ci.KeyframeTrack._getTrackTypeForValueTypeName(e.type);
  43768. if (void 0 === e.times) {
  43769. console.warn("legacy JSON format detected, converting");
  43770. var i = []
  43771. , n = [];
  43772. Ci.AnimationUtils.flattenJSON(e.keys, i, n, "value"),
  43773. e.times = i,
  43774. e.values = n
  43775. }
  43776. return void 0 !== t.parse ? t.parse(e) : new t(e.name,e.times,e.values,e.interpolation)
  43777. },
  43778. toJSON: function(e) {
  43779. var t, i = e.constructor;
  43780. if (void 0 !== i.toJSON)
  43781. t = i.toJSON(e);
  43782. else {
  43783. t = {
  43784. name: e.name,
  43785. times: Ci.AnimationUtils.convertArray(e.times, Array),
  43786. values: Ci.AnimationUtils.convertArray(e.values, Array)
  43787. };
  43788. var n = e.getInterpolation();
  43789. n !== e.DefaultInterpolation && (t.interpolation = n)
  43790. }
  43791. return t.type = e.ValueTypeName,
  43792. t
  43793. },
  43794. _getTrackTypeForValueTypeName: function(e) {
  43795. switch (e.toLowerCase()) {
  43796. case "scalar":
  43797. case "double":
  43798. case "float":
  43799. case "number":
  43800. case "integer":
  43801. return Ci.NumberKeyframeTrack;
  43802. case "vector":
  43803. case "vector2":
  43804. case "vector3":
  43805. case "vector4":
  43806. return Ci.VectorKeyframeTrack;
  43807. case "color":
  43808. return Ci.ColorKeyframeTrack;
  43809. case "quaternion":
  43810. return Ci.QuaternionKeyframeTrack;
  43811. case "bool":
  43812. case "boolean":
  43813. return Ci.BooleanKeyframeTrack;
  43814. case "string":
  43815. return Ci.StringKeyframeTrack
  43816. }
  43817. throw new Error("Unsupported typeName: " + e)
  43818. }
  43819. }),
  43820. Ci.PropertyBinding = function(e, t, i) {
  43821. this.path = t,
  43822. this.parsedPath = i || Ci.PropertyBinding.parseTrackName(t),
  43823. this.node = Ci.PropertyBinding.findNode(e, this.parsedPath.nodeName) || e,
  43824. this.rootNode = e
  43825. }
  43826. ,
  43827. Ci.PropertyBinding.prototype = {
  43828. constructor: Ci.PropertyBinding,
  43829. getValue: function(e, t) {
  43830. this.bind(),
  43831. this.getValue(e, t)
  43832. },
  43833. setValue: function(e, t) {
  43834. this.bind(),
  43835. this.setValue(e, t)
  43836. },
  43837. bind: function() {
  43838. var e = this.node
  43839. , t = this.parsedPath
  43840. , i = t.objectName
  43841. , n = t.propertyName
  43842. , r = t.propertyIndex;
  43843. if (e || (e = Ci.PropertyBinding.findNode(this.rootNode, t.nodeName) || this.rootNode,
  43844. this.node = e),
  43845. this.getValue = this._getValue_unavailable,
  43846. this.setValue = this._setValue_unavailable,
  43847. e) {
  43848. if (i) {
  43849. var o = t.objectIndex;
  43850. switch (i) {
  43851. case "materials":
  43852. if (!e.material)
  43853. return void console.error(" can not bind to material as node does not have a material", this);
  43854. if (!e.material.materials)
  43855. return void console.error(" can not bind to material.materials as node.material does not have a materials array", this);
  43856. e = e.material.materials;
  43857. break;
  43858. case "bones":
  43859. if (!e.skeleton)
  43860. return void console.error(" can not bind to bones as node does not have a skeleton", this);
  43861. e = e.skeleton.bones;
  43862. for (var a = 0; a < e.length; a++)
  43863. if (e[a].name === o) {
  43864. o = a;
  43865. break
  43866. }
  43867. break;
  43868. default:
  43869. if (void 0 === e[i])
  43870. return void console.error(" can not bind to objectName of node, undefined", this);
  43871. e = e[i]
  43872. }
  43873. if (void 0 !== o) {
  43874. if (void 0 === e[o])
  43875. return void console.error(" trying to bind to objectIndex of objectName, but is undefined:", this, e);
  43876. e = e[o]
  43877. }
  43878. }
  43879. var s = e[n];
  43880. if (s) {
  43881. var l = this.Versioning.None;
  43882. void 0 !== e.needsUpdate ? (l = this.Versioning.NeedsUpdate,
  43883. this.targetObject = e) : void 0 !== e.matrixWorldNeedsUpdate && (l = this.Versioning.MatrixWorldNeedsUpdate,
  43884. this.targetObject = e);
  43885. var c = this.BindingType.Direct;
  43886. if (void 0 !== r) {
  43887. if ("morphTargetInfluences" === n) {
  43888. if (!e.geometry)
  43889. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry", this);
  43890. if (!e.geometry.morphTargets)
  43891. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets", this);
  43892. for (a = 0; a < this.node.geometry.morphTargets.length; a++)
  43893. if (e.geometry.morphTargets[a].name === r) {
  43894. r = a;
  43895. break
  43896. }
  43897. }
  43898. c = this.BindingType.ArrayElement,
  43899. this.resolvedProperty = s,
  43900. this.propertyIndex = r
  43901. } else
  43902. void 0 !== s.fromArray && void 0 !== s.toArray ? (c = this.BindingType.HasFromToArray,
  43903. this.resolvedProperty = s) : void 0 !== s.length ? (c = this.BindingType.EntireArray,
  43904. this.resolvedProperty = s) : this.propertyName = n;
  43905. this.getValue = this.GetterByBindingType[c],
  43906. this.setValue = this.SetterByBindingTypeAndVersioning[c][l]
  43907. } else {
  43908. var h = t.nodeName;
  43909. console.error(" trying to update property for track: " + h + "." + n + " but it wasn't found.", e)
  43910. }
  43911. } else
  43912. console.error(" trying to update node for track: " + this.path + " but it wasn't found.")
  43913. },
  43914. unbind: function() {
  43915. this.node = null,
  43916. this.getValue = this._getValue_unbound,
  43917. this.setValue = this._setValue_unbound
  43918. }
  43919. },
  43920. Object.assign(Ci.PropertyBinding.prototype, {
  43921. _getValue_unavailable: function() {},
  43922. _setValue_unavailable: function() {},
  43923. _getValue_unbound: Ci.PropertyBinding.prototype.getValue,
  43924. _setValue_unbound: Ci.PropertyBinding.prototype.setValue,
  43925. BindingType: {
  43926. Direct: 0,
  43927. EntireArray: 1,
  43928. ArrayElement: 2,
  43929. HasFromToArray: 3
  43930. },
  43931. Versioning: {
  43932. None: 0,
  43933. NeedsUpdate: 1,
  43934. MatrixWorldNeedsUpdate: 2
  43935. },
  43936. GetterByBindingType: [function(e, t) {
  43937. e[t] = this.node[this.propertyName]
  43938. }
  43939. , function(e, t) {
  43940. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  43941. e[t++] = i[n]
  43942. }
  43943. , function(e, t) {
  43944. e[t] = this.resolvedProperty[this.propertyIndex]
  43945. }
  43946. , function(e, t) {
  43947. this.resolvedProperty.toArray(e, t)
  43948. }
  43949. ],
  43950. SetterByBindingTypeAndVersioning: [[function(e, t) {
  43951. this.node[this.propertyName] = e[t]
  43952. }
  43953. , function(e, t) {
  43954. this.node[this.propertyName] = e[t],
  43955. this.targetObject.needsUpdate = !0
  43956. }
  43957. , function(e, t) {
  43958. this.node[this.propertyName] = e[t],
  43959. this.targetObject.matrixWorldNeedsUpdate = !0
  43960. }
  43961. ], [function(e, t) {
  43962. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  43963. i[n] = e[t++]
  43964. }
  43965. , function(e, t) {
  43966. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  43967. i[n] = e[t++];
  43968. this.targetObject.needsUpdate = !0
  43969. }
  43970. , function(e, t) {
  43971. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  43972. i[n] = e[t++];
  43973. this.targetObject.matrixWorldNeedsUpdate = !0
  43974. }
  43975. ], [function(e, t) {
  43976. this.resolvedProperty[this.propertyIndex] = e[t]
  43977. }
  43978. , function(e, t) {
  43979. this.resolvedProperty[this.propertyIndex] = e[t],
  43980. this.targetObject.needsUpdate = !0
  43981. }
  43982. , function(e, t) {
  43983. this.resolvedProperty[this.propertyIndex] = e[t],
  43984. this.targetObject.matrixWorldNeedsUpdate = !0
  43985. }
  43986. ], [function(e, t) {
  43987. this.resolvedProperty.fromArray(e, t)
  43988. }
  43989. , function(e, t) {
  43990. this.resolvedProperty.fromArray(e, t),
  43991. this.targetObject.needsUpdate = !0
  43992. }
  43993. , function(e, t) {
  43994. this.resolvedProperty.fromArray(e, t),
  43995. this.targetObject.matrixWorldNeedsUpdate = !0
  43996. }
  43997. ]]
  43998. }),
  43999. Ci.PropertyBinding.Composite = function(e, t, i) {
  44000. var n = i || Ci.PropertyBinding.parseTrackName(t);
  44001. this._targetGroup = e,
  44002. this._bindings = e.subscribe_(t, n)
  44003. }
  44004. ,
  44005. Ci.PropertyBinding.Composite.prototype = {
  44006. constructor: Ci.PropertyBinding.Composite,
  44007. getValue: function(e, t) {
  44008. this.bind();
  44009. var i = this._targetGroup.nCachedObjects_
  44010. , n = this._bindings[i];
  44011. void 0 !== n && n.getValue(e, t)
  44012. },
  44013. setValue: function(e, t) {
  44014. for (var i = this._bindings, n = this._targetGroup.nCachedObjects_, r = i.length; n !== r; ++n)
  44015. i[n].setValue(e, t)
  44016. },
  44017. bind: function() {
  44018. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  44019. e[t].bind()
  44020. },
  44021. unbind: function() {
  44022. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  44023. e[t].unbind()
  44024. }
  44025. },
  44026. Ci.PropertyBinding.create = function(e, t, i) {
  44027. return e instanceof Ci.AnimationObjectGroup ? new Ci.PropertyBinding.Composite(e,t,i) : new Ci.PropertyBinding(e,t,i)
  44028. }
  44029. ,
  44030. Ci.PropertyBinding.parseTrackName = function(e) {
  44031. var t = /^(([\w]+\/)*)([\w-\d]+)?(\.([\w]+)(\[([\w\d\[\]\_.:\- ]+)\])?)?(\.([\w.]+)(\[([\w\d\[\]\_. ]+)\])?)$/
  44032. , i = t.exec(e);
  44033. if (!i)
  44034. throw new Error("cannot parse trackName at all: " + e);
  44035. i.index === t.lastIndex && t.lastIndex++;
  44036. var n = {
  44037. nodeName: i[3],
  44038. objectName: i[5],
  44039. objectIndex: i[7],
  44040. propertyName: i[9],
  44041. propertyIndex: i[11]
  44042. };
  44043. if (null === n.propertyName || 0 === n.propertyName.length)
  44044. throw new Error("can not parse propertyName from trackName: " + e);
  44045. return n
  44046. }
  44047. ,
  44048. Ci.PropertyBinding.findNode = function(e, r) {
  44049. if (!r || "" === r || "root" === r || "." === r || -1 === r || r === e.name || r === e.uuid)
  44050. return e;
  44051. if (e.skeleton) {
  44052. var t = function(e) {
  44053. for (var t = 0; t < e.bones.length; t++) {
  44054. var i = e.bones[t];
  44055. if (i.name === r)
  44056. return i
  44057. }
  44058. return null
  44059. }(e.skeleton);
  44060. if (t)
  44061. return t
  44062. }
  44063. if (e.children) {
  44064. var o = function(e) {
  44065. for (var t = 0; t < e.length; t++) {
  44066. var i = e[t];
  44067. if (i.name === r || i.uuid === r)
  44068. return i;
  44069. var n = o(i.children);
  44070. if (n)
  44071. return n
  44072. }
  44073. return null
  44074. }
  44075. , i = o(e.children);
  44076. if (i)
  44077. return i
  44078. }
  44079. return null
  44080. }
  44081. ,
  44082. Ci.PropertyMixer = function(e, t, i) {
  44083. this.binding = e,
  44084. this.valueSize = i;
  44085. var n, r = Float64Array;
  44086. switch (t) {
  44087. case "quaternion":
  44088. n = this._slerp;
  44089. break;
  44090. case "string":
  44091. case "bool":
  44092. r = Array,
  44093. n = this._select;
  44094. break;
  44095. default:
  44096. n = this._lerp
  44097. }
  44098. this.buffer = new r(4 * i),
  44099. this._mixBufferRegion = n,
  44100. this.cumulativeWeight = 0,
  44101. this.useCount = 0,
  44102. this.referenceCount = 0
  44103. }
  44104. ,
  44105. Ci.PropertyMixer.prototype = {
  44106. constructor: Ci.PropertyMixer,
  44107. accumulate: function(e, t) {
  44108. var i = this.buffer
  44109. , n = this.valueSize
  44110. , r = e * n + n
  44111. , o = this.cumulativeWeight;
  44112. if (0 === o) {
  44113. for (var a = 0; a !== n; ++a)
  44114. i[r + a] = i[a];
  44115. o = t
  44116. } else {
  44117. var s = t / (o += t);
  44118. this._mixBufferRegion(i, r, 0, s, n)
  44119. }
  44120. this.cumulativeWeight = o
  44121. },
  44122. apply: function(e) {
  44123. var t = this.valueSize
  44124. , i = this.buffer
  44125. , n = e * t + t
  44126. , r = this.cumulativeWeight
  44127. , o = this.binding;
  44128. if (this.cumulativeWeight = 0,
  44129. r < 1) {
  44130. var a = 3 * t;
  44131. this._mixBufferRegion(i, n, a, 1 - r, t)
  44132. }
  44133. for (var s = t, l = t + t; s !== l; ++s)
  44134. if (i[s] !== i[s + t]) {
  44135. o.setValue(i, n);
  44136. break
  44137. }
  44138. },
  44139. saveOriginalState: function() {
  44140. var e = this.binding
  44141. , t = this.buffer
  44142. , i = this.valueSize
  44143. , n = 3 * i;
  44144. e.getValue(t, n);
  44145. for (var r = i, o = n; r !== o; ++r)
  44146. t[r] = t[n + r % i];
  44147. this.cumulativeWeight = 0
  44148. },
  44149. restoreOriginalState: function() {
  44150. var e = 3 * this.valueSize;
  44151. this.binding.setValue(this.buffer, e)
  44152. },
  44153. _select: function(e, t, i, n, r) {
  44154. if (.5 <= n)
  44155. for (var o = 0; o !== r; ++o)
  44156. e[t + o] = e[i + o]
  44157. },
  44158. _slerp: function(e, t, i, n, r) {
  44159. Ci.Quaternion.slerpFlat(e, t, e, t, e, i, n)
  44160. },
  44161. _lerp: function(e, t, i, n, r) {
  44162. for (var o = 1 - n, a = 0; a !== r; ++a) {
  44163. var s = t + a;
  44164. e[s] = e[s] * o + e[i + a] * n
  44165. }
  44166. }
  44167. },
  44168. Ci.BooleanKeyframeTrack = function(e, t, i) {
  44169. Ci.KeyframeTrack.call(this, e, t, i)
  44170. }
  44171. ,
  44172. Ci.BooleanKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44173. constructor: Ci.BooleanKeyframeTrack,
  44174. ValueTypeName: "bool",
  44175. ValueBufferType: Array,
  44176. DefaultInterpolation: Ci.IntepolateDiscrete,
  44177. InterpolantFactoryMethodLinear: void 0,
  44178. InterpolantFactoryMethodSmooth: void 0
  44179. }),
  44180. Ci.NumberKeyframeTrack = function(e, t, i, n) {
  44181. Ci.KeyframeTrack.call(this, e, t, i, n)
  44182. }
  44183. ,
  44184. Ci.NumberKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44185. constructor: Ci.NumberKeyframeTrack,
  44186. ValueTypeName: "number"
  44187. }),
  44188. Ci.QuaternionKeyframeTrack = function(e, t, i, n) {
  44189. Ci.KeyframeTrack.call(this, e, t, i, n)
  44190. }
  44191. ,
  44192. Ci.QuaternionKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44193. constructor: Ci.QuaternionKeyframeTrack,
  44194. ValueTypeName: "quaternion",
  44195. DefaultInterpolation: Ci.InterpolateLinear,
  44196. InterpolantFactoryMethodLinear: function(e) {
  44197. return new Ci.QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),e)
  44198. },
  44199. InterpolantFactoryMethodSmooth: void 0
  44200. }),
  44201. Ci.StringKeyframeTrack = function(e, t, i, n) {
  44202. Ci.KeyframeTrack.call(this, e, t, i, n)
  44203. }
  44204. ,
  44205. Ci.StringKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44206. constructor: Ci.StringKeyframeTrack,
  44207. ValueTypeName: "string",
  44208. ValueBufferType: Array,
  44209. DefaultInterpolation: Ci.IntepolateDiscrete,
  44210. InterpolantFactoryMethodLinear: void 0,
  44211. InterpolantFactoryMethodSmooth: void 0
  44212. }),
  44213. Ci.VectorKeyframeTrack = function(e, t, i, n) {
  44214. Ci.KeyframeTrack.call(this, e, t, i, n)
  44215. }
  44216. ,
  44217. Ci.VectorKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  44218. constructor: Ci.VectorKeyframeTrack,
  44219. ValueTypeName: "vector"
  44220. }),
  44221. Ci.Audio = function(e) {
  44222. Ci.Object3D.call(this),
  44223. this.type = "Audio",
  44224. this.context = e.context,
  44225. this.source = this.context.createBufferSource(),
  44226. this.source.onended = this.onEnded.bind(this),
  44227. this.gain = this.context.createGain(),
  44228. this.gain.connect(e.getInput()),
  44229. this.autoplay = !1,
  44230. this.startTime = 0,
  44231. this.playbackRate = 1,
  44232. this.isPlaying = !1,
  44233. this.hasPlaybackControl = !0,
  44234. this.sourceType = "empty",
  44235. this.filter = null
  44236. }
  44237. ,
  44238. Ci.Audio.prototype = Object.create(Ci.Object3D.prototype),
  44239. Ci.Audio.prototype.constructor = Ci.Audio,
  44240. Ci.Audio.prototype.getOutput = function() {
  44241. return this.gain
  44242. }
  44243. ,
  44244. Ci.Audio.prototype.load = function(e) {
  44245. var t = new Ci.AudioBuffer(this.context);
  44246. return t.load(e),
  44247. this.setBuffer(t),
  44248. this
  44249. }
  44250. ,
  44251. Ci.Audio.prototype.setNodeSource = function(e) {
  44252. return this.hasPlaybackControl = !1,
  44253. this.sourceType = "audioNode",
  44254. this.source = e,
  44255. this.connect(),
  44256. this
  44257. }
  44258. ,
  44259. Ci.Audio.prototype.setBuffer = function(e) {
  44260. var t = this;
  44261. return e.onReady(function(e) {
  44262. t.source.buffer = e,
  44263. t.sourceType = "buffer",
  44264. t.autoplay && t.play()
  44265. }),
  44266. this
  44267. }
  44268. ,
  44269. Ci.Audio.prototype.play = function() {
  44270. if (!0 !== this.isPlaying)
  44271. if (!1 !== this.hasPlaybackControl) {
  44272. var e = this.context.createBufferSource();
  44273. e.buffer = this.source.buffer,
  44274. e.loop = this.source.loop,
  44275. e.onended = this.source.onended,
  44276. e.start(0, this.startTime),
  44277. e.playbackRate.value = this.playbackRate,
  44278. this.isPlaying = !0,
  44279. this.source = e,
  44280. this.connect()
  44281. } else
  44282. console.warn("THREE.Audio: this Audio has no playback control.");
  44283. else
  44284. console.warn("THREE.Audio: Audio is already playing.")
  44285. }
  44286. ,
  44287. Ci.Audio.prototype.pause = function() {
  44288. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  44289. void (this.startTime = this.context.currentTime))
  44290. }
  44291. ,
  44292. Ci.Audio.prototype.stop = function() {
  44293. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  44294. void (this.startTime = 0))
  44295. }
  44296. ,
  44297. Ci.Audio.prototype.connect = function() {
  44298. null !== this.filter ? (this.source.connect(this.filter),
  44299. this.filter.connect(this.getOutput())) : this.source.connect(this.getOutput())
  44300. }
  44301. ,
  44302. Ci.Audio.prototype.disconnect = function() {
  44303. null !== this.filter ? (this.source.disconnect(this.filter),
  44304. this.filter.disconnect(this.getOutput())) : this.source.disconnect(this.getOutput())
  44305. }
  44306. ,
  44307. Ci.Audio.prototype.getFilter = function() {
  44308. return this.filter
  44309. }
  44310. ,
  44311. Ci.Audio.prototype.setFilter = function(e) {
  44312. void 0 === e && (e = null),
  44313. !0 === this.isPlaying ? (this.disconnect(),
  44314. this.filter = e,
  44315. this.connect()) : this.filter = e
  44316. }
  44317. ,
  44318. Ci.Audio.prototype.setPlaybackRate = function(e) {
  44319. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.playbackRate = e,
  44320. void (!0 === this.isPlaying && (this.source.playbackRate.value = this.playbackRate)))
  44321. }
  44322. ,
  44323. Ci.Audio.prototype.getPlaybackRate = function() {
  44324. return this.playbackRate
  44325. }
  44326. ,
  44327. Ci.Audio.prototype.onEnded = function() {
  44328. this.isPlaying = !1
  44329. }
  44330. ,
  44331. Ci.Audio.prototype.setLoop = function(e) {
  44332. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : void (this.source.loop = e)
  44333. }
  44334. ,
  44335. Ci.Audio.prototype.getLoop = function() {
  44336. return !1 === this.hasPlaybackControl ? (console.warn("THREE.Audio: this Audio has no playback control."),
  44337. !1) : this.source.loop
  44338. }
  44339. ,
  44340. Ci.Audio.prototype.setVolume = function(e) {
  44341. this.gain.gain.value = e
  44342. }
  44343. ,
  44344. Ci.Audio.prototype.getVolume = function() {
  44345. return this.gain.gain.value
  44346. }
  44347. ,
  44348. Ci.AudioAnalyser = function(e, t) {
  44349. this.analyser = e.context.createAnalyser(),
  44350. this.analyser.fftSize = void 0 !== t ? t : 2048,
  44351. this.data = new Uint8Array(this.analyser.frequencyBinCount),
  44352. e.getOutput().connect(this.analyser)
  44353. }
  44354. ,
  44355. Ci.AudioAnalyser.prototype = {
  44356. constructor: Ci.AudioAnalyser,
  44357. getData: function() {
  44358. return this.analyser.getByteFrequencyData(this.data),
  44359. this.data
  44360. }
  44361. },
  44362. Ci.AudioBuffer = function(e) {
  44363. this.context = e,
  44364. this.ready = !1,
  44365. this.readyCallbacks = []
  44366. }
  44367. ,
  44368. Ci.AudioBuffer.prototype.load = function(e) {
  44369. var i = this
  44370. , t = new XMLHttpRequest;
  44371. return t.open("GET", e, !0),
  44372. t.responseType = "arraybuffer",
  44373. t.onload = function(e) {
  44374. i.context.decodeAudioData(this.response, function(e) {
  44375. i.buffer = e,
  44376. i.ready = !0;
  44377. for (var t = 0; t < i.readyCallbacks.length; t++)
  44378. i.readyCallbacks[t](i.buffer);
  44379. i.readyCallbacks = []
  44380. })
  44381. }
  44382. ,
  44383. t.send(),
  44384. this
  44385. }
  44386. ,
  44387. Ci.AudioBuffer.prototype.onReady = function(e) {
  44388. this.ready ? e(this.buffer) : this.readyCallbacks.push(e)
  44389. }
  44390. ,
  44391. Ci.PositionalAudio = function(e) {
  44392. Ci.Audio.call(this, e),
  44393. this.panner = this.context.createPanner(),
  44394. this.panner.connect(this.gain)
  44395. }
  44396. ,
  44397. Ci.PositionalAudio.prototype = Object.create(Ci.Audio.prototype),
  44398. Ci.PositionalAudio.prototype.constructor = Ci.PositionalAudio,
  44399. Ci.PositionalAudio.prototype.getOutput = function() {
  44400. return this.panner
  44401. }
  44402. ,
  44403. Ci.PositionalAudio.prototype.setRefDistance = function(e) {
  44404. this.panner.refDistance = e
  44405. }
  44406. ,
  44407. Ci.PositionalAudio.prototype.getRefDistance = function() {
  44408. return this.panner.refDistance
  44409. }
  44410. ,
  44411. Ci.PositionalAudio.prototype.setRolloffFactor = function(e) {
  44412. this.panner.rolloffFactor = e
  44413. }
  44414. ,
  44415. Ci.PositionalAudio.prototype.getRolloffFactor = function() {
  44416. return this.panner.rolloffFactor
  44417. }
  44418. ,
  44419. Ci.PositionalAudio.prototype.setDistanceModel = function(e) {
  44420. this.panner.distanceModel = e
  44421. }
  44422. ,
  44423. Ci.PositionalAudio.prototype.getDistanceModel = function() {
  44424. return this.panner.distanceModel
  44425. }
  44426. ,
  44427. Ci.PositionalAudio.prototype.setMaxDistance = function(e) {
  44428. this.panner.maxDistance = e
  44429. }
  44430. ,
  44431. Ci.PositionalAudio.prototype.getMaxDistance = function() {
  44432. return this.panner.maxDistance
  44433. }
  44434. ,
  44435. Ci.PositionalAudio.prototype.updateMatrixWorld = (it = new Ci.Vector3,
  44436. function(e) {
  44437. Ci.Object3D.prototype.updateMatrixWorld.call(this, e),
  44438. it.setFromMatrixPosition(this.matrixWorld),
  44439. this.panner.setPosition(it.x, it.y, it.z)
  44440. }
  44441. ),
  44442. Ci.AudioListener = function() {
  44443. Ci.Object3D.call(this),
  44444. this.type = "AudioListener",
  44445. this.context = new (window.AudioContext || window.webkitAudioContext),
  44446. this.gain = this.context.createGain(),
  44447. this.gain.connect(this.context.destination),
  44448. this.filter = null
  44449. }
  44450. ,
  44451. Ci.AudioListener.prototype = Object.create(Ci.Object3D.prototype),
  44452. Ci.AudioListener.prototype.constructor = Ci.AudioListener,
  44453. Ci.AudioListener.prototype.getInput = function() {
  44454. return this.gain
  44455. }
  44456. ,
  44457. Ci.AudioListener.prototype.removeFilter = function() {
  44458. null !== this.filter && (this.gain.disconnect(this.filter),
  44459. this.filter.disconnect(this.context.destination),
  44460. this.gain.connect(this.context.destination),
  44461. this.filter = null)
  44462. }
  44463. ,
  44464. Ci.AudioListener.prototype.setFilter = function(e) {
  44465. null !== this.filter ? (this.gain.disconnect(this.filter),
  44466. this.filter.disconnect(this.context.destination)) : this.gain.disconnect(this.context.destination),
  44467. this.filter = e,
  44468. this.gain.connect(this.filter),
  44469. this.filter.connect(this.context.destination)
  44470. }
  44471. ,
  44472. Ci.AudioListener.prototype.getFilter = function() {
  44473. return this.filter
  44474. }
  44475. ,
  44476. Ci.AudioListener.prototype.setMasterVolume = function(e) {
  44477. this.gain.gain.value = e
  44478. }
  44479. ,
  44480. Ci.AudioListener.prototype.getMasterVolume = function() {
  44481. return this.gain.gain.value
  44482. }
  44483. ,
  44484. Ci.AudioListener.prototype.updateMatrixWorld = (Je = new Ci.Vector3,
  44485. $e = new Ci.Quaternion,
  44486. et = new Ci.Vector3,
  44487. tt = new Ci.Vector3,
  44488. function(e) {
  44489. Ci.Object3D.prototype.updateMatrixWorld.call(this, e);
  44490. var t = this.context.listener
  44491. , i = this.up;
  44492. this.matrixWorld.decompose(Je, $e, et),
  44493. tt.set(0, 0, -1).applyQuaternion($e),
  44494. t.setPosition(Je.x, Je.y, Je.z),
  44495. t.setOrientation(tt.x, tt.y, tt.z, i.x, i.y, i.z)
  44496. }
  44497. ),
  44498. Ci.Camera = function() {
  44499. Ci.Object3D.call(this),
  44500. this.type = "Camera",
  44501. this.matrixWorldInverse = new Ci.Matrix4,
  44502. this.projectionMatrix = new Ci.Matrix4
  44503. }
  44504. ,
  44505. Ci.Camera.prototype = Object.create(Ci.Object3D.prototype),
  44506. Ci.Camera.prototype.constructor = Ci.Camera,
  44507. Ci.Camera.prototype.getWorldDirection = (Qe = new Ci.Quaternion,
  44508. function(e) {
  44509. var t = e || new Ci.Vector3;
  44510. return this.getWorldQuaternion(Qe),
  44511. t.set(0, 0, -1).applyQuaternion(Qe)
  44512. }
  44513. ),
  44514. Ci.Camera.prototype.lookAt = (Ke = new Ci.Matrix4,
  44515. function(e) {
  44516. Ke.lookAt(this.position, e, this.up),
  44517. this.quaternion.setFromRotationMatrix(Ke)
  44518. }
  44519. ),
  44520. Ci.Camera.prototype.clone = function() {
  44521. return (new this.constructor).copy(this)
  44522. }
  44523. ,
  44524. Ci.Camera.prototype.copy = function(e) {
  44525. return Ci.Object3D.prototype.copy.call(this, e),
  44526. this.matrixWorldInverse.copy(e.matrixWorldInverse),
  44527. this.projectionMatrix.copy(e.projectionMatrix),
  44528. this
  44529. }
  44530. ,
  44531. Ci.CubeCamera = function(e, t, i) {
  44532. Ci.Object3D.call(this),
  44533. this.type = "CubeCamera";
  44534. var r = new Ci.PerspectiveCamera(90,1,e,t);
  44535. r.up.set(0, -1, 0),
  44536. r.lookAt(new Ci.Vector3(1,0,0)),
  44537. this.add(r);
  44538. var o = new Ci.PerspectiveCamera(90,1,e,t);
  44539. o.up.set(0, -1, 0),
  44540. o.lookAt(new Ci.Vector3(-1,0,0)),
  44541. this.add(o);
  44542. var a = new Ci.PerspectiveCamera(90,1,e,t);
  44543. a.up.set(0, 0, 1),
  44544. a.lookAt(new Ci.Vector3(0,1,0)),
  44545. this.add(a);
  44546. var s = new Ci.PerspectiveCamera(90,1,e,t);
  44547. s.up.set(0, 0, -1),
  44548. s.lookAt(new Ci.Vector3(0,-1,0)),
  44549. this.add(s);
  44550. var l = new Ci.PerspectiveCamera(90,1,e,t);
  44551. l.up.set(0, -1, 0),
  44552. l.lookAt(new Ci.Vector3(0,0,1)),
  44553. this.add(l);
  44554. var c = new Ci.PerspectiveCamera(90,1,e,t);
  44555. c.up.set(0, -1, 0),
  44556. c.lookAt(new Ci.Vector3(0,0,-1)),
  44557. this.add(c);
  44558. var n = {
  44559. format: Ci.RGBFormat,
  44560. magFilter: Ci.LinearFilter,
  44561. minFilter: Ci.LinearFilter
  44562. };
  44563. this.renderTarget = new Ci.WebGLRenderTargetCube(i,i,n),
  44564. this.updateCubeMap = function(e, t) {
  44565. null === this.parent && this.updateMatrixWorld();
  44566. var i = this.renderTarget
  44567. , n = i.texture.generateMipmaps;
  44568. i.texture.generateMipmaps = !1,
  44569. i.activeCubeFace = 0,
  44570. e.render(t, r, i),
  44571. i.activeCubeFace = 1,
  44572. e.render(t, o, i),
  44573. i.activeCubeFace = 2,
  44574. e.render(t, a, i),
  44575. i.activeCubeFace = 3,
  44576. e.render(t, s, i),
  44577. i.activeCubeFace = 4,
  44578. e.render(t, l, i),
  44579. i.texture.generateMipmaps = n,
  44580. i.activeCubeFace = 5,
  44581. e.render(t, c, i),
  44582. e.setRenderTarget(null)
  44583. }
  44584. }
  44585. ,
  44586. Ci.CubeCamera.prototype = Object.create(Ci.Object3D.prototype),
  44587. Ci.CubeCamera.prototype.constructor = Ci.CubeCamera,
  44588. Ci.OrthographicCamera = function(e, t, i, n, r, o) {
  44589. Ci.Camera.call(this),
  44590. this.type = "OrthographicCamera",
  44591. this.zoom = 1,
  44592. this.left = e,
  44593. this.right = t,
  44594. this.top = i,
  44595. this.bottom = n,
  44596. this.near = void 0 !== r ? r : .1,
  44597. this.far = void 0 !== o ? o : 2e3,
  44598. this.updateProjectionMatrix()
  44599. }
  44600. ,
  44601. Ci.OrthographicCamera.prototype = Object.create(Ci.Camera.prototype),
  44602. Ci.OrthographicCamera.prototype.constructor = Ci.OrthographicCamera,
  44603. Ci.OrthographicCamera.prototype.updateProjectionMatrix = function() {
  44604. var e = (this.right - this.left) / (2 * this.zoom)
  44605. , t = (this.top - this.bottom) / (2 * this.zoom)
  44606. , i = (this.right + this.left) / 2
  44607. , n = (this.top + this.bottom) / 2;
  44608. this.projectionMatrix.makeOrthographic(i - e, i + e, n + t, n - t, this.near, this.far)
  44609. }
  44610. ,
  44611. Ci.OrthographicCamera.prototype.copy = function(e) {
  44612. return Ci.Camera.prototype.copy.call(this, e),
  44613. this.left = e.left,
  44614. this.right = e.right,
  44615. this.top = e.top,
  44616. this.bottom = e.bottom,
  44617. this.near = e.near,
  44618. this.far = e.far,
  44619. this.zoom = e.zoom,
  44620. this
  44621. }
  44622. ,
  44623. Ci.OrthographicCamera.prototype.toJSON = function(e) {
  44624. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  44625. return t.object.zoom = this.zoom,
  44626. t.object.left = this.left,
  44627. t.object.right = this.right,
  44628. t.object.top = this.top,
  44629. t.object.bottom = this.bottom,
  44630. t.object.near = this.near,
  44631. t.object.far = this.far,
  44632. t
  44633. }
  44634. ,
  44635. Ci.PerspectiveCamera = function(e, t, i, n) {
  44636. Ci.Camera.call(this),
  44637. this.type = "PerspectiveCamera",
  44638. this.focalLength = 10,
  44639. this.zoom = 1,
  44640. this.fov = void 0 !== e ? e : 50,
  44641. this.aspect = void 0 !== t ? t : 1,
  44642. this.near = void 0 !== i ? i : .1,
  44643. this.far = void 0 !== n ? n : 2e3,
  44644. this.updateProjectionMatrix()
  44645. }
  44646. ,
  44647. Ci.PerspectiveCamera.prototype = Object.create(Ci.Camera.prototype),
  44648. Ci.PerspectiveCamera.prototype.constructor = Ci.PerspectiveCamera,
  44649. Ci.PerspectiveCamera.prototype.setLens = function(e, t) {
  44650. void 0 === t && (t = 24),
  44651. this.fov = 2 * Ci.Math.radToDeg(Math.atan(t / (2 * e))),
  44652. this.updateProjectionMatrix()
  44653. }
  44654. ,
  44655. Ci.PerspectiveCamera.prototype.setViewOffset = function(e, t, i, n, r, o) {
  44656. this.fullWidth = e,
  44657. this.fullHeight = t,
  44658. this.x = i,
  44659. this.y = n,
  44660. this.width = r,
  44661. this.height = o,
  44662. this.updateProjectionMatrix()
  44663. }
  44664. ,
  44665. Ci.PerspectiveCamera.prototype.updateProjectionMatrix = function() {
  44666. var e = Ci.Math.radToDeg(2 * Math.atan(Math.tan(.5 * Ci.Math.degToRad(this.fov)) / this.zoom));
  44667. if (this.fullWidth) {
  44668. var t = this.fullWidth / this.fullHeight
  44669. , i = Math.tan(Ci.Math.degToRad(.5 * e)) * this.near
  44670. , n = -i
  44671. , r = t * n
  44672. , o = t * i
  44673. , a = Math.abs(o - r)
  44674. , s = Math.abs(i - n);
  44675. 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)
  44676. } else
  44677. this.projectionMatrix.makePerspective(e, this.aspect, this.near, this.far)
  44678. }
  44679. ,
  44680. Ci.PerspectiveCamera.prototype.copy = function(e) {
  44681. return Ci.Camera.prototype.copy.call(this, e),
  44682. this.focalLength = e.focalLength,
  44683. this.zoom = e.zoom,
  44684. this.fov = e.fov,
  44685. this.aspect = e.aspect,
  44686. this.near = e.near,
  44687. this.far = e.far,
  44688. this
  44689. }
  44690. ,
  44691. Ci.PerspectiveCamera.prototype.toJSON = function(e) {
  44692. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  44693. return t.object.focalLength = this.focalLength,
  44694. t.object.zoom = this.zoom,
  44695. t.object.fov = this.fov,
  44696. t.object.aspect = this.aspect,
  44697. t.object.near = this.near,
  44698. t.object.far = this.far,
  44699. t
  44700. }
  44701. ,
  44702. Ci.StereoCamera = function() {
  44703. this.type = "StereoCamera",
  44704. this.aspect = 1,
  44705. this.cameraL = new Ci.PerspectiveCamera,
  44706. this.cameraL.layers.enable(1),
  44707. this.cameraL.matrixAutoUpdate = !1,
  44708. this.cameraR = new Ci.PerspectiveCamera,
  44709. this.cameraR.layers.enable(2),
  44710. this.cameraR.matrixAutoUpdate = !1
  44711. }
  44712. ,
  44713. Ci.StereoCamera.prototype = {
  44714. constructor: Ci.StereoCamera,
  44715. update: (Xe = new Ci.Matrix4,
  44716. Ze = new Ci.Matrix4,
  44717. function(e) {
  44718. if (Ge !== e.focalLength || We !== e.fov || je !== e.aspect * this.aspect || Ye !== e.near || qe !== e.far) {
  44719. Ge = e.focalLength,
  44720. We = e.fov,
  44721. je = e.aspect * this.aspect,
  44722. Ye = e.near,
  44723. qe = e.far;
  44724. var t, i, n = e.projectionMatrix.clone(), r = .032 * Ye / Ge, o = Ye * Math.tan(Ci.Math.degToRad(.5 * We));
  44725. Ze.elements[12] = -.032,
  44726. Xe.elements[12] = .032,
  44727. t = -o * je + r,
  44728. i = o * je + r,
  44729. n.elements[0] = 2 * Ye / (i - t),
  44730. n.elements[8] = (i + t) / (i - t),
  44731. this.cameraL.projectionMatrix.copy(n),
  44732. t = -o * je - r,
  44733. i = o * je - r,
  44734. n.elements[0] = 2 * Ye / (i - t),
  44735. n.elements[8] = (i + t) / (i - t),
  44736. this.cameraR.projectionMatrix.copy(n)
  44737. }
  44738. this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(Ze),
  44739. this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(Xe)
  44740. }
  44741. )
  44742. },
  44743. Ci.Light = function(e, t) {
  44744. Ci.Object3D.call(this),
  44745. this.type = "Light",
  44746. this.color = new Ci.Color(e),
  44747. this.intensity = void 0 !== t ? t : 1,
  44748. this.receiveShadow = void 0
  44749. }
  44750. ,
  44751. Ci.Light.prototype = Object.create(Ci.Object3D.prototype),
  44752. Ci.Light.prototype.constructor = Ci.Light,
  44753. Ci.Light.prototype.copy = function(e) {
  44754. return Ci.Object3D.prototype.copy.call(this, e),
  44755. this.color.copy(e.color),
  44756. this.intensity = e.intensity,
  44757. this
  44758. }
  44759. ,
  44760. Ci.Light.prototype.toJSON = function(e) {
  44761. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  44762. return t.object.color = this.color.getHex(),
  44763. t.object.intensity = this.intensity,
  44764. void 0 !== this.groundColor && (t.object.groundColor = this.groundColor.getHex()),
  44765. void 0 !== this.distance && (t.object.distance = this.distance),
  44766. void 0 !== this.angle && (t.object.angle = this.angle),
  44767. void 0 !== this.decay && (t.object.decay = this.decay),
  44768. void 0 !== this.penumbra && (t.object.penumbra = this.penumbra),
  44769. t
  44770. }
  44771. ,
  44772. Ci.LightShadow = function(e) {
  44773. this.camera = e,
  44774. this.bias = 0,
  44775. this.radius = 1,
  44776. this.mapSize = new Ci.Vector2(512,512),
  44777. this.map = null,
  44778. this.matrix = new Ci.Matrix4
  44779. }
  44780. ,
  44781. Ci.LightShadow.prototype = {
  44782. constructor: Ci.LightShadow,
  44783. copy: function(e) {
  44784. return this.camera = e.camera.clone(),
  44785. this.bias = e.bias,
  44786. this.radius = e.radius,
  44787. this.mapSize.copy(e.mapSize),
  44788. this
  44789. },
  44790. clone: function() {
  44791. return (new this.constructor).copy(this)
  44792. }
  44793. },
  44794. Ci.AmbientLight = function(e, t) {
  44795. Ci.Light.call(this, e, t),
  44796. this.type = "AmbientLight",
  44797. this.castShadow = void 0
  44798. }
  44799. ,
  44800. Ci.AmbientLight.prototype = Object.create(Ci.Light.prototype),
  44801. Ci.AmbientLight.prototype.constructor = Ci.AmbientLight,
  44802. Ci.DirectionalLight = function(e, t) {
  44803. Ci.Light.call(this, e, t),
  44804. this.type = "DirectionalLight",
  44805. this.position.set(0, 1, 0),
  44806. this.updateMatrix(),
  44807. this.target = new Ci.Object3D,
  44808. this.shadow = new Ci.LightShadow(new Ci.OrthographicCamera(-5,5,5,-5,.5,500))
  44809. }
  44810. ,
  44811. Ci.DirectionalLight.prototype = Object.create(Ci.Light.prototype),
  44812. Ci.DirectionalLight.prototype.constructor = Ci.DirectionalLight,
  44813. Ci.DirectionalLight.prototype.copy = function(e) {
  44814. return Ci.Light.prototype.copy.call(this, e),
  44815. this.target = e.target.clone(),
  44816. this.shadow = e.shadow.clone(),
  44817. this
  44818. }
  44819. ,
  44820. Ci.HemisphereLight = function(e, t, i) {
  44821. Ci.Light.call(this, e, i),
  44822. this.type = "HemisphereLight",
  44823. this.castShadow = void 0,
  44824. this.position.set(0, 1, 0),
  44825. this.updateMatrix(),
  44826. this.groundColor = new Ci.Color(t)
  44827. }
  44828. ,
  44829. Ci.HemisphereLight.prototype = Object.create(Ci.Light.prototype),
  44830. Ci.HemisphereLight.prototype.constructor = Ci.HemisphereLight,
  44831. Ci.HemisphereLight.prototype.copy = function(e) {
  44832. return Ci.Light.prototype.copy.call(this, e),
  44833. this.groundColor.copy(e.groundColor),
  44834. this
  44835. }
  44836. ,
  44837. Ci.PointLight = function(e, t, i, n) {
  44838. Ci.Light.call(this, e, t),
  44839. this.type = "PointLight",
  44840. this.distance = void 0 !== i ? i : 0,
  44841. this.decay = void 0 !== n ? n : 1,
  44842. this.shadow = new Ci.LightShadow(new Ci.PerspectiveCamera(90,1,.5,500))
  44843. }
  44844. ,
  44845. Ci.PointLight.prototype = Object.create(Ci.Light.prototype),
  44846. Ci.PointLight.prototype.constructor = Ci.PointLight,
  44847. Object.defineProperty(Ci.PointLight.prototype, "power", {
  44848. get: function() {
  44849. return 4 * this.intensity * Math.PI
  44850. },
  44851. set: function(e) {
  44852. this.intensity = e / (4 * Math.PI)
  44853. }
  44854. }),
  44855. Ci.PointLight.prototype.copy = function(e) {
  44856. return Ci.Light.prototype.copy.call(this, e),
  44857. this.distance = e.distance,
  44858. this.decay = e.decay,
  44859. this.shadow = e.shadow.clone(),
  44860. this
  44861. }
  44862. ,
  44863. Ci.SpotLight = function(e, t, i, n, r, o) {
  44864. Ci.Light.call(this, e, t),
  44865. this.type = "SpotLight",
  44866. this.position.set(0, 1, 0),
  44867. this.updateMatrix(),
  44868. this.target = new Ci.Object3D,
  44869. this.distance = void 0 !== i ? i : 0,
  44870. this.angle = void 0 !== n ? n : Math.PI / 3,
  44871. this.penumbra = void 0 !== r ? r : 0,
  44872. this.decay = void 0 !== o ? o : 1,
  44873. this.shadow = new Ci.LightShadow(new Ci.PerspectiveCamera(50,1,.5,500))
  44874. }
  44875. ,
  44876. Ci.SpotLight.prototype = Object.create(Ci.Light.prototype),
  44877. Ci.SpotLight.prototype.constructor = Ci.SpotLight,
  44878. Object.defineProperty(Ci.SpotLight.prototype, "power", {
  44879. get: function() {
  44880. return this.intensity * Math.PI
  44881. },
  44882. set: function(e) {
  44883. this.intensity = e / Math.PI
  44884. }
  44885. }),
  44886. Ci.SpotLight.prototype.copy = function(e) {
  44887. return Ci.Light.prototype.copy.call(this, e),
  44888. this.distance = e.distance,
  44889. this.angle = e.angle,
  44890. this.penumbra = e.penumbra,
  44891. this.decay = e.decay,
  44892. this.target = e.target.clone(),
  44893. this.shadow = e.shadow.clone(),
  44894. this
  44895. }
  44896. ,
  44897. Ci.Cache = {
  44898. enabled: !1,
  44899. files: {},
  44900. add: function(e, t) {
  44901. !1 !== this.enabled && (this.files[e] = t)
  44902. },
  44903. get: function(e) {
  44904. if (!1 !== this.enabled)
  44905. return this.files[e]
  44906. },
  44907. remove: function(e) {
  44908. delete this.files[e]
  44909. },
  44910. clear: function() {
  44911. this.files = {}
  44912. }
  44913. },
  44914. Ci.Loader = function() {
  44915. this.onLoadStart = function() {}
  44916. ,
  44917. this.onLoadProgress = function() {}
  44918. ,
  44919. this.onLoadComplete = function() {}
  44920. }
  44921. ,
  44922. Ci.Loader.prototype = {
  44923. constructor: Ci.Loader,
  44924. crossOrigin: void 0,
  44925. extractUrlBase: function(e) {
  44926. var t = e.split("/");
  44927. return 1 === t.length ? "./" : (t.pop(),
  44928. t.join("/") + "/")
  44929. },
  44930. initMaterials: function(e, t, i) {
  44931. for (var n = [], r = 0; r < e.length; ++r)
  44932. n[r] = this.createMaterial(e[r], t, i);
  44933. return n
  44934. },
  44935. createMaterial: function(e, c, h) {
  44936. function t(e, t, i, n, r) {
  44937. var o, a = c + e, s = Ci.Loader.Handlers.get(a);
  44938. o = null !== s ? s.load(a) : (He.setCrossOrigin(h),
  44939. He.load(a)),
  44940. void 0 !== t && (o.repeat.fromArray(t),
  44941. 1 !== t[0] && (o.wrapS = Ci.RepeatWrapping),
  44942. 1 !== t[1] && (o.wrapT = Ci.RepeatWrapping)),
  44943. void 0 !== i && o.offset.fromArray(i),
  44944. void 0 !== n && ("repeat" === n[0] && (o.wrapS = Ci.RepeatWrapping),
  44945. "mirror" === n[0] && (o.wrapS = Ci.MirroredRepeatWrapping),
  44946. "repeat" === n[1] && (o.wrapT = Ci.RepeatWrapping),
  44947. "mirror" === n[1] && (o.wrapT = Ci.MirroredRepeatWrapping)),
  44948. void 0 !== r && (o.anisotropy = r);
  44949. var l = Ci.Math.generateUUID();
  44950. return u[l] = o,
  44951. l
  44952. }
  44953. void 0 === Ue && (Ue = new Ci.Color),
  44954. void 0 === He && (He = new Ci.TextureLoader),
  44955. void 0 === ze && (ze = new Ci.MaterialLoader);
  44956. var u = {}
  44957. , i = {
  44958. uuid: Ci.Math.generateUUID(),
  44959. type: "MeshLambertMaterial"
  44960. };
  44961. for (var n in e) {
  44962. var r = e[n];
  44963. switch (n) {
  44964. case "DbgColor":
  44965. case "DbgIndex":
  44966. case "opticalDensity":
  44967. case "illumination":
  44968. break;
  44969. case "DbgName":
  44970. i.name = r;
  44971. break;
  44972. case "blending":
  44973. i.blending = Ci[r];
  44974. break;
  44975. case "colorAmbient":
  44976. case "mapAmbient":
  44977. console.warn("THREE.Loader.createMaterial:", n, "is no longer supported.");
  44978. break;
  44979. case "colorDiffuse":
  44980. i.color = Ue.fromArray(r).getHex();
  44981. break;
  44982. case "colorSpecular":
  44983. i.specular = Ue.fromArray(r).getHex();
  44984. break;
  44985. case "colorEmissive":
  44986. i.emissive = Ue.fromArray(r).getHex();
  44987. break;
  44988. case "specularCoef":
  44989. i.shininess = r;
  44990. break;
  44991. case "shading":
  44992. "basic" === r.toLowerCase() && (i.type = "MeshBasicMaterial"),
  44993. "phong" === r.toLowerCase() && (i.type = "MeshPhongMaterial");
  44994. break;
  44995. case "mapDiffuse":
  44996. i.map = t(r, e.mapDiffuseRepeat, e.mapDiffuseOffset, e.mapDiffuseWrap, e.mapDiffuseAnisotropy);
  44997. break;
  44998. case "mapDiffuseRepeat":
  44999. case "mapDiffuseOffset":
  45000. case "mapDiffuseWrap":
  45001. case "mapDiffuseAnisotropy":
  45002. break;
  45003. case "mapLight":
  45004. i.lightMap = t(r, e.mapLightRepeat, e.mapLightOffset, e.mapLightWrap, e.mapLightAnisotropy);
  45005. break;
  45006. case "mapLightRepeat":
  45007. case "mapLightOffset":
  45008. case "mapLightWrap":
  45009. case "mapLightAnisotropy":
  45010. break;
  45011. case "mapAO":
  45012. i.aoMap = t(r, e.mapAORepeat, e.mapAOOffset, e.mapAOWrap, e.mapAOAnisotropy);
  45013. break;
  45014. case "mapAORepeat":
  45015. case "mapAOOffset":
  45016. case "mapAOWrap":
  45017. case "mapAOAnisotropy":
  45018. break;
  45019. case "mapBump":
  45020. i.bumpMap = t(r, e.mapBumpRepeat, e.mapBumpOffset, e.mapBumpWrap, e.mapBumpAnisotropy);
  45021. break;
  45022. case "mapBumpScale":
  45023. i.bumpScale = r;
  45024. break;
  45025. case "mapBumpRepeat":
  45026. case "mapBumpOffset":
  45027. case "mapBumpWrap":
  45028. case "mapBumpAnisotropy":
  45029. break;
  45030. case "mapNormal":
  45031. i.normalMap = t(r, e.mapNormalRepeat, e.mapNormalOffset, e.mapNormalWrap, e.mapNormalAnisotropy);
  45032. break;
  45033. case "mapNormalFactor":
  45034. i.normalScale = [r, r];
  45035. break;
  45036. case "mapNormalRepeat":
  45037. case "mapNormalOffset":
  45038. case "mapNormalWrap":
  45039. case "mapNormalAnisotropy":
  45040. break;
  45041. case "mapSpecular":
  45042. i.specularMap = t(r, e.mapSpecularRepeat, e.mapSpecularOffset, e.mapSpecularWrap, e.mapSpecularAnisotropy);
  45043. break;
  45044. case "mapSpecularRepeat":
  45045. case "mapSpecularOffset":
  45046. case "mapSpecularWrap":
  45047. case "mapSpecularAnisotropy":
  45048. break;
  45049. case "mapAlpha":
  45050. i.alphaMap = t(r, e.mapAlphaRepeat, e.mapAlphaOffset, e.mapAlphaWrap, e.mapAlphaAnisotropy);
  45051. break;
  45052. case "mapAlphaRepeat":
  45053. case "mapAlphaOffset":
  45054. case "mapAlphaWrap":
  45055. case "mapAlphaAnisotropy":
  45056. break;
  45057. case "flipSided":
  45058. i.side = Ci.BackSide;
  45059. break;
  45060. case "doubleSided":
  45061. i.side = Ci.DoubleSide;
  45062. break;
  45063. case "transparency":
  45064. console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),
  45065. i.opacity = r;
  45066. break;
  45067. case "depthTest":
  45068. case "depthWrite":
  45069. case "colorWrite":
  45070. case "opacity":
  45071. case "reflectivity":
  45072. case "transparent":
  45073. case "visible":
  45074. case "wireframe":
  45075. i[n] = r;
  45076. break;
  45077. case "vertexColors":
  45078. !0 === r && (i.vertexColors = Ci.VertexColors),
  45079. "face" === r && (i.vertexColors = Ci.FaceColors);
  45080. break;
  45081. default:
  45082. console.error("THREE.Loader.createMaterial: Unsupported", n, r)
  45083. }
  45084. }
  45085. return "MeshBasicMaterial" === i.type && delete i.emissive,
  45086. "MeshPhongMaterial" !== i.type && delete i.specular,
  45087. i.opacity < 1 && (i.transparent = !0),
  45088. ze.setTextures(u),
  45089. ze.parse(i)
  45090. }
  45091. },
  45092. Ci.Loader.Handlers = {
  45093. handlers: [],
  45094. add: function(e, t) {
  45095. this.handlers.push(e, t)
  45096. },
  45097. get: function(e) {
  45098. for (var t = this.handlers, i = 0, n = t.length; i < n; i += 2) {
  45099. var r = t[i]
  45100. , o = t[i + 1];
  45101. if (r.test(e))
  45102. return o
  45103. }
  45104. return null
  45105. }
  45106. },
  45107. Ci.XHRLoader = function(e) {
  45108. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45109. }
  45110. ,
  45111. Ci.XHRLoader.prototype = {
  45112. constructor: Ci.XHRLoader,
  45113. load: function(i, n, t, r) {
  45114. void 0 !== this.path && (i = this.path + i);
  45115. var o = this
  45116. , e = Ci.Cache.get(i);
  45117. if (void 0 !== e)
  45118. return n && setTimeout(function() {
  45119. n(e)
  45120. }, 0),
  45121. e;
  45122. var a = new XMLHttpRequest;
  45123. return a.overrideMimeType("text/plain"),
  45124. a.open("GET", i, !0),
  45125. a.addEventListener("load", function(e) {
  45126. var t = e.target.response;
  45127. Ci.Cache.add(i, t),
  45128. 200 === this.status ? (n && n(t),
  45129. o.manager.itemEnd(i)) : 0 === this.status ? (console.warn("THREE.XHRLoader: HTTP Status 0 received."),
  45130. n && n(t),
  45131. o.manager.itemEnd(i)) : (r && r(e),
  45132. o.manager.itemError(i))
  45133. }, !1),
  45134. void 0 !== t && a.addEventListener("progress", function(e) {
  45135. t(e)
  45136. }, !1),
  45137. a.addEventListener("error", function(e) {
  45138. r && r(e),
  45139. o.manager.itemError(i)
  45140. }, !1),
  45141. void 0 !== this.responseType && (a.responseType = this.responseType),
  45142. void 0 !== this.withCredentials && (a.withCredentials = this.withCredentials),
  45143. a.send(null),
  45144. o.manager.itemStart(i),
  45145. a
  45146. },
  45147. setPath: function(e) {
  45148. this.path = e
  45149. },
  45150. setResponseType: function(e) {
  45151. this.responseType = e
  45152. },
  45153. setWithCredentials: function(e) {
  45154. this.withCredentials = e
  45155. }
  45156. },
  45157. Ci.FontLoader = function(e) {
  45158. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45159. }
  45160. ,
  45161. Ci.FontLoader.prototype = {
  45162. constructor: Ci.FontLoader,
  45163. load: function(e, t, i, n) {
  45164. new Ci.XHRLoader(this.manager).load(e, function(e) {
  45165. t(new Ci.Font(JSON.parse(e.substring(65, e.length - 2))))
  45166. }, i, n)
  45167. }
  45168. },
  45169. Ci.ImageLoader = function(e) {
  45170. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45171. }
  45172. ,
  45173. Ci.ImageLoader.prototype = {
  45174. constructor: Ci.ImageLoader,
  45175. load: function(t, i, n, r) {
  45176. void 0 !== this.path && (t = this.path + t);
  45177. var o = this
  45178. , e = Ci.Cache.get(t);
  45179. if (void 0 !== e)
  45180. return o.manager.itemStart(t),
  45181. i ? setTimeout(function() {
  45182. i(e),
  45183. o.manager.itemEnd(t)
  45184. }, 0) : o.manager.itemEnd(t),
  45185. e;
  45186. var a = document.createElement("img");
  45187. return a.addEventListener("load", function(e) {
  45188. Ci.Cache.add(t, this),
  45189. i && i(this),
  45190. o.manager.itemEnd(t)
  45191. }, !1),
  45192. void 0 !== n && a.addEventListener("progress", function(e) {
  45193. n(e)
  45194. }, !1),
  45195. a.addEventListener("error", function(e) {
  45196. r && r(e),
  45197. o.manager.itemError(t)
  45198. }, !1),
  45199. void 0 !== this.crossOrigin && (a.crossOrigin = this.crossOrigin),
  45200. o.manager.itemStart(t),
  45201. a.src = t,
  45202. a
  45203. },
  45204. setCrossOrigin: function(e) {
  45205. this.crossOrigin = e
  45206. },
  45207. setPath: function(e) {
  45208. this.path = e
  45209. }
  45210. },
  45211. Ci.JSONLoader = function(e) {
  45212. "boolean" == typeof e && (console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),
  45213. e = void 0),
  45214. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  45215. this.withCredentials = !1
  45216. }
  45217. ,
  45218. Ci.JSONLoader.prototype = {
  45219. constructor: Ci.JSONLoader,
  45220. get statusDomElement() {
  45221. return void 0 === this._statusDomElement && (this._statusDomElement = document.createElement("div")),
  45222. console.warn("THREE.JSONLoader: .statusDomElement has been removed."),
  45223. this._statusDomElement
  45224. },
  45225. load: function(o, a, e, t) {
  45226. var s = this
  45227. , l = this.texturePath && "string" == typeof this.texturePath ? this.texturePath : Ci.Loader.prototype.extractUrlBase(o)
  45228. , i = new Ci.XHRLoader(this.manager);
  45229. i.setWithCredentials(this.withCredentials),
  45230. i.load(o, function(e) {
  45231. var t = JSON.parse(e)
  45232. , i = t.metadata;
  45233. if (void 0 !== i) {
  45234. var n = i.type;
  45235. if (void 0 !== n) {
  45236. if ("object" === n.toLowerCase())
  45237. return void console.error("THREE.JSONLoader: " + o + " should be loaded with THREE.ObjectLoader instead.");
  45238. if ("scene" === n.toLowerCase())
  45239. return void console.error("THREE.JSONLoader: " + o + " should be loaded with THREE.SceneLoader instead.")
  45240. }
  45241. }
  45242. var r = s.parse(t, l);
  45243. a(r.geometry, r.materials)
  45244. }, e, t)
  45245. },
  45246. setTexturePath: function(e) {
  45247. this.texturePath = e
  45248. },
  45249. parse: function(D, e) {
  45250. var N = new Ci.Geometry
  45251. , t = void 0 !== D.scale ? 1 / D.scale : 1;
  45252. if (function(e) {
  45253. function t(e, t) {
  45254. return e & 1 << t
  45255. }
  45256. 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;
  45257. if (void 0 !== D.uvs) {
  45258. for (i = 0; i < D.uvs.length; i++)
  45259. D.uvs[i].length && L++;
  45260. for (i = 0; i < L; i++)
  45261. N.faceVertexUvs[i] = []
  45262. }
  45263. for (o = 0,
  45264. a = R.length; o < a; )
  45265. (A = new Ci.Vector3).x = R[o++] * e,
  45266. A.y = R[o++] * e,
  45267. A.z = R[o++] * e,
  45268. N.vertices.push(A);
  45269. for (o = 0,
  45270. a = M.length; o < a; )
  45271. if (d = t(u = M[o++], 0),
  45272. p = t(u, 1),
  45273. f = t(u, 3),
  45274. g = t(u, 4),
  45275. m = t(u, 5),
  45276. v = t(u, 6),
  45277. y = t(u, 7),
  45278. d) {
  45279. if ((I = new Ci.Face3).a = M[o],
  45280. I.b = M[o + 1],
  45281. I.c = M[o + 3],
  45282. (E = new Ci.Face3).a = M[o + 1],
  45283. E.b = M[o + 2],
  45284. E.c = M[o + 3],
  45285. o += 4,
  45286. p && (h = M[o++],
  45287. I.materialIndex = h,
  45288. E.materialIndex = h),
  45289. r = N.faces.length,
  45290. f)
  45291. for (i = 0; i < L; i++)
  45292. for (w = D.uvs[i],
  45293. N.faceVertexUvs[i][r] = [],
  45294. N.faceVertexUvs[i][r + 1] = [],
  45295. n = 0; n < 4; n++)
  45296. x = w[2 * (c = M[o++])],
  45297. S = w[2 * c + 1],
  45298. T = new Ci.Vector2(x,S),
  45299. 2 !== n && N.faceVertexUvs[i][r].push(T),
  45300. 0 !== n && N.faceVertexUvs[i][r + 1].push(T);
  45301. if (g && (l = 3 * M[o++],
  45302. I.normal.set(P[l++], P[l++], P[l]),
  45303. E.normal.copy(I.normal)),
  45304. m)
  45305. for (i = 0; i < 4; i++)
  45306. l = 3 * M[o++],
  45307. b = new Ci.Vector3(P[l++],P[l++],P[l]),
  45308. 2 !== i && I.vertexNormals.push(b),
  45309. 0 !== i && E.vertexNormals.push(b);
  45310. if (v && (_ = O[s = M[o++]],
  45311. I.color.setHex(_),
  45312. E.color.setHex(_)),
  45313. y)
  45314. for (i = 0; i < 4; i++)
  45315. _ = O[s = M[o++]],
  45316. 2 !== i && I.vertexColors.push(new Ci.Color(_)),
  45317. 0 !== i && E.vertexColors.push(new Ci.Color(_));
  45318. N.faces.push(I),
  45319. N.faces.push(E)
  45320. } else {
  45321. if ((C = new Ci.Face3).a = M[o++],
  45322. C.b = M[o++],
  45323. C.c = M[o++],
  45324. p && (h = M[o++],
  45325. C.materialIndex = h),
  45326. r = N.faces.length,
  45327. f)
  45328. for (i = 0; i < L; i++)
  45329. for (w = D.uvs[i],
  45330. N.faceVertexUvs[i][r] = [],
  45331. n = 0; n < 3; n++)
  45332. x = w[2 * (c = M[o++])],
  45333. S = w[2 * c + 1],
  45334. T = new Ci.Vector2(x,S),
  45335. N.faceVertexUvs[i][r].push(T);
  45336. if (g && (l = 3 * M[o++],
  45337. C.normal.set(P[l++], P[l++], P[l])),
  45338. m)
  45339. for (i = 0; i < 3; i++)
  45340. l = 3 * M[o++],
  45341. b = new Ci.Vector3(P[l++],P[l++],P[l]),
  45342. C.vertexNormals.push(b);
  45343. if (v && (s = M[o++],
  45344. C.color.setHex(O[s])),
  45345. y)
  45346. for (i = 0; i < 3; i++)
  45347. s = M[o++],
  45348. C.vertexColors.push(new Ci.Color(O[s]));
  45349. N.faces.push(C)
  45350. }
  45351. }(t),
  45352. function() {
  45353. var e = void 0 !== D.influencesPerVertex ? D.influencesPerVertex : 2;
  45354. if (D.skinWeights)
  45355. for (var t = 0, i = D.skinWeights.length; t < i; t += e) {
  45356. var n = D.skinWeights[t]
  45357. , r = 1 < e ? D.skinWeights[t + 1] : 0
  45358. , o = 2 < e ? D.skinWeights[t + 2] : 0
  45359. , a = 3 < e ? D.skinWeights[t + 3] : 0;
  45360. N.skinWeights.push(new Ci.Vector4(n,r,o,a))
  45361. }
  45362. if (D.skinIndices)
  45363. for (t = 0,
  45364. i = D.skinIndices.length; t < i; t += e) {
  45365. var s = D.skinIndices[t]
  45366. , l = 1 < e ? D.skinIndices[t + 1] : 0
  45367. , c = 2 < e ? D.skinIndices[t + 2] : 0
  45368. , h = 3 < e ? D.skinIndices[t + 3] : 0;
  45369. N.skinIndices.push(new Ci.Vector4(s,l,c,h))
  45370. }
  45371. N.bones = D.bones,
  45372. 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.")
  45373. }(),
  45374. function(e) {
  45375. if (void 0 !== D.morphTargets)
  45376. for (var t = 0, i = D.morphTargets.length; t < i; t++) {
  45377. N.morphTargets[t] = {},
  45378. N.morphTargets[t].name = D.morphTargets[t].name,
  45379. N.morphTargets[t].vertices = [];
  45380. for (var n = N.morphTargets[t].vertices, r = D.morphTargets[t].vertices, o = 0, a = r.length; o < a; o += 3) {
  45381. var s = new Ci.Vector3;
  45382. s.x = r[o] * e,
  45383. s.y = r[o + 1] * e,
  45384. s.z = r[o + 2] * e,
  45385. n.push(s)
  45386. }
  45387. }
  45388. if (void 0 !== D.morphColors && 0 < D.morphColors.length) {
  45389. console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');
  45390. var l = N.faces
  45391. , c = D.morphColors[0].colors;
  45392. for (t = 0,
  45393. i = l.length; t < i; t++)
  45394. l[t].color.fromArray(c, 3 * t)
  45395. }
  45396. }(t),
  45397. function() {
  45398. var e = []
  45399. , t = [];
  45400. void 0 !== D.animation && t.push(D.animation),
  45401. void 0 !== D.animations && (D.animations.length ? t = t.concat(D.animations) : t.push(D.animations));
  45402. for (var i = 0; i < t.length; i++) {
  45403. var n = Ci.AnimationClip.parseAnimation(t[i], N.bones);
  45404. n && e.push(n)
  45405. }
  45406. if (N.morphTargets) {
  45407. var r = Ci.AnimationClip.CreateClipsFromMorphTargetSequences(N.morphTargets, 10);
  45408. e = e.concat(r)
  45409. }
  45410. 0 < e.length && (N.animations = e)
  45411. }(),
  45412. N.computeFaceNormals(),
  45413. N.computeBoundingSphere(),
  45414. void 0 === D.materials || 0 === D.materials.length)
  45415. return {
  45416. geometry: N
  45417. };
  45418. var i = Ci.Loader.prototype.initMaterials(D.materials, e, this.crossOrigin);
  45419. return {
  45420. geometry: N,
  45421. materials: i
  45422. }
  45423. }
  45424. },
  45425. Ci.LoadingManager = function(e, t, i) {
  45426. var n = this
  45427. , r = !1
  45428. , o = 0
  45429. , a = 0;
  45430. this.onStart = void 0,
  45431. this.onLoad = e,
  45432. this.onProgress = t,
  45433. this.onError = i,
  45434. this.itemStart = function(e) {
  45435. a++,
  45436. !1 === r && void 0 !== n.onStart && n.onStart(e, o, a),
  45437. r = !0
  45438. }
  45439. ,
  45440. this.itemEnd = function(e) {
  45441. o++,
  45442. void 0 !== n.onProgress && n.onProgress(e, o, a),
  45443. o === a && (r = !1,
  45444. void 0 !== n.onLoad && n.onLoad())
  45445. }
  45446. ,
  45447. this.itemError = function(e) {
  45448. void 0 !== n.onError && n.onError(e)
  45449. }
  45450. }
  45451. ,
  45452. Ci.DefaultLoadingManager = new Ci.LoadingManager,
  45453. Ci.BufferGeometryLoader = function(e) {
  45454. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45455. }
  45456. ,
  45457. Ci.BufferGeometryLoader.prototype = {
  45458. constructor: Ci.BufferGeometryLoader,
  45459. load: function(e, t, i, n) {
  45460. var r = this;
  45461. new Ci.XHRLoader(r.manager).load(e, function(e) {
  45462. t(r.parse(JSON.parse(e)))
  45463. }, i, n)
  45464. },
  45465. parse: function(e) {
  45466. var t = new Ci.BufferGeometry
  45467. , i = e.data.index
  45468. , n = {
  45469. Int8Array: Int8Array,
  45470. Uint8Array: Uint8Array,
  45471. Uint8ClampedArray: Uint8ClampedArray,
  45472. Int16Array: Int16Array,
  45473. Uint16Array: Uint16Array,
  45474. Int32Array: Int32Array,
  45475. Uint32Array: Uint32Array,
  45476. Float32Array: Float32Array,
  45477. Float64Array: Float64Array
  45478. };
  45479. if (void 0 !== i) {
  45480. var r = new n[i.type](i.array);
  45481. t.setIndex(new Ci.BufferAttribute(r,1))
  45482. }
  45483. var o = e.data.attributes;
  45484. for (var a in o) {
  45485. var s = o[a];
  45486. r = new n[s.type](s.array);
  45487. t.addAttribute(a, new Ci.BufferAttribute(r,s.itemSize))
  45488. }
  45489. var l = e.data.groups || e.data.drawcalls || e.data.offsets;
  45490. if (void 0 !== l)
  45491. for (var c = 0, h = l.length; c !== h; ++c) {
  45492. var u = l[c];
  45493. t.addGroup(u.start, u.count, u.materialIndex)
  45494. }
  45495. var d = e.data.boundingSphere;
  45496. if (void 0 !== d) {
  45497. var p = new Ci.Vector3;
  45498. void 0 !== d.center && p.fromArray(d.center),
  45499. t.boundingSphere = new Ci.Sphere(p,d.radius)
  45500. }
  45501. return t
  45502. }
  45503. },
  45504. Ci.MaterialLoader = function(e) {
  45505. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  45506. this.textures = {}
  45507. }
  45508. ,
  45509. Ci.MaterialLoader.prototype = {
  45510. constructor: Ci.MaterialLoader,
  45511. load: function(e, t, i, n) {
  45512. var r = this;
  45513. new Ci.XHRLoader(r.manager).load(e, function(e) {
  45514. t(r.parse(JSON.parse(e)))
  45515. }, i, n)
  45516. },
  45517. setTextures: function(e) {
  45518. this.textures = e
  45519. },
  45520. getTexture: function(e) {
  45521. var t = this.textures;
  45522. return void 0 === t[e] && console.warn("THREE.MaterialLoader: Undefined texture", e),
  45523. t[e]
  45524. },
  45525. parse: function(e) {
  45526. var t = new Ci[e.type];
  45527. if (void 0 !== e.uuid && (t.uuid = e.uuid),
  45528. void 0 !== e.name && (t.name = e.name),
  45529. void 0 !== e.color && t.color.setHex(e.color),
  45530. void 0 !== e.roughness && (t.roughness = e.roughness),
  45531. void 0 !== e.metalness && (t.metalness = e.metalness),
  45532. void 0 !== e.emissive && t.emissive.setHex(e.emissive),
  45533. void 0 !== e.specular && t.specular.setHex(e.specular),
  45534. void 0 !== e.shininess && (t.shininess = e.shininess),
  45535. void 0 !== e.uniforms && (t.uniforms = e.uniforms),
  45536. void 0 !== e.vertexShader && (t.vertexShader = e.vertexShader),
  45537. void 0 !== e.fragmentShader && (t.fragmentShader = e.fragmentShader),
  45538. void 0 !== e.vertexColors && (t.vertexColors = e.vertexColors),
  45539. void 0 !== e.shading && (t.shading = e.shading),
  45540. void 0 !== e.blending && (t.blending = e.blending),
  45541. void 0 !== e.side && (t.side = e.side),
  45542. void 0 !== e.opacity && (t.opacity = e.opacity),
  45543. void 0 !== e.transparent && (t.transparent = e.transparent),
  45544. void 0 !== e.alphaTest && (t.alphaTest = e.alphaTest),
  45545. void 0 !== e.depthTest && (t.depthTest = e.depthTest),
  45546. void 0 !== e.depthWrite && (t.depthWrite = e.depthWrite),
  45547. void 0 !== e.colorWrite && (t.colorWrite = e.colorWrite),
  45548. void 0 !== e.wireframe && (t.wireframe = e.wireframe),
  45549. void 0 !== e.wireframeLinewidth && (t.wireframeLinewidth = e.wireframeLinewidth),
  45550. void 0 !== e.size && (t.size = e.size),
  45551. void 0 !== e.sizeAttenuation && (t.sizeAttenuation = e.sizeAttenuation),
  45552. void 0 !== e.map && (t.map = this.getTexture(e.map)),
  45553. void 0 !== e.alphaMap && (t.alphaMap = this.getTexture(e.alphaMap),
  45554. t.transparent = !0),
  45555. void 0 !== e.bumpMap && (t.bumpMap = this.getTexture(e.bumpMap)),
  45556. void 0 !== e.bumpScale && (t.bumpScale = e.bumpScale),
  45557. void 0 !== e.normalMap && (t.normalMap = this.getTexture(e.normalMap)),
  45558. void 0 !== e.normalScale) {
  45559. var i = e.normalScale;
  45560. !1 === Array.isArray(i) && (i = [i, i]),
  45561. t.normalScale = (new Ci.Vector2).fromArray(i)
  45562. }
  45563. if (void 0 !== e.displacementMap && (t.displacementMap = this.getTexture(e.displacementMap)),
  45564. void 0 !== e.displacementScale && (t.displacementScale = e.displacementScale),
  45565. void 0 !== e.displacementBias && (t.displacementBias = e.displacementBias),
  45566. void 0 !== e.roughnessMap && (t.roughnessMap = this.getTexture(e.roughnessMap)),
  45567. void 0 !== e.metalnessMap && (t.metalnessMap = this.getTexture(e.metalnessMap)),
  45568. void 0 !== e.emissiveMap && (t.emissiveMap = this.getTexture(e.emissiveMap)),
  45569. void 0 !== e.emissiveIntensity && (t.emissiveIntensity = e.emissiveIntensity),
  45570. void 0 !== e.specularMap && (t.specularMap = this.getTexture(e.specularMap)),
  45571. void 0 !== e.envMap && (t.envMap = this.getTexture(e.envMap),
  45572. t.combine = Ci.MultiplyOperation),
  45573. e.reflectivity && (t.reflectivity = e.reflectivity),
  45574. void 0 !== e.lightMap && (t.lightMap = this.getTexture(e.lightMap)),
  45575. void 0 !== e.lightMapIntensity && (t.lightMapIntensity = e.lightMapIntensity),
  45576. void 0 !== e.aoMap && (t.aoMap = this.getTexture(e.aoMap)),
  45577. void 0 !== e.aoMapIntensity && (t.aoMapIntensity = e.aoMapIntensity),
  45578. void 0 !== e.materials)
  45579. for (var n = 0, r = e.materials.length; n < r; n++)
  45580. t.materials.push(this.parse(e.materials[n]));
  45581. return t
  45582. }
  45583. },
  45584. Ci.ObjectLoader = function(e) {
  45585. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  45586. this.texturePath = ""
  45587. }
  45588. ,
  45589. Ci.ObjectLoader.prototype = {
  45590. constructor: Ci.ObjectLoader,
  45591. load: function(e, t, i, n) {
  45592. "" === this.texturePath && (this.texturePath = e.substring(0, e.lastIndexOf("/") + 1));
  45593. var r = this;
  45594. new Ci.XHRLoader(r.manager).load(e, function(e) {
  45595. r.parse(JSON.parse(e), t)
  45596. }, i, n)
  45597. },
  45598. setTexturePath: function(e) {
  45599. this.texturePath = e
  45600. },
  45601. setCrossOrigin: function(e) {
  45602. this.crossOrigin = e
  45603. },
  45604. parse: function(e, t) {
  45605. var i = this.parseGeometries(e.geometries)
  45606. , n = this.parseImages(e.images, function() {
  45607. void 0 !== t && t(a)
  45608. })
  45609. , r = this.parseTextures(e.textures, n)
  45610. , o = this.parseMaterials(e.materials, r)
  45611. , a = this.parseObject(e.object, i, o);
  45612. return e.animations && (a.animations = this.parseAnimations(e.animations)),
  45613. void 0 !== e.images && 0 !== e.images.length || void 0 !== t && t(a),
  45614. a
  45615. },
  45616. parseGeometries: function(e) {
  45617. var t = {};
  45618. if (void 0 !== e)
  45619. for (var i = new Ci.JSONLoader, n = new Ci.BufferGeometryLoader, r = 0, o = e.length; r < o; r++) {
  45620. var a, s = e[r];
  45621. switch (s.type) {
  45622. case "PlaneGeometry":
  45623. case "PlaneBufferGeometry":
  45624. a = new Ci[s.type](s.width,s.height,s.widthSegments,s.heightSegments);
  45625. break;
  45626. case "BoxGeometry":
  45627. case "BoxBufferGeometry":
  45628. case "CubeGeometry":
  45629. a = new Ci[s.type](s.width,s.height,s.depth,s.widthSegments,s.heightSegments,s.depthSegments);
  45630. break;
  45631. case "CircleGeometry":
  45632. case "CircleBufferGeometry":
  45633. a = new Ci[s.type](s.radius,s.segments,s.thetaStart,s.thetaLength);
  45634. break;
  45635. case "CylinderGeometry":
  45636. case "CylinderBufferGeometry":
  45637. a = new Ci[s.type](s.radiusTop,s.radiusBottom,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);
  45638. break;
  45639. case "SphereGeometry":
  45640. case "SphereBufferGeometry":
  45641. a = new Ci[s.type](s.radius,s.widthSegments,s.heightSegments,s.phiStart,s.phiLength,s.thetaStart,s.thetaLength);
  45642. break;
  45643. case "DodecahedronGeometry":
  45644. a = new Ci.DodecahedronGeometry(s.radius,s.detail);
  45645. break;
  45646. case "IcosahedronGeometry":
  45647. a = new Ci.IcosahedronGeometry(s.radius,s.detail);
  45648. break;
  45649. case "OctahedronGeometry":
  45650. a = new Ci.OctahedronGeometry(s.radius,s.detail);
  45651. break;
  45652. case "TetrahedronGeometry":
  45653. a = new Ci.TetrahedronGeometry(s.radius,s.detail);
  45654. break;
  45655. case "RingGeometry":
  45656. case "RingBufferGeometry":
  45657. a = new Ci[s.type](s.innerRadius,s.outerRadius,s.thetaSegments,s.phiSegments,s.thetaStart,s.thetaLength);
  45658. break;
  45659. case "TorusGeometry":
  45660. case "TorusBufferGeometry":
  45661. a = new Ci[s.type](s.radius,s.tube,s.radialSegments,s.tubularSegments,s.arc);
  45662. break;
  45663. case "TorusKnotGeometry":
  45664. case "TorusKnotBufferGeometry":
  45665. a = new Ci[s.type](s.radius,s.tube,s.tubularSegments,s.radialSegments,s.p,s.q);
  45666. break;
  45667. case "LatheGeometry":
  45668. a = new Ci.LatheGeometry(s.points,s.segments,s.phiStart,s.phiLength);
  45669. break;
  45670. case "BufferGeometry":
  45671. a = n.parse(s);
  45672. break;
  45673. case "Geometry":
  45674. a = i.parse(s.data, this.texturePath).geometry;
  45675. break;
  45676. default:
  45677. console.warn('THREE.ObjectLoader: Unsupported geometry type "' + s.type + '"');
  45678. continue
  45679. }
  45680. a.uuid = s.uuid,
  45681. void 0 !== s.name && (a.name = s.name),
  45682. t[s.uuid] = a
  45683. }
  45684. return t
  45685. },
  45686. parseMaterials: function(e, t) {
  45687. var i = {};
  45688. if (void 0 !== e) {
  45689. var n = new Ci.MaterialLoader;
  45690. n.setTextures(t);
  45691. for (var r = 0, o = e.length; r < o; r++) {
  45692. var a = n.parse(e[r]);
  45693. i[a.uuid] = a
  45694. }
  45695. }
  45696. return i
  45697. },
  45698. parseAnimations: function(e) {
  45699. for (var t = [], i = 0; i < e.length; i++) {
  45700. var n = Ci.AnimationClip.parse(e[i]);
  45701. t.push(n)
  45702. }
  45703. return t
  45704. },
  45705. parseImages: function(e, t) {
  45706. function i(e) {
  45707. return n.manager.itemStart(e),
  45708. a.load(e, function() {
  45709. n.manager.itemEnd(e)
  45710. })
  45711. }
  45712. var n = this
  45713. , r = {};
  45714. if (void 0 !== e && 0 < e.length) {
  45715. var o = new Ci.LoadingManager(t)
  45716. , a = new Ci.ImageLoader(o);
  45717. a.setCrossOrigin(this.crossOrigin);
  45718. for (var s = 0, l = e.length; s < l; s++) {
  45719. var c = e[s]
  45720. , h = /^(\/\/)|([a-z]+:(\/\/)?)/i.test(c.url) ? c.url : n.texturePath + c.url;
  45721. r[c.uuid] = i(h)
  45722. }
  45723. }
  45724. return r
  45725. },
  45726. parseTextures: function(e, t) {
  45727. function i(e) {
  45728. return "number" == typeof e ? e : (console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.", e),
  45729. Ci[e])
  45730. }
  45731. var n = {};
  45732. if (void 0 !== e)
  45733. for (var r = 0, o = e.length; r < o; r++) {
  45734. var a = e[r];
  45735. void 0 === a.image && console.warn('THREE.ObjectLoader: No "image" specified for', a.uuid),
  45736. void 0 === t[a.image] && console.warn("THREE.ObjectLoader: Undefined image", a.image);
  45737. var s = new Ci.Texture(t[a.image]);
  45738. s.needsUpdate = !0,
  45739. s.uuid = a.uuid,
  45740. void 0 !== a.name && (s.name = a.name),
  45741. void 0 !== a.mapping && (s.mapping = i(a.mapping)),
  45742. void 0 !== a.offset && (s.offset = new Ci.Vector2(a.offset[0],a.offset[1])),
  45743. void 0 !== a.repeat && (s.repeat = new Ci.Vector2(a.repeat[0],a.repeat[1])),
  45744. void 0 !== a.minFilter && (s.minFilter = i(a.minFilter)),
  45745. void 0 !== a.magFilter && (s.magFilter = i(a.magFilter)),
  45746. void 0 !== a.anisotropy && (s.anisotropy = a.anisotropy),
  45747. Array.isArray(a.wrap) && (s.wrapS = i(a.wrap[0]),
  45748. s.wrapT = i(a.wrap[1])),
  45749. n[a.uuid] = s
  45750. }
  45751. return n
  45752. },
  45753. parseObject: (ke = new Ci.Matrix4,
  45754. function(e, t, i) {
  45755. function n(e) {
  45756. return void 0 === t[e] && console.warn("THREE.ObjectLoader: Undefined geometry", e),
  45757. t[e]
  45758. }
  45759. function r(e) {
  45760. if (void 0 !== e)
  45761. return void 0 === i[e] && console.warn("THREE.ObjectLoader: Undefined material", e),
  45762. i[e]
  45763. }
  45764. var o;
  45765. switch (e.type) {
  45766. case "Scene":
  45767. o = new Ci.Scene;
  45768. break;
  45769. case "PerspectiveCamera":
  45770. o = new Ci.PerspectiveCamera(e.fov,e.aspect,e.near,e.far);
  45771. break;
  45772. case "OrthographicCamera":
  45773. o = new Ci.OrthographicCamera(e.left,e.right,e.top,e.bottom,e.near,e.far);
  45774. break;
  45775. case "AmbientLight":
  45776. o = new Ci.AmbientLight(e.color,e.intensity);
  45777. break;
  45778. case "DirectionalLight":
  45779. o = new Ci.DirectionalLight(e.color,e.intensity);
  45780. break;
  45781. case "PointLight":
  45782. o = new Ci.PointLight(e.color,e.intensity,e.distance,e.decay);
  45783. break;
  45784. case "SpotLight":
  45785. o = new Ci.SpotLight(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);
  45786. break;
  45787. case "HemisphereLight":
  45788. o = new Ci.HemisphereLight(e.color,e.groundColor,e.intensity);
  45789. break;
  45790. case "Mesh":
  45791. var a = n(e.geometry)
  45792. , s = r(e.material);
  45793. o = a.bones && 0 < a.bones.length ? new Ci.SkinnedMesh(a,s) : new Ci.Mesh(a,s);
  45794. break;
  45795. case "LOD":
  45796. o = new Ci.LOD;
  45797. break;
  45798. case "Line":
  45799. o = new Ci.Line(n(e.geometry),r(e.material),e.mode);
  45800. break;
  45801. case "PointCloud":
  45802. case "Points":
  45803. o = new Ci.Points(n(e.geometry),r(e.material));
  45804. break;
  45805. case "Sprite":
  45806. o = new Ci.Sprite(r(e.material));
  45807. break;
  45808. case "Group":
  45809. o = new Ci.Group;
  45810. break;
  45811. default:
  45812. o = new Ci.Object3D
  45813. }
  45814. if (o.uuid = e.uuid,
  45815. void 0 !== e.name && (o.name = e.name),
  45816. void 0 !== e.matrix ? (ke.fromArray(e.matrix),
  45817. ke.decompose(o.position, o.quaternion, o.scale)) : (void 0 !== e.position && o.position.fromArray(e.position),
  45818. void 0 !== e.rotation && o.rotation.fromArray(e.rotation),
  45819. void 0 !== e.scale && o.scale.fromArray(e.scale)),
  45820. void 0 !== e.castShadow && (o.castShadow = e.castShadow),
  45821. void 0 !== e.receiveShadow && (o.receiveShadow = e.receiveShadow),
  45822. void 0 !== e.visible && (o.visible = e.visible),
  45823. void 0 !== e.userData && (o.userData = e.userData),
  45824. void 0 !== e.children)
  45825. for (var l in e.children)
  45826. o.add(this.parseObject(e.children[l], t, i));
  45827. if ("LOD" === e.type)
  45828. for (var c = e.levels, h = 0; h < c.length; h++) {
  45829. var u = c[h];
  45830. void 0 !== (l = o.getObjectByProperty("uuid", u.object)) && o.addLevel(l, u.distance)
  45831. }
  45832. return o
  45833. }
  45834. )
  45835. },
  45836. Ci.TextureLoader = function(e) {
  45837. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45838. }
  45839. ,
  45840. Ci.TextureLoader.prototype = {
  45841. constructor: Ci.TextureLoader,
  45842. load: function(e, t, i, n) {
  45843. var r = new Ci.Texture
  45844. , o = new Ci.ImageLoader(this.manager);
  45845. return o.setCrossOrigin(this.crossOrigin),
  45846. o.setPath(this.path),
  45847. o.load(e, function(e) {
  45848. r.image = e,
  45849. r.needsUpdate = !0,
  45850. void 0 !== t && t(r)
  45851. }, i, n),
  45852. r
  45853. },
  45854. setCrossOrigin: function(e) {
  45855. this.crossOrigin = e
  45856. },
  45857. setPath: function(e) {
  45858. this.path = e
  45859. }
  45860. },
  45861. Ci.CubeTextureLoader = function(e) {
  45862. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45863. }
  45864. ,
  45865. Ci.CubeTextureLoader.prototype = {
  45866. constructor: Ci.CubeTextureLoader,
  45867. load: function(e, i, t, n) {
  45868. function r(t) {
  45869. a.load(e[t], function(e) {
  45870. o.images[t] = e,
  45871. 6 === ++s && (o.needsUpdate = !0,
  45872. i && i(o))
  45873. }, void 0, n)
  45874. }
  45875. var o = new Ci.CubeTexture
  45876. , a = new Ci.ImageLoader(this.manager);
  45877. a.setCrossOrigin(this.crossOrigin),
  45878. a.setPath(this.path);
  45879. for (var s = 0, l = 0; l < e.length; ++l)
  45880. r(l);
  45881. return o
  45882. },
  45883. setCrossOrigin: function(e) {
  45884. this.crossOrigin = e
  45885. },
  45886. setPath: function(e) {
  45887. this.path = e
  45888. }
  45889. },
  45890. Ci.DataTextureLoader = Ci.BinaryTextureLoader = function(e) {
  45891. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  45892. this._parser = null
  45893. }
  45894. ,
  45895. Ci.BinaryTextureLoader.prototype = {
  45896. constructor: Ci.BinaryTextureLoader,
  45897. load: function(e, i, t, n) {
  45898. var r = this
  45899. , o = new Ci.DataTexture
  45900. , a = new Ci.XHRLoader(this.manager);
  45901. return a.setResponseType("arraybuffer"),
  45902. a.load(e, function(e) {
  45903. var t = r._parser(e);
  45904. t && (void 0 !== t.image ? o.image = t.image : void 0 !== t.data && (o.image.width = t.width,
  45905. o.image.height = t.height,
  45906. o.image.data = t.data),
  45907. o.wrapS = void 0 !== t.wrapS ? t.wrapS : Ci.ClampToEdgeWrapping,
  45908. o.wrapT = void 0 !== t.wrapT ? t.wrapT : Ci.ClampToEdgeWrapping,
  45909. o.magFilter = void 0 !== t.magFilter ? t.magFilter : Ci.LinearFilter,
  45910. o.minFilter = void 0 !== t.minFilter ? t.minFilter : Ci.LinearMipMapLinearFilter,
  45911. o.anisotropy = void 0 !== t.anisotropy ? t.anisotropy : 1,
  45912. void 0 !== t.format && (o.format = t.format),
  45913. void 0 !== t.type && (o.type = t.type),
  45914. void 0 !== t.mipmaps && (o.mipmaps = t.mipmaps),
  45915. 1 === t.mipmapCount && (o.minFilter = Ci.LinearFilter),
  45916. o.needsUpdate = !0,
  45917. i && i(o, t))
  45918. }, t, n),
  45919. o
  45920. }
  45921. },
  45922. Ci.CompressedTextureLoader = function(e) {
  45923. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  45924. this._parser = null
  45925. }
  45926. ,
  45927. Ci.CompressedTextureLoader.prototype = {
  45928. constructor: Ci.CompressedTextureLoader,
  45929. load: function(e, o, t, n) {
  45930. function i(i) {
  45931. r.load(e[i], function(e) {
  45932. var t = a._parser(e, !0);
  45933. s[i] = {
  45934. width: t.width,
  45935. height: t.height,
  45936. format: t.format,
  45937. mipmaps: t.mipmaps
  45938. },
  45939. 6 === (c += 1) && (1 === t.mipmapCount && (l.minFilter = Ci.LinearFilter),
  45940. l.format = t.format,
  45941. l.needsUpdate = !0,
  45942. o && o(l))
  45943. }, t, n)
  45944. }
  45945. var a = this
  45946. , s = []
  45947. , l = new Ci.CompressedTexture;
  45948. l.image = s;
  45949. var r = new Ci.XHRLoader(this.manager);
  45950. if (r.setPath(this.path),
  45951. r.setResponseType("arraybuffer"),
  45952. Array.isArray(e))
  45953. for (var c = 0, h = 0, u = e.length; h < u; ++h)
  45954. i(h);
  45955. else
  45956. r.load(e, function(e) {
  45957. var t = a._parser(e, !0);
  45958. if (t.isCubemap)
  45959. for (var i = t.mipmaps.length / t.mipmapCount, n = 0; n < i; n++) {
  45960. s[n] = {
  45961. mipmaps: []
  45962. };
  45963. for (var r = 0; r < t.mipmapCount; r++)
  45964. s[n].mipmaps.push(t.mipmaps[n * t.mipmapCount + r]),
  45965. s[n].format = t.format,
  45966. s[n].width = t.width,
  45967. s[n].height = t.height
  45968. }
  45969. else
  45970. l.image.width = t.width,
  45971. l.image.height = t.height,
  45972. l.mipmaps = t.mipmaps;
  45973. 1 === t.mipmapCount && (l.minFilter = Ci.LinearFilter),
  45974. l.format = t.format,
  45975. l.needsUpdate = !0,
  45976. o && o(l)
  45977. }, t, n);
  45978. return l
  45979. },
  45980. setPath: function(e) {
  45981. this.path = e
  45982. }
  45983. },
  45984. Ci.Material = function() {
  45985. Object.defineProperty(this, "id", {
  45986. value: Ci.MaterialIdCount++
  45987. }),
  45988. this.uuid = Ci.Math.generateUUID(),
  45989. this.name = "",
  45990. this.type = "Material",
  45991. this.side = Ci.FrontSide,
  45992. this.opacity = 1,
  45993. this.transparent = !1,
  45994. this.blending = Ci.NormalBlending,
  45995. this.blendSrc = Ci.SrcAlphaFactor,
  45996. this.blendDst = Ci.OneMinusSrcAlphaFactor,
  45997. this.blendEquation = Ci.AddEquation,
  45998. this.blendSrcAlpha = null,
  45999. this.blendDstAlpha = null,
  46000. this.blendEquationAlpha = null,
  46001. this.depthFunc = Ci.LessEqualDepth,
  46002. this.depthTest = !0,
  46003. this.depthWrite = !0,
  46004. this.colorWrite = !0,
  46005. this.precision = null,
  46006. this.polygonOffset = !1,
  46007. this.polygonOffsetFactor = 0,
  46008. this.polygonOffsetUnits = 0,
  46009. this.alphaTest = 0,
  46010. this.premultipliedAlpha = !1,
  46011. this.overdraw = 0,
  46012. this.visible = !0,
  46013. this._needsUpdate = !0
  46014. }
  46015. ,
  46016. Ci.Material.prototype = {
  46017. constructor: Ci.Material,
  46018. get needsUpdate() {
  46019. return this._needsUpdate
  46020. },
  46021. set needsUpdate(e) {
  46022. !0 === e && this.update(),
  46023. this._needsUpdate = e
  46024. },
  46025. setValues: function(e) {
  46026. if (void 0 !== e)
  46027. for (var t in e) {
  46028. var i = e[t];
  46029. if (void 0 !== i) {
  46030. var n = this[t];
  46031. 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.")
  46032. } else
  46033. console.warn("THREE.Material: '" + t + "' parameter is undefined.")
  46034. }
  46035. },
  46036. toJSON: function(e) {
  46037. function t(e) {
  46038. var t = [];
  46039. for (var i in e) {
  46040. var n = e[i];
  46041. delete n.metadata,
  46042. t.push(n)
  46043. }
  46044. return t
  46045. }
  46046. var i = void 0 === e;
  46047. i && (e = {
  46048. textures: {},
  46049. images: {}
  46050. });
  46051. var n = {
  46052. metadata: {
  46053. version: 4.4,
  46054. type: "Material",
  46055. generator: "Material.toJSON"
  46056. }
  46057. };
  46058. if (n.uuid = this.uuid,
  46059. n.type = this.type,
  46060. "" !== this.name && (n.name = this.name),
  46061. this.color instanceof Ci.Color && (n.color = this.color.getHex()),
  46062. .5 !== this.roughness && (n.roughness = this.roughness),
  46063. .5 !== this.metalness && (n.metalness = this.metalness),
  46064. this.emissive instanceof Ci.Color && (n.emissive = this.emissive.getHex()),
  46065. this.specular instanceof Ci.Color && (n.specular = this.specular.getHex()),
  46066. void 0 !== this.shininess && (n.shininess = this.shininess),
  46067. this.map instanceof Ci.Texture && (n.map = this.map.toJSON(e).uuid),
  46068. this.alphaMap instanceof Ci.Texture && (n.alphaMap = this.alphaMap.toJSON(e).uuid),
  46069. this.lightMap instanceof Ci.Texture && (n.lightMap = this.lightMap.toJSON(e).uuid),
  46070. this.bumpMap instanceof Ci.Texture && (n.bumpMap = this.bumpMap.toJSON(e).uuid,
  46071. n.bumpScale = this.bumpScale),
  46072. this.normalMap instanceof Ci.Texture && (n.normalMap = this.normalMap.toJSON(e).uuid,
  46073. n.normalScale = this.normalScale.toArray()),
  46074. this.displacementMap instanceof Ci.Texture && (n.displacementMap = this.displacementMap.toJSON(e).uuid,
  46075. n.displacementScale = this.displacementScale,
  46076. n.displacementBias = this.displacementBias),
  46077. this.roughnessMap instanceof Ci.Texture && (n.roughnessMap = this.roughnessMap.toJSON(e).uuid),
  46078. this.metalnessMap instanceof Ci.Texture && (n.metalnessMap = this.metalnessMap.toJSON(e).uuid),
  46079. this.emissiveMap instanceof Ci.Texture && (n.emissiveMap = this.emissiveMap.toJSON(e).uuid),
  46080. this.specularMap instanceof Ci.Texture && (n.specularMap = this.specularMap.toJSON(e).uuid),
  46081. this.envMap instanceof Ci.Texture && (n.envMap = this.envMap.toJSON(e).uuid,
  46082. n.reflectivity = this.reflectivity),
  46083. void 0 !== this.size && (n.size = this.size),
  46084. void 0 !== this.sizeAttenuation && (n.sizeAttenuation = this.sizeAttenuation),
  46085. void 0 !== this.vertexColors && this.vertexColors !== Ci.NoColors && (n.vertexColors = this.vertexColors),
  46086. void 0 !== this.shading && this.shading !== Ci.SmoothShading && (n.shading = this.shading),
  46087. void 0 !== this.blending && this.blending !== Ci.NormalBlending && (n.blending = this.blending),
  46088. void 0 !== this.side && this.side !== Ci.FrontSide && (n.side = this.side),
  46089. this.opacity < 1 && (n.opacity = this.opacity),
  46090. !0 === this.transparent && (n.transparent = this.transparent),
  46091. 0 < this.alphaTest && (n.alphaTest = this.alphaTest),
  46092. !0 === this.premultipliedAlpha && (n.premultipliedAlpha = this.premultipliedAlpha),
  46093. !0 === this.wireframe && (n.wireframe = this.wireframe),
  46094. 1 < this.wireframeLinewidth && (n.wireframeLinewidth = this.wireframeLinewidth),
  46095. i) {
  46096. var r = t(e.textures)
  46097. , o = t(e.images);
  46098. 0 < r.length && (n.textures = r),
  46099. 0 < o.length && (n.images = o)
  46100. }
  46101. return n
  46102. },
  46103. clone: function() {
  46104. return (new this.constructor).copy(this)
  46105. },
  46106. copy: function(e) {
  46107. return this.name = e.name,
  46108. this.side = e.side,
  46109. this.opacity = e.opacity,
  46110. this.transparent = e.transparent,
  46111. this.blending = e.blending,
  46112. this.blendSrc = e.blendSrc,
  46113. this.blendDst = e.blendDst,
  46114. this.blendEquation = e.blendEquation,
  46115. this.blendSrcAlpha = e.blendSrcAlpha,
  46116. this.blendDstAlpha = e.blendDstAlpha,
  46117. this.blendEquationAlpha = e.blendEquationAlpha,
  46118. this.depthFunc = e.depthFunc,
  46119. this.depthTest = e.depthTest,
  46120. this.depthWrite = e.depthWrite,
  46121. this.colorWrite = e.colorWrite,
  46122. this.precision = e.precision,
  46123. this.polygonOffset = e.polygonOffset,
  46124. this.polygonOffsetFactor = e.polygonOffsetFactor,
  46125. this.polygonOffsetUnits = e.polygonOffsetUnits,
  46126. this.alphaTest = e.alphaTest,
  46127. this.premultipliedAlpha = e.premultipliedAlpha,
  46128. this.overdraw = e.overdraw,
  46129. this.visible = e.visible,
  46130. this
  46131. },
  46132. update: function() {
  46133. this.dispatchEvent({
  46134. type: "update"
  46135. })
  46136. },
  46137. dispose: function() {
  46138. this.dispatchEvent({
  46139. type: "dispose"
  46140. })
  46141. }
  46142. },
  46143. Ci.EventDispatcher.prototype.apply(Ci.Material.prototype),
  46144. Ci.MaterialIdCount = 0,
  46145. Ci.LineBasicMaterial = function(e) {
  46146. Ci.Material.call(this),
  46147. this.type = "LineBasicMaterial",
  46148. this.color = new Ci.Color(16777215),
  46149. this.linewidth = 1,
  46150. this.linecap = "round",
  46151. this.linejoin = "round",
  46152. this.blending = Ci.NormalBlending,
  46153. this.vertexColors = Ci.NoColors,
  46154. this.fog = !0,
  46155. this.setValues(e)
  46156. }
  46157. ,
  46158. Ci.LineBasicMaterial.prototype = Object.create(Ci.Material.prototype),
  46159. Ci.LineBasicMaterial.prototype.constructor = Ci.LineBasicMaterial,
  46160. Ci.LineBasicMaterial.prototype.copy = function(e) {
  46161. return Ci.Material.prototype.copy.call(this, e),
  46162. this.color.copy(e.color),
  46163. this.linewidth = e.linewidth,
  46164. this.linecap = e.linecap,
  46165. this.linejoin = e.linejoin,
  46166. this.vertexColors = e.vertexColors,
  46167. this.fog = e.fog,
  46168. this
  46169. }
  46170. ,
  46171. Ci.LineDashedMaterial = function(e) {
  46172. Ci.Material.call(this),
  46173. this.type = "LineDashedMaterial",
  46174. this.color = new Ci.Color(16777215),
  46175. this.linewidth = 1,
  46176. this.scale = 1,
  46177. this.dashSize = 3,
  46178. this.gapSize = 1,
  46179. this.blending = Ci.NormalBlending,
  46180. this.vertexColors = Ci.NoColors,
  46181. this.fog = !0,
  46182. this.setValues(e)
  46183. }
  46184. ,
  46185. Ci.LineDashedMaterial.prototype = Object.create(Ci.Material.prototype),
  46186. Ci.LineDashedMaterial.prototype.constructor = Ci.LineDashedMaterial,
  46187. Ci.LineDashedMaterial.prototype.copy = function(e) {
  46188. return Ci.Material.prototype.copy.call(this, e),
  46189. this.color.copy(e.color),
  46190. this.linewidth = e.linewidth,
  46191. this.scale = e.scale,
  46192. this.dashSize = e.dashSize,
  46193. this.gapSize = e.gapSize,
  46194. this.vertexColors = e.vertexColors,
  46195. this.fog = e.fog,
  46196. this
  46197. }
  46198. ,
  46199. Ci.MeshBasicMaterial = function(e) {
  46200. Ci.Material.call(this),
  46201. this.type = "MeshBasicMaterial",
  46202. this.color = new Ci.Color(16777215),
  46203. this.map = null,
  46204. this.aoMap = null,
  46205. this.aoMapIntensity = 1,
  46206. this.specularMap = null,
  46207. this.alphaMap = null,
  46208. this.envMap = null,
  46209. this.combine = Ci.MultiplyOperation,
  46210. this.reflectivity = 1,
  46211. this.refractionRatio = .98,
  46212. this.fog = !0,
  46213. this.shading = Ci.SmoothShading,
  46214. this.blending = Ci.NormalBlending,
  46215. this.wireframe = !1,
  46216. this.wireframeLinewidth = 1,
  46217. this.wireframeLinecap = "round",
  46218. this.wireframeLinejoin = "round",
  46219. this.vertexColors = Ci.NoColors,
  46220. this.skinning = !1,
  46221. this.morphTargets = !1,
  46222. this.setValues(e)
  46223. }
  46224. ,
  46225. Ci.MeshBasicMaterial.prototype = Object.create(Ci.Material.prototype),
  46226. Ci.MeshBasicMaterial.prototype.constructor = Ci.MeshBasicMaterial,
  46227. Ci.MeshBasicMaterial.prototype.copy = function(e) {
  46228. return Ci.Material.prototype.copy.call(this, e),
  46229. this.color.copy(e.color),
  46230. this.map = e.map,
  46231. this.aoMap = e.aoMap,
  46232. this.aoMapIntensity = e.aoMapIntensity,
  46233. this.specularMap = e.specularMap,
  46234. this.alphaMap = e.alphaMap,
  46235. this.envMap = e.envMap,
  46236. this.combine = e.combine,
  46237. this.reflectivity = e.reflectivity,
  46238. this.refractionRatio = e.refractionRatio,
  46239. this.fog = e.fog,
  46240. this.shading = e.shading,
  46241. this.wireframe = e.wireframe,
  46242. this.wireframeLinewidth = e.wireframeLinewidth,
  46243. this.wireframeLinecap = e.wireframeLinecap,
  46244. this.wireframeLinejoin = e.wireframeLinejoin,
  46245. this.vertexColors = e.vertexColors,
  46246. this.skinning = e.skinning,
  46247. this.morphTargets = e.morphTargets,
  46248. this
  46249. }
  46250. ,
  46251. Ci.MeshLambertMaterial = function(e) {
  46252. Ci.Material.call(this),
  46253. this.type = "MeshLambertMaterial",
  46254. this.color = new Ci.Color(16777215),
  46255. this.map = null,
  46256. this.lightMap = null,
  46257. this.lightMapIntensity = 1,
  46258. this.aoMap = null,
  46259. this.aoMapIntensity = 1,
  46260. this.emissive = new Ci.Color(0),
  46261. this.emissiveIntensity = 1,
  46262. this.emissiveMap = null,
  46263. this.specularMap = null,
  46264. this.alphaMap = null,
  46265. this.envMap = null,
  46266. this.combine = Ci.MultiplyOperation,
  46267. this.reflectivity = 1,
  46268. this.refractionRatio = .98,
  46269. this.fog = !0,
  46270. this.blending = Ci.NormalBlending,
  46271. this.wireframe = !1,
  46272. this.wireframeLinewidth = 1,
  46273. this.wireframeLinecap = "round",
  46274. this.wireframeLinejoin = "round",
  46275. this.vertexColors = Ci.NoColors,
  46276. this.skinning = !1,
  46277. this.morphTargets = !1,
  46278. this.morphNormals = !1,
  46279. this.setValues(e)
  46280. }
  46281. ,
  46282. Ci.MeshLambertMaterial.prototype = Object.create(Ci.Material.prototype),
  46283. Ci.MeshLambertMaterial.prototype.constructor = Ci.MeshLambertMaterial,
  46284. Ci.MeshLambertMaterial.prototype.copy = function(e) {
  46285. return Ci.Material.prototype.copy.call(this, e),
  46286. this.color.copy(e.color),
  46287. this.map = e.map,
  46288. this.lightMap = e.lightMap,
  46289. this.lightMapIntensity = e.lightMapIntensity,
  46290. this.aoMap = e.aoMap,
  46291. this.aoMapIntensity = e.aoMapIntensity,
  46292. this.emissive.copy(e.emissive),
  46293. this.emissiveMap = e.emissiveMap,
  46294. this.emissiveIntensity = e.emissiveIntensity,
  46295. this.specularMap = e.specularMap,
  46296. this.alphaMap = e.alphaMap,
  46297. this.envMap = e.envMap,
  46298. this.combine = e.combine,
  46299. this.reflectivity = e.reflectivity,
  46300. this.refractionRatio = e.refractionRatio,
  46301. this.fog = e.fog,
  46302. this.wireframe = e.wireframe,
  46303. this.wireframeLinewidth = e.wireframeLinewidth,
  46304. this.wireframeLinecap = e.wireframeLinecap,
  46305. this.wireframeLinejoin = e.wireframeLinejoin,
  46306. this.vertexColors = e.vertexColors,
  46307. this.skinning = e.skinning,
  46308. this.morphTargets = e.morphTargets,
  46309. this.morphNormals = e.morphNormals,
  46310. this
  46311. }
  46312. ,
  46313. Ci.MeshPhongMaterial = function(e) {
  46314. Ci.Material.call(this),
  46315. this.type = "MeshPhongMaterial",
  46316. this.color = new Ci.Color(16777215),
  46317. this.specular = new Ci.Color(1118481),
  46318. this.shininess = 30,
  46319. this.map = null,
  46320. this.lightMap = null,
  46321. this.lightMapIntensity = 1,
  46322. this.aoMap = null,
  46323. this.aoMapIntensity = 1,
  46324. this.emissive = new Ci.Color(0),
  46325. this.emissiveIntensity = 1,
  46326. this.emissiveMap = null,
  46327. this.bumpMap = null,
  46328. this.bumpScale = 1,
  46329. this.normalMap = null,
  46330. this.normalScale = new Ci.Vector2(1,1),
  46331. this.displacementMap = null,
  46332. this.displacementScale = 1,
  46333. this.displacementBias = 0,
  46334. this.specularMap = null,
  46335. this.alphaMap = null,
  46336. this.envMap = null,
  46337. this.combine = Ci.MultiplyOperation,
  46338. this.reflectivity = 1,
  46339. this.refractionRatio = .98,
  46340. this.fog = !0,
  46341. this.shading = Ci.SmoothShading,
  46342. this.blending = Ci.NormalBlending,
  46343. this.wireframe = !1,
  46344. this.wireframeLinewidth = 1,
  46345. this.wireframeLinecap = "round",
  46346. this.wireframeLinejoin = "round",
  46347. this.vertexColors = Ci.NoColors,
  46348. this.skinning = !1,
  46349. this.morphTargets = !1,
  46350. this.morphNormals = !1,
  46351. this.setValues(e)
  46352. }
  46353. ,
  46354. Ci.MeshPhongMaterial.prototype = Object.create(Ci.Material.prototype),
  46355. Ci.MeshPhongMaterial.prototype.constructor = Ci.MeshPhongMaterial,
  46356. Ci.MeshPhongMaterial.prototype.copy = function(e) {
  46357. return Ci.Material.prototype.copy.call(this, e),
  46358. this.color.copy(e.color),
  46359. this.specular.copy(e.specular),
  46360. this.shininess = e.shininess,
  46361. this.map = e.map,
  46362. this.lightMap = e.lightMap,
  46363. this.lightMapIntensity = e.lightMapIntensity,
  46364. this.aoMap = e.aoMap,
  46365. this.aoMapIntensity = e.aoMapIntensity,
  46366. this.emissive.copy(e.emissive),
  46367. this.emissiveMap = e.emissiveMap,
  46368. this.emissiveIntensity = e.emissiveIntensity,
  46369. this.bumpMap = e.bumpMap,
  46370. this.bumpScale = e.bumpScale,
  46371. this.normalMap = e.normalMap,
  46372. this.normalScale.copy(e.normalScale),
  46373. this.displacementMap = e.displacementMap,
  46374. this.displacementScale = e.displacementScale,
  46375. this.displacementBias = e.displacementBias,
  46376. this.specularMap = e.specularMap,
  46377. this.alphaMap = e.alphaMap,
  46378. this.envMap = e.envMap,
  46379. this.combine = e.combine,
  46380. this.reflectivity = e.reflectivity,
  46381. this.refractionRatio = e.refractionRatio,
  46382. this.fog = e.fog,
  46383. this.shading = e.shading,
  46384. this.wireframe = e.wireframe,
  46385. this.wireframeLinewidth = e.wireframeLinewidth,
  46386. this.wireframeLinecap = e.wireframeLinecap,
  46387. this.wireframeLinejoin = e.wireframeLinejoin,
  46388. this.vertexColors = e.vertexColors,
  46389. this.skinning = e.skinning,
  46390. this.morphTargets = e.morphTargets,
  46391. this.morphNormals = e.morphNormals,
  46392. this
  46393. }
  46394. ,
  46395. Ci.MeshStandardMaterial = function(e) {
  46396. Ci.Material.call(this),
  46397. this.type = "MeshStandardMaterial",
  46398. this.color = new Ci.Color(16777215),
  46399. this.roughness = .5,
  46400. this.metalness = .5,
  46401. this.map = null,
  46402. this.lightMap = null,
  46403. this.lightMapIntensity = 1,
  46404. this.aoMap = null,
  46405. this.aoMapIntensity = 1,
  46406. this.emissive = new Ci.Color(0),
  46407. this.emissiveIntensity = 1,
  46408. this.emissiveMap = null,
  46409. this.bumpMap = null,
  46410. this.bumpScale = 1,
  46411. this.normalMap = null,
  46412. this.normalScale = new Ci.Vector2(1,1),
  46413. this.displacementMap = null,
  46414. this.displacementScale = 1,
  46415. this.displacementBias = 0,
  46416. this.roughnessMap = null,
  46417. this.metalnessMap = null,
  46418. this.alphaMap = null,
  46419. this.envMap = null,
  46420. this.envMapIntensity = 1,
  46421. this.refractionRatio = .98,
  46422. this.fog = !0,
  46423. this.shading = Ci.SmoothShading,
  46424. this.blending = Ci.NormalBlending,
  46425. this.wireframe = !1,
  46426. this.wireframeLinewidth = 1,
  46427. this.wireframeLinecap = "round",
  46428. this.wireframeLinejoin = "round",
  46429. this.vertexColors = Ci.NoColors,
  46430. this.skinning = !1,
  46431. this.morphTargets = !1,
  46432. this.morphNormals = !1,
  46433. this.setValues(e)
  46434. }
  46435. ,
  46436. Ci.MeshStandardMaterial.prototype = Object.create(Ci.Material.prototype),
  46437. Ci.MeshStandardMaterial.prototype.constructor = Ci.MeshStandardMaterial,
  46438. Ci.MeshStandardMaterial.prototype.copy = function(e) {
  46439. return Ci.Material.prototype.copy.call(this, e),
  46440. this.color.copy(e.color),
  46441. this.roughness = e.roughness,
  46442. this.metalness = e.metalness,
  46443. this.map = e.map,
  46444. this.lightMap = e.lightMap,
  46445. this.lightMapIntensity = e.lightMapIntensity,
  46446. this.aoMap = e.aoMap,
  46447. this.aoMapIntensity = e.aoMapIntensity,
  46448. this.emissive.copy(e.emissive),
  46449. this.emissiveMap = e.emissiveMap,
  46450. this.emissiveIntensity = e.emissiveIntensity,
  46451. this.bumpMap = e.bumpMap,
  46452. this.bumpScale = e.bumpScale,
  46453. this.normalMap = e.normalMap,
  46454. this.normalScale.copy(e.normalScale),
  46455. this.displacementMap = e.displacementMap,
  46456. this.displacementScale = e.displacementScale,
  46457. this.displacementBias = e.displacementBias,
  46458. this.roughnessMap = e.roughnessMap,
  46459. this.metalnessMap = e.metalnessMap,
  46460. this.alphaMap = e.alphaMap,
  46461. this.envMap = e.envMap,
  46462. this.envMapIntensity = e.envMapIntensity,
  46463. this.refractionRatio = e.refractionRatio,
  46464. this.fog = e.fog,
  46465. this.shading = e.shading,
  46466. this.wireframe = e.wireframe,
  46467. this.wireframeLinewidth = e.wireframeLinewidth,
  46468. this.wireframeLinecap = e.wireframeLinecap,
  46469. this.wireframeLinejoin = e.wireframeLinejoin,
  46470. this.vertexColors = e.vertexColors,
  46471. this.skinning = e.skinning,
  46472. this.morphTargets = e.morphTargets,
  46473. this.morphNormals = e.morphNormals,
  46474. this
  46475. }
  46476. ,
  46477. Ci.MeshDepthMaterial = function(e) {
  46478. Ci.Material.call(this),
  46479. this.type = "MeshDepthMaterial",
  46480. this.morphTargets = !1,
  46481. this.wireframe = !1,
  46482. this.wireframeLinewidth = 1,
  46483. this.setValues(e)
  46484. }
  46485. ,
  46486. Ci.MeshDepthMaterial.prototype = Object.create(Ci.Material.prototype),
  46487. Ci.MeshDepthMaterial.prototype.constructor = Ci.MeshDepthMaterial,
  46488. Ci.MeshDepthMaterial.prototype.copy = function(e) {
  46489. return Ci.Material.prototype.copy.call(this, e),
  46490. this.wireframe = e.wireframe,
  46491. this.wireframeLinewidth = e.wireframeLinewidth,
  46492. this
  46493. }
  46494. ,
  46495. Ci.MeshNormalMaterial = function(e) {
  46496. Ci.Material.call(this, e),
  46497. this.type = "MeshNormalMaterial",
  46498. this.wireframe = !1,
  46499. this.wireframeLinewidth = 1,
  46500. this.morphTargets = !1,
  46501. this.setValues(e)
  46502. }
  46503. ,
  46504. Ci.MeshNormalMaterial.prototype = Object.create(Ci.Material.prototype),
  46505. Ci.MeshNormalMaterial.prototype.constructor = Ci.MeshNormalMaterial,
  46506. Ci.MeshNormalMaterial.prototype.copy = function(e) {
  46507. return Ci.Material.prototype.copy.call(this, e),
  46508. this.wireframe = e.wireframe,
  46509. this.wireframeLinewidth = e.wireframeLinewidth,
  46510. this
  46511. }
  46512. ,
  46513. Ci.MultiMaterial = function(e) {
  46514. this.uuid = Ci.Math.generateUUID(),
  46515. this.type = "MultiMaterial",
  46516. this.materials = e instanceof Array ? e : [],
  46517. this.visible = !0
  46518. }
  46519. ,
  46520. Ci.MultiMaterial.prototype = {
  46521. constructor: Ci.MultiMaterial,
  46522. toJSON: function(e) {
  46523. for (var t = {
  46524. metadata: {
  46525. version: 4.2,
  46526. type: "material",
  46527. generator: "MaterialExporter"
  46528. },
  46529. uuid: this.uuid,
  46530. type: this.type,
  46531. materials: []
  46532. }, i = this.materials, n = 0, r = i.length; n < r; n++) {
  46533. var o = i[n].toJSON(e);
  46534. delete o.metadata,
  46535. t.materials.push(o)
  46536. }
  46537. return t.visible = this.visible,
  46538. t
  46539. },
  46540. clone: function() {
  46541. for (var e = new this.constructor, t = 0; t < this.materials.length; t++)
  46542. e.materials.push(this.materials[t].clone());
  46543. return e.visible = this.visible,
  46544. e
  46545. }
  46546. },
  46547. Ci.PointsMaterial = function(e) {
  46548. Ci.Material.call(this),
  46549. this.type = "PointsMaterial",
  46550. this.color = new Ci.Color(16777215),
  46551. this.map = null,
  46552. this.size = 1,
  46553. this.sizeAttenuation = !0,
  46554. this.blending = Ci.NormalBlending,
  46555. this.vertexColors = Ci.NoColors,
  46556. this.fog = !0,
  46557. this.setValues(e)
  46558. }
  46559. ,
  46560. Ci.PointsMaterial.prototype = Object.create(Ci.Material.prototype),
  46561. Ci.PointsMaterial.prototype.constructor = Ci.PointsMaterial,
  46562. Ci.PointsMaterial.prototype.copy = function(e) {
  46563. return Ci.Material.prototype.copy.call(this, e),
  46564. this.color.copy(e.color),
  46565. this.map = e.map,
  46566. this.size = e.size,
  46567. this.sizeAttenuation = e.sizeAttenuation,
  46568. this.vertexColors = e.vertexColors,
  46569. this.fog = e.fog,
  46570. this
  46571. }
  46572. ,
  46573. Ci.ShaderMaterial = function(e) {
  46574. Ci.Material.call(this),
  46575. this.type = "ShaderMaterial",
  46576. this.defines = {},
  46577. this.uniforms = {},
  46578. this.vertexShader = "void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",
  46579. this.fragmentShader = "void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",
  46580. this.shading = Ci.SmoothShading,
  46581. this.linewidth = 1,
  46582. this.wireframe = !1,
  46583. this.wireframeLinewidth = 1,
  46584. this.fog = !1,
  46585. this.lights = !1,
  46586. this.vertexColors = Ci.NoColors,
  46587. this.skinning = !1,
  46588. this.morphTargets = !1,
  46589. this.morphNormals = !1,
  46590. this.extensions = {
  46591. derivatives: !1,
  46592. fragDepth: !1,
  46593. drawBuffers: !1,
  46594. shaderTextureLOD: !1
  46595. },
  46596. this.defaultAttributeValues = {
  46597. color: [1, 1, 1],
  46598. uv: [0, 0],
  46599. uv2: [0, 0]
  46600. },
  46601. (this.index0AttributeName = void 0) !== e && (void 0 !== e.attributes && console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),
  46602. this.setValues(e))
  46603. }
  46604. ,
  46605. Ci.ShaderMaterial.prototype = Object.create(Ci.Material.prototype),
  46606. Ci.ShaderMaterial.prototype.constructor = Ci.ShaderMaterial,
  46607. Ci.ShaderMaterial.prototype.copy = function(e) {
  46608. return Ci.Material.prototype.copy.call(this, e),
  46609. this.fragmentShader = e.fragmentShader,
  46610. this.vertexShader = e.vertexShader,
  46611. this.uniforms = Ci.UniformsUtils.clone(e.uniforms),
  46612. this.defines = e.defines,
  46613. this.shading = e.shading,
  46614. this.wireframe = e.wireframe,
  46615. this.wireframeLinewidth = e.wireframeLinewidth,
  46616. this.fog = e.fog,
  46617. this.lights = e.lights,
  46618. this.vertexColors = e.vertexColors,
  46619. this.skinning = e.skinning,
  46620. this.morphTargets = e.morphTargets,
  46621. this.morphNormals = e.morphNormals,
  46622. this.extensions = e.extensions,
  46623. this
  46624. }
  46625. ,
  46626. Ci.ShaderMaterial.prototype.toJSON = function(e) {
  46627. var t = Ci.Material.prototype.toJSON.call(this, e);
  46628. return t.uniforms = this.uniforms,
  46629. t.vertexShader = this.vertexShader,
  46630. t.fragmentShader = this.fragmentShader,
  46631. t
  46632. }
  46633. ,
  46634. Ci.RawShaderMaterial = function(e) {
  46635. Ci.ShaderMaterial.call(this, e),
  46636. this.type = "RawShaderMaterial"
  46637. }
  46638. ,
  46639. Ci.RawShaderMaterial.prototype = Object.create(Ci.ShaderMaterial.prototype),
  46640. Ci.RawShaderMaterial.prototype.constructor = Ci.RawShaderMaterial,
  46641. Ci.SpriteMaterial = function(e) {
  46642. Ci.Material.call(this),
  46643. this.type = "SpriteMaterial",
  46644. this.color = new Ci.Color(16777215),
  46645. this.map = null,
  46646. this.rotation = 0,
  46647. this.fog = !1,
  46648. this.setValues(e)
  46649. }
  46650. ,
  46651. Ci.SpriteMaterial.prototype = Object.create(Ci.Material.prototype),
  46652. Ci.SpriteMaterial.prototype.constructor = Ci.SpriteMaterial,
  46653. Ci.SpriteMaterial.prototype.copy = function(e) {
  46654. return Ci.Material.prototype.copy.call(this, e),
  46655. this.color.copy(e.color),
  46656. this.map = e.map,
  46657. this.rotation = e.rotation,
  46658. this.fog = e.fog,
  46659. this
  46660. }
  46661. ,
  46662. Ci.Texture = function(e, t, i, n, r, o, a, s, l) {
  46663. Object.defineProperty(this, "id", {
  46664. value: Ci.TextureIdCount++
  46665. }),
  46666. this.uuid = Ci.Math.generateUUID(),
  46667. this.name = "",
  46668. this.sourceFile = "",
  46669. this.image = void 0 !== e ? e : Ci.Texture.DEFAULT_IMAGE,
  46670. this.mipmaps = [],
  46671. this.mapping = void 0 !== t ? t : Ci.Texture.DEFAULT_MAPPING,
  46672. this.wrapS = void 0 !== i ? i : Ci.ClampToEdgeWrapping,
  46673. this.wrapT = void 0 !== n ? n : Ci.ClampToEdgeWrapping,
  46674. this.magFilter = void 0 !== r ? r : Ci.LinearFilter,
  46675. this.minFilter = void 0 !== o ? o : Ci.LinearMipMapLinearFilter,
  46676. this.anisotropy = void 0 !== l ? l : 1,
  46677. this.format = void 0 !== a ? a : Ci.RGBAFormat,
  46678. this.type = void 0 !== s ? s : Ci.UnsignedByteType,
  46679. this.offset = new Ci.Vector2(0,0),
  46680. this.repeat = new Ci.Vector2(1,1),
  46681. this.generateMipmaps = !0,
  46682. this.premultiplyAlpha = !1,
  46683. this.flipY = !0,
  46684. this.unpackAlignment = 4,
  46685. this.encoding = Ci.LinearEncoding,
  46686. this.version = 0,
  46687. this.onUpdate = null
  46688. }
  46689. ,
  46690. Ci.Texture.DEFAULT_IMAGE = void 0,
  46691. Ci.Texture.DEFAULT_MAPPING = Ci.UVMapping,
  46692. Ci.Texture.prototype = {
  46693. constructor: Ci.Texture,
  46694. set needsUpdate(e) {
  46695. !0 === e && this.version++
  46696. },
  46697. clone: function() {
  46698. return (new this.constructor).copy(this)
  46699. },
  46700. copy: function(e) {
  46701. return this.image = e.image,
  46702. this.mipmaps = e.mipmaps.slice(0),
  46703. this.mapping = e.mapping,
  46704. this.wrapS = e.wrapS,
  46705. this.wrapT = e.wrapT,
  46706. this.magFilter = e.magFilter,
  46707. this.minFilter = e.minFilter,
  46708. this.anisotropy = e.anisotropy,
  46709. this.format = e.format,
  46710. this.type = e.type,
  46711. this.offset.copy(e.offset),
  46712. this.repeat.copy(e.repeat),
  46713. this.generateMipmaps = e.generateMipmaps,
  46714. this.premultiplyAlpha = e.premultiplyAlpha,
  46715. this.flipY = e.flipY,
  46716. this.unpackAlignment = e.unpackAlignment,
  46717. this.encoding = e.encoding,
  46718. this
  46719. },
  46720. toJSON: function(e) {
  46721. if (void 0 !== e.textures[this.uuid])
  46722. return e.textures[this.uuid];
  46723. var t, i, n = {
  46724. metadata: {
  46725. version: 4.4,
  46726. type: "Texture",
  46727. generator: "Texture.toJSON"
  46728. },
  46729. uuid: this.uuid,
  46730. name: this.name,
  46731. mapping: this.mapping,
  46732. repeat: [this.repeat.x, this.repeat.y],
  46733. offset: [this.offset.x, this.offset.y],
  46734. wrap: [this.wrapS, this.wrapT],
  46735. minFilter: this.minFilter,
  46736. magFilter: this.magFilter,
  46737. anisotropy: this.anisotropy
  46738. };
  46739. if (void 0 !== this.image) {
  46740. var r = this.image;
  46741. void 0 === r.uuid && (r.uuid = Ci.Math.generateUUID()),
  46742. void 0 === e.images[r.uuid] && (e.images[r.uuid] = {
  46743. uuid: r.uuid,
  46744. url: (t = r,
  46745. void 0 !== t.toDataURL ? i = t : ((i = document.createElement("canvas")).width = t.width,
  46746. i.height = t.height,
  46747. i.getContext("2d").drawImage(t, 0, 0, t.width, t.height)),
  46748. 2048 < i.width || 2048 < i.height ? i.toDataURL("image/jpeg", .6) : i.toDataURL("image/png"))
  46749. }),
  46750. n.image = r.uuid
  46751. }
  46752. return e.textures[this.uuid] = n
  46753. },
  46754. dispose: function() {
  46755. this.dispatchEvent({
  46756. type: "dispose"
  46757. })
  46758. },
  46759. transformUv: function(e) {
  46760. if (this.mapping === Ci.UVMapping) {
  46761. if (e.multiply(this.repeat),
  46762. e.add(this.offset),
  46763. e.x < 0 || 1 < e.x)
  46764. switch (this.wrapS) {
  46765. case Ci.RepeatWrapping:
  46766. e.x = e.x - Math.floor(e.x);
  46767. break;
  46768. case Ci.ClampToEdgeWrapping:
  46769. e.x = e.x < 0 ? 0 : 1;
  46770. break;
  46771. case Ci.MirroredRepeatWrapping:
  46772. 1 === Math.abs(Math.floor(e.x) % 2) ? e.x = Math.ceil(e.x) - e.x : e.x = e.x - Math.floor(e.x)
  46773. }
  46774. if (e.y < 0 || 1 < e.y)
  46775. switch (this.wrapT) {
  46776. case Ci.RepeatWrapping:
  46777. e.y = e.y - Math.floor(e.y);
  46778. break;
  46779. case Ci.ClampToEdgeWrapping:
  46780. e.y = e.y < 0 ? 0 : 1;
  46781. break;
  46782. case Ci.MirroredRepeatWrapping:
  46783. 1 === Math.abs(Math.floor(e.y) % 2) ? e.y = Math.ceil(e.y) - e.y : e.y = e.y - Math.floor(e.y)
  46784. }
  46785. this.flipY && (e.y = 1 - e.y)
  46786. }
  46787. }
  46788. },
  46789. Ci.EventDispatcher.prototype.apply(Ci.Texture.prototype),
  46790. Ci.TextureIdCount = 0,
  46791. Ci.CanvasTexture = function(e, t, i, n, r, o, a, s, l) {
  46792. Ci.Texture.call(this, e, t, i, n, r, o, a, s, l),
  46793. this.needsUpdate = !0
  46794. }
  46795. ,
  46796. Ci.CanvasTexture.prototype = Object.create(Ci.Texture.prototype),
  46797. Ci.CanvasTexture.prototype.constructor = Ci.CanvasTexture,
  46798. Ci.CubeTexture = function(e, t, i, n, r, o, a, s, l) {
  46799. e = void 0 !== e ? e : [],
  46800. t = void 0 !== t ? t : Ci.CubeReflectionMapping,
  46801. Ci.Texture.call(this, e, t, i, n, r, o, a, s, l),
  46802. this.flipY = !1
  46803. }
  46804. ,
  46805. Ci.CubeTexture.prototype = Object.create(Ci.Texture.prototype),
  46806. Ci.CubeTexture.prototype.constructor = Ci.CubeTexture,
  46807. Object.defineProperty(Ci.CubeTexture.prototype, "images", {
  46808. get: function() {
  46809. return this.image
  46810. },
  46811. set: function(e) {
  46812. this.image = e
  46813. }
  46814. }),
  46815. Ci.CompressedTexture = function(e, t, i, n, r, o, a, s, l, c, h) {
  46816. Ci.Texture.call(this, null, o, a, s, l, c, n, r, h),
  46817. this.image = {
  46818. width: t,
  46819. height: i
  46820. },
  46821. this.mipmaps = e,
  46822. this.flipY = !1,
  46823. this.generateMipmaps = !1
  46824. }
  46825. ,
  46826. Ci.CompressedTexture.prototype = Object.create(Ci.Texture.prototype),
  46827. Ci.CompressedTexture.prototype.constructor = Ci.CompressedTexture,
  46828. Ci.DataTexture = function(e, t, i, n, r, o, a, s, l, c, h) {
  46829. Ci.Texture.call(this, null, o, a, s, l, c, n, r, h),
  46830. this.image = {
  46831. data: e,
  46832. width: t,
  46833. height: i
  46834. },
  46835. this.magFilter = void 0 !== l ? l : Ci.NearestFilter,
  46836. this.minFilter = void 0 !== c ? c : Ci.NearestFilter,
  46837. this.flipY = !1,
  46838. this.generateMipmaps = !1
  46839. }
  46840. ,
  46841. Ci.DataTexture.prototype = Object.create(Ci.Texture.prototype),
  46842. Ci.DataTexture.prototype.constructor = Ci.DataTexture,
  46843. Ci.VideoTexture = function(t, e, i, n, r, o, a, s, l) {
  46844. Ci.Texture.call(this, t, e, i, n, r, o, a, s, l),
  46845. this.generateMipmaps = !1;
  46846. var c = this;
  46847. !function e() {
  46848. requestAnimationFrame(e),
  46849. t.readyState === t.HAVE_ENOUGH_DATA && (c.needsUpdate = !0)
  46850. }()
  46851. }
  46852. ,
  46853. Ci.VideoTexture.prototype = Object.create(Ci.Texture.prototype),
  46854. Ci.VideoTexture.prototype.constructor = Ci.VideoTexture,
  46855. Ci.Group = function() {
  46856. Ci.Object3D.call(this),
  46857. this.type = "Group"
  46858. }
  46859. ,
  46860. Ci.Group.prototype = Object.create(Ci.Object3D.prototype),
  46861. Ci.Group.prototype.constructor = Ci.Group,
  46862. Ci.Points = function(e, t) {
  46863. Ci.Object3D.call(this),
  46864. this.type = "Points",
  46865. this.geometry = void 0 !== e ? e : new Ci.Geometry,
  46866. this.material = void 0 !== t ? t : new Ci.PointsMaterial({
  46867. color: 16777215 * Math.random()
  46868. })
  46869. }
  46870. ,
  46871. Ci.Points.prototype = Object.create(Ci.Object3D.prototype),
  46872. Ci.Points.prototype.constructor = Ci.Points,
  46873. Ci.Points.prototype.raycast = (Wt = new Ci.Matrix4,
  46874. jt = new Ci.Ray,
  46875. Yt = new Ci.Sphere,
  46876. function(o, a) {
  46877. function e(e, t) {
  46878. var i = jt.distanceSqToPoint(e);
  46879. if (i < c) {
  46880. var n = jt.closestPointToPoint(e);
  46881. n.applyMatrix4(l);
  46882. var r = o.ray.origin.distanceTo(n);
  46883. if (r < o.near || r > o.far)
  46884. return;
  46885. a.push({
  46886. distance: r,
  46887. distanceToRay: Math.sqrt(i),
  46888. point: n.clone(),
  46889. index: t,
  46890. face: null,
  46891. object: s
  46892. })
  46893. }
  46894. }
  46895. var s = this
  46896. , t = this.geometry
  46897. , l = this.matrixWorld
  46898. , i = o.params.Points.threshold;
  46899. if (null === t.boundingSphere && t.computeBoundingSphere(),
  46900. Yt.copy(t.boundingSphere),
  46901. Yt.applyMatrix4(l),
  46902. !1 !== o.ray.intersectsSphere(Yt)) {
  46903. Wt.getInverse(l),
  46904. jt.copy(o.ray).applyMatrix4(Wt);
  46905. var n = i / ((this.scale.x + this.scale.y + this.scale.z) / 3)
  46906. , c = n * n
  46907. , r = new Ci.Vector3;
  46908. if (t instanceof Ci.BufferGeometry) {
  46909. var h = t.index
  46910. , u = t.attributes.position.array;
  46911. if (null !== h)
  46912. for (var d = h.array, p = 0, f = d.length; p < f; p++) {
  46913. var g = d[p];
  46914. r.fromArray(u, 3 * g),
  46915. e(r, g)
  46916. }
  46917. else {
  46918. p = 0;
  46919. for (var m = u.length / 3; p < m; p++)
  46920. r.fromArray(u, 3 * p),
  46921. e(r, p)
  46922. }
  46923. } else {
  46924. var v = t.vertices;
  46925. for (p = 0,
  46926. m = v.length; p < m; p++)
  46927. e(v[p], p)
  46928. }
  46929. }
  46930. }
  46931. ),
  46932. Ci.Points.prototype.clone = function() {
  46933. return new this.constructor(this.geometry,this.material).copy(this)
  46934. }
  46935. ,
  46936. Ci.Line = function(e, t, i) {
  46937. return 1 === i ? (console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),
  46938. new Ci.LineSegments(e,t)) : (Ci.Object3D.call(this),
  46939. this.type = "Line",
  46940. this.geometry = void 0 !== e ? e : new Ci.Geometry,
  46941. void (this.material = void 0 !== t ? t : new Ci.LineBasicMaterial({
  46942. color: 16777215 * Math.random()
  46943. })))
  46944. }
  46945. ,
  46946. Ci.Line.prototype = Object.create(Ci.Object3D.prototype),
  46947. Ci.Line.prototype.constructor = Ci.Line,
  46948. Ci.Line.prototype.raycast = (Ht = new Ci.Matrix4,
  46949. zt = new Ci.Ray,
  46950. Gt = new Ci.Sphere,
  46951. function(e, t) {
  46952. var i = e.linePrecision
  46953. , n = i * i
  46954. , r = this.geometry
  46955. , o = this.matrixWorld;
  46956. if (null === r.boundingSphere && r.computeBoundingSphere(),
  46957. Gt.copy(r.boundingSphere),
  46958. Gt.applyMatrix4(o),
  46959. !1 !== e.ray.intersectsSphere(Gt)) {
  46960. Ht.getInverse(o),
  46961. zt.copy(e.ray).applyMatrix4(Ht);
  46962. var a = new Ci.Vector3
  46963. , s = new Ci.Vector3
  46964. , l = new Ci.Vector3
  46965. , c = new Ci.Vector3
  46966. , h = this instanceof Ci.LineSegments ? 2 : 1;
  46967. if (r instanceof Ci.BufferGeometry) {
  46968. var u = r.index
  46969. , d = r.attributes.position.array;
  46970. if (null !== u)
  46971. for (var p = u.array, f = 0, g = p.length - 1; f < g; f += h) {
  46972. var m = p[f]
  46973. , v = p[f + 1];
  46974. a.fromArray(d, 3 * m),
  46975. s.fromArray(d, 3 * v),
  46976. n < zt.distanceSqToSegment(a, s, c, l) || (c.applyMatrix4(this.matrixWorld),
  46977. (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
  46978. distance: C,
  46979. point: l.clone().applyMatrix4(this.matrixWorld),
  46980. index: f,
  46981. face: null,
  46982. faceIndex: null,
  46983. object: this
  46984. }))
  46985. }
  46986. else
  46987. for (f = 0,
  46988. g = d.length / 3 - 1; f < g; f += h)
  46989. a.fromArray(d, 3 * f),
  46990. s.fromArray(d, 3 * f + 3),
  46991. n < zt.distanceSqToSegment(a, s, c, l) || (c.applyMatrix4(this.matrixWorld),
  46992. (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
  46993. distance: C,
  46994. point: l.clone().applyMatrix4(this.matrixWorld),
  46995. index: f,
  46996. face: null,
  46997. faceIndex: null,
  46998. object: this
  46999. }))
  47000. } else if (r instanceof Ci.Geometry) {
  47001. var y = r.vertices
  47002. , A = y.length;
  47003. for (f = 0; f < A - 1; f += h) {
  47004. var C;
  47005. n < zt.distanceSqToSegment(y[f], y[f + 1], c, l) || (c.applyMatrix4(this.matrixWorld),
  47006. (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
  47007. distance: C,
  47008. point: l.clone().applyMatrix4(this.matrixWorld),
  47009. index: f,
  47010. face: null,
  47011. faceIndex: null,
  47012. object: this
  47013. }))
  47014. }
  47015. }
  47016. }
  47017. }
  47018. ),
  47019. Ci.Line.prototype.clone = function() {
  47020. return new this.constructor(this.geometry,this.material).copy(this)
  47021. }
  47022. ,
  47023. Ci.LineStrip = 0,
  47024. Ci.LinePieces = 1,
  47025. Ci.LineSegments = function(e, t) {
  47026. Ci.Line.call(this, e, t),
  47027. this.type = "LineSegments"
  47028. }
  47029. ,
  47030. Ci.LineSegments.prototype = Object.create(Ci.Line.prototype),
  47031. Ci.LineSegments.prototype.constructor = Ci.LineSegments,
  47032. Ci.Mesh = function(e, t) {
  47033. Ci.Object3D.call(this),
  47034. this.type = "Mesh",
  47035. this.geometry = void 0 !== e ? e : new Ci.Geometry,
  47036. this.material = void 0 !== t ? t : new Ci.MeshBasicMaterial({
  47037. color: 16777215 * Math.random()
  47038. }),
  47039. this.drawMode = Ci.TrianglesDrawMode,
  47040. this.updateMorphTargets()
  47041. }
  47042. ,
  47043. Ci.Mesh.prototype = Object.create(Ci.Object3D.prototype),
  47044. Ci.Mesh.prototype.constructor = Ci.Mesh,
  47045. Ci.Mesh.prototype.setDrawMode = function(e) {
  47046. this.drawMode = e
  47047. }
  47048. ,
  47049. Ci.Mesh.prototype.updateMorphTargets = function() {
  47050. if (void 0 !== this.geometry.morphTargets && 0 < this.geometry.morphTargets.length) {
  47051. this.morphTargetBase = -1,
  47052. this.morphTargetInfluences = [],
  47053. this.morphTargetDictionary = {};
  47054. for (var e = 0, t = this.geometry.morphTargets.length; e < t; e++)
  47055. this.morphTargetInfluences.push(0),
  47056. this.morphTargetDictionary[this.geometry.morphTargets[e].name] = e
  47057. }
  47058. }
  47059. ,
  47060. Ci.Mesh.prototype.getMorphTargetIndexByName = function(e) {
  47061. return void 0 !== this.morphTargetDictionary[e] ? this.morphTargetDictionary[e] : (console.warn("THREE.Mesh.getMorphTargetIndexByName: morph target " + e + " does not exist. Returning 0."),
  47062. 0)
  47063. }
  47064. ,
  47065. Ci.Mesh.prototype.raycast = (Tt = new Ci.Matrix4,
  47066. xt = new Ci.Ray,
  47067. St = new Ci.Sphere,
  47068. Mt = new Ci.Vector3,
  47069. Rt = new Ci.Vector3,
  47070. Pt = new Ci.Vector3,
  47071. Ot = new Ci.Vector3,
  47072. Lt = new Ci.Vector3,
  47073. Dt = new Ci.Vector3,
  47074. Nt = new Ci.Vector2,
  47075. Ft = new Ci.Vector2,
  47076. Bt = new Ci.Vector2,
  47077. Vt = new Ci.Vector3,
  47078. kt = new Ci.Vector3,
  47079. Ut = new Ci.Vector3,
  47080. function(e, t) {
  47081. var i, n, r = this.geometry, o = this.material, a = this.matrixWorld;
  47082. if (void 0 !== o && (null === r.boundingSphere && r.computeBoundingSphere(),
  47083. St.copy(r.boundingSphere),
  47084. St.applyMatrix4(a),
  47085. !1 !== e.ray.intersectsSphere(St) && (Tt.getInverse(a),
  47086. xt.copy(e.ray).applyMatrix4(Tt),
  47087. null === r.boundingBox || !1 !== xt.intersectsBox(r.boundingBox))))
  47088. if (r instanceof Ci.BufferGeometry) {
  47089. var s, l, c, h = r.index, u = r.attributes, d = u.position.array;
  47090. if (void 0 !== u.uv && (i = u.uv.array),
  47091. null !== h)
  47092. for (var p = h.array, f = 0, g = p.length; f < g; f += 3)
  47093. s = p[f],
  47094. l = p[f + 1],
  47095. c = p[f + 2],
  47096. (n = Ti(this, e, xt, d, i, s, l, c)) && (n.faceIndex = Math.floor(f / 3),
  47097. t.push(n));
  47098. else
  47099. for (f = 0,
  47100. g = d.length; f < g; f += 9)
  47101. (n = Ti(this, e, xt, d, i, s = f / 3, l = s + 1, c = s + 2)) && (n.index = s,
  47102. t.push(n))
  47103. } else if (r instanceof Ci.Geometry) {
  47104. var m, v, y, A = o instanceof Ci.MultiMaterial, C = 1 == A ? o.materials : null, I = r.vertices, E = r.faces, _ = r.faceVertexUvs[0];
  47105. 0 < _.length && (i = _);
  47106. for (var b = 0, w = E.length; b < w; b++) {
  47107. var T = E[b]
  47108. , x = 1 == A ? C[T.materialIndex] : o;
  47109. if (void 0 !== x) {
  47110. if (m = I[T.a],
  47111. v = I[T.b],
  47112. y = I[T.c],
  47113. !0 === x.morphTargets) {
  47114. var S = r.morphTargets
  47115. , M = this.morphTargetInfluences;
  47116. Mt.set(0, 0, 0),
  47117. Rt.set(0, 0, 0),
  47118. Pt.set(0, 0, 0);
  47119. for (var R = 0, P = S.length; R < P; R++) {
  47120. var O = M[R];
  47121. if (0 !== O) {
  47122. var L = S[R].vertices;
  47123. Mt.addScaledVector(Ot.subVectors(L[T.a], m), O),
  47124. Rt.addScaledVector(Lt.subVectors(L[T.b], v), O),
  47125. Pt.addScaledVector(Dt.subVectors(L[T.c], y), O)
  47126. }
  47127. }
  47128. Mt.add(m),
  47129. Rt.add(v),
  47130. Pt.add(y),
  47131. m = Mt,
  47132. v = Rt,
  47133. y = Pt
  47134. }
  47135. if (n = wi(this, e, xt, m, v, y, kt)) {
  47136. if (i) {
  47137. var D = i[b];
  47138. Nt.copy(D[0]),
  47139. Ft.copy(D[1]),
  47140. Bt.copy(D[2]),
  47141. n.uv = bi(kt, m, v, y, Nt, Ft, Bt)
  47142. }
  47143. n.face = T,
  47144. n.faceIndex = b,
  47145. t.push(n)
  47146. }
  47147. }
  47148. }
  47149. }
  47150. }
  47151. ),
  47152. Ci.Mesh.prototype.clone = function() {
  47153. return new this.constructor(this.geometry,this.material).copy(this)
  47154. }
  47155. ,
  47156. Ci.Bone = function(e) {
  47157. Ci.Object3D.call(this),
  47158. this.type = "Bone",
  47159. this.skin = e
  47160. }
  47161. ,
  47162. Ci.Bone.prototype = Object.create(Ci.Object3D.prototype),
  47163. Ci.Bone.prototype.constructor = Ci.Bone,
  47164. Ci.Bone.prototype.copy = function(e) {
  47165. return Ci.Object3D.prototype.copy.call(this, e),
  47166. this.skin = e.skin,
  47167. this
  47168. }
  47169. ,
  47170. Ci.Skeleton = function(e, t, i) {
  47171. if (this.useVertexTexture = void 0 === i || i,
  47172. this.identityMatrix = new Ci.Matrix4,
  47173. e = e || [],
  47174. this.bones = e.slice(0),
  47175. this.useVertexTexture) {
  47176. var n = Math.sqrt(4 * this.bones.length);
  47177. n = Ci.Math.nextPowerOfTwo(Math.ceil(n)),
  47178. n = Math.max(n, 4),
  47179. this.boneTextureWidth = n,
  47180. this.boneTextureHeight = n,
  47181. this.boneMatrices = new Float32Array(this.boneTextureWidth * this.boneTextureHeight * 4),
  47182. this.boneTexture = new Ci.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,Ci.RGBAFormat,Ci.FloatType)
  47183. } else
  47184. this.boneMatrices = new Float32Array(16 * this.bones.length);
  47185. if (void 0 === t)
  47186. this.calculateInverses();
  47187. else if (this.bones.length === t.length)
  47188. this.boneInverses = t.slice(0);
  47189. else {
  47190. console.warn("THREE.Skeleton bonInverses is the wrong length."),
  47191. this.boneInverses = [];
  47192. for (var r = 0, o = this.bones.length; r < o; r++)
  47193. this.boneInverses.push(new Ci.Matrix4)
  47194. }
  47195. }
  47196. ,
  47197. Ci.Skeleton.prototype.calculateInverses = function() {
  47198. this.boneInverses = [];
  47199. for (var e = 0, t = this.bones.length; e < t; e++) {
  47200. var i = new Ci.Matrix4;
  47201. this.bones[e] && i.getInverse(this.bones[e].matrixWorld),
  47202. this.boneInverses.push(i)
  47203. }
  47204. }
  47205. ,
  47206. Ci.Skeleton.prototype.pose = function() {
  47207. for (var e, t = 0, i = this.bones.length; t < i; t++)
  47208. (e = this.bones[t]) && e.matrixWorld.getInverse(this.boneInverses[t]);
  47209. for (t = 0,
  47210. i = this.bones.length; t < i; t++)
  47211. (e = this.bones[t]) && (e.parent ? (e.matrix.getInverse(e.parent.matrixWorld),
  47212. e.matrix.multiply(e.matrixWorld)) : e.matrix.copy(e.matrixWorld),
  47213. e.matrix.decompose(e.position, e.quaternion, e.scale))
  47214. }
  47215. ,
  47216. Ci.Skeleton.prototype.update = (wt = new Ci.Matrix4,
  47217. function() {
  47218. for (var e = 0, t = this.bones.length; e < t; e++) {
  47219. var i = this.bones[e] ? this.bones[e].matrixWorld : this.identityMatrix;
  47220. wt.multiplyMatrices(i, this.boneInverses[e]),
  47221. wt.flattenToArrayOffset(this.boneMatrices, 16 * e)
  47222. }
  47223. this.useVertexTexture && (this.boneTexture.needsUpdate = !0)
  47224. }
  47225. ),
  47226. Ci.Skeleton.prototype.clone = function() {
  47227. return new Ci.Skeleton(this.bones,this.boneInverses,this.useVertexTexture)
  47228. }
  47229. ,
  47230. Ci.SkinnedMesh = function(e, t, i) {
  47231. Ci.Mesh.call(this, e, t),
  47232. this.type = "SkinnedMesh",
  47233. this.bindMode = "attached",
  47234. this.bindMatrix = new Ci.Matrix4,
  47235. this.bindMatrixInverse = new Ci.Matrix4;
  47236. var n = [];
  47237. if (this.geometry && void 0 !== this.geometry.bones) {
  47238. for (var r, o, a = 0, s = this.geometry.bones.length; a < s; ++a)
  47239. o = this.geometry.bones[a],
  47240. r = new Ci.Bone(this),
  47241. n.push(r),
  47242. r.name = o.name,
  47243. r.position.fromArray(o.pos),
  47244. r.quaternion.fromArray(o.rotq),
  47245. void 0 !== o.scl && r.scale.fromArray(o.scl);
  47246. for (a = 0,
  47247. s = this.geometry.bones.length; a < s; ++a)
  47248. -1 !== (o = this.geometry.bones[a]).parent && null !== o.parent ? n[o.parent].add(n[a]) : this.add(n[a])
  47249. }
  47250. this.normalizeSkinWeights(),
  47251. this.updateMatrixWorld(!0),
  47252. this.bind(new Ci.Skeleton(n,void 0,i), this.matrixWorld)
  47253. }
  47254. ,
  47255. Ci.SkinnedMesh.prototype = Object.create(Ci.Mesh.prototype),
  47256. Ci.SkinnedMesh.prototype.constructor = Ci.SkinnedMesh,
  47257. Ci.SkinnedMesh.prototype.bind = function(e, t) {
  47258. this.skeleton = e,
  47259. void 0 === t && (this.updateMatrixWorld(!0),
  47260. this.skeleton.calculateInverses(),
  47261. t = this.matrixWorld),
  47262. this.bindMatrix.copy(t),
  47263. this.bindMatrixInverse.getInverse(t)
  47264. }
  47265. ,
  47266. Ci.SkinnedMesh.prototype.pose = function() {
  47267. this.skeleton.pose()
  47268. }
  47269. ,
  47270. Ci.SkinnedMesh.prototype.normalizeSkinWeights = function() {
  47271. if (this.geometry instanceof Ci.Geometry)
  47272. for (var e = 0; e < this.geometry.skinWeights.length; e++) {
  47273. var t = this.geometry.skinWeights[e];
  47274. (r = 1 / t.lengthManhattan()) !== 1 / 0 ? t.multiplyScalar(r) : t.set(1, 0, 0, 0)
  47275. }
  47276. else if (this.geometry instanceof Ci.BufferGeometry) {
  47277. var i = new Ci.Vector4
  47278. , n = this.geometry.attributes.skinWeight;
  47279. for (e = 0; e < n.count; e++) {
  47280. var r;
  47281. i.x = n.getX(e),
  47282. i.y = n.getY(e),
  47283. i.z = n.getZ(e),
  47284. i.w = n.getW(e),
  47285. (r = 1 / i.lengthManhattan()) !== 1 / 0 ? i.multiplyScalar(r) : i.set(1, 0, 0, 0),
  47286. n.setXYZW(e, i.x, i.y, i.z, i.w)
  47287. }
  47288. }
  47289. }
  47290. ,
  47291. Ci.SkinnedMesh.prototype.updateMatrixWorld = function(e) {
  47292. Ci.Mesh.prototype.updateMatrixWorld.call(this, !0),
  47293. "attached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.matrixWorld) : "detached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.bindMatrix) : console.warn("THREE.SkinnedMesh unrecognized bindMode: " + this.bindMode)
  47294. }
  47295. ,
  47296. Ci.SkinnedMesh.prototype.clone = function() {
  47297. return new this.constructor(this.geometry,this.material,this.useVertexTexture).copy(this)
  47298. }
  47299. ,
  47300. Ci.LOD = function() {
  47301. Ci.Object3D.call(this),
  47302. this.type = "LOD",
  47303. Object.defineProperties(this, {
  47304. levels: {
  47305. enumerable: !0,
  47306. value: []
  47307. },
  47308. objects: {
  47309. get: function() {
  47310. return console.warn("THREE.LOD: .objects has been renamed to .levels."),
  47311. this.levels
  47312. }
  47313. }
  47314. })
  47315. }
  47316. ,
  47317. Ci.LOD.prototype = Object.create(Ci.Object3D.prototype),
  47318. Ci.LOD.prototype.constructor = Ci.LOD,
  47319. Ci.LOD.prototype.addLevel = function(e, t) {
  47320. void 0 === t && (t = 0),
  47321. t = Math.abs(t);
  47322. for (var i = this.levels, n = 0; n < i.length && !(t < i[n].distance); n++)
  47323. ;
  47324. i.splice(n, 0, {
  47325. distance: t,
  47326. object: e
  47327. }),
  47328. this.add(e)
  47329. }
  47330. ,
  47331. Ci.LOD.prototype.getObjectForDistance = function(e) {
  47332. for (var t = this.levels, i = 1, n = t.length; i < n && !(e < t[i].distance); i++)
  47333. ;
  47334. return t[i - 1].object
  47335. }
  47336. ,
  47337. Ci.LOD.prototype.raycast = (bt = new Ci.Vector3,
  47338. function(e, t) {
  47339. bt.setFromMatrixPosition(this.matrixWorld);
  47340. var i = e.ray.origin.distanceTo(bt);
  47341. this.getObjectForDistance(i).raycast(e, t)
  47342. }
  47343. ),
  47344. Ci.LOD.prototype.update = (Et = new Ci.Vector3,
  47345. _t = new Ci.Vector3,
  47346. function(e) {
  47347. var t = this.levels;
  47348. if (1 < t.length) {
  47349. Et.setFromMatrixPosition(e.matrixWorld),
  47350. _t.setFromMatrixPosition(this.matrixWorld);
  47351. var i = Et.distanceTo(_t);
  47352. t[0].object.visible = !0;
  47353. for (var n = 1, r = t.length; n < r && i >= t[n].distance; n++)
  47354. t[n - 1].object.visible = !1,
  47355. t[n].object.visible = !0;
  47356. for (; n < r; n++)
  47357. t[n].object.visible = !1
  47358. }
  47359. }
  47360. ),
  47361. Ci.LOD.prototype.copy = function(e) {
  47362. Ci.Object3D.prototype.copy.call(this, e, !1);
  47363. for (var t = e.levels, i = 0, n = t.length; i < n; i++) {
  47364. var r = t[i];
  47365. this.addLevel(r.object.clone(), r.distance)
  47366. }
  47367. return this
  47368. }
  47369. ,
  47370. Ci.LOD.prototype.toJSON = function(e) {
  47371. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  47372. t.object.levels = [];
  47373. for (var i = this.levels, n = 0, r = i.length; n < r; n++) {
  47374. var o = i[n];
  47375. t.object.levels.push({
  47376. object: o.object.uuid,
  47377. distance: o.distance
  47378. })
  47379. }
  47380. return t
  47381. }
  47382. ,
  47383. Ci.Sprite = (yt = new Uint16Array([0, 1, 2, 0, 2, 3]),
  47384. At = new Float32Array([-.5, -.5, 0, .5, -.5, 0, .5, .5, 0, -.5, .5, 0]),
  47385. Ct = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]),
  47386. (It = new Ci.BufferGeometry).setIndex(new Ci.BufferAttribute(yt,1)),
  47387. It.addAttribute("position", new Ci.BufferAttribute(At,3)),
  47388. It.addAttribute("uv", new Ci.BufferAttribute(Ct,2)),
  47389. function(e) {
  47390. Ci.Object3D.call(this),
  47391. this.type = "Sprite",
  47392. this.geometry = It,
  47393. this.material = void 0 !== e ? e : new Ci.SpriteMaterial
  47394. }
  47395. ),
  47396. Ci.Sprite.prototype = Object.create(Ci.Object3D.prototype),
  47397. Ci.Sprite.prototype.constructor = Ci.Sprite,
  47398. Ci.Sprite.prototype.raycast = (vt = new Ci.Vector3,
  47399. function(e, t) {
  47400. vt.setFromMatrixPosition(this.matrixWorld);
  47401. var i = e.ray.distanceSqToPoint(vt);
  47402. this.scale.x * this.scale.y < i || t.push({
  47403. distance: Math.sqrt(i),
  47404. point: this.position,
  47405. face: null,
  47406. object: this
  47407. })
  47408. }
  47409. ),
  47410. Ci.Sprite.prototype.clone = function() {
  47411. return new this.constructor(this.material).copy(this)
  47412. }
  47413. ,
  47414. Ci.Particle = Ci.Sprite,
  47415. Ci.LensFlare = function(e, t, i, n, r) {
  47416. Ci.Object3D.call(this),
  47417. this.lensFlares = [],
  47418. this.positionScreen = new Ci.Vector3,
  47419. (this.customUpdateCallback = void 0) !== e && this.add(e, t, i, n, r)
  47420. }
  47421. ,
  47422. Ci.LensFlare.prototype = Object.create(Ci.Object3D.prototype),
  47423. Ci.LensFlare.prototype.constructor = Ci.LensFlare,
  47424. Ci.LensFlare.prototype.add = function(e, t, i, n, r, o) {
  47425. void 0 === t && (t = -1),
  47426. void 0 === i && (i = 0),
  47427. void 0 === o && (o = 1),
  47428. void 0 === r && (r = new Ci.Color(16777215)),
  47429. void 0 === n && (n = Ci.NormalBlending),
  47430. i = Math.min(i, Math.max(0, i)),
  47431. this.lensFlares.push({
  47432. texture: e,
  47433. size: t,
  47434. distance: i,
  47435. x: 0,
  47436. y: 0,
  47437. z: 0,
  47438. scale: 1,
  47439. rotation: 0,
  47440. opacity: o,
  47441. color: r,
  47442. blending: n
  47443. })
  47444. }
  47445. ,
  47446. Ci.LensFlare.prototype.updateLensFlares = function() {
  47447. var e, t, i = this.lensFlares.length, n = 2 * -this.positionScreen.x, r = 2 * -this.positionScreen.y;
  47448. for (e = 0; e < i; e++)
  47449. (t = this.lensFlares[e]).x = this.positionScreen.x + n * t.distance,
  47450. t.y = this.positionScreen.y + r * t.distance,
  47451. t.wantedRotation = t.x * Math.PI * .25,
  47452. t.rotation += .25 * (t.wantedRotation - t.rotation)
  47453. }
  47454. ,
  47455. Ci.LensFlare.prototype.copy = function(e) {
  47456. Ci.Object3D.prototype.copy.call(this, e),
  47457. this.positionScreen.copy(e.positionScreen),
  47458. this.customUpdateCallback = e.customUpdateCallback;
  47459. for (var t = 0, i = e.lensFlares.length; t < i; t++)
  47460. this.lensFlares.push(e.lensFlares[t]);
  47461. return this
  47462. }
  47463. ,
  47464. Ci.Scene = function() {
  47465. Ci.Object3D.call(this),
  47466. this.type = "Scene",
  47467. this.fog = null,
  47468. this.overrideMaterial = null,
  47469. this.autoUpdate = !0
  47470. }
  47471. ,
  47472. Ci.Scene.prototype = Object.create(Ci.Object3D.prototype),
  47473. Ci.Scene.prototype.constructor = Ci.Scene,
  47474. Ci.Scene.prototype.copy = function(e, t) {
  47475. return Ci.Object3D.prototype.copy.call(this, e, t),
  47476. null !== e.fog && (this.fog = e.fog.clone()),
  47477. null !== e.overrideMaterial && (this.overrideMaterial = e.overrideMaterial.clone()),
  47478. this.autoUpdate = e.autoUpdate,
  47479. this.matrixAutoUpdate = e.matrixAutoUpdate,
  47480. this
  47481. }
  47482. ,
  47483. Ci.Fog = function(e, t, i) {
  47484. this.name = "",
  47485. this.color = new Ci.Color(e),
  47486. this.near = void 0 !== t ? t : 1,
  47487. this.far = void 0 !== i ? i : 1e3
  47488. }
  47489. ,
  47490. Ci.Fog.prototype.clone = function() {
  47491. return new Ci.Fog(this.color.getHex(),this.near,this.far)
  47492. }
  47493. ,
  47494. Ci.FogExp2 = function(e, t) {
  47495. this.name = "",
  47496. this.color = new Ci.Color(e),
  47497. this.density = void 0 !== t ? t : 25e-5
  47498. }
  47499. ,
  47500. Ci.FogExp2.prototype.clone = function() {
  47501. return new Ci.FogExp2(this.color.getHex(),this.density)
  47502. }
  47503. ,
  47504. Ci.ShaderChunk = {},
  47505. Ci.ShaderChunk.alphamap_fragment = "#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n",
  47506. Ci.ShaderChunk.alphamap_pars_fragment = "#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n",
  47507. Ci.ShaderChunk.alphatest_fragment = "#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n",
  47508. 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",
  47509. Ci.ShaderChunk.aomap_pars_fragment = "#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",
  47510. Ci.ShaderChunk.begin_vertex = "\nvec3 transformed = vec3( position );\n",
  47511. Ci.ShaderChunk.beginnormal_vertex = "\nvec3 objectNormal = vec3( normal );\n",
  47512. 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",
  47513. 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",
  47514. Ci.ShaderChunk.color_fragment = "#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",
  47515. Ci.ShaderChunk.color_pars_fragment = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n",
  47516. Ci.ShaderChunk.color_pars_vertex = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",
  47517. Ci.ShaderChunk.color_vertex = "#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",
  47518. 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",
  47519. 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",
  47520. Ci.ShaderChunk.defaultnormal_vertex = "#ifdef FLIP_SIDED\n\tobjectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n",
  47521. Ci.ShaderChunk.displacementmap_vertex = "#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n",
  47522. Ci.ShaderChunk.displacementmap_pars_vertex = "#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n",
  47523. 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",
  47524. Ci.ShaderChunk.emissivemap_pars_fragment = "#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n",
  47525. 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",
  47526. Ci.ShaderChunk.encodings_fragment = " gl_FragColor = linearToOutputTexel( gl_FragColor );\n",
  47527. 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",
  47528. 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",
  47529. 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",
  47530. 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",
  47531. 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",
  47532. 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",
  47533. Ci.ShaderChunk.lightmap_fragment = "#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n",
  47534. Ci.ShaderChunk.lightmap_pars_fragment = "#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",
  47535. 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",
  47536. 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",
  47537. Ci.ShaderChunk.lights_phong_fragment = "BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",
  47538. 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",
  47539. Ci.ShaderChunk.lights_phong_pars_vertex = "#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\n",
  47540. Ci.ShaderChunk.lights_phong_vertex = "#ifdef USE_ENVMAP\n\tvWorldPosition = worldPosition.xyz;\n#endif\n",
  47541. 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",
  47542. 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",
  47543. 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",
  47544. Ci.ShaderChunk.logdepthbuf_fragment = "#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif",
  47545. 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",
  47546. 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",
  47547. 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",
  47548. Ci.ShaderChunk.map_fragment = "#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n",
  47549. Ci.ShaderChunk.map_pars_fragment = "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n",
  47550. 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",
  47551. Ci.ShaderChunk.map_particle_pars_fragment = "#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n",
  47552. Ci.ShaderChunk.metalnessmap_fragment = "float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.r;\n#endif\n",
  47553. Ci.ShaderChunk.metalnessmap_pars_fragment = "#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",
  47554. 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",
  47555. 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",
  47556. 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",
  47557. 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",
  47558. 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",
  47559. Ci.ShaderChunk.premultiplied_alpha_fragment = "#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n",
  47560. 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",
  47561. Ci.ShaderChunk.roughnessmap_fragment = "float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.r;\n#endif\n",
  47562. Ci.ShaderChunk.roughnessmap_pars_fragment = "#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",
  47563. 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",
  47564. 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",
  47565. 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",
  47566. 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",
  47567. 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",
  47568. 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",
  47569. 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",
  47570. 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",
  47571. 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",
  47572. Ci.ShaderChunk.specularmap_pars_fragment = "#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",
  47573. Ci.ShaderChunk.tonemapping_fragment = "#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n",
  47574. 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",
  47575. Ci.ShaderChunk.uv2_pars_fragment = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",
  47576. Ci.ShaderChunk.uv2_pars_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",
  47577. Ci.ShaderChunk.uv2_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",
  47578. 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",
  47579. 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",
  47580. 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",
  47581. 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",
  47582. Ci.UniformsUtils = {
  47583. merge: function(e) {
  47584. for (var t = {}, i = 0; i < e.length; i++) {
  47585. var n = this.clone(e[i]);
  47586. for (var r in n)
  47587. t[r] = n[r]
  47588. }
  47589. return t
  47590. },
  47591. clone: function(e) {
  47592. var t = {};
  47593. for (var i in e)
  47594. for (var n in t[i] = {},
  47595. e[i]) {
  47596. var r = e[i][n];
  47597. 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
  47598. }
  47599. return t
  47600. }
  47601. },
  47602. Ci.UniformsLib = {
  47603. common: {
  47604. diffuse: {
  47605. type: "c",
  47606. value: new Ci.Color(15658734)
  47607. },
  47608. opacity: {
  47609. type: "f",
  47610. value: 1
  47611. },
  47612. map: {
  47613. type: "t",
  47614. value: null
  47615. },
  47616. offsetRepeat: {
  47617. type: "v4",
  47618. value: new Ci.Vector4(0,0,1,1)
  47619. },
  47620. specularMap: {
  47621. type: "t",
  47622. value: null
  47623. },
  47624. alphaMap: {
  47625. type: "t",
  47626. value: null
  47627. },
  47628. envMap: {
  47629. type: "t",
  47630. value: null
  47631. },
  47632. flipEnvMap: {
  47633. type: "f",
  47634. value: -1
  47635. },
  47636. reflectivity: {
  47637. type: "f",
  47638. value: 1
  47639. },
  47640. refractionRatio: {
  47641. type: "f",
  47642. value: .98
  47643. }
  47644. },
  47645. aomap: {
  47646. aoMap: {
  47647. type: "t",
  47648. value: null
  47649. },
  47650. aoMapIntensity: {
  47651. type: "f",
  47652. value: 1
  47653. }
  47654. },
  47655. lightmap: {
  47656. lightMap: {
  47657. type: "t",
  47658. value: null
  47659. },
  47660. lightMapIntensity: {
  47661. type: "f",
  47662. value: 1
  47663. }
  47664. },
  47665. emissivemap: {
  47666. emissiveMap: {
  47667. type: "t",
  47668. value: null
  47669. }
  47670. },
  47671. bumpmap: {
  47672. bumpMap: {
  47673. type: "t",
  47674. value: null
  47675. },
  47676. bumpScale: {
  47677. type: "f",
  47678. value: 1
  47679. }
  47680. },
  47681. normalmap: {
  47682. normalMap: {
  47683. type: "t",
  47684. value: null
  47685. },
  47686. normalScale: {
  47687. type: "v2",
  47688. value: new Ci.Vector2(1,1)
  47689. }
  47690. },
  47691. displacementmap: {
  47692. displacementMap: {
  47693. type: "t",
  47694. value: null
  47695. },
  47696. displacementScale: {
  47697. type: "f",
  47698. value: 1
  47699. },
  47700. displacementBias: {
  47701. type: "f",
  47702. value: 0
  47703. }
  47704. },
  47705. roughnessmap: {
  47706. roughnessMap: {
  47707. type: "t",
  47708. value: null
  47709. }
  47710. },
  47711. metalnessmap: {
  47712. metalnessMap: {
  47713. type: "t",
  47714. value: null
  47715. }
  47716. },
  47717. fog: {
  47718. fogDensity: {
  47719. type: "f",
  47720. value: 25e-5
  47721. },
  47722. fogNear: {
  47723. type: "f",
  47724. value: 1
  47725. },
  47726. fogFar: {
  47727. type: "f",
  47728. value: 2e3
  47729. },
  47730. fogColor: {
  47731. type: "c",
  47732. value: new Ci.Color(16777215)
  47733. }
  47734. },
  47735. lights: {
  47736. ambientLightColor: {
  47737. type: "fv",
  47738. value: []
  47739. },
  47740. directionalLights: {
  47741. type: "sa",
  47742. value: [],
  47743. properties: {
  47744. direction: {
  47745. type: "v3"
  47746. },
  47747. color: {
  47748. type: "c"
  47749. },
  47750. shadow: {
  47751. type: "i"
  47752. },
  47753. shadowBias: {
  47754. type: "f"
  47755. },
  47756. shadowRadius: {
  47757. type: "f"
  47758. },
  47759. shadowMapSize: {
  47760. type: "v2"
  47761. }
  47762. }
  47763. },
  47764. directionalShadowMap: {
  47765. type: "tv",
  47766. value: []
  47767. },
  47768. directionalShadowMatrix: {
  47769. type: "m4v",
  47770. value: []
  47771. },
  47772. spotLights: {
  47773. type: "sa",
  47774. value: [],
  47775. properties: {
  47776. color: {
  47777. type: "c"
  47778. },
  47779. position: {
  47780. type: "v3"
  47781. },
  47782. direction: {
  47783. type: "v3"
  47784. },
  47785. distance: {
  47786. type: "f"
  47787. },
  47788. coneCos: {
  47789. type: "f"
  47790. },
  47791. penumbraCos: {
  47792. type: "f"
  47793. },
  47794. decay: {
  47795. type: "f"
  47796. },
  47797. shadow: {
  47798. type: "i"
  47799. },
  47800. shadowBias: {
  47801. type: "f"
  47802. },
  47803. shadowRadius: {
  47804. type: "f"
  47805. },
  47806. shadowMapSize: {
  47807. type: "v2"
  47808. }
  47809. }
  47810. },
  47811. spotShadowMap: {
  47812. type: "tv",
  47813. value: []
  47814. },
  47815. spotShadowMatrix: {
  47816. type: "m4v",
  47817. value: []
  47818. },
  47819. pointLights: {
  47820. type: "sa",
  47821. value: [],
  47822. properties: {
  47823. color: {
  47824. type: "c"
  47825. },
  47826. position: {
  47827. type: "v3"
  47828. },
  47829. decay: {
  47830. type: "f"
  47831. },
  47832. distance: {
  47833. type: "f"
  47834. },
  47835. shadow: {
  47836. type: "i"
  47837. },
  47838. shadowBias: {
  47839. type: "f"
  47840. },
  47841. shadowRadius: {
  47842. type: "f"
  47843. },
  47844. shadowMapSize: {
  47845. type: "v2"
  47846. }
  47847. }
  47848. },
  47849. pointShadowMap: {
  47850. type: "tv",
  47851. value: []
  47852. },
  47853. pointShadowMatrix: {
  47854. type: "m4v",
  47855. value: []
  47856. },
  47857. hemisphereLights: {
  47858. type: "sa",
  47859. value: [],
  47860. properties: {
  47861. direction: {
  47862. type: "v3"
  47863. },
  47864. skyColor: {
  47865. type: "c"
  47866. },
  47867. groundColor: {
  47868. type: "c"
  47869. }
  47870. }
  47871. }
  47872. },
  47873. points: {
  47874. diffuse: {
  47875. type: "c",
  47876. value: new Ci.Color(15658734)
  47877. },
  47878. opacity: {
  47879. type: "f",
  47880. value: 1
  47881. },
  47882. size: {
  47883. type: "f",
  47884. value: 1
  47885. },
  47886. scale: {
  47887. type: "f",
  47888. value: 1
  47889. },
  47890. map: {
  47891. type: "t",
  47892. value: null
  47893. },
  47894. offsetRepeat: {
  47895. type: "v4",
  47896. value: new Ci.Vector4(0,0,1,1)
  47897. }
  47898. }
  47899. },
  47900. 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",
  47901. 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",
  47902. 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",
  47903. 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",
  47904. 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",
  47905. 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",
  47906. 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",
  47907. 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",
  47908. 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",
  47909. 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",
  47910. 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",
  47911. 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",
  47912. 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",
  47913. 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",
  47914. 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",
  47915. 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",
  47916. 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",
  47917. 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",
  47918. 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",
  47919. 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",
  47920. 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",
  47921. 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",
  47922. 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",
  47923. 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",
  47924. Ci.ShaderLib = {
  47925. basic: {
  47926. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.aomap, Ci.UniformsLib.fog]),
  47927. vertexShader: Ci.ShaderChunk.meshbasic_vert,
  47928. fragmentShader: Ci.ShaderChunk.meshbasic_frag
  47929. },
  47930. lambert: {
  47931. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.aomap, Ci.UniformsLib.lightmap, Ci.UniformsLib.emissivemap, Ci.UniformsLib.fog, Ci.UniformsLib.lights, {
  47932. emissive: {
  47933. type: "c",
  47934. value: new Ci.Color(0)
  47935. }
  47936. }]),
  47937. vertexShader: Ci.ShaderChunk.meshlambert_vert,
  47938. fragmentShader: Ci.ShaderChunk.meshlambert_frag
  47939. },
  47940. phong: {
  47941. 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, {
  47942. emissive: {
  47943. type: "c",
  47944. value: new Ci.Color(0)
  47945. },
  47946. specular: {
  47947. type: "c",
  47948. value: new Ci.Color(1118481)
  47949. },
  47950. shininess: {
  47951. type: "f",
  47952. value: 30
  47953. }
  47954. }]),
  47955. vertexShader: Ci.ShaderChunk.meshphong_vert,
  47956. fragmentShader: Ci.ShaderChunk.meshphong_frag
  47957. },
  47958. standard: {
  47959. 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, {
  47960. emissive: {
  47961. type: "c",
  47962. value: new Ci.Color(0)
  47963. },
  47964. roughness: {
  47965. type: "f",
  47966. value: .5
  47967. },
  47968. metalness: {
  47969. type: "f",
  47970. value: 0
  47971. },
  47972. envMapIntensity: {
  47973. type: "f",
  47974. value: 1
  47975. }
  47976. }]),
  47977. vertexShader: Ci.ShaderChunk.meshstandard_vert,
  47978. fragmentShader: Ci.ShaderChunk.meshstandard_frag
  47979. },
  47980. points: {
  47981. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.points, Ci.UniformsLib.fog]),
  47982. vertexShader: Ci.ShaderChunk.points_vert,
  47983. fragmentShader: Ci.ShaderChunk.points_frag
  47984. },
  47985. dashed: {
  47986. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.fog, {
  47987. scale: {
  47988. type: "f",
  47989. value: 1
  47990. },
  47991. dashSize: {
  47992. type: "f",
  47993. value: 1
  47994. },
  47995. totalSize: {
  47996. type: "f",
  47997. value: 2
  47998. }
  47999. }]),
  48000. vertexShader: Ci.ShaderChunk.linedashed_vert,
  48001. fragmentShader: Ci.ShaderChunk.linedashed_frag
  48002. },
  48003. depth: {
  48004. uniforms: {
  48005. mNear: {
  48006. type: "f",
  48007. value: 1
  48008. },
  48009. mFar: {
  48010. type: "f",
  48011. value: 2e3
  48012. },
  48013. opacity: {
  48014. type: "f",
  48015. value: 1
  48016. }
  48017. },
  48018. vertexShader: Ci.ShaderChunk.depth_vert,
  48019. fragmentShader: Ci.ShaderChunk.depth_frag
  48020. },
  48021. normal: {
  48022. uniforms: {
  48023. opacity: {
  48024. type: "f",
  48025. value: 1
  48026. }
  48027. },
  48028. vertexShader: Ci.ShaderChunk.normal_vert,
  48029. fragmentShader: Ci.ShaderChunk.normal_frag
  48030. },
  48031. cube: {
  48032. uniforms: {
  48033. tCube: {
  48034. type: "t",
  48035. value: null
  48036. },
  48037. tFlip: {
  48038. type: "f",
  48039. value: -1
  48040. }
  48041. },
  48042. vertexShader: Ci.ShaderChunk.cube_vert,
  48043. fragmentShader: Ci.ShaderChunk.cube_frag
  48044. },
  48045. equirect: {
  48046. uniforms: {
  48047. tEquirect: {
  48048. type: "t",
  48049. value: null
  48050. },
  48051. tFlip: {
  48052. type: "f",
  48053. value: -1
  48054. }
  48055. },
  48056. vertexShader: Ci.ShaderChunk.equirect_vert,
  48057. fragmentShader: Ci.ShaderChunk.equirect_frag
  48058. },
  48059. depthRGBA: {
  48060. uniforms: {},
  48061. vertexShader: Ci.ShaderChunk.depthRGBA_vert,
  48062. fragmentShader: Ci.ShaderChunk.depthRGBA_frag
  48063. },
  48064. distanceRGBA: {
  48065. uniforms: {
  48066. lightPos: {
  48067. type: "v3",
  48068. value: new Ci.Vector3(0,0,0)
  48069. }
  48070. },
  48071. vertexShader: Ci.ShaderChunk.distanceRGBA_vert,
  48072. fragmentShader: Ci.ShaderChunk.distanceRGBA_frag
  48073. }
  48074. },
  48075. Ci.WebGLRenderer = function(e) {
  48076. function S() {
  48077. return null === Q ? he : 1
  48078. }
  48079. function i(e, t, i, n) {
  48080. !0 === V && (e *= n,
  48081. t *= n,
  48082. i *= n),
  48083. _e.clearColor(e, t, i, n)
  48084. }
  48085. function t() {
  48086. _e.init(),
  48087. _e.scissor(ie.copy(ue).multiplyScalar(he)),
  48088. _e.viewport(re.copy(pe).multiplyScalar(he)),
  48089. i(ae.r, ae.g, ae.b, se)
  48090. }
  48091. function n() {
  48092. te = K = null,
  48093. ee = "",
  48094. $ = -1,
  48095. _e.reset()
  48096. }
  48097. function r(e) {
  48098. e.preventDefault(),
  48099. n(),
  48100. t(),
  48101. be.clear()
  48102. }
  48103. function f(e) {
  48104. var t = e.target;
  48105. t.removeEventListener("dispose", f),
  48106. function(e) {
  48107. var t = be.get(e);
  48108. if (e.image && t.__image__webglTextureCube)
  48109. X.deleteTexture(t.__image__webglTextureCube);
  48110. else {
  48111. if (void 0 === t.__webglInit)
  48112. return;
  48113. X.deleteTexture(t.__webglTexture)
  48114. }
  48115. be.delete(e)
  48116. }(t),
  48117. ye.textures--
  48118. }
  48119. function a(e) {
  48120. var t = e.target;
  48121. t.removeEventListener("dispose", a),
  48122. function(e) {
  48123. var t = be.get(e)
  48124. , i = be.get(e.texture);
  48125. if (e && void 0 !== i.__webglTexture) {
  48126. if (X.deleteTexture(i.__webglTexture),
  48127. e instanceof Ci.WebGLRenderTargetCube)
  48128. for (var n = 0; n < 6; n++)
  48129. X.deleteFramebuffer(t.__webglFramebuffer[n]),
  48130. X.deleteRenderbuffer(t.__webglDepthbuffer[n]);
  48131. else
  48132. X.deleteFramebuffer(t.__webglFramebuffer),
  48133. X.deleteRenderbuffer(t.__webglDepthbuffer);
  48134. be.delete(e.texture),
  48135. be.delete(e)
  48136. }
  48137. }(t),
  48138. ye.textures--
  48139. }
  48140. function v(e) {
  48141. var t = e.target;
  48142. t.removeEventListener("dispose", v),
  48143. function(e) {
  48144. y(e),
  48145. be.delete(e)
  48146. }(t)
  48147. }
  48148. function y(e) {
  48149. var t = be.get(e).program;
  48150. (e.program = void 0) !== t && Te.releaseProgram(t)
  48151. }
  48152. function M(e, t) {
  48153. return Math.abs(t[0]) - Math.abs(e[0])
  48154. }
  48155. function s(e, t) {
  48156. 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
  48157. }
  48158. function l(e, t) {
  48159. 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
  48160. }
  48161. function d(e, t, i, n, r) {
  48162. var o, a;
  48163. a = i.transparent ? (o = G,
  48164. ++W) : (o = H,
  48165. ++z);
  48166. var s = o[a];
  48167. void 0 !== s ? (s.id = e.id,
  48168. s.object = e,
  48169. s.geometry = t,
  48170. s.material = i,
  48171. s.z = me.z,
  48172. s.group = r) : (s = {
  48173. id: e.id,
  48174. object: e,
  48175. geometry: t,
  48176. material: i,
  48177. z: me.z,
  48178. group: r
  48179. },
  48180. o.push(s))
  48181. }
  48182. function c(e, t, i, n) {
  48183. for (var r = 0, o = e.length; r < o; r++) {
  48184. var a = e[r]
  48185. , s = a.object
  48186. , l = a.geometry
  48187. , c = void 0 === n ? a.material : n
  48188. , h = a.group;
  48189. if (s.modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, s.matrixWorld),
  48190. s.normalMatrix.getNormalMatrix(s.modelViewMatrix),
  48191. s instanceof Ci.ImmediateRenderObject) {
  48192. R(c);
  48193. var u = P(t, i, c, s);
  48194. ee = "",
  48195. s.render(function(e) {
  48196. Z.renderBufferImmediate(e, u, c)
  48197. })
  48198. } else
  48199. Z.renderBufferDirect(t, i, l, c, s, h)
  48200. }
  48201. }
  48202. function R(e) {
  48203. (function(e) {
  48204. e.side !== Ci.DoubleSide ? _e.enable(X.CULL_FACE) : _e.disable(X.CULL_FACE),
  48205. _e.setFlipSided(e.side === Ci.BackSide)
  48206. }
  48207. )(e),
  48208. !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),
  48209. _e.setDepthFunc(e.depthFunc),
  48210. _e.setDepthTest(e.depthTest),
  48211. _e.setDepthWrite(e.depthWrite),
  48212. _e.setColorWrite(e.colorWrite),
  48213. _e.setPolygonOffset(e.polygonOffset, e.polygonOffsetFactor, e.polygonOffsetUnits)
  48214. }
  48215. function P(e, t, i, n) {
  48216. oe = 0;
  48217. var r = be.get(i);
  48218. void 0 === r.program && (i.needsUpdate = !0),
  48219. void 0 !== r.lightsHash && r.lightsHash !== ve.hash && (i.needsUpdate = !0),
  48220. i.needsUpdate && (function(e, t, i) {
  48221. var n = be.get(e)
  48222. , r = Te.getParameters(e, ve, t, i)
  48223. , o = Te.getProgramCode(e, r)
  48224. , a = n.program
  48225. , s = !0;
  48226. if (void 0 === a)
  48227. e.addEventListener("dispose", v);
  48228. else if (a.code !== o)
  48229. y(e);
  48230. else {
  48231. if (void 0 !== r.shaderID)
  48232. return;
  48233. s = !1
  48234. }
  48235. if (s) {
  48236. if (r.shaderID) {
  48237. var l = Ci.ShaderLib[r.shaderID];
  48238. n.__webglShader = {
  48239. name: e.type,
  48240. uniforms: Ci.UniformsUtils.clone(l.uniforms),
  48241. vertexShader: l.vertexShader,
  48242. fragmentShader: l.fragmentShader
  48243. }
  48244. } else
  48245. n.__webglShader = {
  48246. name: e.type,
  48247. uniforms: e.uniforms,
  48248. vertexShader: e.vertexShader,
  48249. fragmentShader: e.fragmentShader
  48250. };
  48251. e.__webglShader = n.__webglShader,
  48252. a = Te.acquireProgram(e, r, o),
  48253. n.program = a,
  48254. e.program = a
  48255. }
  48256. var c = a.getAttributes();
  48257. if (e.morphTargets)
  48258. for (var h = e.numSupportedMorphTargets = 0; h < Z.maxMorphTargets; h++)
  48259. 0 <= c["morphTarget" + h] && e.numSupportedMorphTargets++;
  48260. if (e.morphNormals)
  48261. for (h = e.numSupportedMorphNormals = 0; h < Z.maxMorphNormals; h++)
  48262. 0 <= c["morphNormal" + h] && e.numSupportedMorphNormals++;
  48263. n.uniformsList = [];
  48264. var u = n.__webglShader.uniforms
  48265. , d = n.program.getUniforms();
  48266. for (var p in u) {
  48267. var f = d[p];
  48268. f && n.uniformsList.push([n.__webglShader.uniforms[p], f])
  48269. }
  48270. (e instanceof Ci.MeshPhongMaterial || e instanceof Ci.MeshLambertMaterial || e instanceof Ci.MeshStandardMaterial || e.lights) && (n.lightsHash = ve.hash,
  48271. u.ambientLightColor.value = ve.ambient,
  48272. u.directionalLights.value = ve.directional,
  48273. u.spotLights.value = ve.spot,
  48274. u.pointLights.value = ve.point,
  48275. u.hemisphereLights.value = ve.hemi,
  48276. u.directionalShadowMap.value = ve.directionalShadowMap,
  48277. u.directionalShadowMatrix.value = ve.directionalShadowMatrix,
  48278. u.spotShadowMap.value = ve.spotShadowMap,
  48279. u.spotShadowMatrix.value = ve.spotShadowMatrix,
  48280. u.pointShadowMap.value = ve.pointShadowMap,
  48281. u.pointShadowMatrix.value = ve.pointShadowMatrix),
  48282. n.hasDynamicUniforms = !1;
  48283. for (var g = 0, m = n.uniformsList.length; g < m; g++) {
  48284. if (!0 === n.uniformsList[g][0].dynamic) {
  48285. n.hasDynamicUniforms = !0;
  48286. break
  48287. }
  48288. }
  48289. }(i, t, n),
  48290. i.needsUpdate = !1);
  48291. var o = !1
  48292. , a = !1
  48293. , s = !1
  48294. , l = r.program
  48295. , c = l.getUniforms()
  48296. , h = r.__webglShader.uniforms;
  48297. if (l.id !== K && (X.useProgram(l.program),
  48298. K = l.id,
  48299. s = a = o = !0),
  48300. i.id !== $ && ($ = i.id,
  48301. a = !0),
  48302. !o && e === te || (X.uniformMatrix4fv(c.projectionMatrix, !1, e.projectionMatrix.elements),
  48303. Ee.logarithmicDepthBuffer && X.uniform1f(c.logDepthBufFC, 2 / (Math.log(e.far + 1) / Math.LN2)),
  48304. e !== te && (te = e,
  48305. s = a = !0),
  48306. (i instanceof Ci.ShaderMaterial || i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshStandardMaterial || i.envMap) && void 0 !== c.cameraPosition && (me.setFromMatrixPosition(e.matrixWorld),
  48307. X.uniform3f(c.cameraPosition, me.x, me.y, me.z)),
  48308. (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),
  48309. void 0 !== c.toneMappingExposure && X.uniform1f(c.toneMappingExposure, Z.toneMappingExposure),
  48310. void 0 !== c.toneMappingWhitePoint && X.uniform1f(c.toneMappingWhitePoint, Z.toneMappingWhitePoint)),
  48311. i.skinning)
  48312. if (n.bindMatrix && void 0 !== c.bindMatrix && X.uniformMatrix4fv(c.bindMatrix, !1, n.bindMatrix.elements),
  48313. n.bindMatrixInverse && void 0 !== c.bindMatrixInverse && X.uniformMatrix4fv(c.bindMatrixInverse, !1, n.bindMatrixInverse.elements),
  48314. Ee.floatVertexTextures && n.skeleton && n.skeleton.useVertexTexture) {
  48315. if (void 0 !== c.boneTexture) {
  48316. var u = A();
  48317. X.uniform1i(c.boneTexture, u),
  48318. Z.setTexture(n.skeleton.boneTexture, u)
  48319. }
  48320. void 0 !== c.boneTextureWidth && X.uniform1i(c.boneTextureWidth, n.skeleton.boneTextureWidth),
  48321. void 0 !== c.boneTextureHeight && X.uniform1i(c.boneTextureHeight, n.skeleton.boneTextureHeight)
  48322. } else
  48323. n.skeleton && n.skeleton.boneMatrices && void 0 !== c.boneGlobalMatrices && X.uniformMatrix4fv(c.boneGlobalMatrices, !1, n.skeleton.boneMatrices);
  48324. return a && ((i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshLambertMaterial || i instanceof Ci.MeshStandardMaterial || i.lights) && function(e, t) {
  48325. e.ambientLightColor.needsUpdate = t,
  48326. e.directionalLights.needsUpdate = t,
  48327. e.pointLights.needsUpdate = t,
  48328. e.spotLights.needsUpdate = t,
  48329. e.hemisphereLights.needsUpdate = t
  48330. }(h, s),
  48331. t && i.fog && function(e, t) {
  48332. e.fogColor.value = t.color,
  48333. t instanceof Ci.Fog ? (e.fogNear.value = t.near,
  48334. e.fogFar.value = t.far) : t instanceof Ci.FogExp2 && (e.fogDensity.value = t.density)
  48335. }(h, t),
  48336. (i instanceof Ci.MeshBasicMaterial || i instanceof Ci.MeshLambertMaterial || i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshStandardMaterial) && function(e, t) {
  48337. var i;
  48338. if (e.opacity.value = t.opacity,
  48339. e.diffuse.value = t.color,
  48340. t.emissive && e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),
  48341. e.map.value = t.map,
  48342. e.specularMap.value = t.specularMap,
  48343. e.alphaMap.value = t.alphaMap,
  48344. t.aoMap && (e.aoMap.value = t.aoMap,
  48345. e.aoMapIntensity.value = t.aoMapIntensity),
  48346. 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),
  48347. void 0 !== i) {
  48348. i instanceof Ci.WebGLRenderTarget && (i = i.texture);
  48349. var n = i.offset
  48350. , r = i.repeat;
  48351. e.offsetRepeat.value.set(n.x, n.y, r.x, r.y)
  48352. }
  48353. e.envMap.value = t.envMap,
  48354. e.flipEnvMap.value = t.envMap instanceof Ci.WebGLRenderTargetCube ? 1 : -1,
  48355. e.reflectivity.value = t.reflectivity,
  48356. e.refractionRatio.value = t.refractionRatio
  48357. }(h, i),
  48358. i instanceof Ci.LineBasicMaterial ? p(h, i) : i instanceof Ci.LineDashedMaterial ? (p(h, i),
  48359. function(e, t) {
  48360. e.dashSize.value = t.dashSize,
  48361. e.totalSize.value = t.dashSize + t.gapSize,
  48362. e.scale.value = t.scale
  48363. }(h, i)) : i instanceof Ci.PointsMaterial ? function(e, t) {
  48364. if (e.diffuse.value = t.color,
  48365. e.opacity.value = t.opacity,
  48366. e.size.value = t.size * he,
  48367. e.scale.value = O.clientHeight / 2,
  48368. e.map.value = t.map,
  48369. null !== t.map) {
  48370. var i = t.map.offset
  48371. , n = t.map.repeat;
  48372. e.offsetRepeat.value.set(i.x, i.y, n.x, n.y)
  48373. }
  48374. }(h, i) : i instanceof Ci.MeshLambertMaterial ? function(e, t) {
  48375. t.lightMap && (e.lightMap.value = t.lightMap,
  48376. e.lightMapIntensity.value = t.lightMapIntensity),
  48377. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap)
  48378. }(h, i) : i instanceof Ci.MeshPhongMaterial ? function(e, t) {
  48379. e.specular.value = t.specular,
  48380. e.shininess.value = Math.max(t.shininess, 1e-4),
  48381. t.lightMap && (e.lightMap.value = t.lightMap,
  48382. e.lightMapIntensity.value = t.lightMapIntensity),
  48383. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  48384. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  48385. e.bumpScale.value = t.bumpScale),
  48386. t.normalMap && (e.normalMap.value = t.normalMap,
  48387. e.normalScale.value.copy(t.normalScale)),
  48388. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  48389. e.displacementScale.value = t.displacementScale,
  48390. e.displacementBias.value = t.displacementBias)
  48391. }(h, i) : i instanceof Ci.MeshStandardMaterial ? function(e, t) {
  48392. e.roughness.value = t.roughness,
  48393. e.metalness.value = t.metalness,
  48394. t.roughnessMap && (e.roughnessMap.value = t.roughnessMap),
  48395. t.metalnessMap && (e.metalnessMap.value = t.metalnessMap),
  48396. t.lightMap && (e.lightMap.value = t.lightMap,
  48397. e.lightMapIntensity.value = t.lightMapIntensity),
  48398. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  48399. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  48400. e.bumpScale.value = t.bumpScale),
  48401. t.normalMap && (e.normalMap.value = t.normalMap,
  48402. e.normalScale.value.copy(t.normalScale)),
  48403. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  48404. e.displacementScale.value = t.displacementScale,
  48405. e.displacementBias.value = t.displacementBias),
  48406. t.envMap && (e.envMapIntensity.value = t.envMapIntensity)
  48407. }(h, i) : i instanceof Ci.MeshDepthMaterial ? (h.mNear.value = e.near,
  48408. h.mFar.value = e.far,
  48409. h.opacity.value = i.opacity) : i instanceof Ci.MeshNormalMaterial && (h.opacity.value = i.opacity),
  48410. g(r.uniformsList)),
  48411. function(e, t) {
  48412. X.uniformMatrix4fv(e.modelViewMatrix, !1, t.modelViewMatrix.elements),
  48413. e.normalMatrix && X.uniformMatrix3fv(e.normalMatrix, !1, t.normalMatrix.elements)
  48414. }(c, n),
  48415. void 0 !== c.modelMatrix && X.uniformMatrix4fv(c.modelMatrix, !1, n.matrixWorld.elements),
  48416. !0 === r.hasDynamicUniforms && function(e, t, i) {
  48417. for (var n = [], r = 0, o = e.length; r < o; r++) {
  48418. var a = e[r][0]
  48419. , s = a.onUpdateCallback;
  48420. void 0 !== s && (s.bind(a)(t, i),
  48421. n.push(e[r]))
  48422. }
  48423. g(n)
  48424. }(r.uniformsList, n, e),
  48425. l
  48426. }
  48427. function p(e, t) {
  48428. e.diffuse.value = t.color,
  48429. e.opacity.value = t.opacity
  48430. }
  48431. function A() {
  48432. var e = oe;
  48433. return e >= Ee.maxTextures && console.warn("WebGLRenderer: trying to use " + e + " texture units while this GPU supports only " + Ee.maxTextures),
  48434. oe += 1,
  48435. e
  48436. }
  48437. function C(e, t, i, n) {
  48438. var r, o;
  48439. if ("1i" === t)
  48440. X.uniform1i(i, n);
  48441. else if ("1f" === t)
  48442. X.uniform1f(i, n);
  48443. else if ("2f" === t)
  48444. X.uniform2f(i, n[0], n[1]);
  48445. else if ("3f" === t)
  48446. X.uniform3f(i, n[0], n[1], n[2]);
  48447. else if ("4f" === t)
  48448. X.uniform4f(i, n[0], n[1], n[2], n[3]);
  48449. else if ("1iv" === t)
  48450. X.uniform1iv(i, n);
  48451. else if ("3iv" === t)
  48452. X.uniform3iv(i, n);
  48453. else if ("1fv" === t)
  48454. X.uniform1fv(i, n);
  48455. else if ("2fv" === t)
  48456. X.uniform2fv(i, n);
  48457. else if ("3fv" === t)
  48458. X.uniform3fv(i, n);
  48459. else if ("4fv" === t)
  48460. X.uniform4fv(i, n);
  48461. else if ("Matrix2fv" === t)
  48462. X.uniformMatrix2fv(i, !1, n);
  48463. else if ("Matrix3fv" === t)
  48464. X.uniformMatrix3fv(i, !1, n);
  48465. else if ("Matrix4fv" === t)
  48466. X.uniformMatrix4fv(i, !1, n);
  48467. else if ("i" === t)
  48468. X.uniform1i(i, n);
  48469. else if ("f" === t)
  48470. X.uniform1f(i, n);
  48471. else if ("v2" === t)
  48472. X.uniform2f(i, n.x, n.y);
  48473. else if ("v3" === t)
  48474. X.uniform3f(i, n.x, n.y, n.z);
  48475. else if ("v4" === t)
  48476. X.uniform4f(i, n.x, n.y, n.z, n.w);
  48477. else if ("c" === t)
  48478. X.uniform3f(i, n.r, n.g, n.b);
  48479. else if ("s" === t) {
  48480. var a = e.properties;
  48481. for (var s in a) {
  48482. var l = a[s]
  48483. , c = i[s]
  48484. , h = n[s];
  48485. C(l, l.type, c, h)
  48486. }
  48487. } else if ("sa" === t) {
  48488. a = e.properties;
  48489. for (var u = 0, d = n.length; u < d; u++)
  48490. for (var s in a) {
  48491. l = a[s],
  48492. c = i[u][s],
  48493. h = n[u][s];
  48494. C(l, l.type, c, h)
  48495. }
  48496. } else if ("iv1" === t)
  48497. X.uniform1iv(i, n);
  48498. else if ("iv" === t)
  48499. X.uniform3iv(i, n);
  48500. else if ("fv1" === t)
  48501. X.uniform1fv(i, n);
  48502. else if ("fv" === t)
  48503. X.uniform3fv(i, n);
  48504. else if ("v2v" === t) {
  48505. void 0 === e._array && (e._array = new Float32Array(2 * n.length));
  48506. u = 0;
  48507. for (var p = 0, f = n.length; u < f; u++,
  48508. p += 2)
  48509. e._array[p + 0] = n[u].x,
  48510. e._array[p + 1] = n[u].y;
  48511. X.uniform2fv(i, e._array)
  48512. } else if ("v3v" === t) {
  48513. void 0 === e._array && (e._array = new Float32Array(3 * n.length));
  48514. u = 0;
  48515. var g = 0;
  48516. for (f = n.length; u < f; u++,
  48517. g += 3)
  48518. e._array[g + 0] = n[u].x,
  48519. e._array[g + 1] = n[u].y,
  48520. e._array[g + 2] = n[u].z;
  48521. X.uniform3fv(i, e._array)
  48522. } else if ("v4v" === t) {
  48523. void 0 === e._array && (e._array = new Float32Array(4 * n.length));
  48524. u = 0;
  48525. var m = 0;
  48526. for (f = n.length; u < f; u++,
  48527. m += 4)
  48528. e._array[m + 0] = n[u].x,
  48529. e._array[m + 1] = n[u].y,
  48530. e._array[m + 2] = n[u].z,
  48531. e._array[m + 3] = n[u].w;
  48532. X.uniform4fv(i, e._array)
  48533. } else if ("m2" === t)
  48534. X.uniformMatrix2fv(i, !1, n.elements);
  48535. else if ("m3" === t)
  48536. X.uniformMatrix3fv(i, !1, n.elements);
  48537. else if ("m3v" === t) {
  48538. void 0 === e._array && (e._array = new Float32Array(9 * n.length));
  48539. for (u = 0,
  48540. f = n.length; u < f; u++)
  48541. n[u].flattenToArrayOffset(e._array, 9 * u);
  48542. X.uniformMatrix3fv(i, !1, e._array)
  48543. } else if ("m4" === t)
  48544. X.uniformMatrix4fv(i, !1, n.elements);
  48545. else if ("m4v" === t) {
  48546. void 0 === e._array && (e._array = new Float32Array(16 * n.length));
  48547. for (u = 0,
  48548. f = n.length; u < f; u++)
  48549. n[u].flattenToArrayOffset(e._array, 16 * u);
  48550. X.uniformMatrix4fv(i, !1, e._array)
  48551. } else if ("t" === t) {
  48552. if (r = n,
  48553. o = A(),
  48554. X.uniform1i(i, o),
  48555. !r)
  48556. return;
  48557. 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)
  48558. } else if ("tv" === t) {
  48559. void 0 === e._array && (e._array = []);
  48560. for (u = 0,
  48561. f = e.value.length; u < f; u++)
  48562. e._array[u] = A();
  48563. X.uniform1iv(i, e._array);
  48564. for (u = 0,
  48565. f = e.value.length; u < f; u++)
  48566. r = e.value[u],
  48567. o = e._array[u],
  48568. 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))
  48569. } else
  48570. console.warn("THREE.WebGLRenderer: Unknown uniform type: " + t)
  48571. }
  48572. function g(e) {
  48573. for (var t = 0, i = e.length; t < i; t++) {
  48574. var n = e[t][0];
  48575. if (!1 !== n.needsUpdate)
  48576. C(n, n.type, e[t][1], n.value)
  48577. }
  48578. }
  48579. function m(e, t, i) {
  48580. var n;
  48581. if (i ? (X.texParameteri(e, X.TEXTURE_WRAP_S, x(t.wrapS)),
  48582. X.texParameteri(e, X.TEXTURE_WRAP_T, x(t.wrapT)),
  48583. X.texParameteri(e, X.TEXTURE_MAG_FILTER, x(t.magFilter)),
  48584. X.texParameteri(e, X.TEXTURE_MIN_FILTER, x(t.minFilter))) : (X.texParameteri(e, X.TEXTURE_WRAP_S, X.CLAMP_TO_EDGE),
  48585. X.texParameteri(e, X.TEXTURE_WRAP_T, X.CLAMP_TO_EDGE),
  48586. 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),
  48587. X.texParameteri(e, X.TEXTURE_MAG_FILTER, T(t.magFilter)),
  48588. X.texParameteri(e, X.TEXTURE_MIN_FILTER, T(t.minFilter)),
  48589. 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)),
  48590. n = Ie.get("EXT_texture_filter_anisotropic")) {
  48591. if (t.type === Ci.FloatType && null === Ie.get("OES_texture_float_linear"))
  48592. return;
  48593. if (t.type === Ci.HalfFloatType && null === Ie.get("OES_texture_half_float_linear"))
  48594. return;
  48595. (1 < t.anisotropy || be.get(t).__currentAnisotropy) && (X.texParameterf(e, n.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(t.anisotropy, Z.getMaxAnisotropy())),
  48596. be.get(t).__currentAnisotropy = t.anisotropy)
  48597. }
  48598. }
  48599. function o(e, t, i) {
  48600. void 0 === e.__webglInit && (e.__webglInit = !0,
  48601. t.addEventListener("dispose", f),
  48602. e.__webglTexture = X.createTexture(),
  48603. ye.textures++),
  48604. _e.activeTexture(X.TEXTURE0 + i),
  48605. _e.bindTexture(X.TEXTURE_2D, e.__webglTexture),
  48606. X.pixelStorei(X.UNPACK_FLIP_Y_WEBGL, t.flipY),
  48607. X.pixelStorei(X.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  48608. X.pixelStorei(X.UNPACK_ALIGNMENT, t.unpackAlignment);
  48609. var n = I(t.image, Ee.maxTextureSize);
  48610. !function(e) {
  48611. return e.wrapS !== Ci.ClampToEdgeWrapping || e.wrapT !== Ci.ClampToEdgeWrapping || e.minFilter !== Ci.NearestFilter && e.minFilter !== Ci.LinearFilter
  48612. }(t) || !1 !== E(n) || (n = function(e) {
  48613. if (e instanceof HTMLImageElement || e instanceof HTMLCanvasElement) {
  48614. var t = document.createElement("canvas");
  48615. return t.width = Ci.Math.nearestPowerOfTwo(e.width),
  48616. t.height = Ci.Math.nearestPowerOfTwo(e.height),
  48617. t.getContext("2d").drawImage(e, 0, 0, t.width, t.height),
  48618. console.warn("THREE.WebGLRenderer: image is not power of two (" + e.width + "x" + e.height + "). Resized to " + t.width + "x" + t.height, e),
  48619. t
  48620. }
  48621. return e
  48622. }(n));
  48623. var r = E(n)
  48624. , o = x(t.format)
  48625. , a = x(t.type);
  48626. m(X.TEXTURE_2D, t, r);
  48627. var s, l = t.mipmaps;
  48628. if (t instanceof Ci.DataTexture)
  48629. if (0 < l.length && r) {
  48630. for (var c = 0, h = l.length; c < h; c++)
  48631. s = l[c],
  48632. _e.texImage2D(X.TEXTURE_2D, c, o, s.width, s.height, 0, o, a, s.data);
  48633. t.generateMipmaps = !1
  48634. } else
  48635. _e.texImage2D(X.TEXTURE_2D, 0, o, n.width, n.height, 0, o, a, n.data);
  48636. else if (t instanceof Ci.CompressedTexture)
  48637. for (c = 0,
  48638. h = l.length; c < h; c++)
  48639. s = l[c],
  48640. 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);
  48641. else if (0 < l.length && r) {
  48642. for (c = 0,
  48643. h = l.length; c < h; c++)
  48644. s = l[c],
  48645. _e.texImage2D(X.TEXTURE_2D, c, o, o, a, s);
  48646. t.generateMipmaps = !1
  48647. } else
  48648. _e.texImage2D(X.TEXTURE_2D, 0, o, o, a, n);
  48649. t.generateMipmaps && r && X.generateMipmap(X.TEXTURE_2D),
  48650. e.__version = t.version,
  48651. t.onUpdate && t.onUpdate(t)
  48652. }
  48653. function I(e, t) {
  48654. if (e.width > t || e.height > t) {
  48655. var i = t / Math.max(e.width, e.height)
  48656. , n = document.createElement("canvas");
  48657. return n.width = Math.floor(e.width * i),
  48658. n.height = Math.floor(e.height * i),
  48659. n.getContext("2d").drawImage(e, 0, 0, e.width, e.height, 0, 0, n.width, n.height),
  48660. console.warn("THREE.WebGLRenderer: image is too big (" + e.width + "x" + e.height + "). Resized to " + n.width + "x" + n.height, e),
  48661. n
  48662. }
  48663. return e
  48664. }
  48665. function E(e) {
  48666. return Ci.Math.isPowerOfTwo(e.width) && Ci.Math.isPowerOfTwo(e.height)
  48667. }
  48668. function _(e, t) {
  48669. var i = be.get(e);
  48670. if (6 === e.image.length)
  48671. if (0 < e.version && i.__version !== e.version) {
  48672. i.__image__webglTextureCube || (e.addEventListener("dispose", f),
  48673. i.__image__webglTextureCube = X.createTexture(),
  48674. ye.textures++),
  48675. _e.activeTexture(X.TEXTURE0 + t),
  48676. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__image__webglTextureCube),
  48677. X.pixelStorei(X.UNPACK_FLIP_Y_WEBGL, e.flipY);
  48678. for (var n = e instanceof Ci.CompressedTexture, r = e.image[0]instanceof Ci.DataTexture, o = [], a = 0; a < 6; a++)
  48679. !Z.autoScaleCubemaps || n || r ? o[a] = r ? e.image[a].image : e.image[a] : o[a] = I(e.image[a], Ee.maxCubemapSize);
  48680. var s = E(o[0])
  48681. , l = x(e.format)
  48682. , c = x(e.type);
  48683. m(X.TEXTURE_CUBE_MAP, e, s);
  48684. for (a = 0; a < 6; a++)
  48685. if (n)
  48686. for (var h, u = o[a].mipmaps, d = 0, p = u.length; d < p; d++)
  48687. h = u[d],
  48688. 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);
  48689. else
  48690. 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]);
  48691. e.generateMipmaps && s && X.generateMipmap(X.TEXTURE_CUBE_MAP),
  48692. i.__version = e.version,
  48693. e.onUpdate && e.onUpdate(e)
  48694. } else
  48695. _e.activeTexture(X.TEXTURE0 + t),
  48696. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__image__webglTextureCube)
  48697. }
  48698. function b(e, t) {
  48699. _e.activeTexture(X.TEXTURE0 + t),
  48700. _e.bindTexture(X.TEXTURE_CUBE_MAP, be.get(e).__webglTexture)
  48701. }
  48702. function h(e, t, i, n) {
  48703. var r = x(t.texture.format)
  48704. , o = x(t.texture.type);
  48705. _e.texImage2D(n, 0, r, t.width, t.height, 0, r, o, null),
  48706. X.bindFramebuffer(X.FRAMEBUFFER, e),
  48707. X.framebufferTexture2D(X.FRAMEBUFFER, i, n, be.get(t.texture).__webglTexture, 0),
  48708. X.bindFramebuffer(X.FRAMEBUFFER, null)
  48709. }
  48710. function u(e, t) {
  48711. X.bindRenderbuffer(X.RENDERBUFFER, e),
  48712. t.depthBuffer && !t.stencilBuffer ? (X.renderbufferStorage(X.RENDERBUFFER, X.DEPTH_COMPONENT16, t.width, t.height),
  48713. 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),
  48714. X.framebufferRenderbuffer(X.FRAMEBUFFER, X.DEPTH_STENCIL_ATTACHMENT, X.RENDERBUFFER, e)) : X.renderbufferStorage(X.RENDERBUFFER, X.RGBA4, t.width, t.height),
  48715. X.bindRenderbuffer(X.RENDERBUFFER, null)
  48716. }
  48717. function w(e) {
  48718. var t = be.get(e)
  48719. , i = be.get(e.texture);
  48720. e.addEventListener("dispose", a),
  48721. i.__webglTexture = X.createTexture(),
  48722. ye.textures++;
  48723. var n = e instanceof Ci.WebGLRenderTargetCube
  48724. , r = Ci.Math.isPowerOfTwo(e.width) && Ci.Math.isPowerOfTwo(e.height);
  48725. if (n) {
  48726. t.__webglFramebuffer = [];
  48727. for (var o = 0; o < 6; o++)
  48728. t.__webglFramebuffer[o] = X.createFramebuffer()
  48729. } else
  48730. t.__webglFramebuffer = X.createFramebuffer();
  48731. if (n) {
  48732. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__webglTexture),
  48733. m(X.TEXTURE_CUBE_MAP, e.texture, r);
  48734. for (o = 0; o < 6; o++)
  48735. h(t.__webglFramebuffer[o], e, X.COLOR_ATTACHMENT0, X.TEXTURE_CUBE_MAP_POSITIVE_X + o);
  48736. e.texture.generateMipmaps && r && X.generateMipmap(X.TEXTURE_CUBE_MAP),
  48737. _e.bindTexture(X.TEXTURE_CUBE_MAP, null)
  48738. } else
  48739. _e.bindTexture(X.TEXTURE_2D, i.__webglTexture),
  48740. m(X.TEXTURE_2D, e.texture, r),
  48741. h(t.__webglFramebuffer, e, X.COLOR_ATTACHMENT0, X.TEXTURE_2D),
  48742. e.texture.generateMipmaps && r && X.generateMipmap(X.TEXTURE_2D),
  48743. _e.bindTexture(X.TEXTURE_2D, null);
  48744. e.depthBuffer && function(e) {
  48745. var t = be.get(e);
  48746. if (e instanceof Ci.WebGLRenderTargetCube) {
  48747. t.__webglDepthbuffer = [];
  48748. for (var i = 0; i < 6; i++)
  48749. X.bindFramebuffer(X.FRAMEBUFFER, t.__webglFramebuffer[i]),
  48750. t.__webglDepthbuffer[i] = X.createRenderbuffer(),
  48751. u(t.__webglDepthbuffer[i], e)
  48752. } else
  48753. X.bindFramebuffer(X.FRAMEBUFFER, t.__webglFramebuffer),
  48754. t.__webglDepthbuffer = X.createRenderbuffer(),
  48755. u(t.__webglDepthbuffer, e);
  48756. X.bindFramebuffer(X.FRAMEBUFFER, null)
  48757. }(e)
  48758. }
  48759. function T(e) {
  48760. return e === Ci.NearestFilter || e === Ci.NearestMipMapNearestFilter || e === Ci.NearestMipMapLinearFilter ? X.NEAREST : X.LINEAR
  48761. }
  48762. function x(e) {
  48763. var t;
  48764. if (e === Ci.RepeatWrapping)
  48765. return X.REPEAT;
  48766. if (e === Ci.ClampToEdgeWrapping)
  48767. return X.CLAMP_TO_EDGE;
  48768. if (e === Ci.MirroredRepeatWrapping)
  48769. return X.MIRRORED_REPEAT;
  48770. if (e === Ci.NearestFilter)
  48771. return X.NEAREST;
  48772. if (e === Ci.NearestMipMapNearestFilter)
  48773. return X.NEAREST_MIPMAP_NEAREST;
  48774. if (e === Ci.NearestMipMapLinearFilter)
  48775. return X.NEAREST_MIPMAP_LINEAR;
  48776. if (e === Ci.LinearFilter)
  48777. return X.LINEAR;
  48778. if (e === Ci.LinearMipMapNearestFilter)
  48779. return X.LINEAR_MIPMAP_NEAREST;
  48780. if (e === Ci.LinearMipMapLinearFilter)
  48781. return X.LINEAR_MIPMAP_LINEAR;
  48782. if (e === Ci.UnsignedByteType)
  48783. return X.UNSIGNED_BYTE;
  48784. if (e === Ci.UnsignedShort4444Type)
  48785. return X.UNSIGNED_SHORT_4_4_4_4;
  48786. if (e === Ci.UnsignedShort5551Type)
  48787. return X.UNSIGNED_SHORT_5_5_5_1;
  48788. if (e === Ci.UnsignedShort565Type)
  48789. return X.UNSIGNED_SHORT_5_6_5;
  48790. if (e === Ci.ByteType)
  48791. return X.BYTE;
  48792. if (e === Ci.ShortType)
  48793. return X.SHORT;
  48794. if (e === Ci.UnsignedShortType)
  48795. return X.UNSIGNED_SHORT;
  48796. if (e === Ci.IntType)
  48797. return X.INT;
  48798. if (e === Ci.UnsignedIntType)
  48799. return X.UNSIGNED_INT;
  48800. if (e === Ci.FloatType)
  48801. return X.FLOAT;
  48802. if (null !== (t = Ie.get("OES_texture_half_float")) && e === Ci.HalfFloatType)
  48803. return t.HALF_FLOAT_OES;
  48804. if (e === Ci.AlphaFormat)
  48805. return X.ALPHA;
  48806. if (e === Ci.RGBFormat)
  48807. return X.RGB;
  48808. if (e === Ci.RGBAFormat)
  48809. return X.RGBA;
  48810. if (e === Ci.LuminanceFormat)
  48811. return X.LUMINANCE;
  48812. if (e === Ci.LuminanceAlphaFormat)
  48813. return X.LUMINANCE_ALPHA;
  48814. if (e === Ci.AddEquation)
  48815. return X.FUNC_ADD;
  48816. if (e === Ci.SubtractEquation)
  48817. return X.FUNC_SUBTRACT;
  48818. if (e === Ci.ReverseSubtractEquation)
  48819. return X.FUNC_REVERSE_SUBTRACT;
  48820. if (e === Ci.ZeroFactor)
  48821. return X.ZERO;
  48822. if (e === Ci.OneFactor)
  48823. return X.ONE;
  48824. if (e === Ci.SrcColorFactor)
  48825. return X.SRC_COLOR;
  48826. if (e === Ci.OneMinusSrcColorFactor)
  48827. return X.ONE_MINUS_SRC_COLOR;
  48828. if (e === Ci.SrcAlphaFactor)
  48829. return X.SRC_ALPHA;
  48830. if (e === Ci.OneMinusSrcAlphaFactor)
  48831. return X.ONE_MINUS_SRC_ALPHA;
  48832. if (e === Ci.DstAlphaFactor)
  48833. return X.DST_ALPHA;
  48834. if (e === Ci.OneMinusDstAlphaFactor)
  48835. return X.ONE_MINUS_DST_ALPHA;
  48836. if (e === Ci.DstColorFactor)
  48837. return X.DST_COLOR;
  48838. if (e === Ci.OneMinusDstColorFactor)
  48839. return X.ONE_MINUS_DST_COLOR;
  48840. if (e === Ci.SrcAlphaSaturateFactor)
  48841. return X.SRC_ALPHA_SATURATE;
  48842. if (null !== (t = Ie.get("WEBGL_compressed_texture_s3tc"))) {
  48843. if (e === Ci.RGB_S3TC_DXT1_Format)
  48844. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  48845. if (e === Ci.RGBA_S3TC_DXT1_Format)
  48846. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  48847. if (e === Ci.RGBA_S3TC_DXT3_Format)
  48848. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  48849. if (e === Ci.RGBA_S3TC_DXT5_Format)
  48850. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  48851. }
  48852. if (null !== (t = Ie.get("WEBGL_compressed_texture_pvrtc"))) {
  48853. if (e === Ci.RGB_PVRTC_4BPPV1_Format)
  48854. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  48855. if (e === Ci.RGB_PVRTC_2BPPV1_Format)
  48856. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  48857. if (e === Ci.RGBA_PVRTC_4BPPV1_Format)
  48858. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  48859. if (e === Ci.RGBA_PVRTC_2BPPV1_Format)
  48860. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  48861. }
  48862. if (null !== (t = Ie.get("WEBGL_compressed_texture_etc1")) && e === Ci.RGB_ETC1_Format)
  48863. return t.COMPRESSED_RGB_ETC1_WEBGL;
  48864. if (null !== (t = Ie.get("EXT_blend_minmax"))) {
  48865. if (e === Ci.MinEquation)
  48866. return t.MIN_EXT;
  48867. if (e === Ci.MaxEquation)
  48868. return t.MAX_EXT
  48869. }
  48870. return 0
  48871. }
  48872. console.log("THREE.WebGLRenderer", Ci.REVISION);
  48873. var O = void 0 !== (e = e || {}).canvas ? e.canvas : document.createElement("canvas")
  48874. , L = void 0 !== e.context ? e.context : null
  48875. , D = void 0 !== e.alpha && e.alpha
  48876. , N = void 0 === e.depth || e.depth
  48877. , F = void 0 === e.stencil || e.stencil
  48878. , B = void 0 !== e.antialias && e.antialias
  48879. , V = void 0 === e.premultipliedAlpha || e.premultipliedAlpha
  48880. , k = void 0 !== e.preserveDrawingBuffer && e.preserveDrawingBuffer
  48881. , U = []
  48882. , H = []
  48883. , z = -1
  48884. , G = []
  48885. , W = -1
  48886. , j = new Float32Array(8)
  48887. , Y = []
  48888. , q = [];
  48889. this.domElement = O,
  48890. this.context = null,
  48891. this.autoClear = !0,
  48892. this.autoClearColor = !0,
  48893. this.autoClearDepth = !0,
  48894. this.autoClearStencil = !0,
  48895. this.sortObjects = !0,
  48896. this.gammaFactor = 2,
  48897. this.gammaInput = !1,
  48898. this.gammaOutput = !1,
  48899. this.physicallyCorrectLights = !1,
  48900. this.toneMapping = Ci.LinearToneMapping,
  48901. this.toneMappingExposure = 1,
  48902. this.toneMappingWhitePoint = 1,
  48903. this.maxMorphTargets = 8,
  48904. this.maxMorphNormals = 4,
  48905. this.autoScaleCubemaps = !0;
  48906. 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 = {
  48907. hash: "",
  48908. ambient: [0, 0, 0],
  48909. directional: [],
  48910. directionalShadowMap: [],
  48911. directionalShadowMatrix: [],
  48912. spot: [],
  48913. spotShadowMap: [],
  48914. spotShadowMatrix: [],
  48915. point: [],
  48916. pointShadowMap: [],
  48917. pointShadowMatrix: [],
  48918. hemi: [],
  48919. shadows: [],
  48920. shadowsPointLight: 0
  48921. }, ye = {
  48922. geometries: 0,
  48923. textures: 0
  48924. }, Ae = {
  48925. calls: 0,
  48926. vertices: 0,
  48927. faces: 0,
  48928. points: 0
  48929. };
  48930. this.info = {
  48931. render: Ae,
  48932. memory: ye,
  48933. programs: null
  48934. };
  48935. try {
  48936. var Ce = {
  48937. alpha: D,
  48938. depth: N,
  48939. stencil: F,
  48940. antialias: B,
  48941. premultipliedAlpha: V,
  48942. preserveDrawingBuffer: k
  48943. };
  48944. if (null === (X = L || O.getContext("webgl", Ce) || O.getContext("experimental-webgl", Ce)))
  48945. throw null !== O.getContext("webgl") ? "Error creating WebGL context with your selected attributes." : "Error creating WebGL context.";
  48946. void 0 === X.getShaderPrecisionFormat && (X.getShaderPrecisionFormat = function() {
  48947. return {
  48948. rangeMin: 1,
  48949. rangeMax: 1,
  48950. precision: 1
  48951. }
  48952. }
  48953. ),
  48954. O.addEventListener("webglcontextlost", r, !1)
  48955. } catch (e) {
  48956. console.error("THREE.WebGLRenderer: " + e)
  48957. }
  48958. var Ie = new Ci.WebGLExtensions(X);
  48959. Ie.get("OES_texture_float"),
  48960. Ie.get("OES_texture_float_linear"),
  48961. Ie.get("OES_texture_half_float"),
  48962. Ie.get("OES_texture_half_float_linear"),
  48963. Ie.get("OES_standard_derivatives"),
  48964. Ie.get("ANGLE_instanced_arrays"),
  48965. Ie.get("OES_element_index_uint") && (Ci.BufferGeometry.MaxIndex = 4294967296);
  48966. var Ee = new Ci.WebGLCapabilities(X,Ie,e)
  48967. , _e = new Ci.WebGLState(X,Ie,x)
  48968. , be = new Ci.WebGLProperties
  48969. , we = new Ci.WebGLObjects(X,be,this.info)
  48970. , Te = new Ci.WebGLPrograms(this,Ee)
  48971. , xe = new Ci.WebGLLights;
  48972. this.info.programs = Te.programs;
  48973. var Se = new Ci.WebGLBufferRenderer(X,Ie,Ae)
  48974. , Me = new Ci.WebGLIndexedBufferRenderer(X,Ie,Ae);
  48975. t(),
  48976. this.context = X,
  48977. this.capabilities = Ee,
  48978. this.extensions = Ie,
  48979. this.properties = be,
  48980. this.state = _e;
  48981. var Re = new Ci.WebGLShadowMap(this,ve,we);
  48982. this.shadowMap = Re;
  48983. var Pe, Oe = new Ci.SpritePlugin(this,Y), Le = new Ci.LensFlarePlugin(this,q);
  48984. this.getContext = function() {
  48985. return X
  48986. }
  48987. ,
  48988. this.getContextAttributes = function() {
  48989. return X.getContextAttributes()
  48990. }
  48991. ,
  48992. this.forceContextLoss = function() {
  48993. Ie.get("WEBGL_lose_context").loseContext()
  48994. }
  48995. ,
  48996. this.getMaxAnisotropy = function() {
  48997. if (void 0 !== Pe)
  48998. return Pe;
  48999. var e = Ie.get("EXT_texture_filter_anisotropic");
  49000. return Pe = null !== e ? X.getParameter(e.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 0
  49001. }
  49002. ,
  49003. this.getPrecision = function() {
  49004. return Ee.precision
  49005. }
  49006. ,
  49007. this.getPixelRatio = function() {
  49008. return he
  49009. }
  49010. ,
  49011. this.setPixelRatio = function(e) {
  49012. void 0 !== e && (he = e,
  49013. this.setSize(pe.z, pe.w, !1))
  49014. }
  49015. ,
  49016. this.getSize = function() {
  49017. return {
  49018. width: le,
  49019. height: ce
  49020. }
  49021. }
  49022. ,
  49023. this.setSize = function(e, t, i, n) {
  49024. null != n && (he = n),
  49025. le = e,
  49026. ce = t,
  49027. O.width = e * he,
  49028. O.height = t * he,
  49029. !1 !== i && (O.style.width = e + "px",
  49030. O.style.height = t + "px"),
  49031. this.setViewport(0, 0, e, t)
  49032. }
  49033. ,
  49034. this.setViewport = function(e, t, i, n) {
  49035. _e.viewport(pe.set(e, t, i, n))
  49036. }
  49037. ,
  49038. this.setScissor = function(e, t, i, n) {
  49039. _e.scissor(ue.set(e, t, i, n))
  49040. }
  49041. ,
  49042. this.setScissorTest = function(e) {
  49043. _e.setScissorTest(de = e)
  49044. }
  49045. ,
  49046. this.getClearColor = function() {
  49047. return ae
  49048. }
  49049. ,
  49050. this.setClearColor = function(e, t) {
  49051. ae.set(e),
  49052. se = void 0 !== t ? t : 1,
  49053. i(ae.r, ae.g, ae.b, se)
  49054. }
  49055. ,
  49056. this.getClearAlpha = function() {
  49057. return se
  49058. }
  49059. ,
  49060. this.setClearAlpha = function(e) {
  49061. se = e,
  49062. i(ae.r, ae.g, ae.b, se)
  49063. }
  49064. ,
  49065. this.clear = function(e, t, i) {
  49066. var n = 0;
  49067. void 0 !== e && !e || (n |= X.COLOR_BUFFER_BIT),
  49068. void 0 !== t && !t || (n |= X.DEPTH_BUFFER_BIT),
  49069. void 0 !== i && !i || (n |= X.STENCIL_BUFFER_BIT),
  49070. X.clear(n)
  49071. }
  49072. ,
  49073. this.clearColor = function() {
  49074. this.clear(!0, !1, !1)
  49075. }
  49076. ,
  49077. this.clearDepth = function() {
  49078. this.clear(!1, !0, !1)
  49079. }
  49080. ,
  49081. this.clearStencil = function() {
  49082. this.clear(!1, !1, !0)
  49083. }
  49084. ,
  49085. this.clearTarget = function(e, t, i, n) {
  49086. this.setRenderTarget(e),
  49087. this.clear(t, i, n)
  49088. }
  49089. ,
  49090. this.resetGLState = n,
  49091. this.dispose = function() {
  49092. O.removeEventListener("webglcontextlost", r, !1)
  49093. }
  49094. ,
  49095. this.renderBufferImmediate = function(e, t, i) {
  49096. _e.initAttributes();
  49097. var n = be.get(e);
  49098. e.hasPositions && !n.position && (n.position = X.createBuffer()),
  49099. e.hasNormals && !n.normal && (n.normal = X.createBuffer()),
  49100. e.hasUvs && !n.uv && (n.uv = X.createBuffer()),
  49101. e.hasColors && !n.color && (n.color = X.createBuffer());
  49102. var r = t.getAttributes();
  49103. if (e.hasPositions && (X.bindBuffer(X.ARRAY_BUFFER, n.position),
  49104. X.bufferData(X.ARRAY_BUFFER, e.positionArray, X.DYNAMIC_DRAW),
  49105. _e.enableAttribute(r.position),
  49106. X.vertexAttribPointer(r.position, 3, X.FLOAT, !1, 0, 0)),
  49107. e.hasNormals) {
  49108. if (X.bindBuffer(X.ARRAY_BUFFER, n.normal),
  49109. "MeshPhongMaterial" !== i.type && "MeshStandardMaterial" !== i.type && i.shading === Ci.FlatShading)
  49110. for (var o = 0, a = 3 * e.count; o < a; o += 9) {
  49111. var s = e.normalArray
  49112. , l = (s[o + 0] + s[o + 3] + s[o + 6]) / 3
  49113. , c = (s[o + 1] + s[o + 4] + s[o + 7]) / 3
  49114. , h = (s[o + 2] + s[o + 5] + s[o + 8]) / 3;
  49115. s[o + 0] = l,
  49116. s[o + 1] = c,
  49117. s[o + 2] = h,
  49118. s[o + 3] = l,
  49119. s[o + 4] = c,
  49120. s[o + 5] = h,
  49121. s[o + 6] = l,
  49122. s[o + 7] = c,
  49123. s[o + 8] = h
  49124. }
  49125. X.bufferData(X.ARRAY_BUFFER, e.normalArray, X.DYNAMIC_DRAW),
  49126. _e.enableAttribute(r.normal),
  49127. X.vertexAttribPointer(r.normal, 3, X.FLOAT, !1, 0, 0)
  49128. }
  49129. e.hasUvs && i.map && (X.bindBuffer(X.ARRAY_BUFFER, n.uv),
  49130. X.bufferData(X.ARRAY_BUFFER, e.uvArray, X.DYNAMIC_DRAW),
  49131. _e.enableAttribute(r.uv),
  49132. X.vertexAttribPointer(r.uv, 2, X.FLOAT, !1, 0, 0)),
  49133. e.hasColors && i.vertexColors !== Ci.NoColors && (X.bindBuffer(X.ARRAY_BUFFER, n.color),
  49134. X.bufferData(X.ARRAY_BUFFER, e.colorArray, X.DYNAMIC_DRAW),
  49135. _e.enableAttribute(r.color),
  49136. X.vertexAttribPointer(r.color, 3, X.FLOAT, !1, 0, 0)),
  49137. _e.disableUnusedAttributes(),
  49138. X.drawArrays(X.TRIANGLES, 0, e.count),
  49139. e.count = 0
  49140. }
  49141. ,
  49142. this.renderBufferDirect = function(e, t, i, n, r, o) {
  49143. R(n);
  49144. var a = P(e, t, n, r)
  49145. , s = !1
  49146. , l = i.id + "_" + a.id + "_" + n.wireframe;
  49147. l !== ee && (ee = l,
  49148. s = !0);
  49149. var c = r.morphTargetInfluences;
  49150. if (void 0 !== c) {
  49151. for (var h = [], u = 0, d = c.length; u < d; u++) {
  49152. var p = c[u];
  49153. h.push([p, u])
  49154. }
  49155. h.sort(M),
  49156. 8 < h.length && (h.length = 8);
  49157. var f = i.morphAttributes;
  49158. for (u = 0,
  49159. d = h.length; u < d; u++) {
  49160. p = h[u];
  49161. if (j[u] = p[0],
  49162. 0 !== p[0]) {
  49163. var g = p[1];
  49164. !0 === n.morphTargets && f.position && i.addAttribute("morphTarget" + u, f.position[g]),
  49165. !0 === n.morphNormals && f.normal && i.addAttribute("morphNormal" + u, f.normal[g])
  49166. } else
  49167. !0 === n.morphTargets && i.removeAttribute("morphTarget" + u),
  49168. !0 === n.morphNormals && i.removeAttribute("morphNormal" + u)
  49169. }
  49170. var m = a.getUniforms();
  49171. null !== m.morphTargetInfluences && X.uniform1fv(m.morphTargetInfluences, j),
  49172. s = !0
  49173. }
  49174. g = i.index;
  49175. var v, y = i.attributes.position;
  49176. !0 === n.wireframe && (g = we.getWireframeAttribute(i)),
  49177. null !== g ? (v = Me).setIndex(g) : v = Se,
  49178. s && (function(e, t, i, n) {
  49179. var r;
  49180. if (i instanceof Ci.InstancedBufferGeometry && null === (r = Ie.get("ANGLE_instanced_arrays")))
  49181. console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
  49182. else {
  49183. void 0 === n && (n = 0),
  49184. _e.initAttributes();
  49185. var o = i.attributes
  49186. , a = t.getAttributes()
  49187. , s = e.defaultAttributeValues;
  49188. for (var l in a) {
  49189. var c = a[l];
  49190. if (0 <= c) {
  49191. var h = o[l];
  49192. if (void 0 !== h) {
  49193. var u = h.itemSize
  49194. , d = we.getAttributeBuffer(h);
  49195. if (h instanceof Ci.InterleavedBufferAttribute) {
  49196. var p = h.data
  49197. , f = p.stride
  49198. , g = h.offset;
  49199. p instanceof Ci.InstancedInterleavedBuffer ? (_e.enableAttributeAndDivisor(c, p.meshPerAttribute, r),
  49200. void 0 === i.maxInstancedCount && (i.maxInstancedCount = p.meshPerAttribute * p.count)) : _e.enableAttribute(c),
  49201. X.bindBuffer(X.ARRAY_BUFFER, d),
  49202. X.vertexAttribPointer(c, u, X.FLOAT, !1, f * p.array.BYTES_PER_ELEMENT, (n * f + g) * p.array.BYTES_PER_ELEMENT)
  49203. } else
  49204. h instanceof Ci.InstancedBufferAttribute ? (_e.enableAttributeAndDivisor(c, h.meshPerAttribute, r),
  49205. void 0 === i.maxInstancedCount && (i.maxInstancedCount = h.meshPerAttribute * h.count)) : _e.enableAttribute(c),
  49206. X.bindBuffer(X.ARRAY_BUFFER, d),
  49207. X.vertexAttribPointer(c, u, X.FLOAT, !1, 0, n * u * 4)
  49208. } else if (void 0 !== s) {
  49209. var m = s[l];
  49210. if (void 0 !== m)
  49211. switch (m.length) {
  49212. case 2:
  49213. X.vertexAttrib2fv(c, m);
  49214. break;
  49215. case 3:
  49216. X.vertexAttrib3fv(c, m);
  49217. break;
  49218. case 4:
  49219. X.vertexAttrib4fv(c, m);
  49220. break;
  49221. default:
  49222. X.vertexAttrib1fv(c, m)
  49223. }
  49224. }
  49225. }
  49226. }
  49227. _e.disableUnusedAttributes()
  49228. }
  49229. }(n, a, i),
  49230. null !== g && X.bindBuffer(X.ELEMENT_ARRAY_BUFFER, we.getAttributeBuffer(g)));
  49231. var A = 1 / 0;
  49232. null !== g ? A = g.count : void 0 !== y && (A = y.count);
  49233. var C = i.drawRange.start
  49234. , I = i.drawRange.count
  49235. , E = null !== o ? o.start : 0
  49236. , _ = null !== o ? o.count : 1 / 0
  49237. , b = Math.max(0, C, E)
  49238. , w = Math.min(0 + A, C + I, E + _) - 1
  49239. , T = Math.max(0, w - b + 1);
  49240. if (r instanceof Ci.Mesh)
  49241. if (!0 === n.wireframe)
  49242. _e.setLineWidth(n.wireframeLinewidth * S()),
  49243. v.setMode(X.LINES);
  49244. else
  49245. switch (r.drawMode) {
  49246. case Ci.TrianglesDrawMode:
  49247. v.setMode(X.TRIANGLES);
  49248. break;
  49249. case Ci.TriangleStripDrawMode:
  49250. v.setMode(X.TRIANGLE_STRIP);
  49251. break;
  49252. case Ci.TriangleFanDrawMode:
  49253. v.setMode(X.TRIANGLE_FAN)
  49254. }
  49255. else if (r instanceof Ci.Line) {
  49256. var x = n.linewidth;
  49257. void 0 === x && (x = 1),
  49258. _e.setLineWidth(x * S()),
  49259. r instanceof Ci.LineSegments ? v.setMode(X.LINES) : v.setMode(X.LINE_STRIP)
  49260. } else
  49261. r instanceof Ci.Points && v.setMode(X.POINTS);
  49262. i instanceof Ci.InstancedBufferGeometry ? 0 < i.maxInstancedCount && v.renderInstances(i, b, T) : v.render(b, T)
  49263. }
  49264. ,
  49265. this.render = function(e, t, i, n) {
  49266. if (t instanceof Ci.Camera != 0) {
  49267. var r = e.fog;
  49268. if (ee = "",
  49269. $ = -1,
  49270. !(te = null) === e.autoUpdate && e.updateMatrixWorld(),
  49271. null === t.parent && t.updateMatrixWorld(),
  49272. t.matrixWorldInverse.getInverse(t.matrixWorld),
  49273. ge.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse),
  49274. fe.setFromMatrix(ge),
  49275. U.length = 0,
  49276. W = z = -1,
  49277. Y.length = 0,
  49278. q.length = 0,
  49279. function e(t, i) {
  49280. if (!1 !== t.visible) {
  49281. if (t.layers.test(i.layers))
  49282. if (t instanceof Ci.Light)
  49283. U.push(t);
  49284. else if (t instanceof Ci.Sprite)
  49285. !1 !== t.frustumCulled && !0 !== fe.intersectsObject(t) || Y.push(t);
  49286. else if (t instanceof Ci.LensFlare)
  49287. q.push(t);
  49288. else if (t instanceof Ci.ImmediateRenderObject)
  49289. !0 === Z.sortObjects && (me.setFromMatrixPosition(t.matrixWorld),
  49290. me.applyProjection(ge)),
  49291. d(t, null, t.material, me.z, null);
  49292. else if ((t instanceof Ci.Mesh || t instanceof Ci.Line || t instanceof Ci.Points) && (t instanceof Ci.SkinnedMesh && t.skeleton.update(),
  49293. !1 === t.frustumCulled || !0 === fe.intersectsObject(t))) {
  49294. var n = t.material;
  49295. if (!0 === n.visible) {
  49296. !0 === Z.sortObjects && (me.setFromMatrixPosition(t.matrixWorld),
  49297. me.applyProjection(ge));
  49298. var r = we.update(t);
  49299. if (n instanceof Ci.MultiMaterial)
  49300. for (var o = r.groups, a = n.materials, s = 0, l = o.length; s < l; s++) {
  49301. var c = o[s]
  49302. , h = a[c.materialIndex];
  49303. !0 === h.visible && d(t, r, h, me.z, c)
  49304. }
  49305. else
  49306. d(t, r, n, me.z, null)
  49307. }
  49308. }
  49309. var u = t.children;
  49310. for (s = 0,
  49311. l = u.length; s < l; s++)
  49312. e(u[s], i)
  49313. }
  49314. }(e, t),
  49315. H.length = z + 1,
  49316. G.length = W + 1,
  49317. !0 === Z.sortObjects && (H.sort(s),
  49318. G.sort(l)),
  49319. function(e, t) {
  49320. 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;
  49321. for (i = ve.shadowsPointLight = 0,
  49322. n = e.length; i < n; i++)
  49323. if (o = (r = e[i]).color,
  49324. a = r.intensity,
  49325. s = r.distance,
  49326. r instanceof Ci.AmbientLight)
  49327. l += o.r * a,
  49328. c += o.g * a,
  49329. h += o.b * a;
  49330. else if (r instanceof Ci.DirectionalLight) {
  49331. (v = xe.get(r)).color.copy(r.color).multiplyScalar(r.intensity),
  49332. v.direction.setFromMatrixPosition(r.matrixWorld),
  49333. me.setFromMatrixPosition(r.target.matrixWorld),
  49334. v.direction.sub(me),
  49335. v.direction.transformDirection(u),
  49336. v.shadow = r.castShadow,
  49337. r.castShadow && (v.shadowBias = r.shadow.bias,
  49338. v.shadowRadius = r.shadow.radius,
  49339. v.shadowMapSize = r.shadow.mapSize,
  49340. ve.shadows[m++] = r),
  49341. ve.directionalShadowMap[d] = r.shadow.map,
  49342. ve.directionalShadowMatrix[d] = r.shadow.matrix,
  49343. ve.directional[d++] = v
  49344. } else if (r instanceof Ci.SpotLight) {
  49345. (v = xe.get(r)).position.setFromMatrixPosition(r.matrixWorld),
  49346. v.position.applyMatrix4(u),
  49347. v.color.copy(o).multiplyScalar(a),
  49348. v.distance = s,
  49349. v.direction.setFromMatrixPosition(r.matrixWorld),
  49350. me.setFromMatrixPosition(r.target.matrixWorld),
  49351. v.direction.sub(me),
  49352. v.direction.transformDirection(u),
  49353. v.coneCos = Math.cos(r.angle),
  49354. v.penumbraCos = Math.cos(r.angle * (1 - r.penumbra)),
  49355. v.decay = 0 === r.distance ? 0 : r.decay,
  49356. v.shadow = r.castShadow,
  49357. r.castShadow && (v.shadowBias = r.shadow.bias,
  49358. v.shadowRadius = r.shadow.radius,
  49359. v.shadowMapSize = r.shadow.mapSize,
  49360. ve.shadows[m++] = r),
  49361. ve.spotShadowMap[f] = r.shadow.map,
  49362. ve.spotShadowMatrix[f] = r.shadow.matrix,
  49363. ve.spot[f++] = v
  49364. } else if (r instanceof Ci.PointLight) {
  49365. (v = xe.get(r)).position.setFromMatrixPosition(r.matrixWorld),
  49366. v.position.applyMatrix4(u),
  49367. v.color.copy(r.color).multiplyScalar(r.intensity),
  49368. v.distance = r.distance,
  49369. v.decay = 0 === r.distance ? 0 : r.decay,
  49370. v.shadow = r.castShadow,
  49371. r.castShadow && (v.shadowBias = r.shadow.bias,
  49372. v.shadowRadius = r.shadow.radius,
  49373. v.shadowMapSize = r.shadow.mapSize,
  49374. ve.shadows[m++] = r),
  49375. ve.pointShadowMap[p] = r.shadow.map,
  49376. void 0 === ve.pointShadowMatrix[p] && (ve.pointShadowMatrix[p] = new Ci.Matrix4),
  49377. me.setFromMatrixPosition(r.matrixWorld).negate(),
  49378. ve.pointShadowMatrix[p].identity().setPosition(me),
  49379. ve.point[p++] = v
  49380. } else if (r instanceof Ci.HemisphereLight) {
  49381. var v;
  49382. (v = xe.get(r)).direction.setFromMatrixPosition(r.matrixWorld),
  49383. v.direction.transformDirection(u),
  49384. v.direction.normalize(),
  49385. v.skyColor.copy(r.color).multiplyScalar(a),
  49386. v.groundColor.copy(r.groundColor).multiplyScalar(a),
  49387. ve.hemi[g++] = v
  49388. }
  49389. ve.ambient[0] = l,
  49390. ve.ambient[1] = c,
  49391. ve.ambient[2] = h,
  49392. ve.directional.length = d,
  49393. ve.spot.length = f,
  49394. ve.point.length = p,
  49395. ve.hemi.length = g,
  49396. ve.shadows.length = m,
  49397. ve.hash = d + "," + p + "," + f + "," + g + "," + m
  49398. }(U, t),
  49399. Re.render(e, t),
  49400. Ae.calls = 0,
  49401. Ae.vertices = 0,
  49402. Ae.faces = 0,
  49403. void (Ae.points = 0) === i && (i = null),
  49404. this.setRenderTarget(i),
  49405. (this.autoClear || n) && this.clear(this.autoClearColor, this.autoClearDepth, this.autoClearStencil),
  49406. e.overrideMaterial) {
  49407. var o = e.overrideMaterial;
  49408. c(H, t, r, o),
  49409. c(G, t, r, o)
  49410. } else
  49411. _e.setBlending(Ci.NoBlending),
  49412. c(H, t, r),
  49413. c(G, t, r);
  49414. if (Oe.render(e, t),
  49415. Le.render(e, t, re),
  49416. i) {
  49417. var a = i.texture;
  49418. a.generateMipmaps && E(i) && a.minFilter !== Ci.NearestFilter && a.minFilter !== Ci.LinearFilter && function(e) {
  49419. var t = e instanceof Ci.WebGLRenderTargetCube ? X.TEXTURE_CUBE_MAP : X.TEXTURE_2D
  49420. , i = be.get(e.texture).__webglTexture;
  49421. _e.bindTexture(t, i),
  49422. X.generateMipmap(t),
  49423. _e.bindTexture(t, null)
  49424. }(i)
  49425. }
  49426. _e.setDepthTest(!0),
  49427. _e.setDepthWrite(!0),
  49428. _e.setColorWrite(!0)
  49429. } else
  49430. console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")
  49431. }
  49432. ,
  49433. this.setFaceCulling = function(e, t) {
  49434. e === Ci.CullFaceNone ? _e.disable(X.CULL_FACE) : (t === Ci.FrontFaceDirectionCW ? X.frontFace(X.CW) : X.frontFace(X.CCW),
  49435. e === Ci.CullFaceBack ? X.cullFace(X.BACK) : e === Ci.CullFaceFront ? X.cullFace(X.FRONT) : X.cullFace(X.FRONT_AND_BACK),
  49436. _e.enable(X.CULL_FACE))
  49437. }
  49438. ,
  49439. this.setTexture = function(e, t) {
  49440. var i = be.get(e);
  49441. if (0 < e.version && i.__version !== e.version) {
  49442. var n = e.image;
  49443. 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)
  49444. }
  49445. _e.activeTexture(X.TEXTURE0 + t),
  49446. _e.bindTexture(X.TEXTURE_2D, i.__webglTexture)
  49447. }
  49448. ,
  49449. this.getCurrentRenderTarget = function() {
  49450. return Q
  49451. }
  49452. ,
  49453. this.setRenderTarget = function(e) {
  49454. (Q = e) && void 0 === be.get(e).__webglFramebuffer && w(e);
  49455. var t, i = e instanceof Ci.WebGLRenderTargetCube;
  49456. if (e) {
  49457. var n = be.get(e);
  49458. t = i ? n.__webglFramebuffer[e.activeCubeFace] : n.__webglFramebuffer,
  49459. ie.copy(e.scissor),
  49460. ne = e.scissorTest,
  49461. re.copy(e.viewport)
  49462. } else
  49463. t = null,
  49464. ie.copy(ue).multiplyScalar(he),
  49465. ne = de,
  49466. re.copy(pe).multiplyScalar(he);
  49467. if (J !== t && (X.bindFramebuffer(X.FRAMEBUFFER, t),
  49468. J = t),
  49469. _e.scissor(ie),
  49470. _e.setScissorTest(ne),
  49471. _e.viewport(re),
  49472. i) {
  49473. var r = be.get(e.texture);
  49474. X.framebufferTexture2D(X.FRAMEBUFFER, X.COLOR_ATTACHMENT0, X.TEXTURE_CUBE_MAP_POSITIVE_X + e.activeCubeFace, r.__webglTexture, e.activeMipMapLevel)
  49475. }
  49476. }
  49477. ,
  49478. this.readRenderTargetPixels = function(e, t, i, n, r, o) {
  49479. if (e instanceof Ci.WebGLRenderTarget != 0) {
  49480. var a = be.get(e).__webglFramebuffer;
  49481. if (a) {
  49482. var s = !1;
  49483. a !== J && (X.bindFramebuffer(X.FRAMEBUFFER, a),
  49484. s = !0);
  49485. try {
  49486. var l = e.texture;
  49487. if (l.format !== Ci.RGBAFormat && x(l.format) !== X.getParameter(X.IMPLEMENTATION_COLOR_READ_FORMAT))
  49488. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");
  49489. 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")))
  49490. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");
  49491. 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.")
  49492. } finally {
  49493. s && X.bindFramebuffer(X.FRAMEBUFFER, J)
  49494. }
  49495. }
  49496. } else
  49497. console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")
  49498. }
  49499. }
  49500. ,
  49501. Ci.WebGLRenderTarget = function(e, t, i) {
  49502. this.uuid = Ci.Math.generateUUID(),
  49503. this.width = e,
  49504. this.height = t,
  49505. this.scissor = new Ci.Vector4(0,0,e,t),
  49506. this.scissorTest = !1,
  49507. this.viewport = new Ci.Vector4(0,0,e,t),
  49508. void 0 === (i = i || {}).minFilter && (i.minFilter = Ci.LinearFilter),
  49509. this.texture = new Ci.Texture(void 0,void 0,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy),
  49510. this.depthBuffer = void 0 === i.depthBuffer || i.depthBuffer,
  49511. this.stencilBuffer = void 0 === i.stencilBuffer || i.stencilBuffer
  49512. }
  49513. ,
  49514. Ci.WebGLRenderTarget.prototype = {
  49515. constructor: Ci.WebGLRenderTarget,
  49516. setSize: function(e, t) {
  49517. this.width === e && this.height === t || (this.width = e,
  49518. this.height = t,
  49519. this.dispose()),
  49520. this.viewport.set(0, 0, e, t),
  49521. this.scissor.set(0, 0, e, t)
  49522. },
  49523. clone: function() {
  49524. return (new this.constructor).copy(this)
  49525. },
  49526. copy: function(e) {
  49527. return this.width = e.width,
  49528. this.height = e.height,
  49529. this.viewport.copy(e.viewport),
  49530. this.texture = e.texture.clone(),
  49531. this.depthBuffer = e.depthBuffer,
  49532. this.stencilBuffer = e.stencilBuffer,
  49533. this
  49534. },
  49535. dispose: function() {
  49536. this.dispatchEvent({
  49537. type: "dispose"
  49538. })
  49539. }
  49540. },
  49541. Ci.EventDispatcher.prototype.apply(Ci.WebGLRenderTarget.prototype),
  49542. Ci.WebGLRenderTargetCube = function(e, t, i) {
  49543. Ci.WebGLRenderTarget.call(this, e, t, i),
  49544. this.activeCubeFace = 0,
  49545. this.activeMipMapLevel = 0
  49546. }
  49547. ,
  49548. Ci.WebGLRenderTargetCube.prototype = Object.create(Ci.WebGLRenderTarget.prototype),
  49549. Ci.WebGLRenderTargetCube.prototype.constructor = Ci.WebGLRenderTargetCube,
  49550. Ci.WebGLBufferRenderer = function(r, o, a) {
  49551. var s;
  49552. this.setMode = function(e) {
  49553. s = e
  49554. }
  49555. ,
  49556. this.render = function(e, t) {
  49557. r.drawArrays(s, e, t),
  49558. a.calls++,
  49559. a.vertices += t,
  49560. s === r.TRIANGLES && (a.faces += t / 3)
  49561. }
  49562. ,
  49563. this.renderInstances = function(e) {
  49564. var t = o.get("ANGLE_instanced_arrays");
  49565. if (null !== t) {
  49566. var i = e.attributes.position
  49567. , n = 0;
  49568. n = i instanceof Ci.InterleavedBufferAttribute ? i.data.count : i.count,
  49569. t.drawArraysInstancedANGLE(s, 0, n, e.maxInstancedCount),
  49570. a.calls++,
  49571. a.vertices += n * e.maxInstancedCount,
  49572. s === r.TRIANGLES && (a.faces += e.maxInstancedCount * n / 3)
  49573. } else
  49574. console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.")
  49575. }
  49576. }
  49577. ,
  49578. Ci.WebGLIndexedBufferRenderer = function(r, o, a) {
  49579. var s, l, c;
  49580. this.setMode = function(e) {
  49581. s = e
  49582. }
  49583. ,
  49584. this.setIndex = function(e) {
  49585. c = e.array instanceof Uint32Array && o.get("OES_element_index_uint") ? (l = r.UNSIGNED_INT,
  49586. 4) : (l = r.UNSIGNED_SHORT,
  49587. 2)
  49588. }
  49589. ,
  49590. this.render = function(e, t) {
  49591. r.drawElements(s, t, l, e * c),
  49592. a.calls++,
  49593. a.vertices += t,
  49594. s === r.TRIANGLES && (a.faces += t / 3)
  49595. }
  49596. ,
  49597. this.renderInstances = function(e, t, i) {
  49598. var n = o.get("ANGLE_instanced_arrays");
  49599. 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),
  49600. a.calls++,
  49601. a.vertices += i * e.maxInstancedCount,
  49602. void (s === r.TRIANGLES && (a.faces += e.maxInstancedCount * i / 3)))
  49603. }
  49604. }
  49605. ,
  49606. Ci.WebGLExtensions = function(i) {
  49607. var n = {};
  49608. this.get = function(e) {
  49609. if (void 0 !== n[e])
  49610. return n[e];
  49611. var t;
  49612. switch (e) {
  49613. case "EXT_texture_filter_anisotropic":
  49614. t = i.getExtension("EXT_texture_filter_anisotropic") || i.getExtension("MOZ_EXT_texture_filter_anisotropic") || i.getExtension("WEBKIT_EXT_texture_filter_anisotropic");
  49615. break;
  49616. case "WEBGL_compressed_texture_s3tc":
  49617. t = i.getExtension("WEBGL_compressed_texture_s3tc") || i.getExtension("MOZ_WEBGL_compressed_texture_s3tc") || i.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");
  49618. break;
  49619. case "WEBGL_compressed_texture_pvrtc":
  49620. t = i.getExtension("WEBGL_compressed_texture_pvrtc") || i.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");
  49621. break;
  49622. case "WEBGL_compressed_texture_etc1":
  49623. t = i.getExtension("WEBGL_compressed_texture_etc1");
  49624. break;
  49625. default:
  49626. t = i.getExtension(e)
  49627. }
  49628. return null === t && console.warn("THREE.WebGLRenderer: " + e + " extension not supported."),
  49629. n[e] = t
  49630. }
  49631. }
  49632. ,
  49633. Ci.WebGLCapabilities = function(t, e, i) {
  49634. function n(e) {
  49635. if ("highp" === e) {
  49636. if (0 < t.getShaderPrecisionFormat(t.VERTEX_SHADER, t.HIGH_FLOAT).precision && 0 < t.getShaderPrecisionFormat(t.FRAGMENT_SHADER, t.HIGH_FLOAT).precision)
  49637. return "highp";
  49638. e = "mediump"
  49639. }
  49640. 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"
  49641. }
  49642. this.getMaxPrecision = n,
  49643. this.precision = void 0 !== i.precision ? i.precision : "highp",
  49644. this.logarithmicDepthBuffer = void 0 !== i.logarithmicDepthBuffer && i.logarithmicDepthBuffer,
  49645. this.maxTextures = t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),
  49646. this.maxVertexTextures = t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),
  49647. this.maxTextureSize = t.getParameter(t.MAX_TEXTURE_SIZE),
  49648. this.maxCubemapSize = t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),
  49649. this.maxAttributes = t.getParameter(t.MAX_VERTEX_ATTRIBS),
  49650. this.maxVertexUniforms = t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),
  49651. this.maxVaryings = t.getParameter(t.MAX_VARYING_VECTORS),
  49652. this.maxFragmentUniforms = t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),
  49653. this.vertexTextures = 0 < this.maxVertexTextures,
  49654. this.floatFragmentTextures = !!e.get("OES_texture_float"),
  49655. this.floatVertexTextures = this.vertexTextures && this.floatFragmentTextures;
  49656. var r = n(this.precision);
  49657. r !== this.precision && (console.warn("THREE.WebGLRenderer:", this.precision, "not supported, using", r, "instead."),
  49658. this.precision = r),
  49659. this.logarithmicDepthBuffer && (this.logarithmicDepthBuffer = !!e.get("EXT_frag_depth"))
  49660. }
  49661. ,
  49662. Ci.WebGLGeometries = function(i, o, a) {
  49663. function s(e) {
  49664. var t = e.target
  49665. , i = c[t.id];
  49666. null !== i.index && l(i.index),
  49667. function(e) {
  49668. for (var t in e)
  49669. l(e[t])
  49670. }(i.attributes),
  49671. t.removeEventListener("dispose", s),
  49672. delete c[t.id];
  49673. var n = o.get(t);
  49674. n.wireframe && l(n.wireframe),
  49675. o.delete(t);
  49676. var r = o.get(i);
  49677. r.wireframe && l(r.wireframe),
  49678. o.delete(i),
  49679. a.memory.geometries--
  49680. }
  49681. function l(e) {
  49682. var t = function(e) {
  49683. return e instanceof Ci.InterleavedBufferAttribute ? o.get(e.data).__webglBuffer : o.get(e).__webglBuffer
  49684. }(e);
  49685. void 0 !== t && (i.deleteBuffer(t),
  49686. function(e) {
  49687. e instanceof Ci.InterleavedBufferAttribute ? o.delete(e.data) : o.delete(e)
  49688. }(e))
  49689. }
  49690. var c = {};
  49691. this.get = function(e) {
  49692. var t, i = e.geometry;
  49693. return void 0 !== c[i.id] ? c[i.id] : (i.addEventListener("dispose", s),
  49694. i instanceof Ci.BufferGeometry ? t = i : i instanceof Ci.Geometry && (void 0 === i._bufferGeometry && (i._bufferGeometry = (new Ci.BufferGeometry).setFromObject(e)),
  49695. t = i._bufferGeometry),
  49696. c[i.id] = t,
  49697. a.memory.geometries++,
  49698. t)
  49699. }
  49700. }
  49701. ,
  49702. Ci.WebGLLights = function() {
  49703. var i = {};
  49704. this.get = function(e) {
  49705. if (void 0 !== i[e.id])
  49706. return i[e.id];
  49707. var t;
  49708. switch (e.type) {
  49709. case "DirectionalLight":
  49710. t = {
  49711. direction: new Ci.Vector3,
  49712. color: new Ci.Color,
  49713. shadow: !1,
  49714. shadowBias: 0,
  49715. shadowRadius: 1,
  49716. shadowMapSize: new Ci.Vector2
  49717. };
  49718. break;
  49719. case "SpotLight":
  49720. t = {
  49721. position: new Ci.Vector3,
  49722. direction: new Ci.Vector3,
  49723. color: new Ci.Color,
  49724. distance: 0,
  49725. coneCos: 0,
  49726. penumbraCos: 0,
  49727. decay: 0,
  49728. shadow: !1,
  49729. shadowBias: 0,
  49730. shadowRadius: 1,
  49731. shadowMapSize: new Ci.Vector2
  49732. };
  49733. break;
  49734. case "PointLight":
  49735. t = {
  49736. position: new Ci.Vector3,
  49737. color: new Ci.Color,
  49738. distance: 0,
  49739. decay: 0,
  49740. shadow: !1,
  49741. shadowBias: 0,
  49742. shadowRadius: 1,
  49743. shadowMapSize: new Ci.Vector2
  49744. };
  49745. break;
  49746. case "HemisphereLight":
  49747. t = {
  49748. direction: new Ci.Vector3,
  49749. skyColor: new Ci.Color,
  49750. groundColor: new Ci.Color
  49751. }
  49752. }
  49753. return i[e.id] = t
  49754. }
  49755. }
  49756. ,
  49757. Ci.WebGLObjects = function(g, m, e) {
  49758. function v(e, t) {
  49759. var i = e instanceof Ci.InterleavedBufferAttribute ? e.data : e
  49760. , n = m.get(i);
  49761. void 0 === n.__webglBuffer ? function(e, t, i) {
  49762. e.__webglBuffer = g.createBuffer(),
  49763. g.bindBuffer(i, e.__webglBuffer);
  49764. var n = t.dynamic ? g.DYNAMIC_DRAW : g.STATIC_DRAW;
  49765. g.bufferData(i, t.array, n),
  49766. e.version = t.version
  49767. }(n, i, t) : n.version !== i.version && function(e, t, i) {
  49768. g.bindBuffer(i, e.__webglBuffer),
  49769. !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)),
  49770. t.updateRange.count = 0),
  49771. e.version = t.version
  49772. }(n, i, t)
  49773. }
  49774. function y(e, t, i) {
  49775. if (i < t) {
  49776. var n = t;
  49777. t = i,
  49778. i = n
  49779. }
  49780. var r = e[t];
  49781. return void 0 === r ? (e[t] = [i],
  49782. !0) : -1 === r.indexOf(i) && (r.push(i),
  49783. !0)
  49784. }
  49785. var c = new Ci.WebGLGeometries(g,m,e);
  49786. this.getAttributeBuffer = function(e) {
  49787. return e instanceof Ci.InterleavedBufferAttribute ? m.get(e.data).__webglBuffer : m.get(e).__webglBuffer
  49788. }
  49789. ,
  49790. this.getWireframeAttribute = function(e) {
  49791. var t = m.get(e);
  49792. if (void 0 !== t.wireframe)
  49793. return t.wireframe;
  49794. var i, n = [], r = e.index, o = e.attributes, a = o.position;
  49795. if (null !== r)
  49796. for (var s = {}, l = 0, c = (i = r.array).length; l < c; l += 3) {
  49797. var h = i[l + 0]
  49798. , u = i[l + 1]
  49799. , d = i[l + 2];
  49800. y(s, h, u) && n.push(h, u),
  49801. y(s, u, d) && n.push(u, d),
  49802. y(s, d, h) && n.push(d, h)
  49803. }
  49804. else
  49805. for (l = 0,
  49806. c = (i = o.position.array).length / 3 - 1; l < c; l += 3) {
  49807. h = l + 0,
  49808. u = l + 1,
  49809. d = l + 2;
  49810. n.push(h, u, u, d, d, h)
  49811. }
  49812. var p = 65535 < a.count ? Uint32Array : Uint16Array
  49813. , f = new Ci.BufferAttribute(new p(n),1);
  49814. return v(f, g.ELEMENT_ARRAY_BUFFER),
  49815. t.wireframe = f
  49816. }
  49817. ,
  49818. this.update = function(e) {
  49819. var t = c.get(e);
  49820. e.geometry instanceof Ci.Geometry && t.updateFromObject(e);
  49821. var i = t.index
  49822. , n = t.attributes;
  49823. for (var r in null !== i && v(i, g.ELEMENT_ARRAY_BUFFER),
  49824. n)
  49825. v(n[r], g.ARRAY_BUFFER);
  49826. var o = t.morphAttributes;
  49827. for (var r in o)
  49828. for (var a = o[r], s = 0, l = a.length; s < l; s++)
  49829. v(a[s], g.ARRAY_BUFFER);
  49830. return t
  49831. }
  49832. }
  49833. ,
  49834. Ci.WebGLProgram = (Qt = 0,
  49835. Jt = /^([\w\d_]+)\.([\w\d_]+)$/,
  49836. $t = /^([\w\d_]+)\[(\d+)\]\.([\w\d_]+)$/,
  49837. ei = /^([\w\d_]+)\[0\]$/,
  49838. function(e, t, i, n) {
  49839. var r = e.context
  49840. , o = i.extensions
  49841. , a = i.defines
  49842. , s = i.__webglShader.vertexShader
  49843. , l = i.__webglShader.fragmentShader
  49844. , c = "SHADOWMAP_TYPE_BASIC";
  49845. n.shadowMapType === Ci.PCFShadowMap ? c = "SHADOWMAP_TYPE_PCF" : n.shadowMapType === Ci.PCFSoftShadowMap && (c = "SHADOWMAP_TYPE_PCF_SOFT");
  49846. var h = "ENVMAP_TYPE_CUBE"
  49847. , u = "ENVMAP_MODE_REFLECTION"
  49848. , d = "ENVMAP_BLENDING_MULTIPLY";
  49849. if (n.envMap) {
  49850. switch (i.envMap.mapping) {
  49851. case Ci.CubeReflectionMapping:
  49852. case Ci.CubeRefractionMapping:
  49853. h = "ENVMAP_TYPE_CUBE";
  49854. break;
  49855. case Ci.CubeUVReflectionMapping:
  49856. case Ci.CubeUVRefractionMapping:
  49857. h = "ENVMAP_TYPE_CUBE_UV";
  49858. break;
  49859. case Ci.EquirectangularReflectionMapping:
  49860. case Ci.EquirectangularRefractionMapping:
  49861. h = "ENVMAP_TYPE_EQUIREC";
  49862. break;
  49863. case Ci.SphericalReflectionMapping:
  49864. h = "ENVMAP_TYPE_SPHERE"
  49865. }
  49866. switch (i.envMap.mapping) {
  49867. case Ci.CubeRefractionMapping:
  49868. case Ci.EquirectangularRefractionMapping:
  49869. u = "ENVMAP_MODE_REFRACTION"
  49870. }
  49871. switch (i.combine) {
  49872. case Ci.MultiplyOperation:
  49873. d = "ENVMAP_BLENDING_MULTIPLY";
  49874. break;
  49875. case Ci.MixOperation:
  49876. d = "ENVMAP_BLENDING_MIX";
  49877. break;
  49878. case Ci.AddOperation:
  49879. d = "ENVMAP_BLENDING_ADD"
  49880. }
  49881. }
  49882. var p, f, g = 0 < e.gammaFactor ? e.gammaFactor : 1, m = function(e, t, i) {
  49883. 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")
  49884. }(o, n, e.extensions), v = function(e) {
  49885. var t = [];
  49886. for (var i in e) {
  49887. var n = e[i];
  49888. !1 !== n && t.push("#define " + i + " " + n)
  49889. }
  49890. return t.join("\n")
  49891. }(a), y = r.createProgram();
  49892. 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"),
  49893. [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) {
  49894. var i;
  49895. switch (t) {
  49896. case Ci.LinearToneMapping:
  49897. i = "Linear";
  49898. break;
  49899. case Ci.ReinhardToneMapping:
  49900. i = "Reinhard";
  49901. break;
  49902. case Ci.Uncharted2ToneMapping:
  49903. i = "Uncharted2";
  49904. break;
  49905. case Ci.CineonToneMapping:
  49906. i = "OptimizedCineon";
  49907. break;
  49908. default:
  49909. throw new Error("unsupported toneMapping: " + t)
  49910. }
  49911. return "vec3 " + e + "( vec3 color ) { return " + i + "ToneMapping( color ); }"
  49912. }("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) {
  49913. var i = Mi(t);
  49914. return "vec4 " + e + "( vec4 value ) { return LinearTo" + i[0] + i[1] + "; }"
  49915. }("linearToOutputTexel", n.outputEncoding) : "", "\n"].filter(Pi).join("\n")),
  49916. s = Oi(s = Li(s), n),
  49917. l = Oi(l = Li(l), n),
  49918. i instanceof Ci.ShaderMaterial == 0 && (s = Di(s),
  49919. l = Di(l));
  49920. var A = p + s
  49921. , C = f + l
  49922. , I = Ci.WebGLShader(r, r.VERTEX_SHADER, A)
  49923. , E = Ci.WebGLShader(r, r.FRAGMENT_SHADER, C);
  49924. r.attachShader(y, I),
  49925. r.attachShader(y, E),
  49926. void 0 !== i.index0AttributeName ? r.bindAttribLocation(y, 0, i.index0AttributeName) : !0 === n.morphTargets && r.bindAttribLocation(y, 0, "position"),
  49927. r.linkProgram(y);
  49928. var _, b, w = r.getProgramInfoLog(y), T = r.getShaderInfoLog(I), x = r.getShaderInfoLog(E), S = !0, M = !0;
  49929. return !1 === r.getProgramParameter(y, r.LINK_STATUS) ? (S = !1,
  49930. 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),
  49931. M && (this.diagnostics = {
  49932. runnable: S,
  49933. material: i,
  49934. programLog: w,
  49935. vertexShader: {
  49936. log: T,
  49937. prefix: p
  49938. },
  49939. fragmentShader: {
  49940. log: x,
  49941. prefix: f
  49942. }
  49943. }),
  49944. r.deleteShader(I),
  49945. r.deleteShader(E),
  49946. this.getUniforms = function() {
  49947. return void 0 === _ && (_ = function(e, t) {
  49948. for (var i = {}, n = e.getProgramParameter(t, e.ACTIVE_UNIFORMS), r = 0; r < n; r++) {
  49949. var o = e.getActiveUniform(t, r).name
  49950. , a = e.getUniformLocation(t, o)
  49951. , s = Jt.exec(o);
  49952. if (s) {
  49953. var l = s[1]
  49954. , c = s[2]
  49955. , h = i[l];
  49956. (h = h || (i[l] = {}))[c] = a
  49957. } else if (s = $t.exec(o)) {
  49958. var u = s[1]
  49959. , d = s[2]
  49960. , p = s[3]
  49961. , f = i[u]
  49962. , g = (f = f || (i[u] = []))[d];
  49963. (g = g || (f[d] = {}))[p] = a
  49964. } else
  49965. (s = ei.exec(o)) ? i[u = s[1]] = a : i[o] = a
  49966. }
  49967. return i
  49968. }(r, y)),
  49969. _
  49970. }
  49971. ,
  49972. this.getAttributes = function() {
  49973. return void 0 === b && (b = function(e, t) {
  49974. for (var i = {}, n = e.getProgramParameter(t, e.ACTIVE_ATTRIBUTES), r = 0; r < n; r++) {
  49975. var o = e.getActiveAttrib(t, r).name;
  49976. i[o] = e.getAttribLocation(t, o)
  49977. }
  49978. return i
  49979. }(r, y)),
  49980. b
  49981. }
  49982. ,
  49983. this.destroy = function() {
  49984. r.deleteProgram(y),
  49985. this.program = void 0
  49986. }
  49987. ,
  49988. Object.defineProperties(this, {
  49989. uniforms: {
  49990. get: function() {
  49991. return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),
  49992. this.getUniforms()
  49993. }
  49994. },
  49995. attributes: {
  49996. get: function() {
  49997. return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),
  49998. this.getAttributes()
  49999. }
  50000. }
  50001. }),
  50002. this.id = Qt++,
  50003. this.code = t,
  50004. this.usedTimes = 1,
  50005. this.program = y,
  50006. this.vertexShader = I,
  50007. this.fragmentShader = E,
  50008. this
  50009. }
  50010. ),
  50011. Ci.WebGLPrograms = function(s, l) {
  50012. function c(e, t) {
  50013. var i;
  50014. return e ? e instanceof Ci.Texture ? i = e.encoding : e instanceof Ci.WebGLRenderTarget && (i = e.texture.encoding) : i = Ci.LinearEncoding,
  50015. i === Ci.LinearEncoding && t && (i = Ci.GammaEncoding),
  50016. i
  50017. }
  50018. var h = []
  50019. , u = {
  50020. MeshDepthMaterial: "depth",
  50021. MeshNormalMaterial: "normal",
  50022. MeshBasicMaterial: "basic",
  50023. MeshLambertMaterial: "lambert",
  50024. MeshPhongMaterial: "phong",
  50025. MeshStandardMaterial: "standard",
  50026. LineBasicMaterial: "basic",
  50027. LineDashedMaterial: "dashed",
  50028. PointsMaterial: "points"
  50029. }
  50030. , 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"];
  50031. this.getParameters = function(e, t, i, n) {
  50032. var r = u[e.type]
  50033. , o = function(e) {
  50034. if (l.floatVertexTextures && e && e.skeleton && e.skeleton.useVertexTexture)
  50035. return 1024;
  50036. var t = l.maxVertexUniforms
  50037. , i = Math.floor((t - 20) / 4);
  50038. 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)")),
  50039. i
  50040. }(n)
  50041. , a = s.getPrecision();
  50042. return null === e.precision || (a = l.getMaxPrecision(e.precision)) !== e.precision && console.warn("THREE.WebGLProgram.getParameters:", e.precision, "not supported, using", a, "instead."),
  50043. {
  50044. shaderID: r,
  50045. precision: a,
  50046. supportsVertexTextures: l.vertexTextures,
  50047. outputEncoding: c(s.getCurrentRenderTarget(), s.gammaOutput),
  50048. map: !!e.map,
  50049. mapEncoding: c(e.map, s.gammaInput),
  50050. envMap: !!e.envMap,
  50051. envMapMode: e.envMap && e.envMap.mapping,
  50052. envMapEncoding: c(e.envMap, s.gammaInput),
  50053. envMapCubeUV: !!e.envMap && (e.envMap.mapping === Ci.CubeUVReflectionMapping || e.envMap.mapping === Ci.CubeUVRefractionMapping),
  50054. lightMap: !!e.lightMap,
  50055. aoMap: !!e.aoMap,
  50056. emissiveMap: !!e.emissiveMap,
  50057. emissiveMapEncoding: c(e.emissiveMap, s.gammaInput),
  50058. bumpMap: !!e.bumpMap,
  50059. normalMap: !!e.normalMap,
  50060. displacementMap: !!e.displacementMap,
  50061. roughnessMap: !!e.roughnessMap,
  50062. metalnessMap: !!e.metalnessMap,
  50063. specularMap: !!e.specularMap,
  50064. alphaMap: !!e.alphaMap,
  50065. combine: e.combine,
  50066. vertexColors: e.vertexColors,
  50067. fog: i,
  50068. useFog: e.fog,
  50069. fogExp: i instanceof Ci.FogExp2,
  50070. flatShading: e.shading === Ci.FlatShading,
  50071. sizeAttenuation: e.sizeAttenuation,
  50072. logarithmicDepthBuffer: l.logarithmicDepthBuffer,
  50073. skinning: e.skinning,
  50074. maxBones: o,
  50075. useVertexTexture: l.floatVertexTextures && n && n.skeleton && n.skeleton.useVertexTexture,
  50076. morphTargets: e.morphTargets,
  50077. morphNormals: e.morphNormals,
  50078. maxMorphTargets: s.maxMorphTargets,
  50079. maxMorphNormals: s.maxMorphNormals,
  50080. numDirLights: t.directional.length,
  50081. numPointLights: t.point.length,
  50082. numSpotLights: t.spot.length,
  50083. numHemiLights: t.hemi.length,
  50084. pointLightShadows: t.shadowsPointLight,
  50085. shadowMapEnabled: s.shadowMap.enabled && n.receiveShadow && 0 < t.shadows.length,
  50086. shadowMapType: s.shadowMap.type,
  50087. toneMapping: s.toneMapping,
  50088. physicallyCorrectLights: s.physicallyCorrectLights,
  50089. premultipliedAlpha: e.premultipliedAlpha,
  50090. alphaTest: e.alphaTest,
  50091. doubleSided: e.side === Ci.DoubleSide,
  50092. flipSided: e.side === Ci.BackSide
  50093. }
  50094. }
  50095. ,
  50096. this.getProgramCode = function(e, t) {
  50097. var i = [];
  50098. if (t.shaderID ? i.push(t.shaderID) : (i.push(e.fragmentShader),
  50099. i.push(e.vertexShader)),
  50100. void 0 !== e.defines)
  50101. for (var n in e.defines)
  50102. i.push(n),
  50103. i.push(e.defines[n]);
  50104. for (var r = 0; r < a.length; r++) {
  50105. var o = a[r];
  50106. i.push(o),
  50107. i.push(t[o])
  50108. }
  50109. return i.join()
  50110. }
  50111. ,
  50112. this.acquireProgram = function(e, t, i) {
  50113. for (var n, r = 0, o = h.length; r < o; r++) {
  50114. var a = h[r];
  50115. if (a.code === i) {
  50116. ++(n = a).usedTimes;
  50117. break
  50118. }
  50119. }
  50120. return void 0 === n && (n = new Ci.WebGLProgram(s,i,e,t),
  50121. h.push(n)),
  50122. n
  50123. }
  50124. ,
  50125. this.releaseProgram = function(e) {
  50126. if (0 == --e.usedTimes) {
  50127. var t = h.indexOf(e);
  50128. h[t] = h[h.length - 1],
  50129. h.pop(),
  50130. e.destroy()
  50131. }
  50132. }
  50133. ,
  50134. this.programs = h
  50135. }
  50136. ,
  50137. Ci.WebGLProperties = function() {
  50138. var n = {};
  50139. this.get = function(e) {
  50140. var t = e.uuid
  50141. , i = n[t];
  50142. return void 0 === i && (i = {},
  50143. n[t] = i),
  50144. i
  50145. }
  50146. ,
  50147. this.delete = function(e) {
  50148. delete n[e.uuid]
  50149. }
  50150. ,
  50151. this.clear = function() {
  50152. n = {}
  50153. }
  50154. }
  50155. ,
  50156. Ci.WebGLShader = function(e, t, i) {
  50157. var n = e.createShader(t);
  50158. return e.shaderSource(n, i),
  50159. e.compileShader(n),
  50160. !1 === e.getShaderParameter(n, e.COMPILE_STATUS) && console.error("THREE.WebGLShader: Shader couldn't compile."),
  50161. "" !== e.getShaderInfoLog(n) && console.warn("THREE.WebGLShader: gl.getShaderInfoLog()", t === e.VERTEX_SHADER ? "vertex" : "fragment", e.getShaderInfoLog(n), function(e) {
  50162. for (var t = e.split("\n"), i = 0; i < t.length; i++)
  50163. t[i] = i + 1 + ": " + t[i];
  50164. return t.join("\n")
  50165. }(i)),
  50166. n
  50167. }
  50168. ,
  50169. Ci.WebGLShadowMap = function(P, O, L) {
  50170. function D(e, t, i, n) {
  50171. var r = e.geometry
  50172. , o = null
  50173. , a = p
  50174. , s = e.customDepthMaterial;
  50175. if (i && (a = f,
  50176. s = e.customDistanceMaterial),
  50177. s)
  50178. o = s;
  50179. else {
  50180. var l = void 0 !== r.morphTargets && 0 < r.morphTargets.length && t.morphTargets
  50181. , c = e instanceof Ci.SkinnedMesh && t.skinning
  50182. , h = 0;
  50183. l && (h |= u),
  50184. c && (h |= d),
  50185. o = a[h]
  50186. }
  50187. return o.visible = t.visible,
  50188. o.wireframe = t.wireframe,
  50189. o.wireframeLinewidth = t.wireframeLinewidth,
  50190. i && void 0 !== o.uniforms.lightPos && o.uniforms.lightPos.value.copy(n),
  50191. o
  50192. }
  50193. function N(e, t, i) {
  50194. if (!1 !== e.visible) {
  50195. 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)))
  50196. !0 === e.material.visible && (e.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse, e.matrixWorld),
  50197. G.push(e));
  50198. for (var n = e.children, r = 0, o = n.length; r < o; r++)
  50199. N(n[r], t, i)
  50200. }
  50201. }
  50202. 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) {
  50203. var a = 0 != (o & u)
  50204. , s = 0 != (o & d)
  50205. , l = new Ci.ShaderMaterial({
  50206. uniforms: i,
  50207. vertexShader: t.vertexShader,
  50208. fragmentShader: t.fragmentShader,
  50209. morphTargets: a,
  50210. skinning: s
  50211. });
  50212. p[o] = l;
  50213. var c = new Ci.ShaderMaterial({
  50214. defines: {
  50215. USE_SHADOWMAP: ""
  50216. },
  50217. uniforms: r,
  50218. vertexShader: n.vertexShader,
  50219. fragmentShader: n.fragmentShader,
  50220. morphTargets: a,
  50221. skinning: s
  50222. });
  50223. f[o] = c
  50224. }
  50225. var q = this;
  50226. this.enabled = !1,
  50227. this.autoUpdate = !0,
  50228. this.needsUpdate = !1,
  50229. this.type = Ci.PCFShadowMap,
  50230. this.cullFace = Ci.CullFaceFront,
  50231. this.render = function(e, t) {
  50232. var i, n, r = O.shadows;
  50233. if (0 !== r.length && !1 !== q.enabled && (!1 !== q.autoUpdate || !1 !== q.needsUpdate)) {
  50234. B.clearColor(1, 1, 1, 1),
  50235. B.disable(F.BLEND),
  50236. B.enable(F.CULL_FACE),
  50237. F.frontFace(F.CCW),
  50238. F.cullFace(q.cullFace === Ci.CullFaceFront ? F.FRONT : F.BACK),
  50239. B.setDepthTest(!0),
  50240. B.setScissorTest(!1);
  50241. for (var o = 0, a = r.length; o < a; o++) {
  50242. var s = r[o]
  50243. , l = s.shadow
  50244. , c = l.camera;
  50245. if (U.copy(l.mapSize),
  50246. s instanceof Ci.PointLight) {
  50247. i = 6,
  50248. n = !0;
  50249. var h = U.x
  50250. , u = U.y;
  50251. Y[0].set(2 * h, u, h, u),
  50252. Y[1].set(0, u, h, u),
  50253. Y[2].set(3 * h, u, h, u),
  50254. Y[3].set(h, u, h, u),
  50255. Y[4].set(3 * h, 0, h, u),
  50256. Y[5].set(h, 0, h, u),
  50257. U.x *= 4,
  50258. U.y *= 2
  50259. } else
  50260. n = !(i = 1);
  50261. if (null === l.map) {
  50262. var d = {
  50263. minFilter: Ci.NearestFilter,
  50264. magFilter: Ci.NearestFilter,
  50265. format: Ci.RGBAFormat
  50266. };
  50267. l.map = new Ci.WebGLRenderTarget(U.x,U.y,d),
  50268. s instanceof Ci.SpotLight && (c.aspect = U.x / U.y),
  50269. c.updateProjectionMatrix()
  50270. }
  50271. var p = l.map
  50272. , f = l.matrix;
  50273. z.setFromMatrixPosition(s.matrixWorld),
  50274. c.position.copy(z),
  50275. P.setRenderTarget(p),
  50276. P.clear();
  50277. for (var g = 0; g < i; g++) {
  50278. if (n) {
  50279. H.copy(c.position),
  50280. H.add(W[g]),
  50281. c.up.copy(j[g]),
  50282. c.lookAt(H);
  50283. var m = Y[g];
  50284. B.viewport(m)
  50285. } else
  50286. H.setFromMatrixPosition(s.target.matrixWorld),
  50287. c.lookAt(H);
  50288. c.updateMatrixWorld(),
  50289. c.matrixWorldInverse.getInverse(c.matrixWorld),
  50290. f.set(.5, 0, 0, .5, 0, .5, 0, .5, 0, 0, .5, .5, 0, 0, 0, 1),
  50291. f.multiply(c.projectionMatrix),
  50292. f.multiply(c.matrixWorldInverse),
  50293. k.multiplyMatrices(c.projectionMatrix, c.matrixWorldInverse),
  50294. V.setFromMatrix(k),
  50295. G.length = 0,
  50296. N(e, t, c);
  50297. for (var v = 0, y = G.length; v < y; v++) {
  50298. var A = G[v]
  50299. , C = L.update(A)
  50300. , I = A.material;
  50301. if (I instanceof Ci.MultiMaterial)
  50302. for (var E = C.groups, _ = I.materials, b = 0, w = E.length; b < w; b++) {
  50303. var T = E[b]
  50304. , x = _[T.materialIndex];
  50305. if (!0 === x.visible) {
  50306. var S = D(A, x, n, z);
  50307. P.renderBufferDirect(c, null, C, S, A, T)
  50308. }
  50309. }
  50310. else {
  50311. S = D(A, I, n, z);
  50312. P.renderBufferDirect(c, null, C, S, A, null)
  50313. }
  50314. }
  50315. }
  50316. }
  50317. var M = P.getClearColor()
  50318. , R = P.getClearAlpha();
  50319. P.setClearColor(M, R),
  50320. B.enable(F.BLEND),
  50321. q.cullFace === Ci.CullFaceFront && F.cullFace(F.BACK),
  50322. q.needsUpdate = !1
  50323. }
  50324. }
  50325. }
  50326. ,
  50327. Ci.WebGLState = function(l, i, c) {
  50328. var n = this
  50329. , r = new Ci.Vector4
  50330. , o = new Uint8Array(16)
  50331. , a = new Uint8Array(16)
  50332. , s = new Uint8Array(16)
  50333. , t = {}
  50334. , h = null
  50335. , u = null
  50336. , d = null
  50337. , p = null
  50338. , f = null
  50339. , g = null
  50340. , m = null
  50341. , v = null
  50342. , y = !1
  50343. , A = null
  50344. , C = null
  50345. , I = null
  50346. , E = null
  50347. , _ = null
  50348. , b = null
  50349. , w = null
  50350. , T = null
  50351. , x = null
  50352. , S = null
  50353. , M = null
  50354. , R = null
  50355. , P = null
  50356. , O = null
  50357. , L = null
  50358. , D = l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS)
  50359. , N = void 0
  50360. , F = {}
  50361. , B = new Ci.Vector4
  50362. , V = null
  50363. , k = null
  50364. , U = new Ci.Vector4
  50365. , H = new Ci.Vector4
  50366. , z = l.createTexture();
  50367. l.bindTexture(l.TEXTURE_2D, z),
  50368. l.texParameteri(l.TEXTURE_2D, l.TEXTURE_MIN_FILTER, l.LINEAR),
  50369. l.texImage2D(l.TEXTURE_2D, 0, l.RGB, 1, 1, 0, l.RGB, l.UNSIGNED_BYTE, new Uint8Array(3)),
  50370. this.init = function() {
  50371. this.clearColor(0, 0, 0, 1),
  50372. this.clearDepth(1),
  50373. this.clearStencil(0),
  50374. this.enable(l.DEPTH_TEST),
  50375. l.depthFunc(l.LEQUAL),
  50376. l.frontFace(l.CCW),
  50377. l.cullFace(l.BACK),
  50378. this.enable(l.CULL_FACE),
  50379. this.enable(l.BLEND),
  50380. l.blendEquation(l.FUNC_ADD),
  50381. l.blendFunc(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA)
  50382. }
  50383. ,
  50384. this.initAttributes = function() {
  50385. for (var e = 0, t = o.length; e < t; e++)
  50386. o[e] = 0
  50387. }
  50388. ,
  50389. this.enableAttribute = function(e) {
  50390. o[e] = 1,
  50391. 0 === a[e] && (l.enableVertexAttribArray(e),
  50392. a[e] = 1),
  50393. 0 !== s[e] && (i.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(e, 0),
  50394. s[e] = 0)
  50395. }
  50396. ,
  50397. this.enableAttributeAndDivisor = function(e, t, i) {
  50398. o[e] = 1,
  50399. 0 === a[e] && (l.enableVertexAttribArray(e),
  50400. a[e] = 1),
  50401. s[e] !== t && (i.vertexAttribDivisorANGLE(e, t),
  50402. s[e] = t)
  50403. }
  50404. ,
  50405. this.disableUnusedAttributes = function() {
  50406. for (var e = 0, t = a.length; e < t; e++)
  50407. a[e] !== o[e] && (l.disableVertexAttribArray(e),
  50408. a[e] = 0)
  50409. }
  50410. ,
  50411. this.enable = function(e) {
  50412. !0 !== t[e] && (l.enable(e),
  50413. t[e] = !0)
  50414. }
  50415. ,
  50416. this.disable = function(e) {
  50417. !1 !== t[e] && (l.disable(e),
  50418. t[e] = !1)
  50419. }
  50420. ,
  50421. this.getCompressedTextureFormats = function() {
  50422. if (null === h && (h = [],
  50423. i.get("WEBGL_compressed_texture_pvrtc") || i.get("WEBGL_compressed_texture_s3tc") || i.get("WEBGL_compressed_texture_etc1")))
  50424. for (var e = l.getParameter(l.COMPRESSED_TEXTURE_FORMATS), t = 0; t < e.length; t++)
  50425. h.push(e[t]);
  50426. return h
  50427. }
  50428. ,
  50429. this.setBlending = function(e, t, i, n, r, o, a, s) {
  50430. e === Ci.NoBlending ? this.disable(l.BLEND) : this.enable(l.BLEND),
  50431. e === u && s === y || (e === Ci.AdditiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50432. l.blendFuncSeparate(l.ONE, l.ONE, l.ONE, l.ONE)) : (l.blendEquation(l.FUNC_ADD),
  50433. l.blendFunc(l.SRC_ALPHA, l.ONE)) : e === Ci.SubtractiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50434. l.blendFuncSeparate(l.ZERO, l.ZERO, l.ONE_MINUS_SRC_COLOR, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  50435. l.blendFunc(l.ZERO, l.ONE_MINUS_SRC_COLOR)) : e === Ci.MultiplyBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50436. l.blendFuncSeparate(l.ZERO, l.ZERO, l.SRC_COLOR, l.SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  50437. l.blendFunc(l.ZERO, l.SRC_COLOR)) : s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50438. l.blendFuncSeparate(l.ONE, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  50439. l.blendFuncSeparate(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)),
  50440. u = e,
  50441. y = s),
  50442. e === Ci.CustomBlending ? (r = r || t,
  50443. o = o || i,
  50444. a = a || n,
  50445. t === d && r === g || (l.blendEquationSeparate(c(t), c(r)),
  50446. d = t,
  50447. g = r),
  50448. i === p && n === f && o === m && a === v || (l.blendFuncSeparate(c(i), c(n), c(o), c(a)),
  50449. p = i,
  50450. f = n,
  50451. m = o,
  50452. v = a)) : v = m = g = f = p = d = null
  50453. }
  50454. ,
  50455. this.setDepthFunc = function(e) {
  50456. if (A !== e) {
  50457. if (e)
  50458. switch (e) {
  50459. case Ci.NeverDepth:
  50460. l.depthFunc(l.NEVER);
  50461. break;
  50462. case Ci.AlwaysDepth:
  50463. l.depthFunc(l.ALWAYS);
  50464. break;
  50465. case Ci.LessDepth:
  50466. l.depthFunc(l.LESS);
  50467. break;
  50468. case Ci.LessEqualDepth:
  50469. l.depthFunc(l.LEQUAL);
  50470. break;
  50471. case Ci.EqualDepth:
  50472. l.depthFunc(l.EQUAL);
  50473. break;
  50474. case Ci.GreaterEqualDepth:
  50475. l.depthFunc(l.GEQUAL);
  50476. break;
  50477. case Ci.GreaterDepth:
  50478. l.depthFunc(l.GREATER);
  50479. break;
  50480. case Ci.NotEqualDepth:
  50481. l.depthFunc(l.NOTEQUAL);
  50482. break;
  50483. default:
  50484. l.depthFunc(l.LEQUAL)
  50485. }
  50486. else
  50487. l.depthFunc(l.LEQUAL);
  50488. A = e
  50489. }
  50490. }
  50491. ,
  50492. this.setDepthTest = function(e) {
  50493. e ? this.enable(l.DEPTH_TEST) : this.disable(l.DEPTH_TEST)
  50494. }
  50495. ,
  50496. this.setDepthWrite = function(e) {
  50497. C !== e && (l.depthMask(e),
  50498. C = e)
  50499. }
  50500. ,
  50501. this.setColorWrite = function(e) {
  50502. I !== e && (l.colorMask(e, e, e, e),
  50503. I = e)
  50504. }
  50505. ,
  50506. this.setStencilFunc = function(e, t, i) {
  50507. _ === e && b === t && w === i || (l.stencilFunc(e, t, i),
  50508. _ = e,
  50509. b = t,
  50510. w = i)
  50511. }
  50512. ,
  50513. this.setStencilOp = function(e, t, i) {
  50514. T === e && x === t && S === i || (l.stencilOp(e, t, i),
  50515. T = e,
  50516. x = t,
  50517. S = i)
  50518. }
  50519. ,
  50520. this.setStencilTest = function(e) {
  50521. e ? this.enable(l.STENCIL_TEST) : this.disable(l.STENCIL_TEST)
  50522. }
  50523. ,
  50524. this.setStencilWrite = function(e) {
  50525. E !== e && (l.stencilMask(e),
  50526. E = e)
  50527. }
  50528. ,
  50529. this.setFlipSided = function(e) {
  50530. M !== e && (e ? l.frontFace(l.CW) : l.frontFace(l.CCW),
  50531. M = e)
  50532. }
  50533. ,
  50534. this.setLineWidth = function(e) {
  50535. e !== R && (l.lineWidth(e),
  50536. R = e)
  50537. }
  50538. ,
  50539. this.setPolygonOffset = function(e, t, i) {
  50540. e ? this.enable(l.POLYGON_OFFSET_FILL) : this.disable(l.POLYGON_OFFSET_FILL),
  50541. !e || P === t && O === i || (l.polygonOffset(t, i),
  50542. P = t,
  50543. O = i)
  50544. }
  50545. ,
  50546. this.getScissorTest = function() {
  50547. return L
  50548. }
  50549. ,
  50550. this.setScissorTest = function(e) {
  50551. (L = e) ? this.enable(l.SCISSOR_TEST) : this.disable(l.SCISSOR_TEST)
  50552. }
  50553. ,
  50554. this.activeTexture = function(e) {
  50555. void 0 === e && (e = l.TEXTURE0 + D - 1),
  50556. N !== e && (l.activeTexture(e),
  50557. N = e)
  50558. }
  50559. ,
  50560. this.bindTexture = function(e, t) {
  50561. void 0 === N && n.activeTexture();
  50562. var i = F[N];
  50563. void 0 === i && (i = {
  50564. type: void 0,
  50565. texture: void 0
  50566. },
  50567. F[N] = i),
  50568. i.type === e && i.texture === t || (l.bindTexture(e, t || z),
  50569. i.type = e,
  50570. i.texture = t)
  50571. }
  50572. ,
  50573. this.compressedTexImage2D = function() {
  50574. try {
  50575. l.compressedTexImage2D.apply(l, arguments)
  50576. } catch (e) {
  50577. console.error(e)
  50578. }
  50579. }
  50580. ,
  50581. this.texImage2D = function() {
  50582. try {
  50583. l.texImage2D.apply(l, arguments)
  50584. } catch (e) {
  50585. console.error(e)
  50586. }
  50587. }
  50588. ,
  50589. this.clearColor = function(e, t, i, n) {
  50590. r.set(e, t, i, n),
  50591. !1 === B.equals(r) && (l.clearColor(e, t, i, n),
  50592. B.copy(r))
  50593. }
  50594. ,
  50595. this.clearDepth = function(e) {
  50596. V !== e && (l.clearDepth(e),
  50597. V = e)
  50598. }
  50599. ,
  50600. this.clearStencil = function(e) {
  50601. k !== e && (l.clearStencil(e),
  50602. k = e)
  50603. }
  50604. ,
  50605. this.scissor = function(e) {
  50606. !1 === U.equals(e) && (l.scissor(e.x, e.y, e.z, e.w),
  50607. U.copy(e))
  50608. }
  50609. ,
  50610. this.viewport = function(e) {
  50611. !1 === H.equals(e) && (l.viewport(e.x, e.y, e.z, e.w),
  50612. H.copy(e))
  50613. }
  50614. ,
  50615. this.reset = function() {
  50616. for (var e = 0; e < a.length; e++)
  50617. 1 === a[e] && (l.disableVertexAttribArray(e),
  50618. a[e] = 0);
  50619. t = {},
  50620. N = void 0,
  50621. F = {},
  50622. M = E = C = I = u = h = null
  50623. }
  50624. }
  50625. ,
  50626. Ci.LensFlarePlugin = function(v, y) {
  50627. function A() {
  50628. 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]);
  50629. C = S.createBuffer(),
  50630. I = S.createBuffer(),
  50631. S.bindBuffer(S.ARRAY_BUFFER, C),
  50632. S.bufferData(S.ARRAY_BUFFER, t, S.STATIC_DRAW),
  50633. S.bindBuffer(S.ELEMENT_ARRAY_BUFFER, I),
  50634. S.bufferData(S.ELEMENT_ARRAY_BUFFER, i, S.STATIC_DRAW),
  50635. T = S.createTexture(),
  50636. x = S.createTexture(),
  50637. M.bindTexture(S.TEXTURE_2D, T),
  50638. S.texImage2D(S.TEXTURE_2D, 0, S.RGB, 16, 16, 0, S.RGB, S.UNSIGNED_BYTE, null),
  50639. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_S, S.CLAMP_TO_EDGE),
  50640. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_T, S.CLAMP_TO_EDGE),
  50641. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MAG_FILTER, S.NEAREST),
  50642. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MIN_FILTER, S.NEAREST),
  50643. M.bindTexture(S.TEXTURE_2D, x),
  50644. S.texImage2D(S.TEXTURE_2D, 0, S.RGBA, 16, 16, 0, S.RGBA, S.UNSIGNED_BYTE, null),
  50645. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_S, S.CLAMP_TO_EDGE),
  50646. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_T, S.CLAMP_TO_EDGE),
  50647. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MAG_FILTER, S.NEAREST),
  50648. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MIN_FILTER, S.NEAREST),
  50649. e = (w = 0 < S.getParameter(S.MAX_VERTEX_TEXTURE_IMAGE_UNITS)) ? {
  50650. 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"),
  50651. 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")
  50652. } : {
  50653. 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"),
  50654. 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")
  50655. },
  50656. E = function(e) {
  50657. var t = S.createProgram()
  50658. , i = S.createShader(S.FRAGMENT_SHADER)
  50659. , n = S.createShader(S.VERTEX_SHADER)
  50660. , r = "precision " + v.getPrecision() + " float;\n";
  50661. return S.shaderSource(i, r + e.fragmentShader),
  50662. S.shaderSource(n, r + e.vertexShader),
  50663. S.compileShader(i),
  50664. S.compileShader(n),
  50665. S.attachShader(t, i),
  50666. S.attachShader(t, n),
  50667. S.linkProgram(t),
  50668. t
  50669. }(e),
  50670. _ = {
  50671. vertex: S.getAttribLocation(E, "position"),
  50672. uv: S.getAttribLocation(E, "uv")
  50673. },
  50674. b = {
  50675. renderType: S.getUniformLocation(E, "renderType"),
  50676. map: S.getUniformLocation(E, "map"),
  50677. occlusionMap: S.getUniformLocation(E, "occlusionMap"),
  50678. opacity: S.getUniformLocation(E, "opacity"),
  50679. color: S.getUniformLocation(E, "color"),
  50680. scale: S.getUniformLocation(E, "scale"),
  50681. rotation: S.getUniformLocation(E, "rotation"),
  50682. screenPosition: S.getUniformLocation(E, "screenPosition")
  50683. }
  50684. }
  50685. var C, I, E, _, b, w, T, x, S = v.context, M = v.state;
  50686. this.render = function(e, t, i) {
  50687. if (0 !== y.length) {
  50688. var n = new Ci.Vector3
  50689. , r = i.w / i.z
  50690. , o = .5 * i.z
  50691. , a = .5 * i.w
  50692. , s = 16 / i.w
  50693. , l = new Ci.Vector2(s * r,s)
  50694. , c = new Ci.Vector3(1,1,0)
  50695. , h = new Ci.Vector2(1,1);
  50696. void 0 === E && A(),
  50697. S.useProgram(E),
  50698. M.initAttributes(),
  50699. M.enableAttribute(_.vertex),
  50700. M.enableAttribute(_.uv),
  50701. M.disableUnusedAttributes(),
  50702. S.uniform1i(b.occlusionMap, 0),
  50703. S.uniform1i(b.map, 1),
  50704. S.bindBuffer(S.ARRAY_BUFFER, C),
  50705. S.vertexAttribPointer(_.vertex, 2, S.FLOAT, !1, 16, 0),
  50706. S.vertexAttribPointer(_.uv, 2, S.FLOAT, !1, 16, 8),
  50707. S.bindBuffer(S.ELEMENT_ARRAY_BUFFER, I),
  50708. M.disable(S.CULL_FACE),
  50709. M.setDepthWrite(!1);
  50710. for (var u = 0, d = y.length; u < d; u++) {
  50711. s = 16 / i.w,
  50712. l.set(s * r, s);
  50713. var p = y[u];
  50714. if (n.set(p.matrixWorld.elements[12], p.matrixWorld.elements[13], p.matrixWorld.elements[14]),
  50715. n.applyMatrix4(t.matrixWorldInverse),
  50716. n.applyProjection(t.projectionMatrix),
  50717. c.copy(n),
  50718. h.x = c.x * o + o,
  50719. h.y = c.y * a + a,
  50720. w || 0 < h.x && h.x < i.z && 0 < h.y && h.y < i.w) {
  50721. M.activeTexture(S.TEXTURE0),
  50722. M.bindTexture(S.TEXTURE_2D, null),
  50723. M.activeTexture(S.TEXTURE1),
  50724. M.bindTexture(S.TEXTURE_2D, T),
  50725. S.copyTexImage2D(S.TEXTURE_2D, 0, S.RGB, i.x + h.x - 8, i.y + h.y - 8, 16, 16, 0),
  50726. S.uniform1i(b.renderType, 0),
  50727. S.uniform2f(b.scale, l.x, l.y),
  50728. S.uniform3f(b.screenPosition, c.x, c.y, c.z),
  50729. M.disable(S.BLEND),
  50730. M.enable(S.DEPTH_TEST),
  50731. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0),
  50732. M.activeTexture(S.TEXTURE0),
  50733. M.bindTexture(S.TEXTURE_2D, x),
  50734. S.copyTexImage2D(S.TEXTURE_2D, 0, S.RGBA, i.x + h.x - 8, i.y + h.y - 8, 16, 16, 0),
  50735. S.uniform1i(b.renderType, 1),
  50736. M.disable(S.DEPTH_TEST),
  50737. M.activeTexture(S.TEXTURE1),
  50738. M.bindTexture(S.TEXTURE_2D, T),
  50739. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0),
  50740. p.positionScreen.copy(c),
  50741. p.customUpdateCallback ? p.customUpdateCallback(p) : p.updateLensFlares(),
  50742. S.uniform1i(b.renderType, 2),
  50743. M.enable(S.BLEND);
  50744. for (var f = 0, g = p.lensFlares.length; f < g; f++) {
  50745. var m = p.lensFlares[f];
  50746. .001 < m.opacity && .001 < m.scale && (c.x = m.x,
  50747. c.y = m.y,
  50748. c.z = m.z,
  50749. s = m.size * m.scale / i.w,
  50750. l.x = s * r,
  50751. l.y = s,
  50752. S.uniform3f(b.screenPosition, c.x, c.y, c.z),
  50753. S.uniform2f(b.scale, l.x, l.y),
  50754. S.uniform1f(b.rotation, m.rotation),
  50755. S.uniform1f(b.opacity, m.opacity),
  50756. S.uniform3f(b.color, m.color.r, m.color.g, m.color.b),
  50757. M.setBlending(m.blending, m.blendEquation, m.blendSrc, m.blendDst),
  50758. v.setTexture(m.texture, 1),
  50759. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0))
  50760. }
  50761. }
  50762. }
  50763. M.enable(S.CULL_FACE),
  50764. M.enable(S.DEPTH_TEST),
  50765. M.setDepthWrite(!0),
  50766. v.resetGLState()
  50767. }
  50768. }
  50769. }
  50770. ,
  50771. Ci.SpritePlugin = function(u, d) {
  50772. function p() {
  50773. var e = new Float32Array([-.5, -.5, 0, 0, .5, -.5, 1, 0, .5, .5, 1, 1, -.5, .5, 0, 1])
  50774. , t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  50775. g = I.createBuffer(),
  50776. m = I.createBuffer(),
  50777. I.bindBuffer(I.ARRAY_BUFFER, g),
  50778. I.bufferData(I.ARRAY_BUFFER, e, I.STATIC_DRAW),
  50779. I.bindBuffer(I.ELEMENT_ARRAY_BUFFER, m),
  50780. I.bufferData(I.ELEMENT_ARRAY_BUFFER, t, I.STATIC_DRAW),
  50781. v = function() {
  50782. var e = I.createProgram()
  50783. , t = I.createShader(I.VERTEX_SHADER)
  50784. , i = I.createShader(I.FRAGMENT_SHADER);
  50785. 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")),
  50786. 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")),
  50787. I.compileShader(t),
  50788. I.compileShader(i),
  50789. I.attachShader(e, t),
  50790. I.attachShader(e, i),
  50791. I.linkProgram(e),
  50792. e
  50793. }(),
  50794. y = {
  50795. position: I.getAttribLocation(v, "position"),
  50796. uv: I.getAttribLocation(v, "uv")
  50797. },
  50798. A = {
  50799. uvOffset: I.getUniformLocation(v, "uvOffset"),
  50800. uvScale: I.getUniformLocation(v, "uvScale"),
  50801. rotation: I.getUniformLocation(v, "rotation"),
  50802. scale: I.getUniformLocation(v, "scale"),
  50803. color: I.getUniformLocation(v, "color"),
  50804. map: I.getUniformLocation(v, "map"),
  50805. opacity: I.getUniformLocation(v, "opacity"),
  50806. modelViewMatrix: I.getUniformLocation(v, "modelViewMatrix"),
  50807. projectionMatrix: I.getUniformLocation(v, "projectionMatrix"),
  50808. fogType: I.getUniformLocation(v, "fogType"),
  50809. fogDensity: I.getUniformLocation(v, "fogDensity"),
  50810. fogNear: I.getUniformLocation(v, "fogNear"),
  50811. fogFar: I.getUniformLocation(v, "fogFar"),
  50812. fogColor: I.getUniformLocation(v, "fogColor"),
  50813. alphaTest: I.getUniformLocation(v, "alphaTest")
  50814. };
  50815. var i = document.createElement("canvas");
  50816. i.width = 8,
  50817. i.height = 8;
  50818. var n = i.getContext("2d");
  50819. n.fillStyle = "white",
  50820. n.fillRect(0, 0, 8, 8),
  50821. (C = new Ci.Texture(i)).needsUpdate = !0
  50822. }
  50823. function f(e, t) {
  50824. return e.renderOrder !== t.renderOrder ? e.renderOrder - t.renderOrder : e.z !== t.z ? t.z - e.z : t.id - e.id
  50825. }
  50826. var g, m, v, y, A, C, I = u.context, E = u.state, _ = new Ci.Vector3, b = new Ci.Quaternion, w = new Ci.Vector3;
  50827. this.render = function(e, t) {
  50828. if (0 !== d.length) {
  50829. void 0 === v && p(),
  50830. I.useProgram(v),
  50831. E.initAttributes(),
  50832. E.enableAttribute(y.position),
  50833. E.enableAttribute(y.uv),
  50834. E.disableUnusedAttributes(),
  50835. E.disable(I.CULL_FACE),
  50836. E.enable(I.BLEND),
  50837. I.bindBuffer(I.ARRAY_BUFFER, g),
  50838. I.vertexAttribPointer(y.position, 2, I.FLOAT, !1, 16, 0),
  50839. I.vertexAttribPointer(y.uv, 2, I.FLOAT, !1, 16, 8),
  50840. I.bindBuffer(I.ELEMENT_ARRAY_BUFFER, m),
  50841. I.uniformMatrix4fv(A.projectionMatrix, !1, t.projectionMatrix.elements),
  50842. E.activeTexture(I.TEXTURE0),
  50843. I.uniform1i(A.map, 0);
  50844. var i = 0
  50845. , n = 0
  50846. , r = e.fog;
  50847. r ? (I.uniform3f(A.fogColor, r.color.r, r.color.g, r.color.b),
  50848. r instanceof Ci.Fog ? (I.uniform1f(A.fogNear, r.near),
  50849. I.uniform1f(A.fogFar, r.far),
  50850. I.uniform1i(A.fogType, 1),
  50851. n = i = 1) : r instanceof Ci.FogExp2 && (I.uniform1f(A.fogDensity, r.density),
  50852. I.uniform1i(A.fogType, 2),
  50853. n = i = 2)) : (I.uniform1i(A.fogType, 0),
  50854. n = i = 0);
  50855. for (var o = 0, a = d.length; o < a; o++) {
  50856. (l = d[o]).modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, l.matrixWorld),
  50857. l.z = -l.modelViewMatrix.elements[14]
  50858. }
  50859. d.sort(f);
  50860. var s = [];
  50861. for (o = 0,
  50862. a = d.length; o < a; o++) {
  50863. var l, c = (l = d[o]).material;
  50864. I.uniform1f(A.alphaTest, c.alphaTest),
  50865. I.uniformMatrix4fv(A.modelViewMatrix, !1, l.modelViewMatrix.elements),
  50866. l.matrixWorld.decompose(_, b, w),
  50867. s[0] = w.x,
  50868. s[1] = w.y;
  50869. var h = 0;
  50870. e.fog && c.fog && (h = n),
  50871. i !== h && (I.uniform1i(A.fogType, h),
  50872. i = h),
  50873. null !== c.map ? (I.uniform2f(A.uvOffset, c.map.offset.x, c.map.offset.y),
  50874. I.uniform2f(A.uvScale, c.map.repeat.x, c.map.repeat.y)) : (I.uniform2f(A.uvOffset, 0, 0),
  50875. I.uniform2f(A.uvScale, 1, 1)),
  50876. I.uniform1f(A.opacity, c.opacity),
  50877. I.uniform3f(A.color, c.color.r, c.color.g, c.color.b),
  50878. I.uniform1f(A.rotation, c.rotation),
  50879. I.uniform2fv(A.scale, s),
  50880. E.setBlending(c.blending, c.blendEquation, c.blendSrc, c.blendDst),
  50881. E.setDepthTest(c.depthTest),
  50882. E.setDepthWrite(c.depthWrite),
  50883. c.map && c.map.image && c.map.image.width ? u.setTexture(c.map, 0) : u.setTexture(C, 0),
  50884. I.drawElements(I.TRIANGLES, 6, I.UNSIGNED_SHORT, 0)
  50885. }
  50886. E.enable(I.CULL_FACE),
  50887. u.resetGLState()
  50888. }
  50889. }
  50890. }
  50891. ,
  50892. Object.defineProperties(Ci.Box2.prototype, {
  50893. empty: {
  50894. value: function() {
  50895. return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),
  50896. this.isEmpty()
  50897. }
  50898. },
  50899. isIntersectionBox: {
  50900. value: function(e) {
  50901. return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),
  50902. this.intersectsBox(e)
  50903. }
  50904. }
  50905. }),
  50906. Object.defineProperties(Ci.Box3.prototype, {
  50907. empty: {
  50908. value: function() {
  50909. return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),
  50910. this.isEmpty()
  50911. }
  50912. },
  50913. isIntersectionBox: {
  50914. value: function(e) {
  50915. return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),
  50916. this.intersectsBox(e)
  50917. }
  50918. },
  50919. isIntersectionSphere: {
  50920. value: function(e) {
  50921. return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  50922. this.intersectsSphere(e)
  50923. }
  50924. }
  50925. }),
  50926. Object.defineProperties(Ci.Matrix3.prototype, {
  50927. multiplyVector3: {
  50928. value: function(e) {
  50929. return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),
  50930. e.applyMatrix3(this)
  50931. }
  50932. },
  50933. multiplyVector3Array: {
  50934. value: function(e) {
  50935. return console.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  50936. this.applyToVector3Array(e)
  50937. }
  50938. }
  50939. }),
  50940. Object.defineProperties(Ci.Matrix4.prototype, {
  50941. extractPosition: {
  50942. value: function(e) {
  50943. return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),
  50944. this.copyPosition(e)
  50945. }
  50946. },
  50947. setRotationFromQuaternion: {
  50948. value: function(e) {
  50949. return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),
  50950. this.makeRotationFromQuaternion(e)
  50951. }
  50952. },
  50953. multiplyVector3: {
  50954. value: function(e) {
  50955. return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead."),
  50956. e.applyProjection(this)
  50957. }
  50958. },
  50959. multiplyVector4: {
  50960. value: function(e) {
  50961. return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  50962. e.applyMatrix4(this)
  50963. }
  50964. },
  50965. multiplyVector3Array: {
  50966. value: function(e) {
  50967. return console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  50968. this.applyToVector3Array(e)
  50969. }
  50970. },
  50971. rotateAxis: {
  50972. value: function(e) {
  50973. console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),
  50974. e.transformDirection(this)
  50975. }
  50976. },
  50977. crossVector: {
  50978. value: function(e) {
  50979. return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  50980. e.applyMatrix4(this)
  50981. }
  50982. },
  50983. translate: {
  50984. value: function(e) {
  50985. console.error("THREE.Matrix4: .translate() has been removed.")
  50986. }
  50987. },
  50988. rotateX: {
  50989. value: function(e) {
  50990. console.error("THREE.Matrix4: .rotateX() has been removed.")
  50991. }
  50992. },
  50993. rotateY: {
  50994. value: function(e) {
  50995. console.error("THREE.Matrix4: .rotateY() has been removed.")
  50996. }
  50997. },
  50998. rotateZ: {
  50999. value: function(e) {
  51000. console.error("THREE.Matrix4: .rotateZ() has been removed.")
  51001. }
  51002. },
  51003. rotateByAxis: {
  51004. value: function(e, t) {
  51005. console.error("THREE.Matrix4: .rotateByAxis() has been removed.")
  51006. }
  51007. }
  51008. }),
  51009. Object.defineProperties(Ci.Plane.prototype, {
  51010. isIntersectionLine: {
  51011. value: function(e) {
  51012. return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),
  51013. this.intersectsLine(e)
  51014. }
  51015. }
  51016. }),
  51017. Object.defineProperties(Ci.Quaternion.prototype, {
  51018. multiplyVector3: {
  51019. value: function(e) {
  51020. return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),
  51021. e.applyQuaternion(this)
  51022. }
  51023. }
  51024. }),
  51025. Object.defineProperties(Ci.Ray.prototype, {
  51026. isIntersectionBox: {
  51027. value: function(e) {
  51028. return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),
  51029. this.intersectsBox(e)
  51030. }
  51031. },
  51032. isIntersectionPlane: {
  51033. value: function(e) {
  51034. return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),
  51035. this.intersectsPlane(e)
  51036. }
  51037. },
  51038. isIntersectionSphere: {
  51039. value: function(e) {
  51040. return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  51041. this.intersectsSphere(e)
  51042. }
  51043. }
  51044. }),
  51045. Object.defineProperties(Ci.Vector3.prototype, {
  51046. setEulerFromRotationMatrix: {
  51047. value: function() {
  51048. console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")
  51049. }
  51050. },
  51051. setEulerFromQuaternion: {
  51052. value: function() {
  51053. console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")
  51054. }
  51055. },
  51056. getPositionFromMatrix: {
  51057. value: function(e) {
  51058. return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),
  51059. this.setFromMatrixPosition(e)
  51060. }
  51061. },
  51062. getScaleFromMatrix: {
  51063. value: function(e) {
  51064. return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),
  51065. this.setFromMatrixScale(e)
  51066. }
  51067. },
  51068. getColumnFromMatrix: {
  51069. value: function(e, t) {
  51070. return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),
  51071. this.setFromMatrixColumn(e, t)
  51072. }
  51073. }
  51074. }),
  51075. Ci.Face4 = function(e, t, i, n, r, o, a) {
  51076. return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),
  51077. new Ci.Face3(e,t,i,r,o,a)
  51078. }
  51079. ,
  51080. Ci.Vertex = function(e, t, i) {
  51081. return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),
  51082. new Ci.Vector3(e,t,i)
  51083. }
  51084. ,
  51085. Object.defineProperties(Ci.Object3D.prototype, {
  51086. eulerOrder: {
  51087. get: function() {
  51088. return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  51089. this.rotation.order
  51090. },
  51091. set: function(e) {
  51092. console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  51093. this.rotation.order = e
  51094. }
  51095. },
  51096. getChildByName: {
  51097. value: function(e) {
  51098. return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),
  51099. this.getObjectByName(e)
  51100. }
  51101. },
  51102. renderDepth: {
  51103. set: function(e) {
  51104. console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")
  51105. }
  51106. },
  51107. translate: {
  51108. value: function(e, t) {
  51109. return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),
  51110. this.translateOnAxis(t, e)
  51111. }
  51112. },
  51113. useQuaternion: {
  51114. get: function() {
  51115. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  51116. },
  51117. set: function(e) {
  51118. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  51119. }
  51120. }
  51121. }),
  51122. Object.defineProperties(Ci, {
  51123. PointCloud: {
  51124. value: function(e, t) {
  51125. return console.warn("THREE.PointCloud has been renamed to THREE.Points."),
  51126. new Ci.Points(e,t)
  51127. }
  51128. },
  51129. ParticleSystem: {
  51130. value: function(e, t) {
  51131. return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),
  51132. new Ci.Points(e,t)
  51133. }
  51134. }
  51135. }),
  51136. Object.defineProperties(Ci.Light.prototype, {
  51137. onlyShadow: {
  51138. set: function(e) {
  51139. console.warn("THREE.Light: .onlyShadow has been removed.")
  51140. }
  51141. },
  51142. shadowCameraFov: {
  51143. set: function(e) {
  51144. console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),
  51145. this.shadow.camera.fov = e
  51146. }
  51147. },
  51148. shadowCameraLeft: {
  51149. set: function(e) {
  51150. console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),
  51151. this.shadow.camera.left = e
  51152. }
  51153. },
  51154. shadowCameraRight: {
  51155. set: function(e) {
  51156. console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),
  51157. this.shadow.camera.right = e
  51158. }
  51159. },
  51160. shadowCameraTop: {
  51161. set: function(e) {
  51162. console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),
  51163. this.shadow.camera.top = e
  51164. }
  51165. },
  51166. shadowCameraBottom: {
  51167. set: function(e) {
  51168. console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),
  51169. this.shadow.camera.bottom = e
  51170. }
  51171. },
  51172. shadowCameraNear: {
  51173. set: function(e) {
  51174. console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),
  51175. this.shadow.camera.near = e
  51176. }
  51177. },
  51178. shadowCameraFar: {
  51179. set: function(e) {
  51180. console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),
  51181. this.shadow.camera.far = e
  51182. }
  51183. },
  51184. shadowCameraVisible: {
  51185. set: function(e) {
  51186. console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")
  51187. }
  51188. },
  51189. shadowBias: {
  51190. set: function(e) {
  51191. console.warn("THREE.Light: .shadowBias is now .shadow.bias."),
  51192. this.shadow.bias = e
  51193. }
  51194. },
  51195. shadowDarkness: {
  51196. set: function(e) {
  51197. console.warn("THREE.Light: .shadowDarkness has been removed.")
  51198. }
  51199. },
  51200. shadowMapWidth: {
  51201. set: function(e) {
  51202. console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),
  51203. this.shadow.mapSize.width = e
  51204. }
  51205. },
  51206. shadowMapHeight: {
  51207. set: function(e) {
  51208. console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),
  51209. this.shadow.mapSize.height = e
  51210. }
  51211. }
  51212. }),
  51213. Object.defineProperties(Ci.BufferAttribute.prototype, {
  51214. length: {
  51215. get: function() {
  51216. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  51217. this.array.length
  51218. }
  51219. }
  51220. }),
  51221. Object.defineProperties(Ci.BufferGeometry.prototype, {
  51222. drawcalls: {
  51223. get: function() {
  51224. return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),
  51225. this.groups
  51226. }
  51227. },
  51228. offsets: {
  51229. get: function() {
  51230. return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),
  51231. this.groups
  51232. }
  51233. },
  51234. addIndex: {
  51235. value: function(e) {
  51236. console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),
  51237. this.setIndex(e)
  51238. }
  51239. },
  51240. addDrawCall: {
  51241. value: function(e, t, i) {
  51242. void 0 !== i && console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),
  51243. console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),
  51244. this.addGroup(e, t)
  51245. }
  51246. },
  51247. clearDrawCalls: {
  51248. value: function() {
  51249. console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),
  51250. this.clearGroups()
  51251. }
  51252. },
  51253. computeTangents: {
  51254. value: function() {
  51255. console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")
  51256. }
  51257. },
  51258. computeOffsets: {
  51259. value: function() {
  51260. console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")
  51261. }
  51262. }
  51263. }),
  51264. Object.defineProperties(Ci.Material.prototype, {
  51265. wrapAround: {
  51266. get: function() {
  51267. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  51268. },
  51269. set: function(e) {
  51270. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  51271. }
  51272. },
  51273. wrapRGB: {
  51274. get: function() {
  51275. return console.warn("THREE." + this.type + ": .wrapRGB has been removed."),
  51276. new Ci.Color
  51277. }
  51278. }
  51279. }),
  51280. Object.defineProperties(Ci, {
  51281. PointCloudMaterial: {
  51282. value: function(e) {
  51283. return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),
  51284. new Ci.PointsMaterial(e)
  51285. }
  51286. },
  51287. ParticleBasicMaterial: {
  51288. value: function(e) {
  51289. return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),
  51290. new Ci.PointsMaterial(e)
  51291. }
  51292. },
  51293. ParticleSystemMaterial: {
  51294. value: function(e) {
  51295. return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),
  51296. new Ci.PointsMaterial(e)
  51297. }
  51298. }
  51299. }),
  51300. Object.defineProperties(Ci.MeshPhongMaterial.prototype, {
  51301. metal: {
  51302. get: function() {
  51303. return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),
  51304. !1
  51305. },
  51306. set: function(e) {
  51307. console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")
  51308. }
  51309. }
  51310. }),
  51311. Object.defineProperties(Ci.ShaderMaterial.prototype, {
  51312. derivatives: {
  51313. get: function() {
  51314. return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  51315. this.extensions.derivatives
  51316. },
  51317. set: function(e) {
  51318. console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  51319. this.extensions.derivatives = e
  51320. }
  51321. }
  51322. }),
  51323. Object.defineProperties(Ci.WebGLRenderer.prototype, {
  51324. supportsFloatTextures: {
  51325. value: function() {
  51326. return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),
  51327. this.extensions.get("OES_texture_float")
  51328. }
  51329. },
  51330. supportsHalfFloatTextures: {
  51331. value: function() {
  51332. return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),
  51333. this.extensions.get("OES_texture_half_float")
  51334. }
  51335. },
  51336. supportsStandardDerivatives: {
  51337. value: function() {
  51338. return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),
  51339. this.extensions.get("OES_standard_derivatives")
  51340. }
  51341. },
  51342. supportsCompressedTextureS3TC: {
  51343. value: function() {
  51344. return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),
  51345. this.extensions.get("WEBGL_compressed_texture_s3tc")
  51346. }
  51347. },
  51348. supportsCompressedTexturePVRTC: {
  51349. value: function() {
  51350. return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),
  51351. this.extensions.get("WEBGL_compressed_texture_pvrtc")
  51352. }
  51353. },
  51354. supportsBlendMinMax: {
  51355. value: function() {
  51356. return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),
  51357. this.extensions.get("EXT_blend_minmax")
  51358. }
  51359. },
  51360. supportsVertexTextures: {
  51361. value: function() {
  51362. return this.capabilities.vertexTextures
  51363. }
  51364. },
  51365. supportsInstancedArrays: {
  51366. value: function() {
  51367. return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),
  51368. this.extensions.get("ANGLE_instanced_arrays")
  51369. }
  51370. },
  51371. enableScissorTest: {
  51372. value: function(e) {
  51373. console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),
  51374. this.setScissorTest(e)
  51375. }
  51376. },
  51377. initMaterial: {
  51378. value: function() {
  51379. console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")
  51380. }
  51381. },
  51382. addPrePlugin: {
  51383. value: function() {
  51384. console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")
  51385. }
  51386. },
  51387. addPostPlugin: {
  51388. value: function() {
  51389. console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")
  51390. }
  51391. },
  51392. updateShadowMap: {
  51393. value: function() {
  51394. console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")
  51395. }
  51396. },
  51397. shadowMapEnabled: {
  51398. get: function() {
  51399. return this.shadowMap.enabled
  51400. },
  51401. set: function(e) {
  51402. console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),
  51403. this.shadowMap.enabled = e
  51404. }
  51405. },
  51406. shadowMapType: {
  51407. get: function() {
  51408. return this.shadowMap.type
  51409. },
  51410. set: function(e) {
  51411. console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),
  51412. this.shadowMap.type = e
  51413. }
  51414. },
  51415. shadowMapCullFace: {
  51416. get: function() {
  51417. return this.shadowMap.cullFace
  51418. },
  51419. set: function(e) {
  51420. console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace."),
  51421. this.shadowMap.cullFace = e
  51422. }
  51423. }
  51424. }),
  51425. Object.defineProperties(Ci.WebGLRenderTarget.prototype, {
  51426. wrapS: {
  51427. get: function() {
  51428. return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  51429. this.texture.wrapS
  51430. },
  51431. set: function(e) {
  51432. console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  51433. this.texture.wrapS = e
  51434. }
  51435. },
  51436. wrapT: {
  51437. get: function() {
  51438. return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  51439. this.texture.wrapT
  51440. },
  51441. set: function(e) {
  51442. console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  51443. this.texture.wrapT = e
  51444. }
  51445. },
  51446. magFilter: {
  51447. get: function() {
  51448. return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  51449. this.texture.magFilter
  51450. },
  51451. set: function(e) {
  51452. console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  51453. this.texture.magFilter = e
  51454. }
  51455. },
  51456. minFilter: {
  51457. get: function() {
  51458. return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  51459. this.texture.minFilter
  51460. },
  51461. set: function(e) {
  51462. console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  51463. this.texture.minFilter = e
  51464. }
  51465. },
  51466. anisotropy: {
  51467. get: function() {
  51468. return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  51469. this.texture.anisotropy
  51470. },
  51471. set: function(e) {
  51472. console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  51473. this.texture.anisotropy = e
  51474. }
  51475. },
  51476. offset: {
  51477. get: function() {
  51478. return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  51479. this.texture.offset
  51480. },
  51481. set: function(e) {
  51482. console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  51483. this.texture.offset = e
  51484. }
  51485. },
  51486. repeat: {
  51487. get: function() {
  51488. return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  51489. this.texture.repeat
  51490. },
  51491. set: function(e) {
  51492. console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  51493. this.texture.repeat = e
  51494. }
  51495. },
  51496. format: {
  51497. get: function() {
  51498. return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  51499. this.texture.format
  51500. },
  51501. set: function(e) {
  51502. console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  51503. this.texture.format = e
  51504. }
  51505. },
  51506. type: {
  51507. get: function() {
  51508. return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  51509. this.texture.type
  51510. },
  51511. set: function(e) {
  51512. console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  51513. this.texture.type = e
  51514. }
  51515. },
  51516. generateMipmaps: {
  51517. get: function() {
  51518. return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  51519. this.texture.generateMipmaps
  51520. },
  51521. set: function(e) {
  51522. console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  51523. this.texture.generateMipmaps = e
  51524. }
  51525. }
  51526. }),
  51527. Ci.GeometryUtils = {
  51528. merge: function(e, t, i) {
  51529. var n;
  51530. console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead."),
  51531. t instanceof Ci.Mesh && (t.matrixAutoUpdate && t.updateMatrix(),
  51532. n = t.matrix,
  51533. t = t.geometry),
  51534. e.merge(t, n, i)
  51535. },
  51536. center: function(e) {
  51537. return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),
  51538. e.center()
  51539. }
  51540. },
  51541. Ci.ImageUtils = {
  51542. crossOrigin: void 0,
  51543. loadTexture: function(e, t, i, n) {
  51544. console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");
  51545. var r = new Ci.TextureLoader;
  51546. r.setCrossOrigin(this.crossOrigin);
  51547. var o = r.load(e, i, void 0, n);
  51548. return t && (o.mapping = t),
  51549. o
  51550. },
  51551. loadTextureCube: function(e, t, i, n) {
  51552. console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");
  51553. var r = new Ci.CubeTextureLoader;
  51554. r.setCrossOrigin(this.crossOrigin);
  51555. var o = r.load(e, i, void 0, n);
  51556. return t && (o.mapping = t),
  51557. o
  51558. },
  51559. loadCompressedTexture: function() {
  51560. console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")
  51561. },
  51562. loadCompressedTextureCube: function() {
  51563. console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")
  51564. }
  51565. },
  51566. Ci.Projector = function() {
  51567. console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),
  51568. this.projectVector = function(e, t) {
  51569. console.warn("THREE.Projector: .projectVector() is now vector.project()."),
  51570. e.project(t)
  51571. }
  51572. ,
  51573. this.unprojectVector = function(e, t) {
  51574. console.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),
  51575. e.unproject(t)
  51576. }
  51577. ,
  51578. this.pickingRay = function(e, t) {
  51579. console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")
  51580. }
  51581. }
  51582. ,
  51583. Ci.CanvasRenderer = function() {
  51584. console.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"),
  51585. this.domElement = document.createElement("canvas"),
  51586. this.clear = function() {}
  51587. ,
  51588. this.render = function() {}
  51589. ,
  51590. this.setClearColor = function() {}
  51591. ,
  51592. this.setSize = function() {}
  51593. }
  51594. ,
  51595. Ci.MeshFaceMaterial = Ci.MultiMaterial,
  51596. Ci.CurveUtils = {
  51597. tangentQuadraticBezier: function(e, t, i, n) {
  51598. return 2 * (1 - e) * (i - t) + 2 * e * (n - i)
  51599. },
  51600. tangentCubicBezier: function(e, t, i, n, r) {
  51601. 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
  51602. },
  51603. tangentSpline: function(e, t, i, n, r) {
  51604. return 6 * e * e - 6 * e + (3 * e * e - 4 * e + 1) + (-6 * e * e + 6 * e) + (3 * e * e - 2 * e)
  51605. },
  51606. interpolate: function(e, t, i, n, r) {
  51607. var o = .5 * (i - e)
  51608. , a = .5 * (n - t)
  51609. , s = r * r;
  51610. return (2 * t - 2 * i + o + a) * (r * s) + (-3 * t + 3 * i - 2 * o - a) * s + o * r + t
  51611. }
  51612. },
  51613. Ci.SceneUtils = {
  51614. createMultiMaterialObject: function(e, t) {
  51615. for (var i = new Ci.Group, n = 0, r = t.length; n < r; n++)
  51616. i.add(new Ci.Mesh(e,t[n]));
  51617. return i
  51618. },
  51619. detach: function(e, t, i) {
  51620. e.applyMatrix(t.matrixWorld),
  51621. t.remove(e),
  51622. i.add(e)
  51623. },
  51624. attach: function(e, t, i) {
  51625. var n = new Ci.Matrix4;
  51626. n.getInverse(i.matrixWorld),
  51627. e.applyMatrix(n),
  51628. t.remove(e),
  51629. i.add(e)
  51630. }
  51631. },
  51632. Ci.ShapeUtils = {
  51633. area: function(e) {
  51634. for (var t = e.length, i = 0, n = t - 1, r = 0; r < t; n = r++)
  51635. i += e[n].x * e[r].y - e[r].x * e[n].y;
  51636. return .5 * i
  51637. },
  51638. triangulate: function(e, t) {
  51639. var i = e.length;
  51640. if (i < 3)
  51641. return null;
  51642. var n, r, o, a = [], s = [], l = [];
  51643. if (0 < Ci.ShapeUtils.area(e))
  51644. for (r = 0; r < i; r++)
  51645. s[r] = r;
  51646. else
  51647. for (r = 0; r < i; r++)
  51648. s[r] = i - 1 - r;
  51649. var c = i
  51650. , h = 2 * c;
  51651. for (r = c - 1; 2 < c; ) {
  51652. if (h-- <= 0)
  51653. return console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()"),
  51654. t ? l : a;
  51655. if (c <= (n = r) && (n = 0),
  51656. c <= (r = n + 1) && (r = 0),
  51657. c <= (o = r + 1) && (o = 0),
  51658. Si(e, n, r, o, c, s)) {
  51659. var u, d, p, f, g;
  51660. for (u = s[n],
  51661. d = s[r],
  51662. p = s[o],
  51663. a.push([e[u], e[d], e[p]]),
  51664. l.push([s[n], s[r], s[o]]),
  51665. g = (f = r) + 1; g < c; f++,
  51666. g++)
  51667. s[f] = s[g];
  51668. h = 2 * --c
  51669. }
  51670. }
  51671. return t ? l : a
  51672. },
  51673. triangulateShape: function(e, t) {
  51674. function w(e, t, i) {
  51675. 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
  51676. }
  51677. function b(e, t, i, n, r) {
  51678. var o = t.x - e.x
  51679. , a = t.y - e.y
  51680. , s = n.x - i.x
  51681. , l = n.y - i.y
  51682. , c = e.x - i.x
  51683. , h = e.y - i.y
  51684. , u = a * s - o * l
  51685. , d = a * c - o * h;
  51686. if (Math.abs(u) > Number.EPSILON) {
  51687. var p;
  51688. if (0 < u) {
  51689. if (d < 0 || u < d)
  51690. return [];
  51691. if ((p = l * c - s * h) < 0 || u < p)
  51692. return []
  51693. } else {
  51694. if (0 < d || d < u)
  51695. return [];
  51696. if (0 < (p = l * c - s * h) || p < u)
  51697. return []
  51698. }
  51699. if (0 === p)
  51700. return !r || 0 != d && d != u ? [e] : [];
  51701. if (p === u)
  51702. return !r || 0 != d && d != u ? [t] : [];
  51703. if (0 == d)
  51704. return [i];
  51705. if (d == u)
  51706. return [n];
  51707. var f = p / u;
  51708. return [{
  51709. x: e.x + f * o,
  51710. y: e.y + f * a
  51711. }]
  51712. }
  51713. if (0 != d || l * c != s * h)
  51714. return [];
  51715. var g, m, v, y, A, C, I, E, _ = 0 == o && 0 == a, b = 0 == s && 0 == l;
  51716. 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,
  51717. (m = t).x) : (v = (g = t).x,
  51718. (m = e).x),
  51719. i.x < n.x ? (I = (A = i).x,
  51720. (C = n).x) : (I = (A = n).x,
  51721. (C = i).x)) : (y = e.y < t.y ? (v = (g = e).y,
  51722. (m = t).y) : (v = (g = t).y,
  51723. (m = e).y),
  51724. i.y < n.y ? (I = (A = i).y,
  51725. (C = n).y) : (I = (A = n).y,
  51726. (C = i).y)),
  51727. 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])
  51728. }
  51729. function T(e, t, i, n) {
  51730. var r = t.x - e.x
  51731. , o = t.y - e.y
  51732. , a = i.x - e.x
  51733. , s = i.y - e.y
  51734. , l = n.x - e.x
  51735. , c = n.y - e.y
  51736. , h = r * s - o * a
  51737. , u = r * c - o * l;
  51738. if (Math.abs(h) > Number.EPSILON) {
  51739. var d = l * s - c * a;
  51740. return 0 < h ? 0 <= u && 0 <= d : 0 <= u || 0 <= d
  51741. }
  51742. return 0 < u
  51743. }
  51744. for (var i, n, r, o, a, s, l = {}, c = e.concat(), h = 0, u = t.length; h < u; h++)
  51745. Array.prototype.push.apply(c, t[h]);
  51746. for (i = 0,
  51747. n = c.length; i < n; i++)
  51748. void 0 !== l[a = c[i].x + ":" + c[i].y] && console.warn("THREE.Shape: Duplicate point", a),
  51749. l[a] = i;
  51750. var d = function(e, a) {
  51751. function t(e, t) {
  51752. var i = m.length - 1
  51753. , n = e - 1;
  51754. n < 0 && (n = i);
  51755. var r = e + 1;
  51756. i < r && (r = 0);
  51757. var o = T(m[e], m[n], m[r], c[t]);
  51758. if (!o)
  51759. return !1;
  51760. var a = c.length - 1
  51761. , s = t - 1;
  51762. s < 0 && (s = a);
  51763. var l = t + 1;
  51764. return a < l && (l = 0),
  51765. !!(o = T(c[t], c[s], c[l], m[e]))
  51766. }
  51767. function i(e, t) {
  51768. var i, n;
  51769. for (i = 0; i < m.length; i++)
  51770. if (n = i + 1,
  51771. n %= m.length,
  51772. 0 < b(e, t, m[i], m[n], !0).length)
  51773. return !0;
  51774. return !1
  51775. }
  51776. function n(e, t) {
  51777. var i, n, r, o;
  51778. for (i = 0; i < v.length; i++)
  51779. for (n = a[v[i]],
  51780. r = 0; r < n.length; r++)
  51781. if (o = r + 1,
  51782. o %= n.length,
  51783. 0 < b(e, t, n[r], n[o], !0).length)
  51784. return !0;
  51785. return !1
  51786. }
  51787. 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++)
  51788. v.push(A);
  51789. for (var I = 0, E = 2 * v.length; 0 < v.length; ) {
  51790. if (--E < 0) {
  51791. console.log("Infinite Loop! Holes left:" + v.length + ", Probably Hole outside Shape!");
  51792. break
  51793. }
  51794. for (o = I; o < m.length; o++) {
  51795. s = m[o],
  51796. r = -1;
  51797. for (A = 0; A < v.length; A++)
  51798. if (h = v[A],
  51799. void 0 === y[u = s.x + ":" + s.y + ":" + h]) {
  51800. c = a[h];
  51801. for (var _ = 0; _ < c.length; _++)
  51802. if (l = c[_],
  51803. t(o, _) && !i(s, l) && !n(s, l)) {
  51804. r = _,
  51805. v.splice(A, 1),
  51806. d = m.slice(0, o + 1),
  51807. p = m.slice(o),
  51808. f = c.slice(r),
  51809. g = c.slice(0, r + 1),
  51810. m = d.concat(f).concat(g).concat(p),
  51811. I = o;
  51812. break
  51813. }
  51814. if (0 <= r)
  51815. break;
  51816. y[u] = !0
  51817. }
  51818. if (0 <= r)
  51819. break
  51820. }
  51821. }
  51822. return m
  51823. }(e, t)
  51824. , p = Ci.ShapeUtils.triangulate(d, !1);
  51825. for (i = 0,
  51826. n = p.length; i < n; i++)
  51827. for (o = p[i],
  51828. r = 0; r < 3; r++)
  51829. void 0 !== (s = l[a = o[r].x + ":" + o[r].y]) && (o[r] = s);
  51830. return p.concat()
  51831. },
  51832. isClockWise: function(e) {
  51833. return Ci.ShapeUtils.area(e) < 0
  51834. },
  51835. b2: function(e, t, i, n) {
  51836. return function(e, t) {
  51837. var i = 1 - e;
  51838. return i * i * t
  51839. }(e, t) + function(e, t) {
  51840. return 2 * (1 - e) * e * t
  51841. }(e, i) + function(e, t) {
  51842. return e * e * t
  51843. }(e, n)
  51844. },
  51845. b3: function(e, t, i, n, r) {
  51846. return function(e, t) {
  51847. var i = 1 - e;
  51848. return i * i * i * t
  51849. }(e, t) + function(e, t) {
  51850. var i = 1 - e;
  51851. return 3 * i * i * e * t
  51852. }(e, i) + function(e, t) {
  51853. return 3 * (1 - e) * e * e * t
  51854. }(e, n) + function(e, t) {
  51855. return e * e * e * t
  51856. }(e, r)
  51857. }
  51858. },
  51859. Ci.Curve = function() {}
  51860. ,
  51861. Ci.Curve.prototype = {
  51862. constructor: Ci.Curve,
  51863. getPoint: function(e) {
  51864. return console.warn("THREE.Curve: Warning, getPoint() not implemented!"),
  51865. null
  51866. },
  51867. getPointAt: function(e) {
  51868. var t = this.getUtoTmapping(e);
  51869. return this.getPoint(t)
  51870. },
  51871. getPoints: function(e) {
  51872. e = e || 5;
  51873. var t, i = [];
  51874. for (t = 0; t <= e; t++)
  51875. i.push(this.getPoint(t / e));
  51876. return i
  51877. },
  51878. getSpacedPoints: function(e) {
  51879. e = e || 5;
  51880. var t, i = [];
  51881. for (t = 0; t <= e; t++)
  51882. i.push(this.getPointAt(t / e));
  51883. return i
  51884. },
  51885. getLength: function() {
  51886. var e = this.getLengths();
  51887. return e[e.length - 1]
  51888. },
  51889. getLengths: function(e) {
  51890. if (e = e || (this.__arcLengthDivisions ? this.__arcLengthDivisions : 200),
  51891. this.cacheArcLengths && this.cacheArcLengths.length === e + 1 && !this.needsUpdate)
  51892. return this.cacheArcLengths;
  51893. this.needsUpdate = !1;
  51894. var t, i, n = [], r = this.getPoint(0), o = 0;
  51895. for (n.push(0),
  51896. i = 1; i <= e; i++)
  51897. o += (t = this.getPoint(i / e)).distanceTo(r),
  51898. n.push(o),
  51899. r = t;
  51900. return this.cacheArcLengths = n
  51901. },
  51902. updateArcLengths: function() {
  51903. this.needsUpdate = !0,
  51904. this.getLengths()
  51905. },
  51906. getUtoTmapping: function(e, t) {
  51907. var i, n = this.getLengths(), r = 0, o = n.length;
  51908. i = t || e * n[o - 1];
  51909. for (var a, s = 0, l = o - 1; s <= l; )
  51910. if ((a = n[r = Math.floor(s + (l - s) / 2)] - i) < 0)
  51911. s = r + 1;
  51912. else {
  51913. if (!(0 < a)) {
  51914. l = r;
  51915. break
  51916. }
  51917. l = r - 1
  51918. }
  51919. if (n[r = l] === i)
  51920. return r / (o - 1);
  51921. var c = n[r];
  51922. return (r + (i - c) / (n[r + 1] - c)) / (o - 1)
  51923. },
  51924. getTangent: function(e) {
  51925. var t = e - 1e-4
  51926. , i = e + 1e-4;
  51927. t < 0 && (t = 0),
  51928. 1 < i && (i = 1);
  51929. var n = this.getPoint(t);
  51930. return this.getPoint(i).clone().sub(n).normalize()
  51931. },
  51932. getTangentAt: function(e) {
  51933. var t = this.getUtoTmapping(e);
  51934. return this.getTangent(t)
  51935. }
  51936. },
  51937. Ci.Curve.create = function(e, t) {
  51938. return e.prototype = Object.create(Ci.Curve.prototype),
  51939. (e.prototype.constructor = e).prototype.getPoint = t,
  51940. e
  51941. }
  51942. ,
  51943. Ci.CurvePath = function() {
  51944. this.curves = [],
  51945. this.autoClose = !1
  51946. }
  51947. ,
  51948. Ci.CurvePath.prototype = Object.create(Ci.Curve.prototype),
  51949. Ci.CurvePath.prototype.constructor = Ci.CurvePath,
  51950. Ci.CurvePath.prototype.add = function(e) {
  51951. this.curves.push(e)
  51952. }
  51953. ,
  51954. Ci.CurvePath.prototype.closePath = function() {
  51955. var e = this.curves[0].getPoint(0)
  51956. , t = this.curves[this.curves.length - 1].getPoint(1);
  51957. e.equals(t) || this.curves.push(new Ci.LineCurve(t,e))
  51958. }
  51959. ,
  51960. Ci.CurvePath.prototype.getPoint = function(e) {
  51961. for (var t = e * this.getLength(), i = this.getCurveLengths(), n = 0; n < i.length; ) {
  51962. if (i[n] >= t) {
  51963. var r = i[n] - t
  51964. , o = this.curves[n]
  51965. , a = 1 - r / o.getLength();
  51966. return o.getPointAt(a)
  51967. }
  51968. n++
  51969. }
  51970. return null
  51971. }
  51972. ,
  51973. Ci.CurvePath.prototype.getLength = function() {
  51974. var e = this.getCurveLengths();
  51975. return e[e.length - 1]
  51976. }
  51977. ,
  51978. Ci.CurvePath.prototype.getCurveLengths = function() {
  51979. if (this.cacheLengths && this.cacheLengths.length === this.curves.length)
  51980. return this.cacheLengths;
  51981. for (var e = [], t = 0, i = 0, n = this.curves.length; i < n; i++)
  51982. t += this.curves[i].getLength(),
  51983. e.push(t);
  51984. return this.cacheLengths = e
  51985. }
  51986. ,
  51987. Ci.CurvePath.prototype.createPointsGeometry = function(e) {
  51988. var t = this.getPoints(e);
  51989. return this.createGeometry(t)
  51990. }
  51991. ,
  51992. Ci.CurvePath.prototype.createSpacedPointsGeometry = function(e) {
  51993. var t = this.getSpacedPoints(e);
  51994. return this.createGeometry(t)
  51995. }
  51996. ,
  51997. Ci.CurvePath.prototype.createGeometry = function(e) {
  51998. for (var t = new Ci.Geometry, i = 0, n = e.length; i < n; i++) {
  51999. var r = e[i];
  52000. t.vertices.push(new Ci.Vector3(r.x,r.y,r.z || 0))
  52001. }
  52002. return t
  52003. }
  52004. ,
  52005. Ci.Font = function(e) {
  52006. this.data = e
  52007. }
  52008. ,
  52009. Ci.Font.prototype = {
  52010. constructor: Ci.Font,
  52011. generateShapes: function(e, s, b) {
  52012. function l(e, t, i) {
  52013. var n = w.glyphs[e] || w.glyphs["?"];
  52014. if (n) {
  52015. 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;
  52016. if (n.o)
  52017. for (var A = n._cachedOutline || (n._cachedOutline = n.o.split(" ")), C = 0, I = A.length; C < I; ) {
  52018. switch (A[C++]) {
  52019. case "m":
  52020. r = A[C++] * t + i,
  52021. o = A[C++] * t,
  52022. g.moveTo(r, o);
  52023. break;
  52024. case "l":
  52025. r = A[C++] * t + i,
  52026. o = A[C++] * t,
  52027. g.lineTo(r, o);
  52028. break;
  52029. case "q":
  52030. if (a = A[C++] * t + i,
  52031. s = A[C++] * t,
  52032. h = A[C++] * t + i,
  52033. u = A[C++] * t,
  52034. g.quadraticCurveTo(h, u, a, s),
  52035. f = m[m.length - 1]) {
  52036. l = f.x,
  52037. c = f.y;
  52038. for (var E = 1; E <= b; E++) {
  52039. v(_ = E / b, l, h, a),
  52040. v(_, c, u, s)
  52041. }
  52042. }
  52043. break;
  52044. case "b":
  52045. if (a = A[C++] * t + i,
  52046. s = A[C++] * t,
  52047. h = A[C++] * t + i,
  52048. u = A[C++] * t,
  52049. d = A[C++] * t + i,
  52050. p = A[C++] * t,
  52051. g.bezierCurveTo(h, u, d, p, a, s),
  52052. f = m[m.length - 1]) {
  52053. l = f.x,
  52054. c = f.y;
  52055. for (E = 1; E <= b; E++) {
  52056. var _;
  52057. y(_ = E / b, l, h, d, a),
  52058. y(_, c, u, p, s)
  52059. }
  52060. }
  52061. }
  52062. }
  52063. return {
  52064. offset: n.ha * t,
  52065. path: g
  52066. }
  52067. }
  52068. }
  52069. void 0 === s && (s = 100),
  52070. void 0 === b && (b = 4);
  52071. for (var w = this.data, t = function(e) {
  52072. for (var t = String(e).split(""), i = s / w.resolution, n = 0, r = [], o = 0; o < t.length; o++) {
  52073. var a = l(t[o], i, n);
  52074. n += a.offset,
  52075. r.push(a.path)
  52076. }
  52077. return r
  52078. }(e), i = [], n = 0, r = t.length; n < r; n++)
  52079. Array.prototype.push.apply(i, t[n].toShapes());
  52080. return i
  52081. }
  52082. },
  52083. Ci.Path = function(e) {
  52084. Ci.CurvePath.call(this),
  52085. this.actions = [],
  52086. e && this.fromPoints(e)
  52087. }
  52088. ,
  52089. Ci.Path.prototype = Object.create(Ci.CurvePath.prototype),
  52090. Ci.Path.prototype.constructor = Ci.Path,
  52091. Ci.Path.prototype.fromPoints = function(e) {
  52092. this.moveTo(e[0].x, e[0].y);
  52093. for (var t = 1, i = e.length; t < i; t++)
  52094. this.lineTo(e[t].x, e[t].y)
  52095. }
  52096. ,
  52097. Ci.Path.prototype.moveTo = function(e, t) {
  52098. this.actions.push({
  52099. action: "moveTo",
  52100. args: [e, t]
  52101. })
  52102. }
  52103. ,
  52104. Ci.Path.prototype.lineTo = function(e, t) {
  52105. var i = this.actions[this.actions.length - 1].args
  52106. , n = i[i.length - 2]
  52107. , r = i[i.length - 1]
  52108. , o = new Ci.LineCurve(new Ci.Vector2(n,r),new Ci.Vector2(e,t));
  52109. this.curves.push(o),
  52110. this.actions.push({
  52111. action: "lineTo",
  52112. args: [e, t]
  52113. })
  52114. }
  52115. ,
  52116. Ci.Path.prototype.quadraticCurveTo = function(e, t, i, n) {
  52117. var r = this.actions[this.actions.length - 1].args
  52118. , o = r[r.length - 2]
  52119. , a = r[r.length - 1]
  52120. , s = new Ci.QuadraticBezierCurve(new Ci.Vector2(o,a),new Ci.Vector2(e,t),new Ci.Vector2(i,n));
  52121. this.curves.push(s),
  52122. this.actions.push({
  52123. action: "quadraticCurveTo",
  52124. args: [e, t, i, n]
  52125. })
  52126. }
  52127. ,
  52128. Ci.Path.prototype.bezierCurveTo = function(e, t, i, n, r, o) {
  52129. var a = this.actions[this.actions.length - 1].args
  52130. , s = a[a.length - 2]
  52131. , l = a[a.length - 1]
  52132. , c = new Ci.CubicBezierCurve(new Ci.Vector2(s,l),new Ci.Vector2(e,t),new Ci.Vector2(i,n),new Ci.Vector2(r,o));
  52133. this.curves.push(c),
  52134. this.actions.push({
  52135. action: "bezierCurveTo",
  52136. args: [e, t, i, n, r, o]
  52137. })
  52138. }
  52139. ,
  52140. Ci.Path.prototype.splineThru = function(e) {
  52141. var t = Array.prototype.slice.call(arguments)
  52142. , i = this.actions[this.actions.length - 1].args
  52143. , n = i[i.length - 2]
  52144. , r = i[i.length - 1]
  52145. , o = [new Ci.Vector2(n,r)];
  52146. Array.prototype.push.apply(o, e);
  52147. var a = new Ci.SplineCurve(o);
  52148. this.curves.push(a),
  52149. this.actions.push({
  52150. action: "splineThru",
  52151. args: t
  52152. })
  52153. }
  52154. ,
  52155. Ci.Path.prototype.arc = function(e, t, i, n, r, o) {
  52156. var a = this.actions[this.actions.length - 1].args
  52157. , s = a[a.length - 2]
  52158. , l = a[a.length - 1];
  52159. this.absarc(e + s, t + l, i, n, r, o)
  52160. }
  52161. ,
  52162. Ci.Path.prototype.absarc = function(e, t, i, n, r, o) {
  52163. this.absellipse(e, t, i, i, n, r, o)
  52164. }
  52165. ,
  52166. Ci.Path.prototype.ellipse = function(e, t, i, n, r, o, a, s) {
  52167. var l = this.actions[this.actions.length - 1].args
  52168. , c = l[l.length - 2]
  52169. , h = l[l.length - 1];
  52170. this.absellipse(e + c, t + h, i, n, r, o, a, s)
  52171. }
  52172. ,
  52173. Ci.Path.prototype.absellipse = function(e, t, i, n, r, o, a, s) {
  52174. var l = [e, t, i, n, r, o, a, s || 0]
  52175. , c = new Ci.EllipseCurve(e,t,i,n,r,o,a,s);
  52176. this.curves.push(c);
  52177. var h = c.getPoint(1);
  52178. l.push(h.x),
  52179. l.push(h.y),
  52180. this.actions.push({
  52181. action: "ellipse",
  52182. args: l
  52183. })
  52184. }
  52185. ,
  52186. Ci.Path.prototype.getSpacedPoints = function(e) {
  52187. e = e || 40;
  52188. for (var t = [], i = 0; i < e; i++)
  52189. t.push(this.getPoint(i / e));
  52190. return this.autoClose && t.push(t[0]),
  52191. t
  52192. }
  52193. ,
  52194. Ci.Path.prototype.getPoints = function(e) {
  52195. e = e || 12;
  52196. 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++) {
  52197. var v = this.actions[g]
  52198. , y = v.action
  52199. , A = v.args;
  52200. switch (y) {
  52201. case "moveTo":
  52202. case "lineTo":
  52203. f.push(new Ci.Vector2(A[0],A[1]));
  52204. break;
  52205. case "quadraticCurveTo":
  52206. t = A[2],
  52207. i = A[3],
  52208. o = A[0],
  52209. a = A[1],
  52210. l = 0 < f.length ? (s = (c = f[f.length - 1]).x,
  52211. c.y) : (s = (c = this.actions[g - 1].args)[c.length - 2],
  52212. c[c.length - 1]);
  52213. for (var C = 1; C <= e; C++) {
  52214. h = d(O = C / e, s, o, t),
  52215. u = d(O, l, a, i),
  52216. f.push(new Ci.Vector2(h,u))
  52217. }
  52218. break;
  52219. case "bezierCurveTo":
  52220. t = A[4],
  52221. i = A[5],
  52222. o = A[0],
  52223. a = A[1],
  52224. n = A[2],
  52225. r = A[3],
  52226. l = 0 < f.length ? (s = (c = f[f.length - 1]).x,
  52227. c.y) : (s = (c = this.actions[g - 1].args)[c.length - 2],
  52228. c[c.length - 1]);
  52229. for (C = 1; C <= e; C++) {
  52230. h = p(O = C / e, s, o, n, t),
  52231. u = p(O, l, a, r, i),
  52232. f.push(new Ci.Vector2(h,u))
  52233. }
  52234. break;
  52235. case "splineThru":
  52236. c = this.actions[g - 1].args;
  52237. var I = [new Ci.Vector2(c[c.length - 2],c[c.length - 1])]
  52238. , E = e * A[0].length;
  52239. I = I.concat(A[0]);
  52240. var _ = new Ci.SplineCurve(I);
  52241. for (C = 1; C <= E; C++)
  52242. f.push(_.getPointAt(C / E));
  52243. break;
  52244. case "arc":
  52245. var b = A[0]
  52246. , w = A[1]
  52247. , T = A[2]
  52248. , x = A[3]
  52249. , S = A[4]
  52250. , M = !!A[5]
  52251. , R = S - x
  52252. , P = 2 * e;
  52253. for (C = 1; C <= P; C++) {
  52254. var O = C / P;
  52255. M || (O = 1 - O),
  52256. L = x + O * R,
  52257. h = b + T * Math.cos(L),
  52258. u = w + T * Math.sin(L),
  52259. f.push(new Ci.Vector2(h,u))
  52260. }
  52261. break;
  52262. case "ellipse":
  52263. b = A[0],
  52264. w = A[1];
  52265. var L, D, N, F = A[2], B = A[3], V = (x = A[4],
  52266. S = A[5],
  52267. M = !!A[6],
  52268. A[7]);
  52269. R = S - x,
  52270. P = 2 * e;
  52271. 0 !== V && (D = Math.cos(V),
  52272. N = Math.sin(V));
  52273. for (C = 1; C <= P; C++) {
  52274. O = C / P;
  52275. if (M || (O = 1 - O),
  52276. L = x + O * R,
  52277. h = b + F * Math.cos(L),
  52278. u = w + B * Math.sin(L),
  52279. 0 !== V) {
  52280. var k = h;
  52281. h = (k - b) * D - (u - w) * N + b,
  52282. u = (k - b) * N + (u - w) * D + w
  52283. }
  52284. f.push(new Ci.Vector2(h,u))
  52285. }
  52286. }
  52287. }
  52288. var U = f[f.length - 1];
  52289. 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),
  52290. this.autoClose && f.push(f[0]),
  52291. f
  52292. }
  52293. ,
  52294. Ci.Path.prototype.toShapes = function(e, t) {
  52295. function i(e) {
  52296. for (var t = [], i = 0, n = e.length; i < n; i++) {
  52297. var r = e[i]
  52298. , o = new Ci.Shape;
  52299. o.actions = r.actions,
  52300. o.curves = r.curves,
  52301. t.push(o)
  52302. }
  52303. return t
  52304. }
  52305. function n(e, t) {
  52306. for (var i = t.length, n = !1, r = i - 1, o = 0; o < i; r = o++) {
  52307. var a = t[r]
  52308. , s = t[o]
  52309. , l = s.x - a.x
  52310. , c = s.y - a.y;
  52311. if (Math.abs(c) > Number.EPSILON) {
  52312. if (c < 0 && (a = t[o],
  52313. l = -l,
  52314. s = t[r],
  52315. c = -c),
  52316. e.y < a.y || e.y > s.y)
  52317. continue;
  52318. if (e.y === a.y) {
  52319. if (e.x === a.x)
  52320. return !0
  52321. } else {
  52322. var h = c * (e.x - a.x) - l * (e.y - a.y);
  52323. if (0 == h)
  52324. return !0;
  52325. if (h < 0)
  52326. continue;
  52327. n = !n
  52328. }
  52329. } else {
  52330. if (e.y !== a.y)
  52331. continue;
  52332. if (s.x <= e.x && e.x <= a.x || a.x <= e.x && e.x <= s.x)
  52333. return !0
  52334. }
  52335. }
  52336. return n
  52337. }
  52338. var r = Ci.ShapeUtils.isClockWise
  52339. , o = function(e) {
  52340. for (var t = [], i = new Ci.Path, n = 0, r = e.length; n < r; n++) {
  52341. var o = e[n]
  52342. , a = o.args
  52343. , s = o.action;
  52344. "moveTo" === s && 0 !== i.actions.length && (t.push(i),
  52345. i = new Ci.Path),
  52346. i[s].apply(i, a)
  52347. }
  52348. return 0 !== i.actions.length && t.push(i),
  52349. t
  52350. }(this.actions);
  52351. if (0 === o.length)
  52352. return [];
  52353. if (!0 === t)
  52354. return i(o);
  52355. var a, s, l, c = [];
  52356. if (1 === o.length)
  52357. return s = o[0],
  52358. (l = new Ci.Shape).actions = s.actions,
  52359. l.curves = s.curves,
  52360. c.push(l),
  52361. c;
  52362. var h = !r(o[0].getPoints());
  52363. h = e ? !h : h;
  52364. var u, d = [], p = [], f = [], g = 0;
  52365. p[g] = void 0,
  52366. f[g] = [];
  52367. for (var m = 0, v = o.length; m < v; m++)
  52368. a = r(u = (s = o[m]).getPoints()),
  52369. (a = e ? !a : a) ? (!h && p[g] && g++,
  52370. p[g] = {
  52371. s: new Ci.Shape,
  52372. p: u
  52373. },
  52374. p[g].s.actions = s.actions,
  52375. p[g].s.curves = s.curves,
  52376. h && g++,
  52377. f[g] = []) : f[g].push({
  52378. h: s,
  52379. p: u[0]
  52380. });
  52381. if (!p[0])
  52382. return i(o);
  52383. if (1 < p.length) {
  52384. for (var y = !1, A = [], C = 0, I = p.length; C < I; C++)
  52385. d[C] = [];
  52386. for (C = 0,
  52387. I = p.length; C < I; C++)
  52388. for (var E = f[C], _ = 0; _ < E.length; _++) {
  52389. for (var b = E[_], w = !0, T = 0; T < p.length; T++)
  52390. n(b.p, p[T].p) && (C !== T && A.push({
  52391. froms: C,
  52392. tos: T,
  52393. hole: _
  52394. }),
  52395. w ? (w = !1,
  52396. d[T].push(b)) : y = !0);
  52397. w && d[C].push(b)
  52398. }
  52399. 0 < A.length && (y || (f = d))
  52400. }
  52401. m = 0;
  52402. for (var x, S = p.length; m < S; m++) {
  52403. l = p[m].s,
  52404. c.push(l);
  52405. for (var M = 0, R = (x = f[m]).length; M < R; M++)
  52406. l.holes.push(x[M].h)
  52407. }
  52408. return c
  52409. }
  52410. ,
  52411. Ci.Shape = function() {
  52412. Ci.Path.apply(this, arguments),
  52413. this.holes = []
  52414. }
  52415. ,
  52416. Ci.Shape.prototype = Object.create(Ci.Path.prototype),
  52417. Ci.Shape.prototype.constructor = Ci.Shape,
  52418. Ci.Shape.prototype.extrude = function(e) {
  52419. return new Ci.ExtrudeGeometry(this,e)
  52420. }
  52421. ,
  52422. Ci.Shape.prototype.makeGeometry = function(e) {
  52423. return new Ci.ShapeGeometry(this,e)
  52424. }
  52425. ,
  52426. Ci.Shape.prototype.getPointsHoles = function(e) {
  52427. for (var t = [], i = 0, n = this.holes.length; i < n; i++)
  52428. t[i] = this.holes[i].getPoints(e);
  52429. return t
  52430. }
  52431. ,
  52432. Ci.Shape.prototype.extractAllPoints = function(e) {
  52433. return {
  52434. shape: this.getPoints(e),
  52435. holes: this.getPointsHoles(e)
  52436. }
  52437. }
  52438. ,
  52439. Ci.Shape.prototype.extractPoints = function(e) {
  52440. return this.extractAllPoints(e)
  52441. }
  52442. ,
  52443. Ci.LineCurve = function(e, t) {
  52444. this.v1 = e,
  52445. this.v2 = t
  52446. }
  52447. ,
  52448. Ci.LineCurve.prototype = Object.create(Ci.Curve.prototype),
  52449. Ci.LineCurve.prototype.constructor = Ci.LineCurve,
  52450. Ci.LineCurve.prototype.getPoint = function(e) {
  52451. var t = this.v2.clone().sub(this.v1);
  52452. return t.multiplyScalar(e).add(this.v1),
  52453. t
  52454. }
  52455. ,
  52456. Ci.LineCurve.prototype.getPointAt = function(e) {
  52457. return this.getPoint(e)
  52458. }
  52459. ,
  52460. Ci.LineCurve.prototype.getTangent = function(e) {
  52461. return this.v2.clone().sub(this.v1).normalize()
  52462. }
  52463. ,
  52464. Ci.QuadraticBezierCurve = function(e, t, i) {
  52465. this.v0 = e,
  52466. this.v1 = t,
  52467. this.v2 = i
  52468. }
  52469. ,
  52470. Ci.QuadraticBezierCurve.prototype = Object.create(Ci.Curve.prototype),
  52471. Ci.QuadraticBezierCurve.prototype.constructor = Ci.QuadraticBezierCurve,
  52472. Ci.QuadraticBezierCurve.prototype.getPoint = function(e) {
  52473. var t = Ci.ShapeUtils.b2;
  52474. 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))
  52475. }
  52476. ,
  52477. Ci.QuadraticBezierCurve.prototype.getTangent = function(e) {
  52478. var t = Ci.CurveUtils.tangentQuadraticBezier;
  52479. 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()
  52480. }
  52481. ,
  52482. Ci.CubicBezierCurve = function(e, t, i, n) {
  52483. this.v0 = e,
  52484. this.v1 = t,
  52485. this.v2 = i,
  52486. this.v3 = n
  52487. }
  52488. ,
  52489. Ci.CubicBezierCurve.prototype = Object.create(Ci.Curve.prototype),
  52490. Ci.CubicBezierCurve.prototype.constructor = Ci.CubicBezierCurve,
  52491. Ci.CubicBezierCurve.prototype.getPoint = function(e) {
  52492. var t = Ci.ShapeUtils.b3;
  52493. 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))
  52494. }
  52495. ,
  52496. Ci.CubicBezierCurve.prototype.getTangent = function(e) {
  52497. var t = Ci.CurveUtils.tangentCubicBezier;
  52498. 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()
  52499. }
  52500. ,
  52501. Ci.SplineCurve = function(e) {
  52502. this.points = null == e ? [] : e
  52503. }
  52504. ,
  52505. Ci.SplineCurve.prototype = Object.create(Ci.Curve.prototype),
  52506. Ci.SplineCurve.prototype.constructor = Ci.SplineCurve,
  52507. Ci.SplineCurve.prototype.getPoint = function(e) {
  52508. var t = this.points
  52509. , i = (t.length - 1) * e
  52510. , n = Math.floor(i)
  52511. , r = i - n
  52512. , o = t[0 === n ? n : n - 1]
  52513. , a = t[n]
  52514. , s = t[n > t.length - 2 ? t.length - 1 : n + 1]
  52515. , l = t[n > t.length - 3 ? t.length - 1 : n + 2]
  52516. , c = Ci.CurveUtils.interpolate;
  52517. return new Ci.Vector2(c(o.x, a.x, s.x, l.x, r),c(o.y, a.y, s.y, l.y, r))
  52518. }
  52519. ,
  52520. Ci.EllipseCurve = function(e, t, i, n, r, o, a, s) {
  52521. this.aX = e,
  52522. this.aY = t,
  52523. this.xRadius = i,
  52524. this.yRadius = n,
  52525. this.aStartAngle = r,
  52526. this.aEndAngle = o,
  52527. this.aClockwise = a,
  52528. this.aRotation = s || 0
  52529. }
  52530. ,
  52531. Ci.EllipseCurve.prototype = Object.create(Ci.Curve.prototype),
  52532. Ci.EllipseCurve.prototype.constructor = Ci.EllipseCurve,
  52533. Ci.EllipseCurve.prototype.getPoint = function(e) {
  52534. var t, i = this.aEndAngle - this.aStartAngle;
  52535. i < 0 && (i += 2 * Math.PI),
  52536. i > 2 * Math.PI && (i -= 2 * Math.PI),
  52537. t = !0 === this.aClockwise ? this.aEndAngle + (1 - e) * (2 * Math.PI - i) : this.aStartAngle + e * i;
  52538. var n = this.aX + this.xRadius * Math.cos(t)
  52539. , r = this.aY + this.yRadius * Math.sin(t);
  52540. if (0 !== this.aRotation) {
  52541. var o = Math.cos(this.aRotation)
  52542. , a = Math.sin(this.aRotation)
  52543. , s = n
  52544. , l = r;
  52545. n = (s - this.aX) * o - (l - this.aY) * a + this.aX,
  52546. r = (s - this.aX) * a + (l - this.aY) * o + this.aY
  52547. }
  52548. return new Ci.Vector2(n,r)
  52549. }
  52550. ,
  52551. Ci.ArcCurve = function(e, t, i, n, r, o) {
  52552. Ci.EllipseCurve.call(this, e, t, i, i, n, r, o)
  52553. }
  52554. ,
  52555. Ci.ArcCurve.prototype = Object.create(Ci.EllipseCurve.prototype),
  52556. Ci.ArcCurve.prototype.constructor = Ci.ArcCurve,
  52557. Ci.LineCurve3 = Ci.Curve.create(function(e, t) {
  52558. this.v1 = e,
  52559. this.v2 = t
  52560. }, function(e) {
  52561. var t = new Ci.Vector3;
  52562. return t.subVectors(this.v2, this.v1),
  52563. t.multiplyScalar(e),
  52564. t.add(this.v1),
  52565. t
  52566. }),
  52567. Ci.QuadraticBezierCurve3 = Ci.Curve.create(function(e, t, i) {
  52568. this.v0 = e,
  52569. this.v1 = t,
  52570. this.v2 = i
  52571. }, function(e) {
  52572. var t = Ci.ShapeUtils.b2;
  52573. 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))
  52574. }),
  52575. Ci.CubicBezierCurve3 = Ci.Curve.create(function(e, t, i, n) {
  52576. this.v0 = e,
  52577. this.v1 = t,
  52578. this.v2 = i,
  52579. this.v3 = n
  52580. }, function(e) {
  52581. var t = Ci.ShapeUtils.b3;
  52582. 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))
  52583. }),
  52584. Ci.SplineCurve3 = Ci.Curve.create(function(e) {
  52585. console.warn("THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3"),
  52586. this.points = null == e ? [] : e
  52587. }, function(e) {
  52588. var t = this.points
  52589. , i = (t.length - 1) * e
  52590. , n = Math.floor(i)
  52591. , r = i - n
  52592. , o = t[0 == n ? n : n - 1]
  52593. , a = t[n]
  52594. , s = t[n > t.length - 2 ? t.length - 1 : n + 1]
  52595. , l = t[n > t.length - 3 ? t.length - 1 : n + 2]
  52596. , c = Ci.CurveUtils.interpolate;
  52597. 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))
  52598. }),
  52599. Ci.CatmullRomCurve3 = (qt = new Ci.Vector3,
  52600. Xt = new xi,
  52601. Zt = new xi,
  52602. Kt = new xi,
  52603. xi.prototype.init = function(e, t, i, n) {
  52604. this.c0 = e,
  52605. this.c1 = i,
  52606. this.c2 = -3 * e + 3 * t - 2 * i - n,
  52607. this.c3 = 2 * e - 2 * t + i + n
  52608. }
  52609. ,
  52610. xi.prototype.initNonuniformCatmullRom = function(e, t, i, n, r, o, a) {
  52611. var s = (t - e) / r - (i - e) / (r + o) + (i - t) / o
  52612. , l = (i - t) / o - (n - t) / (o + a) + (n - i) / a;
  52613. s *= o,
  52614. l *= o,
  52615. this.init(t, i, s, l)
  52616. }
  52617. ,
  52618. xi.prototype.initCatmullRom = function(e, t, i, n, r) {
  52619. this.init(t, i, r * (i - e), r * (n - t))
  52620. }
  52621. ,
  52622. xi.prototype.calc = function(e) {
  52623. var t = e * e
  52624. , i = t * e;
  52625. return this.c0 + this.c1 * e + this.c2 * t + this.c3 * i
  52626. }
  52627. ,
  52628. Ci.Curve.create(function(e) {
  52629. this.points = e || [],
  52630. this.closed = !1
  52631. }, function(e) {
  52632. var t, i, n, r, o, a, s, l, c = this.points;
  52633. if ((r = c.length) < 2 && console.log("duh, you need at least 2 points"),
  52634. n = (t = (r - (this.closed ? 0 : 1)) * e) - (i = Math.floor(t)),
  52635. this.closed ? i += 0 < i ? 0 : (Math.floor(Math.abs(i) / c.length) + 1) * c.length : 0 === n && i === r - 1 && (i = r - 2,
  52636. n = 1),
  52637. o = this.closed || 0 < i ? c[(i - 1) % r] : (qt.subVectors(c[0], c[1]).add(c[0]),
  52638. qt),
  52639. a = c[i % r],
  52640. s = c[(i + 1) % r],
  52641. l = this.closed || i + 2 < r ? c[(i + 2) % r] : (qt.subVectors(c[r - 1], c[r - 2]).add(c[r - 1]),
  52642. qt),
  52643. void 0 === this.type || "centripetal" === this.type || "chordal" === this.type) {
  52644. var h = "chordal" === this.type ? .5 : .25
  52645. , u = Math.pow(o.distanceToSquared(a), h)
  52646. , d = Math.pow(a.distanceToSquared(s), h)
  52647. , p = Math.pow(s.distanceToSquared(l), h);
  52648. d < 1e-4 && (d = 1),
  52649. u < 1e-4 && (u = d),
  52650. p < 1e-4 && (p = d),
  52651. Xt.initNonuniformCatmullRom(o.x, a.x, s.x, l.x, u, d, p),
  52652. Zt.initNonuniformCatmullRom(o.y, a.y, s.y, l.y, u, d, p),
  52653. Kt.initNonuniformCatmullRom(o.z, a.z, s.z, l.z, u, d, p)
  52654. } else if ("catmullrom" === this.type) {
  52655. var f = void 0 !== this.tension ? this.tension : .5;
  52656. Xt.initCatmullRom(o.x, a.x, s.x, l.x, f),
  52657. Zt.initCatmullRom(o.y, a.y, s.y, l.y, f),
  52658. Kt.initCatmullRom(o.z, a.z, s.z, l.z, f)
  52659. }
  52660. return new Ci.Vector3(Xt.calc(n),Zt.calc(n),Kt.calc(n))
  52661. })),
  52662. Ci.ClosedSplineCurve3 = function(e) {
  52663. console.warn("THREE.ClosedSplineCurve3 has been deprecated. Please use THREE.CatmullRomCurve3."),
  52664. Ci.CatmullRomCurve3.call(this, e),
  52665. this.type = "catmullrom",
  52666. this.closed = !0
  52667. }
  52668. ,
  52669. Ci.ClosedSplineCurve3.prototype = Object.create(Ci.CatmullRomCurve3.prototype),
  52670. Ci.BoxGeometry = function(e, t, i, n, r, o) {
  52671. Ci.Geometry.call(this),
  52672. this.type = "BoxGeometry",
  52673. this.parameters = {
  52674. width: e,
  52675. height: t,
  52676. depth: i,
  52677. widthSegments: n,
  52678. heightSegments: r,
  52679. depthSegments: o
  52680. },
  52681. this.fromBufferGeometry(new Ci.BoxBufferGeometry(e,t,i,n,r,o)),
  52682. this.mergeVertices()
  52683. }
  52684. ,
  52685. Ci.BoxGeometry.prototype = Object.create(Ci.Geometry.prototype),
  52686. Ci.BoxGeometry.prototype.constructor = Ci.BoxGeometry,
  52687. Ci.CubeGeometry = Ci.BoxGeometry,
  52688. Ci.BoxBufferGeometry = function(e, t, i, n, r, o) {
  52689. function a(e, t, i, n, r, o, a, s, l, c, h) {
  52690. 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++)
  52691. for (var E = I * d - f, _ = 0; _ < m; _++) {
  52692. var b = _ * u - p;
  52693. C[e] = b * n,
  52694. C[t] = E * r,
  52695. C[i] = g,
  52696. P[D] = C.x,
  52697. P[D + 1] = C.y,
  52698. P[D + 2] = C.z,
  52699. C[e] = 0,
  52700. C[t] = 0,
  52701. C[i] = 0 < s ? 1 : -1,
  52702. O[D] = C.x,
  52703. O[D + 1] = C.y,
  52704. O[D + 2] = C.z,
  52705. L[N] = _ / l,
  52706. L[N + 1] = 1 - I / c,
  52707. D += 3,
  52708. N += 2,
  52709. y += 1
  52710. }
  52711. for (I = 0; I < c; I++)
  52712. for (_ = 0; _ < l; _++) {
  52713. var w = B + _ + m * I
  52714. , T = B + _ + m * (I + 1)
  52715. , x = B + (_ + 1) + m * (I + 1)
  52716. , S = B + (_ + 1) + m * I;
  52717. R[F] = w,
  52718. R[F + 1] = T,
  52719. R[F + 2] = S,
  52720. R[F + 3] = T,
  52721. R[F + 4] = x,
  52722. R[F + 5] = S,
  52723. F += 6,
  52724. A += 6
  52725. }
  52726. M.addGroup(V, A, h),
  52727. V += A,
  52728. B += y
  52729. }
  52730. Ci.BufferGeometry.call(this),
  52731. this.type = "BoxBufferGeometry",
  52732. this.parameters = {
  52733. width: e,
  52734. height: t,
  52735. depth: i,
  52736. widthSegments: n,
  52737. heightSegments: r,
  52738. depthSegments: o
  52739. };
  52740. var M = this;
  52741. n = Math.floor(n) || 1,
  52742. r = Math.floor(r) || 1,
  52743. o = Math.floor(o) || 1;
  52744. var s, l, c, h, u = (h = 0,
  52745. h += (s = n) * (l = r) * 2,
  52746. h += s * (c = o) * 2,
  52747. 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;
  52748. a("z", "y", "x", -1, -1, i, t, e, o, r, 0),
  52749. a("z", "y", "x", 1, -1, i, t, -e, o, r, 1),
  52750. a("x", "z", "y", 1, 1, e, i, t, n, o, 2),
  52751. a("x", "z", "y", 1, -1, e, i, -t, n, o, 3),
  52752. a("x", "y", "z", 1, -1, e, t, i, n, r, 4),
  52753. a("x", "y", "z", -1, -1, e, t, -i, n, r, 5),
  52754. this.setIndex(new Ci.BufferAttribute(R,1)),
  52755. this.addAttribute("position", new Ci.BufferAttribute(P,3)),
  52756. this.addAttribute("normal", new Ci.BufferAttribute(O,3)),
  52757. this.addAttribute("uv", new Ci.BufferAttribute(L,2))
  52758. }
  52759. ,
  52760. Ci.BoxBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  52761. Ci.BoxBufferGeometry.prototype.constructor = Ci.BoxBufferGeometry,
  52762. Ci.CircleGeometry = function(e, t, i, n) {
  52763. Ci.Geometry.call(this),
  52764. this.type = "CircleGeometry",
  52765. this.parameters = {
  52766. radius: e,
  52767. segments: t,
  52768. thetaStart: i,
  52769. thetaLength: n
  52770. },
  52771. this.fromBufferGeometry(new Ci.CircleBufferGeometry(e,t,i,n))
  52772. }
  52773. ,
  52774. Ci.CircleGeometry.prototype = Object.create(Ci.Geometry.prototype),
  52775. Ci.CircleGeometry.prototype.constructor = Ci.CircleGeometry,
  52776. Ci.CircleBufferGeometry = function(e, t, i, n) {
  52777. Ci.BufferGeometry.call(this),
  52778. this.type = "CircleBufferGeometry",
  52779. this.parameters = {
  52780. radius: e,
  52781. segments: t,
  52782. thetaStart: i,
  52783. thetaLength: n
  52784. },
  52785. e = e || 50,
  52786. t = void 0 !== t ? Math.max(3, t) : 8,
  52787. i = void 0 !== i ? i : 0,
  52788. n = void 0 !== n ? n : 2 * Math.PI;
  52789. var r = t + 2
  52790. , o = new Float32Array(3 * r)
  52791. , a = new Float32Array(3 * r)
  52792. , s = new Float32Array(2 * r);
  52793. a[2] = 1,
  52794. s[0] = .5,
  52795. s[1] = .5;
  52796. for (var l = 0, c = 3, h = 2; l <= t; l++,
  52797. c += 3,
  52798. h += 2) {
  52799. var u = i + l / t * n;
  52800. o[c] = e * Math.cos(u),
  52801. o[c + 1] = e * Math.sin(u),
  52802. a[c + 2] = 1,
  52803. s[h] = (o[c] / e + 1) / 2,
  52804. s[h + 1] = (o[c + 1] / e + 1) / 2
  52805. }
  52806. var d = [];
  52807. for (c = 1; c <= t; c++)
  52808. d.push(c, c + 1, 0);
  52809. this.setIndex(new Ci.BufferAttribute(new Uint16Array(d),1)),
  52810. this.addAttribute("position", new Ci.BufferAttribute(o,3)),
  52811. this.addAttribute("normal", new Ci.BufferAttribute(a,3)),
  52812. this.addAttribute("uv", new Ci.BufferAttribute(s,2)),
  52813. this.boundingSphere = new Ci.Sphere(new Ci.Vector3,e)
  52814. }
  52815. ,
  52816. Ci.CircleBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  52817. Ci.CircleBufferGeometry.prototype.constructor = Ci.CircleBufferGeometry,
  52818. Ci.CylinderBufferGeometry = function(p, f, g, m, v, e, y, A) {
  52819. function t(e) {
  52820. var t, i, n, r = new Ci.Vector2, o = new Ci.Vector3, a = !0 === e ? p : f, s = !0 === e ? 1 : -1;
  52821. for (i = b,
  52822. t = 1; t <= m; t++)
  52823. I.setXYZ(b, 0, x * s, 0),
  52824. E.setXYZ(b, 0, s, 0),
  52825. !0 === e ? (r.x = t / m,
  52826. r.y = 0) : (r.x = (t - 1) / m,
  52827. r.y = 1),
  52828. _.setXY(b, r.x, r.y),
  52829. b++;
  52830. for (n = b,
  52831. t = 0; t <= m; t++) {
  52832. var l = t / m;
  52833. o.x = a * Math.sin(l * A + y),
  52834. o.y = x * s,
  52835. o.z = a * Math.cos(l * A + y),
  52836. I.setXYZ(b, o.x, o.y, o.z),
  52837. E.setXYZ(b, 0, s, 0),
  52838. _.setXY(b, l, !0 === e ? 1 : 0),
  52839. b++
  52840. }
  52841. for (t = 0; t < m; t++) {
  52842. var c = i + t
  52843. , h = n + t;
  52844. !0 === e ? (C.setX(w, h),
  52845. w++,
  52846. C.setX(w, h + 1)) : (C.setX(w, h + 1),
  52847. w++,
  52848. C.setX(w, h)),
  52849. w++,
  52850. C.setX(w, c),
  52851. w++
  52852. }
  52853. }
  52854. Ci.BufferGeometry.call(this),
  52855. this.type = "CylinderBufferGeometry",
  52856. this.parameters = {
  52857. radiusTop: p,
  52858. radiusBottom: f,
  52859. height: g,
  52860. radialSegments: m,
  52861. heightSegments: v,
  52862. openEnded: e,
  52863. thetaStart: y,
  52864. thetaLength: A
  52865. },
  52866. p = void 0 !== p ? p : 20,
  52867. f = void 0 !== f ? f : 20,
  52868. g = void 0 !== g ? g : 100,
  52869. m = Math.floor(m) || 8,
  52870. v = Math.floor(v) || 1,
  52871. e = void 0 !== e && e,
  52872. y = void 0 !== y ? y : 0,
  52873. A = void 0 !== A ? A : 2 * Math.PI;
  52874. var i, n, r = (n = (m + 1) * (v + 1),
  52875. !1 === e && (n += 2 * (m + 1) + 2 * m),
  52876. n), o = (i = m * v * 2 * 3,
  52877. !1 === e && (i += 2 * m * 3),
  52878. 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;
  52879. (function() {
  52880. var e, t, i = new Ci.Vector3, n = new Ci.Vector3, r = (f - p) / g;
  52881. for (t = 0; t <= v; t++) {
  52882. var o = []
  52883. , a = t / v
  52884. , s = a * (f - p) + p;
  52885. for (e = 0; e <= m; e++) {
  52886. var l = e / m;
  52887. n.x = s * Math.sin(l * A + y),
  52888. n.y = -a * g + x,
  52889. n.z = s * Math.cos(l * A + y),
  52890. I.setXYZ(b, n.x, n.y, n.z),
  52891. i.copy(n),
  52892. (0 === p && 0 === t || 0 === f && t === v) && (i.x = Math.sin(l * A + y),
  52893. i.z = Math.cos(l * A + y)),
  52894. i.setY(Math.sqrt(i.x * i.x + i.z * i.z) * r).normalize(),
  52895. E.setXYZ(b, i.x, i.y, i.z),
  52896. _.setXY(b, l, 1 - a),
  52897. o.push(b),
  52898. b++
  52899. }
  52900. T.push(o)
  52901. }
  52902. for (e = 0; e < m; e++)
  52903. for (t = 0; t < v; t++) {
  52904. var c = T[t][e]
  52905. , h = T[t + 1][e]
  52906. , u = T[t + 1][e + 1]
  52907. , d = T[t][e + 1];
  52908. C.setX(w, c),
  52909. w++,
  52910. C.setX(w, h),
  52911. w++,
  52912. C.setX(w, d),
  52913. w++,
  52914. C.setX(w, h),
  52915. w++,
  52916. C.setX(w, u),
  52917. w++,
  52918. C.setX(w, d),
  52919. w++
  52920. }
  52921. }
  52922. )(),
  52923. !1 === e && (0 < p && t(!0),
  52924. 0 < f && t(!1)),
  52925. this.setIndex(C),
  52926. this.addAttribute("position", I),
  52927. this.addAttribute("normal", E),
  52928. this.addAttribute("uv", _)
  52929. }
  52930. ,
  52931. Ci.CylinderBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  52932. Ci.CylinderBufferGeometry.prototype.constructor = Ci.CylinderBufferGeometry,
  52933. Ci.CylinderGeometry = function(e, t, i, n, r, o, a, s) {
  52934. Ci.Geometry.call(this),
  52935. this.type = "CylinderGeometry",
  52936. this.parameters = {
  52937. radiusTop: e,
  52938. radiusBottom: t,
  52939. height: i,
  52940. radialSegments: n,
  52941. heightSegments: r,
  52942. openEnded: o,
  52943. thetaStart: a,
  52944. thetaLength: s
  52945. },
  52946. this.fromBufferGeometry(new Ci.CylinderBufferGeometry(e,t,i,n,r,o,a,s)),
  52947. this.mergeVertices()
  52948. }
  52949. ,
  52950. Ci.CylinderGeometry.prototype = Object.create(Ci.Geometry.prototype),
  52951. Ci.CylinderGeometry.prototype.constructor = Ci.CylinderGeometry,
  52952. Ci.EdgesGeometry = function(e, t) {
  52953. function i(e, t) {
  52954. return e - t
  52955. }
  52956. Ci.BufferGeometry.call(this),
  52957. t = void 0 !== t ? t : 1;
  52958. var n, r = Math.cos(Ci.Math.degToRad(t)), o = [0, 0], a = {}, s = ["a", "b", "c"];
  52959. e instanceof Ci.BufferGeometry ? (n = new Ci.Geometry).fromBufferGeometry(e) : n = e.clone(),
  52960. n.mergeVertices(),
  52961. n.computeFaceNormals();
  52962. for (var l = n.vertices, c = n.faces, h = 0, u = c.length; h < u; h++)
  52963. for (var d = c[h], p = 0; p < 3; p++) {
  52964. o[0] = d[s[p]],
  52965. o[1] = d[s[(p + 1) % 3]],
  52966. o.sort(i),
  52967. void 0 === a[g = o.toString()] ? a[g] = {
  52968. vert1: o[0],
  52969. vert2: o[1],
  52970. face1: h,
  52971. face2: void 0
  52972. } : a[g].face2 = h
  52973. }
  52974. var f = [];
  52975. for (var g in a) {
  52976. var m = a[g];
  52977. if (void 0 === m.face2 || c[m.face1].normal.dot(c[m.face2].normal) <= r) {
  52978. var v = l[m.vert1];
  52979. f.push(v.x),
  52980. f.push(v.y),
  52981. f.push(v.z),
  52982. v = l[m.vert2],
  52983. f.push(v.x),
  52984. f.push(v.y),
  52985. f.push(v.z)
  52986. }
  52987. }
  52988. this.addAttribute("position", new Ci.BufferAttribute(new Float32Array(f),3))
  52989. }
  52990. ,
  52991. Ci.EdgesGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  52992. Ci.EdgesGeometry.prototype.constructor = Ci.EdgesGeometry,
  52993. Ci.ExtrudeGeometry = function(e, t) {
  52994. return void 0 === e ? void (e = []) : (Ci.Geometry.call(this),
  52995. this.type = "ExtrudeGeometry",
  52996. e = Array.isArray(e) ? e : [e],
  52997. this.addShapeList(e, t),
  52998. void this.computeFaceNormals())
  52999. }
  53000. ;
  53001. Ci.ExtrudeGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53002. Ci.ExtrudeGeometry.prototype.constructor = Ci.ExtrudeGeometry,
  53003. Ci.ExtrudeGeometry.prototype.addShapeList = function(e, t) {
  53004. for (var i = e.length, n = 0; n < i; n++) {
  53005. var r = e[n];
  53006. this.addShape(r, t)
  53007. }
  53008. }
  53009. ,
  53010. Ci.ExtrudeGeometry.prototype.addShape = function(e, t) {
  53011. function i(e, t, i) {
  53012. return t || console.error("THREE.ExtrudeGeometry: vec does not exist"),
  53013. t.clone().multiplyScalar(i).add(e)
  53014. }
  53015. function n(e, t, i) {
  53016. 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;
  53017. if (Math.abs(u) > Number.EPSILON) {
  53018. var d = Math.sqrt(h)
  53019. , p = Math.sqrt(l * l + c * c)
  53020. , f = t.x - s / d
  53021. , g = t.y + a / d
  53022. , m = ((i.x - c / p - f) * c - (i.y + l / p - g) * l) / (a * c - s * l)
  53023. , v = (n = f + a * m - e.x) * n + (r = g + s * m - e.y) * r;
  53024. if (v <= 2)
  53025. return new Ci.Vector2(n,r);
  53026. o = Math.sqrt(v / 2)
  53027. } else {
  53028. var y = !1;
  53029. a > Number.EPSILON ? l > Number.EPSILON && (y = !0) : a < -Number.EPSILON ? l < -Number.EPSILON && (y = !0) : Math.sign(s) === Math.sign(c) && (y = !0),
  53030. o = y ? (n = -s,
  53031. r = a,
  53032. Math.sqrt(h)) : (n = a,
  53033. r = s,
  53034. Math.sqrt(h / 2))
  53035. }
  53036. return new Ci.Vector2(n / o,r / o)
  53037. }
  53038. function r(e, t) {
  53039. var i, n;
  53040. for (G = e.length; 0 <= --G; ) {
  53041. (n = (i = G) - 1) < 0 && (n = e.length - 1);
  53042. var r = 0
  53043. , o = A + 2 * m;
  53044. for (r = 0; r < o; r++) {
  53045. var a = U * r
  53046. , s = U * (r + 1);
  53047. l(t + i + a, t + n + a, t + n + s, t + i + s, e, r, o, i, n)
  53048. }
  53049. }
  53050. }
  53051. function o(e, t, i) {
  53052. T.vertices.push(new Ci.Vector3(e,t,i))
  53053. }
  53054. function a(e, t, i) {
  53055. e += x,
  53056. t += x,
  53057. i += x,
  53058. T.faces.push(new Ci.Face3(e,t,i,null,null,0));
  53059. var n = E.generateTopUV(T, e, t, i);
  53060. T.faceVertexUvs[0].push(n)
  53061. }
  53062. function l(e, t, i, n) {
  53063. e += x,
  53064. t += x,
  53065. i += x,
  53066. n += x,
  53067. T.faces.push(new Ci.Face3(e,t,n,null,null,1)),
  53068. T.faces.push(new Ci.Face3(t,i,n,null,null,1));
  53069. var r = E.generateSideWallUV(T, e, t, i, n);
  53070. T.faceVertexUvs[0].push([r[0], r[1], r[3]]),
  53071. T.faceVertexUvs[0].push([r[1], r[2], r[3]])
  53072. }
  53073. 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;
  53074. C && (s = C.getSpacedPoints(A),
  53075. v = !(I = !0),
  53076. c = void 0 !== t.frames ? t.frames : new Ci.TubeGeometry.FrenetFrames(C,A,!1),
  53077. h = new Ci.Vector3,
  53078. u = new Ci.Vector3,
  53079. d = new Ci.Vector3),
  53080. v || (g = f = m = 0);
  53081. var _, b, w, T = this, x = this.vertices.length, S = e.extractPoints(y), M = S.shape, R = S.holes, P = !Ci.ShapeUtils.isClockWise(M);
  53082. if (P) {
  53083. for (M = M.reverse(),
  53084. b = 0,
  53085. w = R.length; b < w; b++)
  53086. _ = R[b],
  53087. Ci.ShapeUtils.isClockWise(_) && (R[b] = _.reverse());
  53088. P = !1
  53089. }
  53090. var O = Ci.ShapeUtils.triangulateShape(M, R)
  53091. , L = M;
  53092. for (b = 0,
  53093. w = R.length; b < w; b++)
  53094. _ = R[b],
  53095. M = M.concat(_);
  53096. 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++,
  53097. j++,
  53098. Y++)
  53099. j === W && (j = 0),
  53100. Y === W && (Y = 0),
  53101. z[G] = n(L[G], L[j], L[Y]);
  53102. var q, X, Z = [], K = z.concat();
  53103. for (b = 0,
  53104. w = R.length; b < w; b++) {
  53105. for (_ = R[b],
  53106. q = [],
  53107. G = 0,
  53108. j = (W = _.length) - 1,
  53109. Y = G + 1; G < W; G++,
  53110. j++,
  53111. Y++)
  53112. j === W && (j = 0),
  53113. Y === W && (Y = 0),
  53114. q[G] = n(_[G], _[j], _[Y]);
  53115. Z.push(q),
  53116. K = K.concat(q)
  53117. }
  53118. for (D = 0; D < m; D++) {
  53119. for (B = f * (1 - (F = D / m)),
  53120. N = g * Math.sin(F * Math.PI / 2),
  53121. G = 0,
  53122. W = L.length; G < W; G++)
  53123. o((V = i(L[G], z[G], N)).x, V.y, -B);
  53124. for (b = 0,
  53125. w = R.length; b < w; b++)
  53126. for (_ = R[b],
  53127. q = Z[b],
  53128. G = 0,
  53129. W = _.length; G < W; G++)
  53130. o((V = i(_[G], q[G], N)).x, V.y, -B)
  53131. }
  53132. for (N = g,
  53133. G = 0; G < U; G++)
  53134. V = v ? i(M[G], K[G], N) : M[G],
  53135. I ? (u.copy(c.normals[0]).multiplyScalar(V.x),
  53136. h.copy(c.binormals[0]).multiplyScalar(V.y),
  53137. d.copy(s[0]).add(u).add(h),
  53138. o(d.x, d.y, d.z)) : o(V.x, V.y, 0);
  53139. for (X = 1; X <= A; X++)
  53140. for (G = 0; G < U; G++)
  53141. V = v ? i(M[G], K[G], N) : M[G],
  53142. I ? (u.copy(c.normals[X]).multiplyScalar(V.x),
  53143. h.copy(c.binormals[X]).multiplyScalar(V.y),
  53144. d.copy(s[X]).add(u).add(h),
  53145. o(d.x, d.y, d.z)) : o(V.x, V.y, p / A * X);
  53146. for (D = m - 1; 0 <= D; D--) {
  53147. for (B = f * (1 - (F = D / m)),
  53148. N = g * Math.sin(F * Math.PI / 2),
  53149. G = 0,
  53150. W = L.length; G < W; G++)
  53151. o((V = i(L[G], z[G], N)).x, V.y, p + B);
  53152. for (b = 0,
  53153. w = R.length; b < w; b++)
  53154. for (_ = R[b],
  53155. q = Z[b],
  53156. G = 0,
  53157. W = _.length; G < W; G++)
  53158. V = i(_[G], q[G], N),
  53159. I ? o(V.x, V.y + s[A - 1].y, s[A - 1].x + B) : o(V.x, V.y, p + B)
  53160. }
  53161. (function() {
  53162. if (v) {
  53163. var e = 0
  53164. , t = U * e;
  53165. for (G = 0; G < H; G++)
  53166. a((k = O[G])[2] + t, k[1] + t, k[0] + t);
  53167. for (t = U * (e = A + 2 * m),
  53168. G = 0; G < H; G++)
  53169. a((k = O[G])[0] + t, k[1] + t, k[2] + t)
  53170. } else {
  53171. for (G = 0; G < H; G++)
  53172. a((k = O[G])[2], k[1], k[0]);
  53173. for (G = 0; G < H; G++)
  53174. a((k = O[G])[0] + U * A, k[1] + U * A, k[2] + U * A)
  53175. }
  53176. }
  53177. )(),
  53178. function() {
  53179. var e = 0;
  53180. for (r(L, e),
  53181. e += L.length,
  53182. b = 0,
  53183. w = R.length; b < w; b++)
  53184. r(_ = R[b], e),
  53185. e += _.length
  53186. }()
  53187. }
  53188. ,
  53189. Ci.ExtrudeGeometry.WorldUVGenerator = {
  53190. generateTopUV: function(e, t, i, n) {
  53191. var r = e.vertices
  53192. , o = r[t]
  53193. , a = r[i]
  53194. , s = r[n];
  53195. return [new Ci.Vector2(o.x,o.y), new Ci.Vector2(a.x,a.y), new Ci.Vector2(s.x,s.y)]
  53196. },
  53197. generateSideWallUV: function(e, t, i, n, r) {
  53198. var o = e.vertices
  53199. , a = o[t]
  53200. , s = o[i]
  53201. , l = o[n]
  53202. , c = o[r];
  53203. 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)]
  53204. }
  53205. },
  53206. Ci.ShapeGeometry = function(e, t) {
  53207. Ci.Geometry.call(this),
  53208. !(this.type = "ShapeGeometry") === Array.isArray(e) && (e = [e]),
  53209. this.addShapeList(e, t),
  53210. this.computeFaceNormals()
  53211. }
  53212. ,
  53213. Ci.ShapeGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53214. Ci.ShapeGeometry.prototype.constructor = Ci.ShapeGeometry,
  53215. Ci.ShapeGeometry.prototype.addShapeList = function(e, t) {
  53216. for (var i = 0, n = e.length; i < n; i++)
  53217. this.addShape(e[i], t);
  53218. return this
  53219. }
  53220. ,
  53221. Ci.ShapeGeometry.prototype.addShape = function(e, t) {
  53222. void 0 === t && (t = {});
  53223. 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);
  53224. if (d) {
  53225. for (h = h.reverse(),
  53226. i = 0,
  53227. n = u.length; i < n; i++)
  53228. r = u[i],
  53229. Ci.ShapeUtils.isClockWise(r) && (u[i] = r.reverse());
  53230. d = !1
  53231. }
  53232. var p = Ci.ShapeUtils.triangulateShape(h, u);
  53233. for (i = 0,
  53234. n = u.length; i < n; i++)
  53235. r = u[i],
  53236. h = h.concat(r);
  53237. var f, g, m = h.length, v = p.length;
  53238. for (i = 0; i < m; i++)
  53239. f = h[i],
  53240. this.vertices.push(new Ci.Vector3(f.x,f.y,0));
  53241. for (i = 0; i < v; i++) {
  53242. var y = (g = p[i])[0] + l
  53243. , A = g[1] + l
  53244. , C = g[2] + l;
  53245. this.faces.push(new Ci.Face3(y,A,C,null,null,a)),
  53246. this.faceVertexUvs[0].push(s.generateTopUV(this, y, A, C))
  53247. }
  53248. }
  53249. ,
  53250. Ci.LatheBufferGeometry = function(e, t, i, n) {
  53251. Ci.BufferGeometry.call(this),
  53252. this.type = "LatheBufferGeometry",
  53253. this.parameters = {
  53254. points: e,
  53255. segments: t,
  53256. phiStart: i,
  53257. phiLength: n
  53258. },
  53259. t = Math.floor(t) || 12,
  53260. i = i || 0,
  53261. n = n || 2 * Math.PI,
  53262. n = Ci.Math.clamp(n, 0, 2 * Math.PI);
  53263. 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,
  53264. 1 / t), g = new Ci.Vector3, m = new Ci.Vector2;
  53265. for (o = 0; o <= t; o++) {
  53266. var v = i + o * f * n
  53267. , y = Math.sin(v)
  53268. , A = Math.cos(v);
  53269. for (a = 0; a <= e.length - 1; a++)
  53270. g.x = e[a].x * y,
  53271. g.y = e[a].y,
  53272. g.z = e[a].x * A,
  53273. h.setXYZ(d, g.x, g.y, g.z),
  53274. m.x = o / t,
  53275. m.y = a / (e.length - 1),
  53276. u.setXY(d, m.x, m.y),
  53277. d++
  53278. }
  53279. for (o = 0; o < t; o++)
  53280. for (a = 0; a < e.length - 1; a++) {
  53281. var C = r = a + o * e.length
  53282. , I = r + e.length
  53283. , E = r + e.length + 1
  53284. , _ = r + 1;
  53285. c.setX(p, C),
  53286. p++,
  53287. c.setX(p, I),
  53288. p++,
  53289. c.setX(p, _),
  53290. p++,
  53291. c.setX(p, I),
  53292. p++,
  53293. c.setX(p, E),
  53294. p++,
  53295. c.setX(p, _),
  53296. p++
  53297. }
  53298. if (this.setIndex(c),
  53299. this.addAttribute("position", h),
  53300. this.addAttribute("uv", u),
  53301. this.computeVertexNormals(),
  53302. n === 2 * Math.PI) {
  53303. var b = this.attributes.normal.array
  53304. , w = new Ci.Vector3
  53305. , T = new Ci.Vector3
  53306. , x = new Ci.Vector3;
  53307. for (r = t * e.length * 3,
  53308. a = o = 0; o < e.length; o++,
  53309. a += 3)
  53310. w.x = b[a + 0],
  53311. w.y = b[a + 1],
  53312. w.z = b[a + 2],
  53313. T.x = b[r + a + 0],
  53314. T.y = b[r + a + 1],
  53315. T.z = b[r + a + 2],
  53316. x.addVectors(w, T).normalize(),
  53317. b[a + 0] = b[r + a + 0] = x.x,
  53318. b[a + 1] = b[r + a + 1] = x.y,
  53319. b[a + 2] = b[r + a + 2] = x.z
  53320. }
  53321. }
  53322. ,
  53323. Ci.LatheBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53324. Ci.LatheBufferGeometry.prototype.constructor = Ci.LatheBufferGeometry,
  53325. Ci.LatheGeometry = function(e, t, i, n) {
  53326. Ci.Geometry.call(this),
  53327. this.type = "LatheGeometry",
  53328. this.parameters = {
  53329. points: e,
  53330. segments: t,
  53331. phiStart: i,
  53332. phiLength: n
  53333. },
  53334. this.fromBufferGeometry(new Ci.LatheBufferGeometry(e,t,i,n)),
  53335. this.mergeVertices()
  53336. }
  53337. ,
  53338. Ci.LatheGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53339. Ci.LatheGeometry.prototype.constructor = Ci.LatheGeometry,
  53340. Ci.PlaneGeometry = function(e, t, i, n) {
  53341. Ci.Geometry.call(this),
  53342. this.type = "PlaneGeometry",
  53343. this.parameters = {
  53344. width: e,
  53345. height: t,
  53346. widthSegments: i,
  53347. heightSegments: n
  53348. },
  53349. this.fromBufferGeometry(new Ci.PlaneBufferGeometry(e,t,i,n))
  53350. }
  53351. ,
  53352. Ci.PlaneGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53353. Ci.PlaneGeometry.prototype.constructor = Ci.PlaneGeometry,
  53354. Ci.PlaneBufferGeometry = function(e, t, i, n) {
  53355. Ci.BufferGeometry.call(this),
  53356. this.type = "PlaneBufferGeometry",
  53357. this.parameters = {
  53358. width: e,
  53359. height: t,
  53360. widthSegments: i,
  53361. heightSegments: n
  53362. };
  53363. 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++)
  53364. for (var y = v * u - o, A = 0; A < l; A++) {
  53365. var C = A * h - r;
  53366. d[g] = C,
  53367. d[g + 1] = -y,
  53368. p[g + 2] = 1,
  53369. f[m] = A / a,
  53370. f[m + 1] = 1 - v / s,
  53371. g += 3,
  53372. m += 2
  53373. }
  53374. g = 0;
  53375. var I = new (65535 < d.length / 3 ? Uint32Array : Uint16Array)(a * s * 6);
  53376. for (v = 0; v < s; v++)
  53377. for (A = 0; A < a; A++) {
  53378. var E = A + l * v
  53379. , _ = A + l * (v + 1)
  53380. , b = A + 1 + l * (v + 1)
  53381. , w = A + 1 + l * v;
  53382. I[g] = E,
  53383. I[g + 1] = _,
  53384. I[g + 2] = w,
  53385. I[g + 3] = _,
  53386. I[g + 4] = b,
  53387. I[g + 5] = w,
  53388. g += 6
  53389. }
  53390. this.setIndex(new Ci.BufferAttribute(I,1)),
  53391. this.addAttribute("position", new Ci.BufferAttribute(d,3)),
  53392. this.addAttribute("normal", new Ci.BufferAttribute(p,3)),
  53393. this.addAttribute("uv", new Ci.BufferAttribute(f,2))
  53394. }
  53395. ,
  53396. Ci.PlaneBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53397. Ci.PlaneBufferGeometry.prototype.constructor = Ci.PlaneBufferGeometry,
  53398. Ci.RingBufferGeometry = function(e, t, i, n, r, o) {
  53399. Ci.BufferGeometry.call(this),
  53400. this.type = "RingBufferGeometry",
  53401. this.parameters = {
  53402. innerRadius: e,
  53403. outerRadius: t,
  53404. thetaSegments: i,
  53405. phiSegments: n,
  53406. thetaStart: r,
  53407. thetaLength: o
  53408. },
  53409. e = e || 20,
  53410. t = t || 50,
  53411. r = void 0 !== r ? r : 0,
  53412. o = void 0 !== o ? o : 2 * Math.PI;
  53413. 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;
  53414. for (s = 0; s <= n; s++) {
  53415. for (l = 0; l <= i; l++)
  53416. a = r + l / i * o,
  53417. A.x = v * Math.cos(a),
  53418. A.y = v * Math.sin(a),
  53419. d.setXYZ(g, A.x, A.y, A.z),
  53420. p.setXYZ(g, 0, 0, 1),
  53421. C.x = (A.x / t + 1) / 2,
  53422. C.y = (A.y / t + 1) / 2,
  53423. f.setXY(g, C.x, C.y),
  53424. g++;
  53425. v += y
  53426. }
  53427. for (s = 0; s < n; s++) {
  53428. var I = s * (i + 1);
  53429. for (l = 0; l < i; l++) {
  53430. var E = a = l + I
  53431. , _ = a + i + 1
  53432. , b = a + i + 2
  53433. , w = a + 1;
  53434. u.setX(m, E),
  53435. m++,
  53436. u.setX(m, _),
  53437. m++,
  53438. u.setX(m, b),
  53439. m++,
  53440. u.setX(m, E),
  53441. m++,
  53442. u.setX(m, b),
  53443. m++,
  53444. u.setX(m, w),
  53445. m++
  53446. }
  53447. }
  53448. this.setIndex(u),
  53449. this.addAttribute("position", d),
  53450. this.addAttribute("normal", p),
  53451. this.addAttribute("uv", f)
  53452. }
  53453. ,
  53454. Ci.RingBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53455. Ci.RingBufferGeometry.prototype.constructor = Ci.RingBufferGeometry,
  53456. Ci.RingGeometry = function(e, t, i, n, r, o) {
  53457. Ci.Geometry.call(this),
  53458. this.type = "RingGeometry",
  53459. this.parameters = {
  53460. innerRadius: e,
  53461. outerRadius: t,
  53462. thetaSegments: i,
  53463. phiSegments: n,
  53464. thetaStart: r,
  53465. thetaLength: o
  53466. },
  53467. this.fromBufferGeometry(new Ci.RingBufferGeometry(e,t,i,n,r,o))
  53468. }
  53469. ,
  53470. Ci.RingGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53471. Ci.RingGeometry.prototype.constructor = Ci.RingGeometry,
  53472. Ci.SphereGeometry = function(e, t, i, n, r, o, a) {
  53473. Ci.Geometry.call(this),
  53474. this.type = "SphereGeometry",
  53475. this.parameters = {
  53476. radius: e,
  53477. widthSegments: t,
  53478. heightSegments: i,
  53479. phiStart: n,
  53480. phiLength: r,
  53481. thetaStart: o,
  53482. thetaLength: a
  53483. },
  53484. this.fromBufferGeometry(new Ci.SphereBufferGeometry(e,t,i,n,r,o,a))
  53485. }
  53486. ,
  53487. Ci.SphereGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53488. Ci.SphereGeometry.prototype.constructor = Ci.SphereGeometry,
  53489. Ci.SphereBufferGeometry = function(e, t, i, n, r, o, a) {
  53490. Ci.BufferGeometry.call(this),
  53491. this.type = "SphereBufferGeometry",
  53492. this.parameters = {
  53493. radius: e,
  53494. widthSegments: t,
  53495. heightSegments: i,
  53496. phiStart: n,
  53497. phiLength: r,
  53498. thetaStart: o,
  53499. thetaLength: a
  53500. },
  53501. e = e || 50,
  53502. t = Math.max(3, Math.floor(t) || 8),
  53503. i = Math.max(2, Math.floor(i) || 6),
  53504. n = void 0 !== n ? n : 0,
  53505. r = void 0 !== r ? r : 2 * Math.PI;
  53506. 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++) {
  53507. for (var m = [], v = g / i, y = 0; y <= t; y++) {
  53508. var A = y / t
  53509. , C = -e * Math.cos(n + A * r) * Math.sin(o + v * a)
  53510. , I = e * Math.cos(o + v * a)
  53511. , E = e * Math.sin(n + A * r) * Math.sin(o + v * a);
  53512. f.set(C, I, E).normalize(),
  53513. c.setXYZ(d, C, I, E),
  53514. h.setXYZ(d, f.x, f.y, f.z),
  53515. u.setXY(d, A, 1 - v),
  53516. m.push(d),
  53517. d++
  53518. }
  53519. p.push(m)
  53520. }
  53521. var _ = [];
  53522. for (g = 0; g < i; g++)
  53523. for (y = 0; y < t; y++) {
  53524. var b = p[g][y + 1]
  53525. , w = p[g][y]
  53526. , T = p[g + 1][y]
  53527. , x = p[g + 1][y + 1];
  53528. (0 !== g || 0 < o) && _.push(b, w, x),
  53529. (g !== i - 1 || s < Math.PI) && _.push(w, T, x)
  53530. }
  53531. this.setIndex(new (65535 < c.count ? Ci.Uint32Attribute : Ci.Uint16Attribute)(_,1)),
  53532. this.addAttribute("position", c),
  53533. this.addAttribute("normal", h),
  53534. this.addAttribute("uv", u),
  53535. this.boundingSphere = new Ci.Sphere(new Ci.Vector3,e)
  53536. }
  53537. ,
  53538. Ci.SphereBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53539. Ci.SphereBufferGeometry.prototype.constructor = Ci.SphereBufferGeometry,
  53540. Ci.TextGeometry = function(e, t) {
  53541. var i = (t = t || {}).font;
  53542. if (i instanceof Ci.Font == 0)
  53543. return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),
  53544. new Ci.Geometry;
  53545. var n = i.generateShapes(e, t.size, t.curveSegments);
  53546. t.amount = void 0 !== t.height ? t.height : 50,
  53547. void 0 === t.bevelThickness && (t.bevelThickness = 10),
  53548. void 0 === t.bevelSize && (t.bevelSize = 8),
  53549. void 0 === t.bevelEnabled && (t.bevelEnabled = !1),
  53550. Ci.ExtrudeGeometry.call(this, n, t),
  53551. this.type = "TextGeometry"
  53552. }
  53553. ,
  53554. Ci.TextGeometry.prototype = Object.create(Ci.ExtrudeGeometry.prototype),
  53555. Ci.TextGeometry.prototype.constructor = Ci.TextGeometry,
  53556. Ci.TorusBufferGeometry = function(e, t, i, n, r) {
  53557. Ci.BufferGeometry.call(this),
  53558. this.type = "TorusBufferGeometry",
  53559. this.parameters = {
  53560. radius: e,
  53561. tube: t,
  53562. radialSegments: i,
  53563. tubularSegments: n,
  53564. arc: r
  53565. },
  53566. e = e || 100,
  53567. t = t || 40,
  53568. i = Math.floor(i) || 8,
  53569. n = Math.floor(n) || 6,
  53570. r = r || 2 * Math.PI;
  53571. 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;
  53572. for (o = 0; o <= i; o++)
  53573. for (a = 0; a <= n; a++) {
  53574. var A = a / n * r
  53575. , C = o / i * Math.PI * 2;
  53576. v.x = (e + t * Math.cos(C)) * Math.cos(A),
  53577. v.y = (e + t * Math.cos(C)) * Math.sin(A),
  53578. v.z = t * Math.sin(C),
  53579. h[p] = v.x,
  53580. h[p + 1] = v.y,
  53581. h[p + 2] = v.z,
  53582. m.x = e * Math.cos(A),
  53583. m.y = e * Math.sin(A),
  53584. y.subVectors(v, m).normalize(),
  53585. u[p] = y.x,
  53586. u[p + 1] = y.y,
  53587. u[p + 2] = y.z,
  53588. d[f] = a / n,
  53589. d[f + 1] = o / i,
  53590. p += 3,
  53591. f += 2
  53592. }
  53593. for (o = 1; o <= i; o++)
  53594. for (a = 1; a <= n; a++) {
  53595. var I = (n + 1) * o + a - 1
  53596. , E = (n + 1) * (o - 1) + a - 1
  53597. , _ = (n + 1) * (o - 1) + a
  53598. , b = (n + 1) * o + a;
  53599. c[g] = I,
  53600. c[g + 1] = E,
  53601. c[g + 2] = b,
  53602. c[g + 3] = E,
  53603. c[g + 4] = _,
  53604. c[g + 5] = b,
  53605. g += 6
  53606. }
  53607. this.setIndex(new Ci.BufferAttribute(c,1)),
  53608. this.addAttribute("position", new Ci.BufferAttribute(h,3)),
  53609. this.addAttribute("normal", new Ci.BufferAttribute(u,3)),
  53610. this.addAttribute("uv", new Ci.BufferAttribute(d,2))
  53611. }
  53612. ,
  53613. Ci.TorusBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53614. Ci.TorusBufferGeometry.prototype.constructor = Ci.TorusBufferGeometry,
  53615. Ci.TorusGeometry = function(e, t, i, n, r) {
  53616. Ci.Geometry.call(this),
  53617. this.type = "TorusGeometry",
  53618. this.parameters = {
  53619. radius: e,
  53620. tube: t,
  53621. radialSegments: i,
  53622. tubularSegments: n,
  53623. arc: r
  53624. },
  53625. this.fromBufferGeometry(new Ci.TorusBufferGeometry(e,t,i,n,r))
  53626. }
  53627. ,
  53628. Ci.TorusGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53629. Ci.TorusGeometry.prototype.constructor = Ci.TorusGeometry,
  53630. Ci.TorusKnotBufferGeometry = function(e, t, i, n, r, o) {
  53631. function a(e, t, i, n, r) {
  53632. var o = Math.cos(e)
  53633. , a = Math.sin(e)
  53634. , s = i / t * e
  53635. , l = Math.cos(s);
  53636. r.x = n * (2 + l) * .5 * o,
  53637. r.y = n * (2 + l) * a * .5,
  53638. r.z = n * Math.sin(s) * .5
  53639. }
  53640. Ci.BufferGeometry.call(this),
  53641. this.type = "TorusKnotBufferGeometry",
  53642. this.parameters = {
  53643. radius: e,
  53644. tube: t,
  53645. tubularSegments: i,
  53646. radialSegments: n,
  53647. p: r,
  53648. q: o
  53649. },
  53650. e = e || 100,
  53651. t = t || 40,
  53652. i = Math.floor(i) || 64,
  53653. r = r || 2,
  53654. o = o || 3;
  53655. 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;
  53656. for (s = 0; s <= i; ++s) {
  53657. var w = s / i * r * Math.PI * 2;
  53658. for (a(w, r, o, e, C),
  53659. a(.01 + w, r, o, e, I),
  53660. _.subVectors(I, C),
  53661. b.addVectors(I, C),
  53662. E.crossVectors(_, b),
  53663. b.crossVectors(E, _),
  53664. E.normalize(),
  53665. b.normalize(),
  53666. l = 0; l <= n; ++l) {
  53667. var T = l / n * Math.PI * 2
  53668. , x = -t * Math.cos(T)
  53669. , S = t * Math.sin(T);
  53670. v.x = C.x + (x * b.x + S * E.x),
  53671. v.y = C.y + (x * b.y + S * E.y),
  53672. v.z = C.z + (x * b.z + S * E.z),
  53673. d.setXYZ(g, v.x, v.y, v.z),
  53674. y.subVectors(v, C).normalize(),
  53675. p.setXYZ(g, y.x, y.y, y.z),
  53676. A.x = s / i,
  53677. A.y = l / n,
  53678. f.setXY(g, A.x, A.y),
  53679. g++
  53680. }
  53681. }
  53682. for (l = 1; l <= i; l++)
  53683. for (s = 1; s <= n; s++) {
  53684. var M = (n + 1) * (l - 1) + (s - 1)
  53685. , R = (n + 1) * l + (s - 1)
  53686. , P = (n + 1) * l + s
  53687. , O = (n + 1) * (l - 1) + s;
  53688. u.setX(m, M),
  53689. m++,
  53690. u.setX(m, R),
  53691. m++,
  53692. u.setX(m, O),
  53693. m++,
  53694. u.setX(m, R),
  53695. m++,
  53696. u.setX(m, P),
  53697. m++,
  53698. u.setX(m, O),
  53699. m++
  53700. }
  53701. this.setIndex(u),
  53702. this.addAttribute("position", d),
  53703. this.addAttribute("normal", p),
  53704. this.addAttribute("uv", f)
  53705. }
  53706. ,
  53707. Ci.TorusKnotBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53708. Ci.TorusKnotBufferGeometry.prototype.constructor = Ci.TorusKnotBufferGeometry,
  53709. Ci.TorusKnotGeometry = function(e, t, i, n, r, o, a) {
  53710. Ci.Geometry.call(this),
  53711. this.type = "TorusKnotGeometry",
  53712. this.parameters = {
  53713. radius: e,
  53714. tube: t,
  53715. tubularSegments: i,
  53716. radialSegments: n,
  53717. p: r,
  53718. q: o
  53719. },
  53720. void 0 !== a && console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),
  53721. this.fromBufferGeometry(new Ci.TorusKnotBufferGeometry(e,t,i,n,r,o)),
  53722. this.mergeVertices()
  53723. }
  53724. ,
  53725. Ci.TorusKnotGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53726. Ci.TorusKnotGeometry.prototype.constructor = Ci.TorusKnotGeometry,
  53727. Ci.TubeGeometry = function(e, t, i, n, r, o) {
  53728. Ci.Geometry.call(this),
  53729. this.type = "TubeGeometry",
  53730. this.parameters = {
  53731. path: e,
  53732. segments: t,
  53733. radius: i,
  53734. radialSegments: n,
  53735. closed: r,
  53736. taper: o
  53737. },
  53738. t = t || 64,
  53739. i = i || 1,
  53740. n = n || 8,
  53741. r = r || !1,
  53742. o = o || Ci.TubeGeometry.NoTaper;
  53743. 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;
  53744. for (this.tangents = D,
  53745. this.normals = N,
  53746. this.binormals = F,
  53747. f = 0; f < P; f++)
  53748. for (M[f] = [],
  53749. l = f / (P - 1),
  53750. p = e.getPointAt(l),
  53751. D[f],
  53752. a = N[f],
  53753. s = F[f],
  53754. h = i * o(l),
  53755. g = 0; g < n; g++)
  53756. c = g / n * 2 * Math.PI,
  53757. u = -h * Math.cos(c),
  53758. d = h * Math.sin(c),
  53759. O.copy(p),
  53760. O.x += u * a.x + d * s.x,
  53761. O.y += u * a.y + d * s.y,
  53762. O.z += u * a.z + d * s.z,
  53763. M[f][g] = (T = O.x,
  53764. x = O.y,
  53765. S = O.z,
  53766. R.vertices.push(new Ci.Vector3(T,x,S)) - 1);
  53767. for (f = 0; f < t; f++)
  53768. for (g = 0; g < n; g++)
  53769. m = r ? (f + 1) % t : f + 1,
  53770. v = (g + 1) % n,
  53771. y = M[f][g],
  53772. A = M[m][g],
  53773. C = M[m][v],
  53774. I = M[f][v],
  53775. E = new Ci.Vector2(f / t,g / n),
  53776. _ = new Ci.Vector2((f + 1) / t,g / n),
  53777. b = new Ci.Vector2((f + 1) / t,(g + 1) / n),
  53778. w = new Ci.Vector2(f / t,(g + 1) / n),
  53779. this.faces.push(new Ci.Face3(y,A,I)),
  53780. this.faceVertexUvs[0].push([E, _, w]),
  53781. this.faces.push(new Ci.Face3(A,C,I)),
  53782. this.faceVertexUvs[0].push([_.clone(), b, w.clone()]);
  53783. this.computeFaceNormals(),
  53784. this.computeVertexNormals()
  53785. }
  53786. ,
  53787. Ci.TubeGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53788. Ci.TubeGeometry.prototype.constructor = Ci.TubeGeometry,
  53789. Ci.TubeGeometry.NoTaper = function(e) {
  53790. return 1
  53791. }
  53792. ,
  53793. Ci.TubeGeometry.SinusoidalTaper = function(e) {
  53794. return Math.sin(Math.PI * e)
  53795. }
  53796. ,
  53797. Ci.TubeGeometry.FrenetFrames = function(e, t, i) {
  53798. 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;
  53799. for (this.tangents = u,
  53800. this.normals = d,
  53801. this.binormals = p,
  53802. l = 0; l < m; l++)
  53803. c = l / (m - 1),
  53804. u[l] = e.getTangentAt(c),
  53805. u[l].normalize();
  53806. for (d[0] = new Ci.Vector3,
  53807. p[0] = new Ci.Vector3,
  53808. r = Number.MAX_VALUE,
  53809. o = Math.abs(u[0].x),
  53810. a = Math.abs(u[0].y),
  53811. s = Math.abs(u[0].z),
  53812. o <= r && (r = o,
  53813. h.set(1, 0, 0)),
  53814. a <= r && (r = a,
  53815. h.set(0, 1, 0)),
  53816. s <= r && h.set(0, 0, 1),
  53817. f.crossVectors(u[0], h).normalize(),
  53818. d[0].crossVectors(u[0], f),
  53819. p[0].crossVectors(u[0], d[0]),
  53820. l = 1; l < m; l++)
  53821. d[l] = d[l - 1].clone(),
  53822. p[l] = p[l - 1].clone(),
  53823. f.crossVectors(u[l - 1], u[l]),
  53824. f.length() > Number.EPSILON && (f.normalize(),
  53825. n = Math.acos(Ci.Math.clamp(u[l - 1].dot(u[l]), -1, 1)),
  53826. d[l].applyMatrix4(g.makeRotationAxis(f, n))),
  53827. p[l].crossVectors(u[l], d[l]);
  53828. if (i)
  53829. for (n = Math.acos(Ci.Math.clamp(d[0].dot(d[m - 1]), -1, 1)),
  53830. n /= m - 1,
  53831. 0 < u[0].dot(f.crossVectors(d[0], d[m - 1])) && (n = -n),
  53832. l = 1; l < m; l++)
  53833. d[l].applyMatrix4(g.makeRotationAxis(u[l], n * l)),
  53834. p[l].crossVectors(u[l], d[l])
  53835. }
  53836. ,
  53837. Ci.PolyhedronGeometry = function(e, t, i, n) {
  53838. function f(e) {
  53839. var t = e.normalize().clone();
  53840. t.index = m.vertices.push(t) - 1;
  53841. var i = a(e) / 2 / Math.PI + .5
  53842. , n = function(e) {
  53843. return Math.atan2(-e.y, Math.sqrt(e.x * e.x + e.z * e.z))
  53844. }(e) / Math.PI + .5;
  53845. return t.uv = new Ci.Vector2(i,1 - n),
  53846. t
  53847. }
  53848. function g(e, t, i, n) {
  53849. var r = new Ci.Face3(e.index,t.index,i.index,[e.clone(), t.clone(), i.clone()],void 0,n);
  53850. m.faces.push(r),
  53851. y.copy(e).add(t).add(i).divideScalar(3);
  53852. var o = a(y);
  53853. m.faceVertexUvs[0].push([s(e.uv, e, o), s(t.uv, t, o), s(i.uv, i, o)])
  53854. }
  53855. function r(e, t) {
  53856. 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++) {
  53857. a[l] = [];
  53858. 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++)
  53859. a[l][d] = 0 === d && l === i ? c : f(c.clone().lerp(h, d / u))
  53860. }
  53861. for (l = 0; l < i; l++)
  53862. for (d = 0; d < 2 * (i - l) - 1; d++) {
  53863. var p = Math.floor(d / 2);
  53864. 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)
  53865. }
  53866. }
  53867. function a(e) {
  53868. return Math.atan2(e.z, -e.x)
  53869. }
  53870. function s(e, t, i) {
  53871. return i < 0 && 1 === e.x && (e = new Ci.Vector2(e.x - 1,e.y)),
  53872. 0 === t.x && 0 === t.z && (e = new Ci.Vector2(i / 2 / Math.PI + .5,e.y)),
  53873. e.clone()
  53874. }
  53875. Ci.Geometry.call(this),
  53876. this.type = "PolyhedronGeometry",
  53877. this.parameters = {
  53878. vertices: e,
  53879. indices: t,
  53880. radius: i,
  53881. detail: n
  53882. },
  53883. i = i || 1,
  53884. n = n || 0;
  53885. for (var m = this, o = 0, l = e.length; o < l; o += 3)
  53886. f(new Ci.Vector3(e[o],e[o + 1],e[o + 2]));
  53887. var c = this.vertices
  53888. , h = []
  53889. , u = (o = 0,
  53890. 0);
  53891. for (l = t.length; o < l; o += 3,
  53892. u++) {
  53893. var d = c[t[o]]
  53894. , p = c[t[o + 1]]
  53895. , v = c[t[o + 2]];
  53896. h[u] = new Ci.Face3(d.index,p.index,v.index,[d.clone(), p.clone(), v.clone()],void 0,u)
  53897. }
  53898. var y = new Ci.Vector3;
  53899. for (o = 0,
  53900. l = h.length; o < l; o++)
  53901. r(h[o], n);
  53902. for (o = 0,
  53903. l = this.faceVertexUvs[0].length; o < l; o++) {
  53904. var A = this.faceVertexUvs[0][o]
  53905. , C = A[0].x
  53906. , I = A[1].x
  53907. , E = A[2].x
  53908. , _ = Math.max(C, I, E)
  53909. , b = Math.min(C, I, E);
  53910. .9 < _ && b < .1 && (C < .2 && (A[0].x += 1),
  53911. I < .2 && (A[1].x += 1),
  53912. E < .2 && (A[2].x += 1))
  53913. }
  53914. for (o = 0,
  53915. l = this.vertices.length; o < l; o++)
  53916. this.vertices[o].multiplyScalar(i);
  53917. this.mergeVertices(),
  53918. this.computeFaceNormals(),
  53919. this.boundingSphere = new Ci.Sphere(new Ci.Vector3,i)
  53920. }
  53921. ,
  53922. Ci.PolyhedronGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53923. Ci.PolyhedronGeometry.prototype.constructor = Ci.PolyhedronGeometry,
  53924. Ci.DodecahedronGeometry = function(e, t) {
  53925. var i = (1 + Math.sqrt(5)) / 2
  53926. , n = 1 / i
  53927. , 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];
  53928. 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),
  53929. this.type = "DodecahedronGeometry",
  53930. this.parameters = {
  53931. radius: e,
  53932. detail: t
  53933. }
  53934. }
  53935. ,
  53936. Ci.DodecahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  53937. Ci.DodecahedronGeometry.prototype.constructor = Ci.DodecahedronGeometry,
  53938. Ci.IcosahedronGeometry = function(e, t) {
  53939. var i = (1 + Math.sqrt(5)) / 2
  53940. , 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];
  53941. 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),
  53942. this.type = "IcosahedronGeometry",
  53943. this.parameters = {
  53944. radius: e,
  53945. detail: t
  53946. }
  53947. }
  53948. ,
  53949. Ci.IcosahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  53950. Ci.IcosahedronGeometry.prototype.constructor = Ci.IcosahedronGeometry,
  53951. Ci.OctahedronGeometry = function(e, t) {
  53952. 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),
  53953. this.type = "OctahedronGeometry",
  53954. this.parameters = {
  53955. radius: e,
  53956. detail: t
  53957. }
  53958. }
  53959. ,
  53960. Ci.OctahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  53961. Ci.OctahedronGeometry.prototype.constructor = Ci.OctahedronGeometry,
  53962. Ci.TetrahedronGeometry = function(e, t) {
  53963. 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),
  53964. this.type = "TetrahedronGeometry",
  53965. this.parameters = {
  53966. radius: e,
  53967. detail: t
  53968. }
  53969. }
  53970. ,
  53971. Ci.TetrahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  53972. Ci.TetrahedronGeometry.prototype.constructor = Ci.TetrahedronGeometry,
  53973. Ci.ParametricGeometry = function(e, t, i) {
  53974. Ci.Geometry.call(this),
  53975. this.type = "ParametricGeometry",
  53976. this.parameters = {
  53977. func: e,
  53978. slices: t,
  53979. stacks: i
  53980. };
  53981. 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;
  53982. for (n = 0; n <= i; n++)
  53983. for (a = n / i,
  53984. r = 0; r <= t; r++)
  53985. o = e(r / t, a),
  53986. g.push(o);
  53987. for (n = 0; n < i; n++)
  53988. for (r = 0; r < t; r++)
  53989. l = (s = n * y + r) + 1,
  53990. c = (n + 1) * y + r + 1,
  53991. h = (n + 1) * y + r,
  53992. u = new Ci.Vector2(r / t,n / i),
  53993. d = new Ci.Vector2((r + 1) / t,n / i),
  53994. p = new Ci.Vector2((r + 1) / t,(n + 1) / i),
  53995. f = new Ci.Vector2(r / t,(n + 1) / i),
  53996. m.push(new Ci.Face3(s,l,h)),
  53997. v.push([u, d, f]),
  53998. m.push(new Ci.Face3(l,c,h)),
  53999. v.push([d.clone(), p, f.clone()]);
  54000. this.computeFaceNormals(),
  54001. this.computeVertexNormals()
  54002. }
  54003. ,
  54004. Ci.ParametricGeometry.prototype = Object.create(Ci.Geometry.prototype),
  54005. Ci.ParametricGeometry.prototype.constructor = Ci.ParametricGeometry,
  54006. Ci.WireframeGeometry = function(e) {
  54007. function t(e, t) {
  54008. return e - t
  54009. }
  54010. Ci.BufferGeometry.call(this);
  54011. var i = [0, 0]
  54012. , n = {}
  54013. , r = ["a", "b", "c"];
  54014. if (e instanceof Ci.Geometry) {
  54015. for (var o = e.vertices, a = e.faces, s = 0, l = new Uint32Array(6 * a.length), c = 0, h = a.length; c < h; c++)
  54016. for (var u = a[c], d = 0; d < 3; d++) {
  54017. i[0] = u[r[d]],
  54018. i[1] = u[r[(d + 1) % 3]],
  54019. i.sort(t),
  54020. void 0 === n[E = i.toString()] && (l[2 * s] = i[0],
  54021. l[2 * s + 1] = i[1],
  54022. n[E] = !0,
  54023. s++)
  54024. }
  54025. var p = new Float32Array(2 * s * 3);
  54026. for (c = 0,
  54027. h = s; c < h; c++)
  54028. for (d = 0; d < 2; d++) {
  54029. var f = o[l[2 * c + d]];
  54030. p[(_ = 6 * c + 3 * d) + 0] = f.x,
  54031. p[_ + 1] = f.y,
  54032. p[_ + 2] = f.z
  54033. }
  54034. this.addAttribute("position", new Ci.BufferAttribute(p,3))
  54035. } else if (e instanceof Ci.BufferGeometry)
  54036. if (null !== e.index) {
  54037. var g = e.index.array
  54038. , m = (o = e.attributes.position,
  54039. e.groups);
  54040. s = 0;
  54041. 0 === m.length && e.addGroup(0, g.length);
  54042. l = new Uint32Array(2 * g.length);
  54043. for (var v = 0, y = m.length; v < y; ++v)
  54044. for (var A = m[v], C = A.start, I = (c = C,
  54045. C + A.count); c < I; c += 3)
  54046. for (d = 0; d < 3; d++) {
  54047. var E;
  54048. i[0] = g[c + d],
  54049. i[1] = g[c + (d + 1) % 3],
  54050. i.sort(t),
  54051. void 0 === n[E = i.toString()] && (l[2 * s] = i[0],
  54052. l[2 * s + 1] = i[1],
  54053. n[E] = !0,
  54054. s++)
  54055. }
  54056. for (p = new Float32Array(2 * s * 3),
  54057. c = 0,
  54058. h = s; c < h; c++)
  54059. for (d = 0; d < 2; d++) {
  54060. var _ = 6 * c + 3 * d
  54061. , b = l[2 * c + d];
  54062. p[_ + 0] = o.getX(b),
  54063. p[_ + 1] = o.getY(b),
  54064. p[_ + 2] = o.getZ(b)
  54065. }
  54066. this.addAttribute("position", new Ci.BufferAttribute(p,3))
  54067. } else {
  54068. var w = (s = (o = e.attributes.position.array).length / 3) / 3;
  54069. for (p = new Float32Array(2 * s * 3),
  54070. c = 0,
  54071. h = w; c < h; c++)
  54072. for (d = 0; d < 3; d++) {
  54073. var T = 9 * c + 3 * d;
  54074. p[(_ = 18 * c + 6 * d) + 0] = o[T],
  54075. p[_ + 1] = o[1 + T],
  54076. p[_ + 2] = o[2 + T];
  54077. b = 9 * c + (d + 1) % 3 * 3;
  54078. p[_ + 3] = o[b],
  54079. p[_ + 4] = o[b + 1],
  54080. p[_ + 5] = o[b + 2]
  54081. }
  54082. this.addAttribute("position", new Ci.BufferAttribute(p,3))
  54083. }
  54084. }
  54085. ,
  54086. Ci.WireframeGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  54087. Ci.WireframeGeometry.prototype.constructor = Ci.WireframeGeometry,
  54088. Ci.AxisHelper = function(e) {
  54089. e = e || 1;
  54090. var t = new Float32Array([0, 0, 0, e, 0, 0, 0, 0, 0, 0, e, 0, 0, 0, 0, 0, 0, e])
  54091. , i = new Float32Array([1, 0, 0, 1, .6, 0, 0, 1, 0, .6, 1, 0, 0, 0, 1, 0, .6, 1])
  54092. , n = new Ci.BufferGeometry;
  54093. n.addAttribute("position", new Ci.BufferAttribute(t,3)),
  54094. n.addAttribute("color", new Ci.BufferAttribute(i,3));
  54095. var r = new Ci.LineBasicMaterial({
  54096. vertexColors: Ci.VertexColors
  54097. });
  54098. Ci.LineSegments.call(this, n, r)
  54099. }
  54100. ,
  54101. Ci.AxisHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54102. Ci.AxisHelper.prototype.constructor = Ci.AxisHelper,
  54103. Ci.ArrowHelper = function() {
  54104. var a = new Ci.Geometry;
  54105. a.vertices.push(new Ci.Vector3(0,0,0), new Ci.Vector3(0,1,0));
  54106. var s = new Ci.CylinderGeometry(0,.5,1,5,1);
  54107. return s.translate(0, -.5, 0),
  54108. function(e, t, i, n, r, o) {
  54109. Ci.Object3D.call(this),
  54110. void 0 === n && (n = 16776960),
  54111. void 0 === i && (i = 1),
  54112. void 0 === r && (r = .2 * i),
  54113. void 0 === o && (o = .2 * r),
  54114. this.position.copy(t),
  54115. this.line = new Ci.Line(a,new Ci.LineBasicMaterial({
  54116. color: n
  54117. })),
  54118. this.line.matrixAutoUpdate = !1,
  54119. this.add(this.line),
  54120. this.cone = new Ci.Mesh(s,new Ci.MeshBasicMaterial({
  54121. color: n
  54122. })),
  54123. this.cone.matrixAutoUpdate = !1,
  54124. this.add(this.cone),
  54125. this.setDirection(e),
  54126. this.setLength(i, r, o)
  54127. }
  54128. }(),
  54129. Ci.ArrowHelper.prototype = Object.create(Ci.Object3D.prototype),
  54130. Ci.ArrowHelper.prototype.constructor = Ci.ArrowHelper,
  54131. Ci.ArrowHelper.prototype.setDirection = (Ai = new Ci.Vector3,
  54132. function(e) {
  54133. .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(),
  54134. yi = Math.acos(e.y),
  54135. this.quaternion.setFromAxisAngle(Ai, yi))
  54136. }
  54137. ),
  54138. Ci.ArrowHelper.prototype.setLength = function(e, t, i) {
  54139. void 0 === t && (t = .2 * e),
  54140. void 0 === i && (i = .2 * t),
  54141. this.line.scale.set(1, Math.max(0, e - t), 1),
  54142. this.line.updateMatrix(),
  54143. this.cone.scale.set(i, t, i),
  54144. this.cone.position.y = e,
  54145. this.cone.updateMatrix()
  54146. }
  54147. ,
  54148. Ci.ArrowHelper.prototype.setColor = function(e) {
  54149. this.line.material.color.set(e),
  54150. this.cone.material.color.set(e)
  54151. }
  54152. ,
  54153. Ci.BoxHelper = function(e) {
  54154. 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])
  54155. , i = new Float32Array(24)
  54156. , n = new Ci.BufferGeometry;
  54157. n.setIndex(new Ci.BufferAttribute(t,1)),
  54158. n.addAttribute("position", new Ci.BufferAttribute(i,3)),
  54159. Ci.LineSegments.call(this, n, new Ci.LineBasicMaterial({
  54160. color: 16776960
  54161. })),
  54162. void 0 !== e && this.update(e)
  54163. }
  54164. ,
  54165. Ci.BoxHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54166. Ci.BoxHelper.prototype.constructor = Ci.BoxHelper,
  54167. Ci.BoxHelper.prototype.update = (vi = new Ci.Box3,
  54168. function(e) {
  54169. if (vi.setFromObject(e),
  54170. !vi.isEmpty()) {
  54171. var t = vi.min
  54172. , i = vi.max
  54173. , n = this.geometry.attributes.position
  54174. , r = n.array;
  54175. r[0] = i.x,
  54176. r[1] = i.y,
  54177. r[2] = i.z,
  54178. r[3] = t.x,
  54179. r[4] = i.y,
  54180. r[5] = i.z,
  54181. r[6] = t.x,
  54182. r[7] = t.y,
  54183. r[8] = i.z,
  54184. r[9] = i.x,
  54185. r[10] = t.y,
  54186. r[11] = i.z,
  54187. r[12] = i.x,
  54188. r[13] = i.y,
  54189. r[14] = t.z,
  54190. r[15] = t.x,
  54191. r[16] = i.y,
  54192. r[17] = t.z,
  54193. r[18] = t.x,
  54194. r[19] = t.y,
  54195. r[20] = t.z,
  54196. r[21] = i.x,
  54197. r[22] = t.y,
  54198. r[23] = t.z,
  54199. n.needsUpdate = !0,
  54200. this.geometry.computeBoundingSphere()
  54201. }
  54202. }
  54203. ),
  54204. Ci.BoundingBoxHelper = function(e, t) {
  54205. var i = void 0 !== t ? t : 8947848;
  54206. this.object = e,
  54207. this.box = new Ci.Box3,
  54208. Ci.Mesh.call(this, new Ci.BoxGeometry(1,1,1), new Ci.MeshBasicMaterial({
  54209. color: i,
  54210. wireframe: !0
  54211. }))
  54212. }
  54213. ,
  54214. Ci.BoundingBoxHelper.prototype = Object.create(Ci.Mesh.prototype),
  54215. Ci.BoundingBoxHelper.prototype.constructor = Ci.BoundingBoxHelper,
  54216. Ci.BoundingBoxHelper.prototype.update = function() {
  54217. this.box.setFromObject(this.object),
  54218. this.box.size(this.scale),
  54219. this.box.center(this.position)
  54220. }
  54221. ,
  54222. Ci.CameraHelper = function(e) {
  54223. function t(e, t, i) {
  54224. n(e, i),
  54225. n(t, i)
  54226. }
  54227. function n(e, t) {
  54228. i.vertices.push(new Ci.Vector3),
  54229. i.colors.push(new Ci.Color(t)),
  54230. void 0 === o[e] && (o[e] = []),
  54231. o[e].push(i.vertices.length - 1)
  54232. }
  54233. var i = new Ci.Geometry
  54234. , r = new Ci.LineBasicMaterial({
  54235. color: 16777215,
  54236. vertexColors: Ci.FaceColors
  54237. })
  54238. , o = {}
  54239. , a = 16755200
  54240. , s = 16711680
  54241. , l = 3355443;
  54242. t("n1", "n2", a),
  54243. t("n2", "n4", a),
  54244. t("n4", "n3", a),
  54245. t("n3", "n1", a),
  54246. t("f1", "f2", a),
  54247. t("f2", "f4", a),
  54248. t("f4", "f3", a),
  54249. t("f3", "f1", a),
  54250. t("n1", "f1", a),
  54251. t("n2", "f2", a),
  54252. t("n3", "f3", a),
  54253. t("n4", "f4", a),
  54254. t("p", "n1", s),
  54255. t("p", "n2", s),
  54256. t("p", "n3", s),
  54257. t("p", "n4", s),
  54258. t("u1", "u2", 43775),
  54259. t("u2", "u3", 43775),
  54260. t("u3", "u1", 43775),
  54261. t("c", "t", 16777215),
  54262. t("p", "c", l),
  54263. t("cn1", "cn2", l),
  54264. t("cn3", "cn4", l),
  54265. t("cf1", "cf2", l),
  54266. t("cf3", "cf4", l),
  54267. Ci.LineSegments.call(this, i, r),
  54268. this.camera = e,
  54269. this.camera.updateProjectionMatrix(),
  54270. this.matrix = e.matrixWorld,
  54271. this.matrixAutoUpdate = !1,
  54272. this.pointMap = o,
  54273. this.update()
  54274. }
  54275. ,
  54276. Ci.CameraHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54277. Ci.CameraHelper.prototype.constructor = Ci.CameraHelper,
  54278. Ci.CameraHelper.prototype.update = (gi = new Ci.Vector3,
  54279. mi = new Ci.Camera,
  54280. function() {
  54281. pi = this.geometry,
  54282. fi = this.pointMap,
  54283. mi.projectionMatrix.copy(this.camera.projectionMatrix),
  54284. Ni("c", 0, 0, -1),
  54285. Ni("t", 0, 0, 1),
  54286. Ni("n1", -1, -1, -1),
  54287. Ni("n2", 1, -1, -1),
  54288. Ni("n3", -1, 1, -1),
  54289. Ni("n4", 1, 1, -1),
  54290. Ni("f1", -1, -1, 1),
  54291. Ni("f2", 1, -1, 1),
  54292. Ni("f3", -1, 1, 1),
  54293. Ni("f4", 1, 1, 1),
  54294. Ni("u1", .7, 1.1, -1),
  54295. Ni("u2", -.7, 1.1, -1),
  54296. Ni("u3", 0, 2, -1),
  54297. Ni("cf1", -1, 0, 1),
  54298. Ni("cf2", 1, 0, 1),
  54299. Ni("cf3", 0, -1, 1),
  54300. Ni("cf4", 0, 1, 1),
  54301. Ni("cn1", -1, 0, -1),
  54302. Ni("cn2", 1, 0, -1),
  54303. Ni("cn3", 0, -1, -1),
  54304. Ni("cn4", 0, 1, -1),
  54305. pi.verticesNeedUpdate = !0
  54306. }
  54307. ),
  54308. Ci.DirectionalLightHelper = function(e, t) {
  54309. Ci.Object3D.call(this),
  54310. this.light = e,
  54311. this.light.updateMatrixWorld(),
  54312. this.matrix = e.matrixWorld,
  54313. this.matrixAutoUpdate = !1,
  54314. t = t || 1;
  54315. var i = new Ci.Geometry;
  54316. 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));
  54317. var n = new Ci.LineBasicMaterial({
  54318. fog: !1
  54319. });
  54320. n.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54321. this.lightPlane = new Ci.Line(i,n),
  54322. this.add(this.lightPlane),
  54323. (i = new Ci.Geometry).vertices.push(new Ci.Vector3, new Ci.Vector3),
  54324. (n = new Ci.LineBasicMaterial({
  54325. fog: !1
  54326. })).color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54327. this.targetLine = new Ci.Line(i,n),
  54328. this.add(this.targetLine),
  54329. this.update()
  54330. }
  54331. ,
  54332. Ci.DirectionalLightHelper.prototype = Object.create(Ci.Object3D.prototype),
  54333. Ci.DirectionalLightHelper.prototype.constructor = Ci.DirectionalLightHelper,
  54334. Ci.DirectionalLightHelper.prototype.dispose = function() {
  54335. this.lightPlane.geometry.dispose(),
  54336. this.lightPlane.material.dispose(),
  54337. this.targetLine.geometry.dispose(),
  54338. this.targetLine.material.dispose()
  54339. }
  54340. ,
  54341. Ci.DirectionalLightHelper.prototype.update = (hi = new Ci.Vector3,
  54342. ui = new Ci.Vector3,
  54343. di = new Ci.Vector3,
  54344. function() {
  54345. hi.setFromMatrixPosition(this.light.matrixWorld),
  54346. ui.setFromMatrixPosition(this.light.target.matrixWorld),
  54347. di.subVectors(ui, hi),
  54348. this.lightPlane.lookAt(di),
  54349. this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54350. this.targetLine.geometry.vertices[1].copy(di),
  54351. this.targetLine.geometry.verticesNeedUpdate = !0,
  54352. this.targetLine.material.color.copy(this.lightPlane.material.color)
  54353. }
  54354. ),
  54355. Ci.EdgesHelper = function(e, t, i) {
  54356. var n = void 0 !== t ? t : 16777215;
  54357. Ci.LineSegments.call(this, new Ci.EdgesGeometry(e.geometry,i), new Ci.LineBasicMaterial({
  54358. color: n
  54359. })),
  54360. this.matrix = e.matrixWorld,
  54361. this.matrixAutoUpdate = !1
  54362. }
  54363. ,
  54364. Ci.EdgesHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54365. Ci.EdgesHelper.prototype.constructor = Ci.EdgesHelper,
  54366. Ci.FaceNormalsHelper = function(e, t, i, n) {
  54367. this.object = e,
  54368. this.size = void 0 !== t ? t : 1;
  54369. var r = void 0 !== i ? i : 16776960
  54370. , o = void 0 !== n ? n : 1
  54371. , a = 0
  54372. , s = this.object.geometry;
  54373. s instanceof Ci.Geometry ? a = s.faces.length : console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");
  54374. var l = new Ci.BufferGeometry
  54375. , c = new Ci.Float32Attribute(2 * a * 3,3);
  54376. l.addAttribute("position", c),
  54377. Ci.LineSegments.call(this, l, new Ci.LineBasicMaterial({
  54378. color: r,
  54379. linewidth: o
  54380. })),
  54381. this.matrixAutoUpdate = !1,
  54382. this.update()
  54383. }
  54384. ,
  54385. Ci.FaceNormalsHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54386. Ci.FaceNormalsHelper.prototype.constructor = Ci.FaceNormalsHelper,
  54387. Ci.FaceNormalsHelper.prototype.update = (si = new Ci.Vector3,
  54388. li = new Ci.Vector3,
  54389. ci = new Ci.Matrix3,
  54390. function() {
  54391. this.object.updateMatrixWorld(!0),
  54392. ci.getNormalMatrix(this.object.matrixWorld);
  54393. 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++) {
  54394. var l = r[a]
  54395. , c = l.normal;
  54396. si.copy(n[l.a]).add(n[l.b]).add(n[l.c]).divideScalar(3).applyMatrix4(e),
  54397. li.copy(c).applyMatrix3(ci).normalize().multiplyScalar(this.size).add(si),
  54398. t.setXYZ(o, si.x, si.y, si.z),
  54399. o += 1,
  54400. t.setXYZ(o, li.x, li.y, li.z),
  54401. o += 1
  54402. }
  54403. return t.needsUpdate = !0,
  54404. this
  54405. }
  54406. ),
  54407. Ci.GridHelper = function(e, t) {
  54408. var i = new Ci.Geometry
  54409. , n = new Ci.LineBasicMaterial({
  54410. vertexColors: Ci.VertexColors
  54411. });
  54412. this.color1 = new Ci.Color(4473924),
  54413. this.color2 = new Ci.Color(8947848);
  54414. for (var r = -e; r <= e; r += t) {
  54415. 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));
  54416. var o = 0 === r ? this.color1 : this.color2;
  54417. i.colors.push(o, o, o, o)
  54418. }
  54419. Ci.LineSegments.call(this, i, n)
  54420. }
  54421. ,
  54422. Ci.GridHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54423. Ci.GridHelper.prototype.constructor = Ci.GridHelper,
  54424. Ci.GridHelper.prototype.setColors = function(e, t) {
  54425. this.color1.set(e),
  54426. this.color2.set(t),
  54427. this.geometry.colorsNeedUpdate = !0
  54428. }
  54429. ,
  54430. Ci.HemisphereLightHelper = function(e, t) {
  54431. Ci.Object3D.call(this),
  54432. this.light = e,
  54433. this.light.updateMatrixWorld(),
  54434. this.matrix = e.matrixWorld,
  54435. this.matrixAutoUpdate = !1,
  54436. this.colors = [new Ci.Color, new Ci.Color];
  54437. var i = new Ci.SphereGeometry(t,4,2);
  54438. i.rotateX(-Math.PI / 2);
  54439. for (var n = 0; n < 8; n++)
  54440. i.faces[n].color = this.colors[n < 4 ? 0 : 1];
  54441. var r = new Ci.MeshBasicMaterial({
  54442. vertexColors: Ci.FaceColors,
  54443. wireframe: !0
  54444. });
  54445. this.lightSphere = new Ci.Mesh(i,r),
  54446. this.add(this.lightSphere),
  54447. this.update()
  54448. }
  54449. ,
  54450. Ci.HemisphereLightHelper.prototype = Object.create(Ci.Object3D.prototype),
  54451. Ci.HemisphereLightHelper.prototype.constructor = Ci.HemisphereLightHelper,
  54452. Ci.HemisphereLightHelper.prototype.dispose = function() {
  54453. this.lightSphere.geometry.dispose(),
  54454. this.lightSphere.material.dispose()
  54455. }
  54456. ,
  54457. Ci.HemisphereLightHelper.prototype.update = (ai = new Ci.Vector3,
  54458. function() {
  54459. this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity),
  54460. this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity),
  54461. this.lightSphere.lookAt(ai.setFromMatrixPosition(this.light.matrixWorld).negate()),
  54462. this.lightSphere.geometry.colorsNeedUpdate = !0
  54463. }
  54464. ),
  54465. Ci.PointLightHelper = function(e, t) {
  54466. this.light = e,
  54467. this.light.updateMatrixWorld();
  54468. var i = new Ci.SphereGeometry(t,4,2)
  54469. , n = new Ci.MeshBasicMaterial({
  54470. wireframe: !0,
  54471. fog: !1
  54472. });
  54473. n.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54474. Ci.Mesh.call(this, i, n),
  54475. this.matrix = this.light.matrixWorld,
  54476. this.matrixAutoUpdate = !1
  54477. }
  54478. ,
  54479. Ci.PointLightHelper.prototype = Object.create(Ci.Mesh.prototype),
  54480. Ci.PointLightHelper.prototype.constructor = Ci.PointLightHelper,
  54481. Ci.PointLightHelper.prototype.dispose = function() {
  54482. this.geometry.dispose(),
  54483. this.material.dispose()
  54484. }
  54485. ,
  54486. Ci.PointLightHelper.prototype.update = function() {
  54487. this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  54488. }
  54489. ,
  54490. Ci.SkeletonHelper = function(e) {
  54491. this.bones = this.getBoneList(e);
  54492. for (var t = new Ci.Geometry, i = 0; i < this.bones.length; i++) {
  54493. this.bones[i].parent instanceof Ci.Bone && (t.vertices.push(new Ci.Vector3),
  54494. t.vertices.push(new Ci.Vector3),
  54495. t.colors.push(new Ci.Color(0,0,1)),
  54496. t.colors.push(new Ci.Color(0,1,0)))
  54497. }
  54498. t.dynamic = !0;
  54499. var n = new Ci.LineBasicMaterial({
  54500. vertexColors: Ci.VertexColors,
  54501. depthTest: !1,
  54502. depthWrite: !1,
  54503. transparent: !0
  54504. });
  54505. Ci.LineSegments.call(this, t, n),
  54506. this.root = e,
  54507. this.matrix = e.matrixWorld,
  54508. this.matrixAutoUpdate = !1,
  54509. this.update()
  54510. }
  54511. ,
  54512. Ci.SkeletonHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54513. Ci.SkeletonHelper.prototype.constructor = Ci.SkeletonHelper,
  54514. Ci.SkeletonHelper.prototype.getBoneList = function(e) {
  54515. var t = [];
  54516. e instanceof Ci.Bone && t.push(e);
  54517. for (var i = 0; i < e.children.length; i++)
  54518. t.push.apply(t, this.getBoneList(e.children[i]));
  54519. return t
  54520. }
  54521. ,
  54522. Ci.SkeletonHelper.prototype.update = function() {
  54523. 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++) {
  54524. var o = this.bones[r];
  54525. o.parent instanceof Ci.Bone && (i.multiplyMatrices(t, o.matrixWorld),
  54526. e.vertices[n].setFromMatrixPosition(i),
  54527. i.multiplyMatrices(t, o.parent.matrixWorld),
  54528. e.vertices[n + 1].setFromMatrixPosition(i),
  54529. n += 2)
  54530. }
  54531. e.verticesNeedUpdate = !0,
  54532. e.computeBoundingSphere()
  54533. }
  54534. ,
  54535. Ci.SpotLightHelper = function(e) {
  54536. Ci.Object3D.call(this),
  54537. this.light = e,
  54538. this.light.updateMatrixWorld(),
  54539. this.matrix = e.matrixWorld,
  54540. this.matrixAutoUpdate = !1;
  54541. var t = new Ci.CylinderGeometry(0,1,1,8,1,!0);
  54542. t.translate(0, -.5, 0),
  54543. t.rotateX(-Math.PI / 2);
  54544. var i = new Ci.MeshBasicMaterial({
  54545. wireframe: !0,
  54546. fog: !1
  54547. });
  54548. this.cone = new Ci.Mesh(t,i),
  54549. this.add(this.cone),
  54550. this.update()
  54551. }
  54552. ,
  54553. Ci.SpotLightHelper.prototype = Object.create(Ci.Object3D.prototype),
  54554. Ci.SpotLightHelper.prototype.constructor = Ci.SpotLightHelper,
  54555. Ci.SpotLightHelper.prototype.dispose = function() {
  54556. this.cone.geometry.dispose(),
  54557. this.cone.material.dispose()
  54558. }
  54559. ,
  54560. Ci.SpotLightHelper.prototype.update = (ri = new Ci.Vector3,
  54561. oi = new Ci.Vector3,
  54562. function() {
  54563. var e = this.light.distance ? this.light.distance : 1e4
  54564. , t = e * Math.tan(this.light.angle);
  54565. this.cone.scale.set(t, t, e),
  54566. ri.setFromMatrixPosition(this.light.matrixWorld),
  54567. oi.setFromMatrixPosition(this.light.target.matrixWorld),
  54568. this.cone.lookAt(oi.sub(ri)),
  54569. this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  54570. }
  54571. ),
  54572. Ci.VertexNormalsHelper = function(e, t, i, n) {
  54573. this.object = e,
  54574. this.size = void 0 !== t ? t : 1;
  54575. var r = void 0 !== i ? i : 16711680
  54576. , o = void 0 !== n ? n : 1
  54577. , a = 0
  54578. , s = this.object.geometry;
  54579. s instanceof Ci.Geometry ? a = 3 * s.faces.length : s instanceof Ci.BufferGeometry && (a = s.attributes.normal.count);
  54580. var l = new Ci.BufferGeometry
  54581. , c = new Ci.Float32Attribute(2 * a * 3,3);
  54582. l.addAttribute("position", c),
  54583. Ci.LineSegments.call(this, l, new Ci.LineBasicMaterial({
  54584. color: r,
  54585. linewidth: o
  54586. })),
  54587. this.matrixAutoUpdate = !1,
  54588. this.update()
  54589. }
  54590. ,
  54591. Ci.VertexNormalsHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54592. Ci.VertexNormalsHelper.prototype.constructor = Ci.VertexNormalsHelper,
  54593. Ci.VertexNormalsHelper.prototype.update = (ti = new Ci.Vector3,
  54594. ii = new Ci.Vector3,
  54595. ni = new Ci.Matrix3,
  54596. function() {
  54597. var e = ["a", "b", "c"];
  54598. this.object.updateMatrixWorld(!0),
  54599. ni.getNormalMatrix(this.object.matrixWorld);
  54600. var t = this.object.matrixWorld
  54601. , i = this.geometry.attributes.position
  54602. , n = this.object.geometry;
  54603. if (n instanceof Ci.Geometry)
  54604. for (var r = n.vertices, o = n.faces, a = 0, s = 0, l = o.length; s < l; s++)
  54605. for (var c = o[s], h = 0, u = c.vertexNormals.length; h < u; h++) {
  54606. var d = r[c[e[h]]]
  54607. , p = c.vertexNormals[h];
  54608. ti.copy(d).applyMatrix4(t),
  54609. ii.copy(p).applyMatrix3(ni).normalize().multiplyScalar(this.size).add(ti),
  54610. i.setXYZ(a, ti.x, ti.y, ti.z),
  54611. a += 1,
  54612. i.setXYZ(a, ii.x, ii.y, ii.z),
  54613. a += 1
  54614. }
  54615. else if (n instanceof Ci.BufferGeometry) {
  54616. var f = n.attributes.position
  54617. , g = n.attributes.normal;
  54618. for (h = a = 0,
  54619. u = f.count; h < u; h++)
  54620. ti.set(f.getX(h), f.getY(h), f.getZ(h)).applyMatrix4(t),
  54621. ii.set(g.getX(h), g.getY(h), g.getZ(h)),
  54622. ii.applyMatrix3(ni).normalize().multiplyScalar(this.size).add(ti),
  54623. i.setXYZ(a, ti.x, ti.y, ti.z),
  54624. a += 1,
  54625. i.setXYZ(a, ii.x, ii.y, ii.z),
  54626. a += 1
  54627. }
  54628. return i.needsUpdate = !0,
  54629. this
  54630. }
  54631. ),
  54632. Ci.WireframeHelper = function(e, t) {
  54633. var i = void 0 !== t ? t : 16777215;
  54634. Ci.LineSegments.call(this, new Ci.WireframeGeometry(e.geometry), new Ci.LineBasicMaterial({
  54635. color: i
  54636. })),
  54637. this.matrix = e.matrixWorld,
  54638. this.matrixAutoUpdate = !1
  54639. }
  54640. ,
  54641. Ci.WireframeHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54642. Ci.WireframeHelper.prototype.constructor = Ci.WireframeHelper,
  54643. Ci.ImmediateRenderObject = function(e) {
  54644. Ci.Object3D.call(this),
  54645. this.material = e,
  54646. this.render = function(e) {}
  54647. }
  54648. ,
  54649. Ci.ImmediateRenderObject.prototype = Object.create(Ci.Object3D.prototype),
  54650. Ci.ImmediateRenderObject.prototype.constructor = Ci.ImmediateRenderObject,
  54651. Ci.MorphBlendMesh = function(e, t) {
  54652. Ci.Mesh.call(this, e, t),
  54653. this.animationsMap = {},
  54654. this.animationsList = [];
  54655. var i = this.geometry.morphTargets.length
  54656. , n = i - 1
  54657. , r = i / 1;
  54658. this.createAnimation("__default", 0, n, r),
  54659. this.setAnimationWeight("__default", 1)
  54660. }
  54661. ,
  54662. Ci.MorphBlendMesh.prototype = Object.create(Ci.Mesh.prototype),
  54663. Ci.MorphBlendMesh.prototype.constructor = Ci.MorphBlendMesh,
  54664. Ci.MorphBlendMesh.prototype.createAnimation = function(e, t, i, n) {
  54665. var r = {
  54666. start: t,
  54667. end: i,
  54668. length: i - t + 1,
  54669. fps: n,
  54670. duration: (i - t) / n,
  54671. lastFrame: 0,
  54672. currentFrame: 0,
  54673. active: !1,
  54674. time: 0,
  54675. direction: 1,
  54676. weight: 1,
  54677. directionBackwards: !1,
  54678. mirroredLoop: !1
  54679. };
  54680. this.animationsMap[e] = r,
  54681. this.animationsList.push(r)
  54682. }
  54683. ,
  54684. Ci.MorphBlendMesh.prototype.autoCreateAnimations = function(e) {
  54685. for (var t, i = /([a-z]+)_?(\d+)/i, n = {}, r = this.geometry, o = 0, a = r.morphTargets.length; o < a; o++) {
  54686. var s = r.morphTargets[o].name.match(i);
  54687. if (s && 1 < s.length)
  54688. n[l = s[1]] || (n[l] = {
  54689. start: 1 / 0,
  54690. end: -1 / 0
  54691. }),
  54692. o < (c = n[l]).start && (c.start = o),
  54693. o > c.end && (c.end = o),
  54694. t = t || l
  54695. }
  54696. for (var l in n) {
  54697. var c = n[l];
  54698. this.createAnimation(l, c.start, c.end, e)
  54699. }
  54700. this.firstAnimation = t
  54701. }
  54702. ,
  54703. Ci.MorphBlendMesh.prototype.setAnimationDirectionForward = function(e) {
  54704. var t = this.animationsMap[e];
  54705. t && (t.direction = 1,
  54706. t.directionBackwards = !1)
  54707. }
  54708. ,
  54709. Ci.MorphBlendMesh.prototype.setAnimationDirectionBackward = function(e) {
  54710. var t = this.animationsMap[e];
  54711. t && (t.direction = -1,
  54712. t.directionBackwards = !0)
  54713. }
  54714. ,
  54715. Ci.MorphBlendMesh.prototype.setAnimationFPS = function(e, t) {
  54716. var i = this.animationsMap[e];
  54717. i && (i.fps = t,
  54718. i.duration = (i.end - i.start) / i.fps)
  54719. }
  54720. ,
  54721. Ci.MorphBlendMesh.prototype.setAnimationDuration = function(e, t) {
  54722. var i = this.animationsMap[e];
  54723. i && (i.duration = t,
  54724. i.fps = (i.end - i.start) / i.duration)
  54725. }
  54726. ,
  54727. Ci.MorphBlendMesh.prototype.setAnimationWeight = function(e, t) {
  54728. var i = this.animationsMap[e];
  54729. i && (i.weight = t)
  54730. }
  54731. ,
  54732. Ci.MorphBlendMesh.prototype.setAnimationTime = function(e, t) {
  54733. var i = this.animationsMap[e];
  54734. i && (i.time = t)
  54735. }
  54736. ,
  54737. Ci.MorphBlendMesh.prototype.getAnimationTime = function(e) {
  54738. var t = 0
  54739. , i = this.animationsMap[e];
  54740. return i && (t = i.time),
  54741. t
  54742. }
  54743. ,
  54744. Ci.MorphBlendMesh.prototype.getAnimationDuration = function(e) {
  54745. var t = -1
  54746. , i = this.animationsMap[e];
  54747. return i && (t = i.duration),
  54748. t
  54749. }
  54750. ,
  54751. Ci.MorphBlendMesh.prototype.playAnimation = function(e) {
  54752. var t = this.animationsMap[e];
  54753. t ? (t.time = 0,
  54754. t.active = !0) : console.warn("THREE.MorphBlendMesh: animation[" + e + "] undefined in .playAnimation()")
  54755. }
  54756. ,
  54757. Ci.MorphBlendMesh.prototype.stopAnimation = function(e) {
  54758. var t = this.animationsMap[e];
  54759. t && (t.active = !1)
  54760. }
  54761. ,
  54762. Ci.MorphBlendMesh.prototype.update = function(e) {
  54763. for (var t = 0, i = this.animationsList.length; t < i; t++) {
  54764. var n = this.animationsList[t];
  54765. if (n.active) {
  54766. var r = n.duration / n.length;
  54767. n.time += n.direction * e,
  54768. n.mirroredLoop ? (n.time > n.duration || n.time < 0) && (n.direction *= -1,
  54769. n.time > n.duration && (n.time = n.duration,
  54770. n.directionBackwards = !0),
  54771. n.time < 0 && (n.time = 0,
  54772. n.directionBackwards = !1)) : (n.time = n.time % n.duration,
  54773. n.time < 0 && (n.time += n.duration));
  54774. var o = n.start + Ci.Math.clamp(Math.floor(n.time / r), 0, n.length - 1)
  54775. , a = n.weight;
  54776. o !== n.currentFrame && (this.morphTargetInfluences[n.lastFrame] = 0,
  54777. this.morphTargetInfluences[n.currentFrame] = 1 * a,
  54778. this.morphTargetInfluences[o] = 0,
  54779. n.lastFrame = n.currentFrame,
  54780. n.currentFrame = o);
  54781. var s = n.time % r / r;
  54782. n.directionBackwards && (s = 1 - s),
  54783. n.currentFrame !== n.lastFrame ? (this.morphTargetInfluences[n.currentFrame] = s * a,
  54784. this.morphTargetInfluences[n.lastFrame] = (1 - s) * a) : this.morphTargetInfluences[n.currentFrame] = a
  54785. }
  54786. }
  54787. }
  54788. ,
  54789. void 0 !== i ? (void 0 !== t && t.exports && (i = t.exports = Ci),
  54790. i.THREE = Ci) : this.THREE = Ci
  54791. }
  54792. , {}]
  54793. }, {}, [116]);